@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/cjs/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var solid = require('@zag-js/solid');
|
|
|
6
6
|
var collapsible$1 = require('@zag-js/collapsible');
|
|
7
7
|
var accordion$1 = require('@zag-js/accordion');
|
|
8
8
|
var avatar$1 = require('@zag-js/avatar');
|
|
9
|
-
var anatomy
|
|
9
|
+
var anatomy = require('@ark-ui/anatomy');
|
|
10
10
|
var carousel$1 = require('@zag-js/carousel');
|
|
11
11
|
var checkbox$1 = require('@zag-js/checkbox');
|
|
12
12
|
var clipboard$1 = require('@zag-js/clipboard');
|
|
@@ -16,6 +16,7 @@ var combobox$1 = require('@zag-js/combobox');
|
|
|
16
16
|
var datePicker$1 = require('@zag-js/date-picker');
|
|
17
17
|
var dialog$1 = require('@zag-js/dialog');
|
|
18
18
|
var editable$1 = require('@zag-js/editable');
|
|
19
|
+
var domQuery = require('@zag-js/dom-query');
|
|
19
20
|
var fileUpload$1 = require('@zag-js/file-upload');
|
|
20
21
|
var i18nUtils = require('@zag-js/i18n-utils');
|
|
21
22
|
var hoverCard$1 = require('@zag-js/hover-card');
|
|
@@ -29,8 +30,7 @@ var qrCode$1 = require('@zag-js/qr-code');
|
|
|
29
30
|
var radio = require('@zag-js/radio-group');
|
|
30
31
|
var rating = require('@zag-js/rating-group');
|
|
31
32
|
var select$1 = require('@zag-js/select');
|
|
32
|
-
var
|
|
33
|
-
var types = require('@zag-js/types');
|
|
33
|
+
var signaturePad$1 = require('@zag-js/signature-pad');
|
|
34
34
|
var slider$1 = require('@zag-js/slider');
|
|
35
35
|
var splitter$1 = require('@zag-js/splitter');
|
|
36
36
|
var zagSwitch = require('@zag-js/switch');
|
|
@@ -82,6 +82,7 @@ var qrCode__namespace = /*#__PURE__*/_interopNamespaceDefault(qrCode$1);
|
|
|
82
82
|
var radio__namespace = /*#__PURE__*/_interopNamespaceDefault(radio);
|
|
83
83
|
var rating__namespace = /*#__PURE__*/_interopNamespaceDefault(rating);
|
|
84
84
|
var select__namespace = /*#__PURE__*/_interopNamespaceDefault(select$1);
|
|
85
|
+
var signaturePad__namespace = /*#__PURE__*/_interopNamespaceDefault(signaturePad$1);
|
|
85
86
|
var slider__namespace = /*#__PURE__*/_interopNamespaceDefault(slider$1);
|
|
86
87
|
var splitter__namespace = /*#__PURE__*/_interopNamespaceDefault(splitter$1);
|
|
87
88
|
var zagSwitch__namespace = /*#__PURE__*/_interopNamespaceDefault(zagSwitch);
|
|
@@ -187,8 +188,8 @@ const CollapsibleContent = props => {
|
|
|
187
188
|
|
|
188
189
|
const CollapsibleContext = props => props.children(useCollapsibleContext());
|
|
189
190
|
|
|
190
|
-
const isFunction
|
|
191
|
-
const runIfFn
|
|
191
|
+
const isFunction = value => typeof value === 'function';
|
|
192
|
+
const runIfFn = (valueOrFn, ...args) => isFunction(valueOrFn) ? valueOrFn(...args) : valueOrFn;
|
|
192
193
|
|
|
193
194
|
const [EnvironmentContextProvider, useEnvironmentContext] = createContext({
|
|
194
195
|
hookName: 'useEnvironmentContext',
|
|
@@ -204,7 +205,7 @@ const [EnvironmentContextProvider, useEnvironmentContext] = createContext({
|
|
|
204
205
|
var _tmpl$$5 = /*#__PURE__*/web.template(`<span hidden>`);
|
|
205
206
|
const EnvironmentProvider = props => {
|
|
206
207
|
const [spanRef, setSpanRef] = solidJs.createSignal();
|
|
207
|
-
const getRootNode = () => runIfFn
|
|
208
|
+
const getRootNode = () => runIfFn(props.value) ?? spanRef()?.ownerDocument ?? document;
|
|
208
209
|
const environment = solidJs.createMemo(() => ({
|
|
209
210
|
getRootNode,
|
|
210
211
|
getDocument: () => domQuery.getDocument(getRootNode()),
|
|
@@ -531,7 +532,7 @@ const [CarouselProvider, useCarouselContext] = createContext({
|
|
|
531
532
|
const CarouselContext = props => props.children(useCarouselContext());
|
|
532
533
|
|
|
533
534
|
const CarouselControl = props => {
|
|
534
|
-
const mergedProps = solid.mergeProps(() => anatomy
|
|
535
|
+
const mergedProps = solid.mergeProps(() => anatomy.carouselAnatomy.build().control.attrs, props);
|
|
535
536
|
return web.createComponent(ark.div, mergedProps);
|
|
536
537
|
};
|
|
537
538
|
|
|
@@ -650,12 +651,12 @@ const CheckboxControl = props => {
|
|
|
650
651
|
};
|
|
651
652
|
|
|
652
653
|
function useControllableState(props) {
|
|
653
|
-
const [uncontrolledValue, setUncontrolledValue] = solidJs.createSignal(runIfFn
|
|
654
|
+
const [uncontrolledValue, setUncontrolledValue] = solidJs.createSignal(runIfFn(props.defaultValue));
|
|
654
655
|
const controlled = solidJs.createMemo(() => props.value?.() !== undefined);
|
|
655
656
|
const currentValue = solidJs.createMemo(() => controlled() ? props.value?.() : uncontrolledValue());
|
|
656
657
|
const setValue = next => {
|
|
657
658
|
solidJs.untrack(() => {
|
|
658
|
-
const nextValue = runIfFn
|
|
659
|
+
const nextValue = runIfFn(next, currentValue());
|
|
659
660
|
if (controlled()) {
|
|
660
661
|
return props.onChange?.(nextValue);
|
|
661
662
|
}
|
|
@@ -726,15 +727,205 @@ const CheckboxGroup = props => {
|
|
|
726
727
|
return web.createComponent(CheckboxGroupContextProvider, {
|
|
727
728
|
value: checkboxGroup,
|
|
728
729
|
get children() {
|
|
729
|
-
return web.createComponent(ark.div, web.mergeProps(
|
|
730
|
+
return web.createComponent(ark.div, web.mergeProps({
|
|
731
|
+
role: "group"
|
|
732
|
+
}, localProps, () => anatomy.checkboxAnatomy.build().group.attrs));
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
const [FieldProvider, useFieldContext] = createContext({
|
|
738
|
+
hookName: 'useFieldContext',
|
|
739
|
+
providerName: '<FieldProvider />',
|
|
740
|
+
strict: false
|
|
741
|
+
});
|
|
742
|
+
|
|
743
|
+
const FieldContext = props => props.children(useFieldContext());
|
|
744
|
+
|
|
745
|
+
const FieldErrorText = props => {
|
|
746
|
+
const field = useFieldContext();
|
|
747
|
+
const mergedProps = solid.mergeProps(() => field().getErrorTextProps(), props);
|
|
748
|
+
return web.createComponent(solidJs.Show, {
|
|
749
|
+
get when() {
|
|
750
|
+
return field?.().invalid;
|
|
751
|
+
},
|
|
752
|
+
get children() {
|
|
753
|
+
return web.createComponent(ark.span, mergedProps);
|
|
730
754
|
}
|
|
731
755
|
});
|
|
732
756
|
};
|
|
733
757
|
|
|
758
|
+
const FieldHelperText = props => {
|
|
759
|
+
const field = useFieldContext();
|
|
760
|
+
const mergedProps = solid.mergeProps(() => field().getHelperTextProps(), props);
|
|
761
|
+
return web.createComponent(ark.span, mergedProps);
|
|
762
|
+
};
|
|
763
|
+
|
|
764
|
+
const FieldInput = props => {
|
|
765
|
+
const field = useFieldContext();
|
|
766
|
+
const mergedProps = solid.mergeProps(() => field?.().getInputProps(), props);
|
|
767
|
+
return web.createComponent(ark.input, mergedProps);
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
const FieldLabel = props => {
|
|
771
|
+
const field = useFieldContext();
|
|
772
|
+
const mergedProps = solid.mergeProps(() => field?.().getLabelProps(), props);
|
|
773
|
+
return web.createComponent(ark.label, mergedProps);
|
|
774
|
+
};
|
|
775
|
+
|
|
776
|
+
const FieldSelect = props => {
|
|
777
|
+
const field = useFieldContext();
|
|
778
|
+
const mergedProps = solid.mergeProps(() => field?.().getSelectProps(), props);
|
|
779
|
+
return web.createComponent(ark.select, mergedProps);
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
const parts = anatomy.fieldAnatomy.build();
|
|
783
|
+
const useField = props => {
|
|
784
|
+
const {
|
|
785
|
+
required = false,
|
|
786
|
+
disabled = false,
|
|
787
|
+
invalid = false,
|
|
788
|
+
readOnly = false
|
|
789
|
+
} = props;
|
|
790
|
+
const [hasErrorText, setHasErrorText] = solidJs.createSignal(false);
|
|
791
|
+
const [hasHelperText, setHasHelperText] = solidJs.createSignal(false);
|
|
792
|
+
const id = props.id ?? `field-${Math.random().toString(36).substr(2, 9)}`;
|
|
793
|
+
let rootRef;
|
|
794
|
+
const errorTextId = `field::${id}::error-text`;
|
|
795
|
+
const helperTextId = `field::${id}::helper-text`;
|
|
796
|
+
const labelId = `field::${id}::label`;
|
|
797
|
+
solidJs.createEffect(() => {
|
|
798
|
+
return;
|
|
799
|
+
});
|
|
800
|
+
const getRootProps = () => ({
|
|
801
|
+
...parts.root.attrs,
|
|
802
|
+
role: 'group',
|
|
803
|
+
'data-disabled': dataAttr(disabled),
|
|
804
|
+
'data-invalid': dataAttr(invalid),
|
|
805
|
+
'data-readonly': dataAttr(readOnly)
|
|
806
|
+
});
|
|
807
|
+
const getLabelProps = () => ({
|
|
808
|
+
...parts.label.attrs,
|
|
809
|
+
id: labelId,
|
|
810
|
+
'data-disabled': dataAttr(disabled),
|
|
811
|
+
'data-invalid': dataAttr(invalid),
|
|
812
|
+
'data-readonly': dataAttr(readOnly),
|
|
813
|
+
htmlFor: id
|
|
814
|
+
});
|
|
815
|
+
const labelIds = [];
|
|
816
|
+
if (hasErrorText() && invalid) labelIds.push(errorTextId);
|
|
817
|
+
if (hasHelperText()) labelIds.push(helperTextId);
|
|
818
|
+
const getControlProps = () => ({
|
|
819
|
+
'aria-describedby': labelIds.join(' ') || undefined,
|
|
820
|
+
'aria-invalid': ariaAttr(invalid),
|
|
821
|
+
'aria-required': ariaAttr(required),
|
|
822
|
+
'aria-readonly': ariaAttr(readOnly),
|
|
823
|
+
id,
|
|
824
|
+
required,
|
|
825
|
+
disabled,
|
|
826
|
+
readOnly
|
|
827
|
+
});
|
|
828
|
+
const getInputProps = () => ({
|
|
829
|
+
...getControlProps(),
|
|
830
|
+
...parts.input.attrs
|
|
831
|
+
});
|
|
832
|
+
const getTextareaProps = () => ({
|
|
833
|
+
...getControlProps(),
|
|
834
|
+
...parts.textarea.attrs
|
|
835
|
+
});
|
|
836
|
+
const getSelectProps = () => ({
|
|
837
|
+
...getControlProps(),
|
|
838
|
+
...parts.select.attrs
|
|
839
|
+
});
|
|
840
|
+
const getHelperTextProps = () => ({
|
|
841
|
+
id: helperTextId,
|
|
842
|
+
...parts.helperText.attrs
|
|
843
|
+
});
|
|
844
|
+
const getErrorTextProps = () => ({
|
|
845
|
+
id: errorTextId,
|
|
846
|
+
...parts.errorText.attrs,
|
|
847
|
+
'aria-live': 'polite'
|
|
848
|
+
});
|
|
849
|
+
return solidJs.createMemo(() => ({
|
|
850
|
+
ariaDescribedby: labelIds.join(' '),
|
|
851
|
+
ids: {
|
|
852
|
+
control: id,
|
|
853
|
+
label: labelId,
|
|
854
|
+
errorText: errorTextId,
|
|
855
|
+
helperText: helperTextId
|
|
856
|
+
},
|
|
857
|
+
refs: {
|
|
858
|
+
rootRef
|
|
859
|
+
},
|
|
860
|
+
disabled,
|
|
861
|
+
invalid,
|
|
862
|
+
readOnly,
|
|
863
|
+
required,
|
|
864
|
+
getLabelProps,
|
|
865
|
+
getRootProps,
|
|
866
|
+
getInputProps,
|
|
867
|
+
getTextareaProps,
|
|
868
|
+
getSelectProps,
|
|
869
|
+
getHelperTextProps,
|
|
870
|
+
getErrorTextProps
|
|
871
|
+
}));
|
|
872
|
+
};
|
|
873
|
+
const dataAttr = condition => condition ? '' : undefined;
|
|
874
|
+
const ariaAttr = condition => condition ? true : undefined;
|
|
875
|
+
|
|
876
|
+
const FieldRoot = props => {
|
|
877
|
+
const [useFieldProps, localProps] = createSplitProps()(props, ['id', 'disabled', 'invalid', 'readOnly', 'required']);
|
|
878
|
+
const field = useField(useFieldProps);
|
|
879
|
+
const mergedProps = solid.mergeProps(() => field().getRootProps(), localProps);
|
|
880
|
+
return web.createComponent(FieldProvider, {
|
|
881
|
+
value: field,
|
|
882
|
+
get children() {
|
|
883
|
+
return web.createComponent(ark.div, mergedProps);
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
const FieldRootProvider = props => {
|
|
889
|
+
const [{
|
|
890
|
+
value: field
|
|
891
|
+
}, localProps] = createSplitProps()(props, ['value']);
|
|
892
|
+
const mergedProps = solid.mergeProps(() => field().getRootProps(), localProps);
|
|
893
|
+
return web.createComponent(FieldProvider, {
|
|
894
|
+
value: field,
|
|
895
|
+
get children() {
|
|
896
|
+
return web.createComponent(ark.div, mergedProps);
|
|
897
|
+
}
|
|
898
|
+
});
|
|
899
|
+
};
|
|
900
|
+
|
|
901
|
+
const FieldTextarea = props => {
|
|
902
|
+
const field = useFieldContext();
|
|
903
|
+
const mergedProps = solid.mergeProps(() => field?.().getTextareaProps(), props);
|
|
904
|
+
return web.createComponent(ark.textarea, mergedProps);
|
|
905
|
+
};
|
|
906
|
+
|
|
907
|
+
var field = /*#__PURE__*/Object.freeze({
|
|
908
|
+
__proto__: null,
|
|
909
|
+
Context: FieldContext,
|
|
910
|
+
ErrorText: FieldErrorText,
|
|
911
|
+
HelperText: FieldHelperText,
|
|
912
|
+
Input: FieldInput,
|
|
913
|
+
Label: FieldLabel,
|
|
914
|
+
Root: FieldRoot,
|
|
915
|
+
RootProvider: FieldRootProvider,
|
|
916
|
+
Select: FieldSelect,
|
|
917
|
+
Textarea: FieldTextarea
|
|
918
|
+
});
|
|
919
|
+
|
|
734
920
|
const CheckboxHiddenInput = props => {
|
|
735
921
|
const checkbox = useCheckboxContext();
|
|
736
922
|
const mergedProps = solid.mergeProps(() => checkbox().getHiddenInputProps(), props);
|
|
737
|
-
|
|
923
|
+
const field = useFieldContext();
|
|
924
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
925
|
+
get ["aria-describedby"]() {
|
|
926
|
+
return field?.().ariaDescribedby;
|
|
927
|
+
}
|
|
928
|
+
}, mergedProps));
|
|
738
929
|
};
|
|
739
930
|
|
|
740
931
|
const CheckboxIndicator = props => {
|
|
@@ -764,8 +955,17 @@ const useCheckbox = ownProps => {
|
|
|
764
955
|
const locale = useLocaleContext();
|
|
765
956
|
const environment = useEnvironmentContext();
|
|
766
957
|
const id = solidJs.createUniqueId();
|
|
958
|
+
const field = useFieldContext();
|
|
767
959
|
const context = solidJs.createMemo(() => ({
|
|
768
960
|
id,
|
|
961
|
+
ids: {
|
|
962
|
+
label: field?.().ids.label,
|
|
963
|
+
hiddenInput: field?.().ids.control
|
|
964
|
+
},
|
|
965
|
+
disabled: field?.().disabled,
|
|
966
|
+
readOnly: field?.().readOnly,
|
|
967
|
+
invalid: field?.().invalid,
|
|
968
|
+
required: field?.().required,
|
|
769
969
|
dir: locale().dir,
|
|
770
970
|
getRootNode: environment().getRootNode,
|
|
771
971
|
checked: props().defaultChecked,
|
|
@@ -968,10 +1168,18 @@ const [ColorPickerChannelPropsProvider, useColorPickerChannelPropsContext] = cre
|
|
|
968
1168
|
providerName: '<ColorPickerChannelSliderProvider />'
|
|
969
1169
|
});
|
|
970
1170
|
|
|
1171
|
+
const [ColorPickerFormatPropsProvider, useColorPickerFormatPropsContext] = createContext({
|
|
1172
|
+
hookName: 'useColorPickerFormatPropsContext',
|
|
1173
|
+
providerName: '<ColorPickerFormatPropsProvider />',
|
|
1174
|
+
strict: false
|
|
1175
|
+
});
|
|
1176
|
+
|
|
971
1177
|
const ColorPickerChannelSlider = props => {
|
|
972
1178
|
const [channelProps, localProps] = createSplitProps()(props, ['channel', 'orientation']);
|
|
973
1179
|
const api = useColorPickerContext();
|
|
974
|
-
const
|
|
1180
|
+
const formatProps = useColorPickerFormatPropsContext();
|
|
1181
|
+
const channelSliderProps = solid.mergeProps(channelProps, formatProps);
|
|
1182
|
+
const mergedProps = solid.mergeProps(() => api().getChannelSliderProps(channelSliderProps), localProps);
|
|
975
1183
|
return web.createComponent(ColorPickerChannelPropsProvider, {
|
|
976
1184
|
value: channelProps,
|
|
977
1185
|
get children() {
|
|
@@ -980,20 +1188,43 @@ const ColorPickerChannelSlider = props => {
|
|
|
980
1188
|
});
|
|
981
1189
|
};
|
|
982
1190
|
|
|
1191
|
+
const ColorPickerChannelSliderLabel = props => {
|
|
1192
|
+
const colorPicker = useColorPickerContext();
|
|
1193
|
+
const channelProps = useColorPickerChannelPropsContext();
|
|
1194
|
+
const mergedProps = solid.mergeProps(() => colorPicker().getChannelSliderLabelProps(channelProps), props);
|
|
1195
|
+
return web.createComponent(ark.label, mergedProps);
|
|
1196
|
+
};
|
|
1197
|
+
|
|
983
1198
|
const ColorPickerChannelSliderThumb = props => {
|
|
984
1199
|
const api = useColorPickerContext();
|
|
1200
|
+
const formatProps = useColorPickerFormatPropsContext();
|
|
985
1201
|
const channelProps = useColorPickerChannelPropsContext();
|
|
986
|
-
const
|
|
1202
|
+
const channelSliderProps = solid.mergeProps(channelProps, formatProps);
|
|
1203
|
+
const mergedProps = solid.mergeProps(() => api().getChannelSliderThumbProps(channelSliderProps), props);
|
|
987
1204
|
return web.createComponent(ark.div, mergedProps);
|
|
988
1205
|
};
|
|
989
1206
|
|
|
990
1207
|
const ColorPickerChannelSliderTrack = props => {
|
|
991
1208
|
const api = useColorPickerContext();
|
|
1209
|
+
const formatProps = useColorPickerFormatPropsContext();
|
|
992
1210
|
const channelProps = useColorPickerChannelPropsContext();
|
|
993
|
-
const
|
|
1211
|
+
const channelSliderProps = solid.mergeProps(channelProps, formatProps);
|
|
1212
|
+
const mergedProps = solid.mergeProps(() => api().getChannelSliderTrackProps(channelSliderProps), props);
|
|
994
1213
|
return web.createComponent(ark.div, mergedProps);
|
|
995
1214
|
};
|
|
996
1215
|
|
|
1216
|
+
const ColorPickerChannelSliderValueText = props => {
|
|
1217
|
+
const colorPicker = useColorPickerContext();
|
|
1218
|
+
const localeContext = useLocaleContext();
|
|
1219
|
+
const channelProps = useColorPickerChannelPropsContext();
|
|
1220
|
+
const mergedProps = solid.mergeProps(() => colorPicker().getChannelSliderValueTextProps(channelProps), props);
|
|
1221
|
+
return web.createComponent(ark.span, web.mergeProps(mergedProps, {
|
|
1222
|
+
get children() {
|
|
1223
|
+
return props.children || colorPicker().getChannelValueText(channelProps.channel, localeContext().locale);
|
|
1224
|
+
}
|
|
1225
|
+
}));
|
|
1226
|
+
};
|
|
1227
|
+
|
|
997
1228
|
const splitPresenceProps = props => createSplitProps()(props, ['immediate', 'lazyMount', 'onExitComplete', 'present', 'unmountOnExit']);
|
|
998
1229
|
|
|
999
1230
|
const usePresence = props => {
|
|
@@ -1097,7 +1328,12 @@ const ColorPickerFormatTrigger = props => {
|
|
|
1097
1328
|
const ColorPickerHiddenInput = props => {
|
|
1098
1329
|
const colorPicker = useColorPickerContext();
|
|
1099
1330
|
const mergedProps = solid.mergeProps(() => colorPicker().getHiddenInputProps(), props);
|
|
1100
|
-
|
|
1331
|
+
const field = useFieldContext();
|
|
1332
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
1333
|
+
get ["aria-describedby"]() {
|
|
1334
|
+
return field?.().ariaDescribedby;
|
|
1335
|
+
}
|
|
1336
|
+
}, mergedProps));
|
|
1101
1337
|
};
|
|
1102
1338
|
|
|
1103
1339
|
const ColorPickerLabel = props => {
|
|
@@ -1123,10 +1359,18 @@ const ColorPickerPositioner = props => {
|
|
|
1123
1359
|
const useColorPicker = props => {
|
|
1124
1360
|
const locale = useLocaleContext();
|
|
1125
1361
|
const environment = useEnvironmentContext();
|
|
1362
|
+
const field = useFieldContext();
|
|
1126
1363
|
const id = solidJs.createUniqueId();
|
|
1127
1364
|
const context = solidJs.createMemo(() => ({
|
|
1128
1365
|
id,
|
|
1366
|
+
ids: {
|
|
1367
|
+
label: field?.().ids.label,
|
|
1368
|
+
input: field?.().ids.control
|
|
1369
|
+
},
|
|
1129
1370
|
dir: locale().dir,
|
|
1371
|
+
disabled: field?.().disabled,
|
|
1372
|
+
readOnly: field?.().readOnly,
|
|
1373
|
+
required: field?.().required,
|
|
1130
1374
|
getRootNode: environment().getRootNode,
|
|
1131
1375
|
open: props.defaultOpen,
|
|
1132
1376
|
'open.controlled': props.open !== undefined,
|
|
@@ -1141,7 +1385,7 @@ const useColorPicker = props => {
|
|
|
1141
1385
|
|
|
1142
1386
|
const ColorPickerRoot = props => {
|
|
1143
1387
|
const [presenceProps, colorPickerProps] = splitPresenceProps(props);
|
|
1144
|
-
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']);
|
|
1388
|
+
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']);
|
|
1145
1389
|
const api = useColorPicker(useColorPickerProps);
|
|
1146
1390
|
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
1147
1391
|
present: api().open
|
|
@@ -1232,9 +1476,29 @@ const ColorPickerTrigger = props => {
|
|
|
1232
1476
|
return web.createComponent(ark.button, mergedProps);
|
|
1233
1477
|
};
|
|
1234
1478
|
|
|
1479
|
+
const ColorPickerValueSwatch = props => {
|
|
1480
|
+
const [{
|
|
1481
|
+
respectAlpha
|
|
1482
|
+
}, localProps] = createSplitProps()(props, ['respectAlpha']);
|
|
1483
|
+
const colorPicker = useColorPickerContext();
|
|
1484
|
+
const swatchProps = solidJs.createMemo(() => ({
|
|
1485
|
+
respectAlpha,
|
|
1486
|
+
value: colorPicker().value
|
|
1487
|
+
}));
|
|
1488
|
+
const mergedProps = solid.mergeProps(() => colorPicker().getSwatchProps(swatchProps()), localProps);
|
|
1489
|
+
return web.createComponent(ColorPickerSwatchPropsProvider, {
|
|
1490
|
+
get value() {
|
|
1491
|
+
return swatchProps();
|
|
1492
|
+
},
|
|
1493
|
+
get children() {
|
|
1494
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1495
|
+
}
|
|
1496
|
+
});
|
|
1497
|
+
};
|
|
1498
|
+
|
|
1235
1499
|
const ColorPickerValueText = props => {
|
|
1236
1500
|
const api = useColorPickerContext();
|
|
1237
|
-
const mergedProps = solid.mergeProps(() => anatomy
|
|
1501
|
+
const mergedProps = solid.mergeProps(() => anatomy.colorPickerAnatomy.build().valueText.attrs, props);
|
|
1238
1502
|
return web.createComponent(ark.span, web.mergeProps(mergedProps, {
|
|
1239
1503
|
get children() {
|
|
1240
1504
|
return api().valueAsString || props.children;
|
|
@@ -1244,17 +1508,23 @@ const ColorPickerValueText = props => {
|
|
|
1244
1508
|
|
|
1245
1509
|
const ColorPickerView = props => {
|
|
1246
1510
|
const api = useColorPickerContext();
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
},
|
|
1511
|
+
const [formatProps, localProps] = createSplitProps()(props, ['format']);
|
|
1512
|
+
const mergedProps = solid.mergeProps(() => anatomy.colorPickerAnatomy.build().view.attrs, localProps);
|
|
1513
|
+
return web.createComponent(ColorPickerFormatPropsProvider, {
|
|
1514
|
+
value: formatProps,
|
|
1252
1515
|
get children() {
|
|
1253
|
-
return web.createComponent(
|
|
1254
|
-
get
|
|
1255
|
-
return props.format;
|
|
1516
|
+
return web.createComponent(solidJs.Show, {
|
|
1517
|
+
get when() {
|
|
1518
|
+
return api().format === props.format;
|
|
1519
|
+
},
|
|
1520
|
+
get children() {
|
|
1521
|
+
return web.createComponent(ark.div, web.mergeProps({
|
|
1522
|
+
get ["data-format"]() {
|
|
1523
|
+
return props.format;
|
|
1524
|
+
}
|
|
1525
|
+
}, mergedProps));
|
|
1256
1526
|
}
|
|
1257
|
-
}
|
|
1527
|
+
});
|
|
1258
1528
|
}
|
|
1259
1529
|
});
|
|
1260
1530
|
};
|
|
@@ -1266,8 +1536,10 @@ var colorPicker = /*#__PURE__*/Object.freeze({
|
|
|
1266
1536
|
AreaThumb: ColorPickerAreaThumb,
|
|
1267
1537
|
ChannelInput: ColorPickerChannelInput,
|
|
1268
1538
|
ChannelSlider: ColorPickerChannelSlider,
|
|
1539
|
+
ChannelSliderLabel: ColorPickerChannelSliderLabel,
|
|
1269
1540
|
ChannelSliderThumb: ColorPickerChannelSliderThumb,
|
|
1270
1541
|
ChannelSliderTrack: ColorPickerChannelSliderTrack,
|
|
1542
|
+
ChannelSliderValueText: ColorPickerChannelSliderValueText,
|
|
1271
1543
|
Content: ColorPickerContent,
|
|
1272
1544
|
Context: ColorPickerContext,
|
|
1273
1545
|
Control: ColorPickerControl,
|
|
@@ -1278,12 +1550,14 @@ var colorPicker = /*#__PURE__*/Object.freeze({
|
|
|
1278
1550
|
Label: ColorPickerLabel,
|
|
1279
1551
|
Positioner: ColorPickerPositioner,
|
|
1280
1552
|
Root: ColorPickerRoot,
|
|
1553
|
+
RootProvider: ColorPickerRootProvider,
|
|
1281
1554
|
Swatch: ColorPickerSwatch,
|
|
1282
1555
|
SwatchGroup: ColorPickerSwatchGroup,
|
|
1283
1556
|
SwatchIndicator: ColorPickerSwatchIndicator,
|
|
1284
1557
|
SwatchTrigger: ColorPickerSwatchTrigger,
|
|
1285
1558
|
TransparencyGrid: ColorPickerTransparencyGrid,
|
|
1286
1559
|
Trigger: ColorPickerTrigger,
|
|
1560
|
+
ValueSwatch: ColorPickerValueSwatch,
|
|
1287
1561
|
ValueText: ColorPickerValueText,
|
|
1288
1562
|
View: ColorPickerView
|
|
1289
1563
|
});
|
|
@@ -1325,7 +1599,12 @@ const ComboboxControl = props => {
|
|
|
1325
1599
|
const ComboboxInput = props => {
|
|
1326
1600
|
const combobox = useComboboxContext();
|
|
1327
1601
|
const mergedProps = solid.mergeProps(() => combobox().getInputProps(), props);
|
|
1328
|
-
|
|
1602
|
+
const field = useFieldContext();
|
|
1603
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
1604
|
+
get ["aria-describedby"]() {
|
|
1605
|
+
return field?.().ariaDescribedby;
|
|
1606
|
+
}
|
|
1607
|
+
}, mergedProps));
|
|
1329
1608
|
};
|
|
1330
1609
|
|
|
1331
1610
|
const [ComboboxItemProvider, useComboboxItemContext] = createContext({
|
|
@@ -1433,8 +1712,17 @@ const useCombobox = props => {
|
|
|
1433
1712
|
const locale = useLocaleContext();
|
|
1434
1713
|
const environment = useEnvironmentContext();
|
|
1435
1714
|
const id = solidJs.createUniqueId();
|
|
1715
|
+
const field = useFieldContext();
|
|
1436
1716
|
const context = solidJs.createMemo(() => ({
|
|
1437
1717
|
id,
|
|
1718
|
+
ids: {
|
|
1719
|
+
label: field?.().ids.label,
|
|
1720
|
+
input: field?.().ids.control
|
|
1721
|
+
},
|
|
1722
|
+
disabled: field?.().disabled,
|
|
1723
|
+
readOnly: field?.().readOnly,
|
|
1724
|
+
required: field?.().required,
|
|
1725
|
+
invalid: field?.().invalid,
|
|
1438
1726
|
collection: collection(),
|
|
1439
1727
|
dir: locale().dir,
|
|
1440
1728
|
getRootNode: environment().getRootNode,
|
|
@@ -1451,7 +1739,7 @@ const useCombobox = props => {
|
|
|
1451
1739
|
|
|
1452
1740
|
const ComboboxRoot = props => {
|
|
1453
1741
|
const [presenceProps, comboboxProps] = splitPresenceProps(props);
|
|
1454
|
-
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']);
|
|
1742
|
+
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']);
|
|
1455
1743
|
const api = useCombobox(useComboboxProps);
|
|
1456
1744
|
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
1457
1745
|
present: api().open
|
|
@@ -1572,12 +1860,17 @@ const DatePickerMonthSelect = props => {
|
|
|
1572
1860
|
const mergedProps = solid.mergeProps(() => api().getMonthSelectProps(), props);
|
|
1573
1861
|
return web.createComponent(ark.select, web.mergeProps(mergedProps, {
|
|
1574
1862
|
get children() {
|
|
1575
|
-
return
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1863
|
+
return web.createComponent(solidJs.For, {
|
|
1864
|
+
get each() {
|
|
1865
|
+
return api().getMonths();
|
|
1866
|
+
},
|
|
1867
|
+
children: month => (() => {
|
|
1868
|
+
var _el$ = _tmpl$$4();
|
|
1869
|
+
web.insert(_el$, () => month.label);
|
|
1870
|
+
web.effect(() => _el$.value = month.value);
|
|
1871
|
+
return _el$;
|
|
1872
|
+
})()
|
|
1873
|
+
});
|
|
1581
1874
|
}
|
|
1582
1875
|
}));
|
|
1583
1876
|
};
|
|
@@ -1811,7 +2104,7 @@ const DatePickerTrigger = props => {
|
|
|
1811
2104
|
const DatePickerView = props => {
|
|
1812
2105
|
const [viewProps, localProps] = createSplitProps()(props, ['view']);
|
|
1813
2106
|
const api = useDatePickerContext();
|
|
1814
|
-
const mergedProps = solid.mergeProps(() => anatomy
|
|
2107
|
+
const mergedProps = solid.mergeProps(() => anatomy.datePickerAnatomy.build().view.attrs, localProps);
|
|
1815
2108
|
return web.createComponent(DatePickerViewProvider, {
|
|
1816
2109
|
value: viewProps,
|
|
1817
2110
|
get children() {
|
|
@@ -1844,15 +2137,20 @@ const DatePickerYearSelect = props => {
|
|
|
1844
2137
|
const mergedProps = solid.mergeProps(() => api().getYearSelectProps(), props);
|
|
1845
2138
|
return web.createComponent(ark.select, web.mergeProps(mergedProps, {
|
|
1846
2139
|
get children() {
|
|
1847
|
-
return
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
2140
|
+
return web.createComponent(solidJs.For, {
|
|
2141
|
+
get each() {
|
|
2142
|
+
return getYearsRange({
|
|
2143
|
+
from: 1_000,
|
|
2144
|
+
to: 4_000
|
|
2145
|
+
});
|
|
2146
|
+
},
|
|
2147
|
+
children: year => (() => {
|
|
2148
|
+
var _el$ = _tmpl$$3();
|
|
2149
|
+
_el$.value = year;
|
|
2150
|
+
web.insert(_el$, year);
|
|
2151
|
+
return _el$;
|
|
2152
|
+
})()
|
|
2153
|
+
});
|
|
1856
2154
|
}
|
|
1857
2155
|
}));
|
|
1858
2156
|
};
|
|
@@ -2091,7 +2389,12 @@ const EditableEditTrigger = props => {
|
|
|
2091
2389
|
const EditableInput = props => {
|
|
2092
2390
|
const api = useEditableContext();
|
|
2093
2391
|
const mergedProps = solid.mergeProps(() => api().getInputProps(), props);
|
|
2094
|
-
|
|
2392
|
+
const field = useFieldContext();
|
|
2393
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
2394
|
+
get ["aria-describedby"]() {
|
|
2395
|
+
return field?.().ariaDescribedby;
|
|
2396
|
+
}
|
|
2397
|
+
}, mergedProps));
|
|
2095
2398
|
};
|
|
2096
2399
|
|
|
2097
2400
|
const EditableLabel = props => {
|
|
@@ -2110,9 +2413,18 @@ const useEditable = props => {
|
|
|
2110
2413
|
const locale = useLocaleContext();
|
|
2111
2414
|
const environment = useEnvironmentContext();
|
|
2112
2415
|
const id = solidJs.createUniqueId();
|
|
2416
|
+
const field = useFieldContext();
|
|
2113
2417
|
const context = solidJs.createMemo(() => ({
|
|
2114
2418
|
id,
|
|
2419
|
+
ids: {
|
|
2420
|
+
label: field?.().ids.label,
|
|
2421
|
+
input: field?.().ids.control
|
|
2422
|
+
},
|
|
2115
2423
|
dir: locale().dir,
|
|
2424
|
+
disabled: field?.().disabled,
|
|
2425
|
+
invalid: field?.().invalid,
|
|
2426
|
+
readOnly: field?.().readOnly,
|
|
2427
|
+
required: field?.().required,
|
|
2116
2428
|
getRootNode: environment().getRootNode,
|
|
2117
2429
|
value: props.defaultValue,
|
|
2118
2430
|
...props
|
|
@@ -2124,7 +2436,7 @@ const useEditable = props => {
|
|
|
2124
2436
|
};
|
|
2125
2437
|
|
|
2126
2438
|
const EditableRoot = props => {
|
|
2127
|
-
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']);
|
|
2439
|
+
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']);
|
|
2128
2440
|
const api = useEditable(useEditableProps);
|
|
2129
2441
|
const mergedProps = solid.mergeProps(() => api().getRootProps(), localProps);
|
|
2130
2442
|
return web.createComponent(EditableProvider, {
|
|
@@ -2185,7 +2497,12 @@ const FileUploadDropzone = props => {
|
|
|
2185
2497
|
const FileUploadHiddenInput = props => {
|
|
2186
2498
|
const fileUpload = useFileUploadContext();
|
|
2187
2499
|
const mergedProps = solid.mergeProps(() => fileUpload().getHiddenInputProps(), props);
|
|
2188
|
-
|
|
2500
|
+
const field = useFieldContext();
|
|
2501
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
2502
|
+
get ["aria-describedby"]() {
|
|
2503
|
+
return field?.().ariaDescribedby;
|
|
2504
|
+
}
|
|
2505
|
+
}, mergedProps));
|
|
2189
2506
|
};
|
|
2190
2507
|
|
|
2191
2508
|
const [FileUploadItemPropsProvider, useFileUploadItemPropsContext] = createContext({
|
|
@@ -2270,9 +2587,16 @@ const useFileUpload = props => {
|
|
|
2270
2587
|
const locale = useLocaleContext();
|
|
2271
2588
|
const environment = useEnvironmentContext();
|
|
2272
2589
|
const id = solidJs.createUniqueId();
|
|
2590
|
+
const field = useFieldContext();
|
|
2273
2591
|
const context = solidJs.createMemo(() => ({
|
|
2274
2592
|
id,
|
|
2593
|
+
ids: {
|
|
2594
|
+
label: field?.().ids.label,
|
|
2595
|
+
hiddenInput: field?.().ids.control
|
|
2596
|
+
},
|
|
2275
2597
|
dir: locale().dir,
|
|
2598
|
+
disabled: field?.().disabled,
|
|
2599
|
+
required: field?.().required,
|
|
2276
2600
|
getRootNode: environment().getRootNode,
|
|
2277
2601
|
...props
|
|
2278
2602
|
}));
|
|
@@ -2283,7 +2607,7 @@ const useFileUpload = props => {
|
|
|
2283
2607
|
};
|
|
2284
2608
|
|
|
2285
2609
|
const FileUploadRoot = props => {
|
|
2286
|
-
const [fileUploadProps, localProps] = createSplitProps()(props, ['accept', 'allowDrop', 'capture', 'directory', 'disabled', 'id', 'ids', 'locale', 'maxFiles', 'maxFileSize', 'minFileSize', 'name', 'onFileAccept', 'onFileChange', 'onFileReject', 'translations', 'validate']);
|
|
2610
|
+
const [fileUploadProps, localProps] = createSplitProps()(props, ['accept', 'allowDrop', 'capture', 'directory', 'disabled', 'id', 'ids', 'locale', 'maxFiles', 'maxFileSize', 'minFileSize', 'name', 'onFileAccept', 'onFileChange', 'onFileReject', 'required', 'translations', 'validate']);
|
|
2287
2611
|
const fileUpload = useFileUpload(fileUploadProps);
|
|
2288
2612
|
const mergedProps = solid.mergeProps(() => fileUpload().getRootProps(), localProps);
|
|
2289
2613
|
return web.createComponent(FileUploadProvider, {
|
|
@@ -2509,12 +2833,12 @@ const MenuCheckboxItem = props => {
|
|
|
2509
2833
|
});
|
|
2510
2834
|
const context = useMenuContext();
|
|
2511
2835
|
const mergedProps = solid.mergeProps(() => context().getOptionItemProps(optionItemProps), localProps);
|
|
2512
|
-
const
|
|
2836
|
+
const optionItemState = solidJs.createMemo(() => context().getItemState(optionItemProps));
|
|
2513
2837
|
return web.createComponent(MenuOptionItemPropsProvider, {
|
|
2514
2838
|
value: optionItemProps,
|
|
2515
2839
|
get children() {
|
|
2516
2840
|
return web.createComponent(MenuItemProvider, {
|
|
2517
|
-
value:
|
|
2841
|
+
value: optionItemState,
|
|
2518
2842
|
get children() {
|
|
2519
2843
|
return web.createComponent(ark.div, mergedProps);
|
|
2520
2844
|
}
|
|
@@ -2635,12 +2959,12 @@ const MenuRadioItem = props => {
|
|
|
2635
2959
|
})
|
|
2636
2960
|
}));
|
|
2637
2961
|
const mergedProps = solid.mergeProps(() => context().getOptionItemProps(optionItemProps), localProps);
|
|
2638
|
-
const
|
|
2962
|
+
const optionItemState = solidJs.createMemo(() => context().getOptionItemState(optionItemProps));
|
|
2639
2963
|
return web.createComponent(MenuOptionItemPropsProvider, {
|
|
2640
2964
|
value: optionItemProps,
|
|
2641
2965
|
get children() {
|
|
2642
2966
|
return web.createComponent(MenuItemProvider, {
|
|
2643
|
-
value:
|
|
2967
|
+
value: optionItemState,
|
|
2644
2968
|
get children() {
|
|
2645
2969
|
return web.createComponent(ark.div, mergedProps);
|
|
2646
2970
|
}
|
|
@@ -2854,7 +3178,12 @@ const NumberInputIncrementTrigger = props => {
|
|
|
2854
3178
|
const NumberInputInput = props => {
|
|
2855
3179
|
const api = useNumberInputContext();
|
|
2856
3180
|
const mergedProps = solid.mergeProps(() => api().getInputProps(), props);
|
|
2857
|
-
|
|
3181
|
+
const field = useFieldContext();
|
|
3182
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
3183
|
+
get ["aria-describedby"]() {
|
|
3184
|
+
return field?.().ariaDescribedby;
|
|
3185
|
+
}
|
|
3186
|
+
}, mergedProps));
|
|
2858
3187
|
};
|
|
2859
3188
|
|
|
2860
3189
|
const NumberInputLabel = props => {
|
|
@@ -2867,8 +3196,17 @@ const useNumberInput = props => {
|
|
|
2867
3196
|
const locale = useLocaleContext();
|
|
2868
3197
|
const environment = useEnvironmentContext();
|
|
2869
3198
|
const id = solidJs.createUniqueId();
|
|
3199
|
+
const field = useFieldContext();
|
|
2870
3200
|
const context = solidJs.createMemo(() => ({
|
|
2871
3201
|
id,
|
|
3202
|
+
ids: {
|
|
3203
|
+
label: field?.().ids.label,
|
|
3204
|
+
input: field?.().ids.control
|
|
3205
|
+
},
|
|
3206
|
+
disabled: field?.().disabled,
|
|
3207
|
+
readOnly: field?.().readOnly,
|
|
3208
|
+
required: field?.().required,
|
|
3209
|
+
invalid: field?.().invalid,
|
|
2872
3210
|
dir: locale().dir,
|
|
2873
3211
|
getRootNode: environment().getRootNode,
|
|
2874
3212
|
value: props.defaultValue,
|
|
@@ -2881,7 +3219,7 @@ const useNumberInput = props => {
|
|
|
2881
3219
|
};
|
|
2882
3220
|
|
|
2883
3221
|
const NumberInputRoot = props => {
|
|
2884
|
-
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']);
|
|
3222
|
+
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']);
|
|
2885
3223
|
const api = useNumberInput(useNumberInputProps);
|
|
2886
3224
|
const mergedProps = solid.mergeProps(() => api().getRootProps(), localProps);
|
|
2887
3225
|
return web.createComponent(NumberInputProvider, {
|
|
@@ -2920,6 +3258,7 @@ var numberInput = /*#__PURE__*/Object.freeze({
|
|
|
2920
3258
|
Input: NumberInputInput,
|
|
2921
3259
|
Label: NumberInputLabel,
|
|
2922
3260
|
Root: NumberInputRoot,
|
|
3261
|
+
RootProvider: NumberInputRootProvider,
|
|
2923
3262
|
Scrubber: NumberInputScrubber
|
|
2924
3263
|
});
|
|
2925
3264
|
|
|
@@ -3025,7 +3364,12 @@ const PinInputControl = props => {
|
|
|
3025
3364
|
const PinInputHiddenInput = props => {
|
|
3026
3365
|
const pinInput = usePinInputContext();
|
|
3027
3366
|
const mergedProps = solid.mergeProps(() => pinInput().getHiddenInputProps(), props);
|
|
3028
|
-
|
|
3367
|
+
const field = useFieldContext();
|
|
3368
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
3369
|
+
get ["aria-describedby"]() {
|
|
3370
|
+
return field?.().ariaDescribedby;
|
|
3371
|
+
}
|
|
3372
|
+
}, mergedProps));
|
|
3029
3373
|
};
|
|
3030
3374
|
|
|
3031
3375
|
const PinInputInput = props => {
|
|
@@ -3045,8 +3389,17 @@ const usePinInput = props => {
|
|
|
3045
3389
|
const locale = useLocaleContext();
|
|
3046
3390
|
const environment = useEnvironmentContext();
|
|
3047
3391
|
const id = solidJs.createUniqueId();
|
|
3392
|
+
const field = useFieldContext();
|
|
3048
3393
|
const context = solidJs.createMemo(() => ({
|
|
3049
3394
|
id,
|
|
3395
|
+
ids: {
|
|
3396
|
+
label: field?.().ids.label,
|
|
3397
|
+
hiddenInput: field?.().ids.control
|
|
3398
|
+
},
|
|
3399
|
+
disabled: field?.().disabled,
|
|
3400
|
+
readOnly: field?.().readOnly,
|
|
3401
|
+
required: field?.().required,
|
|
3402
|
+
invalid: field?.().invalid,
|
|
3050
3403
|
dir: locale().dir,
|
|
3051
3404
|
getRootNode: environment().getRootNode,
|
|
3052
3405
|
value: props.defaultValue,
|
|
@@ -3059,7 +3412,7 @@ const usePinInput = props => {
|
|
|
3059
3412
|
};
|
|
3060
3413
|
|
|
3061
3414
|
const PinInputRoot = props => {
|
|
3062
|
-
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']);
|
|
3415
|
+
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']);
|
|
3063
3416
|
const pinInput = usePinInput(usePinInputProps);
|
|
3064
3417
|
const mergedProps = solid.mergeProps(() => pinInput().getRootProps(), localProps);
|
|
3065
3418
|
return web.createComponent(PinInputProvider, {
|
|
@@ -3589,7 +3942,12 @@ const RatingGroupControl = props => {
|
|
|
3589
3942
|
const RatingGroupHiddenInput = props => {
|
|
3590
3943
|
const ratingGroup = useRatingGroupContext();
|
|
3591
3944
|
const mergedProps = solid.mergeProps(() => ratingGroup().getHiddenInputProps(), props);
|
|
3592
|
-
|
|
3945
|
+
const field = useFieldContext();
|
|
3946
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
3947
|
+
get ["aria-describedby"]() {
|
|
3948
|
+
return field?.().ariaDescribedby;
|
|
3949
|
+
}
|
|
3950
|
+
}, mergedProps));
|
|
3593
3951
|
};
|
|
3594
3952
|
|
|
3595
3953
|
const [RatingGroupItemProvider, useRatingGroupItemContext] = createContext({
|
|
@@ -3622,8 +3980,16 @@ const useRatingGroup = props => {
|
|
|
3622
3980
|
const locale = useLocaleContext();
|
|
3623
3981
|
const environment = useEnvironmentContext();
|
|
3624
3982
|
const id = solidJs.createUniqueId();
|
|
3983
|
+
const field = useFieldContext();
|
|
3625
3984
|
const context = solidJs.createMemo(() => ({
|
|
3626
3985
|
id,
|
|
3986
|
+
ids: {
|
|
3987
|
+
label: field?.().ids.label,
|
|
3988
|
+
hiddenInput: field?.().ids.control
|
|
3989
|
+
},
|
|
3990
|
+
disabled: field?.().disabled,
|
|
3991
|
+
readOnly: field?.().readOnly,
|
|
3992
|
+
required: field?.().required,
|
|
3627
3993
|
dir: locale().dir,
|
|
3628
3994
|
getRootNode: environment().getRootNode,
|
|
3629
3995
|
value: props.defaultValue,
|
|
@@ -3636,7 +4002,7 @@ const useRatingGroup = props => {
|
|
|
3636
4002
|
};
|
|
3637
4003
|
|
|
3638
4004
|
const RatingGroupRoot = props => {
|
|
3639
|
-
const [useRatingProps, localProps] = createSplitProps()(props, ['allowHalf', 'autoFocus', 'count', 'defaultValue', 'disabled', 'form', 'id', 'ids', 'name', 'onHoverChange', 'onValueChange', 'readOnly', 'translations', 'value']);
|
|
4005
|
+
const [useRatingProps, localProps] = createSplitProps()(props, ['allowHalf', 'autoFocus', 'count', 'defaultValue', 'disabled', 'form', 'id', 'ids', 'name', 'onHoverChange', 'onValueChange', 'readOnly', 'required', 'translations', 'value']);
|
|
3640
4006
|
const api = useRatingGroup(useRatingProps);
|
|
3641
4007
|
const mergedProps = solid.mergeProps(() => api().getRootProps(), localProps);
|
|
3642
4008
|
return web.createComponent(RatingGroupProvider, {
|
|
@@ -3668,7 +4034,8 @@ var ratingGroup = /*#__PURE__*/Object.freeze({
|
|
|
3668
4034
|
Item: RatingGroupItem,
|
|
3669
4035
|
ItemContext: RatingGroupItemContext,
|
|
3670
4036
|
Label: RatingGroupLabel,
|
|
3671
|
-
Root: RatingGroupRoot
|
|
4037
|
+
Root: RatingGroupRoot,
|
|
4038
|
+
RootProvider: RatingGroupRootProvider
|
|
3672
4039
|
});
|
|
3673
4040
|
|
|
3674
4041
|
const [SegmentGroupProvider, useSegmentGroupContext] = createContext({
|
|
@@ -3680,7 +4047,7 @@ const SegmentGroupContext = props => props.children(useSegmentGroupContext());
|
|
|
3680
4047
|
|
|
3681
4048
|
const SegmentGroupIndicator = props => {
|
|
3682
4049
|
const segmentGroup = useSegmentGroupContext();
|
|
3683
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getIndicatorProps(), anatomy
|
|
4050
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getIndicatorProps(), anatomy.segmentGroupAnatomy.build().indicator.attrs, props);
|
|
3684
4051
|
return web.createComponent(ark.div, mergedProps);
|
|
3685
4052
|
};
|
|
3686
4053
|
|
|
@@ -3697,7 +4064,7 @@ const [SegmentGroupItemPropsProvider, useSegmentGroupItemPropsContext] = createC
|
|
|
3697
4064
|
const SegmentGroupItem = props => {
|
|
3698
4065
|
const [itemProps, localProps] = createSplitProps()(props, ['value', 'disabled', 'invalid']);
|
|
3699
4066
|
const segmentGroup = useSegmentGroupContext();
|
|
3700
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getItemProps(itemProps), anatomy
|
|
4067
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getItemProps(itemProps), anatomy.segmentGroupAnatomy.build().item.attrs, localProps);
|
|
3701
4068
|
const itemState = solidJs.createMemo(() => segmentGroup().getItemState(itemProps));
|
|
3702
4069
|
return web.createComponent(SegmentGroupItemPropsProvider, {
|
|
3703
4070
|
value: itemProps,
|
|
@@ -3717,7 +4084,7 @@ const SegmentGroupItemContext = props => props.children(useSegmentGroupItemConte
|
|
|
3717
4084
|
const SegmentGroupItemControl = props => {
|
|
3718
4085
|
const segmentGroup = useSegmentGroupContext();
|
|
3719
4086
|
const itemProps = useSegmentGroupItemPropsContext();
|
|
3720
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getItemControlProps(itemProps), anatomy
|
|
4087
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getItemControlProps(itemProps), anatomy.segmentGroupAnatomy.build().itemControl.attrs, props);
|
|
3721
4088
|
return web.createComponent(ark.div, mergedProps);
|
|
3722
4089
|
};
|
|
3723
4090
|
|
|
@@ -3731,13 +4098,13 @@ const SegmentGroupItemHiddenInput = props => {
|
|
|
3731
4098
|
const SegmentGroupItemText = props => {
|
|
3732
4099
|
const segmentGroup = useSegmentGroupContext();
|
|
3733
4100
|
const itemProps = useSegmentGroupItemPropsContext();
|
|
3734
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getItemTextProps(itemProps), anatomy
|
|
4101
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getItemTextProps(itemProps), anatomy.segmentGroupAnatomy.build().itemText.attrs, props);
|
|
3735
4102
|
return web.createComponent(ark.span, mergedProps);
|
|
3736
4103
|
};
|
|
3737
4104
|
|
|
3738
4105
|
const SegmentGroupLabel = props => {
|
|
3739
4106
|
const segmentGroup = useSegmentGroupContext();
|
|
3740
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getLabelProps(), anatomy
|
|
4107
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getLabelProps(), anatomy.segmentGroupAnatomy.build().label.attrs, props);
|
|
3741
4108
|
return web.createComponent(ark.label, mergedProps);
|
|
3742
4109
|
};
|
|
3743
4110
|
|
|
@@ -3761,7 +4128,7 @@ const useSegmentGroup = props => {
|
|
|
3761
4128
|
const SegmentGroupRoot = props => {
|
|
3762
4129
|
const [useSegmentGroupProps, localProps] = createSplitProps()(props, ['defaultValue', 'disabled', 'form', 'id', 'ids', 'name', 'onValueChange', 'orientation', 'readOnly', 'value']);
|
|
3763
4130
|
const segmentGroup = useSegmentGroup(useSegmentGroupProps);
|
|
3764
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getRootProps(), anatomy
|
|
4131
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getRootProps(), anatomy.segmentGroupAnatomy.build().root.attrs, localProps);
|
|
3765
4132
|
return web.createComponent(SegmentGroupProvider, {
|
|
3766
4133
|
value: segmentGroup,
|
|
3767
4134
|
get children() {
|
|
@@ -3774,7 +4141,7 @@ const SegmentGroupRootProvider = props => {
|
|
|
3774
4141
|
const [{
|
|
3775
4142
|
value: segmentGroup
|
|
3776
4143
|
}, localProps] = createSplitProps()(props, ['value']);
|
|
3777
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getRootProps(), anatomy
|
|
4144
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getRootProps(), anatomy.segmentGroupAnatomy.build().root.attrs, localProps);
|
|
3778
4145
|
return web.createComponent(SegmentGroupProvider, {
|
|
3779
4146
|
value: segmentGroup,
|
|
3780
4147
|
get children() {
|
|
@@ -3793,7 +4160,8 @@ var segmentGroup = /*#__PURE__*/Object.freeze({
|
|
|
3793
4160
|
ItemHiddenInput: SegmentGroupItemHiddenInput,
|
|
3794
4161
|
ItemText: SegmentGroupItemText,
|
|
3795
4162
|
Label: SegmentGroupLabel,
|
|
3796
|
-
Root: SegmentGroupRoot
|
|
4163
|
+
Root: SegmentGroupRoot,
|
|
4164
|
+
RootProvider: SegmentGroupRootProvider
|
|
3797
4165
|
});
|
|
3798
4166
|
|
|
3799
4167
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
@@ -3834,9 +4202,14 @@ var _tmpl$$2 = /*#__PURE__*/web.template(`<option value="">`),
|
|
|
3834
4202
|
_tmpl$2$1 = /*#__PURE__*/web.template(`<option>`);
|
|
3835
4203
|
const SelectHiddenSelect = props => {
|
|
3836
4204
|
const select = useSelectContext();
|
|
3837
|
-
const mergedProps = solid.mergeProps(() => select().
|
|
4205
|
+
const mergedProps = solid.mergeProps(() => select().getHiddenSelectProps(), props);
|
|
3838
4206
|
const isValueEmpty = solidJs.createMemo(() => select().value.length === 0);
|
|
3839
|
-
|
|
4207
|
+
const field = useFieldContext();
|
|
4208
|
+
return web.createComponent(ark.select, web.mergeProps({
|
|
4209
|
+
get ["aria-describedby"]() {
|
|
4210
|
+
return field?.().ariaDescribedby;
|
|
4211
|
+
}
|
|
4212
|
+
}, mergedProps, {
|
|
3840
4213
|
get children() {
|
|
3841
4214
|
return [web.createComponent(solidJs.Show, {
|
|
3842
4215
|
get when() {
|
|
@@ -3971,8 +4344,17 @@ const useSelect = props => {
|
|
|
3971
4344
|
const locale = useLocaleContext();
|
|
3972
4345
|
const environment = useEnvironmentContext();
|
|
3973
4346
|
const id = solidJs.createUniqueId();
|
|
4347
|
+
const field = useFieldContext();
|
|
3974
4348
|
const context = solidJs.createMemo(() => ({
|
|
3975
4349
|
id,
|
|
4350
|
+
ids: {
|
|
4351
|
+
label: field?.().ids.label,
|
|
4352
|
+
hiddenSelect: field?.().ids.control
|
|
4353
|
+
},
|
|
4354
|
+
disabled: field?.().disabled,
|
|
4355
|
+
readOnly: field?.().readOnly,
|
|
4356
|
+
invalid: field?.().invalid,
|
|
4357
|
+
required: field?.().required,
|
|
3976
4358
|
collection: collection(),
|
|
3977
4359
|
dir: locale().dir,
|
|
3978
4360
|
getRootNode: environment().getRootNode,
|
|
@@ -3989,7 +4371,7 @@ const useSelect = props => {
|
|
|
3989
4371
|
|
|
3990
4372
|
const SelectRoot = props => {
|
|
3991
4373
|
const [presenceProps, selectProps] = splitPresenceProps(props);
|
|
3992
|
-
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']);
|
|
4374
|
+
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']);
|
|
3993
4375
|
const select = useSelect(useSelectProps);
|
|
3994
4376
|
const presenceApi = usePresence(solid.mergeProps(() => ({
|
|
3995
4377
|
present: select().open
|
|
@@ -4038,7 +4420,7 @@ const SelectTrigger = props => {
|
|
|
4038
4420
|
|
|
4039
4421
|
const SelectValueText = props => {
|
|
4040
4422
|
const select = useSelectContext();
|
|
4041
|
-
const mergedProps = solid.mergeProps(() => anatomy
|
|
4423
|
+
const mergedProps = solid.mergeProps(() => anatomy.selectAnatomy.build().valueText.attrs, props);
|
|
4042
4424
|
return web.createComponent(ark.span, web.mergeProps(mergedProps, {
|
|
4043
4425
|
get children() {
|
|
4044
4426
|
return select().valueAsString || props.placeholder;
|
|
@@ -4085,9 +4467,7 @@ const SignaturePadContext = props => props.children(useSignaturePadContext());
|
|
|
4085
4467
|
const SignaturePadControl = props => {
|
|
4086
4468
|
const signaturePad = useSignaturePadContext();
|
|
4087
4469
|
const mergedProps = solid.mergeProps(() => signaturePad().getControlProps(), props);
|
|
4088
|
-
return web.createComponent(ark.div,
|
|
4089
|
-
role: "application"
|
|
4090
|
-
}, mergedProps));
|
|
4470
|
+
return web.createComponent(ark.div, mergedProps);
|
|
4091
4471
|
};
|
|
4092
4472
|
|
|
4093
4473
|
const SignaturePadGuide = props => {
|
|
@@ -4102,1675 +4482,44 @@ const SignaturePadLabel = props => {
|
|
|
4102
4482
|
return web.createComponent(ark.label, mergedProps);
|
|
4103
4483
|
};
|
|
4104
4484
|
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
extendWith: (...values) => createAnatomy(name, [...parts, ...values]),
|
|
4114
|
-
rename: (newName) => createAnatomy(newName, parts),
|
|
4115
|
-
keys: () => parts,
|
|
4116
|
-
build: () => [...new Set(parts)].reduce(
|
|
4117
|
-
(prev, part) => Object.assign(prev, {
|
|
4118
|
-
[part]: {
|
|
4119
|
-
selector: [
|
|
4120
|
-
`&[data-scope="${toKebabCase(name)}"][data-part="${toKebabCase(part)}"]`,
|
|
4121
|
-
`& [data-scope="${toKebabCase(name)}"][data-part="${toKebabCase(part)}"]`
|
|
4122
|
-
].join(", "),
|
|
4123
|
-
attrs: { "data-scope": toKebabCase(name), "data-part": toKebabCase(part) }
|
|
4124
|
-
}
|
|
4125
|
-
}),
|
|
4126
|
-
{}
|
|
4127
|
-
)
|
|
4128
|
-
});
|
|
4129
|
-
var toKebabCase = (value) => value.replace(/([A-Z])([A-Z])/g, "$1-$2").replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
4130
|
-
var isEmpty = (v) => v.length === 0;
|
|
4131
|
-
|
|
4132
|
-
// src/index.ts
|
|
4133
|
-
var state = "default";
|
|
4134
|
-
var userSelect = "";
|
|
4135
|
-
var elementMap = /* @__PURE__ */ new WeakMap();
|
|
4136
|
-
function disableTextSelectionImpl(options = {}) {
|
|
4137
|
-
const { target, doc } = options;
|
|
4138
|
-
const docNode = doc ?? document;
|
|
4139
|
-
const rootEl = docNode.documentElement;
|
|
4140
|
-
if (domQuery.isIos()) {
|
|
4141
|
-
if (state === "default") {
|
|
4142
|
-
userSelect = rootEl.style.webkitUserSelect;
|
|
4143
|
-
rootEl.style.webkitUserSelect = "none";
|
|
4144
|
-
}
|
|
4145
|
-
state = "disabled";
|
|
4146
|
-
} else if (target) {
|
|
4147
|
-
elementMap.set(target, target.style.userSelect);
|
|
4148
|
-
target.style.userSelect = "none";
|
|
4149
|
-
}
|
|
4150
|
-
return () => restoreTextSelection({ target, doc: docNode });
|
|
4151
|
-
}
|
|
4152
|
-
function restoreTextSelection(options = {}) {
|
|
4153
|
-
const { target, doc } = options;
|
|
4154
|
-
const docNode = doc ?? document;
|
|
4155
|
-
const rootEl = docNode.documentElement;
|
|
4156
|
-
if (domQuery.isIos()) {
|
|
4157
|
-
if (state !== "disabled") return;
|
|
4158
|
-
state = "restoring";
|
|
4159
|
-
setTimeout(() => {
|
|
4160
|
-
domQuery.nextTick(() => {
|
|
4161
|
-
if (state === "restoring") {
|
|
4162
|
-
if (rootEl.style.webkitUserSelect === "none") {
|
|
4163
|
-
rootEl.style.webkitUserSelect = userSelect || "";
|
|
4164
|
-
}
|
|
4165
|
-
userSelect = "";
|
|
4166
|
-
state = "default";
|
|
4167
|
-
}
|
|
4168
|
-
});
|
|
4169
|
-
}, 300);
|
|
4170
|
-
} else {
|
|
4171
|
-
if (target && elementMap.has(target)) {
|
|
4172
|
-
const prevUserSelect = elementMap.get(target);
|
|
4173
|
-
if (target.style.userSelect === "none") {
|
|
4174
|
-
target.style.userSelect = prevUserSelect ?? "";
|
|
4175
|
-
}
|
|
4176
|
-
if (target.getAttribute("style") === "") {
|
|
4177
|
-
target.removeAttribute("style");
|
|
4178
|
-
}
|
|
4179
|
-
elementMap.delete(target);
|
|
4180
|
-
}
|
|
4181
|
-
}
|
|
4182
|
-
}
|
|
4183
|
-
function disableTextSelection(options = {}) {
|
|
4184
|
-
const { defer, target, ...restOptions } = options;
|
|
4185
|
-
const func = defer ? domQuery.raf : (v) => v();
|
|
4186
|
-
const cleanups = [];
|
|
4187
|
-
cleanups.push(
|
|
4188
|
-
func(() => {
|
|
4189
|
-
const node = typeof target === "function" ? target() : target;
|
|
4190
|
-
cleanups.push(disableTextSelectionImpl({ ...restOptions, target: node }));
|
|
4191
|
-
})
|
|
4192
|
-
);
|
|
4193
|
-
return () => {
|
|
4194
|
-
cleanups.forEach((fn) => fn?.());
|
|
4195
|
-
};
|
|
4196
|
-
}
|
|
4197
|
-
|
|
4198
|
-
// src/add-dom-event.ts
|
|
4199
|
-
var addDomEvent = (target, eventName, handler, options) => {
|
|
4200
|
-
const node = typeof target === "function" ? target() : target;
|
|
4201
|
-
node?.addEventListener(eventName, handler, options);
|
|
4202
|
-
return () => {
|
|
4203
|
-
node?.removeEventListener(eventName, handler, options);
|
|
4204
|
-
};
|
|
4205
|
-
};
|
|
4206
|
-
var isLeftClick = (e) => e.button === 0;
|
|
4207
|
-
var isModifierKey = (e) => e.ctrlKey || e.altKey || e.metaKey;
|
|
4208
|
-
|
|
4209
|
-
// src/get-event-point.ts
|
|
4210
|
-
function pointFromTouch(e, type = "client") {
|
|
4211
|
-
const point = e.touches[0] || e.changedTouches[0];
|
|
4212
|
-
return { x: point[`${type}X`], y: point[`${type}Y`] };
|
|
4213
|
-
}
|
|
4214
|
-
function pointFromMouse(point, type = "client") {
|
|
4215
|
-
return { x: point[`${type}X`], y: point[`${type}Y`] };
|
|
4216
|
-
}
|
|
4217
|
-
var isTouchEvent = (event) => "touches" in event && event.touches.length > 0;
|
|
4218
|
-
function getEventPoint(event, type = "client") {
|
|
4219
|
-
return isTouchEvent(event) ? pointFromTouch(event, type) : pointFromMouse(event, type);
|
|
4220
|
-
}
|
|
4221
|
-
|
|
4222
|
-
// src/get-point-value.ts
|
|
4223
|
-
function clamp(value) {
|
|
4224
|
-
return Math.max(0, Math.min(1, value));
|
|
4225
|
-
}
|
|
4226
|
-
function getRelativePoint(point, element) {
|
|
4227
|
-
const { left, top, width, height } = element.getBoundingClientRect();
|
|
4228
|
-
const offset = { x: point.x - left, y: point.y - top };
|
|
4229
|
-
const percent = { x: clamp(offset.x / width), y: clamp(offset.y / height) };
|
|
4230
|
-
function getPercentValue(options = {}) {
|
|
4231
|
-
const { dir = "ltr", orientation = "horizontal", inverted } = options;
|
|
4232
|
-
const invertX = typeof inverted === "object" ? inverted.x : inverted;
|
|
4233
|
-
const invertY = typeof inverted === "object" ? inverted.y : inverted;
|
|
4234
|
-
if (orientation === "horizontal") {
|
|
4235
|
-
return dir === "rtl" || invertX ? 1 - percent.x : percent.x;
|
|
4236
|
-
}
|
|
4237
|
-
return invertY ? 1 - percent.y : percent.y;
|
|
4238
|
-
}
|
|
4239
|
-
return { offset, percent, getPercentValue };
|
|
4240
|
-
}
|
|
4241
|
-
function trackPointerMove(doc, handlers) {
|
|
4242
|
-
const { onPointerMove, onPointerUp } = handlers;
|
|
4243
|
-
const history = [];
|
|
4244
|
-
const handleMove = (event) => {
|
|
4245
|
-
const point = getEventPoint(event);
|
|
4246
|
-
history.push({ ...point, timestamp: performance.now() });
|
|
4247
|
-
const distance = Math.sqrt(point.x ** 2 + point.y ** 2);
|
|
4248
|
-
const moveBuffer = event.pointerType === "touch" ? 10 : 5;
|
|
4249
|
-
if (distance < moveBuffer) return;
|
|
4250
|
-
if (event.pointerType === "mouse" && event.button === 0) {
|
|
4251
|
-
onPointerUp();
|
|
4252
|
-
return;
|
|
4253
|
-
}
|
|
4254
|
-
onPointerMove({ point, event, velocity: getVelocity(history, 0.1) });
|
|
4255
|
-
};
|
|
4256
|
-
const cleanups = [
|
|
4257
|
-
addDomEvent(doc, "pointermove", handleMove, false),
|
|
4258
|
-
addDomEvent(doc, "pointerup", onPointerUp, false),
|
|
4259
|
-
addDomEvent(doc, "pointercancel", onPointerUp, false),
|
|
4260
|
-
addDomEvent(doc, "contextmenu", onPointerUp, false),
|
|
4261
|
-
disableTextSelection({ doc })
|
|
4262
|
-
];
|
|
4263
|
-
return () => {
|
|
4264
|
-
cleanups.forEach((cleanup) => cleanup());
|
|
4265
|
-
history.length = 0;
|
|
4266
|
-
};
|
|
4267
|
-
}
|
|
4268
|
-
function lastDevicePoint(history) {
|
|
4269
|
-
return history[history.length - 1];
|
|
4270
|
-
}
|
|
4271
|
-
function ms(seconds) {
|
|
4272
|
-
return seconds * 1e3;
|
|
4273
|
-
}
|
|
4274
|
-
function sec(milliseconds) {
|
|
4275
|
-
return milliseconds / 1e3;
|
|
4276
|
-
}
|
|
4277
|
-
function getVelocity(history, timeDelta) {
|
|
4278
|
-
if (history.length < 2) return { x: 0, y: 0 };
|
|
4279
|
-
let i = history.length - 1;
|
|
4280
|
-
let timestampedPoint = null;
|
|
4281
|
-
const lastPoint = lastDevicePoint(history);
|
|
4282
|
-
while (i >= 0) {
|
|
4283
|
-
timestampedPoint = history[i];
|
|
4284
|
-
if (lastPoint.timestamp - timestampedPoint.timestamp > ms(timeDelta)) {
|
|
4285
|
-
break;
|
|
4286
|
-
}
|
|
4287
|
-
i--;
|
|
4288
|
-
}
|
|
4289
|
-
if (!timestampedPoint) return { x: 0, y: 0 };
|
|
4290
|
-
const time = sec(lastPoint.timestamp - timestampedPoint.timestamp);
|
|
4291
|
-
if (time === 0) return { x: 0, y: 0 };
|
|
4292
|
-
const currentVelocity = {
|
|
4293
|
-
x: (lastPoint.x - timestampedPoint.x) / time,
|
|
4294
|
-
y: (lastPoint.y - timestampedPoint.y) / time
|
|
4295
|
-
};
|
|
4296
|
-
if (currentVelocity.x === Infinity) currentVelocity.x = 0;
|
|
4297
|
-
if (currentVelocity.y === Infinity) currentVelocity.y = 0;
|
|
4298
|
-
return {
|
|
4299
|
-
x: Math.abs(currentVelocity.x),
|
|
4300
|
-
y: Math.abs(currentVelocity.y)
|
|
4301
|
-
};
|
|
4302
|
-
}
|
|
4303
|
-
|
|
4304
|
-
/* eslint @typescript-eslint/no-explicit-any: off */
|
|
4305
|
-
// symbols
|
|
4306
|
-
const GET_ORIGINAL_SYMBOL = Symbol();
|
|
4307
|
-
// get object prototype
|
|
4308
|
-
const getProto = Object.getPrototypeOf;
|
|
4309
|
-
const objectsToTrack = new WeakMap();
|
|
4310
|
-
// check if obj is a plain object or an array
|
|
4311
|
-
const isObjectToTrack = obj => obj && (objectsToTrack.has(obj) ? objectsToTrack.get(obj) : getProto(obj) === Object.prototype || getProto(obj) === Array.prototype);
|
|
4312
|
-
/**
|
|
4313
|
-
* Unwrap proxy to get the original object.
|
|
4314
|
-
*
|
|
4315
|
-
* Used to retrieve the original object used to create the proxy instance with `createProxy`.
|
|
4316
|
-
*
|
|
4317
|
-
* @param {Proxy<object>} obj - The proxy wrapper of the originial object.
|
|
4318
|
-
* @returns {object | null} - Return either the unwrapped object if exists.
|
|
4319
|
-
*
|
|
4320
|
-
* @example
|
|
4321
|
-
* import { createProxy, getUntracked } from 'proxy-compare';
|
|
4322
|
-
*
|
|
4323
|
-
* const original = { a: "1", c: "2", d: { e: "3" } };
|
|
4324
|
-
* const affected = new WeakMap();
|
|
4325
|
-
*
|
|
4326
|
-
* const proxy = createProxy(original, affected);
|
|
4327
|
-
* const originalFromProxy = getUntracked(proxy)
|
|
4328
|
-
*
|
|
4329
|
-
* Object.is(original, originalFromProxy) // true
|
|
4330
|
-
* isChanged(original, originalFromProxy, affected) // false
|
|
4331
|
-
*/
|
|
4332
|
-
const getUntracked = obj => {
|
|
4333
|
-
if (isObjectToTrack(obj)) {
|
|
4334
|
-
return obj[GET_ORIGINAL_SYMBOL] || null;
|
|
4335
|
-
}
|
|
4336
|
-
return null;
|
|
4337
|
-
};
|
|
4338
|
-
/**
|
|
4339
|
-
* Mark object to be tracked.
|
|
4340
|
-
*
|
|
4341
|
-
* This function marks an object that will be passed into `createProxy`
|
|
4342
|
-
* as marked to track or not. By default only Array and Object are marked to track,
|
|
4343
|
-
* so this is useful for example to mark a class instance to track or to mark a object
|
|
4344
|
-
* to be untracked when creating your proxy.
|
|
4345
|
-
*
|
|
4346
|
-
* @param obj - Object to mark as tracked or not.
|
|
4347
|
-
* @param mark - Boolean indicating whether you want to track this object or not.
|
|
4348
|
-
* @returns - No return.
|
|
4349
|
-
*
|
|
4350
|
-
* @example
|
|
4351
|
-
* import { createProxy, markToTrack, isChanged } from 'proxy-compare';
|
|
4352
|
-
*
|
|
4353
|
-
* const nested = { e: "3" }
|
|
4354
|
-
*
|
|
4355
|
-
* markToTrack(nested, false)
|
|
4356
|
-
*
|
|
4357
|
-
* const original = { a: "1", c: "2", d: nested };
|
|
4358
|
-
* const affected = new WeakMap();
|
|
4359
|
-
*
|
|
4360
|
-
* const proxy = createProxy(original, affected);
|
|
4361
|
-
*
|
|
4362
|
-
* proxy.d.e
|
|
4363
|
-
*
|
|
4364
|
-
* isChanged(original, { d: { e: "3" } }, affected) // true
|
|
4365
|
-
*/
|
|
4366
|
-
const markToTrack = (obj, mark = true) => {
|
|
4367
|
-
objectsToTrack.set(obj, mark);
|
|
4368
|
-
};
|
|
4369
|
-
|
|
4370
|
-
// src/global.ts
|
|
4371
|
-
function getGlobal() {
|
|
4372
|
-
if (typeof globalThis !== "undefined") return globalThis;
|
|
4373
|
-
if (typeof self !== "undefined") return self;
|
|
4374
|
-
if (typeof window !== "undefined") return window;
|
|
4375
|
-
if (typeof global !== "undefined") return global;
|
|
4376
|
-
}
|
|
4377
|
-
function makeGlobal(key, value) {
|
|
4378
|
-
const g = getGlobal();
|
|
4379
|
-
if (!g) return value();
|
|
4380
|
-
g[key] || (g[key] = value());
|
|
4381
|
-
return g[key];
|
|
4382
|
-
}
|
|
4383
|
-
var isDev$1 = process.env.NODE_ENV !== "production";
|
|
4384
|
-
var isObject$1 = (x) => typeof x === "object" && x !== null;
|
|
4385
|
-
var proxyStateMap = makeGlobal("__zag__proxyStateMap", () => /* @__PURE__ */ new WeakMap());
|
|
4386
|
-
var refSet = makeGlobal("__zag__refSet", () => /* @__PURE__ */ new WeakSet());
|
|
4387
|
-
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) => {
|
|
4388
|
-
switch (promise.status) {
|
|
4389
|
-
case "fulfilled":
|
|
4390
|
-
return promise.value;
|
|
4391
|
-
case "rejected":
|
|
4392
|
-
throw promise.reason;
|
|
4393
|
-
default:
|
|
4394
|
-
throw promise;
|
|
4395
|
-
}
|
|
4396
|
-
}, snapCache = /* @__PURE__ */ new WeakMap(), createSnapshot = (target, version, handlePromise = defaultHandlePromise) => {
|
|
4397
|
-
const cache = snapCache.get(target);
|
|
4398
|
-
if (cache?.[0] === version) {
|
|
4399
|
-
return cache[1];
|
|
4400
|
-
}
|
|
4401
|
-
const snap = Array.isArray(target) ? [] : Object.create(Object.getPrototypeOf(target));
|
|
4402
|
-
markToTrack(snap, true);
|
|
4403
|
-
snapCache.set(target, [version, snap]);
|
|
4404
|
-
Reflect.ownKeys(target).forEach((key) => {
|
|
4405
|
-
const value = Reflect.get(target, key);
|
|
4406
|
-
if (refSet.has(value)) {
|
|
4407
|
-
markToTrack(value, false);
|
|
4408
|
-
snap[key] = value;
|
|
4409
|
-
} else if (value instanceof Promise) {
|
|
4410
|
-
Object.defineProperty(snap, key, {
|
|
4411
|
-
get() {
|
|
4412
|
-
return handlePromise(value);
|
|
4413
|
-
}
|
|
4414
|
-
});
|
|
4415
|
-
} else if (proxyStateMap.has(value)) {
|
|
4416
|
-
snap[key] = snapshot(value, handlePromise);
|
|
4417
|
-
} else {
|
|
4418
|
-
snap[key] = value;
|
|
4419
|
-
}
|
|
4420
|
-
});
|
|
4421
|
-
return Object.freeze(snap);
|
|
4422
|
-
}, proxyCache = /* @__PURE__ */ new WeakMap(), versionHolder = [1, 1], proxyFunction2 = (initialObject) => {
|
|
4423
|
-
if (!isObject$1(initialObject)) {
|
|
4424
|
-
throw new Error("object required");
|
|
4425
|
-
}
|
|
4426
|
-
const found = proxyCache.get(initialObject);
|
|
4427
|
-
if (found) {
|
|
4428
|
-
return found;
|
|
4429
|
-
}
|
|
4430
|
-
let version = versionHolder[0];
|
|
4431
|
-
const listeners = /* @__PURE__ */ new Set();
|
|
4432
|
-
const notifyUpdate = (op, nextVersion = ++versionHolder[0]) => {
|
|
4433
|
-
if (version !== nextVersion) {
|
|
4434
|
-
version = nextVersion;
|
|
4435
|
-
listeners.forEach((listener) => listener(op, nextVersion));
|
|
4436
|
-
}
|
|
4437
|
-
};
|
|
4438
|
-
let checkVersion = versionHolder[1];
|
|
4439
|
-
const ensureVersion = (nextCheckVersion = ++versionHolder[1]) => {
|
|
4440
|
-
if (checkVersion !== nextCheckVersion && !listeners.size) {
|
|
4441
|
-
checkVersion = nextCheckVersion;
|
|
4442
|
-
propProxyStates.forEach(([propProxyState]) => {
|
|
4443
|
-
const propVersion = propProxyState[1](nextCheckVersion);
|
|
4444
|
-
if (propVersion > version) {
|
|
4445
|
-
version = propVersion;
|
|
4446
|
-
}
|
|
4447
|
-
});
|
|
4448
|
-
}
|
|
4449
|
-
return version;
|
|
4450
|
-
};
|
|
4451
|
-
const createPropListener = (prop) => (op, nextVersion) => {
|
|
4452
|
-
const newOp = [...op];
|
|
4453
|
-
newOp[1] = [prop, ...newOp[1]];
|
|
4454
|
-
notifyUpdate(newOp, nextVersion);
|
|
4455
|
-
};
|
|
4456
|
-
const propProxyStates = /* @__PURE__ */ new Map();
|
|
4457
|
-
const addPropListener = (prop, propProxyState) => {
|
|
4458
|
-
if (isDev$1 && propProxyStates.has(prop)) {
|
|
4459
|
-
throw new Error("prop listener already exists");
|
|
4460
|
-
}
|
|
4461
|
-
if (listeners.size) {
|
|
4462
|
-
const remove = propProxyState[3](createPropListener(prop));
|
|
4463
|
-
propProxyStates.set(prop, [propProxyState, remove]);
|
|
4464
|
-
} else {
|
|
4465
|
-
propProxyStates.set(prop, [propProxyState]);
|
|
4466
|
-
}
|
|
4467
|
-
};
|
|
4468
|
-
const removePropListener = (prop) => {
|
|
4469
|
-
const entry = propProxyStates.get(prop);
|
|
4470
|
-
if (entry) {
|
|
4471
|
-
propProxyStates.delete(prop);
|
|
4472
|
-
entry[1]?.();
|
|
4473
|
-
}
|
|
4474
|
-
};
|
|
4475
|
-
const addListener = (listener) => {
|
|
4476
|
-
listeners.add(listener);
|
|
4477
|
-
if (listeners.size === 1) {
|
|
4478
|
-
propProxyStates.forEach(([propProxyState, prevRemove], prop) => {
|
|
4479
|
-
if (isDev$1 && prevRemove) {
|
|
4480
|
-
throw new Error("remove already exists");
|
|
4481
|
-
}
|
|
4482
|
-
const remove = propProxyState[3](createPropListener(prop));
|
|
4483
|
-
propProxyStates.set(prop, [propProxyState, remove]);
|
|
4484
|
-
});
|
|
4485
|
-
}
|
|
4486
|
-
const removeListener = () => {
|
|
4487
|
-
listeners.delete(listener);
|
|
4488
|
-
if (listeners.size === 0) {
|
|
4489
|
-
propProxyStates.forEach(([propProxyState, remove], prop) => {
|
|
4490
|
-
if (remove) {
|
|
4491
|
-
remove();
|
|
4492
|
-
propProxyStates.set(prop, [propProxyState]);
|
|
4493
|
-
}
|
|
4494
|
-
});
|
|
4495
|
-
}
|
|
4496
|
-
};
|
|
4497
|
-
return removeListener;
|
|
4498
|
-
};
|
|
4499
|
-
const baseObject = Array.isArray(initialObject) ? [] : Object.create(Object.getPrototypeOf(initialObject));
|
|
4500
|
-
const handler = {
|
|
4501
|
-
deleteProperty(target, prop) {
|
|
4502
|
-
const prevValue = Reflect.get(target, prop);
|
|
4503
|
-
removePropListener(prop);
|
|
4504
|
-
const deleted = Reflect.deleteProperty(target, prop);
|
|
4505
|
-
if (deleted) {
|
|
4506
|
-
notifyUpdate(["delete", [prop], prevValue]);
|
|
4507
|
-
}
|
|
4508
|
-
return deleted;
|
|
4509
|
-
},
|
|
4510
|
-
set(target, prop, value, receiver) {
|
|
4511
|
-
const hasPrevValue = Reflect.has(target, prop);
|
|
4512
|
-
const prevValue = Reflect.get(target, prop, receiver);
|
|
4513
|
-
if (hasPrevValue && (objectIs(prevValue, value) || proxyCache.has(value) && objectIs(prevValue, proxyCache.get(value)))) {
|
|
4514
|
-
return true;
|
|
4515
|
-
}
|
|
4516
|
-
removePropListener(prop);
|
|
4517
|
-
if (isObject$1(value)) {
|
|
4518
|
-
value = getUntracked(value) || value;
|
|
4519
|
-
}
|
|
4520
|
-
let nextValue = value;
|
|
4521
|
-
if (Object.getOwnPropertyDescriptor(target, prop)?.set) ; else if (value instanceof Promise) {
|
|
4522
|
-
value.then((v) => {
|
|
4523
|
-
Object.assign(value, { status: "fulfilled", value: v });
|
|
4524
|
-
notifyUpdate(["resolve", [prop], v]);
|
|
4525
|
-
}).catch((e) => {
|
|
4526
|
-
Object.assign(value, { status: "rejected", reason: e });
|
|
4527
|
-
notifyUpdate(["reject", [prop], e]);
|
|
4528
|
-
});
|
|
4529
|
-
} else {
|
|
4530
|
-
if (!proxyStateMap.has(value) && canProxy(value)) {
|
|
4531
|
-
nextValue = proxy(value);
|
|
4532
|
-
}
|
|
4533
|
-
const childProxyState = !refSet.has(nextValue) && proxyStateMap.get(nextValue);
|
|
4534
|
-
if (childProxyState) {
|
|
4535
|
-
addPropListener(prop, childProxyState);
|
|
4536
|
-
}
|
|
4537
|
-
}
|
|
4538
|
-
Reflect.set(target, prop, nextValue, receiver);
|
|
4539
|
-
notifyUpdate(["set", [prop], value, prevValue]);
|
|
4540
|
-
return true;
|
|
4541
|
-
}
|
|
4542
|
-
};
|
|
4543
|
-
const proxyObject = newProxy(baseObject, handler);
|
|
4544
|
-
proxyCache.set(initialObject, proxyObject);
|
|
4545
|
-
const proxyState = [baseObject, ensureVersion, createSnapshot, addListener];
|
|
4546
|
-
proxyStateMap.set(proxyObject, proxyState);
|
|
4547
|
-
Reflect.ownKeys(initialObject).forEach((key) => {
|
|
4548
|
-
const desc = Object.getOwnPropertyDescriptor(initialObject, key);
|
|
4549
|
-
if (desc.get || desc.set) {
|
|
4550
|
-
Object.defineProperty(baseObject, key, desc);
|
|
4551
|
-
} else {
|
|
4552
|
-
proxyObject[key] = initialObject[key];
|
|
4553
|
-
}
|
|
4554
|
-
});
|
|
4555
|
-
return proxyObject;
|
|
4556
|
-
}) => [
|
|
4557
|
-
// public functions
|
|
4558
|
-
proxyFunction2,
|
|
4559
|
-
// shared state
|
|
4560
|
-
proxyStateMap,
|
|
4561
|
-
refSet,
|
|
4562
|
-
// internal things
|
|
4563
|
-
objectIs,
|
|
4564
|
-
newProxy,
|
|
4565
|
-
canProxy,
|
|
4566
|
-
defaultHandlePromise,
|
|
4567
|
-
snapCache,
|
|
4568
|
-
createSnapshot,
|
|
4569
|
-
proxyCache,
|
|
4570
|
-
versionHolder
|
|
4571
|
-
];
|
|
4572
|
-
var [proxyFunction] = buildProxyFunction();
|
|
4573
|
-
function proxy(initialObject = {}) {
|
|
4574
|
-
return proxyFunction(initialObject);
|
|
4575
|
-
}
|
|
4576
|
-
function subscribe(proxyObject, callback, notifyInSync) {
|
|
4577
|
-
const proxyState = proxyStateMap.get(proxyObject);
|
|
4578
|
-
if (isDev$1 && !proxyState) {
|
|
4579
|
-
console.warn("Please use proxy object");
|
|
4580
|
-
}
|
|
4581
|
-
let promise;
|
|
4582
|
-
const ops = [];
|
|
4583
|
-
const addListener = proxyState[3];
|
|
4584
|
-
let isListenerActive = false;
|
|
4585
|
-
const listener = (op) => {
|
|
4586
|
-
ops.push(op);
|
|
4587
|
-
if (notifyInSync) {
|
|
4588
|
-
callback(ops.splice(0));
|
|
4589
|
-
return;
|
|
4590
|
-
}
|
|
4591
|
-
if (!promise) {
|
|
4592
|
-
promise = Promise.resolve().then(() => {
|
|
4593
|
-
promise = void 0;
|
|
4594
|
-
if (isListenerActive) {
|
|
4595
|
-
callback(ops.splice(0));
|
|
4596
|
-
}
|
|
4597
|
-
});
|
|
4598
|
-
}
|
|
4599
|
-
};
|
|
4600
|
-
const removeListener = addListener(listener);
|
|
4601
|
-
isListenerActive = true;
|
|
4602
|
-
return () => {
|
|
4603
|
-
isListenerActive = false;
|
|
4604
|
-
removeListener();
|
|
4605
|
-
};
|
|
4606
|
-
}
|
|
4607
|
-
function snapshot(proxyObject, handlePromise) {
|
|
4608
|
-
const proxyState = proxyStateMap.get(proxyObject);
|
|
4609
|
-
if (isDev$1 && !proxyState) {
|
|
4610
|
-
console.warn("Please use proxy object");
|
|
4611
|
-
}
|
|
4612
|
-
const [target, ensureVersion, createSnapshot] = proxyState;
|
|
4613
|
-
return createSnapshot(target, ensureVersion(), handlePromise);
|
|
4614
|
-
}
|
|
4615
|
-
function ref(obj) {
|
|
4616
|
-
refSet.add(obj);
|
|
4617
|
-
return obj;
|
|
4618
|
-
}
|
|
4619
|
-
|
|
4620
|
-
// src/proxy-computed.ts
|
|
4621
|
-
function proxyWithComputed(initialObject, computedFns) {
|
|
4622
|
-
const keys = Object.keys(computedFns);
|
|
4623
|
-
keys.forEach((key) => {
|
|
4624
|
-
if (Object.getOwnPropertyDescriptor(initialObject, key)) {
|
|
4625
|
-
throw new Error("object property already defined");
|
|
4626
|
-
}
|
|
4627
|
-
const computedFn = computedFns[key];
|
|
4628
|
-
const { get, set } = typeof computedFn === "function" ? { get: computedFn } : computedFn;
|
|
4629
|
-
const desc = {};
|
|
4630
|
-
desc.get = () => get(snapshot(proxyObject));
|
|
4631
|
-
if (set) {
|
|
4632
|
-
desc.set = (newValue) => set(proxyObject, newValue);
|
|
4633
|
-
}
|
|
4634
|
-
Object.defineProperty(initialObject, key, desc);
|
|
4635
|
-
});
|
|
4636
|
-
const proxyObject = proxy(initialObject);
|
|
4637
|
-
return proxyObject;
|
|
4638
|
-
}
|
|
4639
|
-
|
|
4640
|
-
function set(obj, key, val) {
|
|
4641
|
-
if (typeof val.value === 'object') val.value = klona(val.value);
|
|
4642
|
-
if (!val.enumerable || val.get || val.set || !val.configurable || !val.writable || key === '__proto__') {
|
|
4643
|
-
Object.defineProperty(obj, key, val);
|
|
4644
|
-
} else obj[key] = val.value;
|
|
4645
|
-
}
|
|
4646
|
-
|
|
4647
|
-
function klona(x) {
|
|
4648
|
-
if (typeof x !== 'object') return x;
|
|
4649
|
-
|
|
4650
|
-
var i=0, k, list, tmp, str=Object.prototype.toString.call(x);
|
|
4651
|
-
|
|
4652
|
-
if (str === '[object Object]') {
|
|
4653
|
-
tmp = Object.create(x.__proto__ || null);
|
|
4654
|
-
} else if (str === '[object Array]') {
|
|
4655
|
-
tmp = Array(x.length);
|
|
4656
|
-
} else if (str === '[object Set]') {
|
|
4657
|
-
tmp = new Set;
|
|
4658
|
-
x.forEach(function (val) {
|
|
4659
|
-
tmp.add(klona(val));
|
|
4660
|
-
});
|
|
4661
|
-
} else if (str === '[object Map]') {
|
|
4662
|
-
tmp = new Map;
|
|
4663
|
-
x.forEach(function (val, key) {
|
|
4664
|
-
tmp.set(klona(key), klona(val));
|
|
4665
|
-
});
|
|
4666
|
-
} else if (str === '[object Date]') {
|
|
4667
|
-
tmp = new Date(+x);
|
|
4668
|
-
} else if (str === '[object RegExp]') {
|
|
4669
|
-
tmp = new RegExp(x.source, x.flags);
|
|
4670
|
-
} else if (str === '[object DataView]') {
|
|
4671
|
-
tmp = new x.constructor( klona(x.buffer) );
|
|
4672
|
-
} else if (str === '[object ArrayBuffer]') {
|
|
4673
|
-
tmp = x.slice(0);
|
|
4674
|
-
} else if (str.slice(-6) === 'Array]') {
|
|
4675
|
-
// ArrayBuffer.isView(x)
|
|
4676
|
-
// ~> `new` bcuz `Buffer.slice` => ref
|
|
4677
|
-
tmp = new x.constructor(x);
|
|
4678
|
-
}
|
|
4679
|
-
|
|
4680
|
-
if (tmp) {
|
|
4681
|
-
for (list=Object.getOwnPropertySymbols(x); i < list.length; i++) {
|
|
4682
|
-
set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
|
|
4683
|
-
}
|
|
4684
|
-
|
|
4685
|
-
for (i=0, list=Object.getOwnPropertyNames(x); i < list.length; i++) {
|
|
4686
|
-
if (Object.hasOwnProperty.call(tmp, k=list[i]) && tmp[k] === x[k]) continue;
|
|
4687
|
-
set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
|
|
4688
|
-
}
|
|
4689
|
-
}
|
|
4690
|
-
|
|
4691
|
-
return tmp || x;
|
|
4692
|
-
}
|
|
4693
|
-
|
|
4694
|
-
var __defProp = Object.defineProperty;
|
|
4695
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4696
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4697
|
-
|
|
4698
|
-
// ../utilities/core/src/array.ts
|
|
4699
|
-
function clear(v) {
|
|
4700
|
-
while (v.length > 0) v.pop();
|
|
4701
|
-
return v;
|
|
4702
|
-
}
|
|
4703
|
-
|
|
4704
|
-
// ../utilities/core/src/functions.ts
|
|
4705
|
-
var runIfFn = (v, ...a) => {
|
|
4706
|
-
const res = typeof v === "function" ? v(...a) : v;
|
|
4707
|
-
return res ?? void 0;
|
|
4708
|
-
};
|
|
4709
|
-
var cast = (v) => v;
|
|
4710
|
-
var noop = () => {
|
|
4711
|
-
};
|
|
4712
|
-
var uuid = /* @__PURE__ */ (() => {
|
|
4713
|
-
let id = 0;
|
|
4714
|
-
return () => {
|
|
4715
|
-
id++;
|
|
4716
|
-
return id.toString(36);
|
|
4717
|
-
};
|
|
4718
|
-
})();
|
|
4719
|
-
|
|
4720
|
-
// ../utilities/core/src/guard.ts
|
|
4721
|
-
var isDev = () => process.env.NODE_ENV !== "production";
|
|
4722
|
-
var isArray = (v) => Array.isArray(v);
|
|
4723
|
-
var isObject = (v) => !(v == null || typeof v !== "object" || isArray(v));
|
|
4724
|
-
var isNumber = (v) => typeof v === "number" && !Number.isNaN(v);
|
|
4725
|
-
var isString = (v) => typeof v === "string";
|
|
4726
|
-
var isFunction = (v) => typeof v === "function";
|
|
4727
|
-
var hasProp = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
|
|
4728
|
-
|
|
4729
|
-
// ../utilities/core/src/object.ts
|
|
4730
|
-
function compact$1(obj) {
|
|
4731
|
-
if (!isPlainObject$1(obj) || obj === void 0) {
|
|
4732
|
-
return obj;
|
|
4733
|
-
}
|
|
4734
|
-
const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
|
|
4735
|
-
const filtered = {};
|
|
4736
|
-
for (const key of keys) {
|
|
4737
|
-
const value = obj[key];
|
|
4738
|
-
if (value !== void 0) {
|
|
4739
|
-
filtered[key] = compact$1(value);
|
|
4740
|
-
}
|
|
4741
|
-
}
|
|
4742
|
-
return filtered;
|
|
4743
|
-
}
|
|
4744
|
-
var isPlainObject$1 = (value) => {
|
|
4745
|
-
return value && typeof value === "object" && value.constructor === Object;
|
|
4746
|
-
};
|
|
4747
|
-
|
|
4748
|
-
// ../utilities/core/src/warning.ts
|
|
4749
|
-
function warn(...a) {
|
|
4750
|
-
const m = a.length === 1 ? a[0] : a[1];
|
|
4751
|
-
const c = a.length === 2 ? a[0] : true;
|
|
4752
|
-
if (c && process.env.NODE_ENV !== "production") {
|
|
4753
|
-
console.warn(m);
|
|
4754
|
-
}
|
|
4755
|
-
}
|
|
4756
|
-
function invariant(...a) {
|
|
4757
|
-
const m = a.length === 1 ? a[0] : a[1];
|
|
4758
|
-
const c = a.length === 2 ? a[0] : true;
|
|
4759
|
-
if (c && process.env.NODE_ENV !== "production") {
|
|
4760
|
-
throw new Error(m);
|
|
4761
|
-
}
|
|
4762
|
-
}
|
|
4763
|
-
|
|
4764
|
-
// src/deep-merge.ts
|
|
4765
|
-
function deepMerge(source, ...objects) {
|
|
4766
|
-
for (const obj of objects) {
|
|
4767
|
-
const target = compact$1(obj);
|
|
4768
|
-
for (const key in target) {
|
|
4769
|
-
if (isObject(obj[key])) {
|
|
4770
|
-
if (!source[key]) {
|
|
4771
|
-
source[key] = {};
|
|
4772
|
-
}
|
|
4773
|
-
deepMerge(source[key], obj[key]);
|
|
4774
|
-
} else {
|
|
4775
|
-
source[key] = obj[key];
|
|
4776
|
-
}
|
|
4777
|
-
}
|
|
4778
|
-
}
|
|
4779
|
-
return source;
|
|
4780
|
-
}
|
|
4781
|
-
function structuredClone(v) {
|
|
4782
|
-
return klona(v);
|
|
4783
|
-
}
|
|
4784
|
-
function toEvent(event) {
|
|
4785
|
-
const obj = isString(event) ? { type: event } : event;
|
|
4786
|
-
return obj;
|
|
4787
|
-
}
|
|
4788
|
-
function toArray(value) {
|
|
4789
|
-
if (!value) return [];
|
|
4790
|
-
return isArray(value) ? value.slice() : [value];
|
|
4791
|
-
}
|
|
4792
|
-
function isGuardHelper(value) {
|
|
4793
|
-
return isObject(value) && value.predicate != null;
|
|
4794
|
-
}
|
|
4795
|
-
|
|
4796
|
-
// src/guard-utils.ts
|
|
4797
|
-
var Truthy = () => true;
|
|
4798
|
-
function determineGuardFn(guard, guardMap) {
|
|
4799
|
-
guard = guard ?? Truthy;
|
|
4800
|
-
return (context, event, meta) => {
|
|
4801
|
-
if (isString(guard)) {
|
|
4802
|
-
const value = guardMap[guard];
|
|
4803
|
-
return isFunction(value) ? value(context, event, meta) : value;
|
|
4804
|
-
}
|
|
4805
|
-
if (isGuardHelper(guard)) {
|
|
4806
|
-
return guard.predicate(guardMap)(context, event, meta);
|
|
4807
|
-
}
|
|
4808
|
-
return guard?.(context, event, meta);
|
|
4809
|
-
};
|
|
4810
|
-
}
|
|
4811
|
-
function determineActionsFn(values, guardMap) {
|
|
4812
|
-
return (context, event, meta) => {
|
|
4813
|
-
if (isGuardHelper(values)) {
|
|
4814
|
-
return values.predicate(guardMap)(context, event, meta);
|
|
4815
|
-
}
|
|
4816
|
-
return values;
|
|
4817
|
-
};
|
|
4818
|
-
}
|
|
4819
|
-
function createProxy(config) {
|
|
4820
|
-
const computedContext = config.computed ?? cast({});
|
|
4821
|
-
const initialContext = config.context ?? cast({});
|
|
4822
|
-
const initialTags = config.initial ? config.states?.[config.initial]?.tags : [];
|
|
4823
|
-
const state = proxy({
|
|
4824
|
-
value: config.initial ?? "",
|
|
4825
|
-
previousValue: "",
|
|
4826
|
-
event: cast({}),
|
|
4827
|
-
previousEvent: cast({}),
|
|
4828
|
-
context: proxyWithComputed(initialContext, computedContext),
|
|
4829
|
-
done: false,
|
|
4830
|
-
tags: initialTags ?? [],
|
|
4831
|
-
hasTag(tag) {
|
|
4832
|
-
return this.tags.includes(tag);
|
|
4833
|
-
},
|
|
4834
|
-
matches(...value) {
|
|
4835
|
-
return value.includes(this.value);
|
|
4836
|
-
},
|
|
4837
|
-
can(event) {
|
|
4838
|
-
return cast(this).nextEvents.includes(event);
|
|
4839
|
-
},
|
|
4840
|
-
get nextEvents() {
|
|
4841
|
-
const stateEvents = config.states?.[this.value]?.["on"] ?? {};
|
|
4842
|
-
const globalEvents = config?.on ?? {};
|
|
4843
|
-
return Object.keys({ ...stateEvents, ...globalEvents });
|
|
4844
|
-
},
|
|
4845
|
-
get changed() {
|
|
4846
|
-
if (this.event.value === "machine.init" /* Init */ || !this.previousValue) return false;
|
|
4847
|
-
return this.value !== this.previousValue;
|
|
4848
|
-
}
|
|
4849
|
-
});
|
|
4850
|
-
return cast(state);
|
|
4851
|
-
}
|
|
4852
|
-
|
|
4853
|
-
// src/delay-utils.ts
|
|
4854
|
-
function determineDelayFn(delay, delaysMap) {
|
|
4855
|
-
return (context, event) => {
|
|
4856
|
-
if (isNumber(delay)) return delay;
|
|
4857
|
-
if (isFunction(delay)) {
|
|
4858
|
-
return delay(context, event);
|
|
4859
|
-
}
|
|
4860
|
-
if (isString(delay)) {
|
|
4861
|
-
const value = Number.parseFloat(delay);
|
|
4862
|
-
if (!Number.isNaN(value)) {
|
|
4863
|
-
return value;
|
|
4864
|
-
}
|
|
4865
|
-
if (delaysMap) {
|
|
4866
|
-
const valueOrFn = delaysMap?.[delay];
|
|
4867
|
-
invariant(
|
|
4868
|
-
valueOrFn == null,
|
|
4869
|
-
`[@zag-js/core > determine-delay] Cannot determine delay for \`${delay}\`. It doesn't exist in \`options.delays\``
|
|
4870
|
-
);
|
|
4871
|
-
return isFunction(valueOrFn) ? valueOrFn(context, event) : valueOrFn;
|
|
4872
|
-
}
|
|
4485
|
+
const SignaturePadHiddenInput = props => {
|
|
4486
|
+
const [hiddenInputProps, localProps] = createSplitProps()(props, ['value']);
|
|
4487
|
+
const signaturePad = useSignaturePadContext();
|
|
4488
|
+
const mergedProps = solid.mergeProps(() => signaturePad().getHiddenInputProps(hiddenInputProps), localProps);
|
|
4489
|
+
const field = useFieldContext();
|
|
4490
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
4491
|
+
get ["aria-describedby"]() {
|
|
4492
|
+
return field?.().ariaDescribedby;
|
|
4873
4493
|
}
|
|
4874
|
-
};
|
|
4875
|
-
}
|
|
4876
|
-
|
|
4877
|
-
// src/transition-utils.ts
|
|
4878
|
-
function toTarget(target) {
|
|
4879
|
-
return isString(target) ? { target } : target;
|
|
4880
|
-
}
|
|
4881
|
-
function determineTransitionFn(transitions, guardMap) {
|
|
4882
|
-
return (context, event, meta) => {
|
|
4883
|
-
return toArray(transitions).map(toTarget).find((transition) => {
|
|
4884
|
-
const determineGuard = determineGuardFn(transition.guard, guardMap);
|
|
4885
|
-
const guard = determineGuard(context, event, meta);
|
|
4886
|
-
return guard ?? transition.target ?? transition.actions;
|
|
4887
|
-
});
|
|
4888
|
-
};
|
|
4889
|
-
}
|
|
4890
|
-
|
|
4891
|
-
// src/machine.ts
|
|
4892
|
-
var Machine = class {
|
|
4893
|
-
// Let's get started!
|
|
4894
|
-
constructor(config, options) {
|
|
4895
|
-
__publicField(this, "status", "Not Started" /* NotStarted */);
|
|
4896
|
-
__publicField(this, "state");
|
|
4897
|
-
__publicField(this, "initialState");
|
|
4898
|
-
__publicField(this, "initialContext");
|
|
4899
|
-
__publicField(this, "id");
|
|
4900
|
-
__publicField(this, "type", "machine" /* Machine */);
|
|
4901
|
-
// Cleanup function map (per state)
|
|
4902
|
-
__publicField(this, "activityEvents", /* @__PURE__ */ new Map());
|
|
4903
|
-
__publicField(this, "delayedEvents", /* @__PURE__ */ new Map());
|
|
4904
|
-
// state update listeners the user can opt-in for
|
|
4905
|
-
__publicField(this, "stateListeners", /* @__PURE__ */ new Set());
|
|
4906
|
-
__publicField(this, "doneListeners", /* @__PURE__ */ new Set());
|
|
4907
|
-
__publicField(this, "contextWatchers", /* @__PURE__ */ new Set());
|
|
4908
|
-
// Cleanup functions (for `subscribe`)
|
|
4909
|
-
__publicField(this, "removeStateListener", noop);
|
|
4910
|
-
// For Parent <==> Spawned Actor relationship
|
|
4911
|
-
__publicField(this, "parent");
|
|
4912
|
-
__publicField(this, "children", /* @__PURE__ */ new Map());
|
|
4913
|
-
// A map of guard, action, delay implementations
|
|
4914
|
-
__publicField(this, "guardMap");
|
|
4915
|
-
__publicField(this, "actionMap");
|
|
4916
|
-
__publicField(this, "delayMap");
|
|
4917
|
-
__publicField(this, "activityMap");
|
|
4918
|
-
__publicField(this, "sync");
|
|
4919
|
-
__publicField(this, "options");
|
|
4920
|
-
__publicField(this, "config");
|
|
4921
|
-
__publicField(this, "_created", () => {
|
|
4922
|
-
const event = toEvent("machine.created" /* Created */);
|
|
4923
|
-
this.executeActions(this.config?.created, event);
|
|
4924
|
-
});
|
|
4925
|
-
// Starts the interpreted machine.
|
|
4926
|
-
__publicField(this, "start", (init) => {
|
|
4927
|
-
this.state.value = "";
|
|
4928
|
-
this.state.tags = [];
|
|
4929
|
-
if (this.status === "Running" /* Running */) {
|
|
4930
|
-
return this;
|
|
4931
|
-
}
|
|
4932
|
-
this.status = "Running" /* Running */;
|
|
4933
|
-
this.removeStateListener = subscribe(
|
|
4934
|
-
this.state,
|
|
4935
|
-
() => {
|
|
4936
|
-
this.stateListeners.forEach((listener) => {
|
|
4937
|
-
listener(this.stateSnapshot);
|
|
4938
|
-
});
|
|
4939
|
-
},
|
|
4940
|
-
this.sync
|
|
4941
|
-
);
|
|
4942
|
-
this.setupContextWatchers();
|
|
4943
|
-
this.executeActivities(toEvent("machine.start" /* Start */), toArray(this.config.activities), "machine.start" /* Start */);
|
|
4944
|
-
this.executeActions(this.config.entry, toEvent("machine.start" /* Start */));
|
|
4945
|
-
const event = toEvent("machine.init" /* Init */);
|
|
4946
|
-
const target = isObject(init) ? init.value : init;
|
|
4947
|
-
const context = isObject(init) ? init.context : void 0;
|
|
4948
|
-
if (context) {
|
|
4949
|
-
this.setContext(context);
|
|
4950
|
-
}
|
|
4951
|
-
const transition = {
|
|
4952
|
-
target: target ?? this.config.initial
|
|
4953
|
-
};
|
|
4954
|
-
const next = this.getNextStateInfo(transition, event);
|
|
4955
|
-
this.initialState = next;
|
|
4956
|
-
this.performStateChangeEffects(this.state.value, next, event);
|
|
4957
|
-
return this;
|
|
4958
|
-
});
|
|
4959
|
-
__publicField(this, "setupContextWatchers", () => {
|
|
4960
|
-
const { watch } = this.config;
|
|
4961
|
-
if (!watch) return;
|
|
4962
|
-
let prev = snapshot(this.state.context);
|
|
4963
|
-
const cleanup = subscribe(this.state.context, () => {
|
|
4964
|
-
const next = snapshot(this.state.context);
|
|
4965
|
-
for (const [key, fn] of Object.entries(watch)) {
|
|
4966
|
-
const isEqual = this.options.compareFns?.[key] ?? Object.is;
|
|
4967
|
-
if (isEqual(prev[key], next[key])) continue;
|
|
4968
|
-
this.executeActions(fn, this.state.event);
|
|
4969
|
-
}
|
|
4970
|
-
prev = next;
|
|
4971
|
-
});
|
|
4972
|
-
this.contextWatchers.add(cleanup);
|
|
4973
|
-
});
|
|
4974
|
-
// Stops the interpreted machine
|
|
4975
|
-
__publicField(this, "stop", () => {
|
|
4976
|
-
if (this.status === "Stopped" /* Stopped */) return;
|
|
4977
|
-
this.performExitEffects(this.state.value, toEvent("machine.stop" /* Stop */));
|
|
4978
|
-
this.executeActions(this.config.exit, toEvent("machine.stop" /* Stop */));
|
|
4979
|
-
this.setState("");
|
|
4980
|
-
this.setEvent("machine.stop" /* Stop */);
|
|
4981
|
-
this.stopStateListeners();
|
|
4982
|
-
this.stopChildren();
|
|
4983
|
-
this.stopActivities();
|
|
4984
|
-
this.stopDelayedEvents();
|
|
4985
|
-
this.stopContextWatchers();
|
|
4986
|
-
this.status = "Stopped" /* Stopped */;
|
|
4987
|
-
return this;
|
|
4988
|
-
});
|
|
4989
|
-
__publicField(this, "stopStateListeners", () => {
|
|
4990
|
-
this.removeStateListener();
|
|
4991
|
-
this.stateListeners.clear();
|
|
4992
|
-
});
|
|
4993
|
-
__publicField(this, "stopContextWatchers", () => {
|
|
4994
|
-
this.contextWatchers.forEach((fn) => fn());
|
|
4995
|
-
this.contextWatchers.clear();
|
|
4996
|
-
});
|
|
4997
|
-
__publicField(this, "stopDelayedEvents", () => {
|
|
4998
|
-
this.delayedEvents.forEach((state) => {
|
|
4999
|
-
state.forEach((stop) => stop());
|
|
5000
|
-
});
|
|
5001
|
-
this.delayedEvents.clear();
|
|
5002
|
-
});
|
|
5003
|
-
// Cleanup running activities (e.g `setInterval`, invoked callbacks, promises)
|
|
5004
|
-
__publicField(this, "stopActivities", (state) => {
|
|
5005
|
-
if (state) {
|
|
5006
|
-
this.activityEvents.get(state)?.forEach((stop) => stop());
|
|
5007
|
-
this.activityEvents.get(state)?.clear();
|
|
5008
|
-
this.activityEvents.delete(state);
|
|
5009
|
-
} else {
|
|
5010
|
-
this.activityEvents.forEach((state2) => {
|
|
5011
|
-
state2.forEach((stop) => stop());
|
|
5012
|
-
state2.clear();
|
|
5013
|
-
});
|
|
5014
|
-
this.activityEvents.clear();
|
|
5015
|
-
}
|
|
5016
|
-
});
|
|
5017
|
-
/**
|
|
5018
|
-
* Function to send event to spawned child machine or actor
|
|
5019
|
-
*/
|
|
5020
|
-
__publicField(this, "sendChild", (evt, to) => {
|
|
5021
|
-
const event = toEvent(evt);
|
|
5022
|
-
const id = runIfFn(to, this.contextSnapshot);
|
|
5023
|
-
const child = this.children.get(id);
|
|
5024
|
-
if (!child) {
|
|
5025
|
-
invariant(`[@zag-js/core] Cannot send '${event.type}' event to unknown child`);
|
|
5026
|
-
}
|
|
5027
|
-
child.send(event);
|
|
5028
|
-
});
|
|
5029
|
-
/**
|
|
5030
|
-
* Function to stop a running child machine or actor
|
|
5031
|
-
*/
|
|
5032
|
-
__publicField(this, "stopChild", (id) => {
|
|
5033
|
-
if (!this.children.has(id)) {
|
|
5034
|
-
invariant(`[@zag-js/core > stop-child] Cannot stop unknown child ${id}`);
|
|
5035
|
-
}
|
|
5036
|
-
this.children.get(id).stop();
|
|
5037
|
-
this.children.delete(id);
|
|
5038
|
-
});
|
|
5039
|
-
__publicField(this, "removeChild", (id) => {
|
|
5040
|
-
this.children.delete(id);
|
|
5041
|
-
});
|
|
5042
|
-
// Stop and delete spawned actors
|
|
5043
|
-
__publicField(this, "stopChildren", () => {
|
|
5044
|
-
this.children.forEach((child) => child.stop());
|
|
5045
|
-
this.children.clear();
|
|
5046
|
-
});
|
|
5047
|
-
__publicField(this, "setParent", (parent) => {
|
|
5048
|
-
this.parent = parent;
|
|
5049
|
-
});
|
|
5050
|
-
__publicField(this, "spawn", (src, id) => {
|
|
5051
|
-
const actor = runIfFn(src);
|
|
5052
|
-
if (id) actor.id = id;
|
|
5053
|
-
actor.type = "machine.actor" /* Actor */;
|
|
5054
|
-
actor.setParent(this);
|
|
5055
|
-
this.children.set(actor.id, cast(actor));
|
|
5056
|
-
actor.onDone(() => {
|
|
5057
|
-
this.removeChild(actor.id);
|
|
5058
|
-
}).start();
|
|
5059
|
-
return cast(ref(actor));
|
|
5060
|
-
});
|
|
5061
|
-
__publicField(this, "stopActivity", (key) => {
|
|
5062
|
-
if (!this.state.value) return;
|
|
5063
|
-
const cleanups = this.activityEvents.get(this.state.value);
|
|
5064
|
-
cleanups?.get(key)?.();
|
|
5065
|
-
cleanups?.delete(key);
|
|
5066
|
-
});
|
|
5067
|
-
__publicField(this, "addActivityCleanup", (state, key, cleanup) => {
|
|
5068
|
-
if (!state) return;
|
|
5069
|
-
if (!this.activityEvents.has(state)) {
|
|
5070
|
-
this.activityEvents.set(state, /* @__PURE__ */ new Map([[key, cleanup]]));
|
|
5071
|
-
} else {
|
|
5072
|
-
this.activityEvents.get(state)?.set(key, cleanup);
|
|
5073
|
-
}
|
|
5074
|
-
});
|
|
5075
|
-
__publicField(this, "setState", (target) => {
|
|
5076
|
-
this.state.previousValue = this.state.value;
|
|
5077
|
-
this.state.value = target;
|
|
5078
|
-
const stateNode = this.getStateNode(target);
|
|
5079
|
-
if (target == null) {
|
|
5080
|
-
clear(this.state.tags);
|
|
5081
|
-
} else {
|
|
5082
|
-
this.state.tags = toArray(stateNode?.tags);
|
|
5083
|
-
}
|
|
5084
|
-
});
|
|
5085
|
-
/**
|
|
5086
|
-
* To used within side effects for React or Vue to update context
|
|
5087
|
-
*/
|
|
5088
|
-
__publicField(this, "setContext", (context) => {
|
|
5089
|
-
if (!context) return;
|
|
5090
|
-
deepMerge(this.state.context, compact$1(context));
|
|
5091
|
-
});
|
|
5092
|
-
__publicField(this, "setOptions", (options) => {
|
|
5093
|
-
const opts = compact$1(options);
|
|
5094
|
-
this.actionMap = { ...this.actionMap, ...opts.actions };
|
|
5095
|
-
this.delayMap = { ...this.delayMap, ...opts.delays };
|
|
5096
|
-
this.activityMap = { ...this.activityMap, ...opts.activities };
|
|
5097
|
-
this.guardMap = { ...this.guardMap, ...opts.guards };
|
|
5098
|
-
});
|
|
5099
|
-
__publicField(this, "getStateNode", (state) => {
|
|
5100
|
-
if (!state) return;
|
|
5101
|
-
return this.config.states?.[state];
|
|
5102
|
-
});
|
|
5103
|
-
__publicField(this, "getNextStateInfo", (transitions, event) => {
|
|
5104
|
-
const transition = this.determineTransition(transitions, event);
|
|
5105
|
-
const isTargetless = !transition?.target;
|
|
5106
|
-
const target = transition?.target ?? this.state.value;
|
|
5107
|
-
const changed = this.state.value !== target;
|
|
5108
|
-
const stateNode = this.getStateNode(target);
|
|
5109
|
-
const reenter = !isTargetless && !changed && !transition?.internal;
|
|
5110
|
-
const info = {
|
|
5111
|
-
reenter,
|
|
5112
|
-
transition,
|
|
5113
|
-
stateNode,
|
|
5114
|
-
target,
|
|
5115
|
-
changed
|
|
5116
|
-
};
|
|
5117
|
-
this.log("NextState:", `[${event.type}]`, this.state.value, "---->", info.target);
|
|
5118
|
-
return info;
|
|
5119
|
-
});
|
|
5120
|
-
__publicField(this, "getAfterActions", (transition, delay) => {
|
|
5121
|
-
let id;
|
|
5122
|
-
return {
|
|
5123
|
-
entry: () => {
|
|
5124
|
-
id = globalThis.setTimeout(() => {
|
|
5125
|
-
const next = this.getNextStateInfo(transition, this.state.event);
|
|
5126
|
-
this.performStateChangeEffects(this.state.value, next, this.state.event);
|
|
5127
|
-
}, delay);
|
|
5128
|
-
},
|
|
5129
|
-
exit: () => {
|
|
5130
|
-
globalThis.clearTimeout(id);
|
|
5131
|
-
}
|
|
5132
|
-
};
|
|
5133
|
-
});
|
|
5134
|
-
/**
|
|
5135
|
-
* All `after` events leverage `setTimeout` and `clearTimeout`,
|
|
5136
|
-
* we invoke the `clearTimeout` on exit and `setTimeout` on entry.
|
|
5137
|
-
*
|
|
5138
|
-
* To achieve this, we split the `after` defintion into `entry` and `exit`
|
|
5139
|
-
* functions and append them to the state's `entry` and `exit` actions
|
|
5140
|
-
*/
|
|
5141
|
-
__publicField(this, "getDelayedEventActions", (state) => {
|
|
5142
|
-
const stateNode = this.getStateNode(state);
|
|
5143
|
-
const event = this.state.event;
|
|
5144
|
-
if (!stateNode || !stateNode.after) return;
|
|
5145
|
-
const entries = [];
|
|
5146
|
-
const exits = [];
|
|
5147
|
-
if (isArray(stateNode.after)) {
|
|
5148
|
-
const transition = this.determineTransition(stateNode.after, event);
|
|
5149
|
-
if (!transition) return;
|
|
5150
|
-
if (!hasProp(transition, "delay")) {
|
|
5151
|
-
throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(transition)}`);
|
|
5152
|
-
}
|
|
5153
|
-
const determineDelay = determineDelayFn(transition.delay, this.delayMap);
|
|
5154
|
-
const __delay = determineDelay(this.contextSnapshot, event);
|
|
5155
|
-
const actions = this.getAfterActions(transition, __delay);
|
|
5156
|
-
entries.push(actions.entry);
|
|
5157
|
-
exits.push(actions.exit);
|
|
5158
|
-
return { entries, exits };
|
|
5159
|
-
}
|
|
5160
|
-
if (isObject(stateNode.after)) {
|
|
5161
|
-
for (const delay in stateNode.after) {
|
|
5162
|
-
const transition = stateNode.after[delay];
|
|
5163
|
-
const determineDelay = determineDelayFn(delay, this.delayMap);
|
|
5164
|
-
const __delay = determineDelay(this.contextSnapshot, event);
|
|
5165
|
-
const actions = this.getAfterActions(transition, __delay);
|
|
5166
|
-
entries.push(actions.entry);
|
|
5167
|
-
exits.push(actions.exit);
|
|
5168
|
-
}
|
|
5169
|
-
}
|
|
5170
|
-
return { entries, exits };
|
|
5171
|
-
});
|
|
5172
|
-
/**
|
|
5173
|
-
* Function to executes defined actions. It can accept actions as string
|
|
5174
|
-
* (referencing `options.actions`) or actual functions.
|
|
5175
|
-
*/
|
|
5176
|
-
__publicField(this, "executeActions", (actions, event) => {
|
|
5177
|
-
const pickedActions = determineActionsFn(actions, this.guardMap)(this.contextSnapshot, event, this.guardMeta);
|
|
5178
|
-
for (const action of toArray(pickedActions)) {
|
|
5179
|
-
const fn = isString(action) ? this.actionMap?.[action] : action;
|
|
5180
|
-
warn(
|
|
5181
|
-
isString(action) && !fn,
|
|
5182
|
-
`[@zag-js/core > execute-actions] No implementation found for action: \`${action}\``
|
|
5183
|
-
);
|
|
5184
|
-
fn?.(this.state.context, event, this.meta);
|
|
5185
|
-
}
|
|
5186
|
-
});
|
|
5187
|
-
/**
|
|
5188
|
-
* Function to execute running activities and registers
|
|
5189
|
-
* their cleanup function internally (to be called later on when we exit the state)
|
|
5190
|
-
*/
|
|
5191
|
-
__publicField(this, "executeActivities", (event, activities, state) => {
|
|
5192
|
-
for (const activity of activities) {
|
|
5193
|
-
const fn = isString(activity) ? this.activityMap?.[activity] : activity;
|
|
5194
|
-
if (!fn) {
|
|
5195
|
-
warn(`[@zag-js/core > execute-activity] No implementation found for activity: \`${activity}\``);
|
|
5196
|
-
continue;
|
|
5197
|
-
}
|
|
5198
|
-
const cleanup = fn(this.state.context, event, this.meta);
|
|
5199
|
-
if (cleanup) {
|
|
5200
|
-
const key = isString(activity) ? activity : activity.name || uuid();
|
|
5201
|
-
this.addActivityCleanup(state ?? this.state.value, key, cleanup);
|
|
5202
|
-
}
|
|
5203
|
-
}
|
|
5204
|
-
});
|
|
5205
|
-
/**
|
|
5206
|
-
* Normalizes the `every` definition to transition. `every` can be:
|
|
5207
|
-
* - An array of possible actions to run (we need to pick the first match based on guard)
|
|
5208
|
-
* - An object of intervals and actions
|
|
5209
|
-
*/
|
|
5210
|
-
__publicField(this, "createEveryActivities", (every, callbackfn) => {
|
|
5211
|
-
if (!every) return;
|
|
5212
|
-
if (isArray(every)) {
|
|
5213
|
-
const picked = toArray(every).find((transition) => {
|
|
5214
|
-
const delayOrFn = transition.delay;
|
|
5215
|
-
const determineDelay2 = determineDelayFn(delayOrFn, this.delayMap);
|
|
5216
|
-
const delay2 = determineDelay2(this.contextSnapshot, this.state.event);
|
|
5217
|
-
const determineGuard = determineGuardFn(transition.guard, this.guardMap);
|
|
5218
|
-
const guard = determineGuard(this.contextSnapshot, this.state.event, this.guardMeta);
|
|
5219
|
-
return guard ?? delay2 != null;
|
|
5220
|
-
});
|
|
5221
|
-
if (!picked) return;
|
|
5222
|
-
const determineDelay = determineDelayFn(picked.delay, this.delayMap);
|
|
5223
|
-
const delay = determineDelay(this.contextSnapshot, this.state.event);
|
|
5224
|
-
const activity = () => {
|
|
5225
|
-
const id = globalThis.setInterval(() => {
|
|
5226
|
-
this.executeActions(picked.actions, this.state.event);
|
|
5227
|
-
}, delay);
|
|
5228
|
-
return () => {
|
|
5229
|
-
globalThis.clearInterval(id);
|
|
5230
|
-
};
|
|
5231
|
-
};
|
|
5232
|
-
callbackfn(activity);
|
|
5233
|
-
} else {
|
|
5234
|
-
for (const interval in every) {
|
|
5235
|
-
const actions = every?.[interval];
|
|
5236
|
-
const determineDelay = determineDelayFn(interval, this.delayMap);
|
|
5237
|
-
const delay = determineDelay(this.contextSnapshot, this.state.event);
|
|
5238
|
-
const activity = () => {
|
|
5239
|
-
const id = globalThis.setInterval(() => {
|
|
5240
|
-
this.executeActions(actions, this.state.event);
|
|
5241
|
-
}, delay);
|
|
5242
|
-
return () => {
|
|
5243
|
-
globalThis.clearInterval(id);
|
|
5244
|
-
};
|
|
5245
|
-
};
|
|
5246
|
-
callbackfn(activity);
|
|
5247
|
-
}
|
|
5248
|
-
}
|
|
5249
|
-
});
|
|
5250
|
-
__publicField(this, "setEvent", (event) => {
|
|
5251
|
-
this.state.previousEvent = this.state.event;
|
|
5252
|
-
this.state.event = ref(toEvent(event));
|
|
5253
|
-
});
|
|
5254
|
-
__publicField(this, "performExitEffects", (current, event) => {
|
|
5255
|
-
const currentState = this.state.value;
|
|
5256
|
-
if (currentState === "") return;
|
|
5257
|
-
const stateNode = current ? this.getStateNode(current) : void 0;
|
|
5258
|
-
this.stopActivities(currentState);
|
|
5259
|
-
const _exit = determineActionsFn(stateNode?.exit, this.guardMap)(this.contextSnapshot, event, this.guardMeta);
|
|
5260
|
-
const exitActions = toArray(_exit);
|
|
5261
|
-
const afterExitActions = this.delayedEvents.get(currentState);
|
|
5262
|
-
if (afterExitActions) {
|
|
5263
|
-
exitActions.push(...afterExitActions);
|
|
5264
|
-
}
|
|
5265
|
-
this.executeActions(exitActions, event);
|
|
5266
|
-
});
|
|
5267
|
-
__publicField(this, "performEntryEffects", (next, event) => {
|
|
5268
|
-
const stateNode = this.getStateNode(next);
|
|
5269
|
-
const activities = toArray(stateNode?.activities);
|
|
5270
|
-
this.createEveryActivities(stateNode?.every, (activity) => {
|
|
5271
|
-
activities.unshift(activity);
|
|
5272
|
-
});
|
|
5273
|
-
if (activities.length > 0) {
|
|
5274
|
-
this.executeActivities(event, activities);
|
|
5275
|
-
}
|
|
5276
|
-
const pickedActions = determineActionsFn(stateNode?.entry, this.guardMap)(
|
|
5277
|
-
this.contextSnapshot,
|
|
5278
|
-
event,
|
|
5279
|
-
this.guardMeta
|
|
5280
|
-
);
|
|
5281
|
-
const entryActions = toArray(pickedActions);
|
|
5282
|
-
const afterActions = this.getDelayedEventActions(next);
|
|
5283
|
-
if (stateNode?.after && afterActions) {
|
|
5284
|
-
this.delayedEvents.set(next, afterActions?.exits);
|
|
5285
|
-
entryActions.push(...afterActions.entries);
|
|
5286
|
-
}
|
|
5287
|
-
this.executeActions(entryActions, event);
|
|
5288
|
-
if (stateNode?.type === "final") {
|
|
5289
|
-
this.state.done = true;
|
|
5290
|
-
this.doneListeners.forEach((listener) => {
|
|
5291
|
-
listener(this.stateSnapshot);
|
|
5292
|
-
});
|
|
5293
|
-
this.stop();
|
|
5294
|
-
}
|
|
5295
|
-
});
|
|
5296
|
-
__publicField(this, "performTransitionEffects", (transitions, event) => {
|
|
5297
|
-
const transition = this.determineTransition(transitions, event);
|
|
5298
|
-
this.executeActions(transition?.actions, event);
|
|
5299
|
-
});
|
|
5300
|
-
/**
|
|
5301
|
-
* Performs all the requires side-effects or reactions when
|
|
5302
|
-
* we move from state A => state B.
|
|
5303
|
-
*
|
|
5304
|
-
* The Effect order:
|
|
5305
|
-
* Exit actions (current state) => Transition actions => Go to state => Entry actions (next state)
|
|
5306
|
-
*/
|
|
5307
|
-
__publicField(this, "performStateChangeEffects", (current, next, event) => {
|
|
5308
|
-
this.setEvent(event);
|
|
5309
|
-
const changed = next.changed || next.reenter;
|
|
5310
|
-
if (changed) {
|
|
5311
|
-
this.performExitEffects(current, event);
|
|
5312
|
-
}
|
|
5313
|
-
this.performTransitionEffects(next.transition, event);
|
|
5314
|
-
this.setState(next.target);
|
|
5315
|
-
if (changed) {
|
|
5316
|
-
this.performEntryEffects(next.target, event);
|
|
5317
|
-
}
|
|
5318
|
-
});
|
|
5319
|
-
__publicField(this, "determineTransition", (transition, event) => {
|
|
5320
|
-
const fn = determineTransitionFn(transition, this.guardMap);
|
|
5321
|
-
return fn?.(this.contextSnapshot, event, this.guardMeta);
|
|
5322
|
-
});
|
|
5323
|
-
/**
|
|
5324
|
-
* Function to send event to parent machine from spawned child
|
|
5325
|
-
*/
|
|
5326
|
-
__publicField(this, "sendParent", (evt) => {
|
|
5327
|
-
if (!this.parent) {
|
|
5328
|
-
invariant("[@zag-js/core > send-parent] Cannot send event to an unknown parent");
|
|
5329
|
-
}
|
|
5330
|
-
const event = toEvent(evt);
|
|
5331
|
-
this.parent?.send(event);
|
|
5332
|
-
});
|
|
5333
|
-
__publicField(this, "log", (...args) => {
|
|
5334
|
-
if (isDev() && this.options.debug) {
|
|
5335
|
-
console.log(...args);
|
|
5336
|
-
}
|
|
5337
|
-
});
|
|
5338
|
-
/**
|
|
5339
|
-
* Function to send an event to current machine
|
|
5340
|
-
*/
|
|
5341
|
-
__publicField(this, "send", (evt) => {
|
|
5342
|
-
const event = toEvent(evt);
|
|
5343
|
-
this.transition(this.state.value, event);
|
|
5344
|
-
});
|
|
5345
|
-
__publicField(this, "transition", (state, evt) => {
|
|
5346
|
-
const stateNode = isString(state) ? this.getStateNode(state) : state?.stateNode;
|
|
5347
|
-
const event = toEvent(evt);
|
|
5348
|
-
if (!stateNode && !this.config.on) {
|
|
5349
|
-
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}`;
|
|
5350
|
-
warn(msg);
|
|
5351
|
-
return;
|
|
5352
|
-
}
|
|
5353
|
-
const transitions = stateNode?.on?.[event.type] ?? this.config.on?.[event.type];
|
|
5354
|
-
const next = this.getNextStateInfo(transitions, event);
|
|
5355
|
-
this.performStateChangeEffects(this.state.value, next, event);
|
|
5356
|
-
return next.stateNode;
|
|
5357
|
-
});
|
|
5358
|
-
__publicField(this, "subscribe", (listener) => {
|
|
5359
|
-
this.stateListeners.add(listener);
|
|
5360
|
-
if (this.status === "Running" /* Running */) {
|
|
5361
|
-
listener(this.stateSnapshot);
|
|
5362
|
-
}
|
|
5363
|
-
return () => {
|
|
5364
|
-
this.stateListeners.delete(listener);
|
|
5365
|
-
};
|
|
5366
|
-
});
|
|
5367
|
-
__publicField(this, "onDone", (listener) => {
|
|
5368
|
-
this.doneListeners.add(listener);
|
|
5369
|
-
return this;
|
|
5370
|
-
});
|
|
5371
|
-
__publicField(this, "onTransition", (listener) => {
|
|
5372
|
-
this.stateListeners.add(listener);
|
|
5373
|
-
if (this.status === "Running" /* Running */) {
|
|
5374
|
-
listener(this.stateSnapshot);
|
|
5375
|
-
}
|
|
5376
|
-
return this;
|
|
5377
|
-
});
|
|
5378
|
-
this.config = structuredClone(config);
|
|
5379
|
-
this.options = structuredClone(options ?? {});
|
|
5380
|
-
this.id = this.config.id ?? `machine-${uuid()}`;
|
|
5381
|
-
this.guardMap = this.options?.guards ?? {};
|
|
5382
|
-
this.actionMap = this.options?.actions ?? {};
|
|
5383
|
-
this.delayMap = this.options?.delays ?? {};
|
|
5384
|
-
this.activityMap = this.options?.activities ?? {};
|
|
5385
|
-
this.sync = this.options?.sync ?? false;
|
|
5386
|
-
this.state = createProxy(this.config);
|
|
5387
|
-
this.initialContext = snapshot(this.state.context);
|
|
5388
|
-
}
|
|
5389
|
-
// immutable state value
|
|
5390
|
-
get stateSnapshot() {
|
|
5391
|
-
return cast(snapshot(this.state));
|
|
5392
|
-
}
|
|
5393
|
-
getState() {
|
|
5394
|
-
return this.stateSnapshot;
|
|
5395
|
-
}
|
|
5396
|
-
// immutable context value
|
|
5397
|
-
get contextSnapshot() {
|
|
5398
|
-
return this.stateSnapshot.context;
|
|
5399
|
-
}
|
|
5400
|
-
/**
|
|
5401
|
-
* A reference to the instance methods of the machine.
|
|
5402
|
-
* Useful when spawning child machines and managing the communication between them.
|
|
5403
|
-
*/
|
|
5404
|
-
get self() {
|
|
5405
|
-
const self = this;
|
|
5406
|
-
return {
|
|
5407
|
-
id: this.id,
|
|
5408
|
-
send: this.send.bind(this),
|
|
5409
|
-
sendParent: this.sendParent.bind(this),
|
|
5410
|
-
sendChild: this.sendChild.bind(this),
|
|
5411
|
-
stop: this.stop.bind(this),
|
|
5412
|
-
stopChild: this.stopChild.bind(this),
|
|
5413
|
-
spawn: this.spawn.bind(this),
|
|
5414
|
-
stopActivity: this.stopActivity.bind(this),
|
|
5415
|
-
get state() {
|
|
5416
|
-
return self.stateSnapshot;
|
|
5417
|
-
},
|
|
5418
|
-
get initialContext() {
|
|
5419
|
-
return self.initialContext;
|
|
5420
|
-
},
|
|
5421
|
-
get initialState() {
|
|
5422
|
-
return self.initialState?.target ?? "";
|
|
5423
|
-
}
|
|
5424
|
-
};
|
|
5425
|
-
}
|
|
5426
|
-
get meta() {
|
|
5427
|
-
return {
|
|
5428
|
-
state: this.stateSnapshot,
|
|
5429
|
-
guards: this.guardMap,
|
|
5430
|
-
send: this.send.bind(this),
|
|
5431
|
-
self: this.self,
|
|
5432
|
-
initialContext: this.initialContext,
|
|
5433
|
-
initialState: this.initialState?.target ?? "",
|
|
5434
|
-
getState: () => this.stateSnapshot,
|
|
5435
|
-
getAction: (key) => this.actionMap[key],
|
|
5436
|
-
getGuard: (key) => this.guardMap[key]
|
|
5437
|
-
};
|
|
5438
|
-
}
|
|
5439
|
-
get guardMeta() {
|
|
5440
|
-
return {
|
|
5441
|
-
state: this.stateSnapshot
|
|
5442
|
-
};
|
|
5443
|
-
}
|
|
5444
|
-
get [Symbol.toStringTag]() {
|
|
5445
|
-
return "Machine";
|
|
5446
|
-
}
|
|
4494
|
+
}, mergedProps));
|
|
5447
4495
|
};
|
|
5448
|
-
var createMachine = (config, options) => new Machine(config, options);
|
|
5449
|
-
|
|
5450
|
-
// src/array.ts
|
|
5451
|
-
|
|
5452
|
-
// src/object.ts
|
|
5453
|
-
function compact(obj) {
|
|
5454
|
-
if (!isPlainObject(obj) || obj === void 0) {
|
|
5455
|
-
return obj;
|
|
5456
|
-
}
|
|
5457
|
-
const keys = Reflect.ownKeys(obj).filter((key) => typeof key === "string");
|
|
5458
|
-
const filtered = {};
|
|
5459
|
-
for (const key of keys) {
|
|
5460
|
-
const value = obj[key];
|
|
5461
|
-
if (value !== void 0) {
|
|
5462
|
-
filtered[key] = compact(value);
|
|
5463
|
-
}
|
|
5464
|
-
}
|
|
5465
|
-
return filtered;
|
|
5466
|
-
}
|
|
5467
|
-
var isPlainObject = (value) => {
|
|
5468
|
-
return value && typeof value === "object" && value.constructor === Object;
|
|
5469
|
-
};
|
|
5470
|
-
|
|
5471
|
-
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;
|
|
5472
|
-
|
|
5473
|
-
// src/signature-pad.anatomy.ts
|
|
5474
|
-
var anatomy = createAnatomy("signature-pad").parts(
|
|
5475
|
-
"root",
|
|
5476
|
-
"control",
|
|
5477
|
-
"segment",
|
|
5478
|
-
"segmentPath",
|
|
5479
|
-
"guide",
|
|
5480
|
-
"clearTrigger",
|
|
5481
|
-
"label"
|
|
5482
|
-
);
|
|
5483
|
-
var parts = anatomy.build();
|
|
5484
|
-
var dom = domQuery.createScope({
|
|
5485
|
-
getRootId: (ctx) => ctx.ids?.root ?? `signature-${ctx.id}`,
|
|
5486
|
-
getControlId: (ctx) => ctx.ids?.control ?? `signature-control-${ctx.id}`,
|
|
5487
|
-
getHiddenInputId: (ctx) => ctx.ids?.hiddenInput ?? `signature-input-${ctx.id}`,
|
|
5488
|
-
getControlEl: (ctx) => dom.getById(ctx, dom.getControlId(ctx)),
|
|
5489
|
-
getSegmentEl: (ctx) => domQuery.query(dom.getControlEl(ctx), "[data-part=segment]"),
|
|
5490
|
-
getHiddenInputEl: (ctx) => dom.getById(ctx, dom.getHiddenInputId(ctx)),
|
|
5491
|
-
getDataUrl: (ctx, options) => {
|
|
5492
|
-
if (ctx.isEmpty) return Promise.resolve("");
|
|
5493
|
-
return domQuery.getDataUrl(dom.getSegmentEl(ctx), options);
|
|
5494
|
-
}
|
|
5495
|
-
});
|
|
5496
|
-
|
|
5497
|
-
// src/signature-pad.connect.ts
|
|
5498
|
-
function connect(state, send, normalize) {
|
|
5499
|
-
const drawing = state.matches("drawing");
|
|
5500
|
-
const empty = state.context.isEmpty;
|
|
5501
|
-
const interactive = state.context.isInteractive;
|
|
5502
|
-
const disabled = !!state.context.disabled;
|
|
5503
|
-
return {
|
|
5504
|
-
empty,
|
|
5505
|
-
drawing,
|
|
5506
|
-
currentPath: state.context.currentPath,
|
|
5507
|
-
paths: state.context.paths,
|
|
5508
|
-
clear() {
|
|
5509
|
-
send({ type: "CLEAR" });
|
|
5510
|
-
},
|
|
5511
|
-
getDataUrl(type, quality) {
|
|
5512
|
-
return dom.getDataUrl(state.context, { type, quality });
|
|
5513
|
-
},
|
|
5514
|
-
getLabelProps() {
|
|
5515
|
-
return normalize.element({
|
|
5516
|
-
...parts.label.attrs,
|
|
5517
|
-
"data-disabled": domQuery.dataAttr(disabled),
|
|
5518
|
-
htmlFor: dom.getControlId(state.context)
|
|
5519
|
-
});
|
|
5520
|
-
},
|
|
5521
|
-
getRootProps() {
|
|
5522
|
-
return normalize.element({
|
|
5523
|
-
...parts.root.attrs,
|
|
5524
|
-
"data-disabled": domQuery.dataAttr(disabled),
|
|
5525
|
-
id: dom.getRootId(state.context)
|
|
5526
|
-
});
|
|
5527
|
-
},
|
|
5528
|
-
getControlProps() {
|
|
5529
|
-
return normalize.element({
|
|
5530
|
-
...parts.control.attrs,
|
|
5531
|
-
tabIndex: disabled ? void 0 : 0,
|
|
5532
|
-
id: dom.getControlId(state.context),
|
|
5533
|
-
"aria-label": "Signature Pad",
|
|
5534
|
-
"aria-roledescription": "signature pad",
|
|
5535
|
-
"aria-disabled": disabled,
|
|
5536
|
-
"data-disabled": domQuery.dataAttr(disabled),
|
|
5537
|
-
onPointerDown(event) {
|
|
5538
|
-
if (!isLeftClick(event)) return;
|
|
5539
|
-
if (isModifierKey(event)) return;
|
|
5540
|
-
if (!interactive) return;
|
|
5541
|
-
const target = domQuery.getEventTarget(event);
|
|
5542
|
-
if (target?.closest("[data-part=clear-trigger]")) return;
|
|
5543
|
-
event.currentTarget.setPointerCapture(event.pointerId);
|
|
5544
|
-
const point = { x: event.clientX, y: event.clientY };
|
|
5545
|
-
const { offset } = getRelativePoint(point, dom.getControlEl(state.context));
|
|
5546
|
-
send({ type: "POINTER_DOWN", point: offset, pressure: event.pressure });
|
|
5547
|
-
},
|
|
5548
|
-
onPointerUp(event) {
|
|
5549
|
-
if (!interactive) return;
|
|
5550
|
-
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
5551
|
-
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
5552
|
-
}
|
|
5553
|
-
},
|
|
5554
|
-
style: {
|
|
5555
|
-
position: "relative",
|
|
5556
|
-
touchAction: "none",
|
|
5557
|
-
userSelect: "none"
|
|
5558
|
-
}
|
|
5559
|
-
});
|
|
5560
|
-
},
|
|
5561
|
-
getSegmentProps() {
|
|
5562
|
-
return normalize.svg({
|
|
5563
|
-
...parts.segment.attrs,
|
|
5564
|
-
style: {
|
|
5565
|
-
position: "absolute",
|
|
5566
|
-
top: 0,
|
|
5567
|
-
left: 0,
|
|
5568
|
-
width: "100%",
|
|
5569
|
-
height: "100%",
|
|
5570
|
-
pointerEvents: "none",
|
|
5571
|
-
fill: state.context.drawing.fill
|
|
5572
|
-
}
|
|
5573
|
-
});
|
|
5574
|
-
},
|
|
5575
|
-
getSegmentPathProps(props2) {
|
|
5576
|
-
return normalize.path({
|
|
5577
|
-
...parts.segmentPath.attrs,
|
|
5578
|
-
d: props2.path
|
|
5579
|
-
});
|
|
5580
|
-
},
|
|
5581
|
-
getGuideProps() {
|
|
5582
|
-
return normalize.element({
|
|
5583
|
-
...parts.guide.attrs,
|
|
5584
|
-
"data-disabled": domQuery.dataAttr(disabled)
|
|
5585
|
-
});
|
|
5586
|
-
},
|
|
5587
|
-
getClearTriggerProps() {
|
|
5588
|
-
return normalize.button({
|
|
5589
|
-
...parts.clearTrigger.attrs,
|
|
5590
|
-
type: "button",
|
|
5591
|
-
"aria-label": "Clear Signature",
|
|
5592
|
-
hidden: !state.context.paths.length || drawing,
|
|
5593
|
-
disabled,
|
|
5594
|
-
onClick() {
|
|
5595
|
-
send({ type: "CLEAR" });
|
|
5596
|
-
}
|
|
5597
|
-
});
|
|
5598
|
-
},
|
|
5599
|
-
getHiddenInputProps(props2) {
|
|
5600
|
-
return normalize.input({
|
|
5601
|
-
type: "text",
|
|
5602
|
-
hidden: true,
|
|
5603
|
-
disabled,
|
|
5604
|
-
name: state.context.name,
|
|
5605
|
-
value: props2.value
|
|
5606
|
-
});
|
|
5607
|
-
}
|
|
5608
|
-
};
|
|
5609
|
-
}
|
|
5610
|
-
|
|
5611
|
-
// src/get-svg-path.ts
|
|
5612
|
-
var average = (a, b) => (a + b) / 2;
|
|
5613
|
-
function getSvgPathFromStroke(points, closed = true) {
|
|
5614
|
-
const len = points.length;
|
|
5615
|
-
if (len < 4) {
|
|
5616
|
-
return "";
|
|
5617
|
-
}
|
|
5618
|
-
let a = points[0];
|
|
5619
|
-
let b = points[1];
|
|
5620
|
-
const c = points[2];
|
|
5621
|
-
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(
|
|
5622
|
-
b[1],
|
|
5623
|
-
c[1]
|
|
5624
|
-
).toFixed(2)} T`;
|
|
5625
|
-
for (let i = 2, max = len - 1; i < max; i++) {
|
|
5626
|
-
a = points[i];
|
|
5627
|
-
b = points[i + 1];
|
|
5628
|
-
result += `${average(a[0], b[0]).toFixed(2)},${average(a[1], b[1]).toFixed(2)} `;
|
|
5629
|
-
}
|
|
5630
|
-
if (closed) {
|
|
5631
|
-
result += "Z";
|
|
5632
|
-
}
|
|
5633
|
-
return result;
|
|
5634
|
-
}
|
|
5635
|
-
|
|
5636
|
-
// src/signature-pad.machine.ts
|
|
5637
|
-
function machine(userContext) {
|
|
5638
|
-
const ctx = compact(userContext);
|
|
5639
|
-
return createMachine(
|
|
5640
|
-
{
|
|
5641
|
-
id: "signature-pad",
|
|
5642
|
-
initial: "idle",
|
|
5643
|
-
context: {
|
|
5644
|
-
readOnly: false,
|
|
5645
|
-
disabled: false,
|
|
5646
|
-
...ctx,
|
|
5647
|
-
paths: [],
|
|
5648
|
-
currentPoints: [],
|
|
5649
|
-
currentPath: null,
|
|
5650
|
-
drawing: {
|
|
5651
|
-
size: 2,
|
|
5652
|
-
simulatePressure: false,
|
|
5653
|
-
thinning: 0.7,
|
|
5654
|
-
smoothing: 0.4,
|
|
5655
|
-
streamline: 0.6,
|
|
5656
|
-
...ctx.drawing
|
|
5657
|
-
}
|
|
5658
|
-
},
|
|
5659
|
-
computed: {
|
|
5660
|
-
isInteractive: (ctx2) => !(ctx2.disabled || ctx2.readOnly),
|
|
5661
|
-
isEmpty: (ctx2) => ctx2.paths.length === 0
|
|
5662
|
-
},
|
|
5663
|
-
on: {
|
|
5664
|
-
CLEAR: {
|
|
5665
|
-
actions: ["clearPoints", "invokeOnDrawEnd", "focusCanvasEl"]
|
|
5666
|
-
}
|
|
5667
|
-
},
|
|
5668
|
-
states: {
|
|
5669
|
-
idle: {
|
|
5670
|
-
on: {
|
|
5671
|
-
POINTER_DOWN: {
|
|
5672
|
-
target: "drawing",
|
|
5673
|
-
actions: ["addPoint"]
|
|
5674
|
-
}
|
|
5675
|
-
}
|
|
5676
|
-
},
|
|
5677
|
-
drawing: {
|
|
5678
|
-
activities: ["trackPointerMove"],
|
|
5679
|
-
on: {
|
|
5680
|
-
POINTER_MOVE: {
|
|
5681
|
-
actions: ["addPoint", "invokeOnDraw"]
|
|
5682
|
-
},
|
|
5683
|
-
POINTER_UP: {
|
|
5684
|
-
target: "idle",
|
|
5685
|
-
actions: ["endStroke", "invokeOnDrawEnd"]
|
|
5686
|
-
}
|
|
5687
|
-
}
|
|
5688
|
-
}
|
|
5689
|
-
}
|
|
5690
|
-
},
|
|
5691
|
-
{
|
|
5692
|
-
activities: {
|
|
5693
|
-
trackPointerMove(ctx2, _evt, { send }) {
|
|
5694
|
-
const doc = dom.getDoc(ctx2);
|
|
5695
|
-
return trackPointerMove(doc, {
|
|
5696
|
-
onPointerMove({ event, point }) {
|
|
5697
|
-
const { offset } = getRelativePoint(point, dom.getControlEl(ctx2));
|
|
5698
|
-
send({ type: "POINTER_MOVE", point: offset, pressure: event.pressure });
|
|
5699
|
-
},
|
|
5700
|
-
onPointerUp() {
|
|
5701
|
-
send({ type: "POINTER_UP" });
|
|
5702
|
-
}
|
|
5703
|
-
});
|
|
5704
|
-
}
|
|
5705
|
-
},
|
|
5706
|
-
actions: {
|
|
5707
|
-
addPoint(ctx2, evt) {
|
|
5708
|
-
ctx2.currentPoints.push(evt.point);
|
|
5709
|
-
const stroke = _e(ctx2.currentPoints, ctx2.drawing);
|
|
5710
|
-
ctx2.currentPath = getSvgPathFromStroke(stroke);
|
|
5711
|
-
},
|
|
5712
|
-
endStroke(ctx2) {
|
|
5713
|
-
ctx2.paths.push(ctx2.currentPath);
|
|
5714
|
-
ctx2.currentPoints = [];
|
|
5715
|
-
ctx2.currentPath = null;
|
|
5716
|
-
},
|
|
5717
|
-
clearPoints(ctx2) {
|
|
5718
|
-
ctx2.currentPoints = [];
|
|
5719
|
-
ctx2.paths = [];
|
|
5720
|
-
},
|
|
5721
|
-
focusCanvasEl(ctx2) {
|
|
5722
|
-
queueMicrotask(() => {
|
|
5723
|
-
dom.getControlEl(ctx2)?.focus({ preventScroll: true });
|
|
5724
|
-
});
|
|
5725
|
-
},
|
|
5726
|
-
invokeOnDraw(ctx2) {
|
|
5727
|
-
ctx2.onDraw?.({
|
|
5728
|
-
paths: [...ctx2.paths, ctx2.currentPath]
|
|
5729
|
-
});
|
|
5730
|
-
},
|
|
5731
|
-
invokeOnDrawEnd(ctx2) {
|
|
5732
|
-
ctx2.onDrawEnd?.({
|
|
5733
|
-
paths: [...ctx2.paths],
|
|
5734
|
-
getDataUrl(type, quality = 0.92) {
|
|
5735
|
-
return dom.getDataUrl(ctx2, { type, quality });
|
|
5736
|
-
}
|
|
5737
|
-
});
|
|
5738
|
-
}
|
|
5739
|
-
}
|
|
5740
|
-
}
|
|
5741
|
-
);
|
|
5742
|
-
}
|
|
5743
|
-
types.createProps()([
|
|
5744
|
-
"dir",
|
|
5745
|
-
"disabled",
|
|
5746
|
-
"getRootNode",
|
|
5747
|
-
"id",
|
|
5748
|
-
"ids",
|
|
5749
|
-
"onDraw",
|
|
5750
|
-
"onDrawEnd",
|
|
5751
|
-
"readOnly",
|
|
5752
|
-
"drawing",
|
|
5753
|
-
"name"
|
|
5754
|
-
]);
|
|
5755
4496
|
|
|
5756
4497
|
const useSignaturePad = props => {
|
|
5757
4498
|
const locale = useLocaleContext();
|
|
5758
4499
|
const environment = useEnvironmentContext();
|
|
5759
4500
|
const id = solidJs.createUniqueId();
|
|
4501
|
+
const field = useFieldContext();
|
|
5760
4502
|
const context = solidJs.createMemo(() => ({
|
|
5761
4503
|
id,
|
|
4504
|
+
ids: {
|
|
4505
|
+
label: field?.().ids.label,
|
|
4506
|
+
hiddenInput: field?.().ids.control
|
|
4507
|
+
},
|
|
4508
|
+
disabled: field?.().disabled,
|
|
4509
|
+
readOnly: field?.().readOnly,
|
|
4510
|
+
required: field?.().required,
|
|
5762
4511
|
dir: locale().dir,
|
|
5763
4512
|
getRootNode: environment().getRootNode,
|
|
5764
4513
|
...props
|
|
5765
4514
|
}));
|
|
5766
|
-
const [state, send] = solid.useMachine(machine(context()), {
|
|
4515
|
+
const [state, send] = solid.useMachine(signaturePad__namespace.machine(context()), {
|
|
5767
4516
|
context
|
|
5768
4517
|
});
|
|
5769
|
-
return solidJs.createMemo(() => connect(state, send, solid.normalizeProps));
|
|
4518
|
+
return solidJs.createMemo(() => signaturePad__namespace.connect(state, send, solid.normalizeProps));
|
|
5770
4519
|
};
|
|
5771
4520
|
|
|
5772
4521
|
const SignaturePadRoot = props => {
|
|
5773
|
-
const [useSignaturePadProps, localProps] = createSplitProps()(props, ['id', 'ids', 'drawing', 'disabled', 'readOnly', 'name', 'onDraw', 'onDrawEnd']);
|
|
4522
|
+
const [useSignaturePadProps, localProps] = createSplitProps()(props, ['id', 'ids', 'drawing', 'disabled', 'readOnly', 'name', 'onDraw', 'onDrawEnd', 'readOnly', 'required', 'translations']);
|
|
5774
4523
|
const signaturePad = useSignaturePad(useSignaturePadProps);
|
|
5775
4524
|
const mergedProps = solid.mergeProps(() => signaturePad().getRootProps(), localProps);
|
|
5776
4525
|
return web.createComponent(SignaturePadProvider, {
|
|
@@ -5834,6 +4583,7 @@ var signaturePad = /*#__PURE__*/Object.freeze({
|
|
|
5834
4583
|
Context: SignaturePadContext,
|
|
5835
4584
|
Control: SignaturePadControl,
|
|
5836
4585
|
Guide: SignaturePadGuide,
|
|
4586
|
+
HiddenInput: SignaturePadHiddenInput,
|
|
5837
4587
|
Label: SignaturePadLabel,
|
|
5838
4588
|
Root: SignaturePadRoot,
|
|
5839
4589
|
RootProvider: SignaturePadRootProvider,
|
|
@@ -6064,7 +4814,12 @@ const SwitchControl = props => {
|
|
|
6064
4814
|
const SwitchHiddenInput = props => {
|
|
6065
4815
|
const api = useSwitchContext();
|
|
6066
4816
|
const mergedProps = solid.mergeProps(() => api().getHiddenInputProps(), props);
|
|
6067
|
-
|
|
4817
|
+
const field = useFieldContext();
|
|
4818
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
4819
|
+
get ["aria-describedby"]() {
|
|
4820
|
+
return field?.().ariaDescribedby;
|
|
4821
|
+
}
|
|
4822
|
+
}, mergedProps));
|
|
6068
4823
|
};
|
|
6069
4824
|
|
|
6070
4825
|
const SwitchLabel = props => {
|
|
@@ -6077,8 +4832,17 @@ const useSwitch = props => {
|
|
|
6077
4832
|
const locale = useLocaleContext();
|
|
6078
4833
|
const environment = useEnvironmentContext();
|
|
6079
4834
|
const id = solidJs.createUniqueId();
|
|
4835
|
+
const field = useFieldContext();
|
|
6080
4836
|
const context = solidJs.createMemo(() => ({
|
|
6081
4837
|
id,
|
|
4838
|
+
ids: {
|
|
4839
|
+
label: field?.().ids.label,
|
|
4840
|
+
hiddenInput: field?.().ids.control
|
|
4841
|
+
},
|
|
4842
|
+
disabled: field?.().disabled,
|
|
4843
|
+
readOnly: field?.().readOnly,
|
|
4844
|
+
invalid: field?.().invalid,
|
|
4845
|
+
required: field?.().required,
|
|
6082
4846
|
dir: locale().dir,
|
|
6083
4847
|
getRootNode: environment().getRootNode,
|
|
6084
4848
|
checked: props.defaultChecked,
|
|
@@ -6269,7 +5033,12 @@ const TagsInputControl = props => {
|
|
|
6269
5033
|
const TagsInputHiddenInput = props => {
|
|
6270
5034
|
const tagsInput = useTagsInputContext();
|
|
6271
5035
|
const mergedProps = solid.mergeProps(() => tagsInput().getHiddenInputProps(), props);
|
|
6272
|
-
|
|
5036
|
+
const field = useFieldContext();
|
|
5037
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
5038
|
+
get ["aria-describedby"]() {
|
|
5039
|
+
return field?.().ariaDescribedby;
|
|
5040
|
+
}
|
|
5041
|
+
}, mergedProps));
|
|
6273
5042
|
};
|
|
6274
5043
|
|
|
6275
5044
|
const TagsInputInput = props => {
|
|
@@ -6346,9 +5115,18 @@ const useTagsInput = props => {
|
|
|
6346
5115
|
const locale = useLocaleContext();
|
|
6347
5116
|
const environment = useEnvironmentContext();
|
|
6348
5117
|
const id = solidJs.createUniqueId();
|
|
5118
|
+
const field = useFieldContext();
|
|
6349
5119
|
const context = solidJs.createMemo(() => ({
|
|
6350
5120
|
id,
|
|
5121
|
+
ids: {
|
|
5122
|
+
label: field?.().ids.label,
|
|
5123
|
+
hiddenInput: field?.().ids.control
|
|
5124
|
+
},
|
|
6351
5125
|
dir: locale().dir,
|
|
5126
|
+
disabled: field?.().disabled,
|
|
5127
|
+
invalid: field?.().invalid,
|
|
5128
|
+
readOnly: field?.().readOnly,
|
|
5129
|
+
required: field?.().required,
|
|
6352
5130
|
getRootNode: environment().getRootNode,
|
|
6353
5131
|
value: props.defaultValue,
|
|
6354
5132
|
...props
|
|
@@ -6360,7 +5138,7 @@ const useTagsInput = props => {
|
|
|
6360
5138
|
};
|
|
6361
5139
|
|
|
6362
5140
|
const TagsInputRoot = props => {
|
|
6363
|
-
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']);
|
|
5141
|
+
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']);
|
|
6364
5142
|
const api = useTagsInput(useTagsInputProps);
|
|
6365
5143
|
const mergedProps = solid.mergeProps(() => api().getRootProps(), localProps);
|
|
6366
5144
|
return web.createComponent(TagsInputProvider, {
|
|
@@ -6566,7 +5344,8 @@ var toggleGroup = /*#__PURE__*/Object.freeze({
|
|
|
6566
5344
|
__proto__: null,
|
|
6567
5345
|
Context: ToggleGroupContext,
|
|
6568
5346
|
Item: ToggleGroupItem,
|
|
6569
|
-
Root: ToggleGroupRoot
|
|
5347
|
+
Root: ToggleGroupRoot,
|
|
5348
|
+
RootProvider: ToggleGroupRootProvider
|
|
6570
5349
|
});
|
|
6571
5350
|
|
|
6572
5351
|
const [TooltipProvider, useTooltipContext] = createContext({
|
|
@@ -6636,7 +5415,7 @@ const useTooltip = props => {
|
|
|
6636
5415
|
|
|
6637
5416
|
const TooltipRoot = props => {
|
|
6638
5417
|
const [presenceProps, tooltipProps] = splitPresenceProps(props);
|
|
6639
|
-
const [useTooltipProps, localProps] = createSplitProps()(tooltipProps, ['aria-label', 'closeDelay', 'closeOnEscape', 'closeOnPointerDown', 'defaultOpen', 'disabled', 'id', 'ids', 'interactive', 'onOpenChange', 'open', 'openDelay', 'positioning']);
|
|
5418
|
+
const [useTooltipProps, localProps] = createSplitProps()(tooltipProps, ['aria-label', 'closeDelay', 'closeOnEscape', 'closeOnPointerDown', 'closeOnScroll', 'defaultOpen', 'disabled', 'id', 'ids', 'interactive', 'onOpenChange', 'open', 'openDelay', 'positioning']);
|
|
6640
5419
|
const api = useTooltip(useTooltipProps);
|
|
6641
5420
|
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
6642
5421
|
present: api().open
|
|
@@ -6949,8 +5728,10 @@ exports.ColorPickerAreaBackground = ColorPickerAreaBackground;
|
|
|
6949
5728
|
exports.ColorPickerAreaThumb = ColorPickerAreaThumb;
|
|
6950
5729
|
exports.ColorPickerChannelInput = ColorPickerChannelInput;
|
|
6951
5730
|
exports.ColorPickerChannelSlider = ColorPickerChannelSlider;
|
|
5731
|
+
exports.ColorPickerChannelSliderLabel = ColorPickerChannelSliderLabel;
|
|
6952
5732
|
exports.ColorPickerChannelSliderThumb = ColorPickerChannelSliderThumb;
|
|
6953
5733
|
exports.ColorPickerChannelSliderTrack = ColorPickerChannelSliderTrack;
|
|
5734
|
+
exports.ColorPickerChannelSliderValueText = ColorPickerChannelSliderValueText;
|
|
6954
5735
|
exports.ColorPickerContent = ColorPickerContent;
|
|
6955
5736
|
exports.ColorPickerContext = ColorPickerContext;
|
|
6956
5737
|
exports.ColorPickerControl = ColorPickerControl;
|
|
@@ -6968,6 +5749,7 @@ exports.ColorPickerSwatchIndicator = ColorPickerSwatchIndicator;
|
|
|
6968
5749
|
exports.ColorPickerSwatchTrigger = ColorPickerSwatchTrigger;
|
|
6969
5750
|
exports.ColorPickerTransparencyGrid = ColorPickerTransparencyGrid;
|
|
6970
5751
|
exports.ColorPickerTrigger = ColorPickerTrigger;
|
|
5752
|
+
exports.ColorPickerValueSwatch = ColorPickerValueSwatch;
|
|
6971
5753
|
exports.ColorPickerValueText = ColorPickerValueText;
|
|
6972
5754
|
exports.ColorPickerView = ColorPickerView;
|
|
6973
5755
|
exports.Combobox = combobox;
|
|
@@ -7039,6 +5821,16 @@ exports.EditableRoot = EditableRoot;
|
|
|
7039
5821
|
exports.EditableRootProvider = EditableRootProvider;
|
|
7040
5822
|
exports.EditableSubmitTrigger = EditableSubmitTrigger;
|
|
7041
5823
|
exports.EnvironmentProvider = EnvironmentProvider;
|
|
5824
|
+
exports.Field = field;
|
|
5825
|
+
exports.FieldContext = FieldContext;
|
|
5826
|
+
exports.FieldErrorText = FieldErrorText;
|
|
5827
|
+
exports.FieldHelperText = FieldHelperText;
|
|
5828
|
+
exports.FieldInput = FieldInput;
|
|
5829
|
+
exports.FieldLabel = FieldLabel;
|
|
5830
|
+
exports.FieldRoot = FieldRoot;
|
|
5831
|
+
exports.FieldRootProvider = FieldRootProvider;
|
|
5832
|
+
exports.FieldSelect = FieldSelect;
|
|
5833
|
+
exports.FieldTextarea = FieldTextarea;
|
|
7042
5834
|
exports.FileUpload = fileUpload;
|
|
7043
5835
|
exports.FileUploadContext = FileUploadContext;
|
|
7044
5836
|
exports.FileUploadDropzone = FileUploadDropzone;
|
|
@@ -7206,6 +5998,7 @@ exports.SignaturePadClearTrigger = SignaturePadClearTrigger;
|
|
|
7206
5998
|
exports.SignaturePadContext = SignaturePadContext;
|
|
7207
5999
|
exports.SignaturePadControl = SignaturePadControl;
|
|
7208
6000
|
exports.SignaturePadGuide = SignaturePadGuide;
|
|
6001
|
+
exports.SignaturePadHiddenInput = SignaturePadHiddenInput;
|
|
7209
6002
|
exports.SignaturePadLabel = SignaturePadLabel;
|
|
7210
6003
|
exports.SignaturePadRoot = SignaturePadRoot;
|
|
7211
6004
|
exports.SignaturePadRootProvider = SignaturePadRootProvider;
|
|
@@ -7328,6 +6121,7 @@ exports.useDialogContext = useDialogContext;
|
|
|
7328
6121
|
exports.useEditable = useEditable;
|
|
7329
6122
|
exports.useEditableContext = useEditableContext;
|
|
7330
6123
|
exports.useEnvironmentContext = useEnvironmentContext;
|
|
6124
|
+
exports.useFieldContext = useFieldContext;
|
|
7331
6125
|
exports.useFileUpload = useFileUpload;
|
|
7332
6126
|
exports.useFileUploadContext = useFileUploadContext;
|
|
7333
6127
|
exports.useHoverCard = useHoverCard;
|