frontile 0.18.0-alpha.2 → 0.18.0-alpha.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/control-blur.d.ts +63 -0
- package/declarations/-private/dialog.d.ts +15 -0
- package/declarations/-private/dom.d.ts +3 -0
- package/declarations/-private/get-config.d.ts +2 -0
- package/declarations/-private/intent-icons.d.ts +9 -0
- package/declarations/-private/manager.d.ts +20 -0
- package/declarations/-private/notification-stack.d.ts +76 -0
- package/declarations/-private/notification.d.ts +40 -0
- package/declarations/-private/timer.d.ts +12 -0
- package/declarations/-private/types.d.ts +126 -0
- package/declarations/buttons.d.ts +1 -0
- package/declarations/collections.d.ts +1 -0
- package/declarations/components/buttons/button-group.d.ts +24 -0
- package/declarations/components/buttons/button.d.ts +88 -0
- package/declarations/components/buttons/chip.d.ts +85 -0
- package/declarations/components/buttons/close-button.d.ts +55 -0
- package/declarations/components/buttons/index.d.ts +6 -0
- package/declarations/components/buttons/segmented-control/item.d.ts +50 -0
- package/declarations/components/buttons/segmented-control/segmented-control.d.ts +210 -0
- package/declarations/components/buttons/segmented-control.d.ts +3 -0
- package/declarations/components/buttons/toggle-button.d.ts +28 -0
- package/declarations/components/collections/calendar/calendar.d.ts +585 -0
- package/declarations/components/collections/calendar/day-cell.d.ts +19 -0
- package/declarations/components/collections/calendar/header.d.ts +56 -0
- package/declarations/components/collections/calendar/icons.d.ts +14 -0
- package/declarations/components/collections/calendar/month-grid.d.ts +36 -0
- package/declarations/components/collections/calendar/types.d.ts +94 -0
- package/declarations/components/collections/calendar/utils.d.ts +51 -0
- package/declarations/components/collections/calendar/year-grid.d.ts +32 -0
- package/declarations/components/collections/calendar.d.ts +3 -0
- package/declarations/components/collections/command/command.d.ts +195 -0
- package/declarations/components/collections/command/dialog.d.ts +44 -0
- package/declarations/components/collections/command/footer.d.ts +61 -0
- package/declarations/components/collections/command/index.d.ts +6 -0
- package/declarations/components/collections/command/input.d.ts +131 -0
- package/declarations/components/collections/command/list.d.ts +135 -0
- package/declarations/components/collections/command.d.ts +2 -0
- package/declarations/components/collections/dropdown/dropdown.d.ts +190 -0
- package/declarations/components/collections/dropdown/menu-context.d.ts +64 -0
- package/declarations/components/collections/dropdown/sub.d.ts +195 -0
- package/declarations/components/collections/dropdown.d.ts +2 -0
- package/declarations/components/collections/index.d.ts +5 -0
- package/declarations/components/collections/listbox/group.d.ts +62 -0
- package/declarations/components/collections/listbox/item.d.ts +140 -0
- package/declarations/components/collections/listbox/listbox.d.ts +102 -0
- package/declarations/components/collections/listbox.d.ts +2 -0
- package/declarations/components/collections/simple-table/body.d.ts +481 -0
- package/declarations/components/collections/simple-table/cell.d.ts +479 -0
- package/declarations/components/collections/simple-table/column.d.ts +471 -0
- package/declarations/components/collections/simple-table/footer.d.ts +482 -0
- package/declarations/components/collections/simple-table/header.d.ts +482 -0
- package/declarations/components/collections/simple-table/index.d.ts +498 -0
- package/declarations/components/collections/simple-table/row.d.ts +483 -0
- package/declarations/components/collections/table/cell-default.d.ts +43 -0
- package/declarations/components/collections/table/cell-for.d.ts +38 -0
- package/declarations/components/collections/table/cell-rendering-context.d.ts +24 -0
- package/declarations/components/collections/table/checkbox.d.ts +50 -0
- package/declarations/components/collections/table/column-visibility.d.ts +468 -0
- package/declarations/components/collections/table/icons.d.ts +11 -0
- package/declarations/components/collections/table/index.d.ts +4 -0
- package/declarations/components/collections/table/sort-button.d.ts +465 -0
- package/declarations/components/collections/table/table.d.ts +627 -0
- package/declarations/components/collections/table/types.d.ts +58 -0
- package/declarations/components/collections/table/utils.d.ts +6 -0
- package/declarations/components/collections/table.d.ts +2 -0
- package/declarations/components/disclosure/accordion/accordion.d.ts +247 -0
- package/declarations/components/disclosure/accordion/item.d.ts +96 -0
- package/declarations/components/disclosure/accordion.d.ts +3 -0
- package/declarations/components/disclosure/icons.d.ts +9 -0
- package/declarations/components/disclosure/index.d.ts +1 -0
- package/declarations/components/forms/autocomplete.d.ts +446 -0
- package/declarations/components/forms/checkbox-group.d.ts +62 -0
- package/declarations/components/forms/checkbox.d.ts +62 -0
- package/declarations/components/forms/field-types.d.ts +14 -0
- package/declarations/components/forms/field.d.ts +87 -0
- package/declarations/components/forms/form-control.d.ts +101 -0
- package/declarations/components/forms/form-description.d.ts +30 -0
- package/declarations/components/forms/form-feedback.d.ts +64 -0
- package/declarations/components/forms/form.d.ts +255 -0
- package/declarations/components/forms/icons.d.ts +7 -0
- package/declarations/components/forms/index.d.ts +20 -0
- package/declarations/components/forms/input-otp.d.ts +321 -0
- package/declarations/components/forms/input.d.ts +188 -0
- package/declarations/components/forms/label.d.ts +53 -0
- package/declarations/components/forms/native-select.d.ts +251 -0
- package/declarations/components/forms/radio-group.d.ts +64 -0
- package/declarations/components/forms/radio.d.ts +68 -0
- package/declarations/components/forms/select/end-content.d.ts +31 -0
- package/declarations/components/forms/select/native-mirror.d.ts +44 -0
- package/declarations/components/forms/select/select.d.ts +454 -0
- package/declarations/components/forms/select/selected-items.d.ts +80 -0
- package/declarations/components/forms/select/trigger.d.ts +81 -0
- package/declarations/components/forms/select/types.d.ts +431 -0
- package/declarations/components/forms/select.d.ts +2 -0
- package/declarations/components/forms/switch.d.ts +152 -0
- package/declarations/components/forms/textarea.d.ts +104 -0
- package/declarations/components/navigation/external-link.d.ts +94 -0
- package/declarations/components/navigation/index.d.ts +4 -0
- package/declarations/components/navigation/pagination/icons.d.ts +13 -0
- package/declarations/components/navigation/pagination/pagination.d.ts +279 -0
- package/declarations/components/navigation/pagination/range.d.ts +34 -0
- package/declarations/components/navigation/pagination.d.ts +3 -0
- package/declarations/components/navigation/tab-nav/item.d.ts +79 -0
- package/declarations/components/navigation/tab-nav/tab-nav.d.ts +165 -0
- package/declarations/components/navigation/tab-nav.d.ts +3 -0
- package/declarations/components/navigation/tabs/panel.d.ts +28 -0
- package/declarations/components/navigation/tabs/tab.d.ts +46 -0
- package/declarations/components/navigation/tabs/tabs.d.ts +227 -0
- package/declarations/components/navigation/tabs.d.ts +4 -0
- package/declarations/components/notifications/icons.d.ts +9 -0
- package/declarations/components/notifications/index.d.ts +12 -0
- package/declarations/components/notifications/notification-card.d.ts +100 -0
- package/declarations/components/notifications/notifications-container.d.ts +148 -0
- package/declarations/components/overlays/backdrop.d.ts +39 -0
- package/declarations/components/overlays/drawer/body.d.ts +17 -0
- package/declarations/components/overlays/drawer/drag-handle.d.ts +26 -0
- package/declarations/components/overlays/drawer/footer.d.ts +17 -0
- package/declarations/components/overlays/drawer/header.d.ts +140 -0
- package/declarations/components/overlays/drawer/selectors.d.ts +22 -0
- package/declarations/components/overlays/drawer.d.ts +293 -0
- package/declarations/components/overlays/index.d.ts +14 -0
- package/declarations/components/overlays/modal/body.d.ts +17 -0
- package/declarations/components/overlays/modal/footer.d.ts +17 -0
- package/declarations/components/overlays/modal/header.d.ts +35 -0
- package/declarations/components/overlays/modal.d.ts +146 -0
- package/declarations/components/overlays/mount-animation.d.ts +81 -0
- package/declarations/components/overlays/overlay.d.ts +218 -0
- package/declarations/components/overlays/popover.d.ts +452 -0
- package/declarations/components/overlays/portal-target.d.ts +19 -0
- package/declarations/components/overlays/portal.d.ts +38 -0
- package/declarations/components/overlays/tooltip.d.ts +401 -0
- package/declarations/components/status/alert.d.ts +134 -0
- package/declarations/components/status/index.d.ts +2 -0
- package/declarations/components/status/progress-bar.d.ts +115 -0
- package/declarations/components/utilities/avatar.d.ts +90 -0
- package/declarations/components/utilities/collapsible.d.ts +64 -0
- package/declarations/components/utilities/divider.d.ts +25 -0
- package/declarations/components/utilities/index.d.ts +15 -0
- package/declarations/components/utilities/kbd.d.ts +92 -0
- package/declarations/components/utilities/skeleton.d.ts +31 -0
- package/declarations/components/utilities/spinner.d.ts +26 -0
- package/declarations/components/utilities/visually-hidden.d.ts +9 -0
- package/declarations/disclosure.d.ts +1 -0
- package/declarations/forms.d.ts +1 -0
- package/declarations/index.d.ts +9 -7
- package/declarations/modifiers/drag-to-dismiss.d.ts +22 -0
- package/declarations/modifiers/press.d.ts +55 -0
- package/declarations/navigation.d.ts +1 -0
- package/declarations/notifications.d.ts +1 -0
- package/declarations/overlays.d.ts +1 -0
- package/declarations/services/notifications.d.ts +20 -0
- package/declarations/status.d.ts +1 -0
- package/declarations/template-registry.d.ts +55 -2
- package/declarations/test-support.d.ts +3 -0
- package/declarations/utilities.d.ts +1 -0
- package/declarations/utils/deferred-work.d.ts +24 -0
- package/declarations/utils/filter.d.ts +87 -0
- package/declarations/utils/forms-utils-index.d.ts +3 -0
- package/declarations/utils/keys.d.ts +52 -0
- package/declarations/utils/listManager.d.ts +158 -0
- package/declarations/utils/nested-data.d.ts +44 -0
- package/declarations/utils/prefers-reduced-motion.d.ts +3 -0
- package/declarations/utils/ref.d.ts +14 -0
- package/declarations/utils/roving-focus.d.ts +66 -0
- package/declarations/utils/safe-area.d.ts +52 -0
- package/declarations/utils/safe-styles.d.ts +2 -0
- package/declarations/utils/selection-indicator.d.ts +65 -0
- package/declarations/utils/standard-validator.d.ts +176 -0
- package/declarations/utils/toggle.d.ts +9 -0
- package/dist/_app_/services/notifications.js +1 -0
- package/dist/buttons.js +8 -0
- package/dist/buttons.js.map +1 -0
- package/dist/collections.js +13 -0
- package/dist/collections.js.map +1 -0
- package/dist/components/buttons/button-group.js +31 -0
- package/dist/components/buttons/button-group.js.map +1 -0
- package/dist/components/buttons/button.js +120 -0
- package/dist/components/buttons/button.js.map +1 -0
- package/dist/components/buttons/chip.js +44 -0
- package/dist/components/buttons/chip.js.map +1 -0
- package/dist/components/buttons/close-button.js +84 -0
- package/dist/components/buttons/close-button.js.map +1 -0
- package/dist/components/buttons/index.js +8 -0
- package/dist/components/buttons/index.js.map +1 -0
- package/dist/components/buttons/segmented-control/item.js +55 -0
- package/dist/components/buttons/segmented-control/item.js.map +1 -0
- package/dist/components/buttons/segmented-control/segmented-control.js +175 -0
- package/dist/components/buttons/segmented-control/segmented-control.js.map +1 -0
- package/dist/components/buttons/segmented-control.js +3 -0
- package/dist/components/buttons/segmented-control.js.map +1 -0
- package/dist/components/buttons/toggle-button.js +40 -0
- package/dist/components/buttons/toggle-button.js.map +1 -0
- package/dist/components/collections/calendar/calendar.js +808 -0
- package/dist/components/collections/calendar/calendar.js.map +1 -0
- package/dist/components/collections/calendar/day-cell.js +16 -0
- package/dist/components/collections/calendar/day-cell.js.map +1 -0
- package/dist/components/collections/calendar/header.js +48 -0
- package/dist/components/collections/calendar/header.js.map +1 -0
- package/dist/components/collections/calendar/icons.js +23 -0
- package/dist/components/collections/calendar/icons.js.map +1 -0
- package/dist/components/collections/calendar/month-grid.js +14 -0
- package/dist/components/collections/calendar/month-grid.js.map +1 -0
- package/dist/components/collections/calendar/types.js +2 -0
- package/dist/components/collections/calendar/types.js.map +1 -0
- package/dist/components/collections/calendar/utils.js +199 -0
- package/dist/components/collections/calendar/utils.js.map +1 -0
- package/dist/components/collections/calendar/year-grid.js +117 -0
- package/dist/components/collections/calendar/year-grid.js.map +1 -0
- package/dist/components/collections/calendar.js +2 -0
- package/dist/components/collections/calendar.js.map +1 -0
- package/dist/components/collections/command/command.js +263 -0
- package/dist/components/collections/command/command.js.map +1 -0
- package/dist/components/collections/command/dialog.js +100 -0
- package/dist/components/collections/command/dialog.js.map +1 -0
- package/dist/components/collections/command/footer.js +60 -0
- package/dist/components/collections/command/footer.js.map +1 -0
- package/dist/components/collections/command/index.js +6 -0
- package/dist/components/collections/command/index.js.map +1 -0
- package/dist/components/collections/command/input.js +45 -0
- package/dist/components/collections/command/input.js.map +1 -0
- package/dist/components/collections/command/list.js +70 -0
- package/dist/components/collections/command/list.js.map +1 -0
- package/dist/components/collections/command.js +6 -0
- package/dist/components/collections/command.js.map +1 -0
- package/dist/components/collections/dropdown/dropdown.js +206 -0
- package/dist/components/collections/dropdown/dropdown.js.map +1 -0
- package/dist/components/collections/dropdown/menu-context.js +62 -0
- package/dist/components/collections/dropdown/menu-context.js.map +1 -0
- package/dist/components/collections/dropdown/sub.js +256 -0
- package/dist/components/collections/dropdown/sub.js.map +1 -0
- package/dist/components/collections/dropdown.js +2 -0
- package/dist/components/collections/dropdown.js.map +1 -0
- package/dist/components/collections/index.js +13 -0
- package/dist/components/collections/index.js.map +1 -0
- package/dist/components/collections/listbox/group.js +60 -0
- package/dist/components/collections/listbox/group.js.map +1 -0
- package/dist/components/collections/listbox/item.js +197 -0
- package/dist/components/collections/listbox/item.js.map +1 -0
- package/dist/components/collections/listbox/listbox.js +187 -0
- package/dist/components/collections/listbox/listbox.js.map +1 -0
- package/dist/components/collections/listbox.js +4 -0
- package/dist/components/collections/listbox.js.map +1 -0
- package/dist/components/collections/simple-table/body.js +32 -0
- package/dist/components/collections/simple-table/body.js.map +1 -0
- package/dist/components/collections/simple-table/cell.js +27 -0
- package/dist/components/collections/simple-table/cell.js.map +1 -0
- package/dist/components/collections/simple-table/column.js +26 -0
- package/dist/components/collections/simple-table/column.js.map +1 -0
- package/dist/components/collections/simple-table/footer.js +44 -0
- package/dist/components/collections/simple-table/footer.js.map +1 -0
- package/dist/components/collections/simple-table/header.js +44 -0
- package/dist/components/collections/simple-table/header.js.map +1 -0
- package/dist/components/collections/simple-table/index.js +60 -0
- package/dist/components/collections/simple-table/index.js.map +1 -0
- package/dist/components/collections/simple-table/row.js +33 -0
- package/dist/components/collections/simple-table/row.js.map +1 -0
- package/dist/components/collections/table/cell-default.js +39 -0
- package/dist/components/collections/table/cell-default.js.map +1 -0
- package/dist/components/collections/table/cell-for.js +34 -0
- package/dist/components/collections/table/cell-for.js.map +1 -0
- package/dist/components/collections/table/cell-rendering-context.js +39 -0
- package/dist/components/collections/table/cell-rendering-context.js.map +1 -0
- package/dist/components/collections/table/checkbox.js +53 -0
- package/dist/components/collections/table/checkbox.js.map +1 -0
- package/dist/components/collections/table/column-visibility.js +58 -0
- package/dist/components/collections/table/column-visibility.js.map +1 -0
- package/dist/components/collections/table/icons.js +19 -0
- package/dist/components/collections/table/icons.js.map +1 -0
- package/dist/components/collections/table/index.js +3 -0
- package/dist/components/collections/table/index.js.map +1 -0
- package/dist/components/collections/table/sort-button.js +32 -0
- package/dist/components/collections/table/sort-button.js.map +1 -0
- package/dist/components/collections/table/table.js +488 -0
- package/dist/components/collections/table/table.js.map +1 -0
- package/dist/components/collections/table/types.js +2 -0
- package/dist/components/collections/table/types.js.map +1 -0
- package/dist/components/collections/table/utils.js +19 -0
- package/dist/components/collections/table/utils.js.map +1 -0
- package/dist/components/collections/table.js +3 -0
- package/dist/components/collections/table.js.map +1 -0
- package/dist/components/disclosure/accordion/accordion.js +225 -0
- package/dist/components/disclosure/accordion/accordion.js.map +1 -0
- package/dist/components/disclosure/accordion/item.js +86 -0
- package/dist/components/disclosure/accordion/item.js.map +1 -0
- package/dist/components/disclosure/accordion.js +3 -0
- package/dist/components/disclosure/accordion.js.map +1 -0
- package/dist/components/disclosure/icons.js +13 -0
- package/dist/components/disclosure/icons.js.map +1 -0
- package/dist/components/disclosure/index.js +3 -0
- package/dist/components/disclosure/index.js.map +1 -0
- package/dist/components/forms/autocomplete.js +351 -0
- package/dist/components/forms/autocomplete.js.map +1 -0
- package/dist/components/forms/checkbox-group.js +29 -0
- package/dist/components/forms/checkbox-group.js.map +1 -0
- package/dist/components/forms/checkbox.js +50 -0
- package/dist/components/forms/checkbox.js.map +1 -0
- package/dist/components/forms/field-types.js +2 -0
- package/dist/components/forms/field-types.js.map +1 -0
- package/dist/components/forms/field.js +105 -0
- package/dist/components/forms/field.js.map +1 -0
- package/dist/components/forms/form-control.js +70 -0
- package/dist/components/forms/form-control.js.map +1 -0
- package/dist/components/forms/form-description.js +24 -0
- package/dist/components/forms/form-description.js.map +1 -0
- package/dist/components/forms/form-feedback.js +53 -0
- package/dist/components/forms/form-feedback.js.map +1 -0
- package/dist/components/forms/form.js +397 -0
- package/dist/components/forms/form.js.map +1 -0
- package/dist/components/forms/icons.js +13 -0
- package/dist/components/forms/icons.js.map +1 -0
- package/dist/components/forms/index.js +20 -0
- package/dist/components/forms/index.js.map +1 -0
- package/dist/components/forms/input-otp.js +407 -0
- package/dist/components/forms/input-otp.js.map +1 -0
- package/dist/components/forms/input.js +137 -0
- package/dist/components/forms/input.js.map +1 -0
- package/dist/components/forms/label.js +23 -0
- package/dist/components/forms/label.js.map +1 -0
- package/dist/components/forms/native-select.js +134 -0
- package/dist/components/forms/native-select.js.map +1 -0
- package/dist/components/forms/radio-group.js +29 -0
- package/dist/components/forms/radio-group.js.map +1 -0
- package/dist/components/forms/radio.js +49 -0
- package/dist/components/forms/radio.js.map +1 -0
- package/dist/components/forms/select/end-content.js +24 -0
- package/dist/components/forms/select/end-content.js.map +1 -0
- package/dist/components/forms/select/native-mirror.js +29 -0
- package/dist/components/forms/select/native-mirror.js.map +1 -0
- package/dist/components/forms/select/select.js +629 -0
- package/dist/components/forms/select/select.js.map +1 -0
- package/dist/components/forms/select/selected-items.js +63 -0
- package/dist/components/forms/select/selected-items.js.map +1 -0
- package/dist/components/forms/select/trigger.js +30 -0
- package/dist/components/forms/select/trigger.js.map +1 -0
- package/dist/components/forms/select/types.js +2 -0
- package/dist/components/forms/select/types.js.map +1 -0
- package/dist/components/forms/select.js +2 -0
- package/dist/components/forms/select.js.map +1 -0
- package/dist/components/forms/switch.js +63 -0
- package/dist/components/forms/switch.js.map +1 -0
- package/dist/components/forms/textarea.js +53 -0
- package/dist/components/forms/textarea.js.map +1 -0
- package/dist/components/navigation/external-link.js +107 -0
- package/dist/components/navigation/external-link.js.map +1 -0
- package/dist/components/navigation/index.js +9 -0
- package/dist/components/navigation/index.js.map +1 -0
- package/dist/components/navigation/pagination/icons.js +23 -0
- package/dist/components/navigation/pagination/icons.js.map +1 -0
- package/dist/components/navigation/pagination/pagination.js +216 -0
- package/dist/components/navigation/pagination/pagination.js.map +1 -0
- package/dist/components/navigation/pagination/range.js +58 -0
- package/dist/components/navigation/pagination/range.js.map +1 -0
- package/dist/components/navigation/pagination.js +3 -0
- package/dist/components/navigation/pagination.js.map +1 -0
- package/dist/components/navigation/tab-nav/item.js +90 -0
- package/dist/components/navigation/tab-nav/item.js.map +1 -0
- package/dist/components/navigation/tab-nav/tab-nav.js +79 -0
- package/dist/components/navigation/tab-nav/tab-nav.js.map +1 -0
- package/dist/components/navigation/tab-nav.js +3 -0
- package/dist/components/navigation/tab-nav.js.map +1 -0
- package/dist/components/navigation/tabs/panel.js +23 -0
- package/dist/components/navigation/tabs/panel.js.map +1 -0
- package/dist/components/navigation/tabs/tab.js +45 -0
- package/dist/components/navigation/tabs/tab.js.map +1 -0
- package/dist/components/navigation/tabs/tabs.js +156 -0
- package/dist/components/navigation/tabs/tabs.js.map +1 -0
- package/dist/components/navigation/tabs.js +4 -0
- package/dist/components/navigation/tabs.js.map +1 -0
- package/dist/components/notifications/index.js +5 -0
- package/dist/components/notifications/index.js.map +1 -0
- package/dist/components/notifications/notification-card.js +16 -0
- package/dist/components/notifications/notification-card.js.map +1 -0
- package/dist/components/notifications/notifications-container.js +269 -0
- package/dist/components/notifications/notifications-container.js.map +1 -0
- package/dist/components/overlays/backdrop.js +44 -0
- package/dist/components/overlays/backdrop.js.map +1 -0
- package/dist/components/overlays/drawer/body.js +18 -0
- package/dist/components/overlays/drawer/body.js.map +1 -0
- package/dist/components/overlays/drawer/drag-handle.js +18 -0
- package/dist/components/overlays/drawer/drag-handle.js.map +1 -0
- package/dist/components/overlays/drawer/footer.js +18 -0
- package/dist/components/overlays/drawer/footer.js.map +1 -0
- package/dist/components/overlays/drawer/header.js +61 -0
- package/dist/components/overlays/drawer/header.js.map +1 -0
- package/dist/components/overlays/drawer/selectors.js +29 -0
- package/dist/components/overlays/drawer/selectors.js.map +1 -0
- package/dist/components/overlays/drawer.js +175 -0
- package/dist/components/overlays/drawer.js.map +1 -0
- package/dist/components/overlays/index.js +15 -0
- package/dist/components/overlays/index.js.map +1 -0
- package/dist/components/overlays/modal/body.js +18 -0
- package/dist/components/overlays/modal/body.js.map +1 -0
- package/dist/components/overlays/modal/footer.js +18 -0
- package/dist/components/overlays/modal/footer.js.map +1 -0
- package/dist/components/overlays/modal/header.js +25 -0
- package/dist/components/overlays/modal/header.js.map +1 -0
- package/dist/components/overlays/modal.js +129 -0
- package/dist/components/overlays/modal.js.map +1 -0
- package/dist/components/overlays/mount-animation.js +146 -0
- package/dist/components/overlays/mount-animation.js.map +1 -0
- package/dist/components/overlays/overlay.js +321 -0
- package/dist/components/overlays/overlay.js.map +1 -0
- package/dist/components/overlays/popover.js +647 -0
- package/dist/components/overlays/popover.js.map +1 -0
- package/dist/components/overlays/portal-target.js +10 -0
- package/dist/components/overlays/portal-target.js.map +1 -0
- package/dist/components/overlays/portal.js +111 -0
- package/dist/components/overlays/portal.js.map +1 -0
- package/dist/components/overlays/tooltip.js +377 -0
- package/dist/components/overlays/tooltip.js.map +1 -0
- package/dist/components/status/alert.js +146 -0
- package/dist/components/status/alert.js.map +1 -0
- package/dist/components/status/index.js +3 -0
- package/dist/components/status/index.js.map +1 -0
- package/dist/components/status/progress-bar.js +126 -0
- package/dist/components/status/progress-bar.js.map +1 -0
- package/dist/components/utilities/avatar.js +48 -0
- package/dist/components/utilities/avatar.js.map +1 -0
- package/dist/components/utilities/collapsible.js +210 -0
- package/dist/components/utilities/collapsible.js.map +1 -0
- package/dist/components/utilities/divider.js +37 -0
- package/dist/components/utilities/divider.js.map +1 -0
- package/dist/components/utilities/index.js +16 -0
- package/dist/components/utilities/index.js.map +1 -0
- package/dist/components/utilities/kbd.js +88 -0
- package/dist/components/utilities/kbd.js.map +1 -0
- package/dist/components/utilities/skeleton.js +14 -0
- package/dist/components/utilities/skeleton.js.map +1 -0
- package/dist/components/utilities/spinner.js +14 -0
- package/dist/components/utilities/spinner.js.map +1 -0
- package/dist/components/utilities/visually-hidden.js +10 -0
- package/dist/components/utilities/visually-hidden.js.map +1 -0
- package/dist/control-blur-C8OnSQR5.js +124 -0
- package/dist/control-blur-C8OnSQR5.js.map +1 -0
- package/dist/dialog-CreV7aPQ.js +27 -0
- package/dist/dialog-CreV7aPQ.js.map +1 -0
- package/dist/disclosure.js +3 -0
- package/dist/disclosure.js.map +1 -0
- package/dist/dom-cKWVvtkd.js +116 -0
- package/dist/dom-cKWVvtkd.js.map +1 -0
- package/dist/forms.js +20 -0
- package/dist/forms.js.map +1 -0
- package/dist/index.js +83 -7
- package/dist/index.js.map +1 -1
- package/dist/intent-icons-DpEViO8C.js +19 -0
- package/dist/intent-icons-DpEViO8C.js.map +1 -0
- package/dist/manager-CDIZzrQ9.js +388 -0
- package/dist/manager-CDIZzrQ9.js.map +1 -0
- package/dist/modifiers/drag-to-dismiss.js +392 -0
- package/dist/modifiers/drag-to-dismiss.js.map +1 -0
- package/dist/modifiers/press.js +321 -0
- package/dist/modifiers/press.js.map +1 -0
- package/dist/navigation.js +9 -0
- package/dist/navigation.js.map +1 -0
- package/dist/notification-card-D5fd-Sxa.js +330 -0
- package/dist/notification-card-D5fd-Sxa.js.map +1 -0
- package/dist/notifications.js +5 -0
- package/dist/notifications.js.map +1 -0
- package/dist/overlays.js +15 -0
- package/dist/overlays.js.map +1 -0
- package/dist/runtime--fcdnjmJ-BOdRhmsS.js +67 -0
- package/dist/runtime--fcdnjmJ-BOdRhmsS.js.map +1 -0
- package/dist/services/notifications.js +38 -0
- package/dist/services/notifications.js.map +1 -0
- package/dist/status.js +3 -0
- package/dist/status.js.map +1 -0
- package/dist/test-support.js +1316 -0
- package/dist/test-support.js.map +1 -0
- package/dist/utilities.js +16 -0
- package/dist/utilities.js.map +1 -0
- package/dist/utils/deferred-work.js +66 -0
- package/dist/utils/deferred-work.js.map +1 -0
- package/dist/utils/filter.js +166 -0
- package/dist/utils/filter.js.map +1 -0
- package/dist/utils/forms-utils-index.js +24 -0
- package/dist/utils/forms-utils-index.js.map +1 -0
- package/dist/utils/keys.js +259 -0
- package/dist/utils/keys.js.map +1 -0
- package/dist/utils/listManager.js +759 -0
- package/dist/utils/listManager.js.map +1 -0
- package/dist/utils/nested-data.js +196 -0
- package/dist/utils/nested-data.js.map +1 -0
- package/dist/utils/prefers-reduced-motion.js +21 -0
- package/dist/utils/prefers-reduced-motion.js.map +1 -0
- package/dist/utils/ref.js +32 -0
- package/dist/utils/ref.js.map +1 -0
- package/dist/utils/roving-focus.js +206 -0
- package/dist/utils/roving-focus.js.map +1 -0
- package/dist/utils/safe-area.js +133 -0
- package/dist/utils/safe-area.js.map +1 -0
- package/dist/utils/safe-styles.js +15 -0
- package/dist/utils/safe-styles.js.map +1 -0
- package/dist/utils/selection-indicator.js +189 -0
- package/dist/utils/selection-indicator.js.map +1 -0
- package/dist/utils/standard-validator.js +232 -0
- package/dist/utils/standard-validator.js.map +1 -0
- package/dist/utils/toggle.js +46 -0
- package/dist/utils/toggle.js.map +1 -0
- package/package.json +77 -21
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { on } from '@ember/modifier';
|
|
2
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
3
|
+
import { setComponentTemplate } from '@ember/component';
|
|
4
|
+
import templateOnly from '@ember/component/template-only';
|
|
5
|
+
|
|
6
|
+
const handlePress = onPress => {
|
|
7
|
+
return () => onPress?.();
|
|
8
|
+
};
|
|
9
|
+
const DrawerDragHandle = setComponentTemplate(precompileTemplate("<button type=\"button\" aria-label={{if @label @label \"Close drawer\"}} data-drawer-drag-handle class={{@class}} {{on \"click\" (handlePress @onPress)}} ...attributes>\n <span class={{@barClass}}></span>\n</button>", {
|
|
10
|
+
strictMode: true,
|
|
11
|
+
scope: () => ({
|
|
12
|
+
on,
|
|
13
|
+
handlePress
|
|
14
|
+
})
|
|
15
|
+
}), templateOnly());
|
|
16
|
+
|
|
17
|
+
export { DrawerDragHandle, DrawerDragHandle as default };
|
|
18
|
+
//# sourceMappingURL=drag-handle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag-handle.js","sources":["../../../../src/components/overlays/drawer/drag-handle.gts"],"sourcesContent":["import { on } from '@ember/modifier';\nimport type { TOC } from '@ember/component/template-only';\n\nexport interface DrawerDragHandleSignature {\n Args: {\n /**\n * Called when the handle is activated by click, Enter or Space. The drag\n * gesture is attached separately by the Drawer; this is the keyboard and\n * assistive-technology route to the same outcome.\n */\n onPress?: () => void;\n\n /**\n * Accessible name for the handle.\n *\n * @defaultValue 'Close drawer'\n */\n label?: string;\n\n class?: string;\n\n /**\n * @internal\n */\n barClass?: string;\n };\n Element: HTMLButtonElement;\n}\n\nconst handlePress = (onPress?: () => void) => {\n return () => onPress?.();\n};\n\nconst DrawerDragHandle: TOC<DrawerDragHandleSignature> = <template>\n <button\n type=\"button\"\n aria-label={{if @label @label \"Close drawer\"}}\n data-drawer-drag-handle\n class={{@class}}\n {{on \"click\" (handlePress @onPress)}}\n ...attributes\n >\n <span class={{@barClass}}></span>\n </button>\n</template>;\n\nexport { DrawerDragHandle };\nexport default DrawerDragHandle;\n"],"names":["handlePress","onPress","DrawerDragHandle","setComponentTemplate","precompileTemplate","strictMode","scope","on","templateOnly"],"mappings":";;;;;AA6BA,MAAMA,WAAA,GAAeC,OAAoB,IAAA;EACvC,OAAO,MAAMA,OAAA,IAAA;AACf,CAAA;AAEA,MAAMC,gBAAsB,GAAAC,oBAAA,CAA6BC,kBAAA,CAAA,0NAAA,EAWzD;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;IAAAC,EAAA;AAAAP,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAQ,YAAA,EAAA;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { twMerge } from '@frontile/theme';
|
|
3
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
|
+
import { setComponentTemplate } from '@ember/component';
|
|
5
|
+
|
|
6
|
+
class DrawerFooter extends Component {
|
|
7
|
+
static {
|
|
8
|
+
setComponentTemplate(precompileTemplate("<div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n</div>", {
|
|
9
|
+
strictMode: true,
|
|
10
|
+
scope: () => ({
|
|
11
|
+
twMerge
|
|
12
|
+
})
|
|
13
|
+
}), this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { DrawerFooter as default };
|
|
18
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","sources":["../../../../src/components/overlays/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,oFAAA,EAIA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { hash } from '@ember/helper';
|
|
3
|
+
import { modifier } from 'ember-modifier';
|
|
4
|
+
import { twMerge } from '@frontile/theme';
|
|
5
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
|
+
import { setComponentTemplate } from '@ember/component';
|
|
7
|
+
import templateOnly from '@ember/component/template-only';
|
|
8
|
+
|
|
9
|
+
// `data-drawer-header-icon` and `data-drawer-header-description` are what the
|
|
10
|
+
// theme's header grid keys its icon alignment off: the icon spans both text
|
|
11
|
+
// rows only when a description is actually rendered (see `headerContent` in
|
|
12
|
+
// `overlays.ts`). They are structural hooks, not state, so they are always on.
|
|
13
|
+
const DrawerHeaderIcon = setComponentTemplate(precompileTemplate("<div class={{twMerge @classFromParent @class}} data-drawer-header-icon ...attributes>\n {{yield}}\n</div>", {
|
|
14
|
+
strictMode: true,
|
|
15
|
+
scope: () => ({
|
|
16
|
+
twMerge
|
|
17
|
+
})
|
|
18
|
+
}), templateOnly());
|
|
19
|
+
class DrawerHeaderTitle extends Component {
|
|
20
|
+
static {
|
|
21
|
+
setComponentTemplate(precompileTemplate("<div class={{twMerge @classFromParent @class}} ...attributes>\n {{#if (has-block)}}{{yield}}{{else}}{{@value}}{{/if}}\n</div>", {
|
|
22
|
+
strictMode: true,
|
|
23
|
+
scope: () => ({
|
|
24
|
+
twMerge
|
|
25
|
+
})
|
|
26
|
+
}), this);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
class DrawerHeaderDescription extends Component {
|
|
30
|
+
static {
|
|
31
|
+
setComponentTemplate(precompileTemplate("<div class={{twMerge @classFromParent @class}} data-drawer-header-description ...attributes>\n {{#if (has-block)}}{{yield}}{{else}}{{@value}}{{/if}}\n</div>", {
|
|
32
|
+
strictMode: true,
|
|
33
|
+
scope: () => ({
|
|
34
|
+
twMerge
|
|
35
|
+
})
|
|
36
|
+
}), this);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
class DrawerHeader extends Component {
|
|
40
|
+
register = modifier(() => {
|
|
41
|
+
this.args.registerSelf?.(true);
|
|
42
|
+
return () => {
|
|
43
|
+
this.args.registerSelf?.(false);
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
static {
|
|
47
|
+
setComponentTemplate(precompileTemplate("<div id={{@labelledById}} class={{twMerge @classFromParent @class}} {{this.register}} ...attributes>\n <div class={{@contentClass}}>\n {{#if (has-block)}}\n {{yield (hash Icon=(component DrawerHeaderIcon classFromParent=@iconClass) Title=(component DrawerHeaderTitle classFromParent=@titleClass value=@title) Description=(component DrawerHeaderDescription classFromParent=@descriptionClass value=@description))}}\n {{else}}\n {{#if @title}}\n <div class={{@titleClass}}>{{@title}}</div>\n {{/if}}\n {{#if @description}}\n <div class={{@descriptionClass}} data-drawer-header-description>\n {{@description}}\n </div>\n {{/if}}\n {{/if}}\n </div>\n\n {{!-- Only rendered when there is something to put in it: an empty flex\n child would still consume the header's gap, leaving a phantom space to\n the right of the title on every plain header. --}}\n {{#if (has-block \"actions\")}}\n <div class={{@actionsClass}}>\n {{yield to=\"actions\"}}\n </div>\n {{/if}}\n\n {{#if @closeButton}}\n <@closeButton />\n {{/if}}\n</div>", {
|
|
48
|
+
strictMode: true,
|
|
49
|
+
scope: () => ({
|
|
50
|
+
twMerge,
|
|
51
|
+
hash,
|
|
52
|
+
DrawerHeaderIcon,
|
|
53
|
+
DrawerHeaderTitle,
|
|
54
|
+
DrawerHeaderDescription
|
|
55
|
+
})
|
|
56
|
+
}), this);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { DrawerHeaderDescription, DrawerHeaderIcon, DrawerHeaderTitle, DrawerHeader as default };
|
|
61
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.js","sources":["../../../../src/components/overlays/drawer/header.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { hash } from '@ember/helper';\nimport { modifier } from 'ember-modifier';\nimport { twMerge } from '@frontile/theme';\nimport type { TOC } from '@ember/component/template-only';\nimport type { ComponentLike } from '@glint/template';\nimport type { CloseButtonSignature } from '../../buttons/close-button';\n\nexport interface DrawerHeaderIconSignature {\n Args: {\n /**\n * @internal\n */\n classFromParent?: string;\n class?: string;\n };\n Element: HTMLDivElement;\n Blocks: { default: [] };\n}\n\n// `data-drawer-header-icon` and `data-drawer-header-description` are what the\n// theme's header grid keys its icon alignment off: the icon spans both text\n// rows only when a description is actually rendered (see `headerContent` in\n// `overlays.ts`). They are structural hooks, not state, so they are always on.\nconst DrawerHeaderIcon: TOC<DrawerHeaderIconSignature> = <template>\n <div\n class={{twMerge @classFromParent @class}}\n data-drawer-header-icon\n ...attributes\n >\n {{yield}}\n </div>\n</template>;\n\nexport interface DrawerHeaderTitleSignature {\n Args: {\n /**\n * Fallback content, used when this component is given no block.\n */\n value?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n class?: string;\n };\n Element: HTMLDivElement;\n Blocks: { default: [] };\n}\n\nclass DrawerHeaderTitle extends Component<DrawerHeaderTitleSignature> {\n <template>\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{#if (has-block)}}{{yield}}{{else}}{{@value}}{{/if}}\n </div>\n </template>\n}\n\nexport interface DrawerHeaderDescriptionSignature {\n Args: {\n /**\n * Fallback content, used when this component is given no block.\n */\n value?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n class?: string;\n };\n Element: HTMLDivElement;\n Blocks: { default: [] };\n}\n\nclass DrawerHeaderDescription extends Component<DrawerHeaderDescriptionSignature> {\n <template>\n <div\n class={{twMerge @classFromParent @class}}\n data-drawer-header-description\n ...attributes\n >\n {{#if (has-block)}}{{yield}}{{else}}{{@value}}{{/if}}\n </div>\n </template>\n}\n\nexport interface DrawerHeaderArgs {\n /**\n * The id used to reference labelledById in Drawer component\n */\n labelledById: string;\n\n /**\n * Header title. Rendered into the themed title slot when the header is given\n * no block, and used as the fallback content for a blockless `<h.Title />`.\n */\n title?: string;\n\n /**\n * Header description, shown under the title. Behaves like `@title`.\n */\n description?: string;\n\n class?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n\n /**\n * @internal\n */\n iconClass?: string;\n\n /**\n * @internal\n */\n titleClass?: string;\n\n /**\n * @internal\n */\n descriptionClass?: string;\n\n /**\n * @internal\n */\n contentClass?: string;\n\n /**\n * @internal\n */\n actionsClass?: string;\n\n /**\n * Called with `true` when this header is rendered and `false` when it is\n * removed, so the Drawer knows whether it may point `aria-labelledby` at us.\n *\n * @internal\n */\n registerSelf?: (isRendered: boolean) => void;\n\n /**\n * The Drawer's close button, fully bound and rendered inside the header's\n * own grid so it can be centred against the header's actual height. Only\n * present when the Drawer should show a close button at all.\n *\n * @internal\n */\n closeButton?: ComponentLike<CloseButtonSignature>;\n}\n\nexport interface DrawerHeaderSignature {\n Args: DrawerHeaderArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [\n {\n Icon: ComponentLike<DrawerHeaderIconSignature>;\n Title: ComponentLike<DrawerHeaderTitleSignature>;\n Description: ComponentLike<DrawerHeaderDescriptionSignature>;\n }\n ];\n\n /**\n * Controls placed beside the close button. Rendered in flow, so a taller\n * control makes the header band taller -- unlike the close button, which\n * is positioned out of flow precisely so it never does.\n */\n actions: [];\n };\n}\n\nexport default class DrawerHeader extends Component<DrawerHeaderSignature> {\n register = modifier(() => {\n this.args.registerSelf?.(true);\n\n return () => {\n this.args.registerSelf?.(false);\n };\n });\n\n <template>\n <div\n id={{@labelledById}}\n class={{twMerge @classFromParent @class}}\n {{this.register}}\n ...attributes\n >\n <div class={{@contentClass}}>\n {{#if (has-block)}}\n {{yield\n (hash\n Icon=(component DrawerHeaderIcon classFromParent=@iconClass)\n Title=(component\n DrawerHeaderTitle classFromParent=@titleClass value=@title\n )\n Description=(component\n DrawerHeaderDescription\n classFromParent=@descriptionClass\n value=@description\n )\n )\n }}\n {{else}}\n {{#if @title}}\n <div class={{@titleClass}}>{{@title}}</div>\n {{/if}}\n {{#if @description}}\n <div class={{@descriptionClass}} data-drawer-header-description>\n {{@description}}\n </div>\n {{/if}}\n {{/if}}\n </div>\n\n {{! Only rendered when there is something to put in it: an empty flex\n child would still consume the header's gap, leaving a phantom space to\n the right of the title on every plain header. }}\n {{#if (has-block \"actions\")}}\n <div class={{@actionsClass}}>\n {{yield to=\"actions\"}}\n </div>\n {{/if}}\n\n {{#if @closeButton}}\n <@closeButton />\n {{/if}}\n </div>\n </template>\n}\n\nexport { DrawerHeaderIcon, DrawerHeaderTitle, DrawerHeaderDescription };\n"],"names":["DrawerHeaderIcon","setComponentTemplate","precompileTemplate","strictMode","scope","twMerge","templateOnly","DrawerHeaderTitle","Component","DrawerHeaderDescription","DrawerHeader","register","modifier","args","registerSelf","hash"],"mappings":";;;;;;;;AAoBA;AACA;AACA;AACA;AACA,MAAMA,gBAAsB,GAAAC,oBAAA,CAA6BC,kBAAA,CAAA,4GAAA,EAQzD;EAAAC,UAAA,EAAA,IAAA;AAAAC,EAAAA,KAAA,EAAAA,OAAA;AAAAC,IAAAA;AAAA,GAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;AAmBV,MAAMC,0BAA0BC,SAAA,CAAU;AACxC,EAAA;IAAAP,oBAAA,CAAAC,kBAAA,CAAA,gIAAA,EAIA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;AAmBA,MAAMI,gCAAgCD,SAAA,CAAU;AAC9C,EAAA;IAAAP,oBAAA,CAAAC,kBAAA,CAAA,+JAAA,EAQA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;AA0Fe,MAAMK,qBAAqBF,SAAA,CAAU;EAClDG,QAAA,GAAWC,QAAA,CAAS,MAAA;AAClB,IAAA,IAAI,CAACC,IAAI,CAACC,YAAY,GAAG,IAAA,CAAA;AAEzB,IAAA,OAAO,MAAA;AACL,MAAA,IAAI,CAACD,IAAI,CAACC,YAAY,GAAG,KAAA,CAAA;IAC3B,CAAA;AACF,EAAA,CAAA,CAAA;AAEA,EAAA;IAAAb,oBAAA,CAAAC,kBAAA,CAAA,olCAAA,EA+CA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,OAAA;QAAAU,IAAA;QAAAf,gBAAA;QAAAO,iBAAA;AAAAE,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The attributes the drawer's own parts carry so the drag gesture can find
|
|
3
|
+
* them, and the selectors it looks them up by.
|
|
4
|
+
*
|
|
5
|
+
* `dragToDismiss` is a generic modifier: it knows nothing about drawers and
|
|
6
|
+
* takes opaque selector strings. That leaves the emitting element and the
|
|
7
|
+
* consuming selector in different files with nothing tying them together, so
|
|
8
|
+
* renaming an attribute breaks the gesture silently — no type error, and the
|
|
9
|
+
* only symptom is a drag that no longer starts. Both sides read from here
|
|
10
|
+
* instead, and `drawer-selectors-test` asserts the rendered markup still
|
|
11
|
+
* matches, since a template cannot bind an attribute's *name*.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/** Marks the drawer's scrollable body. */
|
|
17
|
+
const DRAWER_BODY_ATTRIBUTE = 'data-drawer-body';
|
|
18
|
+
|
|
19
|
+
/** Marks the drawer's grab handle. */
|
|
20
|
+
const DRAWER_DRAG_HANDLE_ATTRIBUTE = 'data-drawer-drag-handle';
|
|
21
|
+
|
|
22
|
+
/** Passed to `dragToDismiss` as `scrollSelector`. */
|
|
23
|
+
const DRAWER_BODY_SELECTOR = `[${DRAWER_BODY_ATTRIBUTE}]`;
|
|
24
|
+
|
|
25
|
+
/** Passed to `dragToDismiss` as `handleSelector`. */
|
|
26
|
+
const DRAWER_DRAG_HANDLE_SELECTOR = `[${DRAWER_DRAG_HANDLE_ATTRIBUTE}]`;
|
|
27
|
+
|
|
28
|
+
export { DRAWER_BODY_ATTRIBUTE, DRAWER_BODY_SELECTOR, DRAWER_DRAG_HANDLE_ATTRIBUTE, DRAWER_DRAG_HANDLE_SELECTOR };
|
|
29
|
+
//# sourceMappingURL=selectors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.js","sources":["../../../../src/components/overlays/drawer/selectors.ts"],"sourcesContent":["/**\n * The attributes the drawer's own parts carry so the drag gesture can find\n * them, and the selectors it looks them up by.\n *\n * `dragToDismiss` is a generic modifier: it knows nothing about drawers and\n * takes opaque selector strings. That leaves the emitting element and the\n * consuming selector in different files with nothing tying them together, so\n * renaming an attribute breaks the gesture silently — no type error, and the\n * only symptom is a drag that no longer starts. Both sides read from here\n * instead, and `drawer-selectors-test` asserts the rendered markup still\n * matches, since a template cannot bind an attribute's *name*.\n *\n * @internal\n */\n\n/** Marks the drawer's scrollable body. */\nexport const DRAWER_BODY_ATTRIBUTE = 'data-drawer-body';\n\n/** Marks the drawer's grab handle. */\nexport const DRAWER_DRAG_HANDLE_ATTRIBUTE = 'data-drawer-drag-handle';\n\n/** Passed to `dragToDismiss` as `scrollSelector`. */\nexport const DRAWER_BODY_SELECTOR = `[${DRAWER_BODY_ATTRIBUTE}]`;\n\n/** Passed to `dragToDismiss` as `handleSelector`. */\nexport const DRAWER_DRAG_HANDLE_SELECTOR = `[${DRAWER_DRAG_HANDLE_ATTRIBUTE}]`;\n"],"names":["DRAWER_BODY_ATTRIBUTE","DRAWER_DRAG_HANDLE_ATTRIBUTE","DRAWER_BODY_SELECTOR","DRAWER_DRAG_HANDLE_SELECTOR"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACO,MAAMA,qBAAqB,GAAG;;AAErC;AACO,MAAMC,4BAA4B,GAAG;;AAE5C;AACO,MAAMC,oBAAoB,GAAG,CAAA,CAAA,EAAIF,qBAAqB,CAAA,CAAA;;AAE7D;AACO,MAAMG,2BAA2B,GAAG,CAAA,CAAA,EAAIF,4BAA4B,CAAA,CAAA;;;;"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { guidFor } from '@ember/object/internals';
|
|
4
|
+
import { hash } from '@ember/helper';
|
|
5
|
+
import { modifier } from 'ember-modifier';
|
|
6
|
+
import { w as warnIfDialogHasNoAccessibleName } from '../../dialog-CreV7aPQ.js';
|
|
7
|
+
import { Overlay } from './overlay.js';
|
|
8
|
+
import DrawerBody from './drawer/body.js';
|
|
9
|
+
import DrawerFooter from './drawer/footer.js';
|
|
10
|
+
import DrawerHeader from './drawer/header.js';
|
|
11
|
+
import { DrawerDragHandle } from './drawer/drag-handle.js';
|
|
12
|
+
import { DRAWER_BODY_SELECTOR, DRAWER_DRAG_HANDLE_SELECTOR } from './drawer/selectors.js';
|
|
13
|
+
import dragToDismiss from '../../modifiers/drag-to-dismiss.js';
|
|
14
|
+
import { CloseButton } from '../buttons/close-button.js';
|
|
15
|
+
import { useStyles } from '@frontile/theme';
|
|
16
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
17
|
+
import { setComponentTemplate } from '@ember/component';
|
|
18
|
+
import { d as decorateFieldV2, i as initializeDeferredDecorator } from '../../runtime--fcdnjmJ-BOdRhmsS.js';
|
|
19
|
+
|
|
20
|
+
class Drawer extends Component {
|
|
21
|
+
headerId = `${guidFor(this)}-header`;
|
|
22
|
+
// `aria-labelledby` is only useful if it points at an element that actually
|
|
23
|
+
// exists — a dangling reference leaves the dialog with no accessible name at
|
|
24
|
+
// all. The yielded `Header` reports when it is rendered and when it goes
|
|
25
|
+
// away, which keeps the reference correct even for a conditional header.
|
|
26
|
+
// The count itself is deliberately untracked: registration happens while the
|
|
27
|
+
// header's modifier is installing, and reading a tracked value there before
|
|
28
|
+
// writing it trips Glimmer's backtracking assertion. Only the derived flag is
|
|
29
|
+
// tracked, and it is always written, never read, from the callback.
|
|
30
|
+
//
|
|
31
|
+
// The `ref` utility looks like it should replace all of this, and it was
|
|
32
|
+
// tried. It cannot: `Ref.setup` clears `current` unconditionally on teardown,
|
|
33
|
+
// so it answers "what is the current element?" where this needs "does any
|
|
34
|
+
// header exist?" — and those diverge when a header is *replaced* rather than
|
|
35
|
+
// added or removed. Glimmer installs the modifiers of newly rendered elements
|
|
36
|
+
// before tearing down the ones they replace (see the comments in
|
|
37
|
+
// `utils/listManager.ts`), so with a `ref` a header swapped between the
|
|
38
|
+
// branches of an `{{#if}}` leaves `current` undefined and the dialog silently
|
|
39
|
+
// loses its accessible name. A `+1/-1` count is order-independent, which is
|
|
40
|
+
// the whole point of it being a count.
|
|
41
|
+
renderedHeaders = 0;
|
|
42
|
+
static {
|
|
43
|
+
decorateFieldV2(this.prototype, "hasHeader", [tracked], function () {
|
|
44
|
+
return false;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
#hasHeader = (initializeDeferredDecorator(this, "hasHeader"), void 0);
|
|
48
|
+
registerHeader = isRendered => {
|
|
49
|
+
if (this.isDestroying || this.isDestroyed) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
this.renderedHeaders += isRendered ? 1 : -1;
|
|
53
|
+
this.hasHeader = this.renderedHeaders > 0;
|
|
54
|
+
};
|
|
55
|
+
get labelledById() {
|
|
56
|
+
return this.hasHeader ? this.headerId : undefined;
|
|
57
|
+
}
|
|
58
|
+
// What makes reading `hasHeader` here safe is *when* modifiers run, not in
|
|
59
|
+
// what order: modifier install happens after the render transaction has
|
|
60
|
+
// closed, so the template has already consumed `hasHeader` (through
|
|
61
|
+
// `labelledById`) before any modifier hook fires. The header's write during
|
|
62
|
+
// its own install therefore cannot invalidate a value still being rendered,
|
|
63
|
+
// which is what would trip Glimmer's backtracking assertion.
|
|
64
|
+
//
|
|
65
|
+
// Whether the header's registration precedes this modifier is a separate,
|
|
66
|
+
// unspecified Glimmer implementation detail. All it decides is whether this
|
|
67
|
+
// first-render check already sees a registered header; if that order ever
|
|
68
|
+
// inverted, the failure mode is a spurious development warning on a dialog
|
|
69
|
+
// that does have a `Header` — not a broken render.
|
|
70
|
+
//
|
|
71
|
+
// Consumer-supplied names come through `...attributes`, which we cannot see
|
|
72
|
+
// in args, hence inspecting the element itself.
|
|
73
|
+
warnIfUnnamed = modifier(element => {
|
|
74
|
+
warnIfDialogHasNoAccessibleName(element, this.hasHeader, 'drawer');
|
|
75
|
+
});
|
|
76
|
+
/**
|
|
77
|
+
* `aria-modal="true"` promises assistive technology that the rest of the page
|
|
78
|
+
* is unreachable while this dialog is open. That promise only holds while the
|
|
79
|
+
* overlay's focus trap is active, so when the consumer turns the trap off we
|
|
80
|
+
* omit the attribute rather than lie about it — screen readers then keep
|
|
81
|
+
* exposing the page behind, which is what actually happens.
|
|
82
|
+
*/
|
|
83
|
+
get ariaModal() {
|
|
84
|
+
return this.args.disableFocusTrap === true ? undefined : 'true';
|
|
85
|
+
}
|
|
86
|
+
get preventClosing() {
|
|
87
|
+
return this.args.allowClosing === false;
|
|
88
|
+
}
|
|
89
|
+
get showCloseButton() {
|
|
90
|
+
return this.args.allowClosing !== false && this.args.allowCloseButton !== false;
|
|
91
|
+
}
|
|
92
|
+
// When a header is rendered, the close button lives inside it (see
|
|
93
|
+
// `DrawerHeader`'s `@closeButton` arg below) so it can be centred against
|
|
94
|
+
// the header's actual height. The standalone, absolutely-positioned close
|
|
95
|
+
// button is only needed as a fallback for drawers with no header at all --
|
|
96
|
+
// rendering both at once would show two close buttons.
|
|
97
|
+
get showStandaloneCloseButton() {
|
|
98
|
+
return this.showCloseButton && !this.hasHeader;
|
|
99
|
+
}
|
|
100
|
+
get closeButtonSize() {
|
|
101
|
+
return this.args.closeButtonSize || 'lg';
|
|
102
|
+
}
|
|
103
|
+
get placement() {
|
|
104
|
+
return this.args.placement || 'right';
|
|
105
|
+
}
|
|
106
|
+
get appearance() {
|
|
107
|
+
return this.args.appearance || 'default';
|
|
108
|
+
}
|
|
109
|
+
get isVerticalPlacement() {
|
|
110
|
+
return this.placement === 'top' || this.placement === 'bottom';
|
|
111
|
+
}
|
|
112
|
+
get allowDragToClose() {
|
|
113
|
+
if (this.args.allowClosing === false) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
if (typeof this.args.allowDragToClose === 'boolean') {
|
|
117
|
+
return this.args.allowDragToClose;
|
|
118
|
+
}
|
|
119
|
+
return this.isVerticalPlacement;
|
|
120
|
+
}
|
|
121
|
+
get dragAxis() {
|
|
122
|
+
return this.isVerticalPlacement ? 'y' : 'x';
|
|
123
|
+
}
|
|
124
|
+
// The drawer is dismissed by pushing it back toward the edge it came from:
|
|
125
|
+
// a bottom drawer moves down (+y), a top drawer up (-y).
|
|
126
|
+
get dragDirection() {
|
|
127
|
+
return this.placement === 'bottom' || this.placement === 'right' ? 1 : -1;
|
|
128
|
+
}
|
|
129
|
+
handleDragDismiss = () => {
|
|
130
|
+
this.args.onClose?.();
|
|
131
|
+
};
|
|
132
|
+
get classes() {
|
|
133
|
+
const {
|
|
134
|
+
drawer
|
|
135
|
+
} = useStyles();
|
|
136
|
+
return drawer({
|
|
137
|
+
placement: this.placement,
|
|
138
|
+
size: this.args.size || 'md',
|
|
139
|
+
appearance: this.appearance,
|
|
140
|
+
hasCloseButton: this.showCloseButton
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
get transition() {
|
|
144
|
+
let options = {
|
|
145
|
+
name: `overlay-transition--slide-from-${this.placement}`
|
|
146
|
+
};
|
|
147
|
+
if (typeof this.args.transition === 'object') {
|
|
148
|
+
return {
|
|
149
|
+
...options,
|
|
150
|
+
...this.args.transition
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
return options;
|
|
154
|
+
}
|
|
155
|
+
static {
|
|
156
|
+
setComponentTemplate(precompileTemplate("<Overlay @isOpen={{@isOpen}} @onClose={{@onClose}} @onOpen={{@onOpen}} @didClose={{@didClose}} @renderInPlace={{@renderInPlace}} @target={{@target}} @transitionDuration={{@transitionDuration}} @backdrop={{@backdrop}} @disableTransitions={{@disableTransitions}} @animateOnMount={{@animateOnMount}} @disableFocusTrap={{@disableFocusTrap}} @focusTrapOptions={{@focusTrapOptions}} @closeOnOutsideClick={{if this.preventClosing false @closeOnOutsideClick}} @closeOnEscapeKey={{if this.preventClosing false @closeOnEscapeKey}} @backdropTransition={{@backdropTransition}} @transition={{this.transition}} @closeOnOverlayElementClick={{true}} @preventAutoFocus={{@preventAutoFocus}}>\n <div class={{this.classes.base class=@classes.base}} tabindex=\"0\" role=\"dialog\" aria-modal={{this.ariaModal}} aria-labelledby={{this.labelledById}} {{dragToDismiss axis=this.dragAxis direction=this.dragDirection isEnabled=this.allowDragToClose onDismiss=this.handleDragDismiss handleSelector=DRAWER_DRAG_HANDLE_SELECTOR scrollSelector=DRAWER_BODY_SELECTOR}} {{this.warnIfUnnamed}} ...attributes>\n {{#if this.allowDragToClose}}\n <DrawerDragHandle @onPress={{@onClose}} @class={{this.classes.dragHandle class=@classes.dragHandle}} @barClass={{this.classes.dragHandleBar class=@classes.dragHandleBar}} />\n {{/if}}\n\n {{#if this.showStandaloneCloseButton}}\n <CloseButton @onPress={{@onClose}} @size={{this.closeButtonSize}} @class={{this.classes.closeButton class=@classes.closeButton}} />\n {{/if}}\n\n {{yield (hash CloseButton=(component CloseButton onPress=@onClose size=this.closeButtonSize class=(this.classes.closeButton class=@classes.closeButton)) Header=(component DrawerHeader labelledById=this.headerId registerSelf=this.registerHeader classFromParent=(this.classes.header class=@classes.header) iconClass=(this.classes.icon class=@classes.icon) titleClass=(this.classes.title class=@classes.title) descriptionClass=(this.classes.description class=@classes.description) contentClass=(this.classes.headerContent class=@classes.headerContent) actionsClass=(this.classes.headerActions class=@classes.headerActions) closeButton=(if this.showCloseButton (component CloseButton onPress=@onClose size=this.closeButtonSize class=(this.classes.headerCloseButton class=@classes.headerCloseButton)))) 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>", {
|
|
157
|
+
strictMode: true,
|
|
158
|
+
scope: () => ({
|
|
159
|
+
Overlay,
|
|
160
|
+
dragToDismiss,
|
|
161
|
+
DRAWER_DRAG_HANDLE_SELECTOR,
|
|
162
|
+
DRAWER_BODY_SELECTOR,
|
|
163
|
+
DrawerDragHandle,
|
|
164
|
+
CloseButton,
|
|
165
|
+
hash,
|
|
166
|
+
DrawerHeader,
|
|
167
|
+
DrawerBody,
|
|
168
|
+
DrawerFooter
|
|
169
|
+
})
|
|
170
|
+
}), this);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export { Drawer as default };
|
|
175
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawer.js","sources":["../../../src/components/overlays/drawer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { guidFor } from '@ember/object/internals';\nimport { hash } from '@ember/helper';\nimport { modifier } from 'ember-modifier';\nimport { warnIfDialogHasNoAccessibleName } from '../../-private/dialog';\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 DrawerDragHandle from './drawer/drag-handle';\nimport {\n DRAWER_BODY_SELECTOR,\n DRAWER_DRAG_HANDLE_SELECTOR\n} from './drawer/selectors';\nimport dragToDismiss, {\n type DragAxis,\n type DragDirection\n} from '../../modifiers/drag-to-dismiss';\nimport {\n CloseButton,\n type CloseButtonSignature\n} from '../buttons/close-button';\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 extends Pick<\n OverlaySignature['Args'],\n | 'isOpen'\n | 'onOpen'\n | 'onClose'\n | 'didClose'\n | 'renderInPlace'\n | 'target'\n | 'transitionDuration'\n | 'backdrop'\n | 'disableTransitions'\n | 'animateOnMount'\n | 'disableFocusTrap'\n | 'focusTrapOptions'\n | 'closeOnOutsideClick'\n | 'closeOnEscapeKey'\n | 'backdropTransition'\n | 'preventAutoFocus'\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 * @defaultValue 'lg'\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 /**\n * The Drawer visual appearance.\n *\n * `default` gives the drawer a black header band, a distinct body surface and\n * a solid footer. `ghost` keeps every region on the modal surface.\n *\n * @defaultValue 'default'\n */\n appearance?: DrawerVariants['appearance'];\n\n /**\n * Enables the drag-to-close gesture and its grab handle.\n *\n * Omit it and the gesture is on for `top` and `bottom` placements and off for\n * `left` and `right`. Pass `true` to opt a side drawer in, or `false` to turn\n * it off entirely. Always off when `allowClosing` is `false`.\n *\n * @defaultValue true for `top`/`bottom`, false for `left`/`right`\n */\n allowDragToClose?: boolean;\n\n /**\n * Class names for each slot of the component, merged with the theme's.\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'\n | 'classFromParent'\n | 'registerSelf'\n | 'iconClass'\n | 'titleClass'\n | 'descriptionClass'\n | 'contentClass'\n | 'actionsClass'\n | 'closeButton'\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 // `aria-labelledby` is only useful if it points at an element that actually\n // exists — a dangling reference leaves the dialog with no accessible name at\n // all. The yielded `Header` reports when it is rendered and when it goes\n // away, which keeps the reference correct even for a conditional header.\n // The count itself is deliberately untracked: registration happens while the\n // header's modifier is installing, and reading a tracked value there before\n // writing it trips Glimmer's backtracking assertion. Only the derived flag is\n // tracked, and it is always written, never read, from the callback.\n //\n // The `ref` utility looks like it should replace all of this, and it was\n // tried. It cannot: `Ref.setup` clears `current` unconditionally on teardown,\n // so it answers \"what is the current element?\" where this needs \"does any\n // header exist?\" — and those diverge when a header is *replaced* rather than\n // added or removed. Glimmer installs the modifiers of newly rendered elements\n // before tearing down the ones they replace (see the comments in\n // `utils/listManager.ts`), so with a `ref` a header swapped between the\n // branches of an `{{#if}}` leaves `current` undefined and the dialog silently\n // loses its accessible name. A `+1/-1` count is order-independent, which is\n // the whole point of it being a count.\n renderedHeaders = 0;\n @tracked hasHeader = false;\n\n registerHeader = (isRendered: boolean): void => {\n if (this.isDestroying || this.isDestroyed) {\n return;\n }\n\n this.renderedHeaders += isRendered ? 1 : -1;\n this.hasHeader = this.renderedHeaders > 0;\n };\n\n get labelledById(): string | undefined {\n return this.hasHeader ? this.headerId : undefined;\n }\n\n // What makes reading `hasHeader` here safe is *when* modifiers run, not in\n // what order: modifier install happens after the render transaction has\n // closed, so the template has already consumed `hasHeader` (through\n // `labelledById`) before any modifier hook fires. The header's write during\n // its own install therefore cannot invalidate a value still being rendered,\n // which is what would trip Glimmer's backtracking assertion.\n //\n // Whether the header's registration precedes this modifier is a separate,\n // unspecified Glimmer implementation detail. All it decides is whether this\n // first-render check already sees a registered header; if that order ever\n // inverted, the failure mode is a spurious development warning on a dialog\n // that does have a `Header` — not a broken render.\n //\n // Consumer-supplied names come through `...attributes`, which we cannot see\n // in args, hence inspecting the element itself.\n warnIfUnnamed = modifier((element: HTMLElement) => {\n warnIfDialogHasNoAccessibleName(element, this.hasHeader, 'drawer');\n });\n\n /**\n * `aria-modal=\"true\"` promises assistive technology that the rest of the page\n * is unreachable while this dialog is open. That promise only holds while the\n * overlay's focus trap is active, so when the consumer turns the trap off we\n * omit the attribute rather than lie about it — screen readers then keep\n * exposing the page behind, which is what actually happens.\n */\n get ariaModal(): 'true' | undefined {\n return this.args.disableFocusTrap === true ? undefined : 'true';\n }\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 // When a header is rendered, the close button lives inside it (see\n // `DrawerHeader`'s `@closeButton` arg below) so it can be centred against\n // the header's actual height. The standalone, absolutely-positioned close\n // button is only needed as a fallback for drawers with no header at all --\n // rendering both at once would show two close buttons.\n get showStandaloneCloseButton(): boolean {\n return this.showCloseButton && !this.hasHeader;\n }\n\n get closeButtonSize(): NonNullable<DrawerArgs['closeButtonSize']> {\n return this.args.closeButtonSize || 'lg';\n }\n\n get placement() {\n return this.args.placement || 'right';\n }\n\n get appearance(): NonNullable<DrawerVariants['appearance']> {\n return this.args.appearance || 'default';\n }\n\n get isVerticalPlacement(): boolean {\n return this.placement === 'top' || this.placement === 'bottom';\n }\n\n get allowDragToClose(): boolean {\n if (this.args.allowClosing === false) {\n return false;\n }\n\n if (typeof this.args.allowDragToClose === 'boolean') {\n return this.args.allowDragToClose;\n }\n\n return this.isVerticalPlacement;\n }\n\n get dragAxis(): DragAxis {\n return this.isVerticalPlacement ? 'y' : 'x';\n }\n\n // The drawer is dismissed by pushing it back toward the edge it came from:\n // a bottom drawer moves down (+y), a top drawer up (-y).\n get dragDirection(): DragDirection {\n return this.placement === 'bottom' || this.placement === 'right' ? 1 : -1;\n }\n\n handleDragDismiss = (): void => {\n this.args.onClose?.();\n };\n\n get classes() {\n const { drawer } = useStyles();\n\n return drawer({\n placement: this.placement,\n size: this.args.size || 'md',\n appearance: this.appearance,\n hasCloseButton: this.showCloseButton\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 @animateOnMount={{@animateOnMount}}\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 @preventAutoFocus={{@preventAutoFocus}}\n >\n <div\n class={{this.classes.base class=@classes.base}}\n tabindex=\"0\"\n role=\"dialog\"\n aria-modal={{this.ariaModal}}\n aria-labelledby={{this.labelledById}}\n {{dragToDismiss\n axis=this.dragAxis\n direction=this.dragDirection\n isEnabled=this.allowDragToClose\n onDismiss=this.handleDragDismiss\n handleSelector=DRAWER_DRAG_HANDLE_SELECTOR\n scrollSelector=DRAWER_BODY_SELECTOR\n }}\n {{this.warnIfUnnamed}}\n ...attributes\n >\n {{#if this.allowDragToClose}}\n <DrawerDragHandle\n @onPress={{@onClose}}\n @class={{this.classes.dragHandle class=@classes.dragHandle}}\n @barClass={{this.classes.dragHandleBar\n class=@classes.dragHandleBar\n }}\n />\n {{/if}}\n\n {{#if this.showStandaloneCloseButton}}\n <CloseButton\n @onPress={{@onClose}}\n @size={{this.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 size=this.closeButtonSize\n class=(this.classes.closeButton class=@classes.closeButton)\n )\n Header=(component\n DrawerHeader\n labelledById=this.headerId\n registerSelf=this.registerHeader\n classFromParent=(this.classes.header class=@classes.header)\n iconClass=(this.classes.icon class=@classes.icon)\n titleClass=(this.classes.title class=@classes.title)\n descriptionClass=(this.classes.description\n class=@classes.description\n )\n contentClass=(this.classes.headerContent\n class=@classes.headerContent\n )\n actionsClass=(this.classes.headerActions\n class=@classes.headerActions\n )\n closeButton=(if\n this.showCloseButton\n (component\n CloseButton\n onPress=@onClose\n size=this.closeButtonSize\n class=(this.classes.headerCloseButton\n class=@classes.headerCloseButton\n )\n )\n )\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","renderedHeaders","g","prototype","tracked","i","registerHeader","isRendered","isDestroying","isDestroyed","hasHeader","labelledById","undefined","warnIfUnnamed","modifier","element","warnIfDialogHasNoAccessibleName","ariaModal","args","disableFocusTrap","preventClosing","allowClosing","showCloseButton","allowCloseButton","showStandaloneCloseButton","closeButtonSize","placement","appearance","isVerticalPlacement","allowDragToClose","dragAxis","dragDirection","handleDragDismiss","onClose","classes","drawer","useStyles","size","hasCloseButton","transition","options","name","setComponentTemplate","precompileTemplate","strictMode","scope","Overlay","dragToDismiss","DRAWER_DRAG_HANDLE_SELECTOR","DRAWER_BODY_SELECTOR","DrawerDragHandle","CloseButton","hash","DrawerHeader","DrawerBody","DrawerFooter"],"mappings":";;;;;;;;;;;;;;;;;;;AA8Je,MAAMA,eAAeC,SAAA,CAAU;AAC5CC,EAAAA,QAAA,GAAW,CAAA,EAAGC,OAAA,CAAQ,IAAI,CAAA,CAAA,OAAA,CAAU;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAC,EAAAA,eAAA,GAAkB,CAAA;AAAE,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,WAAA,EAAA,CACnBC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAoB,KAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,UAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,WAAA,CAAA,EAAA,MAAA;EAErBC,cAAA,GAAkBC,UAAmB,IAAO;AAC1C,IAAA,IAAI,IAAI,CAACC,YAAY,IAAI,IAAI,CAACC,WAAW,EAAE;AACzC,MAAA;AACF,IAAA;IAEA,IAAI,CAACR,eAAe,IAAIM,UAAA,GAAa,IAAI,EAAC;AAC1C,IAAA,IAAI,CAACG,SAAS,GAAG,IAAI,CAACT,eAAe,GAAG,CAAA;EAC1C,CAAA;EAEA,IAAIU,YAAAA,GAAmC;IACrC,OAAO,IAAI,CAACD,SAAS,GAAG,IAAI,CAACX,QAAQ,GAAGa,SAAA;AAC1C,EAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAC,EAAAA,aAAA,GAAgBC,QAAA,CAAUC,OAAS,IAAA;IACjCC,+BAAA,CAAgCD,OAAA,EAAS,IAAI,CAACL,SAAS,EAAE,QAAA,CAAA;AAC3D,EAAA,CAAA,CAAA;AAEA;;;;;;AAMC;EACD,IAAIO,SAAAA,GAAgC;IAClC,OAAO,IAAI,CAACC,IAAI,CAACC,gBAAgB,KAAK,OAAOP,SAAA,GAAY,MAAA;AAC3D,EAAA;EAEA,IAAIQ,cAAAA,GAA0B;AAC5B,IAAA,OAAO,IAAI,CAACF,IAAI,CAACG,YAAY,KAAK,KAAA;AACpC,EAAA;EAEA,IAAIC,eAAAA,GAA2B;AAC7B,IAAA,OACE,IAAI,CAACJ,IAAI,CAACG,YAAY,KAAK,KAAA,IAAS,IAAI,CAACH,IAAI,CAACK,gBAAgB,KAAK,KACrE;AACF,EAAA;AAEA;AACA;AACA;AACA;AACA;EACA,IAAIC,yBAAAA,GAAqC;AACvC,IAAA,OAAO,IAAI,CAACF,eAAe,IAAI,CAAC,IAAI,CAACZ,SAAS;AAChD,EAAA;EAEA,IAAIe,eAAAA,GAA8D;AAChE,IAAA,OAAO,IAAI,CAACP,IAAI,CAACO,eAAe,IAAI,IAAA;AACtC,EAAA;EAEA,IAAIC,SAAAA,GAAY;AACd,IAAA,OAAO,IAAI,CAACR,IAAI,CAACQ,SAAS,IAAI,OAAA;AAChC,EAAA;EAEA,IAAIC,UAAAA,GAAwD;AAC1D,IAAA,OAAO,IAAI,CAACT,IAAI,CAACS,UAAU,IAAI,SAAA;AACjC,EAAA;EAEA,IAAIC,mBAAAA,GAA+B;IACjC,OAAO,IAAI,CAACF,SAAS,KAAK,SAAS,IAAI,CAACA,SAAS,KAAK,QAAA;AACxD,EAAA;EAEA,IAAIG,gBAAAA,GAA4B;AAC9B,IAAA,IAAI,IAAI,CAACX,IAAI,CAACG,YAAY,KAAK,KAAA,EAAO;AACpC,MAAA,OAAO,KAAA;AACT,IAAA;IAEA,IAAI,OAAO,IAAI,CAACH,IAAI,CAACW,gBAAgB,KAAK,SAAA,EAAW;AACnD,MAAA,OAAO,IAAI,CAACX,IAAI,CAACW,gBAAgB;AACnC,IAAA;IAEA,OAAO,IAAI,CAACD,mBAAmB;AACjC,EAAA;EAEA,IAAIE,WAAqB;AACvB,IAAA,OAAO,IAAI,CAACF,mBAAmB,GAAG,GAAA,GAAM,GAAA;AAC1C,EAAA;AAEA;AACA;EACA,IAAIG,gBAA+B;AACjC,IAAA,OAAO,IAAI,CAACL,SAAS,KAAK,QAAA,IAAY,IAAI,CAACA,SAAS,KAAK,OAAA,GAAU,CAAA,GAAI,EAAC;AAC1E,EAAA;EAEAM,iBAAA,GAAoBA,MAAQ;AAC1B,IAAA,IAAI,CAACd,IAAI,CAACe,OAAO,IAAA;EACnB,CAAA;EAEA,IAAIC,OAAAA,GAAU;IACZ,MAAM;AAAEC,MAAAA;KAAQ,GAAGC,SAAA,EAAA;AAEnB,IAAA,OAAOD,MAAA,CAAO;MACZT,SAAA,EAAW,IAAI,CAACA,SAAS;AACzBW,MAAAA,IAAA,EAAM,IAAI,CAACnB,IAAI,CAACmB,IAAI,IAAI,IAAA;MACxBV,UAAA,EAAY,IAAI,CAACA,UAAU;MAC3BW,cAAA,EAAgB,IAAI,CAAChB;AACvB,KAAA,CAAA;AACF,EAAA;EACA,IAAIiB,UAAAA,GAAa;AACf,IAAA,IAAIC,OAAkC,GAAgB;AACpDC,MAAAA,IAAA,EAAM,CAAA,+BAAA,EAAkC,IAAI,CAACf,SAAS,CAAA;KACxD;IAEA,IAAI,OAAO,IAAI,CAACR,IAAI,CAACqB,UAAU,KAAK,QAAA,EAAU;MAC5C,OAAO;AAAE,QAAA,GAAGC,OAAO;QAAE,GAAG,IAAI,CAACtB,IAAI,CAACqB;OAAW;AAC/C,IAAA;AAEA,IAAA,OAAOC,OAAA;AACT,EAAA;AAEA,EAAA;IAAAE,oBAAA,CAAAC,kBAAA,CAAA,yhFAAA,EA2GA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,OAAA;QAAAC,aAAA;QAAAC,2BAAA;QAAAC,oBAAA;QAAAC,gBAAA;QAAAC,WAAA;QAAAC,IAAA;QAAAC,YAAA;QAAAC,UAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { Overlay } from './overlay.js';
|
|
2
|
+
export { default as Modal } from './modal.js';
|
|
3
|
+
export { default as Drawer } from './drawer.js';
|
|
4
|
+
export { default as ModalHeader } from './modal/header.js';
|
|
5
|
+
export { default as ModalBody } from './modal/body.js';
|
|
6
|
+
export { default as ModalFooter } from './modal/footer.js';
|
|
7
|
+
export { default as DrawerHeader, DrawerHeaderDescription, DrawerHeaderIcon, DrawerHeaderTitle } from './drawer/header.js';
|
|
8
|
+
export { default as DrawerBody } from './drawer/body.js';
|
|
9
|
+
export { default as DrawerFooter } from './drawer/footer.js';
|
|
10
|
+
export { DrawerDragHandle } from './drawer/drag-handle.js';
|
|
11
|
+
export { Portal, findParentPortal } from './portal.js';
|
|
12
|
+
export { PortalTarget } from './portal-target.js';
|
|
13
|
+
export { Popover, PopoverContent } from './popover.js';
|
|
14
|
+
export { Tooltip } from './tooltip.js';
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { twMerge } from '@frontile/theme';
|
|
3
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
|
+
import { setComponentTemplate } from '@ember/component';
|
|
5
|
+
|
|
6
|
+
class ModalBody extends Component {
|
|
7
|
+
static {
|
|
8
|
+
setComponentTemplate(precompileTemplate("<div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n</div>", {
|
|
9
|
+
strictMode: true,
|
|
10
|
+
scope: () => ({
|
|
11
|
+
twMerge
|
|
12
|
+
})
|
|
13
|
+
}), this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { ModalBody as default };
|
|
18
|
+
//# sourceMappingURL=body.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"body.js","sources":["../../../../src/components/overlays/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,oFAAA,EAIA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { twMerge } from '@frontile/theme';
|
|
3
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
|
+
import { setComponentTemplate } from '@ember/component';
|
|
5
|
+
|
|
6
|
+
class ModalFooter extends Component {
|
|
7
|
+
static {
|
|
8
|
+
setComponentTemplate(precompileTemplate("<div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n</div>", {
|
|
9
|
+
strictMode: true,
|
|
10
|
+
scope: () => ({
|
|
11
|
+
twMerge
|
|
12
|
+
})
|
|
13
|
+
}), this);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { ModalFooter as default };
|
|
18
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","sources":["../../../../src/components/overlays/modal/footer.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { twMerge } from '@frontile/theme';\n\nexport interface ModalFooterArgs {\n class?: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n}\n\nexport interface ModalFooterSignature {\n Args: ModalFooterArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class ModalFooter extends Component<ModalFooterSignature> {\n <template>\n <div class={{twMerge @classFromParent @class}} ...attributes>\n {{yield}}\n </div>\n </template>\n}\n"],"names":["ModalFooter","Component","setComponentTemplate","precompileTemplate","strictMode","scope","twMerge"],"mappings":";;;;;AAoBe,MAAMA,oBAAoBC,SAAA,CAAU;AACjD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,oFAAA,EAIA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { modifier } from 'ember-modifier';
|
|
3
|
+
import { twMerge } from '@frontile/theme';
|
|
4
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
5
|
+
import { setComponentTemplate } from '@ember/component';
|
|
6
|
+
|
|
7
|
+
class ModalHeader extends Component {
|
|
8
|
+
register = modifier(() => {
|
|
9
|
+
this.args.registerSelf?.(true);
|
|
10
|
+
return () => {
|
|
11
|
+
this.args.registerSelf?.(false);
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
static {
|
|
15
|
+
setComponentTemplate(precompileTemplate("<div id={{@labelledById}} class={{twMerge @classFromParent @class}} {{this.register}} ...attributes>\n {{yield}}\n</div>", {
|
|
16
|
+
strictMode: true,
|
|
17
|
+
scope: () => ({
|
|
18
|
+
twMerge
|
|
19
|
+
})
|
|
20
|
+
}), this);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { ModalHeader as default };
|
|
25
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.js","sources":["../../../../src/components/overlays/modal/header.gts"],"sourcesContent":["import Component from '@glimmer/component';\nimport { modifier } from 'ember-modifier';\nimport { twMerge } from '@frontile/theme';\n\nexport interface ModalHeaderArgs {\n class?: string;\n /**\n * The id used to reference labelledById in Modal component\n */\n labelledById: string;\n\n /**\n * @internal\n */\n classFromParent?: string;\n\n /**\n * Called with `true` when this header is rendered and `false` when it is\n * removed, so the Modal knows whether it may point `aria-labelledby` at us.\n *\n * @internal\n */\n registerSelf?: (isRendered: boolean) => void;\n}\n\nexport interface ModalHeaderSignature {\n Args: ModalHeaderArgs;\n Element: HTMLDivElement;\n Blocks: {\n default: [];\n };\n}\n\nexport default class ModalHeader extends Component<ModalHeaderSignature> {\n register = modifier(() => {\n this.args.registerSelf?.(true);\n\n return () => {\n this.args.registerSelf?.(false);\n };\n });\n\n <template>\n <div\n id={{@labelledById}}\n class={{twMerge @classFromParent @class}}\n {{this.register}}\n ...attributes\n >\n {{yield}}\n </div>\n </template>\n}\n"],"names":["ModalHeader","Component","register","modifier","args","registerSelf","setComponentTemplate","precompileTemplate","strictMode","scope","twMerge"],"mappings":";;;;;;AAiCe,MAAMA,oBAAoBC,SAAA,CAAU;EACjDC,QAAA,GAAWC,QAAA,CAAS,MAAA;AAClB,IAAA,IAAI,CAACC,IAAI,CAACC,YAAY,GAAG,IAAA,CAAA;AAEzB,IAAA,OAAO,MAAA;AACL,MAAA,IAAI,CAACD,IAAI,CAACC,YAAY,GAAG,KAAA,CAAA;IAC3B,CAAA;AACF,EAAA,CAAA,CAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,2HAAA,EASA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { guidFor } from '@ember/object/internals';
|
|
4
|
+
import { hash } from '@ember/helper';
|
|
5
|
+
import { modifier } from 'ember-modifier';
|
|
6
|
+
import { w as warnIfDialogHasNoAccessibleName } from '../../dialog-CreV7aPQ.js';
|
|
7
|
+
import { Overlay } from './overlay.js';
|
|
8
|
+
import ModalFooter from './modal/footer.js';
|
|
9
|
+
import ModalBody from './modal/body.js';
|
|
10
|
+
import ModalHeader from './modal/header.js';
|
|
11
|
+
import { CloseButton } from '../buttons/close-button.js';
|
|
12
|
+
import { useStyles } from '@frontile/theme';
|
|
13
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
14
|
+
import { setComponentTemplate } from '@ember/component';
|
|
15
|
+
import { d as decorateFieldV2, i as initializeDeferredDecorator } from '../../runtime--fcdnjmJ-BOdRhmsS.js';
|
|
16
|
+
|
|
17
|
+
class Modal extends Component {
|
|
18
|
+
headerId = `${guidFor(this)}-header`;
|
|
19
|
+
// `aria-labelledby` is only useful if it points at an element that actually
|
|
20
|
+
// exists — a dangling reference leaves the dialog with no accessible name at
|
|
21
|
+
// all. The yielded `Header` reports when it is rendered and when it goes
|
|
22
|
+
// away, which keeps the reference correct even for a conditional header.
|
|
23
|
+
// The count itself is deliberately untracked: registration happens while the
|
|
24
|
+
// header's modifier is installing, and reading a tracked value there before
|
|
25
|
+
// writing it trips Glimmer's backtracking assertion. Only the derived flag is
|
|
26
|
+
// tracked, and it is always written, never read, from the callback.
|
|
27
|
+
//
|
|
28
|
+
// The `ref` utility looks like it should replace all of this, and it was
|
|
29
|
+
// tried. It cannot: `Ref.setup` clears `current` unconditionally on teardown,
|
|
30
|
+
// so it answers "what is the current element?" where this needs "does any
|
|
31
|
+
// header exist?" — and those diverge when a header is *replaced* rather than
|
|
32
|
+
// added or removed. Glimmer installs the modifiers of newly rendered elements
|
|
33
|
+
// before tearing down the ones they replace (see the comments in
|
|
34
|
+
// `utils/listManager.ts`), so with a `ref` a header swapped between the
|
|
35
|
+
// branches of an `{{#if}}` leaves `current` undefined and the dialog silently
|
|
36
|
+
// loses its accessible name. A `+1/-1` count is order-independent, which is
|
|
37
|
+
// the whole point of it being a count.
|
|
38
|
+
renderedHeaders = 0;
|
|
39
|
+
static {
|
|
40
|
+
decorateFieldV2(this.prototype, "hasHeader", [tracked], function () {
|
|
41
|
+
return false;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
#hasHeader = (initializeDeferredDecorator(this, "hasHeader"), void 0);
|
|
45
|
+
registerHeader = isRendered => {
|
|
46
|
+
if (this.isDestroying || this.isDestroyed) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.renderedHeaders += isRendered ? 1 : -1;
|
|
50
|
+
this.hasHeader = this.renderedHeaders > 0;
|
|
51
|
+
};
|
|
52
|
+
get labelledById() {
|
|
53
|
+
return this.hasHeader ? this.headerId : undefined;
|
|
54
|
+
}
|
|
55
|
+
// What makes reading `hasHeader` here safe is *when* modifiers run, not in
|
|
56
|
+
// what order: modifier install happens after the render transaction has
|
|
57
|
+
// closed, so the template has already consumed `hasHeader` (through
|
|
58
|
+
// `labelledById`) before any modifier hook fires. The header's write during
|
|
59
|
+
// its own install therefore cannot invalidate a value still being rendered,
|
|
60
|
+
// which is what would trip Glimmer's backtracking assertion.
|
|
61
|
+
//
|
|
62
|
+
// Whether the header's registration precedes this modifier is a separate,
|
|
63
|
+
// unspecified Glimmer implementation detail. All it decides is whether this
|
|
64
|
+
// first-render check already sees a registered header; if that order ever
|
|
65
|
+
// inverted, the failure mode is a spurious development warning on a dialog
|
|
66
|
+
// that does have a `Header` — not a broken render.
|
|
67
|
+
//
|
|
68
|
+
// Consumer-supplied names come through `...attributes`, which we cannot see
|
|
69
|
+
// in args, hence inspecting the element itself.
|
|
70
|
+
warnIfUnnamed = modifier(element => {
|
|
71
|
+
warnIfDialogHasNoAccessibleName(element, this.hasHeader, 'modal');
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* `aria-modal="true"` promises assistive technology that the rest of the page
|
|
75
|
+
* is unreachable while this dialog is open. That promise only holds while the
|
|
76
|
+
* overlay's focus trap is active, so when the consumer turns the trap off we
|
|
77
|
+
* omit the attribute rather than lie about it — screen readers then keep
|
|
78
|
+
* exposing the page behind, which is what actually happens.
|
|
79
|
+
*/
|
|
80
|
+
get ariaModal() {
|
|
81
|
+
return this.args.disableFocusTrap === true ? undefined : 'true';
|
|
82
|
+
}
|
|
83
|
+
get preventClosing() {
|
|
84
|
+
return this.args.allowClosing === false;
|
|
85
|
+
}
|
|
86
|
+
get showCloseButton() {
|
|
87
|
+
return this.args.allowClosing !== false && this.args.allowCloseButton !== false;
|
|
88
|
+
}
|
|
89
|
+
get size() {
|
|
90
|
+
return this.args.size || 'lg';
|
|
91
|
+
}
|
|
92
|
+
get classes() {
|
|
93
|
+
const {
|
|
94
|
+
modal
|
|
95
|
+
} = useStyles();
|
|
96
|
+
return modal({
|
|
97
|
+
size: this.size,
|
|
98
|
+
isCentered: this.args.isCentered
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
get transition() {
|
|
102
|
+
let options = {
|
|
103
|
+
name: 'overlay-transition--zoom'
|
|
104
|
+
};
|
|
105
|
+
if (typeof this.args.transition === 'object') {
|
|
106
|
+
return {
|
|
107
|
+
...options,
|
|
108
|
+
...this.args.transition
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return options;
|
|
112
|
+
}
|
|
113
|
+
static {
|
|
114
|
+
setComponentTemplate(precompileTemplate("<Overlay @isOpen={{@isOpen}} @onClose={{@onClose}} @onOpen={{@onOpen}} @didClose={{@didClose}} @renderInPlace={{@renderInPlace}} @target={{@target}} @transitionDuration={{@transitionDuration}} @backdrop={{@backdrop}} @disableTransitions={{@disableTransitions}} @animateOnMount={{@animateOnMount}} @disableFocusTrap={{@disableFocusTrap}} @focusTrapOptions={{@focusTrapOptions}} @closeOnOutsideClick={{if this.preventClosing false @closeOnOutsideClick}} @closeOnEscapeKey={{if this.preventClosing false @closeOnEscapeKey}} @backdropTransition={{@backdropTransition}} @transition={{this.transition}} @closeOnOverlayElementClick={{true}} @preventAutoFocus={{@preventAutoFocus}}>\n <div class={{this.classes.base class=@classes.base}} tabindex=\"0\" role=\"dialog\" aria-modal={{this.ariaModal}} aria-labelledby={{this.labelledById}} {{this.warnIfUnnamed}} ...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 ModalHeader labelledById=this.headerId registerSelf=this.registerHeader classFromParent=(this.classes.header class=@classes.header)) Body=(component ModalBody classFromParent=(this.classes.body class=@classes.body)) Footer=(component ModalFooter classFromParent=(this.classes.footer class=@classes.footer)) headerId=this.headerId)}}\n </div>\n</Overlay>", {
|
|
115
|
+
strictMode: true,
|
|
116
|
+
scope: () => ({
|
|
117
|
+
Overlay,
|
|
118
|
+
CloseButton,
|
|
119
|
+
hash,
|
|
120
|
+
ModalHeader,
|
|
121
|
+
ModalBody,
|
|
122
|
+
ModalFooter
|
|
123
|
+
})
|
|
124
|
+
}), this);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { Modal as default };
|
|
129
|
+
//# sourceMappingURL=modal.js.map
|