@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.
Files changed (187) hide show
  1. package/dist/ActivityIndicator-cjs.js +1 -0
  2. package/dist/ActivityIndicator-es.js +1 -0
  3. package/dist/Autocomplete/index.cjs +2 -0
  4. package/dist/Autocomplete/index.mjs +2 -0
  5. package/dist/Autocomplete-cjs.js +6 -4
  6. package/dist/Autocomplete-es.js +3 -1
  7. package/dist/Banner-cjs.js +1 -0
  8. package/dist/Banner-es.js +1 -0
  9. package/dist/Card/index.cjs +2 -1
  10. package/dist/Card/index.mjs +2 -1
  11. package/dist/Chip/index.cjs +2 -0
  12. package/dist/Chip/index.mjs +2 -0
  13. package/dist/Chip-cjs.js +1 -0
  14. package/dist/Chip-es.js +1 -0
  15. package/dist/Chips/InternalChipDismissible/hooks/index.cjs +2 -0
  16. package/dist/Chips/InternalChipDismissible/hooks/index.mjs +2 -0
  17. package/dist/Chips/InternalChipDismissible/index.cjs +2 -0
  18. package/dist/Chips/InternalChipDismissible/index.mjs +2 -0
  19. package/dist/Chips/index.cjs +2 -0
  20. package/dist/Chips/index.mjs +2 -0
  21. package/dist/Combobox/index.cjs +4 -2
  22. package/dist/Combobox/index.mjs +4 -2
  23. package/dist/{ComboboxSeparator-cjs.js → ComboboxChipRemove-cjs.js} +455 -501
  24. package/dist/{ComboboxSeparator-es.js → ComboboxChipRemove-es.js} +456 -500
  25. package/dist/ComboboxPrimitive-cjs.js +30 -29
  26. package/dist/ComboboxPrimitive-es.js +3 -2
  27. package/dist/ConfirmationModal/index.cjs +2 -0
  28. package/dist/ConfirmationModal/index.mjs +2 -0
  29. package/dist/ConfirmationModal-cjs.js +1 -0
  30. package/dist/ConfirmationModal-es.js +1 -0
  31. package/dist/DataDump/index.cjs +2 -1
  32. package/dist/DataDump/index.mjs +2 -1
  33. package/dist/DataDump-cjs.js +1 -0
  34. package/dist/DataDump-es.js +1 -0
  35. package/dist/DataList/components/DataListActions/index.cjs +2 -0
  36. package/dist/DataList/components/DataListActions/index.mjs +2 -0
  37. package/dist/DataList/components/DataListBulkActions/index.cjs +2 -0
  38. package/dist/DataList/components/DataListBulkActions/index.mjs +2 -0
  39. package/dist/DataList/components/DataListFilters/components/DataListSort/index.cjs +2 -0
  40. package/dist/DataList/components/DataListFilters/components/DataListSort/index.mjs +2 -0
  41. package/dist/DataList/components/DataListFilters/index.cjs +2 -0
  42. package/dist/DataList/components/DataListFilters/index.mjs +2 -0
  43. package/dist/DataList/components/DataListHeader/index.cjs +2 -0
  44. package/dist/DataList/components/DataListHeader/index.mjs +2 -0
  45. package/dist/DataList/components/DataListItem/index.cjs +2 -0
  46. package/dist/DataList/components/DataListItem/index.mjs +2 -0
  47. package/dist/DataList/components/DataListItemActions/index.cjs +2 -0
  48. package/dist/DataList/components/DataListItemActions/index.mjs +2 -0
  49. package/dist/DataList/components/DataListItemActionsOverflow/index.cjs +2 -0
  50. package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +2 -0
  51. package/dist/DataList/components/DataListItems/index.cjs +2 -0
  52. package/dist/DataList/components/DataListItems/index.mjs +2 -0
  53. package/dist/DataList/components/DataListLayout/index.cjs +2 -0
  54. package/dist/DataList/components/DataListLayout/index.mjs +2 -0
  55. package/dist/DataList/components/DataListLayoutActions/index.cjs +2 -0
  56. package/dist/DataList/components/DataListLayoutActions/index.mjs +2 -0
  57. package/dist/DataList/index.cjs +2 -0
  58. package/dist/DataList/index.mjs +2 -0
  59. package/dist/DataTable-cjs.js +1 -0
  60. package/dist/DataTable-es.js +1 -0
  61. package/dist/DatePicker/index.cjs +2 -0
  62. package/dist/DatePicker/index.mjs +2 -0
  63. package/dist/DatePicker-cjs.js +8 -7
  64. package/dist/DatePicker-es.js +6 -5
  65. package/dist/Dialog/index.cjs +2 -1
  66. package/dist/Dialog/index.mjs +2 -1
  67. package/dist/DrawerDescription-cjs.js +99 -268
  68. package/dist/DrawerDescription-es.js +103 -270
  69. package/dist/DrawerGrid-cjs.js +1 -0
  70. package/dist/DrawerGrid-es.js +1 -0
  71. package/dist/DrawerTitle-cjs.js +6 -2
  72. package/dist/DrawerTitle-es.js +7 -3
  73. package/dist/FeatureSwitch-cjs.js +1 -0
  74. package/dist/FeatureSwitch-es.js +1 -0
  75. package/dist/FieldDescription-cjs.js +181 -184
  76. package/dist/FieldDescription-es.js +184 -187
  77. package/dist/FilterPicker/components/FilterPickerActivator/index.cjs +2 -0
  78. package/dist/FilterPicker/components/FilterPickerActivator/index.mjs +2 -0
  79. package/dist/FilterPicker/components/FilterPickerContent/index.cjs +2 -0
  80. package/dist/FilterPicker/components/FilterPickerContent/index.mjs +2 -0
  81. package/dist/FilterPicker/components/FilterPickerTrigger/index.cjs +2 -0
  82. package/dist/FilterPicker/components/FilterPickerTrigger/index.mjs +2 -0
  83. package/dist/FilterPicker/index.cjs +2 -0
  84. package/dist/FilterPicker/index.mjs +2 -0
  85. package/dist/FilterPickerContent-cjs.js +5 -4
  86. package/dist/FilterPickerContent-es.js +2 -1
  87. package/dist/FormFieldWrapper-cjs.js +1 -0
  88. package/dist/FormFieldWrapper-es.js +1 -0
  89. package/dist/FormatFile/index.cjs +2 -0
  90. package/dist/FormatFile/index.mjs +2 -0
  91. package/dist/FormatFile-cjs.js +1 -0
  92. package/dist/FormatFile-es.js +1 -0
  93. package/dist/Gallery/index.cjs +2 -0
  94. package/dist/Gallery/index.mjs +2 -0
  95. package/dist/InputAvatar-cjs.js +1 -0
  96. package/dist/InputAvatar-es.js +1 -0
  97. package/dist/InputDate/index.cjs +2 -0
  98. package/dist/InputDate/index.mjs +2 -0
  99. package/dist/InputDate-cjs.js +1 -0
  100. package/dist/InputDate-es.js +1 -0
  101. package/dist/InputNumber/index.cjs +2 -1
  102. package/dist/InputNumber/index.mjs +2 -1
  103. package/dist/InternalChipDismissible-cjs.js +1 -0
  104. package/dist/InternalChipDismissible-es.js +1 -0
  105. package/dist/LightBox/index.cjs +2 -0
  106. package/dist/LightBox/index.mjs +2 -0
  107. package/dist/LightBox-cjs.js +1 -0
  108. package/dist/LightBox-es.js +1 -0
  109. package/dist/Menu/index.cjs +2 -1
  110. package/dist/Menu/index.mjs +2 -1
  111. package/dist/Menu-cjs.js +6 -4
  112. package/dist/Menu-es.js +3 -1
  113. package/dist/MenuSubmenuTrigger-cjs.js +164 -206
  114. package/dist/MenuSubmenuTrigger-es.js +152 -194
  115. package/dist/Modal/index.cjs +3 -1
  116. package/dist/Modal/index.mjs +4 -2
  117. package/dist/NumberFieldInput-cjs.js +308 -187
  118. package/dist/NumberFieldInput-es.js +308 -187
  119. package/dist/Page/index.cjs +2 -1
  120. package/dist/Page/index.mjs +2 -1
  121. package/dist/Page-cjs.js +1 -0
  122. package/dist/Page-es.js +1 -0
  123. package/dist/Popover/index.cjs +2 -0
  124. package/dist/Popover/index.mjs +2 -0
  125. package/dist/Popover-cjs.js +9 -7
  126. package/dist/Popover-es.js +3 -1
  127. package/dist/ProgressBar-cjs.js +1 -0
  128. package/dist/ProgressBar-es.js +1 -0
  129. package/dist/ScrollAreaViewport-cjs.js +1093 -747
  130. package/dist/ScrollAreaViewport-es.js +1081 -734
  131. package/dist/Select/index.cjs +2 -1
  132. package/dist/Select/index.mjs +2 -1
  133. package/dist/SelectGroupLabel-cjs.js +306 -207
  134. package/dist/SelectGroupLabel-es.js +302 -203
  135. package/dist/SideDrawer-cjs.js +1 -0
  136. package/dist/SideDrawer-es.js +1 -0
  137. package/dist/Spinner-cjs.js +1 -0
  138. package/dist/Spinner-es.js +1 -0
  139. package/dist/Tooltip/index.cjs +2 -0
  140. package/dist/Tooltip/index.mjs +2 -0
  141. package/dist/Tooltip-cjs.js +7 -6
  142. package/dist/Tooltip-es.js +2 -1
  143. package/dist/dialogReturnFocus-cjs.js +1 -1
  144. package/dist/dialogReturnFocus-es.js +2 -2
  145. package/dist/floating-ui.react-cjs.js +192 -2564
  146. package/dist/floating-ui.react-dom-cjs.js +2103 -0
  147. package/dist/floating-ui.react-dom-es.js +2072 -0
  148. package/dist/floating-ui.react-es.js +156 -2519
  149. package/dist/floating-ui.utils-cjs.js +342 -0
  150. package/dist/floating-ui.utils-es.js +300 -0
  151. package/dist/index.cjs +4 -3
  152. package/dist/index.mjs +4 -3
  153. package/dist/primitives/BottomSheet/index.cjs +1 -1
  154. package/dist/primitives/BottomSheet/index.mjs +1 -1
  155. package/dist/primitives/ComboboxPrimitive/index.cjs +4 -2
  156. package/dist/primitives/ComboboxPrimitive/index.mjs +4 -2
  157. package/dist/primitives/SelectPrimitive/index.cjs +2 -0
  158. package/dist/primitives/SelectPrimitive/index.mjs +2 -0
  159. package/dist/primitives/index.cjs +3 -2
  160. package/dist/primitives/index.mjs +3 -2
  161. package/dist/scrollEdges-cjs.js +11 -1
  162. package/dist/scrollEdges-es.js +11 -1
  163. package/dist/sharedHelpers/i18n/index.cjs +1 -0
  164. package/dist/sharedHelpers/i18n/index.d.ts +1 -0
  165. package/dist/sharedHelpers/i18n/index.mjs +1 -1
  166. package/dist/sharedHelpers/i18n/releasedLanguages.d.ts +12 -0
  167. package/dist/sharedHelpers/i18n/useReleasedLocale.d.ts +6 -0
  168. package/dist/showToast-cjs.js +1 -1
  169. package/dist/showToast-es.js +1 -1
  170. package/dist/testUtils/releasedLanguages.d.ts +16 -0
  171. package/dist/unstyledPrimitives/index.cjs +478 -720
  172. package/dist/unstyledPrimitives/index.mjs +421 -663
  173. package/dist/useAtlantisI18n-cjs.js +44 -11
  174. package/dist/useAtlantisI18n-es.js +44 -12
  175. package/dist/useCompositeListItem-cjs.js +361 -2108
  176. package/dist/useCompositeListItem-es.js +331 -2076
  177. package/dist/useLabel-cjs.js +3 -2
  178. package/dist/useLabel-es.js +3 -2
  179. package/dist/useRenderElement-cjs.js +7 -9
  180. package/dist/useRenderElement-es.js +7 -9
  181. package/dist/useScrollLock-cjs.js +344 -819
  182. package/dist/useScrollLock-es.js +296 -732
  183. package/dist/useScrollToActive-cjs.js +5 -4
  184. package/dist/useScrollToActive-es.js +2 -1
  185. package/package.json +3 -3
  186. package/dist/scrollable-cjs.js +0 -58
  187. package/dist/scrollable-es.js +0 -54
