@frontile/overlays 0.17.0-alpha.2 → 0.17.0-alpha.5

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.
@@ -6,64 +6,66 @@ import DrawerHeader from './header';
6
6
  import CloseButton from '@frontile/core/components/close-button';
7
7
  import type { WithBoundArgs } from '@glint/template';
8
8
  export interface DrawerArgs extends Omit<OverlayArgs, 'contentTransitionName'> {
9
- /**
10
- * The name of the transition to be used in the Drawer.
11
- *
12
- * @defaultValue 'overlay-transition--slide-from-[placement]'
13
- */
14
- transitionName?: string;
15
- /**
16
- * If set to false, the close button will not be displayed,
17
- * closeOnOutsideClick will be set to false, and closeOnEscapeKey will also be set
18
- * to false.
19
- *
20
- * @defaultValue true
21
- */
22
- allowClosing?: boolean;
23
- /**
24
- * If set to false, the close button will not be displayed.
25
- *
26
- * @defaultValue true
27
- */
28
- allowCloseButton?: boolean;
29
- /**
30
- * The Close Button size.
31
- */
32
- closeButtonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
33
- /**
34
- * The Drawer can appear from any side of the screen. The 'placement'
35
- * option allows to choose where it appears from.
36
- *
37
- * @defaultValue 'right'
38
- */
39
- placement?: 'top' | 'bottom' | 'left' | 'right';
40
- /**
41
- * The Drawer size.
42
- *
43
- * @defaultValue 'md'
44
- */
45
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
9
+ /**
10
+ * The name of the transition to be used in the Drawer.
11
+ *
12
+ * @defaultValue 'overlay-transition--slide-from-[placement]'
13
+ */
14
+ transitionName?: string;
15
+ /**
16
+ * If set to false, the close button will not be displayed,
17
+ * closeOnOutsideClick will be set to false, and closeOnEscapeKey will also be set
18
+ * to false.
19
+ *
20
+ * @defaultValue true
21
+ */
22
+ allowClosing?: boolean;
23
+ /**
24
+ * If set to false, the close button will not be displayed.
25
+ *
26
+ * @defaultValue true
27
+ */
28
+ allowCloseButton?: boolean;
29
+ /**
30
+ * The Close Button size.
31
+ */
32
+ closeButtonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
33
+ /**
34
+ * The Drawer can appear from any side of the screen. The 'placement'
35
+ * option allows to choose where it appears from.
36
+ *
37
+ * @defaultValue 'right'
38
+ */
39
+ placement?: 'top' | 'bottom' | 'left' | 'right';
40
+ /**
41
+ * The Drawer size.
42
+ *
43
+ * @defaultValue 'md'
44
+ */
45
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
46
46
  }
47
47
  export interface DrawerSignature {
48
- Args: DrawerArgs;
49
- Blocks: {
50
- default: [
51
- {
52
- CloseButton: WithBoundArgs<typeof CloseButton, 'onClick'> & WithBoundArgs<typeof CloseButton, 'class'>;
53
- Header: WithBoundArgs<typeof DrawerHeader, 'labelledById'> & WithBoundArgs<typeof DrawerHeader, 'size'>;
54
- Body: WithBoundArgs<typeof DrawerBody, 'size'>;
55
- Footer: WithBoundArgs<typeof DrawerFooter, 'size'>;
56
- headerId: string;
57
- }
58
- ];
59
- };
60
- Element: HTMLDivElement;
48
+ Args: DrawerArgs;
49
+ Blocks: {
50
+ default: [
51
+ {
52
+ CloseButton: WithBoundArgs<typeof CloseButton, 'onClick'> &
53
+ WithBoundArgs<typeof CloseButton, 'class'>;
54
+ Header: WithBoundArgs<typeof DrawerHeader, 'labelledById'> &
55
+ WithBoundArgs<typeof DrawerHeader, 'size'>;
56
+ Body: WithBoundArgs<typeof DrawerBody, 'size'>;
57
+ Footer: WithBoundArgs<typeof DrawerFooter, 'size'>;
58
+ headerId: string;
59
+ }
60
+ ];
61
+ };
62
+ Element: HTMLDivElement;
61
63
  }
62
64
  export default class Drawer extends Component<DrawerSignature> {
63
- headerId: string;
64
- get preventClosing(): boolean;
65
- get showCloseButton(): boolean;
66
- get placement(): "left" | "top" | "bottom" | "right";
67
- get size(): string;
65
+ headerId: string;
66
+ get preventClosing(): boolean;
67
+ get showCloseButton(): boolean;
68
+ get placement(): 'left' | 'top' | 'bottom' | 'right';
69
+ get size(): string;
68
70
  }
69
- //# sourceMappingURL=index.d.ts.map
71
+ //# sourceMappingURL=index.d.ts.map
@@ -3,7 +3,7 @@ import { type OverlayArgs } from './overlay';
3
3
  import DrawerBody from './drawer/body';
4
4
  import DrawerFooter from './drawer/footer';
5
5
  import DrawerHeader from './drawer/header';
6
- import CloseButton from '@frontile/core/components/close-button';
6
+ import { CloseButton } from '@frontile/buttons';
7
7
  import type { WithBoundArgs } from '@glint/template';
