@ark-ui/solid 0.2.0 → 0.4.0
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 +101 -0
- package/dist/accordion/accordion-content.cjs +5 -5
- package/dist/accordion/accordion-content.mjs +6 -6
- package/dist/accordion/accordion-context.cjs +2 -2
- package/dist/accordion/accordion-context.d.ts +3 -11
- package/dist/accordion/accordion-context.mjs +2 -2
- package/dist/accordion/accordion-item.cjs +10 -6
- package/dist/accordion/accordion-item.d.ts +1 -1
- package/dist/accordion/accordion-item.mjs +12 -8
- package/dist/accordion/accordion-trigger.cjs +7 -14
- package/dist/accordion/accordion-trigger.d.ts +4 -6
- package/dist/accordion/accordion-trigger.mjs +7 -14
- package/dist/accordion/accordion.cjs +6 -4
- package/dist/accordion/accordion.d.ts +1 -1
- package/dist/accordion/accordion.mjs +7 -5
- package/dist/accordion/use-accordion.cjs +1 -1
- package/dist/accordion/use-accordion.d.ts +4 -9
- package/dist/accordion/use-accordion.mjs +2 -2
- package/dist/carousel/carousel-context.cjs +13 -0
- package/dist/carousel/carousel-context.d.ts +62 -0
- package/dist/carousel/carousel-context.mjs +8 -0
- package/dist/carousel/carousel-control.cjs +10 -0
- package/dist/carousel/carousel-control.d.ts +4 -0
- package/dist/carousel/carousel-control.mjs +6 -0
- package/dist/carousel/carousel-next-slide-trigger.cjs +16 -0
- package/dist/carousel/carousel-next-slide-trigger.d.ts +4 -0
- package/dist/carousel/carousel-next-slide-trigger.mjs +12 -0
- package/dist/carousel/carousel-prev-slide-trigger.cjs +16 -0
- package/dist/carousel/carousel-prev-slide-trigger.d.ts +4 -0
- package/dist/carousel/carousel-prev-slide-trigger.mjs +12 -0
- package/dist/carousel/carousel-slide-group.cjs +16 -0
- package/dist/carousel/carousel-slide-group.d.ts +4 -0
- package/dist/carousel/carousel-slide-group.mjs +12 -0
- package/dist/carousel/carousel-slide.cjs +18 -0
- package/dist/carousel/carousel-slide.d.ts +6 -0
- package/dist/carousel/carousel-slide.mjs +14 -0
- package/dist/carousel/carousel-viewport.cjs +16 -0
- package/dist/carousel/carousel-viewport.d.ts +4 -0
- package/dist/carousel/carousel-viewport.mjs +12 -0
- package/dist/carousel/carousel.anatomy.cjs +10 -0
- package/dist/carousel/carousel.anatomy.d.ts +3 -0
- package/dist/carousel/carousel.anatomy.mjs +6 -0
- package/dist/carousel/carousel.cjs +24 -0
- package/dist/carousel/carousel.d.ts +6 -0
- package/dist/carousel/carousel.mjs +20 -0
- package/dist/carousel/index.d.ts +8 -0
- package/dist/carousel/use-carousel.cjs +36 -0
- package/dist/carousel/use-carousel.d.ts +35 -0
- package/dist/carousel/use-carousel.mjs +13 -0
- package/dist/checkbox/checkbox-context.cjs +2 -2
- package/dist/checkbox/checkbox-context.d.ts +11 -12
- package/dist/checkbox/checkbox-context.mjs +2 -2
- package/dist/checkbox/checkbox-control.cjs +3 -1
- package/dist/checkbox/checkbox-control.mjs +4 -2
- package/dist/checkbox/checkbox-input.cjs +3 -1
- package/dist/checkbox/checkbox-input.mjs +4 -2
- package/dist/checkbox/checkbox-label.cjs +3 -1
- package/dist/checkbox/checkbox-label.mjs +4 -2
- package/dist/checkbox/checkbox.cjs +11 -14
- package/dist/checkbox/checkbox.d.ts +3 -5
- package/dist/checkbox/checkbox.mjs +13 -16
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/use-checkbox.cjs +1 -1
- package/dist/checkbox/use-checkbox.d.ts +6 -6
- package/dist/checkbox/use-checkbox.mjs +2 -2
- package/dist/combobox/combobox-content.cjs +3 -1
- package/dist/combobox/combobox-content.mjs +4 -2
- package/dist/combobox/combobox-control.cjs +3 -1
- package/dist/combobox/combobox-control.mjs +4 -2
- package/dist/combobox/combobox-input.cjs +3 -1
- package/dist/combobox/combobox-input.mjs +4 -2
- package/dist/combobox/combobox-label.cjs +3 -1
- package/dist/combobox/combobox-label.mjs +4 -2
- package/dist/combobox/combobox-option.cjs +5 -6
- package/dist/combobox/combobox-option.d.ts +1 -1
- package/dist/combobox/combobox-option.mjs +8 -9
- package/dist/combobox/combobox-positioner.cjs +3 -1
- package/dist/combobox/combobox-positioner.mjs +4 -2
- package/dist/combobox/combobox-trigger.cjs +4 -11
- package/dist/combobox/combobox-trigger.d.ts +4 -6
- package/dist/combobox/combobox-trigger.mjs +5 -12
- package/dist/combobox/combobox.cjs +9 -12
- package/dist/combobox/combobox.d.ts +3 -5
- package/dist/combobox/combobox.mjs +11 -14
- package/dist/combobox/use-combobox.cjs +1 -1
- package/dist/combobox/use-combobox.d.ts +4 -4
- package/dist/combobox/use-combobox.mjs +2 -2
- package/dist/create-split-props.d.ts +3 -1
- package/dist/dialog/dialog-backdrop.cjs +3 -1
- package/dist/dialog/dialog-backdrop.mjs +4 -2
- package/dist/dialog/dialog-close-trigger.cjs +4 -11
- package/dist/dialog/dialog-close-trigger.d.ts +4 -6
- package/dist/dialog/dialog-close-trigger.mjs +5 -12
- package/dist/dialog/dialog-container.cjs +3 -1
- package/dist/dialog/dialog-container.mjs +4 -2
- package/dist/dialog/dialog-content.cjs +3 -1
- package/dist/dialog/dialog-content.mjs +4 -2
- package/dist/dialog/dialog-description.cjs +3 -1
- package/dist/dialog/dialog-description.mjs +4 -2
- package/dist/dialog/dialog-title.cjs +3 -1
- package/dist/dialog/dialog-title.mjs +4 -2
- package/dist/dialog/dialog-trigger.cjs +4 -11
- package/dist/dialog/dialog-trigger.d.ts +4 -6
- package/dist/dialog/dialog-trigger.mjs +5 -12
- package/dist/dialog/dialog.cjs +5 -6
- package/dist/dialog/dialog.d.ts +1 -1
- package/dist/dialog/dialog.mjs +5 -6
- package/dist/dialog/use-dialog.cjs +1 -1
- package/dist/dialog/use-dialog.mjs +2 -2
- package/dist/editable/editable-area.cjs +3 -1
- package/dist/editable/editable-area.mjs +4 -2
- package/dist/editable/editable-cancel-trigger.cjs +5 -12
- package/dist/editable/editable-cancel-trigger.d.ts +4 -6
- package/dist/editable/editable-cancel-trigger.mjs +6 -13
- package/dist/editable/editable-control.cjs +3 -1
- package/dist/editable/editable-control.mjs +4 -2
- package/dist/editable/editable-edit-trigger.cjs +5 -12
- package/dist/editable/editable-edit-trigger.d.ts +4 -6
- package/dist/editable/editable-edit-trigger.mjs +6 -13
- package/dist/editable/editable-input.cjs +3 -1
- package/dist/editable/editable-input.mjs +4 -2
- package/dist/editable/editable-label.cjs +3 -1
- package/dist/editable/editable-label.mjs +4 -2
- package/dist/editable/editable-preview.cjs +3 -1
- package/dist/editable/editable-preview.mjs +4 -2
- package/dist/editable/editable-submit-trigger.cjs +4 -11
- package/dist/editable/editable-submit-trigger.d.ts +4 -6
- package/dist/editable/editable-submit-trigger.mjs +5 -12
- package/dist/editable/editable.cjs +10 -11
- package/dist/editable/editable.d.ts +4 -6
- package/dist/editable/editable.mjs +13 -14
- package/dist/editable/use-editable.cjs +1 -1
- package/dist/editable/use-editable.mjs +2 -2
- package/dist/factory.cjs +43 -9
- package/dist/factory.d.ts +14 -12
- package/dist/factory.mjs +43 -10
- package/dist/filter-props.cjs +28 -0
- package/dist/filter-props.d.ts +2 -0
- package/dist/filter-props.mjs +23 -0
- package/dist/hover-card/hover-card-arrow-tip.cjs +3 -1
- package/dist/hover-card/hover-card-arrow-tip.mjs +4 -2
- package/dist/hover-card/hover-card-arrow.cjs +3 -1
- package/dist/hover-card/hover-card-arrow.mjs +4 -2
- package/dist/hover-card/hover-card-content.cjs +3 -1
- package/dist/hover-card/hover-card-content.mjs +4 -2
- package/dist/hover-card/hover-card-positioner.cjs +3 -1
- package/dist/hover-card/hover-card-positioner.mjs +4 -2
- package/dist/hover-card/hover-card-trigger.cjs +4 -11
- package/dist/hover-card/hover-card-trigger.d.ts +4 -6
- package/dist/hover-card/hover-card-trigger.mjs +5 -12
- package/dist/hover-card/hover-card.cjs +6 -4
- package/dist/hover-card/hover-card.d.ts +2 -2
- package/dist/hover-card/hover-card.mjs +6 -4
- package/dist/hover-card/use-hover-card.cjs +1 -1
- package/dist/hover-card/use-hover-card.mjs +2 -2
- package/dist/index.cjs +33 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +15 -0
- package/dist/menu/menu-arrow-tip.cjs +3 -1
- package/dist/menu/menu-arrow-tip.mjs +4 -2
- package/dist/menu/menu-arrow.cjs +3 -1
- package/dist/menu/menu-arrow.mjs +4 -2
- package/dist/menu/menu-content.cjs +3 -1
- package/dist/menu/menu-content.mjs +4 -2
- package/dist/menu/menu-context-trigger.cjs +4 -9
- package/dist/menu/menu-context-trigger.d.ts +4 -6
- package/dist/menu/menu-context-trigger.mjs +5 -10
- package/dist/menu/menu-item-group-label.cjs +4 -2
- package/dist/menu/menu-item-group-label.d.ts +1 -1
- package/dist/menu/menu-item-group-label.mjs +5 -3
- package/dist/menu/menu-item-group.cjs +4 -2
- package/dist/menu/menu-item-group.d.ts +1 -1
- package/dist/menu/menu-item-group.mjs +5 -3
- package/dist/menu/menu-item.cjs +4 -2
- package/dist/menu/menu-item.d.ts +1 -1
- package/dist/menu/menu-item.mjs +5 -3
- package/dist/menu/menu-option-item.cjs +9 -4
- package/dist/menu/menu-option-item.d.ts +3 -3
- package/dist/menu/menu-option-item.mjs +11 -6
- package/dist/menu/menu-positioner.cjs +3 -1
- package/dist/menu/menu-positioner.mjs +4 -2
- package/dist/menu/menu-separator.cjs +3 -1
- package/dist/menu/menu-separator.mjs +4 -2
- package/dist/menu/menu-trigger-item.cjs +3 -1
- package/dist/menu/menu-trigger-item.mjs +4 -2
- package/dist/menu/menu-trigger.cjs +4 -10
- package/dist/menu/menu-trigger.d.ts +4 -6
- package/dist/menu/menu-trigger.mjs +5 -11
- package/dist/menu/menu.cjs +13 -21
- package/dist/menu/menu.d.ts +1 -1
- package/dist/menu/menu.mjs +15 -23
- package/dist/menu/use-menu.cjs +1 -1
- package/dist/menu/use-menu.mjs +2 -2
- package/dist/number-input/number-input-control.cjs +4 -2
- package/dist/number-input/number-input-control.mjs +5 -3
- package/dist/number-input/number-input-decrement-trigger.cjs +5 -12
- package/dist/number-input/number-input-decrement-trigger.d.ts +4 -6
- package/dist/number-input/number-input-decrement-trigger.mjs +6 -13
- package/dist/number-input/number-input-field.cjs +4 -2
- package/dist/number-input/number-input-field.mjs +5 -3
- package/dist/number-input/number-input-increment-trigger.cjs +5 -12
- package/dist/number-input/number-input-increment-trigger.d.ts +4 -6
- package/dist/number-input/number-input-increment-trigger.mjs +6 -13
- package/dist/number-input/number-input-label.cjs +4 -2
- package/dist/number-input/number-input-label.mjs +5 -3
- package/dist/number-input/number-input-scrubber.cjs +4 -2
- package/dist/number-input/number-input-scrubber.mjs +5 -3
- package/dist/number-input/number-input.cjs +6 -4
- package/dist/number-input/number-input.d.ts +1 -1
- package/dist/number-input/number-input.mjs +7 -5
- package/dist/number-input/use-number-input.cjs +1 -1
- package/dist/number-input/use-number-input.mjs +2 -2
- package/dist/pagination/index.d.ts +1 -0
- package/dist/pagination/pagination-context.d.ts +5 -15
- package/dist/pagination/pagination-ellipsis.cjs +5 -3
- package/dist/pagination/pagination-ellipsis.d.ts +3 -6
- package/dist/pagination/pagination-ellipsis.mjs +6 -4
- package/dist/pagination/pagination-list-item.cjs +11 -0
- package/dist/pagination/pagination-list-item.d.ts +4 -0
- package/dist/pagination/pagination-list-item.mjs +7 -0
- package/dist/pagination/pagination-list.cjs +2 -1
- package/dist/pagination/pagination-list.mjs +3 -2
- package/dist/pagination/pagination-page-trigger.d.ts +1 -1
- package/dist/pagination/pagination-prev-page-trigger.cjs +2 -2
- package/dist/pagination/pagination-prev-page-trigger.mjs +2 -2
- package/dist/pagination/pagination.anatomy.cjs +3 -1
- package/dist/pagination/pagination.anatomy.d.ts +3 -2
- package/dist/pagination/pagination.anatomy.mjs +3 -2
- package/dist/pagination/pagination.cjs +9 -7
- package/dist/pagination/pagination.d.ts +3 -3
- package/dist/pagination/pagination.mjs +11 -9
- package/dist/pagination/use-pagination.cjs +1 -1
- package/dist/pagination/use-pagination.d.ts +3 -8
- package/dist/pagination/use-pagination.mjs +2 -2
- package/dist/pin-input/pin-input-control.cjs +8 -4
- package/dist/pin-input/pin-input-control.mjs +9 -5
- package/dist/pin-input/pin-input-field.cjs +6 -8
- package/dist/pin-input/pin-input-field.d.ts +1 -1
- package/dist/pin-input/pin-input-field.mjs +7 -9
- package/dist/pin-input/pin-input-label.cjs +4 -2
- package/dist/pin-input/pin-input-label.mjs +5 -3
- package/dist/pin-input/pin-input.cjs +5 -3
- package/dist/pin-input/pin-input.d.ts +1 -1
- package/dist/pin-input/pin-input.mjs +6 -4
- package/dist/pin-input/use-pin-input.cjs +1 -1
- package/dist/pin-input/use-pin-input.mjs +2 -2
- package/dist/popover/popover-anchor.cjs +6 -13
- package/dist/popover/popover-anchor.d.ts +4 -6
- package/dist/popover/popover-anchor.mjs +6 -13
- package/dist/popover/popover-arrow-tip.cjs +3 -1
- package/dist/popover/popover-arrow-tip.mjs +4 -2
- package/dist/popover/popover-arrow.cjs +3 -1
- package/dist/popover/popover-arrow.mjs +4 -2
- package/dist/popover/popover-close-trigger.cjs +5 -12
- package/dist/popover/popover-close-trigger.d.ts +4 -6
- package/dist/popover/popover-close-trigger.mjs +6 -13
- package/dist/popover/popover-content.cjs +4 -2
- package/dist/popover/popover-content.mjs +5 -3
- package/dist/popover/popover-description.cjs +4 -2
- package/dist/popover/popover-description.mjs +5 -3
- package/dist/popover/popover-positioner.cjs +4 -2
- package/dist/popover/popover-positioner.mjs +5 -3
- package/dist/popover/popover-title.cjs +4 -2
- package/dist/popover/popover-title.mjs +5 -3
- package/dist/popover/popover-trigger.cjs +6 -13
- package/dist/popover/popover-trigger.d.ts +4 -6
- package/dist/popover/popover-trigger.mjs +6 -13
- package/dist/popover/popover.cjs +2 -2
- package/dist/popover/popover.mjs +2 -2
- package/dist/popover/use-popover.cjs +1 -1
- package/dist/popover/use-popover.mjs +2 -2
- package/dist/pressable/pressable.cjs +5 -5
- package/dist/pressable/pressable.d.ts +1 -1
- package/dist/pressable/pressable.mjs +6 -6
- package/dist/pressable/use-pressable.cjs +2 -2
- package/dist/pressable/use-pressable.d.ts +3 -3
- package/dist/pressable/use-pressable.mjs +3 -3
- package/dist/prop-trap.cjs +37 -0
- package/dist/prop-trap.d.ts +5 -0
- package/dist/prop-trap.mjs +33 -0
- package/dist/radio-group/radio-control.cjs +5 -3
- package/dist/radio-group/radio-control.mjs +6 -4
- package/dist/radio-group/radio-group-context.d.ts +2 -0
- package/dist/radio-group/radio-group-label.cjs +4 -2
- package/dist/radio-group/radio-group-label.mjs +5 -3
- package/dist/radio-group/radio-group.cjs +6 -4
- package/dist/radio-group/radio-group.d.ts +1 -1
- package/dist/radio-group/radio-group.mjs +7 -5
- package/dist/radio-group/radio-input.cjs +5 -3
- package/dist/radio-group/radio-input.mjs +6 -4
- package/dist/radio-group/radio-label.cjs +5 -3
- package/dist/radio-group/radio-label.mjs +6 -4
- package/dist/radio-group/radio.cjs +5 -6
- package/dist/radio-group/radio.d.ts +1 -1
- package/dist/radio-group/radio.mjs +6 -7
- package/dist/radio-group/use-radio-group.cjs +1 -1
- package/dist/radio-group/use-radio-group.d.ts +1 -0
- package/dist/radio-group/use-radio-group.mjs +2 -2
- package/dist/range-slider/range-slider-control.cjs +3 -1
- package/dist/range-slider/range-slider-control.mjs +4 -2
- package/dist/range-slider/range-slider-label.cjs +3 -1
- package/dist/range-slider/range-slider-label.mjs +4 -2
- package/dist/range-slider/range-slider-marker-group.cjs +3 -1
- package/dist/range-slider/range-slider-marker-group.mjs +4 -2
- package/dist/range-slider/range-slider-marker.cjs +5 -3
- package/dist/range-slider/range-slider-marker.d.ts +1 -1
- package/dist/range-slider/range-slider-marker.mjs +6 -4
- package/dist/range-slider/range-slider-output.cjs +6 -5
- package/dist/range-slider/range-slider-output.d.ts +2 -2
- package/dist/range-slider/range-slider-output.mjs +7 -6
- package/dist/range-slider/range-slider-range.cjs +3 -1
- package/dist/range-slider/range-slider-range.mjs +4 -2
- package/dist/range-slider/range-slider-thumb.cjs +5 -3
- package/dist/range-slider/range-slider-thumb.d.ts +1 -1
- package/dist/range-slider/range-slider-thumb.mjs +6 -4
- package/dist/range-slider/range-slider-track.cjs +3 -1
- package/dist/range-slider/range-slider-track.mjs +4 -2
- package/dist/range-slider/range-slider.cjs +7 -6
- package/dist/range-slider/range-slider.d.ts +2 -2
- package/dist/range-slider/range-slider.mjs +7 -6
- package/dist/range-slider/use-range-slider.cjs +1 -1
- package/dist/range-slider/use-range-slider.mjs +2 -2
- package/dist/rating-group/rating-context.d.ts +3 -13
- package/dist/rating-group/rating-group-context.d.ts +5 -20
- package/dist/rating-group/rating-group-control.cjs +6 -5
- package/dist/rating-group/rating-group-control.d.ts +3 -2
- package/dist/rating-group/rating-group-control.mjs +7 -6
- package/dist/rating-group/rating-group-label.cjs +3 -1
- package/dist/rating-group/rating-group-label.mjs +4 -2
- package/dist/rating-group/rating-group.cjs +7 -5
- package/dist/rating-group/rating-group.d.ts +2 -2
- package/dist/rating-group/rating-group.mjs +8 -6
- package/dist/rating-group/rating.cjs +9 -8
- package/dist/rating-group/rating.d.ts +6 -4
- package/dist/rating-group/rating.mjs +10 -9
- package/dist/rating-group/use-rating-group.cjs +1 -1
- package/dist/rating-group/use-rating-group.d.ts +2 -10
- package/dist/rating-group/use-rating-group.mjs +2 -2
- package/dist/select/select-content.cjs +4 -2
- package/dist/select/select-content.mjs +5 -3
- package/dist/select/select-label.cjs +4 -2
- package/dist/select/select-label.mjs +5 -3
- package/dist/select/select-option-group-label.cjs +5 -3
- package/dist/select/select-option-group-label.d.ts +3 -3
- package/dist/select/select-option-group-label.mjs +6 -4
- package/dist/select/select-option-group.cjs +5 -3
- package/dist/select/select-option-group.d.ts +3 -3
- package/dist/select/select-option-group.mjs +6 -4
- package/dist/select/select-option.cjs +6 -4
- package/dist/select/select-option.d.ts +3 -3
- package/dist/select/select-option.mjs +7 -5
- package/dist/select/select-positioner.cjs +4 -2
- package/dist/select/select-positioner.mjs +5 -3
- package/dist/select/select-trigger.cjs +5 -12
- package/dist/select/select-trigger.d.ts +4 -6
- package/dist/select/select-trigger.mjs +6 -13
- package/dist/select/select.cjs +5 -12
- package/dist/select/select.d.ts +1 -1
- package/dist/select/select.mjs +7 -14
- package/dist/select/use-select.cjs +1 -1
- package/dist/select/use-select.mjs +2 -2
- package/dist/slider/slider-control.cjs +4 -2
- package/dist/slider/slider-control.mjs +5 -3
- package/dist/slider/slider-label.cjs +4 -2
- package/dist/slider/slider-label.mjs +5 -3
- package/dist/slider/slider-marker-group.cjs +4 -2
- package/dist/slider/slider-marker-group.mjs +5 -3
- package/dist/slider/slider-marker.cjs +5 -3
- package/dist/slider/slider-marker.d.ts +3 -3
- package/dist/slider/slider-marker.mjs +6 -4
- package/dist/slider/slider-output.cjs +7 -4
- package/dist/slider/slider-output.d.ts +2 -2
- package/dist/slider/slider-output.mjs +8 -5
- package/dist/slider/slider-range.cjs +3 -1
- package/dist/slider/slider-range.mjs +4 -2
- package/dist/slider/slider-thumb.cjs +5 -3
- package/dist/slider/slider-thumb.mjs +6 -4
- package/dist/slider/slider-track.cjs +3 -1
- package/dist/slider/slider-track.mjs +4 -2
- package/dist/slider/slider.cjs +10 -7
- package/dist/slider/slider.d.ts +2 -2
- package/dist/slider/slider.mjs +11 -8
- package/dist/slider/use-slider.cjs +1 -1
- package/dist/slider/use-slider.mjs +2 -2
- package/dist/splitter/splitter-panel.cjs +5 -3
- package/dist/splitter/splitter-panel.d.ts +3 -3
- package/dist/splitter/splitter-panel.mjs +6 -4
- package/dist/splitter/splitter-resize-trigger.cjs +7 -12
- package/dist/splitter/splitter-resize-trigger.d.ts +7 -9
- package/dist/splitter/splitter-resize-trigger.mjs +8 -13
- package/dist/splitter/splitter.cjs +6 -4
- package/dist/splitter/splitter.d.ts +1 -1
- package/dist/splitter/splitter.mjs +7 -5
- package/dist/splitter/use-splitter.cjs +1 -1
- package/dist/splitter/use-splitter.mjs +2 -2
- package/dist/spread.cjs +26 -13
- package/dist/spread.mjs +26 -13
- package/dist/switch/index.d.ts +6 -0
- package/dist/switch/switch-context.cjs +13 -0
- package/dist/switch/switch-context.d.ts +27 -0
- package/dist/switch/switch-context.mjs +8 -0
- package/dist/switch/switch-control.cjs +16 -0
- package/dist/switch/switch-control.d.ts +4 -0
- package/dist/switch/switch-control.mjs +12 -0
- package/dist/switch/switch-input.cjs +16 -0
- package/dist/switch/switch-input.d.ts +4 -0
- package/dist/switch/switch-input.mjs +12 -0
- package/dist/switch/switch-label.cjs +16 -0
- package/dist/switch/switch-label.d.ts +4 -0
- package/dist/switch/switch-label.mjs +12 -0
- package/dist/switch/switch-thumb.cjs +16 -0
- package/dist/switch/switch-thumb.d.ts +4 -0
- package/dist/switch/switch-thumb.mjs +12 -0
- package/dist/switch/switch.anatomy.d.ts +1 -0
- package/dist/switch/switch.cjs +30 -0
- package/dist/switch/switch.d.ts +9 -0
- package/dist/switch/switch.mjs +26 -0
- package/dist/switch/use-switch.cjs +36 -0
- package/dist/switch/use-switch.d.ts +17 -0
- package/dist/switch/use-switch.mjs +13 -0
- package/dist/tabs/tab-content.cjs +5 -3
- package/dist/tabs/tab-content.d.ts +3 -3
- package/dist/tabs/tab-content.mjs +6 -4
- package/dist/tabs/tab-indicator.cjs +4 -2
- package/dist/tabs/tab-indicator.mjs +5 -3
- package/dist/tabs/tab-list.cjs +4 -2
- package/dist/tabs/tab-list.mjs +5 -3
- package/dist/tabs/tab-trigger.cjs +6 -13
- package/dist/tabs/tab-trigger.d.ts +6 -10
- package/dist/tabs/tab-trigger.mjs +7 -14
- package/dist/tabs/tabs-context.d.ts +7 -9
- package/dist/tabs/tabs.cjs +6 -4
- package/dist/tabs/tabs.d.ts +1 -1
- package/dist/tabs/tabs.mjs +7 -5
- package/dist/tabs/use-tabs.cjs +1 -1
- package/dist/tabs/use-tabs.d.ts +3 -5
- package/dist/tabs/use-tabs.mjs +2 -2
- package/dist/tags-input/tag-delete-trigger.cjs +6 -13
- package/dist/tags-input/tag-delete-trigger.d.ts +5 -7
- package/dist/tags-input/tag-delete-trigger.mjs +7 -14
- package/dist/tags-input/tag-input.cjs +5 -3
- package/dist/tags-input/tag-input.d.ts +1 -1
- package/dist/tags-input/tag-input.mjs +6 -4
- package/dist/tags-input/tag.cjs +5 -3
- package/dist/tags-input/tag.d.ts +1 -1
- package/dist/tags-input/tag.mjs +6 -4
- package/dist/tags-input/tags-input-clear-trigger.cjs +4 -11
- package/dist/tags-input/tags-input-clear-trigger.d.ts +4 -6
- package/dist/tags-input/tags-input-clear-trigger.mjs +5 -12
- package/dist/tags-input/tags-input-control.cjs +4 -2
- package/dist/tags-input/tags-input-control.mjs +5 -3
- package/dist/tags-input/tags-input-field.cjs +4 -2
- package/dist/tags-input/tags-input-field.mjs +5 -3
- package/dist/tags-input/tags-input-label.cjs +4 -2
- package/dist/tags-input/tags-input-label.mjs +5 -3
- package/dist/tags-input/tags-input.cjs +10 -7
- package/dist/tags-input/tags-input.d.ts +3 -3
- package/dist/tags-input/tags-input.mjs +11 -8
- package/dist/tags-input/use-tags-input.cjs +1 -1
- package/dist/tags-input/use-tags-input.mjs +2 -2
- package/dist/toast/toast-close-trigger.cjs +5 -12
- package/dist/toast/toast-close-trigger.d.ts +4 -6
- package/dist/toast/toast-close-trigger.mjs +6 -13
- package/dist/toast/toast-description.cjs +5 -3
- package/dist/toast/toast-description.mjs +6 -4
- package/dist/toast/toast-group.cjs +8 -6
- package/dist/toast/toast-group.d.ts +6 -4
- package/dist/toast/toast-group.mjs +10 -8
- package/dist/toast/toast-placements.cjs +4 -2
- package/dist/toast/toast-placements.d.ts +2 -2
- package/dist/toast/toast-placements.mjs +5 -3
- package/dist/toast/toast-provider.cjs +2 -2
- package/dist/toast/toast-provider.mjs +2 -2
- package/dist/toast/toast-title.cjs +3 -1
- package/dist/toast/toast-title.mjs +4 -2
- package/dist/toast/toast.cjs +6 -4
- package/dist/toast/toast.d.ts +1 -1
- package/dist/toast/toast.mjs +7 -5
- package/dist/tooltip/tooltip-arrow-tip.cjs +4 -2
- package/dist/tooltip/tooltip-arrow-tip.mjs +5 -3
- package/dist/tooltip/tooltip-arrow.cjs +3 -1
- package/dist/tooltip/tooltip-arrow.mjs +4 -2
- package/dist/tooltip/tooltip-content.cjs +4 -2
- package/dist/tooltip/tooltip-content.mjs +5 -3
- package/dist/tooltip/tooltip-context.cjs +2 -2
- package/dist/tooltip/tooltip-context.mjs +2 -2
- package/dist/tooltip/tooltip-positioner.cjs +5 -3
- package/dist/tooltip/tooltip-positioner.mjs +6 -4
- package/dist/tooltip/tooltip-trigger.cjs +5 -12
- package/dist/tooltip/tooltip-trigger.d.ts +4 -6
- package/dist/tooltip/tooltip-trigger.mjs +6 -13
- package/dist/tooltip/tooltip.cjs +4 -4
- package/dist/tooltip/tooltip.mjs +4 -4
- package/dist/tooltip/use-tooltip.cjs +1 -1
- package/dist/tooltip/use-tooltip.mjs +2 -2
- package/dist/types.d.ts +7 -4
- package/package.json +76 -44
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const web = require('solid-js/web');
|
|
6
|
+
const solid = require('@zag-js/solid');
|
|
6
7
|
const createSplitProps = require('../create-split-props.cjs');
|
|
7
8
|
const factory = require('../factory.cjs');
|
|
8
9
|
const splitterContext = require('./splitter-context.cjs');
|
|
9
10
|
|
|
10
11
|
const SplitterPanel = props => {
|
|
11
|
-
const [
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
const [panelParams, restProps] = createSplitProps.createSplitProps()(props, ['id', 'snapSize']);
|
|
13
|
+
const api = splitterContext.useSplitterContext();
|
|
14
|
+
const panelProps = solid.mergeProps(() => api().getPanelProps(panelParams), restProps);
|
|
15
|
+
return web.createComponent(factory.ark.div, panelProps);
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
exports.SplitterPanel = SplitterPanel;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { JSX } from 'solid-js';
|
|
2
|
-
import { type Assign } from '@polymorphic-factory/solid';
|
|
3
2
|
import { type connect } from '@zag-js/splitter';
|
|
4
3
|
import { type HTMLArkProps } from '../factory';
|
|
5
|
-
type
|
|
6
|
-
|
|
4
|
+
import type { Assign } from '../types';
|
|
5
|
+
type PanelParams = Parameters<ReturnType<typeof connect>['getPanelProps']>[0];
|
|
6
|
+
export type SplitterPanelProps = Assign<HTMLArkProps<'div'>, PanelParams>;
|
|
7
7
|
export declare const SplitterPanel: (props: SplitterPanelProps) => JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { createComponent
|
|
1
|
+
import { createComponent } from 'solid-js/web';
|
|
2
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
3
|
import { createSplitProps } from '../create-split-props.mjs';
|
|
3
4
|
import { ark } from '../factory.mjs';
|
|
4
5
|
import { useSplitterContext } from './splitter-context.mjs';
|
|
5
6
|
|
|
6
7
|
const SplitterPanel = props => {
|
|
7
|
-
const [
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const [panelParams, restProps] = createSplitProps()(props, ['id', 'snapSize']);
|
|
9
|
+
const api = useSplitterContext();
|
|
10
|
+
const panelProps = mergeProps(() => api().getPanelProps(panelParams), restProps);
|
|
11
|
+
return createComponent(ark.div, panelProps);
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
export { SplitterPanel };
|
|
@@ -2,22 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const solidJs = require('solid-js');
|
|
6
5
|
const web = require('solid-js/web');
|
|
7
|
-
const
|
|
6
|
+
const solid = require('@zag-js/solid');
|
|
7
|
+
const createSplitProps = require('../create-split-props.cjs');
|
|
8
|
+
const factory = require('../factory.cjs');
|
|
8
9
|
const splitterContext = require('./splitter-context.cjs');
|
|
9
10
|
|
|
10
11
|
const SplitterResizeTrigger = props => {
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const children = getChildren();
|
|
16
|
-
if (children instanceof HTMLElement) {
|
|
17
|
-
web.spread(children, triggerProps);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
return getChildren();
|
|
12
|
+
const api = splitterContext.useSplitterContext();
|
|
13
|
+
const [triggerParams, restProps] = createSplitProps.createSplitProps()(props, ['disabled', 'id', 'step']);
|
|
14
|
+
const triggerProps = solid.mergeProps(() => api().getResizeTriggerProps(triggerParams), restProps);
|
|
15
|
+
return web.createComponent(factory.ark.button, triggerProps);
|
|
21
16
|
};
|
|
22
17
|
|
|
23
18
|
exports.SplitterResizeTrigger = SplitterResizeTrigger;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import { type
|
|
4
|
-
import {
|
|
5
|
-
type
|
|
6
|
-
export type SplitterResizeTriggerProps = Assign<
|
|
7
|
-
|
|
8
|
-
}, SplitterContext>;
|
|
9
|
-
export declare const SplitterResizeTrigger: (props: SplitterResizeTriggerProps) => ResolvedChildren;
|
|
1
|
+
import type { JSX } from 'solid-js';
|
|
2
|
+
import { connect } from '@zag-js/splitter';
|
|
3
|
+
import { type HTMLArkProps } from '../factory';
|
|
4
|
+
import type { Assign } from '../types';
|
|
5
|
+
type TriggerParams = Parameters<ReturnType<typeof connect>['getResizeTriggerProps']>[0];
|
|
6
|
+
export type SplitterResizeTriggerProps = Assign<HTMLArkProps<'button'>, TriggerParams>;
|
|
7
|
+
export declare const SplitterResizeTrigger: (props: SplitterResizeTriggerProps) => JSX.Element;
|
|
10
8
|
export {};
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { createComponent } from 'solid-js/web';
|
|
2
|
+
import { mergeProps } from '@zag-js/solid';
|
|
3
|
+
import { createSplitProps } from '../create-split-props.mjs';
|
|
4
|
+
import { ark } from '../factory.mjs';
|
|
4
5
|
import { useSplitterContext } from './splitter-context.mjs';
|
|
5
6
|
|
|
6
7
|
const SplitterResizeTrigger = props => {
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const children = getChildren();
|
|
12
|
-
if (children instanceof HTMLElement) {
|
|
13
|
-
spread(children, triggerProps);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
return getChildren();
|
|
8
|
+
const api = useSplitterContext();
|
|
9
|
+
const [triggerParams, restProps] = createSplitProps()(props, ['disabled', 'id', 'step']);
|
|
10
|
+
const triggerProps = mergeProps(() => api().getResizeTriggerProps(triggerParams), restProps);
|
|
11
|
+
return createComponent(ark.button, triggerProps);
|
|
17
12
|
};
|
|
18
13
|
|
|
19
14
|
export { SplitterResizeTrigger };
|
|
@@ -3,18 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
5
|
const web = require('solid-js/web');
|
|
6
|
+
const solid = require('@zag-js/solid');
|
|
6
7
|
const createSplitProps = require('../create-split-props.cjs');
|
|
7
8
|
const factory = require('../factory.cjs');
|
|
8
9
|
const splitterContext = require('./splitter-context.cjs');
|
|
9
10
|
const useSplitter = require('./use-splitter.cjs');
|
|
10
11
|
|
|
11
12
|
const Splitter = props => {
|
|
12
|
-
const [
|
|
13
|
-
const
|
|
13
|
+
const [splitterParams, divProps] = createSplitProps.createSplitProps()(props, ['dir', 'getRootNode', 'id', 'ids', 'onResize', 'onResizeEnd', 'onResizeStart', 'orientation', 'size']);
|
|
14
|
+
const api = useSplitter.useSplitter(splitterParams);
|
|
15
|
+
const rootProps = solid.mergeProps(() => api().rootProps, divProps);
|
|
14
16
|
return web.createComponent(splitterContext.SplitterProvider, {
|
|
15
|
-
value:
|
|
17
|
+
value: api,
|
|
16
18
|
get children() {
|
|
17
|
-
return web.createComponent(factory.ark.div,
|
|
19
|
+
return web.createComponent(factory.ark.div, rootProps);
|
|
18
20
|
}
|
|
19
21
|
});
|
|
20
22
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JSX } from 'solid-js';
|
|
2
|
-
import { type Assign } from '@polymorphic-factory/solid';
|
|
3
2
|
import { type HTMLArkProps } from '../factory';
|
|
3
|
+
import type { Assign } from '../types';
|
|
4
4
|
import { type UseSplitterProps } from './use-splitter';
|
|
5
5
|
export type SplitterProps = Assign<HTMLArkProps<'div'>, UseSplitterProps>;
|
|
6
6
|
export declare const Splitter: (props: SplitterProps) => JSX.Element;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { createComponent
|
|
1
|
+
import { createComponent } from 'solid-js/web';
|
|
2
|
+
import { mergeProps } from '@zag-js/solid';
|
|
2
3
|
import { createSplitProps } from '../create-split-props.mjs';
|
|
3
4
|
import { ark } from '../factory.mjs';
|
|
4
5
|
import { SplitterProvider } from './splitter-context.mjs';
|
|
5
6
|
import { useSplitter } from './use-splitter.mjs';
|
|
6
7
|
|
|
7
8
|
const Splitter = props => {
|
|
8
|
-
const [
|
|
9
|
-
const
|
|
9
|
+
const [splitterParams, divProps] = createSplitProps()(props, ['dir', 'getRootNode', 'id', 'ids', 'onResize', 'onResizeEnd', 'onResizeStart', 'orientation', 'size']);
|
|
10
|
+
const api = useSplitter(splitterParams);
|
|
11
|
+
const rootProps = mergeProps(() => api().rootProps, divProps);
|
|
10
12
|
return createComponent(SplitterProvider, {
|
|
11
|
-
value:
|
|
13
|
+
value: api,
|
|
12
14
|
get children() {
|
|
13
|
-
return createComponent(ark.div,
|
|
15
|
+
return createComponent(ark.div, rootProps);
|
|
14
16
|
}
|
|
15
17
|
});
|
|
16
18
|
};
|
|
@@ -9,7 +9,7 @@ const environmentContext = require('../environment/environment-context.cjs');
|
|
|
9
9
|
|
|
10
10
|
const useSplitter = (props) => {
|
|
11
11
|
const getRootNode = environmentContext.useEnvironmentContext();
|
|
12
|
-
const context =
|
|
12
|
+
const context = solid.mergeProps({ id: solidJs.createUniqueId(), getRootNode }, props);
|
|
13
13
|
const [state, send] = solid.useMachine(splitter.machine(context), { context });
|
|
14
14
|
return solidJs.createMemo(() => splitter.connect(state, send, solid.normalizeProps));
|
|
15
15
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useMachine, normalizeProps } from '@zag-js/solid';
|
|
1
|
+
import { mergeProps, useMachine, normalizeProps } from '@zag-js/solid';
|
|
2
2
|
import { machine, connect } from '@zag-js/splitter';
|
|
3
|
-
import {
|
|
3
|
+
import { createUniqueId, createMemo } from 'solid-js';
|
|
4
4
|
import { useEnvironmentContext } from '../environment/environment-context.mjs';
|
|
5
5
|
|
|
6
6
|
const useSplitter = (props) => {
|
package/dist/spread.cjs
CHANGED
|
@@ -2,24 +2,37 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
+
const solidJs = require('solid-js');
|
|
5
6
|
const web = require('solid-js/web');
|
|
6
|
-
const
|
|
7
|
+
const filterProps = require('./filter-props.cjs');
|
|
8
|
+
const mergeStyle = require('./merge-style.cjs');
|
|
7
9
|
|
|
8
10
|
const getEventKey = (key) => `$$${key.toLowerCase().slice(2)}`;
|
|
11
|
+
const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
|
|
9
12
|
const spread = (node, props) => {
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
events[prop](...args);
|
|
17
|
-
value(...args);
|
|
18
|
-
} : value;
|
|
19
|
-
return [key, newValue];
|
|
20
|
-
})
|
|
13
|
+
const parentProps = filterProps.filterProps(
|
|
14
|
+
props,
|
|
15
|
+
(key) => typeof key === "string" && key.slice(0, 2) === "on"
|
|
16
|
+
);
|
|
17
|
+
const nodeEvents = Object.fromEntries(
|
|
18
|
+
Object.keys(node).filter((prop) => prop.startsWith("$$")).map((prop) => [prop, node[prop]])
|
|
21
19
|
);
|
|
22
|
-
|
|
20
|
+
const composedProps = solidJs.createMemo(() => {
|
|
21
|
+
return filterProps.mapProps(parentProps, (key, value) => {
|
|
22
|
+
const prop = getEventKey(key);
|
|
23
|
+
if (hasOwn(nodeEvents, prop)) {
|
|
24
|
+
return function next(...args) {
|
|
25
|
+
value(...args);
|
|
26
|
+
nodeEvents[prop](...args);
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
if (key === "style") {
|
|
30
|
+
return mergeStyle.mergeStyle(node.style.cssText, value);
|
|
31
|
+
}
|
|
32
|
+
return value;
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
web.spread(node, solidJs.mergeProps(props, composedProps));
|
|
23
36
|
};
|
|
24
37
|
|
|
25
38
|
exports.spread = spread;
|
package/dist/spread.mjs
CHANGED
|
@@ -1,21 +1,34 @@
|
|
|
1
|
+
import { createMemo, mergeProps } from 'solid-js';
|
|
1
2
|
import { spread as spread$1 } from 'solid-js/web';
|
|
2
|
-
import {
|
|
3
|
+
import { filterProps, mapProps } from './filter-props.mjs';
|
|
4
|
+
import { mergeStyle } from './merge-style.mjs';
|
|
3
5
|
|
|
4
6
|
const getEventKey = (key) => `$$${key.toLowerCase().slice(2)}`;
|
|
7
|
+
const hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
|
|
5
8
|
const spread = (node, props) => {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
events[prop](...args);
|
|
13
|
-
value(...args);
|
|
14
|
-
} : value;
|
|
15
|
-
return [key, newValue];
|
|
16
|
-
})
|
|
9
|
+
const parentProps = filterProps(
|
|
10
|
+
props,
|
|
11
|
+
(key) => typeof key === "string" && key.slice(0, 2) === "on"
|
|
12
|
+
);
|
|
13
|
+
const nodeEvents = Object.fromEntries(
|
|
14
|
+
Object.keys(node).filter((prop) => prop.startsWith("$$")).map((prop) => [prop, node[prop]])
|
|
17
15
|
);
|
|
18
|
-
|
|
16
|
+
const composedProps = createMemo(() => {
|
|
17
|
+
return mapProps(parentProps, (key, value) => {
|
|
18
|
+
const prop = getEventKey(key);
|
|
19
|
+
if (hasOwn(nodeEvents, prop)) {
|
|
20
|
+
return function next(...args) {
|
|
21
|
+
value(...args);
|
|
22
|
+
nodeEvents[prop](...args);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (key === "style") {
|
|
26
|
+
return mergeStyle(node.style.cssText, value);
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
spread$1(node, mergeProps(props, composedProps));
|
|
19
32
|
};
|
|
20
33
|
|
|
21
34
|
export { spread };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Switch, type SwitchProps } from './switch';
|
|
2
|
+
export { SwitchControl, type SwitchControlProps } from './switch-control';
|
|
3
|
+
export { SwitchInput, type SwitchInputProps } from './switch-input';
|
|
4
|
+
export { SwitchLabel, type SwitchLabelProps } from './switch-label';
|
|
5
|
+
export { SwitchThumb, type SwitchThumbProps } from './switch-thumb';
|
|
6
|
+
export { switchAnatomy } from './switch.anatomy';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const createContext = require('../create-context.cjs');
|
|
6
|
+
|
|
7
|
+
const [SwitchProvider, useSwitchContext] = createContext.createContext({
|
|
8
|
+
hookName: "useSwitchContext",
|
|
9
|
+
providerName: "<SwitchProvider />"
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
exports.SwitchProvider = SwitchProvider;
|
|
13
|
+
exports.useSwitchContext = useSwitchContext;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Accessor, JSX } from 'solid-js';
|
|
2
|
+
import type { ContextProviderComponent } from 'solid-js/types/reactive/signal';
|
|
3
|
+
import { type UseSwitchReturn } from './use-switch';
|
|
4
|
+
export type SwitchContext = UseSwitchReturn;
|
|
5
|
+
export declare const SwitchProvider: ContextProviderComponent<Accessor<{
|
|
6
|
+
isChecked: boolean;
|
|
7
|
+
isDisabled: boolean | undefined;
|
|
8
|
+
isFocused: boolean | undefined;
|
|
9
|
+
setChecked(checked: boolean): void;
|
|
10
|
+
toggleChecked(): void;
|
|
11
|
+
rootProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;
|
|
12
|
+
labelProps: JSX.HTMLAttributes<any>;
|
|
13
|
+
thumbProps: JSX.HTMLAttributes<any>;
|
|
14
|
+
controlProps: JSX.HTMLAttributes<any>;
|
|
15
|
+
inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;
|
|
16
|
+
}>>, useSwitchContext: () => Accessor<{
|
|
17
|
+
isChecked: boolean;
|
|
18
|
+
isDisabled: boolean | undefined;
|
|
19
|
+
isFocused: boolean | undefined;
|
|
20
|
+
setChecked(checked: boolean): void;
|
|
21
|
+
toggleChecked(): void;
|
|
22
|
+
rootProps: JSX.LabelHTMLAttributes<HTMLLabelElement>;
|
|
23
|
+
labelProps: JSX.HTMLAttributes<any>;
|
|
24
|
+
thumbProps: JSX.HTMLAttributes<any>;
|
|
25
|
+
controlProps: JSX.HTMLAttributes<any>;
|
|
26
|
+
inputProps: JSX.InputHTMLAttributes<HTMLInputElement>;
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const web = require('solid-js/web');
|
|
6
|
+
const solid = require('@zag-js/solid');
|
|
7
|
+
const factory = require('../factory.cjs');
|
|
8
|
+
const switchContext = require('./switch-context.cjs');
|
|
9
|
+
|
|
10
|
+
const SwitchControl = props => {
|
|
11
|
+
const checkbox = switchContext.useSwitchContext();
|
|
12
|
+
const controlProps = solid.mergeProps(() => checkbox().controlProps, props);
|
|
13
|
+
return web.createComponent(factory.ark.span, controlProps);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.SwitchControl = SwitchControl;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createComponent } from 'solid-js/web';
|
|
2
|
+
import { mergeProps } from '@zag-js/solid';
|
|
3
|
+
import { ark } from '../factory.mjs';
|
|
4
|
+
import { useSwitchContext } from './switch-context.mjs';
|
|
5
|
+
|
|
6
|
+
const SwitchControl = props => {
|
|
7
|
+
const checkbox = useSwitchContext();
|
|
8
|
+
const controlProps = mergeProps(() => checkbox().controlProps, props);
|
|
9
|
+
return createComponent(ark.span, controlProps);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { SwitchControl };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const web = require('solid-js/web');
|
|
6
|
+
const solid = require('@zag-js/solid');
|
|
7
|
+
const factory = require('../factory.cjs');
|
|
8
|
+
const switchContext = require('./switch-context.cjs');
|
|
9
|
+
|
|
10
|
+
const SwitchInput = props => {
|
|
11
|
+
const checkbox = switchContext.useSwitchContext();
|
|
12
|
+
const inputProps = solid.mergeProps(() => checkbox().inputProps, props);
|
|
13
|
+
return web.createComponent(factory.ark.input, inputProps);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.SwitchInput = SwitchInput;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createComponent } from 'solid-js/web';
|
|
2
|
+
import { mergeProps } from '@zag-js/solid';
|
|
3
|
+
import { ark } from '../factory.mjs';
|
|
4
|
+
import { useSwitchContext } from './switch-context.mjs';
|
|
5
|
+
|
|
6
|
+
const SwitchInput = props => {
|
|
7
|
+
const checkbox = useSwitchContext();
|
|
8
|
+
const inputProps = mergeProps(() => checkbox().inputProps, props);
|
|
9
|
+
return createComponent(ark.input, inputProps);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { SwitchInput };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const web = require('solid-js/web');
|
|
6
|
+
const solid = require('@zag-js/solid');
|
|
7
|
+
const factory = require('../factory.cjs');
|
|
8
|
+
const switchContext = require('./switch-context.cjs');
|
|
9
|
+
|
|
10
|
+
const SwitchLabel = props => {
|
|
11
|
+
const checkbox = switchContext.useSwitchContext();
|
|
12
|
+
const labelProps = solid.mergeProps(() => checkbox().labelProps, props);
|
|
13
|
+
return web.createComponent(factory.ark.span, labelProps);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.SwitchLabel = SwitchLabel;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createComponent } from 'solid-js/web';
|
|
2
|
+
import { mergeProps } from '@zag-js/solid';
|
|
3
|
+
import { ark } from '../factory.mjs';
|
|
4
|
+
import { useSwitchContext } from './switch-context.mjs';
|
|
5
|
+
|
|
6
|
+
const SwitchLabel = props => {
|
|
7
|
+
const checkbox = useSwitchContext();
|
|
8
|
+
const labelProps = mergeProps(() => checkbox().labelProps, props);
|
|
9
|
+
return createComponent(ark.span, labelProps);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { SwitchLabel };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const web = require('solid-js/web');
|
|
6
|
+
const solid = require('@zag-js/solid');
|
|
7
|
+
const factory = require('../factory.cjs');
|
|
8
|
+
const switchContext = require('./switch-context.cjs');
|
|
9
|
+
|
|
10
|
+
const SwitchThumb = props => {
|
|
11
|
+
const checkbox = switchContext.useSwitchContext();
|
|
12
|
+
const thumbProps = solid.mergeProps(() => checkbox().thumbProps, props);
|
|
13
|
+
return web.createComponent(factory.ark.span, thumbProps);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
exports.SwitchThumb = SwitchThumb;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createComponent } from 'solid-js/web';
|
|
2
|
+
import { mergeProps } from '@zag-js/solid';
|
|
3
|
+
import { ark } from '../factory.mjs';
|
|
4
|
+
import { useSwitchContext } from './switch-context.mjs';
|
|
5
|
+
|
|
6
|
+
const SwitchThumb = props => {
|
|
7
|
+
const checkbox = useSwitchContext();
|
|
8
|
+
const thumbProps = mergeProps(() => checkbox().thumbProps, props);
|
|
9
|
+
return createComponent(ark.span, thumbProps);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { SwitchThumb };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { anatomy as switchAnatomy } from '@zag-js/switch';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const web = require('solid-js/web');
|
|
6
|
+
const solid = require('@zag-js/solid');
|
|
7
|
+
const createSplitProps = require('../create-split-props.cjs');
|
|
8
|
+
const factory = require('../factory.cjs');
|
|
9
|
+
const runIfFn = require('../run-if-fn.cjs');
|
|
10
|
+
const switchContext = require('./switch-context.cjs');
|
|
11
|
+
const useSwitch = require('./use-switch.cjs');
|
|
12
|
+
|
|
13
|
+
const Switch = props => {
|
|
14
|
+
const [switchProps, labelProps] = createSplitProps.createSplitProps()(props, ['checked', 'dir', 'disabled', 'focusable', 'form', 'getRootNode', 'id', 'ids', 'invalid', 'label', 'name', 'onChange', 'readOnly', 'required', 'value']);
|
|
15
|
+
const api = useSwitch.useSwitch(switchProps);
|
|
16
|
+
const rootProps = solid.mergeProps(() => api().rootProps, labelProps);
|
|
17
|
+
const getChildren = () => runIfFn.runIfFn(props.children, api);
|
|
18
|
+
return web.createComponent(switchContext.SwitchProvider, {
|
|
19
|
+
value: api,
|
|
20
|
+
get children() {
|
|
21
|
+
return web.createComponent(factory.ark.label, web.mergeProps(rootProps, {
|
|
22
|
+
get children() {
|
|
23
|
+
return getChildren();
|
|
24
|
+
}
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.Switch = Switch;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { JSX } from 'solid-js';
|
|
2
|
+
import { type HTMLArkProps } from '../factory';
|
|
3
|
+
import type { Assign } from '../types';
|
|
4
|
+
import { type SwitchContext } from './switch-context';
|
|
5
|
+
import { type UseSwitchProps } from './use-switch';
|
|
6
|
+
export type SwitchProps = Assign<HTMLArkProps<'label'>, UseSwitchProps & {
|
|
7
|
+
children?: JSX.Element | ((context: SwitchContext) => JSX.Element);
|
|
8
|
+
}>;
|
|
9
|
+
export declare const Switch: (props: SwitchProps) => JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createComponent, mergeProps as mergeProps$1 } from 'solid-js/web';
|
|
2
|
+
import { mergeProps } from '@zag-js/solid';
|
|
3
|
+
import { createSplitProps } from '../create-split-props.mjs';
|
|
4
|
+
import { ark } from '../factory.mjs';
|
|
5
|
+
import { runIfFn } from '../run-if-fn.mjs';
|
|
6
|
+
import { SwitchProvider } from './switch-context.mjs';
|
|
7
|
+
import { useSwitch } from './use-switch.mjs';
|
|
8
|
+
|
|
9
|
+
const Switch = props => {
|
|
10
|
+
const [switchProps, labelProps] = createSplitProps()(props, ['checked', 'dir', 'disabled', 'focusable', 'form', 'getRootNode', 'id', 'ids', 'invalid', 'label', 'name', 'onChange', 'readOnly', 'required', 'value']);
|
|
11
|
+
const api = useSwitch(switchProps);
|
|
12
|
+
const rootProps = mergeProps(() => api().rootProps, labelProps);
|
|
13
|
+
const getChildren = () => runIfFn(props.children, api);
|
|
14
|
+
return createComponent(SwitchProvider, {
|
|
15
|
+
value: api,
|
|
16
|
+
get children() {
|
|
17
|
+
return createComponent(ark.label, mergeProps$1(rootProps, {
|
|
18
|
+
get children() {
|
|
19
|
+
return getChildren();
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { Switch };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const solid = require('@zag-js/solid');
|
|
6
|
+
const zagSwitch = require('@zag-js/switch');
|
|
7
|
+
const solidJs = require('solid-js');
|
|
8
|
+
const environmentContext = require('../environment/environment-context.cjs');
|
|
9
|
+
|
|
10
|
+
function _interopNamespaceDefault(e) {
|
|
11
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
12
|
+
if (e) {
|
|
13
|
+
for (const k in e) {
|
|
14
|
+
if (k !== 'default') {
|
|
15
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: () => e[k]
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
n.default = e;
|
|
24
|
+
return Object.freeze(n);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const zagSwitch__namespace = /*#__PURE__*/_interopNamespaceDefault(zagSwitch);
|
|
28
|
+
|
|
29
|
+
const useSwitch = (props) => {
|
|
30
|
+
const getRootNode = environmentContext.useEnvironmentContext();
|
|
31
|
+
const context = solid.mergeProps({ id: solidJs.createUniqueId(), getRootNode }, props);
|
|
32
|
+
const [state, send] = solid.useMachine(zagSwitch__namespace.machine(context), { context });
|
|
33
|
+
return solidJs.createMemo(() => zagSwitch__namespace.connect(state, send, solid.normalizeProps));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.useSwitch = useSwitch;
|