@dreamtree-org/twreact-ui 1.3.3 → 1.3.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 +13 -6
- package/ai-skills/dreamtree-ui.md +5 -1
- package/dist/ai-schema.json +46 -3
- package/dist/components/core/Button.d.ts.map +1 -1
- package/dist/components/core/Radio.d.ts.map +1 -1
- package/dist/components/core/Select.d.ts.map +1 -1
- package/dist/components/core/Table/MobileCard.d.ts.map +1 -1
- package/dist/components/core/Table/TableRow.d.ts.map +1 -1
- package/dist/components/core/Table/helpers.d.ts +12 -0
- package/dist/components/core/Table/helpers.d.ts.map +1 -1
- package/dist/components/feedback/Dialog.d.ts.map +1 -1
- package/dist/components/feedback/Drawer.d.ts.map +1 -1
- package/dist/components/navigation/FootNav.d.ts.map +1 -1
- package/dist/components/utility/Badge.d.ts.map +1 -1
- package/dist/components/utility/Stepper.d.ts.map +1 -1
- package/dist/esm/components/blocks/StatusPill.js +1 -1
- package/dist/esm/components/core/Button.js +23 -6
- package/dist/esm/components/core/Radio.js +3 -2
- package/dist/esm/components/core/Select.js +12 -2
- package/dist/esm/components/core/Table/ActionMenu.js +5 -5
- package/dist/esm/components/core/Table/ColumnMenu.js +1 -1
- package/dist/esm/components/core/Table/FieldInput.js +5 -5
- package/dist/esm/components/core/Table/MobileCard.js +9 -10
- package/dist/esm/components/core/Table/MobileFilters.js +1 -1
- package/dist/esm/components/core/Table/Pagination.js +1 -1
- package/dist/esm/components/core/Table/Table.js +12 -12
- package/dist/esm/components/core/Table/TableRow.js +10 -11
- package/dist/esm/components/core/Table/helpers.js +16 -1
- package/dist/esm/components/feedback/Dialog.js +4 -2
- package/dist/esm/components/feedback/Drawer.js +39 -10
- package/dist/esm/components/navigation/Dropdown.js +1 -1
- package/dist/esm/components/navigation/FootNav.js +41 -14
- package/dist/esm/components/navigation/Navbar.js +21 -21
- package/dist/esm/components/navigation/Sidebar.js +12 -12
- package/dist/esm/components/utility/Badge.js +1 -0
- package/dist/esm/components/utility/Card.js +5 -5
- package/dist/esm/components/utility/Stepper.js +5 -2
- package/dist/esm/hooks/useSwipeToClose.js +66 -0
- package/dist/esm/utils/touchTarget.js +6 -0
- package/dist/hooks/useSwipeToClose.d.ts +24 -0
- package/dist/hooks/useSwipeToClose.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +287 -121
- package/dist/index.js +287 -121
- package/dist/types/index.d.ts +29 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/touchTarget.d.ts +2 -0
- package/dist/utils/touchTarget.d.ts.map +1 -0
- package/doc/README.md +1 -1
- package/mcp/README.md +1 -1
- package/mcp/catalog.snapshot.json +60 -30
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -3429,7 +3429,7 @@ var Input = /*#__PURE__*/forwardRef(function (props, forwardedRef) {
|
|
|
3429
3429
|
});
|
|
3430
3430
|
Input.displayName = "Input";
|
|
3431
3431
|
|
|
3432
|
-
var _excluded$N = ["className", "variant", "size", "disabled", "loading", "children", "leftIcon", "rightIcon", "fullWidth"];
|
|
3432
|
+
var _excluded$N = ["className", "variant", "size", "disabled", "loading", "children", "leftIcon", "rightIcon", "fullWidth", "as", "onClick"];
|
|
3433
3433
|
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; }
|
|
3434
3434
|
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; }
|
|
3435
3435
|
var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
@@ -3444,12 +3444,19 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3444
3444
|
leftIcon = _ref.leftIcon,
|
|
3445
3445
|
rightIcon = _ref.rightIcon,
|
|
3446
3446
|
fullWidth = _ref.fullWidth,
|
|
3447
|
+
as = _ref.as,
|
|
3448
|
+
onClick = _ref.onClick,
|
|
3447
3449
|
props = _objectWithoutProperties$1(_ref, _excluded$N);
|
|
3448
|
-
|
|
3450
|
+
// `as` renders any element or component (an <a>, a router Link) with the
|
|
3451
|
+
// Button's look; a bare `href` implies an <a>.
|
|
3452
|
+
var Component = as || (props.href !== undefined ? 'a' : 'button');
|
|
3453
|
+
var isNativeButton = Component === 'button';
|
|
3454
|
+
var isDisabled = disabled || loading;
|
|
3455
|
+
var baseClasses = cn$1('inline-flex items-center justify-center rounded-md font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none aria-disabled:opacity-50 aria-disabled:pointer-events-none', {
|
|
3449
3456
|
// Variants
|
|
3450
3457
|
'bg-primary-600 text-white hover:bg-primary-700 focus:ring-primary-500': variant === 'primary',
|
|
3451
3458
|
'bg-secondary-100 text-secondary-900 hover:bg-secondary-200 focus:ring-secondary-500': variant === 'secondary',
|
|
3452
|
-
'bg-transparent border border-gray-300 hover:bg-gray-50 focus:ring-primary-500': variant === 'outline',
|
|
3459
|
+
'bg-transparent border border-gray-300 hover:bg-gray-50 focus:ring-primary-500 dark:border-gray-600 dark:text-gray-100 dark:hover:bg-gray-800 dark:focus:ring-offset-gray-900': variant === 'outline',
|
|
3453
3460
|
'bg-transparent text-primary-600 hover:bg-primary-50 focus:ring-primary-500': variant === 'ghost',
|
|
3454
3461
|
'bg-error-600 text-white hover:bg-error-700 focus:ring-error-500': variant === 'destructive',
|
|
3455
3462
|
'bg-success-600 text-white hover:bg-success-700 focus:ring-success-500': variant === 'success',
|
|
@@ -3464,10 +3471,20 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
3464
3471
|
// Full width
|
|
3465
3472
|
'w-full': fullWidth
|
|
3466
3473
|
}, className);
|
|
3467
|
-
return jsxs(
|
|
3474
|
+
return jsxs(Component, _objectSpread$T(_objectSpread$T(_objectSpread$T({
|
|
3468
3475
|
ref: ref,
|
|
3469
|
-
className: baseClasses
|
|
3470
|
-
|
|
3476
|
+
className: baseClasses
|
|
3477
|
+
}, isNativeButton ? {
|
|
3478
|
+
disabled: isDisabled
|
|
3479
|
+
}
|
|
3480
|
+
// Links can't be `disabled`: announce it and swallow the click instead.
|
|
3481
|
+
: isDisabled && {
|
|
3482
|
+
'aria-disabled': true,
|
|
3483
|
+
tabIndex: -1
|
|
3484
|
+
}), {}, {
|
|
3485
|
+
onClick: !isNativeButton && isDisabled ? function (e) {
|
|
3486
|
+
return e.preventDefault();
|
|
3487
|
+
} : onClick
|
|
3471
3488
|
}, props), {}, {
|
|
3472
3489
|
children: [loading && jsx(Loader2, {
|
|
3473
3490
|
className: "mr-2 h-4 w-4 animate-spin"
|
|
@@ -3514,7 +3531,7 @@ function useLatestRef(value) {
|
|
|
3514
3531
|
return ref;
|
|
3515
3532
|
}
|
|
3516
3533
|
|
|
3517
|
-
var _excluded$M = ["options", "value", "onChange", "placeholder", "label", "error", "helperText", "disabled", "required", "multiSelect", "searchable", "grouped", "onMenuItemRender", "className", "allowClear", "creatable", "onCreateOption", "onSearch", "loading", "selectAllOption", "closeOnSelect", "maxTagCount", "renderGroupLabel", "name"];
|
|
3534
|
+
var _excluded$M = ["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"];
|
|
3518
3535
|
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; }
|
|
3519
3536
|
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; }
|
|
3520
3537
|
/**
|
|
@@ -3615,6 +3632,14 @@ var highlight = function highlight() {
|
|
|
3615
3632
|
}), label.slice(idx + term.length)]
|
|
3616
3633
|
});
|
|
3617
3634
|
};
|
|
3635
|
+
// Trigger sizes. min-h (not h) so multi-select tags can wrap. `md` keeps its
|
|
3636
|
+
// desktop look but grows to the 44px touch target on coarse pointers; `lg` is
|
|
3637
|
+
// 44px everywhere.
|
|
3638
|
+
var SIZE_CLASSES$1 = {
|
|
3639
|
+
sm: "min-h-8 px-2.5 py-1 text-xs",
|
|
3640
|
+
md: "min-h-[38px] px-3 py-2 text-sm [@media(pointer:coarse)]:min-h-11",
|
|
3641
|
+
lg: "min-h-11 px-4 py-2.5 text-base"
|
|
3642
|
+
};
|
|
3618
3643
|
var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef) {
|
|
3619
3644
|
var _ref$options = _ref.options,
|
|
3620
3645
|
options = _ref$options === void 0 ? [] : _ref$options,
|
|
@@ -3651,6 +3676,8 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
3651
3676
|
maxTagCount = _ref$maxTagCount === void 0 ? 3 : _ref$maxTagCount,
|
|
3652
3677
|
renderGroupLabel = _ref.renderGroupLabel,
|
|
3653
3678
|
name = _ref.name,
|
|
3679
|
+
_ref$size = _ref.size,
|
|
3680
|
+
size = _ref$size === void 0 ? "md" : _ref$size,
|
|
3654
3681
|
props = _objectWithoutProperties$1(_ref, _excluded$M);
|
|
3655
3682
|
var _useState = useState(false),
|
|
3656
3683
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -4221,7 +4248,7 @@ var Select = /*#__PURE__*/React__default.forwardRef(function (_ref, forwardedRef
|
|
|
4221
4248
|
"aria-labelledby": label ? "".concat(labelId, " ").concat(valueId) : valueId,
|
|
4222
4249
|
"aria-describedby": describedBy,
|
|
4223
4250
|
"aria-invalid": error ? true : undefined,
|
|
4224
|
-
className: cn$1("flex w-full items-center justify-between rounded-md border border-gray-300
|
|
4251
|
+
className: cn$1("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$1[size] || SIZE_CLASSES$1.md, {
|
|
4225
4252
|
"border-error-500 focus:ring-error-500": error,
|
|
4226
4253
|
"text-primary-500": !selectedOptions.length,
|
|
4227
4254
|
"pr-14": showClearButton
|
|
@@ -4802,6 +4829,21 @@ var getRowKey = function getRowKey(row, globalIndex) {
|
|
|
4802
4829
|
if (row._id !== undefined && row._id !== null) return String(row._id);
|
|
4803
4830
|
return String(globalIndex);
|
|
4804
4831
|
};
|
|
4832
|
+
/**
|
|
4833
|
+
* A `stripedColors` entry is either a CSS colour ("#f7fafc", "rgb(...)") applied as an
|
|
4834
|
+
* inline background, or a Tailwind class ("bg-surface", "dark:bg-gray-900") applied as a
|
|
4835
|
+
* className. Returns the props to spread onto the striped element.
|
|
4836
|
+
*/
|
|
4837
|
+
var getStripeProps = function getStripeProps(stripe) {
|
|
4838
|
+
if (!stripe) return {};
|
|
4839
|
+
return /(^|[\s:])bg-/.test(stripe) ? {
|
|
4840
|
+
className: stripe
|
|
4841
|
+
} : {
|
|
4842
|
+
style: {
|
|
4843
|
+
backgroundColor: stripe
|
|
4844
|
+
}
|
|
4845
|
+
};
|
|
4846
|
+
};
|
|
4805
4847
|
/**
|
|
4806
4848
|
* Resolve a value that may be supplied directly or as a per-row producer.
|
|
4807
4849
|
* Used for an action's `label`, `icon`, `hidden` and `disabled`.
|
|
@@ -4939,7 +4981,7 @@ function useClickOutside(refs, isActive, onClickOutside) {
|
|
|
4939
4981
|
* Pagination controls component for the table
|
|
4940
4982
|
* Supports both header (icon-only) and footer (with page numbers) variants
|
|
4941
4983
|
*/
|
|
4942
|
-
var DEFAULT_ROW_HOVER$1 = "bg-
|
|
4984
|
+
var DEFAULT_ROW_HOVER$1 = "bg-background";
|
|
4943
4985
|
// Header pagination (compact, icon-based)
|
|
4944
4986
|
function PaginationHeader(_ref) {
|
|
4945
4987
|
var _theme$rowHover;
|
|
@@ -5084,7 +5126,7 @@ function PaginationFooter(_ref2) {
|
|
|
5084
5126
|
});
|
|
5085
5127
|
}
|
|
5086
5128
|
|
|
5087
|
-
var DEFAULT_ROW_HOVER = "bg-
|
|
5129
|
+
var DEFAULT_ROW_HOVER = "bg-background";
|
|
5088
5130
|
/**
|
|
5089
5131
|
* Column visibility toggle menu
|
|
5090
5132
|
*/
|
|
@@ -5148,7 +5190,7 @@ function MobileFilters(_ref) {
|
|
|
5148
5190
|
handleFilter = _ref.handleFilter;
|
|
5149
5191
|
var idPrefix = React__default.useId();
|
|
5150
5192
|
return jsxs("div", {
|
|
5151
|
-
className: "mb-4 p-3 bg-
|
|
5193
|
+
className: "mb-4 p-3 bg-background rounded-lg",
|
|
5152
5194
|
children: [jsxs("div", {
|
|
5153
5195
|
className: "flex items-center justify-between mb-3",
|
|
5154
5196
|
children: [jsx("h3", {
|
|
@@ -5205,8 +5247,8 @@ function MobileFilters(_ref) {
|
|
|
5205
5247
|
});
|
|
5206
5248
|
}
|
|
5207
5249
|
|
|
5208
|
-
var DEFAULT_MENU_BG = "bg-
|
|
5209
|
-
var DEFAULT_MENU_ITEM_HOVER = "opacity-75 hover:opacity-100 hover:bg-gray-100/80 active:bg-gray-200/80";
|
|
5250
|
+
var DEFAULT_MENU_BG = "bg-surface border border-line shadow-xl";
|
|
5251
|
+
var DEFAULT_MENU_ITEM_HOVER = "opacity-75 hover:opacity-100 hover:bg-gray-100/80 active:bg-gray-200/80 dark:hover:bg-gray-800 dark:active:bg-gray-700";
|
|
5210
5252
|
function ActionMenu(_ref) {
|
|
5211
5253
|
var _theme$menuBg, _theme$menuItemHover;
|
|
5212
5254
|
var _ref$actions = _ref.actions,
|
|
@@ -5410,7 +5452,7 @@ function ActionMenu(_ref) {
|
|
|
5410
5452
|
children: jsx("div", {
|
|
5411
5453
|
className: "p-1.5 space-y-0.5",
|
|
5412
5454
|
children: !Array.isArray(actions) || actions.length === 0 ? jsx("div", {
|
|
5413
|
-
className: "px-3 py-2 text-sm text-
|
|
5455
|
+
className: "px-3 py-2 text-sm text-muted italic",
|
|
5414
5456
|
children: "No actions"
|
|
5415
5457
|
}) : actions.map(function (action, idx) {
|
|
5416
5458
|
var _action$name;
|
|
@@ -5421,7 +5463,7 @@ function ActionMenu(_ref) {
|
|
|
5421
5463
|
type: "button",
|
|
5422
5464
|
disabled: isDisabled,
|
|
5423
5465
|
"aria-disabled": isDisabled || undefined,
|
|
5424
|
-
className: cn$1("w-full text-left px-3 py-2 text-sm flex items-center gap-2.5 rounded-lg transition-colors font-medium", isDisabled ? "opacity-50 cursor-not-allowed text-
|
|
5466
|
+
className: cn$1("w-full text-left px-3 py-2 text-sm flex items-center gap-2.5 rounded-lg transition-colors font-medium", isDisabled ? "opacity-50 cursor-not-allowed text-muted" : ["text-foreground", menuItemHover, isFocused ? "bg-gray-100 text-gray-900 ring-1 ring-gray-300 dark:bg-gray-800 dark:text-foreground dark:ring-gray-600" : ""]),
|
|
5425
5467
|
onMouseEnter: function onMouseEnter() {
|
|
5426
5468
|
return !isDisabled && setFocusedIndex(idx);
|
|
5427
5469
|
},
|
|
@@ -5433,7 +5475,7 @@ function ActionMenu(_ref) {
|
|
|
5433
5475
|
},
|
|
5434
5476
|
children: action.render ? action.render(row) : jsxs(Fragment, {
|
|
5435
5477
|
children: [action.icon && jsx("span", {
|
|
5436
|
-
className: "inline-flex text-
|
|
5478
|
+
className: "inline-flex text-muted flex-shrink-0",
|
|
5437
5479
|
children: action.icon
|
|
5438
5480
|
}), jsx("span", {
|
|
5439
5481
|
className: "truncate",
|
|
@@ -5528,6 +5570,7 @@ function TableRow(_ref) {
|
|
|
5528
5570
|
var safeExtraRowClass = typeof extraRowClass === "string" ? extraRowClass.trim() : "";
|
|
5529
5571
|
var stripeColors = theme === null || theme === void 0 ? void 0 : theme.stripedColors;
|
|
5530
5572
|
var stripeBg = stripedRows && !isSelected && Array.isArray(stripeColors) && stripeColors.length > 0 ? stripeColors[globalIndex % stripeColors.length] : undefined;
|
|
5573
|
+
var stripeProps = getStripeProps(stripeBg);
|
|
5531
5574
|
var rowKey = isNewRow ? row._key : key;
|
|
5532
5575
|
var isRowActive = interactive && (activeCell === null || activeCell === void 0 ? void 0 : activeCell.rowKey) === rowKey;
|
|
5533
5576
|
var effectiveRow = React__default.useMemo(function () {
|
|
@@ -5536,10 +5579,8 @@ function TableRow(_ref) {
|
|
|
5536
5579
|
}, [interactive, pendingEdits, rowKey, row]);
|
|
5537
5580
|
return jsxs(React__default.Fragment, {
|
|
5538
5581
|
children: [jsxs("tr", {
|
|
5539
|
-
style:
|
|
5540
|
-
|
|
5541
|
-
} : undefined,
|
|
5542
|
-
className: cn$1(theme !== null && theme !== void 0 && theme.rowHover ? ["hover:" + theme.rowHover] : [], {
|
|
5582
|
+
style: stripeProps.style,
|
|
5583
|
+
className: cn$1(stripeProps.className, theme !== null && theme !== void 0 && theme.rowHover ? ["hover:" + theme.rowHover] : [], {
|
|
5543
5584
|
"cursor-pointer": !!onRowClick,
|
|
5544
5585
|
"bg-primary-50": isSelected,
|
|
5545
5586
|
"bg-primary-50/20": isRowActive && !isSelected,
|
|
@@ -5558,7 +5599,7 @@ function TableRow(_ref) {
|
|
|
5558
5599
|
},
|
|
5559
5600
|
"aria-expanded": isExpanded,
|
|
5560
5601
|
"aria-label": isExpanded ? "Collapse row details" : "Expand row details",
|
|
5561
|
-
className: "p-1 rounded hover:bg-gray-100",
|
|
5602
|
+
className: "p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
5562
5603
|
children: isExpanded ? "▾" : "▸"
|
|
5563
5604
|
})
|
|
5564
5605
|
}), showSerial && jsx("td", {
|
|
@@ -5594,9 +5635,9 @@ function TableRow(_ref) {
|
|
|
5594
5635
|
title: isCellInvalid ? "Field \"".concat(column.label || column.key, "\" is required or invalid") : undefined,
|
|
5595
5636
|
className: cn$1("px-6 py-4 text-sm transition-all", wrapCell ? "whitespace-normal break-words" : "whitespace-nowrap", {
|
|
5596
5637
|
"ring-2 ring-error-500 ring-inset bg-error-50/40 relative z-10": isCellInvalid && !isCellEditing,
|
|
5597
|
-
"ring-2 ring-error-600 ring-inset bg-
|
|
5638
|
+
"ring-2 ring-error-600 ring-inset bg-surface p-1 z-20 relative": isCellEditing && isCellInvalid,
|
|
5598
5639
|
"ring-2 ring-primary-500 ring-inset bg-primary-50/50 relative z-10": isCellActive && !isCellEditing && !isCellInvalid,
|
|
5599
|
-
"ring-2 ring-primary-600 ring-inset bg-
|
|
5640
|
+
"ring-2 ring-primary-600 ring-inset bg-surface p-1 z-20 relative": isCellEditing && !isCellInvalid
|
|
5600
5641
|
}, safeExtraCellClass),
|
|
5601
5642
|
onClick: function onClick() {
|
|
5602
5643
|
if (interactive && onCellClick) {
|
|
@@ -5643,7 +5684,7 @@ function TableRow(_ref) {
|
|
|
5643
5684
|
if (action.disabled) return;
|
|
5644
5685
|
handleOnAction(action, row);
|
|
5645
5686
|
},
|
|
5646
|
-
className: cn$1("p-1 rounded", action.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-gray-100"),
|
|
5687
|
+
className: cn$1("p-1 rounded", action.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-gray-100 dark:hover:bg-gray-800"),
|
|
5647
5688
|
children: action.render ? action.render(row) : (_action$icon = action.icon) !== null && _action$icon !== void 0 ? _action$icon : jsx("span", {
|
|
5648
5689
|
className: "text-xs",
|
|
5649
5690
|
children: actionLabel
|
|
@@ -5659,7 +5700,7 @@ function TableRow(_ref) {
|
|
|
5659
5700
|
return toggleActions(e, actionCellKey, row);
|
|
5660
5701
|
},
|
|
5661
5702
|
"aria-expanded": activeActionRowKey === actionCellKey,
|
|
5662
|
-
className: "p-1 rounded hover:bg-gray-100",
|
|
5703
|
+
className: "p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
5663
5704
|
title: "Actions",
|
|
5664
5705
|
children: jsx(MoreVertical, {
|
|
5665
5706
|
className: "h-4 w-4"
|
|
@@ -5683,7 +5724,7 @@ function TableRow(_ref) {
|
|
|
5683
5724
|
colSpan: visibleCount,
|
|
5684
5725
|
className: cn$1(_defineProperty$4(_defineProperty$4({
|
|
5685
5726
|
"px-6 py-4": true
|
|
5686
|
-
}, (_theme$accentColor = theme === null || theme === void 0 ? void 0 : theme.accentColor) !== null && _theme$accentColor !== void 0 ? _theme$accentColor : "bg-
|
|
5727
|
+
}, (_theme$accentColor = theme === null || theme === void 0 ? void 0 : theme.accentColor) !== null && _theme$accentColor !== void 0 ? _theme$accentColor : "bg-background", true), (_theme$rowHover = theme === null || theme === void 0 ? void 0 : theme.rowHover) !== null && _theme$rowHover !== void 0 ? _theme$rowHover : "bg-background", true)),
|
|
5687
5728
|
children: jsx(DetailsComponent, {
|
|
5688
5729
|
row: row,
|
|
5689
5730
|
index: globalIndex
|
|
@@ -5748,11 +5789,10 @@ function MobileCard(_ref) {
|
|
|
5748
5789
|
var hasActions = withAction && (inlineActions.length > 0 || menuActions.length > 0);
|
|
5749
5790
|
var showHeader = showDetailsToggle || selectable || showSerial || hasActions;
|
|
5750
5791
|
var stripeBg = stripedRows && !isSelected && Array.isArray(stripedColors) && stripedColors.length > 0 ? stripedColors[globalIndex % stripedColors.length] : undefined;
|
|
5792
|
+
var stripeProps = getStripeProps(stripeBg);
|
|
5751
5793
|
return jsxs("div", {
|
|
5752
|
-
style:
|
|
5753
|
-
|
|
5754
|
-
} : undefined,
|
|
5755
|
-
className: cn$1("border rounded-lg mb-3 shadow-sm overflow-hidden transition-all duration-200", {
|
|
5794
|
+
style: stripeProps.style,
|
|
5795
|
+
className: cn$1(stripeProps.className, "border border-line rounded-lg mb-3 shadow-sm overflow-hidden transition-all duration-200", {
|
|
5756
5796
|
"cursor-pointer": !!onRowClick,
|
|
5757
5797
|
"bg-primary-50 border-primary-200": isSelected,
|
|
5758
5798
|
"hover:shadow-md": !isSelected
|
|
@@ -5761,7 +5801,7 @@ function MobileCard(_ref) {
|
|
|
5761
5801
|
return onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(row, globalIndex);
|
|
5762
5802
|
},
|
|
5763
5803
|
children: [showHeader && jsxs("div", {
|
|
5764
|
-
className: "flex items-center justify-between p-4 border-b bg-
|
|
5804
|
+
className: "flex items-center justify-between p-4 border-b border-line bg-background",
|
|
5765
5805
|
children: [jsxs("div", {
|
|
5766
5806
|
className: "flex items-center gap-3",
|
|
5767
5807
|
children: [showDetailsToggle && jsx("button", {
|
|
@@ -5772,7 +5812,7 @@ function MobileCard(_ref) {
|
|
|
5772
5812
|
},
|
|
5773
5813
|
"aria-expanded": isExpanded,
|
|
5774
5814
|
"aria-label": isExpanded ? "Collapse row details" : "Expand row details",
|
|
5775
|
-
className: "p-1 rounded hover:bg-gray-200",
|
|
5815
|
+
className: "p-1 rounded hover:bg-gray-200 dark:hover:bg-gray-700",
|
|
5776
5816
|
children: isExpanded ? "▾" : "▸"
|
|
5777
5817
|
}), selectable && jsx("input", {
|
|
5778
5818
|
type: "checkbox",
|
|
@@ -5806,7 +5846,7 @@ function MobileCard(_ref) {
|
|
|
5806
5846
|
if (action.disabled) return;
|
|
5807
5847
|
handleOnAction(action, row);
|
|
5808
5848
|
},
|
|
5809
|
-
className: cn$1("p-1.5 rounded", action.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-gray-200"),
|
|
5849
|
+
className: cn$1("p-1.5 rounded", action.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-gray-200 dark:hover:bg-gray-700"),
|
|
5810
5850
|
children: action.render ? action.render(row) : (_action$icon = action.icon) !== null && _action$icon !== void 0 ? _action$icon : jsx("span", {
|
|
5811
5851
|
className: "text-xs",
|
|
5812
5852
|
children: actionLabel
|
|
@@ -5823,7 +5863,7 @@ function MobileCard(_ref) {
|
|
|
5823
5863
|
return toggleActions(e, actionCellKey, row);
|
|
5824
5864
|
},
|
|
5825
5865
|
"aria-expanded": activeActionRowKey === actionCellKey,
|
|
5826
|
-
className: "p-1.5 rounded hover:bg-gray-200",
|
|
5866
|
+
className: "p-1.5 rounded hover:bg-gray-200 dark:hover:bg-gray-700",
|
|
5827
5867
|
title: "Actions",
|
|
5828
5868
|
"aria-label": "Actions",
|
|
5829
5869
|
children: jsx(MoreVertical, {
|
|
@@ -5865,7 +5905,7 @@ function MobileCard(_ref) {
|
|
|
5865
5905
|
}, column.key);
|
|
5866
5906
|
})
|
|
5867
5907
|
}), showDetailsToggle && isExpanded && DetailsComponent && jsx("div", {
|
|
5868
|
-
className: "border-t bg-
|
|
5908
|
+
className: "border-t border-line bg-background p-4",
|
|
5869
5909
|
children: jsx(DetailsComponent, {
|
|
5870
5910
|
row: row,
|
|
5871
5911
|
index: globalIndex
|
|
@@ -5926,7 +5966,7 @@ function FieldInput(_ref) {
|
|
|
5926
5966
|
onClick: stopProp,
|
|
5927
5967
|
onMouseDown: stopProp,
|
|
5928
5968
|
placeholder: "Enter ".concat(column.label || column.key, "..."),
|
|
5929
|
-
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none transition-all focus:ring-2 focus:ring-primary-500 bg-
|
|
5969
|
+
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none transition-all focus:ring-2 focus:ring-primary-500 bg-surface text-foreground resize-y min-h-[2.5rem]", className)
|
|
5930
5970
|
});
|
|
5931
5971
|
}
|
|
5932
5972
|
// Select / Dropdown
|
|
@@ -5946,7 +5986,7 @@ function FieldInput(_ref) {
|
|
|
5946
5986
|
onKeyDown: onKeyDown,
|
|
5947
5987
|
onClick: stopProp,
|
|
5948
5988
|
onMouseDown: stopProp,
|
|
5949
|
-
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none focus:ring-2 focus:ring-primary-500 bg-
|
|
5989
|
+
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none focus:ring-2 focus:ring-primary-500 bg-surface text-foreground", className),
|
|
5950
5990
|
children: [jsxs("option", {
|
|
5951
5991
|
value: "",
|
|
5952
5992
|
children: ["Select ", column.label || column.key]
|
|
@@ -5989,7 +6029,7 @@ function FieldInput(_ref) {
|
|
|
5989
6029
|
onKeyDown: onKeyDown,
|
|
5990
6030
|
onClick: stopProp,
|
|
5991
6031
|
onMouseDown: stopProp,
|
|
5992
|
-
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none focus:ring-2 focus:ring-primary-500 bg-
|
|
6032
|
+
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none focus:ring-2 focus:ring-primary-500 bg-surface text-foreground", className)
|
|
5993
6033
|
});
|
|
5994
6034
|
}
|
|
5995
6035
|
// Number
|
|
@@ -6005,7 +6045,7 @@ function FieldInput(_ref) {
|
|
|
6005
6045
|
onClick: stopProp,
|
|
6006
6046
|
onMouseDown: stopProp,
|
|
6007
6047
|
placeholder: "Enter ".concat(column.label || column.key, "..."),
|
|
6008
|
-
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none focus:ring-2 focus:ring-primary-500 bg-
|
|
6048
|
+
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none focus:ring-2 focus:ring-primary-500 bg-surface text-foreground", className)
|
|
6009
6049
|
});
|
|
6010
6050
|
}
|
|
6011
6051
|
// Default: Text
|
|
@@ -6020,7 +6060,7 @@ function FieldInput(_ref) {
|
|
|
6020
6060
|
onClick: stopProp,
|
|
6021
6061
|
onMouseDown: stopProp,
|
|
6022
6062
|
placeholder: "Enter ".concat(column.label || column.key, "..."),
|
|
6023
|
-
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none focus:ring-2 focus:ring-primary-500 bg-
|
|
6063
|
+
className: cn$1("w-full px-2 py-1 text-sm border rounded outline-none focus:ring-2 focus:ring-primary-500 bg-surface text-foreground", className)
|
|
6024
6064
|
});
|
|
6025
6065
|
}
|
|
6026
6066
|
|
|
@@ -6031,11 +6071,11 @@ function _objectSpread$P(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
6031
6071
|
var DEFAULT_DATA = [];
|
|
6032
6072
|
var DEFAULT_COLUMNS = [];
|
|
6033
6073
|
var DEFAULT_THEME = {
|
|
6034
|
-
stripedColors: ["bg-
|
|
6035
|
-
rowHover: "bg-
|
|
6036
|
-
accentColor: "bg-
|
|
6037
|
-
menuBg: "bg-
|
|
6038
|
-
menuItemHover: "hover:bg-
|
|
6074
|
+
stripedColors: ["bg-surface", "bg-background"],
|
|
6075
|
+
rowHover: "bg-background",
|
|
6076
|
+
accentColor: "bg-background",
|
|
6077
|
+
menuBg: "bg-surface",
|
|
6078
|
+
menuItemHover: "hover:bg-background"
|
|
6039
6079
|
};
|
|
6040
6080
|
var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
6041
6081
|
var _validationErrors$;
|
|
@@ -7250,7 +7290,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
7250
7290
|
onClick: handleClearChanges,
|
|
7251
7291
|
disabled: isSaving,
|
|
7252
7292
|
title: "Discard all pending modifications",
|
|
7253
|
-
className: "px-4 py-2 font-medium rounded-lg text-sm flex items-center gap-2 transition-all border border-primary-300 text-primary-700 bg-
|
|
7293
|
+
className: "px-4 py-2 font-medium rounded-lg text-sm flex items-center gap-2 transition-all border border-primary-300 text-primary-700 bg-surface hover:bg-primary-50 dark:text-primary-300 dark:border-primary-700 dark:hover:bg-primary-900/40 active:bg-primary-100 cursor-pointer shadow-sm disabled:opacity-50",
|
|
7254
7294
|
children: [jsx(X, {
|
|
7255
7295
|
className: "w-4 h-4 text-primary-600"
|
|
7256
7296
|
}), jsx("span", {
|
|
@@ -7294,7 +7334,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
7294
7334
|
onKeyDown: onGlobalKeyDown
|
|
7295
7335
|
}), jsx("button", {
|
|
7296
7336
|
onClick: applyGlobalSearch,
|
|
7297
|
-
className: "absolute right-2 top-1/2 transform -translate-y-1/2 p-2 rounded-lg hover:bg-gray-100",
|
|
7337
|
+
className: "absolute right-2 top-1/2 transform -translate-y-1/2 p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
7298
7338
|
title: "Search",
|
|
7299
7339
|
children: jsx(Search, {
|
|
7300
7340
|
className: "h-4 w-4 text-primary-400"
|
|
@@ -7305,7 +7345,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
7305
7345
|
setSearchInput("");
|
|
7306
7346
|
handleFilter("global", "");
|
|
7307
7347
|
},
|
|
7308
|
-
className: "whitespace-nowrap rounded-lg md:rounded-md border border-gray-300 px-4 py-3 md:py-2 text-sm hover:bg-gray-100 w-full sm:w-auto",
|
|
7348
|
+
className: "whitespace-nowrap rounded-lg md:rounded-md border border-gray-300 px-4 py-3 md:py-2 text-sm hover:bg-gray-100 dark:hover:bg-gray-800 w-full sm:w-auto",
|
|
7309
7349
|
children: "Clear"
|
|
7310
7350
|
})]
|
|
7311
7351
|
})
|
|
@@ -7329,7 +7369,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
7329
7369
|
}), !isMobileView && jsx("div", {
|
|
7330
7370
|
className: "overflow-x-auto overflow-y-visible",
|
|
7331
7371
|
children: jsxs("table", _objectSpread$P(_objectSpread$P({
|
|
7332
|
-
className: cn$1("min-w-full divide-y divide-
|
|
7372
|
+
className: cn$1("min-w-full divide-y divide-line", className)
|
|
7333
7373
|
}, props), {}, {
|
|
7334
7374
|
children: [jsxs("thead", {
|
|
7335
7375
|
className: safeTheme.accentColor,
|
|
@@ -7351,7 +7391,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
7351
7391
|
var _column$rules;
|
|
7352
7392
|
return jsx("th", {
|
|
7353
7393
|
className: cn$1("px-6 py-3 text-left text-xs font-medium text-primary-700 uppercase tracking-wider", {
|
|
7354
|
-
"cursor-pointer hover:bg-gray-100": sortable && column.sortable !== false
|
|
7394
|
+
"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800": sortable && column.sortable !== false
|
|
7355
7395
|
}),
|
|
7356
7396
|
onClick: function onClick() {
|
|
7357
7397
|
return column.sortable !== false && handleSort(column.key);
|
|
@@ -7395,7 +7435,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
7395
7435
|
return !s;
|
|
7396
7436
|
});
|
|
7397
7437
|
},
|
|
7398
|
-
className: "p-1 rounded hover:bg-gray-100",
|
|
7438
|
+
className: "p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
7399
7439
|
children: jsx(MoreVertical, {
|
|
7400
7440
|
className: "h-4 w-4"
|
|
7401
7441
|
})
|
|
@@ -7431,7 +7471,7 @@ var Table = /*#__PURE__*/forwardRef(function Table(_ref, ref) {
|
|
|
7431
7471
|
})]
|
|
7432
7472
|
})]
|
|
7433
7473
|
}), jsx("tbody", {
|
|
7434
|
-
className: "divide-y divide-
|
|
7474
|
+
className: "divide-y divide-line",
|
|
7435
7475
|
children: loading ? jsx("tr", {
|
|
7436
7476
|
children: jsx("td", {
|
|
7437
7477
|
colSpan: visibleCount,
|
|
@@ -17205,7 +17245,8 @@ var Radio = /*#__PURE__*/forwardRef(function Radio(_ref, ref) {
|
|
|
17205
17245
|
props = _objectWithoutProperties$1(_ref, _excluded$A);
|
|
17206
17246
|
var autoId = useId();
|
|
17207
17247
|
var inputId = id || "".concat(autoId, "-radio");
|
|
17208
|
-
|
|
17248
|
+
// Default to the brand's primary token so the radio follows theming.
|
|
17249
|
+
var accentColor = radioColor || "rgb(var(--dt-primary-600))";
|
|
17209
17250
|
var _useState = useState(!!defaultChecked),
|
|
17210
17251
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17211
17252
|
internalChecked = _useState2[0],
|
|
@@ -17263,7 +17304,7 @@ var Radio = /*#__PURE__*/forwardRef(function Radio(_ref, ref) {
|
|
|
17263
17304
|
"--radio-accent": accentColor
|
|
17264
17305
|
},
|
|
17265
17306
|
children: jsx("span", {
|
|
17266
|
-
className: cn("flex items-center justify-center rounded-full border transition-colors duration-150 ease-in-out border-slate-300", sizeClasses.outer, disabled ? "bg-slate-100" : "bg-white", isChecked ? "shadow-inner" : ""),
|
|
17307
|
+
className: cn("flex items-center justify-center rounded-full border transition-colors duration-150 ease-in-out border-slate-300 dark:border-gray-600", sizeClasses.outer, disabled ? "bg-slate-100 dark:bg-gray-800" : "bg-white dark:bg-gray-900", isChecked ? "shadow-inner" : ""),
|
|
17267
17308
|
children: jsx("span", {
|
|
17268
17309
|
"aria-hidden": true,
|
|
17269
17310
|
className: cn("rounded-full transform transition-all duration-200 ease-out", sizeClasses.dot),
|
|
@@ -20038,8 +20079,8 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
20038
20079
|
}
|
|
20039
20080
|
}), {}, {
|
|
20040
20081
|
className: cn$1("flex items-center rounded-md px-3 py-2 text-sm font-medium transition-colors", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500", {
|
|
20041
|
-
"bg-primary-100 text-primary-700": isActive,
|
|
20042
|
-
"hover:bg-gray-100": !isActive && !item.disabled,
|
|
20082
|
+
"bg-primary-100 text-primary-700 dark:bg-primary-900/40 dark:text-primary-300": isActive,
|
|
20083
|
+
"hover:bg-gray-100 dark:hover:bg-gray-800": !isActive && !item.disabled,
|
|
20043
20084
|
"cursor-pointer": !item.disabled,
|
|
20044
20085
|
"cursor-not-allowed opacity-50": item.disabled,
|
|
20045
20086
|
"justify-center": labelHidden
|
|
@@ -20068,7 +20109,7 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
20068
20109
|
})]
|
|
20069
20110
|
}) : item.badge
|
|
20070
20111
|
}), hasChildren && jsx("span", {
|
|
20071
|
-
className: "ml-2 flex-shrink-0 rounded p-0.5 hover:bg-gray-200",
|
|
20112
|
+
className: "ml-2 flex-shrink-0 rounded p-0.5 hover:bg-gray-200 dark:hover:bg-gray-700",
|
|
20072
20113
|
"aria-hidden": "true",
|
|
20073
20114
|
"data-sidebar-chevron": "",
|
|
20074
20115
|
onClick: hasHref ? function (e) {
|
|
@@ -20118,7 +20159,7 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
20118
20159
|
}),
|
|
20119
20160
|
"data-sidebar-section": section.key || "",
|
|
20120
20161
|
children: [effectiveCollapsed && idx > 0 && jsx("hr", {
|
|
20121
|
-
className: "mx-2 my-2 border-
|
|
20162
|
+
className: "mx-2 my-2 border-line",
|
|
20122
20163
|
"aria-hidden": "true"
|
|
20123
20164
|
}), section.key && (effectiveCollapsed ? jsx("span", {
|
|
20124
20165
|
id: headingId,
|
|
@@ -20126,7 +20167,7 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
20126
20167
|
children: section.key
|
|
20127
20168
|
}) : jsx("p", {
|
|
20128
20169
|
id: headingId,
|
|
20129
|
-
className: "px-3 pb-1 pt-2 text-micro font-semibold uppercase tracking-wide text-
|
|
20170
|
+
className: "px-3 pb-1 pt-2 text-micro font-semibold uppercase tracking-wide text-muted",
|
|
20130
20171
|
children: section.key
|
|
20131
20172
|
})), section.items.map(function (item) {
|
|
20132
20173
|
return _renderMenuItem(item, 0, pane);
|
|
@@ -20165,7 +20206,7 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
20165
20206
|
return jsx("button", {
|
|
20166
20207
|
type: "button",
|
|
20167
20208
|
onClick: handleUserClick,
|
|
20168
|
-
className: cn$1(base, "cursor-pointer hover:bg-gray-100 transition-colors", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"),
|
|
20209
|
+
className: cn$1(base, "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors", "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500"),
|
|
20169
20210
|
"aria-label": effectiveCollapsed && !user.avatar ? user.name : undefined,
|
|
20170
20211
|
children: content
|
|
20171
20212
|
});
|
|
@@ -20179,26 +20220,26 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
20179
20220
|
}) : footer;
|
|
20180
20221
|
if (content === undefined || content === null || content === false) return null;
|
|
20181
20222
|
return jsx("div", {
|
|
20182
|
-
className: "border-t border-
|
|
20223
|
+
className: "border-t border-line p-4",
|
|
20183
20224
|
"data-sidebar-footer": "",
|
|
20184
20225
|
children: content
|
|
20185
20226
|
});
|
|
20186
20227
|
};
|
|
20187
20228
|
var renderSidebarContent = function renderSidebarContent(pane) {
|
|
20188
20229
|
return jsxs("div", {
|
|
20189
|
-
className: cn$1("flex h-full flex-col bg-
|
|
20230
|
+
className: cn$1("flex h-full flex-col bg-surface text-foreground border-r border-line shadow-sm", "w-64 transition-all duration-200", {
|
|
20190
20231
|
"w-16": effectiveCollapsed,
|
|
20191
20232
|
"w-64": !effectiveCollapsed
|
|
20192
20233
|
}),
|
|
20193
20234
|
children: [jsxs("div", {
|
|
20194
|
-
className: "flex h-16 items-center justify-between border-b border-
|
|
20235
|
+
className: "flex h-16 items-center justify-between border-b border-line px-4",
|
|
20195
20236
|
children: [!effectiveCollapsed && logo && jsx("div", {
|
|
20196
20237
|
className: "flex items-center",
|
|
20197
20238
|
children: logo
|
|
20198
20239
|
}), jsx("button", {
|
|
20199
20240
|
type: "button",
|
|
20200
20241
|
onClick: handleToggleClick,
|
|
20201
|
-
className: "rounded-md p-1 hover:bg-gray-100",
|
|
20242
|
+
className: "rounded-md p-1 hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
20202
20243
|
"aria-label": effectiveCollapsed ? "Expand sidebar" : "Collapse sidebar",
|
|
20203
20244
|
children: effectiveCollapsed ? jsx(ChevronRight, {
|
|
20204
20245
|
className: "h-5 w-5"
|
|
@@ -20207,10 +20248,10 @@ var Sidebar = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
20207
20248
|
})
|
|
20208
20249
|
})]
|
|
20209
20250
|
}), jsx("nav", {
|
|
20210
|
-
className: "flex-1 space-y-1 overflow-y-auto p-4 [&::-webkit-scrollbar]:w-2\n [&::-webkit-scrollbar-track]:bg-gray-100\n [&::-webkit-scrollbar-thumb]:bg-gray-300\n hover:[&::-webkit-scrollbar-thumb]:bg-gray-400",
|
|
20251
|
+
className: "flex-1 space-y-1 overflow-y-auto p-4 [&::-webkit-scrollbar]:w-2\n [&::-webkit-scrollbar-track]:bg-gray-100 dark:[&::-webkit-scrollbar-track]:bg-gray-800\n [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-thumb]:bg-gray-700\n hover:[&::-webkit-scrollbar-thumb]:bg-gray-400",
|
|
20211
20252
|
children: renderNavContent(pane)
|
|
20212
20253
|
}), renderFooter(pane), user && jsx("div", {
|
|
20213
|
-
className: "border-t border-
|
|
20254
|
+
className: "border-t border-line p-4",
|
|
20214
20255
|
children: jsx("div", {
|
|
20215
20256
|
className: "relative",
|
|
20216
20257
|
children: renderUserBlock()
|
|
@@ -20311,7 +20352,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
20311
20352
|
},
|
|
20312
20353
|
children: trigger
|
|
20313
20354
|
}), isOpen && jsx("div", {
|
|
20314
|
-
className: "absolute z-50 bg-
|
|
20355
|
+
className: "absolute z-50 bg-surface text-foreground border border-line rounded-md shadow-lg ".concat(placementClasses[placement], " min-w-48"),
|
|
20315
20356
|
children: children
|
|
20316
20357
|
})]
|
|
20317
20358
|
}));
|
|
@@ -20461,7 +20502,7 @@ var NotificationsDropdown = function NotificationsDropdown(_ref) {
|
|
|
20461
20502
|
// For simplicity, shows notifications in the dropdown, can be expanded
|
|
20462
20503
|
return jsx(Dropdown, {
|
|
20463
20504
|
trigger: jsxs("button", {
|
|
20464
|
-
className: "relative rounded-md p-2 text-primary-400 hover:text-primary-500 hover:bg-gray-100",
|
|
20505
|
+
className: "relative rounded-md p-2 text-primary-400 hover:text-primary-500 hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
20465
20506
|
"aria-label": "notifications",
|
|
20466
20507
|
children: [jsx(Bell, {
|
|
20467
20508
|
className: "h-5 w-5"
|
|
@@ -20474,9 +20515,9 @@ var NotificationsDropdown = function NotificationsDropdown(_ref) {
|
|
|
20474
20515
|
children: jsxs("div", {
|
|
20475
20516
|
className: "py-2 min-w-56 max-h-80 overflow-y-auto",
|
|
20476
20517
|
children: [jsxs("div", {
|
|
20477
|
-
className: "px-4 py-2 border-b border-
|
|
20518
|
+
className: "px-4 py-2 border-b border-line flex items-center justify-between",
|
|
20478
20519
|
children: [jsx("span", {
|
|
20479
|
-
className: "font-medium text-primary-800 text-sm",
|
|
20520
|
+
className: "font-medium text-primary-800 dark:text-primary-100 text-sm",
|
|
20480
20521
|
children: "Notifications"
|
|
20481
20522
|
}), jsx("button", {
|
|
20482
20523
|
className: "text-xs text-primary-400 hover:text-error-600",
|
|
@@ -20492,16 +20533,16 @@ var NotificationsDropdown = function NotificationsDropdown(_ref) {
|
|
|
20492
20533
|
children: "No notifications"
|
|
20493
20534
|
}) : notifications.map(function (n) {
|
|
20494
20535
|
return jsxs("div", {
|
|
20495
|
-
className: cn$1("flex items-start gap-3 px-4 py-2 hover:bg-gray-50 cursor-pointer group", !n.read ? "bg-primary-50" : ""),
|
|
20536
|
+
className: cn$1("flex items-start gap-3 px-4 py-2 hover:bg-gray-50 dark:hover:bg-gray-800 cursor-pointer group", !n.read ? "bg-primary-50 dark:bg-primary-900/40" : ""),
|
|
20496
20537
|
onClick: function onClick() {
|
|
20497
20538
|
return onView();
|
|
20498
20539
|
},
|
|
20499
20540
|
children: [jsx("span", {
|
|
20500
|
-
className: cn$1("h-2 w-2 mt-2 rounded-full", !n.read ? "bg-primary-500" : "bg-gray-300")
|
|
20541
|
+
className: cn$1("h-2 w-2 mt-2 rounded-full", !n.read ? "bg-primary-500" : "bg-gray-300 dark:bg-gray-600")
|
|
20501
20542
|
}), jsxs("div", {
|
|
20502
20543
|
className: "flex-1",
|
|
20503
20544
|
children: [jsx("div", {
|
|
20504
|
-
className: "text-sm text-primary-800",
|
|
20545
|
+
className: "text-sm text-primary-800 dark:text-primary-100",
|
|
20505
20546
|
children: n.title
|
|
20506
20547
|
}), n.message && jsx("div", {
|
|
20507
20548
|
className: "text-xs text-primary-500",
|
|
@@ -20553,10 +20594,10 @@ var RightMenuContent = function RightMenuContent(_ref2) {
|
|
|
20553
20594
|
});
|
|
20554
20595
|
};
|
|
20555
20596
|
var styledClassNames = {
|
|
20556
|
-
button: "rounded-md p-2 text-primary-400 hover:text-primary-500 hover:bg-gray-100",
|
|
20597
|
+
button: "rounded-md p-2 text-primary-400 hover:text-primary-500 hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
20557
20598
|
mobileItem: "md:hidden",
|
|
20558
20599
|
icon: "h-6 w-6",
|
|
20559
|
-
dropdown: "w-56 rounded-md border border-
|
|
20600
|
+
dropdown: "w-56 rounded-md border border-line bg-surface py-1 shadow-lg"
|
|
20560
20601
|
};
|
|
20561
20602
|
var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
20562
20603
|
var emitter = _ref3.emitter,
|
|
@@ -20641,7 +20682,7 @@ var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
20641
20682
|
},
|
|
20642
20683
|
className: cn$1("block w-full text-left px-4 py-2 text-sm", {
|
|
20643
20684
|
"text-primary-600": item.active,
|
|
20644
|
-
"hover:bg-gray-50": !item.active
|
|
20685
|
+
"hover:bg-gray-50 dark:hover:bg-gray-800": !item.active
|
|
20645
20686
|
}),
|
|
20646
20687
|
children: item.label
|
|
20647
20688
|
}, item.id);
|
|
@@ -20656,7 +20697,7 @@ var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
20656
20697
|
};
|
|
20657
20698
|
return jsxs("nav", _objectSpread$p(_objectSpread$p({
|
|
20658
20699
|
ref: ref,
|
|
20659
|
-
className: cn$1("bg-
|
|
20700
|
+
className: cn$1("bg-surface text-foreground border-b border-line px-4 sm:px-6 lg:px-8", className)
|
|
20660
20701
|
}, props), {}, {
|
|
20661
20702
|
children: [jsxs("div", {
|
|
20662
20703
|
className: "flex h-16 min-w-0 items-center justify-between gap-2 sm:gap-4",
|
|
@@ -20669,7 +20710,7 @@ var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
20669
20710
|
className: "flex min-w-0 items-center",
|
|
20670
20711
|
children: [leftIcon !== false && jsx("button", {
|
|
20671
20712
|
onClick: onLeftIconClick,
|
|
20672
|
-
className: "shrink-0 md:hidden rounded-md p-2 text-primary-400 hover:text-primary-500 hover:bg-gray-100",
|
|
20713
|
+
className: "shrink-0 md:hidden rounded-md p-2 text-primary-400 hover:text-primary-500 hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
20673
20714
|
"aria-label": "back",
|
|
20674
20715
|
children: leftIcon
|
|
20675
20716
|
}), logo && jsx("div", {
|
|
@@ -20696,7 +20737,7 @@ var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
20696
20737
|
}), jsx("input", {
|
|
20697
20738
|
type: "text",
|
|
20698
20739
|
placeholder: "Search...",
|
|
20699
|
-
className: "w-64 rounded-md border border-gray-300 bg-
|
|
20740
|
+
className: "w-64 rounded-md border border-gray-300 bg-surface text-foreground dark:border-gray-700 pl-10 pr-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent",
|
|
20700
20741
|
value: searchTerm,
|
|
20701
20742
|
onChange: function onChange(e) {
|
|
20702
20743
|
return setSearchTerm(e.target.value);
|
|
@@ -20759,9 +20800,9 @@ var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
20759
20800
|
children: jsxs("div", {
|
|
20760
20801
|
className: styledClassNames.dropdown,
|
|
20761
20802
|
children: [jsxs("div", {
|
|
20762
|
-
className: "px-4 py-2 border-b border-
|
|
20803
|
+
className: "px-4 py-2 border-b border-line",
|
|
20763
20804
|
children: [jsx("p", {
|
|
20764
|
-
className: "text-sm font-medium text-primary-900",
|
|
20805
|
+
className: "text-sm font-medium text-primary-900 dark:text-primary-100",
|
|
20765
20806
|
children: user.name
|
|
20766
20807
|
}), jsx("p", {
|
|
20767
20808
|
className: "text-xs text-primary-500",
|
|
@@ -20771,23 +20812,23 @@ var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
20771
20812
|
className: "py-1",
|
|
20772
20813
|
children: renderNavItems(true)
|
|
20773
20814
|
}), user.menuItems && user.menuItems.length > 0 && jsx("div", {
|
|
20774
|
-
className: "border-t border-
|
|
20815
|
+
className: "border-t border-line",
|
|
20775
20816
|
children: user.menuItems.map(function (mi) {
|
|
20776
20817
|
return jsx("button", {
|
|
20777
20818
|
onClick: function onClick(e) {
|
|
20778
20819
|
var _mi$onClick;
|
|
20779
20820
|
return mi === null || mi === void 0 || (_mi$onClick = mi.onClick) === null || _mi$onClick === void 0 ? void 0 : _mi$onClick.call(mi, e);
|
|
20780
20821
|
},
|
|
20781
|
-
className: "block w-full px-4 py-2 text-left text-sm hover:bg-gray-100",
|
|
20822
|
+
className: "block w-full px-4 py-2 text-left text-sm hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
20782
20823
|
children: mi.label
|
|
20783
20824
|
}, mi.id);
|
|
20784
20825
|
})
|
|
20785
20826
|
}), jsx("div", {
|
|
20786
|
-
className: "border-t border-
|
|
20827
|
+
className: "border-t border-line sm:hidden",
|
|
20787
20828
|
children: jsxs("button", {
|
|
20788
20829
|
type: "button",
|
|
20789
20830
|
onClick: handleLogoutClick,
|
|
20790
|
-
className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm hover:bg-gray-100",
|
|
20831
|
+
className: "flex w-full items-center gap-2 px-4 py-2 text-left text-sm hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
20791
20832
|
children: [jsx(LogOut, {
|
|
20792
20833
|
className: "h-4 w-4",
|
|
20793
20834
|
"aria-hidden": "true"
|
|
@@ -20801,13 +20842,13 @@ var Navbar = /*#__PURE__*/React__default.forwardRef(function (_ref3, ref) {
|
|
|
20801
20842
|
}), isMobileMenuOpen && !user && jsx("div", {
|
|
20802
20843
|
className: "md:hidden h-full",
|
|
20803
20844
|
children: jsx("div", {
|
|
20804
|
-
className: "space-y-1 border-t border-
|
|
20845
|
+
className: "space-y-1 border-t border-line px-2 pt-4 pb-3",
|
|
20805
20846
|
children: items.map(function (item) {
|
|
20806
20847
|
return jsx("a", {
|
|
20807
20848
|
href: item.href,
|
|
20808
20849
|
className: cn$1("block rounded-md px-3 py-2 text-base font-medium", {
|
|
20809
|
-
"bg-primary-50 text-primary-700": item.active,
|
|
20810
|
-
"hover:bg-gray-50": !item.active
|
|
20850
|
+
"bg-primary-50 text-primary-700 dark:bg-primary-900/40 dark:text-primary-300": item.active,
|
|
20851
|
+
"hover:bg-gray-50 dark:hover:bg-gray-800": !item.active
|
|
20811
20852
|
}),
|
|
20812
20853
|
children: item.label
|
|
20813
20854
|
}, item.id);
|
|
@@ -20834,11 +20875,28 @@ function _objectSpread$o(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
20834
20875
|
var hasBadge = function hasBadge(badge) {
|
|
20835
20876
|
return badge === 0 || Boolean(badge);
|
|
20836
20877
|
};
|
|
20837
|
-
|
|
20838
|
-
|
|
20839
|
-
|
|
20840
|
-
|
|
20841
|
-
|
|
20878
|
+
// Only aria-* and data-* item keys reach the DOM (e.g. aria-haspopup="dialog"
|
|
20879
|
+
// on an item that opens a sheet); the rest of the item is data, not attributes.
|
|
20880
|
+
var passthrough = function passthrough(item) {
|
|
20881
|
+
return Object.fromEntries(Object.entries(item).filter(function (_ref) {
|
|
20882
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
|
20883
|
+
key = _ref2[0];
|
|
20884
|
+
return /^(aria|data)-/.test(key);
|
|
20885
|
+
}));
|
|
20886
|
+
};
|
|
20887
|
+
var Badge$1 = function Badge(_ref3) {
|
|
20888
|
+
var badge = _ref3.badge;
|
|
20889
|
+
return jsx("span", {
|
|
20890
|
+
className: "absolute -top-1.5 left-full -ml-2 flex h-4 min-w-4 items-center justify-center rounded-full bg-error-600 px-1 text-micro font-semibold text-white",
|
|
20891
|
+
"data-slot": "badge",
|
|
20892
|
+
children: badge
|
|
20893
|
+
});
|
|
20894
|
+
};
|
|
20895
|
+
var FootNav = /*#__PURE__*/React__default.forwardRef(function (_ref4, ref) {
|
|
20896
|
+
var _ref4$items = _ref4.items,
|
|
20897
|
+
items = _ref4$items === void 0 ? [] : _ref4$items,
|
|
20898
|
+
className = _ref4.className,
|
|
20899
|
+
props = _objectWithoutProperties$1(_ref4, _excluded$k);
|
|
20842
20900
|
return jsx("nav", _objectSpread$o(_objectSpread$o({
|
|
20843
20901
|
ref: ref,
|
|
20844
20902
|
className: cn$1('fixed bottom-0 left-0 right-0 bg-surface border-t border-line px-2 py-2 md:hidden', className)
|
|
@@ -20847,27 +20905,37 @@ var FootNav = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
20847
20905
|
className: "flex items-stretch justify-around gap-1",
|
|
20848
20906
|
children: items.map(function (item, index) {
|
|
20849
20907
|
var _item$id;
|
|
20850
|
-
|
|
20908
|
+
var isAction = item.variant === 'action';
|
|
20909
|
+
return jsxs("button", _objectSpread$o(_objectSpread$o({
|
|
20851
20910
|
type: "button",
|
|
20852
20911
|
"aria-current": item.active ? 'page' : undefined,
|
|
20853
|
-
|
|
20912
|
+
"data-variant": isAction ? 'action' : undefined
|
|
20913
|
+
}, passthrough(item)), {}, {
|
|
20914
|
+
className: cn$1('relative flex min-w-0 flex-1 flex-col items-center gap-1 rounded-md px-1 py-2 text-xs transition-colors', 'focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-1 motion-reduce:transition-none', isAction ? 'group justify-start py-0 font-medium text-muted' : item.active ? 'bg-primary-50 font-semibold text-primary-700 dark:bg-primary-900/40 dark:text-primary-300' : 'font-medium text-muted hover:bg-gray-100 hover:text-foreground dark:hover:bg-gray-800'),
|
|
20854
20915
|
onClick: function onClick() {
|
|
20855
20916
|
var _item$onClick;
|
|
20856
20917
|
return (_item$onClick = item.onClick) === null || _item$onClick === void 0 ? void 0 : _item$onClick.call(item, item);
|
|
20857
20918
|
},
|
|
20858
|
-
children: [
|
|
20919
|
+
children: [isAction ?
|
|
20920
|
+
// Raised primary circle (FAB): 56px, lifted above the bar and
|
|
20921
|
+
// ringed in the surface colour so it reads as cut out of the bar.
|
|
20922
|
+
jsxs("span", {
|
|
20923
|
+
className: "relative -mt-7 inline-flex h-14 w-14 items-center justify-center rounded-full bg-primary-600 text-2xl text-white shadow-lg ring-4 ring-surface transition-colors group-hover:bg-primary-700 motion-reduce:transition-none",
|
|
20924
|
+
"data-slot": "icon",
|
|
20925
|
+
children: [item.icon, hasBadge(item.badge) && jsx(Badge$1, {
|
|
20926
|
+
badge: item.badge
|
|
20927
|
+
})]
|
|
20928
|
+
}) : jsxs("span", {
|
|
20859
20929
|
className: "relative inline-flex text-lg",
|
|
20860
20930
|
"data-slot": "icon",
|
|
20861
|
-
children: [item.icon, hasBadge(item.badge) && jsx(
|
|
20862
|
-
|
|
20863
|
-
"data-slot": "badge",
|
|
20864
|
-
children: item.badge
|
|
20931
|
+
children: [item.icon, hasBadge(item.badge) && jsx(Badge$1, {
|
|
20932
|
+
badge: item.badge
|
|
20865
20933
|
})]
|
|
20866
20934
|
}), jsx("span", {
|
|
20867
20935
|
className: "block max-w-full truncate",
|
|
20868
20936
|
children: item.label
|
|
20869
20937
|
})]
|
|
20870
|
-
}, (_item$id = item.id) !== null && _item$id !== void 0 ? _item$id : index);
|
|
20938
|
+
}), (_item$id = item.id) !== null && _item$id !== void 0 ? _item$id : index);
|
|
20871
20939
|
})
|
|
20872
20940
|
})
|
|
20873
20941
|
}));
|
|
@@ -20943,6 +21011,11 @@ var Breadcrumbs = /*#__PURE__*/React__default.forwardRef(function (_ref2, ref) {
|
|
|
20943
21011
|
});
|
|
20944
21012
|
Breadcrumbs.displayName = 'Breadcrumbs';
|
|
20945
21013
|
|
|
21014
|
+
// Internal (not exported). Grows an icon-only control to the 44×44 px minimum
|
|
21015
|
+
// touch target (WCAG 2.5.5, Apple HIG) on coarse pointers only, so desktop
|
|
21016
|
+
// layouts keep their compact size. Pair with inline-flex centering.
|
|
21017
|
+
var TOUCH_TARGET = "[@media(pointer:coarse)]:min-h-11 [@media(pointer:coarse)]:min-w-11";
|
|
21018
|
+
|
|
20946
21019
|
var _excluded$i = ["isOpen", "onClose", "title", "children", "size", "dismissible", "showCloseButton", "footer", "className", "onOpen"],
|
|
20947
21020
|
_excluded2$2 = ["children", "className"],
|
|
20948
21021
|
_excluded3$2 = ["children", "className"],
|
|
@@ -21079,11 +21152,12 @@ var Dialog = /*#__PURE__*/React__default.forwardRef(function (_ref, _ref3) {
|
|
|
21079
21152
|
children: title
|
|
21080
21153
|
}), showCloseButton && jsx("button", {
|
|
21081
21154
|
type: "button",
|
|
21082
|
-
className:
|
|
21155
|
+
className: cn$1('inline-flex items-center justify-center rounded-md p-1 text-primary-400 hover:text-primary-600 hover:bg-gray-100', TOUCH_TARGET),
|
|
21083
21156
|
onClick: onClose,
|
|
21084
21157
|
"aria-label": "Close dialog",
|
|
21085
21158
|
children: jsx(X, {
|
|
21086
|
-
className: "h-5 w-5"
|
|
21159
|
+
className: "h-5 w-5",
|
|
21160
|
+
"aria-hidden": "true"
|
|
21087
21161
|
})
|
|
21088
21162
|
})]
|
|
21089
21163
|
}), jsx("div", {
|
|
@@ -21602,7 +21676,68 @@ function useScrollLock(active) {
|
|
|
21602
21676
|
}, [active]);
|
|
21603
21677
|
}
|
|
21604
21678
|
|
|
21605
|
-
|
|
21679
|
+
// Internal (not exported). Drag-down-to-dismiss for a bottom sheet. Spread
|
|
21680
|
+
// `dragProps` on the grab zone (handle + header), not the scrolling body, so a
|
|
21681
|
+
// swipe never fights the content's own scroll. Past `threshold` px (or a quick
|
|
21682
|
+
// flick) the drag calls onClose; otherwise the sheet snaps back.
|
|
21683
|
+
var FLICK_VELOCITY = 0.5; // px per ms
|
|
21684
|
+
function useSwipeToClose(_ref) {
|
|
21685
|
+
var enabled = _ref.enabled,
|
|
21686
|
+
onClose = _ref.onClose,
|
|
21687
|
+
_ref$threshold = _ref.threshold,
|
|
21688
|
+
threshold = _ref$threshold === void 0 ? 80 : _ref$threshold;
|
|
21689
|
+
var _useState = useState(0),
|
|
21690
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
21691
|
+
offset = _useState2[0],
|
|
21692
|
+
setOffset = _useState2[1];
|
|
21693
|
+
var _useState3 = useState(false),
|
|
21694
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
21695
|
+
dragging = _useState4[0],
|
|
21696
|
+
setDragging = _useState4[1];
|
|
21697
|
+
var start = useRef(null);
|
|
21698
|
+
var end = useCallback(function (e) {
|
|
21699
|
+
if (!start.current) return;
|
|
21700
|
+
var dy = Math.max(0, e.clientY - start.current.y);
|
|
21701
|
+
var elapsed = Math.max(1, Date.now() - start.current.t);
|
|
21702
|
+
start.current = null;
|
|
21703
|
+
setDragging(false);
|
|
21704
|
+
setOffset(0);
|
|
21705
|
+
if (dy >= threshold || dy > 16 && dy / elapsed >= FLICK_VELOCITY) onClose === null || onClose === void 0 || onClose();
|
|
21706
|
+
}, [onClose, threshold]);
|
|
21707
|
+
if (!enabled) return {
|
|
21708
|
+
dragProps: {},
|
|
21709
|
+
offset: 0,
|
|
21710
|
+
dragging: false
|
|
21711
|
+
};
|
|
21712
|
+
return {
|
|
21713
|
+
offset: offset,
|
|
21714
|
+
dragging: dragging,
|
|
21715
|
+
dragProps: {
|
|
21716
|
+
onPointerDown: function onPointerDown(e) {
|
|
21717
|
+
var _e$currentTarget$setP, _e$currentTarget;
|
|
21718
|
+
if (e.button !== undefined && e.button !== 0) return;
|
|
21719
|
+
start.current = {
|
|
21720
|
+
y: e.clientY,
|
|
21721
|
+
t: Date.now()
|
|
21722
|
+
};
|
|
21723
|
+
setDragging(true);
|
|
21724
|
+
(_e$currentTarget$setP = (_e$currentTarget = e.currentTarget).setPointerCapture) === null || _e$currentTarget$setP === void 0 || _e$currentTarget$setP.call(_e$currentTarget, e.pointerId);
|
|
21725
|
+
},
|
|
21726
|
+
onPointerMove: function onPointerMove(e) {
|
|
21727
|
+
if (!start.current) return;
|
|
21728
|
+
setOffset(Math.max(0, e.clientY - start.current.y));
|
|
21729
|
+
},
|
|
21730
|
+
onPointerUp: end,
|
|
21731
|
+
onPointerCancel: function onPointerCancel() {
|
|
21732
|
+
start.current = null;
|
|
21733
|
+
setDragging(false);
|
|
21734
|
+
setOffset(0);
|
|
21735
|
+
}
|
|
21736
|
+
}
|
|
21737
|
+
};
|
|
21738
|
+
}
|
|
21739
|
+
|
|
21740
|
+
var _excluded$f = ["isOpen", "onClose", "title", "description", "children", "placement", "size", "dismissible", "showCloseButton", "footer", "initialFocusRef", "handle", "swipeToClose", "className", "style"],
|
|
21606
21741
|
_excluded2$1 = ["className"],
|
|
21607
21742
|
_excluded3$1 = ["className"],
|
|
21608
21743
|
_excluded4$1 = ["className"];
|
|
@@ -21612,7 +21747,8 @@ var PLACEMENT_CLASSES = {
|
|
|
21612
21747
|
right: "inset-y-0 right-0 h-full w-full border-l",
|
|
21613
21748
|
left: "inset-y-0 left-0 h-full w-full border-r",
|
|
21614
21749
|
top: "inset-x-0 top-0 w-full border-b",
|
|
21615
|
-
|
|
21750
|
+
// Bottom sheet: rounded top and room for the home indicator (safe area).
|
|
21751
|
+
bottom: "inset-x-0 bottom-0 w-full overflow-hidden rounded-t-2xl border-t pb-[env(safe-area-inset-bottom)]"
|
|
21616
21752
|
};
|
|
21617
21753
|
var SIDE_SIZES = {
|
|
21618
21754
|
sm: "max-w-xs",
|
|
@@ -21635,7 +21771,7 @@ var CloseButton = function CloseButton(_ref) {
|
|
|
21635
21771
|
type: "button",
|
|
21636
21772
|
onClick: onClose,
|
|
21637
21773
|
"aria-label": "Close drawer",
|
|
21638
|
-
className: cn$1("rounded-md p-1 text-gray-500 hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2", "dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200 dark:focus:ring-offset-gray-900", className),
|
|
21774
|
+
className: cn$1("inline-flex items-center justify-center rounded-md p-1 text-gray-500 hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2", "dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200 dark:focus:ring-offset-gray-900", TOUCH_TARGET, className),
|
|
21639
21775
|
children: jsx(X, {
|
|
21640
21776
|
className: "h-5 w-5",
|
|
21641
21777
|
"aria-hidden": "true"
|
|
@@ -21658,7 +21794,11 @@ var Drawer = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref3) {
|
|
|
21658
21794
|
showCloseButton = _ref2$showCloseButton === void 0 ? true : _ref2$showCloseButton,
|
|
21659
21795
|
footer = _ref2.footer,
|
|
21660
21796
|
initialFocusRef = _ref2.initialFocusRef,
|
|
21797
|
+
handle = _ref2.handle,
|
|
21798
|
+
_ref2$swipeToClose = _ref2.swipeToClose,
|
|
21799
|
+
swipeToClose = _ref2$swipeToClose === void 0 ? false : _ref2$swipeToClose,
|
|
21661
21800
|
className = _ref2.className,
|
|
21801
|
+
style = _ref2.style,
|
|
21662
21802
|
props = _objectWithoutProperties$1(_ref2, _excluded$f);
|
|
21663
21803
|
var panelRef = useRef(null);
|
|
21664
21804
|
var titleId = "drawer-title-".concat(useId());
|
|
@@ -21668,6 +21808,17 @@ var Drawer = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref3) {
|
|
|
21668
21808
|
// Without title/description/footer the children are the panel content, so
|
|
21669
21809
|
// Drawer.Header / Drawer.Body / Drawer.Footer compose without double padding.
|
|
21670
21810
|
var composed = !title && !description && !footer;
|
|
21811
|
+
var showHandle = handle !== null && handle !== void 0 ? handle : side === "bottom";
|
|
21812
|
+
var swipe = useSwipeToClose({
|
|
21813
|
+
enabled: swipeToClose && side === "bottom" && dismissible,
|
|
21814
|
+
onClose: onClose
|
|
21815
|
+
});
|
|
21816
|
+
// The grab zone (handle + header) starts a swipe; the scrolling body never does.
|
|
21817
|
+
var grabProps = swipeToClose && side === "bottom" && dismissible ? _objectSpread$j(_objectSpread$j({}, swipe.dragProps), {}, {
|
|
21818
|
+
className: "touch-none cursor-grab"
|
|
21819
|
+
}) : {
|
|
21820
|
+
className: ""
|
|
21821
|
+
};
|
|
21671
21822
|
useScrollLock(isOpen);
|
|
21672
21823
|
useFocusTrap(panelRef, {
|
|
21673
21824
|
active: isOpen,
|
|
@@ -21686,7 +21837,7 @@ var Drawer = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref3) {
|
|
|
21686
21837
|
onClick: function onClick() {
|
|
21687
21838
|
return dismissible && (onClose === null || onClose === void 0 ? void 0 : onClose());
|
|
21688
21839
|
}
|
|
21689
|
-
}),
|
|
21840
|
+
}), jsxs("div", _objectSpread$j(_objectSpread$j({
|
|
21690
21841
|
ref: function ref(node) {
|
|
21691
21842
|
return setRefs$1(node, panelRef, _ref3);
|
|
21692
21843
|
},
|
|
@@ -21696,16 +21847,27 @@ var Drawer = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref3) {
|
|
|
21696
21847
|
"aria-describedby": description ? descriptionId : undefined,
|
|
21697
21848
|
tabIndex: -1,
|
|
21698
21849
|
"data-placement": side,
|
|
21699
|
-
className: cn$1("absolute flex flex-col 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", "animate-fade-in motion-reduce:animate-none", PLACEMENT_CLASSES[side], (isEdge ? EDGE_SIZES : SIDE_SIZES)[size] || (isEdge ? EDGE_SIZES.md : SIDE_SIZES.md), className)
|
|
21850
|
+
className: cn$1("absolute flex flex-col 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", "animate-fade-in motion-reduce:animate-none", PLACEMENT_CLASSES[side], (isEdge ? EDGE_SIZES : SIDE_SIZES)[size] || (isEdge ? EDGE_SIZES.md : SIDE_SIZES.md), !swipe.dragging && "transition-transform duration-200 ease-out motion-reduce:transition-none", className),
|
|
21851
|
+
style: swipe.offset ? _objectSpread$j(_objectSpread$j({}, style), {}, {
|
|
21852
|
+
transform: "translateY(".concat(swipe.offset, "px)")
|
|
21853
|
+
}) : style
|
|
21700
21854
|
}, props), {}, {
|
|
21701
|
-
children:
|
|
21855
|
+
children: [showHandle && jsx("div", _objectSpread$j(_objectSpread$j({
|
|
21856
|
+
"aria-hidden": "true",
|
|
21857
|
+
"data-testid": "drawer-handle"
|
|
21858
|
+
}, grabProps), {}, {
|
|
21859
|
+
className: cn$1("flex shrink-0 justify-center pb-1 pt-3", grabProps.className),
|
|
21860
|
+
children: jsx("span", {
|
|
21861
|
+
className: "h-1.5 w-10 rounded-full bg-gray-300 dark:bg-gray-600"
|
|
21862
|
+
})
|
|
21863
|
+
})), composed ? jsxs(Fragment, {
|
|
21702
21864
|
children: [showCloseButton && jsx(CloseButton, {
|
|
21703
21865
|
onClose: onClose,
|
|
21704
21866
|
className: "absolute right-3 top-3"
|
|
21705
21867
|
}), children]
|
|
21706
21868
|
}) : jsxs(Fragment, {
|
|
21707
|
-
children: [jsxs("div", {
|
|
21708
|
-
className: "flex items-start justify-between gap-4 border-b border-gray-200 px-6 py-4 dark:border-gray-700",
|
|
21869
|
+
children: [jsxs("div", _objectSpread$j(_objectSpread$j({}, grabProps), {}, {
|
|
21870
|
+
className: cn$1("flex items-start justify-between gap-4 border-b border-gray-200 px-6 py-4 dark:border-gray-700", showHandle && "pt-2", grabProps.className),
|
|
21709
21871
|
children: [jsxs("div", {
|
|
21710
21872
|
className: "min-w-0",
|
|
21711
21873
|
children: [title && jsx("h2", {
|
|
@@ -21720,14 +21882,14 @@ var Drawer = /*#__PURE__*/React__default.forwardRef(function (_ref2, _ref3) {
|
|
|
21720
21882
|
}), showCloseButton && jsx(CloseButton, {
|
|
21721
21883
|
onClose: onClose
|
|
21722
21884
|
})]
|
|
21723
|
-
}), jsx("div", {
|
|
21885
|
+
})), jsx("div", {
|
|
21724
21886
|
className: "min-h-0 flex-1 overflow-y-auto px-6 py-4",
|
|
21725
21887
|
children: children
|
|
21726
21888
|
}), footer && jsx("div", {
|
|
21727
21889
|
className: "flex items-center justify-end gap-3 border-t border-gray-200 px-6 py-4 dark:border-gray-700",
|
|
21728
21890
|
children: footer
|
|
21729
21891
|
})]
|
|
21730
|
-
})
|
|
21892
|
+
})]
|
|
21731
21893
|
}))]
|
|
21732
21894
|
}), document.body);
|
|
21733
21895
|
});
|
|
@@ -22135,6 +22297,7 @@ var Badge = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
22135
22297
|
success: 'bg-success-100 text-success-800',
|
|
22136
22298
|
warning: 'bg-warning-100 text-warning-800',
|
|
22137
22299
|
error: 'bg-error-100 text-error-800',
|
|
22300
|
+
info: 'bg-info-100 text-info-800',
|
|
22138
22301
|
outline: 'border border-gray-300'
|
|
22139
22302
|
};
|
|
22140
22303
|
var sizes = {
|
|
@@ -22173,7 +22336,7 @@ var Card = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
22173
22336
|
props = _objectWithoutProperties$1(_ref, _excluded$c);
|
|
22174
22337
|
return jsx("div", _objectSpread$g(_objectSpread$g({
|
|
22175
22338
|
ref: ref,
|
|
22176
|
-
className: cn$1('rounded-lg border border-
|
|
22339
|
+
className: cn$1('rounded-lg border border-line bg-surface shadow-sm', {
|
|
22177
22340
|
'hover:shadow-md transition-shadow': hover
|
|
22178
22341
|
}, className)
|
|
22179
22342
|
}, props), {}, {
|
|
@@ -22186,7 +22349,7 @@ var CardHeader = function CardHeader(_ref2) {
|
|
|
22186
22349
|
className = _ref2.className,
|
|
22187
22350
|
props = _objectWithoutProperties$1(_ref2, _excluded2);
|
|
22188
22351
|
return jsx("div", _objectSpread$g(_objectSpread$g({
|
|
22189
|
-
className: cn$1('px-6 py-4 border-b border-
|
|
22352
|
+
className: cn$1('px-6 py-4 border-b border-line', className)
|
|
22190
22353
|
}, props), {}, {
|
|
22191
22354
|
children: children
|
|
22192
22355
|
}));
|
|
@@ -22196,7 +22359,7 @@ var CardTitle = function CardTitle(_ref3) {
|
|
|
22196
22359
|
className = _ref3.className,
|
|
22197
22360
|
props = _objectWithoutProperties$1(_ref3, _excluded3);
|
|
22198
22361
|
return jsx("h3", _objectSpread$g(_objectSpread$g({
|
|
22199
|
-
className: cn$1('text-lg font-semibold text-primary-900', className)
|
|
22362
|
+
className: cn$1('text-lg font-semibold text-primary-900 dark:text-primary-100', className)
|
|
22200
22363
|
}, props), {}, {
|
|
22201
22364
|
children: children
|
|
22202
22365
|
}));
|
|
@@ -22206,7 +22369,7 @@ var CardDescription = function CardDescription(_ref4) {
|
|
|
22206
22369
|
className = _ref4.className,
|
|
22207
22370
|
props = _objectWithoutProperties$1(_ref4, _excluded4);
|
|
22208
22371
|
return jsx("p", _objectSpread$g(_objectSpread$g({
|
|
22209
|
-
className: cn$1('text-sm text-primary-600', className)
|
|
22372
|
+
className: cn$1('text-sm text-primary-600 dark:text-primary-300', className)
|
|
22210
22373
|
}, props), {}, {
|
|
22211
22374
|
children: children
|
|
22212
22375
|
}));
|
|
@@ -22226,7 +22389,7 @@ var CardFooter = function CardFooter(_ref6) {
|
|
|
22226
22389
|
className = _ref6.className,
|
|
22227
22390
|
props = _objectWithoutProperties$1(_ref6, _excluded6);
|
|
22228
22391
|
return jsx("div", _objectSpread$g(_objectSpread$g({
|
|
22229
|
-
className: cn$1('px-6 py-4 border-t border-
|
|
22392
|
+
className: cn$1('px-6 py-4 border-t border-line', className)
|
|
22230
22393
|
}, props), {}, {
|
|
22231
22394
|
children: children
|
|
22232
22395
|
}));
|
|
@@ -22387,9 +22550,12 @@ var Stepper = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
22387
22550
|
"aria-label": "Progress"
|
|
22388
22551
|
}, props), {}, {
|
|
22389
22552
|
children: steps.map(function (step, stepIndex) {
|
|
22553
|
+
var _step$title;
|
|
22390
22554
|
var status = getStepStatus(stepIndex);
|
|
22391
22555
|
var isLast = stepIndex === steps.length - 1;
|
|
22392
22556
|
var colors = statusColors[status];
|
|
22557
|
+
// `label` is accepted as an alias for `title` (the docs used `label`).
|
|
22558
|
+
var stepTitle = (_step$title = step.title) !== null && _step$title !== void 0 ? _step$title : step.label;
|
|
22393
22559
|
return jsxs("div", {
|
|
22394
22560
|
className: cn$1('flex items-center', {
|
|
22395
22561
|
'flex-col': orientation === 'horizontal',
|
|
@@ -22409,7 +22575,7 @@ var Stepper = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
22409
22575
|
},
|
|
22410
22576
|
disabled: !onStepClick || stepIndex > currentStep,
|
|
22411
22577
|
"aria-current": status === 'current' ? 'step' : undefined,
|
|
22412
|
-
"aria-label": "Step ".concat(stepIndex + 1).concat(
|
|
22578
|
+
"aria-label": "Step ".concat(stepIndex + 1).concat(stepTitle ? ": ".concat(stepTitle) : '').concat(status === 'completed' ? ' (completed)' : ''),
|
|
22413
22579
|
children: status === 'completed' ? jsx(Check, {
|
|
22414
22580
|
className: "h-4 w-4",
|
|
22415
22581
|
"aria-hidden": "true"
|
|
@@ -22427,7 +22593,7 @@ var Stepper = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
|
22427
22593
|
}),
|
|
22428
22594
|
children: [jsx("span", {
|
|
22429
22595
|
className: cn$1('text-sm font-medium', colors.text),
|
|
22430
|
-
children:
|
|
22596
|
+
children: stepTitle
|
|
22431
22597
|
}), step.description && jsx("span", {
|
|
22432
22598
|
className: "text-xs text-muted",
|
|
22433
22599
|
children: step.description
|
|
@@ -23527,7 +23693,7 @@ function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t
|
|
|
23527
23693
|
// One map from domain state to tone + human label; unknown states are humanized, never shown raw.
|
|
23528
23694
|
var TONE_TO_VARIANT = {
|
|
23529
23695
|
neutral: 'secondary',
|
|
23530
|
-
info: '
|
|
23696
|
+
info: 'info',
|
|
23531
23697
|
success: 'success',
|
|
23532
23698
|
warning: 'warning',
|
|
23533
23699
|
danger: 'error',
|