@l3mpire/ui 3.0.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/USAGE.md +25 -4
- package/dist/index.d.mts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.js +302 -189
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +303 -190
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/styles/globals.css +92 -0
package/dist/index.js
CHANGED
|
@@ -202,7 +202,7 @@ function cn(...inputs) {
|
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
// src/components/ui/browser-tab.tsx
|
|
205
|
-
var
|
|
205
|
+
var React4 = __toESM(require("react"));
|
|
206
206
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
207
207
|
var import_icons3 = require("@l3mpire/icons");
|
|
208
208
|
|
|
@@ -231,6 +231,20 @@ var badgeVariants = (0, import_class_variance_authority.cva)(
|
|
|
231
231
|
warning: "",
|
|
232
232
|
neutral: ""
|
|
233
233
|
},
|
|
234
|
+
// Categorical palette. Colors come from {variant, tone} compound variants below,
|
|
235
|
+
// so a tone combines with solid / light / outlined just like `type` does.
|
|
236
|
+
tone: {
|
|
237
|
+
indigo: "",
|
|
238
|
+
rose: "",
|
|
239
|
+
lime: "",
|
|
240
|
+
violet: "",
|
|
241
|
+
cyan: "",
|
|
242
|
+
orange: "",
|
|
243
|
+
emerald: "",
|
|
244
|
+
fuchsia: "",
|
|
245
|
+
amber: "",
|
|
246
|
+
slate: ""
|
|
247
|
+
},
|
|
234
248
|
size: {
|
|
235
249
|
sm: [
|
|
236
250
|
"p-2xs gap-2xs",
|
|
@@ -267,22 +281,61 @@ var badgeVariants = (0, import_class_variance_authority.cva)(
|
|
|
267
281
|
{ variant: "outlined", type: "success", class: "border-badge-outlined-success-border text-badge-outlined-success-text" },
|
|
268
282
|
{ variant: "outlined", type: "critical", class: "border-badge-outlined-critical-border text-badge-outlined-critical-text" },
|
|
269
283
|
{ variant: "outlined", type: "warning", class: "border-badge-outlined-warning-border text-badge-outlined-warning-text" },
|
|
270
|
-
{ variant: "outlined", type: "neutral", class: "border-badge-outlined-neutral-border text-badge-outlined-neutral-text" }
|
|
284
|
+
{ variant: "outlined", type: "neutral", class: "border-badge-outlined-neutral-border text-badge-outlined-neutral-text" },
|
|
285
|
+
// ── Categorical tones × variant ──────────────────────────────────────
|
|
286
|
+
{ variant: "solid", tone: "indigo", class: "bg-badge-solid-indigo-bg text-badge-solid-indigo-text" },
|
|
287
|
+
{ variant: "solid", tone: "rose", class: "bg-badge-solid-rose-bg text-badge-solid-rose-text" },
|
|
288
|
+
{ variant: "solid", tone: "lime", class: "bg-badge-solid-lime-bg text-badge-solid-lime-text" },
|
|
289
|
+
{ variant: "solid", tone: "violet", class: "bg-badge-solid-violet-bg text-badge-solid-violet-text" },
|
|
290
|
+
{ variant: "solid", tone: "cyan", class: "bg-badge-solid-cyan-bg text-badge-solid-cyan-text" },
|
|
291
|
+
{ variant: "solid", tone: "orange", class: "bg-badge-solid-orange-bg text-badge-solid-orange-text" },
|
|
292
|
+
{ variant: "solid", tone: "emerald", class: "bg-badge-solid-emerald-bg text-badge-solid-emerald-text" },
|
|
293
|
+
{ variant: "solid", tone: "fuchsia", class: "bg-badge-solid-fuchsia-bg text-badge-solid-fuchsia-text" },
|
|
294
|
+
{ variant: "solid", tone: "amber", class: "bg-badge-solid-amber-bg text-badge-solid-amber-text" },
|
|
295
|
+
{ variant: "solid", tone: "slate", class: "bg-badge-solid-slate-bg text-badge-solid-slate-text" },
|
|
296
|
+
{ variant: "light", tone: "indigo", class: "bg-badge-light-indigo-bg text-badge-light-indigo-text" },
|
|
297
|
+
{ variant: "light", tone: "rose", class: "bg-badge-light-rose-bg text-badge-light-rose-text" },
|
|
298
|
+
{ variant: "light", tone: "lime", class: "bg-badge-light-lime-bg text-badge-light-lime-text" },
|
|
299
|
+
{ variant: "light", tone: "violet", class: "bg-badge-light-violet-bg text-badge-light-violet-text" },
|
|
300
|
+
{ variant: "light", tone: "cyan", class: "bg-badge-light-cyan-bg text-badge-light-cyan-text" },
|
|
301
|
+
{ variant: "light", tone: "orange", class: "bg-badge-light-orange-bg text-badge-light-orange-text" },
|
|
302
|
+
{ variant: "light", tone: "emerald", class: "bg-badge-light-emerald-bg text-badge-light-emerald-text" },
|
|
303
|
+
{ variant: "light", tone: "fuchsia", class: "bg-badge-light-fuchsia-bg text-badge-light-fuchsia-text" },
|
|
304
|
+
{ variant: "light", tone: "amber", class: "bg-badge-light-amber-bg text-badge-light-amber-text" },
|
|
305
|
+
{ variant: "light", tone: "slate", class: "bg-badge-light-slate-bg text-badge-light-slate-text" },
|
|
306
|
+
{ variant: "outlined", tone: "indigo", class: "border-badge-outlined-indigo-border text-badge-outlined-indigo-text" },
|
|
307
|
+
{ variant: "outlined", tone: "rose", class: "border-badge-outlined-rose-border text-badge-outlined-rose-text" },
|
|
308
|
+
{ variant: "outlined", tone: "lime", class: "border-badge-outlined-lime-border text-badge-outlined-lime-text" },
|
|
309
|
+
{ variant: "outlined", tone: "violet", class: "border-badge-outlined-violet-border text-badge-outlined-violet-text" },
|
|
310
|
+
{ variant: "outlined", tone: "cyan", class: "border-badge-outlined-cyan-border text-badge-outlined-cyan-text" },
|
|
311
|
+
{ variant: "outlined", tone: "orange", class: "border-badge-outlined-orange-border text-badge-outlined-orange-text" },
|
|
312
|
+
{ variant: "outlined", tone: "emerald", class: "border-badge-outlined-emerald-border text-badge-outlined-emerald-text" },
|
|
313
|
+
{ variant: "outlined", tone: "fuchsia", class: "border-badge-outlined-fuchsia-border text-badge-outlined-fuchsia-text" },
|
|
314
|
+
{ variant: "outlined", tone: "amber", class: "border-badge-outlined-amber-border text-badge-outlined-amber-text" },
|
|
315
|
+
{ variant: "outlined", tone: "slate", class: "border-badge-outlined-slate-border text-badge-outlined-slate-text" }
|
|
271
316
|
],
|
|
317
|
+
// variant/type defaults are applied in the component so `tone` can suppress `type`.
|
|
272
318
|
defaultVariants: {
|
|
273
|
-
variant: "solid",
|
|
274
|
-
type: "primary",
|
|
275
319
|
size: "md"
|
|
276
320
|
}
|
|
277
321
|
}
|
|
278
322
|
);
|
|
279
323
|
var Badge = React.forwardRef(
|
|
280
|
-
({ className, variant, type, size, icon, children, ...props }, ref) => {
|
|
324
|
+
({ className, variant, type, tone, size, icon, children, ...props }, ref) => {
|
|
281
325
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
282
326
|
"span",
|
|
283
327
|
{
|
|
284
328
|
ref,
|
|
285
|
-
className: cn(
|
|
329
|
+
className: cn(
|
|
330
|
+
badgeVariants({
|
|
331
|
+
variant: variant ?? "solid",
|
|
332
|
+
// `tone` and `type` share the color axis — when a tone is set it wins.
|
|
333
|
+
type: tone != null ? void 0 : type ?? "primary",
|
|
334
|
+
tone,
|
|
335
|
+
size
|
|
336
|
+
}),
|
|
337
|
+
className
|
|
338
|
+
),
|
|
286
339
|
...props,
|
|
287
340
|
children: [
|
|
288
341
|
icon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Icon, { icon, size: "xs" }),
|
|
@@ -550,17 +603,78 @@ var Button = React2.forwardRef(
|
|
|
550
603
|
);
|
|
551
604
|
Button.displayName = "Button";
|
|
552
605
|
|
|
553
|
-
// src/components/ui/
|
|
606
|
+
// src/components/ui/tooltip.tsx
|
|
607
|
+
var React3 = __toESM(require("react"));
|
|
608
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
609
|
+
var import_class_variance_authority3 = require("class-variance-authority");
|
|
554
610
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
555
|
-
var
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
611
|
+
var tooltipContentVariants = (0, import_class_variance_authority3.cva)(
|
|
612
|
+
[
|
|
613
|
+
"inline-flex items-center z-50",
|
|
614
|
+
"gap-xs",
|
|
615
|
+
"px-base py-sm",
|
|
616
|
+
"rounded-lg",
|
|
617
|
+
"shadow-lg",
|
|
618
|
+
"text-sm",
|
|
619
|
+
"font-regular",
|
|
620
|
+
"leading-sm",
|
|
621
|
+
"data-[state=delayed-open]:animate-[tooltip-in_150ms_ease-out]",
|
|
622
|
+
"data-[state=instant-open]:animate-[tooltip-in_0ms]",
|
|
623
|
+
"data-[state=closed]:animate-[tooltip-out_100ms_ease-in]"
|
|
624
|
+
],
|
|
625
|
+
{
|
|
626
|
+
variants: {
|
|
627
|
+
type: {
|
|
628
|
+
default: [
|
|
629
|
+
"bg-tooltip-default-bg",
|
|
630
|
+
"text-tooltip-default-text"
|
|
631
|
+
],
|
|
632
|
+
invert: [
|
|
633
|
+
"bg-tooltip-invert-bg",
|
|
634
|
+
"text-tooltip-invert-text",
|
|
635
|
+
"border border-tooltip-invert-border"
|
|
636
|
+
]
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
defaultVariants: {
|
|
640
|
+
type: "default"
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
);
|
|
644
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
645
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
646
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
647
|
+
var TooltipContent = React3.forwardRef(({ className, type, hasArrow = true, sideOffset = 4, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
648
|
+
TooltipPrimitive.Content,
|
|
649
|
+
{
|
|
650
|
+
ref,
|
|
651
|
+
sideOffset,
|
|
652
|
+
className: cn(tooltipContentVariants({ type, className })),
|
|
653
|
+
...props,
|
|
654
|
+
children: [
|
|
655
|
+
children,
|
|
656
|
+
hasArrow && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
657
|
+
TooltipPrimitive.Arrow,
|
|
658
|
+
{
|
|
659
|
+
className: type === "default" ? "fill-tooltip-default-bg" : "fill-tooltip-invert-bg"
|
|
660
|
+
}
|
|
661
|
+
)
|
|
662
|
+
]
|
|
663
|
+
}
|
|
664
|
+
) }));
|
|
665
|
+
TooltipContent.displayName = "TooltipContent";
|
|
666
|
+
|
|
667
|
+
// src/components/ui/browser-tab.tsx
|
|
668
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
669
|
+
var BrowserTabContext = React4.createContext(null);
|
|
670
|
+
var BrowserTabItem = React4.forwardRef(
|
|
671
|
+
({ className, icon, label, badge, isActive = false, pinned = false, isEditable = false, onEdit, onClose, onRename, ...props }, ref) => {
|
|
672
|
+
const [isHovered, setIsHovered] = React4.useState(false);
|
|
673
|
+
const [isEditing, setIsEditing] = React4.useState(false);
|
|
674
|
+
const [editValue, setEditValue] = React4.useState(label);
|
|
675
|
+
const inputRef = React4.useRef(null);
|
|
676
|
+
const ctx = React4.useContext(BrowserTabContext);
|
|
677
|
+
React4.useEffect(() => {
|
|
564
678
|
if (isEditing && inputRef.current) {
|
|
565
679
|
inputRef.current.focus();
|
|
566
680
|
inputRef.current.select();
|
|
@@ -589,7 +703,7 @@ var BrowserTabItem = React3.forwardRef(
|
|
|
589
703
|
const isDragged = ctx?.draggable && ctx.dragIndex === ctx.itemIndex;
|
|
590
704
|
const isDropTarget = ctx?.draggable && ctx.dropIndex === ctx.itemIndex && ctx.dragIndex !== ctx.itemIndex;
|
|
591
705
|
const showGrip = ctx?.draggable && isHovered;
|
|
592
|
-
|
|
706
|
+
const tab = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
593
707
|
"div",
|
|
594
708
|
{
|
|
595
709
|
ref,
|
|
@@ -606,15 +720,15 @@ var BrowserTabItem = React3.forwardRef(
|
|
|
606
720
|
...dragProps,
|
|
607
721
|
...props,
|
|
608
722
|
children: [
|
|
609
|
-
/* @__PURE__ */ (0,
|
|
723
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
610
724
|
"div",
|
|
611
725
|
{
|
|
612
726
|
className: cn(
|
|
613
|
-
"flex items-center gap-base px-xs py-2xs transition-[background-color,border-radius,box-shadow]",
|
|
727
|
+
"relative flex items-center gap-base px-xs py-2xs transition-[background-color,border-radius,box-shadow]",
|
|
614
728
|
isHovered && !isActive ? "bg-browser-tab-item-hover-bg rounded-sm shadow-sm" : "bg-browser-tab-item-bg rounded-base"
|
|
615
729
|
),
|
|
616
730
|
children: [
|
|
617
|
-
icon && /* @__PURE__ */ (0,
|
|
731
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
618
732
|
import_icons3.Icon,
|
|
619
733
|
{
|
|
620
734
|
icon: showGrip ? import_icons3.faGripDotsVerticalSolid : icon,
|
|
@@ -624,7 +738,7 @@ var BrowserTabItem = React3.forwardRef(
|
|
|
624
738
|
)
|
|
625
739
|
}
|
|
626
740
|
) }),
|
|
627
|
-
isEditing ? /* @__PURE__ */ (0,
|
|
741
|
+
isEditing ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
628
742
|
"input",
|
|
629
743
|
{
|
|
630
744
|
ref: inputRef,
|
|
@@ -643,7 +757,7 @@ var BrowserTabItem = React3.forwardRef(
|
|
|
643
757
|
),
|
|
644
758
|
style: { width: `${Math.max(editValue.length + 1, 2)}ch` }
|
|
645
759
|
}
|
|
646
|
-
) : /* @__PURE__ */ (0,
|
|
760
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
647
761
|
"span",
|
|
648
762
|
{
|
|
649
763
|
className: cn(
|
|
@@ -660,46 +774,86 @@ var BrowserTabItem = React3.forwardRef(
|
|
|
660
774
|
children: label
|
|
661
775
|
}
|
|
662
776
|
),
|
|
663
|
-
badge && /* @__PURE__ */ (0,
|
|
664
|
-
onClose && /* @__PURE__ */ (0,
|
|
665
|
-
"
|
|
777
|
+
badge && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Badge, { variant: "light", type: "neutral", size: "sm", children: badge }),
|
|
778
|
+
!pinned && (isEditable || onClose) && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
779
|
+
"div",
|
|
666
780
|
{
|
|
667
|
-
|
|
668
|
-
e.stopPropagation();
|
|
669
|
-
onClose(e);
|
|
670
|
-
},
|
|
781
|
+
"aria-hidden": !isHovered,
|
|
671
782
|
className: cn(
|
|
672
|
-
"
|
|
673
|
-
|
|
783
|
+
"absolute right-0 top-0 bottom-0 flex items-center justify-end gap-2xs pl-2xl pr-2xs",
|
|
784
|
+
"transition-opacity duration-150 bg-gradient-to-l from-[72%] to-transparent",
|
|
785
|
+
isActive ? "from-browser-tab-item-bg rounded-r-base" : "from-browser-tab-item-hover-bg rounded-r-sm",
|
|
786
|
+
isHovered ? "opacity-100" : "opacity-0 pointer-events-none"
|
|
674
787
|
),
|
|
675
|
-
|
|
676
|
-
|
|
788
|
+
children: [
|
|
789
|
+
isEditable && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
790
|
+
"button",
|
|
791
|
+
{
|
|
792
|
+
onClick: (e) => {
|
|
793
|
+
e.stopPropagation();
|
|
794
|
+
onEdit?.(e);
|
|
795
|
+
},
|
|
796
|
+
tabIndex: isHovered ? 0 : -1,
|
|
797
|
+
className: cn(
|
|
798
|
+
"shrink-0 flex items-center justify-center cursor-pointer rounded-2xs p-2xs",
|
|
799
|
+
"hover:bg-black/5 transition-colors",
|
|
800
|
+
isActive ? "text-browser-tab-item-active-icon" : "text-browser-tab-item-inactive-icon"
|
|
801
|
+
),
|
|
802
|
+
"aria-label": `Edit ${label}`,
|
|
803
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons3.Icon, { icon: import_icons3.faPenOutline, size: "xs" })
|
|
804
|
+
}
|
|
805
|
+
),
|
|
806
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
807
|
+
"button",
|
|
808
|
+
{
|
|
809
|
+
onClick: (e) => {
|
|
810
|
+
e.stopPropagation();
|
|
811
|
+
onClose(e);
|
|
812
|
+
},
|
|
813
|
+
tabIndex: isHovered ? 0 : -1,
|
|
814
|
+
className: cn(
|
|
815
|
+
"shrink-0 flex items-center justify-center cursor-pointer rounded-2xs p-2xs",
|
|
816
|
+
"hover:bg-black/5 transition-colors",
|
|
817
|
+
isActive ? "text-browser-tab-item-active-icon" : "text-browser-tab-item-inactive-icon"
|
|
818
|
+
),
|
|
819
|
+
"aria-label": `Close ${label}`,
|
|
820
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_icons3.Icon, { icon: import_icons3.faXmarkOutline, size: "xs" })
|
|
821
|
+
}
|
|
822
|
+
)
|
|
823
|
+
]
|
|
677
824
|
}
|
|
678
825
|
)
|
|
679
826
|
]
|
|
680
827
|
}
|
|
681
828
|
),
|
|
682
|
-
isActive && /* @__PURE__ */ (0,
|
|
683
|
-
/* @__PURE__ */ (0,
|
|
684
|
-
/* @__PURE__ */ (0,
|
|
685
|
-
/* @__PURE__ */ (0,
|
|
686
|
-
/* @__PURE__ */ (0,
|
|
687
|
-
/* @__PURE__ */ (0,
|
|
829
|
+
isActive && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
830
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": true, className: "pointer-events-none absolute bottom-0 left-[-1px] w-px h-[8px] bg-browser-tab-item-bg" }),
|
|
831
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": true, className: "pointer-events-none absolute bottom-0 right-[-1px] w-px h-[8px] bg-browser-tab-item-bg" }),
|
|
832
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "aria-hidden": true, className: "pointer-events-none absolute bottom-0 left-[-8px] size-[8px]", children: [
|
|
833
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "absolute bottom-0 left-0 right-0 h-px bg-browser-tab-item-bg" }),
|
|
834
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "absolute inset-0 rounded-br-[8px] border-b border-r border-solid border-browser-tab-item-border" })
|
|
688
835
|
] }),
|
|
689
|
-
/* @__PURE__ */ (0,
|
|
690
|
-
/* @__PURE__ */ (0,
|
|
691
|
-
/* @__PURE__ */ (0,
|
|
836
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { "aria-hidden": true, className: "pointer-events-none absolute bottom-0 right-[-8px] size-[8px]", children: [
|
|
837
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "absolute bottom-0 left-0 right-0 h-px bg-browser-tab-item-bg" }),
|
|
838
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "absolute inset-0 rounded-bl-[8px] border-b border-l border-solid border-browser-tab-item-border" })
|
|
692
839
|
] })
|
|
693
840
|
] })
|
|
694
841
|
]
|
|
695
842
|
}
|
|
696
843
|
);
|
|
844
|
+
if (pinned) {
|
|
845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipProvider, { delayDuration: 300, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Tooltip, { children: [
|
|
846
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipTrigger, { asChild: true, children: tab }),
|
|
847
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipContent, { side: "bottom", hasArrow: false, children: "Pinned tab" })
|
|
848
|
+
] }) });
|
|
849
|
+
}
|
|
850
|
+
return tab;
|
|
697
851
|
}
|
|
698
852
|
);
|
|
699
853
|
BrowserTabItem.displayName = "BrowserTabItem";
|
|
700
854
|
function useOverflowDetection(containerRef, childCount) {
|
|
701
|
-
const [visibleCount, setVisibleCount] =
|
|
702
|
-
|
|
855
|
+
const [visibleCount, setVisibleCount] = React4.useState(childCount);
|
|
856
|
+
React4.useEffect(() => {
|
|
703
857
|
const container = containerRef.current;
|
|
704
858
|
if (!container) return;
|
|
705
859
|
const measure = () => {
|
|
@@ -727,12 +881,12 @@ function useOverflowDetection(containerRef, childCount) {
|
|
|
727
881
|
}, [containerRef, childCount]);
|
|
728
882
|
return visibleCount;
|
|
729
883
|
}
|
|
730
|
-
var BrowserTab =
|
|
884
|
+
var BrowserTab = React4.forwardRef(
|
|
731
885
|
({ className, children, onAddTab, draggable = false, onReorder, onOverflowSelect, ...props }, ref) => {
|
|
732
|
-
const [dragIndex, setDragIndex] =
|
|
733
|
-
const [dropIndex, setDropIndex] =
|
|
734
|
-
const tabsContainerRef =
|
|
735
|
-
const childArray =
|
|
886
|
+
const [dragIndex, setDragIndex] = React4.useState(null);
|
|
887
|
+
const [dropIndex, setDropIndex] = React4.useState(null);
|
|
888
|
+
const tabsContainerRef = React4.useRef(null);
|
|
889
|
+
const childArray = React4.Children.toArray(children).filter(React4.isValidElement);
|
|
736
890
|
const visibleCount = useOverflowDetection(tabsContainerRef, childArray.length);
|
|
737
891
|
const hasOverflow = visibleCount < childArray.length;
|
|
738
892
|
const ctxBase = {
|
|
@@ -766,7 +920,7 @@ var BrowserTab = React3.forwardRef(
|
|
|
766
920
|
isActive: childProps.isActive
|
|
767
921
|
};
|
|
768
922
|
});
|
|
769
|
-
return /* @__PURE__ */ (0,
|
|
923
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
770
924
|
"div",
|
|
771
925
|
{
|
|
772
926
|
ref,
|
|
@@ -776,15 +930,15 @@ var BrowserTab = React3.forwardRef(
|
|
|
776
930
|
),
|
|
777
931
|
...props,
|
|
778
932
|
children: [
|
|
779
|
-
/* @__PURE__ */ (0,
|
|
933
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
780
934
|
"div",
|
|
781
935
|
{
|
|
782
936
|
ref: tabsContainerRef,
|
|
783
937
|
className: "flex items-center flex-1 min-w-0 pl-base",
|
|
784
938
|
style: { overflowX: "clip", overflowY: "visible" },
|
|
785
939
|
children: [
|
|
786
|
-
childArray.map((child, index) => /* @__PURE__ */ (0,
|
|
787
|
-
onAddTab && !hasOverflow && /* @__PURE__ */ (0,
|
|
940
|
+
childArray.map((child, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(BrowserTabContext.Provider, { value: { ...ctxBase, itemIndex: index }, children: child }, index)),
|
|
941
|
+
onAddTab && !hasOverflow && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
788
942
|
Button,
|
|
789
943
|
{
|
|
790
944
|
className: "ml-base",
|
|
@@ -800,10 +954,11 @@ var BrowserTab = React3.forwardRef(
|
|
|
800
954
|
]
|
|
801
955
|
}
|
|
802
956
|
),
|
|
803
|
-
hasOverflow && /* @__PURE__ */ (0,
|
|
804
|
-
/* @__PURE__ */ (0,
|
|
957
|
+
hasOverflow && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(DropdownMenuPrimitive.Root, { children: [
|
|
958
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DropdownMenuPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
805
959
|
Button,
|
|
806
960
|
{
|
|
961
|
+
className: "mb-sm",
|
|
807
962
|
appearance: "ghost",
|
|
808
963
|
intent: "brand",
|
|
809
964
|
size: "sm",
|
|
@@ -812,7 +967,7 @@ var BrowserTab = React3.forwardRef(
|
|
|
812
967
|
"aria-label": "Show more tabs"
|
|
813
968
|
}
|
|
814
969
|
) }),
|
|
815
|
-
/* @__PURE__ */ (0,
|
|
970
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
816
971
|
DropdownMenuPrimitive.Content,
|
|
817
972
|
{
|
|
818
973
|
sideOffset: 4,
|
|
@@ -824,7 +979,7 @@ var BrowserTab = React3.forwardRef(
|
|
|
824
979
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
|
|
825
980
|
"data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2"
|
|
826
981
|
),
|
|
827
|
-
children: hiddenItems.map((item) => /* @__PURE__ */ (0,
|
|
982
|
+
children: hiddenItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
828
983
|
DropdownMenuPrimitive.Item,
|
|
829
984
|
{
|
|
830
985
|
className: cn(
|
|
@@ -837,7 +992,7 @@ var BrowserTab = React3.forwardRef(
|
|
|
837
992
|
}
|
|
838
993
|
},
|
|
839
994
|
children: [
|
|
840
|
-
item.icon && /* @__PURE__ */ (0,
|
|
995
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
841
996
|
import_icons3.Icon,
|
|
842
997
|
{
|
|
843
998
|
icon: item.icon,
|
|
@@ -847,7 +1002,7 @@ var BrowserTab = React3.forwardRef(
|
|
|
847
1002
|
)
|
|
848
1003
|
}
|
|
849
1004
|
),
|
|
850
|
-
/* @__PURE__ */ (0,
|
|
1005
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
851
1006
|
"span",
|
|
852
1007
|
{
|
|
853
1008
|
className: cn(
|
|
@@ -857,7 +1012,7 @@ var BrowserTab = React3.forwardRef(
|
|
|
857
1012
|
children: item.label
|
|
858
1013
|
}
|
|
859
1014
|
),
|
|
860
|
-
item.badge && /* @__PURE__ */ (0,
|
|
1015
|
+
item.badge && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Badge, { variant: "light", type: "neutral", size: "sm", children: item.badge })
|
|
861
1016
|
]
|
|
862
1017
|
},
|
|
863
1018
|
item.index
|
|
@@ -865,9 +1020,10 @@ var BrowserTab = React3.forwardRef(
|
|
|
865
1020
|
}
|
|
866
1021
|
) })
|
|
867
1022
|
] }),
|
|
868
|
-
onAddTab && hasOverflow && /* @__PURE__ */ (0,
|
|
1023
|
+
onAddTab && hasOverflow && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
869
1024
|
Button,
|
|
870
1025
|
{
|
|
1026
|
+
className: "mb-sm",
|
|
871
1027
|
appearance: "ghost",
|
|
872
1028
|
intent: "brand",
|
|
873
1029
|
size: "sm",
|
|
@@ -885,14 +1041,14 @@ var BrowserTab = React3.forwardRef(
|
|
|
885
1041
|
BrowserTab.displayName = "BrowserTab";
|
|
886
1042
|
|
|
887
1043
|
// src/components/ui/bulk-action.tsx
|
|
888
|
-
var
|
|
1044
|
+
var React6 = __toESM(require("react"));
|
|
889
1045
|
var import_icons5 = require("@l3mpire/icons");
|
|
890
1046
|
|
|
891
1047
|
// src/components/ui/dropdown-menu.tsx
|
|
892
|
-
var
|
|
1048
|
+
var React5 = __toESM(require("react"));
|
|
893
1049
|
var DropdownMenuPrimitive2 = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
894
1050
|
var import_icons4 = require("@l3mpire/icons");
|
|
895
|
-
var
|
|
1051
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
896
1052
|
var textSm = "text-sm font-regular leading-sm";
|
|
897
1053
|
var textXs = "text-xs font-regular leading-xs";
|
|
898
1054
|
var textXsMedium = "text-xs font-medium leading-xs";
|
|
@@ -905,13 +1061,13 @@ var containerStyle = [
|
|
|
905
1061
|
"p-xs",
|
|
906
1062
|
"shadow-lg"
|
|
907
1063
|
];
|
|
908
|
-
var DropdownMenu =
|
|
909
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1064
|
+
var DropdownMenu = React5.forwardRef(
|
|
1065
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref, className: cn(containerStyle, className), ...props, children })
|
|
910
1066
|
);
|
|
911
1067
|
DropdownMenu.displayName = "DropdownMenu";
|
|
912
1068
|
var DropdownMenuRoot = DropdownMenuPrimitive2.Root;
|
|
913
1069
|
var DropdownMenuTrigger = DropdownMenuPrimitive2.Trigger;
|
|
914
|
-
var DropdownMenuContent =
|
|
1070
|
+
var DropdownMenuContent = React5.forwardRef(({ className, sideOffset = 4, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DropdownMenuPrimitive2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
915
1071
|
DropdownMenuPrimitive2.Content,
|
|
916
1072
|
{
|
|
917
1073
|
ref,
|
|
@@ -930,12 +1086,12 @@ var DropdownMenuContent = React4.forwardRef(({ className, sideOffset = 4, childr
|
|
|
930
1086
|
}
|
|
931
1087
|
) }));
|
|
932
1088
|
DropdownMenuContent.displayName = "DropdownMenuContent";
|
|
933
|
-
var DropdownMenuList =
|
|
934
|
-
({ className, children, ...props }, ref) => /* @__PURE__ */ (0,
|
|
1089
|
+
var DropdownMenuList = React5.forwardRef(
|
|
1090
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref, className: cn("flex flex-col", className), role: "listbox", ...props, children })
|
|
935
1091
|
);
|
|
936
1092
|
DropdownMenuList.displayName = "DropdownMenuList";
|
|
937
1093
|
var itemStyle = "flex items-center gap-base p-base rounded-base cursor-pointer hover:bg-dropdown-item-hover";
|
|
938
|
-
var DropdownMenuItem =
|
|
1094
|
+
var DropdownMenuItem = React5.forwardRef(
|
|
939
1095
|
({
|
|
940
1096
|
className,
|
|
941
1097
|
icon,
|
|
@@ -950,7 +1106,7 @@ var DropdownMenuItem = React4.forwardRef(
|
|
|
950
1106
|
onClick,
|
|
951
1107
|
...props
|
|
952
1108
|
}, ref) => {
|
|
953
|
-
const handleClick =
|
|
1109
|
+
const handleClick = React5.useCallback(
|
|
954
1110
|
(e) => {
|
|
955
1111
|
const target = e.target;
|
|
956
1112
|
if (!target.closest("button[role='checkbox']")) {
|
|
@@ -963,7 +1119,7 @@ var DropdownMenuItem = React4.forwardRef(
|
|
|
963
1119
|
},
|
|
964
1120
|
[onClick]
|
|
965
1121
|
);
|
|
966
|
-
return /* @__PURE__ */ (0,
|
|
1122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
967
1123
|
"div",
|
|
968
1124
|
{
|
|
969
1125
|
ref,
|
|
@@ -980,7 +1136,7 @@ var DropdownMenuItem = React4.forwardRef(
|
|
|
980
1136
|
children,
|
|
981
1137
|
avatar,
|
|
982
1138
|
flag,
|
|
983
|
-
icon && /* @__PURE__ */ (0,
|
|
1139
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
984
1140
|
import_icons4.Icon,
|
|
985
1141
|
{
|
|
986
1142
|
icon,
|
|
@@ -988,9 +1144,9 @@ var DropdownMenuItem = React4.forwardRef(
|
|
|
988
1144
|
className: "shrink-0 text-dropdown-item-icon"
|
|
989
1145
|
}
|
|
990
1146
|
),
|
|
991
|
-
/* @__PURE__ */ (0,
|
|
992
|
-
/* @__PURE__ */ (0,
|
|
993
|
-
description && /* @__PURE__ */ (0,
|
|
1147
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-1 items-center gap-sm min-w-0", children: [
|
|
1148
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: cn("truncate shrink-0", textSm, "text-dropdown-item-text"), children: label }),
|
|
1149
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: cn("truncate", textXs, "text-dropdown-item-secondary"), children: description })
|
|
994
1150
|
] }),
|
|
995
1151
|
badge,
|
|
996
1152
|
action
|
|
@@ -1000,7 +1156,7 @@ var DropdownMenuItem = React4.forwardRef(
|
|
|
1000
1156
|
}
|
|
1001
1157
|
);
|
|
1002
1158
|
DropdownMenuItem.displayName = "DropdownMenuItem";
|
|
1003
|
-
var DropdownMenuRadixItem =
|
|
1159
|
+
var DropdownMenuRadixItem = React5.forwardRef(
|
|
1004
1160
|
({
|
|
1005
1161
|
className,
|
|
1006
1162
|
icon,
|
|
@@ -1012,7 +1168,7 @@ var DropdownMenuRadixItem = React4.forwardRef(
|
|
|
1012
1168
|
action,
|
|
1013
1169
|
children,
|
|
1014
1170
|
...props
|
|
1015
|
-
}, ref) => /* @__PURE__ */ (0,
|
|
1171
|
+
}, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1016
1172
|
DropdownMenuPrimitive2.Item,
|
|
1017
1173
|
{
|
|
1018
1174
|
ref,
|
|
@@ -1026,7 +1182,7 @@ var DropdownMenuRadixItem = React4.forwardRef(
|
|
|
1026
1182
|
children,
|
|
1027
1183
|
avatar,
|
|
1028
1184
|
flag,
|
|
1029
|
-
icon && /* @__PURE__ */ (0,
|
|
1185
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1030
1186
|
import_icons4.Icon,
|
|
1031
1187
|
{
|
|
1032
1188
|
icon,
|
|
@@ -1034,9 +1190,9 @@ var DropdownMenuRadixItem = React4.forwardRef(
|
|
|
1034
1190
|
className: "shrink-0 text-dropdown-item-icon"
|
|
1035
1191
|
}
|
|
1036
1192
|
),
|
|
1037
|
-
/* @__PURE__ */ (0,
|
|
1038
|
-
/* @__PURE__ */ (0,
|
|
1039
|
-
description && /* @__PURE__ */ (0,
|
|
1193
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-1 items-center gap-sm min-w-0", children: [
|
|
1194
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: cn("truncate shrink-0", textSm, "text-dropdown-item-text"), children: label }),
|
|
1195
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: cn("truncate", textXs, "text-dropdown-item-secondary"), children: description })
|
|
1040
1196
|
] }),
|
|
1041
1197
|
badge,
|
|
1042
1198
|
action
|
|
@@ -1045,7 +1201,7 @@ var DropdownMenuRadixItem = React4.forwardRef(
|
|
|
1045
1201
|
)
|
|
1046
1202
|
);
|
|
1047
1203
|
DropdownMenuRadixItem.displayName = "DropdownMenuRadixItem";
|
|
1048
|
-
var DropdownMenuHeading =
|
|
1204
|
+
var DropdownMenuHeading = React5.forwardRef(({ className, action, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1049
1205
|
"div",
|
|
1050
1206
|
{
|
|
1051
1207
|
ref,
|
|
@@ -1055,7 +1211,7 @@ var DropdownMenuHeading = React4.forwardRef(({ className, action, children, ...p
|
|
|
1055
1211
|
),
|
|
1056
1212
|
...props,
|
|
1057
1213
|
children: [
|
|
1058
|
-
/* @__PURE__ */ (0,
|
|
1214
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: cn("flex-1 truncate uppercase", textXsMedium, "text-dropdown-heading-text"), children }),
|
|
1059
1215
|
action
|
|
1060
1216
|
]
|
|
1061
1217
|
}
|
|
@@ -1070,7 +1226,7 @@ var clearStyle = [
|
|
|
1070
1226
|
"shadow-sm",
|
|
1071
1227
|
"cursor-pointer"
|
|
1072
1228
|
];
|
|
1073
|
-
var DropdownMenuClear =
|
|
1229
|
+
var DropdownMenuClear = React5.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1074
1230
|
"button",
|
|
1075
1231
|
{
|
|
1076
1232
|
ref,
|
|
@@ -1083,10 +1239,10 @@ var DropdownMenuClear = React4.forwardRef(({ className, children, ...props }, re
|
|
|
1083
1239
|
DropdownMenuClear.displayName = "DropdownMenuClear";
|
|
1084
1240
|
|
|
1085
1241
|
// src/components/ui/bulk-action.tsx
|
|
1086
|
-
var
|
|
1242
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1087
1243
|
var GAP_PX = 8;
|
|
1088
1244
|
var MORE_BTN_FALLBACK = 36;
|
|
1089
|
-
var BulkAction =
|
|
1245
|
+
var BulkAction = React6.forwardRef(
|
|
1090
1246
|
({
|
|
1091
1247
|
count,
|
|
1092
1248
|
onClear,
|
|
@@ -1097,11 +1253,11 @@ var BulkAction = React5.forwardRef(
|
|
|
1097
1253
|
className,
|
|
1098
1254
|
...props
|
|
1099
1255
|
}, ref) => {
|
|
1100
|
-
const slotRef =
|
|
1101
|
-
const measureRef =
|
|
1102
|
-
const moreBtnMeasureRef =
|
|
1103
|
-
const [visibleCount, setVisibleCount] =
|
|
1104
|
-
|
|
1256
|
+
const slotRef = React6.useRef(null);
|
|
1257
|
+
const measureRef = React6.useRef(null);
|
|
1258
|
+
const moreBtnMeasureRef = React6.useRef(null);
|
|
1259
|
+
const [visibleCount, setVisibleCount] = React6.useState(actions.length);
|
|
1260
|
+
React6.useLayoutEffect(() => {
|
|
1105
1261
|
const slot = slotRef.current;
|
|
1106
1262
|
const measure = measureRef.current;
|
|
1107
1263
|
if (!slot || !measure) return;
|
|
@@ -1141,7 +1297,7 @@ var BulkAction = React5.forwardRef(
|
|
|
1141
1297
|
}, [actions]);
|
|
1142
1298
|
const visibleItems = actions.slice(0, visibleCount);
|
|
1143
1299
|
const overflowItems = actions.slice(visibleCount);
|
|
1144
|
-
return /* @__PURE__ */ (0,
|
|
1300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1145
1301
|
"div",
|
|
1146
1302
|
{
|
|
1147
1303
|
ref,
|
|
@@ -1157,20 +1313,20 @@ var BulkAction = React5.forwardRef(
|
|
|
1157
1313
|
),
|
|
1158
1314
|
...props,
|
|
1159
1315
|
children: [
|
|
1160
|
-
/* @__PURE__ */ (0,
|
|
1316
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "text-sm font-regular leading-sm text-bulk-action-count whitespace-nowrap shrink-0", children: [
|
|
1161
1317
|
count,
|
|
1162
1318
|
" ",
|
|
1163
1319
|
countLabel
|
|
1164
1320
|
] }),
|
|
1165
|
-
/* @__PURE__ */ (0,
|
|
1321
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1166
1322
|
"div",
|
|
1167
1323
|
{
|
|
1168
1324
|
ref: slotRef,
|
|
1169
1325
|
className: "relative flex flex-1 items-center gap-base min-w-0 overflow-hidden",
|
|
1170
1326
|
children: [
|
|
1171
|
-
visibleItems.map((item) => /* @__PURE__ */ (0,
|
|
1172
|
-
overflowItems.length > 0 && /* @__PURE__ */ (0,
|
|
1173
|
-
/* @__PURE__ */ (0,
|
|
1327
|
+
visibleItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ActionButton, { item }, item.id)),
|
|
1328
|
+
overflowItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(DropdownMenuRoot, { children: [
|
|
1329
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1174
1330
|
Button,
|
|
1175
1331
|
{
|
|
1176
1332
|
type: "button",
|
|
@@ -1182,7 +1338,7 @@ var BulkAction = React5.forwardRef(
|
|
|
1182
1338
|
"aria-label": "More actions"
|
|
1183
1339
|
}
|
|
1184
1340
|
) }),
|
|
1185
|
-
/* @__PURE__ */ (0,
|
|
1341
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DropdownMenuContent, { align: "end", side: "top", sideOffset: 8, children: overflowItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1186
1342
|
DropdownMenuItem,
|
|
1187
1343
|
{
|
|
1188
1344
|
icon: item.icon,
|
|
@@ -1192,29 +1348,29 @@ var BulkAction = React5.forwardRef(
|
|
|
1192
1348
|
item.id
|
|
1193
1349
|
)) })
|
|
1194
1350
|
] }),
|
|
1195
|
-
/* @__PURE__ */ (0,
|
|
1351
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1196
1352
|
"div",
|
|
1197
1353
|
{
|
|
1198
1354
|
ref: measureRef,
|
|
1199
1355
|
"aria-hidden": true,
|
|
1200
1356
|
className: "pointer-events-none absolute inset-0 flex items-center gap-base opacity-0 invisible",
|
|
1201
|
-
children: actions.map((item) => /* @__PURE__ */ (0,
|
|
1357
|
+
children: actions.map((item) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ActionButton, { item, tabIndex: -1 }, `measure-${item.id}`))
|
|
1202
1358
|
}
|
|
1203
1359
|
),
|
|
1204
|
-
/* @__PURE__ */ (0,
|
|
1360
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1205
1361
|
"button",
|
|
1206
1362
|
{
|
|
1207
1363
|
ref: moreBtnMeasureRef,
|
|
1208
1364
|
"aria-hidden": true,
|
|
1209
1365
|
tabIndex: -1,
|
|
1210
1366
|
className: "pointer-events-none absolute opacity-0 invisible h-8 w-8 min-w-8",
|
|
1211
|
-
children: /* @__PURE__ */ (0,
|
|
1367
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons5.Icon, { icon: import_icons5.faEllipsisOutline, size: "sm" })
|
|
1212
1368
|
}
|
|
1213
1369
|
)
|
|
1214
1370
|
]
|
|
1215
1371
|
}
|
|
1216
1372
|
),
|
|
1217
|
-
/* @__PURE__ */ (0,
|
|
1373
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1218
1374
|
Button,
|
|
1219
1375
|
{
|
|
1220
1376
|
type: "button",
|
|
@@ -1234,7 +1390,7 @@ var BulkAction = React5.forwardRef(
|
|
|
1234
1390
|
}
|
|
1235
1391
|
);
|
|
1236
1392
|
BulkAction.displayName = "BulkAction";
|
|
1237
|
-
var ActionButton = ({ item, tabIndex }) => /* @__PURE__ */ (0,
|
|
1393
|
+
var ActionButton = ({ item, tabIndex }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1238
1394
|
Button,
|
|
1239
1395
|
{
|
|
1240
1396
|
type: "button",
|
|
@@ -1250,67 +1406,6 @@ var ActionButton = ({ item, tabIndex }) => /* @__PURE__ */ (0, import_jsx_runtim
|
|
|
1250
1406
|
}
|
|
1251
1407
|
);
|
|
1252
1408
|
|
|
1253
|
-
// src/components/ui/tooltip.tsx
|
|
1254
|
-
var React6 = __toESM(require("react"));
|
|
1255
|
-
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"));
|
|
1256
|
-
var import_class_variance_authority3 = require("class-variance-authority");
|
|
1257
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1258
|
-
var tooltipContentVariants = (0, import_class_variance_authority3.cva)(
|
|
1259
|
-
[
|
|
1260
|
-
"inline-flex items-center z-50",
|
|
1261
|
-
"gap-xs",
|
|
1262
|
-
"px-base py-sm",
|
|
1263
|
-
"rounded-lg",
|
|
1264
|
-
"shadow-lg",
|
|
1265
|
-
"text-sm",
|
|
1266
|
-
"font-regular",
|
|
1267
|
-
"leading-sm",
|
|
1268
|
-
"data-[state=delayed-open]:animate-[tooltip-in_150ms_ease-out]",
|
|
1269
|
-
"data-[state=instant-open]:animate-[tooltip-in_0ms]",
|
|
1270
|
-
"data-[state=closed]:animate-[tooltip-out_100ms_ease-in]"
|
|
1271
|
-
],
|
|
1272
|
-
{
|
|
1273
|
-
variants: {
|
|
1274
|
-
type: {
|
|
1275
|
-
default: [
|
|
1276
|
-
"bg-tooltip-default-bg",
|
|
1277
|
-
"text-tooltip-default-text"
|
|
1278
|
-
],
|
|
1279
|
-
invert: [
|
|
1280
|
-
"bg-tooltip-invert-bg",
|
|
1281
|
-
"text-tooltip-invert-text",
|
|
1282
|
-
"border border-tooltip-invert-border"
|
|
1283
|
-
]
|
|
1284
|
-
}
|
|
1285
|
-
},
|
|
1286
|
-
defaultVariants: {
|
|
1287
|
-
type: "default"
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
);
|
|
1291
|
-
var TooltipProvider = TooltipPrimitive.Provider;
|
|
1292
|
-
var Tooltip = TooltipPrimitive.Root;
|
|
1293
|
-
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
1294
|
-
var TooltipContent = React6.forwardRef(({ className, type, hasArrow = true, sideOffset = 4, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(TooltipPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
1295
|
-
TooltipPrimitive.Content,
|
|
1296
|
-
{
|
|
1297
|
-
ref,
|
|
1298
|
-
sideOffset,
|
|
1299
|
-
className: cn(tooltipContentVariants({ type, className })),
|
|
1300
|
-
...props,
|
|
1301
|
-
children: [
|
|
1302
|
-
children,
|
|
1303
|
-
hasArrow && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1304
|
-
TooltipPrimitive.Arrow,
|
|
1305
|
-
{
|
|
1306
|
-
className: type === "default" ? "fill-tooltip-default-bg" : "fill-tooltip-invert-bg"
|
|
1307
|
-
}
|
|
1308
|
-
)
|
|
1309
|
-
]
|
|
1310
|
-
}
|
|
1311
|
-
) }));
|
|
1312
|
-
TooltipContent.displayName = "TooltipContent";
|
|
1313
|
-
|
|
1314
1409
|
// src/components/ui/truncated-text.tsx
|
|
1315
1410
|
var React7 = __toESM(require("react"));
|
|
1316
1411
|
var TooltipPrimitive2 = __toESM(require("@radix-ui/react-tooltip"));
|
|
@@ -3336,6 +3431,20 @@ var tagVariants = (0, import_class_variance_authority12.cva)(
|
|
|
3336
3431
|
"text-tag-neutral-text"
|
|
3337
3432
|
]
|
|
3338
3433
|
},
|
|
3434
|
+
// Categorical tones — soft style with a subtle border.
|
|
3435
|
+
// When `tone` is set it overrides `variant` (handled in the component).
|
|
3436
|
+
tone: {
|
|
3437
|
+
indigo: "bg-tag-indigo-bg text-tag-indigo-text border border-tag-indigo-border",
|
|
3438
|
+
rose: "bg-tag-rose-bg text-tag-rose-text border border-tag-rose-border",
|
|
3439
|
+
lime: "bg-tag-lime-bg text-tag-lime-text border border-tag-lime-border",
|
|
3440
|
+
violet: "bg-tag-violet-bg text-tag-violet-text border border-tag-violet-border",
|
|
3441
|
+
cyan: "bg-tag-cyan-bg text-tag-cyan-text border border-tag-cyan-border",
|
|
3442
|
+
orange: "bg-tag-orange-bg text-tag-orange-text border border-tag-orange-border",
|
|
3443
|
+
emerald: "bg-tag-emerald-bg text-tag-emerald-text border border-tag-emerald-border",
|
|
3444
|
+
fuchsia: "bg-tag-fuchsia-bg text-tag-fuchsia-text border border-tag-fuchsia-border",
|
|
3445
|
+
amber: "bg-tag-amber-bg text-tag-amber-text border border-tag-amber-border",
|
|
3446
|
+
slate: "bg-tag-slate-bg text-tag-slate-text border border-tag-slate-border"
|
|
3447
|
+
},
|
|
3339
3448
|
size: {
|
|
3340
3449
|
sm: [
|
|
3341
3450
|
"p-xs",
|
|
@@ -3349,21 +3458,29 @@ var tagVariants = (0, import_class_variance_authority12.cva)(
|
|
|
3349
3458
|
]
|
|
3350
3459
|
}
|
|
3351
3460
|
},
|
|
3461
|
+
// variant default is applied in the component so `tone` can suppress it.
|
|
3352
3462
|
defaultVariants: {
|
|
3353
|
-
variant: "brand",
|
|
3354
3463
|
size: "sm"
|
|
3355
3464
|
}
|
|
3356
3465
|
}
|
|
3357
3466
|
);
|
|
3358
3467
|
var iconSizeMap3 = { sm: "xs", md: "sm" };
|
|
3359
3468
|
var Tag = React26.forwardRef(
|
|
3360
|
-
({ className, variant, size, icon, onClose, children, ...props }, ref) => {
|
|
3469
|
+
({ className, variant, tone, size, icon, onClose, children, ...props }, ref) => {
|
|
3361
3470
|
const iconSize = iconSizeMap3[size ?? "sm"];
|
|
3362
3471
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
3363
3472
|
"span",
|
|
3364
3473
|
{
|
|
3365
3474
|
ref,
|
|
3366
|
-
className: cn(
|
|
3475
|
+
className: cn(
|
|
3476
|
+
tagVariants({
|
|
3477
|
+
// A categorical tone is self-contained and overrides variant.
|
|
3478
|
+
variant: tone != null ? void 0 : variant ?? "brand",
|
|
3479
|
+
tone,
|
|
3480
|
+
size
|
|
3481
|
+
}),
|
|
3482
|
+
className
|
|
3483
|
+
),
|
|
3367
3484
|
...props,
|
|
3368
3485
|
children: [
|
|
3369
3486
|
icon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_icons18.Icon, { icon, size: iconSize, className: "shrink-0" }),
|
|
@@ -6463,10 +6580,11 @@ var SaveViewButton = React46.forwardRef(
|
|
|
6463
6580
|
const sharedStyle = [
|
|
6464
6581
|
"relative flex items-center justify-center",
|
|
6465
6582
|
"min-h-[32px] max-h-[32px]",
|
|
6466
|
-
"bg-gradient-to-t from-btn-
|
|
6467
|
-
"border border-btn-
|
|
6583
|
+
"bg-gradient-to-t from-btn-outlined-neutral-bg-default from-[10%] to-btn-outlined-neutral-bg-gradient-to-default",
|
|
6584
|
+
"border border-btn-outlined-neutral-border-default",
|
|
6468
6585
|
"shadow-sm cursor-pointer transition-colors",
|
|
6469
|
-
"hover:from-btn-
|
|
6586
|
+
"hover:from-btn-outlined-neutral-bg-hover hover:from-[0%] hover:to-btn-outlined-neutral-bg-gradient-to-hover",
|
|
6587
|
+
"hover:border-btn-outlined-neutral-border-hover"
|
|
6470
6588
|
];
|
|
6471
6589
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
|
|
6472
6590
|
"div",
|
|
@@ -6475,7 +6593,7 @@ var SaveViewButton = React46.forwardRef(
|
|
|
6475
6593
|
className: cn("flex items-center", className),
|
|
6476
6594
|
...props,
|
|
6477
6595
|
children: [
|
|
6478
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.
|
|
6596
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6479
6597
|
"button",
|
|
6480
6598
|
{
|
|
6481
6599
|
type: "button",
|
|
@@ -6485,33 +6603,28 @@ var SaveViewButton = React46.forwardRef(
|
|
|
6485
6603
|
"gap-sm px-base py-sm min-w-[80px]",
|
|
6486
6604
|
"rounded-l-md -mr-px"
|
|
6487
6605
|
),
|
|
6488
|
-
children:
|
|
6489
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-btn-solid-brand-text-default", children: label }),
|
|
6490
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "absolute inset-0 rounded-l-[9px] border border-btn-solid-brand-inner-border-default shadow-sm pointer-events-none" })
|
|
6491
|
-
]
|
|
6606
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "text-sm font-medium leading-sm whitespace-nowrap text-btn-outlined-neutral-text-default", children: label })
|
|
6492
6607
|
}
|
|
6493
6608
|
),
|
|
6494
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.
|
|
6609
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6495
6610
|
"button",
|
|
6496
6611
|
{
|
|
6497
6612
|
type: "button",
|
|
6498
6613
|
onClick: onDropdown,
|
|
6614
|
+
"aria-label": "More save options",
|
|
6499
6615
|
className: cn(
|
|
6500
6616
|
sharedStyle,
|
|
6501
6617
|
"p-sm",
|
|
6502
6618
|
"rounded-r-md -ml-px"
|
|
6503
6619
|
),
|
|
6504
|
-
children:
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
),
|
|
6513
|
-
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "absolute inset-0 rounded-r-[9px] border border-btn-solid-brand-inner-border-default shadow-sm pointer-events-none" })
|
|
6514
|
-
]
|
|
6620
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
6621
|
+
import_icons30.Icon,
|
|
6622
|
+
{
|
|
6623
|
+
icon: import_icons30.faChevronDownOutline,
|
|
6624
|
+
size: "sm",
|
|
6625
|
+
className: "text-btn-outlined-neutral-text-default"
|
|
6626
|
+
}
|
|
6627
|
+
)
|
|
6515
6628
|
}
|
|
6516
6629
|
)
|
|
6517
6630
|
]
|