frontile 0.18.11 → 0.18.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/components/buttons/button-group.d.ts +1 -1
- package/declarations/components/buttons/button-group.d.ts.map +1 -1
- package/declarations/components/buttons/button.d.ts +4 -2
- package/declarations/components/buttons/button.d.ts.map +1 -1
- package/declarations/components/buttons/chip.d.ts +4 -3
- package/declarations/components/buttons/chip.d.ts.map +1 -1
- package/declarations/components/buttons/icon-button.d.ts +50 -0
- package/declarations/components/buttons/icon-button.d.ts.map +1 -0
- package/declarations/components/buttons/index.d.ts +1 -0
- package/declarations/components/buttons/index.d.ts.map +1 -1
- package/declarations/components/buttons/toggle-button.d.ts +1 -1
- package/declarations/components/buttons/toggle-button.d.ts.map +1 -1
- package/declarations/components/forms/select/types.d.ts +1 -1
- package/declarations/components/status/badge.d.ts +4 -3
- package/declarations/components/status/badge.d.ts.map +1 -1
- package/declarations/components/utilities/card.d.ts +94 -0
- package/declarations/components/utilities/card.d.ts.map +1 -0
- package/declarations/components/utilities/icon.d.ts +57 -0
- package/declarations/components/utilities/icon.d.ts.map +1 -0
- package/declarations/components/utilities/index.d.ts +2 -0
- package/declarations/components/utilities/index.d.ts.map +1 -1
- package/dist/buttons.js +1 -0
- package/dist/buttons.js.map +1 -1
- package/dist/components/buttons/button.js.map +1 -1
- package/dist/components/buttons/chip.js.map +1 -1
- package/dist/components/buttons/icon-button.js +33 -0
- package/dist/components/buttons/icon-button.js.map +1 -0
- package/dist/components/buttons/index.js +1 -0
- package/dist/components/buttons/index.js.map +1 -1
- package/dist/components/forms/select/select.js +1 -1
- package/dist/components/forms/select/select.js.map +1 -1
- package/dist/components/status/badge.js.map +1 -1
- package/dist/components/utilities/card.js +38 -0
- package/dist/components/utilities/card.js.map +1 -0
- package/dist/components/utilities/icon.js +33 -0
- package/dist/components/utilities/icon.js.map +1 -0
- package/dist/components/utilities/index.js +2 -0
- package/dist/components/utilities/index.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/utilities.js +2 -0
- package/dist/utilities.js.map +1 -1
- package/package.json +3 -3
|
@@ -18,7 +18,7 @@ interface ButtonGroupSignature {
|
|
|
18
18
|
Element: HTMLDivElement;
|
|
19
19
|
}
|
|
20
20
|
declare class ButtonGroup extends Component<ButtonGroupSignature> {
|
|
21
|
-
get variant(): "solid" | "soft" | "subtle" | "outline" | "ghost" | "plain" | "custom" | undefined;
|
|
21
|
+
get variant(): "link" | "solid" | "soft" | "subtle" | "outline" | "ghost" | "plain" | "custom" | "glass" | undefined;
|
|
22
22
|
get color(): "neutral" | "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger" | undefined;
|
|
23
23
|
get classNames(): string;
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/button-group.gts"],"names":[],"mappings":"AAqGA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAe,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAqB,EAAE,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGpE,UAAU,eAAgB,SAAQ,IAAI,CACpC,UAAU,EACV,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CACjE;CAAG;AAEJ,UAAU,oBAAoB;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE;QACN,OAAO,EAAE;YACP;gBACE,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC,CAAC;gBACnE,YAAY,EAAE,aAAa,CACzB,aAAa,CAAC,qBAAqB,CAAC,EACpC,WAAW,CACZ,CAAC;aACH;SACF,CAAC;KACH,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,cAAM,WAAY,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACvD,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/button-group.gts"],"names":[],"mappings":"AAqGA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAe,EAAE,KAAK,eAAe,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAqB,EAAE,KAAK,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGpE,UAAU,eAAgB,SAAQ,IAAI,CACpC,UAAU,EACV,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CACjE;CAAG;AAEJ,UAAU,oBAAoB;IAC5B,IAAI,EAAE,eAAe,CAAC;IACtB,MAAM,EAAE;QACN,OAAO,EAAE;YACP;gBACE,MAAM,EAAE,aAAa,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE,WAAW,CAAC,CAAC;gBACnE,YAAY,EAAE,aAAa,CACzB,aAAa,CAAC,qBAAqB,CAAC,EACpC,WAAW,CACZ,CAAC;aACH;SACF,CAAC;KACH,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,cAAM,WAAY,SAAQ,SAAS,CAAC,oBAAoB,CAAC;IACvD,IAAI,OAAO,0GAkBV;IAED,IAAI,KAAK,oGAYR;IAED,IAAI,UAAU,IAAI,MAAM,CAMvB;CA2BF;AAED,OAAO,EAAE,WAAW,EAAE,KAAK,oBAAoB,EAAE,CAAC;AAClD,eAAe,WAAW,CAAC"}
|
|
@@ -8,11 +8,13 @@ export interface ButtonArgs {
|
|
|
8
8
|
*/
|
|
9
9
|
type?: 'button' | 'submit' | 'reset';
|
|
10
10
|
/**
|
|
11
|
-
* The button variant.
|
|
11
|
+
* The button variant. `glass` is a translucent, color-less fill (it ignores
|
|
12
|
+
* `color`) for use over a colored or imaged surface. `link` is inline, with
|
|
13
|
+
* no fill or side padding, and underlines on hover.
|
|
12
14
|
*
|
|
13
15
|
* @defaultValue 'solid'
|
|
14
16
|
*/
|
|
15
|
-
variant?: 'solid' | 'soft' | 'subtle' | 'outline' | 'ghost' | 'plain' | 'custom';
|
|
17
|
+
variant?: 'solid' | 'soft' | 'subtle' | 'outline' | 'ghost' | 'plain' | 'custom' | 'glass' | 'link';
|
|
16
18
|
/**
|
|
17
19
|
* @deprecated Use `variant`. `default` is now `solid`, `outlined` is
|
|
18
20
|
* `outline`, and `minimal` is `plain`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/button.gts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/button.gts"],"names":[],"mappings":"AAuUA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AA6E/D,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAErC;;;;;;OAMG;IACH,OAAO,CAAC,EACJ,OAAO,GACP,MAAM,GACN,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,OAAO,GACP,MAAM,CAAC;IAEX;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;IAE9E;;OAEG;IACH,KAAK,CAAC,EACF,SAAS,GACT,SAAS,GACT,WAAW,GACX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,UAAU,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAE5D;IAED,iBAAiB,GAAI,WAAW,OAAO,KAAG,IAAI,CAE5C;IAEF,OAAO,GAAI,OAAO,UAAU,UAI1B;CAqEH;AAED,OAAO,EAAE,MAAM,EAAE,KAAK,eAAe,EAAE,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -21,11 +21,12 @@ interface ChipSignature {
|
|
|
21
21
|
*/
|
|
22
22
|
intent?: 'default' | 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger';
|
|
23
23
|
/**
|
|
24
|
-
* The size of the chip
|
|
24
|
+
* The size of the chip. Uses Button's size names and text size: the same
|
|
25
|
+
* `@size` gives the same label text size on Chip, Badge and Button.
|
|
25
26
|
*
|
|
26
|
-
* @defaultValue '
|
|
27
|
+
* @defaultValue 'xs'
|
|
27
28
|
*/
|
|
28
|
-
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
29
|
+
size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
29
30
|
/**
|
|
30
31
|
* @deprecated Ignored. Chip is always a pill; use `Badge` for a squared
|
|
31
32
|
* label.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/chip.gts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chip.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/chip.gts"],"names":[],"mappings":"AAoMA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAM3C,UAAU,aAAa;IACrB,IAAI,EAAE;QACJ;;;;WAIG;QACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;QAEvC;;;WAGG;QACH,UAAU,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;QAE9C;;WAEG;QACH,KAAK,CAAC,EACF,SAAS,GACT,SAAS,GACT,WAAW,GACX,UAAU,GACV,SAAS,GACT,SAAS,GACT,QAAQ,CAAC;QAEb;;WAEG;QACH,MAAM,CAAC,EACH,SAAS,GACT,SAAS,GACT,WAAW,GACX,UAAU,GACV,SAAS,GACT,SAAS,GACT,QAAQ,CAAC;QAEb;;;;;WAKG;QACH,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;QAExD;;;WAGG;QACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;QAEvC;;;;;;WAMG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAElB;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;QAErB;;;;;;WAMG;QACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAE1B;;;;;;;;;WASG;QACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAEtC;;;;WAIG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;QAErB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,cAAM,IAAK,SAAQ,SAAS,CAAC,aAAa,CAAC;IACzC,IAAI,UAAU;;;;;MAmDb;CA8DF;AAED,OAAO,EAAE,IAAI,EAAE,KAAK,aAAa,EAAE,CAAC;AACpC,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type ButtonArgs } from './button';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
import type { PressEvent } from '../../modifiers/press';
|
|
4
|
+
export interface IconButtonSignature {
|
|
5
|
+
Args: {
|
|
6
|
+
/**
|
|
7
|
+
* The accessible name. An icon-only button has no text, so this is
|
|
8
|
+
* required and must not be empty; it becomes the button's `aria-label`.
|
|
9
|
+
*/
|
|
10
|
+
label: string;
|
|
11
|
+
/**
|
|
12
|
+
* The size of the button. Same names as Button, and the same height, so
|
|
13
|
+
* an IconButton lines up with a Button of that size.
|
|
14
|
+
*
|
|
15
|
+
* @defaultValue 'md'
|
|
16
|
+
*/
|
|
17
|
+
size?: ButtonArgs['size'];
|
|
18
|
+
/** The color of the button. Same values as Button. */
|
|
19
|
+
color?: ButtonArgs['color'];
|
|
20
|
+
/** The button variant. Same values as Button. */
|
|
21
|
+
variant?: ButtonArgs['variant'];
|
|
22
|
+
/**
|
|
23
|
+
* Renders a spinner in place of the icon and disables the button.
|
|
24
|
+
*
|
|
25
|
+
* @defaultValue false
|
|
26
|
+
*/
|
|
27
|
+
isLoading?: boolean;
|
|
28
|
+
/** The HTML type of the button. */
|
|
29
|
+
type?: ButtonArgs['type'];
|
|
30
|
+
/** Callback for when the button is pressed. */
|
|
31
|
+
onPress?: (event: PressEvent) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Custom class name, it will override the default ones using Tailwind
|
|
34
|
+
* Merge library.
|
|
35
|
+
*/
|
|
36
|
+
class?: string;
|
|
37
|
+
};
|
|
38
|
+
Blocks: {
|
|
39
|
+
/** The icon, for example an inline `<svg>`. Sized to the button's text. */
|
|
40
|
+
default: [];
|
|
41
|
+
};
|
|
42
|
+
Element: HTMLButtonElement;
|
|
43
|
+
}
|
|
44
|
+
declare class IconButton extends Component<IconButtonSignature> {
|
|
45
|
+
get label(): string;
|
|
46
|
+
get classNames(): string;
|
|
47
|
+
}
|
|
48
|
+
export { IconButton };
|
|
49
|
+
export default IconButton;
|
|
50
|
+
//# sourceMappingURL=icon-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/icon-button.gts"],"names":[],"mappings":"AA0FA,OAAO,EAAU,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,SAA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file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,qBAAqB,CAAC"}
|
|
@@ -26,7 +26,7 @@ declare class ToggleButton extends Component<ToggleButtonSignature> {
|
|
|
26
26
|
* `@variant` so a consumer still migrating gets the warning, even though
|
|
27
27
|
* the resolved value itself has nowhere else to go.
|
|
28
28
|
*/
|
|
29
|
-
get variant(): "solid" | "soft" | "subtle" | "outline" | "ghost" | "plain" | "custom" | undefined;
|
|
29
|
+
get variant(): "link" | "solid" | "soft" | "subtle" | "outline" | "ghost" | "plain" | "custom" | "glass" | undefined;
|
|
30
30
|
get color(): "neutral" | "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger" | undefined;
|
|
31
31
|
get classNames(): string;
|
|
32
32
|
get isSelected(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle-button.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/toggle-button.gts"],"names":[],"mappings":"AAmHA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,UAAU,gBAAiB,SAAQ,IAAI,CACrC,UAAU,EACV,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,CAC/E;IACC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IACF,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,cAAM,YAAa,SAAQ,SAAS,CAAC,qBAAqB,CAAC;IACzD;;;;;OAKG;IACH,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"toggle-button.d.ts","sourceRoot":"","sources":["../../../src/components/buttons/toggle-button.gts"],"names":[],"mappings":"AAmHA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3C,UAAU,gBAAiB,SAAQ,IAAI,CACrC,UAAU,EACV,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,CAC/E;IACC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED,UAAU,qBAAqB;IAC7B,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IACF,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAED,cAAM,YAAa,SAAQ,SAAS,CAAC,qBAAqB,CAAC;IACzD;;;;;OAKG;IACH,IAAI,OAAO,0GAkBV;IAED,IAAI,KAAK,oGAYR;IAED,IAAI,UAAU,IAAI,MAAM,CAcvB;IAED,IAAI,UAAU,YAEb;IAED,QAAQ,aAIN;CA4BH;AAED,OAAO,EAAE,YAAY,EAAE,KAAK,qBAAqB,EAAE,CAAC;AACpD,eAAe,YAAY,CAAC"}
|
|
@@ -182,7 +182,7 @@ interface MultipleSelectArgs<T> extends BaseSelectArgs<T> {
|
|
|
182
182
|
* - `variant` defaults to `'soft'`
|
|
183
183
|
* - `color` defaults to the Select's own `@color`, so `@color="primary"`
|
|
184
184
|
* colors the listbox items and the chips together
|
|
185
|
-
* - `size` defaults to `'
|
|
185
|
+
* - `size` defaults to `'xs'`
|
|
186
186
|
* - `withDot` falls back to Chip's own default
|
|
187
187
|
*
|
|
188
188
|
* @example
|
|
@@ -15,11 +15,12 @@ interface BadgeSignature {
|
|
|
15
15
|
*/
|
|
16
16
|
color?: 'neutral' | 'primary' | 'secondary' | 'tertiary' | 'success' | 'danger';
|
|
17
17
|
/**
|
|
18
|
-
* The size of the badge
|
|
18
|
+
* The size of the badge. Uses Button's size names and text size: the same
|
|
19
|
+
* `@size` gives the same label text size on Badge, Chip and Button.
|
|
19
20
|
*
|
|
20
|
-
* @defaultValue '
|
|
21
|
+
* @defaultValue 'xs'
|
|
21
22
|
*/
|
|
22
|
-
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
23
|
+
size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
23
24
|
/**
|
|
24
25
|
* Adds a dot before the content, colored by `@color`.
|
|
25
26
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/status/badge.gts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/status/badge.gts"],"names":[],"mappings":"AA2JA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,UAAU,cAAc;IACtB,IAAI,EAAE;QACJ;;;;;WAKG;QACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAE7B;;;;WAIG;QACH,KAAK,CAAC,EACJ,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAAC;QAE1E;;;;;WAKG;QACH,IAAI,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;QAExD;;;;WAIG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAElB;;WAEG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf;;;;;WAKG;QACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAExB;;WAEG;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,EAAE;QACN;;WAEG;QACH,OAAO,EAAE,EAAE,CAAC;QAEZ;;;WAGG;QACH,SAAS,CAAC,EAAE,EAAE,CAAC;QAEf;;;WAGG;QACH,OAAO,CAAC,EAAE,EAAE,CAAC;KACd,CAAC;IACF,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED;;;;;;;;;;;GAWG;AACH,cAAM,KAAM,SAAQ,SAAS,CAAC,cAAc,CAAC;IAE3C,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,UAAU;;;;;;MAgBb;CAgGF;AAED,OAAO,EAAE,KAAK,EAAE,KAAK,cAAc,EAAE,CAAC;AACtC,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
interface CardSignature {
|
|
3
|
+
Args: {
|
|
4
|
+
/**
|
|
5
|
+
* The surface treatment. `outline` is a bordered card, `flat` has no
|
|
6
|
+
* visible border, and `soft` swaps the fill for a faint tint with no
|
|
7
|
+
* border.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue 'outline'
|
|
10
|
+
*/
|
|
11
|
+
variant?: 'outline' | 'flat' | 'soft';
|
|
12
|
+
/**
|
|
13
|
+
* Colours the hover and selected border. The resting border is neutral
|
|
14
|
+
* either way. The border is 1px in every state; hover and selected add a
|
|
15
|
+
* second 1px inset layer in the same colour so they read as 2px without a
|
|
16
|
+
* layout shift.
|
|
17
|
+
*
|
|
18
|
+
* @defaultValue 'neutral'
|
|
19
|
+
*/
|
|
20
|
+
color?: 'neutral' | 'primary';
|
|
21
|
+
/**
|
|
22
|
+
* How much padding surrounds the contents.
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue 'comfortable'
|
|
25
|
+
*/
|
|
26
|
+
density?: 'compact' | 'comfortable' | 'spacious';
|
|
27
|
+
/**
|
|
28
|
+
* `raised` gives an `outline` card its shadow, and lifts it on hover when
|
|
29
|
+
* the card is interactive. `none` removes both. `flat` and `soft` never
|
|
30
|
+
* have a shadow, so this changes nothing for them.
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue 'raised'
|
|
33
|
+
*/
|
|
34
|
+
elevation?: 'raised' | 'none';
|
|
35
|
+
/**
|
|
36
|
+
* Shows the card as selected. This is appearance only: Card holds no
|
|
37
|
+
* selection state, and does not set `role` or `aria-*` for you. Pair it
|
|
38
|
+
* with whatever provides the selection behaviour and semantics. A selected
|
|
39
|
+
* card also shows the `indicator` block, if one is passed.
|
|
40
|
+
*
|
|
41
|
+
* @defaultValue false
|
|
42
|
+
*/
|
|
43
|
+
isSelected?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Adds the hover, pressed, focus-visible and pointer styles for a card
|
|
46
|
+
* that can be clicked. It does not make the card focusable or add an
|
|
47
|
+
* event handler; use a `button`, a link, or `role` and `tabindex` through
|
|
48
|
+
* `...attributes` for that.
|
|
49
|
+
*
|
|
50
|
+
* @defaultValue false
|
|
51
|
+
*/
|
|
52
|
+
isInteractive?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Dims the card and removes its hover and pressed styles. Disabled and
|
|
55
|
+
* selected can be combined: the selected border and its inset layer stay
|
|
56
|
+
* visible.
|
|
57
|
+
*
|
|
58
|
+
* @defaultValue false
|
|
59
|
+
*/
|
|
60
|
+
isDisabled?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Custom class name, it will override the default ones using Tailwind
|
|
63
|
+
* Merge library.
|
|
64
|
+
*/
|
|
65
|
+
class?: string;
|
|
66
|
+
};
|
|
67
|
+
Blocks: {
|
|
68
|
+
/**
|
|
69
|
+
* The card's contents. Card has no regions of its own; lay them out here.
|
|
70
|
+
* When the `indicator` block is also used, the contents go in
|
|
71
|
+
* `<:default>`, because named blocks cannot sit beside loose content.
|
|
72
|
+
*/
|
|
73
|
+
default: [];
|
|
74
|
+
/**
|
|
75
|
+
* Opts in to a selection indicator: a small circle at the card's top-right
|
|
76
|
+
* corner holding whatever you pass, usually a check icon from your own
|
|
77
|
+
* icon library. It is shown only while the card is selected, is hidden
|
|
78
|
+
* from assistive technology, and takes its fill from `@color`. Card never
|
|
79
|
+
* supplies the icon, so it depends on no icon set.
|
|
80
|
+
*
|
|
81
|
+
* A parent with `overflow: hidden` clips the part that overhangs the
|
|
82
|
+
* corner.
|
|
83
|
+
*/
|
|
84
|
+
indicator?: [];
|
|
85
|
+
};
|
|
86
|
+
Element: HTMLDivElement;
|
|
87
|
+
}
|
|
88
|
+
declare class Card extends Component<CardSignature> {
|
|
89
|
+
get classNames(): string;
|
|
90
|
+
get indicatorClassNames(): string;
|
|
91
|
+
}
|
|
92
|
+
export { Card };
|
|
93
|
+
export default Card;
|
|
94
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/utilities/card.gts"],"names":[],"mappings":"AAmJA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,UAAU,aAAa;IACrB,IAAI,EAAE;QACJ;;;;;;WAMG;QACH,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;QAEtC;;;;;;;WAOG;QACH,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;QAE9B;;;;WAIG;QACH,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;QAEjD;;;;;;WAMG;QACH,SAAS,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;QAE9B;;;;;;;WAOG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;QAErB;;;;;;;WAOG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;QAExB;;;;;;WAMG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;QAErB;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,EAAE;QACN;;;;WAIG;QACH,OAAO,EAAE,EAAE,CAAC;QAEZ;;;;;;;;;WASG;QACH,SAAS,CAAC,EAAE,EAAE,CAAC;KAChB,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,cAAM,IAAK,SAAQ,SAAS,CAAC,aAAa,CAAC;IACzC,IAAI,UAAU,WAab;IAED,IAAI,mBAAmB,WAItB;CA8CF;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { type IconVariants } from '@frontile/theme';
|
|
3
|
+
export interface IconSignature {
|
|
4
|
+
Args: {
|
|
5
|
+
/**
|
|
6
|
+
* The size of the circle. The icon inside scales with it.
|
|
7
|
+
*
|
|
8
|
+
* @defaultValue 'md'
|
|
9
|
+
*/
|
|
10
|
+
size?: IconVariants['size'];
|
|
11
|
+
/**
|
|
12
|
+
* The color role. A `plain` icon without a color takes the color of the
|
|
13
|
+
* surrounding text; every other variant defaults to `neutral`.
|
|
14
|
+
*/
|
|
15
|
+
color?: IconVariants['color'];
|
|
16
|
+
/**
|
|
17
|
+
* How the circle is drawn. `plain` has no circle, only the icon. `solid`,
|
|
18
|
+
* `soft` and `subtle` fill it at decreasing strength, and `outline` draws
|
|
19
|
+
* a ring. A plain icon's box is tighter than the circle of the other
|
|
20
|
+
* variants at the same size.
|
|
21
|
+
*
|
|
22
|
+
* @defaultValue 'plain'
|
|
23
|
+
*/
|
|
24
|
+
variant?: IconVariants['variant'];
|
|
25
|
+
/**
|
|
26
|
+
* Draws the icon, its fill and its ring in the opposite light or dark
|
|
27
|
+
* scheme, for an icon on a surface of the other scheme. An inverse plain
|
|
28
|
+
* icon with no `@color` is neutral.
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue false
|
|
31
|
+
*/
|
|
32
|
+
inverse?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The accessible name. Without it the icon is decorative and hidden from
|
|
35
|
+
* screen readers; set it when the icon carries meaning on its own.
|
|
36
|
+
*/
|
|
37
|
+
label?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Custom classes for the root element, merged over the defaults.
|
|
40
|
+
*/
|
|
41
|
+
classes?: {
|
|
42
|
+
base?: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
Blocks: {
|
|
46
|
+
/** The icon, for example an inline `<svg>` or a `FaIcon`. */
|
|
47
|
+
default: [];
|
|
48
|
+
};
|
|
49
|
+
Element: HTMLSpanElement;
|
|
50
|
+
}
|
|
51
|
+
declare class Icon extends Component<IconSignature> {
|
|
52
|
+
defaultColor(variant: string): 'neutral' | undefined;
|
|
53
|
+
get classNames(): string;
|
|
54
|
+
}
|
|
55
|
+
export { Icon };
|
|
56
|
+
export default Icon;
|
|
57
|
+
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/components/utilities/icon.gts"],"names":[],"mappings":"AAwFA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAa,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE;QACJ;;;;WAIG;QACH,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;QAE5B;;;WAGG;QACH,KAAK,CAAC,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QAE9B;;;;;;;WAOG;QACH,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;QAElC;;;;;;WAMG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAElB;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QAEf;;WAEG;QACH,OAAO,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC7B,CAAC;IACF,MAAM,EAAE;QACN,6DAA6D;QAC7D,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IACF,OAAO,EAAE,eAAe,CAAC;CAC1B;AAED,cAAM,IAAK,SAAQ,SAAS,CAAC,aAAa,CAAC;IAGzC,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAIpD,IAAI,UAAU,IAAI,MAAM,CAWvB;CAwBF;AAED,OAAO,EAAE,IAAI,EAAE,CAAC;AAChB,eAAe,IAAI,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import 'focus-visible/dist/focus-visible.js';
|
|
2
2
|
export * from './avatar';
|
|
3
|
+
export * from './icon';
|
|
3
4
|
export * from './visually-hidden';
|
|
4
5
|
export * from './collapsible';
|
|
5
6
|
export * from './divider';
|
|
7
|
+
export * from './card';
|
|
6
8
|
export * from './kbd';
|
|
7
9
|
export * from '../../utils/keys';
|
|
8
10
|
export * from './skeleton';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/utilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,qCAAqC,CAAC;AAE7C,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/utilities/index.ts"],"names":[],"mappings":"AAAA,OAAO,qCAAqC,CAAC;AAE7C,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC"}
|
package/dist/buttons.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Button } from './components/buttons/button.js';
|
|
2
2
|
export { CloseButton } from './components/buttons/close-button.js';
|
|
3
|
+
export { IconButton } from './components/buttons/icon-button.js';
|
|
3
4
|
export { ToggleButton } from './components/buttons/toggle-button.js';
|
|
4
5
|
export { ButtonGroup } from './components/buttons/button-group.js';
|
|
5
6
|
export { Chip } from './components/buttons/chip.js';
|
package/dist/buttons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buttons.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buttons.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../src/components/buttons/button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached, tracked } from '@glimmer/tracking';\nimport { modifier } from 'ember-modifier';\nimport type { TOC } from '@ember/component/template-only';\nimport { useStyles } from '@frontile/theme';\nimport { press, type PressEvent } from '../../modifiers/press';\nimport { Spinner } from '../utilities/spinner';\nimport { renamedArgValue } from '../../-private/deprecated-args';\n\n/**\n * Sets `disabled` on the element while `loading` is true, restoring whatever\n * the consumer had before. This is a modifier rather than a plain attribute\n * because splattributes are applied last: `disabled={{@isLoading}}` written\n * before `...attributes` is clobbered by a consumer's own `disabled`, and\n * written after it a consumer's `disabled={{false}}` would erase ours.\n * Modifiers run after attributes, so neither ordering problem applies.\n *\n * Known limitation: this re-runs only when `loading` changes, so `previous`\n * is a snapshot taken once at install time — it goes stale if the consumer's\n * own `disabled` binding changes while loading is already in flight, in\n * either direction:\n *\n * - true → false: Glimmer rewrites the attribute to `false`, we do not\n * re-run, so the button stays disabled (from our own `el.disabled = true`)\n * until loading ends and teardown restores the stale `previous` (`false`),\n * which happens to match — net: the button goes live at the same moment,\n * with the disabling outliving the intent for no visible reason.\n * - false → true: Glimmer rewrites the attribute to `true`, we do not\n * re-run, so `previous` is left holding the stale `false`. When loading\n * ends, teardown restores `previous` and sets `disabled = false` — the\n * button ends up enabled even though the consumer's binding says\n * `disabled={{true}}`. This is a fail-open: the consumer's disable is\n * silently and indefinitely lost. See the\n * `'known limitation: a consumer disable applied mid-load is lost when\n * loading ends'` test in buttons-test.gts, which pins this exact case.\n *\n * Closing this would need a MutationObserver watching `disabled` for a case\n * nobody has hit; the project has decided not to add one.\n */\nconst disableWhile = modifier((el: HTMLButtonElement, [loading]: [boolean]) => {\n if (!loading) {\n return;\n }\n\n const previous = el.disabled;\n el.disabled = true;\n\n return () => {\n el.disabled = previous;\n };\n});\n\n/**\n * The spinner stands in for the icon while loading, on whichever side\n * `@iconPlacement` puts it. Extracted so the spinner-or-icon choice is written\n * once; the caller passes the icon through as this component's default block.\n *\n * The invocation below is still written twice, once per side, and that is\n * deliberate: the block contains `{{yield to=\"icon\"}}`, and Glimmer has no way\n * to hoist a block-yielding invocation into a `{{#let}}` or a helper. Only the\n * choice was deduplicated, not the two call sites.\n */\nconst SpinnerOrIcon: TOC<{\n Args: {\n isLoading: boolean;\n spinnerClass: string;\n };\n Blocks: {\n default: [];\n };\n}> = <template>\n {{#if @isLoading}}\n <Spinner @class={{@spinnerClass}} />\n {{else}}\n {{yield}}\n {{/if}}\n</template>;\n\nexport interface ButtonArgs {\n /**\n * The HTML type of the button\n *\n * @defaultValue 'button'\n */\n type?: 'button' | 'submit' | 'reset';\n\n /**\n * The button variant.\n *\n * @defaultValue 'solid'\n */\n variant?:\n 'solid' | 'soft' | 'subtle' | 'outline' | 'ghost' | 'plain' | 'custom';\n\n /**\n * @deprecated Use `variant`. `default` is now `solid`, `outlined` is\n * `outline`, and `minimal` is `plain`.\n */\n appearance?: 'default' | 'soft' | 'outlined' | 'minimal' | 'tonal' | 'custom';\n\n /**\n * The color of the button\n */\n color?:\n | 'neutral'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * @deprecated Use `color`. `default` is now `neutral`.\n */\n intent?:\n | 'default'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * The size of the button\n */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n /**\n * Disable rendering the button element. It yields an object with classNames instead.\n */\n isRenderless?: boolean;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n\n /**\n * If button is part of a group. Most of the time, this is automatically set\n * when using the ButtonGroup component.\n */\n isInGroup?: boolean;\n\n /**\n * Renders a spinner in place of the icon and disables the button.\n *\n * @defaultValue false\n */\n isLoading?: boolean;\n\n /**\n * Which side the `icon` block — and the loading spinner that replaces it —\n * sits on.\n *\n * @defaultValue 'start'\n */\n iconPlacement?: 'start' | 'end';\n\n /**\n * Callback for when the button is pressed.\n */\n onPress?: (event: PressEvent) => void;\n}\n\ninterface ButtonSignature {\n Args: ButtonArgs;\n Blocks: {\n default: [{ classNames: string; isLoading: boolean }];\n icon?: [];\n loading?: [];\n };\n Element: HTMLButtonElement;\n}\n\nclass Button extends Component<ButtonSignature> {\n @tracked isPressed = false;\n\n get type(): string {\n if (this.args.type) {\n return this.args.type;\n }\n return 'button';\n }\n\n get isLoading(): boolean {\n return this.args.isLoading === true;\n }\n\n get isIconAtEnd(): boolean {\n return this.args.iconPlacement === 'end';\n }\n\n get isIconAtStart(): boolean {\n return !this.isIconAtEnd;\n }\n\n @cached\n get classNames(): string {\n const { button } = useStyles();\n\n return button({\n color:\n renamedArgValue(\n this.args.color,\n this.args.intent,\n { default: 'neutral' } as const,\n {\n component: 'Button',\n from: 'intent',\n to: 'color',\n id: 'frontile.button.intent'\n }\n ) || 'neutral',\n size: this.args.size,\n variant:\n renamedArgValue(\n this.args.variant,\n this.args.appearance,\n {\n default: 'solid',\n outlined: 'outline',\n minimal: 'plain',\n soft: 'subtle',\n tonal: 'soft'\n } as const,\n {\n component: 'Button',\n from: 'appearance',\n to: 'variant',\n id: 'frontile.button.appearance'\n }\n ) || 'solid',\n isInGroup: this.args.isInGroup,\n isLoading: this.isLoading,\n class: this.args.class\n });\n }\n\n @cached\n get spinnerClassNames(): string {\n const { buttonSpinner } = useStyles();\n\n return buttonSpinner();\n }\n\n /**\n * The object yielded to the default block (and, when `@isRenderless`, in\n * place of rendering). Hoisted so the shape is written once — it's part of\n * this component's public contract, asserted on directly by tests.\n */\n @cached\n get yieldedHash(): { classNames: string; isLoading: boolean } {\n return { classNames: this.classNames, isLoading: this.isLoading };\n }\n\n handlePressChange = (isPressed: boolean): void => {\n this.isPressed = isPressed;\n };\n\n onPress = (event: PressEvent) => {\n if (typeof this.args.onPress === 'function') {\n this.args.onPress(event);\n }\n };\n\n <template>\n {{#if @isRenderless}}\n {{yield this.yieldedHash}}\n {{else}}\n <button\n type={{this.type}}\n class={{this.classNames}}\n aria-busy={{if this.isLoading \"true\"}}\n data-loading={{if this.isLoading \"true\"}}\n data-pressed={{if this.isPressed \"true\"}}\n data-component=\"button\"\n data-part=\"base\"\n {{press this.onPress onPressChange=this.handlePressChange}}\n ...attributes\n {{disableWhile this.isLoading}}\n >\n {{#if this.isIconAtStart}}\n <SpinnerOrIcon\n @isLoading={{this.isLoading}}\n @spinnerClass={{this.spinnerClassNames}}\n >\n {{yield to=\"icon\"}}\n </SpinnerOrIcon>\n {{/if}}\n\n {{#if this.isLoading}}\n {{#if (has-block \"loading\")}}\n {{yield to=\"loading\"}}\n {{else}}\n {{yield this.yieldedHash}}\n {{/if}}\n {{else}}\n {{yield this.yieldedHash}}\n {{/if}}\n\n {{#if this.isIconAtEnd}}\n <SpinnerOrIcon\n @isLoading={{this.isLoading}}\n @spinnerClass={{this.spinnerClassNames}}\n >\n {{yield to=\"icon\"}}\n </SpinnerOrIcon>\n {{/if}}\n </button>\n {{/if}}\n </template>\n}\n\nexport { Button, type ButtonSignature };\nexport default Button;\n"],"names":["disableWhile","modifier","el","loading","previous","disabled","SpinnerOrIcon","setComponentTemplate","precompileTemplate","strictMode","scope","Spinner","templateOnly","Button","Component","g","prototype","tracked","i","type","args","isLoading","isIconAtEnd","iconPlacement","isIconAtStart","classNames","button","useStyles","color","renamedArgValue","intent","default","component","from","to","id","size","variant","appearance","outlined","minimal","soft","tonal","isInGroup","class","n","cached","spinnerClassNames","buttonSpinner","yieldedHash","handlePressChange","isPressed","onPress","event","press"],"mappings":";;;;;;;;;;;;AAuCA,MAAMA,eAAeC,QAAA,CAAS,CAACC,EAAI,EAAmB,CAACC,OAAA,CAAmB,KAAA;EACxE,IAAI,CAACA,OAAA,EAAS;AACZ,IAAA;AACF,EAAA;AAEA,EAAA,MAAMC,QAAA,GAAWF,GAAGG,QAAQ;EAC5BH,EAAA,CAAGG,QAAQ,GAAG,IAAA;AAEd,EAAA,OAAO,MAAA;IACLH,EAAA,CAAGG,QAAQ,GAAGD,QAAA;EAChB,CAAA;AACF,CAAA,CAAA;AAEA;;;;;;;;;AASC;AACD,MAAME,aAQD,GAAAC,oBAAA,CAAAC,kBAAA,CAAA,4FAAA,EAML;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,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C,OAAA,GAAWC,KAAO,IAAA;IAChB,IAAI,OAAO,IAAI,CAACjC,IAAI,CAACgC,OAAO,KAAK,UAAA,EAAY;AAC3C,MAAA,IAAI,CAAChC,IAAI,CAACgC,OAAO,CAACC,KAAA,CAAA;AACpB,IAAA;EACF,CAAA;AAEA,EAAA;IAAA9C,oBAAA,CAAAC,kBAAA,CAAA,ihCAAA,EA6CA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAA4C,KAAA;QAAAtD,YAAA;AAAAM,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../src/components/buttons/button.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { cached, tracked } from '@glimmer/tracking';\nimport { modifier } from 'ember-modifier';\nimport type { TOC } from '@ember/component/template-only';\nimport { useStyles } from '@frontile/theme';\nimport { press, type PressEvent } from '../../modifiers/press';\nimport { Spinner } from '../utilities/spinner';\nimport { renamedArgValue } from '../../-private/deprecated-args';\n\n/**\n * Sets `disabled` on the element while `loading` is true, restoring whatever\n * the consumer had before. This is a modifier rather than a plain attribute\n * because splattributes are applied last: `disabled={{@isLoading}}` written\n * before `...attributes` is clobbered by a consumer's own `disabled`, and\n * written after it a consumer's `disabled={{false}}` would erase ours.\n * Modifiers run after attributes, so neither ordering problem applies.\n *\n * Known limitation: this re-runs only when `loading` changes, so `previous`\n * is a snapshot taken once at install time — it goes stale if the consumer's\n * own `disabled` binding changes while loading is already in flight, in\n * either direction:\n *\n * - true → false: Glimmer rewrites the attribute to `false`, we do not\n * re-run, so the button stays disabled (from our own `el.disabled = true`)\n * until loading ends and teardown restores the stale `previous` (`false`),\n * which happens to match — net: the button goes live at the same moment,\n * with the disabling outliving the intent for no visible reason.\n * - false → true: Glimmer rewrites the attribute to `true`, we do not\n * re-run, so `previous` is left holding the stale `false`. When loading\n * ends, teardown restores `previous` and sets `disabled = false` — the\n * button ends up enabled even though the consumer's binding says\n * `disabled={{true}}`. This is a fail-open: the consumer's disable is\n * silently and indefinitely lost. See the\n * `'known limitation: a consumer disable applied mid-load is lost when\n * loading ends'` test in buttons-test.gts, which pins this exact case.\n *\n * Closing this would need a MutationObserver watching `disabled` for a case\n * nobody has hit; the project has decided not to add one.\n */\nconst disableWhile = modifier((el: HTMLButtonElement, [loading]: [boolean]) => {\n if (!loading) {\n return;\n }\n\n const previous = el.disabled;\n el.disabled = true;\n\n return () => {\n el.disabled = previous;\n };\n});\n\n/**\n * The spinner stands in for the icon while loading, on whichever side\n * `@iconPlacement` puts it. Extracted so the spinner-or-icon choice is written\n * once; the caller passes the icon through as this component's default block.\n *\n * The invocation below is still written twice, once per side, and that is\n * deliberate: the block contains `{{yield to=\"icon\"}}`, and Glimmer has no way\n * to hoist a block-yielding invocation into a `{{#let}}` or a helper. Only the\n * choice was deduplicated, not the two call sites.\n */\nconst SpinnerOrIcon: TOC<{\n Args: {\n isLoading: boolean;\n spinnerClass: string;\n };\n Blocks: {\n default: [];\n };\n}> = <template>\n {{#if @isLoading}}\n <Spinner @class={{@spinnerClass}} />\n {{else}}\n {{yield}}\n {{/if}}\n</template>;\n\nexport interface ButtonArgs {\n /**\n * The HTML type of the button\n *\n * @defaultValue 'button'\n */\n type?: 'button' | 'submit' | 'reset';\n\n /**\n * The button variant. `glass` is a translucent, color-less fill (it ignores\n * `color`) for use over a colored or imaged surface. `link` is inline, with\n * no fill or side padding, and underlines on hover.\n *\n * @defaultValue 'solid'\n */\n variant?:\n | 'solid'\n | 'soft'\n | 'subtle'\n | 'outline'\n | 'ghost'\n | 'plain'\n | 'custom'\n | 'glass'\n | 'link';\n\n /**\n * @deprecated Use `variant`. `default` is now `solid`, `outlined` is\n * `outline`, and `minimal` is `plain`.\n */\n appearance?: 'default' | 'soft' | 'outlined' | 'minimal' | 'tonal' | 'custom';\n\n /**\n * The color of the button\n */\n color?:\n | 'neutral'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * @deprecated Use `color`. `default` is now `neutral`.\n */\n intent?:\n | 'default'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * The size of the button\n */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n /**\n * Disable rendering the button element. It yields an object with classNames instead.\n */\n isRenderless?: boolean;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n\n /**\n * If button is part of a group. Most of the time, this is automatically set\n * when using the ButtonGroup component.\n */\n isInGroup?: boolean;\n\n /**\n * Renders a spinner in place of the icon and disables the button.\n *\n * @defaultValue false\n */\n isLoading?: boolean;\n\n /**\n * Which side the `icon` block — and the loading spinner that replaces it —\n * sits on.\n *\n * @defaultValue 'start'\n */\n iconPlacement?: 'start' | 'end';\n\n /**\n * Callback for when the button is pressed.\n */\n onPress?: (event: PressEvent) => void;\n}\n\ninterface ButtonSignature {\n Args: ButtonArgs;\n Blocks: {\n default: [{ classNames: string; isLoading: boolean }];\n icon?: [];\n loading?: [];\n };\n Element: HTMLButtonElement;\n}\n\nclass Button extends Component<ButtonSignature> {\n @tracked isPressed = false;\n\n get type(): string {\n if (this.args.type) {\n return this.args.type;\n }\n return 'button';\n }\n\n get isLoading(): boolean {\n return this.args.isLoading === true;\n }\n\n get isIconAtEnd(): boolean {\n return this.args.iconPlacement === 'end';\n }\n\n get isIconAtStart(): boolean {\n return !this.isIconAtEnd;\n }\n\n @cached\n get classNames(): string {\n const { button } = useStyles();\n\n return button({\n color:\n renamedArgValue(\n this.args.color,\n this.args.intent,\n { default: 'neutral' } as const,\n {\n component: 'Button',\n from: 'intent',\n to: 'color',\n id: 'frontile.button.intent'\n }\n ) || 'neutral',\n size: this.args.size,\n variant:\n renamedArgValue(\n this.args.variant,\n this.args.appearance,\n {\n default: 'solid',\n outlined: 'outline',\n minimal: 'plain',\n soft: 'subtle',\n tonal: 'soft'\n } as const,\n {\n component: 'Button',\n from: 'appearance',\n to: 'variant',\n id: 'frontile.button.appearance'\n }\n ) || 'solid',\n isInGroup: this.args.isInGroup,\n isLoading: this.isLoading,\n class: this.args.class\n });\n }\n\n @cached\n get spinnerClassNames(): string {\n const { buttonSpinner } = useStyles();\n\n return buttonSpinner();\n }\n\n /**\n * The object yielded to the default block (and, when `@isRenderless`, in\n * place of rendering). Hoisted so the shape is written once — it's part of\n * this component's public contract, asserted on directly by tests.\n */\n @cached\n get yieldedHash(): { classNames: string; isLoading: boolean } {\n return { classNames: this.classNames, isLoading: this.isLoading };\n }\n\n handlePressChange = (isPressed: boolean): void => {\n this.isPressed = isPressed;\n };\n\n onPress = (event: PressEvent) => {\n if (typeof this.args.onPress === 'function') {\n this.args.onPress(event);\n }\n };\n\n <template>\n {{#if @isRenderless}}\n {{yield this.yieldedHash}}\n {{else}}\n <button\n type={{this.type}}\n class={{this.classNames}}\n aria-busy={{if this.isLoading \"true\"}}\n data-loading={{if this.isLoading \"true\"}}\n data-pressed={{if this.isPressed \"true\"}}\n data-component=\"button\"\n data-part=\"base\"\n {{press this.onPress onPressChange=this.handlePressChange}}\n ...attributes\n {{disableWhile this.isLoading}}\n >\n {{#if this.isIconAtStart}}\n <SpinnerOrIcon\n @isLoading={{this.isLoading}}\n @spinnerClass={{this.spinnerClassNames}}\n >\n {{yield to=\"icon\"}}\n </SpinnerOrIcon>\n {{/if}}\n\n {{#if this.isLoading}}\n {{#if (has-block \"loading\")}}\n {{yield to=\"loading\"}}\n {{else}}\n {{yield this.yieldedHash}}\n {{/if}}\n {{else}}\n {{yield this.yieldedHash}}\n {{/if}}\n\n {{#if this.isIconAtEnd}}\n <SpinnerOrIcon\n @isLoading={{this.isLoading}}\n @spinnerClass={{this.spinnerClassNames}}\n >\n {{yield to=\"icon\"}}\n </SpinnerOrIcon>\n {{/if}}\n </button>\n {{/if}}\n </template>\n}\n\nexport { Button, type ButtonSignature };\nexport default Button;\n"],"names":["disableWhile","modifier","el","loading","previous","disabled","SpinnerOrIcon","setComponentTemplate","precompileTemplate","strictMode","scope","Spinner","templateOnly","Button","Component","g","prototype","tracked","i","type","args","isLoading","isIconAtEnd","iconPlacement","isIconAtStart","classNames","button","useStyles","color","renamedArgValue","intent","default","component","from","to","id","size","variant","appearance","outlined","minimal","soft","tonal","isInGroup","class","n","cached","spinnerClassNames","buttonSpinner","yieldedHash","handlePressChange","isPressed","onPress","event","press"],"mappings":";;;;;;;;;;;;AAuCA,MAAMA,eAAeC,QAAA,CAAS,CAACC,EAAI,EAAmB,CAACC,OAAA,CAAmB,KAAA;EACxE,IAAI,CAACA,OAAA,EAAS;AACZ,IAAA;AACF,EAAA;AAEA,EAAA,MAAMC,QAAA,GAAWF,GAAGG,QAAQ;EAC5BH,EAAA,CAAGG,QAAQ,GAAG,IAAA;AAEd,EAAA,OAAO,MAAA;IACLH,EAAA,CAAGG,QAAQ,GAAGD,QAAA;EAChB,CAAA;AACF,CAAA,CAAA;AAEA;;;;;;;;;AASC;AACD,MAAME,aAQD,GAAAC,oBAAA,CAAAC,kBAAA,CAAA,4FAAA,EAML;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA,CAAA;AA8GV,MAAMC,eAAeC,SAAA,CAAU;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CAC5BC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAoB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;EAErB,IAAIC,IAAAA,GAAe;AACjB,IAAA,IAAI,IAAI,CAACC,IAAI,CAACD,IAAI,EAAE;AAClB,MAAA,OAAO,IAAI,CAACC,IAAI,CAACD,IAAI;AACvB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|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chip.js","sources":["../../../src/components/buttons/chip.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { deprecate } from '@ember/debug';\nimport { useStyles } from '@frontile/theme';\nimport { CloseButton } from './close-button';\nimport { renamedArgValue } from '../../-private/deprecated-args';\n\ninterface ChipSignature {\n Args: {\n /**\n * The chip variant.\n *\n * @defaultValue 'solid'\n */\n variant?: 'solid' | 'outline' | 'soft';\n\n /**\n * @deprecated Use `variant`. `default` is now `solid`, `outlined` is\n * `outline`, and `faded` is `soft`.\n */\n appearance?: 'default' | 'outlined' | 'faded';\n\n /**\n * The color of the chip.\n */\n color?:\n | 'neutral'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * @deprecated Use `color`. `default` is now `neutral`.\n */\n intent?:\n | 'default'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * The size of the chip\n *\n * @defaultValue '
|
|
1
|
+
{"version":3,"file":"chip.js","sources":["../../../src/components/buttons/chip.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { deprecate } from '@ember/debug';\nimport { useStyles } from '@frontile/theme';\nimport { CloseButton } from './close-button';\nimport { renamedArgValue } from '../../-private/deprecated-args';\n\ninterface ChipSignature {\n Args: {\n /**\n * The chip variant.\n *\n * @defaultValue 'solid'\n */\n variant?: 'solid' | 'outline' | 'soft';\n\n /**\n * @deprecated Use `variant`. `default` is now `solid`, `outlined` is\n * `outline`, and `faded` is `soft`.\n */\n appearance?: 'default' | 'outlined' | 'faded';\n\n /**\n * The color of the chip.\n */\n color?:\n | 'neutral'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * @deprecated Use `color`. `default` is now `neutral`.\n */\n intent?:\n | 'default'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'success'\n | 'warning'\n | 'danger';\n\n /**\n * The size of the chip. Uses Button's size names and text size: the same\n * `@size` gives the same label text size on Chip, Badge and Button.\n *\n * @defaultValue 'xs'\n */\n size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n /**\n * @deprecated Ignored. Chip is always a pill; use `Badge` for a squared\n * label.\n */\n radius?: 'none' | 'sm' | 'lg' | 'full';\n\n /**\n * Adds a dot before the content, colored by `@color`. On the `solid`\n * variant the dot takes the chip's text color, since the chip's\n * background is already the chip's color.\n *\n * @defaultValue false\n */\n withDot?: boolean;\n\n /**\n * Function to be called when clicking on the close button.\n * If you pass this argument, the close button will be visible.\n */\n onClose?: () => void;\n\n /**\n * The accessible name of the close button. Every close button would\n * otherwise be announced as just \"Close\", which does not say *what* is\n * being removed — worth setting when several chips sit together.\n *\n * @defaultValue 'Close'\n */\n closeButtonTitle?: string;\n\n /**\n * `tabindex` for the close button.\n *\n * Set to `-1` when chips sit inside another control (a multi-select field,\n * say) and the close button should stay a pointer affordance: every chip\n * would otherwise cost a Tab stop before the control itself is reached.\n * Whoever does this owes keyboard users another way to remove a chip.\n *\n * @defaultValue undefined (the close button is a normal tab stop)\n */\n closeButtonTabIndex?: number | string;\n\n /**\n * Dims the chip and disables its close button, if any.\n *\n * @defaultValue false\n */\n isDisabled?: boolean;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n };\n Blocks: {\n default: [];\n };\n Element: HTMLDivElement;\n}\n\nclass Chip extends Component<ChipSignature> {\n get classNames() {\n const { chip } = useStyles();\n\n if (this.args.radius !== undefined) {\n deprecate(\n 'Chip: `@radius` is deprecated and ignored. Chip is always a pill; use `Badge` for a squared label.',\n false,\n {\n id: 'frontile.chip.radius',\n until: '0.19.0',\n for: 'frontile',\n since: { available: '0.18.0', enabled: '0.18.0' }\n }\n );\n }\n\n const { base, content, dot, closeButton } = chip({\n color:\n renamedArgValue(\n this.args.color,\n this.args.intent,\n { default: 'neutral' } as const,\n {\n component: 'Chip',\n from: 'intent',\n to: 'color',\n id: 'frontile.chip.intent'\n }\n ) || 'neutral',\n size: this.args.size,\n variant:\n renamedArgValue(\n this.args.variant,\n this.args.appearance,\n { default: 'solid', outlined: 'outline', faded: 'soft' } as const,\n {\n component: 'Chip',\n from: 'appearance',\n to: 'variant',\n id: 'frontile.chip.appearance'\n }\n ) || 'solid',\n isDisabled: this.args.isDisabled\n });\n\n return {\n base: base({ class: this.args.class }),\n content: content(),\n dot: dot(),\n closeButton: closeButton()\n };\n }\n\n <template>\n <div\n class={{this.classNames.base}}\n data-component=\"chip\"\n data-part=\"base\"\n ...attributes\n >\n {{#if @withDot}}\n <span class={{this.classNames.dot}} data-part=\"dot\"></span>\n {{/if}}\n <span class={{this.classNames.content}} data-part=\"content\">\n {{yield}}\n </span>\n {{#if @onClose}}\n <CloseButton\n @class={{this.classNames.closeButton}}\n @title={{@closeButtonTitle}}\n @onPress={{@onClose}}\n tabindex={{@closeButtonTabIndex}}\n disabled={{@isDisabled}}\n data-part=\"close-button\"\n />\n {{/if}}\n </div>\n </template>\n}\n\nexport { Chip, type ChipSignature };\nexport default Chip;\n"],"names":["Chip","Component","classNames","chip","useStyles","args","radius","undefined","deprecate","id","until","for","since","available","enabled","base","content","dot","closeButton","color","renamedArgValue","intent","default","component","from","to","size","variant","appearance","outlined","faded","isDisabled","class","setComponentTemplate","precompileTemplate","strictMode","scope","CloseButton"],"mappings":";;;;;;;;AAiHA,MAAMA,aAAaC,SAAA,CAAU;EAC3B,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAM,GAAGC,SAAA,EAAA;AAEjB,IAAA,IAAI,IAAI,CAACC,IAAI,CAACC,MAAM,KAAKC,SAAA,EAAW;AAClCC,MAAAA,SAAA,CACE,sGACA,KAAA,EACA;AACEC,QAAAA,EAAA,EAAI,sBAAA;AACJC,QAAAA,KAAA,EAAO,QAAA;AACPC,QAAAA,GAAA,EAAK,UAAA;AACLC,QAAAA,KAAA,EAAO;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AAAC,kBAAA,CAAA,ygBAAA,EAwBA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Button } from './button.js';
|
|
2
|
+
import { assert } from '@ember/debug';
|
|
3
|
+
import Component from '@glimmer/component';
|
|
4
|
+
import { useStyles } from '@frontile/theme';
|
|
5
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
|
+
import { setComponentTemplate } from '@ember/component';
|
|
7
|
+
|
|
8
|
+
class IconButton extends Component {
|
|
9
|
+
get label() {
|
|
10
|
+
assert('IconButton: @label is required, an icon-only button has no other accessible name.', typeof this.args.label === 'string' && this.args.label.trim() !== '');
|
|
11
|
+
return this.args.label;
|
|
12
|
+
}
|
|
13
|
+
get classNames() {
|
|
14
|
+
const {
|
|
15
|
+
iconButton
|
|
16
|
+
} = useStyles();
|
|
17
|
+
return iconButton({
|
|
18
|
+
size: this.args.size,
|
|
19
|
+
class: this.args.class
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
static {
|
|
23
|
+
setComponentTemplate(precompileTemplate("<Button @size={{@size}} @color={{@color}} @variant={{@variant}} @isLoading={{@isLoading}} @type={{@type}} @onPress={{@onPress}} @class={{this.classNames}} aria-label={{this.label}} data-component=\"icon-button\" ...attributes>\n <:icon>{{yield}}</:icon>\n</Button>", {
|
|
24
|
+
strictMode: true,
|
|
25
|
+
scope: () => ({
|
|
26
|
+
Button
|
|
27
|
+
})
|
|
28
|
+
}), this);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { IconButton, IconButton as default };
|
|
33
|
+
//# sourceMappingURL=icon-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-button.js","sources":["../../../src/components/buttons/icon-button.gts"],"sourcesContent":["import { Button, type ButtonArgs } from './button';\nimport { assert } from '@ember/debug';\nimport Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\nimport type { PressEvent } from '../../modifiers/press';\n\nexport interface IconButtonSignature {\n Args: {\n /**\n * The accessible name. An icon-only button has no text, so this is\n * required and must not be empty; it becomes the button's `aria-label`.\n */\n label: string;\n\n /**\n * The size of the button. Same names as Button, and the same height, so\n * an IconButton lines up with a Button of that size.\n *\n * @defaultValue 'md'\n */\n size?: ButtonArgs['size'];\n\n /** The color of the button. Same values as Button. */\n color?: ButtonArgs['color'];\n\n /** The button variant. Same values as Button. */\n variant?: ButtonArgs['variant'];\n\n /**\n * Renders a spinner in place of the icon and disables the button.\n *\n * @defaultValue false\n */\n isLoading?: boolean;\n\n /** The HTML type of the button. */\n type?: ButtonArgs['type'];\n\n /** Callback for when the button is pressed. */\n onPress?: (event: PressEvent) => void;\n\n /**\n * Custom class name, it will override the default ones using Tailwind\n * Merge library.\n */\n class?: string;\n };\n Blocks: {\n /** The icon, for example an inline `<svg>`. Sized to the button's text. */\n default: [];\n };\n Element: HTMLButtonElement;\n}\n\nclass IconButton extends Component<IconButtonSignature> {\n get label(): string {\n assert(\n 'IconButton: @label is required, an icon-only button has no other accessible name.',\n typeof this.args.label === 'string' && this.args.label.trim() !== ''\n );\n\n return this.args.label;\n }\n\n get classNames(): string {\n const { iconButton } = useStyles();\n\n return iconButton({ size: this.args.size, class: this.args.class });\n }\n\n <template>\n <Button\n @size={{@size}}\n @color={{@color}}\n @variant={{@variant}}\n @isLoading={{@isLoading}}\n @type={{@type}}\n @onPress={{@onPress}}\n @class={{this.classNames}}\n aria-label={{this.label}}\n data-component=\"icon-button\"\n ...attributes\n >\n <:icon>{{yield}}</:icon>\n </Button>\n </template>\n}\n\nexport { IconButton };\nexport default IconButton;\n"],"names":["IconButton","Component","label","assert","args","trim","classNames","iconButton","useStyles","size","class","setComponentTemplate","precompileTemplate","strictMode","scope","Button"],"mappings":";;;;;;;AAsDA,MAAMA,mBAAmBC,SAAA,CAAU;EACjC,IAAIC,KAAAA,GAAgB;IAClBC,MAAA,CACE,qFACA,OAAO,IAAI,CAACC,IAAI,CAACF,KAAK,KAAK,QAAA,IAAY,IAAI,CAACE,IAAI,CAACF,KAAK,CAACG,IAAI,EAAA,KAAO,EAAA,CAAA;AAGpE,IAAA,OAAO,IAAI,CAACD,IAAI,CAACF,KAAK;AACxB,EAAA;EAEA,IAAII,UAAAA,GAAqB;IACvB,MAAM;AAAEC,MAAAA;KAAY,GAAGC,SAAA,EAAA;AAEvB,IAAA,OAAOD,UAAA,CAAW;AAAEE,MAAAA,IAAA,EAAM,IAAI,CAACL,IAAI,CAACK,IAAI;AAAEC,MAAAA,KAAA,EAAO,IAAI,CAACN,IAAI,CAACM;AAAM,KAAA,CAAA;AACnE,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,2QAAA,EAeA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Button } from './button.js';
|
|
2
2
|
export { CloseButton } from './close-button.js';
|
|
3
|
+
export { IconButton } from './icon-button.js';
|
|
3
4
|
export { ToggleButton } from './toggle-button.js';
|
|
4
5
|
export { ButtonGroup } from './button-group.js';
|
|
5
6
|
export { Chip } from './chip.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -357,7 +357,7 @@ class Select extends Component {
|
|
|
357
357
|
// wrote.
|
|
358
358
|
color: chip?.color ?? this.args.color ?? (chip?.intent ?? this.args.intent ? undefined : 'neutral'),
|
|
359
359
|
intent: chip?.intent ?? this.args.intent,
|
|
360
|
-
size: chip?.size ?? '
|
|
360
|
+
size: chip?.size ?? 'xs',
|
|
361
361
|
radius: chip?.radius,
|
|
362
362
|
withDot: chip?.withDot ?? false
|
|
363
363
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sources":["../../../../src/components/forms/select/select.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked, cached } from '@glimmer/tracking';\nimport type Owner from '@ember/owner';\nimport { assert } from '@ember/debug';\nimport { on } from '@ember/modifier';\nimport { modifier } from 'ember-modifier';\nimport { useStyles } from '@frontile/theme';\nimport { renamedArgValue } from '../../../-private/deprecated-args';\n\nimport type { ListItem } from '../native-select';\nimport { Listbox } from '../../collections/listbox';\nimport { VisuallyHidden } from '../../utilities/visually-hidden';\nimport { Popover } from '../../overlays/popover';\nimport { FormControl } from '../form-control';\nimport { ref } from '../../../utils/ref';\nimport { ControlBlurTracker } from '../../../-private/control-blur';\nimport { triggerFormInputEvent } from '../../../utils/forms-utils-index';\nimport { canDeselectKey, keyAndLabelForItem } from '../../../utils/listManager';\nimport {\n filterAndRankItems,\n limitItems,\n type DisplayLimitContentArgs\n} from '../../../utils/filter';\n\nimport { SelectNativeMirror } from './native-mirror';\nimport { SelectTrigger } from './trigger';\nimport { SelectedChips } from './selected-items';\nimport { SelectEndContent } from './end-content';\nimport type {\n DefaultSingleSelectArgs,\n ExplicitSingleSelectArgs,\n ResolvedSelectChipOptions,\n SelectArgs,\n SelectChipOptions,\n SelectSignature,\n SelectedItem,\n SelectedItemBlockArg\n} from './types';\n\n// Import helper function directly instead of using ember-truth-helpers\nconst and = (a: unknown, b: unknown) => Boolean(a) && Boolean(b);\n\n/*\n * Internal `_selectedKey` / `_selectedKeys` are the source of truth for\n * rendering. `@selectedKey(s)` seeds them in the constructor and the\n * `updateSingle/MultipleSelectValue` modifiers keep them synced whenever the\n * arg changes; user interactions update them directly for an immediate UI\n * response, then call `@onSelectionChange` so the parent can update its copy.\n */\n/**\n * A dropdown selection component: a custom listbox in a popover, backed by a\n * visually hidden native `<select>` so the value submits with a form.\n *\n * Selection can be controlled with `@selectedKey` / `@selectedKeys` plus\n * `@onSelectionChange`, or left uncontrolled.\n */\nclass Select<T = unknown> extends Component<SelectSignature<T>> {\n /**\n * Every item registered by the hidden native `<select>`, in item order.\n *\n * The hidden select is deliberately given the *unfiltered* `@items` — it\n * carries the form value, which must not shrink to the filter — so this\n * covers every selected item even while the listbox is filtered down\n * (`mirroredItems` keeps them past `@displayLimit` too). Chips and the\n * joined text value can therefore be resolved straight from it.\n */\n @tracked nodes: ListItem[] = [];\n\n @tracked isOpen = false;\n /**\n * Internal tracked state for single selection mode.\n * Source of truth for rendering. Synced with @selectedKey via the updateSingleSelectValue modifier.\n */\n @tracked _selectedKey: string | null = null;\n\n /**\n * Internal tracked state for multiple selection mode.\n * Source of truth for rendering. Synced with @selectedKeys via the updateMultipleSelectValue modifier.\n */\n @tracked _selectedKeys: string[] = [];\n\n constructor(owner: Owner, args: SelectArgs<T>) {\n super(owner, args);\n\n if (this.args.selectionMode === 'multiple') {\n this._selectedKeys = this.args.selectedKeys || [];\n } else {\n this._selectedKey =\n (this.args as ExplicitSingleSelectArgs<T> | DefaultSingleSelectArgs<T>)\n .selectedKey || null;\n }\n\n this.validateArgs();\n }\n\n validateArgs() {\n if (this.args.selectionMode === 'multiple') {\n if (\n typeof (this.args as unknown as Record<string, unknown>)[\n 'selectedKey'\n ] !== 'undefined'\n ) {\n console.warn(\n 'WARNING: selectedKey is not supported in multiple selection mode. Use selectedKeys instead.'\n );\n }\n } else {\n if (\n typeof (this.args as unknown as Record<string, unknown>)[\n 'selectedKeys'\n ] !== 'undefined'\n ) {\n console.warn(\n 'WARNING: selectedKeys is deprecated for single selection mode. Use selectedKey instead.'\n );\n }\n }\n }\n\n @tracked filterValue?: string;\n\n containerRef = ref<HTMLDivElement>();\n triggerRef = ref<HTMLInputElement | HTMLButtonElement>();\n chipsContainerRef = ref<HTMLDivElement>();\n\n onSelectionChange = (keys: string[]) => {\n if (this.args.selectionMode === 'multiple') {\n this._selectedKeys = keys;\n if (typeof this.args.onSelectionChange === 'function') {\n (this.args.onSelectionChange as (keys: string[]) => void)(keys);\n }\n } else {\n const singleKey: string | null = keys.length > 0 ? keys[0] || null : null;\n this._selectedKey = singleKey;\n if (typeof this.args.onSelectionChange === 'function') {\n (this.args.onSelectionChange as (key: string | null) => void)(\n singleKey\n );\n }\n }\n\n this.filterValue = undefined;\n triggerFormInputEvent(this.containerRef.current);\n };\n\n /**\n * Like `onSelectionChange`, but for the native `<select>`'s single-value API.\n */\n onSingleSelectionChange = (key: string | null) => {\n this._selectedKey = key;\n if (typeof this.args.onSelectionChange === 'function') {\n (this.args.onSelectionChange as (key: string | null) => void)(key);\n }\n\n this.filterValue = undefined;\n triggerFormInputEvent(this.containerRef.current);\n };\n\n onOpenChange = (isOpen: boolean) => {\n this.isOpen = isOpen;\n };\n\n onFilterChange = (event: Event) => {\n const target = event.target as HTMLInputElement;\n this.filterValue = target.value;\n };\n\n /**\n * Enter in the open filter picks the active option (the Listbox handles\n * that), so it must not also submit a wrapping form, the same guard\n * Autocomplete has. Closed, Enter is left to the form.\n *\n * Backspace on an empty filter removes the last chip — the familiar tag-input\n * gesture. With text in the filter, Backspace edits the text as usual.\n */\n handleFilterKeydown = (event: KeyboardEvent) => {\n if (event.key === 'Enter' && this.isOpen) {\n event.preventDefault();\n return;\n }\n if (event.key !== 'Backspace' || !this.showChips) {\n return;\n }\n const target = event.target as HTMLInputElement;\n if (target.value !== '') {\n return;\n }\n this.removeLastSelectedKey();\n };\n\n /**\n * The non-filterable counterpart of {@link handleFilterKeydown}.\n *\n * Chip close buttons are deliberately outside the tab order (they would\n * otherwise cost a Tab stop each before the combobox is reached), so\n * Backspace/Delete on the trigger is the *only* keyboard route to removing a\n * chip here. There is no text to edit on a button trigger, so both keys act\n * immediately; `preventDefault` keeps Backspace from navigating back.\n */\n handleTriggerKeydown = (event: KeyboardEvent) => {\n if (!this.showChips || this.args.isDisabled) {\n return;\n }\n if (event.key !== 'Backspace' && event.key !== 'Delete') {\n return;\n }\n event.preventDefault();\n this.removeLastSelectedKey();\n };\n\n /**\n * Removes the trailing chip. `removeSelectedKey` applies the same\n * `@allowEmpty` rule the chip close buttons follow, so the last required\n * selection stays put.\n */\n removeLastSelectedKey(): void {\n const items = this.selectedItems;\n const last = items[items.length - 1];\n if (last) {\n this.removeSelectedKey(last.key);\n }\n }\n\n /** Current selection normalized to an array, for template rendering. */\n get selectedKeys(): string[] {\n if (this.args.selectionMode === 'multiple') {\n return this._selectedKeys;\n } else {\n const key = this.getSelectedKey;\n return key ? [key] : [];\n }\n }\n\n get getSelectedKey(): string | null {\n return this._selectedKey;\n }\n\n get blockScroll() {\n if (this.args.blockScroll === false) {\n return false;\n }\n return true;\n }\n\n get disableFocusTrap() {\n if (this.args.disableFocusTrap === false) {\n return false;\n }\n return true;\n }\n\n onAction = (key: string) => {\n if (typeof this.args.onAction === 'function') {\n this.args.onAction(key);\n }\n\n if (\n this.args.closeOnItemSelect !== false &&\n this.args.selectionMode !== 'multiple'\n ) {\n this.isOpen = false;\n }\n\n // Deliberately does not touch `@onBlur`. Selecting is not blurring: this\n // runs on every option click, including the ones that leave the dropdown\n // open in multiple selection mode. Focus loss is reported by\n // `blurTracker` instead, from the trigger's own `focusout`.\n };\n\n /**\n * Reports focus leaving the *whole* control -- the field and its portaled\n * dropdown -- rather than the trigger, which blurs on the way into the\n * dropdown and on every option click. See `ControlBlurTracker`.\n */\n blurTracker = new ControlBlurTracker({\n trigger: () => this.triggerRef.current,\n container: () => this.containerRef.current,\n isOpen: () => this.isOpen,\n isDestroyed: () => this.isDestroyed || this.isDestroying,\n onBlur: () => this.args.onBlur?.()\n });\n\n willDestroy(): void {\n super.willDestroy();\n // Nothing may resolve against a destroyed component.\n this.blurTracker.cancel();\n }\n\n /**\n * In chips mode the trigger is only as wide as the room left over beside the\n * chips, so the field's padding -- and the strip under the chevron -- are not\n * part of it, and with a single selection the trigger can be a narrow sliver.\n * Without this, clicking anywhere else in the field would do nothing, while\n * the same click anywhere on a non-chips field opens the dropdown (there the\n * trigger *is* the whole field). Forwards such a click to the trigger,\n * including clicks on a chip's own body, so the whole field is a click\n * target. The one exception is a chip's close button: within the chips\n * container the only `<button>` elements a chip ever renders are its close\n * button (see chip.gts / close-button.gts), so `closest('button')` combined\n * with containment against `chipsContainerRef` identifies it without relying\n * on any test-only attribute. Clicks on the trigger itself are left alone\n * too, since it already handles its own clicks.\n */\n handleFieldClick = (event: MouseEvent): void => {\n if (!this.showChips || this.args.isDisabled) {\n return;\n }\n\n const trigger = this.triggerRef.current;\n const target = event.target;\n\n if (!trigger || !(target instanceof Element)) {\n return;\n }\n\n // The trigger handles its own clicks; this listener also sees them bubble.\n if (trigger === target || trigger.contains(target)) {\n return;\n }\n\n const chipsContainer = this.chipsContainerRef.current;\n\n if (chipsContainer && chipsContainer.contains(target)) {\n const closeButton = target.closest('button');\n if (closeButton && chipsContainer.contains(closeButton)) {\n return;\n }\n }\n\n trigger.focus();\n trigger.click();\n };\n\n /**\n * Wipes the selection from the clear button.\n *\n * Unlike the chips and the listbox options, this deliberately does *not*\n * consult `@allowEmpty`. `@allowEmpty` governs deselecting *an option* --\n * the listbox refuses to let the last one be toggled off, and\n * `chipsRemovable` mirrors that -- whereas `@isClearable` is a separate,\n * explicit affordance the consumer opts into for exactly this purpose. It\n * also defaults to `false`, so honouring it here would render the clear\n * button dead in every default configuration. Documented as an override on\n * `@isClearable` itself; the two must keep saying the same thing.\n *\n * A disabled Select renders no clear button at all (see `isClearable`), so\n * there is nothing to guard here.\n */\n clearSelectedKeys = () => {\n this.onSelectionChange([]);\n };\n\n /**\n * Resolved once (`@cached`) and forwarded to the internal `Listbox` as\n * `@variant` only -- never `@appearance` as well, which would make the\n * inner `Listbox` raise its own deprecation for the same usage.\n */\n @cached\n get variant() {\n return renamedArgValue(\n this.args.variant,\n this.args.appearance,\n { default: 'solid', outlined: 'outline', faded: 'subtle' } as const,\n {\n component: 'Select',\n from: 'appearance',\n to: 'variant',\n id: 'frontile.select.appearance'\n }\n );\n }\n\n /**\n * Resolved once (`@cached`) and forwarded to the internal `Listbox` as\n * `@color` only -- never `@intent` as well, which would make the inner\n * `Listbox` raise its own deprecation for the same usage.\n */\n @cached\n get color() {\n return renamedArgValue(\n this.args.color,\n this.args.intent,\n { default: 'neutral' } as const,\n {\n component: 'Select',\n from: 'intent',\n to: 'color',\n id: 'frontile.select.intent'\n }\n );\n }\n\n /**\n * Resolved chip appearance: `@chip` wins, then the Select's own `@color`\n * (or deprecated `@intent`), then chip defaults tuned for sitting inside a\n * field.\n */\n get chipOptions(): ResolvedSelectChipOptions {\n const chip =\n this.args.selectionMode === 'multiple' ? this.args.chip : undefined;\n return {\n // `appearance` is passed through only when the consumer set it. Giving\n // it a default would make Chip's deprecation fire on every chip render.\n variant: chip?.variant ?? (chip?.appearance ? undefined : 'soft'),\n appearance: chip?.appearance,\n // `intent` is passed through only when the consumer (or Select's own\n // deprecated `@intent`) actually set it. Defaulting it would fire\n // Chip's `intent` deprecation on every chip render, for a prop nobody\n // wrote.\n color:\n chip?.color ??\n this.args.color ??\n ((chip?.intent ?? this.args.intent) ? undefined : 'neutral'),\n intent: chip?.intent ?? this.args.intent,\n size: chip?.size ?? 'sm',\n radius: chip?.radius,\n withDot: chip?.withDot ?? false\n };\n }\n\n /**\n * Whether chips may be removed. Mirrors the listbox: with `@allowEmpty`\n * false — the default — the final selection cannot be deselected, so its\n * chip renders without a close button rather than with a dead one.\n */\n get chipsRemovable(): boolean {\n // Asks `canDeselectKey` — the rule the listbox itself applies when an\n // already-selected option is clicked — rather than restating it, so a chip\n // and its option can never disagree about the same removal.\n //\n // Asked of `selectedItems`, the collection the chips render from, so the\n // decision cannot disagree with what is on screen either (a selected key\n // with no remembered item would otherwise be counted but never render a\n // chip at all). Every chip's key is in that collection by construction, so\n // the rule's answer is the same for all of them; it is asked of the last\n // chip, the one Backspace removes.\n const keys = this.selectedItems.map((item) => item.key);\n const lastKey = keys[keys.length - 1];\n\n // With nothing selected there is no chip, so nothing reads this today --\n // but the answer is deliberately `@allowEmpty`, not `false`. That is what\n // this getter has always returned for an empty selection, and keeping it\n // means the answer never depends on whether a chip happens to exist right\n // now. `canDeselectKey` cannot be asked here (it needs a key), so the\n // empty case is answered directly. Do not \"simplify\" this away.\n if (lastKey === undefined) {\n return this.args.allowEmpty === true;\n }\n\n return canDeselectKey(keys, lastKey, this.args.allowEmpty);\n }\n\n /**\n * Removes a single selection from a chip's close button. Routes through\n * `onSelectionChange`, which already syncs internal state, notifies the\n * parent and dispatches the form input event.\n */\n removeSelectedKey = (key: string) => {\n if (this.args.isDisabled || !this.chipsRemovable) {\n return;\n }\n this.onSelectionChange(this.selectedKeys.filter((k) => k !== key));\n };\n\n onItemsChange = (nodes: ListItem[], _: 'add' | 'remove') => {\n // `onItemsChange` runs while a modifier installs, i.e. inside a render\n // pass. Reading a tracked field here and writing it in the same\n // computation would trip Glimmer's read-then-write assertion, so `nodes`\n // is only ever written, never read, in this callback.\n this.nodes = nodes;\n };\n\n didClose = () => {\n this.filterValue = undefined;\n if (typeof this.args.didClose === 'function') {\n this.args.didClose();\n }\n };\n\n /**\n * Whether selections render as chips. Chips are the default presentation for\n * multiple selection mode; `@selectedItemsDisplay=\"text\"` opts back out to the\n * comma-joined string.\n */\n get showChips(): boolean {\n return (\n this.args.selectionMode === 'multiple' &&\n this.args.selectedItemsDisplay !== 'text'\n );\n }\n\n get hasSelection(): boolean {\n return this.selectedKeys.length > 0;\n }\n\n /**\n * The accessible name for the trigger when its own text cannot supply one.\n *\n * Left to itself the trigger names itself from its own text -- the selected\n * label, or the placeholder -- and that is still what happens in the plain\n * case; see the trigger, which only applies this when it has to.\n *\n * Two cases need it:\n *\n * - **Chips mode.** The trigger renders nothing; the chips are its siblings\n * and are read separately. Naming the *control* is both enough and\n * correct here -- appending the selection would have it read twice -- so\n * this returns the bare name.\n * - **A `:selectedItem` block.** The block owns the trigger's content and may\n * render nothing readable at all (an avatar, an icon), which would leave\n * the combobox announced as an unnamed button. The selection is not\n * readable anywhere else in that case, so the name carries it: the control\n * name *and* the selected options' text.\n *\n * With nothing selected the placeholder is the trigger's visible text, so\n * it joins the name (`Merchant, All merchants`) rather than being dropped.\n *\n * The two halves are composed so that the separator only appears when both\n * are there. A selected key with no registered option behind it resolves to\n * no text at all, and `\"Owner, \"` is announced as \"Owner comma\"; and with\n * neither `@label` nor `@placeholder` the only control name available is the\n * hardcoded, unlocalizable `Select options`, so the selected text is left to\n * name the control on its own rather than be prefixed by English.\n */\n get triggerAccessibleName(): string {\n const name = this.args.label || this.args.placeholder;\n\n // Nothing selected: the placeholder is the visible text, so it joins the\n // name (WCAG 2.5.3 Label in Name).\n if (!this.hasSelection && this.args.label && this.args.placeholder) {\n return this.args.label === this.args.placeholder\n ? this.args.label\n : `${this.args.label}, ${this.args.placeholder}`;\n }\n\n // Chips mode names the *control* only -- the chips are read separately --\n // and has no better fallback than the literal.\n if (this.showChips) {\n return name || 'Select options';\n }\n\n const selectedText = this.hasSelection ? this.selectedTextValue : '';\n\n if (!name) {\n return selectedText || 'Select options';\n }\n\n return selectedText ? `${name}, ${selectedText}` : name;\n }\n\n /**\n * The selected options in item order (not click order) so chips do not\n * reorder underneath the user as they select.\n *\n * Resolved against `nodes`, which the hidden native `<select>` populates from\n * the unfiltered `@items`, so a chip stays put while a filter hides the item\n * it came from.\n */\n get selectedItems(): SelectedItem[] {\n const keys = this.selectedKeys;\n return this.nodes\n .filter((node) => keys.includes(node.key))\n .map((node) => ({\n key: node.key,\n textValue: node.textValue,\n item: node.item\n }));\n }\n\n /**\n * The same selection `selectedItems` describes, rendered as text.\n *\n * Chips and this string are two presentations of one thing, so they read one\n * projection: walking `nodes` a second time here is how a fix to the\n * selection's contents once landed in the chips and not in the text.\n */\n get selectedTextValue(): string {\n return this.selectedItems.map((item) => item.textValue).join(', ');\n }\n\n get backdrop() {\n if (typeof this.args.backdrop === 'undefined') {\n return 'transparent';\n }\n return this.args.backdrop;\n }\n\n get classes() {\n const { select } = useStyles();\n // Referenced here, on the always-rendered root, so `@appearance`/\n // `@variant` (and `@intent`/`@color`) raises its deprecation regardless\n // of whether the popover content (and so the internal `Listbox`) is\n // currently mounted.\n void this.variant;\n void this.color;\n return select({\n size: this.args.inputSize,\n hasChips: this.showChips,\n isFilterable: !!this.args.isFilterable,\n hasSelection: this.hasSelection\n });\n }\n\n /**\n * Whether the clear button takes the chevron's place: something to clear,\n * and a control that can act on it. A disabled Select never shows it -- the\n * end-content cluster is not pointer-transparent to it and it carries no\n * disabled state of its own, so it would otherwise be a focusable button\n * that clears a field the user is not allowed to change.\n */\n get isClearable() {\n return (\n this.args.isClearable &&\n !this.args.isDisabled &&\n this.selectedKeys &&\n this.selectedKeys.length > 0\n );\n }\n\n get filterFieldValue() {\n if (this.filterValue !== undefined) {\n return this.filterValue;\n }\n // With chips, the selection is already visible beside the input. Echoing\n // the joined text here would fill the box and block typing.\n if (this.showChips) {\n return '';\n }\n return this.selectedTextValue;\n }\n\n // Cached: the listbox, the empty content and the display limit read it, and\n // filtering a long list on every read would repeat the work per keystroke.\n @cached\n get filteredItems() {\n if (this.filterValue === undefined) {\n return this.args.items;\n }\n\n return filterAndRankItems(\n this.args.items,\n this.filterValue || '',\n (item) => keyAndLabelForItem(item).label,\n this.args.filter\n );\n }\n\n get showEmptyContent() {\n return this.filteredItems?.length === 0 && !this.args.hideEmptyContent;\n }\n\n /**\n * The matches the listbox renders: `filteredItems`, capped by\n * `@displayLimit`.\n */\n @cached\n get displayedItems() {\n const { displayLimit, isFilterable } = this.args;\n assert(\n `Select: @displayLimit must be a positive integer, received ${String(displayLimit)}`,\n displayLimit === undefined ||\n (Number.isInteger(displayLimit) && displayLimit > 0)\n );\n assert(\n 'Select: @displayLimit requires @isFilterable, otherwise the options past the limit cannot be reached',\n displayLimit === undefined || isFilterable\n );\n\n const selectedKeys = this.selectedKeys;\n return limitItems(this.filteredItems, displayLimit, (item) =>\n selectedKeys.includes(keyAndLabelForItem(item).key)\n );\n }\n\n /**\n * The options the hidden native `<select>` holds: the unfiltered `@items`,\n * capped by `@displayLimit` like the listbox, plus every selected option.\n *\n * The form value is the selected options, so it never needs the others.\n * Holding every item instead costs the same rendering the limit saves in\n * the listbox, and it is paid while the Select is closed: a page with a\n * hundred Selects over a thousand items each built a hundred thousand\n * hidden options. Unfiltered, so a filter can't change what the form sees.\n */\n @cached\n get mirroredItems() {\n const selectedKeys = this.selectedKeys;\n return limitItems(this.args.items, this.args.displayLimit, (item) =>\n selectedKeys.includes(keyAndLabelForItem(item).key)\n );\n }\n\n /**\n * What the display limit content reports, or `undefined` when nothing is\n * left out.\n */\n get displayLimitContent(): DisplayLimitContentArgs | undefined {\n const shown = this.displayedItems?.length ?? 0;\n const total = this.filteredItems?.length ?? 0;\n if (shown === total || this.args.hideDisplayLimitContent) {\n return undefined;\n }\n return { shown, total };\n }\n\n get autoActivateMode(): 'first' | 'selected' {\n if (this.filterValue === undefined || this.filterValue === '') {\n return 'selected';\n }\n return 'first';\n }\n\n /** Syncs internal `_selectedKeys` whenever `@selectedKeys` changes. */\n updateMultipleSelectValue = modifier(\n (_: HTMLDivElement, [selectedKeys]: [string[] | null | undefined]) => {\n if (selectedKeys !== undefined && selectedKeys !== null) {\n this._selectedKeys = selectedKeys;\n } else {\n this._selectedKeys = [];\n }\n }\n );\n\n /** Syncs internal `_selectedKey` whenever `@selectedKey` changes. */\n updateSingleSelectValue = modifier(\n (_: HTMLDivElement, [selectedKey]: [string | null | undefined]) => {\n if (selectedKey !== undefined) {\n this._selectedKey = selectedKey;\n }\n }\n );\n\n <template>\n <div\n {{this.updateMultipleSelectValue @selectedKeys}}\n {{this.updateSingleSelectValue @selectedKey}}\n {{this.containerRef.setup}}\n class={{this.classes.base class=@classes.base}}\n data-component=\"select\"\n data-part=\"base\"\n ...attributes\n >\n <FormControl\n @id={{@id}}\n @size={{@inputSize}}\n @label={{@label}}\n @isRequired={{@isRequired}}\n @description={{@description}}\n @errors={{@errors}}\n @isInvalid={{@isInvalid}}\n as |c|\n >\n <Popover\n @placement={{@placement}}\n @flipOptions={{@flipOptions}}\n @middleware={{@middleware}}\n @shiftOptions={{@shiftOptions}}\n @offsetOptions={{@offsetOptions}}\n @strategy={{@strategy}}\n @didClose={{this.didClose}}\n @isOpen={{this.isOpen}}\n @onOpenChange={{this.onOpenChange}}\n as |p|\n >\n <VisuallyHidden>\n <SelectNativeMirror\n @items={{this.mirroredItems}}\n @allowEmpty={{@allowEmpty}}\n @disabledKeys={{@disabledKeys}}\n @selectionMode={{@selectionMode}}\n @selectedKeys={{this.selectedKeys}}\n @selectedKey={{this.getSelectedKey}}\n @onSelectionChange={{this.onSelectionChange}}\n @onSingleSelectionChange={{this.onSingleSelectionChange}}\n @onItemsChange={{this.onItemsChange}}\n @placeholder={{@placeholder}}\n @id={{c.id}}\n @name={{@name}}\n @isDisabled={{@isDisabled}}\n >\n <:default as |l|>\n {{! @glint-expect-error: the signature of the native select is not the same as the listbox}}\n {{yield l to=\"default\"}}\n </:default>\n </SelectNativeMirror>\n </VisuallyHidden>\n\n <div\n class={{this.classes.innerContainer class=@classes.innerContainer}}\n data-part=\"inner-container\"\n >\n {{#if (has-block \"startContent\")}}\n <div\n data-part=\"start-content\"\n class={{this.classes.startContent\n class=@classes.startContent\n startContentPointerEvents=(if\n @startContentPointerEvents @startContentPointerEvents \"auto\"\n )\n }}\n >\n {{yield to=\"startContent\"}}\n </div>\n {{/if}}\n {{! The wrapper, not the trigger, is the popover's width reference:\n in chips mode the trigger is only as wide as the space left over\n inside the field. The wrapper is a real full-width box in both\n modes, so the dropdown matches the field either way. }}\n <div\n {{p.anchor}}\n {{p.measureWidth}}\n {{on \"click\" this.handleFieldClick}}\n data-test-id={{if this.showChips \"chips-field\"}}\n data-part=\"chips-field\"\n {{! These flags are stringified rather than handed the boolean.\n Glimmer renders a true boolean attribute as an empty value, so\n passing isInvalid straight through produced an empty data-invalid\n and the theme selector keyed on the value true never matched. }}\n data-has-chips={{if this.showChips \"true\" \"false\"}}\n data-invalid={{if c.isInvalid \"true\" \"false\"}}\n data-disabled={{if @isDisabled \"true\" \"false\"}}\n class={{this.classes.chipsField\n class=@classes.chipsField\n hasStartContent=(has-block \"startContent\")\n hasEndContent=true\n }}\n >\n {{#if (and this.showChips this.hasSelection)}}\n {{! A block cannot be passed conditionally in Glimmer, so the\n :item block below is always supplied and the branch lives\n inside it: with no :selectedItem block from the consumer, both\n it and the trigger render exactly what they rendered before. }}\n <SelectedChips\n @containerRef={{this.chipsContainerRef.setup}}\n @items={{this.selectedItems}}\n @classes={{this.classes}}\n @userClasses={{@classes}}\n @chipOptions={{this.chipOptions}}\n @isDisabled={{@isDisabled}}\n @isRemovable={{this.chipsRemovable}}\n @onRemove={{this.removeSelectedKey}}\n >\n <:item as |selected|>\n {{~#if (has-block \"selectedItem\")~}}\n {{~yield selected to=\"selectedItem\"~}}\n {{~else~}}\n {{~selected.label~}}\n {{~/if~}}\n </:item>\n </SelectedChips>\n {{/if}}\n <SelectTrigger\n @isFilterable={{@isFilterable}}\n @trigger={{p.trigger}}\n @triggerRef={{this.triggerRef.setup}}\n @isDisabled={{@isDisabled}}\n @isInvalid={{c.isInvalid}}\n @showChips={{this.showChips}}\n @accessibleName={{this.triggerAccessibleName}}\n @placeholder={{@placeholder}}\n @hasSelection={{this.hasSelection}}\n @hasStartContent={{has-block \"startContent\"}}\n @classes={{this.classes}}\n @userClasses={{@classes}}\n @items={{this.selectedItems}}\n @filterValue={{this.filterFieldValue}}\n @onFilterInput={{this.onFilterChange}}\n @onFilterKeydown={{this.handleFilterKeydown}}\n @onKeydown={{this.handleTriggerKeydown}}\n @onFocusOut={{this.blurTracker.handleFocusOut}}\n @hasCustomContent={{has-block \"selectedItem\"}}\n >\n <:selectedItem as |selected|>\n {{~#if (has-block \"selectedItem\")~}}\n {{~yield selected to=\"selectedItem\"~}}\n {{~else~}}\n {{~selected.label~}}\n {{~/if~}}\n </:selectedItem>\n </SelectTrigger>\n </div>\n <SelectEndContent\n @classes={{this.classes}}\n @userClasses={{@classes}}\n @endContentPointerEvents={{@endContentPointerEvents}}\n @inputSize={{@inputSize}}\n @isLoading={{@isLoading}}\n @isClearable={{this.isClearable}}\n @onClear={{this.clearSelectedKeys}}\n >\n {{yield to=\"endContent\"}}\n </SelectEndContent>\n </div>\n\n <p.Content\n @size={{if @popoverSize @popoverSize \"trigger\"}}\n @target={{@target}}\n @renderInPlace={{@renderInPlace}}\n @disableFocusTrap={{this.disableFocusTrap}}\n @blockScroll={{this.blockScroll}}\n @transitionDuration={{@transitionDuration}}\n @backdrop={{this.backdrop}}\n @disableTransitions={{@disableTransitions}}\n @focusTrapOptions={{@focusTrapOptions}}\n @closeOnOutsideClick={{@closeOnOutsideClick}}\n @closeOnEscapeKey={{@closeOnEscapeKey}}\n @backdropTransition={{@backdropTransition}}\n @transition={{@transition}}\n @preventAutoFocus={{true}}\n >\n <Listbox\n @items={{this.displayedItems}}\n @allowEmpty={{@allowEmpty}}\n @variant={{this.variant}}\n @disabledKeys={{@disabledKeys}}\n @color={{this.color}}\n @isKeyboardEventsEnabled={{true}}\n @onAction={{this.onAction}}\n @onSelectionChange={{this.onSelectionChange}}\n @selectedKeys={{this.selectedKeys}}\n @selectionMode={{if @selectionMode @selectionMode \"single\"}}\n @type=\"listbox\"\n @class={{this.classes.listbox class=@classes.listbox}}\n @elementToAddKeyboardEvents={{this.triggerRef.current}}\n @autoActivateMode={{this.autoActivateMode}}\n data-part=\"listbox\"\n >\n <:item as |l|>\n {{#if (has-block \"item\")}}\n {{yield l to=\"item\"}}\n {{else}}\n <l.Item\n @key={{l.key}}\n @variant={{this.variant}}\n @color={{this.color}}\n >\n {{l.label}}\n </l.Item>\n {{/if}}\n </:item>\n <:default as |l|>\n {{yield l to=\"default\"}}\n </:default>\n </Listbox>\n {{#if this.showEmptyContent}}\n <div\n class={{this.classes.emptyContent class=@classes.emptyContent}}\n data-part=\"empty-content\"\n >\n {{#if (has-block \"emptyContent\")}}\n {{yield to=\"emptyContent\"}}\n {{else}}\n No results found.\n {{/if}}\n </div>\n {{/if}}\n {{#if this.displayLimitContent}}\n <div\n class={{this.classes.displayLimitContent\n class=@classes.displayLimitContent\n }}\n data-part=\"display-limit-content\"\n >\n {{#if (has-block \"displayLimitContent\")}}\n {{yield this.displayLimitContent to=\"displayLimitContent\"}}\n {{else}}\n Showing\n {{this.displayLimitContent.shown}}\n of\n {{this.displayLimitContent.total}}. Type to narrow down.\n {{/if}}\n </div>\n {{/if}}\n </p.Content>\n </Popover>\n </FormControl>\n </div>\n </template>\n}\n\nexport {\n Select,\n type SelectSignature,\n type SelectChipOptions,\n type SelectedItem,\n type SelectedItemBlockArg,\n type DisplayLimitContentArgs\n};\nexport default Select;\n"],"names":["and","a","b","Boolean","Select","Component","g","prototype","tracked","i","constructor","owner","args","selectionMode","_selectedKeys","selectedKeys","_selectedKey","selectedKey","validateArgs","console","warn","containerRef","ref","triggerRef","chipsContainerRef","onSelectionChange","keys","singleKey","length","filterValue","undefined","triggerFormInputEvent","current","onSingleSelectionChange","key","onOpenChange","isOpen","onFilterChange","event","target","value","handleFilterKeydown","preventDefault","showChips","removeLastSelectedKey","handleTriggerKeydown","isDisabled","items","selectedItems","last","removeSelectedKey","getSelectedKey","blockScroll","disableFocusTrap","onAction","closeOnItemSelect","blurTracker","ControlBlurTracker","trigger","container","isDestroyed","isDestroying","onBlur","willDestroy","cancel","handleFieldClick","Element","contains","chipsContainer","closeButton","closest","focus","click","clearSelectedKeys","variant","renamedArgValue","appearance","default","outlined","faded","component","from","to","id","n","cached","color","intent","chipOptions","chip","size","radius","withDot","chipsRemovable","map","item","lastKey","allowEmpty","canDeselectKey","filter","k","onItemsChange","nodes","_","didClose","selectedItemsDisplay","hasSelection","triggerAccessibleName","name","label","placeholder","selectedText","selectedTextValue","node","includes","textValue","join","backdrop","classes","select","useStyles","inputSize","hasChips","isFilterable","isClearable","filterFieldValue","filteredItems","filterAndRankItems","keyAndLabelForItem","showEmptyContent","hideEmptyContent","displayedItems","displayLimit","assert","String","Number","isInteger","limitItems","mirroredItems","displayLimitContent","shown","total","hideDisplayLimitContent","autoActivateMode","updateMultipleSelectValue","modifier","updateSingleSelectValue","setComponentTemplate","precompileTemplate","strictMode","scope","FormControl","Popover","VisuallyHidden","SelectNativeMirror","on","SelectedChips","SelectTrigger","SelectEndContent","Listbox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAMA,GAAA,GAAMA,CAACC,CAAU,EAAEC,CAAU,KAAKC,OAAA,CAAQF,CAAA,CAAA,IAAME,OAAA,CAAQD,CAAA,CAAA;AAE9D;;;;;;;;;;;;AAaC;AACD,MAAME,MAAA,SAA4BC,UAA0B;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,OAAA,EAAA,CAUzDC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAA4B,EAAE;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,MAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,OAAA,CAAA,EAAA,MAAA;AAT/B;;;;;;;;AAQC;AARD,EAAA;IAAAH,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,QAAA,EAAA,CAWCC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAiB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,OAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,QAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,cAAA,EAAA,CAKjBC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAsC,IAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,aAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,cAAA,CAAA,EAAA,MAAA;AAJvC;;;AAGC;AAHD,EAAA;IAAAH,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,eAAA,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A;QAAA3J,GAAA;QAAA4J,aAAA;QAAAC,aAAA;QAAAC,gBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
1
|
+
{"version":3,"file":"select.js","sources":["../../../../src/components/forms/select/select.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked, cached } from '@glimmer/tracking';\nimport type Owner from '@ember/owner';\nimport { assert } from '@ember/debug';\nimport { on } from '@ember/modifier';\nimport { modifier } from 'ember-modifier';\nimport { useStyles } from '@frontile/theme';\nimport { renamedArgValue } from '../../../-private/deprecated-args';\n\nimport type { ListItem } from '../native-select';\nimport { Listbox } from '../../collections/listbox';\nimport { VisuallyHidden } from '../../utilities/visually-hidden';\nimport { Popover } from '../../overlays/popover';\nimport { FormControl } from '../form-control';\nimport { ref } from '../../../utils/ref';\nimport { ControlBlurTracker } from '../../../-private/control-blur';\nimport { triggerFormInputEvent } from '../../../utils/forms-utils-index';\nimport { canDeselectKey, keyAndLabelForItem } from '../../../utils/listManager';\nimport {\n filterAndRankItems,\n limitItems,\n type DisplayLimitContentArgs\n} from '../../../utils/filter';\n\nimport { SelectNativeMirror } from './native-mirror';\nimport { SelectTrigger } from './trigger';\nimport { SelectedChips } from './selected-items';\nimport { SelectEndContent } from './end-content';\nimport type {\n DefaultSingleSelectArgs,\n ExplicitSingleSelectArgs,\n ResolvedSelectChipOptions,\n SelectArgs,\n SelectChipOptions,\n SelectSignature,\n SelectedItem,\n SelectedItemBlockArg\n} from './types';\n\n// Import helper function directly instead of using ember-truth-helpers\nconst and = (a: unknown, b: unknown) => Boolean(a) && Boolean(b);\n\n/*\n * Internal `_selectedKey` / `_selectedKeys` are the source of truth for\n * rendering. `@selectedKey(s)` seeds them in the constructor and the\n * `updateSingle/MultipleSelectValue` modifiers keep them synced whenever the\n * arg changes; user interactions update them directly for an immediate UI\n * response, then call `@onSelectionChange` so the parent can update its copy.\n */\n/**\n * A dropdown selection component: a custom listbox in a popover, backed by a\n * visually hidden native `<select>` so the value submits with a form.\n *\n * Selection can be controlled with `@selectedKey` / `@selectedKeys` plus\n * `@onSelectionChange`, or left uncontrolled.\n */\nclass Select<T = unknown> extends Component<SelectSignature<T>> {\n /**\n * Every item registered by the hidden native `<select>`, in item order.\n *\n * The hidden select is deliberately given the *unfiltered* `@items` — it\n * carries the form value, which must not shrink to the filter — so this\n * covers every selected item even while the listbox is filtered down\n * (`mirroredItems` keeps them past `@displayLimit` too). Chips and the\n * joined text value can therefore be resolved straight from it.\n */\n @tracked nodes: ListItem[] = [];\n\n @tracked isOpen = false;\n /**\n * Internal tracked state for single selection mode.\n * Source of truth for rendering. Synced with @selectedKey via the updateSingleSelectValue modifier.\n */\n @tracked _selectedKey: string | null = null;\n\n /**\n * Internal tracked state for multiple selection mode.\n * Source of truth for rendering. Synced with @selectedKeys via the updateMultipleSelectValue modifier.\n */\n @tracked _selectedKeys: string[] = [];\n\n constructor(owner: Owner, args: SelectArgs<T>) {\n super(owner, args);\n\n if (this.args.selectionMode === 'multiple') {\n this._selectedKeys = this.args.selectedKeys || [];\n } else {\n this._selectedKey =\n (this.args as ExplicitSingleSelectArgs<T> | DefaultSingleSelectArgs<T>)\n .selectedKey || null;\n }\n\n this.validateArgs();\n }\n\n validateArgs() {\n if (this.args.selectionMode === 'multiple') {\n if (\n typeof (this.args as unknown as Record<string, unknown>)[\n 'selectedKey'\n ] !== 'undefined'\n ) {\n console.warn(\n 'WARNING: selectedKey is not supported in multiple selection mode. Use selectedKeys instead.'\n );\n }\n } else {\n if (\n typeof (this.args as unknown as Record<string, unknown>)[\n 'selectedKeys'\n ] !== 'undefined'\n ) {\n console.warn(\n 'WARNING: selectedKeys is deprecated for single selection mode. Use selectedKey instead.'\n );\n }\n }\n }\n\n @tracked filterValue?: string;\n\n containerRef = ref<HTMLDivElement>();\n triggerRef = ref<HTMLInputElement | HTMLButtonElement>();\n chipsContainerRef = ref<HTMLDivElement>();\n\n onSelectionChange = (keys: string[]) => {\n if (this.args.selectionMode === 'multiple') {\n this._selectedKeys = keys;\n if (typeof this.args.onSelectionChange === 'function') {\n (this.args.onSelectionChange as (keys: string[]) => void)(keys);\n }\n } else {\n const singleKey: string | null = keys.length > 0 ? keys[0] || null : null;\n this._selectedKey = singleKey;\n if (typeof this.args.onSelectionChange === 'function') {\n (this.args.onSelectionChange as (key: string | null) => void)(\n singleKey\n );\n }\n }\n\n this.filterValue = undefined;\n triggerFormInputEvent(this.containerRef.current);\n };\n\n /**\n * Like `onSelectionChange`, but for the native `<select>`'s single-value API.\n */\n onSingleSelectionChange = (key: string | null) => {\n this._selectedKey = key;\n if (typeof this.args.onSelectionChange === 'function') {\n (this.args.onSelectionChange as (key: string | null) => void)(key);\n }\n\n this.filterValue = undefined;\n triggerFormInputEvent(this.containerRef.current);\n };\n\n onOpenChange = (isOpen: boolean) => {\n this.isOpen = isOpen;\n };\n\n onFilterChange = (event: Event) => {\n const target = event.target as HTMLInputElement;\n this.filterValue = target.value;\n };\n\n /**\n * Enter in the open filter picks the active option (the Listbox handles\n * that), so it must not also submit a wrapping form, the same guard\n * Autocomplete has. Closed, Enter is left to the form.\n *\n * Backspace on an empty filter removes the last chip — the familiar tag-input\n * gesture. With text in the filter, Backspace edits the text as usual.\n */\n handleFilterKeydown = (event: KeyboardEvent) => {\n if (event.key === 'Enter' && this.isOpen) {\n event.preventDefault();\n return;\n }\n if (event.key !== 'Backspace' || !this.showChips) {\n return;\n }\n const target = event.target as HTMLInputElement;\n if (target.value !== '') {\n return;\n }\n this.removeLastSelectedKey();\n };\n\n /**\n * The non-filterable counterpart of {@link handleFilterKeydown}.\n *\n * Chip close buttons are deliberately outside the tab order (they would\n * otherwise cost a Tab stop each before the combobox is reached), so\n * Backspace/Delete on the trigger is the *only* keyboard route to removing a\n * chip here. There is no text to edit on a button trigger, so both keys act\n * immediately; `preventDefault` keeps Backspace from navigating back.\n */\n handleTriggerKeydown = (event: KeyboardEvent) => {\n if (!this.showChips || this.args.isDisabled) {\n return;\n }\n if (event.key !== 'Backspace' && event.key !== 'Delete') {\n return;\n }\n event.preventDefault();\n this.removeLastSelectedKey();\n };\n\n /**\n * Removes the trailing chip. `removeSelectedKey` applies the same\n * `@allowEmpty` rule the chip close buttons follow, so the last required\n * selection stays put.\n */\n removeLastSelectedKey(): void {\n const items = this.selectedItems;\n const last = items[items.length - 1];\n if (last) {\n this.removeSelectedKey(last.key);\n }\n }\n\n /** Current selection normalized to an array, for template rendering. */\n get selectedKeys(): string[] {\n if (this.args.selectionMode === 'multiple') {\n return this._selectedKeys;\n } else {\n const key = this.getSelectedKey;\n return key ? [key] : [];\n }\n }\n\n get getSelectedKey(): string | null {\n return this._selectedKey;\n }\n\n get blockScroll() {\n if (this.args.blockScroll === false) {\n return false;\n }\n return true;\n }\n\n get disableFocusTrap() {\n if (this.args.disableFocusTrap === false) {\n return false;\n }\n return true;\n }\n\n onAction = (key: string) => {\n if (typeof this.args.onAction === 'function') {\n this.args.onAction(key);\n }\n\n if (\n this.args.closeOnItemSelect !== false &&\n this.args.selectionMode !== 'multiple'\n ) {\n this.isOpen = false;\n }\n\n // Deliberately does not touch `@onBlur`. Selecting is not blurring: this\n // runs on every option click, including the ones that leave the dropdown\n // open in multiple selection mode. Focus loss is reported by\n // `blurTracker` instead, from the trigger's own `focusout`.\n };\n\n /**\n * Reports focus leaving the *whole* control -- the field and its portaled\n * dropdown -- rather than the trigger, which blurs on the way into the\n * dropdown and on every option click. See `ControlBlurTracker`.\n */\n blurTracker = new ControlBlurTracker({\n trigger: () => this.triggerRef.current,\n container: () => this.containerRef.current,\n isOpen: () => this.isOpen,\n isDestroyed: () => this.isDestroyed || this.isDestroying,\n onBlur: () => this.args.onBlur?.()\n });\n\n willDestroy(): void {\n super.willDestroy();\n // Nothing may resolve against a destroyed component.\n this.blurTracker.cancel();\n }\n\n /**\n * In chips mode the trigger is only as wide as the room left over beside the\n * chips, so the field's padding -- and the strip under the chevron -- are not\n * part of it, and with a single selection the trigger can be a narrow sliver.\n * Without this, clicking anywhere else in the field would do nothing, while\n * the same click anywhere on a non-chips field opens the dropdown (there the\n * trigger *is* the whole field). Forwards such a click to the trigger,\n * including clicks on a chip's own body, so the whole field is a click\n * target. The one exception is a chip's close button: within the chips\n * container the only `<button>` elements a chip ever renders are its close\n * button (see chip.gts / close-button.gts), so `closest('button')` combined\n * with containment against `chipsContainerRef` identifies it without relying\n * on any test-only attribute. Clicks on the trigger itself are left alone\n * too, since it already handles its own clicks.\n */\n handleFieldClick = (event: MouseEvent): void => {\n if (!this.showChips || this.args.isDisabled) {\n return;\n }\n\n const trigger = this.triggerRef.current;\n const target = event.target;\n\n if (!trigger || !(target instanceof Element)) {\n return;\n }\n\n // The trigger handles its own clicks; this listener also sees them bubble.\n if (trigger === target || trigger.contains(target)) {\n return;\n }\n\n const chipsContainer = this.chipsContainerRef.current;\n\n if (chipsContainer && chipsContainer.contains(target)) {\n const closeButton = target.closest('button');\n if (closeButton && chipsContainer.contains(closeButton)) {\n return;\n }\n }\n\n trigger.focus();\n trigger.click();\n };\n\n /**\n * Wipes the selection from the clear button.\n *\n * Unlike the chips and the listbox options, this deliberately does *not*\n * consult `@allowEmpty`. `@allowEmpty` governs deselecting *an option* --\n * the listbox refuses to let the last one be toggled off, and\n * `chipsRemovable` mirrors that -- whereas `@isClearable` is a separate,\n * explicit affordance the consumer opts into for exactly this purpose. It\n * also defaults to `false`, so honouring it here would render the clear\n * button dead in every default configuration. Documented as an override on\n * `@isClearable` itself; the two must keep saying the same thing.\n *\n * A disabled Select renders no clear button at all (see `isClearable`), so\n * there is nothing to guard here.\n */\n clearSelectedKeys = () => {\n this.onSelectionChange([]);\n };\n\n /**\n * Resolved once (`@cached`) and forwarded to the internal `Listbox` as\n * `@variant` only -- never `@appearance` as well, which would make the\n * inner `Listbox` raise its own deprecation for the same usage.\n */\n @cached\n get variant() {\n return renamedArgValue(\n this.args.variant,\n this.args.appearance,\n { default: 'solid', outlined: 'outline', faded: 'subtle' } as const,\n {\n component: 'Select',\n from: 'appearance',\n to: 'variant',\n id: 'frontile.select.appearance'\n }\n );\n }\n\n /**\n * Resolved once (`@cached`) and forwarded to the internal `Listbox` as\n * `@color` only -- never `@intent` as well, which would make the inner\n * `Listbox` raise its own deprecation for the same usage.\n */\n @cached\n get color() {\n return renamedArgValue(\n this.args.color,\n this.args.intent,\n { default: 'neutral' } as const,\n {\n component: 'Select',\n from: 'intent',\n to: 'color',\n id: 'frontile.select.intent'\n }\n );\n }\n\n /**\n * Resolved chip appearance: `@chip` wins, then the Select's own `@color`\n * (or deprecated `@intent`), then chip defaults tuned for sitting inside a\n * field.\n */\n get chipOptions(): ResolvedSelectChipOptions {\n const chip =\n this.args.selectionMode === 'multiple' ? this.args.chip : undefined;\n return {\n // `appearance` is passed through only when the consumer set it. Giving\n // it a default would make Chip's deprecation fire on every chip render.\n variant: chip?.variant ?? (chip?.appearance ? undefined : 'soft'),\n appearance: chip?.appearance,\n // `intent` is passed through only when the consumer (or Select's own\n // deprecated `@intent`) actually set it. Defaulting it would fire\n // Chip's `intent` deprecation on every chip render, for a prop nobody\n // wrote.\n color:\n chip?.color ??\n this.args.color ??\n ((chip?.intent ?? this.args.intent) ? undefined : 'neutral'),\n intent: chip?.intent ?? this.args.intent,\n size: chip?.size ?? 'xs',\n radius: chip?.radius,\n withDot: chip?.withDot ?? false\n };\n }\n\n /**\n * Whether chips may be removed. Mirrors the listbox: with `@allowEmpty`\n * false — the default — the final selection cannot be deselected, so its\n * chip renders without a close button rather than with a dead one.\n */\n get chipsRemovable(): boolean {\n // Asks `canDeselectKey` — the rule the listbox itself applies when an\n // already-selected option is clicked — rather than restating it, so a chip\n // and its option can never disagree about the same removal.\n //\n // Asked of `selectedItems`, the collection the chips render from, so the\n // decision cannot disagree with what is on screen either (a selected key\n // with no remembered item would otherwise be counted but never render a\n // chip at all). Every chip's key is in that collection by construction, so\n // the rule's answer is the same for all of them; it is asked of the last\n // chip, the one Backspace removes.\n const keys = this.selectedItems.map((item) => item.key);\n const lastKey = keys[keys.length - 1];\n\n // With nothing selected there is no chip, so nothing reads this today --\n // but the answer is deliberately `@allowEmpty`, not `false`. That is what\n // this getter has always returned for an empty selection, and keeping it\n // means the answer never depends on whether a chip happens to exist right\n // now. `canDeselectKey` cannot be asked here (it needs a key), so the\n // empty case is answered directly. Do not \"simplify\" this away.\n if (lastKey === undefined) {\n return this.args.allowEmpty === true;\n }\n\n return canDeselectKey(keys, lastKey, this.args.allowEmpty);\n }\n\n /**\n * Removes a single selection from a chip's close button. Routes through\n * `onSelectionChange`, which already syncs internal state, notifies the\n * parent and dispatches the form input event.\n */\n removeSelectedKey = (key: string) => {\n if (this.args.isDisabled || !this.chipsRemovable) {\n return;\n }\n this.onSelectionChange(this.selectedKeys.filter((k) => k !== key));\n };\n\n onItemsChange = (nodes: ListItem[], _: 'add' | 'remove') => {\n // `onItemsChange` runs while a modifier installs, i.e. inside a render\n // pass. Reading a tracked field here and writing it in the same\n // computation would trip Glimmer's read-then-write assertion, so `nodes`\n // is only ever written, never read, in this callback.\n this.nodes = nodes;\n };\n\n didClose = () => {\n this.filterValue = undefined;\n if (typeof this.args.didClose === 'function') {\n this.args.didClose();\n }\n };\n\n /**\n * Whether selections render as chips. Chips are the default presentation for\n * multiple selection mode; `@selectedItemsDisplay=\"text\"` opts back out to the\n * comma-joined string.\n */\n get showChips(): boolean {\n return (\n this.args.selectionMode === 'multiple' &&\n this.args.selectedItemsDisplay !== 'text'\n );\n }\n\n get hasSelection(): boolean {\n return this.selectedKeys.length > 0;\n }\n\n /**\n * The accessible name for the trigger when its own text cannot supply one.\n *\n * Left to itself the trigger names itself from its own text -- the selected\n * label, or the placeholder -- and that is still what happens in the plain\n * case; see the trigger, which only applies this when it has to.\n *\n * Two cases need it:\n *\n * - **Chips mode.** The trigger renders nothing; the chips are its siblings\n * and are read separately. Naming the *control* is both enough and\n * correct here -- appending the selection would have it read twice -- so\n * this returns the bare name.\n * - **A `:selectedItem` block.** The block owns the trigger's content and may\n * render nothing readable at all (an avatar, an icon), which would leave\n * the combobox announced as an unnamed button. The selection is not\n * readable anywhere else in that case, so the name carries it: the control\n * name *and* the selected options' text.\n *\n * With nothing selected the placeholder is the trigger's visible text, so\n * it joins the name (`Merchant, All merchants`) rather than being dropped.\n *\n * The two halves are composed so that the separator only appears when both\n * are there. A selected key with no registered option behind it resolves to\n * no text at all, and `\"Owner, \"` is announced as \"Owner comma\"; and with\n * neither `@label` nor `@placeholder` the only control name available is the\n * hardcoded, unlocalizable `Select options`, so the selected text is left to\n * name the control on its own rather than be prefixed by English.\n */\n get triggerAccessibleName(): string {\n const name = this.args.label || this.args.placeholder;\n\n // Nothing selected: the placeholder is the visible text, so it joins the\n // name (WCAG 2.5.3 Label in Name).\n if (!this.hasSelection && this.args.label && this.args.placeholder) {\n return this.args.label === this.args.placeholder\n ? this.args.label\n : `${this.args.label}, ${this.args.placeholder}`;\n }\n\n // Chips mode names the *control* only -- the chips are read separately --\n // and has no better fallback than the literal.\n if (this.showChips) {\n return name || 'Select options';\n }\n\n const selectedText = this.hasSelection ? this.selectedTextValue : '';\n\n if (!name) {\n return selectedText || 'Select options';\n }\n\n return selectedText ? `${name}, ${selectedText}` : name;\n }\n\n /**\n * The selected options in item order (not click order) so chips do not\n * reorder underneath the user as they select.\n *\n * Resolved against `nodes`, which the hidden native `<select>` populates from\n * the unfiltered `@items`, so a chip stays put while a filter hides the item\n * it came from.\n */\n get selectedItems(): SelectedItem[] {\n const keys = this.selectedKeys;\n return this.nodes\n .filter((node) => keys.includes(node.key))\n .map((node) => ({\n key: node.key,\n textValue: node.textValue,\n item: node.item\n }));\n }\n\n /**\n * The same selection `selectedItems` describes, rendered as text.\n *\n * Chips and this string are two presentations of one thing, so they read one\n * projection: walking `nodes` a second time here is how a fix to the\n * selection's contents once landed in the chips and not in the text.\n */\n get selectedTextValue(): string {\n return this.selectedItems.map((item) => item.textValue).join(', ');\n }\n\n get backdrop() {\n if (typeof this.args.backdrop === 'undefined') {\n return 'transparent';\n }\n return this.args.backdrop;\n }\n\n get classes() {\n const { select } = useStyles();\n // Referenced here, on the always-rendered root, so `@appearance`/\n // `@variant` (and `@intent`/`@color`) raises its deprecation regardless\n // of whether the popover content (and so the internal `Listbox`) is\n // currently mounted.\n void this.variant;\n void this.color;\n return select({\n size: this.args.inputSize,\n hasChips: this.showChips,\n isFilterable: !!this.args.isFilterable,\n hasSelection: this.hasSelection\n });\n }\n\n /**\n * Whether the clear button takes the chevron's place: something to clear,\n * and a control that can act on it. A disabled Select never shows it -- the\n * end-content cluster is not pointer-transparent to it and it carries no\n * disabled state of its own, so it would otherwise be a focusable button\n * that clears a field the user is not allowed to change.\n */\n get isClearable() {\n return (\n this.args.isClearable &&\n !this.args.isDisabled &&\n this.selectedKeys &&\n this.selectedKeys.length > 0\n );\n }\n\n get filterFieldValue() {\n if (this.filterValue !== undefined) {\n return this.filterValue;\n }\n // With chips, the selection is already visible beside the input. Echoing\n // the joined text here would fill the box and block typing.\n if (this.showChips) {\n return '';\n }\n return this.selectedTextValue;\n }\n\n // Cached: the listbox, the empty content and the display limit read it, and\n // filtering a long list on every read would repeat the work per keystroke.\n @cached\n get filteredItems() {\n if (this.filterValue === undefined) {\n return this.args.items;\n }\n\n return filterAndRankItems(\n this.args.items,\n this.filterValue || '',\n (item) => keyAndLabelForItem(item).label,\n this.args.filter\n );\n }\n\n get showEmptyContent() {\n return this.filteredItems?.length === 0 && !this.args.hideEmptyContent;\n }\n\n /**\n * The matches the listbox renders: `filteredItems`, capped by\n * `@displayLimit`.\n */\n @cached\n get displayedItems() {\n const { displayLimit, isFilterable } = this.args;\n assert(\n `Select: @displayLimit must be a positive integer, received ${String(displayLimit)}`,\n displayLimit === undefined ||\n (Number.isInteger(displayLimit) && displayLimit > 0)\n );\n assert(\n 'Select: @displayLimit requires @isFilterable, otherwise the options past the limit cannot be reached',\n displayLimit === undefined || isFilterable\n );\n\n const selectedKeys = this.selectedKeys;\n return limitItems(this.filteredItems, displayLimit, (item) =>\n selectedKeys.includes(keyAndLabelForItem(item).key)\n );\n }\n\n /**\n * The options the hidden native `<select>` holds: the unfiltered `@items`,\n * capped by `@displayLimit` like the listbox, plus every selected option.\n *\n * The form value is the selected options, so it never needs the others.\n * Holding every item instead costs the same rendering the limit saves in\n * the listbox, and it is paid while the Select is closed: a page with a\n * hundred Selects over a thousand items each built a hundred thousand\n * hidden options. Unfiltered, so a filter can't change what the form sees.\n */\n @cached\n get mirroredItems() {\n const selectedKeys = this.selectedKeys;\n return limitItems(this.args.items, this.args.displayLimit, (item) =>\n selectedKeys.includes(keyAndLabelForItem(item).key)\n );\n }\n\n /**\n * What the display limit content reports, or `undefined` when nothing is\n * left out.\n */\n get displayLimitContent(): DisplayLimitContentArgs | undefined {\n const shown = this.displayedItems?.length ?? 0;\n const total = this.filteredItems?.length ?? 0;\n if (shown === total || this.args.hideDisplayLimitContent) {\n return undefined;\n }\n return { shown, total };\n }\n\n get autoActivateMode(): 'first' | 'selected' {\n if (this.filterValue === undefined || this.filterValue === '') {\n return 'selected';\n }\n return 'first';\n }\n\n /** Syncs internal `_selectedKeys` whenever `@selectedKeys` changes. */\n updateMultipleSelectValue = modifier(\n (_: HTMLDivElement, [selectedKeys]: [string[] | null | undefined]) => {\n if (selectedKeys !== undefined && selectedKeys !== null) {\n this._selectedKeys = selectedKeys;\n } else {\n this._selectedKeys = [];\n }\n }\n );\n\n /** Syncs internal `_selectedKey` whenever `@selectedKey` changes. */\n updateSingleSelectValue = modifier(\n (_: HTMLDivElement, [selectedKey]: [string | null | undefined]) => {\n if (selectedKey !== undefined) {\n this._selectedKey = selectedKey;\n }\n }\n );\n\n <template>\n <div\n {{this.updateMultipleSelectValue @selectedKeys}}\n {{this.updateSingleSelectValue @selectedKey}}\n {{this.containerRef.setup}}\n class={{this.classes.base class=@classes.base}}\n data-component=\"select\"\n data-part=\"base\"\n ...attributes\n >\n <FormControl\n @id={{@id}}\n @size={{@inputSize}}\n @label={{@label}}\n @isRequired={{@isRequired}}\n @description={{@description}}\n @errors={{@errors}}\n @isInvalid={{@isInvalid}}\n as |c|\n >\n <Popover\n @placement={{@placement}}\n @flipOptions={{@flipOptions}}\n @middleware={{@middleware}}\n @shiftOptions={{@shiftOptions}}\n @offsetOptions={{@offsetOptions}}\n @strategy={{@strategy}}\n @didClose={{this.didClose}}\n @isOpen={{this.isOpen}}\n @onOpenChange={{this.onOpenChange}}\n as |p|\n >\n <VisuallyHidden>\n <SelectNativeMirror\n @items={{this.mirroredItems}}\n @allowEmpty={{@allowEmpty}}\n @disabledKeys={{@disabledKeys}}\n @selectionMode={{@selectionMode}}\n @selectedKeys={{this.selectedKeys}}\n @selectedKey={{this.getSelectedKey}}\n @onSelectionChange={{this.onSelectionChange}}\n @onSingleSelectionChange={{this.onSingleSelectionChange}}\n @onItemsChange={{this.onItemsChange}}\n @placeholder={{@placeholder}}\n @id={{c.id}}\n @name={{@name}}\n @isDisabled={{@isDisabled}}\n >\n <:default as |l|>\n {{! @glint-expect-error: the signature of the native select is not the same as the listbox}}\n {{yield l to=\"default\"}}\n </:default>\n </SelectNativeMirror>\n </VisuallyHidden>\n\n <div\n class={{this.classes.innerContainer class=@classes.innerContainer}}\n data-part=\"inner-container\"\n >\n {{#if (has-block \"startContent\")}}\n <div\n data-part=\"start-content\"\n class={{this.classes.startContent\n class=@classes.startContent\n startContentPointerEvents=(if\n @startContentPointerEvents @startContentPointerEvents \"auto\"\n )\n }}\n >\n {{yield to=\"startContent\"}}\n </div>\n {{/if}}\n {{! The wrapper, not the trigger, is the popover's width reference:\n in chips mode the trigger is only as wide as the space left over\n inside the field. The wrapper is a real full-width box in both\n modes, so the dropdown matches the field either way. }}\n <div\n {{p.anchor}}\n {{p.measureWidth}}\n {{on \"click\" this.handleFieldClick}}\n data-test-id={{if this.showChips \"chips-field\"}}\n data-part=\"chips-field\"\n {{! These flags are stringified rather than handed the boolean.\n Glimmer renders a true boolean attribute as an empty value, so\n passing isInvalid straight through produced an empty data-invalid\n and the theme selector keyed on the value true never matched. }}\n data-has-chips={{if this.showChips \"true\" \"false\"}}\n data-invalid={{if c.isInvalid \"true\" \"false\"}}\n data-disabled={{if @isDisabled \"true\" \"false\"}}\n class={{this.classes.chipsField\n class=@classes.chipsField\n hasStartContent=(has-block \"startContent\")\n hasEndContent=true\n }}\n >\n {{#if (and this.showChips this.hasSelection)}}\n {{! A block cannot be passed conditionally in Glimmer, so the\n :item block below is always supplied and the branch lives\n inside it: with no :selectedItem block from the consumer, both\n it and the trigger render exactly what they rendered before. }}\n <SelectedChips\n @containerRef={{this.chipsContainerRef.setup}}\n @items={{this.selectedItems}}\n @classes={{this.classes}}\n @userClasses={{@classes}}\n @chipOptions={{this.chipOptions}}\n @isDisabled={{@isDisabled}}\n @isRemovable={{this.chipsRemovable}}\n @onRemove={{this.removeSelectedKey}}\n >\n <:item as |selected|>\n {{~#if (has-block \"selectedItem\")~}}\n {{~yield selected to=\"selectedItem\"~}}\n {{~else~}}\n {{~selected.label~}}\n {{~/if~}}\n </:item>\n </SelectedChips>\n {{/if}}\n <SelectTrigger\n @isFilterable={{@isFilterable}}\n @trigger={{p.trigger}}\n @triggerRef={{this.triggerRef.setup}}\n @isDisabled={{@isDisabled}}\n @isInvalid={{c.isInvalid}}\n @showChips={{this.showChips}}\n @accessibleName={{this.triggerAccessibleName}}\n @placeholder={{@placeholder}}\n @hasSelection={{this.hasSelection}}\n @hasStartContent={{has-block \"startContent\"}}\n @classes={{this.classes}}\n @userClasses={{@classes}}\n @items={{this.selectedItems}}\n @filterValue={{this.filterFieldValue}}\n @onFilterInput={{this.onFilterChange}}\n @onFilterKeydown={{this.handleFilterKeydown}}\n @onKeydown={{this.handleTriggerKeydown}}\n @onFocusOut={{this.blurTracker.handleFocusOut}}\n @hasCustomContent={{has-block \"selectedItem\"}}\n >\n <:selectedItem as |selected|>\n {{~#if (has-block \"selectedItem\")~}}\n {{~yield selected to=\"selectedItem\"~}}\n {{~else~}}\n {{~selected.label~}}\n {{~/if~}}\n </:selectedItem>\n </SelectTrigger>\n </div>\n <SelectEndContent\n @classes={{this.classes}}\n @userClasses={{@classes}}\n @endContentPointerEvents={{@endContentPointerEvents}}\n @inputSize={{@inputSize}}\n @isLoading={{@isLoading}}\n @isClearable={{this.isClearable}}\n @onClear={{this.clearSelectedKeys}}\n >\n {{yield to=\"endContent\"}}\n </SelectEndContent>\n </div>\n\n <p.Content\n @size={{if @popoverSize @popoverSize \"trigger\"}}\n @target={{@target}}\n @renderInPlace={{@renderInPlace}}\n @disableFocusTrap={{this.disableFocusTrap}}\n @blockScroll={{this.blockScroll}}\n @transitionDuration={{@transitionDuration}}\n @backdrop={{this.backdrop}}\n @disableTransitions={{@disableTransitions}}\n @focusTrapOptions={{@focusTrapOptions}}\n @closeOnOutsideClick={{@closeOnOutsideClick}}\n @closeOnEscapeKey={{@closeOnEscapeKey}}\n @backdropTransition={{@backdropTransition}}\n @transition={{@transition}}\n @preventAutoFocus={{true}}\n >\n <Listbox\n @items={{this.displayedItems}}\n @allowEmpty={{@allowEmpty}}\n @variant={{this.variant}}\n @disabledKeys={{@disabledKeys}}\n @color={{this.color}}\n @isKeyboardEventsEnabled={{true}}\n @onAction={{this.onAction}}\n @onSelectionChange={{this.onSelectionChange}}\n @selectedKeys={{this.selectedKeys}}\n @selectionMode={{if @selectionMode @selectionMode \"single\"}}\n @type=\"listbox\"\n @class={{this.classes.listbox class=@classes.listbox}}\n @elementToAddKeyboardEvents={{this.triggerRef.current}}\n @autoActivateMode={{this.autoActivateMode}}\n data-part=\"listbox\"\n >\n <:item as |l|>\n {{#if (has-block \"item\")}}\n {{yield l to=\"item\"}}\n {{else}}\n <l.Item\n @key={{l.key}}\n @variant={{this.variant}}\n @color={{this.color}}\n >\n {{l.label}}\n </l.Item>\n {{/if}}\n </:item>\n <:default as |l|>\n {{yield l to=\"default\"}}\n </:default>\n </Listbox>\n {{#if this.showEmptyContent}}\n <div\n class={{this.classes.emptyContent class=@classes.emptyContent}}\n data-part=\"empty-content\"\n >\n {{#if (has-block \"emptyContent\")}}\n {{yield to=\"emptyContent\"}}\n {{else}}\n No results found.\n {{/if}}\n </div>\n {{/if}}\n {{#if this.displayLimitContent}}\n <div\n class={{this.classes.displayLimitContent\n class=@classes.displayLimitContent\n }}\n data-part=\"display-limit-content\"\n >\n {{#if (has-block \"displayLimitContent\")}}\n {{yield this.displayLimitContent to=\"displayLimitContent\"}}\n {{else}}\n Showing\n {{this.displayLimitContent.shown}}\n of\n {{this.displayLimitContent.total}}. Type to narrow down.\n {{/if}}\n </div>\n {{/if}}\n </p.Content>\n </Popover>\n </FormControl>\n </div>\n </template>\n}\n\nexport {\n Select,\n type SelectSignature,\n type SelectChipOptions,\n type SelectedItem,\n type SelectedItemBlockArg,\n type DisplayLimitContentArgs\n};\nexport default Select;\n"],"names":["and","a","b","Boolean","Select","Component","g","prototype","tracked","i","constructor","owner","args","selectionMode","_selectedKeys","selectedKeys","_selectedKey","selectedKey","validateArgs","console","warn","containerRef","ref","triggerRef","chipsContainerRef","onSelectionChange","keys","singleKey","length","filterValue","undefined","triggerFormInputEvent","current","onSingleSelectionChange","key","onOpenChange","isOpen","onFilterChange","event","target","value","handleFilterKeydown","preventDefault","showChips","removeLastSelectedKey","handleTriggerKeydown","isDisabled","items","selectedItems","last","removeSelectedKey","getSelectedKey","blockScroll","disableFocusTrap","onAction","closeOnItemSelect","blurTracker","ControlBlurTracker","trigger","container","isDestroyed","isDestroying","onBlur","willDestroy","cancel","handleFieldClick","Element","contains","chipsContainer","closeButton","closest","focus","click","clearSelectedKeys","variant","renamedArgValue","appearance","default","outlined","faded","component","from","to","id","n","cached","color","intent","chipOptions","chip","size","radius","withDot","chipsRemovable","map","item","lastKey","allowEmpty","canDeselectKey","filter","k","onItemsChange","nodes","_","didClose","selectedItemsDisplay","hasSelection","triggerAccessibleName","name","label","placeholder","selectedText","selectedTextValue","node","includes","textValue","join","backdrop","classes","select","useStyles","inputSize","hasChips","isFilterable","isClearable","filterFieldValue","filteredItems","filterAndRankItems","keyAndLabelForItem","showEmptyContent","hideEmptyContent","displayedItems","displayLimit","assert","String","Number","isInteger","limitItems","mirroredItems","displayLimitContent","shown","total","hideDisplayLimitContent","autoActivateMode","updateMultipleSelectValue","modifier","updateSingleSelectValue","setComponentTemplate","precompileTemplate","strictMode","scope","FormControl","Popover","VisuallyHidden","SelectNativeMirror","on","SelectedChips","SelectTrigger","SelectEndContent","Listbox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAwCA,MAAMA,GAAA,GAAMA,CAACC,CAAU,EAAEC,CAAU,KAAKC,OAAA,CAAQF,CAAA,CAAA,IAAME,OAAA,CAAQD,CAAA,CAAA;AAE9D;;;;;;;;;;;;AAaC;AACD,MAAME,MAAA,SAA4BC,UAA0B;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,OAAA,EAAA,CAUzDC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAA4B,EAAE;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,MAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,OAAA,CAAA,EAAA,MAAA;AAT/B;;;;;;;;AAQC;AARD,EAAA;IAAAH,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,QAAA,EAAA,CAWCC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAiB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,OAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,QAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,cAAA,EAAA,CAKjBC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAsC,IAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,aAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,cAAA,CAAA,EAAA,MAAA;AAJvC;;;AAGC;AAHD,EAAA;IAAAH,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,eAAA,EAAA,CAUCC,OA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;QAAA4J,aAAA;QAAAC,aAAA;QAAAC,gBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sources":["../../../src/components/status/badge.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\ninterface BadgeSignature {\n Args: {\n /**\n * The badge variant. There is no `solid`: a saturated block reads as a\n * Chip or Button.\n *\n * @defaultValue 'soft'\n */\n variant?: 'soft' | 'outline';\n\n /**\n * The color of the badge.\n *\n * @defaultValue 'neutral'\n */\n color?:\n 'neutral' | 'primary' | 'secondary' | 'tertiary' | 'success' | 'danger';\n\n /**\n * The size of the badge\n *\n * @defaultValue '
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../../src/components/status/badge.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\ninterface BadgeSignature {\n Args: {\n /**\n * The badge variant. There is no `solid`: a saturated block reads as a\n * Chip or Button.\n *\n * @defaultValue 'soft'\n */\n variant?: 'soft' | 'outline';\n\n /**\n * The color of the badge.\n *\n * @defaultValue 'neutral'\n */\n color?:\n 'neutral' | 'primary' | 'secondary' | 'tertiary' | 'success' | 'danger';\n\n /**\n * The size of the badge. Uses Button's size names and text size: the same\n * `@size` gives the same label text size on Badge, Chip and Button.\n *\n * @defaultValue 'xs'\n */\n size?: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\n /**\n * Adds a dot before the content, colored by `@color`.\n *\n * @defaultValue false\n */\n withDot?: boolean;\n\n /**\n * Custom class name, it will override the default ones using Tailwind Merge library.\n */\n class?: string;\n\n /**\n * A figure shown after the label, such as a price or a count. A number is\n * accepted, and `0` still renders; only `undefined` or `null` leaves the\n * value out. Rendered in its own part so the theme can give it a\n * tabular, heavier treatment.\n */\n value?: string | number;\n\n /**\n * A unit shown after the value, such as `/mo`. Rendered only when set.\n */\n unit?: string;\n };\n Blocks: {\n /**\n * The badge label.\n */\n default: [];\n\n /**\n * An icon shown before the label. Using this block means the label must\n * go in the `<:default>` block.\n */\n startIcon?: [];\n\n /**\n * An icon shown after the value and unit. Using this block means the label\n * must go in the `<:default>` block.\n */\n endIcon?: [];\n };\n Element: HTMLSpanElement;\n}\n\n/**\n * A non-interactive label for status or metadata. Renders, in order: dot, start\n * icon, label, value, unit, end icon.\n *\n * When you pass a named block (`<:startIcon>` or `<:endIcon>`), Glimmer no\n * longer treats loose content as the default block, so put the label in\n * `<:default>`.\n *\n * Facet 2.0 content parts map one-to-one onto this API, so there are no extra\n * slots: `leading` is the default block, `price` is `@value`, `unit` is\n * `@unit`, `startGlyph` is `<:startIcon>` and `endGlyph` is `<:endIcon>`.\n */\nclass Badge extends Component<BadgeSignature> {\n // `!= null` rather than truthiness, so a count of `0` is shown.\n get hasValue(): boolean {\n return this.args.value != null;\n }\n\n get classNames() {\n const { badge } = useStyles();\n\n const { base, value, unit, icon, dot } = badge({\n color: this.args.color,\n size: this.args.size,\n variant: this.args.variant\n });\n\n return {\n base: base({ class: this.args.class }),\n value: value(),\n unit: unit(),\n icon: icon(),\n dot: dot()\n };\n }\n\n <template>\n <span\n class={{this.classNames.base}}\n data-component=\"badge\"\n data-part=\"base\"\n ...attributes\n >\n {{#if @withDot}}\n <span class={{this.classNames.dot}} data-part=\"dot\"></span>\n {{/if}}\n {{#if (has-block \"startIcon\")}}\n <span\n class={{this.classNames.icon}}\n data-part=\"icon\"\n data-position=\"start\"\n >\n {{yield to=\"startIcon\"}}\n </span>\n {{/if}}\n {{yield}}\n {{#if this.hasValue}}\n <span\n class={{this.classNames.value}}\n data-part=\"value\"\n >{{@value}}</span>\n {{/if}}\n {{#if @unit}}\n <span class={{this.classNames.unit}} data-part=\"unit\">{{@unit}}</span>\n {{/if}}\n {{#if (has-block \"endIcon\")}}\n <span\n class={{this.classNames.icon}}\n data-part=\"icon\"\n data-position=\"end\"\n >\n {{yield to=\"endIcon\"}}\n </span>\n {{/if}}\n </span>\n </template>\n}\n\nexport { Badge, type BadgeSignature };\nexport default Badge;\n"],"names":["Badge","Component","hasValue","args","value","classNames","badge","useStyles","base","unit","icon","dot","color","size","variant","class","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AA2EA;;;;;;;;;;;;AAYA,MAAMA,cAAcC,SAAA,CAAU;AAC5B;EACA,IAAIC,QAAAA,GAAoB;AACtB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,KAAK,IAAI,IAAA;AAC5B,EAAA;EAEA,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;IAElB,MAAM;MAAEC,IAAI;MAAEJ,KAAK;MAAEK,IAAI;MAAEC,IAAI;AAAEC,MAAAA;KAAK,GAAGL,KAAA,CAAM;AAC7CM,MAAAA,KAAA,EAAO,IAAI,CAACT,IAAI,CAACS,KAAK;AACtBC,MAAAA,IAAA,EAAM,IAAI,CAACV,IAAI,CAACU,IAAI;AACpBC,MAAAA,OAAA,EAAS,IAAI,CAACX,IAAI,CAACW;AACrB,KAAA,CAAA;IAEA,OAAO;MACLN,IAAA,EAAMA,IAAA,CAAK;AAAEO,QAAAA,KAAA,EAAO,IAAI,CAACZ,IAAI,CAACY;AAAM,OAAA,CAAA;MACpCX,KAAA,EAAOA,KAAA,EAAA;MACPK,IAAA,EAAMA,IAAA,EAAA;MACNC,IAAA,EAAMA,IAAA,EAAA;MACNC,GAAA,EAAKA,GAAA;KACP;AACF,EAAA;AAEA,EAAA;IAAAK,oBAAA,CAAAC,kBAAA,CAAA,4xBAAA,EAuCA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { useStyles } from '@frontile/theme';
|
|
3
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
|
+
import { setComponentTemplate } from '@ember/component';
|
|
5
|
+
|
|
6
|
+
class Card extends Component {
|
|
7
|
+
get classNames() {
|
|
8
|
+
const {
|
|
9
|
+
card
|
|
10
|
+
} = useStyles();
|
|
11
|
+
return card({
|
|
12
|
+
variant: this.args.variant,
|
|
13
|
+
color: this.args.color,
|
|
14
|
+
density: this.args.density,
|
|
15
|
+
elevation: this.args.elevation,
|
|
16
|
+
isSelected: this.args.isSelected,
|
|
17
|
+
isInteractive: this.args.isInteractive,
|
|
18
|
+
isDisabled: this.args.isDisabled,
|
|
19
|
+
class: this.args.class
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
get indicatorClassNames() {
|
|
23
|
+
const {
|
|
24
|
+
cardIndicator
|
|
25
|
+
} = useStyles();
|
|
26
|
+
return cardIndicator({
|
|
27
|
+
color: this.args.color
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
static {
|
|
31
|
+
setComponentTemplate(precompileTemplate("<div class={{this.classNames}} data-component=\"card\" data-part=\"base\" data-selected={{@isSelected}} data-disabled={{@isDisabled}} ...attributes>\n {{yield}}\n {{#if @isSelected}}\n {{#if (has-block \"indicator\")}}\n <span class={{this.indicatorClassNames}} data-part=\"indicator\" aria-hidden=\"true\">\n {{yield to=\"indicator\"}}\n </span>\n {{/if}}\n {{/if}}\n</div>", {
|
|
32
|
+
strictMode: true
|
|
33
|
+
}), this);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { Card, Card as default };
|
|
38
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sources":["../../../src/components/utilities/card.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles } from '@frontile/theme';\n\ninterface CardSignature {\n Args: {\n /**\n * The surface treatment. `outline` is a bordered card, `flat` has no\n * visible border, and `soft` swaps the fill for a faint tint with no\n * border.\n *\n * @defaultValue 'outline'\n */\n variant?: 'outline' | 'flat' | 'soft';\n\n /**\n * Colours the hover and selected border. The resting border is neutral\n * either way. The border is 1px in every state; hover and selected add a\n * second 1px inset layer in the same colour so they read as 2px without a\n * layout shift.\n *\n * @defaultValue 'neutral'\n */\n color?: 'neutral' | 'primary';\n\n /**\n * How much padding surrounds the contents.\n *\n * @defaultValue 'comfortable'\n */\n density?: 'compact' | 'comfortable' | 'spacious';\n\n /**\n * `raised` gives an `outline` card its shadow, and lifts it on hover when\n * the card is interactive. `none` removes both. `flat` and `soft` never\n * have a shadow, so this changes nothing for them.\n *\n * @defaultValue 'raised'\n */\n elevation?: 'raised' | 'none';\n\n /**\n * Shows the card as selected. This is appearance only: Card holds no\n * selection state, and does not set `role` or `aria-*` for you. Pair it\n * with whatever provides the selection behaviour and semantics. A selected\n * card also shows the `indicator` block, if one is passed.\n *\n * @defaultValue false\n */\n isSelected?: boolean;\n\n /**\n * Adds the hover, pressed, focus-visible and pointer styles for a card\n * that can be clicked. It does not make the card focusable or add an\n * event handler; use a `button`, a link, or `role` and `tabindex` through\n * `...attributes` for that.\n *\n * @defaultValue false\n */\n isInteractive?: boolean;\n\n /**\n * Dims the card and removes its hover and pressed styles. Disabled and\n * selected can be combined: the selected border and its inset layer stay\n * visible.\n *\n * @defaultValue false\n */\n isDisabled?: boolean;\n\n /**\n * Custom class name, it will override the default ones using Tailwind\n * Merge library.\n */\n class?: string;\n };\n Blocks: {\n /**\n * The card's contents. Card has no regions of its own; lay them out here.\n * When the `indicator` block is also used, the contents go in\n * `<:default>`, because named blocks cannot sit beside loose content.\n */\n default: [];\n\n /**\n * Opts in to a selection indicator: a small circle at the card's top-right\n * corner holding whatever you pass, usually a check icon from your own\n * icon library. It is shown only while the card is selected, is hidden\n * from assistive technology, and takes its fill from `@color`. Card never\n * supplies the icon, so it depends on no icon set.\n *\n * A parent with `overflow: hidden` clips the part that overhangs the\n * corner.\n */\n indicator?: [];\n };\n Element: HTMLDivElement;\n}\n\nclass Card extends Component<CardSignature> {\n get classNames() {\n const { card } = useStyles();\n\n return card({\n variant: this.args.variant,\n color: this.args.color,\n density: this.args.density,\n elevation: this.args.elevation,\n isSelected: this.args.isSelected,\n isInteractive: this.args.isInteractive,\n isDisabled: this.args.isDisabled,\n class: this.args.class\n });\n }\n\n get indicatorClassNames() {\n const { cardIndicator } = useStyles();\n\n return cardIndicator({ color: this.args.color });\n }\n\n <template>\n <div\n class={{this.classNames}}\n data-component=\"card\"\n data-part=\"base\"\n data-selected={{@isSelected}}\n data-disabled={{@isDisabled}}\n ...attributes\n >\n {{yield}}\n {{#if @isSelected}}\n {{#if (has-block \"indicator\")}}\n <span\n class={{this.indicatorClassNames}}\n data-part=\"indicator\"\n aria-hidden=\"true\"\n >\n {{yield to=\"indicator\"}}\n </span>\n {{/if}}\n {{/if}}\n </div>\n </template>\n}\n\nexport { Card };\nexport default Card;\n"],"names":["Card","Component","classNames","card","useStyles","variant","args","color","density","elevation","isSelected","isInteractive","isDisabled","class","indicatorClassNames","cardIndicator","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAkGA,MAAMA,aAAaC,SAAA,CAAU;EAC3B,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAM,GAAGC,SAAA,EAAA;AAEjB,IAAA,OAAOD,IAAA,CAAK;AACVE,MAAAA,OAAA,EAAS,IAAI,CAACC,IAAI,CAACD,OAAO;AAC1BE,MAAAA,KAAA,EAAO,IAAI,CAACD,IAAI,CAACC,KAAK;AACtBC,MAAAA,OAAA,EAAS,IAAI,CAACF,IAAI,CAACE,OAAO;AAC1BC,MAAAA,SAAA,EAAW,IAAI,CAACH,IAAI,CAACG,SAAS;AAC9BC,MAAAA,UAAA,EAAY,IAAI,CAACJ,IAAI,CAACI,UAAU;AAChCC,MAAAA,aAAA,EAAe,IAAI,CAACL,IAAI,CAACK,aAAa;AACtCC,MAAAA,UAAA,EAAY,IAAI,CAACN,IAAI,CAACM,UAAU;AAChCC,MAAAA,KAAA,EAAO,IAAI,CAACP,IAAI,CAACO;AACnB,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,mBAAAA,GAAsB;IACxB,MAAM;AAAEC,MAAAA;KAAe,GAAGX,SAAA,EAAA;AAE1B,IAAA,OAAOW,aAAA,CAAc;AAAER,MAAAA,KAAA,EAAO,IAAI,CAACD,IAAI,CAACC;AAAM,KAAA,CAAA;AAChD,EAAA;AAEA,EAAA;IAAAS,oBAAA,CAAAC,kBAAA,CAAA,kZAAA,EAsBA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { useStyles } from '@frontile/theme';
|
|
3
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
|
+
import { setComponentTemplate } from '@ember/component';
|
|
5
|
+
|
|
6
|
+
class Icon extends Component {
|
|
7
|
+
// A plain icon takes the surrounding text color, unless it is inverse: an
|
|
8
|
+
// inherited color cannot be inverted, so it becomes neutral.
|
|
9
|
+
defaultColor(variant) {
|
|
10
|
+
return variant === 'plain' && !this.args.inverse ? undefined : 'neutral';
|
|
11
|
+
}
|
|
12
|
+
get classNames() {
|
|
13
|
+
const {
|
|
14
|
+
icon
|
|
15
|
+
} = useStyles();
|
|
16
|
+
const variant = this.args.variant ?? 'plain';
|
|
17
|
+
return icon({
|
|
18
|
+
size: this.args.size,
|
|
19
|
+
variant,
|
|
20
|
+
color: this.args.color ?? this.defaultColor(variant),
|
|
21
|
+
inverse: this.args.inverse,
|
|
22
|
+
class: this.args.classes?.base
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
static {
|
|
26
|
+
setComponentTemplate(precompileTemplate("<span class={{this.classNames}} role={{if @label \"img\"}} aria-label={{@label}} aria-hidden={{unless @label \"true\"}} ...attributes>{{yield}}</span>", {
|
|
27
|
+
strictMode: true
|
|
28
|
+
}), this);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { Icon, Icon as default };
|
|
33
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.js","sources":["../../../src/components/utilities/icon.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { useStyles, type IconVariants } from '@frontile/theme';\n\nexport interface IconSignature {\n Args: {\n /**\n * The size of the circle. The icon inside scales with it.\n *\n * @defaultValue 'md'\n */\n size?: IconVariants['size'];\n\n /**\n * The color role. A `plain` icon without a color takes the color of the\n * surrounding text; every other variant defaults to `neutral`.\n */\n color?: IconVariants['color'];\n\n /**\n * How the circle is drawn. `plain` has no circle, only the icon. `solid`,\n * `soft` and `subtle` fill it at decreasing strength, and `outline` draws\n * a ring. A plain icon's box is tighter than the circle of the other\n * variants at the same size.\n *\n * @defaultValue 'plain'\n */\n variant?: IconVariants['variant'];\n\n /**\n * Draws the icon, its fill and its ring in the opposite light or dark\n * scheme, for an icon on a surface of the other scheme. An inverse plain\n * icon with no `@color` is neutral.\n *\n * @defaultValue false\n */\n inverse?: boolean;\n\n /**\n * The accessible name. Without it the icon is decorative and hidden from\n * screen readers; set it when the icon carries meaning on its own.\n */\n label?: string;\n\n /**\n * Custom classes for the root element, merged over the defaults.\n */\n classes?: { base?: string };\n };\n Blocks: {\n /** The icon, for example an inline `<svg>` or a `FaIcon`. */\n default: [];\n };\n Element: HTMLSpanElement;\n}\n\nclass Icon extends Component<IconSignature> {\n // A plain icon takes the surrounding text color, unless it is inverse: an\n // inherited color cannot be inverted, so it becomes neutral.\n defaultColor(variant: string): 'neutral' | undefined {\n return variant === 'plain' && !this.args.inverse ? undefined : 'neutral';\n }\n\n get classNames(): string {\n const { icon } = useStyles();\n const variant = this.args.variant ?? 'plain';\n\n return icon({\n size: this.args.size,\n variant,\n color: this.args.color ?? this.defaultColor(variant),\n inverse: this.args.inverse,\n class: this.args.classes?.base\n });\n }\n\n <template>\n <span\n class={{this.classNames}}\n role={{if @label \"img\"}}\n aria-label={{@label}}\n aria-hidden={{unless @label \"true\"}}\n ...attributes\n >{{yield}}</span>\n </template>\n}\n\nexport { Icon };\nexport default Icon;\n"],"names":["Icon","Component","defaultColor","variant","args","inverse","undefined","classNames","icon","useStyles","size","color","class","classes","base","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAuDA,MAAMA,aAAaC,SAAA,CAAU;AAC3B;AACA;EACAC,YAAAA,CAAaC,OAAe,EAAyB;AACnD,IAAA,OAAOA,OAAA,KAAY,WAAW,CAAC,IAAI,CAACC,IAAI,CAACC,OAAO,GAAGC,SAAA,GAAY,SAAA;AACjE,EAAA;EAEA,IAAIC,UAAAA,GAAqB;IACvB,MAAM;AAAEC,MAAAA;KAAM,GAAGC,SAAA,EAAA;IACjB,MAAMN,UAAU,IAAI,CAACC,IAAI,CAACD,OAAO,IAAI,OAAA;AAErC,IAAA,OAAOK,IAAA,CAAK;AACVE,MAAAA,IAAA,EAAM,IAAI,CAACN,IAAI,CAACM,IAAI;MACpBP,OAAA;AACAQ,MAAAA,KAAA,EAAO,IAAI,CAACP,IAAI,CAACO,KAAK,IAAI,IAAI,CAACT,YAAY,CAACC,OAAA,CAAA;AAC5CE,MAAAA,OAAA,EAAS,IAAI,CAACD,IAAI,CAACC,OAAO;AAC1BO,MAAAA,KAAA,EAAO,IAAI,CAACR,IAAI,CAACS,OAAO,EAAEC;AAC5B,KAAA,CAAA;AACF,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,wJAAA,EAQA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import 'focus-visible/dist/focus-visible.js';
|
|
2
2
|
export { Avatar } from './avatar.js';
|
|
3
|
+
export { Icon } from './icon.js';
|
|
3
4
|
export { VisuallyHidden } from './visually-hidden.js';
|
|
4
5
|
export { Collapsible } from './collapsible.js';
|
|
5
6
|
export { Divider } from './divider.js';
|
|
7
|
+
export { Card } from './card.js';
|
|
6
8
|
export { Kbd } from './kbd.js';
|
|
7
9
|
export { isApplePlatform, parseKeys, resolveKbdPlatform, setKbdPlatform } from '../../utils/keys.js';
|
|
8
10
|
export { Skeleton } from './skeleton.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { Button } from './components/buttons/button.js';
|
|
2
2
|
export { CloseButton } from './components/buttons/close-button.js';
|
|
3
|
+
export { IconButton } from './components/buttons/icon-button.js';
|
|
3
4
|
export { ToggleButton } from './components/buttons/toggle-button.js';
|
|
4
5
|
export { ButtonGroup } from './components/buttons/button-group.js';
|
|
5
6
|
export { Chip } from './components/buttons/chip.js';
|
|
@@ -58,9 +59,11 @@ export { Badge } from './components/status/badge.js';
|
|
|
58
59
|
export { ProgressBar } from './components/status/progress-bar.js';
|
|
59
60
|
import 'focus-visible/dist/focus-visible.js';
|
|
60
61
|
export { Avatar } from './components/utilities/avatar.js';
|
|
62
|
+
export { Icon } from './components/utilities/icon.js';
|
|
61
63
|
export { VisuallyHidden } from './components/utilities/visually-hidden.js';
|
|
62
64
|
export { Collapsible } from './components/utilities/collapsible.js';
|
|
63
65
|
export { Divider } from './components/utilities/divider.js';
|
|
66
|
+
export { Card } from './components/utilities/card.js';
|
|
64
67
|
export { Kbd } from './components/utilities/kbd.js';
|
|
65
68
|
export { isApplePlatform, parseKeys, resolveKbdPlatform, setKbdPlatform } from './utils/keys.js';
|
|
66
69
|
export { Skeleton } from './components/utilities/skeleton.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/utilities.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import 'focus-visible/dist/focus-visible.js';
|
|
2
2
|
export { Avatar } from './components/utilities/avatar.js';
|
|
3
|
+
export { Icon } from './components/utilities/icon.js';
|
|
3
4
|
export { VisuallyHidden } from './components/utilities/visually-hidden.js';
|
|
4
5
|
export { Collapsible } from './components/utilities/collapsible.js';
|
|
5
6
|
export { Divider } from './components/utilities/divider.js';
|
|
7
|
+
export { Card } from './components/utilities/card.js';
|
|
6
8
|
export { Kbd } from './components/utilities/kbd.js';
|
|
7
9
|
export { isApplePlatform, parseKeys, resolveKbdPlatform, setKbdPlatform } from './utils/keys.js';
|
|
8
10
|
export { Skeleton } from './components/utilities/skeleton.js';
|
package/dist/utilities.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utilities.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utilities.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frontile",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.12",
|
|
4
4
|
"description": "Component Library for Ember Octane apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"@embroider/addon-shim": "^1.11.0",
|
|
99
99
|
"@embroider/macros": "^1.21.4",
|
|
100
100
|
"@floating-ui/dom": "^1.8.0",
|
|
101
|
-
"@frontile/theme": "^0.18.
|
|
101
|
+
"@frontile/theme": "^0.18.12",
|
|
102
102
|
"@glint/template": "^1.11.1",
|
|
103
103
|
"@universal-ember/table": "^4.1.1",
|
|
104
104
|
"date-fns": "^4.4.0",
|
|
@@ -156,5 +156,5 @@
|
|
|
156
156
|
"./services/notifications.js": "./dist/_app_/services/notifications.js"
|
|
157
157
|
}
|
|
158
158
|
},
|
|
159
|
-
"gitHead": "
|
|
159
|
+
"gitHead": "183a78d2b9caf3eeaf5c485fbb3089439d91ff66"
|
|
160
160
|
}
|