ember-primitives 0.32.0 → 0.34.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.
Files changed (173) hide show
  1. package/declarations/-private.d.ts +0 -1
  2. package/declarations/color-scheme.d.ts +0 -1
  3. package/declarations/components/-private/typed-elements.d.ts +0 -1
  4. package/declarations/components/-private/utils.d.ts +0 -1
  5. package/declarations/components/accordion/content.d.ts +0 -1
  6. package/declarations/components/accordion/header.d.ts +0 -1
  7. package/declarations/components/accordion/item.d.ts +0 -1
  8. package/declarations/components/accordion/public.d.ts +0 -1
  9. package/declarations/components/accordion/trigger.d.ts +0 -1
  10. package/declarations/components/accordion.d.ts +0 -1
  11. package/declarations/components/avatar.d.ts +0 -1
  12. package/declarations/components/dialog.d.ts +0 -1
  13. package/declarations/components/external-link.d.ts +0 -1
  14. package/declarations/components/form.d.ts +0 -1
  15. package/declarations/components/keys.d.ts +0 -1
  16. package/declarations/components/layout/hero.d.ts +0 -1
  17. package/declarations/components/layout/sticky-footer.d.ts +0 -1
  18. package/declarations/components/link.d.ts +0 -1
  19. package/declarations/components/menu.d.ts +0 -1
  20. package/declarations/components/one-time-password/buttons.d.ts +0 -1
  21. package/declarations/components/one-time-password/index.d.ts +0 -1
  22. package/declarations/components/one-time-password/input.d.ts +0 -1
  23. package/declarations/components/one-time-password/otp.d.ts +0 -1
  24. package/declarations/components/one-time-password/utils.d.ts +0 -1
  25. package/declarations/components/popover.d.ts +0 -1
  26. package/declarations/components/portal-targets.d.ts +0 -1
  27. package/declarations/components/portal.d.ts +0 -1
  28. package/declarations/components/progress.d.ts +0 -1
  29. package/declarations/components/rating/index.d.ts +0 -1
  30. package/declarations/components/rating/public-types.d.ts +0 -1
  31. package/declarations/components/rating/range.d.ts +0 -1
  32. package/declarations/components/rating/stars.d.ts +0 -1
  33. package/declarations/components/rating/state.d.ts +0 -1
  34. package/declarations/components/rating/utils.d.ts +0 -1
  35. package/declarations/components/rating.d.ts +0 -1
  36. package/declarations/components/scroller.d.ts +0 -1
  37. package/declarations/components/shadowed.d.ts +0 -1
  38. package/declarations/components/switch.d.ts +0 -1
  39. package/declarations/components/toggle-group.d.ts +0 -1
  40. package/declarations/components/toggle.d.ts +0 -1
  41. package/declarations/components/visually-hidden.d.ts +0 -1
  42. package/declarations/components/zoetrope/index.d.ts +0 -1
  43. package/declarations/components/zoetrope/types.d.ts +0 -1
  44. package/declarations/components/zoetrope.d.ts +0 -1
  45. package/declarations/floating-ui/component.d.ts +0 -1
  46. package/declarations/floating-ui/middleware.d.ts +0 -1
  47. package/declarations/floating-ui/modifier.d.ts +0 -1
  48. package/declarations/floating-ui.d.ts +0 -1
  49. package/declarations/helpers/body-class.d.ts +0 -1
  50. package/declarations/helpers/link.d.ts +0 -1
  51. package/declarations/helpers/service.d.ts +0 -1
  52. package/declarations/helpers.d.ts +0 -1
  53. package/declarations/iframe.d.ts +0 -1
  54. package/declarations/index.d.ts +0 -1
  55. package/declarations/on-resize.d.ts +0 -1
  56. package/declarations/proper-links.d.ts +0 -1
  57. package/declarations/qp.d.ts +73 -0
  58. package/declarations/styles.css.d.ts +0 -1
  59. package/declarations/tabster.d.ts +0 -1
  60. package/declarations/template-registry.d.ts +0 -1
  61. package/declarations/test-support/a11y.d.ts +0 -1
  62. package/declarations/test-support/index.d.ts +0 -1
  63. package/declarations/test-support/otp.d.ts +0 -1
  64. package/declarations/test-support/rating.d.ts +0 -1
  65. package/declarations/test-support/routing.d.ts +0 -1
  66. package/declarations/test-support/zoetrope.d.ts +0 -1
  67. package/declarations/utils.d.ts +0 -1
  68. package/dist/components/-private/typed-elements.js.map +1 -1
  69. package/dist/components/accordion.js.map +1 -1
  70. package/dist/components/avatar.js.map +1 -1
  71. package/dist/components/dialog.js.map +1 -1
  72. package/dist/components/external-link.js.map +1 -1
  73. package/dist/components/form.js.map +1 -1
  74. package/dist/components/keys.js.map +1 -1
  75. package/dist/components/layout/hero.js.map +1 -1
  76. package/dist/components/layout/sticky-footer.js.map +1 -1
  77. package/dist/components/link.js.map +1 -1
  78. package/dist/components/menu.js.map +1 -1
  79. package/dist/components/one-time-password/buttons.js.map +1 -1
  80. package/dist/components/one-time-password/input.js.map +1 -1
  81. package/dist/components/one-time-password/otp.js.map +1 -1
  82. package/dist/components/one-time-password/utils.js.map +1 -1
  83. package/dist/components/popover.js.map +1 -1
  84. package/dist/components/portal-targets.js.map +1 -1
  85. package/dist/components/portal.js.map +1 -1
  86. package/dist/components/progress.js.map +1 -1
  87. package/dist/components/rating/index.js.map +1 -1
  88. package/dist/components/rating/range.js.map +1 -1
  89. package/dist/components/rating/stars.js.map +1 -1
  90. package/dist/components/rating/state.js.map +1 -1
  91. package/dist/components/scroller.js.map +1 -1
  92. package/dist/components/shadowed.js.map +1 -1
  93. package/dist/components/switch.js.map +1 -1
  94. package/dist/components/toggle-group.js.map +1 -1
  95. package/dist/components/toggle.js.map +1 -1
  96. package/dist/components/violations.css +8 -8
  97. package/dist/components/visually-hidden.js.map +1 -1
  98. package/dist/components/zoetrope/index.js.map +1 -1
  99. package/dist/floating-ui/component.js.map +1 -1
  100. package/dist/floating-ui/modifier.js.map +1 -1
  101. package/dist/item-D6pwWzMs.js.map +1 -1
  102. package/dist/proper-links.js.map +1 -1
  103. package/dist/qp.js +92 -0
  104. package/dist/qp.js.map +1 -0
  105. package/dist/test-support/otp.js.map +1 -1
  106. package/dist/test-support/rating.js.map +1 -1
  107. package/package.json +13 -13
  108. package/declarations/-private.d.ts.map +0 -1
  109. package/declarations/color-scheme.d.ts.map +0 -1
  110. package/declarations/components/-private/typed-elements.d.ts.map +0 -1
  111. package/declarations/components/-private/utils.d.ts.map +0 -1
  112. package/declarations/components/accordion/content.d.ts.map +0 -1
  113. package/declarations/components/accordion/header.d.ts.map +0 -1
  114. package/declarations/components/accordion/item.d.ts.map +0 -1
  115. package/declarations/components/accordion/public.d.ts.map +0 -1
  116. package/declarations/components/accordion/trigger.d.ts.map +0 -1
  117. package/declarations/components/accordion.d.ts.map +0 -1
  118. package/declarations/components/avatar.d.ts.map +0 -1
  119. package/declarations/components/dialog.d.ts.map +0 -1
  120. package/declarations/components/external-link.d.ts.map +0 -1
  121. package/declarations/components/form.d.ts.map +0 -1
  122. package/declarations/components/keys.d.ts.map +0 -1
  123. package/declarations/components/layout/hero.d.ts.map +0 -1
  124. package/declarations/components/layout/sticky-footer.d.ts.map +0 -1
  125. package/declarations/components/link.d.ts.map +0 -1
  126. package/declarations/components/menu.d.ts.map +0 -1
  127. package/declarations/components/one-time-password/buttons.d.ts.map +0 -1
  128. package/declarations/components/one-time-password/index.d.ts.map +0 -1
  129. package/declarations/components/one-time-password/input.d.ts.map +0 -1
  130. package/declarations/components/one-time-password/otp.d.ts.map +0 -1
  131. package/declarations/components/one-time-password/utils.d.ts.map +0 -1
  132. package/declarations/components/popover.d.ts.map +0 -1
  133. package/declarations/components/portal-targets.d.ts.map +0 -1
  134. package/declarations/components/portal.d.ts.map +0 -1
  135. package/declarations/components/progress.d.ts.map +0 -1
  136. package/declarations/components/rating/index.d.ts.map +0 -1
  137. package/declarations/components/rating/public-types.d.ts.map +0 -1
  138. package/declarations/components/rating/range.d.ts.map +0 -1
  139. package/declarations/components/rating/stars.d.ts.map +0 -1
  140. package/declarations/components/rating/state.d.ts.map +0 -1
  141. package/declarations/components/rating/utils.d.ts.map +0 -1
  142. package/declarations/components/rating.d.ts.map +0 -1
  143. package/declarations/components/scroller.d.ts.map +0 -1
  144. package/declarations/components/shadowed.d.ts.map +0 -1
  145. package/declarations/components/switch.d.ts.map +0 -1
  146. package/declarations/components/toggle-group.d.ts.map +0 -1
  147. package/declarations/components/toggle.d.ts.map +0 -1
  148. package/declarations/components/visually-hidden.d.ts.map +0 -1
  149. package/declarations/components/zoetrope/index.d.ts.map +0 -1
  150. package/declarations/components/zoetrope/types.d.ts.map +0 -1
  151. package/declarations/components/zoetrope.d.ts.map +0 -1
  152. package/declarations/floating-ui/component.d.ts.map +0 -1
  153. package/declarations/floating-ui/middleware.d.ts.map +0 -1
  154. package/declarations/floating-ui/modifier.d.ts.map +0 -1
  155. package/declarations/floating-ui.d.ts.map +0 -1
  156. package/declarations/helpers/body-class.d.ts.map +0 -1
  157. package/declarations/helpers/link.d.ts.map +0 -1
  158. package/declarations/helpers/service.d.ts.map +0 -1
  159. package/declarations/helpers.d.ts.map +0 -1
  160. package/declarations/iframe.d.ts.map +0 -1
  161. package/declarations/index.d.ts.map +0 -1
  162. package/declarations/on-resize.d.ts.map +0 -1
  163. package/declarations/proper-links.d.ts.map +0 -1
  164. package/declarations/styles.css.d.ts.map +0 -1
  165. package/declarations/tabster.d.ts.map +0 -1
  166. package/declarations/template-registry.d.ts.map +0 -1
  167. package/declarations/test-support/a11y.d.ts.map +0 -1
  168. package/declarations/test-support/index.d.ts.map +0 -1
  169. package/declarations/test-support/otp.d.ts.map +0 -1
  170. package/declarations/test-support/rating.d.ts.map +0 -1
  171. package/declarations/test-support/routing.d.ts.map +0 -1
  172. package/declarations/test-support/zoetrope.d.ts.map +0 -1
  173. package/declarations/utils.d.ts.map +0 -1
