@ark-ui/solid 1.0.0-beta.3 → 1.0.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/CHANGELOG.md +14 -51
- package/cjs/index.js +604 -453
- package/cjs/index.js.map +1 -1
- package/esm/index.js +601 -455
- package/esm/index.js.map +1 -1
- package/package.json +42 -42
- package/source/accordion/accordion-item-content.jsx +6 -5
- package/source/accordion/accordion-item-trigger.jsx +4 -1
- package/source/accordion/accordion-item.jsx +10 -6
- package/source/accordion/accordion.jsx +8 -4
- package/source/avatar/avatar-fallback.jsx +2 -2
- package/source/avatar/avatar-image.jsx +2 -2
- package/source/avatar/avatar.jsx +2 -2
- package/source/carousel/carousel.jsx +6 -4
- package/source/checkbox/checkbox-label.jsx +2 -2
- package/source/color-picker/color-picker-content.jsx +6 -5
- package/source/color-picker/color-picker-positioner.jsx +6 -1
- package/source/color-picker/color-picker-view.jsx +13 -0
- package/source/color-picker/color-picker.jsx +8 -3
- package/source/color-picker/index.js +2 -0
- package/source/combobox/combobox-content.jsx +6 -5
- package/source/combobox/combobox-positioner.jsx +8 -3
- package/source/combobox/combobox.jsx +8 -3
- package/source/date-picker/date-picker-content.jsx +6 -5
- package/source/date-picker/date-picker-positioner.jsx +6 -1
- package/source/date-picker/date-picker.jsx +8 -3
- package/source/dialog/dialog-backdrop.jsx +7 -5
- package/source/dialog/dialog-close-trigger.jsx +2 -2
- package/source/dialog/dialog-content.jsx +6 -5
- package/source/dialog/dialog-description.jsx +2 -2
- package/source/dialog/dialog-positioner.jsx +8 -3
- package/source/dialog/dialog-title.jsx +2 -2
- package/source/dialog/dialog-trigger.jsx +6 -3
- package/source/dialog/dialog.jsx +11 -3
- package/source/editable/editable-area.jsx +2 -2
- package/source/editable/editable-cancel-trigger.jsx +2 -2
- package/source/editable/editable-control.jsx +2 -2
- package/source/editable/editable-edit-trigger.jsx +2 -2
- package/source/editable/editable-input.jsx +2 -2
- package/source/editable/editable-label.jsx +2 -2
- package/source/editable/editable-preview.jsx +2 -2
- package/source/editable/editable-submit-trigger.jsx +2 -2
- package/source/editable/editable.jsx +2 -2
- package/source/hover-card/hover-card-arrow-tip.jsx +2 -2
- package/source/hover-card/hover-card-arrow.jsx +2 -2
- package/source/hover-card/hover-card-content.jsx +6 -5
- package/source/hover-card/hover-card-positioner.jsx +8 -3
- package/source/hover-card/hover-card-trigger.jsx +2 -2
- package/source/hover-card/hover-card.jsx +9 -3
- package/source/menu/menu-arrow-tip.jsx +2 -2
- package/source/menu/menu-arrow.jsx +2 -2
- package/source/menu/menu-content.jsx +6 -5
- package/source/menu/menu-context-trigger.jsx +2 -2
- package/source/menu/menu-item-group.jsx +2 -2
- package/source/menu/menu-item.jsx +2 -2
- package/source/menu/menu-option-item.jsx +2 -2
- package/source/menu/menu-positioner.jsx +8 -3
- package/source/menu/menu-separator.jsx +2 -2
- package/source/menu/menu-trigger-item.jsx +2 -2
- package/source/menu/menu-trigger.jsx +6 -3
- package/source/menu/menu.jsx +11 -12
- package/source/number-input/number-input-control.jsx +2 -2
- package/source/number-input/number-input-decrement-trigger.jsx +2 -2
- package/source/number-input/number-input-field.jsx +2 -2
- package/source/number-input/number-input-increment-trigger.jsx +2 -2
- package/source/number-input/number-input-label.jsx +2 -2
- package/source/number-input/number-input-scrubber.jsx +2 -2
- package/source/number-input/number-input.jsx +2 -2
- package/source/pagination/pagination.jsx +2 -2
- package/source/pin-input/pin-input-field.jsx +2 -2
- package/source/pin-input/pin-input-label.jsx +2 -2
- package/source/popover/popover-anchor.jsx +2 -2
- package/source/popover/popover-arrow-tip.jsx +2 -2
- package/source/popover/popover-arrow.jsx +2 -2
- package/source/popover/popover-close-trigger.jsx +2 -2
- package/source/popover/popover-content.jsx +6 -5
- package/source/popover/popover-description.jsx +2 -2
- package/source/popover/popover-positioner.jsx +7 -2
- package/source/popover/popover-title.jsx +2 -2
- package/source/popover/popover-trigger.jsx +5 -2
- package/source/popover/popover.jsx +10 -2
- package/source/presence/index.js +4 -1
- package/source/presence/presence-context.js +5 -0
- package/source/presence/presence-props-context.js +5 -0
- package/source/presence/presence.jsx +9 -28
- package/source/presence/split-presence-props.js +0 -1
- package/source/presence/use-presence.js +21 -4
- package/source/rating-group/rating-group-item.jsx +5 -4
- package/source/select/select-content.jsx +6 -5
- package/source/select/select-positioner.jsx +6 -1
- package/source/select/select.jsx +8 -3
- package/source/slider/slider-thumb.jsx +2 -2
- package/source/slider/slider-value-text.jsx +3 -3
- package/source/splitter/splitter-panel.jsx +2 -2
- package/source/splitter/splitter-resize-trigger.jsx +2 -2
- package/source/splitter/splitter.jsx +2 -2
- package/source/switch/switch-label.jsx +2 -2
- package/source/switch/switch-thumb.jsx +2 -2
- package/source/tabs/tab-content.jsx +11 -8
- package/source/tabs/tab-indicator.jsx +2 -2
- package/source/tabs/tab-list.jsx +2 -2
- package/source/tabs/tab-trigger.jsx +2 -2
- package/source/tabs/tabs.jsx +7 -3
- package/source/toggle-group/toggle-group.jsx +2 -2
- package/source/tooltip/tooltip-arrow-tip.jsx +2 -2
- package/source/tooltip/tooltip-arrow.jsx +2 -2
- package/source/tooltip/tooltip-content.jsx +7 -6
- package/source/tooltip/tooltip-positioner.jsx +7 -2
- package/source/tooltip/tooltip-trigger.jsx +2 -2
- package/source/tooltip/tooltip.jsx +10 -2
- package/types/accordion/accordion-context.d.ts +3 -2
- package/types/accordion/accordion-item-content.d.ts +1 -3
- package/types/accordion/accordion-item-context.d.ts +3 -2
- package/types/accordion/accordion-item-indicator.d.ts +2 -1
- package/types/accordion/accordion-item-trigger.d.ts +2 -1
- package/types/accordion/accordion-item.d.ts +5 -4
- package/types/accordion/accordion.d.ts +3 -1
- package/types/accordion/use-accordion.d.ts +4 -2
- package/types/avatar/avatar-context.d.ts +3 -2
- package/types/avatar/avatar-fallback.d.ts +2 -1
- package/types/avatar/avatar-image.d.ts +2 -1
- package/types/avatar/avatar.d.ts +2 -1
- package/types/avatar/use-avatar.d.ts +4 -2
- package/types/carousel/carousel-context.d.ts +3 -2
- package/types/carousel/carousel-control.d.ts +2 -1
- package/types/carousel/carousel-indicator-group.d.ts +2 -1
- package/types/carousel/carousel-indicator.d.ts +2 -1
- package/types/carousel/carousel-next-trigger.d.ts +2 -1
- package/types/carousel/carousel-prev-trigger.d.ts +2 -1
- package/types/carousel/carousel-slide-group.d.ts +2 -1
- package/types/carousel/carousel-slide.d.ts +2 -1
- package/types/carousel/carousel-viewport.d.ts +2 -1
- package/types/carousel/carousel.d.ts +7 -3
- package/types/carousel/use-carousel.d.ts +4 -2
- package/types/checkbox/checkbox-context.d.ts +3 -2
- package/types/checkbox/checkbox-control.d.ts +2 -1
- package/types/checkbox/checkbox-indicator.d.ts +2 -1
- package/types/checkbox/checkbox-label.d.ts +2 -1
- package/types/checkbox/checkbox.d.ts +5 -5
- package/types/checkbox/use-checkbox.d.ts +4 -2
- package/types/color-picker/color-picker-content.d.ts +1 -3
- package/types/color-picker/color-picker-view.d.ts +7 -0
- package/types/color-picker/color-picker.d.ts +5 -3
- package/types/color-picker/index.d.ts +3 -1
- package/types/combobox/combobox-clear-trigger.d.ts +2 -1
- package/types/combobox/combobox-content.d.ts +1 -3
- package/types/combobox/combobox-context.d.ts +2 -1
- package/types/combobox/combobox-control.d.ts +2 -1
- package/types/combobox/combobox-input.d.ts +2 -1
- package/types/combobox/combobox-item-context.d.ts +3 -2
- package/types/combobox/combobox-item-group.d.ts +2 -1
- package/types/combobox/combobox-item-indicator.d.ts +2 -1
- package/types/combobox/combobox-item-text.d.ts +2 -1
- package/types/combobox/combobox-item.d.ts +5 -4
- package/types/combobox/combobox-label.d.ts +2 -1
- package/types/combobox/combobox-positioner.d.ts +2 -1
- package/types/combobox/combobox-trigger.d.ts +2 -1
- package/types/combobox/combobox.d.ts +7 -6
- package/types/combobox/use-combobox.d.ts +2 -1
- package/types/date-picker/date-picker-content.d.ts +1 -3
- package/types/date-picker/date-picker-context.d.ts +3 -2
- package/types/date-picker/date-picker-view.d.ts +4 -3
- package/types/date-picker/date-picker.d.ts +5 -3
- package/types/dialog/dialog-backdrop.d.ts +1 -3
- package/types/dialog/dialog-close-trigger.d.ts +2 -1
- package/types/dialog/dialog-content.d.ts +1 -3
- package/types/dialog/dialog-context.d.ts +3 -2
- package/types/dialog/dialog-description.d.ts +2 -1
- package/types/dialog/dialog-positioner.d.ts +2 -1
- package/types/dialog/dialog-title.d.ts +2 -1
- package/types/dialog/dialog-trigger.d.ts +2 -1
- package/types/dialog/dialog.d.ts +4 -3
- package/types/dialog/use-dialog.d.ts +4 -2
- package/types/editable/editable-area.d.ts +2 -1
- package/types/editable/editable-cancel-trigger.d.ts +2 -1
- package/types/editable/editable-context.d.ts +3 -2
- package/types/editable/editable-control.d.ts +2 -1
- package/types/editable/editable-edit-trigger.d.ts +2 -1
- package/types/editable/editable-input.d.ts +2 -1
- package/types/editable/editable-label.d.ts +2 -1
- package/types/editable/editable-preview.d.ts +2 -1
- package/types/editable/editable-submit-trigger.d.ts +2 -1
- package/types/editable/editable.d.ts +5 -5
- package/types/editable/use-editable.d.ts +4 -2
- package/types/environment/environment.d.ts +2 -2
- package/types/hover-card/hover-card-arrow-tip.d.ts +2 -1
- package/types/hover-card/hover-card-arrow.d.ts +2 -1
- package/types/hover-card/hover-card-content.d.ts +1 -3
- package/types/hover-card/hover-card-context.d.ts +3 -2
- package/types/hover-card/hover-card-positioner.d.ts +2 -1
- package/types/hover-card/hover-card-trigger.d.ts +2 -1
- package/types/hover-card/hover-card.d.ts +4 -3
- package/types/hover-card/use-hover-card.d.ts +4 -2
- package/types/menu/menu-arrow-tip.d.ts +2 -1
- package/types/menu/menu-arrow.d.ts +2 -1
- package/types/menu/menu-content.d.ts +1 -3
- package/types/menu/menu-context-trigger.d.ts +2 -1
- package/types/menu/menu-item-group.d.ts +2 -1
- package/types/menu/menu-item.d.ts +2 -1
- package/types/menu/menu-option-item.d.ts +3 -2
- package/types/menu/menu-positioner.d.ts +2 -1
- package/types/menu/menu-separator.d.ts +2 -1
- package/types/menu/menu-trigger-item.d.ts +2 -1
- package/types/menu/menu-trigger.d.ts +2 -1
- package/types/menu/menu.d.ts +6 -9
- package/types/menu/use-menu.d.ts +2 -1
- package/types/number-input/number-input-context.d.ts +3 -2
- package/types/number-input/number-input-control.d.ts +2 -1
- package/types/number-input/number-input-decrement-trigger.d.ts +2 -1
- package/types/number-input/number-input-field.d.ts +2 -1
- package/types/number-input/number-input-increment-trigger.d.ts +2 -1
- package/types/number-input/number-input-label.d.ts +2 -1
- package/types/number-input/number-input-scrubber.d.ts +2 -1
- package/types/number-input/number-input.d.ts +2 -1
- package/types/number-input/use-number-input.d.ts +4 -2
- package/types/pagination/pagination-context.d.ts +3 -2
- package/types/pagination/pagination-ellipsis.d.ts +2 -1
- package/types/pagination/pagination-item.d.ts +2 -1
- package/types/pagination/pagination.d.ts +4 -3
- package/types/pagination/use-pagination.d.ts +4 -2
- package/types/pin-input/pin-input-context.d.ts +3 -2
- package/types/pin-input/pin-input-control.d.ts +2 -1
- package/types/pin-input/pin-input-field.d.ts +3 -2
- package/types/pin-input/pin-input-label.d.ts +2 -1
- package/types/pin-input/pin-input.d.ts +2 -1
- package/types/pin-input/use-pin-input.d.ts +4 -2
- package/types/popover/popover-anchor.d.ts +2 -1
- package/types/popover/popover-arrow-tip.d.ts +2 -1
- package/types/popover/popover-arrow.d.ts +2 -1
- package/types/popover/popover-close-trigger.d.ts +2 -1
- package/types/popover/popover-content.d.ts +1 -3
- package/types/popover/popover-context.d.ts +3 -2
- package/types/popover/popover-description.d.ts +2 -1
- package/types/popover/popover-indicator.d.ts +2 -1
- package/types/popover/popover-positioner.d.ts +2 -1
- package/types/popover/popover-title.d.ts +2 -1
- package/types/popover/popover-trigger.d.ts +2 -1
- package/types/popover/popover.d.ts +5 -4
- package/types/popover/use-popover.d.ts +4 -2
- package/types/presence/index.d.ts +5 -2
- package/types/presence/presence-context.d.ts +4 -0
- package/types/presence/presence-props-context.d.ts +4 -0
- package/types/presence/presence.d.ts +3 -18
- package/types/presence/split-presence-props.d.ts +2 -2
- package/types/presence/use-presence.d.ts +23 -2
- package/types/radio-group/radio-group-context.d.ts +3 -2
- package/types/radio-group/radio-group-indicator.d.ts +2 -1
- package/types/radio-group/radio-group-item-context.d.ts +3 -2
- package/types/radio-group/radio-group-item-control.d.ts +2 -1
- package/types/radio-group/radio-group-item-text.d.ts +2 -1
- package/types/radio-group/radio-group-item.d.ts +2 -1
- package/types/radio-group/radio-group-label.d.ts +2 -1
- package/types/radio-group/radio-group.d.ts +2 -1
- package/types/radio-group/use-radio-group.d.ts +4 -2
- package/types/rating-group/rating-group-context.d.ts +3 -2
- package/types/rating-group/rating-group-control.d.ts +6 -5
- package/types/rating-group/rating-group-item-context.d.ts +4 -2
- package/types/rating-group/rating-group-item.d.ts +6 -6
- package/types/rating-group/rating-group-label.d.ts +2 -1
- package/types/rating-group/rating-group.d.ts +2 -1
- package/types/rating-group/use-rating-group.d.ts +4 -2
- package/types/segment-group/segment-group-context.d.ts +3 -2
- package/types/segment-group/segment-group-indicator.d.ts +2 -1
- package/types/segment-group/segment-group-item-control.d.ts +2 -1
- package/types/segment-group/segment-group-item-text.d.ts +2 -1
- package/types/segment-group/segment-group-item.d.ts +2 -1
- package/types/segment-group/segment-group-label.d.ts +2 -1
- package/types/segment-group/segment-group.d.ts +2 -1
- package/types/segment-group/use-segment-group.d.ts +4 -2
- package/types/select/select-clear-trigger.d.ts +2 -1
- package/types/select/select-content.d.ts +1 -3
- package/types/select/select-context.d.ts +2 -1
- package/types/select/select-control.d.ts +2 -1
- package/types/select/select-indicator.d.ts +2 -1
- package/types/select/select-item-context.d.ts +2 -1
- package/types/select/select-item-group.d.ts +2 -1
- package/types/select/select-item-indicator.d.ts +2 -1
- package/types/select/select-item-text.d.ts +2 -1
- package/types/select/select-item.d.ts +5 -4
- package/types/select/select-label.d.ts +2 -1
- package/types/select/select-positioner.d.ts +2 -1
- package/types/select/select-trigger.d.ts +2 -1
- package/types/select/select.d.ts +7 -6
- package/types/select/use-select.d.ts +2 -1
- package/types/slider/slider-context.d.ts +3 -2
- package/types/slider/slider-control.d.ts +2 -1
- package/types/slider/slider-label.d.ts +2 -1
- package/types/slider/slider-marker-group.d.ts +2 -1
- package/types/slider/slider-marker.d.ts +2 -1
- package/types/slider/slider-range.d.ts +2 -1
- package/types/slider/slider-thumb.d.ts +2 -1
- package/types/slider/slider-track.d.ts +2 -1
- package/types/slider/slider-value-text.d.ts +3 -7
- package/types/slider/slider.d.ts +4 -3
- package/types/slider/use-slider.d.ts +4 -2
- package/types/splitter/splitter-context.d.ts +3 -2
- package/types/splitter/splitter-panel.d.ts +2 -1
- package/types/splitter/splitter-resize-trigger.d.ts +2 -1
- package/types/splitter/splitter.d.ts +4 -3
- package/types/splitter/use-splitter.d.ts +4 -2
- package/types/switch/switch-context.d.ts +3 -2
- package/types/switch/switch-control.d.ts +2 -1
- package/types/switch/switch-label.d.ts +2 -1
- package/types/switch/switch-thumb.d.ts +2 -1
- package/types/switch/switch.d.ts +5 -5
- package/types/switch/use-switch.d.ts +4 -2
- package/types/tabs/tab-content.d.ts +2 -2
- package/types/tabs/tab-indicator.d.ts +2 -1
- package/types/tabs/tab-list.d.ts +2 -1
- package/types/tabs/tab-trigger.d.ts +2 -1
- package/types/tabs/tabs-context.d.ts +3 -2
- package/types/tabs/tabs.d.ts +3 -1
- package/types/tabs/use-tabs.d.ts +4 -2
- package/types/tags-input/tags-input-clear-trigger.d.ts +2 -1
- package/types/tags-input/tags-input-context.d.ts +3 -2
- package/types/tags-input/tags-input-control.d.ts +2 -1
- package/types/tags-input/tags-input-input.d.ts +2 -1
- package/types/tags-input/tags-input-item-context.d.ts +3 -2
- package/types/tags-input/tags-input-item-delete-trigger.d.ts +2 -1
- package/types/tags-input/tags-input-item-input.d.ts +2 -1
- package/types/tags-input/tags-input-item-text.d.ts +2 -1
- package/types/tags-input/tags-input-item.d.ts +5 -4
- package/types/tags-input/tags-input-label.d.ts +2 -1
- package/types/tags-input/tags-input.d.ts +5 -5
- package/types/tags-input/use-tags-input.d.ts +4 -2
- package/types/toast/toast-close-trigger.d.ts +2 -1
- package/types/toast/toast-description.d.ts +2 -1
- package/types/toast/toast-title.d.ts +2 -1
- package/types/toast/toast.d.ts +2 -1
- package/types/toggle-group/toggle-group-context.d.ts +3 -2
- package/types/toggle-group/toggle-group.d.ts +2 -1
- package/types/toggle-group/use-toggle-group.d.ts +4 -2
- package/types/tooltip/tooltip-arrow-tip.d.ts +2 -1
- package/types/tooltip/tooltip-arrow.d.ts +2 -1
- package/types/tooltip/tooltip-content.d.ts +1 -3
- package/types/tooltip/tooltip-context.d.ts +3 -2
- package/types/tooltip/tooltip-positioner.d.ts +2 -1
- package/types/tooltip/tooltip-trigger.d.ts +2 -1
- package/types/tooltip/tooltip.d.ts +6 -5
- package/types/tooltip/use-tooltip.d.ts +4 -2
- package/source/tabs/tab-presence.jsx +0 -6
- package/types/tabs/tab-presence.d.ts +0 -4
- /package/source/date-picker/{use-date-picker.jsx → use-date-picker.js} +0 -0
- /package/source/radio-group/{use-radio-group.jsx → use-radio-group.js} +0 -0
- /package/source/rating-group/{use-rating-group.jsx → use-rating-group.js} +0 -0
- /package/source/segment-group/{use-segment-group.jsx → use-segment-group.js} +0 -0
package/cjs/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var web = require('solid-js/web');
|
|
4
4
|
var solid = require('@zag-js/solid');
|
|
5
5
|
var solidJs = require('solid-js');
|
|
6
|
-
var accordion = require('@zag-js/accordion');
|
|
7
6
|
var presence = require('@zag-js/presence');
|
|
7
|
+
var accordion = require('@zag-js/accordion');
|
|
8
8
|
var avatar = require('@zag-js/avatar');
|
|
9
9
|
var carousel = require('@zag-js/carousel');
|
|
10
10
|
var anatomy = require('@ark-ui/anatomy');
|
|
@@ -49,8 +49,8 @@ function _interopNamespaceDefault(e) {
|
|
|
49
49
|
return Object.freeze(n);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
var accordion__namespace = /*#__PURE__*/_interopNamespaceDefault(accordion);
|
|
53
52
|
var presence__namespace = /*#__PURE__*/_interopNamespaceDefault(presence);
|
|
53
|
+
var accordion__namespace = /*#__PURE__*/_interopNamespaceDefault(accordion);
|
|
54
54
|
var avatar__namespace = /*#__PURE__*/_interopNamespaceDefault(avatar);
|
|
55
55
|
var carousel__namespace = /*#__PURE__*/_interopNamespaceDefault(carousel);
|
|
56
56
|
var checkbox__namespace = /*#__PURE__*/_interopNamespaceDefault(checkbox);
|
|
@@ -441,6 +441,49 @@ function jsxFactory() {
|
|
|
441
441
|
}
|
|
442
442
|
const ark = jsxFactory();
|
|
443
443
|
|
|
444
|
+
function splitPresenceProps(props) {
|
|
445
|
+
return createSplitProps()(props, ['lazyMount', 'onExitComplete', 'present', 'unmountOnExit']);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
const usePresence = props => {
|
|
449
|
+
const [localProps, machineProps] = solidJs.splitProps(props, ['lazyMount', 'unmountOnExit']);
|
|
450
|
+
const [wasEverPresent, setWasEverPresent] = solidJs.createSignal(false);
|
|
451
|
+
const [state, send] = solid.useMachine(presence__namespace.machine(machineProps), {
|
|
452
|
+
context: machineProps
|
|
453
|
+
});
|
|
454
|
+
const api = solidJs.createMemo(() => presence__namespace.connect(state, send, solid.normalizeProps));
|
|
455
|
+
solidJs.createEffect(() => {
|
|
456
|
+
const isPresent = api().isPresent;
|
|
457
|
+
if (isPresent) setWasEverPresent(true);
|
|
458
|
+
});
|
|
459
|
+
return solidJs.createMemo(() => ({
|
|
460
|
+
isUnmounted: !api().isPresent && !wasEverPresent() && localProps.lazyMount || localProps.unmountOnExit && !api().isPresent && wasEverPresent(),
|
|
461
|
+
isPresent: api().isPresent,
|
|
462
|
+
presenceProps: {
|
|
463
|
+
ref: api().setNode,
|
|
464
|
+
hidden: !api().isPresent,
|
|
465
|
+
'data-state': machineProps.present ? 'open' : 'closed'
|
|
466
|
+
}
|
|
467
|
+
}));
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
const Presence$1 = props => {
|
|
471
|
+
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
472
|
+
const api = usePresence(presenceProps);
|
|
473
|
+
const mergedProps = solid.mergeProps(() => api().presenceProps, localProps);
|
|
474
|
+
return web.createComponent(solidJs.Show, {
|
|
475
|
+
get when() {
|
|
476
|
+
return !api().isUnmounted;
|
|
477
|
+
},
|
|
478
|
+
get children() {
|
|
479
|
+
return web.createComponent(ark.div, web.mergeProps(mergedProps, {
|
|
480
|
+
"data-scope": "presence",
|
|
481
|
+
"data-part": "root"
|
|
482
|
+
}));
|
|
483
|
+
}
|
|
484
|
+
});
|
|
485
|
+
};
|
|
486
|
+
|
|
444
487
|
function getErrorMessage(hook, provider) {
|
|
445
488
|
return `${hook} returned \`undefined\`. Seems you forgot to wrap component within ${provider}`;
|
|
446
489
|
}
|
|
@@ -465,6 +508,20 @@ function createContext(options = {}) {
|
|
|
465
508
|
return [Context.Provider, useContext, Context];
|
|
466
509
|
}
|
|
467
510
|
|
|
511
|
+
const [PresenceProvider, usePresenceContext] = createContext({
|
|
512
|
+
hookName: 'usePresenceContext',
|
|
513
|
+
providerName: '<PresenceProvider />'
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
const [PresencePropsProvider, usePresencePropsContext] = createContext({
|
|
517
|
+
hookName: 'usePresencePropsContext',
|
|
518
|
+
providerName: '<PresencePropsProvider />'
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
const Presence = Object.assign(Presence$1, {
|
|
522
|
+
Root: Presence$1
|
|
523
|
+
});
|
|
524
|
+
|
|
468
525
|
const [AccordionProvider, useAccordionContext] = createContext({
|
|
469
526
|
hookName: 'useAccordionContext',
|
|
470
527
|
providerName: '<AccordionProvider />'
|
|
@@ -476,7 +533,7 @@ const [EnvironmentProvider, useEnvironmentContext] = createContext({
|
|
|
476
533
|
strict: false
|
|
477
534
|
});
|
|
478
535
|
|
|
479
|
-
const _tmpl$$
|
|
536
|
+
const _tmpl$$b = /*#__PURE__*/web.template(`<span hidden>`);
|
|
480
537
|
const Environment$1 = props => {
|
|
481
538
|
// eslint-disable-next-line prefer-const
|
|
482
539
|
let spanRef = undefined;
|
|
@@ -487,7 +544,7 @@ const Environment$1 = props => {
|
|
|
487
544
|
},
|
|
488
545
|
get children() {
|
|
489
546
|
return [web.memo(() => props.children), web.memo(() => web.memo(() => !!!props.value)() && (() => {
|
|
490
|
-
const _el$ = _tmpl$$
|
|
547
|
+
const _el$ = _tmpl$$b();
|
|
491
548
|
const _ref$ = spanRef;
|
|
492
549
|
typeof _ref$ === "function" ? web.use(_ref$, _el$) : spanRef = _el$;
|
|
493
550
|
return _el$;
|
|
@@ -513,13 +570,19 @@ const useAccordion = props => {
|
|
|
513
570
|
};
|
|
514
571
|
|
|
515
572
|
const Accordion$1 = props => {
|
|
516
|
-
const [
|
|
517
|
-
const
|
|
518
|
-
const
|
|
573
|
+
const [presenceProps, accordionProps] = splitPresenceProps(props);
|
|
574
|
+
const [useAccordionProps, localProps] = createSplitProps()(accordionProps, ['collapsible', 'dir', 'disabled', 'getRootNode', 'id', 'ids', 'multiple', 'onFocusChange', 'onValueChange', 'orientation', 'value']);
|
|
575
|
+
const api = useAccordion(useAccordionProps);
|
|
576
|
+
const mergedProps = solid.mergeProps(() => api().rootProps, localProps);
|
|
519
577
|
return web.createComponent(AccordionProvider, {
|
|
520
578
|
value: api,
|
|
521
579
|
get children() {
|
|
522
|
-
return web.createComponent(
|
|
580
|
+
return web.createComponent(PresencePropsProvider, {
|
|
581
|
+
value: presenceProps,
|
|
582
|
+
get children() {
|
|
583
|
+
return web.createComponent(ark.div, mergedProps);
|
|
584
|
+
}
|
|
585
|
+
});
|
|
523
586
|
}
|
|
524
587
|
});
|
|
525
588
|
};
|
|
@@ -533,83 +596,44 @@ const [AccordionItemProvider, useAccordionItemContext] = createContext({
|
|
|
533
596
|
});
|
|
534
597
|
|
|
535
598
|
const AccordionItem = props => {
|
|
536
|
-
const [itemProps,
|
|
599
|
+
const [itemProps, localProps] = createSplitProps()(props, ['value', 'disabled']);
|
|
537
600
|
const api = useAccordionContext();
|
|
538
|
-
const
|
|
539
|
-
const
|
|
540
|
-
|
|
601
|
+
const presenceProps = usePresencePropsContext();
|
|
602
|
+
const presenceApi = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
603
|
+
present: api().getItemState(itemProps).isOpen
|
|
604
|
+
})));
|
|
605
|
+
const mergedProps = solid.mergeProps(() => api().getItemProps(itemProps), localProps);
|
|
606
|
+
const getChildren = () => runIfFn(localProps.children, () => api().getItemState(itemProps));
|
|
541
607
|
return web.createComponent(AccordionItemProvider, {
|
|
542
|
-
value:
|
|
608
|
+
value: itemProps,
|
|
543
609
|
get children() {
|
|
544
|
-
return web.createComponent(
|
|
610
|
+
return web.createComponent(PresenceProvider, {
|
|
611
|
+
value: presenceApi,
|
|
545
612
|
get children() {
|
|
546
|
-
return
|
|
613
|
+
return web.createComponent(ark.div, web.mergeProps(mergedProps, {
|
|
614
|
+
get children() {
|
|
615
|
+
return getChildren();
|
|
616
|
+
}
|
|
617
|
+
}));
|
|
547
618
|
}
|
|
548
|
-
}));
|
|
549
|
-
}
|
|
550
|
-
});
|
|
551
|
-
};
|
|
552
|
-
|
|
553
|
-
const usePresence = props => {
|
|
554
|
-
const [state, send] = solid.useMachine(presence__namespace.machine(props), {
|
|
555
|
-
context: props
|
|
556
|
-
});
|
|
557
|
-
return solidJs.createMemo(() => presence__namespace.connect(state, send, solid.normalizeProps));
|
|
558
|
-
};
|
|
559
|
-
|
|
560
|
-
const Presence$1 = props => {
|
|
561
|
-
const [presenceProps, localProps] = createSplitProps()(props, ['onExitComplete', 'present']);
|
|
562
|
-
const api = usePresence(presenceProps);
|
|
563
|
-
const [wasEverPresent, setWasEverPresent] = solidJs.createSignal(false);
|
|
564
|
-
const getChildren = solidJs.children(() => props.children);
|
|
565
|
-
solidJs.createEffect(() => {
|
|
566
|
-
const isPresent = api().isPresent;
|
|
567
|
-
if (isPresent) setWasEverPresent(true);
|
|
568
|
-
const children = getChildren();
|
|
569
|
-
if (children instanceof HTMLElement) {
|
|
570
|
-
api().setNode(children);
|
|
571
|
-
web.spread(children, {
|
|
572
|
-
['data-state']: presenceProps.present ? 'open' : 'closed',
|
|
573
|
-
hidden: !api().isPresent
|
|
574
619
|
});
|
|
575
620
|
}
|
|
576
621
|
});
|
|
577
|
-
return web.memo((() => {
|
|
578
|
-
const _c$ = web.memo(() => !!(!api().isPresent && !wasEverPresent() && localProps.lazyMount || localProps.unmountOnExit && !api().isPresent && wasEverPresent()));
|
|
579
|
-
return () => _c$() ? localProps.fallback : getChildren();
|
|
580
|
-
})());
|
|
581
622
|
};
|
|
582
623
|
|
|
583
|
-
function splitPresenceProps(props) {
|
|
584
|
-
return createSplitProps()(props, ['fallback', 'lazyMount', 'onExitComplete', 'present', 'unmountOnExit']);
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
const Presence = Object.assign(Presence$1, {
|
|
588
|
-
Root: Presence$1
|
|
589
|
-
});
|
|
590
|
-
|
|
591
|
-
const _tmpl$$l = /*#__PURE__*/web.template(`<div>`);
|
|
592
624
|
const AccordionItemContent = props => {
|
|
593
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
594
625
|
const api = useAccordionContext();
|
|
595
626
|
const accordionItem = useAccordionItemContext();
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
}, presenceProps, {
|
|
602
|
-
get fallback() {
|
|
603
|
-
return (() => {
|
|
604
|
-
const _el$ = _tmpl$$l();
|
|
605
|
-
web.spread(_el$, web.mergeProps(() => api().getItemContentProps(accordionItem)), false, false);
|
|
606
|
-
return _el$;
|
|
607
|
-
})();
|
|
627
|
+
const presenceApi = usePresenceContext();
|
|
628
|
+
const mergedProps = solid.mergeProps(() => api().getItemContentProps(accordionItem), () => presenceApi().presenceProps, props);
|
|
629
|
+
return web.createComponent(solidJs.Show, {
|
|
630
|
+
get when() {
|
|
631
|
+
return !presenceApi().isUnmounted;
|
|
608
632
|
},
|
|
609
633
|
get children() {
|
|
610
634
|
return web.createComponent(ark.div, mergedProps);
|
|
611
635
|
}
|
|
612
|
-
})
|
|
636
|
+
});
|
|
613
637
|
};
|
|
614
638
|
|
|
615
639
|
const AccordionItemIndicator = props => {
|
|
@@ -622,7 +646,12 @@ const AccordionItemIndicator = props => {
|
|
|
622
646
|
const AccordionItemTrigger = props => {
|
|
623
647
|
const api = useAccordionContext();
|
|
624
648
|
const item = useAccordionItemContext();
|
|
625
|
-
const
|
|
649
|
+
const presenceApi = usePresenceContext();
|
|
650
|
+
const mergedProps = solid.mergeProps(() => api().getItemTriggerProps(item), () => ({
|
|
651
|
+
'aria-controls': presenceApi().isUnmounted && null
|
|
652
|
+
}), props);
|
|
653
|
+
|
|
654
|
+
// @ts-expect-error we want aria-controls to be null to remove them if the popover if lazy mounted
|
|
626
655
|
return web.createComponent(ark.button, mergedProps);
|
|
627
656
|
};
|
|
628
657
|
|
|
@@ -654,25 +683,25 @@ const useAvatar = props => {
|
|
|
654
683
|
const Avatar$1 = props => {
|
|
655
684
|
const [params, localProps] = createSplitProps()(props, ['dir', 'getRootNode', 'id', 'onLoadingStatusChange']);
|
|
656
685
|
const api = useAvatar(params);
|
|
657
|
-
const
|
|
686
|
+
const mergedProps = solid.mergeProps(() => api().rootProps, localProps);
|
|
658
687
|
return web.createComponent(AvatarProvider, {
|
|
659
688
|
value: api,
|
|
660
689
|
get children() {
|
|
661
|
-
return web.createComponent(ark.div,
|
|
690
|
+
return web.createComponent(ark.div, mergedProps);
|
|
662
691
|
}
|
|
663
692
|
});
|
|
664
693
|
};
|
|
665
694
|
|
|
666
695
|
const AvatarFallback = props => {
|
|
667
696
|
const avatar = useAvatarContext();
|
|
668
|
-
const
|
|
669
|
-
return web.createComponent(ark.span,
|
|
697
|
+
const mergedProps = solid.mergeProps(() => avatar().fallbackProps, props);
|
|
698
|
+
return web.createComponent(ark.span, mergedProps);
|
|
670
699
|
};
|
|
671
700
|
|
|
672
701
|
const AvatarImage = props => {
|
|
673
702
|
const avatar = useAvatarContext();
|
|
674
|
-
const
|
|
675
|
-
return web.createComponent(ark.img,
|
|
703
|
+
const mergedProps = solid.mergeProps(() => avatar().imageProps, props);
|
|
704
|
+
return web.createComponent(ark.img, mergedProps);
|
|
676
705
|
};
|
|
677
706
|
|
|
678
707
|
const Avatar = Object.assign(Avatar$1, {
|
|
@@ -700,12 +729,17 @@ const useCarousel = props => {
|
|
|
700
729
|
|
|
701
730
|
const Carousel$1 = props => {
|
|
702
731
|
const [useCarouselProps, localProps] = createSplitProps()(props, ['align', 'dir', 'getRootNode', 'id', 'ids', 'index', 'loop', 'onIndexChange', 'orientation', 'slidesPerView', 'spacing']);
|
|
703
|
-
const
|
|
704
|
-
const
|
|
732
|
+
const api = useCarousel(useCarouselProps);
|
|
733
|
+
const mergedProps = solid.mergeProps(() => api().rootProps, localProps);
|
|
734
|
+
const getChildren = () => runIfFn(localProps.children, api);
|
|
705
735
|
return web.createComponent(CarouselProvider, {
|
|
706
|
-
value:
|
|
736
|
+
value: api,
|
|
707
737
|
get children() {
|
|
708
|
-
return web.createComponent(ark.div,
|
|
738
|
+
return web.createComponent(ark.div, web.mergeProps(mergedProps, {
|
|
739
|
+
get children() {
|
|
740
|
+
return getChildren();
|
|
741
|
+
}
|
|
742
|
+
}));
|
|
709
743
|
}
|
|
710
744
|
});
|
|
711
745
|
};
|
|
@@ -805,12 +839,12 @@ const Checkbox$1 = props => {
|
|
|
805
839
|
});
|
|
806
840
|
};
|
|
807
841
|
|
|
808
|
-
const _tmpl$$
|
|
842
|
+
const _tmpl$$a = /*#__PURE__*/web.template(`<input>`);
|
|
809
843
|
const CheckboxControl = props => {
|
|
810
844
|
const api = useCheckboxContext();
|
|
811
845
|
const mergedProps = solid.mergeProps(() => api().controlProps, props);
|
|
812
846
|
return [web.createComponent(ark.div, mergedProps), (() => {
|
|
813
|
-
const _el$ = _tmpl$$
|
|
847
|
+
const _el$ = _tmpl$$a();
|
|
814
848
|
web.spread(_el$, web.mergeProps(() => api().hiddenInputProps), false, false);
|
|
815
849
|
return _el$;
|
|
816
850
|
})()];
|
|
@@ -824,8 +858,8 @@ const CheckboxIndicator = props => {
|
|
|
824
858
|
|
|
825
859
|
const CheckboxLabel = props => {
|
|
826
860
|
const checkbox = useCheckboxContext();
|
|
827
|
-
const
|
|
828
|
-
return web.createComponent(ark.span,
|
|
861
|
+
const mergedProps = solid.mergeProps(() => checkbox().labelProps, props);
|
|
862
|
+
return web.createComponent(ark.span, mergedProps);
|
|
829
863
|
};
|
|
830
864
|
|
|
831
865
|
const Checkbox = Object.assign(Checkbox$1, {
|
|
@@ -854,21 +888,30 @@ const useColorPicker = props => {
|
|
|
854
888
|
return solidJs.createMemo(() => colorPicker__namespace.connect(state, send, solid.normalizeProps));
|
|
855
889
|
};
|
|
856
890
|
|
|
857
|
-
const _tmpl$$
|
|
891
|
+
const _tmpl$$9 = /*#__PURE__*/web.template(`<input>`);
|
|
858
892
|
const ColorPicker$1 = props => {
|
|
859
|
-
const [
|
|
860
|
-
const
|
|
893
|
+
const [presenceProps, colorPickerProps] = splitPresenceProps(props);
|
|
894
|
+
const [useColorPickerProps, localProps] = createSplitProps()(colorPickerProps, ['autoFocus', 'dir', 'disabled', 'getRootNode', 'id', 'ids', 'initialFocusEl', 'name', 'name', 'onFocusOutside', 'onInteractOutside', 'onOpenChange', 'onPointerDownOutside', 'onValueChange', 'onValueChangeEnd', 'open', 'positioning', 'readOnly', 'value']);
|
|
895
|
+
const api = useColorPicker(useColorPickerProps);
|
|
896
|
+
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
897
|
+
present: api().isOpen
|
|
898
|
+
})));
|
|
861
899
|
const mergedProps = solid.mergeProps(() => api().rootProps, localProps);
|
|
862
900
|
const getChildren = () => runIfFn(localProps.children, api);
|
|
863
901
|
return web.createComponent(ColorPickerProvider, {
|
|
864
902
|
value: api,
|
|
865
903
|
get children() {
|
|
866
|
-
return [web.createComponent(
|
|
904
|
+
return [web.createComponent(PresenceProvider, {
|
|
905
|
+
value: apiPresence,
|
|
867
906
|
get children() {
|
|
868
|
-
return
|
|
907
|
+
return web.createComponent(ark.div, web.mergeProps(mergedProps, {
|
|
908
|
+
get children() {
|
|
909
|
+
return getChildren();
|
|
910
|
+
}
|
|
911
|
+
}));
|
|
869
912
|
}
|
|
870
|
-
})
|
|
871
|
-
const _el$ = _tmpl$$
|
|
913
|
+
}), (() => {
|
|
914
|
+
const _el$ = _tmpl$$9();
|
|
872
915
|
web.spread(_el$, web.mergeProps(() => api().hiddenInputProps), false, false);
|
|
873
916
|
return _el$;
|
|
874
917
|
})()];
|
|
@@ -945,27 +988,18 @@ const ColorPickerChannelSliderTrack = props => {
|
|
|
945
988
|
return web.createComponent(ark.div, mergedProps);
|
|
946
989
|
};
|
|
947
990
|
|
|
948
|
-
const _tmpl$$i = /*#__PURE__*/web.template(`<div>`);
|
|
949
991
|
const ColorPickerContent = props => {
|
|
950
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
951
992
|
const api = useColorPickerContext();
|
|
952
|
-
const
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
}, presenceProps, {
|
|
958
|
-
get fallback() {
|
|
959
|
-
return (() => {
|
|
960
|
-
const _el$ = _tmpl$$i();
|
|
961
|
-
web.spread(_el$, web.mergeProps(() => api().contentProps), false, false);
|
|
962
|
-
return _el$;
|
|
963
|
-
})();
|
|
993
|
+
const presenceApi = usePresenceContext();
|
|
994
|
+
const mergedProps = solid.mergeProps(() => api().contentProps, () => presenceApi().presenceProps, props);
|
|
995
|
+
return web.createComponent(solidJs.Show, {
|
|
996
|
+
get when() {
|
|
997
|
+
return !presenceApi().isUnmounted;
|
|
964
998
|
},
|
|
965
999
|
get children() {
|
|
966
1000
|
return web.createComponent(ark.div, mergedProps);
|
|
967
1001
|
}
|
|
968
|
-
})
|
|
1002
|
+
});
|
|
969
1003
|
};
|
|
970
1004
|
|
|
971
1005
|
const ColorPickerControl = props => {
|
|
@@ -988,8 +1022,16 @@ const ColorPickerLabel = props => {
|
|
|
988
1022
|
|
|
989
1023
|
const ColorPickerPositioner = props => {
|
|
990
1024
|
const api = useColorPickerContext();
|
|
1025
|
+
const presenceApi = usePresenceContext();
|
|
991
1026
|
const mergedProps = solid.mergeProps(() => api().positionerProps, props);
|
|
992
|
-
return web.createComponent(
|
|
1027
|
+
return web.createComponent(solidJs.Show, {
|
|
1028
|
+
get when() {
|
|
1029
|
+
return !presenceApi().isUnmounted;
|
|
1030
|
+
},
|
|
1031
|
+
get children() {
|
|
1032
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
993
1035
|
};
|
|
994
1036
|
|
|
995
1037
|
const ColorPickerSwatch = props => {
|
|
@@ -1035,6 +1077,25 @@ const ColorPickerValueText = props => {
|
|
|
1035
1077
|
}));
|
|
1036
1078
|
};
|
|
1037
1079
|
|
|
1080
|
+
const ColorPickerView = props => {
|
|
1081
|
+
const api = useColorPickerContext();
|
|
1082
|
+
const mergedProps = solid.mergeProps(() => anatomy.colorPickerAnatomy.build().view.attrs, props);
|
|
1083
|
+
|
|
1084
|
+
// TODO @segunadebayo
|
|
1085
|
+
return web.createComponent(solidJs.Show, {
|
|
1086
|
+
get when() {
|
|
1087
|
+
return api().format === props.format;
|
|
1088
|
+
},
|
|
1089
|
+
get children() {
|
|
1090
|
+
return web.createComponent(ark.div, web.mergeProps({
|
|
1091
|
+
get ["data-format"]() {
|
|
1092
|
+
return props.format;
|
|
1093
|
+
}
|
|
1094
|
+
}, mergedProps));
|
|
1095
|
+
}
|
|
1096
|
+
});
|
|
1097
|
+
};
|
|
1098
|
+
|
|
1038
1099
|
const ColorPicker = Object.assign(ColorPicker$1, {
|
|
1039
1100
|
Root: ColorPicker$1,
|
|
1040
1101
|
Area: ColorPickerArea,
|
|
@@ -1054,7 +1115,8 @@ const ColorPicker = Object.assign(ColorPicker$1, {
|
|
|
1054
1115
|
SwatchTrigger: ColorPickerSwatchTrigger,
|
|
1055
1116
|
TransparencyGrid: ColorPickerTransparencyGrid,
|
|
1056
1117
|
Trigger: ColorPickerTrigger,
|
|
1057
|
-
ValueText: ColorPickerValueText
|
|
1118
|
+
ValueText: ColorPickerValueText,
|
|
1119
|
+
View: ColorPickerView
|
|
1058
1120
|
});
|
|
1059
1121
|
|
|
1060
1122
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1079,18 +1141,27 @@ const useCombobox = props => {
|
|
|
1079
1141
|
};
|
|
1080
1142
|
|
|
1081
1143
|
const Combobox$1 = props => {
|
|
1082
|
-
const [
|
|
1083
|
-
const
|
|
1144
|
+
const [presenceProps, comboboxProps] = splitPresenceProps(props);
|
|
1145
|
+
const [useComboboxProps, localProps] = createSplitProps()(comboboxProps, ['allowCustomValue', 'autoFocus', 'closeOnSelect', 'dir', 'disabled', 'form', 'getRootNode', 'highlightedValue', 'id', 'ids', 'inputBehavior', 'inputValue', 'invalid', 'isItemDisabled', 'items', 'itemToString', 'itemToValue', 'loop', 'multiple', 'name', 'onFocusOutside', 'onHighlightChange', 'onInputValueChange', 'onInteractOutside', 'onOpenChange', 'onOpenChange', 'onPointerDownOutside', 'onValueChange', 'openOnClick', 'placeholder', 'positioning', 'readOnly', 'selectionBehavior', 'selectOnBlur', 'translations', 'value']);
|
|
1146
|
+
const api = useCombobox(useComboboxProps);
|
|
1147
|
+
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
1148
|
+
present: api().isOpen
|
|
1149
|
+
})));
|
|
1084
1150
|
const mergedProps = solid.mergeProps(() => api().rootProps, localProps);
|
|
1085
1151
|
const getChildren = () => runIfFn(localProps.children, api);
|
|
1086
1152
|
return web.createComponent(ComboboxProvider, {
|
|
1087
1153
|
value: api,
|
|
1088
1154
|
get children() {
|
|
1089
|
-
return web.createComponent(
|
|
1155
|
+
return web.createComponent(PresenceProvider, {
|
|
1156
|
+
value: apiPresence,
|
|
1090
1157
|
get children() {
|
|
1091
|
-
return
|
|
1158
|
+
return web.createComponent(ark.div, web.mergeProps(mergedProps, {
|
|
1159
|
+
get children() {
|
|
1160
|
+
return getChildren();
|
|
1161
|
+
}
|
|
1162
|
+
}));
|
|
1092
1163
|
}
|
|
1093
|
-
})
|
|
1164
|
+
});
|
|
1094
1165
|
}
|
|
1095
1166
|
});
|
|
1096
1167
|
};
|
|
@@ -1101,27 +1172,18 @@ const ComboboxClearTrigger = props => {
|
|
|
1101
1172
|
return web.createComponent(ark.button, mergedProps);
|
|
1102
1173
|
};
|
|
1103
1174
|
|
|
1104
|
-
const _tmpl$$h = /*#__PURE__*/web.template(`<div>`);
|
|
1105
1175
|
const ComboboxContent = props => {
|
|
1106
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
1107
1176
|
const api = useComboboxContext();
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
}, presenceProps, {
|
|
1114
|
-
get fallback() {
|
|
1115
|
-
return (() => {
|
|
1116
|
-
const _el$ = _tmpl$$h();
|
|
1117
|
-
web.spread(_el$, web.mergeProps(() => api().contentProps), false, false);
|
|
1118
|
-
return _el$;
|
|
1119
|
-
})();
|
|
1177
|
+
const presenceApi = usePresenceContext();
|
|
1178
|
+
const mergedProps = solid.mergeProps(() => api().contentProps, () => presenceApi().presenceProps, props);
|
|
1179
|
+
return web.createComponent(solidJs.Show, {
|
|
1180
|
+
get when() {
|
|
1181
|
+
return !presenceApi().isUnmounted;
|
|
1120
1182
|
},
|
|
1121
1183
|
get children() {
|
|
1122
1184
|
return web.createComponent(ark.div, mergedProps);
|
|
1123
1185
|
}
|
|
1124
|
-
})
|
|
1186
|
+
});
|
|
1125
1187
|
};
|
|
1126
1188
|
|
|
1127
1189
|
const ComboboxControl = props => {
|
|
@@ -1195,9 +1257,17 @@ const ComboboxLabel = props => {
|
|
|
1195
1257
|
};
|
|
1196
1258
|
|
|
1197
1259
|
const ComboboxPositioner = props => {
|
|
1198
|
-
const
|
|
1199
|
-
const
|
|
1200
|
-
|
|
1260
|
+
const api = useComboboxContext();
|
|
1261
|
+
const presenceApi = usePresenceContext();
|
|
1262
|
+
const mergedProps = solid.mergeProps(() => api().positionerProps, props);
|
|
1263
|
+
return web.createComponent(solidJs.Show, {
|
|
1264
|
+
get when() {
|
|
1265
|
+
return !presenceApi().isUnmounted;
|
|
1266
|
+
},
|
|
1267
|
+
get children() {
|
|
1268
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1269
|
+
}
|
|
1270
|
+
});
|
|
1201
1271
|
};
|
|
1202
1272
|
|
|
1203
1273
|
const ComboboxTrigger = props => {
|
|
@@ -1243,18 +1313,27 @@ const useDatePicker = props => {
|
|
|
1243
1313
|
};
|
|
1244
1314
|
|
|
1245
1315
|
const DatePicker$1 = props => {
|
|
1246
|
-
const [
|
|
1247
|
-
const
|
|
1316
|
+
const [presenceProps, datePickerProps] = splitPresenceProps(props);
|
|
1317
|
+
const [useDatePickerProps, localProps] = createSplitProps()(datePickerProps, ['closeOnSelect', 'dir', 'disabled', 'fixedWeeks', 'focusedValue', 'format', 'getRootNode', 'id', 'ids', 'isDateUnavailable', 'isDateUnavailable', 'locale', 'max', 'messages', 'min', 'modal', 'name', 'numOfMonths', 'onFocusChange', 'onOpenChange', 'onValueChange', 'onViewChange', 'open', 'parse', 'positioning', 'readOnly', 'selectionMode', 'startOfWeek', 'timeZone', 'value', 'view']);
|
|
1318
|
+
const api = useDatePicker(useDatePickerProps);
|
|
1319
|
+
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
1320
|
+
present: api().isOpen
|
|
1321
|
+
})));
|
|
1248
1322
|
const mergedProps = solid.mergeProps(() => api().rootProps, localProps);
|
|
1249
1323
|
const getChildren = () => runIfFn(localProps.children, api);
|
|
1250
1324
|
return web.createComponent(DatePickerProvider, {
|
|
1251
1325
|
value: api,
|
|
1252
1326
|
get children() {
|
|
1253
|
-
return web.createComponent(
|
|
1327
|
+
return web.createComponent(PresenceProvider, {
|
|
1328
|
+
value: apiPresence,
|
|
1254
1329
|
get children() {
|
|
1255
|
-
return
|
|
1330
|
+
return web.createComponent(ark.div, web.mergeProps(mergedProps, {
|
|
1331
|
+
get children() {
|
|
1332
|
+
return getChildren();
|
|
1333
|
+
}
|
|
1334
|
+
}));
|
|
1256
1335
|
}
|
|
1257
|
-
})
|
|
1336
|
+
});
|
|
1258
1337
|
}
|
|
1259
1338
|
});
|
|
1260
1339
|
};
|
|
@@ -1265,27 +1344,18 @@ const DatePickerClearTrigger = props => {
|
|
|
1265
1344
|
return web.createComponent(ark.button, mergedProps);
|
|
1266
1345
|
};
|
|
1267
1346
|
|
|
1268
|
-
const _tmpl$$g = /*#__PURE__*/web.template(`<div>`);
|
|
1269
1347
|
const DatePickerContent = props => {
|
|
1270
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
1271
1348
|
const api = useDatePickerContext();
|
|
1272
|
-
const
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
}, presenceProps, {
|
|
1278
|
-
get fallback() {
|
|
1279
|
-
return (() => {
|
|
1280
|
-
const _el$ = _tmpl$$g();
|
|
1281
|
-
web.spread(_el$, web.mergeProps(() => api().contentProps), false, false);
|
|
1282
|
-
return _el$;
|
|
1283
|
-
})();
|
|
1349
|
+
const presenceApi = usePresenceContext();
|
|
1350
|
+
const mergedProps = solid.mergeProps(() => api().contentProps, () => presenceApi().presenceProps, props);
|
|
1351
|
+
return web.createComponent(solidJs.Show, {
|
|
1352
|
+
get when() {
|
|
1353
|
+
return !presenceApi().isUnmounted;
|
|
1284
1354
|
},
|
|
1285
1355
|
get children() {
|
|
1286
1356
|
return web.createComponent(ark.div, mergedProps);
|
|
1287
1357
|
}
|
|
1288
|
-
})
|
|
1358
|
+
});
|
|
1289
1359
|
};
|
|
1290
1360
|
|
|
1291
1361
|
const DatePickerControl = props => {
|
|
@@ -1306,14 +1376,14 @@ const DatePickerLabel = props => {
|
|
|
1306
1376
|
return web.createComponent(ark.label, mergedProps);
|
|
1307
1377
|
};
|
|
1308
1378
|
|
|
1309
|
-
const _tmpl$$
|
|
1379
|
+
const _tmpl$$8 = /*#__PURE__*/web.template(`<option>`);
|
|
1310
1380
|
const DatePickerMonthSelect = props => {
|
|
1311
1381
|
const api = useDatePickerContext();
|
|
1312
1382
|
const mergedProps = solid.mergeProps(() => api().monthSelectProps, props);
|
|
1313
1383
|
return web.createComponent(ark.select, web.mergeProps(mergedProps, {
|
|
1314
1384
|
get children() {
|
|
1315
1385
|
return api().getMonths().map(month => (() => {
|
|
1316
|
-
const _el$ = _tmpl$$
|
|
1386
|
+
const _el$ = _tmpl$$8();
|
|
1317
1387
|
web.insert(_el$, () => month.label);
|
|
1318
1388
|
web.effect(() => _el$.value = month.value);
|
|
1319
1389
|
return _el$;
|
|
@@ -1336,8 +1406,16 @@ const DatePickerNextTrigger = props => {
|
|
|
1336
1406
|
|
|
1337
1407
|
const DatePickerPositioner = props => {
|
|
1338
1408
|
const api = useDatePickerContext();
|
|
1409
|
+
const presenceApi = usePresenceContext();
|
|
1339
1410
|
const mergedProps = solid.mergeProps(() => api().positionerProps, props);
|
|
1340
|
-
return web.createComponent(
|
|
1411
|
+
return web.createComponent(solidJs.Show, {
|
|
1412
|
+
get when() {
|
|
1413
|
+
return !presenceApi().isUnmounted;
|
|
1414
|
+
},
|
|
1415
|
+
get children() {
|
|
1416
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1417
|
+
}
|
|
1418
|
+
});
|
|
1341
1419
|
};
|
|
1342
1420
|
|
|
1343
1421
|
const DatePickerPrevTrigger = props => {
|
|
@@ -1488,7 +1566,7 @@ const DatePickerViewTrigger = props => {
|
|
|
1488
1566
|
return web.createComponent(ark.button, mergedProps);
|
|
1489
1567
|
};
|
|
1490
1568
|
|
|
1491
|
-
const _tmpl$$
|
|
1569
|
+
const _tmpl$$7 = /*#__PURE__*/web.template(`<option>`);
|
|
1492
1570
|
const DatePickerYearSelect = props => {
|
|
1493
1571
|
const api = useDatePickerContext();
|
|
1494
1572
|
const mergedProps = solid.mergeProps(() => api().yearSelectProps, props);
|
|
@@ -1498,7 +1576,7 @@ const DatePickerYearSelect = props => {
|
|
|
1498
1576
|
from: 1_000,
|
|
1499
1577
|
to: 4_000
|
|
1500
1578
|
}).map(year => (() => {
|
|
1501
|
-
const _el$ = _tmpl$$
|
|
1579
|
+
const _el$ = _tmpl$$7();
|
|
1502
1580
|
_el$.value = year;
|
|
1503
1581
|
web.insert(_el$, year);
|
|
1504
1582
|
return _el$;
|
|
@@ -1558,91 +1636,103 @@ const useDialog = props => {
|
|
|
1558
1636
|
};
|
|
1559
1637
|
|
|
1560
1638
|
const Dialog$1 = props => {
|
|
1561
|
-
const [
|
|
1562
|
-
const
|
|
1639
|
+
const [presenceProps, dialogProps] = splitPresenceProps(props);
|
|
1640
|
+
const [useDialogProps, localProps] = createSplitProps()(dialogProps, ['aria-label', 'closeOnEscapeKeyDown', 'closeOnInteractOutside', 'dir', 'finalFocusEl', 'getRootNode', 'id', 'ids', 'initialFocusEl', 'modal', 'onEscapeKeyDown', 'onFocusOutside', 'onInteractOutside', 'onOpenChange', 'onPointerDownOutside', 'open', 'preventScroll', 'restoreFocus', 'role', 'trapFocus']);
|
|
1641
|
+
const api = useDialog(useDialogProps);
|
|
1642
|
+
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
1643
|
+
present: api().isOpen
|
|
1644
|
+
})));
|
|
1563
1645
|
const getChildren = () => runIfFn(localProps.children, api);
|
|
1564
1646
|
return web.createComponent(DialogProvider, {
|
|
1565
1647
|
value: api,
|
|
1566
1648
|
get children() {
|
|
1567
|
-
return
|
|
1649
|
+
return web.createComponent(PresencePropsProvider, {
|
|
1650
|
+
value: presenceProps,
|
|
1651
|
+
get children() {
|
|
1652
|
+
return web.createComponent(PresenceProvider, {
|
|
1653
|
+
value: apiPresence,
|
|
1654
|
+
get children() {
|
|
1655
|
+
return getChildren();
|
|
1656
|
+
}
|
|
1657
|
+
});
|
|
1658
|
+
}
|
|
1659
|
+
});
|
|
1568
1660
|
}
|
|
1569
1661
|
});
|
|
1570
1662
|
};
|
|
1571
1663
|
|
|
1572
|
-
const _tmpl$$d = /*#__PURE__*/web.template(`<div>`);
|
|
1573
1664
|
const DialogBackdrop = props => {
|
|
1574
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
1575
1665
|
const api = useDialogContext();
|
|
1576
|
-
const
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
get
|
|
1583
|
-
return (
|
|
1584
|
-
const _el$ = _tmpl$$d();
|
|
1585
|
-
web.spread(_el$, web.mergeProps(() => api().backdropProps), false, false);
|
|
1586
|
-
return _el$;
|
|
1587
|
-
})();
|
|
1666
|
+
const presenceProps = usePresencePropsContext();
|
|
1667
|
+
const presenceApi = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
1668
|
+
present: api().isOpen
|
|
1669
|
+
})));
|
|
1670
|
+
const mergedProps = solid.mergeProps(() => api().backdropProps, () => presenceApi().presenceProps, props);
|
|
1671
|
+
return web.createComponent(solidJs.Show, {
|
|
1672
|
+
get when() {
|
|
1673
|
+
return !presenceApi().isUnmounted;
|
|
1588
1674
|
},
|
|
1589
1675
|
get children() {
|
|
1590
1676
|
return web.createComponent(ark.div, mergedProps);
|
|
1591
1677
|
}
|
|
1592
|
-
})
|
|
1678
|
+
});
|
|
1593
1679
|
};
|
|
1594
1680
|
|
|
1595
1681
|
const DialogCloseTrigger = props => {
|
|
1596
1682
|
const dialog = useDialogContext();
|
|
1597
|
-
const
|
|
1598
|
-
return web.createComponent(ark.button,
|
|
1683
|
+
const mergedProps = solid.mergeProps(() => dialog().triggerProps, props);
|
|
1684
|
+
return web.createComponent(ark.button, mergedProps);
|
|
1599
1685
|
};
|
|
1600
1686
|
|
|
1601
|
-
const _tmpl$$c = /*#__PURE__*/web.template(`<div>`);
|
|
1602
1687
|
const DialogContent = props => {
|
|
1603
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
1604
1688
|
const api = useDialogContext();
|
|
1605
|
-
const
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
}, presenceProps, {
|
|
1611
|
-
get fallback() {
|
|
1612
|
-
return (() => {
|
|
1613
|
-
const _el$ = _tmpl$$c();
|
|
1614
|
-
web.spread(_el$, web.mergeProps(() => api().contentProps), false, false);
|
|
1615
|
-
return _el$;
|
|
1616
|
-
})();
|
|
1689
|
+
const presenceApi = usePresenceContext();
|
|
1690
|
+
const mergedProps = solid.mergeProps(() => api().contentProps, () => presenceApi().presenceProps, props);
|
|
1691
|
+
return web.createComponent(solidJs.Show, {
|
|
1692
|
+
get when() {
|
|
1693
|
+
return !presenceApi().isUnmounted;
|
|
1617
1694
|
},
|
|
1618
1695
|
get children() {
|
|
1619
1696
|
return web.createComponent(ark.div, mergedProps);
|
|
1620
1697
|
}
|
|
1621
|
-
})
|
|
1698
|
+
});
|
|
1622
1699
|
};
|
|
1623
1700
|
|
|
1624
1701
|
const DialogDescription = props => {
|
|
1625
1702
|
const dialog = useDialogContext();
|
|
1626
|
-
const
|
|
1627
|
-
return web.createComponent(ark.p,
|
|
1703
|
+
const mergedProps = solid.mergeProps(() => dialog().descriptionProps, props);
|
|
1704
|
+
return web.createComponent(ark.p, mergedProps);
|
|
1628
1705
|
};
|
|
1629
1706
|
|
|
1630
1707
|
const DialogPositioner = props => {
|
|
1631
|
-
const
|
|
1632
|
-
const
|
|
1633
|
-
|
|
1708
|
+
const api = useDialogContext();
|
|
1709
|
+
const presenceApi = usePresenceContext();
|
|
1710
|
+
const mergedProps = solid.mergeProps(() => api().positionerProps, props);
|
|
1711
|
+
return web.createComponent(solidJs.Show, {
|
|
1712
|
+
get when() {
|
|
1713
|
+
return !presenceApi().isUnmounted;
|
|
1714
|
+
},
|
|
1715
|
+
get children() {
|
|
1716
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1717
|
+
}
|
|
1718
|
+
});
|
|
1634
1719
|
};
|
|
1635
1720
|
|
|
1636
1721
|
const DialogTitle = props => {
|
|
1637
1722
|
const dialog = useDialogContext();
|
|
1638
|
-
const
|
|
1639
|
-
return web.createComponent(ark.h2,
|
|
1723
|
+
const mergedProps = solid.mergeProps(() => dialog().titleProps, props);
|
|
1724
|
+
return web.createComponent(ark.h2, mergedProps);
|
|
1640
1725
|
};
|
|
1641
1726
|
|
|
1642
1727
|
const DialogTrigger = props => {
|
|
1643
|
-
const
|
|
1644
|
-
const
|
|
1645
|
-
|
|
1728
|
+
const api = useDialogContext();
|
|
1729
|
+
const presenceApi = usePresenceContext();
|
|
1730
|
+
const mergedProps = solid.mergeProps(() => api().triggerProps, () => ({
|
|
1731
|
+
'aria-controls': presenceApi().isUnmounted && null
|
|
1732
|
+
}), props);
|
|
1733
|
+
|
|
1734
|
+
// @ts-expect-error we want aria-controls to be null to remove them if the popover if lazy mounted
|
|
1735
|
+
return web.createComponent(ark.button, mergedProps);
|
|
1646
1736
|
};
|
|
1647
1737
|
|
|
1648
1738
|
const Dialog = Object.assign(Dialog$1, {
|
|
@@ -1677,12 +1767,12 @@ const Editable$1 = props => {
|
|
|
1677
1767
|
const [useEditableProps, restProps] = createSplitProps()(props, ['activationMode', 'autoResize', 'dir', 'disabled', 'finalFocusEl', 'form', 'getRootNode', 'id', 'ids', 'invalid', 'maxLength', 'name', 'onEdit', 'onFocusOutside', 'onInteractOutside', 'onPointerDownOutside', 'onValueChange', 'onValueCommit', 'onValueRevert', 'placeholder', 'readOnly', 'selectOnFocus', 'startWithEditView', 'submitMode', 'translations', 'value']);
|
|
1678
1768
|
const editable = useEditable(useEditableProps);
|
|
1679
1769
|
const [childrenProps, localProps] = solidJs.splitProps(restProps, ['children']);
|
|
1680
|
-
const
|
|
1770
|
+
const mergedProps = solid.mergeProps(() => editable().rootProps, localProps);
|
|
1681
1771
|
const getChildren = () => runIfFn(childrenProps.children, editable);
|
|
1682
1772
|
return web.createComponent(EditableProvider, {
|
|
1683
1773
|
value: editable,
|
|
1684
1774
|
get children() {
|
|
1685
|
-
return web.createComponent(ark.div, web.mergeProps(
|
|
1775
|
+
return web.createComponent(ark.div, web.mergeProps(mergedProps, {
|
|
1686
1776
|
get children() {
|
|
1687
1777
|
return getChildren();
|
|
1688
1778
|
}
|
|
@@ -1693,50 +1783,50 @@ const Editable$1 = props => {
|
|
|
1693
1783
|
|
|
1694
1784
|
const EditableArea = props => {
|
|
1695
1785
|
const editable = useEditableContext();
|
|
1696
|
-
const
|
|
1697
|
-
return web.createComponent(ark.div,
|
|
1786
|
+
const mergedProps = solid.mergeProps(() => editable().areaProps, props);
|
|
1787
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1698
1788
|
};
|
|
1699
1789
|
|
|
1700
1790
|
const EditableCancelTrigger = props => {
|
|
1701
1791
|
const editable = useEditableContext();
|
|
1702
|
-
const
|
|
1703
|
-
return web.createComponent(ark.button,
|
|
1792
|
+
const mergedProps = solid.mergeProps(() => editable().cancelTriggerProps, props);
|
|
1793
|
+
return web.createComponent(ark.button, mergedProps);
|
|
1704
1794
|
};
|
|
1705
1795
|
|
|
1706
1796
|
const EditableControl = props => {
|
|
1707
1797
|
const editable = useEditableContext();
|
|
1708
|
-
const
|
|
1709
|
-
return web.createComponent(ark.div,
|
|
1798
|
+
const mergedProps = solid.mergeProps(() => editable().controlProps, props);
|
|
1799
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1710
1800
|
};
|
|
1711
1801
|
|
|
1712
1802
|
const EditableEditTrigger = props => {
|
|
1713
1803
|
const editable = useEditableContext();
|
|
1714
|
-
const
|
|
1715
|
-
return web.createComponent(ark.button,
|
|
1804
|
+
const mergedProps = solid.mergeProps(() => editable().editTriggerProps, props);
|
|
1805
|
+
return web.createComponent(ark.button, mergedProps);
|
|
1716
1806
|
};
|
|
1717
1807
|
|
|
1718
1808
|
const EditableInput = props => {
|
|
1719
1809
|
const editable = useEditableContext();
|
|
1720
|
-
const
|
|
1721
|
-
return web.createComponent(ark.input,
|
|
1810
|
+
const mergedProps = solid.mergeProps(() => editable().inputProps, props);
|
|
1811
|
+
return web.createComponent(ark.input, mergedProps);
|
|
1722
1812
|
};
|
|
1723
1813
|
|
|
1724
1814
|
const EditableLabel = props => {
|
|
1725
1815
|
const editable = useEditableContext();
|
|
1726
|
-
const
|
|
1727
|
-
return web.createComponent(ark.label,
|
|
1816
|
+
const mergedProps = solid.mergeProps(() => editable().labelProps, props);
|
|
1817
|
+
return web.createComponent(ark.label, mergedProps);
|
|
1728
1818
|
};
|
|
1729
1819
|
|
|
1730
1820
|
const EditablePreview = props => {
|
|
1731
1821
|
const editable = useEditableContext();
|
|
1732
|
-
const
|
|
1733
|
-
return web.createComponent(ark.span,
|
|
1822
|
+
const mergedProps = solid.mergeProps(() => editable().previewProps, props);
|
|
1823
|
+
return web.createComponent(ark.span, mergedProps);
|
|
1734
1824
|
};
|
|
1735
1825
|
|
|
1736
1826
|
const EditableSubmitTrigger = props => {
|
|
1737
1827
|
const dialog = useEditableContext();
|
|
1738
|
-
const
|
|
1739
|
-
return web.createComponent(ark.button,
|
|
1828
|
+
const mergedProps = solid.mergeProps(() => dialog().submitTriggerProps, props);
|
|
1829
|
+
return web.createComponent(ark.button, mergedProps);
|
|
1740
1830
|
};
|
|
1741
1831
|
|
|
1742
1832
|
const Editable = Object.assign(Editable$1, {
|
|
@@ -1769,62 +1859,70 @@ const useHoverCard = props => {
|
|
|
1769
1859
|
};
|
|
1770
1860
|
|
|
1771
1861
|
const HoverCard$1 = props => {
|
|
1772
|
-
const [
|
|
1773
|
-
const
|
|
1862
|
+
const [presenceProps, hoverCardProps] = splitPresenceProps(props);
|
|
1863
|
+
const [useHoverCardProps, localProps] = createSplitProps()(hoverCardProps, ['closeDelay', 'dir', 'getRootNode', 'id', 'ids', 'onOpenChange', 'open', 'openDelay', 'positioning']);
|
|
1864
|
+
const api = useHoverCard(useHoverCardProps);
|
|
1865
|
+
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
1866
|
+
present: api().isOpen
|
|
1867
|
+
})));
|
|
1774
1868
|
const getChildren = () => runIfFn(localProps.children, api);
|
|
1775
1869
|
return web.createComponent(HoverCardProvider, {
|
|
1776
1870
|
value: api,
|
|
1777
1871
|
get children() {
|
|
1778
|
-
return
|
|
1872
|
+
return web.createComponent(PresenceProvider, {
|
|
1873
|
+
value: apiPresence,
|
|
1874
|
+
get children() {
|
|
1875
|
+
return getChildren();
|
|
1876
|
+
}
|
|
1877
|
+
});
|
|
1779
1878
|
}
|
|
1780
1879
|
});
|
|
1781
1880
|
};
|
|
1782
1881
|
|
|
1783
1882
|
const HoverCardArrow = props => {
|
|
1784
1883
|
const hoverCard = useHoverCardContext();
|
|
1785
|
-
const
|
|
1786
|
-
return web.createComponent(ark.div,
|
|
1884
|
+
const mergedProps = solid.mergeProps(() => hoverCard().arrowProps, props);
|
|
1885
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1787
1886
|
};
|
|
1788
1887
|
|
|
1789
1888
|
const HoverCardArrowTip = props => {
|
|
1790
1889
|
const hoverCard = useHoverCardContext();
|
|
1791
|
-
const
|
|
1792
|
-
return web.createComponent(ark.div,
|
|
1890
|
+
const mergedProps = solid.mergeProps(() => hoverCard().arrowTipProps, props);
|
|
1891
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1793
1892
|
};
|
|
1794
1893
|
|
|
1795
|
-
const _tmpl$$b = /*#__PURE__*/web.template(`<div>`);
|
|
1796
1894
|
const HoverCardContent = props => {
|
|
1797
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
1798
1895
|
const api = useHoverCardContext();
|
|
1799
|
-
const
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
}, presenceProps, {
|
|
1805
|
-
get fallback() {
|
|
1806
|
-
return (() => {
|
|
1807
|
-
const _el$ = _tmpl$$b();
|
|
1808
|
-
web.spread(_el$, web.mergeProps(() => api().contentProps), false, false);
|
|
1809
|
-
return _el$;
|
|
1810
|
-
})();
|
|
1896
|
+
const presenceApi = usePresenceContext();
|
|
1897
|
+
const mergedProps = solid.mergeProps(() => api().contentProps, () => presenceApi().presenceProps, props);
|
|
1898
|
+
return web.createComponent(solidJs.Show, {
|
|
1899
|
+
get when() {
|
|
1900
|
+
return !presenceApi().isUnmounted;
|
|
1811
1901
|
},
|
|
1812
1902
|
get children() {
|
|
1813
1903
|
return web.createComponent(ark.div, mergedProps);
|
|
1814
1904
|
}
|
|
1815
|
-
})
|
|
1905
|
+
});
|
|
1816
1906
|
};
|
|
1817
1907
|
|
|
1818
1908
|
const HoverCardPositioner = props => {
|
|
1819
|
-
const
|
|
1820
|
-
const
|
|
1821
|
-
|
|
1909
|
+
const api = useHoverCardContext();
|
|
1910
|
+
const presenceApi = usePresenceContext();
|
|
1911
|
+
const mergedProps = solid.mergeProps(() => api().positionerProps, props);
|
|
1912
|
+
return web.createComponent(solidJs.Show, {
|
|
1913
|
+
get when() {
|
|
1914
|
+
return !presenceApi().isUnmounted;
|
|
1915
|
+
},
|
|
1916
|
+
get children() {
|
|
1917
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1918
|
+
}
|
|
1919
|
+
});
|
|
1822
1920
|
};
|
|
1823
1921
|
|
|
1824
1922
|
const HoverCardTrigger = props => {
|
|
1825
1923
|
const hoverCard = useHoverCardContext();
|
|
1826
|
-
const
|
|
1827
|
-
return web.createComponent(ark.button,
|
|
1924
|
+
const mergedProps = solid.mergeProps(() => hoverCard().triggerProps, props);
|
|
1925
|
+
return web.createComponent(ark.button, mergedProps);
|
|
1828
1926
|
};
|
|
1829
1927
|
|
|
1830
1928
|
const HoverCard = Object.assign(HoverCard$1, {
|
|
@@ -1868,25 +1966,22 @@ const useMenu = props => {
|
|
|
1868
1966
|
};
|
|
1869
1967
|
|
|
1870
1968
|
const Menu$1 = props => {
|
|
1871
|
-
const [
|
|
1969
|
+
const [presenceProps, menuProps] = splitPresenceProps(props);
|
|
1970
|
+
const [useMenuProps, localProps] = createSplitProps()(menuProps, ['anchorPoint', 'aria-label', 'closeOnSelect', 'dir', 'getRootNode', 'highlightedId', 'id', 'ids', 'loop', 'onFocusOutside', 'onInteractOutside', 'onOpenChange', 'onPointerDownOutside', 'onSelect', 'onValueChange', 'open', 'positioning', 'value']);
|
|
1872
1971
|
const parentMenu = useMenuContext();
|
|
1873
1972
|
const parentMachine = useMenuMachineContext();
|
|
1874
|
-
const menu = useMenu(
|
|
1973
|
+
const menu = useMenu(useMenuProps);
|
|
1974
|
+
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
1975
|
+
present: menu().api().isOpen
|
|
1976
|
+
})));
|
|
1875
1977
|
solidJs.createEffect(() => {
|
|
1876
1978
|
if (!parentMachine) return;
|
|
1877
1979
|
parentMenu?.().setChild(menu().machine);
|
|
1878
1980
|
menu().api().setParent(parentMachine());
|
|
1879
1981
|
});
|
|
1880
|
-
solidJs.createEffect(() => {
|
|
1881
|
-
if (!restProps.isOpen) return;
|
|
1882
|
-
restProps.isOpen?.() ? menu().api().open() : menu().api().close();
|
|
1883
|
-
});
|
|
1884
1982
|
const triggerItemContext = solidJs.createMemo(() => parentMenu?.().getTriggerItemProps(menu().api()));
|
|
1885
1983
|
const machineContext = () => menu().machine;
|
|
1886
|
-
const getChildren = () => runIfFn(
|
|
1887
|
-
isOpen: menu?.().api().isOpen,
|
|
1888
|
-
onClose: menu?.().api().close
|
|
1889
|
-
}));
|
|
1984
|
+
const getChildren = () => runIfFn(localProps.children, menu().api);
|
|
1890
1985
|
return web.createComponent(MenuTriggerItemProvider, {
|
|
1891
1986
|
value: triggerItemContext,
|
|
1892
1987
|
get children() {
|
|
@@ -1898,7 +1993,12 @@ const Menu$1 = props => {
|
|
|
1898
1993
|
return menu().api;
|
|
1899
1994
|
},
|
|
1900
1995
|
get children() {
|
|
1901
|
-
return
|
|
1996
|
+
return web.createComponent(PresenceProvider, {
|
|
1997
|
+
value: apiPresence,
|
|
1998
|
+
get children() {
|
|
1999
|
+
return getChildren();
|
|
2000
|
+
}
|
|
2001
|
+
});
|
|
1902
2002
|
}
|
|
1903
2003
|
});
|
|
1904
2004
|
}
|
|
@@ -1909,57 +2009,48 @@ const Menu$1 = props => {
|
|
|
1909
2009
|
|
|
1910
2010
|
const MenuArrow = props => {
|
|
1911
2011
|
const menu = useMenuContext();
|
|
1912
|
-
const
|
|
1913
|
-
return web.createComponent(ark.div,
|
|
2012
|
+
const mergedProps = solid.mergeProps(() => menu?.().arrowProps, props);
|
|
2013
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1914
2014
|
};
|
|
1915
2015
|
|
|
1916
2016
|
const MenuArrowTip = props => {
|
|
1917
2017
|
const menu = useMenuContext();
|
|
1918
|
-
const
|
|
1919
|
-
return web.createComponent(ark.div,
|
|
2018
|
+
const mergedProps = solid.mergeProps(() => menu?.().arrowTipProps, props);
|
|
2019
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1920
2020
|
};
|
|
1921
2021
|
|
|
1922
|
-
const _tmpl$$a = /*#__PURE__*/web.template(`<div>`);
|
|
1923
2022
|
const MenuContent = props => {
|
|
1924
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
1925
2023
|
const api = useMenuContext();
|
|
1926
|
-
const
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
}, presenceProps, {
|
|
1932
|
-
get fallback() {
|
|
1933
|
-
return (() => {
|
|
1934
|
-
const _el$ = _tmpl$$a();
|
|
1935
|
-
web.spread(_el$, web.mergeProps(() => api().contentProps), false, false);
|
|
1936
|
-
return _el$;
|
|
1937
|
-
})();
|
|
2024
|
+
const presenceApi = usePresenceContext();
|
|
2025
|
+
const mergedProps = solid.mergeProps(() => api().contentProps, () => presenceApi().presenceProps, props);
|
|
2026
|
+
return web.createComponent(solidJs.Show, {
|
|
2027
|
+
get when() {
|
|
2028
|
+
return !presenceApi().isUnmounted;
|
|
1938
2029
|
},
|
|
1939
2030
|
get children() {
|
|
1940
2031
|
return web.createComponent(ark.div, mergedProps);
|
|
1941
2032
|
}
|
|
1942
|
-
})
|
|
2033
|
+
});
|
|
1943
2034
|
};
|
|
1944
2035
|
|
|
1945
2036
|
const MenuContextTrigger = props => {
|
|
1946
2037
|
const menu = useMenuContext();
|
|
1947
|
-
const
|
|
1948
|
-
return web.createComponent(ark.button,
|
|
2038
|
+
const mergedProps = solid.mergeProps(() => menu?.().contextTriggerProps, props);
|
|
2039
|
+
return web.createComponent(ark.button, mergedProps);
|
|
1949
2040
|
};
|
|
1950
2041
|
|
|
1951
2042
|
const MenuItem = props => {
|
|
1952
2043
|
const menu = useMenuContext();
|
|
1953
2044
|
const [itemParams, restProps] = createSplitProps()(props, ['id', 'disabled', 'valueText', 'closeOnSelect']);
|
|
1954
|
-
const
|
|
1955
|
-
return web.createComponent(ark.div,
|
|
2045
|
+
const mergedProps = solid.mergeProps(() => menu?.().getItemProps(itemParams), restProps);
|
|
2046
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1956
2047
|
};
|
|
1957
2048
|
|
|
1958
2049
|
const MenuItemGroup = props => {
|
|
1959
2050
|
const menu = useMenuContext();
|
|
1960
2051
|
const [itemGroupProps, localProps] = createSplitProps()(props, ['id']);
|
|
1961
|
-
const
|
|
1962
|
-
return web.createComponent(ark.div,
|
|
2052
|
+
const mergedProps = solid.mergeProps(() => menu?.().getItemGroupProps(itemGroupProps), localProps);
|
|
2053
|
+
return web.createComponent(ark.div, mergedProps);
|
|
1963
2054
|
};
|
|
1964
2055
|
|
|
1965
2056
|
const MenuItemGroupLabel = props => {
|
|
@@ -1974,10 +2065,10 @@ const MenuItemGroupLabel = props => {
|
|
|
1974
2065
|
const MenuOptionItem = props => {
|
|
1975
2066
|
const menu = useMenuContext();
|
|
1976
2067
|
const [optionProps, localProps] = createSplitProps()(props, ['id', 'disabled', 'valueText', 'closeOnSelect', 'name', 'type', 'value', 'onCheckedChange']);
|
|
1977
|
-
const
|
|
2068
|
+
const mergedProps = solid.mergeProps(() => menu().getOptionItemProps(optionProps), localProps);
|
|
1978
2069
|
const itemState = solidJs.createMemo(() => menu().getOptionItemState(optionProps));
|
|
1979
2070
|
const getChildren = () => runIfFn(localProps.children, itemState);
|
|
1980
|
-
return web.createComponent(ark.div, web.mergeProps(
|
|
2071
|
+
return web.createComponent(ark.div, web.mergeProps(mergedProps, {
|
|
1981
2072
|
get children() {
|
|
1982
2073
|
return getChildren();
|
|
1983
2074
|
}
|
|
@@ -1985,27 +2076,40 @@ const MenuOptionItem = props => {
|
|
|
1985
2076
|
};
|
|
1986
2077
|
|
|
1987
2078
|
const MenuPositioner = props => {
|
|
1988
|
-
const
|
|
1989
|
-
const
|
|
1990
|
-
|
|
2079
|
+
const api = useMenuContext();
|
|
2080
|
+
const presenceApi = usePresenceContext();
|
|
2081
|
+
const mergedProps = solid.mergeProps(() => api().positionerProps, props);
|
|
2082
|
+
return web.createComponent(solidJs.Show, {
|
|
2083
|
+
get when() {
|
|
2084
|
+
return !presenceApi().isUnmounted;
|
|
2085
|
+
},
|
|
2086
|
+
get children() {
|
|
2087
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2088
|
+
}
|
|
2089
|
+
});
|
|
1991
2090
|
};
|
|
1992
2091
|
|
|
1993
2092
|
const MenuSeparator = props => {
|
|
1994
2093
|
const menu = useMenuContext();
|
|
1995
|
-
const
|
|
1996
|
-
return web.createComponent(ark.hr,
|
|
2094
|
+
const mergedProps = solid.mergeProps(() => menu?.().separatorProps, props);
|
|
2095
|
+
return web.createComponent(ark.hr, mergedProps);
|
|
1997
2096
|
};
|
|
1998
2097
|
|
|
1999
2098
|
const MenuTrigger = props => {
|
|
2000
|
-
const
|
|
2001
|
-
const
|
|
2002
|
-
|
|
2099
|
+
const api = useMenuContext();
|
|
2100
|
+
const presenceApi = usePresenceContext();
|
|
2101
|
+
const mergedProps = solid.mergeProps(() => api().triggerProps, () => ({
|
|
2102
|
+
'aria-controls': presenceApi().isUnmounted && null
|
|
2103
|
+
}), props);
|
|
2104
|
+
|
|
2105
|
+
// @ts-expect-error we want aria-controls to be null to remove them if the popover if lazy mounted
|
|
2106
|
+
return web.createComponent(ark.button, mergedProps);
|
|
2003
2107
|
};
|
|
2004
2108
|
|
|
2005
2109
|
const MenuTriggerItem = props => {
|
|
2006
2110
|
const getTriggerItemProps = useMenuTriggerItemContext();
|
|
2007
|
-
const
|
|
2008
|
-
return web.createComponent(ark.div,
|
|
2111
|
+
const mergedProps = solid.mergeProps(() => getTriggerItemProps?.(), props);
|
|
2112
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2009
2113
|
};
|
|
2010
2114
|
|
|
2011
2115
|
const Menu = Object.assign(Menu$1, {
|
|
@@ -2044,49 +2148,49 @@ const useNumberInput = props => {
|
|
|
2044
2148
|
const NumberInput$1 = props => {
|
|
2045
2149
|
const [useNumberInputProps, localProps] = createSplitProps()(props, ['allowMouseWheel', 'allowOverflow', 'clampValueOnBlur', 'dir', 'disabled', 'focusInputOnChange', 'form', 'formatOptions', 'getRootNode', 'id', 'ids', 'inputMode', 'invalid', 'locale', 'max', 'min', 'name', 'onFocusChange', 'onValueChange', 'onValueInvalid', 'pattern', 'readOnly', 'spinOnPress', 'step', 'translations', 'value']);
|
|
2046
2150
|
const api = useNumberInput(useNumberInputProps);
|
|
2047
|
-
const
|
|
2151
|
+
const mergedProps = solid.mergeProps(() => api().rootProps, localProps);
|
|
2048
2152
|
return web.createComponent(NumberInputProvider, {
|
|
2049
2153
|
value: api,
|
|
2050
2154
|
get children() {
|
|
2051
|
-
return web.createComponent(ark.div,
|
|
2155
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2052
2156
|
}
|
|
2053
2157
|
});
|
|
2054
2158
|
};
|
|
2055
2159
|
|
|
2056
2160
|
const NumberInputControl = props => {
|
|
2057
2161
|
const api = useNumberInputContext();
|
|
2058
|
-
const
|
|
2059
|
-
return web.createComponent(ark.div,
|
|
2162
|
+
const mergedProps = solid.mergeProps(() => api().controlProps, props);
|
|
2163
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2060
2164
|
};
|
|
2061
2165
|
|
|
2062
2166
|
const NumberInputDecrementTrigger = props => {
|
|
2063
2167
|
const api = useNumberInputContext();
|
|
2064
|
-
const
|
|
2065
|
-
return web.createComponent(ark.button,
|
|
2168
|
+
const mergedProps = solid.mergeProps(() => api().decrementTriggerProps, props);
|
|
2169
|
+
return web.createComponent(ark.button, mergedProps);
|
|
2066
2170
|
};
|
|
2067
2171
|
|
|
2068
2172
|
const NumberInputInput = props => {
|
|
2069
2173
|
const api = useNumberInputContext();
|
|
2070
|
-
const
|
|
2071
|
-
return web.createComponent(ark.input,
|
|
2174
|
+
const mergedProps = solid.mergeProps(() => api().inputProps, props);
|
|
2175
|
+
return web.createComponent(ark.input, mergedProps);
|
|
2072
2176
|
};
|
|
2073
2177
|
|
|
2074
2178
|
const NumberInputIncrementTrigger = props => {
|
|
2075
2179
|
const api = useNumberInputContext();
|
|
2076
|
-
const
|
|
2077
|
-
return web.createComponent(ark.button,
|
|
2180
|
+
const mergedProps = solid.mergeProps(() => api().incrementTriggerProps, props);
|
|
2181
|
+
return web.createComponent(ark.button, mergedProps);
|
|
2078
2182
|
};
|
|
2079
2183
|
|
|
2080
2184
|
const NumberInputLabel = props => {
|
|
2081
2185
|
const api = useNumberInputContext();
|
|
2082
|
-
const
|
|
2083
|
-
return web.createComponent(ark.label,
|
|
2186
|
+
const mergedProps = solid.mergeProps(() => api().labelProps, props);
|
|
2187
|
+
return web.createComponent(ark.label, mergedProps);
|
|
2084
2188
|
};
|
|
2085
2189
|
|
|
2086
2190
|
const NumberInputScrubber = props => {
|
|
2087
2191
|
const api = useNumberInputContext();
|
|
2088
|
-
const
|
|
2089
|
-
return web.createComponent(ark.div,
|
|
2192
|
+
const mergedProps = solid.mergeProps(() => api().scrubberProps, props);
|
|
2193
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2090
2194
|
};
|
|
2091
2195
|
|
|
2092
2196
|
const NumberInput = Object.assign(NumberInput$1, {
|
|
@@ -2121,11 +2225,11 @@ const Pagination$1 = props => {
|
|
|
2121
2225
|
const [childrenProps, localProps] = solidJs.splitProps(restProps, ['children']);
|
|
2122
2226
|
const api = usePagination(paginationParams);
|
|
2123
2227
|
const getChildren = () => runIfFn(childrenProps.children, api);
|
|
2124
|
-
const
|
|
2228
|
+
const mergedProps = solid.mergeProps(() => api().rootProps, localProps);
|
|
2125
2229
|
return web.createComponent(PaginationProvider, {
|
|
2126
2230
|
value: api,
|
|
2127
2231
|
get children() {
|
|
2128
|
-
return web.createComponent(ark.nav, web.mergeProps(
|
|
2232
|
+
return web.createComponent(ark.nav, web.mergeProps(mergedProps, {
|
|
2129
2233
|
get children() {
|
|
2130
2234
|
return getChildren();
|
|
2131
2235
|
}
|
|
@@ -2185,7 +2289,7 @@ const usePinInput = props => {
|
|
|
2185
2289
|
return solidJs.createMemo(() => pinInput__namespace.connect(state, send, solid.normalizeProps));
|
|
2186
2290
|
};
|
|
2187
2291
|
|
|
2188
|
-
const _tmpl$$
|
|
2292
|
+
const _tmpl$$6 = /*#__PURE__*/web.template(`<input>`);
|
|
2189
2293
|
const PinInput$1 = props => {
|
|
2190
2294
|
const [pinInputProps, localProps] = createSplitProps()(props, ['autoFocus', 'blurOnComplete', 'dir', 'disabled', 'form', 'getRootNode', 'id', 'ids', 'invalid', 'mask', 'name', 'onValueChange', 'onValueComplete', 'onValueInvalid', 'otp', 'pattern', 'placeholder', 'selectOnFocus', 'translations', 'type', 'value']);
|
|
2191
2295
|
const api = usePinInput(pinInputProps);
|
|
@@ -2194,7 +2298,7 @@ const PinInput$1 = props => {
|
|
|
2194
2298
|
value: api,
|
|
2195
2299
|
get children() {
|
|
2196
2300
|
return [web.createComponent(ark.div, mergedProps), (() => {
|
|
2197
|
-
const _el$ = _tmpl$$
|
|
2301
|
+
const _el$ = _tmpl$$6();
|
|
2198
2302
|
web.spread(_el$, web.mergeProps(() => api().hiddenInputProps), false, false);
|
|
2199
2303
|
return _el$;
|
|
2200
2304
|
})()];
|
|
@@ -2211,14 +2315,14 @@ const PinInputControl = props => {
|
|
|
2211
2315
|
const PinInputInput = props => {
|
|
2212
2316
|
const [inputParams, localProps] = solidJs.splitProps(props, ['index']);
|
|
2213
2317
|
const api = usePinInputContext();
|
|
2214
|
-
const
|
|
2215
|
-
return web.createComponent(ark.input,
|
|
2318
|
+
const mergedProps = solid.mergeProps(() => api().getInputProps(inputParams), localProps);
|
|
2319
|
+
return web.createComponent(ark.input, mergedProps);
|
|
2216
2320
|
};
|
|
2217
2321
|
|
|
2218
2322
|
const PinInputLabel = props => {
|
|
2219
2323
|
const api = usePinInputContext();
|
|
2220
|
-
const
|
|
2221
|
-
return web.createComponent(ark.label,
|
|
2324
|
+
const mergedProps = solid.mergeProps(() => api().labelProps, props);
|
|
2325
|
+
return web.createComponent(ark.label, mergedProps);
|
|
2222
2326
|
};
|
|
2223
2327
|
|
|
2224
2328
|
const PinInput = Object.assign(PinInput$1, {
|
|
@@ -2246,67 +2350,68 @@ const usePopover = props => {
|
|
|
2246
2350
|
};
|
|
2247
2351
|
|
|
2248
2352
|
const Popover$1 = props => {
|
|
2249
|
-
const [
|
|
2353
|
+
const [presenceProps, popoverProps] = splitPresenceProps(props);
|
|
2354
|
+
const [usePopoverProps, localProps] = createSplitProps()(popoverProps, ['autoFocus', 'closeOnEsc', 'closeOnInteractOutside', 'dir', 'getRootNode', 'id', 'ids', 'initialFocusEl', 'modal', 'onEscapeKeyDown', 'onFocusOutside', 'onInteractOutside', 'onOpenChange', 'onPointerDownOutside', 'open', 'portalled', 'positioning']);
|
|
2250
2355
|
const api = usePopover(usePopoverProps);
|
|
2356
|
+
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
2357
|
+
present: api().isOpen
|
|
2358
|
+
})));
|
|
2359
|
+
const getChildren = () => runIfFn(localProps.children, api);
|
|
2251
2360
|
return web.createComponent(PopoverProvider, {
|
|
2252
2361
|
value: api,
|
|
2253
2362
|
get children() {
|
|
2254
|
-
return
|
|
2363
|
+
return web.createComponent(PresenceProvider, {
|
|
2364
|
+
value: apiPresence,
|
|
2365
|
+
get children() {
|
|
2366
|
+
return getChildren();
|
|
2367
|
+
}
|
|
2368
|
+
});
|
|
2255
2369
|
}
|
|
2256
2370
|
});
|
|
2257
2371
|
};
|
|
2258
2372
|
|
|
2259
2373
|
const PopoverAnchor = props => {
|
|
2260
2374
|
const api = usePopoverContext();
|
|
2261
|
-
const
|
|
2262
|
-
return web.createComponent(ark.div,
|
|
2375
|
+
const mergedProps = solid.mergeProps(() => api().anchorProps, props);
|
|
2376
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2263
2377
|
};
|
|
2264
2378
|
|
|
2265
2379
|
const PopoverArrow = props => {
|
|
2266
2380
|
const popover = usePopoverContext();
|
|
2267
|
-
const
|
|
2268
|
-
return web.createComponent(ark.div,
|
|
2381
|
+
const mergedProps = solid.mergeProps(() => popover().arrowProps, props);
|
|
2382
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2269
2383
|
};
|
|
2270
2384
|
|
|
2271
2385
|
const PopoverArrowTip = props => {
|
|
2272
2386
|
const popover = usePopoverContext();
|
|
2273
|
-
const
|
|
2274
|
-
return web.createComponent(ark.div,
|
|
2387
|
+
const mergedProps = solid.mergeProps(() => popover().arrowTipProps, props);
|
|
2388
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2275
2389
|
};
|
|
2276
2390
|
|
|
2277
2391
|
const PopoverCloseTrigger = props => {
|
|
2278
2392
|
const api = usePopoverContext();
|
|
2279
|
-
const
|
|
2280
|
-
return web.createComponent(ark.button,
|
|
2393
|
+
const mergedProps = solid.mergeProps(() => api().closeTriggerProps, props);
|
|
2394
|
+
return web.createComponent(ark.button, mergedProps);
|
|
2281
2395
|
};
|
|
2282
2396
|
|
|
2283
|
-
const _tmpl$$8 = /*#__PURE__*/web.template(`<div>`);
|
|
2284
2397
|
const PopoverContent = props => {
|
|
2285
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
2286
2398
|
const api = usePopoverContext();
|
|
2287
|
-
const
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
}, presenceProps, {
|
|
2293
|
-
get fallback() {
|
|
2294
|
-
return (() => {
|
|
2295
|
-
const _el$ = _tmpl$$8();
|
|
2296
|
-
web.spread(_el$, web.mergeProps(() => api().contentProps), false, false);
|
|
2297
|
-
return _el$;
|
|
2298
|
-
})();
|
|
2399
|
+
const presenceApi = usePresenceContext();
|
|
2400
|
+
const mergedProps = solid.mergeProps(() => api().contentProps, () => presenceApi().presenceProps, props);
|
|
2401
|
+
return web.createComponent(solidJs.Show, {
|
|
2402
|
+
get when() {
|
|
2403
|
+
return !presenceApi().isUnmounted;
|
|
2299
2404
|
},
|
|
2300
2405
|
get children() {
|
|
2301
2406
|
return web.createComponent(ark.div, mergedProps);
|
|
2302
2407
|
}
|
|
2303
|
-
})
|
|
2408
|
+
});
|
|
2304
2409
|
};
|
|
2305
2410
|
|
|
2306
2411
|
const PopoverDescription = props => {
|
|
2307
2412
|
const api = usePopoverContext();
|
|
2308
|
-
const
|
|
2309
|
-
return web.createComponent(ark.div,
|
|
2413
|
+
const mergedProps = solid.mergeProps(() => api().descriptionProps, props);
|
|
2414
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2310
2415
|
};
|
|
2311
2416
|
|
|
2312
2417
|
const PopoverIndicator = props => {
|
|
@@ -2317,20 +2422,33 @@ const PopoverIndicator = props => {
|
|
|
2317
2422
|
|
|
2318
2423
|
const PopoverPositioner = props => {
|
|
2319
2424
|
const api = usePopoverContext();
|
|
2320
|
-
const
|
|
2321
|
-
|
|
2425
|
+
const presenceApi = usePresenceContext();
|
|
2426
|
+
const mergedProps = solid.mergeProps(() => api().positionerProps, props);
|
|
2427
|
+
return web.createComponent(solidJs.Show, {
|
|
2428
|
+
get when() {
|
|
2429
|
+
return !presenceApi().isUnmounted;
|
|
2430
|
+
},
|
|
2431
|
+
get children() {
|
|
2432
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2433
|
+
}
|
|
2434
|
+
});
|
|
2322
2435
|
};
|
|
2323
2436
|
|
|
2324
2437
|
const PopoverTitle = props => {
|
|
2325
2438
|
const api = usePopoverContext();
|
|
2326
|
-
const
|
|
2327
|
-
return web.createComponent(ark.div,
|
|
2439
|
+
const mergedProps = solid.mergeProps(() => api().titleProps, props);
|
|
2440
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2328
2441
|
};
|
|
2329
2442
|
|
|
2330
2443
|
const PopoverTrigger = props => {
|
|
2331
2444
|
const api = usePopoverContext();
|
|
2332
|
-
const
|
|
2333
|
-
|
|
2445
|
+
const presenceApi = usePresenceContext();
|
|
2446
|
+
const mergedProps = solid.mergeProps(() => api().triggerProps, () => ({
|
|
2447
|
+
'aria-controls': presenceApi().isUnmounted && null
|
|
2448
|
+
}), props);
|
|
2449
|
+
|
|
2450
|
+
// @ts-expect-error we want aria-controls to be null to remove them if the popover if lazy mounted
|
|
2451
|
+
return web.createComponent(ark.button, mergedProps);
|
|
2334
2452
|
};
|
|
2335
2453
|
|
|
2336
2454
|
const Popover = Object.assign(Popover$1, {
|
|
@@ -2399,13 +2517,13 @@ const RadioGroupItem = props => {
|
|
|
2399
2517
|
});
|
|
2400
2518
|
};
|
|
2401
2519
|
|
|
2402
|
-
const _tmpl$$
|
|
2520
|
+
const _tmpl$$5 = /*#__PURE__*/web.template(`<input>`);
|
|
2403
2521
|
const RadioGroupItemControl = props => {
|
|
2404
2522
|
const api = useRadioGroupContext();
|
|
2405
2523
|
const itemProps = useRadioGroupItemContext();
|
|
2406
2524
|
const mergedProps = solid.mergeProps(() => api().getItemControlProps(itemProps), props);
|
|
2407
2525
|
return [web.createComponent(ark.div, mergedProps), (() => {
|
|
2408
|
-
const _el$ = _tmpl$$
|
|
2526
|
+
const _el$ = _tmpl$$5();
|
|
2409
2527
|
web.spread(_el$, web.mergeProps(() => api().getItemHiddenInputProps(itemProps)), false, false);
|
|
2410
2528
|
return _el$;
|
|
2411
2529
|
})()];
|
|
@@ -2462,7 +2580,7 @@ const RatingGroup$1 = props => {
|
|
|
2462
2580
|
});
|
|
2463
2581
|
};
|
|
2464
2582
|
|
|
2465
|
-
const _tmpl$$
|
|
2583
|
+
const _tmpl$$4 = /*#__PURE__*/web.template(`<input>`);
|
|
2466
2584
|
const RatingGroupControl = props => {
|
|
2467
2585
|
const api = useRatingGroupContext();
|
|
2468
2586
|
const getChildren = () => runIfFn(props.children, api);
|
|
@@ -2472,7 +2590,7 @@ const RatingGroupControl = props => {
|
|
|
2472
2590
|
return getChildren();
|
|
2473
2591
|
}
|
|
2474
2592
|
})), (() => {
|
|
2475
|
-
const _el$ = _tmpl$$
|
|
2593
|
+
const _el$ = _tmpl$$4();
|
|
2476
2594
|
web.spread(_el$, web.mergeProps(() => api().hiddenInputProps), false, false);
|
|
2477
2595
|
return _el$;
|
|
2478
2596
|
})()];
|
|
@@ -2484,11 +2602,11 @@ const [RatingGroupItemProvider, useRatingGroupItemContext] = createContext({
|
|
|
2484
2602
|
});
|
|
2485
2603
|
|
|
2486
2604
|
const RatingGroupItem = props => {
|
|
2487
|
-
const [
|
|
2605
|
+
const [itemProps, localProps] = createSplitProps()(props, ['index']);
|
|
2488
2606
|
const api = useRatingGroupContext();
|
|
2489
|
-
const itemState = api().getItemState(
|
|
2490
|
-
const
|
|
2491
|
-
const
|
|
2607
|
+
const itemState = solidJs.createMemo(() => api().getItemState(itemProps));
|
|
2608
|
+
const getChildren = () => runIfFn(localProps.children, itemState);
|
|
2609
|
+
const mergedProps = solid.mergeProps(() => api().getItemProps(itemProps), localProps);
|
|
2492
2610
|
return web.createComponent(RatingGroupItemProvider, {
|
|
2493
2611
|
value: itemState,
|
|
2494
2612
|
get children() {
|
|
@@ -2566,13 +2684,13 @@ const SegmentGroupItem = props => {
|
|
|
2566
2684
|
});
|
|
2567
2685
|
};
|
|
2568
2686
|
|
|
2569
|
-
const _tmpl$$
|
|
2687
|
+
const _tmpl$$3 = /*#__PURE__*/web.template(`<input>`);
|
|
2570
2688
|
const SegmentGroupItemControl = props => {
|
|
2571
2689
|
const api = useSegmentGroupContext();
|
|
2572
2690
|
const itemProps = useSegmentGroupItemContext();
|
|
2573
2691
|
const mergedProps = solid.mergeProps(() => api().getItemControlProps(itemProps), anatomy.segmentGroupAnatomy.build().itemControl.attrs, props);
|
|
2574
2692
|
return [web.createComponent(ark.div, mergedProps), (() => {
|
|
2575
|
-
const _el$ = _tmpl$$
|
|
2693
|
+
const _el$ = _tmpl$$3();
|
|
2576
2694
|
web.spread(_el$, web.mergeProps(() => api().getItemHiddenInputProps(itemProps)), false, false);
|
|
2577
2695
|
return _el$;
|
|
2578
2696
|
})()];
|
|
@@ -2622,18 +2740,27 @@ const useSelect = props => {
|
|
|
2622
2740
|
};
|
|
2623
2741
|
|
|
2624
2742
|
const Select$1 = props => {
|
|
2625
|
-
const [
|
|
2626
|
-
const
|
|
2743
|
+
const [presenceProps, selectProps] = splitPresenceProps(props);
|
|
2744
|
+
const [useSelectProps, localProps] = createSplitProps()(selectProps, ['closeOnSelect', 'dir', 'disabled', 'form', 'getRootNode', 'highlightedValue', 'id', 'ids', 'invalid', 'isItemDisabled', 'items', 'itemToString', 'itemToValue', 'loop', 'multiple', 'name', 'onFocusOutside', 'onHighlightChange', 'onInteractOutside', 'onOpenChange', 'onPointerDownOutside', 'onValueChange', 'open', 'positioning', 'readOnly', 'selectOnBlur', 'value']);
|
|
2745
|
+
const api = useSelect(useSelectProps);
|
|
2746
|
+
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
2747
|
+
present: api().isOpen
|
|
2748
|
+
})));
|
|
2627
2749
|
const mergedProps = solid.mergeProps(() => api().rootProps, localProps);
|
|
2628
2750
|
const getChildren = () => runIfFn(localProps.children, api);
|
|
2629
2751
|
return web.createComponent(SelectProvider, {
|
|
2630
2752
|
value: api,
|
|
2631
2753
|
get children() {
|
|
2632
|
-
return web.createComponent(
|
|
2754
|
+
return web.createComponent(PresenceProvider, {
|
|
2755
|
+
value: apiPresence,
|
|
2633
2756
|
get children() {
|
|
2634
|
-
return
|
|
2757
|
+
return web.createComponent(ark.div, web.mergeProps(mergedProps, {
|
|
2758
|
+
get children() {
|
|
2759
|
+
return getChildren();
|
|
2760
|
+
}
|
|
2761
|
+
}));
|
|
2635
2762
|
}
|
|
2636
|
-
})
|
|
2763
|
+
});
|
|
2637
2764
|
}
|
|
2638
2765
|
});
|
|
2639
2766
|
};
|
|
@@ -2644,36 +2771,27 @@ const SelectClearTrigger = props => {
|
|
|
2644
2771
|
return web.createComponent(ark.button, mergedProps);
|
|
2645
2772
|
};
|
|
2646
2773
|
|
|
2647
|
-
const _tmpl$$4 = /*#__PURE__*/web.template(`<div>`);
|
|
2648
2774
|
const SelectContent = props => {
|
|
2649
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
2650
2775
|
const api = useSelectContext();
|
|
2651
|
-
const
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
}, presenceProps, {
|
|
2657
|
-
get fallback() {
|
|
2658
|
-
return (() => {
|
|
2659
|
-
const _el$ = _tmpl$$4();
|
|
2660
|
-
web.spread(_el$, web.mergeProps(() => api().contentProps), false, false);
|
|
2661
|
-
return _el$;
|
|
2662
|
-
})();
|
|
2776
|
+
const presenceApi = usePresenceContext();
|
|
2777
|
+
const mergedProps = solid.mergeProps(() => api().contentProps, () => presenceApi().presenceProps, props);
|
|
2778
|
+
return web.createComponent(solidJs.Show, {
|
|
2779
|
+
get when() {
|
|
2780
|
+
return !presenceApi().isUnmounted;
|
|
2663
2781
|
},
|
|
2664
2782
|
get children() {
|
|
2665
2783
|
return web.createComponent(ark.div, mergedProps);
|
|
2666
2784
|
}
|
|
2667
|
-
})
|
|
2785
|
+
});
|
|
2668
2786
|
};
|
|
2669
2787
|
|
|
2670
|
-
const _tmpl$$
|
|
2788
|
+
const _tmpl$$2 = /*#__PURE__*/web.template(`<select>`),
|
|
2671
2789
|
_tmpl$2 = /*#__PURE__*/web.template(`<option>`);
|
|
2672
2790
|
const SelectControl = props => {
|
|
2673
2791
|
const api = useSelectContext();
|
|
2674
2792
|
const mergedProps = solid.mergeProps(() => api().controlProps, props);
|
|
2675
2793
|
return [web.createComponent(ark.div, mergedProps), (() => {
|
|
2676
|
-
const _el$ = _tmpl$$
|
|
2794
|
+
const _el$ = _tmpl$$2();
|
|
2677
2795
|
web.spread(_el$, web.mergeProps(() => api().hiddenSelectProps), false, true);
|
|
2678
2796
|
web.insert(_el$, web.createComponent(solidJs.Index, {
|
|
2679
2797
|
get each() {
|
|
@@ -2756,8 +2874,16 @@ const SelectLabel = props => {
|
|
|
2756
2874
|
|
|
2757
2875
|
const SelectPositioner = props => {
|
|
2758
2876
|
const api = useSelectContext();
|
|
2877
|
+
const presenceApi = usePresenceContext();
|
|
2759
2878
|
const mergedProps = solid.mergeProps(() => api().positionerProps, props);
|
|
2760
|
-
return web.createComponent(
|
|
2879
|
+
return web.createComponent(solidJs.Show, {
|
|
2880
|
+
get when() {
|
|
2881
|
+
return !presenceApi().isUnmounted;
|
|
2882
|
+
},
|
|
2883
|
+
get children() {
|
|
2884
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2885
|
+
}
|
|
2886
|
+
});
|
|
2761
2887
|
};
|
|
2762
2888
|
|
|
2763
2889
|
const SelectTrigger = props => {
|
|
@@ -2861,8 +2987,8 @@ const SliderRange = props => {
|
|
|
2861
2987
|
const SliderThumb = props => {
|
|
2862
2988
|
const [thumbProps, localProps] = createSplitProps()(props, ['index']);
|
|
2863
2989
|
const api = useSliderContext();
|
|
2864
|
-
const
|
|
2865
|
-
return web.createComponent(ark.div,
|
|
2990
|
+
const mergedProps = solid.mergeProps(() => api().getThumbProps(thumbProps), localProps);
|
|
2991
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2866
2992
|
};
|
|
2867
2993
|
|
|
2868
2994
|
const SliderTrack = props => {
|
|
@@ -2873,11 +2999,11 @@ const SliderTrack = props => {
|
|
|
2873
2999
|
|
|
2874
3000
|
const SliderValueText = props => {
|
|
2875
3001
|
const api = useSliderContext();
|
|
2876
|
-
const getChildren = () => runIfFn(props.children, api);
|
|
2877
3002
|
const mergedProps = solid.mergeProps(() => api().valueTextProps, props);
|
|
3003
|
+
const getChildren = solidJs.children(() => props.children);
|
|
2878
3004
|
return web.createComponent(ark.div, web.mergeProps(mergedProps, {
|
|
2879
3005
|
get children() {
|
|
2880
|
-
return getChildren();
|
|
3006
|
+
return getChildren() || api().value.join(',');
|
|
2881
3007
|
}
|
|
2882
3008
|
}));
|
|
2883
3009
|
};
|
|
@@ -2915,11 +3041,11 @@ const Splitter$1 = props => {
|
|
|
2915
3041
|
const [splitterParams, localProps] = createSplitProps()(props, ['dir', 'getRootNode', 'id', 'ids', 'onSizeChange', 'onSizeChangeEnd', 'onSizeChangeStart', 'orientation', 'size']);
|
|
2916
3042
|
const api = useSplitter(splitterParams);
|
|
2917
3043
|
const getChildren = () => runIfFn(localProps.children, api);
|
|
2918
|
-
const
|
|
3044
|
+
const mergedProps = solid.mergeProps(() => api().rootProps, localProps);
|
|
2919
3045
|
return web.createComponent(SplitterProvider, {
|
|
2920
3046
|
value: api,
|
|
2921
3047
|
get children() {
|
|
2922
|
-
return web.createComponent(ark.div, web.mergeProps(
|
|
3048
|
+
return web.createComponent(ark.div, web.mergeProps(mergedProps, {
|
|
2923
3049
|
get children() {
|
|
2924
3050
|
return getChildren();
|
|
2925
3051
|
}
|
|
@@ -2931,15 +3057,15 @@ const Splitter$1 = props => {
|
|
|
2931
3057
|
const SplitterPanel = props => {
|
|
2932
3058
|
const [panelParams, restProps] = createSplitProps()(props, ['id', 'snapSize']);
|
|
2933
3059
|
const api = useSplitterContext();
|
|
2934
|
-
const
|
|
2935
|
-
return web.createComponent(ark.div,
|
|
3060
|
+
const mergedProps = solid.mergeProps(() => api().getPanelProps(panelParams), restProps);
|
|
3061
|
+
return web.createComponent(ark.div, mergedProps);
|
|
2936
3062
|
};
|
|
2937
3063
|
|
|
2938
3064
|
const SplitterResizeTrigger = props => {
|
|
2939
3065
|
const api = useSplitterContext();
|
|
2940
3066
|
const [triggerParams, restProps] = createSplitProps()(props, ['disabled', 'id', 'step']);
|
|
2941
|
-
const
|
|
2942
|
-
return web.createComponent(ark.button,
|
|
3067
|
+
const mergedProps = solid.mergeProps(() => api().getResizeTriggerProps(triggerParams), restProps);
|
|
3068
|
+
return web.createComponent(ark.button, mergedProps);
|
|
2943
3069
|
};
|
|
2944
3070
|
|
|
2945
3071
|
const Splitter = Object.assign(Splitter$1, {
|
|
@@ -2982,12 +3108,12 @@ const Switch$1 = props => {
|
|
|
2982
3108
|
});
|
|
2983
3109
|
};
|
|
2984
3110
|
|
|
2985
|
-
const _tmpl$$
|
|
3111
|
+
const _tmpl$$1 = /*#__PURE__*/web.template(`<input>`);
|
|
2986
3112
|
const SwitchControl = props => {
|
|
2987
3113
|
const api = useSwitchContext();
|
|
2988
3114
|
const mergedProps = solid.mergeProps(() => api().controlProps, props);
|
|
2989
3115
|
return [web.createComponent(ark.span, mergedProps), (() => {
|
|
2990
|
-
const _el$ = _tmpl$$
|
|
3116
|
+
const _el$ = _tmpl$$1();
|
|
2991
3117
|
web.spread(_el$, web.mergeProps(() => api().hiddenInputProps), false, false);
|
|
2992
3118
|
return _el$;
|
|
2993
3119
|
})()];
|
|
@@ -2995,14 +3121,14 @@ const SwitchControl = props => {
|
|
|
2995
3121
|
|
|
2996
3122
|
const SwitchLabel = props => {
|
|
2997
3123
|
const checkbox = useSwitchContext();
|
|
2998
|
-
const
|
|
2999
|
-
return web.createComponent(ark.span,
|
|
3124
|
+
const mergedProps = solid.mergeProps(() => checkbox().labelProps, props);
|
|
3125
|
+
return web.createComponent(ark.span, mergedProps);
|
|
3000
3126
|
};
|
|
3001
3127
|
|
|
3002
3128
|
const SwitchThumb = props => {
|
|
3003
3129
|
const checkbox = useSwitchContext();
|
|
3004
|
-
const
|
|
3005
|
-
return web.createComponent(ark.span,
|
|
3130
|
+
const mergedProps = solid.mergeProps(() => checkbox().thumbProps, props);
|
|
3131
|
+
return web.createComponent(ark.span, mergedProps);
|
|
3006
3132
|
};
|
|
3007
3133
|
|
|
3008
3134
|
const Switch = Object.assign(Switch$1, {
|
|
@@ -3017,44 +3143,46 @@ const [TabsProvider, useTabsContext] = createContext({
|
|
|
3017
3143
|
providerName: '<TabsProvider />'
|
|
3018
3144
|
});
|
|
3019
3145
|
|
|
3020
|
-
const TabPresence = props => {
|
|
3021
|
-
const api = useTabsContext();
|
|
3022
|
-
return web.createComponent(Presence, web.mergeProps({
|
|
3023
|
-
get present() {
|
|
3024
|
-
return api().value === props.value;
|
|
3025
|
-
}
|
|
3026
|
-
}, props));
|
|
3027
|
-
};
|
|
3028
|
-
|
|
3029
3146
|
const TabContent = props => {
|
|
3030
|
-
const [
|
|
3031
|
-
const [getContentProps, restProps] = createSplitProps()(localProps, ['value']);
|
|
3147
|
+
const [contentProps, localProps] = createSplitProps()(props, ['value']);
|
|
3032
3148
|
const api = useTabsContext();
|
|
3033
|
-
const
|
|
3034
|
-
|
|
3149
|
+
const presenceProps = usePresencePropsContext();
|
|
3150
|
+
const presenceApi = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
3151
|
+
present: api().value === contentProps.value
|
|
3152
|
+
})));
|
|
3153
|
+
const mergedProps = solid.mergeProps(() => api().getContentProps(contentProps), () => presenceApi().presenceProps, localProps);
|
|
3154
|
+
return web.createComponent(PresenceProvider, {
|
|
3155
|
+
value: presenceApi,
|
|
3035
3156
|
get children() {
|
|
3036
|
-
return web.createComponent(
|
|
3157
|
+
return web.createComponent(solidJs.Show, {
|
|
3158
|
+
get when() {
|
|
3159
|
+
return !presenceApi().isUnmounted;
|
|
3160
|
+
},
|
|
3161
|
+
get children() {
|
|
3162
|
+
return web.createComponent(ark.div, mergedProps);
|
|
3163
|
+
}
|
|
3164
|
+
});
|
|
3037
3165
|
}
|
|
3038
|
-
})
|
|
3166
|
+
});
|
|
3039
3167
|
};
|
|
3040
3168
|
|
|
3041
3169
|
const TabIndicator = props => {
|
|
3042
3170
|
const api = useTabsContext();
|
|
3043
|
-
const
|
|
3044
|
-
return web.createComponent(ark.div,
|
|
3171
|
+
const mergedProps = solid.mergeProps(() => api().indicatorProps, props);
|
|
3172
|
+
return web.createComponent(ark.div, mergedProps);
|
|
3045
3173
|
};
|
|
3046
3174
|
|
|
3047
3175
|
const TabList = props => {
|
|
3048
3176
|
const api = useTabsContext();
|
|
3049
|
-
const
|
|
3050
|
-
return web.createComponent(ark.div,
|
|
3177
|
+
const mergedProps = solid.mergeProps(() => api().tablistProps, props);
|
|
3178
|
+
return web.createComponent(ark.div, mergedProps);
|
|
3051
3179
|
};
|
|
3052
3180
|
|
|
3053
3181
|
const TabTrigger = props => {
|
|
3054
3182
|
const [tabParams, restProps] = createSplitProps()(props, ['disabled', 'value']);
|
|
3055
3183
|
const api = useTabsContext();
|
|
3056
|
-
const
|
|
3057
|
-
return web.createComponent(ark.button,
|
|
3184
|
+
const mergedProps = solid.mergeProps(() => api().getTriggerProps(tabParams), restProps);
|
|
3185
|
+
return web.createComponent(ark.button, mergedProps);
|
|
3058
3186
|
};
|
|
3059
3187
|
|
|
3060
3188
|
const useTabs = props => {
|
|
@@ -3070,13 +3198,19 @@ const useTabs = props => {
|
|
|
3070
3198
|
};
|
|
3071
3199
|
|
|
3072
3200
|
const Tabs$1 = props => {
|
|
3073
|
-
const [
|
|
3201
|
+
const [presenceProps, tabsProps] = splitPresenceProps(props);
|
|
3202
|
+
const [tabsParams, restProps] = createSplitProps()(tabsProps, ['activationMode', 'dir', 'getRootNode', 'id', 'ids', 'loop', 'onFocusChange', 'onValueChange', 'orientation', 'translations', 'value']);
|
|
3074
3203
|
const api = useTabs(tabsParams);
|
|
3075
|
-
const
|
|
3204
|
+
const mergedProps = solid.mergeProps(() => api().rootProps, restProps);
|
|
3076
3205
|
return web.createComponent(TabsProvider, {
|
|
3077
3206
|
value: api,
|
|
3078
3207
|
get children() {
|
|
3079
|
-
return web.createComponent(
|
|
3208
|
+
return web.createComponent(PresencePropsProvider, {
|
|
3209
|
+
value: presenceProps,
|
|
3210
|
+
get children() {
|
|
3211
|
+
return web.createComponent(ark.div, mergedProps);
|
|
3212
|
+
}
|
|
3213
|
+
});
|
|
3080
3214
|
}
|
|
3081
3215
|
});
|
|
3082
3216
|
};
|
|
@@ -3106,7 +3240,7 @@ const useTagsInput = props => {
|
|
|
3106
3240
|
return solidJs.createMemo(() => tagsInput__namespace.connect(state, send, solid.normalizeProps));
|
|
3107
3241
|
};
|
|
3108
3242
|
|
|
3109
|
-
const _tmpl
|
|
3243
|
+
const _tmpl$ = /*#__PURE__*/web.template(`<input>`);
|
|
3110
3244
|
const TagsInput$1 = props => {
|
|
3111
3245
|
const [tagsInputParams, restProps] = createSplitProps()(props, ['addOnPaste', 'allowEditTag', 'allowOverflow', 'autoFocus', 'blurBehavior', 'delimiter', 'dir', 'disabled', 'form', 'getRootNode', 'id', 'ids', 'inputValue', 'invalid', 'max', 'maxLength', 'name', 'onFocusOutside', 'onHighlightChange', 'onInteractOutside', 'onPointerDownOutside', 'onValueChange', 'onValueInvalid', 'readOnly', 'translations', 'validate', 'value']);
|
|
3112
3246
|
const api = useTagsInput(tagsInputParams);
|
|
@@ -3120,7 +3254,7 @@ const TagsInput$1 = props => {
|
|
|
3120
3254
|
return getChildren();
|
|
3121
3255
|
}
|
|
3122
3256
|
})), (() => {
|
|
3123
|
-
const _el$ = _tmpl
|
|
3257
|
+
const _el$ = _tmpl$();
|
|
3124
3258
|
web.spread(_el$, web.mergeProps(() => api().hiddenInputProps), false, false);
|
|
3125
3259
|
return _el$;
|
|
3126
3260
|
})()];
|
|
@@ -3316,11 +3450,11 @@ const useToggleGroup = props => {
|
|
|
3316
3450
|
const ToggleGroup$1 = props => {
|
|
3317
3451
|
const [groupParams, restProps] = createSplitProps()(props, ['dir', 'disabled', 'getRootNode', 'id', 'ids', 'loop', 'multiple', 'onValueChange', 'orientation', 'rovingFocus', 'value']);
|
|
3318
3452
|
const api = useToggleGroup(groupParams);
|
|
3319
|
-
const
|
|
3453
|
+
const mergedProps = solid.mergeProps(() => api().rootProps, restProps);
|
|
3320
3454
|
return web.createComponent(ToggleGroupProvider, {
|
|
3321
3455
|
value: api,
|
|
3322
3456
|
get children() {
|
|
3323
|
-
return web.createComponent(ark.div,
|
|
3457
|
+
return web.createComponent(ark.div, mergedProps);
|
|
3324
3458
|
}
|
|
3325
3459
|
});
|
|
3326
3460
|
};
|
|
@@ -3355,58 +3489,70 @@ const useTooltip = props => {
|
|
|
3355
3489
|
};
|
|
3356
3490
|
|
|
3357
3491
|
const Tooltip$1 = props => {
|
|
3358
|
-
const [
|
|
3492
|
+
const [presenceProps, tooltipProps] = splitPresenceProps(props);
|
|
3493
|
+
const [useTooltipProps, localProps] = createSplitProps()(tooltipProps, ['aria-label', 'closeDelay', 'closeOnEsc', 'closeOnPointerDown', 'dir', 'disabled', 'getRootNode', 'id', 'ids', 'interactive', 'onOpenChange', 'open', 'openDelay', 'positioning']);
|
|
3359
3494
|
const api = useTooltip(useTooltipProps);
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
}
|
|
3495
|
+
const apiPresence = usePresence(solid.mergeProps(presenceProps, () => ({
|
|
3496
|
+
present: api().isOpen
|
|
3497
|
+
})));
|
|
3498
|
+
const getChildren = () => runIfFn(localProps.children, api);
|
|
3499
|
+
return web.createComponent(TooltipProvider, {
|
|
3500
|
+
value: api,
|
|
3501
|
+
get children() {
|
|
3502
|
+
return web.createComponent(PresenceProvider, {
|
|
3503
|
+
value: apiPresence,
|
|
3504
|
+
get children() {
|
|
3505
|
+
return getChildren();
|
|
3506
|
+
}
|
|
3507
|
+
});
|
|
3508
|
+
}
|
|
3509
|
+
});
|
|
3363
3510
|
};
|
|
3364
3511
|
|
|
3365
3512
|
const TooltipArrow = props => {
|
|
3366
3513
|
const tooltip = useTooltipContext();
|
|
3367
|
-
const
|
|
3368
|
-
return web.createComponent(ark.div,
|
|
3514
|
+
const mergedProps = solid.mergeProps(() => tooltip().arrowProps, props);
|
|
3515
|
+
return web.createComponent(ark.div, mergedProps);
|
|
3369
3516
|
};
|
|
3370
3517
|
|
|
3371
3518
|
const TooltipArrowTip = props => {
|
|
3372
3519
|
const api = useTooltipContext();
|
|
3373
|
-
const
|
|
3374
|
-
return web.createComponent(ark.div,
|
|
3520
|
+
const mergedProps = solid.mergeProps(() => api().arrowTipProps, props);
|
|
3521
|
+
return web.createComponent(ark.div, mergedProps);
|
|
3375
3522
|
};
|
|
3376
3523
|
|
|
3377
|
-
const _tmpl$ = /*#__PURE__*/web.template(`<div>`);
|
|
3378
3524
|
const TooltipContent = props => {
|
|
3379
|
-
const [presenceProps, localProps] = splitPresenceProps(props);
|
|
3380
3525
|
const api = useTooltipContext();
|
|
3381
|
-
const
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
}, presenceProps, {
|
|
3387
|
-
get fallback() {
|
|
3388
|
-
return (() => {
|
|
3389
|
-
const _el$ = _tmpl$();
|
|
3390
|
-
web.spread(_el$, web.mergeProps(() => api().contentProps), false, false);
|
|
3391
|
-
return _el$;
|
|
3392
|
-
})();
|
|
3526
|
+
const presenceApi = usePresenceContext();
|
|
3527
|
+
const mergedProps = solid.mergeProps(() => api().contentProps, () => presenceApi().presenceProps, props);
|
|
3528
|
+
return web.createComponent(solidJs.Show, {
|
|
3529
|
+
get when() {
|
|
3530
|
+
return !presenceApi().isUnmounted;
|
|
3393
3531
|
},
|
|
3394
3532
|
get children() {
|
|
3395
|
-
return web.createComponent(ark.div,
|
|
3533
|
+
return web.createComponent(ark.div, mergedProps);
|
|
3396
3534
|
}
|
|
3397
|
-
})
|
|
3535
|
+
});
|
|
3398
3536
|
};
|
|
3399
3537
|
|
|
3400
3538
|
const TooltipPositioner = props => {
|
|
3401
3539
|
const api = useTooltipContext();
|
|
3402
|
-
const
|
|
3403
|
-
|
|
3540
|
+
const presenceApi = usePresenceContext();
|
|
3541
|
+
const mergedProps = solid.mergeProps(() => api().positionerProps, props);
|
|
3542
|
+
return web.createComponent(solidJs.Show, {
|
|
3543
|
+
get when() {
|
|
3544
|
+
return !presenceApi().isUnmounted;
|
|
3545
|
+
},
|
|
3546
|
+
get children() {
|
|
3547
|
+
return web.createComponent(ark.div, mergedProps);
|
|
3548
|
+
}
|
|
3549
|
+
});
|
|
3404
3550
|
};
|
|
3405
3551
|
|
|
3406
3552
|
const TooltipTrigger = props => {
|
|
3407
3553
|
const api = useTooltipContext();
|
|
3408
|
-
const
|
|
3409
|
-
return web.createComponent(ark.button,
|
|
3554
|
+
const mergedProps = solid.mergeProps(() => api().triggerProps, props);
|
|
3555
|
+
return web.createComponent(ark.button, mergedProps);
|
|
3410
3556
|
};
|
|
3411
3557
|
|
|
3412
3558
|
const Tooltip = Object.assign(Tooltip$1, {
|
|
@@ -3559,6 +3705,8 @@ exports.PopoverPositioner = PopoverPositioner;
|
|
|
3559
3705
|
exports.PopoverTitle = PopoverTitle;
|
|
3560
3706
|
exports.PopoverTrigger = PopoverTrigger;
|
|
3561
3707
|
exports.Presence = Presence;
|
|
3708
|
+
exports.PresencePropsProvider = PresencePropsProvider;
|
|
3709
|
+
exports.PresenceProvider = PresenceProvider;
|
|
3562
3710
|
exports.RadioGroup = RadioGroup;
|
|
3563
3711
|
exports.RadioGroupItem = RadioGroupItem;
|
|
3564
3712
|
exports.RadioGroupItemControl = RadioGroupItemControl;
|
|
@@ -3655,6 +3803,9 @@ exports.useNumberInputContext = useNumberInputContext;
|
|
|
3655
3803
|
exports.usePaginationContext = usePaginationContext;
|
|
3656
3804
|
exports.usePinInputContext = usePinInputContext;
|
|
3657
3805
|
exports.usePopoverContext = usePopoverContext;
|
|
3806
|
+
exports.usePresence = usePresence;
|
|
3807
|
+
exports.usePresenceContext = usePresenceContext;
|
|
3808
|
+
exports.usePresencePropsContext = usePresencePropsContext;
|
|
3658
3809
|
exports.useRadioGroupContext = useRadioGroupContext;
|
|
3659
3810
|
exports.useRadioGroupItemContext = useRadioGroupItemContext;
|
|
3660
3811
|
exports.useRatingGroupContext = useRatingGroupContext;
|