fluentui-apple
fluentui-apple copied to clipboard
Add SwiftUI PillButton
Platforms Impacted
- [x] iOS
- [x] visionOS
- [ ] macOS
Description of changes
This PR implements a new SwiftUI PillButtonView.
- The new SwiftUI pill button adds support for a leading image icon as defined in the Fluent 2 designs.
- The
PillButtonViewuses the existingPillButtonTokenSetand adds the necessary tokens for the leading icon and the unread dot offset values. - The new pill button uses a
PillButtonViewStylewhich is used to configure the button based on its style and tokens. - The
PillButtonViewis initialized with aPillButtonViewModelwhich is the observable class used to track the unread dot and leading image states.
Binary change
TBD
Verification
- Visual verification on iPhone and Vision Pro.
- Used the accessibility inspector to VoiceOver, accessibility labels and traits.
Visual Verification
iPhone
| Standard | Unread dot | Icon | Icon + unread dot |
|---|---|---|---|
| Action | Large text | Focus ring |
|---|---|---|
Vision Pro
| Standard | Unread dot | Icon | Icon + unread dot |
|---|---|---|---|
Pull request checklist
This PR has considered:
- [x] Light and Dark appearances
- [ ] iOS supported versions (all major versions greater than or equal current target deployment version)
- [x] VoiceOver and Keyboard Accessibility
- [x] Internationalization and Right to Left layouts
- [ ] Different resolutions (1x, 2x, 3x)
- [x] Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
- [ ] iPad Pointer interaction
- [x] SwiftUI consumption (validation or new demo scenarios needed)
- [ ] Objective-C exposure (provide it only if needed)