@ark-ui/solid 1.3.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/README.md +1 -0
- package/cjs/index.js +1247 -1384
- package/cjs/index.js.map +1 -1
- package/esm/index.js +1415 -1599
- package/esm/index.js.map +1 -1
- package/package.json +52 -51
- package/source/accordion/accordion-item-trigger.jsx +0 -1
- package/source/accordion/accordion-root.jsx +29 -0
- package/source/accordion/accordion.jsx +6 -29
- package/source/accordion/index.js +3 -9
- package/source/avatar/avatar-root.jsx +18 -0
- package/source/avatar/avatar.jsx +4 -18
- package/source/avatar/index.js +3 -7
- package/source/carousel/carousel-root.jsx +27 -0
- package/source/carousel/carousel.jsx +10 -27
- package/source/carousel/index.js +5 -15
- package/source/checkbox/checkbox-root.jsx +28 -0
- package/source/checkbox/checkbox.jsx +5 -28
- package/source/checkbox/index.js +3 -8
- package/source/color-picker/color-picker-root.jsx +43 -0
- package/source/color-picker/color-picker.jsx +24 -43
- package/source/color-picker/index.js +3 -27
- package/source/combobox/combobox-root.jsx +57 -0
- package/source/combobox/combobox.jsx +14 -57
- package/source/combobox/index.js +3 -17
- package/source/date-picker/date-picker-root.jsx +52 -0
- package/source/date-picker/date-picker.jsx +24 -52
- package/source/date-picker/index.js +3 -27
- package/source/dialog/dialog-root.jsx +39 -0
- package/source/dialog/dialog-trigger.jsx +0 -1
- package/source/dialog/dialog.jsx +9 -39
- package/source/dialog/index.js +3 -12
- package/source/editable/editable-root.jsx +42 -0
- package/source/editable/editable.jsx +10 -42
- package/source/editable/index.js +3 -13
- package/source/environment/index.js +1 -4
- package/source/factory.jsx +10 -23
- package/source/file-upload/file-upload-root.jsx +34 -0
- package/source/file-upload/file-upload.jsx +12 -34
- package/source/file-upload/index.js +3 -15
- package/source/hover-card/hover-card-root.jsx +26 -0
- package/source/hover-card/hover-card.jsx +7 -26
- package/source/hover-card/index.js +3 -10
- package/source/index.jsx +1 -0
- package/source/menu/index.js +3 -17
- package/source/menu/menu-root.jsx +50 -0
- package/source/menu/menu-trigger.jsx +0 -1
- package/source/menu/menu.jsx +14 -50
- package/source/number-input/index.js +3 -11
- package/source/number-input/number-input-root.jsx +42 -0
- package/source/number-input/number-input.jsx +8 -42
- package/source/pagination/index.js +3 -9
- package/source/pagination/pagination-root.jsx +27 -0
- package/source/pagination/pagination.jsx +6 -27
- package/source/pin-input/index.js +3 -8
- package/source/pin-input/pin-input-root.jsx +36 -0
- package/source/pin-input/pin-input.jsx +5 -36
- package/source/popover/index.js +3 -15
- package/source/popover/popover-root.jsx +34 -0
- package/source/popover/popover-trigger.jsx +0 -1
- package/source/popover/popover.jsx +12 -34
- package/source/presence/index.js +1 -4
- package/source/progress/index.js +4 -14
- package/source/progress/progress-root.jsx +24 -0
- package/source/progress/{progress-indicator.jsx → progress-view.jsx} +2 -2
- package/source/progress/progress.jsx +10 -24
- package/source/radio-group/index.js +3 -10
- package/source/radio-group/radio-group-root.jsx +24 -0
- package/source/radio-group/radio-group.jsx +7 -24
- package/source/rating-group/index.js +3 -8
- package/source/rating-group/rating-group-root.jsx +29 -0
- package/source/rating-group/rating-group.jsx +5 -29
- package/source/segment-group/index.js +3 -10
- package/source/segment-group/segment-group-root.jsx +25 -0
- package/source/segment-group/segment-group.jsx +7 -25
- package/source/select/index.js +3 -18
- package/source/select/select-root.jsx +48 -0
- package/source/select/select.jsx +15 -48
- package/source/slider/index.js +3 -13
- package/source/slider/slider-root.jsx +41 -0
- package/source/slider/slider.jsx +10 -41
- package/source/splitter/index.js +3 -7
- package/source/splitter/splitter-root.jsx +25 -0
- package/source/splitter/splitter.jsx +4 -25
- package/source/switch/index.js +3 -8
- package/source/switch/switch-root.jsx +29 -0
- package/source/switch/switch.jsx +5 -29
- package/source/tabs/index.js +3 -9
- package/source/tabs/tabs-root.jsx +29 -0
- package/source/tabs/tabs.jsx +6 -29
- package/source/tags-input/index.js +4 -13
- package/source/tags-input/tags-input-item-preview.jsx +10 -0
- package/source/tags-input/tags-input-root.jsx +44 -0
- package/source/tags-input/tags-input.jsx +11 -44
- package/source/toast/index.js +3 -9
- package/source/toast/toast-root.jsx +8 -0
- package/source/toast/toast.jsx +6 -8
- package/source/toggle-group/index.js +3 -6
- package/source/toggle-group/toggle-group-root.jsx +25 -0
- package/source/toggle-group/toggle-group.jsx +3 -25
- package/source/tooltip/index.js +3 -10
- package/source/tooltip/tooltip-root.jsx +31 -0
- package/source/tooltip/tooltip.jsx +7 -31
- package/source/tree-view/index.js +14 -0
- package/source/tree-view/tree-view-branch-content.jsx +15 -0
- package/source/tree-view/tree-view-branch-control.jsx +15 -0
- package/source/tree-view/tree-view-branch-indicator.jsx +16 -0
- package/source/tree-view/tree-view-branch-text.jsx +15 -0
- package/source/tree-view/tree-view-branch-trigger.jsx +15 -0
- package/source/tree-view/tree-view-branch.jsx +17 -0
- package/source/tree-view/tree-view-context.js +5 -0
- package/source/tree-view/tree-view-item-text.jsx +12 -0
- package/source/tree-view/tree-view-item.jsx +13 -0
- package/source/tree-view/tree-view-label.jsx +8 -0
- package/source/tree-view/tree-view-root.jsx +27 -0
- package/source/tree-view/tree-view-tree.jsx +8 -0
- package/source/tree-view/tree-view.jsx +12 -0
- package/source/tree-view/use-tree-view.js +10 -0
- package/types/accordion/accordion-item-content.d.ts +2 -2
- package/types/accordion/accordion-item-indicator.d.ts +2 -2
- package/types/accordion/accordion-item-trigger.d.ts +2 -2
- package/types/accordion/accordion-item.d.ts +7 -5
- package/types/accordion/accordion-root.d.ts +10 -0
- package/types/accordion/accordion.d.ts +6 -7
- package/types/accordion/index.d.ts +4 -10
- package/types/avatar/avatar-fallback.d.ts +2 -2
- package/types/avatar/avatar-image.d.ts +2 -2
- package/types/avatar/avatar-root.d.ts +6 -0
- package/types/avatar/avatar.d.ts +4 -6
- package/types/avatar/index.d.ts +4 -8
- package/types/carousel/carousel-control.d.ts +2 -2
- package/types/carousel/carousel-indicator-group.d.ts +2 -2
- package/types/carousel/carousel-indicator.d.ts +2 -2
- package/types/carousel/carousel-item-group.d.ts +4 -0
- package/types/carousel/{carousel-slide.d.ts → carousel-item.d.ts} +2 -2
- package/types/carousel/carousel-next-trigger.d.ts +2 -2
- package/types/carousel/carousel-prev-trigger.d.ts +2 -2
- package/types/carousel/carousel-root.d.ts +11 -0
- package/types/carousel/carousel-viewport.d.ts +2 -2
- package/types/carousel/carousel.d.ts +10 -9
- package/types/carousel/index.d.ts +6 -16
- package/types/checkbox/checkbox-control.d.ts +2 -2
- package/types/checkbox/checkbox-indicator.d.ts +2 -2
- package/types/checkbox/checkbox-label.d.ts +2 -2
- package/types/checkbox/checkbox-root.d.ts +11 -0
- package/types/checkbox/checkbox.d.ts +5 -9
- package/types/checkbox/index.d.ts +5 -10
- package/types/color-picker/color-picker-area-background.d.ts +2 -2
- package/types/color-picker/color-picker-area-thumb.d.ts +2 -2
- package/types/color-picker/color-picker-area.d.ts +2 -2
- package/types/color-picker/color-picker-channel-input.d.ts +3 -3
- package/types/color-picker/color-picker-channel-slider-thumb.d.ts +2 -2
- package/types/color-picker/color-picker-channel-slider-track.d.ts +2 -2
- package/types/color-picker/color-picker-channel-slider.d.ts +2 -2
- package/types/color-picker/color-picker-content.d.ts +2 -2
- package/types/color-picker/color-picker-control.d.ts +2 -2
- package/types/color-picker/color-picker-eye-dropper-trigger.d.ts +2 -2
- package/types/color-picker/color-picker-format-select.d.ts +2 -2
- package/types/color-picker/color-picker-format-trigger.d.ts +2 -2
- package/types/color-picker/color-picker-label.d.ts +2 -2
- package/types/color-picker/color-picker-positioner.d.ts +2 -2
- package/types/color-picker/color-picker-root.d.ts +12 -0
- package/types/color-picker/color-picker-swatch-group.d.ts +2 -2
- package/types/color-picker/color-picker-swatch-indicator.d.ts +2 -2
- package/types/color-picker/color-picker-swatch-trigger.d.ts +2 -2
- package/types/color-picker/color-picker-swatch.d.ts +2 -2
- package/types/color-picker/color-picker-transparency-grid.d.ts +2 -2
- package/types/color-picker/color-picker-trigger.d.ts +2 -2
- package/types/color-picker/color-picker-value-text.d.ts +6 -3
- package/types/color-picker/color-picker.d.ts +24 -10
- package/types/color-picker/index.d.ts +4 -28
- package/types/combobox/combobox-clear-trigger.d.ts +2 -2
- package/types/combobox/combobox-content.d.ts +2 -2
- package/types/combobox/combobox-control.d.ts +2 -2
- package/types/combobox/combobox-input.d.ts +2 -2
- package/types/combobox/combobox-item-group-label.d.ts +2 -2
- package/types/combobox/combobox-item-group.d.ts +2 -2
- package/types/combobox/combobox-item-indicator.d.ts +2 -2
- package/types/combobox/combobox-item-text.d.ts +2 -2
- package/types/combobox/combobox-item.d.ts +6 -4
- package/types/combobox/combobox-label.d.ts +2 -2
- package/types/combobox/combobox-positioner.d.ts +2 -2
- package/types/combobox/combobox-root.d.ts +10 -0
- package/types/combobox/combobox-trigger.d.ts +2 -2
- package/types/combobox/combobox.d.ts +14 -10
- package/types/combobox/index.d.ts +4 -18
- package/types/date-picker/date-picker-clear-trigger.d.ts +2 -2
- package/types/date-picker/date-picker-content.d.ts +2 -2
- package/types/date-picker/date-picker-control.d.ts +2 -2
- package/types/date-picker/date-picker-input.d.ts +2 -2
- package/types/date-picker/date-picker-label.d.ts +2 -2
- package/types/date-picker/date-picker-month-select.d.ts +2 -2
- package/types/date-picker/date-picker-next-trigger.d.ts +2 -2
- package/types/date-picker/date-picker-positioner.d.ts +2 -2
- package/types/date-picker/date-picker-prev-trigger.d.ts +2 -2
- package/types/date-picker/date-picker-range-text.d.ts +2 -2
- package/types/date-picker/date-picker-root.d.ts +12 -0
- package/types/date-picker/date-picker-table-body.d.ts +2 -2
- package/types/date-picker/date-picker-table-cell-trigger.d.ts +2 -2
- package/types/date-picker/date-picker-table-cell.d.ts +2 -2
- package/types/date-picker/date-picker-table-head.d.ts +2 -2
- package/types/date-picker/date-picker-table-header.d.ts +2 -2
- package/types/date-picker/date-picker-table-row.d.ts +2 -2
- package/types/date-picker/date-picker-table.d.ts +2 -2
- package/types/date-picker/date-picker-trigger.d.ts +2 -2
- package/types/date-picker/date-picker-view-control.d.ts +2 -2
- package/types/date-picker/date-picker-view-trigger.d.ts +2 -2
- package/types/date-picker/date-picker-view.d.ts +6 -4
- package/types/date-picker/date-picker-year-select.d.ts +2 -2
- package/types/date-picker/date-picker.d.ts +24 -10
- package/types/date-picker/index.d.ts +4 -28
- package/types/dialog/dialog-backdrop.d.ts +2 -2
- package/types/dialog/dialog-close-trigger.d.ts +2 -2
- package/types/dialog/dialog-content.d.ts +2 -2
- package/types/dialog/dialog-description.d.ts +2 -2
- package/types/dialog/dialog-positioner.d.ts +2 -2
- package/types/dialog/dialog-root.d.ts +7 -0
- package/types/dialog/dialog-title.d.ts +2 -2
- package/types/dialog/dialog-trigger.d.ts +2 -2
- package/types/dialog/dialog.d.ts +9 -7
- package/types/dialog/index.d.ts +4 -13
- package/types/editable/editable-area.d.ts +2 -2
- package/types/editable/editable-cancel-trigger.d.ts +2 -2
- package/types/editable/editable-control.d.ts +2 -2
- package/types/editable/editable-edit-trigger.d.ts +2 -2
- package/types/editable/editable-input.d.ts +2 -2
- package/types/editable/editable-label.d.ts +2 -2
- package/types/editable/editable-preview.d.ts +2 -2
- package/types/editable/editable-root.d.ts +11 -0
- package/types/editable/editable-submit-trigger.d.ts +2 -2
- package/types/editable/editable.d.ts +10 -9
- package/types/editable/index.d.ts +4 -14
- package/types/environment/index.d.ts +1 -4
- package/types/factory.d.ts +12 -8
- package/types/file-upload/file-upload-dropzone.d.ts +2 -2
- package/types/file-upload/file-upload-item-delete-trigger.d.ts +2 -2
- package/types/file-upload/file-upload-item-group.d.ts +6 -4
- package/types/file-upload/file-upload-item-name.d.ts +2 -2
- package/types/file-upload/file-upload-item-preview-image.d.ts +2 -2
- package/types/file-upload/file-upload-item-preview.d.ts +6 -3
- package/types/file-upload/file-upload-item-size-text.d.ts +2 -2
- package/types/file-upload/file-upload-item.d.ts +2 -2
- package/types/file-upload/file-upload-label.d.ts +2 -2
- package/types/file-upload/file-upload-root.d.ts +11 -0
- package/types/file-upload/file-upload-trigger.d.ts +2 -2
- package/types/file-upload/file-upload.d.ts +12 -9
- package/types/file-upload/index.d.ts +5 -17
- package/types/hover-card/hover-card-arrow-tip.d.ts +2 -2
- package/types/hover-card/hover-card-arrow.d.ts +2 -2
- package/types/hover-card/hover-card-content.d.ts +2 -2
- package/types/hover-card/hover-card-positioner.d.ts +2 -2
- package/types/hover-card/hover-card-root.d.ts +7 -0
- package/types/hover-card/hover-card-trigger.d.ts +2 -2
- package/types/hover-card/hover-card.d.ts +7 -7
- package/types/hover-card/index.d.ts +5 -12
- package/types/index.d.ts +1 -0
- package/types/menu/index.d.ts +4 -18
- package/types/menu/menu-arrow-tip.d.ts +2 -2
- package/types/menu/menu-arrow.d.ts +2 -2
- package/types/menu/menu-content.d.ts +2 -2
- package/types/menu/menu-context-trigger.d.ts +2 -2
- package/types/menu/menu-item-group-label.d.ts +2 -2
- package/types/menu/menu-item-group.d.ts +2 -2
- package/types/menu/menu-item.d.ts +2 -2
- package/types/menu/menu-option-item.d.ts +6 -4
- package/types/menu/menu-positioner.d.ts +2 -2
- package/types/menu/menu-root.d.ts +9 -0
- package/types/menu/menu-separator.d.ts +2 -2
- package/types/menu/menu-trigger-item.d.ts +2 -2
- package/types/menu/menu-trigger.d.ts +2 -2
- package/types/menu/menu.d.ts +14 -9
- package/types/number-input/index.d.ts +4 -12
- package/types/number-input/number-input-control.d.ts +2 -2
- package/types/number-input/number-input-decrement-trigger.d.ts +2 -2
- package/types/number-input/number-input-increment-trigger.d.ts +2 -2
- package/types/number-input/number-input-input.d.ts +2 -2
- package/types/number-input/number-input-label.d.ts +2 -2
- package/types/number-input/number-input-root.d.ts +11 -0
- package/types/number-input/number-input-scrubber.d.ts +2 -2
- package/types/number-input/number-input.d.ts +8 -9
- package/types/pagination/index.d.ts +4 -10
- package/types/pagination/pagination-ellipsis.d.ts +2 -2
- package/types/pagination/pagination-item.d.ts +2 -2
- package/types/pagination/pagination-next-trigger.d.ts +2 -2
- package/types/pagination/pagination-prev-trigger.d.ts +2 -2
- package/types/pagination/pagination-root.d.ts +11 -0
- package/types/pagination/pagination.d.ts +6 -9
- package/types/pin-input/index.d.ts +4 -9
- package/types/pin-input/pin-input-control.d.ts +2 -2
- package/types/pin-input/pin-input-input.d.ts +4 -2
- package/types/pin-input/pin-input-label.d.ts +2 -2
- package/types/pin-input/pin-input-root.d.ts +6 -0
- package/types/pin-input/pin-input.d.ts +5 -6
- package/types/popover/index.d.ts +4 -16
- package/types/popover/popover-anchor.d.ts +2 -2
- package/types/popover/popover-arrow-tip.d.ts +2 -2
- package/types/popover/popover-arrow.d.ts +2 -2
- package/types/popover/popover-close-trigger.d.ts +2 -2
- package/types/popover/popover-content.d.ts +2 -2
- package/types/popover/popover-description.d.ts +2 -2
- package/types/popover/popover-indicator.d.ts +2 -2
- package/types/popover/popover-positioner.d.ts +2 -2
- package/types/popover/popover-root.d.ts +7 -0
- package/types/popover/popover-title.d.ts +2 -2
- package/types/popover/popover-trigger.d.ts +2 -2
- package/types/popover/popover.d.ts +12 -7
- package/types/presence/index.d.ts +1 -4
- package/types/presence/presence.d.ts +2 -2
- package/types/progress/index.d.ts +5 -15
- package/types/progress/progress-circle-range.d.ts +2 -2
- package/types/progress/progress-circle-track.d.ts +2 -2
- package/types/progress/progress-circle.d.ts +2 -2
- package/types/progress/progress-label.d.ts +2 -2
- package/types/progress/progress-range.d.ts +2 -2
- package/types/progress/progress-root.d.ts +11 -0
- package/types/progress/progress-track.d.ts +2 -2
- package/types/progress/progress-value-text.d.ts +2 -2
- package/types/progress/progress-view.d.ts +6 -0
- package/types/progress/progress.d.ts +10 -9
- package/types/radio-group/index.d.ts +5 -12
- package/types/radio-group/radio-group-indicator.d.ts +2 -2
- package/types/radio-group/radio-group-item-control.d.ts +2 -2
- package/types/radio-group/radio-group-item-text.d.ts +2 -2
- package/types/radio-group/radio-group-item.d.ts +6 -4
- package/types/radio-group/radio-group-label.d.ts +2 -2
- package/types/radio-group/radio-group-root.d.ts +6 -0
- package/types/radio-group/radio-group.d.ts +7 -6
- package/types/rating-group/index.d.ts +4 -9
- package/types/rating-group/rating-group-control.d.ts +6 -4
- package/types/rating-group/rating-group-item.d.ts +6 -4
- package/types/rating-group/rating-group-label.d.ts +2 -2
- package/types/rating-group/rating-group-root.d.ts +6 -0
- package/types/rating-group/rating-group.d.ts +5 -6
- package/types/segment-group/index.d.ts +4 -11
- package/types/segment-group/segment-group-indicator.d.ts +2 -2
- package/types/segment-group/segment-group-item-control.d.ts +2 -2
- package/types/segment-group/segment-group-item-text.d.ts +2 -2
- package/types/segment-group/segment-group-item.d.ts +7 -5
- package/types/segment-group/segment-group-label.d.ts +2 -2
- package/types/segment-group/segment-group-root.d.ts +6 -0
- package/types/segment-group/segment-group.d.ts +7 -6
- package/types/select/index.d.ts +4 -19
- package/types/select/select-clear-trigger.d.ts +2 -2
- package/types/select/select-content.d.ts +2 -2
- package/types/select/select-control.d.ts +2 -2
- package/types/select/select-indicator.d.ts +2 -2
- package/types/select/select-item-group-label.d.ts +2 -2
- package/types/select/select-item-group.d.ts +2 -2
- package/types/select/select-item-indicator.d.ts +2 -2
- package/types/select/select-item-text.d.ts +2 -2
- package/types/select/select-item.d.ts +6 -4
- package/types/select/select-label.d.ts +2 -2
- package/types/select/select-positioner.d.ts +2 -2
- package/types/select/select-root.d.ts +10 -0
- package/types/select/select-trigger.d.ts +2 -2
- package/types/select/select-value-text.d.ts +6 -3
- package/types/select/select.d.ts +15 -10
- package/types/slider/index.d.ts +4 -14
- package/types/slider/slider-control.d.ts +2 -2
- package/types/slider/slider-label.d.ts +2 -2
- package/types/slider/slider-marker-group.d.ts +2 -2
- package/types/slider/slider-marker.d.ts +2 -2
- package/types/slider/slider-range.d.ts +2 -2
- package/types/slider/slider-root.d.ts +11 -0
- package/types/slider/slider-thumb.d.ts +2 -2
- package/types/slider/slider-track.d.ts +2 -2
- package/types/slider/slider-value-text.d.ts +2 -2
- package/types/slider/slider.d.ts +10 -9
- package/types/splitter/index.d.ts +4 -8
- package/types/splitter/splitter-panel.d.ts +2 -2
- package/types/splitter/splitter-resize-trigger.d.ts +2 -2
- package/types/splitter/splitter-root.d.ts +11 -0
- package/types/splitter/splitter.d.ts +4 -9
- package/types/switch/index.d.ts +4 -9
- package/types/switch/switch-control.d.ts +2 -2
- package/types/switch/switch-label.d.ts +2 -2
- package/types/switch/switch-root.d.ts +11 -0
- package/types/switch/switch-thumb.d.ts +2 -2
- package/types/switch/switch.d.ts +5 -9
- package/types/tabs/index.d.ts +4 -10
- package/types/tabs/tab-content.d.ts +2 -2
- package/types/tabs/tab-indicator.d.ts +2 -2
- package/types/tabs/tab-list.d.ts +2 -2
- package/types/tabs/tab-trigger.d.ts +2 -2
- package/types/tabs/tabs-root.d.ts +10 -0
- package/types/tabs/tabs.d.ts +6 -7
- package/types/tags-input/index.d.ts +5 -14
- package/types/tags-input/tags-input-clear-trigger.d.ts +2 -2
- package/types/tags-input/tags-input-control.d.ts +2 -2
- package/types/tags-input/tags-input-input.d.ts +2 -2
- package/types/tags-input/tags-input-item-delete-trigger.d.ts +2 -2
- package/types/tags-input/tags-input-item-input.d.ts +2 -2
- package/types/tags-input/tags-input-item-preview.d.ts +4 -0
- package/types/tags-input/tags-input-item-text.d.ts +2 -2
- package/types/tags-input/tags-input-item.d.ts +6 -4
- package/types/tags-input/tags-input-label.d.ts +2 -2
- package/types/tags-input/tags-input-root.d.ts +11 -0
- package/types/tags-input/tags-input.d.ts +11 -9
- package/types/toast/index.d.ts +4 -10
- package/types/toast/toast-close-trigger.d.ts +2 -2
- package/types/toast/toast-description.d.ts +2 -2
- package/types/toast/toast-group.d.ts +2 -2
- package/types/toast/toast-root.d.ts +4 -0
- package/types/toast/toast-title.d.ts +2 -2
- package/types/toast/toast.d.ts +6 -4
- package/types/toggle-group/index.d.ts +4 -7
- package/types/toggle-group/toggle-group-item.d.ts +2 -2
- package/types/toggle-group/toggle-group-root.d.ts +6 -0
- package/types/toggle-group/toggle-group.d.ts +3 -6
- package/types/tooltip/index.d.ts +4 -11
- package/types/tooltip/tooltip-arrow-tip.d.ts +2 -2
- package/types/tooltip/tooltip-arrow.d.ts +2 -2
- package/types/tooltip/tooltip-content.d.ts +2 -2
- package/types/tooltip/tooltip-positioner.d.ts +2 -2
- package/types/tooltip/tooltip-root.d.ts +7 -0
- package/types/tooltip/tooltip-trigger.d.ts +2 -2
- package/types/tooltip/tooltip.d.ts +7 -7
- package/types/tree-view/index.d.ts +16 -0
- package/types/tree-view/tree-view-branch-content.d.ts +6 -0
- package/types/tree-view/tree-view-branch-control.d.ts +6 -0
- package/types/tree-view/tree-view-branch-indicator.d.ts +6 -0
- package/types/tree-view/tree-view-branch-text.d.ts +6 -0
- package/types/tree-view/tree-view-branch-trigger.d.ts +6 -0
- package/types/tree-view/tree-view-branch.d.ts +11 -0
- package/types/tree-view/tree-view-context.d.ts +20 -0
- package/types/tree-view/tree-view-item-text.d.ts +6 -0
- package/types/tree-view/tree-view-item.d.ts +11 -0
- package/types/tree-view/tree-view-label.d.ts +4 -0
- package/types/tree-view/tree-view-root.d.ts +11 -0
- package/types/tree-view/tree-view-tree.d.ts +4 -0
- package/types/tree-view/tree-view.d.ts +12 -0
- package/types/tree-view/use-tree-view.d.ts +9 -0
- package/source/constants.js +0 -27
- package/source/filter-object.js +0 -7
- package/source/is-empty.js +0 -4
- package/source/is-function.js +0 -1
- package/source/merge-style.js +0 -30
- package/source/parse-template.js +0 -248
- package/source/pipe.js +0 -1
- package/source/spread.js +0 -40
- package/source/ssr-spread.js +0 -19
- package/types/carousel/carousel-slide-group.d.ts +0 -4
- package/types/constants.d.ts +0 -1
- package/types/filter-object.d.ts +0 -8
- package/types/is-empty.d.ts +0 -1
- package/types/is-function.d.ts +0 -1
- package/types/merge-style.d.ts +0 -6
- package/types/parse-template.d.ts +0 -45
- package/types/pipe.d.ts +0 -10
- package/types/progress/progress-indicator.d.ts +0 -6
- package/types/spread.d.ts +0 -1
- package/types/ssr-spread.d.ts +0 -10
- /package/source/carousel/{carousel-slide-group.jsx → carousel-item-group.jsx} +0 -0
- /package/source/carousel/{carousel-slide.jsx → carousel-item.jsx} +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ArkComponent, type HTMLArkProps } from '../factory';
|
|
2
|
+
import type { Assign } from '../types';
|
|
3
|
+
import { type BranchProps } from './tree-view-context';
|
|
4
|
+
export interface TreeViewBranchIndicatorProps extends Assign<HTMLArkProps<'div'>, BranchProps> {
|
|
5
|
+
}
|
|
6
|
+
export declare const TreeViewBranchIndicator: ArkComponent<'div', BranchProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ArkComponent, type HTMLArkProps } from '../factory';
|
|
2
|
+
import type { Assign } from '../types';
|
|
3
|
+
import { type BranchProps } from './tree-view-context';
|
|
4
|
+
export interface TreeViewBranchTextProps extends Assign<HTMLArkProps<'span'>, BranchProps> {
|
|
5
|
+
}
|
|
6
|
+
export declare const TreeViewBranchText: ArkComponent<'span', BranchProps>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ArkComponent, type HTMLArkProps } from '../factory';
|
|
2
|
+
import type { Assign } from '../types';
|
|
3
|
+
import { type BranchProps } from './tree-view-context';
|
|
4
|
+
export interface TreeViewBranchTriggerProps extends Assign<HTMLArkProps<'button'>, BranchProps> {
|
|
5
|
+
}
|
|
6
|
+
export declare const TreeViewBranchTrigger: ArkComponent<'button', BranchProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Accessor, type JSX } from 'solid-js';
|
|
2
|
+
import { type ArkComponent, type HTMLArkProps } from '../factory';
|
|
3
|
+
import type { Assign } from '../types';
|
|
4
|
+
import { type BranchProps, type BranchState } from './tree-view-context';
|
|
5
|
+
interface ElementProps extends BranchProps {
|
|
6
|
+
children?: JSX.Element | ((state: Accessor<BranchState>) => JSX.Element);
|
|
7
|
+
}
|
|
8
|
+
export interface TreeViewBranchProps extends Assign<HTMLArkProps<'li'>, ElementProps> {
|
|
9
|
+
}
|
|
10
|
+
export declare const TreeViewBranch: ArkComponent<'li', ElementProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type UseTreeViewReturn } from './use-tree-view';
|
|
2
|
+
export interface ItemProps {
|
|
3
|
+
depth: number;
|
|
4
|
+
id: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface BranchProps extends ItemProps {
|
|
8
|
+
}
|
|
9
|
+
export interface ItemState {
|
|
10
|
+
id: string;
|
|
11
|
+
isDisabled: boolean;
|
|
12
|
+
isSelected: boolean;
|
|
13
|
+
isFocused: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface BranchState extends ItemState {
|
|
16
|
+
isExpanded: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface TreeViewContext extends UseTreeViewReturn {
|
|
19
|
+
}
|
|
20
|
+
export declare const TreeViewProvider: import("solid-js").ContextProviderComponent<TreeViewContext>, useTreeViewContext: () => TreeViewContext;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ArkComponent, type HTMLArkProps } from '../factory';
|
|
2
|
+
import type { Assign } from '../types';
|
|
3
|
+
import { type ItemProps } from './tree-view-context';
|
|
4
|
+
export interface TreeViewItemTextProps extends Assign<HTMLArkProps<'span'>, ItemProps> {
|
|
5
|
+
}
|
|
6
|
+
export declare const TreeViewItemText: ArkComponent<'span', ItemProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Accessor, type JSX } from 'solid-js';
|
|
2
|
+
import { type ArkComponent, type HTMLArkProps } from '../factory';
|
|
3
|
+
import type { Assign } from '../types';
|
|
4
|
+
import { type ItemProps, type ItemState } from './tree-view-context';
|
|
5
|
+
interface ElementProps extends ItemProps {
|
|
6
|
+
children?: JSX.Element | ((state: Accessor<ItemState>) => JSX.Element);
|
|
7
|
+
}
|
|
8
|
+
export interface TreeViewItemProps extends Assign<HTMLArkProps<'li'>, ElementProps> {
|
|
9
|
+
}
|
|
10
|
+
export declare const TreeViewItem: ArkComponent<'li', ElementProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type JSX } from 'solid-js';
|
|
2
|
+
import { type ArkComponent, type HTMLArkProps } from '../factory';
|
|
3
|
+
import type { Assign } from '../types';
|
|
4
|
+
import { type UseTreeViewProps, type UseTreeViewReturn } from './use-tree-view';
|
|
5
|
+
interface ElementProps extends UseTreeViewProps {
|
|
6
|
+
children?: JSX.Element | ((api: UseTreeViewReturn) => JSX.Element);
|
|
7
|
+
}
|
|
8
|
+
export interface TreeViewRootProps extends Assign<HTMLArkProps<'div'>, ElementProps> {
|
|
9
|
+
}
|
|
10
|
+
export declare const TreeViewRoot: ArkComponent<'div', ElementProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TreeViewBranch as Branch } from './tree-view-branch';
|
|
2
|
+
import { TreeViewBranchContent as BranchContent } from './tree-view-branch-content';
|
|
3
|
+
import { TreeViewBranchControl as BranchControl } from './tree-view-branch-control';
|
|
4
|
+
import { TreeViewBranchIndicator as BranchIndicator } from './tree-view-branch-indicator';
|
|
5
|
+
import { TreeViewBranchText as BranchText } from './tree-view-branch-text';
|
|
6
|
+
import { TreeViewBranchTrigger as BranchTrigger } from './tree-view-branch-trigger';
|
|
7
|
+
import { TreeViewItem as Item } from './tree-view-item';
|
|
8
|
+
import { TreeViewItemText as ItemText } from './tree-view-item-text';
|
|
9
|
+
import { TreeViewLabel as Label } from './tree-view-label';
|
|
10
|
+
import { TreeViewRoot as Root } from './tree-view-root';
|
|
11
|
+
import { TreeViewTree as Tree } from './tree-view-tree';
|
|
12
|
+
export { Branch, BranchContent, BranchControl, BranchIndicator, BranchText, BranchTrigger, Item, ItemText, Label, Root, Tree, };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PropTypes } from '@zag-js/solid';
|
|
2
|
+
import * as treeView from '@zag-js/tree-view';
|
|
3
|
+
import { type Accessor } from 'solid-js';
|
|
4
|
+
import { type Optional } from '../types';
|
|
5
|
+
export interface UseTreeViewProps extends Optional<treeView.Context, 'id'> {
|
|
6
|
+
}
|
|
7
|
+
export interface UseTreeViewReturn extends Accessor<treeView.Api<PropTypes>> {
|
|
8
|
+
}
|
|
9
|
+
export declare const useTreeView: (props: UseTreeViewProps) => UseTreeViewReturn;
|
package/source/constants.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const booleans = [
|
|
2
|
-
'allowfullscreen',
|
|
3
|
-
'async',
|
|
4
|
-
'autofocus',
|
|
5
|
-
'autoplay',
|
|
6
|
-
'checked',
|
|
7
|
-
'controls',
|
|
8
|
-
'default',
|
|
9
|
-
'disabled',
|
|
10
|
-
'formnovalidate',
|
|
11
|
-
'hidden',
|
|
12
|
-
'indeterminate',
|
|
13
|
-
'ismap',
|
|
14
|
-
'loop',
|
|
15
|
-
'multiple',
|
|
16
|
-
'muted',
|
|
17
|
-
'nomodule',
|
|
18
|
-
'novalidate',
|
|
19
|
-
'open',
|
|
20
|
-
'playsinline',
|
|
21
|
-
'readonly',
|
|
22
|
-
'required',
|
|
23
|
-
'reversed',
|
|
24
|
-
'seamless',
|
|
25
|
-
'selected',
|
|
26
|
-
];
|
|
27
|
-
export const BooleanAttributes = new Set(booleans);
|
package/source/filter-object.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BooleanAttributes } from './constants';
|
|
2
|
-
import { isEmpty } from './is-empty';
|
|
3
|
-
import { isFunction } from './is-function';
|
|
4
|
-
export const filterObject = (obj, fn) => Object.fromEntries(Object.entries(obj).filter(fn));
|
|
5
|
-
export const filterEmptyValues = (obj) => filterObject(obj, ([, v]) => !isEmpty(v));
|
|
6
|
-
export const filterFunctionValues = (obj) => filterObject(obj, ([, v]) => !isFunction(v));
|
|
7
|
-
export const filterBooleanAttributeValues = (obj) => filterObject(obj, ([k, v]) => !(BooleanAttributes.has(k) && !v));
|
package/source/is-empty.js
DELETED
package/source/is-function.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const isFunction = (value) => typeof value === 'function';
|
package/source/merge-style.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export const mergeStyle = (a, b) => styleObjectToString({ ...getStyleObject(a), ...getStyleObject(b) });
|
|
2
|
-
const getStyleObject = (style) => typeof style === 'object' ? style : stringStyleToObject(style);
|
|
3
|
-
const stringStyleToObject = (style) => {
|
|
4
|
-
const object = {};
|
|
5
|
-
if (!style)
|
|
6
|
-
return object;
|
|
7
|
-
const extractCSSregex = /([^:; ]*):\s*([^;]*)/g;
|
|
8
|
-
let match;
|
|
9
|
-
while ((match = extractCSSregex.exec(style))) {
|
|
10
|
-
object[match[1]] = match[2];
|
|
11
|
-
}
|
|
12
|
-
return object;
|
|
13
|
-
};
|
|
14
|
-
const styleObjectToString = (value) => {
|
|
15
|
-
if (!value)
|
|
16
|
-
return '';
|
|
17
|
-
let result = '';
|
|
18
|
-
const k = Object.keys(value);
|
|
19
|
-
for (let i = 0; i < k.length; i++) {
|
|
20
|
-
const s = k[i];
|
|
21
|
-
// @ts-expect-error - we know this is a string
|
|
22
|
-
const v = value[s];
|
|
23
|
-
if (v != undefined) {
|
|
24
|
-
if (i)
|
|
25
|
-
result += ';';
|
|
26
|
-
result += `${s}:${v}`;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
};
|
package/source/parse-template.js
DELETED
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
// Forked from https://github.com/natemoo-re/ultrahtml.git under MIT license
|
|
3
|
-
const DOCUMENT_NODE = 0;
|
|
4
|
-
const ELEMENT_NODE = 1;
|
|
5
|
-
const TEXT_NODE = 2;
|
|
6
|
-
const COMMENT_NODE = 3;
|
|
7
|
-
const DOCTYPE_NODE = 4;
|
|
8
|
-
const Fragment = Symbol('Fragment');
|
|
9
|
-
const VOID_TAGS = new Set([
|
|
10
|
-
'area',
|
|
11
|
-
'base',
|
|
12
|
-
'br',
|
|
13
|
-
'col',
|
|
14
|
-
'embed',
|
|
15
|
-
'hr',
|
|
16
|
-
'img',
|
|
17
|
-
'input',
|
|
18
|
-
'keygen',
|
|
19
|
-
'link',
|
|
20
|
-
'meta',
|
|
21
|
-
'param',
|
|
22
|
-
'source',
|
|
23
|
-
'track',
|
|
24
|
-
'wbr',
|
|
25
|
-
]);
|
|
26
|
-
const RAW_TAGS = new Set(['script', 'style']);
|
|
27
|
-
const SPLIT_ATTRS_RE = /([@.a-z0-9_:-]*)\s*?=?\s*?(['"]?)([\s\S]*?)\2\s+/gim;
|
|
28
|
-
const DOM_PARSER_RE = /(?:<(\/?)([a-zA-Z][a-zA-Z0-9:-]*)(?:\s([^>]*?))?((?:\s*\/)?)>|(<!--)([\s\S]*?)(-->)|(<!)([\s\S]*?)(>))/gm;
|
|
29
|
-
function splitAttrs(str) {
|
|
30
|
-
const obj = {};
|
|
31
|
-
let token;
|
|
32
|
-
if (str) {
|
|
33
|
-
SPLIT_ATTRS_RE.lastIndex = 0;
|
|
34
|
-
str = ' ' + (str || '') + ' ';
|
|
35
|
-
while ((token = SPLIT_ATTRS_RE.exec(str))) {
|
|
36
|
-
if (token[0] === ' ')
|
|
37
|
-
continue;
|
|
38
|
-
obj[token[1]] = token[3];
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return obj;
|
|
42
|
-
}
|
|
43
|
-
export function parse(str) {
|
|
44
|
-
let doc, parent, token, text, i, bStart, bText, bEnd, tag;
|
|
45
|
-
const tags = [];
|
|
46
|
-
DOM_PARSER_RE.lastIndex = 0;
|
|
47
|
-
parent = doc = {
|
|
48
|
-
type: DOCUMENT_NODE,
|
|
49
|
-
children: [],
|
|
50
|
-
};
|
|
51
|
-
let lastIndex = 0;
|
|
52
|
-
function commitTextNode() {
|
|
53
|
-
text = str.substring(lastIndex, DOM_PARSER_RE.lastIndex - token[0].length);
|
|
54
|
-
if (text) {
|
|
55
|
-
// eslint-disable-next-line
|
|
56
|
-
;
|
|
57
|
-
parent.children.push({
|
|
58
|
-
type: TEXT_NODE,
|
|
59
|
-
value: text,
|
|
60
|
-
parent,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
while ((token = DOM_PARSER_RE.exec(str))) {
|
|
65
|
-
bStart = token[5] || token[8];
|
|
66
|
-
bText = token[6] || token[9];
|
|
67
|
-
bEnd = token[7] || token[10];
|
|
68
|
-
if (RAW_TAGS.has(parent.name) && token[2] !== parent.name) {
|
|
69
|
-
i = DOM_PARSER_RE.lastIndex - token[0].length;
|
|
70
|
-
if (parent.children.length > 0) {
|
|
71
|
-
parent.children[0].value += token[0];
|
|
72
|
-
}
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
else if (bStart === '<!--') {
|
|
76
|
-
i = DOM_PARSER_RE.lastIndex - token[0].length;
|
|
77
|
-
if (RAW_TAGS.has(parent.name)) {
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
tag = {
|
|
81
|
-
type: COMMENT_NODE,
|
|
82
|
-
value: bText,
|
|
83
|
-
parent: parent,
|
|
84
|
-
loc: [
|
|
85
|
-
{
|
|
86
|
-
start: i,
|
|
87
|
-
end: i + bStart.length,
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
start: DOM_PARSER_RE.lastIndex - bEnd.length,
|
|
91
|
-
end: DOM_PARSER_RE.lastIndex,
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
};
|
|
95
|
-
tags.push(tag);
|
|
96
|
-
tag.parent.children.push(tag);
|
|
97
|
-
}
|
|
98
|
-
else if (bStart === '<!') {
|
|
99
|
-
i = DOM_PARSER_RE.lastIndex - token[0].length;
|
|
100
|
-
tag = {
|
|
101
|
-
type: DOCTYPE_NODE,
|
|
102
|
-
value: bText,
|
|
103
|
-
parent: parent,
|
|
104
|
-
loc: [
|
|
105
|
-
{
|
|
106
|
-
start: i,
|
|
107
|
-
end: i + bStart.length,
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
start: DOM_PARSER_RE.lastIndex - bEnd.length,
|
|
111
|
-
end: DOM_PARSER_RE.lastIndex,
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
};
|
|
115
|
-
// commitTextNode();
|
|
116
|
-
tags.push(tag);
|
|
117
|
-
tag.parent.children.push(tag);
|
|
118
|
-
}
|
|
119
|
-
else if (token[1] !== '/') {
|
|
120
|
-
commitTextNode();
|
|
121
|
-
if (RAW_TAGS.has(parent.name)) {
|
|
122
|
-
lastIndex = DOM_PARSER_RE.lastIndex;
|
|
123
|
-
commitTextNode();
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
tag = {
|
|
128
|
-
type: ELEMENT_NODE,
|
|
129
|
-
name: token[2] + '',
|
|
130
|
-
attributes: splitAttrs(token[3]),
|
|
131
|
-
parent,
|
|
132
|
-
children: [],
|
|
133
|
-
loc: [
|
|
134
|
-
{
|
|
135
|
-
start: DOM_PARSER_RE.lastIndex - token[0].length,
|
|
136
|
-
end: DOM_PARSER_RE.lastIndex,
|
|
137
|
-
},
|
|
138
|
-
],
|
|
139
|
-
};
|
|
140
|
-
tags.push(tag);
|
|
141
|
-
tag.parent.children.push(tag);
|
|
142
|
-
if ((token[4] && token[4].indexOf('/') > -1) || VOID_TAGS.has(tag.name)) {
|
|
143
|
-
tag.loc[1] = tag.loc[0];
|
|
144
|
-
tag.isSelfClosingTag = true;
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
parent = tag;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
commitTextNode();
|
|
153
|
-
// Close parent node if end-tag matches
|
|
154
|
-
if (token[2] + '' === parent.name) {
|
|
155
|
-
tag = parent;
|
|
156
|
-
parent = tag.parent;
|
|
157
|
-
tag.loc.push({
|
|
158
|
-
start: DOM_PARSER_RE.lastIndex - token[0].length,
|
|
159
|
-
end: DOM_PARSER_RE.lastIndex,
|
|
160
|
-
});
|
|
161
|
-
text = str.substring(tag.loc[0].end, tag.loc[1].start);
|
|
162
|
-
if (tag.children.length === 0) {
|
|
163
|
-
tag.children.push({
|
|
164
|
-
type: TEXT_NODE,
|
|
165
|
-
value: text,
|
|
166
|
-
parent,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
// account for abuse of self-closing tags when an end-tag is also provided:
|
|
171
|
-
else if (token[2] + '' === tags[tags.length - 1].name &&
|
|
172
|
-
tags[tags.length - 1].isSelfClosingTag === true) {
|
|
173
|
-
tag = tags[tags.length - 1];
|
|
174
|
-
tag.loc.push({
|
|
175
|
-
start: DOM_PARSER_RE.lastIndex - token[0].length,
|
|
176
|
-
end: DOM_PARSER_RE.lastIndex,
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
lastIndex = DOM_PARSER_RE.lastIndex;
|
|
181
|
-
}
|
|
182
|
-
text = str.slice(lastIndex);
|
|
183
|
-
parent.children.push({
|
|
184
|
-
type: TEXT_NODE,
|
|
185
|
-
value: text,
|
|
186
|
-
parent,
|
|
187
|
-
});
|
|
188
|
-
return doc;
|
|
189
|
-
}
|
|
190
|
-
const HTMLString = Symbol('HTMLString');
|
|
191
|
-
const AttrString = Symbol('AttrString');
|
|
192
|
-
const RenderFn = Symbol('RenderFn');
|
|
193
|
-
function mark(str, tags = [HTMLString]) {
|
|
194
|
-
const v = { value: str };
|
|
195
|
-
for (const tag of tags) {
|
|
196
|
-
Object.defineProperty(v, tag, {
|
|
197
|
-
value: true,
|
|
198
|
-
enumerable: false,
|
|
199
|
-
writable: false,
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
return v;
|
|
203
|
-
}
|
|
204
|
-
const ESCAPE_CHARS = {
|
|
205
|
-
'&': '&',
|
|
206
|
-
'<': '<',
|
|
207
|
-
'>': '>',
|
|
208
|
-
};
|
|
209
|
-
function escapeHTML(str) {
|
|
210
|
-
return str.replace(/[&<>]/g, (c) => ESCAPE_CHARS[c] || c);
|
|
211
|
-
}
|
|
212
|
-
function attrs(attributes) {
|
|
213
|
-
let attrStr = '';
|
|
214
|
-
for (const [key, value] of Object.entries(attributes)) {
|
|
215
|
-
attrStr += ` ${key}="${value}"`;
|
|
216
|
-
}
|
|
217
|
-
return mark(attrStr, [HTMLString, AttrString]);
|
|
218
|
-
}
|
|
219
|
-
function renderElement(node) {
|
|
220
|
-
const { name, attributes = {} } = node;
|
|
221
|
-
const children = node.children.map((child) => render(child)).join('');
|
|
222
|
-
if (RenderFn in node) {
|
|
223
|
-
const value = node[RenderFn](attributes, mark(children));
|
|
224
|
-
if (value && value[HTMLString])
|
|
225
|
-
return value.value;
|
|
226
|
-
return escapeHTML(String(value));
|
|
227
|
-
}
|
|
228
|
-
if (name === Fragment)
|
|
229
|
-
return children;
|
|
230
|
-
if (VOID_TAGS.has(name)) {
|
|
231
|
-
return `<${node.name}${attrs(attributes).value}>`;
|
|
232
|
-
}
|
|
233
|
-
return `<${node.name}${attrs(attributes).value}>${children}</${node.name}>`;
|
|
234
|
-
}
|
|
235
|
-
export function render(node) {
|
|
236
|
-
switch (node.type) {
|
|
237
|
-
case DOCUMENT_NODE:
|
|
238
|
-
return node.children.map((child) => render(child)).join('');
|
|
239
|
-
case ELEMENT_NODE:
|
|
240
|
-
return renderElement(node);
|
|
241
|
-
case TEXT_NODE:
|
|
242
|
-
return `${node.value}`;
|
|
243
|
-
case COMMENT_NODE:
|
|
244
|
-
return `<!--${node.value}-->`;
|
|
245
|
-
case DOCTYPE_NODE:
|
|
246
|
-
return `<!${node.value}>`;
|
|
247
|
-
}
|
|
248
|
-
}
|
package/source/pipe.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const pipe = (arg, firstFn, ...fns) => fns.reduce((acc, fn) => fn(acc), firstFn(arg));
|
package/source/spread.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
import { createMemo, mergeProps } from 'solid-js';
|
|
3
|
-
import { spread as solidSpread } from 'solid-js/web';
|
|
4
|
-
import { mergeStyle } from './merge-style';
|
|
5
|
-
const getEventKey = (key) => `$$${key.toLowerCase().slice(2)}`;
|
|
6
|
-
const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
|
|
7
|
-
function mapProps(props, mapper) {
|
|
8
|
-
return Object.fromEntries(Object.entries(props).map(([key, value]) => [key, mapper(key, value)]));
|
|
9
|
-
}
|
|
10
|
-
export const spread = (node, props) => {
|
|
11
|
-
const nodeEvents = Object.fromEntries(Object.keys(node)
|
|
12
|
-
.filter((prop) => prop.startsWith('$$'))
|
|
13
|
-
// @ts-expect-error - fix later
|
|
14
|
-
.map((prop) => [prop, node[prop]]));
|
|
15
|
-
const isSVG = node instanceof SVGElement;
|
|
16
|
-
const childProps = createMemo(() => mapProps(props, (key, value) => {
|
|
17
|
-
const eventKey = getEventKey(key);
|
|
18
|
-
// event composition
|
|
19
|
-
if (hasOwn(nodeEvents, eventKey)) {
|
|
20
|
-
return function next(...args) {
|
|
21
|
-
if (typeof value === 'function')
|
|
22
|
-
value(...args);
|
|
23
|
-
nodeEvents[eventKey](...args);
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
// style composition
|
|
27
|
-
if (key === 'style') {
|
|
28
|
-
return mergeStyle(node.style.cssText, value);
|
|
29
|
-
}
|
|
30
|
-
// class composition
|
|
31
|
-
if (key === 'class') {
|
|
32
|
-
return [node.classList.toString(), value].filter(Boolean).join(' ');
|
|
33
|
-
}
|
|
34
|
-
// don't override existing child attributes
|
|
35
|
-
if (node.hasAttribute(key))
|
|
36
|
-
return;
|
|
37
|
-
return value;
|
|
38
|
-
}));
|
|
39
|
-
solidSpread(node, mergeProps(childProps), isSVG);
|
|
40
|
-
};
|
package/source/ssr-spread.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { filterBooleanAttributeValues, filterEmptyValues, filterFunctionValues, } from './filter-object';
|
|
2
|
-
import { mergeStyle } from './merge-style';
|
|
3
|
-
import { parse, render } from './parse-template';
|
|
4
|
-
import { pipe } from './pipe';
|
|
5
|
-
export const ssrSpread = (children, attributes) => {
|
|
6
|
-
if (isJSXElement(children))
|
|
7
|
-
return children;
|
|
8
|
-
const { t } = children;
|
|
9
|
-
const ast = parse(t);
|
|
10
|
-
const [node] = ast.children;
|
|
11
|
-
const mergedAttributes = Object.assign({}, attributes, {
|
|
12
|
-
class: [attributes?.class, node.attributes.class].filter(Boolean).join(' '),
|
|
13
|
-
style: mergeStyle(attributes.style, node.attributes.style),
|
|
14
|
-
});
|
|
15
|
-
const ssrAttributes = pipe(mergedAttributes, filterEmptyValues, filterFunctionValues, filterBooleanAttributeValues);
|
|
16
|
-
Object.assign(node.attributes, ssrAttributes);
|
|
17
|
-
return { t: render(ast) };
|
|
18
|
-
};
|
|
19
|
-
const isJSXElement = (children) => !Object.hasOwnProperty.call(children, 't');
|
package/types/constants.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const BooleanAttributes: Set<string>;
|
package/types/filter-object.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type Entry<T> = {
|
|
2
|
-
[K in keyof T]: [K, T[K]];
|
|
3
|
-
}[keyof T];
|
|
4
|
-
export declare const filterObject: <T extends object>(obj: T, fn: (entry: Entry<T>, i: number, arr: Entry<T>[]) => boolean) => Partial<T>;
|
|
5
|
-
export declare const filterEmptyValues: <T extends object>(obj: T) => Partial<T>;
|
|
6
|
-
export declare const filterFunctionValues: <T extends object>(obj: T) => Partial<T>;
|
|
7
|
-
export declare const filterBooleanAttributeValues: <T extends object>(obj: T) => Partial<T>;
|
|
8
|
-
export {};
|
package/types/is-empty.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isEmpty: (value: unknown) => boolean;
|
package/types/is-function.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isFunction: (value: unknown) => boolean;
|
package/types/merge-style.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
type Node = DocumentNode | ElementNode | TextNode | CommentNode | DoctypeNode;
|
|
2
|
-
type NodeType = typeof DOCUMENT_NODE | typeof ELEMENT_NODE | typeof TEXT_NODE | typeof COMMENT_NODE | typeof DOCTYPE_NODE;
|
|
3
|
-
interface Location {
|
|
4
|
-
start: number;
|
|
5
|
-
end: number;
|
|
6
|
-
}
|
|
7
|
-
interface BaseNode {
|
|
8
|
-
type: NodeType;
|
|
9
|
-
loc: [Location, Location];
|
|
10
|
-
parent: Node;
|
|
11
|
-
[key: string]: any;
|
|
12
|
-
}
|
|
13
|
-
interface LiteralNode extends BaseNode {
|
|
14
|
-
value: string;
|
|
15
|
-
}
|
|
16
|
-
interface ParentNode extends BaseNode {
|
|
17
|
-
children: Node[];
|
|
18
|
-
}
|
|
19
|
-
interface DocumentNode extends Omit<ParentNode, 'parent'> {
|
|
20
|
-
type: typeof DOCUMENT_NODE;
|
|
21
|
-
attributes: Record<string, string>;
|
|
22
|
-
parent: undefined;
|
|
23
|
-
}
|
|
24
|
-
interface ElementNode extends ParentNode {
|
|
25
|
-
type: typeof ELEMENT_NODE;
|
|
26
|
-
name: string;
|
|
27
|
-
attributes: Record<string, string>;
|
|
28
|
-
}
|
|
29
|
-
interface TextNode extends LiteralNode {
|
|
30
|
-
type: typeof TEXT_NODE;
|
|
31
|
-
}
|
|
32
|
-
interface CommentNode extends LiteralNode {
|
|
33
|
-
type: typeof COMMENT_NODE;
|
|
34
|
-
}
|
|
35
|
-
interface DoctypeNode extends LiteralNode {
|
|
36
|
-
type: typeof DOCTYPE_NODE;
|
|
37
|
-
}
|
|
38
|
-
declare const DOCUMENT_NODE = 0;
|
|
39
|
-
declare const ELEMENT_NODE = 1;
|
|
40
|
-
declare const TEXT_NODE = 2;
|
|
41
|
-
declare const COMMENT_NODE = 3;
|
|
42
|
-
declare const DOCTYPE_NODE = 4;
|
|
43
|
-
export declare function parse(str: string): any;
|
|
44
|
-
export declare function render(node: Node): string;
|
|
45
|
-
export {};
|
package/types/pipe.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type AnyFunc = (...arg: any) => any;
|
|
2
|
-
type LastFnReturnType<F extends Array<AnyFunc>, Else = never> = F extends [
|
|
3
|
-
...any[],
|
|
4
|
-
(...arg: any) => infer R
|
|
5
|
-
] ? R : Else;
|
|
6
|
-
type PipeArgs<F extends AnyFunc[], Acc extends AnyFunc[] = []> = F extends [
|
|
7
|
-
(...args: infer A) => infer B
|
|
8
|
-
] ? [...Acc, (...args: A) => B] : F extends [(...args: infer A) => any, ...infer Tail] ? Tail extends [(arg: infer B) => any, ...any[]] ? PipeArgs<Tail, [...Acc, (...args: A) => B]> : Acc : Acc;
|
|
9
|
-
export declare const pipe: <FirstFn extends AnyFunc, F extends AnyFunc[]>(arg: Parameters<FirstFn>[0], firstFn: FirstFn, ...fns: PipeArgs<F, []> extends F ? F : PipeArgs<F, []>) => LastFnReturnType<F, ReturnType<FirstFn>>;
|
|
10
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IndicatorProps } from '@zag-js/progress';
|
|
2
|
-
import { type HTMLArkProps } from '../factory';
|
|
3
|
-
import type { Assign } from '../types';
|
|
4
|
-
export interface ProgressIndicatorProps extends Assign<HTMLArkProps<'span'>, IndicatorProps> {
|
|
5
|
-
}
|
|
6
|
-
export declare const ProgressIndicator: (props: ProgressIndicatorProps) => import("solid-js").JSX.Element;
|
package/types/spread.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const spread: (node: HTMLElement | SVGElement, props: any) => void;
|
package/types/ssr-spread.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type JSX } from 'solid-js';
|
|
2
|
-
type Children = {
|
|
3
|
-
t: string;
|
|
4
|
-
} | JSX.Element;
|
|
5
|
-
type Attributes = {
|
|
6
|
-
class?: string;
|
|
7
|
-
style?: string | JSX.CSSProperties;
|
|
8
|
-
} & object;
|
|
9
|
-
export declare const ssrSpread: <T extends Children>(children: T, attributes: Attributes) => T;
|
|
10
|
-
export {};
|
|
File without changes
|
|
File without changes
|