@@ -2,4 +2,3 @@
2
2
  * @internal
3
3
  */
4
4
  export declare const PRIMITIVES: unique symbol;
5
- //# sourceMappingURL=-private.d.ts.map
@@ -57,4 +57,3 @@ export declare function setColorScheme(value: string): void;
57
57
  * Removes the `color-scheme` from the given element
58
58
  */
59
59
  export declare function removeColorScheme(element?: HTMLElement): void;
60
- //# sourceMappingURL=color-scheme.d.ts.map
@@ -14,4 +14,3 @@ export declare const Label: TOC<{
14
14
  default: [];
15
15
  };
16
16
  }>;
17
- //# sourceMappingURL=typed-elements.d.ts.map
@@ -3,4 +3,3 @@
3
3
  * otherwise fallback to the uncontrolled toggle
4
4
  */
5
5
  export declare function toggleWithFallback(uncontrolledToggle: (...args: unknown[]) => void, controlledToggle?: (...args: any[]) => void, ...args: unknown[]): void;
6
- //# sourceMappingURL=utils.d.ts.map
@@ -11,4 +11,3 @@ export declare class AccordionContent extends Component<Signature> {
11
11
  get isHidden(): boolean;
12
12
  }
13
13
  export default AccordionContent;
14
- //# sourceMappingURL=content.d.ts.map
@@ -10,4 +10,3 @@ interface Signature extends AccordionHeaderExternalSignature {
10
10
  }
