@human-kit/ui 1.0.0-beta.0 → 1.0.0-beta.10
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 +29 -16
- package/dist/FOCUS_STATE_CONTRACT.md +18 -4
- package/dist/FOCUS_STATE_REVIEW_TEMPLATE.md +8 -8
- package/dist/accordion/README.md +3 -3
- package/dist/accordion/root/accordion-root.svelte +15 -3
- package/dist/accordion/root/context.svelte.js +4 -4
- package/dist/accordion/types.d.ts +40 -19
- 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 +11 -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/root/context.svelte.js +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 +133 -38
- package/dist/checkbox/root/checkbox-root.svelte.d.ts +21 -1
- 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/root/create-time-selection-state.svelte.d.ts +5 -0
- package/dist/clock/root/create-time-selection-state.svelte.js +113 -10
- package/dist/clock/root/wheel-options.d.ts +7 -3
- package/dist/clock/root/wheel-options.js +7 -15
- package/dist/clock/wheel-column/clock-wheel-column.svelte +10 -2
- package/dist/clock/wheel-column/clock-wheel-column.svelte.d.ts +2 -1
- package/dist/collapsible/README.md +3 -3
- package/dist/collapsible/root/collapsible-root.svelte +9 -4
- package/dist/collapsible/types.d.ts +13 -1
- 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 +15 -4
- 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 +98 -3
- package/dist/combobox/list/combobox-listbox.svelte.d.ts +28 -3
- 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 +138 -56
- package/dist/combobox/root/combobox.svelte.d.ts +31 -11
- package/dist/combobox/root/context.d.ts +12 -0
- package/dist/combobox/status/README.md +3 -3
- 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 +14 -3
- package/dist/combobox/tag-remove/combobox-tag-remove.svelte.d.ts +7 -1
- package/dist/combobox/tags/README.md +1 -1
- package/dist/combobox/tags/combobox-tags.svelte +15 -12
- package/dist/combobox/tags/combobox-tags.svelte.d.ts +12 -10
- package/dist/combobox/trigger/README.md +7 -7
- package/dist/combobox/trigger/combobox-trigger.svelte +4 -1
- package/dist/datepicker/README.md +5 -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 +38 -2
- package/dist/datepicker/root/date-picker-root.svelte.d.ts +2 -0
- package/dist/datepicker/root/draft-evaluation.d.ts +7 -0
- package/dist/datepicker/root/draft-evaluation.js +2 -2
- 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/daterangepicker/root/date-range-picker-root.svelte +19 -1
- package/dist/daterangepicker/root/date-range-picker-root.svelte.d.ts +2 -0
- package/dist/dialog/README.md +10 -2
- package/dist/dialog/close/dialog-close.svelte +57 -0
- package/dist/dialog/close/dialog-close.svelte.d.ts +19 -0
- package/dist/dialog/content/dialog-content.svelte +6 -4
- package/dist/dialog/content/dialog-content.svelte.d.ts +4 -4
- package/dist/dialog/description/dialog-description.svelte +46 -0
- package/dist/dialog/description/dialog-description.svelte.d.ts +20 -0
- package/dist/dialog/index.d.ts +9 -0
- package/dist/dialog/index.js +3 -0
- package/dist/dialog/index.parts.d.ts +3 -0
- package/dist/dialog/index.parts.js +3 -0
- 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/context.d.ts +8 -0
- package/dist/dialog/root/dialog-root.svelte +100 -20
- package/dist/dialog/root/dialog-root.svelte.d.ts +15 -6
- package/dist/dialog/root/dialog-stack.d.ts +6 -22
- package/dist/dialog/root/dialog-stack.js +4 -33
- package/dist/dialog/title/dialog-title.svelte +43 -0
- package/dist/dialog/title/dialog-title.svelte.d.ts +21 -0
- package/dist/dialog/trigger/README.md +1 -1
- package/dist/drawer/README.md +111 -0
- package/dist/drawer/body/drawer-body.svelte +47 -0
- package/dist/drawer/body/drawer-body.svelte.d.ts +32 -0
- package/dist/drawer/close/drawer-close.svelte +52 -0
- package/dist/drawer/close/drawer-close.svelte.d.ts +20 -0
- package/dist/drawer/content/drawer-content.svelte +600 -0
- package/dist/drawer/content/drawer-content.svelte.d.ts +31 -0
- package/dist/drawer/description/drawer-description.svelte +40 -0
- package/dist/drawer/description/drawer-description.svelte.d.ts +20 -0
- package/dist/drawer/indent/drawer-indent-background.svelte +36 -0
- package/dist/drawer/indent/drawer-indent-background.svelte.d.ts +17 -0
- package/dist/drawer/indent/drawer-indent.svelte +59 -0
- package/dist/drawer/indent/drawer-indent.svelte.d.ts +32 -0
- package/dist/drawer/index.d.ts +49 -0
- package/dist/drawer/index.js +25 -0
- package/dist/drawer/index.parts.d.ts +14 -0
- package/dist/drawer/index.parts.js +15 -0
- package/dist/drawer/overlay/drawer-overlay.svelte +67 -0
- package/dist/drawer/overlay/drawer-overlay.svelte.d.ts +12 -0
- package/dist/drawer/portal/drawer-portal.svelte +57 -0
- package/dist/drawer/portal/drawer-portal.svelte.d.ts +13 -0
- package/dist/drawer/root/context.d.ts +81 -0
- package/dist/drawer/root/context.js +20 -0
- package/dist/drawer/root/drawer-root.svelte +348 -0
- package/dist/drawer/root/drawer-root.svelte.d.ts +79 -0
- package/dist/drawer/root/drawer-stack.svelte.d.ts +73 -0
- package/dist/drawer/root/drawer-stack.svelte.js +113 -0
- package/dist/drawer/root/handle.svelte.d.ts +39 -0
- package/dist/drawer/root/handle.svelte.js +64 -0
- package/dist/drawer/root/keyboard-context.d.ts +13 -0
- package/dist/drawer/root/keyboard-context.js +8 -0
- package/dist/drawer/root/presence-context.d.ts +22 -0
- package/dist/drawer/root/presence-context.js +8 -0
- package/dist/drawer/root/snap-points.d.ts +68 -0
- package/dist/drawer/root/snap-points.js +120 -0
- package/dist/drawer/root/starting-style.svelte.d.ts +18 -0
- package/dist/drawer/root/starting-style.svelte.js +38 -0
- package/dist/drawer/root/types.d.ts +36 -0
- package/dist/drawer/root/types.js +1 -0
- package/dist/drawer/root/viewport-context.d.ts +2 -0
- package/dist/drawer/root/viewport-context.js +16 -0
- package/dist/drawer/swipe-area/drawer-swipe-area.svelte +143 -0
- package/dist/drawer/swipe-area/drawer-swipe-area.svelte.d.ts +22 -0
- package/dist/drawer/title/drawer-title.svelte +37 -0
- package/dist/drawer/title/drawer-title.svelte.d.ts +21 -0
- package/dist/drawer/trigger/drawer-trigger.svelte +90 -0
- package/dist/drawer/trigger/drawer-trigger.svelte.d.ts +41 -0
- package/dist/drawer/viewport/drawer-viewport.svelte +69 -0
- package/dist/drawer/viewport/drawer-viewport.svelte.d.ts +15 -0
- package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte +88 -0
- package/dist/drawer/virtual-keyboard/drawer-virtual-keyboard-provider.svelte.d.ts +29 -0
- package/dist/dropzone/README.md +4 -6
- package/dist/hooks/use-virtual-focus.svelte.d.ts +9 -0
- package/dist/hooks/use-virtual-focus.svelte.js +7 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.js +23 -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 +43 -18
- 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 +56 -1
- package/dist/listbox/root/context.js +118 -1
- package/dist/listbox/root/listbox.svelte +400 -27
- package/dist/listbox/root/listbox.svelte.d.ts +73 -16
- package/dist/locale-provider/README.md +1 -6
- package/dist/menu/README.md +41 -4
- package/dist/menu/content/menu-content.svelte +31 -14
- 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 +2 -2
- 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-field-root.svelte +2 -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 +22 -16
- package/dist/popover/content/popover-content.svelte.d.ts +19 -14
- package/dist/popover/overlay/popover-overlay.svelte +2 -2
- 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 +29 -14
- package/dist/popover/root/popover-root.svelte.d.ts +16 -5
- 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 +49 -8
- package/dist/primitives/floating.js +75 -7
- 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 +3 -0
- package/dist/primitives/index.js +3 -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 +27 -17
- package/dist/primitives/layer-stack.d.ts +29 -0
- package/dist/primitives/layer-stack.js +35 -0
- package/dist/primitives/list-virtualizer.d.ts +75 -0
- package/dist/primitives/list-virtualizer.js +59 -0
- 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 +47 -3
- package/dist/primitives/scroll-lock.js +191 -9
- package/dist/primitives/swipe-gesture.d.ts +126 -0
- package/dist/primitives/swipe-gesture.js +351 -0
- package/dist/primitives/text.d.ts +8 -0
- package/dist/primitives/text.js +13 -0
- 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 +49 -21
- package/dist/switch/root/switch-root.svelte.d.ts +26 -14
- 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/body/table-body.svelte +84 -9
- package/dist/table/cell/table-cell.svelte +27 -10
- package/dist/table/checkbox/table-checkbox.svelte +3 -0
- package/dist/table/checkbox-indicator/README.md +1 -1
- package/dist/table/column/table-column.svelte +5 -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/column-resizer/table-column-resizer.svelte +1 -5
- 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 -10
- 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 +212 -66
- package/dist/table/root/table-root.svelte +36 -6
- package/dist/table/row/table-row.svelte +14 -14
- package/dist/table/sort-trigger/README.md +1 -1
- package/dist/table/sort-trigger/table-sort-trigger.svelte +5 -1
- package/dist/table/types.d.ts +32 -14
- package/dist/tabs/root/tabs-root.svelte +20 -6
- package/dist/tabs/types.d.ts +9 -0
- 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/root/time-picker-root.svelte +11 -0
- package/dist/timepicker/root/time-picker-root.svelte.d.ts +2 -0
- 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 +24 -8
- package/dist/toggle-group/root/toggle-group-root.svelte +24 -4
- 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 -0
- 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 +461 -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/root/context.svelte.js +6 -0
- package/dist/tree/root/tree-root.svelte +22 -8
- package/dist/tree/types.d.ts +23 -1
- package/package.json +282 -224
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<!-- Generic over the payload so it lines up with the handle it pushes into. -->
|
|
2
|
+
<script lang="ts" generics="Payload = unknown">
|
|
3
|
+
import { untrack, type Snippet } from 'svelte';
|
|
4
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
5
|
+
import { ButtonRoot } from '../../button/index.js';
|
|
6
|
+
import { getDrawerContext } from '../root/context';
|
|
7
|
+
import type { DrawerHandle } from '../root/handle.svelte';
|
|
8
|
+
|
|
9
|
+
// Not exported: a generic component cannot re-export a type that mentions its own
|
|
10
|
+
// type parameter. The public `DrawerTriggerProps` comes from `ComponentProps` in
|
|
11
|
+
// the index, which resolves the generic properly anyway.
|
|
12
|
+
type DrawerTriggerProps = Omit<
|
|
13
|
+
HTMLButtonAttributes,
|
|
14
|
+
'type' | 'class' | 'children' | 'aria-haspopup' | 'aria-expanded'
|
|
15
|
+
> & {
|
|
16
|
+
/** The name on the button. */
|
|
17
|
+
children?: Snippet;
|
|
18
|
+
/** The CSS class names of the button. */
|
|
19
|
+
class?: string;
|
|
20
|
+
/** A bindable reference to the button element. */
|
|
21
|
+
element?: HTMLButtonElement | null;
|
|
22
|
+
/**
|
|
23
|
+
* Opens the drawer through a separate object, and not through the context. Thus the trigger can
|
|
24
|
+
* be at any position in the tree. Read `createDrawerHandle`.
|
|
25
|
+
*/
|
|
26
|
+
handle?: DrawerHandle<Payload>;
|
|
27
|
+
/** The value that goes to the `children` snippet of the drawer when this trigger opens it. */
|
|
28
|
+
payload?: Payload;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
type DrawerTriggerMouseEvent = MouseEvent & {
|
|
32
|
+
currentTarget: EventTarget & HTMLButtonElement;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
let {
|
|
36
|
+
children,
|
|
37
|
+
class: className = '',
|
|
38
|
+
element = $bindable<HTMLButtonElement | null>(null),
|
|
39
|
+
handle,
|
|
40
|
+
payload,
|
|
41
|
+
onclick: onClickExternal,
|
|
42
|
+
...restProps
|
|
43
|
+
}: DrawerTriggerProps = $props();
|
|
44
|
+
|
|
45
|
+
// With a handle the trigger is usually OUTSIDE the root, so context is optional;
|
|
46
|
+
// without one it is the only way to reach the drawer, and its absence is a bug.
|
|
47
|
+
// Context can only be read during init, so `handle` is read untracked — a handle
|
|
48
|
+
// swapped later would not change which mechanism this trigger uses anyway.
|
|
49
|
+
const ctx = getDrawerContext();
|
|
50
|
+
if (!ctx && !untrack(() => handle)) {
|
|
51
|
+
throw new Error('Drawer.Trigger must be used inside a Drawer.Root, or given a `handle`.');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
let buttonRef: HTMLButtonElement | null = $state(null);
|
|
55
|
+
|
|
56
|
+
const isOpen = $derived(handle ? handle.isOpen : (ctx?.isOpen ?? false));
|
|
57
|
+
|
|
58
|
+
function handleClick(event: DrawerTriggerMouseEvent) {
|
|
59
|
+
if (handle) {
|
|
60
|
+
handle.toggle(payload, buttonRef);
|
|
61
|
+
} else {
|
|
62
|
+
ctx?.toggle();
|
|
63
|
+
}
|
|
64
|
+
onClickExternal?.(event);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
$effect(() => {
|
|
68
|
+
element = buttonRef;
|
|
69
|
+
// A handled trigger records itself on the handle at click time instead: with
|
|
70
|
+
// many triggers sharing one drawer, the last one to mount is not the one focus
|
|
71
|
+
// should return to.
|
|
72
|
+
if (buttonRef && !handle) {
|
|
73
|
+
ctx?.setTriggerRef(buttonRef);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
</script>
|
|
77
|
+
|
|
78
|
+
<ButtonRoot
|
|
79
|
+
{...restProps}
|
|
80
|
+
bind:element={buttonRef}
|
|
81
|
+
class={className}
|
|
82
|
+
type="button"
|
|
83
|
+
pressed={isOpen || undefined}
|
|
84
|
+
aria-haspopup="dialog"
|
|
85
|
+
aria-expanded={isOpen}
|
|
86
|
+
data-drawer-trigger="true"
|
|
87
|
+
onclick={handleClick}
|
|
88
|
+
>
|
|
89
|
+
{@render children?.()}
|
|
90
|
+
</ButtonRoot>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
|
+
import type { DrawerHandle } from '../root/handle.svelte';
|
|
4
|
+
declare function $$render<Payload = unknown>(): {
|
|
5
|
+
props: Omit<HTMLButtonAttributes, "children" | "class" | "aria-expanded" | "aria-haspopup" | "type"> & {
|
|
6
|
+
/** The name on the button. */
|
|
7
|
+
children?: Snippet;
|
|
8
|
+
/** The CSS class names of the button. */
|
|
9
|
+
class?: string;
|
|
10
|
+
/** A bindable reference to the button element. */
|
|
11
|
+
element?: HTMLButtonElement | null;
|
|
12
|
+
/**
|
|
13
|
+
* Opens the drawer through a separate object, and not through the context. Thus the trigger can
|
|
14
|
+
* be at any position in the tree. Read `createDrawerHandle`.
|
|
15
|
+
*/
|
|
16
|
+
handle?: DrawerHandle<Payload>;
|
|
17
|
+
/** The value that goes to the `children` snippet of the drawer when this trigger opens it. */
|
|
18
|
+
payload?: Payload;
|
|
19
|
+
};
|
|
20
|
+
exports: {};
|
|
21
|
+
bindings: "element";
|
|
22
|
+
slots: {};
|
|
23
|
+
events: {};
|
|
24
|
+
};
|
|
25
|
+
declare class __sveltets_Render<Payload = unknown> {
|
|
26
|
+
props(): ReturnType<typeof $$render<Payload>>['props'];
|
|
27
|
+
events(): ReturnType<typeof $$render<Payload>>['events'];
|
|
28
|
+
slots(): ReturnType<typeof $$render<Payload>>['slots'];
|
|
29
|
+
bindings(): "element";
|
|
30
|
+
exports(): {};
|
|
31
|
+
}
|
|
32
|
+
interface $$IsomorphicComponent {
|
|
33
|
+
new <Payload = unknown>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Payload>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Payload>['props']>, ReturnType<__sveltets_Render<Payload>['events']>, ReturnType<__sveltets_Render<Payload>['slots']>> & {
|
|
34
|
+
$$bindings?: ReturnType<__sveltets_Render<Payload>['bindings']>;
|
|
35
|
+
} & ReturnType<__sveltets_Render<Payload>['exports']>;
|
|
36
|
+
<Payload = unknown>(internal: unknown, props: ReturnType<__sveltets_Render<Payload>['props']> & {}): ReturnType<__sveltets_Render<Payload>['exports']>;
|
|
37
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
38
|
+
}
|
|
39
|
+
declare const DrawerTrigger: $$IsomorphicComponent;
|
|
40
|
+
type DrawerTrigger<Payload = unknown> = InstanceType<typeof DrawerTrigger<Payload>>;
|
|
41
|
+
export default DrawerTrigger;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import { requireDrawerContext } from '../root/context';
|
|
5
|
+
import { getDrawerPresenceContext } from '../root/presence-context';
|
|
6
|
+
import { markDrawerViewport } from '../root/viewport-context';
|
|
7
|
+
import { getContentZIndex } from '../../primitives/layer-stack';
|
|
8
|
+
import type { DrawerSide } from '../root/types';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Drawer.Viewport — the positioning layer that pins the panel to its edge.
|
|
12
|
+
* Belongs inside a Drawer.Portal, wrapping a Drawer.Content.
|
|
13
|
+
*/
|
|
14
|
+
type DrawerViewportProps = {
|
|
15
|
+
/** The panel that this viewport puts in position. */
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
/** The CSS class names of the viewport. */
|
|
18
|
+
class?: string;
|
|
19
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'>;
|
|
20
|
+
|
|
21
|
+
let {
|
|
22
|
+
children,
|
|
23
|
+
class: className = '',
|
|
24
|
+
style: styleProp,
|
|
25
|
+
...restProps
|
|
26
|
+
}: DrawerViewportProps = $props();
|
|
27
|
+
|
|
28
|
+
const ctx = requireDrawerContext('Drawer.Viewport');
|
|
29
|
+
const presence = getDrawerPresenceContext();
|
|
30
|
+
|
|
31
|
+
// Tells the Content inside to stay in flow instead of pinning itself.
|
|
32
|
+
markDrawerViewport();
|
|
33
|
+
|
|
34
|
+
const zIndex = $derived(getContentZIndex(ctx.stackLevel));
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The viewport spans the whole screen so the panel can be aligned with flexbox
|
|
38
|
+
* and still size itself to its content. It is transparent to pointers — only the
|
|
39
|
+
* panel inside it takes them — so a non-modal drawer leaves the rest of the page
|
|
40
|
+
* fully usable, and a modal one relies on Drawer.Overlay to block instead.
|
|
41
|
+
*/
|
|
42
|
+
function layoutFor(side: DrawerSide): string {
|
|
43
|
+
const vertical = side === 'top' || side === 'bottom';
|
|
44
|
+
const direction = vertical ? 'column' : 'row';
|
|
45
|
+
const justify = side === 'bottom' || side === 'right' ? 'flex-end' : 'flex-start';
|
|
46
|
+
return `flex-direction: ${direction}; justify-content: ${justify}; align-items: stretch;`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// A consumer `style` is appended rather than spread through `restProps`, which
|
|
50
|
+
// would land after this attribute and drop the positioning with it.
|
|
51
|
+
const style = $derived(
|
|
52
|
+
`position: fixed; inset: 0; z-index: ${zIndex}; display: flex; pointer-events: none; ${layoutFor(ctx.side)} ${styleProp ?? ''}`
|
|
53
|
+
);
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<div
|
|
57
|
+
class={className}
|
|
58
|
+
data-drawer-viewport
|
|
59
|
+
data-side={ctx.side}
|
|
60
|
+
data-state={presence ? presence.state : 'open'}
|
|
61
|
+
data-entering={presence?.isEntering || undefined}
|
|
62
|
+
data-exiting={presence?.isExiting || undefined}
|
|
63
|
+
{style}
|
|
64
|
+
{...restProps}
|
|
65
|
+
>
|
|
66
|
+
{#if children}
|
|
67
|
+
{@render children()}
|
|
68
|
+
{/if}
|
|
69
|
+
</div>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
/**
|
|
4
|
+
* Drawer.Viewport — the positioning layer that pins the panel to its edge.
|
|
5
|
+
* Belongs inside a Drawer.Portal, wrapping a Drawer.Content.
|
|
6
|
+
*/
|
|
7
|
+
type DrawerViewportProps = {
|
|
8
|
+
/** The panel that this viewport puts in position. */
|
|
9
|
+
children?: Snippet;
|
|
10
|
+
/** The CSS class names of the viewport. */
|
|
11
|
+
class?: string;
|
|
12
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, 'class' | 'children'>;
|
|
13
|
+
declare const DrawerViewport: import("svelte").Component<DrawerViewportProps, {}, "">;
|
|
14
|
+
type DrawerViewport = ReturnType<typeof DrawerViewport>;
|
|
15
|
+
export default DrawerViewport;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { browser } from '../../internal/environment';
|
|
4
|
+
import { setDrawerKeyboardContext } from '../root/keyboard-context';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Drawer.VirtualKeyboardProvider — keeps a drawer's fields above the software
|
|
8
|
+
* keyboard.
|
|
9
|
+
*
|
|
10
|
+
* Wrap it around `Drawer.Root` (it renders no element of its own). While the
|
|
11
|
+
* keyboard is up, `Drawer.Content` exposes `--drawer-keyboard-inset` — the height
|
|
12
|
+
* the keyboard covers — so a footer can be lifted clear of it:
|
|
13
|
+
*
|
|
14
|
+
* ```css
|
|
15
|
+
* .Footer { padding-bottom: var(--drawer-keyboard-inset, 0px); }
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* The variable is only set while the keyboard is actually up, which is what makes
|
|
19
|
+
* the `0px` fallback the right default rather than a guess.
|
|
20
|
+
*
|
|
21
|
+
* On a phone the keyboard shrinks the VISUAL viewport without touching the layout
|
|
22
|
+
* viewport, so nothing in CSS notices it — `100vh` still spans the full screen and
|
|
23
|
+
* a bottom sheet ends up underneath the keys. `window.visualViewport` is the only
|
|
24
|
+
* thing that reports the difference. Where it is missing (older browsers, and
|
|
25
|
+
* every desktop where this does not apply anyway) the provider is inert.
|
|
26
|
+
*/
|
|
27
|
+
type DrawerVirtualKeyboardProviderProps = {
|
|
28
|
+
/** The elements below it, which receive the keyboard inset. */
|
|
29
|
+
children?: Snippet;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
let { children }: DrawerVirtualKeyboardProviderProps = $props();
|
|
33
|
+
|
|
34
|
+
let inset = $state(0);
|
|
35
|
+
|
|
36
|
+
setDrawerKeyboardContext({
|
|
37
|
+
get inset() {
|
|
38
|
+
return inset;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
$effect(() => {
|
|
43
|
+
if (!browser) return;
|
|
44
|
+
const viewport = window.visualViewport;
|
|
45
|
+
if (!viewport) return;
|
|
46
|
+
|
|
47
|
+
function measure() {
|
|
48
|
+
if (!viewport) return;
|
|
49
|
+
const layoutHeight = document.documentElement.clientHeight;
|
|
50
|
+
// `offsetTop` matters when the user has pinch-zoomed and panned: the visual
|
|
51
|
+
// viewport is then both shorter AND offset, and ignoring it reports an inset
|
|
52
|
+
// that is off by the pan distance.
|
|
53
|
+
const covered = layoutHeight - (viewport.height + viewport.offsetTop);
|
|
54
|
+
// Sub-pixel noise is constant on HiDPI screens; anything under a few pixels
|
|
55
|
+
// is not a keyboard.
|
|
56
|
+
inset = covered > 4 ? covered : 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
measure();
|
|
60
|
+
viewport.addEventListener('resize', measure);
|
|
61
|
+
viewport.addEventListener('scroll', measure);
|
|
62
|
+
|
|
63
|
+
return () => {
|
|
64
|
+
viewport.removeEventListener('resize', measure);
|
|
65
|
+
viewport.removeEventListener('scroll', measure);
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Bring the focused field back into view once the keyboard has settled. The
|
|
70
|
+
// browser does this for the document scroller on its own, but not for a field
|
|
71
|
+
// inside a fixed-position panel.
|
|
72
|
+
$effect(() => {
|
|
73
|
+
if (!browser || inset <= 0) return;
|
|
74
|
+
|
|
75
|
+
const frame = requestAnimationFrame(() => {
|
|
76
|
+
const active = document.activeElement;
|
|
77
|
+
if (!(active instanceof HTMLElement)) return;
|
|
78
|
+
if (!active.closest('[data-drawer-content]')) return;
|
|
79
|
+
active.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
return () => cancelAnimationFrame(frame);
|
|
83
|
+
});
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
{#if children}
|
|
87
|
+
{@render children()}
|
|
88
|
+
{/if}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
/**
|
|
3
|
+
* Drawer.VirtualKeyboardProvider — keeps a drawer's fields above the software
|
|
4
|
+
* keyboard.
|
|
5
|
+
*
|
|
6
|
+
* Wrap it around `Drawer.Root` (it renders no element of its own). While the
|
|
7
|
+
* keyboard is up, `Drawer.Content` exposes `--drawer-keyboard-inset` — the height
|
|
8
|
+
* the keyboard covers — so a footer can be lifted clear of it:
|
|
9
|
+
*
|
|
10
|
+
* ```css
|
|
11
|
+
* .Footer { padding-bottom: var(--drawer-keyboard-inset, 0px); }
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* The variable is only set while the keyboard is actually up, which is what makes
|
|
15
|
+
* the `0px` fallback the right default rather than a guess.
|
|
16
|
+
*
|
|
17
|
+
* On a phone the keyboard shrinks the VISUAL viewport without touching the layout
|
|
18
|
+
* viewport, so nothing in CSS notices it — `100vh` still spans the full screen and
|
|
19
|
+
* a bottom sheet ends up underneath the keys. `window.visualViewport` is the only
|
|
20
|
+
* thing that reports the difference. Where it is missing (older browsers, and
|
|
21
|
+
* every desktop where this does not apply anyway) the provider is inert.
|
|
22
|
+
*/
|
|
23
|
+
type DrawerVirtualKeyboardProviderProps = {
|
|
24
|
+
/** The elements below it, which receive the keyboard inset. */
|
|
25
|
+
children?: Snippet;
|
|
26
|
+
};
|
|
27
|
+
declare const DrawerVirtualKeyboardProvider: import("svelte").Component<DrawerVirtualKeyboardProviderProps, {}, "">;
|
|
28
|
+
type DrawerVirtualKeyboardProvider = ReturnType<typeof DrawerVirtualKeyboardProvider>;
|
|
29
|
+
export default DrawerVirtualKeyboardProvider;
|
package/dist/dropzone/README.md
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Description
|
|
4
4
|
|
|
5
|
-
`Dropzone` is a headless file-drop surface. It
|
|
6
|
-
visually-hidden `<input type="file">`, so files can be selected by click/keyboard, by
|
|
7
|
-
drag-and-drop, or by pasting from the clipboard, and emits the accepted native `File`s.
|
|
5
|
+
`Dropzone` is a headless file-drop surface. It makes a `<button>` element that takes the focus, and a hidden `<input type="file">` element. Thus the user selects the files with a click, with the keyboard, with a drag, or from the clipboard. The component then sends the native `File` objects that it accepts.
|
|
8
6
|
It is encoding-agnostic — consumers own how files are stored or rendered.
|
|
9
7
|
|
|
10
8
|
## Anatomy
|
|
@@ -33,7 +31,7 @@ It is encoding-agnostic — consumers own how files are stored or rendered.
|
|
|
33
31
|
tokens (`.ext`), so include the extensions you care about alongside MIME types.
|
|
34
32
|
- Directory drops are excluded when the browser exposes `webkitGetAsEntry`; otherwise the
|
|
35
33
|
drop falls back to `dataTransfer.files` as before.
|
|
36
|
-
- `multiple`
|
|
34
|
+
- `multiple` lets the user give more than one file. With `false`, the component sends only the first file.
|
|
37
35
|
- Style interaction state with `data-drop-target`, `data-focus-visible`, `data-hovered`, and
|
|
38
36
|
`data-disabled`. The `children` snippet also receives `{ dragging, hovered, focused,
|
|
39
37
|
focusVisible, disabled }`.
|
|
@@ -58,9 +56,9 @@ focusVisible, disabled }`.
|
|
|
58
56
|
- The drop surface is a native `<button type="button">`, so it is reachable by Tab and
|
|
59
57
|
activatable with Enter/Space, which opens the file picker. This is the keyboard path that
|
|
60
58
|
drag-and-drop alone cannot provide.
|
|
61
|
-
- `aria-label`
|
|
59
|
+
- `aria-label` gives the zone its name. The `aria-labelledby` and `aria-describedby` attributes also go through the other props.
|
|
62
60
|
- `data-focus-visible` follows the shared modality contract and only appears for keyboard or
|
|
63
61
|
virtual focus.
|
|
64
|
-
- `announcement`
|
|
62
|
+
- The component puts `announcement` in a hidden `role="status" aria-live="polite"` region.
|
|
65
63
|
- The hidden file input is removed from the tab order (`tabindex="-1"`, `aria-hidden`) so the
|
|
66
64
|
button is the single focus stop.
|
|
@@ -33,6 +33,15 @@ export type VirtualFocusOptions = {
|
|
|
33
33
|
itemPrefix?: string;
|
|
34
34
|
/** Reference to container element for scoped DOM queries */
|
|
35
35
|
containerRef?: () => HTMLElement | null;
|
|
36
|
+
/**
|
|
37
|
+
* The authoritative item order, when the caller has one.
|
|
38
|
+
*
|
|
39
|
+
* Navigation otherwise reads the order off the DOM, which is only the same thing while
|
|
40
|
+
* every item is mounted. A virtualized list mounts a window of rows, so without this
|
|
41
|
+
* `last()` would land on the last *rendered* item and `next()` would stop at the edge of
|
|
42
|
+
* that window. Return `undefined` to fall back to the DOM order.
|
|
43
|
+
*/
|
|
44
|
+
orderedIds?: () => (string | number)[] | undefined;
|
|
36
45
|
};
|
|
37
46
|
export type VirtualFocusReturn = {
|
|
38
47
|
readonly focusedId: string | number | null;
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import { SvelteMap } from 'svelte/reactivity';
|
|
30
30
|
export function useVirtualFocus(options) {
|
|
31
|
-
const { instanceId, itemPrefix = 'combobox-item', containerRef } = options;
|
|
31
|
+
const { instanceId, itemPrefix = 'combobox-item', containerRef, orderedIds: getOrderedIds } = options;
|
|
32
32
|
// Internal state
|
|
33
33
|
let focusedId = $state(null);
|
|
34
34
|
let itemIds = $state([]);
|
|
@@ -47,6 +47,12 @@ export function useVirtualFocus(options) {
|
|
|
47
47
|
* Uses cache when available, queries DOM otherwise.
|
|
48
48
|
*/
|
|
49
49
|
function getItemIdsInOrder() {
|
|
50
|
+
// Given order wins over the DOM, and is never cached: it is derived from the caller's
|
|
51
|
+
// own list, which already changes exactly when the order does.
|
|
52
|
+
const given = getOrderedIds?.();
|
|
53
|
+
if (given !== undefined) {
|
|
54
|
+
return given;
|
|
55
|
+
}
|
|
50
56
|
if (cachedItemOrder !== null) {
|
|
51
57
|
return cachedItemOrder;
|
|
52
58
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { Accordion } from './accordion/index.js';
|
|
2
2
|
export { Autocomplete } from './autocomplete/index.js';
|
|
3
|
+
export { Avatar } from './avatar/index.js';
|
|
4
|
+
export { Breadcrumbs } from './breadcrumbs/index.js';
|
|
3
5
|
export { Button } from './button/index.js';
|
|
4
6
|
export { Checkbox } from './checkbox/index.js';
|
|
7
|
+
export { CheckboxGroup } from './checkbox-group/index.js';
|
|
5
8
|
export { Collapsible } from './collapsible/index.js';
|
|
6
9
|
export { ComboBox } from './combobox/index.js';
|
|
7
10
|
export { Calendar } from './calendar/index.js';
|
|
@@ -10,28 +13,41 @@ export { DatePicker } from './datepicker/index.js';
|
|
|
10
13
|
export { DateRangePicker } from './daterangepicker/index.js';
|
|
11
14
|
export { TimePicker } from './timepicker/index.js';
|
|
12
15
|
export { Dialog } from './dialog/index.js';
|
|
16
|
+
export { Drawer } from './drawer/index.js';
|
|
13
17
|
export { ListBox } from './listbox/index.js';
|
|
14
18
|
export { Menu } from './menu/index.js';
|
|
15
19
|
export { NumberField } from './numberfield/index.js';
|
|
16
20
|
export { Popover } from './popover/index.js';
|
|
21
|
+
export { Progress } from './progress/index.js';
|
|
22
|
+
export { RadioGroup } from './radio-group/index.js';
|
|
23
|
+
export { Select } from './select/index.js';
|
|
24
|
+
export { Slider } from './slider/index.js';
|
|
17
25
|
export { Switch } from './switch/index.js';
|
|
26
|
+
export { Tooltip } from './tooltip/index.js';
|
|
18
27
|
export { Table } from './table/index.js';
|
|
19
28
|
export { Tabs } from './tabs/index.js';
|
|
29
|
+
export { Toast } from './toast/index.js';
|
|
20
30
|
export { Toggle } from './toggle/index.js';
|
|
21
31
|
export { ToggleGroup } from './toggle-group/index.js';
|
|
32
|
+
export { TransferList } from './transfer-list/index.js';
|
|
22
33
|
export { Tree } from './tree/index.js';
|
|
23
34
|
export { default as Input } from './input/index.js';
|
|
24
35
|
export { default as Label } from './label/index.js';
|
|
36
|
+
export { default as Separator } from './separator/index.js';
|
|
25
37
|
export { default as Dropzone } from './dropzone/index.js';
|
|
26
38
|
export { default as LocaleProvider } from './locale-provider/index.js';
|
|
27
39
|
export { Portal } from './portal/index.js';
|
|
28
40
|
export { OverflowRow, type OverflowRowState } from './overflow-row/index.js';
|
|
29
41
|
export { default as TextArea } from './textarea/index.js';
|
|
30
42
|
export * from './locale-provider/index.js';
|
|
43
|
+
export type { SeparatorOrientation, SeparatorProps } from './separator/index.js';
|
|
31
44
|
export * from './accordion/index.js';
|
|
32
45
|
export * from './autocomplete/index.js';
|
|
33
46
|
export * from './button/index.js';
|
|
34
47
|
export * from './checkbox/index.js';
|
|
48
|
+
export * from './checkbox-group/index.js';
|
|
49
|
+
export * from './avatar/index.js';
|
|
50
|
+
export * from './breadcrumbs/index.js';
|
|
35
51
|
export * from './collapsible/index.js';
|
|
36
52
|
export * from './combobox/index.js';
|
|
37
53
|
export * from './calendar/index.js';
|
|
@@ -41,15 +57,23 @@ export * from './daterangepicker/index.js';
|
|
|
41
57
|
export * from './dropzone/index.js';
|
|
42
58
|
export * from './timepicker/index.js';
|
|
43
59
|
export * from './dialog/index.js';
|
|
60
|
+
export * from './drawer/index.js';
|
|
44
61
|
export * from './listbox/index.js';
|
|
45
62
|
export * from './menu/index.js';
|
|
46
63
|
export * from './numberfield/index.js';
|
|
47
64
|
export * from './popover/index.js';
|
|
65
|
+
export * from './progress/index.js';
|
|
66
|
+
export * from './radio-group/index.js';
|
|
67
|
+
export * from './select/index.js';
|
|
68
|
+
export * from './slider/index.js';
|
|
48
69
|
export * from './switch/index.js';
|
|
70
|
+
export * from './tooltip/index.js';
|
|
49
71
|
export * from './table/index.js';
|
|
50
72
|
export * from './tabs/index.js';
|
|
73
|
+
export * from './toast/index.js';
|
|
51
74
|
export * from './toggle/index.js';
|
|
52
75
|
export * from './toggle-group/index.js';
|
|
76
|
+
export * from './transfer-list/index.js';
|
|
53
77
|
export * from './tree/index.js';
|
|
54
78
|
export * from './primitives/index.js';
|
|
55
79
|
export { cn } from './utils/index.js';
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
// Components (namespace exports)
|
|
3
3
|
export { Accordion } from './accordion/index.js';
|
|
4
4
|
export { Autocomplete } from './autocomplete/index.js';
|
|
5
|
+
export { Avatar } from './avatar/index.js';
|
|
6
|
+
export { Breadcrumbs } from './breadcrumbs/index.js';
|
|
5
7
|
export { Button } from './button/index.js';
|
|
6
8
|
export { Checkbox } from './checkbox/index.js';
|
|
9
|
+
export { CheckboxGroup } from './checkbox-group/index.js';
|
|
7
10
|
export { Collapsible } from './collapsible/index.js';
|
|
8
11
|
export { ComboBox } from './combobox/index.js';
|
|
9
12
|
export { Calendar } from './calendar/index.js';
|
|
@@ -12,19 +15,28 @@ export { DatePicker } from './datepicker/index.js';
|
|
|
12
15
|
export { DateRangePicker } from './daterangepicker/index.js';
|
|
13
16
|
export { TimePicker } from './timepicker/index.js';
|
|
14
17
|
export { Dialog } from './dialog/index.js';
|
|
18
|
+
export { Drawer } from './drawer/index.js';
|
|
15
19
|
export { ListBox } from './listbox/index.js';
|
|
16
20
|
export { Menu } from './menu/index.js';
|
|
17
21
|
export { NumberField } from './numberfield/index.js';
|
|
18
22
|
export { Popover } from './popover/index.js';
|
|
23
|
+
export { Progress } from './progress/index.js';
|
|
24
|
+
export { RadioGroup } from './radio-group/index.js';
|
|
25
|
+
export { Select } from './select/index.js';
|
|
26
|
+
export { Slider } from './slider/index.js';
|
|
19
27
|
export { Switch } from './switch/index.js';
|
|
28
|
+
export { Tooltip } from './tooltip/index.js';
|
|
20
29
|
export { Table } from './table/index.js';
|
|
21
30
|
export { Tabs } from './tabs/index.js';
|
|
31
|
+
export { Toast } from './toast/index.js';
|
|
22
32
|
export { Toggle } from './toggle/index.js';
|
|
23
33
|
export { ToggleGroup } from './toggle-group/index.js';
|
|
34
|
+
export { TransferList } from './transfer-list/index.js';
|
|
24
35
|
export { Tree } from './tree/index.js';
|
|
25
36
|
// Simple components
|
|
26
37
|
export { default as Input } from './input/index.js';
|
|
27
38
|
export { default as Label } from './label/index.js';
|
|
39
|
+
export { default as Separator } from './separator/index.js';
|
|
28
40
|
export { default as Dropzone } from './dropzone/index.js';
|
|
29
41
|
export { default as LocaleProvider } from './locale-provider/index.js';
|
|
30
42
|
export { Portal } from './portal/index.js';
|
|
@@ -36,6 +48,9 @@ export * from './accordion/index.js';
|
|
|
36
48
|
export * from './autocomplete/index.js';
|
|
37
49
|
export * from './button/index.js';
|
|
38
50
|
export * from './checkbox/index.js';
|
|
51
|
+
export * from './checkbox-group/index.js';
|
|
52
|
+
export * from './avatar/index.js';
|
|
53
|
+
export * from './breadcrumbs/index.js';
|
|
39
54
|
export * from './collapsible/index.js';
|
|
40
55
|
export * from './combobox/index.js';
|
|
41
56
|
export * from './calendar/index.js';
|
|
@@ -45,15 +60,23 @@ export * from './daterangepicker/index.js';
|
|
|
45
60
|
export * from './dropzone/index.js';
|
|
46
61
|
export * from './timepicker/index.js';
|
|
47
62
|
export * from './dialog/index.js';
|
|
63
|
+
export * from './drawer/index.js';
|
|
48
64
|
export * from './listbox/index.js';
|
|
49
65
|
export * from './menu/index.js';
|
|
50
66
|
export * from './numberfield/index.js';
|
|
51
67
|
export * from './popover/index.js';
|
|
68
|
+
export * from './progress/index.js';
|
|
69
|
+
export * from './radio-group/index.js';
|
|
70
|
+
export * from './select/index.js';
|
|
71
|
+
export * from './slider/index.js';
|
|
52
72
|
export * from './switch/index.js';
|
|
73
|
+
export * from './tooltip/index.js';
|
|
53
74
|
export * from './table/index.js';
|
|
54
75
|
export * from './tabs/index.js';
|
|
76
|
+
export * from './toast/index.js';
|
|
55
77
|
export * from './toggle/index.js';
|
|
56
78
|
export * from './toggle-group/index.js';
|
|
79
|
+
export * from './transfer-list/index.js';
|
|
57
80
|
export * from './tree/index.js';
|
|
58
81
|
// Primitives
|
|
59
82
|
export * from './primitives/index.js';
|
package/dist/input/input.svelte
CHANGED
|
@@ -10,17 +10,17 @@
|
|
|
10
10
|
|
|
11
11
|
type InputProps = HTMLInputAttributes & {
|
|
12
12
|
class?: ClassValue;
|
|
13
|
-
/** Disables the input
|
|
13
|
+
/** Disables the input, with the native attribute. */
|
|
14
14
|
disabled?: boolean | null;
|
|
15
|
-
/**
|
|
15
|
+
/** The native `readonly` attribute. The component also sets `aria-readonly`. */
|
|
16
16
|
readonly?: boolean | null;
|
|
17
|
-
/** Marks the value as
|
|
17
|
+
/** Marks the value as not valid. The component sets `aria-invalid` and `data-invalid`. */
|
|
18
18
|
invalid?: boolean;
|
|
19
|
-
/**
|
|
19
|
+
/** The native `required` attribute. The component also sets `aria-required`. */
|
|
20
20
|
required?: boolean | null;
|
|
21
|
-
/**
|
|
21
|
+
/** The value. You can bind it. */
|
|
22
22
|
value?: HTMLInputAttributes['value'];
|
|
23
|
-
/**
|
|
23
|
+
/** A bindable reference to the input element. */
|
|
24
24
|
element?: HTMLInputElement | null;
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -2,17 +2,17 @@ import type { HTMLInputAttributes } from 'svelte/elements';
|
|
|
2
2
|
import type { ClassValue } from '../utils/cn';
|
|
3
3
|
type InputProps = HTMLInputAttributes & {
|
|
4
4
|
class?: ClassValue;
|
|
5
|
-
/** Disables the input
|
|
5
|
+
/** Disables the input, with the native attribute. */
|
|
6
6
|
disabled?: boolean | null;
|
|
7
|
-
/**
|
|
7
|
+
/** The native `readonly` attribute. The component also sets `aria-readonly`. */
|
|
8
8
|
readonly?: boolean | null;
|
|
9
|
-
/** Marks the value as
|
|
9
|
+
/** Marks the value as not valid. The component sets `aria-invalid` and `data-invalid`. */
|
|
10
10
|
invalid?: boolean;
|
|
11
|
-
/**
|
|
11
|
+
/** The native `required` attribute. The component also sets `aria-required`. */
|
|
12
12
|
required?: boolean | null;
|
|
13
|
-
/**
|
|
13
|
+
/** The value. You can bind it. */
|
|
14
14
|
value?: HTMLInputAttributes['value'];
|
|
15
|
-
/**
|
|
15
|
+
/** A bindable reference to the input element. */
|
|
16
16
|
element?: HTMLInputElement | null;
|
|
17
17
|
};
|
|
18
18
|
declare const Input: import("svelte").Component<InputProps, {}, "value" | "element">;
|
|
@@ -1,2 +1,13 @@
|
|
|
1
1
|
export declare const browser: boolean;
|
|
2
2
|
export declare const dev: boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Whether the platform uses Cmd where the rest use Ctrl.
|
|
5
|
+
*
|
|
6
|
+
* Only for *naming* a shortcut — `aria-keyshortcuts`, a hint in the UI. Never gate behaviour
|
|
7
|
+
* on it: handlers should accept `ctrlKey || metaKey` and let either work everywhere, which is
|
|
8
|
+
* both simpler and right for a user on an Apple keyboard plugged into something else.
|
|
9
|
+
*
|
|
10
|
+
* `false` on the server, where there is no platform to read; the value is corrected on
|
|
11
|
+
* hydration, and an attribute that names a key is safe to settle a tick late.
|
|
12
|
+
*/
|
|
13
|
+
export declare const isApplePlatform: boolean;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
1
|
export const browser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
2
2
|
export const dev = import.meta.env?.DEV ?? false;
|
|
3
|
+
/**
|
|
4
|
+
* Whether the platform uses Cmd where the rest use Ctrl.
|
|
5
|
+
*
|
|
6
|
+
* Only for *naming* a shortcut — `aria-keyshortcuts`, a hint in the UI. Never gate behaviour
|
|
7
|
+
* on it: handlers should accept `ctrlKey || metaKey` and let either work everywhere, which is
|
|
8
|
+
* both simpler and right for a user on an Apple keyboard plugged into something else.
|
|
9
|
+
*
|
|
10
|
+
* `false` on the server, where there is no platform to read; the value is corrected on
|
|
11
|
+
* hydration, and an attribute that names a key is safe to settle a tick late.
|
|
12
|
+
*/
|
|
13
|
+
export const isApplePlatform = browser &&
|
|
14
|
+
/mac|iphone|ipad|ipod/i.test(navigator.userAgentData?.platform ??
|
|
15
|
+
navigator.platform ??
|
|
16
|
+
'');
|