ember-primitives 0.44.0 → 0.45.1

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 (97) hide show
  1. package/declarations/components/heading.d.ts.map +1 -1
  2. package/declarations/components/one-time-password.d.ts +3 -0
  3. package/declarations/components/one-time-password.d.ts.map +1 -0
  4. package/declarations/components/shadowed.d.ts +33 -3
  5. package/declarations/components/shadowed.d.ts.map +1 -1
  6. package/declarations/index.d.ts +1 -1
  7. package/declarations/index.d.ts.map +1 -1
  8. package/declarations/test-support/dom.d.ts +14 -0
  9. package/declarations/test-support/dom.d.ts.map +1 -0
  10. package/declarations/test-support.d.ts +7 -0
  11. package/declarations/test-support.d.ts.map +1 -0
  12. package/dist/{floating-ui/modifier.js → component-Bs3N-G9z.js} +72 -4
  13. package/dist/component-Bs3N-G9z.js.map +1 -0
  14. package/dist/components/accordion.js +60 -1
  15. package/dist/components/heading.js +74 -7
  16. package/dist/components/one-time-password.js +3 -0
  17. package/dist/components/one-time-password.js.map +1 -0
  18. package/dist/components/popover.js +1 -2
  19. package/dist/components/rating.js +1 -1
  20. package/dist/components/shadowed.js +47 -35
  21. package/dist/components/switch.js +8 -2
  22. package/dist/components/toggle.js +1 -1
  23. package/dist/components/zoetrope.js +1 -1
  24. package/dist/floating-ui.js +1 -2
  25. package/dist/index-D052JWRa.js +149 -0
  26. package/dist/index-D052JWRa.js.map +1 -0
  27. package/dist/{components/zoetrope/index.js → index-DKE67I8L.js} +3 -3
  28. package/dist/index-DKE67I8L.js.map +1 -0
  29. package/dist/index.js +3 -4
  30. package/dist/otp-C6hCCXKx.js +291 -0
  31. package/dist/otp-C6hCCXKx.js.map +1 -0
  32. package/dist/test-support.js +255 -0
  33. package/dist/test-support.js.map +1 -0
  34. package/dist/{components/-private/utils.js → utils-C5796IKA.js} +2 -2
  35. package/dist/utils-C5796IKA.js.map +1 -0
  36. package/package.json +1 -9
  37. package/declarations/components/one-time-password/index.d.ts +0 -3
  38. package/declarations/components/one-time-password/index.d.ts.map +0 -1
  39. package/declarations/test-support/index.d.ts +0 -6
  40. package/declarations/test-support/index.d.ts.map +0 -1
  41. package/dist/components/-private/typed-elements.js +0 -14
  42. package/dist/components/-private/typed-elements.js.map +0 -1
  43. package/dist/components/-private/utils.js.map +0 -1
  44. package/dist/components/accordion/content.js +0 -6
  45. package/dist/components/accordion/content.js.map +0 -1
  46. package/dist/components/accordion/header.js +0 -7
  47. package/dist/components/accordion/header.js.map +0 -1
  48. package/dist/components/accordion/item.js +0 -7
  49. package/dist/components/accordion/item.js.map +0 -1
  50. package/dist/components/accordion/public.js +0 -2
  51. package/dist/components/accordion/public.js.map +0 -1
  52. package/dist/components/accordion/trigger.js +0 -7
  53. package/dist/components/accordion/trigger.js.map +0 -1
  54. package/dist/components/one-time-password/buttons.js +0 -26
  55. package/dist/components/one-time-password/buttons.js.map +0 -1
  56. package/dist/components/one-time-password/index.js +0 -4
  57. package/dist/components/one-time-password/index.js.map +0 -1
  58. package/dist/components/one-time-password/input.js +0 -90
  59. package/dist/components/one-time-password/input.js.map +0 -1
  60. package/dist/components/one-time-password/otp.js +0 -58
  61. package/dist/components/one-time-password/otp.js.map +0 -1
  62. package/dist/components/one-time-password/utils.js +0 -144
  63. package/dist/components/one-time-password/utils.js.map +0 -1
  64. package/dist/components/rating/index.js +0 -45
  65. package/dist/components/rating/index.js.map +0 -1
  66. package/dist/components/rating/public-types.js +0 -2
  67. package/dist/components/rating/public-types.js.map +0 -1
  68. package/dist/components/rating/range.js +0 -15
  69. package/dist/components/rating/range.js.map +0 -1
  70. package/dist/components/rating/stars.js +0 -19
  71. package/dist/components/rating/stars.js.map +0 -1
  72. package/dist/components/rating/state.js +0 -82
  73. package/dist/components/rating/state.js.map +0 -1
  74. package/dist/components/rating/utils.js +0 -18
  75. package/dist/components/rating/utils.js.map +0 -1
  76. package/dist/components/zoetrope/index.js.map +0 -1
  77. package/dist/components/zoetrope/types.js +0 -2
  78. package/dist/components/zoetrope/types.js.map +0 -1
  79. package/dist/floating-ui/component.js +0 -63
  80. package/dist/floating-ui/component.js.map +0 -1
  81. package/dist/floating-ui/middleware.js +0 -15
  82. package/dist/floating-ui/middleware.js.map +0 -1
  83. package/dist/floating-ui/modifier.js.map +0 -1
  84. package/dist/item-CwIzoqlC.js +0 -68
  85. package/dist/item-CwIzoqlC.js.map +0 -1
  86. package/dist/test-support/a11y.js +0 -24
  87. package/dist/test-support/a11y.js.map +0 -1
  88. package/dist/test-support/index.js +0 -7
  89. package/dist/test-support/index.js.map +0 -1
  90. package/dist/test-support/otp.js +0 -34
  91. package/dist/test-support/otp.js.map +0 -1
  92. package/dist/test-support/rating.js +0 -92
  93. package/dist/test-support/rating.js.map +0 -1
  94. package/dist/test-support/routing.js +0 -54
  95. package/dist/test-support/routing.js.map +0 -1
  96. package/dist/test-support/zoetrope.js +0 -43
  97. package/dist/test-support/zoetrope.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/components/heading.gts"],"names":[],"mappings":"AAmEA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAI3C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAyBtC,qBAAa,OAAQ,SAAQ,SAAS,CAAC;IACrC,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAC;CACzB,CAAC;IACA,kBAAkB,EAAE,IAAI,CAAC;gBACb,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM;IAMtC,IAAI,KAAK,WAWR;IAED,IAAI,MAAM,WAET;CAqBF"}