11
11
  export declare const AccordionHeader: TOC<Signature>;
12
12
  export default AccordionHeader;
13
- //# sourceMappingURL=header.d.ts.map
@@ -13,4 +13,3 @@ export declare class AccordionItem extends Component<Signature> {
13
13
  toggleItem: () => void;
14
14
  }
15
15
  export default AccordionItem;
16
- //# sourceMappingURL=item.d.ts.map
@@ -58,4 +58,3 @@ export interface AccordionItemExternalSignature {
58
58
  value: string;
59
59
  };
60
60
  }
61
- //# sourceMappingURL=public.d.ts.map
@@ -10,4 +10,3 @@ interface Signature extends AccordionTriggerExternalSignature {
10
10
  }
11
11
  export declare const AccordionTrigger: TOC<Signature>;
12
12
  export default AccordionTrigger;
13
- //# sourceMappingURL=trigger.d.ts.map
@@ -98,4 +98,3 @@ export declare class Accordion extends Component<{
98
98
  toggleItemMultiple: (value: string) => void;
99
99
  }
100
100
  export default Accordion;
101
- //# sourceMappingURL=accordion.d.ts.map
@@ -69,4 +69,3 @@ export declare const Avatar: TOC<{
69
69
  };
70
70
  }>;
71
71
  export default Avatar;
72
- //# sourceMappingURL=avatar.d.ts.map
@@ -126,4 +126,3 @@ declare class ModalDialog extends Component<Signature> {
126
126
  export declare const Modal: typeof ModalDialog;
127
127
  export declare const Dialog: typeof ModalDialog;
128
128
  export default ModalDialog;
129
- //# sourceMappingURL=dialog.d.ts.map
@@ -6,4 +6,3 @@ export declare const ExternalLink: TOC<{
6
6
  };
7
7
  }>;
8
8
  export default ExternalLink;
9
- //# sourceMappingURL=external-link.d.ts.map
@@ -37,4 +37,3 @@ export interface Signature {
37
37
  }
38
38
  export declare const Form: TOC<Signature>;
39
39
  export default Form;
40
- //# sourceMappingURL=form.d.ts.map
@@ -14,4 +14,3 @@ export interface KeySignature {
14
14
  };
15
15
  }
16
16
  export declare const Key: TOC<KeySignature>;
17
- //# sourceMappingURL=keys.d.ts.map
@@ -9,4 +9,3 @@ export declare const Hero: TOC<{
9
9
  default: [];
10
10
  };
11
11
  }>;
12
- //# sourceMappingURL=hero.d.ts.map
@@ -24,4 +24,3 @@ export declare const StickyFooter: TOC<{
24
24
  };
25
25
  }>;
26
26
  export default StickyFooter;
27
- //# sourceMappingURL=sticky-footer.d.ts.map
@@ -138,4 +138,3 @@ export interface Signature {
138
138
  */
139
139
  export declare const Link: TOC<Signature>;
140
140
  export default Link;
141
- //# sourceMappingURL=link.d.ts.map
@@ -107,4 +107,3 @@ export declare class Menu extends Component<Signature> {
107
107
  contentId: string;
108
108
  }
109
109
  export default Menu;
110
- //# sourceMappingURL=menu.d.ts.map
@@ -11,4 +11,3 @@ export declare const Reset: TOC<{
11
11
  default: [];
12
12
  };
13
13
  }>;
14
- //# sourceMappingURL=buttons.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { OTPInput } from './input';
2
2
  export { OTP } from './otp';
3
- //# sourceMappingURL=index.d.ts.map
@@ -73,4 +73,3 @@ export declare class OTPInput extends Component<{
73
73
  get fields(): undefined[];
74
74
  }
75
75
  export {};
76
- //# sourceMappingURL=input.d.ts.map
@@ -54,4 +54,3 @@ export declare const OTP: TOC<{
54
54
  ];
55
55
  };
56
56
  }>;
57
- //# sourceMappingURL=otp.d.ts.map
@@ -3,4 +3,3 @@ export declare function handlePaste(event: Event): void;
3
3
  export declare function handleNavigation(event: KeyboardEvent): void;
4
4
  export declare const autoAdvance: (event: Event) => void;
5
5
  export declare function getCollectiveValue(elementTarget: EventTarget | null, length: number): string | undefined;
6
- //# sourceMappingURL=utils.d.ts.map
@@ -105,4 +105,3 @@ declare const Content: TOC<{
105
105
  }>;
106
106
  export declare const Popover: TOC<Signature>;
107
107
  export default Popover;
108
- //# sourceMappingURL=popover.d.ts.map
@@ -10,4 +10,3 @@ export interface Signature {
10
10
  }
11
11
  export declare const PortalTargets: TOC<Signature>;
12
12
  export default PortalTargets;
13
- //# sourceMappingURL=portal-targets.d.ts.map
@@ -19,4 +19,3 @@ export interface Signature {
19
19
  }
20
20
  export declare const Portal: TOC<Signature>;
21
21
  export default Portal;
