frontile 0.18.11 → 0.18.13
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/layout/app-layout.d.ts +53 -5
- package/declarations/components/layout/app-layout.d.ts.map +1 -1
- package/declarations/components/layout/aside.d.ts +79 -0
- package/declarations/components/layout/aside.d.ts.map +1 -1
- package/declarations/components/layout/context.d.ts +12 -4
- package/declarations/components/layout/context.d.ts.map +1 -1
- package/declarations/components/layout/in-layout-region.d.ts +38 -0
- package/declarations/components/layout/in-layout-region.d.ts.map +1 -0
- package/declarations/components/layout/index.d.ts +2 -0
- package/declarations/components/layout/index.d.ts.map +1 -1
- package/declarations/components/layout/navbar.d.ts +43 -0
- package/declarations/components/layout/navbar.d.ts.map +1 -1
- package/declarations/components/layout/region.d.ts +60 -0
- package/declarations/components/layout/region.d.ts.map +1 -0
- package/declarations/components/layout/sidebar.d.ts +43 -0
- package/declarations/components/layout/sidebar.d.ts.map +1 -1
- package/declarations/components/overlays/tooltip.d.ts +1 -1
- package/declarations/components/status/badge.d.ts +8 -7
- 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/declarations/services/frontile-layout-regions.d.ts +69 -0
- package/declarations/services/frontile-layout-regions.d.ts.map +1 -0
- package/dist/_app_/services/frontile-layout-regions.js +1 -0
- 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/layout/app-layout.js +11 -3
- package/dist/components/layout/app-layout.js.map +1 -1
- package/dist/components/layout/aside.js +56 -2
- package/dist/components/layout/aside.js.map +1 -1
- package/dist/components/layout/context.js.map +1 -1
- package/dist/components/layout/in-layout-region.js +42 -0
- package/dist/components/layout/in-layout-region.js.map +1 -0
- package/dist/components/layout/index.js +2 -0
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/layout/region.js +51 -0
- package/dist/components/layout/region.js.map +1 -0
- package/dist/components/overlays/tooltip.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 +5 -0
- package/dist/index.js.map +1 -1
- package/dist/layout.js +2 -0
- package/dist/layout.js.map +1 -1
- package/dist/services/frontile-layout-regions.js +149 -0
- package/dist/services/frontile-layout-regions.js.map +1 -0
- package/dist/utilities.js +2 -0
- package/dist/utilities.js.map +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { type AppLayoutContext } from './context';
|
|
3
|
+
import type FrontileLayoutRegionsService from '../../services/frontile-layout-regions';
|
|
4
|
+
import type Owner from '@ember/owner';
|
|
5
|
+
interface RegionArgs {
|
|
6
|
+
/**
|
|
7
|
+
* The region's name, matched by `InLayoutRegion @name`. Names are global
|
|
8
|
+
* to the app. Read once, when the region renders.
|
|
9
|
+
*/
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* Render every source, in the order they rendered, instead of only the
|
|
13
|
+
* newest. After the region renders again, sources follow template order.
|
|
14
|
+
* Read once, when the region renders.
|
|
15
|
+
*
|
|
16
|
+
* @defaultValue false
|
|
17
|
+
*/
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Supplied by `AppLayout`. Not part of the public API.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
layout?: AppLayoutContext;
|
|
25
|
+
}
|
|
26
|
+
interface RegionSignature {
|
|
27
|
+
Args: RegionArgs;
|
|
28
|
+
Blocks: {
|
|
29
|
+
/** Rendered while no `InLayoutRegion` fills the region. */
|
|
30
|
+
default: [];
|
|
31
|
+
};
|
|
32
|
+
Element: HTMLDivElement;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A named place in the layout that any template, including a route template
|
|
36
|
+
* inside `{{outlet}}`, fills with `InLayoutRegion`. Its element is
|
|
37
|
+
* `display: contents`, so the content lays out as if it were written where
|
|
38
|
+
* the region sits. `data-has-content` is `true` while a source fills it.
|
|
39
|
+
*/
|
|
40
|
+
declare class Region extends Component<RegionSignature> {
|
|
41
|
+
regions: FrontileLayoutRegionsService;
|
|
42
|
+
/** `@name`, read once. */
|
|
43
|
+
name: string;
|
|
44
|
+
/** `@multiple`, read once. */
|
|
45
|
+
multiple: boolean;
|
|
46
|
+
constructor(owner: Owner, args: RegionArgs);
|
|
47
|
+
register: import("ember-modifier").FunctionBasedModifier<{
|
|
48
|
+
Args: {
|
|
49
|
+
Positional: unknown[];
|
|
50
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
51
|
+
};
|
|
52
|
+
Element: HTMLElement;
|
|
53
|
+
}>;
|
|
54
|
+
get classNames(): string;
|
|
55
|
+
get hasContent(): boolean;
|
|
56
|
+
get hasContentString(): 'true' | 'false';
|
|
57
|
+
}
|
|
58
|
+
export { Region, type RegionSignature, type RegionArgs };
|
|
59
|
+
export default Region;
|
|
60
|
+
//# sourceMappingURL=region.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"region.d.ts","sourceRoot":"","sources":["../../../src/components/layout/region.gts"],"names":[],"mappings":"AAgGA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACpE,OAAO,KAAK,4BAA4B,MAAM,wCAAwC,CAAC;AACvF,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,UAAU,UAAU;IAClB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;CAC3B;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,MAAM,EAAE;QACN,2DAA2D;QAC3D,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;;GAKG;AACH,cAAM,MAAO,SAAQ,SAAS,CAAC,eAAe,CAAC;IAErC,OAAO,EAAE,4BAA4B,CAAC;IAE9C,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,QAAQ,EAAE,OAAO,CAAC;gBAEN,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU;IAM1C,QAAQ;;;;;;OAIN;IAEF,IAAI,UAAU,IAAI,MAAM,CAGvB;IAED,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,IAAI,gBAAgB,IAAI,MAAM,GAAG,OAAO,CAEvC;CA2BF;AAED,OAAO,EAAE,MAAM,EAAE,KAAK,eAAe,EAAE,KAAK,UAAU,EAAE,CAAC;AACzD,eAAe,MAAM,CAAC"}
|
|
@@ -1193,6 +1193,49 @@ declare class Sidebar extends Component<SidebarSignature> {
|
|
|
1193
1193
|
class?: never | undefined;
|
|
1194
1194
|
className?: import("tailwind-variants").ClassNameValue;
|
|
1195
1195
|
} | undefined) => string;
|
|
1196
|
+
region: (slotProps?: {
|
|
1197
|
+
color?: "neutral" | "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger" | undefined;
|
|
1198
|
+
variant?: "inset" | "attached" | undefined;
|
|
1199
|
+
collapsed?: boolean | undefined;
|
|
1200
|
+
navbarPlacement?: "content" | "frame" | undefined;
|
|
1201
|
+
breakpoint?: "sm" | "md" | "lg" | undefined;
|
|
1202
|
+
sidebarColumn?: "none" | "shown" | "collapsed" | undefined;
|
|
1203
|
+
bottomNavRow?: "none" | "shown" | undefined;
|
|
1204
|
+
sidebarSize?: "default" | "rail" | undefined;
|
|
1205
|
+
collapsible?: "icon" | "none" | "offcanvas" | undefined;
|
|
1206
|
+
partColor?: "neutral" | "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger" | undefined;
|
|
1207
|
+
sidebarSurface?: "solid" | "plain" | undefined;
|
|
1208
|
+
navbarSurface?: "solid" | "plain" | undefined;
|
|
1209
|
+
frameGradient?: boolean | undefined;
|
|
1210
|
+
cardSurface?: "solid" | "translucent" | undefined;
|
|
1211
|
+
sidebarSide?: "start" | "end" | undefined;
|
|
1212
|
+
inDrawer?: boolean | undefined;
|
|
1213
|
+
standalone?: boolean | undefined;
|
|
1214
|
+
scrollMode?: "content" | "page" | undefined;
|
|
1215
|
+
class?: import("tailwind-variants").ClassNameValue;
|
|
1216
|
+
className?: never | undefined;
|
|
1217
|
+
} | {
|
|
1218
|
+
color?: "neutral" | "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger" | undefined;
|
|
1219
|
+
variant?: "inset" | "attached" | undefined;
|
|
1220
|
+
collapsed?: boolean | undefined;
|
|
1221
|
+
navbarPlacement?: "content" | "frame" | undefined;
|
|
1222
|
+
breakpoint?: "sm" | "md" | "lg" | undefined;
|
|
1223
|
+
sidebarColumn?: "none" | "shown" | "collapsed" | undefined;
|
|
1224
|
+
bottomNavRow?: "none" | "shown" | undefined;
|
|
1225
|
+
sidebarSize?: "default" | "rail" | undefined;
|
|
1226
|
+
collapsible?: "icon" | "none" | "offcanvas" | undefined;
|
|
1227
|
+
partColor?: "neutral" | "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger" | undefined;
|
|
1228
|
+
sidebarSurface?: "solid" | "plain" | undefined;
|
|
1229
|
+
navbarSurface?: "solid" | "plain" | undefined;
|
|
1230
|
+
frameGradient?: boolean | undefined;
|
|
1231
|
+
cardSurface?: "solid" | "translucent" | undefined;
|
|
1232
|
+
sidebarSide?: "start" | "end" | undefined;
|
|
1233
|
+
inDrawer?: boolean | undefined;
|
|
1234
|
+
standalone?: boolean | undefined;
|
|
1235
|
+
scrollMode?: "content" | "page" | undefined;
|
|
1236
|
+
class?: never | undefined;
|
|
1237
|
+
className?: import("tailwind-variants").ClassNameValue;
|
|
1238
|
+
} | undefined) => string;
|
|
1196
1239
|
skipLink: (slotProps?: {
|
|
1197
1240
|
color?: "neutral" | "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger" | undefined;
|
|
1198
1241
|
variant?: "inset" | "attached" | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/components/layout/sidebar.gts"],"names":[],"mappings":"AAyeA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAO3C,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,SAAS,MAAM,cAAc,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgBT;IAED,IACI,UAAU,IAAI,MAAM,CAKvB;IAED,IACI,sBAAsB,IAAI,MAAM,CAInC;IAED,IAAI,gBAAgB,IAAI,MAAM,CAI7B;IAED,IACI,WAAW;;;;;;;;MAad;IAED;;;OAGG;IACH,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,2EAA2E;IAC3E,IAAI,gBAAgB,IAAI,MAAM,GAAG,OAAO,CAEvC;CA6GF;AASD,QAAA,MAAM,aAAa,EAAE,GAAG,CAAC,uBAAuB,CAe9C,CAAC;AAEH,QAAA,MAAM,WAAW,EAAE,GAAG,CAAC,uBAAuB,CAe5C,CAAC;AAEH,QAAA,MAAM,aAAa,EAAE,GAAG,CAAC,uBAAuB,CAe9C,CAAC;AAEH,OAAO,EAAE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,CAAC;AAC5D,eAAe,OAAO,CAAC"}
|
|
@@ -2,12 +2,12 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
interface BadgeSignature {
|
|
3
3
|
Args: {
|
|
4
4
|
/**
|
|
5
|
-
* The badge variant.
|
|
6
|
-
*
|
|
5
|
+
* The badge variant. `solid` fills with the color's default level, `soft`
|
|
6
|
+
* is a tinted surface, and `outline` draws the color as a border.
|
|
7
7
|
*
|
|
8
|
-
* @defaultValue '
|
|
8
|
+
* @defaultValue 'solid'
|
|
9
9
|
*/
|
|
10
|
-
variant?: 'soft' | 'outline';
|
|
10
|
+
variant?: 'solid' | 'soft' | 'outline';
|
|
11
11
|
/**
|
|
12
12
|
* The color of the badge.
|
|
13
13
|
*
|
|
@@ -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,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;QAEvC;;;;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"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import Service from '@ember/service';
|
|
2
|
+
/** A mounted target: the element sources render into, and how. */
|
|
3
|
+
interface RegionTarget {
|
|
4
|
+
readonly element: Element;
|
|
5
|
+
/** Whether every source renders (`true`) or only the newest. */
|
|
6
|
+
readonly multiple: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** One named region: where it renders (the target) and who fills it. */
|
|
9
|
+
export declare class LayoutRegionState {
|
|
10
|
+
/**
|
|
11
|
+
* Mounted targets in registration order. The newest is the one sources
|
|
12
|
+
* render into; when it goes away, the previous one takes over again.
|
|
13
|
+
* Reassigned, never mutated.
|
|
14
|
+
*/
|
|
15
|
+
targets: readonly RegionTarget[];
|
|
16
|
+
/** Sources in registration (render) order. Reassigned, never mutated. */
|
|
17
|
+
sources: readonly object[];
|
|
18
|
+
get hasContent(): boolean;
|
|
19
|
+
/** The target sources render into: the newest mounted one. */
|
|
20
|
+
get target(): RegionTarget | undefined;
|
|
21
|
+
/** Where `source` should render, or `null` when it is not shown. */
|
|
22
|
+
targetFor(source: object): Element | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Connects `InLayoutRegion` sources, rendered anywhere in the app, to the
|
|
26
|
+
* layout's named regions. Internal to Frontile: use `layout.Region`,
|
|
27
|
+
* `layout.Aside @region` and `InLayoutRegion` instead.
|
|
28
|
+
*
|
|
29
|
+
* Every write is deferred to `afterRender`. Sources register while the
|
|
30
|
+
* render is running, and the layout, which renders before `{{outlet}}`, has
|
|
31
|
+
* usually already read the same tracked state in that render. Writing it
|
|
32
|
+
* synchronously trips Glimmer's backtracking assertion. The deferred write
|
|
33
|
+
* re-renders in the same runloop, so no paint happens in between.
|
|
34
|
+
*/
|
|
35
|
+
export default class FrontileLayoutRegionsService extends Service {
|
|
36
|
+
#private;
|
|
37
|
+
/** The named region, created on first use (by a source or a target). */
|
|
38
|
+
region(name: string): LayoutRegionState;
|
|
39
|
+
/** Whether any source fills the named region (tracked). */
|
|
40
|
+
hasContent(name: string): boolean;
|
|
41
|
+
/** Where `source` renders in the named region, or `null` (tracked). */
|
|
42
|
+
targetFor(name: string, source: object): Element | null;
|
|
43
|
+
/**
|
|
44
|
+
* Adds an element sources render into. The newest target wins; removing
|
|
45
|
+
* it hands the sources back to the previous one. Returns the undo
|
|
46
|
+
* function, which removes only this registration.
|
|
47
|
+
*/
|
|
48
|
+
registerTarget(name: string, element: Element, options?: {
|
|
49
|
+
multiple?: boolean;
|
|
50
|
+
}): () => void;
|
|
51
|
+
/**
|
|
52
|
+
* Adds a source to the named region. Returns the undo function. The
|
|
53
|
+
* removal is deferred too, so a swap in one render goes 1 → 2 → 1 and the
|
|
54
|
+
* region is never seen empty.
|
|
55
|
+
*/
|
|
56
|
+
addSource(name: string, source: object): () => void;
|
|
57
|
+
/**
|
|
58
|
+
* Calls `listener` whenever the named region loses its last source. Runs
|
|
59
|
+
* after render, so it may change tracked state.
|
|
60
|
+
*/
|
|
61
|
+
onEmpty(name: string, listener: () => void): () => void;
|
|
62
|
+
}
|
|
63
|
+
declare module '@ember/service' {
|
|
64
|
+
interface Registry {
|
|
65
|
+
'frontile-layout-regions': FrontileLayoutRegionsService;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=frontile-layout-regions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontile-layout-regions.d.ts","sourceRoot":"","sources":["../../src/services/frontile-layout-regions.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAKrC,kEAAkE;AAClE,UAAU,YAAY;IACpB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;CAC5B;AAED,wEAAwE;AACxE,qBAAa,iBAAiB;IAC5B;;;;OAIG;IACM,OAAO,EAAE,SAAS,YAAY,EAAE,CAAM;IAC/C,yEAAyE;IAChE,OAAO,EAAE,SAAS,MAAM,EAAE,CAAM;IACzC,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,8DAA8D;IAC9D,IAAI,MAAM,IAAI,YAAY,GAAG,SAAS,CAErC;IAED,oEAAoE;IACpE,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI;CAU1C;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,OAAO,OAAO,4BAA6B,SAAQ,OAAO;;IAY/D,wEAAwE;IACxE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB;IASvC,2DAA2D;IAC3D,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIjC,uEAAuE;IACvE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI;IAIvD;;;;OAIG;IACH,cAAc,CACZ,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAO,GACnC,MAAM,IAAI;IAwBb;;;;OAIG;IACH,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI;IAenD;;;OAGG;IACH,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;CAUxD;AAED,OAAO,QAAQ,gBAAgB,CAAC;IAC9B,UAAU,QAAQ;QAChB,yBAAyB,EAAE,4BAA4B,CAAC;KACzD;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "frontile/services/frontile-layout-regions";
|
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,YAAA,EAAA,CAAA;AAoGV,MAAMC,eAAe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I,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,IAAA;AACA,IAAA,OAAO,QAAA;AACT,EA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,"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;AAAEC,UAAAA,SAAA,EAAW,QAAA;AAAU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AAC,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';
|