1
+ {"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../src/components/heading.gts"],"names":[],"mappings":"AAkLA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAK3C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAuItC,qBAAa,OAAQ,SAAQ,SAAS,CAAC;IACrC,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAC;CACzB,CAAC;IACA,kBAAkB,EAAE,IAAI,CAAC;gBACb,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM;IAMtC,IAAI,KAAK,WAWR;IAED,IAAI,MAAM,WAET;CAqBF"}
@@ -0,0 +1,3 @@
1
+ export { OTPInput } from './one-time-password/input';
2
+ export { OTP } from './one-time-password/otp';
3
+ //# sourceMappingURL=one-time-password.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one-time-password.d.ts","sourceRoot":"","sources":["../../src/components/one-time-password.gts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAC"}
@@ -1,4 +1,5 @@
1
- import type { TOC } from "@ember/component/template-only";
1
+ import Component from "@glimmer/component";
2
+ import type Owner from "@ember/owner";
2
3
  /**
3
4
  * Render content in a shadow dom, attached to a div.
4
5
  *
@@ -8,7 +9,7 @@ import type { TOC } from "@ember/component/template-only";
8
9
  *
9
10
  * This is useful when you want to render content that escapes your app's styles.
10
11
  */
11
- export declare const Shadowed: TOC<{
12
+ export declare class Shadowed extends Component<{
12
13
  /**
13
14
  * The shadow dom attaches to a div element.
14
15
  * You may specify any attribute, and it'll be applied to this host element.
@@ -30,6 +31,35 @@ export declare const Shadowed: TOC<{
30
31
  */
31
32
  default: [];
32
33
  };
33
- }>;
34
+ }> {
35
+ shadow: HTMLDivElement;
36
+ host: HTMLDivElement;
37
+ /**
38
+ * ember-source 5.6 broke the ability to in-element
39
+ * natively into a shadowroot.
40
+ *
41
+ * We have two or three more dives than we should have here.
42
+ *
43
+ *
44
+ * See these ember-source bugs:
45
+ * - https://github.com/emberjs/ember.js/issues/20643
46
+ * - https://github.com/emberjs/ember.js/issues/20642
47
+ * - https://github.com/emberjs/ember.js/issues/20641
48
+ *
49
+ * Ideally, shadowdom should be built in.
50
+ * Couple paths forward:
51
+ * - (as the overall template tag)
52
+ * <template shadowrootmode="open">
53
+ * </template>
54
+ *
55
+ * - Build a component into the framework that does the above ^
56
+ * - add additional parsing in content-tag to allow
57
+ * nested <template>
58
+ *
59
+ */
60
+ constructor(owner: Owner, args: {
61
+ includeStyles?: boolean;
62
+ });
63
+ }
34
64
  export default Shadowed;