8
8
  export interface DrawerArgs extends Omit<OverlayArgs, 'contentTransitionName'> {
9
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../src/components/drawer.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,WAAW,MAAM,wCAAwC,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,WAAW,EAAE,uBAAuB,CAAC;IAC5E;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,eAAe,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAEnD;;;;;OAKG;IACH,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAEhD;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,G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IAAI,SAAS,wCAEZ;IAED,IAAI,OAAO;;;;;;MAeV;CAoCF"}
@@ -6,61 +6,63 @@ import ModalHeader from './header';
6
6
  import CloseButton from '@frontile/core/components/close-button';
7
7
  import type { WithBoundArgs } from '@glint/template';
8
8
  export interface ModalArgs extends Omit<OverlayArgs, 'contentTransitionName'> {
9
- /**
10
- * The name of the transition to be used in the modal.
11
- * @defaultValue 'overlay-transition--zoom'
12
- */
13
- transitionName?: string;
14
- /**
15
- * If set to false, the close button will not be displayed,
16
- * closeOnOutsideClick will be set to false, and closeOnEscapeKey will also be set
17
- * to false.
18
- *
19
- * @defaultValue true
20
- */
21
- allowClosing?: boolean;
22
- /**
23
- * If set to false, the close button will not be displayed.
24
- *
25
- * @defaultValue true
26
- */
27
- allowCloseButton?: boolean;
28
- /**
29
- * The Close Button size.
30
- */
31
- closeButtonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
32
- /**
33
- * If set to true, the modal will be vertically centered
34
- *
35
- * @defaultValue false
36
- */
37
- isCentered?: boolean;
38
- /**
39
- * The Modal size.
40
- *
41
- * @defaultValue 'lg'
42
- */
43
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
9
+ /**
10
+ * The name of the transition to be used in the modal.
11
+ * @defaultValue 'overlay-transition--zoom'
12
+ */
13
+ transitionName?: string;
14
+ /**
15
+ * If set to false, the close button will not be displayed,
16
+ * closeOnOutsideClick will be set to false, and closeOnEscapeKey will also be set
17
+ * to false.
18
+ *
19
+ * @defaultValue true
20
+ */
21
+ allowClosing?: boolean;
22
+ /**
23
+ * If set to false, the close button will not be displayed.
24
+ *
25
+ * @defaultValue true
26
+ */
27
+ allowCloseButton?: boolean;
28
+ /**
29
+ * The Close Button size.
30
+ */
31
+ closeButtonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
32
+ /**
33
+ * If set to true, the modal will be vertically centered
34
+ *
35
+ * @defaultValue false
36
+ */
37
+ isCentered?: boolean;
38
+ /**
39
+ * The Modal size.
40
+ *
41
+ * @defaultValue 'lg'
42
+ */
43
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
44
44
  }
45
45
  export interface ModalSignature {
46
- Args: ModalArgs;
47
- Blocks: {
48
- default: [
49
- {
50
- CloseButton: WithBoundArgs<typeof CloseButton, 'onClick'> & WithBoundArgs<typeof CloseButton, 'class'>;
51
- Header: WithBoundArgs<typeof ModalHeader, 'labelledById'> & WithBoundArgs<typeof ModalHeader, 'size'>;
52
- Body: WithBoundArgs<typeof ModalBody, 'size'>;
53
- Footer: WithBoundArgs<typeof ModalFooter, 'size'>;
54
- headerId: string;
55
- }
56
- ];
57
- };
58
- Element: HTMLDivElement;
46
+ Args: ModalArgs;
47
+ Blocks: {
48
+ default: [
49
+ {
50
+ CloseButton: WithBoundArgs<typeof CloseButton, 'onClick'> &
51
+ WithBoundArgs<typeof CloseButton, 'class'>;
52
+ Header: WithBoundArgs<typeof ModalHeader, 'labelledById'> &
53
+ WithBoundArgs<typeof ModalHeader, 'size'>;
54
+ Body: WithBoundArgs<typeof ModalBody, 'size'>;
55
+ Footer: WithBoundArgs<typeof ModalFooter, 'size'>;
56
+ headerId: string;
57
+ }
58
+ ];
59
+ };
60
+ Element: HTMLDivElement;
59
61
  }
60
62
  export default class Modal extends Component<ModalSignature> {
61
- headerId: string;
62
- get preventClosing(): boolean;
63
- get showCloseButton(): boolean;
64
- get size(): "full" | "xs" | "sm" | "md" | "lg" | "xl";
63
+ headerId: string;
64
+ get preventClosing(): boolean;
65
+ get showCloseButton(): boolean;
66
+ get size(): 'full' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
65
67
  }
66
- //# sourceMappingURL=index.d.ts.map
68
+ //# sourceMappingURL=index.d.ts.map
@@ -3,7 +3,7 @@ import { type OverlayArgs } from './overlay';
3
3
  import ModalFooter from './modal/footer';
4
4
  import ModalBody from './modal/body';
5
5
  import ModalHeader from './modal/header';
6
- import CloseButton from '@frontile/core/components/close-button';
6
+ import { CloseButton } from '@frontile/buttons';
7
7
  import type { WithBoundArgs } from '@glint/template';
8
8
  export interface ModalArgs extends Omit<OverlayArgs, 'contentTransitionName'> {
9
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"modal.d.ts","sourceRoot":"","sources":["../../src/components/modal.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAG3C,OAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,OAAO,WAAW,MAAM,wCAAwC,CAAC;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,WAAW,EAAE,uBAAuB,CAAC;IAC3E;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,eAAe,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAEnD;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;CAClD;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE;QACN,OAAO,EAAE;YACP;gBACE,WAAW,EAAE,aAAa,CAAC,OAAO,WAAW,EAAE,SAAS,CAAC,GACvD,aAAa,CAAC,OAAO,WAAW,EAAE,OAAO,CAAC,CAAC;gBAC7C,MAAM,EAAE,aAAa,CAAC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AI,GAAG,IAAI,CAAC;IAEnD;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;CAClD;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE;QACN,OAAO,EAAE;YACP;gBACE,WAAW,EAAE,aAAa,CAAC,OAAO,WAAW,EAAE,SAAS,CAAC,GACvD,aAAa,CAAC,OAAO,WAAW,EAAE,OAAO,CAAC,CAAC;gBAC7C,MAAM,EAAE,aAAa,CAAC,OAAO,WAAW,EAAE,cAAc,CAAC,GACvD,aAAa,CAAC,OAAO,WAAW,EAAE,OAAO,CAAC,CAAC;gBAC7C,IAAI,EAAE,aAAa,CAAC,OAAO,SAAS,EAAE,OAAO,CAAC,CAAC;gBAC/C,MAAM,EAAE,aAAa,CAAC,OAAO,WAAW,EAAE,OAAO,CAAC,CAAC;gBACnD,QAAQ,EAAE,MAAM,CAAC;aAClB;SACF,CAAC;KACH,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC1D,QAAQ,SAA6B;IAErC,IAAI,cAAc,IAAI,OAAO,CAE5B;IAED,IAAI,eAAe,IAAI,OAAO,CAI7B;IAED,IAAI,IAAI,8CAEP;IAED,IAAI,OAAO;;;;;;MAeV;CAoCF"}
@@ -1,4 +1,5 @@
1
1
  import Component from '@glimmer/component';
2
+ import type { ModifierLike } from '@glint/template';
2
3
  export interface OverlayArgs {
3
4
  /**
4
5
  * Whether to render in place or in the specified/default destination
@@ -84,6 +85,11 @@ export interface OverlayArgs {
84
85
  * @defaultValue 'overlay-transition--fade'
85
86
  */
86
87
  contentTransitionName?: string;
88
+ disableFlexContent?: boolean;
89
+ customContentModifier?: ModifierLike<{
90
+ Element: HTMLElement;
91
+ }>;
92
+ contentClass?: string;
87
93
  }
88
94
  export interface OverlaySignature {
89
95
  Args: OverlayArgs;
@@ -94,6 +100,8 @@ export interface OverlaySignature {
94
100
  }
95
101
  export default class Overlay extends Component<OverlaySignature> {
96
102
  keepOpen: boolean;
103
+ wrapperElement: HTMLElement | undefined;
104
+ backdropElement: HTMLElement | undefined;
97
105
  contentElement: HTMLElement | undefined;
98
106
  mouseDownContentElement: EventTarget | null;
99
107
  get destinationElement(): HTMLElement | null;
@@ -101,17 +109,45 @@ export default class Overlay extends Component<OverlaySignature> {
101
109
  get isBackdropVisible(): boolean;
102
110
  get isAnimationEnabled(): boolean;
103
111
  get focusTrapOptions(): unknown;
104
- handleOverlayClick(): void;
112
+ handleOverlayClick(e: MouseEvent): void;
105
113
  handleContentClick(event: MouseEvent): void;
106
114
  handleClose(): void;
107
115
  handleContentMouseDown(event: MouseEvent): void;
108
116
  handleKeyDown(event: KeyboardEvent): void;
109
- setup(element: HTMLElement): void;
110
- teardown(): void;
117
+ setupContent: import("ember-modifier").FunctionBasedModifier<{
118
+ Args: {
119
+ Positional: unknown[];
120
+ Named: import("ember-modifier/-private/signature.js").EmptyObject;
121
+ };
122
+ Element: HTMLDivElement;
123
+ }>;
124
+ setupBackdrop: import("ember-modifier").FunctionBasedModifier<{
125
+ Args: {
126
+ Positional: unknown[];
127
+ Named: import("ember-modifier/-private/signature.js").EmptyObject;
128
+ };
129
+ Element: HTMLDivElement;
130
+ }>;
131
+ setupWrapper: import("ember-modifier").FunctionBasedModifier<{
132
+ Args: {
133
+ Positional: unknown[];
134
+ Named: import("ember-modifier/-private/signature.js").EmptyObject;
135
+ };
136
+ Element: HTMLDivElement;
137
+ }>;
111
138
  get classes(): {
112
139
  base: string;
113
140
  backdrop: string;
114
141
  content: string;
115
142
  };
143
+ get customContentModifier(): ModifierLike<{
144
+ Element: HTMLElement;
145
+ }> | import("ember-modifier").FunctionBasedModifier<{
146
+ Args: {
147
+ Positional: unknown[];
148
+ Named: import("ember-modifier/-private/signature.js").EmptyObject;
149
+ };
150
+ Element: Element;
151
+ }>;
116
152
  }
117
153
  //# sourceMappingURL=overlay.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/components/overlay.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAwC3C,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAC;CACz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BAAgB,IAAI,OAAO,CAc9B;IAEO,kBAAkB,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAUvC,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAW3C,WAAW,IAAI,IAAI;IAO3B,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAK/C,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAMzC,YAAY;;;;;;OAgCT;IAEH,aAAa;;;;;;OAKV;IAEH,YAAY;;;;;;OAKT;IAEH,IAAI,OAAO;;;;MAaV;IAED,IAAI,qBAAqB;;;;;;;;OAMxB;CAyDF"}
@@ -0,0 +1,4 @@
1
+ export { default as Overlay } from './components/overlay';
2
+ export { default as Modal } from './components/modal';
3
+ export { default as Drawer } from './components/drawer';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC"}
@@ -6,7 +6,7 @@ import Overlay from './overlay.js';
6
6
  import DrawerBody from './drawer/body.js';
7
7
  import DrawerFooter from './drawer/footer.js';
8
8
  import DrawerHeader from './drawer/header.js';
9
- import CloseButton from '@frontile/core/components/close-button';
9
+ import { CloseButton } from '@frontile/buttons';
10
10
  import { useStyles } from '@frontile/theme';
11
11
  import { precompileTemplate } from '@ember/template-compilation';
12
12
  import { setComponentTemplate } from '@ember/component';
@@ -1 +1 @@
1
- {"version":3,"file":"drawer.js","sources":["../../src/components/drawer.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\nimport { concat, hash } from '@ember/helper';\nimport Overlay, { type OverlayArgs } from './overlay';\nimport DrawerBody from './drawer/body';\nimport DrawerFooter from './drawer/footer';\nimport DrawerHeader from './drawer/header';\nimport CloseButton from '@frontile/core/components/close-button';\nimport type { WithBoundArgs } from '@glint/template';\nimport { useStyles } from '@frontile/theme';\nexport interface DrawerArgs extends Omit<OverlayArgs, 'contentTransitionName'> {\n /**\n * The name of the transition to be used in the Drawer.\n *\n * @defaultValue 'overlay-transition--slide-from-[placement]'\n */ transitionName?: string;\n /**\n * If set to false, the close button will not be displayed,\n * closeOnOutsideClick will be set to false, and closeOnEscapeKey will also be set\n * to false.\n *\n * @defaultValue true\n */ allowClosing?: boolean;\n /**\n * If set to false, the close button will not be displayed.\n *\n * @defaultValue true\n */ allowCloseButton?: boolean;\n /**\n * The Close Button size.\n */ closeButtonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /**\n * The Drawer can appear from any side of the screen. The 'placement'\n * option allows to choose where it appears from.\n *\n * @defaultValue 'right'\n */ placement?: 'top' | 'bottom' | 'left' | 'right';\n /**\n * The Drawer size.\n *\n * @defaultValue 'md'\n */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';\n}\nexport interface DrawerSignature {\n Args: DrawerArgs;\n Blocks: {\n default: [{\n CloseButton: WithBoundArgs<typeof CloseButton, 'onClick'> & WithBoundArgs<typeof CloseButton, 'class'>;\n Header: WithBoundArgs<typeof DrawerHeader, 'labelledById'> & WithBoundArgs<typeof DrawerHeader, 'class'>;\n Body: WithBoundArgs<typeof DrawerBody, 'class'>;\n Footer: WithBoundArgs<typeof DrawerFooter, 'class'>;\n headerId: string;\n }];\n };\n Element: HTMLDivElement;\n}\nexport default class Drawer extends Component<DrawerSignature> {\n headerId = `${guidFor(this)}-header`;\n get preventClosing(): boolean {\n return this.args.allowClosing === false;\n }\n get showCloseButton(): boolean {\n return (this.args.allowClosing !== false && this.args.allowCloseButton !== false);\n }\n get placement() {\n return this.args.placement || 'right';\n }\n get classes() {\n const { drawer: drawer1 } = useStyles();\n const { base: base1, closeButton: closeButton1, header: header1, body: body1, footer: footer1 } = drawer1({\n placement: this.placement,\n size: this.args.size || 'md'\n });\n return {\n base: base1(),\n closeButton: closeButton1(),\n header: header1(),\n body: body1(),\n footer: footer1()\n };\n }\n static{\n template(`\n <Overlay\n @isOpen={{@isOpen}}\n @onClose={{@onClose}}\n @onOpen={{@onOpen}}\n @didClose={{@didClose}}\n @renderInPlace={{@renderInPlace}}\n @destinationElementId={{@destinationElementId}}\n @transitionDuration={{@transitionDuration}}\n @disableBackdrop={{@disableBackdrop}}\n @disableTransitions={{@disableTransitions}}\n @disableFocusTrap={{@disableFocusTrap}}\n @focusTrapOptions={{@focusTrapOptions}}\n @closeOnOutsideClick={{if this.preventClosing false @closeOnOutsideClick}}\n @closeOnEscapeKey={{if this.preventClosing false @closeOnEscapeKey}}\n @backdropTransitionName={{@backdropTransitionName}}\n @contentTransitionName={{if\n @transitionName\n @transitionName\n (concat \"overlay-transition--slide-from-\" this.placement)\n }}\n >\n\n <div\n class={{this.classes.base}}\n tabindex=\"0\"\n role=\"dialog\"\n aria-labelledby={{this.headerId}}\n ...attributes\n >\n {{#if this.showCloseButton}}\n <CloseButton\n @onClick={{@onClose}}\n @size={{@closeButtonSize}}\n @class={{this.classes.closeButton}}\n />\n {{/if}}\n\n {{yield\n (hash\n CloseButton=(component\n CloseButton onClick=@onClose class=this.classes.closeButton\n )\n Header=(component\n DrawerHeader labelledById=this.headerId class=this.classes.header\n )\n Body=(component\n DrawerBody placement=this.placement class=this.classes.body\n )\n Footer=(component\n DrawerFooter placement=this.placement class=this.classes.footer\n )\n headerId=this.headerId\n )\n }}\n </div>\n </Overlay>\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["Drawer","Component","constructor","args","_defineProperty","guidFor","preventClosing","allowClosing","showCloseButton","allowCloseButton","placement","classes","drawer","drawer1","useStyles","base","base1","closeButton","closeButton1","header","header1","body","body1","footer","footer1","size","_class","setComponentTemplate","precompileTemplate","scope","Overlay","concat","CloseButton","hash","DrawerHeader","DrawerBody","DrawerFooter","strictMode"],"mappings":";;;;;;;;;;;;;;AAyDe,MAAMA,MAAM,SAASC,SAAS,CAAkB;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,mBAC/C,CAAEC,EAAAA,OAAO,CAAC,IAAI,CAAE,CAAQ,OAAA,CAAA,CAAA,CAAA;AAAA,GAAA;EACpC,IAAIC,cAAcA,GAAY;AAC1B,IAAA,OAAO,IAAI,CAACH,IAAI,CAACI,YAAY,KAAK,KAAK,CAAA;AAC3C,GAAA;EACA,IAAIC,eAAeA,GAAY;AAC3B,IAAA,OAAQ,IAAI,CAACL,IAAI,CAACI,YAAY,KAAK,KAAK,IAAI,IAAI,CAACJ,IAAI,CAACM,gBAAgB,KAAK,KAAK,CAAA;AACpF,GAAA;EACA,IAAIC,SAASA,GAAG;AACZ,IAAA,OAAO,IAAI,CAACP,IAAI,CAACO,SAAS,IAAI,OAAO,CAAA;AACzC,GAAA;EACA,IAAIC,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,MAAM,EAAEC,OAAAA;KAAS,GAAGC,SAAS,EAAE,CAAA;IACvC,MAAM;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,WAAW,EAAEC,YAAY;AAAEC,MAAAA,MAAM,EAAEC,OAAO;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,MAAM,EAAEC,OAAAA;KAAS,GAAGX,OAAO,CAAC;MACtGH,SAAS,EAAE,IAAI,CAACA,SAAS;AACzBe,MAAAA,IAAI,EAAE,IAAI,CAACtB,IAAI,CAACsB,IAAI,IAAI,IAAA;AAC5B,KAAC,CAAC,CAAA;IACF,OAAO;MACHV,IAAI,EAAEC,KAAK,EAAE;MACbC,WAAW,EAAEC,YAAY,EAAE;MAC3BC,MAAM,EAAEC,OAAO,EAAE;MACjBC,IAAI,EAAEC,KAAK,EAAE;MACbC,MAAM,EAAEC,OAAO,EAAC;KACnB,CAAA;AACL,GAAA;AAkEJ,CAAA;AAACE,MAAA,GA1FoB1B,MAAM,CAAA;AA0BnB2B,oBAAA,CAAAC,kBAAA,CAyDH,o4CAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,WAAA;IAAAC,IAAA;IAAAC,YAAA;IAAAC,UAAA;AAAAC,IAAAA,YAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAX,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"drawer.js","sources":["../../src/components/drawer.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\nimport { concat, hash } from '@ember/helper';\nimport Overlay, { type OverlayArgs } from './overlay';\nimport DrawerBody from './drawer/body';\nimport DrawerFooter from './drawer/footer';\nimport DrawerHeader from './drawer/header';\nimport { CloseButton } from '@frontile/buttons';\nimport type { WithBoundArgs } from '@glint/template';\nimport { useStyles } from '@frontile/theme';\nexport interface DrawerArgs extends Omit<OverlayArgs, 'contentTransitionName'> {\n /**\n * The name of the transition to be used in the Drawer.\n *\n * @defaultValue 'overlay-transition--slide-from-[placement]'\n */ transitionName?: string;\n /**\n * If set to false, the close button will not be displayed,\n * closeOnOutsideClick will be set to false, and closeOnEscapeKey will also be set\n * to false.\n *\n * @defaultValue true\n */ allowClosing?: boolean;\n /**\n * If set to false, the close button will not be displayed.\n *\n * @defaultValue true\n */ allowCloseButton?: boolean;\n /**\n * The Close Button size.\n */ closeButtonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /**\n * The Drawer can appear from any side of the screen. The 'placement'\n * option allows to choose where it appears from.\n *\n * @defaultValue 'right'\n */ placement?: 'top' | 'bottom' | 'left' | 'right';\n /**\n * The Drawer size.\n *\n * @defaultValue 'md'\n */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';\n}\nexport interface DrawerSignature {\n Args: DrawerArgs;\n Blocks: {\n default: [{\n CloseButton: WithBoundArgs<typeof CloseButton, 'onClick'> & WithBoundArgs<typeof CloseButton, 'class'>;\n Header: WithBoundArgs<typeof DrawerHeader, 'labelledById'> & WithBoundArgs<typeof DrawerHeader, 'class'>;\n Body: WithBoundArgs<typeof DrawerBody, 'class'>;\n Footer: WithBoundArgs<typeof DrawerFooter, 'class'>;\n headerId: string;\n }];\n };\n Element: HTMLDivElement;\n}\nexport default class Drawer extends Component<DrawerSignature> {\n headerId = `${guidFor(this)}-header`;\n get preventClosing(): boolean {\n return this.args.allowClosing === false;\n }\n get showCloseButton(): boolean {\n return (this.args.allowClosing !== false && this.args.allowCloseButton !== false);\n }\n get placement() {\n return this.args.placement || 'right';\n }\n get classes() {\n const { drawer: drawer1 } = useStyles();\n const { base: base1, closeButton: closeButton1, header: header1, body: body1, footer: footer1 } = drawer1({\n placement: this.placement,\n size: this.args.size || 'md'\n });\n return {\n base: base1(),\n closeButton: closeButton1(),\n header: header1(),\n body: body1(),\n footer: footer1()\n };\n }\n static{\n template(`\n <Overlay\n @isOpen={{@isOpen}}\n @onClose={{@onClose}}\n @onOpen={{@onOpen}}\n @didClose={{@didClose}}\n @renderInPlace={{@renderInPlace}}\n @destinationElementId={{@destinationElementId}}\n @transitionDuration={{@transitionDuration}}\n @disableBackdrop={{@disableBackdrop}}\n @disableTransitions={{@disableTransitions}}\n @disableFocusTrap={{@disableFocusTrap}}\n @focusTrapOptions={{@focusTrapOptions}}\n @closeOnOutsideClick={{if this.preventClosing false @closeOnOutsideClick}}\n @closeOnEscapeKey={{if this.preventClosing false @closeOnEscapeKey}}\n @backdropTransitionName={{@backdropTransitionName}}\n @contentTransitionName={{if\n @transitionName\n @transitionName\n (concat \"overlay-transition--slide-from-\" this.placement)\n }}\n >\n\n <div\n class={{this.classes.base}}\n tabindex=\"0\"\n role=\"dialog\"\n aria-labelledby={{this.headerId}}\n ...attributes\n >\n {{#if this.showCloseButton}}\n <CloseButton\n @onClick={{@onClose}}\n @size={{@closeButtonSize}}\n @class={{this.classes.closeButton}}\n />\n {{/if}}\n\n {{yield\n (hash\n CloseButton=(component\n CloseButton onClick=@onClose class=this.classes.closeButton\n )\n Header=(component\n DrawerHeader labelledById=this.headerId class=this.classes.header\n )\n Body=(component\n DrawerBody placement=this.placement class=this.classes.body\n )\n Footer=(component\n DrawerFooter placement=this.placement class=this.classes.footer\n )\n headerId=this.headerId\n )\n }}\n </div>\n </Overlay>\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["Drawer","Component","constructor","args","_defineProperty","guidFor","preventClosing","allowClosing","showCloseButton","allowCloseButton","placement","classes","drawer","drawer1","useStyles","base","base1","closeButton","closeButton1","header","header1","body","body1","footer","footer1","size","_class","setComponentTemplate","precompileTemplate","scope","Overlay","concat","CloseButton","hash","DrawerHeader","DrawerBody","DrawerFooter","strictMode"],"mappings":";;;;;;;;;;;;;;AAyDe,MAAMA,MAAM,SAASC,SAAS,CAAkB;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,mBAC/C,CAAEC,EAAAA,OAAO,CAAC,IAAI,CAAE,CAAQ,OAAA,CAAA,CAAA,CAAA;AAAA,GAAA;EACpC,IAAIC,cAAcA,GAAY;AAC1B,IAAA,OAAO,IAAI,CAACH,IAAI,CAACI,YAAY,KAAK,KAAK,CAAA;AAC3C,GAAA;EACA,IAAIC,eAAeA,GAAY;AAC3B,IAAA,OAAQ,IAAI,CAACL,IAAI,CAACI,YAAY,KAAK,KAAK,IAAI,IAAI,CAACJ,IAAI,CAACM,gBAAgB,KAAK,KAAK,CAAA;AACpF,GAAA;EACA,IAAIC,SAASA,GAAG;AACZ,IAAA,OAAO,IAAI,CAACP,IAAI,CAACO,SAAS,IAAI,OAAO,CAAA;AACzC,GAAA;EACA,IAAIC,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,MAAM,EAAEC,OAAAA;KAAS,GAAGC,SAAS,EAAE,CAAA;IACvC,MAAM;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,WAAW,EAAEC,YAAY;AAAEC,MAAAA,MAAM,EAAEC,OAAO;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,MAAM,EAAEC,OAAAA;KAAS,GAAGX,OAAO,CAAC;MACtGH,SAAS,EAAE,IAAI,CAACA,SAAS;AACzBe,MAAAA,IAAI,EAAE,IAAI,CAACtB,IAAI,CAACsB,IAAI,IAAI,IAAA;AAC5B,KAAC,CAAC,CAAA;IACF,OAAO;MACHV,IAAI,EAAEC,KAAK,EAAE;MACbC,WAAW,EAAEC,YAAY,EAAE;MAC3BC,MAAM,EAAEC,OAAO,EAAE;MACjBC,IAAI,EAAEC,KAAK,EAAE;MACbC,MAAM,EAAEC,OAAO,EAAC;KACnB,CAAA;AACL,GAAA;AAkEJ,CAAA;AAACE,MAAA,GA1FoB1B,MAAM,CAAA;AA0BnB2B,oBAAA,CAAAC,kBAAA,CAyDH,o4CAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,WAAA;IAAAC,IAAA;IAAAC,YAAA;IAAAC,UAAA;AAAAC,IAAAA,YAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAX,MAAA,CAAA;;;;"}
@@ -6,7 +6,7 @@ import Overlay from './overlay.js';
6
6
  import ModalFooter from './modal/footer.js';
7
7
  import ModalBody from './modal/body.js';
8
8
  import ModalHeader from './modal/header.js';
9
- import CloseButton from '@frontile/core/components/close-button';
9
+ import { CloseButton } from '@frontile/buttons';
10
10
  import { useStyles } from '@frontile/theme';
11
11
  import { precompileTemplate } from '@ember/template-compilation';
12
12
  import { setComponentTemplate } from '@ember/component';
@@ -1 +1 @@
1
- {"version":3,"file":"modal.js","sources":["../../src/components/modal.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\nimport { hash } from '@ember/helper';\nimport Overlay, { type OverlayArgs } from './overlay';\nimport ModalFooter from './modal/footer';\nimport ModalBody from './modal/body';\nimport ModalHeader from './modal/header';\nimport CloseButton from '@frontile/core/components/close-button';\nimport { useStyles } from '@frontile/theme';\nimport type { WithBoundArgs } from '@glint/template';\nexport interface ModalArgs extends Omit<OverlayArgs, 'contentTransitionName'> {\n /**\n * The name of the transition to be used in the modal.\n * @defaultValue 'overlay-transition--zoom'\n */ transitionName?: string;\n /**\n * If set to false, the close button will not be displayed,\n * closeOnOutsideClick will be set to false, and closeOnEscapeKey will also be set\n * to false.\n *\n * @defaultValue true\n */ allowClosing?: boolean;\n /**\n * If set to false, the close button will not be displayed.\n *\n * @defaultValue true\n */ allowCloseButton?: boolean;\n /**\n * The Close Button size.\n */ closeButtonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /**\n * If set to true, the modal will be vertically centered\n *\n * @defaultValue false\n */ isCentered?: boolean;\n /**\n * The Modal size.\n *\n * @defaultValue 'lg'\n */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';\n}\nexport interface ModalSignature {\n Args: ModalArgs;\n Blocks: {\n default: [{\n CloseButton: WithBoundArgs<typeof CloseButton, 'onClick'> & WithBoundArgs<typeof CloseButton, 'class'>;\n Header: WithBoundArgs<typeof ModalHeader, 'labelledById'> & WithBoundArgs<typeof ModalHeader, 'class'>;\n Body: WithBoundArgs<typeof ModalBody, 'class'>;\n Footer: WithBoundArgs<typeof ModalFooter, 'class'>;\n headerId: string;\n }];\n };\n Element: HTMLDivElement;\n}\nexport default class Modal extends Component<ModalSignature> {\n headerId = `${guidFor(this)}-header`;\n get preventClosing(): boolean {\n return this.args.allowClosing === false;\n }\n get showCloseButton(): boolean {\n return (this.args.allowClosing !== false && this.args.allowCloseButton !== false);\n }\n get size() {\n return this.args.size || 'lg';\n }\n get classes() {\n const { modal: modal1 } = useStyles();\n const { base: base1, closeButton: closeButton1, header: header1, body: body1, footer: footer1 } = modal1({\n size: this.size,\n isCentered: this.args.isCentered\n });\n return {\n base: base1(),\n closeButton: closeButton1(),\n header: header1(),\n body: body1(),\n footer: footer1()\n };\n }\n static{\n template(`\n <Overlay\n @isOpen={{@isOpen}}\n @onClose={{@onClose}}\n @onOpen={{@onOpen}}\n @didClose={{@didClose}}\n @renderInPlace={{@renderInPlace}}\n @destinationElementId={{@destinationElementId}}\n @transitionDuration={{@transitionDuration}}\n @disableBackdrop={{@disableBackdrop}}\n @disableTransitions={{@disableTransitions}}\n @disableFocusTrap={{@disableFocusTrap}}\n @focusTrapOptions={{@focusTrapOptions}}\n @closeOnOutsideClick={{if this.preventClosing false @closeOnOutsideClick}}\n @closeOnEscapeKey={{if this.preventClosing false @closeOnEscapeKey}}\n @backdropTransitionName={{@backdropTransitionName}}\n @contentTransitionName={{if\n @transitionName\n @transitionName\n \"overlay-transition--zoom\"\n }}\n >\n <div\n class={{this.classes.base}}\n tabindex=\"0\"\n role=\"dialog\"\n aria-labelledby={{this.headerId}}\n ...attributes\n >\n {{#if this.showCloseButton}}\n <CloseButton\n @onClick={{@onClose}}\n @size={{@closeButtonSize}}\n @class={{this.classes.closeButton}}\n />\n {{/if}}\n\n {{yield\n (hash\n CloseButton=(component\n CloseButton onClick=@onClose class=this.classes.closeButton\n )\n Header=(component\n ModalHeader labelledById=this.headerId class=this.classes.header\n )\n Body=(component ModalBody class=this.classes.body)\n Footer=(component ModalFooter class=this.classes.footer)\n headerId=this.headerId\n )\n }}\n </div>\n </Overlay>\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["Modal","Component","constructor","args","_defineProperty","guidFor","preventClosing","allowClosing","showCloseButton","allowCloseButton","size","classes","modal","modal1","useStyles","base","base1","closeButton","closeButton1","header","header1","body","body1","footer","footer1","isCentered","_class","setComponentTemplate","precompileTemplate","scope","Overlay","CloseButton","hash","ModalHeader","ModalBody","ModalFooter","strictMode"],"mappings":";;;;;;;;;;;;;;AAuDe,MAAMA,KAAK,SAASC,SAAS,CAAiB;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,mBAC7C,CAAEC,EAAAA,OAAO,CAAC,IAAI,CAAE,CAAQ,OAAA,CAAA,CAAA,CAAA;AAAA,GAAA;EACpC,IAAIC,cAAcA,GAAY;AAC1B,IAAA,OAAO,IAAI,CAACH,IAAI,CAACI,YAAY,KAAK,KAAK,CAAA;AAC3C,GAAA;EACA,IAAIC,eAAeA,GAAY;AAC3B,IAAA,OAAQ,IAAI,CAACL,IAAI,CAACI,YAAY,KAAK,KAAK,IAAI,IAAI,CAACJ,IAAI,CAACM,gBAAgB,KAAK,KAAK,CAAA;AACpF,GAAA;EACA,IAAIC,IAAIA,GAAG;AACP,IAAA,OAAO,IAAI,CAACP,IAAI,CAACO,IAAI,IAAI,IAAI,CAAA;AACjC,GAAA;EACA,IAAIC,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,KAAK,EAAEC,MAAAA;KAAQ,GAAGC,SAAS,EAAE,CAAA;IACrC,MAAM;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,WAAW,EAAEC,YAAY;AAAEC,MAAAA,MAAM,EAAEC,OAAO;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,MAAM,EAAEC,OAAAA;KAAS,GAAGX,MAAM,CAAC;MACrGH,IAAI,EAAE,IAAI,CAACA,IAAI;AACfe,MAAAA,UAAU,EAAE,IAAI,CAACtB,IAAI,CAACsB,UAAAA;AAC1B,KAAC,CAAC,CAAA;IACF,OAAO;MACHV,IAAI,EAAEC,KAAK,EAAE;MACbC,WAAW,EAAEC,YAAY,EAAE;MAC3BC,MAAM,EAAEC,OAAO,EAAE;MACjBC,IAAI,EAAEC,KAAK,EAAE;MACbC,MAAM,EAAEC,OAAO,EAAC;KACnB,CAAA;AACL,GAAA;AA6DJ,CAAA;AAACE,MAAA,GArFoB1B,KAAK,CAAA;AA0BlB2B,oBAAA,CAAAC,kBAAA,CAoDH,8yCAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,OAAA;IAAAC,WAAA;IAAAC,IAAA;IAAAC,WAAA;IAAAC,SAAA;AAAAC,IAAAA,WAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAV,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"modal.js","sources":["../../src/components/modal.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { guidFor } from '@ember/object/internals';\nimport { hash } from '@ember/helper';\nimport Overlay, { type OverlayArgs } from './overlay';\nimport ModalFooter from './modal/footer';\nimport ModalBody from './modal/body';\nimport ModalHeader from './modal/header';\nimport { CloseButton } from '@frontile/buttons';\nimport { useStyles } from '@frontile/theme';\nimport type { WithBoundArgs } from '@glint/template';\nexport interface ModalArgs extends Omit<OverlayArgs, 'contentTransitionName'> {\n /**\n * The name of the transition to be used in the modal.\n * @defaultValue 'overlay-transition--zoom'\n */ transitionName?: string;\n /**\n * If set to false, the close button will not be displayed,\n * closeOnOutsideClick will be set to false, and closeOnEscapeKey will also be set\n * to false.\n *\n * @defaultValue true\n */ allowClosing?: boolean;\n /**\n * If set to false, the close button will not be displayed.\n *\n * @defaultValue true\n */ allowCloseButton?: boolean;\n /**\n * The Close Button size.\n */ closeButtonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n /**\n * If set to true, the modal will be vertically centered\n *\n * @defaultValue false\n */ isCentered?: boolean;\n /**\n * The Modal size.\n *\n * @defaultValue 'lg'\n */ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';\n}\nexport interface ModalSignature {\n Args: ModalArgs;\n Blocks: {\n default: [{\n CloseButton: WithBoundArgs<typeof CloseButton, 'onClick'> & WithBoundArgs<typeof CloseButton, 'class'>;\n Header: WithBoundArgs<typeof ModalHeader, 'labelledById'> & WithBoundArgs<typeof ModalHeader, 'class'>;\n Body: WithBoundArgs<typeof ModalBody, 'class'>;\n Footer: WithBoundArgs<typeof ModalFooter, 'class'>;\n headerId: string;\n }];\n };\n Element: HTMLDivElement;\n}\nexport default class Modal extends Component<ModalSignature> {\n headerId = `${guidFor(this)}-header`;\n get preventClosing(): boolean {\n return this.args.allowClosing === false;\n }\n get showCloseButton(): boolean {\n return (this.args.allowClosing !== false && this.args.allowCloseButton !== false);\n }\n get size() {\n return this.args.size || 'lg';\n }\n get classes() {\n const { modal: modal1 } = useStyles();\n const { base: base1, closeButton: closeButton1, header: header1, body: body1, footer: footer1 } = modal1({\n size: this.size,\n isCentered: this.args.isCentered\n });\n return {\n base: base1(),\n closeButton: closeButton1(),\n header: header1(),\n body: body1(),\n footer: footer1()\n };\n }\n static{\n template(`\n <Overlay\n @isOpen={{@isOpen}}\n @onClose={{@onClose}}\n @onOpen={{@onOpen}}\n @didClose={{@didClose}}\n @renderInPlace={{@renderInPlace}}\n @destinationElementId={{@destinationElementId}}\n @transitionDuration={{@transitionDuration}}\n @disableBackdrop={{@disableBackdrop}}\n @disableTransitions={{@disableTransitions}}\n @disableFocusTrap={{@disableFocusTrap}}\n @focusTrapOptions={{@focusTrapOptions}}\n @closeOnOutsideClick={{if this.preventClosing false @closeOnOutsideClick}}\n @closeOnEscapeKey={{if this.preventClosing false @closeOnEscapeKey}}\n @backdropTransitionName={{@backdropTransitionName}}\n @contentTransitionName={{if\n @transitionName\n @transitionName\n \"overlay-transition--zoom\"\n }}\n >\n <div\n class={{this.classes.base}}\n tabindex=\"0\"\n role=\"dialog\"\n aria-labelledby={{this.headerId}}\n ...attributes\n >\n {{#if this.showCloseButton}}\n <CloseButton\n @onClick={{@onClose}}\n @size={{@closeButtonSize}}\n @class={{this.classes.closeButton}}\n />\n {{/if}}\n\n {{yield\n (hash\n CloseButton=(component\n CloseButton onClick=@onClose class=this.classes.closeButton\n )\n Header=(component\n ModalHeader labelledById=this.headerId class=this.classes.header\n )\n Body=(component ModalBody class=this.classes.body)\n Footer=(component ModalFooter class=this.classes.footer)\n headerId=this.headerId\n )\n }}\n </div>\n </Overlay>\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["Modal","Component","constructor","args","_defineProperty","guidFor","preventClosing","allowClosing","showCloseButton","allowCloseButton","size","classes","modal","modal1","useStyles","base","base1","closeButton","closeButton1","header","header1","body","body1","footer","footer1","isCentered","_class","setComponentTemplate","precompileTemplate","scope","Overlay","CloseButton","hash","ModalHeader","ModalBody","ModalFooter","strictMode"],"mappings":";;;;;;;;;;;;;;AAuDe,MAAMA,KAAK,SAASC,SAAS,CAAiB;AAAAC,EAAAA,WAAAA,CAAA,GAAAC,IAAA,EAAA;AAAA,IAAA,KAAA,CAAA,GAAAA,IAAA,CAAA,CAAA;AAAAC,IAAAA,eAAA,mBAC7C,CAAEC,EAAAA,OAAO,CAAC,IAAI,CAAE,CAAQ,OAAA,CAAA,CAAA,CAAA;AAAA,GAAA;EACpC,IAAIC,cAAcA,GAAY;AAC1B,IAAA,OAAO,IAAI,CAACH,IAAI,CAACI,YAAY,KAAK,KAAK,CAAA;AAC3C,GAAA;EACA,IAAIC,eAAeA,GAAY;AAC3B,IAAA,OAAQ,IAAI,CAACL,IAAI,CAACI,YAAY,KAAK,KAAK,IAAI,IAAI,CAACJ,IAAI,CAACM,gBAAgB,KAAK,KAAK,CAAA;AACpF,GAAA;EACA,IAAIC,IAAIA,GAAG;AACP,IAAA,OAAO,IAAI,CAACP,IAAI,CAACO,IAAI,IAAI,IAAI,CAAA;AACjC,GAAA;EACA,IAAIC,OAAOA,GAAG;IACV,MAAM;AAAEC,MAAAA,KAAK,EAAEC,MAAAA;KAAQ,GAAGC,SAAS,EAAE,CAAA;IACrC,MAAM;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,WAAW,EAAEC,YAAY;AAAEC,MAAAA,MAAM,EAAEC,OAAO;AAAEC,MAAAA,IAAI,EAAEC,KAAK;AAAEC,MAAAA,MAAM,EAAEC,OAAAA;KAAS,GAAGX,MAAM,CAAC;MACrGH,IAAI,EAAE,IAAI,CAACA,IAAI;AACfe,MAAAA,UAAU,EAAE,IAAI,CAACtB,IAAI,CAACsB,UAAAA;AAC1B,KAAC,CAAC,CAAA;IACF,OAAO;MACHV,IAAI,EAAEC,KAAK,EAAE;MACbC,WAAW,EAAEC,YAAY,EAAE;MAC3BC,MAAM,EAAEC,OAAO,EAAE;MACjBC,IAAI,EAAEC,KAAK,EAAE;MACbC,MAAM,EAAEC,OAAO,EAAC;KACnB,CAAA;AACL,GAAA;AA6DJ,CAAA;AAACE,MAAA,GArFoB1B,KAAK,CAAA;AA0BlB2B,oBAAA,CAAAC,kBAAA,CAoDH,8yCAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,OAAA;IAAAC,WAAA;IAAAC,IAAA;IAAAC,WAAA;IAAAC,SAAA;AAAAC,IAAAA,WAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAV,MAAA,CAAA;;;;"}
@@ -7,11 +7,10 @@ import { tracked } from '@glimmer/tracking';
7
7
  import { action } from '@ember/object';
8
8
  import { later } from '@ember/runloop';
9
9
  import { on } from '@ember/modifier';
10
- import { getOwner } from '@ember/application';
11
- import didInsert from '@ember/render-modifiers/modifiers/did-insert';
12
- import willDestroy from '@ember/render-modifiers/modifiers/will-destroy';
10
+ import { getOwner } from '@ember/owner';
13
11
  import { cssTransition } from 'ember-css-transitions';
14
12
  import { useStyles } from '@frontile/theme';
13
+ import { modifier } from 'ember-modifier';
15
14
  import { focusTrap } from 'ember-focus-trap';
16
15
  import { precompileTemplate } from '@ember/template-compilation';
17
16
  import { setComponentTemplate } from '@ember/component';
@@ -77,8 +76,51 @@ let Overlay = (_class = (_class2 = class Overlay extends Component {
77
76
  constructor(...args) {
78
77
  super(...args);
79
78
  _initializerDefineProperty(this, "keepOpen", _descriptor, this);
79
+ _defineProperty(this, "wrapperElement", void 0);
80
+ _defineProperty(this, "backdropElement", void 0);
80
81
  _defineProperty(this, "contentElement", void 0);
81
82
  _defineProperty(this, "mouseDownContentElement", null);
83
+ _defineProperty(this, "setupContent", modifier(el1 => {
84
+ this.contentElement = el1;
85
+ this.keepOpen = true;
86
+ if (this.args.renderInPlace !== true) {
87
+ document.body.style.overflow = 'hidden';
88
+ }
89
+ if (typeof this.args.onOpen === 'function') {
90
+ this.args.onOpen();
91
+ }
92
+ return () => {
93
+ this.contentElement = undefined;
94
+ if (this.args.renderInPlace !== true && document.body.classList) {
95
+ document.body.style.overflow = '';
96
+ }
97
+ let duration1 = this.args.transitionDuration || 200;
98
+ if (this.args.disableTransitions === true) {
99
+ duration1 = 0;
100
+ }
101
+ const {
102
+ didClose: didClose1
103
+ } = this.args;
104
+ later(() => {
105
+ if (!this.isDestroyed) this.keepOpen = false;
106
+ if (typeof didClose1 === 'function' && !this.isDestroyed) {
107
+ didClose1();
108
+ }
109
+ }, duration1);
110
+ };
111
+ }));
112
+ _defineProperty(this, "setupBackdrop", modifier(el1 => {
113
+ this.backdropElement = el1;
114
+ return () => {
115
+ this.backdropElement = undefined;
116
+ };
117
+ }));
118
+ _defineProperty(this, "setupWrapper", modifier(el1 => {
119
+ this.wrapperElement = el1;
120
+ return () => {
121
+ this.wrapperElement = undefined;
122
+ };
123
+ }));
82
124
  }
83
125
  get destinationElement() {
84
126
  const doc1 = getDOM(this);
@@ -102,12 +144,18 @@ let Overlay = (_class = (_class2 = class Overlay extends Component {
102
144
  }
103
145
  get focusTrapOptions() {
104
146
  return this.args.focusTrapOptions || {
105
- allowOutsideClick: true
147
+ allowOutsideClick: e1 => {
148
+ if (e1.target == this.backdropElement || e1.target == this.wrapperElement) {
149
+ return true;
150
+ }
151
+ return false;
152
+ }
106
153
  };
107
154
  }
108
- handleOverlayClick() {
109
- if (this.args.closeOnOutsideClick !== false) {
155
+ handleOverlayClick(e1) {
156
+ if (this.args.closeOnOutsideClick !== false && (e1.target == this.backdropElement || e1.target == this.wrapperElement)) {
110
157
  this.handleClose();
158
+ e1.preventDefault();
111
159
  }
112
160
  }
113
161
  handleContentClick(event1) {
@@ -117,7 +165,7 @@ let Overlay = (_class = (_class2 = class Overlay extends Component {
117
165
  this.mouseDownContentElement = null;
118
166
  }
119
167
  handleClose() {
120
- if (typeof this.args.onClose === 'function') {
168
+ if (this.args.isOpen && typeof this.args.onClose === 'function') {
121
169
  this.args.onClose();
122
170
  }
123
171
  }
@@ -129,35 +177,6 @@ let Overlay = (_class = (_class2 = class Overlay extends Component {
129
177
  this.handleClose();
130
178
  }
131
179
  }
132
- setup(element1) {
133
- this.contentElement = element1;
134
- this.keepOpen = true;
135
- if (this.args.renderInPlace !== true) {
136
- document.body.style.overflow = 'hidden';
137
- }
138
- if (typeof this.args.onOpen === 'function') {
139
- this.args.onOpen();
140
- }
141
- }
142
- teardown() {
143
- this.contentElement = undefined;
144
- if (this.args.renderInPlace !== true && document.body.classList) {
145
- document.body.style.overflow = '';
146
- }
147
- let duration1 = this.args.transitionDuration || 200;
148
- if (this.args.disableTransitions === true) {
149
- duration1 = 0;
150
- }
151
- const {
152
- didClose: didClose1
153
- } = this.args;
154
- later(() => {
155
- if (!this.isDestroyed) this.keepOpen = false;
156
- if (typeof didClose1 === 'function' && !this.isDestroyed) {
157
- didClose1();
158
- }
159
- }, duration1);
160
- }
161
180
  get classes() {
162
181
  const {
163
182
  overlay: overlay1
@@ -167,22 +186,29 @@ let Overlay = (_class = (_class2 = class Overlay extends Component {
167
186
  backdrop: backdrop1,
168
187
  content: content1
169
188
  } = overlay1({
170
- inPlace: this.args.renderInPlace
189
+ inPlace: this.args.renderInPlace,
190
+ enableFlexContent: !(this.args.disableFlexContent === true)
171
191
  });
172
192
  return {
173
193
  base: base1(),
174
194
  backdrop: backdrop1(),
175
- content: content1()
195
+ content: content1({
196
+ class: this.args.contentClass
197
+ })
176
198
  };
177
199
  }
178
- }, setComponentTemplate(precompileTemplate("\n {{#if this.isVisible}}\n <MaybeInElement @renderInPlace={{@renderInPlace}} @destinationElement={{this.destinationElement}}>\n <div class={{this.classes.base}} ...attributes {{focusTrap isActive=(if @disableFocusTrap false @isOpen) focusTrapOptions=this.focusTrapOptions}}>\n {{!-- template-lint-disable no-invalid-interactive --}}\n {{#if this.isBackdropVisible}}\n <div class={{this.classes.backdrop}} {{on \"click\" this.handleOverlayClick}} {{cssTransition (if @backdropTransitionName @backdropTransitionName \"overlay-transition--fade\") isEnabled=this.isAnimationEnabled}}></div>\n {{/if}}\n\n {{!--\n This is required to make css-transition work with 2\n sibling elements been removed at the same time.\n --}}\n <span data-is-visible={{this.isVisible}}></span>\n\n {{#if @isOpen}}\n {{!-- template-lint-disable no-pointer-down-event-binding --}}\n <div class={{this.classes.content}} {{on \"click\" this.handleContentClick}} {{on \"keydown\" this.handleKeyDown}} {{on \"mousedown\" this.handleContentMouseDown}} {{didInsert this.setup}} {{willDestroy this.teardown}} {{cssTransition (if @contentTransitionName @contentTransitionName \"overlay-transition--fade\") isEnabled=this.isAnimationEnabled}}>\n {{!-- template-lint-enable no-pointer-down-event-binding --}}\n {{yield}}\n </div>\n {{/if}}\n {{!-- template-lint-enable no-invalid-interactive --}}\n </div>\n </MaybeInElement>\n {{/if}}\n ", {
200
+ get customContentModifier() {
201
+ if (this.args.customContentModifier) {
202
+ return this.args.customContentModifier;
203
+ }
204
+ return modifier(() => {});
205
+ }
206
+ }, setComponentTemplate(precompileTemplate("\n {{#if this.isVisible}}\n <MaybeInElement @renderInPlace={{@renderInPlace}} @destinationElement={{this.destinationElement}}>\n <div {{this.setupWrapper}} class={{this.classes.base}} {{on \"click\" this.handleOverlayClick}} ...attributes>\n\n {{!-- template-lint-disable no-invalid-interactive --}}\n {{#if this.isBackdropVisible}}\n <div {{this.setupBackdrop}} {{on \"click\" this.handleOverlayClick}} {{cssTransition (if @backdropTransitionName @backdropTransitionName \"overlay-transition--fade\") isEnabled=this.isAnimationEnabled}} class={{this.classes.backdrop}}></div>\n {{/if}}\n\n {{!--\n This is required to make css-transition work with 2\n sibling elements been removed at the same time.\n --}}\n <span data-is-visible={{this.isVisible}}></span>\n\n {{#if @isOpen}}\n {{!-- template-lint-disable no-pointer-down-event-binding --}}\n <div {{this.setupContent}} {{on \"click\" this.handleContentClick}} {{on \"keydown\" this.handleKeyDown}} {{on \"mousedown\" this.handleContentMouseDown}} {{cssTransition (if @contentTransitionName @contentTransitionName \"overlay-transition--fade\") isEnabled=this.isAnimationEnabled}} {{focusTrap isActive=(if @disableFocusTrap false @isOpen) focusTrapOptions=this.focusTrapOptions}} class={{this.classes.content}} {{!-- Keep this custom modifer by last--}} {{this.customContentModifier}}>\n {{!-- template-lint-enable no-pointer-down-event-binding --}}\n {{yield}}\n </div>\n {{/if}}\n {{!-- template-lint-enable no-invalid-interactive --}}\n </div>\n </MaybeInElement>\n {{/if}}\n ", {
179
207
  scope: () => ({
180
208
  MaybeInElement,
181
- focusTrap,
182
209
  on,
183
210
  cssTransition,
184
- didInsert,
185
- willDestroy
211
+ focusTrap
186
212
  }),
187
213
  strictMode: true
188
214
  }), _class2), _class2), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "keepOpen", [tracked], {
@@ -192,7 +218,7 @@ let Overlay = (_class = (_class2 = class Overlay extends Component {
192
218
  initializer: function () {
193
219
  return false;
194
220
  }
195
- }), _applyDecoratedDescriptor(_class.prototype, "handleOverlayClick", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleOverlayClick"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleContentClick", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleContentClick"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleClose", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleClose"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleContentMouseDown", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleContentMouseDown"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleKeyDown", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleKeyDown"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "setup", [action], Object.getOwnPropertyDescriptor(_class.prototype, "setup"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "teardown", [action], Object.getOwnPropertyDescriptor(_class.prototype, "teardown"), _class.prototype)), _class);
221
+ }), _applyDecoratedDescriptor(_class.prototype, "handleOverlayClick", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleOverlayClick"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleContentClick", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleContentClick"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleClose", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleClose"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleContentMouseDown", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleContentMouseDown"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, "handleKeyDown", [action], Object.getOwnPropertyDescriptor(_class.prototype, "handleKeyDown"), _class.prototype)), _class);
196
222
 
197
223
  export { Overlay as default };
198
224
  //# sourceMappingURL=overlay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.js","sources":["../../src/-private/dom.js","../../src/components/overlay.gts"],"sourcesContent":["import { getOwner } from '@ember/application';\n\n// adjusted from https://github.com/yapplabs/ember-wormhole/blob/0.5.4/addon/utils/dom.js#L45-L63\n// Copied from https://github.com/ember-intl/ember-intl/blob/a66560d0af9f08af20778a3eb3003045e19fbf16/addon/-private/utils/get-dom.js\n//\n// Private Ember API usage. Get the dom implementation used by the current\n// renderer, be it native browser DOM or Fastboot SimpleDOM\n/**\n * @private\n * @hide\n */\nexport function getDOM(context) {\n let { renderer } = context;\n if (!renderer || !renderer._dom) {\n // pre glimmer2\n const container = getOwner ? getOwner(context) : context.container;\n const documentService = container.lookup('service:-document');\n\n if (documentService) {\n return documentService;\n }\n\n renderer = container.lookup('renderer:-dom');\n }\n\n if (renderer._dom && renderer._dom.document) {\n // pre Ember 2.6\n return renderer._dom.document;\n }\n\n return null;\n}\n\nfunction childNodesOfElement(element) {\n const children = [];\n let child = element.firstChild;\n while (child) {\n children.push(child);\n child = child.nextSibling;\n }\n return children;\n}\n\nexport function getElementById(doc, id) {\n if (doc.getElementById) {\n return doc.getElementById(id);\n }\n\n let nodes = childNodesOfElement(doc);\n let node;\n\n while (nodes.length) {\n node = nodes.shift();\n\n if (node.getAttribute && node.getAttribute('id') === id) {\n return node;\n }\n\n nodes = childNodesOfElement(node).concat(nodes);\n }\n}\n","import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { later } from '@ember/runloop';\nimport { on } from '@ember/modifier';\nimport { getDOM, getElementById } from '../-private/dom';\nimport didInsert from '@ember/render-modifiers/modifiers/did-insert';\nimport willDestroy from '@ember/render-modifiers/modifiers/will-destroy';\nimport { cssTransition } from 'ember-css-transitions';\nimport { useStyles } from '@frontile/theme';\n// @ts-ignore\nimport { focusTrap } from 'ember-focus-trap';\nimport type { TOC } from '@ember/component/template-only';\nconst MaybeInElement: TOC<{\n Args: {\n destinationElement?: Element | null;\n renderInPlace?: boolean;\n };\n Blocks: {\n default: [];\n };\n}> = template(`\n {{#if @renderInPlace}}\n {{yield}}\n {{else if @destinationElement}}\n {{#in-element @destinationElement insertBefore=null}}\n {{yield}}\n {{/in-element}}\n {{/if}}\n`, {\n eval () {\n return eval(arguments[0]);\n }\n});\nexport interface OverlayArgs {\n /**\n * Whether to render in place or in the specified/default destination\n *\n * @defaultValue false\n */ renderInPlace?: boolean;\n /**\n * The destination where the overlay will be inserted, defaults to\n * `document.body`\n *\n * @defaultValue undefined\n */ destinationElementId?: string;\n /**\n * Duration of the animation\n *\n * @defaultValue 200\n */ transitionDuration?: number;\n /**\n * Whether to hide the backdrop or not\n *\n * @defaultValue false\n */ disableBackdrop?: boolean;\n /**\n * Disable css transitions\n *\n * @defaultValue false\n */ disableTransitions?: boolean;\n /**\n * Whether the focus trap is disabled or not\n *\n * @defaultValue false\n */ disableFocusTrap?: boolean;\n /**\n * Focus trap options\n *\n * @defaultValue { allowOutsideClick: true }\n */ focusTrapOptions?: unknown;\n /**\n * Whether it is open or not\n */ isOpen: boolean;\n /**\n * A function that will be called when closed\n */ onClose?: () => void;\n /**\n * A function that will be called when closing is finished executing, this\n * includes waiting for animations/transitions to finish.\n */ didClose?: () => void;\n /**\n * A function that will be called when opened\n */ onOpen?: () => void;\n /**\n * Whether to close when the area outside (the backdrop) is clicked\n *\n * @defaultValue true\n */ closeOnOutsideClick?: boolean;\n /**\n * Whether to close when the escape key is pressed\n *\n * @defaultValue true\n */ closeOnEscapeKey?: boolean;\n /**\n * The name of the transition to be used in the backdrop.\n *\n * @defaultValue 'overlay-transition--fade'\n */ backdropTransitionName?: string;\n /**\n * The name of the transition to be used in the content.\n *\n * @defaultValue 'overlay-transition--fade'\n */ contentTransitionName?: string;\n}\nexport interface OverlaySignature {\n Args: OverlayArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\nexport default class Overlay extends Component<OverlaySignature> {\n @tracked\n keepOpen = false;\n contentElement: HTMLElement | undefined;\n mouseDownContentElement: EventTarget | null = null;\n get destinationElement(): HTMLElement | null {\n const doc1 = getDOM(this);\n if (!doc1) {\n return null;\n }\n if (this.args.destinationElementId) {\n return getElementById(doc1, this.args.destinationElementId);\n } else {\n return doc1.body;\n }\n }\n get isVisible(): boolean {\n return this.args.isOpen || this.keepOpen;\n }\n get isBackdropVisible(): boolean {\n return Boolean(this.args.isOpen && this.args.disableBackdrop !== true);\n }\n get isAnimationEnabled(): boolean {\n return !(this.args.disableTransitions === true);\n }\n get focusTrapOptions(): unknown {\n return this.args.focusTrapOptions || {\n allowOutsideClick: true\n };\n }\n @action\n handleOverlayClick(): void {\n if (this.args.closeOnOutsideClick !== false) {\n this.handleClose();\n }\n }\n @action\n handleContentClick(event1: MouseEvent): void {\n if (this.args.closeOnOutsideClick !== false && event1.target === this.contentElement && this.mouseDownContentElement == this.contentElement) {\n this.handleClose();\n }\n this.mouseDownContentElement = null;\n }\n @action\n handleClose(): void {\n if (typeof this.args.onClose === 'function') {\n this.args.onClose();\n }\n }\n @action\n handleContentMouseDown(event1: MouseEvent): void {\n this.mouseDownContentElement = event1.target;\n }\n @action\n handleKeyDown(event1: KeyboardEvent): void {\n if (event1.key === 'Escape' && this.args.closeOnEscapeKey !== false) {\n this.handleClose();\n }\n }\n @action\n setup(element1: HTMLElement): void {\n this.contentElement = element1;\n this.keepOpen = true;\n if (this.args.renderInPlace !== true) {\n document.body.style.overflow = 'hidden';\n }\n if (typeof this.args.onOpen === 'function') {\n this.args.onOpen();\n }\n }\n @action\n teardown(): void {\n this.contentElement = undefined;\n if (this.args.renderInPlace !== true && document.body.classList) {\n document.body.style.overflow = '';\n }\n let duration1 = this.args.transitionDuration || 200;\n if (this.args.disableTransitions === true) {\n duration1 = 0;\n }\n const { didClose: didClose1 } = this.args;\n later(()=>{\n if (!this.isDestroyed) this.keepOpen = false;\n if (typeof didClose1 === 'function' && !this.isDestroyed) {\n didClose1();\n }\n }, duration1);\n }\n get classes() {\n const { overlay: overlay1 } = useStyles();\n const { base: base1, backdrop: backdrop1, content: content1 } = overlay1({\n inPlace: this.args.renderInPlace\n });\n return {\n base: base1(),\n backdrop: backdrop1(),\n content: content1()\n };\n }\n static{\n template(`\n {{#if this.isVisible}}\n <MaybeInElement\n @renderInPlace={{@renderInPlace}}\n @destinationElement={{this.destinationElement}}\n >\n <div\n class={{this.classes.base}}\n ...attributes\n {{focusTrap\n isActive=(if @disableFocusTrap false @isOpen)\n focusTrapOptions=this.focusTrapOptions\n }}\n >\n {{! template-lint-disable no-invalid-interactive }}\n {{#if this.isBackdropVisible}}\n <div\n class={{this.classes.backdrop}}\n {{on \"click\" this.handleOverlayClick}}\n {{cssTransition\n (if\n @backdropTransitionName\n @backdropTransitionName\n \"overlay-transition--fade\"\n )\n isEnabled=this.isAnimationEnabled\n }}\n ></div>\n {{/if}}\n\n {{!\n This is required to make css-transition work with 2\n sibling elements been removed at the same time.\n }}\n <span data-is-visible={{this.isVisible}}></span>\n\n {{#if @isOpen}}\n {{! template-lint-disable no-pointer-down-event-binding }}\n <div\n class={{this.classes.content}}\n {{on \"click\" this.handleContentClick}}\n {{on \"keydown\" this.handleKeyDown}}\n {{on \"mousedown\" this.handleContentMouseDown}}\n {{didInsert this.setup}}\n {{willDestroy this.teardown}}\n {{cssTransition\n (if\n @contentTransitionName\n @contentTransitionName\n \"overlay-transition--fade\"\n )\n isEnabled=this.isAnimationEnabled\n }}\n >\n {{! template-lint-enable no-pointer-down-event-binding }}\n {{yield}}\n </div>\n {{/if}}\n {{! template-lint-enable no-invalid-interactive }}\n </div>\n </MaybeInElement>\n {{/if}}\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["getDOM","context","renderer","_dom","container","getOwner","documentService","lookup","document","childNodesOfElement","element","children","child","firstChild","push","nextSibling","getElementById","doc","id","nodes","node","length","shift","getAttribute","concat","MaybeInElement","setComponentTemplate","precompileTemplate","strictMode","templateOnly","Overlay","_class","_class2","Component","constructor","args","_initializerDefineProperty","_descriptor","_defineProperty","destinationElement","doc1","destinationElementId","body","isVisible","isOpen","keepOpen","isBackdropVisible","Boolean","disableBackdrop","isAnimationEnabled","disableTransitions","focusTrapOptions","allowOutsideClick","handleOverlayClick","closeOnOutsideClick","handleClose","handleContentClick","event1","target","contentElement","mouseDownContentElement","onClose","handleContentMouseDown","handleKeyDown","key","closeOnEscapeKey","setup","element1","renderInPlace","style","overflow","onOpen","teardown","undefined","classList","duration1","transitionDuration","didClose","didClose1","later","isDestroyed","classes","overlay","overlay1","useStyles","base","base1","backdrop","backdrop1","content","content1","inPlace","scope","focusTrap","on","cssTransition","didInsert","willDestroy","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,MAAMA,CAACC,OAAO,EAAE;EAC9B,IAAI;AAAEC,IAAAA,QAAAA;AAAS,GAAC,GAAGD,OAAO,CAAA;AAC1B,EAAA,IAAI,CAACC,QAAQ,IAAI,CAACA,QAAQ,CAACC,IAAI,EAAE;AAC/B;IACA,MAAMC,SAAS,GAAGC,QAAQ,GAAGA,QAAQ,CAACJ,OAAO,CAAC,GAAGA,OAAO,CAACG,SAAS,CAAA;AAClE,IAAA,MAAME,eAAe,GAAGF,SAAS,CAACG,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAE7D,IAAA,IAAID,eAAe,EAAE;AACnB,MAAA,OAAOA,eAAe,CAAA;AACxB,KAAA;AAEAJ,IAAAA,QAAQ,GAAGE,SAAS,CAACG,MAAM,CAAC,eAAe,CAAC,CAAA;AAC9C,GAAA;EAEA,IAAIL,QAAQ,CAACC,IAAI,IAAID,QAAQ,CAACC,IAAI,CAACK,QAAQ,EAAE;AAC3C;AACA,IAAA,OAAON,QAAQ,CAACC,IAAI,CAACK,QAAQ,CAAA;AAC/B,GAAA;AAEA,EAAA,OAAO,IAAI,CAAA;AACb,CAAA;AAEA,SAASC,mBAAmBA,CAACC,OAAO,EAAE;EACpC,MAAMC,QAAQ,GAAG,EAAE,CAAA;AACnB,EAAA,IAAIC,KAAK,GAAGF,OAAO,CAACG,UAAU,CAAA;AAC9B,EAAA,OAAOD,KAAK,EAAE;A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AA,wBAAA,CAAA,EAAApE,MAAA,CAAAoE,SAAA,CAAAD,EAAAA,yBAAA,CAAAnE,MAAA,CAAAoE,SAAA,oBAINM,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAA5E,MAAA,CAAAoE,SAAA,EAAApE,eAAAA,CAAAA,EAAAA,MAAA,CAAAoE,SAAA,CAAAD,EAAAA,yBAAA,CAAAnE,MAAA,CAAAoE,SAAA,EAAA,OAAA,EAAA,CAMNM,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAA5E,MAAA,CAAAoE,SAAA,EAAApE,OAAAA,CAAAA,EAAAA,MAAA,CAAAoE,SAAA,CAAAD,EAAAA,yBAAA,CAAAnE,MAAA,CAAAoE,SAAA,EAAA,UAAA,EAAA,CAWNM,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAA5E,MAAA,CAAAoE,SAAA,EAAApE,UAAAA,CAAAA,EAAAA,MAAA,CAAAoE,SAAA,IAAApE,MAAA;;;;"}
1
+ {"version":3,"file":"overlay.js","sources":["../../src/-private/dom.js","../../src/components/overlay.gts"],"sourcesContent":["import { getOwner } from '@ember/owner';\n\n// adjusted from https://github.com/yapplabs/ember-wormhole/blob/0.5.4/addon/utils/dom.js#L45-L63\n// Copied from https://github.com/ember-intl/ember-intl/blob/a66560d0af9f08af20778a3eb3003045e19fbf16/addon/-private/utils/get-dom.js\n//\n// Private Ember API usage. Get the dom implementation used by the current\n// renderer, be it native browser DOM or Fastboot SimpleDOM\n/**\n * @private\n * @hide\n */\nexport function getDOM(context) {\n let { renderer } = context;\n if (!renderer || !renderer._dom) {\n // pre glimmer2\n const container = getOwner ? getOwner(context) : context.container;\n const documentService = container.lookup('service:-document');\n\n if (documentService) {\n return documentService;\n }\n\n renderer = container.lookup('renderer:-dom');\n }\n\n if (renderer._dom && renderer._dom.document) {\n // pre Ember 2.6\n return renderer._dom.document;\n }\n\n return null;\n}\n\nfunction childNodesOfElement(element) {\n const children = [];\n let child = element.firstChild;\n while (child) {\n children.push(child);\n child = child.nextSibling;\n }\n return children;\n}\n\nexport function getElementById(doc, id) {\n if (doc.getElementById) {\n return doc.getElementById(id);\n }\n\n let nodes = childNodesOfElement(doc);\n let node;\n\n while (nodes.length) {\n node = nodes.shift();\n\n if (node.getAttribute && node.getAttribute('id') === id) {\n return node;\n }\n\n nodes = childNodesOfElement(node).concat(nodes);\n }\n}\n","/* eslint-disable ember/no-runloop */ import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { action } from '@ember/object';\nimport { later } from '@ember/runloop';\nimport { on } from '@ember/modifier';\nimport { getDOM, getElementById } from '../-private/dom';\nimport { cssTransition } from 'ember-css-transitions';\nimport { useStyles } from '@frontile/theme';\nimport { modifier } from 'ember-modifier';\n// @ts-ignore\nimport { focusTrap } from 'ember-focus-trap';\nimport type { TOC } from '@ember/component/template-only';\nimport type { ModifierLike } from '@glint/template';\nconst MaybeInElement: TOC<{\n Args: {\n destinationElement?: Element | null;\n renderInPlace?: boolean;\n };\n Blocks: {\n default: [];\n };\n}> = template(`\n {{#if @renderInPlace}}\n {{yield}}\n {{else if @destinationElement}}\n {{#in-element @destinationElement insertBefore=null}}\n {{yield}}\n {{/in-element}}\n {{/if}}\n`, {\n eval () {\n return eval(arguments[0]);\n }\n});\nexport interface OverlayArgs {\n /**\n * Whether to render in place or in the specified/default destination\n *\n * @defaultValue false\n */ renderInPlace?: boolean;\n /**\n * The destination where the overlay will be inserted, defaults to\n * `document.body`\n *\n * @defaultValue undefined\n */ destinationElementId?: string;\n /**\n * Duration of the animation\n *\n * @defaultValue 200\n */ transitionDuration?: number;\n /**\n * Whether to hide the backdrop or not\n *\n * @defaultValue false\n */ disableBackdrop?: boolean;\n /**\n * Disable css transitions\n *\n * @defaultValue false\n */ disableTransitions?: boolean;\n /**\n * Whether the focus trap is disabled or not\n *\n * @defaultValue false\n */ disableFocusTrap?: boolean;\n /**\n * Focus trap options\n *\n * @defaultValue { allowOutsideClick: true }\n */ focusTrapOptions?: unknown;\n /**\n * Whether it is open or not\n */ isOpen: boolean;\n /**\n * A function that will be called when closed\n */ onClose?: () => void;\n /**\n * A function that will be called when closing is finished executing, this\n * includes waiting for animations/transitions to finish.\n */ didClose?: () => void;\n /**\n * A function that will be called when opened\n */ onOpen?: () => void;\n /**\n * Whether to close when the area outside (the backdrop) is clicked\n *\n * @defaultValue true\n */ closeOnOutsideClick?: boolean;\n /**\n * Whether to close when the escape key is pressed\n *\n * @defaultValue true\n */ closeOnEscapeKey?: boolean;\n /**\n * The name of the transition to be used in the backdrop.\n *\n * @defaultValue 'overlay-transition--fade'\n */ backdropTransitionName?: string;\n /**\n * The name of the transition to be used in the content.\n *\n * @defaultValue 'overlay-transition--fade'\n */ contentTransitionName?: string;\n disableFlexContent?: boolean;\n customContentModifier?: ModifierLike<{\n Element: HTMLElement;\n }>;\n contentClass?: string;\n}\nexport interface OverlaySignature {\n Args: OverlayArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\nexport default class Overlay extends Component<OverlaySignature> {\n @tracked\n keepOpen = false;\n wrapperElement: HTMLElement | undefined;\n backdropElement: HTMLElement | undefined;\n contentElement: HTMLElement | undefined;\n mouseDownContentElement: EventTarget | null = null;\n get destinationElement(): HTMLElement | null {\n const doc1 = getDOM(this);\n if (!doc1) {\n return null;\n }\n if (this.args.destinationElementId) {\n return getElementById(doc1, this.args.destinationElementId);\n } else {\n return doc1.body;\n }\n }\n get isVisible(): boolean {\n return this.args.isOpen || this.keepOpen;\n }\n get isBackdropVisible(): boolean {\n return Boolean(this.args.isOpen && this.args.disableBackdrop !== true);\n }\n get isAnimationEnabled(): boolean {\n return !(this.args.disableTransitions === true);\n }\n get focusTrapOptions(): unknown {\n return (this.args.focusTrapOptions || {\n allowOutsideClick: (e1: MouseEvent)=>{\n if (e1.target == this.backdropElement || e1.target == this.wrapperElement) {\n return true;\n }\n return false;\n }\n });\n }\n @action\n handleOverlayClick(e1: MouseEvent): void {\n if (this.args.closeOnOutsideClick !== false && (e1.target == this.backdropElement || e1.target == this.wrapperElement)) {\n this.handleClose();\n e1.preventDefault();\n }\n }\n @action\n handleContentClick(event1: MouseEvent): void {\n if (this.args.closeOnOutsideClick !== false && event1.target === this.contentElement && this.mouseDownContentElement == this.contentElement) {\n this.handleClose();\n }\n this.mouseDownContentElement = null;\n }\n @action\n handleClose(): void {\n if (this.args.isOpen && typeof this.args.onClose === 'function') {\n this.args.onClose();\n }\n }\n @action\n handleContentMouseDown(event1: MouseEvent): void {\n this.mouseDownContentElement = event1.target;\n }\n @action\n handleKeyDown(event1: KeyboardEvent): void {\n if (event1.key === 'Escape' && this.args.closeOnEscapeKey !== false) {\n this.handleClose();\n }\n }\n setupContent = modifier((el1: HTMLDivElement)=>{\n this.contentElement = el1;\n this.keepOpen = true;\n if (this.args.renderInPlace !== true) {\n document.body.style.overflow = 'hidden';\n }\n if (typeof this.args.onOpen === 'function') {\n this.args.onOpen();\n }\n return ()=>{\n this.contentElement = undefined;\n if (this.args.renderInPlace !== true && document.body.classList) {\n document.body.style.overflow = '';\n }\n let duration1 = this.args.transitionDuration || 200;\n if (this.args.disableTransitions === true) {\n duration1 = 0;\n }\n const { didClose: didClose1 } = this.args;\n later(()=>{\n if (!this.isDestroyed) this.keepOpen = false;\n if (typeof didClose1 === 'function' && !this.isDestroyed) {\n didClose1();\n }\n }, duration1);\n };\n });\n setupBackdrop = modifier((el1: HTMLDivElement)=>{\n this.backdropElement = el1;\n return ()=>{\n this.backdropElement = undefined;\n };\n });\n setupWrapper = modifier((el1: HTMLDivElement)=>{\n this.wrapperElement = el1;\n return ()=>{\n this.wrapperElement = undefined;\n };\n });\n get classes() {\n const { overlay: overlay1 } = useStyles();\n const { base: base1, backdrop: backdrop1, content: content1 } = overlay1({\n inPlace: this.args.renderInPlace,\n enableFlexContent: !(this.args.disableFlexContent === true)\n });\n return {\n base: base1(),\n backdrop: backdrop1(),\n content: content1({\n class: this.args.contentClass\n })\n };\n }\n get customContentModifier() {\n if (this.args.customContentModifier) {\n return this.args.customContentModifier;\n }\n return modifier(()=>{});\n }\n static{\n template(`\n {{#if this.isVisible}}\n <MaybeInElement\n @renderInPlace={{@renderInPlace}}\n @destinationElement={{this.destinationElement}}\n >\n <div\n {{this.setupWrapper}}\n class={{this.classes.base}}\n {{on \"click\" this.handleOverlayClick}}\n ...attributes\n >\n\n {{! template-lint-disable no-invalid-interactive }}\n {{#if this.isBackdropVisible}}\n <div\n {{this.setupBackdrop}}\n {{on \"click\" this.handleOverlayClick}}\n {{cssTransition\n (if\n @backdropTransitionName\n @backdropTransitionName\n \"overlay-transition--fade\"\n )\n isEnabled=this.isAnimationEnabled\n }}\n class={{this.classes.backdrop}}\n ></div>\n {{/if}}\n\n {{!\n This is required to make css-transition work with 2\n sibling elements been removed at the same time.\n }}\n <span data-is-visible={{this.isVisible}}></span>\n\n {{#if @isOpen}}\n {{! template-lint-disable no-pointer-down-event-binding }}\n <div\n {{this.setupContent}}\n {{on \"click\" this.handleContentClick}}\n {{on \"keydown\" this.handleKeyDown}}\n {{on \"mousedown\" this.handleContentMouseDown}}\n {{cssTransition\n (if\n @contentTransitionName\n @contentTransitionName\n \"overlay-transition--fade\"\n )\n isEnabled=this.isAnimationEnabled\n }}\n {{focusTrap\n isActive=(if @disableFocusTrap false @isOpen)\n focusTrapOptions=this.focusTrapOptions\n }}\n class={{this.classes.content}}\n {{! Keep this custom modifer by last}}\n {{this.customContentModifier}}\n >\n {{! template-lint-enable no-pointer-down-event-binding }}\n {{yield}}\n </div>\n {{/if}}\n {{! template-lint-enable no-invalid-interactive }}\n </div>\n </MaybeInElement>\n {{/if}}\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n}\n"],"names":["getDOM","context","renderer","_dom","container","getOwner","documentService","lookup","document","childNodesOfElement","element","children","child","firstChild","push","nextSibling","getElementById","doc","id","nodes","node","length","shift","getAttribute","concat","MaybeInElement","setComponentTemplate","precompileTemplate","strictMode","templateOnly","Overlay","_class","_class2","Component","constructor","args","_initializerDefineProperty","_descriptor","_defineProperty","modifier","el1","contentElement","keepOpen","renderInPlace","body","style","overflow","onOpen","undefined","classList","duration1","transitionDuration","disableTransitions","didClose","didClose1","later","isDestroyed","backdropElement","wrapperElement","destinationElement","doc1","destinationElementId","isVisible","isOpen","isBackdropVisible","Boolean","disableBackdrop","isAnimationEnabled","focusTrapOptions","allowOutsideClick","e1","target","handleOverlayClick","closeOnOutsideClick","handleClose","preventDefault","handleContentClick","event1","mouseDownContentElement","onClose","handleContentMouseDown","handleKeyDown","key","closeOnEscapeKey","classes","overlay","overlay1","useStyles","base","base1","backdrop","backdrop1","content","content1","inPlace","enableFlexContent","disableFlexContent","class","contentClass","customContentModifier","scope","on","cssTransition","focusTrap","_applyDecoratedDescriptor","prototype","tracked","configurable","enumerable","writable","initializer","action","Object","getOwnPropertyDescriptor"],"mappings":";;;;;;;;;;;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,MAAMA,CAACC,OAAO,EAAE;EAC9B,IAAI;AAAEC,IAAAA,QAAAA;AAAS,GAAC,GAAGD,OAAO,CAAA;AAC1B,EAAA,IAAI,CAACC,QAAQ,IAAI,CAACA,QAAQ,CAACC,IAAI,EAAE;AAC/B;IACA,MAAMC,SAAS,GAAGC,QAAQ,GAAGA,QAAQ,CAACJ,OAAO,CAAC,GAAGA,OAAO,CAACG,SAAS,CAAA;AAClE,IAAA,MAAME,eAAe,GAAGF,SAAS,CAACG,MAAM,CAAC,mBAAmB,CAAC,CAAA;AAE7D,IAAA,IAAID,eAAe,EAAE;AACnB,MAAA,OAAOA,eAAe,CAAA;AACxB,KAAA;AAEAJ,IAAAA,QAAQ,GAAGE,SAAS,CAACG,MAAM,CAAC,eAAe,CAAC,CAAA;AAC9C,GAAA;EAEA,IAAIL,QAAQ,CAACC,IAAI,IAAID,QAAQ,CAACC,IAAI,CAACK,QAAQ,EAAE;AAC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E,MAAA,CAAA0E,SAAA,EAONM,oBAAAA,EAAAA,CAAAA,MAAM,GAAAC,MAAA,CAAAC,wBAAA,CAAAlF,MAAA,CAAA0E,SAAA,EAAA1E,oBAAAA,CAAAA,EAAAA,MAAA,CAAA0E,SAAA,CAAA,EAAAD,yBAAA,CAAAzE,MAAA,CAAA0E,SAAA,EAAA,aAAA,EAAA,CAONM,MAAM,CAAA,EAAAC,MAAA,CAAAC,wBAAA,CAAAlF,MAAA,CAAA0E,SAAA,EAAA,aAAA,CAAA,EAAA1E,MAAA,CAAA0E,SAAA,CAAAD,EAAAA,yBAAA,CAAAzE,MAAA,CAAA0E,SAAA,EAAA,wBAAA,EAAA,CAMNM,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAlF,MAAA,CAAA0E,SAAA,EAAA,wBAAA,CAAA,EAAA1E,MAAA,CAAA0E,SAAA,GAAAD,yBAAA,CAAAzE,MAAA,CAAA0E,SAAA,EAINM,eAAAA,EAAAA,CAAAA,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAlF,MAAA,CAAA0E,SAAA,oBAAA1E,MAAA,CAAA0E,SAAA,CAAA,GAAA1E,MAAA;;;;"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ export { default as Overlay } from './components/overlay.js';
2
+ export { default as Modal } from './components/modal.js';
3
+ export { default as Drawer } from './components/drawer.js';
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontile/overlays",
3
- "version": "0.17.0-alpha.2",
3
+ "version": "0.17.0-alpha.5",
4
4
  "description": "Component Library for Ember Octane apps: overlays",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -40,34 +40,34 @@
40
40
  "ember-source": "^4.0.0 || ^5.0.0"
41
41
  },
42
42
  "dependencies": {
43
- "@ember/render-modifiers": "^2.1.0",
44
43
  "@embroider/addon-shim": "^1.8.7",
45
- "@frontile/core": "^0.17.0-alpha.2",
46
- "@frontile/theme": "^0.17.0-alpha.2",
47
- "@glint/template": "1.2.1",
44
+ "@frontile/buttons": "0.17.0-alpha.5",
45
+ "@frontile/theme": "0.17.0-alpha.5",
46
+ "@glint/template": "1.3.0",
48
47
  "ember-css-transitions": "^4.4.0",
49
- "ember-focus-trap": "^1.0.2"
48
+ "ember-focus-trap": "^1.1.0",
49
+ "ember-modifier": "^4.1.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@babel/core": "7.23.6",
52
+ "@babel/core": "7.23.7",
53
53
  "@babel/plugin-proposal-class-properties": "7.18.6",
54
- "@babel/plugin-proposal-decorators": "7.23.6",
54
+ "@babel/plugin-proposal-decorators": "7.23.7",
55
55
  "@babel/plugin-transform-class-static-block": "^7.23.4",
56
56
  "@babel/preset-typescript": "7.23.3",
57
57
  "@embroider/addon-dev": "4.1.3",
58
58
  "@glimmer/component": "^1.1.2",
59
59
  "@glimmer/tracking": "^1.1.2",
60
- "@glint/core": "1.2.1",
61
- "@glint/environment-ember-loose": "1.2.1",
62
- "@glint/environment-ember-template-imports": "1.2.1",
60
+ "@glint/core": "1.3.0",
61
+ "@glint/environment-ember-loose": "1.3.0",
62
+ "@glint/environment-ember-template-imports": "1.3.0",
63
63
  "@rollup/plugin-node-resolve": "^15.2.3",
64
64
  "@tsconfig/ember": "^3.0.3",
65
65
  "babel-plugin-ember-template-compilation": "^2.2.1",
66
- "concurrently": "^8.2.0",
66
+ "concurrently": "^8.2.2",
67
67
  "ember-source": "^5.5.0",
68
- "rollup": "^4.9.1",
68
+ "rollup": "^4.9.6",
69
69
  "rollup-plugin-ts": "^3.4.5",
70
- "tailwindcss": "^3.3.3",
70
+ "tailwindcss": "^3.4.1",
71
71
  "typescript": "^5.3.3"
72
72
  },
73
73
  "engines": {
@@ -113,5 +113,5 @@
113
113
  ]
114
114
  }
115
115
  },
116
- "gitHead": "d5fbed6f98dc1b5d3f099ab0e16197e83a1f58fd"
116
+ "gitHead": "7e01670d8d6f8f3f807ab292f5a64694bcbc1fc7"
117
117
  }