Skip to content

Commit 95b8bbb

Browse files
Merge branch 'next' into FW-6252-button
2 parents 863b87f + 2a1addc commit 95b8bbb

File tree

162 files changed

+1191
-122
lines changed

Some content is hidden

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

162 files changed

+1191
-122
lines changed

core/api.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,17 +596,23 @@ ion-checkbox,part,supporting-text
596596
ion-chip,shadow
597597
ion-chip,prop,color,"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined,undefined,false,true
598598
ion-chip,prop,disabled,boolean,false,false,false
599+
ion-chip,prop,hue,"bold" | "subtle" | undefined,'subtle',false,false
599600
ion-chip,prop,mode,"ios" | "md",undefined,false,false
600601
ion-chip,prop,outline,boolean,false,false,false
601602
ion-chip,prop,shape,"rectangular" | "round" | "soft" | undefined,undefined,false,false
602603
ion-chip,prop,size,"large" | "small" | undefined,undefined,false,false
603604
ion-chip,prop,theme,"ios" | "md" | "ionic",undefined,false,false
605+
ion-chip,css-prop,--background,ionic
604606
ion-chip,css-prop,--background,ios
605607
ion-chip,css-prop,--background,md
608+
ion-chip,css-prop,--border-radius,ionic
606609
ion-chip,css-prop,--border-radius,ios
607610
ion-chip,css-prop,--border-radius,md
611+
ion-chip,css-prop,--color,ionic
608612
ion-chip,css-prop,--color,ios
609613
ion-chip,css-prop,--color,md
614+
ion-chip,css-prop,--focus-ring-color,ionic
615+
ion-chip,css-prop,--focus-ring-width,ionic
610616

611617
ion-col,shadow
612618
ion-col,prop,mode,"ios" | "md",undefined,false,false
@@ -1184,6 +1190,7 @@ ion-item-option,prop,disabled,boolean,false,false,false
11841190
ion-item-option,prop,download,string | undefined,undefined,false,false
11851191
ion-item-option,prop,expandable,boolean,false,false,false
11861192
ion-item-option,prop,href,string | undefined,undefined,false,false
1193+
ion-item-option,prop,hue,"bold" | "subtle" | undefined,'subtle',false,false
11871194
ion-item-option,prop,mode,"ios" | "md",undefined,false,false
11881195
ion-item-option,prop,rel,string | undefined,undefined,false,false
11891196
ion-item-option,prop,shape,"rectangular" | "round" | "soft" | undefined,undefined,false,false
@@ -2429,6 +2436,7 @@ ion-toast,prop,duration,number,config.getNumber('toastDuration', 0),false,false
24292436
ion-toast,prop,enterAnimation,((baseEl: any, opts?: any) => Animation) | undefined,undefined,false,false
24302437
ion-toast,prop,header,string | undefined,undefined,false,false
24312438
ion-toast,prop,htmlAttributes,undefined | { [key: string]: any; },undefined,false,false
2439+
ion-toast,prop,hue,"bold" | "subtle" | undefined,'subtle',false,false
24322440
ion-toast,prop,icon,string | undefined,undefined,false,false
24332441
ion-toast,prop,isOpen,boolean,false,false,false
24342442
ion-toast,prop,keyboardClose,boolean,false,false,false

