ember-primitives 0.27.1 → 0.28.0
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/color-scheme.d.ts.map +1 -1
- package/declarations/components/-private/typed-elements.d.ts +1 -1
- package/declarations/components/accordion/content.d.ts +2 -2
- package/declarations/components/accordion/header.d.ts +2 -2
- package/declarations/components/accordion/item.d.ts +3 -3
- package/declarations/components/accordion/public.d.ts +3 -3
- package/declarations/components/accordion/trigger.d.ts +2 -2
- package/declarations/components/accordion.d.ts +7 -7
- package/declarations/components/accordion.d.ts.map +1 -1
- package/declarations/components/avatar.d.ts +4 -4
- package/declarations/components/dialog.d.ts +4 -4
- package/declarations/components/dialog.d.ts.map +1 -1
- package/declarations/components/external-link.d.ts +1 -1
- package/declarations/components/form.d.ts +3 -3
- package/declarations/components/keys.d.ts +17 -0
- package/declarations/components/keys.d.ts.map +1 -0
- package/declarations/components/layout/hero.d.ts +2 -2
- package/declarations/components/layout/sticky-footer.d.ts +2 -2
- package/declarations/components/menu.d.ts +19 -19
- package/declarations/components/menu.d.ts.map +1 -1
- package/declarations/components/one-time-password/buttons.d.ts +1 -1
- package/declarations/components/one-time-password/index.d.ts +2 -2
- package/declarations/components/one-time-password/input.d.ts +5 -5
- package/declarations/components/one-time-password/input.d.ts.map +1 -1
- package/declarations/components/one-time-password/otp.d.ts +5 -5
- package/declarations/components/one-time-password/otp.d.ts.map +1 -1
- package/declarations/components/one-time-password/utils.d.ts.map +1 -1
- package/declarations/components/popover.d.ts +17 -26
- package/declarations/components/popover.d.ts.map +1 -1
- package/declarations/components/portal-targets.d.ts +1 -1
- package/declarations/components/portal.d.ts +4 -3
- package/declarations/components/portal.d.ts.map +1 -1
- package/declarations/components/progress.d.ts +4 -4
- package/declarations/components/scroller.d.ts +1 -1
- package/declarations/components/shadowed.d.ts +1 -1
- package/declarations/components/switch.d.ts +5 -5
- package/declarations/components/toggle-group.d.ts +4 -4
- package/declarations/components/toggle.d.ts +2 -2
- package/declarations/components/toggle.d.ts.map +1 -1
- package/declarations/components/zoetrope/index.d.ts +3 -3
- package/declarations/components/zoetrope.d.ts +2 -2
- package/declarations/floating-ui/component.d.ts +19 -16
- package/declarations/floating-ui/component.d.ts.map +1 -1
- package/declarations/floating-ui/modifier.d.ts.map +1 -1
- package/declarations/floating-ui.d.ts +1 -1
- package/declarations/helpers/link.d.ts.map +1 -1
- package/declarations/index.d.ts +20 -19
- package/declarations/index.d.ts.map +1 -1
- package/declarations/proper-links.d.ts.map +1 -1
- package/declarations/test-support/routing.d.ts.map +1 -1
- package/declarations/utils.d.ts.map +1 -1
- package/dist/color-scheme.js +5 -5
- package/dist/color-scheme.js.map +1 -1
- package/dist/components/-private/typed-elements.js.map +1 -1
- package/dist/components/-private/utils.js +1 -3
- package/dist/components/-private/utils.js.map +1 -1
- package/dist/components/accordion/content.js +1 -1
- package/dist/components/accordion/header.js +1 -1
- package/dist/components/accordion/item.js +1 -1
- package/dist/components/accordion/trigger.js +1 -1
- package/dist/components/accordion.js +26 -25
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/dialog.js +15 -14
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/external-link.js.map +1 -1
- package/dist/components/form.js +6 -6
- package/dist/components/form.js.map +1 -1
- package/dist/components/keys.js +33 -0
- package/dist/components/keys.js.map +1 -0
- package/dist/components/layout/hero.js.map +1 -1
- package/dist/components/layout/sticky-footer.js.map +1 -1
- package/dist/components/link.js.map +1 -1
- package/dist/components/menu.js +47 -46
- package/dist/components/menu.js.map +1 -1
- package/dist/components/one-time-password/buttons.js +5 -5
- package/dist/components/one-time-password/buttons.js.map +1 -1
- package/dist/components/one-time-password/input.js +14 -14
- package/dist/components/one-time-password/input.js.map +1 -1
- package/dist/components/one-time-password/otp.js +26 -25
- package/dist/components/one-time-password/otp.js.map +1 -1
- package/dist/components/one-time-password/utils.js +18 -18
- package/dist/components/one-time-password/utils.js.map +1 -1
- package/dist/components/popover.js +44 -44
- package/dist/components/popover.js.map +1 -1
- package/dist/components/portal-targets.js +16 -16
- package/dist/components/portal-targets.js.map +1 -1
- package/dist/components/portal.js +5 -3
- package/dist/components/portal.js.map +1 -1
- package/dist/components/progress.js +16 -16
- package/dist/components/progress.js.map +1 -1
- package/dist/components/scroller.js +6 -6
- package/dist/components/scroller.js.map +1 -1
- package/dist/components/shadowed.js +9 -9
- package/dist/components/shadowed.js.map +1 -1
- package/dist/components/switch.js.map +1 -1
- package/dist/components/toggle-group.js +24 -24
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.js +4 -4
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/violations.css +8 -8
- package/dist/components/zoetrope/index.js +102 -102
- package/dist/components/zoetrope/index.js.map +1 -1
- package/dist/floating-ui/component.js +6 -6
- package/dist/floating-ui/component.js.map +1 -1
- package/dist/floating-ui/modifier.js +10 -6
- package/dist/floating-ui/modifier.js.map +1 -1
- package/dist/helpers/link.js +11 -7
- package/dist/helpers/link.js.map +1 -1
- package/dist/helpers/service.js +1 -1
- package/dist/helpers/service.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/{item-DmpElnSZ.js → item-D6pwWzMs.js} +3 -3
- package/dist/item-D6pwWzMs.js.map +1 -0
- package/dist/proper-links.js +10 -10
- package/dist/proper-links.js.map +1 -1
- package/dist/tabster.js +2 -2
- package/dist/tabster.js.map +1 -1
- package/dist/test-support/a11y.js +4 -4
- package/dist/test-support/a11y.js.map +1 -1
- package/dist/test-support/otp.js +6 -6
- package/dist/test-support/otp.js.map +1 -1
- package/dist/test-support/routing.js +3 -2
- package/dist/test-support/routing.js.map +1 -1
- package/dist/test-support/zoetrope.js.map +1 -1
- package/dist/utils.js +1 -0
- package/dist/utils.js.map +1 -1
- package/package.json +21 -31
- package/dist/item-DmpElnSZ.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Label } from
|
|
2
|
-
import type { TOC } from
|
|
3
|
-
import type { WithBoundArgs } from
|
|
1
|
+
import { Label } from './-private/typed-elements';
|
|
2
|
+
import type { TOC } from "@ember/component/template-only";
|
|
3
|
+
import type { WithBoundArgs } from "@glint/template";
|
|
4
4
|
export interface Signature {
|
|
5
5
|
Element: HTMLInputElement;
|
|
6
6
|
Args: {
|
|
@@ -33,7 +33,7 @@ export interface Signature {
|
|
|
33
33
|
* </template>
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
Control: WithBoundArgs<typeof Checkbox,
|
|
36
|
+
Control: WithBoundArgs<typeof Checkbox, "checked" | "id" | "onChange">;
|
|
37
37
|
/**
|
|
38
38
|
* The Switch element requires a label, and this label already has
|
|
39
39
|
* the association to the Control by setting the `for` attribute to the `id` of the Control
|
|
@@ -48,7 +48,7 @@ export interface Signature {
|
|
|
48
48
|
* </template>
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
|
-
Label: WithBoundArgs<typeof Label,
|
|
51
|
+
Label: WithBoundArgs<typeof Label, "for">;
|
|
52
52
|
}
|
|
53
53
|
];
|
|
54
54
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Component from
|
|
2
|
-
import type { ComponentLike } from
|
|
1
|
+
import Component from "@glimmer/component";
|
|
2
|
+
import type { ComponentLike } from "@glint/template";
|
|
3
3
|
export interface ItemSignature<Value = any> {
|
|
4
4
|
/**
|
|
5
5
|
* The button element will have aria-pressed="true" on it when the button is in the pressed state.
|
|
@@ -84,7 +84,7 @@ export interface MultiSignature<Value = any> {
|
|
|
84
84
|
interface PrivateSingleSignature<Value = any> {
|
|
85
85
|
Element: HTMLDivElement;
|
|
86
86
|
Args: {
|
|
87
|
-
type?:
|
|
87
|
+
type?: "single";
|
|
88
88
|
/**
|
|
89
89
|
* Optionally set the initial toggle state
|
|
90
90
|
*/
|
|
@@ -110,7 +110,7 @@ interface PrivateSingleSignature<Value = any> {
|
|
|
110
110
|
interface PrivateMultiSignature<Value = any> {
|
|
111
111
|
Element: HTMLDivElement;
|
|
112
112
|
Args: {
|
|
113
|
-
type:
|
|
113
|
+
type: "multi";
|
|
114
114
|
/**
|
|
115
115
|
* Optionally set the initial toggle state
|
|
116
116
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TOC } from
|
|
1
|
+
import type { TOC } from "@ember/component/template-only";
|
|
2
2
|
export interface Signature<Value = any> {
|
|
3
3
|
Element: HTMLButtonElement;
|
|
4
4
|
Args: {
|
|
@@ -29,7 +29,7 @@ export interface Signature<Value = any> {
|
|
|
29
29
|
/**
|
|
30
30
|
* When controlling state in a wrapping component, this function can be used in conjunction with `@value` to determine if this `<Toggle>` should appear pressed.
|
|
31
31
|
*/
|
|
32
|
-
isPressed?: (value?: Value
|
|
32
|
+
isPressed?: (value?: Value) => boolean;
|
|
33
33
|
};
|
|
34
34
|
Blocks: {
|
|
35
35
|
default: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../src/components/toggle.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../src/components/toggle.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAE1D,MAAM,WAAW,SAAS,CAAC,KAAK,GAAG,GAAG;IACpC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,IAAI,EAAE;QACJ;;;;WAIG;QACH,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB;;;;;;;;;;WAUG;QACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;QAEhE;;;;WAIG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC;QAEd;;WAEG;QACH,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,OAAO,CAAC;KACxC,CAAC;IACF,MAAM,EAAE;QACN,OAAO,EAAE;YACP;;;;eAIG;YACH,OAAO,EAAE,OAAO;SACjB,CAAC;KACH,CAAC;CACH;AAaD,eAAO,MAAM,MAAM,EAAE,GAAG,CAAC,SAAS,CAmBhC,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Component from
|
|
3
|
-
import type { ScrollBehavior, Signature } from
|
|
1
|
+
import "./styles.css";
|
|
2
|
+
import Component from "@glimmer/component";
|
|
3
|
+
import type { ScrollBehavior, Signature } from "./types.ts";
|
|
4
4
|
export declare class Zoetrope extends Component<Signature> {
|
|
5
5
|
scrollerElement: HTMLElement | null;
|
|
6
6
|
currentlyScrolled: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { Zoetrope } from
|
|
2
|
-
export { default } from
|
|
1
|
+
export { Zoetrope } from './zoetrope/index';
|
|
2
|
+
export { default } from './zoetrope/index';
|
|
3
3
|
export type { Signature } from './zoetrope/types.ts';
|
|
4
4
|
//# sourceMappingURL=zoetrope.d.ts.map
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import Component from
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
|
|
6
|
-
import type { ModifierLike } from '@glint/template';
|
|
7
|
-
type ModifierArgs = ModifierSignature['Args']['Named'];
|
|
1
|
+
import Component from "@glimmer/component";
|
|
2
|
+
import type { Signature as ModifierSignature } from "./modifier.ts";
|
|
3
|
+
import type { MiddlewareState } from "@floating-ui/dom";
|
|
4
|
+
import type { ModifierLike } from "@glint/template";
|
|
5
|
+
type ModifierArgs = ModifierSignature["Args"]["Named"];
|
|
8
6
|
interface ReferenceSignature {
|
|
9
7
|
Element: HTMLElement | SVGElement;
|
|
10
8
|
}
|
|
@@ -15,37 +13,37 @@ export interface Signature {
|
|
|
15
13
|
*
|
|
16
14
|
* See: [The middleware docs](https://floating-ui.com/docs/middleware)
|
|
17
15
|
*/
|
|
18
|
-
middleware?: ModifierArgs[
|
|
16
|
+
middleware?: ModifierArgs["middleware"];
|
|
19
17
|
/**
|
|
20
18
|
* Where to place the floating element relative to its reference element.
|
|
21
19
|
* The default is 'bottom'.
|
|
22
20
|
*
|
|
23
21
|
* See: [The placement docs](https://floating-ui.com/docs/computePosition#placement)
|
|
24
22
|
*/
|
|
25
|
-
placement?: ModifierArgs[
|
|
23
|
+
placement?: ModifierArgs["placement"];
|
|
26
24
|
/**
|
|
27
25
|
* This is the type of CSS position property to use.
|
|
28
26
|
* By default this is 'fixed', but can also be 'absolute'.
|
|
29
27
|
*
|
|
30
28
|
* See: [The strategy docs](https://floating-ui.com/docs/computePosition#strategy)
|
|
31
29
|
*/
|
|
32
|
-
strategy?: ModifierArgs[
|
|
30
|
+
strategy?: ModifierArgs["strategy"];
|
|
33
31
|
/**
|
|
34
32
|
* Options to pass to the [flip middleware](https://floating-ui.com/docs/flip)
|
|
35
33
|
*/
|
|
36
|
-
flipOptions?: ModifierArgs[
|
|
34
|
+
flipOptions?: ModifierArgs["flipOptions"];
|
|
37
35
|
/**
|
|
38
36
|
* Options to pass to the [hide middleware](https://floating-ui.com/docs/hide)
|
|
39
37
|
*/
|
|
40
|
-
hideOptions?: ModifierArgs[
|
|
38
|
+
hideOptions?: ModifierArgs["hideOptions"];
|
|
41
39
|
/**
|
|
42
40
|
* Options to pass to the [shift middleware](https://floating-ui.com/docs/shift)
|
|
43
41
|
*/
|
|
44
|
-
shiftOptions?: ModifierArgs[
|
|
42
|
+
shiftOptions?: ModifierArgs["shiftOptions"];
|
|
45
43
|
/**
|
|
46
44
|
* Options to pass to the [offset middleware](https://floating-ui.com/docs/offset)
|
|
47
45
|
*/
|
|
48
|
-
offsetOptions?: ModifierArgs[
|
|
46
|
+
offsetOptions?: ModifierArgs["offsetOptions"];
|
|
49
47
|
};
|
|
50
48
|
Blocks: {
|
|
51
49
|
default: [
|
|
@@ -82,7 +80,12 @@ export interface Signature {
|
|
|
82
80
|
* </template>
|
|
83
81
|
* ```
|
|
84
82
|
*/
|
|
85
|
-
floating: undefined |
|
|
83
|
+
floating: undefined | ModifierLike<{
|
|
84
|
+
Element: HTMLElement;
|
|
85
|
+
Args: {
|
|
86
|
+
Named: ModifierArgs;
|
|
87
|
+
};
|
|
88
|
+
}>,
|
|
86
89
|
/**
|
|
87
90
|
* Special utilities for advanced usage
|
|
88
91
|
*/
|
|
@@ -124,7 +127,7 @@ export interface Signature {
|
|
|
124
127
|
export declare class FloatingUI extends Component<Signature> {
|
|
125
128
|
reference?: HTMLElement | SVGElement;
|
|
126
129
|
data?: MiddlewareState;
|
|
127
|
-
setData: ModifierArgs[
|
|
130
|
+
setData: ModifierArgs["setData"];
|
|
128
131
|
setReference: (element: HTMLElement | SVGElement) => void;
|
|
129
132
|
}
|
|
130
133
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/floating-ui/component.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../src/floating-ui/component.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAQ3C,OAAO,KAAK,EAAE,SAAS,IAAI,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,KAAK,YAAY,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;AAEvD,UAAU,kBAAkB;IAC1B,OAAO,EAAE,WAAW,GAAG,UAAU,CAAC;CACnC;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE;QACJ;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UAE/C;CAwBH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modifier.d.ts","sourceRoot":"","sources":["../../src/floating-ui/modifier.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE;QACJ,UAAU,EAAE;YACV;;;;;;;;;;;;;eAaG;YACH,gBAAgB,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU;SACpD,CAAC;QACF,KAAK,EAAE;YACL;;;;;eAKG;YACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;YACpB;;eAEG;YACH,aAAa,CAAC,EAAE,aAAa,CAAC;YAC9B;;;;;eAKG;YACH,SAAS,CAAC,EAAE,SAAS,CAAC;YACtB;;eAEG;YACH,WAAW,CAAC,EAAE,WAAW,CAAC;YAC1B;;eAEG;YACH,YAAY,CAAC,EAAE,YAAY,CAAC;YAC5B;;eAEG;YACH,WAAW,CAAC,EAAE,WAAW,CAAC;YAC1B;;;;eAIG;YACH,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;YAC1B;;;eAGG;YACH,OAAO,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;SAC5B,CAAC;KACH,CAAC;CACH;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ;;;;YA3Df;;;;;eAKG;uBACQ,QAAQ;YACnB;;eAEG;4BACa,aAAa;YAC7B;;;;;eAKG;wBACS,SAAS;YACrB;;eAEG;0BACW,WAAW;YACzB;;eAEG;2BACY,YAAY;YAC3B;;eAEG;0BACW,WAAW;YACzB;;;;eAIG;yBACU,UAAU,EAAE;YACzB;;;eAGG;sBACO,UAAU,CAAC,IAAI,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"modifier.d.ts","sourceRoot":"","sources":["../../src/floating-ui/modifier.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,WAAW,EACX,WAAW,EACX,UAAU,EACV,aAAa,EACb,SAAS,EACT,YAAY,EACZ,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE;QACJ,UAAU,EAAE;YACV;;;;;;;;;;;;;eAaG;YACH,gBAAgB,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU;SACpD,CAAC;QACF,KAAK,EAAE;YACL;;;;;eAKG;YACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;YACpB;;eAEG;YACH,aAAa,CAAC,EAAE,aAAa,CAAC;YAC9B;;;;;eAKG;YACH,SAAS,CAAC,EAAE,SAAS,CAAC;YACtB;;eAEG;YACH,WAAW,CAAC,EAAE,WAAW,CAAC;YAC1B;;eAEG;YACH,YAAY,CAAC,EAAE,YAAY,CAAC;YAC5B;;eAEG;YACH,WAAW,CAAC,EAAE,WAAW,CAAC;YAC1B;;;;eAIG;YACH,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC;YAC1B;;;eAGG;YACH,OAAO,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;SAC5B,CAAC;KACH,CAAC;CACH;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ;;;;YA3Df;;;;;eAKG;uBACQ,QAAQ;YACnB;;eAEG;4BACa,aAAa;YAC7B;;;;;eAKG;wBACS,SAAS;YACrB;;eAEG;0BACW,WAAW;YACzB;;eAEG;2BACY,YAAY;YAC3B;;eAEG;0BACW,WAAW;YACzB;;;;eAIG;yBACU,UAAU,EAAE;YACzB;;;eAGG;sBACO,UAAU,CAAC,IAAI,CAAC;;;;EAqG/B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":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
2
|
export type { AccordionContentExternalSignature, AccordionHeaderExternalSignature, AccordionItemExternalSignature, AccordionTriggerExternalSignature, } from './components/accordion/public.ts';
|
|
3
|
-
export { Avatar } from
|
|
4
|
-
export { Dialog, Dialog as Modal } from
|
|
5
|
-
export { ExternalLink } from
|
|
6
|
-
export { Form } from
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
3
|
+
export { Avatar } from './components/avatar';
|
|
4
|
+
export { Dialog, Dialog as Modal } from './components/dialog';
|
|
5
|
+
export { ExternalLink } from './components/external-link';
|
|
6
|
+
export { Form } from './components/form';
|
|
7
|
+
export { Key, KeyCombo } from './components/keys';
|
|
8
|
+
export { StickyFooter } from './components/layout/sticky-footer';
|
|
9
|
+
export { Link } from './components/link';
|
|
10
|
+
export { Menu } from './components/menu';
|
|
11
|
+
export { OTP, OTPInput } from './components/one-time-password/index';
|
|
12
|
+
export { Popover } from './components/popover';
|
|
13
|
+
export { Portal } from './components/portal';
|
|
14
|
+
export { PortalTargets } from './components/portal-targets';
|
|
15
|
+
export { TARGETS as PORTALS } from './components/portal-targets';
|
|
16
|
+
export { Progress } from './components/progress';
|
|
17
|
+
export { Scroller } from './components/scroller';
|
|
18
|
+
export { Shadowed } from './components/shadowed';
|
|
19
|
+
export { Switch } from './components/switch';
|
|
20
|
+
export { Toggle } from './components/toggle';
|
|
21
|
+
export { ToggleGroup } from './components/toggle-group';
|
|
21
22
|
export { Zoetrope } from './components/zoetrope.ts';
|
|
22
23
|
export * from './helpers.ts';
|
|
23
24
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts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C5D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,cAAc,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proper-links.d.ts","sourceRoot":"","sources":["../src/proper-links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proper-links.d.ts","sourceRoot":"","sources":["../src/proper-links.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlD,MAAM,WAAW,OAAO;IACtB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,OAAO,GACf,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,GAAG;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAA;CAAE,EAAE,KAAK,EAAE,KAAK,KAAK,KAAK,CAAC;AAEhG,wBAAgB,WAAW,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,GAAG;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAA;CAAE,EAC7F,KAAK,EAAE,KAAK,GACX,KAAK,CAAC;AACT;;GAEG;AACH,wBAAgB,WAAW,CAAC,QAAQ,SAAS,MAAM,EAAE,KAAK,GAAG;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,QAAQ,CAAA;CAAE,EAC7F,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,GACX,KAAK,CAAC;AAsCT;;;GAGG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,QAsBtD;AAED,wBAAgB,MAAM,CACpB,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,iBAAiB,EAC1B,MAAM,EAAE,MAAM,EAAE,EAChB,KAAK,EAAE,UAAU,qBAwClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/test-support/routing.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/test-support/routing.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,aAAa,MAAM,+BAA+B,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,QAqBzF;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,GAAG,aAAa,CAErD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,QAQvB"}
|
package/dist/color-scheme.js
CHANGED
|
@@ -5,7 +5,7 @@ const _colorScheme = cell();
|
|
|
5
5
|
let callbacks = new Set();
|
|
6
6
|
async function runCallbacks(theme) {
|
|
7
7
|
await Promise.resolve();
|
|
8
|
-
for (
|
|
8
|
+
for (const callback of callbacks.values()) {
|
|
9
9
|
callback(theme);
|
|
10
10
|
}
|
|
11
11
|
}
|
|
@@ -19,7 +19,7 @@ const colorScheme = {
|
|
|
19
19
|
*/
|
|
20
20
|
update: value => {
|
|
21
21
|
colorScheme.current = value;
|
|
22
|
-
waitForPromise(runCallbacks(value));
|
|
22
|
+
void waitForPromise(runCallbacks(value));
|
|
23
23
|
},
|
|
24
24
|
on: {
|
|
25
25
|
/**
|
|
@@ -69,7 +69,7 @@ function sync() {
|
|
|
69
69
|
* If local prefs are set, then we don't care what prefers-color-scheme is
|
|
70
70
|
*/
|
|
71
71
|
if (localPreference.isSet()) {
|
|
72
|
-
|
|
72
|
+
const pref = localPreference.read();
|
|
73
73
|
if (pref === 'dark') {
|
|
74
74
|
setColorScheme('dark');
|
|
75
75
|
_colorScheme.current = 'dark';
|
|
@@ -113,7 +113,7 @@ const localPreference = {
|
|
|
113
113
|
* For the given element, returns the `color-scheme` of that element.
|
|
114
114
|
*/
|
|
115
115
|
function getColorScheme(element) {
|
|
116
|
-
|
|
116
|
+
const style = styleOf(element);
|
|
117
117
|
return style.getPropertyValue('color-scheme');
|
|
118
118
|
}
|
|
119
119
|
function setColorScheme(...args) {
|
|
@@ -132,7 +132,7 @@ function setColorScheme(...args) {
|
|
|
132
132
|
* Removes the `color-scheme` from the given element
|
|
133
133
|
*/
|
|
134
134
|
function removeColorScheme(element) {
|
|
135
|
-
|
|
135
|
+
const style = styleOf(element);
|
|
136
136
|
style.removeProperty('color-scheme');
|
|
137
137
|
}
|
|
138
138
|
function styleOf(element) {
|
package/dist/color-scheme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-scheme.js","sources":["../src/color-scheme.ts"],"sourcesContent":["import { waitForPromise } from '@ember/test-waiters';\n\nimport { cell } from 'ember-resources';\n\nconst _colorScheme = cell<string | undefined>();\n\nlet callbacks: Set<(colorScheme: string) => void> = new Set();\n\nasync function runCallbacks(theme: string) {\n await Promise.resolve();\n\n for (
|
|
1
|
+
{"version":3,"file":"color-scheme.js","sources":["../src/color-scheme.ts"],"sourcesContent":["import { waitForPromise } from '@ember/test-waiters';\n\nimport { cell } from 'ember-resources';\n\nconst _colorScheme = cell<string | undefined>();\n\nlet callbacks: Set<(colorScheme: string) => void> = new Set();\n\nasync function runCallbacks(theme: string) {\n await Promise.resolve();\n\n for (const callback of callbacks.values()) {\n callback(theme);\n }\n}\n\n/**\n * Object for managing the color scheme\n */\nexport const colorScheme = {\n /**\n * Set's the current color scheme to the passed value\n */\n update: (value: string) => {\n colorScheme.current = value;\n\n void waitForPromise(runCallbacks(value));\n },\n\n on: {\n /**\n * register a function to be called when the color scheme changes.\n */\n update: (callback: (colorScheme: string) => void) => {\n callbacks.add(callback);\n },\n },\n off: {\n /**\n * unregister a function that would have been called when the color scheme changes.\n */\n update: (callback: (colorScheme: string) => void) => {\n callbacks.delete(callback);\n },\n },\n\n /**\n * the current valuel of the \"color scheme\"\n */\n get current(): string | undefined {\n return _colorScheme.current;\n },\n set current(value: string | undefined) {\n _colorScheme.current = value;\n\n if (!value) {\n localPreference.delete();\n\n return;\n }\n\n localPreference.update(value);\n setColorScheme(value);\n },\n};\n\n/**\n * Synchronizes state of `colorScheme` with the users preferences as well as reconciles with previously set theme in local storage.\n *\n * This may only be called once per app.\n */\nexport function sync() {\n /**\n * reset the callbacks\n */\n callbacks = new Set();\n\n /**\n * If local prefs are set, then we don't care what prefers-color-scheme is\n */\n if (localPreference.isSet()) {\n const pref = localPreference.read();\n\n if (pref === 'dark') {\n setColorScheme('dark');\n\n _colorScheme.current = 'dark';\n\n return;\n }\n\n setColorScheme('light');\n _colorScheme.current = 'light';\n\n return;\n }\n\n if (prefers.dark()) {\n setColorScheme('dark');\n _colorScheme.current = 'dark';\n } else if (prefers.light()) {\n setColorScheme('light');\n _colorScheme.current = 'light';\n }\n}\n\n/**\n * Helper methods to determining what the user's preferred color scheme is\n */\nexport const prefers = {\n dark: () => window.matchMedia('(prefers-color-scheme: dark)').matches,\n light: () => window.matchMedia('(prefers-color-scheme: light)').matches,\n custom: (name: string) => window.matchMedia(`(prefers-color-scheme: ${name})`).matches,\n none: () => window.matchMedia('(prefers-color-scheme: no-preference)').matches,\n};\n\nconst LOCAL_PREF_KEY = 'ember-primitives/color-scheme#local-preference';\n\n/**\n * Helper methods for working with the color scheme preference in local storage\n */\nexport const localPreference = {\n isSet: () => Boolean(localPreference.read()),\n read: () => localStorage.getItem(LOCAL_PREF_KEY),\n update: (value: string) => localStorage.setItem(LOCAL_PREF_KEY, value),\n delete: () => localStorage.removeItem(LOCAL_PREF_KEY),\n};\n\n/**\n * For the given element, returns the `color-scheme` of that element.\n */\nexport function getColorScheme(element?: HTMLElement) {\n const style = styleOf(element);\n\n return style.getPropertyValue('color-scheme');\n}\n\nexport function setColorScheme(element: HTMLElement, value: string): void;\nexport function setColorScheme(value: string): void;\n\nexport function setColorScheme(...args: [string] | [HTMLElement, string]): void {\n if (typeof args[0] === 'string') {\n styleOf().setProperty('color-scheme', args[0]);\n\n return;\n }\n\n if (typeof args[1] === 'string') {\n styleOf(args[0]).setProperty('color-scheme', args[1]);\n\n return;\n }\n\n throw new Error(`Invalid arity, expected up to 2 args, received ${args.length}`);\n}\n\n/**\n * Removes the `color-scheme` from the given element\n */\nexport function removeColorScheme(element?: HTMLElement) {\n const style = styleOf(element);\n\n style.removeProperty('color-scheme');\n}\n\nfunction styleOf(element?: HTMLElement) {\n if (element) {\n return element.style;\n }\n\n return document.documentElement.style;\n}\n"],"names":["_colorScheme","cell","callbacks","Set","runCallbacks","theme","Promise","resolve","callback","values","colorScheme","update","value","current","waitForPromise","on","add","off","delete","localPreference","setColorScheme","sync","isSet","pref","read","prefers","dark","light","window","matchMedia","matches","custom","name","none","LOCAL_PREF_KEY","Boolean","localStorage","getItem","setItem","removeItem","getColorScheme","element","style","styleOf","getPropertyValue","args","setProperty","Error","length","removeColorScheme","removeProperty","document","documentElement"],"mappings":";;;AAIA,MAAMA,YAAY,GAAGC,IAAI,EAAsB;AAE/C,IAAIC,SAA6C,GAAG,IAAIC,GAAG,EAAE;AAE7D,eAAeC,YAAYA,CAACC,KAAa,EAAE;AACzC,EAAA,MAAMC,OAAO,CAACC,OAAO,EAAE;EAEvB,KAAK,MAAMC,QAAQ,IAAIN,SAAS,CAACO,MAAM,EAAE,EAAE;IACzCD,QAAQ,CAACH,KAAK,CAAC;AACjB;AACF;;AAEA;AACA;AACA;AACO,MAAMK,WAAW,GAAG;AACzB;AACF;AACA;EACEC,MAAM,EAAGC,KAAa,IAAK;IACzBF,WAAW,CAACG,OAAO,GAAGD,KAAK;AAE3B,IAAA,KAAKE,cAAc,CAACV,YAAY,CAACQ,KAAK,CAAC,CAAC;GACzC;AAEDG,EAAAA,EAAE,EAAE;AACF;AACJ;AACA;IACIJ,MAAM,EAAGH,QAAuC,IAAK;AACnDN,MAAAA,SAAS,CAACc,GAAG,CAACR,QAAQ,CAAC;AACzB;GACD;AACDS,EAAAA,GAAG,EAAE;AACH;AACJ;AACA;IACIN,MAAM,EAAGH,QAAuC,IAAK;AACnDN,MAAAA,SAAS,CAACgB,MAAM,CAACV,QAAQ,CAAC;AAC5B;GACD;AAED;AACF;AACA;EACE,IAAIK,OAAOA,GAAuB;IAChC,OAAOb,YAAY,CAACa,OAAO;GAC5B;EACD,IAAIA,OAAOA,CAACD,KAAyB,EAAE;IACrCZ,YAAY,CAACa,OAAO,GAAGD,KAAK;IAE5B,IAAI,CAACA,KAAK,EAAE;MACVO,eAAe,CAACD,MAAM,EAAE;AAExB,MAAA;AACF;AAEAC,IAAAA,eAAe,CAACR,MAAM,CAACC,KAAK,CAAC;IAC7BQ,cAAc,CAACR,KAAK,CAAC;AACvB;AACF;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASS,IAAIA,GAAG;AACrB;AACF;AACA;AACEnB,EAAAA,SAAS,GAAG,IAAIC,GAAG,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ources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"typed-elements.js","sources":["../../../src/components/-private/typed-elements.gts"],"sourcesContent":["import type { TOC } from \"@ember/component/template-only\";\n\nexport const Div: TOC<{ Element: HTMLDivElement; Blocks: { default: [] } }> = <template>\n <div ...attributes>{{yield}}</div>\n</template>;\n\nexport const Label: TOC<{\n Element: HTMLLabelElement;\n Args: { for: string };\n Blocks: { default: [] };\n}> = <template>\n <label for={{@for}} ...attributes>{{yield}}</label>\n</template>;\n"],"names":["Div","setComponentTemplate","precompileTemplate","strictMode","templateOnly","Label"],"mappings":";;;;MAEaA,GAAiE,GAAAC,oBAAA,CAAAC,kBAAA,CAE9E,0CAAA,EAAA;EAAAC,UAAA,EAAA;AAAU,CAAE,CAAA,EAAAC,YAAA,EAAA;MAECC,KAIR,GAAAJ,oBAAA,CAAAC,kBAAA,CAEL,2DAAA,EAAA;EAAAC,UAAA,EAAA;AAAU,CAAE,CAAA,EAAAC,YAAA,EAAA;;;;"}
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
* If the user provides an onChange or similar function, use that,
|
|
3
3
|
* otherwise fallback to the uncontrolled toggle
|
|
4
4
|
*/
|
|
5
|
-
function toggleWithFallback(uncontrolledToggle,
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
-
controlledToggle, ...args) {
|
|
5
|
+
function toggleWithFallback(uncontrolledToggle, controlledToggle, ...args) {
|
|
8
6
|
if (controlledToggle) {
|
|
9
7
|
return controlledToggle(...args);
|
|
10
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../../../src/components/-private/utils.ts"],"sourcesContent":["/**\n * If the user provides an onChange or similar function, use that,\n * otherwise fallback to the uncontrolled toggle\n */\nexport function toggleWithFallback(\n uncontrolledToggle: (...args: unknown[]) => void,\n
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/components/-private/utils.ts"],"sourcesContent":["/**\n * If the user provides an onChange or similar function, use that,\n * otherwise fallback to the uncontrolled toggle\n */\nexport function toggleWithFallback(\n uncontrolledToggle: (...args: unknown[]) => void,\n\n controlledToggle?: (...args: any[]) => void,\n ...args: unknown[]\n) {\n if (controlledToggle) {\n return controlledToggle(...args);\n }\n\n uncontrolledToggle(...args);\n}\n"],"names":["toggleWithFallback","uncontrolledToggle","controlledToggle","args"],"mappings":"AAAA;AACA;AACA;AACA;AACO,SAASA,kBAAkBA,CAChCC,kBAAgD,EAEhDC,gBAA2C,EAC3C,GAAGC,IAAe,EAClB;AACA,EAAA,IAAID,gBAAgB,EAAE;AACpB,IAAA,OAAOA,gBAAgB,CAAC,GAAGC,IAAI,CAAC;AAClC;EAEAF,kBAAkB,CAAC,GAAGE,IAAI,CAAC;AAC7B;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@glimmer/component';
|
|
2
|
-
export { a as AccordionContent, a as default } from '../../item-
|
|
2
|
+
export { a as AccordionContent, a as default } from '../../item-D6pwWzMs.js';
|
|
3
3
|
import '@ember/template-compilation';
|
|
4
4
|
import '@ember/component';
|
|
5
5
|
//# sourceMappingURL=content.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@ember/helper';
|
|
2
|
-
export { c as AccordionHeader, c as default } from '../../item-
|
|
2
|
+
export { c as AccordionHeader, c as default } from '../../item-D6pwWzMs.js';
|
|
3
3
|
import '@ember/template-compilation';
|
|
4
4
|
import '@ember/component';
|
|
5
5
|
import '@ember/component/template-only';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '@glimmer/component';
|
|
2
2
|
import '@ember/helper';
|
|
3
|
-
export { A as AccordionItem, A as default, g as getDataState } from '../../item-
|
|
3
|
+
export { A as AccordionItem, A as default, g as getDataState } from '../../item-D6pwWzMs.js';
|
|
4
4
|
import '@ember/template-compilation';
|
|
5
5
|
import '@ember/component';
|
|
6
6
|
//# sourceMappingURL=item.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@ember/modifier';
|
|
2
|
-
export { b as AccordionTrigger, b as default } from '../../item-
|
|
2
|
+
export { b as AccordionTrigger, b as default } from '../../item-D6pwWzMs.js';
|
|
3
3
|
import '@ember/template-compilation';
|
|
4
4
|
import '@ember/component';
|
|
5
5
|
import '@ember/component/template-only';
|
|
@@ -2,7 +2,7 @@ import Component from '@glimmer/component';
|
|
|
2
2
|
import { assert } from '@ember/debug';
|
|
3
3
|
import { hash } from '@ember/helper';
|
|
4
4
|
import { localCopy } from 'tracked-toolbox';
|
|
5
|
-
import { A as AccordionItem } from '../item-
|
|
5
|
+
import { A as AccordionItem } from '../item-D6pwWzMs.js';
|
|
6
6
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
7
7
|
import { setComponentTemplate } from '@ember/component';
|
|
8
8
|
import { g, i } from 'decorator-transforms/runtime';
|
|
@@ -17,51 +17,52 @@ class Accordion extends Component {
|
|
|
17
17
|
})
|
|
18
18
|
}), this);
|
|
19
19
|
}
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
20
21
|
static {
|
|
21
|
-
g(this.prototype, "_internallyManagedValue", [localCopy(
|
|
22
|
+
g(this.prototype, "_internallyManagedValue", [localCopy("args.defaultValue")]);
|
|
22
23
|
}
|
|
23
24
|
#_internallyManagedValue = (i(this, "_internallyManagedValue"), void 0);
|
|
24
25
|
get selectedValue() {
|
|
25
26
|
return this.args.value ?? this._internallyManagedValue;
|
|
26
27
|
}
|
|
27
|
-
toggleItem =
|
|
28
|
+
toggleItem = value => {
|
|
28
29
|
if (this.args.disabled) {
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
31
|
-
if (this.args.type ===
|
|
32
|
-
this.toggleItemSingle(
|
|
33
|
-
} else if (this.args.type ===
|
|
34
|
-
this.toggleItemMultiple(
|
|
32
|
+
if (this.args.type === "single") {
|
|
33
|
+
this.toggleItemSingle(value);
|
|
34
|
+
} else if (this.args.type === "multiple") {
|
|
35
|
+
this.toggleItemMultiple(value);
|
|
35
36
|
}
|
|
36
37
|
};
|
|
37
|
-
toggleItemSingle =
|
|
38
|
-
assert(
|
|
39
|
-
assert(
|
|
40
|
-
if (
|
|
38
|
+
toggleItemSingle = value => {
|
|
39
|
+
assert("Cannot call `toggleItemSingle` when `disabled` is true.", !this.args.disabled);
|
|
40
|
+
assert("Cannot call `toggleItemSingle` when `type` is not `single`.", this.args.type === "single");
|
|
41
|
+
if (value === this.selectedValue && !this.args.collapsible) {
|
|
41
42
|
return;
|
|
42
43
|
}
|
|
43
|
-
const
|
|
44
|
+
const newValue = value === this.selectedValue ? undefined : value;
|
|
44
45
|
if (this.args.onValueChange) {
|
|
45
|
-
this.args.onValueChange(
|
|
46
|
+
this.args.onValueChange(newValue);
|
|
46
47
|
} else {
|
|
47
|
-
this._internallyManagedValue =
|
|
48
|
+
this._internallyManagedValue = newValue;
|
|
48
49
|
}
|
|
49
50
|
};
|
|
50
|
-
toggleItemMultiple =
|
|
51
|
-
assert(
|
|
52
|
-
assert(
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
let
|
|
56
|
-
if (
|
|
57
|
-
|
|
51
|
+
toggleItemMultiple = value => {
|
|
52
|
+
assert("Cannot call `toggleItemMultiple` when `disabled` is true.", !this.args.disabled);
|
|
53
|
+
assert("Cannot call `toggleItemMultiple` when `type` is not `multiple`.", this.args.type === "multiple");
|
|
54
|
+
const currentValues = this.selectedValue ?? [];
|
|
55
|
+
const indexOfValue = currentValues.indexOf(value);
|
|
56
|
+
let newValue;
|
|
57
|
+
if (indexOfValue === -1) {
|
|
58
|
+
newValue = [...currentValues, value];
|
|
58
59
|
} else {
|
|
59
|
-
|
|
60
|
+
newValue = [...currentValues.slice(0, indexOfValue), ...currentValues.slice(indexOfValue + 1)];
|
|
60
61
|
}
|
|
61
62
|
if (this.args.onValueChange) {
|
|
62
|
-
this.args.onValueChange(
|
|
63
|
+
this.args.onValueChange(newValue);
|
|
63
64
|
} else {
|
|
64
|
-
this._internallyManagedValue =
|
|
65
|
+
this._internallyManagedValue = newValue;
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accordion.js","sources":["../../src/components/accordion.gts"],"sourcesContent":["import Component from \"@glimmer/component\";\nimport { assert } from \"@ember/debug\";\nimport { hash } from \"@ember/helper\";\n\n// temp\n// https://github.com/tracked-tools/tracked-toolbox/issues/38\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport { localCopy } from \"tracked-toolbox\";\n\nimport AccordionItem from \"./accordion/item.gts\";\n\nimport type { WithBoundArgs } from \"@glint/template\";\n\ntype AccordionSingleArgs = {\n /**\n * The type of accordion. If `single`, only one item can be selected at a time. If `multiple`, multiple items can be selected at a time.\n */\n type: \"single\";\n /**\n * Whether the accordion is disabled. When `true`, all items cannot be expanded or collapsed.\n */\n disabled?: boolean;\n /**\n * When type is `single`, whether the accordion is collapsible. When `true`, the selected item can be collapsed by clicking its trigger.\n */\n collapsible?: boolean;\n} & (\n | {\n /**\n * The currently selected value. To be used in a controlled fashion in conjunction with `onValueChange`.\n */\n value: string;\n /**\n * A callback that is called when the selected value changes. To be used in a controlled fashion in conjunction with `value`.\n */\n onValueChange: (value: string | undefined) => void;\n /**\n * Not available in a controlled fashion.\n */\n defaultValue?: never;\n }\n | {\n /**\n * Not available in an uncontrolled fashion.\n */\n value?: never;\n /**\n * Not available in an uncontrolled fashion.\n */\n onValueChange?: never;\n /**\n * The default value of the accordion. To be used in an uncontrolled fashion.\n */\n defaultValue?: string;\n }\n);\n\ntype AccordionMultipleArgs = {\n /**\n * The type of accordion. If `single`, only one item can be selected at a time. If `multiple`, multiple items can be selected at a time.\n */\n type: \"multiple\";\n /**\n * Whether the accordion is disabled. When `true`, all items cannot be expanded or collapsed.\n */\n disabled?: boolean;\n} & (\n | {\n /**\n * The currently selected values. To be used in a controlled fashion in conjunction with `onValueChange`.\n */\n value: string[];\n /**\n * A callback that is called when the selected values change. To be used in a controlled fashion in conjunction with `value`.\n */\n onValueChange: (value?: string[]) => void;\n /**\n * Not available in a controlled fashion.\n */\n defaultValue?: never;\n }\n | {\n /**\n * Not available in an uncontrolled fashion.\n */\n value?: never;\n /**\n * Not available in an uncontrolled fashion.\n */\n onValueChange?: never;\n /**\n * The default values of the accordion. To be used in an uncontrolled fashion.\n */\n defaultValue?: string[];\n }\n);\n\nexport class Accordion extends Component<{\n Element: HTMLDivElement;\n Args: AccordionSingleArgs | AccordionMultipleArgs;\n Blocks: {\n default: [\n {\n /**\n * The AccordionItem component.\n */\n Item: WithBoundArgs<typeof AccordionItem, \"selectedValue\" | \"toggleItem\" | \"disabled\">;\n },\n ];\n };\n}> {\n <template>\n <div data-disabled={{@disabled}} ...attributes>\n {{yield\n (hash\n Item=(component\n AccordionItem\n selectedValue=this.selectedValue\n toggleItem=this.toggleItem\n disabled=@disabled\n )\n )\n }}\n </div>\n </template>\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n @localCopy(\"args.defaultValue\") declare _internallyManagedValue?: string | string[];\n\n get selectedValue() {\n return this.args.value ?? this._internallyManagedValue;\n }\n\n toggleItem = (value: string) => {\n if (this.args.disabled) {\n return;\n }\n\n if (this.args.type === \"single\") {\n this.toggleItemSingle(value);\n } else if (this.args.type === \"multiple\") {\n this.toggleItemMultiple(value);\n }\n };\n\n toggleItemSingle = (value: string) => {\n assert(\"Cannot call `toggleItemSingle` when `disabled` is true.\", !this.args.disabled);\n assert(\n \"Cannot call `toggleItemSingle` when `type` is not `single`.\",\n this.args.type === \"single\",\n );\n\n if (value === this.selectedValue && !this.args.collapsible) {\n return;\n }\n\n const newValue = value === this.selectedValue ? undefined : value;\n\n if (this.args.onValueChange) {\n this.args.onValueChange(newValue);\n } else {\n this._internallyManagedValue = newValue;\n }\n };\n\n toggleItemMultiple = (value: string) => {\n assert(\"Cannot call `toggleItemMultiple` when `disabled` is true.\", !this.args.disabled);\n assert(\n \"Cannot call `toggleItemMultiple` when `type` is not `multiple`.\",\n this.args.type === \"multiple\",\n );\n\n const currentValues = (this.selectedValue as string[] | undefined) ?? [];\n const indexOfValue = currentValues.indexOf(value);\n let newValue: string[];\n\n if (indexOfValue === -1) {\n newValue = [...currentValues, value];\n } else {\n newValue = [\n ...currentValues.slice(0, indexOfValue),\n ...currentValues.slice(indexOfValue + 1),\n ];\n }\n\n if (this.args.onValueChange) {\n this.args.onValueChange(newValue);\n } else {\n this._internallyManagedValue = newValue;\n }\n };\n}\n\nexport default Accordion;\n"],"names":["Accordion","Component","setComponentTemplate","precompileTemplate","strictMode","scope","hash","AccordionItem","g","prototype","localCopy","i","void 0","selectedValue","args","value","_internallyManagedValue","toggleItem","disabled","type","toggleItemSingle","toggleItemMultiple","assert","collapsible","newValue","undefined","onValueChange","currentValues","indexOfValue","indexOf","slice"],"mappings":";;;;;;;;;AAkGO,MAAMA,SAAkB,SAAAC,SAAA;AAc7B,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAaA,6MAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,IAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AAEV;AAAA,EAAA;AAAAC,IAAAA,CAAA,MAAAC,SAAA,EAAA,yBAAA,EAAA,CACCC,SAAU,CAAA,mBAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,wBAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,yBAAA,CAAA,EAAAC,MAAA;EAEX,IAAIC,aAAgBA,GAAA;IAClB,OAAO,IAAI,CAACC,IAAI,CAACC,KAAK,IAAI,IAAI,CAACC,uBAAuB;AACxD;EAEAC,UAAa,GAACF,KAAa,IAAA;AACzB,IAAA,IAAI,IAAI,CAACD,IAAI,CAACI,QAAQ,EA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AW,GAAA,CAAI,GAAAG,aAAA,EAAeZ,KAAA,CAAM;AACtC,KAAO,MAAA;MACLS,QAAW,GAAA,IACNG,aAAc,CAAAG,KAAK,CAAC,CAAG,EAAAF,YAAA,CAAA,KACvBD,aAAc,CAAAG,KAAK,CAACF,YAAe,GAAA,CAAA,CAAA,CACvC;AACH;AAEA,IAAA,IAAI,IAAI,CAACd,IAAI,CAACY,aAAa,EAAE;AAC3B,MAAA,IAAI,CAACZ,IAAI,CAACY,aAAa,CAACF,QAAA,CAAA;AAC1B,KAAO,MAAA;MACL,IAAI,CAACR,uBAAuB,GAAGQ,QAAA;AACjC;GACA;AACJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"avatar.js","sources":["../../src/components/avatar.gts"],"sourcesContent":["import { hash } from \"@ember/helper\";\n\nimport { ReactiveImage } from \"reactiveweb/image\";\nimport { WaitUntil } from \"reactiveweb/wait-until\";\n\nimport type { TOC } from \"@ember/component/template-only\";\nimport type { WithBoundArgs } from \"@glint/template\";\n\nconst Fallback: TOC<{\n Blocks: { default: [] };\n Args: {\n /**\n * The number of milliseconds to wait for the image to load\n * before displaying the fallback\n */\n delayMs?: number;\n /**\n * @private\n * Bound internally by ember-primitives\n */\n isLoaded: boolean;\n };\n}> = <template>\n {{#unless @isLoaded}}\n {{#let (WaitUntil @delayMs) as |delayFinished|}}\n {{#if delayFinished}}\n {{yield}}\n {{/if}}\n {{/let}}\n {{/unless}}\n</template>;\n\nconst Image: TOC<{\n Element: HTMLImageElement;\n Args: {\n /**\n * @private\n * The `src` value for the image.\n *\n * Bound internally by ember-primitives\n */\n src: string;\n /**\n * @private\n * Bound internally by ember-primitives\n */\n isLoaded: boolean;\n };\n}> = <template>\n {{#if @isLoaded}}\n <img alt=\"__missing__\" ...attributes src={{@src}} />\n {{/if}}\n</template>;\n\nexport const Avatar: TOC<{\n Element: HTMLSpanElement;\n Args: {\n /**\n * The `src` value for the image.\n */\n src: string;\n };\n Blocks: {\n default: [\n avatar: {\n /**\n * The image to render. It will only render when it has loaded.\n */\n Image: WithBoundArgs<typeof Image, \"src\" | \"isLoaded\">;\n /**\n * An element that renders when the image hasn't loaded.\n * This means whilst it's loading, or if there was an error.\n * If you notice a flash during loading,\n * you can provide a delayMs prop to delay its rendering so it only renders for those with slower connections.\n */\n Fallback: WithBoundArgs<typeof Fallback, \"isLoaded\">;\n /**\n * true while the image is loading\n */\n isLoading: boolean;\n /**\n * If the image fails to load, this will be `true`\n */\n isError: boolean;\n },\n ];\n };\n}> = <template>\n {{#let (ReactiveImage @src) as |imgState|}}\n <span\n data-prim-avatar\n ...attributes\n data-loading={{imgState.isLoading}}\n data-error={{imgState.isError}}\n >\n {{yield\n (hash\n Image=(component Image src=@src isLoaded=imgState.isResolved)\n Fallback=(component Fallback isLoaded=imgState.isResolved)\n isLoading=imgState.isLoading\n isError=imgState.isError\n )\n }}\n </span>\n {{/let}}\n</template>;\n\nexport default Avatar;\n"],"names":["Fallback","setComponentTemplate","precompileTemplate","strictMode","scope","WaitUntil","templateOnly","Image","Avatar","ReactiveImage","hash"],"mappings":";;;;;;;AAQA,MAAMA,QAcD,GAAAC,oBAAA,CAAAC,kBAAA,CAQL,+KAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA,CAAA;AAEV,MAAMC,KAgBD,GAAAN,oBAAA,CAAAC,kBAAA,CAIL,gGAAA,EAAA;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAG,YAAA,EAAA,CAAA;MAEGE,MAiCR,GAAAP,oBAAA,CAAAC,kBAAA,CAkBL,kYAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAK,aAAA;IAAAC,IAAA;IAAAH,KAAA;AAAAP,IAAAA;AAAA,GAAA;AAAU,CAAE,CAAA,EAAAM,YAAA,EAAA;;;;"}
|