@frontile/overlays 0.17.0-alpha.3 → 0.17.0-alpha.6

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.
@@ -1,117 +1,163 @@
1
1
  import Component from '@glimmer/component';
2
- export interface OverlayArgs {
3
- /**
4
- * Whether to render in place or in the specified/default destination
5
- *
6
- * @defaultValue false
7
- */
8
- renderInPlace?: boolean;
9
- /**
10
- * The destination where the overlay will be inserted, defaults to
11
- * `document.body`
12
- *
13
- * @defaultValue undefined
14
- */
15
- destinationElementId?: string;
16
- /**
17
- * Duration of the animation
18
- *
19
- * @defaultValue 200
20
- */
21
- transitionDuration?: number;
22
- /**
23
- * Whether to hide the backdrop or not
24
- *
25
- * @defaultValue false
26
- */
27
- disableBackdrop?: boolean;
28
- /**
29
- * Disable css transitions
30
- *
31
- * @defaultValue false
32
- */
33
- disableTransitions?: boolean;
34
- /**
35
- * Whether the focus trap is disabled or not
36
- *
37
- * @defaultValue false
38
- */
39
- disableFocusTrap?: boolean;
40
- /**
41
- * Focus trap options
42
- *
43
- * @defaultValue { allowOutsideClick: true }
44
- */
45
- focusTrapOptions?: unknown;
46
- /**
47
- * Whether it is open or not
48
- */
49
- isOpen: boolean;
50
- /**
51
- * A function that will be called when closed
52
- */
53
- onClose?: () => void;
54
- /**
55
- * A function that will be called when closing is finished executing, this
56
- * includes waiting for animations/transitions to finish.
57
- */
58
- didClose?: () => void;
59
- /**
60
- * A function that will be called when opened
61
- */
62
- onOpen?: () => void;
63
- /**
64
- * Whether to close when the area outside (the backdrop) is clicked
65
- *
66
- * @defaultValue true
67
- */
68
- closeOnOutsideClick?: boolean;
69
- /**
70
- * Whether to close when the escape key is pressed
71
- *
72
- * @defaultValue true
73
- */
74
- closeOnEscapeKey?: boolean;
75
- /**
76
- * The name of the transition to be used in the backdrop.
77
- *
78
- * @defaultValue 'overlay-transition--fade'
79
- */
80
- backdropTransitionName?: string;
81
- /**
82
- * The name of the transition to be used in the content.
83
- *
84
- * @defaultValue 'overlay-transition--fade'
85
- */
86
- contentTransitionName?: string;
87
- }
88
- export interface OverlaySignature {
89
- Args: OverlayArgs;
2
+ import { type BackdropSignature } from './backdrop';
3
+ import type { ModifierLike } from '@glint/template';
4
+ import type { CssTransitionSignature } from 'ember-css-transitions/modifiers/css-transition';
5
+ interface OverlaySignature {
6
+ Args: {
7
+ /**
8
+ * Whether to render in place or in the specified/default destination
9
+ *
10
+ * @defaultValue false
11
+ */
12
+ renderInPlace?: boolean;
13
+ /**
14
+ * The destination where the overlay will be inserted, defaults to
15
+ * `document.body`
16
+ *
17
+ * @defaultValue undefined
18
+ */
19
+ destinationElementId?: string;
20
+ /**
21
+ * Duration of the animation
22
+ *
23
+ * @defaultValue 200
24
+ */
25
+ transitionDuration?: number;
26
+ backdrop?: BackdropSignature['Args']['type'];
27
+ backdropTransition?: BackdropSignature['Args']['transition'];
28
+ /**
29
+ * Disable css transitions
30
+ *
31
+ * @defaultValue false
32
+ */
33
+ disableTransitions?: boolean;
34
+ /**
35
+ * Whether the focus trap is disabled or not
36
+ *
37
+ * @defaultValue false
38
+ */
39
+ disableFocusTrap?: boolean;
40
+ /**
41
+ * Focus trap options
42
+ *
43
+ * @defaultValue { allowOutsideClick: true }
44
+ */
45
+ focusTrapOptions?: unknown;
46
+ /**
47
+ * Whether it is open or not
48
+ */
49
+ isOpen: boolean;
50
+ /**
51
+ * A function that will be called when closed
52
+ */
53
+ onClose?: () => void;
54
+ /**
55
+ * A function that will be called when closing is finished executing, this
56
+ * includes waiting for animations/transitions to finish.
57
+ */
58
+ didClose?: () => void;
59
+ /**
60
+ * A function that will be called when opened
61
+ */
62
+ onOpen?: () => void;
63
+ /**
64
+ * Whether to close when the area outside (the backdrop) is clicked
65
+ *
66
+ * @defaultValue true
67
+ */
68
+ closeOnOutsideClick?: boolean;
69
+ /**
70
+ * Whether to close when the overlay element is clicked, used for modal and drawer components.
71
+ *
72
+ * @defaultValue false
73
+ */
74
+ closeOnOverlayElementClick?: boolean;
75
+ /**
76
+ * Whether to close when the escape key is pressed
77
+ *
78
+ * @defaultValue true
79
+ */
80
+ closeOnEscapeKey?: boolean;
81
+ /**
82
+ * Transition options
83
+ *
84
+ * @defaultValue {name:'overlay-transition--fade'}
85
+ */
86
+ transition?: CssTransitionSignature['Args']['Named'];
87
+ disableFlexContent?: boolean;
88
+ customContentModifier?: ModifierLike<{
89
+ Element: HTMLElement;
90
+ }>;
91
+ class?: string;
92
+ /**
93
+ * @defaultValue true
94
+ */
95
+ blockScroll?: boolean;
96
+ };
90
97
  Element: HTMLDivElement;
91
98
  Blocks: {
92
99
  default: [];
93
100
  };
94
101
  }
95
- export default class Overlay extends Component<OverlaySignature> {
102
+ declare class Overlay extends Component<OverlaySignature> {
96
103
  keepOpen: boolean;
97
104
  contentElement: HTMLElement | undefined;
105
+ focusedElement: Element | null | undefined;
98
106
  mouseDownContentElement: EventTarget | null;
99
107
  get destinationElement(): HTMLElement | null;
100
- get isVisible(): boolean;
101
- get isBackdropVisible(): boolean;
102
- get isAnimationEnabled(): boolean;
103
- get focusTrapOptions(): unknown;
104
- handleOverlayClick(): void;
105
- handleContentClick(event: MouseEvent): void;
106
108
  handleClose(): void;
109
+ handleContentClick(event: MouseEvent): void;
110
+ handleOutsideClick(e: Event): void;
107
111
  handleContentMouseDown(event: MouseEvent): void;
108
112
  handleKeyDown(event: KeyboardEvent): void;
109
- setup(element: HTMLElement): void;
110
- teardown(): void;
111
- get classes(): {
112
- base: string;
113
- backdrop: string;
114
- content: string;
113
+ setupContent: import("ember-modifier").FunctionBasedModifier<{
114
+ Args: {
115
+ Positional: unknown[];
116
+ Named: import("ember-modifier/-private/signature.js").EmptyObject;
117
+ };
118
+ Element: HTMLDivElement;
119
+ }>;
120
+ get isVisible(): boolean;
121
+ get backdrop(): BackdropSignature['Args']['type'];
122
+ get isAnimationEnabled(): boolean;
123
+ get focusTrapOptions(): unknown;
124
+ get classes(): string;
125
+ get customContentModifier(): ModifierLike<{
126
+ Element: HTMLElement;
127
+ }> | import("ember-modifier").FunctionBasedModifier<{
128
+ Args: {
129
+ Positional: unknown[];
130
+ Named: import("ember-modifier/-private/signature.js").EmptyObject;
131
+ };
132
+ Element: Element;
133
+ }>;
134
+ get backdropTransition(): {
135
+ didTransitionIn?: (() => void) | undefined;
136
+ didTransitionOut?: (() => void) | undefined;
137
+ enterClass?: string | undefined;
138
+ enterActiveClass?: string | undefined;
139
+ enterToClass?: string | undefined;
140
+ isEnabled?: boolean | undefined;
141
+ leaveClass?: string | undefined;
142
+ leaveActiveClass?: string | undefined;
143
+ leaveToClass?: string | undefined;
144
+ name?: string | undefined;
145
+ parentSelector?: string | undefined;
146
+ };
147
+ get transition(): {
148
+ didTransitionIn?: (() => void) | undefined;
149
+ didTransitionOut?: (() => void) | undefined;
150
+ enterClass?: string | undefined;
151
+ enterActiveClass?: string | undefined;
152
+ enterToClass?: string | undefined;
153
+ isEnabled?: boolean | undefined;
154
+ leaveClass?: string | undefined;
155
+ leaveActiveClass?: string | undefined;
156
+ leaveToClass?: string | undefined;
157
+ name?: string | undefined;
158
+ parentSelector?: string | undefined;
115
159
  };
116
160
  }
161
+ export { Overlay, type OverlaySignature };
162
+ export default Overlay;
117
163
  //# 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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BAAqB;;;;;;;;OAMxB;IAED,IAAI,kBAAkB;;;;;;;;;;;;MAMrB;IAED,IAAI,UAAU;;;;;;;;;;;;MAWb;CAuCF;AAED,OAAO,EAAE,OAAO,EAAE,KAAK,gBAAgB,EAAE,CAAC;AAC1C,eAAe,OAAO,CAAC"}
@@ -0,0 +1,136 @@
1
+ import Component from '@glimmer/component';
2
+ import { type OverlaySignature } from './overlay';
3
+ import type { ModifierLike } from '@glint/template';
4
+ import type { WithBoundArgs } from '@glint/template';
5
+ import type { Signature as VelcroSignature } from 'ember-velcro/modifiers/velcro';
6
+ interface PopoverSignature {
7
+ Args: {
8
+ /**
9
+ * Placement of the menu when open
10
+ *
11
+ * @defaultValue 'bottom-start'
12
+ */
13
+ placement?: 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
14
+ flipOptions?: VelcroSignature['Args']['Named']['flipOptions'];
15
+ middleware?: VelcroSignature['Args']['Named']['middleware'];
16
+ shiftOptions?: VelcroSignature['Args']['Named']['shiftOptions'];
17
+ /**
18
+ * @defaultValue 5
19
+ */
20
+ offsetOptions?: VelcroSignature['Args']['Named']['offsetOptions'];
21
+ /**
22
+ * @defaultValue 'absolute'
23
+ */
24
+ strategy?: VelcroSignature['Args']['Named']['strategy'];
25
+ onClose?: () => void;
26
+ };
27
+ Element: HTMLUListElement;
28
+ Blocks: {
29
+ default: [
30
+ {
31
+ anchor: ModifierLike<{
32
+ Element: HTMLElement;
33
+ }>;
34
+ isOpen: boolean;
35
+ toggle: () => void;
36
+ open: () => void;
37
+ close: () => void;
38
+ trigger: ModifierLike<{
39
+ Element: HTMLElement;
40
+ }>;
41
+ Content: WithBoundArgs<typeof Content, 'loop' | 'isOpen' | 'id' | 'toggle' | 'blockScroll' | 'backdrop'>;
42
+ }
43
+ ];
44
+ };
45
+ }
46
+ declare class Popover extends Component<PopoverSignature> {
47
+ triggerEl?: HTMLElement;
48
+ menuId: string;
49
+ isOpen: boolean;
50
+ toggle: () => void;
51
+ open: () => void;
52
+ close: () => void;
53
+ trigger: import("ember-modifier").FunctionBasedModifier<{
54
+ Args: {
55
+ Positional: unknown[];
56
+ Named: import("ember-modifier/-private/signature.js").EmptyObject;
57
+ };
58
+ Element: HTMLElement;
59
+ }>;
60
+ updateAriaExtanded: import("ember-modifier").FunctionBasedModifier<{
61
+ Args: {
62
+ Positional: unknown[];
63
+ Named: import("ember-modifier/-private/signature.js").EmptyObject;
64
+ };
65
+ Element: HTMLElement;
66
+ }>;
67
+ }
68
+ interface ContentArgs extends Pick<OverlaySignature['Args'], 'onOpen' | 'didClose' | 'renderInPlace' | 'destinationElementId' | 'transitionDuration' | 'backdrop' | 'disableTransitions' | 'focusTrapOptions' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'backdropTransition' | 'blockScroll'> {
69
+ /**
70
+ * @internal
71
+ */
72
+ loop: ModifierLike<{
73
+ Element: HTMLElement;
74
+ }>;
75
+ /**
76
+ * @internal
77
+ */
78
+ isOpen: boolean;
79
+ /**
80
+ * @internal
81
+ */
82
+ toggle: () => void;
83
+ /**
84
+ * @internal
85
+ */
86
+ id: string;
87
+ class?: string;
88
+ /**
89
+ * The transition to be used in the Modal.
90
+ *
91
+ * @defaultValue {name: 'overlay-transition--scale'}
92
+ */
93
+ transition?: OverlaySignature['Args']['transition'];
94
+ /**
95
+ * @defaultValue true
96
+ */
97
+ disableFocusTrap?: boolean;
98
+ /**
99
+ * The size of the content.
100
+ *
101
+ * @defaultValue 'md'
102
+ */
103
+ size?: 'sm' | 'md' | 'lg' | 'xl';
104
+ }
105
+ interface ContentSignature {
106
+ Args: ContentArgs;
107
+ Element: HTMLDivElement;
108
+ Blocks: {
109
+ default: [];
110
+ };
111
+ }
112
+ declare class Content extends Component<ContentSignature> {
113
+ get loop(): ModifierLike<{
114
+ Element: HTMLElement;
115
+ }>;
116
+ get classNames(): string;
117
+ get backdrop(): OverlaySignature['Args']['backdrop'];
118
+ get transition(): {
119
+ didTransitionIn?: (() => void) | undefined;
120
+ didTransitionOut?: (() => void) | undefined;
121
+ enterClass?: string | undefined;
122
+ enterActiveClass?: string | undefined;
123
+ enterToClass?: string | undefined;
124
+ isEnabled?: boolean | undefined;
125
+ leaveClass?: string | undefined;
126
+ leaveActiveClass?: string | undefined;
127
+ leaveToClass?: string | undefined;
128
+ name?: string | undefined;
129
+ parentSelector?: string | undefined;
130
+ };
131
+ get blockScroll(): boolean;
132
+ get disableFocusTrap(): boolean;
133
+ }
134
+ export { Popover, type PopoverSignature, type ContentSignature };
135
+ export default Popover;
136
+ //# sourceMappingURL=popover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../src/components/popover.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAQ3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAElF,UAAU,gBAAgB;IACxB,IAAI,EAAE;QACJ;;;;WAIG;QACH,SAAS,CAAC,EACN,KAAK,GACL,WAAW,GACX,SAAS,GACT,OAAO,GACP,aAAa,GACb,WAAW,GACX,QAAQ,GACR,cAAc,GACd,YAAY,GACZ,MAAM,GACN,YAAY,GACZ,UAAU,CAAC;QAEf,WAAW,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC;QAC9D,UAAU,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC;QAC5D,YAAY,CAAC,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC,OAA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AkB,GAClB,qBAAqB,GACrB,kBAAkB,GAClB,oBAAoB,GACpB,aAAa,CAChB;IACD;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;QAAE,OAAO,EAAE,WAAW,CAAA;KAAE,CAAC,CAAC;IAC7C;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IAEnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,UAAU,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;IAEpD;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAClC;AAED,UAAU,gBAAgB;IACxB,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE;QAAE,OAAO,EAAE,EAAE,CAAA;KAAE,CAAC;CACzB;AAED,cAAM,OAAQ,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IAC/C,IAAI,IAAI;;OAMP;IAED,IAAI,UAAU,WAGb;IAED,IAAI,QAAQ,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAEnD;IAED,IAAI,UAAU;;;;;;;;;;;;MAUb;IAED,IAAI,WAAW,YAKd;IAED,IAAI,gBAAgB,YAKnB;CAiBF;AAED,OAAO,EAAE,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,CAAC;AACjE,eAAe,OAAO,CAAC"}
@@ -0,0 +1,5 @@
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
+ export * from './components/popover';
5
+ //# 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;AACxD,cAAc,sBAAsB,CAAC"}
@@ -1,9 +1,8 @@
1
- import type Overlay from './components/overlay';
2
- import type Drawer from './components/drawer';
3
- import type Modal from './components/modal';
1
+ import type { Overlay, Modal, Drawer, Popover } from './index';
4
2
  export default interface Registry {
5
3
  Overlay: typeof Overlay;
6
4
  Drawer: typeof Drawer;
7
5
  Modal: typeof Modal;
6
+ Popover: typeof Popover;
8
7
  }
9
8
  //# sourceMappingURL=template-registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"template-registry.d.ts","sourceRoot":"","sources":["../src/template-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAE5C,MAAM,CAAC,OAAO,WAAW,QAAQ;IAC/B,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,KAAK,CAAC;CACrB"}
1
+ {"version":3,"file":"template-registry.d.ts","sourceRoot":"","sources":["../src/template-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAE/D,MAAM,CAAC,OAAO,WAAW,QAAQ;IAC/B,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,OAAO,EAAE,OAAO,OAAO,CAAC;CACzB"}
@@ -0,0 +1 @@
1
+ export { default } from "@frontile/overlays/components/backdrop";
@@ -0,0 +1 @@
1
+ export { default } from "@frontile/overlays/components/popover";
@@ -0,0 +1,42 @@
1
+ import Component from '@glimmer/component';
2
+ import { cssTransition } from 'ember-css-transitions';
3
+ import { useStyles } from '@frontile/theme';
4
+ import { precompileTemplate } from '@ember/template-compilation';
5
+ import { setComponentTemplate } from '@ember/component';
6
+
7
+ var _class;
8
+ let Backdrop = (_class = class Backdrop extends Component {
9
+ get classNames() {
10
+ const {
11
+ backdrop: backdrop1
12
+ } = useStyles();
13
+ return backdrop1({
14
+ class: this.args.class,
15
+ type: this.args.type,
16
+ inPlace: this.args.inPlace
17
+ });
18
+ }
19
+ get transition() {
20
+ let options1 = {
21
+ name: 'overlay-transition--fade'
22
+ };
23
+ if (typeof this.args.transition === 'object') {
24
+ return {
25
+ ...options1,
26
+ ...this.args.transition
27
+ };
28
+ }
29
+ return options1;
30
+ }
31
+ get isVisiable() {
32
+ return this.args.type !== 'none';
33
+ }
34
+ }, setComponentTemplate(precompileTemplate("\n {{#if this.isVisiable}}\n <div {{cssTransition didTransitionIn=this.transition.didTransitionIn didTransitionOut=this.transition.didTransitionOut enterClass=this.transition.enterClass enterActiveClass=this.transition.enterActiveClass enterToClass=this.transition.enterToClass isEnabled=this.transition.isEnabled leaveClass=this.transition.leaveClass leaveActiveClass=this.transition.leaveActiveClass leaveToClass=this.transition.leaveToClass name=this.transition.name parentSelector=this.transition.parentSelector}} class={{this.classNames}} ...attributes>\n </div>\n {{/if}}\n ", {
35
+ scope: () => ({
36
+ cssTransition
37
+ }),
38
+ strictMode: true
39
+ }), _class), _class);
40
+
41
+ export { Backdrop, Backdrop as default };
42
+ //# sourceMappingURL=backdrop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backdrop.js","sources":["../../src/components/backdrop.gts"],"sourcesContent":["import { template } from \"@ember/template-compiler\";\nimport Component from '@glimmer/component';\nimport { cssTransition } from 'ember-css-transitions';\nimport type { CssTransitionSignature } from 'ember-css-transitions/modifiers/css-transition';\nimport { useStyles } from '@frontile/theme';\ninterface BackdropSignature {\n Args: {\n /**\n * @defaultValue 'faded'\n */ type?: 'none' | 'transparent' | 'faded' | 'blur';\n class?: string;\n /**\n * @defaultValue false\n */ inPlace?: boolean;\n transition?: CssTransitionSignature['Args']['Named'];\n };\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\nlet Backdrop = class Backdrop extends Component<BackdropSignature> {\n get classNames() {\n const { backdrop: backdrop1 } = useStyles();\n return backdrop1({\n class: this.args.class,\n type: this.args.type,\n inPlace: this.args.inPlace\n });\n }\n get transition() {\n let options1: BackdropSignature['Args']['transition'] = {\n name: 'overlay-transition--fade'\n };\n if (typeof this.args.transition === 'object') {\n return {\n ...options1,\n ...this.args.transition\n };\n }\n return options1;\n }\n get isVisiable() {\n return this.args.type !== 'none';\n }\n static{\n template(`\n {{#if this.isVisiable}}\n <div\n {{cssTransition\n didTransitionIn=this.transition.didTransitionIn\n didTransitionOut=this.transition.didTransitionOut\n enterClass=this.transition.enterClass\n enterActiveClass=this.transition.enterActiveClass\n enterToClass=this.transition.enterToClass\n isEnabled=this.transition.isEnabled\n leaveClass=this.transition.leaveClass\n leaveActiveClass=this.transition.leaveActiveClass\n leaveToClass=this.transition.leaveToClass\n name=this.transition.name\n parentSelector=this.transition.parentSelector\n }}\n class={{this.classNames}}\n ...attributes\n >\n </div>\n {{/if}}\n `, {\n component: this,\n eval () {\n return eval(arguments[0]);\n }\n });\n }\n};\nexport { Backdrop, BackdropSignature };\nexport default Backdrop;\n"],"names":["Backdrop","_class","Component","classNames","backdrop","backdrop1","useStyles","class","args","type","inPlace","transition","options1","name","isVisiable","setComponentTemplate","precompileTemplate","scope","cssTransition","strictMode"],"mappings":";;;;;;;AAqBIA,IAAAA,QAAQ,IAAAC,MAAA,GAAG,MAAMD,QAAQ,SAASE,SAAS,CAAoB;EAC/D,IAAIC,UAAUA,GAAG;IACb,MAAM;AAAEC,MAAAA,QAAQ,EAAEC,SAAAA;KAAW,GAAGC,SAAS,EAAE,CAAA;AAC3C,IAAA,OAAOD,SAAS,CAAC;AACbE,MAAAA,KAAK,EAAE,IAAI,CAACC,IAAI,CAACD,KAAK;AACtBE,MAAAA,IAAI,EAAE,IAAI,CAACD,IAAI,CAACC,IAAI;AACpBC,MAAAA,OAAO,EAAE,IAAI,CAACF,IAAI,CAACE,OAAAA;AACvB,KAAC,CAAC,CAAA;AACN,GAAA;EACA,IAAIC,UAAUA,GAAG;AACb,IAAA,IAAIC,QAAiD,GAAG;AACpDC,MAAAA,IAAI,EAAE,0BAAA;KACT,CAAA;IACD,IAAI,OAAO,IAAI,CAACL,IAAI,CAACG,UAAU,KAAK,QAAQ,EAAE;MAC1C,OAAO;AACH,QAAA,GAAGC,QAAQ;QACX,GAAG,IAAI,CAACJ,IAAI,CAACG,UAAAA;OAChB,CAAA;AACL,KAAA;AACA,IAAA,OAAOC,QAAQ,CAAA;AACnB,GAAA;EACA,IAAIE,UAAUA,GAAG;AACb,IAAA,OAAO,IAAI,CAACN,IAAI,CAACC,IAAI,KAAK,MAAM,CAAA;AACpC,GAAA;AA8BJ,CAAC,EAAAM,oBAAA,CA5BOC,kBAAA,CAqBH,ulBAAA,EAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA,aAAAA;AAAA,GAAA,CAAA;EAAAC,UAAA,EAAA,IAAA;AAKG,CAAC,CAAC,EAAAlB,MAAA,CAAA,EAAAA,MAAA;;;;"}
@@ -1,12 +1,12 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
2
2
  import Component from '@glimmer/component';
3
3
  import { guidFor } from '@ember/object/internals';
4
- import { concat, hash } from '@ember/helper';
5
- import Overlay from './overlay.js';
4
+ import { hash } from '@ember/helper';
5
+ 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';
@@ -48,12 +48,23 @@ class Drawer extends Component {
48
48
  footer: footer1()
49
49
  };
50
50
  }
51
+ get transition() {
52
+ let options1 = {
53
+ name: `overlay-transition--slide-from-${this.placement}`
54
+ };
55
+ if (typeof this.args.transition === 'object') {
56
+ return {
57
+ ...options1,
58
+ ...this.args.transition
59
+ };
60
+ }
61
+ return options1;
62
+ }
51
63
  }
52
64
  _class = Drawer;
53
- setComponentTemplate(precompileTemplate("\n <Overlay @isOpen={{@isOpen}} @onClose={{@onClose}} @onOpen={{@onOpen}} @didClose={{@didClose}} @renderInPlace={{@renderInPlace}} @destinationElementId={{@destinationElementId}} @transitionDuration={{@transitionDuration}} @disableBackdrop={{@disableBackdrop}} @disableTransitions={{@disableTransitions}} @disableFocusTrap={{@disableFocusTrap}} @focusTrapOptions={{@focusTrapOptions}} @closeOnOutsideClick={{if this.preventClosing false @closeOnOutsideClick}} @closeOnEscapeKey={{if this.preventClosing false @closeOnEscapeKey}} @backdropTransitionName={{@backdropTransitionName}} @contentTransitionName={{if @transitionName @transitionName (concat \"overlay-transition--slide-from-\" this.placement)}}>\n\n <div class={{this.classes.base}} tabindex=\"0\" role=\"dialog\" aria-labelledby={{this.headerId}} ...attributes>\n {{#if this.showCloseButton}}\n <CloseButton @onClick={{@onClose}} @size={{@closeButtonSize}} @class={{this.classes.closeButton}} />\n {{/if}}\n\n {{yield (hash CloseButton=(component CloseButton onClick=@onClose class=this.classes.closeButton) Header=(component DrawerHeader labelledById=this.headerId class=this.classes.header) Body=(component DrawerBody placement=this.placement class=this.classes.body) Footer=(component DrawerFooter placement=this.placement class=this.classes.footer) headerId=this.headerId)}}\n </div>\n </Overlay>\n ", {
65
+ setComponentTemplate(precompileTemplate("\n <Overlay @isOpen={{@isOpen}} @onClose={{@onClose}} @onOpen={{@onOpen}} @didClose={{@didClose}} @renderInPlace={{@renderInPlace}} @destinationElementId={{@destinationElementId}} @transitionDuration={{@transitionDuration}} @backdrop={{@backdrop}} @disableTransitions={{@disableTransitions}} @disableFocusTrap={{@disableFocusTrap}} @focusTrapOptions={{@focusTrapOptions}} @closeOnOutsideClick={{if this.preventClosing false @closeOnOutsideClick}} @closeOnEscapeKey={{if this.preventClosing false @closeOnEscapeKey}} @backdropTransition={{@backdropTransition}} @transition={{this.transition}} @closeOnOverlayElementClick={{true}}>\n <div class={{this.classes.base}} tabindex=\"0\" role=\"dialog\" aria-labelledby={{this.headerId}} ...attributes>\n {{#if this.showCloseButton}}\n <CloseButton @onClick={{@onClose}} @size={{@closeButtonSize}} @class={{this.classes.closeButton}} />\n {{/if}}\n\n {{yield (hash CloseButton=(component CloseButton onClick=@onClose class=this.classes.closeButton) Header=(component DrawerHeader labelledById=this.headerId class=this.classes.header) Body=(component DrawerBody placement=this.placement class=this.classes.body) Footer=(component DrawerFooter placement=this.placement class=this.classes.footer) headerId=this.headerId)}}\n </div>\n </Overlay>\n ", {
54
66
  scope: () => ({
55
67
  Overlay,
56
- concat,
57
68
  CloseButton,
58
69
  hash,
59
70
  DrawerHeader,
@@ -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,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AAAA,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 { hash } from '@ember/helper';\nimport Overlay, { type OverlaySignature } 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 Pick<OverlaySignature['Args'], 'isOpen' | 'onOpen' | 'onClose' | 'didClose' | 'renderInPlace' | 'destinationElementId' | 'transitionDuration' | 'backdrop' | 'disableTransitions' | 'disableFocusTrap' | 'focusTrapOptions' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'backdropTransition'> {\n /**\n * The transition to be used in the Drawer.\n *\n * @defaultValue {name: 'overlay-transition--slide-from-[placement]'}\n */ transition?: OverlaySignature['Args']['transition'];\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 get transition() {\n let options1: OverlaySignature['Args']['transition'] = {\n name: `overlay-transition--slide-from-${this.placement}`\n };\n if (typeof this.args.transition === 'object') {\n return {\n ...options1,\n ...this.args.transition\n };\n }\n return options1;\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 @backdrop={{@backdrop}}\n @disableTransitions={{@disableTransitions}}\n @disableFocusTrap={{@disableFocusTrap}}\n @focusTrapOptions={{@focusTrapOptions}}\n @closeOnOutsideClick={{if this.preventClosing false @closeOnOutsideClick}}\n @closeOnEscapeKey={{if this.preventClosing false @closeOnEscapeKey}}\n @backdropTransition={{@backdropTransition}}\n @transition={{this.transition}}\n @closeOnOverlayElementClick={{true}}\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","transition","options1","name","_class","setComponentTemplate","precompileTemplate","scope","Overlay","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,KA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