@nurix/ui-component-library 1.1.7-stage.136 → 1.1.7-stage.138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +102 -5
- package/dist/index.d.ts +102 -5
- package/dist/index.js +502 -320
- package/dist/index.mjs +501 -320
- package/dist/styles.css +28 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6501,6 +6501,7 @@ __export(index_exports, {
|
|
|
6501
6501
|
ChatBubbleUser: () => ChatBubbleUser,
|
|
6502
6502
|
Checkbox: () => Checkbox,
|
|
6503
6503
|
Chip: () => Chip,
|
|
6504
|
+
CircularBadge: () => CircularBadge,
|
|
6504
6505
|
ColumnWidth: () => ColumnWidth,
|
|
6505
6506
|
CompoundFilterSelect: () => CompoundFilterSelect,
|
|
6506
6507
|
DEFAULT_DATE_PRESETS: () => DEFAULT_DATE_PRESETS2,
|
|
@@ -7177,6 +7178,8 @@ var BUTTON_TOKENS = {
|
|
|
7177
7178
|
primary: "bg-token-brand-primary text-fg-white disabled:bg-token-grey disabled:text-fg-grey-secondary disabled:opacity-100",
|
|
7178
7179
|
secondary: "bg-token-grey text-fg-black border-token-light disabled:bg-token-grey disabled:text-fg-grey-secondary disabled:opacity-100",
|
|
7179
7180
|
destructive: "bg-token-destructive-primary text-fg-white disabled:bg-token-grey disabled:text-fg-grey-secondary disabled:opacity-100",
|
|
7181
|
+
// Light amber bg + dark amber text/icon (Figma: 177:13177).
|
|
7182
|
+
warning: "bg-token-warning-secondary text-fg-warning [&>svg]:text-icon-warning disabled:bg-token-grey disabled:text-fg-grey-secondary disabled:opacity-100",
|
|
7180
7183
|
// Outline / link — `hover:` then `active:` so Tailwind emits active-last,
|
|
7181
7184
|
// and the pressed bg (10% black) beats the hover bg (5% black).
|
|
7182
7185
|
outline: "border-token-light bg-transparent text-fg-black hover:bg-token-dark/5 active:bg-interaction-pressed-opacity-secondary disabled:border-token-grey disabled:text-fg-grey-secondary disabled:opacity-100",
|
|
@@ -7229,7 +7232,7 @@ function cn(...inputs) {
|
|
|
7229
7232
|
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
7230
7233
|
}
|
|
7231
7234
|
var withHoverOverlay = (variant) => {
|
|
7232
|
-
return variant === "primary" || variant === "secondary" || variant === "destructive" || variant === "outline" || variant === "link" || variant === "iconPrimary" || variant === "iconSecondary" || variant === "iconOutline" || variant === "iconLink";
|
|
7235
|
+
return variant === "primary" || variant === "secondary" || variant === "destructive" || variant === "warning" || variant === "outline" || variant === "link" || variant === "iconPrimary" || variant === "iconSecondary" || variant === "iconOutline" || variant === "iconLink";
|
|
7233
7236
|
};
|
|
7234
7237
|
|
|
7235
7238
|
// src/button/button.tsx
|
|
@@ -8518,36 +8521,120 @@ var DialogHeaderNavigation = React12.forwardRef(
|
|
|
8518
8521
|
DialogHeaderNavigation.displayName = "DialogHeaderNavigation";
|
|
8519
8522
|
|
|
8520
8523
|
// src/navigation/tabs.tsx
|
|
8521
|
-
var
|
|
8524
|
+
var React15 = __toESM(require("react"));
|
|
8522
8525
|
|
|
8523
|
-
// src/
|
|
8526
|
+
// src/tooltip/tooltip.tsx
|
|
8524
8527
|
var React13 = __toESM(require("react"));
|
|
8525
|
-
var
|
|
8528
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
8529
|
+
|
|
8530
|
+
// src/tooltip/variables.ts
|
|
8531
|
+
var TOOLTIP_TOKENS = {
|
|
8532
|
+
content: {
|
|
8533
|
+
base: "z-50 overflow-hidden rounded-xl px-2 py-2 text-xs leading-4 font-normal",
|
|
8534
|
+
bg: "bg-token-brand-primary text-fg-white"
|
|
8535
|
+
},
|
|
8536
|
+
arrow: "fill-primary",
|
|
8537
|
+
shortcut: {
|
|
8538
|
+
base: "ml-2 inline-flex h-5 min-w-5 items-center justify-center rounded-sm px-1 text-xs leading-4 font-normal",
|
|
8539
|
+
bg: "bg-token-grey",
|
|
8540
|
+
text: "text-fg-grey-secondary"
|
|
8541
|
+
}
|
|
8542
|
+
};
|
|
8543
|
+
|
|
8544
|
+
// src/tooltip/tooltip.tsx
|
|
8545
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
8546
|
+
var useTooltipContainer = (anchorRef) => {
|
|
8547
|
+
const [container, setContainer] = React13.useState(
|
|
8548
|
+
void 0
|
|
8549
|
+
);
|
|
8550
|
+
React13.useEffect(() => {
|
|
8551
|
+
var _a5;
|
|
8552
|
+
if (typeof document === "undefined") return;
|
|
8553
|
+
const anchor = anchorRef.current;
|
|
8554
|
+
const el = (_a5 = anchor == null ? void 0 : anchor.closest(".lego-land")) != null ? _a5 : document.querySelector(".lego-land");
|
|
8555
|
+
setContainer(el != null ? el : void 0);
|
|
8556
|
+
}, [anchorRef]);
|
|
8557
|
+
return container;
|
|
8558
|
+
};
|
|
8559
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
8560
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
8561
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
8562
|
+
var TooltipContent = React13.forwardRef(({ className, sideOffset = 6, shortcut, children, ...props }, ref) => {
|
|
8563
|
+
const anchorRef = React13.useRef(null);
|
|
8564
|
+
const container = useTooltipContainer(anchorRef);
|
|
8565
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
8566
|
+
TooltipPrimitive.Content,
|
|
8567
|
+
{
|
|
8568
|
+
ref,
|
|
8569
|
+
sideOffset,
|
|
8570
|
+
className: cn(
|
|
8571
|
+
TOOLTIP_TOKENS.content.base,
|
|
8572
|
+
TOOLTIP_TOKENS.content.bg,
|
|
8573
|
+
"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
8574
|
+
className
|
|
8575
|
+
),
|
|
8576
|
+
...props,
|
|
8577
|
+
children: [
|
|
8578
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center", children: [
|
|
8579
|
+
children,
|
|
8580
|
+
shortcut && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
8581
|
+
"span",
|
|
8582
|
+
{
|
|
8583
|
+
className: cn(
|
|
8584
|
+
TOOLTIP_TOKENS.shortcut.base,
|
|
8585
|
+
TOOLTIP_TOKENS.shortcut.bg,
|
|
8586
|
+
TOOLTIP_TOKENS.shortcut.text
|
|
8587
|
+
),
|
|
8588
|
+
children: shortcut
|
|
8589
|
+
}
|
|
8590
|
+
)
|
|
8591
|
+
] }),
|
|
8592
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
8593
|
+
TooltipPrimitive.Arrow,
|
|
8594
|
+
{
|
|
8595
|
+
className: TOOLTIP_TOKENS.arrow,
|
|
8596
|
+
style: { fill: "hsl(var(--bg-brand-primary))" }
|
|
8597
|
+
}
|
|
8598
|
+
)
|
|
8599
|
+
]
|
|
8600
|
+
}
|
|
8601
|
+
);
|
|
8602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
8603
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { ref: anchorRef, style: { display: "none" } }),
|
|
8604
|
+
container ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipPrimitive.Portal, { container, children: content }) : content
|
|
8605
|
+
] });
|
|
8606
|
+
});
|
|
8607
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
8608
|
+
|
|
8609
|
+
// src/navigation/useTabs.ts
|
|
8610
|
+
var React14 = __toESM(require("react"));
|
|
8611
|
+
var TabsContext = React14.createContext(null);
|
|
8526
8612
|
function useTabs(props) {
|
|
8527
8613
|
if (props) {
|
|
8528
8614
|
const {
|
|
8529
8615
|
value: valueProp,
|
|
8530
8616
|
defaultValue,
|
|
8531
8617
|
onValueChange,
|
|
8532
|
-
variant = "top"
|
|
8618
|
+
variant = "top",
|
|
8619
|
+
size = "default"
|
|
8533
8620
|
} = props;
|
|
8534
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
8621
|
+
const [uncontrolledValue, setUncontrolledValue] = React14.useState(defaultValue);
|
|
8535
8622
|
const isControlled = valueProp !== void 0;
|
|
8536
8623
|
const value = isControlled ? valueProp : uncontrolledValue;
|
|
8537
|
-
const setValue =
|
|
8624
|
+
const setValue = React14.useCallback(
|
|
8538
8625
|
(next) => {
|
|
8539
8626
|
if (!isControlled) setUncontrolledValue(next);
|
|
8540
8627
|
onValueChange == null ? void 0 : onValueChange(next);
|
|
8541
8628
|
},
|
|
8542
8629
|
[isControlled, onValueChange]
|
|
8543
8630
|
);
|
|
8544
|
-
const ctx2 =
|
|
8545
|
-
() => ({ value, setValue, variant }),
|
|
8546
|
-
[value, setValue, variant]
|
|
8631
|
+
const ctx2 = React14.useMemo(
|
|
8632
|
+
() => ({ value, setValue, variant, size }),
|
|
8633
|
+
[value, setValue, variant, size]
|
|
8547
8634
|
);
|
|
8548
8635
|
return ctx2;
|
|
8549
8636
|
}
|
|
8550
|
-
const ctx =
|
|
8637
|
+
const ctx = React14.useContext(TabsContext);
|
|
8551
8638
|
if (!ctx) {
|
|
8552
8639
|
throw new Error("Tabs components must be used within <Tabs />");
|
|
8553
8640
|
}
|
|
@@ -8555,24 +8642,25 @@ function useTabs(props) {
|
|
|
8555
8642
|
}
|
|
8556
8643
|
|
|
8557
8644
|
// src/navigation/tabs.tsx
|
|
8558
|
-
var
|
|
8645
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
8559
8646
|
function Tabs({
|
|
8560
8647
|
className,
|
|
8561
8648
|
value,
|
|
8562
8649
|
defaultValue,
|
|
8563
8650
|
onValueChange,
|
|
8564
8651
|
variant,
|
|
8652
|
+
size,
|
|
8565
8653
|
...props
|
|
8566
8654
|
}) {
|
|
8567
|
-
const ctx = useTabs({ value, defaultValue, onValueChange, variant });
|
|
8568
|
-
return /* @__PURE__ */ (0,
|
|
8655
|
+
const ctx = useTabs({ value, defaultValue, onValueChange, variant, size });
|
|
8656
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TabsContext.Provider, { value: ctx, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: cn("w-full", className), ...props }) });
|
|
8569
8657
|
}
|
|
8570
|
-
var TabsList =
|
|
8658
|
+
var TabsList = React15.forwardRef(
|
|
8571
8659
|
({ className, variant, ...props }, ref) => {
|
|
8572
8660
|
var _a5;
|
|
8573
8661
|
const ctx = useTabs();
|
|
8574
8662
|
const v2 = (_a5 = variant != null ? variant : ctx.variant) != null ? _a5 : "top";
|
|
8575
|
-
return /* @__PURE__ */ (0,
|
|
8663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8576
8664
|
"div",
|
|
8577
8665
|
{
|
|
8578
8666
|
ref,
|
|
@@ -8586,19 +8674,24 @@ var TabsList = React14.forwardRef(
|
|
|
8586
8674
|
}
|
|
8587
8675
|
);
|
|
8588
8676
|
TabsList.displayName = "TabsList";
|
|
8589
|
-
var TabsTrigger =
|
|
8590
|
-
({ className, value, variant, iconLeft, disabled, children, "data-testid": dataTestId, ...props }, ref) => {
|
|
8591
|
-
var _a5;
|
|
8677
|
+
var TabsTrigger = React15.forwardRef(
|
|
8678
|
+
({ className, value, variant, size, iconLeft, disabled, children, "data-testid": dataTestId, ...props }, ref) => {
|
|
8679
|
+
var _a5, _b5;
|
|
8592
8680
|
const ctx = useTabs();
|
|
8593
8681
|
const v2 = (_a5 = variant != null ? variant : ctx.variant) != null ? _a5 : "top";
|
|
8682
|
+
const s = (_b5 = size != null ? size : ctx.size) != null ? _b5 : "default";
|
|
8594
8683
|
const selected = ctx.value === value;
|
|
8595
8684
|
const baseClass = v2 === "side" ? NAVIGATION_TOKENS.tab.sideBase : v2 === "section" ? NAVIGATION_TOKENS.tab.sectionBase : selected ? NAVIGATION_TOKENS.tab.topBaseSelected : NAVIGATION_TOKENS.tab.topBase;
|
|
8596
8685
|
const selectedClass = v2 === "side" ? NAVIGATION_TOKENS.tab.sideSelected : v2 === "section" ? NAVIGATION_TOKENS.tab.sectionSelected : "";
|
|
8597
|
-
const
|
|
8686
|
+
const topSizeOverride = v2 === "top" && s === "sm" ? "text-sm leading-5" : "";
|
|
8687
|
+
const labelClass = cn(
|
|
8688
|
+
v2 === "side" ? selected ? NAVIGATION_TOKENS.tab.sideLabelSelected : NAVIGATION_TOKENS.tab.sideLabelUnselected : v2 === "section" ? selected ? NAVIGATION_TOKENS.tab.sectionLabelSelected : NAVIGATION_TOKENS.tab.sectionLabelUnselected : selected ? NAVIGATION_TOKENS.tab.topLabelSelected : NAVIGATION_TOKENS.tab.topLabelUnselected,
|
|
8689
|
+
topSizeOverride
|
|
8690
|
+
);
|
|
8598
8691
|
const iconColor = v2 === "section" ? selected ? "text-icon-link" : "text-icon-grey-secondary" : v2 === "side" ? selected ? "text-icon-black" : "text-icon-grey-secondary" : selected ? "text-icon-link" : "text-icon-grey-primary";
|
|
8599
8692
|
const hoverClass = v2 === "side" ? selected ? NAVIGATION_TOKENS.tab.sideHoverSelected : NAVIGATION_TOKENS.tab.sideHoverUnselected : v2 === "section" ? selected ? NAVIGATION_TOKENS.tab.sectionHoverSelected : NAVIGATION_TOKENS.tab.sectionHoverUnselected : selected ? NAVIGATION_TOKENS.tab.topHoverSelected : NAVIGATION_TOKENS.tab.topHoverUnselected;
|
|
8600
8693
|
const pressedClass = v2 === "side" ? selected ? NAVIGATION_TOKENS.tab.sidePressedSelected : NAVIGATION_TOKENS.tab.sidePressedUnselected : v2 === "section" ? selected ? NAVIGATION_TOKENS.tab.sectionPressedSelected : NAVIGATION_TOKENS.tab.sectionPressedUnselected : selected ? NAVIGATION_TOKENS.tab.topPressedSelected : NAVIGATION_TOKENS.tab.topPressedUnselected;
|
|
8601
|
-
return /* @__PURE__ */ (0,
|
|
8694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
8602
8695
|
"button",
|
|
8603
8696
|
{
|
|
8604
8697
|
ref,
|
|
@@ -8619,9 +8712,9 @@ var TabsTrigger = React14.forwardRef(
|
|
|
8619
8712
|
onClick: () => ctx.setValue(value),
|
|
8620
8713
|
...props,
|
|
8621
8714
|
children: [
|
|
8622
|
-
iconLeft ? /* @__PURE__ */ (0,
|
|
8623
|
-
/* @__PURE__ */ (0,
|
|
8624
|
-
v2 === "top" && /* @__PURE__ */ (0,
|
|
8715
|
+
iconLeft ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn(NAVIGATION_TOKENS.tab.iconWrap, iconColor), children: iconLeft }) : null,
|
|
8716
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: cn(NAVIGATION_TOKENS.tab.labelBase, labelClass), children }),
|
|
8717
|
+
v2 === "top" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8625
8718
|
"span",
|
|
8626
8719
|
{
|
|
8627
8720
|
className: cn(
|
|
@@ -8647,7 +8740,7 @@ function TabsContent({
|
|
|
8647
8740
|
const ctx = useTabs();
|
|
8648
8741
|
const isActive = ctx.value === value;
|
|
8649
8742
|
if (!forceMount && !isActive) return null;
|
|
8650
|
-
return /* @__PURE__ */ (0,
|
|
8743
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8651
8744
|
"div",
|
|
8652
8745
|
{
|
|
8653
8746
|
className: cn(className),
|
|
@@ -8658,8 +8751,37 @@ function TabsContent({
|
|
|
8658
8751
|
}
|
|
8659
8752
|
);
|
|
8660
8753
|
}
|
|
8661
|
-
var ListNavigation =
|
|
8662
|
-
|
|
8754
|
+
var ListNavigation = React15.forwardRef(({
|
|
8755
|
+
items,
|
|
8756
|
+
selectedId,
|
|
8757
|
+
onSelect,
|
|
8758
|
+
truncate = false,
|
|
8759
|
+
maxTitleChars,
|
|
8760
|
+
maxSubtitleChars,
|
|
8761
|
+
className,
|
|
8762
|
+
"data-testid": dataTestId,
|
|
8763
|
+
...props
|
|
8764
|
+
}, ref) => {
|
|
8765
|
+
const clamp = (s, max) => typeof max === "number" && s.length > max ? `${s.slice(0, max)}\u2026` : s;
|
|
8766
|
+
const renderTitle = (item, renderedTitle) => {
|
|
8767
|
+
const wasClamped = renderedTitle !== item.title;
|
|
8768
|
+
const titleNode = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8769
|
+
"p",
|
|
8770
|
+
{
|
|
8771
|
+
className: cn(
|
|
8772
|
+
NAVIGATION_TOKENS.listNav.title,
|
|
8773
|
+
truncate && "truncate"
|
|
8774
|
+
),
|
|
8775
|
+
children: renderedTitle
|
|
8776
|
+
}
|
|
8777
|
+
);
|
|
8778
|
+
if (!truncate) return titleNode;
|
|
8779
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Tooltip, { children: [
|
|
8780
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipTrigger, { asChild: true, children: titleNode }),
|
|
8781
|
+
wasClamped && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipContent, { side: "top", className: "max-w-xs", children: item.title })
|
|
8782
|
+
] });
|
|
8783
|
+
};
|
|
8784
|
+
const listBody = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8663
8785
|
"div",
|
|
8664
8786
|
{
|
|
8665
8787
|
ref,
|
|
@@ -8668,7 +8790,9 @@ var ListNavigation = React14.forwardRef(({ items, selectedId, onSelect, classNam
|
|
|
8668
8790
|
...props,
|
|
8669
8791
|
children: items.map((item) => {
|
|
8670
8792
|
const isSelected = item.id === selectedId;
|
|
8671
|
-
|
|
8793
|
+
const renderedTitle = clamp(item.title, maxTitleChars);
|
|
8794
|
+
const renderedSubtitle = item.subtitle ? clamp(item.subtitle, maxSubtitleChars) : void 0;
|
|
8795
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
8672
8796
|
"div",
|
|
8673
8797
|
{
|
|
8674
8798
|
className: cn(
|
|
@@ -8680,12 +8804,42 @@ var ListNavigation = React14.forwardRef(({ items, selectedId, onSelect, classNam
|
|
|
8680
8804
|
"data-state": isSelected ? "selected" : "default",
|
|
8681
8805
|
"data-testid": `nav-item-${item.id}`,
|
|
8682
8806
|
children: [
|
|
8683
|
-
/* @__PURE__ */ (0,
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8807
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8808
|
+
"div",
|
|
8809
|
+
{
|
|
8810
|
+
className: cn(
|
|
8811
|
+
NAVIGATION_TOKENS.listNav.content,
|
|
8812
|
+
// In truncate mode the content column must be allowed to
|
|
8813
|
+
// shrink — default `shrink-0` would let the title push
|
|
8814
|
+
// past the trailing badge.
|
|
8815
|
+
truncate && "min-w-0 flex-1 shrink"
|
|
8816
|
+
),
|
|
8817
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
8818
|
+
"div",
|
|
8819
|
+
{
|
|
8820
|
+
className: cn(
|
|
8821
|
+
NAVIGATION_TOKENS.listNav.info,
|
|
8822
|
+
truncate && "min-w-0 w-full"
|
|
8823
|
+
),
|
|
8824
|
+
children: [
|
|
8825
|
+
renderTitle(item, renderedTitle),
|
|
8826
|
+
renderedSubtitle && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8827
|
+
"p",
|
|
8828
|
+
{
|
|
8829
|
+
className: cn(
|
|
8830
|
+
NAVIGATION_TOKENS.listNav.subtitle,
|
|
8831
|
+
truncate && "truncate"
|
|
8832
|
+
),
|
|
8833
|
+
children: renderedSubtitle
|
|
8834
|
+
}
|
|
8835
|
+
)
|
|
8836
|
+
]
|
|
8837
|
+
}
|
|
8838
|
+
)
|
|
8839
|
+
}
|
|
8840
|
+
),
|
|
8841
|
+
item.trailing && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: NAVIGATION_TOKENS.listNav.trailing, children: item.trailing }),
|
|
8842
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: NAVIGATION_TOKENS.listNav.indicator })
|
|
8689
8843
|
]
|
|
8690
8844
|
},
|
|
8691
8845
|
item.id
|
|
@@ -8693,11 +8847,12 @@ var ListNavigation = React14.forwardRef(({ items, selectedId, onSelect, classNam
|
|
|
8693
8847
|
})
|
|
8694
8848
|
}
|
|
8695
8849
|
);
|
|
8850
|
+
return truncate ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TooltipProvider, { delayDuration: 200, children: listBody }) : listBody;
|
|
8696
8851
|
});
|
|
8697
8852
|
ListNavigation.displayName = "ListNavigation";
|
|
8698
8853
|
|
|
8699
8854
|
// src/accordion/accordion.tsx
|
|
8700
|
-
var
|
|
8855
|
+
var React17 = __toESM(require("react"));
|
|
8701
8856
|
var AccordionPrimitive = __toESM(require("@radix-ui/react-accordion"));
|
|
8702
8857
|
var import_lucide_react4 = require("lucide-react");
|
|
8703
8858
|
|
|
@@ -8759,7 +8914,7 @@ var ACCORDION_TOKENS = {
|
|
|
8759
8914
|
};
|
|
8760
8915
|
|
|
8761
8916
|
// src/accordion/useAccordion.ts
|
|
8762
|
-
var
|
|
8917
|
+
var React16 = __toESM(require("react"));
|
|
8763
8918
|
function normalizeToArray(type, value) {
|
|
8764
8919
|
if (type === "multiple") {
|
|
8765
8920
|
return Array.isArray(value) ? value : [];
|
|
@@ -8781,13 +8936,13 @@ function useAccordion({
|
|
|
8781
8936
|
disabled
|
|
8782
8937
|
}) {
|
|
8783
8938
|
const isControlled = value !== void 0;
|
|
8784
|
-
const [uncontrolled, setUncontrolled] =
|
|
8939
|
+
const [uncontrolled, setUncontrolled] = React16.useState(
|
|
8785
8940
|
() => normalizeToArray(type, defaultValue)
|
|
8786
8941
|
);
|
|
8787
|
-
const openValues =
|
|
8942
|
+
const openValues = React16.useMemo(() => {
|
|
8788
8943
|
return isControlled ? normalizeToArray(type, value) : uncontrolled;
|
|
8789
8944
|
}, [isControlled, type, value, uncontrolled]);
|
|
8790
|
-
const commit =
|
|
8945
|
+
const commit = React16.useCallback(
|
|
8791
8946
|
(next) => {
|
|
8792
8947
|
var _a5;
|
|
8793
8948
|
if (!isControlled) setUncontrolled(next);
|
|
@@ -8801,12 +8956,12 @@ function useAccordion({
|
|
|
8801
8956
|
},
|
|
8802
8957
|
[isControlled, onValueChange, type]
|
|
8803
8958
|
);
|
|
8804
|
-
const radixValue =
|
|
8959
|
+
const radixValue = React16.useMemo(() => {
|
|
8805
8960
|
var _a5;
|
|
8806
8961
|
if (type === "multiple") return openValues;
|
|
8807
8962
|
return (_a5 = openValues[0]) != null ? _a5 : "";
|
|
8808
8963
|
}, [openValues, type]);
|
|
8809
|
-
const onRadixValueChange =
|
|
8964
|
+
const onRadixValueChange = React16.useCallback(
|
|
8810
8965
|
(next) => {
|
|
8811
8966
|
if (disabled) return;
|
|
8812
8967
|
if (type === "multiple") {
|
|
@@ -8823,7 +8978,7 @@ function useAccordion({
|
|
|
8823
8978
|
},
|
|
8824
8979
|
[collapsible, commit, disabled, type]
|
|
8825
8980
|
);
|
|
8826
|
-
|
|
8981
|
+
React16.useEffect(() => {
|
|
8827
8982
|
if (isControlled) return;
|
|
8828
8983
|
const next = normalizeToArray(type, defaultValue);
|
|
8829
8984
|
setUncontrolled((prev) => arraysEqual(prev, next) ? prev : next);
|
|
@@ -8838,7 +8993,7 @@ function useAccordion({
|
|
|
8838
8993
|
}
|
|
8839
8994
|
|
|
8840
8995
|
// src/accordion/accordion.tsx
|
|
8841
|
-
var
|
|
8996
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
8842
8997
|
function Accordion({
|
|
8843
8998
|
className,
|
|
8844
8999
|
type,
|
|
@@ -8859,7 +9014,7 @@ function Accordion({
|
|
|
8859
9014
|
onValueChange,
|
|
8860
9015
|
disabled
|
|
8861
9016
|
});
|
|
8862
|
-
return /* @__PURE__ */ (0,
|
|
9017
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8863
9018
|
AccordionPrimitive.Root,
|
|
8864
9019
|
{
|
|
8865
9020
|
className: cn(ACCORDION_TOKENS.root, className),
|
|
@@ -8872,7 +9027,7 @@ function Accordion({
|
|
|
8872
9027
|
}
|
|
8873
9028
|
);
|
|
8874
9029
|
}
|
|
8875
|
-
var AccordionItem =
|
|
9030
|
+
var AccordionItem = React17.forwardRef(({ className, variant = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8876
9031
|
AccordionPrimitive.Item,
|
|
8877
9032
|
{
|
|
8878
9033
|
ref,
|
|
@@ -8884,7 +9039,7 @@ var AccordionItem = React16.forwardRef(({ className, variant = "default", ...pro
|
|
|
8884
9039
|
}
|
|
8885
9040
|
));
|
|
8886
9041
|
AccordionItem.displayName = "AccordionItem";
|
|
8887
|
-
var AccordionTrigger =
|
|
9042
|
+
var AccordionTrigger = React17.forwardRef(
|
|
8888
9043
|
({
|
|
8889
9044
|
className,
|
|
8890
9045
|
children,
|
|
@@ -8897,14 +9052,14 @@ var AccordionTrigger = React16.forwardRef(
|
|
|
8897
9052
|
...props
|
|
8898
9053
|
}, ref) => {
|
|
8899
9054
|
const isSurface = variant === "surface";
|
|
8900
|
-
const titleNode = /* @__PURE__ */ (0,
|
|
9055
|
+
const titleNode = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8901
9056
|
"div",
|
|
8902
9057
|
{
|
|
8903
9058
|
className: size === "sm" ? ACCORDION_TOKENS.titleSm : ACCORDION_TOKENS.title,
|
|
8904
9059
|
children
|
|
8905
9060
|
}
|
|
8906
9061
|
);
|
|
8907
|
-
return /* @__PURE__ */ (0,
|
|
9062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
8908
9063
|
AccordionPrimitive.Trigger,
|
|
8909
9064
|
{
|
|
8910
9065
|
ref,
|
|
@@ -8916,8 +9071,8 @@ var AccordionTrigger = React16.forwardRef(
|
|
|
8916
9071
|
"data-testid": dataTestId != null ? dataTestId : "accordion",
|
|
8917
9072
|
...props,
|
|
8918
9073
|
children: [
|
|
8919
|
-
/* @__PURE__ */ (0,
|
|
8920
|
-
isSurface ? /* @__PURE__ */ (0,
|
|
9074
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: ACCORDION_TOKENS.textWrap, children: [
|
|
9075
|
+
isSurface ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8921
9076
|
"div",
|
|
8922
9077
|
{
|
|
8923
9078
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -8926,10 +9081,10 @@ var AccordionTrigger = React16.forwardRef(
|
|
|
8926
9081
|
children: titleNode
|
|
8927
9082
|
}
|
|
8928
9083
|
) : titleNode,
|
|
8929
|
-
description ? /* @__PURE__ */ (0,
|
|
9084
|
+
description ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: ACCORDION_TOKENS.description, children: description }) : null
|
|
8930
9085
|
] }),
|
|
8931
|
-
/* @__PURE__ */ (0,
|
|
8932
|
-
action ? /* @__PURE__ */ (0,
|
|
9086
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: ACCORDION_TOKENS.rightWrap, children: [
|
|
9087
|
+
action ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8933
9088
|
"div",
|
|
8934
9089
|
{
|
|
8935
9090
|
onClick: (e) => e.stopPropagation(),
|
|
@@ -8937,7 +9092,7 @@ var AccordionTrigger = React16.forwardRef(
|
|
|
8937
9092
|
children: action
|
|
8938
9093
|
}
|
|
8939
9094
|
) : null,
|
|
8940
|
-
!hideChevron ? /* @__PURE__ */ (0,
|
|
9095
|
+
!hideChevron ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8941
9096
|
import_lucide_react4.ChevronDown,
|
|
8942
9097
|
{
|
|
8943
9098
|
className: size === "sm" || isSurface ? ACCORDION_TOKENS.chevronSm : ACCORDION_TOKENS.chevron,
|
|
@@ -8951,7 +9106,7 @@ var AccordionTrigger = React16.forwardRef(
|
|
|
8951
9106
|
}
|
|
8952
9107
|
);
|
|
8953
9108
|
AccordionTrigger.displayName = "AccordionTrigger";
|
|
8954
|
-
var AccordionSectionTrigger =
|
|
9109
|
+
var AccordionSectionTrigger = React17.forwardRef(({ className, children, label, "data-testid": dataTestId, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
8955
9110
|
AccordionPrimitive.Trigger,
|
|
8956
9111
|
{
|
|
8957
9112
|
ref,
|
|
@@ -8959,8 +9114,8 @@ var AccordionSectionTrigger = React16.forwardRef(({ className, children, label,
|
|
|
8959
9114
|
"data-testid": dataTestId != null ? dataTestId : "accordion",
|
|
8960
9115
|
...props,
|
|
8961
9116
|
children: [
|
|
8962
|
-
/* @__PURE__ */ (0,
|
|
8963
|
-
/* @__PURE__ */ (0,
|
|
9117
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "whitespace-nowrap", children: children != null ? children : label }),
|
|
9118
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8964
9119
|
import_lucide_react4.ChevronDown,
|
|
8965
9120
|
{
|
|
8966
9121
|
className: ACCORDION_TOKENS.sectionTriggerChevron,
|
|
@@ -8971,13 +9126,13 @@ var AccordionSectionTrigger = React16.forwardRef(({ className, children, label,
|
|
|
8971
9126
|
}
|
|
8972
9127
|
) }));
|
|
8973
9128
|
AccordionSectionTrigger.displayName = "AccordionSectionTrigger";
|
|
8974
|
-
var AccordionContent =
|
|
9129
|
+
var AccordionContent = React17.forwardRef(({ className, children, variant = "default", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8975
9130
|
AccordionPrimitive.Content,
|
|
8976
9131
|
{
|
|
8977
9132
|
ref,
|
|
8978
9133
|
className: cn(ACCORDION_TOKENS.contentWrap, className),
|
|
8979
9134
|
...props,
|
|
8980
|
-
children: /* @__PURE__ */ (0,
|
|
9135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
8981
9136
|
"div",
|
|
8982
9137
|
{
|
|
8983
9138
|
className: variant === "surface" ? ACCORDION_TOKENS.contentSurfaceInner : ACCORDION_TOKENS.contentInner,
|
|
@@ -8991,11 +9146,11 @@ function AccordionContentPlaceholder({
|
|
|
8991
9146
|
className,
|
|
8992
9147
|
children = "Content Placeholder"
|
|
8993
9148
|
}) {
|
|
8994
|
-
return /* @__PURE__ */ (0,
|
|
9149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: cn(ACCORDION_TOKENS.contentCard, className), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: ACCORDION_TOKENS.contentCardText, children }) });
|
|
8995
9150
|
}
|
|
8996
9151
|
|
|
8997
9152
|
// src/avatar/avatar.tsx
|
|
8998
|
-
var
|
|
9153
|
+
var React18 = __toESM(require("react"));
|
|
8999
9154
|
var AvatarPrimitive = __toESM(require("@radix-ui/react-avatar"));
|
|
9000
9155
|
|
|
9001
9156
|
// src/avatar/variables.ts
|
|
@@ -9034,8 +9189,8 @@ var AVATAR_TOKENS = {
|
|
|
9034
9189
|
};
|
|
9035
9190
|
|
|
9036
9191
|
// src/avatar/avatar.tsx
|
|
9037
|
-
var
|
|
9038
|
-
var Avatar =
|
|
9192
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
9193
|
+
var Avatar = React18.forwardRef(
|
|
9039
9194
|
({
|
|
9040
9195
|
src,
|
|
9041
9196
|
alt,
|
|
@@ -9046,7 +9201,7 @@ var Avatar = React17.forwardRef(
|
|
|
9046
9201
|
style,
|
|
9047
9202
|
"data-testid": dataTestId
|
|
9048
9203
|
}, ref) => {
|
|
9049
|
-
return /* @__PURE__ */ (0,
|
|
9204
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
9050
9205
|
AvatarPrimitive.Root,
|
|
9051
9206
|
{
|
|
9052
9207
|
ref,
|
|
@@ -9059,7 +9214,7 @@ var Avatar = React17.forwardRef(
|
|
|
9059
9214
|
style,
|
|
9060
9215
|
"data-testid": dataTestId != null ? dataTestId : "avatar",
|
|
9061
9216
|
children: [
|
|
9062
|
-
/* @__PURE__ */ (0,
|
|
9217
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
9063
9218
|
AvatarPrimitive.Image,
|
|
9064
9219
|
{
|
|
9065
9220
|
src,
|
|
@@ -9067,7 +9222,7 @@ var Avatar = React17.forwardRef(
|
|
|
9067
9222
|
className: cn(AVATAR_TOKENS.image, AVATAR_TOKENS.shape[shape])
|
|
9068
9223
|
}
|
|
9069
9224
|
),
|
|
9070
|
-
/* @__PURE__ */ (0,
|
|
9225
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
9071
9226
|
AvatarPrimitive.Fallback,
|
|
9072
9227
|
{
|
|
9073
9228
|
className: cn(
|
|
@@ -9085,7 +9240,7 @@ var Avatar = React17.forwardRef(
|
|
|
9085
9240
|
}
|
|
9086
9241
|
);
|
|
9087
9242
|
Avatar.displayName = "Avatar";
|
|
9088
|
-
var AvatarGroup =
|
|
9243
|
+
var AvatarGroup = React18.forwardRef(
|
|
9089
9244
|
({
|
|
9090
9245
|
max = 3,
|
|
9091
9246
|
size = "default",
|
|
@@ -9095,10 +9250,10 @@ var AvatarGroup = React17.forwardRef(
|
|
|
9095
9250
|
style,
|
|
9096
9251
|
"data-testid": dataTestId
|
|
9097
9252
|
}, ref) => {
|
|
9098
|
-
const childArray =
|
|
9253
|
+
const childArray = React18.Children.toArray(children);
|
|
9099
9254
|
const visibleChildren = childArray.slice(0, max);
|
|
9100
9255
|
const overflowCount = childArray.length - max;
|
|
9101
|
-
return /* @__PURE__ */ (0,
|
|
9256
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
9102
9257
|
"div",
|
|
9103
9258
|
{
|
|
9104
9259
|
ref,
|
|
@@ -9108,8 +9263,8 @@ var AvatarGroup = React17.forwardRef(
|
|
|
9108
9263
|
children: [
|
|
9109
9264
|
visibleChildren.map((child, index2) => {
|
|
9110
9265
|
var _a5, _b5;
|
|
9111
|
-
if (
|
|
9112
|
-
return
|
|
9266
|
+
if (React18.isValidElement(child)) {
|
|
9267
|
+
return React18.cloneElement(child, {
|
|
9113
9268
|
key: index2,
|
|
9114
9269
|
size: (_a5 = child.props.size) != null ? _a5 : size,
|
|
9115
9270
|
shape: (_b5 = child.props.shape) != null ? _b5 : shape,
|
|
@@ -9118,7 +9273,7 @@ var AvatarGroup = React17.forwardRef(
|
|
|
9118
9273
|
}
|
|
9119
9274
|
return child;
|
|
9120
9275
|
}),
|
|
9121
|
-
overflowCount > 0 && /* @__PURE__ */ (0,
|
|
9276
|
+
overflowCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
9122
9277
|
"div",
|
|
9123
9278
|
{
|
|
9124
9279
|
className: cn(
|
|
@@ -9142,7 +9297,7 @@ var AvatarGroup = React17.forwardRef(
|
|
|
9142
9297
|
AvatarGroup.displayName = "AvatarGroup";
|
|
9143
9298
|
|
|
9144
9299
|
// src/badge/badge.tsx
|
|
9145
|
-
var
|
|
9300
|
+
var React20 = __toESM(require("react"));
|
|
9146
9301
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
9147
9302
|
var import_lucide_react5 = require("lucide-react");
|
|
9148
9303
|
|
|
@@ -9182,10 +9337,10 @@ var BADGE_TOKENS = {
|
|
|
9182
9337
|
};
|
|
9183
9338
|
|
|
9184
9339
|
// src/theme/theme-context.tsx
|
|
9185
|
-
var
|
|
9340
|
+
var React19 = __toESM(require("react"));
|
|
9186
9341
|
|
|
9187
9342
|
// src/theme/lego-land-wrapper.tsx
|
|
9188
|
-
var
|
|
9343
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
9189
9344
|
var LegoLandWrapper = ({
|
|
9190
9345
|
children,
|
|
9191
9346
|
theme,
|
|
@@ -9196,7 +9351,7 @@ var LegoLandWrapper = ({
|
|
|
9196
9351
|
const themeClass = theme === "dark" ? "dark" : "light";
|
|
9197
9352
|
const baseClass = `lego-land ${themeClass}`;
|
|
9198
9353
|
const mergedClassName = className ? `${baseClass} ${className}` : baseClass;
|
|
9199
|
-
return /* @__PURE__ */ (0,
|
|
9354
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9200
9355
|
"div",
|
|
9201
9356
|
{
|
|
9202
9357
|
className: mergedClassName,
|
|
@@ -9425,13 +9580,13 @@ function buildDefaultThemeCssText() {
|
|
|
9425
9580
|
}
|
|
9426
9581
|
|
|
9427
9582
|
// src/theme/theme-context.tsx
|
|
9428
|
-
var
|
|
9429
|
-
var ThemeContext =
|
|
9583
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
9584
|
+
var ThemeContext = React19.createContext(
|
|
9430
9585
|
void 0
|
|
9431
9586
|
);
|
|
9432
9587
|
var ThemeProvider = ({ children, defaultTheme = "light", fill }) => {
|
|
9433
|
-
const [theme, setTheme] =
|
|
9434
|
-
|
|
9588
|
+
const [theme, setTheme] = React19.useState(defaultTheme);
|
|
9589
|
+
React19.useEffect(() => {
|
|
9435
9590
|
if (typeof document === "undefined") return;
|
|
9436
9591
|
const STYLE_ID = "nurix-default-theme-vars";
|
|
9437
9592
|
const existing = document.getElementById(STYLE_ID);
|
|
@@ -9442,14 +9597,14 @@ var ThemeProvider = ({ children, defaultTheme = "light", fill }) => {
|
|
|
9442
9597
|
document.head.appendChild(styleEl);
|
|
9443
9598
|
}
|
|
9444
9599
|
}, []);
|
|
9445
|
-
|
|
9600
|
+
React19.useEffect(() => {
|
|
9446
9601
|
setTheme(defaultTheme);
|
|
9447
9602
|
}, [defaultTheme]);
|
|
9448
|
-
return /* @__PURE__ */ (0,
|
|
9603
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ThemeContext.Provider, { value: { theme, setTheme }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LegoLandWrapper, { theme, fill, children }) });
|
|
9449
9604
|
};
|
|
9450
9605
|
var NurixThemeProvider = ThemeProvider;
|
|
9451
9606
|
var useTheme = () => {
|
|
9452
|
-
const context =
|
|
9607
|
+
const context = React19.useContext(ThemeContext);
|
|
9453
9608
|
if (context === void 0) {
|
|
9454
9609
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
9455
9610
|
}
|
|
@@ -9457,8 +9612,13 @@ var useTheme = () => {
|
|
|
9457
9612
|
};
|
|
9458
9613
|
|
|
9459
9614
|
// src/badge/badge.tsx
|
|
9460
|
-
var
|
|
9461
|
-
var
|
|
9615
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
9616
|
+
var CIRCULAR_BADGE_SIZE_CLASS = {
|
|
9617
|
+
sm: "size-4 [&>svg]:size-2.5",
|
|
9618
|
+
md: "size-5 [&>svg]:size-3",
|
|
9619
|
+
lg: "size-6 [&>svg]:size-3.5"
|
|
9620
|
+
};
|
|
9621
|
+
var Badge = React20.forwardRef(
|
|
9462
9622
|
({
|
|
9463
9623
|
variant = "default",
|
|
9464
9624
|
label,
|
|
@@ -9484,13 +9644,13 @@ var Badge = React19.forwardRef(
|
|
|
9484
9644
|
interactive && onClick && "cursor-pointer",
|
|
9485
9645
|
className
|
|
9486
9646
|
);
|
|
9487
|
-
const content = /* @__PURE__ */ (0,
|
|
9647
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
|
|
9488
9648
|
showLeadingIcon && leadingIcon,
|
|
9489
9649
|
children != null ? children : label,
|
|
9490
9650
|
showTrailingIcon && trailingIcon
|
|
9491
9651
|
] });
|
|
9492
9652
|
if (onClick && interactive) {
|
|
9493
|
-
return /* @__PURE__ */ (0,
|
|
9653
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
9494
9654
|
"button",
|
|
9495
9655
|
{
|
|
9496
9656
|
ref,
|
|
@@ -9503,7 +9663,7 @@ var Badge = React19.forwardRef(
|
|
|
9503
9663
|
}
|
|
9504
9664
|
);
|
|
9505
9665
|
}
|
|
9506
|
-
return /* @__PURE__ */ (0,
|
|
9666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
9507
9667
|
"div",
|
|
9508
9668
|
{
|
|
9509
9669
|
ref,
|
|
@@ -9516,7 +9676,7 @@ var Badge = React19.forwardRef(
|
|
|
9516
9676
|
}
|
|
9517
9677
|
);
|
|
9518
9678
|
Badge.displayName = "Badge";
|
|
9519
|
-
var NumberBadge =
|
|
9679
|
+
var NumberBadge = React20.forwardRef(
|
|
9520
9680
|
({
|
|
9521
9681
|
count,
|
|
9522
9682
|
max = 99,
|
|
@@ -9530,7 +9690,7 @@ var NumberBadge = React19.forwardRef(
|
|
|
9530
9690
|
return null;
|
|
9531
9691
|
}
|
|
9532
9692
|
const displayValue = count > max ? `${max}+` : count.toString();
|
|
9533
|
-
return /* @__PURE__ */ (0,
|
|
9693
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
9534
9694
|
"div",
|
|
9535
9695
|
{
|
|
9536
9696
|
ref,
|
|
@@ -9548,7 +9708,51 @@ var NumberBadge = React19.forwardRef(
|
|
|
9548
9708
|
}
|
|
9549
9709
|
);
|
|
9550
9710
|
NumberBadge.displayName = "NumberBadge";
|
|
9551
|
-
var
|
|
9711
|
+
var CircularBadge = React20.forwardRef(
|
|
9712
|
+
({
|
|
9713
|
+
variant = "default",
|
|
9714
|
+
size = "md",
|
|
9715
|
+
onClick,
|
|
9716
|
+
children,
|
|
9717
|
+
className,
|
|
9718
|
+
style,
|
|
9719
|
+
"data-testid": dataTestId
|
|
9720
|
+
}, ref) => {
|
|
9721
|
+
const classes = cn(
|
|
9722
|
+
"inline-flex items-center justify-center rounded-full shrink-0",
|
|
9723
|
+
CIRCULAR_BADGE_SIZE_CLASS[size],
|
|
9724
|
+
BADGE_TOKENS.variant[variant],
|
|
9725
|
+
onClick && "cursor-pointer",
|
|
9726
|
+
className
|
|
9727
|
+
);
|
|
9728
|
+
if (onClick) {
|
|
9729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
9730
|
+
"button",
|
|
9731
|
+
{
|
|
9732
|
+
ref,
|
|
9733
|
+
type: "button",
|
|
9734
|
+
className: classes,
|
|
9735
|
+
style,
|
|
9736
|
+
onClick,
|
|
9737
|
+
"data-testid": dataTestId != null ? dataTestId : "badge",
|
|
9738
|
+
children
|
|
9739
|
+
}
|
|
9740
|
+
);
|
|
9741
|
+
}
|
|
9742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
9743
|
+
"span",
|
|
9744
|
+
{
|
|
9745
|
+
ref,
|
|
9746
|
+
className: classes,
|
|
9747
|
+
style,
|
|
9748
|
+
"data-testid": dataTestId != null ? dataTestId : "badge",
|
|
9749
|
+
children
|
|
9750
|
+
}
|
|
9751
|
+
);
|
|
9752
|
+
}
|
|
9753
|
+
);
|
|
9754
|
+
CircularBadge.displayName = "CircularBadge";
|
|
9755
|
+
var TagBadge = React20.forwardRef(
|
|
9552
9756
|
({
|
|
9553
9757
|
value,
|
|
9554
9758
|
onValueChange,
|
|
@@ -9563,7 +9767,7 @@ var TagBadge = React19.forwardRef(
|
|
|
9563
9767
|
var _a5, _b5;
|
|
9564
9768
|
const { theme } = useTheme();
|
|
9565
9769
|
const themeClass = theme === "dark" ? "dark" : "light";
|
|
9566
|
-
const [open, setOpen] =
|
|
9770
|
+
const [open, setOpen] = React20.useState(false);
|
|
9567
9771
|
const selectedOption = options.find((opt) => opt.value === value);
|
|
9568
9772
|
const displayLabel = (_a5 = selectedOption == null ? void 0 : selectedOption.label) != null ? _a5 : placeholder;
|
|
9569
9773
|
const displayVariant = (_b5 = selectedOption == null ? void 0 : selectedOption.variant) != null ? _b5 : defaultVariant;
|
|
@@ -9572,11 +9776,11 @@ var TagBadge = React19.forwardRef(
|
|
|
9572
9776
|
...(selectedOption == null ? void 0 : selectedOption.background) ? { backgroundColor: selectedOption.background } : {},
|
|
9573
9777
|
...(selectedOption == null ? void 0 : selectedOption.color) ? { color: selectedOption.color } : {}
|
|
9574
9778
|
};
|
|
9575
|
-
const sentinelRef =
|
|
9576
|
-
const [container, setContainer] =
|
|
9779
|
+
const sentinelRef = React20.useRef(null);
|
|
9780
|
+
const [container, setContainer] = React20.useState(
|
|
9577
9781
|
void 0
|
|
9578
9782
|
);
|
|
9579
|
-
|
|
9783
|
+
React20.useEffect(() => {
|
|
9580
9784
|
var _a6, _b6;
|
|
9581
9785
|
const el = (_a6 = sentinelRef.current) == null ? void 0 : _a6.closest(".lego-land");
|
|
9582
9786
|
setContainer(
|
|
@@ -9584,7 +9788,7 @@ var TagBadge = React19.forwardRef(
|
|
|
9584
9788
|
);
|
|
9585
9789
|
}, []);
|
|
9586
9790
|
if (viewOnly) {
|
|
9587
|
-
return /* @__PURE__ */ (0,
|
|
9791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
9588
9792
|
Badge,
|
|
9589
9793
|
{
|
|
9590
9794
|
ref,
|
|
@@ -9597,10 +9801,10 @@ var TagBadge = React19.forwardRef(
|
|
|
9597
9801
|
}
|
|
9598
9802
|
);
|
|
9599
9803
|
}
|
|
9600
|
-
return /* @__PURE__ */ (0,
|
|
9601
|
-
/* @__PURE__ */ (0,
|
|
9602
|
-
/* @__PURE__ */ (0,
|
|
9603
|
-
/* @__PURE__ */ (0,
|
|
9804
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ref, className: "inline-block", children: [
|
|
9805
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { ref: sentinelRef, className: "hidden", "aria-hidden": "true" }),
|
|
9806
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(DropdownMenuPrimitive.Root, { open, onOpenChange: setOpen, children: [
|
|
9807
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
9604
9808
|
"button",
|
|
9605
9809
|
{
|
|
9606
9810
|
type: "button",
|
|
@@ -9619,7 +9823,7 @@ var TagBadge = React19.forwardRef(
|
|
|
9619
9823
|
"data-testid": dataTestId != null ? dataTestId : "badge",
|
|
9620
9824
|
children: [
|
|
9621
9825
|
displayLabel,
|
|
9622
|
-
/* @__PURE__ */ (0,
|
|
9826
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
9623
9827
|
import_lucide_react5.ChevronDown,
|
|
9624
9828
|
{
|
|
9625
9829
|
className: cn(
|
|
@@ -9631,14 +9835,14 @@ var TagBadge = React19.forwardRef(
|
|
|
9631
9835
|
]
|
|
9632
9836
|
}
|
|
9633
9837
|
) }),
|
|
9634
|
-
/* @__PURE__ */ (0,
|
|
9838
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DropdownMenuPrimitive.Portal, { container, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
9635
9839
|
"div",
|
|
9636
9840
|
{
|
|
9637
9841
|
className: cn(
|
|
9638
9842
|
!container && "lego-land",
|
|
9639
9843
|
!container && themeClass
|
|
9640
9844
|
),
|
|
9641
|
-
children: /* @__PURE__ */ (0,
|
|
9845
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
9642
9846
|
DropdownMenuPrimitive.Content,
|
|
9643
9847
|
{
|
|
9644
9848
|
className: cn(
|
|
@@ -9654,7 +9858,7 @@ var TagBadge = React19.forwardRef(
|
|
|
9654
9858
|
children: options.map((option) => {
|
|
9655
9859
|
var _a6;
|
|
9656
9860
|
const isSelected = option.value === value;
|
|
9657
|
-
return /* @__PURE__ */ (0,
|
|
9861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
9658
9862
|
DropdownMenuPrimitive.Item,
|
|
9659
9863
|
{
|
|
9660
9864
|
className: cn(
|
|
@@ -9664,7 +9868,7 @@ var TagBadge = React19.forwardRef(
|
|
|
9664
9868
|
),
|
|
9665
9869
|
onSelect: () => onValueChange == null ? void 0 : onValueChange(option.value),
|
|
9666
9870
|
children: [
|
|
9667
|
-
/* @__PURE__ */ (0,
|
|
9871
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
9668
9872
|
Badge,
|
|
9669
9873
|
{
|
|
9670
9874
|
variant: (_a6 = option.variant) != null ? _a6 : defaultVariant,
|
|
@@ -9676,7 +9880,7 @@ var TagBadge = React19.forwardRef(
|
|
|
9676
9880
|
} : void 0
|
|
9677
9881
|
}
|
|
9678
9882
|
),
|
|
9679
|
-
isSelected && /* @__PURE__ */ (0,
|
|
9883
|
+
isSelected && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_lucide_react5.Check, { className: "size-3 shrink-0 text-border-token-brand ml-auto" })
|
|
9680
9884
|
]
|
|
9681
9885
|
},
|
|
9682
9886
|
option.value
|
|
@@ -9693,7 +9897,7 @@ var TagBadge = React19.forwardRef(
|
|
|
9693
9897
|
TagBadge.displayName = "TagBadge";
|
|
9694
9898
|
|
|
9695
9899
|
// src/select/select.tsx
|
|
9696
|
-
var
|
|
9900
|
+
var React22 = __toESM(require("react"));
|
|
9697
9901
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"));
|
|
9698
9902
|
var import_lucide_react6 = require("lucide-react");
|
|
9699
9903
|
|
|
@@ -9854,7 +10058,7 @@ var SELECT_TOKENS = {
|
|
|
9854
10058
|
};
|
|
9855
10059
|
|
|
9856
10060
|
// src/typography/typography.tsx
|
|
9857
|
-
var
|
|
10061
|
+
var React21 = __toESM(require("react"));
|
|
9858
10062
|
var import_react_slot2 = require("@radix-ui/react-slot");
|
|
9859
10063
|
|
|
9860
10064
|
// src/typography/variables.ts
|
|
@@ -9971,7 +10175,7 @@ var TYPOGRAPHY_TOKENS = {
|
|
|
9971
10175
|
};
|
|
9972
10176
|
|
|
9973
10177
|
// src/typography/typography.tsx
|
|
9974
|
-
var
|
|
10178
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
9975
10179
|
var DEFAULT_TAG_BY_VARIANT = {
|
|
9976
10180
|
h1: "h1",
|
|
9977
10181
|
h2: "h2",
|
|
@@ -9993,7 +10197,7 @@ var DEFAULT_TAG_BY_VARIANT = {
|
|
|
9993
10197
|
"label-md": "label",
|
|
9994
10198
|
"label-lg": "label"
|
|
9995
10199
|
};
|
|
9996
|
-
var Typography =
|
|
10200
|
+
var Typography = React21.forwardRef(
|
|
9997
10201
|
({
|
|
9998
10202
|
variant,
|
|
9999
10203
|
size,
|
|
@@ -10016,7 +10220,7 @@ var Typography = React20.forwardRef(
|
|
|
10016
10220
|
TYPOGRAPHY_TOKENS.variant[variantOrDefault],
|
|
10017
10221
|
weight ? TYPOGRAPHY_TOKENS.weight[weight] : void 0
|
|
10018
10222
|
) : void 0;
|
|
10019
|
-
return /* @__PURE__ */ (0,
|
|
10223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
10020
10224
|
Comp,
|
|
10021
10225
|
{
|
|
10022
10226
|
ref,
|
|
@@ -10036,9 +10240,9 @@ var Typography = React20.forwardRef(
|
|
|
10036
10240
|
Typography.displayName = "Typography";
|
|
10037
10241
|
|
|
10038
10242
|
// src/select/select.tsx
|
|
10039
|
-
var
|
|
10243
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
10040
10244
|
var Select = SelectPrimitive.Root;
|
|
10041
|
-
var SelectGroup =
|
|
10245
|
+
var SelectGroup = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10042
10246
|
SelectPrimitive.Group,
|
|
10043
10247
|
{
|
|
10044
10248
|
ref,
|
|
@@ -10047,7 +10251,7 @@ var SelectGroup = React21.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
10047
10251
|
}
|
|
10048
10252
|
));
|
|
10049
10253
|
SelectGroup.displayName = SelectPrimitive.Group.displayName;
|
|
10050
|
-
var SelectValue =
|
|
10254
|
+
var SelectValue = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10051
10255
|
"span",
|
|
10052
10256
|
{
|
|
10053
10257
|
className: cn(
|
|
@@ -10062,11 +10266,11 @@ var SelectValue = React21.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
10062
10266
|
"block w-full min-w-0 max-w-full truncate text-left",
|
|
10063
10267
|
className
|
|
10064
10268
|
),
|
|
10065
|
-
children: /* @__PURE__ */ (0,
|
|
10269
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectPrimitive.Value, { ref, ...props })
|
|
10066
10270
|
}
|
|
10067
10271
|
));
|
|
10068
10272
|
SelectValue.displayName = "SelectValue";
|
|
10069
|
-
var SelectTrigger =
|
|
10273
|
+
var SelectTrigger = React22.forwardRef(
|
|
10070
10274
|
({
|
|
10071
10275
|
className,
|
|
10072
10276
|
children,
|
|
@@ -10077,7 +10281,7 @@ var SelectTrigger = React21.forwardRef(
|
|
|
10077
10281
|
bg = "default",
|
|
10078
10282
|
"data-testid": dataTestId,
|
|
10079
10283
|
...props
|
|
10080
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
10284
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
10081
10285
|
SelectPrimitive.Trigger,
|
|
10082
10286
|
{
|
|
10083
10287
|
ref,
|
|
@@ -10101,7 +10305,7 @@ var SelectTrigger = React21.forwardRef(
|
|
|
10101
10305
|
"data-testid": dataTestId != null ? dataTestId : "select",
|
|
10102
10306
|
...props,
|
|
10103
10307
|
children: [
|
|
10104
|
-
/* @__PURE__ */ (0,
|
|
10308
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
10105
10309
|
"div",
|
|
10106
10310
|
{
|
|
10107
10311
|
className: cn(
|
|
@@ -10109,7 +10313,7 @@ var SelectTrigger = React21.forwardRef(
|
|
|
10109
10313
|
SELECT_TOKENS.contentWrap.default
|
|
10110
10314
|
),
|
|
10111
10315
|
children: [
|
|
10112
|
-
showLead && leadIcon && /* @__PURE__ */ (0,
|
|
10316
|
+
showLead && leadIcon && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10113
10317
|
"span",
|
|
10114
10318
|
{
|
|
10115
10319
|
className: cn(
|
|
@@ -10119,7 +10323,7 @@ var SelectTrigger = React21.forwardRef(
|
|
|
10119
10323
|
children: leadIcon
|
|
10120
10324
|
}
|
|
10121
10325
|
),
|
|
10122
|
-
/* @__PURE__ */ (0,
|
|
10326
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10123
10327
|
Typography,
|
|
10124
10328
|
{
|
|
10125
10329
|
as: "span",
|
|
@@ -10137,7 +10341,7 @@ var SelectTrigger = React21.forwardRef(
|
|
|
10137
10341
|
]
|
|
10138
10342
|
}
|
|
10139
10343
|
),
|
|
10140
|
-
/* @__PURE__ */ (0,
|
|
10344
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10141
10345
|
import_lucide_react6.ChevronDown,
|
|
10142
10346
|
{
|
|
10143
10347
|
className: cn(
|
|
@@ -10152,7 +10356,7 @@ var SelectTrigger = React21.forwardRef(
|
|
|
10152
10356
|
)
|
|
10153
10357
|
);
|
|
10154
10358
|
SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
|
|
10155
|
-
var SelectScrollUpButton =
|
|
10359
|
+
var SelectScrollUpButton = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10156
10360
|
SelectPrimitive.ScrollUpButton,
|
|
10157
10361
|
{
|
|
10158
10362
|
ref,
|
|
@@ -10161,11 +10365,11 @@ var SelectScrollUpButton = React21.forwardRef(({ className, ...props }, ref) =>
|
|
|
10161
10365
|
className
|
|
10162
10366
|
),
|
|
10163
10367
|
...props,
|
|
10164
|
-
children: /* @__PURE__ */ (0,
|
|
10368
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react6.ChevronDown, { className: "h-4 w-4 rotate-180" })
|
|
10165
10369
|
}
|
|
10166
10370
|
));
|
|
10167
10371
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
10168
|
-
var SelectScrollDownButton =
|
|
10372
|
+
var SelectScrollDownButton = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10169
10373
|
SelectPrimitive.ScrollDownButton,
|
|
10170
10374
|
{
|
|
10171
10375
|
ref,
|
|
@@ -10174,7 +10378,7 @@ var SelectScrollDownButton = React21.forwardRef(({ className, ...props }, ref) =
|
|
|
10174
10378
|
className
|
|
10175
10379
|
),
|
|
10176
10380
|
...props,
|
|
10177
|
-
children: /* @__PURE__ */ (0,
|
|
10381
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react6.ChevronDown, { className: "h-4 w-4" })
|
|
10178
10382
|
}
|
|
10179
10383
|
));
|
|
10180
10384
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
@@ -10199,7 +10403,7 @@ function filterSectionsBySearch(sections, query) {
|
|
|
10199
10403
|
function isSectionArray(items) {
|
|
10200
10404
|
return items.length > 0 && typeof items[0] === "object" && items[0] !== null && "sectionLabel" in items[0] && "items" in items[0];
|
|
10201
10405
|
}
|
|
10202
|
-
var SelectContent =
|
|
10406
|
+
var SelectContent = React22.forwardRef(
|
|
10203
10407
|
({
|
|
10204
10408
|
className,
|
|
10205
10409
|
children,
|
|
@@ -10214,30 +10418,30 @@ var SelectContent = React21.forwardRef(
|
|
|
10214
10418
|
}, ref) => {
|
|
10215
10419
|
const { theme } = useTheme();
|
|
10216
10420
|
const themeClass = theme === "dark" ? "dark" : "light";
|
|
10217
|
-
const [searchQuery, setSearchQuery] =
|
|
10218
|
-
const sentinelRef =
|
|
10219
|
-
const [container, setContainer] =
|
|
10421
|
+
const [searchQuery, setSearchQuery] = React22.useState("");
|
|
10422
|
+
const sentinelRef = React22.useRef(null);
|
|
10423
|
+
const [container, setContainer] = React22.useState(
|
|
10220
10424
|
void 0
|
|
10221
10425
|
);
|
|
10222
|
-
|
|
10426
|
+
React22.useEffect(() => {
|
|
10223
10427
|
var _a5, _b5;
|
|
10224
10428
|
const el = (_a5 = sentinelRef.current) == null ? void 0 : _a5.closest(".lego-land");
|
|
10225
10429
|
setContainer(
|
|
10226
10430
|
el != null ? el : typeof document !== "undefined" ? (_b5 = document.querySelector(".lego-land")) != null ? _b5 : void 0 : void 0
|
|
10227
10431
|
);
|
|
10228
10432
|
}, []);
|
|
10229
|
-
const filteredItems =
|
|
10433
|
+
const filteredItems = React22.useMemo(() => {
|
|
10230
10434
|
if (!items) return [];
|
|
10231
10435
|
if (isSectionArray(items)) {
|
|
10232
10436
|
return filterSectionsBySearch(items, searchQuery);
|
|
10233
10437
|
}
|
|
10234
10438
|
return filterItemsBySearch(items, searchQuery);
|
|
10235
10439
|
}, [items, searchQuery]);
|
|
10236
|
-
const handleSearchKeyDown =
|
|
10440
|
+
const handleSearchKeyDown = React22.useCallback((e) => {
|
|
10237
10441
|
e.stopPropagation();
|
|
10238
10442
|
}, []);
|
|
10239
|
-
const searchInputRef =
|
|
10240
|
-
const handleSearchBlur =
|
|
10443
|
+
const searchInputRef = React22.useRef(null);
|
|
10444
|
+
const handleSearchBlur = React22.useCallback(
|
|
10241
10445
|
(e) => {
|
|
10242
10446
|
const next = e.relatedTarget;
|
|
10243
10447
|
const isSelectItem = (next == null ? void 0 : next.getAttribute("role")) === "option";
|
|
@@ -10249,7 +10453,7 @@ var SelectContent = React21.forwardRef(
|
|
|
10249
10453
|
},
|
|
10250
10454
|
[]
|
|
10251
10455
|
);
|
|
10252
|
-
|
|
10456
|
+
React22.useEffect(() => {
|
|
10253
10457
|
if (!searchInputRef.current) return;
|
|
10254
10458
|
const id = requestAnimationFrame(() => {
|
|
10255
10459
|
var _a5;
|
|
@@ -10259,12 +10463,12 @@ var SelectContent = React21.forwardRef(
|
|
|
10259
10463
|
});
|
|
10260
10464
|
return () => cancelAnimationFrame(id);
|
|
10261
10465
|
}, [searchQuery]);
|
|
10262
|
-
const content = items ? isSectionArray(items) ? /* @__PURE__ */ (0,
|
|
10263
|
-
(section, sectionIdx) => /* @__PURE__ */ (0,
|
|
10264
|
-
/* @__PURE__ */ (0,
|
|
10466
|
+
const content = items ? isSectionArray(items) ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: filteredItems.map(
|
|
10467
|
+
(section, sectionIdx) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(SelectGroup, { children: [
|
|
10468
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectLabel, { children: section.sectionLabel }),
|
|
10265
10469
|
section.items.map((item) => {
|
|
10266
10470
|
var _a5;
|
|
10267
|
-
return /* @__PURE__ */ (0,
|
|
10471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10268
10472
|
SelectItem,
|
|
10269
10473
|
{
|
|
10270
10474
|
value: item.value,
|
|
@@ -10279,9 +10483,9 @@ var SelectContent = React21.forwardRef(
|
|
|
10279
10483
|
);
|
|
10280
10484
|
})
|
|
10281
10485
|
] }, sectionIdx)
|
|
10282
|
-
) }) : /* @__PURE__ */ (0,
|
|
10486
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectGroup, { children: filteredItems.map((item) => {
|
|
10283
10487
|
var _a5;
|
|
10284
|
-
return /* @__PURE__ */ (0,
|
|
10488
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10285
10489
|
SelectItem,
|
|
10286
10490
|
{
|
|
10287
10491
|
value: item.value,
|
|
@@ -10295,13 +10499,13 @@ var SelectContent = React21.forwardRef(
|
|
|
10295
10499
|
item.value
|
|
10296
10500
|
);
|
|
10297
10501
|
}) }) : children;
|
|
10298
|
-
return /* @__PURE__ */ (0,
|
|
10299
|
-
/* @__PURE__ */ (0,
|
|
10300
|
-
/* @__PURE__ */ (0,
|
|
10502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [
|
|
10503
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { ref: sentinelRef, className: "hidden", "aria-hidden": "true" }),
|
|
10504
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectPrimitive.Portal, { container, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10301
10505
|
"div",
|
|
10302
10506
|
{
|
|
10303
10507
|
className: cn(!container && "lego-land", !container && themeClass),
|
|
10304
|
-
children: /* @__PURE__ */ (0,
|
|
10508
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
10305
10509
|
SelectPrimitive.Content,
|
|
10306
10510
|
{
|
|
10307
10511
|
ref,
|
|
@@ -10317,14 +10521,14 @@ var SelectContent = React21.forwardRef(
|
|
|
10317
10521
|
position,
|
|
10318
10522
|
...props,
|
|
10319
10523
|
children: [
|
|
10320
|
-
showSearch && /* @__PURE__ */ (0,
|
|
10524
|
+
showSearch && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
10321
10525
|
"div",
|
|
10322
10526
|
{
|
|
10323
10527
|
className: SELECT_TOKENS.search.container,
|
|
10324
10528
|
style: { paddingLeft: 11, paddingRight: 11 },
|
|
10325
10529
|
children: [
|
|
10326
|
-
/* @__PURE__ */ (0,
|
|
10327
|
-
/* @__PURE__ */ (0,
|
|
10530
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react6.Search, { className: SELECT_TOKENS.search.icon }),
|
|
10531
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10328
10532
|
"input",
|
|
10329
10533
|
{
|
|
10330
10534
|
ref: searchInputRef,
|
|
@@ -10343,7 +10547,7 @@ var SelectContent = React21.forwardRef(
|
|
|
10343
10547
|
]
|
|
10344
10548
|
}
|
|
10345
10549
|
),
|
|
10346
|
-
/* @__PURE__ */ (0,
|
|
10550
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10347
10551
|
SelectPrimitive.Viewport,
|
|
10348
10552
|
{
|
|
10349
10553
|
ref: viewportRef,
|
|
@@ -10360,14 +10564,14 @@ var SelectContent = React21.forwardRef(
|
|
|
10360
10564
|
}
|
|
10361
10565
|
);
|
|
10362
10566
|
SelectContent.displayName = SelectPrimitive.Content.displayName;
|
|
10363
|
-
var SelectLabel =
|
|
10567
|
+
var SelectLabel = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10364
10568
|
SelectPrimitive.Label,
|
|
10365
10569
|
{
|
|
10366
10570
|
ref,
|
|
10367
10571
|
className: cn(SELECT_TOKENS.menu.sectionLabel, className),
|
|
10368
10572
|
...props,
|
|
10369
10573
|
style: { ...props.style, paddingLeft: 12, paddingRight: 12 },
|
|
10370
|
-
children: /* @__PURE__ */ (0,
|
|
10574
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10371
10575
|
Typography,
|
|
10372
10576
|
{
|
|
10373
10577
|
as: "span",
|
|
@@ -10380,7 +10584,7 @@ var SelectLabel = React21.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
10380
10584
|
}
|
|
10381
10585
|
));
|
|
10382
10586
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
10383
|
-
var SelectItem =
|
|
10587
|
+
var SelectItem = React22.forwardRef(
|
|
10384
10588
|
({
|
|
10385
10589
|
className,
|
|
10386
10590
|
children,
|
|
@@ -10391,7 +10595,7 @@ var SelectItem = React21.forwardRef(
|
|
|
10391
10595
|
trailing,
|
|
10392
10596
|
"data-testid": dataTestId,
|
|
10393
10597
|
...props
|
|
10394
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
10598
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
10395
10599
|
SelectPrimitive.Item,
|
|
10396
10600
|
{
|
|
10397
10601
|
ref,
|
|
@@ -10409,8 +10613,8 @@ var SelectItem = React21.forwardRef(
|
|
|
10409
10613
|
...props,
|
|
10410
10614
|
style: { ...props.style, paddingLeft: 12, paddingRight: 12 },
|
|
10411
10615
|
children: [
|
|
10412
|
-
/* @__PURE__ */ (0,
|
|
10413
|
-
leadIcon ? /* @__PURE__ */ (0,
|
|
10616
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn(SELECT_TOKENS.menu.itemContent.base), children: [
|
|
10617
|
+
leadIcon ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10414
10618
|
"span",
|
|
10415
10619
|
{
|
|
10416
10620
|
className: cn(
|
|
@@ -10420,7 +10624,7 @@ var SelectItem = React21.forwardRef(
|
|
|
10420
10624
|
children: leadIcon
|
|
10421
10625
|
}
|
|
10422
10626
|
) : null,
|
|
10423
|
-
/* @__PURE__ */ (0,
|
|
10627
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
10424
10628
|
"div",
|
|
10425
10629
|
{
|
|
10426
10630
|
className: cn(
|
|
@@ -10429,20 +10633,20 @@ var SelectItem = React21.forwardRef(
|
|
|
10429
10633
|
"min-w-0 flex-1"
|
|
10430
10634
|
),
|
|
10431
10635
|
children: [
|
|
10432
|
-
/* @__PURE__ */ (0,
|
|
10433
|
-
subtext && type === "double" && /* @__PURE__ */ (0,
|
|
10636
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectPrimitive.ItemText, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: SELECT_TOKENS.menu.itemText, children }) }),
|
|
10637
|
+
subtext && type === "double" && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: SELECT_TOKENS.menu.itemSubtext, children: subtext })
|
|
10434
10638
|
]
|
|
10435
10639
|
}
|
|
10436
10640
|
)
|
|
10437
10641
|
] }),
|
|
10438
|
-
trailing ? /* @__PURE__ */ (0,
|
|
10439
|
-
/* @__PURE__ */ (0,
|
|
10642
|
+
trailing ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "flex items-center gap-1 shrink-0 ml-2", children: trailing }) : null,
|
|
10643
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SelectPrimitive.ItemIndicator, { className: SELECT_TOKENS.menu.checkIcon.wrap, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react6.Check, { className: SELECT_TOKENS.menu.checkIcon.iconSelected }) })
|
|
10440
10644
|
]
|
|
10441
10645
|
}
|
|
10442
10646
|
)
|
|
10443
10647
|
);
|
|
10444
10648
|
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
10445
|
-
var SelectSeparator =
|
|
10649
|
+
var SelectSeparator = React22.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
10446
10650
|
SelectPrimitive.Separator,
|
|
10447
10651
|
{
|
|
10448
10652
|
ref,
|
|
@@ -10456,18 +10660,18 @@ function SelectFormLabel({
|
|
|
10456
10660
|
label = "Title",
|
|
10457
10661
|
mandatory = true
|
|
10458
10662
|
}) {
|
|
10459
|
-
return /* @__PURE__ */ (0,
|
|
10460
|
-
/* @__PURE__ */ (0,
|
|
10461
|
-
mandatory && /* @__PURE__ */ (0,
|
|
10663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: cn(SELECT_TOKENS.label.container, className), children: [
|
|
10664
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: SELECT_TOKENS.label.text, children: label }),
|
|
10665
|
+
mandatory && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: SELECT_TOKENS.label.asterisk, children: "*" })
|
|
10462
10666
|
] });
|
|
10463
10667
|
}
|
|
10464
10668
|
|
|
10465
10669
|
// src/select/play-select.tsx
|
|
10466
|
-
var
|
|
10670
|
+
var React24 = __toESM(require("react"));
|
|
10467
10671
|
var import_lucide_react7 = require("lucide-react");
|
|
10468
10672
|
|
|
10469
10673
|
// src/select/use-play-select.ts
|
|
10470
|
-
var
|
|
10674
|
+
var React23 = __toESM(require("react"));
|
|
10471
10675
|
function usePlaySelect({
|
|
10472
10676
|
value,
|
|
10473
10677
|
defaultValue,
|
|
@@ -10476,23 +10680,23 @@ function usePlaySelect({
|
|
|
10476
10680
|
onSelectValue,
|
|
10477
10681
|
onCloseDropdown
|
|
10478
10682
|
}) {
|
|
10479
|
-
const [internalValue, setInternalValue] =
|
|
10683
|
+
const [internalValue, setInternalValue] = React23.useState(
|
|
10480
10684
|
defaultValue
|
|
10481
10685
|
);
|
|
10482
|
-
const [playingUrl, setPlayingUrl] =
|
|
10483
|
-
const audioRef =
|
|
10686
|
+
const [playingUrl, setPlayingUrl] = React23.useState(null);
|
|
10687
|
+
const audioRef = React23.useRef(null);
|
|
10484
10688
|
const currentValue = value !== void 0 ? value : internalValue;
|
|
10485
|
-
|
|
10689
|
+
React23.useEffect(() => {
|
|
10486
10690
|
if (value === void 0 && defaultValue !== void 0) {
|
|
10487
10691
|
setInternalValue(defaultValue);
|
|
10488
10692
|
}
|
|
10489
10693
|
}, [defaultValue, value]);
|
|
10490
|
-
const pauseAudio =
|
|
10694
|
+
const pauseAudio = React23.useCallback(() => {
|
|
10491
10695
|
var _a5;
|
|
10492
10696
|
(_a5 = audioRef.current) == null ? void 0 : _a5.pause();
|
|
10493
10697
|
setPlayingUrl(null);
|
|
10494
10698
|
}, []);
|
|
10495
|
-
const handleValueChange =
|
|
10699
|
+
const handleValueChange = React23.useCallback(
|
|
10496
10700
|
(newValue) => {
|
|
10497
10701
|
if (value === void 0) {
|
|
10498
10702
|
setInternalValue(newValue);
|
|
@@ -10502,7 +10706,7 @@ function usePlaySelect({
|
|
|
10502
10706
|
},
|
|
10503
10707
|
[value, onValueChange, onSelectValue]
|
|
10504
10708
|
);
|
|
10505
|
-
const handleOpenChange =
|
|
10709
|
+
const handleOpenChange = React23.useCallback(
|
|
10506
10710
|
(open) => {
|
|
10507
10711
|
if (!open) {
|
|
10508
10712
|
pauseAudio();
|
|
@@ -10511,7 +10715,7 @@ function usePlaySelect({
|
|
|
10511
10715
|
},
|
|
10512
10716
|
[pauseAudio, onCloseDropdown]
|
|
10513
10717
|
);
|
|
10514
|
-
const handlePlay =
|
|
10718
|
+
const handlePlay = React23.useCallback(
|
|
10515
10719
|
(url, item) => {
|
|
10516
10720
|
const audio = audioRef.current;
|
|
10517
10721
|
if (!audio) return;
|
|
@@ -10527,14 +10731,14 @@ function usePlaySelect({
|
|
|
10527
10731
|
},
|
|
10528
10732
|
[playingUrl, onPlayClick]
|
|
10529
10733
|
);
|
|
10530
|
-
const stopEvent =
|
|
10734
|
+
const stopEvent = React23.useCallback(
|
|
10531
10735
|
(e) => {
|
|
10532
10736
|
e.stopPropagation();
|
|
10533
10737
|
e.preventDefault();
|
|
10534
10738
|
},
|
|
10535
10739
|
[]
|
|
10536
10740
|
);
|
|
10537
|
-
const createPlayHandler =
|
|
10741
|
+
const createPlayHandler = React23.useCallback(
|
|
10538
10742
|
(item) => (e) => {
|
|
10539
10743
|
e.stopPropagation();
|
|
10540
10744
|
e.preventDefault();
|
|
@@ -10542,7 +10746,7 @@ function usePlaySelect({
|
|
|
10542
10746
|
},
|
|
10543
10747
|
[handlePlay]
|
|
10544
10748
|
);
|
|
10545
|
-
|
|
10749
|
+
React23.useEffect(() => {
|
|
10546
10750
|
const audio = audioRef.current;
|
|
10547
10751
|
if (!audio) return;
|
|
10548
10752
|
const onEnded = () => setPlayingUrl(null);
|
|
@@ -10563,8 +10767,8 @@ function usePlaySelect({
|
|
|
10563
10767
|
}
|
|
10564
10768
|
|
|
10565
10769
|
// src/select/play-select.tsx
|
|
10566
|
-
var
|
|
10567
|
-
var PlaySelect =
|
|
10770
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
10771
|
+
var PlaySelect = React24.forwardRef(
|
|
10568
10772
|
({
|
|
10569
10773
|
dropdownListItems,
|
|
10570
10774
|
label = "Title",
|
|
@@ -10603,7 +10807,7 @@ var PlaySelect = React23.forwardRef(
|
|
|
10603
10807
|
onSelectValue,
|
|
10604
10808
|
onCloseDropdown
|
|
10605
10809
|
});
|
|
10606
|
-
const items =
|
|
10810
|
+
const items = React24.useMemo(
|
|
10607
10811
|
() => dropdownListItems.map((item) => {
|
|
10608
10812
|
const hasPreview = Boolean(item.url);
|
|
10609
10813
|
const isPlaying = hasPreview && playingUrl === item.url;
|
|
@@ -10618,7 +10822,7 @@ var PlaySelect = React23.forwardRef(
|
|
|
10618
10822
|
// overflowing a smaller container — otherwise it visually drifts
|
|
10619
10823
|
// out of vertical center next to the label.
|
|
10620
10824
|
leadIconSize: "md",
|
|
10621
|
-
leadIcon: /* @__PURE__ */ (0,
|
|
10825
|
+
leadIcon: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
10622
10826
|
"button",
|
|
10623
10827
|
{
|
|
10624
10828
|
type: "button",
|
|
@@ -10632,7 +10836,7 @@ var PlaySelect = React23.forwardRef(
|
|
|
10632
10836
|
onMouseDown: stopEvent,
|
|
10633
10837
|
onClick: stopEvent,
|
|
10634
10838
|
"aria-label": !hasPreview ? `${item.label} \u2014 no preview available` : isPlaying ? `Pause ${item.label}` : `Play ${item.label}`,
|
|
10635
|
-
children: /* @__PURE__ */ (0,
|
|
10839
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Icon2, { className: cn(!isPlaying && "ml-px") })
|
|
10636
10840
|
}
|
|
10637
10841
|
)
|
|
10638
10842
|
};
|
|
@@ -10642,26 +10846,26 @@ var PlaySelect = React23.forwardRef(
|
|
|
10642
10846
|
const selectedItem = dropdownListItems.find((it) => it.value === value);
|
|
10643
10847
|
const isSelectedPlaying = selectedItem && selectedItem.url && playingUrl === selectedItem.url;
|
|
10644
10848
|
const TriggerIcon = isSelectedPlaying ? import_lucide_react7.Pause : import_lucide_react7.Play;
|
|
10645
|
-
const resolvedTriggerLeadIcon = triggerLeadIcon != null ? triggerLeadIcon : /* @__PURE__ */ (0,
|
|
10849
|
+
const resolvedTriggerLeadIcon = triggerLeadIcon != null ? triggerLeadIcon : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
10646
10850
|
"span",
|
|
10647
10851
|
{
|
|
10648
10852
|
className: cn(
|
|
10649
10853
|
SELECT_TOKENS.playIconCircle,
|
|
10650
10854
|
"-translate-y-px text-fg-grey-secondary [&>svg]:fill-current"
|
|
10651
10855
|
),
|
|
10652
|
-
children: /* @__PURE__ */ (0,
|
|
10856
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TriggerIcon, { className: cn(!isSelectedPlaying && "ml-px") })
|
|
10653
10857
|
}
|
|
10654
10858
|
);
|
|
10655
10859
|
const defaultTriggerClassName = "!h-8 !rounded-xl !px-3 !py-0 !gap-2";
|
|
10656
|
-
return /* @__PURE__ */ (0,
|
|
10860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
10657
10861
|
"div",
|
|
10658
10862
|
{
|
|
10659
10863
|
className: cn("flex flex-col gap-2", className),
|
|
10660
10864
|
style: minWidth ? { minWidth } : void 0,
|
|
10661
10865
|
children: [
|
|
10662
|
-
/* @__PURE__ */ (0,
|
|
10663
|
-
showLabel && /* @__PURE__ */ (0,
|
|
10664
|
-
/* @__PURE__ */ (0,
|
|
10866
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("audio", { ref: audioRef, className: "sr-only" }),
|
|
10867
|
+
showLabel && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SelectFormLabel, { label, mandatory }),
|
|
10868
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
10665
10869
|
Select,
|
|
10666
10870
|
{
|
|
10667
10871
|
value,
|
|
@@ -10669,7 +10873,7 @@ var PlaySelect = React23.forwardRef(
|
|
|
10669
10873
|
onOpenChange: handleOpenChange,
|
|
10670
10874
|
disabled,
|
|
10671
10875
|
children: [
|
|
10672
|
-
/* @__PURE__ */ (0,
|
|
10876
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
10673
10877
|
SelectTrigger,
|
|
10674
10878
|
{
|
|
10675
10879
|
ref,
|
|
@@ -10678,10 +10882,10 @@ var PlaySelect = React23.forwardRef(
|
|
|
10678
10882
|
leadIconSize: "md",
|
|
10679
10883
|
size,
|
|
10680
10884
|
className: cn(defaultTriggerClassName, triggerClassName),
|
|
10681
|
-
children: /* @__PURE__ */ (0,
|
|
10885
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SelectValue, { placeholder })
|
|
10682
10886
|
}
|
|
10683
10887
|
),
|
|
10684
|
-
/* @__PURE__ */ (0,
|
|
10888
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
10685
10889
|
SelectContent,
|
|
10686
10890
|
{
|
|
10687
10891
|
items,
|
|
@@ -10701,13 +10905,13 @@ var PlaySelect = React23.forwardRef(
|
|
|
10701
10905
|
PlaySelect.displayName = "PlaySelect";
|
|
10702
10906
|
|
|
10703
10907
|
// src/select/playback-control.tsx
|
|
10704
|
-
var
|
|
10908
|
+
var React25 = __toESM(require("react"));
|
|
10705
10909
|
var import_lucide_react8 = require("lucide-react");
|
|
10706
|
-
var
|
|
10707
|
-
var PlaybackControl =
|
|
10910
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
10911
|
+
var PlaybackControl = React25.forwardRef(({ state: state2, playing, ...props }, ref) => {
|
|
10708
10912
|
const showPause = state2 ? state2 === "pause" : !!playing;
|
|
10709
10913
|
const Icon2 = showPause ? import_lucide_react8.Pause : import_lucide_react8.Play;
|
|
10710
|
-
return /* @__PURE__ */ (0,
|
|
10914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
10711
10915
|
Button,
|
|
10712
10916
|
{
|
|
10713
10917
|
ref,
|
|
@@ -10718,29 +10922,29 @@ var PlaybackControl = React24.forwardRef(({ state: state2, playing, ...props },
|
|
|
10718
10922
|
showLeadingIcon: false,
|
|
10719
10923
|
showTrailingIcon: false,
|
|
10720
10924
|
...props,
|
|
10721
|
-
children: /* @__PURE__ */ (0,
|
|
10925
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Icon2, { className: cn("size-5", !showPause && "ml-0.5") })
|
|
10722
10926
|
}
|
|
10723
10927
|
);
|
|
10724
10928
|
});
|
|
10725
10929
|
PlaybackControl.displayName = "PlaybackControl";
|
|
10726
10930
|
|
|
10727
10931
|
// src/select/use-select.ts
|
|
10728
|
-
var
|
|
10932
|
+
var React26 = __toESM(require("react"));
|
|
10729
10933
|
function useSelect({
|
|
10730
10934
|
value,
|
|
10731
10935
|
defaultValue,
|
|
10732
10936
|
onValueChange
|
|
10733
10937
|
}) {
|
|
10734
|
-
const [internalValue, setInternalValue] =
|
|
10938
|
+
const [internalValue, setInternalValue] = React26.useState(
|
|
10735
10939
|
defaultValue
|
|
10736
10940
|
);
|
|
10737
10941
|
const currentValue = value !== void 0 ? value : internalValue;
|
|
10738
|
-
|
|
10942
|
+
React26.useEffect(() => {
|
|
10739
10943
|
if (value === void 0 && defaultValue !== void 0) {
|
|
10740
10944
|
setInternalValue(defaultValue);
|
|
10741
10945
|
}
|
|
10742
10946
|
}, [defaultValue, value]);
|
|
10743
|
-
const handleValueChange =
|
|
10947
|
+
const handleValueChange = React26.useCallback(
|
|
10744
10948
|
(newValue) => {
|
|
10745
10949
|
if (value === void 0) {
|
|
10746
10950
|
setInternalValue(newValue);
|
|
@@ -10757,7 +10961,7 @@ function useSelect({
|
|
|
10757
10961
|
}
|
|
10758
10962
|
|
|
10759
10963
|
// src/empty-state/empty-state.tsx
|
|
10760
|
-
var
|
|
10964
|
+
var React27 = __toESM(require("react"));
|
|
10761
10965
|
|
|
10762
10966
|
// src/empty-state/variables.ts
|
|
10763
10967
|
var EMPTY_STATE_TOKENS = {
|
|
@@ -10780,12 +10984,12 @@ var EMPTY_STATE_TOKENS = {
|
|
|
10780
10984
|
};
|
|
10781
10985
|
|
|
10782
10986
|
// src/empty-state/empty-state.tsx
|
|
10783
|
-
var
|
|
10987
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
10784
10988
|
var ILLUSTRATION_SIZE_CLASS = {
|
|
10785
10989
|
small: EMPTY_STATE_TOKENS.illustrationSmall,
|
|
10786
10990
|
banner: EMPTY_STATE_TOKENS.illustrationBanner
|
|
10787
10991
|
};
|
|
10788
|
-
var EmptyState =
|
|
10992
|
+
var EmptyState = React27.forwardRef(
|
|
10789
10993
|
({
|
|
10790
10994
|
className,
|
|
10791
10995
|
illustration,
|
|
@@ -10804,7 +11008,7 @@ var EmptyState = React26.forwardRef(
|
|
|
10804
11008
|
width: illustrationWidth != null ? typeof illustrationWidth === "number" ? `${illustrationWidth}px` : illustrationWidth : void 0,
|
|
10805
11009
|
height: illustrationHeight != null ? typeof illustrationHeight === "number" ? `${illustrationHeight}px` : illustrationHeight : void 0
|
|
10806
11010
|
} : void 0;
|
|
10807
|
-
const illustrationWrapper = illustration ? /* @__PURE__ */ (0,
|
|
11011
|
+
const illustrationWrapper = illustration ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10808
11012
|
"div",
|
|
10809
11013
|
{
|
|
10810
11014
|
className: cn(
|
|
@@ -10815,26 +11019,26 @@ var EmptyState = React26.forwardRef(
|
|
|
10815
11019
|
children: illustration
|
|
10816
11020
|
}
|
|
10817
11021
|
) : null;
|
|
10818
|
-
const textBlock = /* @__PURE__ */ (0,
|
|
10819
|
-
typeof title === "string" ? /* @__PURE__ */ (0,
|
|
10820
|
-
description != null && (typeof description === "string" ? /* @__PURE__ */ (0,
|
|
11022
|
+
const textBlock = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: EMPTY_STATE_TOKENS.textWrap, children: [
|
|
11023
|
+
typeof title === "string" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: EMPTY_STATE_TOKENS.title, children: title }) : title,
|
|
11024
|
+
description != null && (typeof description === "string" ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: EMPTY_STATE_TOKENS.description, children: description }) : description)
|
|
10821
11025
|
] });
|
|
10822
11026
|
const actionsArray = action == null ? [] : Array.isArray(action) ? action : [action];
|
|
10823
|
-
const actionsEl = actionsArray.length > 0 ? /* @__PURE__ */ (0,
|
|
10824
|
-
const content = /* @__PURE__ */ (0,
|
|
11027
|
+
const actionsEl = actionsArray.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: EMPTY_STATE_TOKENS.actions, children: actionsArray.map((a, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(React27.Fragment, { children: a }, i)) }) : null;
|
|
11028
|
+
const content = /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
|
|
10825
11029
|
illustrationPosition === "top" && illustrationWrapper,
|
|
10826
11030
|
textBlock,
|
|
10827
11031
|
actionsEl,
|
|
10828
11032
|
illustrationPosition === "bottom" && illustrationWrapper
|
|
10829
11033
|
] });
|
|
10830
|
-
return /* @__PURE__ */ (0,
|
|
11034
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
10831
11035
|
"div",
|
|
10832
11036
|
{
|
|
10833
11037
|
ref,
|
|
10834
11038
|
className: cn(EMPTY_STATE_TOKENS.container, className),
|
|
10835
11039
|
"data-testid": dataTestId != null ? dataTestId : "empty-state",
|
|
10836
11040
|
...props,
|
|
10837
|
-
children: /* @__PURE__ */ (0,
|
|
11041
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: EMPTY_STATE_TOKENS.content, children: content })
|
|
10838
11042
|
}
|
|
10839
11043
|
);
|
|
10840
11044
|
}
|
|
@@ -10842,7 +11046,7 @@ var EmptyState = React26.forwardRef(
|
|
|
10842
11046
|
EmptyState.displayName = "EmptyState";
|
|
10843
11047
|
|
|
10844
11048
|
// src/list-card/list-card.tsx
|
|
10845
|
-
var
|
|
11049
|
+
var React28 = __toESM(require("react"));
|
|
10846
11050
|
|
|
10847
11051
|
// src/list-card/variables.ts
|
|
10848
11052
|
var LIST_TOKENS = {
|
|
@@ -10881,8 +11085,8 @@ var LIST_TOKENS = {
|
|
|
10881
11085
|
};
|
|
10882
11086
|
|
|
10883
11087
|
// src/list-card/list-card.tsx
|
|
10884
|
-
var
|
|
10885
|
-
var List =
|
|
11088
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
11089
|
+
var List = React28.forwardRef(
|
|
10886
11090
|
({
|
|
10887
11091
|
type = "card",
|
|
10888
11092
|
variant = "default",
|
|
@@ -10894,7 +11098,7 @@ var List = React27.forwardRef(
|
|
|
10894
11098
|
...props
|
|
10895
11099
|
}, ref) => {
|
|
10896
11100
|
const list_border_radius = list_border_radiusProp != null ? list_border_radiusProp : type === "card" ? "rounded" : "soft";
|
|
10897
|
-
return /* @__PURE__ */ (0,
|
|
11101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
10898
11102
|
"div",
|
|
10899
11103
|
{
|
|
10900
11104
|
ref,
|
|
@@ -10918,7 +11122,7 @@ var List = React27.forwardRef(
|
|
|
10918
11122
|
List.displayName = "List";
|
|
10919
11123
|
|
|
10920
11124
|
// src/surface/surface.tsx
|
|
10921
|
-
var
|
|
11125
|
+
var React29 = __toESM(require("react"));
|
|
10922
11126
|
|
|
10923
11127
|
// src/surface/variables.ts
|
|
10924
11128
|
var SURFACE_TOKENS = {
|
|
@@ -10939,7 +11143,7 @@ var SURFACE_TOKENS = {
|
|
|
10939
11143
|
};
|
|
10940
11144
|
|
|
10941
11145
|
// src/surface/surface.tsx
|
|
10942
|
-
var
|
|
11146
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
10943
11147
|
var GRADIENT_ANGLE = {
|
|
10944
11148
|
top: "180deg",
|
|
10945
11149
|
bottom: "0deg",
|
|
@@ -10953,7 +11157,7 @@ function buildGradient({
|
|
|
10953
11157
|
}) {
|
|
10954
11158
|
return `linear-gradient(${GRADIENT_ANGLE[position]}, ${color} 0%, white ${coverage})`;
|
|
10955
11159
|
}
|
|
10956
|
-
var Surface =
|
|
11160
|
+
var Surface = React29.forwardRef(
|
|
10957
11161
|
({
|
|
10958
11162
|
background = "white",
|
|
10959
11163
|
padded = true,
|
|
@@ -10964,7 +11168,7 @@ var Surface = React28.forwardRef(
|
|
|
10964
11168
|
...props
|
|
10965
11169
|
}, ref) => {
|
|
10966
11170
|
const mergedStyle = gradient ? { background: buildGradient(gradient), ...style } : style;
|
|
10967
|
-
return /* @__PURE__ */ (0,
|
|
11171
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
10968
11172
|
"div",
|
|
10969
11173
|
{
|
|
10970
11174
|
ref,
|
|
@@ -10982,17 +11186,17 @@ var Surface = React28.forwardRef(
|
|
|
10982
11186
|
}
|
|
10983
11187
|
);
|
|
10984
11188
|
Surface.displayName = "Surface";
|
|
10985
|
-
var SurfaceHeader =
|
|
11189
|
+
var SurfaceHeader = React29.forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref, className: cn(SURFACE_TOKENS.header, className), ...props, children }));
|
|
10986
11190
|
SurfaceHeader.displayName = "SurfaceHeader";
|
|
10987
|
-
var SurfaceBody =
|
|
10988
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */ (0,
|
|
11191
|
+
var SurfaceBody = React29.forwardRef(
|
|
11192
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref, className: cn(SURFACE_TOKENS.body, className), ...props, children })
|
|
10989
11193
|
);
|
|
10990
11194
|
SurfaceBody.displayName = "SurfaceBody";
|
|
10991
|
-
var SurfaceFooter =
|
|
11195
|
+
var SurfaceFooter = React29.forwardRef(({ children, className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { ref, className: cn(SURFACE_TOKENS.footer, className), ...props, children }));
|
|
10992
11196
|
SurfaceFooter.displayName = "SurfaceFooter";
|
|
10993
11197
|
|
|
10994
11198
|
// src/side-panel/side-panel.tsx
|
|
10995
|
-
var
|
|
11199
|
+
var React30 = __toESM(require("react"));
|
|
10996
11200
|
|
|
10997
11201
|
// src/side-panel/variables.ts
|
|
10998
11202
|
var SIDE_PANEL_TOKENS = {
|
|
@@ -11012,10 +11216,10 @@ var SIDE_PANEL_TOKENS = {
|
|
|
11012
11216
|
};
|
|
11013
11217
|
|
|
11014
11218
|
// src/side-panel/side-panel.tsx
|
|
11015
|
-
var
|
|
11016
|
-
var SidePanel =
|
|
11219
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
11220
|
+
var SidePanel = React30.forwardRef(
|
|
11017
11221
|
({ size = "sm", side = "right", className, children, "data-testid": dataTestId, ...props }, ref) => {
|
|
11018
|
-
return /* @__PURE__ */ (0,
|
|
11222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
11019
11223
|
"div",
|
|
11020
11224
|
{
|
|
11021
11225
|
ref,
|
|
@@ -11034,89 +11238,6 @@ var SidePanel = React29.forwardRef(
|
|
|
11034
11238
|
);
|
|
11035
11239
|
SidePanel.displayName = "SidePanel";
|
|
11036
11240
|
|
|
11037
|
-
// src/tooltip/tooltip.tsx
|
|
11038
|
-
var React30 = __toESM(require("react"));
|
|
11039
|
-
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
11040
|
-
|
|
11041
|
-
// src/tooltip/variables.ts
|
|
11042
|
-
var TOOLTIP_TOKENS = {
|
|
11043
|
-
content: {
|
|
11044
|
-
base: "z-50 overflow-hidden rounded-xl px-2 py-2 text-xs leading-4 font-normal",
|
|
11045
|
-
bg: "bg-token-brand-primary text-fg-white"
|
|
11046
|
-
},
|
|
11047
|
-
arrow: "fill-primary",
|
|
11048
|
-
shortcut: {
|
|
11049
|
-
base: "ml-2 inline-flex h-5 min-w-5 items-center justify-center rounded-sm px-1 text-xs leading-4 font-normal",
|
|
11050
|
-
bg: "bg-token-grey",
|
|
11051
|
-
text: "text-fg-grey-secondary"
|
|
11052
|
-
}
|
|
11053
|
-
};
|
|
11054
|
-
|
|
11055
|
-
// src/tooltip/tooltip.tsx
|
|
11056
|
-
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
11057
|
-
var useTooltipContainer = (anchorRef) => {
|
|
11058
|
-
const [container, setContainer] = React30.useState(
|
|
11059
|
-
void 0
|
|
11060
|
-
);
|
|
11061
|
-
React30.useEffect(() => {
|
|
11062
|
-
var _a5;
|
|
11063
|
-
if (typeof document === "undefined") return;
|
|
11064
|
-
const anchor = anchorRef.current;
|
|
11065
|
-
const el = (_a5 = anchor == null ? void 0 : anchor.closest(".lego-land")) != null ? _a5 : document.querySelector(".lego-land");
|
|
11066
|
-
setContainer(el != null ? el : void 0);
|
|
11067
|
-
}, [anchorRef]);
|
|
11068
|
-
return container;
|
|
11069
|
-
};
|
|
11070
|
-
var TooltipProvider = TooltipPrimitive.Provider;
|
|
11071
|
-
var Tooltip = TooltipPrimitive.Root;
|
|
11072
|
-
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
11073
|
-
var TooltipContent = React30.forwardRef(({ className, sideOffset = 6, shortcut, children, ...props }, ref) => {
|
|
11074
|
-
const anchorRef = React30.useRef(null);
|
|
11075
|
-
const container = useTooltipContainer(anchorRef);
|
|
11076
|
-
const content = /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
11077
|
-
TooltipPrimitive.Content,
|
|
11078
|
-
{
|
|
11079
|
-
ref,
|
|
11080
|
-
sideOffset,
|
|
11081
|
-
className: cn(
|
|
11082
|
-
TOOLTIP_TOKENS.content.base,
|
|
11083
|
-
TOOLTIP_TOKENS.content.bg,
|
|
11084
|
-
"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
11085
|
-
className
|
|
11086
|
-
),
|
|
11087
|
-
...props,
|
|
11088
|
-
children: [
|
|
11089
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center", children: [
|
|
11090
|
-
children,
|
|
11091
|
-
shortcut && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
11092
|
-
"span",
|
|
11093
|
-
{
|
|
11094
|
-
className: cn(
|
|
11095
|
-
TOOLTIP_TOKENS.shortcut.base,
|
|
11096
|
-
TOOLTIP_TOKENS.shortcut.bg,
|
|
11097
|
-
TOOLTIP_TOKENS.shortcut.text
|
|
11098
|
-
),
|
|
11099
|
-
children: shortcut
|
|
11100
|
-
}
|
|
11101
|
-
)
|
|
11102
|
-
] }),
|
|
11103
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
11104
|
-
TooltipPrimitive.Arrow,
|
|
11105
|
-
{
|
|
11106
|
-
className: TOOLTIP_TOKENS.arrow,
|
|
11107
|
-
style: { fill: "hsl(var(--bg-brand-primary))" }
|
|
11108
|
-
}
|
|
11109
|
-
)
|
|
11110
|
-
]
|
|
11111
|
-
}
|
|
11112
|
-
);
|
|
11113
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
11114
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { ref: anchorRef, style: { display: "none" } }),
|
|
11115
|
-
container ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(TooltipPrimitive.Portal, { container, children: content }) : content
|
|
11116
|
-
] });
|
|
11117
|
-
});
|
|
11118
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
11119
|
-
|
|
11120
11241
|
// src/dialog/dialog.tsx
|
|
11121
11242
|
var React31 = __toESM(require("react"));
|
|
11122
11243
|
var import_lucide_react9 = require("lucide-react");
|
|
@@ -15125,9 +15246,16 @@ function CompoundFilterSelect({
|
|
|
15125
15246
|
leftLabel,
|
|
15126
15247
|
children,
|
|
15127
15248
|
disabled = false,
|
|
15249
|
+
inputValue,
|
|
15250
|
+
onInputValueChange,
|
|
15251
|
+
inputPlaceholder,
|
|
15252
|
+
inputType = "text",
|
|
15253
|
+
inputWidth = 220,
|
|
15254
|
+
"data-testid-input": dataTestIdInput,
|
|
15128
15255
|
className,
|
|
15129
15256
|
...props
|
|
15130
15257
|
}) {
|
|
15258
|
+
const useInputMode = inputValue !== void 0;
|
|
15131
15259
|
const { theme } = useTheme();
|
|
15132
15260
|
const themeClass = theme === "dark" ? "dark" : "light";
|
|
15133
15261
|
const [open, setOpen] = React40.useState(false);
|
|
@@ -15144,7 +15272,13 @@ function CompoundFilterSelect({
|
|
|
15144
15272
|
"div",
|
|
15145
15273
|
{
|
|
15146
15274
|
className: cn(
|
|
15147
|
-
|
|
15275
|
+
// `group/compound` lets the left pill react to focus anywhere inside
|
|
15276
|
+
// the compound — when the user clicks into the built-in input mode's
|
|
15277
|
+
// <input> (or any focusable child in the children path), `:focus-within`
|
|
15278
|
+
// fires on this wrapper, and the left pill flips to `border-token-brand`
|
|
15279
|
+
// alongside the right input. Without this, only the focused side
|
|
15280
|
+
// looked active and the merged pill read as half-active.
|
|
15281
|
+
"group/compound inline-flex items-start pr-px font-sans",
|
|
15148
15282
|
disabled && "opacity-60 pointer-events-none",
|
|
15149
15283
|
className
|
|
15150
15284
|
),
|
|
@@ -15163,6 +15297,11 @@ function CompoundFilterSelect({
|
|
|
15163
15297
|
"outline-none transition-colors cursor-pointer",
|
|
15164
15298
|
"hover:bg-interaction-hov-opacity-primary",
|
|
15165
15299
|
"active:bg-interaction-pressed-opacity-primary",
|
|
15300
|
+
// Paint brand-blue when focus lives anywhere in the compound
|
|
15301
|
+
// (e.g. the user is typing in the built-in input). Pair with
|
|
15302
|
+
// `z-10` so the merged border stays continuous with the right
|
|
15303
|
+
// pill's own focused state.
|
|
15304
|
+
"group-focus-within/compound:border-token-brand group-focus-within/compound:z-10",
|
|
15166
15305
|
"data-[state=open]:border-token-brand data-[state=open]:z-10",
|
|
15167
15306
|
"disabled:opacity-50 disabled:pointer-events-none",
|
|
15168
15307
|
"relative"
|
|
@@ -15239,7 +15378,27 @@ function CompoundFilterSelect({
|
|
|
15239
15378
|
}
|
|
15240
15379
|
) })
|
|
15241
15380
|
] }),
|
|
15242
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
15381
|
+
useInputMode ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
15382
|
+
"input",
|
|
15383
|
+
{
|
|
15384
|
+
type: inputType,
|
|
15385
|
+
value: inputValue,
|
|
15386
|
+
onChange: (e) => onInputValueChange == null ? void 0 : onInputValueChange(e.target.value),
|
|
15387
|
+
placeholder: inputPlaceholder,
|
|
15388
|
+
disabled,
|
|
15389
|
+
"data-testid": dataTestIdInput,
|
|
15390
|
+
style: { width: typeof inputWidth === "number" ? `${inputWidth}px` : inputWidth },
|
|
15391
|
+
className: cn(
|
|
15392
|
+
"border border-solid border-token-light bg-token-white",
|
|
15393
|
+
"rounded-r-[16px] shrink-0",
|
|
15394
|
+
"px-3 py-2 outline-none transition-colors",
|
|
15395
|
+
"font-sans text-xs font-normal leading-4 text-fg-black",
|
|
15396
|
+
"placeholder:text-fg-placeholder",
|
|
15397
|
+
"focus:border-token-brand focus:z-10",
|
|
15398
|
+
"disabled:opacity-50 disabled:pointer-events-none"
|
|
15399
|
+
)
|
|
15400
|
+
}
|
|
15401
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
15243
15402
|
"div",
|
|
15244
15403
|
{
|
|
15245
15404
|
className: cn(
|
|
@@ -17139,15 +17298,27 @@ var Popover = React46.forwardRef(
|
|
|
17139
17298
|
};
|
|
17140
17299
|
const onScroll = (e) => {
|
|
17141
17300
|
var _a6;
|
|
17142
|
-
|
|
17301
|
+
const target = e.target;
|
|
17302
|
+
if ((_a6 = popoverRef.current) == null ? void 0 : _a6.contains(target)) return;
|
|
17303
|
+
if (target && typeof target.closest === "function" && target.closest(
|
|
17304
|
+
'[data-lego-popover][data-state="open"], [data-radix-popper-content-wrapper]'
|
|
17305
|
+
)) {
|
|
17306
|
+
return;
|
|
17307
|
+
}
|
|
17143
17308
|
update();
|
|
17144
17309
|
};
|
|
17145
17310
|
update();
|
|
17146
17311
|
window.addEventListener("resize", update);
|
|
17147
17312
|
window.addEventListener("scroll", onScroll, true);
|
|
17313
|
+
let ro;
|
|
17314
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
17315
|
+
ro = new ResizeObserver(() => update());
|
|
17316
|
+
ro.observe(p);
|
|
17317
|
+
}
|
|
17148
17318
|
return () => {
|
|
17149
17319
|
window.removeEventListener("resize", update);
|
|
17150
17320
|
window.removeEventListener("scroll", onScroll, true);
|
|
17321
|
+
ro == null ? void 0 : ro.disconnect();
|
|
17151
17322
|
};
|
|
17152
17323
|
}, [open, side, align, sideOffset]);
|
|
17153
17324
|
React46.useEffect(() => {
|
|
@@ -17674,6 +17845,10 @@ var TimeRangeInput = React49.forwardRef(
|
|
|
17674
17845
|
const parsed = React49.useMemo(() => parse24To12(value), [value]);
|
|
17675
17846
|
const [hour, setHour] = React49.useState(parsed.hour);
|
|
17676
17847
|
const [minute, setMinute] = React49.useState(parsed.minute);
|
|
17848
|
+
const hourValueRef = React49.useRef(hour);
|
|
17849
|
+
const minuteValueRef = React49.useRef(minute);
|
|
17850
|
+
hourValueRef.current = hour;
|
|
17851
|
+
minuteValueRef.current = minute;
|
|
17677
17852
|
React49.useEffect(() => {
|
|
17678
17853
|
setHour(parsed.hour);
|
|
17679
17854
|
setMinute(parsed.minute);
|
|
@@ -17683,8 +17858,8 @@ var TimeRangeInput = React49.forwardRef(
|
|
|
17683
17858
|
const commit = (next) => {
|
|
17684
17859
|
var _a5, _b5, _c;
|
|
17685
17860
|
const merged = {
|
|
17686
|
-
hour: (_a5 = next.hour) != null ? _a5 :
|
|
17687
|
-
minute: (_b5 = next.minute) != null ? _b5 :
|
|
17861
|
+
hour: (_a5 = next.hour) != null ? _a5 : hourValueRef.current,
|
|
17862
|
+
minute: (_b5 = next.minute) != null ? _b5 : minuteValueRef.current,
|
|
17688
17863
|
period: (_c = next.period) != null ? _c : parsed.period
|
|
17689
17864
|
};
|
|
17690
17865
|
onChange(format12To24(merged));
|
|
@@ -17693,26 +17868,32 @@ var TimeRangeInput = React49.forwardRef(
|
|
|
17693
17868
|
var _a5;
|
|
17694
17869
|
const digits = raw.replace(/\D/g, "").slice(0, 2);
|
|
17695
17870
|
setHour(digits);
|
|
17871
|
+
hourValueRef.current = digits;
|
|
17696
17872
|
const n = Number.parseInt(digits) || 0;
|
|
17697
17873
|
if (digits.length === 2 && n >= 1 && n <= 12) {
|
|
17698
17874
|
(_a5 = minuteRef.current) == null ? void 0 : _a5.focus();
|
|
17699
17875
|
}
|
|
17700
17876
|
};
|
|
17701
17877
|
const handleHourBlur = () => {
|
|
17702
|
-
const
|
|
17703
|
-
const
|
|
17878
|
+
const current = hourValueRef.current;
|
|
17879
|
+
const n = Number.parseInt(current);
|
|
17880
|
+
const clamped = !current || n < 1 || n > 12 ? "12" : String(n);
|
|
17704
17881
|
setHour(clamped);
|
|
17705
|
-
|
|
17882
|
+
hourValueRef.current = clamped;
|
|
17883
|
+
commit({ hour: clamped, minute: minuteValueRef.current.padStart(2, "0") });
|
|
17706
17884
|
};
|
|
17707
17885
|
const handleMinuteChange = (raw) => {
|
|
17708
17886
|
const digits = raw.replace(/\D/g, "").slice(0, 2);
|
|
17709
17887
|
setMinute(digits);
|
|
17888
|
+
minuteValueRef.current = digits;
|
|
17710
17889
|
};
|
|
17711
17890
|
const handleMinuteBlur = () => {
|
|
17712
|
-
const
|
|
17891
|
+
const current = minuteValueRef.current;
|
|
17892
|
+
const n = Number.parseInt(current) || 0;
|
|
17713
17893
|
const clamped = n > 59 ? "00" : String(n).padStart(2, "0");
|
|
17714
17894
|
setMinute(clamped);
|
|
17715
|
-
|
|
17895
|
+
minuteValueRef.current = clamped;
|
|
17896
|
+
commit({ hour: hourValueRef.current, minute: clamped });
|
|
17716
17897
|
};
|
|
17717
17898
|
const handlePeriodChange = (next) => {
|
|
17718
17899
|
if (next === "AM" || next === "PM") commit({ period: next });
|
|
@@ -19357,6 +19538,7 @@ RuleBuilderAddCondition.displayName = "RuleBuilderAddCondition";
|
|
|
19357
19538
|
ChatBubbleUser,
|
|
19358
19539
|
Checkbox,
|
|
19359
19540
|
Chip,
|
|
19541
|
+
CircularBadge,
|
|
19360
19542
|
ColumnWidth,
|
|
19361
19543
|
CompoundFilterSelect,
|
|
19362
19544
|
DEFAULT_DATE_PRESETS,
|