@serendie/ui 3.2.0 → 3.2.1
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,54 @@
|
|
|
1
|
+
import { parts as E } from "./toast.anatomy.js";
|
|
2
|
+
import { getRegionId as f } from "./toast.dom.js";
|
|
3
|
+
import { getGroupPlacementStyle as R } from "./toast.utils.js";
|
|
4
|
+
import { contains as T } from "../../dom-query/dist/node.js";
|
|
5
|
+
function b(a, g) {
|
|
6
|
+
const { context: i, prop: n, send: t, refs: r, computed: u } = a;
|
|
7
|
+
return {
|
|
8
|
+
getCount() {
|
|
9
|
+
return i.get("toasts").length;
|
|
10
|
+
},
|
|
11
|
+
getToasts() {
|
|
12
|
+
return i.get("toasts");
|
|
13
|
+
},
|
|
14
|
+
getGroupProps(s = {}) {
|
|
15
|
+
const { label: c = "Notifications" } = s, { hotkey: l } = n("store").attrs, p = l.join("+").replace(/Key/g, "").replace(/Digit/g, ""), e = u("placement"), [m, d = "center"] = e.split("-");
|
|
16
|
+
return g.element({
|
|
17
|
+
...E.group.attrs,
|
|
18
|
+
dir: n("dir"),
|
|
19
|
+
tabIndex: -1,
|
|
20
|
+
role: "region",
|
|
21
|
+
"aria-label": `${c}, ${e} (${p})`,
|
|
22
|
+
id: f(e),
|
|
23
|
+
"data-placement": e,
|
|
24
|
+
"data-side": m,
|
|
25
|
+
"data-align": d,
|
|
26
|
+
"aria-live": "polite",
|
|
27
|
+
"aria-relevant": "additions text",
|
|
28
|
+
"aria-atomic": "false",
|
|
29
|
+
style: R(a, e),
|
|
30
|
+
onMouseEnter() {
|
|
31
|
+
r.get("ignoreMouseTimer").isActive() || t({ type: "REGION.POINTER_ENTER", placement: e });
|
|
32
|
+
},
|
|
33
|
+
onMouseMove() {
|
|
34
|
+
r.get("ignoreMouseTimer").isActive() || t({ type: "REGION.POINTER_ENTER", placement: e });
|
|
35
|
+
},
|
|
36
|
+
onMouseLeave() {
|
|
37
|
+
r.get("ignoreMouseTimer").isActive() || t({ type: "REGION.POINTER_LEAVE", placement: e });
|
|
38
|
+
},
|
|
39
|
+
onFocus(o) {
|
|
40
|
+
t({ type: "REGION.FOCUS", target: o.relatedTarget });
|
|
41
|
+
},
|
|
42
|
+
onBlur(o) {
|
|
43
|
+
r.get("isFocusWithin") && !T(o.currentTarget, o.relatedTarget) && queueMicrotask(() => t({ type: "REGION.BLUR" }));
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
subscribe(s) {
|
|
48
|
+
return n("store").subscribe(() => s(i.get("toasts")));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
b as groupConnect
|
|
54
|
+
};
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { getRegionEl as l } from "./toast.dom.js";
|
|
2
|
+
import { trackDismissableBranch as d } from "../../dismissable/dist/dismissable-layer.js";
|
|
3
|
+
import { addDomEvent as c } from "../../dom-query/dist/event.js";
|
|
4
|
+
import { AnimationFrame as p } from "../../dom-query/dist/raf.js";
|
|
5
|
+
import { uuid as m } from "../../utils/dist/functions.js";
|
|
6
|
+
import { setup as g } from "../../core/dist/create-machine.js";
|
|
7
|
+
var { guards: E, createMachine: h } = g(), { and: T } = E, W = h({
|
|
8
|
+
props({ props: e }) {
|
|
9
|
+
return {
|
|
10
|
+
dir: "ltr",
|
|
11
|
+
id: m(),
|
|
12
|
+
...e,
|
|
13
|
+
store: e.store
|
|
14
|
+
};
|
|
15
|
+
},
|
|
16
|
+
initialState({ prop: e }) {
|
|
17
|
+
return e("store").attrs.overlap ? "overlap" : "stack";
|
|
18
|
+
},
|
|
19
|
+
refs() {
|
|
20
|
+
return {
|
|
21
|
+
lastFocusedEl: null,
|
|
22
|
+
isFocusWithin: !1,
|
|
23
|
+
isPointerWithin: !1,
|
|
24
|
+
ignoreMouseTimer: p.create(),
|
|
25
|
+
dismissableCleanup: void 0
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
context({ bindable: e }) {
|
|
29
|
+
return {
|
|
30
|
+
toasts: e(() => ({
|
|
31
|
+
defaultValue: [],
|
|
32
|
+
sync: !0,
|
|
33
|
+
hash: (t) => t.map((s) => s.id).join(",")
|
|
34
|
+
})),
|
|
35
|
+
heights: e(() => ({
|
|
36
|
+
defaultValue: [],
|
|
37
|
+
sync: !0
|
|
38
|
+
}))
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
computed: {
|
|
42
|
+
count: ({ context: e }) => e.get("toasts").length,
|
|
43
|
+
overlap: ({ prop: e }) => e("store").attrs.overlap,
|
|
44
|
+
placement: ({ prop: e }) => e("store").attrs.placement
|
|
45
|
+
},
|
|
46
|
+
effects: ["subscribeToStore", "trackDocumentVisibility", "trackHotKeyPress"],
|
|
47
|
+
watch({ track: e, context: t, action: s }) {
|
|
48
|
+
e([() => t.hash("toasts")], () => {
|
|
49
|
+
queueMicrotask(() => {
|
|
50
|
+
s(["collapsedIfEmpty", "setDismissableBranch"]);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
exit: ["clearDismissableBranch", "clearLastFocusedEl", "clearMouseEventTimer"],
|
|
55
|
+
on: {
|
|
56
|
+
"DOC.HOTKEY": {
|
|
57
|
+
actions: ["focusRegionEl"]
|
|
58
|
+
},
|
|
59
|
+
"REGION.BLUR": [
|
|
60
|
+
{
|
|
61
|
+
guard: T("isOverlapping", "isPointerOut"),
|
|
62
|
+
target: "overlap",
|
|
63
|
+
actions: ["collapseToasts", "resumeToasts", "restoreFocusIfPointerOut"]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
guard: "isPointerOut",
|
|
67
|
+
target: "stack",
|
|
68
|
+
actions: ["resumeToasts", "restoreFocusIfPointerOut"]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
actions: ["clearFocusWithin"]
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"TOAST.REMOVE": {
|
|
75
|
+
actions: ["removeToast", "removeHeight", "ignoreMouseEventsTemporarily"]
|
|
76
|
+
},
|
|
77
|
+
"TOAST.PAUSE": {
|
|
78
|
+
actions: ["pauseToasts"]
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
states: {
|
|
82
|
+
stack: {
|
|
83
|
+
on: {
|
|
84
|
+
"REGION.POINTER_LEAVE": [
|
|
85
|
+
{
|
|
86
|
+
guard: "isOverlapping",
|
|
87
|
+
target: "overlap",
|
|
88
|
+
actions: ["clearPointerWithin", "resumeToasts", "collapseToasts"]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
actions: ["clearPointerWithin", "resumeToasts"]
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"REGION.OVERLAP": {
|
|
95
|
+
target: "overlap",
|
|
96
|
+
actions: ["collapseToasts"]
|
|
97
|
+
},
|
|
98
|
+
"REGION.FOCUS": {
|
|
99
|
+
actions: ["setLastFocusedEl", "pauseToasts"]
|
|
100
|
+
},
|
|
101
|
+
"REGION.POINTER_ENTER": {
|
|
102
|
+
actions: ["setPointerWithin", "pauseToasts"]
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
overlap: {
|
|
107
|
+
on: {
|
|
108
|
+
"REGION.STACK": {
|
|
109
|
+
target: "stack",
|
|
110
|
+
actions: ["expandToasts"]
|
|
111
|
+
},
|
|
112
|
+
"REGION.POINTER_ENTER": {
|
|
113
|
+
target: "stack",
|
|
114
|
+
actions: ["setPointerWithin", "pauseToasts", "expandToasts"]
|
|
115
|
+
},
|
|
116
|
+
"REGION.FOCUS": {
|
|
117
|
+
target: "stack",
|
|
118
|
+
actions: ["setLastFocusedEl", "pauseToasts", "expandToasts"]
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
implementations: {
|
|
124
|
+
guards: {
|
|
125
|
+
isOverlapping: ({ computed: e }) => e("overlap"),
|
|
126
|
+
isPointerOut: ({ refs: e }) => !e.get("isPointerWithin")
|
|
127
|
+
},
|
|
128
|
+
effects: {
|
|
129
|
+
subscribeToStore({ context: e, prop: t }) {
|
|
130
|
+
const s = t("store");
|
|
131
|
+
return e.set("toasts", s.getVisibleToasts()), s.subscribe((o) => {
|
|
132
|
+
if (o.dismiss) {
|
|
133
|
+
e.set("toasts", (i) => i.filter((a) => a.id !== o.id));
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
e.set("toasts", (i) => {
|
|
137
|
+
const a = i.findIndex((r) => r.id === o.id);
|
|
138
|
+
return a !== -1 ? [...i.slice(0, a), { ...i[a], ...o }, ...i.slice(a + 1)] : [o, ...i];
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
trackHotKeyPress({ prop: e, send: t }) {
|
|
143
|
+
return c(document, "keydown", (o) => {
|
|
144
|
+
const { hotkey: i } = e("store").attrs;
|
|
145
|
+
i.every((r) => o[r] || o.code === r) && t({ type: "DOC.HOTKEY" });
|
|
146
|
+
}, { capture: !0 });
|
|
147
|
+
},
|
|
148
|
+
trackDocumentVisibility({ prop: e, send: t, scope: s }) {
|
|
149
|
+
const { pauseOnPageIdle: o } = e("store").attrs;
|
|
150
|
+
if (!o) return;
|
|
151
|
+
const i = s.getDoc();
|
|
152
|
+
return c(i, "visibilitychange", () => {
|
|
153
|
+
const a = i.visibilityState === "hidden";
|
|
154
|
+
t({ type: a ? "PAUSE_ALL" : "RESUME_ALL" });
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
actions: {
|
|
159
|
+
setDismissableBranch({ refs: e, context: t, computed: s, scope: o }) {
|
|
160
|
+
var n;
|
|
161
|
+
const i = t.get("toasts"), a = s("placement"), r = i.length > 0;
|
|
162
|
+
if (!r) {
|
|
163
|
+
(n = e.get("dismissableCleanup")) == null || n();
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (r && e.get("dismissableCleanup"))
|
|
167
|
+
return;
|
|
168
|
+
const u = d(() => l(o, a), { defer: !0 });
|
|
169
|
+
e.set("dismissableCleanup", u);
|
|
170
|
+
},
|
|
171
|
+
clearDismissableBranch({ refs: e }) {
|
|
172
|
+
var t;
|
|
173
|
+
(t = e.get("dismissableCleanup")) == null || t();
|
|
174
|
+
},
|
|
175
|
+
focusRegionEl({ scope: e, computed: t }) {
|
|
176
|
+
queueMicrotask(() => {
|
|
177
|
+
var s;
|
|
178
|
+
(s = l(e, t("placement"))) == null || s.focus();
|
|
179
|
+
});
|
|
180
|
+
},
|
|
181
|
+
pauseToasts({ prop: e }) {
|
|
182
|
+
e("store").pause();
|
|
183
|
+
},
|
|
184
|
+
resumeToasts({ prop: e }) {
|
|
185
|
+
e("store").resume();
|
|
186
|
+
},
|
|
187
|
+
expandToasts({ prop: e }) {
|
|
188
|
+
e("store").expand();
|
|
189
|
+
},
|
|
190
|
+
collapseToasts({ prop: e }) {
|
|
191
|
+
e("store").collapse();
|
|
192
|
+
},
|
|
193
|
+
removeToast({ prop: e, event: t }) {
|
|
194
|
+
e("store").remove(t.id);
|
|
195
|
+
},
|
|
196
|
+
removeHeight({ event: e, context: t }) {
|
|
197
|
+
(e == null ? void 0 : e.id) != null && queueMicrotask(() => {
|
|
198
|
+
t.set("heights", (s) => s.filter((o) => o.id !== e.id));
|
|
199
|
+
});
|
|
200
|
+
},
|
|
201
|
+
collapsedIfEmpty({ send: e, computed: t }) {
|
|
202
|
+
!t("overlap") || t("count") > 1 || e({ type: "REGION.OVERLAP" });
|
|
203
|
+
},
|
|
204
|
+
setLastFocusedEl({ refs: e, event: t }) {
|
|
205
|
+
e.get("isFocusWithin") || !t.target || (e.set("isFocusWithin", !0), e.set("lastFocusedEl", t.target));
|
|
206
|
+
},
|
|
207
|
+
restoreFocusIfPointerOut({ refs: e }) {
|
|
208
|
+
var t;
|
|
209
|
+
!e.get("lastFocusedEl") || e.get("isPointerWithin") || ((t = e.get("lastFocusedEl")) == null || t.focus({ preventScroll: !0 }), e.set("lastFocusedEl", null), e.set("isFocusWithin", !1));
|
|
210
|
+
},
|
|
211
|
+
setPointerWithin({ refs: e }) {
|
|
212
|
+
e.set("isPointerWithin", !0);
|
|
213
|
+
},
|
|
214
|
+
clearPointerWithin({ refs: e }) {
|
|
215
|
+
var t;
|
|
216
|
+
e.set("isPointerWithin", !1), e.get("lastFocusedEl") && !e.get("isFocusWithin") && ((t = e.get("lastFocusedEl")) == null || t.focus({ preventScroll: !0 }), e.set("lastFocusedEl", null));
|
|
217
|
+
},
|
|
218
|
+
clearFocusWithin({ refs: e }) {
|
|
219
|
+
e.set("isFocusWithin", !1);
|
|
220
|
+
},
|
|
221
|
+
clearLastFocusedEl({ refs: e }) {
|
|
222
|
+
var t;
|
|
223
|
+
e.get("lastFocusedEl") && ((t = e.get("lastFocusedEl")) == null || t.focus({ preventScroll: !0 }), e.set("lastFocusedEl", null), e.set("isFocusWithin", !1));
|
|
224
|
+
},
|
|
225
|
+
ignoreMouseEventsTemporarily({ refs: e }) {
|
|
226
|
+
e.get("ignoreMouseTimer").request();
|
|
227
|
+
},
|
|
228
|
+
clearMouseEventTimer({ refs: e }) {
|
|
229
|
+
e.get("ignoreMouseTimer").cancel();
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
export {
|
|
235
|
+
W as groupMachine
|
|
236
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createAnatomy as r } from "../../anatomy/dist/create-anatomy.js";
|
|
2
|
+
var t = r("toast").parts(
|
|
3
|
+
"group",
|
|
4
|
+
"root",
|
|
5
|
+
"title",
|
|
6
|
+
"description",
|
|
7
|
+
"actionTrigger",
|
|
8
|
+
"closeTrigger"
|
|
9
|
+
), a = t.build();
|
|
10
|
+
export {
|
|
11
|
+
t as anatomy,
|
|
12
|
+
a as parts
|
|
13
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { dataAttr as a } from "../../dom-query/dist/shared.js";
|
|
2
|
+
import { parts as d } from "./toast.anatomy.js";
|
|
3
|
+
import { getCloseTriggerId as C, getDescriptionId as P, getTitleId as T, getRootId as M } from "./toast.dom.js";
|
|
4
|
+
import { getGhostAfterStyle as E, getGhostBeforeStyle as G, getPlacementStyle as x } from "./toast.utils.js";
|
|
5
|
+
function K(p, e) {
|
|
6
|
+
const { state: g, send: o, prop: t, scope: s, context: h, computed: k } = p, c = t("translations"), i = g.hasTag("visible"), u = g.hasTag("paused"), D = h.get("mounted"), m = k("frontmost"), l = t("parent").computed("placement"), f = t("type"), y = t("stacked"), b = t("title"), S = t("description"), n = t("action"), [v, A = "center"] = l.split("-");
|
|
7
|
+
return {
|
|
8
|
+
type: f,
|
|
9
|
+
title: b,
|
|
10
|
+
description: S,
|
|
11
|
+
placement: l,
|
|
12
|
+
visible: i,
|
|
13
|
+
paused: u,
|
|
14
|
+
closable: !!t("closable"),
|
|
15
|
+
pause() {
|
|
16
|
+
o({ type: "PAUSE" });
|
|
17
|
+
},
|
|
18
|
+
resume() {
|
|
19
|
+
o({ type: "RESUME" });
|
|
20
|
+
},
|
|
21
|
+
dismiss() {
|
|
22
|
+
o({ type: "DISMISS", src: "programmatic" });
|
|
23
|
+
},
|
|
24
|
+
getRootProps() {
|
|
25
|
+
return e.element({
|
|
26
|
+
...d.root.attrs,
|
|
27
|
+
dir: t("dir"),
|
|
28
|
+
id: M(s),
|
|
29
|
+
"data-state": i ? "open" : "closed",
|
|
30
|
+
"data-type": f,
|
|
31
|
+
"data-placement": l,
|
|
32
|
+
"data-align": A,
|
|
33
|
+
"data-side": v,
|
|
34
|
+
"data-mounted": a(D),
|
|
35
|
+
"data-paused": a(u),
|
|
36
|
+
"data-first": a(m),
|
|
37
|
+
"data-sibling": a(!m),
|
|
38
|
+
"data-stack": a(y),
|
|
39
|
+
"data-overlap": a(!y),
|
|
40
|
+
role: "status",
|
|
41
|
+
"aria-atomic": "true",
|
|
42
|
+
"aria-describedby": S ? P(s) : void 0,
|
|
43
|
+
"aria-labelledby": b ? T(s) : void 0,
|
|
44
|
+
tabIndex: 0,
|
|
45
|
+
style: x(p, i),
|
|
46
|
+
onKeyDown(r) {
|
|
47
|
+
r.defaultPrevented || r.key == "Escape" && (o({ type: "DISMISS", src: "keyboard" }), r.preventDefault());
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
/* Leave a ghost div to avoid setting hover to false when transitioning out */
|
|
52
|
+
getGhostBeforeProps() {
|
|
53
|
+
return e.element({
|
|
54
|
+
"data-ghost": "before",
|
|
55
|
+
style: G(p, i)
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
/* Needed to avoid setting hover to false when in between toasts */
|
|
59
|
+
getGhostAfterProps() {
|
|
60
|
+
return e.element({
|
|
61
|
+
"data-ghost": "after",
|
|
62
|
+
style: E()
|
|
63
|
+
});
|
|
64
|
+
},
|
|
65
|
+
getTitleProps() {
|
|
66
|
+
return e.element({
|
|
67
|
+
...d.title.attrs,
|
|
68
|
+
id: T(s)
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
getDescriptionProps() {
|
|
72
|
+
return e.element({
|
|
73
|
+
...d.description.attrs,
|
|
74
|
+
id: P(s)
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
getActionTriggerProps() {
|
|
78
|
+
return e.button({
|
|
79
|
+
...d.actionTrigger.attrs,
|
|
80
|
+
type: "button",
|
|
81
|
+
onClick(r) {
|
|
82
|
+
var I;
|
|
83
|
+
r.defaultPrevented || ((I = n == null ? void 0 : n.onClick) == null || I.call(n), o({ type: "DISMISS", src: "user" }));
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
},
|
|
87
|
+
getCloseTriggerProps() {
|
|
88
|
+
return e.button({
|
|
89
|
+
id: C(s),
|
|
90
|
+
...d.closeTrigger.attrs,
|
|
91
|
+
type: "button",
|
|
92
|
+
"aria-label": c == null ? void 0 : c.closeTriggerLabel,
|
|
93
|
+
onClick(r) {
|
|
94
|
+
r.defaultPrevented || o({ type: "DISMISS", src: "user" });
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
K as connect
|
|
102
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var g = (t) => `toast-group:${t}`, r = (t, e) => t.getById(`toast-group:${e}`), o = (t) => `toast:${t.id}`, a = (t) => t.getById(o(t)), i = (t) => `toast:${t.id}:title`, d = (t) => `toast:${t.id}:description`, s = (t) => `toast${t.id}:close`;
|
|
2
|
+
export {
|
|
3
|
+
s as getCloseTriggerId,
|
|
4
|
+
d as getDescriptionId,
|
|
5
|
+
r as getRegionEl,
|
|
6
|
+
g as getRegionId,
|
|
7
|
+
a as getRootEl,
|
|
8
|
+
o as getRootId,
|
|
9
|
+
i as getTitleId
|
|
10
|
+
};
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { getRootEl as u } from "./toast.dom.js";
|
|
2
|
+
import { getToastDuration as o } from "./toast.utils.js";
|
|
3
|
+
import { createMachine as f, createGuards as T } from "../../core/dist/create-machine.js";
|
|
4
|
+
import { raf as m } from "../../dom-query/dist/raf.js";
|
|
5
|
+
import { setRafTimeout as g } from "../../utils/dist/timers.js";
|
|
6
|
+
import { ensureProps as y } from "../../utils/dist/warning.js";
|
|
7
|
+
var { not: v } = T(), R = f({
|
|
8
|
+
props({ props: t }) {
|
|
9
|
+
return y(t, ["id", "type", "parent", "removeDelay"], "toast"), {
|
|
10
|
+
closable: !0,
|
|
11
|
+
...t,
|
|
12
|
+
translations: {
|
|
13
|
+
closeTriggerLabel: "Dismiss notification",
|
|
14
|
+
...t.translations
|
|
15
|
+
},
|
|
16
|
+
duration: o(t.duration, t.type)
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
initialState({ prop: t }) {
|
|
20
|
+
return t("type") === "loading" || t("duration") === 1 / 0 ? "visible:persist" : "visible";
|
|
21
|
+
},
|
|
22
|
+
context({ prop: t, bindable: e }) {
|
|
23
|
+
return {
|
|
24
|
+
remainingTime: e(() => ({
|
|
25
|
+
defaultValue: o(t("duration"), t("type"))
|
|
26
|
+
})),
|
|
27
|
+
createdAt: e(() => ({
|
|
28
|
+
defaultValue: Date.now()
|
|
29
|
+
})),
|
|
30
|
+
mounted: e(() => ({
|
|
31
|
+
defaultValue: !1
|
|
32
|
+
})),
|
|
33
|
+
initialHeight: e(() => ({
|
|
34
|
+
defaultValue: 0
|
|
35
|
+
}))
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
refs() {
|
|
39
|
+
return {
|
|
40
|
+
closeTimerStartTime: Date.now(),
|
|
41
|
+
lastCloseStartTimerStartTime: 0
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
computed: {
|
|
45
|
+
zIndex: ({ prop: t }) => {
|
|
46
|
+
const e = t("parent").context.get("toasts"), i = e.findIndex((s) => s.id === t("id"));
|
|
47
|
+
return e.length - i;
|
|
48
|
+
},
|
|
49
|
+
height: ({ prop: t }) => {
|
|
50
|
+
const i = t("parent").context.get("heights").find((s) => s.id === t("id"));
|
|
51
|
+
return (i == null ? void 0 : i.height) ?? 0;
|
|
52
|
+
},
|
|
53
|
+
heightIndex: ({ prop: t }) => t("parent").context.get("heights").findIndex((i) => i.id === t("id")),
|
|
54
|
+
frontmost: ({ prop: t }) => t("index") === 0,
|
|
55
|
+
heightBefore: ({ prop: t }) => {
|
|
56
|
+
const e = t("parent").context.get("heights"), i = e.findIndex((s) => s.id === t("id"));
|
|
57
|
+
return e.reduce((s, n, a) => a >= i ? s : s + n.height, 0);
|
|
58
|
+
},
|
|
59
|
+
shouldPersist: ({ prop: t }) => t("type") === "loading" || t("duration") === 1 / 0
|
|
60
|
+
},
|
|
61
|
+
watch({ track: t, prop: e, send: i }) {
|
|
62
|
+
t([() => e("message")], () => {
|
|
63
|
+
const s = e("message");
|
|
64
|
+
s && i({ type: s, src: "programmatic" });
|
|
65
|
+
}), t([() => e("type"), () => e("duration")], () => {
|
|
66
|
+
i({ type: "UPDATE" });
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
on: {
|
|
70
|
+
UPDATE: [
|
|
71
|
+
{
|
|
72
|
+
guard: "shouldPersist",
|
|
73
|
+
target: "visible:persist",
|
|
74
|
+
actions: ["resetCloseTimer"]
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
target: "visible:updating",
|
|
78
|
+
actions: ["resetCloseTimer"]
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
MEASURE: {
|
|
82
|
+
actions: ["measureHeight"]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
entry: ["setMounted", "measureHeight", "invokeOnVisible"],
|
|
86
|
+
effects: ["trackHeight"],
|
|
87
|
+
states: {
|
|
88
|
+
"visible:updating": {
|
|
89
|
+
tags: ["visible", "updating"],
|
|
90
|
+
effects: ["waitForNextTick"],
|
|
91
|
+
on: {
|
|
92
|
+
SHOW: {
|
|
93
|
+
target: "visible"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"visible:persist": {
|
|
98
|
+
tags: ["visible", "paused"],
|
|
99
|
+
on: {
|
|
100
|
+
RESUME: {
|
|
101
|
+
guard: v("isLoadingType"),
|
|
102
|
+
target: "visible",
|
|
103
|
+
actions: ["setCloseTimer"]
|
|
104
|
+
},
|
|
105
|
+
DISMISS: {
|
|
106
|
+
target: "dismissing"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
visible: {
|
|
111
|
+
tags: ["visible"],
|
|
112
|
+
effects: ["waitForDuration"],
|
|
113
|
+
on: {
|
|
114
|
+
DISMISS: {
|
|
115
|
+
target: "dismissing"
|
|
116
|
+
},
|
|
117
|
+
PAUSE: {
|
|
118
|
+
target: "visible:persist",
|
|
119
|
+
actions: ["syncRemainingTime"]
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
dismissing: {
|
|
124
|
+
entry: ["invokeOnDismiss"],
|
|
125
|
+
effects: ["waitForRemoveDelay"],
|
|
126
|
+
on: {
|
|
127
|
+
REMOVE: {
|
|
128
|
+
target: "unmounted",
|
|
129
|
+
actions: ["notifyParentToRemove"]
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
unmounted: {
|
|
134
|
+
entry: ["invokeOnUnmount"]
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
implementations: {
|
|
138
|
+
effects: {
|
|
139
|
+
waitForRemoveDelay({ prop: t, send: e }) {
|
|
140
|
+
return g(() => {
|
|
141
|
+
e({ type: "REMOVE", src: "timer" });
|
|
142
|
+
}, t("removeDelay"));
|
|
143
|
+
},
|
|
144
|
+
waitForDuration({ send: t, context: e, computed: i }) {
|
|
145
|
+
if (!i("shouldPersist"))
|
|
146
|
+
return g(() => {
|
|
147
|
+
t({ type: "DISMISS", src: "timer" });
|
|
148
|
+
}, e.get("remainingTime"));
|
|
149
|
+
},
|
|
150
|
+
waitForNextTick({ send: t }) {
|
|
151
|
+
return g(() => {
|
|
152
|
+
t({ type: "SHOW", src: "timer" });
|
|
153
|
+
}, 0);
|
|
154
|
+
},
|
|
155
|
+
trackHeight({ scope: t, prop: e }) {
|
|
156
|
+
let i;
|
|
157
|
+
return m(() => {
|
|
158
|
+
const s = u(t);
|
|
159
|
+
if (!s) return;
|
|
160
|
+
const n = () => {
|
|
161
|
+
const d = s.style.height;
|
|
162
|
+
s.style.height = "auto";
|
|
163
|
+
const l = s.getBoundingClientRect().height;
|
|
164
|
+
s.style.height = d;
|
|
165
|
+
const h = { id: e("id"), height: l };
|
|
166
|
+
c(e("parent"), h);
|
|
167
|
+
}, a = t.getWin(), r = new a.MutationObserver(n);
|
|
168
|
+
r.observe(s, {
|
|
169
|
+
childList: !0,
|
|
170
|
+
subtree: !0,
|
|
171
|
+
characterData: !0
|
|
172
|
+
}), i = () => r.disconnect();
|
|
173
|
+
}), () => i == null ? void 0 : i();
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
guards: {
|
|
177
|
+
isLoadingType: ({ prop: t }) => t("type") === "loading",
|
|
178
|
+
shouldPersist: ({ computed: t }) => t("shouldPersist")
|
|
179
|
+
},
|
|
180
|
+
actions: {
|
|
181
|
+
setMounted({ context: t }) {
|
|
182
|
+
m(() => {
|
|
183
|
+
t.set("mounted", !0);
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
measureHeight({ scope: t, prop: e, context: i }) {
|
|
187
|
+
queueMicrotask(() => {
|
|
188
|
+
const s = u(t);
|
|
189
|
+
if (!s) return;
|
|
190
|
+
const n = s.style.height;
|
|
191
|
+
s.style.height = "auto";
|
|
192
|
+
const a = s.getBoundingClientRect().height;
|
|
193
|
+
s.style.height = n, i.set("initialHeight", a);
|
|
194
|
+
const r = { id: e("id"), height: a };
|
|
195
|
+
c(e("parent"), r);
|
|
196
|
+
});
|
|
197
|
+
},
|
|
198
|
+
setCloseTimer({ refs: t }) {
|
|
199
|
+
t.set("closeTimerStartTime", Date.now());
|
|
200
|
+
},
|
|
201
|
+
resetCloseTimer({ context: t, refs: e, prop: i }) {
|
|
202
|
+
e.set("closeTimerStartTime", Date.now()), t.set("remainingTime", o(i("duration"), i("type")));
|
|
203
|
+
},
|
|
204
|
+
syncRemainingTime({ context: t, refs: e }) {
|
|
205
|
+
t.set("remainingTime", (i) => {
|
|
206
|
+
const s = e.get("closeTimerStartTime"), n = Date.now() - s;
|
|
207
|
+
return e.set("lastCloseStartTimerStartTime", Date.now()), i - n;
|
|
208
|
+
});
|
|
209
|
+
},
|
|
210
|
+
notifyParentToRemove({ prop: t }) {
|
|
211
|
+
t("parent").send({ type: "TOAST.REMOVE", id: t("id") });
|
|
212
|
+
},
|
|
213
|
+
invokeOnDismiss({ prop: t, event: e }) {
|
|
214
|
+
var i;
|
|
215
|
+
(i = t("onStatusChange")) == null || i({ status: "dismissing", src: e.src });
|
|
216
|
+
},
|
|
217
|
+
invokeOnUnmount({ prop: t }) {
|
|
218
|
+
var e;
|
|
219
|
+
(e = t("onStatusChange")) == null || e({ status: "unmounted" });
|
|
220
|
+
},
|
|
221
|
+
invokeOnVisible({ prop: t }) {
|
|
222
|
+
var e;
|
|
223
|
+
(e = t("onStatusChange")) == null || e({ status: "visible" });
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
function c(t, e) {
|
|
229
|
+
const { id: i, height: s } = e;
|
|
230
|
+
t.context.set("heights", (n) => n.find((r) => r.id === i) ? n.map((r) => r.id === i ? { ...r, height: s } : r) : [{ id: i, height: s }, ...n]);
|
|
231
|
+
}
|
|
232
|
+
export {
|
|
233
|
+
R as machine
|
|
234
|
+
};
|