22
- //# sourceMappingURL=portal.d.ts.map
@@ -62,4 +62,3 @@ export declare class Progress extends Component<Signature> {
62
62
  get percent(): number;
63
63
  }
64
64
  export default Progress;
65
- //# sourceMappingURL=progress.d.ts.map
@@ -105,4 +105,3 @@ export declare class Rating extends Component<Signature> {
105
105
  get isReadonly(): boolean;
106
106
  get needsDescription(): boolean;
107
107
  }
108
- //# sourceMappingURL=index.d.ts.map
@@ -44,4 +44,3 @@ export interface StringIcons {
44
44
  */
45
45
  icon?: string;
46
46
  }
47
- //# sourceMappingURL=public-types.d.ts.map
@@ -8,4 +8,3 @@ export declare const RatingRange: TOC<{
8
8
  handleChange: (event: Event) => void;
9
9
  };
10
10
  }>;
11
- //# sourceMappingURL=range.d.ts.map
@@ -10,4 +10,3 @@ export declare const Stars: TOC<{
10
10
  total: number;
11
11
  };
12
12
  }>;
13
- //# sourceMappingURL=stars.d.ts.map
@@ -41,4 +41,3 @@ export declare class RatingState extends Component<{
41
41
  */
42
42
  handleChange: (event: Event) => void;
43
43
  }
44
- //# sourceMappingURL=state.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export declare function isString(x: unknown): x is string;
2
2
  export declare function lte(a: number, b: number): boolean;
3
3
  export declare function percentSelected(a: number, b: number): number;
4
- //# sourceMappingURL=utils.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export { Rating } from './rating/index';
2
2
  import type { ComponentIcons } from "./rating/public-types.ts";
3
3
  export type IconType = ComponentIcons["icon"];
4
- //# sourceMappingURL=rating.d.ts.map
@@ -105,4 +105,3 @@ export declare class Scroller extends Component<{
105
105
  scrollToLeft: () => void;
106
106
  scrollToRight: () => void;
107
107
  }
108
- //# sourceMappingURL=scroller.d.ts.map
@@ -32,4 +32,3 @@ export declare const Shadowed: TOC<{
32
32
  };
33
33
  }>;
34
34
  export default Shadowed;
35
- //# sourceMappingURL=shadowed.d.ts.map
@@ -67,4 +67,3 @@ declare const Checkbox: TOC<ControlSignature>;
67
67
  */
68
68
  export declare const Switch: TOC<Signature>;
69
69
  export default Switch;
70
- //# sourceMappingURL=switch.d.ts.map
@@ -136,4 +136,3 @@ interface PrivateMultiSignature<Value = any> {
136
136
  export declare class ToggleGroup<Value = any> extends Component<PrivateSingleSignature<Value> | PrivateMultiSignature<Value>> {
137
137
  }
138
138
  export {};
139
- //# sourceMappingURL=toggle-group.d.ts.map
@@ -44,4 +44,3 @@ export interface Signature<Value = any> {
44
44
  }
45
45
  export declare const Toggle: TOC<Signature>;
46
46
  export default Toggle;
47
- //# sourceMappingURL=toggle.d.ts.map
@@ -9,4 +9,3 @@ export declare const VisuallyHidden: TOC<{
9
9
  default: [];
10
10
  };
11
11
  }>;
12
- //# sourceMappingURL=visually-hidden.d.ts.map
@@ -23,4 +23,3 @@ export declare class Zoetrope extends Component<Signature> {
23
23
  private findOverflowingElement;
24
24
  }
25
25
  export default Zoetrope;
26
- //# sourceMappingURL=index.d.ts.map
@@ -54,4 +54,3 @@ export interface Signature {
54
54
  };
55
55
  Element: HTMLElement;
56
56
  }
57
- //# sourceMappingURL=types.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export { Zoetrope } from './zoetrope/index';
2
2
  export { default } from './zoetrope/index';
3
3
  export type { Signature } from './zoetrope/types.ts';
4
- //# sourceMappingURL=zoetrope.d.ts.map
@@ -131,4 +131,3 @@ export declare class FloatingUI extends Component<Signature> {
131
131
  setReference: (element: HTMLElement | SVGElement) => void;
132
132
  }
133
133
  export {};
134
- //# sourceMappingURL=component.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import type { Middleware } from '@floating-ui/dom';
2
2
  export declare function exposeMetadata(): Middleware;
3
- //# sourceMappingURL=middleware.d.ts.map
@@ -130,4 +130,3 @@ export declare const anchorTo: import("ember-modifier").FunctionBasedModifier<{
130
130
  Positional: [referenceElement: string | HTMLElement | SVGElement];
131
131
  };
132
132
  }>;
133
- //# sourceMappingURL=modifier.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { FloatingUI } from './floating-ui/component';
2
2
  export { anchorTo } from './floating-ui/modifier.ts';
3
- //# sourceMappingURL=floating-ui.d.ts.map
@@ -26,4 +26,3 @@ export default class BodyClass extends Helper<Signature> {
26
26
  willDestroy(): void;
27
27
  }
28
28
  export declare const bodyClass: typeof BodyClass;
29
- //# sourceMappingURL=body-class.d.ts.map
@@ -31,4 +31,3 @@ export declare function isActive(router: RouterService, href: string, includeQue
31
31
  type RouteInfo = ReturnType<RouterService['recognize']>;
32
32
  export declare function getParams(currentRouteInfo: RouteInfo): any[];
33
33
  export {};
34
- //# sourceMappingURL=link.d.ts.map
@@ -11,4 +11,3 @@ export default class GetService<Key extends keyof Registry> extends Helper<Signa
11
11
  compute(positional: [Key]): Registry[Key] & Service;
12
12
  }
13
13
  export declare const service: typeof GetService;
14
- //# sourceMappingURL=service.d.ts.map
@@ -1,3 +1,2 @@
1
1
  export { link } from './helpers/link.ts';
2
2
  export { service } from './helpers/service.ts';
