ui-ingredients 0.0.24 → 0.0.26
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +3 -3
- package/dist/accordion/item-content.svelte +14 -7
- package/dist/accordion/item-indicator.svelte +14 -7
- package/dist/accordion/item-trigger.svelte +13 -6
- package/dist/accordion/item.svelte +11 -6
- package/dist/accordion/root.svelte +12 -4
- package/dist/avatar/fallback.svelte +14 -7
- package/dist/avatar/image.svelte +11 -4
- package/dist/avatar/root.svelte +11 -13
- package/dist/carousel/indicator-group.svelte +14 -7
- package/dist/carousel/indicator.svelte +13 -6
- package/dist/carousel/item-group.svelte +14 -7
- package/dist/carousel/item.svelte +12 -8
- package/dist/carousel/next-trigger.svelte +13 -6
- package/dist/carousel/prev-trigger.svelte +13 -6
- package/dist/carousel/root.svelte +11 -5
- package/dist/carousel/viewport.svelte +14 -7
- package/dist/checkbox/control.svelte +14 -7
- package/dist/checkbox/hidden-input.svelte +1 -1
- package/dist/checkbox/indicator.svelte +14 -7
- package/dist/checkbox/label.svelte +14 -7
- package/dist/checkbox/root.svelte +12 -4
- package/dist/clipboard/control.svelte +14 -7
- package/dist/clipboard/indicator.svelte +14 -7
- package/dist/clipboard/input.svelte +11 -4
- package/dist/clipboard/label.svelte +14 -6
- package/dist/clipboard/root.svelte +13 -5
- package/dist/clipboard/trigger.svelte +13 -6
- package/dist/collapsible/content.svelte +14 -7
- package/dist/collapsible/root.svelte +14 -6
- package/dist/collapsible/trigger.svelte +13 -6
- package/dist/color-picker/area-background.svelte +21 -0
- package/dist/color-picker/area-background.svelte.d.ts +18 -0
- package/dist/color-picker/area-thumb.svelte +21 -0
- package/dist/color-picker/area-thumb.svelte.d.ts +18 -0
- package/dist/color-picker/area.svelte +27 -0
- package/dist/color-picker/area.svelte.d.ts +18 -0
- package/dist/color-picker/channel-input.svelte +28 -0
- package/dist/color-picker/channel-input.svelte.d.ts +18 -0
- package/dist/color-picker/channel-slider-label.svelte +25 -0
- package/dist/color-picker/channel-slider-label.svelte.d.ts +18 -0
- package/dist/color-picker/channel-slider-thumb.svelte +23 -0
- package/dist/color-picker/channel-slider-thumb.svelte.d.ts +18 -0
- package/dist/color-picker/channel-slider-track.svelte +23 -0
- package/dist/color-picker/channel-slider-track.svelte.d.ts +18 -0
- package/dist/color-picker/channel-slider-value-text.svelte +29 -0
- package/dist/color-picker/channel-slider-value-text.svelte.d.ts +18 -0
- package/dist/color-picker/channel-slider.svelte +29 -0
- package/dist/color-picker/channel-slider.svelte.d.ts +18 -0
- package/dist/color-picker/color-picker.d.ts +26 -0
- package/dist/color-picker/color-picker.js +26 -0
- package/dist/color-picker/content.svelte +20 -0
- package/dist/color-picker/content.svelte.d.ts +18 -0
- package/dist/color-picker/context.svelte.d.ts +8 -0
- package/dist/color-picker/context.svelte.js +6 -0
- package/dist/color-picker/control.svelte +20 -0
- package/dist/color-picker/control.svelte.d.ts +18 -0
- package/dist/color-picker/create-color-picker.svelte.d.ts +9 -0
- package/dist/color-picker/create-color-picker.svelte.js +20 -0
- package/dist/color-picker/eye-dropper-trigger.svelte +20 -0
- package/dist/color-picker/eye-dropper-trigger.svelte.d.ts +18 -0
- package/dist/color-picker/format-select.svelte +28 -0
- package/dist/color-picker/format-select.svelte.d.ts +18 -0
- package/dist/color-picker/format-trigger.svelte +20 -0
- package/dist/color-picker/format-trigger.svelte.d.ts +18 -0
- package/dist/color-picker/hidden-input.svelte +18 -0
- package/dist/color-picker/hidden-input.svelte.d.ts +18 -0
- package/dist/color-picker/index.d.ts +26 -0
- package/dist/color-picker/index.js +1 -0
- package/dist/color-picker/label.svelte +20 -0
- package/dist/color-picker/label.svelte.d.ts +18 -0
- package/dist/color-picker/positioner.svelte +20 -0
- package/dist/color-picker/positioner.svelte.d.ts +18 -0
- package/dist/color-picker/root.svelte +75 -0
- package/dist/color-picker/root.svelte.d.ts +18 -0
- package/dist/color-picker/swatch-group.svelte +20 -0
- package/dist/color-picker/swatch-group.svelte.d.ts +18 -0
- package/dist/color-picker/swatch-indicator.svelte +21 -0
- package/dist/color-picker/swatch-indicator.svelte.d.ts +18 -0
- package/dist/color-picker/swatch-trigger.svelte +31 -0
- package/dist/color-picker/swatch-trigger.svelte.d.ts +18 -0
- package/dist/color-picker/swatch.svelte +27 -0
- package/dist/color-picker/swatch.svelte.d.ts +18 -0
- package/dist/color-picker/transparency-grid.svelte +29 -0
- package/dist/color-picker/transparency-grid.svelte.d.ts +18 -0
- package/dist/color-picker/trigger.svelte +20 -0
- package/dist/color-picker/trigger.svelte.d.ts +18 -0
- package/dist/color-picker/value-text.svelte +24 -0
- package/dist/color-picker/value-text.svelte.d.ts +18 -0
- package/dist/combobox/clear-trigger.svelte +13 -6
- package/dist/combobox/content.svelte +14 -7
- package/dist/combobox/control.svelte +14 -7
- package/dist/combobox/input.svelte +11 -4
- package/dist/combobox/item-group-label.svelte +14 -7
- package/dist/combobox/item-group.svelte +14 -8
- package/dist/combobox/item-indicator.svelte +14 -7
- package/dist/combobox/item-text.svelte +18 -11
- package/dist/combobox/item.svelte +11 -6
- package/dist/combobox/label.svelte +13 -6
- package/dist/combobox/list.svelte +14 -7
- package/dist/combobox/positioner.svelte +14 -7
- package/dist/combobox/root.svelte +11 -5
- package/dist/combobox/trigger.svelte +13 -6
- package/dist/date-picker/clear-trigger.svelte +13 -6
- package/dist/date-picker/content.svelte +14 -7
- package/dist/date-picker/control.svelte +14 -7
- package/dist/date-picker/create-date-picker.svelte.d.ts +2 -0
- package/dist/date-picker/create-date-picker.svelte.js +11 -1
- package/dist/date-picker/date-picker.d.ts +1 -0
- package/dist/date-picker/date-picker.js +1 -0
- package/dist/date-picker/day-table-cell-trigger.svelte +13 -6
- package/dist/date-picker/day-table-cell.svelte +12 -13
- package/dist/date-picker/index.d.ts +1 -0
- package/dist/date-picker/input.svelte +11 -4
- package/dist/date-picker/label.svelte +13 -6
- package/dist/date-picker/month-select.svelte +19 -12
- package/dist/date-picker/month-table-cell-trigger.svelte +13 -6
- package/dist/date-picker/month-table-cell.svelte +12 -13
- package/dist/date-picker/next-trigger.svelte +13 -6
- package/dist/date-picker/positioner.svelte +14 -7
- package/dist/date-picker/preset-trigger.svelte +14 -6
- package/dist/date-picker/prev-trigger.svelte +13 -6
- package/dist/date-picker/range-text.svelte +18 -11
- package/dist/date-picker/root.svelte +13 -5
- package/dist/date-picker/table-body.svelte +14 -7
- package/dist/date-picker/table-head.svelte +14 -7
- package/dist/date-picker/table-header.svelte +14 -7
- package/dist/date-picker/table-row.svelte +14 -7
- package/dist/date-picker/table.svelte +14 -8
- package/dist/date-picker/trigger.svelte +13 -6
- package/dist/date-picker/view-control.svelte +14 -7
- package/dist/date-picker/view-trigger.svelte +28 -0
- package/dist/date-picker/view-trigger.svelte.d.ts +18 -0
- package/dist/date-picker/view.svelte +22 -9
- package/dist/date-picker/year-select.svelte +19 -12
- package/dist/date-picker/year-table-cell-trigger.svelte +13 -6
- package/dist/date-picker/year-table-cell.svelte +12 -13
- package/dist/dialog/backdrop.svelte +14 -7
- package/dist/dialog/close-trigger.svelte +13 -6
- package/dist/dialog/content.svelte +14 -7
- package/dist/dialog/description.svelte +14 -7
- package/dist/dialog/positioner.svelte +14 -7
- package/dist/dialog/title.svelte +14 -7
- package/dist/dialog/trigger.svelte +13 -6
- package/dist/editable/area.svelte +14 -7
- package/dist/editable/cancel-trigger.svelte +13 -6
- package/dist/editable/control.svelte +14 -7
- package/dist/editable/edit-trigger.svelte +13 -6
- package/dist/editable/input.svelte +11 -4
- package/dist/editable/label.svelte +13 -6
- package/dist/editable/preview.svelte +18 -11
- package/dist/editable/submit-trigger.svelte +13 -6
- package/dist/file-upload/dropzone.svelte +14 -7
- package/dist/file-upload/hidden-input.svelte +1 -1
- package/dist/file-upload/item-delete-trigger.svelte +13 -6
- package/dist/file-upload/item-group.svelte +14 -7
- package/dist/file-upload/item-name.svelte +18 -11
- package/dist/file-upload/item-preview-image.svelte +11 -4
- package/dist/file-upload/item-preview.svelte +14 -7
- package/dist/file-upload/item-size-text.svelte +18 -11
- package/dist/file-upload/item.svelte +14 -7
- package/dist/file-upload/label.svelte +13 -6
- package/dist/file-upload/root.svelte +1 -1
- package/dist/file-upload/trigger.svelte +13 -6
- package/dist/hover-card/arrow-tip.svelte +14 -7
- package/dist/hover-card/arrow.svelte +14 -7
- package/dist/hover-card/content.svelte +14 -7
- package/dist/hover-card/positioner.svelte +14 -7
- package/dist/hover-card/trigger.svelte +14 -7
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/menu/arrow-tip.svelte +14 -7
- package/dist/menu/arrow.svelte +14 -7
- package/dist/menu/content.svelte +14 -7
- package/dist/menu/context-trigger.svelte +13 -6
- package/dist/menu/indicator.svelte +14 -7
- package/dist/menu/item-group-label.svelte +14 -7
- package/dist/menu/item-group.svelte +15 -9
- package/dist/menu/item.svelte +1 -1
- package/dist/menu/option-item-indicator.svelte +14 -7
- package/dist/menu/option-item-text.svelte +18 -11
- package/dist/menu/option-item.svelte +11 -5
- package/dist/menu/positioner.svelte +14 -7
- package/dist/menu/separator.svelte +14 -7
- package/dist/menu/trigger-item.svelte +14 -7
- package/dist/menu/trigger.svelte +14 -7
- package/dist/number-input/control.svelte +14 -7
- package/dist/number-input/decrement-trigger.svelte +13 -6
- package/dist/number-input/increment-trigger.svelte +14 -7
- package/dist/number-input/input.svelte +11 -4
- package/dist/number-input/label.svelte +13 -6
- package/dist/number-input/root.svelte +13 -5
- package/dist/number-input/scrubber.svelte +14 -7
- package/dist/pagination/ellipsis.svelte +14 -7
- package/dist/pagination/item.svelte +13 -6
- package/dist/pagination/next-trigger.svelte +13 -6
- package/dist/pagination/prev-trigger.svelte +13 -6
- package/dist/pagination/root.svelte +13 -5
- package/dist/pin-input/anatomy.js +3 -0
- package/dist/pin-input/clear-trigger.svelte +18 -12
- package/dist/pin-input/create-pin-input.svelte.d.ts +2 -0
- package/dist/pin-input/create-pin-input.svelte.js +13 -1
- package/dist/pin-input/hidden-input.svelte +1 -1
- package/dist/pin-input/input.svelte +11 -4
- package/dist/pin-input/label.svelte +13 -6
- package/dist/pin-input/pin-input.d.ts +1 -1
- package/dist/pin-input/pin-input.js +1 -1
- package/dist/pin-input/root.svelte +11 -5
- package/dist/popover/arrow-tip.svelte +14 -7
- package/dist/popover/arrow.svelte +14 -7
- package/dist/popover/close-trigger.svelte +13 -6
- package/dist/popover/content.svelte +14 -7
- package/dist/popover/description.svelte +14 -7
- package/dist/popover/positioner.svelte +14 -7
- package/dist/popover/title.svelte +14 -7
- package/dist/popover/trigger.svelte +13 -6
- package/dist/presence/context.svelte.d.ts +3 -0
- package/dist/presence/context.svelte.js +2 -0
- package/dist/presence/create-presence.svelte.d.ts +11 -4
- package/dist/presence/create-presence.svelte.js +19 -3
- package/dist/presence/root.svelte +9 -9
- package/dist/presence/root.svelte.d.ts +1 -1
- package/dist/progress/circle-range.svelte +13 -6
- package/dist/progress/circle-track.svelte +13 -6
- package/dist/progress/circle.svelte +13 -6
- package/dist/progress/index.d.ts +1 -0
- package/dist/progress/label.svelte +14 -7
- package/dist/progress/progress.d.ts +1 -0
- package/dist/progress/progress.js +1 -0
- package/dist/progress/range.svelte +14 -7
- package/dist/progress/root.svelte +11 -5
- package/dist/progress/track.svelte +14 -7
- package/dist/progress/value-text.svelte +18 -11
- package/dist/progress/view.svelte +28 -0
- package/dist/progress/view.svelte.d.ts +18 -0
- package/dist/qr-code/frame.svelte +13 -6
- package/dist/qr-code/overlay.svelte +14 -7
- package/dist/qr-code/pattern.svelte +13 -6
- package/dist/qr-code/root.svelte +11 -5
- package/dist/radio-group/indicator.svelte +14 -7
- package/dist/radio-group/item-control.svelte +14 -7
- package/dist/radio-group/item-hidden-input.svelte +1 -1
- package/dist/radio-group/item-text.svelte +14 -7
- package/dist/radio-group/item.svelte +10 -12
- package/dist/radio-group/label.svelte +14 -7
- package/dist/radio-group/root.svelte +13 -5
- package/dist/rating-group/control.svelte +16 -9
- package/dist/rating-group/hidden-input.svelte +1 -1
- package/dist/rating-group/item.svelte +14 -9
- package/dist/rating-group/label.svelte +15 -8
- package/dist/rating-group/root.svelte +17 -9
- package/dist/segment-group/indicator.svelte +14 -8
- package/dist/segment-group/item-control.svelte +15 -8
- package/dist/segment-group/item-hidden-input.svelte +1 -1
- package/dist/segment-group/item-text.svelte +14 -8
- package/dist/segment-group/item.svelte +10 -5
- package/dist/segment-group/label.svelte +14 -8
- package/dist/segment-group/root.svelte +13 -6
- package/dist/select/clear-trigger.svelte +13 -6
- package/dist/select/content.svelte +14 -7
- package/dist/select/control.svelte +14 -7
- package/dist/select/hidden-select.svelte +1 -1
- package/dist/select/indicator.svelte +14 -7
- package/dist/select/item-group-label.svelte +14 -7
- package/dist/select/item-group.svelte +14 -8
- package/dist/select/item-indicator.svelte +14 -7
- package/dist/select/item-text.svelte +18 -11
- package/dist/select/item.svelte +11 -6
- package/dist/select/label.svelte +13 -6
- package/dist/select/list.svelte +14 -7
- package/dist/select/positioner.svelte +14 -7
- package/dist/select/root.svelte +12 -6
- package/dist/select/trigger.svelte +13 -6
- package/dist/select/value-text.svelte +20 -13
- package/dist/signature-pad/clear-trigger.svelte +14 -7
- package/dist/signature-pad/control.svelte +14 -7
- package/dist/signature-pad/current-segment-path.svelte +13 -6
- package/dist/signature-pad/guide.svelte +14 -7
- package/dist/signature-pad/hidden-input.svelte +1 -1
- package/dist/signature-pad/label.svelte +13 -6
- package/dist/signature-pad/root.svelte +13 -5
- package/dist/signature-pad/segment-path.svelte +13 -6
- package/dist/signature-pad/segment.svelte +13 -6
- package/dist/slider/control.svelte +14 -7
- package/dist/slider/hidden-input.svelte +1 -1
- package/dist/slider/label.svelte +13 -6
- package/dist/slider/marker-group.svelte +14 -7
- package/dist/slider/marker.svelte +14 -7
- package/dist/slider/range.svelte +14 -7
- package/dist/slider/root.svelte +11 -5
- package/dist/slider/thumb.svelte +14 -7
- package/dist/slider/track.svelte +14 -7
- package/dist/slider/value-text.svelte +18 -11
- package/dist/splitter/context.svelte.d.ts +3 -0
- package/dist/splitter/context.svelte.js +2 -0
- package/dist/splitter/create-splitter.svelte.d.ts +7 -0
- package/dist/splitter/create-splitter.svelte.js +17 -0
- package/dist/splitter/index.d.ts +4 -0
- package/dist/splitter/index.js +1 -0
- package/dist/splitter/panel.svelte +36 -0
- package/dist/splitter/panel.svelte.d.ts +18 -0
- package/dist/splitter/resize-trigger.svelte +46 -0
- package/dist/splitter/resize-trigger.svelte.d.ts +18 -0
- package/dist/splitter/root.svelte +50 -0
- package/dist/splitter/root.svelte.d.ts +18 -0
- package/dist/splitter/splitter.d.ts +4 -0
- package/dist/splitter/splitter.js +4 -0
- package/dist/steps/completed-content.svelte +14 -7
- package/dist/steps/content.svelte +14 -7
- package/dist/steps/indicator.svelte +14 -7
- package/dist/steps/item.svelte +11 -6
- package/dist/steps/list.svelte +15 -7
- package/dist/steps/next-trigger.svelte +13 -6
- package/dist/steps/prev-trigger.svelte +13 -6
- package/dist/steps/progress.svelte +14 -7
- package/dist/steps/root.svelte +12 -6
- package/dist/steps/separator.svelte +14 -7
- package/dist/steps/trigger.svelte +13 -6
- package/dist/switch/control.svelte +14 -7
- package/dist/switch/hidden-input.svelte +1 -1
- package/dist/switch/label.svelte +14 -7
- package/dist/switch/root.svelte +10 -4
- package/dist/switch/thumb.svelte +14 -7
- package/dist/tabs/content.svelte +14 -7
- package/dist/tabs/list.svelte +14 -7
- package/dist/tabs/root.svelte +12 -6
- package/dist/tabs/trigger.svelte +13 -6
- package/dist/tags-input/clear-trigger.svelte +13 -6
- package/dist/tags-input/control.svelte +14 -7
- package/dist/tags-input/hidden-input.svelte +1 -1
- package/dist/tags-input/input.svelte +11 -4
- package/dist/tags-input/item-delete-trigger.svelte +13 -6
- package/dist/tags-input/item-input.svelte +12 -4
- package/dist/tags-input/item-preview.svelte +14 -7
- package/dist/tags-input/item-text.svelte +14 -7
- package/dist/tags-input/item.svelte +11 -13
- package/dist/tags-input/label.svelte +13 -6
- package/dist/tags-input/root.svelte +14 -6
- package/dist/time-picker/clear-trigger.svelte +27 -0
- package/dist/time-picker/clear-trigger.svelte.d.ts +18 -0
- package/dist/time-picker/column.svelte +28 -0
- package/dist/time-picker/column.svelte.d.ts +18 -0
- package/dist/time-picker/content.svelte +27 -0
- package/dist/time-picker/content.svelte.d.ts +18 -0
- package/dist/time-picker/context.svelte.d.ts +3 -0
- package/dist/time-picker/context.svelte.js +2 -0
- package/dist/time-picker/control.svelte +27 -0
- package/dist/time-picker/control.svelte.d.ts +18 -0
- package/dist/time-picker/create-time-picker.svelte.d.ts +8 -0
- package/dist/time-picker/create-time-picker.svelte.js +20 -0
- package/dist/time-picker/hour-cell.svelte +28 -0
- package/dist/time-picker/hour-cell.svelte.d.ts +18 -0
- package/dist/time-picker/index.d.ts +15 -0
- package/dist/time-picker/index.js +1 -0
- package/dist/time-picker/input.svelte +25 -0
- package/dist/time-picker/input.svelte.d.ts +18 -0
- package/dist/time-picker/label.svelte +27 -0
- package/dist/time-picker/label.svelte.d.ts +18 -0
- package/dist/time-picker/minute-cell.svelte +28 -0
- package/dist/time-picker/minute-cell.svelte.d.ts +18 -0
- package/dist/time-picker/period-cell.svelte +36 -0
- package/dist/time-picker/period-cell.svelte.d.ts +18 -0
- package/dist/time-picker/positioner.svelte +27 -0
- package/dist/time-picker/positioner.svelte.d.ts +18 -0
- package/dist/time-picker/root.svelte +78 -0
- package/dist/time-picker/root.svelte.d.ts +18 -0
- package/dist/time-picker/second-cell.svelte +28 -0
- package/dist/time-picker/second-cell.svelte.d.ts +18 -0
- package/dist/time-picker/spacer.svelte +27 -0
- package/dist/time-picker/spacer.svelte.d.ts +18 -0
- package/dist/time-picker/time-picker.d.ts +15 -0
- package/dist/time-picker/time-picker.js +15 -0
- package/dist/time-picker/trigger.svelte +27 -0
- package/dist/time-picker/trigger.svelte.d.ts +18 -0
- package/dist/timer/action-trigger.svelte +13 -7
- package/dist/timer/item-label.svelte +14 -7
- package/dist/timer/item-value.svelte +18 -11
- package/dist/timer/item.svelte +14 -7
- package/dist/timer/root.svelte +11 -5
- package/dist/timer/separator.svelte +14 -7
- package/dist/toast/action-trigger.svelte +13 -6
- package/dist/toast/actor.svelte +6 -6
- package/dist/toast/actor.svelte.d.ts +3 -3
- package/dist/toast/close-trigger.svelte +13 -6
- package/dist/toast/description.svelte +18 -11
- package/dist/toast/root.svelte +16 -14
- package/dist/toast/title.svelte +18 -11
- package/dist/toast/toaster.svelte +3 -2
- package/dist/toggle-group/item.svelte +10 -5
- package/dist/toggle-group/root.svelte +14 -6
- package/dist/tooltip/arrow-tip.svelte +14 -7
- package/dist/tooltip/arrow.svelte +14 -7
- package/dist/tooltip/content.svelte +14 -7
- package/dist/tooltip/positioner.svelte +14 -7
- package/dist/tooltip/trigger.svelte +13 -6
- package/dist/tree-view/branch-content.svelte +14 -7
- package/dist/tree-view/branch-control.svelte +14 -7
- package/dist/tree-view/branch-indicator.svelte +14 -7
- package/dist/tree-view/branch-text.svelte +14 -7
- package/dist/tree-view/branch-trigger.svelte +14 -7
- package/dist/tree-view/branch.svelte +11 -13
- package/dist/tree-view/item-indicator.svelte +14 -7
- package/dist/tree-view/item-text.svelte +14 -7
- package/dist/tree-view/item.svelte +11 -13
- package/dist/tree-view/label.svelte +14 -7
- package/dist/tree-view/root.svelte +12 -6
- package/dist/tree-view/tree.svelte +14 -7
- package/dist/types.d.ts +2 -1
- package/dist/utils.svelte.d.ts +2 -5
- package/dist/utils.svelte.js +9 -9
- package/package.json +4 -3
- package/dist/color-picker/.gitkeep +0 -0
- package/dist/time-picker/.gitkeep +0 -0
@@ -1,14 +1,17 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {HtmlProps} from '../types.js';
|
2
|
+
import type {GenericHtmlProps, HtmlProps} from '../types.js';
|
3
|
+
import type {Snippet} from 'svelte';
|
3
4
|
|
4
|
-
export interface ComboboxItemIndicatorProps extends HtmlProps<'
|
5
|
+
export interface ComboboxItemIndicatorProps extends HtmlProps<'div'> {
|
6
|
+
asChild?: Snippet<[attrs: Omit<GenericHtmlProps, 'children'>]>;
|
7
|
+
}
|
5
8
|
</script>
|
6
9
|
|
7
10
|
<script lang="ts">
|
8
|
-
import {mergeProps} from '
|
11
|
+
import {mergeProps} from '../utils.svelte.js';
|
9
12
|
import {comboboxContext, comboboxItemPropsContext} from './context.svelte.js';
|
10
13
|
|
11
|
-
let {children, ...props}: ComboboxItemIndicatorProps = $props();
|
14
|
+
let {asChild, children, ...props}: ComboboxItemIndicatorProps = $props();
|
12
15
|
|
13
16
|
let combobox = comboboxContext.get();
|
14
17
|
let itemProps = comboboxItemPropsContext.get();
|
@@ -16,6 +19,10 @@
|
|
16
19
|
let attrs = $derived(mergeProps(props, combobox.getItemIndicatorProps(itemProps)));
|
17
20
|
</script>
|
18
21
|
|
19
|
-
|
20
|
-
{@render
|
21
|
-
|
22
|
+
{#if asChild}
|
23
|
+
{@render asChild(attrs)}
|
24
|
+
{:else}
|
25
|
+
<div {...attrs}>
|
26
|
+
{@render children?.()}
|
27
|
+
</div>
|
28
|
+
{/if}
|
@@ -1,14 +1,17 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {HtmlProps} from '../types.js';
|
2
|
+
import type {GenericHtmlProps, HtmlProps} from '../types.js';
|
3
|
+
import type {Snippet} from 'svelte';
|
3
4
|
|
4
|
-
export interface ComboboxItemTextProps extends HtmlProps<'
|
5
|
+
export interface ComboboxItemTextProps extends HtmlProps<'div'> {
|
6
|
+
asChild?: Snippet<[attrs: Omit<GenericHtmlProps, 'children'>]>;
|
7
|
+
}
|
5
8
|
</script>
|
6
9
|
|
7
10
|
<script lang="ts">
|
8
|
-
import {mergeProps} from '
|
11
|
+
import {mergeProps} from '../utils.svelte.js';
|
9
12
|
import {comboboxContext, comboboxItemPropsContext} from './context.svelte.js';
|
10
13
|
|
11
|
-
let {children, ...props}: ComboboxItemTextProps = $props();
|
14
|
+
let {asChild, children, ...props}: ComboboxItemTextProps = $props();
|
12
15
|
|
13
16
|
let combobox = comboboxContext.get();
|
14
17
|
let itemProps = comboboxItemPropsContext.get();
|
@@ -16,10 +19,14 @@
|
|
16
19
|
let attrs = $derived(mergeProps(props, combobox.getItemTextProps(itemProps)));
|
17
20
|
</script>
|
18
21
|
|
19
|
-
|
20
|
-
{
|
21
|
-
|
22
|
-
{
|
23
|
-
{
|
24
|
-
|
25
|
-
|
22
|
+
{#if asChild}
|
23
|
+
{@render asChild(attrs)}
|
24
|
+
{:else}
|
25
|
+
<div {...attrs}>
|
26
|
+
{#if children}
|
27
|
+
{@render children?.()}
|
28
|
+
{:else}
|
29
|
+
{combobox.collection.stringifyItem(itemProps.item)}
|
30
|
+
{/if}
|
31
|
+
</div>
|
32
|
+
{/if}
|
@@ -1,18 +1,19 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign, HtmlProps} from '../types.js';
|
2
|
+
import type {Assign, GenericHtmlProps, HtmlProps} from '../types.js';
|
3
3
|
import type {ItemProps, ItemState} from '@zag-js/combobox';
|
4
4
|
import type {Snippet} from 'svelte';
|
5
5
|
|
6
6
|
export interface ComboboxItemProps extends Assign<Omit<HtmlProps<'div'>, 'children'>, ItemProps> {
|
7
|
+
asChild?: Snippet<[attrs: Omit<GenericHtmlProps, 'children'>, state: ItemState]>;
|
7
8
|
children?: Snippet<[state: ItemState]>;
|
8
9
|
}
|
9
10
|
</script>
|
10
11
|
|
11
12
|
<script lang="ts">
|
12
|
-
import {mergeProps} from '
|
13
|
+
import {mergeProps} from '../utils.svelte.js';
|
13
14
|
import {comboboxContext, comboboxItemPropsContext} from './context.svelte.js';
|
14
15
|
|
15
|
-
let {
|
16
|
+
let {item, persistFocus, asChild, children, ...props}: ComboboxItemProps = $props();
|
16
17
|
|
17
18
|
let combobox = comboboxContext.get();
|
18
19
|
let itemProps = $derived({
|
@@ -26,6 +27,10 @@
|
|
26
27
|
comboboxItemPropsContext.set(() => itemProps);
|
27
28
|
</script>
|
28
29
|
|
29
|
-
|
30
|
-
{@render
|
31
|
-
|
30
|
+
{#if asChild}
|
31
|
+
{@render asChild(attrs, state)}
|
32
|
+
{:else}
|
33
|
+
<div {...attrs}>
|
34
|
+
{@render children?.(state)}
|
35
|
+
</div>
|
36
|
+
{/if}
|
@@ -1,20 +1,27 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlProps} from '../types.js';
|
3
|
+
import type {Snippet} from 'svelte';
|
3
4
|
|
4
|
-
export interface ComboboxLabelProps extends HtmlProps<'label'> {
|
5
|
+
export interface ComboboxLabelProps extends HtmlProps<'label'> {
|
6
|
+
asChild?: Snippet<[attrs: Omit<HtmlProps<'label'>, 'children'>]>;
|
7
|
+
}
|
5
8
|
</script>
|
6
9
|
|
7
10
|
<script lang="ts">
|
8
|
-
import {mergeProps} from '
|
11
|
+
import {mergeProps} from '../utils.svelte.js';
|
9
12
|
import {comboboxContext} from './context.svelte.js';
|
10
13
|
|
11
|
-
let {children, ...props}: ComboboxLabelProps = $props();
|
14
|
+
let {asChild, children, ...props}: ComboboxLabelProps = $props();
|
12
15
|
|
13
16
|
let combobox = comboboxContext.get();
|
14
17
|
|
15
18
|
let attrs = $derived(mergeProps(props, combobox.getLabelProps()));
|
16
19
|
</script>
|
17
20
|
|
18
|
-
|
19
|
-
{@render
|
20
|
-
|
21
|
+
{#if asChild}
|
22
|
+
{@render asChild(attrs)}
|
23
|
+
{:else}
|
24
|
+
<label {...attrs}>
|
25
|
+
{@render children?.()}
|
26
|
+
</label>
|
27
|
+
{/if}
|
@@ -1,20 +1,27 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {HtmlProps} from '../types.js';
|
2
|
+
import type {GenericHtmlProps, HtmlProps} from '../types.js';
|
3
|
+
import type {Snippet} from 'svelte';
|
3
4
|
|
4
|
-
export interface ComboboxListProps extends HtmlProps<'div'> {
|
5
|
+
export interface ComboboxListProps extends HtmlProps<'div'> {
|
6
|
+
asChild?: Snippet<[attrs: Omit<GenericHtmlProps, 'children'>]>;
|
7
|
+
}
|
5
8
|
</script>
|
6
9
|
|
7
10
|
<script lang="ts">
|
8
|
-
import {mergeProps} from '
|
11
|
+
import {mergeProps} from '../utils.svelte.js';
|
9
12
|
import {comboboxContext} from './context.svelte.js';
|
10
13
|
|
11
|
-
let {children, ...props}: ComboboxListProps = $props();
|
14
|
+
let {asChild, children, ...props}: ComboboxListProps = $props();
|
12
15
|
|
13
16
|
let combobox = comboboxContext.get();
|
14
17
|
|
15
18
|
let attrs = $derived(mergeProps(props, combobox.getListProps()));
|
16
19
|
</script>
|
17
20
|
|
18
|
-
|
19
|
-
{@render
|
20
|
-
|
21
|
+
{#if asChild}
|
22
|
+
{@render asChild(attrs)}
|
23
|
+
{:else}
|
24
|
+
<div {...attrs}>
|
25
|
+
{@render children?.()}
|
26
|
+
</div>
|
27
|
+
{/if}
|
@@ -1,20 +1,27 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {HtmlProps} from '../types.js';
|
2
|
+
import type {GenericHtmlProps, HtmlProps} from '../types.js';
|
3
|
+
import type {Snippet} from 'svelte';
|
3
4
|
|
4
|
-
export interface ComboboxPositionerProps extends HtmlProps<'div'> {
|
5
|
+
export interface ComboboxPositionerProps extends HtmlProps<'div'> {
|
6
|
+
asChild?: Snippet<[attrs: Omit<GenericHtmlProps, 'children'>]>;
|
7
|
+
}
|
5
8
|
</script>
|
6
9
|
|
7
10
|
<script lang="ts">
|
8
|
-
import {mergeProps} from '
|
11
|
+
import {mergeProps} from '../utils.svelte.js';
|
9
12
|
import {comboboxContext} from './context.svelte.js';
|
10
13
|
|
11
|
-
let {children, ...props}: ComboboxPositionerProps = $props();
|
14
|
+
let {asChild, children, ...props}: ComboboxPositionerProps = $props();
|
12
15
|
|
13
16
|
let combobox = comboboxContext.get();
|
14
17
|
|
15
18
|
let attrs = $derived(mergeProps(props, combobox.getPositionerProps()));
|
16
19
|
</script>
|
17
20
|
|
18
|
-
|
19
|
-
{@render
|
20
|
-
|
21
|
+
{#if asChild}
|
22
|
+
{@render asChild(attrs)}
|
23
|
+
{:else}
|
24
|
+
<div {...attrs}>
|
25
|
+
{@render children?.()}
|
26
|
+
</div>
|
27
|
+
{/if}
|
@@ -1,16 +1,17 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign, HtmlProps} from '../types.js';
|
2
|
+
import type {Assign, GenericHtmlProps, HtmlProps} from '../types.js';
|
3
3
|
import type {Snippet} from 'svelte';
|
4
4
|
import type {CreateComboboxProps, CreateComboboxReturn} from './create-combobox.svelte.js';
|
5
5
|
|
6
6
|
export interface ComboboxProps<T>
|
7
7
|
extends Assign<Omit<HtmlProps<'div'>, 'children'>, CreateComboboxProps<T>> {
|
8
|
+
asChild?: Snippet<[attrs: Omit<GenericHtmlProps, 'children'>, combobox: CreateComboboxReturn]>;
|
8
9
|
children?: Snippet<[combobox: CreateComboboxReturn]>;
|
9
10
|
}
|
10
11
|
</script>
|
11
12
|
|
12
13
|
<script lang="ts" generics="T">
|
13
|
-
import {mergeProps} from '
|
14
|
+
import {mergeProps} from '../utils.svelte.js';
|
14
15
|
import {comboboxContext} from './context.svelte.js';
|
15
16
|
import {createCombobox} from './create-combobox.svelte.js';
|
16
17
|
|
@@ -56,6 +57,7 @@
|
|
56
57
|
onPointerDownOutside,
|
57
58
|
getSelectionValue,
|
58
59
|
scrollToIndexFn,
|
60
|
+
asChild,
|
59
61
|
children,
|
60
62
|
...props
|
61
63
|
}: ComboboxProps<T> = $props();
|
@@ -109,6 +111,10 @@
|
|
109
111
|
comboboxContext.set(combobox);
|
110
112
|
</script>
|
111
113
|
|
112
|
-
|
113
|
-
{@render
|
114
|
-
|
114
|
+
{#if asChild}
|
115
|
+
{@render asChild(attrs, combobox)}
|
116
|
+
{:else}
|
117
|
+
<div {...attrs}>
|
118
|
+
{@render children?.(combobox)}
|
119
|
+
</div>
|
120
|
+
{/if}
|
@@ -1,20 +1,27 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlProps} from '../types.js';
|
3
|
+
import type {Snippet} from 'svelte';
|
3
4
|
|
4
|
-
export interface ComboboxTriggerProps extends HtmlProps<'button'> {
|
5
|
+
export interface ComboboxTriggerProps extends HtmlProps<'button'> {
|
6
|
+
asChild?: Snippet<[attrs: Omit<HtmlProps<'button'>, 'children'>]>;
|
7
|
+
}
|
5
8
|
</script>
|
6
9
|
|
7
10
|
<script lang="ts">
|
8
|
-
import {mergeProps} from '
|
11
|
+
import {mergeProps} from '../utils.svelte.js';
|
9
12
|
import {comboboxContext} from './context.svelte.js';
|
10
13
|
|
11
|
-
let {children, ...props}: ComboboxTriggerProps = $props();
|
14
|
+
let {asChild, children, ...props}: ComboboxTriggerProps = $props();
|
12
15
|
|
13
16
|
let combobox = comboboxContext.get();
|
14
17
|
|
15
18
|
let attrs = $derived(mergeProps(props, combobox.getTriggerProps()));
|
16
19
|
</script>
|
17
20
|
|
18
|
-
|
19
|
-
{@render
|
20
|
-
|
21
|
+
{#if asChild}
|
22
|
+
{@render asChild(attrs)}
|
23
|
+
{:else}
|
24
|
+
<button type="button" {...attrs}>
|
25
|
+
{@render children?.()}
|
26
|
+
</button>
|
27
|
+
{/if}
|
@@ -1,20 +1,27 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlProps} from '../types.js';
|
3
|
+
import type {Snippet} from 'svelte';
|
3
4
|
|
4
|
-
export interface DatePickerClearTriggerProps extends HtmlProps<'button'> {
|
5
|
+
export interface DatePickerClearTriggerProps extends HtmlProps<'button'> {
|
6
|
+
asChild?: Snippet<[attrs: Omit<HtmlProps<'button'>, 'children'>]>;
|
7
|
+
}
|
5
8
|
</script>
|
6
9
|
|
7
10
|
<script lang="ts">
|
8
|
-
import {mergeProps} from '
|
11
|
+
import {mergeProps} from '../utils.svelte.js';
|
9
12
|
import {datePickerContext} from './context.svelte.js';
|
10
13
|
|
11
|
-
let {children, ...props}: DatePickerClearTriggerProps = $props();
|
14
|
+
let {asChild, children, ...props}: DatePickerClearTriggerProps = $props();
|
12
15
|
|
13
16
|
let datePicker = datePickerContext.get();
|
14
17
|
|
15
18
|
let attrs = $derived(mergeProps(props, datePicker.getClearTriggerProps()));
|
16
19
|
</script>
|
17
20
|
|
18
|
-
|
19
|
-
{@render
|
20
|
-
|
21
|
+
{#if asChild}
|
22
|
+
{@render asChild(attrs)}
|
23
|
+
{:else}
|
24
|
+
<button type="button" {...attrs}>
|
25
|
+
{@render children?.()}
|
26
|
+
</button>
|
27
|
+
{/if}
|
@@ -1,20 +1,27 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {HtmlProps} from '../types.js';
|
2
|
+
import type {GenericHtmlProps, HtmlProps} from '../types.js';
|
3
|
+
import type {Snippet} from 'svelte';
|
3
4
|
|
4
|
-
export interface DatePickerContentProps extends HtmlProps<'div'> {
|
5
|
+
export interface DatePickerContentProps extends HtmlProps<'div'> {
|
6
|
+
asChild?: Snippet<[attrs: Omit<GenericHtmlProps, 'children'>]>;
|
7
|
+
}
|
5
8
|
</script>
|
6
9
|
|
7
10
|
<script lang="ts">
|
8
|
-
import {mergeProps} from '
|
11
|
+
import {mergeProps} from '../utils.svelte.js';
|
9
12
|
import {datePickerContext} from './context.svelte.js';
|
10
13
|
|
11
|
-
let {children, ...props}: DatePickerContentProps = $props();
|
14
|
+
let {asChild, children, ...props}: DatePickerContentProps = $props();
|
12
15
|
|
13
16
|
let datePicker = datePickerContext.get();
|
14
17
|
|
15
18
|
let attrs = $derived(mergeProps(props, datePicker.getContentProps()));
|
16
19
|
</script>
|
17
20
|
|
18
|
-
|
19
|
-
{@render
|
20
|
-
|
21
|
+
{#if asChild}
|
22
|
+
{@render asChild(attrs)}
|
23
|
+
{:else}
|
24
|
+
<div {...attrs}>
|
25
|
+
{@render children?.()}
|
26
|
+
</div>
|
27
|
+
{/if}
|
@@ -1,20 +1,27 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {HtmlProps} from '../types.js';
|
2
|
+
import type {GenericHtmlProps, HtmlProps} from '../types.js';
|
3
|
+
import type {Snippet} from 'svelte';
|
3
4
|
|
4
|
-
export interface DatePickerControlProps extends HtmlProps<'div'> {
|
5
|
+
export interface DatePickerControlProps extends HtmlProps<'div'> {
|
6
|
+
asChild?: Snippet<[attrs: Omit<GenericHtmlProps, 'children'>]>;
|
7
|
+
}
|
5
8
|
</script>
|
6
9
|
|
7
10
|
<script lang="ts">
|
8
|
-
import {mergeProps} from '
|
11
|
+
import {mergeProps} from '../utils.svelte.js';
|
9
12
|
import {datePickerContext} from './context.svelte.js';
|
10
13
|
|
11
|
-
let {children, ...props}: DatePickerControlProps = $props();
|
14
|
+
let {asChild, children, ...props}: DatePickerControlProps = $props();
|
12
15
|
|
13
16
|
let datePicker = datePickerContext.get();
|
14
17
|
|
15
18
|
let attrs = $derived(mergeProps(props, datePicker.getControlProps()));
|
16
19
|
</script>
|
17
20
|
|
18
|
-
|
19
|
-
{@render
|
20
|
-
|
21
|
+
{#if asChild}
|
22
|
+
{@render asChild(attrs)}
|
23
|
+
{:else}
|
24
|
+
<div {...attrs}>
|
25
|
+
{@render children?.()}
|
26
|
+
</div>
|
27
|
+
{/if}
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import type { GenericHtmlProps } from '../types.js';
|
1
2
|
import * as datePicker from '@zag-js/date-picker';
|
2
3
|
type Omitted = 'id' | 'dir' | 'min' | 'max' | 'value' | 'focusedValue' | 'getRootNode' | 'open.controlled';
|
3
4
|
export interface CreateDatePickerProps extends Omit<datePicker.Context, Omitted> {
|
@@ -9,6 +10,7 @@ export interface CreateDatePickerProps extends Omit<datePicker.Context, Omitted>
|
|
9
10
|
defaultOpen?: boolean;
|
10
11
|
}
|
11
12
|
export interface CreateDatePickerReturn extends datePicker.Api {
|
13
|
+
getViewProps(props: datePicker.ViewProps): GenericHtmlProps;
|
12
14
|
}
|
13
15
|
export declare function createDatePicker(props: CreateDatePickerProps): CreateDatePickerReturn;
|
14
16
|
export {};
|
@@ -19,6 +19,16 @@ export function createDatePicker(props) {
|
|
19
19
|
locale: props.locale ?? locale?.locale,
|
20
20
|
getRootNode: environment?.getRootNode,
|
21
21
|
}));
|
22
|
-
const api = $derived(reflect(() =>
|
22
|
+
const api = $derived(reflect(() => {
|
23
|
+
const o = datePicker.connect(state, send, normalizeProps);
|
24
|
+
return {
|
25
|
+
...o,
|
26
|
+
getViewProps(props) {
|
27
|
+
return {
|
28
|
+
hidden: o.view !== props.view,
|
29
|
+
};
|
30
|
+
},
|
31
|
+
};
|
32
|
+
}));
|
23
33
|
return api;
|
24
34
|
}
|
@@ -23,6 +23,7 @@ export { default as TableRow } from './table-row.svelte';
|
|
23
23
|
export { default as Table } from './table.svelte';
|
24
24
|
export { default as Trigger } from './trigger.svelte';
|
25
25
|
export { default as ViewControl } from './view-control.svelte';
|
26
|
+
export { default as ViewTrigger } from './view-trigger.svelte';
|
26
27
|
export { default as View } from './view.svelte';
|
27
28
|
export { default as YearSelect } from './year-select.svelte';
|
28
29
|
export { default as YearTableCellTrigger } from './year-table-cell-trigger.svelte';
|
@@ -23,6 +23,7 @@ export { default as TableRow } from './table-row.svelte';
|
|
23
23
|
export { default as Table } from './table.svelte';
|
24
24
|
export { default as Trigger } from './trigger.svelte';
|
25
25
|
export { default as ViewControl } from './view-control.svelte';
|
26
|
+
export { default as ViewTrigger } from './view-trigger.svelte';
|
26
27
|
export { default as View } from './view.svelte';
|
27
28
|
export { default as YearSelect } from './year-select.svelte';
|
28
29
|
export { default as YearTableCellTrigger } from './year-table-cell-trigger.svelte';
|
@@ -1,14 +1,17 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {HtmlProps} from '../types.js';
|
3
|
+
import type {Snippet} from 'svelte';
|
3
4
|
|
4
|
-
export interface DatePickerDayTableCellTriggerProps extends HtmlProps<'button'> {
|
5
|
+
export interface DatePickerDayTableCellTriggerProps extends HtmlProps<'button'> {
|
6
|
+
asChild?: Snippet<[attrs: Omit<HtmlProps<'button'>, 'children'>]>;
|
7
|
+
}
|
5
8
|
</script>
|
6
9
|
|
7
10
|
<script lang="ts">
|
8
|
-
import {mergeProps} from '
|
11
|
+
import {mergeProps} from '../utils.svelte.js';
|
9
12
|
import {datePickerContext, datePickerDayTableCellPropsContext} from './context.svelte.js';
|
10
13
|
|
11
|
-
let {children, ...props}: DatePickerDayTableCellTriggerProps = $props();
|
14
|
+
let {asChild, children, ...props}: DatePickerDayTableCellTriggerProps = $props();
|
12
15
|
|
13
16
|
let datePicker = datePickerContext.get();
|
14
17
|
let tableCellProps = datePickerDayTableCellPropsContext.get();
|
@@ -16,6 +19,10 @@
|
|
16
19
|
let attrs = $derived(mergeProps(props, datePicker.getDayTableCellTriggerProps(tableCellProps)));
|
17
20
|
</script>
|
18
21
|
|
19
|
-
|
20
|
-
{@render
|
21
|
-
|
22
|
+
{#if asChild}
|
23
|
+
{@render asChild(attrs)}
|
24
|
+
{:else}
|
25
|
+
<button type="button" {...attrs}>
|
26
|
+
{@render children?.()}
|
27
|
+
</button>
|
28
|
+
{/if}
|
@@ -1,26 +1,21 @@
|
|
1
1
|
<script lang="ts" module>
|
2
|
-
import type {Assign, HtmlProps} from '../types.js';
|
2
|
+
import type {Assign, GenericHtmlProps, HtmlProps} from '../types.js';
|
3
3
|
import type {DayTableCellProps, DayTableCellState} from '@zag-js/date-picker';
|
4
4
|
import type {Snippet} from 'svelte';
|
5
5
|
|
6
6
|
export interface DatePickerDayTableCellProps
|
7
7
|
extends Assign<Omit<HtmlProps<'div'>, 'children'>, DayTableCellProps> {
|
8
|
+
asChild?: Snippet<[attrs: Omit<GenericHtmlProps, 'children'>, state: DayTableCellState]>;
|
8
9
|
children?: Snippet<[state: DayTableCellState]>;
|
9
10
|
}
|
10
11
|
</script>
|
11
12
|
|
12
13
|
<script lang="ts">
|
13
|
-
import {mergeProps} from '
|
14
|
+
import {mergeProps} from '../utils.svelte.js';
|
14
15
|
import {datePickerContext, datePickerDayTableCellPropsContext} from './context.svelte.js';
|
15
16
|
|
16
|
-
let {
|
17
|
-
|
18
|
-
value,
|
19
|
-
disabled,
|
20
|
-
visibleRange,
|
21
|
-
children,
|
22
|
-
...props
|
23
|
-
}: DatePickerDayTableCellProps = $props();
|
17
|
+
let {value, disabled, visibleRange, asChild, children, ...props}: DatePickerDayTableCellProps =
|
18
|
+
$props();
|
24
19
|
|
25
20
|
let datePicker = datePickerContext.get();
|
26
21
|
let tableCellProps: DayTableCellProps = $derived({
|
@@ -35,6 +30,10 @@
|
|
35
30
|
datePickerDayTableCellPropsContext.set(() => tableCellProps);
|
36
31
|
</script>
|
37
32
|
|
38
|
-
|
39
|
-
{@render
|
40
|
-
|
33
|
+
{#if asChild}
|
34
|
+
{@render asChild(attrs, state)}
|
35
|
+
{:else}
|
36
|
+
<div {...attrs}>
|
37
|
+
{@render children?.(state)}
|
38
|
+
</div>
|
39
|
+
{/if}
|
@@ -22,6 +22,7 @@ export type { DatePickerTableRowProps } from './table-row.svelte';
|
|
22
22
|
export type { DatePickerTableProps } from './table.svelte';
|
23
23
|
export type { DatePickerTriggerProps } from './trigger.svelte';
|
24
24
|
export type { DatePickerViewControlProps } from './view-control.svelte';
|
25
|
+
export type { DatePickerViewTriggerProps } from './view-trigger.svelte';
|
25
26
|
export type { DatePickerViewProps } from './view.svelte';
|
26
27
|
export type { DatePickerYearSelectProps } from './year-select.svelte';
|
27
28
|
export type { DatePickerYearTableCellTriggerProps } from './year-table-cell-trigger.svelte';
|
@@ -1,19 +1,26 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {InputProps} from '@zag-js/date-picker';
|
4
|
+
import type {Snippet} from 'svelte';
|
4
5
|
|
5
|
-
export interface DatePickerInputProps extends Assign<HtmlProps<'input'>, InputProps> {
|
6
|
+
export interface DatePickerInputProps extends Assign<HtmlProps<'input'>, InputProps> {
|
7
|
+
asChild?: Snippet<[attrs: Omit<HtmlProps<'input'>, 'children'>]>;
|
8
|
+
}
|
6
9
|
</script>
|
7
10
|
|
8
11
|
<script lang="ts">
|
9
|
-
import {mergeProps} from '
|
12
|
+
import {mergeProps} from '../utils.svelte.js';
|
10
13
|
import {datePickerContext} from './context.svelte.js';
|
11
14
|
|
12
|
-
let {index, children, ...props}: DatePickerInputProps = $props();
|
15
|
+
let {index, asChild, children, ...props}: DatePickerInputProps = $props();
|
13
16
|
|
14
17
|
let datePicker = datePickerContext.get();
|
15
18
|
|
16
19
|
let attrs = $derived(mergeProps(props, datePicker.getInputProps({index})));
|
17
20
|
</script>
|
18
21
|
|
19
|
-
|
22
|
+
{#if asChild}
|
23
|
+
{@render asChild(attrs)}
|
24
|
+
{:else}
|
25
|
+
<input {...attrs} />
|
26
|
+
{/if}
|
@@ -1,21 +1,28 @@
|
|
1
1
|
<script lang="ts" module>
|
2
2
|
import type {Assign, HtmlProps} from '../types.js';
|
3
3
|
import type {LabelProps} from '@zag-js/date-picker';
|
4
|
+
import type {Snippet} from 'svelte';
|
4
5
|
|
5
|
-
export interface DatePickerLabelProps extends Assign<HtmlProps<'label'>, LabelProps> {
|
6
|
+
export interface DatePickerLabelProps extends Assign<HtmlProps<'label'>, LabelProps> {
|
7
|
+
asChild?: Snippet<[attrs: Omit<HtmlProps<'label'>, 'children'>]>;
|
8
|
+
}
|
6
9
|
</script>
|
7
10
|
|
8
11
|
<script lang="ts">
|
9
|
-
import {mergeProps} from '
|
12
|
+
import {mergeProps} from '../utils.svelte.js';
|
10
13
|
import {datePickerContext} from './context.svelte.js';
|
11
14
|
|
12
|
-
let {index, children, ...props}: DatePickerLabelProps = $props();
|
15
|
+
let {index, asChild, children, ...props}: DatePickerLabelProps = $props();
|
13
16
|
|
14
17
|
let datePicker = datePickerContext.get();
|
15
18
|
|
16
19
|
let attrs = $derived(mergeProps(props, datePicker.getLabelProps({index})));
|
17
20
|
</script>
|
18
21
|
|
19
|
-
|
20
|
-
{@render
|
21
|
-
|
22
|
+
{#if asChild}
|
23
|
+
{@render asChild(attrs)}
|
24
|
+
{:else}
|
25
|
+
<label {...attrs}>
|
26
|
+
{@render children?.()}
|
27
|
+
</label>
|
28
|
+
{/if}
|