@@ -1,227 +1,14 @@
1
1
  import * as React from 'react';
2
- import { u as useDialogRootContext, k as useDialogPortalContext, l as dialogStateAttributesMapping, m as useRenderDialogRoot, n as createNullDialogStore } from './ScrollAreaViewport-es.js';
3
- import { f as formatErrorMessage, u as useRenderElement } from './useRenderElement-es.js';
4
- import { A as AnimationFrame, h as createChangeEventDetails, k as imperativeAction, p as popupTransitionStateMapping, u as useBaseUiId, l as useOpenChangeComplete, m as createDefaultInitialFocus, F as FOCUSABLE_POPUP_PROPS, n as FloatingFocusManager } from './useScrollLock-es.js';
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
- * Minimal store contract exposed by popup handles to detached triggers.
10
- *
11
- * Detached triggers read `store` during render and subscribe to be notified when the handle switches
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 store = useDialogRootContext();
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: popupTransitionStateMapping,
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 store = useDialogRootContext();
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 store = useDialogRootContext();
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: floatingId,
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
- '--nested-dialogs': nestedOpenDialogCount
197
+ [DialogPopupCssVars.nestedDialogs]: nestedOpenDialogCount
351
198
  }
352
199
  }, elementProps],
353
200
  ref: [forwardedRef, store.context.popupRef, setPopupElement],