3
- //# sourceMappingURL=helpers.d.ts.map
@@ -28,4 +28,3 @@ export declare const inIframe: () => boolean;
28
28
  * ```
29
29
  */
30
30
  export declare const notInIframe: () => boolean;
31
- //# sourceMappingURL=iframe.d.ts.map
@@ -23,4 +23,3 @@ export { ToggleGroup } from './components/toggle-group';
23
23
  export { VisuallyHidden } from './components/visually-hidden';
24
24
  export { Zoetrope } from './components/zoetrope.ts';
25
25
  export * from './helpers.ts';
26
- //# sourceMappingURL=index.d.ts.map
@@ -35,4 +35,3 @@ export declare const onResize: typeof OnResize;
35
35
  */
36
36
  export default function ignoreROError(): void;
37
37
  export {};
38
- //# sourceMappingURL=on-resize.d.ts.map
@@ -21,4 +21,3 @@ export declare function properLinks<Instance extends object, Klass = {
21
21
  */
22
22
  export declare function setup(parent: object, ignore?: string[]): void;
23
23
  export declare function handle(router: RouterService, element: HTMLAnchorElement, ignore: string[], event: MouseEvent): false | undefined;
24
- //# sourceMappingURL=proper-links.d.ts.map
@@ -0,0 +1,73 @@
1
+ import Helper from '@ember/component/helper';
2
+ import type RouterService from '@ember/routing/router-service';
3
+ interface Signature {
4
+ Args: {
5
+ Positional: [string];
6
+ };
7
+ Return: string | undefined;
8
+ }
9
+ /**
10
+ * Grabs a query-param off the current route from the router service.
11
+ *
12
+ * ```gjs
13
+ * import { qp } from 'ember-primitives/qp';
14
+ *
15
+ * <template>
16
+ * {{qp "query-param"}}
17
+ * </template>
18
+ * ```
19
+ */
20
+ export declare class qp extends Helper<Signature> {
21
+ router: RouterService;
22
+ compute([name]: [string]): string | undefined;
23
+ }
24
+ /**
25
+ * Returns a string for use as an `href` on `<a>` tags, updated with the passed query param
26
+ *
27
+ * ```gjs
28
+ * import { withQP } from 'ember-primitives/qp';
29
+ *
30
+ * <template>
31
+ * <a href={{withQP "foo" "2"}}>
32
+ * ...
33
+ * </a>
34
+ * </template>
35
+ * ```
36
+ */
37
+ export declare class withQP extends Helper<{
38
+ Args: {
39
+ Positional: [string, string];
40
+ };
41
+ Return: string;
42
+ }> {
43
+ router: RouterService;
44
+ compute([qpName, nextValue]: [string, string]): string;
45
+ }
46
+ /**
47
+ * Cast a query-param string value to a boolean
48
+ *
49
+ * ```gjs
50
+ * import { castToBoolean, qp } from 'ember-primitives/qp';
51
+ *
52
+ * <template>
53
+ * {{#if (castToBoolean (qp 'the-qp'))}}
54
+ * ...
55
+ * {{/if}}
56
+ * </template>
57
+ * ```
58
+ *
59
+ * The following values are considered "false"
60
+ * - undefined
61
+ * - ""
62
+ * - "0"
63
+ * - false
64
+ * - "f"
65
+ * - "off"
66
+ * - "no"
67
+ * - "null"
68
+ * - "undefined"
69
+ *
70
+ * All other values are considered truthy
71
+ */
72
+ export declare function castToBoolean(x: string | undefined): boolean;
73
+ export {};
@@ -3,4 +3,3 @@
3
3
  * may not be are included here.
4
4
  */
5
5
  import './components/visually-hidden.css';
6
- //# sourceMappingURL=styles.css.d.ts.map
@@ -21,4 +21,3 @@ context: object, { tabster, setTabsterRoot, }?: {
21
21
  tabster?: boolean;
22
22
  setTabsterRoot?: boolean;
23
23
  }): Promise<void>;
24
- //# sourceMappingURL=tabster.d.ts.map
@@ -30,4 +30,3 @@ export default interface Registry {
30
30
  Toggle: typeof Toggle;
31
31
  service: typeof service;
32
32
  }
33
- //# sourceMappingURL=template-registry.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export declare function setupTabster(hooks: {
2
2
  beforeEach: (callback: () => void | Promise<void>) => unknown;
3
3
  }): void;
4
- //# sourceMappingURL=a11y.d.ts.map
@@ -3,4 +3,3 @@ export { fillOTP } from './otp.ts';
3
3
  export { rating } from './rating.ts';
4
4
  export { getRouter, setupRouting } from './routing.ts';
5
5
  export { ZoetropeHelper } from './zoetrope.ts';
6
- //# sourceMappingURL=index.d.ts.map
@@ -3,4 +3,3 @@
3
3
  * @param {string} [ selector ] if there are multiple OTP components on a page, this can be used to select one of them.
4
4
  */
5
5
  export declare function fillOTP(code: string, selector?: string): Promise<void>;
6
- //# sourceMappingURL=otp.d.ts.map
@@ -19,4 +19,3 @@ declare class RatingPageObject {
19
19
  select(stars: number): Promise<void>;
20
20
  }
21
21
  export {};
22
- //# sourceMappingURL=rating.d.ts.map
@@ -29,4 +29,3 @@ export declare function setupRouting(owner: Owner, map: DSLCallback, options?: {
29
29
  rootURL: string;
30
30
  }): void;
31
31
  export declare function getRouter(owner: Owner): RouterService;
32
- //# sourceMappingURL=routing.d.ts.map
@@ -6,4 +6,3 @@ export declare class ZoetropeHelper {
6
6
  visibleItems(): Element[];
7
7
  visibleItemCount(): number;
8
8
  }
9
- //# sourceMappingURL=zoetrope.d.ts.map
@@ -1,2 +1 @@
1
1
  export declare function uniqueId(): string;
2
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
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;;;;"}
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,CAAA,0CAAA,EAE9E;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGC,KAIR,GAAAJ,oBAAA,CAAAC,kBAAA,CAAA,2DAAA,EAEL;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
@@ -1 +1 @@
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,EAAE;AACtB,MAAA;AACF;AAEA,IAAA,IAAI,IAAI,CAACJ,IAAI,CAACK,IAAI,KAAK,QAAU,EAAA;AAC/B,MAAA,IAAI,CAACC,gBAAgB,CAACL,KAAA,CAAA;KACxB,MAAO,IAAI,IAAI,CAACD,IAAI,CAACK,IAAI,KAAK,UAAY,EAAA;AACxC,MAAA,IAAI,CAACE,kBAAkB,CAACN,KAAA,CAAA;AAC1B;GACA;EAEFK,gBAAmB,GAACL,KAAa,IAAA;IAC/BO,MAAA,CAAO,2DAA2D,CAAC,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O,MAAA;MACL,IAAI,CAACR,uBAAuB,GAAGQ,QAAA;AACjC;GACA;AACJ;;;;"}
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,SAAA,SAAkBC,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,SAAA,CAAU,mBAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,wBAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,yBAAA,CAAA,EAAAC,MAAA;EAEX,IAAIC,aAAAA,GAAgB;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,EAAE;AACtB,MAAA;AACF;AAEA,IAAA,IAAI,IAAI,CAACJ,IAAI,CAACK,IAAI,KAAK,QAAA,EAAU;AAC/B,MAAA,IAAI,CAACC,gB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AC,CAAA,EAAGF,YAAA,CAAA,KACvBD,aAAA,CAAcG,KAAK,CAACF,YAAA,GAAe,CAAA,CAAA,CACvC;AACH;AAEA,IAAA,IAAI,IAAI,CAACd,IAAI,CAACY,aAAa,EAAE;AAC3B,MAAA,IAAI,CAACZ,IAAI,CAACY,aAAa,CAACF,QAAA,CAAA;AAC1B,KAAA,MAAO;MACL,IAAI,CAACR,uBAAuB,GAAGQ,QAAA;AACjC;GACF;AACF;;;;"}
@@ -1 +1 @@
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;;;;"}
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,CAAA,+KAAA,EAQL;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,CAAA,gGAAA,EAIL;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAG,YAAA,EAAA,CAAA;MAEGE,MAiCR,GAAAP,oBAAA,CAAAC,kBAAA,CAAA,kYAAA,EAkBL;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAK,aAAA;IAAAC,IAAA;IAAAH,KAAA;AAAAP,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAM,YAAA,EAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.js","sources":["../../src/components/dialog.gts"],"sourcesContent":["import Component from \"@glimmer/component\";\nimport { tracked } from \"@glimmer/tracking\";\nimport { assert } from \"@ember/debug\";\nimport { hash } from \"@ember/helper\";\nimport { on } from \"@ember/modifier\";\n\nimport { modifier as eModifier } from \"ember-modifier\";\n// temp\n// https://github.com/tracked-tools/tracked-toolbox/issues/38\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-expect-error\nimport { localCopy } from \"tracked-toolbox\";\n\nimport type { TOC } from \"@ember/component/template-only\";\nimport type { ModifierLike, WithBoundArgs } from \"@glint/template\";\n\nconst DialogElement: TOC<{\n Element: HTMLDialogElement;\n Args: {\n /**\n * @internal\n */\n open: boolean | undefined;\n /**\n * @internal\n */\n onClose: () => void;\n\n /**\n * @internal\n */\n register: ModifierLike<{ Element: HTMLDialogElement }>;\n };\n Blocks: { default: [] };\n}> = <template>\n <dialog ...attributes open={{@open}} {{on \"close\" @onClose}} {{@register}}>\n {{yield}}\n </dialog>\n</template>;\n\nexport interface Signature {\n Args: {\n /**\n * Optionally set the open state of the `<dialog>`\n * The state will still be managed internally,\n * so this does not need to be a maintained value, but whenever it changes,\n * the dialog element will reflect that change accordingly.\n */\n open?: boolean;\n /**\n * When the `<dialog>` is closed, this function will be called\n * and the `<dialog>`'s `returnValue` will be passed.\n *\n * This can be used to determine which button was clicked to close the modal\n *\n * Note though that this value is only populated when using\n * `<form method='dialog'>`\n */\n onClose?: (returnValue: string) => void;\n };\n Blocks: {\n default: [\n {\n /**\n * Represents the open state of the `<dialog>` element.\n */\n isOpen: boolean;\n\n /**\n * Closes the `<dialog>` element\n * Will throw an error if `Dialog` is not rendered.\n */\n close: () => void;\n\n /**\n * Opens the `<dialog>` element.\n * Will throw an error if `Dialog` is not rendered.\n */\n open: () => void;\n\n /**\n * This modifier should be applied to the button that opens the Dialog so that it can be re-focused when the dialog closes.\n *\n * Example:\n *\n * ```gjs\n * <template>\n * <Modal as |m|>\n * <button {{m.focusOnClose}} {{on \"click\" m.open}}>Open</button>\n *\n * <m.Dialog>...</m.Dialog>\n * </Modal>\n * </template>\n * ```\n */\n focusOnClose: ModifierLike<{ Element: HTMLElement }>;\n\n /**\n * This is the `<dialog>` element (with some defaults pre-wired).\n * This is required to be rendered.\n */\n Dialog: WithBoundArgs<typeof DialogElement, \"onClose\" | \"register\" | \"open\">;\n },\n ];\n };\n}\n\nclass ModalDialog extends Component<Signature> {\n <template>\n {{yield\n (hash\n isOpen=this.isOpen\n open=this.open\n close=this.close\n focusOnClose=this.refocus\n Dialog=(component DialogElement open=@open onClose=this.handleClose register=this.register)\n )\n }}\n </template>\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n @localCopy(\"args.open\") declare _isOpen: boolean;\n\n get isOpen() {\n /**\n * Always fallback to false (closed)\n */\n return this._isOpen ?? false;\n }\n set isOpen(val: boolean) {\n this._isOpen = val;\n }\n\n #lastIsOpen = false;\n refocus = eModifier((element) => {\n assert(`focusOnClose is only valid on a HTMLElement`, element instanceof HTMLElement);\n\n if (!this.isOpen && this.#lastIsOpen) {\n element.focus();\n }\n\n this.#lastIsOpen = this.isOpen;\n });\n\n @tracked declare dialogElement: HTMLDialogElement | undefined;\n\n register = eModifier((element: HTMLDialogElement) => {\n /**\n * This is very sad.\n *\n * But we need the element to be 'root state'\n * so that when we read things like \"isOpen\",\n * when the dialog is finally rendered, all the\n * downstream properties render.\n *\n * This has to be an async / delayed a bit, so that\n * the tracking frame can exit, and we don't infinite loop\n */\n void (async () => {\n await Promise.resolve();\n\n this.dialogElement = element;\n })();\n });\n\n /**\n * Closes the dialog -- this will throw an error in development if the dialog element was not rendered\n */\n close = () => {\n assert(\n \"Cannot call `close` on <Dialog> without rendering the dialog element.\",\n this.dialogElement,\n );\n\n /**\n * If the element is already closed, don't run all this again\n */\n if (!this.dialogElement.hasAttribute(\"open\")) {\n return;\n }\n\n /**\n * removes the `open` attribute\n * handleClose will be called because the dialog has bound the `close` event.\n */\n this.dialogElement.close();\n };\n\n /**\n * @internal\n *\n * handles the <dialog> element's native close behavior.\n * listened to via addEventListener('close', ...);\n */\n handleClose = () => {\n assert(\n \"Cannot call `handleDialogClose` on <Dialog> without rendering the dialog element. This is likely a bug in ember-primitives. Please open an issue <3\",\n this.dialogElement,\n );\n\n this.isOpen = false;\n this.args.onClose?.(this.dialogElement.returnValue);\n // the return value ends up staying... which is annoying\n this.dialogElement.returnValue = \"\";\n };\n\n /**\n * Opens the dialog -- this will throw an error in development if the dialog element was not rendered\n */\n open = () => {\n assert(\n \"Cannot call `open` on <Dialog> without rendering the dialog element.\",\n this.dialogElement,\n );\n\n /**\n * If the element is already open, don't run all this again\n */\n if (this.dialogElement.hasAttribute(\"open\")) {\n return;\n }\n\n /**\n * adds the `open` attribute\n */\n this.dialogElement.showModal();\n this.isOpen = true;\n };\n}\n\nexport const Modal = ModalDialog;\nexport const Dialog = ModalDialog;\n\nexport default ModalDialog;\n"],"names":["DialogElement","setComponentTemplate","precompileTemplate","strictMode","scope","on","templateOnly","ModalDialog","Component","hash","g","prototype","localCopy","i","void 0","isOpen","_isOpen","val","refocus","eModifier","element","assert","HTMLElement","focus","tracked","register","Promise","resolve","dialogElement","close","hasAttribute","handleClose","args","onClose","returnValue","open","showModal","Modal","Dialog"],"mappings":";;;;;;;;;;;;AAgBA,MAAMA,aAkBD,GAAAC,oBAAA,CAAAC,kBAAA,CAIL,iHAAA,EAAA;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA,CAAA;AAqEV,MAAMC,oBAAoBC,SAAU,CAAA;AAClC,EAAA;IAAAP,oBAAA,CAAAC,kBAAA,CAUA,qMAAA,EAAA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAK,IAAA;AAAAT,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AAEV;AAAA,EAAA;AAAAU,IAAAA,CAAA,MAAAC,SAAA,EAAA,SAAA,EAAA,CACCC,SAAU,CAAA,WAAA,CAAA,CAAA,CAAA;AAAA;AAAA,EAAA,QAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,SAAA,CAAA,EAAAC,MAAA;EAEX,IAAIC,MAASA,GAAA;AACX;;AAEC;AACD,IAAA,OAAO,IAAI,CAACC,OAAO,IAAI,KAAA;AACzB;EACA,IAAID,MAAAA,CAAOE,GAAY,EAAE;IACvB,IAAI,CAACD,OAAO,GAAGC,GAAA;AACjB;EAEA,WAAW,GAAG,KAAM;AACpBC,EAAAA,OAAA,GAAUC,SAAWC,OAAA,IAAA;AACnBC,IAAAA,MAAA,CAAO,CAA6C,2CAAA,CAAA,EAAED,O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Aa,CAAA;AAGpB;;AAEC;IACD,IAAI,IAAI,CAACA,aAAa,CAACE,YAAY,CAAC,MAAS,CAAA,EAAA;AAC3C,MAAA;AACF;AAEA;;AAEC;AACD,IAAA,IAAI,CAACF,aAAa,CAACQ,SAAS,EAAA;IAC5B,IAAI,CAACrB,MAAM,GAAG,IAAA;GACd;AACJ;AAEO,MAAMsB,QAAQ9B;AACd,MAAM+B,SAAS/B;;;;"}
1
+ {"version":3,"file":"dialog.js","sources":["../../src/components/dialog.gts"],"sourcesContent":["import Component from \"@glimmer/component\";\nimport { tracked } from \"@glimmer/tracking\";\nimport { assert } from \"@ember/debug\";\nimport { hash } from \"@ember/helper\";\nimport { on } from \"@ember/modifier\";\n\nimport { modifier as eModifier } from \"ember-modifier\";\n// temp\n// https://github.com/tracked-tools/tracked-toolbox/issues/38\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-expect-error\nimport { localCopy } from \"tracked-toolbox\";\n\nimport type { TOC } from \"@ember/component/template-only\";\nimport type { ModifierLike, WithBoundArgs } from \"@glint/template\";\n\nconst DialogElement: TOC<{\n Element: HTMLDialogElement;\n Args: {\n /**\n * @internal\n */\n open: boolean | undefined;\n /**\n * @internal\n */\n onClose: () => void;\n\n /**\n * @internal\n */\n register: ModifierLike<{ Element: HTMLDialogElement }>;\n };\n Blocks: { default: [] };\n}> = <template>\n <dialog ...attributes open={{@open}} {{on \"close\" @onClose}} {{@register}}>\n {{yield}}\n </dialog>\n</template>;\n\nexport interface Signature {\n Args: {\n /**\n * Optionally set the open state of the `<dialog>`\n * The state will still be managed internally,\n * so this does not need to be a maintained value, but whenever it changes,\n * the dialog element will reflect that change accordingly.\n */\n open?: boolean;\n /**\n * When the `<dialog>` is closed, this function will be called\n * and the `<dialog>`'s `returnValue` will be passed.\n *\n * This can be used to determine which button was clicked to close the modal\n *\n * Note though that this value is only populated when using\n * `<form method='dialog'>`\n */\n onClose?: (returnValue: string) => void;\n };\n Blocks: {\n default: [\n {\n /**\n * Represents the open state of the `<dialog>` element.\n */\n isOpen: boolean;\n\n /**\n * Closes the `<dialog>` element\n * Will throw an error if `Dialog` is not rendered.\n */\n close: () => void;\n\n /**\n * Opens the `<dialog>` element.\n * Will throw an error if `Dialog` is not rendered.\n */\n open: () => void;\n\n /**\n * This modifier should be applied to the button that opens the Dialog so that it can be re-focused when the dialog closes.\n *\n * Example:\n *\n * ```gjs\n * <template>\n * <Modal as |m|>\n * <button {{m.focusOnClose}} {{on \"click\" m.open}}>Open</button>\n *\n * <m.Dialog>...</m.Dialog>\n * </Modal>\n * </template>\n * ```\n */\n focusOnClose: ModifierLike<{ Element: HTMLElement }>;\n\n /**\n * This is the `<dialog>` element (with some defaults pre-wired).\n * This is required to be rendered.\n */\n Dialog: WithBoundArgs<typeof DialogElement, \"onClose\" | \"register\" | \"open\">;\n },\n ];\n };\n}\n\nclass ModalDialog extends Component<Signature> {\n <template>\n {{yield\n (hash\n isOpen=this.isOpen\n open=this.open\n close=this.close\n focusOnClose=this.refocus\n Dialog=(component DialogElement open=@open onClose=this.handleClose register=this.register)\n )\n }}\n </template>\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n @localCopy(\"args.open\") declare _isOpen: boolean;\n\n get isOpen() {\n /**\n * Always fallback to false (closed)\n */\n return this._isOpen ?? false;\n }\n set isOpen(val: boolean) {\n this._isOpen = val;\n }\n\n #lastIsOpen = false;\n refocus = eModifier((element) => {\n assert(`focusOnClose is only valid on a HTMLElement`, element instanceof HTMLElement);\n\n if (!this.isOpen && this.#lastIsOpen) {\n element.focus();\n }\n\n this.#lastIsOpen = this.isOpen;\n });\n\n @tracked declare dialogElement: HTMLDialogElement | undefined;\n\n register = eModifier((element: HTMLDialogElement) => {\n /**\n * This is very sad.\n *\n * But we need the element to be 'root state'\n * so that when we read things like \"isOpen\",\n * when the dialog is finally rendered, all the\n * downstream properties render.\n *\n * This has to be an async / delayed a bit, so that\n * the tracking frame can exit, and we don't infinite loop\n */\n void (async () => {\n await Promise.resolve();\n\n this.dialogElement = element;\n })();\n });\n\n /**\n * Closes the dialog -- this will throw an error in development if the dialog element was not rendered\n */\n close = () => {\n assert(\n \"Cannot call `close` on <Dialog> without rendering the dialog element.\",\n this.dialogElement,\n );\n\n /**\n * If the element is already closed, don't run all this again\n */\n if (!this.dialogElement.hasAttribute(\"open\")) {\n return;\n }\n\n /**\n * removes the `open` attribute\n * handleClose will be called because the dialog has bound the `close` event.\n */\n this.dialogElement.close();\n };\n\n /**\n * @internal\n *\n * handles the <dialog> element's native close behavior.\n * listened to via addEventListener('close', ...);\n */\n handleClose = () => {\n assert(\n \"Cannot call `handleDialogClose` on <Dialog> without rendering the dialog element. This is likely a bug in ember-primitives. Please open an issue <3\",\n this.dialogElement,\n );\n\n this.isOpen = false;\n this.args.onClose?.(this.dialogElement.returnValue);\n // the return value ends up staying... which is annoying\n this.dialogElement.returnValue = \"\";\n };\n\n /**\n * Opens the dialog -- this will throw an error in development if the dialog element was not rendered\n */\n open = () => {\n assert(\n \"Cannot call `open` on <Dialog> without rendering the dialog element.\",\n this.dialogElement,\n );\n\n /**\n * If the element is already open, don't run all this again\n */\n if (this.dialogElement.hasAttribute(\"open\")) {\n return;\n }\n\n /**\n * adds the `open` attribute\n */\n this.dialogElement.showModal();\n this.isOpen = true;\n };\n}\n\nexport const Modal = ModalDialog;\nexport const Dialog = ModalDialog;\n\nexport default ModalDialog;\n"],"names":["DialogElement","setComponentTemplate","precompileTemplate","strictMode","scope","on","templateOnly","ModalDialog","Component","hash","g","prototype","localCopy","i","void 0","isOpen","_isOpen","val","refocus","eModifier","element","assert","HTMLElement","focus","tracked","register","Promise","resolve","dialogElement","close","hasAttribute","handleClose","args","onClose","returnValue","open","showModal","Modal","Dialog"],"mappings":";;;;;;;;;;;;AAgBA,MAAMA,aAkBD,GAAAC,oBAAA,CAAAC,kBAAA,CAAA,iHAAA,EAIL;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IA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