frontile 0.18.0-beta.2 → 0.18.0-beta.4
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 +1 -0
- package/declarations/-private/control-blur.d.ts.map +1 -0
- package/declarations/-private/deprecated-args.d.ts +1 -0
- package/declarations/-private/deprecated-args.d.ts.map +1 -0
- package/declarations/-private/dialog.d.ts +1 -0
- package/declarations/-private/dialog.d.ts.map +1 -0
- package/declarations/-private/dom.d.ts +1 -0
- package/declarations/-private/dom.d.ts.map +1 -0
- package/declarations/-private/get-config.d.ts +1 -0
- package/declarations/-private/get-config.d.ts.map +1 -0
- package/declarations/-private/icons.d.ts +23 -0
- package/declarations/-private/icons.d.ts.map +1 -0
- package/declarations/-private/manager.d.ts +1 -0
- package/declarations/-private/manager.d.ts.map +1 -0
- package/declarations/-private/notification-stack.d.ts +1 -0
- package/declarations/-private/notification-stack.d.ts.map +1 -0
- package/declarations/-private/notification.d.ts +1 -0
- package/declarations/-private/notification.d.ts.map +1 -0
- package/declarations/-private/timer.d.ts +1 -0
- package/declarations/-private/timer.d.ts.map +1 -0
- package/declarations/-private/types.d.ts +1 -0
- package/declarations/-private/types.d.ts.map +1 -0
- package/declarations/buttons.d.ts +1 -0
- package/declarations/buttons.d.ts.map +1 -0
- package/declarations/collections.d.ts +1 -0
- package/declarations/collections.d.ts.map +1 -0
- package/declarations/components/buttons/button-group.d.ts +1 -0
- package/declarations/components/buttons/button-group.d.ts.map +1 -0
- package/declarations/components/buttons/button.d.ts +1 -0
- package/declarations/components/buttons/button.d.ts.map +1 -0
- package/declarations/components/buttons/chip.d.ts +1 -0
- package/declarations/components/buttons/chip.d.ts.map +1 -0
- package/declarations/components/buttons/close-button.d.ts +1 -0
- package/declarations/components/buttons/close-button.d.ts.map +1 -0
- package/declarations/components/buttons/index.d.ts +1 -0
- package/declarations/components/buttons/index.d.ts.map +1 -0
- package/declarations/components/buttons/segmented-control/item.d.ts +1 -0
- package/declarations/components/buttons/segmented-control/item.d.ts.map +1 -0
- package/declarations/components/buttons/segmented-control/segmented-control.d.ts +12 -1
- package/declarations/components/buttons/segmented-control/segmented-control.d.ts.map +1 -0
- package/declarations/components/buttons/segmented-control.d.ts +1 -0
- package/declarations/components/buttons/segmented-control.d.ts.map +1 -0
- package/declarations/components/buttons/toggle-button.d.ts +1 -0
- package/declarations/components/buttons/toggle-button.d.ts.map +1 -0
- package/declarations/components/collections/calendar/calendar.d.ts +9 -12
- package/declarations/components/collections/calendar/calendar.d.ts.map +1 -0
- package/declarations/components/collections/calendar/day-cell.d.ts +1 -0
- package/declarations/components/collections/calendar/day-cell.d.ts.map +1 -0
- package/declarations/components/collections/calendar/header.d.ts +1 -0
- package/declarations/components/collections/calendar/header.d.ts.map +1 -0
- package/declarations/components/collections/calendar/month-grid.d.ts +1 -0
- package/declarations/components/collections/calendar/month-grid.d.ts.map +1 -0
- package/declarations/components/collections/calendar/types.d.ts +1 -0
- package/declarations/components/collections/calendar/types.d.ts.map +1 -0
- package/declarations/components/collections/calendar/utils.d.ts +1 -0
- package/declarations/components/collections/calendar/utils.d.ts.map +1 -0
- package/declarations/components/collections/calendar/year-grid.d.ts +1 -0
- package/declarations/components/collections/calendar/year-grid.d.ts.map +1 -0
- package/declarations/components/collections/calendar.d.ts +1 -0
- package/declarations/components/collections/calendar.d.ts.map +1 -0
- package/declarations/components/collections/command/command.d.ts +2 -11
- package/declarations/components/collections/command/command.d.ts.map +1 -0
- package/declarations/components/collections/command/dialog.d.ts +1 -0
- package/declarations/components/collections/command/dialog.d.ts.map +1 -0
- package/declarations/components/collections/command/footer.d.ts +1 -0
- package/declarations/components/collections/command/footer.d.ts.map +1 -0
- package/declarations/components/collections/command/index.d.ts +1 -0
- package/declarations/components/collections/command/index.d.ts.map +1 -0
- package/declarations/components/collections/command/input.d.ts +7 -1
- package/declarations/components/collections/command/input.d.ts.map +1 -0
- package/declarations/components/collections/command/list.d.ts +4 -0
- package/declarations/components/collections/command/list.d.ts.map +1 -0
- package/declarations/components/collections/command.d.ts +1 -0
- package/declarations/components/collections/command.d.ts.map +1 -0
- package/declarations/components/collections/dropdown/dropdown.d.ts +61 -2
- package/declarations/components/collections/dropdown/dropdown.d.ts.map +1 -0
- package/declarations/components/collections/dropdown/menu-context.d.ts +34 -7
- package/declarations/components/collections/dropdown/menu-context.d.ts.map +1 -0
- package/declarations/components/collections/dropdown/sub.d.ts +4 -8
- package/declarations/components/collections/dropdown/sub.d.ts.map +1 -0
- package/declarations/components/collections/dropdown.d.ts +1 -0
- package/declarations/components/collections/dropdown.d.ts.map +1 -0
- package/declarations/components/collections/index.d.ts +1 -0
- package/declarations/components/collections/index.d.ts.map +1 -0
- package/declarations/components/collections/listbox/group.d.ts +1 -0
- package/declarations/components/collections/listbox/group.d.ts.map +1 -0
- package/declarations/components/collections/listbox/item.d.ts +22 -1
- package/declarations/components/collections/listbox/item.d.ts.map +1 -0
- package/declarations/components/collections/listbox/listbox.d.ts +1 -0
- package/declarations/components/collections/listbox/listbox.d.ts.map +1 -0
- package/declarations/components/collections/listbox.d.ts +1 -0
- package/declarations/components/collections/listbox.d.ts.map +1 -0
- package/declarations/components/collections/simple-table/body.d.ts +50 -35
- package/declarations/components/collections/simple-table/body.d.ts.map +1 -0
- package/declarations/components/collections/simple-table/cell.d.ts +50 -35
- package/declarations/components/collections/simple-table/cell.d.ts.map +1 -0
- package/declarations/components/collections/simple-table/column.d.ts +50 -35
- package/declarations/components/collections/simple-table/column.d.ts.map +1 -0
- package/declarations/components/collections/simple-table/footer.d.ts +50 -35
- package/declarations/components/collections/simple-table/footer.d.ts.map +1 -0
- package/declarations/components/collections/simple-table/header.d.ts +50 -35
- package/declarations/components/collections/simple-table/header.d.ts.map +1 -0
- package/declarations/components/collections/simple-table/index.d.ts +50 -35
- package/declarations/components/collections/simple-table/index.d.ts.map +1 -0
- package/declarations/components/collections/simple-table/row.d.ts +50 -35
- package/declarations/components/collections/simple-table/row.d.ts.map +1 -0
- package/declarations/components/collections/table/cell-default.d.ts +1 -0
- package/declarations/components/collections/table/cell-default.d.ts.map +1 -0
- package/declarations/components/collections/table/cell-for.d.ts +1 -0
- package/declarations/components/collections/table/cell-for.d.ts.map +1 -0
- package/declarations/components/collections/table/cell-rendering-context.d.ts +1 -0
- package/declarations/components/collections/table/cell-rendering-context.d.ts.map +1 -0
- package/declarations/components/collections/table/checkbox.d.ts +6 -1
- package/declarations/components/collections/table/checkbox.d.ts.map +1 -0
- package/declarations/components/collections/table/column-visibility.d.ts +51 -36
- package/declarations/components/collections/table/column-visibility.d.ts.map +1 -0
- package/declarations/components/collections/table/index.d.ts +1 -0
- package/declarations/components/collections/table/index.d.ts.map +1 -0
- package/declarations/components/collections/table/sort-button.d.ts +50 -35
- package/declarations/components/collections/table/sort-button.d.ts.map +1 -0
- package/declarations/components/collections/table/table.d.ts +50 -35
- package/declarations/components/collections/table/table.d.ts.map +1 -0
- package/declarations/components/collections/table/types.d.ts +1 -0
- package/declarations/components/collections/table/types.d.ts.map +1 -0
- package/declarations/components/collections/table/utils.d.ts +1 -0
- package/declarations/components/collections/table/utils.d.ts.map +1 -0
- package/declarations/components/collections/table.d.ts +1 -0
- package/declarations/components/collections/table.d.ts.map +1 -0
- package/declarations/components/disclosure/accordion/accordion.d.ts +8 -1
- package/declarations/components/disclosure/accordion/accordion.d.ts.map +1 -0
- package/declarations/components/disclosure/accordion/item.d.ts +1 -0
- package/declarations/components/disclosure/accordion/item.d.ts.map +1 -0
- package/declarations/components/disclosure/accordion.d.ts +1 -0
- package/declarations/components/disclosure/accordion.d.ts.map +1 -0
- package/declarations/components/disclosure/index.d.ts +1 -0
- package/declarations/components/disclosure/index.d.ts.map +1 -0
- package/declarations/components/forms/autocomplete.d.ts +13 -23
- package/declarations/components/forms/autocomplete.d.ts.map +1 -0
- package/declarations/components/forms/checkbox-group.d.ts +8 -1
- package/declarations/components/forms/checkbox-group.d.ts.map +1 -0
- package/declarations/components/forms/checkbox.d.ts +6 -1
- package/declarations/components/forms/checkbox.d.ts.map +1 -0
- package/declarations/components/forms/date-picker/date-picker.d.ts +13 -23
- package/declarations/components/forms/date-picker/date-picker.d.ts.map +1 -0
- package/declarations/components/forms/date-picker/end-content.d.ts +1 -0
- package/declarations/components/forms/date-picker/end-content.d.ts.map +1 -0
- package/declarations/components/forms/date-picker/trigger.d.ts +1 -0
- package/declarations/components/forms/date-picker/trigger.d.ts.map +1 -0
- package/declarations/components/forms/date-picker/types.d.ts +1 -0
- package/declarations/components/forms/date-picker/types.d.ts.map +1 -0
- package/declarations/components/forms/date-picker/value.d.ts +1 -0
- package/declarations/components/forms/date-picker/value.d.ts.map +1 -0
- package/declarations/components/forms/date-picker.d.ts +1 -0
- package/declarations/components/forms/date-picker.d.ts.map +1 -0
- package/declarations/components/forms/field-types.d.ts +2 -1
- package/declarations/components/forms/field-types.d.ts.map +1 -0
- package/declarations/components/forms/field.d.ts +1 -0
- package/declarations/components/forms/field.d.ts.map +1 -0
- package/declarations/components/forms/form-control.d.ts +1 -0
- package/declarations/components/forms/form-control.d.ts.map +1 -0
- package/declarations/components/forms/form-description.d.ts +1 -0
- package/declarations/components/forms/form-description.d.ts.map +1 -0
- package/declarations/components/forms/form-feedback.d.ts +1 -0
- package/declarations/components/forms/form-feedback.d.ts.map +1 -0
- package/declarations/components/forms/form.d.ts +2 -11
- package/declarations/components/forms/form.d.ts.map +1 -0
- package/declarations/components/forms/index.d.ts +1 -0
- package/declarations/components/forms/index.d.ts.map +1 -0
- package/declarations/components/forms/input-otp.d.ts +10 -12
- package/declarations/components/forms/input-otp.d.ts.map +1 -0
- package/declarations/components/forms/input.d.ts +12 -12
- package/declarations/components/forms/input.d.ts.map +1 -0
- package/declarations/components/forms/label.d.ts +6 -1
- package/declarations/components/forms/label.d.ts.map +1 -0
- package/declarations/components/forms/native-select.d.ts +11 -1
- package/declarations/components/forms/native-select.d.ts.map +1 -0
- package/declarations/components/forms/radio-group.d.ts +8 -1
- package/declarations/components/forms/radio-group.d.ts.map +1 -0
- package/declarations/components/forms/radio.d.ts +6 -1
- package/declarations/components/forms/radio.d.ts.map +1 -0
- package/declarations/components/forms/select/end-content.d.ts +1 -0
- package/declarations/components/forms/select/end-content.d.ts.map +1 -0
- package/declarations/components/forms/select/native-mirror.d.ts +1 -0
- package/declarations/components/forms/select/native-mirror.d.ts.map +1 -0
- package/declarations/components/forms/select/select.d.ts +15 -34
- package/declarations/components/forms/select/select.d.ts.map +1 -0
- package/declarations/components/forms/select/selected-items.d.ts +1 -0
- package/declarations/components/forms/select/selected-items.d.ts.map +1 -0
- package/declarations/components/forms/select/trigger.d.ts +1 -0
- package/declarations/components/forms/select/trigger.d.ts.map +1 -0
- package/declarations/components/forms/select/types.d.ts +1 -0
- package/declarations/components/forms/select/types.d.ts.map +1 -0
- package/declarations/components/forms/select.d.ts +1 -0
- package/declarations/components/forms/select.d.ts.map +1 -0
- package/declarations/components/forms/switch.d.ts +8 -1
- package/declarations/components/forms/switch.d.ts.map +1 -0
- package/declarations/components/forms/textarea.d.ts +11 -1
- package/declarations/components/forms/textarea.d.ts.map +1 -0
- package/declarations/components/navigation/external-link.d.ts +2 -1
- package/declarations/components/navigation/external-link.d.ts.map +1 -0
- package/declarations/components/navigation/index.d.ts +1 -0
- package/declarations/components/navigation/index.d.ts.map +1 -0
- package/declarations/components/navigation/pagination/pagination.d.ts +8 -1
- package/declarations/components/navigation/pagination/pagination.d.ts.map +1 -0
- package/declarations/components/navigation/pagination/range.d.ts +1 -0
- package/declarations/components/navigation/pagination/range.d.ts.map +1 -0
- package/declarations/components/navigation/pagination.d.ts +1 -0
- package/declarations/components/navigation/pagination.d.ts.map +1 -0
- package/declarations/components/navigation/tab-nav/item.d.ts +1 -0
- package/declarations/components/navigation/tab-nav/item.d.ts.map +1 -0
- package/declarations/components/navigation/tab-nav/tab-nav.d.ts +11 -1
- package/declarations/components/navigation/tab-nav/tab-nav.d.ts.map +1 -0
- package/declarations/components/navigation/tab-nav.d.ts +1 -0
- package/declarations/components/navigation/tab-nav.d.ts.map +1 -0
- package/declarations/components/navigation/tabs/panel.d.ts +1 -0
- package/declarations/components/navigation/tabs/panel.d.ts.map +1 -0
- package/declarations/components/navigation/tabs/tab.d.ts +1 -0
- package/declarations/components/navigation/tabs/tab.d.ts.map +1 -0
- package/declarations/components/navigation/tabs/tabs.d.ts +11 -1
- package/declarations/components/navigation/tabs/tabs.d.ts.map +1 -0
- package/declarations/components/navigation/tabs.d.ts +1 -0
- package/declarations/components/navigation/tabs.d.ts.map +1 -0
- package/declarations/components/notifications/index.d.ts +1 -0
- package/declarations/components/notifications/index.d.ts.map +1 -0
- package/declarations/components/notifications/notification-card.d.ts +2 -3
- package/declarations/components/notifications/notification-card.d.ts.map +1 -0
- package/declarations/components/notifications/notifications-container.d.ts +1 -0
- package/declarations/components/notifications/notifications-container.d.ts.map +1 -0
- package/declarations/components/overlays/backdrop.d.ts +1 -0
- package/declarations/components/overlays/backdrop.d.ts.map +1 -0
- package/declarations/components/overlays/drawer/body.d.ts +1 -0
- package/declarations/components/overlays/drawer/body.d.ts.map +1 -0
- package/declarations/components/overlays/drawer/drag-handle.d.ts +1 -0
- package/declarations/components/overlays/drawer/drag-handle.d.ts.map +1 -0
- package/declarations/components/overlays/drawer/footer.d.ts +1 -0
- package/declarations/components/overlays/drawer/footer.d.ts.map +1 -0
- package/declarations/components/overlays/drawer/header.d.ts +1 -0
- package/declarations/components/overlays/drawer/header.d.ts.map +1 -0
- package/declarations/components/overlays/drawer/selectors.d.ts +1 -0
- package/declarations/components/overlays/drawer/selectors.d.ts.map +1 -0
- package/declarations/components/overlays/drawer.d.ts +62 -54
- package/declarations/components/overlays/drawer.d.ts.map +1 -0
- package/declarations/components/overlays/index.d.ts +1 -0
- package/declarations/components/overlays/index.d.ts.map +1 -0
- package/declarations/components/overlays/modal/body.d.ts +1 -0
- package/declarations/components/overlays/modal/body.d.ts.map +1 -0
- package/declarations/components/overlays/modal/footer.d.ts +1 -0
- package/declarations/components/overlays/modal/footer.d.ts.map +1 -0
- package/declarations/components/overlays/modal/header.d.ts +1 -0
- package/declarations/components/overlays/modal/header.d.ts.map +1 -0
- package/declarations/components/overlays/modal.d.ts +18 -12
- package/declarations/components/overlays/modal.d.ts.map +1 -0
- package/declarations/components/overlays/mount-animation.d.ts +1 -0
- package/declarations/components/overlays/mount-animation.d.ts.map +1 -0
- package/declarations/components/overlays/overlay.d.ts +14 -0
- package/declarations/components/overlays/overlay.d.ts.map +1 -0
- package/declarations/components/overlays/popover.d.ts +1 -0
- package/declarations/components/overlays/popover.d.ts.map +1 -0
- package/declarations/components/overlays/portal-target.d.ts +1 -0
- package/declarations/components/overlays/portal-target.d.ts.map +1 -0
- package/declarations/components/overlays/portal.d.ts +1 -0
- package/declarations/components/overlays/portal.d.ts.map +1 -0
- package/declarations/components/overlays/tooltip.d.ts +1 -0
- package/declarations/components/overlays/tooltip.d.ts.map +1 -0
- package/declarations/components/status/alert.d.ts +2 -3
- package/declarations/components/status/alert.d.ts.map +1 -0
- package/declarations/components/status/index.d.ts +1 -0
- package/declarations/components/status/index.d.ts.map +1 -0
- package/declarations/components/status/progress-bar.d.ts +1 -0
- package/declarations/components/status/progress-bar.d.ts.map +1 -0
- package/declarations/components/utilities/avatar.d.ts +13 -7
- package/declarations/components/utilities/avatar.d.ts.map +1 -0
- package/declarations/components/utilities/collapsible.d.ts +1 -0
- package/declarations/components/utilities/collapsible.d.ts.map +1 -0
- package/declarations/components/utilities/divider.d.ts +12 -0
- package/declarations/components/utilities/divider.d.ts.map +1 -0
- package/declarations/components/utilities/index.d.ts +1 -0
- package/declarations/components/utilities/index.d.ts.map +1 -0
- package/declarations/components/utilities/kbd.d.ts +1 -0
- package/declarations/components/utilities/kbd.d.ts.map +1 -0
- package/declarations/components/utilities/skeleton.d.ts +1 -0
- package/declarations/components/utilities/skeleton.d.ts.map +1 -0
- package/declarations/components/utilities/spinner.d.ts +1 -0
- package/declarations/components/utilities/spinner.d.ts.map +1 -0
- package/declarations/components/utilities/visually-hidden.d.ts +1 -0
- package/declarations/components/utilities/visually-hidden.d.ts.map +1 -0
- package/declarations/disclosure.d.ts +1 -0
- package/declarations/disclosure.d.ts.map +1 -0
- package/declarations/forms.d.ts +1 -0
- package/declarations/forms.d.ts.map +1 -0
- package/declarations/index.d.ts +1 -0
- package/declarations/index.d.ts.map +1 -0
- package/declarations/modifiers/drag-to-dismiss.d.ts +1 -0
- package/declarations/modifiers/drag-to-dismiss.d.ts.map +1 -0
- package/declarations/modifiers/press.d.ts +1 -0
- package/declarations/modifiers/press.d.ts.map +1 -0
- package/declarations/navigation.d.ts +1 -0
- package/declarations/navigation.d.ts.map +1 -0
- package/declarations/notifications.d.ts +1 -0
- package/declarations/notifications.d.ts.map +1 -0
- package/declarations/overlays.d.ts +1 -0
- package/declarations/overlays.d.ts.map +1 -0
- package/declarations/services/notifications.d.ts +1 -0
- package/declarations/services/notifications.d.ts.map +1 -0
- package/declarations/status.d.ts +1 -0
- package/declarations/status.d.ts.map +1 -0
- package/declarations/test-support.d.ts +1 -0
- package/declarations/test-support.d.ts.map +1 -0
- package/declarations/utilities.d.ts +1 -0
- package/declarations/utilities.d.ts.map +1 -0
- package/declarations/utils/deferred-work.d.ts +1 -0
- package/declarations/utils/deferred-work.d.ts.map +1 -0
- package/declarations/utils/filter.d.ts +1 -0
- package/declarations/utils/filter.d.ts.map +1 -0
- package/declarations/utils/forms-utils-index.d.ts +1 -0
- package/declarations/utils/forms-utils-index.d.ts.map +1 -0
- package/declarations/utils/keys.d.ts +1 -0
- package/declarations/utils/keys.d.ts.map +1 -0
- package/declarations/utils/listManager.d.ts +22 -0
- package/declarations/utils/listManager.d.ts.map +1 -0
- package/declarations/utils/nested-data.d.ts +1 -0
- package/declarations/utils/nested-data.d.ts.map +1 -0
- package/declarations/utils/prefers-reduced-motion.d.ts +1 -0
- package/declarations/utils/prefers-reduced-motion.d.ts.map +1 -0
- package/declarations/utils/ref.d.ts +2 -1
- package/declarations/utils/ref.d.ts.map +1 -0
- package/declarations/utils/roving-focus.d.ts +1 -0
- package/declarations/utils/roving-focus.d.ts.map +1 -0
- package/declarations/utils/safe-area.d.ts +1 -0
- package/declarations/utils/safe-area.d.ts.map +1 -0
- package/declarations/utils/safe-styles.d.ts +1 -0
- package/declarations/utils/safe-styles.d.ts.map +1 -0
- package/declarations/utils/selection-indicator.d.ts +1 -0
- package/declarations/utils/selection-indicator.d.ts.map +1 -0
- package/declarations/utils/standard-validator.d.ts +1 -0
- package/declarations/utils/standard-validator.d.ts.map +1 -0
- package/declarations/utils/toggle.d.ts +1 -0
- package/declarations/utils/toggle.d.ts.map +1 -0
- package/dist/components/buttons/button-group.js.map +1 -1
- package/dist/components/buttons/button.js.map +1 -1
- package/dist/components/buttons/chip.js.map +1 -1
- package/dist/components/buttons/close-button.js +1 -1
- package/dist/components/buttons/close-button.js.map +1 -1
- package/dist/components/buttons/segmented-control/item.js.map +1 -1
- package/dist/components/buttons/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/buttons/toggle-button.js.map +1 -1
- package/dist/components/collections/calendar/calendar.js.map +1 -1
- package/dist/components/collections/calendar/day-cell.js.map +1 -1
- package/dist/components/collections/calendar/header.js +1 -2
- package/dist/components/collections/calendar/header.js.map +1 -1
- package/dist/components/collections/calendar/month-grid.js.map +1 -1
- package/dist/components/collections/calendar/utils.js.map +1 -1
- package/dist/components/collections/calendar/year-grid.js.map +1 -1
- package/dist/components/collections/command/command.js.map +1 -1
- package/dist/components/collections/command/dialog.js +0 -1
- package/dist/components/collections/command/dialog.js.map +1 -1
- package/dist/components/collections/command/footer.js.map +1 -1
- package/dist/components/collections/command/input.js.map +1 -1
- package/dist/components/collections/command/list.js.map +1 -1
- package/dist/components/collections/dropdown/dropdown.js +72 -7
- package/dist/components/collections/dropdown/dropdown.js.map +1 -1
- package/dist/components/collections/dropdown/menu-context.js +52 -1
- package/dist/components/collections/dropdown/menu-context.js.map +1 -1
- package/dist/components/collections/dropdown/sub.js +2 -9
- package/dist/components/collections/dropdown/sub.js.map +1 -1
- package/dist/components/collections/listbox/group.js.map +1 -1
- package/dist/components/collections/listbox/item.js +32 -6
- package/dist/components/collections/listbox/item.js.map +1 -1
- package/dist/components/collections/listbox/listbox.js.map +1 -1
- package/dist/components/collections/simple-table/body.js.map +1 -1
- package/dist/components/collections/simple-table/cell.js.map +1 -1
- package/dist/components/collections/simple-table/column.js.map +1 -1
- package/dist/components/collections/simple-table/footer.js.map +1 -1
- package/dist/components/collections/simple-table/header.js.map +1 -1
- package/dist/components/collections/simple-table/index.js.map +1 -1
- package/dist/components/collections/simple-table/row.js.map +1 -1
- package/dist/components/collections/table/cell-default.js.map +1 -1
- package/dist/components/collections/table/cell-for.js.map +1 -1
- package/dist/components/collections/table/cell-rendering-context.js.map +1 -1
- package/dist/components/collections/table/checkbox.js.map +1 -1
- package/dist/components/collections/table/column-visibility.js +1 -1
- package/dist/components/collections/table/column-visibility.js.map +1 -1
- package/dist/components/collections/table/sort-button.js +1 -1
- package/dist/components/collections/table/sort-button.js.map +1 -1
- package/dist/components/collections/table/table.js +1 -2
- package/dist/components/collections/table/table.js.map +1 -1
- package/dist/components/collections/table/utils.js.map +1 -1
- package/dist/components/disclosure/accordion/accordion.js.map +1 -1
- package/dist/components/disclosure/accordion/item.js +1 -1
- package/dist/components/disclosure/accordion/item.js.map +1 -1
- package/dist/components/forms/autocomplete.js +1 -1
- package/dist/components/forms/autocomplete.js.map +1 -1
- package/dist/components/forms/checkbox-group.js.map +1 -1
- package/dist/components/forms/checkbox.js.map +1 -1
- package/dist/components/forms/date-picker/date-picker.js.map +1 -1
- package/dist/components/forms/date-picker/end-content.js +1 -1
- package/dist/components/forms/date-picker/end-content.js.map +1 -1
- package/dist/components/forms/date-picker/trigger.js.map +1 -1
- package/dist/components/forms/date-picker/value.js.map +1 -1
- package/dist/components/forms/field.js.map +1 -1
- package/dist/components/forms/form-control.js.map +1 -1
- package/dist/components/forms/form-description.js.map +1 -1
- package/dist/components/forms/form-feedback.js.map +1 -1
- package/dist/components/forms/form.js.map +1 -1
- package/dist/components/forms/input-otp.js.map +1 -1
- package/dist/components/forms/input.js.map +1 -1
- package/dist/components/forms/label.js.map +1 -1
- package/dist/components/forms/native-select.js +2 -2
- package/dist/components/forms/native-select.js.map +1 -1
- package/dist/components/forms/radio-group.js.map +1 -1
- package/dist/components/forms/radio.js.map +1 -1
- package/dist/components/forms/select/end-content.js +1 -1
- package/dist/components/forms/select/end-content.js.map +1 -1
- package/dist/components/forms/select/native-mirror.js.map +1 -1
- package/dist/components/forms/select/select.js.map +1 -1
- package/dist/components/forms/select/selected-items.js.map +1 -1
- package/dist/components/forms/select/trigger.js.map +1 -1
- package/dist/components/forms/switch.js.map +1 -1
- package/dist/components/forms/textarea.js.map +1 -1
- package/dist/components/navigation/external-link.js.map +1 -1
- package/dist/components/navigation/pagination/pagination.js +1 -1
- package/dist/components/navigation/pagination/pagination.js.map +1 -1
- package/dist/components/navigation/pagination/range.js.map +1 -1
- package/dist/components/navigation/tab-nav/item.js.map +1 -1
- package/dist/components/navigation/tab-nav/tab-nav.js.map +1 -1
- package/dist/components/navigation/tabs/panel.js.map +1 -1
- package/dist/components/navigation/tabs/tab.js.map +1 -1
- package/dist/components/navigation/tabs/tabs.js.map +1 -1
- package/dist/components/notifications/index.js +2 -2
- package/dist/components/notifications/notification-card.js +2 -2
- package/dist/components/notifications/notifications-container.js +1 -1
- package/dist/components/notifications/notifications-container.js.map +1 -1
- package/dist/components/overlays/backdrop.js +1 -1
- package/dist/components/overlays/backdrop.js.map +1 -1
- package/dist/components/overlays/drawer/body.js.map +1 -1
- package/dist/components/overlays/drawer/drag-handle.js.map +1 -1
- package/dist/components/overlays/drawer/footer.js.map +1 -1
- package/dist/components/overlays/drawer/header.js.map +1 -1
- package/dist/components/overlays/drawer/selectors.js.map +1 -1
- package/dist/components/overlays/drawer.js +1 -1
- package/dist/components/overlays/drawer.js.map +1 -1
- package/dist/components/overlays/modal/body.js.map +1 -1
- package/dist/components/overlays/modal/footer.js.map +1 -1
- package/dist/components/overlays/modal/header.js.map +1 -1
- package/dist/components/overlays/modal.js +1 -1
- package/dist/components/overlays/modal.js.map +1 -1
- package/dist/components/overlays/mount-animation.js.map +1 -1
- package/dist/components/overlays/overlay.js +52 -3
- package/dist/components/overlays/overlay.js.map +1 -1
- package/dist/components/overlays/popover.js +2 -2
- package/dist/components/overlays/popover.js.map +1 -1
- package/dist/components/overlays/portal-target.js.map +1 -1
- package/dist/components/overlays/portal.js.map +1 -1
- package/dist/components/overlays/tooltip.js.map +1 -1
- package/dist/components/status/alert.js +11 -6
- package/dist/components/status/alert.js.map +1 -1
- package/dist/components/status/progress-bar.js.map +1 -1
- package/dist/components/utilities/avatar.js.map +1 -1
- package/dist/components/utilities/collapsible.js.map +1 -1
- package/dist/components/utilities/divider.js +1 -1
- package/dist/components/utilities/divider.js.map +1 -1
- package/dist/components/utilities/index.js +1 -1
- package/dist/components/utilities/kbd.js.map +1 -1
- package/dist/components/utilities/skeleton.js.map +1 -1
- package/dist/components/utilities/spinner.js.map +1 -1
- package/dist/components/utilities/visually-hidden.js.map +1 -1
- package/dist/control-blur-C8OnSQR5.js.map +1 -1
- package/dist/deprecated-args-BIUjLA8y.js.map +1 -1
- package/dist/dialog-CreV7aPQ.js.map +1 -1
- package/dist/dom-cKWVvtkd.js.map +1 -1
- package/dist/icons-DZ61nCzv.js +51 -0
- package/dist/icons-DZ61nCzv.js.map +1 -0
- package/dist/index.js +3 -3
- package/dist/{manager-B-PnYqDs.js → manager-jDaRVZ5o.js} +1 -3
- package/dist/manager-jDaRVZ5o.js.map +1 -0
- package/dist/modifiers/drag-to-dismiss.js.map +1 -1
- package/dist/modifiers/press.js.map +1 -1
- package/dist/{notification-card-CYmWQ35W.js → notification-card-dz-eE6z9.js} +2 -2
- package/dist/notification-card-dz-eE6z9.js.map +1 -0
- package/dist/notifications.js +2 -2
- package/dist/runtime--fcdnjmJ-BOdRhmsS.js.map +1 -1
- package/dist/services/notifications.js +1 -1
- package/dist/services/notifications.js.map +1 -1
- package/dist/test-support.js.map +1 -1
- package/dist/utilities.js +1 -1
- package/dist/utils/deferred-work.js.map +1 -1
- package/dist/utils/filter.js.map +1 -1
- package/dist/utils/forms-utils-index.js.map +1 -1
- package/dist/utils/keys.js.map +1 -1
- package/dist/utils/listManager.js +34 -4
- package/dist/utils/listManager.js.map +1 -1
- package/dist/utils/nested-data.js.map +1 -1
- package/dist/utils/prefers-reduced-motion.js.map +1 -1
- package/dist/utils/ref.js +1 -1
- package/dist/utils/ref.js.map +1 -1
- package/dist/utils/roving-focus.js.map +1 -1
- package/dist/utils/safe-area.js.map +1 -1
- package/dist/utils/safe-styles.js.map +1 -1
- package/dist/utils/selection-indicator.js.map +1 -1
- package/dist/utils/standard-validator.js.map +1 -1
- package/dist/utils/toggle.js.map +1 -1
- package/package.json +23 -24
- package/dist/components/collections/calendar/icons.js +0 -23
- package/dist/components/collections/calendar/icons.js.map +0 -1
- package/dist/components/collections/table/icons.js +0 -19
- package/dist/components/collections/table/icons.js.map +0 -1
- package/dist/components/disclosure/icons.js +0 -13
- package/dist/components/disclosure/icons.js.map +0 -1
- package/dist/components/forms/icons.js +0 -16
- package/dist/components/forms/icons.js.map +0 -1
- package/dist/components/navigation/pagination/icons.js +0 -23
- package/dist/components/navigation/pagination/icons.js.map +0 -1
- package/dist/intent-icons-DpEViO8C.js +0 -19
- package/dist/intent-icons-DpEViO8C.js.map +0 -1
- package/dist/manager-B-PnYqDs.js.map +0 -1
- package/dist/notification-card-CYmWQ35W.js.map +0 -1
- package/dist/template-registry.js +0 -2
- package/dist/template-registry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roving-focus.js","sources":["../../src/utils/roving-focus.ts"],"sourcesContent":["import { modifier } from 'ember-modifier';\n\ntype RovingFocusOrientation = 'horizontal' | 'vertical';\ntype RovingFocusActivationMode = 'automatic' | 'manual';\n\ninterface RovingFocusOptions {\n /** @defaultValue 'horizontal' */\n orientation?: RovingFocusOrientation;\n\n /**\n * `automatic` moves selection with focus, which is what the radiogroup\n * pattern requires. `manual` moves focus only and waits for Enter or Space,\n * which tabs may want when switching panels is expensive.\n *\n * @defaultValue 'automatic'\n */\n activationMode?: RovingFocusActivationMode;\n\n /**\n * Called when an item becomes the active one: on every focus move when\n * `activationMode` is `automatic`, or on Enter/Space when it is `manual`.\n * Receives the element that was activated.\n */\n onActivate?: (element: HTMLElement) => void;\n}\n\n/**\n * How an element says it is selected. Read from the element for the same\n * reason as `DISABLED_SELECTOR`: it already has to declare this for assistive\n * technology, and a second declaration is only a way for the two to disagree.\n */\nconst SELECTED_SELECTOR =\n '[data-selected=\"true\"], [aria-checked=\"true\"], [aria-selected=\"true\"]';\n\n/**\n * How an element says it is disabled. `:disabled` covers the form controls\n * that support it; `[aria-disabled=\"true\"]` covers everything that does not --\n * an `<a>` or a `LinkTo`, which a navigation tab list is built from, cannot be\n * natively disabled at all.\n */\nconst DISABLED_SELECTOR = ':disabled, [aria-disabled=\"true\"]';\n\n/**\n * Keyboard navigation for a single-tab-stop group: arrow keys by orientation,\n * Home/End, wrapping, disabled items skipped, and exactly one tabbable item.\n *\n * Options are supplied as a thunk rather than a snapshot, so a consumer whose\n * orientation or activation mode is an argument stays reactive without having\n * to push updates in.\n */\nclass RovingFocus {\n #items: HTMLElement[] = [];\n #focused: HTMLElement | undefined;\n #observers = new Map<HTMLElement, MutationObserver>();\n #readOptions: () => RovingFocusOptions;\n\n constructor(readOptions: () => RovingFocusOptions = () => ({})) {\n this.#readOptions = readOptions;\n }\n\n /**\n * Modifier to place on each candidate item. It takes no arguments: both the\n * facts it needs, selection and disabled state, are read from the element\n * itself at the moment a decision is made.\n */\n setupItem = modifier((element: HTMLElement) => {\n this.#register(element);\n element.addEventListener('keydown', this.handleKeydown);\n element.addEventListener('focusin', this.handleFocusIn);\n\n // Navigation reads the DOM live, so it never goes stale. The tab stop is a\n // written attribute though, and nothing re-runs this modifier when the\n // element's own state changes, so watch for it.\n const observer = new MutationObserver(() => this.#syncTabStops());\n observer.observe(element, {\n attributes: true,\n attributeFilter: [\n 'disabled',\n 'aria-disabled',\n 'data-selected',\n 'aria-checked',\n 'aria-selected'\n ]\n });\n this.#observers.set(element, observer);\n\n this.#syncTabStops();\n\n return (): void => {\n element.removeEventListener('keydown', this.handleKeydown);\n element.removeEventListener('focusin', this.handleFocusIn);\n this.#observers.get(element)?.disconnect();\n this.#observers.delete(element);\n this.#items = this.#items.filter((item) => item !== element);\n if (this.#focused === element) {\n this.#focused = undefined;\n }\n this.#syncTabStops();\n };\n });\n\n /**\n * The tab stop belongs wherever focus last was, so that leaving the group\n * and coming back returns the user to where they left off. `focusin` rather\n * than `focus` because an item is not always a leaf -- a grid row holds real\n * controls, and focus landing on one of them still puts the row in play.\n */\n handleFocusIn = (event: FocusEvent): void => {\n const item = event.currentTarget as HTMLElement | null;\n if (!item || this.#focused === item) {\n return;\n }\n this.#focused = item;\n this.#syncTabStops();\n };\n\n handleKeydown = (event: KeyboardEvent): void => {\n const current = event.currentTarget as HTMLElement | null;\n if (!current) {\n return;\n }\n\n // An item is not necessarily a leaf. A key pressed on a button, link or\n // input *inside* one belongs to that control -- taking it would break\n // typing in a cell and swallow Enter on a nested button.\n if (event.target !== current) {\n return;\n }\n\n const { activationMode = 'automatic', onActivate } = this.#readOptions();\n\n if (\n activationMode === 'manual' &&\n (event.key === 'Enter' || event.key === ' ')\n ) {\n event.preventDefault();\n onActivate?.(current);\n return;\n }\n\n const next = this.#resolve(event.key, current);\n if (!next) {\n return;\n }\n\n event.preventDefault();\n next.focus();\n\n if (activationMode === 'automatic') {\n onActivate?.(next);\n }\n };\n\n #register(element: HTMLElement): void {\n if (!this.#items.includes(element)) {\n this.#items.push(element);\n }\n // Modifier setup order is not guaranteed to match DOM order once items are\n // added or reordered, and navigation has to follow what the user sees.\n this.#items.sort((a, b) =>\n a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n );\n }\n\n #isDisabled(element: HTMLElement): boolean {\n return element.matches(DISABLED_SELECTOR);\n }\n\n get #enabled(): HTMLElement[] {\n return this.#items.filter((item) => !this.#isDisabled(item));\n }\n\n #resolve(key: string, current: HTMLElement): HTMLElement | undefined {\n const { orientation = 'horizontal' } = this.#readOptions();\n\n let forward = orientation === 'horizontal' ? 'ArrowRight' : 'ArrowDown';\n let backward = orientation === 'horizontal' ? 'ArrowLeft' : 'ArrowUp';\n\n // The one place direction genuinely matters: in RTL the right arrow moves\n // towards the *start* of the group. Vertical order is unaffected.\n if (\n orientation === 'horizontal' &&\n getComputedStyle(current).direction === 'rtl'\n ) {\n [forward, backward] = [backward, forward];\n }\n\n const enabled = this.#enabled;\n if (enabled.length === 0) {\n return undefined;\n }\n\n const index = enabled.indexOf(current);\n if (index === -1) {\n return key === 'Home' || key === forward ? enabled[0] : undefined;\n }\n\n switch (key) {\n case forward:\n return enabled[(index + 1) % enabled.length];\n case backward:\n return enabled[(index - 1 + enabled.length) % enabled.length];\n case 'Home':\n return enabled[0];\n case 'End':\n return enabled[enabled.length - 1];\n default:\n return undefined;\n }\n }\n\n /**\n * Exactly one item is tabbable. It is wherever focus last was, else the\n * selected one, else -- per the radiogroup pattern, where a group with\n * nothing selected still has to be reachable by Tab -- the first enabled\n * item.\n *\n * Focus comes first because the two only disagree when activation does not\n * follow focus: a `manual` group, or one whose selection is several items\n * at once. There the selected item is not where the user is, and sending\n * Tab back to it would undo their navigation.\n */\n #syncTabStops(): void {\n const focused =\n this.#focused &&\n this.#items.includes(this.#focused) &&\n !this.#isDisabled(this.#focused)\n ? this.#focused\n : undefined;\n\n const selected = this.#items.find(\n (item) => item.matches(SELECTED_SELECTOR) && !this.#isDisabled(item)\n );\n const stop = focused ?? selected ?? this.#enabled[0];\n\n for (const item of this.#items) {\n const tabIndex = item === stop ? 0 : -1;\n // Compared against the *attribute*, not the property: an element that is\n // not natively focusable already reports `tabIndex === -1` with no\n // attribute set, so a property comparison would skip the very write that\n // makes it focusable. Guarded at all because this runs once per item as\n // a group registers -- O(n²) writes for a table's worth of rows.\n if (item.getAttribute('tabindex') !== String(tabIndex)) {\n item.tabIndex = tabIndex;\n }\n }\n }\n}\n\n/**\n * Creates a roving-focus manager.\n *\n * `readOptions` is read lazily on every key press rather than captured once, so\n * a consumer whose orientation or activation mode is a component argument stays\n * reactive without having to push updates in.\n *\n * Mirrors the shape of `ref` and `toggleState`: the class stays internal and\n * the public surface is this lowercase factory, since this is a utility rather\n * than a component.\n */\nfunction rovingFocus(\n readOptions: () => RovingFocusOptions = () => ({})\n): RovingFocus {\n return new RovingFocus(readOptions);\n}\n\nexport {\n rovingFocus,\n type RovingFocusOptions,\n type RovingFocusOrientation,\n type RovingFocusActivationMode\n};\nexport type { RovingFocus };\n"],"names":["SELECTED_SELECTOR","DISABLED_SELECTOR","RovingFocus","Map","constructor","readOptions","setupItem","modifier","element","addEventListener","handleKeydown","handleFocusIn","observer","MutationObserver","observe","attributes","attributeFilter","set","removeEventListener","get","disconnect","delete","filter","item","undefined","event","currentTarget","current","target","activationMode","onActivate","key","preventDefault","next","focus","#register","includes","push","sort","a","b","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","#isDisabled","matches","#enabled","#resolve","orientation","forward","backward","getComputedStyle","direction","enabled","length","index","indexOf","#syncTabStops","focused","selected","find","stop","tabIndex","getAttribute","String","rovingFocus"],"mappings":";;AA0BA;AACA;AACA;AACA;AACA;AACA,MAAMA,iBAAiB,GACrB,uEAAuE;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAG,mCAAmC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,CAAC;EAChB,MAAM,GAAkB,EAAE;AAC1B,EAAA,QAAQ;AACR,EAAA,UAAU,GAAG,IAAIC,GAAG,EAAiC;AACrD,EAAA,YAAY;EAEZC,WAAWA,CAACC,WAAqC,GAAGA,OAAO,EAAE,CAAC,EAAE;AAC9D,IAAA,IAAI,CAAC,YA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AI,GAAGH,OAAO,IAAIC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;AAEpD,IAAA,KAAK,MAAMpC,IAAI,IAAI,IAAI,CAAC,MAAM,EAAE;MAC9B,MAAMuC,QAAQ,GAAGvC,IAAI,KAAKsC,IAAI,GAAG,CAAC,GAAG,EAAE;AACvC;AACA;AACA;AACA;AACA;MACA,IAAItC,IAAI,CAACwC,YAAY,CAAC,UAAU,CAAC,KAAKC,MAAM,CAACF,QAAQ,CAAC,EAAE;QACtDvC,IAAI,CAACuC,QAAQ,GAAGA,QAAQ;AAC1B,MAAA;AACF,IAAA;AACF,EAAA;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,WAAWA,CAClB5D,WAAqC,GAAGA,OAAO,EAAE,CAAC,EACrC;AACb,EAAA,OAAO,IAAIH,WAAW,CAACG,WAAW,CAAC;AACrC;;;;"}
|
|
1
|
+
{"version":3,"file":"roving-focus.js","sources":["../../src/utils/roving-focus.ts"],"sourcesContent":["import { modifier } from 'ember-modifier';\n\ntype RovingFocusOrientation = 'horizontal' | 'vertical';\ntype RovingFocusActivationMode = 'automatic' | 'manual';\n\ninterface RovingFocusOptions {\n /** @defaultValue 'horizontal' */\n orientation?: RovingFocusOrientation;\n\n /**\n * `automatic` moves selection with focus, which is what the radiogroup\n * pattern requires. `manual` moves focus only and waits for Enter or Space,\n * which tabs may want when switching panels is expensive.\n *\n * @defaultValue 'automatic'\n */\n activationMode?: RovingFocusActivationMode;\n\n /**\n * Called when an item becomes the active one: on every focus move when\n * `activationMode` is `automatic`, or on Enter/Space when it is `manual`.\n * Receives the element that was activated.\n */\n onActivate?: (element: HTMLElement) => void;\n}\n\n/**\n * How an element says it is selected. Read from the element for the same\n * reason as `DISABLED_SELECTOR`: it already has to declare this for assistive\n * technology, and a second declaration is only a way for the two to disagree.\n */\nconst SELECTED_SELECTOR =\n '[data-selected=\"true\"], [aria-checked=\"true\"], [aria-selected=\"true\"]';\n\n/**\n * How an element says it is disabled. `:disabled` covers the form controls\n * that support it; `[aria-disabled=\"true\"]` covers everything that does not --\n * an `<a>` or a `LinkTo`, which a navigation tab list is built from, cannot be\n * natively disabled at all.\n */\nconst DISABLED_SELECTOR = ':disabled, [aria-disabled=\"true\"]';\n\n/**\n * Keyboard navigation for a single-tab-stop group: arrow keys by orientation,\n * Home/End, wrapping, disabled items skipped, and exactly one tabbable item.\n *\n * Options are supplied as a thunk rather than a snapshot, so a consumer whose\n * orientation or activation mode is an argument stays reactive without having\n * to push updates in.\n */\nclass RovingFocus {\n #items: HTMLElement[] = [];\n #focused: HTMLElement | undefined;\n #observers = new Map<HTMLElement, MutationObserver>();\n #readOptions: () => RovingFocusOptions;\n\n constructor(readOptions: () => RovingFocusOptions = () => ({})) {\n this.#readOptions = readOptions;\n }\n\n /**\n * Modifier to place on each candidate item. It takes no arguments: both the\n * facts it needs, selection and disabled state, are read from the element\n * itself at the moment a decision is made.\n */\n setupItem = modifier((element: HTMLElement) => {\n this.#register(element);\n element.addEventListener('keydown', this.handleKeydown);\n element.addEventListener('focusin', this.handleFocusIn);\n\n // Navigation reads the DOM live, so it never goes stale. The tab stop is a\n // written attribute though, and nothing re-runs this modifier when the\n // element's own state changes, so watch for it.\n const observer = new MutationObserver(() => this.#syncTabStops());\n observer.observe(element, {\n attributes: true,\n attributeFilter: [\n 'disabled',\n 'aria-disabled',\n 'data-selected',\n 'aria-checked',\n 'aria-selected'\n ]\n });\n this.#observers.set(element, observer);\n\n this.#syncTabStops();\n\n return (): void => {\n element.removeEventListener('keydown', this.handleKeydown);\n element.removeEventListener('focusin', this.handleFocusIn);\n this.#observers.get(element)?.disconnect();\n this.#observers.delete(element);\n this.#items = this.#items.filter((item) => item !== element);\n if (this.#focused === element) {\n this.#focused = undefined;\n }\n this.#syncTabStops();\n };\n });\n\n /**\n * The tab stop belongs wherever focus last was, so that leaving the group\n * and coming back returns the user to where they left off. `focusin` rather\n * than `focus` because an item is not always a leaf -- a grid row holds real\n * controls, and focus landing on one of them still puts the row in play.\n */\n handleFocusIn = (event: FocusEvent): void => {\n const item = event.currentTarget as HTMLElement | null;\n if (!item || this.#focused === item) {\n return;\n }\n this.#focused = item;\n this.#syncTabStops();\n };\n\n handleKeydown = (event: KeyboardEvent): void => {\n const current = event.currentTarget as HTMLElement | null;\n if (!current) {\n return;\n }\n\n // An item is not necessarily a leaf. A key pressed on a button, link or\n // input *inside* one belongs to that control -- taking it would break\n // typing in a cell and swallow Enter on a nested button.\n if (event.target !== current) {\n return;\n }\n\n const { activationMode = 'automatic', onActivate } = this.#readOptions();\n\n if (\n activationMode === 'manual' &&\n (event.key === 'Enter' || event.key === ' ')\n ) {\n event.preventDefault();\n onActivate?.(current);\n return;\n }\n\n const next = this.#resolve(event.key, current);\n if (!next) {\n return;\n }\n\n event.preventDefault();\n next.focus();\n\n if (activationMode === 'automatic') {\n onActivate?.(next);\n }\n };\n\n #register(element: HTMLElement): void {\n if (!this.#items.includes(element)) {\n this.#items.push(element);\n }\n // Modifier setup order is not guaranteed to match DOM order once items are\n // added or reordered, and navigation has to follow what the user sees.\n this.#items.sort((a, b) =>\n a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1\n );\n }\n\n #isDisabled(element: HTMLElement): boolean {\n return element.matches(DISABLED_SELECTOR);\n }\n\n get #enabled(): HTMLElement[] {\n return this.#items.filter((item) => !this.#isDisabled(item));\n }\n\n #resolve(key: string, current: HTMLElement): HTMLElement | undefined {\n const { orientation = 'horizontal' } = this.#readOptions();\n\n let forward = orientation === 'horizontal' ? 'ArrowRight' : 'ArrowDown';\n let backward = orientation === 'horizontal' ? 'ArrowLeft' : 'ArrowUp';\n\n // The one place direction genuinely matters: in RTL the right arrow moves\n // towards the *start* of the group. Vertical order is unaffected.\n if (\n orientation === 'horizontal' &&\n getComputedStyle(current).direction === 'rtl'\n ) {\n [forward, backward] = [backward, forward];\n }\n\n const enabled = this.#enabled;\n if (enabled.length === 0) {\n return undefined;\n }\n\n const index = enabled.indexOf(current);\n if (index === -1) {\n return key === 'Home' || key === forward ? enabled[0] : undefined;\n }\n\n switch (key) {\n case forward:\n return enabled[(index + 1) % enabled.length];\n case backward:\n return enabled[(index - 1 + enabled.length) % enabled.length];\n case 'Home':\n return enabled[0];\n case 'End':\n return enabled[enabled.length - 1];\n default:\n return undefined;\n }\n }\n\n /**\n * Exactly one item is tabbable. It is wherever focus last was, else the\n * selected one, else -- per the radiogroup pattern, where a group with\n * nothing selected still has to be reachable by Tab -- the first enabled\n * item.\n *\n * Focus comes first because the two only disagree when activation does not\n * follow focus: a `manual` group, or one whose selection is several items\n * at once. There the selected item is not where the user is, and sending\n * Tab back to it would undo their navigation.\n */\n #syncTabStops(): void {\n const focused =\n this.#focused &&\n this.#items.includes(this.#focused) &&\n !this.#isDisabled(this.#focused)\n ? this.#focused\n : undefined;\n\n const selected = this.#items.find(\n (item) => item.matches(SELECTED_SELECTOR) && !this.#isDisabled(item)\n );\n const stop = focused ?? selected ?? this.#enabled[0];\n\n for (const item of this.#items) {\n const tabIndex = item === stop ? 0 : -1;\n // Compared against the *attribute*, not the property: an element that is\n // not natively focusable already reports `tabIndex === -1` with no\n // attribute set, so a property comparison would skip the very write that\n // makes it focusable. Guarded at all because this runs once per item as\n // a group registers -- O(n²) writes for a table's worth of rows.\n if (item.getAttribute('tabindex') !== String(tabIndex)) {\n item.tabIndex = tabIndex;\n }\n }\n }\n}\n\n/**\n * Creates a roving-focus manager.\n *\n * `readOptions` is read lazily on every key press rather than captured once, so\n * a consumer whose orientation or activation mode is a component argument stays\n * reactive without having to push updates in.\n *\n * Mirrors the shape of `ref` and `toggleState`: the class stays internal and\n * the public surface is this lowercase factory, since this is a utility rather\n * than a component.\n */\nfunction rovingFocus(\n readOptions: () => RovingFocusOptions = () => ({})\n): RovingFocus {\n return new RovingFocus(readOptions);\n}\n\nexport {\n rovingFocus,\n type RovingFocusOptions,\n type RovingFocusOrientation,\n type RovingFocusActivationMode\n};\nexport type { RovingFocus };\n"],"names":["SELECTED_SELECTOR","DISABLED_SELECTOR","RovingFocus","Map","constructor","readOptions","setupItem","modifier","element","addEventListener","handleKeydown","handleFocusIn","observer","MutationObserver","observe","attributes","attributeFilter","set","removeEventListener","get","disconnect","delete","filter","item","undefined","event","currentTarget","current","target","activationMode","onActivate","key","preventDefault","next","focus","#register","includes","push","sort","a","b","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","#isDisabled","matches","#enabled","#resolve","orientation","forward","backward","getComputedStyle","direction","enabled","length","index","indexOf","#syncTabStops","focused","selected","find","stop","tabIndex","getAttribute","String","rovingFocus"],"mappings":";;AA0BA;AACA;AACA;AACA;AACA;AACA,MAAMA,iBAAiB,GACrB,uEAAuE;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAG,mCAAmC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,CAAC;EAChB,MAAM,GAAkB,EAAE;AAC1B,EAAA,QAAQ;AACR,EAAA,UAAU,GAAG,IAAIC,GAAG,EAAiC;AACrD,EAAA,YAAY;EAEZC,WAAWA,CAACC,WAAqC,GAAGA,OAAO,EAAE,CAAC,EAAE;AAC9D,IAAA,IAAI,CAAC,YAAY,GAAGA,WAAW;AACjC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEC,EAAAA,SAAS,GAAGC,QAAQ,CAAEC,OAAoB,IAAK;AAC7C,IAAA,IAAI,CAAC,SAAS,CAACA,OAAO,CAAC;IACvBA,OAAO,CAACC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAACC,aAAa,CAAC;IACvDF,OAAO,CAACC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAACE,aAAa,CAAC;;AAEvD;AACA;AACA;AACA,IAAA,MAAMC,QAAQ,GAAG,IAAIC,gBAAgB,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;AACjED,IAAAA,Q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A;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASG,WAAWA,CAClB5D,WAAqC,GAAGA,OAAO,EAAE,CAAC,EACrC;AACb,EAAA,OAAO,IAAIH,WAAW,CAACG,WAAW,CAAC;AACrC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-area.js","sources":["../../src/utils/safe-area.ts"],"sourcesContent":["/**\n * The \"safe area\" a pointer may travel through on its way from a submenu\n * trigger to the submenu itself.\n *\n * A submenu that closed the instant the pointer left its trigger row would be\n * unusable: the pointer has to cross a gap, and it crosses it diagonally\n * because the submenu is offset downward from the row that opened it. The safe\n * area is the trigger rect, the content rect, and the polygon that fans out\n * from the trigger's facing edge to cover the whole content rect -- so a\n * pointer aimed at the submenu keeps it open, while one heading for a sibling\n * row leaves immediately and closes it.\n *\n * Pure functions over plain rects: the fiddliest part of the interaction is\n * therefore testable without a browser, and the placement (left or right of\n * the trigger, possibly flipped by floating-ui) is derived from the rects\n * rather than passed in and trusted.\n */\n\ninterface Point {\n x: number;\n y: number;\n}\n\ntype Rect = Pick<DOMRect, 'top' | 'right' | 'bottom' | 'left'>;\n\n/** Inclusive of the edges: a pointer exactly on the border is still inside. */\nfunction isPointInRect(point: Point, rect: Rect): boolean {\n return (\n point.x >= rect.left &&\n point.x <= rect.right &&\n point.y >= rect.top &&\n point.y <= rect.bottom\n );\n}\n\n/**\n * Cross product of (o -> a) and (o -> b). Positive when a->b turns left\n * (counter-clockwise) around o, negative when it turns right, zero when the\n * three points are collinear.\n */\nfunction cross(o: Point, a: Point, b: Point): number {\n return (a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x);\n}\n\n/**\n * Convex hull via the monotone chain (Andrew's) algorithm. Sorts the points\n * and builds the lower and upper chains, dropping any point that would make\n * a non-left turn — which also drops collinear points, so degenerate input\n * (duplicates, all-collinear rects) shrinks to a smaller-but-still-valid\n * simple polygon instead of throwing.\n */\nfunction convexHull(points: Point[]): Point[] {\n const sorted = [...points].sort((a, b) => a.x - b.x || a.y - b.y);\n\n const lower: Point[] = [];\n for (const point of sorted) {\n while (\n lower.length >= 2 &&\n cross(\n lower[lower.length - 2] as Point,\n lower[lower.length - 1] as Point,\n point\n ) <= 0\n ) {\n lower.pop();\n }\n lower.push(point);\n }\n\n const upper: Point[] = [];\n for (let i = sorted.length - 1; i >= 0; i--) {\n const point = sorted[i] as Point;\n while (\n upper.length >= 2 &&\n cross(\n upper[upper.length - 2] as Point,\n upper[upper.length - 1] as Point,\n point\n ) <= 0\n ) {\n upper.pop();\n }\n upper.push(point);\n }\n\n lower.pop();\n upper.pop();\n\n return [...lower, ...upper];\n}\n\n/**\n * The bridge from the trigger's facing edge to the content rect.\n *\n * Which edge faces the content is decided by the rects: floating-ui's flip\n * middleware can put the submenu on either side, and a polygon built for the\n * wrong side would make every pointer movement unsafe.\n *\n * The safe area is the convex hull of six candidate points: the trigger's\n * two facing-edge corners, and the content rect's four corners. The hull is\n * computed rather than hand-picked, because which of the content's corners\n * turn out to be redundant (inside the hull of the rest) depends on\n * placement — for a submenu opening downward the near-top corner is usually\n * the one the hull drops, but for one flipped upward it can be the\n * near-bottom corner instead, and whenever the content is no taller than the\n * trigger both near corners can matter. Computing the real hull is correct\n * for every placement instead of only the ones a hand-picked shape happens\n * to fit.\n */\nfunction buildSafeAreaPolygon(trigger: Rect, content: Rect): Point[] {\n const opensRight =\n content.left + content.right >= trigger.left + trigger.right;\n\n const edgeX = opensRight ? trigger.right : trigger.left;\n const nearX = opensRight ? content.left : content.right;\n const farX = opensRight ? content.right : content.left;\n\n return convexHull([\n { x: edgeX, y: trigger.top },\n { x: nearX, y: content.top },\n { x: farX, y: content.top },\n { x: farX, y: content.bottom },\n { x: nearX, y: content.bottom },\n { x: edgeX, y: trigger.bottom }\n ]);\n}\n\n/**\n * Ray casting: count the polygon edges a ray from the point crosses. An odd\n * count means inside. Chosen over a winding number because the polygon above\n * is always simple (non-self-intersecting), which is the case ray casting\n * handles without caveats.\n */\nfunction isPointInPolygon(point: Point, polygon: Point[]): boolean {\n let isInside = false;\n\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const a = polygon[i] as Point;\n const b = polygon[j] as Point;\n\n const straddlesRay = a.y > point.y !== b.y > point.y;\n if (!straddlesRay) {\n continue;\n }\n\n const crossingX = ((b.x - a.x) * (point.y - a.y)) / (b.y - a.y) + a.x;\n if (point.x < crossingX) {\n isInside = !isInside;\n }\n }\n\n return isInside;\n}\n\nfunction isPointInSafeArea(\n point: Point,\n trigger: Rect,\n content: Rect\n): boolean {\n return (\n isPointInRect(point, trigger) ||\n isPointInRect(point, content) ||\n isPointInPolygon(point, buildSafeAreaPolygon(trigger, content))\n );\n}\n\nexport {\n isPointInRect,\n buildSafeAreaPolygon,\n isPointInPolygon,\n isPointInSafeArea,\n type Point,\n type Rect\n};\n"],"names":["isPointInRect","point","rect","x","left","right","y","top","bottom","cross","o","a","b","convexHull","points","sorted","sort","lower","length","pop","push","upper","i","buildSafeAreaPolygon","trigger","content","opensRight","edgeX","nearX","farX","isPointInPolygon","polygon","isInside","j","straddlesRay","crossingX","isPointInSafeArea"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA,SAASA,aAAaA,CAACC,KAAY,EAAEC,IAAU,EAAW;AACxD,EAAA,OACED,KAAK,CAACE,CAAC,IAAID,IAAI,CAACE,IAAI,IACpBH,KAAK,CAACE,CAAC,IAAID,IAAI,CAACG,KAAK,IACrBJ,KAAK,CAACK,CAAC,IAAIJ,IAAI,CAACK,GAAG,IACnBN,KAAK,CAACK,CAAC,IAAIJ,IAAI,CAACM,MAAM;AAE1B;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASC,KAAKA,CAACC,CAAQ,EAAEC,CAAQ,EAAEC,CAAQ,EAAU;AACnD,EAAA,OAAO,CAACD,CAAC,CAACR,CAAC,GAAGO,CAAC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KAAK,EAAEuB,OAAO,CAAC,IAC7BxB,aAAa,CAACC,KAAK,EAAEwB,OAAO,CAAC,IAC7BK,gBAAgB,CAAC7B,KAAK,EAAEsB,oBAAoB,CAACC,OAAO,EAAEC,OAAO,CAAC,CAAC;AAEnE
|
|
1
|
+
{"version":3,"file":"safe-area.js","sources":["../../src/utils/safe-area.ts"],"sourcesContent":["/**\n * The \"safe area\" a pointer may travel through on its way from a submenu\n * trigger to the submenu itself.\n *\n * A submenu that closed the instant the pointer left its trigger row would be\n * unusable: the pointer has to cross a gap, and it crosses it diagonally\n * because the submenu is offset downward from the row that opened it. The safe\n * area is the trigger rect, the content rect, and the polygon that fans out\n * from the trigger's facing edge to cover the whole content rect -- so a\n * pointer aimed at the submenu keeps it open, while one heading for a sibling\n * row leaves immediately and closes it.\n *\n * Pure functions over plain rects: the fiddliest part of the interaction is\n * therefore testable without a browser, and the placement (left or right of\n * the trigger, possibly flipped by floating-ui) is derived from the rects\n * rather than passed in and trusted.\n */\n\ninterface Point {\n x: number;\n y: number;\n}\n\ntype Rect = Pick<DOMRect, 'top' | 'right' | 'bottom' | 'left'>;\n\n/** Inclusive of the edges: a pointer exactly on the border is still inside. */\nfunction isPointInRect(point: Point, rect: Rect): boolean {\n return (\n point.x >= rect.left &&\n point.x <= rect.right &&\n point.y >= rect.top &&\n point.y <= rect.bottom\n );\n}\n\n/**\n * Cross product of (o -> a) and (o -> b). Positive when a->b turns left\n * (counter-clockwise) around o, negative when it turns right, zero when the\n * three points are collinear.\n */\nfunction cross(o: Point, a: Point, b: Point): number {\n return (a.x - o.x) * (b.y - o.y) - (a.y - o.y) * (b.x - o.x);\n}\n\n/**\n * Convex hull via the monotone chain (Andrew's) algorithm. Sorts the points\n * and builds the lower and upper chains, dropping any point that would make\n * a non-left turn — which also drops collinear points, so degenerate input\n * (duplicates, all-collinear rects) shrinks to a smaller-but-still-valid\n * simple polygon instead of throwing.\n */\nfunction convexHull(points: Point[]): Point[] {\n const sorted = [...points].sort((a, b) => a.x - b.x || a.y - b.y);\n\n const lower: Point[] = [];\n for (const point of sorted) {\n while (\n lower.length >= 2 &&\n cross(\n lower[lower.length - 2] as Point,\n lower[lower.length - 1] as Point,\n point\n ) <= 0\n ) {\n lower.pop();\n }\n lower.push(point);\n }\n\n const upper: Point[] = [];\n for (let i = sorted.length - 1; i >= 0; i--) {\n const point = sorted[i] as Point;\n while (\n upper.length >= 2 &&\n cross(\n upper[upper.length - 2] as Point,\n upper[upper.length - 1] as Point,\n point\n ) <= 0\n ) {\n upper.pop();\n }\n upper.push(point);\n }\n\n lower.pop();\n upper.pop();\n\n return [...lower, ...upper];\n}\n\n/**\n * The bridge from the trigger's facing edge to the content rect.\n *\n * Which edge faces the content is decided by the rects: floating-ui's flip\n * middleware can put the submenu on either side, and a polygon built for the\n * wrong side would make every pointer movement unsafe.\n *\n * The safe area is the convex hull of six candidate points: the trigger's\n * two facing-edge corners, and the content rect's four corners. The hull is\n * computed rather than hand-picked, because which of the content's corners\n * turn out to be redundant (inside the hull of the rest) depends on\n * placement — for a submenu opening downward the near-top corner is usually\n * the one the hull drops, but for one flipped upward it can be the\n * near-bottom corner instead, and whenever the content is no taller than the\n * trigger both near corners can matter. Computing the real hull is correct\n * for every placement instead of only the ones a hand-picked shape happens\n * to fit.\n */\nfunction buildSafeAreaPolygon(trigger: Rect, content: Rect): Point[] {\n const opensRight =\n content.left + content.right >= trigger.left + trigger.right;\n\n const edgeX = opensRight ? trigger.right : trigger.left;\n const nearX = opensRight ? content.left : content.right;\n const farX = opensRight ? content.right : content.left;\n\n return convexHull([\n { x: edgeX, y: trigger.top },\n { x: nearX, y: content.top },\n { x: farX, y: content.top },\n { x: farX, y: content.bottom },\n { x: nearX, y: content.bottom },\n { x: edgeX, y: trigger.bottom }\n ]);\n}\n\n/**\n * Ray casting: count the polygon edges a ray from the point crosses. An odd\n * count means inside. Chosen over a winding number because the polygon above\n * is always simple (non-self-intersecting), which is the case ray casting\n * handles without caveats.\n */\nfunction isPointInPolygon(point: Point, polygon: Point[]): boolean {\n let isInside = false;\n\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const a = polygon[i] as Point;\n const b = polygon[j] as Point;\n\n const straddlesRay = a.y > point.y !== b.y > point.y;\n if (!straddlesRay) {\n continue;\n }\n\n const crossingX = ((b.x - a.x) * (point.y - a.y)) / (b.y - a.y) + a.x;\n if (point.x < crossingX) {\n isInside = !isInside;\n }\n }\n\n return isInside;\n}\n\nfunction isPointInSafeArea(\n point: Point,\n trigger: Rect,\n content: Rect\n): boolean {\n return (\n isPointInRect(point, trigger) ||\n isPointInRect(point, content) ||\n isPointInPolygon(point, buildSafeAreaPolygon(trigger, content))\n );\n}\n\nexport {\n isPointInRect,\n buildSafeAreaPolygon,\n isPointInPolygon,\n isPointInSafeArea,\n type Point,\n type Rect\n};\n"],"names":["isPointInRect","point","rect","x","left","right","y","top","bottom","cross","o","a","b","convexHull","points","sorted","sort","lower","length","pop","push","upper","i","buildSafeAreaPolygon","trigger","content","opensRight","edgeX","nearX","farX","isPointInPolygon","polygon","isInside","j","straddlesRay","crossingX","isPointInSafeArea"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AASA;AACA,SAASA,aAAaA,CAACC,KAAY,EAAEC,IAAU,EAAW;AACxD,EAAA,OACED,KAAK,CAACE,CAAC,IAAID,IAAI,CAACE,IAAI,IACpBH,KAAK,CAACE,CAAC,IAAID,IAAI,CAACG,KAAK,IACrBJ,KAAK,CAACK,CAAC,IAAIJ,IAAI,CAACK,GAAG,IACnBN,KAAK,CAACK,CAAC,IAAIJ,IAAI,CAACM,MAAM;AAE1B;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASC,KAAKA,CAACC,CAAQ,EAAEC,CAAQ,EAAEC,CAAQ,EAAU;AACnD,EAAA,OAAO,CAACD,CAAC,CAACR,CAAC,GAAGO,CAAC,CAACP,CAAC,KAAKS,CAA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C,IAC7BxB,aAAa,CAACC,KAAK,EAAEwB,OAAO,CAAC,IAC7BK,gBAAgB,CAAC7B,KAAK,EAAEsB,oBAAoB,CAACC,OAAO,EAAEC,OAAO,CAAC,CAAC;AAEnE;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-styles.js","sources":["../../src/utils/safe-styles.ts"],"sourcesContent":["import { htmlSafe } from '@ember/template';\n\nexport default function safeStyles(\n style: Record<string, string | number> | undefined\n): ReturnType<typeof htmlSafe> {\n if (!style) {\n return htmlSafe('');\n }\n const styles: string[] = [];\n\n Object.keys(style).forEach((key): void => {\n styles.push(`${key}:${style[key]}`);\n });\n\n return htmlSafe(styles.join(';'));\n}\n"],"names":["safeStyles","style","htmlSafe","styles","Object","keys","forEach","key","push","join"],"mappings":";;AAEe,SAASA,UAAUA,CAChCC,KAAkD,EACrB;EAC7B,IAAI,CAACA,KAAK,EAAE;IACV,OAAOC,QAAQ,CAAC,EAAE,CAAC;AACrB,EAAA;EACA,MAAMC,MAAgB,GAAG,EAAE;EAE3BC,MAAM,CAACC,IAAI,CAACJ,KAAK,CAAC,CAACK,OAAO,CAAEC,GAAG,IAAW;IACxCJ,MAAM,CAACK,IAAI,CAAC,CAAA,EAAGD,GAAG,CAAA,CAAA,EAAIN,KAAK,CAACM,GAAG,CAAC,CAAA,CAAE,CAAC;AACrC,EAAA,CAAC,CAAC;EAEF,OAAOL,QAAQ,CAACC,MAAM,CAACM,IAAI,CAAC,GAAG,CAAC,CAAC;AACnC
|
|
1
|
+
{"version":3,"file":"safe-styles.js","sources":["../../src/utils/safe-styles.ts"],"sourcesContent":["import { htmlSafe } from '@ember/template';\n\nexport default function safeStyles(\n style: Record<string, string | number> | undefined\n): ReturnType<typeof htmlSafe> {\n if (!style) {\n return htmlSafe('');\n }\n const styles: string[] = [];\n\n Object.keys(style).forEach((key): void => {\n styles.push(`${key}:${style[key]}`);\n });\n\n return htmlSafe(styles.join(';'));\n}\n"],"names":["safeStyles","style","htmlSafe","styles","Object","keys","forEach","key","push","join"],"mappings":";;AAEe,SAASA,UAAUA,CAChCC,KAAkD,EACrB;EAC7B,IAAI,CAACA,KAAK,EAAE;IACV,OAAOC,QAAQ,CAAC,EAAE,CAAC;AACrB,EAAA;EACA,MAAMC,MAAgB,GAAG,EAAE;EAE3BC,MAAM,CAACC,IAAI,CAACJ,KAAK,CAAC,CAACK,OAAO,CAAEC,GAAG,IAAW;IACxCJ,MAAM,CAACK,IAAI,CAAC,CAAA,EAAGD,GAAG,CAAA,CAAA,EAAIN,KAAK,CAACM,GAAG,CAAC,CAAA,CAAE,CAAC;AACrC,EAAA,CAAC,CAAC;EAEF,OAAOL,QAAQ,CAACC,MAAM,CAACM,IAAI,CAAC,GAAG,CAAC,CAAC;AACnC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selection-indicator.js","sources":["../../src/utils/selection-indicator.ts"],"sourcesContent":["import { modifier } from 'ember-modifier';\nimport { deferredWork } from './deferred-work';\n\nconst READY_ATTRIBUTE = 'data-fr-si-ready';\n\n/**\n * Measures whichever element is currently selected and publishes its geometry\n * on the container as CSS custom properties. It never paints anything: the\n * theme decides whether that geometry becomes a full pill or a bar pinned to\n * one edge, which is what lets one primitive serve a segmented control and\n * tabs alike.\n *\n * Offsets are physical (`offsetLeft` / `offsetTop`), not logical, and that is\n * deliberate. The browser has already laid the items out for the container's\n * direction, so a physical offset fed to `translate` is correct in both LTR\n * and RTL. Reaching for `inset-inline-start` here would flip an already\n * flipped value.\n */\nclass SelectionIndicator {\n #container?: HTMLElement;\n #target?: HTMLElement;\n #observer?: ResizeObserver;\n #ready = deferredWork('@frontile/utils:selection-indicator:ready');\n #remeasure = deferredWork('@frontile/utils:selection-indicator:remeasure');\n #resize = deferredWork('@frontile/utils:selection-indicator:resize');\n #isReady = false;\n\n // Whether a real measurement has ever landed. Only the very first one is\n // forced-layout-sensitive (see `setupContainer`); once it has happened, a\n // click that moves the selection is no longer racing an ancestor's own\n // mount-time transition, so there is no reason to defer those.\n #hasMeasuredOnce = false;\n\n /**\n * Modifier to place on the container element. Observes its size and, once\n * a target is selected, publishes that target's geometry as CSS custom\n * properties on this element.\n */\n setupContainer = modifier((element: HTMLElement) => {\n this.#container = element;\n // Coalesced to one measurement per frame: the container and the target are\n // both observed, and resizing the container usually resizes the target too,\n // so a single layout change delivers two entries. Measuring reads layout\n // and then writes four custom properties, and a window drag fires this\n // continuously.\n this.#observer = new ResizeObserver(() =>\n this.#resize.schedule(() => this.#measure())\n );\n this.#observer.observe(element);\n\n if (this.#target) {\n this.#observer.observe(this.#target);\n }\n\n // Before the first real measurement, this call is happening during the\n // control's own initial mount -- the same render pass that can be\n // mounting an ancestor overlay's enter transition. Forcing layout here\n // lands at an arbitrary point in `ember-css-transitions`' own\n // reflow-then-swap sequence for that transition, which is enough to make\n // the browser skip it entirely. `ResizeObserver.observe()` above already\n // guarantees an initial, asynchronous notification for `element` (and for\n // the target, if already claimed), so leaving it to that -- deferred\n // through `#resize` like any other resize -- gets the same measurement\n // without the synchronous reflow. Once a first measurement has actually\n // landed, later remounts of this same container are no longer racing\n // anything, so measure immediately as before.\n if (this.#hasMeasuredOnce) {\n this.#measure();\n }\n\n return (): void => {\n this.#shutDown();\n };\n });\n\n /**\n * Claims `element` as the measured target. Exposed alongside `setupTarget`\n * so a consumer composing its own modifier -- a navigation bar that also has\n * to write `aria-current` -- can delegate here rather than reimplement the\n * handover rules below.\n *\n * Measures synchronously once a first measurement has already landed --\n * see `setupContainer` -- so a click that moves the selection updates the\n * indicator immediately rather than a frame later.\n */\n claim(element: HTMLElement): void {\n this.#target = element;\n this.#observer?.observe(element);\n if (this.#hasMeasuredOnce) {\n this.#measure();\n }\n }\n\n /**\n * Releases `element` if it is still the target. When selection moves\n * backwards, the incoming item's setup runs before the outgoing item's\n * teardown, and without this guard that teardown would wipe the new\n * target.\n */\n release(element: HTMLElement): void {\n if (this.#target !== element) {\n return;\n }\n this.#observer?.unobserve(element);\n this.#target = undefined;\n\n // Do not re-measure synchronously. When selection moves forwards the\n // order is reversed -- ember-modifier tears down before re-running\n // setup, and Glimmer revalidates in tree order -- so the outgoing\n // teardown lands first and the incoming target is still moments away\n // in this same render. Measuring now would strip the ready attribute,\n // and the theme gates both opacity and the transition on it, so the\n // indicator would blink out and jump to its new position instead of\n // sliding. Defer instead, and only fall through to the not-ready path\n // if nothing has claimed the target by then.\n this.#scheduleRemeasure();\n }\n\n /**\n * Modifier to place on each candidate target element, passing whether it\n * is currently selected as the sole positional argument. Only the\n * currently-selected target's geometry is measured and published.\n */\n setupTarget = modifier((element: HTMLElement, [isSelected]: [boolean]) => {\n if (isSelected) {\n this.claim(element);\n }\n\n return (): void => {\n this.release(element);\n };\n });\n\n /**\n * Recomputes and republishes the current target's geometry. Called\n * automatically on setup, selection change, and container/target resize;\n * exposed for callers that need to force a recomputation.\n */\n #measure = (): void => {\n const container = this.#container;\n if (!container) {\n return;\n }\n\n const target = this.#target;\n if (!target) {\n this.#markNotReady();\n return;\n }\n\n const width = target.offsetWidth;\n const height = target.offsetHeight;\n\n // A control inside a hidden ancestor -- a closed drawer, an inactive tab\n // panel -- measures zero. Publishing that would collapse the indicator and,\n // worse, mark it ready, so the first real measurement once it is shown\n // would animate in from the container origin. Stay un-ready instead; the\n // ResizeObserver fires when it becomes visible.\n if (width === 0 && height === 0) {\n this.#markNotReady();\n return;\n }\n\n container.style.setProperty('--fr-si-x', `${target.offsetLeft}px`);\n container.style.setProperty('--fr-si-y', `${target.offsetTop}px`);\n container.style.setProperty('--fr-si-width', `${width}px`);\n container.style.setProperty('--fr-si-height', `${height}px`);\n\n this.#hasMeasuredOnce = true;\n\n if (!this.#isReady) {\n this.#isReady = true;\n this.#scheduleReady(container);\n }\n };\n\n /**\n * Everything the container modifier's destructor undoes. The target is not\n * reset here: it belongs to `setupTarget`, whose own destructor clears it.\n */\n #shutDown(): void {\n this.#observer?.disconnect();\n this.#observer = undefined;\n this.#ready.cancel();\n this.#remeasure.cancel();\n this.#resize.cancel();\n this.#container = undefined;\n this.#isReady = false;\n }\n\n #markNotReady(): void {\n this.#ready.cancel();\n this.#isReady = false;\n this.#container?.removeAttribute(READY_ATTRIBUTE);\n }\n\n // The ready flag is set a frame after the first real measurement so the\n // theme can hold transitions off until the indicator is already in place.\n #scheduleReady(container: HTMLElement): void {\n this.#ready.schedule(() => container.setAttribute(READY_ATTRIBUTE, ''));\n }\n\n // Re-measures once the current render has settled, so a target being handed\n // from one element to another is never observed mid-handover.\n #scheduleRemeasure(): void {\n this.#remeasure.schedule(() => {\n // A new target claimed the slot in the meantime and measured itself.\n if (this.#target) {\n return;\n }\n this.#measure();\n }, 'microtask');\n }\n}\n\n/**\n * Creates a selection indicator.\n *\n * Mirrors the shape of `ref` and `toggleState`: the class stays internal and\n * the public surface is this lowercase factory, since this is a utility rather\n * than a component.\n */\nfunction selectionIndicator(): SelectionIndicator {\n return new SelectionIndicator();\n}\n\nexport { selectionIndicator, READY_ATTRIBUTE };\nexport type { SelectionIndicator };\n"],"names":["READY_ATTRIBUTE","SelectionIndicator","deferredWork","setupContainer","modifier","element","ResizeObserver","schedule","observe","claim","release","unobserve","undefined","setupTarget","isSelected","#measure","container","target","width","offsetWidth","height","offsetHeight","style","setProperty","offsetLeft","offsetTop","#shutDown","disconnect","cancel","#markNotReady","removeAttribute","#scheduleReady","setAttribute","#scheduleRemeasure","selectionIndicator"],"mappings":";;;AAGA,MAAMA,eAAe,GAAG;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,CAAC;AACvB,EAAA,UAAU;AACV,EAAA,OAAO;AACP,EAAA,SAAS;AACT,EAAA,MAAM,GAAGC,YAAY,CAAC,2CAA2C,CAAC;AAClE,EAAA,UAAU,GAAGA,YAAY,CAAC,+CAA+C,CAAC;AAC1E,EAAA,OAAO,GAAGA,YAAY,CAAC,4CAA4C,CAAC;EACpE,QAAQ,GAAG,KAAK;;AAE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AC1B,QAAQ,CAAC,MAAM;AAC7B;AACA,MAAA,IAAI,IAAI,CAAC,OAAO,EAAE;AAChB,QAAA;AACF,MAAA;AACA,MAAA,IAAI,CAAC,QAAQ,EAAE;IACjB,CAAC,EAAE,WAAW,CAAC;AACjB,EAAA;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS2B,kBAAkBA,GAAuB;EAChD,OAAO,IAAIjC,kBAAkB,EAAE;AACjC;;;;"}
|
|
1
|
+
{"version":3,"file":"selection-indicator.js","sources":["../../src/utils/selection-indicator.ts"],"sourcesContent":["import { modifier } from 'ember-modifier';\nimport { deferredWork } from './deferred-work';\n\nconst READY_ATTRIBUTE = 'data-fr-si-ready';\n\n/**\n * Measures whichever element is currently selected and publishes its geometry\n * on the container as CSS custom properties. It never paints anything: the\n * theme decides whether that geometry becomes a full pill or a bar pinned to\n * one edge, which is what lets one primitive serve a segmented control and\n * tabs alike.\n *\n * Offsets are physical (`offsetLeft` / `offsetTop`), not logical, and that is\n * deliberate. The browser has already laid the items out for the container's\n * direction, so a physical offset fed to `translate` is correct in both LTR\n * and RTL. Reaching for `inset-inline-start` here would flip an already\n * flipped value.\n */\nclass SelectionIndicator {\n #container?: HTMLElement;\n #target?: HTMLElement;\n #observer?: ResizeObserver;\n #ready = deferredWork('@frontile/utils:selection-indicator:ready');\n #remeasure = deferredWork('@frontile/utils:selection-indicator:remeasure');\n #resize = deferredWork('@frontile/utils:selection-indicator:resize');\n #isReady = false;\n\n // Whether a real measurement has ever landed. Only the very first one is\n // forced-layout-sensitive (see `setupContainer`); once it has happened, a\n // click that moves the selection is no longer racing an ancestor's own\n // mount-time transition, so there is no reason to defer those.\n #hasMeasuredOnce = false;\n\n /**\n * Modifier to place on the container element. Observes its size and, once\n * a target is selected, publishes that target's geometry as CSS custom\n * properties on this element.\n */\n setupContainer = modifier((element: HTMLElement) => {\n this.#container = element;\n // Coalesced to one measurement per frame: the container and the target are\n // both observed, and resizing the container usually resizes the target too,\n // so a single layout change delivers two entries. Measuring reads layout\n // and then writes four custom properties, and a window drag fires this\n // continuously.\n this.#observer = new ResizeObserver(() =>\n this.#resize.schedule(() => this.#measure())\n );\n this.#observer.observe(element);\n\n if (this.#target) {\n this.#observer.observe(this.#target);\n }\n\n // Before the first real measurement, this call is happening during the\n // control's own initial mount -- the same render pass that can be\n // mounting an ancestor overlay's enter transition. Forcing layout here\n // lands at an arbitrary point in `ember-css-transitions`' own\n // reflow-then-swap sequence for that transition, which is enough to make\n // the browser skip it entirely. `ResizeObserver.observe()` above already\n // guarantees an initial, asynchronous notification for `element` (and for\n // the target, if already claimed), so leaving it to that -- deferred\n // through `#resize` like any other resize -- gets the same measurement\n // without the synchronous reflow. Once a first measurement has actually\n // landed, later remounts of this same container are no longer racing\n // anything, so measure immediately as before.\n if (this.#hasMeasuredOnce) {\n this.#measure();\n }\n\n return (): void => {\n this.#shutDown();\n };\n });\n\n /**\n * Claims `element` as the measured target. Exposed alongside `setupTarget`\n * so a consumer composing its own modifier -- a navigation bar that also has\n * to write `aria-current` -- can delegate here rather than reimplement the\n * handover rules below.\n *\n * Measures synchronously once a first measurement has already landed --\n * see `setupContainer` -- so a click that moves the selection updates the\n * indicator immediately rather than a frame later.\n */\n claim(element: HTMLElement): void {\n this.#target = element;\n this.#observer?.observe(element);\n if (this.#hasMeasuredOnce) {\n this.#measure();\n }\n }\n\n /**\n * Releases `element` if it is still the target. When selection moves\n * backwards, the incoming item's setup runs before the outgoing item's\n * teardown, and without this guard that teardown would wipe the new\n * target.\n */\n release(element: HTMLElement): void {\n if (this.#target !== element) {\n return;\n }\n this.#observer?.unobserve(element);\n this.#target = undefined;\n\n // Do not re-measure synchronously. When selection moves forwards the\n // order is reversed -- ember-modifier tears down before re-running\n // setup, and Glimmer revalidates in tree order -- so the outgoing\n // teardown lands first and the incoming target is still moments away\n // in this same render. Measuring now would strip the ready attribute,\n // and the theme gates both opacity and the transition on it, so the\n // indicator would blink out and jump to its new position instead of\n // sliding. Defer instead, and only fall through to the not-ready path\n // if nothing has claimed the target by then.\n this.#scheduleRemeasure();\n }\n\n /**\n * Modifier to place on each candidate target element, passing whether it\n * is currently selected as the sole positional argument. Only the\n * currently-selected target's geometry is measured and published.\n */\n setupTarget = modifier((element: HTMLElement, [isSelected]: [boolean]) => {\n if (isSelected) {\n this.claim(element);\n }\n\n return (): void => {\n this.release(element);\n };\n });\n\n /**\n * Recomputes and republishes the current target's geometry. Called\n * automatically on setup, selection change, and container/target resize;\n * exposed for callers that need to force a recomputation.\n */\n #measure = (): void => {\n const container = this.#container;\n if (!container) {\n return;\n }\n\n const target = this.#target;\n if (!target) {\n this.#markNotReady();\n return;\n }\n\n const width = target.offsetWidth;\n const height = target.offsetHeight;\n\n // A control inside a hidden ancestor -- a closed drawer, an inactive tab\n // panel -- measures zero. Publishing that would collapse the indicator and,\n // worse, mark it ready, so the first real measurement once it is shown\n // would animate in from the container origin. Stay un-ready instead; the\n // ResizeObserver fires when it becomes visible.\n if (width === 0 && height === 0) {\n this.#markNotReady();\n return;\n }\n\n container.style.setProperty('--fr-si-x', `${target.offsetLeft}px`);\n container.style.setProperty('--fr-si-y', `${target.offsetTop}px`);\n container.style.setProperty('--fr-si-width', `${width}px`);\n container.style.setProperty('--fr-si-height', `${height}px`);\n\n this.#hasMeasuredOnce = true;\n\n if (!this.#isReady) {\n this.#isReady = true;\n this.#scheduleReady(container);\n }\n };\n\n /**\n * Everything the container modifier's destructor undoes. The target is not\n * reset here: it belongs to `setupTarget`, whose own destructor clears it.\n */\n #shutDown(): void {\n this.#observer?.disconnect();\n this.#observer = undefined;\n this.#ready.cancel();\n this.#remeasure.cancel();\n this.#resize.cancel();\n this.#container = undefined;\n this.#isReady = false;\n }\n\n #markNotReady(): void {\n this.#ready.cancel();\n this.#isReady = false;\n this.#container?.removeAttribute(READY_ATTRIBUTE);\n }\n\n // The ready flag is set a frame after the first real measurement so the\n // theme can hold transitions off until the indicator is already in place.\n #scheduleReady(container: HTMLElement): void {\n this.#ready.schedule(() => container.setAttribute(READY_ATTRIBUTE, ''));\n }\n\n // Re-measures once the current render has settled, so a target being handed\n // from one element to another is never observed mid-handover.\n #scheduleRemeasure(): void {\n this.#remeasure.schedule(() => {\n // A new target claimed the slot in the meantime and measured itself.\n if (this.#target) {\n return;\n }\n this.#measure();\n }, 'microtask');\n }\n}\n\n/**\n * Creates a selection indicator.\n *\n * Mirrors the shape of `ref` and `toggleState`: the class stays internal and\n * the public surface is this lowercase factory, since this is a utility rather\n * than a component.\n */\nfunction selectionIndicator(): SelectionIndicator {\n return new SelectionIndicator();\n}\n\nexport { selectionIndicator, READY_ATTRIBUTE };\nexport type { SelectionIndicator };\n"],"names":["READY_ATTRIBUTE","SelectionIndicator","deferredWork","setupContainer","modifier","element","ResizeObserver","schedule","observe","claim","release","unobserve","undefined","setupTarget","isSelected","#measure","container","target","width","offsetWidth","height","offsetHeight","style","setProperty","offsetLeft","offsetTop","#shutDown","disconnect","cancel","#markNotReady","removeAttribute","#scheduleReady","setAttribute","#scheduleRemeasure","selectionIndicator"],"mappings":";;;AAGA,MAAMA,eAAe,GAAG;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,CAAC;AACvB,EAAA,UAAU;AACV,EAAA,OAAO;AACP,EAAA,SAAS;AACT,EAAA,MAAM,GAAGC,YAAY,CAAC,2CAA2C,CAAC;AAClE,EAAA,UAAU,GAAGA,YAAY,CAAC,+CAA+C,CAAC;AAC1E,EAAA,OAAO,GAAGA,YAAY,CAAC,4CAA4C,CAAC;EACpE,QAAQ,GAAG,KAAK;;AAEhB;AACA;AACA;AACA;EACA,gBAAgB,GAAG,KAAK;;AAExB;AACF;AACA;AACA;AACA;AACEC,EAAAA,cAAc,GAAGC,QAAQ,CAAEC,OAAoB,IAAK;AAClD,IAAA,IAAI,CAAC,UAAU,GAAGA,OAAO;AACzB;AACA;AACA;AACA;AACA;IACA,IAAI,CAAC,SAAS,GA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A,SAAS2B,kBAAkBA,GAAuB;EAChD,OAAO,IAAIjC,kBAAkB,EAAE;AACjC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-validator.js","sources":["../../src/utils/standard-validator.ts"],"sourcesContent":["import type { StandardSchemaV1 } from '@standard-schema/spec';\n\n/**\n * The issues collection returned by a Standard Schema validation failure.\n */\nexport type Issues = readonly StandardSchemaV1.Issue[];\n\n/**\n * The return type of a validator function.\n * Resolves to the issues (when validation fails) or undefined\n * (when it succeeds).\n */\nexport type ValidatorReturn = Promise<Issues | undefined>;\n\n/**\n * StandardSchemaV1 issues as either a promise or synchronous. If there are\n * no issues, `undefined` is returned.\n */\nexport type CustomValidatorReturn = ValidatorReturn | Issues | undefined;\n\n/**\n * A custom validator function.\n * If there are errors, they are returned by the validator as\n * StandardSchemaV1 issues. If there are no errors, nothing is returned.\n */\nexport type CustomValidatorFn<Input = unknown> = (\n input: Input\n) => CustomValidatorReturn;\n\n/**\n * Extracts the comparable keys from a Standard Schema issue path.\n *\n * Path segments may be plain keys or `{ key }` objects. Keys are coerced to\n * strings so numeric array indexes (including `0`) survive and line up with\n * the dotted field name a consumer writes as `@name` (e.g. `items.0.name`).\n *\n * This is the single source of truth for that format: both\n * `StandardValidator.filterFieldIssues` and the form component's\n * `FormErrors` conversion go through it, so field lookup and error keys\n * cannot disagree.\n *\n * @param path The issue path to extract keys from.\n * @returns The path keys as strings, with null/undefined segments dropped.\n */\nfunction issuePathKeys(path: StandardSchemaV1.Issue['path']): string[] {\n if (!path) return [];\n\n return path\n .map((s) => (typeof s === 'object' && s !== null && 'key' in s ? s.key : s))\n .filter((key) => key !== null && key !== undefined)\n .map((key) => String(key));\n}\n\n/**\n * Builds the dotted field name for a Standard Schema issue, matching the\n * `@name` a consumer gives a field (e.g. `items.0.name`).\n *\n * @param issue The issue to build the field name for.\n * @returns The dotted field name, or an empty string when the issue has no\n * path.\n */\nfunction issuePathToFieldName(issue: StandardSchemaV1.Issue): string {\n return issuePathKeys(issue.path).join('.');\n}\n\n/**\n * Provides convenience methods for validating data using Standard Schema.\n * Also supports custom validator functions that return issues in the\n * Standard Schema format.\n *\n * Most of the time you should use `validateAll` or `validateFieldAll` to\n * validate data. Schema and custom validation are optional arguments\n * to these methods. This is useful because schema and custom validation\n * must both be optional in the form component, which is the primary use\n * case for this class.\n *\n * Note: all methods are static, so you do not need to instantiate\n * this class.\n *\n * @see https://standardschema.dev/\n */\nclass StandardValidator {\n private constructor() {\n throw new Error('StandardValidator is static and cannot be instantiated');\n }\n\n /**\n * Validates data against the provided standard schema.\n * If there are errors, they are returned. Otherwise, nothing is returned.\n * This provides a boolean indication of outcome: if there is a return\n * value, validation failed. Otherwise, validation succeeded.\n * @see https://standardschema.dev/\n *\n * @example\n * const input = …; // your data to validate\n * const schema = …; // your standard schema\n * const issues = await StandardValidator.validate(input, schema);\n *\n * @param input The input to validate.\n * @param schema The standard schema to validate against.\n * @return The issues if validation failed, otherwise undefined.\n */\n static async validate<I, O>(\n input: I,\n schema: StandardSchemaV1<I, O>\n ): ValidatorReturn {\n const result = await schema['~standard'].validate(input);\n return result.issues;\n }\n\n /**\n * Validates a single field within the input data using the provided\n * standard schema. If there are issues related to the specified field,\n * they are returned. Otherwise, nothing is returned.\n *\n * Note: because standard schema does not provide a way to validate\n * individual fields, this method filters the issues returned by the\n * schema validation to find those related to the specified field.\n * @see https://standardschema.dev/\n *\n * @param input The input data to validate.\n * @param fieldName The name of the field to validate.\n * @param schema The standard schema to validate against.\n * @returns The issues related to the specified field if validation failed,\n * otherwise undefined.\n */\n static async validateField<I, O>(\n input: I,\n fieldName: string,\n schema: StandardSchemaV1<I, O>\n ): ValidatorReturn {\n const issues = await StandardValidator.validate(input, schema);\n if (issues) {\n return StandardValidator.filterFieldIssues(issues, fieldName);\n }\n }\n\n /**\n * Validates input using a custom validator function.\n * If there are errors, they are returned by the validator as\n * StandardSchemaV1 issues. If there are no errors, nothing is returned.\n * @see https://standardschema.dev/\n *\n * @param input The input data to validate.\n * @param customValidator The custom validator function to use.\n * @returns The issues if validation failed, otherwise undefined.\n */\n static async validateCustom<I>(\n input: I,\n customValidator: CustomValidatorFn<I>\n ): ValidatorReturn {\n return await customValidator(input);\n }\n\n /**\n * Validates a single field within the input data using a custom validator\n * function. If there are issues related to the specified field, they are\n * returned. Otherwise, nothing is returned.\n *\n * Note: because custom validators may return issues for multiple fields,\n * this method filters the issues returned by the custom validator to find\n * those related to the specified field.\n * @see https://standardschema.dev/\n *\n * @param input The input data to validate.\n * @param fieldName The name of the field to validate.\n * @param customValidator The custom validator function to use.\n * @returns The issues related to the specified field if validation failed,\n * otherwise undefined.\n */\n static async validateFieldCustom<I>(\n input: I,\n fieldName: string,\n customValidator: CustomValidatorFn<I>\n ): ValidatorReturn {\n const issues = await StandardValidator.validateCustom(\n input,\n customValidator\n );\n if (issues) {\n return StandardValidator.filterFieldIssues(issues, fieldName);\n }\n }\n\n /**\n * Validates input data using both a standard schema and a custom validator\n * function, merging any issues found by either method. If there are issues,\n * they are returned. Otherwise, nothing is returned. This method runs both\n * validations in parallel.\n *\n * Note: `schema` and `customValidator` are both optional. If either the\n * schema or custom validator is not provided, that validation is skipped.\n * @see https://standardschema.dev/\n *\n * @param input The input data to validate.\n * @param schema Optional standard schema to validate against.\n * @param customValidator Optional custom validator function to use.\n * @returns issues if validation failed, otherwise undefined.\n */\n static async validateAll<I, O>(\n input: I,\n schema?: StandardSchemaV1<I, O>,\n customValidator?: CustomValidatorFn<I>\n ): ValidatorReturn {\n const standardIssues = schema && StandardValidator.validate(input, schema);\n const customIssues =\n customValidator &&\n StandardValidator.validateCustom(input, customValidator);\n const [s, c] = await Promise.all([standardIssues, customIssues]);\n if (s || c) {\n return [...(s ?? []), ...(c ?? [])];\n }\n }\n\n /**\n * Validates a single field within the input data using both a standard\n * schema and a custom validator function, merging any issues found by\n * either method. If there are issues related to the specified field,\n * they are returned. Otherwise, nothing is returned. This method runs\n * both validations in parallel.\n *\n * Note: `schema` and `customValidator` are both optional. If either the\n * schema or custom validator is not provided, that validation is skipped.\n * @see https://standardschema.dev/\n *\n * @param input The input data to validate.\n * @param fieldName The name of the field to validate.\n * @param schema Optional standard schema to validate against.\n * @param customValidator Optional custom validator function to use.\n * @returns The issues related to the specified field if validation failed,\n * otherwise undefined.\n */\n static async validateFieldAll<I, O>(\n input: I,\n fieldName: string,\n schema?: StandardSchemaV1<I, O>,\n customValidator?: CustomValidatorFn<I>\n ): ValidatorReturn {\n const standardIssues =\n schema && StandardValidator.validateField(input, fieldName, schema);\n const customIssues =\n customValidator &&\n StandardValidator.validateFieldCustom(input, fieldName, customValidator);\n const [s, c] = await Promise.all([standardIssues, customIssues]);\n if (s || c) {\n return [...(s ?? []), ...(c ?? [])];\n }\n }\n\n /**\n * Filters issues to those related to the specified field name.\n * Supports both simple field names and dotted notation for nested fields.\n *\n * @param issues The issues to filter.\n * @param fieldName The name of the field to filter by (e.g., \"email\",\n * \"profile.contact.email\" or \"items.0.name\" for array elements).\n * @returns The issues related to the specified field, or undefined if\n * there are none.\n */\n static filterFieldIssues(\n issues: Issues,\n fieldName: string\n ): Issues | undefined {\n const fieldParts = fieldName.split('.');\n\n const fieldIssues = issues.filter((issue) => {\n if (!issue.path) return false;\n\n const pathKeys = issuePathKeys(issue.path);\n\n // For exact path matching:\n // The paths must be the same length and match exactly\n return (\n pathKeys.length === fieldParts.length &&\n pathKeys.every((key, i) => key === fieldParts[i])\n );\n });\n\n return fieldIssues.length > 0 ? fieldIssues : undefined;\n }\n}\n\nexport { StandardValidator, issuePathKeys, issuePathToFieldName };\nexport default StandardValidator;\n"],"names":["issuePathKeys","path","map","s","key","filter","undefined","String","issuePathToFieldName","issue","join","StandardValidator","constructor","Error","validate","input","schema","result","issues","validateField","fieldName","filterFieldIssues","validateCustom","customValidator","validateFieldCustom","validateAll","standardIssues","customIssues","c","Promise","all","validateFieldAll","fieldParts","split","fieldIssues","pathKeys","length","every","i"],"mappings":"AAEA;AACA;AACA;;AAGA;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ACA,KAAK,CAACR,IAAI,EAAE,OAAO,KAAK;AAE7B,MAAA,MAAMkC,QAAQ,GAAGnC,aAAa,CAACS,KAAK,CAACR,IAAI,CAAC;;AAE1C;AACA;MACA,OACEkC,QAAQ,CAACC,MAAM,KAAKJ,UAAU,CAACI,MAAM,IACrCD,QAAQ,CAACE,KAAK,CAAC,CAACjC,GAAG,EAAEkC,CAAC,KAAKlC,GAAG,KAAK4B,UAAU,CAACM,CAAC,CAAC,CAAC;AAErD,IAAA,CAAC,CAAC;IAEF,OAAOJ,WAAW,CAACE,MAAM,GAAG,CAAC,GAAGF,WAAW,GAAG5B,SAAS;AACzD,EAAA;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"standard-validator.js","sources":["../../src/utils/standard-validator.ts"],"sourcesContent":["import type { StandardSchemaV1 } from '@standard-schema/spec';\n\n/**\n * The issues collection returned by a Standard Schema validation failure.\n */\nexport type Issues = readonly StandardSchemaV1.Issue[];\n\n/**\n * The return type of a validator function.\n * Resolves to the issues (when validation fails) or undefined\n * (when it succeeds).\n */\nexport type ValidatorReturn = Promise<Issues | undefined>;\n\n/**\n * StandardSchemaV1 issues as either a promise or synchronous. If there are\n * no issues, `undefined` is returned.\n */\nexport type CustomValidatorReturn = ValidatorReturn | Issues | undefined;\n\n/**\n * A custom validator function.\n * If there are errors, they are returned by the validator as\n * StandardSchemaV1 issues. If there are no errors, nothing is returned.\n */\nexport type CustomValidatorFn<Input = unknown> = (\n input: Input\n) => CustomValidatorReturn;\n\n/**\n * Extracts the comparable keys from a Standard Schema issue path.\n *\n * Path segments may be plain keys or `{ key }` objects. Keys are coerced to\n * strings so numeric array indexes (including `0`) survive and line up with\n * the dotted field name a consumer writes as `@name` (e.g. `items.0.name`).\n *\n * This is the single source of truth for that format: both\n * `StandardValidator.filterFieldIssues` and the form component's\n * `FormErrors` conversion go through it, so field lookup and error keys\n * cannot disagree.\n *\n * @param path The issue path to extract keys from.\n * @returns The path keys as strings, with null/undefined segments dropped.\n */\nfunction issuePathKeys(path: StandardSchemaV1.Issue['path']): string[] {\n if (!path) return [];\n\n return path\n .map((s) => (typeof s === 'object' && s !== null && 'key' in s ? s.key : s))\n .filter((key) => key !== null && key !== undefined)\n .map((key) => String(key));\n}\n\n/**\n * Builds the dotted field name for a Standard Schema issue, matching the\n * `@name` a consumer gives a field (e.g. `items.0.name`).\n *\n * @param issue The issue to build the field name for.\n * @returns The dotted field name, or an empty string when the issue has no\n * path.\n */\nfunction issuePathToFieldName(issue: StandardSchemaV1.Issue): string {\n return issuePathKeys(issue.path).join('.');\n}\n\n/**\n * Provides convenience methods for validating data using Standard Schema.\n * Also supports custom validator functions that return issues in the\n * Standard Schema format.\n *\n * Most of the time you should use `validateAll` or `validateFieldAll` to\n * validate data. Schema and custom validation are optional arguments\n * to these methods. This is useful because schema and custom validation\n * must both be optional in the form component, which is the primary use\n * case for this class.\n *\n * Note: all methods are static, so you do not need to instantiate\n * this class.\n *\n * @see https://standardschema.dev/\n */\nclass StandardValidator {\n private constructor() {\n throw new Error('StandardValidator is static and cannot be instantiated');\n }\n\n /**\n * Validates data against the provided standard schema.\n * If there are errors, they are returned. Otherwise, nothing is returned.\n * This provides a boolean indication of outcome: if there is a return\n * value, validation failed. Otherwise, validation succeeded.\n * @see https://standardschema.dev/\n *\n * @example\n * const input = …; // your data to validate\n * const schema = …; // your standard schema\n * const issues = await StandardValidator.validate(input, schema);\n *\n * @param input The input to validate.\n * @param schema The standard schema to validate against.\n * @return The issues if validation failed, otherwise undefined.\n */\n static async validate<I, O>(\n input: I,\n schema: StandardSchemaV1<I, O>\n ): ValidatorReturn {\n const result = await schema['~standard'].validate(input);\n return result.issues;\n }\n\n /**\n * Validates a single field within the input data using the provided\n * standard schema. If there are issues related to the specified field,\n * they are returned. Otherwise, nothing is returned.\n *\n * Note: because standard schema does not provide a way to validate\n * individual fields, this method filters the issues returned by the\n * schema validation to find those related to the specified field.\n * @see https://standardschema.dev/\n *\n * @param input The input data to validate.\n * @param fieldName The name of the field to validate.\n * @param schema The standard schema to validate against.\n * @returns The issues related to the specified field if validation failed,\n * otherwise undefined.\n */\n static async validateField<I, O>(\n input: I,\n fieldName: string,\n schema: StandardSchemaV1<I, O>\n ): ValidatorReturn {\n const issues = await StandardValidator.validate(input, schema);\n if (issues) {\n return StandardValidator.filterFieldIssues(issues, fieldName);\n }\n }\n\n /**\n * Validates input using a custom validator function.\n * If there are errors, they are returned by the validator as\n * StandardSchemaV1 issues. If there are no errors, nothing is returned.\n * @see https://standardschema.dev/\n *\n * @param input The input data to validate.\n * @param customValidator The custom validator function to use.\n * @returns The issues if validation failed, otherwise undefined.\n */\n static async validateCustom<I>(\n input: I,\n customValidator: CustomValidatorFn<I>\n ): ValidatorReturn {\n return await customValidator(input);\n }\n\n /**\n * Validates a single field within the input data using a custom validator\n * function. If there are issues related to the specified field, they are\n * returned. Otherwise, nothing is returned.\n *\n * Note: because custom validators may return issues for multiple fields,\n * this method filters the issues returned by the custom validator to find\n * those related to the specified field.\n * @see https://standardschema.dev/\n *\n * @param input The input data to validate.\n * @param fieldName The name of the field to validate.\n * @param customValidator The custom validator function to use.\n * @returns The issues related to the specified field if validation failed,\n * otherwise undefined.\n */\n static async validateFieldCustom<I>(\n input: I,\n fieldName: string,\n customValidator: CustomValidatorFn<I>\n ): ValidatorReturn {\n const issues = await StandardValidator.validateCustom(\n input,\n customValidator\n );\n if (issues) {\n return StandardValidator.filterFieldIssues(issues, fieldName);\n }\n }\n\n /**\n * Validates input data using both a standard schema and a custom validator\n * function, merging any issues found by either method. If there are issues,\n * they are returned. Otherwise, nothing is returned. This method runs both\n * validations in parallel.\n *\n * Note: `schema` and `customValidator` are both optional. If either the\n * schema or custom validator is not provided, that validation is skipped.\n * @see https://standardschema.dev/\n *\n * @param input The input data to validate.\n * @param schema Optional standard schema to validate against.\n * @param customValidator Optional custom validator function to use.\n * @returns issues if validation failed, otherwise undefined.\n */\n static async validateAll<I, O>(\n input: I,\n schema?: StandardSchemaV1<I, O>,\n customValidator?: CustomValidatorFn<I>\n ): ValidatorReturn {\n const standardIssues = schema && StandardValidator.validate(input, schema);\n const customIssues =\n customValidator &&\n StandardValidator.validateCustom(input, customValidator);\n const [s, c] = await Promise.all([standardIssues, customIssues]);\n if (s || c) {\n return [...(s ?? []), ...(c ?? [])];\n }\n }\n\n /**\n * Validates a single field within the input data using both a standard\n * schema and a custom validator function, merging any issues found by\n * either method. If there are issues related to the specified field,\n * they are returned. Otherwise, nothing is returned. This method runs\n * both validations in parallel.\n *\n * Note: `schema` and `customValidator` are both optional. If either the\n * schema or custom validator is not provided, that validation is skipped.\n * @see https://standardschema.dev/\n *\n * @param input The input data to validate.\n * @param fieldName The name of the field to validate.\n * @param schema Optional standard schema to validate against.\n * @param customValidator Optional custom validator function to use.\n * @returns The issues related to the specified field if validation failed,\n * otherwise undefined.\n */\n static async validateFieldAll<I, O>(\n input: I,\n fieldName: string,\n schema?: StandardSchemaV1<I, O>,\n customValidator?: CustomValidatorFn<I>\n ): ValidatorReturn {\n const standardIssues =\n schema && StandardValidator.validateField(input, fieldName, schema);\n const customIssues =\n customValidator &&\n StandardValidator.validateFieldCustom(input, fieldName, customValidator);\n const [s, c] = await Promise.all([standardIssues, customIssues]);\n if (s || c) {\n return [...(s ?? []), ...(c ?? [])];\n }\n }\n\n /**\n * Filters issues to those related to the specified field name.\n * Supports both simple field names and dotted notation for nested fields.\n *\n * @param issues The issues to filter.\n * @param fieldName The name of the field to filter by (e.g., \"email\",\n * \"profile.contact.email\" or \"items.0.name\" for array elements).\n * @returns The issues related to the specified field, or undefined if\n * there are none.\n */\n static filterFieldIssues(\n issues: Issues,\n fieldName: string\n ): Issues | undefined {\n const fieldParts = fieldName.split('.');\n\n const fieldIssues = issues.filter((issue) => {\n if (!issue.path) return false;\n\n const pathKeys = issuePathKeys(issue.path);\n\n // For exact path matching:\n // The paths must be the same length and match exactly\n return (\n pathKeys.length === fieldParts.length &&\n pathKeys.every((key, i) => key === fieldParts[i])\n );\n });\n\n return fieldIssues.length > 0 ? fieldIssues : undefined;\n }\n}\n\nexport { StandardValidator, issuePathKeys, issuePathToFieldName };\nexport default StandardValidator;\n"],"names":["issuePathKeys","path","map","s","key","filter","undefined","String","issuePathToFieldName","issue","join","StandardValidator","constructor","Error","validate","input","schema","result","issues","validateField","fieldName","filterFieldIssues","validateCustom","customValidator","validateFieldCustom","validateAll","standardIssues","customIssues","c","Promise","all","validateFieldAll","fieldParts","split","fieldIssues","pathKeys","length","every","i"],"mappings":"AAEA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,aAAaA,CAACC,IAAoC,EAAY;AACrE,EAAA,IAAI,CAACA,IAAI,EAAE,OAAO,EAAE;EAEpB,OAAOA,IAAI,CACRC,GAAG,CAAEC,CAAC,IAAM,OAAOA,CAAC,KAAK,QAAQ,IAAIA,CAAC,KAAK,IAAI,IAAI,KAAK,IAAIA,CAAC,GAAGA,CAAC,CAACC,GAAG,GAAGD,CAAE,CAAC,CAC3EE,MAAM,CAAED,GAAG,IAAKA,GAAG,KAAK,IAAI,IAAIA,GAAG,KAAKE,SAAS,CAAC,CAClDJ,GAAG,CAAEE,GAAG,IAAKG,MAAM,CAACH,GAAG,CAAC,CAAC;AAC9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASI,oBAAoBA,CAACC,KAA6B,EAAU;EACnE,OAAOT,aAAa,CAACS,KAAK,CAACR,IAAI,CAAC,CAACS,IAAI,CAAC,GAAG,CAAC;AAC5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,CAAC;AACdC,EAAAA,WAAWA,GAAG;AACpB,IAAA,MAAM,IAAIC,KAAK,CAAC,wDAAwD,CAAC;A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C,IAAI,EAAE,CAAC,CAAC;AACrC,IAAA;AACF,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACE,EAAA,OAAOP,iBAAiBA,CACtBH,MAAc,EACdE,SAAiB,EACG;AACpB,IAAA,MAAMY,UAAU,GAAGZ,SAAS,CAACa,KAAK,CAAC,GAAG,CAAC;AAEvC,IAAA,MAAMC,WAAW,GAAGhB,MAAM,CAACb,MAAM,CAAEI,KAAK,IAAK;AAC3C,MAAA,IAAI,CAACA,KAAK,CAACR,IAAI,EAAE,OAAO,KAAK;AAE7B,MAAA,MAAMkC,QAAQ,GAAGnC,aAAa,CAACS,KAAK,CAACR,IAAI,CAAC;;AAE1C;AACA;MACA,OACEkC,QAAQ,CAACC,MAAM,KAAKJ,UAAU,CAACI,MAAM,IACrCD,QAAQ,CAACE,KAAK,CAAC,CAACjC,GAAG,EAAEkC,CAAC,KAAKlC,GAAG,KAAK4B,UAAU,CAACM,CAAC,CAAC,CAAC;AAErD,IAAA,CAAC,CAAC;IAEF,OAAOJ,WAAW,CAACE,MAAM,GAAG,CAAC,GAAGF,WAAW,GAAG5B,SAAS;AACzD,EAAA;AACF;;"}
|
package/dist/utils/toggle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toggle.js","sources":["../../src/utils/toggle.ts"],"sourcesContent":["import { tracked } from '@glimmer/tracking';\nimport type { PressEvent } from '../modifiers/press';\n\nclass ToggleState {\n @tracked current = false;\n #onChange?: (val: boolean) => void;\n\n constructor(initialValue?: boolean, onChange?: (val: boolean) => void) {\n this.#onChange = onChange;\n if (initialValue !== undefined) {\n this.current = initialValue;\n }\n }\n\n toggle = (input?: boolean | Event | PressEvent): void => {\n if (typeof input === 'boolean') {\n this.#set(input);\n return;\n }\n\n // Handle checkbox input\n if (\n input instanceof Event &&\n input.currentTarget &&\n input.currentTarget instanceof HTMLInputElement\n ) {\n this.#set(input.currentTarget.checked);\n return;\n }\n\n this.#set(!this.current);\n };\n\n #set(val: boolean): void {\n this.current = val;\n this.#callback();\n }\n\n #callback() {\n if (this.#onChange) {\n this.#onChange(this.current);\n }\n }\n}\n\nfunction toggleState(\n initialValue?: boolean,\n onChange?: (val: boolean) => void\n): ToggleState {\n return new ToggleState(initialValue, onChange);\n}\n\nexport { toggleState };\n"],"names":["ToggleState","g","prototype","tracked","i","constructor","initialValue","onChange","undefined","current","toggle","input","Event","currentTarget","HTMLInputElement","checked","#set","val","#callback","toggleState"],"mappings":";;;AAGA,MAAMA,WAAW,CAAC;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,SAAA,EAAA,CACfC,OAAO,CAAA,EAAA,YAAA;AAAA,MAAA,OAAW,KAAK;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,QAAA,IAAAC,2BAAA,CAAA,IAAA,EAAA,SAAA,CAAA,EAAA,MAAA;AACxB,EAAA,SAAS;AAETC,EAAAA,WAAWA,CAACC,YAAsB,EAAEC,QAAiC,EAAE;AACrE,IAAA,IAAI,CAAC,SAAS,GAAGA,QAAQ;IACzB,IAAID,YAAY,KAAKE,SAAS,EAAE;MAC9B,IAAI,CAACC,OAAO,GAAGH,YAAY;AAC7B,IAAA;AACF,EAAA;EAEAI,MAAM,GAAIC,KAAoC,IAAW;AACvD,IAAA,IAAI,OAAOA,KAAK,KAAK,SAAS,EAAE;AAC9B,MAAA,IAAI,CAAC,IAAI,CAACA,KAAK,CAAC;AAChB,MAAA;AACF,IAAA;;AAEA;AACA,IAAA,IACEA,KAAK,YAAYC,KAAK,IACtBD,KAAK,CAACE,aAAa,IACnBF,KAAK,CAACE,aAAa,YAAYC,gBAAgB,EAC/C;MACA,IAAI,CAAC,IAAI,CAACH,KAAK,CAACE,aAAa,CAACE,OAAO,CAAC;AACtC,MAAA;AACF,IAAA;IAEA,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAACN,OAAO,CAAC;EAC1B,CAAC;EAED,IAAIO,CAACC,GAAY,EAAQ;IACvB,IAAI,CAACR,OAAO,GAAGQ,GAAG;AAClB,IAAA,IAAI,CAAC,SAAS,EAAE;AAClB,EAAA;EAEA,SAASC,GAAG;AACV,IAAA,IAAI,IAAI,CAAC,SAAS,EAAE;AAClB,MAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAACT,OAAO,CAAC;AAC9B,IAAA;AACF,EAAA;AACF;AAEA,SAASU,WAAWA,CAClBb,YAAsB,EACtBC,QAAiC,EACpB;AACb,EAAA,OAAO,IAAIP,WAAW,CAACM,YAAY,EAAEC,QAAQ,CAAC;AAChD
|
|
1
|
+
{"version":3,"file":"toggle.js","sources":["../../src/utils/toggle.ts"],"sourcesContent":["import { tracked } from '@glimmer/tracking';\nimport type { PressEvent } from '../modifiers/press';\n\nclass ToggleState {\n @tracked current = false;\n #onChange?: (val: boolean) => void;\n\n constructor(initialValue?: boolean, onChange?: (val: boolean) => void) {\n this.#onChange = onChange;\n if (initialValue !== undefined) {\n this.current = initialValue;\n }\n }\n\n toggle = (input?: boolean | Event | PressEvent): void => {\n if (typeof input === 'boolean') {\n this.#set(input);\n return;\n }\n\n // Handle checkbox input\n if (\n input instanceof Event &&\n input.currentTarget &&\n input.currentTarget instanceof HTMLInputElement\n ) {\n this.#set(input.currentTarget.checked);\n return;\n }\n\n this.#set(!this.current);\n };\n\n #set(val: boolean): void {\n this.current = val;\n this.#callback();\n }\n\n #callback() {\n if (this.#onChange) {\n this.#onChange(this.current);\n }\n }\n}\n\nfunction toggleState(\n initialValue?: boolean,\n onChange?: (val: boolean) => void\n): ToggleState {\n return new ToggleState(initialValue, onChange);\n}\n\nexport { toggleState };\n"],"names":["ToggleState","g","prototype","tracked","i","constructor","initialValue","onChange","undefined","current","toggle","input","Event","currentTarget","HTMLInputElement","checked","#set","val","#callback","toggleState"],"mappings":";;;AAGA,MAAMA,WAAW,CAAC;AAAA,EAAA;IAAAC,eAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,SAAA,EAAA,CACf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
|
|
1
1
|
{
|
|
2
2
|
"name": "frontile",
|
|
3
|
-
"version": "0.18.0-beta.
|
|
3
|
+
"version": "0.18.0-beta.4",
|
|
4
4
|
"description": "Component Library for Ember Octane apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"lint:fix": "concurrently 'npm:lint:*:fix' --names 'fix:'",
|
|
83
83
|
"lint:js": "eslint . --cache",
|
|
84
84
|
"lint:js:fix": "eslint . --fix",
|
|
85
|
-
"lint:types": "
|
|
85
|
+
"lint:types": "ember-tsc --noEmit",
|
|
86
86
|
"prepack": "concurrently 'npm:build'",
|
|
87
87
|
"start": "concurrently 'npm:start:*'",
|
|
88
88
|
"start:js": "rollup --config --watch --no-watch.clearScreen",
|
|
@@ -92,45 +92,44 @@
|
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@ember/test-waiters": "^4.1.2",
|
|
94
94
|
"@embroider/addon-shim": "^1.10.3",
|
|
95
|
-
"@embroider/macros": "^1.
|
|
96
|
-
"@floating-ui/dom": "^1.0
|
|
97
|
-
"@frontile/theme": "^0.18.0-beta.
|
|
98
|
-
"@glint/template": "^1.
|
|
95
|
+
"@embroider/macros": "^1.21.1",
|
|
96
|
+
"@floating-ui/dom": "^1.8.0",
|
|
97
|
+
"@frontile/theme": "^0.18.0-beta.4",
|
|
98
|
+
"@glint/template": "^1.9.0",
|
|
99
99
|
"@universal-ember/table": "^4.0.0",
|
|
100
100
|
"date-fns": "^4.4.0",
|
|
101
101
|
"ember-auto-import": "^2.13.1",
|
|
102
|
-
"ember-click-outside": "^6.1.
|
|
103
|
-
"ember-css-transitions": "^4.
|
|
104
|
-
"ember-element-helper": "^0.8.
|
|
102
|
+
"ember-click-outside": "^6.1.1",
|
|
103
|
+
"ember-css-transitions": "^4.5.0",
|
|
104
|
+
"ember-element-helper": "^0.8.8",
|
|
105
105
|
"ember-focus-trap": "^2.0.0",
|
|
106
106
|
"ember-modifier": "^4.3.0",
|
|
107
|
-
"ember-velcro": "^2.
|
|
108
|
-
"focus-
|
|
107
|
+
"ember-velcro": "^2.2.0",
|
|
108
|
+
"focus-trap": "^8.0.0",
|
|
109
|
+
"focus-visible": "^5.2.1",
|
|
109
110
|
"form-data-utils": "^0.6.0",
|
|
110
111
|
"fuzzysort": "^4.0.2"
|
|
111
112
|
},
|
|
112
113
|
"devDependencies": {
|
|
113
114
|
"@babel/core": "7.26.7",
|
|
114
|
-
"@babel/plugin-transform-typescript": "^7.
|
|
115
|
+
"@babel/plugin-transform-typescript": "^7.29.7",
|
|
116
|
+
"@ember/library-tsconfig": "^2.0.0",
|
|
115
117
|
"@ember/test-helpers": "^5.4.3",
|
|
116
|
-
"@embroider/addon-dev": "8.
|
|
118
|
+
"@embroider/addon-dev": "8.4.0",
|
|
117
119
|
"@glimmer/component": "^2.1.1",
|
|
118
120
|
"@glimmer/tracking": "^1.1.2",
|
|
119
|
-
"@glint/
|
|
120
|
-
"@glint/environment-ember-loose": "1.5.2",
|
|
121
|
-
"@glint/environment-ember-template-imports": "1.5.2",
|
|
121
|
+
"@glint/ember-tsc": "^1.11.4",
|
|
122
122
|
"@rollup/plugin-babel": "^7.1.0",
|
|
123
123
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
124
124
|
"@standard-schema/spec": "^1.1.0",
|
|
125
|
-
"
|
|
126
|
-
"
|
|
127
|
-
"concurrently": "^10.0.4",
|
|
125
|
+
"babel-plugin-ember-template-compilation": "^4.0.0",
|
|
126
|
+
"concurrently": "^10.0.5",
|
|
128
127
|
"decorator-transforms": "^2.4.0",
|
|
129
|
-
"ember-source": "^
|
|
130
|
-
"rollup": "^4.
|
|
128
|
+
"ember-source": "^7.3.0",
|
|
129
|
+
"rollup": "^4.63.3",
|
|
131
130
|
"rollup-plugin-copy": "^3.5.0",
|
|
132
|
-
"tailwindcss": "^3.
|
|
133
|
-
"typescript": "^
|
|
131
|
+
"tailwindcss": "^4.3.3",
|
|
132
|
+
"typescript": "^6.0.3"
|
|
134
133
|
},
|
|
135
134
|
"peerDependencies": {
|
|
136
135
|
"@babel/runtime": ">= 7",
|
|
@@ -153,5 +152,5 @@
|
|
|
153
152
|
"./services/notifications.js": "./dist/_app_/services/notifications.js"
|
|
154
153
|
}
|
|
155
154
|
},
|
|
156
|
-
"gitHead": "
|
|
155
|
+
"gitHead": "763c301723206669ce65ab13e212fc07f7acb36c"
|
|
157
156
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { precompileTemplate } from '@ember/template-compilation';
|
|
2
|
-
import { setComponentTemplate } from '@ember/component';
|
|
3
|
-
import templateOnly from '@ember/component/template-only';
|
|
4
|
-
export { ChevronDownIcon } from '../../disclosure/icons.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Icon components used by the calendar's month navigation.
|
|
8
|
-
*
|
|
9
|
-
* These are sized by their button (`[&_svg]:size-4` on the `navButton` slot)
|
|
10
|
-
* rather than carrying a size of their own, so a `@size` variant scales the
|
|
11
|
-
* glyph and its hit area together.
|
|
12
|
-
*/
|
|
13
|
-
// The down chevron already exists as a shared icon; only the left/right
|
|
14
|
-
// pair is new here.
|
|
15
|
-
const ChevronLeftIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.75 19.5 8.25 12l7.5-7.5\" />\n</svg>", {
|
|
16
|
-
strictMode: true
|
|
17
|
-
}), templateOnly());
|
|
18
|
-
const ChevronRightIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m8.25 4.5 7.5 7.5-7.5 7.5\" />\n</svg>", {
|
|
19
|
-
strictMode: true
|
|
20
|
-
}), templateOnly());
|
|
21
|
-
|
|
22
|
-
export { ChevronLeftIcon, ChevronRightIcon };
|
|
23
|
-
//# sourceMappingURL=icons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sources":["../../../../src/components/collections/calendar/icons.gts"],"sourcesContent":["/**\n * Icon components used by the calendar's month navigation.\n *\n * These are sized by their button (`[&_svg]:size-4` on the `navButton` slot)\n * rather than carrying a size of their own, so a `@size` variant scales the\n * glyph and its hit area together.\n */\nimport type { TOC } from '@ember/component/template-only';\n\n// The down chevron already exists as a shared icon; only the left/right\n// pair is new here.\nexport { ChevronDownIcon } from '../../disclosure/icons';\n\ninterface IconSignature {\n Element: SVGElement;\n}\n\nexport const ChevronLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M15.75 19.5 8.25 12l7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m8.25 4.5 7.5 7.5-7.5 7.5\"\n />\n </svg>\n</template>;\n"],"names":["ChevronLeftIcon","setComponentTemplate","precompileTemplate","strictMode","templateOnly","ChevronRightIcon"],"mappings":";;;;;AAAA;;;;;;;AASA;AACA;MAOaA,eAAqB,GAAAC,oBAAA,CAAiBC,kBAAA,CAAA,yQAAA,EAgBnD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGC,gBAAsB,GAAAJ,oBAAA,CAAiBC,kBAAA,CAAA,uQAAA,EAgBpD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { precompileTemplate } from '@ember/template-compilation';
|
|
2
|
-
import { setComponentTemplate } from '@ember/component';
|
|
3
|
-
import templateOnly from '@ember/component/template-only';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Icon components used in the table component
|
|
7
|
-
*/
|
|
8
|
-
const ChevronUpIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m4.5 15.75 7.5-7.5 7.5 7.5\" />\n</svg>", {
|
|
9
|
-
strictMode: true
|
|
10
|
-
}), templateOnly());
|
|
11
|
-
const ChevronDownIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m19.5 8.25-7.5 7.5-7.5-7.5\" />\n</svg>", {
|
|
12
|
-
strictMode: true
|
|
13
|
-
}), templateOnly());
|
|
14
|
-
const ColumnVisibilityIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z\" />\n</svg>", {
|
|
15
|
-
strictMode: true
|
|
16
|
-
}), templateOnly());
|
|
17
|
-
|
|
18
|
-
export { ChevronDownIcon, ChevronUpIcon, ColumnVisibilityIcon };
|
|
19
|
-
//# sourceMappingURL=icons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sources":["../../../../src/components/collections/table/icons.gts"],"sourcesContent":["/**\n * Icon components used in the table component\n */\nimport type { TOC } from '@ember/component/template-only';\n\ninterface IconSignature {\n Element: SVGElement;\n}\n\nexport const ChevronUpIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m4.5 15.75 7.5-7.5 7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDownIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m19.5 8.25-7.5 7.5-7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ColumnVisibilityIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z\"\n />\n </svg>\n</template>;\n"],"names":["ChevronUpIcon","setComponentTemplate","precompileTemplate","strictMode","templateOnly","ChevronDownIcon","ColumnVisibilityIcon"],"mappings":";;;;AAAA;;;MASaA,aAAmB,GAAAC,oBAAA,CAAiBC,kBAAA,CAAA,mPAAA,EAejD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGC,eAAqB,GAAAJ,oBAAA,CAAiBC,kBAAA,CAAA,mPAAA,EAenD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGE,oBAA0B,GAAAL,oBAAA,CAAiBC,kBAAA,CAAA,gYAAA,EAexD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { precompileTemplate } from '@ember/template-compilation';
|
|
2
|
-
import { setComponentTemplate } from '@ember/component';
|
|
3
|
-
import templateOnly from '@ember/component/template-only';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Icon components used in the disclosure components.
|
|
7
|
-
*/
|
|
8
|
-
const ChevronDownIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m19.5 8.25-7.5 7.5-7.5-7.5\" />\n</svg>", {
|
|
9
|
-
strictMode: true
|
|
10
|
-
}), templateOnly());
|
|
11
|
-
|
|
12
|
-
export { ChevronDownIcon };
|
|
13
|
-
//# sourceMappingURL=icons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sources":["../../../src/components/disclosure/icons.gts"],"sourcesContent":["/**\n * Icon components used in the disclosure components.\n */\nimport type { TOC } from '@ember/component/template-only';\n\ninterface IconSignature {\n Element: SVGElement;\n}\n\nexport const ChevronDownIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m19.5 8.25-7.5 7.5-7.5-7.5\"\n />\n </svg>\n</template>;\n"],"names":["ChevronDownIcon","setComponentTemplate","precompileTemplate","strictMode","templateOnly"],"mappings":";;;;AAAA;;;MASaA,eAAqB,GAAAC,oBAAA,CAAiBC,kBAAA,CAAA,wQAAA,EAgBnD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { precompileTemplate } from '@ember/template-compilation';
|
|
2
|
-
import { setComponentTemplate } from '@ember/component';
|
|
3
|
-
import templateOnly from '@ember/component/template-only';
|
|
4
|
-
|
|
5
|
-
const IconChevronUpDown = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9\" />\n</svg>", {
|
|
6
|
-
strictMode: true
|
|
7
|
-
}), templateOnly());
|
|
8
|
-
const IconCalendar = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" aria-hidden=\"true\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0V11.25A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5\" />\n</svg>", {
|
|
9
|
-
strictMode: true
|
|
10
|
-
}), templateOnly());
|
|
11
|
-
var icons = setComponentTemplate(precompileTemplate("@frontile/froms Icons component is empty, use template imports.", {
|
|
12
|
-
strictMode: true
|
|
13
|
-
}), templateOnly());
|
|
14
|
-
|
|
15
|
-
export { IconCalendar, IconChevronUpDown, icons as default };
|
|
16
|
-
//# sourceMappingURL=icons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sources":["../../../src/components/forms/icons.gts"],"sourcesContent":["import type { TOC } from '@ember/component/template-only';\n\nconst IconChevronUpDown: TOC<{\n Element: SVGElement;\n}> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9\"\n />\n </svg>\n</template>;\n\nconst IconCalendar: TOC<{\n Element: SVGElement;\n}> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0V11.25A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5\"\n />\n </svg>\n</template>;\n\nexport { IconChevronUpDown, IconCalendar };\n\n<template>\n @frontile/froms Icons component is empty, use template imports.\n</template>\n"],"names":["IconChevronUpDown","setComponentTemplate","precompileTemplate","strictMode","templateOnly","IconCalendar"],"mappings":";;;;AAEA,MAAMA,iBAED,GAAAC,oBAAA,CAAAC,kBAAA,CAAA,+RAAA,EAgBL;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;AAEV,MAAMC,YAED,GAAAJ,oBAAA,CAAAC,kBAAA,CAAA,gdAAA,EAgBL;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;AAIV,YAAAH,oBAAA,CAAAC,kBAAA,CAAA,iEAAA,EAEA;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA,CAAA;;;;"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { precompileTemplate } from '@ember/template-compilation';
|
|
2
|
-
import { setComponentTemplate } from '@ember/component';
|
|
3
|
-
import templateOnly from '@ember/component/template-only';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Icon components used by the Pagination component. Heroicons outline, 24px
|
|
7
|
-
* grid, `currentColor` stroke — the same source and settings as the table's.
|
|
8
|
-
*/
|
|
9
|
-
const ChevronLeftIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.75 19.5 8.25 12l7.5-7.5\" />\n</svg>", {
|
|
10
|
-
strictMode: true
|
|
11
|
-
}), templateOnly());
|
|
12
|
-
const ChevronRightIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m8.25 4.5 7.5 7.5-7.5 7.5\" />\n</svg>", {
|
|
13
|
-
strictMode: true
|
|
14
|
-
}), templateOnly());
|
|
15
|
-
const ChevronDoubleLeftIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5\" />\n</svg>", {
|
|
16
|
-
strictMode: true
|
|
17
|
-
}), templateOnly());
|
|
18
|
-
const ChevronDoubleRightIcon = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5\" />\n</svg>", {
|
|
19
|
-
strictMode: true
|
|
20
|
-
}), templateOnly());
|
|
21
|
-
|
|
22
|
-
export { ChevronDoubleLeftIcon, ChevronDoubleRightIcon, ChevronLeftIcon, ChevronRightIcon };
|
|
23
|
-
//# sourceMappingURL=icons.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sources":["../../../../src/components/navigation/pagination/icons.gts"],"sourcesContent":["/**\n * Icon components used by the Pagination component. Heroicons outline, 24px\n * grid, `currentColor` stroke — the same source and settings as the table's.\n */\nimport type { TOC } from '@ember/component/template-only';\n\ninterface IconSignature {\n Element: SVGElement;\n}\n\nexport const ChevronLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M15.75 19.5 8.25 12l7.5-7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m8.25 4.5 7.5 7.5-7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDoubleLeftIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5\"\n />\n </svg>\n</template>;\n\nexport const ChevronDoubleRightIcon: TOC<IconSignature> = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5\"\n />\n </svg>\n</template>;\n"],"names":["ChevronLeftIcon","setComponentTemplate","precompileTemplate","strictMode","templateOnly","ChevronRightIcon","ChevronDoubleLeftIcon","ChevronDoubleRightIcon"],"mappings":";;;;AAAA;;;;MAUaA,eAAqB,GAAAC,oBAAA,CAAiBC,kBAAA,CAAA,yQAAA,EAgBnD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGC,gBAAsB,GAAAJ,oBAAA,CAAiBC,kBAAA,CAAA,uQAAA,EAgBpD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGE,qBAA2B,GAAAL,oBAAA,CAAiBC,kBAAA,CAAA,8RAAA,EAgBzD;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;MAEGG,sBAA4B,GAAAN,oBAAA,CAAiBC,kBAAA,CAAA,4RAAA,EAgB1D;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { precompileTemplate } from '@ember/template-compilation';
|
|
2
|
-
import { setComponentTemplate } from '@ember/component';
|
|
3
|
-
import templateOnly from '@ember/component/template-only';
|
|
4
|
-
|
|
5
|
-
const IconInfo = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" data-test-icon=\"info\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M11.25 11.25h.75v4.5h.75M12 8.25h.008v.008H12V8.25ZM21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\" />\n</svg>", {
|
|
6
|
-
strictMode: true
|
|
7
|
-
}), templateOnly());
|
|
8
|
-
const IconSuccess = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" data-test-icon=\"success\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\" />\n</svg>", {
|
|
9
|
-
strictMode: true
|
|
10
|
-
}), templateOnly());
|
|
11
|
-
const IconWarning = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" data-test-icon=\"warning\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z\" />\n</svg>", {
|
|
12
|
-
strictMode: true
|
|
13
|
-
}), templateOnly());
|
|
14
|
-
const IconDanger = setComponentTemplate(precompileTemplate("<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\" aria-hidden=\"true\" data-test-icon=\"danger\" ...attributes>\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\" />\n</svg>", {
|
|
15
|
-
strictMode: true
|
|
16
|
-
}), templateOnly());
|
|
17
|
-
|
|
18
|
-
export { IconDanger as I, IconWarning as a, IconSuccess as b, IconInfo as c };
|
|
19
|
-
//# sourceMappingURL=intent-icons-DpEViO8C.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"intent-icons-DpEViO8C.js","sources":["../src/-private/intent-icons.gts"],"sourcesContent":["import type { TOC } from '@ember/component/template-only';\n\ntype IconSignature = TOC<{ Element: SVGElement }>;\n\nconst IconInfo: IconSignature = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"info\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M11.25 11.25h.75v4.5h.75M12 8.25h.008v.008H12V8.25ZM21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nconst IconSuccess: IconSignature = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"success\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nconst IconWarning: IconSignature = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"warning\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z\"\n />\n </svg>\n</template>;\n\nconst IconDanger: IconSignature = <template>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke-width=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-test-icon=\"danger\"\n ...attributes\n >\n <path\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n d=\"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\"\n />\n </svg>\n</template>;\n\nexport { IconInfo, IconSuccess, IconWarning, IconDanger };\n"],"names":["IconInfo","setComponentTemplate","precompileTemplate","strictMode","templateOnly","IconSuccess","IconWarning","IconDanger"],"mappings":";;;;AAIA,MAAMA,QAAU,GAAAC,oBAAA,CAAgBC,kBAAA,CAAA,8VAAA,EAiBhC;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;AAEV,MAAMC,WAAa,GAAAJ,oBAAA,CAAgBC,kBAAA,CAAA,uUAAA,EAiBnC;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;AAEV,MAAME,WAAa,GAAAL,oBAAA,CAAgBC,kBAAA,CAAA,ybAAA,EAiBnC;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;AAEV,MAAMG,UAAY,GAAAN,oBAAA,CAAgBC,kBAAA,CAAA,6UAAA,EAiBlC;EAAAC,UAAA,EAAA;AAAU,CAAA,CAAA,EAAAC,YAAA,EAAA;;;;"}
|