35
65
  //# sourceMappingURL=shadowed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shadowed.d.ts","sourceRoot":"","sources":["../../src/components/shadowed.gts"],"names":[],"mappings":"AAyGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAqD1D;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,EAAE,GAAG,CAAC;IACzB;;;OAGG;IACH,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE;QACJ;;;;;;WAMG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,MAAM,EAAE;QACN;;WAEG;QACH,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH,CA6BC,CAAC;AAEH,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"shadowed.d.ts","sourceRoot":"","sources":["../../src/components/shadowed.gts"],"names":[],"mappings":"AA8GA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAE3C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AA4BtC;;;;;;;;GAQG;AACH,qBAAa,QAAS,SAAQ,SAAS,CAAC;IACtC;;;OAGG;IACH,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE;QACJ;;;;;;WAMG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;IACF,MAAM,EAAE;QACN;;WAEG;QACH,OAAO,EAAE,EAAE,CAAC;KACb,CAAC;CACH,CAAC;IACA,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB;;;;;;;;;;;;;;;;;;;;;;OAsBG;gBACS,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE;QAAE,aAAa,CAAC,EAAE,OAAO,CAAA;KAAE;CAiC5D;AAED,eAAe,QAAQ,CAAC"}
@@ -8,7 +8,7 @@ export { Key, KeyCombo } from './components/keys';
8
8
  export { StickyFooter } from './components/layout/sticky-footer';
9
9
  export { Link } from './components/link';
10
10
  export { Menu } from './components/menu';
11
- export { OTP, OTPInput } from './components/one-time-password/index';
11
+ export { OTP, OTPInput } from './components/one-time-password';
12
12
  export { Popover } from './components/popover';
13
13
  export { Portal } from './components/portal';
14
14
  export { PortalTargets } from './components/portal-targets';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,YAAY,EACV,iCAAiC,EACjC,gCAAgC,EAChC,8BAA8B,EAC9B,iCAAiC,GAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,YAAY,EACV,iCAAiC,EACjC,gCAAgC,EAChC,8BAA8B,EAC9B,iCAAiC,GAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,cAAc,cAAc,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { find } from '@ember/test-helpers';
2
+ type Findable = Parameters<typeof find>[0] | Element;
3
+ /**
4
+ * Find an element within a shadow-root.
5
+ */
6
+ export declare function findInShadow(root: Findable, query: string): Element | null | undefined;
7
+ /**
8
+ * Does the element have a shadow root?
9
+ */
10
+ export declare function hasShadowRoot(el: Element): boolean;
11
+ export declare function findShadow(root?: Findable): Element | undefined;
12
+ export declare function findInFirstShadow(query: string): Element | null | undefined;
13
+ export {};
14
+ //# sourceMappingURL=dom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../src/test-support/dom.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,KAAK,QAAQ,GAAG,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;AAErD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,8BAIzD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,OAAO,WAExC;AAED,wBAAgB,UAAU,CAAC,IAAI,CAAC,EAAE,QAAQ,uBAczC;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,8BAM9C"}
@@ -0,0 +1,7 @@
1
+ export { setupTabster } from "./test-support/a11y.ts";
2
+ export { findInFirstShadow, findInShadow, findShadow, hasShadowRoot } from "./test-support/dom.ts";
3
+ export { fillOTP } from "./test-support/otp.ts";
4
+ export { rating } from "./test-support/rating.ts";
5
+ export { getRouter, setupRouting } from "./test-support/routing.ts";
6
+ export { ZoetropeHelper } from "./test-support/zoetrope.ts";
7
+ //# sourceMappingURL=test-support.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-support.d.ts","sourceRoot":"","sources":["../src/test-support.gts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACnG,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC"}
@@ -1,8 +1,25 @@
1
1
 
