@frontile/overlays 0.18.0-alpha.0 → 0.18.0-alpha.2

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,10 +1,10 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { type OverlaySignature } from './overlay';
3
- import DrawerBody from './drawer/body';
4
- import DrawerFooter from './drawer/footer';
5
- import DrawerHeader from './drawer/header';
6
- import { CloseButton } from '@frontile/buttons';
7
- import type { WithBoundArgs } from '@glint/template';
3
+ import { type DrawerBodySignature } from './drawer/body';
4
+ import { type DrawerFooterSignature } from './drawer/footer';
5
+ import { type DrawerHeaderSignature } from './drawer/header';
6
+ import { type CloseButtonSignature } from '@frontile/buttons';
7
+ import type { ComponentLike, WithBoundArgs } from '@glint/template';
8
8
  import { type SlotsToClasses, type DrawerSlots, type DrawerVariants } from '@frontile/theme';
9
9
  export interface DrawerArgs extends Pick<OverlaySignature['Args'], 'isOpen' | 'onOpen' | 'onClose' | 'didClose' | 'renderInPlace' | 'target' | 'transitionDuration' | 'backdrop' | 'disableTransitions' | 'disableFocusTrap' | 'focusTrapOptions' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'backdropTransition'> {
10
10
  /**
@@ -51,10 +51,10 @@ export interface DrawerSignature {
51
51
  Blocks: {
52
52
  default: [
53
53
  {
54
- CloseButton: WithBoundArgs<typeof CloseButton, 'onPress' | 'class'>;
55
- Header: WithBoundArgs<typeof DrawerHeader, 'labelledById' | 'classFromParent'>;
56
- Body: WithBoundArgs<typeof DrawerBody, 'classFromParent'>;
57
- Footer: WithBoundArgs<typeof DrawerFooter, 'classFromParent'>;
54
+ CloseButton: WithBoundArgs<ComponentLike<CloseButtonSignature>, 'onPress' | 'class'>;
55
+ Header: WithBoundArgs<ComponentLike<DrawerHeaderSignature>, 'labelledById' | 'classFromParent'>;
56
+ Body: WithBoundArgs<ComponentLike<DrawerBodySignature>, 'classFromParent'>;
57
+ Footer: WithBoundArgs<ComponentLike<DrawerFooterSignature>, 'classFromParent'>;
58
58
  headerId: string;
59
59
  }
60
60
  ];
@@ -1,11 +1,11 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { type OverlaySignature } from './overlay';
3
- import ModalFooter from './modal/footer';
4
- import ModalBody from './modal/body';
5
- import ModalHeader from './modal/header';
6
- import { CloseButton } from '@frontile/buttons';
3
+ import { type ModalFooterSignature } from './modal/footer';
4
+ import { type ModalBodySignature } from './modal/body';
5
+ import { type ModalHeaderSignature } from './modal/header';
6
+ import { type CloseButtonSignature } from '@frontile/buttons';
7
7
  import { type SlotsToClasses, type ModalSlots, type ModalVariants } from '@frontile/theme';
8
- import type { WithBoundArgs } from '@glint/template';
8
+ import type { ComponentLike, WithBoundArgs } from '@glint/template';
9
9
  export interface ModalArgs extends Pick<OverlaySignature['Args'], 'isOpen' | 'onOpen' | 'onClose' | 'didClose' | 'renderInPlace' | 'target' | 'transitionDuration' | 'backdrop' | 'disableTransitions' | 'disableFocusTrap' | 'focusTrapOptions' | 'closeOnOutsideClick' | 'closeOnEscapeKey' | 'backdropTransition'> {
10
10
  /**
11
11
  * The transition to be used in the Modal.
@@ -50,10 +50,10 @@ export interface ModalSignature {
50
50
  Blocks: {
51
51
  default: [
52
52
  {
53
- CloseButton: WithBoundArgs<typeof CloseButton, 'onPress' | 'class'>;
54
- Header: WithBoundArgs<typeof ModalHeader, 'labelledById' | 'classFromParent'>;
55
- Body: WithBoundArgs<typeof ModalBody, 'classFromParent'>;
56
- Footer: WithBoundArgs<typeof ModalFooter, 'classFromParent'>;
53
+ CloseButton: WithBoundArgs<ComponentLike<CloseButtonSignature>, 'onPress' | 'class'>;
54
+ Header: WithBoundArgs<ComponentLike<ModalHeaderSignature>, 'labelledById' | 'classFromParent'>;
55
+ Body: WithBoundArgs<ComponentLike<ModalBodySignature>, 'classFromParent'>;
56
+ Footer: WithBoundArgs<ComponentLike<ModalFooterSignature>, 'classFromParent'>;
57
57
  headerId: string;
58
58
  }
59
59
  ];
@@ -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, '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;;;;"}
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, { type DrawerBodySignature } from './drawer/body';\nimport DrawerFooter, { type DrawerFooterSignature } from './drawer/footer';\nimport DrawerHeader, { type DrawerHeaderSignature } from './drawer/header';\nimport { CloseButton, type CloseButtonSignature } from '@frontile/buttons';\nimport type { ComponentLike, 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<\n ComponentLike<CloseButtonSignature>,\n 'onPress' | 'class'\n >;\n Header: WithBoundArgs<\n ComponentLike<DrawerHeaderSignature>,\n 'labelledById' | 'classFromParent'\n >;\n Body: WithBoundArgs<\n ComponentLike<DrawerBodySignature>,\n 'classFromParent'\n >;\n Footer: WithBoundArgs<\n ComponentLike<DrawerFooterSignature>,\n 'classFromParent'\n >;\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":";;;;;;;;;;;;AA4Ge,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;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"modal.js","sources":["../../src/components/modal.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 ModalFooter from './modal/footer';\nimport ModalBody from './modal/body';\nimport ModalHeader from './modal/header';\nimport { CloseButton } from '@frontile/buttons';\nimport {\n useStyles,\n type SlotsToClasses,\n type ModalSlots,\n type ModalVariants\n} from '@frontile/theme';\nimport type { WithBoundArgs } from '@glint/template';\n\nexport interface ModalArgs\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 Modal.\n *\n * @defaultValue {name: 'overlay-transition--zoom'}\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 * If set to true, the modal will be vertically centered\n *\n * @defaultValue false\n */\n isCentered?: boolean;\n\n /**\n * The Modal size.\n *\n * @defaultValue 'lg'\n */\n size?: ModalVariants['size'];\n\n classes?: SlotsToClasses<ModalSlots>;\n}\n\nexport interface ModalSignature {\n Args: ModalArgs;\n Blocks: {\n default: [\n {\n CloseButton: WithBoundArgs<typeof CloseButton, 'onPress' | 'class'>;\n Header: WithBoundArgs<\n typeof ModalHeader,\n 'labelledById' | 'classFromParent'\n >;\n Body: WithBoundArgs<typeof ModalBody, 'classFromParent'>;\n Footer: WithBoundArgs<typeof ModalFooter, 'classFromParent'>;\n headerId: string;\n }\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class Modal extends Component<ModalSignature> {\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 size() {\n return this.args.size || 'lg';\n }\n\n get classes() {\n const { modal } = useStyles();\n\n return modal({\n size: this.size,\n isCentered: this.args.isCentered\n });\n }\n\n get transition() {\n let options: OverlaySignature['Args']['transition'] = {\n name: 'overlay-transition--zoom'\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 ModalHeader\n labelledById=this.headerId\n classFromParent=(this.classes.header class=@classes.header)\n )\n Body=(component\n ModalBody classFromParent=(this.classes.body class=@classes.body)\n )\n Footer=(component\n ModalFooter\n classFromParent=(this.classes.footer class=@classes.footer)\n )\n headerId=this.headerId\n )\n }}\n </div>\n </Overlay>\n </template>\n}\n"],"names":["Modal","Component","headerId","guidFor","preventClosing","args","allowClosing","showCloseButton","allowCloseButton","size","classes","modal","useStyles","isCentered","transition","options","name","setComponentTemplate","precompileTemplate","strictMode","scope","Overlay","CloseButton","hash","ModalHeader","ModalBody","ModalFooter"],"mappings":";;;;;;;;;;;;AAkGe,MAAMA,cAAcC,SAAA,CAAU;AAC3CC,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,IAAAA,GAAO;AACT,IAAA,OAAO,IAAI,CAACJ,IAAI,CAACI,IAAI,IAAI,IAAA;AAC3B,EAAA;EAEA,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;AAElB,IAAA,OAAOD,KAAA,CAAM;MACXF,IAAA,EAAM,IAAI,CAACA,IAAI;AACfI,MAAAA,UAAA,EAAY,IAAI,CAACR,IAAI,CAACQ;AACxB,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,IAAIC,OAAkC,GAAgB;AACpDC,MAAAA,IAAA,EAAM;KACR;IAEA,IAAI,OAAO,IAAI,CAACX,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,s5CAAA,EA0DA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,OAAA;QAAAC,WAAA;QAAAC,IAAA;QAAAC,WAAA;QAAAC,SAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
1
+ {"version":3,"file":"modal.js","sources":["../../src/components/modal.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 ModalFooter, { type ModalFooterSignature } from './modal/footer';\nimport ModalBody, { type ModalBodySignature } from './modal/body';\nimport ModalHeader, { type ModalHeaderSignature } from './modal/header';\nimport { CloseButton, type CloseButtonSignature } from '@frontile/buttons';\nimport {\n useStyles,\n type SlotsToClasses,\n type ModalSlots,\n type ModalVariants\n} from '@frontile/theme';\nimport type { ComponentLike, WithBoundArgs } from '@glint/template';\n\nexport interface ModalArgs\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 Modal.\n *\n * @defaultValue {name: 'overlay-transition--zoom'}\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 * If set to true, the modal will be vertically centered\n *\n * @defaultValue false\n */\n isCentered?: boolean;\n\n /**\n * The Modal size.\n *\n * @defaultValue 'lg'\n */\n size?: ModalVariants['size'];\n\n classes?: SlotsToClasses<ModalSlots>;\n}\n\nexport interface ModalSignature {\n Args: ModalArgs;\n Blocks: {\n default: [\n {\n CloseButton: WithBoundArgs<\n ComponentLike<CloseButtonSignature>,\n 'onPress' | 'class'\n >;\n Header: WithBoundArgs<\n ComponentLike<ModalHeaderSignature>,\n 'labelledById' | 'classFromParent'\n >;\n Body: WithBoundArgs<\n ComponentLike<ModalBodySignature>,\n 'classFromParent'\n >;\n Footer: WithBoundArgs<\n ComponentLike<ModalFooterSignature>,\n 'classFromParent'\n >;\n headerId: string;\n }\n ];\n };\n Element: HTMLDivElement;\n}\n\nexport default class Modal extends Component<ModalSignature> {\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 size() {\n return this.args.size || 'lg';\n }\n\n get classes() {\n const { modal } = useStyles();\n\n return modal({\n size: this.size,\n isCentered: this.args.isCentered\n });\n }\n\n get transition() {\n let options: OverlaySignature['Args']['transition'] = {\n name: 'overlay-transition--zoom'\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 ModalHeader\n labelledById=this.headerId\n classFromParent=(this.classes.header class=@classes.header)\n )\n Body=(component\n ModalBody classFromParent=(this.classes.body class=@classes.body)\n )\n Footer=(component\n ModalFooter\n classFromParent=(this.classes.footer class=@classes.footer)\n )\n headerId=this.headerId\n )\n }}\n </div>\n </Overlay>\n </template>\n}\n"],"names":["Modal","Component","headerId","guidFor","preventClosing","args","allowClosing","showCloseButton","allowCloseButton","size","classes","modal","useStyles","isCentered","transition","options","name","setComponentTemplate","precompileTemplate","strictMode","scope","Overlay","CloseButton","hash","ModalHeader","ModalBody","ModalFooter"],"mappings":";;;;;;;;;;;;AA2Ge,MAAMA,cAAcC,SAAA,CAAU;AAC3CC,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,IAAAA,GAAO;AACT,IAAA,OAAO,IAAI,CAACJ,IAAI,CAACI,IAAI,IAAI,IAAA;AAC3B,EAAA;EAEA,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAO,GAAGC,SAAA,EAAA;AAElB,IAAA,OAAOD,KAAA,CAAM;MACXF,IAAA,EAAM,IAAI,CAACA,IAAI;AACfI,MAAAA,UAAA,EAAY,IAAI,CAACR,IAAI,CAACQ;AACxB,KAAA,CAAA;AACF,EAAA;EAEA,IAAIC,UAAAA,GAAa;AACf,IAAA,IAAIC,OAAkC,GAAgB;AACpDC,MAAAA,IAAA,EAAM;KACR;IAEA,IAAI,OAAO,IAAI,CAACX,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,s5CAAA,EA0DA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,OAAA;QAAAC,WAAA;QAAAC,IAAA;QAAAC,WAAA;QAAAC,SAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontile/overlays",
3
- "version": "0.18.0-alpha.0",
3
+ "version": "0.18.0-alpha.2",
4
4
  "description": "Component Library for Ember Octane apps: overlays",
5
5
  "keywords": [
6
6
  "ember-addon",
@@ -36,12 +36,27 @@
36
36
  "declarations",
37
37
  "dist"
38
38
  ],
39
+ "scripts": {
40
+ "build": "rollup --config",
41
+ "lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
42
+ "lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
43
+ "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
44
+ "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
45
+ "lint:js": "eslint . --cache",
46
+ "lint:js:fix": "eslint . --fix",
47
+ "lint:types": "glint",
48
+ "prepack": "concurrently 'npm:build'",
49
+ "start": "concurrently 'npm:start:*'",
50
+ "start:js": "rollup --config --watch --no-watch.clearScreen",
51
+ "start:types": "glint -d --watch",
52
+ "test": "echo 'A v2 addon does not have tests, run tests in test-app'"
53
+ },
39
54
  "dependencies": {
40
55
  "@embroider/addon-shim": "^1.9.0",
41
56
  "@embroider/macros": "^1.16.10",
42
- "@frontile/buttons": "0.18.0-alpha.0",
43
- "@frontile/theme": "0.18.0-alpha.0",
44
- "@glint/template": "1.5.2",
57
+ "@frontile/buttons": "0.18.0-alpha.2",
58
+ "@frontile/theme": "0.18.0-alpha.2",
59
+ "@glint/template": "^1.7.4",
45
60
  "ember-click-outside": "^6.1.0",
46
61
  "ember-css-transitions": "^4.4.0",
47
62
  "ember-focus-trap": "^1.1.1",
@@ -102,18 +117,5 @@
102
117
  "./components/portal.js": "./dist/_app_/components/portal.js"
103
118
  }
104
119
  },
105
- "scripts": {
106
- "build": "rollup --config",
107
- "lint": "concurrently 'npm:lint:*(!fix)' --names 'lint:'",
108
- "lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
109
- "lint:hbs": "ember-template-lint . --no-error-on-unmatched-pattern",
110
- "lint:hbs:fix": "ember-template-lint . --fix --no-error-on-unmatched-pattern",
111
- "lint:js": "eslint . --cache",
112
- "lint:js:fix": "eslint . --fix",
113
- "lint:types": "glint",
114
- "start": "concurrently 'npm:start:*'",
115
- "start:js": "rollup --config --watch --no-watch.clearScreen",
116
- "start:types": "glint -d --watch",
117
- "test": "echo 'A v2 addon does not have tests, run tests in test-app'"
118
- }
119
- }
120
+ "gitHead": "43e69f7d367baa0fc78b46bf11625a8b3979534a"
121
+ }