@ark-ui/solid 3.3.0 → 3.4.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/README.md +1 -7
- package/dist/cjs/index.js +533 -1733
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +507 -1723
- package/dist/esm/index.js.map +1 -1
- package/dist/source/components/accordion/accordion.js +2 -2
- package/dist/source/components/accordion/index.js +7 -7
- package/dist/source/components/avatar/avatar.js +2 -2
- package/dist/source/components/avatar/index.js +5 -5
- package/dist/source/components/carousel/carousel.js +2 -2
- package/dist/source/components/carousel/index.js +10 -10
- package/dist/source/components/checkbox/checkbox-group.jsx +2 -1
- package/dist/source/components/checkbox/checkbox-hidden-input.jsx +3 -1
- package/dist/source/components/checkbox/checkbox.js +3 -3
- package/dist/source/components/checkbox/index.js +8 -8
- package/dist/source/components/checkbox/use-checkbox-group.js +2 -0
- package/dist/source/components/checkbox/use-checkbox.js +10 -0
- package/dist/source/components/clipboard/clipboard.js +3 -3
- package/dist/source/components/clipboard/index.js +8 -8
- package/dist/source/components/collapsible/collapsible.js +1 -1
- package/dist/source/components/collapsible/index.js +4 -4
- package/dist/source/components/color-picker/color-picker-channel-slider-label.jsx +10 -0
- package/dist/source/components/color-picker/color-picker-channel-slider-thumb.jsx +4 -1
- package/dist/source/components/color-picker/color-picker-channel-slider-track.jsx +4 -1
- package/dist/source/components/color-picker/color-picker-channel-slider-value-text.jsx +15 -0
- package/dist/source/components/color-picker/color-picker-channel-slider.jsx +4 -1
- package/dist/source/components/color-picker/color-picker-hidden-input.jsx +3 -1
- package/dist/source/components/color-picker/color-picker-root.jsx +1 -0
- package/dist/source/components/color-picker/color-picker-value-swatch.jsx +20 -0
- package/dist/source/components/color-picker/color-picker-view.jsx +9 -4
- package/dist/source/components/color-picker/color-picker.js +5 -1
- package/dist/source/components/color-picker/index.js +15 -12
- package/dist/source/components/color-picker/use-color-picker-format-context.js +6 -0
- package/dist/source/components/color-picker/use-color-picker.js +9 -0
- package/dist/source/components/combobox/combobox-input.jsx +3 -1
- package/dist/source/components/combobox/combobox-root.jsx +1 -0
- package/dist/source/components/combobox/combobox.js +5 -5
- package/dist/source/components/combobox/index.js +16 -16
- package/dist/source/components/combobox/use-combobox.js +11 -1
- package/dist/source/components/date-picker/date-picker-month-select.jsx +4 -3
- package/dist/source/components/date-picker/date-picker-year-select.jsx +4 -1
- package/dist/source/components/date-picker/date-picker.js +2 -2
- package/dist/source/components/date-picker/index.js +22 -22
- package/dist/source/components/dialog/dialog.js +4 -4
- package/dist/source/components/dialog/index.js +10 -10
- package/dist/source/components/editable/editable-input.jsx +3 -1
- package/dist/source/components/editable/editable-root.jsx +1 -0
- package/dist/source/components/editable/editable.js +4 -4
- package/dist/source/components/editable/index.js +11 -11
- package/dist/source/components/editable/use-editable.js +10 -0
- package/dist/source/components/field/field-context.jsx +2 -0
- package/dist/source/components/field/field-error-text.jsx +11 -0
- package/dist/source/components/field/field-helper-text.jsx +8 -0
- package/dist/source/components/field/field-input.jsx +8 -0
- package/dist/source/components/field/field-label.jsx +8 -0
- package/dist/source/components/field/field-root-provider.jsx +11 -0
- package/dist/source/components/field/field-root.jsx +19 -0
- package/dist/source/components/field/field-select.jsx +8 -0
- package/dist/source/components/field/field-textarea.jsx +8 -0
- package/dist/source/components/field/field.js +9 -0
- package/dist/source/components/field/index.js +11 -0
- package/dist/source/components/field/use-field-context.js +6 -0
- package/dist/source/components/field/use-field.js +105 -0
- package/dist/source/components/file-upload/file-upload-hidden-input.jsx +3 -1
- package/dist/source/components/file-upload/file-upload-root.jsx +1 -0
- package/dist/source/components/file-upload/file-upload.js +2 -2
- package/dist/source/components/file-upload/index.js +10 -10
- package/dist/source/components/file-upload/use-file-upload.js +8 -0
- package/dist/source/components/format/format.js +2 -2
- package/dist/source/components/format/index.js +2 -2
- package/dist/source/components/hover-card/hover-card.js +2 -2
- package/dist/source/components/hover-card/index.js +8 -8
- package/dist/source/components/index.js +1 -0
- package/dist/source/components/menu/index.js +21 -21
- package/dist/source/components/menu/menu-checkbox-item.jsx +2 -2
- package/dist/source/components/menu/menu-radio-item.jsx +2 -2
- package/dist/source/components/menu/menu.js +7 -7
- package/dist/source/components/number-input/index.js +6 -6
- package/dist/source/components/number-input/number-input-input.jsx +3 -1
- package/dist/source/components/number-input/number-input-root.jsx +1 -0
- package/dist/source/components/number-input/number-input.js +1 -0
- package/dist/source/components/number-input/use-number-input.js +10 -0
- package/dist/source/components/pagination/index.js +6 -6
- package/dist/source/components/pagination/pagination.js +2 -2
- package/dist/source/components/pin-input/index.js +7 -7
- package/dist/source/components/pin-input/pin-input-hidden-input.jsx +3 -1
- package/dist/source/components/pin-input/pin-input-root.jsx +2 -0
- package/dist/source/components/pin-input/pin-input.js +3 -3
- package/dist/source/components/pin-input/use-pin-input.js +10 -0
- package/dist/source/components/popover/index.js +13 -13
- package/dist/source/components/popover/popover.js +4 -4
- package/dist/source/components/progress/index.js +11 -11
- package/dist/source/components/progress/progress.js +5 -5
- package/dist/source/components/qr-code/index.js +6 -6
- package/dist/source/components/qr-code/qr-code.js +2 -2
- package/dist/source/components/radio-group/index.js +8 -8
- package/dist/source/components/radio-group/radio-group.js +2 -2
- package/dist/source/components/rating-group/index.js +5 -5
- package/dist/source/components/rating-group/rating-group-hidden-input.jsx +3 -1
- package/dist/source/components/rating-group/rating-group-root.jsx +1 -0
- package/dist/source/components/rating-group/rating-group.js +1 -0
- package/dist/source/components/rating-group/use-rating-group.js +9 -0
- package/dist/source/components/segment-group/index.js +6 -6
- package/dist/source/components/segment-group/segment-group.js +1 -0
- package/dist/source/components/select/index.js +19 -19
- package/dist/source/components/select/select-hidden-select.jsx +4 -2
- package/dist/source/components/select/select-root.jsx +1 -0
- package/dist/source/components/select/select.js +7 -7
- package/dist/source/components/select/use-select.js +11 -1
- package/dist/source/components/signature-pad/index.js +7 -6
- package/dist/source/components/signature-pad/signature-pad-control.jsx +1 -1
- package/dist/source/components/signature-pad/signature-pad-hidden-input.jsx +12 -0
- package/dist/source/components/signature-pad/signature-pad-root.jsx +3 -0
- package/dist/source/components/signature-pad/signature-pad.js +1 -0
- package/dist/source/components/signature-pad/use-signature-pad.js +9 -0
- package/dist/source/components/slider/index.js +12 -12
- package/dist/source/components/slider/slider.js +7 -7
- package/dist/source/components/splitter/index.js +5 -5
- package/dist/source/components/splitter/splitter.js +2 -2
- package/dist/source/components/switch/index.js +7 -7
- package/dist/source/components/switch/switch-hidden-input.jsx +3 -1
- package/dist/source/components/switch/switch.js +4 -4
- package/dist/source/components/switch/use-switch.js +10 -0
- package/dist/source/components/tabs/index.js +7 -7
- package/dist/source/components/tabs/tabs.js +4 -4
- package/dist/source/components/tags-input/index.js +13 -13
- package/dist/source/components/tags-input/tags-input-hidden-input.jsx +3 -1
- package/dist/source/components/tags-input/tags-input-root.jsx +1 -0
- package/dist/source/components/tags-input/tags-input.js +4 -4
- package/dist/source/components/tags-input/use-tags-input.js +10 -0
- package/dist/source/components/toast/index.js +8 -8
- package/dist/source/components/toast/toast.js +6 -7
- package/dist/source/components/toggle-group/index.js +3 -3
- package/dist/source/components/toggle-group/toggle-group.js +1 -0
- package/dist/source/components/tooltip/index.js +8 -8
- package/dist/source/components/tooltip/tooltip-root.jsx +1 -0
- package/dist/source/components/tooltip/tooltip.js +2 -2
- package/dist/source/components/tree-view/index.js +14 -14
- package/dist/source/components/tree-view/tree-view.js +4 -4
- package/dist/types/components/accordion/accordion-item-content.d.ts +4 -2
- package/dist/types/components/accordion/accordion-item-indicator.d.ts +4 -2
- package/dist/types/components/accordion/accordion-item-trigger.d.ts +4 -2
- package/dist/types/components/accordion/accordion-item.d.ts +4 -3
- package/dist/types/components/accordion/accordion-root-provider.d.ts +4 -2
- package/dist/types/components/accordion/accordion-root.d.ts +4 -3
- package/dist/types/components/accordion/accordion.d.ts +6 -6
- package/dist/types/components/accordion/index.d.ts +8 -8
- package/dist/types/components/avatar/avatar-fallback.d.ts +4 -2
- package/dist/types/components/avatar/avatar-image.d.ts +4 -2
- package/dist/types/components/avatar/avatar-root-provider.d.ts +4 -2
- package/dist/types/components/avatar/avatar-root.d.ts +4 -3
- package/dist/types/components/avatar/avatar.d.ts +4 -4
- package/dist/types/components/avatar/index.d.ts +5 -5
- package/dist/types/components/carousel/carousel-control.d.ts +4 -2
- package/dist/types/components/carousel/carousel-indicator-group.d.ts +4 -2
- package/dist/types/components/carousel/carousel-indicator.d.ts +4 -3
- package/dist/types/components/carousel/carousel-item-group.d.ts +4 -2
- package/dist/types/components/carousel/carousel-item.d.ts +4 -3
- package/dist/types/components/carousel/carousel-next-trigger.d.ts +4 -2
- package/dist/types/components/carousel/carousel-prev-trigger.d.ts +4 -2
- package/dist/types/components/carousel/carousel-root-provider.d.ts +4 -2
- package/dist/types/components/carousel/carousel-root.d.ts +4 -3
- package/dist/types/components/carousel/carousel-viewport.d.ts +4 -2
- package/dist/types/components/carousel/carousel.d.ts +10 -10
- package/dist/types/components/carousel/index.d.ts +11 -11
- package/dist/types/components/checkbox/checkbox-control.d.ts +4 -2
- package/dist/types/components/checkbox/checkbox-group.d.ts +4 -3
- package/dist/types/components/checkbox/checkbox-hidden-input.d.ts +4 -2
- package/dist/types/components/checkbox/checkbox-indicator.d.ts +4 -3
- package/dist/types/components/checkbox/checkbox-label.d.ts +4 -2
- package/dist/types/components/checkbox/checkbox-root-provider.d.ts +4 -2
- package/dist/types/components/checkbox/checkbox-root.d.ts +4 -3
- package/dist/types/components/checkbox/checkbox.d.ts +7 -7
- package/dist/types/components/checkbox/index.d.ts +8 -8
- package/dist/types/components/checkbox/use-checkbox-group.d.ts +7 -0
- package/dist/types/components/clipboard/clipboard-control.d.ts +4 -2
- package/dist/types/components/clipboard/clipboard-indicator.d.ts +4 -3
- package/dist/types/components/clipboard/clipboard-input.d.ts +4 -2
- package/dist/types/components/clipboard/clipboard-label.d.ts +4 -2
- package/dist/types/components/clipboard/clipboard-root-provider.d.ts +4 -2
- package/dist/types/components/clipboard/clipboard-root.d.ts +4 -3
- package/dist/types/components/clipboard/clipboard-trigger.d.ts +4 -2
- package/dist/types/components/clipboard/clipboard.d.ts +7 -7
- package/dist/types/components/clipboard/index.d.ts +8 -8
- package/dist/types/components/collapsible/collapsible-content.d.ts +4 -2
- package/dist/types/components/collapsible/collapsible-root-provider.d.ts +4 -2
- package/dist/types/components/collapsible/collapsible-root.d.ts +4 -3
- package/dist/types/components/collapsible/collapsible-trigger.d.ts +4 -2
- package/dist/types/components/collapsible/collapsible.d.ts +4 -4
- package/dist/types/components/collapsible/index.d.ts +5 -5
- package/dist/types/components/color-picker/color-picker-area-background.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-area-thumb.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-area.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker-channel-input.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker-channel-slider-label.d.ts +6 -0
- package/dist/types/components/color-picker/color-picker-channel-slider-thumb.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-channel-slider-track.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-channel-slider-value-text.d.ts +6 -0
- package/dist/types/components/color-picker/color-picker-channel-slider.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker-content.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-control.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-eye-dropper-trigger.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-format-select.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-format-trigger.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-hidden-input.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-label.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-positioner.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-root-provider.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-root.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker-swatch-group.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-swatch-indicator.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-swatch-trigger.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-swatch.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker-transparency-grid.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker-trigger.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-value-swatch.d.ts +10 -0
- package/dist/types/components/color-picker/color-picker-value-text.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-view.d.ts +7 -2
- package/dist/types/components/color-picker/color-picker.d.ts +28 -24
- package/dist/types/components/color-picker/index.d.ts +29 -26
- package/dist/types/components/color-picker/use-color-picker-format-context.d.ts +5 -0
- package/dist/types/components/combobox/combobox-clear-trigger.d.ts +4 -2
- package/dist/types/components/combobox/combobox-content.d.ts +4 -2
- package/dist/types/components/combobox/combobox-control.d.ts +4 -2
- package/dist/types/components/combobox/combobox-input.d.ts +4 -2
- package/dist/types/components/combobox/combobox-item-group-label.d.ts +4 -2
- package/dist/types/components/combobox/combobox-item-group.d.ts +4 -2
- package/dist/types/components/combobox/combobox-item-indicator.d.ts +4 -2
- package/dist/types/components/combobox/combobox-item-text.d.ts +4 -2
- package/dist/types/components/combobox/combobox-item.d.ts +4 -3
- package/dist/types/components/combobox/combobox-label.d.ts +4 -2
- package/dist/types/components/combobox/combobox-list.d.ts +4 -2
- package/dist/types/components/combobox/combobox-positioner.d.ts +4 -2
- package/dist/types/components/combobox/combobox-root-provider.d.ts +4 -2
- package/dist/types/components/combobox/combobox-root.d.ts +5 -3
- package/dist/types/components/combobox/combobox-trigger.d.ts +4 -3
- package/dist/types/components/combobox/combobox.d.ts +15 -15
- package/dist/types/components/combobox/index.d.ts +17 -17
- package/dist/types/components/date-picker/date-picker-clear-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-content.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-control.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-input.d.ts +4 -3
- package/dist/types/components/date-picker/date-picker-label.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-month-select.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-next-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-positioner.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-preset-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-prev-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-range-text.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-root-provider.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-root.d.ts +4 -3
- package/dist/types/components/date-picker/date-picker-table-body.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-table-cell-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-table-cell.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-table-head.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-table-header.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-table-row.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-table.d.ts +4 -3
- package/dist/types/components/date-picker/date-picker-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-view-control.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-view-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-view.d.ts +4 -3
- package/dist/types/components/date-picker/date-picker-year-select.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker.d.ts +25 -25
- package/dist/types/components/date-picker/index.d.ts +26 -26
- package/dist/types/components/dialog/dialog-backdrop.d.ts +4 -2
- package/dist/types/components/dialog/dialog-close-trigger.d.ts +4 -2
- package/dist/types/components/dialog/dialog-content.d.ts +4 -2
- package/dist/types/components/dialog/dialog-description.d.ts +4 -2
- package/dist/types/components/dialog/dialog-positioner.d.ts +4 -2
- package/dist/types/components/dialog/dialog-root-provider.d.ts +4 -2
- package/dist/types/components/dialog/dialog-root.d.ts +2 -0
- package/dist/types/components/dialog/dialog-title.d.ts +4 -2
- package/dist/types/components/dialog/dialog-trigger.d.ts +4 -2
- package/dist/types/components/dialog/dialog.d.ts +9 -9
- package/dist/types/components/dialog/index.d.ts +10 -10
- package/dist/types/components/editable/editable-area.d.ts +4 -2
- package/dist/types/components/editable/editable-cancel-trigger.d.ts +4 -2
- package/dist/types/components/editable/editable-control.d.ts +4 -2
- package/dist/types/components/editable/editable-edit-trigger.d.ts +4 -2
- package/dist/types/components/editable/editable-input.d.ts +4 -2
- package/dist/types/components/editable/editable-label.d.ts +4 -2
- package/dist/types/components/editable/editable-preview.d.ts +4 -2
- package/dist/types/components/editable/editable-root-provider.d.ts +4 -2
- package/dist/types/components/editable/editable-root.d.ts +4 -3
- package/dist/types/components/editable/editable-submit-trigger.d.ts +4 -2
- package/dist/types/components/editable/editable.d.ts +10 -10
- package/dist/types/components/editable/index.d.ts +11 -11
- package/dist/types/components/factory.d.ts +7 -3
- package/dist/types/components/field/field-context.d.ts +6 -0
- package/dist/types/components/field/field-error-text.d.ts +6 -0
- package/dist/types/components/field/field-helper-text.d.ts +6 -0
- package/dist/types/components/field/field-input.d.ts +6 -0
- package/dist/types/components/field/field-label.d.ts +6 -0
- package/dist/types/components/field/field-root-provider.d.ts +11 -0
- package/dist/types/components/field/field-root.d.ts +7 -0
- package/dist/types/components/field/field-select.d.ts +6 -0
- package/dist/types/components/field/field-textarea.d.ts +6 -0
- package/dist/types/components/field/field.d.ts +9 -0
- package/dist/types/components/field/index.d.ts +11 -0
- package/dist/types/components/field/use-field-context.d.ts +4 -0
- package/dist/types/components/field/use-field.d.ts +102 -0
- package/dist/types/components/file-upload/file-upload-dropzone.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-hidden-input.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item-delete-trigger.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item-group.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item-name.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item-preview-image.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item-preview.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item-size-text.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item.d.ts +4 -3
- package/dist/types/components/file-upload/file-upload-label.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-root-provider.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-root.d.ts +4 -3
- package/dist/types/components/file-upload/file-upload-trigger.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload.d.ts +13 -13
- package/dist/types/components/file-upload/index.d.ts +14 -14
- package/dist/types/components/format/format.d.ts +2 -2
- package/dist/types/components/format/index.d.ts +2 -2
- package/dist/types/components/hover-card/hover-card-arrow-tip.d.ts +4 -2
- package/dist/types/components/hover-card/hover-card-arrow.d.ts +4 -2
- package/dist/types/components/hover-card/hover-card-content.d.ts +4 -2
- package/dist/types/components/hover-card/hover-card-positioner.d.ts +4 -2
- package/dist/types/components/hover-card/hover-card-root-provider.d.ts +4 -2
- package/dist/types/components/hover-card/hover-card-root.d.ts +3 -1
- package/dist/types/components/hover-card/hover-card-trigger.d.ts +4 -2
- package/dist/types/components/hover-card/hover-card.d.ts +7 -7
- package/dist/types/components/hover-card/index.d.ts +8 -8
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/menu/index.d.ts +21 -21
- package/dist/types/components/menu/menu-arrow-tip.d.ts +4 -2
- package/dist/types/components/menu/menu-arrow.d.ts +4 -2
- package/dist/types/components/menu/menu-checkbox-item.d.ts +4 -3
- package/dist/types/components/menu/menu-content.d.ts +4 -2
- package/dist/types/components/menu/menu-context-trigger.d.ts +4 -2
- package/dist/types/components/menu/menu-indicator.d.ts +4 -2
- package/dist/types/components/menu/menu-item-group-label.d.ts +4 -2
- package/dist/types/components/menu/menu-item-group.d.ts +5 -3
- package/dist/types/components/menu/menu-item-indicator.d.ts +4 -2
- package/dist/types/components/menu/menu-item-text.d.ts +4 -2
- package/dist/types/components/menu/menu-item.d.ts +4 -3
- package/dist/types/components/menu/menu-positioner.d.ts +4 -2
- package/dist/types/components/menu/menu-radio-item-group.d.ts +5 -3
- package/dist/types/components/menu/menu-radio-item.d.ts +4 -3
- package/dist/types/components/menu/menu-root-provider.d.ts +4 -2
- package/dist/types/components/menu/menu-root.d.ts +3 -1
- package/dist/types/components/menu/menu-separator.d.ts +4 -2
- package/dist/types/components/menu/menu-trigger-item.d.ts +4 -2
- package/dist/types/components/menu/menu-trigger.d.ts +4 -2
- package/dist/types/components/menu/menu.d.ts +19 -19
- package/dist/types/components/number-input/index.d.ts +9 -9
- package/dist/types/components/number-input/number-input-control.d.ts +4 -2
- package/dist/types/components/number-input/number-input-decrement-trigger.d.ts +4 -2
- package/dist/types/components/number-input/number-input-increment-trigger.d.ts +4 -2
- package/dist/types/components/number-input/number-input-input.d.ts +4 -2
- package/dist/types/components/number-input/number-input-label.d.ts +4 -2
- package/dist/types/components/number-input/number-input-root-provider.d.ts +4 -2
- package/dist/types/components/number-input/number-input-root.d.ts +4 -2
- package/dist/types/components/number-input/number-input-scrubber.d.ts +4 -2
- package/dist/types/components/number-input/number-input.d.ts +8 -7
- package/dist/types/components/pagination/index.d.ts +7 -7
- package/dist/types/components/pagination/pagination-ellipsis.d.ts +4 -3
- package/dist/types/components/pagination/pagination-item.d.ts +4 -2
- package/dist/types/components/pagination/pagination-next-trigger.d.ts +4 -2
- package/dist/types/components/pagination/pagination-prev-trigger.d.ts +4 -2
- package/dist/types/components/pagination/pagination-root-provider.d.ts +4 -2
- package/dist/types/components/pagination/pagination-root.d.ts +4 -3
- package/dist/types/components/pagination/pagination.d.ts +6 -6
- package/dist/types/components/pin-input/index.d.ts +7 -7
- package/dist/types/components/pin-input/pin-input-control.d.ts +4 -2
- package/dist/types/components/pin-input/pin-input-hidden-input.d.ts +4 -2
- package/dist/types/components/pin-input/pin-input-input.d.ts +4 -3
- package/dist/types/components/pin-input/pin-input-label.d.ts +4 -2
- package/dist/types/components/pin-input/pin-input-root-provider.d.ts +4 -2
- package/dist/types/components/pin-input/pin-input-root.d.ts +4 -3
- package/dist/types/components/pin-input/pin-input.d.ts +6 -6
- package/dist/types/components/popover/index.d.ts +13 -13
- package/dist/types/components/popover/popover-anchor.d.ts +4 -2
- package/dist/types/components/popover/popover-arrow-tip.d.ts +4 -2
- package/dist/types/components/popover/popover-arrow.d.ts +4 -2
- package/dist/types/components/popover/popover-close-trigger.d.ts +4 -2
- package/dist/types/components/popover/popover-content.d.ts +4 -2
- package/dist/types/components/popover/popover-description.d.ts +4 -2
- package/dist/types/components/popover/popover-indicator.d.ts +4 -2
- package/dist/types/components/popover/popover-positioner.d.ts +4 -2
- package/dist/types/components/popover/popover-root-provider.d.ts +4 -2
- package/dist/types/components/popover/popover-root.d.ts +3 -1
- package/dist/types/components/popover/popover-title.d.ts +4 -2
- package/dist/types/components/popover/popover-trigger.d.ts +4 -2
- package/dist/types/components/popover/popover.d.ts +12 -12
- package/dist/types/components/presence/presence.d.ts +4 -3
- package/dist/types/components/progress/index.d.ts +11 -11
- package/dist/types/components/progress/progress-circle-range.d.ts +4 -2
- package/dist/types/components/progress/progress-circle-track.d.ts +4 -2
- package/dist/types/components/progress/progress-circle.d.ts +4 -2
- package/dist/types/components/progress/progress-label.d.ts +4 -2
- package/dist/types/components/progress/progress-range.d.ts +4 -2
- package/dist/types/components/progress/progress-root-provider.d.ts +4 -2
- package/dist/types/components/progress/progress-root.d.ts +4 -3
- package/dist/types/components/progress/progress-track.d.ts +4 -2
- package/dist/types/components/progress/progress-value-text.d.ts +4 -2
- package/dist/types/components/progress/progress-view.d.ts +4 -3
- package/dist/types/components/progress/progress.d.ts +10 -10
- package/dist/types/components/qr-code/index.d.ts +6 -6
- package/dist/types/components/qr-code/qr-code-frame.d.ts +4 -2
- package/dist/types/components/qr-code/qr-code-overlay.d.ts +4 -2
- package/dist/types/components/qr-code/qr-code-pattern.d.ts +4 -2
- package/dist/types/components/qr-code/qr-code-root-provider.d.ts +4 -2
- package/dist/types/components/qr-code/qr-code-root.d.ts +4 -3
- package/dist/types/components/qr-code/qr-code.d.ts +5 -5
- package/dist/types/components/radio-group/index.d.ts +10 -10
- package/dist/types/components/radio-group/radio-group-indicator.d.ts +4 -2
- package/dist/types/components/radio-group/radio-group-item-control.d.ts +4 -2
- package/dist/types/components/radio-group/radio-group-item-hidden-input.d.ts +4 -2
- package/dist/types/components/radio-group/radio-group-item-text.d.ts +4 -2
- package/dist/types/components/radio-group/radio-group-item.d.ts +4 -3
- package/dist/types/components/radio-group/radio-group-label.d.ts +4 -2
- package/dist/types/components/radio-group/radio-group-root-provider.d.ts +4 -2
- package/dist/types/components/radio-group/radio-group-root.d.ts +4 -3
- package/dist/types/components/radio-group/radio-group.d.ts +8 -8
- package/dist/types/components/rating-group/index.d.ts +7 -7
- package/dist/types/components/rating-group/rating-group-control.d.ts +4 -2
- package/dist/types/components/rating-group/rating-group-hidden-input.d.ts +4 -2
- package/dist/types/components/rating-group/rating-group-item.d.ts +4 -3
- package/dist/types/components/rating-group/rating-group-label.d.ts +4 -2
- package/dist/types/components/rating-group/rating-group-root-provider.d.ts +4 -2
- package/dist/types/components/rating-group/rating-group-root.d.ts +4 -3
- package/dist/types/components/rating-group/rating-group.d.ts +6 -5
- package/dist/types/components/segment-group/index.d.ts +9 -9
- package/dist/types/components/segment-group/segment-group-indicator.d.ts +4 -2
- package/dist/types/components/segment-group/segment-group-item-control.d.ts +4 -2
- package/dist/types/components/segment-group/segment-group-item-hidden-input.d.ts +4 -2
- package/dist/types/components/segment-group/segment-group-item-text.d.ts +4 -2
- package/dist/types/components/segment-group/segment-group-item.d.ts +4 -3
- package/dist/types/components/segment-group/segment-group-label.d.ts +4 -2
- package/dist/types/components/segment-group/segment-group-root-provider.d.ts +4 -2
- package/dist/types/components/segment-group/segment-group-root.d.ts +4 -3
- package/dist/types/components/segment-group/segment-group.d.ts +8 -7
- package/dist/types/components/select/index.d.ts +19 -19
- package/dist/types/components/select/select-clear-trigger.d.ts +4 -2
- package/dist/types/components/select/select-content.d.ts +4 -2
- package/dist/types/components/select/select-control.d.ts +4 -2
- package/dist/types/components/select/select-hidden-select.d.ts +4 -2
- package/dist/types/components/select/select-indicator.d.ts +4 -2
- package/dist/types/components/select/select-item-group-label.d.ts +4 -2
- package/dist/types/components/select/select-item-group.d.ts +4 -2
- package/dist/types/components/select/select-item-indicator.d.ts +4 -2
- package/dist/types/components/select/select-item-text.d.ts +4 -2
- package/dist/types/components/select/select-item.d.ts +4 -3
- package/dist/types/components/select/select-label.d.ts +4 -2
- package/dist/types/components/select/select-list.d.ts +4 -2
- package/dist/types/components/select/select-positioner.d.ts +4 -2
- package/dist/types/components/select/select-root-provider.d.ts +4 -2
- package/dist/types/components/select/select-root.d.ts +5 -3
- package/dist/types/components/select/select-trigger.d.ts +4 -2
- package/dist/types/components/select/select-value-text.d.ts +7 -2
- package/dist/types/components/select/select.d.ts +17 -17
- package/dist/types/components/signature-pad/index.d.ts +9 -8
- package/dist/types/components/signature-pad/signature-pad-clear-trigger.d.ts +4 -2
- package/dist/types/components/signature-pad/signature-pad-control.d.ts +4 -2
- package/dist/types/components/signature-pad/signature-pad-guide.d.ts +4 -2
- package/dist/types/components/signature-pad/signature-pad-hidden-input.d.ts +8 -0
- package/dist/types/components/signature-pad/signature-pad-label.d.ts +4 -2
- package/dist/types/components/signature-pad/signature-pad-root-provider.d.ts +4 -2
- package/dist/types/components/signature-pad/signature-pad-root.d.ts +4 -3
- package/dist/types/components/signature-pad/signature-pad-segment.d.ts +4 -2
- package/dist/types/components/signature-pad/signature-pad.d.ts +8 -7
- package/dist/types/components/slider/index.d.ts +12 -12
- package/dist/types/components/slider/slider-control.d.ts +4 -2
- package/dist/types/components/slider/slider-hidden-input.d.ts +4 -2
- package/dist/types/components/slider/slider-label.d.ts +4 -2
- package/dist/types/components/slider/slider-marker-group.d.ts +4 -2
- package/dist/types/components/slider/slider-marker.d.ts +4 -3
- package/dist/types/components/slider/slider-range.d.ts +4 -2
- package/dist/types/components/slider/slider-root-provider.d.ts +4 -2
- package/dist/types/components/slider/slider-root.d.ts +4 -2
- package/dist/types/components/slider/slider-thumb.d.ts +4 -3
- package/dist/types/components/slider/slider-track.d.ts +4 -2
- package/dist/types/components/slider/slider-value-text.d.ts +4 -2
- package/dist/types/components/slider/slider.d.ts +11 -11
- package/dist/types/components/splitter/index.d.ts +5 -5
- package/dist/types/components/splitter/splitter-panel.d.ts +4 -2
- package/dist/types/components/splitter/splitter-resize-trigger.d.ts +4 -2
- package/dist/types/components/splitter/splitter-root-provider.d.ts +4 -2
- package/dist/types/components/splitter/splitter-root.d.ts +4 -3
- package/dist/types/components/splitter/splitter.d.ts +4 -4
- package/dist/types/components/switch/index.d.ts +7 -7
- package/dist/types/components/switch/switch-control.d.ts +4 -2
- package/dist/types/components/switch/switch-hidden-input.d.ts +4 -2
- package/dist/types/components/switch/switch-label.d.ts +4 -2
- package/dist/types/components/switch/switch-root-provider.d.ts +4 -2
- package/dist/types/components/switch/switch-root.d.ts +4 -3
- package/dist/types/components/switch/switch-thumb.d.ts +4 -2
- package/dist/types/components/switch/switch.d.ts +6 -6
- package/dist/types/components/tabs/index.d.ts +7 -7
- package/dist/types/components/tabs/tab-content.d.ts +4 -3
- package/dist/types/components/tabs/tab-indicator.d.ts +4 -2
- package/dist/types/components/tabs/tab-list.d.ts +4 -2
- package/dist/types/components/tabs/tab-trigger.d.ts +4 -2
- package/dist/types/components/tabs/tabs-root-provider.d.ts +4 -2
- package/dist/types/components/tabs/tabs-root.d.ts +4 -3
- package/dist/types/components/tabs/tabs.d.ts +6 -6
- package/dist/types/components/tags-input/index.d.ts +14 -14
- package/dist/types/components/tags-input/tags-input-clear-trigger.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-control.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-hidden-input.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-input.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-item-delete-trigger.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-item-input.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-item-preview.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-item-text.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-item.d.ts +4 -3
- package/dist/types/components/tags-input/tags-input-label.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-root-provider.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-root.d.ts +4 -3
- package/dist/types/components/tags-input/tags-input.d.ts +12 -12
- package/dist/types/components/toast/index.d.ts +8 -8
- package/dist/types/components/toast/toast-action-trigger.d.ts +4 -2
- package/dist/types/components/toast/toast-close-trigger.d.ts +4 -2
- package/dist/types/components/toast/toast-description.d.ts +4 -2
- package/dist/types/components/toast/toast-root.d.ts +4 -2
- package/dist/types/components/toast/toast-title.d.ts +4 -2
- package/dist/types/components/toast/toast.d.ts +6 -8
- package/dist/types/components/toast/toaster.d.ts +4 -3
- package/dist/types/components/toggle-group/index.d.ts +4 -4
- package/dist/types/components/toggle-group/toggle-group-item.d.ts +4 -2
- package/dist/types/components/toggle-group/toggle-group-root-provider.d.ts +4 -2
- package/dist/types/components/toggle-group/toggle-group-root.d.ts +4 -3
- package/dist/types/components/toggle-group/toggle-group.d.ts +3 -2
- package/dist/types/components/tooltip/index.d.ts +8 -8
- package/dist/types/components/tooltip/tooltip-arrow-tip.d.ts +4 -2
- package/dist/types/components/tooltip/tooltip-arrow.d.ts +4 -2
- package/dist/types/components/tooltip/tooltip-content.d.ts +4 -2
- package/dist/types/components/tooltip/tooltip-positioner.d.ts +4 -2
- package/dist/types/components/tooltip/tooltip-root-provider.d.ts +4 -2
- package/dist/types/components/tooltip/tooltip-root.d.ts +3 -1
- package/dist/types/components/tooltip/tooltip-trigger.d.ts +4 -2
- package/dist/types/components/tooltip/tooltip.d.ts +7 -7
- package/dist/types/components/tree-view/index.d.ts +15 -15
- package/dist/types/components/tree-view/tree-view-branch-content.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-branch-control.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-branch-indicator.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-branch-text.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-branch-trigger.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-branch.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-item-indicator.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-item-text.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-item.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-label.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-root-provider.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-root.d.ts +4 -3
- package/dist/types/components/tree-view/tree-view-tree.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view.d.ts +13 -13
- package/package.json +50 -49
package/dist/esm/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { mergeProps as mergeProps$1, useMachine, normalizeProps, useActor } from
|
|
|
4
4
|
import * as collapsible$1 from '@zag-js/collapsible';
|
|
5
5
|
import * as accordion$1 from '@zag-js/accordion';
|
|
6
6
|
import * as avatar$1 from '@zag-js/avatar';
|
|
7
|
-
import { carouselAnatomy, checkboxAnatomy, colorPickerAnatomy, datePickerAnatomy, segmentGroupAnatomy, selectAnatomy } from '@ark-ui/anatomy';
|
|
7
|
+
import { carouselAnatomy, checkboxAnatomy, fieldAnatomy, colorPickerAnatomy, datePickerAnatomy, segmentGroupAnatomy, selectAnatomy } from '@ark-ui/anatomy';
|
|
8
8
|
import * as carousel$1 from '@zag-js/carousel';
|
|
9
9
|
import * as checkbox$1 from '@zag-js/checkbox';
|
|
10
10
|
import * as clipboard$1 from '@zag-js/clipboard';
|
|
@@ -14,6 +14,7 @@ import * as combobox$1 from '@zag-js/combobox';
|
|
|
14
14
|
import * as datePicker$1 from '@zag-js/date-picker';
|
|
15
15
|
import * as dialog$1 from '@zag-js/dialog';
|
|
16
16
|
import * as editable$1 from '@zag-js/editable';
|
|
17
|
+
import { getDocument, getWindow } from '@zag-js/dom-query';
|
|
17
18
|
import * as fileUpload$1 from '@zag-js/file-upload';
|
|
18
19
|
import { isRTL, formatBytes, formatNumber } from '@zag-js/i18n-utils';
|
|
19
20
|
import * as hoverCard$1 from '@zag-js/hover-card';
|
|
@@ -27,8 +28,7 @@ import * as qrCode$1 from '@zag-js/qr-code';
|
|
|
27
28
|
import * as radio from '@zag-js/radio-group';
|
|
28
29
|
import * as rating from '@zag-js/rating-group';
|
|
29
30
|
import * as select$1 from '@zag-js/select';
|
|
30
|
-
import
|
|
31
|
-
import { createProps } from '@zag-js/types';
|
|
31
|
+
import * as signaturePad$1 from '@zag-js/signature-pad';
|
|
32
32
|
import * as slider$1 from '@zag-js/slider';
|
|
33
33
|
import * as splitter$1 from '@zag-js/splitter';
|
|
34
34
|
import * as zagSwitch from '@zag-js/switch';
|
|
@@ -134,8 +134,8 @@ const CollapsibleContent = props => {
|
|
|
134
134
|
|
|
135
135
|
const CollapsibleContext = props => props.children(useCollapsibleContext());
|
|
136
136
|
|
|
137
|
-
const isFunction
|
|
138
|
-
const runIfFn
|
|
137
|
+
const isFunction = value => typeof value === 'function';
|
|
138
|
+
const runIfFn = (valueOrFn, ...args) => isFunction(valueOrFn) ? valueOrFn(...args) : valueOrFn;
|
|
139
139
|
|
|
140
140
|
const [EnvironmentContextProvider, useEnvironmentContext] = createContext({
|
|
141
141
|
hookName: 'useEnvironmentContext',
|
|
@@ -151,7 +151,7 @@ const [EnvironmentContextProvider, useEnvironmentContext] = createContext({
|
|
|
151
151
|
var _tmpl$$5 = /*#__PURE__*/template(`<span hidden>`);
|
|
152
152
|
const EnvironmentProvider = props => {
|
|
153
153
|
const [spanRef, setSpanRef] = createSignal();
|
|
154
|
-
const getRootNode = () => runIfFn
|
|
154
|
+
const getRootNode = () => runIfFn(props.value) ?? spanRef()?.ownerDocument ?? document;
|
|
155
155
|
const environment = createMemo(() => ({
|
|
156
156
|
getRootNode,
|
|
157
157
|
getDocument: () => getDocument(getRootNode()),
|
|
@@ -597,12 +597,12 @@ const CheckboxControl = props => {
|
|
|
597
597
|
};
|
|
598
598
|
|
|
599
599
|
function useControllableState(props) {
|
|
600
|
-
const [uncontrolledValue, setUncontrolledValue] = createSignal(runIfFn
|
|
600
|
+
const [uncontrolledValue, setUncontrolledValue] = createSignal(runIfFn(props.defaultValue));
|
|
601
601
|
const controlled = createMemo(() => props.value?.() !== undefined);
|
|
602
602
|
const currentValue = createMemo(() => controlled() ? props.value?.() : uncontrolledValue());
|
|
603
603
|
const setValue = next => {
|
|
604
604
|
untrack(() => {
|
|
605
|
-
const nextValue = runIfFn
|
|
605
|
+
const nextValue = runIfFn(next, currentValue());
|
|
606
606
|
if (controlled()) {
|
|
607
607
|
return props.onChange?.(nextValue);
|
|
608
608
|
}
|
|
@@ -644,6 +644,7 @@ function useCheckboxGroup(props = {}) {
|
|
|
644
644
|
toggleValue(itemProps.value);
|
|
645
645
|
}
|
|
646
646
|
},
|
|
647
|
+
name: props.name,
|
|
647
648
|
disabled: props.disabled,
|
|
648
649
|
readOnly: props.readOnly
|
|
649
650
|
};
|
|
@@ -651,6 +652,7 @@ function useCheckboxGroup(props = {}) {
|
|
|
651
652
|
return {
|
|
652
653
|
isChecked,
|
|
653
654
|
value,
|
|
655
|
+
name: props.name,
|
|
654
656
|
disabled: props.disabled,
|
|
655
657
|
readOnly: props.readOnly,
|
|
656
658
|
setValue,
|
|
@@ -668,20 +670,210 @@ const [CheckboxGroupContextProvider, useCheckboxGroupContext] = createContext({
|
|
|
668
670
|
});
|
|
669
671
|
|
|
670
672
|
const CheckboxGroup = props => {
|
|
671
|
-
const [checkboxGroupProps, localProps] = createSplitProps()(props, ['defaultValue', 'value', 'onValueChange', 'disabled', 'readOnly']);
|
|
673
|
+
const [checkboxGroupProps, localProps] = createSplitProps()(props, ['defaultValue', 'value', 'onValueChange', 'disabled', 'readOnly', 'name']);
|
|
672
674
|
const checkboxGroup = useCheckboxGroup(checkboxGroupProps);
|
|
673
675
|
return createComponent(CheckboxGroupContextProvider, {
|
|
674
676
|
value: checkboxGroup,
|
|
675
677
|
get children() {
|
|
676
|
-
return createComponent(ark.div, mergeProps(
|
|
678
|
+
return createComponent(ark.div, mergeProps({
|
|
679
|
+
role: "group"
|
|
680
|
+
}, localProps, () => checkboxAnatomy.build().group.attrs));
|
|
681
|
+
}
|
|
682
|
+
});
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
const [FieldProvider, useFieldContext] = createContext({
|
|
686
|
+
hookName: 'useFieldContext',
|
|
687
|
+
providerName: '<FieldProvider />',
|
|
688
|
+
strict: false
|
|
689
|
+
});
|
|
690
|
+
|
|
691
|
+
const FieldContext = props => props.children(useFieldContext());
|
|
692
|
+
|
|
693
|
+
const FieldErrorText = props => {
|
|
694
|
+
const field = useFieldContext();
|
|
695
|
+
const mergedProps = mergeProps$1(() => field().getErrorTextProps(), props);
|
|
696
|
+
return createComponent(Show, {
|
|
697
|
+
get when() {
|
|
698
|
+
return field?.().invalid;
|
|
699
|
+
},
|
|
700
|
+
get children() {
|
|
701
|
+
return createComponent(ark.span, mergedProps);
|
|
702
|
+
}
|
|
703
|
+
});
|
|
704
|
+
};
|
|
705
|
+
|
|
706
|
+
const FieldHelperText = props => {
|
|
707
|
+
const field = useFieldContext();
|
|
708
|
+
const mergedProps = mergeProps$1(() => field().getHelperTextProps(), props);
|
|
709
|
+
return createComponent(ark.span, mergedProps);
|
|
710
|
+
};
|
|
711
|
+
|
|
712
|
+
const FieldInput = props => {
|
|
713
|
+
const field = useFieldContext();
|
|
714
|
+
const mergedProps = mergeProps$1(() => field?.().getInputProps(), props);
|
|
715
|
+
return createComponent(ark.input, mergedProps);
|
|
716
|
+
};
|
|
717
|
+
|
|
718
|
+
const FieldLabel = props => {
|
|
719
|
+
const field = useFieldContext();
|
|
720
|
+
const mergedProps = mergeProps$1(() => field?.().getLabelProps(), props);
|
|
721
|
+
return createComponent(ark.label, mergedProps);
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
const FieldSelect = props => {
|
|
725
|
+
const field = useFieldContext();
|
|
726
|
+
const mergedProps = mergeProps$1(() => field?.().getSelectProps(), props);
|
|
727
|
+
return createComponent(ark.select, mergedProps);
|
|
728
|
+
};
|
|
729
|
+
|
|
730
|
+
const parts = fieldAnatomy.build();
|
|
731
|
+
const useField = props => {
|
|
732
|
+
const {
|
|
733
|
+
required = false,
|
|
734
|
+
disabled = false,
|
|
735
|
+
invalid = false,
|
|
736
|
+
readOnly = false
|
|
737
|
+
} = props;
|
|
738
|
+
const [hasErrorText, setHasErrorText] = createSignal(false);
|
|
739
|
+
const [hasHelperText, setHasHelperText] = createSignal(false);
|
|
740
|
+
const id = props.id ?? `field-${Math.random().toString(36).substr(2, 9)}`;
|
|
741
|
+
let rootRef;
|
|
742
|
+
const errorTextId = `field::${id}::error-text`;
|
|
743
|
+
const helperTextId = `field::${id}::helper-text`;
|
|
744
|
+
const labelId = `field::${id}::label`;
|
|
745
|
+
createEffect(() => {
|
|
746
|
+
return;
|
|
747
|
+
});
|
|
748
|
+
const getRootProps = () => ({
|
|
749
|
+
...parts.root.attrs,
|
|
750
|
+
role: 'group',
|
|
751
|
+
'data-disabled': dataAttr(disabled),
|
|
752
|
+
'data-invalid': dataAttr(invalid),
|
|
753
|
+
'data-readonly': dataAttr(readOnly)
|
|
754
|
+
});
|
|
755
|
+
const getLabelProps = () => ({
|
|
756
|
+
...parts.label.attrs,
|
|
757
|
+
id: labelId,
|
|
758
|
+
'data-disabled': dataAttr(disabled),
|
|
759
|
+
'data-invalid': dataAttr(invalid),
|
|
760
|
+
'data-readonly': dataAttr(readOnly),
|
|
761
|
+
htmlFor: id
|
|
762
|
+
});
|
|
763
|
+
const labelIds = [];
|
|
764
|
+
if (hasErrorText() && invalid) labelIds.push(errorTextId);
|
|
765
|
+
if (hasHelperText()) labelIds.push(helperTextId);
|
|
766
|
+
const getControlProps = () => ({
|
|
767
|
+
'aria-describedby': labelIds.join(' ') || undefined,
|
|
768
|
+
'aria-invalid': ariaAttr(invalid),
|
|
769
|
+
'aria-required': ariaAttr(required),
|
|
770
|
+
'aria-readonly': ariaAttr(readOnly),
|
|
771
|
+
id,
|
|
772
|
+
required,
|
|
773
|
+
disabled,
|
|
774
|
+
readOnly
|
|
775
|
+
});
|
|
776
|
+
const getInputProps = () => ({
|
|
777
|
+
...getControlProps(),
|
|
778
|
+
...parts.input.attrs
|
|
779
|
+
});
|
|
780
|
+
const getTextareaProps = () => ({
|
|
781
|
+
...getControlProps(),
|
|
782
|
+
...parts.textarea.attrs
|
|
783
|
+
});
|
|
784
|
+
const getSelectProps = () => ({
|
|
785
|
+
...getControlProps(),
|
|
786
|
+
...parts.select.attrs
|
|
787
|
+
});
|
|
788
|
+
const getHelperTextProps = () => ({
|
|
789
|
+
id: helperTextId,
|
|
790
|
+
...parts.helperText.attrs
|
|
791
|
+
});
|
|
792
|
+
const getErrorTextProps = () => ({
|
|
793
|
+
id: errorTextId,
|
|
794
|
+
...parts.errorText.attrs,
|
|
795
|
+
'aria-live': 'polite'
|
|
796
|
+
});
|
|
797
|
+
return createMemo(() => ({
|
|
798
|
+
ariaDescribedby: labelIds.join(' '),
|
|
799
|
+
ids: {
|
|
800
|
+
control: id,
|
|
801
|
+
label: labelId,
|
|
802
|
+
errorText: errorTextId,
|
|
803
|
+
helperText: helperTextId
|
|
804
|
+
},
|
|
805
|
+
refs: {
|
|
806
|
+
rootRef
|
|
807
|
+
},
|
|
808
|
+
disabled,
|
|
809
|
+
invalid,
|
|
810
|
+
readOnly,
|
|
811
|
+
required,
|
|
812
|
+
getLabelProps,
|
|
813
|
+
getRootProps,
|
|
814
|
+
getInputProps,
|
|
815
|
+
getTextareaProps,
|
|
816
|
+
getSelectProps,
|
|
817
|
+
getHelperTextProps,
|
|
818
|
+
getErrorTextProps
|
|
819
|
+
}));
|
|
820
|
+
};
|
|
821
|
+
const dataAttr = condition => condition ? '' : undefined;
|
|
822
|
+
const ariaAttr = condition => condition ? true : undefined;
|
|
823
|
+
|
|
824
|
+
const FieldRoot = props => {
|
|
825
|
+
const [useFieldProps, localProps] = createSplitProps()(props, ['id', 'disabled', 'invalid', 'readOnly', 'required']);
|
|
826
|
+
const field = useField(useFieldProps);
|
|
827
|
+
const mergedProps = mergeProps$1(() => field().getRootProps(), localProps);
|
|
828
|
+
return createComponent(FieldProvider, {
|
|
829
|
+
value: field,
|
|
830
|
+
get children() {
|
|
831
|
+
return createComponent(ark.div, mergedProps);
|
|
677
832
|
}
|
|
678
833
|
});
|
|
679
834
|
};
|
|
680
835
|
|
|
836
|
+
const FieldRootProvider = props => {
|
|
837
|
+
const [{
|
|
838
|
+
value: field
|
|
839
|
+
}, localProps] = createSplitProps()(props, ['value']);
|
|
840
|
+
const mergedProps = mergeProps$1(() => field().getRootProps(), localProps);
|
|
841
|
+
return createComponent(FieldProvider, {
|
|
842
|
+
value: field,
|
|
843
|
+
get children() {
|
|
844
|
+
return createComponent(ark.div, mergedProps);
|
|
845
|
+
}
|
|
846
|
+
});
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
const FieldTextarea = props => {
|
|
850
|
+
const field = useFieldContext();
|
|
851
|
+
const mergedProps = mergeProps$1(() => field?.().getTextareaProps(), props);
|
|
852
|
+
return createComponent(ark.textarea, mergedProps);
|
|
853
|
+
};
|
|
854
|
+
|
|
855
|
+
var field = /*#__PURE__*/Object.freeze({
|
|
856
|
+
__proto__: null,
|
|
857
|
+
Context: FieldContext,
|
|
858
|
+
ErrorText: FieldErrorText,
|
|
859
|
+
HelperText: FieldHelperText,
|
|
860
|
+
Input: FieldInput,
|
|
861
|
+
Label: FieldLabel,
|
|
862
|
+
Root: FieldRoot,
|
|
863
|
+
RootProvider: FieldRootProvider,
|
|
864
|
+
Select: FieldSelect,
|
|
865
|
+
Textarea: FieldTextarea
|
|
866
|
+
});
|
|
867
|
+
|
|
681
868
|
const CheckboxHiddenInput = props => {
|
|
682
869
|
const checkbox = useCheckboxContext();
|
|
683
870
|
const mergedProps = mergeProps$1(() => checkbox().getHiddenInputProps(), props);
|
|
684
|
-
|
|
871
|
+
const field = useFieldContext();
|
|
872
|
+
return createComponent(ark.input, mergeProps({
|
|
873
|
+
get ["aria-describedby"]() {
|
|
874
|
+
return field?.().ariaDescribedby;
|
|
875
|
+
}
|
|
876
|
+
}, mergedProps));
|
|
685
877
|
};
|
|
686
878
|
|
|
687
879
|
const CheckboxIndicator = props => {
|
|
@@ -711,8 +903,17 @@ const useCheckbox = ownProps => {
|
|
|
711
903
|
const locale = useLocaleContext();
|
|
712
904
|
const environment = useEnvironmentContext();
|
|
713
905
|
const id = createUniqueId();
|
|
906
|
+
const field = useFieldContext();
|
|
714
907
|
const context = createMemo(() => ({
|
|
715
908
|
id,
|
|
909
|
+
ids: {
|
|
910
|
+
label: field?.().ids.label,
|
|
911
|
+
hiddenInput: field?.().ids.control
|
|
912
|
+
},
|
|
913
|
+
disabled: field?.().disabled,
|
|
914
|
+
readOnly: field?.().readOnly,
|
|
915
|
+
invalid: field?.().invalid,
|
|
916
|
+
required: field?.().required,
|
|
716
917
|
dir: locale().dir,
|
|
717
918
|
getRootNode: environment().getRootNode,
|
|
718
919
|
checked: props().defaultChecked,
|
|
@@ -915,10 +1116,18 @@ const [ColorPickerChannelPropsProvider, useColorPickerChannelPropsContext] = cre
|
|
|
915
1116
|
providerName: '<ColorPickerChannelSliderProvider />'
|
|
916
1117
|
});
|
|
917
1118
|
|
|
1119
|
+
const [ColorPickerFormatPropsProvider, useColorPickerFormatPropsContext] = createContext({
|
|
1120
|
+
hookName: 'useColorPickerFormatPropsContext',
|
|
1121
|
+
providerName: '<ColorPickerFormatPropsProvider />',
|
|
1122
|
+
strict: false
|
|
1123
|
+
});
|
|
1124
|
+
|
|
918
1125
|
const ColorPickerChannelSlider = props => {
|
|
919
1126
|
const [channelProps, localProps] = createSplitProps()(props, ['channel', 'orientation']);
|
|
920
1127
|
const api = useColorPickerContext();
|
|
921
|
-
const
|
|
1128
|
+
const formatProps = useColorPickerFormatPropsContext();
|
|
1129
|
+
const channelSliderProps = mergeProps$1(channelProps, formatProps);
|
|
1130
|
+
const mergedProps = mergeProps$1(() => api().getChannelSliderProps(channelSliderProps), localProps);
|
|
922
1131
|
return createComponent(ColorPickerChannelPropsProvider, {
|
|
923
1132
|
value: channelProps,
|
|
924
1133
|
get children() {
|
|
@@ -927,20 +1136,43 @@ const ColorPickerChannelSlider = props => {
|
|
|
927
1136
|
});
|
|
928
1137
|
};
|
|
929
1138
|
|
|
1139
|
+
const ColorPickerChannelSliderLabel = props => {
|
|
1140
|
+
const colorPicker = useColorPickerContext();
|
|
1141
|
+
const channelProps = useColorPickerChannelPropsContext();
|
|
1142
|
+
const mergedProps = mergeProps$1(() => colorPicker().getChannelSliderLabelProps(channelProps), props);
|
|
1143
|
+
return createComponent(ark.label, mergedProps);
|
|
1144
|
+
};
|
|
1145
|
+
|
|
930
1146
|
const ColorPickerChannelSliderThumb = props => {
|
|
931
1147
|
const api = useColorPickerContext();
|
|
1148
|
+
const formatProps = useColorPickerFormatPropsContext();
|
|
932
1149
|
const channelProps = useColorPickerChannelPropsContext();
|
|
933
|
-
const
|
|
1150
|
+
const channelSliderProps = mergeProps$1(channelProps, formatProps);
|
|
1151
|
+
const mergedProps = mergeProps$1(() => api().getChannelSliderThumbProps(channelSliderProps), props);
|
|
934
1152
|
return createComponent(ark.div, mergedProps);
|
|
935
1153
|
};
|
|
936
1154
|
|
|
937
1155
|
const ColorPickerChannelSliderTrack = props => {
|
|
938
1156
|
const api = useColorPickerContext();
|
|
1157
|
+
const formatProps = useColorPickerFormatPropsContext();
|
|
939
1158
|
const channelProps = useColorPickerChannelPropsContext();
|
|
940
|
-
const
|
|
1159
|
+
const channelSliderProps = mergeProps$1(channelProps, formatProps);
|
|
1160
|
+
const mergedProps = mergeProps$1(() => api().getChannelSliderTrackProps(channelSliderProps), props);
|
|
941
1161
|
return createComponent(ark.div, mergedProps);
|
|
942
1162
|
};
|
|
943
1163
|
|
|
1164
|
+
const ColorPickerChannelSliderValueText = props => {
|
|
1165
|
+
const colorPicker = useColorPickerContext();
|
|
1166
|
+
const localeContext = useLocaleContext();
|
|
1167
|
+
const channelProps = useColorPickerChannelPropsContext();
|
|
1168
|
+
const mergedProps = mergeProps$1(() => colorPicker().getChannelSliderValueTextProps(channelProps), props);
|
|
1169
|
+
return createComponent(ark.span, mergeProps(mergedProps, {
|
|
1170
|
+
get children() {
|
|
1171
|
+
return props.children || colorPicker().getChannelValueText(channelProps.channel, localeContext().locale);
|
|
1172
|
+
}
|
|
1173
|
+
}));
|
|
1174
|
+
};
|
|
1175
|
+
|
|
944
1176
|
const splitPresenceProps = props => createSplitProps()(props, ['immediate', 'lazyMount', 'onExitComplete', 'present', 'unmountOnExit']);
|
|
945
1177
|
|
|
946
1178
|
const usePresence = props => {
|
|
@@ -1044,7 +1276,12 @@ const ColorPickerFormatTrigger = props => {
|
|
|
1044
1276
|
const ColorPickerHiddenInput = props => {
|
|
1045
1277
|
const colorPicker = useColorPickerContext();
|
|
1046
1278
|
const mergedProps = mergeProps$1(() => colorPicker().getHiddenInputProps(), props);
|
|
1047
|
-
|
|
1279
|
+
const field = useFieldContext();
|
|
1280
|
+
return createComponent(ark.input, mergeProps({
|
|
1281
|
+
get ["aria-describedby"]() {
|
|
1282
|
+
return field?.().ariaDescribedby;
|
|
1283
|
+
}
|
|
1284
|
+
}, mergedProps));
|
|
1048
1285
|
};
|
|
1049
1286
|
|
|
1050
1287
|
const ColorPickerLabel = props => {
|
|
@@ -1070,10 +1307,18 @@ const ColorPickerPositioner = props => {
|
|
|
1070
1307
|
const useColorPicker = props => {
|
|
1071
1308
|
const locale = useLocaleContext();
|
|
1072
1309
|
const environment = useEnvironmentContext();
|
|
1310
|
+
const field = useFieldContext();
|
|
1073
1311
|
const id = createUniqueId();
|
|
1074
1312
|
const context = createMemo(() => ({
|
|
1075
1313
|
id,
|
|
1314
|
+
ids: {
|
|
1315
|
+
label: field?.().ids.label,
|
|
1316
|
+
input: field?.().ids.control
|
|
1317
|
+
},
|
|
1076
1318
|
dir: locale().dir,
|
|
1319
|
+
disabled: field?.().disabled,
|
|
1320
|
+
readOnly: field?.().readOnly,
|
|
1321
|
+
required: field?.().required,
|
|
1077
1322
|
getRootNode: environment().getRootNode,
|
|
1078
1323
|
open: props.defaultOpen,
|
|
1079
1324
|
'open.controlled': props.open !== undefined,
|
|
@@ -1088,7 +1333,7 @@ const useColorPicker = props => {
|
|
|
1088
1333
|
|
|
1089
1334
|
const ColorPickerRoot = props => {
|
|
1090
1335
|
const [presenceProps, colorPickerProps] = splitPresenceProps(props);
|
|
1091
|
-
const [useColorPickerProps, localProps] = createSplitProps()(colorPickerProps, ['closeOnSelect', 'defaultOpen', 'defaultValue', 'disabled', 'format', 'id', 'ids', 'initialFocusEl', 'name', 'name', 'onFocusOutside', 'onFormatChange', 'onInteractOutside', 'onOpenChange', 'onPointerDownOutside', 'onValueChange', 'onValueChangeEnd', 'open', 'positioning', 'readOnly', 'value']);
|
|
1336
|
+
const [useColorPickerProps, localProps] = createSplitProps()(colorPickerProps, ['closeOnSelect', 'defaultOpen', 'defaultValue', 'disabled', 'format', 'id', 'ids', 'initialFocusEl', 'name', 'name', 'onFocusOutside', 'onFormatChange', 'onInteractOutside', 'onOpenChange', 'onPointerDownOutside', 'onValueChange', 'onValueChangeEnd', 'open', 'positioning', 'readOnly', 'required', 'value']);
|
|
1092
1337
|
const api = useColorPicker(useColorPickerProps);
|
|
1093
1338
|
const apiPresence = usePresence(mergeProps$1(presenceProps, () => ({
|
|
1094
1339
|
present: api().open
|
|
@@ -1179,6 +1424,26 @@ const ColorPickerTrigger = props => {
|
|
|
1179
1424
|
return createComponent(ark.button, mergedProps);
|
|
1180
1425
|
};
|
|
1181
1426
|
|
|
1427
|
+
const ColorPickerValueSwatch = props => {
|
|
1428
|
+
const [{
|
|
1429
|
+
respectAlpha
|
|
1430
|
+
}, localProps] = createSplitProps()(props, ['respectAlpha']);
|
|
1431
|
+
const colorPicker = useColorPickerContext();
|
|
1432
|
+
const swatchProps = createMemo(() => ({
|
|
1433
|
+
respectAlpha,
|
|
1434
|
+
value: colorPicker().value
|
|
1435
|
+
}));
|
|
1436
|
+
const mergedProps = mergeProps$1(() => colorPicker().getSwatchProps(swatchProps()), localProps);
|
|
1437
|
+
return createComponent(ColorPickerSwatchPropsProvider, {
|
|
1438
|
+
get value() {
|
|
1439
|
+
return swatchProps();
|
|
1440
|
+
},
|
|
1441
|
+
get children() {
|
|
1442
|
+
return createComponent(ark.div, mergedProps);
|
|
1443
|
+
}
|
|
1444
|
+
});
|
|
1445
|
+
};
|
|
1446
|
+
|
|
1182
1447
|
const ColorPickerValueText = props => {
|
|
1183
1448
|
const api = useColorPickerContext();
|
|
1184
1449
|
const mergedProps = mergeProps$1(() => colorPickerAnatomy.build().valueText.attrs, props);
|
|
@@ -1191,17 +1456,23 @@ const ColorPickerValueText = props => {
|
|
|
1191
1456
|
|
|
1192
1457
|
const ColorPickerView = props => {
|
|
1193
1458
|
const api = useColorPickerContext();
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
},
|
|
1459
|
+
const [formatProps, localProps] = createSplitProps()(props, ['format']);
|
|
1460
|
+
const mergedProps = mergeProps$1(() => colorPickerAnatomy.build().view.attrs, localProps);
|
|
1461
|
+
return createComponent(ColorPickerFormatPropsProvider, {
|
|
1462
|
+
value: formatProps,
|
|
1199
1463
|
get children() {
|
|
1200
|
-
return createComponent(
|
|
1201
|
-
get
|
|
1202
|
-
return props.format;
|
|
1464
|
+
return createComponent(Show, {
|
|
1465
|
+
get when() {
|
|
1466
|
+
return api().format === props.format;
|
|
1467
|
+
},
|
|
1468
|
+
get children() {
|
|
1469
|
+
return createComponent(ark.div, mergeProps({
|
|
1470
|
+
get ["data-format"]() {
|
|
1471
|
+
return props.format;
|
|
1472
|
+
}
|
|
1473
|
+
}, mergedProps));
|
|
1203
1474
|
}
|
|
1204
|
-
}
|
|
1475
|
+
});
|
|
1205
1476
|
}
|
|
1206
1477
|
});
|
|
1207
1478
|
};
|
|
@@ -1213,8 +1484,10 @@ var colorPicker = /*#__PURE__*/Object.freeze({
|
|
|
1213
1484
|
AreaThumb: ColorPickerAreaThumb,
|
|
1214
1485
|
ChannelInput: ColorPickerChannelInput,
|
|
1215
1486
|
ChannelSlider: ColorPickerChannelSlider,
|
|
1487
|
+
ChannelSliderLabel: ColorPickerChannelSliderLabel,
|
|
1216
1488
|
ChannelSliderThumb: ColorPickerChannelSliderThumb,
|
|
1217
1489
|
ChannelSliderTrack: ColorPickerChannelSliderTrack,
|
|
1490
|
+
ChannelSliderValueText: ColorPickerChannelSliderValueText,
|
|
1218
1491
|
Content: ColorPickerContent,
|
|
1219
1492
|
Context: ColorPickerContext,
|
|
1220
1493
|
Control: ColorPickerControl,
|
|
@@ -1225,12 +1498,14 @@ var colorPicker = /*#__PURE__*/Object.freeze({
|
|
|
1225
1498
|
Label: ColorPickerLabel,
|
|
1226
1499
|
Positioner: ColorPickerPositioner,
|
|
1227
1500
|
Root: ColorPickerRoot,
|
|
1501
|
+
RootProvider: ColorPickerRootProvider,
|
|
1228
1502
|
Swatch: ColorPickerSwatch,
|
|
1229
1503
|
SwatchGroup: ColorPickerSwatchGroup,
|
|
1230
1504
|
SwatchIndicator: ColorPickerSwatchIndicator,
|
|
1231
1505
|
SwatchTrigger: ColorPickerSwatchTrigger,
|
|
1232
1506
|
TransparencyGrid: ColorPickerTransparencyGrid,
|
|
1233
1507
|
Trigger: ColorPickerTrigger,
|
|
1508
|
+
ValueSwatch: ColorPickerValueSwatch,
|
|
1234
1509
|
ValueText: ColorPickerValueText,
|
|
1235
1510
|
View: ColorPickerView
|
|
1236
1511
|
});
|
|
@@ -1272,7 +1547,12 @@ const ComboboxControl = props => {
|
|
|
1272
1547
|
const ComboboxInput = props => {
|
|
1273
1548
|
const combobox = useComboboxContext();
|
|
1274
1549
|
const mergedProps = mergeProps$1(() => combobox().getInputProps(), props);
|
|
1275
|
-
|
|
1550
|
+
const field = useFieldContext();
|
|
1551
|
+
return createComponent(ark.input, mergeProps({
|
|
1552
|
+
get ["aria-describedby"]() {
|
|
1553
|
+
return field?.().ariaDescribedby;
|
|
1554
|
+
}
|
|
1555
|
+
}, mergedProps));
|
|
1276
1556
|
};
|
|
1277
1557
|
|
|
1278
1558
|
const [ComboboxItemProvider, useComboboxItemContext] = createContext({
|
|
@@ -1376,12 +1656,23 @@ const ComboboxPositioner = props => {
|
|
|
1376
1656
|
|
|
1377
1657
|
const useCombobox = props => {
|
|
1378
1658
|
const [collectionOptions, comboboxProps] = createSplitProps()(props, ['isItemDisabled', 'itemToValue', 'itemToString', 'items']);
|
|
1379
|
-
const collection = () => combobox$1.collection(
|
|
1659
|
+
const collection = () => combobox$1.collection({
|
|
1660
|
+
...collectionOptions
|
|
1661
|
+
});
|
|
1380
1662
|
const locale = useLocaleContext();
|
|
1381
1663
|
const environment = useEnvironmentContext();
|
|
1382
1664
|
const id = createUniqueId();
|
|
1665
|
+
const field = useFieldContext();
|
|
1383
1666
|
const context = createMemo(() => ({
|
|
1384
1667
|
id,
|
|
1668
|
+
ids: {
|
|
1669
|
+
label: field?.().ids.label,
|
|
1670
|
+
input: field?.().ids.control
|
|
1671
|
+
},
|
|
1672
|
+
disabled: field?.().disabled,
|
|
1673
|
+
readOnly: field?.().readOnly,
|
|
1674
|
+
required: field?.().required,
|
|
1675
|
+
invalid: field?.().invalid,
|
|
1385
1676
|
collection: collection(),
|
|
1386
1677
|
dir: locale().dir,
|
|
1387
1678
|
getRootNode: environment().getRootNode,
|
|
@@ -1398,7 +1689,7 @@ const useCombobox = props => {
|
|
|
1398
1689
|
|
|
1399
1690
|
const ComboboxRoot = props => {
|
|
1400
1691
|
const [presenceProps, comboboxProps] = splitPresenceProps(props);
|
|
1401
|
-
const [useComboboxProps, localProps] = createSplitProps()(comboboxProps, ['allowCustomValue', 'autoFocus', 'closeOnSelect', 'composite', 'defaultOpen', 'defaultValue', 'disabled', 'disableLayer', 'form', 'getSelectionValue', 'highlightedValue', 'id', 'ids', 'inputBehavior', 'inputValue', 'invalid', 'isItemDisabled', 'items', 'itemToString', 'itemToValue', 'loopFocus', 'multiple', 'name', 'onFocusOutside', 'onHighlightChange', 'onInputValueChange', 'onInteractOutside', 'onOpenChange', 'onOpenChange', 'onPointerDownOutside', 'onValueChange', 'open', 'openOnChange', 'openOnClick', 'openOnKeyPress', 'placeholder', 'positioning', 'readOnly', 'scrollToIndexFn', 'selectionBehavior', 'translations', 'value']);
|
|
1692
|
+
const [useComboboxProps, localProps] = createSplitProps()(comboboxProps, ['allowCustomValue', 'autoFocus', 'closeOnSelect', 'composite', 'defaultOpen', 'defaultValue', 'disabled', 'disableLayer', 'form', 'getSelectionValue', 'highlightedValue', 'id', 'ids', 'inputBehavior', 'inputValue', 'invalid', 'isItemDisabled', 'items', 'itemToString', 'itemToValue', 'loopFocus', 'multiple', 'name', 'onFocusOutside', 'onHighlightChange', 'onInputValueChange', 'onInteractOutside', 'onOpenChange', 'onOpenChange', 'onPointerDownOutside', 'onValueChange', 'open', 'openOnChange', 'openOnClick', 'openOnKeyPress', 'placeholder', 'positioning', 'readOnly', 'required', 'scrollToIndexFn', 'selectionBehavior', 'translations', 'value']);
|
|
1402
1693
|
const api = useCombobox(useComboboxProps);
|
|
1403
1694
|
const apiPresence = usePresence(mergeProps$1(presenceProps, () => ({
|
|
1404
1695
|
present: api().open
|
|
@@ -1519,12 +1810,17 @@ const DatePickerMonthSelect = props => {
|
|
|
1519
1810
|
const mergedProps = mergeProps$1(() => api().getMonthSelectProps(), props);
|
|
1520
1811
|
return createComponent(ark.select, mergeProps(mergedProps, {
|
|
1521
1812
|
get children() {
|
|
1522
|
-
return
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1813
|
+
return createComponent(For, {
|
|
1814
|
+
get each() {
|
|
1815
|
+
return api().getMonths();
|
|
1816
|
+
},
|
|
1817
|
+
children: month => (() => {
|
|
1818
|
+
var _el$ = _tmpl$$4();
|
|
1819
|
+
insert(_el$, () => month.label);
|
|
1820
|
+
effect(() => _el$.value = month.value);
|
|
1821
|
+
return _el$;
|
|
1822
|
+
})()
|
|
1823
|
+
});
|
|
1528
1824
|
}
|
|
1529
1825
|
}));
|
|
1530
1826
|
};
|
|
@@ -1791,15 +2087,20 @@ const DatePickerYearSelect = props => {
|
|
|
1791
2087
|
const mergedProps = mergeProps$1(() => api().getYearSelectProps(), props);
|
|
1792
2088
|
return createComponent(ark.select, mergeProps(mergedProps, {
|
|
1793
2089
|
get children() {
|
|
1794
|
-
return
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
2090
|
+
return createComponent(For, {
|
|
2091
|
+
get each() {
|
|
2092
|
+
return getYearsRange({
|
|
2093
|
+
from: 1_000,
|
|
2094
|
+
to: 4_000
|
|
2095
|
+
});
|
|
2096
|
+
},
|
|
2097
|
+
children: year => (() => {
|
|
2098
|
+
var _el$ = _tmpl$$3();
|
|
2099
|
+
_el$.value = year;
|
|
2100
|
+
insert(_el$, year);
|
|
2101
|
+
return _el$;
|
|
2102
|
+
})()
|
|
2103
|
+
});
|
|
1803
2104
|
}
|
|
1804
2105
|
}));
|
|
1805
2106
|
};
|
|
@@ -2038,7 +2339,12 @@ const EditableEditTrigger = props => {
|
|
|
2038
2339
|
const EditableInput = props => {
|
|
2039
2340
|
const api = useEditableContext();
|
|
2040
2341
|
const mergedProps = mergeProps$1(() => api().getInputProps(), props);
|
|
2041
|
-
|
|
2342
|
+
const field = useFieldContext();
|
|
2343
|
+
return createComponent(ark.input, mergeProps({
|
|
2344
|
+
get ["aria-describedby"]() {
|
|
2345
|
+
return field?.().ariaDescribedby;
|
|
2346
|
+
}
|
|
2347
|
+
}, mergedProps));
|
|
2042
2348
|
};
|
|
2043
2349
|
|
|
2044
2350
|
const EditableLabel = props => {
|
|
@@ -2057,9 +2363,18 @@ const useEditable = props => {
|
|
|
2057
2363
|
const locale = useLocaleContext();
|
|
2058
2364
|
const environment = useEnvironmentContext();
|
|
2059
2365
|
const id = createUniqueId();
|
|
2366
|
+
const field = useFieldContext();
|
|
2060
2367
|
const context = createMemo(() => ({
|
|
2061
2368
|
id,
|
|
2369
|
+
ids: {
|
|
2370
|
+
label: field?.().ids.label,
|
|
2371
|
+
input: field?.().ids.control
|
|
2372
|
+
},
|
|
2062
2373
|
dir: locale().dir,
|
|
2374
|
+
disabled: field?.().disabled,
|
|
2375
|
+
invalid: field?.().invalid,
|
|
2376
|
+
readOnly: field?.().readOnly,
|
|
2377
|
+
required: field?.().required,
|
|
2063
2378
|
getRootNode: environment().getRootNode,
|
|
2064
2379
|
value: props.defaultValue,
|
|
2065
2380
|
...props
|
|
@@ -2071,7 +2386,7 @@ const useEditable = props => {
|
|
|
2071
2386
|
};
|
|
2072
2387
|
|
|
2073
2388
|
const EditableRoot = props => {
|
|
2074
|
-
const [useEditableProps, localProps] = createSplitProps()(props, ['activationMode', 'autoResize', 'defaultValue', 'disabled', 'finalFocusEl', 'form', 'id', 'ids', 'invalid', 'maxLength', 'name', 'onEdit', 'onFocusOutside', 'onInteractOutside', 'onPointerDownOutside', 'onValueChange', 'onValueCommit', 'onValueRevert', 'placeholder', 'readOnly', 'selectOnFocus', 'startWithEditView', 'submitMode', 'translations', 'value']);
|
|
2389
|
+
const [useEditableProps, localProps] = createSplitProps()(props, ['activationMode', 'autoResize', 'defaultValue', 'disabled', 'finalFocusEl', 'form', 'id', 'ids', 'invalid', 'maxLength', 'name', 'onEdit', 'onFocusOutside', 'onInteractOutside', 'onPointerDownOutside', 'onValueChange', 'onValueCommit', 'onValueRevert', 'placeholder', 'readOnly', 'required', 'selectOnFocus', 'startWithEditView', 'submitMode', 'translations', 'value']);
|
|
2075
2390
|
const api = useEditable(useEditableProps);
|
|
2076
2391
|
const mergedProps = mergeProps$1(() => api().getRootProps(), localProps);
|
|
2077
2392
|
return createComponent(EditableProvider, {
|
|
@@ -2132,7 +2447,12 @@ const FileUploadDropzone = props => {
|
|
|
2132
2447
|
const FileUploadHiddenInput = props => {
|
|
2133
2448
|
const fileUpload = useFileUploadContext();
|
|
2134
2449
|
const mergedProps = mergeProps$1(() => fileUpload().getHiddenInputProps(), props);
|
|
2135
|
-
|
|
2450
|
+
const field = useFieldContext();
|
|
2451
|
+
return createComponent(ark.input, mergeProps({
|
|
2452
|
+
get ["aria-describedby"]() {
|
|
2453
|
+
return field?.().ariaDescribedby;
|
|
2454
|
+
}
|
|
2455
|
+
}, mergedProps));
|
|
2136
2456
|
};
|
|
2137
2457
|
|
|
2138
2458
|
const [FileUploadItemPropsProvider, useFileUploadItemPropsContext] = createContext({
|
|
@@ -2217,9 +2537,16 @@ const useFileUpload = props => {
|
|
|
2217
2537
|
const locale = useLocaleContext();
|
|
2218
2538
|
const environment = useEnvironmentContext();
|
|
2219
2539
|
const id = createUniqueId();
|
|
2540
|
+
const field = useFieldContext();
|
|
2220
2541
|
const context = createMemo(() => ({
|
|
2221
2542
|
id,
|
|
2543
|
+
ids: {
|
|
2544
|
+
label: field?.().ids.label,
|
|
2545
|
+
hiddenInput: field?.().ids.control
|
|
2546
|
+
},
|
|
2222
2547
|
dir: locale().dir,
|
|
2548
|
+
disabled: field?.().disabled,
|
|
2549
|
+
required: field?.().required,
|
|
2223
2550
|
getRootNode: environment().getRootNode,
|
|
2224
2551
|
...props
|
|
2225
2552
|
}));
|
|
@@ -2230,7 +2557,7 @@ const useFileUpload = props => {
|
|
|
2230
2557
|
};
|
|
2231
2558
|
|
|
2232
2559
|
const FileUploadRoot = props => {
|
|
2233
|
-
const [fileUploadProps, localProps] = createSplitProps()(props, ['accept', 'allowDrop', 'capture', 'directory', 'disabled', 'id', 'ids', 'locale', 'maxFiles', 'maxFileSize', 'minFileSize', 'name', 'onFileAccept', 'onFileChange', 'onFileReject', 'translations', 'validate']);
|
|
2560
|
+
const [fileUploadProps, localProps] = createSplitProps()(props, ['accept', 'allowDrop', 'capture', 'directory', 'disabled', 'id', 'ids', 'locale', 'maxFiles', 'maxFileSize', 'minFileSize', 'name', 'onFileAccept', 'onFileChange', 'onFileReject', 'required', 'translations', 'validate']);
|
|
2234
2561
|
const fileUpload = useFileUpload(fileUploadProps);
|
|
2235
2562
|
const mergedProps = mergeProps$1(() => fileUpload().getRootProps(), localProps);
|
|
2236
2563
|
return createComponent(FileUploadProvider, {
|
|
@@ -2456,12 +2783,12 @@ const MenuCheckboxItem = props => {
|
|
|
2456
2783
|
});
|
|
2457
2784
|
const context = useMenuContext();
|
|
2458
2785
|
const mergedProps = mergeProps$1(() => context().getOptionItemProps(optionItemProps), localProps);
|
|
2459
|
-
const
|
|
2786
|
+
const optionItemState = createMemo(() => context().getItemState(optionItemProps));
|
|
2460
2787
|
return createComponent(MenuOptionItemPropsProvider, {
|
|
2461
2788
|
value: optionItemProps,
|
|
2462
2789
|
get children() {
|
|
2463
2790
|
return createComponent(MenuItemProvider, {
|
|
2464
|
-
value:
|
|
2791
|
+
value: optionItemState,
|
|
2465
2792
|
get children() {
|
|
2466
2793
|
return createComponent(ark.div, mergedProps);
|
|
2467
2794
|
}
|
|
@@ -2582,12 +2909,12 @@ const MenuRadioItem = props => {
|
|
|
2582
2909
|
})
|
|
2583
2910
|
}));
|
|
2584
2911
|
const mergedProps = mergeProps$1(() => context().getOptionItemProps(optionItemProps), localProps);
|
|
2585
|
-
const
|
|
2912
|
+
const optionItemState = createMemo(() => context().getOptionItemState(optionItemProps));
|
|
2586
2913
|
return createComponent(MenuOptionItemPropsProvider, {
|
|
2587
2914
|
value: optionItemProps,
|
|
2588
2915
|
get children() {
|
|
2589
2916
|
return createComponent(MenuItemProvider, {
|
|
2590
|
-
value:
|
|
2917
|
+
value: optionItemState,
|
|
2591
2918
|
get children() {
|
|
2592
2919
|
return createComponent(ark.div, mergedProps);
|
|
2593
2920
|
}
|
|
@@ -2801,7 +3128,12 @@ const NumberInputIncrementTrigger = props => {
|
|
|
2801
3128
|
const NumberInputInput = props => {
|
|
2802
3129
|
const api = useNumberInputContext();
|
|
2803
3130
|
const mergedProps = mergeProps$1(() => api().getInputProps(), props);
|
|
2804
|
-
|
|
3131
|
+
const field = useFieldContext();
|
|
3132
|
+
return createComponent(ark.input, mergeProps({
|
|
3133
|
+
get ["aria-describedby"]() {
|
|
3134
|
+
return field?.().ariaDescribedby;
|
|
3135
|
+
}
|
|
3136
|
+
}, mergedProps));
|
|
2805
3137
|
};
|
|
2806
3138
|
|
|
2807
3139
|
const NumberInputLabel = props => {
|
|
@@ -2814,8 +3146,17 @@ const useNumberInput = props => {
|
|
|
2814
3146
|
const locale = useLocaleContext();
|
|
2815
3147
|
const environment = useEnvironmentContext();
|
|
2816
3148
|
const id = createUniqueId();
|
|
3149
|
+
const field = useFieldContext();
|
|
2817
3150
|
const context = createMemo(() => ({
|
|
2818
3151
|
id,
|
|
3152
|
+
ids: {
|
|
3153
|
+
label: field?.().ids.label,
|
|
3154
|
+
input: field?.().ids.control
|
|
3155
|
+
},
|
|
3156
|
+
disabled: field?.().disabled,
|
|
3157
|
+
readOnly: field?.().readOnly,
|
|
3158
|
+
required: field?.().required,
|
|
3159
|
+
invalid: field?.().invalid,
|
|
2819
3160
|
dir: locale().dir,
|
|
2820
3161
|
getRootNode: environment().getRootNode,
|
|
2821
3162
|
value: props.defaultValue,
|
|
@@ -2828,7 +3169,7 @@ const useNumberInput = props => {
|
|
|
2828
3169
|
};
|
|
2829
3170
|
|
|
2830
3171
|
const NumberInputRoot = props => {
|
|
2831
|
-
const [useNumberInputProps, localProps] = createSplitProps()(props, ['allowMouseWheel', 'allowOverflow', 'clampValueOnBlur', 'defaultValue', 'disabled', 'focusInputOnChange', 'form', 'formatOptions', 'id', 'ids', 'inputMode', 'invalid', 'locale', 'max', 'min', 'name', 'onFocusChange', 'onValueChange', 'onValueInvalid', 'pattern', 'readOnly', 'spinOnPress', 'step', 'translations', 'value']);
|
|
3172
|
+
const [useNumberInputProps, localProps] = createSplitProps()(props, ['allowMouseWheel', 'allowOverflow', 'clampValueOnBlur', 'defaultValue', 'disabled', 'focusInputOnChange', 'form', 'formatOptions', 'id', 'ids', 'inputMode', 'invalid', 'locale', 'max', 'min', 'name', 'onFocusChange', 'onValueChange', 'onValueInvalid', 'pattern', 'readOnly', 'required', 'spinOnPress', 'step', 'translations', 'value']);
|
|
2832
3173
|
const api = useNumberInput(useNumberInputProps);
|
|
2833
3174
|
const mergedProps = mergeProps$1(() => api().getRootProps(), localProps);
|
|
2834
3175
|
return createComponent(NumberInputProvider, {
|
|
@@ -2867,6 +3208,7 @@ var numberInput = /*#__PURE__*/Object.freeze({
|
|
|
2867
3208
|
Input: NumberInputInput,
|
|
2868
3209
|
Label: NumberInputLabel,
|
|
2869
3210
|
Root: NumberInputRoot,
|
|
3211
|
+
RootProvider: NumberInputRootProvider,
|
|
2870
3212
|
Scrubber: NumberInputScrubber
|
|
2871
3213
|
});
|
|
2872
3214
|
|
|
@@ -2972,7 +3314,12 @@ const PinInputControl = props => {
|
|
|
2972
3314
|
const PinInputHiddenInput = props => {
|
|
2973
3315
|
const pinInput = usePinInputContext();
|
|
2974
3316
|
const mergedProps = mergeProps$1(() => pinInput().getHiddenInputProps(), props);
|
|
2975
|
-
|
|
3317
|
+
const field = useFieldContext();
|
|
3318
|
+
return createComponent(ark.input, mergeProps({
|
|
3319
|
+
get ["aria-describedby"]() {
|
|
3320
|
+
return field?.().ariaDescribedby;
|
|
3321
|
+
}
|
|
3322
|
+
}, mergedProps));
|
|
2976
3323
|
};
|
|
2977
3324
|
|
|
2978
3325
|
const PinInputInput = props => {
|
|
@@ -2992,8 +3339,17 @@ const usePinInput = props => {
|
|
|
2992
3339
|
const locale = useLocaleContext();
|
|
2993
3340
|
const environment = useEnvironmentContext();
|
|
2994
3341
|
const id = createUniqueId();
|
|
3342
|
+
const field = useFieldContext();
|
|
2995
3343
|
const context = createMemo(() => ({
|
|
2996
3344
|
id,
|
|
3345
|
+
ids: {
|
|
3346
|
+
label: field?.().ids.label,
|
|
3347
|
+
hiddenInput: field?.().ids.control
|
|
3348
|
+
},
|
|
3349
|
+
disabled: field?.().disabled,
|
|
3350
|
+
readOnly: field?.().readOnly,
|
|
3351
|
+
required: field?.().required,
|
|
3352
|
+
invalid: field?.().invalid,
|
|
2997
3353
|
dir: locale().dir,
|
|
2998
3354
|
getRootNode: environment().getRootNode,
|
|
2999
3355
|
value: props.defaultValue,
|
|
@@ -3006,7 +3362,7 @@ const usePinInput = props => {
|
|
|
3006
3362
|
};
|
|
3007
3363
|
|
|
3008
3364
|
const PinInputRoot = props => {
|
|
3009
|
-
const [usePinInputProps, localProps] = createSplitProps()(props, ['autoFocus', 'blurOnComplete', 'defaultValue', 'disabled', 'form', 'id', 'ids', 'invalid', 'mask', 'name', 'onValueChange', 'onValueComplete', 'onValueInvalid', 'otp', 'pattern', 'placeholder', 'selectOnFocus', 'translations', 'type', 'value']);
|
|
3365
|
+
const [usePinInputProps, localProps] = createSplitProps()(props, ['autoFocus', 'blurOnComplete', 'defaultValue', 'disabled', 'form', 'id', 'ids', 'invalid', 'mask', 'name', 'onValueChange', 'onValueComplete', 'onValueInvalid', 'otp', 'pattern', 'placeholder', 'readOnly', 'required', 'selectOnFocus', 'translations', 'type', 'value']);
|
|
3010
3366
|
const pinInput = usePinInput(usePinInputProps);
|
|
3011
3367
|
const mergedProps = mergeProps$1(() => pinInput().getRootProps(), localProps);
|
|
3012
3368
|
return createComponent(PinInputProvider, {
|
|
@@ -3536,7 +3892,12 @@ const RatingGroupControl = props => {
|
|
|
3536
3892
|
const RatingGroupHiddenInput = props => {
|
|
3537
3893
|
const ratingGroup = useRatingGroupContext();
|
|
3538
3894
|
const mergedProps = mergeProps$1(() => ratingGroup().getHiddenInputProps(), props);
|
|
3539
|
-
|
|
3895
|
+
const field = useFieldContext();
|
|
3896
|
+
return createComponent(ark.input, mergeProps({
|
|
3897
|
+
get ["aria-describedby"]() {
|
|
3898
|
+
return field?.().ariaDescribedby;
|
|
3899
|
+
}
|
|
3900
|
+
}, mergedProps));
|
|
3540
3901
|
};
|
|
3541
3902
|
|
|
3542
3903
|
const [RatingGroupItemProvider, useRatingGroupItemContext] = createContext({
|
|
@@ -3569,8 +3930,16 @@ const useRatingGroup = props => {
|
|
|
3569
3930
|
const locale = useLocaleContext();
|
|
3570
3931
|
const environment = useEnvironmentContext();
|
|
3571
3932
|
const id = createUniqueId();
|
|
3933
|
+
const field = useFieldContext();
|
|
3572
3934
|
const context = createMemo(() => ({
|
|
3573
3935
|
id,
|
|
3936
|
+
ids: {
|
|
3937
|
+
label: field?.().ids.label,
|
|
3938
|
+
hiddenInput: field?.().ids.control
|
|
3939
|
+
},
|
|
3940
|
+
disabled: field?.().disabled,
|
|
3941
|
+
readOnly: field?.().readOnly,
|
|
3942
|
+
required: field?.().required,
|
|
3574
3943
|
dir: locale().dir,
|
|
3575
3944
|
getRootNode: environment().getRootNode,
|
|
3576
3945
|
value: props.defaultValue,
|
|
@@ -3583,7 +3952,7 @@ const useRatingGroup = props => {
|
|
|
3583
3952
|
};
|
|
3584
3953
|
|
|
3585
3954
|
const RatingGroupRoot = props => {
|
|
3586
|
-
const [useRatingProps, localProps] = createSplitProps()(props, ['allowHalf', 'autoFocus', 'count', 'defaultValue', 'disabled', 'form', 'id', 'ids', 'name', 'onHoverChange', 'onValueChange', 'readOnly', 'translations', 'value']);
|
|
3955
|
+
const [useRatingProps, localProps] = createSplitProps()(props, ['allowHalf', 'autoFocus', 'count', 'defaultValue', 'disabled', 'form', 'id', 'ids', 'name', 'onHoverChange', 'onValueChange', 'readOnly', 'required', 'translations', 'value']);
|
|
3587
3956
|
const api = useRatingGroup(useRatingProps);
|
|
3588
3957
|
const mergedProps = mergeProps$1(() => api().getRootProps(), localProps);
|
|
3589
3958
|
return createComponent(RatingGroupProvider, {
|
|
@@ -3615,7 +3984,8 @@ var ratingGroup = /*#__PURE__*/Object.freeze({
|
|
|
3615
3984
|
Item: RatingGroupItem,
|
|
3616
3985
|
ItemContext: RatingGroupItemContext,
|
|
3617
3986
|
Label: RatingGroupLabel,
|
|
3618
|
-
Root: RatingGroupRoot
|
|
3987
|
+
Root: RatingGroupRoot,
|
|
3988
|
+
RootProvider: RatingGroupRootProvider
|
|
3619
3989
|
});
|
|
3620
3990
|
|
|
3621
3991
|
const [SegmentGroupProvider, useSegmentGroupContext] = createContext({
|
|
@@ -3740,7 +4110,8 @@ var segmentGroup = /*#__PURE__*/Object.freeze({
|
|
|
3740
4110
|
ItemHiddenInput: SegmentGroupItemHiddenInput,
|
|
3741
4111
|
ItemText: SegmentGroupItemText,
|
|
3742
4112
|
Label: SegmentGroupLabel,
|
|
3743
|
-
Root: SegmentGroupRoot
|
|
4113
|
+
Root: SegmentGroupRoot,
|
|
4114
|
+
RootProvider: SegmentGroupRootProvider
|
|
3744
4115
|
});
|
|
3745
4116
|
|
|
3746
4117
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
@@ -3781,9 +4152,14 @@ var _tmpl$$2 = /*#__PURE__*/template(`<option value="">`),
|
|
|
3781
4152
|
_tmpl$2$1 = /*#__PURE__*/template(`<option>`);
|
|
3782
4153
|
const SelectHiddenSelect = props => {
|
|
3783
4154
|
const select = useSelectContext();
|
|
3784
|
-
const mergedProps = mergeProps$1(() => select().
|
|
4155
|
+
const mergedProps = mergeProps$1(() => select().getHiddenSelectProps(), props);
|
|
3785
4156
|
const isValueEmpty = createMemo(() => select().value.length === 0);
|
|
3786
|
-
|
|
4157
|
+
const field = useFieldContext();
|
|
4158
|
+
return createComponent(ark.select, mergeProps({
|
|
4159
|
+
get ["aria-describedby"]() {
|
|
4160
|
+
return field?.().ariaDescribedby;
|
|
4161
|
+
}
|
|
4162
|
+
}, mergedProps, {
|
|
3787
4163
|
get children() {
|
|
3788
4164
|
return [createComponent(Show, {
|
|
3789
4165
|
get when() {
|
|
@@ -3914,12 +4290,23 @@ const SelectPositioner = props => {
|
|
|
3914
4290
|
|
|
3915
4291
|
const useSelect = props => {
|
|
3916
4292
|
const [collectionOptions, selectProps] = createSplitProps()(props, ['isItemDisabled', 'itemToValue', 'itemToString', 'items']);
|
|
3917
|
-
const collection = () => select$1.collection(
|
|
4293
|
+
const collection = () => select$1.collection({
|
|
4294
|
+
...collectionOptions
|
|
4295
|
+
});
|
|
3918
4296
|
const locale = useLocaleContext();
|
|
3919
4297
|
const environment = useEnvironmentContext();
|
|
3920
4298
|
const id = createUniqueId();
|
|
4299
|
+
const field = useFieldContext();
|
|
3921
4300
|
const context = createMemo(() => ({
|
|
3922
4301
|
id,
|
|
4302
|
+
ids: {
|
|
4303
|
+
label: field?.().ids.label,
|
|
4304
|
+
hiddenSelect: field?.().ids.control
|
|
4305
|
+
},
|
|
4306
|
+
disabled: field?.().disabled,
|
|
4307
|
+
readOnly: field?.().readOnly,
|
|
4308
|
+
invalid: field?.().invalid,
|
|
4309
|
+
required: field?.().required,
|
|
3923
4310
|
collection: collection(),
|
|
3924
4311
|
dir: locale().dir,
|
|
3925
4312
|
getRootNode: environment().getRootNode,
|
|
@@ -3936,7 +4323,7 @@ const useSelect = props => {
|
|
|
3936
4323
|
|
|
3937
4324
|
const SelectRoot = props => {
|
|
3938
4325
|
const [presenceProps, selectProps] = splitPresenceProps(props);
|
|
3939
|
-
const [useSelectProps, localProps] = createSplitProps()(selectProps, ['closeOnSelect', 'composite', 'defaultOpen', 'defaultValue', 'disabled', 'form', 'highlightedValue', 'id', 'ids', 'invalid', 'isItemDisabled', 'items', 'itemToString', 'itemToValue', 'loopFocus', 'multiple', 'name', 'onFocusOutside', 'onHighlightChange', 'onInteractOutside', 'onOpenChange', 'onPointerDownOutside', 'onValueChange', 'open', 'positioning', 'readOnly', 'scrollToIndexFn', 'value']);
|
|
4326
|
+
const [useSelectProps, localProps] = createSplitProps()(selectProps, ['closeOnSelect', 'composite', 'defaultOpen', 'defaultValue', 'disabled', 'form', 'highlightedValue', 'id', 'ids', 'invalid', 'isItemDisabled', 'items', 'itemToString', 'itemToValue', 'loopFocus', 'multiple', 'name', 'onFocusOutside', 'onHighlightChange', 'onInteractOutside', 'onOpenChange', 'onPointerDownOutside', 'onValueChange', 'open', 'positioning', 'readOnly', 'required', 'scrollToIndexFn', 'value']);
|
|
3940
4327
|
const select = useSelect(useSelectProps);
|
|
3941
4328
|
const presenceApi = usePresence(mergeProps$1(() => ({
|
|
3942
4329
|
present: select().open
|
|
@@ -4032,9 +4419,7 @@ const SignaturePadContext = props => props.children(useSignaturePadContext());
|
|
|
4032
4419
|
const SignaturePadControl = props => {
|
|
4033
4420
|
const signaturePad = useSignaturePadContext();
|
|
4034
4421
|
const mergedProps = mergeProps$1(() => signaturePad().getControlProps(), props);
|
|
4035
|
-
return createComponent(ark.div,
|
|
4036
|
-
role: "application"
|
|
4037
|
-
}, mergedProps));
|
|
4422
|
+
return createComponent(ark.div, mergedProps);
|
|
4038
4423
|
};
|
|
4039
4424
|
|
|
4040
4425
|
const SignaturePadGuide = props => {
|
|
@@ -4049,1675 +4434,44 @@ const SignaturePadLabel = props => {
|
|
|
4049
4434
|
return createComponent(ark.label, mergedProps);
|
|
4050
4435
|
};
|
|
4051
4436
|
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
extendWith: (...values) => createAnatomy(name, [...parts, ...values]),
|
|
4061
|
-
rename: (newName) => createAnatomy(newName, parts),
|
|
4062
|
-
keys: () => parts,
|
|
4063
|
-
build: () => [...new Set(parts)].reduce(
|
|
4064
|
-
(prev, part) => Object.assign(prev, {
|
|
4065
|
-
[part]: {
|
|
4066
|
-
selector: [
|
|
4067
|
-
`&[data-scope="${toKebabCase(name)}"][data-part="${toKebabCase(part)}"]`,
|
|
4068
|
-
`& [data-scope="${toKebabCase(name)}"][data-part="${toKebabCase(part)}"]`
|
|
4069
|
-
].join(", "),
|
|
4070
|
-
attrs: { "data-scope": toKebabCase(name), "data-part": toKebabCase(part) }
|
|
4071
|
-
}
|
|
4072
|
-
}),
|
|
4073
|
-
{}
|
|
4074
|
-
)
|
|
4075
|
-
});
|
|
4076
|
-
var toKebabCase = (value) => value.replace(/([A-Z])([A-Z])/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
4077
|
-
var isEmpty = (v) => v.length === 0;
|
|
4078
|
-
|
|
4079
|
-
// src/index.ts
|
|
4080
|
-
var state = "default";
|
|
4081
|
-
var userSelect = "";
|
|
4082
|
-
var elementMap = /* @__PURE__ */ new WeakMap();
|
|
4083
|
-
function disableTextSelectionImpl(options = {}) {
|
|
4084
|
-
const { target, doc } = options;
|
|
4085
|
-
const docNode = doc ?? document;
|
|
4086
|
-
const rootEl = docNode.documentElement;
|
|
4087
|
-
if (isIos()) {
|
|
4088
|
-
if (state === "default") {
|
|
4089
|
-
userSelect = rootEl.style.webkitUserSelect;
|
|
4090
|
-
rootEl.style.webkitUserSelect = "none";
|
|
4091
|
-
}
|
|
4092
|
-
state = "disabled";
|
|
4093
|
-
} else if (target) {
|
|
4094
|
-
elementMap.set(target, target.style.userSelect);
|
|
4095
|
-
target.style.userSelect = "none";
|
|
4096
|
-
}
|
|
4097
|
-
return () => restoreTextSelection({ target, doc: docNode });
|
|
4098
|
-
}
|
|
4099
|
-
function restoreTextSelection(options = {}) {
|
|
4100
|
-
const { target, doc } = options;
|
|
4101
|
-
const docNode = doc ?? document;
|
|
4102
|
-
const rootEl = docNode.documentElement;
|
|
4103
|
-
if (isIos()) {
|
|
4104
|
-
if (state !== "disabled") return;
|
|
4105
|
-
state = "restoring";
|
|
4106
|
-
setTimeout(() => {
|
|
4107
|
-
nextTick(() => {
|
|
4108
|
-
if (state === "restoring") {
|
|
4109
|
-
if (rootEl.style.webkitUserSelect === "none") {
|
|
4110
|
-
rootEl.style.webkitUserSelect = userSelect || "";
|
|
4111
|
-
}
|
|
4112
|
-
userSelect = "";
|
|
4113
|
-
state = "default";
|
|
4114
|
-
}
|
|
4115
|
-
});
|
|
4116
|
-
}, 300);
|
|
4117
|
-
} else {
|
|
4118
|
-
if (target && elementMap.has(target)) {
|
|
4119
|
-
const prevUserSelect = elementMap.get(target);
|
|
4120
|
-
if (target.style.userSelect === "none") {
|
|
4121
|
-
target.style.userSelect = prevUserSelect ?? "";
|
|
4122
|
-
}
|
|
4123
|
-
if (target.getAttribute("style") === "") {
|
|
4124
|
-
target.removeAttribute("style");
|
|
4125
|
-
}
|
|
4126
|
-
elementMap.delete(target);
|
|
4127
|
-
}
|
|
4128
|
-
}
|
|
4129
|
-
}
|
|
4130
|
-
function disableTextSelection(options = {}) {
|
|
4131
|
-
const { defer, target, ...restOptions } = options;
|
|
4132
|
-
const func = defer ? raf : (v) => v();
|
|
4133
|
-
const cleanups = [];
|
|
4134
|
-
cleanups.push(
|
|
4135
|
-
func(() => {
|
|
4136
|
-
const node = typeof target === "function" ? target() : target;
|
|
4137
|
-
cleanups.push(disableTextSelectionImpl({ ...restOptions, target: node }));
|
|
4138
|
-
})
|
|
4139
|
-
);
|
|
4140
|
-
return () => {
|
|
4141
|
-
cleanups.forEach((fn) => fn?.());
|
|
4142
|
-
};
|
|
4143
|
-
}
|
|
4144
|
-
|
|
4145
|
-
// src/add-dom-event.ts
|
|
4146
|
-
var addDomEvent = (target, eventName, handler, options) => {
|
|
4147
|
-
const node = typeof target === "function" ? target() : target;
|
|
4148
|
-
node?.addEventListener(eventName, handler, options);
|
|
4149
|
-
return () => {
|
|
4150
|
-
node?.removeEventListener(eventName, handler, options);
|
|
4151
|
-
};
|
|
4152
|
-
};
|
|
4153
|
-
var isLeftClick = (e) => e.button === 0;
|
|
4154
|
-
var isModifierKey = (e) => e.ctrlKey || e.altKey || e.metaKey;
|
|
4155
|
-
|
|
4156
|
-
// src/get-event-point.ts
|
|
4157
|
-
function pointFromTouch(e, type = "client") {
|
|
4158
|
-
const point = e.touches[0] || e.changedTouches[0];
|
|
4159
|
-
return { x: point[`${type}X`], y: point[`${type}Y`] };
|
|
4160
|
-
}
|
|
4161
|
-
function pointFromMouse(point, type = "client") {
|
|
4162
|
-
return { x: point[`${type}X`], y: point[`${type}Y`] };
|
|
4163
|
-
}
|
|
4164
|
-
var isTouchEvent = (event) => "touches" in event && event.touches.length > 0;
|
|
4165
|
-
function getEventPoint(event, type = "client") {
|
|
4166
|
-
return isTouchEvent(event) ? pointFromTouch(event, type) : pointFromMouse(event, type);
|
|
4167
|
-
}
|
|
4168
|
-
|
|
4169
|
-
// src/get-point-value.ts
|
|
4170
|
-
function clamp(value) {
|
|
4171
|
-
return Math.max(0, Math.min(1, value));
|
|
4172
|
-
}
|
|
4173
|
-
function getRelativePoint(point, element) {
|
|
4174
|
-
const { left, top, width, height } = element.getBoundingClientRect();
|
|
4175
|
-
const offset = { x: point.x - left, y: point.y - top };
|
|
4176
|
-
const percent = { x: clamp(offset.x / width), y: clamp(offset.y / height) };
|
|
4177
|
-
function getPercentValue(options = {}) {
|
|
4178
|
-
const { dir = "ltr", orientation = "horizontal", inverted } = options;
|
|
4179
|
-
const invertX = typeof inverted === "object" ? inverted.x : inverted;
|
|
4180
|
-
const invertY = typeof inverted === "object" ? inverted.y : inverted;
|
|
4181
|
-
if (orientation === "horizontal") {
|
|
4182
|
-
return dir === "rtl" || invertX ? 1 - percent.x : percent.x;
|
|
4183
|
-
}
|
|
4184
|
-
return invertY ? 1 - percent.y : percent.y;
|
|
4185
|
-
}
|
|
4186
|
-
return { offset, percent, getPercentValue };
|
|
4187
|
-
}
|
|
4188
|
-
function trackPointerMove(doc, handlers) {
|
|
4189
|
-
const { onPointerMove, onPointerUp } = handlers;
|
|
4190
|
-
const history = [];
|
|
4191
|
-
const handleMove = (event) => {
|
|
4192
|
-
const point = getEventPoint(event);
|
|
4193
|
-
history.push({ ...point, timestamp: performance.now() });
|
|
4194
|
-
const distance = Math.sqrt(point.x ** 2 + point.y ** 2);
|
|
4195
|
-
const moveBuffer = event.pointerType === "touch" ? 10 : 5;
|
|
4196
|
-
if (distance < moveBuffer) return;
|
|
4197
|
-
if (event.pointerType === "mouse" && event.button === 0) {
|
|
4198
|
-
onPointerUp();
|
|
4199
|
-
return;
|
|
4200
|
-
}
|
|
4201
|
-
onPointerMove({ point, event, velocity: getVelocity(history, 0.1) });
|
|
4202
|
-
};
|
|
4203
|
-
const cleanups = [
|
|
4204
|
-
addDomEvent(doc, "pointermove", handleMove, false),
|
|
4205
|
-
addDomEvent(doc, "pointerup", onPointerUp, false),
|
|
4206
|
-
addDomEvent(doc, "pointercancel", onPointerUp, false),
|
|
4207
|
-
addDomEvent(doc, "contextmenu", onPointerUp, false),
|
|
4208
|
-
disableTextSelection({ doc })
|
|
4209
|
-
];
|
|
4210
|
-
return () => {
|
|
4211
|
-
cleanups.forEach((cleanup) => cleanup());
|
|
4212
|
-
history.length = 0;
|
|
4213
|
-
};
|
|
4214
|
-
}
|
|
4215
|
-
function lastDevicePoint(history) {
|
|
4216
|
-
return history[history.length - 1];
|
|
4217
|
-
}
|
|
4218
|
-
function ms(seconds) {
|
|
4219
|
-
return seconds * 1e3;
|
|
4220
|
-
}
|
|
4221
|
-
function sec(milliseconds) {
|
|
4222
|
-
return milliseconds / 1e3;
|
|
4223
|
-
}
|
|
4224
|
-
function getVelocity(history, timeDelta) {
|
|
4225
|
-
if (history.length < 2) return { x: 0, y: 0 };
|
|
4226
|
-
let i = history.length - 1;
|
|
4227
|
-
let timestampedPoint = null;
|
|
4228
|
-
const lastPoint = lastDevicePoint(history);
|
|
4229
|
-
while (i >= 0) {
|
|
4230
|
-
timestampedPoint = history[i];
|
|
4231
|
-
if (lastPoint.timestamp - timestampedPoint.timestamp > ms(timeDelta)) {
|
|
4232
|
-
break;
|
|
4233
|
-
}
|
|
4234
|
-
i--;
|
|
4235
|
-
}
|
|
4236
|
-
if (!timestampedPoint) return { x: 0, y: 0 };
|
|
4237
|
-
const time = sec(lastPoint.timestamp - timestampedPoint.timestamp);
|
|
4238
|
-
if (time === 0) return { x: 0, y: 0 };
|
|
4239
|
-
const currentVelocity = {
|
|
4240
|
-
x: (lastPoint.x - timestampedPoint.x) / time,
|
|
4241
|
-
y: (lastPoint.y - timestampedPoint.y) / time
|
|
4242
|
-
};
|
|
4243
|
-
if (currentVelocity.x === Infinity) currentVelocity.x = 0;
|
|
4244
|
-
if (currentVelocity.y === Infinity) currentVelocity.y = 0;
|
|
4245
|
-
return {
|
|
4246
|
-
x: Math.abs(currentVelocity.x),
|
|
4247
|
-
y: Math.abs(currentVelocity.y)
|
|
4248
|
-
};
|
|
4249
|
-
}
|
|
4250
|
-
|
|
4251
|
-
/* eslint @typescript-eslint/no-explicit-any: off */
|
|
4252
|
-
// symbols
|
|
4253
|
-
const GET_ORIGINAL_SYMBOL = Symbol();
|
|
4254
|
-
// get object prototype
|
|
4255
|
-
const getProto = Object.getPrototypeOf;
|
|
4256
|
-
const objectsToTrack = new WeakMap();
|
|
4257
|
-
// check if obj is a plain object or an array
|
|
4258
|
-
const isObjectToTrack = obj => obj && (objectsToTrack.has(obj) ? objectsToTrack.get(obj) : getProto(obj) === Object.prototype || getProto(obj) === Array.prototype);
|
|
4259
|
-
/**
|
|
4260
|
-
* Unwrap proxy to get the original object.
|
|
4261
|
-
*
|
|
4262
|
-
* Used to retrieve the original object used to create the proxy instance with `createProxy`.
|
|
4263
|
-
*
|
|
4264
|
-
* @param {Proxy<object>} obj - The proxy wrapper of the originial object.
|
|
4265
|
-
* @returns {object | null} - Return either the unwrapped object if exists.
|
|
4266
|
-
*
|
|
4267
|
-
* @example
|
|
4268
|
-
* import { createProxy, getUntracked } from 'proxy-compare';
|
|
4269
|
-
*
|
|
4270
|
-
* const original = { a: "1", c: "2", d: { e: "3" } };
|
|
4271
|
-
* const affected = new WeakMap();
|
|
4272
|
-
*
|
|
4273
|
-
* const proxy = createProxy(original, affected);
|
|
4274
|
-
* const originalFromProxy = getUntracked(proxy)
|
|
4275
|
-
*
|
|
4276
|
-
* Object.is(original, originalFromProxy) // true
|
|
4277
|
-
* isChanged(original, originalFromProxy, affected) // false
|
|
4278
|
-
*/
|
|
4279
|
-
const getUntracked = obj => {
|
|
4280
|
-
if (isObjectToTrack(obj)) {
|
|
4281
|
-
return obj[GET_ORIGINAL_SYMBOL] || null;
|
|
4282
|
-
}
|
|
4283
|
-
return null;
|
|
4284
|
-
};
|
|
4285
|
-
/**
|
|
4286
|
-
* Mark object to be tracked.
|
|
4287
|
-
*
|
|
4288
|
-
* This function marks an object that will be passed into `createProxy`
|
|
4289
|
-
* as marked to track or not. By default only Array and Object are marked to track,
|
|
4290
|
-
* so this is useful for example to mark a class instance to track or to mark a object
|
|
4291
|
-
* to be untracked when creating your proxy.
|
|
4292
|
-
*
|
|
4293
|
-
* @param obj - Object to mark as tracked or not.
|
|
4294
|
-
* @param mark - Boolean indicating whether you want to track this object or not.
|
|
4295
|
-
* @returns - No return.
|
|
4296
|
-
*
|
|
4297
|
-
* @example
|
|
4298
|
-
* import { createProxy, markToTrack, isChanged } from 'proxy-compare';
|
|
4299
|
-
*
|
|
4300
|
-
* const nested = { e: "3" }
|
|
4301
|
-
*
|
|
4302
|
-
* markToTrack(nested, false)
|
|
4303
|
-
*
|
|
4304
|
-
* const original = { a: "1", c: "2", d: nested };
|
|
4305
|
-
* const affected = new WeakMap();
|
|
4306
|
-
*
|
|
4307
|
-
* const proxy = createProxy(original, affected);
|
|
4308
|
-
*
|
|
4309
|
-
* proxy.d.e
|
|
4310
|
-
*
|
|
4311
|
-
* isChanged(original, { d: { e: "3" } }, affected) // true
|
|
4312
|
-
*/
|
|
4313
|
-
const markToTrack = (obj, mark = true) => {
|
|
4314
|
-
objectsToTrack.set(obj, mark);
|
|
4315
|
-
};
|
|
4316
|
-
|
|
4317
|
-
// src/global.ts
|
|
4318
|
-
function getGlobal() {
|
|
4319
|
-
if (typeof globalThis !== "undefined") return globalThis;
|
|
4320
|
-
if (typeof self !== "undefined") return self;
|
|
4321
|
-
if (typeof window !== "undefined") return window;
|
|
4322
|
-
if (typeof global !== "undefined") return global;
|
|
4323
|
-
}
|
|
4324
|
-
function makeGlobal(key, value) {
|
|
4325
|
-
const g = getGlobal();
|
|
4326
|
-
if (!g) return value();
|
|
4327
|
-
g[key] || (g[key] = value());
|
|
4328
|
-
return g[key];
|
|
4329
|
-
}
|
|
4330
|
-
var isDev$1 = process.env.NODE_ENV !== "production";
|
|
4331
|
-
var isObject$1 = (x) => typeof x === "object" && x !== null;
|
|
4332
|
-
var proxyStateMap = makeGlobal("__zag__proxyStateMap", () => /* @__PURE__ */ new WeakMap());
|
|
4333
|
-
var refSet = makeGlobal("__zag__refSet", () => /* @__PURE__ */ new WeakSet());
|
|
4334
|
-
var buildProxyFunction = (objectIs = Object.is, newProxy = (target, handler) => new Proxy(target, handler), canProxy = (x) => isObject$1(x) && !refSet.has(x) && (Array.isArray(x) || !(Symbol.iterator in x)) && !(x instanceof WeakMap) && !(x instanceof WeakSet) && !(x instanceof Error) && !(x instanceof Number) && !(x instanceof Date) && !(x instanceof String) && !(x instanceof RegExp) && !(x instanceof ArrayBuffer), defaultHandlePromise = (promise) => {
|
|
4335
|
-
switch (promise.status) {
|
|
4336
|
-
case "fulfilled":
|
|
4337
|
-
return promise.value;
|
|
4338
|
-
case "rejected":
|
|
4339
|
-
throw promise.reason;
|
|
4340
|
-
default:
|
|
4341
|
-
throw promise;
|
|
4342
|
-
}
|
|
4343
|
-
}, snapCache = /* @__PURE__ */ new WeakMap(), createSnapshot = (target, version, handlePromise = defaultHandlePromise) => {
|
|
4344
|
-
const cache = snapCache.get(target);
|
|
4345
|
-
if (cache?.[0] === version) {
|
|
4346
|
-
return cache[1];
|
|
4347
|
-
}
|
|
4348
|
-
const snap = Array.isArray(target) ? [] : Object.create(Object.getPrototypeOf(target));
|
|
4349
|
-
markToTrack(snap, true);
|
|
4350
|
-
snapCache.set(target, [version, snap]);
|
|
4351
|
-
Reflect.ownKeys(target).forEach((key) => {
|
|
4352
|
-
const value = Reflect.get(target, key);
|
|
4353
|
-
if (refSet.has(value)) {
|
|
4354
|
-
markToTrack(value, false);
|
|
4355
|
-
snap[key] = value;
|
|
4356
|
-
} else if (value instanceof Promise) {
|
|
4357
|
-
Object.defineProperty(snap, key, {
|
|
4358
|
-
get() {
|
|
4359
|
-
return handlePromise(value);
|
|
4360
|
-
}
|
|
4361
|
-
});
|
|
4362
|
-
} else if (proxyStateMap.has(value)) {
|
|
4363
|
-
snap[key] = snapshot(value, handlePromise);
|
|
4364
|
-
} else {
|
|
4365
|
-
snap[key] = value;
|
|
4366
|
-
}
|
|
4367
|
-
});
|
|
4368
|
-
return Object.freeze(snap);
|
|
4369
|
-
}, proxyCache = /* @__PURE__ */ new WeakMap(), versionHolder = [1, 1], proxyFunction2 = (initialObject) => {
|
|
4370
|
-
if (!isObject$1(initialObject)) {
|
|
4371
|
-
throw new Error("object required");
|
|
4372
|
-
}
|
|
4373
|
-
const found = proxyCache.get(initialObject);
|
|
4374
|
-
if (found) {
|
|
4375
|
-
return found;
|
|
4376
|
-
}
|
|
4377
|
-
let version = versionHolder[0];
|
|
4378
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
4379
|
-
const notifyUpdate = (op, nextVersion = ++versionHolder[0]) => {
|
|
4380
|
-
if (version !== nextVersion) {
|
|
4381
|
-
version = nextVersion;
|
|
4382
|
-
listeners.forEach((listener) => listener(op, nextVersion));
|
|
4383
|
-
}
|
|
4384
|
-
};
|
|
4385
|
-
let checkVersion = versionHolder[1];
|
|
4386
|
-
const ensureVersion = (nextCheckVersion = ++versionHolder[1]) => {
|
|
4387
|
-
if (checkVersion !== nextCheckVersion && !listeners.size) {
|
|
4388
|
-
checkVersion = nextCheckVersion;
|
|
4389
|
-
propProxyStates.forEach(([propProxyState]) => {
|
|
4390
|
-
const propVersion = propProxyState[1](nextCheckVersion);
|
|
4391
|
-
if (propVersion > version) {
|
|
4392
|
-
version = propVersion;
|
|
4393
|
-
}
|
|
4394
|
-
});
|
|
4395
|
-
}
|
|
4396
|
-
return version;
|
|
4397
|
-
};
|
|
4398
|
-
const createPropListener = (prop) => (op, nextVersion) => {
|
|
4399
|
-
const newOp = [...op];
|
|
4400
|
-
newOp[1] = [prop, ...newOp[1]];
|
|
4401
|
-
notifyUpdate(newOp, nextVersion);
|
|
4402
|
-
};
|
|
4403
|
-
const propProxyStates = /* @__PURE__ */ new Map();
|
|
4404
|
-
const addPropListener = (prop, propProxyState) => {
|
|
4405
|
-
if (isDev$1 && propProxyStates.has(prop)) {
|
|
4406
|
-
throw new Error("prop listener already exists");
|
|
4407
|
-
}
|
|
4408
|
-
if (listeners.size) {
|
|
4409
|
-
const remove = propProxyState[3](createPropListener(prop));
|
|
4410
|
-
propProxyStates.set(prop, [propProxyState, remove]);
|
|
4411
|
-
} else {
|
|
4412
|
-
propProxyStates.set(prop, [propProxyState]);
|
|
4413
|
-
}
|
|
4414
|
-
};
|
|
4415
|
-
const removePropListener = (prop) => {
|
|
4416
|
-
const entry = propProxyStates.get(prop);
|
|
4417
|
-
if (entry) {
|
|
4418
|
-
propProxyStates.delete(prop);
|
|
4419
|
-
entry[1]?.();
|
|
4420
|
-
}
|
|
4421
|
-
};
|
|
4422
|
-
const addListener = (listener) => {
|
|
4423
|
-
listeners.add(listener);
|
|
4424
|
-
if (listeners.size === 1) {
|
|
4425
|
-
propProxyStates.forEach(([propProxyState, prevRemove], prop) => {
|
|
4426
|
-
if (isDev$1 && prevRemove) {
|
|
4427
|
-
throw new Error("remove already exists");
|
|
4428
|
-
}
|
|
4429
|
-
const remove = propProxyState[3](createPropListener(prop));
|
|
4430
|
-
propProxyStates.set(prop, [propProxyState, remove]);
|
|
4431
|
-
});
|
|
4432
|
-
}
|
|
4433
|
-
const removeListener = () => {
|
|
4434
|
-
listeners.delete(listener);
|
|
4435
|
-
if (listeners.size === 0) {
|
|
4436
|
-
propProxyStates.forEach(([propProxyState, remove], prop) => {
|
|
4437
|
-
if (remove) {
|
|
4438
|
-
remove();
|
|
4439
|
-
propProxyStates.set(prop, [propProxyState]);
|
|
4440
|
-
}
|
|
4441
|
-
});
|
|
4442
|
-
}
|
|
4443
|
-
};
|
|
4444
|
-
return removeListener;
|
|
4445
|
-
};
|
|
4446
|
-
const baseObject = Array.isArray(initialObject) ? [] : Object.create(Object.getPrototypeOf(initialObject));
|
|
4447
|
-
const handler = {
|
|
4448
|
-
deleteProperty(target, prop) {
|
|
4449
|
-
const prevValue = Reflect.get(target, prop);
|
|
4450
|
-
removePropListener(prop);
|
|
4451
|
-
const deleted = Reflect.deleteProperty(target, prop);
|
|
4452
|
-
if (deleted) {
|
|
4453
|
-
notifyUpdate(["delete", [prop], prevValue]);
|
|
4454
|
-
}
|
|
4455
|
-
return deleted;
|
|
4456
|
-
},
|
|
4457
|
-
set(target, prop, value, receiver) {
|
|
4458
|
-
const hasPrevValue = Reflect.has(target, prop);
|
|
4459
|
-
const prevValue = Reflect.get(target, prop, receiver);
|
|
4460
|
-
if (hasPrevValue && (objectIs(prevValue, value) || proxyCache.has(value) && objectIs(prevValue, proxyCache.get(value)))) {
|
|
4461
|
-
return true;
|
|
4462
|
-
}
|
|
4463
|
-
removePropListener(prop);
|
|
4464
|
-
if (isObject$1(value)) {
|
|
4465
|
-
value = getUntracked(value) || value;
|
|
4466
|
-
}
|
|
4467
|
-
let nextValue = value;
|
|
4468
|
-
if (Object.getOwnPropertyDescriptor(target, prop)?.set) ; else if (value instanceof Promise) {
|
|
4469
|
-
value.then((v) => {
|
|
4470
|
-
Object.assign(value, { status: "fulfilled", value: v });
|
|
4471
|
-
notifyUpdate(["resolve", [prop], v]);
|
|
4472
|
-
}).catch((e) => {
|
|
4473
|
-
Object.assign(value, { status: "rejected", reason: e });
|
|
4474
|
-
notifyUpdate(["reject", [prop], e]);
|
|
4475
|
-
});
|
|
4476
|
-
} else {
|
|
4477
|
-
if (!proxyStateMap.has(value) && canProxy(value)) {
|
|
4478
|
-
nextValue = proxy(value);
|
|
4479
|
-
}
|
|
4480
|
-
const childProxyState = !refSet.has(nextValue) && proxyStateMap.get(nextValue);
|
|
4481
|
-
if (childProxyState) {
|
|
4482
|
-
addPropListener(prop, childProxyState);
|
|
4483
|
-
}
|
|
4484
|
-
}
|
|
4485
|
-
Reflect.set(target, prop, nextValue, receiver);
|
|
4486
|
-
notifyUpdate(["set", [prop], value, prevValue]);
|
|
4487
|
-
return true;
|
|
4488
|
-
}
|
|
4489
|
-
};
|
|
4490
|
-
const proxyObject = newProxy(baseObject, handler);
|
|
4491
|
-
proxyCache.set(initialObject, proxyObject);
|
|
4492
|
-
const proxyState = [baseObject, ensureVersion, createSnapshot, addListener];
|
|
4493
|
-
proxyStateMap.set(proxyObject, proxyState);
|
|
4494
|
-
Reflect.ownKeys(initialObject).forEach((key) => {
|
|
4495
|
-
const desc = Object.getOwnPropertyDescriptor(initialObject, key);
|
|
4496
|
-
if (desc.get || desc.set) {
|
|
4497
|
-
Object.defineProperty(baseObject, key, desc);
|
|
4498
|
-
} else {
|
|
4499
|
-
proxyObject[key] = initialObject[key];
|
|
4500
|
-
}
|
|
4501
|
-
});
|
|
4502
|
-
return proxyObject;
|
|
4503
|
-
}) => [
|
|
4504
|
-
// public functions
|
|
4505
|
-
proxyFunction2,
|
|
4506
|
-
// shared state
|
|
4507
|
-
proxyStateMap,
|
|
4508
|
-
refSet,
|
|
4509
|
-
// internal things
|
|
4510
|
-
objectIs,
|
|
4511
|
-
newProxy,
|
|
4512
|
-
canProxy,
|
|
4513
|
-
defaultHandlePromise,
|
|
4514
|
-
snapCache,
|
|
4515
|
-
createSnapshot,
|
|
4516
|
-
proxyCache,
|
|
4517
|
-
versionHolder
|
|
4518
|
-
];
|
|
4519
|
-
var [proxyFunction] = buildProxyFunction();
|
|
4520
|
-
function proxy(initialObject = {}) {
|
|
4521
|
-
return proxyFunction(initialObject);
|
|
4522
|
-
}
|
|
4523
|
-
function subscribe(proxyObject, callback, notifyInSync) {
|
|
4524
|
-
const proxyState = proxyStateMap.get(proxyObject);
|
|
4525
|
-
if (isDev$1 && !proxyState) {
|
|
4526
|
-
console.warn("Please use proxy object");
|
|
4527
|
-
}
|
|
4528
|
-
let promise;
|
|
4529
|
-
const ops = [];
|
|
4530
|
-
const addListener = proxyState[3];
|
|
4531
|
-
let isListenerActive = false;
|
|
4532
|
-
const listener = (op) => {
|
|
4533
|
-
ops.push(op);
|
|
4534
|
-
if (notifyInSync) {
|
|
4535
|
-
callback(ops.splice(0));
|
|
4536
|
-
return;
|
|
4537
|
-
}
|
|
4538
|
-
if (!promise) {
|
|
4539
|
-
promise = Promise.resolve().then(() => {
|
|
4540
|
-
promise = void 0;
|
|
4541
|
-
if (isListenerActive) {
|
|
4542
|
-
callback(ops.splice(0));
|
|
4543
|
-
}
|
|
4544
|
-
});
|
|
4545
|
-
}
|
|
4546
|
-
};
|
|
4547
|
-
const removeListener = addListener(listener);
|
|
4548
|
-
isListenerActive = true;
|
|
4549
|
-
return () => {
|
|
4550
|
-
isListenerActive = false;
|
|
4551
|
-
removeListener();
|
|
4552
|
-
};
|
|
4553
|
-
}
|
|
4554
|
-
function snapshot(proxyObject, handlePromise) {
|
|
4555
|
-
const proxyState = proxyStateMap.get(proxyObject);
|
|
4556
|
-
if (isDev$1 && !proxyState) {
|
|
4557
|
-
console.warn("Please use proxy object");
|
|
4558
|
-
}
|
|
4559
|
-
const [target, ensureVersion, createSnapshot] = proxyState;
|
|
4560
|
-
return createSnapshot(target, ensureVersion(), handlePromise);
|
|
4561
|
-
}
|
|
4562
|
-
function ref(obj) {
|
|
4563
|
-
refSet.add(obj);
|
|
4564
|
-
return obj;
|
|
4565
|
-
}
|
|
4566
|
-
|
|
4567
|
-
// src/proxy-computed.ts
|
|
4568
|
-
function proxyWithComputed(initialObject, computedFns) {
|
|
4569
|
-
const keys = Object.keys(computedFns);
|
|
4570
|
-
keys.forEach((key) => {
|
|
4571
|
-
if (Object.getOwnPropertyDescriptor(initialObject, key)) {
|
|
4572
|
-
throw new Error("object property already defined");
|
|
4573
|
-
}
|
|
4574
|
-
const computedFn = computedFns[key];
|
|
4575
|
-
const { get, set } = typeof computedFn === "function" ? { get: computedFn } : computedFn;
|
|
4576
|
-
const desc = {};
|
|
4577
|
-
desc.get = () => get(snapshot(proxyObject));
|
|
4578
|
-
if (set) {
|
|
4579
|
-
desc.set = (newValue) => set(proxyObject, newValue);
|
|
4580
|
-
}
|
|
4581
|
-
Object.defineProperty(initialObject, key, desc);
|
|
4582
|
-
});
|
|
4583
|
-
const proxyObject = proxy(initialObject);
|
|
4584
|
-
return proxyObject;
|
|
4585
|
-
}
|
|
4586
|
-
|
|
4587
|
-
function set(obj, key, val) {
|
|
4588
|
-
if (typeof val.value === 'object') val.value = klona(val.value);
|
|
4589
|
-
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {
|
|
4590
|
-
Object.defineProperty(obj, key, val);
|
|
4591
|
-
} else obj[key] = val.value;
|
|
4592
|
-
}
|
|
4593
|
-
|
|
4594
|
-
function klona(x) {
|
|
4595
|
-
if (typeof x !== 'object') return x;
|
|
4596
|
-
|
|
4597
|
-
var i=0, k, list, tmp, str=Object.prototype.toString.call(x);
|
|
4598
|
-
|
|
4599
|
-
if (str === '[object Object]') {
|
|
4600
|
-
tmp = Object.create(x.__proto__ || null);
|
|
4601
|
-
} else if (str === '[object Array]') {
|
|
4602
|
-
tmp = Array(x.length);
|
|
4603
|
-
} else if (str === '[object Set]') {
|
|
4604
|
-
tmp = new Set;
|
|
4605
|
-
x.forEach(function (val) {
|
|
4606
|
-
tmp.add(klona(val));
|
|
4607
|
-
});
|
|
4608
|
-
} else if (str === '[object Map]') {
|
|
4609
|
-
tmp = new Map;
|
|
4610
|
-
x.forEach(function (val, key) {
|
|
4611
|
-
tmp.set(klona(key), klona(val));
|
|
4612
|
-
});
|
|
4613
|
-
} else if (str === '[object Date]') {
|
|
4614
|
-
tmp = new Date(+x);
|
|
4615
|
-
} else if (str === '[object RegExp]') {
|
|
4616
|
-
tmp = new RegExp(x.source, x.flags);
|
|
4617
|
-
} else if (str === '[object DataView]') {
|
|
4618
|
-
tmp = new x.constructor( klona(x.buffer) );
|
|
4619
|
-
} else if (str === '[object ArrayBuffer]') {
|
|
4620
|
-
tmp = x.slice(0);
|
|
4621
|
-
} else if (str.slice(-6) === 'Array]') {
|
|
4622
|
-
// ArrayBuffer.isView(x)
|
|
4623
|
-
// ~> `new` bcuz `Buffer.slice` => ref
|
|
4624
|
-
tmp = new x.constructor(x);
|
|
4625
|
-
}
|
|
4626
|
-
|
|
4627
|
-
if (tmp) {
|
|
4628
|
-
for (list=Object.getOwnPropertySymbols(x); i < list.length; i++) {
|
|
4629
|
-
set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
|
|
4630
|
-
}
|
|
4631
|
-
|
|
4632
|
-
for (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) {
|
|
4633
|
-
if (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue;
|
|
4634
|
-
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
|
4635
|
-
}
|
|
4636
|
-
}
|
|
4637
|
-
|
|
4638
|
-
return tmp || x;
|
|
4639
|
-
}
|
|
4640
|
-
|
|
4641
|
-
var __defProp = Object.defineProperty;
|
|
4642
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4643
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4644
|
-
|
|
4645
|
-
// ../utilities/core/src/array.ts
|
|
4646
|
-
function clear(v) {
|
|
4647
|
-
while (v.length > 0) v.pop();
|
|
4648
|
-
return v;
|
|
4649
|
-
}
|
|
4650
|
-
|
|
4651
|
-
// ../utilities/core/src/functions.ts
|
|
4652
|
-
var runIfFn = (v, ...a) => {
|
|
4653
|
-
const res = typeof v === "function" ? v(...a) : v;
|
|
4654
|
-
return res ?? void 0;
|
|
4655
|
-
};
|
|
4656
|
-
var cast = (v) => v;
|
|
4657
|
-
var noop = () => {
|
|
4658
|
-
};
|
|
4659
|
-
var uuid = /* @__PURE__ */ (() => {
|
|
4660
|
-
let id = 0;
|
|
4661
|
-
return () => {
|
|
4662
|
-
id++;
|
|
4663
|
-
return id.toString(36);
|
|
4664
|
-
};
|
|
4665
|
-
})();
|
|
4666
|
-
|
|
4667
|
-
// ../utilities/core/src/guard.ts
|
|
4668
|
-
var isDev = () => process.env.NODE_ENV !== "production";
|
|
4669
|
-
var isArray = (v) => Array.isArray(v);
|
|
4670
|
-
var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
|
|
4671
|
-
var isNumber = (v) => typeof v === "number" && !Number.isNaN(v);
|
|
4672
|
-
var isString = (v) => typeof v === "string";
|
|
4673
|
-
var isFunction = (v) => typeof v === "function";
|
|
4674
|
-
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
4675
|
-
|
|
4676
|
-
// ../utilities/core/src/object.ts
|
|
4677
|
-
function compact$1(obj) {
|
|
4678
|
-
if (!isPlainObject$1(obj) || obj === void 0) {
|
|
4679
|
-
return obj;
|
|
4680
|
-
}
|
|
4681
|
-
const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
|
|
4682
|
-
const filtered = {};
|
|
4683
|
-
for (const key of keys) {
|
|
4684
|
-
const value = obj[key];
|
|
4685
|
-
if (value !== void 0) {
|
|
4686
|
-
filtered[key] = compact$1(value);
|
|
4687
|
-
}
|
|
4688
|
-
}
|
|
4689
|
-
return filtered;
|
|
4690
|
-
}
|
|
4691
|
-
var isPlainObject$1 = (value) => {
|
|
4692
|
-
return value && typeof value === "object" && value.constructor === Object;
|
|
4693
|
-
};
|
|
4694
|
-
|
|
4695
|
-
// ../utilities/core/src/warning.ts
|
|
4696
|
-
function warn(...a) {
|
|
4697
|
-
const m = a.length === 1 ? a[0] : a[1];
|
|
4698
|
-
const c = a.length === 2 ? a[0] : true;
|
|
4699
|
-
if (c && process.env.NODE_ENV !== "production") {
|
|
4700
|
-
console.warn(m);
|
|
4701
|
-
}
|
|
4702
|
-
}
|
|
4703
|
-
function invariant(...a) {
|
|
4704
|
-
const m = a.length === 1 ? a[0] : a[1];
|
|
4705
|
-
const c = a.length === 2 ? a[0] : true;
|
|
4706
|
-
if (c && process.env.NODE_ENV !== "production") {
|
|
4707
|
-
throw new Error(m);
|
|
4708
|
-
}
|
|
4709
|
-
}
|
|
4710
|
-
|
|
4711
|
-
// src/deep-merge.ts
|
|
4712
|
-
function deepMerge(source, ...objects) {
|
|
4713
|
-
for (const obj of objects) {
|
|
4714
|
-
const target = compact$1(obj);
|
|
4715
|
-
for (const key in target) {
|
|
4716
|
-
if (isObject(obj[key])) {
|
|
4717
|
-
if (!source[key]) {
|
|
4718
|
-
source[key] = {};
|
|
4719
|
-
}
|
|
4720
|
-
deepMerge(source[key], obj[key]);
|
|
4721
|
-
} else {
|
|
4722
|
-
source[key] = obj[key];
|
|
4723
|
-
}
|
|
4724
|
-
}
|
|
4725
|
-
}
|
|
4726
|
-
return source;
|
|
4727
|
-
}
|
|
4728
|
-
function structuredClone(v) {
|
|
4729
|
-
return klona(v);
|
|
4730
|
-
}
|
|
4731
|
-
function toEvent(event) {
|
|
4732
|
-
const obj = isString(event) ? { type: event } : event;
|
|
4733
|
-
return obj;
|
|
4734
|
-
}
|
|
4735
|
-
function toArray(value) {
|
|
4736
|
-
if (!value) return [];
|
|
4737
|
-
return isArray(value) ? value.slice() : [value];
|
|
4738
|
-
}
|
|
4739
|
-
function isGuardHelper(value) {
|
|
4740
|
-
return isObject(value) && value.predicate != null;
|
|
4741
|
-
}
|
|
4742
|
-
|
|
4743
|
-
// src/guard-utils.ts
|
|
4744
|
-
var Truthy = () => true;
|
|
4745
|
-
function determineGuardFn(guard, guardMap) {
|
|
4746
|
-
guard = guard ?? Truthy;
|
|
4747
|
-
return (context, event, meta) => {
|
|
4748
|
-
if (isString(guard)) {
|
|
4749
|
-
const value = guardMap[guard];
|
|
4750
|
-
return isFunction(value) ? value(context, event, meta) : value;
|
|
4751
|
-
}
|
|
4752
|
-
if (isGuardHelper(guard)) {
|
|
4753
|
-
return guard.predicate(guardMap)(context, event, meta);
|
|
4754
|
-
}
|
|
4755
|
-
return guard?.(context, event, meta);
|
|
4756
|
-
};
|
|
4757
|
-
}
|
|
4758
|
-
function determineActionsFn(values, guardMap) {
|
|
4759
|
-
return (context, event, meta) => {
|
|
4760
|
-
if (isGuardHelper(values)) {
|
|
4761
|
-
return values.predicate(guardMap)(context, event, meta);
|
|
4762
|
-
}
|
|
4763
|
-
return values;
|
|
4764
|
-
};
|
|
4765
|
-
}
|
|
4766
|
-
function createProxy(config) {
|
|
4767
|
-
const computedContext = config.computed ?? cast({});
|
|
4768
|
-
const initialContext = config.context ?? cast({});
|
|
4769
|
-
const initialTags = config.initial ? config.states?.[config.initial]?.tags : [];
|
|
4770
|
-
const state = proxy({
|
|
4771
|
-
value: config.initial ?? "",
|
|
4772
|
-
previousValue: "",
|
|
4773
|
-
event: cast({}),
|
|
4774
|
-
previousEvent: cast({}),
|
|
4775
|
-
context: proxyWithComputed(initialContext, computedContext),
|
|
4776
|
-
done: false,
|
|
4777
|
-
tags: initialTags ?? [],
|
|
4778
|
-
hasTag(tag) {
|
|
4779
|
-
return this.tags.includes(tag);
|
|
4780
|
-
},
|
|
4781
|
-
matches(...value) {
|
|
4782
|
-
return value.includes(this.value);
|
|
4783
|
-
},
|
|
4784
|
-
can(event) {
|
|
4785
|
-
return cast(this).nextEvents.includes(event);
|
|
4786
|
-
},
|
|
4787
|
-
get nextEvents() {
|
|
4788
|
-
const stateEvents = config.states?.[this.value]?.["on"] ?? {};
|
|
4789
|
-
const globalEvents = config?.on ?? {};
|
|
4790
|
-
return Object.keys({ ...stateEvents, ...globalEvents });
|
|
4791
|
-
},
|
|
4792
|
-
get changed() {
|
|
4793
|
-
if (this.event.value === "machine.init" /* Init */ || !this.previousValue) return false;
|
|
4794
|
-
return this.value !== this.previousValue;
|
|
4795
|
-
}
|
|
4796
|
-
});
|
|
4797
|
-
return cast(state);
|
|
4798
|
-
}
|
|
4799
|
-
|
|
4800
|
-
// src/delay-utils.ts
|
|
4801
|
-
function determineDelayFn(delay, delaysMap) {
|
|
4802
|
-
return (context, event) => {
|
|
4803
|
-
if (isNumber(delay)) return delay;
|
|
4804
|
-
if (isFunction(delay)) {
|
|
4805
|
-
return delay(context, event);
|
|
4806
|
-
}
|
|
4807
|
-
if (isString(delay)) {
|
|
4808
|
-
const value = Number.parseFloat(delay);
|
|
4809
|
-
if (!Number.isNaN(value)) {
|
|
4810
|
-
return value;
|
|
4811
|
-
}
|
|
4812
|
-
if (delaysMap) {
|
|
4813
|
-
const valueOrFn = delaysMap?.[delay];
|
|
4814
|
-
invariant(
|
|
4815
|
-
valueOrFn == null,
|
|
4816
|
-
`[@zag-js/core > determine-delay] Cannot determine delay for \`${delay}\`. It doesn't exist in \`options.delays\``
|
|
4817
|
-
);
|
|
4818
|
-
return isFunction(valueOrFn) ? valueOrFn(context, event) : valueOrFn;
|
|
4819
|
-
}
|
|
4437
|
+
const SignaturePadHiddenInput = props => {
|
|
4438
|
+
const [hiddenInputProps, localProps] = createSplitProps()(props, ['value']);
|
|
4439
|
+
const signaturePad = useSignaturePadContext();
|
|
4440
|
+
const mergedProps = mergeProps$1(() => signaturePad().getHiddenInputProps(hiddenInputProps), localProps);
|
|
4441
|
+
const field = useFieldContext();
|
|
4442
|
+
return createComponent(ark.input, mergeProps({
|
|
4443
|
+
get ["aria-describedby"]() {
|
|
4444
|
+
return field?.().ariaDescribedby;
|
|
4820
4445
|
}
|
|
4821
|
-
};
|
|
4822
|
-
}
|
|
4823
|
-
|
|
4824
|
-
// src/transition-utils.ts
|
|
4825
|
-
function toTarget(target) {
|
|
4826
|
-
return isString(target) ? { target } : target;
|
|
4827
|
-
}
|
|
4828
|
-
function determineTransitionFn(transitions, guardMap) {
|
|
4829
|
-
return (context, event, meta) => {
|
|
4830
|
-
return toArray(transitions).map(toTarget).find((transition) => {
|
|
4831
|
-
const determineGuard = determineGuardFn(transition.guard, guardMap);
|
|
4832
|
-
const guard = determineGuard(context, event, meta);
|
|
4833
|
-
return guard ?? transition.target ?? transition.actions;
|
|
4834
|
-
});
|
|
4835
|
-
};
|
|
4836
|
-
}
|
|
4837
|
-
|
|
4838
|
-
// src/machine.ts
|
|
4839
|
-
var Machine = class {
|
|
4840
|
-
// Let's get started!
|
|
4841
|
-
constructor(config, options) {
|
|
4842
|
-
__publicField(this, "status", "Not Started" /* NotStarted */);
|
|
4843
|
-
__publicField(this, "state");
|
|
4844
|
-
__publicField(this, "initialState");
|
|
4845
|
-
__publicField(this, "initialContext");
|
|
4846
|
-
__publicField(this, "id");
|
|
4847
|
-
__publicField(this, "type", "machine" /* Machine */);
|
|
4848
|
-
// Cleanup function map (per state)
|
|
4849
|
-
__publicField(this, "activityEvents", /* @__PURE__ */ new Map());
|
|
4850
|
-
__publicField(this, "delayedEvents", /* @__PURE__ */ new Map());
|
|
4851
|
-
// state update listeners the user can opt-in for
|
|
4852
|
-
__publicField(this, "stateListeners", /* @__PURE__ */ new Set());
|
|
4853
|
-
__publicField(this, "doneListeners", /* @__PURE__ */ new Set());
|
|
4854
|
-
__publicField(this, "contextWatchers", /* @__PURE__ */ new Set());
|
|
4855
|
-
// Cleanup functions (for `subscribe`)
|
|
4856
|
-
__publicField(this, "removeStateListener", noop);
|
|
4857
|
-
// For Parent <==> Spawned Actor relationship
|
|
4858
|
-
__publicField(this, "parent");
|
|
4859
|
-
__publicField(this, "children", /* @__PURE__ */ new Map());
|
|
4860
|
-
// A map of guard, action, delay implementations
|
|
4861
|
-
__publicField(this, "guardMap");
|
|
4862
|
-
__publicField(this, "actionMap");
|
|
4863
|
-
__publicField(this, "delayMap");
|
|
4864
|
-
__publicField(this, "activityMap");
|
|
4865
|
-
__publicField(this, "sync");
|
|
4866
|
-
__publicField(this, "options");
|
|
4867
|
-
__publicField(this, "config");
|
|
4868
|
-
__publicField(this, "_created", () => {
|
|
4869
|
-
const event = toEvent("machine.created" /* Created */);
|
|
4870
|
-
this.executeActions(this.config?.created, event);
|
|
4871
|
-
});
|
|
4872
|
-
// Starts the interpreted machine.
|
|
4873
|
-
__publicField(this, "start", (init) => {
|
|
4874
|
-
this.state.value = "";
|
|
4875
|
-
this.state.tags = [];
|
|
4876
|
-
if (this.status === "Running" /* Running */) {
|
|
4877
|
-
return this;
|
|
4878
|
-
}
|
|
4879
|
-
this.status = "Running" /* Running */;
|
|
4880
|
-
this.removeStateListener = subscribe(
|
|
4881
|
-
this.state,
|
|
4882
|
-
() => {
|
|
4883
|
-
this.stateListeners.forEach((listener) => {
|
|
4884
|
-
listener(this.stateSnapshot);
|
|
4885
|
-
});
|
|
4886
|
-
},
|
|
4887
|
-
this.sync
|
|
4888
|
-
);
|
|
4889
|
-
this.setupContextWatchers();
|
|
4890
|
-
this.executeActivities(toEvent("machine.start" /* Start */), toArray(this.config.activities), "machine.start" /* Start */);
|
|
4891
|
-
this.executeActions(this.config.entry, toEvent("machine.start" /* Start */));
|
|
4892
|
-
const event = toEvent("machine.init" /* Init */);
|
|
4893
|
-
const target = isObject(init) ? init.value : init;
|
|
4894
|
-
const context = isObject(init) ? init.context : void 0;
|
|
4895
|
-
if (context) {
|
|
4896
|
-
this.setContext(context);
|
|
4897
|
-
}
|
|
4898
|
-
const transition = {
|
|
4899
|
-
target: target ?? this.config.initial
|
|
4900
|
-
};
|
|
4901
|
-
const next = this.getNextStateInfo(transition, event);
|
|
4902
|
-
this.initialState = next;
|
|
4903
|
-
this.performStateChangeEffects(this.state.value, next, event);
|
|
4904
|
-
return this;
|
|
4905
|
-
});
|
|
4906
|
-
__publicField(this, "setupContextWatchers", () => {
|
|
4907
|
-
const { watch } = this.config;
|
|
4908
|
-
if (!watch) return;
|
|
4909
|
-
let prev = snapshot(this.state.context);
|
|
4910
|
-
const cleanup = subscribe(this.state.context, () => {
|
|
4911
|
-
const next = snapshot(this.state.context);
|
|
4912
|
-
for (const [key, fn] of Object.entries(watch)) {
|
|
4913
|
-
const isEqual = this.options.compareFns?.[key] ?? Object.is;
|
|
4914
|
-
if (isEqual(prev[key], next[key])) continue;
|
|
4915
|
-
this.executeActions(fn, this.state.event);
|
|
4916
|
-
}
|
|
4917
|
-
prev = next;
|
|
4918
|
-
});
|
|
4919
|
-
this.contextWatchers.add(cleanup);
|
|
4920
|
-
});
|
|
4921
|
-
// Stops the interpreted machine
|
|
4922
|
-
__publicField(this, "stop", () => {
|
|
4923
|
-
if (this.status === "Stopped" /* Stopped */) return;
|
|
4924
|
-
this.performExitEffects(this.state.value, toEvent("machine.stop" /* Stop */));
|
|
4925
|
-
this.executeActions(this.config.exit, toEvent("machine.stop" /* Stop */));
|
|
4926
|
-
this.setState("");
|
|
4927
|
-
this.setEvent("machine.stop" /* Stop */);
|
|
4928
|
-
this.stopStateListeners();
|
|
4929
|
-
this.stopChildren();
|
|
4930
|
-
this.stopActivities();
|
|
4931
|
-
this.stopDelayedEvents();
|
|
4932
|
-
this.stopContextWatchers();
|
|
4933
|
-
this.status = "Stopped" /* Stopped */;
|
|
4934
|
-
return this;
|
|
4935
|
-
});
|
|
4936
|
-
__publicField(this, "stopStateListeners", () => {
|
|
4937
|
-
this.removeStateListener();
|
|
4938
|
-
this.stateListeners.clear();
|
|
4939
|
-
});
|
|
4940
|
-
__publicField(this, "stopContextWatchers", () => {
|
|
4941
|
-
this.contextWatchers.forEach((fn) => fn());
|
|
4942
|
-
this.contextWatchers.clear();
|
|
4943
|
-
});
|
|
4944
|
-
__publicField(this, "stopDelayedEvents", () => {
|
|
4945
|
-
this.delayedEvents.forEach((state) => {
|
|
4946
|
-
state.forEach((stop) => stop());
|
|
4947
|
-
});
|
|
4948
|
-
this.delayedEvents.clear();
|
|
4949
|
-
});
|
|
4950
|
-
// Cleanup running activities (e.g `setInterval`, invoked callbacks, promises)
|
|
4951
|
-
__publicField(this, "stopActivities", (state) => {
|
|
4952
|
-
if (state) {
|
|
4953
|
-
this.activityEvents.get(state)?.forEach((stop) => stop());
|
|
4954
|
-
this.activityEvents.get(state)?.clear();
|
|
4955
|
-
this.activityEvents.delete(state);
|
|
4956
|
-
} else {
|
|
4957
|
-
this.activityEvents.forEach((state2) => {
|
|
4958
|
-
state2.forEach((stop) => stop());
|
|
4959
|
-
state2.clear();
|
|
4960
|
-
});
|
|
4961
|
-
this.activityEvents.clear();
|
|
4962
|
-
}
|
|
4963
|
-
});
|
|
4964
|
-
/**
|
|
4965
|
-
* Function to send event to spawned child machine or actor
|
|
4966
|
-
*/
|
|
4967
|
-
__publicField(this, "sendChild", (evt, to) => {
|
|
4968
|
-
const event = toEvent(evt);
|
|
4969
|
-
const id = runIfFn(to, this.contextSnapshot);
|
|
4970
|
-
const child = this.children.get(id);
|
|
4971
|
-
if (!child) {
|
|
4972
|
-
invariant(`[@zag-js/core] Cannot send '${event.type}' event to unknown child`);
|
|
4973
|
-
}
|
|
4974
|
-
child.send(event);
|
|
4975
|
-
});
|
|
4976
|
-
/**
|
|
4977
|
-
* Function to stop a running child machine or actor
|
|
4978
|
-
*/
|
|
4979
|
-
__publicField(this, "stopChild", (id) => {
|
|
4980
|
-
if (!this.children.has(id)) {
|
|
4981
|
-
invariant(`[@zag-js/core > stop-child] Cannot stop unknown child ${id}`);
|
|
4982
|
-
}
|
|
4983
|
-
this.children.get(id).stop();
|
|
4984
|
-
this.children.delete(id);
|
|
4985
|
-
});
|
|
4986
|
-
__publicField(this, "removeChild", (id) => {
|
|
4987
|
-
this.children.delete(id);
|
|
4988
|
-
});
|
|
4989
|
-
// Stop and delete spawned actors
|
|
4990
|
-
__publicField(this, "stopChildren", () => {
|
|
4991
|
-
this.children.forEach((child) => child.stop());
|
|
4992
|
-
this.children.clear();
|
|
4993
|
-
});
|
|
4994
|
-
__publicField(this, "setParent", (parent) => {
|
|
4995
|
-
this.parent = parent;
|
|
4996
|
-
});
|
|
4997
|
-
__publicField(this, "spawn", (src, id) => {
|
|
4998
|
-
const actor = runIfFn(src);
|
|
4999
|
-
if (id) actor.id = id;
|
|
5000
|
-
actor.type = "machine.actor" /* Actor */;
|
|
5001
|
-
actor.setParent(this);
|
|
5002
|
-
this.children.set(actor.id, cast(actor));
|
|
5003
|
-
actor.onDone(() => {
|
|
5004
|
-
this.removeChild(actor.id);
|
|
5005
|
-
}).start();
|
|
5006
|
-
return cast(ref(actor));
|
|
5007
|
-
});
|
|
5008
|
-
__publicField(this, "stopActivity", (key) => {
|
|
5009
|
-
if (!this.state.value) return;
|
|
5010
|
-
const cleanups = this.activityEvents.get(this.state.value);
|
|
5011
|
-
cleanups?.get(key)?.();
|
|
5012
|
-
cleanups?.delete(key);
|
|
5013
|
-
});
|
|
5014
|
-
__publicField(this, "addActivityCleanup", (state, key, cleanup) => {
|
|
5015
|
-
if (!state) return;
|
|
5016
|
-
if (!this.activityEvents.has(state)) {
|
|
5017
|
-
this.activityEvents.set(state, /* @__PURE__ */ new Map([[key, cleanup]]));
|
|
5018
|
-
} else {
|
|
5019
|
-
this.activityEvents.get(state)?.set(key, cleanup);
|
|
5020
|
-
}
|
|
5021
|
-
});
|
|
5022
|
-
__publicField(this, "setState", (target) => {
|
|
5023
|
-
this.state.previousValue = this.state.value;
|
|
5024
|
-
this.state.value = target;
|
|
5025
|
-
const stateNode = this.getStateNode(target);
|
|
5026
|
-
if (target == null) {
|
|
5027
|
-
clear(this.state.tags);
|
|
5028
|
-
} else {
|
|
5029
|
-
this.state.tags = toArray(stateNode?.tags);
|
|
5030
|
-
}
|
|
5031
|
-
});
|
|
5032
|
-
/**
|
|
5033
|
-
* To used within side effects for React or Vue to update context
|
|
5034
|
-
*/
|
|
5035
|
-
__publicField(this, "setContext", (context) => {
|
|
5036
|
-
if (!context) return;
|
|
5037
|
-
deepMerge(this.state.context, compact$1(context));
|
|
5038
|
-
});
|
|
5039
|
-
__publicField(this, "setOptions", (options) => {
|
|
5040
|
-
const opts = compact$1(options);
|
|
5041
|
-
this.actionMap = { ...this.actionMap, ...opts.actions };
|
|
5042
|
-
this.delayMap = { ...this.delayMap, ...opts.delays };
|
|
5043
|
-
this.activityMap = { ...this.activityMap, ...opts.activities };
|
|
5044
|
-
this.guardMap = { ...this.guardMap, ...opts.guards };
|
|
5045
|
-
});
|
|
5046
|
-
__publicField(this, "getStateNode", (state) => {
|
|
5047
|
-
if (!state) return;
|
|
5048
|
-
return this.config.states?.[state];
|
|
5049
|
-
});
|
|
5050
|
-
__publicField(this, "getNextStateInfo", (transitions, event) => {
|
|
5051
|
-
const transition = this.determineTransition(transitions, event);
|
|
5052
|
-
const isTargetless = !transition?.target;
|
|
5053
|
-
const target = transition?.target ?? this.state.value;
|
|
5054
|
-
const changed = this.state.value !== target;
|
|
5055
|
-
const stateNode = this.getStateNode(target);
|
|
5056
|
-
const reenter = !isTargetless && !changed && !transition?.internal;
|
|
5057
|
-
const info = {
|
|
5058
|
-
reenter,
|
|
5059
|
-
transition,
|
|
5060
|
-
stateNode,
|
|
5061
|
-
target,
|
|
5062
|
-
changed
|
|
5063
|
-
};
|
|
5064
|
-
this.log("NextState:", `[${event.type}]`, this.state.value, "---->", info.target);
|
|
5065
|
-
return info;
|
|
5066
|
-
});
|
|
5067
|
-
__publicField(this, "getAfterActions", (transition, delay) => {
|
|
5068
|
-
let id;
|
|
5069
|
-
return {
|
|
5070
|
-
entry: () => {
|
|
5071
|
-
id = globalThis.setTimeout(() => {
|
|
5072
|
-
const next = this.getNextStateInfo(transition, this.state.event);
|
|
5073
|
-
this.performStateChangeEffects(this.state.value, next, this.state.event);
|
|
5074
|
-
}, delay);
|
|
5075
|
-
},
|
|
5076
|
-
exit: () => {
|
|
5077
|
-
globalThis.clearTimeout(id);
|
|
5078
|
-
}
|
|
5079
|
-
};
|
|
5080
|
-
});
|
|
5081
|
-
/**
|
|
5082
|
-
* All `after` events leverage `setTimeout` and `clearTimeout`,
|
|
5083
|
-
* we invoke the `clearTimeout` on exit and `setTimeout` on entry.
|
|
5084
|
-
*
|
|
5085
|
-
* To achieve this, we split the `after` defintion into `entry` and `exit`
|
|
5086
|
-
* functions and append them to the state's `entry` and `exit` actions
|
|
5087
|
-
*/
|
|
5088
|
-
__publicField(this, "getDelayedEventActions", (state) => {
|
|
5089
|
-
const stateNode = this.getStateNode(state);
|
|
5090
|
-
const event = this.state.event;
|
|
5091
|
-
if (!stateNode || !stateNode.after) return;
|
|
5092
|
-
const entries = [];
|
|
5093
|
-
const exits = [];
|
|
5094
|
-
if (isArray(stateNode.after)) {
|
|
5095
|
-
const transition = this.determineTransition(stateNode.after, event);
|
|
5096
|
-
if (!transition) return;
|
|
5097
|
-
if (!hasProp(transition, "delay")) {
|
|
5098
|
-
throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(transition)}`);
|
|
5099
|
-
}
|
|
5100
|
-
const determineDelay = determineDelayFn(transition.delay, this.delayMap);
|
|
5101
|
-
const __delay = determineDelay(this.contextSnapshot, event);
|
|
5102
|
-
const actions = this.getAfterActions(transition, __delay);
|
|
5103
|
-
entries.push(actions.entry);
|
|
5104
|
-
exits.push(actions.exit);
|
|
5105
|
-
return { entries, exits };
|
|
5106
|
-
}
|
|
5107
|
-
if (isObject(stateNode.after)) {
|
|
5108
|
-
for (const delay in stateNode.after) {
|
|
5109
|
-
const transition = stateNode.after[delay];
|
|
5110
|
-
const determineDelay = determineDelayFn(delay, this.delayMap);
|
|
5111
|
-
const __delay = determineDelay(this.contextSnapshot, event);
|
|
5112
|
-
const actions = this.getAfterActions(transition, __delay);
|
|
5113
|
-
entries.push(actions.entry);
|
|
5114
|
-
exits.push(actions.exit);
|
|
5115
|
-
}
|
|
5116
|
-
}
|
|
5117
|
-
return { entries, exits };
|
|
5118
|
-
});
|
|
5119
|
-
/**
|
|
5120
|
-
* Function to executes defined actions. It can accept actions as string
|
|
5121
|
-
* (referencing `options.actions`) or actual functions.
|
|
5122
|
-
*/
|
|
5123
|
-
__publicField(this, "executeActions", (actions, event) => {
|
|
5124
|
-
const pickedActions = determineActionsFn(actions, this.guardMap)(this.contextSnapshot, event, this.guardMeta);
|
|
5125
|
-
for (const action of toArray(pickedActions)) {
|
|
5126
|
-
const fn = isString(action) ? this.actionMap?.[action] : action;
|
|
5127
|
-
warn(
|
|
5128
|
-
isString(action) && !fn,
|
|
5129
|
-
`[@zag-js/core > execute-actions] No implementation found for action: \`${action}\``
|
|
5130
|
-
);
|
|
5131
|
-
fn?.(this.state.context, event, this.meta);
|
|
5132
|
-
}
|
|
5133
|
-
});
|
|
5134
|
-
/**
|
|
5135
|
-
* Function to execute running activities and registers
|
|
5136
|
-
* their cleanup function internally (to be called later on when we exit the state)
|
|
5137
|
-
*/
|
|
5138
|
-
__publicField(this, "executeActivities", (event, activities, state) => {
|
|
5139
|
-
for (const activity of activities) {
|
|
5140
|
-
const fn = isString(activity) ? this.activityMap?.[activity] : activity;
|
|
5141
|
-
if (!fn) {
|
|
5142
|
-
warn(`[@zag-js/core > execute-activity] No implementation found for activity: \`${activity}\``);
|
|
5143
|
-
continue;
|
|
5144
|
-
}
|
|
5145
|
-
const cleanup = fn(this.state.context, event, this.meta);
|
|
5146
|
-
if (cleanup) {
|
|
5147
|
-
const key = isString(activity) ? activity : activity.name || uuid();
|
|
5148
|
-
this.addActivityCleanup(state ?? this.state.value, key, cleanup);
|
|
5149
|
-
}
|
|
5150
|
-
}
|
|
5151
|
-
});
|
|
5152
|
-
/**
|
|
5153
|
-
* Normalizes the `every` definition to transition. `every` can be:
|
|
5154
|
-
* - An array of possible actions to run (we need to pick the first match based on guard)
|
|
5155
|
-
* - An object of intervals and actions
|
|
5156
|
-
*/
|
|
5157
|
-
__publicField(this, "createEveryActivities", (every, callbackfn) => {
|
|
5158
|
-
if (!every) return;
|
|
5159
|
-
if (isArray(every)) {
|
|
5160
|
-
const picked = toArray(every).find((transition) => {
|
|
5161
|
-
const delayOrFn = transition.delay;
|
|
5162
|
-
const determineDelay2 = determineDelayFn(delayOrFn, this.delayMap);
|
|
5163
|
-
const delay2 = determineDelay2(this.contextSnapshot, this.state.event);
|
|
5164
|
-
const determineGuard = determineGuardFn(transition.guard, this.guardMap);
|
|
5165
|
-
const guard = determineGuard(this.contextSnapshot, this.state.event, this.guardMeta);
|
|
5166
|
-
return guard ?? delay2 != null;
|
|
5167
|
-
});
|
|
5168
|
-
if (!picked) return;
|
|
5169
|
-
const determineDelay = determineDelayFn(picked.delay, this.delayMap);
|
|
5170
|
-
const delay = determineDelay(this.contextSnapshot, this.state.event);
|
|
5171
|
-
const activity = () => {
|
|
5172
|
-
const id = globalThis.setInterval(() => {
|
|
5173
|
-
this.executeActions(picked.actions, this.state.event);
|
|
5174
|
-
}, delay);
|
|
5175
|
-
return () => {
|
|
5176
|
-
globalThis.clearInterval(id);
|
|
5177
|
-
};
|
|
5178
|
-
};
|
|
5179
|
-
callbackfn(activity);
|
|
5180
|
-
} else {
|
|
5181
|
-
for (const interval in every) {
|
|
5182
|
-
const actions = every?.[interval];
|
|
5183
|
-
const determineDelay = determineDelayFn(interval, this.delayMap);
|
|
5184
|
-
const delay = determineDelay(this.contextSnapshot, this.state.event);
|
|
5185
|
-
const activity = () => {
|
|
5186
|
-
const id = globalThis.setInterval(() => {
|
|
5187
|
-
this.executeActions(actions, this.state.event);
|
|
5188
|
-
}, delay);
|
|
5189
|
-
return () => {
|
|
5190
|
-
globalThis.clearInterval(id);
|
|
5191
|
-
};
|
|
5192
|
-
};
|
|
5193
|
-
callbackfn(activity);
|
|
5194
|
-
}
|
|
5195
|
-
}
|
|
5196
|
-
});
|
|
5197
|
-
__publicField(this, "setEvent", (event) => {
|
|
5198
|
-
this.state.previousEvent = this.state.event;
|
|
5199
|
-
this.state.event = ref(toEvent(event));
|
|
5200
|
-
});
|
|
5201
|
-
__publicField(this, "performExitEffects", (current, event) => {
|
|
5202
|
-
const currentState = this.state.value;
|
|
5203
|
-
if (currentState === "") return;
|
|
5204
|
-
const stateNode = current ? this.getStateNode(current) : void 0;
|
|
5205
|
-
this.stopActivities(currentState);
|
|
5206
|
-
const _exit = determineActionsFn(stateNode?.exit, this.guardMap)(this.contextSnapshot, event, this.guardMeta);
|
|
5207
|
-
const exitActions = toArray(_exit);
|
|
5208
|
-
const afterExitActions = this.delayedEvents.get(currentState);
|
|
5209
|
-
if (afterExitActions) {
|
|
5210
|
-
exitActions.push(...afterExitActions);
|
|
5211
|
-
}
|
|
5212
|
-
this.executeActions(exitActions, event);
|
|
5213
|
-
});
|
|
5214
|
-
__publicField(this, "performEntryEffects", (next, event) => {
|
|
5215
|
-
const stateNode = this.getStateNode(next);
|
|
5216
|
-
const activities = toArray(stateNode?.activities);
|
|
5217
|
-
this.createEveryActivities(stateNode?.every, (activity) => {
|
|
5218
|
-
activities.unshift(activity);
|
|
5219
|
-
});
|
|
5220
|
-
if (activities.length > 0) {
|
|
5221
|
-
this.executeActivities(event, activities);
|
|
5222
|
-
}
|
|
5223
|
-
const pickedActions = determineActionsFn(stateNode?.entry, this.guardMap)(
|
|
5224
|
-
this.contextSnapshot,
|
|
5225
|
-
event,
|
|
5226
|
-
this.guardMeta
|
|
5227
|
-
);
|
|
5228
|
-
const entryActions = toArray(pickedActions);
|
|
5229
|
-
const afterActions = this.getDelayedEventActions(next);
|
|
5230
|
-
if (stateNode?.after && afterActions) {
|
|
5231
|
-
this.delayedEvents.set(next, afterActions?.exits);
|
|
5232
|
-
entryActions.push(...afterActions.entries);
|
|
5233
|
-
}
|
|
5234
|
-
this.executeActions(entryActions, event);
|
|
5235
|
-
if (stateNode?.type === "final") {
|
|
5236
|
-
this.state.done = true;
|
|
5237
|
-
this.doneListeners.forEach((listener) => {
|
|
5238
|
-
listener(this.stateSnapshot);
|
|
5239
|
-
});
|
|
5240
|
-
this.stop();
|
|
5241
|
-
}
|
|
5242
|
-
});
|
|
5243
|
-
__publicField(this, "performTransitionEffects", (transitions, event) => {
|
|
5244
|
-
const transition = this.determineTransition(transitions, event);
|
|
5245
|
-
this.executeActions(transition?.actions, event);
|
|
5246
|
-
});
|
|
5247
|
-
/**
|
|
5248
|
-
* Performs all the requires side-effects or reactions when
|
|
5249
|
-
* we move from state A => state B.
|
|
5250
|
-
*
|
|
5251
|
-
* The Effect order:
|
|
5252
|
-
* Exit actions (current state) => Transition actions => Go to state => Entry actions (next state)
|
|
5253
|
-
*/
|
|
5254
|
-
__publicField(this, "performStateChangeEffects", (current, next, event) => {
|
|
5255
|
-
this.setEvent(event);
|
|
5256
|
-
const changed = next.changed || next.reenter;
|
|
5257
|
-
if (changed) {
|
|
5258
|
-
this.performExitEffects(current, event);
|
|
5259
|
-
}
|
|
5260
|
-
this.performTransitionEffects(next.transition, event);
|
|
5261
|
-
this.setState(next.target);
|
|
5262
|
-
if (changed) {
|
|
5263
|
-
this.performEntryEffects(next.target, event);
|
|
5264
|
-
}
|
|
5265
|
-
});
|
|
5266
|
-
__publicField(this, "determineTransition", (transition, event) => {
|
|
5267
|
-
const fn = determineTransitionFn(transition, this.guardMap);
|
|
5268
|
-
return fn?.(this.contextSnapshot, event, this.guardMeta);
|
|
5269
|
-
});
|
|
5270
|
-
/**
|
|
5271
|
-
* Function to send event to parent machine from spawned child
|
|
5272
|
-
*/
|
|
5273
|
-
__publicField(this, "sendParent", (evt) => {
|
|
5274
|
-
if (!this.parent) {
|
|
5275
|
-
invariant("[@zag-js/core > send-parent] Cannot send event to an unknown parent");
|
|
5276
|
-
}
|
|
5277
|
-
const event = toEvent(evt);
|
|
5278
|
-
this.parent?.send(event);
|
|
5279
|
-
});
|
|
5280
|
-
__publicField(this, "log", (...args) => {
|
|
5281
|
-
if (isDev() && this.options.debug) {
|
|
5282
|
-
console.log(...args);
|
|
5283
|
-
}
|
|
5284
|
-
});
|
|
5285
|
-
/**
|
|
5286
|
-
* Function to send an event to current machine
|
|
5287
|
-
*/
|
|
5288
|
-
__publicField(this, "send", (evt) => {
|
|
5289
|
-
const event = toEvent(evt);
|
|
5290
|
-
this.transition(this.state.value, event);
|
|
5291
|
-
});
|
|
5292
|
-
__publicField(this, "transition", (state, evt) => {
|
|
5293
|
-
const stateNode = isString(state) ? this.getStateNode(state) : state?.stateNode;
|
|
5294
|
-
const event = toEvent(evt);
|
|
5295
|
-
if (!stateNode && !this.config.on) {
|
|
5296
|
-
const msg = this.status === "Stopped" /* Stopped */ ? "[@zag-js/core > transition] Cannot transition a stopped machine" : `[@zag-js/core > transition] State does not have a definition for \`state\`: ${state}, \`event\`: ${event.type}`;
|
|
5297
|
-
warn(msg);
|
|
5298
|
-
return;
|
|
5299
|
-
}
|
|
5300
|
-
const transitions = stateNode?.on?.[event.type] ?? this.config.on?.[event.type];
|
|
5301
|
-
const next = this.getNextStateInfo(transitions, event);
|
|
5302
|
-
this.performStateChangeEffects(this.state.value, next, event);
|
|
5303
|
-
return next.stateNode;
|
|
5304
|
-
});
|
|
5305
|
-
__publicField(this, "subscribe", (listener) => {
|
|
5306
|
-
this.stateListeners.add(listener);
|
|
5307
|
-
if (this.status === "Running" /* Running */) {
|
|
5308
|
-
listener(this.stateSnapshot);
|
|
5309
|
-
}
|
|
5310
|
-
return () => {
|
|
5311
|
-
this.stateListeners.delete(listener);
|
|
5312
|
-
};
|
|
5313
|
-
});
|
|
5314
|
-
__publicField(this, "onDone", (listener) => {
|
|
5315
|
-
this.doneListeners.add(listener);
|
|
5316
|
-
return this;
|
|
5317
|
-
});
|
|
5318
|
-
__publicField(this, "onTransition", (listener) => {
|
|
5319
|
-
this.stateListeners.add(listener);
|
|
5320
|
-
if (this.status === "Running" /* Running */) {
|
|
5321
|
-
listener(this.stateSnapshot);
|
|
5322
|
-
}
|
|
5323
|
-
return this;
|
|
5324
|
-
});
|
|
5325
|
-
this.config = structuredClone(config);
|
|
5326
|
-
this.options = structuredClone(options ?? {});
|
|
5327
|
-
this.id = this.config.id ?? `machine-${uuid()}`;
|
|
5328
|
-
this.guardMap = this.options?.guards ?? {};
|
|
5329
|
-
this.actionMap = this.options?.actions ?? {};
|
|
5330
|
-
this.delayMap = this.options?.delays ?? {};
|
|
5331
|
-
this.activityMap = this.options?.activities ?? {};
|
|
5332
|
-
this.sync = this.options?.sync ?? false;
|
|
5333
|
-
this.state = createProxy(this.config);
|
|
5334
|
-
this.initialContext = snapshot(this.state.context);
|
|
5335
|
-
}
|
|
5336
|
-
// immutable state value
|
|
5337
|
-
get stateSnapshot() {
|
|
5338
|
-
return cast(snapshot(this.state));
|
|
5339
|
-
}
|
|
5340
|
-
getState() {
|
|
5341
|
-
return this.stateSnapshot;
|
|
5342
|
-
}
|
|
5343
|
-
// immutable context value
|
|
5344
|
-
get contextSnapshot() {
|
|
5345
|
-
return this.stateSnapshot.context;
|
|
5346
|
-
}
|
|
5347
|
-
/**
|
|
5348
|
-
* A reference to the instance methods of the machine.
|
|
5349
|
-
* Useful when spawning child machines and managing the communication between them.
|
|
5350
|
-
*/
|
|
5351
|
-
get self() {
|
|
5352
|
-
const self = this;
|
|
5353
|
-
return {
|
|
5354
|
-
id: this.id,
|
|
5355
|
-
send: this.send.bind(this),
|
|
5356
|
-
sendParent: this.sendParent.bind(this),
|
|
5357
|
-
sendChild: this.sendChild.bind(this),
|
|
5358
|
-
stop: this.stop.bind(this),
|
|
5359
|
-
stopChild: this.stopChild.bind(this),
|
|
5360
|
-
spawn: this.spawn.bind(this),
|
|
5361
|
-
stopActivity: this.stopActivity.bind(this),
|
|
5362
|
-
get state() {
|
|
5363
|
-
return self.stateSnapshot;
|
|
5364
|
-
},
|
|
5365
|
-
get initialContext() {
|
|
5366
|
-
return self.initialContext;
|
|
5367
|
-
},
|
|
5368
|
-
get initialState() {
|
|
5369
|
-
return self.initialState?.target ?? "";
|
|
5370
|
-
}
|
|
5371
|
-
};
|
|
5372
|
-
}
|
|
5373
|
-
get meta() {
|
|
5374
|
-
return {
|
|
5375
|
-
state: this.stateSnapshot,
|
|
5376
|
-
guards: this.guardMap,
|
|
5377
|
-
send: this.send.bind(this),
|
|
5378
|
-
self: this.self,
|
|
5379
|
-
initialContext: this.initialContext,
|
|
5380
|
-
initialState: this.initialState?.target ?? "",
|
|
5381
|
-
getState: () => this.stateSnapshot,
|
|
5382
|
-
getAction: (key) => this.actionMap[key],
|
|
5383
|
-
getGuard: (key) => this.guardMap[key]
|
|
5384
|
-
};
|
|
5385
|
-
}
|
|
5386
|
-
get guardMeta() {
|
|
5387
|
-
return {
|
|
5388
|
-
state: this.stateSnapshot
|
|
5389
|
-
};
|
|
5390
|
-
}
|
|
5391
|
-
get [Symbol.toStringTag]() {
|
|
5392
|
-
return "Machine";
|
|
5393
|
-
}
|
|
4446
|
+
}, mergedProps));
|
|
5394
4447
|
};
|
|
5395
|
-
var createMachine = (config, options) => new Machine(config, options);
|
|
5396
|
-
|
|
5397
|
-
// src/array.ts
|
|
5398
|
-
|
|
5399
|
-
// src/object.ts
|
|
5400
|
-
function compact(obj) {
|
|
5401
|
-
if (!isPlainObject(obj) || obj === void 0) {
|
|
5402
|
-
return obj;
|
|
5403
|
-
}
|
|
5404
|
-
const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
|
|
5405
|
-
const filtered = {};
|
|
5406
|
-
for (const key of keys) {
|
|
5407
|
-
const value = obj[key];
|
|
5408
|
-
if (value !== void 0) {
|
|
5409
|
-
filtered[key] = compact(value);
|
|
5410
|
-
}
|
|
5411
|
-
}
|
|
5412
|
-
return filtered;
|
|
5413
|
-
}
|
|
5414
|
-
var isPlainObject = (value) => {
|
|
5415
|
-
return value && typeof value === "object" && value.constructor === Object;
|
|
5416
|
-
};
|
|
5417
|
-
|
|
5418
|
-
function $(e,t,u,x=h=>h){return e*x(.5-t*(.5-u))}function se(e){return [-e[0],-e[1]]}function l(e,t){return [e[0]+t[0],e[1]+t[1]]}function a(e,t){return [e[0]-t[0],e[1]-t[1]]}function b(e,t){return [e[0]*t,e[1]*t]}function he(e,t){return [e[0]/t,e[1]/t]}function R(e){return [e[1],-e[0]]}function B(e,t){return e[0]*t[0]+e[1]*t[1]}function ue(e,t){return e[0]===t[0]&&e[1]===t[1]}function ge(e){return Math.hypot(e[0],e[1])}function de(e){return e[0]*e[0]+e[1]*e[1]}function A(e,t){return de(a(e,t))}function G(e){return he(e,ge(e))}function ie(e,t){return Math.hypot(e[1]-t[1],e[0]-t[0])}function L(e,t,u){let x=Math.sin(u),h=Math.cos(u),y=e[0]-t[0],n=e[1]-t[1],f=y*h-n*x,d=y*x+n*h;return [f+t[0],d+t[1]]}function K(e,t,u){return l(e,b(a(t,e),u))}function ee(e,t,u){return l(e,b(t,u))}var{min:C,PI:xe}=Math,pe=.275,V=xe+1e-4;function ce(e,t={}){let{size:u=16,smoothing:x=.5,thinning:h=.5,simulatePressure:y=!0,easing:n=r=>r,start:f={},end:d={},last:D=!1}=t,{cap:S=!0,easing:j=r=>r*(2-r)}=f,{cap:q=!0,easing:c=r=>--r*r*r+1}=d;if(e.length===0||u<=0)return [];let p=e[e.length-1].runningLength,g=f.taper===!1?0:f.taper===!0?Math.max(u,p):f.taper,T=d.taper===!1?0:d.taper===!0?Math.max(u,p):d.taper,te=Math.pow(u*x,2),_=[],M=[],H=e.slice(0,10).reduce((r,i)=>{let o=i.pressure;if(y){let s=C(1,i.distance/u),W=C(1,1-s);o=C(1,r+(W-r)*(s*pe));}return (r+o)/2},e[0].pressure),m=$(u,h,e[e.length-1].pressure,n),U,X=e[0].vector,z=e[0].point,F=z,O=z,E=F,J=!1;for(let r=0;r<e.length;r++){let{pressure:i}=e[r],{point:o,vector:s,distance:W,runningLength:I}=e[r];if(r<e.length-1&&p-I<3)continue;if(h){if(y){let v=C(1,W/u),Z=C(1,1-v);i=C(1,H+(Z-H)*(v*pe));}m=$(u,h,i,n);}else m=u/2;U===void 0&&(U=m);let le=I<g?j(I/g):1,fe=p-I<T?c((p-I)/T):1;m=Math.max(.01,m*Math.min(le,fe));let re=(r<e.length-1?e[r+1]:e[r]).vector,Y=r<e.length-1?B(s,re):1,be=B(s,X)<0&&!J,ne=Y!==null&&Y<0;if(be||ne){let v=b(R(X),m);for(let Z=1/13,w=0;w<=1;w+=Z)O=L(a(o,v),o,V*w),_.push(O),E=L(l(o,v),o,V*-w),M.push(E);z=O,F=E,ne&&(J=!0);continue}if(J=!1,r===e.length-1){let v=b(R(s),m);_.push(a(o,v)),M.push(l(o,v));continue}let oe=b(R(K(re,s,Y)),m);O=a(o,oe),(r<=1||A(z,O)>te)&&(_.push(O),z=O),E=l(o,oe),(r<=1||A(F,E)>te)&&(M.push(E),F=E),H=i,X=s;}let P=e[0].point.slice(0,2),k=e.length>1?e[e.length-1].point.slice(0,2):l(e[0].point,[1,1]),Q=[],N=[];if(e.length===1){if(!(g||T)||D){let r=ee(P,G(R(a(P,k))),-(U||m)),i=[];for(let o=1/13,s=o;s<=1;s+=o)i.push(L(r,P,V*2*s));return i}}else {if(!(g||T&&e.length===1))if(S)for(let i=1/13,o=i;o<=1;o+=i){let s=L(M[0],P,V*o);Q.push(s);}else {let i=a(_[0],M[0]),o=b(i,.5),s=b(i,.51);Q.push(a(P,o),a(P,s),l(P,s),l(P,o));}let r=R(se(e[e.length-1].vector));if(T||g&&e.length===1)N.push(k);else if(q){let i=ee(k,r,m);for(let o=1/29,s=o;s<1;s+=o)N.push(L(i,k,V*3*s));}else N.push(l(k,b(r,m)),l(k,b(r,m*.99)),a(k,b(r,m*.99)),a(k,b(r,m)));}return _.concat(N,M.reverse(),Q)}function me(e,t={}){var q;let{streamline:u=.5,size:x=16,last:h=!1}=t;if(e.length===0)return [];let y=.15+(1-u)*.85,n=Array.isArray(e[0])?e:e.map(({x:c,y:p,pressure:g=.5})=>[c,p,g]);if(n.length===2){let c=n[1];n=n.slice(0,-1);for(let p=1;p<5;p++)n.push(K(n[0],c,p/4));}n.length===1&&(n=[...n,[...l(n[0],[1,1]),...n[0].slice(2)]]);let f=[{point:[n[0][0],n[0][1]],pressure:n[0][2]>=0?n[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],d=!1,D=0,S=f[0],j=n.length-1;for(let c=1;c<n.length;c++){let p=h&&c===j?n[c].slice(0,2):K(S.point,n[c],y);if(ue(S.point,p))continue;let g=ie(p,S.point);if(D+=g,c<j&&!d){if(D<x)continue;d=!0;}S={point:p,pressure:n[c][2]>=0?n[c][2]:.5,vector:G(a(S.point,p)),distance:g,runningLength:D},f.push(S);}return f[0].vector=((q=f[1])==null?void 0:q.vector)||[0,0],f}function ae(e,t={}){return ce(me(e,t),t)}var _e=ae;
|
|
5419
|
-
|
|
5420
|
-
// src/signature-pad.anatomy.ts
|
|
5421
|
-
var anatomy = createAnatomy("signature-pad").parts(
|
|
5422
|
-
"root",
|
|
5423
|
-
"control",
|
|
5424
|
-
"segment",
|
|
5425
|
-
"segmentPath",
|
|
5426
|
-
"guide",
|
|
5427
|
-
"clearTrigger",
|
|
5428
|
-
"label"
|
|
5429
|
-
);
|
|
5430
|
-
var parts = anatomy.build();
|
|
5431
|
-
var dom = createScope({
|
|
5432
|
-
getRootId: (ctx) => ctx.ids?.root ?? `signature-${ctx.id}`,
|
|
5433
|
-
getControlId: (ctx) => ctx.ids?.control ?? `signature-control-${ctx.id}`,
|
|
5434
|
-
getHiddenInputId: (ctx) => ctx.ids?.hiddenInput ?? `signature-input-${ctx.id}`,
|
|
5435
|
-
getControlEl: (ctx) => dom.getById(ctx, dom.getControlId(ctx)),
|
|
5436
|
-
getSegmentEl: (ctx) => query(dom.getControlEl(ctx), "[data-part=segment]"),
|
|
5437
|
-
getHiddenInputEl: (ctx) => dom.getById(ctx, dom.getHiddenInputId(ctx)),
|
|
5438
|
-
getDataUrl: (ctx, options) => {
|
|
5439
|
-
if (ctx.isEmpty) return Promise.resolve("");
|
|
5440
|
-
return getDataUrl(dom.getSegmentEl(ctx), options);
|
|
5441
|
-
}
|
|
5442
|
-
});
|
|
5443
|
-
|
|
5444
|
-
// src/signature-pad.connect.ts
|
|
5445
|
-
function connect(state, send, normalize) {
|
|
5446
|
-
const drawing = state.matches("drawing");
|
|
5447
|
-
const empty = state.context.isEmpty;
|
|
5448
|
-
const interactive = state.context.isInteractive;
|
|
5449
|
-
const disabled = !!state.context.disabled;
|
|
5450
|
-
return {
|
|
5451
|
-
empty,
|
|
5452
|
-
drawing,
|
|
5453
|
-
currentPath: state.context.currentPath,
|
|
5454
|
-
paths: state.context.paths,
|
|
5455
|
-
clear() {
|
|
5456
|
-
send({ type: "CLEAR" });
|
|
5457
|
-
},
|
|
5458
|
-
getDataUrl(type, quality) {
|
|
5459
|
-
return dom.getDataUrl(state.context, { type, quality });
|
|
5460
|
-
},
|
|
5461
|
-
getLabelProps() {
|
|
5462
|
-
return normalize.element({
|
|
5463
|
-
...parts.label.attrs,
|
|
5464
|
-
"data-disabled": dataAttr(disabled),
|
|
5465
|
-
htmlFor: dom.getControlId(state.context)
|
|
5466
|
-
});
|
|
5467
|
-
},
|
|
5468
|
-
getRootProps() {
|
|
5469
|
-
return normalize.element({
|
|
5470
|
-
...parts.root.attrs,
|
|
5471
|
-
"data-disabled": dataAttr(disabled),
|
|
5472
|
-
id: dom.getRootId(state.context)
|
|
5473
|
-
});
|
|
5474
|
-
},
|
|
5475
|
-
getControlProps() {
|
|
5476
|
-
return normalize.element({
|
|
5477
|
-
...parts.control.attrs,
|
|
5478
|
-
tabIndex: disabled ? void 0 : 0,
|
|
5479
|
-
id: dom.getControlId(state.context),
|
|
5480
|
-
"aria-label": "Signature Pad",
|
|
5481
|
-
"aria-roledescription": "signature pad",
|
|
5482
|
-
"aria-disabled": disabled,
|
|
5483
|
-
"data-disabled": dataAttr(disabled),
|
|
5484
|
-
onPointerDown(event) {
|
|
5485
|
-
if (!isLeftClick(event)) return;
|
|
5486
|
-
if (isModifierKey(event)) return;
|
|
5487
|
-
if (!interactive) return;
|
|
5488
|
-
const target = getEventTarget(event);
|
|
5489
|
-
if (target?.closest("[data-part=clear-trigger]")) return;
|
|
5490
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
5491
|
-
const point = { x: event.clientX, y: event.clientY };
|
|
5492
|
-
const { offset } = getRelativePoint(point, dom.getControlEl(state.context));
|
|
5493
|
-
send({ type: "POINTER_DOWN", point: offset, pressure: event.pressure });
|
|
5494
|
-
},
|
|
5495
|
-
onPointerUp(event) {
|
|
5496
|
-
if (!interactive) return;
|
|
5497
|
-
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
5498
|
-
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
5499
|
-
}
|
|
5500
|
-
},
|
|
5501
|
-
style: {
|
|
5502
|
-
position: "relative",
|
|
5503
|
-
touchAction: "none",
|
|
5504
|
-
userSelect: "none"
|
|
5505
|
-
}
|
|
5506
|
-
});
|
|
5507
|
-
},
|
|
5508
|
-
getSegmentProps() {
|
|
5509
|
-
return normalize.svg({
|
|
5510
|
-
...parts.segment.attrs,
|
|
5511
|
-
style: {
|
|
5512
|
-
position: "absolute",
|
|
5513
|
-
top: 0,
|
|
5514
|
-
left: 0,
|
|
5515
|
-
width: "100%",
|
|
5516
|
-
height: "100%",
|
|
5517
|
-
pointerEvents: "none",
|
|
5518
|
-
fill: state.context.drawing.fill
|
|
5519
|
-
}
|
|
5520
|
-
});
|
|
5521
|
-
},
|
|
5522
|
-
getSegmentPathProps(props2) {
|
|
5523
|
-
return normalize.path({
|
|
5524
|
-
...parts.segmentPath.attrs,
|
|
5525
|
-
d: props2.path
|
|
5526
|
-
});
|
|
5527
|
-
},
|
|
5528
|
-
getGuideProps() {
|
|
5529
|
-
return normalize.element({
|
|
5530
|
-
...parts.guide.attrs,
|
|
5531
|
-
"data-disabled": dataAttr(disabled)
|
|
5532
|
-
});
|
|
5533
|
-
},
|
|
5534
|
-
getClearTriggerProps() {
|
|
5535
|
-
return normalize.button({
|
|
5536
|
-
...parts.clearTrigger.attrs,
|
|
5537
|
-
type: "button",
|
|
5538
|
-
"aria-label": "Clear Signature",
|
|
5539
|
-
hidden: !state.context.paths.length || drawing,
|
|
5540
|
-
disabled,
|
|
5541
|
-
onClick() {
|
|
5542
|
-
send({ type: "CLEAR" });
|
|
5543
|
-
}
|
|
5544
|
-
});
|
|
5545
|
-
},
|
|
5546
|
-
getHiddenInputProps(props2) {
|
|
5547
|
-
return normalize.input({
|
|
5548
|
-
type: "text",
|
|
5549
|
-
hidden: true,
|
|
5550
|
-
disabled,
|
|
5551
|
-
name: state.context.name,
|
|
5552
|
-
value: props2.value
|
|
5553
|
-
});
|
|
5554
|
-
}
|
|
5555
|
-
};
|
|
5556
|
-
}
|
|
5557
|
-
|
|
5558
|
-
// src/get-svg-path.ts
|
|
5559
|
-
var average = (a, b) => (a + b) / 2;
|
|
5560
|
-
function getSvgPathFromStroke(points, closed = true) {
|
|
5561
|
-
const len = points.length;
|
|
5562
|
-
if (len < 4) {
|
|
5563
|
-
return "";
|
|
5564
|
-
}
|
|
5565
|
-
let a = points[0];
|
|
5566
|
-
let b = points[1];
|
|
5567
|
-
const c = points[2];
|
|
5568
|
-
let result = `M${a[0].toFixed(2)},${a[1].toFixed(2)} Q${b[0].toFixed(2)},${b[1].toFixed(2)} ${average(b[0], c[0]).toFixed(2)},${average(
|
|
5569
|
-
b[1],
|
|
5570
|
-
c[1]
|
|
5571
|
-
).toFixed(2)} T`;
|
|
5572
|
-
for (let i = 2, max = len - 1; i < max; i++) {
|
|
5573
|
-
a = points[i];
|
|
5574
|
-
b = points[i + 1];
|
|
5575
|
-
result += `${average(a[0], b[0]).toFixed(2)},${average(a[1], b[1]).toFixed(2)} `;
|
|
5576
|
-
}
|
|
5577
|
-
if (closed) {
|
|
5578
|
-
result += "Z";
|
|
5579
|
-
}
|
|
5580
|
-
return result;
|
|
5581
|
-
}
|
|
5582
|
-
|
|
5583
|
-
// src/signature-pad.machine.ts
|
|
5584
|
-
function machine(userContext) {
|
|
5585
|
-
const ctx = compact(userContext);
|
|
5586
|
-
return createMachine(
|
|
5587
|
-
{
|
|
5588
|
-
id: "signature-pad",
|
|
5589
|
-
initial: "idle",
|
|
5590
|
-
context: {
|
|
5591
|
-
readOnly: false,
|
|
5592
|
-
disabled: false,
|
|
5593
|
-
...ctx,
|
|
5594
|
-
paths: [],
|
|
5595
|
-
currentPoints: [],
|
|
5596
|
-
currentPath: null,
|
|
5597
|
-
drawing: {
|
|
5598
|
-
size: 2,
|
|
5599
|
-
simulatePressure: false,
|
|
5600
|
-
thinning: 0.7,
|
|
5601
|
-
smoothing: 0.4,
|
|
5602
|
-
streamline: 0.6,
|
|
5603
|
-
...ctx.drawing
|
|
5604
|
-
}
|
|
5605
|
-
},
|
|
5606
|
-
computed: {
|
|
5607
|
-
isInteractive: (ctx2) => !(ctx2.disabled || ctx2.readOnly),
|
|
5608
|
-
isEmpty: (ctx2) => ctx2.paths.length === 0
|
|
5609
|
-
},
|
|
5610
|
-
on: {
|
|
5611
|
-
CLEAR: {
|
|
5612
|
-
actions: ["clearPoints", "invokeOnDrawEnd", "focusCanvasEl"]
|
|
5613
|
-
}
|
|
5614
|
-
},
|
|
5615
|
-
states: {
|
|
5616
|
-
idle: {
|
|
5617
|
-
on: {
|
|
5618
|
-
POINTER_DOWN: {
|
|
5619
|
-
target: "drawing",
|
|
5620
|
-
actions: ["addPoint"]
|
|
5621
|
-
}
|
|
5622
|
-
}
|
|
5623
|
-
},
|
|
5624
|
-
drawing: {
|
|
5625
|
-
activities: ["trackPointerMove"],
|
|
5626
|
-
on: {
|
|
5627
|
-
POINTER_MOVE: {
|
|
5628
|
-
actions: ["addPoint", "invokeOnDraw"]
|
|
5629
|
-
},
|
|
5630
|
-
POINTER_UP: {
|
|
5631
|
-
target: "idle",
|
|
5632
|
-
actions: ["endStroke", "invokeOnDrawEnd"]
|
|
5633
|
-
}
|
|
5634
|
-
}
|
|
5635
|
-
}
|
|
5636
|
-
}
|
|
5637
|
-
},
|
|
5638
|
-
{
|
|
5639
|
-
activities: {
|
|
5640
|
-
trackPointerMove(ctx2, _evt, { send }) {
|
|
5641
|
-
const doc = dom.getDoc(ctx2);
|
|
5642
|
-
return trackPointerMove(doc, {
|
|
5643
|
-
onPointerMove({ event, point }) {
|
|
5644
|
-
const { offset } = getRelativePoint(point, dom.getControlEl(ctx2));
|
|
5645
|
-
send({ type: "POINTER_MOVE", point: offset, pressure: event.pressure });
|
|
5646
|
-
},
|
|
5647
|
-
onPointerUp() {
|
|
5648
|
-
send({ type: "POINTER_UP" });
|
|
5649
|
-
}
|
|
5650
|
-
});
|
|
5651
|
-
}
|
|
5652
|
-
},
|
|
5653
|
-
actions: {
|
|
5654
|
-
addPoint(ctx2, evt) {
|
|
5655
|
-
ctx2.currentPoints.push(evt.point);
|
|
5656
|
-
const stroke = _e(ctx2.currentPoints, ctx2.drawing);
|
|
5657
|
-
ctx2.currentPath = getSvgPathFromStroke(stroke);
|
|
5658
|
-
},
|
|
5659
|
-
endStroke(ctx2) {
|
|
5660
|
-
ctx2.paths.push(ctx2.currentPath);
|
|
5661
|
-
ctx2.currentPoints = [];
|
|
5662
|
-
ctx2.currentPath = null;
|
|
5663
|
-
},
|
|
5664
|
-
clearPoints(ctx2) {
|
|
5665
|
-
ctx2.currentPoints = [];
|
|
5666
|
-
ctx2.paths = [];
|
|
5667
|
-
},
|
|
5668
|
-
focusCanvasEl(ctx2) {
|
|
5669
|
-
queueMicrotask(() => {
|
|
5670
|
-
dom.getControlEl(ctx2)?.focus({ preventScroll: true });
|
|
5671
|
-
});
|
|
5672
|
-
},
|
|
5673
|
-
invokeOnDraw(ctx2) {
|
|
5674
|
-
ctx2.onDraw?.({
|
|
5675
|
-
paths: [...ctx2.paths, ctx2.currentPath]
|
|
5676
|
-
});
|
|
5677
|
-
},
|
|
5678
|
-
invokeOnDrawEnd(ctx2) {
|
|
5679
|
-
ctx2.onDrawEnd?.({
|
|
5680
|
-
paths: [...ctx2.paths],
|
|
5681
|
-
getDataUrl(type, quality = 0.92) {
|
|
5682
|
-
return dom.getDataUrl(ctx2, { type, quality });
|
|
5683
|
-
}
|
|
5684
|
-
});
|
|
5685
|
-
}
|
|
5686
|
-
}
|
|
5687
|
-
}
|
|
5688
|
-
);
|
|
5689
|
-
}
|
|
5690
|
-
createProps()([
|
|
5691
|
-
"dir",
|
|
5692
|
-
"disabled",
|
|
5693
|
-
"getRootNode",
|
|
5694
|
-
"id",
|
|
5695
|
-
"ids",
|
|
5696
|
-
"onDraw",
|
|
5697
|
-
"onDrawEnd",
|
|
5698
|
-
"readOnly",
|
|
5699
|
-
"drawing",
|
|
5700
|
-
"name"
|
|
5701
|
-
]);
|
|
5702
4448
|
|
|
5703
4449
|
const useSignaturePad = props => {
|
|
5704
4450
|
const locale = useLocaleContext();
|
|
5705
4451
|
const environment = useEnvironmentContext();
|
|
5706
4452
|
const id = createUniqueId();
|
|
4453
|
+
const field = useFieldContext();
|
|
5707
4454
|
const context = createMemo(() => ({
|
|
5708
4455
|
id,
|
|
4456
|
+
ids: {
|
|
4457
|
+
label: field?.().ids.label,
|
|
4458
|
+
hiddenInput: field?.().ids.control
|
|
4459
|
+
},
|
|
4460
|
+
disabled: field?.().disabled,
|
|
4461
|
+
readOnly: field?.().readOnly,
|
|
4462
|
+
required: field?.().required,
|
|
5709
4463
|
dir: locale().dir,
|
|
5710
4464
|
getRootNode: environment().getRootNode,
|
|
5711
4465
|
...props
|
|
5712
4466
|
}));
|
|
5713
|
-
const [state, send] = useMachine(machine(context()), {
|
|
4467
|
+
const [state, send] = useMachine(signaturePad$1.machine(context()), {
|
|
5714
4468
|
context
|
|
5715
4469
|
});
|
|
5716
|
-
return createMemo(() => connect(state, send, normalizeProps));
|
|
4470
|
+
return createMemo(() => signaturePad$1.connect(state, send, normalizeProps));
|
|
5717
4471
|
};
|
|
5718
4472
|
|
|
5719
4473
|
const SignaturePadRoot = props => {
|
|
5720
|
-
const [useSignaturePadProps, localProps] = createSplitProps()(props, ['id', 'ids', 'drawing', 'disabled', 'readOnly', 'name', 'onDraw', 'onDrawEnd']);
|
|
4474
|
+
const [useSignaturePadProps, localProps] = createSplitProps()(props, ['id', 'ids', 'drawing', 'disabled', 'readOnly', 'name', 'onDraw', 'onDrawEnd', 'readOnly', 'required', 'translations']);
|
|
5721
4475
|
const signaturePad = useSignaturePad(useSignaturePadProps);
|
|
5722
4476
|
const mergedProps = mergeProps$1(() => signaturePad().getRootProps(), localProps);
|
|
5723
4477
|
return createComponent(SignaturePadProvider, {
|
|
@@ -5781,6 +4535,7 @@ var signaturePad = /*#__PURE__*/Object.freeze({
|
|
|
5781
4535
|
Context: SignaturePadContext,
|
|
5782
4536
|
Control: SignaturePadControl,
|
|
5783
4537
|
Guide: SignaturePadGuide,
|
|
4538
|
+
HiddenInput: SignaturePadHiddenInput,
|
|
5784
4539
|
Label: SignaturePadLabel,
|
|
5785
4540
|
Root: SignaturePadRoot,
|
|
5786
4541
|
RootProvider: SignaturePadRootProvider,
|
|
@@ -6011,7 +4766,12 @@ const SwitchControl = props => {
|
|
|
6011
4766
|
const SwitchHiddenInput = props => {
|
|
6012
4767
|
const api = useSwitchContext();
|
|
6013
4768
|
const mergedProps = mergeProps$1(() => api().getHiddenInputProps(), props);
|
|
6014
|
-
|
|
4769
|
+
const field = useFieldContext();
|
|
4770
|
+
return createComponent(ark.input, mergeProps({
|
|
4771
|
+
get ["aria-describedby"]() {
|
|
4772
|
+
return field?.().ariaDescribedby;
|
|
4773
|
+
}
|
|
4774
|
+
}, mergedProps));
|
|
6015
4775
|
};
|
|
6016
4776
|
|
|
6017
4777
|
const SwitchLabel = props => {
|
|
@@ -6024,8 +4784,17 @@ const useSwitch = props => {
|
|
|
6024
4784
|
const locale = useLocaleContext();
|
|
6025
4785
|
const environment = useEnvironmentContext();
|
|
6026
4786
|
const id = createUniqueId();
|
|
4787
|
+
const field = useFieldContext();
|
|
6027
4788
|
const context = createMemo(() => ({
|
|
6028
4789
|
id,
|
|
4790
|
+
ids: {
|
|
4791
|
+
label: field?.().ids.label,
|
|
4792
|
+
hiddenInput: field?.().ids.control
|
|
4793
|
+
},
|
|
4794
|
+
disabled: field?.().disabled,
|
|
4795
|
+
readOnly: field?.().readOnly,
|
|
4796
|
+
invalid: field?.().invalid,
|
|
4797
|
+
required: field?.().required,
|
|
6029
4798
|
dir: locale().dir,
|
|
6030
4799
|
getRootNode: environment().getRootNode,
|
|
6031
4800
|
checked: props.defaultChecked,
|
|
@@ -6216,7 +4985,12 @@ const TagsInputControl = props => {
|
|
|
6216
4985
|
const TagsInputHiddenInput = props => {
|
|
6217
4986
|
const tagsInput = useTagsInputContext();
|
|
6218
4987
|
const mergedProps = mergeProps$1(() => tagsInput().getHiddenInputProps(), props);
|
|
6219
|
-
|
|
4988
|
+
const field = useFieldContext();
|
|
4989
|
+
return createComponent(ark.input, mergeProps({
|
|
4990
|
+
get ["aria-describedby"]() {
|
|
4991
|
+
return field?.().ariaDescribedby;
|
|
4992
|
+
}
|
|
4993
|
+
}, mergedProps));
|
|
6220
4994
|
};
|
|
6221
4995
|
|
|
6222
4996
|
const TagsInputInput = props => {
|
|
@@ -6293,9 +5067,18 @@ const useTagsInput = props => {
|
|
|
6293
5067
|
const locale = useLocaleContext();
|
|
6294
5068
|
const environment = useEnvironmentContext();
|
|
6295
5069
|
const id = createUniqueId();
|
|
5070
|
+
const field = useFieldContext();
|
|
6296
5071
|
const context = createMemo(() => ({
|
|
6297
5072
|
id,
|
|
5073
|
+
ids: {
|
|
5074
|
+
label: field?.().ids.label,
|
|
5075
|
+
hiddenInput: field?.().ids.control
|
|
5076
|
+
},
|
|
6298
5077
|
dir: locale().dir,
|
|
5078
|
+
disabled: field?.().disabled,
|
|
5079
|
+
invalid: field?.().invalid,
|
|
5080
|
+
readOnly: field?.().readOnly,
|
|
5081
|
+
required: field?.().required,
|
|
6299
5082
|
getRootNode: environment().getRootNode,
|
|
6300
5083
|
value: props.defaultValue,
|
|
6301
5084
|
...props
|
|
@@ -6307,7 +5090,7 @@ const useTagsInput = props => {
|
|
|
6307
5090
|
};
|
|
6308
5091
|
|
|
6309
5092
|
const TagsInputRoot = props => {
|
|
6310
|
-
const [useTagsInputProps, localProps] = createSplitProps()(props, ['addOnPaste', 'allowOverflow', 'autoFocus', 'blurBehavior', 'delimiter', 'defaultValue', 'disabled', 'editable', 'form', 'id', 'ids', 'inputValue', 'invalid', 'max', 'maxLength', 'name', 'onFocusOutside', 'onHighlightChange', 'onInputValueChange', 'onInteractOutside', 'onPointerDownOutside', 'onValueChange', 'onValueInvalid', 'readOnly', 'translations', 'validate', 'value']);
|
|
5093
|
+
const [useTagsInputProps, localProps] = createSplitProps()(props, ['addOnPaste', 'allowOverflow', 'autoFocus', 'blurBehavior', 'delimiter', 'defaultValue', 'disabled', 'editable', 'form', 'id', 'ids', 'inputValue', 'invalid', 'max', 'maxLength', 'name', 'onFocusOutside', 'onHighlightChange', 'onInputValueChange', 'onInteractOutside', 'onPointerDownOutside', 'onValueChange', 'onValueInvalid', 'readOnly', 'required', 'translations', 'validate', 'value']);
|
|
6311
5094
|
const api = useTagsInput(useTagsInputProps);
|
|
6312
5095
|
const mergedProps = mergeProps$1(() => api().getRootProps(), localProps);
|
|
6313
5096
|
return createComponent(TagsInputProvider, {
|
|
@@ -6513,7 +5296,8 @@ var toggleGroup = /*#__PURE__*/Object.freeze({
|
|
|
6513
5296
|
__proto__: null,
|
|
6514
5297
|
Context: ToggleGroupContext,
|
|
6515
5298
|
Item: ToggleGroupItem,
|
|
6516
|
-
Root: ToggleGroupRoot
|
|
5299
|
+
Root: ToggleGroupRoot,
|
|
5300
|
+
RootProvider: ToggleGroupRootProvider
|
|
6517
5301
|
});
|
|
6518
5302
|
|
|
6519
5303
|
const [TooltipProvider, useTooltipContext] = createContext({
|
|
@@ -6583,7 +5367,7 @@ const useTooltip = props => {
|
|
|
6583
5367
|
|
|
6584
5368
|
const TooltipRoot = props => {
|
|
6585
5369
|
const [presenceProps, tooltipProps] = splitPresenceProps(props);
|
|
6586
|
-
const [useTooltipProps, localProps] = createSplitProps()(tooltipProps, ['aria-label', 'closeDelay', 'closeOnEscape', 'closeOnPointerDown', 'defaultOpen', 'disabled', 'id', 'ids', 'interactive', 'onOpenChange', 'open', 'openDelay', 'positioning']);
|
|
5370
|
+
const [useTooltipProps, localProps] = createSplitProps()(tooltipProps, ['aria-label', 'closeDelay', 'closeOnEscape', 'closeOnPointerDown', 'closeOnScroll', 'defaultOpen', 'disabled', 'id', 'ids', 'interactive', 'onOpenChange', 'open', 'openDelay', 'positioning']);
|
|
6587
5371
|
const api = useTooltip(useTooltipProps);
|
|
6588
5372
|
const apiPresence = usePresence(mergeProps$1(presenceProps, () => ({
|
|
6589
5373
|
present: api().open
|
|
@@ -6839,5 +5623,5 @@ var treeView = /*#__PURE__*/Object.freeze({
|
|
|
6839
5623
|
Tree: TreeViewTree
|
|
6840
5624
|
});
|
|
6841
5625
|
|
|
6842
|
-
export { accordion as Accordion, AccordionContext, AccordionItem, AccordionItemContent, AccordionItemContext, AccordionItemIndicator, AccordionItemTrigger, AccordionRoot, AccordionRootProvider, avatar as Avatar, AvatarContext, AvatarFallback, AvatarImage, AvatarRoot, AvatarRootProvider, carousel as Carousel, CarouselContext, CarouselControl, CarouselIndicator, CarouselIndicatorGroup, CarouselItem, CarouselItemGroup, CarouselNextTrigger, CarouselPrevTrigger, CarouselRoot, CarouselRootProvider, CarouselViewport, checkbox as Checkbox, CheckboxContext, CheckboxControl, CheckboxGroup, CheckboxHiddenInput, CheckboxIndicator, CheckboxLabel, CheckboxRoot, CheckboxRootProvider, clipboard as Clipboard, ClipboardContext, ClipboardControl, ClipboardIndicator, ClipboardInput, ClipboardLabel, ClipboardRoot, ClipboardRootProvider, ClipboardTrigger, collapsible as Collapsible, CollapsibleContent, CollapsibleContext, CollapsibleRoot, CollapsibleRootProvider, CollapsibleTrigger, colorPicker as ColorPicker, ColorPickerArea, ColorPickerAreaBackground, ColorPickerAreaThumb, ColorPickerChannelInput, ColorPickerChannelSlider, ColorPickerChannelSliderThumb, ColorPickerChannelSliderTrack, ColorPickerContent, ColorPickerContext, ColorPickerControl, ColorPickerEyeDropperTrigger, ColorPickerFormatSelect, ColorPickerFormatTrigger, ColorPickerHiddenInput, ColorPickerLabel, ColorPickerPositioner, ColorPickerRoot, ColorPickerRootProvider, ColorPickerSwatch, ColorPickerSwatchGroup, ColorPickerSwatchIndicator, ColorPickerSwatchTrigger, ColorPickerTransparencyGrid, ColorPickerTrigger, ColorPickerValueText, ColorPickerView, combobox as Combobox, ComboboxClearTrigger, ComboboxContent, ComboboxContext, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxItemContext, ComboboxItemGroup, ComboboxItemGroupLabel, ComboboxItemIndicator, ComboboxItemText, ComboboxLabel, ComboboxList, ComboboxPositioner, ComboboxRoot, ComboboxRootProvider, ComboboxTrigger, datePicker as DatePicker, DatePickerClearTrigger, DatePickerContent, DatePickerContext, DatePickerControl, DatePickerInput, DatePickerLabel, DatePickerMonthSelect, DatePickerNextTrigger, DatePickerPositioner, DatePickerPresetTrigger, DatePickerPrevTrigger, DatePickerRangeText, DatePickerRoot, DatePickerRootProvider, DatePickerTable, DatePickerTableBody, DatePickerTableCell, DatePickerTableCellTrigger, DatePickerTableHead, DatePickerTableHeader, DatePickerTableRow, DatePickerTrigger, DatePickerView, DatePickerViewControl, DatePickerViewTrigger, DatePickerYearSelect, dialog as Dialog, DialogBackdrop, DialogCloseTrigger, DialogContent, DialogContext, DialogDescription, DialogPositioner, DialogRoot, DialogRootProvider, DialogTitle, DialogTrigger, editable as Editable, EditableArea, EditableCancelTrigger, EditableContext, EditableControl, EditableEditTrigger, EditableInput, EditableLabel, EditablePreview, EditableRoot, EditableRootProvider, EditableSubmitTrigger, EnvironmentProvider, fileUpload as FileUpload, FileUploadContext, FileUploadDropzone, FileUploadHiddenInput, FileUploadItem, FileUploadItemDeleteTrigger, FileUploadItemGroup, FileUploadItemName, FileUploadItemPreview, FileUploadItemPreviewImage, FileUploadItemSizeText, FileUploadLabel, FileUploadRoot, FileUploadRootProvider, FileUploadTrigger, format as Format, FormatByte, FormatNumber, hoverCard as HoverCard, HoverCardArrow, HoverCardArrowTip, HoverCardContent, HoverCardContext, HoverCardPositioner, HoverCardRoot, HoverCardRootProvider, HoverCardTrigger, LocaleProvider, menu as Menu, MenuArrow, MenuArrowTip, MenuCheckboxItem, MenuContent, MenuContext, MenuContextTrigger, MenuIndicator, MenuItem, MenuItemContext, MenuItemGroup, MenuItemGroupLabel, MenuItemIndicator, MenuItemText, MenuPositioner, MenuRadioItem, MenuRadioItemGroup, MenuRoot, MenuRootProvider, MenuSeparator, MenuTrigger, MenuTriggerItem, numberInput as NumberInput, NumberInputContext, NumberInputControl, NumberInputDecrementTrigger, NumberInputIncrementTrigger, NumberInputInput, NumberInputLabel, NumberInputRoot, NumberInputRootProvider, NumberInputScrubber, pagination as Pagination, PaginationContext, PaginationEllipsis, PaginationItem, PaginationNextTrigger, PaginationPrevTrigger, PaginationRoot, PaginationRootProvider, pinInput as PinInput, PinInputContext, PinInputControl, PinInputHiddenInput, PinInputInput, PinInputLabel, PinInputRoot, PinInputRootProvider, popover as Popover, PopoverAnchor, PopoverArrow, PopoverArrowTip, PopoverCloseTrigger, PopoverContent, PopoverContext, PopoverDescription, PopoverIndicator, PopoverPositioner, PopoverRoot, PopoverRootProvider, PopoverTitle, PopoverTrigger, Presence, PresenceProvider, progress as Progress, ProgressCircle, ProgressCircleRange, ProgressCircleTrack, ProgressContext, ProgressLabel, ProgressRange, ProgressRoot, ProgressRootProvider, ProgressTrack, ProgressValueText, ProgressView, qrCode as QrCode, QrCodeContext, QrCodeFrame, QrCodeOverlay, QrCodePattern, QrCodeRoot, QrCodeRootProvider, radioGroup as RadioGroup, RadioGroupContext, RadioGroupIndicator, RadioGroupItem, RadioGroupItemContext, RadioGroupItemControl, RadioGroupItemHiddenInput, RadioGroupItemText, RadioGroupLabel, RadioGroupRoot, RadioGroupRootProvider, ratingGroup as RatingGroup, RatingGroupContext, RatingGroupControl, RatingGroupHiddenInput, RatingGroupItem, RatingGroupItemContext, RatingGroupLabel, RatingGroupRoot, RatingGroupRootProvider, segmentGroup as SegmentGroup, SegmentGroupContext, SegmentGroupIndicator, SegmentGroupItem, SegmentGroupItemContext, SegmentGroupItemControl, SegmentGroupItemHiddenInput, SegmentGroupItemText, SegmentGroupLabel, SegmentGroupRoot, SegmentGroupRootProvider, select as Select, SelectClearTrigger, SelectContent, SelectContext, SelectControl, SelectHiddenSelect, SelectIndicator, SelectItem, SelectItemContext, SelectItemGroup, SelectItemGroupLabel, SelectItemIndicator, SelectItemText, SelectLabel, SelectList, SelectPositioner, SelectRoot, SelectRootProvider, SelectTrigger, SelectValueText, signaturePad as SignaturePad, SignaturePadClearTrigger, SignaturePadContext, SignaturePadControl, SignaturePadGuide, SignaturePadLabel, SignaturePadRoot, SignaturePadRootProvider, SignaturePadSegment, slider as Slider, SliderContext, SliderControl, SliderHiddenInput, SliderLabel, SliderMarker, SliderMarkerGroup, SliderRange, SliderRoot, SliderRootProvider, SliderThumb, SliderTrack, SliderValueText, splitter as Splitter, SplitterContext, SplitterPanel, SplitterResizeTrigger, SplitterRoot, SplitterRootProvider, _switch as Switch, SwitchContext, SwitchControl, SwitchHiddenInput, SwitchLabel, SwitchRoot, SwitchRootProvider, SwitchThumb, TabContent, TabIndicator, TabList, TabTrigger, tabs as Tabs, TabsContext, TabsRoot, TabsRootProvider, tagsInput as TagsInput, TagsInputClearTrigger, TagsInputContext, TagsInputControl, TagsInputHiddenInput, TagsInputInput, TagsInputItem, TagsInputItemContext, TagsInputItemDeleteTrigger, TagsInputItemInput, TagsInputItemPreview, TagsInputItemText, TagsInputLabel, TagsInputRoot, TagsInputRootProvider, toast as Toast, ToastActionTrigger, ToastCloseTrigger, ToastContext, ToastDescription, ToastRoot, ToastTitle, Toaster, toggleGroup as ToggleGroup, ToggleGroupContext, ToggleGroupItem, ToggleGroupRoot, ToggleGroupRootProvider, tooltip as Tooltip, TooltipArrow, TooltipArrowTip, TooltipContent, TooltipContext, TooltipPositioner, TooltipRoot, TooltipRootProvider, TooltipTrigger, treeView as TreeView, TreeViewBranch, TreeViewBranchContent, TreeViewBranchControl, TreeViewBranchIndicator, TreeViewBranchText, TreeViewBranchTrigger, TreeViewContext, TreeViewItem, TreeViewItemContext, TreeViewItemIndicator, TreeViewItemText, TreeViewLabel, TreeViewRoot, TreeViewRootProvider, TreeViewTree, ark, createToaster, splitPresenceProps, useAccordion, useAccordionContext, useAccordionItemContext, useAvatar, useAvatarContext, useCarousel, useCarouselContext, useCheckbox, useCheckboxContext, useCheckboxGroup, useCheckboxGroupContext, useClipboard, useClipboardContext, useCollapsible, useCollapsibleContext, useColorPicker, useColorPickerContext, useCombobox, useComboboxContext, useComboboxItemContext, useDatePicker, useDatePickerContext, useDialog, useDialogContext, useEditable, useEditableContext, useEnvironmentContext, useFileUpload, useFileUploadContext, useHoverCard, useHoverCardContext, useLocaleContext, useMenu, useMenuContext, useMenuItemContext, useNumberInput, useNumberInputContext, usePagination, usePaginationContext, usePinInput, usePinInputContext, usePopover, usePopoverContext, usePresence, usePresenceContext, useProgress, useProgressContext, useQrCode, useQrCodeContext, useRadioGroup, useRadioGroupContext, useRadioGroupItemContext, useRatingGroup, useRatingGroupContext, useRatingGroupItemContext, useSegmentGroup, useSegmentGroupContext, useSegmentGroupItemContext, useSelect, useSelectContext, useSelectItemContext, useSignaturePad, useSignaturePadContext, useSlider, useSliderContext, useSplitter, useSplitterContext, useSwitch, useSwitchContext, useTabs, useTabsContext, useTagsInput, useTagsInputContext, useTagsInputItemContext, useToastContext, useToggleGroup, useToggleGroupContext, useTooltip, useTooltipContext, useTreeView, useTreeViewContext, useTreeViewItemContext };
|
|
5626
|
+
export { accordion as Accordion, AccordionContext, AccordionItem, AccordionItemContent, AccordionItemContext, AccordionItemIndicator, AccordionItemTrigger, AccordionRoot, AccordionRootProvider, avatar as Avatar, AvatarContext, AvatarFallback, AvatarImage, AvatarRoot, AvatarRootProvider, carousel as Carousel, CarouselContext, CarouselControl, CarouselIndicator, CarouselIndicatorGroup, CarouselItem, CarouselItemGroup, CarouselNextTrigger, CarouselPrevTrigger, CarouselRoot, CarouselRootProvider, CarouselViewport, checkbox as Checkbox, CheckboxContext, CheckboxControl, CheckboxGroup, CheckboxHiddenInput, CheckboxIndicator, CheckboxLabel, CheckboxRoot, CheckboxRootProvider, clipboard as Clipboard, ClipboardContext, ClipboardControl, ClipboardIndicator, ClipboardInput, ClipboardLabel, ClipboardRoot, ClipboardRootProvider, ClipboardTrigger, collapsible as Collapsible, CollapsibleContent, CollapsibleContext, CollapsibleRoot, CollapsibleRootProvider, CollapsibleTrigger, colorPicker as ColorPicker, ColorPickerArea, ColorPickerAreaBackground, ColorPickerAreaThumb, ColorPickerChannelInput, ColorPickerChannelSlider, ColorPickerChannelSliderLabel, ColorPickerChannelSliderThumb, ColorPickerChannelSliderTrack, ColorPickerChannelSliderValueText, ColorPickerContent, ColorPickerContext, ColorPickerControl, ColorPickerEyeDropperTrigger, ColorPickerFormatSelect, ColorPickerFormatTrigger, ColorPickerHiddenInput, ColorPickerLabel, ColorPickerPositioner, ColorPickerRoot, ColorPickerRootProvider, ColorPickerSwatch, ColorPickerSwatchGroup, ColorPickerSwatchIndicator, ColorPickerSwatchTrigger, ColorPickerTransparencyGrid, ColorPickerTrigger, ColorPickerValueSwatch, ColorPickerValueText, ColorPickerView, combobox as Combobox, ComboboxClearTrigger, ComboboxContent, ComboboxContext, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxItemContext, ComboboxItemGroup, ComboboxItemGroupLabel, ComboboxItemIndicator, ComboboxItemText, ComboboxLabel, ComboboxList, ComboboxPositioner, ComboboxRoot, ComboboxRootProvider, ComboboxTrigger, datePicker as DatePicker, DatePickerClearTrigger, DatePickerContent, DatePickerContext, DatePickerControl, DatePickerInput, DatePickerLabel, DatePickerMonthSelect, DatePickerNextTrigger, DatePickerPositioner, DatePickerPresetTrigger, DatePickerPrevTrigger, DatePickerRangeText, DatePickerRoot, DatePickerRootProvider, DatePickerTable, DatePickerTableBody, DatePickerTableCell, DatePickerTableCellTrigger, DatePickerTableHead, DatePickerTableHeader, DatePickerTableRow, DatePickerTrigger, DatePickerView, DatePickerViewControl, DatePickerViewTrigger, DatePickerYearSelect, dialog as Dialog, DialogBackdrop, DialogCloseTrigger, DialogContent, DialogContext, DialogDescription, DialogPositioner, DialogRoot, DialogRootProvider, DialogTitle, DialogTrigger, editable as Editable, EditableArea, EditableCancelTrigger, EditableContext, EditableControl, EditableEditTrigger, EditableInput, EditableLabel, EditablePreview, EditableRoot, EditableRootProvider, EditableSubmitTrigger, EnvironmentProvider, field as Field, FieldContext, FieldErrorText, FieldHelperText, FieldInput, FieldLabel, FieldRoot, FieldRootProvider, FieldSelect, FieldTextarea, fileUpload as FileUpload, FileUploadContext, FileUploadDropzone, FileUploadHiddenInput, FileUploadItem, FileUploadItemDeleteTrigger, FileUploadItemGroup, FileUploadItemName, FileUploadItemPreview, FileUploadItemPreviewImage, FileUploadItemSizeText, FileUploadLabel, FileUploadRoot, FileUploadRootProvider, FileUploadTrigger, format as Format, FormatByte, FormatNumber, hoverCard as HoverCard, HoverCardArrow, HoverCardArrowTip, HoverCardContent, HoverCardContext, HoverCardPositioner, HoverCardRoot, HoverCardRootProvider, HoverCardTrigger, LocaleProvider, menu as Menu, MenuArrow, MenuArrowTip, MenuCheckboxItem, MenuContent, MenuContext, MenuContextTrigger, MenuIndicator, MenuItem, MenuItemContext, MenuItemGroup, MenuItemGroupLabel, MenuItemIndicator, MenuItemText, MenuPositioner, MenuRadioItem, MenuRadioItemGroup, MenuRoot, MenuRootProvider, MenuSeparator, MenuTrigger, MenuTriggerItem, numberInput as NumberInput, NumberInputContext, NumberInputControl, NumberInputDecrementTrigger, NumberInputIncrementTrigger, NumberInputInput, NumberInputLabel, NumberInputRoot, NumberInputRootProvider, NumberInputScrubber, pagination as Pagination, PaginationContext, PaginationEllipsis, PaginationItem, PaginationNextTrigger, PaginationPrevTrigger, PaginationRoot, PaginationRootProvider, pinInput as PinInput, PinInputContext, PinInputControl, PinInputHiddenInput, PinInputInput, PinInputLabel, PinInputRoot, PinInputRootProvider, popover as Popover, PopoverAnchor, PopoverArrow, PopoverArrowTip, PopoverCloseTrigger, PopoverContent, PopoverContext, PopoverDescription, PopoverIndicator, PopoverPositioner, PopoverRoot, PopoverRootProvider, PopoverTitle, PopoverTrigger, Presence, PresenceProvider, progress as Progress, ProgressCircle, ProgressCircleRange, ProgressCircleTrack, ProgressContext, ProgressLabel, ProgressRange, ProgressRoot, ProgressRootProvider, ProgressTrack, ProgressValueText, ProgressView, qrCode as QrCode, QrCodeContext, QrCodeFrame, QrCodeOverlay, QrCodePattern, QrCodeRoot, QrCodeRootProvider, radioGroup as RadioGroup, RadioGroupContext, RadioGroupIndicator, RadioGroupItem, RadioGroupItemContext, RadioGroupItemControl, RadioGroupItemHiddenInput, RadioGroupItemText, RadioGroupLabel, RadioGroupRoot, RadioGroupRootProvider, ratingGroup as RatingGroup, RatingGroupContext, RatingGroupControl, RatingGroupHiddenInput, RatingGroupItem, RatingGroupItemContext, RatingGroupLabel, RatingGroupRoot, RatingGroupRootProvider, segmentGroup as SegmentGroup, SegmentGroupContext, SegmentGroupIndicator, SegmentGroupItem, SegmentGroupItemContext, SegmentGroupItemControl, SegmentGroupItemHiddenInput, SegmentGroupItemText, SegmentGroupLabel, SegmentGroupRoot, SegmentGroupRootProvider, select as Select, SelectClearTrigger, SelectContent, SelectContext, SelectControl, SelectHiddenSelect, SelectIndicator, SelectItem, SelectItemContext, SelectItemGroup, SelectItemGroupLabel, SelectItemIndicator, SelectItemText, SelectLabel, SelectList, SelectPositioner, SelectRoot, SelectRootProvider, SelectTrigger, SelectValueText, signaturePad as SignaturePad, SignaturePadClearTrigger, SignaturePadContext, SignaturePadControl, SignaturePadGuide, SignaturePadHiddenInput, SignaturePadLabel, SignaturePadRoot, SignaturePadRootProvider, SignaturePadSegment, slider as Slider, SliderContext, SliderControl, SliderHiddenInput, SliderLabel, SliderMarker, SliderMarkerGroup, SliderRange, SliderRoot, SliderRootProvider, SliderThumb, SliderTrack, SliderValueText, splitter as Splitter, SplitterContext, SplitterPanel, SplitterResizeTrigger, SplitterRoot, SplitterRootProvider, _switch as Switch, SwitchContext, SwitchControl, SwitchHiddenInput, SwitchLabel, SwitchRoot, SwitchRootProvider, SwitchThumb, TabContent, TabIndicator, TabList, TabTrigger, tabs as Tabs, TabsContext, TabsRoot, TabsRootProvider, tagsInput as TagsInput, TagsInputClearTrigger, TagsInputContext, TagsInputControl, TagsInputHiddenInput, TagsInputInput, TagsInputItem, TagsInputItemContext, TagsInputItemDeleteTrigger, TagsInputItemInput, TagsInputItemPreview, TagsInputItemText, TagsInputLabel, TagsInputRoot, TagsInputRootProvider, toast as Toast, ToastActionTrigger, ToastCloseTrigger, ToastContext, ToastDescription, ToastRoot, ToastTitle, Toaster, toggleGroup as ToggleGroup, ToggleGroupContext, ToggleGroupItem, ToggleGroupRoot, ToggleGroupRootProvider, tooltip as Tooltip, TooltipArrow, TooltipArrowTip, TooltipContent, TooltipContext, TooltipPositioner, TooltipRoot, TooltipRootProvider, TooltipTrigger, treeView as TreeView, TreeViewBranch, TreeViewBranchContent, TreeViewBranchControl, TreeViewBranchIndicator, TreeViewBranchText, TreeViewBranchTrigger, TreeViewContext, TreeViewItem, TreeViewItemContext, TreeViewItemIndicator, TreeViewItemText, TreeViewLabel, TreeViewRoot, TreeViewRootProvider, TreeViewTree, ark, createToaster, splitPresenceProps, useAccordion, useAccordionContext, useAccordionItemContext, useAvatar, useAvatarContext, useCarousel, useCarouselContext, useCheckbox, useCheckboxContext, useCheckboxGroup, useCheckboxGroupContext, useClipboard, useClipboardContext, useCollapsible, useCollapsibleContext, useColorPicker, useColorPickerContext, useCombobox, useComboboxContext, useComboboxItemContext, useDatePicker, useDatePickerContext, useDialog, useDialogContext, useEditable, useEditableContext, useEnvironmentContext, useFieldContext, useFileUpload, useFileUploadContext, useHoverCard, useHoverCardContext, useLocaleContext, useMenu, useMenuContext, useMenuItemContext, useNumberInput, useNumberInputContext, usePagination, usePaginationContext, usePinInput, usePinInputContext, usePopover, usePopoverContext, usePresence, usePresenceContext, useProgress, useProgressContext, useQrCode, useQrCodeContext, useRadioGroup, useRadioGroupContext, useRadioGroupItemContext, useRatingGroup, useRatingGroupContext, useRatingGroupItemContext, useSegmentGroup, useSegmentGroupContext, useSegmentGroupItemContext, useSelect, useSelectContext, useSelectItemContext, useSignaturePad, useSignaturePadContext, useSlider, useSliderContext, useSplitter, useSplitterContext, useSwitch, useSwitchContext, useTabs, useTabsContext, useTagsInput, useTagsInputContext, useTagsInputItemContext, useToastContext, useToggleGroup, useToggleGroupContext, useTooltip, useTooltipContext, useTreeView, useTreeViewContext, useTreeViewItemContext };
|
|
6843
5627
|
//# sourceMappingURL=index.js.map
|