2
+ import Component from '@glimmer/component';
3
+ import { tracked } from '@glimmer/tracking';
4
+ import { hash } from '@ember/helper';
5
+ import { modifier } from 'ember-modifier';
2
6
  import { assert } from '@ember/debug';
3
7
  import { autoUpdate, computePosition, offset, flip, shift, hide } from '@floating-ui/dom';
4
- import { modifier } from 'ember-modifier';
5
- import { exposeMetadata } from './middleware.js';
8
+ import { precompileTemplate } from '@ember/template-compilation';
9
+ import { setComponentTemplate } from '@ember/component';
10
+ import { g, i } from 'decorator-transforms/runtime';
11
+
12
+ function exposeMetadata() {
13
+ return {
14
+ name: 'metadata',
15
+ fn: data => {
16
+ // https://floating-ui.com/docs/middleware#always-return-an-object
17
+ return {
18
+ data
19
+ };
20
+ }
21
+ };
22
+ }
6
23
 
7
24
  /**
8
25
  * A modifier to apply to the _floating_ element.
@@ -75,5 +92,56 @@ const anchorTo = modifier((floatingElement, [_referenceElement], {
75
92
  return cleanup;
76
93
  });
77
94
 
78
- export { anchorTo };
79
- //# sourceMappingURL=modifier.js.map
95
+ const ref = modifier((element, positional) => {
96
+ const fn = positional[0];
97
+ fn(element);
98
+ });
99
+ /**
100
+ * A component that provides no DOM and yields two modifiers for creating
101
+ * creating floating uis, such as menus, popovers, tooltips, etc.
102
+ * This component currently uses [Floating UI](https://floating-ui.com/)
103
+ * but will be switching to [CSS Anchor Positioning](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_anchor_positioning) when that lands.
104
+ *
105
+ * Example usage:
106
+ * ```gjs
107
+ * import { FloatingUI } from 'ember-primitives/floating-ui';
108
+ *
109
+ * <template>
110
+ * <FloatingUI as |reference floating|>
111
+ * <button {{reference}}> ... </button>
112
+ * <menu {{floating}}> ... </menu>
113
+ * </FloatingUI>
114
+ * </template>
115
+ * ```
116
+ */
117
+ class FloatingUI extends Component {
118
+ static {
119
+ g(this.prototype, "reference", [tracked], function () {
120
+ return undefined;
121
+ });
122
+ }
123
+ #reference = (i(this, "reference"), void 0);
124
+ static {
125
+ g(this.prototype, "data", [tracked], function () {
126
+ return undefined;
127
+ });
128
+ }
129
+ #data = (i(this, "data"), void 0);
130
+ setData = data => this.data = data;
131
+ setReference = element => {
132
+ this.reference = element;
133
+ };
134
+ static {
135
+ setComponentTemplate(precompileTemplate("\n {{#let (modifier anchorTo flipOptions=@flipOptions hideOptions=@hideOptions middleware=@middleware offsetOptions=@offsetOptions placement=@placement shiftOptions=@shiftOptions strategy=@strategy setData=this.setData) as |prewiredAnchorTo|}}\n {{#let (if this.reference (modifier prewiredAnchorTo this.reference)) as |floating|}}\n {{!-- @glint-nocheck -- Excessively deep, possibly infinite --}}\n {{yield (modifier ref this.setReference) floating (hash setReference=this.setReference data=this.data)}}\n {{/let}}\n {{/let}}\n ", {
136
+ strictMode: true,
137
+ scope: () => ({
138
+ anchorTo,
139
+ ref,
140
+ hash
141
+ })
142
+ }), this);
143
+ }
144
+ }
145
+
146
+ export { FloatingUI as F, anchorTo as a };
147
+ //# sourceMappingURL=component-Bs3N-G9z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-Bs3N-G9z.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -3,11 +3,70 @@ import Component from '@glimmer/component';
3
3
  import { assert } from '@ember/debug';
