@ark-ui/solid 3.3.0 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -7
- package/dist/cjs/index.js +524 -1730
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +498 -1720
- 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 +1 -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.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 +10 -0
- 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 +10 -0
- 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/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
|
}
|
|
@@ -673,15 +673,205 @@ const CheckboxGroup = props => {
|
|
|
673
673
|
return createComponent(CheckboxGroupContextProvider, {
|
|
674
674
|
value: checkboxGroup,
|
|
675
675
|
get children() {
|
|
676
|
-
return createComponent(ark.div, mergeProps(
|
|
676
|
+
return createComponent(ark.div, mergeProps({
|
|
677
|
+
role: "group"
|
|
678
|
+
}, localProps, () => checkboxAnatomy.build().group.attrs));
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
const [FieldProvider, useFieldContext] = createContext({
|
|
684
|
+
hookName: 'useFieldContext',
|
|
685
|
+
providerName: '<FieldProvider />',
|
|
686
|
+
strict: false
|
|
687
|
+
});
|
|
688
|
+
|
|
689
|
+
const FieldContext = props => props.children(useFieldContext());
|
|
690
|
+
|
|
691
|
+
const FieldErrorText = props => {
|
|
692
|
+
const field = useFieldContext();
|
|
693
|
+
const mergedProps = mergeProps$1(() => field().getErrorTextProps(), props);
|
|
694
|
+
return createComponent(Show, {
|
|
695
|
+
get when() {
|
|
696
|
+
return field?.().invalid;
|
|
697
|
+
},
|
|
698
|
+
get children() {
|
|
699
|
+
return createComponent(ark.span, mergedProps);
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
const FieldHelperText = props => {
|
|
705
|
+
const field = useFieldContext();
|
|
706
|
+
const mergedProps = mergeProps$1(() => field().getHelperTextProps(), props);
|
|
707
|
+
return createComponent(ark.span, mergedProps);
|
|
708
|
+
};
|
|
709
|
+
|
|
710
|
+
const FieldInput = props => {
|
|
711
|
+
const field = useFieldContext();
|
|
712
|
+
const mergedProps = mergeProps$1(() => field?.().getInputProps(), props);
|
|
713
|
+
return createComponent(ark.input, mergedProps);
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
const FieldLabel = props => {
|
|
717
|
+
const field = useFieldContext();
|
|
718
|
+
const mergedProps = mergeProps$1(() => field?.().getLabelProps(), props);
|
|
719
|
+
return createComponent(ark.label, mergedProps);
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
const FieldSelect = props => {
|
|
723
|
+
const field = useFieldContext();
|
|
724
|
+
const mergedProps = mergeProps$1(() => field?.().getSelectProps(), props);
|
|
725
|
+
return createComponent(ark.select, mergedProps);
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
const parts = fieldAnatomy.build();
|
|
729
|
+
const useField = props => {
|
|
730
|
+
const {
|
|
731
|
+
required = false,
|
|
732
|
+
disabled = false,
|
|
733
|
+
invalid = false,
|
|
734
|
+
readOnly = false
|
|
735
|
+
} = props;
|
|
736
|
+
const [hasErrorText, setHasErrorText] = createSignal(false);
|
|
737
|
+
const [hasHelperText, setHasHelperText] = createSignal(false);
|
|
738
|
+
const id = props.id ?? `field-${Math.random().toString(36).substr(2, 9)}`;
|
|
739
|
+
let rootRef;
|
|
740
|
+
const errorTextId = `field::${id}::error-text`;
|
|
741
|
+
const helperTextId = `field::${id}::helper-text`;
|
|
742
|
+
const labelId = `field::${id}::label`;
|
|
743
|
+
createEffect(() => {
|
|
744
|
+
return;
|
|
745
|
+
});
|
|
746
|
+
const getRootProps = () => ({
|
|
747
|
+
...parts.root.attrs,
|
|
748
|
+
role: 'group',
|
|
749
|
+
'data-disabled': dataAttr(disabled),
|
|
750
|
+
'data-invalid': dataAttr(invalid),
|
|
751
|
+
'data-readonly': dataAttr(readOnly)
|
|
752
|
+
});
|
|
753
|
+
const getLabelProps = () => ({
|
|
754
|
+
...parts.label.attrs,
|
|
755
|
+
id: labelId,
|
|
756
|
+
'data-disabled': dataAttr(disabled),
|
|
757
|
+
'data-invalid': dataAttr(invalid),
|
|
758
|
+
'data-readonly': dataAttr(readOnly),
|
|
759
|
+
htmlFor: id
|
|
760
|
+
});
|
|
761
|
+
const labelIds = [];
|
|
762
|
+
if (hasErrorText() && invalid) labelIds.push(errorTextId);
|
|
763
|
+
if (hasHelperText()) labelIds.push(helperTextId);
|
|
764
|
+
const getControlProps = () => ({
|
|
765
|
+
'aria-describedby': labelIds.join(' ') || undefined,
|
|
766
|
+
'aria-invalid': ariaAttr(invalid),
|
|
767
|
+
'aria-required': ariaAttr(required),
|
|
768
|
+
'aria-readonly': ariaAttr(readOnly),
|
|
769
|
+
id,
|
|
770
|
+
required,
|
|
771
|
+
disabled,
|
|
772
|
+
readOnly
|
|
773
|
+
});
|
|
774
|
+
const getInputProps = () => ({
|
|
775
|
+
...getControlProps(),
|
|
776
|
+
...parts.input.attrs
|
|
777
|
+
});
|
|
778
|
+
const getTextareaProps = () => ({
|
|
779
|
+
...getControlProps(),
|
|
780
|
+
...parts.textarea.attrs
|
|
781
|
+
});
|
|
782
|
+
const getSelectProps = () => ({
|
|
783
|
+
...getControlProps(),
|
|
784
|
+
...parts.select.attrs
|
|
785
|
+
});
|
|
786
|
+
const getHelperTextProps = () => ({
|
|
787
|
+
id: helperTextId,
|
|
788
|
+
...parts.helperText.attrs
|
|
789
|
+
});
|
|
790
|
+
const getErrorTextProps = () => ({
|
|
791
|
+
id: errorTextId,
|
|
792
|
+
...parts.errorText.attrs,
|
|
793
|
+
'aria-live': 'polite'
|
|
794
|
+
});
|
|
795
|
+
return createMemo(() => ({
|
|
796
|
+
ariaDescribedby: labelIds.join(' '),
|
|
797
|
+
ids: {
|
|
798
|
+
control: id,
|
|
799
|
+
label: labelId,
|
|
800
|
+
errorText: errorTextId,
|
|
801
|
+
helperText: helperTextId
|
|
802
|
+
},
|
|
803
|
+
refs: {
|
|
804
|
+
rootRef
|
|
805
|
+
},
|
|
806
|
+
disabled,
|
|
807
|
+
invalid,
|
|
808
|
+
readOnly,
|
|
809
|
+
required,
|
|
810
|
+
getLabelProps,
|
|
811
|
+
getRootProps,
|
|
812
|
+
getInputProps,
|
|
813
|
+
getTextareaProps,
|
|
814
|
+
getSelectProps,
|
|
815
|
+
getHelperTextProps,
|
|
816
|
+
getErrorTextProps
|
|
817
|
+
}));
|
|
818
|
+
};
|
|
819
|
+
const dataAttr = condition => condition ? '' : undefined;
|
|
820
|
+
const ariaAttr = condition => condition ? true : undefined;
|
|
821
|
+
|
|
822
|
+
const FieldRoot = props => {
|
|
823
|
+
const [useFieldProps, localProps] = createSplitProps()(props, ['id', 'disabled', 'invalid', 'readOnly', 'required']);
|
|
824
|
+
const field = useField(useFieldProps);
|
|
825
|
+
const mergedProps = mergeProps$1(() => field().getRootProps(), localProps);
|
|
826
|
+
return createComponent(FieldProvider, {
|
|
827
|
+
value: field,
|
|
828
|
+
get children() {
|
|
829
|
+
return createComponent(ark.div, mergedProps);
|
|
677
830
|
}
|
|
678
831
|
});
|
|
679
832
|
};
|
|
680
833
|
|
|
834
|
+
const FieldRootProvider = props => {
|
|
835
|
+
const [{
|
|
836
|
+
value: field
|
|
837
|
+
}, localProps] = createSplitProps()(props, ['value']);
|
|
838
|
+
const mergedProps = mergeProps$1(() => field().getRootProps(), localProps);
|
|
839
|
+
return createComponent(FieldProvider, {
|
|
840
|
+
value: field,
|
|
841
|
+
get children() {
|
|
842
|
+
return createComponent(ark.div, mergedProps);
|
|
843
|
+
}
|
|
844
|
+
});
|
|
845
|
+
};
|
|
846
|
+
|
|
847
|
+
const FieldTextarea = props => {
|
|
848
|
+
const field = useFieldContext();
|
|
849
|
+
const mergedProps = mergeProps$1(() => field?.().getTextareaProps(), props);
|
|
850
|
+
return createComponent(ark.textarea, mergedProps);
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
var field = /*#__PURE__*/Object.freeze({
|
|
854
|
+
__proto__: null,
|
|
855
|
+
Context: FieldContext,
|
|
856
|
+
ErrorText: FieldErrorText,
|
|
857
|
+
HelperText: FieldHelperText,
|
|
858
|
+
Input: FieldInput,
|
|
859
|
+
Label: FieldLabel,
|
|
860
|
+
Root: FieldRoot,
|
|
861
|
+
RootProvider: FieldRootProvider,
|
|
862
|
+
Select: FieldSelect,
|
|
863
|
+
Textarea: FieldTextarea
|
|
864
|
+
});
|
|
865
|
+
|
|
681
866
|
const CheckboxHiddenInput = props => {
|
|
682
867
|
const checkbox = useCheckboxContext();
|
|
683
868
|
const mergedProps = mergeProps$1(() => checkbox().getHiddenInputProps(), props);
|
|
684
|
-
|
|
869
|
+
const field = useFieldContext();
|
|
870
|
+
return createComponent(ark.input, mergeProps({
|
|
871
|
+
get ["aria-describedby"]() {
|
|
872
|
+
return field?.().ariaDescribedby;
|
|
873
|
+
}
|
|
874
|
+
}, mergedProps));
|
|
685
875
|
};
|
|
686
876
|
|
|
687
877
|
const CheckboxIndicator = props => {
|
|
@@ -711,8 +901,17 @@ const useCheckbox = ownProps => {
|
|
|
711
901
|
const locale = useLocaleContext();
|
|
712
902
|
const environment = useEnvironmentContext();
|
|
713
903
|
const id = createUniqueId();
|
|
904
|
+
const field = useFieldContext();
|
|
714
905
|
const context = createMemo(() => ({
|
|
715
906
|
id,
|
|
907
|
+
ids: {
|
|
908
|
+
label: field?.().ids.label,
|
|
909
|
+
hiddenInput: field?.().ids.control
|
|
910
|
+
},
|
|
911
|
+
disabled: field?.().disabled,
|
|
912
|
+
readOnly: field?.().readOnly,
|
|
913
|
+
invalid: field?.().invalid,
|
|
914
|
+
required: field?.().required,
|
|
716
915
|
dir: locale().dir,
|
|
717
916
|
getRootNode: environment().getRootNode,
|
|
718
917
|
checked: props().defaultChecked,
|
|
@@ -915,10 +1114,18 @@ const [ColorPickerChannelPropsProvider, useColorPickerChannelPropsContext] = cre
|
|
|
915
1114
|
providerName: '<ColorPickerChannelSliderProvider />'
|
|
916
1115
|
});
|
|
917
1116
|
|
|
1117
|
+
const [ColorPickerFormatPropsProvider, useColorPickerFormatPropsContext] = createContext({
|
|
1118
|
+
hookName: 'useColorPickerFormatPropsContext',
|
|
1119
|
+
providerName: '<ColorPickerFormatPropsProvider />',
|
|
1120
|
+
strict: false
|
|
1121
|
+
});
|
|
1122
|
+
|
|
918
1123
|
const ColorPickerChannelSlider = props => {
|
|
919
1124
|
const [channelProps, localProps] = createSplitProps()(props, ['channel', 'orientation']);
|
|
920
1125
|
const api = useColorPickerContext();
|
|
921
|
-
const
|
|
1126
|
+
const formatProps = useColorPickerFormatPropsContext();
|
|
1127
|
+
const channelSliderProps = mergeProps$1(channelProps, formatProps);
|
|
1128
|
+
const mergedProps = mergeProps$1(() => api().getChannelSliderProps(channelSliderProps), localProps);
|
|
922
1129
|
return createComponent(ColorPickerChannelPropsProvider, {
|
|
923
1130
|
value: channelProps,
|
|
924
1131
|
get children() {
|
|
@@ -927,20 +1134,43 @@ const ColorPickerChannelSlider = props => {
|
|
|
927
1134
|
});
|
|
928
1135
|
};
|
|
929
1136
|
|
|
1137
|
+
const ColorPickerChannelSliderLabel = props => {
|
|
1138
|
+
const colorPicker = useColorPickerContext();
|
|
1139
|
+
const channelProps = useColorPickerChannelPropsContext();
|
|
1140
|
+
const mergedProps = mergeProps$1(() => colorPicker().getChannelSliderLabelProps(channelProps), props);
|
|
1141
|
+
return createComponent(ark.label, mergedProps);
|
|
1142
|
+
};
|
|
1143
|
+
|
|
930
1144
|
const ColorPickerChannelSliderThumb = props => {
|
|
931
1145
|
const api = useColorPickerContext();
|
|
1146
|
+
const formatProps = useColorPickerFormatPropsContext();
|
|
932
1147
|
const channelProps = useColorPickerChannelPropsContext();
|
|
933
|
-
const
|
|
1148
|
+
const channelSliderProps = mergeProps$1(channelProps, formatProps);
|
|
1149
|
+
const mergedProps = mergeProps$1(() => api().getChannelSliderThumbProps(channelSliderProps), props);
|
|
934
1150
|
return createComponent(ark.div, mergedProps);
|
|
935
1151
|
};
|
|
936
1152
|
|
|
937
1153
|
const ColorPickerChannelSliderTrack = props => {
|
|
938
1154
|
const api = useColorPickerContext();
|
|
1155
|
+
const formatProps = useColorPickerFormatPropsContext();
|
|
939
1156
|
const channelProps = useColorPickerChannelPropsContext();
|
|
940
|
-
const
|
|
1157
|
+
const channelSliderProps = mergeProps$1(channelProps, formatProps);
|
|
1158
|
+
const mergedProps = mergeProps$1(() => api().getChannelSliderTrackProps(channelSliderProps), props);
|
|
941
1159
|
return createComponent(ark.div, mergedProps);
|
|
942
1160
|
};
|
|
943
1161
|
|
|
1162
|
+
const ColorPickerChannelSliderValueText = props => {
|
|
1163
|
+
const colorPicker = useColorPickerContext();
|
|
1164
|
+
const localeContext = useLocaleContext();
|
|
1165
|
+
const channelProps = useColorPickerChannelPropsContext();
|
|
1166
|
+
const mergedProps = mergeProps$1(() => colorPicker().getChannelSliderValueTextProps(channelProps), props);
|
|
1167
|
+
return createComponent(ark.span, mergeProps(mergedProps, {
|
|
1168
|
+
get children() {
|
|
1169
|
+
return props.children || colorPicker().getChannelValueText(channelProps.channel, localeContext().locale);
|
|
1170
|
+
}
|
|
1171
|
+
}));
|
|
1172
|
+
};
|
|
1173
|
+
|
|
944
1174
|
const splitPresenceProps = props => createSplitProps()(props, ['immediate', 'lazyMount', 'onExitComplete', 'present', 'unmountOnExit']);
|
|
945
1175
|
|
|
946
1176
|
const usePresence = props => {
|
|
@@ -1044,7 +1274,12 @@ const ColorPickerFormatTrigger = props => {
|
|
|
1044
1274
|
const ColorPickerHiddenInput = props => {
|
|
1045
1275
|
const colorPicker = useColorPickerContext();
|
|
1046
1276
|
const mergedProps = mergeProps$1(() => colorPicker().getHiddenInputProps(), props);
|
|
1047
|
-
|
|
1277
|
+
const field = useFieldContext();
|
|
1278
|
+
return createComponent(ark.input, mergeProps({
|
|
1279
|
+
get ["aria-describedby"]() {
|
|
1280
|
+
return field?.().ariaDescribedby;
|
|
1281
|
+
}
|
|
1282
|
+
}, mergedProps));
|
|
1048
1283
|
};
|
|
1049
1284
|
|
|
1050
1285
|
const ColorPickerLabel = props => {
|
|
@@ -1070,10 +1305,18 @@ const ColorPickerPositioner = props => {
|
|
|
1070
1305
|
const useColorPicker = props => {
|
|
1071
1306
|
const locale = useLocaleContext();
|
|
1072
1307
|
const environment = useEnvironmentContext();
|
|
1308
|
+
const field = useFieldContext();
|
|
1073
1309
|
const id = createUniqueId();
|
|
1074
1310
|
const context = createMemo(() => ({
|
|
1075
1311
|
id,
|
|
1312
|
+
ids: {
|
|
1313
|
+
label: field?.().ids.label,
|
|
1314
|
+
input: field?.().ids.control
|
|
1315
|
+
},
|
|
1076
1316
|
dir: locale().dir,
|
|
1317
|
+
disabled: field?.().disabled,
|
|
1318
|
+
readOnly: field?.().readOnly,
|
|
1319
|
+
required: field?.().required,
|
|
1077
1320
|
getRootNode: environment().getRootNode,
|
|
1078
1321
|
open: props.defaultOpen,
|
|
1079
1322
|
'open.controlled': props.open !== undefined,
|
|
@@ -1088,7 +1331,7 @@ const useColorPicker = props => {
|
|
|
1088
1331
|
|
|
1089
1332
|
const ColorPickerRoot = props => {
|
|
1090
1333
|
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']);
|
|
1334
|
+
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
1335
|
const api = useColorPicker(useColorPickerProps);
|
|
1093
1336
|
const apiPresence = usePresence(mergeProps$1(presenceProps, () => ({
|
|
1094
1337
|
present: api().open
|
|
@@ -1179,6 +1422,26 @@ const ColorPickerTrigger = props => {
|
|
|
1179
1422
|
return createComponent(ark.button, mergedProps);
|
|
1180
1423
|
};
|
|
1181
1424
|
|
|
1425
|
+
const ColorPickerValueSwatch = props => {
|
|
1426
|
+
const [{
|
|
1427
|
+
respectAlpha
|
|
1428
|
+
}, localProps] = createSplitProps()(props, ['respectAlpha']);
|
|
1429
|
+
const colorPicker = useColorPickerContext();
|
|
1430
|
+
const swatchProps = createMemo(() => ({
|
|
1431
|
+
respectAlpha,
|
|
1432
|
+
value: colorPicker().value
|
|
1433
|
+
}));
|
|
1434
|
+
const mergedProps = mergeProps$1(() => colorPicker().getSwatchProps(swatchProps()), localProps);
|
|
1435
|
+
return createComponent(ColorPickerSwatchPropsProvider, {
|
|
1436
|
+
get value() {
|
|
1437
|
+
return swatchProps();
|
|
1438
|
+
},
|
|
1439
|
+
get children() {
|
|
1440
|
+
return createComponent(ark.div, mergedProps);
|
|
1441
|
+
}
|
|
1442
|
+
});
|
|
1443
|
+
};
|
|
1444
|
+
|
|
1182
1445
|
const ColorPickerValueText = props => {
|
|
1183
1446
|
const api = useColorPickerContext();
|
|
1184
1447
|
const mergedProps = mergeProps$1(() => colorPickerAnatomy.build().valueText.attrs, props);
|
|
@@ -1191,17 +1454,23 @@ const ColorPickerValueText = props => {
|
|
|
1191
1454
|
|
|
1192
1455
|
const ColorPickerView = props => {
|
|
1193
1456
|
const api = useColorPickerContext();
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
},
|
|
1457
|
+
const [formatProps, localProps] = createSplitProps()(props, ['format']);
|
|
1458
|
+
const mergedProps = mergeProps$1(() => colorPickerAnatomy.build().view.attrs, localProps);
|
|
1459
|
+
return createComponent(ColorPickerFormatPropsProvider, {
|
|
1460
|
+
value: formatProps,
|
|
1199
1461
|
get children() {
|
|
1200
|
-
return createComponent(
|
|
1201
|
-
get
|
|
1202
|
-
return props.format;
|
|
1462
|
+
return createComponent(Show, {
|
|
1463
|
+
get when() {
|
|
1464
|
+
return api().format === props.format;
|
|
1465
|
+
},
|
|
1466
|
+
get children() {
|
|
1467
|
+
return createComponent(ark.div, mergeProps({
|
|
1468
|
+
get ["data-format"]() {
|
|
1469
|
+
return props.format;
|
|
1470
|
+
}
|
|
1471
|
+
}, mergedProps));
|
|
1203
1472
|
}
|
|
1204
|
-
}
|
|
1473
|
+
});
|
|
1205
1474
|
}
|
|
1206
1475
|
});
|
|
1207
1476
|
};
|
|
@@ -1213,8 +1482,10 @@ var colorPicker = /*#__PURE__*/Object.freeze({
|
|
|
1213
1482
|
AreaThumb: ColorPickerAreaThumb,
|
|
1214
1483
|
ChannelInput: ColorPickerChannelInput,
|
|
1215
1484
|
ChannelSlider: ColorPickerChannelSlider,
|
|
1485
|
+
ChannelSliderLabel: ColorPickerChannelSliderLabel,
|
|
1216
1486
|
ChannelSliderThumb: ColorPickerChannelSliderThumb,
|
|
1217
1487
|
ChannelSliderTrack: ColorPickerChannelSliderTrack,
|
|
1488
|
+
ChannelSliderValueText: ColorPickerChannelSliderValueText,
|
|
1218
1489
|
Content: ColorPickerContent,
|
|
1219
1490
|
Context: ColorPickerContext,
|
|
1220
1491
|
Control: ColorPickerControl,
|
|
@@ -1225,12 +1496,14 @@ var colorPicker = /*#__PURE__*/Object.freeze({
|
|
|
1225
1496
|
Label: ColorPickerLabel,
|
|
1226
1497
|
Positioner: ColorPickerPositioner,
|
|
1227
1498
|
Root: ColorPickerRoot,
|
|
1499
|
+
RootProvider: ColorPickerRootProvider,
|
|
1228
1500
|
Swatch: ColorPickerSwatch,
|
|
1229
1501
|
SwatchGroup: ColorPickerSwatchGroup,
|
|
1230
1502
|
SwatchIndicator: ColorPickerSwatchIndicator,
|
|
1231
1503
|
SwatchTrigger: ColorPickerSwatchTrigger,
|
|
1232
1504
|
TransparencyGrid: ColorPickerTransparencyGrid,
|
|
1233
1505
|
Trigger: ColorPickerTrigger,
|
|
1506
|
+
ValueSwatch: ColorPickerValueSwatch,
|
|
1234
1507
|
ValueText: ColorPickerValueText,
|
|
1235
1508
|
View: ColorPickerView
|
|
1236
1509
|
});
|
|
@@ -1272,7 +1545,12 @@ const ComboboxControl = props => {
|
|
|
1272
1545
|
const ComboboxInput = props => {
|
|
1273
1546
|
const combobox = useComboboxContext();
|
|
1274
1547
|
const mergedProps = mergeProps$1(() => combobox().getInputProps(), props);
|
|
1275
|
-
|
|
1548
|
+
const field = useFieldContext();
|
|
1549
|
+
return createComponent(ark.input, mergeProps({
|
|
1550
|
+
get ["aria-describedby"]() {
|
|
1551
|
+
return field?.().ariaDescribedby;
|
|
1552
|
+
}
|
|
1553
|
+
}, mergedProps));
|
|
1276
1554
|
};
|
|
1277
1555
|
|
|
1278
1556
|
const [ComboboxItemProvider, useComboboxItemContext] = createContext({
|
|
@@ -1380,8 +1658,17 @@ const useCombobox = props => {
|
|
|
1380
1658
|
const locale = useLocaleContext();
|
|
1381
1659
|
const environment = useEnvironmentContext();
|
|
1382
1660
|
const id = createUniqueId();
|
|
1661
|
+
const field = useFieldContext();
|
|
1383
1662
|
const context = createMemo(() => ({
|
|
1384
1663
|
id,
|
|
1664
|
+
ids: {
|
|
1665
|
+
label: field?.().ids.label,
|
|
1666
|
+
input: field?.().ids.control
|
|
1667
|
+
},
|
|
1668
|
+
disabled: field?.().disabled,
|
|
1669
|
+
readOnly: field?.().readOnly,
|
|
1670
|
+
required: field?.().required,
|
|
1671
|
+
invalid: field?.().invalid,
|
|
1385
1672
|
collection: collection(),
|
|
1386
1673
|
dir: locale().dir,
|
|
1387
1674
|
getRootNode: environment().getRootNode,
|
|
@@ -1398,7 +1685,7 @@ const useCombobox = props => {
|
|
|
1398
1685
|
|
|
1399
1686
|
const ComboboxRoot = props => {
|
|
1400
1687
|
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']);
|
|
1688
|
+
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
1689
|
const api = useCombobox(useComboboxProps);
|
|
1403
1690
|
const apiPresence = usePresence(mergeProps$1(presenceProps, () => ({
|
|
1404
1691
|
present: api().open
|
|
@@ -1519,12 +1806,17 @@ const DatePickerMonthSelect = props => {
|
|
|
1519
1806
|
const mergedProps = mergeProps$1(() => api().getMonthSelectProps(), props);
|
|
1520
1807
|
return createComponent(ark.select, mergeProps(mergedProps, {
|
|
1521
1808
|
get children() {
|
|
1522
|
-
return
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1809
|
+
return createComponent(For, {
|
|
1810
|
+
get each() {
|
|
1811
|
+
return api().getMonths();
|
|
1812
|
+
},
|
|
1813
|
+
children: month => (() => {
|
|
1814
|
+
var _el$ = _tmpl$$4();
|
|
1815
|
+
insert(_el$, () => month.label);
|
|
1816
|
+
effect(() => _el$.value = month.value);
|
|
1817
|
+
return _el$;
|
|
1818
|
+
})()
|
|
1819
|
+
});
|
|
1528
1820
|
}
|
|
1529
1821
|
}));
|
|
1530
1822
|
};
|
|
@@ -1791,15 +2083,20 @@ const DatePickerYearSelect = props => {
|
|
|
1791
2083
|
const mergedProps = mergeProps$1(() => api().getYearSelectProps(), props);
|
|
1792
2084
|
return createComponent(ark.select, mergeProps(mergedProps, {
|
|
1793
2085
|
get children() {
|
|
1794
|
-
return
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
2086
|
+
return createComponent(For, {
|
|
2087
|
+
get each() {
|
|
2088
|
+
return getYearsRange({
|
|
2089
|
+
from: 1_000,
|
|
2090
|
+
to: 4_000
|
|
2091
|
+
});
|
|
2092
|
+
},
|
|
2093
|
+
children: year => (() => {
|
|
2094
|
+
var _el$ = _tmpl$$3();
|
|
2095
|
+
_el$.value = year;
|
|
2096
|
+
insert(_el$, year);
|
|
2097
|
+
return _el$;
|
|
2098
|
+
})()
|
|
2099
|
+
});
|
|
1803
2100
|
}
|
|
1804
2101
|
}));
|
|
1805
2102
|
};
|
|
@@ -2038,7 +2335,12 @@ const EditableEditTrigger = props => {
|
|
|
2038
2335
|
const EditableInput = props => {
|
|
2039
2336
|
const api = useEditableContext();
|
|
2040
2337
|
const mergedProps = mergeProps$1(() => api().getInputProps(), props);
|
|
2041
|
-
|
|
2338
|
+
const field = useFieldContext();
|
|
2339
|
+
return createComponent(ark.input, mergeProps({
|
|
2340
|
+
get ["aria-describedby"]() {
|
|
2341
|
+
return field?.().ariaDescribedby;
|
|
2342
|
+
}
|
|
2343
|
+
}, mergedProps));
|
|
2042
2344
|
};
|
|
2043
2345
|
|
|
2044
2346
|
const EditableLabel = props => {
|
|
@@ -2057,9 +2359,18 @@ const useEditable = props => {
|
|
|
2057
2359
|
const locale = useLocaleContext();
|
|
2058
2360
|
const environment = useEnvironmentContext();
|
|
2059
2361
|
const id = createUniqueId();
|
|
2362
|
+
const field = useFieldContext();
|
|
2060
2363
|
const context = createMemo(() => ({
|
|
2061
2364
|
id,
|
|
2365
|
+
ids: {
|
|
2366
|
+
label: field?.().ids.label,
|
|
2367
|
+
input: field?.().ids.control
|
|
2368
|
+
},
|
|
2062
2369
|
dir: locale().dir,
|
|
2370
|
+
disabled: field?.().disabled,
|
|
2371
|
+
invalid: field?.().invalid,
|
|
2372
|
+
readOnly: field?.().readOnly,
|
|
2373
|
+
required: field?.().required,
|
|
2063
2374
|
getRootNode: environment().getRootNode,
|
|
2064
2375
|
value: props.defaultValue,
|
|
2065
2376
|
...props
|
|
@@ -2071,7 +2382,7 @@ const useEditable = props => {
|
|
|
2071
2382
|
};
|
|
2072
2383
|
|
|
2073
2384
|
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']);
|
|
2385
|
+
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
2386
|
const api = useEditable(useEditableProps);
|
|
2076
2387
|
const mergedProps = mergeProps$1(() => api().getRootProps(), localProps);
|
|
2077
2388
|
return createComponent(EditableProvider, {
|
|
@@ -2132,7 +2443,12 @@ const FileUploadDropzone = props => {
|
|
|
2132
2443
|
const FileUploadHiddenInput = props => {
|
|
2133
2444
|
const fileUpload = useFileUploadContext();
|
|
2134
2445
|
const mergedProps = mergeProps$1(() => fileUpload().getHiddenInputProps(), props);
|
|
2135
|
-
|
|
2446
|
+
const field = useFieldContext();
|
|
2447
|
+
return createComponent(ark.input, mergeProps({
|
|
2448
|
+
get ["aria-describedby"]() {
|
|
2449
|
+
return field?.().ariaDescribedby;
|
|
2450
|
+
}
|
|
2451
|
+
}, mergedProps));
|
|
2136
2452
|
};
|
|
2137
2453
|
|
|
2138
2454
|
const [FileUploadItemPropsProvider, useFileUploadItemPropsContext] = createContext({
|
|
@@ -2217,9 +2533,16 @@ const useFileUpload = props => {
|
|
|
2217
2533
|
const locale = useLocaleContext();
|
|
2218
2534
|
const environment = useEnvironmentContext();
|
|
2219
2535
|
const id = createUniqueId();
|
|
2536
|
+
const field = useFieldContext();
|
|
2220
2537
|
const context = createMemo(() => ({
|
|
2221
2538
|
id,
|
|
2539
|
+
ids: {
|
|
2540
|
+
label: field?.().ids.label,
|
|
2541
|
+
hiddenInput: field?.().ids.control
|
|
2542
|
+
},
|
|
2222
2543
|
dir: locale().dir,
|
|
2544
|
+
disabled: field?.().disabled,
|
|
2545
|
+
required: field?.().required,
|
|
2223
2546
|
getRootNode: environment().getRootNode,
|
|
2224
2547
|
...props
|
|
2225
2548
|
}));
|
|
@@ -2230,7 +2553,7 @@ const useFileUpload = props => {
|
|
|
2230
2553
|
};
|
|
2231
2554
|
|
|
2232
2555
|
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']);
|
|
2556
|
+
const [fileUploadProps, localProps] = createSplitProps()(props, ['accept', 'allowDrop', 'capture', 'directory', 'disabled', 'id', 'ids', 'locale', 'maxFiles', 'maxFileSize', 'minFileSize', 'name', 'onFileAccept', 'onFileChange', 'onFileReject', 'required', 'translations', 'validate']);
|
|
2234
2557
|
const fileUpload = useFileUpload(fileUploadProps);
|
|
2235
2558
|
const mergedProps = mergeProps$1(() => fileUpload().getRootProps(), localProps);
|
|
2236
2559
|
return createComponent(FileUploadProvider, {
|
|
@@ -2456,12 +2779,12 @@ const MenuCheckboxItem = props => {
|
|
|
2456
2779
|
});
|
|
2457
2780
|
const context = useMenuContext();
|
|
2458
2781
|
const mergedProps = mergeProps$1(() => context().getOptionItemProps(optionItemProps), localProps);
|
|
2459
|
-
const
|
|
2782
|
+
const optionItemState = createMemo(() => context().getItemState(optionItemProps));
|
|
2460
2783
|
return createComponent(MenuOptionItemPropsProvider, {
|
|
2461
2784
|
value: optionItemProps,
|
|
2462
2785
|
get children() {
|
|
2463
2786
|
return createComponent(MenuItemProvider, {
|
|
2464
|
-
value:
|
|
2787
|
+
value: optionItemState,
|
|
2465
2788
|
get children() {
|
|
2466
2789
|
return createComponent(ark.div, mergedProps);
|
|
2467
2790
|
}
|
|
@@ -2582,12 +2905,12 @@ const MenuRadioItem = props => {
|
|
|
2582
2905
|
})
|
|
2583
2906
|
}));
|
|
2584
2907
|
const mergedProps = mergeProps$1(() => context().getOptionItemProps(optionItemProps), localProps);
|
|
2585
|
-
const
|
|
2908
|
+
const optionItemState = createMemo(() => context().getOptionItemState(optionItemProps));
|
|
2586
2909
|
return createComponent(MenuOptionItemPropsProvider, {
|
|
2587
2910
|
value: optionItemProps,
|
|
2588
2911
|
get children() {
|
|
2589
2912
|
return createComponent(MenuItemProvider, {
|
|
2590
|
-
value:
|
|
2913
|
+
value: optionItemState,
|
|
2591
2914
|
get children() {
|
|
2592
2915
|
return createComponent(ark.div, mergedProps);
|
|
2593
2916
|
}
|
|
@@ -2801,7 +3124,12 @@ const NumberInputIncrementTrigger = props => {
|
|
|
2801
3124
|
const NumberInputInput = props => {
|
|
2802
3125
|
const api = useNumberInputContext();
|
|
2803
3126
|
const mergedProps = mergeProps$1(() => api().getInputProps(), props);
|
|
2804
|
-
|
|
3127
|
+
const field = useFieldContext();
|
|
3128
|
+
return createComponent(ark.input, mergeProps({
|
|
3129
|
+
get ["aria-describedby"]() {
|
|
3130
|
+
return field?.().ariaDescribedby;
|
|
3131
|
+
}
|
|
3132
|
+
}, mergedProps));
|
|
2805
3133
|
};
|
|
2806
3134
|
|
|
2807
3135
|
const NumberInputLabel = props => {
|
|
@@ -2814,8 +3142,17 @@ const useNumberInput = props => {
|
|
|
2814
3142
|
const locale = useLocaleContext();
|
|
2815
3143
|
const environment = useEnvironmentContext();
|
|
2816
3144
|
const id = createUniqueId();
|
|
3145
|
+
const field = useFieldContext();
|
|
2817
3146
|
const context = createMemo(() => ({
|
|
2818
3147
|
id,
|
|
3148
|
+
ids: {
|
|
3149
|
+
label: field?.().ids.label,
|
|
3150
|
+
input: field?.().ids.control
|
|
3151
|
+
},
|
|
3152
|
+
disabled: field?.().disabled,
|
|
3153
|
+
readOnly: field?.().readOnly,
|
|
3154
|
+
required: field?.().required,
|
|
3155
|
+
invalid: field?.().invalid,
|
|
2819
3156
|
dir: locale().dir,
|
|
2820
3157
|
getRootNode: environment().getRootNode,
|
|
2821
3158
|
value: props.defaultValue,
|
|
@@ -2828,7 +3165,7 @@ const useNumberInput = props => {
|
|
|
2828
3165
|
};
|
|
2829
3166
|
|
|
2830
3167
|
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']);
|
|
3168
|
+
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
3169
|
const api = useNumberInput(useNumberInputProps);
|
|
2833
3170
|
const mergedProps = mergeProps$1(() => api().getRootProps(), localProps);
|
|
2834
3171
|
return createComponent(NumberInputProvider, {
|
|
@@ -2867,6 +3204,7 @@ var numberInput = /*#__PURE__*/Object.freeze({
|
|
|
2867
3204
|
Input: NumberInputInput,
|
|
2868
3205
|
Label: NumberInputLabel,
|
|
2869
3206
|
Root: NumberInputRoot,
|
|
3207
|
+
RootProvider: NumberInputRootProvider,
|
|
2870
3208
|
Scrubber: NumberInputScrubber
|
|
2871
3209
|
});
|
|
2872
3210
|
|
|
@@ -2972,7 +3310,12 @@ const PinInputControl = props => {
|
|
|
2972
3310
|
const PinInputHiddenInput = props => {
|
|
2973
3311
|
const pinInput = usePinInputContext();
|
|
2974
3312
|
const mergedProps = mergeProps$1(() => pinInput().getHiddenInputProps(), props);
|
|
2975
|
-
|
|
3313
|
+
const field = useFieldContext();
|
|
3314
|
+
return createComponent(ark.input, mergeProps({
|
|
3315
|
+
get ["aria-describedby"]() {
|
|
3316
|
+
return field?.().ariaDescribedby;
|
|
3317
|
+
}
|
|
3318
|
+
}, mergedProps));
|
|
2976
3319
|
};
|
|
2977
3320
|
|
|
2978
3321
|
const PinInputInput = props => {
|
|
@@ -2992,8 +3335,17 @@ const usePinInput = props => {
|
|
|
2992
3335
|
const locale = useLocaleContext();
|
|
2993
3336
|
const environment = useEnvironmentContext();
|
|
2994
3337
|
const id = createUniqueId();
|
|
3338
|
+
const field = useFieldContext();
|
|
2995
3339
|
const context = createMemo(() => ({
|
|
2996
3340
|
id,
|
|
3341
|
+
ids: {
|
|
3342
|
+
label: field?.().ids.label,
|
|
3343
|
+
hiddenInput: field?.().ids.control
|
|
3344
|
+
},
|
|
3345
|
+
disabled: field?.().disabled,
|
|
3346
|
+
readOnly: field?.().readOnly,
|
|
3347
|
+
required: field?.().required,
|
|
3348
|
+
invalid: field?.().invalid,
|
|
2997
3349
|
dir: locale().dir,
|
|
2998
3350
|
getRootNode: environment().getRootNode,
|
|
2999
3351
|
value: props.defaultValue,
|
|
@@ -3006,7 +3358,7 @@ const usePinInput = props => {
|
|
|
3006
3358
|
};
|
|
3007
3359
|
|
|
3008
3360
|
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']);
|
|
3361
|
+
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
3362
|
const pinInput = usePinInput(usePinInputProps);
|
|
3011
3363
|
const mergedProps = mergeProps$1(() => pinInput().getRootProps(), localProps);
|
|
3012
3364
|
return createComponent(PinInputProvider, {
|
|
@@ -3536,7 +3888,12 @@ const RatingGroupControl = props => {
|
|
|
3536
3888
|
const RatingGroupHiddenInput = props => {
|
|
3537
3889
|
const ratingGroup = useRatingGroupContext();
|
|
3538
3890
|
const mergedProps = mergeProps$1(() => ratingGroup().getHiddenInputProps(), props);
|
|
3539
|
-
|
|
3891
|
+
const field = useFieldContext();
|
|
3892
|
+
return createComponent(ark.input, mergeProps({
|
|
3893
|
+
get ["aria-describedby"]() {
|
|
3894
|
+
return field?.().ariaDescribedby;
|
|
3895
|
+
}
|
|
3896
|
+
}, mergedProps));
|
|
3540
3897
|
};
|
|
3541
3898
|
|
|
3542
3899
|
const [RatingGroupItemProvider, useRatingGroupItemContext] = createContext({
|
|
@@ -3569,8 +3926,16 @@ const useRatingGroup = props => {
|
|
|
3569
3926
|
const locale = useLocaleContext();
|
|
3570
3927
|
const environment = useEnvironmentContext();
|
|
3571
3928
|
const id = createUniqueId();
|
|
3929
|
+
const field = useFieldContext();
|
|
3572
3930
|
const context = createMemo(() => ({
|
|
3573
3931
|
id,
|
|
3932
|
+
ids: {
|
|
3933
|
+
label: field?.().ids.label,
|
|
3934
|
+
hiddenInput: field?.().ids.control
|
|
3935
|
+
},
|
|
3936
|
+
disabled: field?.().disabled,
|
|
3937
|
+
readOnly: field?.().readOnly,
|
|
3938
|
+
required: field?.().required,
|
|
3574
3939
|
dir: locale().dir,
|
|
3575
3940
|
getRootNode: environment().getRootNode,
|
|
3576
3941
|
value: props.defaultValue,
|
|
@@ -3583,7 +3948,7 @@ const useRatingGroup = props => {
|
|
|
3583
3948
|
};
|
|
3584
3949
|
|
|
3585
3950
|
const RatingGroupRoot = props => {
|
|
3586
|
-
const [useRatingProps, localProps] = createSplitProps()(props, ['allowHalf', 'autoFocus', 'count', 'defaultValue', 'disabled', 'form', 'id', 'ids', 'name', 'onHoverChange', 'onValueChange', 'readOnly', 'translations', 'value']);
|
|
3951
|
+
const [useRatingProps, localProps] = createSplitProps()(props, ['allowHalf', 'autoFocus', 'count', 'defaultValue', 'disabled', 'form', 'id', 'ids', 'name', 'onHoverChange', 'onValueChange', 'readOnly', 'required', 'translations', 'value']);
|
|
3587
3952
|
const api = useRatingGroup(useRatingProps);
|
|
3588
3953
|
const mergedProps = mergeProps$1(() => api().getRootProps(), localProps);
|
|
3589
3954
|
return createComponent(RatingGroupProvider, {
|
|
@@ -3615,7 +3980,8 @@ var ratingGroup = /*#__PURE__*/Object.freeze({
|
|
|
3615
3980
|
Item: RatingGroupItem,
|
|
3616
3981
|
ItemContext: RatingGroupItemContext,
|
|
3617
3982
|
Label: RatingGroupLabel,
|
|
3618
|
-
Root: RatingGroupRoot
|
|
3983
|
+
Root: RatingGroupRoot,
|
|
3984
|
+
RootProvider: RatingGroupRootProvider
|
|
3619
3985
|
});
|
|
3620
3986
|
|
|
3621
3987
|
const [SegmentGroupProvider, useSegmentGroupContext] = createContext({
|
|
@@ -3740,7 +4106,8 @@ var segmentGroup = /*#__PURE__*/Object.freeze({
|
|
|
3740
4106
|
ItemHiddenInput: SegmentGroupItemHiddenInput,
|
|
3741
4107
|
ItemText: SegmentGroupItemText,
|
|
3742
4108
|
Label: SegmentGroupLabel,
|
|
3743
|
-
Root: SegmentGroupRoot
|
|
4109
|
+
Root: SegmentGroupRoot,
|
|
4110
|
+
RootProvider: SegmentGroupRootProvider
|
|
3744
4111
|
});
|
|
3745
4112
|
|
|
3746
4113
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
@@ -3781,9 +4148,14 @@ var _tmpl$$2 = /*#__PURE__*/template(`<option value="">`),
|
|
|
3781
4148
|
_tmpl$2$1 = /*#__PURE__*/template(`<option>`);
|
|
3782
4149
|
const SelectHiddenSelect = props => {
|
|
3783
4150
|
const select = useSelectContext();
|
|
3784
|
-
const mergedProps = mergeProps$1(() => select().
|
|
4151
|
+
const mergedProps = mergeProps$1(() => select().getHiddenSelectProps(), props);
|
|
3785
4152
|
const isValueEmpty = createMemo(() => select().value.length === 0);
|
|
3786
|
-
|
|
4153
|
+
const field = useFieldContext();
|
|
4154
|
+
return createComponent(ark.select, mergeProps({
|
|
4155
|
+
get ["aria-describedby"]() {
|
|
4156
|
+
return field?.().ariaDescribedby;
|
|
4157
|
+
}
|
|
4158
|
+
}, mergedProps, {
|
|
3787
4159
|
get children() {
|
|
3788
4160
|
return [createComponent(Show, {
|
|
3789
4161
|
get when() {
|
|
@@ -3918,8 +4290,17 @@ const useSelect = props => {
|
|
|
3918
4290
|
const locale = useLocaleContext();
|
|
3919
4291
|
const environment = useEnvironmentContext();
|
|
3920
4292
|
const id = createUniqueId();
|
|
4293
|
+
const field = useFieldContext();
|
|
3921
4294
|
const context = createMemo(() => ({
|
|
3922
4295
|
id,
|
|
4296
|
+
ids: {
|
|
4297
|
+
label: field?.().ids.label,
|
|
4298
|
+
hiddenSelect: field?.().ids.control
|
|
4299
|
+
},
|
|
4300
|
+
disabled: field?.().disabled,
|
|
4301
|
+
readOnly: field?.().readOnly,
|
|
4302
|
+
invalid: field?.().invalid,
|
|
4303
|
+
required: field?.().required,
|
|
3923
4304
|
collection: collection(),
|
|
3924
4305
|
dir: locale().dir,
|
|
3925
4306
|
getRootNode: environment().getRootNode,
|
|
@@ -3936,7 +4317,7 @@ const useSelect = props => {
|
|
|
3936
4317
|
|
|
3937
4318
|
const SelectRoot = props => {
|
|
3938
4319
|
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']);
|
|
4320
|
+
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
4321
|
const select = useSelect(useSelectProps);
|
|
3941
4322
|
const presenceApi = usePresence(mergeProps$1(() => ({
|
|
3942
4323
|
present: select().open
|
|
@@ -4032,9 +4413,7 @@ const SignaturePadContext = props => props.children(useSignaturePadContext());
|
|
|
4032
4413
|
const SignaturePadControl = props => {
|
|
4033
4414
|
const signaturePad = useSignaturePadContext();
|
|
4034
4415
|
const mergedProps = mergeProps$1(() => signaturePad().getControlProps(), props);
|
|
4035
|
-
return createComponent(ark.div,
|
|
4036
|
-
role: "application"
|
|
4037
|
-
}, mergedProps));
|
|
4416
|
+
return createComponent(ark.div, mergedProps);
|
|
4038
4417
|
};
|
|
4039
4418
|
|
|
4040
4419
|
const SignaturePadGuide = props => {
|
|
@@ -4049,1675 +4428,44 @@ const SignaturePadLabel = props => {
|
|
|
4049
4428
|
return createComponent(ark.label, mergedProps);
|
|
4050
4429
|
};
|
|
4051
4430
|
|
|
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
|
-
}
|
|
4431
|
+
const SignaturePadHiddenInput = props => {
|
|
4432
|
+
const [hiddenInputProps, localProps] = createSplitProps()(props, ['value']);
|
|
4433
|
+
const signaturePad = useSignaturePadContext();
|
|
4434
|
+
const mergedProps = mergeProps$1(() => signaturePad().getHiddenInputProps(hiddenInputProps), localProps);
|
|
4435
|
+
const field = useFieldContext();
|
|
4436
|
+
return createComponent(ark.input, mergeProps({
|
|
4437
|
+
get ["aria-describedby"]() {
|
|
4438
|
+
return field?.().ariaDescribedby;
|
|
4820
4439
|
}
|
|
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
|
-
}
|
|
4440
|
+
}, mergedProps));
|
|
5394
4441
|
};
|
|
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
4442
|
|
|
5703
4443
|
const useSignaturePad = props => {
|
|
5704
4444
|
const locale = useLocaleContext();
|
|
5705
4445
|
const environment = useEnvironmentContext();
|
|
5706
4446
|
const id = createUniqueId();
|
|
4447
|
+
const field = useFieldContext();
|
|
5707
4448
|
const context = createMemo(() => ({
|
|
5708
4449
|
id,
|
|
4450
|
+
ids: {
|
|
4451
|
+
label: field?.().ids.label,
|
|
4452
|
+
hiddenInput: field?.().ids.control
|
|
4453
|
+
},
|
|
4454
|
+
disabled: field?.().disabled,
|
|
4455
|
+
readOnly: field?.().readOnly,
|
|
4456
|
+
required: field?.().required,
|
|
5709
4457
|
dir: locale().dir,
|
|
5710
4458
|
getRootNode: environment().getRootNode,
|
|
5711
4459
|
...props
|
|
5712
4460
|
}));
|
|
5713
|
-
const [state, send] = useMachine(machine(context()), {
|
|
4461
|
+
const [state, send] = useMachine(signaturePad$1.machine(context()), {
|
|
5714
4462
|
context
|
|
5715
4463
|
});
|
|
5716
|
-
return createMemo(() => connect(state, send, normalizeProps));
|
|
4464
|
+
return createMemo(() => signaturePad$1.connect(state, send, normalizeProps));
|
|
5717
4465
|
};
|
|
5718
4466
|
|
|
5719
4467
|
const SignaturePadRoot = props => {
|
|
5720
|
-
const [useSignaturePadProps, localProps] = createSplitProps()(props, ['id', 'ids', 'drawing', 'disabled', 'readOnly', 'name', 'onDraw', 'onDrawEnd']);
|
|
4468
|
+
const [useSignaturePadProps, localProps] = createSplitProps()(props, ['id', 'ids', 'drawing', 'disabled', 'readOnly', 'name', 'onDraw', 'onDrawEnd', 'readOnly', 'required', 'translations']);
|
|
5721
4469
|
const signaturePad = useSignaturePad(useSignaturePadProps);
|
|
5722
4470
|
const mergedProps = mergeProps$1(() => signaturePad().getRootProps(), localProps);
|
|
5723
4471
|
return createComponent(SignaturePadProvider, {
|
|
@@ -5781,6 +4529,7 @@ var signaturePad = /*#__PURE__*/Object.freeze({
|
|
|
5781
4529
|
Context: SignaturePadContext,
|
|
5782
4530
|
Control: SignaturePadControl,
|
|
5783
4531
|
Guide: SignaturePadGuide,
|
|
4532
|
+
HiddenInput: SignaturePadHiddenInput,
|
|
5784
4533
|
Label: SignaturePadLabel,
|
|
5785
4534
|
Root: SignaturePadRoot,
|
|
5786
4535
|
RootProvider: SignaturePadRootProvider,
|
|
@@ -6011,7 +4760,12 @@ const SwitchControl = props => {
|
|
|
6011
4760
|
const SwitchHiddenInput = props => {
|
|
6012
4761
|
const api = useSwitchContext();
|
|
6013
4762
|
const mergedProps = mergeProps$1(() => api().getHiddenInputProps(), props);
|
|
6014
|
-
|
|
4763
|
+
const field = useFieldContext();
|
|
4764
|
+
return createComponent(ark.input, mergeProps({
|
|
4765
|
+
get ["aria-describedby"]() {
|
|
4766
|
+
return field?.().ariaDescribedby;
|
|
4767
|
+
}
|
|
4768
|
+
}, mergedProps));
|
|
6015
4769
|
};
|
|
6016
4770
|
|
|
6017
4771
|
const SwitchLabel = props => {
|
|
@@ -6024,8 +4778,17 @@ const useSwitch = props => {
|
|
|
6024
4778
|
const locale = useLocaleContext();
|
|
6025
4779
|
const environment = useEnvironmentContext();
|
|
6026
4780
|
const id = createUniqueId();
|
|
4781
|
+
const field = useFieldContext();
|
|
6027
4782
|
const context = createMemo(() => ({
|
|
6028
4783
|
id,
|
|
4784
|
+
ids: {
|
|
4785
|
+
label: field?.().ids.label,
|
|
4786
|
+
hiddenInput: field?.().ids.control
|
|
4787
|
+
},
|
|
4788
|
+
disabled: field?.().disabled,
|
|
4789
|
+
readOnly: field?.().readOnly,
|
|
4790
|
+
invalid: field?.().invalid,
|
|
4791
|
+
required: field?.().required,
|
|
6029
4792
|
dir: locale().dir,
|
|
6030
4793
|
getRootNode: environment().getRootNode,
|
|
6031
4794
|
checked: props.defaultChecked,
|
|
@@ -6216,7 +4979,12 @@ const TagsInputControl = props => {
|
|
|
6216
4979
|
const TagsInputHiddenInput = props => {
|
|
6217
4980
|
const tagsInput = useTagsInputContext();
|
|
6218
4981
|
const mergedProps = mergeProps$1(() => tagsInput().getHiddenInputProps(), props);
|
|
6219
|
-
|
|
4982
|
+
const field = useFieldContext();
|
|
4983
|
+
return createComponent(ark.input, mergeProps({
|
|
4984
|
+
get ["aria-describedby"]() {
|
|
4985
|
+
return field?.().ariaDescribedby;
|
|
4986
|
+
}
|
|
4987
|
+
}, mergedProps));
|
|
6220
4988
|
};
|
|
6221
4989
|
|
|
6222
4990
|
const TagsInputInput = props => {
|
|
@@ -6293,9 +5061,18 @@ const useTagsInput = props => {
|
|
|
6293
5061
|
const locale = useLocaleContext();
|
|
6294
5062
|
const environment = useEnvironmentContext();
|
|
6295
5063
|
const id = createUniqueId();
|
|
5064
|
+
const field = useFieldContext();
|
|
6296
5065
|
const context = createMemo(() => ({
|
|
6297
5066
|
id,
|
|
5067
|
+
ids: {
|
|
5068
|
+
label: field?.().ids.label,
|
|
5069
|
+
hiddenInput: field?.().ids.control
|
|
5070
|
+
},
|
|
6298
5071
|
dir: locale().dir,
|
|
5072
|
+
disabled: field?.().disabled,
|
|
5073
|
+
invalid: field?.().invalid,
|
|
5074
|
+
readOnly: field?.().readOnly,
|
|
5075
|
+
required: field?.().required,
|
|
6299
5076
|
getRootNode: environment().getRootNode,
|
|
6300
5077
|
value: props.defaultValue,
|
|
6301
5078
|
...props
|
|
@@ -6307,7 +5084,7 @@ const useTagsInput = props => {
|
|
|
6307
5084
|
};
|
|
6308
5085
|
|
|
6309
5086
|
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']);
|
|
5087
|
+
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
5088
|
const api = useTagsInput(useTagsInputProps);
|
|
6312
5089
|
const mergedProps = mergeProps$1(() => api().getRootProps(), localProps);
|
|
6313
5090
|
return createComponent(TagsInputProvider, {
|
|
@@ -6513,7 +5290,8 @@ var toggleGroup = /*#__PURE__*/Object.freeze({
|
|
|
6513
5290
|
__proto__: null,
|
|
6514
5291
|
Context: ToggleGroupContext,
|
|
6515
5292
|
Item: ToggleGroupItem,
|
|
6516
|
-
Root: ToggleGroupRoot
|
|
5293
|
+
Root: ToggleGroupRoot,
|
|
5294
|
+
RootProvider: ToggleGroupRootProvider
|
|
6517
5295
|
});
|
|
6518
5296
|
|
|
6519
5297
|
const [TooltipProvider, useTooltipContext] = createContext({
|
|
@@ -6583,7 +5361,7 @@ const useTooltip = props => {
|
|
|
6583
5361
|
|
|
6584
5362
|
const TooltipRoot = props => {
|
|
6585
5363
|
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']);
|
|
5364
|
+
const [useTooltipProps, localProps] = createSplitProps()(tooltipProps, ['aria-label', 'closeDelay', 'closeOnEscape', 'closeOnPointerDown', 'closeOnScroll', 'defaultOpen', 'disabled', 'id', 'ids', 'interactive', 'onOpenChange', 'open', 'openDelay', 'positioning']);
|
|
6587
5365
|
const api = useTooltip(useTooltipProps);
|
|
6588
5366
|
const apiPresence = usePresence(mergeProps$1(presenceProps, () => ({
|
|
6589
5367
|
present: api().open
|
|
@@ -6839,5 +5617,5 @@ var treeView = /*#__PURE__*/Object.freeze({
|
|
|
6839
5617
|
Tree: TreeViewTree
|
|
6840
5618
|
});
|
|
6841
5619
|
|
|
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 };
|
|
5620
|
+
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
5621
|
//# sourceMappingURL=index.js.map
|