@jobber/components 9.6.0 → 9.6.2
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/dist/ActivityIndicator-cjs.js +1 -0
- package/dist/ActivityIndicator-es.js +1 -0
- package/dist/Autocomplete/index.cjs +2 -0
- package/dist/Autocomplete/index.mjs +2 -0
- package/dist/Autocomplete-cjs.js +6 -4
- package/dist/Autocomplete-es.js +3 -1
- package/dist/Banner-cjs.js +1 -0
- package/dist/Banner-es.js +1 -0
- package/dist/Card/index.cjs +2 -1
- package/dist/Card/index.mjs +2 -1
- package/dist/Chip/index.cjs +2 -0
- package/dist/Chip/index.mjs +2 -0
- package/dist/Chip-cjs.js +1 -0
- package/dist/Chip-es.js +1 -0
- package/dist/Chips/InternalChipDismissible/hooks/index.cjs +2 -0
- package/dist/Chips/InternalChipDismissible/hooks/index.mjs +2 -0
- package/dist/Chips/InternalChipDismissible/index.cjs +2 -0
- package/dist/Chips/InternalChipDismissible/index.mjs +2 -0
- package/dist/Chips/index.cjs +2 -0
- package/dist/Chips/index.mjs +2 -0
- package/dist/Combobox/index.cjs +4 -2
- package/dist/Combobox/index.mjs +4 -2
- package/dist/{ComboboxSeparator-cjs.js → ComboboxChipRemove-cjs.js} +455 -501
- package/dist/{ComboboxSeparator-es.js → ComboboxChipRemove-es.js} +456 -500
- package/dist/ComboboxPrimitive-cjs.js +30 -29
- package/dist/ComboboxPrimitive-es.js +3 -2
- package/dist/ConfirmationModal/index.cjs +2 -0
- package/dist/ConfirmationModal/index.mjs +2 -0
- package/dist/ConfirmationModal-cjs.js +1 -0
- package/dist/ConfirmationModal-es.js +1 -0
- package/dist/DataDump/index.cjs +2 -1
- package/dist/DataDump/index.mjs +2 -1
- package/dist/DataDump-cjs.js +1 -0
- package/dist/DataDump-es.js +1 -0
- package/dist/DataList/components/DataListActions/index.cjs +2 -0
- package/dist/DataList/components/DataListActions/index.mjs +2 -0
- package/dist/DataList/components/DataListBulkActions/index.cjs +2 -0
- package/dist/DataList/components/DataListBulkActions/index.mjs +2 -0
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +2 -0
- package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +2 -0
- package/dist/DataList/components/DataListFilters/index.cjs +2 -0
- package/dist/DataList/components/DataListFilters/index.mjs +2 -0
- package/dist/DataList/components/DataListHeader/index.cjs +2 -0
- package/dist/DataList/components/DataListHeader/index.mjs +2 -0
- package/dist/DataList/components/DataListItem/index.cjs +2 -0
- package/dist/DataList/components/DataListItem/index.mjs +2 -0
- package/dist/DataList/components/DataListItemActions/index.cjs +2 -0
- package/dist/DataList/components/DataListItemActions/index.mjs +2 -0
- package/dist/DataList/components/DataListItemActionsOverflow/index.cjs +2 -0
- package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +2 -0
- package/dist/DataList/components/DataListItems/index.cjs +2 -0
- package/dist/DataList/components/DataListItems/index.mjs +2 -0
- package/dist/DataList/components/DataListLayout/index.cjs +2 -0
- package/dist/DataList/components/DataListLayout/index.mjs +2 -0
- package/dist/DataList/components/DataListLayoutActions/index.cjs +2 -0
- package/dist/DataList/components/DataListLayoutActions/index.mjs +2 -0
- package/dist/DataList/index.cjs +2 -0
- package/dist/DataList/index.mjs +2 -0
- package/dist/DataTable-cjs.js +1 -0
- package/dist/DataTable-es.js +1 -0
- package/dist/DatePicker/index.cjs +2 -0
- package/dist/DatePicker/index.mjs +2 -0
- package/dist/DatePicker-cjs.js +8 -7
- package/dist/DatePicker-es.js +6 -5
- package/dist/Dialog/index.cjs +2 -1
- package/dist/Dialog/index.mjs +2 -1
- package/dist/DrawerDescription-cjs.js +99 -268
- package/dist/DrawerDescription-es.js +103 -270
- package/dist/DrawerGrid-cjs.js +1 -0
- package/dist/DrawerGrid-es.js +1 -0
- package/dist/DrawerTitle-cjs.js +6 -2
- package/dist/DrawerTitle-es.js +7 -3
- package/dist/FeatureSwitch-cjs.js +1 -0
- package/dist/FeatureSwitch-es.js +1 -0
- package/dist/FieldDescription-cjs.js +181 -184
- package/dist/FieldDescription-es.js +184 -187
- package/dist/FilterPicker/components/FilterPickerActivator/index.cjs +2 -0
- package/dist/FilterPicker/components/FilterPickerActivator/index.mjs +2 -0
- package/dist/FilterPicker/components/FilterPickerContent/index.cjs +2 -0
- package/dist/FilterPicker/components/FilterPickerContent/index.mjs +2 -0
- package/dist/FilterPicker/components/FilterPickerTrigger/index.cjs +2 -0
- package/dist/FilterPicker/components/FilterPickerTrigger/index.mjs +2 -0
- package/dist/FilterPicker/index.cjs +2 -0
- package/dist/FilterPicker/index.mjs +2 -0
- package/dist/FilterPickerContent-cjs.js +5 -4
- package/dist/FilterPickerContent-es.js +2 -1
- package/dist/FormFieldWrapper-cjs.js +1 -0
- package/dist/FormFieldWrapper-es.js +1 -0
- package/dist/FormatFile/index.cjs +2 -0
- package/dist/FormatFile/index.mjs +2 -0
- package/dist/FormatFile-cjs.js +1 -0
- package/dist/FormatFile-es.js +1 -0
- package/dist/Gallery/index.cjs +2 -0
- package/dist/Gallery/index.mjs +2 -0
- package/dist/InputAvatar-cjs.js +1 -0
- package/dist/InputAvatar-es.js +1 -0
- package/dist/InputDate/index.cjs +2 -0
- package/dist/InputDate/index.mjs +2 -0
- package/dist/InputDate-cjs.js +1 -0
- package/dist/InputDate-es.js +1 -0
- package/dist/InputNumber/index.cjs +2 -1
- package/dist/InputNumber/index.mjs +2 -1
- package/dist/InternalChipDismissible-cjs.js +1 -0
- package/dist/InternalChipDismissible-es.js +1 -0
- package/dist/LightBox/index.cjs +2 -0
- package/dist/LightBox/index.mjs +2 -0
- package/dist/LightBox-cjs.js +1 -0
- package/dist/LightBox-es.js +1 -0
- package/dist/Menu/index.cjs +2 -1
- package/dist/Menu/index.mjs +2 -1
- package/dist/Menu-cjs.js +6 -4
- package/dist/Menu-es.js +3 -1
- package/dist/MenuSubmenuTrigger-cjs.js +164 -206
- package/dist/MenuSubmenuTrigger-es.js +152 -194
- package/dist/Modal/index.cjs +3 -1
- package/dist/Modal/index.mjs +4 -2
- package/dist/NumberFieldInput-cjs.js +308 -187
- package/dist/NumberFieldInput-es.js +308 -187
- package/dist/Page/index.cjs +2 -1
- package/dist/Page/index.mjs +2 -1
- package/dist/Page-cjs.js +1 -0
- package/dist/Page-es.js +1 -0
- package/dist/Popover/index.cjs +2 -0
- package/dist/Popover/index.mjs +2 -0
- package/dist/Popover-cjs.js +9 -7
- package/dist/Popover-es.js +3 -1
- package/dist/ProgressBar-cjs.js +1 -0
- package/dist/ProgressBar-es.js +1 -0
- package/dist/ScrollAreaViewport-cjs.js +1093 -747
- package/dist/ScrollAreaViewport-es.js +1081 -734
- package/dist/Select/index.cjs +2 -1
- package/dist/Select/index.mjs +2 -1
- package/dist/SelectGroupLabel-cjs.js +306 -207
- package/dist/SelectGroupLabel-es.js +302 -203
- package/dist/SideDrawer-cjs.js +1 -0
- package/dist/SideDrawer-es.js +1 -0
- package/dist/Spinner-cjs.js +1 -0
- package/dist/Spinner-es.js +1 -0
- package/dist/Tooltip/index.cjs +2 -0
- package/dist/Tooltip/index.mjs +2 -0
- package/dist/Tooltip-cjs.js +7 -6
- package/dist/Tooltip-es.js +2 -1
- package/dist/dialogReturnFocus-cjs.js +1 -1
- package/dist/dialogReturnFocus-es.js +2 -2
- package/dist/floating-ui.react-cjs.js +192 -2564
- package/dist/floating-ui.react-dom-cjs.js +2103 -0
- package/dist/floating-ui.react-dom-es.js +2072 -0
- package/dist/floating-ui.react-es.js +156 -2519
- package/dist/floating-ui.utils-cjs.js +342 -0
- package/dist/floating-ui.utils-es.js +300 -0
- package/dist/index.cjs +4 -3
- package/dist/index.mjs +4 -3
- package/dist/primitives/BottomSheet/index.cjs +1 -1
- package/dist/primitives/BottomSheet/index.mjs +1 -1
- package/dist/primitives/ComboboxPrimitive/index.cjs +4 -2
- package/dist/primitives/ComboboxPrimitive/index.mjs +4 -2
- package/dist/primitives/SelectPrimitive/index.cjs +2 -0
- package/dist/primitives/SelectPrimitive/index.mjs +2 -0
- package/dist/primitives/index.cjs +3 -2
- package/dist/primitives/index.mjs +3 -2
- package/dist/scrollEdges-cjs.js +11 -1
- package/dist/scrollEdges-es.js +11 -1
- package/dist/sharedHelpers/i18n/index.cjs +1 -0
- package/dist/sharedHelpers/i18n/index.d.ts +1 -0
- package/dist/sharedHelpers/i18n/index.mjs +1 -1
- package/dist/sharedHelpers/i18n/releasedLanguages.d.ts +12 -0
- package/dist/sharedHelpers/i18n/useReleasedLocale.d.ts +6 -0
- package/dist/showToast-cjs.js +1 -1
- package/dist/showToast-es.js +1 -1
- package/dist/testUtils/releasedLanguages.d.ts +16 -0
- package/dist/unstyledPrimitives/index.cjs +478 -720
- package/dist/unstyledPrimitives/index.mjs +421 -663
- package/dist/useAtlantisI18n-cjs.js +44 -11
- package/dist/useAtlantisI18n-es.js +44 -12
- package/dist/useCompositeListItem-cjs.js +361 -2108
- package/dist/useCompositeListItem-es.js +331 -2076
- package/dist/useLabel-cjs.js +3 -2
- package/dist/useLabel-es.js +3 -2
- package/dist/useRenderElement-cjs.js +7 -9
- package/dist/useRenderElement-es.js +7 -9
- package/dist/useScrollLock-cjs.js +344 -819
- package/dist/useScrollLock-es.js +296 -732
- package/dist/useScrollToActive-cjs.js +5 -4
- package/dist/useScrollToActive-es.js +2 -1
- package/package.json +3 -3
- package/dist/scrollable-cjs.js +0 -58
- package/dist/scrollable-es.js +0 -54
|
@@ -1,227 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { u as useDialogRootContext,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { u as useDialogRootContext, l as useDialogPortalContext, m as DialogStore } from './ScrollAreaViewport-es.js';
|
|
3
|
+
import { u as useRenderElement } from './useRenderElement-es.js';
|
|
4
|
+
import { p as popupStateMapping, t as transitionStatusMapping, u as useBaseUiId, C as CommonPopupDataAttributes, f as useOpenChangeComplete, h as createDefaultInitialFocus, F as FOCUSABLE_POPUP_PROPS, i as FloatingFocusManager, d as createChangeEventDetails, j as imperativeAction } from './useScrollLock-es.js';
|
|
5
5
|
import { C as COMPOSITE_KEYS } from './scrollEdges-es.js';
|
|
6
6
|
import { jsx } from 'react/jsx-runtime';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* between its fallback store and a root's live store.
|
|
13
|
-
*
|
|
14
|
-
* @template HandleStore Store shape exposed to detached triggers.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Store shape holding a trigger registry, required by `BasePopupHandle.openByTrigger` to resolve a
|
|
19
|
-
* trigger element by id on both the attached root's store and the fallback store.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Store shape required by `BasePopupHandle.openByTrigger`/`closePopup` to drive open/close state.
|
|
24
|
-
* Only the root-owned `Store` needs this — the `HandleStore` view exposed to detached triggers may
|
|
25
|
-
* omit `setOpen` entirely (as Dialog and PreviewCard's do) since it is never called while detached.
|
|
26
|
-
*/
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Shared implementation for popup handles that coordinate detached triggers with a mounted root.
|
|
30
|
-
*
|
|
31
|
-
* Subclasses provide the component-specific imperative methods, while this base class owns the
|
|
32
|
-
* fallback store, root store attachment stack, subscriber notifications, and development warning for
|
|
33
|
-
* overlapping roots.
|
|
34
|
-
*
|
|
35
|
-
* @template HandleStore Store shape exposed to detached triggers.
|
|
36
|
-
* @template Store Root-owned store attached by the component root.
|
|
37
|
-
*/
|
|
38
|
-
class BasePopupHandle {
|
|
39
|
-
/**
|
|
40
|
-
* Stores of every root currently using this handle, in attach order. A handle is meant to be used
|
|
41
|
-
* by a single mounted root, but roots can transiently overlap (e.g. during an animated route
|
|
42
|
-
* transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of
|
|
43
|
-
* leaving a still-mounted root uncontrollable when a newer overlapping root detaches first.
|
|
44
|
-
*/
|
|
45
|
-
attachedStores = [];
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Store of the root that currently controls the handle: the most recently attached one still
|
|
49
|
-
* mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`.
|
|
50
|
-
*/
|
|
51
|
-
attachedStoreValue = null;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer.
|
|
55
|
-
*/
|
|
56
|
-
storeListeners = new Set();
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Creates a handle backed by the store used while no root is attached.
|
|
60
|
-
*
|
|
61
|
-
* @param fallbackStore Inert, closed store handed to detached triggers while no root is attached,
|
|
62
|
-
* so they can render and register without a mounted root. Triggers register into whichever store
|
|
63
|
-
* `store` currently resolves to, so while detached they live in this store's trigger map and
|
|
64
|
-
* migrate themselves to the root's store (and back) as it attaches/detaches.
|
|
65
|
-
* @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces
|
|
66
|
-
* `MenuHandle.open()` in warning text.
|
|
67
|
-
* @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is
|
|
68
|
-
* registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to,
|
|
69
|
-
* so they throw; Dialog is not anchored and instead opens unassociated with a dev warning.
|
|
70
|
-
*/
|
|
71
|
-
constructor(fallbackStore, componentName, throwOnMissingTrigger = true) {
|
|
72
|
-
this.fallbackStore = fallbackStore;
|
|
73
|
-
this.componentName = componentName;
|
|
74
|
-
this.throwOnMissingTrigger = throwOnMissingTrigger;
|
|
75
|
-
}
|
|
76
|
-
get attachedStore() {
|
|
77
|
-
return this.attachedStoreValue;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Store that detached triggers read from: the attached root's store, or an inert fallback store
|
|
82
|
-
* used while no root is attached.
|
|
83
|
-
* @internal
|
|
84
|
-
*/
|
|
85
|
-
get store() {
|
|
86
|
-
return this.attachedStoreValue ?? this.fallbackStore;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on
|
|
91
|
-
* the handle during render because a handle can be shared by concurrent server-rendered requests.
|
|
92
|
-
* @internal
|
|
93
|
-
*/
|
|
94
|
-
get serverStore() {
|
|
95
|
-
return this.fallbackStore;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind
|
|
100
|
-
* when a root attaches or detaches. Returns a function that removes the listener.
|
|
101
|
-
* @internal
|
|
102
|
-
*/
|
|
103
|
-
subscribeStore(listener) {
|
|
104
|
-
this.storeListeners.add(listener);
|
|
105
|
-
return () => {
|
|
106
|
-
this.storeListeners.delete(listener);
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Points the handle at a root's store and notifies subscribers so detached triggers re-render and
|
|
112
|
-
* re-register into it (their registration ref re-fires on the store-pointer change). Returns a
|
|
113
|
-
* cleanup function that detaches the store again.
|
|
114
|
-
* @internal
|
|
115
|
-
*/
|
|
116
|
-
attachStore(newStore) {
|
|
117
|
-
this.attachedStores.push(newStore);
|
|
118
|
-
this.setActiveStore(newStore);
|
|
119
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
120
|
-
if (this.attachedStores.length > 1) {
|
|
121
|
-
// More than one root is attached at once. This is usually a transient overlap during an
|
|
122
|
-
// animated route transition, where the outgoing root unmounts shortly after the incoming
|
|
123
|
-
// one mounts. Defer the check by a frame and only warn if the overlap is still present once
|
|
124
|
-
// the transition has settled (more than one root stayed mounted), so a clean handoff doesn't
|
|
125
|
-
// warn regardless of the exact unmount timing.
|
|
126
|
-
// The warning frame only exists in development; it is created lazily so it never appears on
|
|
127
|
-
// instances in production (like `controlledValues` in `ReactStore`).
|
|
128
|
-
const dev = this;
|
|
129
|
-
(dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => {
|
|
130
|
-
if (this.attachedStores.length > 1) {
|
|
131
|
-
console.warn('Base UI: A handle is attached to more than one mounted root at the same time. ' + 'The most recently mounted root takes over and the previous one stops being controlled by the handle. ' + 'A handle should be used by a single root that stays mounted for the lifetime of the handle.');
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return () => {
|
|
137
|
-
const index = this.attachedStores.lastIndexOf(newStore);
|
|
138
|
-
if (index !== -1) {
|
|
139
|
-
this.attachedStores.splice(index, 1);
|
|
140
|
-
}
|
|
141
|
-
// Restore control to the most recently attached root that is still mounted (or detach fully if
|
|
142
|
-
// none remain). Clearing unconditionally would leave a still-mounted older root uncontrollable
|
|
143
|
-
// when a newer overlapping root detaches first (e.g. a canceled route transition).
|
|
144
|
-
this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null);
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* Sets the store that currently controls the handle and notifies subscribers when it changes, so
|
|
150
|
-
* detached triggers re-render and migrate their registration to the new store.
|
|
151
|
-
*/
|
|
152
|
-
setActiveStore(store) {
|
|
153
|
-
if (this.attachedStoreValue !== store) {
|
|
154
|
-
this.attachedStoreValue = store;
|
|
155
|
-
this.storeListeners.forEach(listener => {
|
|
156
|
-
listener();
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Opens the attached root's store and associates it with the trigger with the given id, or a
|
|
163
|
-
* no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public
|
|
164
|
-
* `open()` method, which only narrows the parameter type.
|
|
165
|
-
*
|
|
166
|
-
* When a trigger id is given but no matching trigger is registered, anchored popups throw (see
|
|
167
|
-
* `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead.
|
|
168
|
-
*
|
|
169
|
-
* This method should only be called in an event handler or an effect (not during rendering).
|
|
170
|
-
*
|
|
171
|
-
* @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open
|
|
172
|
-
* without associating any trigger.
|
|
173
|
-
*/
|
|
174
|
-
openByTrigger(triggerId) {
|
|
175
|
-
const attachedStore = this.attachedStore;
|
|
176
|
-
if (attachedStore === null) {
|
|
177
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
178
|
-
console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. ` + 'The call was ignored; mount a root with this handle before opening it imperatively.');
|
|
179
|
-
}
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
// Registered triggers normally live in the active root's store. During the commit in which a
|
|
184
|
-
// root attaches, a still-mounted detached trigger has not re-registered into that store yet (it
|
|
185
|
-
// migrates on its next render): it is still registered wherever it lived before — the fallback
|
|
186
|
-
// store when this is the first root to attach, or a previously attached root's store during a
|
|
187
|
-
// transient overlap (e.g. an animated route transition). Search the whole attachment stack
|
|
188
|
-
// (newest first) and the fallback map so an imperative open-by-id called in that commit (e.g.
|
|
189
|
-
// from a layout effect) still resolves the trigger instead of treating it as missing.
|
|
190
|
-
let triggerElement;
|
|
191
|
-
if (triggerId) {
|
|
192
|
-
for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) {
|
|
193
|
-
triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId);
|
|
194
|
-
}
|
|
195
|
-
triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId);
|
|
196
|
-
}
|
|
197
|
-
if (triggerId && !triggerElement) {
|
|
198
|
-
if (this.throwOnMissingTrigger) {
|
|
199
|
-
throw new Error(process.env.NODE_ENV !== "production" ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id "${triggerId}", ` + 'but no matching trigger is registered with this handle. ' + 'An anchored popup cannot open without a trigger to anchor to. ' + `Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its "handle" prop.` : formatErrorMessage(99, this.componentName, triggerId, this.componentName));
|
|
200
|
-
}
|
|
201
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
202
|
-
console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id "${triggerId}". ` + 'The popup will open, but the trigger will not be associated with it.');
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
attachedStore.setOpen(true, createChangeEventDetails(imperativeAction, undefined, triggerElement));
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning)
|
|
210
|
-
* while no root is attached. Shared by every concrete handle's public `close()` method.
|
|
211
|
-
*
|
|
212
|
-
* This method should only be called in an event handler or an effect (not during rendering).
|
|
213
|
-
*/
|
|
214
|
-
closePopup() {
|
|
215
|
-
const attachedStore = this.attachedStore;
|
|
216
|
-
if (attachedStore === null) {
|
|
217
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
218
|
-
console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. ` + 'The call was ignored.');
|
|
219
|
-
}
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
attachedStore.setOpen(false, createChangeEventDetails(imperativeAction));
|
|
223
|
-
}
|
|
224
|
-
}
|
|
8
|
+
const stateAttributesMapping$1 = {
|
|
9
|
+
...popupStateMapping,
|
|
10
|
+
...transitionStatusMapping
|
|
11
|
+
};
|
|
225
12
|
|
|
226
13
|
/**
|
|
227
14
|
* An overlay displayed beneath the popup.
|
|
@@ -237,7 +24,9 @@ const DialogBackdrop = /*#__PURE__*/React.forwardRef(function DialogBackdrop(com
|
|
|
237
24
|
forceRender = false,
|
|
238
25
|
...elementProps
|
|
239
26
|
} = componentProps;
|
|
240
|
-
const
|
|
27
|
+
const {
|
|
28
|
+
store
|
|
29
|
+
} = useDialogRootContext();
|
|
241
30
|
const open = store.useState('open');
|
|
242
31
|
const nested = store.useState('nested');
|
|
243
32
|
const mounted = store.useState('mounted');
|
|
@@ -249,7 +38,7 @@ const DialogBackdrop = /*#__PURE__*/React.forwardRef(function DialogBackdrop(com
|
|
|
249
38
|
return useRenderElement('div', componentProps, {
|
|
250
39
|
state,
|
|
251
40
|
ref: [store.context.backdropRef, forwardedRef],
|
|
252
|
-
stateAttributesMapping:
|
|
41
|
+
stateAttributesMapping: stateAttributesMapping$1,
|
|
253
42
|
props: [{
|
|
254
43
|
role: 'presentation',
|
|
255
44
|
hidden: !mounted,
|
|
@@ -277,7 +66,9 @@ const DialogDescription = /*#__PURE__*/React.forwardRef(function DialogDescripti
|
|
|
277
66
|
id: idProp,
|
|
278
67
|
...elementProps
|
|
279
68
|
} = componentProps;
|
|
280
|
-
const
|
|
69
|
+
const {
|
|
70
|
+
store
|
|
71
|
+
} = useDialogRootContext();
|
|
281
72
|
const id = useBaseUiId(idProp);
|
|
282
73
|
store.useSyncedValueWithCleanup('descriptionElementId', id);
|
|
283
74
|
return useRenderElement('p', componentProps, {
|
|
@@ -289,6 +80,59 @@ const DialogDescription = /*#__PURE__*/React.forwardRef(function DialogDescripti
|
|
|
289
80
|
});
|
|
290
81
|
if (process.env.NODE_ENV !== "production") DialogDescription.displayName = "DialogDescription";
|
|
291
82
|
|
|
83
|
+
let DialogPopupCssVars = /*#__PURE__*/function (DialogPopupCssVars) {
|
|
84
|
+
/**
|
|
85
|
+
* Indicates how many dialogs are nested within.
|
|
86
|
+
* @type {number}
|
|
87
|
+
*/
|
|
88
|
+
DialogPopupCssVars["nestedDialogs"] = "--nested-dialogs";
|
|
89
|
+
return DialogPopupCssVars;
|
|
90
|
+
}({});
|
|
91
|
+
|
|
92
|
+
let DialogPopupDataAttributes = function (DialogPopupDataAttributes) {
|
|
93
|
+
/**
|
|
94
|
+
* Present when the dialog is open.
|
|
95
|
+
*/
|
|
96
|
+
DialogPopupDataAttributes[DialogPopupDataAttributes["open"] = CommonPopupDataAttributes.open] = "open";
|
|
97
|
+
/**
|
|
98
|
+
* Present when the dialog is closed.
|
|
99
|
+
*/
|
|
100
|
+
DialogPopupDataAttributes[DialogPopupDataAttributes["closed"] = CommonPopupDataAttributes.closed] = "closed";
|
|
101
|
+
/**
|
|
102
|
+
* Present when the dialog is animating in.
|
|
103
|
+
*/
|
|
104
|
+
DialogPopupDataAttributes[DialogPopupDataAttributes["startingStyle"] = CommonPopupDataAttributes.startingStyle] = "startingStyle";
|
|
105
|
+
/**
|
|
106
|
+
* Present when the dialog is animating out.
|
|
107
|
+
*/
|
|
108
|
+
DialogPopupDataAttributes[DialogPopupDataAttributes["endingStyle"] = CommonPopupDataAttributes.endingStyle] = "endingStyle";
|
|
109
|
+
/**
|
|
110
|
+
* Present when the dialog is nested within another dialog.
|
|
111
|
+
*/
|
|
112
|
+
DialogPopupDataAttributes["nested"] = "data-nested";
|
|
113
|
+
/**
|
|
114
|
+
* Present when the dialog has other open dialogs nested within it.
|
|
115
|
+
*/
|
|
116
|
+
DialogPopupDataAttributes["nestedDialogOpen"] = "data-nested-dialog-open";
|
|
117
|
+
return DialogPopupDataAttributes;
|
|
118
|
+
}({});
|
|
119
|
+
|
|
120
|
+
const stateAttributesMapping = {
|
|
121
|
+
...popupStateMapping,
|
|
122
|
+
...transitionStatusMapping,
|
|
123
|
+
nestedDialogOpen(value) {
|
|
124
|
+
return value ? {
|
|
125
|
+
[DialogPopupDataAttributes.nestedDialogOpen]: ''
|
|
126
|
+
} : null;
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* A container for the dialog contents.
|
|
132
|
+
* Renders a `<div>` element.
|
|
133
|
+
*
|
|
134
|
+
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
|
|
135
|
+
*/
|
|
292
136
|
const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(componentProps, forwardedRef) {
|
|
293
137
|
const {
|
|
294
138
|
render,
|
|
@@ -298,7 +142,9 @@ const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(component
|
|
|
298
142
|
initialFocus,
|
|
299
143
|
...elementProps
|
|
300
144
|
} = componentProps;
|
|
301
|
-
const
|
|
145
|
+
const {
|
|
146
|
+
store
|
|
147
|
+
} = useDialogRootContext();
|
|
302
148
|
const descriptionElementId = store.useState('descriptionElementId');
|
|
303
149
|
const disablePointerDismissal = store.useState('disablePointerDismissal');
|
|
304
150
|
const floatingRootContext = store.useState('floatingRootContext');
|
|
@@ -313,6 +159,7 @@ const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(component
|
|
|
313
159
|
const transitionStatus = store.useState('transitionStatus');
|
|
314
160
|
const role = store.useState('role');
|
|
315
161
|
const floatingId = floatingRootContext.useState('floatingId');
|
|
162
|
+
const popupId = elementProps.id ?? floatingId;
|
|
316
163
|
useDialogPortalContext();
|
|
317
164
|
useOpenChangeComplete({
|
|
318
165
|
open,
|
|
@@ -335,9 +182,9 @@ const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(component
|
|
|
335
182
|
const element = useRenderElement('div', componentProps, {
|
|
336
183
|
state,
|
|
337
184
|
props: [rootPopupProps, {
|
|
338
|
-
id:
|
|
339
|
-
'aria-labelledby': titleElementId,
|
|
340
|
-
'aria-describedby': descriptionElementId,
|
|
185
|
+
id: popupId,
|
|
186
|
+
'aria-labelledby': titleElementId ?? undefined,
|
|
187
|
+
'aria-describedby': descriptionElementId ?? undefined,
|
|
341
188
|
role,
|
|
342
189
|
...FOCUSABLE_POPUP_PROPS,
|
|
343
190
|
hidden: !mounted,
|
|
@@ -347,11 +194,11 @@ const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(component
|
|
|
347
194
|
}
|
|
348
195
|
},
|
|
349
196
|
style: {
|
|
350
|
-
|
|
197
|
+
[DialogPopupCssVars.nestedDialogs]: nestedOpenDialogCount
|
|
351
198
|
}
|
|
352
199
|
}, elementProps],
|
|
353
200
|
ref: [forwardedRef, store.context.popupRef, setPopupElement],
|
|
354
|
-
stateAttributesMapping
|
|
201
|
+
stateAttributesMapping
|
|
355
202
|
});
|
|
356
203
|
return /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
357
204
|
context: floatingRootContext,
|
|
@@ -368,73 +215,59 @@ const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(component
|
|
|
368
215
|
if (process.env.NODE_ENV !== "production") DialogPopup.displayName = "DialogPopup";
|
|
369
216
|
|
|
370
217
|
/**
|
|
371
|
-
*
|
|
372
|
-
* Doesn't render its own HTML element.
|
|
373
|
-
*
|
|
374
|
-
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
|
|
218
|
+
* A handle to control a Dialog imperatively and to associate detached triggers with it.
|
|
375
219
|
*/
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
220
|
+
class DialogHandle {
|
|
221
|
+
/**
|
|
222
|
+
* Internal store holding the dialog state.
|
|
223
|
+
* @internal
|
|
224
|
+
*/
|
|
379
225
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
* `Dialog.Root`. Create one with `Dialog.createHandle()` and pass it to the `handle` prop of the
|
|
383
|
-
* root and of any triggers rendered outside of it.
|
|
384
|
-
*
|
|
385
|
-
* The imperative methods take effect only while a root using this handle is mounted; calls made
|
|
386
|
-
* before a root attaches (or after it unmounts) are ignored.
|
|
387
|
-
*/
|
|
388
|
-
class DialogHandle extends BasePopupHandle {
|
|
389
|
-
constructor() {
|
|
390
|
-
super(createNullDialogStore(), 'Dialog', false);
|
|
226
|
+
constructor(store) {
|
|
227
|
+
this.store = store ?? new DialogStore();
|
|
391
228
|
}
|
|
392
229
|
|
|
393
230
|
/**
|
|
394
|
-
* Opens the dialog
|
|
231
|
+
* Opens the dialog and associates it with the trigger with the given id.
|
|
232
|
+
* The trigger, if provided, must be a matching Trigger component with this handle passed as a prop.
|
|
395
233
|
*
|
|
396
234
|
* This method should only be called in an event handler or an effect (not during rendering).
|
|
397
235
|
*
|
|
398
|
-
* @param triggerId ID of the trigger to associate with the dialog.
|
|
399
|
-
* `Dialog.Trigger` with this handle passed as a prop. Pass `null` to open without associating any trigger.
|
|
236
|
+
* @param triggerId ID of the trigger to associate with the dialog. If null, the dialog will open without a trigger association.
|
|
400
237
|
*/
|
|
401
238
|
open(triggerId) {
|
|
402
|
-
this.
|
|
239
|
+
const triggerElement = triggerId ? this.store.context.triggerElements.getById(triggerId) : undefined;
|
|
240
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
241
|
+
if (triggerId && !triggerElement) {
|
|
242
|
+
console.warn(`Base UI: DialogHandle.open: No trigger found with id "${triggerId}". The dialog will open, but the trigger will not be associated with the dialog.`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
this.store.setOpen(true, createChangeEventDetails(imperativeAction, undefined, triggerElement));
|
|
403
246
|
}
|
|
404
247
|
|
|
405
248
|
/**
|
|
406
|
-
* Opens the dialog
|
|
407
|
-
*
|
|
408
|
-
* This method should only be called in an event handler or an effect (not during rendering).
|
|
249
|
+
* Opens the dialog and sets the payload.
|
|
250
|
+
* Does not associate the dialog with any trigger.
|
|
409
251
|
*
|
|
410
|
-
* @param payload Payload to set when opening the dialog.
|
|
252
|
+
* @param payload Payload to set when opening the dialog.
|
|
411
253
|
*/
|
|
412
254
|
openWithPayload(payload) {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
416
|
-
console.warn('Base UI: DialogHandle.openWithPayload() was called while no root using this handle is mounted. ' + 'The call and its payload were ignored; mount a root with this handle before opening it imperatively.');
|
|
417
|
-
}
|
|
418
|
-
return;
|
|
419
|
-
}
|
|
420
|
-
attachedStore.set('payload', payload);
|
|
421
|
-
attachedStore.setOpen(true, createChangeEventDetails(imperativeAction));
|
|
255
|
+
this.store.set('payload', payload);
|
|
256
|
+
this.store.setOpen(true, createChangeEventDetails(imperativeAction, undefined, undefined));
|
|
422
257
|
}
|
|
423
258
|
|
|
424
259
|
/**
|
|
425
260
|
* Closes the dialog.
|
|
426
|
-
*
|
|
427
|
-
* This method should only be called in an event handler or an effect (not during rendering).
|
|
428
261
|
*/
|
|
429
262
|
close() {
|
|
430
|
-
this.
|
|
263
|
+
this.store.setOpen(false, createChangeEventDetails(imperativeAction, undefined, undefined));
|
|
431
264
|
}
|
|
432
265
|
|
|
433
266
|
/**
|
|
434
|
-
*
|
|
267
|
+
* Indicates whether the dialog is currently open.
|
|
435
268
|
*/
|
|
436
269
|
get isOpen() {
|
|
437
|
-
return this.
|
|
270
|
+
return this.store.select('open');
|
|
438
271
|
}
|
|
439
272
|
}
|
|
440
273
|
|
|
@@ -453,4 +286,4 @@ function createDialogHandle() {
|
|
|
453
286
|
*/
|
|
454
287
|
const DrawerDescription = DialogDescription;
|
|
455
288
|
|
|
456
|
-
export {
|
|
289
|
+
export { DrawerDescription as D, DialogBackdrop as a, DialogPopup as b, DialogDescription as c, createDialogHandle as d, DialogHandle as e };
|
package/dist/DrawerGrid-cjs.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var classnames = require('classnames');
|
|
5
5
|
var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
|
|
6
|
+
require('./AtlantisContext-cjs.js');
|
|
6
7
|
var Heading = require('./Heading-cjs.js');
|
|
7
8
|
var ButtonDismiss = require('./ButtonDismiss-cjs.js');
|
|
8
9
|
|
package/dist/DrawerGrid-es.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
3
|
import { d as defineMessages, u as useAtlantisI18n } from './useAtlantisI18n-es.js';
|
|
4
|
+
import './AtlantisContext-es.js';
|
|
4
5
|
import { H as Heading } from './Heading-es.js';
|
|
5
6
|
import { B as ButtonDismiss } from './ButtonDismiss-es.js';
|
|
6
7
|
|
package/dist/DrawerTitle-cjs.js
CHANGED
|
@@ -39,7 +39,9 @@ const DialogClose = /*#__PURE__*/React__namespace.forwardRef(function DialogClos
|
|
|
39
39
|
nativeButton = true,
|
|
40
40
|
...elementProps
|
|
41
41
|
} = componentProps;
|
|
42
|
-
const
|
|
42
|
+
const {
|
|
43
|
+
store
|
|
44
|
+
} = ScrollAreaViewport.useDialogRootContext();
|
|
43
45
|
const open = store.useState('open');
|
|
44
46
|
const {
|
|
45
47
|
getButtonProps,
|
|
@@ -80,7 +82,9 @@ const DialogTitle = /*#__PURE__*/React__namespace.forwardRef(function DialogTitl
|
|
|
80
82
|
id: idProp,
|
|
81
83
|
...elementProps
|
|
82
84
|
} = componentProps;
|
|
83
|
-
const
|
|
85
|
+
const {
|
|
86
|
+
store
|
|
87
|
+
} = ScrollAreaViewport.useDialogRootContext();
|
|
84
88
|
const id = useScrollLock.useBaseUiId(idProp);
|
|
85
89
|
store.useSyncedValueWithCleanup('titleElementId', id);
|
|
86
90
|
return useRenderElement.useRenderElement('h2', componentProps, {
|
package/dist/DrawerTitle-es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { u as useDialogRootContext } from './ScrollAreaViewport-es.js';
|
|
3
3
|
import { u as useRenderElement } from './useRenderElement-es.js';
|
|
4
|
-
import {
|
|
4
|
+
import { c as useButton, d as createChangeEventDetails, e as closePress, u as useBaseUiId } from './useScrollLock-es.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* A button that closes the dialog.
|
|
@@ -18,7 +18,9 @@ const DialogClose = /*#__PURE__*/React.forwardRef(function DialogClose(component
|
|
|
18
18
|
nativeButton = true,
|
|
19
19
|
...elementProps
|
|
20
20
|
} = componentProps;
|
|
21
|
-
const
|
|
21
|
+
const {
|
|
22
|
+
store
|
|
23
|
+
} = useDialogRootContext();
|
|
22
24
|
const open = store.useState('open');
|
|
23
25
|
const {
|
|
24
26
|
getButtonProps,
|
|
@@ -59,7 +61,9 @@ const DialogTitle = /*#__PURE__*/React.forwardRef(function DialogTitle(component
|
|
|
59
61
|
id: idProp,
|
|
60
62
|
...elementProps
|
|
61
63
|
} = componentProps;
|
|
62
|
-
const
|
|
64
|
+
const {
|
|
65
|
+
store
|
|
66
|
+
} = useDialogRootContext();
|
|
63
67
|
const id = useBaseUiId(idProp);
|
|
64
68
|
store.useSyncedValueWithCleanup('titleElementId', id);
|
|
65
69
|
return useRenderElement('h2', componentProps, {
|
|
@@ -4,6 +4,7 @@ var React = require('react');
|
|
|
4
4
|
var framerMotion = require('framer-motion');
|
|
5
5
|
var classnames = require('classnames');
|
|
6
6
|
var useAtlantisI18n = require('./useAtlantisI18n-cjs.js');
|
|
7
|
+
require('./AtlantisContext-cjs.js');
|
|
7
8
|
var Heading = require('./Heading-cjs.js');
|
|
8
9
|
var Text = require('./Text-cjs.js');
|
|
9
10
|
var Content = require('./Content-cjs.js');
|
package/dist/FeatureSwitch-es.js
CHANGED
|
@@ -2,6 +2,7 @@ import React__default, { useState, useEffect } from 'react';
|
|
|
2
2
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { d as defineMessages, u as useAtlantisI18n } from './useAtlantisI18n-es.js';
|
|
5
|
+
import './AtlantisContext-es.js';
|
|
5
6
|
import { H as Heading } from './Heading-es.js';
|
|
6
7
|
import { T as Text } from './Text-es.js';
|
|
7
8
|
import { C as Content } from './Content-es.js';
|