@dreamtree-org/twreact-ui 2.0.3 → 2.0.5
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/README.md +17 -6
- package/ai-skills/dreamtree-ui.md +12 -5
- package/dist/ai-schema.json +150 -1
- package/dist/charts/index.d.ts +2 -1
- package/dist/charts/index.js +297 -12
- package/dist/components/charts/ChartFrame.d.ts +1 -0
- package/dist/components/charts/ChartFrame.d.ts.map +1 -1
- package/dist/components/charts/ScatterChart.d.ts +4 -0
- package/dist/components/charts/ScatterChart.d.ts.map +1 -0
- package/dist/components/charts/ScatterTooltip.d.ts +14 -0
- package/dist/components/charts/ScatterTooltip.d.ts.map +1 -0
- package/dist/components/charts/scatterData.d.ts +17 -0
- package/dist/components/charts/scatterData.d.ts.map +1 -0
- package/dist/components/core/DatePicker.d.ts.map +1 -1
- package/dist/components/core/DateRangePicker.d.ts.map +1 -1
- package/dist/components/core/Select.d.ts.map +1 -1
- package/dist/components/navigation/Navbar.d.ts.map +1 -1
- package/dist/components/navigation/Sidebar.d.ts +2 -0
- package/dist/components/navigation/Sidebar.d.ts.map +1 -1
- package/dist/components/utility/Sortable.d.ts.map +1 -1
- package/dist/components/utility/SortableGroup.d.ts +15 -0
- package/dist/components/utility/SortableGroup.d.ts.map +1 -0
- package/dist/esm/charts/index.js +1 -0
- package/dist/esm/components/charts/ChartFrame.js +5 -5
- package/dist/esm/components/charts/ScatterChart.js +204 -0
- package/dist/esm/components/charts/ScatterTooltip.js +61 -0
- package/dist/esm/components/charts/scatterData.js +43 -0
- package/dist/esm/components/core/DatePicker.js +4 -1
- package/dist/esm/components/core/DateRangePicker.js +6 -2
- package/dist/esm/components/core/Select.js +6 -2
- package/dist/esm/components/navigation/Navbar.js +23 -6
- package/dist/esm/components/navigation/Sidebar.js +9 -2
- package/dist/esm/components/utility/Sortable.js +70 -48
- package/dist/esm/components/utility/SortableGroup.js +48 -0
- package/dist/esm/hooks/useFocusTrap.js +21 -9
- package/dist/esm/hooks/useSortable.js +96 -30
- package/dist/esm/hooks/useSortableGroup.js +268 -0
- package/dist/esm/index.js +1 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useSortable.d.ts +12 -3
- package/dist/hooks/useSortable.d.ts.map +1 -1
- package/dist/hooks/useSortableGroup.d.ts +43 -0
- package/dist/hooks/useSortableGroup.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +936 -498
- package/dist/index.js +936 -497
- package/dist/types/charts.d.ts +28 -0
- package/dist/types/charts.d.ts.map +1 -1
- package/dist/types/index.d.ts +40 -1
- package/dist/types/index.d.ts.map +1 -1
- package/doc/README.md +2 -0
- package/mcp/catalog.snapshot.json +252 -14
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3359,9 +3359,9 @@ var TOUCH_TARGET = "[@media(pointer:coarse)]:min-h-11 [@media(pointer:coarse)]:m
|
|
|
3359
3359
|
// off under prefers-reduced-motion. Add to pressables (buttons, tiles, tab items).
|
|
3360
3360
|
var PRESS_FEEDBACK = "active:scale-[0.97] motion-reduce:active:scale-100 transition-transform duration-fast";
|
|
3361
3361
|
|
|
3362
|
-
var _excluded
|
|
3363
|
-
function ownKeys$
|
|
3364
|
-
function _objectSpread$
|
|
3362
|
+
var _excluded$10 = ["id", "className", "type", "label", "placeholder", "error", "success", "helperText", "disabled", "required", "clearable", "leftIcon", "rightIcon", "onClear", "showCount", "maxLength", "readOnly", "onChange", "value", "defaultValue", "size", "floatingLabel", "otp"];
|
|
3363
|
+
function ownKeys$1c(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3364
|
+
function _objectSpread$1c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1c(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3365
3365
|
// Field heights. `md` keeps its 40px desktop look and grows to the 44px touch
|
|
3366
3366
|
// target on coarse pointers (same rule as Select); `lg` is 44px everywhere.
|
|
3367
3367
|
var SIZE_CLASSES$4 = {
|
|
@@ -3435,7 +3435,7 @@ var Input = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
3435
3435
|
floatingLabel = _props$floatingLabel === void 0 ? false : _props$floatingLabel,
|
|
3436
3436
|
_props$otp = props.otp,
|
|
3437
3437
|
otp = _props$otp === void 0 ? false : _props$otp,
|
|
3438
|
-
rest = _objectWithoutProperties$1(props, _excluded
|
|
3438
|
+
rest = _objectWithoutProperties$1(props, _excluded$10);
|
|
3439
3439
|
// `size` is the field size (sm|md|lg). A numeric value is the native
|
|
3440
3440
|
// `<input size>` attribute and is passed through unchanged.
|
|
3441
3441
|
var size = SIZE_CLASSES$4[sizeProp] ? sizeProp : "md";
|
|
@@ -3523,7 +3523,7 @@ var Input = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
3523
3523
|
className: "text-primary-400",
|
|
3524
3524
|
children: leftIcon
|
|
3525
3525
|
})
|
|
3526
|
-
}), jsx("input", _objectSpread$
|
|
3526
|
+
}), jsx("input", _objectSpread$1c(_objectSpread$1c({
|
|
3527
3527
|
id: inputId,
|
|
3528
3528
|
ref: setRefs,
|
|
3529
3529
|
type: inputType,
|
|
@@ -3595,9 +3595,9 @@ var Input = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
3595
3595
|
});
|
|
3596
3596
|
Input.displayName = "Input";
|
|
3597
3597
|
|
|
3598
|
-
var _excluded
|
|
3599
|
-
function ownKeys$
|
|
3600
|
-
function _objectSpread$
|
|
3598
|
+
var _excluded$$ = ["className", "variant", "size", "disabled", "loading", "children", "leftIcon", "rightIcon", "fullWidth", "as", "onClick"];
|
|
3599
|
+
function ownKeys$1b(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3600
|
+
function _objectSpread$1b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1b(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3601
3601
|
// Square, icon-only sizes. Pair with an `aria-label` (there is no visible text).
|
|
3602
3602
|
var ICON_SIZES = {
|
|
3603
3603
|
'icon-sm': 'h-8 w-8 p-0',
|
|
@@ -3618,7 +3618,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3618
3618
|
fullWidth = _ref.fullWidth,
|
|
3619
3619
|
as = _ref.as,
|
|
3620
3620
|
onClick = _ref.onClick,
|
|
3621
|
-
props = _objectWithoutProperties$1(_ref, _excluded
|
|
3621
|
+
props = _objectWithoutProperties$1(_ref, _excluded$$);
|
|
3622
3622
|
// `as` renders any element or component (an <a>, a router Link) with the
|
|
3623
3623
|
// Button's look; a bare `href` implies an <a>.
|
|
3624
3624
|
var Component = as || (props.href !== undefined ? 'a' : 'button');
|
|
@@ -3654,7 +3654,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3654
3654
|
children: rightIcon
|
|
3655
3655
|
})]
|
|
3656
3656
|
});
|
|
3657
|
-
return jsx(Component, _objectSpread$
|
|
3657
|
+
return jsx(Component, _objectSpread$1b(_objectSpread$1b(_objectSpread$1b({
|
|
3658
3658
|
ref: ref,
|
|
3659
3659
|
className: baseClasses
|
|
3660
3660
|
}, isNativeButton ? {
|
|
@@ -3789,7 +3789,7 @@ function setRefs$1(node) {
|
|
|
3789
3789
|
}
|
|
3790
3790
|
|
|
3791
3791
|
// useLayoutEffect warns during SSR; fall back to useEffect on the server.
|
|
3792
|
-
var useIsomorphicLayoutEffect$
|
|
3792
|
+
var useIsomorphicLayoutEffect$9 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
3793
3793
|
/**
|
|
3794
3794
|
* Internal (not exported from the package): a ref that always holds the latest
|
|
3795
3795
|
* `value`. Lets an effect call the newest consumer callback (e.g. `onChange`)
|
|
@@ -3798,7 +3798,7 @@ var useIsomorphicLayoutEffect$8 = typeof window !== "undefined" ? useLayoutEffec
|
|
|
3798
3798
|
*/
|
|
3799
3799
|
function useLatestRef$1(value) {
|
|
3800
3800
|
var ref = useRef(value);
|
|
3801
|
-
useIsomorphicLayoutEffect$
|
|
3801
|
+
useIsomorphicLayoutEffect$9(function () {
|
|
3802
3802
|
ref.current = value;
|
|
3803
3803
|
});
|
|
3804
3804
|
return ref;
|
|
@@ -5976,9 +5976,29 @@ function Portal(_ref) {
|
|
|
5976
5976
|
// Internal (not exported from the package). Shared focus management for the
|
|
5977
5977
|
// overlay primitives (Drawer, Dialog, Popover, Tour, Sidebar, AppShell).
|
|
5978
5978
|
var FOCUSABLE_SELECTOR = ["a[href]", "button:not([disabled])", "textarea:not([disabled])", "input:not([disabled])", "select:not([disabled])", '[tabindex]:not([tabindex="-1"])'].join(",");
|
|
5979
|
+
// A responsive drawer (Sidebar's `md:hidden`, AppShell's `lg:hidden`) can be
|
|
5980
|
+
// "open" while CSS hides it on wide viewports; there is nothing to trap then.
|
|
5981
|
+
// `stopAt` (exclusive) bounds the walk, so getFocusable checks only the
|
|
5982
|
+
// elements between a candidate and its root.
|
|
5983
|
+
var isDisplayNone = function isDisplayNone(el) {
|
|
5984
|
+
var stopAt = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
5985
|
+
for (var node = el; node && node.nodeType === 1 && node !== stopAt; node = node.parentElement) {
|
|
5986
|
+
if (window.getComputedStyle(node).display === "none") return true;
|
|
5987
|
+
}
|
|
5988
|
+
return false;
|
|
5989
|
+
};
|
|
5990
|
+
// `.focus()` silently fails on an element that is not rendered (`display:none`
|
|
5991
|
+
// on it or an ancestor) or is `visibility:hidden` (inherited, so the element's
|
|
5992
|
+
// own computed value covers its ancestors). getClientRects() is not used:
|
|
5993
|
+
// jsdom reports empty rects for every element.
|
|
5994
|
+
var isRendered = function isRendered(el, root) {
|
|
5995
|
+
return window.getComputedStyle(el).visibility !== "hidden" && !isDisplayNone(el, root);
|
|
5996
|
+
};
|
|
5997
|
+
// Tabbable, rendered descendants of `root`, in DOM order. Used for the initial
|
|
5998
|
+
// focus and for the Tab trap's first/last items.
|
|
5979
5999
|
var getFocusable = function getFocusable(root) {
|
|
5980
6000
|
return root ? Array.from(root.querySelectorAll(FOCUSABLE_SELECTOR)).filter(function (el) {
|
|
5981
|
-
return el.getAttribute("aria-hidden") !== "true";
|
|
6001
|
+
return el.getAttribute("aria-hidden") !== "true" && isRendered(el, root);
|
|
5982
6002
|
}) : [];
|
|
5983
6003
|
};
|
|
5984
6004
|
// Only the most recently opened overlay reacts to Escape / Tab, so a Popover
|
|
@@ -5987,14 +6007,6 @@ var layerStack = [];
|
|
|
5987
6007
|
var isTopLayer = function isTopLayer(token) {
|
|
5988
6008
|
return layerStack[layerStack.length - 1] === token;
|
|
5989
6009
|
};
|
|
5990
|
-
// A responsive drawer (Sidebar's `md:hidden`, AppShell's `lg:hidden`) can be
|
|
5991
|
-
// "open" while CSS hides it on wide viewports; there is nothing to trap then.
|
|
5992
|
-
var isDisplayNone = function isDisplayNone(el) {
|
|
5993
|
-
for (var node = el; node && node.nodeType === 1; node = node.parentElement) {
|
|
5994
|
-
if (window.getComputedStyle(node).display === "none") return true;
|
|
5995
|
-
}
|
|
5996
|
-
return false;
|
|
5997
|
-
};
|
|
5998
6010
|
function cycleFocus(e, panel) {
|
|
5999
6011
|
if (isDisplayNone(panel)) return;
|
|
6000
6012
|
var focusables = getFocusable(panel);
|
|
@@ -6202,8 +6214,8 @@ function usePresence(open) {
|
|
|
6202
6214
|
};
|
|
6203
6215
|
}
|
|
6204
6216
|
|
|
6205
|
-
function ownKeys$
|
|
6206
|
-
function _objectSpread$
|
|
6217
|
+
function ownKeys$1a(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6218
|
+
function _objectSpread$1a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1a(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6207
6219
|
// Internal (not exported). The gesture core behind Sheet: a pointer drag along
|
|
6208
6220
|
// one axis, measured "toward dismiss" for the edge the sheet is attached to.
|
|
6209
6221
|
//
|
|
@@ -6405,12 +6417,12 @@ function useSheetDrag() {
|
|
|
6405
6417
|
return {
|
|
6406
6418
|
delta: delta,
|
|
6407
6419
|
dragging: dragging,
|
|
6408
|
-
dragProps: _objectSpread$
|
|
6420
|
+
dragProps: _objectSpread$1a(_objectSpread$1a({}, common), {}, {
|
|
6409
6421
|
onPointerDown: function onPointerDown(e) {
|
|
6410
6422
|
return start(e, false);
|
|
6411
6423
|
}
|
|
6412
6424
|
}),
|
|
6413
|
-
bodyDragProps: _objectSpread$
|
|
6425
|
+
bodyDragProps: _objectSpread$1a(_objectSpread$1a({}, common), {}, {
|
|
6414
6426
|
onPointerDown: function onPointerDown(e) {
|
|
6415
6427
|
return start(e, true);
|
|
6416
6428
|
}
|
|
@@ -6418,9 +6430,9 @@ function useSheetDrag() {
|
|
|
6418
6430
|
};
|
|
6419
6431
|
}
|
|
6420
6432
|
|
|
6421
|
-
var _excluded$
|
|
6422
|
-
function ownKeys$
|
|
6423
|
-
function _objectSpread$
|
|
6433
|
+
var _excluded$_ = ["open", "onClose", "placement", "snapPoints", "activeSnap", "defaultSnap", "onSnapChange", "dismissible", "dragEnabled", "handle", "scaleBackground", "initialFocus", "hasTitle", "hasDescription", "idPrefix", "testIdPrefix", "panelClassName", "handleBarClassName", "renderHeader", "children", "className", "style"];
|
|
6434
|
+
function ownKeys$19(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6435
|
+
function _objectSpread$19(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$19(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$19(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6424
6436
|
// Internal (not exported from the package). The shared sheet core behind
|
|
6425
6437
|
// `Sheet` and `Drawer` (ADR 0001 §1): portal, backdrop, presence (enter/exit
|
|
6426
6438
|
// motion), drag to dismiss + snap points, focus trap, scroll lock,
|
|
@@ -6596,7 +6608,7 @@ var SheetCore = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
6596
6608
|
children = _ref.children,
|
|
6597
6609
|
className = _ref.className,
|
|
6598
6610
|
style = _ref.style,
|
|
6599
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
6611
|
+
props = _objectWithoutProperties$1(_ref, _excluded$_);
|
|
6600
6612
|
var shown = Boolean(open);
|
|
6601
6613
|
var side = SHEET_PLACEMENTS.includes(placement) ? placement : "bottom";
|
|
6602
6614
|
var vertical = side === "bottom" || side === "top";
|
|
@@ -6784,7 +6796,7 @@ var SheetCore = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
6784
6796
|
if (!reducedMotion) {
|
|
6785
6797
|
if (side === "bottom" && presence.state === "entering") motionClass = "animate-sheet-in motion-reduce:animate-none";else if (exiting && useKeyframes) motionClass = "animate-sheet-out motion-reduce:animate-none";else if (exiting || side !== "bottom" && !entered) motionClass = OFFSCREEN[side];
|
|
6786
6798
|
}
|
|
6787
|
-
var panelStyle = _objectSpread$
|
|
6799
|
+
var panelStyle = _objectSpread$19({}, style);
|
|
6788
6800
|
if (height !== undefined) panelStyle.height = "".concat(height, "px");
|
|
6789
6801
|
var transform = translateFor(side, translate);
|
|
6790
6802
|
if (transform) panelStyle.transform = transform;
|
|
@@ -6823,7 +6835,7 @@ var SheetCore = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
6823
6835
|
"aria-hidden": "true",
|
|
6824
6836
|
className: cn("h-1.5 w-10 rounded-pill", handleBarClassName)
|
|
6825
6837
|
});
|
|
6826
|
-
var handleNode = showHandle ? snaps ? jsx("button", _objectSpread$
|
|
6838
|
+
var handleNode = showHandle ? snaps ? jsx("button", _objectSpread$19(_objectSpread$19({
|
|
6827
6839
|
type: "button",
|
|
6828
6840
|
"aria-label": "Resize sheet",
|
|
6829
6841
|
"aria-keyshortcuts": "ArrowUp ArrowDown",
|
|
@@ -6833,7 +6845,7 @@ var SheetCore = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
6833
6845
|
}, drag.dragProps), {}, {
|
|
6834
6846
|
className: cn("flex w-full shrink-0 justify-center pb-1 pt-3 focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary-500", side === "top" && "pb-3 pt-1", grabClass),
|
|
6835
6847
|
children: handleBar
|
|
6836
|
-
})) : jsx("div", _objectSpread$
|
|
6848
|
+
})) : jsx("div", _objectSpread$19(_objectSpread$19({
|
|
6837
6849
|
"aria-hidden": "true",
|
|
6838
6850
|
"data-sheet-handle": "",
|
|
6839
6851
|
"data-testid": "".concat(testIdPrefix, "-handle")
|
|
@@ -6853,7 +6865,7 @@ var SheetCore = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
6853
6865
|
onClick: function onClick() {
|
|
6854
6866
|
return dismissible && requestClose("backdrop");
|
|
6855
6867
|
}
|
|
6856
|
-
}), jsxs("div", _objectSpread$
|
|
6868
|
+
}), jsxs("div", _objectSpread$19(_objectSpread$19({
|
|
6857
6869
|
ref: panelCallbackRef,
|
|
6858
6870
|
role: "dialog",
|
|
6859
6871
|
"aria-modal": "true",
|
|
@@ -6897,12 +6909,12 @@ var SheetCloseButton = function SheetCloseButton(_ref5) {
|
|
|
6897
6909
|
});
|
|
6898
6910
|
};
|
|
6899
6911
|
|
|
6900
|
-
var _excluded$
|
|
6912
|
+
var _excluded$Z = ["open", "isOpen", "placement", "title", "description", "showCloseButton", "haptics", "onSnapChange"],
|
|
6901
6913
|
_excluded2$9 = ["className"],
|
|
6902
|
-
_excluded3$
|
|
6914
|
+
_excluded3$5 = ["className"],
|
|
6903
6915
|
_excluded4$3 = ["className"];
|
|
6904
|
-
function ownKeys$
|
|
6905
|
-
function _objectSpread$
|
|
6916
|
+
function ownKeys$18(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6917
|
+
function _objectSpread$18(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$18(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$18(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6906
6918
|
// Phone-native sheet (ADR 0001). Bottom by default; snap points, drag to
|
|
6907
6919
|
// dismiss, keyboard-aware via visualViewport. The behaviour lives in the
|
|
6908
6920
|
// internal sheet core (./sheetCore.jsx), shared with Drawer (DTUI-33).
|
|
@@ -6924,7 +6936,7 @@ var Sheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
6924
6936
|
_ref$haptics = _ref.haptics,
|
|
6925
6937
|
haptics = _ref$haptics === void 0 ? false : _ref$haptics,
|
|
6926
6938
|
onSnapChange = _ref.onSnapChange,
|
|
6927
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
6939
|
+
props = _objectWithoutProperties$1(_ref, _excluded$Z);
|
|
6928
6940
|
// Opt-in: a selection tick when a drag or arrow key settles on a new snap point.
|
|
6929
6941
|
var _useHaptics = useHaptics({
|
|
6930
6942
|
enabled: haptics
|
|
@@ -6962,7 +6974,7 @@ var Sheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
6962
6974
|
})]
|
|
6963
6975
|
}) : null;
|
|
6964
6976
|
};
|
|
6965
|
-
return jsx(SheetCore, _objectSpread$
|
|
6977
|
+
return jsx(SheetCore, _objectSpread$18({
|
|
6966
6978
|
ref: ref,
|
|
6967
6979
|
open: Boolean(open !== null && open !== void 0 ? open : isOpen),
|
|
6968
6980
|
placement: side,
|
|
@@ -6979,7 +6991,7 @@ var SheetHeader = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
6979
6991
|
props = _objectWithoutProperties$1(_ref3, _excluded2$9);
|
|
6980
6992
|
var ctx = useContext(SheetContext);
|
|
6981
6993
|
var dragProps = ctx ? mergeHandlers(ctx.headerDragProps, props) : {};
|
|
6982
|
-
return jsx("div", _objectSpread$
|
|
6994
|
+
return jsx("div", _objectSpread$18(_objectSpread$18(_objectSpread$18({
|
|
6983
6995
|
ref: ref
|
|
6984
6996
|
}, props), dragProps), {}, {
|
|
6985
6997
|
className: cn("shrink-0 border-b border-line px-4 py-3", ctx === null || ctx === void 0 ? void 0 : ctx.grabClass, className)
|
|
@@ -6987,10 +6999,10 @@ var SheetHeader = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
6987
6999
|
});
|
|
6988
7000
|
var SheetBody = /*#__PURE__*/React__default.forwardRef(function (_ref4, _ref5) {
|
|
6989
7001
|
var className = _ref4.className,
|
|
6990
|
-
props = _objectWithoutProperties$1(_ref4, _excluded3$
|
|
7002
|
+
props = _objectWithoutProperties$1(_ref4, _excluded3$5);
|
|
6991
7003
|
var ctx = useContext(SheetContext);
|
|
6992
7004
|
var dragProps = ctx ? mergeHandlers(ctx.bodyDragProps, props) : {};
|
|
6993
|
-
return jsx("div", _objectSpread$
|
|
7005
|
+
return jsx("div", _objectSpread$18(_objectSpread$18(_objectSpread$18({
|
|
6994
7006
|
ref: function ref(node) {
|
|
6995
7007
|
return setRefs$1(node, _ref5, ctx === null || ctx === void 0 ? void 0 : ctx.setBodyEl);
|
|
6996
7008
|
},
|
|
@@ -7002,7 +7014,7 @@ var SheetBody = /*#__PURE__*/React__default.forwardRef(function (_ref4, _ref5) {
|
|
|
7002
7014
|
var SheetFooter = /*#__PURE__*/React__default.forwardRef(function (_ref6, ref) {
|
|
7003
7015
|
var className = _ref6.className,
|
|
7004
7016
|
props = _objectWithoutProperties$1(_ref6, _excluded4$3);
|
|
7005
|
-
return jsx("div", _objectSpread$
|
|
7017
|
+
return jsx("div", _objectSpread$18({
|
|
7006
7018
|
ref: ref,
|
|
7007
7019
|
className: cn("sticky bottom-0 flex shrink-0 items-center justify-end gap-3 border-t border-line bg-surface px-4 py-3", className)
|
|
7008
7020
|
}, props));
|
|
@@ -7014,9 +7026,9 @@ Sheet.Header = SheetHeader;
|
|
|
7014
7026
|
Sheet.Body = SheetBody;
|
|
7015
7027
|
Sheet.Footer = SheetFooter;
|
|
7016
7028
|
|
|
7017
|
-
var _excluded$
|
|
7018
|
-
function ownKeys$
|
|
7019
|
-
function _objectSpread$
|
|
7029
|
+
var _excluded$Y = ["options", "value", "onChange", "placeholder", "label", "error", "helperText", "disabled", "required", "multiSelect", "searchable", "grouped", "onMenuItemRender", "className", "allowClear", "creatable", "onCreateOption", "onSearch", "loading", "selectAllOption", "closeOnSelect", "maxTagCount", "renderGroupLabel", "name", "size", "presentation"];
|
|
7030
|
+
function ownKeys$17(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7031
|
+
function _objectSpread$17(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$17(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$17(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7020
7032
|
/**
|
|
7021
7033
|
* Enhanced Select component (debounce removed)
|
|
7022
7034
|
* - Supports single and multi select
|
|
@@ -7072,7 +7084,7 @@ var normalizeGroups = function normalizeGroups(options) {
|
|
|
7072
7084
|
if (Array.isArray(item.options)) {
|
|
7073
7085
|
var valid = item.options.filter(isPlainObject$4);
|
|
7074
7086
|
if (valid.length !== item.options.length) malformed = true;
|
|
7075
|
-
groups.push(_objectSpread$
|
|
7087
|
+
groups.push(_objectSpread$17(_objectSpread$17({}, item), {}, {
|
|
7076
7088
|
options: valid
|
|
7077
7089
|
}));
|
|
7078
7090
|
return;
|
|
@@ -7095,7 +7107,7 @@ var flattenGroups = function flattenGroups() {
|
|
|
7095
7107
|
return groups.reduce(function (acc, g) {
|
|
7096
7108
|
var groupLabel = g.label;
|
|
7097
7109
|
g.options.forEach(function (opt) {
|
|
7098
|
-
return acc.push(_objectSpread$
|
|
7110
|
+
return acc.push(_objectSpread$17(_objectSpread$17({}, opt), {}, {
|
|
7099
7111
|
_group: groupLabel
|
|
7100
7112
|
}));
|
|
7101
7113
|
});
|
|
@@ -7170,7 +7182,7 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
7170
7182
|
size = _ref$size === void 0 ? "md" : _ref$size,
|
|
7171
7183
|
_ref$presentation = _ref.presentation,
|
|
7172
7184
|
presentation = _ref$presentation === void 0 ? "auto" : _ref$presentation,
|
|
7173
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
7185
|
+
props = _objectWithoutProperties$1(_ref, _excluded$Y);
|
|
7174
7186
|
var _useState = useState(false),
|
|
7175
7187
|
_useState2 = _slicedToArray(_useState, 2),
|
|
7176
7188
|
isOpen = _useState2[0],
|
|
@@ -7251,7 +7263,7 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
7251
7263
|
var flatOptions = useMemo(function () {
|
|
7252
7264
|
if (grouped) return flattenGroups(groupedOptions);
|
|
7253
7265
|
return (Array.isArray(options) ? options : []).filter(isPlainObject$4).map(function (opt) {
|
|
7254
|
-
return _objectSpread$
|
|
7266
|
+
return _objectSpread$17({}, opt);
|
|
7255
7267
|
});
|
|
7256
7268
|
}, [options, grouped, groupedOptions]);
|
|
7257
7269
|
var selectedValues = useMemo(function () {
|
|
@@ -7285,7 +7297,7 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
7285
7297
|
};
|
|
7286
7298
|
if (grouped) {
|
|
7287
7299
|
return groupedOptions.map(function (g) {
|
|
7288
|
-
return _objectSpread$
|
|
7300
|
+
return _objectSpread$17(_objectSpread$17({}, g), {}, {
|
|
7289
7301
|
options: g.options.filter(matches)
|
|
7290
7302
|
});
|
|
7291
7303
|
}).filter(function (g) {
|
|
@@ -7497,7 +7509,8 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
7497
7509
|
return document.removeEventListener("mousedown", handleClickOutside);
|
|
7498
7510
|
};
|
|
7499
7511
|
}, []);
|
|
7500
|
-
var
|
|
7512
|
+
var isEmpty = selectedOptions.length === 0;
|
|
7513
|
+
var showClearButton = allowClear && !disabled && !isEmpty;
|
|
7501
7514
|
var displayValue = function displayValue() {
|
|
7502
7515
|
var _selectedOptions$;
|
|
7503
7516
|
if (multiSelect) {
|
|
@@ -7576,7 +7589,7 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
7576
7589
|
className: "text-xs border border-slate-200 p-0.5 rounded-md cursor-pointer hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-primary-500",
|
|
7577
7590
|
onClick: function onClick() {
|
|
7578
7591
|
return setCollapsedGroups(function (prev) {
|
|
7579
|
-
return _objectSpread$
|
|
7592
|
+
return _objectSpread$17(_objectSpread$17({}, prev), {}, _defineProperty$4({}, group.label, !prev[group.label]));
|
|
7580
7593
|
});
|
|
7581
7594
|
},
|
|
7582
7595
|
children: jsx(ChevronDown, {
|
|
@@ -7743,7 +7756,7 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
7743
7756
|
}), jsxs("div", {
|
|
7744
7757
|
ref: wrapperRef,
|
|
7745
7758
|
className: "relative",
|
|
7746
|
-
children: [jsxs("button", _objectSpread$
|
|
7759
|
+
children: [jsxs("button", _objectSpread$17(_objectSpread$17({
|
|
7747
7760
|
ref: triggerRef,
|
|
7748
7761
|
type: "button",
|
|
7749
7762
|
id: baseId,
|
|
@@ -7755,9 +7768,12 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
7755
7768
|
"aria-invalid": error ? true : undefined,
|
|
7756
7769
|
className: cn("flex w-full items-center justify-between rounded-md border border-gray-300 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50", SIZE_CLASSES$3[size] || SIZE_CLASSES$3.md, {
|
|
7757
7770
|
"border-error-500 focus:ring-error-500": error,
|
|
7758
|
-
|
|
7771
|
+
// Empty: the placeholder reads muted, like Input's
|
|
7772
|
+
// ::placeholder (#159). `className` still merges last.
|
|
7773
|
+
"text-muted": isEmpty,
|
|
7759
7774
|
"pr-14": showClearButton
|
|
7760
7775
|
}, className),
|
|
7776
|
+
"data-empty": isEmpty ? "" : undefined,
|
|
7761
7777
|
onClick: function onClick() {
|
|
7762
7778
|
if (!disabled) {
|
|
7763
7779
|
setIsOpen(function (prev) {
|
|
@@ -7817,7 +7833,7 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
7817
7833
|
// by useFloatingPosition (flip / shift; width matches the
|
|
7818
7834
|
// trigger; max-height follows the room left). Transparent
|
|
7819
7835
|
// until the first position so it never flashes at (0,0).
|
|
7820
|
-
style: _objectSpread$
|
|
7836
|
+
style: _objectSpread$17(_objectSpread$17({}, floatingStyles), isPositioned ? {} : {
|
|
7821
7837
|
opacity: 0
|
|
7822
7838
|
}),
|
|
7823
7839
|
children: [searchable && jsx("div", {
|
|
@@ -8285,8 +8301,8 @@ var DEFAULT_ACTIONS = [{
|
|
|
8285
8301
|
})
|
|
8286
8302
|
}];
|
|
8287
8303
|
|
|
8288
|
-
function ownKeys$
|
|
8289
|
-
function _objectSpread$
|
|
8304
|
+
function ownKeys$16(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8305
|
+
function _objectSpread$16(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$16(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$16(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8290
8306
|
function _createForOfIteratorHelper$1(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: true } : { done: false, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = true, u = false; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = true, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
8291
8307
|
function _unsupportedIterableToArray$1(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$1(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; } }
|
|
8292
8308
|
function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -8365,7 +8381,7 @@ var mergeDefaultActions = function mergeDefaultActions(overrides, defaults) {
|
|
|
8365
8381
|
_iterator.f();
|
|
8366
8382
|
}
|
|
8367
8383
|
var merged = defaults.map(function (d) {
|
|
8368
|
-
return d !== null && d !== void 0 && d.name && byName.has(d.name) ? _objectSpread$
|
|
8384
|
+
return d !== null && d !== void 0 && d.name && byName.has(d.name) ? _objectSpread$16(_objectSpread$16({}, d), byName.get(d.name)) : d;
|
|
8369
8385
|
});
|
|
8370
8386
|
var defaultNames = new Set(defaults.map(function (d) {
|
|
8371
8387
|
return d === null || d === void 0 ? void 0 : d.name;
|
|
@@ -8407,7 +8423,7 @@ var resolveActions = function resolveActions(actions, row, index) {
|
|
|
8407
8423
|
var action = _step2.value;
|
|
8408
8424
|
if (!action || _typeof$4(action) !== "object") continue;
|
|
8409
8425
|
if (callIfFn(action.hidden, row, index)) continue;
|
|
8410
|
-
var resolved = _objectSpread$
|
|
8426
|
+
var resolved = _objectSpread$16(_objectSpread$16({}, action), {}, {
|
|
8411
8427
|
label: callIfFn(action.label, row, index),
|
|
8412
8428
|
icon: callIfFn(action.icon, row, index),
|
|
8413
8429
|
disabled: !!callIfFn(action.disabled, row, index),
|
|
@@ -8695,8 +8711,8 @@ function ColumnMenu(_ref) {
|
|
|
8695
8711
|
});
|
|
8696
8712
|
}
|
|
8697
8713
|
|
|
8698
|
-
function ownKeys$
|
|
8699
|
-
function _objectSpread$
|
|
8714
|
+
function ownKeys$15(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8715
|
+
function _objectSpread$15(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$15(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$15(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8700
8716
|
var FIELD_CLASSES = "w-full rounded-md border border-line bg-surface px-3 py-2 text-base sm:text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-primary-500";
|
|
8701
8717
|
var FOOTER_BUTTON = "inline-flex min-h-11 flex-1 items-center justify-center rounded-lg px-4 text-sm font-medium outline-none focus-visible:ring-2 focus-visible:ring-primary-500 transition-colors duration-fast motion-reduce:transition-none";
|
|
8702
8718
|
/** Number of non-empty filters (the global search counts as one). */
|
|
@@ -8758,7 +8774,7 @@ function FilterSheet(_ref) {
|
|
|
8758
8774
|
};
|
|
8759
8775
|
var setField = function setField(key, value) {
|
|
8760
8776
|
return setDraft(function (prev) {
|
|
8761
|
-
return _objectSpread$
|
|
8777
|
+
return _objectSpread$15(_objectSpread$15({}, prev), {}, _defineProperty$4({}, key, value));
|
|
8762
8778
|
});
|
|
8763
8779
|
};
|
|
8764
8780
|
var formId = "".concat(idPrefix, "-filters");
|
|
@@ -9046,8 +9062,8 @@ function normalizeAction(action, idx) {
|
|
|
9046
9062
|
};
|
|
9047
9063
|
}
|
|
9048
9064
|
|
|
9049
|
-
function ownKeys$
|
|
9050
|
-
function _objectSpread$
|
|
9065
|
+
function ownKeys$14(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9066
|
+
function _objectSpread$14(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$14(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$14(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9051
9067
|
// Internal (not exported). Desktop presentation of the action menu: a
|
|
9052
9068
|
// portaled, floating `role="menu"` anchored to its trigger (flip + shift via
|
|
9053
9069
|
// useFloatingPosition), with roving focus and Escape/outside-press dismissal.
|
|
@@ -9158,7 +9174,7 @@ function MenuPopover(_ref) {
|
|
|
9158
9174
|
tabIndex: -1,
|
|
9159
9175
|
"data-presentation": "popover",
|
|
9160
9176
|
className: cn(MENU_CLASSES, className),
|
|
9161
|
-
style: _objectSpread$
|
|
9177
|
+
style: _objectSpread$14(_objectSpread$14({}, floatingStyles), {}, {
|
|
9162
9178
|
opacity: isPositioned ? 1 : 0
|
|
9163
9179
|
}),
|
|
9164
9180
|
onKeyDown: function onKeyDown(e) {
|
|
@@ -9210,9 +9226,9 @@ function MenuPopover(_ref) {
|
|
|
9210
9226
|
});
|
|
9211
9227
|
}
|
|
9212
9228
|
|
|
9213
|
-
var _excluded$
|
|
9214
|
-
function ownKeys$
|
|
9215
|
-
function _objectSpread$
|
|
9229
|
+
var _excluded$X = ["open", "onClose", "groups", "onSelectItem", "title", "message", "label", "cancelLabel", "emptyLabel", "itemClassName", "className"];
|
|
9230
|
+
function ownKeys$13(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9231
|
+
function _objectSpread$13(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$13(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$13(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9216
9232
|
// Internal. The one action-sheet implementation: an iOS-style action sheet in
|
|
9217
9233
|
// a bottom Sheet. Actions sit in rounded cards (one card per group),
|
|
9218
9234
|
// destructive actions use the error tone, and a separate Cancel button closes
|
|
@@ -9253,7 +9269,7 @@ var ActionSheetMenu = /*#__PURE__*/React__default.forwardRef(function ActionShee
|
|
|
9253
9269
|
emptyLabel = _ref$emptyLabel === void 0 ? "No actions" : _ref$emptyLabel,
|
|
9254
9270
|
itemClassName = _ref.itemClassName,
|
|
9255
9271
|
className = _ref.className,
|
|
9256
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
9272
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$X);
|
|
9257
9273
|
var nonEmpty = (groups || []).filter(function (g) {
|
|
9258
9274
|
return Array.isArray(g) && g.length > 0;
|
|
9259
9275
|
});
|
|
@@ -9275,7 +9291,7 @@ var ActionSheetMenu = /*#__PURE__*/React__default.forwardRef(function ActionShee
|
|
|
9275
9291
|
children: message
|
|
9276
9292
|
})]
|
|
9277
9293
|
}) : null;
|
|
9278
|
-
return jsx(Sheet, _objectSpread$
|
|
9294
|
+
return jsx(Sheet, _objectSpread$13(_objectSpread$13({
|
|
9279
9295
|
ref: ref,
|
|
9280
9296
|
open: open,
|
|
9281
9297
|
onClose: onClose,
|
|
@@ -9503,8 +9519,8 @@ function ActionMenu(_ref) {
|
|
|
9503
9519
|
});
|
|
9504
9520
|
}
|
|
9505
9521
|
|
|
9506
|
-
function ownKeys$
|
|
9507
|
-
function _objectSpread$
|
|
9522
|
+
function ownKeys$12(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9523
|
+
function _objectSpread$12(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$12(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$12(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9508
9524
|
/**
|
|
9509
9525
|
* Desktop table row component
|
|
9510
9526
|
*/
|
|
@@ -9591,7 +9607,7 @@ function TableRow(_ref) {
|
|
|
9591
9607
|
var isRowActive = interactive && (activeCell === null || activeCell === void 0 ? void 0 : activeCell.rowKey) === rowKey;
|
|
9592
9608
|
var effectiveRow = React__default.useMemo(function () {
|
|
9593
9609
|
if (!interactive || !pendingEdits || !pendingEdits[rowKey]) return row;
|
|
9594
|
-
return _objectSpread$
|
|
9610
|
+
return _objectSpread$12(_objectSpread$12({}, row), pendingEdits[rowKey]);
|
|
9595
9611
|
}, [interactive, pendingEdits, rowKey, row]);
|
|
9596
9612
|
return jsxs(React__default.Fragment, {
|
|
9597
9613
|
children: [jsxs("tr", {
|
|
@@ -9993,9 +10009,9 @@ function useSwipeGesture(_ref2) {
|
|
|
9993
10009
|
};
|
|
9994
10010
|
}
|
|
9995
10011
|
|
|
9996
|
-
var _excluded$
|
|
9997
|
-
function ownKeys
|
|
9998
|
-
function _objectSpread
|
|
10012
|
+
var _excluded$W = ["as", "children", "leadingActions", "trailingActions", "fullSwipe", "fullSwipeThreshold", "actionWidth", "open", "defaultOpen", "onOpenChange", "disabled", "moreActions", "moreActionsLabel", "menuPresentation", "contentClassName", "className", "onKeyDown"];
|
|
10013
|
+
function ownKeys$11(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10014
|
+
function _objectSpread$11(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$11(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$11(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9999
10015
|
// The iOS Mail / Gmail row: swipe horizontally to reveal actions, swipe all
|
|
10000
10016
|
// the way to commit the first one. Every action is also reachable without a
|
|
10001
10017
|
// gesture through the "More actions" button (a menu, or an action sheet on
|
|
@@ -10090,7 +10106,7 @@ var SwipeableListItem = /*#__PURE__*/React__default.forwardRef(function Swipeabl
|
|
|
10090
10106
|
contentClassName = _ref2.contentClassName,
|
|
10091
10107
|
className = _ref2.className,
|
|
10092
10108
|
onKeyDown = _ref2.onKeyDown,
|
|
10093
|
-
rest = _objectWithoutProperties$1(_ref2, _excluded$
|
|
10109
|
+
rest = _objectWithoutProperties$1(_ref2, _excluded$W);
|
|
10094
10110
|
var leading = useMemo(function () {
|
|
10095
10111
|
return Array.isArray(leadingActions) ? leadingActions : [];
|
|
10096
10112
|
}, [leadingActions]);
|
|
@@ -10193,7 +10209,7 @@ var SwipeableListItem = /*#__PURE__*/React__default.forwardRef(function Swipeabl
|
|
|
10193
10209
|
setOpenSide(null);
|
|
10194
10210
|
}
|
|
10195
10211
|
};
|
|
10196
|
-
return jsxs(Component, _objectSpread
|
|
10212
|
+
return jsxs(Component, _objectSpread$11(_objectSpread$11({
|
|
10197
10213
|
ref: function ref(node) {
|
|
10198
10214
|
return setRefs$1(node, rootRef, _ref4);
|
|
10199
10215
|
},
|
|
@@ -10218,7 +10234,7 @@ var SwipeableListItem = /*#__PURE__*/React__default.forwardRef(function Swipeabl
|
|
|
10218
10234
|
armed: armed === "trailing",
|
|
10219
10235
|
dragging: dragging,
|
|
10220
10236
|
onSelect: runAction
|
|
10221
|
-
}), jsx("div", _objectSpread
|
|
10237
|
+
}), jsx("div", _objectSpread$11(_objectSpread$11({
|
|
10222
10238
|
"data-swipe-content": "",
|
|
10223
10239
|
className: cn("relative bg-surface touch-pan-y", dragging ? "select-none" : cn("transition-transform", MOTION), contentClassName),
|
|
10224
10240
|
style: x ? {
|
|
@@ -10646,10 +10662,10 @@ function FieldInput(_ref) {
|
|
|
10646
10662
|
});
|
|
10647
10663
|
}
|
|
10648
10664
|
|
|
10649
|
-
var _excluded$
|
|
10665
|
+
var _excluded$V = ["data", "columns", "sortable", "filterable", "selectable", "pagination", "paginationPosition", "pageSize", "onSort", "onFilter", "onFetch", "onFilterChange", "onSelectionChange", "onRowClick", "hasDetails", "DetailsComponent", "className", "withAction", "onAction", "actions", "replaceDefaultActions", "showSerial", "cellClass", "rowClass", "globalSearch", "limitOptions", "showLimitSelector", "onLimitChange", "showReloadButton", "renderReloadButton", "onReload", "stripedRows", "theme", "responsiveBreakpoint", "showToolbar", "showColumnPicker", "wrapCells", "mobileMaxFields", "serverSide", "totalRecords", "pageNumber", "onPageChange", "TheadComponent", "TfootComponent", "interactive", "onSave", "onEdit", "onRowAdd", "onRowDelete", "editKeyBinding", "newRowPosition", "addRowRef", "onInitAddRow", "renderAddRowButton", "renderExternalAddRow", "actionMenuPresentation", "defaultMobileView", "mobileFiltersPresentation", "swipeActions", "stickyHeader"],
|
|
10650
10666
|
_excluded2$8 = ["_key", "_isNew"];
|
|
10651
|
-
function ownKeys$
|
|
10652
|
-
function _objectSpread$
|
|
10667
|
+
function ownKeys$10(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
10668
|
+
function _objectSpread$10(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$10(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$10(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10653
10669
|
var DEFAULT_DATA = [];
|
|
10654
10670
|
var DEFAULT_COLUMNS = [];
|
|
10655
10671
|
var DEFAULT_THEME = {
|
|
@@ -10755,8 +10771,8 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
10755
10771
|
swipeActions = _ref.swipeActions,
|
|
10756
10772
|
_ref$stickyHeader = _ref.stickyHeader,
|
|
10757
10773
|
stickyHeader = _ref$stickyHeader === void 0 ? false : _ref$stickyHeader,
|
|
10758
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
10759
|
-
theme = _objectSpread$
|
|
10774
|
+
props = _objectWithoutProperties$1(_ref, _excluded$V);
|
|
10775
|
+
theme = _objectSpread$10(_objectSpread$10({}, DEFAULT_THEME), theme);
|
|
10760
10776
|
// Card mode follows a media query (SSR-safe): `defaultMobileView` on the
|
|
10761
10777
|
// server and while hydrating, then the live match. Same semantics as the old
|
|
10762
10778
|
// `window.innerWidth < responsiveBreakpoint` check.
|
|
@@ -10787,7 +10803,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
10787
10803
|
setCurrentPage = _useState8[1];
|
|
10788
10804
|
var _useState9 = useState(function () {
|
|
10789
10805
|
return Array.isArray(initialColumns) ? initialColumns.map(function (c) {
|
|
10790
|
-
return _objectSpread$
|
|
10806
|
+
return _objectSpread$10({}, c);
|
|
10791
10807
|
}) : [];
|
|
10792
10808
|
}),
|
|
10793
10809
|
_useState0 = _slicedToArray(_useState9, 2),
|
|
@@ -10905,7 +10921,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
10905
10921
|
return getRowKey(r, i) === rowKey;
|
|
10906
10922
|
});
|
|
10907
10923
|
if (!origRow) return;
|
|
10908
|
-
var effectiveRow = _objectSpread$
|
|
10924
|
+
var effectiveRow = _objectSpread$10(_objectSpread$10({}, origRow), pendingEdits[rowKey] || {});
|
|
10909
10925
|
columnsState.forEach(function (col) {
|
|
10910
10926
|
var _col$rules;
|
|
10911
10927
|
if (col.isVisible === false) return;
|
|
@@ -10972,7 +10988,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
10972
10988
|
if (newRowIdx !== -1) {
|
|
10973
10989
|
setNewRows(function (prev) {
|
|
10974
10990
|
var next = _toConsumableArray$1(prev);
|
|
10975
|
-
next[newRowIdx] = _objectSpread$
|
|
10991
|
+
next[newRowIdx] = _objectSpread$10(_objectSpread$10({}, next[newRowIdx]), {}, _defineProperty$4({}, colKey, newValue));
|
|
10976
10992
|
onEdit === null || onEdit === void 0 || onEdit({
|
|
10977
10993
|
rowKey: rowKey,
|
|
10978
10994
|
colKey: colKey,
|
|
@@ -10985,11 +11001,11 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
10985
11001
|
return;
|
|
10986
11002
|
}
|
|
10987
11003
|
setPendingEdits(function (prev) {
|
|
10988
|
-
var nextRowEdits = _objectSpread$
|
|
11004
|
+
var nextRowEdits = _objectSpread$10(_objectSpread$10({}, prev[rowKey] || {}), {}, _defineProperty$4({}, colKey, newValue));
|
|
10989
11005
|
var origRow = tableData.find(function (r, i) {
|
|
10990
11006
|
return getRowKey(r, i) === rowKey;
|
|
10991
11007
|
});
|
|
10992
|
-
var updatedRow = _objectSpread$
|
|
11008
|
+
var updatedRow = _objectSpread$10(_objectSpread$10({}, origRow), nextRowEdits);
|
|
10993
11009
|
onEdit === null || onEdit === void 0 || onEdit({
|
|
10994
11010
|
rowKey: rowKey,
|
|
10995
11011
|
colKey: colKey,
|
|
@@ -10997,7 +11013,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
10997
11013
|
row: updatedRow,
|
|
10998
11014
|
isNew: false
|
|
10999
11015
|
});
|
|
11000
|
-
return _objectSpread$
|
|
11016
|
+
return _objectSpread$10(_objectSpread$10({}, prev), {}, _defineProperty$4({}, rowKey, nextRowEdits));
|
|
11001
11017
|
});
|
|
11002
11018
|
}, [newRows, tableData, onEdit]);
|
|
11003
11019
|
var _handleAddRow = useCallback(function (positionOverride) {
|
|
@@ -11065,7 +11081,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
11065
11081
|
});
|
|
11066
11082
|
});
|
|
11067
11083
|
setPendingEdits(function (prev) {
|
|
11068
|
-
var next = _objectSpread$
|
|
11084
|
+
var next = _objectSpread$10({}, prev);
|
|
11069
11085
|
delete next[rowKey];
|
|
11070
11086
|
return next;
|
|
11071
11087
|
});
|
|
@@ -11091,7 +11107,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
11091
11107
|
updatedTableData = tableData.map(function (row, i) {
|
|
11092
11108
|
var rKey = getRowKey(row, i);
|
|
11093
11109
|
if (dirtyEdits[rKey]) {
|
|
11094
|
-
return _objectSpread$
|
|
11110
|
+
return _objectSpread$10(_objectSpread$10({}, row), dirtyEdits[rKey]);
|
|
11095
11111
|
}
|
|
11096
11112
|
return row;
|
|
11097
11113
|
});
|
|
@@ -11224,7 +11240,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
11224
11240
|
useEffect(function () {
|
|
11225
11241
|
if (initialColumns !== initialColumnsRef.current) {
|
|
11226
11242
|
setColumnsState(Array.isArray(initialColumns) ? initialColumns.map(function (c) {
|
|
11227
|
-
return _objectSpread$
|
|
11243
|
+
return _objectSpread$10({}, c);
|
|
11228
11244
|
}) : []);
|
|
11229
11245
|
initialColumnsRef.current = initialColumns;
|
|
11230
11246
|
}
|
|
@@ -11555,7 +11571,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
11555
11571
|
var toggleColumnVisibility = useCallback(function (key) {
|
|
11556
11572
|
setColumnsState(function (prev) {
|
|
11557
11573
|
return prev.map(function (c) {
|
|
11558
|
-
return c.key === key ? _objectSpread$
|
|
11574
|
+
return c.key === key ? _objectSpread$10(_objectSpread$10({}, c), {}, {
|
|
11559
11575
|
isVisible: !(c.isVisible !== false)
|
|
11560
11576
|
}) : c;
|
|
11561
11577
|
});
|
|
@@ -11574,7 +11590,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
11574
11590
|
}, [sortable, onSort]);
|
|
11575
11591
|
var handleFilter = useCallback(function (key, value) {
|
|
11576
11592
|
setFilters(function (prev) {
|
|
11577
|
-
var newFilters = _objectSpread$
|
|
11593
|
+
var newFilters = _objectSpread$10(_objectSpread$10({}, prev), {}, _defineProperty$4({}, key, value));
|
|
11578
11594
|
onFilter === null || onFilter === void 0 || onFilter(newFilters);
|
|
11579
11595
|
onFilterChange === null || onFilterChange === void 0 || onFilterChange(newFilters);
|
|
11580
11596
|
return newFilters;
|
|
@@ -11584,7 +11600,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
11584
11600
|
// Commits several filters at once (the phone filter sheet's Apply).
|
|
11585
11601
|
var applyFilters = useCallback(function (patch) {
|
|
11586
11602
|
setFilters(function (prev) {
|
|
11587
|
-
var newFilters = _objectSpread$
|
|
11603
|
+
var newFilters = _objectSpread$10(_objectSpread$10({}, prev), patch);
|
|
11588
11604
|
onFilter === null || onFilter === void 0 || onFilter(newFilters);
|
|
11589
11605
|
onFilterChange === null || onFilterChange === void 0 || onFilterChange(newFilters);
|
|
11590
11606
|
return newFilters;
|
|
@@ -11998,7 +12014,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
11998
12014
|
style: stickyHeader && stickyHeader !== true ? {
|
|
11999
12015
|
maxHeight: typeof stickyHeader === "number" ? "".concat(stickyHeader, "px") : stickyHeader
|
|
12000
12016
|
} : undefined,
|
|
12001
|
-
children: jsxs("table", _objectSpread$
|
|
12017
|
+
children: jsxs("table", _objectSpread$10(_objectSpread$10({
|
|
12002
12018
|
className: cn("min-w-full divide-y divide-line", className)
|
|
12003
12019
|
}, props), {}, {
|
|
12004
12020
|
children: [jsxs("thead", {
|
|
@@ -12148,7 +12164,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
12148
12164
|
}), interactive && newRowPosition !== "top" && renderAddRowClickableRow()]
|
|
12149
12165
|
}) : jsxs(Fragment, {
|
|
12150
12166
|
children: [interactive && newRowPosition === "top" && renderAddRowClickableRow(), interactive && newRowPosition === "top" && newRows.map(function (newRow, newIdx) {
|
|
12151
|
-
return jsx(TableRow, _objectSpread$
|
|
12167
|
+
return jsx(TableRow, _objectSpread$10({
|
|
12152
12168
|
row: newRow,
|
|
12153
12169
|
rowIndexInPage: newIdx,
|
|
12154
12170
|
startIndex: 0,
|
|
@@ -12157,14 +12173,14 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
12157
12173
|
onDeleteNewRow: handleDeleteNewRow
|
|
12158
12174
|
}, rowSharedProps), newRow._key);
|
|
12159
12175
|
}), paginatedData.map(function (row, rowIndexInPage) {
|
|
12160
|
-
return jsx(TableRow, _objectSpread$
|
|
12176
|
+
return jsx(TableRow, _objectSpread$10({
|
|
12161
12177
|
row: row,
|
|
12162
12178
|
rowIndexInPage: rowIndexInPage,
|
|
12163
12179
|
startIndex: startIndex,
|
|
12164
12180
|
visibleCount: visibleCount
|
|
12165
12181
|
}, rowSharedProps), getRowKey(row, startIndex + rowIndexInPage));
|
|
12166
12182
|
}), interactive && newRowPosition !== "top" && newRows.map(function (newRow, newIdx) {
|
|
12167
|
-
return jsx(TableRow, _objectSpread$
|
|
12183
|
+
return jsx(TableRow, _objectSpread$10({
|
|
12168
12184
|
row: newRow,
|
|
12169
12185
|
rowIndexInPage: paginatedData.length + newIdx,
|
|
12170
12186
|
startIndex: 0,
|
|
@@ -12204,7 +12220,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
12204
12220
|
})]
|
|
12205
12221
|
})
|
|
12206
12222
|
}) : paginatedData.map(function (row, rowIndexInPage) {
|
|
12207
|
-
return jsx(MobileCard, _objectSpread$
|
|
12223
|
+
return jsx(MobileCard, _objectSpread$10(_objectSpread$10({
|
|
12208
12224
|
row: row,
|
|
12209
12225
|
rowIndexInPage: rowIndexInPage,
|
|
12210
12226
|
startIndex: startIndex
|
|
@@ -12378,7 +12394,7 @@ var getProxyFormState = (formState, control, localProxyFormState, isRoot = true)
|
|
|
12378
12394
|
return result;
|
|
12379
12395
|
};
|
|
12380
12396
|
|
|
12381
|
-
const useIsomorphicLayoutEffect$
|
|
12397
|
+
const useIsomorphicLayoutEffect$8 = typeof window !== 'undefined' ? React__default.useLayoutEffect : React__default.useEffect;
|
|
12382
12398
|
|
|
12383
12399
|
/**
|
|
12384
12400
|
* This custom hook allows you to subscribe to each form state, and isolate the re-render at the custom hook level. It has its scope in terms of form state subscription, so it would not affect other useFormState and useForm. Using this hook can reduce the re-render impact on large and complex form application.
|
|
@@ -12424,7 +12440,7 @@ function useFormState(props) {
|
|
|
12424
12440
|
isValid: false,
|
|
12425
12441
|
errors: false,
|
|
12426
12442
|
});
|
|
12427
|
-
useIsomorphicLayoutEffect$
|
|
12443
|
+
useIsomorphicLayoutEffect$8(() => control._subscribe({
|
|
12428
12444
|
name,
|
|
12429
12445
|
formState: _localProxyFormState.current,
|
|
12430
12446
|
exact,
|
|
@@ -12543,7 +12559,7 @@ function useWatch(props) {
|
|
|
12543
12559
|
}
|
|
12544
12560
|
}
|
|
12545
12561
|
}, [control._formValues, control._names, disabled, name]);
|
|
12546
|
-
useIsomorphicLayoutEffect$
|
|
12562
|
+
useIsomorphicLayoutEffect$8(() => {
|
|
12547
12563
|
if (_prevControl.current !== control ||
|
|
12548
12564
|
!deepEqual(_prevName.current, name)) {
|
|
12549
12565
|
_prevControl.current = control;
|
|
@@ -14624,7 +14640,7 @@ function useForm(props = {}) {
|
|
|
14624
14640
|
}
|
|
14625
14641
|
const control = _formControl.current.control;
|
|
14626
14642
|
control._options = props;
|
|
14627
|
-
useIsomorphicLayoutEffect$
|
|
14643
|
+
useIsomorphicLayoutEffect$8(() => {
|
|
14628
14644
|
const sub = control._subscribe({
|
|
14629
14645
|
formState: control._proxyFormState,
|
|
14630
14646
|
callback: () => updateFormState({ ...control._formState }),
|
|
@@ -17627,8 +17643,8 @@ function subMonths(dirtyDate, dirtyAmount) {
|
|
|
17627
17643
|
return addMonths(dirtyDate, -amount);
|
|
17628
17644
|
}
|
|
17629
17645
|
|
|
17630
|
-
function ownKeys
|
|
17631
|
-
function _objectSpread
|
|
17646
|
+
function ownKeys$$(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17647
|
+
function _objectSpread$$(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$$(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$$(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
17632
17648
|
// Internal (not exported). The month calendar shared by DatePicker and
|
|
17633
17649
|
// DateRangePicker: month header, weekday row and an ARIA grid of days with a
|
|
17634
17650
|
// roving tabindex, arrow/Home/End/PageUp/PageDown navigation and (in sheet
|
|
@@ -17875,7 +17891,7 @@ function Calendar(_ref3) {
|
|
|
17875
17891
|
children: label
|
|
17876
17892
|
}, label);
|
|
17877
17893
|
})
|
|
17878
|
-
}), jsx("div", _objectSpread
|
|
17894
|
+
}), jsx("div", _objectSpread$$(_objectSpread$$({
|
|
17879
17895
|
ref: grid,
|
|
17880
17896
|
role: "grid",
|
|
17881
17897
|
"aria-label": format(month, "MMMM yyyy"),
|
|
@@ -17998,9 +18014,9 @@ function PickerSurface(_ref4) {
|
|
|
17998
18014
|
return portal && typeof document !== "undefined" ? /*#__PURE__*/ReactDOM__default.createPortal(popup, document.body) : popup;
|
|
17999
18015
|
}
|
|
18000
18016
|
|
|
18001
|
-
var _excluded$
|
|
18002
|
-
function ownKeys$
|
|
18003
|
-
function _objectSpread$
|
|
18017
|
+
var _excluded$U = ["value", "onChange", "placeholder", "label", "error", "helperText", "disabled", "required", "minDate", "maxDate", "className", "weekStartsOn", "portal", "displayFormat", "locale", "showClear", "closeOnSelect", "presentation"];
|
|
18018
|
+
function ownKeys$_(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18019
|
+
function _objectSpread$_(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$_(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$_(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18004
18020
|
var DatePicker = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef) {
|
|
18005
18021
|
var value = _ref.value,
|
|
18006
18022
|
onChange = _ref.onChange,
|
|
@@ -18028,7 +18044,7 @@ var DatePicker = /*#__PURE__*/React__default.forwardRef(function (_ref, forwarde
|
|
|
18028
18044
|
closeOnSelect = _ref$closeOnSelect === void 0 ? true : _ref$closeOnSelect,
|
|
18029
18045
|
_ref$presentation = _ref.presentation,
|
|
18030
18046
|
presentation = _ref$presentation === void 0 ? "auto" : _ref$presentation,
|
|
18031
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
18047
|
+
props = _objectWithoutProperties$1(_ref, _excluded$U);
|
|
18032
18048
|
// Stable ids wiring label / helper / error to the trigger button.
|
|
18033
18049
|
// A consumer `id` (spread onto the trigger via ...props) wins.
|
|
18034
18050
|
var reactId = useId();
|
|
@@ -18192,7 +18208,7 @@ var DatePicker = /*#__PURE__*/React__default.forwardRef(function (_ref, forwarde
|
|
|
18192
18208
|
}), jsxs("div", {
|
|
18193
18209
|
ref: fieldRef,
|
|
18194
18210
|
className: "relative",
|
|
18195
|
-
children: [jsxs("button", _objectSpread$
|
|
18211
|
+
children: [jsxs("button", _objectSpread$_(_objectSpread$_({
|
|
18196
18212
|
ref: triggerRef,
|
|
18197
18213
|
type: "button",
|
|
18198
18214
|
id: fieldId,
|
|
@@ -18201,10 +18217,13 @@ var DatePicker = /*#__PURE__*/React__default.forwardRef(function (_ref, forwarde
|
|
|
18201
18217
|
"aria-invalid": error ? true : undefined,
|
|
18202
18218
|
className: cn("flex w-full items-center justify-between rounded-md border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50", {
|
|
18203
18219
|
"border-error-500 focus:ring-error-500": error,
|
|
18204
|
-
|
|
18220
|
+
// Empty: the placeholder reads muted, like Input's
|
|
18221
|
+
// ::placeholder (#159). `className` still merges last.
|
|
18222
|
+
"text-muted": !selected,
|
|
18205
18223
|
// leave room for the sibling clear button overlaid on the field
|
|
18206
18224
|
"pr-16": showClear && selected
|
|
18207
18225
|
}, className),
|
|
18226
|
+
"data-empty": selected ? undefined : "",
|
|
18208
18227
|
onClick: function onClick() {
|
|
18209
18228
|
return setIsOpen(function (open) {
|
|
18210
18229
|
return !open;
|
|
@@ -18276,9 +18295,9 @@ var DatePicker = /*#__PURE__*/React__default.forwardRef(function (_ref, forwarde
|
|
|
18276
18295
|
});
|
|
18277
18296
|
DatePicker.displayName = "DatePicker";
|
|
18278
18297
|
|
|
18279
|
-
var _excluded$
|
|
18280
|
-
function ownKeys$
|
|
18281
|
-
function _objectSpread$
|
|
18298
|
+
var _excluded$T = ["id", "name", "checked", "defaultChecked", "onChange", "disabled", "size", "color", "trackClass", "thumbClass", "className", "topLabel", "bottomLabel", "rightLabel", "leftLabel", "ariaLabel", "onPointerDown", "onPointerMove", "onPointerUp", "onPointerCancel", "haptics"];
|
|
18299
|
+
function ownKeys$Z(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18300
|
+
function _objectSpread$Z(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$Z(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$Z(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18282
18301
|
/**
|
|
18283
18302
|
* Switch.jsx
|
|
18284
18303
|
* - Plain JSX (no TypeScript)
|
|
@@ -18378,7 +18397,7 @@ var Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
|
|
18378
18397
|
onPointerCancel = props.onPointerCancel,
|
|
18379
18398
|
_props$haptics = props.haptics,
|
|
18380
18399
|
haptics = _props$haptics === void 0 ? false : _props$haptics,
|
|
18381
|
-
rest = _objectWithoutProperties$1(props, _excluded$
|
|
18400
|
+
rest = _objectWithoutProperties$1(props, _excluded$T);
|
|
18382
18401
|
var isControlled = typeof checked === "boolean";
|
|
18383
18402
|
var _useState = useState(defaultChecked),
|
|
18384
18403
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -18497,7 +18516,7 @@ var Switch = /*#__PURE__*/forwardRef(function Switch(props, ref) {
|
|
|
18497
18516
|
htmlFor: switchId,
|
|
18498
18517
|
className: labelOpacityClass,
|
|
18499
18518
|
children: leftLabel
|
|
18500
|
-
}) : null, jsxs("button", _objectSpread$
|
|
18519
|
+
}) : null, jsxs("button", _objectSpread$Z(_objectSpread$Z({
|
|
18501
18520
|
ref: ref,
|
|
18502
18521
|
id: switchId,
|
|
18503
18522
|
type: "button",
|
|
@@ -18681,9 +18700,9 @@ function useSliderPointer(_ref4) {
|
|
|
18681
18700
|
};
|
|
18682
18701
|
}
|
|
18683
18702
|
|
|
18684
|
-
var _excluded$
|
|
18685
|
-
function ownKeys$
|
|
18686
|
-
function _objectSpread$
|
|
18703
|
+
var _excluded$S = ["value", "defaultValue", "onChange", "onChangeEnd", "min", "max", "step", "largeStep", "disabled", "label", "showValue", "showBubble", "formatValue", "thumbLabels", "name", "className", "aria-label"];
|
|
18704
|
+
function ownKeys$Y(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18705
|
+
function _objectSpread$Y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$Y(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$Y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18687
18706
|
var DEFAULT_THUMB_LABELS = ["Minimum", "Maximum"];
|
|
18688
18707
|
var Slider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
18689
18708
|
var value = _ref.value,
|
|
@@ -18711,7 +18730,7 @@ var Slider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
18711
18730
|
name = _ref.name,
|
|
18712
18731
|
className = _ref.className,
|
|
18713
18732
|
ariaLabel = _ref["aria-label"],
|
|
18714
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
18733
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$S);
|
|
18715
18734
|
var labelId = "slider-label-".concat(useId());
|
|
18716
18735
|
var trackRef = useRef(null);
|
|
18717
18736
|
var bounds = useMemo(function () {
|
|
@@ -18759,7 +18778,7 @@ var Slider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
18759
18778
|
var display = values.map(function (v) {
|
|
18760
18779
|
return formatValue(v);
|
|
18761
18780
|
}).join(" – ");
|
|
18762
|
-
return jsxs("div", _objectSpread$
|
|
18781
|
+
return jsxs("div", _objectSpread$Y(_objectSpread$Y({
|
|
18763
18782
|
ref: ref,
|
|
18764
18783
|
className: cn("w-full", disabled && "opacity-50", className)
|
|
18765
18784
|
}, rest), {}, {
|
|
@@ -18774,7 +18793,7 @@ var Slider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
18774
18793
|
"aria-hidden": "true",
|
|
18775
18794
|
children: display
|
|
18776
18795
|
})]
|
|
18777
|
-
}), jsxs("div", _objectSpread$
|
|
18796
|
+
}), jsxs("div", _objectSpread$Y(_objectSpread$Y({
|
|
18778
18797
|
ref: trackRef,
|
|
18779
18798
|
className: cn(
|
|
18780
18799
|
// 44px tall row on coarse pointers so the whole strip is easy to grab.
|
|
@@ -18827,9 +18846,9 @@ var Slider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
18827
18846
|
});
|
|
18828
18847
|
Slider.displayName = "Slider";
|
|
18829
18848
|
|
|
18830
|
-
var _excluded$
|
|
18831
|
-
function ownKeys$
|
|
18832
|
-
function _objectSpread$
|
|
18849
|
+
var _excluded$R = ["value", "defaultValue", "onChange", "swatches", "showAlpha", "size", "disabled", "className", "label", "id"];
|
|
18850
|
+
function ownKeys$X(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
18851
|
+
function _objectSpread$X(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$X(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$X(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18833
18852
|
/**
|
|
18834
18853
|
* ColorPicker.jsx
|
|
18835
18854
|
* A reusable, accessible, and Tailwind-friendly color picker component (plain JavaScript)
|
|
@@ -18982,7 +19001,7 @@ var ColorPicker = /*#__PURE__*/forwardRef(function ColorPicker(props, ref) {
|
|
|
18982
19001
|
_props$label = props.label,
|
|
18983
19002
|
label = _props$label === void 0 ? "Pick a color" : _props$label,
|
|
18984
19003
|
id = props.id,
|
|
18985
|
-
rest = _objectWithoutProperties$1(props, _excluded$
|
|
19004
|
+
rest = _objectWithoutProperties$1(props, _excluded$R);
|
|
18986
19005
|
// The visible <label> must point at a real control: the text value input
|
|
18987
19006
|
// takes the caller's `id` (or a generated one).
|
|
18988
19007
|
var autoId = useId();
|
|
@@ -19046,7 +19065,7 @@ var ColorPicker = /*#__PURE__*/forwardRef(function ColorPicker(props, ref) {
|
|
|
19046
19065
|
// Sizes outside sm/md/lg (the shared `Size` type also lists xs/xl/2xl) fall
|
|
19047
19066
|
// back to md instead of crashing on an undefined map entry.
|
|
19048
19067
|
var sizeMap = sizeMaps[size] || sizeMaps.md;
|
|
19049
|
-
return jsxs("div", _objectSpread$
|
|
19068
|
+
return jsxs("div", _objectSpread$X(_objectSpread$X({
|
|
19050
19069
|
ref: ref,
|
|
19051
19070
|
className: cn("inline-block", className)
|
|
19052
19071
|
}, rest), {}, {
|
|
@@ -19113,7 +19132,7 @@ var ColorPicker = /*#__PURE__*/forwardRef(function ColorPicker(props, ref) {
|
|
|
19113
19132
|
value: rgbaToHex(internal, false).slice(0, 7),
|
|
19114
19133
|
onChange: function onChange(e) {
|
|
19115
19134
|
var parsed = hexToRgba(e.target.value);
|
|
19116
|
-
if (parsed) pushChange(_objectSpread$
|
|
19135
|
+
if (parsed) pushChange(_objectSpread$X(_objectSpread$X({}, parsed), {}, {
|
|
19117
19136
|
a: internal.a
|
|
19118
19137
|
}));
|
|
19119
19138
|
},
|
|
@@ -19136,7 +19155,7 @@ var ColorPicker = /*#__PURE__*/forwardRef(function ColorPicker(props, ref) {
|
|
|
19136
19155
|
if (p) pushChange(p);else {
|
|
19137
19156
|
var maybe = v.startsWith("#") ? v : "#".concat(v);
|
|
19138
19157
|
var ph = hexToRgba(maybe);
|
|
19139
|
-
if (ph) pushChange(_objectSpread$
|
|
19158
|
+
if (ph) pushChange(_objectSpread$X(_objectSpread$X({}, ph), {}, {
|
|
19140
19159
|
a: internal.a
|
|
19141
19160
|
}));
|
|
19142
19161
|
}
|
|
@@ -19157,7 +19176,7 @@ var ColorPicker = /*#__PURE__*/forwardRef(function ColorPicker(props, ref) {
|
|
|
19157
19176
|
max: 100,
|
|
19158
19177
|
value: Math.round(((_internal$a = internal.a) !== null && _internal$a !== void 0 ? _internal$a : 1) * 100),
|
|
19159
19178
|
onChange: function onChange(v) {
|
|
19160
|
-
pushChange(_objectSpread$
|
|
19179
|
+
pushChange(_objectSpread$X(_objectSpread$X({}, internal), {}, {
|
|
19161
19180
|
a: clamp(v / 100, 0, 1)
|
|
19162
19181
|
}));
|
|
19163
19182
|
},
|
|
@@ -19170,11 +19189,11 @@ var ColorPicker = /*#__PURE__*/forwardRef(function ColorPicker(props, ref) {
|
|
|
19170
19189
|
});
|
|
19171
19190
|
ColorPicker.displayName = "ColorPicker";
|
|
19172
19191
|
|
|
19173
|
-
var _excluded$
|
|
19192
|
+
var _excluded$Q = ["fields", "onSubmit", "defaultValues", "validationSchema", "className", "submitText", "resetText", "submitButtonClass", "resetButtonClass", "showReset", "submitDisabled"],
|
|
19174
19193
|
_excluded2$7 = ["type", "name", "label", "required", "options", "placeholder", "helperText"],
|
|
19175
|
-
_excluded3$
|
|
19176
|
-
function ownKeys$
|
|
19177
|
-
function _objectSpread$
|
|
19194
|
+
_excluded3$4 = ["onChange", "ref", "value"];
|
|
19195
|
+
function ownKeys$W(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19196
|
+
function _objectSpread$W(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$W(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$W(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19178
19197
|
/**
|
|
19179
19198
|
* Error / helper line rendered under Form-owned field markup (textarea,
|
|
19180
19199
|
* checkbox, radio, file, switch, color). Mirrors Input / Select / DatePicker:
|
|
@@ -19235,7 +19254,7 @@ var Form = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
19235
19254
|
showReset = _ref2$showReset === void 0 ? true : _ref2$showReset,
|
|
19236
19255
|
_ref2$submitDisabled = _ref2.submitDisabled,
|
|
19237
19256
|
submitDisabled = _ref2$submitDisabled === void 0 ? false : _ref2$submitDisabled,
|
|
19238
|
-
props = _objectWithoutProperties$1(_ref2, _excluded$
|
|
19257
|
+
props = _objectWithoutProperties$1(_ref2, _excluded$Q);
|
|
19239
19258
|
var methods = useForm({
|
|
19240
19259
|
defaultValues: defaultValues,
|
|
19241
19260
|
resolver: validationSchema
|
|
@@ -19281,7 +19300,7 @@ var Form = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
19281
19300
|
// hatch for extra component props and is still spread. An array must
|
|
19282
19301
|
// never be spread: it leaked index keys ("0", "1", …) as props/attributes.
|
|
19283
19302
|
var extraProps = options && _typeof$4(options) === "object" && !Array.isArray(options) ? options : undefined;
|
|
19284
|
-
var commonProps = _objectSpread$
|
|
19303
|
+
var commonProps = _objectSpread$W(_objectSpread$W({
|
|
19285
19304
|
name: name,
|
|
19286
19305
|
label: label,
|
|
19287
19306
|
required: required,
|
|
@@ -19303,7 +19322,7 @@ var Form = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
19303
19322
|
onChange = _ref3$field.onChange,
|
|
19304
19323
|
value = _ref3$field.value,
|
|
19305
19324
|
ref = _ref3$field.ref;
|
|
19306
|
-
return jsx(Input, _objectSpread$
|
|
19325
|
+
return jsx(Input, _objectSpread$W(_objectSpread$W({
|
|
19307
19326
|
type: type,
|
|
19308
19327
|
value: value || "",
|
|
19309
19328
|
onChange: onChange,
|
|
@@ -19330,7 +19349,7 @@ var Form = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
19330
19349
|
onChange = _ref4$field.onChange,
|
|
19331
19350
|
value = _ref4$field.value,
|
|
19332
19351
|
ref = _ref4$field.ref;
|
|
19333
|
-
return jsx(Select, _objectSpread$
|
|
19352
|
+
return jsx(Select, _objectSpread$W({
|
|
19334
19353
|
value: value,
|
|
19335
19354
|
onChange: onChange,
|
|
19336
19355
|
ref: ref,
|
|
@@ -19348,7 +19367,7 @@ var Form = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
19348
19367
|
onChange = _ref5$field.onChange,
|
|
19349
19368
|
value = _ref5$field.value,
|
|
19350
19369
|
ref = _ref5$field.ref;
|
|
19351
|
-
return jsx(DatePicker, _objectSpread$
|
|
19370
|
+
return jsx(DatePicker, _objectSpread$W({
|
|
19352
19371
|
value: value,
|
|
19353
19372
|
onChange: onChange,
|
|
19354
19373
|
ref: ref,
|
|
@@ -19502,7 +19521,7 @@ var Form = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
19502
19521
|
_onChange3 = _ref9$field.onChange,
|
|
19503
19522
|
ref = _ref9$field.ref,
|
|
19504
19523
|
value = _ref9$field.value,
|
|
19505
|
-
field = _objectWithoutProperties$1(_ref9$field, _excluded3$
|
|
19524
|
+
field = _objectWithoutProperties$1(_ref9$field, _excluded3$4);
|
|
19506
19525
|
return jsxs("div", {
|
|
19507
19526
|
className: "w-full",
|
|
19508
19527
|
children: [label && jsxs("label", {
|
|
@@ -19531,7 +19550,7 @@ var Form = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
19531
19550
|
d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"
|
|
19532
19551
|
})
|
|
19533
19552
|
}), "Choose File"]
|
|
19534
|
-
}), jsx("input", _objectSpread$
|
|
19553
|
+
}), jsx("input", _objectSpread$W(_objectSpread$W({}, field), {}, {
|
|
19535
19554
|
id: name,
|
|
19536
19555
|
ref: ref,
|
|
19537
19556
|
type: "file",
|
|
@@ -19546,13 +19565,13 @@ var Form = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
19546
19565
|
var reader = new FileReader();
|
|
19547
19566
|
reader.onloadend = function () {
|
|
19548
19567
|
setFilePreviews(function (prev) {
|
|
19549
|
-
return _objectSpread$
|
|
19568
|
+
return _objectSpread$W(_objectSpread$W({}, prev), {}, _defineProperty$4({}, name, reader.result));
|
|
19550
19569
|
});
|
|
19551
19570
|
};
|
|
19552
19571
|
reader.readAsDataURL(file);
|
|
19553
19572
|
} else {
|
|
19554
19573
|
setFilePreviews(function (prev) {
|
|
19555
|
-
return _objectSpread$
|
|
19574
|
+
return _objectSpread$W(_objectSpread$W({}, prev), {}, _defineProperty$4({}, name, null));
|
|
19556
19575
|
});
|
|
19557
19576
|
}
|
|
19558
19577
|
},
|
|
@@ -19566,7 +19585,7 @@ var Form = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
19566
19585
|
onClick: function onClick() {
|
|
19567
19586
|
_onChange3(null);
|
|
19568
19587
|
setFilePreviews(function (prev) {
|
|
19569
|
-
return _objectSpread$
|
|
19588
|
+
return _objectSpread$W(_objectSpread$W({}, prev), {}, _defineProperty$4({}, name, null));
|
|
19570
19589
|
});
|
|
19571
19590
|
},
|
|
19572
19591
|
className: "ml-3 text-sm text-error-600 hover:text-error-800",
|
|
@@ -19601,7 +19620,7 @@ var Form = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
19601
19620
|
ref = _ref0$field.ref;
|
|
19602
19621
|
return jsxs("div", {
|
|
19603
19622
|
className: "w-full",
|
|
19604
|
-
children: [jsx(Switch, _objectSpread$
|
|
19623
|
+
children: [jsx(Switch, _objectSpread$W({
|
|
19605
19624
|
checked: !!value,
|
|
19606
19625
|
onChange: onChange,
|
|
19607
19626
|
ref: ref,
|
|
@@ -19688,8 +19707,8 @@ var Form = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
19688
19707
|
}
|
|
19689
19708
|
return renderField(group);
|
|
19690
19709
|
};
|
|
19691
|
-
return jsx(FormProvider, _objectSpread$
|
|
19692
|
-
children: jsxs("form", _objectSpread$
|
|
19710
|
+
return jsx(FormProvider, _objectSpread$W(_objectSpread$W({}, methods), {}, {
|
|
19711
|
+
children: jsxs("form", _objectSpread$W(_objectSpread$W({
|
|
19693
19712
|
ref: ref,
|
|
19694
19713
|
className: cn("space-y-6", className),
|
|
19695
19714
|
onSubmit: handleSubmit(handleFormSubmit)
|
|
@@ -19716,9 +19735,9 @@ var Form = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
19716
19735
|
});
|
|
19717
19736
|
Form.displayName = "Form";
|
|
19718
19737
|
|
|
19719
|
-
var _excluded$
|
|
19720
|
-
function ownKeys$
|
|
19721
|
-
function _objectSpread$
|
|
19738
|
+
var _excluded$P = ["items", "allowMultiple", "defaultOpenIndexes", "onChange", "className", "headerClassName", "contentClassName", "chevronPosition", "chevronIcon", "bordered", "rounded", "size", "transitionDuration"];
|
|
19739
|
+
function ownKeys$V(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
19740
|
+
function _objectSpread$V(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$V(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$V(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19722
19741
|
/**
|
|
19723
19742
|
* item.leftIcon may be:
|
|
19724
19743
|
* - ReactNode (e.g. <svg/>)
|
|
@@ -19750,7 +19769,7 @@ var Accordion = /*#__PURE__*/forwardRef(function Accordion(_ref, ref) {
|
|
|
19750
19769
|
size = _ref$size === void 0 ? "md" : _ref$size,
|
|
19751
19770
|
_ref$transitionDurati = _ref.transitionDuration,
|
|
19752
19771
|
transitionDuration = _ref$transitionDurati === void 0 ? 220 : _ref$transitionDurati,
|
|
19753
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
19772
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$P);
|
|
19754
19773
|
var saneDefault = Array.isArray(defaultOpenIndexes) ? defaultOpenIndexes.filter(function (i) {
|
|
19755
19774
|
return Number.isFinite(i) && i >= 0 && i < items.length;
|
|
19756
19775
|
}) : [];
|
|
@@ -19900,7 +19919,7 @@ var Accordion = /*#__PURE__*/forwardRef(function Accordion(_ref, ref) {
|
|
|
19900
19919
|
}
|
|
19901
19920
|
return left; // assume ReactNode
|
|
19902
19921
|
};
|
|
19903
|
-
return jsx("div", _objectSpread$
|
|
19922
|
+
return jsx("div", _objectSpread$V(_objectSpread$V({
|
|
19904
19923
|
ref: ref,
|
|
19905
19924
|
className: wrapperClasses,
|
|
19906
19925
|
role: "presentation"
|
|
@@ -20000,9 +20019,9 @@ var Accordion = /*#__PURE__*/forwardRef(function Accordion(_ref, ref) {
|
|
|
20000
20019
|
});
|
|
20001
20020
|
Accordion.displayName = "Accordion";
|
|
20002
20021
|
|
|
20003
|
-
var _excluded$
|
|
20004
|
-
function ownKeys$
|
|
20005
|
-
function _objectSpread$
|
|
20022
|
+
var _excluded$O = ["id", "name", "label", "checked", "defaultChecked", "onChange", "disabled", "required", "className", "size", "labelPosition", "value", "ariaLabel", "variant", "indeterminate", "color", "iconClass", "checkedClass", "wrapperProps", "haptics"];
|
|
20023
|
+
function ownKeys$U(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20024
|
+
function _objectSpread$U(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$U(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$U(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20006
20025
|
var SIZE_CLASSES$2 = {
|
|
20007
20026
|
sm: {
|
|
20008
20027
|
box: "h-4 w-4",
|
|
@@ -20099,7 +20118,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
20099
20118
|
wrapperProps = _ref.wrapperProps,
|
|
20100
20119
|
_ref$haptics = _ref.haptics,
|
|
20101
20120
|
haptics = _ref$haptics === void 0 ? false : _ref$haptics,
|
|
20102
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
20121
|
+
props = _objectWithoutProperties$1(_ref, _excluded$O);
|
|
20103
20122
|
var autoId = useId();
|
|
20104
20123
|
var inputId = id || "".concat(autoId, "-checkbox");
|
|
20105
20124
|
var inputRef = useRef(null);
|
|
@@ -20142,7 +20161,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
20142
20161
|
var iconState = function iconState(shown) {
|
|
20143
20162
|
return shown ? "opacity-100 scale-100" : "opacity-0 scale-50";
|
|
20144
20163
|
};
|
|
20145
|
-
return jsxs("div", _objectSpread$
|
|
20164
|
+
return jsxs("div", _objectSpread$U(_objectSpread$U({
|
|
20146
20165
|
className: cn("inline-flex items-center", className)
|
|
20147
20166
|
}, wrapperProps !== null && wrapperProps !== void 0 ? wrapperProps : {}), {}, {
|
|
20148
20167
|
children: [label && labelPosition === "left" && jsx("label", {
|
|
@@ -20152,7 +20171,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
20152
20171
|
}), jsxs("div", {
|
|
20153
20172
|
className: cn("relative inline-flex shrink-0 items-center justify-center rounded-sm border transition-shadow duration-fast motion-reduce:transition-none", sizeClass.box, disabled ? "opacity-60 cursor-not-allowed" : "cursor-pointer hover:shadow-sm", !disabled && showBoxBorder && "border-gray-300 dark:border-gray-600"),
|
|
20154
20173
|
"aria-disabled": disabled,
|
|
20155
|
-
children: [jsx("input", _objectSpread$
|
|
20174
|
+
children: [jsx("input", _objectSpread$U({
|
|
20156
20175
|
id: inputId,
|
|
20157
20176
|
ref: inputRef,
|
|
20158
20177
|
name: name,
|
|
@@ -20196,9 +20215,9 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
20196
20215
|
});
|
|
20197
20216
|
Checkbox.displayName = "Checkbox";
|
|
20198
20217
|
|
|
20199
|
-
var _excluded$
|
|
20200
|
-
function ownKeys$
|
|
20201
|
-
function _objectSpread$
|
|
20218
|
+
var _excluded$N = ["value", "onChange", "placeholder", "label", "error", "helperText", "disabled", "required", "minDate", "maxDate", "className", "weekStartsOn", "portal", "displayFormat", "locale", "showClear", "closeOnSelect", "presentation", "presets"];
|
|
20219
|
+
function ownKeys$T(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20220
|
+
function _objectSpread$T(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$T(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$T(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20202
20221
|
/*
|
|
20203
20222
|
Single-calendar DateRangePicker.
|
|
20204
20223
|
- Popover: tap/click start then end; the second pick commits (and closes
|
|
@@ -20240,7 +20259,7 @@ var DateRangePicker = /*#__PURE__*/forwardRef(function DateRangePicker(_ref, ref
|
|
|
20240
20259
|
_ref$presentation = _ref.presentation,
|
|
20241
20260
|
presentation = _ref$presentation === void 0 ? "auto" : _ref$presentation,
|
|
20242
20261
|
presets = _ref.presets,
|
|
20243
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
20262
|
+
props = _objectWithoutProperties$1(_ref, _excluded$N);
|
|
20244
20263
|
// Stable ids wiring label / helper / error to the trigger button.
|
|
20245
20264
|
// A consumer `id` (spread onto the trigger via ...props) wins.
|
|
20246
20265
|
var reactId = useId();
|
|
@@ -20468,7 +20487,8 @@ var DateRangePicker = /*#__PURE__*/forwardRef(function DateRangePicker(_ref, ref
|
|
|
20468
20487
|
}));
|
|
20469
20488
|
};
|
|
20470
20489
|
// Display placeholder until both start and end are committed (mandatory range).
|
|
20471
|
-
var
|
|
20490
|
+
var isEmpty = !committed.start || !committed.end;
|
|
20491
|
+
var triggerText = isEmpty ? placeholder : formatRange(committed.start, committed.end);
|
|
20472
20492
|
var draftText = localStart && localEnd ? formatRange(localStart, localEnd) : placeholder;
|
|
20473
20493
|
var presetList = Array.isArray(presets) && presets.length > 0 ? presets : null;
|
|
20474
20494
|
var presetChips = presetList ? jsx("div", {
|
|
@@ -20539,7 +20559,7 @@ var DateRangePicker = /*#__PURE__*/forwardRef(function DateRangePicker(_ref, ref
|
|
|
20539
20559
|
}), jsxs("div", {
|
|
20540
20560
|
ref: fieldRef,
|
|
20541
20561
|
className: "relative",
|
|
20542
|
-
children: [jsxs("button", _objectSpread$
|
|
20562
|
+
children: [jsxs("button", _objectSpread$T(_objectSpread$T({
|
|
20543
20563
|
ref: triggerRef,
|
|
20544
20564
|
type: "button",
|
|
20545
20565
|
id: fieldId,
|
|
@@ -20548,9 +20568,12 @@ var DateRangePicker = /*#__PURE__*/forwardRef(function DateRangePicker(_ref, ref
|
|
|
20548
20568
|
"aria-invalid": error ? true : undefined,
|
|
20549
20569
|
className: cn("flex w-full items-center justify-between rounded-md border border-gray-300 bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent disabled:cursor-not-allowed disabled:opacity-50", {
|
|
20550
20570
|
"border-error-500 focus:ring-error-500": error,
|
|
20551
|
-
|
|
20571
|
+
// Empty: the placeholder reads muted, like Input's
|
|
20572
|
+
// ::placeholder (#159). `className` still merges last.
|
|
20573
|
+
"text-muted": isEmpty,
|
|
20552
20574
|
"pr-16": showClearButton
|
|
20553
20575
|
}, className),
|
|
20576
|
+
"data-empty": isEmpty ? "" : undefined,
|
|
20554
20577
|
onClick: function onClick() {
|
|
20555
20578
|
// The trigger always toggles, even mid-pick (DTUI-35): closing
|
|
20556
20579
|
// drops the uncommitted start, reopening starts from the last
|
|
@@ -20632,9 +20655,9 @@ var DateRangePicker = /*#__PURE__*/forwardRef(function DateRangePicker(_ref, ref
|
|
|
20632
20655
|
});
|
|
20633
20656
|
DateRangePicker.displayName = "DateRangePicker";
|
|
20634
20657
|
|
|
20635
|
-
var _excluded$
|
|
20636
|
-
function ownKeys$
|
|
20637
|
-
function _objectSpread$
|
|
20658
|
+
var _excluded$M = ["size", "speed", "thickness", "color", "secondaryColor", "variant", "className", "inline", "ariaLabel", "text", "reverse", "style"];
|
|
20659
|
+
function ownKeys$S(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20660
|
+
function _objectSpread$S(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$S(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$S(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20638
20661
|
var sizeToPx = function sizeToPx(size) {
|
|
20639
20662
|
if (!size) return 24;
|
|
20640
20663
|
if (typeof size === "number") return size;
|
|
@@ -20679,13 +20702,13 @@ var Loader = /*#__PURE__*/forwardRef(function Loader(_ref, ref) {
|
|
|
20679
20702
|
_ref$reverse = _ref.reverse,
|
|
20680
20703
|
reverse = _ref$reverse === void 0 ? false : _ref$reverse,
|
|
20681
20704
|
style = _ref.style,
|
|
20682
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
20705
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$M);
|
|
20683
20706
|
var px = sizeToPx(size);
|
|
20684
20707
|
var wrapperClass = cn(inline ? "inline-flex" : "flex", "items-center gap-2", className);
|
|
20685
|
-
var rootStyle = _objectSpread$
|
|
20708
|
+
var rootStyle = _objectSpread$S({
|
|
20686
20709
|
"--dt-loader-speed": "".concat(speed, "s")
|
|
20687
20710
|
}, style);
|
|
20688
|
-
return jsxs("div", _objectSpread$
|
|
20711
|
+
return jsxs("div", _objectSpread$S(_objectSpread$S({
|
|
20689
20712
|
ref: ref,
|
|
20690
20713
|
role: "progressbar",
|
|
20691
20714
|
"aria-label": ariaLabel,
|
|
@@ -20735,7 +20758,7 @@ var Loader = /*#__PURE__*/forwardRef(function Loader(_ref, ref) {
|
|
|
20735
20758
|
}), variant === "bar" && jsx("div", {
|
|
20736
20759
|
"aria-hidden": true,
|
|
20737
20760
|
className: cn("relative overflow-hidden rounded-full", !secondaryColor && TRACK_BG),
|
|
20738
|
-
style: _objectSpread$
|
|
20761
|
+
style: _objectSpread$S({
|
|
20739
20762
|
width: Math.max(72, px * 2.5),
|
|
20740
20763
|
height: Math.max(6, px / 6)
|
|
20741
20764
|
}, secondaryColor ? {
|
|
@@ -20754,9 +20777,9 @@ var Loader = /*#__PURE__*/forwardRef(function Loader(_ref, ref) {
|
|
|
20754
20777
|
}));
|
|
20755
20778
|
});
|
|
20756
20779
|
|
|
20757
|
-
var _excluded$
|
|
20758
|
-
function ownKeys$
|
|
20759
|
-
function _objectSpread$
|
|
20780
|
+
var _excluded$L = ["min", "max", "step", "minGap", "value", "defaultValue", "onChange", "onFinalChange", "showInputs", "showTooltips", "disabled", "presets", "formatValue", "className", "size", "colorClass", "ariaLabel"];
|
|
20781
|
+
function ownKeys$R(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
20782
|
+
function _objectSpread$R(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$R(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$R(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20760
20783
|
/**
|
|
20761
20784
|
* PriceRangePicker - dual-thumb range picker (Tailwind)
|
|
20762
20785
|
*
|
|
@@ -20839,7 +20862,7 @@ var PriceRangePicker = /*#__PURE__*/forwardRef(function PriceRangePicker(_ref, r
|
|
|
20839
20862
|
colorClass = _ref$colorClass === void 0 ? "bg-primary-600" : _ref$colorClass,
|
|
20840
20863
|
_ref$ariaLabel = _ref.ariaLabel,
|
|
20841
20864
|
ariaLabel = _ref$ariaLabel === void 0 ? "Price range" : _ref$ariaLabel,
|
|
20842
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
20865
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$L);
|
|
20843
20866
|
var isControlled = value && _typeof$4(value) === "object";
|
|
20844
20867
|
var _useState = useState(function () {
|
|
20845
20868
|
return isControlled ? {
|
|
@@ -20921,7 +20944,7 @@ var PriceRangePicker = /*#__PURE__*/forwardRef(function PriceRangePicker(_ref, r
|
|
|
20921
20944
|
var next = keyToValue(e.key, current[which], bounds);
|
|
20922
20945
|
if (next === null) return;
|
|
20923
20946
|
e.preventDefault();
|
|
20924
|
-
handleFinal(setValues(_objectSpread$
|
|
20947
|
+
handleFinal(setValues(_objectSpread$R(_objectSpread$R({}, current), {}, _defineProperty$4(_defineProperty$4({}, which, next), "_active", which))));
|
|
20925
20948
|
};
|
|
20926
20949
|
};
|
|
20927
20950
|
// Pointer drag on the track: grab the nearest thumb and follow the pointer.
|
|
@@ -20937,12 +20960,12 @@ var PriceRangePicker = /*#__PURE__*/forwardRef(function PriceRangePicker(_ref, r
|
|
|
20937
20960
|
var which = Math.abs(raw - current.min) < Math.abs(raw - current.max) || current.min === current.max && raw < current.min ? "min" : "max";
|
|
20938
20961
|
(_e$currentTarget$setP = (_e$currentTarget = e.currentTarget).setPointerCapture) === null || _e$currentTarget$setP === void 0 || _e$currentTarget$setP.call(_e$currentTarget, e.pointerId);
|
|
20939
20962
|
setDragging(which);
|
|
20940
|
-
setValues(_objectSpread$
|
|
20963
|
+
setValues(_objectSpread$R(_objectSpread$R({}, current), {}, _defineProperty$4(_defineProperty$4({}, which, raw), "_active", which)));
|
|
20941
20964
|
(_thumbRefs$current = thumbRefs[which === "min" ? 0 : 1].current) === null || _thumbRefs$current === void 0 || _thumbRefs$current.focus();
|
|
20942
20965
|
};
|
|
20943
20966
|
var onPointerMove = function onPointerMove(e) {
|
|
20944
20967
|
if (!dragging) return;
|
|
20945
|
-
setValues(_objectSpread$
|
|
20968
|
+
setValues(_objectSpread$R(_objectSpread$R({}, latest.current), {}, _defineProperty$4(_defineProperty$4({}, dragging, toValue(e.clientX)), "_active", dragging)));
|
|
20946
20969
|
};
|
|
20947
20970
|
var onPointerUp = function onPointerUp() {
|
|
20948
20971
|
if (!dragging) return;
|
|
@@ -20996,7 +21019,7 @@ var PriceRangePicker = /*#__PURE__*/forwardRef(function PriceRangePicker(_ref, r
|
|
|
20996
21019
|
vmin: current.min,
|
|
20997
21020
|
vmax: max
|
|
20998
21021
|
}];
|
|
20999
|
-
return jsxs("div", _objectSpread$
|
|
21022
|
+
return jsxs("div", _objectSpread$R(_objectSpread$R({
|
|
21000
21023
|
ref: ref,
|
|
21001
21024
|
className: cn("bg-surface rounded-lg p-4 w-full max-w-lg", className)
|
|
21002
21025
|
}, rest), {}, {
|
|
@@ -21110,9 +21133,9 @@ var PriceRangePicker = /*#__PURE__*/forwardRef(function PriceRangePicker(_ref, r
|
|
|
21110
21133
|
});
|
|
21111
21134
|
PriceRangePicker.displayName = "PriceRangePicker";
|
|
21112
21135
|
|
|
21113
|
-
var _excluded$
|
|
21114
|
-
function ownKeys$
|
|
21115
|
-
function _objectSpread$
|
|
21136
|
+
var _excluded$K = ["value", "max", "size", "showValue", "rounded", "variant", "striped", "animated", "label", "ariaLabel", "className", "style"];
|
|
21137
|
+
function ownKeys$Q(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21138
|
+
function _objectSpread$Q(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$Q(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$Q(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
21116
21139
|
// ProgressBar. Colours come only from role tokens, so it follows the brand and
|
|
21117
21140
|
// dark mode (STUDIO-59). The HEX props `color` / `bgColor` / `valueColor` were
|
|
21118
21141
|
// removed in 2.0.0 (DTUI-65); pick a token tone with `variant` instead.
|
|
@@ -21171,7 +21194,7 @@ var ProgressBar = /*#__PURE__*/forwardRef(function ProgressBar(_ref, ref) {
|
|
|
21171
21194
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
21172
21195
|
_ref$style = _ref.style,
|
|
21173
21196
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
21174
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
21197
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$K);
|
|
21175
21198
|
var safeMax = typeof max === 'number' && max > 0 ? max : 100;
|
|
21176
21199
|
var safeValue = typeof value === 'number' ? value : 0;
|
|
21177
21200
|
var clamped = Math.max(0, Math.min(safeValue, safeMax));
|
|
@@ -21193,10 +21216,10 @@ var ProgressBar = /*#__PURE__*/forwardRef(function ProgressBar(_ref, ref) {
|
|
|
21193
21216
|
// Stripe motion is a Tailwind animation (DTUI-48) — no per-instance <style> tag —
|
|
21194
21217
|
// and stops under prefers-reduced-motion, as does the width transition.
|
|
21195
21218
|
var animatedClass = animated ? 'animate-progress-stripes motion-reduce:animate-none' : '';
|
|
21196
|
-
var finalFillStyle = _objectSpread$
|
|
21219
|
+
var finalFillStyle = _objectSpread$Q({
|
|
21197
21220
|
width: "".concat(percent, "%")
|
|
21198
21221
|
}, stripeStyle);
|
|
21199
|
-
return jsxs("div", _objectSpread$
|
|
21222
|
+
return jsxs("div", _objectSpread$Q(_objectSpread$Q({
|
|
21200
21223
|
ref: ref,
|
|
21201
21224
|
className: cn("w-full", className),
|
|
21202
21225
|
style: style
|
|
@@ -22408,9 +22431,9 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
22408
22431
|
var propTypesExports = propTypes.exports;
|
|
22409
22432
|
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
22410
22433
|
|
|
22411
|
-
var _excluded$
|
|
22412
|
-
function ownKeys$
|
|
22413
|
-
function _objectSpread$
|
|
22434
|
+
var _excluded$J = ["id", "name", "value", "checked", "defaultChecked", "onChange", "disabled", "required", "label", "size", "labelPosition", "radioColor", "className", "ariaLabel"];
|
|
22435
|
+
function ownKeys$P(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22436
|
+
function _objectSpread$P(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$P(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$P(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22414
22437
|
var SIZE_MAP = {
|
|
22415
22438
|
sm: {
|
|
22416
22439
|
outer: "h-4 w-4",
|
|
@@ -22448,7 +22471,7 @@ var Radio = /*#__PURE__*/forwardRef(function Radio(_ref, ref) {
|
|
|
22448
22471
|
_ref$className = _ref.className,
|
|
22449
22472
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
22450
22473
|
ariaLabel = _ref.ariaLabel,
|
|
22451
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
22474
|
+
props = _objectWithoutProperties$1(_ref, _excluded$J);
|
|
22452
22475
|
var autoId = useId();
|
|
22453
22476
|
var inputId = id || "".concat(autoId, "-radio");
|
|
22454
22477
|
// Default to the brand's primary token so the radio follows theming.
|
|
@@ -22519,7 +22542,7 @@ var Radio = /*#__PURE__*/forwardRef(function Radio(_ref, ref) {
|
|
|
22519
22542
|
"aria-hidden": "true",
|
|
22520
22543
|
children: " *"
|
|
22521
22544
|
}) : null]
|
|
22522
|
-
}), jsx("input", _objectSpread$
|
|
22545
|
+
}), jsx("input", _objectSpread$P({
|
|
22523
22546
|
ref: setRefs,
|
|
22524
22547
|
id: inputId,
|
|
22525
22548
|
type: "radio",
|
|
@@ -22587,9 +22610,9 @@ Radio.defaultProps = {
|
|
|
22587
22610
|
required: false
|
|
22588
22611
|
};
|
|
22589
22612
|
|
|
22590
|
-
var _excluded$
|
|
22591
|
-
function ownKeys$
|
|
22592
|
-
function _objectSpread$
|
|
22613
|
+
var _excluded$I = ["count", "value", "defaultValue", "readOnly", "icon", "toggledIcon", "size", "onChange", "onClick", "text", "className", "id", "name"];
|
|
22614
|
+
function ownKeys$O(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22615
|
+
function _objectSpread$O(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$O(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$O(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22593
22616
|
function StarFilled(_ref) {
|
|
22594
22617
|
var _ref$size = _ref.size,
|
|
22595
22618
|
size = _ref$size === void 0 ? 20 : _ref$size;
|
|
@@ -22643,7 +22666,7 @@ var Rate = /*#__PURE__*/forwardRef(function Rate(_ref3, ref) {
|
|
|
22643
22666
|
className = _ref3$className === void 0 ? "" : _ref3$className,
|
|
22644
22667
|
id = _ref3.id,
|
|
22645
22668
|
name = _ref3.name,
|
|
22646
|
-
rest = _objectWithoutProperties$1(_ref3, _excluded$
|
|
22669
|
+
rest = _objectWithoutProperties$1(_ref3, _excluded$I);
|
|
22647
22670
|
var _useState = useState(Math.max(0, Math.min(count, Math.floor(defaultValue || 0)))),
|
|
22648
22671
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22649
22672
|
internalValue = _useState2[0],
|
|
@@ -22763,7 +22786,7 @@ var Rate = /*#__PURE__*/forwardRef(function Rate(_ref3, ref) {
|
|
|
22763
22786
|
if (target) target.focus();
|
|
22764
22787
|
if (next !== selectedValue) setValue(next);
|
|
22765
22788
|
};
|
|
22766
|
-
return jsxs("div", _objectSpread$
|
|
22789
|
+
return jsxs("div", _objectSpread$O(_objectSpread$O({
|
|
22767
22790
|
ref: ref,
|
|
22768
22791
|
id: id,
|
|
22769
22792
|
className: cn("inline-flex items-center gap-2", className),
|
|
@@ -22832,9 +22855,9 @@ var Rate = /*#__PURE__*/forwardRef(function Rate(_ref3, ref) {
|
|
|
22832
22855
|
});
|
|
22833
22856
|
Rate.displayName = "Rate";
|
|
22834
22857
|
|
|
22835
|
-
var _excluded$
|
|
22836
|
-
function ownKeys$
|
|
22837
|
-
function _objectSpread$
|
|
22858
|
+
var _excluded$H = ["label", "avatarSrc", "avatarAlt", "initials", "size", "onRemove", "onClick", "className", "closeClass", "ariaLabel", "onKeyDown", "avatarPosition", "avatarClassname", "initialClassname"];
|
|
22859
|
+
function ownKeys$N(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22860
|
+
function _objectSpread$N(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$N(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$N(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22838
22861
|
var RoundedTag = /*#__PURE__*/forwardRef(function RoundedTag(_ref, ref) {
|
|
22839
22862
|
var label = _ref.label,
|
|
22840
22863
|
_ref$avatarSrc = _ref.avatarSrc,
|
|
@@ -22861,7 +22884,7 @@ var RoundedTag = /*#__PURE__*/forwardRef(function RoundedTag(_ref, ref) {
|
|
|
22861
22884
|
avatarClassname = _ref$avatarClassname === void 0 ? "" : _ref$avatarClassname,
|
|
22862
22885
|
_ref$initialClassname = _ref.initialClassname,
|
|
22863
22886
|
initialClassname = _ref$initialClassname === void 0 ? "" : _ref$initialClassname,
|
|
22864
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
22887
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$H);
|
|
22865
22888
|
var showAvatar = Boolean(avatarSrc || initials);
|
|
22866
22889
|
var sizes = {
|
|
22867
22890
|
sm: {
|
|
@@ -22924,7 +22947,7 @@ var RoundedTag = /*#__PURE__*/forwardRef(function RoundedTag(_ref, ref) {
|
|
|
22924
22947
|
children: initials
|
|
22925
22948
|
})
|
|
22926
22949
|
});
|
|
22927
|
-
return jsxs("div", _objectSpread$
|
|
22950
|
+
return jsxs("div", _objectSpread$N(_objectSpread$N({
|
|
22928
22951
|
ref: ref,
|
|
22929
22952
|
className: cn("inline-flex items-center rounded-full bg-gray-100 text-primary-800 dark:bg-gray-800 dark:text-gray-100", paddingClass, gapClass, s.text, clickable && ["cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-1 dark:focus-visible:ring-offset-gray-900", PRESS_FEEDBACK], className),
|
|
22930
22953
|
role: clickable ? "button" : "group",
|
|
@@ -22961,9 +22984,9 @@ var RoundedTag = /*#__PURE__*/forwardRef(function RoundedTag(_ref, ref) {
|
|
|
22961
22984
|
});
|
|
22962
22985
|
RoundedTag.displayName = "RoundedTag";
|
|
22963
22986
|
|
|
22964
|
-
var _excluded$
|
|
22965
|
-
function ownKeys$
|
|
22966
|
-
function _objectSpread$
|
|
22987
|
+
var _excluded$G = ["count", "circle", "height", "width", "rounded", "animated", "active", "gap", "inline", "className", "children", "style"];
|
|
22988
|
+
function ownKeys$M(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
22989
|
+
function _objectSpread$M(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$M(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$M(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22967
22990
|
/**
|
|
22968
22991
|
* Skeleton Component (React)
|
|
22969
22992
|
*
|
|
@@ -23014,7 +23037,7 @@ var Skeleton = /*#__PURE__*/forwardRef(function Skeleton(_ref, ref) {
|
|
|
23014
23037
|
children = _ref$children === void 0 ? null : _ref$children,
|
|
23015
23038
|
_ref$style = _ref.style,
|
|
23016
23039
|
style = _ref$style === void 0 ? {} : _ref$style,
|
|
23017
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
23040
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$G);
|
|
23018
23041
|
if (!active) return jsx(Fragment, {
|
|
23019
23042
|
children: children
|
|
23020
23043
|
});
|
|
@@ -23025,13 +23048,13 @@ var Skeleton = /*#__PURE__*/forwardRef(function Skeleton(_ref, ref) {
|
|
|
23025
23048
|
var items = Array.from({
|
|
23026
23049
|
length: Math.max(1, Math.floor(count))
|
|
23027
23050
|
});
|
|
23028
|
-
return jsx("div", _objectSpread$
|
|
23051
|
+
return jsx("div", _objectSpread$M(_objectSpread$M({
|
|
23029
23052
|
ref: ref,
|
|
23030
23053
|
className: cn("skeleton-wrapper", className),
|
|
23031
23054
|
role: "status",
|
|
23032
23055
|
"aria-busy": active,
|
|
23033
23056
|
"aria-live": "polite",
|
|
23034
|
-
style: _objectSpread$
|
|
23057
|
+
style: _objectSpread$M({
|
|
23035
23058
|
display: "flex",
|
|
23036
23059
|
flexDirection: containerDirection,
|
|
23037
23060
|
gap: gap,
|
|
@@ -23055,12 +23078,12 @@ var Skeleton = /*#__PURE__*/forwardRef(function Skeleton(_ref, ref) {
|
|
|
23055
23078
|
});
|
|
23056
23079
|
Skeleton.displayName = "Skeleton";
|
|
23057
23080
|
|
|
23058
|
-
var _excluded$
|
|
23081
|
+
var _excluded$F = ["children", "defaultIndex", "index", "onChange", "orientation", "size", "variant", "animated", "swipeable", "className"],
|
|
23059
23082
|
_excluded2$6 = ["children", "className"];
|
|
23060
|
-
function ownKeys$
|
|
23061
|
-
function _objectSpread$
|
|
23083
|
+
function ownKeys$L(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23084
|
+
function _objectSpread$L(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$L(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$L(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23062
23085
|
// useLayoutEffect warns during SSR; fall back to useEffect on the server.
|
|
23063
|
-
var useIsomorphicLayoutEffect$
|
|
23086
|
+
var useIsomorphicLayoutEffect$7 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
23064
23087
|
// Minimum horizontal travel (px) for a swipe to change tabs, and how much more
|
|
23065
23088
|
// horizontal than vertical it must be, so vertical page scrolls never switch tabs.
|
|
23066
23089
|
var SWIPE_THRESHOLD = 50;
|
|
@@ -23129,7 +23152,7 @@ var Tabs = /*#__PURE__*/forwardRef(function Tabs(_ref, ref) {
|
|
|
23129
23152
|
swipeable = _ref$swipeable === void 0 ? false : _ref$swipeable,
|
|
23130
23153
|
_ref$className = _ref.className,
|
|
23131
23154
|
className = _ref$className === void 0 ? "" : _ref$className,
|
|
23132
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
23155
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$F);
|
|
23133
23156
|
var isControlled = controlledIndex != null;
|
|
23134
23157
|
var _useState = useState(defaultIndex),
|
|
23135
23158
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -23167,7 +23190,7 @@ var Tabs = /*#__PURE__*/forwardRef(function Tabs(_ref, ref) {
|
|
|
23167
23190
|
};
|
|
23168
23191
|
return jsx(TabsContext.Provider, {
|
|
23169
23192
|
value: value,
|
|
23170
|
-
children: jsx("div", _objectSpread$
|
|
23193
|
+
children: jsx("div", _objectSpread$L(_objectSpread$L({
|
|
23171
23194
|
ref: ref,
|
|
23172
23195
|
className: cn("tabs-root", className)
|
|
23173
23196
|
}, rest), {}, {
|
|
@@ -23202,7 +23225,7 @@ var TabList = /*#__PURE__*/forwardRef(function TabList(_ref2, ref) {
|
|
|
23202
23225
|
if (typeof ref === "function") ref(node);else if (ref) ref.current = node;
|
|
23203
23226
|
};
|
|
23204
23227
|
// Measure the active tab: position the indicator and scroll the tab into view.
|
|
23205
|
-
useIsomorphicLayoutEffect$
|
|
23228
|
+
useIsomorphicLayoutEffect$7(function () {
|
|
23206
23229
|
var list = listRef.current;
|
|
23207
23230
|
var tab = tabsRef.current[activeIndex];
|
|
23208
23231
|
if (!list || !tab) return undefined;
|
|
@@ -23236,7 +23259,7 @@ var TabList = /*#__PURE__*/forwardRef(function TabList(_ref2, ref) {
|
|
|
23236
23259
|
if (!hasIndicator && indicatorReady) setIndicatorReady(false);
|
|
23237
23260
|
}, [hasIndicator, indicatorReady, setIndicatorReady]);
|
|
23238
23261
|
var showIndicator = hasIndicator && indicatorReady && indicator;
|
|
23239
|
-
return jsxs("div", _objectSpread$
|
|
23262
|
+
return jsxs("div", _objectSpread$L(_objectSpread$L({
|
|
23240
23263
|
ref: setRefs,
|
|
23241
23264
|
role: "tablist",
|
|
23242
23265
|
"aria-orientation": orientation,
|
|
@@ -23436,7 +23459,7 @@ function Panels(_ref4) {
|
|
|
23436
23459
|
start.current = null;
|
|
23437
23460
|
}
|
|
23438
23461
|
} : {};
|
|
23439
|
-
return jsx("div", _objectSpread$
|
|
23462
|
+
return jsx("div", _objectSpread$L(_objectSpread$L({
|
|
23440
23463
|
// touch-pan-y: the browser keeps vertical scrolling; horizontal moves reach us.
|
|
23441
23464
|
className: cn("relative w-full", swipeable && "touch-pan-y", className)
|
|
23442
23465
|
}, swipeHandlers), {}, {
|
|
@@ -23487,9 +23510,9 @@ Tabs.Tab = Tab;
|
|
|
23487
23510
|
Tabs.Panels = Panels;
|
|
23488
23511
|
Tabs.Panel = Panel;
|
|
23489
23512
|
|
|
23490
|
-
var _excluded$
|
|
23491
|
-
function ownKeys$
|
|
23492
|
-
function _objectSpread$
|
|
23513
|
+
var _excluded$E = ["items", "trigger", "className", "menuClass", "menuItemClass", "closeOnSelect", "ariaLabel", "wrapperClassName", "presentation", "cancelLabel"];
|
|
23514
|
+
function ownKeys$K(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23515
|
+
function _objectSpread$K(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$K(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$K(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23493
23516
|
/**
|
|
23494
23517
|
* ThreeDotPopover
|
|
23495
23518
|
*
|
|
@@ -23526,7 +23549,7 @@ var ThreeDotPopoverSimple = /*#__PURE__*/forwardRef(function ThreeDotPopoverSimp
|
|
|
23526
23549
|
presentation = _ref$presentation === void 0 ? "auto" : _ref$presentation,
|
|
23527
23550
|
_ref$cancelLabel = _ref.cancelLabel,
|
|
23528
23551
|
cancelLabel = _ref$cancelLabel === void 0 ? "Cancel" : _ref$cancelLabel,
|
|
23529
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
23552
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$E);
|
|
23530
23553
|
var triggerRef = useRef(null);
|
|
23531
23554
|
var _useState = useState(null),
|
|
23532
23555
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -23581,7 +23604,7 @@ var ThreeDotPopoverSimple = /*#__PURE__*/forwardRef(function ThreeDotPopoverSimp
|
|
|
23581
23604
|
"aria-expanded": open,
|
|
23582
23605
|
"aria-controls": open ? menuId : undefined
|
|
23583
23606
|
};
|
|
23584
|
-
var DefaultTrigger = jsx("button", _objectSpread$
|
|
23607
|
+
var DefaultTrigger = jsx("button", _objectSpread$K(_objectSpread$K({
|
|
23585
23608
|
type: "button",
|
|
23586
23609
|
"aria-label": ariaLabel
|
|
23587
23610
|
}, triggerA11y), {}, {
|
|
@@ -23596,7 +23619,7 @@ var ThreeDotPopoverSimple = /*#__PURE__*/forwardRef(function ThreeDotPopoverSimp
|
|
|
23596
23619
|
var triggerNode = trigger ?
|
|
23597
23620
|
/*#__PURE__*/
|
|
23598
23621
|
// eslint-disable-next-line react-hooks/refs -- setTriggerNode is a callback ref, run by React at commit
|
|
23599
|
-
React__default.cloneElement(trigger, _objectSpread$
|
|
23622
|
+
React__default.cloneElement(trigger, _objectSpread$K({
|
|
23600
23623
|
ref: setTriggerNode,
|
|
23601
23624
|
onClick: function onClick(e) {
|
|
23602
23625
|
trigger.props && trigger.props.onClick && trigger.props.onClick(e);
|
|
@@ -23607,7 +23630,7 @@ var ThreeDotPopoverSimple = /*#__PURE__*/forwardRef(function ThreeDotPopoverSimp
|
|
|
23607
23630
|
if (!e.defaultPrevented) onTriggerKeyDown(e);
|
|
23608
23631
|
}
|
|
23609
23632
|
}, triggerA11y)) : DefaultTrigger;
|
|
23610
|
-
return jsxs("div", _objectSpread$
|
|
23633
|
+
return jsxs("div", _objectSpread$K(_objectSpread$K({
|
|
23611
23634
|
ref: ref,
|
|
23612
23635
|
className: cn("inline-block relative", wrapperClassName)
|
|
23613
23636
|
}, rest), {}, {
|
|
@@ -23632,9 +23655,9 @@ var ThreeDotPopoverSimple = /*#__PURE__*/forwardRef(function ThreeDotPopoverSimp
|
|
|
23632
23655
|
});
|
|
23633
23656
|
ThreeDotPopoverSimple.displayName = "ThreeDotPopover";
|
|
23634
23657
|
|
|
23635
|
-
var _excluded$
|
|
23636
|
-
function ownKeys$
|
|
23637
|
-
function _objectSpread$
|
|
23658
|
+
var _excluded$D = ["position", "trigger", "content", "customTrigger", "children", "open", "defaultOpen", "onChange", "delay", "offset", "textClass", "bgClass", "className", "portal", "id", "style"];
|
|
23659
|
+
function ownKeys$J(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
23660
|
+
function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$J(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$J(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
23638
23661
|
// Grace period (ms) before a hover tooltip closes after the pointer leaves the
|
|
23639
23662
|
// trigger, so the pointer can cross the `offset` gap onto the tooltip itself
|
|
23640
23663
|
// (WCAG 1.4.13 "hoverable").
|
|
@@ -23718,7 +23741,7 @@ var Tooltip = /*#__PURE__*/forwardRef(function Tooltip(_ref, forwardedRef) {
|
|
|
23718
23741
|
portal = _ref$portal === void 0 ? true : _ref$portal,
|
|
23719
23742
|
propsId = _ref.id,
|
|
23720
23743
|
style = _ref.style,
|
|
23721
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
23744
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$D);
|
|
23722
23745
|
var triggerRef = useRef(null);
|
|
23723
23746
|
var tooltipRef = useRef(null);
|
|
23724
23747
|
var delayRef = useRef(null);
|
|
@@ -24038,7 +24061,7 @@ var Tooltip = /*#__PURE__*/forwardRef(function Tooltip(_ref, forwardedRef) {
|
|
|
24038
24061
|
}
|
|
24039
24062
|
} : {};
|
|
24040
24063
|
// Tooltip box element
|
|
24041
|
-
var tooltipNode = open ? jsx("div", _objectSpread$
|
|
24064
|
+
var tooltipNode = open ? jsx("div", _objectSpread$J(_objectSpread$J(_objectSpread$J({
|
|
24042
24065
|
ref: function ref(node) {
|
|
24043
24066
|
return setRefs$1(node, tooltipRef, setFloating);
|
|
24044
24067
|
},
|
|
@@ -24047,7 +24070,7 @@ var Tooltip = /*#__PURE__*/forwardRef(function Tooltip(_ref, forwardedRef) {
|
|
|
24047
24070
|
"data-placement": placement
|
|
24048
24071
|
}, rest), tipHoverProps), {}, {
|
|
24049
24072
|
className: cn("z-tooltip transform-gpu transition-opacity duration-150 motion-reduce:transition-none", className),
|
|
24050
|
-
style: _objectSpread$
|
|
24073
|
+
style: _objectSpread$J(_objectSpread$J({}, floatingStyles), style),
|
|
24051
24074
|
children: jsx("div", {
|
|
24052
24075
|
className: cn("max-w-xs rounded-md border border-line px-3 py-2 text-sm shadow-lg shadow-black/5", bgClass, textClass),
|
|
24053
24076
|
children: renderContent()
|
|
@@ -24060,9 +24083,9 @@ var Tooltip = /*#__PURE__*/forwardRef(function Tooltip(_ref, forwardedRef) {
|
|
|
24060
24083
|
});
|
|
24061
24084
|
Tooltip.displayName = "Tooltip";
|
|
24062
24085
|
|
|
24063
|
-
var _excluded$
|
|
24064
|
-
function ownKeys$
|
|
24065
|
-
function _objectSpread$
|
|
24086
|
+
var _excluded$C = ["value", "onChange", "inputProps", "icon", "iconProps", "iconPosition", "placeholder", "fullWidth", "className"];
|
|
24087
|
+
function ownKeys$I(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24088
|
+
function _objectSpread$I(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$I(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$I(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24066
24089
|
// User-facing copy for GeolocationPositionError codes (and "unsupported").
|
|
24067
24090
|
var LOCATION_ERROR_MESSAGES = {
|
|
24068
24091
|
unsupported: "Location isn't available in this browser.",
|
|
@@ -24109,7 +24132,7 @@ var LocationPicker = /*#__PURE__*/forwardRef(function LocationPicker(_ref, ref)
|
|
|
24109
24132
|
_ref$fullWidth = _ref.fullWidth,
|
|
24110
24133
|
fullWidth = _ref$fullWidth === void 0 ? false : _ref$fullWidth,
|
|
24111
24134
|
className = _ref.className,
|
|
24112
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
24135
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$C);
|
|
24113
24136
|
var _useState = useState(function () {
|
|
24114
24137
|
return formatCoords(value);
|
|
24115
24138
|
}),
|
|
@@ -24235,7 +24258,7 @@ var LocationPicker = /*#__PURE__*/forwardRef(function LocationPicker(_ref, ref)
|
|
|
24235
24258
|
strokeLinecap: "round"
|
|
24236
24259
|
})]
|
|
24237
24260
|
});
|
|
24238
|
-
var iconButton = jsx("button", _objectSpread$
|
|
24261
|
+
var iconButton = jsx("button", _objectSpread$I(_objectSpread$I({
|
|
24239
24262
|
type: "button",
|
|
24240
24263
|
onClick: handleIconClick
|
|
24241
24264
|
}, iconProps), {}, {
|
|
@@ -24247,13 +24270,13 @@ var LocationPicker = /*#__PURE__*/forwardRef(function LocationPicker(_ref, ref)
|
|
|
24247
24270
|
}));
|
|
24248
24271
|
// The 44px touch target is wider than p-1, so leave room for it on coarse pointers.
|
|
24249
24272
|
var inputPaddingClass = iconPosition === "right" ? "pr-10 [@media(pointer:coarse)]:pr-12" : "pl-10 [@media(pointer:coarse)]:pl-12";
|
|
24250
|
-
return jsxs("div", _objectSpread$
|
|
24273
|
+
return jsxs("div", _objectSpread$I(_objectSpread$I({
|
|
24251
24274
|
className: cn(fullWidth ? "flex w-full flex-col" : "inline-flex flex-col", className),
|
|
24252
24275
|
"data-status": status
|
|
24253
24276
|
}, rest), {}, {
|
|
24254
24277
|
children: [jsxs("div", {
|
|
24255
24278
|
className: cn("relative", fullWidth && "w-full"),
|
|
24256
|
-
children: [jsx("input", _objectSpread$
|
|
24279
|
+
children: [jsx("input", _objectSpread$I(_objectSpread$I({
|
|
24257
24280
|
ref: ref,
|
|
24258
24281
|
type: "text",
|
|
24259
24282
|
placeholder: placeholder,
|
|
@@ -24281,9 +24304,9 @@ var LocationPicker = /*#__PURE__*/forwardRef(function LocationPicker(_ref, ref)
|
|
|
24281
24304
|
});
|
|
24282
24305
|
LocationPicker.displayName = "LocationPicker";
|
|
24283
24306
|
|
|
24284
|
-
var _excluded$
|
|
24285
|
-
function ownKeys$
|
|
24286
|
-
function _objectSpread$
|
|
24307
|
+
var _excluded$B = ["lang", "continuous", "interimResults", "onSpeechComplete", "onSpeaking", "onError", "onStart", "onStop", "renderButton", "autoStart", "disabled", "resetOnStart", "className"];
|
|
24308
|
+
function ownKeys$H(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24309
|
+
function _objectSpread$H(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$H(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$H(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24287
24310
|
// Level bars (DTUI-42). There is no audio-level API without getUserMedia, so the
|
|
24288
24311
|
// bars show *whether* speech is being heard (speechstart / results), not volume.
|
|
24289
24312
|
var LEVEL_BARS = [{
|
|
@@ -24329,7 +24352,7 @@ var SpeechToText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
24329
24352
|
_ref$resetOnStart = _ref.resetOnStart,
|
|
24330
24353
|
resetOnStart = _ref$resetOnStart === void 0 ? false : _ref$resetOnStart,
|
|
24331
24354
|
className = _ref.className,
|
|
24332
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
24355
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$B);
|
|
24333
24356
|
var recognitionRef = useRef(null);
|
|
24334
24357
|
var isMountedRef = useRef(true);
|
|
24335
24358
|
var autoStartedRef = useRef(false);
|
|
@@ -24508,7 +24531,7 @@ var SpeechToText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
24508
24531
|
});
|
|
24509
24532
|
}
|
|
24510
24533
|
var isDisabled = disabled || !_isSupported;
|
|
24511
|
-
return jsxs("button", _objectSpread$
|
|
24534
|
+
return jsxs("button", _objectSpread$H(_objectSpread$H({
|
|
24512
24535
|
type: "button",
|
|
24513
24536
|
"aria-pressed": _isListening,
|
|
24514
24537
|
"aria-label": _isListening ? "Stop listening" : "Start listening",
|
|
@@ -24552,9 +24575,9 @@ var SpeechToText = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
24552
24575
|
});
|
|
24553
24576
|
SpeechToText.displayName = "SpeechToText";
|
|
24554
24577
|
|
|
24555
|
-
var _excluded$
|
|
24556
|
-
function ownKeys$
|
|
24557
|
-
function _objectSpread$
|
|
24578
|
+
var _excluded$A = ["text", "rate", "pitch", "onSpeak", "onError", "renderButton", "disabled", "className"];
|
|
24579
|
+
function ownKeys$G(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24580
|
+
function _objectSpread$G(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$G(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$G(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24558
24581
|
var UNSUPPORTED_MESSAGE = "Text-to-speech is not supported in this browser";
|
|
24559
24582
|
// `interrupted` / `canceled` fire when playback is stopped on purpose (our own
|
|
24560
24583
|
// cancel(), or another utterance taking over) — not failures worth surfacing.
|
|
@@ -24577,7 +24600,7 @@ var TextToSpeech = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
24577
24600
|
_ref$disabled = _ref.disabled,
|
|
24578
24601
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
24579
24602
|
className = _ref.className,
|
|
24580
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
24603
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$A);
|
|
24581
24604
|
var _useState = useState(false),
|
|
24582
24605
|
_useState2 = _slicedToArray(_useState, 2),
|
|
24583
24606
|
isSpeaking = _useState2[0],
|
|
@@ -24665,7 +24688,7 @@ var TextToSpeech = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
24665
24688
|
stop: stop
|
|
24666
24689
|
});
|
|
24667
24690
|
}
|
|
24668
|
-
return jsxs("button", _objectSpread$
|
|
24691
|
+
return jsxs("button", _objectSpread$G(_objectSpread$G({
|
|
24669
24692
|
ref: ref,
|
|
24670
24693
|
type: "button",
|
|
24671
24694
|
onClick: handleClick,
|
|
@@ -24691,10 +24714,10 @@ var TextToSpeech = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
24691
24714
|
});
|
|
24692
24715
|
TextToSpeech.displayName = "TextToSpeech";
|
|
24693
24716
|
|
|
24694
|
-
var _excluded$
|
|
24695
|
-
function ownKeys$
|
|
24696
|
-
function _objectSpread$
|
|
24697
|
-
var useIsomorphicLayoutEffect$
|
|
24717
|
+
var _excluded$z = ["id", "className", "label", "error", "helperText", "required", "disabled", "showCount", "maxLength", "autoResize", "rows", "maxRows", "value", "defaultValue", "onChange", "size"];
|
|
24718
|
+
function ownKeys$F(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24719
|
+
function _objectSpread$F(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$F(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$F(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24720
|
+
var useIsomorphicLayoutEffect$6 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
24698
24721
|
function fitToContent(el, maxRows) {
|
|
24699
24722
|
if (!el) return;
|
|
24700
24723
|
el.style.height = "auto";
|
|
@@ -24740,7 +24763,7 @@ var Textarea = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
24740
24763
|
onChange = _ref.onChange,
|
|
24741
24764
|
_ref$size = _ref.size,
|
|
24742
24765
|
size = _ref$size === void 0 ? "md" : _ref$size,
|
|
24743
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
24766
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$z);
|
|
24744
24767
|
var reactId = useId();
|
|
24745
24768
|
var textareaId = id || "textarea-".concat(reactId);
|
|
24746
24769
|
var errorId = "".concat(textareaId, "-error");
|
|
@@ -24757,7 +24780,7 @@ var Textarea = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
24757
24780
|
uncontrolledLength = _useState2[0],
|
|
24758
24781
|
setUncontrolledLength = _useState2[1];
|
|
24759
24782
|
var length = isControlled ? String(value !== null && value !== void 0 ? value : "").length : uncontrolledLength;
|
|
24760
|
-
useIsomorphicLayoutEffect$
|
|
24783
|
+
useIsomorphicLayoutEffect$6(function () {
|
|
24761
24784
|
if (autoResize) fitToContent(localRef.current, maxRows);
|
|
24762
24785
|
}, [autoResize, maxRows, value]);
|
|
24763
24786
|
var handleChange = function handleChange(e) {
|
|
@@ -24776,7 +24799,7 @@ var Textarea = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
24776
24799
|
"aria-hidden": "true",
|
|
24777
24800
|
children: "*"
|
|
24778
24801
|
})]
|
|
24779
|
-
}), jsx("textarea", _objectSpread$
|
|
24802
|
+
}), jsx("textarea", _objectSpread$F(_objectSpread$F({}, rest), {}, {
|
|
24780
24803
|
id: textareaId,
|
|
24781
24804
|
ref: setRef,
|
|
24782
24805
|
rows: rows,
|
|
@@ -24817,9 +24840,9 @@ var Textarea = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
|
|
24817
24840
|
});
|
|
24818
24841
|
Textarea.displayName = "Textarea";
|
|
24819
24842
|
|
|
24820
|
-
var _excluded$
|
|
24821
|
-
function ownKeys$
|
|
24822
|
-
function _objectSpread$
|
|
24843
|
+
var _excluded$y = ["trigger", "children", "open", "defaultOpen", "onOpenChange", "placement", "offset", "title", "initialFocusRef", "disabled", "presentation", "id", "className", "style"];
|
|
24844
|
+
function ownKeys$E(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
24845
|
+
function _objectSpread$E(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$E(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$E(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24823
24846
|
function useOutsideClose(open, anchorRef, panelRef, close) {
|
|
24824
24847
|
useEffect(function () {
|
|
24825
24848
|
if (!open) return undefined;
|
|
@@ -24857,7 +24880,7 @@ var Popover = /*#__PURE__*/React__default.forwardRef(function (_ref, _ref2) {
|
|
|
24857
24880
|
idProp = _ref.id,
|
|
24858
24881
|
className = _ref.className,
|
|
24859
24882
|
style = _ref.style,
|
|
24860
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
24883
|
+
props = _objectWithoutProperties$1(_ref, _excluded$y);
|
|
24861
24884
|
var anchorRef = useRef(null);
|
|
24862
24885
|
var panelRef = useRef(null);
|
|
24863
24886
|
var reactId = useId();
|
|
@@ -24945,7 +24968,7 @@ var Popover = /*#__PURE__*/React__default.forwardRef(function (_ref, _ref2) {
|
|
|
24945
24968
|
// backdrop, the modal focus trap, Escape and focus return.
|
|
24946
24969
|
if (asSheet) {
|
|
24947
24970
|
return jsxs(Fragment, {
|
|
24948
|
-
children: [anchor, jsx(Sheet, _objectSpread$
|
|
24971
|
+
children: [anchor, jsx(Sheet, _objectSpread$E(_objectSpread$E({
|
|
24949
24972
|
ref: _ref2,
|
|
24950
24973
|
open: open,
|
|
24951
24974
|
onClose: close,
|
|
@@ -24963,7 +24986,7 @@ var Popover = /*#__PURE__*/React__default.forwardRef(function (_ref, _ref2) {
|
|
|
24963
24986
|
});
|
|
24964
24987
|
}
|
|
24965
24988
|
return jsxs(Fragment, {
|
|
24966
|
-
children: [anchor, open && typeof document !== "undefined" && /*#__PURE__*/createPortal(jsxs("div", _objectSpread$
|
|
24989
|
+
children: [anchor, open && typeof document !== "undefined" && /*#__PURE__*/createPortal(jsxs("div", _objectSpread$E(_objectSpread$E({
|
|
24967
24990
|
ref: function ref(node) {
|
|
24968
24991
|
return setRefs$1(node, panelRef, _ref2, setFloating);
|
|
24969
24992
|
},
|
|
@@ -24975,7 +24998,7 @@ var Popover = /*#__PURE__*/React__default.forwardRef(function (_ref, _ref2) {
|
|
|
24975
24998
|
"data-side": resolvedPlacement.split("-")[0],
|
|
24976
24999
|
"data-presentation": "popover",
|
|
24977
25000
|
className: cn("z-popover min-w-[12rem] max-w-sm rounded-lg border border-gray-200 bg-white p-4 text-sm text-gray-900 shadow-lg focus:outline-none", "dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100", "animate-fade-in motion-reduce:animate-none", className),
|
|
24978
|
-
style: _objectSpread$
|
|
25001
|
+
style: _objectSpread$E(_objectSpread$E({}, floatingStyles), style)
|
|
24979
25002
|
}, props), {}, {
|
|
24980
25003
|
children: [title && jsx("h2", {
|
|
24981
25004
|
id: titleId,
|
|
@@ -24987,11 +25010,11 @@ var Popover = /*#__PURE__*/React__default.forwardRef(function (_ref, _ref2) {
|
|
|
24987
25010
|
});
|
|
24988
25011
|
Popover.displayName = "Popover";
|
|
24989
25012
|
|
|
24990
|
-
var _excluded$
|
|
24991
|
-
function ownKeys$
|
|
24992
|
-
function _objectSpread$
|
|
25013
|
+
var _excluded$x = ["options", "value", "defaultValue", "onChange", "size", "fullWidth", "name", "disabled", "className"];
|
|
25014
|
+
function ownKeys$D(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25015
|
+
function _objectSpread$D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$D(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
24993
25016
|
// useLayoutEffect warns during SSR; fall back to useEffect on the server.
|
|
24994
|
-
var useIsomorphicLayoutEffect$
|
|
25017
|
+
var useIsomorphicLayoutEffect$5 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
24995
25018
|
// Same padding / type scale as `Tabs` segments, so the two read as one control.
|
|
24996
25019
|
var SIZE_CLASSES = {
|
|
24997
25020
|
sm: "px-2 py-1 text-sm",
|
|
@@ -25038,7 +25061,7 @@ var SegmentedControl = /*#__PURE__*/forwardRef(function SegmentedControl(_ref, _
|
|
|
25038
25061
|
_ref$disabled = _ref.disabled,
|
|
25039
25062
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
25040
25063
|
className = _ref.className,
|
|
25041
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
25064
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$x);
|
|
25042
25065
|
var _useControllableState = useControllableState({
|
|
25043
25066
|
value: valueProp,
|
|
25044
25067
|
defaultValue: defaultValue,
|
|
@@ -25061,7 +25084,7 @@ var SegmentedControl = /*#__PURE__*/forwardRef(function SegmentedControl(_ref, _
|
|
|
25061
25084
|
var tabbableIndex = selectedEnabled ? selectedIndex : firstEnabled;
|
|
25062
25085
|
// Measure the selected option and move the thumb under it. Runs before paint,
|
|
25063
25086
|
// so the thumb never flashes; the CSS transition animates the slide.
|
|
25064
|
-
useIsomorphicLayoutEffect$
|
|
25087
|
+
useIsomorphicLayoutEffect$5(function () {
|
|
25065
25088
|
var root = rootRef.current;
|
|
25066
25089
|
var option = optionRefs.current[selectedIndex];
|
|
25067
25090
|
if (!root || !option) return undefined;
|
|
@@ -25114,7 +25137,7 @@ var SegmentedControl = /*#__PURE__*/forwardRef(function SegmentedControl(_ref, _
|
|
|
25114
25137
|
(_optionRefs$current$t = optionRefs.current[target]) === null || _optionRefs$current$t === void 0 || _optionRefs$current$t.focus();
|
|
25115
25138
|
select(target);
|
|
25116
25139
|
};
|
|
25117
|
-
return jsxs("div", _objectSpread$
|
|
25140
|
+
return jsxs("div", _objectSpread$D(_objectSpread$D({
|
|
25118
25141
|
ref: function ref(node) {
|
|
25119
25142
|
return setRefs$1(node, rootRef, _ref2);
|
|
25120
25143
|
},
|
|
@@ -25168,9 +25191,9 @@ var SegmentedControl = /*#__PURE__*/forwardRef(function SegmentedControl(_ref, _
|
|
|
25168
25191
|
});
|
|
25169
25192
|
SegmentedControl.displayName = "SegmentedControl";
|
|
25170
25193
|
|
|
25171
|
-
var _excluded$
|
|
25172
|
-
function ownKeys$
|
|
25173
|
-
function _objectSpread$
|
|
25194
|
+
var _excluded$w = ["value", "defaultValue", "onChange", "onValueChange", "onSearch", "onCancel", "onClear", "placeholder", "cancelLabel", "clearLabel", "showCancel", "presentation", "results", "renderResults", "resultsOpen", "onResultsOpenChange", "resultsLabel", "disabled", "readOnly", "className", "inputClassName", "style", "onFocus", "onBlur", "onKeyDown", "onClick", "aria-label"];
|
|
25195
|
+
function ownKeys$C(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25196
|
+
function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$C(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$C(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25174
25197
|
// iOS-style search field (DTUI-58): leading icon, clear button, a "Cancel"
|
|
25175
25198
|
// text button on phones while focused, and an optional results surface that
|
|
25176
25199
|
// is a full-height Sheet on phones and a popover beneath the field elsewhere.
|
|
@@ -25230,7 +25253,7 @@ var SearchField = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
25230
25253
|
onKeyDown = _ref.onKeyDown,
|
|
25231
25254
|
onClick = _ref.onClick,
|
|
25232
25255
|
ariaLabel = _ref["aria-label"],
|
|
25233
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
25256
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$w);
|
|
25234
25257
|
var _useControllableState = useControllableState({
|
|
25235
25258
|
value: valueProp,
|
|
25236
25259
|
defaultValue: defaultValue,
|
|
@@ -25405,7 +25428,7 @@ var SearchField = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
25405
25428
|
onChange: handleChange,
|
|
25406
25429
|
"aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : rest["aria-labelledby"] ? undefined : placeholder || "Search"
|
|
25407
25430
|
};
|
|
25408
|
-
var inlineInput = jsx("input", _objectSpread$
|
|
25431
|
+
var inlineInput = jsx("input", _objectSpread$C(_objectSpread$C(_objectSpread$C({
|
|
25409
25432
|
ref: inputCallbackRef
|
|
25410
25433
|
}, sharedInputProps), {}, {
|
|
25411
25434
|
"aria-controls": popoverOpen ? resultsId : undefined,
|
|
@@ -25446,7 +25469,7 @@ var SearchField = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
25446
25469
|
className: "flex shrink-0 items-center gap-2 border-b border-line px-4 py-3",
|
|
25447
25470
|
children: renderRow({
|
|
25448
25471
|
inSheet: true,
|
|
25449
|
-
inputProps: jsx("input", _objectSpread$
|
|
25472
|
+
inputProps: jsx("input", _objectSpread$C(_objectSpread$C({
|
|
25450
25473
|
ref: sheetInputRef
|
|
25451
25474
|
}, sharedInputProps), {}, {
|
|
25452
25475
|
"aria-controls": resultsId,
|
|
@@ -25467,9 +25490,9 @@ var SearchField = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
25467
25490
|
});
|
|
25468
25491
|
SearchField.displayName = "SearchField";
|
|
25469
25492
|
|
|
25470
|
-
var _excluded$
|
|
25471
|
-
function ownKeys$
|
|
25472
|
-
function _objectSpread$
|
|
25493
|
+
var _excluded$v = ["items", "collapsed", "collapsible", "onToggle", "className", "containerClassName", "stickyOffset", "logo", "footer", "user", "onUserClick", "drawerPosition", "isMobileOpen", "setIsMobileOpen", "showCollapsedTooltips", "tooltipOptions", "linkAs", "expandedIds", "defaultExpandedIds", "onExpandedChange", "swipeable"];
|
|
25494
|
+
function ownKeys$B(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25495
|
+
function _objectSpread$B(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$B(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$B(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
25473
25496
|
// From `md` up the sidebar is an in-flow sticky column; below it, the same
|
|
25474
25497
|
// tree becomes an off-canvas drawer (modal dialog while open).
|
|
25475
25498
|
var SIDEBAR_DESKTOP_QUERY = "(min-width: 768px)";
|
|
@@ -25570,7 +25593,7 @@ function useEdgeSwipe(_ref) {
|
|
|
25570
25593
|
return enabled ? distance : 0;
|
|
25571
25594
|
}
|
|
25572
25595
|
// useLayoutEffect warns during SSR; fall back to useEffect on the server.
|
|
25573
|
-
var useIsomorphicLayoutEffect$
|
|
25596
|
+
var useIsomorphicLayoutEffect$4 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
25574
25597
|
// Ctrl/Cmd/Shift/Alt-click or a non-primary button: the browser opens the
|
|
25575
25598
|
// link in a new tab/window, so the sidebar must not react as if navigating.
|
|
25576
25599
|
var isModifiedClick = function isModifiedClick(e) {
|
|
@@ -25636,6 +25659,8 @@ var hasBadge$1 = function hasBadge(item) {
|
|
|
25636
25659
|
* - linkAs: element type used for items with `href` (default "a"; pass Next.js Link etc.)
|
|
25637
25660
|
* - collapsed: boolean (desktop collapsed)
|
|
25638
25661
|
* - onToggle: function to toggle collapse
|
|
25662
|
+
* - collapsible: boolean (default true) — false hides the md+ collapse/expand
|
|
25663
|
+
* toggle (the drawer keeps its "Close navigation" button)
|
|
25639
25664
|
* - expandedIds / defaultExpandedIds / onExpandedChange: open groups (ids)
|
|
25640
25665
|
* - className, containerClassName, stickyOffset, logo, footer, user, onUserClick
|
|
25641
25666
|
* - drawerPosition: 'left' | 'right'
|
|
@@ -25652,6 +25677,8 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
25652
25677
|
items = _ref2$items === void 0 ? [] : _ref2$items,
|
|
25653
25678
|
_ref2$collapsed = _ref2.collapsed,
|
|
25654
25679
|
collapsed = _ref2$collapsed === void 0 ? false : _ref2$collapsed,
|
|
25680
|
+
_ref2$collapsible = _ref2.collapsible,
|
|
25681
|
+
collapsible = _ref2$collapsible === void 0 ? true : _ref2$collapsible,
|
|
25655
25682
|
onToggle = _ref2.onToggle,
|
|
25656
25683
|
className = _ref2.className,
|
|
25657
25684
|
containerClassName = _ref2.containerClassName,
|
|
@@ -25675,7 +25702,7 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
25675
25702
|
onExpandedChange = _ref2.onExpandedChange,
|
|
25676
25703
|
_ref2$swipeable = _ref2.swipeable,
|
|
25677
25704
|
swipeable = _ref2$swipeable === void 0 ? true : _ref2$swipeable,
|
|
25678
|
-
props = _objectWithoutProperties$1(_ref2, _excluded$
|
|
25705
|
+
props = _objectWithoutProperties$1(_ref2, _excluded$v);
|
|
25679
25706
|
// -- expansion (controlled via `expandedIds`, else internal) ----------------
|
|
25680
25707
|
var isExpansionControlled = expandedIds !== undefined;
|
|
25681
25708
|
var activeAncestors = useMemo(function () {
|
|
@@ -25744,7 +25771,7 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
25744
25771
|
// The drawer stays mounted (it slides in/out), so when it is shut it must
|
|
25745
25772
|
// leave the tab order and the a11y tree. `inert` is set imperatively: React
|
|
25746
25773
|
// 18 does not know the attribute and React 19 treats `inert=""` as false.
|
|
25747
|
-
useIsomorphicLayoutEffect$
|
|
25774
|
+
useIsomorphicLayoutEffect$4(function () {
|
|
25748
25775
|
var drawer = drawerRef.current;
|
|
25749
25776
|
if (!drawer) return;
|
|
25750
25777
|
if (drawerMode && !mobileOpen) drawer.setAttribute("inert", "");else drawer.removeAttribute("inert");
|
|
@@ -25865,7 +25892,7 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
25865
25892
|
className: "relative h-4 w-0",
|
|
25866
25893
|
children: compactBadge
|
|
25867
25894
|
});
|
|
25868
|
-
var itemEl = jsxs(ItemTag, _objectSpread$
|
|
25895
|
+
var itemEl = jsxs(ItemTag, _objectSpread$B(_objectSpread$B({}, hasHref ? {
|
|
25869
25896
|
href: item.href,
|
|
25870
25897
|
target: item.target,
|
|
25871
25898
|
rel: (_item$rel = item.rel) !== null && _item$rel !== void 0 ? _item$rel : item.target === "_blank" ? "noopener noreferrer" : undefined,
|
|
@@ -25928,7 +25955,7 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
25928
25955
|
}));
|
|
25929
25956
|
return jsxs("div", {
|
|
25930
25957
|
className: "relative",
|
|
25931
|
-
children: [showTooltipForThis ? jsx(Tooltip, _objectSpread$
|
|
25958
|
+
children: [showTooltipForThis ? jsx(Tooltip, _objectSpread$B(_objectSpread$B({}, tooltipOptions), {}, {
|
|
25932
25959
|
trigger: "hover",
|
|
25933
25960
|
content: item.label,
|
|
25934
25961
|
position: "right",
|
|
@@ -25983,6 +26010,9 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
25983
26010
|
if (drawerMode && mobileOpen && setIsMobileOpen) setIsMobileOpen(false);else onToggle === null || onToggle === void 0 || onToggle();
|
|
25984
26011
|
};
|
|
25985
26012
|
var toggleLabel = drawerMode ? "Close navigation" : effectiveCollapsed ? "Expand sidebar" : "Collapse sidebar";
|
|
26013
|
+
// `collapsible={false}`: no collapse/expand toggle on md+. The drawer keeps
|
|
26014
|
+
// its close button (44px touch target, the drawer's only visible close).
|
|
26015
|
+
var showToggle = drawerMode || collapsible;
|
|
25986
26016
|
var CloseChevron = isRight ? ChevronRight : ChevronLeft;
|
|
25987
26017
|
var toggleIcon = drawerMode ? jsx(CloseChevron, {
|
|
25988
26018
|
className: "h-5 w-5",
|
|
@@ -26049,7 +26079,7 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
26049
26079
|
children: [!effectiveCollapsed && logo && jsx("div", {
|
|
26050
26080
|
className: "flex min-w-0 items-center",
|
|
26051
26081
|
children: logo
|
|
26052
|
-
}), jsx("button", {
|
|
26082
|
+
}), showToggle && jsx("button", {
|
|
26053
26083
|
type: "button",
|
|
26054
26084
|
onClick: handleToggleClick,
|
|
26055
26085
|
className: cn("inline-flex h-11 w-11 shrink-0 items-center justify-center rounded-md", "hover:bg-gray-100 dark:hover:bg-gray-800", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"),
|
|
@@ -26100,7 +26130,7 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
26100
26130
|
},
|
|
26101
26131
|
"aria-hidden": "true",
|
|
26102
26132
|
"data-sidebar-backdrop": ""
|
|
26103
|
-
}), jsx("aside", _objectSpread$
|
|
26133
|
+
}), jsx("aside", _objectSpread$B(_objectSpread$B(_objectSpread$B({
|
|
26104
26134
|
ref: drawerRef,
|
|
26105
26135
|
className: drawerClasses,
|
|
26106
26136
|
style: drawerTransform ? {
|
|
@@ -26115,7 +26145,7 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
26115
26145
|
"aria-hidden": mobileOpen ? undefined : true,
|
|
26116
26146
|
tabIndex: -1
|
|
26117
26147
|
} : {}), closeDrag.bodyDragProps), {}, {
|
|
26118
|
-
children: jsx("div", _objectSpread$
|
|
26148
|
+
children: jsx("div", _objectSpread$B(_objectSpread$B({
|
|
26119
26149
|
ref: ref,
|
|
26120
26150
|
className: cn("h-full", className)
|
|
26121
26151
|
}, props), {}, {
|
|
@@ -26126,9 +26156,9 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
26126
26156
|
});
|
|
26127
26157
|
Sidebar.displayName = "Sidebar";
|
|
26128
26158
|
|
|
26129
|
-
var _excluded$
|
|
26130
|
-
function ownKeys$
|
|
26131
|
-
function _objectSpread$
|
|
26159
|
+
var _excluded$u = ["trigger", "children", "placement", "className"];
|
|
26160
|
+
function ownKeys$A(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26161
|
+
function _objectSpread$A(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$A(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$A(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26132
26162
|
var Dropdown = function Dropdown(_ref) {
|
|
26133
26163
|
var trigger = _ref.trigger,
|
|
26134
26164
|
children = _ref.children,
|
|
@@ -26136,7 +26166,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
26136
26166
|
placement = _ref$placement === void 0 ? 'bottom-start' : _ref$placement,
|
|
26137
26167
|
_ref$className = _ref.className,
|
|
26138
26168
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
26139
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
26169
|
+
props = _objectWithoutProperties$1(_ref, _excluded$u);
|
|
26140
26170
|
var _useState = useState(false),
|
|
26141
26171
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26142
26172
|
isOpen = _useState2[0],
|
|
@@ -26159,7 +26189,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
26159
26189
|
'top-start': 'bottom-full left-0 mb-1',
|
|
26160
26190
|
'top-end': 'bottom-full right-0 mb-1'
|
|
26161
26191
|
};
|
|
26162
|
-
return jsxs("div", _objectSpread$
|
|
26192
|
+
return jsxs("div", _objectSpread$A(_objectSpread$A({
|
|
26163
26193
|
className: "relative inline-block ".concat(className),
|
|
26164
26194
|
ref: dropdownRef
|
|
26165
26195
|
}, props), {}, {
|
|
@@ -26175,9 +26205,9 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
26175
26205
|
}));
|
|
26176
26206
|
};
|
|
26177
26207
|
|
|
26178
|
-
var _excluded$
|
|
26179
|
-
function ownKeys$
|
|
26180
|
-
function _objectSpread$
|
|
26208
|
+
var _excluded$t = ["src", "alt", "name", "size", "shape", "status", "className"];
|
|
26209
|
+
function ownKeys$z(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26210
|
+
function _objectSpread$z(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$z(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$z(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26181
26211
|
// Internal (not exported from the package): shared with AvatarGroup's "+N" tile.
|
|
26182
26212
|
var AVATAR_SIZES = {
|
|
26183
26213
|
xs: 'h-6 w-6 text-xs',
|
|
@@ -26197,7 +26227,7 @@ var Avatar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
26197
26227
|
shape = _ref$shape === void 0 ? 'circle' : _ref$shape,
|
|
26198
26228
|
status = _ref.status,
|
|
26199
26229
|
className = _ref.className,
|
|
26200
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
26230
|
+
props = _objectWithoutProperties$1(_ref, _excluded$t);
|
|
26201
26231
|
// State-driven fallback: a broken image swaps to initials / icon without
|
|
26202
26232
|
// touching the DOM directly. Reset whenever `src` changes
|
|
26203
26233
|
// (adjust-during-render pattern).
|
|
@@ -26238,7 +26268,7 @@ var Avatar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
26238
26268
|
return jsxs("div", {
|
|
26239
26269
|
ref: ref,
|
|
26240
26270
|
className: "relative inline-block",
|
|
26241
|
-
children: [jsx("div", _objectSpread$
|
|
26271
|
+
children: [jsx("div", _objectSpread$z(_objectSpread$z({
|
|
26242
26272
|
className: cn('flex items-center justify-center bg-gray-100 text-primary-600 font-medium dark:bg-gray-800 dark:text-primary-300', sizes[size], {
|
|
26243
26273
|
'rounded-full': shape === 'circle',
|
|
26244
26274
|
'rounded-md': shape === 'square',
|
|
@@ -26273,10 +26303,11 @@ var Avatar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
26273
26303
|
});
|
|
26274
26304
|
Avatar.displayName = 'Avatar';
|
|
26275
26305
|
|
|
26276
|
-
var _excluded$
|
|
26277
|
-
_excluded2$5 = ["emitter", "logo", "center", "items", "user", "notifications", "searchable", "onSearch", "leftIcon", "rightMenuContent", "onLeftIconClick", "onLoginClick", "onLogoutClick", "className", "onFetch", "isMobileOpen", "setIsMobileOpen", "sticky", "largeTitle"]
|
|
26278
|
-
|
|
26279
|
-
function
|
|
26306
|
+
var _excluded$s = ["emitter", "content", "notifications"],
|
|
26307
|
+
_excluded2$5 = ["emitter", "logo", "center", "items", "user", "notifications", "searchable", "onSearch", "leftIcon", "rightMenuContent", "onLeftIconClick", "leftIconLabel", "leftIconProps", "onLoginClick", "onLogoutClick", "className", "onFetch", "isMobileOpen", "setIsMobileOpen", "sticky", "largeTitle"],
|
|
26308
|
+
_excluded3$3 = ["className", "onClick"];
|
|
26309
|
+
function ownKeys$y(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26310
|
+
function _objectSpread$y(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$y(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$y(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26280
26311
|
var NO_NOTIFICATIONS = [];
|
|
26281
26312
|
// Icon-only bar buttons: 36px on desktop, the 44px touch target on coarse pointers.
|
|
26282
26313
|
var ICON_BUTTON = cn("inline-flex items-center justify-center rounded-md p-2 text-primary-400 hover:text-primary-500 hover:bg-gray-100 dark:hover:bg-gray-800", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500", TOUCH_TARGET);
|
|
@@ -26474,10 +26505,10 @@ var RightMenuContent = function RightMenuContent(_ref2) {
|
|
|
26474
26505
|
_ref2.content;
|
|
26475
26506
|
var _ref2$notifications = _ref2.notifications,
|
|
26476
26507
|
notifications = _ref2$notifications === void 0 ? [] : _ref2$notifications,
|
|
26477
|
-
props = _objectWithoutProperties$1(_ref2, _excluded$
|
|
26508
|
+
props = _objectWithoutProperties$1(_ref2, _excluded$s);
|
|
26478
26509
|
return jsx("div", {
|
|
26479
26510
|
className: "relative",
|
|
26480
|
-
children: jsx(NotificationsDropdown, _objectSpread$
|
|
26511
|
+
children: jsx(NotificationsDropdown, _objectSpread$y({
|
|
26481
26512
|
emitter: emitter,
|
|
26482
26513
|
notifications: notifications
|
|
26483
26514
|
}, props))
|
|
@@ -26505,6 +26536,9 @@ var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
26505
26536
|
leftIcon = _ref3$leftIcon === void 0 ? jsx(ChevronLeft, {}) : _ref3$leftIcon,
|
|
26506
26537
|
RightMenuContentProp = _ref3.rightMenuContent,
|
|
26507
26538
|
onLeftIconClick = _ref3.onLeftIconClick,
|
|
26539
|
+
_ref3$leftIconLabel = _ref3.leftIconLabel,
|
|
26540
|
+
leftIconLabel = _ref3$leftIconLabel === void 0 ? "Go back" : _ref3$leftIconLabel,
|
|
26541
|
+
leftIconProps = _ref3.leftIconProps,
|
|
26508
26542
|
_ref3$onLoginClick = _ref3.onLoginClick,
|
|
26509
26543
|
onLoginClick = _ref3$onLoginClick === void 0 ? function () {
|
|
26510
26544
|
return console.log("invoked onLoginClick");
|
|
@@ -26551,6 +26585,18 @@ var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
26551
26585
|
window.removeEventListener("resize", handleResize);
|
|
26552
26586
|
};
|
|
26553
26587
|
}, [handleResize]);
|
|
26588
|
+
// Left button: `leftIconLabel` names it ("Go back" by default; e.g. "Open
|
|
26589
|
+
// menu" when it opens a Sidebar drawer). `leftIconProps` lands on the
|
|
26590
|
+
// <button> (aria-expanded, aria-controls, data-*, …); its className merges
|
|
26591
|
+
// last and its onClick runs after `onLeftIconClick`.
|
|
26592
|
+
var _ref4 = leftIconProps || {},
|
|
26593
|
+
leftIconClassName = _ref4.className,
|
|
26594
|
+
leftIconOnClick = _ref4.onClick,
|
|
26595
|
+
leftIconRest = _objectWithoutProperties$1(_ref4, _excluded3$3);
|
|
26596
|
+
var handleLeftIconClick = function handleLeftIconClick(e) {
|
|
26597
|
+
onLeftIconClick === null || onLeftIconClick === void 0 || onLeftIconClick(e);
|
|
26598
|
+
leftIconOnClick === null || leftIconOnClick === void 0 || leftIconOnClick(e);
|
|
26599
|
+
};
|
|
26554
26600
|
// Handle search submit
|
|
26555
26601
|
var handleSearch = function handleSearch(e) {
|
|
26556
26602
|
e.preventDefault();
|
|
@@ -26597,11 +26643,11 @@ var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
26597
26643
|
};
|
|
26598
26644
|
// RightMenuContent: prefer prop if provided, else fallback
|
|
26599
26645
|
var RightMenuComponent = typeof RightMenuContentProp === "function" ? RightMenuContentProp : function (rest) {
|
|
26600
|
-
return jsx(RightMenuContent, _objectSpread$
|
|
26646
|
+
return jsx(RightMenuContent, _objectSpread$y({
|
|
26601
26647
|
emitter: emitter
|
|
26602
26648
|
}, rest));
|
|
26603
26649
|
};
|
|
26604
|
-
return jsxs("nav", _objectSpread$
|
|
26650
|
+
return jsxs("nav", _objectSpread$y(_objectSpread$y({
|
|
26605
26651
|
ref: ref,
|
|
26606
26652
|
className: cn("bg-surface text-foreground border-b border-line px-4 sm:px-6 lg:px-8", sticky && "sticky top-0 z-sticky pt-safe supports-[backdrop-filter]:bg-surface/80 supports-[backdrop-filter]:backdrop-blur", className),
|
|
26607
26653
|
"data-sticky": sticky ? "" : undefined
|
|
@@ -26620,13 +26666,14 @@ var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
26620
26666
|
"aria-hidden": true
|
|
26621
26667
|
}), jsxs("div", {
|
|
26622
26668
|
className: "flex min-w-0 items-center",
|
|
26623
|
-
children: [leftIcon !== false && jsx("button", {
|
|
26624
|
-
onClick: onLeftIconClick,
|
|
26669
|
+
children: [leftIcon !== false && jsx("button", _objectSpread$y(_objectSpread$y({
|
|
26625
26670
|
type: "button",
|
|
26626
|
-
|
|
26627
|
-
|
|
26671
|
+
"aria-label": leftIconLabel
|
|
26672
|
+
}, leftIconRest), {}, {
|
|
26673
|
+
onClick: handleLeftIconClick,
|
|
26674
|
+
className: cn(ICON_BUTTON, "shrink-0 md:hidden", leftIconClassName),
|
|
26628
26675
|
children: leftIcon
|
|
26629
|
-
}), logo && jsx("div", {
|
|
26676
|
+
})), logo && jsx("div", {
|
|
26630
26677
|
className: "ml-2 min-w-0 truncate sm:ml-4 md:ml-0",
|
|
26631
26678
|
children: logo
|
|
26632
26679
|
})]
|
|
@@ -26833,10 +26880,10 @@ Navbar.propTypes = {
|
|
|
26833
26880
|
largeTitle: PropTypes.node
|
|
26834
26881
|
};
|
|
26835
26882
|
|
|
26836
|
-
var _excluded$
|
|
26883
|
+
var _excluded$r = ["items", "linkAs", "hideOnScroll", "badgeMax", "className", "onFocus"],
|
|
26837
26884
|
_excluded2$4 = ["className"];
|
|
26838
|
-
function ownKeys$
|
|
26839
|
-
function _objectSpread$
|
|
26885
|
+
function ownKeys$x(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
26886
|
+
function _objectSpread$x(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$x(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$x(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
26840
26887
|
var hasBadge = function hasBadge(badge) {
|
|
26841
26888
|
return badge === 0 || Boolean(badge);
|
|
26842
26889
|
};
|
|
@@ -26905,7 +26952,7 @@ var FootNav = /*#__PURE__*/React__default.forwardRef(function (_ref4, ref) {
|
|
|
26905
26952
|
badgeMax = _ref4$badgeMax === void 0 ? 99 : _ref4$badgeMax,
|
|
26906
26953
|
className = _ref4.className,
|
|
26907
26954
|
onFocus = _ref4.onFocus,
|
|
26908
|
-
props = _objectWithoutProperties$1(_ref4, _excluded$
|
|
26955
|
+
props = _objectWithoutProperties$1(_ref4, _excluded$r);
|
|
26909
26956
|
var _useHideOnScroll = useHideOnScroll(hideOnScroll),
|
|
26910
26957
|
_useHideOnScroll2 = _slicedToArray(_useHideOnScroll, 2),
|
|
26911
26958
|
hidden = _useHideOnScroll2[0],
|
|
@@ -26915,7 +26962,7 @@ var FootNav = /*#__PURE__*/React__default.forwardRef(function (_ref4, ref) {
|
|
|
26915
26962
|
if (hidden) setHidden(false);
|
|
26916
26963
|
onFocus === null || onFocus === void 0 || onFocus(e);
|
|
26917
26964
|
};
|
|
26918
|
-
return jsx("nav", _objectSpread$
|
|
26965
|
+
return jsx("nav", _objectSpread$x(_objectSpread$x({
|
|
26919
26966
|
ref: ref,
|
|
26920
26967
|
"aria-label": "Primary",
|
|
26921
26968
|
"data-hidden": hideOnScroll ? String(hidden) : undefined,
|
|
@@ -26931,14 +26978,14 @@ var FootNav = /*#__PURE__*/React__default.forwardRef(function (_ref4, ref) {
|
|
|
26931
26978
|
var isAction = item.variant === 'action';
|
|
26932
26979
|
var isLink = item.href !== undefined || item.to !== undefined;
|
|
26933
26980
|
var Item = isLink ? linkAs || 'a' : 'button';
|
|
26934
|
-
var linkProps = isLink ? _objectSpread$
|
|
26981
|
+
var linkProps = isLink ? _objectSpread$x({
|
|
26935
26982
|
href: item.href
|
|
26936
26983
|
}, linkAs ? {
|
|
26937
26984
|
to: (_item$to = item.to) !== null && _item$to !== void 0 ? _item$to : item.href
|
|
26938
26985
|
} : {}) : {
|
|
26939
26986
|
type: 'button'
|
|
26940
26987
|
};
|
|
26941
|
-
return jsxs(Item, _objectSpread$
|
|
26988
|
+
return jsxs(Item, _objectSpread$x(_objectSpread$x(_objectSpread$x({}, linkProps), {}, {
|
|
26942
26989
|
"aria-current": item.active ? 'page' : undefined,
|
|
26943
26990
|
"data-variant": isAction ? 'action' : undefined
|
|
26944
26991
|
}, passthrough(item)), {}, {
|
|
@@ -26980,7 +27027,7 @@ FootNav.displayName = 'FootNav';
|
|
|
26980
27027
|
var FootNavSpacer = /*#__PURE__*/React__default.forwardRef(function (_ref5, ref) {
|
|
26981
27028
|
var className = _ref5.className,
|
|
26982
27029
|
props = _objectWithoutProperties$1(_ref5, _excluded2$4);
|
|
26983
|
-
return jsx("div", _objectSpread$
|
|
27030
|
+
return jsx("div", _objectSpread$x(_objectSpread$x({
|
|
26984
27031
|
ref: ref,
|
|
26985
27032
|
"aria-hidden": "true",
|
|
26986
27033
|
"data-slot": "footnav-spacer",
|
|
@@ -26994,9 +27041,9 @@ var FootNavSpacer = /*#__PURE__*/React__default.forwardRef(function (_ref5, ref)
|
|
|
26994
27041
|
FootNavSpacer.displayName = 'FootNav.Spacer';
|
|
26995
27042
|
FootNav.Spacer = FootNavSpacer;
|
|
26996
27043
|
|
|
26997
|
-
var _excluded$
|
|
26998
|
-
function ownKeys$
|
|
26999
|
-
function _objectSpread$
|
|
27044
|
+
var _excluded$q = ["items", "separator", "showHome", "homeIcon", "onHomeClick", "maxItems", "className"];
|
|
27045
|
+
function ownKeys$w(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27046
|
+
function _objectSpread$w(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$w(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$w(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27000
27047
|
// Items without an `id` still need a stable, unique React key.
|
|
27001
27048
|
var itemKey = function itemKey(item, index) {
|
|
27002
27049
|
var _ref, _item$href;
|
|
@@ -27037,7 +27084,7 @@ var Breadcrumbs = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
27037
27084
|
onHomeClick = _ref3.onHomeClick,
|
|
27038
27085
|
maxItems = _ref3.maxItems,
|
|
27039
27086
|
className = _ref3.className,
|
|
27040
|
-
props = _objectWithoutProperties$1(_ref3, _excluded$
|
|
27087
|
+
props = _objectWithoutProperties$1(_ref3, _excluded$q);
|
|
27041
27088
|
var _useState = useState(false),
|
|
27042
27089
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27043
27090
|
expanded = _useState2[0],
|
|
@@ -27072,7 +27119,7 @@ var Breadcrumbs = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
27072
27119
|
children: separator
|
|
27073
27120
|
});
|
|
27074
27121
|
};
|
|
27075
|
-
return jsx("nav", _objectSpread$
|
|
27122
|
+
return jsx("nav", _objectSpread$w(_objectSpread$w({
|
|
27076
27123
|
ref: ref,
|
|
27077
27124
|
className: cn('flex min-w-0 items-center space-x-1 text-sm', className),
|
|
27078
27125
|
"aria-label": "Breadcrumb"
|
|
@@ -27124,12 +27171,12 @@ var Breadcrumbs = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
27124
27171
|
});
|
|
27125
27172
|
Breadcrumbs.displayName = 'Breadcrumbs';
|
|
27126
27173
|
|
|
27127
|
-
var _excluded$
|
|
27174
|
+
var _excluded$p = ["isOpen", "onClose", "title", "children", "size", "dismissible", "showCloseButton", "footer", "className", "onOpen", "presentation"],
|
|
27128
27175
|
_excluded2$3 = ["children", "className"],
|
|
27129
27176
|
_excluded3$2 = ["children", "className"],
|
|
27130
27177
|
_excluded4$2 = ["children", "className"];
|
|
27131
|
-
function ownKeys$
|
|
27132
|
-
function _objectSpread$
|
|
27178
|
+
function ownKeys$v(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27179
|
+
function _objectSpread$v(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$v(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$v(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27133
27180
|
// Exit length of the centred modal. `animate-scale-out` / `animate-fade-out`
|
|
27134
27181
|
// run for duration-fast (120ms) with `forwards`, so the panel stays invisible
|
|
27135
27182
|
// for the few ms before it unmounts.
|
|
@@ -27185,7 +27232,7 @@ var Dialog = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
27185
27232
|
onOpen = _ref2.onOpen,
|
|
27186
27233
|
_ref2$presentation = _ref2.presentation,
|
|
27187
27234
|
presentation = _ref2$presentation === void 0 ? 'auto' : _ref2$presentation,
|
|
27188
|
-
props = _objectWithoutProperties$1(_ref2, _excluded$
|
|
27235
|
+
props = _objectWithoutProperties$1(_ref2, _excluded$p);
|
|
27189
27236
|
var dialogRef = useRef(null);
|
|
27190
27237
|
// Unique per instance so two open dialogs never share an aria-labelledby target.
|
|
27191
27238
|
var titleId = "dialog-title-".concat(useId());
|
|
@@ -27233,7 +27280,7 @@ var Dialog = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
27233
27280
|
var _onCloseRef$current2;
|
|
27234
27281
|
return (_onCloseRef$current2 = onCloseRef.current) === null || _onCloseRef$current2 === void 0 ? void 0 : _onCloseRef$current2.call(onCloseRef);
|
|
27235
27282
|
};
|
|
27236
|
-
return jsxs(Sheet, _objectSpread$
|
|
27283
|
+
return jsxs(Sheet, _objectSpread$v(_objectSpread$v({
|
|
27237
27284
|
ref: panelRef,
|
|
27238
27285
|
isOpen: Boolean(isOpen),
|
|
27239
27286
|
onClose: close,
|
|
@@ -27275,7 +27322,7 @@ var Dialog = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
27275
27322
|
className: cn('fixed inset-0 z-modal flex items-center justify-center bg-black/50 motion-reduce:animate-none', SAFE_GUTTER, exiting ? 'pointer-events-none animate-fade-out' : 'animate-fade-in'),
|
|
27276
27323
|
"data-state": presence.state,
|
|
27277
27324
|
onClick: handleBackdropClick,
|
|
27278
|
-
children: jsxs("div", _objectSpread$
|
|
27325
|
+
children: jsxs("div", _objectSpread$v(_objectSpread$v({
|
|
27279
27326
|
ref: panelRef,
|
|
27280
27327
|
className: cn('flex w-full flex-col overflow-hidden rounded-lg border border-line bg-surface text-foreground shadow-xl focus:outline-none motion-reduce:animate-none', PANEL_MAX_HEIGHT, exiting ? 'animate-scale-out' : 'animate-scale-in', sizeClasses[size], className),
|
|
27281
27328
|
tabIndex: -1,
|
|
@@ -27311,7 +27358,7 @@ var DialogHeader = function DialogHeader(_ref3) {
|
|
|
27311
27358
|
var children = _ref3.children,
|
|
27312
27359
|
className = _ref3.className,
|
|
27313
27360
|
props = _objectWithoutProperties$1(_ref3, _excluded2$3);
|
|
27314
|
-
return jsx("div", _objectSpread$
|
|
27361
|
+
return jsx("div", _objectSpread$v(_objectSpread$v({
|
|
27315
27362
|
className: cn('border-b border-line px-6 py-4', className)
|
|
27316
27363
|
}, props), {}, {
|
|
27317
27364
|
children: children
|
|
@@ -27321,7 +27368,7 @@ var DialogBody = function DialogBody(_ref4) {
|
|
|
27321
27368
|
var children = _ref4.children,
|
|
27322
27369
|
className = _ref4.className,
|
|
27323
27370
|
props = _objectWithoutProperties$1(_ref4, _excluded3$2);
|
|
27324
|
-
return jsx("div", _objectSpread$
|
|
27371
|
+
return jsx("div", _objectSpread$v(_objectSpread$v({
|
|
27325
27372
|
className: cn('px-6 py-4', className)
|
|
27326
27373
|
}, props), {}, {
|
|
27327
27374
|
children: children
|
|
@@ -27331,7 +27378,7 @@ var DialogFooter = function DialogFooter(_ref5) {
|
|
|
27331
27378
|
var children = _ref5.children,
|
|
27332
27379
|
className = _ref5.className,
|
|
27333
27380
|
props = _objectWithoutProperties$1(_ref5, _excluded4$2);
|
|
27334
|
-
return jsx("div", _objectSpread$
|
|
27381
|
+
return jsx("div", _objectSpread$v(_objectSpread$v({
|
|
27335
27382
|
className: cn('flex items-center justify-end gap-3 border-t border-line px-6 py-4', className)
|
|
27336
27383
|
}, props), {}, {
|
|
27337
27384
|
children: children
|
|
@@ -27390,9 +27437,9 @@ function useToastSwipe(_ref) {
|
|
|
27390
27437
|
};
|
|
27391
27438
|
}
|
|
27392
27439
|
|
|
27393
|
-
var _excluded$
|
|
27394
|
-
function ownKeys$
|
|
27395
|
-
function _objectSpread$
|
|
27440
|
+
var _excluded$o = ["id", "title", "message", "description", "type", "duration", "onClose", "position", "statusIcon", "actions", "color", "footerNote", "showFooterNote", "portal", "paused", "swipeToDismiss", "mobilePosition", "mobileOffset", "closeLabel", "className", "style", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onPointerDown", "onPointerUp", "onPointerCancel"];
|
|
27441
|
+
function ownKeys$u(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27442
|
+
function _objectSpread$u(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$u(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$u(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27396
27443
|
// The single toast card. Re-exported as `Toast` from ./Toast.jsx, which also
|
|
27397
27444
|
// holds the provider / hook; the stack lives in ./ToastStack.jsx.
|
|
27398
27445
|
// Errors interrupt (role="alert", assertive); everything else waits for the
|
|
@@ -27480,7 +27527,7 @@ function usePauseReasons() {
|
|
|
27480
27527
|
setReasons = _useState2[1];
|
|
27481
27528
|
var set = useCallback(function (reason, on) {
|
|
27482
27529
|
setReasons(function (prev) {
|
|
27483
|
-
return Boolean(prev[reason]) === on ? prev : _objectSpread$
|
|
27530
|
+
return Boolean(prev[reason]) === on ? prev : _objectSpread$u(_objectSpread$u({}, prev), {}, _defineProperty$4({}, reason, on));
|
|
27484
27531
|
});
|
|
27485
27532
|
}, []);
|
|
27486
27533
|
return [Object.values(reasons).some(Boolean), set];
|
|
@@ -27525,7 +27572,7 @@ var Toast = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
27525
27572
|
onPointerDown = _ref.onPointerDown,
|
|
27526
27573
|
onPointerUp = _ref.onPointerUp,
|
|
27527
27574
|
onPointerCancel = _ref.onPointerCancel,
|
|
27528
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
27575
|
+
props = _objectWithoutProperties$1(_ref, _excluded$o);
|
|
27529
27576
|
var _useState3 = useState(true),
|
|
27530
27577
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
27531
27578
|
isVisible = _useState4[0],
|
|
@@ -27609,7 +27656,7 @@ var Toast = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
27609
27656
|
var positionClass = mobileClass || STANDALONE_POSITION_CLASSES[position] || STANDALONE_POSITION_CLASSES['top-right'];
|
|
27610
27657
|
// Swipe: follow the finger, fade with distance, then leave the way it went.
|
|
27611
27658
|
// A centred standalone toast keeps its -50% shift under the inline transform.
|
|
27612
|
-
var rootStyle = _objectSpread$
|
|
27659
|
+
var rootStyle = _objectSpread$u({}, style);
|
|
27613
27660
|
if (mobileClass && mobileOffset != null) rootStyle[MOBILE_OFFSET_VAR] = toCssLength(mobileOffset);
|
|
27614
27661
|
var centerShift = portal && !mobileClass && /-center$/.test(position) ? 'translateX(-50%) ' : '';
|
|
27615
27662
|
if (swipe.swipedOut) {
|
|
@@ -27625,7 +27672,7 @@ var Toast = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
27625
27672
|
var onTouchRelease = function onTouchRelease() {
|
|
27626
27673
|
return setPaused('touch', false);
|
|
27627
27674
|
};
|
|
27628
|
-
var toastContent = jsxs("div", _objectSpread$
|
|
27675
|
+
var toastContent = jsxs("div", _objectSpread$u(_objectSpread$u(_objectSpread$u({
|
|
27629
27676
|
ref: ref,
|
|
27630
27677
|
"data-swiping": swipe.dragging ? '' : undefined,
|
|
27631
27678
|
"data-swipe-out": swipe.swipedOut ? swipe.swipedOut > 0 ? 'right' : 'left' : undefined,
|
|
@@ -27728,8 +27775,8 @@ var Toast = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
27728
27775
|
});
|
|
27729
27776
|
Toast.displayName = 'Toast';
|
|
27730
27777
|
|
|
27731
|
-
function ownKeys$
|
|
27732
|
-
function _objectSpread$
|
|
27778
|
+
function ownKeys$t(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27779
|
+
function _objectSpread$t(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$t(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$t(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27733
27780
|
// Internal (not exported). The stack behind <ToastContainer> and
|
|
27734
27781
|
// <ToastProvider>. Up to `visibleToasts` toasts list normally; past that the
|
|
27735
27782
|
// stack collapses Sonner-style (newest in front, older ones peeking behind)
|
|
@@ -27836,7 +27883,7 @@ var ToastStack = function ToastStack(_ref) {
|
|
|
27836
27883
|
"data-toast-depth": depth,
|
|
27837
27884
|
className: cn('pointer-events-auto w-full', mobile ? 'max-w-none' : 'max-w-md', collapsible && 'transition-[transform,opacity] duration-base ease-standard motion-reduce:transition-none', collapsed && ['col-start-1 row-start-1', fromBottom ? 'self-end' : 'self-start'], collapsed && depth >= limit && 'pointer-events-none'),
|
|
27838
27885
|
style: collapsed ? collapsedStyle(depth, fromBottom, limit) : undefined,
|
|
27839
|
-
children: jsx(Toast, _objectSpread$
|
|
27886
|
+
children: jsx(Toast, _objectSpread$t(_objectSpread$t({}, t), {}, {
|
|
27840
27887
|
portal: false,
|
|
27841
27888
|
position: position,
|
|
27842
27889
|
paused: collapsible && interacting ? true : t.paused,
|
|
@@ -27849,9 +27896,9 @@ var ToastStack = function ToastStack(_ref) {
|
|
|
27849
27896
|
}), document.body);
|
|
27850
27897
|
};
|
|
27851
27898
|
|
|
27852
|
-
var _excluded$
|
|
27853
|
-
function ownKeys$
|
|
27854
|
-
function _objectSpread$
|
|
27899
|
+
var _excluded$n = ["children", "position", "className"];
|
|
27900
|
+
function ownKeys$s(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27901
|
+
function _objectSpread$s(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$s(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$s(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27855
27902
|
// The toast family: the card (./ToastItem.jsx), the stack (./ToastStack.jsx),
|
|
27856
27903
|
// and the queue shared by <ToastProvider> / useToast().
|
|
27857
27904
|
// Shared queue for <ToastProvider>. `null` outside a provider, where useToast
|
|
@@ -27864,7 +27911,7 @@ var ToastContainer = function ToastContainer(props) {
|
|
|
27864
27911
|
// legacy `<ToastContainer toasts={useToast().toasts} />` would render every
|
|
27865
27912
|
// toast twice. Skip it when it is handed the provider's own queue.
|
|
27866
27913
|
if (shared && props.toasts === shared.toasts) return null;
|
|
27867
|
-
return jsx(ToastStack, _objectSpread$
|
|
27914
|
+
return jsx(ToastStack, _objectSpread$s({}, props));
|
|
27868
27915
|
};
|
|
27869
27916
|
var useToastQueue = function useToastQueue() {
|
|
27870
27917
|
var _useState = useState([]),
|
|
@@ -27873,7 +27920,7 @@ var useToastQueue = function useToastQueue() {
|
|
|
27873
27920
|
setToasts = _useState2[1];
|
|
27874
27921
|
var addToast = useCallback(function (toastOptions) {
|
|
27875
27922
|
var id = toastOptions.id || "".concat(Date.now(), "-").concat(Math.random().toString(36).slice(2, 7));
|
|
27876
|
-
var newToast = _objectSpread$
|
|
27923
|
+
var newToast = _objectSpread$s(_objectSpread$s({}, toastOptions), {}, {
|
|
27877
27924
|
id: id
|
|
27878
27925
|
});
|
|
27879
27926
|
setToasts(function (prev) {
|
|
@@ -27896,7 +27943,7 @@ var useToastQueue = function useToastQueue() {
|
|
|
27896
27943
|
var toast = useMemo(function () {
|
|
27897
27944
|
var withType = function withType(type) {
|
|
27898
27945
|
return function (title, message, options) {
|
|
27899
|
-
return addToast(_objectSpread$
|
|
27946
|
+
return addToast(_objectSpread$s({
|
|
27900
27947
|
title: title,
|
|
27901
27948
|
message: message,
|
|
27902
27949
|
type: type
|
|
@@ -27933,11 +27980,11 @@ var ToastProvider = function ToastProvider(_ref) {
|
|
|
27933
27980
|
position = _ref$position === void 0 ? 'top-right' : _ref$position,
|
|
27934
27981
|
_ref$className = _ref.className,
|
|
27935
27982
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
27936
|
-
stackProps = _objectWithoutProperties$1(_ref, _excluded$
|
|
27983
|
+
stackProps = _objectWithoutProperties$1(_ref, _excluded$n);
|
|
27937
27984
|
var queue = useToastQueue();
|
|
27938
27985
|
return jsxs(ToastContext.Provider, {
|
|
27939
27986
|
value: queue,
|
|
27940
|
-
children: [children, jsx(ToastStack, _objectSpread$
|
|
27987
|
+
children: [children, jsx(ToastStack, _objectSpread$s({
|
|
27941
27988
|
toasts: queue.toasts,
|
|
27942
27989
|
position: position,
|
|
27943
27990
|
onRemove: queue.removeToast,
|
|
@@ -27954,9 +28001,9 @@ var useToast = function useToast() {
|
|
|
27954
28001
|
return shared !== null && shared !== void 0 ? shared : local;
|
|
27955
28002
|
};
|
|
27956
28003
|
|
|
27957
|
-
var _excluded$
|
|
27958
|
-
function ownKeys$
|
|
27959
|
-
function _objectSpread$
|
|
28004
|
+
var _excluded$m = ["variant", "title", "children", "actions", "dismissible", "onDismiss", "dismissLabel", "className"];
|
|
28005
|
+
function ownKeys$r(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28006
|
+
function _objectSpread$r(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$r(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$r(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
27960
28007
|
// error / warning need attention now (role="alert", assertive); info / success
|
|
27961
28008
|
// / neutral must not interrupt (role="status", polite).
|
|
27962
28009
|
var URGENT_VARIANTS = new Set(['error', 'warning']);
|
|
@@ -28014,10 +28061,10 @@ var Alert = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
28014
28061
|
_ref$dismissLabel = _ref.dismissLabel,
|
|
28015
28062
|
dismissLabel = _ref$dismissLabel === void 0 ? 'Dismiss' : _ref$dismissLabel,
|
|
28016
28063
|
className = _ref.className,
|
|
28017
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
28064
|
+
props = _objectWithoutProperties$1(_ref, _excluded$m);
|
|
28018
28065
|
var styles = VARIANTS[variant] || VARIANTS.info;
|
|
28019
28066
|
var Icon = styles.Icon;
|
|
28020
|
-
return jsx("div", _objectSpread$
|
|
28067
|
+
return jsx("div", _objectSpread$r(_objectSpread$r({
|
|
28021
28068
|
ref: ref,
|
|
28022
28069
|
className: cn('rounded-md border p-4 animate-fade-in motion-reduce:animate-none', styles.container, className),
|
|
28023
28070
|
role: URGENT_VARIANTS.has(variant) ? 'alert' : 'status'
|
|
@@ -28063,12 +28110,12 @@ var Alert = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
28063
28110
|
});
|
|
28064
28111
|
Alert.displayName = 'Alert';
|
|
28065
28112
|
|
|
28066
|
-
var _excluded$
|
|
28113
|
+
var _excluded$l = ["isOpen", "onClose", "title", "description", "children", "placement", "size", "dismissible", "showCloseButton", "footer", "initialFocusRef", "handle", "swipeToClose"],
|
|
28067
28114
|
_excluded2$2 = ["className"],
|
|
28068
28115
|
_excluded3$1 = ["className"],
|
|
28069
28116
|
_excluded4$1 = ["className"];
|
|
28070
|
-
function ownKeys$
|
|
28071
|
-
function _objectSpread$
|
|
28117
|
+
function ownKeys$q(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28118
|
+
function _objectSpread$q(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$q(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$q(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28072
28119
|
// Record-peek / editor panel. Built on the internal sheet core (ADR 0001,
|
|
28073
28120
|
// DTUI-33): it slides in and out from its edge, stays mounted through the
|
|
28074
28121
|
// exit, and `swipeToClose` drags it toward its own edge on every placement.
|
|
@@ -28127,7 +28174,7 @@ var DrawerTitleBar = function DrawerTitleBar(_ref2) {
|
|
|
28127
28174
|
var _useGrabZone = useGrabZone({}),
|
|
28128
28175
|
dragProps = _useGrabZone.dragProps,
|
|
28129
28176
|
grabClass = _useGrabZone.grabClass;
|
|
28130
|
-
return jsx("div", _objectSpread$
|
|
28177
|
+
return jsx("div", _objectSpread$q(_objectSpread$q({}, dragProps), {}, {
|
|
28131
28178
|
className: cn("flex shrink-0 items-start justify-between gap-4 border-b border-gray-200 px-6 py-4 dark:border-gray-700", grabClass, className),
|
|
28132
28179
|
children: children
|
|
28133
28180
|
}));
|
|
@@ -28151,7 +28198,7 @@ var Drawer = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
28151
28198
|
handle = _ref3.handle,
|
|
28152
28199
|
_ref3$swipeToClose = _ref3.swipeToClose,
|
|
28153
28200
|
swipeToClose = _ref3$swipeToClose === void 0 ? false : _ref3$swipeToClose,
|
|
28154
|
-
props = _objectWithoutProperties$1(_ref3, _excluded$
|
|
28201
|
+
props = _objectWithoutProperties$1(_ref3, _excluded$l);
|
|
28155
28202
|
var side = PLACEMENT_CLASSES[placement] ? placement : "right";
|
|
28156
28203
|
var sizes = side === "top" || side === "bottom" ? EDGE_SIZES : SIDE_SIZES;
|
|
28157
28204
|
// Without title/description/footer the children are the panel content, so
|
|
@@ -28189,7 +28236,7 @@ var Drawer = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
28189
28236
|
})]
|
|
28190
28237
|
});
|
|
28191
28238
|
};
|
|
28192
|
-
return jsx(SheetCore, _objectSpread$
|
|
28239
|
+
return jsx(SheetCore, _objectSpread$q(_objectSpread$q({
|
|
28193
28240
|
ref: ref,
|
|
28194
28241
|
open: Boolean(isOpen),
|
|
28195
28242
|
onClose: close,
|
|
@@ -28224,7 +28271,7 @@ var DrawerHeader = /*#__PURE__*/React__default.forwardRef(function (_ref5, ref)
|
|
|
28224
28271
|
var _useGrabZone2 = useGrabZone(props),
|
|
28225
28272
|
dragProps = _useGrabZone2.dragProps,
|
|
28226
28273
|
grabClass = _useGrabZone2.grabClass;
|
|
28227
|
-
return jsx("div", _objectSpread$
|
|
28274
|
+
return jsx("div", _objectSpread$q(_objectSpread$q(_objectSpread$q({
|
|
28228
28275
|
ref: ref
|
|
28229
28276
|
}, props), dragProps), {}, {
|
|
28230
28277
|
className: cn("border-b border-gray-200 px-6 py-4 dark:border-gray-700", grabClass, className)
|
|
@@ -28233,7 +28280,7 @@ var DrawerHeader = /*#__PURE__*/React__default.forwardRef(function (_ref5, ref)
|
|
|
28233
28280
|
var DrawerBody = /*#__PURE__*/React__default.forwardRef(function (_ref6, ref) {
|
|
28234
28281
|
var className = _ref6.className,
|
|
28235
28282
|
props = _objectWithoutProperties$1(_ref6, _excluded3$1);
|
|
28236
|
-
return jsx("div", _objectSpread$
|
|
28283
|
+
return jsx("div", _objectSpread$q({
|
|
28237
28284
|
ref: ref,
|
|
28238
28285
|
className: cn("min-h-0 flex-1 overflow-y-auto px-6 py-4", className)
|
|
28239
28286
|
}, props));
|
|
@@ -28241,7 +28288,7 @@ var DrawerBody = /*#__PURE__*/React__default.forwardRef(function (_ref6, ref) {
|
|
|
28241
28288
|
var DrawerFooter = /*#__PURE__*/React__default.forwardRef(function (_ref7, ref) {
|
|
28242
28289
|
var className = _ref7.className,
|
|
28243
28290
|
props = _objectWithoutProperties$1(_ref7, _excluded4$1);
|
|
28244
|
-
return jsx("div", _objectSpread$
|
|
28291
|
+
return jsx("div", _objectSpread$q({
|
|
28245
28292
|
ref: ref,
|
|
28246
28293
|
className: cn("flex items-center justify-end gap-3 border-t border-gray-200 px-6 py-4 dark:border-gray-700", className)
|
|
28247
28294
|
}, props));
|
|
@@ -28253,9 +28300,9 @@ Drawer.Header = DrawerHeader;
|
|
|
28253
28300
|
Drawer.Body = DrawerBody;
|
|
28254
28301
|
Drawer.Footer = DrawerFooter;
|
|
28255
28302
|
|
|
28256
|
-
var _excluded$
|
|
28257
|
-
function ownKeys$
|
|
28258
|
-
function _objectSpread$
|
|
28303
|
+
var _excluded$k = ["open", "isOpen", "onClose", "title", "message", "actions", "cancelLabel", "className", "aria-label"];
|
|
28304
|
+
function ownKeys$p(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28305
|
+
function _objectSpread$p(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$p(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$p(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28259
28306
|
// iOS UIAlertController-style action sheet on the bottom Sheet: an optional
|
|
28260
28307
|
// title + message, a card of actions (destructive ones in the error tone) and
|
|
28261
28308
|
// a separate Cancel. The same implementation (ActionSheetMenu) renders the
|
|
@@ -28276,7 +28323,7 @@ var ActionSheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
28276
28323
|
cancelLabel = _ref$cancelLabel === void 0 ? "Cancel" : _ref$cancelLabel,
|
|
28277
28324
|
className = _ref.className,
|
|
28278
28325
|
ariaLabel = _ref["aria-label"],
|
|
28279
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
28326
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$k);
|
|
28280
28327
|
var items = (Array.isArray(actions) ? actions : []).filter(Boolean).map(normalizeAction);
|
|
28281
28328
|
var selectItem = function selectItem(item) {
|
|
28282
28329
|
var _item$onSelect;
|
|
@@ -28284,7 +28331,7 @@ var ActionSheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
28284
28331
|
(_item$onSelect = item.onSelect) === null || _item$onSelect === void 0 || _item$onSelect.call(item);
|
|
28285
28332
|
_onClose === null || _onClose === void 0 || _onClose("select");
|
|
28286
28333
|
};
|
|
28287
|
-
return jsx(ActionSheetMenu, _objectSpread$
|
|
28334
|
+
return jsx(ActionSheetMenu, _objectSpread$p({
|
|
28288
28335
|
ref: ref,
|
|
28289
28336
|
open: Boolean(open !== null && open !== void 0 ? open : isOpen),
|
|
28290
28337
|
onClose: function onClose(reason) {
|
|
@@ -28452,10 +28499,10 @@ var TourSpotlight = function TourSpotlight(_ref) {
|
|
|
28452
28499
|
};
|
|
28453
28500
|
TourSpotlight.displayName = "TourSpotlight";
|
|
28454
28501
|
|
|
28455
|
-
var _excluded$
|
|
28456
|
-
function ownKeys$
|
|
28457
|
-
function _objectSpread$
|
|
28458
|
-
var useIsomorphicLayoutEffect$
|
|
28502
|
+
var _excluded$j = ["open", "steps", "onClose", "onFinish", "step", "defaultStep", "onStepChange", "labels", "targetTimeout", "spotlightPadding", "presentation", "className", "style", "onPointerDown", "onPointerUp", "onPointerCancel", "onClickCapture"];
|
|
28503
|
+
function ownKeys$o(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28504
|
+
function _objectSpread$o(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$o(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$o(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28505
|
+
var useIsomorphicLayoutEffect$3 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
28459
28506
|
// Docked (phone) card: a horizontal swipe at least this long (px), and clearly
|
|
28460
28507
|
// more horizontal than vertical, goes to the next / previous step.
|
|
28461
28508
|
var SWIPE_DISTANCE = 50;
|
|
@@ -28507,7 +28554,7 @@ var Tour = /*#__PURE__*/forwardRef(function (_ref, _ref2) {
|
|
|
28507
28554
|
_onPointerUp = _ref.onPointerUp,
|
|
28508
28555
|
_onPointerCancel = _ref.onPointerCancel,
|
|
28509
28556
|
_onClickCapture = _ref.onClickCapture,
|
|
28510
|
-
rest = _objectWithoutProperties$1(_ref, _excluded$
|
|
28557
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$j);
|
|
28511
28558
|
var cardRef = useRef(null);
|
|
28512
28559
|
var swipeRef = useRef({
|
|
28513
28560
|
x: 0,
|
|
@@ -28516,7 +28563,7 @@ var Tour = /*#__PURE__*/forwardRef(function (_ref, _ref2) {
|
|
|
28516
28563
|
swipedAt: -Infinity
|
|
28517
28564
|
});
|
|
28518
28565
|
var baseId = useId();
|
|
28519
|
-
var text = _objectSpread$
|
|
28566
|
+
var text = _objectSpread$o(_objectSpread$o({}, DEFAULT_LABELS), labels);
|
|
28520
28567
|
var docked = usePresentation(presentation) === "sheet";
|
|
28521
28568
|
// Each opening is a new session: the uncontrolled step restarts and stale
|
|
28522
28569
|
// target measurements from the previous run are ignored.
|
|
@@ -28559,7 +28606,7 @@ var Tour = /*#__PURE__*/forwardRef(function (_ref, _ref2) {
|
|
|
28559
28606
|
setFloating = refs.setFloating;
|
|
28560
28607
|
// The target's measured box is the (virtual) reference; useTourTarget
|
|
28561
28608
|
// re-measures it on scroll/resize.
|
|
28562
|
-
useIsomorphicLayoutEffect$
|
|
28609
|
+
useIsomorphicLayoutEffect$3(function () {
|
|
28563
28610
|
setReference(anchored ? {
|
|
28564
28611
|
getBoundingClientRect: function getBoundingClientRect() {
|
|
28565
28612
|
return rect;
|
|
@@ -28569,7 +28616,7 @@ var Tour = /*#__PURE__*/forwardRef(function (_ref, _ref2) {
|
|
|
28569
28616
|
var goTo = function goTo(next) {
|
|
28570
28617
|
if (next < 0 || next >= total || next === index) return;
|
|
28571
28618
|
if (stepProp === undefined) setSession(function (s) {
|
|
28572
|
-
return _objectSpread$
|
|
28619
|
+
return _objectSpread$o(_objectSpread$o({}, s), {}, {
|
|
28573
28620
|
step: next
|
|
28574
28621
|
});
|
|
28575
28622
|
});
|
|
@@ -28648,7 +28695,7 @@ var Tour = /*#__PURE__*/forwardRef(function (_ref, _ref2) {
|
|
|
28648
28695
|
children: [jsx(TourSpotlight, {
|
|
28649
28696
|
rect: ready ? rect : null,
|
|
28650
28697
|
padding: spotlightPadding
|
|
28651
|
-
}), jsxs("div", _objectSpread$
|
|
28698
|
+
}), jsxs("div", _objectSpread$o(_objectSpread$o(_objectSpread$o({
|
|
28652
28699
|
ref: function ref(node) {
|
|
28653
28700
|
return setRefs$1(node, cardRef, _ref2, setFloating);
|
|
28654
28701
|
},
|
|
@@ -28661,7 +28708,7 @@ var Tour = /*#__PURE__*/forwardRef(function (_ref, _ref2) {
|
|
|
28661
28708
|
"data-placement": placementAttr,
|
|
28662
28709
|
"data-presentation": docked ? "sheet" : "popover",
|
|
28663
28710
|
className: cn("fixed overflow-y-auto overscroll-contain rounded-lg border border-gray-200 bg-white text-gray-900 shadow-xl focus:outline-none", "dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100", "transition-opacity duration-200 motion-reduce:transition-none", docked ? "inset-x-4 bottom-4 max-h-[60dvh] pb-safe touch-pan-y" : "w-[min(22rem,calc(100vw-2rem))] max-h-[calc(100dvh-2rem)]", !docked && !rect && "left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", ready ? "opacity-100" : "pointer-events-none opacity-0", className),
|
|
28664
|
-
style: anchored ? _objectSpread$
|
|
28711
|
+
style: anchored ? _objectSpread$o(_objectSpread$o({}, floatingStyles), style) : style
|
|
28665
28712
|
}, swipeHandlers), rest), {}, {
|
|
28666
28713
|
children: [jsxs("div", {
|
|
28667
28714
|
className: "flex items-start justify-between gap-3 px-4 pt-4",
|
|
@@ -28727,9 +28774,9 @@ var Tour = /*#__PURE__*/forwardRef(function (_ref, _ref2) {
|
|
|
28727
28774
|
});
|
|
28728
28775
|
Tour.displayName = "Tour";
|
|
28729
28776
|
|
|
28730
|
-
var _excluded$
|
|
28731
|
-
function ownKeys$
|
|
28732
|
-
function _objectSpread$
|
|
28777
|
+
var _excluded$i = ["children", "variant", "size", "rounded", "dot", "icon", "max", "className"];
|
|
28778
|
+
function ownKeys$n(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28779
|
+
function _objectSpread$n(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$n(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$n(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28733
28780
|
// Light: 100 fill + 800 text (≥4.5:1). Dark: a tinted 900 fill + 200 text.
|
|
28734
28781
|
var variants = {
|
|
28735
28782
|
"default": 'bg-gray-100 text-primary-800 dark:bg-gray-800 dark:text-gray-100',
|
|
@@ -28766,9 +28813,9 @@ var Badge = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
28766
28813
|
icon = _ref.icon,
|
|
28767
28814
|
max = _ref.max,
|
|
28768
28815
|
className = _ref.className,
|
|
28769
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
28816
|
+
props = _objectWithoutProperties$1(_ref, _excluded$i);
|
|
28770
28817
|
var hasLead = dot || Boolean(icon);
|
|
28771
|
-
return jsxs("span", _objectSpread$
|
|
28818
|
+
return jsxs("span", _objectSpread$n(_objectSpread$n({
|
|
28772
28819
|
ref: ref,
|
|
28773
28820
|
className: cn('inline-flex items-center font-medium', variants[variant], sizes[size] || sizes.md, {
|
|
28774
28821
|
'rounded-full': rounded,
|
|
@@ -28790,9 +28837,9 @@ var Badge = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
28790
28837
|
});
|
|
28791
28838
|
Badge.displayName = 'Badge';
|
|
28792
28839
|
|
|
28793
|
-
var _excluded$
|
|
28794
|
-
function ownKeys$
|
|
28795
|
-
function _objectSpread$
|
|
28840
|
+
var _excluded$h = ["children", "max", "size", "className"];
|
|
28841
|
+
function ownKeys$m(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28842
|
+
function _objectSpread$m(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$m(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$m(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28796
28843
|
// Overlap grows with the avatar so the stack reads the same at every size.
|
|
28797
28844
|
var OVERLAP = {
|
|
28798
28845
|
xs: '-space-x-1.5',
|
|
@@ -28811,13 +28858,13 @@ var AvatarGroup = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
28811
28858
|
_ref$size = _ref.size,
|
|
28812
28859
|
size = _ref$size === void 0 ? 'md' : _ref$size,
|
|
28813
28860
|
className = _ref.className,
|
|
28814
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
28861
|
+
props = _objectWithoutProperties$1(_ref, _excluded$h);
|
|
28815
28862
|
var avatars = React__default.Children.toArray(children).filter(React__default.isValidElement);
|
|
28816
28863
|
var limit = typeof max === 'number' && max >= 0 ? max : avatars.length;
|
|
28817
28864
|
var visible = avatars.slice(0, limit);
|
|
28818
28865
|
var overflow = avatars.length - visible.length;
|
|
28819
28866
|
var sizeKey = AVATAR_SIZES[size] ? size : 'md';
|
|
28820
|
-
return jsxs("div", _objectSpread$
|
|
28867
|
+
return jsxs("div", _objectSpread$m(_objectSpread$m({
|
|
28821
28868
|
ref: ref,
|
|
28822
28869
|
role: "group",
|
|
28823
28870
|
className: cn('flex items-center', OVERLAP[sizeKey], className)
|
|
@@ -28840,14 +28887,14 @@ var AvatarGroup = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
28840
28887
|
});
|
|
28841
28888
|
AvatarGroup.displayName = 'AvatarGroup';
|
|
28842
28889
|
|
|
28843
|
-
var _excluded$
|
|
28890
|
+
var _excluded$g = ["children", "className", "hover", "interactive", "onClick", "onKeyDown"],
|
|
28844
28891
|
_excluded2$1 = ["children", "className"],
|
|
28845
28892
|
_excluded3 = ["children", "className"],
|
|
28846
28893
|
_excluded4 = ["children", "className"],
|
|
28847
28894
|
_excluded5 = ["children", "className"],
|
|
28848
28895
|
_excluded6 = ["children", "className"];
|
|
28849
|
-
function ownKeys$
|
|
28850
|
-
function _objectSpread$
|
|
28896
|
+
function ownKeys$l(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28897
|
+
function _objectSpread$l(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$l(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$l(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28851
28898
|
// Interactive cards: hover lift, press shrink and a keyboard focus ring. The
|
|
28852
28899
|
// transition list covers both the shadow and the press transform.
|
|
28853
28900
|
var INTERACTIVE_CLASSES = cn('cursor-pointer hover:shadow-md focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-900', PRESS_FEEDBACK, 'transition-[box-shadow,transform] duration-fast ease-standard motion-reduce:transition-none');
|
|
@@ -28860,7 +28907,7 @@ var Card = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
28860
28907
|
interactive = _ref$interactive === void 0 ? false : _ref$interactive,
|
|
28861
28908
|
onClick = _ref.onClick,
|
|
28862
28909
|
onKeyDown = _ref.onKeyDown,
|
|
28863
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
28910
|
+
props = _objectWithoutProperties$1(_ref, _excluded$g);
|
|
28864
28911
|
// A clickable interactive card with no role of its own becomes a keyboard
|
|
28865
28912
|
// operable button (Tab to it, Enter / Space to activate).
|
|
28866
28913
|
var actsAsButton = interactive && typeof onClick === 'function' && props.role === undefined;
|
|
@@ -28872,7 +28919,7 @@ var Card = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
28872
28919
|
onClick(e);
|
|
28873
28920
|
}
|
|
28874
28921
|
};
|
|
28875
|
-
return jsx("div", _objectSpread$
|
|
28922
|
+
return jsx("div", _objectSpread$l(_objectSpread$l({
|
|
28876
28923
|
ref: ref,
|
|
28877
28924
|
role: actsAsButton ? 'button' : undefined,
|
|
28878
28925
|
tabIndex: actsAsButton ? 0 : undefined,
|
|
@@ -28891,7 +28938,7 @@ var CardHeader = function CardHeader(_ref2) {
|
|
|
28891
28938
|
var children = _ref2.children,
|
|
28892
28939
|
className = _ref2.className,
|
|
28893
28940
|
props = _objectWithoutProperties$1(_ref2, _excluded2$1);
|
|
28894
|
-
return jsx("div", _objectSpread$
|
|
28941
|
+
return jsx("div", _objectSpread$l(_objectSpread$l({
|
|
28895
28942
|
className: cn('px-4 sm:px-6 py-4 border-b border-line', className)
|
|
28896
28943
|
}, props), {}, {
|
|
28897
28944
|
children: children
|
|
@@ -28901,7 +28948,7 @@ var CardTitle = function CardTitle(_ref3) {
|
|
|
28901
28948
|
var children = _ref3.children,
|
|
28902
28949
|
className = _ref3.className,
|
|
28903
28950
|
props = _objectWithoutProperties$1(_ref3, _excluded3);
|
|
28904
|
-
return jsx("h3", _objectSpread$
|
|
28951
|
+
return jsx("h3", _objectSpread$l(_objectSpread$l({
|
|
28905
28952
|
className: cn('text-lg font-semibold text-primary-900 dark:text-primary-100', className)
|
|
28906
28953
|
}, props), {}, {
|
|
28907
28954
|
children: children
|
|
@@ -28911,7 +28958,7 @@ var CardDescription = function CardDescription(_ref4) {
|
|
|
28911
28958
|
var children = _ref4.children,
|
|
28912
28959
|
className = _ref4.className,
|
|
28913
28960
|
props = _objectWithoutProperties$1(_ref4, _excluded4);
|
|
28914
|
-
return jsx("p", _objectSpread$
|
|
28961
|
+
return jsx("p", _objectSpread$l(_objectSpread$l({
|
|
28915
28962
|
className: cn('text-sm text-primary-600 dark:text-primary-300', className)
|
|
28916
28963
|
}, props), {}, {
|
|
28917
28964
|
children: children
|
|
@@ -28921,7 +28968,7 @@ var CardContent = function CardContent(_ref5) {
|
|
|
28921
28968
|
var children = _ref5.children,
|
|
28922
28969
|
className = _ref5.className,
|
|
28923
28970
|
props = _objectWithoutProperties$1(_ref5, _excluded5);
|
|
28924
|
-
return jsx("div", _objectSpread$
|
|
28971
|
+
return jsx("div", _objectSpread$l(_objectSpread$l({
|
|
28925
28972
|
className: cn('px-4 sm:px-6 py-4', className)
|
|
28926
28973
|
}, props), {}, {
|
|
28927
28974
|
children: children
|
|
@@ -28931,7 +28978,7 @@ var CardFooter = function CardFooter(_ref6) {
|
|
|
28931
28978
|
var children = _ref6.children,
|
|
28932
28979
|
className = _ref6.className,
|
|
28933
28980
|
props = _objectWithoutProperties$1(_ref6, _excluded6);
|
|
28934
|
-
return jsx("div", _objectSpread$
|
|
28981
|
+
return jsx("div", _objectSpread$l(_objectSpread$l({
|
|
28935
28982
|
className: cn('px-4 sm:px-6 py-4 border-t border-line', className)
|
|
28936
28983
|
}, props), {}, {
|
|
28937
28984
|
children: children
|
|
@@ -28943,9 +28990,9 @@ Card.Description = CardDescription;
|
|
|
28943
28990
|
Card.Content = CardContent;
|
|
28944
28991
|
Card.Footer = CardFooter;
|
|
28945
28992
|
|
|
28946
|
-
var _excluded$
|
|
28947
|
-
function ownKeys$
|
|
28948
|
-
function _objectSpread$
|
|
28993
|
+
var _excluded$f = ["currentPage", "totalPages", "onPageChange", "showFirstLast", "showPrevNext", "maxVisiblePages", "className"];
|
|
28994
|
+
function ownKeys$k(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
28995
|
+
function _objectSpread$k(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$k(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$k(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28949
28996
|
// Shared button chrome: dark-safe surface, focus-visible ring, 44px target on coarse pointers.
|
|
28950
28997
|
var BUTTON_BASE = cn('inline-flex items-center justify-center rounded-md border px-3 py-2 text-sm font-medium', 'transition-colors duration-fast motion-reduce:transition-none', 'outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 dark:focus-visible:ring-offset-gray-900', TOUCH_TARGET);
|
|
28951
28998
|
var BUTTON_IDLE = 'border-gray-300 bg-white hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 dark:hover:bg-gray-800';
|
|
@@ -28964,7 +29011,7 @@ var Pagination = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
28964
29011
|
_ref$maxVisiblePages = _ref.maxVisiblePages,
|
|
28965
29012
|
maxVisiblePages = _ref$maxVisiblePages === void 0 ? 5 : _ref$maxVisiblePages,
|
|
28966
29013
|
className = _ref.className,
|
|
28967
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
29014
|
+
props = _objectWithoutProperties$1(_ref, _excluded$f);
|
|
28968
29015
|
var getVisiblePages = function getVisiblePages() {
|
|
28969
29016
|
var pages = [];
|
|
28970
29017
|
var halfVisible = Math.floor(maxVisiblePages / 2);
|
|
@@ -28994,7 +29041,7 @@ var Pagination = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
28994
29041
|
// prev/next buttons to drive it; otherwise the full layout shows everywhere.
|
|
28995
29042
|
var compact = showPrevNext;
|
|
28996
29043
|
var fullOnly = compact ? 'hidden sm:inline-flex' : '';
|
|
28997
|
-
return jsxs("nav", _objectSpread$
|
|
29044
|
+
return jsxs("nav", _objectSpread$k(_objectSpread$k({
|
|
28998
29045
|
ref: ref,
|
|
28999
29046
|
className: cn('flex flex-wrap items-center justify-center gap-1', className),
|
|
29000
29047
|
"aria-label": "Pagination"
|
|
@@ -29065,9 +29112,9 @@ var Pagination = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
29065
29112
|
});
|
|
29066
29113
|
Pagination.displayName = 'Pagination';
|
|
29067
29114
|
|
|
29068
|
-
var _excluded$
|
|
29069
|
-
function ownKeys$
|
|
29070
|
-
function _objectSpread$
|
|
29115
|
+
var _excluded$e = ["steps", "currentStep", "orientation", "variant", "onStepClick", "className"];
|
|
29116
|
+
function ownKeys$j(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29117
|
+
function _objectSpread$j(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$j(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$j(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29071
29118
|
// Layout classes per orientation. "auto" stacks vertically below `sm` and lays
|
|
29072
29119
|
// out horizontally from `sm` up. Every class is written out literally so
|
|
29073
29120
|
// Tailwind's content scan picks it up.
|
|
@@ -29134,7 +29181,7 @@ var Stepper = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
29134
29181
|
variant = _ref$variant === void 0 ? 'default' : _ref$variant,
|
|
29135
29182
|
onStepClick = _ref.onStepClick,
|
|
29136
29183
|
className = _ref.className,
|
|
29137
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
29184
|
+
props = _objectWithoutProperties$1(_ref, _excluded$e);
|
|
29138
29185
|
var getStepStatus = function getStepStatus(stepIndex) {
|
|
29139
29186
|
if (stepIndex < currentStep) return 'completed';
|
|
29140
29187
|
if (stepIndex === currentStep) return 'current';
|
|
@@ -29152,7 +29199,7 @@ var Stepper = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
29152
29199
|
};
|
|
29153
29200
|
// Compact progress dots: no titles, just one dot per step (current = pill).
|
|
29154
29201
|
if (variant === 'dots') {
|
|
29155
|
-
return jsx("nav", _objectSpread$
|
|
29202
|
+
return jsx("nav", _objectSpread$j(_objectSpread$j({
|
|
29156
29203
|
ref: ref,
|
|
29157
29204
|
className: cn('flex flex-row items-center gap-1', className),
|
|
29158
29205
|
"aria-label": "Progress",
|
|
@@ -29178,7 +29225,7 @@ var Stepper = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
29178
29225
|
}));
|
|
29179
29226
|
}
|
|
29180
29227
|
var layout = LAYOUT[orientation] || LAYOUT.horizontal;
|
|
29181
|
-
return jsx("nav", _objectSpread$
|
|
29228
|
+
return jsx("nav", _objectSpread$j(_objectSpread$j({
|
|
29182
29229
|
ref: ref,
|
|
29183
29230
|
className: cn('flex', layout.nav, className),
|
|
29184
29231
|
"aria-label": "Progress"
|
|
@@ -29227,9 +29274,9 @@ var Stepper = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
29227
29274
|
});
|
|
29228
29275
|
Stepper.displayName = 'Stepper';
|
|
29229
29276
|
|
|
29230
|
-
var _excluded$
|
|
29231
|
-
function ownKeys$
|
|
29232
|
-
function _objectSpread$
|
|
29277
|
+
var _excluded$d = ["accept", "multiple", "maxSize", "onFileSelect", "onFileRemove", "files", "disabled", "capture", "className"];
|
|
29278
|
+
function ownKeys$i(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29279
|
+
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$i(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$i(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29233
29280
|
var COARSE_POINTER_QUERY = '(pointer: coarse)';
|
|
29234
29281
|
// PRESS_FEEDBACK sets transition-transform; this keeps the colour transition as well.
|
|
29235
29282
|
var TRANSITION_WITH_PRESS = 'transition-[color,background-color,border-color,transform]';
|
|
@@ -29254,7 +29301,7 @@ var FileUpload = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
29254
29301
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
29255
29302
|
capture = _ref.capture,
|
|
29256
29303
|
className = _ref.className,
|
|
29257
|
-
props = _objectWithoutProperties$1(_ref, _excluded$
|
|
29304
|
+
props = _objectWithoutProperties$1(_ref, _excluded$d);
|
|
29258
29305
|
var _useState = useState(false),
|
|
29259
29306
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29260
29307
|
isDragOver = _useState2[0],
|
|
@@ -29345,7 +29392,7 @@ var FileUpload = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
29345
29392
|
className: "text-xs text-primary-500 dark:text-primary-300 mt-1",
|
|
29346
29393
|
children: [accept && "Accepted formats: ".concat(accept), maxSize && " \u2022 Max size: ".concat(formatFileSize(maxSize))]
|
|
29347
29394
|
});
|
|
29348
|
-
return jsxs("div", _objectSpread$
|
|
29395
|
+
return jsxs("div", _objectSpread$i(_objectSpread$i({
|
|
29349
29396
|
ref: ref,
|
|
29350
29397
|
className: cn('w-full', className)
|
|
29351
29398
|
}, props), {}, {
|
|
@@ -29479,9 +29526,9 @@ var Condition = function Condition(_ref) {
|
|
|
29479
29526
|
return condition ? children : fallback;
|
|
29480
29527
|
};
|
|
29481
29528
|
|
|
29482
|
-
var _excluded$
|
|
29483
|
-
function ownKeys$
|
|
29484
|
-
function _objectSpread$
|
|
29529
|
+
var _excluded$c = ["children", "autoPlay", "interval", "showDots", "className", "itemClassName", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onTouchStart", "onTouchEnd"];
|
|
29530
|
+
function ownKeys$h(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29531
|
+
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29485
29532
|
// Arrows stay visible at rest (touch devices have no hover) and use the surface /
|
|
29486
29533
|
// foreground role tokens so they read on light and dark themes alike.
|
|
29487
29534
|
var ARROW_CLASSES = "absolute top-1/2 -translate-y-1/2 z-10 inline-flex items-center justify-center p-2 rounded-full bg-surface/80 backdrop-blur-md border border-line text-foreground shadow-lg transition-colors motion-reduce:transition-none hover:bg-surface focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500";
|
|
@@ -29516,7 +29563,7 @@ var Carousel = /*#__PURE__*/React__default.forwardRef(function Carousel(props, r
|
|
|
29516
29563
|
_onBlur = props.onBlur,
|
|
29517
29564
|
_onTouchStart = props.onTouchStart,
|
|
29518
29565
|
_onTouchEnd = props.onTouchEnd,
|
|
29519
|
-
rest = _objectWithoutProperties$1(props, _excluded$
|
|
29566
|
+
rest = _objectWithoutProperties$1(props, _excluded$c);
|
|
29520
29567
|
var reducedMotion = useReducedMotion();
|
|
29521
29568
|
var _React$useState = React__default.useState(0),
|
|
29522
29569
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -29584,7 +29631,7 @@ var Carousel = /*#__PURE__*/React__default.forwardRef(function Carousel(props, r
|
|
|
29584
29631
|
return clearInterval(timer);
|
|
29585
29632
|
};
|
|
29586
29633
|
}, [isAutoPlaying, next, interval]);
|
|
29587
|
-
return jsxs("div", _objectSpread$
|
|
29634
|
+
return jsxs("div", _objectSpread$h(_objectSpread$h({
|
|
29588
29635
|
ref: ref,
|
|
29589
29636
|
role: "region",
|
|
29590
29637
|
"aria-roledescription": "carousel",
|
|
@@ -29696,7 +29743,25 @@ Carousel.displayName = "Carousel";
|
|
|
29696
29743
|
|
|
29697
29744
|
// Internal (not exported). Keyboard + pointer reordering for Sortable. Both
|
|
29698
29745
|
// work on a draft list of keys while the user is moving an item and only call
|
|
29699
|
-
// `commit(fromIndex, toIndex)` when the item is dropped.
|
|
29746
|
+
// `commit(fromIndex, toIndex)` when the item is dropped. Inside a SortableGroup
|
|
29747
|
+
// they also get a `cross` object (see useSortableGroup.js) that takes over when
|
|
29748
|
+
// the item is carried into another list; without one they behave as before.
|
|
29749
|
+
var defaultGetKey = function defaultGetKey(item, index) {
|
|
29750
|
+
var _ref, _item$id;
|
|
29751
|
+
return (_ref = (_item$id = item === null || item === void 0 ? void 0 : item.id) !== null && _item$id !== void 0 ? _item$id : item === null || item === void 0 ? void 0 : item.key) !== null && _ref !== void 0 ? _ref : index;
|
|
29752
|
+
};
|
|
29753
|
+
var defaultGetItemLabel = function defaultGetItemLabel(item, index) {
|
|
29754
|
+
var _ref2, _ref3, _item$label;
|
|
29755
|
+
return typeof item === "string" || typeof item === "number" ? String(item) : (_ref2 = (_ref3 = (_item$label = item === null || item === void 0 ? void 0 : item.label) !== null && _item$label !== void 0 ? _item$label : item === null || item === void 0 ? void 0 : item.title) !== null && _ref3 !== void 0 ? _ref3 : item === null || item === void 0 ? void 0 : item.name) !== null && _ref2 !== void 0 ? _ref2 : "Item ".concat(index + 1);
|
|
29756
|
+
};
|
|
29757
|
+
function arrayMove(list, from, to) {
|
|
29758
|
+
var next = list.slice();
|
|
29759
|
+
var _next$splice = next.splice(from, 1),
|
|
29760
|
+
_next$splice2 = _slicedToArray(_next$splice, 1),
|
|
29761
|
+
moved = _next$splice2[0];
|
|
29762
|
+
next.splice(to, 0, moved);
|
|
29763
|
+
return next;
|
|
29764
|
+
}
|
|
29700
29765
|
function moveKey(keys, key, toIndex) {
|
|
29701
29766
|
var next = keys.filter(function (k) {
|
|
29702
29767
|
return k !== key;
|
|
@@ -29717,6 +29782,17 @@ var DEFAULT_SORTABLE_MESSAGES = {
|
|
|
29717
29782
|
},
|
|
29718
29783
|
cancelled: function cancelled(label, position) {
|
|
29719
29784
|
return "Reorder cancelled. ".concat(label, " returned to position ").concat(position, ".");
|
|
29785
|
+
},
|
|
29786
|
+
// Only used inside a SortableGroup.
|
|
29787
|
+
groupInstructions: "Use the arrow keys across the list (Left and Right in a vertical list) to carry it to the previous or next list.",
|
|
29788
|
+
movedToList: function movedToList(label, list, position, total) {
|
|
29789
|
+
return "".concat(label, " moved to ").concat(list, ", position ").concat(position, " of ").concat(total, ".");
|
|
29790
|
+
},
|
|
29791
|
+
droppedInList: function droppedInList(label, list, position, total) {
|
|
29792
|
+
return "".concat(label, " dropped in ").concat(list, " at position ").concat(position, " of ").concat(total, ".");
|
|
29793
|
+
},
|
|
29794
|
+
refused: function refused(label, list) {
|
|
29795
|
+
return "".concat(label, " cannot be dropped in ").concat(list, ".");
|
|
29720
29796
|
}
|
|
29721
29797
|
};
|
|
29722
29798
|
var PREV_KEYS = {
|
|
@@ -29727,13 +29803,31 @@ var NEXT_KEYS = {
|
|
|
29727
29803
|
vertical: ["ArrowDown"],
|
|
29728
29804
|
horizontal: ["ArrowRight"]
|
|
29729
29805
|
};
|
|
29730
|
-
|
|
29731
|
-
|
|
29732
|
-
|
|
29733
|
-
|
|
29734
|
-
|
|
29735
|
-
|
|
29736
|
-
|
|
29806
|
+
// Cross-axis arrows step between the lists of a SortableGroup.
|
|
29807
|
+
var LIST_KEYS = {
|
|
29808
|
+
vertical: {
|
|
29809
|
+
ArrowLeft: -1,
|
|
29810
|
+
ArrowRight: 1
|
|
29811
|
+
},
|
|
29812
|
+
horizontal: {
|
|
29813
|
+
ArrowUp: -1,
|
|
29814
|
+
ArrowDown: 1
|
|
29815
|
+
}
|
|
29816
|
+
};
|
|
29817
|
+
var stepOf = function stepOf(e, orientation, cross) {
|
|
29818
|
+
return {
|
|
29819
|
+
delta: PREV_KEYS[orientation].includes(e.key) ? -1 : NEXT_KEYS[orientation].includes(e.key) ? 1 : 0,
|
|
29820
|
+
list: cross ? LIST_KEYS[orientation][e.key] || 0 : 0
|
|
29821
|
+
};
|
|
29822
|
+
};
|
|
29823
|
+
function useSortableKeyboard(_ref4) {
|
|
29824
|
+
var keys = _ref4.keys,
|
|
29825
|
+
setDraft = _ref4.setDraft,
|
|
29826
|
+
commit = _ref4.commit,
|
|
29827
|
+
announce = _ref4.announce,
|
|
29828
|
+
labelFor = _ref4.labelFor,
|
|
29829
|
+
orientation = _ref4.orientation,
|
|
29830
|
+
cross = _ref4.cross;
|
|
29737
29831
|
var _useState = useState(null),
|
|
29738
29832
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29739
29833
|
grabbed = _useState2[0],
|
|
@@ -29751,21 +29845,27 @@ function useSortableKeyboard(_ref) {
|
|
|
29751
29845
|
setGrabbed(key);
|
|
29752
29846
|
setDraft(keys);
|
|
29753
29847
|
announce("grabbed", labelFor(key), index + 1, total);
|
|
29754
|
-
|
|
29755
|
-
setGrabbed(null);
|
|
29756
|
-
commit(origin.current, index);
|
|
29757
|
-
announce("dropped", labelFor(key), index + 1, total);
|
|
29848
|
+
return;
|
|
29758
29849
|
}
|
|
29850
|
+
var crossed = cross === null || cross === void 0 ? void 0 : cross.drop(key);
|
|
29851
|
+
if (crossed === "refused") return;
|
|
29852
|
+
setGrabbed(null);
|
|
29853
|
+
if (crossed) return;
|
|
29854
|
+
commit(origin.current, index);
|
|
29855
|
+
announce("dropped", labelFor(key), index + 1, total);
|
|
29759
29856
|
} else if (grabbed === key && e.key === "Escape") {
|
|
29760
29857
|
e.preventDefault();
|
|
29761
29858
|
setGrabbed(null);
|
|
29762
29859
|
setDraft(null);
|
|
29860
|
+
cross === null || cross === void 0 || cross.cancel();
|
|
29763
29861
|
announce("cancelled", labelFor(key), origin.current + 1, total);
|
|
29764
29862
|
} else if (grabbed === key) {
|
|
29765
|
-
var
|
|
29766
|
-
if (!delta) return;
|
|
29863
|
+
var step = stepOf(e, orientation, cross);
|
|
29864
|
+
if (!step.delta && !step.list) return;
|
|
29767
29865
|
e.preventDefault();
|
|
29768
|
-
|
|
29866
|
+
if (step.list) return cross.step(key, step.list);
|
|
29867
|
+
if (cross !== null && cross !== void 0 && cross.nudge(key, step.delta)) return;
|
|
29868
|
+
var to = Math.max(0, Math.min(total - 1, index + step.delta));
|
|
29769
29869
|
if (to === index) return;
|
|
29770
29870
|
setDraft(moveKey(keys, key, to));
|
|
29771
29871
|
announce("moved", labelFor(key), to + 1, total);
|
|
@@ -29775,7 +29875,8 @@ function useSortableKeyboard(_ref) {
|
|
|
29775
29875
|
var cancel = useCallback(function () {
|
|
29776
29876
|
setGrabbed(null);
|
|
29777
29877
|
setDraft(null);
|
|
29778
|
-
|
|
29878
|
+
cross === null || cross === void 0 || cross.cancel();
|
|
29879
|
+
}, [setDraft, cross]);
|
|
29779
29880
|
return {
|
|
29780
29881
|
grabbed: grabbed,
|
|
29781
29882
|
keyDownFor: keyDownFor,
|
|
@@ -29821,13 +29922,14 @@ var raf = function raf(cb) {
|
|
|
29821
29922
|
var caf = function caf(id) {
|
|
29822
29923
|
return typeof window.cancelAnimationFrame === "function" ? window.cancelAnimationFrame(id) : clearTimeout(id);
|
|
29823
29924
|
};
|
|
29824
|
-
function useSortablePointer(
|
|
29825
|
-
var keys =
|
|
29826
|
-
setDraft =
|
|
29827
|
-
commit =
|
|
29828
|
-
nodeFor =
|
|
29829
|
-
orientation =
|
|
29830
|
-
disabled =
|
|
29925
|
+
function useSortablePointer(_ref5) {
|
|
29926
|
+
var keys = _ref5.keys,
|
|
29927
|
+
setDraft = _ref5.setDraft,
|
|
29928
|
+
commit = _ref5.commit,
|
|
29929
|
+
nodeFor = _ref5.nodeFor,
|
|
29930
|
+
orientation = _ref5.orientation,
|
|
29931
|
+
disabled = _ref5.disabled,
|
|
29932
|
+
cross = _ref5.cross;
|
|
29831
29933
|
var _useState3 = useState(null),
|
|
29832
29934
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
29833
29935
|
dragging = _useState4[0],
|
|
@@ -29837,7 +29939,8 @@ function useSortablePointer(_ref2) {
|
|
|
29837
29939
|
keys: keys,
|
|
29838
29940
|
commit: commit,
|
|
29839
29941
|
nodeFor: nodeFor,
|
|
29840
|
-
orientation: orientation
|
|
29942
|
+
orientation: orientation,
|
|
29943
|
+
cross: cross
|
|
29841
29944
|
});
|
|
29842
29945
|
var end = useCallback(function () {
|
|
29843
29946
|
var _session$current;
|
|
@@ -29866,9 +29969,9 @@ function useSortablePointer(_ref2) {
|
|
|
29866
29969
|
// `longPress`: on touch, wait LONG_PRESS_DELAY before picking the item up (used
|
|
29867
29970
|
// when the whole item is the drag source, so the list still scrolls on swipe).
|
|
29868
29971
|
var startFor = function startFor(key) {
|
|
29869
|
-
var
|
|
29870
|
-
|
|
29871
|
-
longPress =
|
|
29972
|
+
var _ref6 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
29973
|
+
_ref6$longPress = _ref6.longPress,
|
|
29974
|
+
longPress = _ref6$longPress === void 0 ? false : _ref6$longPress;
|
|
29872
29975
|
return function (e) {
|
|
29873
29976
|
if (disabled || e.button > 0) return;
|
|
29874
29977
|
var start = {
|
|
@@ -29881,6 +29984,12 @@ function useSortablePointer(_ref2) {
|
|
|
29881
29984
|
var point = start;
|
|
29882
29985
|
var pressTimer = null;
|
|
29883
29986
|
var frame = null;
|
|
29987
|
+
// Over another list of the group, the source list keeps its original order
|
|
29988
|
+
// and the target list shows where the item would land.
|
|
29989
|
+
var track = function track() {
|
|
29990
|
+
var _latest$current$cross;
|
|
29991
|
+
if ((_latest$current$cross = latest.current.cross) !== null && _latest$current$cross !== void 0 && _latest$current$cross.over(point, key)) setDraft(null);else setDraft(moveKey(latest.current.keys, key, targetIndex(point, key)));
|
|
29992
|
+
};
|
|
29884
29993
|
var scrollTarget = function scrollTarget() {
|
|
29885
29994
|
return getScrollParent(latest.current.nodeFor(key), latest.current.orientation);
|
|
29886
29995
|
};
|
|
@@ -29905,7 +30014,7 @@ function useSortablePointer(_ref2) {
|
|
|
29905
30014
|
} else if (typeof window.scrollBy === "function") {
|
|
29906
30015
|
window.scrollBy(dx, dy);
|
|
29907
30016
|
}
|
|
29908
|
-
|
|
30017
|
+
track();
|
|
29909
30018
|
frame = raf(_autoScroll);
|
|
29910
30019
|
};
|
|
29911
30020
|
var activate = function activate() {
|
|
@@ -29927,20 +30036,24 @@ function useSortablePointer(_ref2) {
|
|
|
29927
30036
|
if (distance < DRAG_THRESHOLD) return;
|
|
29928
30037
|
activate();
|
|
29929
30038
|
}
|
|
29930
|
-
|
|
30039
|
+
track();
|
|
29931
30040
|
if (frame === null) frame = raf(_autoScroll);
|
|
29932
30041
|
};
|
|
29933
30042
|
var onUp = function onUp() {
|
|
30043
|
+
var _latest$current$cross2;
|
|
29934
30044
|
end();
|
|
29935
30045
|
if (!active) return;
|
|
29936
30046
|
setDragging(null);
|
|
30047
|
+
if ((_latest$current$cross2 = latest.current.cross) !== null && _latest$current$cross2 !== void 0 && _latest$current$cross2.release()) return;
|
|
29937
30048
|
latest.current.commit(from, latest.current.keys.indexOf(key));
|
|
29938
30049
|
};
|
|
29939
30050
|
var onCancel = function onCancel() {
|
|
30051
|
+
var _latest$current$cross3;
|
|
29940
30052
|
end();
|
|
29941
30053
|
if (!active) return;
|
|
29942
30054
|
setDragging(null);
|
|
29943
30055
|
setDraft(null);
|
|
30056
|
+
(_latest$current$cross3 = latest.current.cross) === null || _latest$current$cross3 === void 0 || _latest$current$cross3.cancel();
|
|
29944
30057
|
};
|
|
29945
30058
|
// Once a touch drag is live, stop the browser from scrolling (and from firing
|
|
29946
30059
|
// pointercancel); before that, let the page scroll normally.
|
|
@@ -29978,47 +30091,338 @@ function useSortablePointer(_ref2) {
|
|
|
29978
30091
|
};
|
|
29979
30092
|
}
|
|
29980
30093
|
|
|
30094
|
+
function ownKeys$g(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30095
|
+
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30096
|
+
// Internal (not exported). Cross-list moves for Sortable lists inside a
|
|
30097
|
+
// SortableGroup. The group holds one "carry": the item on its way from one list
|
|
30098
|
+
// to another, the target `{ listId, index }` and whether `canDrop` allows it.
|
|
30099
|
+
// The target list draws a placeholder from it; nothing is committed until the
|
|
30100
|
+
// drop, so a refused target is never shown as a success.
|
|
30101
|
+
var useIsomorphicLayoutEffect$2 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
30102
|
+
var SortableGroupContext = /*#__PURE__*/createContext(null);
|
|
30103
|
+
var documentOrder = function documentOrder(a, b) {
|
|
30104
|
+
return a === b ? 0 : a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
30105
|
+
};
|
|
30106
|
+
var contains = function contains(rect, point) {
|
|
30107
|
+
return point.x >= rect.left && point.x <= rect.right && point.y >= rect.top && point.y <= rect.bottom;
|
|
30108
|
+
};
|
|
30109
|
+
/** Insertion index for `point` among the items of a list (midpoint hit-test). */
|
|
30110
|
+
function indexAt(list, point) {
|
|
30111
|
+
var index = list.itemKeys.findIndex(function (k) {
|
|
30112
|
+
var _list$nodeFor;
|
|
30113
|
+
var rect = (_list$nodeFor = list.nodeFor(k)) === null || _list$nodeFor === void 0 ? void 0 : _list$nodeFor.getBoundingClientRect();
|
|
30114
|
+
if (!rect) return false;
|
|
30115
|
+
return list.orientation === "horizontal" ? point.x < rect.left + rect.width / 2 : point.y < rect.top + rect.height / 2;
|
|
30116
|
+
});
|
|
30117
|
+
return index === -1 ? list.itemKeys.length : index;
|
|
30118
|
+
}
|
|
30119
|
+
/** State + stable API behind <SortableGroup>. */
|
|
30120
|
+
function useSortableGroupState(_ref) {
|
|
30121
|
+
var onMove = _ref.onMove,
|
|
30122
|
+
canDrop = _ref.canDrop;
|
|
30123
|
+
var lists = useRef(new Map());
|
|
30124
|
+
var carryRef = useRef(null);
|
|
30125
|
+
var focusRef = useRef(null);
|
|
30126
|
+
var _useState = useState(null),
|
|
30127
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
30128
|
+
carry = _useState2[0],
|
|
30129
|
+
setCarryState = _useState2[1];
|
|
30130
|
+
var latest = useLatestRef$1({
|
|
30131
|
+
onMove: onMove,
|
|
30132
|
+
canDrop: canDrop
|
|
30133
|
+
});
|
|
30134
|
+
var api = useMemo(function () {
|
|
30135
|
+
var setCarry = function setCarry(next) {
|
|
30136
|
+
carryRef.current = next;
|
|
30137
|
+
setCarryState(next);
|
|
30138
|
+
return next;
|
|
30139
|
+
};
|
|
30140
|
+
var read = function read(id) {
|
|
30141
|
+
var _lists$current$get;
|
|
30142
|
+
return (_lists$current$get = lists.current.get(id)) === null || _lists$current$get === void 0 ? void 0 : _lists$current$get();
|
|
30143
|
+
};
|
|
30144
|
+
return {
|
|
30145
|
+
pendingFocus: function pendingFocus() {
|
|
30146
|
+
return focusRef.current;
|
|
30147
|
+
},
|
|
30148
|
+
clearFocus: function clearFocus() {
|
|
30149
|
+
focusRef.current = null;
|
|
30150
|
+
},
|
|
30151
|
+
read: read,
|
|
30152
|
+
current: function current() {
|
|
30153
|
+
return carryRef.current;
|
|
30154
|
+
},
|
|
30155
|
+
register: function register(id, reader) {
|
|
30156
|
+
lists.current.set(id, reader);
|
|
30157
|
+
return function () {
|
|
30158
|
+
if (lists.current.get(id) === reader) lists.current["delete"](id);
|
|
30159
|
+
};
|
|
30160
|
+
},
|
|
30161
|
+
/** List ids in document order (only lists that are mounted). */
|
|
30162
|
+
order: function order() {
|
|
30163
|
+
return _toConsumableArray$1(lists.current.keys()).filter(function (id) {
|
|
30164
|
+
var _read;
|
|
30165
|
+
return (_read = read(id)) === null || _read === void 0 ? void 0 : _read.node;
|
|
30166
|
+
}).sort(function (a, b) {
|
|
30167
|
+
return documentOrder(read(a).node, read(b).node);
|
|
30168
|
+
});
|
|
30169
|
+
},
|
|
30170
|
+
aim: function aim(from, item, target) {
|
|
30171
|
+
var c = carryRef.current;
|
|
30172
|
+
if (c && c.from.listId === from.listId && c.target.listId === target.listId && c.target.index === target.index) return c;
|
|
30173
|
+
var test = latest.current.canDrop;
|
|
30174
|
+
return setCarry({
|
|
30175
|
+
from: from,
|
|
30176
|
+
item: item,
|
|
30177
|
+
target: target,
|
|
30178
|
+
allowed: test ? Boolean(test(item, target, from)) : true
|
|
30179
|
+
});
|
|
30180
|
+
},
|
|
30181
|
+
clear: function clear() {
|
|
30182
|
+
if (carryRef.current) setCarry(null);
|
|
30183
|
+
},
|
|
30184
|
+
drop: function drop(c, focus) {
|
|
30185
|
+
var _latest$current$onMov, _latest$current;
|
|
30186
|
+
setCarry(null);
|
|
30187
|
+
focusRef.current = focus || null;
|
|
30188
|
+
(_latest$current$onMov = (_latest$current = latest.current).onMove) === null || _latest$current$onMov === void 0 || _latest$current$onMov.call(_latest$current, {
|
|
30189
|
+
item: c.item,
|
|
30190
|
+
from: c.from,
|
|
30191
|
+
to: c.target
|
|
30192
|
+
});
|
|
30193
|
+
}
|
|
30194
|
+
};
|
|
30195
|
+
}, [latest]);
|
|
30196
|
+
return useMemo(function () {
|
|
30197
|
+
return {
|
|
30198
|
+
api: api,
|
|
30199
|
+
carry: carry
|
|
30200
|
+
};
|
|
30201
|
+
}, [api, carry]);
|
|
30202
|
+
}
|
|
30203
|
+
function makeCross(api, latest) {
|
|
30204
|
+
var me = function me() {
|
|
30205
|
+
return latest.current;
|
|
30206
|
+
};
|
|
30207
|
+
var origin = function origin(key) {
|
|
30208
|
+
var m = me();
|
|
30209
|
+
var index = m.itemKeys.indexOf(key);
|
|
30210
|
+
return {
|
|
30211
|
+
from: {
|
|
30212
|
+
listId: m.listId,
|
|
30213
|
+
index: index
|
|
30214
|
+
},
|
|
30215
|
+
item: m.items[index]
|
|
30216
|
+
};
|
|
30217
|
+
};
|
|
30218
|
+
var say = function say(kind, key) {
|
|
30219
|
+
var _me;
|
|
30220
|
+
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
30221
|
+
args[_key - 2] = arguments[_key];
|
|
30222
|
+
}
|
|
30223
|
+
return (_me = me()).announce.apply(_me, [kind, me().labelFor(key)].concat(args));
|
|
30224
|
+
};
|
|
30225
|
+
var aimAt = function aimAt(key, target) {
|
|
30226
|
+
var _origin = origin(key),
|
|
30227
|
+
from = _origin.from,
|
|
30228
|
+
item = _origin.item;
|
|
30229
|
+
var next = api.aim(from, item, target);
|
|
30230
|
+
var list = api.read(target.listId);
|
|
30231
|
+
if (next.allowed) say("movedToList", key, list.label, target.index + 1, list.items.length + 1);else say("refused", key, list.label);
|
|
30232
|
+
};
|
|
30233
|
+
return {
|
|
30234
|
+
// Pointer: true while the pointer is over another list of the group.
|
|
30235
|
+
over: function over(point, key) {
|
|
30236
|
+
var id = api.order().find(function (other) {
|
|
30237
|
+
return other !== me().listId && contains(api.read(other).node.getBoundingClientRect(), point);
|
|
30238
|
+
});
|
|
30239
|
+
if (id === undefined) {
|
|
30240
|
+
api.clear();
|
|
30241
|
+
return false;
|
|
30242
|
+
}
|
|
30243
|
+
var _origin2 = origin(key),
|
|
30244
|
+
from = _origin2.from,
|
|
30245
|
+
item = _origin2.item;
|
|
30246
|
+
api.aim(from, item, {
|
|
30247
|
+
listId: id,
|
|
30248
|
+
index: indexAt(api.read(id), point)
|
|
30249
|
+
});
|
|
30250
|
+
return true;
|
|
30251
|
+
},
|
|
30252
|
+
// Pointer drop: true when the drop was handled here (moved, or refused and dropped nowhere).
|
|
30253
|
+
release: function release() {
|
|
30254
|
+
var c = api.current();
|
|
30255
|
+
if (!c) return false;
|
|
30256
|
+
if (c.allowed) api.drop(c);else api.clear();
|
|
30257
|
+
return true;
|
|
30258
|
+
},
|
|
30259
|
+
// Keyboard: carry the item to the previous (-1) or next (1) list.
|
|
30260
|
+
step: function step(key, dir) {
|
|
30261
|
+
var m = me();
|
|
30262
|
+
var ids = api.order();
|
|
30263
|
+
var c = api.current();
|
|
30264
|
+
var nextId = ids[ids.indexOf(c ? c.target.listId : m.listId) + dir];
|
|
30265
|
+
if (nextId === undefined) return;
|
|
30266
|
+
m.setDraft(null);
|
|
30267
|
+
if (nextId === m.listId) {
|
|
30268
|
+
api.clear();
|
|
30269
|
+
say("moved", key, m.itemKeys.indexOf(key) + 1, m.itemKeys.length);
|
|
30270
|
+
return;
|
|
30271
|
+
}
|
|
30272
|
+
var index = c ? c.target.index : m.keys.indexOf(key);
|
|
30273
|
+
aimAt(key, {
|
|
30274
|
+
listId: nextId,
|
|
30275
|
+
index: Math.min(index, api.read(nextId).items.length)
|
|
30276
|
+
});
|
|
30277
|
+
},
|
|
30278
|
+
// Keyboard: move within the target list; false when the item is still in its own list.
|
|
30279
|
+
nudge: function nudge(key, delta) {
|
|
30280
|
+
var c = api.current();
|
|
30281
|
+
if (!c) return false;
|
|
30282
|
+
var size = api.read(c.target.listId).items.length;
|
|
30283
|
+
var index = Math.max(0, Math.min(size, c.target.index + delta));
|
|
30284
|
+
if (index !== c.target.index) aimAt(key, {
|
|
30285
|
+
listId: c.target.listId,
|
|
30286
|
+
index: index
|
|
30287
|
+
});
|
|
30288
|
+
return true;
|
|
30289
|
+
},
|
|
30290
|
+
// Keyboard drop: "dropped", "refused" (keep carrying) or false (in-list drop).
|
|
30291
|
+
drop: function drop(key) {
|
|
30292
|
+
var c = api.current();
|
|
30293
|
+
if (!c) return false;
|
|
30294
|
+
var list = api.read(c.target.listId);
|
|
30295
|
+
if (!c.allowed) {
|
|
30296
|
+
say("refused", key, list.label);
|
|
30297
|
+
return "refused";
|
|
30298
|
+
}
|
|
30299
|
+
api.drop(c, {
|
|
30300
|
+
listId: c.target.listId,
|
|
30301
|
+
key: list.getKey(c.item, c.target.index)
|
|
30302
|
+
});
|
|
30303
|
+
say("droppedInList", key, list.label, c.target.index + 1, list.items.length + 1);
|
|
30304
|
+
return "dropped";
|
|
30305
|
+
},
|
|
30306
|
+
cancel: function cancel() {
|
|
30307
|
+
return api.clear();
|
|
30308
|
+
}
|
|
30309
|
+
};
|
|
30310
|
+
}
|
|
30311
|
+
/**
|
|
30312
|
+
* Wires one Sortable into the surrounding SortableGroup (if any). Outside a
|
|
30313
|
+
* group, or without an `id`, it returns `{ cross: undefined }` and the list
|
|
30314
|
+
* behaves exactly like a standalone Sortable.
|
|
30315
|
+
*/
|
|
30316
|
+
function useSortableGroupMember(options) {
|
|
30317
|
+
var _group$api;
|
|
30318
|
+
var group = useContext(SortableGroupContext);
|
|
30319
|
+
var latest = useLatestRef$1(options);
|
|
30320
|
+
var listId = options.listId,
|
|
30321
|
+
itemKeys = options.itemKeys,
|
|
30322
|
+
nodeFor = options.nodeFor;
|
|
30323
|
+
var api = listId == null ? null : (_group$api = group === null || group === void 0 ? void 0 : group.api) !== null && _group$api !== void 0 ? _group$api : null;
|
|
30324
|
+
useEffect(function () {
|
|
30325
|
+
return api ? api.register(listId, function () {
|
|
30326
|
+
return _objectSpread$g(_objectSpread$g({}, latest.current), {}, {
|
|
30327
|
+
node: latest.current.listRef.current
|
|
30328
|
+
});
|
|
30329
|
+
}) : undefined;
|
|
30330
|
+
}, [api, listId, latest]);
|
|
30331
|
+
var cross = useMemo(function () {
|
|
30332
|
+
return api ? makeCross(api, latest) : undefined;
|
|
30333
|
+
}, [api, latest]);
|
|
30334
|
+
// After a keyboard drop the moved item mounts here; keep focus on it.
|
|
30335
|
+
var signature = itemKeys.join("\0");
|
|
30336
|
+
useIsomorphicLayoutEffect$2(function () {
|
|
30337
|
+
var pending = api === null || api === void 0 ? void 0 : api.pendingFocus();
|
|
30338
|
+
if (!pending || pending.listId !== listId) return;
|
|
30339
|
+
var node = nodeFor(pending.key);
|
|
30340
|
+
if (node) {
|
|
30341
|
+
api.clearFocus();
|
|
30342
|
+
node.focus();
|
|
30343
|
+
}
|
|
30344
|
+
}, [api, listId, signature, nodeFor]);
|
|
30345
|
+
var carry = api ? group.carry : null;
|
|
30346
|
+
return {
|
|
30347
|
+
cross: cross,
|
|
30348
|
+
// Where another list's item would land in this list.
|
|
30349
|
+
incoming: carry && carry.target.listId === listId ? {
|
|
30350
|
+
index: carry.target.index,
|
|
30351
|
+
allowed: carry.allowed
|
|
30352
|
+
} : null,
|
|
30353
|
+
// This list's item currently aimed at another list.
|
|
30354
|
+
outgoing: carry && carry.from.listId === listId ? carry : null
|
|
30355
|
+
};
|
|
30356
|
+
}
|
|
30357
|
+
|
|
30358
|
+
var _excluded$b = ["onMove", "canDrop", "className", "children"];
|
|
30359
|
+
function ownKeys$f(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
30360
|
+
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
30361
|
+
/**
|
|
30362
|
+
* Connects several `<Sortable id="…">` lists so items can move between them
|
|
30363
|
+
* (pointer drag, or the cross-axis arrow keys while an item is picked up).
|
|
30364
|
+
* `canDrop(item, target, from)` is asked before a target is shown as droppable;
|
|
30365
|
+
* a refused target is marked as such and dropping there does nothing.
|
|
30366
|
+
*/
|
|
30367
|
+
var SortableGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
30368
|
+
var onMove = _ref.onMove,
|
|
30369
|
+
canDrop = _ref.canDrop,
|
|
30370
|
+
className = _ref.className,
|
|
30371
|
+
children = _ref.children,
|
|
30372
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$b);
|
|
30373
|
+
var value = useSortableGroupState({
|
|
30374
|
+
onMove: onMove,
|
|
30375
|
+
canDrop: canDrop
|
|
30376
|
+
});
|
|
30377
|
+
return jsx(SortableGroupContext.Provider, {
|
|
30378
|
+
value: value,
|
|
30379
|
+
children: jsx("div", _objectSpread$f(_objectSpread$f({
|
|
30380
|
+
ref: ref,
|
|
30381
|
+
className: cn(className),
|
|
30382
|
+
"data-sortable-group": ""
|
|
30383
|
+
}, rest), {}, {
|
|
30384
|
+
children: children
|
|
30385
|
+
}))
|
|
30386
|
+
});
|
|
30387
|
+
});
|
|
30388
|
+
SortableGroup.displayName = "SortableGroup";
|
|
30389
|
+
/** Where an item from another list would land; styled by whether `canDrop` allows it. */
|
|
30390
|
+
function SortablePlaceholder(_ref2) {
|
|
30391
|
+
var Tag = _ref2.as,
|
|
30392
|
+
allowed = _ref2.allowed;
|
|
30393
|
+
return jsx(Tag, {
|
|
30394
|
+
"aria-hidden": "true",
|
|
30395
|
+
"data-sortable-placeholder": allowed ? "allowed" : "refused",
|
|
30396
|
+
className: cn("min-h-10 rounded-md border-2 border-dashed", allowed ? "border-primary-500 bg-primary-50 dark:bg-primary-950/40" : "cursor-not-allowed border-error-500 bg-error-50 opacity-60 dark:bg-error-950/40")
|
|
30397
|
+
});
|
|
30398
|
+
}
|
|
30399
|
+
|
|
29981
30400
|
var _excluded$a = ["items", "onReorder", "renderItem", "getKey", "getItemLabel", "disabled", "handle", "orientation", "as", "itemClassName", "messages", "className"];
|
|
29982
30401
|
function ownKeys$e(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
29983
30402
|
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), true).forEach(function (r) { _defineProperty$4(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
29984
30403
|
var useIsomorphicLayoutEffect$1 = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
29985
|
-
var
|
|
29986
|
-
var
|
|
29987
|
-
|
|
29988
|
-
|
|
29989
|
-
|
|
29990
|
-
|
|
29991
|
-
|
|
29992
|
-
|
|
29993
|
-
|
|
29994
|
-
|
|
29995
|
-
|
|
29996
|
-
|
|
29997
|
-
|
|
29998
|
-
|
|
29999
|
-
|
|
30000
|
-
|
|
30001
|
-
|
|
30002
|
-
|
|
30003
|
-
|
|
30004
|
-
|
|
30005
|
-
|
|
30006
|
-
|
|
30007
|
-
getKey = _ref4$getKey === void 0 ? defaultGetKey : _ref4$getKey,
|
|
30008
|
-
_ref4$getItemLabel = _ref4.getItemLabel,
|
|
30009
|
-
getItemLabel = _ref4$getItemLabel === void 0 ? defaultGetItemLabel : _ref4$getItemLabel,
|
|
30010
|
-
_ref4$disabled = _ref4.disabled,
|
|
30011
|
-
disabled = _ref4$disabled === void 0 ? false : _ref4$disabled,
|
|
30012
|
-
_ref4$handle = _ref4.handle,
|
|
30013
|
-
handle = _ref4$handle === void 0 ? false : _ref4$handle,
|
|
30014
|
-
_ref4$orientation = _ref4.orientation,
|
|
30015
|
-
orientation = _ref4$orientation === void 0 ? "vertical" : _ref4$orientation,
|
|
30016
|
-
_ref4$as = _ref4.as,
|
|
30017
|
-
List = _ref4$as === void 0 ? "ul" : _ref4$as,
|
|
30018
|
-
itemClassName = _ref4.itemClassName,
|
|
30019
|
-
messages = _ref4.messages,
|
|
30020
|
-
className = _ref4.className,
|
|
30021
|
-
rest = _objectWithoutProperties$1(_ref4, _excluded$a);
|
|
30404
|
+
var Sortable = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
30405
|
+
var _rest$ariaLabel;
|
|
30406
|
+
var _ref$items = _ref.items,
|
|
30407
|
+
items = _ref$items === void 0 ? [] : _ref$items,
|
|
30408
|
+
onReorder = _ref.onReorder,
|
|
30409
|
+
renderItem = _ref.renderItem,
|
|
30410
|
+
_ref$getKey = _ref.getKey,
|
|
30411
|
+
getKey = _ref$getKey === void 0 ? defaultGetKey : _ref$getKey,
|
|
30412
|
+
_ref$getItemLabel = _ref.getItemLabel,
|
|
30413
|
+
getItemLabel = _ref$getItemLabel === void 0 ? defaultGetItemLabel : _ref$getItemLabel,
|
|
30414
|
+
_ref$disabled = _ref.disabled,
|
|
30415
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
30416
|
+
_ref$handle = _ref.handle,
|
|
30417
|
+
handle = _ref$handle === void 0 ? false : _ref$handle,
|
|
30418
|
+
_ref$orientation = _ref.orientation,
|
|
30419
|
+
orientation = _ref$orientation === void 0 ? "vertical" : _ref$orientation,
|
|
30420
|
+
_ref$as = _ref.as,
|
|
30421
|
+
List = _ref$as === void 0 ? "ul" : _ref$as,
|
|
30422
|
+
itemClassName = _ref.itemClassName,
|
|
30423
|
+
messages = _ref.messages,
|
|
30424
|
+
className = _ref.className,
|
|
30425
|
+
rest = _objectWithoutProperties$1(_ref, _excluded$a);
|
|
30022
30426
|
var instructionsId = "sortable-instructions-".concat(useId());
|
|
30023
30427
|
var text = useMemo(function () {
|
|
30024
30428
|
return _objectSpread$e(_objectSpread$e({}, DEFAULT_SORTABLE_MESSAGES), messages);
|
|
@@ -30033,6 +30437,10 @@ var Sortable = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
|
30033
30437
|
announcement = _useState4[0],
|
|
30034
30438
|
setAnnouncement = _useState4[1];
|
|
30035
30439
|
var nodes = useRef(new Map());
|
|
30440
|
+
var listRef = useRef(null);
|
|
30441
|
+
var setListRef = useCallback(function (node) {
|
|
30442
|
+
return setRefs$1(node, listRef, ref);
|
|
30443
|
+
}, [ref]);
|
|
30036
30444
|
var itemKeys = items.map(function (item, i) {
|
|
30037
30445
|
return getKey(item, i);
|
|
30038
30446
|
});
|
|
@@ -30066,13 +30474,32 @@ var Sortable = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
|
30066
30474
|
var nodeFor = useCallback(function (key) {
|
|
30067
30475
|
return nodes.current.get(key);
|
|
30068
30476
|
}, []);
|
|
30477
|
+
// Inside a <SortableGroup>, `id` names this list; `cross` handles moves to other lists.
|
|
30478
|
+
var _useSortableGroupMemb = useSortableGroupMember({
|
|
30479
|
+
listId: rest.id,
|
|
30480
|
+
label: (_rest$ariaLabel = rest["aria-label"]) !== null && _rest$ariaLabel !== void 0 ? _rest$ariaLabel : String(rest.id),
|
|
30481
|
+
items: items,
|
|
30482
|
+
itemKeys: itemKeys,
|
|
30483
|
+
keys: keys,
|
|
30484
|
+
getKey: getKey,
|
|
30485
|
+
nodeFor: nodeFor,
|
|
30486
|
+
listRef: listRef,
|
|
30487
|
+
orientation: axis,
|
|
30488
|
+
setDraft: setDraft,
|
|
30489
|
+
announce: announce,
|
|
30490
|
+
labelFor: labelFor
|
|
30491
|
+
}),
|
|
30492
|
+
cross = _useSortableGroupMemb.cross,
|
|
30493
|
+
incoming = _useSortableGroupMemb.incoming,
|
|
30494
|
+
outgoing = _useSortableGroupMemb.outgoing;
|
|
30069
30495
|
var keyboard = useSortableKeyboard({
|
|
30070
30496
|
keys: keys,
|
|
30071
30497
|
setDraft: setDraft,
|
|
30072
30498
|
commit: commit,
|
|
30073
30499
|
announce: announce,
|
|
30074
30500
|
labelFor: labelFor,
|
|
30075
|
-
orientation: axis
|
|
30501
|
+
orientation: axis,
|
|
30502
|
+
cross: cross
|
|
30076
30503
|
});
|
|
30077
30504
|
var pointer = useSortablePointer({
|
|
30078
30505
|
keys: keys,
|
|
@@ -30080,7 +30507,8 @@ var Sortable = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
|
30080
30507
|
commit: commit,
|
|
30081
30508
|
nodeFor: nodeFor,
|
|
30082
30509
|
orientation: axis,
|
|
30083
|
-
disabled: disabled
|
|
30510
|
+
disabled: disabled,
|
|
30511
|
+
cross: cross
|
|
30084
30512
|
});
|
|
30085
30513
|
// Moving DOM nodes can drop focus; keep it on the item being carried.
|
|
30086
30514
|
useIsomorphicLayoutEffect$1(function () {
|
|
@@ -30099,24 +30527,30 @@ var Sortable = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
|
30099
30527
|
var isNativeList = List === "ul" || List === "ol";
|
|
30100
30528
|
var ItemTag = isNativeList ? "li" : "div";
|
|
30101
30529
|
return jsxs(Fragment, {
|
|
30102
|
-
children: [
|
|
30103
|
-
ref:
|
|
30530
|
+
children: [jsxs(List, _objectSpread$e(_objectSpread$e({
|
|
30531
|
+
ref: setListRef,
|
|
30104
30532
|
className: cn("flex", axis === "horizontal" ? "flex-row gap-2" : "flex-col gap-2", className),
|
|
30105
30533
|
"data-orientation": axis,
|
|
30534
|
+
"data-drop-target": incoming ? incoming.allowed ? "allowed" : "refused" : undefined,
|
|
30106
30535
|
role: isNativeList ? undefined : "list"
|
|
30107
30536
|
}, rest), {}, {
|
|
30108
|
-
children: keys.
|
|
30537
|
+
children: [keys.flatMap(function (key, index) {
|
|
30109
30538
|
var _byKey$get = byKey.get(key),
|
|
30110
30539
|
item = _byKey$get.item,
|
|
30111
30540
|
originalIndex = _byKey$get.index;
|
|
30112
30541
|
var isGrabbed = keyboard.grabbed === key;
|
|
30113
30542
|
var isDragging = pointer.dragging === key;
|
|
30543
|
+
var isLeaving = outgoing !== null && (isGrabbed || isDragging);
|
|
30114
30544
|
var startDrag = disabled ? undefined : pointer.startFor(key);
|
|
30115
30545
|
// Whole-item drags wait for a long-press on touch so the page still scrolls.
|
|
30116
30546
|
var startItemDrag = disabled || handle ? undefined : pointer.startFor(key, {
|
|
30117
30547
|
longPress: true
|
|
30118
30548
|
});
|
|
30119
|
-
|
|
30549
|
+
var placeholder = (incoming === null || incoming === void 0 ? void 0 : incoming.index) === index ? [jsx(SortablePlaceholder, {
|
|
30550
|
+
as: ItemTag,
|
|
30551
|
+
allowed: incoming.allowed
|
|
30552
|
+
}, "dt-sortable-placeholder")] : [];
|
|
30553
|
+
return placeholder.concat(jsx(ItemTag, {
|
|
30120
30554
|
ref: function ref(node) {
|
|
30121
30555
|
if (node) nodes.current.set(key, node);else nodes.current["delete"](key);
|
|
30122
30556
|
},
|
|
@@ -30126,12 +30560,13 @@ var Sortable = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
|
30126
30560
|
role: isNativeList ? undefined : "listitem",
|
|
30127
30561
|
"data-dragging": isDragging || undefined,
|
|
30128
30562
|
"data-grabbed": isGrabbed || undefined,
|
|
30563
|
+
"data-leaving": isLeaving ? outgoing.allowed ? "allowed" : "refused" : undefined,
|
|
30129
30564
|
onKeyDown: disabled ? undefined : keyboard.keyDownFor(key),
|
|
30130
30565
|
onBlur: function onBlur(e) {
|
|
30131
30566
|
if (isGrabbed && e.relatedTarget && !e.currentTarget.contains(e.relatedTarget)) keyboard.cancel();
|
|
30132
30567
|
},
|
|
30133
30568
|
onPointerDown: startItemDrag,
|
|
30134
|
-
className: cn("rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 dark:focus:ring-offset-gray-900", !disabled && !handle && "cursor-grab select-none [-webkit-touch-callout:none]", (isGrabbed || isDragging) && "relative z-10 shadow-lg ring-2 ring-primary-500 opacity-90", itemClassName),
|
|
30569
|
+
className: cn("rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 dark:focus:ring-offset-gray-900", !disabled && !handle && "cursor-grab select-none [-webkit-touch-callout:none]", (isGrabbed || isDragging) && "relative z-10 shadow-lg ring-2 ring-primary-500 opacity-90", isLeaving && (outgoing.allowed ? "opacity-50" : "cursor-not-allowed ring-error-500 opacity-50"), itemClassName),
|
|
30135
30570
|
children: renderItem ? renderItem(item, {
|
|
30136
30571
|
index: index,
|
|
30137
30572
|
originalIndex: originalIndex,
|
|
@@ -30149,12 +30584,15 @@ var Sortable = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
|
30149
30584
|
return moveBy(originalIndex, 1);
|
|
30150
30585
|
}
|
|
30151
30586
|
}) : labelFor(key)
|
|
30152
|
-
}, key);
|
|
30153
|
-
})
|
|
30587
|
+
}, key));
|
|
30588
|
+
}), incoming && incoming.index >= keys.length && jsx(SortablePlaceholder, {
|
|
30589
|
+
as: ItemTag,
|
|
30590
|
+
allowed: incoming.allowed
|
|
30591
|
+
})]
|
|
30154
30592
|
})), jsx("span", {
|
|
30155
30593
|
id: instructionsId,
|
|
30156
30594
|
className: "sr-only",
|
|
30157
|
-
children: text.instructions
|
|
30595
|
+
children: cross ? "".concat(text.instructions, " ").concat(text.groupInstructions) : text.instructions
|
|
30158
30596
|
}), jsx("span", {
|
|
30159
30597
|
role: "status",
|
|
30160
30598
|
"aria-live": "assertive",
|
|
@@ -39895,4 +40333,4 @@ var StoreProvider = function StoreProvider(_ref) {
|
|
|
39895
40333
|
});
|
|
39896
40334
|
};
|
|
39897
40335
|
|
|
39898
|
-
export { Accordion, ActionSheet, Alert, AppShell, Avatar, AvatarGroup, Badge, BottomActionBar, Breadcrumbs, Button, Card, Carousel, Checkbox, ColorPicker, Condition, ConfirmDialog, DatePicker, DateRangePicker, Dialog, Drawer, EmitterClass as Emitter, EmptyState, ErrorState, FileUpload, FootNav, Form, Helpers, Input, Loader, LoadingState, LocationPicker, Navbar, PageHeader, Pagination, Popover, PriceRangePicker, ProgressBar, PullToRefresh, Radio, Rate, RoundedTag, SearchField, SegmentedControl, Select, Sheet, Sidebar, Skeleton, Slider, Sortable, SpeechToText, StatCard, StatusPill, Stepper, StoreProvider, SwipeableListItem, Switch, Table, Tabs, TextToSpeech, Textarea, ThemeProvider, ThreeDotPopoverSimple as ThreeDotPopover, Toast, ToastContainer, ToastProvider, Tooltip, Tour, cn, useApi, useHaptics, useMixins, useTheme, useToast };
|
|
40336
|
+
export { Accordion, ActionSheet, Alert, AppShell, Avatar, AvatarGroup, Badge, BottomActionBar, Breadcrumbs, Button, Card, Carousel, Checkbox, ColorPicker, Condition, ConfirmDialog, DatePicker, DateRangePicker, Dialog, Drawer, EmitterClass as Emitter, EmptyState, ErrorState, FileUpload, FootNav, Form, Helpers, Input, Loader, LoadingState, LocationPicker, Navbar, PageHeader, Pagination, Popover, PriceRangePicker, ProgressBar, PullToRefresh, Radio, Rate, RoundedTag, SearchField, SegmentedControl, Select, Sheet, Sidebar, Skeleton, Slider, Sortable, SortableGroup, SpeechToText, StatCard, StatusPill, Stepper, StoreProvider, SwipeableListItem, Switch, Table, Tabs, TextToSpeech, Textarea, ThemeProvider, ThreeDotPopoverSimple as ThreeDotPopover, Toast, ToastContainer, ToastProvider, Tooltip, Tour, cn, useApi, useHaptics, useMixins, useTheme, useToast };
|