@ark-ui/solid 3.3.0 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -7
- package/dist/cjs/index.js +533 -1733
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +507 -1723
- package/dist/esm/index.js.map +1 -1
- package/dist/source/components/accordion/accordion.js +2 -2
- package/dist/source/components/accordion/index.js +7 -7
- package/dist/source/components/avatar/avatar.js +2 -2
- package/dist/source/components/avatar/index.js +5 -5
- package/dist/source/components/carousel/carousel.js +2 -2
- package/dist/source/components/carousel/index.js +10 -10
- package/dist/source/components/checkbox/checkbox-group.jsx +2 -1
- package/dist/source/components/checkbox/checkbox-hidden-input.jsx +3 -1
- package/dist/source/components/checkbox/checkbox.js +3 -3
- package/dist/source/components/checkbox/index.js +8 -8
- package/dist/source/components/checkbox/use-checkbox-group.js +2 -0
- package/dist/source/components/checkbox/use-checkbox.js +10 -0
- package/dist/source/components/clipboard/clipboard.js +3 -3
- package/dist/source/components/clipboard/index.js +8 -8
- package/dist/source/components/collapsible/collapsible.js +1 -1
- package/dist/source/components/collapsible/index.js +4 -4
- package/dist/source/components/color-picker/color-picker-channel-slider-label.jsx +10 -0
- package/dist/source/components/color-picker/color-picker-channel-slider-thumb.jsx +4 -1
- package/dist/source/components/color-picker/color-picker-channel-slider-track.jsx +4 -1
- package/dist/source/components/color-picker/color-picker-channel-slider-value-text.jsx +15 -0
- package/dist/source/components/color-picker/color-picker-channel-slider.jsx +4 -1
- package/dist/source/components/color-picker/color-picker-hidden-input.jsx +3 -1
- package/dist/source/components/color-picker/color-picker-root.jsx +1 -0
- package/dist/source/components/color-picker/color-picker-value-swatch.jsx +20 -0
- package/dist/source/components/color-picker/color-picker-view.jsx +9 -4
- package/dist/source/components/color-picker/color-picker.js +5 -1
- package/dist/source/components/color-picker/index.js +15 -12
- package/dist/source/components/color-picker/use-color-picker-format-context.js +6 -0
- package/dist/source/components/color-picker/use-color-picker.js +9 -0
- package/dist/source/components/combobox/combobox-input.jsx +3 -1
- package/dist/source/components/combobox/combobox-root.jsx +1 -0
- package/dist/source/components/combobox/combobox.js +5 -5
- package/dist/source/components/combobox/index.js +16 -16
- package/dist/source/components/combobox/use-combobox.js +11 -1
- package/dist/source/components/date-picker/date-picker-month-select.jsx +4 -3
- package/dist/source/components/date-picker/date-picker-year-select.jsx +4 -1
- package/dist/source/components/date-picker/date-picker.js +2 -2
- package/dist/source/components/date-picker/index.js +22 -22
- package/dist/source/components/dialog/dialog.js +4 -4
- package/dist/source/components/dialog/index.js +10 -10
- package/dist/source/components/editable/editable-input.jsx +3 -1
- package/dist/source/components/editable/editable-root.jsx +1 -0
- package/dist/source/components/editable/editable.js +4 -4
- package/dist/source/components/editable/index.js +11 -11
- package/dist/source/components/editable/use-editable.js +10 -0
- package/dist/source/components/field/field-context.jsx +2 -0
- package/dist/source/components/field/field-error-text.jsx +11 -0
- package/dist/source/components/field/field-helper-text.jsx +8 -0
- package/dist/source/components/field/field-input.jsx +8 -0
- package/dist/source/components/field/field-label.jsx +8 -0
- package/dist/source/components/field/field-root-provider.jsx +11 -0
- package/dist/source/components/field/field-root.jsx +19 -0
- package/dist/source/components/field/field-select.jsx +8 -0
- package/dist/source/components/field/field-textarea.jsx +8 -0
- package/dist/source/components/field/field.js +9 -0
- package/dist/source/components/field/index.js +11 -0
- package/dist/source/components/field/use-field-context.js +6 -0
- package/dist/source/components/field/use-field.js +105 -0
- package/dist/source/components/file-upload/file-upload-hidden-input.jsx +3 -1
- package/dist/source/components/file-upload/file-upload-root.jsx +1 -0
- package/dist/source/components/file-upload/file-upload.js +2 -2
- package/dist/source/components/file-upload/index.js +10 -10
- package/dist/source/components/file-upload/use-file-upload.js +8 -0
- package/dist/source/components/format/format.js +2 -2
- package/dist/source/components/format/index.js +2 -2
- package/dist/source/components/hover-card/hover-card.js +2 -2
- package/dist/source/components/hover-card/index.js +8 -8
- package/dist/source/components/index.js +1 -0
- package/dist/source/components/menu/index.js +21 -21
- package/dist/source/components/menu/menu-checkbox-item.jsx +2 -2
- package/dist/source/components/menu/menu-radio-item.jsx +2 -2
- package/dist/source/components/menu/menu.js +7 -7
- package/dist/source/components/number-input/index.js +6 -6
- package/dist/source/components/number-input/number-input-input.jsx +3 -1
- package/dist/source/components/number-input/number-input-root.jsx +1 -0
- package/dist/source/components/number-input/number-input.js +1 -0
- package/dist/source/components/number-input/use-number-input.js +10 -0
- package/dist/source/components/pagination/index.js +6 -6
- package/dist/source/components/pagination/pagination.js +2 -2
- package/dist/source/components/pin-input/index.js +7 -7
- package/dist/source/components/pin-input/pin-input-hidden-input.jsx +3 -1
- package/dist/source/components/pin-input/pin-input-root.jsx +2 -0
- package/dist/source/components/pin-input/pin-input.js +3 -3
- package/dist/source/components/pin-input/use-pin-input.js +10 -0
- package/dist/source/components/popover/index.js +13 -13
- package/dist/source/components/popover/popover.js +4 -4
- package/dist/source/components/progress/index.js +11 -11
- package/dist/source/components/progress/progress.js +5 -5
- package/dist/source/components/qr-code/index.js +6 -6
- package/dist/source/components/qr-code/qr-code.js +2 -2
- package/dist/source/components/radio-group/index.js +8 -8
- package/dist/source/components/radio-group/radio-group.js +2 -2
- package/dist/source/components/rating-group/index.js +5 -5
- package/dist/source/components/rating-group/rating-group-hidden-input.jsx +3 -1
- package/dist/source/components/rating-group/rating-group-root.jsx +1 -0
- package/dist/source/components/rating-group/rating-group.js +1 -0
- package/dist/source/components/rating-group/use-rating-group.js +9 -0
- package/dist/source/components/segment-group/index.js +6 -6
- package/dist/source/components/segment-group/segment-group.js +1 -0
- package/dist/source/components/select/index.js +19 -19
- package/dist/source/components/select/select-hidden-select.jsx +4 -2
- package/dist/source/components/select/select-root.jsx +1 -0
- package/dist/source/components/select/select.js +7 -7
- package/dist/source/components/select/use-select.js +11 -1
- package/dist/source/components/signature-pad/index.js +7 -6
- package/dist/source/components/signature-pad/signature-pad-control.jsx +1 -1
- package/dist/source/components/signature-pad/signature-pad-hidden-input.jsx +12 -0
- package/dist/source/components/signature-pad/signature-pad-root.jsx +3 -0
- package/dist/source/components/signature-pad/signature-pad.js +1 -0
- package/dist/source/components/signature-pad/use-signature-pad.js +9 -0
- package/dist/source/components/slider/index.js +12 -12
- package/dist/source/components/slider/slider.js +7 -7
- package/dist/source/components/splitter/index.js +5 -5
- package/dist/source/components/splitter/splitter.js +2 -2
- package/dist/source/components/switch/index.js +7 -7
- package/dist/source/components/switch/switch-hidden-input.jsx +3 -1
- package/dist/source/components/switch/switch.js +4 -4
- package/dist/source/components/switch/use-switch.js +10 -0
- package/dist/source/components/tabs/index.js +7 -7
- package/dist/source/components/tabs/tabs.js +4 -4
- package/dist/source/components/tags-input/index.js +13 -13
- package/dist/source/components/tags-input/tags-input-hidden-input.jsx +3 -1
- package/dist/source/components/tags-input/tags-input-root.jsx +1 -0
- package/dist/source/components/tags-input/tags-input.js +4 -4
- package/dist/source/components/tags-input/use-tags-input.js +10 -0
- package/dist/source/components/toast/index.js +8 -8
- package/dist/source/components/toast/toast.js +6 -7
- package/dist/source/components/toggle-group/index.js +3 -3
- package/dist/source/components/toggle-group/toggle-group.js +1 -0
- package/dist/source/components/tooltip/index.js +8 -8
- package/dist/source/components/tooltip/tooltip-root.jsx +1 -0
- package/dist/source/components/tooltip/tooltip.js +2 -2
- package/dist/source/components/tree-view/index.js +14 -14
- package/dist/source/components/tree-view/tree-view.js +4 -4
- package/dist/types/components/accordion/accordion-item-content.d.ts +4 -2
- package/dist/types/components/accordion/accordion-item-indicator.d.ts +4 -2
- package/dist/types/components/accordion/accordion-item-trigger.d.ts +4 -2
- package/dist/types/components/accordion/accordion-item.d.ts +4 -3
- package/dist/types/components/accordion/accordion-root-provider.d.ts +4 -2
- package/dist/types/components/accordion/accordion-root.d.ts +4 -3
- package/dist/types/components/accordion/accordion.d.ts +6 -6
- package/dist/types/components/accordion/index.d.ts +8 -8
- package/dist/types/components/avatar/avatar-fallback.d.ts +4 -2
- package/dist/types/components/avatar/avatar-image.d.ts +4 -2
- package/dist/types/components/avatar/avatar-root-provider.d.ts +4 -2
- package/dist/types/components/avatar/avatar-root.d.ts +4 -3
- package/dist/types/components/avatar/avatar.d.ts +4 -4
- package/dist/types/components/avatar/index.d.ts +5 -5
- package/dist/types/components/carousel/carousel-control.d.ts +4 -2
- package/dist/types/components/carousel/carousel-indicator-group.d.ts +4 -2
- package/dist/types/components/carousel/carousel-indicator.d.ts +4 -3
- package/dist/types/components/carousel/carousel-item-group.d.ts +4 -2
- package/dist/types/components/carousel/carousel-item.d.ts +4 -3
- package/dist/types/components/carousel/carousel-next-trigger.d.ts +4 -2
- package/dist/types/components/carousel/carousel-prev-trigger.d.ts +4 -2
- package/dist/types/components/carousel/carousel-root-provider.d.ts +4 -2
- package/dist/types/components/carousel/carousel-root.d.ts +4 -3
- package/dist/types/components/carousel/carousel-viewport.d.ts +4 -2
- package/dist/types/components/carousel/carousel.d.ts +10 -10
- package/dist/types/components/carousel/index.d.ts +11 -11
- package/dist/types/components/checkbox/checkbox-control.d.ts +4 -2
- package/dist/types/components/checkbox/checkbox-group.d.ts +4 -3
- package/dist/types/components/checkbox/checkbox-hidden-input.d.ts +4 -2
- package/dist/types/components/checkbox/checkbox-indicator.d.ts +4 -3
- package/dist/types/components/checkbox/checkbox-label.d.ts +4 -2
- package/dist/types/components/checkbox/checkbox-root-provider.d.ts +4 -2
- package/dist/types/components/checkbox/checkbox-root.d.ts +4 -3
- package/dist/types/components/checkbox/checkbox.d.ts +7 -7
- package/dist/types/components/checkbox/index.d.ts +8 -8
- package/dist/types/components/checkbox/use-checkbox-group.d.ts +7 -0
- package/dist/types/components/clipboard/clipboard-control.d.ts +4 -2
- package/dist/types/components/clipboard/clipboard-indicator.d.ts +4 -3
- package/dist/types/components/clipboard/clipboard-input.d.ts +4 -2
- package/dist/types/components/clipboard/clipboard-label.d.ts +4 -2
- package/dist/types/components/clipboard/clipboard-root-provider.d.ts +4 -2
- package/dist/types/components/clipboard/clipboard-root.d.ts +4 -3
- package/dist/types/components/clipboard/clipboard-trigger.d.ts +4 -2
- package/dist/types/components/clipboard/clipboard.d.ts +7 -7
- package/dist/types/components/clipboard/index.d.ts +8 -8
- package/dist/types/components/collapsible/collapsible-content.d.ts +4 -2
- package/dist/types/components/collapsible/collapsible-root-provider.d.ts +4 -2
- package/dist/types/components/collapsible/collapsible-root.d.ts +4 -3
- package/dist/types/components/collapsible/collapsible-trigger.d.ts +4 -2
- package/dist/types/components/collapsible/collapsible.d.ts +4 -4
- package/dist/types/components/collapsible/index.d.ts +5 -5
- package/dist/types/components/color-picker/color-picker-area-background.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-area-thumb.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-area.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker-channel-input.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker-channel-slider-label.d.ts +6 -0
- package/dist/types/components/color-picker/color-picker-channel-slider-thumb.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-channel-slider-track.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-channel-slider-value-text.d.ts +6 -0
- package/dist/types/components/color-picker/color-picker-channel-slider.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker-content.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-control.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-eye-dropper-trigger.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-format-select.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-format-trigger.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-hidden-input.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-label.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-positioner.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-root-provider.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-root.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker-swatch-group.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-swatch-indicator.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-swatch-trigger.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-swatch.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker-transparency-grid.d.ts +4 -3
- package/dist/types/components/color-picker/color-picker-trigger.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-value-swatch.d.ts +10 -0
- package/dist/types/components/color-picker/color-picker-value-text.d.ts +4 -2
- package/dist/types/components/color-picker/color-picker-view.d.ts +7 -2
- package/dist/types/components/color-picker/color-picker.d.ts +28 -24
- package/dist/types/components/color-picker/index.d.ts +29 -26
- package/dist/types/components/color-picker/use-color-picker-format-context.d.ts +5 -0
- package/dist/types/components/combobox/combobox-clear-trigger.d.ts +4 -2
- package/dist/types/components/combobox/combobox-content.d.ts +4 -2
- package/dist/types/components/combobox/combobox-control.d.ts +4 -2
- package/dist/types/components/combobox/combobox-input.d.ts +4 -2
- package/dist/types/components/combobox/combobox-item-group-label.d.ts +4 -2
- package/dist/types/components/combobox/combobox-item-group.d.ts +4 -2
- package/dist/types/components/combobox/combobox-item-indicator.d.ts +4 -2
- package/dist/types/components/combobox/combobox-item-text.d.ts +4 -2
- package/dist/types/components/combobox/combobox-item.d.ts +4 -3
- package/dist/types/components/combobox/combobox-label.d.ts +4 -2
- package/dist/types/components/combobox/combobox-list.d.ts +4 -2
- package/dist/types/components/combobox/combobox-positioner.d.ts +4 -2
- package/dist/types/components/combobox/combobox-root-provider.d.ts +4 -2
- package/dist/types/components/combobox/combobox-root.d.ts +5 -3
- package/dist/types/components/combobox/combobox-trigger.d.ts +4 -3
- package/dist/types/components/combobox/combobox.d.ts +15 -15
- package/dist/types/components/combobox/index.d.ts +17 -17
- package/dist/types/components/date-picker/date-picker-clear-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-content.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-control.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-input.d.ts +4 -3
- package/dist/types/components/date-picker/date-picker-label.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-month-select.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-next-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-positioner.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-preset-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-prev-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-range-text.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-root-provider.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-root.d.ts +4 -3
- package/dist/types/components/date-picker/date-picker-table-body.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-table-cell-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-table-cell.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-table-head.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-table-header.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-table-row.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-table.d.ts +4 -3
- package/dist/types/components/date-picker/date-picker-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-view-control.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-view-trigger.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker-view.d.ts +4 -3
- package/dist/types/components/date-picker/date-picker-year-select.d.ts +4 -2
- package/dist/types/components/date-picker/date-picker.d.ts +25 -25
- package/dist/types/components/date-picker/index.d.ts +26 -26
- package/dist/types/components/dialog/dialog-backdrop.d.ts +4 -2
- package/dist/types/components/dialog/dialog-close-trigger.d.ts +4 -2
- package/dist/types/components/dialog/dialog-content.d.ts +4 -2
- package/dist/types/components/dialog/dialog-description.d.ts +4 -2
- package/dist/types/components/dialog/dialog-positioner.d.ts +4 -2
- package/dist/types/components/dialog/dialog-root-provider.d.ts +4 -2
- package/dist/types/components/dialog/dialog-root.d.ts +2 -0
- package/dist/types/components/dialog/dialog-title.d.ts +4 -2
- package/dist/types/components/dialog/dialog-trigger.d.ts +4 -2
- package/dist/types/components/dialog/dialog.d.ts +9 -9
- package/dist/types/components/dialog/index.d.ts +10 -10
- package/dist/types/components/editable/editable-area.d.ts +4 -2
- package/dist/types/components/editable/editable-cancel-trigger.d.ts +4 -2
- package/dist/types/components/editable/editable-control.d.ts +4 -2
- package/dist/types/components/editable/editable-edit-trigger.d.ts +4 -2
- package/dist/types/components/editable/editable-input.d.ts +4 -2
- package/dist/types/components/editable/editable-label.d.ts +4 -2
- package/dist/types/components/editable/editable-preview.d.ts +4 -2
- package/dist/types/components/editable/editable-root-provider.d.ts +4 -2
- package/dist/types/components/editable/editable-root.d.ts +4 -3
- package/dist/types/components/editable/editable-submit-trigger.d.ts +4 -2
- package/dist/types/components/editable/editable.d.ts +10 -10
- package/dist/types/components/editable/index.d.ts +11 -11
- package/dist/types/components/factory.d.ts +7 -3
- package/dist/types/components/field/field-context.d.ts +6 -0
- package/dist/types/components/field/field-error-text.d.ts +6 -0
- package/dist/types/components/field/field-helper-text.d.ts +6 -0
- package/dist/types/components/field/field-input.d.ts +6 -0
- package/dist/types/components/field/field-label.d.ts +6 -0
- package/dist/types/components/field/field-root-provider.d.ts +11 -0
- package/dist/types/components/field/field-root.d.ts +7 -0
- package/dist/types/components/field/field-select.d.ts +6 -0
- package/dist/types/components/field/field-textarea.d.ts +6 -0
- package/dist/types/components/field/field.d.ts +9 -0
- package/dist/types/components/field/index.d.ts +11 -0
- package/dist/types/components/field/use-field-context.d.ts +4 -0
- package/dist/types/components/field/use-field.d.ts +102 -0
- package/dist/types/components/file-upload/file-upload-dropzone.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-hidden-input.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item-delete-trigger.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item-group.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item-name.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item-preview-image.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item-preview.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item-size-text.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-item.d.ts +4 -3
- package/dist/types/components/file-upload/file-upload-label.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-root-provider.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload-root.d.ts +4 -3
- package/dist/types/components/file-upload/file-upload-trigger.d.ts +4 -2
- package/dist/types/components/file-upload/file-upload.d.ts +13 -13
- package/dist/types/components/file-upload/index.d.ts +14 -14
- package/dist/types/components/format/format.d.ts +2 -2
- package/dist/types/components/format/index.d.ts +2 -2
- package/dist/types/components/hover-card/hover-card-arrow-tip.d.ts +4 -2
- package/dist/types/components/hover-card/hover-card-arrow.d.ts +4 -2
- package/dist/types/components/hover-card/hover-card-content.d.ts +4 -2
- package/dist/types/components/hover-card/hover-card-positioner.d.ts +4 -2
- package/dist/types/components/hover-card/hover-card-root-provider.d.ts +4 -2
- package/dist/types/components/hover-card/hover-card-root.d.ts +3 -1
- package/dist/types/components/hover-card/hover-card-trigger.d.ts +4 -2
- package/dist/types/components/hover-card/hover-card.d.ts +7 -7
- package/dist/types/components/hover-card/index.d.ts +8 -8
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/menu/index.d.ts +21 -21
- package/dist/types/components/menu/menu-arrow-tip.d.ts +4 -2
- package/dist/types/components/menu/menu-arrow.d.ts +4 -2
- package/dist/types/components/menu/menu-checkbox-item.d.ts +4 -3
- package/dist/types/components/menu/menu-content.d.ts +4 -2
- package/dist/types/components/menu/menu-context-trigger.d.ts +4 -2
- package/dist/types/components/menu/menu-indicator.d.ts +4 -2
- package/dist/types/components/menu/menu-item-group-label.d.ts +4 -2
- package/dist/types/components/menu/menu-item-group.d.ts +5 -3
- package/dist/types/components/menu/menu-item-indicator.d.ts +4 -2
- package/dist/types/components/menu/menu-item-text.d.ts +4 -2
- package/dist/types/components/menu/menu-item.d.ts +4 -3
- package/dist/types/components/menu/menu-positioner.d.ts +4 -2
- package/dist/types/components/menu/menu-radio-item-group.d.ts +5 -3
- package/dist/types/components/menu/menu-radio-item.d.ts +4 -3
- package/dist/types/components/menu/menu-root-provider.d.ts +4 -2
- package/dist/types/components/menu/menu-root.d.ts +3 -1
- package/dist/types/components/menu/menu-separator.d.ts +4 -2
- package/dist/types/components/menu/menu-trigger-item.d.ts +4 -2
- package/dist/types/components/menu/menu-trigger.d.ts +4 -2
- package/dist/types/components/menu/menu.d.ts +19 -19
- package/dist/types/components/number-input/index.d.ts +9 -9
- package/dist/types/components/number-input/number-input-control.d.ts +4 -2
- package/dist/types/components/number-input/number-input-decrement-trigger.d.ts +4 -2
- package/dist/types/components/number-input/number-input-increment-trigger.d.ts +4 -2
- package/dist/types/components/number-input/number-input-input.d.ts +4 -2
- package/dist/types/components/number-input/number-input-label.d.ts +4 -2
- package/dist/types/components/number-input/number-input-root-provider.d.ts +4 -2
- package/dist/types/components/number-input/number-input-root.d.ts +4 -2
- package/dist/types/components/number-input/number-input-scrubber.d.ts +4 -2
- package/dist/types/components/number-input/number-input.d.ts +8 -7
- package/dist/types/components/pagination/index.d.ts +7 -7
- package/dist/types/components/pagination/pagination-ellipsis.d.ts +4 -3
- package/dist/types/components/pagination/pagination-item.d.ts +4 -2
- package/dist/types/components/pagination/pagination-next-trigger.d.ts +4 -2
- package/dist/types/components/pagination/pagination-prev-trigger.d.ts +4 -2
- package/dist/types/components/pagination/pagination-root-provider.d.ts +4 -2
- package/dist/types/components/pagination/pagination-root.d.ts +4 -3
- package/dist/types/components/pagination/pagination.d.ts +6 -6
- package/dist/types/components/pin-input/index.d.ts +7 -7
- package/dist/types/components/pin-input/pin-input-control.d.ts +4 -2
- package/dist/types/components/pin-input/pin-input-hidden-input.d.ts +4 -2
- package/dist/types/components/pin-input/pin-input-input.d.ts +4 -3
- package/dist/types/components/pin-input/pin-input-label.d.ts +4 -2
- package/dist/types/components/pin-input/pin-input-root-provider.d.ts +4 -2
- package/dist/types/components/pin-input/pin-input-root.d.ts +4 -3
- package/dist/types/components/pin-input/pin-input.d.ts +6 -6
- package/dist/types/components/popover/index.d.ts +13 -13
- package/dist/types/components/popover/popover-anchor.d.ts +4 -2
- package/dist/types/components/popover/popover-arrow-tip.d.ts +4 -2
- package/dist/types/components/popover/popover-arrow.d.ts +4 -2
- package/dist/types/components/popover/popover-close-trigger.d.ts +4 -2
- package/dist/types/components/popover/popover-content.d.ts +4 -2
- package/dist/types/components/popover/popover-description.d.ts +4 -2
- package/dist/types/components/popover/popover-indicator.d.ts +4 -2
- package/dist/types/components/popover/popover-positioner.d.ts +4 -2
- package/dist/types/components/popover/popover-root-provider.d.ts +4 -2
- package/dist/types/components/popover/popover-root.d.ts +3 -1
- package/dist/types/components/popover/popover-title.d.ts +4 -2
- package/dist/types/components/popover/popover-trigger.d.ts +4 -2
- package/dist/types/components/popover/popover.d.ts +12 -12
- package/dist/types/components/presence/presence.d.ts +4 -3
- package/dist/types/components/progress/index.d.ts +11 -11
- package/dist/types/components/progress/progress-circle-range.d.ts +4 -2
- package/dist/types/components/progress/progress-circle-track.d.ts +4 -2
- package/dist/types/components/progress/progress-circle.d.ts +4 -2
- package/dist/types/components/progress/progress-label.d.ts +4 -2
- package/dist/types/components/progress/progress-range.d.ts +4 -2
- package/dist/types/components/progress/progress-root-provider.d.ts +4 -2
- package/dist/types/components/progress/progress-root.d.ts +4 -3
- package/dist/types/components/progress/progress-track.d.ts +4 -2
- package/dist/types/components/progress/progress-value-text.d.ts +4 -2
- package/dist/types/components/progress/progress-view.d.ts +4 -3
- package/dist/types/components/progress/progress.d.ts +10 -10
- package/dist/types/components/qr-code/index.d.ts +6 -6
- package/dist/types/components/qr-code/qr-code-frame.d.ts +4 -2
- package/dist/types/components/qr-code/qr-code-overlay.d.ts +4 -2
- package/dist/types/components/qr-code/qr-code-pattern.d.ts +4 -2
- package/dist/types/components/qr-code/qr-code-root-provider.d.ts +4 -2
- package/dist/types/components/qr-code/qr-code-root.d.ts +4 -3
- package/dist/types/components/qr-code/qr-code.d.ts +5 -5
- package/dist/types/components/radio-group/index.d.ts +10 -10
- package/dist/types/components/radio-group/radio-group-indicator.d.ts +4 -2
- package/dist/types/components/radio-group/radio-group-item-control.d.ts +4 -2
- package/dist/types/components/radio-group/radio-group-item-hidden-input.d.ts +4 -2
- package/dist/types/components/radio-group/radio-group-item-text.d.ts +4 -2
- package/dist/types/components/radio-group/radio-group-item.d.ts +4 -3
- package/dist/types/components/radio-group/radio-group-label.d.ts +4 -2
- package/dist/types/components/radio-group/radio-group-root-provider.d.ts +4 -2
- package/dist/types/components/radio-group/radio-group-root.d.ts +4 -3
- package/dist/types/components/radio-group/radio-group.d.ts +8 -8
- package/dist/types/components/rating-group/index.d.ts +7 -7
- package/dist/types/components/rating-group/rating-group-control.d.ts +4 -2
- package/dist/types/components/rating-group/rating-group-hidden-input.d.ts +4 -2
- package/dist/types/components/rating-group/rating-group-item.d.ts +4 -3
- package/dist/types/components/rating-group/rating-group-label.d.ts +4 -2
- package/dist/types/components/rating-group/rating-group-root-provider.d.ts +4 -2
- package/dist/types/components/rating-group/rating-group-root.d.ts +4 -3
- package/dist/types/components/rating-group/rating-group.d.ts +6 -5
- package/dist/types/components/segment-group/index.d.ts +9 -9
- package/dist/types/components/segment-group/segment-group-indicator.d.ts +4 -2
- package/dist/types/components/segment-group/segment-group-item-control.d.ts +4 -2
- package/dist/types/components/segment-group/segment-group-item-hidden-input.d.ts +4 -2
- package/dist/types/components/segment-group/segment-group-item-text.d.ts +4 -2
- package/dist/types/components/segment-group/segment-group-item.d.ts +4 -3
- package/dist/types/components/segment-group/segment-group-label.d.ts +4 -2
- package/dist/types/components/segment-group/segment-group-root-provider.d.ts +4 -2
- package/dist/types/components/segment-group/segment-group-root.d.ts +4 -3
- package/dist/types/components/segment-group/segment-group.d.ts +8 -7
- package/dist/types/components/select/index.d.ts +19 -19
- package/dist/types/components/select/select-clear-trigger.d.ts +4 -2
- package/dist/types/components/select/select-content.d.ts +4 -2
- package/dist/types/components/select/select-control.d.ts +4 -2
- package/dist/types/components/select/select-hidden-select.d.ts +4 -2
- package/dist/types/components/select/select-indicator.d.ts +4 -2
- package/dist/types/components/select/select-item-group-label.d.ts +4 -2
- package/dist/types/components/select/select-item-group.d.ts +4 -2
- package/dist/types/components/select/select-item-indicator.d.ts +4 -2
- package/dist/types/components/select/select-item-text.d.ts +4 -2
- package/dist/types/components/select/select-item.d.ts +4 -3
- package/dist/types/components/select/select-label.d.ts +4 -2
- package/dist/types/components/select/select-list.d.ts +4 -2
- package/dist/types/components/select/select-positioner.d.ts +4 -2
- package/dist/types/components/select/select-root-provider.d.ts +4 -2
- package/dist/types/components/select/select-root.d.ts +5 -3
- package/dist/types/components/select/select-trigger.d.ts +4 -2
- package/dist/types/components/select/select-value-text.d.ts +7 -2
- package/dist/types/components/select/select.d.ts +17 -17
- package/dist/types/components/signature-pad/index.d.ts +9 -8
- package/dist/types/components/signature-pad/signature-pad-clear-trigger.d.ts +4 -2
- package/dist/types/components/signature-pad/signature-pad-control.d.ts +4 -2
- package/dist/types/components/signature-pad/signature-pad-guide.d.ts +4 -2
- package/dist/types/components/signature-pad/signature-pad-hidden-input.d.ts +8 -0
- package/dist/types/components/signature-pad/signature-pad-label.d.ts +4 -2
- package/dist/types/components/signature-pad/signature-pad-root-provider.d.ts +4 -2
- package/dist/types/components/signature-pad/signature-pad-root.d.ts +4 -3
- package/dist/types/components/signature-pad/signature-pad-segment.d.ts +4 -2
- package/dist/types/components/signature-pad/signature-pad.d.ts +8 -7
- package/dist/types/components/slider/index.d.ts +12 -12
- package/dist/types/components/slider/slider-control.d.ts +4 -2
- package/dist/types/components/slider/slider-hidden-input.d.ts +4 -2
- package/dist/types/components/slider/slider-label.d.ts +4 -2
- package/dist/types/components/slider/slider-marker-group.d.ts +4 -2
- package/dist/types/components/slider/slider-marker.d.ts +4 -3
- package/dist/types/components/slider/slider-range.d.ts +4 -2
- package/dist/types/components/slider/slider-root-provider.d.ts +4 -2
- package/dist/types/components/slider/slider-root.d.ts +4 -2
- package/dist/types/components/slider/slider-thumb.d.ts +4 -3
- package/dist/types/components/slider/slider-track.d.ts +4 -2
- package/dist/types/components/slider/slider-value-text.d.ts +4 -2
- package/dist/types/components/slider/slider.d.ts +11 -11
- package/dist/types/components/splitter/index.d.ts +5 -5
- package/dist/types/components/splitter/splitter-panel.d.ts +4 -2
- package/dist/types/components/splitter/splitter-resize-trigger.d.ts +4 -2
- package/dist/types/components/splitter/splitter-root-provider.d.ts +4 -2
- package/dist/types/components/splitter/splitter-root.d.ts +4 -3
- package/dist/types/components/splitter/splitter.d.ts +4 -4
- package/dist/types/components/switch/index.d.ts +7 -7
- package/dist/types/components/switch/switch-control.d.ts +4 -2
- package/dist/types/components/switch/switch-hidden-input.d.ts +4 -2
- package/dist/types/components/switch/switch-label.d.ts +4 -2
- package/dist/types/components/switch/switch-root-provider.d.ts +4 -2
- package/dist/types/components/switch/switch-root.d.ts +4 -3
- package/dist/types/components/switch/switch-thumb.d.ts +4 -2
- package/dist/types/components/switch/switch.d.ts +6 -6
- package/dist/types/components/tabs/index.d.ts +7 -7
- package/dist/types/components/tabs/tab-content.d.ts +4 -3
- package/dist/types/components/tabs/tab-indicator.d.ts +4 -2
- package/dist/types/components/tabs/tab-list.d.ts +4 -2
- package/dist/types/components/tabs/tab-trigger.d.ts +4 -2
- package/dist/types/components/tabs/tabs-root-provider.d.ts +4 -2
- package/dist/types/components/tabs/tabs-root.d.ts +4 -3
- package/dist/types/components/tabs/tabs.d.ts +6 -6
- package/dist/types/components/tags-input/index.d.ts +14 -14
- package/dist/types/components/tags-input/tags-input-clear-trigger.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-control.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-hidden-input.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-input.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-item-delete-trigger.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-item-input.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-item-preview.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-item-text.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-item.d.ts +4 -3
- package/dist/types/components/tags-input/tags-input-label.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-root-provider.d.ts +4 -2
- package/dist/types/components/tags-input/tags-input-root.d.ts +4 -3
- package/dist/types/components/tags-input/tags-input.d.ts +12 -12
- package/dist/types/components/toast/index.d.ts +8 -8
- package/dist/types/components/toast/toast-action-trigger.d.ts +4 -2
- package/dist/types/components/toast/toast-close-trigger.d.ts +4 -2
- package/dist/types/components/toast/toast-description.d.ts +4 -2
- package/dist/types/components/toast/toast-root.d.ts +4 -2
- package/dist/types/components/toast/toast-title.d.ts +4 -2
- package/dist/types/components/toast/toast.d.ts +6 -8
- package/dist/types/components/toast/toaster.d.ts +4 -3
- package/dist/types/components/toggle-group/index.d.ts +4 -4
- package/dist/types/components/toggle-group/toggle-group-item.d.ts +4 -2
- package/dist/types/components/toggle-group/toggle-group-root-provider.d.ts +4 -2
- package/dist/types/components/toggle-group/toggle-group-root.d.ts +4 -3
- package/dist/types/components/toggle-group/toggle-group.d.ts +3 -2
- package/dist/types/components/tooltip/index.d.ts +8 -8
- package/dist/types/components/tooltip/tooltip-arrow-tip.d.ts +4 -2
- package/dist/types/components/tooltip/tooltip-arrow.d.ts +4 -2
- package/dist/types/components/tooltip/tooltip-content.d.ts +4 -2
- package/dist/types/components/tooltip/tooltip-positioner.d.ts +4 -2
- package/dist/types/components/tooltip/tooltip-root-provider.d.ts +4 -2
- package/dist/types/components/tooltip/tooltip-root.d.ts +3 -1
- package/dist/types/components/tooltip/tooltip-trigger.d.ts +4 -2
- package/dist/types/components/tooltip/tooltip.d.ts +7 -7
- package/dist/types/components/tree-view/index.d.ts +15 -15
- package/dist/types/components/tree-view/tree-view-branch-content.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-branch-control.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-branch-indicator.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-branch-text.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-branch-trigger.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-branch.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-item-indicator.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-item-text.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-item.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-label.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-root-provider.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view-root.d.ts +4 -3
- package/dist/types/components/tree-view/tree-view-tree.d.ts +4 -2
- package/dist/types/components/tree-view/tree-view.d.ts +13 -13
- package/package.json +50 -49
package/dist/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
|
}
|
|
@@ -697,6 +698,7 @@ function useCheckboxGroup(props = {}) {
|
|
|
697
698
|
toggleValue(itemProps.value);
|
|
698
699
|
}
|
|
699
700
|
},
|
|
701
|
+
name: props.name,
|
|
700
702
|
disabled: props.disabled,
|
|
701
703
|
readOnly: props.readOnly
|
|
702
704
|
};
|
|
@@ -704,6 +706,7 @@ function useCheckboxGroup(props = {}) {
|
|
|
704
706
|
return {
|
|
705
707
|
isChecked,
|
|
706
708
|
value,
|
|
709
|
+
name: props.name,
|
|
707
710
|
disabled: props.disabled,
|
|
708
711
|
readOnly: props.readOnly,
|
|
709
712
|
setValue,
|
|
@@ -721,20 +724,210 @@ const [CheckboxGroupContextProvider, useCheckboxGroupContext] = createContext({
|
|
|
721
724
|
});
|
|
722
725
|
|
|
723
726
|
const CheckboxGroup = props => {
|
|
724
|
-
const [checkboxGroupProps, localProps] = createSplitProps()(props, ['defaultValue', 'value', 'onValueChange', 'disabled', 'readOnly']);
|
|
727
|
+
const [checkboxGroupProps, localProps] = createSplitProps()(props, ['defaultValue', 'value', 'onValueChange', 'disabled', 'readOnly', 'name']);
|
|
725
728
|
const checkboxGroup = useCheckboxGroup(checkboxGroupProps);
|
|
726
729
|
return web.createComponent(CheckboxGroupContextProvider, {
|
|
727
730
|
value: checkboxGroup,
|
|
728
731
|
get children() {
|
|
729
|
-
return web.createComponent(ark.div, web.mergeProps(
|
|
732
|
+
return web.createComponent(ark.div, web.mergeProps({
|
|
733
|
+
role: "group"
|
|
734
|
+
}, localProps, () => anatomy.checkboxAnatomy.build().group.attrs));
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
const [FieldProvider, useFieldContext] = createContext({
|
|
740
|
+
hookName: 'useFieldContext',
|
|
741
|
+
providerName: '<FieldProvider />',
|
|
742
|
+
strict: false
|
|
743
|
+
});
|
|
744
|
+
|
|
745
|
+
const FieldContext = props => props.children(useFieldContext());
|
|
746
|
+
|
|
747
|
+
const FieldErrorText = props => {
|
|
748
|
+
const field = useFieldContext();
|
|
749
|
+
const mergedProps = solid.mergeProps(() => field().getErrorTextProps(), props);
|
|
750
|
+
return web.createComponent(solidJs.Show, {
|
|
751
|
+
get when() {
|
|
752
|
+
return field?.().invalid;
|
|
753
|
+
},
|
|
754
|
+
get children() {
|
|
755
|
+
return web.createComponent(ark.span, mergedProps);
|
|
730
756
|
}
|
|
731
757
|
});
|
|
732
758
|
};
|
|
733
759
|
|
|
760
|
+
const FieldHelperText = props => {
|
|
761
|
+
const field = useFieldContext();
|
|
762
|
+
const mergedProps = solid.mergeProps(() => field().getHelperTextProps(), props);
|
|
763
|
+
return web.createComponent(ark.span, mergedProps);
|
|
764
|
+
};
|
|
765
|
+
|
|
766
|
+
const FieldInput = props => {
|
|
767
|
+
const field = useFieldContext();
|
|
768
|
+
const mergedProps = solid.mergeProps(() => field?.().getInputProps(), props);
|
|
769
|
+
return web.createComponent(ark.input, mergedProps);
|
|
770
|
+
};
|
|
771
|
+
|
|
772
|
+
const FieldLabel = props => {
|
|
773
|
+
const field = useFieldContext();
|
|
774
|
+
const mergedProps = solid.mergeProps(() => field?.().getLabelProps(), props);
|
|
775
|
+
return web.createComponent(ark.label, mergedProps);
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
const FieldSelect = props => {
|
|
779
|
+
const field = useFieldContext();
|
|
780
|
+
const mergedProps = solid.mergeProps(() => field?.().getSelectProps(), props);
|
|
781
|
+
return web.createComponent(ark.select, mergedProps);
|
|
782
|
+
};
|
|
783
|
+
|
|
784
|
+
const parts = anatomy.fieldAnatomy.build();
|
|
785
|
+
const useField = props => {
|
|
786
|
+
const {
|
|
787
|
+
required = false,
|
|
788
|
+
disabled = false,
|
|
789
|
+
invalid = false,
|
|
790
|
+
readOnly = false
|
|
791
|
+
} = props;
|
|
792
|
+
const [hasErrorText, setHasErrorText] = solidJs.createSignal(false);
|
|
793
|
+
const [hasHelperText, setHasHelperText] = solidJs.createSignal(false);
|
|
794
|
+
const id = props.id ?? `field-${Math.random().toString(36).substr(2, 9)}`;
|
|
795
|
+
let rootRef;
|
|
796
|
+
const errorTextId = `field::${id}::error-text`;
|
|
797
|
+
const helperTextId = `field::${id}::helper-text`;
|
|
798
|
+
const labelId = `field::${id}::label`;
|
|
799
|
+
solidJs.createEffect(() => {
|
|
800
|
+
return;
|
|
801
|
+
});
|
|
802
|
+
const getRootProps = () => ({
|
|
803
|
+
...parts.root.attrs,
|
|
804
|
+
role: 'group',
|
|
805
|
+
'data-disabled': dataAttr(disabled),
|
|
806
|
+
'data-invalid': dataAttr(invalid),
|
|
807
|
+
'data-readonly': dataAttr(readOnly)
|
|
808
|
+
});
|
|
809
|
+
const getLabelProps = () => ({
|
|
810
|
+
...parts.label.attrs,
|
|
811
|
+
id: labelId,
|
|
812
|
+
'data-disabled': dataAttr(disabled),
|
|
813
|
+
'data-invalid': dataAttr(invalid),
|
|
814
|
+
'data-readonly': dataAttr(readOnly),
|
|
815
|
+
htmlFor: id
|
|
816
|
+
});
|
|
817
|
+
const labelIds = [];
|
|
818
|
+
if (hasErrorText() && invalid) labelIds.push(errorTextId);
|
|
819
|
+
if (hasHelperText()) labelIds.push(helperTextId);
|
|
820
|
+
const getControlProps = () => ({
|
|
821
|
+
'aria-describedby': labelIds.join(' ') || undefined,
|
|
822
|
+
'aria-invalid': ariaAttr(invalid),
|
|
823
|
+
'aria-required': ariaAttr(required),
|
|
824
|
+
'aria-readonly': ariaAttr(readOnly),
|
|
825
|
+
id,
|
|
826
|
+
required,
|
|
827
|
+
disabled,
|
|
828
|
+
readOnly
|
|
829
|
+
});
|
|
830
|
+
const getInputProps = () => ({
|
|
831
|
+
...getControlProps(),
|
|
832
|
+
...parts.input.attrs
|
|
833
|
+
});
|
|
834
|
+
const getTextareaProps = () => ({
|
|
835
|
+
...getControlProps(),
|
|
836
|
+
...parts.textarea.attrs
|
|
837
|
+
});
|
|
838
|
+
const getSelectProps = () => ({
|
|
839
|
+
...getControlProps(),
|
|
840
|
+
...parts.select.attrs
|
|
841
|
+
});
|
|
842
|
+
const getHelperTextProps = () => ({
|
|
843
|
+
id: helperTextId,
|
|
844
|
+
...parts.helperText.attrs
|
|
845
|
+
});
|
|
846
|
+
const getErrorTextProps = () => ({
|
|
847
|
+
id: errorTextId,
|
|
848
|
+
...parts.errorText.attrs,
|
|
849
|
+
'aria-live': 'polite'
|
|
850
|
+
});
|
|
851
|
+
return solidJs.createMemo(() => ({
|
|
852
|
+
ariaDescribedby: labelIds.join(' '),
|
|
853
|
+
ids: {
|
|
854
|
+
control: id,
|
|
855
|
+
label: labelId,
|
|
856
|
+
errorText: errorTextId,
|
|
857
|
+
helperText: helperTextId
|
|
858
|
+
},
|
|
859
|
+
refs: {
|
|
860
|
+
rootRef
|
|
861
|
+
},
|
|
862
|
+
disabled,
|
|
863
|
+
invalid,
|
|
864
|
+
readOnly,
|
|
865
|
+
required,
|
|
866
|
+
getLabelProps,
|
|
867
|
+
getRootProps,
|
|
868
|
+
getInputProps,
|
|
869
|
+
getTextareaProps,
|
|
870
|
+
getSelectProps,
|
|
871
|
+
getHelperTextProps,
|
|
872
|
+
getErrorTextProps
|
|
873
|
+
}));
|
|
874
|
+
};
|
|
875
|
+
const dataAttr = condition => condition ? '' : undefined;
|
|
876
|
+
const ariaAttr = condition => condition ? true : undefined;
|
|
877
|
+
|
|
878
|
+
const FieldRoot = props => {
|
|
879
|
+
const [useFieldProps, localProps] = createSplitProps()(props, ['id', 'disabled', 'invalid', 'readOnly', 'required']);
|
|
880
|
+
const field = useField(useFieldProps);
|
|
881
|
+
const mergedProps = solid.mergeProps(() => field().getRootProps(), localProps);
|
|
882
|
+
return web.createComponent(FieldProvider, {
|
|
883
|
+
value: field,
|
|
884
|
+
get children() {
|
|
885
|
+
return web.createComponent(ark.div, mergedProps);
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
const FieldRootProvider = props => {
|
|
891
|
+
const [{
|
|
892
|
+
value: field
|
|
893
|
+
}, localProps] = createSplitProps()(props, ['value']);
|
|
894
|
+
const mergedProps = solid.mergeProps(() => field().getRootProps(), localProps);
|
|
895
|
+
return web.createComponent(FieldProvider, {
|
|
896
|
+
value: field,
|
|
897
|
+
get children() {
|
|
898
|
+
return web.createComponent(ark.div, mergedProps);
|
|
899
|
+
}
|
|
900
|
+
});
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
const FieldTextarea = props => {
|
|
904
|
+
const field = useFieldContext();
|
|
905
|
+
const mergedProps = solid.mergeProps(() => field?.().getTextareaProps(), props);
|
|
906
|
+
return web.createComponent(ark.textarea, mergedProps);
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
var field = /*#__PURE__*/Object.freeze({
|
|
910
|
+
__proto__: null,
|
|
911
|
+
Context: FieldContext,
|
|
912
|
+
ErrorText: FieldErrorText,
|
|
913
|
+
HelperText: FieldHelperText,
|
|
914
|
+
Input: FieldInput,
|
|
915
|
+
Label: FieldLabel,
|
|
916
|
+
Root: FieldRoot,
|
|
917
|
+
RootProvider: FieldRootProvider,
|
|
918
|
+
Select: FieldSelect,
|
|
919
|
+
Textarea: FieldTextarea
|
|
920
|
+
});
|
|
921
|
+
|
|
734
922
|
const CheckboxHiddenInput = props => {
|
|
735
923
|
const checkbox = useCheckboxContext();
|
|
736
924
|
const mergedProps = solid.mergeProps(() => checkbox().getHiddenInputProps(), props);
|
|
737
|
-
|
|
925
|
+
const field = useFieldContext();
|
|
926
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
927
|
+
get ["aria-describedby"]() {
|
|
928
|
+
return field?.().ariaDescribedby;
|
|
929
|
+
}
|
|
930
|
+
}, mergedProps));
|
|
738
931
|
};
|
|
739
932
|
|
|
740
933
|
const CheckboxIndicator = props => {
|
|
@@ -764,8 +957,17 @@ const useCheckbox = ownProps => {
|
|
|
764
957
|
const locale = useLocaleContext();
|
|
765
958
|
const environment = useEnvironmentContext();
|
|
766
959
|
const id = solidJs.createUniqueId();
|
|
960
|
+
const field = useFieldContext();
|
|
767
961
|
const context = solidJs.createMemo(() => ({
|
|
768
962
|
id,
|
|
963
|
+
ids: {
|
|
964
|
+
label: field?.().ids.label,
|
|
965
|
+
hiddenInput: field?.().ids.control
|
|
966
|
+
},
|
|
967
|
+
disabled: field?.().disabled,
|
|
968
|
+
readOnly: field?.().readOnly,
|
|
969
|
+
invalid: field?.().invalid,
|
|
970
|
+
required: field?.().required,
|
|
769
971
|
dir: locale().dir,
|
|
770
972
|
getRootNode: environment().getRootNode,
|
|
771
973
|
checked: props().defaultChecked,
|
|
@@ -968,10 +1170,18 @@ const [ColorPickerChannelPropsProvider, useColorPickerChannelPropsContext] = cre
|
|
|
968
1170
|
providerName: '<ColorPickerChannelSliderProvider />'
|
|
969
1171
|
});
|
|
970
1172
|
|
|
1173
|
+
const [ColorPickerFormatPropsProvider, useColorPickerFormatPropsContext] = createContext({
|
|
1174
|
+
hookName: 'useColorPickerFormatPropsContext',
|
|
1175
|
+
providerName: '<ColorPickerFormatPropsProvider />',
|
|
1176
|
+
strict: false
|
|
1177
|
+
});
|
|
1178
|
+
|
|
971
1179
|
const ColorPickerChannelSlider = props => {
|
|
972
1180
|
const [channelProps, localProps] = createSplitProps()(props, ['channel', 'orientation']);
|
|
973
1181
|
const api = useColorPickerContext();
|
|
974
|
-
const
|
|
1182
|
+
const formatProps = useColorPickerFormatPropsContext();
|
|
1183
|
+
const channelSliderProps = solid.mergeProps(channelProps, formatProps);
|
|
1184
|
+
const mergedProps = solid.mergeProps(() => api().getChannelSliderProps(channelSliderProps), localProps);
|
|
975
1185
|
return web.createComponent(ColorPickerChannelPropsProvider, {
|
|
976
1186
|
value: channelProps,
|
|
977
1187
|
get children() {
|
|
@@ -980,20 +1190,43 @@ const ColorPickerChannelSlider = props => {
|
|
|
980
1190
|
});
|
|
981
1191
|
};
|
|
982
1192
|
|
|
1193
|
+
const ColorPickerChannelSliderLabel = props => {
|
|
1194
|
+
const colorPicker = useColorPickerContext();
|
|
1195
|
+
const channelProps = useColorPickerChannelPropsContext();
|
|
1196
|
+
const mergedProps = solid.mergeProps(() => colorPicker().getChannelSliderLabelProps(channelProps), props);
|
|
1197
|
+
return web.createComponent(ark.label, mergedProps);
|
|
1198
|
+
};
|
|
1199
|
+
|
|
983
1200
|
const ColorPickerChannelSliderThumb = props => {
|
|
984
1201
|
const api = useColorPickerContext();
|
|
1202
|
+
const formatProps = useColorPickerFormatPropsContext();
|
|
985
1203
|
const channelProps = useColorPickerChannelPropsContext();
|
|
986
|
-
const
|
|
1204
|
+
const channelSliderProps = solid.mergeProps(channelProps, formatProps);
|
|
1205
|
+
const mergedProps = solid.mergeProps(() => api().getChannelSliderThumbProps(channelSliderProps), props);
|
|
987
1206
|
return web.createComponent(ark.div, mergedProps);
|
|
988
1207
|
};
|
|
989
1208
|
|
|
990
1209
|
const ColorPickerChannelSliderTrack = props => {
|
|
991
1210
|
const api = useColorPickerContext();
|
|
1211
|
+
const formatProps = useColorPickerFormatPropsContext();
|
|
992
1212
|
const channelProps = useColorPickerChannelPropsContext();
|
|
993
|
-
const
|
|
1213
|
+
const channelSliderProps = solid.mergeProps(channelProps, formatProps);
|
|
1214
|
+
const mergedProps = solid.mergeProps(() => api().getChannelSliderTrackProps(channelSliderProps), props);
|
|
994
1215
|
return web.createComponent(ark.div, mergedProps);
|
|
995
1216
|
};
|
|
996
1217
|
|
|
1218
|
+
const ColorPickerChannelSliderValueText = props => {
|
|
1219
|
+
const colorPicker = useColorPickerContext();
|
|
1220
|
+
const localeContext = useLocaleContext();
|
|
1221
|
+
const channelProps = useColorPickerChannelPropsContext();
|
|
1222
|
+
const mergedProps = solid.mergeProps(() => colorPicker().getChannelSliderValueTextProps(channelProps), props);
|
|
1223
|
+
return web.createComponent(ark.span, web.mergeProps(mergedProps, {
|
|
1224
|
+
get children() {
|
|
1225
|
+
return props.children || colorPicker().getChannelValueText(channelProps.channel, localeContext().locale);
|
|
1226
|
+
}
|
|
1227
|
+
}));
|
|
1228
|
+
};
|
|
1229
|
+
|
|
997
1230
|
const splitPresenceProps = props => createSplitProps()(props, ['immediate', 'lazyMount', 'onExitComplete', 'present', 'unmountOnExit']);
|
|
998
1231
|
|
|
999
1232
|
const usePresence = props => {
|
|
@@ -1097,7 +1330,12 @@ const ColorPickerFormatTrigger = props => {
|
|
|
1097
1330
|
const ColorPickerHiddenInput = props => {
|
|
1098
1331
|
const colorPicker = useColorPickerContext();
|
|
1099
1332
|
const mergedProps = solid.mergeProps(() => colorPicker().getHiddenInputProps(), props);
|
|
1100
|
-
|
|
1333
|
+
const field = useFieldContext();
|
|
1334
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
1335
|
+
get ["aria-describedby"]() {
|
|
1336
|
+
return field?.().ariaDescribedby;
|
|
1337
|
+
}
|
|
1338
|
+
}, mergedProps));
|
|
1101
1339
|
};
|
|
1102
1340
|
|
|
1103
1341
|
const ColorPickerLabel = props => {
|
|
@@ -1123,10 +1361,18 @@ const ColorPickerPositioner = props => {
|
|
|
1123
1361
|
const useColorPicker = props => {
|
|
1124
1362
|
const locale = useLocaleContext();
|
|
1125
1363
|
const environment = useEnvironmentContext();
|
|
1364
|
+
const field = useFieldContext();
|
|
1126
1365
|
const id = solidJs.createUniqueId();
|
|
1127
1366
|
const context = solidJs.createMemo(() => ({
|
|
1128
1367
|
id,
|
|
1368
|
+
ids: {
|
|
1369
|
+
label: field?.().ids.label,
|
|
1370
|
+
input: field?.().ids.control
|
|
1371
|
+
},
|
|
1129
1372
|
dir: locale().dir,
|
|
1373
|
+
disabled: field?.().disabled,
|
|
1374
|
+
readOnly: field?.().readOnly,
|
|
1375
|
+
required: field?.().required,
|
|
1130
1376
|
getRootNode: environment().getRootNode,
|
|
1131
1377
|
open: props.defaultOpen,
|
|
1132
1378
|
'open.controlled': props.open !== undefined,
|
|
@@ -1141,7 +1387,7 @@ const useColorPicker = props => {
|
|
|
1141
1387
|
|
|
1142
1388
|
const ColorPickerRoot = props => {
|
|
1143
1389
|
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']);
|
|
1390
|
+
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
1391
|
const api = useColorPicker(useColorPickerProps);
|
|
1146
1392
|
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
1147
1393
|
present: api().open
|
|
@@ -1232,9 +1478,29 @@ const ColorPickerTrigger = props => {
|
|
|
1232
1478
|
return web.createComponent(ark.button, mergedProps);
|
|
1233
1479
|
};
|
|
1234
1480
|
|
|
1481
|
+
const ColorPickerValueSwatch = props => {
|
|
1482
|
+
const [{
|
|
1483
|
+
respectAlpha
|
|
1484
|
+
}, localProps] = createSplitProps()(props, ['respectAlpha']);
|
|
1485
|
+
const colorPicker = useColorPickerContext();
|
|
1486
|
+
const swatchProps = solidJs.createMemo(() => ({
|
|
1487
|
+
respectAlpha,
|
|
1488
|
+
value: colorPicker().value
|
|
1489
|
+
}));
|
|
1490
|
+
const mergedProps = solid.mergeProps(() => colorPicker().getSwatchProps(swatchProps()), localProps);
|
|
1491
|
+
return web.createComponent(ColorPickerSwatchPropsProvider, {
|
|
1492
|
+
get value() {
|
|
1493
|
+
return swatchProps();
|
|
1494
|
+
},
|
|
1495
|
+
get children() {
|
|
1496
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1497
|
+
}
|
|
1498
|
+
});
|
|
1499
|
+
};
|
|
1500
|
+
|
|
1235
1501
|
const ColorPickerValueText = props => {
|
|
1236
1502
|
const api = useColorPickerContext();
|
|
1237
|
-
const mergedProps = solid.mergeProps(() => anatomy
|
|
1503
|
+
const mergedProps = solid.mergeProps(() => anatomy.colorPickerAnatomy.build().valueText.attrs, props);
|
|
1238
1504
|
return web.createComponent(ark.span, web.mergeProps(mergedProps, {
|
|
1239
1505
|
get children() {
|
|
1240
1506
|
return api().valueAsString || props.children;
|
|
@@ -1244,17 +1510,23 @@ const ColorPickerValueText = props => {
|
|
|
1244
1510
|
|
|
1245
1511
|
const ColorPickerView = props => {
|
|
1246
1512
|
const api = useColorPickerContext();
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
},
|
|
1513
|
+
const [formatProps, localProps] = createSplitProps()(props, ['format']);
|
|
1514
|
+
const mergedProps = solid.mergeProps(() => anatomy.colorPickerAnatomy.build().view.attrs, localProps);
|
|
1515
|
+
return web.createComponent(ColorPickerFormatPropsProvider, {
|
|
1516
|
+
value: formatProps,
|
|
1252
1517
|
get children() {
|
|
1253
|
-
return web.createComponent(
|
|
1254
|
-
get
|
|
1255
|
-
return props.format;
|
|
1518
|
+
return web.createComponent(solidJs.Show, {
|
|
1519
|
+
get when() {
|
|
1520
|
+
return api().format === props.format;
|
|
1521
|
+
},
|
|
1522
|
+
get children() {
|
|
1523
|
+
return web.createComponent(ark.div, web.mergeProps({
|
|
1524
|
+
get ["data-format"]() {
|
|
1525
|
+
return props.format;
|
|
1526
|
+
}
|
|
1527
|
+
}, mergedProps));
|
|
1256
1528
|
}
|
|
1257
|
-
}
|
|
1529
|
+
});
|
|
1258
1530
|
}
|
|
1259
1531
|
});
|
|
1260
1532
|
};
|
|
@@ -1266,8 +1538,10 @@ var colorPicker = /*#__PURE__*/Object.freeze({
|
|
|
1266
1538
|
AreaThumb: ColorPickerAreaThumb,
|
|
1267
1539
|
ChannelInput: ColorPickerChannelInput,
|
|
1268
1540
|
ChannelSlider: ColorPickerChannelSlider,
|
|
1541
|
+
ChannelSliderLabel: ColorPickerChannelSliderLabel,
|
|
1269
1542
|
ChannelSliderThumb: ColorPickerChannelSliderThumb,
|
|
1270
1543
|
ChannelSliderTrack: ColorPickerChannelSliderTrack,
|
|
1544
|
+
ChannelSliderValueText: ColorPickerChannelSliderValueText,
|
|
1271
1545
|
Content: ColorPickerContent,
|
|
1272
1546
|
Context: ColorPickerContext,
|
|
1273
1547
|
Control: ColorPickerControl,
|
|
@@ -1278,12 +1552,14 @@ var colorPicker = /*#__PURE__*/Object.freeze({
|
|
|
1278
1552
|
Label: ColorPickerLabel,
|
|
1279
1553
|
Positioner: ColorPickerPositioner,
|
|
1280
1554
|
Root: ColorPickerRoot,
|
|
1555
|
+
RootProvider: ColorPickerRootProvider,
|
|
1281
1556
|
Swatch: ColorPickerSwatch,
|
|
1282
1557
|
SwatchGroup: ColorPickerSwatchGroup,
|
|
1283
1558
|
SwatchIndicator: ColorPickerSwatchIndicator,
|
|
1284
1559
|
SwatchTrigger: ColorPickerSwatchTrigger,
|
|
1285
1560
|
TransparencyGrid: ColorPickerTransparencyGrid,
|
|
1286
1561
|
Trigger: ColorPickerTrigger,
|
|
1562
|
+
ValueSwatch: ColorPickerValueSwatch,
|
|
1287
1563
|
ValueText: ColorPickerValueText,
|
|
1288
1564
|
View: ColorPickerView
|
|
1289
1565
|
});
|
|
@@ -1325,7 +1601,12 @@ const ComboboxControl = props => {
|
|
|
1325
1601
|
const ComboboxInput = props => {
|
|
1326
1602
|
const combobox = useComboboxContext();
|
|
1327
1603
|
const mergedProps = solid.mergeProps(() => combobox().getInputProps(), props);
|
|
1328
|
-
|
|
1604
|
+
const field = useFieldContext();
|
|
1605
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
1606
|
+
get ["aria-describedby"]() {
|
|
1607
|
+
return field?.().ariaDescribedby;
|
|
1608
|
+
}
|
|
1609
|
+
}, mergedProps));
|
|
1329
1610
|
};
|
|
1330
1611
|
|
|
1331
1612
|
const [ComboboxItemProvider, useComboboxItemContext] = createContext({
|
|
@@ -1429,12 +1710,23 @@ const ComboboxPositioner = props => {
|
|
|
1429
1710
|
|
|
1430
1711
|
const useCombobox = props => {
|
|
1431
1712
|
const [collectionOptions, comboboxProps] = createSplitProps()(props, ['isItemDisabled', 'itemToValue', 'itemToString', 'items']);
|
|
1432
|
-
const collection = () => combobox__namespace.collection(
|
|
1713
|
+
const collection = () => combobox__namespace.collection({
|
|
1714
|
+
...collectionOptions
|
|
1715
|
+
});
|
|
1433
1716
|
const locale = useLocaleContext();
|
|
1434
1717
|
const environment = useEnvironmentContext();
|
|
1435
1718
|
const id = solidJs.createUniqueId();
|
|
1719
|
+
const field = useFieldContext();
|
|
1436
1720
|
const context = solidJs.createMemo(() => ({
|
|
1437
1721
|
id,
|
|
1722
|
+
ids: {
|
|
1723
|
+
label: field?.().ids.label,
|
|
1724
|
+
input: field?.().ids.control
|
|
1725
|
+
},
|
|
1726
|
+
disabled: field?.().disabled,
|
|
1727
|
+
readOnly: field?.().readOnly,
|
|
1728
|
+
required: field?.().required,
|
|
1729
|
+
invalid: field?.().invalid,
|
|
1438
1730
|
collection: collection(),
|
|
1439
1731
|
dir: locale().dir,
|
|
1440
1732
|
getRootNode: environment().getRootNode,
|
|
@@ -1451,7 +1743,7 @@ const useCombobox = props => {
|
|
|
1451
1743
|
|
|
1452
1744
|
const ComboboxRoot = props => {
|
|
1453
1745
|
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']);
|
|
1746
|
+
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
1747
|
const api = useCombobox(useComboboxProps);
|
|
1456
1748
|
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
1457
1749
|
present: api().open
|
|
@@ -1572,12 +1864,17 @@ const DatePickerMonthSelect = props => {
|
|
|
1572
1864
|
const mergedProps = solid.mergeProps(() => api().getMonthSelectProps(), props);
|
|
1573
1865
|
return web.createComponent(ark.select, web.mergeProps(mergedProps, {
|
|
1574
1866
|
get children() {
|
|
1575
|
-
return
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1867
|
+
return web.createComponent(solidJs.For, {
|
|
1868
|
+
get each() {
|
|
1869
|
+
return api().getMonths();
|
|
1870
|
+
},
|
|
1871
|
+
children: month => (() => {
|
|
1872
|
+
var _el$ = _tmpl$$4();
|
|
1873
|
+
web.insert(_el$, () => month.label);
|
|
1874
|
+
web.effect(() => _el$.value = month.value);
|
|
1875
|
+
return _el$;
|
|
1876
|
+
})()
|
|
1877
|
+
});
|
|
1581
1878
|
}
|
|
1582
1879
|
}));
|
|
1583
1880
|
};
|
|
@@ -1811,7 +2108,7 @@ const DatePickerTrigger = props => {
|
|
|
1811
2108
|
const DatePickerView = props => {
|
|
1812
2109
|
const [viewProps, localProps] = createSplitProps()(props, ['view']);
|
|
1813
2110
|
const api = useDatePickerContext();
|
|
1814
|
-
const mergedProps = solid.mergeProps(() => anatomy
|
|
2111
|
+
const mergedProps = solid.mergeProps(() => anatomy.datePickerAnatomy.build().view.attrs, localProps);
|
|
1815
2112
|
return web.createComponent(DatePickerViewProvider, {
|
|
1816
2113
|
value: viewProps,
|
|
1817
2114
|
get children() {
|
|
@@ -1844,15 +2141,20 @@ const DatePickerYearSelect = props => {
|
|
|
1844
2141
|
const mergedProps = solid.mergeProps(() => api().getYearSelectProps(), props);
|
|
1845
2142
|
return web.createComponent(ark.select, web.mergeProps(mergedProps, {
|
|
1846
2143
|
get children() {
|
|
1847
|
-
return
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
2144
|
+
return web.createComponent(solidJs.For, {
|
|
2145
|
+
get each() {
|
|
2146
|
+
return getYearsRange({
|
|
2147
|
+
from: 1_000,
|
|
2148
|
+
to: 4_000
|
|
2149
|
+
});
|
|
2150
|
+
},
|
|
2151
|
+
children: year => (() => {
|
|
2152
|
+
var _el$ = _tmpl$$3();
|
|
2153
|
+
_el$.value = year;
|
|
2154
|
+
web.insert(_el$, year);
|
|
2155
|
+
return _el$;
|
|
2156
|
+
})()
|
|
2157
|
+
});
|
|
1856
2158
|
}
|
|
1857
2159
|
}));
|
|
1858
2160
|
};
|
|
@@ -2091,7 +2393,12 @@ const EditableEditTrigger = props => {
|
|
|
2091
2393
|
const EditableInput = props => {
|
|
2092
2394
|
const api = useEditableContext();
|
|
2093
2395
|
const mergedProps = solid.mergeProps(() => api().getInputProps(), props);
|
|
2094
|
-
|
|
2396
|
+
const field = useFieldContext();
|
|
2397
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
2398
|
+
get ["aria-describedby"]() {
|
|
2399
|
+
return field?.().ariaDescribedby;
|
|
2400
|
+
}
|
|
2401
|
+
}, mergedProps));
|
|
2095
2402
|
};
|
|
2096
2403
|
|
|
2097
2404
|
const EditableLabel = props => {
|
|
@@ -2110,9 +2417,18 @@ const useEditable = props => {
|
|
|
2110
2417
|
const locale = useLocaleContext();
|
|
2111
2418
|
const environment = useEnvironmentContext();
|
|
2112
2419
|
const id = solidJs.createUniqueId();
|
|
2420
|
+
const field = useFieldContext();
|
|
2113
2421
|
const context = solidJs.createMemo(() => ({
|
|
2114
2422
|
id,
|
|
2423
|
+
ids: {
|
|
2424
|
+
label: field?.().ids.label,
|
|
2425
|
+
input: field?.().ids.control
|
|
2426
|
+
},
|
|
2115
2427
|
dir: locale().dir,
|
|
2428
|
+
disabled: field?.().disabled,
|
|
2429
|
+
invalid: field?.().invalid,
|
|
2430
|
+
readOnly: field?.().readOnly,
|
|
2431
|
+
required: field?.().required,
|
|
2116
2432
|
getRootNode: environment().getRootNode,
|
|
2117
2433
|
value: props.defaultValue,
|
|
2118
2434
|
...props
|
|
@@ -2124,7 +2440,7 @@ const useEditable = props => {
|
|
|
2124
2440
|
};
|
|
2125
2441
|
|
|
2126
2442
|
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']);
|
|
2443
|
+
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
2444
|
const api = useEditable(useEditableProps);
|
|
2129
2445
|
const mergedProps = solid.mergeProps(() => api().getRootProps(), localProps);
|
|
2130
2446
|
return web.createComponent(EditableProvider, {
|
|
@@ -2185,7 +2501,12 @@ const FileUploadDropzone = props => {
|
|
|
2185
2501
|
const FileUploadHiddenInput = props => {
|
|
2186
2502
|
const fileUpload = useFileUploadContext();
|
|
2187
2503
|
const mergedProps = solid.mergeProps(() => fileUpload().getHiddenInputProps(), props);
|
|
2188
|
-
|
|
2504
|
+
const field = useFieldContext();
|
|
2505
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
2506
|
+
get ["aria-describedby"]() {
|
|
2507
|
+
return field?.().ariaDescribedby;
|
|
2508
|
+
}
|
|
2509
|
+
}, mergedProps));
|
|
2189
2510
|
};
|
|
2190
2511
|
|
|
2191
2512
|
const [FileUploadItemPropsProvider, useFileUploadItemPropsContext] = createContext({
|
|
@@ -2270,9 +2591,16 @@ const useFileUpload = props => {
|
|
|
2270
2591
|
const locale = useLocaleContext();
|
|
2271
2592
|
const environment = useEnvironmentContext();
|
|
2272
2593
|
const id = solidJs.createUniqueId();
|
|
2594
|
+
const field = useFieldContext();
|
|
2273
2595
|
const context = solidJs.createMemo(() => ({
|
|
2274
2596
|
id,
|
|
2597
|
+
ids: {
|
|
2598
|
+
label: field?.().ids.label,
|
|
2599
|
+
hiddenInput: field?.().ids.control
|
|
2600
|
+
},
|
|
2275
2601
|
dir: locale().dir,
|
|
2602
|
+
disabled: field?.().disabled,
|
|
2603
|
+
required: field?.().required,
|
|
2276
2604
|
getRootNode: environment().getRootNode,
|
|
2277
2605
|
...props
|
|
2278
2606
|
}));
|
|
@@ -2283,7 +2611,7 @@ const useFileUpload = props => {
|
|
|
2283
2611
|
};
|
|
2284
2612
|
|
|
2285
2613
|
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']);
|
|
2614
|
+
const [fileUploadProps, localProps] = createSplitProps()(props, ['accept', 'allowDrop', 'capture', 'directory', 'disabled', 'id', 'ids', 'locale', 'maxFiles', 'maxFileSize', 'minFileSize', 'name', 'onFileAccept', 'onFileChange', 'onFileReject', 'required', 'translations', 'validate']);
|
|
2287
2615
|
const fileUpload = useFileUpload(fileUploadProps);
|
|
2288
2616
|
const mergedProps = solid.mergeProps(() => fileUpload().getRootProps(), localProps);
|
|
2289
2617
|
return web.createComponent(FileUploadProvider, {
|
|
@@ -2509,12 +2837,12 @@ const MenuCheckboxItem = props => {
|
|
|
2509
2837
|
});
|
|
2510
2838
|
const context = useMenuContext();
|
|
2511
2839
|
const mergedProps = solid.mergeProps(() => context().getOptionItemProps(optionItemProps), localProps);
|
|
2512
|
-
const
|
|
2840
|
+
const optionItemState = solidJs.createMemo(() => context().getItemState(optionItemProps));
|
|
2513
2841
|
return web.createComponent(MenuOptionItemPropsProvider, {
|
|
2514
2842
|
value: optionItemProps,
|
|
2515
2843
|
get children() {
|
|
2516
2844
|
return web.createComponent(MenuItemProvider, {
|
|
2517
|
-
value:
|
|
2845
|
+
value: optionItemState,
|
|
2518
2846
|
get children() {
|
|
2519
2847
|
return web.createComponent(ark.div, mergedProps);
|
|
2520
2848
|
}
|
|
@@ -2635,12 +2963,12 @@ const MenuRadioItem = props => {
|
|
|
2635
2963
|
})
|
|
2636
2964
|
}));
|
|
2637
2965
|
const mergedProps = solid.mergeProps(() => context().getOptionItemProps(optionItemProps), localProps);
|
|
2638
|
-
const
|
|
2966
|
+
const optionItemState = solidJs.createMemo(() => context().getOptionItemState(optionItemProps));
|
|
2639
2967
|
return web.createComponent(MenuOptionItemPropsProvider, {
|
|
2640
2968
|
value: optionItemProps,
|
|
2641
2969
|
get children() {
|
|
2642
2970
|
return web.createComponent(MenuItemProvider, {
|
|
2643
|
-
value:
|
|
2971
|
+
value: optionItemState,
|
|
2644
2972
|
get children() {
|
|
2645
2973
|
return web.createComponent(ark.div, mergedProps);
|
|
2646
2974
|
}
|
|
@@ -2854,7 +3182,12 @@ const NumberInputIncrementTrigger = props => {
|
|
|
2854
3182
|
const NumberInputInput = props => {
|
|
2855
3183
|
const api = useNumberInputContext();
|
|
2856
3184
|
const mergedProps = solid.mergeProps(() => api().getInputProps(), props);
|
|
2857
|
-
|
|
3185
|
+
const field = useFieldContext();
|
|
3186
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
3187
|
+
get ["aria-describedby"]() {
|
|
3188
|
+
return field?.().ariaDescribedby;
|
|
3189
|
+
}
|
|
3190
|
+
}, mergedProps));
|
|
2858
3191
|
};
|
|
2859
3192
|
|
|
2860
3193
|
const NumberInputLabel = props => {
|
|
@@ -2867,8 +3200,17 @@ const useNumberInput = props => {
|
|
|
2867
3200
|
const locale = useLocaleContext();
|
|
2868
3201
|
const environment = useEnvironmentContext();
|
|
2869
3202
|
const id = solidJs.createUniqueId();
|
|
3203
|
+
const field = useFieldContext();
|
|
2870
3204
|
const context = solidJs.createMemo(() => ({
|
|
2871
3205
|
id,
|
|
3206
|
+
ids: {
|
|
3207
|
+
label: field?.().ids.label,
|
|
3208
|
+
input: field?.().ids.control
|
|
3209
|
+
},
|
|
3210
|
+
disabled: field?.().disabled,
|
|
3211
|
+
readOnly: field?.().readOnly,
|
|
3212
|
+
required: field?.().required,
|
|
3213
|
+
invalid: field?.().invalid,
|
|
2872
3214
|
dir: locale().dir,
|
|
2873
3215
|
getRootNode: environment().getRootNode,
|
|
2874
3216
|
value: props.defaultValue,
|
|
@@ -2881,7 +3223,7 @@ const useNumberInput = props => {
|
|
|
2881
3223
|
};
|
|
2882
3224
|
|
|
2883
3225
|
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']);
|
|
3226
|
+
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
3227
|
const api = useNumberInput(useNumberInputProps);
|
|
2886
3228
|
const mergedProps = solid.mergeProps(() => api().getRootProps(), localProps);
|
|
2887
3229
|
return web.createComponent(NumberInputProvider, {
|
|
@@ -2920,6 +3262,7 @@ var numberInput = /*#__PURE__*/Object.freeze({
|
|
|
2920
3262
|
Input: NumberInputInput,
|
|
2921
3263
|
Label: NumberInputLabel,
|
|
2922
3264
|
Root: NumberInputRoot,
|
|
3265
|
+
RootProvider: NumberInputRootProvider,
|
|
2923
3266
|
Scrubber: NumberInputScrubber
|
|
2924
3267
|
});
|
|
2925
3268
|
|
|
@@ -3025,7 +3368,12 @@ const PinInputControl = props => {
|
|
|
3025
3368
|
const PinInputHiddenInput = props => {
|
|
3026
3369
|
const pinInput = usePinInputContext();
|
|
3027
3370
|
const mergedProps = solid.mergeProps(() => pinInput().getHiddenInputProps(), props);
|
|
3028
|
-
|
|
3371
|
+
const field = useFieldContext();
|
|
3372
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
3373
|
+
get ["aria-describedby"]() {
|
|
3374
|
+
return field?.().ariaDescribedby;
|
|
3375
|
+
}
|
|
3376
|
+
}, mergedProps));
|
|
3029
3377
|
};
|
|
3030
3378
|
|
|
3031
3379
|
const PinInputInput = props => {
|
|
@@ -3045,8 +3393,17 @@ const usePinInput = props => {
|
|
|
3045
3393
|
const locale = useLocaleContext();
|
|
3046
3394
|
const environment = useEnvironmentContext();
|
|
3047
3395
|
const id = solidJs.createUniqueId();
|
|
3396
|
+
const field = useFieldContext();
|
|
3048
3397
|
const context = solidJs.createMemo(() => ({
|
|
3049
3398
|
id,
|
|
3399
|
+
ids: {
|
|
3400
|
+
label: field?.().ids.label,
|
|
3401
|
+
hiddenInput: field?.().ids.control
|
|
3402
|
+
},
|
|
3403
|
+
disabled: field?.().disabled,
|
|
3404
|
+
readOnly: field?.().readOnly,
|
|
3405
|
+
required: field?.().required,
|
|
3406
|
+
invalid: field?.().invalid,
|
|
3050
3407
|
dir: locale().dir,
|
|
3051
3408
|
getRootNode: environment().getRootNode,
|
|
3052
3409
|
value: props.defaultValue,
|
|
@@ -3059,7 +3416,7 @@ const usePinInput = props => {
|
|
|
3059
3416
|
};
|
|
3060
3417
|
|
|
3061
3418
|
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']);
|
|
3419
|
+
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
3420
|
const pinInput = usePinInput(usePinInputProps);
|
|
3064
3421
|
const mergedProps = solid.mergeProps(() => pinInput().getRootProps(), localProps);
|
|
3065
3422
|
return web.createComponent(PinInputProvider, {
|
|
@@ -3589,7 +3946,12 @@ const RatingGroupControl = props => {
|
|
|
3589
3946
|
const RatingGroupHiddenInput = props => {
|
|
3590
3947
|
const ratingGroup = useRatingGroupContext();
|
|
3591
3948
|
const mergedProps = solid.mergeProps(() => ratingGroup().getHiddenInputProps(), props);
|
|
3592
|
-
|
|
3949
|
+
const field = useFieldContext();
|
|
3950
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
3951
|
+
get ["aria-describedby"]() {
|
|
3952
|
+
return field?.().ariaDescribedby;
|
|
3953
|
+
}
|
|
3954
|
+
}, mergedProps));
|
|
3593
3955
|
};
|
|
3594
3956
|
|
|
3595
3957
|
const [RatingGroupItemProvider, useRatingGroupItemContext] = createContext({
|
|
@@ -3622,8 +3984,16 @@ const useRatingGroup = props => {
|
|
|
3622
3984
|
const locale = useLocaleContext();
|
|
3623
3985
|
const environment = useEnvironmentContext();
|
|
3624
3986
|
const id = solidJs.createUniqueId();
|
|
3987
|
+
const field = useFieldContext();
|
|
3625
3988
|
const context = solidJs.createMemo(() => ({
|
|
3626
3989
|
id,
|
|
3990
|
+
ids: {
|
|
3991
|
+
label: field?.().ids.label,
|
|
3992
|
+
hiddenInput: field?.().ids.control
|
|
3993
|
+
},
|
|
3994
|
+
disabled: field?.().disabled,
|
|
3995
|
+
readOnly: field?.().readOnly,
|
|
3996
|
+
required: field?.().required,
|
|
3627
3997
|
dir: locale().dir,
|
|
3628
3998
|
getRootNode: environment().getRootNode,
|
|
3629
3999
|
value: props.defaultValue,
|
|
@@ -3636,7 +4006,7 @@ const useRatingGroup = props => {
|
|
|
3636
4006
|
};
|
|
3637
4007
|
|
|
3638
4008
|
const RatingGroupRoot = props => {
|
|
3639
|
-
const [useRatingProps, localProps] = createSplitProps()(props, ['allowHalf', 'autoFocus', 'count', 'defaultValue', 'disabled', 'form', 'id', 'ids', 'name', 'onHoverChange', 'onValueChange', 'readOnly', 'translations', 'value']);
|
|
4009
|
+
const [useRatingProps, localProps] = createSplitProps()(props, ['allowHalf', 'autoFocus', 'count', 'defaultValue', 'disabled', 'form', 'id', 'ids', 'name', 'onHoverChange', 'onValueChange', 'readOnly', 'required', 'translations', 'value']);
|
|
3640
4010
|
const api = useRatingGroup(useRatingProps);
|
|
3641
4011
|
const mergedProps = solid.mergeProps(() => api().getRootProps(), localProps);
|
|
3642
4012
|
return web.createComponent(RatingGroupProvider, {
|
|
@@ -3668,7 +4038,8 @@ var ratingGroup = /*#__PURE__*/Object.freeze({
|
|
|
3668
4038
|
Item: RatingGroupItem,
|
|
3669
4039
|
ItemContext: RatingGroupItemContext,
|
|
3670
4040
|
Label: RatingGroupLabel,
|
|
3671
|
-
Root: RatingGroupRoot
|
|
4041
|
+
Root: RatingGroupRoot,
|
|
4042
|
+
RootProvider: RatingGroupRootProvider
|
|
3672
4043
|
});
|
|
3673
4044
|
|
|
3674
4045
|
const [SegmentGroupProvider, useSegmentGroupContext] = createContext({
|
|
@@ -3680,7 +4051,7 @@ const SegmentGroupContext = props => props.children(useSegmentGroupContext());
|
|
|
3680
4051
|
|
|
3681
4052
|
const SegmentGroupIndicator = props => {
|
|
3682
4053
|
const segmentGroup = useSegmentGroupContext();
|
|
3683
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getIndicatorProps(), anatomy
|
|
4054
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getIndicatorProps(), anatomy.segmentGroupAnatomy.build().indicator.attrs, props);
|
|
3684
4055
|
return web.createComponent(ark.div, mergedProps);
|
|
3685
4056
|
};
|
|
3686
4057
|
|
|
@@ -3697,7 +4068,7 @@ const [SegmentGroupItemPropsProvider, useSegmentGroupItemPropsContext] = createC
|
|
|
3697
4068
|
const SegmentGroupItem = props => {
|
|
3698
4069
|
const [itemProps, localProps] = createSplitProps()(props, ['value', 'disabled', 'invalid']);
|
|
3699
4070
|
const segmentGroup = useSegmentGroupContext();
|
|
3700
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getItemProps(itemProps), anatomy
|
|
4071
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getItemProps(itemProps), anatomy.segmentGroupAnatomy.build().item.attrs, localProps);
|
|
3701
4072
|
const itemState = solidJs.createMemo(() => segmentGroup().getItemState(itemProps));
|
|
3702
4073
|
return web.createComponent(SegmentGroupItemPropsProvider, {
|
|
3703
4074
|
value: itemProps,
|
|
@@ -3717,7 +4088,7 @@ const SegmentGroupItemContext = props => props.children(useSegmentGroupItemConte
|
|
|
3717
4088
|
const SegmentGroupItemControl = props => {
|
|
3718
4089
|
const segmentGroup = useSegmentGroupContext();
|
|
3719
4090
|
const itemProps = useSegmentGroupItemPropsContext();
|
|
3720
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getItemControlProps(itemProps), anatomy
|
|
4091
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getItemControlProps(itemProps), anatomy.segmentGroupAnatomy.build().itemControl.attrs, props);
|
|
3721
4092
|
return web.createComponent(ark.div, mergedProps);
|
|
3722
4093
|
};
|
|
3723
4094
|
|
|
@@ -3731,13 +4102,13 @@ const SegmentGroupItemHiddenInput = props => {
|
|
|
3731
4102
|
const SegmentGroupItemText = props => {
|
|
3732
4103
|
const segmentGroup = useSegmentGroupContext();
|
|
3733
4104
|
const itemProps = useSegmentGroupItemPropsContext();
|
|
3734
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getItemTextProps(itemProps), anatomy
|
|
4105
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getItemTextProps(itemProps), anatomy.segmentGroupAnatomy.build().itemText.attrs, props);
|
|
3735
4106
|
return web.createComponent(ark.span, mergedProps);
|
|
3736
4107
|
};
|
|
3737
4108
|
|
|
3738
4109
|
const SegmentGroupLabel = props => {
|
|
3739
4110
|
const segmentGroup = useSegmentGroupContext();
|
|
3740
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getLabelProps(), anatomy
|
|
4111
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getLabelProps(), anatomy.segmentGroupAnatomy.build().label.attrs, props);
|
|
3741
4112
|
return web.createComponent(ark.label, mergedProps);
|
|
3742
4113
|
};
|
|
3743
4114
|
|
|
@@ -3761,7 +4132,7 @@ const useSegmentGroup = props => {
|
|
|
3761
4132
|
const SegmentGroupRoot = props => {
|
|
3762
4133
|
const [useSegmentGroupProps, localProps] = createSplitProps()(props, ['defaultValue', 'disabled', 'form', 'id', 'ids', 'name', 'onValueChange', 'orientation', 'readOnly', 'value']);
|
|
3763
4134
|
const segmentGroup = useSegmentGroup(useSegmentGroupProps);
|
|
3764
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getRootProps(), anatomy
|
|
4135
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getRootProps(), anatomy.segmentGroupAnatomy.build().root.attrs, localProps);
|
|
3765
4136
|
return web.createComponent(SegmentGroupProvider, {
|
|
3766
4137
|
value: segmentGroup,
|
|
3767
4138
|
get children() {
|
|
@@ -3774,7 +4145,7 @@ const SegmentGroupRootProvider = props => {
|
|
|
3774
4145
|
const [{
|
|
3775
4146
|
value: segmentGroup
|
|
3776
4147
|
}, localProps] = createSplitProps()(props, ['value']);
|
|
3777
|
-
const mergedProps = solid.mergeProps(() => segmentGroup().getRootProps(), anatomy
|
|
4148
|
+
const mergedProps = solid.mergeProps(() => segmentGroup().getRootProps(), anatomy.segmentGroupAnatomy.build().root.attrs, localProps);
|
|
3778
4149
|
return web.createComponent(SegmentGroupProvider, {
|
|
3779
4150
|
value: segmentGroup,
|
|
3780
4151
|
get children() {
|
|
@@ -3793,7 +4164,8 @@ var segmentGroup = /*#__PURE__*/Object.freeze({
|
|
|
3793
4164
|
ItemHiddenInput: SegmentGroupItemHiddenInput,
|
|
3794
4165
|
ItemText: SegmentGroupItemText,
|
|
3795
4166
|
Label: SegmentGroupLabel,
|
|
3796
|
-
Root: SegmentGroupRoot
|
|
4167
|
+
Root: SegmentGroupRoot,
|
|
4168
|
+
RootProvider: SegmentGroupRootProvider
|
|
3797
4169
|
});
|
|
3798
4170
|
|
|
3799
4171
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
@@ -3834,9 +4206,14 @@ var _tmpl$$2 = /*#__PURE__*/web.template(`<option value="">`),
|
|
|
3834
4206
|
_tmpl$2$1 = /*#__PURE__*/web.template(`<option>`);
|
|
3835
4207
|
const SelectHiddenSelect = props => {
|
|
3836
4208
|
const select = useSelectContext();
|
|
3837
|
-
const mergedProps = solid.mergeProps(() => select().
|
|
4209
|
+
const mergedProps = solid.mergeProps(() => select().getHiddenSelectProps(), props);
|
|
3838
4210
|
const isValueEmpty = solidJs.createMemo(() => select().value.length === 0);
|
|
3839
|
-
|
|
4211
|
+
const field = useFieldContext();
|
|
4212
|
+
return web.createComponent(ark.select, web.mergeProps({
|
|
4213
|
+
get ["aria-describedby"]() {
|
|
4214
|
+
return field?.().ariaDescribedby;
|
|
4215
|
+
}
|
|
4216
|
+
}, mergedProps, {
|
|
3840
4217
|
get children() {
|
|
3841
4218
|
return [web.createComponent(solidJs.Show, {
|
|
3842
4219
|
get when() {
|
|
@@ -3967,12 +4344,23 @@ const SelectPositioner = props => {
|
|
|
3967
4344
|
|
|
3968
4345
|
const useSelect = props => {
|
|
3969
4346
|
const [collectionOptions, selectProps] = createSplitProps()(props, ['isItemDisabled', 'itemToValue', 'itemToString', 'items']);
|
|
3970
|
-
const collection = () => select__namespace.collection(
|
|
4347
|
+
const collection = () => select__namespace.collection({
|
|
4348
|
+
...collectionOptions
|
|
4349
|
+
});
|
|
3971
4350
|
const locale = useLocaleContext();
|
|
3972
4351
|
const environment = useEnvironmentContext();
|
|
3973
4352
|
const id = solidJs.createUniqueId();
|
|
4353
|
+
const field = useFieldContext();
|
|
3974
4354
|
const context = solidJs.createMemo(() => ({
|
|
3975
4355
|
id,
|
|
4356
|
+
ids: {
|
|
4357
|
+
label: field?.().ids.label,
|
|
4358
|
+
hiddenSelect: field?.().ids.control
|
|
4359
|
+
},
|
|
4360
|
+
disabled: field?.().disabled,
|
|
4361
|
+
readOnly: field?.().readOnly,
|
|
4362
|
+
invalid: field?.().invalid,
|
|
4363
|
+
required: field?.().required,
|
|
3976
4364
|
collection: collection(),
|
|
3977
4365
|
dir: locale().dir,
|
|
3978
4366
|
getRootNode: environment().getRootNode,
|
|
@@ -3989,7 +4377,7 @@ const useSelect = props => {
|
|
|
3989
4377
|
|
|
3990
4378
|
const SelectRoot = props => {
|
|
3991
4379
|
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']);
|
|
4380
|
+
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
4381
|
const select = useSelect(useSelectProps);
|
|
3994
4382
|
const presenceApi = usePresence(solid.mergeProps(() => ({
|
|
3995
4383
|
present: select().open
|
|
@@ -4038,7 +4426,7 @@ const SelectTrigger = props => {
|
|
|
4038
4426
|
|
|
4039
4427
|
const SelectValueText = props => {
|
|
4040
4428
|
const select = useSelectContext();
|
|
4041
|
-
const mergedProps = solid.mergeProps(() => anatomy
|
|
4429
|
+
const mergedProps = solid.mergeProps(() => anatomy.selectAnatomy.build().valueText.attrs, props);
|
|
4042
4430
|
return web.createComponent(ark.span, web.mergeProps(mergedProps, {
|
|
4043
4431
|
get children() {
|
|
4044
4432
|
return select().valueAsString || props.placeholder;
|
|
@@ -4085,9 +4473,7 @@ const SignaturePadContext = props => props.children(useSignaturePadContext());
|
|
|
4085
4473
|
const SignaturePadControl = props => {
|
|
4086
4474
|
const signaturePad = useSignaturePadContext();
|
|
4087
4475
|
const mergedProps = solid.mergeProps(() => signaturePad().getControlProps(), props);
|
|
4088
|
-
return web.createComponent(ark.div,
|
|
4089
|
-
role: "application"
|
|
4090
|
-
}, mergedProps));
|
|
4476
|
+
return web.createComponent(ark.div, mergedProps);
|
|
4091
4477
|
};
|
|
4092
4478
|
|
|
4093
4479
|
const SignaturePadGuide = props => {
|
|
@@ -4102,1675 +4488,44 @@ const SignaturePadLabel = props => {
|
|
|
4102
4488
|
return web.createComponent(ark.label, mergedProps);
|
|
4103
4489
|
};
|
|
4104
4490
|
|
|
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
|
-
}
|
|
4491
|
+
const SignaturePadHiddenInput = props => {
|
|
4492
|
+
const [hiddenInputProps, localProps] = createSplitProps()(props, ['value']);
|
|
4493
|
+
const signaturePad = useSignaturePadContext();
|
|
4494
|
+
const mergedProps = solid.mergeProps(() => signaturePad().getHiddenInputProps(hiddenInputProps), localProps);
|
|
4495
|
+
const field = useFieldContext();
|
|
4496
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
4497
|
+
get ["aria-describedby"]() {
|
|
4498
|
+
return field?.().ariaDescribedby;
|
|
4873
4499
|
}
|
|
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
|
-
}
|
|
4500
|
+
}, mergedProps));
|
|
5447
4501
|
};
|
|
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
4502
|
|
|
5756
4503
|
const useSignaturePad = props => {
|
|
5757
4504
|
const locale = useLocaleContext();
|
|
5758
4505
|
const environment = useEnvironmentContext();
|
|
5759
4506
|
const id = solidJs.createUniqueId();
|
|
4507
|
+
const field = useFieldContext();
|
|
5760
4508
|
const context = solidJs.createMemo(() => ({
|
|
5761
4509
|
id,
|
|
4510
|
+
ids: {
|
|
4511
|
+
label: field?.().ids.label,
|
|
4512
|
+
hiddenInput: field?.().ids.control
|
|
4513
|
+
},
|
|
4514
|
+
disabled: field?.().disabled,
|
|
4515
|
+
readOnly: field?.().readOnly,
|
|
4516
|
+
required: field?.().required,
|
|
5762
4517
|
dir: locale().dir,
|
|
5763
4518
|
getRootNode: environment().getRootNode,
|
|
5764
4519
|
...props
|
|
5765
4520
|
}));
|
|
5766
|
-
const [state, send] = solid.useMachine(machine(context()), {
|
|
4521
|
+
const [state, send] = solid.useMachine(signaturePad__namespace.machine(context()), {
|
|
5767
4522
|
context
|
|
5768
4523
|
});
|
|
5769
|
-
return solidJs.createMemo(() => connect(state, send, solid.normalizeProps));
|
|
4524
|
+
return solidJs.createMemo(() => signaturePad__namespace.connect(state, send, solid.normalizeProps));
|
|
5770
4525
|
};
|
|
5771
4526
|
|
|
5772
4527
|
const SignaturePadRoot = props => {
|
|
5773
|
-
const [useSignaturePadProps, localProps] = createSplitProps()(props, ['id', 'ids', 'drawing', 'disabled', 'readOnly', 'name', 'onDraw', 'onDrawEnd']);
|
|
4528
|
+
const [useSignaturePadProps, localProps] = createSplitProps()(props, ['id', 'ids', 'drawing', 'disabled', 'readOnly', 'name', 'onDraw', 'onDrawEnd', 'readOnly', 'required', 'translations']);
|
|
5774
4529
|
const signaturePad = useSignaturePad(useSignaturePadProps);
|
|
5775
4530
|
const mergedProps = solid.mergeProps(() => signaturePad().getRootProps(), localProps);
|
|
5776
4531
|
return web.createComponent(SignaturePadProvider, {
|
|
@@ -5834,6 +4589,7 @@ var signaturePad = /*#__PURE__*/Object.freeze({
|
|
|
5834
4589
|
Context: SignaturePadContext,
|
|
5835
4590
|
Control: SignaturePadControl,
|
|
5836
4591
|
Guide: SignaturePadGuide,
|
|
4592
|
+
HiddenInput: SignaturePadHiddenInput,
|
|
5837
4593
|
Label: SignaturePadLabel,
|
|
5838
4594
|
Root: SignaturePadRoot,
|
|
5839
4595
|
RootProvider: SignaturePadRootProvider,
|
|
@@ -6064,7 +4820,12 @@ const SwitchControl = props => {
|
|
|
6064
4820
|
const SwitchHiddenInput = props => {
|
|
6065
4821
|
const api = useSwitchContext();
|
|
6066
4822
|
const mergedProps = solid.mergeProps(() => api().getHiddenInputProps(), props);
|
|
6067
|
-
|
|
4823
|
+
const field = useFieldContext();
|
|
4824
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
4825
|
+
get ["aria-describedby"]() {
|
|
4826
|
+
return field?.().ariaDescribedby;
|
|
4827
|
+
}
|
|
4828
|
+
}, mergedProps));
|
|
6068
4829
|
};
|
|
6069
4830
|
|
|
6070
4831
|
const SwitchLabel = props => {
|
|
@@ -6077,8 +4838,17 @@ const useSwitch = props => {
|
|
|
6077
4838
|
const locale = useLocaleContext();
|
|
6078
4839
|
const environment = useEnvironmentContext();
|
|
6079
4840
|
const id = solidJs.createUniqueId();
|
|
4841
|
+
const field = useFieldContext();
|
|
6080
4842
|
const context = solidJs.createMemo(() => ({
|
|
6081
4843
|
id,
|
|
4844
|
+
ids: {
|
|
4845
|
+
label: field?.().ids.label,
|
|
4846
|
+
hiddenInput: field?.().ids.control
|
|
4847
|
+
},
|
|
4848
|
+
disabled: field?.().disabled,
|
|
4849
|
+
readOnly: field?.().readOnly,
|
|
4850
|
+
invalid: field?.().invalid,
|
|
4851
|
+
required: field?.().required,
|
|
6082
4852
|
dir: locale().dir,
|
|
6083
4853
|
getRootNode: environment().getRootNode,
|
|
6084
4854
|
checked: props.defaultChecked,
|
|
@@ -6269,7 +5039,12 @@ const TagsInputControl = props => {
|
|
|
6269
5039
|
const TagsInputHiddenInput = props => {
|
|
6270
5040
|
const tagsInput = useTagsInputContext();
|
|
6271
5041
|
const mergedProps = solid.mergeProps(() => tagsInput().getHiddenInputProps(), props);
|
|
6272
|
-
|
|
5042
|
+
const field = useFieldContext();
|
|
5043
|
+
return web.createComponent(ark.input, web.mergeProps({
|
|
5044
|
+
get ["aria-describedby"]() {
|
|
5045
|
+
return field?.().ariaDescribedby;
|
|
5046
|
+
}
|
|
5047
|
+
}, mergedProps));
|
|
6273
5048
|
};
|
|
6274
5049
|
|
|
6275
5050
|
const TagsInputInput = props => {
|
|
@@ -6346,9 +5121,18 @@ const useTagsInput = props => {
|
|
|
6346
5121
|
const locale = useLocaleContext();
|
|
6347
5122
|
const environment = useEnvironmentContext();
|
|
6348
5123
|
const id = solidJs.createUniqueId();
|
|
5124
|
+
const field = useFieldContext();
|
|
6349
5125
|
const context = solidJs.createMemo(() => ({
|
|
6350
5126
|
id,
|
|
5127
|
+
ids: {
|
|
5128
|
+
label: field?.().ids.label,
|
|
5129
|
+
hiddenInput: field?.().ids.control
|
|
5130
|
+
},
|
|
6351
5131
|
dir: locale().dir,
|
|
5132
|
+
disabled: field?.().disabled,
|
|
5133
|
+
invalid: field?.().invalid,
|
|
5134
|
+
readOnly: field?.().readOnly,
|
|
5135
|
+
required: field?.().required,
|
|
6352
5136
|
getRootNode: environment().getRootNode,
|
|
6353
5137
|
value: props.defaultValue,
|
|
6354
5138
|
...props
|
|
@@ -6360,7 +5144,7 @@ const useTagsInput = props => {
|
|
|
6360
5144
|
};
|
|
6361
5145
|
|
|
6362
5146
|
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']);
|
|
5147
|
+
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
5148
|
const api = useTagsInput(useTagsInputProps);
|
|
6365
5149
|
const mergedProps = solid.mergeProps(() => api().getRootProps(), localProps);
|
|
6366
5150
|
return web.createComponent(TagsInputProvider, {
|
|
@@ -6566,7 +5350,8 @@ var toggleGroup = /*#__PURE__*/Object.freeze({
|
|
|
6566
5350
|
__proto__: null,
|
|
6567
5351
|
Context: ToggleGroupContext,
|
|
6568
5352
|
Item: ToggleGroupItem,
|
|
6569
|
-
Root: ToggleGroupRoot
|
|
5353
|
+
Root: ToggleGroupRoot,
|
|
5354
|
+
RootProvider: ToggleGroupRootProvider
|
|
6570
5355
|
});
|
|
6571
5356
|
|
|
6572
5357
|
const [TooltipProvider, useTooltipContext] = createContext({
|
|
@@ -6636,7 +5421,7 @@ const useTooltip = props => {
|
|
|
6636
5421
|
|
|
6637
5422
|
const TooltipRoot = props => {
|
|
6638
5423
|
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']);
|
|
5424
|
+
const [useTooltipProps, localProps] = createSplitProps()(tooltipProps, ['aria-label', 'closeDelay', 'closeOnEscape', 'closeOnPointerDown', 'closeOnScroll', 'defaultOpen', 'disabled', 'id', 'ids', 'interactive', 'onOpenChange', 'open', 'openDelay', 'positioning']);
|
|
6640
5425
|
const api = useTooltip(useTooltipProps);
|
|
6641
5426
|
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
6642
5427
|
present: api().open
|
|
@@ -6949,8 +5734,10 @@ exports.ColorPickerAreaBackground = ColorPickerAreaBackground;
|
|
|
6949
5734
|
exports.ColorPickerAreaThumb = ColorPickerAreaThumb;
|
|
6950
5735
|
exports.ColorPickerChannelInput = ColorPickerChannelInput;
|
|
6951
5736
|
exports.ColorPickerChannelSlider = ColorPickerChannelSlider;
|
|
5737
|
+
exports.ColorPickerChannelSliderLabel = ColorPickerChannelSliderLabel;
|
|
6952
5738
|
exports.ColorPickerChannelSliderThumb = ColorPickerChannelSliderThumb;
|
|
6953
5739
|
exports.ColorPickerChannelSliderTrack = ColorPickerChannelSliderTrack;
|
|
5740
|
+
exports.ColorPickerChannelSliderValueText = ColorPickerChannelSliderValueText;
|
|
6954
5741
|
exports.ColorPickerContent = ColorPickerContent;
|
|
6955
5742
|
exports.ColorPickerContext = ColorPickerContext;
|
|
6956
5743
|
exports.ColorPickerControl = ColorPickerControl;
|
|
@@ -6968,6 +5755,7 @@ exports.ColorPickerSwatchIndicator = ColorPickerSwatchIndicator;
|
|
|
6968
5755
|
exports.ColorPickerSwatchTrigger = ColorPickerSwatchTrigger;
|
|
6969
5756
|
exports.ColorPickerTransparencyGrid = ColorPickerTransparencyGrid;
|
|
6970
5757
|
exports.ColorPickerTrigger = ColorPickerTrigger;
|
|
5758
|
+
exports.ColorPickerValueSwatch = ColorPickerValueSwatch;
|
|
6971
5759
|
exports.ColorPickerValueText = ColorPickerValueText;
|
|
6972
5760
|
exports.ColorPickerView = ColorPickerView;
|
|
6973
5761
|
exports.Combobox = combobox;
|
|
@@ -7039,6 +5827,16 @@ exports.EditableRoot = EditableRoot;
|
|
|
7039
5827
|
exports.EditableRootProvider = EditableRootProvider;
|
|
7040
5828
|
exports.EditableSubmitTrigger = EditableSubmitTrigger;
|
|
7041
5829
|
exports.EnvironmentProvider = EnvironmentProvider;
|
|
5830
|
+
exports.Field = field;
|
|
5831
|
+
exports.FieldContext = FieldContext;
|
|
5832
|
+
exports.FieldErrorText = FieldErrorText;
|
|
5833
|
+
exports.FieldHelperText = FieldHelperText;
|
|
5834
|
+
exports.FieldInput = FieldInput;
|
|
5835
|
+
exports.FieldLabel = FieldLabel;
|
|
5836
|
+
exports.FieldRoot = FieldRoot;
|
|
5837
|
+
exports.FieldRootProvider = FieldRootProvider;
|
|
5838
|
+
exports.FieldSelect = FieldSelect;
|
|
5839
|
+
exports.FieldTextarea = FieldTextarea;
|
|
7042
5840
|
exports.FileUpload = fileUpload;
|
|
7043
5841
|
exports.FileUploadContext = FileUploadContext;
|
|
7044
5842
|
exports.FileUploadDropzone = FileUploadDropzone;
|
|
@@ -7206,6 +6004,7 @@ exports.SignaturePadClearTrigger = SignaturePadClearTrigger;
|
|
|
7206
6004
|
exports.SignaturePadContext = SignaturePadContext;
|
|
7207
6005
|
exports.SignaturePadControl = SignaturePadControl;
|
|
7208
6006
|
exports.SignaturePadGuide = SignaturePadGuide;
|
|
6007
|
+
exports.SignaturePadHiddenInput = SignaturePadHiddenInput;
|
|
7209
6008
|
exports.SignaturePadLabel = SignaturePadLabel;
|
|
7210
6009
|
exports.SignaturePadRoot = SignaturePadRoot;
|
|
7211
6010
|
exports.SignaturePadRootProvider = SignaturePadRootProvider;
|
|
@@ -7328,6 +6127,7 @@ exports.useDialogContext = useDialogContext;
|
|
|
7328
6127
|
exports.useEditable = useEditable;
|
|
7329
6128
|
exports.useEditableContext = useEditableContext;
|
|
7330
6129
|
exports.useEnvironmentContext = useEnvironmentContext;
|
|
6130
|
+
exports.useFieldContext = useFieldContext;
|
|
7331
6131
|
exports.useFileUpload = useFileUpload;
|
|
7332
6132
|
exports.useFileUploadContext = useFileUploadContext;
|
|
7333
6133
|
exports.useHoverCard = useHoverCard;
|