354
- stateAttributesMapping: dialogStateAttributesMapping
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
- * Groups all parts of the dialog.
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
- function DialogRoot(props) {
377
- return useRenderDialogRoot('dialog', props);
378
- }
220
+ class DialogHandle {
221
+ /**
222
+ * Internal store holding the dialog state.
223
+ * @internal
224
+ */
379
225
 
380
- /**
381
- * Controls a Dialog imperatively and associates detached `Dialog.Trigger` components with a
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, optionally associating it with a trigger.
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. The trigger must be a matching
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.openByTrigger(triggerId);
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 with the given payload, without associating it with any trigger.
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. It is exposed to the root's render-prop children.
252
+ * @param payload Payload to set when opening the dialog.
411
253
  */
412
254
  openWithPayload(payload) {
413
- const attachedStore = this.attachedStore;
414
- if (attachedStore === null) {
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.closePopup();
263
+ this.store.setOpen(false, createChangeEventDetails(imperativeAction, undefined, undefined));
431
264
  }
432
265
 
433
266
  /**
434
- * Whether the dialog is currently open. Returns `false` while no root is attached to the handle.
267
+ * Indicates whether the dialog is currently open.
435
268
  */
436
269
  get isOpen() {
437
- return this.attachedStore?.select('open') ?? false;
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 { BasePopupHandle as B, DrawerDescription as D, DialogRoot as a, DialogBackdrop as b, DialogPopup as c, DialogDescription as d, createDialogHandle as e, DialogHandle as f };
289
+ export { DrawerDescription as D, DialogBackdrop as a, DialogPopup as b, DialogDescription as c, createDialogHandle as d, DialogHandle as e };
@@ -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
 
@@ -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
 
@@ -39,7 +39,9 @@ const DialogClose = /*#__PURE__*/React__namespace.forwardRef(function DialogClos
39
39
  nativeButton = true,
40
40
  ...elementProps
41
41
  } = componentProps;
42
- const store = ScrollAreaViewport.useDialogRootContext();
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 store = ScrollAreaViewport.useDialogRootContext();
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, {
@@ -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 { f as useButton, h as createChangeEventDetails, j as closePress, u as useBaseUiId } from './useScrollLock-es.js';
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 store = useDialogRootContext();
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 store = useDialogRootContext();
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');
@@ -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';