4
4
  import { hash } from '@ember/helper';
5
5
  import { localCopy } from 'tracked-toolbox';
6
- import { A as AccordionItem } from '../item-CwIzoqlC.js';
7
6
  import { precompileTemplate } from '@ember/template-compilation';
8
7
  import { setComponentTemplate } from '@ember/component';
8
+ import { on } from '@ember/modifier';
9
+ import templateOnly from '@ember/component/template-only';
9
10
  import { g, i } from 'decorator-transforms/runtime';
10
11
 
12
+ class AccordionContent extends Component {
13
+ static {
14
+ setComponentTemplate(precompileTemplate("\n <div role=\"region\" id={{@value}} data-state={{getDataState @isExpanded}} hidden={{this.isHidden}} data-disabled={{@disabled}} ...attributes>\n {{yield}}\n </div>\n ", {
15
+ strictMode: true,
16
+ scope: () => ({
17
+ getDataState
18
+ })
19
+ }), this);
20
+ }
21
+ get isHidden() {
22
+ return !this.args.isExpanded;
23
+ }
24
+ }
25
+
26
+ const AccordionTrigger = setComponentTemplate(precompileTemplate("\n <button type=\"button\" aria-controls={{@value}} aria-expanded={{@isExpanded}} data-state={{getDataState @isExpanded}} data-disabled={{@disabled}} aria-disabled={{if @disabled \"true\" \"false\"}} {{on \"click\" @toggleItem}} ...attributes>\n {{yield}}\n </button>\n", {
27
+ strictMode: true,
28
+ scope: () => ({
29
+ getDataState,
30
+ on
31
+ })
32
+ }), templateOnly());
33
+
34
+ const AccordionHeader = setComponentTemplate(precompileTemplate("\n <div role=\"heading\" aria-level=\"3\" data-state={{getDataState @isExpanded}} data-disabled={{@disabled}} ...attributes>\n {{yield (hash Trigger=(component Trigger value=@value isExpanded=@isExpanded disabled=@disabled toggleItem=@toggleItem))}}\n </div>\n", {
35
+ strictMode: true,
36
+ scope: () => ({
37
+ getDataState,
38
+ hash,
39
+ Trigger: AccordionTrigger
40
+ })
41
+ }), templateOnly());
42
+
43
+ function getDataState(isExpanded) {
44
+ return isExpanded ? "open" : "closed";
45
+ }
46
+ class AccordionItem extends Component {
47
+ static {
48
+ setComponentTemplate(precompileTemplate("\n <div data-state={{getDataState this.isExpanded}} data-disabled={{@disabled}} ...attributes>\n {{yield (hash isExpanded=this.isExpanded Header=(component Header value=@value isExpanded=this.isExpanded disabled=@disabled toggleItem=this.toggleItem) Content=(component Content value=@value isExpanded=this.isExpanded disabled=@disabled))}}\n </div>\n ", {
49
+ strictMode: true,
50
+ scope: () => ({
51
+ getDataState,
52
+ hash,
53
+ Header: AccordionHeader,
54
+ Content: AccordionContent
55
+ })
56
+ }), this);
57
+ }
58
+ get isExpanded() {
59
+ if (Array.isArray(this.args.selectedValue)) {
60
+ return this.args.selectedValue.includes(this.args.value);
61
+ }
62
+ return this.args.selectedValue === this.args.value;
63
+ }
64
+ toggleItem = () => {
65
+ if (this.args.disabled) return;
66
+ this.args.toggleItem(this.args.value);
67
+ };
68
+ }
69
+
11
70
  class Accordion extends Component {
12
71
  static {
13
72
  setComponentTemplate(precompileTemplate("\n <div data-disabled={{@disabled}} ...attributes>\n {{yield (hash Item=(component AccordionItem selectedValue=this.selectedValue toggleItem=this.toggleItem disabled=@disabled))}}\n </div>\n ", {
@@ -1,25 +1,92 @@
1
1
 
2
2
  import Component from '@glimmer/component';
3
+ import { assert } from '@ember/debug';
3
4
  import { element } from 'ember-element-helper';
4
5
  import { precompileTemplate } from '@ember/template-compilation';
5
6
  import { setComponentTemplate } from '@ember/component';
6
7
 
7
8
  const LOOKUP = new WeakMap();
8
- function levelOf(node) {
9
+ const BOUNDARY_ELEMENTS = new Set(["SECTION", "ARTICLE", "ASIDE", "HEADER", "FOOTER", "MAIN", "NAV"]);
10
+ /**
11
+ * A set with both cases is more performant than calling toLowerCase
12
+ */
13
+ const SECTION_HEADINGS = new Set(["h1", "h2", "h3", "h4", "h5", "h6", "H1", "H2", "H3", "H4", "H5", "H6"]);
14
+ const TEST_BOUNDARY = "ember-testing";
15
+ function isRoot(element) {
16
+ return element === document.body || element.id === TEST_BOUNDARY;
17
+ }
18
+ function findHeadingIn(node) {
19
+ if (!(node instanceof Element)) return;
20
+ if (SECTION_HEADINGS.has(node.tagName)) {
21
+ const level = parseInt(node.tagName.replace("h", "").replace("H", ""));
22
+ return level;
23
+ }
24
+ for (const child of node.children) {
25
+ const level = findHeadingIn(child);
26
+ if (level) return level;
27
+ }
28
+ }
29
+ /**
30
+ * The Platform native 'closest' function can't punch through shadow-boundaries
31
+ */
32
+ function nearestAncestor(node, matcher) {
9
33
  let parent = node.parentElement;
10
- let level = 0;
34
+ if (!parent) return;
11
35
  while (parent) {
12
36
  if (parent instanceof Element) {
13
- if (parent.tagName.toLowerCase() === "section") {
14
- level++;
15
- }
37
+ if (matcher(parent)) return parent;
16
38
  }
17
39
  if (parent instanceof ShadowRoot) {
18
40
  parent = parent.host;
19
41
  }
20
42
  parent = parent.parentNode;
21
43
  }
22
- return level;
44
+ }
45
+ /**
46
+ * The algorithm:
47
+ *
48
+ * section <- "our" level-changing boundary element
49
+ * h# <- the element we want to figure out the level of
50
+ *
51
+ * We start assuming we'll emit an h1.
52
+ * We adjust this based on what we find crawling up the tree.
53
+ *
54
+ * While traversing up, when we go from the h# to the section,
55
+ * and ignore it. Because this alone has no bearing on if the h# should be an h2.
56
+ * We need to continue traversing upwards, until we hit the next boundary element.
57
+ *
58
+ * IF we would change the level the heading, we will find another heading between
59
+ * these two boundary elements.
60
+ * We'll need to check the subtrees between these elements, stopping if we
61
+ * encounter other boundary elements.
62
+ *
63
+ */
64
+ function levelOf(node) {
65
+ const ourBoundary = nearestAncestor(node, el => BOUNDARY_ELEMENTS.has(el.tagName));
66
+ /**
67
+ * We are the top-level
68
+ */
69
+ if (!ourBoundary) {
70
+ return 1;
71
+ }
72
+ const stopAt = nearestAncestor(ourBoundary, el => {
73
+ if (BOUNDARY_ELEMENTS.has(el.tagName)) return true;
74
+ return isRoot(el);
75
+ });
76
+ assert(`[BUG]: Could not find a stopping boundary for automatic heading level detection. Checked for ${[...BOUNDARY_ELEMENTS, "body", "#ember-testing"].map(x => x.toLowerCase()).join(", ")}`, stopAt);
77
+ let current = ourBoundary.parentNode;
78
+ while (current) {
79
+ const level = findHeadingIn(current);
80
+ if (level) {
81
+ return level + 1;
82
+ }
83
+ if (current === stopAt) break;
84
+ if (current instanceof ShadowRoot) {
85
+ current = current.host;
86
+ }
87
+ current = current.parentNode;
88
+ }
89
+ return 1;
23
90
  }
24
91
  class Heading extends Component {
25
92
  headingScopeAnchor;
@@ -31,7 +98,7 @@ class Heading extends Component {
31
98
  const existing = LOOKUP.get(this.headingScopeAnchor);
32
99
  if (existing) return existing;
33
100
  const parentLevel = levelOf(this.headingScopeAnchor);
34
- const myLevel = parentLevel + 1;
101
+ const myLevel = parentLevel;
35
102
  LOOKUP.set(this.headingScopeAnchor, myLevel);
36
103
  return myLevel;
37
104
  }
@@ -0,0 +1,3 @@
1
+
2
+ export { a as OTP, O as OTPInput } from '../otp-C6hCCXKx.js';
3
+ //# sourceMappingURL=one-time-password.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one-time-password.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -4,8 +4,7 @@ import { arrow } from '@floating-ui/dom';
4
4
  import { element } from 'ember-element-helper';
5
5
  import { modifier } from 'ember-modifier';
6
6
  import { cell } from 'ember-resources';
7
- import { FloatingUI } from '../floating-ui/component.js';
8
- import '../floating-ui/modifier.js';
7
+ import { F as FloatingUI } from '../component-Bs3N-G9z.js';
9
8
  import { Portal } from './portal.js';
10
9
  import { TARGETS } from './portal-targets.js';
11
10
  import { precompileTemplate } from '@ember/template-compilation';
@@ -1,3 +1,3 @@
1
1
 
2
- export { Rating } from './rating/index.js';
2
+ export { R as Rating } from '../index-D052JWRa.js';
3
3
  //# sourceMappingURL=rating.js.map
@@ -1,36 +1,9 @@
1
1
 
2
- import { modifier } from 'ember-modifier';
3
- import { cell } from 'ember-resources';
2
+ import Component from '@glimmer/component';
4
3
  import { precompileTemplate } from '@ember/template-compilation';
5
4
  import { setComponentTemplate } from '@ember/component';
6
5
  import templateOnly from '@ember/component/template-only';
7
6
 
8
- const Shadow = () => {
9
- const shadow = cell();
10
- return {
11
- get root() {
12
- return shadow.current;
13
- },
14
- attach: modifier(element => {
15
- const shadowRoot = element.attachShadow({
16
- mode: "open"
17
- });
18
- const div = document.createElement("div");
19
- // ember-source 5.6 broke the ability to in-element
20
- // natively into a shadowroot.
21
- //
22
- // See these ember-source bugs:
23
- // - https://github.com/emberjs/ember.js/issues/20643
24
- // - https://github.com/emberjs/ember.js/issues/20642
25
- // - https://github.com/emberjs/ember.js/issues/20641
26
- shadowRoot.appendChild(div);
27
- shadow.set(div);
28
- })
29
- };
30
- };
31
- // index.html has the production-fingerprinted references to these links
32
- // Ideally, we'd have some pre-processor scan everything for references to
33
- // assets in public, but idk how to set that up
34
7
  const getStyles = () => [...document.querySelectorAll("link")].map(link => link.href);
35
8
  /**
36
9
  * style + native @import
@@ -53,13 +26,52 @@ const Styles = setComponentTemplate(precompileTemplate("\n <style>\n {{#each
53
26
  *
54
27
  * This is useful when you want to render content that escapes your app's styles.
55
28
  */
56
- const Shadowed = setComponentTemplate(precompileTemplate("\n {{#let (Shadow) as |shadow|}}\n {{!-- TODO: We need a way in ember to render in to a shadow dom without an effect --}}\n <div {{shadow.attach}} ...attributes></div>\n\n {{#if shadow.root}}\n {{#in-element shadow.root}}\n\n {{#if @includeStyles}}\n <Styles />\n {{/if}}\n\n {{yield}}\n\n {{/in-element}}\n {{/if}}\n {{/let}}\n", {
57
- strictMode: true,
58
- scope: () => ({
59
- Shadow,
60
- Styles
61
- })
62
- }), templateOnly());
29
+ class Shadowed extends Component {
30
+ shadow;
31
+ host;
32
+ /**
33
+ * ember-source 5.6 broke the ability to in-element
34
+ * natively into a shadowroot.
35
+ *
36
+ * We have two or three more dives than we should have here.
37
+ *
38
+ *
39
+ * See these ember-source bugs:
40
+ * - https://github.com/emberjs/ember.js/issues/20643
41
+ * - https://github.com/emberjs/ember.js/issues/20642
42
+ * - https://github.com/emberjs/ember.js/issues/20641
43
+ *
44
+ * Ideally, shadowdom should be built in.
45
+ * Couple paths forward:
46
+ * - (as the overall template tag)
47
+ * <template shadowrootmode="open">
48
+ * </template>
49
+ *
50
+ * - Build a component into the framework that does the above ^
51
+ * - add additional parsing in content-tag to allow
52
+ * nested <template>
53
+ *
54
+ */
55
+ constructor(owner, args) {
56
+ super(owner, args);
57
+ const element = document.createElement("div");
58
+ const shadowRoot = element.attachShadow({
59
+ mode: "open"
60
+ });
61
+ const div = document.createElement("div");
62
+ shadowRoot.appendChild(div);
63
+ this.host = element;
64
+ this.shadow = div;
65
+ }
66
+ static {
67
+ setComponentTemplate(precompileTemplate("\n <div ...attributes>{{this.host}}</div>\n\n {{#in-element this.shadow}}\n\n {{#if @includeStyles}}\n <Styles />\n {{/if}}\n\n {{yield}}\n\n {{/in-element}}\n ", {
68
+ strictMode: true,
69
+ scope: () => ({
70
+ Styles
71
+ })
72
+ }), this);
73
+ }
74
+ }
63
75
 
64
76
  export { Shadowed, Shadowed as default };
65
77
  //# sourceMappingURL=shadowed.js.map
@@ -3,11 +3,17 @@ import { fn, hash } from '@ember/helper';
3
3
  import { on } from '@ember/modifier';
4
4
  import { cell } from 'ember-resources';
5
5
  import { uniqueId } from '../utils.js';
6
- import { Label } from './-private/typed-elements.js';
7
- import { toggleWithFallback } from './-private/utils.js';
8
6
  import { precompileTemplate } from '@ember/template-compilation';
9
7
  import { setComponentTemplate } from '@ember/component';
10
8
  import templateOnly from '@ember/component/template-only';
9
+ import { t as toggleWithFallback } from '../utils-C5796IKA.js';
10
+
11
+ setComponentTemplate(precompileTemplate("\n <div ...attributes>{{yield}}</div>\n", {
12
+ strictMode: true
13
+ }), templateOnly());
14
+ const Label = setComponentTemplate(precompileTemplate("\n <label for={{@for}} ...attributes>{{yield}}</label>\n", {
15
+ strictMode: true
16
+ }), templateOnly());
11
17
 
12
18
  const Checkbox = setComponentTemplate(precompileTemplate("\n {{#let (cell @checked) as |checked|}}\n <input id={{@id}} type=\"checkbox\" role=\"switch\" checked={{checked.current}} aria-checked={{checked.current}} data-state={{if checked.current \"on\" \"off\"}} {{on \"click\" (fn toggleWithFallback checked.toggle @onChange)}} ...attributes />\n {{/let}}\n", {
13
19
  strictMode: true,
@@ -2,7 +2,7 @@
2
2
  import { fn } from '@ember/helper';
3
3
  import { on } from '@ember/modifier';
4
4
  import { cell } from 'ember-resources';
5
- import { toggleWithFallback } from './-private/utils.js';
5
+ import { t as toggleWithFallback } from '../utils-C5796IKA.js';
6
6
  import { precompileTemplate } from '@ember/template-compilation';
7
7
  import { setComponentTemplate } from '@ember/component';
8
8
  import templateOnly from '@ember/component/template-only';
@@ -1,3 +1,3 @@
1
1
 
2
- export { Zoetrope, Zoetrope as default } from './zoetrope/index.js';
2
+ export { Z as Zoetrope, Z as default } from '../index-DKE67I8L.js';
3
3
  //# sourceMappingURL=zoetrope.js.map
@@ -1,4 +1,3 @@
1
1
 
2
- export { FloatingUI } from './floating-ui/component.js';
3
- export { anchorTo } from './floating-ui/modifier.js';
2
+ export { F as FloatingUI, a as anchorTo } from './component-Bs3N-G9z.js';
4
3
  //# sourceMappingURL=floating-ui.js.map