@frontile/overlays 0.17.0-beta.2 → 0.17.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/-private/dom.d.ts +0 -1
- package/declarations/components/backdrop.d.ts +0 -1
- package/declarations/components/drawer/body.d.ts +0 -1
- package/declarations/components/drawer/footer.d.ts +0 -1
- package/declarations/components/drawer/header.d.ts +0 -1
- package/declarations/components/drawer.d.ts +12 -13
- package/declarations/components/modal/body.d.ts +0 -1
- package/declarations/components/modal/footer.d.ts +0 -1
- package/declarations/components/modal/header.d.ts +0 -1
- package/declarations/components/modal.d.ts +11 -12
- package/declarations/components/overlay.d.ts +8 -2
- package/declarations/components/popover.d.ts +12 -4
- package/declarations/components/portal-target.d.ts +0 -1
- package/declarations/components/portal.d.ts +0 -1
- package/declarations/index.d.ts +0 -1
- package/declarations/template-registry.d.ts +0 -1
- package/dist/components/backdrop.js +8 -8
- package/dist/components/backdrop.js.map +1 -1
- package/dist/components/drawer/body.js +10 -9
- package/dist/components/drawer/body.js.map +1 -1
- package/dist/components/drawer/footer.js +10 -9
- package/dist/components/drawer/footer.js.map +1 -1
- package/dist/components/drawer/header.js +10 -9
- package/dist/components/drawer/header.js.map +1 -1
- package/dist/components/drawer.js +15 -19
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/modal/body.js +10 -9
- package/dist/components/modal/body.js.map +1 -1
- package/dist/components/modal/footer.js +10 -9
- package/dist/components/modal/footer.js.map +1 -1
- package/dist/components/modal/header.js +10 -9
- package/dist/components/modal/header.js.map +1 -1
- package/dist/components/modal.js +15 -19
- package/dist/components/modal.js.map +1 -1
- package/dist/components/overlay.js +16 -197
- package/dist/components/overlay.js.map +1 -1
- package/dist/components/popover.js +159 -128
- package/dist/components/popover.js.map +1 -1
- package/dist/components/portal-target.js.map +1 -1
- package/dist/components/portal.js +1 -2
- package/dist/components/portal.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/overlay-CtCgH4Fk.js +270 -0
- package/dist/overlay-CtCgH4Fk.js.map +1 -0
- package/dist/{portal-Es7o21X5.js → portal-lZU6177n.js} +21 -22
- package/dist/portal-lZU6177n.js.map +1 -0
- package/package.json +48 -51
- package/declarations/-private/dom.d.ts.map +0 -1
- package/declarations/components/backdrop.d.ts.map +0 -1
- package/declarations/components/drawer/body.d.ts.map +0 -1
- package/declarations/components/drawer/footer.d.ts.map +0 -1
- package/declarations/components/drawer/header.d.ts.map +0 -1
- package/declarations/components/drawer.d.ts.map +0 -1
- package/declarations/components/modal/body.d.ts.map +0 -1
- package/declarations/components/modal/footer.d.ts.map +0 -1
- package/declarations/components/modal/header.d.ts.map +0 -1
- package/declarations/components/modal.d.ts.map +0 -1
- package/declarations/components/overlay.d.ts.map +0 -1
- package/declarations/components/popover.d.ts.map +0 -1
- package/declarations/components/portal-target.d.ts.map +0 -1
- package/declarations/components/portal.d.ts.map +0 -1
- package/declarations/index.d.ts.map +0 -1
- package/declarations/portal-Es7o21X5.d.ts +0 -5
- package/declarations/portal-Es7o21X5.d.ts.map +0 -1
- package/declarations/template-registry.d.ts.map +0 -1
- package/dist/portal-D1N7TxUb.js +0 -167
- package/dist/portal-D1N7TxUb.js.map +0 -1
- package/dist/portal-Es7o21X5.js.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export declare function getDOM(context: object): Document | null;
|
|
2
2
|
export declare function getElementById(doc: Document | Element, id: string): null | Element;
|
|
3
3
|
export declare function getElementByAttribute(doc: Document | Element, attribute: string, value?: string | undefined): null | Element;
|
|
4
|
-
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -51,8 +51,8 @@ export interface DrawerSignature {
|
|
|
51
51
|
Blocks: {
|
|
52
52
|
default: [
|
|
53
53
|
{
|
|
54
|
-
CloseButton: WithBoundArgs<typeof CloseButton, '
|
|
55
|
-
Header: WithBoundArgs<typeof DrawerHeader, 'labelledById'
|
|
54
|
+
CloseButton: WithBoundArgs<typeof CloseButton, 'onPress' | 'class'>;
|
|
55
|
+
Header: WithBoundArgs<typeof DrawerHeader, 'labelledById' | 'classFromParent'>;
|
|
56
56
|
Body: WithBoundArgs<typeof DrawerBody, 'classFromParent'>;
|
|
57
57
|
Footer: WithBoundArgs<typeof DrawerFooter, 'classFromParent'>;
|
|
58
58
|
headerId: string;
|
|
@@ -70,44 +70,44 @@ export default class Drawer extends Component<DrawerSignature> {
|
|
|
70
70
|
base: (slotProps?: ({
|
|
71
71
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
72
72
|
placement?: "top" | "bottom" | "left" | "right" | undefined;
|
|
73
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
73
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
74
74
|
closeButton: (slotProps?: ({
|
|
75
75
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
76
76
|
placement?: "top" | "bottom" | "left" | "right" | undefined;
|
|
77
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
77
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
78
78
|
header: (slotProps?: ({
|
|
79
79
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
80
80
|
placement?: "top" | "bottom" | "left" | "right" | undefined;
|
|
81
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
81
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
82
82
|
body: (slotProps?: ({
|
|
83
83
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
84
84
|
placement?: "top" | "bottom" | "left" | "right" | undefined;
|
|
85
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
85
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
86
86
|
footer: (slotProps?: ({
|
|
87
87
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
88
88
|
placement?: "top" | "bottom" | "left" | "right" | undefined;
|
|
89
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
89
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
90
90
|
} & {
|
|
91
91
|
base: (slotProps?: ({
|
|
92
92
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
93
93
|
placement?: "top" | "bottom" | "left" | "right" | undefined;
|
|
94
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
94
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
95
95
|
closeButton: (slotProps?: ({
|
|
96
96
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
97
97
|
placement?: "top" | "bottom" | "left" | "right" | undefined;
|
|
98
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
98
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
99
99
|
header: (slotProps?: ({
|
|
100
100
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
101
101
|
placement?: "top" | "bottom" | "left" | "right" | undefined;
|
|
102
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
102
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
103
103
|
body: (slotProps?: ({
|
|
104
104
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
105
105
|
placement?: "top" | "bottom" | "left" | "right" | undefined;
|
|
106
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
106
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
107
107
|
footer: (slotProps?: ({
|
|
108
108
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
109
109
|
placement?: "top" | "bottom" | "left" | "right" | undefined;
|
|
110
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
110
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
111
111
|
} & {};
|
|
112
112
|
get transition(): {
|
|
113
113
|
didTransitionIn?: () => void;
|
|
@@ -123,4 +123,3 @@ export default class Drawer extends Component<DrawerSignature> {
|
|
|
123
123
|
parentSelector?: string;
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
//# sourceMappingURL=drawer.d.ts.map
|
|
@@ -50,7 +50,7 @@ export interface ModalSignature {
|
|
|
50
50
|
Blocks: {
|
|
51
51
|
default: [
|
|
52
52
|
{
|
|
53
|
-
CloseButton: WithBoundArgs<typeof CloseButton, '
|
|
53
|
+
CloseButton: WithBoundArgs<typeof CloseButton, 'onPress' | 'class'>;
|
|
54
54
|
Header: WithBoundArgs<typeof ModalHeader, 'labelledById' | 'classFromParent'>;
|
|
55
55
|
Body: WithBoundArgs<typeof ModalBody, 'classFromParent'>;
|
|
56
56
|
Footer: WithBoundArgs<typeof ModalFooter, 'classFromParent'>;
|
|
@@ -69,44 +69,44 @@ export default class Modal extends Component<ModalSignature> {
|
|
|
69
69
|
base: (slotProps?: ({
|
|
70
70
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
71
71
|
isCentered?: boolean | undefined;
|
|
72
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
72
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
73
73
|
closeButton: (slotProps?: ({
|
|
74
74
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
75
75
|
isCentered?: boolean | undefined;
|
|
76
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
76
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
77
77
|
header: (slotProps?: ({
|
|
78
78
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
79
79
|
isCentered?: boolean | undefined;
|
|
80
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
80
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
81
81
|
body: (slotProps?: ({
|
|
82
82
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
83
83
|
isCentered?: boolean | undefined;
|
|
84
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
84
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
85
85
|
footer: (slotProps?: ({
|
|
86
86
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
87
87
|
isCentered?: boolean | undefined;
|
|
88
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
88
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
89
89
|
} & {
|
|
90
90
|
base: (slotProps?: ({
|
|
91
91
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
92
92
|
isCentered?: boolean | undefined;
|
|
93
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
93
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
94
94
|
closeButton: (slotProps?: ({
|
|
95
95
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
96
96
|
isCentered?: boolean | undefined;
|
|
97
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
97
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
98
98
|
header: (slotProps?: ({
|
|
99
99
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
100
100
|
isCentered?: boolean | undefined;
|
|
101
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
101
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
102
102
|
body: (slotProps?: ({
|
|
103
103
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
104
104
|
isCentered?: boolean | undefined;
|
|
105
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
105
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
106
106
|
footer: (slotProps?: ({
|
|
107
107
|
size?: "sm" | "md" | "lg" | "xl" | "xs" | "full" | undefined;
|
|
108
108
|
isCentered?: boolean | undefined;
|
|
109
|
-
} & import("tailwind-variants").ClassProp<import("tailwind-
|
|
109
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
110
110
|
} & {};
|
|
111
111
|
get transition(): {
|
|
112
112
|
didTransitionIn?: () => void;
|
|
@@ -122,4 +122,3 @@ export default class Modal extends Component<ModalSignature> {
|
|
|
122
122
|
parentSelector?: string;
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -55,8 +55,10 @@ interface Args extends Pick<PortalSignature['Args'], 'renderInPlace' | 'target'>
|
|
|
55
55
|
closeOnOutsideClick?: boolean;
|
|
56
56
|
/**
|
|
57
57
|
* Whether to close when the overlay element is clicked, used for modal and drawer components.
|
|
58
|
+
* This is set to true by default to allow "outside click" functionality to work properly.
|
|
59
|
+
* Most overlay content is wrapped with an inner element, preventing accidental closure.
|
|
58
60
|
*
|
|
59
|
-
* @defaultValue
|
|
61
|
+
* @defaultValue true
|
|
60
62
|
*/
|
|
61
63
|
closeOnOverlayElementClick?: boolean;
|
|
62
64
|
/**
|
|
@@ -80,6 +82,11 @@ interface Args extends Pick<PortalSignature['Args'], 'renderInPlace' | 'target'>
|
|
|
80
82
|
* @defaultValue false
|
|
81
83
|
*/
|
|
82
84
|
preventFocusRestore?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* When focusTrap is disabled, by default Oberlay will be auto focused. This option prevents that.
|
|
87
|
+
* @defaultValue false
|
|
88
|
+
*/
|
|
89
|
+
preventAutoFocus?: boolean;
|
|
83
90
|
/**
|
|
84
91
|
* @defaultValue true
|
|
85
92
|
*/
|
|
@@ -152,4 +159,3 @@ declare class Overlay extends Component<OverlaySignature> {
|
|
|
152
159
|
}
|
|
153
160
|
export { Overlay, type OverlaySignature };
|
|
154
161
|
export default Overlay;
|
|
155
|
-
//# sourceMappingURL=overlay.d.ts.map
|
|
@@ -43,7 +43,7 @@ interface PopoverSignature {
|
|
|
43
43
|
Positional: [eventType?: 'click' | 'hover'];
|
|
44
44
|
};
|
|
45
45
|
}>;
|
|
46
|
-
Content: WithBoundArgs<typeof Content, 'loop' | 'isOpen' | 'id' | 'toggle' | 'internalDidClose' | 'blockScroll' | 'backdrop'>;
|
|
46
|
+
Content: WithBoundArgs<typeof Content, 'loop' | 'isOpen' | 'id' | 'toggle' | 'internalDidClose' | 'blockScroll' | 'backdrop' | 'triggerWidth'>;
|
|
47
47
|
}
|
|
48
48
|
];
|
|
49
49
|
};
|
|
@@ -54,6 +54,7 @@ declare class Popover extends Component<PopoverSignature> {
|
|
|
54
54
|
_isOpen: boolean;
|
|
55
55
|
isClosing: boolean;
|
|
56
56
|
preventFocusRestore: boolean;
|
|
57
|
+
triggerWidth?: number;
|
|
57
58
|
get isOpen(): boolean;
|
|
58
59
|
toggle: (event?: Event) => void;
|
|
59
60
|
open: () => void;
|
|
@@ -74,7 +75,7 @@ declare class Popover extends Component<PopoverSignature> {
|
|
|
74
75
|
}>;
|
|
75
76
|
didClose: () => void;
|
|
76
77
|
}
|
|
77
|
-
interface ContentArgs extends Pick<OverlaySignature['Args'], 'onOpen' | 'didClose' | 'renderInPlace' | 'target' | 'transitionDuration' | 'backdrop' | 'disableTransitions' | 'focusTrapOptions' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'backdropTransition' | 'blockScroll'> {
|
|
78
|
+
interface ContentArgs extends Pick<OverlaySignature['Args'], 'onOpen' | 'didClose' | 'renderInPlace' | 'target' | 'transitionDuration' | 'backdrop' | 'disableTransitions' | 'focusTrapOptions' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'backdropTransition' | 'blockScroll' | 'preventAutoFocus'> {
|
|
78
79
|
/**
|
|
79
80
|
* @internal
|
|
80
81
|
*/
|
|
@@ -101,6 +102,7 @@ interface ContentArgs extends Pick<OverlaySignature['Args'], 'onOpen' | 'didClos
|
|
|
101
102
|
* @internal
|
|
102
103
|
*/
|
|
103
104
|
preventFocusRestore?: boolean;
|
|
105
|
+
triggerWidth?: number;
|
|
104
106
|
class?: string;
|
|
105
107
|
/**
|
|
106
108
|
* The transition to be used in the Modal.
|
|
@@ -117,7 +119,7 @@ interface ContentArgs extends Pick<OverlaySignature['Args'], 'onOpen' | 'didClos
|
|
|
117
119
|
*
|
|
118
120
|
* @defaultValue 'md'
|
|
119
121
|
*/
|
|
120
|
-
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
122
|
+
size?: 'sm' | 'md' | 'lg' | 'xl' | 'trigger';
|
|
121
123
|
}
|
|
122
124
|
interface ContentSignature {
|
|
123
125
|
Args: ContentArgs;
|
|
@@ -151,7 +153,13 @@ declare class Content extends Component<ContentSignature> {
|
|
|
151
153
|
get blockScroll(): boolean;
|
|
152
154
|
get disableFocusTrap(): boolean;
|
|
153
155
|
didClose: () => void;
|
|
156
|
+
updateTriggerWidth: import("ember-modifier").FunctionBasedModifier<{
|
|
157
|
+
Args: {
|
|
158
|
+
Positional: unknown[];
|
|
159
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
160
|
+
};
|
|
161
|
+
Element: HTMLDivElement;
|
|
162
|
+
}>;
|
|
154
163
|
}
|
|
155
164
|
export { Popover, type PopoverSignature, type ContentSignature };
|
|
156
165
|
export default Popover;
|
|
157
|
-
//# sourceMappingURL=popover.d.ts.map
|
package/declarations/index.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { useStyles } from '@frontile/theme';
|
|
|
4
4
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
5
5
|
import { setComponentTemplate } from '@ember/component';
|
|
6
6
|
|
|
7
|
-
var _Backdrop;
|
|
8
7
|
class Backdrop extends Component {
|
|
9
8
|
get classNames() {
|
|
10
9
|
const {
|
|
@@ -31,14 +30,15 @@ class Backdrop extends Component {
|
|
|
31
30
|
get isVisible() {
|
|
32
31
|
return this.args.type !== 'none';
|
|
33
32
|
}
|
|
33
|
+
static {
|
|
34
|
+
setComponentTemplate(precompileTemplate("\n {{#if this.isVisible}}\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
|
+
strictMode: true,
|
|
36
|
+
scope: () => ({
|
|
37
|
+
cssTransition
|
|
38
|
+
})
|
|
39
|
+
}), this);
|
|
40
|
+
}
|
|
34
41
|
}
|
|
35
|
-
_Backdrop = Backdrop;
|
|
36
|
-
setComponentTemplate(precompileTemplate("\n {{#if this.isVisible}}\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 ", {
|
|
37
|
-
strictMode: true,
|
|
38
|
-
scope: () => ({
|
|
39
|
-
cssTransition
|
|
40
|
-
})
|
|
41
|
-
}), _Backdrop);
|
|
42
42
|
|
|
43
43
|
export { Backdrop, Backdrop as default };
|
|
44
44
|
//# sourceMappingURL=backdrop.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backdrop.js","sources":["../../src/components/backdrop.gts"],"sourcesContent":["import 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';\n\ninterface BackdropSignature {\n Args: {\n /**\n * @defaultValue 'faded'\n */\n type?: 'none' | 'transparent' | 'faded' | 'blur';\n class?: string;\n /**\n * @defaultValue false\n */\n inPlace?: boolean;\n\n transition?: CssTransitionSignature['Args']['Named'];\n };\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nclass Backdrop extends Component<BackdropSignature> {\n get classNames() {\n const { backdrop } = useStyles();\n return backdrop({\n class: this.args.class,\n type: this.args.type,\n inPlace: this.args.inPlace\n });\n }\n\n get transition() {\n let options: BackdropSignature['Args']['transition'] = {\n name: 'overlay-transition--fade'\n };\n\n if (typeof this.args.transition === 'object') {\n return { ...options, ...this.args.transition };\n }\n\n return options;\n }\n\n get isVisible() {\n return this.args.type !== 'none';\n }\n\n <template>\n {{#if this.isVisible}}\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 </template>\n}\n\nexport { Backdrop, type BackdropSignature };\nexport default Backdrop;\n"],"names":["Backdrop","Component","classNames","backdrop","useStyles","class","args","type","inPlace","transition","options","name","isVisible","
|
|
1
|
+
{"version":3,"file":"backdrop.js","sources":["../../src/components/backdrop.gts"],"sourcesContent":["import 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';\n\ninterface BackdropSignature {\n Args: {\n /**\n * @defaultValue 'faded'\n */\n type?: 'none' | 'transparent' | 'faded' | 'blur';\n class?: string;\n /**\n * @defaultValue false\n */\n inPlace?: boolean;\n\n transition?: CssTransitionSignature['Args']['Named'];\n };\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nclass Backdrop extends Component<BackdropSignature> {\n get classNames() {\n const { backdrop } = useStyles();\n return backdrop({\n class: this.args.class,\n type: this.args.type,\n inPlace: this.args.inPlace\n });\n }\n\n get transition() {\n let options: BackdropSignature['Args']['transition'] = {\n name: 'overlay-transition--fade'\n };\n\n if (typeof this.args.transition === 'object') {\n return { ...options, ...this.args.transition };\n }\n\n return options;\n }\n\n get isVisible() {\n return this.args.type !== 'none';\n }\n\n <template>\n {{#if this.isVisible}}\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 </template>\n}\n\nexport { Backdrop, type BackdropSignature };\nexport default Backdrop;\n"],"names":["Backdrop","Component","classNames","backdrop","useStyles","class","args","type","inPlace","transition","options","name","isVisible","setComponentTemplate","precompileTemplate","strictMode","scope","cssTransition"],"mappings":";;;;;;AAyBA,MAAMA,iBAAiBC,SAAA,CAAU;EAC/B,IAAIC,UAAAA,GAAa;IACf,MAAM;AAAEC,MAAAA;KAAU,GAAGC,SAAA,EAAA;AACrB,IAAA,OAAOD,QAAA,CAAS;AACdE,MAAAA,KAAA,EAAO,IAAI,CAACC,IAAI,CAACD,KAAK;AACtBE,MAAAA,IAAA,EAAM,IAAI,CAACD,IAAI,CAACC,IAAI;AACpBC,MAAAA,OAAA,EAAS,IAAI,CAACF,IAAI,CAACE;AACrB,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,IAAIC,OAAmC,GAAgB;AACrDC,MAAAA,IAAA,EAAM;KACR;IAEA,IAAI,OAAO,IAAI,CAACL,IAAI,CAACG,UAAU,KAAK,QAAA,EAAU;MAC5C,OAAO;AAAE,QAAA,GAAGC,OAAO;QAAE,GAAG,IAAI,CAACJ,IAAI,CAACG;OAAW;AAC/C,IAAA;AAEA,IAAA,OAAOC,OAAA;AACT,EAAA;EAEA,IAAIE,SAAAA,GAAY;AACd,IAAA,OAAO,IAAI,CAACN,IAAI,CAACC,IAAI,KAAK,MAAA;AAC5B,EAAA;AAEA,EAAA;IAAAM,oBAAA,CAAAC,kBAAA,CAAA,slBAAA,EAqBA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -3,15 +3,16 @@ import { twMerge } from '@frontile/theme';
|
|
|
3
3
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
4
|
import { setComponentTemplate } from '@ember/component';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
6
|
+
class DrawerBody extends Component {
|
|
7
|
+
static {
|
|
8
|
+
setComponentTemplate(precompileTemplate("\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n ", {
|
|
9
|
+
strictMode: true,
|
|
10
|
+
scope: () => ({
|
|
11
|
+
twMerge
|
|
12
|
+
})
|
|
13
|
+
}), this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
15
16
|
|
|
16
17
|
export { DrawerBody as default };
|
|
17
18
|
//# sourceMappingURL=body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sources":["../../../src/components/drawer/body.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface DrawerBodyArgs {\n class?: string;\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface DrawerBodySignature {\n Args: DrawerBodyArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class DrawerBody extends Component<DrawerBodySignature> {\n <template>\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n </template>\n}\n"],"names":["DrawerBody","Component","
|
|
1
|
+
{"version":3,"file":"body.js","sources":["../../../src/components/drawer/body.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface DrawerBodyArgs {\n class?: string;\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface DrawerBodySignature {\n Args: DrawerBodyArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class DrawerBody extends Component<DrawerBodySignature> {\n <template>\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n </template>\n}\n"],"names":["DrawerBody","Component","setComponentTemplate","precompileTemplate","strictMode","scope","twMerge"],"mappings":";;;;;AAmBe,MAAMA,mBAAmBC,SAAA,CAAU;AAChD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,sGAAA,EAIA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -3,15 +3,16 @@ import { twMerge } from '@frontile/theme';
|
|
|
3
3
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
4
|
import { setComponentTemplate } from '@ember/component';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
6
|
+
class DrawerFooter extends Component {
|
|
7
|
+
static {
|
|
8
|
+
setComponentTemplate(precompileTemplate("\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n ", {
|
|
9
|
+
strictMode: true,
|
|
10
|
+
scope: () => ({
|
|
11
|
+
twMerge
|
|
12
|
+
})
|
|
13
|
+
}), this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
15
16
|
|
|
16
17
|
export { DrawerFooter as default };
|
|
17
18
|
//# sourceMappingURL=footer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"footer.js","sources":["../../../src/components/drawer/footer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface DrawerFooterArgs {\n class?: string;\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface DrawerFooterSignature {\n Args: DrawerFooterArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class DrawerFooter extends Component<DrawerFooterSignature> {\n <template>\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n </template>\n}\n"],"names":["DrawerFooter","Component","
|
|
1
|
+
{"version":3,"file":"footer.js","sources":["../../../src/components/drawer/footer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface DrawerFooterArgs {\n class?: string;\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface DrawerFooterSignature {\n Args: DrawerFooterArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class DrawerFooter extends Component<DrawerFooterSignature> {\n <template>\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n </template>\n}\n"],"names":["DrawerFooter","Component","setComponentTemplate","precompileTemplate","strictMode","scope","twMerge"],"mappings":";;;;;AAmBe,MAAMA,qBAAqBC,SAAA,CAAU;AAClD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,sGAAA,EAIA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -3,15 +3,16 @@ import { twMerge } from '@frontile/theme';
|
|
|
3
3
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
4
|
import { setComponentTemplate } from '@ember/component';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
6
|
+
class DrawerHeader extends Component {
|
|
7
|
+
static {
|
|
8
|
+
setComponentTemplate(precompileTemplate("\n <div id={{@labelledById}} class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n ", {
|
|
9
|
+
strictMode: true,
|
|
10
|
+
scope: () => ({
|
|
11
|
+
twMerge
|
|
12
|
+
})
|
|
13
|
+
}), this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
15
16
|
|
|
16
17
|
export { DrawerHeader as default };
|
|
17
18
|
//# sourceMappingURL=header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.js","sources":["../../../src/components/drawer/header.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface DrawerHeaderArgs {\n /**\n * The id used to reference labelledById in Drawer component\n */\n labelledById: string;\n\n class?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface DrawerHeaderSignature {\n Args: DrawerHeaderArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\nexport default class DrawerHeader extends Component<DrawerHeaderSignature> {\n <template>\n <div\n id={{@labelledById}}\n class={{twMerge @classFromParent @class}}\n ...attributes\n >\n {{yield}}\n </div>\n </template>\n}\n"],"names":["DrawerHeader","Component","
|
|
1
|
+
{"version":3,"file":"header.js","sources":["../../../src/components/drawer/header.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface DrawerHeaderArgs {\n /**\n * The id used to reference labelledById in Drawer component\n */\n labelledById: string;\n\n class?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface DrawerHeaderSignature {\n Args: DrawerHeaderArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\nexport default class DrawerHeader extends Component<DrawerHeaderSignature> {\n <template>\n <div\n id={{@labelledById}}\n class={{twMerge @classFromParent @class}}\n ...attributes\n >\n {{yield}}\n </div>\n </template>\n}\n"],"names":["DrawerHeader","Component","setComponentTemplate","precompileTemplate","strictMode","scope","twMerge"],"mappings":";;;;;AAwBe,MAAMA,qBAAqBC,SAAA,CAAU;AAClD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,2HAAA,EAQA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
1
|
import Component from '@glimmer/component';
|
|
3
2
|
import { guidFor } from '@ember/object/internals';
|
|
4
3
|
import { hash } from '@ember/helper';
|
|
5
|
-
import { Overlay } from '
|
|
4
|
+
import { O as Overlay } from '../overlay-CtCgH4Fk.js';
|
|
6
5
|
import DrawerBody from './drawer/body.js';
|
|
7
6
|
import DrawerFooter from './drawer/footer.js';
|
|
8
7
|
import DrawerHeader from './drawer/header.js';
|
|
@@ -11,12 +10,8 @@ import { useStyles } from '@frontile/theme';
|
|
|
11
10
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
12
11
|
import { setComponentTemplate } from '@ember/component';
|
|
13
12
|
|
|
14
|
-
var _Drawer;
|
|
15
13
|
class Drawer extends Component {
|
|
16
|
-
|
|
17
|
-
super(...args);
|
|
18
|
-
_defineProperty(this, "headerId", `${guidFor(this)}-header`);
|
|
19
|
-
}
|
|
14
|
+
headerId = `${guidFor(this)}-header`;
|
|
20
15
|
get preventClosing() {
|
|
21
16
|
return this.args.allowClosing === false;
|
|
22
17
|
}
|
|
@@ -47,19 +42,20 @@ class Drawer extends Component {
|
|
|
47
42
|
}
|
|
48
43
|
return options;
|
|
49
44
|
}
|
|
45
|
+
static {
|
|
46
|
+
setComponentTemplate(precompileTemplate("\n <Overlay @isOpen={{@isOpen}} @onClose={{@onClose}} @onOpen={{@onOpen}} @didClose={{@didClose}} @renderInPlace={{@renderInPlace}} @target={{@target}} @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 class=@classes.base}} tabindex=\"0\" role=\"dialog\" aria-labelledby={{this.headerId}} ...attributes>\n {{#if this.showCloseButton}}\n <CloseButton @onPress={{@onClose}} @size={{@closeButtonSize}} @class={{this.classes.closeButton class=@classes.closeButton}} />\n {{/if}}\n\n {{yield (hash CloseButton=(component CloseButton onPress=@onClose class=(this.classes.closeButton class=@classes.closeButton)) Header=(component DrawerHeader labelledById=this.headerId classFromParent=(this.classes.header class=@classes.header)) Body=(component DrawerBody placement=this.placement classFromParent=(this.classes.body class=@classes.body)) Footer=(component DrawerFooter placement=this.placement classFromParent=(this.classes.footer class=@classes.footer)) headerId=this.headerId)}}\n </div>\n </Overlay>\n ", {
|
|
47
|
+
strictMode: true,
|
|
48
|
+
scope: () => ({
|
|
49
|
+
Overlay,
|
|
50
|
+
CloseButton,
|
|
51
|
+
hash,
|
|
52
|
+
DrawerHeader,
|
|
53
|
+
DrawerBody,
|
|
54
|
+
DrawerFooter
|
|
55
|
+
})
|
|
56
|
+
}), this);
|
|
57
|
+
}
|
|
50
58
|
}
|
|
51
|
-
_Drawer = Drawer;
|
|
52
|
-
setComponentTemplate(precompileTemplate("\n <Overlay @isOpen={{@isOpen}} @onClose={{@onClose}} @onOpen={{@onOpen}} @didClose={{@didClose}} @renderInPlace={{@renderInPlace}} @target={{@target}} @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 class=@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 class=@classes.closeButton}} />\n {{/if}}\n\n {{yield (hash CloseButton=(component CloseButton onClick=@onClose class=(this.classes.closeButton class=@classes.closeButton)) Header=(component DrawerHeader labelledById=this.headerId classFromParent=(this.classes.header class=@classes.header)) Body=(component DrawerBody placement=this.placement classFromParent=(this.classes.body class=@classes.body)) Footer=(component DrawerFooter placement=this.placement classFromParent=(this.classes.footer class=@classes.footer)) headerId=this.headerId)}}\n </div>\n </Overlay>\n ", {
|
|
53
|
-
strictMode: true,
|
|
54
|
-
scope: () => ({
|
|
55
|
-
Overlay,
|
|
56
|
-
CloseButton,
|
|
57
|
-
hash,
|
|
58
|
-
DrawerHeader,
|
|
59
|
-
DrawerBody,
|
|
60
|
-
DrawerFooter
|
|
61
|
-
})
|
|
62
|
-
}), _Drawer);
|
|
63
59
|
|
|
64
60
|
export { Drawer as default };
|
|
65
61
|
//# sourceMappingURL=drawer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer.js","sources":["../../src/components/drawer.gts"],"sourcesContent":["import 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 {\n useStyles,\n type SlotsToClasses,\n type DrawerSlots,\n type DrawerVariants\n} from '@frontile/theme';\n\nexport interface DrawerArgs\n extends Pick<\n OverlaySignature['Args'],\n | 'isOpen'\n | 'onOpen'\n | 'onClose'\n | 'didClose'\n | 'renderInPlace'\n | 'target'\n | 'transitionDuration'\n | 'backdrop'\n | 'disableTransitions'\n | 'disableFocusTrap'\n | 'focusTrapOptions'\n | 'closeOnOutsideClick'\n | 'closeOnEscapeKey'\n | 'backdropTransition'\n > {\n /**\n * The transition to be used in the Drawer.\n *\n * @defaultValue {name: 'overlay-transition--slide-from-[placement]'}\n */\n transition?: OverlaySignature['Args']['transition'];\n\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 */\n allowClosing?: boolean;\n\n /**\n * If set to false, the close button will not be displayed.\n *\n * @defaultValue true\n */\n allowCloseButton?: boolean;\n\n /**\n * The Close Button size.\n */\n closeButtonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\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 */\n placement?: DrawerVariants['placement'];\n\n /**\n * The Drawer size.\n *\n * @defaultValue 'md'\n */\n size?: DrawerVariants['size'];\n\n classes?: SlotsToClasses<DrawerSlots>;\n}\n\nexport interface DrawerSignature {\n Args: DrawerArgs;\n Blocks: {\n default: [\n {\n CloseButton: WithBoundArgs<typeof CloseButton, '
|
|
1
|
+
{"version":3,"file":"drawer.js","sources":["../../src/components/drawer.gts"],"sourcesContent":["import 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 {\n useStyles,\n type SlotsToClasses,\n type DrawerSlots,\n type DrawerVariants\n} from '@frontile/theme';\n\nexport interface DrawerArgs\n extends Pick<\n OverlaySignature['Args'],\n | 'isOpen'\n | 'onOpen'\n | 'onClose'\n | 'didClose'\n | 'renderInPlace'\n | 'target'\n | 'transitionDuration'\n | 'backdrop'\n | 'disableTransitions'\n | 'disableFocusTrap'\n | 'focusTrapOptions'\n | 'closeOnOutsideClick'\n | 'closeOnEscapeKey'\n | 'backdropTransition'\n > {\n /**\n * The transition to be used in the Drawer.\n *\n * @defaultValue {name: 'overlay-transition--slide-from-[placement]'}\n */\n transition?: OverlaySignature['Args']['transition'];\n\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 */\n allowClosing?: boolean;\n\n /**\n * If set to false, the close button will not be displayed.\n *\n * @defaultValue true\n */\n allowCloseButton?: boolean;\n\n /**\n * The Close Button size.\n */\n closeButtonSize?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\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 */\n placement?: DrawerVariants['placement'];\n\n /**\n * The Drawer size.\n *\n * @defaultValue 'md'\n */\n size?: DrawerVariants['size'];\n\n classes?: SlotsToClasses<DrawerSlots>;\n}\n\nexport interface DrawerSignature {\n Args: DrawerArgs;\n Blocks: {\n default: [\n {\n CloseButton: WithBoundArgs<typeof CloseButton, 'onPress' | 'class'>;\n Header: WithBoundArgs<\n typeof DrawerHeader,\n 'labelledById' | 'classFromParent'\n >;\n Body: WithBoundArgs<typeof DrawerBody, 'classFromParent'>;\n Footer: WithBoundArgs<typeof DrawerFooter, 'classFromParent'>;\n headerId: string;\n }\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class Drawer extends Component<DrawerSignature> {\n headerId = `${guidFor(this)}-header`;\n\n get preventClosing(): boolean {\n return this.args.allowClosing === false;\n }\n\n get showCloseButton(): boolean {\n return (\n this.args.allowClosing !== false && this.args.allowCloseButton !== false\n );\n }\n\n get placement() {\n return this.args.placement || 'right';\n }\n\n get classes() {\n const { drawer } = useStyles();\n\n return drawer({\n placement: this.placement,\n size: this.args.size || 'md'\n });\n }\n get transition() {\n let options: OverlaySignature['Args']['transition'] = {\n name: `overlay-transition--slide-from-${this.placement}`\n };\n\n if (typeof this.args.transition === 'object') {\n return { ...options, ...this.args.transition };\n }\n\n return options;\n }\n\n <template>\n <Overlay\n @isOpen={{@isOpen}}\n @onClose={{@onClose}}\n @onOpen={{@onOpen}}\n @didClose={{@didClose}}\n @renderInPlace={{@renderInPlace}}\n @target={{@target}}\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 class=@classes.base}}\n tabindex=\"0\"\n role=\"dialog\"\n aria-labelledby={{this.headerId}}\n ...attributes\n >\n {{#if this.showCloseButton}}\n <CloseButton\n @onPress={{@onClose}}\n @size={{@closeButtonSize}}\n @class={{this.classes.closeButton class=@classes.closeButton}}\n />\n {{/if}}\n\n {{yield\n (hash\n CloseButton=(component\n CloseButton\n onPress=@onClose\n class=(this.classes.closeButton class=@classes.closeButton)\n )\n Header=(component\n DrawerHeader\n labelledById=this.headerId\n classFromParent=(this.classes.header class=@classes.header)\n )\n Body=(component\n DrawerBody\n placement=this.placement\n classFromParent=(this.classes.body class=@classes.body)\n )\n Footer=(component\n DrawerFooter\n placement=this.placement\n classFromParent=(this.classes.footer class=@classes.footer)\n )\n headerId=this.headerId\n )\n }}\n </div>\n </Overlay>\n </template>\n}\n"],"names":["Drawer","Component","headerId","guidFor","preventClosing","args","allowClosing","showCloseButton","allowCloseButton","placement","classes","drawer","useStyles","size","transition","options","name","setComponentTemplate","precompileTemplate","strictMode","scope","Overlay","CloseButton","hash","DrawerHeader","DrawerBody","DrawerFooter"],"mappings":";;;;;;;;;;;;AAmGe,MAAMA,eAAeC,SAAA,CAAU;AAC5CC,EAAAA,QAAA,GAAW,CAAA,EAAGC,OAAA,CAAQ,IAAI,CAAA,CAAA,OAAA,CAAU;EAEpC,IAAIC,cAAAA,GAA0B;AAC5B,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,YAAY,KAAK,KAAA;AACpC,EAAA;EAEA,IAAIC,eAAAA,GAA2B;AAC7B,IAAA,OACE,IAAI,CAACF,IAAI,CAACC,YAAY,KAAK,KAAA,IAAS,IAAI,CAACD,IAAI,CAACG,gBAAgB,KAAK,KACrE;AACF,EAAA;EAEA,IAAIC,SAAAA,GAAY;AACd,IAAA,OAAO,IAAI,CAACJ,IAAI,CAACI,SAAS,IAAI,OAAA;AAChC,EAAA;EAEA,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAQ,GAAGC,SAAA,EAAA;AAEnB,IAAA,OAAOD,MAAA,CAAO;MACZF,SAAA,EAAW,IAAI,CAACA,SAAS;AACzBI,MAAAA,IAAA,EAAM,IAAI,CAACR,IAAI,CAACQ,IAAI,IAAI;AAC1B,KAAA,CAAA;AACF,EAAA;EACA,IAAIC,UAAAA,GAAa;AACf,IAAA,IAAIC,OAAkC,GAAgB;AACpDC,MAAAA,IAAA,EAAM,CAAA,+BAAA,EAAkC,IAAI,CAACP,SAAS,CAAA;KACxD;IAEA,IAAI,OAAO,IAAI,CAACJ,IAAI,CAACS,UAAU,KAAK,QAAA,EAAU;MAC5C,OAAO;AAAE,QAAA,GAAGC,OAAO;QAAE,GAAG,IAAI,CAACV,IAAI,CAACS;OAAW;AAC/C,IAAA;AAEA,IAAA,OAAOC,OAAA;AACT,EAAA;AAEA,EAAA;IAAAE,oBAAA,CAAAC,kBAAA,CAAA,28CAAA,EA6DA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,OAAA;QAAAC,WAAA;QAAAC,IAAA;QAAAC,YAAA;QAAAC,UAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -3,15 +3,16 @@ import { twMerge } from '@frontile/theme';
|
|
|
3
3
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
4
|
import { setComponentTemplate } from '@ember/component';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
6
|
+
class ModalBody extends Component {
|
|
7
|
+
static {
|
|
8
|
+
setComponentTemplate(precompileTemplate("\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n ", {
|
|
9
|
+
strictMode: true,
|
|
10
|
+
scope: () => ({
|
|
11
|
+
twMerge
|
|
12
|
+
})
|
|
13
|
+
}), this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
15
16
|
|
|
16
17
|
export { ModalBody as default };
|
|
17
18
|
//# sourceMappingURL=body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sources":["../../../src/components/modal/body.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface ModalBodyArgs {\n class?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface ModalBodySignature {\n Args: ModalBodyArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class ModalBody extends Component<ModalBodySignature> {\n <template>\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n </template>\n}\n"],"names":["ModalBody","Component","
|
|
1
|
+
{"version":3,"file":"body.js","sources":["../../../src/components/modal/body.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface ModalBodyArgs {\n class?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface ModalBodySignature {\n Args: ModalBodyArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class ModalBody extends Component<ModalBodySignature> {\n <template>\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n </template>\n}\n"],"names":["ModalBody","Component","setComponentTemplate","precompileTemplate","strictMode","scope","twMerge"],"mappings":";;;;;AAoBe,MAAMA,kBAAkBC,SAAA,CAAU;AAC/C,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,sGAAA,EAIA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|