@human-kit/ui 1.0.0-beta.1 → 1.0.0-beta.11
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/README.md +27 -16
- package/dist/FOCUS_STATE_CONTRACT.md +17 -4
- package/dist/FOCUS_STATE_REVIEW_TEMPLATE.md +8 -8
- package/dist/accordion/README.md +3 -3
- package/dist/accordion/types.d.ts +37 -23
- package/dist/autocomplete/README.md +6 -7
- package/dist/autocomplete/empty/autocomplete-empty.svelte +1 -1
- package/dist/autocomplete/empty/autocomplete-empty.svelte.d.ts +1 -1
- package/dist/autocomplete/input/autocomplete-input.svelte +3 -3
- package/dist/autocomplete/input/autocomplete-input.svelte.d.ts +3 -3
- package/dist/autocomplete/item/autocomplete-item.svelte +10 -0
- package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte +2 -2
- package/dist/autocomplete/item-indicator/autocomplete-item-indicator.svelte.d.ts +2 -2
- package/dist/autocomplete/list/autocomplete-list.svelte +2 -2
- package/dist/autocomplete/list/autocomplete-list.svelte.d.ts +5 -3
- package/dist/autocomplete/root/autocomplete.svelte +7 -7
- package/dist/autocomplete/root/autocomplete.svelte.d.ts +7 -7
- package/dist/autocomplete/status/autocomplete-status.svelte +1 -1
- package/dist/autocomplete/status/autocomplete-status.svelte.d.ts +1 -1
- package/dist/avatar/README.md +52 -0
- package/dist/avatar/count/avatar-count.svelte +56 -0
- package/dist/avatar/count/avatar-count.svelte.d.ts +4 -0
- package/dist/avatar/fallback/avatar-fallback.svelte +67 -0
- package/dist/avatar/fallback/avatar-fallback.svelte.d.ts +4 -0
- package/dist/avatar/group/avatar-group.svelte +65 -0
- package/dist/avatar/group/avatar-group.svelte.d.ts +4 -0
- package/dist/avatar/group/context.d.ts +15 -0
- package/dist/avatar/group/context.js +15 -0
- package/dist/avatar/image/avatar-image.svelte +104 -0
- package/dist/avatar/image/avatar-image.svelte.d.ts +4 -0
- package/dist/avatar/index.d.ts +22 -0
- package/dist/avatar/index.js +10 -0
- package/dist/avatar/index.parts.d.ts +5 -0
- package/dist/avatar/index.parts.js +5 -0
- package/dist/avatar/root/avatar-root.svelte +79 -0
- package/dist/avatar/root/avatar-root.svelte.d.ts +4 -0
- package/dist/avatar/root/context.d.ts +14 -0
- package/dist/avatar/root/context.js +15 -0
- package/dist/avatar/types.d.ts +84 -0
- package/dist/avatar/types.js +1 -0
- package/dist/breadcrumbs/README.md +65 -0
- package/dist/breadcrumbs/ellipsis/breadcrumbs-ellipsis.svelte +62 -0
- package/dist/breadcrumbs/ellipsis/breadcrumbs-ellipsis.svelte.d.ts +4 -0
- package/dist/breadcrumbs/index.d.ts +23 -0
- package/dist/breadcrumbs/index.js +10 -0
- package/dist/breadcrumbs/index.parts.d.ts +6 -0
- package/dist/breadcrumbs/index.parts.js +6 -0
- package/dist/breadcrumbs/item/breadcrumbs-item.svelte +42 -0
- package/dist/breadcrumbs/item/breadcrumbs-item.svelte.d.ts +4 -0
- package/dist/breadcrumbs/link/breadcrumbs-link.svelte +47 -0
- package/dist/breadcrumbs/link/breadcrumbs-link.svelte.d.ts +4 -0
- package/dist/breadcrumbs/list/breadcrumbs-list.svelte +31 -0
- package/dist/breadcrumbs/list/breadcrumbs-list.svelte.d.ts +4 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.svelte +112 -0
- package/dist/breadcrumbs/root/breadcrumbs-root.svelte.d.ts +4 -0
- package/dist/breadcrumbs/root/context.d.ts +19 -0
- package/dist/breadcrumbs/root/context.js +15 -0
- package/dist/breadcrumbs/separator/breadcrumbs-separator.svelte +35 -0
- package/dist/breadcrumbs/separator/breadcrumbs-separator.svelte.d.ts +4 -0
- package/dist/breadcrumbs/types.d.ts +80 -0
- package/dist/breadcrumbs/types.js +1 -0
- package/dist/button/README.md +1 -1
- package/dist/button/root/button-root.svelte +37 -7
- package/dist/button/root/button-root.svelte.d.ts +19 -4
- package/dist/calendar/README.md +3 -3
- package/dist/calendar/body-cell/calendar-body-cell.svelte +7 -0
- package/dist/calendar/grid-header/calendar-grid-header.svelte +3 -4
- package/dist/calendar/grid-header/calendar-grid-header.svelte.d.ts +3 -4
- package/dist/calendar/root/calendar-root.svelte +8 -2
- package/dist/calendar/root/calendar-root.svelte.d.ts +8 -2
- package/dist/calendar/trigger-next/README.md +1 -1
- package/dist/calendar/trigger-previous/README.md +1 -1
- package/dist/checkbox/README.md +1 -1
- package/dist/checkbox/indicator/README.md +1 -1
- package/dist/checkbox/indicator/checkbox-indicator.svelte +1 -0
- package/dist/checkbox/indicator/checkbox-indicator.svelte.d.ts +1 -0
- package/dist/checkbox/root/README.md +2 -2
- package/dist/checkbox/root/checkbox-root.svelte +118 -40
- package/dist/checkbox/root/checkbox-root.svelte.d.ts +17 -10
- package/dist/checkbox-group/README.md +95 -0
- package/dist/checkbox-group/index.d.ts +15 -0
- package/dist/checkbox-group/index.js +6 -0
- package/dist/checkbox-group/index.parts.d.ts +4 -0
- package/dist/checkbox-group/index.parts.js +7 -0
- package/dist/checkbox-group/label/checkbox-group-label.svelte +36 -0
- package/dist/checkbox-group/label/checkbox-group-label.svelte.d.ts +4 -0
- package/dist/checkbox-group/root/checkbox-group-root.svelte +118 -0
- package/dist/checkbox-group/root/checkbox-group-root.svelte.d.ts +4 -0
- package/dist/checkbox-group/root/context.svelte.d.ts +52 -0
- package/dist/checkbox-group/root/context.svelte.js +251 -0
- package/dist/checkbox-group/types.d.ts +57 -0
- package/dist/checkbox-group/types.js +1 -0
- package/dist/clock/README.md +3 -3
- package/dist/clock/axis/README.md +1 -1
- package/dist/clock/root/README.md +1 -1
- package/dist/clock/wheel-column/clock-wheel-column.svelte +1 -1
- package/dist/clock/wheel-column/clock-wheel-column.svelte.d.ts +1 -1
- package/dist/collapsible/README.md +3 -3
- package/dist/collapsible/types.d.ts +10 -7
- package/dist/combobox/README.md +2 -2
- package/dist/combobox/button/README.md +6 -6
- package/dist/combobox/input/README.md +1 -1
- package/dist/combobox/input/combobox-input.svelte +3 -3
- package/dist/combobox/input/combobox-input.svelte.d.ts +3 -3
- package/dist/combobox/item/combobox-listboxitem.svelte +4 -2
- package/dist/combobox/item/combobox-listboxitem.svelte.d.ts +4 -2
- package/dist/combobox/item-indicator/README.md +1 -1
- package/dist/combobox/item-indicator/combobox-item-indicator.svelte +2 -2
- package/dist/combobox/item-indicator/combobox-item-indicator.svelte.d.ts +2 -2
- package/dist/combobox/list/combobox-listbox.svelte +11 -8
- package/dist/combobox/list/combobox-listbox.svelte.d.ts +14 -9
- package/dist/combobox/popover/README.md +1 -1
- package/dist/combobox/popover/combobox-popover.svelte +4 -56
- package/dist/combobox/root/README.md +24 -24
- package/dist/combobox/root/combobox.svelte +26 -17
- package/dist/combobox/root/combobox.svelte.d.ts +26 -17
- package/dist/combobox/status/README.md +1 -1
- package/dist/combobox/status/combobox-status.svelte +1 -1
- package/dist/combobox/status/combobox-status.svelte.d.ts +1 -1
- package/dist/combobox/tag/README.md +1 -1
- package/dist/combobox/tag/combobox-tag.svelte +1 -1
- package/dist/combobox/tag/combobox-tag.svelte.d.ts +1 -1
- package/dist/combobox/tag-remove/README.md +1 -1
- package/dist/combobox/tag-remove/combobox-tag-remove.svelte +4 -5
- package/dist/combobox/tag-remove/combobox-tag-remove.svelte.d.ts +4 -5
- package/dist/combobox/tags/README.md +1 -1
- package/dist/combobox/tags/combobox-tags.svelte +11 -11
- package/dist/combobox/tags/combobox-tags.svelte.d.ts +11 -11
- package/dist/combobox/trigger/README.md +7 -7
- package/dist/datepicker/README.md +4 -4
- package/dist/datepicker/input/date-picker-input.svelte +3 -4
- package/dist/datepicker/input/date-picker-input.svelte.d.ts +3 -4
- package/dist/datepicker/root/date-picker-root.svelte +1 -1
- package/dist/datepicker/trigger/README.md +1 -1
- package/dist/daterangepicker/README.md +3 -3
- package/dist/daterangepicker/input/date-range-picker-input.svelte +3 -4
- package/dist/daterangepicker/input/date-range-picker-input.svelte.d.ts +3 -4
- package/dist/dialog/README.md +1 -1
- package/dist/dialog/close/dialog-close.svelte +3 -3
- package/dist/dialog/close/dialog-close.svelte.d.ts +3 -3
- package/dist/dialog/content/dialog-content.svelte +4 -4
- package/dist/dialog/content/dialog-content.svelte.d.ts +4 -4
- package/dist/dialog/description/dialog-description.svelte +3 -3
- package/dist/dialog/description/dialog-description.svelte.d.ts +3 -3
- package/dist/dialog/overlay/dialog-overlay.svelte +1 -1
- package/dist/dialog/overlay/dialog-overlay.svelte.d.ts +1 -1
- package/dist/dialog/portal/dialog-portal.svelte +1 -1
- package/dist/dialog/portal/dialog-portal.svelte.d.ts +1 -1
- package/dist/dialog/root/README.md +1 -1
- package/dist/dialog/root/dialog-root.svelte +49 -11
- package/dist/dialog/root/dialog-root.svelte.d.ts +11 -9
- package/dist/dialog/title/dialog-title.svelte +3 -3
- package/dist/dialog/title/dialog-title.svelte.d.ts +3 -3
- package/dist/dialog/trigger/README.md +1 -1
- package/dist/drawer/README.md +3 -3
- package/dist/drawer/body/drawer-body.svelte +2 -2
- package/dist/drawer/body/drawer-body.svelte.d.ts +2 -2
- package/dist/drawer/close/drawer-close.svelte +3 -3
- package/dist/drawer/close/drawer-close.svelte.d.ts +3 -3
- package/dist/drawer/content/drawer-content.svelte +12 -9
- package/dist/drawer/content/drawer-content.svelte.d.ts +12 -9
- package/dist/drawer/description/drawer-description.svelte +3 -3
- package/dist/drawer/description/drawer-description.svelte.d.ts +3 -3
- package/dist/drawer/indent/drawer-indent-background.svelte +1 -1
- package/dist/drawer/indent/drawer-indent-background.svelte.d.ts +1 -1
- package/dist/drawer/indent/drawer-indent.svelte +2 -2
- package/dist/drawer/indent/drawer-indent.svelte.d.ts +2 -2
- package/dist/drawer/overlay/drawer-overlay.svelte +1 -1
- package/dist/drawer/overlay/drawer-overlay.svelte.d.ts +1 -1
- package/dist/drawer/portal/drawer-portal.svelte +1 -1
- package/dist/drawer/portal/drawer-portal.svelte.d.ts +1 -1
- package/dist/drawer/root/context.d.ts +1 -1
- package/dist/drawer/root/drawer-root.svelte +40 -25
- package/dist/drawer/root/drawer-root.svelte.d.ts +25 -23
- package/dist/drawer/swipe-area/drawer-swipe-area.svelte +3 -3
- package/dist/drawer/swipe-area/drawer-swipe-area.svelte.d.ts +3 -3
- package/dist/drawer/title/drawer-title.svelte +3 -3
- package/dist/drawer/title/drawer-title.svelte.d.ts +3 -3
- package/dist/drawer/trigger/drawer-trigger.svelte +6 -6
- package/dist/drawer/trigger/drawer-trigger.svelte.d.ts +6 -6
- package/dist/drawer/viewport/drawer-viewport.svelte +2 -2
- package/dist/drawer/viewport/drawer-viewport.svelte.d.ts +2 -2
- package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte +1 -1
- package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte.d.ts +1 -1
- package/dist/dropzone/README.md +4 -6
- package/dist/index.d.ts +22 -0
- package/dist/index.js +21 -0
- package/dist/input/input.svelte +6 -6
- package/dist/input/input.svelte.d.ts +6 -6
- package/dist/internal/environment.d.ts +11 -0
- package/dist/internal/environment.js +14 -0
- package/dist/internal/localized-strings.d.ts +152 -0
- package/dist/internal/localized-strings.js +152 -0
- package/dist/internal/number-precision.d.ts +9 -0
- package/dist/internal/number-precision.js +27 -0
- package/dist/listbox/README.md +20 -1
- package/dist/listbox/item/listbox-item.svelte +35 -17
- package/dist/listbox/item/listbox-item.svelte.d.ts +24 -15
- package/dist/listbox/root/README.md +1 -1
- package/dist/listbox/root/context.d.ts +26 -1
- package/dist/listbox/root/context.js +108 -1
- package/dist/listbox/root/listbox.svelte +129 -39
- package/dist/listbox/root/listbox.svelte.d.ts +57 -33
- package/dist/locale-provider/README.md +1 -6
- package/dist/menu/README.md +41 -4
- package/dist/menu/content/menu-content.svelte +28 -13
- package/dist/menu/content/menu-content.svelte.d.ts +14 -9
- package/dist/menu/context-trigger/menu-context-trigger.svelte +194 -0
- package/dist/menu/context-trigger/menu-context-trigger.svelte.d.ts +35 -0
- package/dist/menu/group/menu-group-label.svelte +1 -1
- package/dist/menu/group/menu-group-label.svelte.d.ts +1 -1
- package/dist/menu/index.d.ts +4 -1
- package/dist/menu/index.js +1 -0
- package/dist/menu/index.parts.d.ts +1 -0
- package/dist/menu/index.parts.js +1 -0
- package/dist/menu/item/menu-item.svelte +11 -8
- package/dist/menu/item/menu-item.svelte.d.ts +11 -8
- package/dist/menu/overlay/menu-overlay.svelte +1 -1
- package/dist/menu/overlay/menu-overlay.svelte.d.ts +1 -1
- package/dist/menu/root/context.d.ts +24 -3
- package/dist/menu/root/focus-state.d.ts +2 -2
- package/dist/menu/root/focus-state.js +8 -32
- package/dist/menu/root/menu-root.svelte +14 -8
- package/dist/menu/root/menu-root.svelte.d.ts +14 -8
- package/dist/menu/root/menu-state.svelte.d.ts +1 -1
- package/dist/menu/root/menu-state.svelte.js +24 -1
- package/dist/menu/separator/menu-separator.svelte +1 -1
- package/dist/menu/separator/menu-separator.svelte.d.ts +1 -1
- package/dist/menu/submenu/menu-submenu-root.svelte +10 -7
- package/dist/menu/submenu/menu-submenu-root.svelte.d.ts +10 -7
- package/dist/numberfield/root/README.md +1 -1
- package/dist/numberfield/root/number-utils.js +1 -20
- package/dist/numberfield/scrub-area-cursor/README.md +1 -1
- package/dist/popover/README.md +1 -1
- package/dist/popover/content/popover-content.svelte +21 -15
- package/dist/popover/content/popover-content.svelte.d.ts +19 -14
- package/dist/popover/overlay/popover-overlay.svelte +1 -1
- package/dist/popover/overlay/popover-overlay.svelte.d.ts +1 -1
- package/dist/popover/root/README.md +1 -1
- package/dist/popover/root/focus-state.d.ts +2 -2
- package/dist/popover/root/focus-state.js +7 -34
- package/dist/popover/root/popover-root.svelte +13 -10
- package/dist/popover/root/popover-root.svelte.d.ts +13 -10
- package/dist/popover/trigger/README.md +1 -1
- package/dist/primitives/aria-hide-outside.d.ts +13 -0
- package/dist/primitives/aria-hide-outside.js +7 -1
- package/dist/primitives/contain-wheel.d.ts +9 -0
- package/dist/primitives/contain-wheel.js +41 -0
- package/dist/primitives/floating.d.ts +42 -8
- package/dist/primitives/floating.js +70 -6
- package/dist/primitives/focus-trap.d.ts +2 -0
- package/dist/primitives/focus-trap.js +7 -1
- package/dist/primitives/focus-visible.svelte.d.ts +14 -0
- package/dist/primitives/focus-visible.svelte.js +19 -0
- package/dist/primitives/index.d.ts +2 -0
- package/dist/primitives/index.js +2 -0
- package/dist/primitives/input-modality.d.ts +7 -0
- package/dist/primitives/input-modality.js +32 -5
- package/dist/primitives/keyboard-navigation.d.ts +29 -5
- package/dist/primitives/keyboard-navigation.js +24 -16
- package/dist/primitives/long-press.d.ts +59 -0
- package/dist/primitives/long-press.js +142 -0
- package/dist/primitives/presence.svelte.js +6 -1
- package/dist/primitives/scroll-lock.d.ts +24 -0
- package/dist/primitives/scroll-lock.js +75 -6
- package/dist/primitives/trigger-focus-state.d.ts +29 -0
- package/dist/primitives/trigger-focus-state.js +57 -0
- package/dist/progress/README.md +54 -0
- package/dist/progress/index.d.ts +21 -0
- package/dist/progress/index.js +9 -0
- package/dist/progress/index.parts.d.ts +5 -0
- package/dist/progress/index.parts.js +5 -0
- package/dist/progress/indicator/progress-indicator.svelte +37 -0
- package/dist/progress/indicator/progress-indicator.svelte.d.ts +4 -0
- package/dist/progress/label/progress-label.svelte +34 -0
- package/dist/progress/label/progress-label.svelte.d.ts +4 -0
- package/dist/progress/root/context.d.ts +26 -0
- package/dist/progress/root/context.js +15 -0
- package/dist/progress/root/progress-root.svelte +136 -0
- package/dist/progress/root/progress-root.svelte.d.ts +4 -0
- package/dist/progress/root/progress-utils.d.ts +12 -0
- package/dist/progress/root/progress-utils.js +41 -0
- package/dist/progress/track/progress-track.svelte +27 -0
- package/dist/progress/track/progress-track.svelte.d.ts +4 -0
- package/dist/progress/types.d.ts +81 -0
- package/dist/progress/types.js +1 -0
- package/dist/progress/value/progress-value.svelte +36 -0
- package/dist/progress/value/progress-value.svelte.d.ts +4 -0
- package/dist/radio-group/README.md +103 -0
- package/dist/radio-group/index.d.ts +18 -0
- package/dist/radio-group/index.js +9 -0
- package/dist/radio-group/index.parts.d.ts +4 -0
- package/dist/radio-group/index.parts.js +4 -0
- package/dist/radio-group/indicator/radio-group-indicator.svelte +43 -0
- package/dist/radio-group/indicator/radio-group-indicator.svelte.d.ts +12 -0
- package/dist/radio-group/item/context.d.ts +18 -0
- package/dist/radio-group/item/context.js +15 -0
- package/dist/radio-group/item/radio-group-item.svelte +377 -0
- package/dist/radio-group/item/radio-group-item.svelte.d.ts +35 -0
- package/dist/radio-group/label/radio-group-label.svelte +37 -0
- package/dist/radio-group/label/radio-group-label.svelte.d.ts +4 -0
- package/dist/radio-group/root/context.svelte.d.ts +57 -0
- package/dist/radio-group/root/context.svelte.js +284 -0
- package/dist/radio-group/root/radio-group-root.svelte +193 -0
- package/dist/radio-group/root/radio-group-root.svelte.d.ts +4 -0
- package/dist/radio-group/types.d.ts +50 -0
- package/dist/radio-group/types.js +1 -0
- package/dist/select/README.md +129 -0
- package/dist/select/index.d.ts +30 -0
- package/dist/select/index.js +16 -0
- package/dist/select/index.parts.d.ts +8 -0
- package/dist/select/index.parts.js +9 -0
- package/dist/select/item/select-item.svelte +68 -0
- package/dist/select/item/select-item.svelte.d.ts +10 -0
- package/dist/select/item-indicator/select-item-indicator.svelte +55 -0
- package/dist/select/item-indicator/select-item-indicator.svelte.d.ts +4 -0
- package/dist/select/label/select-label.svelte +46 -0
- package/dist/select/label/select-label.svelte.d.ts +4 -0
- package/dist/select/list/select-list.svelte +241 -0
- package/dist/select/list/select-list.svelte.d.ts +62 -0
- package/dist/select/popover/select-popover.svelte +80 -0
- package/dist/select/popover/select-popover.svelte.d.ts +9 -0
- package/dist/select/root/context.d.ts +106 -0
- package/dist/select/root/context.js +22 -0
- package/dist/select/root/select-root.svelte +544 -0
- package/dist/select/root/select-root.svelte.d.ts +25 -0
- package/dist/select/trigger/select-trigger.svelte +192 -0
- package/dist/select/trigger/select-trigger.svelte.d.ts +4 -0
- package/dist/select/types.d.ts +133 -0
- package/dist/select/types.js +1 -0
- package/dist/select/value/select-value.svelte +61 -0
- package/dist/select/value/select-value.svelte.d.ts +4 -0
- package/dist/separator/README.md +35 -0
- package/dist/separator/index.d.ts +7 -0
- package/dist/separator/index.js +3 -0
- package/dist/separator/separator.svelte +254 -0
- package/dist/separator/separator.svelte.d.ts +45 -0
- package/dist/separator/types.d.ts +1 -0
- package/dist/separator/types.js +1 -0
- package/dist/slider/README.md +61 -0
- package/dist/slider/fill/slider-fill.svelte +40 -0
- package/dist/slider/fill/slider-fill.svelte.d.ts +4 -0
- package/dist/slider/index.d.ts +9 -0
- package/dist/slider/index.js +8 -0
- package/dist/slider/index.parts.d.ts +6 -0
- package/dist/slider/index.parts.js +6 -0
- package/dist/slider/label/slider-label.svelte +44 -0
- package/dist/slider/label/slider-label.svelte.d.ts +4 -0
- package/dist/slider/output/slider-output.svelte +46 -0
- package/dist/slider/output/slider-output.svelte.d.ts +4 -0
- package/dist/slider/root/context.d.ts +106 -0
- package/dist/slider/root/context.js +15 -0
- package/dist/slider/root/slider-root.svelte +545 -0
- package/dist/slider/root/slider-root.svelte.d.ts +4 -0
- package/dist/slider/root/slider-utils.d.ts +57 -0
- package/dist/slider/root/slider-utils.js +88 -0
- package/dist/slider/thumb/slider-thumb.svelte +276 -0
- package/dist/slider/thumb/slider-thumb.svelte.d.ts +4 -0
- package/dist/slider/track/slider-track.svelte +60 -0
- package/dist/slider/track/slider-track.svelte.d.ts +4 -0
- package/dist/slider/types.d.ts +144 -0
- package/dist/slider/types.js +1 -0
- package/dist/switch/root/README.md +2 -2
- package/dist/switch/root/switch-root.svelte +32 -18
- package/dist/switch/root/switch-root.svelte.d.ts +23 -18
- package/dist/switch/thumb/switch-thumb.svelte +1 -1
- package/dist/switch/thumb/switch-thumb.svelte.d.ts +1 -1
- package/dist/table/README.md +16 -9
- package/dist/table/cell/table-cell.svelte +27 -8
- package/dist/table/checkbox/table-checkbox.svelte +3 -0
- package/dist/table/checkbox-indicator/README.md +1 -1
- package/dist/table/column-header-cell/table-column-header-cell.svelte +24 -0
- package/dist/table/column-resizer/README.md +2 -2
- package/dist/table/index.d.ts +1 -1
- package/dist/table/index.js +1 -1
- package/dist/table/interactive-cell/table-interactive-cell.svelte +26 -8
- package/dist/table/root/README.md +1 -1
- package/dist/table/root/context.svelte.d.ts +17 -0
- package/dist/table/root/context.svelte.js +113 -17
- package/dist/table/root/table-root.svelte +36 -6
- package/dist/table/row/table-row.svelte +7 -7
- package/dist/table/sort-trigger/README.md +1 -1
- package/dist/table/types.d.ts +26 -14
- package/dist/tabs/types.d.ts +6 -6
- package/dist/timepicker/README.md +3 -2
- package/dist/timepicker/input/README.md +1 -1
- package/dist/timepicker/input/time-picker-input.svelte +66 -5
- package/dist/timepicker/input/time-picker-input.svelte.d.ts +18 -1
- package/dist/timepicker/root/README.md +1 -1
- package/dist/timepicker/trigger/README.md +1 -1
- package/dist/toast/README.md +75 -0
- package/dist/toast/action/toast-action.svelte +42 -0
- package/dist/toast/action/toast-action.svelte.d.ts +4 -0
- package/dist/toast/close/toast-close.svelte +41 -0
- package/dist/toast/close/toast-close.svelte.d.ts +4 -0
- package/dist/toast/content/toast-content.svelte +24 -0
- package/dist/toast/content/toast-content.svelte.d.ts +4 -0
- package/dist/toast/description/toast-description.svelte +41 -0
- package/dist/toast/description/toast-description.svelte.d.ts +4 -0
- package/dist/toast/index.d.ts +34 -0
- package/dist/toast/index.js +15 -0
- package/dist/toast/index.parts.d.ts +9 -0
- package/dist/toast/index.parts.js +9 -0
- package/dist/toast/positioner/toast-positioner.svelte +75 -0
- package/dist/toast/positioner/toast-positioner.svelte.d.ts +4 -0
- package/dist/toast/provider/context.d.ts +36 -0
- package/dist/toast/provider/context.js +22 -0
- package/dist/toast/provider/toast-manager.svelte.d.ts +113 -0
- package/dist/toast/provider/toast-manager.svelte.js +210 -0
- package/dist/toast/provider/toast-provider.svelte +98 -0
- package/dist/toast/provider/toast-provider.svelte.d.ts +4 -0
- package/dist/toast/root/context.d.ts +18 -0
- package/dist/toast/root/context.js +15 -0
- package/dist/toast/root/toast-root.svelte +296 -0
- package/dist/toast/root/toast-root.svelte.d.ts +4 -0
- package/dist/toast/title/toast-title.svelte +38 -0
- package/dist/toast/title/toast-title.svelte.d.ts +4 -0
- package/dist/toast/types.d.ts +100 -0
- package/dist/toast/types.js +1 -0
- package/dist/toast/viewport/toast-viewport.svelte +389 -0
- package/dist/toast/viewport/toast-viewport.svelte.d.ts +4 -0
- package/dist/toggle/README.md +1 -1
- package/dist/toggle/root/toggle-root.svelte +28 -0
- package/dist/toggle/root/toggle-root.svelte.d.ts +19 -0
- package/dist/toggle-group/README.md +12 -4
- package/dist/toggle-group/index.d.ts +2 -0
- package/dist/toggle-group/index.parts.d.ts +1 -0
- package/dist/toggle-group/index.parts.js +4 -0
- package/dist/toggle-group/root/context.svelte.d.ts +1 -1
- package/dist/toggle-group/root/context.svelte.js +20 -11
- package/dist/toggle-group/root/toggle-group-root.svelte +20 -15
- package/dist/toggle-group/root/toggle-group-teardown-order-child.svelte +13 -0
- package/dist/toggle-group/root/toggle-group-teardown-order-child.svelte.d.ts +7 -0
- package/dist/toggle-group/types.d.ts +9 -9
- package/dist/tooltip/README.md +53 -0
- package/dist/tooltip/arrow/tooltip-arrow.svelte +36 -0
- package/dist/tooltip/arrow/tooltip-arrow.svelte.d.ts +4 -0
- package/dist/tooltip/content/tooltip-content.svelte +148 -0
- package/dist/tooltip/content/tooltip-content.svelte.d.ts +4 -0
- package/dist/tooltip/index.d.ts +8 -0
- package/dist/tooltip/index.js +7 -0
- package/dist/tooltip/index.parts.d.ts +5 -0
- package/dist/tooltip/index.parts.js +5 -0
- package/dist/tooltip/provider/tooltip-provider.svelte +36 -0
- package/dist/tooltip/provider/tooltip-provider.svelte.d.ts +4 -0
- package/dist/tooltip/root/context.d.ts +46 -0
- package/dist/tooltip/root/context.js +22 -0
- package/dist/tooltip/root/safe-polygon.d.ts +26 -0
- package/dist/tooltip/root/safe-polygon.js +66 -0
- package/dist/tooltip/root/tooltip-group.d.ts +26 -0
- package/dist/tooltip/root/tooltip-group.js +41 -0
- package/dist/tooltip/root/tooltip-root.svelte +459 -0
- package/dist/tooltip/root/tooltip-root.svelte.d.ts +4 -0
- package/dist/tooltip/trigger/tooltip-trigger.svelte +52 -0
- package/dist/tooltip/trigger/tooltip-trigger.svelte.d.ts +4 -0
- package/dist/tooltip/types.d.ts +105 -0
- package/dist/tooltip/types.js +1 -0
- package/dist/transfer-list/README.md +110 -0
- package/dist/transfer-list/index.d.ts +33 -0
- package/dist/transfer-list/index.js +18 -0
- package/dist/transfer-list/index.parts.d.ts +9 -0
- package/dist/transfer-list/index.parts.js +10 -0
- package/dist/transfer-list/item/transfer-list-item.svelte +74 -0
- package/dist/transfer-list/item/transfer-list-item.svelte.d.ts +35 -0
- package/dist/transfer-list/list/transfer-list-list.svelte +162 -0
- package/dist/transfer-list/list/transfer-list-list.svelte.d.ts +56 -0
- package/dist/transfer-list/list/transfer-list-source.svelte +13 -0
- package/dist/transfer-list/list/transfer-list-source.svelte.d.ts +36 -0
- package/dist/transfer-list/list/transfer-list-target.svelte +14 -0
- package/dist/transfer-list/list/transfer-list-target.svelte.d.ts +36 -0
- package/dist/transfer-list/move/transfer-list-move-all.svelte +14 -0
- package/dist/transfer-list/move/transfer-list-move-all.svelte.d.ts +10 -0
- package/dist/transfer-list/move/transfer-list-move-button.svelte +103 -0
- package/dist/transfer-list/move/transfer-list-move-button.svelte.d.ts +25 -0
- package/dist/transfer-list/move/transfer-list-move-down.svelte +14 -0
- package/dist/transfer-list/move/transfer-list-move-down.svelte.d.ts +10 -0
- package/dist/transfer-list/move/transfer-list-move-selected.svelte +14 -0
- package/dist/transfer-list/move/transfer-list-move-selected.svelte.d.ts +10 -0
- package/dist/transfer-list/move/transfer-list-move-up.svelte +14 -0
- package/dist/transfer-list/move/transfer-list-move-up.svelte.d.ts +10 -0
- package/dist/transfer-list/move/transfer-list-reorder-button.svelte +83 -0
- package/dist/transfer-list/move/transfer-list-reorder-button.svelte.d.ts +21 -0
- package/dist/transfer-list/root/context.d.ts +70 -0
- package/dist/transfer-list/root/context.js +24 -0
- package/dist/transfer-list/root/transfer-list-root.svelte +345 -0
- package/dist/transfer-list/root/transfer-list-root.svelte.d.ts +68 -0
- package/dist/transfer-list/root/types.d.ts +22 -0
- package/dist/transfer-list/root/types.js +4 -0
- package/dist/transfer-list/status/transfer-list-status.svelte +70 -0
- package/dist/transfer-list/status/transfer-list-status.svelte.d.ts +15 -0
- package/dist/tree/README.md +3 -3
- package/dist/tree/checkbox-indicator/README.md +1 -1
- package/dist/tree/root/README.md +1 -1
- package/dist/tree/types.d.ts +19 -10
- package/package.json +56 -1
package/dist/clock/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Description
|
|
4
4
|
|
|
5
|
-
`Clock`
|
|
5
|
+
`Clock` is a time picker with wheels. Each wheel is a spinbutton column for the hour, the minute, the second, or the day period. Use it alone, or put it in a `TimePicker` with `TimePicker.Clock`.
|
|
6
6
|
|
|
7
7
|
## Anatomy
|
|
8
8
|
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</Clock.Root>
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
If you give no `column` snippet, the component makes the default columns:
|
|
28
28
|
|
|
29
29
|
```svelte
|
|
30
30
|
<Clock.Root value="09:00" granularity="minute" hourCycle={24} />
|
|
@@ -69,7 +69,7 @@ Visible columns are resolved automatically in stable order: `hour → minute?
|
|
|
69
69
|
|
|
70
70
|
## Notes
|
|
71
71
|
|
|
72
|
-
- `Clock.WheelColumn` needs an explicit height (it is an `overflow-y: auto` scroll container). Without a height class it
|
|
72
|
+
- `Clock.WheelColumn` needs an explicit height (it is an `overflow-y: auto` scroll container). Without a height class, it uses the Tailwind utility `h-55` (`13.75rem`). That class works only in a Tailwind project. Without Tailwind, set the height yourself. Read the WheelColumn README.
|
|
73
73
|
- Locale is read from `LocaleProvider` when available.
|
|
74
74
|
- Internally, values are normalized to 24-hour representation; 12-hour rendering only affects UI segments.
|
|
75
75
|
- `granularity='hour'` emits `HH:00` values.
|
|
@@ -17,7 +17,7 @@ Description: Visual overlay band for `Clock.Root`; it is presentational (`aria-h
|
|
|
17
17
|
### Context utilities
|
|
18
18
|
|
|
19
19
|
Name: `useClockContext`
|
|
20
|
-
Description:
|
|
20
|
+
Description: Makes sure that `Clock.Axis` is in a `Clock.Root`.
|
|
21
21
|
|
|
22
22
|
| Prop | Type | Default | Description |
|
|
23
23
|
| ----------------- | -------------------- | ------- | ------------------------------------------------ |
|
|
@@ -22,7 +22,7 @@ Description: Standalone wheel-based time state container that resolves visible c
|
|
|
22
22
|
| `disabled` | `boolean` | `false` | Disables wheel interaction and value updates. |
|
|
23
23
|
| `column` | `Snippet<[ClockColumnInfo]>` | `undefined` | Optional custom renderer for each resolved column. |
|
|
24
24
|
| `children` | `Snippet` | `undefined` | Optional additional content rendered inside the root. |
|
|
25
|
-
| `class` | `string` | `''` | CSS class names
|
|
25
|
+
| `class` | `string` | `''` | The CSS class names of the root element. |
|
|
26
26
|
| `element` | `HTMLDivElement \| null` | `bindable` | Reference to the root DOM element. |
|
|
27
27
|
| `aria-label` | `string` | `undefined` | Accessible label for the root group. |
|
|
28
28
|
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
| 'onclick'
|
|
32
32
|
> & {
|
|
33
33
|
type: ClockEditableSegmentType;
|
|
34
|
-
/**
|
|
34
|
+
/** It receives the option, and a boolean that is true for the selected value of the column. */
|
|
35
35
|
children?: Snippet<[TimePickerWheelOption, boolean]>;
|
|
36
36
|
class?: string;
|
|
37
37
|
'aria-label'?: string;
|
|
@@ -8,7 +8,7 @@ type TimePickerWheelOption = {
|
|
|
8
8
|
};
|
|
9
9
|
type TimePickerWheelColumnProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class' | 'role' | 'tabindex' | 'aria-label' | 'onkeydown' | 'onfocusin' | 'onfocusout' | 'onmousedown' | 'onclick'> & {
|
|
10
10
|
type: ClockEditableSegmentType;
|
|
11
|
-
/**
|
|
11
|
+
/** It receives the option, and a boolean that is true for the selected value of the column. */
|
|
12
12
|
children?: Snippet<[TimePickerWheelOption, boolean]>;
|
|
13
13
|
class?: string;
|
|
14
14
|
'aria-label'?: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Description
|
|
4
4
|
|
|
5
|
-
`Collapsible` is a headless
|
|
5
|
+
`Collapsible` is a headless disclosure component: a button that shows and hides one panel. You can control the open state, or the component can control it. It also has a disabled state.
|
|
6
6
|
|
|
7
7
|
## Anatomy
|
|
8
8
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
## Usage Guidelines
|
|
21
21
|
|
|
22
22
|
- Use `open` / `onOpenChange` for controlled state and `defaultOpen` for uncontrolled state.
|
|
23
|
-
- Use `disabled` to
|
|
23
|
+
- Use `disabled` to stop the trigger. It cannot open or close the panel.
|
|
24
24
|
- Use `forceMount` on `Collapsible.Panel` when collapsed content must stay in the DOM.
|
|
25
25
|
- For grouped disclosures where only one section opens at a time, use `Accordion` instead.
|
|
26
26
|
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
|
|
29
29
|
- `Collapsible.Trigger` renders button semantics with `aria-expanded` and `aria-controls` pointing at the panel, following the WAI-ARIA disclosure pattern.
|
|
30
30
|
- `Collapsible.Panel` is `hidden` + `inert` while collapsed and carries the `id` referenced by the trigger.
|
|
31
|
-
- Enter
|
|
31
|
+
- The `Enter` key and the `Space` key open and close the panel, like a native button.
|
|
@@ -3,15 +3,15 @@ import type { HTMLAttributes, HTMLButtonAttributes } from 'svelte/elements';
|
|
|
3
3
|
import type { CollapsibleContext } from './root/context.js';
|
|
4
4
|
export type { CollapsibleContext } from './root/context.js';
|
|
5
5
|
export type CollapsibleRootProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class'> & {
|
|
6
|
-
/**
|
|
6
|
+
/** The open state. By default it goes in the two directions: use `bind:open`. */
|
|
7
7
|
open?: boolean;
|
|
8
|
-
/**
|
|
8
|
+
/** The open state at the start, for when you give no `open`. */
|
|
9
9
|
defaultOpen?: boolean;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* Give your own code full control of the open state. The component stops to write back to `open`,
|
|
12
|
+
* and it reports only through `onOpenChange`. Thus the parent can refuse a change: the parent
|
|
13
|
+
* does not send the new value down. The default is off, because `bind:open` is the usual case and
|
|
14
|
+
* it needs the write-back.
|
|
15
15
|
*/
|
|
16
16
|
controlledOpen?: boolean;
|
|
17
17
|
onOpenChange?: (open: boolean) => void;
|
|
@@ -28,7 +28,10 @@ export type CollapsibleTriggerProps = Omit<HTMLButtonAttributes, 'children' | 'c
|
|
|
28
28
|
element?: HTMLButtonElement | null;
|
|
29
29
|
};
|
|
30
30
|
export type CollapsiblePanelProps = Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'class' | 'hidden'> & {
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Keep the closed panel in the DOM, and hidden. Without it, the panel leaves the DOM after the
|
|
33
|
+
* exit animation.
|
|
34
|
+
*/
|
|
32
35
|
forceMount?: boolean;
|
|
33
36
|
children?: Snippet;
|
|
34
37
|
class?: string;
|
package/dist/combobox/README.md
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
- Use controlled props (`value`, `inputValue`, `open`) only when external state management is needed.
|
|
11
11
|
- Use `pending` on `ComboBox.Root` to expose async loading state on the root while keeping the rest of the composition under your control.
|
|
12
12
|
- Prefer `ComboBox.Trigger` in new code. `ComboBox.Button` remains available as a compatibility alias.
|
|
13
|
-
- Use `ComboBox.Clear` when you want a
|
|
13
|
+
- Use `ComboBox.Clear` when you want a control that removes the input text and the selected value together.
|
|
14
14
|
- Provide a stable `id` in SSR environments to keep ARIA ids deterministic.
|
|
15
15
|
- Render `ComboBox.Tags`, `ComboBox.Tag`, and `ComboBox.TagRemove` in multiple mode to expose selected values.
|
|
16
|
-
-
|
|
16
|
+
- Use `ComboBox.Status` to announce the number of the results to a screen reader when the filter changes. It is a hidden `aria-live="polite"` region. `LocaleProvider` localizes the default message, and the `formatMessage` prop replaces it. The region announces only while the popover is open.
|
|
17
17
|
- Choose `trigger="focus"`, `trigger="input"`, or `trigger="press"` based on your opening behavior requirements.
|
|
18
18
|
|
|
19
19
|
## Anatomy
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
Name: `ComboBox.Button`
|
|
8
8
|
Description: Compatibility alias for `ComboBox.Trigger`.
|
|
9
9
|
|
|
10
|
-
| Prop | Type | Default | Description
|
|
11
|
-
| -------------- | ---------------------- | ----------- |
|
|
12
|
-
| `class` | `string` | `undefined` | CSS class names
|
|
13
|
-
| `children` | `Snippet` | `undefined` |
|
|
14
|
-
| `tabindex` | `number` | `-1` | Tab index applied to the trigger button.
|
|
15
|
-
| `...restProps` | `HTMLButtonAttributes` | `-` | Additional native button attributes.
|
|
10
|
+
| Prop | Type | Default | Description |
|
|
11
|
+
| -------------- | ---------------------- | ----------- | --------------------------------------------------------------------------------------- |
|
|
12
|
+
| `class` | `string` | `undefined` | The CSS class names of the trigger element. |
|
|
13
|
+
| `children` | `Snippet` | `undefined` | Your own content for the trigger. If you give none, the component makes a chevron icon. |
|
|
14
|
+
| `tabindex` | `number` | `-1` | Tab index applied to the trigger button. |
|
|
15
|
+
| `...restProps` | `HTMLButtonAttributes` | `-` | Additional native button attributes. |
|
|
16
16
|
|
|
17
17
|
## Notes
|
|
18
18
|
|
|
@@ -12,5 +12,5 @@ Description: Text input with `role="combobox"` that syncs typed value, active de
|
|
|
12
12
|
| `aria-label` | `string` | `undefined` | Accessible label applied directly to the input. |
|
|
13
13
|
| `aria-labelledby` | `string` | `undefined` | Element id that labels the input. |
|
|
14
14
|
| `aria-describedby` | `string` | `undefined` | Element id that describes the input behavior. |
|
|
15
|
-
| `class` | `string` | `undefined` | CSS class names
|
|
15
|
+
| `class` | `string` | `undefined` | The CSS class names of the input element. |
|
|
16
16
|
| `...restProps` | `HTMLInputAttributes` | `-` | Additional native input attributes. |
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
} from '../../primitives/input-modality';
|
|
9
9
|
|
|
10
10
|
type ComboBoxInputProps = HTMLInputAttributes & {
|
|
11
|
-
/**
|
|
11
|
+
/** The accessible name of the input. */
|
|
12
12
|
'aria-label'?: string;
|
|
13
|
-
/**
|
|
13
|
+
/** The id of the element that gives this input its name. */
|
|
14
14
|
'aria-labelledby'?: string;
|
|
15
|
-
/**
|
|
15
|
+
/** The id of the element that describes this input, for example the instructions. */
|
|
16
16
|
'aria-describedby'?: string;
|
|
17
17
|
class?: string;
|
|
18
18
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
2
2
|
type ComboBoxInputProps = HTMLInputAttributes & {
|
|
3
|
-
/**
|
|
3
|
+
/** The accessible name of the input. */
|
|
4
4
|
'aria-label'?: string;
|
|
5
|
-
/**
|
|
5
|
+
/** The id of the element that gives this input its name. */
|
|
6
6
|
'aria-labelledby'?: string;
|
|
7
|
-
/**
|
|
7
|
+
/** The id of the element that describes this input, for example the instructions. */
|
|
8
8
|
'aria-describedby'?: string;
|
|
9
9
|
class?: string;
|
|
10
10
|
};
|
|
@@ -31,9 +31,11 @@
|
|
|
31
31
|
| 'scrollOnFocus'
|
|
32
32
|
| 'isParentDisabled'
|
|
33
33
|
> & {
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* The component calls it when the user activates this item as an action, and does not select it.
|
|
36
|
+
*/
|
|
35
37
|
onAction?: ComboBoxItemActionHandler;
|
|
36
|
-
/**
|
|
38
|
+
/** Closes the popover after the `onAction` function runs. */
|
|
37
39
|
closeOnAction?: boolean;
|
|
38
40
|
};
|
|
39
41
|
|
|
@@ -14,9 +14,11 @@ import { type ComboBoxItemActionHandler } from '../root/context';
|
|
|
14
14
|
* - Automatic filtering based on inputValue
|
|
15
15
|
*/
|
|
16
16
|
type ComboBoxListBoxItemProps = Omit<ComponentProps<typeof ListBoxItem>, 'customId' | 'disableFocusHandling' | 'isFocusedOverride' | 'onItemSelect' | 'onResolvedTextValue' | 'scrollOnFocus' | 'isParentDisabled'> & {
|
|
17
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* The component calls it when the user activates this item as an action, and does not select it.
|
|
19
|
+
*/
|
|
18
20
|
onAction?: ComboBoxItemActionHandler;
|
|
19
|
-
/**
|
|
21
|
+
/** Closes the popover after the `onAction` function runs. */
|
|
20
22
|
closeOnAction?: boolean;
|
|
21
23
|
};
|
|
22
24
|
declare const ComboboxListboxitem: import("svelte").Component<ComboBoxListBoxItemProps, {}, "">;
|
|
@@ -11,5 +11,5 @@ Description: Visual selection indicator rendered inside `ComboBox.Item`.
|
|
|
11
11
|
| -------------- | --------------------------------- | ------------ | ---------------------------------------------------- |
|
|
12
12
|
| `children` | `Snippet` | `check icon` | Custom indicator content. |
|
|
13
13
|
| `forceMount` | `boolean` | `false` | Forces rendering even when the item is not selected. |
|
|
14
|
-
| `class` | `string` | `undefined` | CSS class names
|
|
14
|
+
| `class` | `string` | `undefined` | The CSS class names of the indicator container. |
|
|
15
15
|
| `...restProps` | `HTMLAttributes<HTMLSpanElement>` | `-` | Additional attributes passed to the wrapper span. |
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* Only renders when the parent item is selected.
|
|
15
15
|
*/
|
|
16
16
|
type ComboBoxItemIndicatorProps = {
|
|
17
|
-
/**
|
|
17
|
+
/** The content while the item is selected. The default is a check mark icon. */
|
|
18
18
|
children?: Snippet;
|
|
19
|
-
/**
|
|
19
|
+
/** Keeps the indicator in the DOM, for each selection state. */
|
|
20
20
|
forceMount?: boolean;
|
|
21
21
|
class?: string;
|
|
22
22
|
} & Omit<HTMLAttributes<HTMLSpanElement>, 'class' | 'children'>;
|
|
@@ -6,9 +6,9 @@ import type { HTMLAttributes } from 'svelte/elements';
|
|
|
6
6
|
* Only renders when the parent item is selected.
|
|
7
7
|
*/
|
|
8
8
|
type ComboBoxItemIndicatorProps = {
|
|
9
|
-
/**
|
|
9
|
+
/** The content while the item is selected. The default is a check mark icon. */
|
|
10
10
|
children?: Snippet;
|
|
11
|
-
/**
|
|
11
|
+
/** Keeps the indicator in the DOM, for each selection state. */
|
|
12
12
|
forceMount?: boolean;
|
|
13
13
|
class?: string;
|
|
14
14
|
} & Omit<HTMLAttributes<HTMLSpanElement>, 'class' | 'children'>;
|
|
@@ -23,20 +23,23 @@
|
|
|
23
23
|
| 'items'
|
|
24
24
|
| 'id'
|
|
25
25
|
> & {
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The items, for a list that the component makes from an array. They replace the items of the
|
|
28
|
+
* ComboBox context.
|
|
29
|
+
*/
|
|
27
30
|
items?: Iterable<T>;
|
|
28
|
-
/**
|
|
31
|
+
/** The content of the listbox. From an array of items, it receives one item. */
|
|
29
32
|
children?: Snippet<[T]> | Snippet;
|
|
30
33
|
/**
|
|
31
|
-
*
|
|
32
|
-
* the
|
|
34
|
+
* Makes only the options near the viewport. The `virtualizer` prop of `ListBox` gives the two
|
|
35
|
+
* conditions: all of the rows have the same height, and the list is the element that scrolls.
|
|
33
36
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
+
* Without its own `items`, it uses the filtered items of the ComboBox. A list without a
|
|
38
|
+
* virtualizer filters one item at a time, and that cannot work when most of the items are not in
|
|
39
|
+
* the DOM.
|
|
37
40
|
*/
|
|
38
41
|
virtualizer?: { rowHeight?: number; overscan?: number };
|
|
39
|
-
/**
|
|
42
|
+
/** The rows in the listbox above the options, for example a "Create …" action. */
|
|
40
43
|
header?: Snippet;
|
|
41
44
|
};
|
|
42
45
|
|
|
@@ -5,6 +5,7 @@ declare function $$render<T extends object = object>(): {
|
|
|
5
5
|
selectionBehavior?: "toggle" | "replace";
|
|
6
6
|
emptyPlaceholder?: string | Snippet;
|
|
7
7
|
items?: Iterable<object> | undefined;
|
|
8
|
+
getItemKey?: ((item: object) => string | number) | undefined;
|
|
8
9
|
disabledKeys?: Iterable<string | number>;
|
|
9
10
|
selectionMode?: "single" | "multiple";
|
|
10
11
|
value?: Iterable<string | number>;
|
|
@@ -15,6 +16,7 @@ declare function $$render<T extends object = object>(): {
|
|
|
15
16
|
class?: string;
|
|
16
17
|
id?: string;
|
|
17
18
|
'aria-label'?: string;
|
|
19
|
+
'aria-labelledby'?: string;
|
|
18
20
|
onChange?: ((value: Set<string | number>) => void) | undefined;
|
|
19
21
|
disableFocusHandling?: boolean;
|
|
20
22
|
loop?: boolean;
|
|
@@ -23,27 +25,30 @@ declare function $$render<T extends object = object>(): {
|
|
|
23
25
|
rowHeight?: number;
|
|
24
26
|
overscan?: number;
|
|
25
27
|
} | undefined;
|
|
26
|
-
} & {
|
|
28
|
+
} & Omit<import("svelte/elements").HTMLAttributes<HTMLDivElement>, "children" | "class" | "id" | "role" | "aria-label" | "aria-labelledby" | "onchange"> & {
|
|
27
29
|
context?: ListBoxContext;
|
|
28
30
|
element?: HTMLElement;
|
|
29
31
|
}, "children" | "id" | "value" | "element" | "defaultValue" | "onChange" | "selectionMode" | "context" | "selectionBehavior" | "items"> & {
|
|
30
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* The items, for a list that the component makes from an array. They replace the items of the
|
|
34
|
+
* ComboBox context.
|
|
35
|
+
*/
|
|
31
36
|
items?: Iterable<T>;
|
|
32
|
-
/**
|
|
37
|
+
/** The content of the listbox. From an array of items, it receives one item. */
|
|
33
38
|
children?: Snippet<[T]> | Snippet;
|
|
34
39
|
/**
|
|
35
|
-
*
|
|
36
|
-
* the
|
|
40
|
+
* Makes only the options near the viewport. The `virtualizer` prop of `ListBox` gives the two
|
|
41
|
+
* conditions: all of the rows have the same height, and the list is the element that scrolls.
|
|
37
42
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
43
|
+
* Without its own `items`, it uses the filtered items of the ComboBox. A list without a
|
|
44
|
+
* virtualizer filters one item at a time, and that cannot work when most of the items are not in
|
|
45
|
+
* the DOM.
|
|
41
46
|
*/
|
|
42
47
|
virtualizer?: {
|
|
43
48
|
rowHeight?: number;
|
|
44
49
|
overscan?: number;
|
|
45
50
|
};
|
|
46
|
-
/**
|
|
51
|
+
/** The rows in the listbox above the options, for example a "Create …" action. */
|
|
47
52
|
header?: Snippet;
|
|
48
53
|
};
|
|
49
54
|
exports: {};
|
|
@@ -23,5 +23,5 @@ Description: Floating container for combobox options. Internally composes `Popov
|
|
|
23
23
|
|
|
24
24
|
## Notes
|
|
25
25
|
|
|
26
|
-
- `ComboBox.Popover`
|
|
26
|
+
- `ComboBox.Popover` accepts each `Popover.Content` prop. It does not accept the props of the controlled open state: `open`, `triggerRef`, and `onOpenChange`.
|
|
27
27
|
- The default placement is `bottom-start` to match the combobox input.
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { useComboBoxContext } from '../root/context';
|
|
4
4
|
import { Popover } from '../../popover';
|
|
5
5
|
import { focusWithModality, type InputModality } from '../../primitives/input-modality';
|
|
6
|
+
import { containWheel } from '../../primitives/contain-wheel';
|
|
6
7
|
import type { PopoverOpenChangeDetails } from '../../popover/root/context';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -98,65 +99,12 @@
|
|
|
98
99
|
};
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const isScrollingUp = deltaY < 0;
|
|
104
|
-
const canScrollDown = element.scrollTop < element.scrollHeight - element.clientHeight;
|
|
105
|
-
const canScrollUp = element.scrollTop > 0;
|
|
106
|
-
|
|
107
|
-
return (isScrollingDown && canScrollDown) || (isScrollingUp && canScrollUp);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function isScrollableElement(element: HTMLElement) {
|
|
111
|
-
const { overflowY } = getComputedStyle(element);
|
|
112
|
-
return (
|
|
113
|
-
['auto', 'scroll', 'overlay'].includes(overflowY) &&
|
|
114
|
-
element.scrollHeight > element.clientHeight
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function hasScrollableDescendantForWheel(
|
|
119
|
-
boundary: HTMLElement,
|
|
120
|
-
target: EventTarget | null,
|
|
121
|
-
deltaY: number
|
|
122
|
-
) {
|
|
123
|
-
let current =
|
|
124
|
-
target instanceof HTMLElement ? target : target instanceof Node ? target.parentElement : null;
|
|
125
|
-
|
|
126
|
-
while (current) {
|
|
127
|
-
if (isScrollableElement(current) && canElementScrollInDirection(current, deltaY)) {
|
|
128
|
-
return true;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (current === boundary) {
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
current = current.parentElement;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return false;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Prevent wheel/scroll events from propagating to the page
|
|
143
|
-
* This keeps the page from scrolling when scrolling over the popover
|
|
144
|
-
* But allows internal scrolling when either the popover or a descendant owns overflow
|
|
145
|
-
*/
|
|
102
|
+
// The page must not scroll under the popover, and a scroll of the page closes it. The
|
|
103
|
+
// wheel scrolls the panel, or a scrollable element inside it, while one of them can move.
|
|
146
104
|
function handleWheel(event: WheelEvent) {
|
|
147
105
|
const element = event.currentTarget as HTMLElement;
|
|
148
106
|
if (!element) return;
|
|
149
|
-
|
|
150
|
-
if (
|
|
151
|
-
hasScrollableDescendantForWheel(element, event.target, event.deltaY) ||
|
|
152
|
-
(isScrollableElement(element) && canElementScrollInDirection(element, event.deltaY))
|
|
153
|
-
) {
|
|
154
|
-
event.stopPropagation();
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
event.preventDefault();
|
|
159
|
-
event.stopPropagation();
|
|
107
|
+
containWheel(event, element);
|
|
160
108
|
}
|
|
161
109
|
|
|
162
110
|
$effect(() => {
|
|
@@ -7,30 +7,30 @@
|
|
|
7
7
|
Name: `ComboBox.Root`
|
|
8
8
|
Description: State container for combobox behavior, including open state, input value, selection logic, filtering, and keyboard interaction.
|
|
9
9
|
|
|
10
|
-
| Prop | Type | Default | Description
|
|
11
|
-
| ------------------- | ------------------------------------------------------------------- | -------------------------------- |
|
|
12
|
-
| `id` | `string` | `$props.id()` | Stable id used to derive internal ARIA ids.
|
|
13
|
-
| `disabled` | `boolean` | `false` |
|
|
14
|
-
| `pending` | `boolean` | `false` | Exposes busy async state on the root via `data-pending`.
|
|
15
|
-
| `readonly` | `boolean` | `false` | Keeps the component interactive but prevents value changes.
|
|
16
|
-
| `value` | `string \| number \| null \| (string \| number)[]` | `null` in single mode | Controlled selection value. Supports `bind:value`.
|
|
17
|
-
| `defaultValue` | `string \| number \| null \| (string \| number)[]` | `undefined` | Initial selection value in uncontrolled mode.
|
|
18
|
-
| `inputValue` | `string` | `undefined` | Controlled input value. Supports `bind:inputValue`.
|
|
19
|
-
| `defaultInputValue` | `string` | `''` | Initial input value in uncontrolled mode.
|
|
20
|
-
| `selectionBehavior` | `'toggle' \| 'replace'` | `'toggle'` | Selection behavior when selecting an option.
|
|
21
|
-
| `selectionMode` | `'single' \| 'multiple'` | `'single'` |
|
|
22
|
-
| `closeOnSelect` | `boolean` | `single: true / multiple: false` | Controls whether the popover closes after selection.
|
|
23
|
-
| `open` | `boolean` | `undefined` |
|
|
24
|
-
| `trigger` | `'focus' \| 'input' \| 'press'` | `'press'` | Opening strategy for the popover.
|
|
25
|
-
| `filterActionItems` | `boolean` | `true` | Whether `onAction` items participate in local filtering.
|
|
26
|
-
| `onInputChange` | `(value: string) => void` | `undefined` |
|
|
27
|
-
| `onOpenChange` | `(open: boolean) => void` | `undefined` | Called when open state changes.
|
|
28
|
-
| `onChange` | `(value: string \| number \| null \| (string \| number)[]) => void` | `undefined` | Called when selection changes.
|
|
29
|
-
| `items` | `T[]` | `undefined` | Optional item collection for dynamic rendering.
|
|
30
|
-
| `children` | `Snippet` | `undefined` |
|
|
31
|
-
| `class` | `string` | `''` | CSS class names
|
|
32
|
-
| `aria-label` | `string` | `undefined` |
|
|
33
|
-
| `aria-labelledby` | `string` | `undefined` | Id of an external labeling element.
|
|
10
|
+
| Prop | Type | Default | Description |
|
|
11
|
+
| ------------------- | ------------------------------------------------------------------- | -------------------------------- | -------------------------------------------------------------- |
|
|
12
|
+
| `id` | `string` | `$props.id()` | Stable id used to derive internal ARIA ids. |
|
|
13
|
+
| `disabled` | `boolean` | `false` | Stops all of the user interaction. |
|
|
14
|
+
| `pending` | `boolean` | `false` | Exposes busy async state on the root via `data-pending`. |
|
|
15
|
+
| `readonly` | `boolean` | `false` | Keeps the component interactive but prevents value changes. |
|
|
16
|
+
| `value` | `string \| number \| null \| (string \| number)[]` | `null` in single mode | Controlled selection value. Supports `bind:value`. |
|
|
17
|
+
| `defaultValue` | `string \| number \| null \| (string \| number)[]` | `undefined` | Initial selection value in uncontrolled mode. |
|
|
18
|
+
| `inputValue` | `string` | `undefined` | Controlled input value. Supports `bind:inputValue`. |
|
|
19
|
+
| `defaultInputValue` | `string` | `''` | Initial input value in uncontrolled mode. |
|
|
20
|
+
| `selectionBehavior` | `'toggle' \| 'replace'` | `'toggle'` | Selection behavior when selecting an option. |
|
|
21
|
+
| `selectionMode` | `'single' \| 'multiple'` | `'single'` | The selection mode: one selection, or more than one selection. |
|
|
22
|
+
| `closeOnSelect` | `boolean` | `single: true / multiple: false` | Controls whether the popover closes after selection. |
|
|
23
|
+
| `open` | `boolean` | `undefined` | The open state. Supports `bind:open`. |
|
|
24
|
+
| `trigger` | `'focus' \| 'input' \| 'press'` | `'press'` | Opening strategy for the popover. |
|
|
25
|
+
| `filterActionItems` | `boolean` | `true` | Whether `onAction` items participate in local filtering. |
|
|
26
|
+
| `onInputChange` | `(value: string) => void` | `undefined` | The component calls it when the text in the input changes. |
|
|
27
|
+
| `onOpenChange` | `(open: boolean) => void` | `undefined` | Called when open state changes. |
|
|
28
|
+
| `onChange` | `(value: string \| number \| null \| (string \| number)[]) => void` | `undefined` | Called when selection changes. |
|
|
29
|
+
| `items` | `T[]` | `undefined` | Optional item collection for dynamic rendering. |
|
|
30
|
+
| `children` | `Snippet` | `undefined` | The combobox parts that you assemble. |
|
|
31
|
+
| `class` | `string` | `''` | The CSS class names of the root group element. |
|
|
32
|
+
| `aria-label` | `string` | `undefined` | The accessible name of the combobox group.. |
|
|
33
|
+
| `aria-labelledby` | `string` | `undefined` | Id of an external labeling element. |
|
|
34
34
|
|
|
35
35
|
### Context utilities
|
|
36
36
|
|
|
@@ -18,50 +18,59 @@
|
|
|
18
18
|
} from '../../primitives/input-modality';
|
|
19
19
|
|
|
20
20
|
type ComboBoxProps<T> = {
|
|
21
|
-
/**
|
|
21
|
+
/** A stable id, from which the component makes its internal ARIA ids. Give one on a server. */
|
|
22
22
|
id?: string;
|
|
23
23
|
disabled?: boolean;
|
|
24
24
|
pending?: boolean;
|
|
25
25
|
readonly?: boolean;
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* The selected value or values: one value in the single mode, and an array in the multiple mode.
|
|
28
|
+
* You can bind it with `bind:value`.
|
|
29
|
+
*/
|
|
27
30
|
value?: string | number | null | (string | number)[];
|
|
28
31
|
defaultValue?: string | number | null | (string | number)[];
|
|
29
32
|
/**
|
|
30
|
-
*
|
|
31
|
-
* and
|
|
32
|
-
*
|
|
33
|
-
*
|
|
33
|
+
* Give your own code full control of the selection. The component stops to write back to
|
|
34
|
+
* `value`, and it reports only through `onChange`. Thus the parent can refuse a change: the
|
|
35
|
+
* parent does not send the new value down. The default is off, because `bind:value` is the usual
|
|
36
|
+
* case and it needs the write-back.
|
|
34
37
|
*/
|
|
35
38
|
controlledValue?: boolean;
|
|
36
|
-
/**
|
|
39
|
+
/** The text in the input. You can bind it with `bind:inputValue`. */
|
|
37
40
|
inputValue?: string;
|
|
38
41
|
defaultInputValue?: string;
|
|
39
|
-
/**
|
|
42
|
+
/** Give your own code full control of the input text. Read `controlledValue`. */
|
|
40
43
|
controlledInputValue?: boolean;
|
|
41
44
|
selectionBehavior?: 'toggle' | 'replace';
|
|
42
45
|
selectionMode?: 'single' | 'multiple';
|
|
43
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Closes the popover after a selection. The default is true in the single mode, and false in the
|
|
48
|
+
* multiple mode.
|
|
49
|
+
*/
|
|
44
50
|
closeOnSelect?: boolean;
|
|
45
|
-
/**
|
|
51
|
+
/** The open state of the popover. You can bind it with `bind:open`. */
|
|
46
52
|
open?: boolean;
|
|
47
|
-
/**
|
|
53
|
+
/** Give your own code full control of the open state. Read `controlledValue`. */
|
|
48
54
|
controlledOpen?: boolean;
|
|
49
|
-
/**
|
|
55
|
+
/** What opens the popover: 'focus', 'input', or 'press'. The default is 'press'. */
|
|
50
56
|
trigger?: 'focus' | 'input' | 'press';
|
|
51
|
-
/**
|
|
57
|
+
/** The function that filters the items locally. Set it to null to stop the local filter. */
|
|
52
58
|
filter?: ComboBoxFilter | null;
|
|
53
|
-
/**
|
|
59
|
+
/** Puts the items that have an `onAction` function into the local filter. */
|
|
54
60
|
filterActionItems?: boolean;
|
|
55
61
|
onInputChange?: (value: string) => void;
|
|
56
62
|
onOpenChange?: (open: boolean) => void;
|
|
57
63
|
onChange?: (value: string | number | null | (string | number)[]) => void;
|
|
58
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* The array of the items. The component uses it to find the names of the selected values before
|
|
66
|
+
* the options go into the DOM.
|
|
67
|
+
*/
|
|
59
68
|
items?: T[];
|
|
60
69
|
children?: Snippet;
|
|
61
70
|
class?: string;
|
|
62
|
-
/**
|
|
71
|
+
/** The accessible name of the combobox group. */
|
|
63
72
|
'aria-label'?: string;
|
|
64
|
-
/**
|
|
73
|
+
/** The id of the element that gives this combobox group its name. */
|
|
65
74
|
'aria-labelledby'?: string;
|
|
66
75
|
};
|
|
67
76
|
|