Skip to content

Commit 1ce0e2d

Browse files
feat(spinner): add recipe and tokens (#31014)
Issue number: internal Co-authored-by: Brandy Smith <6577830+brandyscarney@users.noreply.github.com>
1 parent 55cac74 commit 1ce0e2d

File tree

63 files changed

+1085
-499
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1085
-499
lines changed

BREAKING.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ This is a comprehensive list of the breaking changes introduced in the major ver
1919
- [Card](#version-9x-card)
2020
- [Chip](#version-9x-chip)
2121
- [Grid](#version-9x-grid)
22+
- [Spinner](#version-9x-spinner)
2223

2324
<h2 id="version-9x-components">Components</h2>
2425

@@ -32,7 +33,14 @@ This is a comprehensive list of the breaking changes introduced in the major ver
3233

3334
<h4 id="version-9x-chip">Chip</h4>
3435

35-
- The `border-radius` of the `ios` and `md` chip now defaults to `10px` and `8px`, respectively, instead of `16px` in accordance with the iOS and Material Design 3 guidelines. To revert to the previous appearance, set the `shape` to `"round"`, or override the `--border-radius` CSS variable to specify a different value.
36+
- Component CSS variables have been removed. The component now utilizes the centralized Ionic Theming system. Global updates should be managed via the theme tokens file, while component-specific overrides are handled through localized CSS variables.
37+
- `--color` is replaced by `IonChip.hue.bold.solid.default` for global styles and `--ion-chip-hue-bold-solid-default-color` for component-specific styles if the chip has a bold hue and solid fill.
38+
- `--color` is replaced by `IonChip.hue.bold.outline.default` for global styles and `--ion-chip-hue-bold-outline-default-color` for component-specific styles if the chip has a bold hue and outline fill.
39+
- `--color` is replaced by `IonChip.hue.subtle.solid.default` for global styles and `--ion-chip-hue-subtle-solid-default-color` for component-specific styles if the chip has a subtle hue and solid fill.
40+
- `--color` is replaced by `IonChip.hue.subtle.outline.default` for global styles and `--ion-chip-hue-subtle-outline-default-color` for component-specific styles if the chip has a subtle hue and outline fill.
41+
- The `outline` property has been deprecated. To achieve an outlined chip, set the `fill` property to `"outline"`. The class `.chip-outline` has also been updated to `.chip-fill-outline` for clarity.
42+
- Specific theme classes (e.g., `ion-chip.md`) are no longer supported. Style modifications based on the active theme must be implemented using theme tokens rather than direct class targeting.
43+
- The `border-radius` of the `ios` and `md` chip now defaults to `10px` and `8px`, respectively, instead of `16px` in accordance with the iOS and Material Design 3 guidelines. To revert to the previous appearance, set the `shape` to `"round"`, or override the `IonChip.shape.round.border.radius` to specify a different value for global styles and `--ion-chip-shape-round-border-radius` for component-specific styles.
3644

3745
<h4 id="version-9x-grid">Grid</h4>
3846

@@ -140,4 +148,13 @@ To reorder two columns where column 1 has `size="9" push="3"` and column 2 has `
140148
</ion-col>
141149
</ion-row>
142150
</ion-grid>
143-
```
151+
```
152+
153+
<h4 id="version-9x-spinner">Spinner</h4>
154+
155+
- Component CSS variables have been removed. The component now utilizes the centralized Ionic Theming system. Global updates should be managed via the theme tokens file, while component-specific overrides are handled through localized CSS variables.
156+
- `--color` is replaced by `IonSpinner.color` for global styles and
157+
`--ion-spinner-color` for component-specific styles.
158+
- CSS classes now include the property name to improve clarity.
159+
- `.spinner-[spinner-name]``.spinner-name-[spinner-name]`
160+
- Specific theme classes (e.g., `ion-spinner.md`) are no longer supported. Style modifications based on the active theme must be implemented using theme tokens rather than direct class targeting.

core/api.txt

Lines changed: 113 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -602,11 +602,101 @@ ion-chip,prop,mode,"ios" | "md",undefined,false,false
602602
ion-chip,prop,outline,boolean,false,false,false
603603
ion-chip,prop,shape,"rectangular" | "round" | "soft" | undefined,undefined,false,false
604604
ion-chip,prop,size,"large" | "small" | undefined,undefined,false,false
605-
ion-chip,css-prop,--border-radius
606-
ion-chip,css-prop,--color
607-
ion-chip,css-prop,--focus-ring-color
608-
ion-chip,css-prop,--focus-ring-style
609-
ion-chip,css-prop,--focus-ring-width
605+
ion-chip,css-prop,--ion-chip-avatar-height
606+
ion-chip,css-prop,--ion-chip-avatar-leading-margin-bottom
607+
ion-chip,css-prop,--ion-chip-avatar-leading-margin-end
608+
ion-chip,css-prop,--ion-chip-avatar-leading-margin-start
609+
ion-chip,css-prop,--ion-chip-avatar-leading-margin-top
610+
ion-chip,css-prop,--ion-chip-avatar-trailing-margin-bottom
611+
ion-chip,css-prop,--ion-chip-avatar-trailing-margin-end
612+
ion-chip,css-prop,--ion-chip-avatar-trailing-margin-start
613+
ion-chip,css-prop,--ion-chip-avatar-trailing-margin-top
614+
ion-chip,css-prop,--ion-chip-avatar-width
615+
ion-chip,css-prop,--ion-chip-font-weight
616+
ion-chip,css-prop,--ion-chip-gap
617+
ion-chip,css-prop,--ion-chip-hue-bold-outline-activated-background
618+
ion-chip,css-prop,--ion-chip-hue-bold-outline-default-background
619+
ion-chip,css-prop,--ion-chip-hue-bold-outline-default-border-color
620+
ion-chip,css-prop,--ion-chip-hue-bold-outline-default-border-style
621+
ion-chip,css-prop,--ion-chip-hue-bold-outline-default-border-width
622+
ion-chip,css-prop,--ion-chip-hue-bold-outline-default-color
623+
ion-chip,css-prop,--ion-chip-hue-bold-outline-focus-background
624+
ion-chip,css-prop,--ion-chip-hue-bold-outline-hover-background
625+
ion-chip,css-prop,--ion-chip-hue-bold-outline-semantic-activated-background
626+
ion-chip,css-prop,--ion-chip-hue-bold-outline-semantic-default-background
627+
ion-chip,css-prop,--ion-chip-hue-bold-outline-semantic-default-border-color
628+
ion-chip,css-prop,--ion-chip-hue-bold-outline-semantic-default-border-style
629+
ion-chip,css-prop,--ion-chip-hue-bold-outline-semantic-default-border-width
630+
ion-chip,css-prop,--ion-chip-hue-bold-outline-semantic-default-color
631+
ion-chip,css-prop,--ion-chip-hue-bold-outline-semantic-focus-background
632+
ion-chip,css-prop,--ion-chip-hue-bold-outline-semantic-hover-background
633+
ion-chip,css-prop,--ion-chip-hue-bold-solid-activated-background
634+
ion-chip,css-prop,--ion-chip-hue-bold-solid-default-background
635+
ion-chip,css-prop,--ion-chip-hue-bold-solid-default-color
636+
ion-chip,css-prop,--ion-chip-hue-bold-solid-focus-background
637+
ion-chip,css-prop,--ion-chip-hue-bold-solid-hover-background
638+
ion-chip,css-prop,--ion-chip-hue-bold-solid-semantic-activated-background
639+
ion-chip,css-prop,--ion-chip-hue-bold-solid-semantic-default-background
640+
ion-chip,css-prop,--ion-chip-hue-bold-solid-semantic-default-color
641+
ion-chip,css-prop,--ion-chip-hue-bold-solid-semantic-focus-background
642+
ion-chip,css-prop,--ion-chip-hue-bold-solid-semantic-hover-background
643+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-activated-background
644+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-default-background
645+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-default-border-color
646+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-default-border-style
647+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-default-border-width
648+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-default-color
649+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-focus-background
650+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-hover-background
651+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-semantic-activated-background
652+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-semantic-default-background
653+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-semantic-default-border-color
654+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-semantic-default-border-style
655+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-semantic-default-border-width
656+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-semantic-default-color
657+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-semantic-focus-background
658+
ion-chip,css-prop,--ion-chip-hue-subtle-outline-semantic-hover-background
659+
ion-chip,css-prop,--ion-chip-hue-subtle-solid-activated-background
660+
ion-chip,css-prop,--ion-chip-hue-subtle-solid-default-background
661+
ion-chip,css-prop,--ion-chip-hue-subtle-solid-default-color
662+
ion-chip,css-prop,--ion-chip-hue-subtle-solid-focus-background
663+
ion-chip,css-prop,--ion-chip-hue-subtle-solid-hover-background
664+
ion-chip,css-prop,--ion-chip-hue-subtle-solid-semantic-activated-background
665+
ion-chip,css-prop,--ion-chip-hue-subtle-solid-semantic-default-background
666+
ion-chip,css-prop,--ion-chip-hue-subtle-solid-semantic-default-color
667+
ion-chip,css-prop,--ion-chip-hue-subtle-solid-semantic-focus-background
668+
ion-chip,css-prop,--ion-chip-hue-subtle-solid-semantic-hover-background
669+
ion-chip,css-prop,--ion-chip-icon-color
670+
ion-chip,css-prop,--ion-chip-icon-font-size
671+
ion-chip,css-prop,--ion-chip-icon-leading-margin-bottom
672+
ion-chip,css-prop,--ion-chip-icon-leading-margin-end
673+
ion-chip,css-prop,--ion-chip-icon-leading-margin-start
674+
ion-chip,css-prop,--ion-chip-icon-leading-margin-top
675+
ion-chip,css-prop,--ion-chip-icon-trailing-margin-bottom
676+
ion-chip,css-prop,--ion-chip-icon-trailing-margin-end
677+
ion-chip,css-prop,--ion-chip-icon-trailing-margin-start
678+
ion-chip,css-prop,--ion-chip-icon-trailing-margin-top
679+
ion-chip,css-prop,--ion-chip-letter-spacing
680+
ion-chip,css-prop,--ion-chip-line-height
681+
ion-chip,css-prop,--ion-chip-margin-bottom
682+
ion-chip,css-prop,--ion-chip-margin-end
683+
ion-chip,css-prop,--ion-chip-margin-start
684+
ion-chip,css-prop,--ion-chip-margin-top
685+
ion-chip,css-prop,--ion-chip-padding-bottom
686+
ion-chip,css-prop,--ion-chip-padding-end
687+
ion-chip,css-prop,--ion-chip-padding-start
688+
ion-chip,css-prop,--ion-chip-padding-top
689+
ion-chip,css-prop,--ion-chip-shape-rectangular-border-radius
690+
ion-chip,css-prop,--ion-chip-shape-round-border-radius
691+
ion-chip,css-prop,--ion-chip-shape-soft-border-radius
692+
ion-chip,css-prop,--ion-chip-size-large-font-size
693+
ion-chip,css-prop,--ion-chip-size-large-min-height
694+
ion-chip,css-prop,--ion-chip-size-small-font-size
695+
ion-chip,css-prop,--ion-chip-size-small-min-height
696+
ion-chip,css-prop,--ion-chip-state-disabled-opacity
697+
ion-chip,css-prop,--ion-chip-state-focus-ring-color
698+
ion-chip,css-prop,--ion-chip-state-focus-ring-style
699+
ion-chip,css-prop,--ion-chip-state-focus-ring-width
610700

611701
ion-col,shadow
612702
ion-col,prop,mode,"ios" | "md",undefined,false,false
@@ -2309,10 +2399,24 @@ ion-spinner,prop,mode,"ios" | "md",undefined,false,false
23092399
ion-spinner,prop,name,"bubbles" | "circles" | "circular" | "crescent" | "dots" | "lines" | "lines-sharp" | "lines-sharp-small" | "lines-small" | undefined,undefined,false,false
23102400
ion-spinner,prop,paused,boolean,false,false,false
23112401
ion-spinner,prop,size,"large" | "medium" | "small" | "xlarge" | "xsmall" | undefined,undefined,false,false
2312-
ion-spinner,prop,theme,"ios" | "md" | "ionic",undefined,false,false
2313-
ion-spinner,css-prop,--color,ionic
2314-
ion-spinner,css-prop,--color,ios
2315-
ion-spinner,css-prop,--color,md
2402+
ion-spinner,css-prop,--ion-spinner-circular-stroke-width
2403+
ion-spinner,css-prop,--ion-spinner-color
2404+
ion-spinner,css-prop,--ion-spinner-crescent-stroke-width
2405+
ion-spinner,css-prop,--ion-spinner-dots-stroke-width
2406+
ion-spinner,css-prop,--ion-spinner-lines-sharp-small-stroke-width
2407+
ion-spinner,css-prop,--ion-spinner-lines-sharp-stroke-width
2408+
ion-spinner,css-prop,--ion-spinner-lines-small-stroke-width
2409+
ion-spinner,css-prop,--ion-spinner-lines-stroke-width
2410+
ion-spinner,css-prop,--ion-spinner-size-large-height
2411+
ion-spinner,css-prop,--ion-spinner-size-large-width
2412+
ion-spinner,css-prop,--ion-spinner-size-medium-height
2413+
ion-spinner,css-prop,--ion-spinner-size-medium-width
2414+
ion-spinner,css-prop,--ion-spinner-size-small-height
2415+
ion-spinner,css-prop,--ion-spinner-size-small-width
2416+
ion-spinner,css-prop,--ion-spinner-size-xlarge-height
2417+
ion-spinner,css-prop,--ion-spinner-size-xlarge-width
2418+
ion-spinner,css-prop,--ion-spinner-size-xsmall-height
2419+
ion-spinner,css-prop,--ion-spinner-size-xsmall-width
23162420

23172421
ion-split-pane,shadow
23182422
ion-split-pane,prop,contentId,string | undefined,undefined,false,true

core/src/components.d.ts

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { SegmentViewScrollEvent } from "./components/segment-view/segment-view-i
3939
import { SelectChangeEventDetail, SelectCompareFn, SelectInterface } from "./components/select/select-interface";
4040
import { SelectModalOption } from "./components/select-modal/select-modal-interface";
4141
import { SelectPopoverOption } from "./components/select-popover/select-popover-interface";
42+
import { SpinnerSize } from "./components/spinner/spinner.interfaces";
4243
import { TabBarChangedEventDetail, TabButtonClickEventDetail, TabButtonLayout } from "./components/tab-bar/tab-bar-interface";
4344
import { TextareaChangeEventDetail, TextareaInputEventDetail } from "./components/textarea/textarea-interface";
4445
import { ToastButton, ToastDismissOptions, ToastLayout, ToastPosition, ToastPresentOptions, ToastSwipeGestureDirection } from "./components/toast/toast-interface";
@@ -77,6 +78,7 @@ export { SegmentViewScrollEvent } from "./components/segment-view/segment-view-i
7778
export { SelectChangeEventDetail, SelectCompareFn, SelectInterface } from "./components/select/select-interface";
7879
export { SelectModalOption } from "./components/select-modal/select-modal-interface";
7980
export { SelectPopoverOption } from "./components/select-popover/select-popover-interface";
81+
export { SpinnerSize } from "./components/spinner/spinner.interfaces";
8082
export { TabBarChangedEventDetail, TabButtonClickEventDetail, TabButtonLayout } from "./components/tab-bar/tab-bar-interface";
8183
export { TextareaChangeEventDetail, TextareaInputEventDetail } from "./components/textarea/textarea-interface";
8284
export { ToastButton, ToastDismissOptions, ToastLayout, ToastPosition, ToastPresentOptions, ToastSwipeGestureDirection } from "./components/toast/toast-interface";
@@ -872,11 +874,11 @@ export namespace Components {
872874
*/
873875
"disabled": boolean;
874876
/**
875-
* The fill for the chip. Set to `"outline"` for a chip with a border and background. Set to `"solid"` for a chip with a background. Defaults to `"solid"`.
877+
* The fill for the chip. Set to `"outline"` for a chip with a border and background. Set to `"solid"` for a chip with a background. Defaults to `"solid"` if both the fill property and theme config are unset.
876878
*/
877879
"fill"?: 'outline' | 'solid';
878880
/**
879-
* Set to `"bold"` for a chip with vibrant, bold colors or to `"subtle"` for a chip with muted, subtle colors. Defaults to `"subtle"`.
881+
* Set to `"bold"` for a chip with vibrant, bold colors or to `"subtle"` for a chip with muted, subtle colors. Defaults to `"subtle"` if both the hue property and theme config are unset.
880882
*/
881883
"hue"?: 'bold' | 'subtle';
882884
/**
@@ -890,11 +892,11 @@ export namespace Components {
890892
*/
891893
"outline": boolean;
892894
/**
893-
* Set to `"soft"` for a chip with slightly rounded corners, `"round"` for a chip with fully rounded corners, or `"rectangular"` for a chip without rounded corners. Defaults to `"round"`.
895+
* Set to `"soft"` for a chip with slightly rounded corners, `"round"` for a chip with fully rounded corners, or `"rectangular"` for a chip without rounded corners. Defaults to `"round"` if both the shape property and theme config are unset.
894896
*/
895897
"shape"?: 'soft' | 'round' | 'rectangular';
896898
/**
897-
* Set to `"small"` for a chip with less height and padding. Defaults to `"large"`.
899+
* Set to `"small"` for a chip with less height and padding. Defaults to `"large"` if both the size property and theme config are unset.
898900
*/
899901
"size"?: 'small' | 'large';
900902
}
@@ -3881,13 +3883,9 @@ export namespace Components {
38813883
*/
38823884
"paused": boolean;
38833885
/**
3884-
* Set to `"xsmall"` for the smallest size. Set to `"small"` for a smaller size. Set to `"medium"` for a medium size. Set to `"large"` for a large size. Set to `"xlarge"` for the largest size. Defaults to `"xsmall"` for the `ionic` theme, undefined for all other themes.
3886+
* Set to `"xsmall"` for the smallest size. Set to `"small"` for a smaller size. Set to `"medium"` for a medium size. Set to `"large"` for a large size. Set to `"xlarge"` for the largest size. Defaults to `"medium"` if both the size property and theme config are unset.
38853887
*/
3886-
"size"?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
3887-
/**
3888-
* The theme determines the visual appearance of the component.
3889-
*/
3890-
"theme"?: "ios" | "md" | "ionic";
3888+
"size"?: SpinnerSize;
38913889
}
38923890
interface IonSplitPane {
38933891
/**
@@ -6846,11 +6844,11 @@ declare namespace LocalJSX {
68466844
*/
68476845
"disabled"?: boolean;
68486846
/**
6849-
* The fill for the chip. Set to `"outline"` for a chip with a border and background. Set to `"solid"` for a chip with a background. Defaults to `"solid"`.
6847+
* The fill for the chip. Set to `"outline"` for a chip with a border and background. Set to `"solid"` for a chip with a background. Defaults to `"solid"` if both the fill property and theme config are unset.
68506848
*/
68516849
"fill"?: 'outline' | 'solid';
68526850
/**
6853-
* Set to `"bold"` for a chip with vibrant, bold colors or to `"subtle"` for a chip with muted, subtle colors. Defaults to `"subtle"`.
6851+
* Set to `"bold"` for a chip with vibrant, bold colors or to `"subtle"` for a chip with muted, subtle colors. Defaults to `"subtle"` if both the hue property and theme config are unset.
68546852
*/
68556853
"hue"?: 'bold' | 'subtle';
68566854
/**
@@ -6864,11 +6862,11 @@ declare namespace LocalJSX {
68646862
*/
68656863
"outline"?: boolean;
68666864
/**
6867-
* Set to `"soft"` for a chip with slightly rounded corners, `"round"` for a chip with fully rounded corners, or `"rectangular"` for a chip without rounded corners. Defaults to `"round"`.
6865+
* Set to `"soft"` for a chip with slightly rounded corners, `"round"` for a chip with fully rounded corners, or `"rectangular"` for a chip without rounded corners. Defaults to `"round"` if both the shape property and theme config are unset.
68686866
*/
68696867
"shape"?: 'soft' | 'round' | 'rectangular';
68706868
/**
6871-
* Set to `"small"` for a chip with less height and padding. Defaults to `"large"`.
6869+
* Set to `"small"` for a chip with less height and padding. Defaults to `"large"` if both the size property and theme config are unset.
68726870
*/
68736871
"size"?: 'small' | 'large';
68746872
}
@@ -9911,13 +9909,9 @@ declare namespace LocalJSX {
99119909
*/
99129910
"paused"?: boolean;
99139911
/**
9914-
* Set to `"xsmall"` for the smallest size. Set to `"small"` for a smaller size. Set to `"medium"` for a medium size. Set to `"large"` for a large size. Set to `"xlarge"` for the largest size. Defaults to `"xsmall"` for the `ionic` theme, undefined for all other themes.
9912+
* Set to `"xsmall"` for the smallest size. Set to `"small"` for a smaller size. Set to `"medium"` for a medium size. Set to `"large"` for a large size. Set to `"xlarge"` for the largest size. Defaults to `"medium"` if both the size property and theme config are unset.
99159913
*/
9916-
"size"?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
9917-
/**
9918-
* The theme determines the visual appearance of the component.
9919-
*/
9920-
"theme"?: "ios" | "md" | "ionic";
9914+
"size"?: SpinnerSize;
99219915
}
99229916
interface IonSplitPane {
99239917
/**

core/src/components/button/button.common.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@
208208
pointer-events: none;
209209
}
210210

211+
::slotted(ion-spinner) {
212+
color: currentColor;
213+
}
214+
211215
// Button Ripple effect
212216
// --------------------------------------------------
213217

core/src/components/button/button.ionic.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,6 @@
166166

167167
// Button with Spinner
168168
// -------------------------------------------------------------------------------
169-
::slotted(ion-spinner) {
170-
--color: currentColor;
171-
}
172169

173170
/* Button containing only a spinner */
174171
::slotted(ion-spinner[slot="start"]),

0 commit comments

Comments
 (0)