@serendie/ui 3.2.0 → 3.2.1-dev.202604251106
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/dist/client.js +6 -6
- package/dist/components/Accordion/Accordion.js +18 -21
- package/dist/components/Accordion/AccordionGroup.js +4 -4
- package/dist/components/Avatar/Avatar.js +19 -21
- package/dist/components/Badge/Badge.js +1 -1
- package/dist/components/Banner/Banner.js +4 -4
- package/dist/components/BottomNavigation/BottomNavigation.js +12 -11
- package/dist/components/BottomNavigation/BottomNavigationItem.js +4 -4
- package/dist/components/Button/Button.js +6 -6
- package/dist/components/CheckBox/CheckBox.js +28 -32
- package/dist/components/ChoiceBox/ChoiceBox.js +46 -52
- package/dist/components/DashboardWidget/DashboardWidget.js +4 -4
- package/dist/components/DataTable/DataTableComponent.js +16 -17
- package/dist/components/DataTable/table/BodyCell.js +3 -2
- package/dist/components/DataTable/table/HeaderCell.js +16 -15
- package/dist/components/DataTable/table/Root.js +7 -6
- package/dist/components/DatePicker/DatePicker.js +107 -127
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/Divider/Divider.js +4 -4
- package/dist/components/Drawer/Drawer.js +22 -26
- package/dist/components/DropdownMenu/DropdownMenu.js +36 -41
- package/dist/components/IconButton/IconButton.js +4 -4
- package/dist/components/List/ListItem.js +1 -1
- package/dist/components/ModalDialog/ModalDialog.js +27 -33
- package/dist/components/NotificationBadge/NotificationBadge.js +1 -1
- package/dist/components/Pagination/Pagination.js +54 -59
- package/dist/components/RadioButton/RadioButton.js +32 -36
- package/dist/components/RadioButton/RadioGroup.js +4 -4
- package/dist/components/Search/Search.js +67 -74
- package/dist/components/Select/Select.js +53 -60
- package/dist/components/Switch/Switch.js +18 -22
- package/dist/components/Tabs/TabItem.js +16 -15
- package/dist/components/Tabs/Tabs.js +9 -10
- package/dist/components/TextArea/TextArea.js +4 -4
- package/dist/components/TextField/TextField.js +1 -1
- package/dist/components/Toast/Toast.js +16 -17
- package/dist/components/Tooltip/Tooltip.js +30 -35
- package/dist/components/TopAppBar/TopAppBar.js +4 -4
- package/dist/index.js +6 -6
- package/dist/node_modules/@ark-ui/react/dist/_virtual/_rolldown/runtime.js +11 -0
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-content.js +15 -12
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-indicator.js +11 -8
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-trigger.js +16 -16
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item.js +25 -22
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-root-provider.js +24 -0
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-root.js +21 -12
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion.js +22 -0
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/use-accordion-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/use-accordion-item-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/use-accordion-item-props-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/use-accordion.js +15 -13
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-fallback.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-image.js +11 -8
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root-provider.js +20 -0
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js +21 -11
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/use-avatar-context.js +3 -3
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/use-avatar.js +14 -12
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-context.js +3 -3
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-control.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-group-provider.js +22 -0
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-group.js +32 -0
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js +13 -9
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-indicator.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-label.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root-provider.js +20 -0
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-root.js +19 -13
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox.anatomy.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox.js +24 -0
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-group-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox-group.js +43 -0
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js +16 -14
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-content.js +14 -12
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-root.js +15 -9
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/split-collapsible-props.js +5 -3
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/use-collapsible-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/use-collapsible.js +17 -12
- package/dist/node_modules/@ark-ui/react/dist/components/collection/list-collection.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-clear-trigger.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-control.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-empty.js +15 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-input.js +14 -10
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group-label.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js +20 -11
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-indicator.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-text.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item.js +19 -10
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-label.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-list.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js +11 -8
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root-provider.js +25 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js +24 -14
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox.anatomy.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox.js +42 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox-item-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox-item-group-props-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox-item-props-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox.js +13 -11
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-clear-trigger.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js +14 -7
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js +14 -11
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js +11 -8
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-preset-trigger.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js +14 -11
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-range-text.js +21 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root-provider.js +26 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js +32 -16
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js +16 -13
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js +18 -13
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js +22 -12
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js +11 -8
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-value-text.js +25 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-trigger.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js +16 -16
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-week-number-cell.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-week-number-header-cell.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js +16 -9
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.anatomy.js +3 -3
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.js +64 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-cell-props-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-props-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-view-props-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker.js +16 -14
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js +19 -13
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js +15 -12
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-positioner.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-root-provider.js +24 -0
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-root.js +17 -7
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-title.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-trigger.js +21 -0
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog.js +26 -0
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/use-dialog-context.js +3 -3
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/use-dialog.js +15 -13
- package/dist/node_modules/@ark-ui/react/dist/components/factory.js +21 -22
- package/dist/node_modules/@ark-ui/react/dist/components/field/use-field-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/fieldset/use-fieldset-context.js +11 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-arrow-tip.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-arrow.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-checkbox-item.js +35 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-content.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-context-trigger.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-indicator.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group-label.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js +21 -12
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-indicator.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-text.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item.js +25 -13
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-positioner.js +14 -11
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-radio-item-group.js +28 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-radio-item.js +39 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root-provider.js +31 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +32 -19
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-separator.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-trigger-item.js +21 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-trigger.js +18 -17
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu.js +48 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-item-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-item-group-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-machine-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-option-item-props-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-trigger-item-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu.js +19 -14
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-ellipsis.js +11 -8
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-first-trigger.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-item.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-last-trigger.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-next-trigger.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-prev-trigger.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-root-provider.js +20 -0
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-root.js +20 -12
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination.js +24 -0
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/use-pagination-context.js +4 -4
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/use-pagination.js +15 -13
- package/dist/node_modules/@ark-ui/react/dist/components/portal/portal.js +16 -20
- package/dist/node_modules/@ark-ui/react/dist/components/presence/split-presence-props.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/presence/use-presence-context.js +3 -3
- package/dist/node_modules/@ark-ui/react/dist/components/presence/use-presence.js +13 -12
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-indicator.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-hidden-input.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-text.js +14 -11
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js +26 -13
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-label.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-root-provider.js +20 -0
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-root.js +18 -10
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group.js +26 -0
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/use-radio-group-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/use-radio-group-item-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/use-radio-group-item-props-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/use-radio-group.js +20 -13
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-clear-trigger.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-content.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-control.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-hidden-select.js +23 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-indicator.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-item-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-item-group-label.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-item-group.js +24 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-item-indicator.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-item-text.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-item.js +22 -13
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-label.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-list.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-positioner.js +11 -8
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-root-provider.js +25 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-root.js +25 -14
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-trigger.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-value-text.js +11 -7
- package/dist/node_modules/@ark-ui/react/dist/components/select/select.js +44 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/use-select-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/select/use-select-item-context.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/select/use-select-item-group-props.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/select/use-select-item-props-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/select/use-select.js +12 -10
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-control.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js +13 -9
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-label.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-root-provider.js +20 -0
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-root.js +18 -12
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-thumb.js +10 -7
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch.js +20 -0
- package/dist/node_modules/@ark-ui/react/dist/components/switch/use-switch-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/switch/use-switch.js +13 -11
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tab-content.js +28 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tab-indicator.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tab-list.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tab-trigger.js +14 -11
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root-provider.js +24 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root.js +20 -11
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs.js +20 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/use-tabs-context.js +3 -3
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/use-tabs.js +15 -13
- package/dist/node_modules/@ark-ui/react/dist/components/toast/create-toaster.js +2 -2
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toast-action-trigger.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toast-close-trigger.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toast-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toast-description.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toast-root.js +14 -10
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toast-title.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toast.js +18 -0
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toaster.js +37 -22
- package/dist/node_modules/@ark-ui/react/dist/components/toast/use-toast-context.js +4 -4
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow-tip.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow.js +12 -9
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-content.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-positioner.js +13 -10
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-root-provider.js +20 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-root.js +16 -9
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-trigger.js +12 -8
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip.js +22 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip.js +15 -13
- package/dist/node_modules/@ark-ui/react/dist/providers/environment/use-environment-context.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/providers/locale/use-locale-context.js +5 -2
- package/dist/node_modules/@ark-ui/react/dist/utils/compose-refs.js +7 -10
- package/dist/node_modules/@ark-ui/react/dist/utils/create-context.js +17 -20
- package/dist/node_modules/@ark-ui/react/dist/utils/create-split-props.js +4 -7
- package/dist/node_modules/@ark-ui/react/dist/utils/render-strategy.js +6 -6
- package/dist/node_modules/@ark-ui/react/dist/utils/use-controllable-state.js +8 -0
- package/dist/node_modules/@ark-ui/react/dist/utils/use-effect-once.js +1 -1
- package/dist/node_modules/@ark-ui/react/dist/utils/use-event.js +7 -10
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +294 -289
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +195 -194
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +97 -97
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +60 -62
- package/dist/node_modules/@internationalized/date/dist/GregorianCalendar.js +18 -12
- package/dist/node_modules/@internationalized/date/dist/conversion.js +35 -35
- package/dist/node_modules/@internationalized/date/dist/queries.js +126 -75
- package/dist/node_modules/@internationalized/date/dist/string.js +29 -28
- package/dist/node_modules/@zag-js/accordion/dist/accordion.anatomy.js +6 -0
- package/dist/node_modules/@zag-js/accordion/dist/accordion.connect.js +129 -0
- package/dist/node_modules/@zag-js/accordion/dist/accordion.dom.js +30 -0
- package/dist/node_modules/@zag-js/accordion/dist/accordion.machine.js +137 -0
- package/dist/node_modules/@zag-js/aria-hidden/dist/aria-hidden.js +14 -0
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +12 -49
- package/dist/node_modules/@zag-js/aria-hidden/dist/walk-tree-outside.js +41 -0
- package/dist/node_modules/@zag-js/avatar/dist/avatar.anatomy.js +6 -0
- package/dist/node_modules/@zag-js/avatar/dist/avatar.connect.js +52 -0
- package/dist/node_modules/@zag-js/avatar/dist/avatar.dom.js +17 -0
- package/dist/node_modules/@zag-js/avatar/dist/avatar.machine.js +93 -0
- package/dist/node_modules/@zag-js/checkbox/dist/checkbox.anatomy.js +6 -0
- package/dist/node_modules/@zag-js/checkbox/dist/checkbox.connect.js +108 -0
- package/dist/node_modules/@zag-js/checkbox/dist/checkbox.dom.js +21 -0
- package/dist/node_modules/@zag-js/checkbox/dist/checkbox.machine.js +141 -0
- package/dist/node_modules/@zag-js/collapsible/dist/collapsible.anatomy.js +6 -0
- package/dist/node_modules/@zag-js/collapsible/dist/collapsible.connect.js +80 -0
- package/dist/node_modules/@zag-js/collapsible/dist/collapsible.dom.js +16 -0
- package/dist/node_modules/@zag-js/collapsible/dist/{index.js → collapsible.machine.js} +58 -115
- package/dist/node_modules/@zag-js/collection/dist/chunk-QZ7TP4HQ.js +4 -0
- package/dist/node_modules/@zag-js/collection/dist/{index.js → list-collection.js} +58 -56
- package/dist/node_modules/@zag-js/collection/dist/selection-map.js +58 -0
- package/dist/node_modules/@zag-js/combobox/dist/combobox.anatomy.js +21 -0
- package/dist/node_modules/@zag-js/combobox/dist/combobox.collection.js +6 -0
- package/dist/node_modules/@zag-js/combobox/dist/combobox.connect.js +341 -0
- package/dist/node_modules/@zag-js/combobox/dist/combobox.dom.js +68 -0
- package/dist/node_modules/@zag-js/combobox/dist/combobox.machine.js +936 -0
- package/dist/node_modules/@zag-js/core/dist/create-machine.js +32 -0
- package/dist/node_modules/@zag-js/core/dist/memo.js +11 -0
- package/dist/node_modules/@zag-js/core/dist/merge-props.js +48 -0
- package/dist/node_modules/@zag-js/core/dist/scope.js +19 -0
- package/dist/node_modules/@zag-js/core/dist/state.js +143 -0
- package/dist/node_modules/@zag-js/core/dist/types.js +5 -0
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.anatomy.js +31 -0
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.connect.js +742 -0
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.dom.js +73 -0
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.machine.js +1042 -0
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.parse.js +8 -0
- package/dist/node_modules/@zag-js/date-picker/dist/date-picker.utils.js +155 -0
- package/dist/node_modules/@zag-js/date-utils/dist/align.js +15 -0
- package/dist/node_modules/@zag-js/date-utils/dist/assertion.js +26 -0
- package/dist/node_modules/@zag-js/date-utils/dist/constrain.js +40 -0
- package/dist/node_modules/@zag-js/date-utils/dist/date-month.js +74 -0
- package/dist/node_modules/@zag-js/date-utils/dist/date-year.js +37 -0
- package/dist/node_modules/@zag-js/date-utils/dist/duration.js +13 -0
- package/dist/node_modules/@zag-js/date-utils/dist/format.js +25 -0
- package/dist/node_modules/@zag-js/date-utils/dist/formatter.js +30 -0
- package/dist/node_modules/@zag-js/date-utils/dist/get-era-format.js +8 -0
- package/dist/node_modules/@zag-js/date-utils/dist/mutation.js +9 -0
- package/dist/node_modules/@zag-js/date-utils/dist/pagination.js +95 -0
- package/dist/node_modules/@zag-js/date-utils/dist/parse-date.js +34 -0
- package/dist/node_modules/@zag-js/date-utils/dist/preset.js +41 -0
- package/dist/node_modules/@zag-js/dialog/dist/dialog.anatomy.js +14 -0
- package/dist/node_modules/@zag-js/dialog/dist/dialog.connect.js +104 -0
- package/dist/node_modules/@zag-js/dialog/dist/dialog.dom.js +42 -0
- package/dist/node_modules/@zag-js/dialog/dist/dialog.machine.js +220 -0
- package/dist/node_modules/@zag-js/dismissable/dist/dismissable-layer.js +80 -0
- package/dist/node_modules/@zag-js/dismissable/dist/escape-keydown.js +11 -0
- package/dist/node_modules/@zag-js/dismissable/dist/layer-stack.js +103 -0
- package/dist/node_modules/@zag-js/dismissable/dist/pointer-event-outside.js +37 -0
- package/dist/node_modules/@zag-js/dom-query/dist/caret.js +12 -0
- package/dist/node_modules/@zag-js/dom-query/dist/chunk-QZ7TP4HQ.js +4 -0
- package/dist/node_modules/@zag-js/dom-query/dist/computed-style.js +8 -0
- package/dist/node_modules/@zag-js/dom-query/dist/controller.js +76 -0
- package/dist/node_modules/@zag-js/dom-query/dist/event.js +80 -0
- package/dist/node_modules/@zag-js/dom-query/dist/form.js +70 -0
- package/dist/node_modules/@zag-js/dom-query/dist/initial-focus.js +22 -0
- package/dist/node_modules/@zag-js/dom-query/dist/mutation-observer.js +41 -0
- package/dist/node_modules/@zag-js/dom-query/dist/navigate.js +13 -0
- package/dist/node_modules/@zag-js/dom-query/dist/node.js +87 -0
- package/dist/node_modules/@zag-js/dom-query/dist/overflow.js +27 -0
- package/dist/node_modules/@zag-js/dom-query/dist/platform.js +24 -0
- package/dist/node_modules/@zag-js/dom-query/dist/press.js +61 -0
- package/dist/node_modules/@zag-js/dom-query/dist/query.js +31 -0
- package/dist/node_modules/@zag-js/dom-query/dist/raf.js +51 -0
- package/dist/node_modules/@zag-js/dom-query/dist/resize-observer.js +34 -0
- package/dist/node_modules/@zag-js/dom-query/dist/searchable.js +17 -0
- package/dist/node_modules/@zag-js/dom-query/dist/set.js +29 -0
- package/dist/node_modules/@zag-js/dom-query/dist/shared.js +11 -0
- package/dist/node_modules/@zag-js/dom-query/dist/tabbable.js +110 -0
- package/dist/node_modules/@zag-js/dom-query/dist/text-selection.js +36 -0
- package/dist/node_modules/@zag-js/dom-query/dist/typeahead.js +25 -0
- package/dist/node_modules/@zag-js/dom-query/dist/visually-hidden.js +15 -0
- package/dist/node_modules/@zag-js/dom-query/dist/wait-for.js +42 -0
- package/dist/node_modules/@zag-js/focus-trap/dist/chunk-QZ7TP4HQ.js +4 -0
- package/dist/node_modules/@zag-js/focus-trap/dist/focus-trap.js +335 -0
- package/dist/node_modules/@zag-js/focus-trap/dist/index.js +24 -299
- package/dist/node_modules/@zag-js/focus-visible/dist/index.js +63 -39
- package/dist/node_modules/@zag-js/interact-outside/dist/frame-utils.js +60 -0
- package/dist/node_modules/@zag-js/interact-outside/dist/index.js +97 -131
- package/dist/node_modules/@zag-js/menu/dist/menu.anatomy.js +21 -0
- package/dist/node_modules/@zag-js/menu/dist/menu.connect.js +385 -0
- package/dist/node_modules/@zag-js/menu/dist/menu.dom.js +93 -0
- package/dist/node_modules/@zag-js/menu/dist/menu.machine.js +855 -0
- package/dist/node_modules/@zag-js/menu/dist/menu.utils.js +51 -0
- package/dist/node_modules/@zag-js/pagination/dist/pagination.anatomy.js +14 -0
- package/dist/node_modules/@zag-js/pagination/dist/pagination.connect.js +145 -0
- package/dist/node_modules/@zag-js/pagination/dist/pagination.dom.js +31 -0
- package/dist/node_modules/@zag-js/pagination/dist/pagination.machine.js +132 -0
- package/dist/node_modules/@zag-js/pagination/dist/pagination.utils.js +39 -0
- package/dist/node_modules/@zag-js/popper/dist/get-anchor.js +34 -0
- package/dist/node_modules/@zag-js/popper/dist/get-placement.js +190 -0
- package/dist/node_modules/@zag-js/popper/dist/get-styles.js +47 -0
- package/dist/node_modules/@zag-js/popper/dist/middleware.js +57 -0
- package/dist/node_modules/@zag-js/popper/dist/placement.js +11 -0
- package/dist/node_modules/@zag-js/presence/dist/presence.connect.js +16 -0
- package/dist/node_modules/@zag-js/presence/dist/{index.js → presence.machine.js} +39 -47
- package/dist/node_modules/@zag-js/radio-group/dist/radio-group.anatomy.js +13 -0
- package/dist/node_modules/@zag-js/radio-group/dist/radio-group.connect.js +197 -0
- package/dist/node_modules/@zag-js/radio-group/dist/radio-group.dom.js +57 -0
- package/dist/node_modules/@zag-js/radio-group/dist/radio-group.machine.js +179 -0
- package/dist/node_modules/@zag-js/react/dist/bindable.js +52 -0
- package/dist/node_modules/@zag-js/react/dist/machine.js +208 -0
- package/dist/node_modules/@zag-js/react/dist/normalize-props.js +5 -0
- package/dist/node_modules/@zag-js/react/dist/refs.js +15 -0
- package/dist/node_modules/@zag-js/react/dist/track.js +13 -0
- package/dist/node_modules/@zag-js/react/dist/use-layout-effect.js +5 -0
- package/dist/node_modules/@zag-js/rect-utils/dist/polygon.js +23 -0
- package/dist/node_modules/@zag-js/rect-utils/dist/rect.js +26 -0
- package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +32 -23
- package/dist/node_modules/@zag-js/select/dist/select.anatomy.js +22 -0
- package/dist/node_modules/@zag-js/select/dist/select.collection.js +6 -0
- package/dist/node_modules/@zag-js/select/dist/select.connect.js +372 -0
- package/dist/node_modules/@zag-js/select/dist/select.dom.js +53 -0
- package/dist/node_modules/@zag-js/select/dist/select.machine.js +690 -0
- package/dist/node_modules/@zag-js/switch/dist/switch.anatomy.js +6 -0
- package/dist/node_modules/@zag-js/switch/dist/switch.connect.js +110 -0
- package/dist/node_modules/@zag-js/switch/dist/switch.dom.js +25 -0
- package/dist/node_modules/@zag-js/switch/dist/switch.machine.js +143 -0
- package/dist/node_modules/@zag-js/tabs/dist/tabs.anatomy.js +6 -0
- package/dist/node_modules/@zag-js/tabs/dist/tabs.connect.js +176 -0
- package/dist/node_modules/@zag-js/tabs/dist/tabs.dom.js +47 -0
- package/dist/node_modules/@zag-js/tabs/dist/tabs.machine.js +268 -0
- package/dist/node_modules/@zag-js/toast/dist/index.js +6 -798
- package/dist/node_modules/@zag-js/toast/dist/toast-group.connect.js +54 -0
- package/dist/node_modules/@zag-js/toast/dist/toast-group.machine.js +236 -0
- package/dist/node_modules/@zag-js/toast/dist/toast.anatomy.js +13 -0
- package/dist/node_modules/@zag-js/toast/dist/toast.connect.js +102 -0
- package/dist/node_modules/@zag-js/toast/dist/toast.dom.js +10 -0
- package/dist/node_modules/@zag-js/toast/dist/toast.machine.js +234 -0
- package/dist/node_modules/@zag-js/toast/dist/toast.store.js +134 -0
- package/dist/node_modules/@zag-js/toast/dist/toast.utils.js +122 -0
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.anatomy.js +6 -0
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.connect.js +120 -0
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.dom.js +25 -0
- package/dist/node_modules/@zag-js/tooltip/dist/{index.js → tooltip.machine.js} +109 -188
- package/dist/node_modules/@zag-js/tooltip/dist/tooltip.store.js +9 -0
- package/dist/node_modules/@zag-js/types/dist/prop-types.js +10 -0
- package/dist/node_modules/@zag-js/utils/dist/array.js +39 -0
- package/dist/node_modules/@zag-js/utils/dist/chunk-MXGZDBDQ.js +8 -0
- package/dist/node_modules/@zag-js/utils/dist/equal.js +27 -0
- package/dist/node_modules/@zag-js/utils/dist/functions.js +28 -0
- package/dist/node_modules/@zag-js/utils/dist/guard.js +19 -0
- package/dist/node_modules/@zag-js/utils/dist/number.js +11 -0
- package/dist/node_modules/@zag-js/utils/dist/object.js +13 -0
- package/dist/node_modules/@zag-js/utils/dist/store.js +25 -0
- package/dist/node_modules/@zag-js/utils/dist/timers.js +39 -0
- package/dist/node_modules/@zag-js/utils/dist/warning.js +25 -0
- package/dist/styled-system/css/css.js +1 -1
- package/dist/styled-system/helpers.js +85 -83
- package/dist/styled-system/jsx/is-valid-prop.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +18 -21
- package/styled-system/css/css.js +1 -1
- package/styled-system/helpers.js +3 -0
- package/styled-system/jsx/is-valid-prop.js +1 -1
- package/styled-system/patterns/aspect-ratio.d.ts +0 -1
- package/styled-system/patterns/bleed.d.ts +0 -1
- package/styled-system/patterns/box.d.ts +0 -1
- package/styled-system/patterns/center.d.ts +0 -1
- package/styled-system/patterns/circle.d.ts +0 -1
- package/styled-system/patterns/container.d.ts +0 -1
- package/styled-system/patterns/cq.d.ts +0 -1
- package/styled-system/patterns/divider.d.ts +0 -1
- package/styled-system/patterns/flex.d.ts +0 -1
- package/styled-system/patterns/float.d.ts +0 -1
- package/styled-system/patterns/grid-item.d.ts +0 -1
- package/styled-system/patterns/grid.d.ts +0 -1
- package/styled-system/patterns/hstack.d.ts +0 -1
- package/styled-system/patterns/link-overlay.d.ts +0 -1
- package/styled-system/patterns/spacer.d.ts +0 -1
- package/styled-system/patterns/square.d.ts +0 -1
- package/styled-system/patterns/stack.d.ts +0 -1
- package/styled-system/patterns/visually-hidden.d.ts +0 -1
- package/styled-system/patterns/vstack.d.ts +0 -1
- package/styled-system/patterns/wrap.d.ts +0 -1
- package/styled-system/themes/theme-asagi.json +1 -1
- package/styled-system/themes/theme-konjo-dark.json +1 -1
- package/styled-system/themes/theme-kurikawa.json +1 -1
- package/styled-system/themes/theme-sumire.json +1 -1
- package/styled-system/themes/theme-tsutsuji.json +1 -1
- package/styled-system/tokens/tokens.d.ts +1 -1
- package/styled-system/types/conditions.d.ts +11 -11
- package/styled-system/types/prop-type.d.ts +2 -0
- package/styled-system/types/style-props.d.ts +3 -4
- package/dist/node_modules/@zag-js/accordion/dist/index.js +0 -290
- package/dist/node_modules/@zag-js/avatar/dist/index.js +0 -154
- package/dist/node_modules/@zag-js/checkbox/dist/index.js +0 -270
- package/dist/node_modules/@zag-js/combobox/dist/index.js +0 -1415
- package/dist/node_modules/@zag-js/core/dist/index.js +0 -92
- package/dist/node_modules/@zag-js/date-picker/dist/index.js +0 -1826
- package/dist/node_modules/@zag-js/date-utils/dist/index.js +0 -366
- package/dist/node_modules/@zag-js/dialog/dist/index.js +0 -324
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +0 -188
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +0 -633
- package/dist/node_modules/@zag-js/menu/dist/index.js +0 -1235
- package/dist/node_modules/@zag-js/pagination/dist/index.js +0 -273
- package/dist/node_modules/@zag-js/popper/dist/index.js +0 -260
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +0 -407
- package/dist/node_modules/@zag-js/react/dist/index.js +0 -269
- package/dist/node_modules/@zag-js/rect-utils/dist/index.js +0 -46
- package/dist/node_modules/@zag-js/select/dist/index.js +0 -1088
- package/dist/node_modules/@zag-js/switch/dist/index.js +0 -275
- package/dist/node_modules/@zag-js/tabs/dist/index.js +0 -475
- package/dist/node_modules/@zag-js/types/dist/index.js +0 -12
- package/dist/node_modules/@zag-js/utils/dist/index.js +0 -173
- /package/dist/node_modules/@zag-js/anatomy/dist/{index.js → create-anatomy.js} +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { isHTMLElement as h, isElementVisible as T, isInputElement as v, isEditableElement as w } from "./node.js";
|
|
2
|
+
var y = (t) => h(t) && t.tagName === "IFRAME", N = /^(audio|video|details)$/;
|
|
3
|
+
function A(t) {
|
|
4
|
+
const s = t.getAttribute("tabindex");
|
|
5
|
+
return s ? parseInt(s, 10) : NaN;
|
|
6
|
+
}
|
|
7
|
+
var S = (t) => !Number.isNaN(A(t)), R = (t) => A(t) < 0;
|
|
8
|
+
function D(t) {
|
|
9
|
+
return v(t) && t.type === "radio";
|
|
10
|
+
}
|
|
11
|
+
function B(t) {
|
|
12
|
+
if (!D(t) || !t.name || t.checked) return !0;
|
|
13
|
+
const s = `input[type="radio"][name="${CSS.escape(t.name)}"]`, o = t.form ?? t.ownerDocument, e = Array.from(o.querySelectorAll(s)).filter(
|
|
14
|
+
(i) => i.form === t.form && d(i)
|
|
15
|
+
), r = e.find((i) => i.checked);
|
|
16
|
+
return r ? r === t : e[0] === t;
|
|
17
|
+
}
|
|
18
|
+
function F(t, s) {
|
|
19
|
+
if (!s) return null;
|
|
20
|
+
if (s === !0)
|
|
21
|
+
return t.shadowRoot || null;
|
|
22
|
+
const o = s(t);
|
|
23
|
+
return (o === !0 ? t.shadowRoot : o) || null;
|
|
24
|
+
}
|
|
25
|
+
function x(t, s, o) {
|
|
26
|
+
const e = [...t], r = [...t], i = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map();
|
|
27
|
+
t.forEach((a, b) => n.set(a, b));
|
|
28
|
+
let u = 0;
|
|
29
|
+
for (; u < r.length; ) {
|
|
30
|
+
const a = r[u++];
|
|
31
|
+
if (!a || i.has(a)) continue;
|
|
32
|
+
i.add(a);
|
|
33
|
+
const b = F(a, s);
|
|
34
|
+
if (b) {
|
|
35
|
+
const l = Array.from(b.querySelectorAll(m)).filter(o), E = n.get(a);
|
|
36
|
+
if (E !== void 0) {
|
|
37
|
+
const f = E + 1;
|
|
38
|
+
e.splice(f, 0, ...l), l.forEach((c, p) => {
|
|
39
|
+
n.set(c, f + p);
|
|
40
|
+
});
|
|
41
|
+
for (let c = f + l.length; c < e.length; c++)
|
|
42
|
+
n.set(e[c], c);
|
|
43
|
+
} else {
|
|
44
|
+
const f = e.length;
|
|
45
|
+
e.push(...l), l.forEach((c, p) => {
|
|
46
|
+
n.set(c, f + p);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
r.push(...l);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return e;
|
|
53
|
+
}
|
|
54
|
+
var m = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type", M = (t, s = {}) => {
|
|
55
|
+
if (!t) return [];
|
|
56
|
+
const { includeContainer: o = !1, getShadowRoot: e } = s, r = Array.from(t.querySelectorAll(m));
|
|
57
|
+
(o == !0 || o == "if-empty" && r.length === 0) && h(t) && d(t) && r.unshift(t);
|
|
58
|
+
const n = [];
|
|
59
|
+
for (const u of r)
|
|
60
|
+
if (d(u)) {
|
|
61
|
+
if (y(u) && u.contentDocument) {
|
|
62
|
+
const a = u.contentDocument.body;
|
|
63
|
+
n.push(...M(a, { getShadowRoot: e }));
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
n.push(u);
|
|
67
|
+
}
|
|
68
|
+
return e ? x(n, e, d) : n;
|
|
69
|
+
};
|
|
70
|
+
function d(t) {
|
|
71
|
+
return !h(t) || t.closest("[inert]") ? !1 : t.matches(m) && T(t);
|
|
72
|
+
}
|
|
73
|
+
function I(t, s = {}) {
|
|
74
|
+
if (!t) return [];
|
|
75
|
+
const { includeContainer: o, getShadowRoot: e } = s, r = Array.from(t.querySelectorAll(m));
|
|
76
|
+
o && g(t) && r.unshift(t);
|
|
77
|
+
const i = [];
|
|
78
|
+
for (const n of r)
|
|
79
|
+
if (g(n)) {
|
|
80
|
+
if (y(n) && n.contentDocument) {
|
|
81
|
+
const u = n.contentDocument.body;
|
|
82
|
+
i.push(...I(u, { getShadowRoot: e }));
|
|
83
|
+
continue;
|
|
84
|
+
}
|
|
85
|
+
i.push(n);
|
|
86
|
+
}
|
|
87
|
+
if (e) {
|
|
88
|
+
const n = x(i, e, g);
|
|
89
|
+
return !n.length && o ? r : n;
|
|
90
|
+
}
|
|
91
|
+
return !i.length && o ? r : i;
|
|
92
|
+
}
|
|
93
|
+
function g(t) {
|
|
94
|
+
return h(t) && t.tabIndex > 0 ? !0 : !d(t) || R(t) ? !1 : B(t);
|
|
95
|
+
}
|
|
96
|
+
function L(t, s = {}) {
|
|
97
|
+
const o = I(t, s), e = o[0] || null, r = o[o.length - 1] || null;
|
|
98
|
+
return [e, r];
|
|
99
|
+
}
|
|
100
|
+
function k(t) {
|
|
101
|
+
return t.tabIndex < 0 && (N.test(t.localName) || w(t)) && !S(t) ? 0 : t.tabIndex;
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
M as getFocusables,
|
|
105
|
+
k as getTabIndex,
|
|
106
|
+
L as getTabbableEdges,
|
|
107
|
+
I as getTabbables,
|
|
108
|
+
d as isFocusable,
|
|
109
|
+
g as isTabbable
|
|
110
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { isIos as d } from "./platform.js";
|
|
2
|
+
import { raf as a, nextTick as f } from "./raf.js";
|
|
3
|
+
var n = "default", u = "", i = /* @__PURE__ */ new WeakMap();
|
|
4
|
+
function m(r = {}) {
|
|
5
|
+
const { target: e, doc: t } = r, c = t ?? document, o = c.documentElement;
|
|
6
|
+
return d() ? (n === "default" && (u = o.style.webkitUserSelect, o.style.webkitUserSelect = "none"), n = "disabled") : e && (i.set(e, e.style.userSelect), e.style.userSelect = "none"), () => S({ target: e, doc: c });
|
|
7
|
+
}
|
|
8
|
+
function S(r = {}) {
|
|
9
|
+
const { target: e, doc: t } = r, o = (t ?? document).documentElement;
|
|
10
|
+
if (d()) {
|
|
11
|
+
if (n !== "disabled") return;
|
|
12
|
+
n = "restoring", setTimeout(() => {
|
|
13
|
+
f(() => {
|
|
14
|
+
n === "restoring" && (o.style.webkitUserSelect === "none" && (o.style.webkitUserSelect = u || ""), u = "", n = "default");
|
|
15
|
+
});
|
|
16
|
+
}, 300);
|
|
17
|
+
} else if (e && i.has(e)) {
|
|
18
|
+
const l = i.get(e);
|
|
19
|
+
e.style.userSelect === "none" && (e.style.userSelect = l ?? ""), e.getAttribute("style") === "" && e.removeAttribute("style"), i.delete(e);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function b(r = {}) {
|
|
23
|
+
const { defer: e, target: t, ...c } = r, o = e ? a : (s) => s(), l = [];
|
|
24
|
+
return l.push(
|
|
25
|
+
o(() => {
|
|
26
|
+
const s = typeof t == "function" ? t() : t;
|
|
27
|
+
l.push(m({ ...c, target: s }));
|
|
28
|
+
})
|
|
29
|
+
), () => {
|
|
30
|
+
l.forEach((s) => s == null ? void 0 : s());
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
b as disableTextSelection,
|
|
35
|
+
S as restoreTextSelection
|
|
36
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getByText as l } from "./searchable.js";
|
|
2
|
+
function f(t, o) {
|
|
3
|
+
const { state: i, activeId: s, key: c, timeout: y = 350, itemToId: m } = o, e = i.keysSoFar + c, u = e.length > 1 && Array.from(e).every((a) => a === e[0]) ? e[0] : e;
|
|
4
|
+
let d = t.slice();
|
|
5
|
+
const p = l(d, u, s, m);
|
|
6
|
+
function r() {
|
|
7
|
+
clearTimeout(i.timer), i.timer = -1;
|
|
8
|
+
}
|
|
9
|
+
function n(a) {
|
|
10
|
+
i.keysSoFar = a, r(), a !== "" && (i.timer = +setTimeout(() => {
|
|
11
|
+
n(""), r();
|
|
12
|
+
}, y));
|
|
13
|
+
}
|
|
14
|
+
return n(e), p;
|
|
15
|
+
}
|
|
16
|
+
var k = /* @__PURE__ */ Object.assign(f, {
|
|
17
|
+
defaultOptions: { keysSoFar: "", timer: -1 },
|
|
18
|
+
isValidEvent: T
|
|
19
|
+
});
|
|
20
|
+
function T(t) {
|
|
21
|
+
return t.key.length === 1 && !t.ctrlKey && !t.metaKey;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
k as getByTypeahead
|
|
25
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var e = {
|
|
2
|
+
border: "0",
|
|
3
|
+
clip: "rect(0 0 0 0)",
|
|
4
|
+
height: "1px",
|
|
5
|
+
margin: "-1px",
|
|
6
|
+
overflow: "hidden",
|
|
7
|
+
padding: "0",
|
|
8
|
+
position: "absolute",
|
|
9
|
+
width: "1px",
|
|
10
|
+
whiteSpace: "nowrap",
|
|
11
|
+
wordWrap: "normal"
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
e as visuallyHiddenStyle
|
|
15
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { getWindow as u, getDocument as b } from "./node.js";
|
|
2
|
+
function w(n, i, s) {
|
|
3
|
+
const { signal: o } = i;
|
|
4
|
+
return [new Promise((a, e) => {
|
|
5
|
+
const t = setTimeout(() => {
|
|
6
|
+
e(new Error(`Timeout of ${s}ms exceeded`));
|
|
7
|
+
}, s);
|
|
8
|
+
o.addEventListener("abort", () => {
|
|
9
|
+
clearTimeout(t), e(new DOMException("Promise aborted", "AbortError"));
|
|
10
|
+
}), n.then((r) => {
|
|
11
|
+
o.aborted || (clearTimeout(t), a(r));
|
|
12
|
+
}).catch((r) => {
|
|
13
|
+
o.aborted || (clearTimeout(t), e(r));
|
|
14
|
+
});
|
|
15
|
+
}), () => i.abort()];
|
|
16
|
+
}
|
|
17
|
+
function f(n, i) {
|
|
18
|
+
const { timeout: s, rootNode: o } = i, c = u(o), m = b(o), a = new c.AbortController();
|
|
19
|
+
return w(
|
|
20
|
+
new Promise((e) => {
|
|
21
|
+
const t = n();
|
|
22
|
+
if (t) {
|
|
23
|
+
e(t);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const r = new c.MutationObserver(() => {
|
|
27
|
+
const d = n();
|
|
28
|
+
d && d.isConnected && (r.disconnect(), e(d));
|
|
29
|
+
});
|
|
30
|
+
r.observe(m.body, {
|
|
31
|
+
childList: !0,
|
|
32
|
+
subtree: !0
|
|
33
|
+
});
|
|
34
|
+
}),
|
|
35
|
+
a,
|
|
36
|
+
s
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
f as waitForElement,
|
|
41
|
+
w as waitForPromise
|
|
42
|
+
};
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { __publicField as l } from "./chunk-QZ7TP4HQ.js";
|
|
2
|
+
import { getDocument as E, getActiveElement as m, isDocument as O } from "../../dom-query/dist/node.js";
|
|
3
|
+
import { getControlledElements as I, isControlledElement as k, hasControllerElements as D, isControlledByExpandedController as R } from "../../dom-query/dist/controller.js";
|
|
4
|
+
import { getTabbables as G, getFocusables as P, getTabIndex as g, isTabbable as v, isFocusable as y } from "../../dom-query/dist/tabbable.js";
|
|
5
|
+
import { addDomEvent as p, getEventTarget as F } from "../../dom-query/dist/event.js";
|
|
6
|
+
var w = {
|
|
7
|
+
activateTrap(e, o) {
|
|
8
|
+
if (e.length > 0) {
|
|
9
|
+
const t = e[e.length - 1];
|
|
10
|
+
t !== o && t.pause();
|
|
11
|
+
}
|
|
12
|
+
const c = e.indexOf(o);
|
|
13
|
+
c === -1 || e.splice(c, 1), e.push(o);
|
|
14
|
+
},
|
|
15
|
+
deactivateTrap(e, o) {
|
|
16
|
+
const c = e.indexOf(o);
|
|
17
|
+
c !== -1 && e.splice(c, 1), e.length > 0 && e[e.length - 1].unpause();
|
|
18
|
+
}
|
|
19
|
+
}, B = [], q = class {
|
|
20
|
+
constructor(e, o) {
|
|
21
|
+
l(this, "trapStack"), l(this, "config"), l(this, "doc"), l(this, "state", {
|
|
22
|
+
containers: [],
|
|
23
|
+
containerGroups: [],
|
|
24
|
+
tabbableGroups: [],
|
|
25
|
+
nodeFocusedBeforeActivation: null,
|
|
26
|
+
mostRecentlyFocusedNode: null,
|
|
27
|
+
active: !1,
|
|
28
|
+
paused: !1,
|
|
29
|
+
delayInitialFocusTimer: void 0,
|
|
30
|
+
recentNavEvent: void 0
|
|
31
|
+
}), l(this, "portalContainers", /* @__PURE__ */ new Set()), l(this, "listenerCleanups", []), l(this, "handleFocus", (t) => {
|
|
32
|
+
const s = F(t), r = this.findContainerIndex(s, t) >= 0;
|
|
33
|
+
if (r || O(s))
|
|
34
|
+
r && (this.state.mostRecentlyFocusedNode = s);
|
|
35
|
+
else {
|
|
36
|
+
t.stopImmediatePropagation();
|
|
37
|
+
let a, n = !0;
|
|
38
|
+
if (this.state.mostRecentlyFocusedNode)
|
|
39
|
+
if (g(this.state.mostRecentlyFocusedNode) > 0) {
|
|
40
|
+
const h = this.findContainerIndex(this.state.mostRecentlyFocusedNode), { tabbableNodes: i } = this.state.containerGroups[h];
|
|
41
|
+
if (i.length > 0) {
|
|
42
|
+
const d = i.findIndex((u) => u === this.state.mostRecentlyFocusedNode);
|
|
43
|
+
d >= 0 && (this.config.isKeyForward(this.state.recentNavEvent) ? d + 1 < i.length && (a = i[d + 1], n = !1) : d - 1 >= 0 && (a = i[d - 1], n = !1));
|
|
44
|
+
}
|
|
45
|
+
} else
|
|
46
|
+
this.state.containerGroups.some((h) => h.tabbableNodes.some((i) => g(i) > 0)) || (n = !1);
|
|
47
|
+
else
|
|
48
|
+
n = !1;
|
|
49
|
+
n && (a = this.findNextNavNode({
|
|
50
|
+
// move FROM the MRU node, not event-related node (which will be the node that is
|
|
51
|
+
// outside the trap causing the focus escape we're trying to fix)
|
|
52
|
+
target: this.state.mostRecentlyFocusedNode,
|
|
53
|
+
isBackward: this.config.isKeyBackward(this.state.recentNavEvent)
|
|
54
|
+
})), a ? this.tryFocus(a) : this.tryFocus(this.state.mostRecentlyFocusedNode || this.getInitialFocusNode());
|
|
55
|
+
}
|
|
56
|
+
this.state.recentNavEvent = void 0;
|
|
57
|
+
}), l(this, "handlePointerDown", (t) => {
|
|
58
|
+
const s = F(t);
|
|
59
|
+
if (!(this.findContainerIndex(s, t) >= 0)) {
|
|
60
|
+
if (N(this.config.clickOutsideDeactivates, t)) {
|
|
61
|
+
this.deactivate({ returnFocus: this.config.returnFocusOnDeactivate });
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
N(this.config.allowOutsideClick, t) || t.preventDefault();
|
|
65
|
+
}
|
|
66
|
+
}), l(this, "handleClick", (t) => {
|
|
67
|
+
const s = F(t);
|
|
68
|
+
this.findContainerIndex(s, t) >= 0 || N(this.config.clickOutsideDeactivates, t) || N(this.config.allowOutsideClick, t) || (t.preventDefault(), t.stopImmediatePropagation());
|
|
69
|
+
}), l(this, "handleTabKey", (t) => {
|
|
70
|
+
if (this.config.isKeyForward(t) || this.config.isKeyBackward(t)) {
|
|
71
|
+
this.state.recentNavEvent = t;
|
|
72
|
+
const s = this.config.isKeyBackward(t), r = this.findNextNavNode({ event: t, isBackward: s });
|
|
73
|
+
if (!r) return;
|
|
74
|
+
T(t) && t.preventDefault(), this.tryFocus(r);
|
|
75
|
+
}
|
|
76
|
+
}), l(this, "handleEscapeKey", (t) => {
|
|
77
|
+
L(t) && N(this.config.escapeDeactivates, t) !== !1 && (t.preventDefault(), this.deactivate());
|
|
78
|
+
}), l(this, "_mutationObserver"), l(this, "setupMutationObserver", () => {
|
|
79
|
+
const t = this.doc.defaultView || window;
|
|
80
|
+
this._mutationObserver = new t.MutationObserver((s) => {
|
|
81
|
+
s.some((n) => Array.from(n.removedNodes).some((i) => i === this.state.mostRecentlyFocusedNode)) && this.tryFocus(this.getInitialFocusNode()), s.some((n) => n.type === "attributes" && (n.attributeName === "aria-controls" || n.attributeName === "aria-expanded") ? !0 : n.type === "childList" && n.addedNodes.length > 0 ? Array.from(n.addedNodes).some((h) => {
|
|
82
|
+
if (h.nodeType !== Node.ELEMENT_NODE) return !1;
|
|
83
|
+
const i = h;
|
|
84
|
+
return D(i) ? !0 : i.id && !this.state.containers.some((d) => d.contains(i)) ? R(i) : !1;
|
|
85
|
+
}) : !1) && this.state.active && !this.state.paused && (this.updateTabbableNodes(), this.updatePortalContainers());
|
|
86
|
+
});
|
|
87
|
+
}), l(this, "updateObservedNodes", () => {
|
|
88
|
+
var t;
|
|
89
|
+
(t = this._mutationObserver) == null || t.disconnect(), this.state.active && !this.state.paused && (this.state.containers.map((s) => {
|
|
90
|
+
var r;
|
|
91
|
+
(r = this._mutationObserver) == null || r.observe(s, {
|
|
92
|
+
subtree: !0,
|
|
93
|
+
childList: !0,
|
|
94
|
+
attributes: !0,
|
|
95
|
+
attributeFilter: ["aria-controls", "aria-expanded"]
|
|
96
|
+
});
|
|
97
|
+
}), this.portalContainers.forEach((s) => {
|
|
98
|
+
this.observePortalContainer(s);
|
|
99
|
+
}));
|
|
100
|
+
}), l(this, "getInitialFocusNode", () => {
|
|
101
|
+
let t = this.getNodeForOption("initialFocus", { hasFallback: !0 });
|
|
102
|
+
if (t === !1)
|
|
103
|
+
return !1;
|
|
104
|
+
if (t === void 0 || t && !y(t)) {
|
|
105
|
+
const s = m(this.doc);
|
|
106
|
+
if (s && this.findContainerIndex(s) >= 0)
|
|
107
|
+
t = s;
|
|
108
|
+
else {
|
|
109
|
+
const r = this.state.tabbableGroups[0];
|
|
110
|
+
t = r && r.firstTabbableNode || this.getNodeForOption("fallbackFocus");
|
|
111
|
+
}
|
|
112
|
+
} else t === null && (t = this.getNodeForOption("fallbackFocus"));
|
|
113
|
+
if (!t)
|
|
114
|
+
throw new Error("Your focus-trap needs to have at least one focusable element");
|
|
115
|
+
if (t.isConnected || (t = this.getNodeForOption("fallbackFocus")), !t || !t.isConnected)
|
|
116
|
+
throw new Error("Your focus-trap needs to have at least one focusable element");
|
|
117
|
+
return t;
|
|
118
|
+
}), l(this, "tryFocus", (t) => {
|
|
119
|
+
if (t !== !1 && t !== m(this.doc)) {
|
|
120
|
+
if (!t || !t.focus) {
|
|
121
|
+
this.tryFocus(this.getInitialFocusNode());
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
t.focus({ preventScroll: !!this.config.preventScroll }), this.state.mostRecentlyFocusedNode = t, _(t) && t.select();
|
|
125
|
+
}
|
|
126
|
+
}), l(this, "deactivate", (t) => {
|
|
127
|
+
if (!this.state.active) return this;
|
|
128
|
+
const s = {
|
|
129
|
+
onDeactivate: this.config.onDeactivate,
|
|
130
|
+
onPostDeactivate: this.config.onPostDeactivate,
|
|
131
|
+
checkCanReturnFocus: this.config.checkCanReturnFocus,
|
|
132
|
+
...t
|
|
133
|
+
};
|
|
134
|
+
clearTimeout(this.state.delayInitialFocusTimer), this.state.delayInitialFocusTimer = void 0, this.removeListeners(), this.state.active = !1, this.state.paused = !1, this.updateObservedNodes(), w.deactivateTrap(this.trapStack, this), this.portalContainers.clear();
|
|
135
|
+
const r = this.getOption(s, "onDeactivate"), a = this.getOption(s, "onPostDeactivate"), n = this.getOption(s, "checkCanReturnFocus"), h = this.getOption(s, "returnFocus", "returnFocusOnDeactivate");
|
|
136
|
+
r == null || r();
|
|
137
|
+
const i = () => {
|
|
138
|
+
x(() => {
|
|
139
|
+
if (h) {
|
|
140
|
+
const d = this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);
|
|
141
|
+
this.tryFocus(d);
|
|
142
|
+
}
|
|
143
|
+
a == null || a();
|
|
144
|
+
});
|
|
145
|
+
};
|
|
146
|
+
if (h && n) {
|
|
147
|
+
const d = this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);
|
|
148
|
+
return n(d).then(i, i), this;
|
|
149
|
+
}
|
|
150
|
+
return i(), this;
|
|
151
|
+
}), l(this, "pause", (t) => {
|
|
152
|
+
if (this.state.paused || !this.state.active)
|
|
153
|
+
return this;
|
|
154
|
+
const s = this.getOption(t, "onPause"), r = this.getOption(t, "onPostPause");
|
|
155
|
+
return this.state.paused = !0, s == null || s(), this.removeListeners(), this.updateObservedNodes(), r == null || r(), this;
|
|
156
|
+
}), l(this, "unpause", (t) => {
|
|
157
|
+
if (!this.state.paused || !this.state.active)
|
|
158
|
+
return this;
|
|
159
|
+
const s = this.getOption(t, "onUnpause"), r = this.getOption(t, "onPostUnpause");
|
|
160
|
+
return this.state.paused = !1, s == null || s(), this.updateTabbableNodes(), this.addListeners(), this.updateObservedNodes(), r == null || r(), this;
|
|
161
|
+
}), l(this, "updateContainerElements", (t) => (this.state.containers = Array.isArray(t) ? t.filter(Boolean) : [t].filter(Boolean), this.state.active && this.updateTabbableNodes(), this.updateObservedNodes(), this)), l(this, "getReturnFocusNode", (t) => {
|
|
162
|
+
const s = this.getNodeForOption("setReturnFocus", {
|
|
163
|
+
params: [t]
|
|
164
|
+
});
|
|
165
|
+
return s || (s === !1 ? !1 : t);
|
|
166
|
+
}), l(this, "getOption", (t, s, r) => t && t[s] !== void 0 ? t[s] : (
|
|
167
|
+
// @ts-expect-error
|
|
168
|
+
this.config[r || s]
|
|
169
|
+
)), l(this, "getNodeForOption", (t, { hasFallback: s = !1, params: r = [] } = {}) => {
|
|
170
|
+
let a = this.config[t];
|
|
171
|
+
if (typeof a == "function" && (a = a(...r)), a === !0 && (a = void 0), !a) {
|
|
172
|
+
if (a === void 0 || a === !1)
|
|
173
|
+
return a;
|
|
174
|
+
throw new Error(`\`${t}\` was specified but was not a node, or did not return a node`);
|
|
175
|
+
}
|
|
176
|
+
let n = a;
|
|
177
|
+
if (typeof a == "string") {
|
|
178
|
+
try {
|
|
179
|
+
n = this.doc.querySelector(a);
|
|
180
|
+
} catch (h) {
|
|
181
|
+
throw new Error(`\`${t}\` appears to be an invalid selector; error="${h.message}"`);
|
|
182
|
+
}
|
|
183
|
+
if (!n && !s)
|
|
184
|
+
throw new Error(`\`${t}\` as selector refers to no known node`);
|
|
185
|
+
}
|
|
186
|
+
return n;
|
|
187
|
+
}), l(this, "findNextNavNode", (t) => {
|
|
188
|
+
const { event: s, isBackward: r = !1 } = t, a = t.target || F(s);
|
|
189
|
+
this.updateTabbableNodes();
|
|
190
|
+
let n = null;
|
|
191
|
+
if (this.state.tabbableGroups.length > 0) {
|
|
192
|
+
const h = this.findContainerIndex(a, s), i = h >= 0 ? this.state.containerGroups[h] : void 0;
|
|
193
|
+
if (h < 0)
|
|
194
|
+
r ? n = this.state.tabbableGroups[this.state.tabbableGroups.length - 1].lastTabbableNode : n = this.state.tabbableGroups[0].firstTabbableNode;
|
|
195
|
+
else if (r) {
|
|
196
|
+
let d = this.state.tabbableGroups.findIndex(
|
|
197
|
+
({ firstTabbableNode: u }) => a === u
|
|
198
|
+
);
|
|
199
|
+
if (d < 0 && ((i == null ? void 0 : i.container) === a || y(a) && !v(a) && !(i != null && i.nextTabbableNode(a, !1))) && (d = h), d >= 0) {
|
|
200
|
+
const u = d === 0 ? this.state.tabbableGroups.length - 1 : d - 1, f = this.state.tabbableGroups[u];
|
|
201
|
+
n = g(a) >= 0 ? f.lastTabbableNode : f.lastDomTabbableNode;
|
|
202
|
+
} else T(s) || (n = i == null ? void 0 : i.nextTabbableNode(a, !1));
|
|
203
|
+
} else {
|
|
204
|
+
let d = this.state.tabbableGroups.findIndex(
|
|
205
|
+
({ lastTabbableNode: u }) => a === u
|
|
206
|
+
);
|
|
207
|
+
if (d < 0 && ((i == null ? void 0 : i.container) === a || y(a) && !v(a) && !(i != null && i.nextTabbableNode(a))) && (d = h), d >= 0) {
|
|
208
|
+
const u = d === this.state.tabbableGroups.length - 1 ? 0 : d + 1, f = this.state.tabbableGroups[u];
|
|
209
|
+
n = g(a) >= 0 ? f.firstTabbableNode : f.firstDomTabbableNode;
|
|
210
|
+
} else T(s) || (n = i == null ? void 0 : i.nextTabbableNode(a));
|
|
211
|
+
}
|
|
212
|
+
} else
|
|
213
|
+
n = this.getNodeForOption("fallbackFocus");
|
|
214
|
+
return n;
|
|
215
|
+
}), this.trapStack = o.trapStack || B;
|
|
216
|
+
const c = {
|
|
217
|
+
returnFocusOnDeactivate: !0,
|
|
218
|
+
escapeDeactivates: !0,
|
|
219
|
+
delayInitialFocus: !0,
|
|
220
|
+
followControlledElements: !0,
|
|
221
|
+
isKeyForward: K,
|
|
222
|
+
isKeyBackward: A,
|
|
223
|
+
...o
|
|
224
|
+
};
|
|
225
|
+
this.doc = c.document || E(Array.isArray(e) ? e[0] : e), this.config = c, this.updateContainerElements(e), this.setupMutationObserver();
|
|
226
|
+
}
|
|
227
|
+
addPortalContainer(e) {
|
|
228
|
+
const o = e.parentElement;
|
|
229
|
+
o && !this.portalContainers.has(o) && (this.portalContainers.add(o), this.state.active && !this.state.paused && this.observePortalContainer(o));
|
|
230
|
+
}
|
|
231
|
+
observePortalContainer(e) {
|
|
232
|
+
var o;
|
|
233
|
+
(o = this._mutationObserver) == null || o.observe(e, {
|
|
234
|
+
subtree: !0,
|
|
235
|
+
childList: !0,
|
|
236
|
+
attributes: !0,
|
|
237
|
+
attributeFilter: ["aria-controls", "aria-expanded"]
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
updatePortalContainers() {
|
|
241
|
+
this.config.followControlledElements && this.state.containers.forEach((e) => {
|
|
242
|
+
I(e).forEach((c) => {
|
|
243
|
+
this.addPortalContainer(c);
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
get active() {
|
|
248
|
+
return this.state.active;
|
|
249
|
+
}
|
|
250
|
+
get paused() {
|
|
251
|
+
return this.state.paused;
|
|
252
|
+
}
|
|
253
|
+
findContainerIndex(e, o) {
|
|
254
|
+
const c = typeof (o == null ? void 0 : o.composedPath) == "function" ? o.composedPath() : void 0;
|
|
255
|
+
return this.state.containerGroups.findIndex(
|
|
256
|
+
({ container: t, tabbableNodes: s }) => t.contains(e) || (c == null ? void 0 : c.includes(t)) || s.find((r) => r === e) || this.isControlledElement(t, e)
|
|
257
|
+
);
|
|
258
|
+
}
|
|
259
|
+
isControlledElement(e, o) {
|
|
260
|
+
return this.config.followControlledElements ? k(e, o) : !1;
|
|
261
|
+
}
|
|
262
|
+
updateTabbableNodes() {
|
|
263
|
+
if (this.state.containerGroups = this.state.containers.map((e) => {
|
|
264
|
+
const o = G(e, { getShadowRoot: this.config.getShadowRoot }), c = P(e, { getShadowRoot: this.config.getShadowRoot }), t = o[0], s = o[o.length - 1], r = t, a = s;
|
|
265
|
+
let n = !1;
|
|
266
|
+
for (let i = 0; i < o.length; i++)
|
|
267
|
+
if (g(o[i]) > 0) {
|
|
268
|
+
n = !0;
|
|
269
|
+
break;
|
|
270
|
+
}
|
|
271
|
+
function h(i, d = !0) {
|
|
272
|
+
const u = o.indexOf(i);
|
|
273
|
+
if (u >= 0)
|
|
274
|
+
return o[u + (d ? 1 : -1)];
|
|
275
|
+
const f = c.indexOf(i);
|
|
276
|
+
if (!(f < 0)) {
|
|
277
|
+
if (d) {
|
|
278
|
+
for (let b = f + 1; b < c.length; b++)
|
|
279
|
+
if (v(c[b])) return c[b];
|
|
280
|
+
} else
|
|
281
|
+
for (let b = f - 1; b >= 0; b--)
|
|
282
|
+
if (v(c[b])) return c[b];
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return {
|
|
286
|
+
container: e,
|
|
287
|
+
tabbableNodes: o,
|
|
288
|
+
focusableNodes: c,
|
|
289
|
+
posTabIndexesFound: n,
|
|
290
|
+
firstTabbableNode: t,
|
|
291
|
+
lastTabbableNode: s,
|
|
292
|
+
firstDomTabbableNode: r,
|
|
293
|
+
lastDomTabbableNode: a,
|
|
294
|
+
nextTabbableNode: h
|
|
295
|
+
};
|
|
296
|
+
}), this.state.tabbableGroups = this.state.containerGroups.filter((e) => e.tabbableNodes.length > 0), this.state.tabbableGroups.length <= 0 && !this.getNodeForOption("fallbackFocus"))
|
|
297
|
+
throw new Error(
|
|
298
|
+
"Your focus-trap must have at least one container with at least one tabbable node in it at all times"
|
|
299
|
+
);
|
|
300
|
+
if (this.state.containerGroups.find((e) => e.posTabIndexesFound) && this.state.containerGroups.length > 1)
|
|
301
|
+
throw new Error(
|
|
302
|
+
"At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps."
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
addListeners() {
|
|
306
|
+
if (this.state.active)
|
|
307
|
+
return w.activateTrap(this.trapStack, this), this.state.delayInitialFocusTimer = this.config.delayInitialFocus ? x(() => {
|
|
308
|
+
this.tryFocus(this.getInitialFocusNode());
|
|
309
|
+
}) : this.tryFocus(this.getInitialFocusNode()), this.listenerCleanups.push(
|
|
310
|
+
p(this.doc, "focusin", this.handleFocus, !0),
|
|
311
|
+
p(this.doc, "mousedown", this.handlePointerDown, { capture: !0, passive: !1 }),
|
|
312
|
+
p(this.doc, "touchstart", this.handlePointerDown, { capture: !0, passive: !1 }),
|
|
313
|
+
p(this.doc, "click", this.handleClick, { capture: !0, passive: !1 }),
|
|
314
|
+
p(this.doc, "keydown", this.handleTabKey, { capture: !0, passive: !1 }),
|
|
315
|
+
p(this.doc, "keydown", this.handleEscapeKey)
|
|
316
|
+
), this;
|
|
317
|
+
}
|
|
318
|
+
removeListeners() {
|
|
319
|
+
if (this.state.active)
|
|
320
|
+
return this.listenerCleanups.forEach((e) => e()), this.listenerCleanups = [], this;
|
|
321
|
+
}
|
|
322
|
+
activate(e) {
|
|
323
|
+
if (this.state.active)
|
|
324
|
+
return this;
|
|
325
|
+
const o = this.getOption(e, "onActivate"), c = this.getOption(e, "onPostActivate"), t = this.getOption(e, "checkCanFocusTrap");
|
|
326
|
+
t || this.updateTabbableNodes(), this.state.active = !0, this.state.paused = !1, this.state.nodeFocusedBeforeActivation = m(this.doc), o == null || o();
|
|
327
|
+
const s = () => {
|
|
328
|
+
t && this.updateTabbableNodes(), this.addListeners(), this.updateObservedNodes(), c == null || c();
|
|
329
|
+
};
|
|
330
|
+
return t ? (t(this.state.containers.concat()).then(s, s), this) : (s(), this);
|
|
331
|
+
}
|
|
332
|
+
}, C = (e) => (e == null ? void 0 : e.type) === "keydown", T = (e) => C(e) && (e == null ? void 0 : e.key) === "Tab", K = (e) => C(e) && e.key === "Tab" && !(e != null && e.shiftKey), A = (e) => C(e) && e.key === "Tab" && (e == null ? void 0 : e.shiftKey), N = (e, ...o) => typeof e == "function" ? e(...o) : e, L = (e) => !e.isComposing && e.key === "Escape", x = (e) => setTimeout(e, 0), _ = (e) => e.localName === "input" && "select" in e && typeof e.select == "function";
|
|
333
|
+
export {
|
|
334
|
+
q as FocusTrap
|
|
335
|
+
};
|