@jobber/components 8.27.0 → 8.27.2-upgrade-ax-69e6080.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/dist/BottomSheet-cjs.js +8 -7
- package/dist/BottomSheet-es.js +9 -8
- package/dist/ComboboxChipRemove-es.js +2 -2
- package/dist/DrawerDescription-cjs.js +4 -97
- package/dist/DrawerDescription-es.js +6 -98
- package/dist/MenuSubmenuTrigger-es.js +3 -3
- package/dist/Modal/index.cjs +12 -2
- package/dist/Modal/index.mjs +13 -3
- package/dist/ScrollAreaViewport-cjs.js +2122 -12
- package/dist/ScrollAreaViewport-es.js +2118 -13
- package/dist/dialogReturnFocus-cjs.js +8 -5
- package/dist/dialogReturnFocus-es.js +9 -6
- package/dist/styles.css +66 -10
- package/dist/unstyledPrimitives/index.cjs +218 -2230
- package/dist/unstyledPrimitives/index.mjs +224 -2236
- package/dist/useButton-es.js +1 -1
- package/dist/useScrollLock-es.js +2 -2
- package/package.json +7 -7
package/dist/BottomSheet-cjs.js
CHANGED
|
@@ -7,7 +7,7 @@ var buttonRenderAdapter = require('./buttonRenderAdapter-cjs.js');
|
|
|
7
7
|
var Button = require('./Button-cjs.js');
|
|
8
8
|
var ScrollAreaViewport = require('./ScrollAreaViewport-cjs.js');
|
|
9
9
|
|
|
10
|
-
var styles = {"backdrop":"Qf3IFhKJwQ0-","popup":"_868PDAA3U2M-","content":"eKuxReHyju8-","scrollRoot":"V--tRnN-P0I-","scrollArea":"_1I0eaFciaWo-","bottomFade":"BYEzqcZUGls-","spinning":"IJxq5fm5qdw-"};
|
|
10
|
+
var styles = {"backdrop":"Qf3IFhKJwQ0-","viewport":"U069n8h0urk-","popup":"_868PDAA3U2M-","content":"eKuxReHyju8-","scrollRoot":"V--tRnN-P0I-","scrollArea":"_1I0eaFciaWo-","bottomFade":"BYEzqcZUGls-","spinning":"IJxq5fm5qdw-"};
|
|
11
11
|
|
|
12
12
|
// `resolveBottomSheetTriggerRender` so an Atlantis `<Button>` works as a trigger
|
|
13
13
|
// via `children` or `render`. Raw text children are wrapped in a default Button.
|
|
@@ -64,11 +64,12 @@ function BottomSheetPopup(_a) {
|
|
|
64
64
|
const renderScrollArea = React.useContext(BottomSheetScrollAreaContext);
|
|
65
65
|
return (React.createElement(ScrollAreaViewport.DrawerPortal, null,
|
|
66
66
|
React.createElement(ScrollAreaViewport.DrawerBackdrop, { forceRender: true, className: styles.backdrop, "data-testid": "ATL-BottomSheet-Backdrop" }),
|
|
67
|
-
React.createElement(ScrollAreaViewport.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
React.createElement(ScrollAreaViewport.DrawerViewport, { className: styles.viewport, "data-testid": "ATL-BottomSheet-Viewport" },
|
|
68
|
+
React.createElement(ScrollAreaViewport.DrawerPopup, Object.assign({}, popupProps, { ref: ref, className: classnames(styles.popup, className), initialFocus: initialFocus, finalFocus: finalFocus }), !renderScrollArea ? (
|
|
69
|
+
// The consumer manages its own scroll region (e.g. Dialog pins a
|
|
70
|
+
// header/footer outside a single scroll area) — often by composing
|
|
71
|
+
// `BottomSheet.ScrollArea` itself.
|
|
72
|
+
children) : (React.createElement(BottomSheetScrollArea, null, children))))));
|
|
72
73
|
}
|
|
73
74
|
/**
|
|
74
75
|
* The sheet's scroll region: a styled BaseUI `ScrollArea` (native scrollbar) with
|
|
@@ -78,7 +79,7 @@ function BottomSheetPopup(_a) {
|
|
|
78
79
|
* directly.
|
|
79
80
|
*/
|
|
80
81
|
function BottomSheetScrollArea({ children, className, style, }) {
|
|
81
|
-
return (React.createElement(ScrollAreaViewport.ScrollAreaRoot, { className: classnames(styles.scrollRoot, className), style: style },
|
|
82
|
+
return (React.createElement(ScrollAreaViewport.ScrollAreaRoot, { className: classnames(styles.scrollRoot, className), style: style, "data-testid": "ATL-BottomSheet-ScrollRegion" },
|
|
82
83
|
React.createElement(ScrollAreaViewport.ScrollAreaViewport, { className: styles.scrollArea, "data-testid": "ATL-BottomSheet-ScrollArea",
|
|
83
84
|
// BaseUI sets overflow: scroll in the style prop by default. This is to override that because adding it to the className doesn't work.
|
|
84
85
|
style: { overflow: "auto" } }, children),
|
package/dist/BottomSheet-es.js
CHANGED
|
@@ -3,9 +3,9 @@ import React__default from 'react';
|
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { n as normalizeBaseUiButtonProps, i as isAtlantisButtonRenderTarget, s as stripNativeTypeFromButtonRenderTarget, r as renderAtlantisButtonTarget } from './buttonRenderAdapter-es.js';
|
|
5
5
|
import { B as Button } from './Button-es.js';
|
|
6
|
-
import { D as DrawerTrigger, a as DrawerRoot, b as DrawerPortal, c as DrawerBackdrop, d as DrawerPopup, S as ScrollAreaRoot,
|
|
6
|
+
import { D as DrawerTrigger, a as DrawerRoot, b as DrawerPortal, c as DrawerBackdrop, d as DrawerViewport, e as DrawerPopup, S as ScrollAreaRoot, f as ScrollAreaViewport, g as DrawerContent } from './ScrollAreaViewport-es.js';
|
|
7
7
|
|
|
8
|
-
var styles = {"backdrop":"Qf3IFhKJwQ0-","popup":"_868PDAA3U2M-","content":"eKuxReHyju8-","scrollRoot":"V--tRnN-P0I-","scrollArea":"_1I0eaFciaWo-","bottomFade":"BYEzqcZUGls-","spinning":"IJxq5fm5qdw-"};
|
|
8
|
+
var styles = {"backdrop":"Qf3IFhKJwQ0-","viewport":"U069n8h0urk-","popup":"_868PDAA3U2M-","content":"eKuxReHyju8-","scrollRoot":"V--tRnN-P0I-","scrollArea":"_1I0eaFciaWo-","bottomFade":"BYEzqcZUGls-","spinning":"IJxq5fm5qdw-"};
|
|
9
9
|
|
|
10
10
|
// `resolveBottomSheetTriggerRender` so an Atlantis `<Button>` works as a trigger
|
|
11
11
|
// via `children` or `render`. Raw text children are wrapped in a default Button.
|
|
@@ -62,11 +62,12 @@ function BottomSheetPopup(_a) {
|
|
|
62
62
|
const renderScrollArea = React__default.useContext(BottomSheetScrollAreaContext);
|
|
63
63
|
return (React__default.createElement(DrawerPortal, null,
|
|
64
64
|
React__default.createElement(DrawerBackdrop, { forceRender: true, className: styles.backdrop, "data-testid": "ATL-BottomSheet-Backdrop" }),
|
|
65
|
-
React__default.createElement(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
React__default.createElement(DrawerViewport, { className: styles.viewport, "data-testid": "ATL-BottomSheet-Viewport" },
|
|
66
|
+
React__default.createElement(DrawerPopup, Object.assign({}, popupProps, { ref: ref, className: classnames(styles.popup, className), initialFocus: initialFocus, finalFocus: finalFocus }), !renderScrollArea ? (
|
|
67
|
+
// The consumer manages its own scroll region (e.g. Dialog pins a
|
|
68
|
+
// header/footer outside a single scroll area) — often by composing
|
|
69
|
+
// `BottomSheet.ScrollArea` itself.
|
|
70
|
+
children) : (React__default.createElement(BottomSheetScrollArea, null, children))))));
|
|
70
71
|
}
|
|
71
72
|
/**
|
|
72
73
|
* The sheet's scroll region: a styled BaseUI `ScrollArea` (native scrollbar) with
|
|
@@ -76,7 +77,7 @@ function BottomSheetPopup(_a) {
|
|
|
76
77
|
* directly.
|
|
77
78
|
*/
|
|
78
79
|
function BottomSheetScrollArea({ children, className, style, }) {
|
|
79
|
-
return (React__default.createElement(ScrollAreaRoot, { className: classnames(styles.scrollRoot, className), style: style },
|
|
80
|
+
return (React__default.createElement(ScrollAreaRoot, { className: classnames(styles.scrollRoot, className), style: style, "data-testid": "ATL-BottomSheet-ScrollRegion" },
|
|
80
81
|
React__default.createElement(ScrollAreaViewport, { className: styles.scrollArea, "data-testid": "ATL-BottomSheet-ScrollArea",
|
|
81
82
|
// BaseUI sets overflow: scroll in the style prop by default. This is to override that because adding it to the className doesn't work.
|
|
82
83
|
style: { overflow: "auto" } }, children),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { z as useControlled, b as useStableCallback, m as useValueAsRef, k as useTransitionStatus, a as useIsoLayoutEffect, J as createGenericEventDetails, G as inputClear, F as inputChange, d as createChangeEventDetails, v as focusOut, Q as outsidePress, g as getTarget, V as itemPress, f as useOpenChangeComplete, O as useValueChanged, C as none,
|
|
2
|
+
import { z as useControlled, b as useStableCallback, m as useValueAsRef, k as useTransitionStatus, a as useIsoLayoutEffect, J as createGenericEventDetails, G as inputClear, F as inputChange, d as createChangeEventDetails, v as focusOut, Q as outsidePress, g as getTarget, V as itemPress, f as useOpenChangeComplete, O as useValueChanged, C as none, a7 as inputPress, q as contains, D as visuallyHiddenInput, E as visuallyHidden, h as useTimeout, c as useButton, o as ownerDocument, s as stopEvent, r as listNavigation, e as closePress, u as useBaseUiId, a3 as android, _ as escapeKey, a8 as clearPress, t as transitionStatusMapping, A as ios, S as SafeReact, j as error, a9 as chipRemovePress } from './useButton-es.js';
|
|
3
3
|
import { f as formatErrorMessage, b as EMPTY_ARRAY, a as useRefWithInit, E as EMPTY_OBJECT, N as NOOP, m as mergeProps, c as useMergedRefs, u as useRenderElement } from './useRenderElement-es.js';
|
|
4
4
|
import { a as useFormContext, b as useFieldRootContext, c as useLabelableId, d as useRegisterFieldControl, f as fieldValidityMapping, u as useLabelableContext, F as FieldRootContext, e as DEFAULT_FIELD_ROOT_CONTEXT, g as DEFAULT_FIELD_STATE_ATTRIBUTES } from './useLabelableId-es.js';
|
|
5
5
|
import { u as useFloatingRootContext, a as useListNavigation, b as useTypeahead, g as getPseudoElementBounds, C as CompositeList, d as useAnchorPositioning, c as useAnchoredPopupScrollLock, e as usePositioner, f as getDisabledMountTransitionStyles, h as useCompositeListItem, I as IndexGuessBehavior } from './useCompositeListItem-es.js';
|
|
6
6
|
import { h as hasNullItemLabel, c as compareItemEquality, a as stringifyAsLabel, k as isGroupedItems, s as stringifyAsValue, i as selectedValueIncludes, j as removeItem, f as findItemIndex, d as defaultItemEquality, b as areArraysEqual, r as resolveAriaLabelledBy, l as getDefaultLabelId, e as resolveMultipleLabels, g as resolveSelectedLabel } from './resolveAriaLabelledBy-es.js';
|
|
7
|
-
import {
|
|
7
|
+
import { al as getGridNavigatedIndex, e as isIndexOutOfListBounds, t as createSelector, r as useDirection, S as Store, w as useStore, v as useOpenInteractionType, x as useClick, y as useDismiss, F as FOCUSABLE_POPUP_PROPS, z as useOnFirstRender, B as pressableTriggerOpenStateMapping, am as gecko, Q as isInteractiveElement, af as triggerOpenStateMapping, E as FloatingPortal, p as popupStateMapping, I as InternalBackdrop, G as inertValue, H as DROPDOWN_COLLISION_AVOIDANCE, a as FloatingFocusManager } from './useScrollLock-es.js';
|
|
8
8
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
9
9
|
import * as ReactDOM from 'react-dom';
|
|
10
10
|
import { s as stringifyLocale } from './stringifyLocale-es.js';
|
|
@@ -27,7 +27,7 @@ function _interopNamespaceDefault(e) {
|
|
|
27
27
|
|
|
28
28
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
29
29
|
|
|
30
|
-
const stateAttributesMapping$
|
|
30
|
+
const stateAttributesMapping$1 = {
|
|
31
31
|
...useScrollLock.popupStateMapping,
|
|
32
32
|
...useButton.transitionStatusMapping
|
|
33
33
|
};
|
|
@@ -60,7 +60,7 @@ const DialogBackdrop = /*#__PURE__*/React__namespace.forwardRef(function DialogB
|
|
|
60
60
|
return useRenderElement.useRenderElement('div', componentProps, {
|
|
61
61
|
state,
|
|
62
62
|
ref: [store.context.backdropRef, forwardedRef],
|
|
63
|
-
stateAttributesMapping: stateAttributesMapping$
|
|
63
|
+
stateAttributesMapping: stateAttributesMapping$1,
|
|
64
64
|
props: [{
|
|
65
65
|
role: 'presentation',
|
|
66
66
|
hidden: !mounted,
|
|
@@ -139,7 +139,7 @@ let DialogPopupDataAttributes = function (DialogPopupDataAttributes) {
|
|
|
139
139
|
return DialogPopupDataAttributes;
|
|
140
140
|
}({});
|
|
141
141
|
|
|
142
|
-
const stateAttributesMapping
|
|
142
|
+
const stateAttributesMapping = {
|
|
143
143
|
...useScrollLock.popupStateMapping,
|
|
144
144
|
...useButton.transitionStatusMapping,
|
|
145
145
|
nestedDialogOpen(value) {
|
|
@@ -220,7 +220,7 @@ const DialogPopup = /*#__PURE__*/React__namespace.forwardRef(function DialogPopu
|
|
|
220
220
|
}
|
|
221
221
|
}, elementProps],
|
|
222
222
|
ref: [forwardedRef, store.context.popupRef, setPopupElement],
|
|
223
|
-
stateAttributesMapping
|
|
223
|
+
stateAttributesMapping
|
|
224
224
|
});
|
|
225
225
|
return /*#__PURE__*/jsxRuntime.jsx(useScrollLock.FloatingFocusManager, {
|
|
226
226
|
context: floatingRootContext,
|
|
@@ -236,98 +236,6 @@ const DialogPopup = /*#__PURE__*/React__namespace.forwardRef(function DialogPopu
|
|
|
236
236
|
});
|
|
237
237
|
if (process.env.NODE_ENV !== "production") DialogPopup.displayName = "DialogPopup";
|
|
238
238
|
|
|
239
|
-
let DialogViewportDataAttributes = function (DialogViewportDataAttributes) {
|
|
240
|
-
/**
|
|
241
|
-
* Present when the dialog is open.
|
|
242
|
-
*/
|
|
243
|
-
DialogViewportDataAttributes[DialogViewportDataAttributes["open"] = useScrollLock.CommonPopupDataAttributes.open] = "open";
|
|
244
|
-
/**
|
|
245
|
-
* Present when the dialog is closed.
|
|
246
|
-
*/
|
|
247
|
-
DialogViewportDataAttributes[DialogViewportDataAttributes["closed"] = useScrollLock.CommonPopupDataAttributes.closed] = "closed";
|
|
248
|
-
/**
|
|
249
|
-
* Present when the dialog is animating in.
|
|
250
|
-
*/
|
|
251
|
-
DialogViewportDataAttributes[DialogViewportDataAttributes["startingStyle"] = useScrollLock.CommonPopupDataAttributes.startingStyle] = "startingStyle";
|
|
252
|
-
/**
|
|
253
|
-
* Present when the dialog is animating out.
|
|
254
|
-
*/
|
|
255
|
-
DialogViewportDataAttributes[DialogViewportDataAttributes["endingStyle"] = useScrollLock.CommonPopupDataAttributes.endingStyle] = "endingStyle";
|
|
256
|
-
/**
|
|
257
|
-
* Present when the dialog is nested within another dialog.
|
|
258
|
-
*/
|
|
259
|
-
DialogViewportDataAttributes["nested"] = "data-nested";
|
|
260
|
-
/**
|
|
261
|
-
* Present when the dialog has other open dialogs nested within it.
|
|
262
|
-
*/
|
|
263
|
-
DialogViewportDataAttributes["nestedDialogOpen"] = "data-nested-dialog-open";
|
|
264
|
-
return DialogViewportDataAttributes;
|
|
265
|
-
}({});
|
|
266
|
-
|
|
267
|
-
const stateAttributesMapping = {
|
|
268
|
-
...useScrollLock.popupStateMapping,
|
|
269
|
-
...useButton.transitionStatusMapping,
|
|
270
|
-
nested(value) {
|
|
271
|
-
return value ? {
|
|
272
|
-
[DialogViewportDataAttributes.nested]: ''
|
|
273
|
-
} : null;
|
|
274
|
-
},
|
|
275
|
-
nestedDialogOpen(value) {
|
|
276
|
-
return value ? {
|
|
277
|
-
[DialogViewportDataAttributes.nestedDialogOpen]: ''
|
|
278
|
-
} : null;
|
|
279
|
-
}
|
|
280
|
-
};
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* A positioning container for the dialog popup that can be made scrollable.
|
|
284
|
-
* Renders a `<div>` element.
|
|
285
|
-
*
|
|
286
|
-
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
|
|
287
|
-
*/
|
|
288
|
-
const DialogViewport = /*#__PURE__*/React__namespace.forwardRef(function DialogViewport(componentProps, forwardedRef) {
|
|
289
|
-
const {
|
|
290
|
-
render,
|
|
291
|
-
className,
|
|
292
|
-
style,
|
|
293
|
-
children,
|
|
294
|
-
...elementProps
|
|
295
|
-
} = componentProps;
|
|
296
|
-
const keepMounted = ScrollAreaViewport.useDialogPortalContext();
|
|
297
|
-
const {
|
|
298
|
-
store
|
|
299
|
-
} = ScrollAreaViewport.useDialogRootContext();
|
|
300
|
-
const open = store.useState('open');
|
|
301
|
-
const nested = store.useState('nested');
|
|
302
|
-
const transitionStatus = store.useState('transitionStatus');
|
|
303
|
-
const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');
|
|
304
|
-
const mounted = store.useState('mounted');
|
|
305
|
-
const setViewportElement = store.useStateSetter('viewportElement');
|
|
306
|
-
const nestedDialogOpen = nestedOpenDialogCount > 0;
|
|
307
|
-
const state = {
|
|
308
|
-
open,
|
|
309
|
-
nested,
|
|
310
|
-
transitionStatus,
|
|
311
|
-
nestedDialogOpen
|
|
312
|
-
};
|
|
313
|
-
const shouldRender = keepMounted || mounted;
|
|
314
|
-
return useRenderElement.useRenderElement('div', componentProps, {
|
|
315
|
-
enabled: shouldRender,
|
|
316
|
-
state,
|
|
317
|
-
ref: [forwardedRef, setViewportElement],
|
|
318
|
-
stateAttributesMapping,
|
|
319
|
-
props: [{
|
|
320
|
-
role: 'presentation',
|
|
321
|
-
hidden: !mounted,
|
|
322
|
-
style: {
|
|
323
|
-
pointerEvents: !open ? 'none' : undefined
|
|
324
|
-
},
|
|
325
|
-
children
|
|
326
|
-
}, elementProps]
|
|
327
|
-
});
|
|
328
|
-
});
|
|
329
|
-
if (process.env.NODE_ENV !== "production") DialogViewport.displayName = "DialogViewport";
|
|
330
|
-
|
|
331
239
|
/**
|
|
332
240
|
* A handle to control a Dialog imperatively and to associate detached triggers with it.
|
|
333
241
|
*/
|
|
@@ -404,6 +312,5 @@ exports.DialogBackdrop = DialogBackdrop;
|
|
|
404
312
|
exports.DialogDescription = DialogDescription;
|
|
405
313
|
exports.DialogHandle = DialogHandle;
|
|
406
314
|
exports.DialogPopup = DialogPopup;
|
|
407
|
-
exports.DialogViewport = DialogViewport;
|
|
408
315
|
exports.DrawerDescription = DrawerDescription;
|
|
409
316
|
exports.createDialogHandle = createDialogHandle;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { u as useDialogRootContext,
|
|
2
|
+
import { u as useDialogRootContext, h as useDialogPortalContext, i as DialogStore } from './ScrollAreaViewport-es.js';
|
|
3
3
|
import { u as useRenderElement } from './useRenderElement-es.js';
|
|
4
4
|
import { p as popupStateMapping, C as CommonPopupDataAttributes, c as createDefaultInitialFocus, F as FOCUSABLE_POPUP_PROPS, a as FloatingFocusManager } from './useScrollLock-es.js';
|
|
5
5
|
import { t as transitionStatusMapping, u as useBaseUiId, f as useOpenChangeComplete, d as createChangeEventDetails, i as imperativeAction } from './useButton-es.js';
|
|
6
6
|
import { C as COMPOSITE_KEYS } from './scrollEdges-es.js';
|
|
7
7
|
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
|
-
const stateAttributesMapping$
|
|
9
|
+
const stateAttributesMapping$1 = {
|
|
10
10
|
...popupStateMapping,
|
|
11
11
|
...transitionStatusMapping
|
|
12
12
|
};
|
|
@@ -39,7 +39,7 @@ const DialogBackdrop = /*#__PURE__*/React.forwardRef(function DialogBackdrop(com
|
|
|
39
39
|
return useRenderElement('div', componentProps, {
|
|
40
40
|
state,
|
|
41
41
|
ref: [store.context.backdropRef, forwardedRef],
|
|
42
|
-
stateAttributesMapping: stateAttributesMapping$
|
|
42
|
+
stateAttributesMapping: stateAttributesMapping$1,
|
|
43
43
|
props: [{
|
|
44
44
|
role: 'presentation',
|
|
45
45
|
hidden: !mounted,
|
|
@@ -118,7 +118,7 @@ let DialogPopupDataAttributes = function (DialogPopupDataAttributes) {
|
|
|
118
118
|
return DialogPopupDataAttributes;
|
|
119
119
|
}({});
|
|
120
120
|
|
|
121
|
-
const stateAttributesMapping
|
|
121
|
+
const stateAttributesMapping = {
|
|
122
122
|
...popupStateMapping,
|
|
123
123
|
...transitionStatusMapping,
|
|
124
124
|
nestedDialogOpen(value) {
|
|
@@ -199,7 +199,7 @@ const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(component
|
|
|
199
199
|
}
|
|
200
200
|
}, elementProps],
|
|
201
201
|
ref: [forwardedRef, store.context.popupRef, setPopupElement],
|
|
202
|
-
stateAttributesMapping
|
|
202
|
+
stateAttributesMapping
|
|
203
203
|
});
|
|
204
204
|
return /*#__PURE__*/jsx(FloatingFocusManager, {
|
|
205
205
|
context: floatingRootContext,
|
|
@@ -215,98 +215,6 @@ const DialogPopup = /*#__PURE__*/React.forwardRef(function DialogPopup(component
|
|
|
215
215
|
});
|
|
216
216
|
if (process.env.NODE_ENV !== "production") DialogPopup.displayName = "DialogPopup";
|
|
217
217
|
|
|
218
|
-
let DialogViewportDataAttributes = function (DialogViewportDataAttributes) {
|
|
219
|
-
/**
|
|
220
|
-
* Present when the dialog is open.
|
|
221
|
-
*/
|
|
222
|
-
DialogViewportDataAttributes[DialogViewportDataAttributes["open"] = CommonPopupDataAttributes.open] = "open";
|
|
223
|
-
/**
|
|
224
|
-
* Present when the dialog is closed.
|
|
225
|
-
*/
|
|
226
|
-
DialogViewportDataAttributes[DialogViewportDataAttributes["closed"] = CommonPopupDataAttributes.closed] = "closed";
|
|
227
|
-
/**
|
|
228
|
-
* Present when the dialog is animating in.
|
|
229
|
-
*/
|
|
230
|
-
DialogViewportDataAttributes[DialogViewportDataAttributes["startingStyle"] = CommonPopupDataAttributes.startingStyle] = "startingStyle";
|
|
231
|
-
/**
|
|
232
|
-
* Present when the dialog is animating out.
|
|
233
|
-
*/
|
|
234
|
-
DialogViewportDataAttributes[DialogViewportDataAttributes["endingStyle"] = CommonPopupDataAttributes.endingStyle] = "endingStyle";
|
|
235
|
-
/**
|
|
236
|
-
* Present when the dialog is nested within another dialog.
|
|
237
|
-
*/
|
|
238
|
-
DialogViewportDataAttributes["nested"] = "data-nested";
|
|
239
|
-
/**
|
|
240
|
-
* Present when the dialog has other open dialogs nested within it.
|
|
241
|
-
*/
|
|
242
|
-
DialogViewportDataAttributes["nestedDialogOpen"] = "data-nested-dialog-open";
|
|
243
|
-
return DialogViewportDataAttributes;
|
|
244
|
-
}({});
|
|
245
|
-
|
|
246
|
-
const stateAttributesMapping = {
|
|
247
|
-
...popupStateMapping,
|
|
248
|
-
...transitionStatusMapping,
|
|
249
|
-
nested(value) {
|
|
250
|
-
return value ? {
|
|
251
|
-
[DialogViewportDataAttributes.nested]: ''
|
|
252
|
-
} : null;
|
|
253
|
-
},
|
|
254
|
-
nestedDialogOpen(value) {
|
|
255
|
-
return value ? {
|
|
256
|
-
[DialogViewportDataAttributes.nestedDialogOpen]: ''
|
|
257
|
-
} : null;
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* A positioning container for the dialog popup that can be made scrollable.
|
|
263
|
-
* Renders a `<div>` element.
|
|
264
|
-
*
|
|
265
|
-
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
|
|
266
|
-
*/
|
|
267
|
-
const DialogViewport = /*#__PURE__*/React.forwardRef(function DialogViewport(componentProps, forwardedRef) {
|
|
268
|
-
const {
|
|
269
|
-
render,
|
|
270
|
-
className,
|
|
271
|
-
style,
|
|
272
|
-
children,
|
|
273
|
-
...elementProps
|
|
274
|
-
} = componentProps;
|
|
275
|
-
const keepMounted = useDialogPortalContext();
|
|
276
|
-
const {
|
|
277
|
-
store
|
|
278
|
-
} = useDialogRootContext();
|
|
279
|
-
const open = store.useState('open');
|
|
280
|
-
const nested = store.useState('nested');
|
|
281
|
-
const transitionStatus = store.useState('transitionStatus');
|
|
282
|
-
const nestedOpenDialogCount = store.useState('nestedOpenDialogCount');
|
|
283
|
-
const mounted = store.useState('mounted');
|
|
284
|
-
const setViewportElement = store.useStateSetter('viewportElement');
|
|
285
|
-
const nestedDialogOpen = nestedOpenDialogCount > 0;
|
|
286
|
-
const state = {
|
|
287
|
-
open,
|
|
288
|
-
nested,
|
|
289
|
-
transitionStatus,
|
|
290
|
-
nestedDialogOpen
|
|
291
|
-
};
|
|
292
|
-
const shouldRender = keepMounted || mounted;
|
|
293
|
-
return useRenderElement('div', componentProps, {
|
|
294
|
-
enabled: shouldRender,
|
|
295
|
-
state,
|
|
296
|
-
ref: [forwardedRef, setViewportElement],
|
|
297
|
-
stateAttributesMapping,
|
|
298
|
-
props: [{
|
|
299
|
-
role: 'presentation',
|
|
300
|
-
hidden: !mounted,
|
|
301
|
-
style: {
|
|
302
|
-
pointerEvents: !open ? 'none' : undefined
|
|
303
|
-
},
|
|
304
|
-
children
|
|
305
|
-
}, elementProps]
|
|
306
|
-
});
|
|
307
|
-
});
|
|
308
|
-
if (process.env.NODE_ENV !== "production") DialogViewport.displayName = "DialogViewport";
|
|
309
|
-
|
|
310
218
|
/**
|
|
311
219
|
* A handle to control a Dialog imperatively and to associate detached triggers with it.
|
|
312
220
|
*/
|
|
@@ -379,4 +287,4 @@ function createDialogHandle() {
|
|
|
379
287
|
*/
|
|
380
288
|
const DrawerDescription = DialogDescription;
|
|
381
289
|
|
|
382
|
-
export { DrawerDescription as D, DialogBackdrop as a,
|
|
290
|
+
export { DrawerDescription as D, DialogBackdrop as a, DialogPopup as b, DialogDescription as c, createDialogHandle as d, DialogHandle as e };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { a as useRefWithInit, f as formatErrorMessage, u as useRenderElement, m as mergeProps, c as useMergedRefs, E as EMPTY_OBJECT, b as EMPTY_ARRAY, w as warn } from './useRenderElement-es.js';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { K as mergeCleanups, L as isTypeableElement, M as matchesFocusVisible, N as isTargetInsideEnabledTrigger, O as createAttribute, J as webkit, d as useFloatingTree, u as useFloatingParentNodeId, Q as isInteractiveElement, R as getNodeChildren, p as popupStateMapping, a as FloatingFocusManager, E as FloatingPortal, T as POPUP_COLLISION_AVOIDANCE, I as InternalBackdrop, G as inertValue, U as FloatingNode, H as DROPDOWN_COLLISION_AVOIDANCE, t as createSelector, V as ReactStore, P as PopupTriggerMap, W as FloatingTreeStore, X as fastComponent, Y as useInitialOpenSync, Z as useFloatingNodeId, v as useOpenInteractionType, _ as useImplicitActiveTrigger, $ as useOpenStateTransitions, a0 as attachPreventUnmountOnClose, a1 as setPopupOpenState, a2 as useSyncedFloatingRootContext, y as useDismiss, r as useDirection, a3 as TYPEAHEAD_RESET_MS, F as FOCUSABLE_POPUP_PROPS, a4 as usePopupInteractionProps, a5 as FloatingTree, a6 as getTabbableBeforeElement, a7 as isOutsideEvent, a8 as getTabbableAfterElement, a9 as getNextTabbable, aa as fastComponentRef, ab as useTriggerDataForwarding, x as useClick, B as pressableTriggerOpenStateMapping, ac as FocusGuard, ad as PATIENT_CLICK_THRESHOLD, ae as useTriggerRegistration, af as triggerOpenStateMapping } from './useScrollLock-es.js';
|
|
4
|
+
import { W as isMouseLikePointerType, h as useTimeout, B as addEventListener, g as getTarget, d as createChangeEventDetails, X as triggerFocus, p as activeElement, o as ownerDocument, q as contains, Y as mac, Z as triggerPress, _ as escapeKey, L as useOnMount, T as Timeout, b as useStableCallback, a as useIsoLayoutEffect, $ as triggerHover, m as useValueAsRef, t as transitionStatusMapping, V as itemPress, c as useButton, u as useBaseUiId, f as useOpenChangeComplete, Q as outsidePress, a0 as useAnimationsFinished, a1 as siblingOpen, z as useControlled, k as useTransitionStatus, l as useId, v as focusOut, r as listNavigation, i as imperativeAction, a2 as useCompositeRootContext, R as cancelOpen, S as SafeReact } from './useButton-es.js';
|
|
5
5
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
6
|
import { h as useCompositeListItem, f as getDisabledMountTransitionStyles, d as useAnchorPositioning, i as adaptiveOrigin, c as useAnchoredPopupScrollLock, e as usePositioner, C as CompositeList, a as useListNavigation, b as useTypeahead, g as getPseudoElementBounds } from './useCompositeListItem-es.js';
|
|
7
7
|
import { u as useToolbarRootContext, i as isElementDisabled } from './isElementDisabled-es.js';
|
|
8
8
|
import { C as COMPOSITE_KEYS } from './scrollEdges-es.js';
|
|
9
9
|
import { o as getWindow, b as isElement, i as isHTMLElement, d as isLastTraversableNode, e as getParentNode } from './floating-ui.utils.dom-es.js';
|
|
10
|
-
import { p as popupStoreSelectors,
|
|
10
|
+
import { p as popupStoreSelectors, n as createInitialPopupStoreState } from './ScrollAreaViewport-es.js';
|
|
11
11
|
import * as ReactDOM from 'react-dom';
|
|
12
12
|
|
|
13
13
|
function resolveValue(value, pointerType) {
|
package/dist/Modal/index.cjs
CHANGED
|
@@ -42,8 +42,7 @@ function ModalLegacy({ open = false, title, size, dismissible = true, children,
|
|
|
42
42
|
const containerClassName = classnames(styles$1.container, size === "fullScreen" && styles$1.containerFullScreen);
|
|
43
43
|
jobberHooks.useRefocusOnActivator(open);
|
|
44
44
|
const modalRef = jobberHooks.useFocusTrap(open);
|
|
45
|
-
|
|
46
|
-
const template = (React.createElement(framerMotion.AnimatePresence, null, open && (React.createElement("div", { ref: modalRef, role: "dialog", className: containerClassName, tabIndex: 0, "aria-modal": "true", "aria-labelledby": title ? MODAL_HEADER_ID : undefined, "aria-label": ariaLabel },
|
|
45
|
+
const template = (React.createElement(framerMotion.AnimatePresence, null, open && (React.createElement("div", { ref: modalRef, role: "dialog", className: containerClassName, tabIndex: 0, "aria-modal": "true", "aria-labelledby": title ? MODAL_HEADER_ID : undefined, "aria-label": ariaLabel, onKeyDown: handleKeyDown },
|
|
47
46
|
React.createElement(framerMotion.motion.div, { key: styles$1.overlay, className: styles$1.overlay, onClick: onRequestClose, initial: { opacity: 0 }, animate: { opacity: 0.8 }, exit: { opacity: 0 }, transition: { duration: 0.2 } }),
|
|
48
47
|
React.createElement(framerMotion.motion.div, { key: styles$1.modal, className: modalClassName, initial: { scale: 0.9, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.9, opacity: 0 }, transition: {
|
|
49
48
|
duration: 0.2,
|
|
@@ -60,6 +59,17 @@ function ModalLegacy({ open = false, title, size, dismissible = true, children,
|
|
|
60
59
|
onRequestClose();
|
|
61
60
|
}
|
|
62
61
|
}
|
|
62
|
+
function handleKeyDown(event) {
|
|
63
|
+
if (event.key === "Escape") {
|
|
64
|
+
// Stop the Escape from bubbling to outer overlays (e.g. a Base UI Dialog
|
|
65
|
+
// this Modal is nested within, whose dismissal listens at the document
|
|
66
|
+
// level). Without this, one Escape closes both layers; instead only the
|
|
67
|
+
// top-most layer — this Modal — should close. Mirrors SideDrawer's
|
|
68
|
+
// Escape containment.
|
|
69
|
+
event.stopPropagation();
|
|
70
|
+
handleRequestClose();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
63
73
|
}
|
|
64
74
|
function Header({ title, dismissible, onRequestClose }) {
|
|
65
75
|
return (React.createElement("div", { className: styles$1.header, "data-testid": "modal-header" },
|
package/dist/Modal/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import React__default, { useRef, useEffect, createContext, useContext } from 're
|
|
|
2
2
|
import ReactDOM__default from 'react-dom';
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { AnimatePresence, motion } from 'framer-motion';
|
|
5
|
-
import { useRefocusOnActivator, useFocusTrap
|
|
5
|
+
import { useRefocusOnActivator, useFocusTrap } from '@jobber/hooks';
|
|
6
6
|
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';
|
|
@@ -40,8 +40,7 @@ function ModalLegacy({ open = false, title, size, dismissible = true, children,
|
|
|
40
40
|
const containerClassName = classnames(styles$1.container, size === "fullScreen" && styles$1.containerFullScreen);
|
|
41
41
|
useRefocusOnActivator(open);
|
|
42
42
|
const modalRef = useFocusTrap(open);
|
|
43
|
-
|
|
44
|
-
const template = (React__default.createElement(AnimatePresence, null, open && (React__default.createElement("div", { ref: modalRef, role: "dialog", className: containerClassName, tabIndex: 0, "aria-modal": "true", "aria-labelledby": title ? MODAL_HEADER_ID : undefined, "aria-label": ariaLabel },
|
|
43
|
+
const template = (React__default.createElement(AnimatePresence, null, open && (React__default.createElement("div", { ref: modalRef, role: "dialog", className: containerClassName, tabIndex: 0, "aria-modal": "true", "aria-labelledby": title ? MODAL_HEADER_ID : undefined, "aria-label": ariaLabel, onKeyDown: handleKeyDown },
|
|
45
44
|
React__default.createElement(motion.div, { key: styles$1.overlay, className: styles$1.overlay, onClick: onRequestClose, initial: { opacity: 0 }, animate: { opacity: 0.8 }, exit: { opacity: 0 }, transition: { duration: 0.2 } }),
|
|
46
45
|
React__default.createElement(motion.div, { key: styles$1.modal, className: modalClassName, initial: { scale: 0.9, opacity: 0 }, animate: { scale: 1, opacity: 1 }, exit: { scale: 0.9, opacity: 0 }, transition: {
|
|
47
46
|
duration: 0.2,
|
|
@@ -58,6 +57,17 @@ function ModalLegacy({ open = false, title, size, dismissible = true, children,
|
|
|
58
57
|
onRequestClose();
|
|
59
58
|
}
|
|
60
59
|
}
|
|
60
|
+
function handleKeyDown(event) {
|
|
61
|
+
if (event.key === "Escape") {
|
|
62
|
+
// Stop the Escape from bubbling to outer overlays (e.g. a Base UI Dialog
|
|
63
|
+
// this Modal is nested within, whose dismissal listens at the document
|
|
64
|
+
// level). Without this, one Escape closes both layers; instead only the
|
|
65
|
+
// top-most layer — this Modal — should close. Mirrors SideDrawer's
|
|
66
|
+
// Escape containment.
|
|
67
|
+
event.stopPropagation();
|
|
68
|
+
handleRequestClose();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
61
71
|
}
|
|
62
72
|
function Header({ title, dismissible, onRequestClose }) {
|
|
63
73
|
return (React__default.createElement("div", { className: styles$1.header, "data-testid": "modal-header" },
|