@jobber/components 8.14.0 → 8.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FilterPicker.d.ts +1 -0
- package/{Combobox.js → FilterPicker.js} +3 -3
- package/dist/Autocomplete-es.js +1 -1
- package/dist/BottomSheet-cjs.js +109 -77
- package/dist/BottomSheet-es.js +103 -75
- package/dist/Card/index.cjs +1 -2
- package/dist/Card/index.mjs +1 -2
- package/dist/DataDump/index.cjs +1 -2
- package/dist/DataDump/index.mjs +1 -2
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +11 -11
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +11 -11
- package/dist/DataList/components/DataListFilters/index.cjs +11 -11
- package/dist/DataList/components/DataListFilters/index.mjs +11 -11
- package/dist/DataList/index.cjs +11 -11
- package/dist/DataList/index.mjs +11 -11
- package/dist/DataListSort-cjs.js +5 -5
- package/dist/DataListSort-es.js +5 -5
- package/dist/FilterPicker/FilterPicker.d.ts +11 -0
- package/dist/{Combobox/Combobox.types.d.ts → FilterPicker/FilterPicker.types.d.ts} +51 -51
- package/dist/FilterPicker/FilterPickerProvider.d.ts +18 -0
- package/dist/FilterPicker/components/FilterPickerAction/FilterPickerAction.d.ts +3 -0
- package/dist/FilterPicker/components/FilterPickerAction/index.cjs +12 -0
- package/dist/FilterPicker/components/FilterPickerAction/index.d.ts +1 -0
- package/dist/FilterPicker/components/FilterPickerAction/index.mjs +6 -0
- package/dist/FilterPicker/components/FilterPickerActivator/FilterPickerActivator.d.ts +3 -0
- package/dist/{Combobox/components/ComboboxActivator → FilterPicker/components/FilterPickerActivator}/index.cjs +3 -3
- package/dist/FilterPicker/components/FilterPickerActivator/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxActivator → FilterPicker/components/FilterPickerActivator}/index.mjs +2 -2
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContent.d.ts +3 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentHeader/FilterPickerContentHeader.d.ts +3 -0
- package/dist/{Combobox/components/ComboboxContent/ComboboxContentHeader → FilterPicker/components/FilterPickerContent/FilterPickerContentHeader}/index.cjs +2 -2
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentHeader/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxContent/ComboboxContentHeader → FilterPicker/components/FilterPickerContent/FilterPickerContentHeader}/index.mjs +1 -1
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentList/FilterPickerContentList.d.ts +3 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentList/FilterPickerContentList.module.css.d.ts +13 -0
- package/dist/{Combobox/components/ComboboxContent/ComboboxContentList → FilterPicker/components/FilterPickerContent/FilterPickerContentList}/index.cjs +5 -5
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentList/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxContent/ComboboxContentList → FilterPicker/components/FilterPickerContent/FilterPickerContentList}/index.mjs +4 -4
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/FilterPickerContentSearch.d.ts +3 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/index.cjs +10 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/index.d.ts +1 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerContentSearch/index.mjs +4 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerLoadMore/FilterPickerLoadMore.d.ts +6 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerLoadMore/index.cjs +9 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerLoadMore/index.d.ts +1 -0
- package/dist/FilterPicker/components/FilterPickerContent/FilterPickerLoadMore/index.mjs +3 -0
- package/dist/{Combobox/components/ComboboxContent → FilterPicker/components/FilterPickerContent}/index.cjs +8 -8
- package/dist/FilterPicker/components/FilterPickerContent/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxContent → FilterPicker/components/FilterPickerContent}/index.mjs +7 -7
- package/dist/FilterPicker/components/FilterPickerOption/FilterPickerOption.d.ts +3 -0
- package/dist/{Combobox/components/ComboboxOption → FilterPicker/components/FilterPickerOption}/index.cjs +3 -3
- package/dist/FilterPicker/components/FilterPickerOption/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxOption → FilterPicker/components/FilterPickerOption}/index.mjs +2 -2
- package/dist/FilterPicker/components/FilterPickerTrigger/FilterPickerTrigger.d.ts +3 -0
- package/dist/{Combobox/components/ComboboxTrigger → FilterPicker/components/FilterPickerTrigger}/index.cjs +3 -3
- package/dist/FilterPicker/components/FilterPickerTrigger/index.d.ts +1 -0
- package/dist/{Combobox/components/ComboboxTrigger → FilterPicker/components/FilterPickerTrigger}/index.mjs +2 -2
- package/dist/FilterPicker/constants.d.ts +1 -0
- package/dist/FilterPicker/hooks/useFilterPicker.d.ts +17 -0
- package/dist/FilterPicker/hooks/useFilterPickerAccessibility.d.ts +9 -0
- package/dist/FilterPicker/hooks/useFilterPickerActivatorAccessibility.d.ts +2 -0
- package/dist/FilterPicker/hooks/useFilterPickerContent.d.ts +9 -0
- package/dist/FilterPicker/hooks/useFilterPickerValidation.d.ts +12 -0
- package/dist/FilterPicker/hooks/useMakeFilterPickerHandlers.d.ts +8 -0
- package/dist/{Combobox → FilterPicker}/index.cjs +13 -13
- package/dist/FilterPicker/index.d.ts +3 -0
- package/dist/{Combobox → FilterPicker}/index.mjs +11 -11
- package/dist/{Combobox-cjs.js → FilterPicker-cjs.js} +25 -25
- package/dist/{Combobox-es.js → FilterPicker-es.js} +25 -25
- package/dist/{ComboboxAction-cjs.js → FilterPickerAction-cjs.js} +5 -5
- package/dist/{ComboboxAction-es.js → FilterPickerAction-es.js} +5 -5
- package/dist/{ComboboxActivator-cjs.js → FilterPickerActivator-cjs.js} +8 -8
- package/dist/{ComboboxActivator-es.js → FilterPickerActivator-es.js} +9 -9
- package/dist/{ComboboxContent-cjs.js → FilterPickerContent-cjs.js} +19 -19
- package/dist/{ComboboxContent-es.js → FilterPickerContent-es.js} +20 -20
- package/dist/{ComboboxContentHeader-cjs.js → FilterPickerContentHeader-cjs.js} +4 -4
- package/dist/{ComboboxContentHeader-es.js → FilterPickerContentHeader-es.js} +4 -4
- package/dist/{ComboboxContentList-cjs.js → FilterPickerContentList-cjs.js} +7 -7
- package/dist/{ComboboxContentList-es.js → FilterPickerContentList-es.js} +7 -7
- package/dist/{ComboboxContentSearch-cjs.js → FilterPickerContentSearch-cjs.js} +4 -4
- package/dist/{ComboboxContentSearch-es.js → FilterPickerContentSearch-es.js} +4 -4
- package/dist/FilterPickerLoadMore-cjs.js +16 -0
- package/dist/{ComboboxLoadMore-es.js → FilterPickerLoadMore-es.js} +4 -4
- package/dist/{ComboboxOption-cjs.js → FilterPickerOption-cjs.js} +5 -5
- package/dist/{ComboboxOption-es.js → FilterPickerOption-es.js} +5 -5
- package/dist/FilterPickerProvider-cjs.js +13 -0
- package/dist/FilterPickerProvider-es.js +10 -0
- package/dist/{ComboboxTrigger-cjs.js → FilterPickerTrigger-cjs.js} +4 -4
- package/dist/{ComboboxTrigger-es.js → FilterPickerTrigger-es.js} +4 -4
- package/dist/InputNumberExperimental-cjs.js +3 -4
- package/dist/InputNumberExperimental-es.js +2 -3
- package/dist/Menu/index.cjs +1 -2
- package/dist/Menu/index.mjs +1 -2
- package/dist/Menu-cjs.js +11 -56
- package/dist/Menu-es.js +4 -49
- package/dist/MenuSubmenuTrigger-cjs.js +160 -345
- package/dist/MenuSubmenuTrigger-es.js +4 -186
- package/dist/Modal/index.mjs +1 -1
- package/dist/NumberFieldInput-cjs.js +3 -4
- package/dist/NumberFieldInput-es.js +2 -3
- package/dist/Page/index.cjs +1 -2
- package/dist/Page/index.mjs +1 -2
- package/dist/{DrawerRoot-cjs.js → ScrollAreaViewport-cjs.js} +1042 -3
- package/dist/{DrawerRoot-es.js → ScrollAreaViewport-es.js} +1035 -5
- package/dist/constants-cjs.js +2 -2
- package/dist/constants-es.js +2 -2
- package/dist/docs/Autocomplete/Autocomplete.md +1 -1
- package/dist/docs/Chip/Chip.md +4 -4
- package/dist/docs/DataList/DataList.md +16 -15
- package/dist/docs/{Combobox/Combobox.md → FilterPicker/FilterPicker.md} +91 -85
- package/dist/docs/Menu/Menu.md +1 -1
- package/dist/docs/MultiSelect/MultiSelect.md +1 -1
- package/dist/docs/Tabs/Tabs.md +2 -2
- package/dist/docs/index.md +1 -1
- package/dist/docs/usage-guidelines/usage-guidelines.md +5 -5
- package/dist/floating-ui.react-es.js +1 -1
- package/dist/index.cjs +14 -15
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +12 -13
- package/dist/primitives/BottomSheet/BottomSheet.d.ts +15 -16
- package/dist/primitives/BottomSheet/BottomSheet.types.d.ts +27 -0
- package/dist/primitives/BottomSheet/BottomSheet.utils.d.ts +6 -0
- package/dist/primitives/BottomSheet/index.cjs +7 -2
- package/dist/primitives/BottomSheet/index.d.ts +1 -0
- package/dist/primitives/BottomSheet/index.mjs +7 -2
- package/dist/primitives/InputNumberExperimental/index.cjs +1 -2
- package/dist/primitives/InputNumberExperimental/index.mjs +1 -2
- package/dist/primitives/index.cjs +7 -8
- package/dist/primitives/index.mjs +7 -8
- package/dist/styles.css +115 -54
- package/dist/unstyledPrimitives/index.cjs +665 -297
- package/dist/unstyledPrimitives/index.d.ts +1 -0
- package/dist/unstyledPrimitives/index.mjs +375 -8
- package/dist/useRenderElement-es.js +1 -1
- package/dist/useValueChanged-cjs.js +251 -1
- package/dist/useValueChanged-es.js +248 -2
- package/dist/utils/meta/meta.json +5 -5
- package/package.json +6 -6
- package/rollup.config.mjs +2 -2
- package/Combobox.d.ts +0 -1
- package/dist/Combobox/Combobox.d.ts +0 -11
- package/dist/Combobox/ComboboxProvider.d.ts +0 -18
- package/dist/Combobox/components/ComboboxAction/ComboboxAction.d.ts +0 -3
- package/dist/Combobox/components/ComboboxAction/index.cjs +0 -12
- package/dist/Combobox/components/ComboboxAction/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxAction/index.mjs +0 -6
- package/dist/Combobox/components/ComboboxActivator/ComboboxActivator.d.ts +0 -3
- package/dist/Combobox/components/ComboboxActivator/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContent.d.ts +0 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/ComboboxContentHeader.d.ts +0 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/ComboboxContentList.d.ts +0 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentList/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/ComboboxContentSearch.d.ts +0 -3
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.cjs +0 -10
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxContentSearch/index.mjs +0 -4
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/ComboboxLoadMore.d.ts +0 -6
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.cjs +0 -9
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxContent/ComboboxLoadMore/index.mjs +0 -3
- package/dist/Combobox/components/ComboboxContent/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxOption/ComboboxOption.d.ts +0 -3
- package/dist/Combobox/components/ComboboxOption/index.d.ts +0 -1
- package/dist/Combobox/components/ComboboxTrigger/ComboboxTrigger.d.ts +0 -3
- package/dist/Combobox/components/ComboboxTrigger/index.d.ts +0 -1
- package/dist/Combobox/constants.d.ts +0 -1
- package/dist/Combobox/hooks/useCombobox.d.ts +0 -17
- package/dist/Combobox/hooks/useComboboxAccessibility.d.ts +0 -9
- package/dist/Combobox/hooks/useComboboxActivatorAccessibility.d.ts +0 -2
- package/dist/Combobox/hooks/useComboboxContent.d.ts +0 -9
- package/dist/Combobox/hooks/useComboboxValidation.d.ts +0 -12
- package/dist/Combobox/hooks/useMakeComboboxHandlers.d.ts +0 -8
- package/dist/Combobox/index.d.ts +0 -3
- package/dist/ComboboxLoadMore-cjs.js +0 -16
- package/dist/ComboboxProvider-cjs.js +0 -13
- package/dist/ComboboxProvider-es.js +0 -10
- package/dist/useBaseUiId-cjs.js +0 -275
- package/dist/useBaseUiId-es.js +0 -251
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { u as useDialogRootContext,
|
|
3
|
-
import { u as useRenderElement,
|
|
4
|
-
import {
|
|
5
|
-
import { a as useButton, u as useBaseUiId, b as useCompositeRootContext } from './useBaseUiId-es.js';
|
|
2
|
+
import { u as useDialogRootContext, g as useFloatingParentNodeId, F as FloatingRootStore, P as PopupTriggerMap, h as useFloatingTree, i as getTarget, j as isTypeableElement, m as matchesFocusVisible, k as isTargetInsideEnabledTrigger, l as createAttribute, n as activeElement, o as contains, T as TYPEABLE_SELECTOR, p as getNodeChildren, q as getFloatingFocusElement, r as isTypeableCombobox, s as isIndexOutOfListBounds, t as getMinListIndex, v as getMaxListIndex, w as createGridCellMap, x as isListIndexDisabled, y as getGridNavigatedIndex, z as getGridCellIndices, A as getGridCellIndexOfCorner, B as ARROW_DOWN, C as ARROW_LEFT, E as ARROW_RIGHT, G as findNonDisabledListIndex, H as enqueueFocus, I as ARROW_UP, J as isElementVisible, K as DISABLED_TRANSITIONS_STYLE, L as popupStateMapping, M as COMPOSITE_KEYS, N as FloatingFocusManager, O as FloatingPortal, Q as useDirection, R as POPUP_COLLISION_AVOIDANCE, U as InternalBackdrop, V as inertValue, W as FloatingNode, X as DROPDOWN_COLLISION_AVOIDANCE, Y as popupStoreSelectors, Z as createSelector, _ as ReactStore, $ as createInitialPopupStoreState, a0 as FloatingTreeStore, a1 as fastComponent, a2 as useOnFirstRender, a3 as useFloatingNodeId, a4 as useOpenInteractionType, a5 as useImplicitActiveTrigger, a6 as useOpenStateTransitions, a7 as useScrollLock, a8 as useSyncedFloatingRootContext, a9 as useDismiss, aa as useRole, ab as TYPEAHEAD_RESET_MS, ac as useInteractions, ad as FloatingTree, ae as fastComponentRef, af as useTriggerDataForwarding, ag as useClick, ah as getTabbableBeforeElement, ai as isOutsideEvent, aj as getTabbableAfterElement, ak as getNextTabbable, al as pressableTriggerOpenStateMapping, am as FocusGuard, an as PATIENT_CLICK_THRESHOLD, ao as useTriggerRegistration, ap as triggerOpenStateMapping } from './ScrollAreaViewport-es.js';
|
|
3
|
+
import { u as useRenderElement, a as useRefWithInit, f as formatErrorMessage, m as mergeProps, b as useMergedRefs, E as EMPTY_OBJECT, d as EMPTY_ARRAY } from './useRenderElement-es.js';
|
|
4
|
+
import { y as useButton, k as createChangeEventDetails, C as closePress, D as isMouseLikePointerType, E as useId, d as useIsoLayoutEffect, b as useTimeout, F as triggerFocus, G as isMac, H as isSafari, s as ownerDocument, I as triggerPress, J as escapeKey, f as useOnMount, T as Timeout, a as useStableCallback, K as triggerHover, i as useValueAsRef, A as stopEvent, L as listNavigation, M as focusOut, N as isVirtualClick, O as isVirtualPointerEvent, u as useBaseUiId, P as itemPress, t as transitionStatusMapping, e as useOpenChangeComplete, Q as outsidePress, R as useAnimationsFinished, S as siblingOpen, h as useControlled, c as useTransitionStatus, U as imperativeAction, V as useCompositeRootContext, W as cancelOpen } from './useValueChanged-es.js';
|
|
6
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
7
6
|
import { b as isElement, k as getWindow, a as isHTMLElement, d as isLastTraversableNode, e as getParentNode } from './floating-ui.utils.dom-es.js';
|
|
8
7
|
import { e as evaluate, h as getPaddingObject, b as getAlignmentAxis, d as getAlignment, q as getAxisLength, n as clamp, c as getSide, g as getSideAxis } from './index.esm-es.js';
|
|
@@ -86,109 +85,6 @@ function isClickLikeOpenEvent(openEventType, interactedInside) {
|
|
|
86
85
|
return interactedInside || openEventType === 'click' || openEventType === 'mousedown';
|
|
87
86
|
}
|
|
88
87
|
|
|
89
|
-
/**
|
|
90
|
-
* Opens or closes the floating element when clicking the reference element.
|
|
91
|
-
* @see https://floating-ui.com/docs/useClick
|
|
92
|
-
*/
|
|
93
|
-
function useClick(context, props = {}) {
|
|
94
|
-
const store = 'rootStore' in context ? context.rootStore : context;
|
|
95
|
-
const dataRef = store.context.dataRef;
|
|
96
|
-
const {
|
|
97
|
-
enabled = true,
|
|
98
|
-
event: eventOption = 'click',
|
|
99
|
-
toggle = true,
|
|
100
|
-
ignoreMouse = false,
|
|
101
|
-
stickIfOpen = true,
|
|
102
|
-
touchOpenDelay = 0,
|
|
103
|
-
reason = triggerPress
|
|
104
|
-
} = props;
|
|
105
|
-
const pointerTypeRef = React.useRef(undefined);
|
|
106
|
-
const frame = useAnimationFrame();
|
|
107
|
-
const touchOpenTimeout = useTimeout();
|
|
108
|
-
const reference = React.useMemo(() => ({
|
|
109
|
-
onPointerDown(event) {
|
|
110
|
-
pointerTypeRef.current = event.pointerType;
|
|
111
|
-
},
|
|
112
|
-
onMouseDown(event) {
|
|
113
|
-
const pointerType = pointerTypeRef.current;
|
|
114
|
-
const nativeEvent = event.nativeEvent;
|
|
115
|
-
const open = store.select('open');
|
|
116
|
-
|
|
117
|
-
// Ignore all buttons except for the "main" button.
|
|
118
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
|
|
119
|
-
if (event.button !== 0 || eventOption === 'click' || isMouseLikePointerType(pointerType, true) && ignoreMouse) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
const openEvent = dataRef.current.openEvent;
|
|
123
|
-
const openEventType = openEvent?.type;
|
|
124
|
-
const hasClickedOnInactiveTrigger = store.select('domReferenceElement') !== event.currentTarget;
|
|
125
|
-
const nextOpen = open && hasClickedOnInactiveTrigger || !(open && toggle && (openEvent && stickIfOpen ? openEventType === 'click' || openEventType === 'mousedown' : true));
|
|
126
|
-
|
|
127
|
-
// Animations sometimes won't run on a typeable element if using a rAF.
|
|
128
|
-
// Focus is always set on these elements. For touch, we may delay opening.
|
|
129
|
-
if (isTypeableElement(nativeEvent.target)) {
|
|
130
|
-
const details = createChangeEventDetails(reason, nativeEvent, nativeEvent.target);
|
|
131
|
-
if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {
|
|
132
|
-
touchOpenTimeout.start(touchOpenDelay, () => {
|
|
133
|
-
store.setOpen(true, details);
|
|
134
|
-
});
|
|
135
|
-
} else {
|
|
136
|
-
store.setOpen(nextOpen, details);
|
|
137
|
-
}
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Capture the currentTarget before the rAF.
|
|
142
|
-
// as React sets it to null after the event handler completes.
|
|
143
|
-
const eventCurrentTarget = event.currentTarget;
|
|
144
|
-
|
|
145
|
-
// Wait until focus is set on the element. This is an alternative to
|
|
146
|
-
// `event.preventDefault()` to avoid :focus-visible from appearing when using a pointer.
|
|
147
|
-
frame.request(() => {
|
|
148
|
-
const details = createChangeEventDetails(reason, nativeEvent, eventCurrentTarget);
|
|
149
|
-
if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {
|
|
150
|
-
touchOpenTimeout.start(touchOpenDelay, () => {
|
|
151
|
-
store.setOpen(true, details);
|
|
152
|
-
});
|
|
153
|
-
} else {
|
|
154
|
-
store.setOpen(nextOpen, details);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
},
|
|
158
|
-
onClick(event) {
|
|
159
|
-
if (eventOption === 'mousedown-only') {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
const pointerType = pointerTypeRef.current;
|
|
163
|
-
if (eventOption === 'mousedown' && pointerType) {
|
|
164
|
-
pointerTypeRef.current = undefined;
|
|
165
|
-
return;
|
|
166
|
-
}
|
|
167
|
-
if (isMouseLikePointerType(pointerType, true) && ignoreMouse) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
const open = store.select('open');
|
|
171
|
-
const openEvent = dataRef.current.openEvent;
|
|
172
|
-
const hasClickedOnInactiveTrigger = store.select('domReferenceElement') !== event.currentTarget;
|
|
173
|
-
const nextOpen = open && hasClickedOnInactiveTrigger || !(open && toggle && (openEvent && stickIfOpen ? isClickLikeEvent(openEvent) : true));
|
|
174
|
-
const details = createChangeEventDetails(reason, event.nativeEvent, event.currentTarget);
|
|
175
|
-
if (nextOpen && pointerType === 'touch' && touchOpenDelay > 0) {
|
|
176
|
-
touchOpenTimeout.start(touchOpenDelay, () => {
|
|
177
|
-
store.setOpen(true, details);
|
|
178
|
-
});
|
|
179
|
-
} else {
|
|
180
|
-
store.setOpen(nextOpen, details);
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
onKeyDown() {
|
|
184
|
-
pointerTypeRef.current = undefined;
|
|
185
|
-
}
|
|
186
|
-
}), [dataRef, eventOption, ignoreMouse, store, stickIfOpen, toggle, frame, touchOpenTimeout, touchOpenDelay, reason]);
|
|
187
|
-
return React.useMemo(() => enabled ? {
|
|
188
|
-
reference
|
|
189
|
-
} : EMPTY_OBJECT, [enabled, reference]);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
88
|
function useFloatingRootContext(options) {
|
|
193
89
|
const {
|
|
194
90
|
open = false,
|
|
@@ -2000,66 +1896,6 @@ const DialogTitle = /*#__PURE__*/React.forwardRef(function DialogTitle(component
|
|
|
2000
1896
|
});
|
|
2001
1897
|
if (process.env.NODE_ENV !== "production") DialogTitle.displayName = "DialogTitle";
|
|
2002
1898
|
|
|
2003
|
-
/**
|
|
2004
|
-
* A button that opens the dialog.
|
|
2005
|
-
* Renders a `<button>` element.
|
|
2006
|
-
*
|
|
2007
|
-
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
|
|
2008
|
-
*/
|
|
2009
|
-
const DialogTrigger = /*#__PURE__*/React.forwardRef(function DialogTrigger(componentProps, forwardedRef) {
|
|
2010
|
-
const {
|
|
2011
|
-
render,
|
|
2012
|
-
className,
|
|
2013
|
-
disabled = false,
|
|
2014
|
-
nativeButton = true,
|
|
2015
|
-
id: idProp,
|
|
2016
|
-
payload,
|
|
2017
|
-
handle,
|
|
2018
|
-
...elementProps
|
|
2019
|
-
} = componentProps;
|
|
2020
|
-
const dialogRootContext = useDialogRootContext(true);
|
|
2021
|
-
const store = handle?.store ?? dialogRootContext?.store;
|
|
2022
|
-
if (!store) {
|
|
2023
|
-
throw new Error(process.env.NODE_ENV !== "production" ? 'Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.' : formatErrorMessage(79));
|
|
2024
|
-
}
|
|
2025
|
-
const thisTriggerId = useBaseUiId(idProp);
|
|
2026
|
-
const floatingContext = store.useState('floatingRootContext');
|
|
2027
|
-
const isOpenedByThisTrigger = store.useState('isOpenedByTrigger', thisTriggerId);
|
|
2028
|
-
const triggerElementRef = React.useRef(null);
|
|
2029
|
-
const {
|
|
2030
|
-
registerTrigger,
|
|
2031
|
-
isMountedByThisTrigger
|
|
2032
|
-
} = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
|
|
2033
|
-
payload
|
|
2034
|
-
});
|
|
2035
|
-
const {
|
|
2036
|
-
getButtonProps,
|
|
2037
|
-
buttonRef
|
|
2038
|
-
} = useButton({
|
|
2039
|
-
disabled,
|
|
2040
|
-
native: nativeButton
|
|
2041
|
-
});
|
|
2042
|
-
const click = useClick(floatingContext, {
|
|
2043
|
-
enabled: floatingContext != null
|
|
2044
|
-
});
|
|
2045
|
-
const localInteractionProps = useInteractions([click]);
|
|
2046
|
-
const state = {
|
|
2047
|
-
disabled,
|
|
2048
|
-
open: isOpenedByThisTrigger
|
|
2049
|
-
};
|
|
2050
|
-
const rootTriggerProps = store.useState('triggerProps', isMountedByThisTrigger);
|
|
2051
|
-
return useRenderElement('button', componentProps, {
|
|
2052
|
-
state,
|
|
2053
|
-
ref: [buttonRef, forwardedRef, registerTrigger, triggerElementRef],
|
|
2054
|
-
props: [localInteractionProps.getReferenceProps(), rootTriggerProps, {
|
|
2055
|
-
[CLICK_TRIGGER_IDENTIFIER]: '',
|
|
2056
|
-
id: thisTriggerId
|
|
2057
|
-
}, elementProps, getButtonProps],
|
|
2058
|
-
stateAttributesMapping: triggerOpenStateMapping
|
|
2059
|
-
});
|
|
2060
|
-
});
|
|
2061
|
-
if (process.env.NODE_ENV !== "production") DialogTrigger.displayName = "DialogTrigger";
|
|
2062
|
-
|
|
2063
1899
|
/**
|
|
2064
1900
|
* A heading that labels the drawer.
|
|
2065
1901
|
* Renders an `<h2>` element.
|
|
@@ -2068,14 +1904,6 @@ if (process.env.NODE_ENV !== "production") DialogTrigger.displayName = "DialogTr
|
|
|
2068
1904
|
*/
|
|
2069
1905
|
const DrawerTitle = DialogTitle;
|
|
2070
1906
|
|
|
2071
|
-
/**
|
|
2072
|
-
* A button that opens the drawer.
|
|
2073
|
-
* Renders a `<button>` element.
|
|
2074
|
-
*
|
|
2075
|
-
* Documentation: [Base UI Drawer](https://base-ui.com/react/components/drawer)
|
|
2076
|
-
*/
|
|
2077
|
-
const DrawerTrigger = DialogTrigger;
|
|
2078
|
-
|
|
2079
1907
|
const MenuPositionerContext = /*#__PURE__*/React.createContext(undefined);
|
|
2080
1908
|
if (process.env.NODE_ENV !== "production") MenuPositionerContext.displayName = "MenuPositionerContext";
|
|
2081
1909
|
function useMenuPositionerContext(optional) {
|
|
@@ -2695,16 +2523,6 @@ const MenuPortal = /*#__PURE__*/React.forwardRef(function MenuPortal(props, forw
|
|
|
2695
2523
|
});
|
|
2696
2524
|
if (process.env.NODE_ENV !== "production") MenuPortal.displayName = "MenuPortal";
|
|
2697
2525
|
|
|
2698
|
-
/**
|
|
2699
|
-
* @internal
|
|
2700
|
-
*/
|
|
2701
|
-
const DirectionContext = /*#__PURE__*/React.createContext(undefined);
|
|
2702
|
-
if (process.env.NODE_ENV !== "production") DirectionContext.displayName = "DirectionContext";
|
|
2703
|
-
function useDirection() {
|
|
2704
|
-
const context = React.useContext(DirectionContext);
|
|
2705
|
-
return context?.direction ?? 'ltr';
|
|
2706
|
-
}
|
|
2707
|
-
|
|
2708
2526
|
/**
|
|
2709
2527
|
* Fork of the original `arrow` middleware from Floating UI that allows
|
|
2710
2528
|
* configuring the offset parent.
|
|
@@ -4979,4 +4797,4 @@ const MenuSubmenuTrigger = /*#__PURE__*/React.forwardRef(function SubmenuTrigger
|
|
|
4979
4797
|
});
|
|
4980
4798
|
if (process.env.NODE_ENV !== "production") MenuSubmenuTrigger.displayName = "MenuSubmenuTrigger";
|
|
4981
4799
|
|
|
4982
|
-
export {
|
|
4800
|
+
export { getDisabledMountTransitionStyles as A, CompositeList as C, DrawerTitle as D, IndexGuessBehavior as I, MenuTrigger as M, REGULAR_ITEM as R, DrawerClose as a, MenuLinkItem as b, MenuItem as c, MenuRadioItem as d, MenuRadioItemIndicator as e, MenuSubmenuTrigger as f, MenuRoot as g, MenuPortal as h, MenuPositioner as i, MenuPopup as j, MenuRadioGroup as k, MenuGroup as l, MenuSubmenuRoot as m, MenuGroupLabel as n, useMenuPositionerContext as o, useContextMenuRootContext as p, useCompositeListItem as q, useMenuItem as r, itemMapping as s, MenuStore as t, useMenuRootContext as u, useFloatingRootContext as v, useListNavigation as w, useTypeahead as x, getPseudoElementBounds as y, useAnchorPositioning as z };
|
package/dist/Modal/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { H as Heading } from '../Heading-es.js';
|
|
|
7
7
|
import { B as Button } from '../Button-es.js';
|
|
8
8
|
import { B as ButtonDismiss } from '../ButtonDismiss-es.js';
|
|
9
9
|
import { n as noop } from '../noop-es.js';
|
|
10
|
-
import { b as useFloatingNodeId, u as useFloating, c as useDismiss,
|
|
10
|
+
import { b as useFloatingNodeId, u as useFloating, c as useDismiss, h as useRole, d as useInteractions, a as useFloatingParentNodeId, e as FloatingTree, f as FloatingNode, F as FloatingPortal, i as FloatingFocusManager, j as FloatingOverlay } from '../floating-ui.react-es.js';
|
|
11
11
|
import { b as identity } from '../identity-es.js';
|
|
12
12
|
import { A as AtlantisPortalContent } from '../AtlantisPortalContent-es.js';
|
|
13
13
|
import '../Typography-es.js';
|
|
@@ -4,7 +4,6 @@ var React = require('react');
|
|
|
4
4
|
var useValueChanged = require('./useValueChanged-cjs.js');
|
|
5
5
|
var useRenderElement = require('./useRenderElement-cjs.js');
|
|
6
6
|
var floatingUi_utils_dom = require('./floating-ui.utils.dom-cjs.js');
|
|
7
|
-
var useBaseUiId = require('./useBaseUiId-cjs.js');
|
|
8
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
8
|
var ReactDOM = require('react-dom');
|
|
10
9
|
|
|
@@ -284,7 +283,7 @@ function useLabelableId(params = {}) {
|
|
|
284
283
|
controlId,
|
|
285
284
|
registerControlId
|
|
286
285
|
} = useLabelableContext();
|
|
287
|
-
const defaultId =
|
|
286
|
+
const defaultId = useValueChanged.useBaseUiId(id);
|
|
288
287
|
const controlIdForEffect = implicit ? controlId : undefined;
|
|
289
288
|
const controlSourceRef = useRenderElement.useRefWithInit(() => Symbol('labelable-control'));
|
|
290
289
|
const hasRegisteredRef = React__namespace.useRef(false);
|
|
@@ -1394,7 +1393,7 @@ const NumberFieldIncrement = /*#__PURE__*/React__namespace.forwardRef(function N
|
|
|
1394
1393
|
const {
|
|
1395
1394
|
getButtonProps,
|
|
1396
1395
|
buttonRef
|
|
1397
|
-
} =
|
|
1396
|
+
} = useValueChanged.useButton({
|
|
1398
1397
|
disabled,
|
|
1399
1398
|
native: nativeButton,
|
|
1400
1399
|
focusableWhenDisabled: true
|
|
@@ -1478,7 +1477,7 @@ const NumberFieldDecrement = /*#__PURE__*/React__namespace.forwardRef(function N
|
|
|
1478
1477
|
const {
|
|
1479
1478
|
getButtonProps,
|
|
1480
1479
|
buttonRef
|
|
1481
|
-
} =
|
|
1480
|
+
} = useValueChanged.useButton({
|
|
1482
1481
|
disabled,
|
|
1483
1482
|
native: nativeButton,
|
|
1484
1483
|
focusableWhenDisabled: true
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { a as useStableCallback,
|
|
3
|
-
import { N as NOOP, f as formatErrorMessage, E as EMPTY_OBJECT,
|
|
2
|
+
import { a as useStableCallback, d as useIsoLayoutEffect, u as useBaseUiId, f as useOnMount, T as Timeout, g as clamp, h as useControlled, i as useValueAsRef, b as useTimeout, j as isIOS, k as createChangeEventDetails, n as none, v as visuallyHiddenInput, l as visuallyHidden, m as inputChange, o as inputClear, p as inputBlur, q as inputPaste, r as createGenericEventDetails, s as ownerDocument, w as incrementPress, x as decrementPress, y as useButton, z as useValueChanged, A as stopEvent, B as keyboard } from './useValueChanged-es.js';
|
|
3
|
+
import { N as NOOP, f as formatErrorMessage, E as EMPTY_OBJECT, a as useRefWithInit, b as useMergedRefs, u as useRenderElement } from './useRenderElement-es.js';
|
|
4
4
|
import { b as isElement, k as getWindow } from './floating-ui.utils.dom-es.js';
|
|
5
|
-
import { u as useBaseUiId, a as useButton } from './useBaseUiId-es.js';
|
|
6
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
6
|
import * as ReactDOM from 'react-dom';
|
|
8
7
|
|
package/dist/Page/index.cjs
CHANGED
|
@@ -28,12 +28,11 @@ require('../useFormFieldFocus-cjs.js');
|
|
|
28
28
|
require('../maxHeight-cjs.js');
|
|
29
29
|
require('../useRenderElement-cjs.js');
|
|
30
30
|
require('../BottomSheet-cjs.js');
|
|
31
|
-
require('../
|
|
31
|
+
require('../ScrollAreaViewport-cjs.js');
|
|
32
32
|
require('../useValueChanged-cjs.js');
|
|
33
33
|
require('../OverlaySeparator-cjs.js');
|
|
34
34
|
require('../Separator-cjs.js');
|
|
35
35
|
require('../MenuSubmenuTrigger-cjs.js');
|
|
36
|
-
require('../useBaseUiId-cjs.js');
|
|
37
36
|
require('../filterDataAttributes-cjs.js');
|
|
38
37
|
|
|
39
38
|
|
package/dist/Page/index.mjs
CHANGED
|
@@ -26,10 +26,9 @@ import '../useFormFieldFocus-es.js';
|
|
|
26
26
|
import '../maxHeight-es.js';
|
|
27
27
|
import '../useRenderElement-es.js';
|
|
28
28
|
import '../BottomSheet-es.js';
|
|
29
|
-
import '../
|
|
29
|
+
import '../ScrollAreaViewport-es.js';
|
|
30
30
|
import '../useValueChanged-es.js';
|
|
31
31
|
import '../OverlaySeparator-es.js';
|
|
32
32
|
import '../Separator-es.js';
|
|
33
33
|
import '../MenuSubmenuTrigger-es.js';
|
|
34
|
-
import '../useBaseUiId-es.js';
|
|
35
34
|
import '../filterDataAttributes-es.js';
|