core/src/components.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,10 @@ export namespace Components {
807807
* If `true`, the user cannot interact with the chip.
808808
*/
809809
"disabled": boolean;
810+
/**
811+
* Set to `"bold"` for a chip with vibrant, bold colors or to `"subtle"` for a chip with muted, subtle colors. Only applies to the `ionic` theme.
812+
*/
813+
"hue"?: 'bold' | 'subtle';
810814
/**
811815
* The mode determines the platform behaviors of the component.
812816
*/
@@ -1700,6 +1704,10 @@ export namespace Components {
17001704
* Contains a URL or a URL fragment that the hyperlink points to. If this property is set, an anchor tag will be rendered.
17011705
*/
17021706
"href": string | undefined;
1707+
/**
1708+
* Set to `"bold"` for an option with vibrant, bold colors or to `"subtle"` for an option with muted, subtle colors. Only applies to the `ionic` theme.
1709+
*/
1710+
"hue"?: 'bold' | 'subtle';
17031711
/**
17041712
* The mode determines the platform behaviors of the component.
17051713
*/
@@ -3836,6 +3844,10 @@ export namespace Components {
38363844
* Additional attributes to pass to the toast.
38373845
*/
38383846
"htmlAttributes"?: { [key: string]: any };
3847+
/**
3848+
* Set to `"bold"` for a toast with vibrant, bold colors or to `"subtle"` for a toast with muted, subtle colors. Only applies to the `ionic` theme.
3849+
*/
3850+
"hue"?: 'bold' | 'subtle';
38393851
/**
38403852
* The name of the icon to display, or the path to a valid SVG file. See `ion-icon`. https://ionic.io/ionicons
38413853
*/
@@ -6287,6 +6299,10 @@ declare namespace LocalJSX {
62876299
* If `true`, the user cannot interact with the chip.
62886300
*/
62896301
"disabled"?: boolean;
6302+
/**
6303+
* Set to `"bold"` for a chip with vibrant, bold colors or to `"subtle"` for a chip with muted, subtle colors. Only applies to the `ionic` theme.
6304+
*/
6305+
"hue"?: 'bold' | 'subtle';
62906306
/**
62916307
* The mode determines the platform behaviors of the component.
62926308
*/
@@ -7196,6 +7212,10 @@ declare namespace LocalJSX {
71967212
* Contains a URL or a URL fragment that the hyperlink points to. If this property is set, an anchor tag will be rendered.
71977213
*/
71987214
"href"?: string | undefined;
7215+
/**
7216+
* Set to `"bold"` for an option with vibrant, bold colors or to `"subtle"` for an option with muted, subtle colors. Only applies to the `ionic` theme.
7217+
*/
7218+
"hue"?: 'bold' | 'subtle';
71997219
/**
72007220
* The mode determines the platform behaviors of the component.
72017221
*/
@@ -9368,6 +9388,10 @@ declare namespace LocalJSX {
93689388
* Additional attributes to pass to the toast.
93699389
*/
93709390
"htmlAttributes"?: { [key: string]: any };
9391+
/**
9392+
* Set to `"bold"` for a toast with vibrant, bold colors or to `"subtle"` for a toast with muted, subtle colors. Only applies to the `ionic` theme.
9393+
*/
9394+
"hue"?: 'bold' | 'subtle';
93719395
/**
93729396
* The name of the icon to display, or the path to a valid SVG file. See `ion-icon`. https://ionic.io/ionicons
93739397
*/
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@import "../../themes/mixins";
2+
3+
// Chip: Common Styles
4+
// --------------------------------------------------
5+
6+
:host {
7+
/**
8+
* @prop --background: Background of the chip
9+
* @prop --color: Color of the chip
10+
* @prop --border-radius: Border radius of the chip
11+
*/
12+
@include font-smoothing();
13+
14+
display: inline-flex;
15+
16+
position: relative;
17+
18+
align-items: center;
19+
justify-content: center;
20+
21+
background: var(--background);
22+
color: var(--color);
23+
24+
cursor: pointer;
25+
26+
overflow: hidden;
27+
28+
box-sizing: border-box;
29+
30+
vertical-align: middle;
31+
}
32+
33+
:host(.chip-disabled) {
34+
cursor: default;
35+
pointer-events: none;
36+
}
Lines changed: 57 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,26 @@
11
@use "../../themes/ionic/ionic.globals.scss" as globals;
2+
@use "./chip.common";
23

34
// Ionic Chip
45
// --------------------------------------------------
56

67
:host {
7-
--background: #{globals.$ion-primitives-neutral-100};
8-
--color: #{globals.$ion-primitives-neutral-900};
8+
/**
9+
* @prop --focus-ring-color: Color of the focus ring
10+
* @prop --focus-ring-width: Width of the focus ring
11+
*/
912
--focus-ring-color: #{globals.$ion-border-focus-default};
1013
--focus-ring-width: #{globals.$ion-border-size-050};
1114

12-
@include globals.font-smoothing;
1315
@include globals.padding(globals.$ion-space-150, globals.$ion-space-200);
1416
@include globals.border-radius(var(--border-radius));
1517

16-
display: inline-flex;
17-
18-
position: relative;
19-
20-
align-items: center;
21-
justify-content: center;
22-
2318
gap: globals.$ion-space-100;
2419

25-
background: var(--background);
26-
color: var(--color);
27-
2820
font-family: globals.$ion-font-family;
2921
font-weight: globals.$ion-font-weight-medium;
3022

3123
line-height: globals.$ion-font-line-height-full;
32-
33-
cursor: pointer;
34-
35-
overflow: hidden;
36-
37-
box-sizing: border-box;
38-
39-
vertical-align: middle;
4024
}
4125

4226
// Outline Chip
@@ -45,13 +29,6 @@
4529
:host(.chip-outline) {
4630
border-width: globals.$ion-border-size-025;
4731
border-style: globals.$ion-border-style-solid;
48-
border-color: globals.$ion-primitives-neutral-100;
49-
50-
background: transparent;
51-
}
52-
53-
:host(.chip-outline.ion-color) {
54-
border-color: globals.current-color(base, 0.32);
5532
}
5633

5734
// Chip: Focus
@@ -66,12 +43,20 @@
6643
// ---------------------------------------------
6744

6845
@media (any-hover: hover) {
69-
:host(:hover) {
46+
:host(.chip-subtle:hover) {
7047
--background: #{globals.$ion-primitives-neutral-200};
7148
}
7249

73-
:host(.ion-color:hover) {
74-
background: globals.current-color(base, 0.12);
50+
:host(.chip-bold:hover) {
51+
--background: #{globals.$ion-primitives-neutral-1100};
52+
}
53+
54+
:host(.chip-subtle.ion-color:hover) {
55+
background: globals.current-color(tint, $subtle: true);
56+
}
57+
58+
:host(.chip-bold.ion-color:hover) {
59+
background: globals.current-color(shade);
7560
}
7661
}
7762

@@ -80,7 +65,6 @@
8065

8166
:host(.chip-disabled) {
8267
opacity: 0.6;
83-
pointer-events: none;
8468
}
8569

8670
// Chip Shapes
@@ -110,7 +94,7 @@
11094
:host(.chip-small) {
11195
min-height: globals.$ion-scale-600;
11296

113-
font-size: #{globals.$ion-font-size-300};
97+
font-size: globals.$ion-font-size-300;
11498
}
11599

116100
:host(.chip-large) {
@@ -119,18 +103,51 @@
119103
font-size: globals.$ion-font-size-350;
120104
}
121105

106+
// Subtle Chip
107+
// ---------------------------------------------
108+
109+
:host(.chip-subtle) {
110+
--background: #{globals.$ion-primitives-neutral-100};
111+
--color: #{globals.$ion-primitives-neutral-800};
112+
}
113+
114+
:host(.chip-outline.chip-subtle) {
115+
border-color: globals.$ion-primitives-neutral-300;
116+
}
117+
118+
// Bold Chip
119+
// ---------------------------------------------
120+
121+
:host(.chip-bold) {
122+
--background: #{globals.$ion-bg-neutral-bold-default};
123+
--color: #{globals.$ion-primitives-base-white};
124+
}
125+
126+
:host(.chip-outline.chip-bold) {
127+
// TODO(FW-6450): this is a made up design choice based on a
128+
// darker shade of the background color
129+
border-color: globals.$ion-primitives-neutral-1200;
130+
}
131+
122132
// Chip Colors
123133
// ---------------------------------------------
124134

125-
:host(.ion-color) {
126-
background: globals.current-color(base, 0.08);
127-
color: globals.current-color(shade);
135+
// Subtle
136+
:host(.chip-subtle.ion-color) {
137+
background: globals.current-color(base, $subtle: true);
138+
color: globals.current-color(contrast, $subtle: true);
139+
}
140+
141+
:host(.chip-subtle.chip-outline.ion-color) {
142+
border-color: globals.current-color(shade, $subtle: true);
128143
}
129144

130-
:host(.ion-color:focus) {
131-
background: globals.current-color(base, 0.12);
145+
// Bold
146+
:host(.chip-bold.ion-color) {
147+
background: globals.current-color(base);
148+
color: globals.current-color(contrast);
132149
}
133150

134-
:host(.ion-color.ion-activated) {
135-
background: globals.current-color(base, 0.16);
151+
:host(.chip-bold.chip-outline.ion-color) {
152+
border-color: globals.current-color(shade);
136153
}

core/src/components/chip/chip.ios.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "./chip";
1+
@import "./chip.native";
22
@import "./chip.vars";
33

44
:host {

core/src/components/chip/chip.md.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import "./chip";
1+
@import "./chip.native";
22
@import "./chip.vars";
33

44
:host {

core/src/components/chip/chip.scss renamed to core/src/components/chip/chip.native.scss

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,22 @@
11
@import "../../themes/native/native.globals";
22
@import "./chip.vars";
3+
@import "./chip.common";
34

45
:host {
5-
/**
6-
* @prop --background: Background of the chip
7-
* @prop --color: Color of the chip
8-
* @prop --border-radius: Border radius of the chip
9-
*/
106
--background: #{rgba($text-color-rgb, 0.12)};
117
--color: #{rgba($text-color-rgb, 0.87)};
128

139
@include border-radius(var(--border-radius));
14-
@include font-smoothing();
1510
@include margin(4px);
1611
@include padding(6px, 12px);
1712

18-
display: inline-flex;
19-
20-
position: relative;
21-
22-
align-items: center;
23-
2413
min-height: 32px;
2514

26-
background: var(--background);
27-
color: var(--color);
28-
2915
font-family: $font-family-base;
30-
31-
cursor: pointer;
32-
33-
overflow: hidden;
34-
35-
vertical-align: middle;
36-
box-sizing: border-box;
3716
}
3817

3918
:host(.chip-disabled) {
40-
cursor: default;
4119
opacity: 0.4;
42-
pointer-events: none;
4320
}
4421

4522
// Chip Colors
@@ -58,6 +35,15 @@
5835
background: current-color(base, 0.16);
5936
}
6037

38+
// Chip: Hover
39+
// ---------------------------------------------
40+
41+
@media (any-hover: hover) {
42+
:host(.ion-color:hover) {
43+
background: current-color(base, 0.12);
44+
}
45+
}
46+
6147
// Outline Chip
6248
// ---------------------------------------------
6349

0 commit comments

Comments
 (0)