@serendie/ui 3.2.0 → 3.2.1-dev.202604210459
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/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/HeaderCell.js +4 -4
- package/dist/components/DataTable/table/Root.js +4 -4
- 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 +6 -6
- 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,104 @@
|
|
|
1
|
+
import { dataAttr as y } from "../../dom-query/dist/shared.js";
|
|
2
|
+
import { parts as n } from "./dialog.anatomy.js";
|
|
3
|
+
import { getCloseTriggerId as v, getDescriptionId as u, getTitleId as b, getContentId as m, getPositionerId as I, getBackdropId as C, getTriggerId as h } from "./dialog.dom.js";
|
|
4
|
+
import { compact as P } from "../../utils/dist/object.js";
|
|
5
|
+
function V(T, i) {
|
|
6
|
+
const { state: p, send: a, context: l, prop: t, scope: r } = T, c = t("aria-label"), o = p.matches("open"), g = l.get("triggerValue");
|
|
7
|
+
return {
|
|
8
|
+
open: o,
|
|
9
|
+
setOpen(e) {
|
|
10
|
+
p.matches("open") !== e && a({ type: e ? "OPEN" : "CLOSE" });
|
|
11
|
+
},
|
|
12
|
+
triggerValue: g,
|
|
13
|
+
setTriggerValue(e) {
|
|
14
|
+
a({ type: "TRIGGER_VALUE.SET", value: e });
|
|
15
|
+
},
|
|
16
|
+
getTriggerProps(e = {}) {
|
|
17
|
+
const { value: d } = e, s = d == null ? !1 : g === d;
|
|
18
|
+
return i.button({
|
|
19
|
+
...n.trigger.attrs,
|
|
20
|
+
dir: t("dir"),
|
|
21
|
+
id: h(r, d),
|
|
22
|
+
"data-ownedby": r.id,
|
|
23
|
+
"data-value": d,
|
|
24
|
+
"aria-haspopup": "dialog",
|
|
25
|
+
type: "button",
|
|
26
|
+
"aria-expanded": d == null ? o : o && s,
|
|
27
|
+
"data-state": o ? "open" : "closed",
|
|
28
|
+
"aria-controls": m(r),
|
|
29
|
+
"data-current": y(s),
|
|
30
|
+
onClick(E) {
|
|
31
|
+
if (E.defaultPrevented) return;
|
|
32
|
+
const f = o && d != null && !s;
|
|
33
|
+
a({ type: f ? "TRIGGER_VALUE.SET" : "TOGGLE", value: d });
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
getBackdropProps() {
|
|
38
|
+
return i.element({
|
|
39
|
+
...n.backdrop.attrs,
|
|
40
|
+
dir: t("dir"),
|
|
41
|
+
hidden: !o,
|
|
42
|
+
id: C(r),
|
|
43
|
+
"data-state": o ? "open" : "closed"
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
getPositionerProps() {
|
|
47
|
+
return i.element({
|
|
48
|
+
...n.positioner.attrs,
|
|
49
|
+
dir: t("dir"),
|
|
50
|
+
id: I(r),
|
|
51
|
+
style: P({
|
|
52
|
+
pointerEvents: !o || !t("modal") ? "none" : void 0
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
getContentProps() {
|
|
57
|
+
const e = l.get("rendered");
|
|
58
|
+
return i.element({
|
|
59
|
+
...n.content.attrs,
|
|
60
|
+
dir: t("dir"),
|
|
61
|
+
role: t("role"),
|
|
62
|
+
hidden: !o,
|
|
63
|
+
id: m(r),
|
|
64
|
+
tabIndex: -1,
|
|
65
|
+
"data-state": o ? "open" : "closed",
|
|
66
|
+
"aria-modal": t("modal"),
|
|
67
|
+
"aria-label": c || void 0,
|
|
68
|
+
"aria-labelledby": c || !e.title ? void 0 : b(r),
|
|
69
|
+
"aria-describedby": e.description ? u(r) : void 0,
|
|
70
|
+
style: P({
|
|
71
|
+
pointerEvents: t("modal") ? void 0 : "auto"
|
|
72
|
+
})
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
getTitleProps() {
|
|
76
|
+
return i.element({
|
|
77
|
+
...n.title.attrs,
|
|
78
|
+
dir: t("dir"),
|
|
79
|
+
id: b(r)
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
getDescriptionProps() {
|
|
83
|
+
return i.element({
|
|
84
|
+
...n.description.attrs,
|
|
85
|
+
dir: t("dir"),
|
|
86
|
+
id: u(r)
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
getCloseTriggerProps() {
|
|
90
|
+
return i.button({
|
|
91
|
+
...n.closeTrigger.attrs,
|
|
92
|
+
dir: t("dir"),
|
|
93
|
+
id: v(r),
|
|
94
|
+
type: "button",
|
|
95
|
+
onClick(e) {
|
|
96
|
+
e.defaultPrevented || (e.stopPropagation(), a({ type: "CLOSE" }));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
V as connect
|
|
104
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { queryAll as d } from "../../dom-query/dist/query.js";
|
|
2
|
+
import { isFunction as t } from "../../utils/dist/guard.js";
|
|
3
|
+
var o = (i) => {
|
|
4
|
+
var r;
|
|
5
|
+
return ((r = i.ids) == null ? void 0 : r.positioner) ?? `dialog:${i.id}:positioner`;
|
|
6
|
+
}, a = (i) => {
|
|
7
|
+
var r;
|
|
8
|
+
return ((r = i.ids) == null ? void 0 : r.backdrop) ?? `dialog:${i.id}:backdrop`;
|
|
9
|
+
}, l = (i) => {
|
|
10
|
+
var r;
|
|
11
|
+
return ((r = i.ids) == null ? void 0 : r.content) ?? `dialog:${i.id}:content`;
|
|
12
|
+
}, n = (i, r) => {
|
|
13
|
+
var g;
|
|
14
|
+
const e = (g = i.ids) == null ? void 0 : g.trigger;
|
|
15
|
+
return e != null ? t(e) ? e(r) : e : r ? `dialog:${i.id}:trigger:${r}` : `dialog:${i.id}:trigger`;
|
|
16
|
+
}, s = (i) => {
|
|
17
|
+
var r;
|
|
18
|
+
return ((r = i.ids) == null ? void 0 : r.title) ?? `dialog:${i.id}:title`;
|
|
19
|
+
}, p = (i) => {
|
|
20
|
+
var r;
|
|
21
|
+
return ((r = i.ids) == null ? void 0 : r.description) ?? `dialog:${i.id}:description`;
|
|
22
|
+
}, I = (i) => {
|
|
23
|
+
var r;
|
|
24
|
+
return ((r = i.ids) == null ? void 0 : r.closeTrigger) ?? `dialog:${i.id}:close`;
|
|
25
|
+
}, B = (i) => i.getById(l(i)), E = (i) => i.getById(o(i)), T = (i) => i.getById(a(i)), m = (i) => i.getById(s(i)), u = (i) => i.getById(p(i)), k = (i) => i.getById(I(i)), v = (i) => d(i.getDoc(), `[data-scope="dialog"][data-part="trigger"][data-ownedby="${i.id}"]`), C = (i, r) => r == null ? v(i)[0] : i.getById(n(i, r));
|
|
26
|
+
export {
|
|
27
|
+
C as getActiveTriggerEl,
|
|
28
|
+
T as getBackdropEl,
|
|
29
|
+
a as getBackdropId,
|
|
30
|
+
k as getCloseTriggerEl,
|
|
31
|
+
I as getCloseTriggerId,
|
|
32
|
+
B as getContentEl,
|
|
33
|
+
l as getContentId,
|
|
34
|
+
u as getDescriptionEl,
|
|
35
|
+
p as getDescriptionId,
|
|
36
|
+
E as getPositionerEl,
|
|
37
|
+
o as getPositionerId,
|
|
38
|
+
m as getTitleEl,
|
|
39
|
+
s as getTitleId,
|
|
40
|
+
v as getTriggerEls,
|
|
41
|
+
n as getTriggerId
|
|
42
|
+
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { ariaHidden as O } from "../../aria-hidden/dist/index.js";
|
|
2
|
+
import { trapFocus as m } from "../../focus-trap/dist/index.js";
|
|
3
|
+
import { preventBodyScroll as f } from "../../remove-scroll/dist/index.js";
|
|
4
|
+
import { getContentEl as l, getPositionerEl as p, getBackdropEl as C, getDescriptionEl as v, getTitleEl as T, getTriggerEls as d, getActiveTriggerEl as E, getCloseTriggerEl as V } from "./dialog.dom.js";
|
|
5
|
+
import { createMachine as y } from "../../core/dist/create-machine.js";
|
|
6
|
+
import { raf as s } from "../../dom-query/dist/raf.js";
|
|
7
|
+
import { getComputedStyle as F } from "../../dom-query/dist/computed-style.js";
|
|
8
|
+
import { getInitialFocus as D } from "../../dom-query/dist/initial-focus.js";
|
|
9
|
+
import { trackDismissableElement as k } from "../../dismissable/dist/dismissable-layer.js";
|
|
10
|
+
var N = y({
|
|
11
|
+
props({ props: e, scope: t }) {
|
|
12
|
+
const n = e.role === "alertdialog", i = n ? () => V(t) : void 0, r = typeof e.modal == "boolean" ? e.modal : !0;
|
|
13
|
+
return {
|
|
14
|
+
role: "dialog",
|
|
15
|
+
modal: r,
|
|
16
|
+
trapFocus: r,
|
|
17
|
+
preventScroll: r,
|
|
18
|
+
closeOnInteractOutside: r && !n,
|
|
19
|
+
closeOnEscape: !0,
|
|
20
|
+
restoreFocus: !0,
|
|
21
|
+
initialFocusEl: i,
|
|
22
|
+
...e
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
initialState({ prop: e }) {
|
|
26
|
+
return e("open") || e("defaultOpen") ? "open" : "closed";
|
|
27
|
+
},
|
|
28
|
+
context({ bindable: e, prop: t, scope: n }) {
|
|
29
|
+
return {
|
|
30
|
+
rendered: e(() => ({
|
|
31
|
+
defaultValue: { title: !0, description: !0 }
|
|
32
|
+
})),
|
|
33
|
+
triggerValue: e(() => ({
|
|
34
|
+
defaultValue: t("defaultTriggerValue") ?? null,
|
|
35
|
+
value: t("triggerValue"),
|
|
36
|
+
onChange(i) {
|
|
37
|
+
const r = t("onTriggerValueChange");
|
|
38
|
+
if (!r) return;
|
|
39
|
+
const o = E(n, i);
|
|
40
|
+
r({ value: i, triggerElement: o });
|
|
41
|
+
}
|
|
42
|
+
}))
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
watch({ track: e, action: t, prop: n }) {
|
|
46
|
+
e([() => n("open")], () => {
|
|
47
|
+
t(["toggleVisibility"]);
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
states: {
|
|
51
|
+
open: {
|
|
52
|
+
entry: ["checkRenderedElements", "syncZIndex", "setInitialFocus"],
|
|
53
|
+
effects: ["trackDismissableElement", "trapFocus", "preventScroll", "hideContentBelow"],
|
|
54
|
+
on: {
|
|
55
|
+
"CONTROLLED.CLOSE": {
|
|
56
|
+
target: "closed"
|
|
57
|
+
},
|
|
58
|
+
CLOSE: [
|
|
59
|
+
{
|
|
60
|
+
guard: "isOpenControlled",
|
|
61
|
+
actions: ["invokeOnClose"]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
target: "closed",
|
|
65
|
+
actions: ["invokeOnClose"]
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
TOGGLE: [
|
|
69
|
+
{
|
|
70
|
+
guard: "isOpenControlled",
|
|
71
|
+
actions: ["invokeOnClose"]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
target: "closed",
|
|
75
|
+
actions: ["invokeOnClose"]
|
|
76
|
+
}
|
|
77
|
+
],
|
|
78
|
+
"TRIGGER_VALUE.SET": {
|
|
79
|
+
actions: ["setTriggerValue"]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
closed: {
|
|
84
|
+
on: {
|
|
85
|
+
"CONTROLLED.OPEN": {
|
|
86
|
+
target: "open"
|
|
87
|
+
},
|
|
88
|
+
OPEN: [
|
|
89
|
+
{
|
|
90
|
+
guard: "isOpenControlled",
|
|
91
|
+
actions: ["invokeOnOpen", "setTriggerValue"]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
target: "open",
|
|
95
|
+
actions: ["invokeOnOpen", "setTriggerValue"]
|
|
96
|
+
}
|
|
97
|
+
],
|
|
98
|
+
TOGGLE: [
|
|
99
|
+
{
|
|
100
|
+
guard: "isOpenControlled",
|
|
101
|
+
actions: ["invokeOnOpen", "setTriggerValue"]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
target: "open",
|
|
105
|
+
actions: ["invokeOnOpen", "setTriggerValue"]
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"TRIGGER_VALUE.SET": {
|
|
109
|
+
actions: ["setTriggerValue"]
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
implementations: {
|
|
115
|
+
guards: {
|
|
116
|
+
isOpenControlled: ({ prop: e }) => e("open") != null
|
|
117
|
+
},
|
|
118
|
+
effects: {
|
|
119
|
+
trackDismissableElement({ scope: e, send: t, prop: n }) {
|
|
120
|
+
return k(() => l(e), {
|
|
121
|
+
type: "dialog",
|
|
122
|
+
defer: !0,
|
|
123
|
+
pointerBlocking: n("modal"),
|
|
124
|
+
exclude: d(e),
|
|
125
|
+
onInteractOutside(r) {
|
|
126
|
+
var o;
|
|
127
|
+
(o = n("onInteractOutside")) == null || o(r), n("closeOnInteractOutside") || r.preventDefault();
|
|
128
|
+
},
|
|
129
|
+
persistentElements: n("persistentElements"),
|
|
130
|
+
onFocusOutside: n("onFocusOutside"),
|
|
131
|
+
onPointerDownOutside: n("onPointerDownOutside"),
|
|
132
|
+
onRequestDismiss: n("onRequestDismiss"),
|
|
133
|
+
onEscapeKeyDown(r) {
|
|
134
|
+
var o;
|
|
135
|
+
(o = n("onEscapeKeyDown")) == null || o(r), n("closeOnEscape") || r.preventDefault();
|
|
136
|
+
},
|
|
137
|
+
onDismiss() {
|
|
138
|
+
t({ type: "CLOSE", src: "interact-outside" });
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
preventScroll({ scope: e, prop: t }) {
|
|
143
|
+
if (t("preventScroll"))
|
|
144
|
+
return f(e.getDoc());
|
|
145
|
+
},
|
|
146
|
+
trapFocus({ scope: e, prop: t, context: n }) {
|
|
147
|
+
return t("trapFocus") ? m(() => l(e), {
|
|
148
|
+
preventScroll: !0,
|
|
149
|
+
returnFocusOnDeactivate: !!t("restoreFocus"),
|
|
150
|
+
initialFocus: t("initialFocusEl"),
|
|
151
|
+
setReturnFocus: (r) => {
|
|
152
|
+
var u;
|
|
153
|
+
const o = (u = t("finalFocusEl")) == null ? void 0 : u();
|
|
154
|
+
if (o) return o;
|
|
155
|
+
const a = n.get("triggerValue");
|
|
156
|
+
if (a) {
|
|
157
|
+
const g = E(e, a);
|
|
158
|
+
if (g) return g;
|
|
159
|
+
}
|
|
160
|
+
const c = d(e)[0];
|
|
161
|
+
return c || r;
|
|
162
|
+
},
|
|
163
|
+
getShadowRoot: !0
|
|
164
|
+
}) : void 0;
|
|
165
|
+
},
|
|
166
|
+
hideContentBelow({ scope: e, prop: t }) {
|
|
167
|
+
return t("modal") ? O(() => [l(e)], { defer: !0 }) : void 0;
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
actions: {
|
|
171
|
+
setInitialFocus({ prop: e, scope: t }) {
|
|
172
|
+
e("trapFocus") || s(() => {
|
|
173
|
+
const n = D({
|
|
174
|
+
root: l(t),
|
|
175
|
+
getInitialEl: e("initialFocusEl")
|
|
176
|
+
});
|
|
177
|
+
n == null || n.focus({ preventScroll: !0 });
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
checkRenderedElements({ context: e, scope: t }) {
|
|
181
|
+
s(() => {
|
|
182
|
+
e.set("rendered", {
|
|
183
|
+
title: !!T(t),
|
|
184
|
+
description: !!v(t)
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
syncZIndex({ scope: e }) {
|
|
189
|
+
s(() => {
|
|
190
|
+
const t = l(e);
|
|
191
|
+
if (!t) return;
|
|
192
|
+
const n = F(t);
|
|
193
|
+
[p(e), C(e)].forEach((r) => {
|
|
194
|
+
r == null || r.style.setProperty("--z-index", n.zIndex), r == null || r.style.setProperty("--layer-index", n.getPropertyValue("--layer-index"));
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
invokeOnClose({ prop: e }) {
|
|
199
|
+
var t;
|
|
200
|
+
(t = e("onOpenChange")) == null || t({ open: !1 });
|
|
201
|
+
},
|
|
202
|
+
invokeOnOpen({ prop: e }) {
|
|
203
|
+
var t;
|
|
204
|
+
(t = e("onOpenChange")) == null || t({ open: !0 });
|
|
205
|
+
},
|
|
206
|
+
setTriggerValue({ context: e, event: t }) {
|
|
207
|
+
t.value !== void 0 && e.set("triggerValue", t.value);
|
|
208
|
+
},
|
|
209
|
+
toggleVisibility({ prop: e, send: t, event: n }) {
|
|
210
|
+
t({
|
|
211
|
+
type: e("open") ? "CONTROLLED.OPEN" : "CONTROLLED.CLOSE",
|
|
212
|
+
previousEvent: n
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
export {
|
|
219
|
+
N as machine
|
|
220
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { trackInteractOutside as x } from "../../interact-outside/dist/index.js";
|
|
2
|
+
import { trackEscapeKeydown as L } from "./escape-keydown.js";
|
|
3
|
+
import { layerStack as s } from "./layer-stack.js";
|
|
4
|
+
import { assignPointerEventToLayers as g, disablePointerEventsOutside as T, clearPointerEvent as K } from "./pointer-event-outside.js";
|
|
5
|
+
import { raf as y } from "../../dom-query/dist/raf.js";
|
|
6
|
+
import { isFunction as P } from "../../utils/dist/guard.js";
|
|
7
|
+
import { warn as w } from "../../utils/dist/warning.js";
|
|
8
|
+
import { getEventTarget as h } from "../../dom-query/dist/event.js";
|
|
9
|
+
import { isHTMLElement as M, contains as j } from "../../dom-query/dist/node.js";
|
|
10
|
+
function q(t, e) {
|
|
11
|
+
const { warnOnMissingNode: f = !0 } = e;
|
|
12
|
+
if (f && !t) {
|
|
13
|
+
w("[@zag-js/dismissable] node is `null` or `undefined`");
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (!t)
|
|
17
|
+
return;
|
|
18
|
+
const { onDismiss: n, onRequestDismiss: c, pointerBlocking: i, exclude: d, debug: o, type: b = "dialog" } = e, k = { dismiss: n, node: t, type: b, pointerBlocking: i, requestDismiss: c };
|
|
19
|
+
s.add(k), g();
|
|
20
|
+
function B(r) {
|
|
21
|
+
var u, l;
|
|
22
|
+
const a = h(r.detail.originalEvent);
|
|
23
|
+
s.isBelowPointerBlockingLayer(t) || s.isInBranch(a) || ((u = e.onPointerDownOutside) == null || u.call(e, r), (l = e.onInteractOutside) == null || l.call(e, r), !r.defaultPrevented && (o && console.log("onPointerDownOutside:", r.detail.originalEvent), n == null || n()));
|
|
24
|
+
}
|
|
25
|
+
function D(r) {
|
|
26
|
+
var u, l;
|
|
27
|
+
const a = h(r.detail.originalEvent);
|
|
28
|
+
s.isInBranch(a) || ((u = e.onFocusOutside) == null || u.call(e, r), (l = e.onInteractOutside) == null || l.call(e, r), !r.defaultPrevented && (o && console.log("onFocusOutside:", r.detail.originalEvent), n == null || n()));
|
|
29
|
+
}
|
|
30
|
+
function I(r) {
|
|
31
|
+
var a;
|
|
32
|
+
s.isTopMost(t) && ((a = e.onEscapeKeyDown) == null || a.call(e, r), !r.defaultPrevented && n && (r.preventDefault(), n()));
|
|
33
|
+
}
|
|
34
|
+
function O(r) {
|
|
35
|
+
var E;
|
|
36
|
+
if (!t) return !1;
|
|
37
|
+
const a = typeof d == "function" ? d() : d, u = Array.isArray(a) ? a : [a], l = (E = e.persistentElements) == null ? void 0 : E.map((m) => m()).filter(M);
|
|
38
|
+
return l && u.push(...l), u.some((m) => j(m, r)) || s.isInNestedLayer(t, r);
|
|
39
|
+
}
|
|
40
|
+
const v = [
|
|
41
|
+
i ? T(t, e.persistentElements) : void 0,
|
|
42
|
+
L(t, I),
|
|
43
|
+
x(t, { exclude: O, onFocusOutside: D, onPointerDownOutside: B, defer: e.defer })
|
|
44
|
+
];
|
|
45
|
+
return () => {
|
|
46
|
+
s.remove(t), g(), K(t), v.forEach((r) => r == null ? void 0 : r());
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function F(t, e) {
|
|
50
|
+
const { defer: f } = e, n = f ? y : (i) => i(), c = [];
|
|
51
|
+
return c.push(
|
|
52
|
+
n(() => {
|
|
53
|
+
const i = P(t) ? t() : t;
|
|
54
|
+
c.push(q(i, e));
|
|
55
|
+
})
|
|
56
|
+
), () => {
|
|
57
|
+
c.forEach((i) => i == null ? void 0 : i());
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function G(t, e = {}) {
|
|
61
|
+
const { defer: f } = e, n = f ? y : (i) => i(), c = [];
|
|
62
|
+
return c.push(
|
|
63
|
+
n(() => {
|
|
64
|
+
const i = P(t) ? t() : t;
|
|
65
|
+
if (!i) {
|
|
66
|
+
w("[@zag-js/dismissable] branch node is `null` or `undefined`");
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
s.addBranch(i), c.push(() => {
|
|
70
|
+
s.removeBranch(i);
|
|
71
|
+
});
|
|
72
|
+
})
|
|
73
|
+
), () => {
|
|
74
|
+
c.forEach((i) => i == null ? void 0 : i());
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
G as trackDismissableBranch,
|
|
79
|
+
F as trackDismissableElement
|
|
80
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { addDomEvent as c } from "../../dom-query/dist/event.js";
|
|
2
|
+
import { getDocument as i } from "../../dom-query/dist/node.js";
|
|
3
|
+
function p(e, o) {
|
|
4
|
+
const t = (r) => {
|
|
5
|
+
r.key === "Escape" && (r.isComposing || o == null || o(r));
|
|
6
|
+
};
|
|
7
|
+
return c(i(e), "keydown", t, { capture: !0 });
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
p as trackEscapeKeydown
|
|
11
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { nextTick as d } from "../../dom-query/dist/raf.js";
|
|
2
|
+
import { contains as o } from "../../dom-query/dist/node.js";
|
|
3
|
+
var a = "layer:request-dismiss", c = {
|
|
4
|
+
layers: [],
|
|
5
|
+
branches: [],
|
|
6
|
+
recentlyRemoved: /* @__PURE__ */ new Set(),
|
|
7
|
+
count() {
|
|
8
|
+
return this.layers.length;
|
|
9
|
+
},
|
|
10
|
+
pointerBlockingLayers() {
|
|
11
|
+
return this.layers.filter((e) => e.pointerBlocking);
|
|
12
|
+
},
|
|
13
|
+
topMostPointerBlockingLayer() {
|
|
14
|
+
return [...this.pointerBlockingLayers()].slice(-1)[0];
|
|
15
|
+
},
|
|
16
|
+
hasPointerBlockingLayer() {
|
|
17
|
+
return this.pointerBlockingLayers().length > 0;
|
|
18
|
+
},
|
|
19
|
+
isBelowPointerBlockingLayer(e) {
|
|
20
|
+
var s;
|
|
21
|
+
const t = this.indexOf(e), n = this.topMostPointerBlockingLayer() ? this.indexOf((s = this.topMostPointerBlockingLayer()) == null ? void 0 : s.node) : -1;
|
|
22
|
+
return t < n;
|
|
23
|
+
},
|
|
24
|
+
isTopMost(e) {
|
|
25
|
+
const t = this.layers[this.count() - 1];
|
|
26
|
+
return (t == null ? void 0 : t.node) === e;
|
|
27
|
+
},
|
|
28
|
+
getNestedLayers(e) {
|
|
29
|
+
return Array.from(this.layers).slice(this.indexOf(e) + 1);
|
|
30
|
+
},
|
|
31
|
+
getLayersByType(e) {
|
|
32
|
+
return this.layers.filter((t) => t.type === e);
|
|
33
|
+
},
|
|
34
|
+
getNestedLayersByType(e, t) {
|
|
35
|
+
const n = this.indexOf(e);
|
|
36
|
+
return n === -1 ? [] : this.layers.slice(n + 1).filter((s) => s.type === t);
|
|
37
|
+
},
|
|
38
|
+
getParentLayerOfType(e, t) {
|
|
39
|
+
const n = this.indexOf(e);
|
|
40
|
+
if (!(n <= 0))
|
|
41
|
+
return this.layers.slice(0, n).reverse().find((s) => s.type === t);
|
|
42
|
+
},
|
|
43
|
+
countNestedLayersOfType(e, t) {
|
|
44
|
+
return this.getNestedLayersByType(e, t).length;
|
|
45
|
+
},
|
|
46
|
+
isInNestedLayer(e, t) {
|
|
47
|
+
return !!(this.getNestedLayers(e).some((s) => o(s.node, t)) || this.recentlyRemoved.size > 0);
|
|
48
|
+
},
|
|
49
|
+
isInBranch(e) {
|
|
50
|
+
return Array.from(this.branches).some((t) => o(t, e));
|
|
51
|
+
},
|
|
52
|
+
add(e) {
|
|
53
|
+
this.layers.push(e), this.syncLayers();
|
|
54
|
+
},
|
|
55
|
+
addBranch(e) {
|
|
56
|
+
this.branches.push(e);
|
|
57
|
+
},
|
|
58
|
+
remove(e) {
|
|
59
|
+
const t = this.indexOf(e);
|
|
60
|
+
t < 0 || (this.recentlyRemoved.add(e), d(() => this.recentlyRemoved.delete(e)), t < this.count() - 1 && this.getNestedLayers(e).forEach((s) => c.dismiss(s.node, e)), this.layers.splice(t, 1), this.syncLayers());
|
|
61
|
+
},
|
|
62
|
+
removeBranch(e) {
|
|
63
|
+
const t = this.branches.indexOf(e);
|
|
64
|
+
t >= 0 && this.branches.splice(t, 1);
|
|
65
|
+
},
|
|
66
|
+
syncLayers() {
|
|
67
|
+
this.layers.forEach((e, t) => {
|
|
68
|
+
e.node.style.setProperty("--layer-index", `${t}`), e.node.removeAttribute("data-nested"), e.node.removeAttribute("data-has-nested"), this.getParentLayerOfType(e.node, e.type) && e.node.setAttribute("data-nested", e.type);
|
|
69
|
+
const s = this.countNestedLayersOfType(e.node, e.type);
|
|
70
|
+
s > 0 && e.node.setAttribute("data-has-nested", e.type), e.node.style.setProperty("--nested-layer-count", `${s}`);
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
indexOf(e) {
|
|
74
|
+
return this.layers.findIndex((t) => t.node === e);
|
|
75
|
+
},
|
|
76
|
+
dismiss(e, t) {
|
|
77
|
+
const n = this.indexOf(e);
|
|
78
|
+
if (n === -1) return;
|
|
79
|
+
const s = this.layers[n];
|
|
80
|
+
y(e, a, (r) => {
|
|
81
|
+
var i;
|
|
82
|
+
(i = s.requestDismiss) == null || i.call(s, r), r.defaultPrevented || s == null || s.dismiss();
|
|
83
|
+
}), h(e, a, {
|
|
84
|
+
originalLayer: e,
|
|
85
|
+
targetLayer: t,
|
|
86
|
+
originalIndex: n,
|
|
87
|
+
targetIndex: t ? this.indexOf(t) : -1
|
|
88
|
+
}), this.syncLayers();
|
|
89
|
+
},
|
|
90
|
+
clear() {
|
|
91
|
+
this.remove(this.layers[0].node);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
function h(e, t, n) {
|
|
95
|
+
const s = e.ownerDocument.defaultView || window, r = new s.CustomEvent(t, { cancelable: !0, bubbles: !0, detail: n });
|
|
96
|
+
return e.dispatchEvent(r);
|
|
97
|
+
}
|
|
98
|
+
function y(e, t, n) {
|
|
99
|
+
e.addEventListener(t, n, { once: !0 });
|
|
100
|
+
}
|
|
101
|
+
export {
|
|
102
|
+
c as layerStack
|
|
103
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { layerStack as r } from "./layer-stack.js";
|
|
2
|
+
import { getDocument as c, isHTMLElement as l } from "../../dom-query/dist/node.js";
|
|
3
|
+
import { waitForElement as d } from "../../dom-query/dist/wait-for.js";
|
|
4
|
+
import { setStyle as b } from "../../dom-query/dist/set.js";
|
|
5
|
+
var s;
|
|
6
|
+
function E() {
|
|
7
|
+
r.layers.forEach(({ node: o }) => {
|
|
8
|
+
o.style.pointerEvents = r.isBelowPointerBlockingLayer(o) ? "none" : "auto";
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function h(o) {
|
|
12
|
+
o.style.pointerEvents = "";
|
|
13
|
+
}
|
|
14
|
+
function g(o, n) {
|
|
15
|
+
const t = c(o), i = [];
|
|
16
|
+
return r.hasPointerBlockingLayer() && !t.body.hasAttribute("data-inert") && (s = document.body.style.pointerEvents, queueMicrotask(() => {
|
|
17
|
+
t.body.style.pointerEvents = "none", t.body.setAttribute("data-inert", "");
|
|
18
|
+
})), n == null || n.forEach((a) => {
|
|
19
|
+
const [u, y] = d(
|
|
20
|
+
() => {
|
|
21
|
+
const e = a();
|
|
22
|
+
return l(e) ? e : null;
|
|
23
|
+
},
|
|
24
|
+
{ timeout: 1e3 }
|
|
25
|
+
);
|
|
26
|
+
u.then((e) => i.push(b(e, { pointerEvents: "auto" }))), i.push(y);
|
|
27
|
+
}), () => {
|
|
28
|
+
r.hasPointerBlockingLayer() || (queueMicrotask(() => {
|
|
29
|
+
t.body.style.pointerEvents = s, t.body.removeAttribute("data-inert"), t.body.style.length === 0 && t.body.removeAttribute("style");
|
|
30
|
+
}), i.forEach((a) => a()));
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
E as assignPointerEventToLayers,
|
|
35
|
+
h as clearPointerEvent,
|
|
36
|
+
g as disablePointerEventsOutside
|
|
37
|
+
};
|