@ship-it-ui/ui 0.0.6 → 0.0.7
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.cjs +954 -765
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -1
- package/dist/index.d.ts +50 -1
- package/dist/index.js +962 -767
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -537,11 +537,205 @@ function Field({ label, hint, error, required, className, children, ...props })
|
|
|
537
537
|
] });
|
|
538
538
|
}
|
|
539
539
|
|
|
540
|
-
// src/components/
|
|
540
|
+
// src/components/InlineEdit/InlineEdit.tsx
|
|
541
541
|
import { cva as cva3 } from "class-variance-authority";
|
|
542
|
-
import {
|
|
542
|
+
import {
|
|
543
|
+
forwardRef as forwardRef7,
|
|
544
|
+
useCallback as useCallback5,
|
|
545
|
+
useEffect as useEffect5,
|
|
546
|
+
useImperativeHandle,
|
|
547
|
+
useRef as useRef3,
|
|
548
|
+
useState as useState5
|
|
549
|
+
} from "react";
|
|
543
550
|
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
544
|
-
var
|
|
551
|
+
var displayStyles = cva3(
|
|
552
|
+
[
|
|
553
|
+
"inline-block cursor-text rounded-[3px] px-[2px] -mx-[2px]",
|
|
554
|
+
"outline-none transition-[background,box-shadow] duration-(--duration-micro)",
|
|
555
|
+
"hover:bg-panel-2",
|
|
556
|
+
"focus-visible:ring-[2px] focus-visible:ring-accent-dim"
|
|
557
|
+
],
|
|
558
|
+
{
|
|
559
|
+
variants: {
|
|
560
|
+
size: {
|
|
561
|
+
sm: "text-[12px]",
|
|
562
|
+
md: "text-[13px]",
|
|
563
|
+
lg: "text-[14px]"
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
defaultVariants: { size: "md" }
|
|
567
|
+
}
|
|
568
|
+
);
|
|
569
|
+
var inputStyles = cva3(
|
|
570
|
+
[
|
|
571
|
+
"border bg-panel text-text font-sans outline-none",
|
|
572
|
+
"transition-[border-color,box-shadow] duration-(--duration-micro)",
|
|
573
|
+
"focus:ring-[3px] focus:ring-accent-dim focus:border-accent",
|
|
574
|
+
"placeholder:text-text-dim"
|
|
575
|
+
],
|
|
576
|
+
{
|
|
577
|
+
variants: {
|
|
578
|
+
size: {
|
|
579
|
+
sm: "h-6 px-2 text-[12px] rounded-md",
|
|
580
|
+
md: "h-[28px] px-[8px] text-[13px] rounded-md",
|
|
581
|
+
lg: "h-8 px-[10px] text-[14px] rounded-md"
|
|
582
|
+
},
|
|
583
|
+
tone: {
|
|
584
|
+
default: "border-border",
|
|
585
|
+
err: "border-err focus:border-err focus:ring-err/30"
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
defaultVariants: { size: "md", tone: "default" }
|
|
589
|
+
}
|
|
590
|
+
);
|
|
591
|
+
var InlineEdit = forwardRef7(function InlineEdit2({
|
|
592
|
+
value,
|
|
593
|
+
onValueChange,
|
|
594
|
+
as = "span",
|
|
595
|
+
activate = "dblclick",
|
|
596
|
+
commitOnBlur = true,
|
|
597
|
+
validate,
|
|
598
|
+
placeholder = "Empty",
|
|
599
|
+
disabled = false,
|
|
600
|
+
editing: editingProp,
|
|
601
|
+
onEditingChange,
|
|
602
|
+
size,
|
|
603
|
+
className,
|
|
604
|
+
inputClassName,
|
|
605
|
+
"aria-label": ariaLabel,
|
|
606
|
+
...rest
|
|
607
|
+
}, forwardedRef) {
|
|
608
|
+
const [editing, setEditing] = useControllableState({
|
|
609
|
+
value: editingProp,
|
|
610
|
+
defaultValue: false,
|
|
611
|
+
onChange: onEditingChange
|
|
612
|
+
});
|
|
613
|
+
const [draft, setDraft] = useState5(value);
|
|
614
|
+
const [error, setError] = useState5(null);
|
|
615
|
+
const inputRef = useRef3(null);
|
|
616
|
+
useEffect5(() => {
|
|
617
|
+
if (!editing) {
|
|
618
|
+
setDraft(value);
|
|
619
|
+
setError(null);
|
|
620
|
+
}
|
|
621
|
+
}, [editing, value]);
|
|
622
|
+
useEffect5(() => {
|
|
623
|
+
if (!editing) return;
|
|
624
|
+
const el = inputRef.current;
|
|
625
|
+
if (!el) return;
|
|
626
|
+
el.focus();
|
|
627
|
+
el.select();
|
|
628
|
+
}, [editing]);
|
|
629
|
+
const commit = useCallback5(() => {
|
|
630
|
+
const next = draft;
|
|
631
|
+
if (validate) {
|
|
632
|
+
const msg = validate(next);
|
|
633
|
+
if (msg !== null) {
|
|
634
|
+
setError(msg);
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
setError(null);
|
|
639
|
+
setEditing(false);
|
|
640
|
+
if (next !== value) onValueChange(next);
|
|
641
|
+
}, [draft, validate, value, onValueChange, setEditing]);
|
|
642
|
+
const cancel = useCallback5(() => {
|
|
643
|
+
setDraft(value);
|
|
644
|
+
setError(null);
|
|
645
|
+
setEditing(false);
|
|
646
|
+
}, [value, setEditing]);
|
|
647
|
+
const beginEdit = useCallback5(() => {
|
|
648
|
+
if (disabled) return;
|
|
649
|
+
setDraft(value);
|
|
650
|
+
setError(null);
|
|
651
|
+
setEditing(true);
|
|
652
|
+
}, [disabled, value, setEditing]);
|
|
653
|
+
useImperativeHandle(forwardedRef, () => ({ edit: beginEdit, cancel }), [beginEdit, cancel]);
|
|
654
|
+
const onDisplayKeyDown = (e) => {
|
|
655
|
+
if (disabled) return;
|
|
656
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
657
|
+
e.preventDefault();
|
|
658
|
+
beginEdit();
|
|
659
|
+
}
|
|
660
|
+
};
|
|
661
|
+
const onDisplayActivate = (e) => {
|
|
662
|
+
if (disabled) return;
|
|
663
|
+
if (activate === "dblclick" && e.detail >= 2 || activate === "click" && e.detail >= 1) {
|
|
664
|
+
e.preventDefault();
|
|
665
|
+
beginEdit();
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
const onInputKeyDown = (e) => {
|
|
669
|
+
if (e.key === "Enter") {
|
|
670
|
+
e.preventDefault();
|
|
671
|
+
commit();
|
|
672
|
+
} else if (e.key === "Escape") {
|
|
673
|
+
e.preventDefault();
|
|
674
|
+
cancel();
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
if (editing) {
|
|
678
|
+
const errorId = `${rest.id ?? "inline-edit"}-error`;
|
|
679
|
+
const inputAriaLabel = ariaLabel ?? value ?? placeholder;
|
|
680
|
+
return /* @__PURE__ */ jsxs5("span", { className: "inline-flex flex-col items-stretch gap-1", children: [
|
|
681
|
+
/* @__PURE__ */ jsx8(
|
|
682
|
+
"input",
|
|
683
|
+
{
|
|
684
|
+
ref: inputRef,
|
|
685
|
+
type: "text",
|
|
686
|
+
value: draft,
|
|
687
|
+
onChange: (e) => {
|
|
688
|
+
setDraft(e.target.value);
|
|
689
|
+
if (error) setError(null);
|
|
690
|
+
},
|
|
691
|
+
onKeyDown: onInputKeyDown,
|
|
692
|
+
onBlur: () => {
|
|
693
|
+
if (commitOnBlur) commit();
|
|
694
|
+
else cancel();
|
|
695
|
+
},
|
|
696
|
+
placeholder,
|
|
697
|
+
"aria-label": inputAriaLabel,
|
|
698
|
+
"aria-invalid": error ? true : void 0,
|
|
699
|
+
"aria-errormessage": error ? errorId : void 0,
|
|
700
|
+
className: cn(inputStyles({ size, tone: error ? "err" : "default" }), inputClassName)
|
|
701
|
+
}
|
|
702
|
+
),
|
|
703
|
+
error && /* @__PURE__ */ jsx8("span", { id: errorId, role: "alert", className: "text-err text-[11px]", children: error })
|
|
704
|
+
] });
|
|
705
|
+
}
|
|
706
|
+
const Tag3 = as;
|
|
707
|
+
const isHeading = as === "h1" || as === "h2" || as === "h3";
|
|
708
|
+
const isEmpty = value.length === 0;
|
|
709
|
+
const displayText = isEmpty ? placeholder : value;
|
|
710
|
+
return /* @__PURE__ */ jsx8(
|
|
711
|
+
Tag3,
|
|
712
|
+
{
|
|
713
|
+
role: isHeading ? void 0 : "button",
|
|
714
|
+
"aria-roledescription": isHeading ? "editable" : void 0,
|
|
715
|
+
tabIndex: disabled ? -1 : 0,
|
|
716
|
+
"aria-disabled": disabled || void 0,
|
|
717
|
+
"aria-label": ariaLabel ?? `Edit ${value || placeholder}`,
|
|
718
|
+
"data-empty": isEmpty || void 0,
|
|
719
|
+
onClick: onDisplayActivate,
|
|
720
|
+
onKeyDown: onDisplayKeyDown,
|
|
721
|
+
className: cn(
|
|
722
|
+
displayStyles({ size }),
|
|
723
|
+
isEmpty && "text-text-dim italic",
|
|
724
|
+
disabled && "cursor-not-allowed opacity-50 hover:bg-transparent",
|
|
725
|
+
className
|
|
726
|
+
),
|
|
727
|
+
...rest,
|
|
728
|
+
children: displayText
|
|
729
|
+
}
|
|
730
|
+
);
|
|
731
|
+
});
|
|
732
|
+
InlineEdit.displayName = "InlineEdit";
|
|
733
|
+
|
|
734
|
+
// src/components/Input/Input.tsx
|
|
735
|
+
import { cva as cva4 } from "class-variance-authority";
|
|
736
|
+
import { forwardRef as forwardRef8 } from "react";
|
|
737
|
+
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
738
|
+
var inputWrapperStyles = cva4(
|
|
545
739
|
[
|
|
546
740
|
"flex items-center gap-[6px] font-sans transition-[border-color,box-shadow] duration-(--duration-micro)",
|
|
547
741
|
"border focus-within:ring-[3px]",
|
|
@@ -573,16 +767,16 @@ var inputWrapperStyles = cva3(
|
|
|
573
767
|
defaultVariants: { size: "md", tone: "default", density: "comfortable" }
|
|
574
768
|
}
|
|
575
769
|
);
|
|
576
|
-
var Input =
|
|
770
|
+
var Input = forwardRef8(function Input2({ size, tone, density, icon, trailing, error, width, className, style, disabled, ...props }, ref) {
|
|
577
771
|
const computedTone = error ? "err" : tone;
|
|
578
|
-
return /* @__PURE__ */
|
|
772
|
+
return /* @__PURE__ */ jsxs6(
|
|
579
773
|
"div",
|
|
580
774
|
{
|
|
581
775
|
className: cn(inputWrapperStyles({ size, tone: computedTone, density }), className),
|
|
582
776
|
style: { width, ...style },
|
|
583
777
|
children: [
|
|
584
|
-
icon && /* @__PURE__ */
|
|
585
|
-
/* @__PURE__ */
|
|
778
|
+
icon && /* @__PURE__ */ jsx9("span", { className: "text-text-dim leading-none", children: icon }),
|
|
779
|
+
/* @__PURE__ */ jsx9(
|
|
586
780
|
"input",
|
|
587
781
|
{
|
|
588
782
|
ref,
|
|
@@ -596,7 +790,7 @@ var Input = forwardRef7(function Input2({ size, tone, density, icon, trailing, e
|
|
|
596
790
|
...props
|
|
597
791
|
}
|
|
598
792
|
),
|
|
599
|
-
trailing && /* @__PURE__ */
|
|
793
|
+
trailing && /* @__PURE__ */ jsx9("span", { className: "text-text-dim text-[11px]", children: trailing })
|
|
600
794
|
]
|
|
601
795
|
}
|
|
602
796
|
);
|
|
@@ -604,9 +798,9 @@ var Input = forwardRef7(function Input2({ size, tone, density, icon, trailing, e
|
|
|
604
798
|
Input.displayName = "Input";
|
|
605
799
|
|
|
606
800
|
// src/components/Input/SearchInput.tsx
|
|
607
|
-
import { forwardRef as
|
|
608
|
-
import { jsx as
|
|
609
|
-
var SearchInput =
|
|
801
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
802
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
803
|
+
var SearchInput = forwardRef9(function SearchInput2({
|
|
610
804
|
shortcut,
|
|
611
805
|
width,
|
|
612
806
|
density = "comfortable",
|
|
@@ -619,7 +813,7 @@ var SearchInput = forwardRef8(function SearchInput2({
|
|
|
619
813
|
const isTouch = density === "touch";
|
|
620
814
|
const resolvedWidth = width ?? (isTouch ? "100%" : 360);
|
|
621
815
|
const resolvedShortcut = shortcut ?? (isTouch ? void 0 : "\u2318K");
|
|
622
|
-
return /* @__PURE__ */
|
|
816
|
+
return /* @__PURE__ */ jsxs7(
|
|
623
817
|
"div",
|
|
624
818
|
{
|
|
625
819
|
className: cn(
|
|
@@ -632,8 +826,8 @@ var SearchInput = forwardRef8(function SearchInput2({
|
|
|
632
826
|
),
|
|
633
827
|
style: { width: resolvedWidth, ...style },
|
|
634
828
|
children: [
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
/* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ jsx10("span", { className: cn("text-text-dim leading-none", isTouch && "text-[18px]"), "aria-hidden": true, children: "\u2315" }),
|
|
830
|
+
/* @__PURE__ */ jsx10(
|
|
637
831
|
"input",
|
|
638
832
|
{
|
|
639
833
|
ref,
|
|
@@ -647,7 +841,7 @@ var SearchInput = forwardRef8(function SearchInput2({
|
|
|
647
841
|
...props
|
|
648
842
|
}
|
|
649
843
|
),
|
|
650
|
-
resolvedShortcut && /* @__PURE__ */
|
|
844
|
+
resolvedShortcut && /* @__PURE__ */ jsx10("kbd", { className: "text-text-dim border-border rounded-xs border px-[6px] py-[2px] font-mono text-[10px]", children: resolvedShortcut })
|
|
651
845
|
]
|
|
652
846
|
}
|
|
653
847
|
);
|
|
@@ -656,21 +850,21 @@ SearchInput.displayName = "SearchInput";
|
|
|
656
850
|
|
|
657
851
|
// src/components/OTP/OTP.tsx
|
|
658
852
|
import {
|
|
659
|
-
forwardRef as
|
|
853
|
+
forwardRef as forwardRef10,
|
|
660
854
|
useId as useId3,
|
|
661
|
-
useImperativeHandle,
|
|
662
|
-
useRef as
|
|
663
|
-
useState as
|
|
855
|
+
useImperativeHandle as useImperativeHandle2,
|
|
856
|
+
useRef as useRef4,
|
|
857
|
+
useState as useState6
|
|
664
858
|
} from "react";
|
|
665
|
-
import { jsx as
|
|
666
|
-
var OTP =
|
|
859
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
860
|
+
var OTP = forwardRef10(function OTP2({ length = 6, onComplete, onChange, defaultValue = "", ariaLabel = "Code", className, disabled }, ref) {
|
|
667
861
|
const baseId = useId3();
|
|
668
|
-
const refs =
|
|
669
|
-
const [values, setValues] =
|
|
862
|
+
const refs = useRef4([]);
|
|
863
|
+
const [values, setValues] = useState6(
|
|
670
864
|
() => Array.from({ length }, (_, i) => defaultValue[i] ?? "")
|
|
671
865
|
);
|
|
672
|
-
const [completedAnnouncement, setCompletedAnnouncement] =
|
|
673
|
-
|
|
866
|
+
const [completedAnnouncement, setCompletedAnnouncement] = useState6("");
|
|
867
|
+
useImperativeHandle2(ref, () => ({
|
|
674
868
|
focus: () => refs.current[0]?.focus(),
|
|
675
869
|
reset: () => {
|
|
676
870
|
setValues(Array(length).fill(""));
|
|
@@ -720,8 +914,8 @@ var OTP = forwardRef9(function OTP2({ length = 6, onComplete, onChange, defaultV
|
|
|
720
914
|
}
|
|
721
915
|
refs.current[Math.min(pasted.length, length - 1)]?.focus();
|
|
722
916
|
};
|
|
723
|
-
return /* @__PURE__ */
|
|
724
|
-
values.map((c, i) => /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn("flex gap-2", className), children: [
|
|
918
|
+
values.map((c, i) => /* @__PURE__ */ jsx11(
|
|
725
919
|
"input",
|
|
726
920
|
{
|
|
727
921
|
id: `${baseId}-${i}`,
|
|
@@ -747,23 +941,23 @@ var OTP = forwardRef9(function OTP2({ length = 6, onComplete, onChange, defaultV
|
|
|
747
941
|
},
|
|
748
942
|
i
|
|
749
943
|
)),
|
|
750
|
-
/* @__PURE__ */
|
|
944
|
+
/* @__PURE__ */ jsx11("span", { className: "sr-only", "aria-live": "polite", "aria-atomic": "true", children: completedAnnouncement })
|
|
751
945
|
] });
|
|
752
946
|
});
|
|
753
947
|
OTP.displayName = "OTP";
|
|
754
948
|
|
|
755
949
|
// src/components/Radio/Radio.tsx
|
|
756
950
|
import * as RadixRadio from "@radix-ui/react-radio-group";
|
|
757
|
-
import { forwardRef as
|
|
758
|
-
import { jsx as
|
|
759
|
-
var RadioGroup =
|
|
760
|
-
return /* @__PURE__ */
|
|
951
|
+
import { forwardRef as forwardRef11, useId as useId4 } from "react";
|
|
952
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
953
|
+
var RadioGroup = forwardRef11(function RadioGroup2({ className, ...props }, ref) {
|
|
954
|
+
return /* @__PURE__ */ jsx12(RadixRadio.Root, { ref, className: cn("flex flex-col gap-2", className), ...props });
|
|
761
955
|
});
|
|
762
956
|
RadioGroup.displayName = "RadioGroup";
|
|
763
|
-
var Radio =
|
|
957
|
+
var Radio = forwardRef11(function Radio2({ label, className, id: idProp, ...props }, ref) {
|
|
764
958
|
const reactId = useId4();
|
|
765
959
|
const id = idProp ?? `radio-${reactId}`;
|
|
766
|
-
return /* @__PURE__ */
|
|
960
|
+
return /* @__PURE__ */ jsxs9(
|
|
767
961
|
"span",
|
|
768
962
|
{
|
|
769
963
|
className: cn(
|
|
@@ -772,7 +966,7 @@ var Radio = forwardRef10(function Radio2({ label, className, id: idProp, ...prop
|
|
|
772
966
|
className
|
|
773
967
|
),
|
|
774
968
|
children: [
|
|
775
|
-
/* @__PURE__ */
|
|
969
|
+
/* @__PURE__ */ jsx12(
|
|
776
970
|
RadixRadio.Item,
|
|
777
971
|
{
|
|
778
972
|
ref,
|
|
@@ -785,10 +979,10 @@ var Radio = forwardRef10(function Radio2({ label, className, id: idProp, ...prop
|
|
|
785
979
|
"focus-visible:ring-accent-dim outline-none focus-visible:ring-[3px]"
|
|
786
980
|
),
|
|
787
981
|
...props,
|
|
788
|
-
children: /* @__PURE__ */
|
|
982
|
+
children: /* @__PURE__ */ jsx12(RadixRadio.Indicator, { className: "bg-accent block h-[7px] w-[7px] rounded-full" })
|
|
789
983
|
}
|
|
790
984
|
),
|
|
791
|
-
label && /* @__PURE__ */
|
|
985
|
+
label && /* @__PURE__ */ jsx12("label", { htmlFor: id, className: "cursor-pointer text-[13px]", children: label })
|
|
792
986
|
]
|
|
793
987
|
}
|
|
794
988
|
);
|
|
@@ -797,8 +991,8 @@ Radio.displayName = "Radio";
|
|
|
797
991
|
|
|
798
992
|
// src/components/Select/Select.tsx
|
|
799
993
|
import * as RadixSelect from "@radix-ui/react-select";
|
|
800
|
-
import { forwardRef as
|
|
801
|
-
import { jsx as
|
|
994
|
+
import { forwardRef as forwardRef12 } from "react";
|
|
995
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
802
996
|
var SelectRoot = RadixSelect.Root;
|
|
803
997
|
var SelectValue = RadixSelect.Value;
|
|
804
998
|
var SelectGroup = RadixSelect.Group;
|
|
@@ -808,8 +1002,8 @@ var triggerClasses = {
|
|
|
808
1002
|
md: "h-[34px] px-[10px] text-[13px]",
|
|
809
1003
|
lg: "h-10 px-3 text-[14px]"
|
|
810
1004
|
};
|
|
811
|
-
var SelectTrigger =
|
|
812
|
-
return /* @__PURE__ */
|
|
1005
|
+
var SelectTrigger = forwardRef12(function SelectTrigger2({ size = "md", className, children, ...props }, ref) {
|
|
1006
|
+
return /* @__PURE__ */ jsxs10(
|
|
813
1007
|
RadixSelect.Trigger,
|
|
814
1008
|
{
|
|
815
1009
|
ref,
|
|
@@ -825,15 +1019,15 @@ var SelectTrigger = forwardRef11(function SelectTrigger2({ size = "md", classNam
|
|
|
825
1019
|
...props,
|
|
826
1020
|
children: [
|
|
827
1021
|
children,
|
|
828
|
-
/* @__PURE__ */
|
|
1022
|
+
/* @__PURE__ */ jsx13(RadixSelect.Icon, { className: "text-text-dim text-[11px] leading-none", children: "\u25BE" })
|
|
829
1023
|
]
|
|
830
1024
|
}
|
|
831
1025
|
);
|
|
832
1026
|
});
|
|
833
1027
|
SelectTrigger.displayName = "SelectTrigger";
|
|
834
|
-
var SelectContent =
|
|
1028
|
+
var SelectContent = forwardRef12(
|
|
835
1029
|
function SelectContent2({ className, children, position = "popper", sideOffset = 6, ...props }, ref) {
|
|
836
|
-
return /* @__PURE__ */
|
|
1030
|
+
return /* @__PURE__ */ jsx13(RadixSelect.Portal, { children: /* @__PURE__ */ jsx13(
|
|
837
1031
|
RadixSelect.Content,
|
|
838
1032
|
{
|
|
839
1033
|
ref,
|
|
@@ -845,15 +1039,15 @@ var SelectContent = forwardRef11(
|
|
|
845
1039
|
className
|
|
846
1040
|
),
|
|
847
1041
|
...props,
|
|
848
|
-
children: /* @__PURE__ */
|
|
1042
|
+
children: /* @__PURE__ */ jsx13(RadixSelect.Viewport, { children })
|
|
849
1043
|
}
|
|
850
1044
|
) });
|
|
851
1045
|
}
|
|
852
1046
|
);
|
|
853
1047
|
SelectContent.displayName = "SelectContent";
|
|
854
|
-
var SelectItem =
|
|
1048
|
+
var SelectItem = forwardRef12(
|
|
855
1049
|
function SelectItem2({ className, children, ...props }, ref) {
|
|
856
|
-
return /* @__PURE__ */
|
|
1050
|
+
return /* @__PURE__ */ jsx13(
|
|
857
1051
|
RadixSelect.Item,
|
|
858
1052
|
{
|
|
859
1053
|
ref,
|
|
@@ -865,7 +1059,7 @@ var SelectItem = forwardRef11(
|
|
|
865
1059
|
className
|
|
866
1060
|
),
|
|
867
1061
|
...props,
|
|
868
|
-
children: /* @__PURE__ */
|
|
1062
|
+
children: /* @__PURE__ */ jsx13(RadixSelect.ItemText, { children })
|
|
869
1063
|
}
|
|
870
1064
|
);
|
|
871
1065
|
}
|
|
@@ -880,30 +1074,30 @@ function Select({
|
|
|
880
1074
|
"aria-labelledby": ariaLabelledBy,
|
|
881
1075
|
...rootProps
|
|
882
1076
|
}) {
|
|
883
|
-
return /* @__PURE__ */
|
|
884
|
-
/* @__PURE__ */
|
|
1077
|
+
return /* @__PURE__ */ jsxs10(RadixSelect.Root, { ...rootProps, children: [
|
|
1078
|
+
/* @__PURE__ */ jsx13(
|
|
885
1079
|
SelectTrigger,
|
|
886
1080
|
{
|
|
887
1081
|
size,
|
|
888
1082
|
className,
|
|
889
1083
|
"aria-label": ariaLabel,
|
|
890
1084
|
"aria-labelledby": ariaLabelledBy,
|
|
891
|
-
children: /* @__PURE__ */
|
|
1085
|
+
children: /* @__PURE__ */ jsx13(SelectValue, { placeholder })
|
|
892
1086
|
}
|
|
893
1087
|
),
|
|
894
|
-
/* @__PURE__ */
|
|
1088
|
+
/* @__PURE__ */ jsx13(SelectContent, { children: options.map((opt) => {
|
|
895
1089
|
const value = typeof opt === "string" ? opt : opt.value;
|
|
896
1090
|
const label = typeof opt === "string" ? opt : opt.label;
|
|
897
|
-
return /* @__PURE__ */
|
|
1091
|
+
return /* @__PURE__ */ jsx13(SelectItem, { value, children: label }, value);
|
|
898
1092
|
}) })
|
|
899
1093
|
] });
|
|
900
1094
|
}
|
|
901
1095
|
|
|
902
1096
|
// src/components/Slider/Slider.tsx
|
|
903
1097
|
import * as RadixSlider from "@radix-ui/react-slider";
|
|
904
|
-
import { forwardRef as
|
|
905
|
-
import { jsx as
|
|
906
|
-
var Slider =
|
|
1098
|
+
import { forwardRef as forwardRef13, useCallback as useCallback6, useState as useState7 } from "react";
|
|
1099
|
+
import { jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1100
|
+
var Slider = forwardRef13(function Slider2({
|
|
907
1101
|
showValue,
|
|
908
1102
|
width = 240,
|
|
909
1103
|
className,
|
|
@@ -918,10 +1112,10 @@ var Slider = forwardRef12(function Slider2({
|
|
|
918
1112
|
const arrValue = Array.isArray(value) ? value : value !== void 0 ? [value] : void 0;
|
|
919
1113
|
const arrDefault = Array.isArray(defaultValue) ? defaultValue : defaultValue !== void 0 ? [defaultValue] : void 0;
|
|
920
1114
|
const isControlled = arrValue !== void 0;
|
|
921
|
-
const [uncontrolledValue, setUncontrolledValue] =
|
|
1115
|
+
const [uncontrolledValue, setUncontrolledValue] = useState7(arrDefault);
|
|
922
1116
|
const currentValue = isControlled ? arrValue : uncontrolledValue;
|
|
923
1117
|
const wasScalar = !Array.isArray(value ?? defaultValue) && (value ?? defaultValue) !== void 0;
|
|
924
|
-
const handleValueChange =
|
|
1118
|
+
const handleValueChange = useCallback6(
|
|
925
1119
|
(next) => {
|
|
926
1120
|
if (!isControlled) setUncontrolledValue(next);
|
|
927
1121
|
if (onValueChange) {
|
|
@@ -932,14 +1126,14 @@ var Slider = forwardRef12(function Slider2({
|
|
|
932
1126
|
);
|
|
933
1127
|
const display = currentValue?.[0] ?? props.min ?? 0;
|
|
934
1128
|
const thumbCount = (arrValue ?? arrDefault)?.length ?? 1;
|
|
935
|
-
return /* @__PURE__ */
|
|
1129
|
+
return /* @__PURE__ */ jsxs11(
|
|
936
1130
|
"span",
|
|
937
1131
|
{
|
|
938
1132
|
ref,
|
|
939
1133
|
className: cn("inline-flex items-center gap-[10px]", className),
|
|
940
1134
|
style: { width },
|
|
941
1135
|
children: [
|
|
942
|
-
/* @__PURE__ */
|
|
1136
|
+
/* @__PURE__ */ jsxs11(
|
|
943
1137
|
RadixSlider.Root,
|
|
944
1138
|
{
|
|
945
1139
|
value: arrValue,
|
|
@@ -948,11 +1142,11 @@ var Slider = forwardRef12(function Slider2({
|
|
|
948
1142
|
className: "relative flex h-4 flex-1 touch-none items-center select-none",
|
|
949
1143
|
...props,
|
|
950
1144
|
children: [
|
|
951
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ jsx14(RadixSlider.Track, { className: "bg-panel-2 relative h-1 grow rounded-full", children: /* @__PURE__ */ jsx14(RadixSlider.Range, { className: "bg-accent absolute h-full rounded-full" }) }),
|
|
952
1146
|
Array.from({ length: thumbCount }, (_, i) => {
|
|
953
1147
|
const perThumb = thumbLabels?.[i];
|
|
954
1148
|
const thumbAriaLabel = perThumb ?? (ariaLabelledBy ? void 0 : ariaLabel ?? "Value");
|
|
955
|
-
return /* @__PURE__ */
|
|
1149
|
+
return /* @__PURE__ */ jsx14(
|
|
956
1150
|
RadixSlider.Thumb,
|
|
957
1151
|
{
|
|
958
1152
|
className: cn(
|
|
@@ -969,7 +1163,7 @@ var Slider = forwardRef12(function Slider2({
|
|
|
969
1163
|
]
|
|
970
1164
|
}
|
|
971
1165
|
),
|
|
972
|
-
showValue && /* @__PURE__ */
|
|
1166
|
+
showValue && /* @__PURE__ */ jsx14("span", { className: "text-text-muted min-w-[28px] text-right font-mono text-[11px]", children: display })
|
|
973
1167
|
]
|
|
974
1168
|
}
|
|
975
1169
|
);
|
|
@@ -978,8 +1172,8 @@ Slider.displayName = "Slider";
|
|
|
978
1172
|
|
|
979
1173
|
// src/components/Switch/Switch.tsx
|
|
980
1174
|
import * as RadixSwitch from "@radix-ui/react-switch";
|
|
981
|
-
import { forwardRef as
|
|
982
|
-
import { jsx as
|
|
1175
|
+
import { forwardRef as forwardRef14, useId as useId5 } from "react";
|
|
1176
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
983
1177
|
var trackClasses = {
|
|
984
1178
|
comfortable: {
|
|
985
1179
|
sm: "h-4 w-7",
|
|
@@ -1000,10 +1194,10 @@ var thumbClasses = {
|
|
|
1000
1194
|
md: "h-[26px] w-[26px] data-[state=checked]:translate-x-5"
|
|
1001
1195
|
}
|
|
1002
1196
|
};
|
|
1003
|
-
var Switch =
|
|
1197
|
+
var Switch = forwardRef14(function Switch2({ label, size = "md", density = "comfortable", className, id: idProp, ...props }, ref) {
|
|
1004
1198
|
const reactId = useId5();
|
|
1005
1199
|
const id = idProp ?? `sw-${reactId}`;
|
|
1006
|
-
return /* @__PURE__ */
|
|
1200
|
+
return /* @__PURE__ */ jsxs12(
|
|
1007
1201
|
"span",
|
|
1008
1202
|
{
|
|
1009
1203
|
className: cn(
|
|
@@ -1012,7 +1206,7 @@ var Switch = forwardRef13(function Switch2({ label, size = "md", density = "comf
|
|
|
1012
1206
|
className
|
|
1013
1207
|
),
|
|
1014
1208
|
children: [
|
|
1015
|
-
/* @__PURE__ */
|
|
1209
|
+
/* @__PURE__ */ jsx15(
|
|
1016
1210
|
RadixSwitch.Root,
|
|
1017
1211
|
{
|
|
1018
1212
|
ref,
|
|
@@ -1025,7 +1219,7 @@ var Switch = forwardRef13(function Switch2({ label, size = "md", density = "comf
|
|
|
1025
1219
|
trackClasses[density][size]
|
|
1026
1220
|
),
|
|
1027
1221
|
...props,
|
|
1028
|
-
children: /* @__PURE__ */
|
|
1222
|
+
children: /* @__PURE__ */ jsx15(
|
|
1029
1223
|
RadixSwitch.Thumb,
|
|
1030
1224
|
{
|
|
1031
1225
|
className: cn(
|
|
@@ -1037,7 +1231,7 @@ var Switch = forwardRef13(function Switch2({ label, size = "md", density = "comf
|
|
|
1037
1231
|
)
|
|
1038
1232
|
}
|
|
1039
1233
|
),
|
|
1040
|
-
label && /* @__PURE__ */
|
|
1234
|
+
label && /* @__PURE__ */ jsx15(
|
|
1041
1235
|
"label",
|
|
1042
1236
|
{
|
|
1043
1237
|
htmlFor: id,
|
|
@@ -1052,10 +1246,10 @@ var Switch = forwardRef13(function Switch2({ label, size = "md", density = "comf
|
|
|
1052
1246
|
Switch.displayName = "Switch";
|
|
1053
1247
|
|
|
1054
1248
|
// src/components/Textarea/Textarea.tsx
|
|
1055
|
-
import { cva as
|
|
1056
|
-
import { forwardRef as
|
|
1057
|
-
import { jsx as
|
|
1058
|
-
var textareaStyles =
|
|
1249
|
+
import { cva as cva5 } from "class-variance-authority";
|
|
1250
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
1251
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
1252
|
+
var textareaStyles = cva5(
|
|
1059
1253
|
[
|
|
1060
1254
|
"w-full font-sans text-text bg-panel rounded-md p-[10px]",
|
|
1061
1255
|
"border outline-none transition-[border-color,box-shadow] duration-(--duration-micro)",
|
|
@@ -1073,8 +1267,8 @@ var textareaStyles = cva4(
|
|
|
1073
1267
|
defaultVariants: { tone: "default" }
|
|
1074
1268
|
}
|
|
1075
1269
|
);
|
|
1076
|
-
var Textarea =
|
|
1077
|
-
return /* @__PURE__ */
|
|
1270
|
+
var Textarea = forwardRef15(function Textarea2({ tone, error, rows = 4, className, ...props }, ref) {
|
|
1271
|
+
return /* @__PURE__ */ jsx16(
|
|
1078
1272
|
"textarea",
|
|
1079
1273
|
{
|
|
1080
1274
|
ref,
|
|
@@ -1089,11 +1283,11 @@ Textarea.displayName = "Textarea";
|
|
|
1089
1283
|
|
|
1090
1284
|
// src/components/Avatar/Avatar.tsx
|
|
1091
1285
|
import * as RadixAvatar from "@radix-ui/react-avatar";
|
|
1092
|
-
import { forwardRef as
|
|
1286
|
+
import { forwardRef as forwardRef17 } from "react";
|
|
1093
1287
|
|
|
1094
1288
|
// src/components/StatusDot/StatusDot.tsx
|
|
1095
|
-
import { forwardRef as
|
|
1096
|
-
import { jsx as
|
|
1289
|
+
import { forwardRef as forwardRef16 } from "react";
|
|
1290
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1097
1291
|
var stateColor = {
|
|
1098
1292
|
ok: "bg-ok",
|
|
1099
1293
|
warn: "bg-warn",
|
|
@@ -1118,8 +1312,8 @@ var stateLabel = {
|
|
|
1118
1312
|
sync: "Syncing",
|
|
1119
1313
|
accent: "Active"
|
|
1120
1314
|
};
|
|
1121
|
-
var StatusDot =
|
|
1122
|
-
return /* @__PURE__ */
|
|
1315
|
+
var StatusDot = forwardRef16(function StatusDot2({ state = "ok", label, pulse, size = 8, className, ...props }, ref) {
|
|
1316
|
+
return /* @__PURE__ */ jsxs13(
|
|
1123
1317
|
"span",
|
|
1124
1318
|
{
|
|
1125
1319
|
ref,
|
|
@@ -1128,7 +1322,7 @@ var StatusDot = forwardRef15(function StatusDot2({ state = "ok", label, pulse, s
|
|
|
1128
1322
|
className: cn("inline-flex items-center gap-[6px]", className),
|
|
1129
1323
|
...props,
|
|
1130
1324
|
children: [
|
|
1131
|
-
/* @__PURE__ */
|
|
1325
|
+
/* @__PURE__ */ jsx17(
|
|
1132
1326
|
"span",
|
|
1133
1327
|
{
|
|
1134
1328
|
className: cn(
|
|
@@ -1140,7 +1334,7 @@ var StatusDot = forwardRef15(function StatusDot2({ state = "ok", label, pulse, s
|
|
|
1140
1334
|
style: { width: size, height: size }
|
|
1141
1335
|
}
|
|
1142
1336
|
),
|
|
1143
|
-
label && /* @__PURE__ */
|
|
1337
|
+
label && /* @__PURE__ */ jsx17("span", { className: "text-text-muted text-[12px]", children: label })
|
|
1144
1338
|
]
|
|
1145
1339
|
}
|
|
1146
1340
|
);
|
|
@@ -1157,7 +1351,7 @@ var sizePx = {
|
|
|
1157
1351
|
};
|
|
1158
1352
|
|
|
1159
1353
|
// src/components/Avatar/Avatar.tsx
|
|
1160
|
-
import { jsx as
|
|
1354
|
+
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1161
1355
|
var statusBg = {
|
|
1162
1356
|
ok: "bg-ok",
|
|
1163
1357
|
warn: "bg-warn",
|
|
@@ -1172,11 +1366,11 @@ function hashHue(str) {
|
|
|
1172
1366
|
for (let i = 0; i < str.length; i++) h = (h * 31 + str.charCodeAt(i)) % 360;
|
|
1173
1367
|
return h;
|
|
1174
1368
|
}
|
|
1175
|
-
var Avatar =
|
|
1369
|
+
var Avatar = forwardRef17(function Avatar2({ name = "?", src, size = "md", status, initials, className, style, ...props }, ref) {
|
|
1176
1370
|
const dim = sizePx[size];
|
|
1177
1371
|
const hue = hashHue(name);
|
|
1178
1372
|
const computedInitials = initials ?? initialsFor(name);
|
|
1179
|
-
return /* @__PURE__ */
|
|
1373
|
+
return /* @__PURE__ */ jsxs14(
|
|
1180
1374
|
"span",
|
|
1181
1375
|
{
|
|
1182
1376
|
ref,
|
|
@@ -1184,7 +1378,7 @@ var Avatar = forwardRef16(function Avatar2({ name = "?", src, size = "md", statu
|
|
|
1184
1378
|
style: { width: dim, height: dim, ...style },
|
|
1185
1379
|
...props,
|
|
1186
1380
|
children: [
|
|
1187
|
-
/* @__PURE__ */
|
|
1381
|
+
/* @__PURE__ */ jsxs14(
|
|
1188
1382
|
RadixAvatar.Root,
|
|
1189
1383
|
{
|
|
1190
1384
|
className: "border-border relative inline-flex h-full w-full shrink-0 overflow-hidden rounded-full border",
|
|
@@ -1192,8 +1386,8 @@ var Avatar = forwardRef16(function Avatar2({ name = "?", src, size = "md", statu
|
|
|
1192
1386
|
background: src ? void 0 : `oklch(var(--color-avatar-fallback-l) var(--color-avatar-fallback-c) ${hue})`
|
|
1193
1387
|
},
|
|
1194
1388
|
children: [
|
|
1195
|
-
src && /* @__PURE__ */
|
|
1196
|
-
/* @__PURE__ */
|
|
1389
|
+
src && /* @__PURE__ */ jsx18(RadixAvatar.Image, { src, alt: name, className: "h-full w-full object-cover" }),
|
|
1390
|
+
/* @__PURE__ */ jsx18(
|
|
1197
1391
|
RadixAvatar.Fallback,
|
|
1198
1392
|
{
|
|
1199
1393
|
className: "flex h-full w-full items-center justify-center font-sans font-semibold text-white",
|
|
@@ -1204,7 +1398,7 @@ var Avatar = forwardRef16(function Avatar2({ name = "?", src, size = "md", statu
|
|
|
1204
1398
|
]
|
|
1205
1399
|
}
|
|
1206
1400
|
),
|
|
1207
|
-
status && /* @__PURE__ */
|
|
1401
|
+
status && /* @__PURE__ */ jsx18(
|
|
1208
1402
|
"span",
|
|
1209
1403
|
{
|
|
1210
1404
|
role: "img",
|
|
@@ -1223,16 +1417,16 @@ var Avatar = forwardRef16(function Avatar2({ name = "?", src, size = "md", statu
|
|
|
1223
1417
|
Avatar.displayName = "Avatar";
|
|
1224
1418
|
|
|
1225
1419
|
// src/components/Avatar/AvatarGroup.tsx
|
|
1226
|
-
import { forwardRef as
|
|
1227
|
-
import { jsx as
|
|
1228
|
-
var AvatarGroup =
|
|
1420
|
+
import { forwardRef as forwardRef18 } from "react";
|
|
1421
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1422
|
+
var AvatarGroup = forwardRef18(function AvatarGroup2({ names, max = 3, size = "md", className, ...props }, ref) {
|
|
1229
1423
|
const dim = sizePx[size];
|
|
1230
1424
|
const visible = names.slice(0, max);
|
|
1231
1425
|
const rest = names.length - visible.length;
|
|
1232
1426
|
const overlap = -dim * 0.35;
|
|
1233
|
-
return /* @__PURE__ */
|
|
1234
|
-
visible.map((n, i) => /* @__PURE__ */
|
|
1235
|
-
rest > 0 && /* @__PURE__ */
|
|
1427
|
+
return /* @__PURE__ */ jsxs15("div", { ref, className: cn("inline-flex", className), ...props, children: [
|
|
1428
|
+
visible.map((n, i) => /* @__PURE__ */ jsx19("span", { style: { marginLeft: i === 0 ? 0 : overlap }, children: /* @__PURE__ */ jsx19(Avatar, { name: n, size }) }, `${n}-${i}`)),
|
|
1429
|
+
rest > 0 && /* @__PURE__ */ jsxs15(
|
|
1236
1430
|
"span",
|
|
1237
1431
|
{
|
|
1238
1432
|
"aria-label": `+${rest} more`,
|
|
@@ -1254,10 +1448,10 @@ var AvatarGroup = forwardRef17(function AvatarGroup2({ names, max = 3, size = "m
|
|
|
1254
1448
|
AvatarGroup.displayName = "AvatarGroup";
|
|
1255
1449
|
|
|
1256
1450
|
// src/components/Badge/Badge.tsx
|
|
1257
|
-
import { cva as
|
|
1258
|
-
import { forwardRef as
|
|
1259
|
-
import { jsx as
|
|
1260
|
-
var badgeStyles =
|
|
1451
|
+
import { cva as cva6 } from "class-variance-authority";
|
|
1452
|
+
import { forwardRef as forwardRef19 } from "react";
|
|
1453
|
+
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1454
|
+
var badgeStyles = cva6("inline-flex items-center font-sans leading-none whitespace-nowrap", {
|
|
1261
1455
|
variants: {
|
|
1262
1456
|
variant: {
|
|
1263
1457
|
neutral: "bg-panel-2 text-text-muted border border-border",
|
|
@@ -1290,28 +1484,28 @@ var dotColorClass = {
|
|
|
1290
1484
|
solid: "bg-bg"
|
|
1291
1485
|
};
|
|
1292
1486
|
var dotSize = { sm: "h-[5px] w-[5px]", md: "h-[6px] w-[6px]", lg: "h-[7px] w-[7px]" };
|
|
1293
|
-
var Badge =
|
|
1487
|
+
var Badge = forwardRef19(function Badge2({ variant = "neutral", size = "md", dot, icon, className, children, ...props }, ref) {
|
|
1294
1488
|
const sz = size ?? "md";
|
|
1295
1489
|
const v = variant ?? "neutral";
|
|
1296
|
-
return /* @__PURE__ */
|
|
1297
|
-
dot && /* @__PURE__ */
|
|
1490
|
+
return /* @__PURE__ */ jsxs16("span", { ref, className: cn(badgeStyles({ variant, size }), className), ...props, children: [
|
|
1491
|
+
dot && /* @__PURE__ */ jsx20(
|
|
1298
1492
|
"span",
|
|
1299
1493
|
{
|
|
1300
1494
|
"aria-hidden": true,
|
|
1301
1495
|
className: cn("inline-block rounded-full", dotSize[sz], dotColorClass[v])
|
|
1302
1496
|
}
|
|
1303
1497
|
),
|
|
1304
|
-
icon && /* @__PURE__ */
|
|
1498
|
+
icon && /* @__PURE__ */ jsx20("span", { className: "inline-flex leading-none", children: icon }),
|
|
1305
1499
|
children
|
|
1306
1500
|
] });
|
|
1307
1501
|
});
|
|
1308
1502
|
Badge.displayName = "Badge";
|
|
1309
1503
|
|
|
1310
1504
|
// src/components/Card/Card.tsx
|
|
1311
|
-
import { cva as
|
|
1312
|
-
import { forwardRef as
|
|
1313
|
-
import { jsx as
|
|
1314
|
-
var cardStyles =
|
|
1505
|
+
import { cva as cva7 } from "class-variance-authority";
|
|
1506
|
+
import { forwardRef as forwardRef20 } from "react";
|
|
1507
|
+
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1508
|
+
var cardStyles = cva7(
|
|
1315
1509
|
"block bg-panel border border-border transition-[border-color,transform,box-shadow] duration-(--duration-step)",
|
|
1316
1510
|
{
|
|
1317
1511
|
variants: {
|
|
@@ -1332,7 +1526,7 @@ var cardStyles = cva6(
|
|
|
1332
1526
|
defaultVariants: { variant: "default", interactive: false, density: "comfortable" }
|
|
1333
1527
|
}
|
|
1334
1528
|
);
|
|
1335
|
-
var Card =
|
|
1529
|
+
var Card = forwardRef20(function Card2({
|
|
1336
1530
|
variant,
|
|
1337
1531
|
interactive,
|
|
1338
1532
|
density,
|
|
@@ -1364,7 +1558,7 @@ var Card = forwardRef19(function Card2({
|
|
|
1364
1558
|
onClick(e);
|
|
1365
1559
|
}
|
|
1366
1560
|
} : void 0;
|
|
1367
|
-
return /* @__PURE__ */
|
|
1561
|
+
return /* @__PURE__ */ jsxs17(
|
|
1368
1562
|
"div",
|
|
1369
1563
|
{
|
|
1370
1564
|
ref,
|
|
@@ -1379,20 +1573,20 @@ var Card = forwardRef19(function Card2({
|
|
|
1379
1573
|
),
|
|
1380
1574
|
...props,
|
|
1381
1575
|
children: [
|
|
1382
|
-
(title || actions) && /* @__PURE__ */
|
|
1383
|
-
title && /* @__PURE__ */
|
|
1384
|
-
actions && /* @__PURE__ */
|
|
1576
|
+
(title || actions) && /* @__PURE__ */ jsxs17("div", { className: cn("flex items-start gap-3", (description || children) && "mb-[10px]"), children: [
|
|
1577
|
+
title && /* @__PURE__ */ jsx21("div", { className: "flex-1 text-[14px] font-medium", children: title }),
|
|
1578
|
+
actions && /* @__PURE__ */ jsx21("div", { className: "flex gap-1", children: actions })
|
|
1385
1579
|
] }),
|
|
1386
|
-
description && /* @__PURE__ */
|
|
1580
|
+
description && /* @__PURE__ */ jsx21("div", { className: cn("text-text-muted text-[12px] leading-[1.55]", children && "mb-[14px]"), children: description }),
|
|
1387
1581
|
children,
|
|
1388
|
-
footer && /* @__PURE__ */
|
|
1582
|
+
footer && /* @__PURE__ */ jsx21("div", { className: "border-border text-text-dim mt-[14px] border-t pt-3 text-[11px]", children: footer })
|
|
1389
1583
|
]
|
|
1390
1584
|
}
|
|
1391
1585
|
);
|
|
1392
1586
|
});
|
|
1393
1587
|
Card.displayName = "Card";
|
|
1394
|
-
var CardLink =
|
|
1395
|
-
return /* @__PURE__ */
|
|
1588
|
+
var CardLink = forwardRef20(function CardLink2({ variant, density, title, description, footer, className, children, href, ...props }, ref) {
|
|
1589
|
+
return /* @__PURE__ */ jsxs17(
|
|
1396
1590
|
"a",
|
|
1397
1591
|
{
|
|
1398
1592
|
ref,
|
|
@@ -1405,10 +1599,10 @@ var CardLink = forwardRef19(function CardLink2({ variant, density, title, descri
|
|
|
1405
1599
|
),
|
|
1406
1600
|
...props,
|
|
1407
1601
|
children: [
|
|
1408
|
-
title && /* @__PURE__ */
|
|
1409
|
-
description && /* @__PURE__ */
|
|
1602
|
+
title && /* @__PURE__ */ jsx21("div", { className: cn("flex items-start", (description || children) && "mb-[10px]"), children: /* @__PURE__ */ jsx21("div", { className: "flex-1 text-[14px] font-medium", children: title }) }),
|
|
1603
|
+
description && /* @__PURE__ */ jsx21("div", { className: cn("text-text-muted text-[12px] leading-[1.55]", children && "mb-[14px]"), children: description }),
|
|
1410
1604
|
children,
|
|
1411
|
-
footer && /* @__PURE__ */
|
|
1605
|
+
footer && /* @__PURE__ */ jsx21("div", { className: "border-border text-text-dim mt-[14px] border-t pt-3 text-[11px]", children: footer })
|
|
1412
1606
|
]
|
|
1413
1607
|
}
|
|
1414
1608
|
);
|
|
@@ -1416,28 +1610,28 @@ var CardLink = forwardRef19(function CardLink2({ variant, density, title, descri
|
|
|
1416
1610
|
CardLink.displayName = "CardLink";
|
|
1417
1611
|
|
|
1418
1612
|
// src/components/Card/StatCard.tsx
|
|
1419
|
-
import { forwardRef as
|
|
1420
|
-
import { jsx as
|
|
1613
|
+
import { forwardRef as forwardRef21 } from "react";
|
|
1614
|
+
import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1421
1615
|
var trendClasses = {
|
|
1422
1616
|
up: "text-ok",
|
|
1423
1617
|
down: "text-err",
|
|
1424
1618
|
flat: "text-text-dim"
|
|
1425
1619
|
};
|
|
1426
1620
|
var trendArrows = { up: "\u2191", down: "\u2193", flat: "\u2192" };
|
|
1427
|
-
var StatCard =
|
|
1428
|
-
return /* @__PURE__ */
|
|
1621
|
+
var StatCard = forwardRef21(function StatCard2({ label, value, delta, trend = "flat", icon, className, ...props }, ref) {
|
|
1622
|
+
return /* @__PURE__ */ jsxs18(
|
|
1429
1623
|
"div",
|
|
1430
1624
|
{
|
|
1431
1625
|
ref,
|
|
1432
1626
|
className: cn("bg-panel border-border rounded-base block border p-[18px]", className),
|
|
1433
1627
|
...props,
|
|
1434
1628
|
children: [
|
|
1435
|
-
/* @__PURE__ */
|
|
1436
|
-
/* @__PURE__ */
|
|
1437
|
-
icon && /* @__PURE__ */
|
|
1629
|
+
/* @__PURE__ */ jsxs18("div", { className: "mb-[10px] flex items-center justify-between", children: [
|
|
1630
|
+
/* @__PURE__ */ jsx22("div", { className: "text-text-dim font-mono text-[10px] tracking-wide uppercase", children: label }),
|
|
1631
|
+
icon && /* @__PURE__ */ jsx22("div", { className: "text-text-dim text-[14px]", children: icon })
|
|
1438
1632
|
] }),
|
|
1439
|
-
/* @__PURE__ */
|
|
1440
|
-
delta !== void 0 && /* @__PURE__ */
|
|
1633
|
+
/* @__PURE__ */ jsx22("div", { className: "text-text font-mono text-[26px] leading-none font-medium tracking-tight", children: value }),
|
|
1634
|
+
delta !== void 0 && /* @__PURE__ */ jsxs18("div", { className: cn("mt-[6px] font-mono text-[11px]", trendClasses[trend]), children: [
|
|
1441
1635
|
trendArrows[trend],
|
|
1442
1636
|
" ",
|
|
1443
1637
|
delta
|
|
@@ -1449,11 +1643,11 @@ var StatCard = forwardRef20(function StatCard2({ label, value, delta, trend = "f
|
|
|
1449
1643
|
StatCard.displayName = "StatCard";
|
|
1450
1644
|
|
|
1451
1645
|
// src/components/Chip/Chip.tsx
|
|
1452
|
-
import { forwardRef as
|
|
1453
|
-
import { jsx as
|
|
1454
|
-
var Chip =
|
|
1646
|
+
import { forwardRef as forwardRef22 } from "react";
|
|
1647
|
+
import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1648
|
+
var Chip = forwardRef22(function Chip2({ icon, onRemove, density = "comfortable", className, children, ...props }, ref) {
|
|
1455
1649
|
const isTouch = density === "touch";
|
|
1456
|
-
return /* @__PURE__ */
|
|
1650
|
+
return /* @__PURE__ */ jsxs19(
|
|
1457
1651
|
"span",
|
|
1458
1652
|
{
|
|
1459
1653
|
ref,
|
|
@@ -1465,9 +1659,9 @@ var Chip = forwardRef21(function Chip2({ icon, onRemove, density = "comfortable"
|
|
|
1465
1659
|
),
|
|
1466
1660
|
...props,
|
|
1467
1661
|
children: [
|
|
1468
|
-
icon && /* @__PURE__ */
|
|
1662
|
+
icon && /* @__PURE__ */ jsx23("span", { className: cn("text-text-dim inline-flex", isTouch ? "text-[12px]" : "text-[10px]"), children: icon }),
|
|
1469
1663
|
children,
|
|
1470
|
-
onRemove && /* @__PURE__ */
|
|
1664
|
+
onRemove && /* @__PURE__ */ jsx23(
|
|
1471
1665
|
"button",
|
|
1472
1666
|
{
|
|
1473
1667
|
type: "button",
|
|
@@ -1487,10 +1681,10 @@ var Chip = forwardRef21(function Chip2({ icon, onRemove, density = "comfortable"
|
|
|
1487
1681
|
Chip.displayName = "Chip";
|
|
1488
1682
|
|
|
1489
1683
|
// src/components/Kbd/Kbd.tsx
|
|
1490
|
-
import { forwardRef as
|
|
1491
|
-
import { jsx as
|
|
1492
|
-
var Kbd =
|
|
1493
|
-
return /* @__PURE__ */
|
|
1684
|
+
import { forwardRef as forwardRef23 } from "react";
|
|
1685
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
1686
|
+
var Kbd = forwardRef23(function Kbd2({ className, children, ...props }, ref) {
|
|
1687
|
+
return /* @__PURE__ */ jsx24(
|
|
1494
1688
|
"kbd",
|
|
1495
1689
|
{
|
|
1496
1690
|
ref,
|
|
@@ -1509,11 +1703,11 @@ Kbd.displayName = "Kbd";
|
|
|
1509
1703
|
|
|
1510
1704
|
// src/components/ScrollArea/ScrollArea.tsx
|
|
1511
1705
|
import * as RadixScrollArea from "@radix-ui/react-scroll-area";
|
|
1512
|
-
import { forwardRef as
|
|
1513
|
-
import { jsx as
|
|
1706
|
+
import { forwardRef as forwardRef24 } from "react";
|
|
1707
|
+
import { jsx as jsx25, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1514
1708
|
var scrollbarBase = "flex touch-none select-none p-[2px] transition-colors duration-(--duration-micro)";
|
|
1515
1709
|
var thumbBase = 'relative flex-1 rounded-full bg-text-muted/40 hover:bg-text-muted/60 before:absolute before:inset-1/2 before:size-full before:min-h-[44px] before:min-w-[44px] before:-translate-x-1/2 before:-translate-y-1/2 before:content-[""]';
|
|
1516
|
-
var ScrollArea =
|
|
1710
|
+
var ScrollArea = forwardRef24(function ScrollArea2({
|
|
1517
1711
|
type = "hover",
|
|
1518
1712
|
orientation = "vertical",
|
|
1519
1713
|
scrollHideDelay = 600,
|
|
@@ -1525,7 +1719,7 @@ var ScrollArea = forwardRef23(function ScrollArea2({
|
|
|
1525
1719
|
}, ref) {
|
|
1526
1720
|
const showVertical = orientation === "vertical" || orientation === "both";
|
|
1527
1721
|
const showHorizontal = orientation === "horizontal" || orientation === "both";
|
|
1528
|
-
return /* @__PURE__ */
|
|
1722
|
+
return /* @__PURE__ */ jsxs20(
|
|
1529
1723
|
RadixScrollArea.Root,
|
|
1530
1724
|
{
|
|
1531
1725
|
ref,
|
|
@@ -1534,7 +1728,7 @@ var ScrollArea = forwardRef23(function ScrollArea2({
|
|
|
1534
1728
|
className: cn("relative overflow-hidden", className),
|
|
1535
1729
|
...props,
|
|
1536
1730
|
children: [
|
|
1537
|
-
/* @__PURE__ */
|
|
1731
|
+
/* @__PURE__ */ jsx25(
|
|
1538
1732
|
RadixScrollArea.Viewport,
|
|
1539
1733
|
{
|
|
1540
1734
|
ref: viewportRef,
|
|
@@ -1542,15 +1736,15 @@ var ScrollArea = forwardRef23(function ScrollArea2({
|
|
|
1542
1736
|
children
|
|
1543
1737
|
}
|
|
1544
1738
|
),
|
|
1545
|
-
showVertical && /* @__PURE__ */
|
|
1739
|
+
showVertical && /* @__PURE__ */ jsx25(
|
|
1546
1740
|
RadixScrollArea.Scrollbar,
|
|
1547
1741
|
{
|
|
1548
1742
|
orientation: "vertical",
|
|
1549
1743
|
className: cn(scrollbarBase, "bg-panel-2/40 hover:bg-panel-2/80 h-full w-[10px]"),
|
|
1550
|
-
children: /* @__PURE__ */
|
|
1744
|
+
children: /* @__PURE__ */ jsx25(RadixScrollArea.Thumb, { className: thumbBase })
|
|
1551
1745
|
}
|
|
1552
1746
|
),
|
|
1553
|
-
showHorizontal && /* @__PURE__ */
|
|
1747
|
+
showHorizontal && /* @__PURE__ */ jsx25(
|
|
1554
1748
|
RadixScrollArea.Scrollbar,
|
|
1555
1749
|
{
|
|
1556
1750
|
orientation: "horizontal",
|
|
@@ -1558,10 +1752,10 @@ var ScrollArea = forwardRef23(function ScrollArea2({
|
|
|
1558
1752
|
scrollbarBase,
|
|
1559
1753
|
"bg-panel-2/40 hover:bg-panel-2/80 h-[10px] w-full flex-col"
|
|
1560
1754
|
),
|
|
1561
|
-
children: /* @__PURE__ */
|
|
1755
|
+
children: /* @__PURE__ */ jsx25(RadixScrollArea.Thumb, { className: thumbBase })
|
|
1562
1756
|
}
|
|
1563
1757
|
),
|
|
1564
|
-
orientation === "both" && /* @__PURE__ */
|
|
1758
|
+
orientation === "both" && /* @__PURE__ */ jsx25(RadixScrollArea.Corner, { className: "bg-panel-2/60" })
|
|
1565
1759
|
]
|
|
1566
1760
|
}
|
|
1567
1761
|
);
|
|
@@ -1569,10 +1763,10 @@ var ScrollArea = forwardRef23(function ScrollArea2({
|
|
|
1569
1763
|
ScrollArea.displayName = "ScrollArea";
|
|
1570
1764
|
|
|
1571
1765
|
// src/components/Skeleton/Skeleton.tsx
|
|
1572
|
-
import { cva as
|
|
1573
|
-
import { forwardRef as
|
|
1574
|
-
import { jsx as
|
|
1575
|
-
var skeletonStyles =
|
|
1766
|
+
import { cva as cva8 } from "class-variance-authority";
|
|
1767
|
+
import { forwardRef as forwardRef25 } from "react";
|
|
1768
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
1769
|
+
var skeletonStyles = cva8("block bg-panel-2 animate-[ship-skeleton_1.4s_infinite]", {
|
|
1576
1770
|
variants: {
|
|
1577
1771
|
shape: {
|
|
1578
1772
|
line: "rounded-xs",
|
|
@@ -1583,11 +1777,11 @@ var skeletonStyles = cva7("block bg-panel-2 animate-[ship-skeleton_1.4s_infinite
|
|
|
1583
1777
|
defaultVariants: { shape: "line" }
|
|
1584
1778
|
});
|
|
1585
1779
|
var defaultHeight = { line: 14, block: 80, circle: 40 };
|
|
1586
|
-
var Skeleton =
|
|
1780
|
+
var Skeleton = forwardRef25(function Skeleton2({ shape = "line", width = "100%", height, standalone = false, className, style, ...props }, ref) {
|
|
1587
1781
|
const h = height ?? defaultHeight[shape];
|
|
1588
1782
|
const w = shape === "circle" ? h : width;
|
|
1589
1783
|
const a11yProps = standalone ? { role: "status", "aria-busy": true, "aria-label": "Loading" } : { "aria-hidden": true };
|
|
1590
|
-
return /* @__PURE__ */
|
|
1784
|
+
return /* @__PURE__ */ jsx26(
|
|
1591
1785
|
"div",
|
|
1592
1786
|
{
|
|
1593
1787
|
ref,
|
|
@@ -1599,11 +1793,11 @@ var Skeleton = forwardRef24(function Skeleton2({ shape = "line", width = "100%",
|
|
|
1599
1793
|
);
|
|
1600
1794
|
});
|
|
1601
1795
|
Skeleton.displayName = "Skeleton";
|
|
1602
|
-
var SkeletonGroup =
|
|
1796
|
+
var SkeletonGroup = forwardRef25(function SkeletonGroup2({ label = "Loading", loading = true, className, children, ...props }, ref) {
|
|
1603
1797
|
if (!loading) {
|
|
1604
|
-
return /* @__PURE__ */
|
|
1798
|
+
return /* @__PURE__ */ jsx26("div", { ref, className, ...props, children });
|
|
1605
1799
|
}
|
|
1606
|
-
return /* @__PURE__ */
|
|
1800
|
+
return /* @__PURE__ */ jsx26(
|
|
1607
1801
|
"div",
|
|
1608
1802
|
{
|
|
1609
1803
|
ref,
|
|
@@ -1619,10 +1813,10 @@ var SkeletonGroup = forwardRef24(function SkeletonGroup2({ label = "Loading", lo
|
|
|
1619
1813
|
SkeletonGroup.displayName = "SkeletonGroup";
|
|
1620
1814
|
|
|
1621
1815
|
// src/components/Tag/Tag.tsx
|
|
1622
|
-
import { forwardRef as
|
|
1623
|
-
import { jsx as
|
|
1624
|
-
var Tag =
|
|
1625
|
-
return /* @__PURE__ */
|
|
1816
|
+
import { forwardRef as forwardRef26 } from "react";
|
|
1817
|
+
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1818
|
+
var Tag = forwardRef26(function Tag2({ onRemove, icon, size = 22, className, children, ...props }, ref) {
|
|
1819
|
+
return /* @__PURE__ */ jsxs21(
|
|
1626
1820
|
"span",
|
|
1627
1821
|
{
|
|
1628
1822
|
ref,
|
|
@@ -1634,9 +1828,9 @@ var Tag = forwardRef25(function Tag2({ onRemove, icon, size = 22, className, chi
|
|
|
1634
1828
|
style: { height: size },
|
|
1635
1829
|
...props,
|
|
1636
1830
|
children: [
|
|
1637
|
-
icon && /* @__PURE__ */
|
|
1831
|
+
icon && /* @__PURE__ */ jsx27("span", { className: "text-text-dim inline-flex", children: icon }),
|
|
1638
1832
|
children,
|
|
1639
|
-
onRemove && /* @__PURE__ */
|
|
1833
|
+
onRemove && /* @__PURE__ */ jsx27(
|
|
1640
1834
|
"button",
|
|
1641
1835
|
{
|
|
1642
1836
|
type: "button",
|
|
@@ -1654,14 +1848,14 @@ Tag.displayName = "Tag";
|
|
|
1654
1848
|
|
|
1655
1849
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
1656
1850
|
import * as RadixContext from "@radix-ui/react-context-menu";
|
|
1657
|
-
import { forwardRef as
|
|
1658
|
-
import { jsx as
|
|
1851
|
+
import { forwardRef as forwardRef27 } from "react";
|
|
1852
|
+
import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1659
1853
|
var ContextMenuRoot = RadixContext.Root;
|
|
1660
1854
|
var ContextMenuTrigger = RadixContext.Trigger;
|
|
1661
1855
|
var ContextMenuPortal = RadixContext.Portal;
|
|
1662
|
-
var ContextMenuContent =
|
|
1856
|
+
var ContextMenuContent = forwardRef27(
|
|
1663
1857
|
function ContextMenuContent2({ className, ...props }, ref) {
|
|
1664
|
-
return /* @__PURE__ */
|
|
1858
|
+
return /* @__PURE__ */ jsx28(RadixContext.Portal, { children: /* @__PURE__ */ jsx28(
|
|
1665
1859
|
RadixContext.Content,
|
|
1666
1860
|
{
|
|
1667
1861
|
ref,
|
|
@@ -1681,26 +1875,26 @@ var itemBase = cn(
|
|
|
1681
1875
|
"data-[highlighted]:bg-panel-2",
|
|
1682
1876
|
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed"
|
|
1683
1877
|
);
|
|
1684
|
-
var ContextMenuItem =
|
|
1878
|
+
var ContextMenuItem = forwardRef27(
|
|
1685
1879
|
function ContextMenuItem2({ icon, trailing, destructive, className, children, ...props }, ref) {
|
|
1686
|
-
return /* @__PURE__ */
|
|
1880
|
+
return /* @__PURE__ */ jsxs22(
|
|
1687
1881
|
RadixContext.Item,
|
|
1688
1882
|
{
|
|
1689
1883
|
ref,
|
|
1690
1884
|
className: cn(itemBase, destructive ? "text-err" : "text-text", className),
|
|
1691
1885
|
...props,
|
|
1692
1886
|
children: [
|
|
1693
|
-
icon && /* @__PURE__ */
|
|
1694
|
-
/* @__PURE__ */
|
|
1695
|
-
trailing && /* @__PURE__ */
|
|
1887
|
+
icon && /* @__PURE__ */ jsx28("span", { className: "w-[14px] text-[12px] opacity-70", children: icon }),
|
|
1888
|
+
/* @__PURE__ */ jsx28("span", { className: "flex-1", children }),
|
|
1889
|
+
trailing && /* @__PURE__ */ jsx28("span", { className: "text-text-dim font-mono text-[10px]", children: trailing })
|
|
1696
1890
|
]
|
|
1697
1891
|
}
|
|
1698
1892
|
);
|
|
1699
1893
|
}
|
|
1700
1894
|
);
|
|
1701
1895
|
ContextMenuItem.displayName = "ContextMenuItem";
|
|
1702
|
-
var ContextMenuSeparator =
|
|
1703
|
-
return /* @__PURE__ */
|
|
1896
|
+
var ContextMenuSeparator = forwardRef27(function ContextMenuSeparator2({ className, ...props }, ref) {
|
|
1897
|
+
return /* @__PURE__ */ jsx28(
|
|
1704
1898
|
RadixContext.Separator,
|
|
1705
1899
|
{
|
|
1706
1900
|
ref,
|
|
@@ -1714,15 +1908,15 @@ var ContextMenu = RadixContext.Root;
|
|
|
1714
1908
|
|
|
1715
1909
|
// src/components/Dialog/Dialog.tsx
|
|
1716
1910
|
import * as RadixDialog from "@radix-ui/react-dialog";
|
|
1717
|
-
import { forwardRef as
|
|
1718
|
-
import { jsx as
|
|
1911
|
+
import { forwardRef as forwardRef28 } from "react";
|
|
1912
|
+
import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1719
1913
|
var DialogRoot = RadixDialog.Root;
|
|
1720
1914
|
var DialogTrigger = RadixDialog.Trigger;
|
|
1721
1915
|
var DialogClose = RadixDialog.Close;
|
|
1722
1916
|
var DialogPortal = RadixDialog.Portal;
|
|
1723
|
-
var DialogOverlay =
|
|
1917
|
+
var DialogOverlay = forwardRef28(
|
|
1724
1918
|
function DialogOverlay2({ className, ...props }, ref) {
|
|
1725
|
-
return /* @__PURE__ */
|
|
1919
|
+
return /* @__PURE__ */ jsx29(
|
|
1726
1920
|
RadixDialog.Overlay,
|
|
1727
1921
|
{
|
|
1728
1922
|
ref,
|
|
@@ -1737,10 +1931,10 @@ var DialogOverlay = forwardRef27(
|
|
|
1737
1931
|
}
|
|
1738
1932
|
);
|
|
1739
1933
|
DialogOverlay.displayName = "DialogOverlay";
|
|
1740
|
-
var DialogContent =
|
|
1741
|
-
return /* @__PURE__ */
|
|
1742
|
-
/* @__PURE__ */
|
|
1743
|
-
/* @__PURE__ */
|
|
1934
|
+
var DialogContent = forwardRef28(function DialogContent2({ className, width = 460, style, children, ...props }, ref) {
|
|
1935
|
+
return /* @__PURE__ */ jsxs23(DialogPortal, { children: [
|
|
1936
|
+
/* @__PURE__ */ jsx29(DialogOverlay, {}),
|
|
1937
|
+
/* @__PURE__ */ jsx29(
|
|
1744
1938
|
RadixDialog.Content,
|
|
1745
1939
|
{
|
|
1746
1940
|
ref,
|
|
@@ -1760,32 +1954,32 @@ var DialogContent = forwardRef27(function DialogContent2({ className, width = 46
|
|
|
1760
1954
|
});
|
|
1761
1955
|
DialogContent.displayName = "DialogContent";
|
|
1762
1956
|
function Dialog({ title, description, footer, width, children, ...rootProps }) {
|
|
1763
|
-
return /* @__PURE__ */
|
|
1764
|
-
title && /* @__PURE__ */
|
|
1957
|
+
return /* @__PURE__ */ jsx29(DialogRoot, { ...rootProps, children: /* @__PURE__ */ jsxs23(DialogContent, { width, children: [
|
|
1958
|
+
title && /* @__PURE__ */ jsx29(
|
|
1765
1959
|
RadixDialog.Title,
|
|
1766
1960
|
{
|
|
1767
1961
|
className: cn("text-[16px] font-medium", description ? "mb-[6px]" : "mb-4"),
|
|
1768
1962
|
children: title
|
|
1769
1963
|
}
|
|
1770
1964
|
),
|
|
1771
|
-
description && /* @__PURE__ */
|
|
1965
|
+
description && /* @__PURE__ */ jsx29(RadixDialog.Description, { className: "text-text-muted mb-[18px] text-[13px] leading-[1.55]", children: description }),
|
|
1772
1966
|
children,
|
|
1773
|
-
footer && /* @__PURE__ */
|
|
1967
|
+
footer && /* @__PURE__ */ jsx29("div", { className: "mt-5 flex justify-end gap-2", children: footer })
|
|
1774
1968
|
] }) });
|
|
1775
1969
|
}
|
|
1776
1970
|
|
|
1777
1971
|
// src/components/Dialog/Drawer.tsx
|
|
1778
1972
|
import * as RadixDialog2 from "@radix-ui/react-dialog";
|
|
1779
|
-
import { forwardRef as
|
|
1780
|
-
import { jsx as
|
|
1973
|
+
import { forwardRef as forwardRef29 } from "react";
|
|
1974
|
+
import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1781
1975
|
var sideClasses = {
|
|
1782
1976
|
left: "top-0 bottom-0 left-0 border-r border-border-strong data-[state=open]:animate-[ship-slide-in-left_220ms_var(--easing-out)]",
|
|
1783
1977
|
right: "top-0 bottom-0 right-0 border-l border-border-strong data-[state=open]:animate-[ship-slide-in-right_220ms_var(--easing-out)]",
|
|
1784
1978
|
bottom: "bottom-0 left-0 right-0 border-t border-border-strong rounded-t-m-sheet data-[state=open]:animate-[ship-slide-in-bottom_240ms_var(--easing-out)]"
|
|
1785
1979
|
};
|
|
1786
|
-
var DrawerHeader = ({ title, onClose }) => /* @__PURE__ */
|
|
1787
|
-
/* @__PURE__ */
|
|
1788
|
-
/* @__PURE__ */
|
|
1980
|
+
var DrawerHeader = ({ title, onClose }) => /* @__PURE__ */ jsxs24("div", { className: "border-border flex items-center justify-between border-b p-[16px] px-5", children: [
|
|
1981
|
+
/* @__PURE__ */ jsx30(RadixDialog2.Title, { className: "text-[14px] font-medium", children: title }),
|
|
1982
|
+
/* @__PURE__ */ jsx30(
|
|
1789
1983
|
RadixDialog2.Close,
|
|
1790
1984
|
{
|
|
1791
1985
|
onClick: onClose,
|
|
@@ -1795,15 +1989,15 @@ var DrawerHeader = ({ title, onClose }) => /* @__PURE__ */ jsxs23("div", { class
|
|
|
1795
1989
|
}
|
|
1796
1990
|
)
|
|
1797
1991
|
] });
|
|
1798
|
-
var SheetHeader = ({ title }) => /* @__PURE__ */
|
|
1799
|
-
var DragHandle = () => /* @__PURE__ */
|
|
1800
|
-
var Drawer =
|
|
1992
|
+
var SheetHeader = ({ title }) => /* @__PURE__ */ jsx30("div", { className: "px-5 pb-3", children: /* @__PURE__ */ jsx30(RadixDialog2.Title, { className: "text-m-body-lg font-semibold tracking-tight", children: title }) });
|
|
1993
|
+
var DragHandle = () => /* @__PURE__ */ jsx30("div", { className: "flex justify-center pt-3 pb-2", "aria-hidden": true, children: /* @__PURE__ */ jsx30("span", { className: "bg-border-strong h-1 w-9 rounded-full" }) });
|
|
1994
|
+
var Drawer = forwardRef29(function Drawer2({ side = "right", title, width = 420, height = "85vh", handle, children, ...rootProps }, ref) {
|
|
1801
1995
|
const isBottom = side === "bottom";
|
|
1802
1996
|
const showHandle = isBottom && (handle ?? true);
|
|
1803
1997
|
const dimensionStyle = isBottom ? { height } : { width };
|
|
1804
|
-
return /* @__PURE__ */
|
|
1805
|
-
/* @__PURE__ */
|
|
1806
|
-
/* @__PURE__ */
|
|
1998
|
+
return /* @__PURE__ */ jsx30(DialogRoot, { ...rootProps, children: /* @__PURE__ */ jsxs24(DialogPortal, { children: [
|
|
1999
|
+
/* @__PURE__ */ jsx30(DialogOverlay, {}),
|
|
2000
|
+
/* @__PURE__ */ jsxs24(
|
|
1807
2001
|
RadixDialog2.Content,
|
|
1808
2002
|
{
|
|
1809
2003
|
ref,
|
|
@@ -1814,9 +2008,9 @@ var Drawer = forwardRef28(function Drawer2({ side = "right", title, width = 420,
|
|
|
1814
2008
|
),
|
|
1815
2009
|
style: dimensionStyle,
|
|
1816
2010
|
children: [
|
|
1817
|
-
showHandle && /* @__PURE__ */
|
|
1818
|
-
title ? isBottom ? /* @__PURE__ */
|
|
1819
|
-
/* @__PURE__ */
|
|
2011
|
+
showHandle && /* @__PURE__ */ jsx30(DragHandle, {}),
|
|
2012
|
+
title ? isBottom ? /* @__PURE__ */ jsx30(SheetHeader, { title }) : /* @__PURE__ */ jsx30(DrawerHeader, { title }) : /* @__PURE__ */ jsx30(RadixDialog2.Title, { className: "sr-only", children: isBottom ? "Sheet" : "Drawer" }),
|
|
2013
|
+
/* @__PURE__ */ jsx30("div", { className: cn("flex-1 overflow-auto", isBottom ? "px-5 pb-6" : "p-5"), children })
|
|
1820
2014
|
]
|
|
1821
2015
|
}
|
|
1822
2016
|
)
|
|
@@ -1826,12 +2020,12 @@ Drawer.displayName = "Drawer";
|
|
|
1826
2020
|
|
|
1827
2021
|
// src/components/Dialog/Sheet.tsx
|
|
1828
2022
|
import * as RadixDialog3 from "@radix-ui/react-dialog";
|
|
1829
|
-
import { forwardRef as
|
|
1830
|
-
import { jsx as
|
|
1831
|
-
var Sheet =
|
|
1832
|
-
return /* @__PURE__ */
|
|
1833
|
-
/* @__PURE__ */
|
|
1834
|
-
/* @__PURE__ */
|
|
2023
|
+
import { forwardRef as forwardRef30 } from "react";
|
|
2024
|
+
import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
2025
|
+
var Sheet = forwardRef30(function Sheet2({ title, width = "min(640px, 90vw)", children, ...rootProps }, ref) {
|
|
2026
|
+
return /* @__PURE__ */ jsx31(DialogRoot, { ...rootProps, children: /* @__PURE__ */ jsxs25(DialogPortal, { children: [
|
|
2027
|
+
/* @__PURE__ */ jsx31(DialogOverlay, {}),
|
|
2028
|
+
/* @__PURE__ */ jsxs25(
|
|
1835
2029
|
RadixDialog3.Content,
|
|
1836
2030
|
{
|
|
1837
2031
|
ref,
|
|
@@ -1843,7 +2037,7 @@ var Sheet = forwardRef29(function Sheet2({ title, width = "min(640px, 90vw)", ch
|
|
|
1843
2037
|
),
|
|
1844
2038
|
style: { width },
|
|
1845
2039
|
children: [
|
|
1846
|
-
title ? /* @__PURE__ */
|
|
2040
|
+
title ? /* @__PURE__ */ jsx31(RadixDialog3.Title, { className: "mb-1 text-[15px] font-medium", children: title }) : /* @__PURE__ */ jsx31(RadixDialog3.Title, { className: "sr-only", children: "Sheet" }),
|
|
1847
2041
|
children
|
|
1848
2042
|
]
|
|
1849
2043
|
}
|
|
@@ -1854,15 +2048,15 @@ Sheet.displayName = "Sheet";
|
|
|
1854
2048
|
|
|
1855
2049
|
// src/components/Dialog/AlertDialog.tsx
|
|
1856
2050
|
import * as RadixAlert from "@radix-ui/react-alert-dialog";
|
|
1857
|
-
import { forwardRef as
|
|
1858
|
-
import { jsx as
|
|
2051
|
+
import { forwardRef as forwardRef31 } from "react";
|
|
2052
|
+
import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1859
2053
|
var AlertDialogRoot = RadixAlert.Root;
|
|
1860
2054
|
var AlertDialogTrigger = RadixAlert.Trigger;
|
|
1861
2055
|
var AlertDialogAction = RadixAlert.Action;
|
|
1862
2056
|
var AlertDialogCancel = RadixAlert.Cancel;
|
|
1863
|
-
var AlertDialog =
|
|
1864
|
-
return /* @__PURE__ */
|
|
1865
|
-
/* @__PURE__ */
|
|
2057
|
+
var AlertDialog = forwardRef31(function AlertDialog2({ title, description, footer, width = 460, children, ...rootProps }, ref) {
|
|
2058
|
+
return /* @__PURE__ */ jsx32(AlertDialogRoot, { ...rootProps, children: /* @__PURE__ */ jsxs26(RadixAlert.Portal, { children: [
|
|
2059
|
+
/* @__PURE__ */ jsx32(
|
|
1866
2060
|
RadixAlert.Overlay,
|
|
1867
2061
|
{
|
|
1868
2062
|
className: cn(
|
|
@@ -1871,7 +2065,7 @@ var AlertDialog = forwardRef30(function AlertDialog2({ title, description, foote
|
|
|
1871
2065
|
)
|
|
1872
2066
|
}
|
|
1873
2067
|
),
|
|
1874
|
-
/* @__PURE__ */
|
|
2068
|
+
/* @__PURE__ */ jsxs26(
|
|
1875
2069
|
RadixAlert.Content,
|
|
1876
2070
|
{
|
|
1877
2071
|
ref,
|
|
@@ -1882,16 +2076,16 @@ var AlertDialog = forwardRef30(function AlertDialog2({ title, description, foote
|
|
|
1882
2076
|
"data-[state=open]:animate-[ship-dialog-in_180ms_var(--easing-out)]"
|
|
1883
2077
|
),
|
|
1884
2078
|
children: [
|
|
1885
|
-
/* @__PURE__ */
|
|
2079
|
+
/* @__PURE__ */ jsx32(
|
|
1886
2080
|
RadixAlert.Title,
|
|
1887
2081
|
{
|
|
1888
2082
|
className: cn("text-[16px] font-medium", description ? "mb-[6px]" : "mb-4"),
|
|
1889
2083
|
children: title
|
|
1890
2084
|
}
|
|
1891
2085
|
),
|
|
1892
|
-
description && /* @__PURE__ */
|
|
2086
|
+
description && /* @__PURE__ */ jsx32(RadixAlert.Description, { className: "text-text-muted mb-[18px] text-[13px] leading-[1.55]", children: description }),
|
|
1893
2087
|
children,
|
|
1894
|
-
footer && /* @__PURE__ */
|
|
2088
|
+
footer && /* @__PURE__ */ jsx32("div", { className: "mt-5 flex justify-end gap-2", children: footer })
|
|
1895
2089
|
]
|
|
1896
2090
|
}
|
|
1897
2091
|
)
|
|
@@ -1901,17 +2095,17 @@ AlertDialog.displayName = "AlertDialog";
|
|
|
1901
2095
|
|
|
1902
2096
|
// src/components/DropdownMenu/DropdownMenu.tsx
|
|
1903
2097
|
import * as RadixMenu from "@radix-ui/react-dropdown-menu";
|
|
1904
|
-
import { forwardRef as
|
|
1905
|
-
import { jsx as
|
|
2098
|
+
import { forwardRef as forwardRef32 } from "react";
|
|
2099
|
+
import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
1906
2100
|
var DropdownMenuRoot = RadixMenu.Root;
|
|
1907
2101
|
var DropdownMenuTrigger = RadixMenu.Trigger;
|
|
1908
2102
|
var DropdownMenuPortal = RadixMenu.Portal;
|
|
1909
2103
|
var DropdownMenuGroup = RadixMenu.Group;
|
|
1910
2104
|
var DropdownMenuLabel = RadixMenu.Label;
|
|
1911
2105
|
var DropdownMenuRadioGroup = RadixMenu.RadioGroup;
|
|
1912
|
-
var DropdownMenuContent =
|
|
2106
|
+
var DropdownMenuContent = forwardRef32(
|
|
1913
2107
|
function DropdownMenuContent2({ className, sideOffset = 6, align = "start", ...props }, ref) {
|
|
1914
|
-
return /* @__PURE__ */
|
|
2108
|
+
return /* @__PURE__ */ jsx33(RadixMenu.Portal, { children: /* @__PURE__ */ jsx33(
|
|
1915
2109
|
RadixMenu.Content,
|
|
1916
2110
|
{
|
|
1917
2111
|
ref,
|
|
@@ -1933,32 +2127,32 @@ var itemBase2 = cn(
|
|
|
1933
2127
|
"data-[highlighted]:bg-panel-2",
|
|
1934
2128
|
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed"
|
|
1935
2129
|
);
|
|
1936
|
-
var MenuItem =
|
|
1937
|
-
return /* @__PURE__ */
|
|
2130
|
+
var MenuItem = forwardRef32(function MenuItem2({ icon, trailing, destructive, className, children, ...props }, ref) {
|
|
2131
|
+
return /* @__PURE__ */ jsxs27(
|
|
1938
2132
|
RadixMenu.Item,
|
|
1939
2133
|
{
|
|
1940
2134
|
ref,
|
|
1941
2135
|
className: cn(itemBase2, destructive ? "text-err" : "text-text", className),
|
|
1942
2136
|
...props,
|
|
1943
2137
|
children: [
|
|
1944
|
-
icon && /* @__PURE__ */
|
|
1945
|
-
/* @__PURE__ */
|
|
1946
|
-
trailing && /* @__PURE__ */
|
|
2138
|
+
icon && /* @__PURE__ */ jsx33("span", { className: "w-[14px] text-[12px] opacity-70", children: icon }),
|
|
2139
|
+
/* @__PURE__ */ jsx33("span", { className: "flex-1", children }),
|
|
2140
|
+
trailing && /* @__PURE__ */ jsx33("span", { className: "text-text-dim font-mono text-[10px]", children: trailing })
|
|
1947
2141
|
]
|
|
1948
2142
|
}
|
|
1949
2143
|
);
|
|
1950
2144
|
});
|
|
1951
2145
|
MenuItem.displayName = "MenuItem";
|
|
1952
|
-
var MenuCheckboxItem =
|
|
2146
|
+
var MenuCheckboxItem = forwardRef32(
|
|
1953
2147
|
function MenuCheckboxItem2({ className, children, ...props }, ref) {
|
|
1954
|
-
return /* @__PURE__ */
|
|
2148
|
+
return /* @__PURE__ */ jsxs27(
|
|
1955
2149
|
RadixMenu.CheckboxItem,
|
|
1956
2150
|
{
|
|
1957
2151
|
ref,
|
|
1958
2152
|
className: cn(itemBase2, "text-text relative pl-[26px]", className),
|
|
1959
2153
|
...props,
|
|
1960
2154
|
children: [
|
|
1961
|
-
/* @__PURE__ */
|
|
2155
|
+
/* @__PURE__ */ jsx33(RadixMenu.ItemIndicator, { className: "text-accent absolute top-1/2 left-2 -translate-y-1/2 text-[10px]", children: "\u2713" }),
|
|
1962
2156
|
children
|
|
1963
2157
|
]
|
|
1964
2158
|
}
|
|
@@ -1966,9 +2160,9 @@ var MenuCheckboxItem = forwardRef31(
|
|
|
1966
2160
|
}
|
|
1967
2161
|
);
|
|
1968
2162
|
MenuCheckboxItem.displayName = "MenuCheckboxItem";
|
|
1969
|
-
var MenuSeparator =
|
|
2163
|
+
var MenuSeparator = forwardRef32(
|
|
1970
2164
|
function MenuSeparator2({ className, ...props }, ref) {
|
|
1971
|
-
return /* @__PURE__ */
|
|
2165
|
+
return /* @__PURE__ */ jsx33(
|
|
1972
2166
|
RadixMenu.Separator,
|
|
1973
2167
|
{
|
|
1974
2168
|
ref,
|
|
@@ -1983,14 +2177,14 @@ var DropdownMenu = RadixMenu.Root;
|
|
|
1983
2177
|
|
|
1984
2178
|
// src/components/HoverCard/HoverCard.tsx
|
|
1985
2179
|
import * as RadixHoverCard from "@radix-ui/react-hover-card";
|
|
1986
|
-
import { forwardRef as
|
|
1987
|
-
import { jsx as
|
|
2180
|
+
import { forwardRef as forwardRef33 } from "react";
|
|
2181
|
+
import { jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
1988
2182
|
var HoverCardRoot = RadixHoverCard.Root;
|
|
1989
2183
|
var HoverCardTrigger = RadixHoverCard.Trigger;
|
|
1990
2184
|
var HoverCardPortal = RadixHoverCard.Portal;
|
|
1991
|
-
var HoverCardContent =
|
|
2185
|
+
var HoverCardContent = forwardRef33(
|
|
1992
2186
|
function HoverCardContent2({ className, sideOffset = 4, ...props }, ref) {
|
|
1993
|
-
return /* @__PURE__ */
|
|
2187
|
+
return /* @__PURE__ */ jsx34(RadixHoverCard.Portal, { children: /* @__PURE__ */ jsx34(
|
|
1994
2188
|
RadixHoverCard.Content,
|
|
1995
2189
|
{
|
|
1996
2190
|
ref,
|
|
@@ -2007,25 +2201,25 @@ var HoverCardContent = forwardRef32(
|
|
|
2007
2201
|
);
|
|
2008
2202
|
HoverCardContent.displayName = "HoverCardContent";
|
|
2009
2203
|
function HoverCard({ trigger, content, ...rootProps }) {
|
|
2010
|
-
return /* @__PURE__ */
|
|
2011
|
-
/* @__PURE__ */
|
|
2012
|
-
/* @__PURE__ */
|
|
2204
|
+
return /* @__PURE__ */ jsxs28(RadixHoverCard.Root, { openDelay: 200, closeDelay: 120, ...rootProps, children: [
|
|
2205
|
+
/* @__PURE__ */ jsx34(RadixHoverCard.Trigger, { asChild: true, children: trigger }),
|
|
2206
|
+
/* @__PURE__ */ jsx34(HoverCardContent, { children: content })
|
|
2013
2207
|
] });
|
|
2014
2208
|
}
|
|
2015
2209
|
|
|
2016
2210
|
// src/components/Popover/Popover.tsx
|
|
2017
2211
|
import * as RadixPopover from "@radix-ui/react-popover";
|
|
2018
|
-
import { forwardRef as
|
|
2019
|
-
import { jsx as
|
|
2212
|
+
import { forwardRef as forwardRef34 } from "react";
|
|
2213
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
2020
2214
|
var PopoverRoot = RadixPopover.Root;
|
|
2021
2215
|
var PopoverTrigger = RadixPopover.Trigger;
|
|
2022
2216
|
var PopoverAnchor = RadixPopover.Anchor;
|
|
2023
2217
|
var PopoverPortal = RadixPopover.Portal;
|
|
2024
2218
|
var PopoverClose = RadixPopover.Close;
|
|
2025
2219
|
var PopoverArrow = RadixPopover.Arrow;
|
|
2026
|
-
var PopoverContent =
|
|
2220
|
+
var PopoverContent = forwardRef34(
|
|
2027
2221
|
function PopoverContent2({ className, align = "start", sideOffset = 6, ...props }, ref) {
|
|
2028
|
-
return /* @__PURE__ */
|
|
2222
|
+
return /* @__PURE__ */ jsx35(RadixPopover.Portal, { children: /* @__PURE__ */ jsx35(
|
|
2029
2223
|
RadixPopover.Content,
|
|
2030
2224
|
{
|
|
2031
2225
|
ref,
|
|
@@ -2048,13 +2242,13 @@ var Popover = RadixPopover.Root;
|
|
|
2048
2242
|
import * as RadixToast from "@radix-ui/react-toast";
|
|
2049
2243
|
import {
|
|
2050
2244
|
createContext,
|
|
2051
|
-
forwardRef as
|
|
2052
|
-
useCallback as
|
|
2245
|
+
forwardRef as forwardRef35,
|
|
2246
|
+
useCallback as useCallback7,
|
|
2053
2247
|
useContext,
|
|
2054
2248
|
useMemo,
|
|
2055
|
-
useState as
|
|
2249
|
+
useState as useState8
|
|
2056
2250
|
} from "react";
|
|
2057
|
-
import { jsx as
|
|
2251
|
+
import { jsx as jsx36, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2058
2252
|
var ToastContext = createContext(null);
|
|
2059
2253
|
var variantIcon = {
|
|
2060
2254
|
default: "\u25CF",
|
|
@@ -2080,8 +2274,8 @@ var variantBorderLeft = {
|
|
|
2080
2274
|
var toastIdCounter = 0;
|
|
2081
2275
|
var nextToastId = () => `toast-${++toastIdCounter}`;
|
|
2082
2276
|
function ToastProvider({ children }) {
|
|
2083
|
-
const [toasts, setToasts] =
|
|
2084
|
-
const toast =
|
|
2277
|
+
const [toasts, setToasts] = useState8([]);
|
|
2278
|
+
const toast = useCallback7((t) => {
|
|
2085
2279
|
const explicitId = t.id;
|
|
2086
2280
|
const id = explicitId ?? nextToastId();
|
|
2087
2281
|
const entry = { ...t, id };
|
|
@@ -2093,14 +2287,14 @@ function ToastProvider({ children }) {
|
|
|
2093
2287
|
});
|
|
2094
2288
|
return id;
|
|
2095
2289
|
}, []);
|
|
2096
|
-
const dismiss =
|
|
2290
|
+
const dismiss = useCallback7((id) => {
|
|
2097
2291
|
setToasts((prev) => prev.filter((t) => t.id !== id));
|
|
2098
2292
|
}, []);
|
|
2099
2293
|
const value = useMemo(() => ({ toast, dismiss }), [toast, dismiss]);
|
|
2100
|
-
return /* @__PURE__ */
|
|
2294
|
+
return /* @__PURE__ */ jsx36(ToastContext.Provider, { value, children: /* @__PURE__ */ jsxs29(RadixToast.Provider, { swipeDirection: "right", children: [
|
|
2101
2295
|
children,
|
|
2102
|
-
toasts.map((t) => /* @__PURE__ */
|
|
2103
|
-
/* @__PURE__ */
|
|
2296
|
+
toasts.map((t) => /* @__PURE__ */ jsx36(ToastCard, { toast: t, onDismiss: () => dismiss(t.id) }, t.id)),
|
|
2297
|
+
/* @__PURE__ */ jsx36(RadixToast.Viewport, { className: "z-toast fixed right-5 bottom-5 flex w-[380px] max-w-[calc(100vw-40px)] flex-col gap-2 outline-none" })
|
|
2104
2298
|
] }) });
|
|
2105
2299
|
}
|
|
2106
2300
|
function useToast() {
|
|
@@ -2108,9 +2302,9 @@ function useToast() {
|
|
|
2108
2302
|
if (!ctx) throw new Error("useToast must be inside <ToastProvider>");
|
|
2109
2303
|
return ctx;
|
|
2110
2304
|
}
|
|
2111
|
-
var ToastCard =
|
|
2305
|
+
var ToastCard = forwardRef35(function ToastCard2({ toast, onDismiss }, ref) {
|
|
2112
2306
|
const variant = toast.variant ?? "default";
|
|
2113
|
-
return /* @__PURE__ */
|
|
2307
|
+
return /* @__PURE__ */ jsxs29(
|
|
2114
2308
|
RadixToast.Root,
|
|
2115
2309
|
{
|
|
2116
2310
|
ref,
|
|
@@ -2125,13 +2319,13 @@ var ToastCard = forwardRef34(function ToastCard2({ toast, onDismiss }, ref) {
|
|
|
2125
2319
|
variantBorderLeft[variant]
|
|
2126
2320
|
),
|
|
2127
2321
|
children: [
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
-
/* @__PURE__ */
|
|
2130
|
-
/* @__PURE__ */
|
|
2131
|
-
toast.description && /* @__PURE__ */
|
|
2132
|
-
toast.action && /* @__PURE__ */
|
|
2322
|
+
/* @__PURE__ */ jsx36("span", { className: cn("mt-px text-[14px] leading-none", variantTextColor[variant]), children: variantIcon[variant] }),
|
|
2323
|
+
/* @__PURE__ */ jsxs29("div", { className: "min-w-0 flex-1", children: [
|
|
2324
|
+
/* @__PURE__ */ jsx36(RadixToast.Title, { className: "text-text text-[13px] font-medium", children: toast.title }),
|
|
2325
|
+
toast.description && /* @__PURE__ */ jsx36(RadixToast.Description, { className: "text-text-muted mt-[2px] text-[12px] leading-[1.5]", children: toast.description }),
|
|
2326
|
+
toast.action && /* @__PURE__ */ jsx36("div", { className: "mt-2", children: toast.action })
|
|
2133
2327
|
] }),
|
|
2134
|
-
/* @__PURE__ */
|
|
2328
|
+
/* @__PURE__ */ jsx36(
|
|
2135
2329
|
RadixToast.Close,
|
|
2136
2330
|
{
|
|
2137
2331
|
"aria-label": "Dismiss",
|
|
@@ -2147,16 +2341,16 @@ ToastCard.displayName = "ToastCard";
|
|
|
2147
2341
|
|
|
2148
2342
|
// src/components/Tooltip/Tooltip.tsx
|
|
2149
2343
|
import * as RadixTooltip from "@radix-ui/react-tooltip";
|
|
2150
|
-
import { forwardRef as
|
|
2151
|
-
import { jsx as
|
|
2344
|
+
import { forwardRef as forwardRef36 } from "react";
|
|
2345
|
+
import { jsx as jsx37, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
2152
2346
|
var TooltipProvider = RadixTooltip.Provider;
|
|
2153
2347
|
var Tooltip = RadixTooltip.Root;
|
|
2154
2348
|
var TooltipTrigger = RadixTooltip.Trigger;
|
|
2155
2349
|
var TooltipPortal = RadixTooltip.Portal;
|
|
2156
2350
|
var TooltipArrow = RadixTooltip.Arrow;
|
|
2157
|
-
var TooltipContent =
|
|
2351
|
+
var TooltipContent = forwardRef36(
|
|
2158
2352
|
function TooltipContent2({ className, sideOffset = 6, ...props }, ref) {
|
|
2159
|
-
return /* @__PURE__ */
|
|
2353
|
+
return /* @__PURE__ */ jsx37(RadixTooltip.Portal, { children: /* @__PURE__ */ jsx37(
|
|
2160
2354
|
RadixTooltip.Content,
|
|
2161
2355
|
{
|
|
2162
2356
|
ref,
|
|
@@ -2179,17 +2373,17 @@ function SimpleTooltip({
|
|
|
2179
2373
|
side = "top",
|
|
2180
2374
|
delayDuration = 400
|
|
2181
2375
|
}) {
|
|
2182
|
-
return /* @__PURE__ */
|
|
2183
|
-
/* @__PURE__ */
|
|
2184
|
-
/* @__PURE__ */
|
|
2376
|
+
return /* @__PURE__ */ jsx37(TooltipProvider, { delayDuration, children: /* @__PURE__ */ jsxs30(Tooltip, { children: [
|
|
2377
|
+
/* @__PURE__ */ jsx37(TooltipTrigger, { asChild: true, children }),
|
|
2378
|
+
/* @__PURE__ */ jsx37(TooltipContent, { side, children: content })
|
|
2185
2379
|
] }) });
|
|
2186
2380
|
}
|
|
2187
2381
|
|
|
2188
2382
|
// src/patterns/Alert/Alert.tsx
|
|
2189
|
-
import { cva as
|
|
2190
|
-
import { forwardRef as
|
|
2191
|
-
import { jsx as
|
|
2192
|
-
var alertStyles =
|
|
2383
|
+
import { cva as cva9 } from "class-variance-authority";
|
|
2384
|
+
import { forwardRef as forwardRef37 } from "react";
|
|
2385
|
+
import { jsx as jsx38, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2386
|
+
var alertStyles = cva9("flex items-start gap-3 rounded-base border bg-panel p-3 text-[13px]", {
|
|
2193
2387
|
variants: {
|
|
2194
2388
|
tone: {
|
|
2195
2389
|
accent: "border-border border-l-2 border-l-accent",
|
|
@@ -2212,7 +2406,7 @@ var defaultGlyph = {
|
|
|
2212
2406
|
warn: "!",
|
|
2213
2407
|
err: "\xD7"
|
|
2214
2408
|
};
|
|
2215
|
-
var Alert =
|
|
2409
|
+
var Alert = forwardRef37(function Alert2({
|
|
2216
2410
|
tone = "accent",
|
|
2217
2411
|
title,
|
|
2218
2412
|
description,
|
|
@@ -2224,7 +2418,7 @@ var Alert = forwardRef36(function Alert2({
|
|
|
2224
2418
|
...props
|
|
2225
2419
|
}, ref) {
|
|
2226
2420
|
const t = tone ?? "accent";
|
|
2227
|
-
return /* @__PURE__ */
|
|
2421
|
+
return /* @__PURE__ */ jsxs31(
|
|
2228
2422
|
"div",
|
|
2229
2423
|
{
|
|
2230
2424
|
ref,
|
|
@@ -2233,13 +2427,13 @@ var Alert = forwardRef36(function Alert2({
|
|
|
2233
2427
|
className: cn(alertStyles({ tone }), className),
|
|
2234
2428
|
...props,
|
|
2235
2429
|
children: [
|
|
2236
|
-
/* @__PURE__ */
|
|
2237
|
-
/* @__PURE__ */
|
|
2238
|
-
title && /* @__PURE__ */
|
|
2239
|
-
description && /* @__PURE__ */
|
|
2430
|
+
/* @__PURE__ */ jsx38("span", { "aria-hidden": true, className: cn("mt-[1px] text-[14px] leading-none", iconColorClass[t]), children: icon ?? defaultGlyph[t] }),
|
|
2431
|
+
/* @__PURE__ */ jsxs31("div", { className: "min-w-0 flex-1", children: [
|
|
2432
|
+
title && /* @__PURE__ */ jsx38("div", { className: "font-medium", children: title }),
|
|
2433
|
+
description && /* @__PURE__ */ jsx38("div", { className: "text-text-muted mt-[2px] text-[12px]", children: description }),
|
|
2240
2434
|
children
|
|
2241
2435
|
] }),
|
|
2242
|
-
action && /* @__PURE__ */
|
|
2436
|
+
action && /* @__PURE__ */ jsx38("div", { className: "ml-1 shrink-0", children: action })
|
|
2243
2437
|
]
|
|
2244
2438
|
}
|
|
2245
2439
|
);
|
|
@@ -2247,10 +2441,10 @@ var Alert = forwardRef36(function Alert2({
|
|
|
2247
2441
|
Alert.displayName = "Alert";
|
|
2248
2442
|
|
|
2249
2443
|
// src/patterns/Banner/Banner.tsx
|
|
2250
|
-
import { cva as
|
|
2251
|
-
import { forwardRef as
|
|
2252
|
-
import { jsx as
|
|
2253
|
-
var bannerStyles =
|
|
2444
|
+
import { cva as cva10 } from "class-variance-authority";
|
|
2445
|
+
import { forwardRef as forwardRef38 } from "react";
|
|
2446
|
+
import { jsx as jsx39, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
2447
|
+
var bannerStyles = cva10(
|
|
2254
2448
|
"flex items-center gap-3 border-b border-border px-[14px] py-2 text-[12px]",
|
|
2255
2449
|
{
|
|
2256
2450
|
variants: {
|
|
@@ -2274,9 +2468,9 @@ var defaultGlyph2 = {
|
|
|
2274
2468
|
warn: "!",
|
|
2275
2469
|
err: "\xD7"
|
|
2276
2470
|
};
|
|
2277
|
-
var Banner =
|
|
2471
|
+
var Banner = forwardRef38(function Banner2({ tone = "accent", sticky, icon, action, live = "polite", className, children, ...props }, ref) {
|
|
2278
2472
|
const t = tone ?? "accent";
|
|
2279
|
-
return /* @__PURE__ */
|
|
2473
|
+
return /* @__PURE__ */ jsxs32(
|
|
2280
2474
|
"div",
|
|
2281
2475
|
{
|
|
2282
2476
|
ref,
|
|
@@ -2285,9 +2479,9 @@ var Banner = forwardRef37(function Banner2({ tone = "accent", sticky, icon, acti
|
|
|
2285
2479
|
className: cn(bannerStyles({ tone, sticky }), className),
|
|
2286
2480
|
...props,
|
|
2287
2481
|
children: [
|
|
2288
|
-
/* @__PURE__ */
|
|
2289
|
-
/* @__PURE__ */
|
|
2290
|
-
action && /* @__PURE__ */
|
|
2482
|
+
/* @__PURE__ */ jsx39("span", { "aria-hidden": true, className: "leading-none", children: icon ?? defaultGlyph2[t] }),
|
|
2483
|
+
/* @__PURE__ */ jsx39("div", { className: "min-w-0 flex-1", children }),
|
|
2484
|
+
action && /* @__PURE__ */ jsx39("div", { className: "ml-auto", children: action })
|
|
2291
2485
|
]
|
|
2292
2486
|
}
|
|
2293
2487
|
);
|
|
@@ -2297,30 +2491,30 @@ Banner.displayName = "Banner";
|
|
|
2297
2491
|
// src/patterns/Breadcrumbs/Breadcrumbs.tsx
|
|
2298
2492
|
import {
|
|
2299
2493
|
Children as Children2,
|
|
2300
|
-
forwardRef as
|
|
2494
|
+
forwardRef as forwardRef39,
|
|
2301
2495
|
isValidElement as isValidElement2
|
|
2302
2496
|
} from "react";
|
|
2303
|
-
import { jsx as
|
|
2304
|
-
var Breadcrumbs =
|
|
2497
|
+
import { jsx as jsx40, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
2498
|
+
var Breadcrumbs = forwardRef39(function Breadcrumbs2({ separator = "/", className, children, ...props }, ref) {
|
|
2305
2499
|
const crumbs = Children2.toArray(children).filter(isValidElement2);
|
|
2306
2500
|
const last = crumbs.length - 1;
|
|
2307
|
-
return /* @__PURE__ */
|
|
2501
|
+
return /* @__PURE__ */ jsx40("nav", { ref, "aria-label": "Breadcrumb", className: cn("text-[13px]", className), ...props, children: /* @__PURE__ */ jsx40("ol", { className: "text-text-muted flex flex-wrap items-center gap-[6px]", children: crumbs.map((crumb, i) => {
|
|
2308
2502
|
const isCurrent = i === last;
|
|
2309
|
-
return /* @__PURE__ */
|
|
2310
|
-
isCurrent ? /* @__PURE__ */
|
|
2311
|
-
!isCurrent && /* @__PURE__ */
|
|
2503
|
+
return /* @__PURE__ */ jsxs33("li", { className: "inline-flex items-center gap-[6px]", children: [
|
|
2504
|
+
isCurrent ? /* @__PURE__ */ jsx40(Crumb, { ...crumb.props, current: true }) : crumb,
|
|
2505
|
+
!isCurrent && /* @__PURE__ */ jsx40("span", { "aria-hidden": true, className: "text-text-dim", children: separator })
|
|
2312
2506
|
] }, i);
|
|
2313
2507
|
}) }) });
|
|
2314
2508
|
});
|
|
2315
2509
|
Breadcrumbs.displayName = "Breadcrumbs";
|
|
2316
|
-
var Crumb =
|
|
2510
|
+
var Crumb = forwardRef39(function Crumb2({ current, className, href, children, ...props }, ref) {
|
|
2317
2511
|
if (current) {
|
|
2318
|
-
return /* @__PURE__ */
|
|
2512
|
+
return /* @__PURE__ */ jsx40("span", { "aria-current": "page", className: cn("text-text", className), children });
|
|
2319
2513
|
}
|
|
2320
2514
|
if (href === void 0) {
|
|
2321
|
-
return /* @__PURE__ */
|
|
2515
|
+
return /* @__PURE__ */ jsx40("span", { className: cn("text-text-dim", className), children });
|
|
2322
2516
|
}
|
|
2323
|
-
return /* @__PURE__ */
|
|
2517
|
+
return /* @__PURE__ */ jsx40(
|
|
2324
2518
|
"a",
|
|
2325
2519
|
{
|
|
2326
2520
|
ref,
|
|
@@ -2335,14 +2529,14 @@ Crumb.displayName = "Crumb";
|
|
|
2335
2529
|
|
|
2336
2530
|
// src/patterns/Combobox/Combobox.tsx
|
|
2337
2531
|
import {
|
|
2338
|
-
forwardRef as
|
|
2339
|
-
useEffect as
|
|
2532
|
+
forwardRef as forwardRef40,
|
|
2533
|
+
useEffect as useEffect6,
|
|
2340
2534
|
useId as useId6,
|
|
2341
2535
|
useMemo as useMemo2,
|
|
2342
|
-
useRef as
|
|
2343
|
-
useState as
|
|
2536
|
+
useRef as useRef5,
|
|
2537
|
+
useState as useState9
|
|
2344
2538
|
} from "react";
|
|
2345
|
-
import { jsx as
|
|
2539
|
+
import { jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
2346
2540
|
function normalize(option) {
|
|
2347
2541
|
if (typeof option === "string") {
|
|
2348
2542
|
return { value: option, label: option, searchText: option.toLowerCase() };
|
|
@@ -2358,7 +2552,7 @@ function normalize(option) {
|
|
|
2358
2552
|
};
|
|
2359
2553
|
}
|
|
2360
2554
|
var defaultFilter = (option, query) => option.searchText.includes(query.toLowerCase());
|
|
2361
|
-
var Combobox =
|
|
2555
|
+
var Combobox = forwardRef40(function Combobox2({
|
|
2362
2556
|
options,
|
|
2363
2557
|
value: valueProp,
|
|
2364
2558
|
defaultValue,
|
|
@@ -2397,8 +2591,8 @@ var Combobox = forwardRef39(function Combobox2({
|
|
|
2397
2591
|
defaultValue: initialQuery,
|
|
2398
2592
|
onChange: onQueryChange
|
|
2399
2593
|
});
|
|
2400
|
-
const [open, setOpen] =
|
|
2401
|
-
const wrapperRef =
|
|
2594
|
+
const [open, setOpen] = useState9(false);
|
|
2595
|
+
const wrapperRef = useRef5(null);
|
|
2402
2596
|
useOutsideClick(wrapperRef, () => setOpen(false));
|
|
2403
2597
|
const filtered = useMemo2(
|
|
2404
2598
|
() => query ? normalized.filter((o) => filter(o, query)) : normalized,
|
|
@@ -2412,7 +2606,7 @@ var Combobox = forwardRef39(function Combobox2({
|
|
|
2412
2606
|
if (item && !item.disabled) commit(item);
|
|
2413
2607
|
}
|
|
2414
2608
|
});
|
|
2415
|
-
|
|
2609
|
+
useEffect6(() => {
|
|
2416
2610
|
setCursor(0);
|
|
2417
2611
|
}, [query, setCursor]);
|
|
2418
2612
|
function commit(option) {
|
|
@@ -2435,8 +2629,8 @@ var Combobox = forwardRef39(function Combobox2({
|
|
|
2435
2629
|
setOpen(false);
|
|
2436
2630
|
}
|
|
2437
2631
|
};
|
|
2438
|
-
return /* @__PURE__ */
|
|
2439
|
-
/* @__PURE__ */
|
|
2632
|
+
return /* @__PURE__ */ jsxs34("div", { ref: wrapperRef, className: "relative", style: { width }, children: [
|
|
2633
|
+
/* @__PURE__ */ jsx41(
|
|
2440
2634
|
"input",
|
|
2441
2635
|
{
|
|
2442
2636
|
ref,
|
|
@@ -2470,7 +2664,7 @@ var Combobox = forwardRef39(function Combobox2({
|
|
|
2470
2664
|
)
|
|
2471
2665
|
}
|
|
2472
2666
|
),
|
|
2473
|
-
open && /* @__PURE__ */
|
|
2667
|
+
open && /* @__PURE__ */ jsx41(
|
|
2474
2668
|
"ul",
|
|
2475
2669
|
{
|
|
2476
2670
|
id: listboxId,
|
|
@@ -2480,9 +2674,9 @@ var Combobox = forwardRef39(function Combobox2({
|
|
|
2480
2674
|
"z-dropdown absolute top-full right-0 left-0 mt-1 max-h-[220px] overflow-auto",
|
|
2481
2675
|
"border-border bg-panel rounded-md border p-1 shadow-lg"
|
|
2482
2676
|
),
|
|
2483
|
-
children: filtered.length === 0 ? /* @__PURE__ */
|
|
2677
|
+
children: filtered.length === 0 ? /* @__PURE__ */ jsx41("li", { className: "text-text-dim px-2 py-3 text-center text-[12px]", role: "presentation", children: emptyState ?? "No matches" }) : filtered.map((option, i) => {
|
|
2484
2678
|
const isActive = i === cursor;
|
|
2485
|
-
return /* @__PURE__ */
|
|
2679
|
+
return /* @__PURE__ */ jsxs34(
|
|
2486
2680
|
"li",
|
|
2487
2681
|
{
|
|
2488
2682
|
id: `${listboxId}-option-${i}`,
|
|
@@ -2500,8 +2694,8 @@ var Combobox = forwardRef39(function Combobox2({
|
|
|
2500
2694
|
option.disabled && "pointer-events-none opacity-40"
|
|
2501
2695
|
),
|
|
2502
2696
|
children: [
|
|
2503
|
-
/* @__PURE__ */
|
|
2504
|
-
option.description && /* @__PURE__ */
|
|
2697
|
+
/* @__PURE__ */ jsx41("div", { children: option.label }),
|
|
2698
|
+
option.description && /* @__PURE__ */ jsx41("div", { className: "text-text-dim text-[11px]", children: option.description })
|
|
2505
2699
|
]
|
|
2506
2700
|
},
|
|
2507
2701
|
option.value
|
|
@@ -2509,19 +2703,19 @@ var Combobox = forwardRef39(function Combobox2({
|
|
|
2509
2703
|
})
|
|
2510
2704
|
}
|
|
2511
2705
|
),
|
|
2512
|
-
name && /* @__PURE__ */
|
|
2706
|
+
name && /* @__PURE__ */ jsx41("input", { type: "hidden", name, value: value ?? "", readOnly: true })
|
|
2513
2707
|
] });
|
|
2514
2708
|
});
|
|
2515
2709
|
Combobox.displayName = "Combobox";
|
|
2516
2710
|
|
|
2517
2711
|
// src/patterns/CommandPalette/CommandPalette.tsx
|
|
2518
2712
|
import * as RadixDialog4 from "@radix-ui/react-dialog";
|
|
2519
|
-
import { forwardRef as
|
|
2520
|
-
import { Fragment, jsx as
|
|
2713
|
+
import { forwardRef as forwardRef41, useEffect as useEffect7, useId as useId7, useMemo as useMemo3 } from "react";
|
|
2714
|
+
import { Fragment, jsx as jsx42, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
2521
2715
|
function flatItems(groups) {
|
|
2522
2716
|
return groups.flatMap((g) => g.items);
|
|
2523
2717
|
}
|
|
2524
|
-
var CommandPalette =
|
|
2718
|
+
var CommandPalette = forwardRef41(
|
|
2525
2719
|
function CommandPalette2({
|
|
2526
2720
|
open,
|
|
2527
2721
|
onOpenChange,
|
|
@@ -2547,11 +2741,11 @@ var CommandPalette = forwardRef40(
|
|
|
2547
2741
|
const listboxId = `${reactId}-listbox`;
|
|
2548
2742
|
const optionId = (i) => `${listboxId}-option-${i}`;
|
|
2549
2743
|
const hasMatches = flat.length > 0;
|
|
2550
|
-
|
|
2744
|
+
useEffect7(() => {
|
|
2551
2745
|
setCursor(0);
|
|
2552
2746
|
}, [query, groups, setCursor]);
|
|
2553
|
-
return /* @__PURE__ */
|
|
2554
|
-
/* @__PURE__ */
|
|
2747
|
+
return /* @__PURE__ */ jsx42(RadixDialog4.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxs35(RadixDialog4.Portal, { children: [
|
|
2748
|
+
/* @__PURE__ */ jsx42(
|
|
2555
2749
|
RadixDialog4.Overlay,
|
|
2556
2750
|
{
|
|
2557
2751
|
className: cn(
|
|
@@ -2560,7 +2754,7 @@ var CommandPalette = forwardRef40(
|
|
|
2560
2754
|
)
|
|
2561
2755
|
}
|
|
2562
2756
|
),
|
|
2563
|
-
/* @__PURE__ */
|
|
2757
|
+
/* @__PURE__ */ jsxs35(
|
|
2564
2758
|
RadixDialog4.Content,
|
|
2565
2759
|
{
|
|
2566
2760
|
ref,
|
|
@@ -2574,10 +2768,10 @@ var CommandPalette = forwardRef40(
|
|
|
2574
2768
|
),
|
|
2575
2769
|
onKeyDown,
|
|
2576
2770
|
children: [
|
|
2577
|
-
/* @__PURE__ */
|
|
2578
|
-
/* @__PURE__ */
|
|
2579
|
-
/* @__PURE__ */
|
|
2580
|
-
/* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ jsx42(RadixDialog4.Title, { className: "sr-only", children: "Command palette" }),
|
|
2772
|
+
/* @__PURE__ */ jsxs35("div", { className: "border-border flex items-center gap-[10px] border-b px-4 py-[14px]", children: [
|
|
2773
|
+
/* @__PURE__ */ jsx42("span", { "aria-hidden": true, className: "text-text-dim", children: "\u2315" }),
|
|
2774
|
+
/* @__PURE__ */ jsx42(
|
|
2581
2775
|
"input",
|
|
2582
2776
|
{
|
|
2583
2777
|
autoFocus: true,
|
|
@@ -2594,9 +2788,9 @@ var CommandPalette = forwardRef40(
|
|
|
2594
2788
|
className: "text-text placeholder:text-text-dim flex-1 border-0 bg-transparent text-[14px] outline-none"
|
|
2595
2789
|
}
|
|
2596
2790
|
),
|
|
2597
|
-
/* @__PURE__ */
|
|
2791
|
+
/* @__PURE__ */ jsx42("span", { className: "border-border text-text-dim rounded-xs border px-[6px] py-[2px] font-mono text-[10px]", children: "ESC" })
|
|
2598
2792
|
] }),
|
|
2599
|
-
/* @__PURE__ */
|
|
2793
|
+
/* @__PURE__ */ jsx42("div", { id: listboxId, className: "min-h-[220px] p-2", role: "listbox", "aria-label": "Results", children: flat.length === 0 ? emptyState ?? /* @__PURE__ */ jsx42("div", { className: "text-text-dim px-3 py-5 text-center text-[12px]", children: "No matches" }) : /* @__PURE__ */ jsx42(
|
|
2600
2794
|
CommandGroups,
|
|
2601
2795
|
{
|
|
2602
2796
|
groups,
|
|
@@ -2606,7 +2800,7 @@ var CommandPalette = forwardRef40(
|
|
|
2606
2800
|
optionId
|
|
2607
2801
|
}
|
|
2608
2802
|
) }),
|
|
2609
|
-
footer && /* @__PURE__ */
|
|
2803
|
+
footer && /* @__PURE__ */ jsx42("div", { className: "border-border text-text-dim flex gap-4 border-t px-[14px] py-[10px] font-mono text-[10px]", children: footer })
|
|
2610
2804
|
]
|
|
2611
2805
|
}
|
|
2612
2806
|
)
|
|
@@ -2616,10 +2810,10 @@ var CommandPalette = forwardRef40(
|
|
|
2616
2810
|
CommandPalette.displayName = "CommandPalette";
|
|
2617
2811
|
function CommandGroups({ groups, cursor, setCursor, onSelect, optionId }) {
|
|
2618
2812
|
let runningIndex = 0;
|
|
2619
|
-
return /* @__PURE__ */
|
|
2813
|
+
return /* @__PURE__ */ jsx42(Fragment, { children: groups.map((group, gIdx) => {
|
|
2620
2814
|
if (group.items.length === 0) return null;
|
|
2621
|
-
return /* @__PURE__ */
|
|
2622
|
-
group.label && /* @__PURE__ */
|
|
2815
|
+
return /* @__PURE__ */ jsxs35("div", { children: [
|
|
2816
|
+
group.label && /* @__PURE__ */ jsxs35("div", { className: "text-text-dim px-2 pt-2 pb-1 font-mono text-[9px] tracking-[1.4px] uppercase", children: [
|
|
2623
2817
|
group.label,
|
|
2624
2818
|
" \xB7 ",
|
|
2625
2819
|
group.items.length
|
|
@@ -2627,7 +2821,7 @@ function CommandGroups({ groups, cursor, setCursor, onSelect, optionId }) {
|
|
|
2627
2821
|
group.items.map((item) => {
|
|
2628
2822
|
const myIndex = runningIndex++;
|
|
2629
2823
|
const isActive = cursor === myIndex;
|
|
2630
|
-
return /* @__PURE__ */
|
|
2824
|
+
return /* @__PURE__ */ jsxs35(
|
|
2631
2825
|
"button",
|
|
2632
2826
|
{
|
|
2633
2827
|
id: optionId(myIndex),
|
|
@@ -2641,7 +2835,7 @@ function CommandGroups({ groups, cursor, setCursor, onSelect, optionId }) {
|
|
|
2641
2835
|
isActive ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2"
|
|
2642
2836
|
),
|
|
2643
2837
|
children: [
|
|
2644
|
-
item.glyph != null && /* @__PURE__ */
|
|
2838
|
+
item.glyph != null && /* @__PURE__ */ jsx42(
|
|
2645
2839
|
"span",
|
|
2646
2840
|
{
|
|
2647
2841
|
"aria-hidden": true,
|
|
@@ -2652,11 +2846,11 @@ function CommandGroups({ groups, cursor, setCursor, onSelect, optionId }) {
|
|
|
2652
2846
|
children: item.glyph
|
|
2653
2847
|
}
|
|
2654
2848
|
),
|
|
2655
|
-
/* @__PURE__ */
|
|
2656
|
-
/* @__PURE__ */
|
|
2657
|
-
item.description && /* @__PURE__ */
|
|
2849
|
+
/* @__PURE__ */ jsxs35("span", { className: "min-w-0 flex-1", children: [
|
|
2850
|
+
/* @__PURE__ */ jsx42("span", { className: "block truncate text-[13px]", children: item.label }),
|
|
2851
|
+
item.description && /* @__PURE__ */ jsx42("span", { className: "text-text-dim block truncate text-[11px]", children: item.description })
|
|
2658
2852
|
] }),
|
|
2659
|
-
item.trailing && /* @__PURE__ */
|
|
2853
|
+
item.trailing && /* @__PURE__ */ jsx42("span", { className: "text-text-dim font-mono text-[10px]", children: item.trailing })
|
|
2660
2854
|
]
|
|
2661
2855
|
},
|
|
2662
2856
|
item.id
|
|
@@ -2678,8 +2872,8 @@ function filterCommandItems(query, groups) {
|
|
|
2678
2872
|
}
|
|
2679
2873
|
|
|
2680
2874
|
// src/patterns/DataTable/DataTable.tsx
|
|
2681
|
-
import { useEffect as
|
|
2682
|
-
import { jsx as
|
|
2875
|
+
import { useEffect as useEffect8, useMemo as useMemo4, useRef as useRef6 } from "react";
|
|
2876
|
+
import { jsx as jsx43, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
2683
2877
|
var alignClass = {
|
|
2684
2878
|
left: "text-left",
|
|
2685
2879
|
right: "text-right",
|
|
@@ -2735,8 +2929,8 @@ function DataTable(props) {
|
|
|
2735
2929
|
const selectedSet = selected ?? EMPTY_SET;
|
|
2736
2930
|
const allSelected = allIds.length > 0 && allIds.every((id) => selectedSet.has(id));
|
|
2737
2931
|
const someSelected = !allSelected && allIds.some((id) => selectedSet.has(id));
|
|
2738
|
-
const headerCheckRef =
|
|
2739
|
-
|
|
2932
|
+
const headerCheckRef = useRef6(null);
|
|
2933
|
+
useEffect8(() => {
|
|
2740
2934
|
if (headerCheckRef.current) headerCheckRef.current.indeterminate = someSelected;
|
|
2741
2935
|
}, [someSelected]);
|
|
2742
2936
|
const toggleSort = (key) => {
|
|
@@ -2767,10 +2961,10 @@ function DataTable(props) {
|
|
|
2767
2961
|
return next;
|
|
2768
2962
|
});
|
|
2769
2963
|
};
|
|
2770
|
-
return /* @__PURE__ */
|
|
2771
|
-
caption && /* @__PURE__ */
|
|
2772
|
-
/* @__PURE__ */
|
|
2773
|
-
selectable && /* @__PURE__ */
|
|
2964
|
+
return /* @__PURE__ */ jsxs36("table", { ref, className: cn("w-full border-collapse text-[12px]", className), children: [
|
|
2965
|
+
caption && /* @__PURE__ */ jsx43("caption", { className: "sr-only", children: caption }),
|
|
2966
|
+
/* @__PURE__ */ jsx43("thead", { className: cn("bg-panel-2", stickyHeader && "z-raised sticky top-0"), children: /* @__PURE__ */ jsxs36("tr", { children: [
|
|
2967
|
+
selectable && /* @__PURE__ */ jsx43("th", { scope: "col", className: "border-border w-8 border-b px-3 py-2 text-left", children: /* @__PURE__ */ jsx43(
|
|
2774
2968
|
"input",
|
|
2775
2969
|
{
|
|
2776
2970
|
ref: headerCheckRef,
|
|
@@ -2786,8 +2980,8 @@ function DataTable(props) {
|
|
|
2786
2980
|
const isSorted = sort?.key === col.key;
|
|
2787
2981
|
const ariaSort = !sortable ? void 0 : isSorted ? sort?.direction === "asc" ? "ascending" : "descending" : "none";
|
|
2788
2982
|
const align = col.align ?? "left";
|
|
2789
|
-
const indicator = sortable && isSorted && /* @__PURE__ */
|
|
2790
|
-
return /* @__PURE__ */
|
|
2983
|
+
const indicator = sortable && isSorted && /* @__PURE__ */ jsx43("span", { "aria-hidden": true, className: "ml-1", children: sort?.direction === "asc" ? "\u2191" : "\u2193" });
|
|
2984
|
+
return /* @__PURE__ */ jsx43(
|
|
2791
2985
|
"th",
|
|
2792
2986
|
{
|
|
2793
2987
|
scope: "col",
|
|
@@ -2799,7 +2993,7 @@ function DataTable(props) {
|
|
|
2799
2993
|
sortable && "cursor-pointer",
|
|
2800
2994
|
isSorted ? "text-accent" : "text-text-dim"
|
|
2801
2995
|
),
|
|
2802
|
-
children: sortable ? /* @__PURE__ */
|
|
2996
|
+
children: sortable ? /* @__PURE__ */ jsxs36(
|
|
2803
2997
|
"button",
|
|
2804
2998
|
{
|
|
2805
2999
|
type: "button",
|
|
@@ -2816,8 +3010,8 @@ function DataTable(props) {
|
|
|
2816
3010
|
);
|
|
2817
3011
|
})
|
|
2818
3012
|
] }) }),
|
|
2819
|
-
/* @__PURE__ */
|
|
2820
|
-
sortedData.length === 0 && /* @__PURE__ */
|
|
3013
|
+
/* @__PURE__ */ jsxs36("tbody", { children: [
|
|
3014
|
+
sortedData.length === 0 && /* @__PURE__ */ jsx43("tr", { children: /* @__PURE__ */ jsx43(
|
|
2821
3015
|
"td",
|
|
2822
3016
|
{
|
|
2823
3017
|
colSpan: columns.length + (selectable ? 1 : 0),
|
|
@@ -2828,7 +3022,7 @@ function DataTable(props) {
|
|
|
2828
3022
|
sortedData.map((row) => {
|
|
2829
3023
|
const id = rowKey(row);
|
|
2830
3024
|
const isSelected = selectedSet.has(id);
|
|
2831
|
-
return /* @__PURE__ */
|
|
3025
|
+
return /* @__PURE__ */ jsxs36(
|
|
2832
3026
|
"tr",
|
|
2833
3027
|
{
|
|
2834
3028
|
"data-state": isSelected ? "selected" : void 0,
|
|
@@ -2837,7 +3031,7 @@ function DataTable(props) {
|
|
|
2837
3031
|
isSelected ? "bg-accent-dim/50" : "hover:bg-panel-2"
|
|
2838
3032
|
),
|
|
2839
3033
|
children: [
|
|
2840
|
-
selectable && /* @__PURE__ */
|
|
3034
|
+
selectable && /* @__PURE__ */ jsx43("td", { className: "px-3 py-[10px]", children: /* @__PURE__ */ jsx43(
|
|
2841
3035
|
"input",
|
|
2842
3036
|
{
|
|
2843
3037
|
type: "checkbox",
|
|
@@ -2847,7 +3041,7 @@ function DataTable(props) {
|
|
|
2847
3041
|
className: "cursor-pointer accent-[var(--color-accent)]"
|
|
2848
3042
|
}
|
|
2849
3043
|
) }),
|
|
2850
|
-
columns.map((col) => /* @__PURE__ */
|
|
3044
|
+
columns.map((col) => /* @__PURE__ */ jsx43("td", { className: cn("px-3 py-[10px]", alignClass[col.align ?? "left"]), children: col.cell ? col.cell(row) : col.accessor ? String(col.accessor(row)) : null }, col.key))
|
|
2851
3045
|
]
|
|
2852
3046
|
},
|
|
2853
3047
|
id
|
|
@@ -2859,13 +3053,13 @@ function DataTable(props) {
|
|
|
2859
3053
|
|
|
2860
3054
|
// src/patterns/DatePicker/Calendar.tsx
|
|
2861
3055
|
import {
|
|
2862
|
-
forwardRef as
|
|
2863
|
-
useCallback as
|
|
2864
|
-
useEffect as
|
|
2865
|
-
useRef as
|
|
2866
|
-
useState as
|
|
3056
|
+
forwardRef as forwardRef42,
|
|
3057
|
+
useCallback as useCallback8,
|
|
3058
|
+
useEffect as useEffect9,
|
|
3059
|
+
useRef as useRef7,
|
|
3060
|
+
useState as useState10
|
|
2867
3061
|
} from "react";
|
|
2868
|
-
import { jsx as
|
|
3062
|
+
import { jsx as jsx44, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
2869
3063
|
var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
2870
3064
|
var DAYS = ["S", "M", "T", "W", "T", "F", "S"];
|
|
2871
3065
|
function isSameDay(a, b) {
|
|
@@ -2876,7 +3070,7 @@ function clampDay(year, month, day) {
|
|
|
2876
3070
|
const max = new Date(year, month + 1, 0).getDate();
|
|
2877
3071
|
return Math.min(Math.max(1, day), max);
|
|
2878
3072
|
}
|
|
2879
|
-
var Calendar =
|
|
3073
|
+
var Calendar = forwardRef42(function Calendar2({
|
|
2880
3074
|
value,
|
|
2881
3075
|
defaultValue,
|
|
2882
3076
|
onValueChange,
|
|
@@ -2889,9 +3083,9 @@ var Calendar = forwardRef41(function Calendar2({
|
|
|
2889
3083
|
className,
|
|
2890
3084
|
...props
|
|
2891
3085
|
}, ref) {
|
|
2892
|
-
const [today] =
|
|
2893
|
-
const [hydrated, setHydrated] =
|
|
2894
|
-
|
|
3086
|
+
const [today] = useState10(() => /* @__PURE__ */ new Date());
|
|
3087
|
+
const [hydrated, setHydrated] = useState10(false);
|
|
3088
|
+
useEffect9(() => setHydrated(true), []);
|
|
2895
3089
|
const [selectedDate, setSelectedDate] = useControllableState({
|
|
2896
3090
|
value,
|
|
2897
3091
|
defaultValue,
|
|
@@ -2899,12 +3093,12 @@ var Calendar = forwardRef41(function Calendar2({
|
|
|
2899
3093
|
});
|
|
2900
3094
|
const initialMonth = defaultMonth ?? defaultValue?.getMonth() ?? today.getMonth();
|
|
2901
3095
|
const initialYear = defaultYear ?? defaultValue?.getFullYear() ?? today.getFullYear();
|
|
2902
|
-
const [internalMonth, setInternalMonth] =
|
|
2903
|
-
const [internalYear, setInternalYear] =
|
|
3096
|
+
const [internalMonth, setInternalMonth] = useState10(initialMonth);
|
|
3097
|
+
const [internalYear, setInternalYear] = useState10(initialYear);
|
|
2904
3098
|
const month = monthProp ?? internalMonth;
|
|
2905
3099
|
const year = yearProp ?? internalYear;
|
|
2906
3100
|
const isControlled = monthProp !== void 0 && yearProp !== void 0;
|
|
2907
|
-
const setVisible =
|
|
3101
|
+
const setVisible = useCallback8(
|
|
2908
3102
|
(m, y) => {
|
|
2909
3103
|
if (!isControlled) {
|
|
2910
3104
|
setInternalMonth(m);
|
|
@@ -2914,36 +3108,36 @@ var Calendar = forwardRef41(function Calendar2({
|
|
|
2914
3108
|
},
|
|
2915
3109
|
[isControlled, onVisibleMonthChange]
|
|
2916
3110
|
);
|
|
2917
|
-
const goPrev =
|
|
3111
|
+
const goPrev = useCallback8(() => {
|
|
2918
3112
|
const m = month === 0 ? 11 : month - 1;
|
|
2919
3113
|
const y = month === 0 ? year - 1 : year;
|
|
2920
3114
|
setVisible(m, y);
|
|
2921
3115
|
}, [month, year, setVisible]);
|
|
2922
|
-
const goNext =
|
|
3116
|
+
const goNext = useCallback8(() => {
|
|
2923
3117
|
const m = month === 11 ? 0 : month + 1;
|
|
2924
3118
|
const y = month === 11 ? year + 1 : year;
|
|
2925
3119
|
setVisible(m, y);
|
|
2926
3120
|
}, [month, year, setVisible]);
|
|
2927
3121
|
const daysInMonth = new Date(year, month + 1, 0).getDate();
|
|
2928
3122
|
const firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
2929
|
-
const [focusedDate, setFocusedDate] =
|
|
3123
|
+
const [focusedDate, setFocusedDate] = useState10(() => {
|
|
2930
3124
|
if (selectedDate) return selectedDate;
|
|
2931
3125
|
return new Date(initialYear, initialMonth, 1);
|
|
2932
3126
|
});
|
|
2933
|
-
|
|
3127
|
+
useEffect9(() => {
|
|
2934
3128
|
if (selectedDate) setFocusedDate(selectedDate);
|
|
2935
3129
|
}, [selectedDate]);
|
|
2936
3130
|
const focusedInVisibleMonth = focusedDate.getMonth() === month && focusedDate.getFullYear() === year;
|
|
2937
3131
|
const effectiveFocusDay = focusedInVisibleMonth ? focusedDate.getDate() : clampDay(year, month, focusedDate.getDate());
|
|
2938
|
-
const dayRefs =
|
|
2939
|
-
const shouldFocusRef =
|
|
2940
|
-
|
|
3132
|
+
const dayRefs = useRef7(/* @__PURE__ */ new Map());
|
|
3133
|
+
const shouldFocusRef = useRef7(false);
|
|
3134
|
+
useEffect9(() => {
|
|
2941
3135
|
if (!shouldFocusRef.current) return;
|
|
2942
3136
|
shouldFocusRef.current = false;
|
|
2943
3137
|
const node = dayRefs.current.get(effectiveFocusDay);
|
|
2944
3138
|
node?.focus();
|
|
2945
3139
|
}, [effectiveFocusDay, month, year]);
|
|
2946
|
-
const moveFocus =
|
|
3140
|
+
const moveFocus = useCallback8(
|
|
2947
3141
|
(next) => {
|
|
2948
3142
|
setFocusedDate(next);
|
|
2949
3143
|
shouldFocusRef.current = true;
|
|
@@ -2955,7 +3149,7 @@ var Calendar = forwardRef41(function Calendar2({
|
|
|
2955
3149
|
},
|
|
2956
3150
|
[month, year, setVisible]
|
|
2957
3151
|
);
|
|
2958
|
-
const onCellKeyDown =
|
|
3152
|
+
const onCellKeyDown = useCallback8(
|
|
2959
3153
|
(e, day) => {
|
|
2960
3154
|
const current = new Date(year, month, day);
|
|
2961
3155
|
let next = null;
|
|
@@ -3007,7 +3201,7 @@ var Calendar = forwardRef41(function Calendar2({
|
|
|
3007
3201
|
},
|
|
3008
3202
|
[month, year, moveFocus]
|
|
3009
3203
|
);
|
|
3010
|
-
return /* @__PURE__ */
|
|
3204
|
+
return /* @__PURE__ */ jsxs37(
|
|
3011
3205
|
"div",
|
|
3012
3206
|
{
|
|
3013
3207
|
ref,
|
|
@@ -3019,14 +3213,14 @@ var Calendar = forwardRef41(function Calendar2({
|
|
|
3019
3213
|
),
|
|
3020
3214
|
...props,
|
|
3021
3215
|
children: [
|
|
3022
|
-
/* @__PURE__ */
|
|
3023
|
-
/* @__PURE__ */
|
|
3216
|
+
/* @__PURE__ */ jsxs37("div", { className: "mb-3 flex items-center justify-between", children: [
|
|
3217
|
+
/* @__PURE__ */ jsxs37("span", { className: "text-[13px] font-medium", "aria-live": "polite", children: [
|
|
3024
3218
|
MONTHS[month],
|
|
3025
3219
|
" ",
|
|
3026
3220
|
year
|
|
3027
3221
|
] }),
|
|
3028
|
-
/* @__PURE__ */
|
|
3029
|
-
/* @__PURE__ */
|
|
3222
|
+
/* @__PURE__ */ jsxs37("div", { className: "flex gap-1", children: [
|
|
3223
|
+
/* @__PURE__ */ jsx44(
|
|
3030
3224
|
IconButton,
|
|
3031
3225
|
{
|
|
3032
3226
|
size: "sm",
|
|
@@ -3036,11 +3230,11 @@ var Calendar = forwardRef41(function Calendar2({
|
|
|
3036
3230
|
onClick: goPrev
|
|
3037
3231
|
}
|
|
3038
3232
|
),
|
|
3039
|
-
/* @__PURE__ */
|
|
3233
|
+
/* @__PURE__ */ jsx44(IconButton, { size: "sm", variant: "ghost", icon: "\u203A", "aria-label": "Next month", onClick: goNext })
|
|
3040
3234
|
] })
|
|
3041
3235
|
] }),
|
|
3042
|
-
/* @__PURE__ */
|
|
3043
|
-
/* @__PURE__ */
|
|
3236
|
+
/* @__PURE__ */ jsxs37("div", { role: "grid", "aria-label": `${MONTHS[month]} ${year}`, className: "flex flex-col gap-[2px]", children: [
|
|
3237
|
+
/* @__PURE__ */ jsx44("div", { role: "row", className: "grid grid-cols-7 gap-[2px]", children: DAYS.map((d, i) => /* @__PURE__ */ jsx44(
|
|
3044
3238
|
"div",
|
|
3045
3239
|
{
|
|
3046
3240
|
role: "columnheader",
|
|
@@ -3060,7 +3254,7 @@ var Calendar = forwardRef41(function Calendar2({
|
|
|
3060
3254
|
const cellIndex = r * 7 + c;
|
|
3061
3255
|
const dayNum = cellIndex - firstDayOfMonth + 1;
|
|
3062
3256
|
if (dayNum < 1 || dayNum > daysInMonth) {
|
|
3063
|
-
cells.push(/* @__PURE__ */
|
|
3257
|
+
cells.push(/* @__PURE__ */ jsx44("div", { role: "gridcell", "aria-hidden": true }, `pad-${r}-${c}`));
|
|
3064
3258
|
continue;
|
|
3065
3259
|
}
|
|
3066
3260
|
const date = new Date(year, month, dayNum);
|
|
@@ -3070,7 +3264,7 @@ var Calendar = forwardRef41(function Calendar2({
|
|
|
3070
3264
|
const isFocused = dayNum === effectiveFocusDay;
|
|
3071
3265
|
const day = dayNum;
|
|
3072
3266
|
cells.push(
|
|
3073
|
-
/* @__PURE__ */
|
|
3267
|
+
/* @__PURE__ */ jsx44("div", { role: "gridcell", "aria-selected": isSelected, children: /* @__PURE__ */ jsx44(
|
|
3074
3268
|
"button",
|
|
3075
3269
|
{
|
|
3076
3270
|
ref: (node) => {
|
|
@@ -3101,7 +3295,7 @@ var Calendar = forwardRef41(function Calendar2({
|
|
|
3101
3295
|
);
|
|
3102
3296
|
}
|
|
3103
3297
|
rows.push(
|
|
3104
|
-
/* @__PURE__ */
|
|
3298
|
+
/* @__PURE__ */ jsx44("div", { role: "row", className: "grid grid-cols-7 gap-[2px]", children: cells }, `row-${r}`)
|
|
3105
3299
|
);
|
|
3106
3300
|
}
|
|
3107
3301
|
return rows;
|
|
@@ -3115,10 +3309,10 @@ Calendar.displayName = "Calendar";
|
|
|
3115
3309
|
|
|
3116
3310
|
// src/patterns/DatePicker/DatePicker.tsx
|
|
3117
3311
|
import * as RadixPopover2 from "@radix-ui/react-popover";
|
|
3118
|
-
import { forwardRef as
|
|
3119
|
-
import { jsx as
|
|
3312
|
+
import { forwardRef as forwardRef43, useState as useState11 } from "react";
|
|
3313
|
+
import { jsx as jsx45, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
3120
3314
|
var defaultFormat = (d) => d.toLocaleDateString();
|
|
3121
|
-
var DatePicker =
|
|
3315
|
+
var DatePicker = forwardRef43(function DatePicker2({
|
|
3122
3316
|
value: valueProp,
|
|
3123
3317
|
defaultValue,
|
|
3124
3318
|
onValueChange,
|
|
@@ -3132,14 +3326,14 @@ var DatePicker = forwardRef42(function DatePicker2({
|
|
|
3132
3326
|
id,
|
|
3133
3327
|
name
|
|
3134
3328
|
}, ref) {
|
|
3135
|
-
const [open, setOpen] =
|
|
3329
|
+
const [open, setOpen] = useState11(false);
|
|
3136
3330
|
const [value, setValue] = useControllableState({
|
|
3137
3331
|
value: valueProp,
|
|
3138
3332
|
defaultValue,
|
|
3139
3333
|
onChange: onValueChange
|
|
3140
3334
|
});
|
|
3141
|
-
return /* @__PURE__ */
|
|
3142
|
-
/* @__PURE__ */
|
|
3335
|
+
return /* @__PURE__ */ jsxs38(RadixPopover2.Root, { open, onOpenChange: setOpen, children: [
|
|
3336
|
+
/* @__PURE__ */ jsx45(RadixPopover2.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs38(
|
|
3143
3337
|
"button",
|
|
3144
3338
|
{
|
|
3145
3339
|
ref,
|
|
@@ -3156,18 +3350,18 @@ var DatePicker = forwardRef42(function DatePicker2({
|
|
|
3156
3350
|
),
|
|
3157
3351
|
style: { width },
|
|
3158
3352
|
children: [
|
|
3159
|
-
/* @__PURE__ */
|
|
3160
|
-
/* @__PURE__ */
|
|
3353
|
+
/* @__PURE__ */ jsx45("span", { "aria-hidden": true, className: "text-text-dim", children: "\u25A2" }),
|
|
3354
|
+
/* @__PURE__ */ jsx45("span", { className: cn("flex-1 truncate", !value && "text-text-dim"), children: value ? format(value) : emptyLabel ?? placeholder })
|
|
3161
3355
|
]
|
|
3162
3356
|
}
|
|
3163
3357
|
) }),
|
|
3164
|
-
/* @__PURE__ */
|
|
3358
|
+
/* @__PURE__ */ jsx45(RadixPopover2.Portal, { children: /* @__PURE__ */ jsx45(
|
|
3165
3359
|
RadixPopover2.Content,
|
|
3166
3360
|
{
|
|
3167
3361
|
align: "start",
|
|
3168
3362
|
sideOffset: 6,
|
|
3169
3363
|
className: "z-popover outline-none data-[state=open]:animate-[ship-pop-in_140ms_var(--easing-out)]",
|
|
3170
|
-
children: /* @__PURE__ */
|
|
3364
|
+
children: /* @__PURE__ */ jsx45(
|
|
3171
3365
|
Calendar,
|
|
3172
3366
|
{
|
|
3173
3367
|
value,
|
|
@@ -3182,17 +3376,17 @@ var DatePicker = forwardRef42(function DatePicker2({
|
|
|
3182
3376
|
)
|
|
3183
3377
|
}
|
|
3184
3378
|
) }),
|
|
3185
|
-
name && /* @__PURE__ */
|
|
3379
|
+
name && /* @__PURE__ */ jsx45("input", { type: "hidden", name, value: value ? value.toISOString() : "", readOnly: true })
|
|
3186
3380
|
] });
|
|
3187
3381
|
});
|
|
3188
3382
|
DatePicker.displayName = "DatePicker";
|
|
3189
3383
|
|
|
3190
3384
|
// src/patterns/Dots/Dots.tsx
|
|
3191
|
-
import { forwardRef as
|
|
3192
|
-
import { jsx as
|
|
3193
|
-
var Dots =
|
|
3385
|
+
import { forwardRef as forwardRef44 } from "react";
|
|
3386
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
3387
|
+
var Dots = forwardRef44(function Dots2({ total, current, onChange, className, "aria-label": ariaLabel = "Progress", ...props }, ref) {
|
|
3194
3388
|
const interactive = typeof onChange === "function";
|
|
3195
|
-
return /* @__PURE__ */
|
|
3389
|
+
return /* @__PURE__ */ jsx46(
|
|
3196
3390
|
"nav",
|
|
3197
3391
|
{
|
|
3198
3392
|
ref,
|
|
@@ -3206,7 +3400,7 @@ var Dots = forwardRef43(function Dots2({ total, current, onChange, className, "a
|
|
|
3206
3400
|
isActive ? "w-[18px] bg-accent" : "w-[6px] bg-panel-2"
|
|
3207
3401
|
);
|
|
3208
3402
|
if (interactive) {
|
|
3209
|
-
return /* @__PURE__ */
|
|
3403
|
+
return /* @__PURE__ */ jsx46(
|
|
3210
3404
|
"button",
|
|
3211
3405
|
{
|
|
3212
3406
|
type: "button",
|
|
@@ -3223,7 +3417,7 @@ var Dots = forwardRef43(function Dots2({ total, current, onChange, className, "a
|
|
|
3223
3417
|
i
|
|
3224
3418
|
);
|
|
3225
3419
|
}
|
|
3226
|
-
return /* @__PURE__ */
|
|
3420
|
+
return /* @__PURE__ */ jsx46("span", { "aria-hidden": true, className: sharedClass }, i);
|
|
3227
3421
|
})
|
|
3228
3422
|
}
|
|
3229
3423
|
);
|
|
@@ -3232,15 +3426,15 @@ Dots.displayName = "Dots";
|
|
|
3232
3426
|
|
|
3233
3427
|
// src/patterns/Dropzone/Dropzone.tsx
|
|
3234
3428
|
import {
|
|
3235
|
-
forwardRef as
|
|
3236
|
-
useState as
|
|
3429
|
+
forwardRef as forwardRef45,
|
|
3430
|
+
useState as useState12
|
|
3237
3431
|
} from "react";
|
|
3238
|
-
import { jsx as
|
|
3432
|
+
import { jsx as jsx47, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
3239
3433
|
function listToArray(list) {
|
|
3240
3434
|
if (!list) return [];
|
|
3241
3435
|
return Array.from(list);
|
|
3242
3436
|
}
|
|
3243
|
-
var Dropzone =
|
|
3437
|
+
var Dropzone = forwardRef45(function Dropzone2({
|
|
3244
3438
|
onFiles,
|
|
3245
3439
|
accept,
|
|
3246
3440
|
multiple = true,
|
|
@@ -3251,7 +3445,7 @@ var Dropzone = forwardRef44(function Dropzone2({
|
|
|
3251
3445
|
className,
|
|
3252
3446
|
...props
|
|
3253
3447
|
}, ref) {
|
|
3254
|
-
const [isDragging, setIsDragging] =
|
|
3448
|
+
const [isDragging, setIsDragging] = useState12(false);
|
|
3255
3449
|
const onDragOver = (e) => {
|
|
3256
3450
|
if (disabled) return;
|
|
3257
3451
|
e.preventDefault();
|
|
@@ -3265,7 +3459,7 @@ var Dropzone = forwardRef44(function Dropzone2({
|
|
|
3265
3459
|
const files = listToArray(e.dataTransfer.files);
|
|
3266
3460
|
if (files.length) onFiles?.(files);
|
|
3267
3461
|
};
|
|
3268
|
-
return /* @__PURE__ */
|
|
3462
|
+
return /* @__PURE__ */ jsxs39(
|
|
3269
3463
|
"label",
|
|
3270
3464
|
{
|
|
3271
3465
|
ref,
|
|
@@ -3282,7 +3476,7 @@ var Dropzone = forwardRef44(function Dropzone2({
|
|
|
3282
3476
|
),
|
|
3283
3477
|
...props,
|
|
3284
3478
|
children: [
|
|
3285
|
-
/* @__PURE__ */
|
|
3479
|
+
/* @__PURE__ */ jsx47(
|
|
3286
3480
|
"input",
|
|
3287
3481
|
{
|
|
3288
3482
|
type: "file",
|
|
@@ -3298,7 +3492,7 @@ var Dropzone = forwardRef44(function Dropzone2({
|
|
|
3298
3492
|
}
|
|
3299
3493
|
}
|
|
3300
3494
|
),
|
|
3301
|
-
/* @__PURE__ */
|
|
3495
|
+
/* @__PURE__ */ jsx47(
|
|
3302
3496
|
"div",
|
|
3303
3497
|
{
|
|
3304
3498
|
"aria-hidden": true,
|
|
@@ -3306,8 +3500,8 @@ var Dropzone = forwardRef44(function Dropzone2({
|
|
|
3306
3500
|
children: icon
|
|
3307
3501
|
}
|
|
3308
3502
|
),
|
|
3309
|
-
/* @__PURE__ */
|
|
3310
|
-
description && /* @__PURE__ */
|
|
3503
|
+
/* @__PURE__ */ jsx47("div", { className: "mb-1 text-[13px] font-medium", children: title }),
|
|
3504
|
+
description && /* @__PURE__ */ jsx47("div", { className: "text-text-dim text-[11px]", children: description })
|
|
3311
3505
|
]
|
|
3312
3506
|
}
|
|
3313
3507
|
);
|
|
@@ -3315,10 +3509,10 @@ var Dropzone = forwardRef44(function Dropzone2({
|
|
|
3315
3509
|
Dropzone.displayName = "Dropzone";
|
|
3316
3510
|
|
|
3317
3511
|
// src/patterns/EmptyState/EmptyState.tsx
|
|
3318
|
-
import { cva as
|
|
3319
|
-
import { forwardRef as
|
|
3320
|
-
import { jsx as
|
|
3321
|
-
var plateStyles =
|
|
3512
|
+
import { cva as cva11 } from "class-variance-authority";
|
|
3513
|
+
import { forwardRef as forwardRef46 } from "react";
|
|
3514
|
+
import { jsx as jsx48, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
3515
|
+
var plateStyles = cva11("grid h-12 w-12 place-items-center rounded-base text-[22px]", {
|
|
3322
3516
|
variants: {
|
|
3323
3517
|
tone: {
|
|
3324
3518
|
neutral: "bg-panel-2 text-text-muted",
|
|
@@ -3330,8 +3524,8 @@ var plateStyles = cva10("grid h-12 w-12 place-items-center rounded-base text-[22
|
|
|
3330
3524
|
},
|
|
3331
3525
|
defaultVariants: { tone: "neutral" }
|
|
3332
3526
|
});
|
|
3333
|
-
var EmptyState =
|
|
3334
|
-
return /* @__PURE__ */
|
|
3527
|
+
var EmptyState = forwardRef46(function EmptyState2({ icon, title, description, action, chips, tone, className, ...props }, ref) {
|
|
3528
|
+
return /* @__PURE__ */ jsxs40(
|
|
3335
3529
|
"div",
|
|
3336
3530
|
{
|
|
3337
3531
|
ref,
|
|
@@ -3341,10 +3535,10 @@ var EmptyState = forwardRef45(function EmptyState2({ icon, title, description, a
|
|
|
3341
3535
|
),
|
|
3342
3536
|
...props,
|
|
3343
3537
|
children: [
|
|
3344
|
-
icon != null && /* @__PURE__ */
|
|
3345
|
-
/* @__PURE__ */
|
|
3346
|
-
description && /* @__PURE__ */
|
|
3347
|
-
chips && chips.length > 0 && /* @__PURE__ */
|
|
3538
|
+
icon != null && /* @__PURE__ */ jsx48("span", { "aria-hidden": true, className: plateStyles({ tone: tone ?? "neutral" }), children: icon }),
|
|
3539
|
+
/* @__PURE__ */ jsx48("div", { className: "text-[14px] font-medium", children: title }),
|
|
3540
|
+
description && /* @__PURE__ */ jsx48("div", { className: "text-text-muted max-w-[260px] text-[12px] leading-[1.5]", children: description }),
|
|
3541
|
+
chips && chips.length > 0 && /* @__PURE__ */ jsx48("div", { className: "flex w-full flex-col gap-1", children: chips.map((c, i) => /* @__PURE__ */ jsx48(
|
|
3348
3542
|
"button",
|
|
3349
3543
|
{
|
|
3350
3544
|
type: "button",
|
|
@@ -3366,18 +3560,18 @@ var EmptyState = forwardRef45(function EmptyState2({ icon, title, description, a
|
|
|
3366
3560
|
EmptyState.displayName = "EmptyState";
|
|
3367
3561
|
|
|
3368
3562
|
// src/patterns/FileChip/FileChip.tsx
|
|
3369
|
-
import { forwardRef as
|
|
3370
|
-
import { jsx as
|
|
3563
|
+
import { forwardRef as forwardRef47 } from "react";
|
|
3564
|
+
import { jsx as jsx49, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
3371
3565
|
function deriveExt(name) {
|
|
3372
3566
|
const dot = name.lastIndexOf(".");
|
|
3373
3567
|
if (dot < 0) return "FILE";
|
|
3374
3568
|
return name.slice(dot + 1).slice(0, 4).toUpperCase();
|
|
3375
3569
|
}
|
|
3376
|
-
var FileChip =
|
|
3570
|
+
var FileChip = forwardRef47(function FileChip2({ name, size, progress, icon, onRemove, failed, className, ...props }, ref) {
|
|
3377
3571
|
const ext = deriveExt(name);
|
|
3378
3572
|
const showProgress = typeof progress === "number";
|
|
3379
3573
|
const isComplete = showProgress && progress >= 100;
|
|
3380
|
-
return /* @__PURE__ */
|
|
3574
|
+
return /* @__PURE__ */ jsxs41(
|
|
3381
3575
|
"div",
|
|
3382
3576
|
{
|
|
3383
3577
|
ref,
|
|
@@ -3387,7 +3581,7 @@ var FileChip = forwardRef46(function FileChip2({ name, size, progress, icon, onR
|
|
|
3387
3581
|
),
|
|
3388
3582
|
...props,
|
|
3389
3583
|
children: [
|
|
3390
|
-
/* @__PURE__ */
|
|
3584
|
+
/* @__PURE__ */ jsx49(
|
|
3391
3585
|
"span",
|
|
3392
3586
|
{
|
|
3393
3587
|
"aria-hidden": true,
|
|
@@ -3395,17 +3589,17 @@ var FileChip = forwardRef46(function FileChip2({ name, size, progress, icon, onR
|
|
|
3395
3589
|
children: icon ?? ext
|
|
3396
3590
|
}
|
|
3397
3591
|
),
|
|
3398
|
-
/* @__PURE__ */
|
|
3399
|
-
/* @__PURE__ */
|
|
3400
|
-
/* @__PURE__ */
|
|
3592
|
+
/* @__PURE__ */ jsxs41("div", { className: "min-w-0 flex-1", children: [
|
|
3593
|
+
/* @__PURE__ */ jsx49("div", { className: "truncate text-[12px] font-medium", children: name }),
|
|
3594
|
+
/* @__PURE__ */ jsxs41("div", { className: cn("font-mono text-[10px]", failed ? "text-err" : "text-text-dim"), children: [
|
|
3401
3595
|
size,
|
|
3402
|
-
showProgress && !isComplete && /* @__PURE__ */
|
|
3596
|
+
showProgress && !isComplete && /* @__PURE__ */ jsxs41("span", { children: [
|
|
3403
3597
|
" \xB7 ",
|
|
3404
3598
|
Math.round(progress),
|
|
3405
3599
|
"%"
|
|
3406
3600
|
] })
|
|
3407
3601
|
] }),
|
|
3408
|
-
showProgress && !isComplete && /* @__PURE__ */
|
|
3602
|
+
showProgress && !isComplete && /* @__PURE__ */ jsx49("div", { className: "bg-panel mt-1 h-[2px] overflow-hidden rounded-full", children: /* @__PURE__ */ jsx49(
|
|
3409
3603
|
"div",
|
|
3410
3604
|
{
|
|
3411
3605
|
className: cn(
|
|
@@ -3416,7 +3610,7 @@ var FileChip = forwardRef46(function FileChip2({ name, size, progress, icon, onR
|
|
|
3416
3610
|
}
|
|
3417
3611
|
) })
|
|
3418
3612
|
] }),
|
|
3419
|
-
onRemove && /* @__PURE__ */
|
|
3613
|
+
onRemove && /* @__PURE__ */ jsx49(
|
|
3420
3614
|
"button",
|
|
3421
3615
|
{
|
|
3422
3616
|
type: "button",
|
|
@@ -3436,10 +3630,10 @@ var FileChip = forwardRef46(function FileChip2({ name, size, progress, icon, onR
|
|
|
3436
3630
|
FileChip.displayName = "FileChip";
|
|
3437
3631
|
|
|
3438
3632
|
// src/patterns/FilterPanel/FilterPanel.tsx
|
|
3439
|
-
import { forwardRef as
|
|
3440
|
-
import { jsx as
|
|
3633
|
+
import { forwardRef as forwardRef48, useCallback as useCallback9, useState as useState13 } from "react";
|
|
3634
|
+
import { jsx as jsx50, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
3441
3635
|
var EMPTY = Object.freeze({});
|
|
3442
|
-
var FilterPanel =
|
|
3636
|
+
var FilterPanel = forwardRef48(function FilterPanel2({
|
|
3443
3637
|
facets,
|
|
3444
3638
|
value,
|
|
3445
3639
|
defaultValue,
|
|
@@ -3457,7 +3651,7 @@ var FilterPanel = forwardRef47(function FilterPanel2({
|
|
|
3457
3651
|
onChange: onValueChange
|
|
3458
3652
|
});
|
|
3459
3653
|
const total = facets.reduce((sum, facet) => sum + (selection[facet.id]?.length ?? 0), 0);
|
|
3460
|
-
const toggle =
|
|
3654
|
+
const toggle = useCallback9(
|
|
3461
3655
|
(facetId, optionValue, next) => {
|
|
3462
3656
|
setSelection((prev) => {
|
|
3463
3657
|
const current = prev?.[facetId] ?? [];
|
|
@@ -3468,11 +3662,11 @@ var FilterPanel = forwardRef47(function FilterPanel2({
|
|
|
3468
3662
|
},
|
|
3469
3663
|
[setSelection]
|
|
3470
3664
|
);
|
|
3471
|
-
const handleReset =
|
|
3665
|
+
const handleReset = useCallback9(() => {
|
|
3472
3666
|
setSelection(EMPTY);
|
|
3473
3667
|
onReset?.();
|
|
3474
3668
|
}, [setSelection, onReset]);
|
|
3475
|
-
return /* @__PURE__ */
|
|
3669
|
+
return /* @__PURE__ */ jsxs42(
|
|
3476
3670
|
"div",
|
|
3477
3671
|
{
|
|
3478
3672
|
ref,
|
|
@@ -3484,10 +3678,10 @@ var FilterPanel = forwardRef47(function FilterPanel2({
|
|
|
3484
3678
|
),
|
|
3485
3679
|
...props,
|
|
3486
3680
|
children: [
|
|
3487
|
-
/* @__PURE__ */
|
|
3488
|
-
/* @__PURE__ */
|
|
3489
|
-
total > 0 && /* @__PURE__ */
|
|
3490
|
-
/* @__PURE__ */
|
|
3681
|
+
/* @__PURE__ */ jsxs42("div", { className: "flex items-center gap-2", children: [
|
|
3682
|
+
/* @__PURE__ */ jsx50("span", { className: "text-text-dim font-mono text-[10px] tracking-[1.4px] uppercase", children: title }),
|
|
3683
|
+
total > 0 && /* @__PURE__ */ jsx50(Badge, { size: "sm", variant: "accent", children: total }),
|
|
3684
|
+
/* @__PURE__ */ jsx50(
|
|
3491
3685
|
Button,
|
|
3492
3686
|
{
|
|
3493
3687
|
type: "button",
|
|
@@ -3500,7 +3694,7 @@ var FilterPanel = forwardRef47(function FilterPanel2({
|
|
|
3500
3694
|
}
|
|
3501
3695
|
)
|
|
3502
3696
|
] }),
|
|
3503
|
-
facets.map((facet) => /* @__PURE__ */
|
|
3697
|
+
facets.map((facet) => /* @__PURE__ */ jsx50(
|
|
3504
3698
|
FilterFacetGroup,
|
|
3505
3699
|
{
|
|
3506
3700
|
facet,
|
|
@@ -3517,12 +3711,12 @@ var FilterPanel = forwardRef47(function FilterPanel2({
|
|
|
3517
3711
|
FilterPanel.displayName = "FilterPanel";
|
|
3518
3712
|
function FilterFacetGroup({ facet, selected, counts, onToggle }) {
|
|
3519
3713
|
const collapsible = facet.collapsible ?? true;
|
|
3520
|
-
const [open, setOpen] =
|
|
3714
|
+
const [open, setOpen] = useState13(facet.defaultOpen ?? true);
|
|
3521
3715
|
const isOpen = !collapsible || open;
|
|
3522
3716
|
const selectedCount = selected.length;
|
|
3523
3717
|
const headingClass = "text-text-muted flex items-center gap-[6px] font-mono text-[10px] tracking-[1.4px] uppercase";
|
|
3524
|
-
return /* @__PURE__ */
|
|
3525
|
-
collapsible ? /* @__PURE__ */
|
|
3718
|
+
return /* @__PURE__ */ jsxs42("section", { className: "flex flex-col gap-1", children: [
|
|
3719
|
+
collapsible ? /* @__PURE__ */ jsxs42(
|
|
3526
3720
|
"button",
|
|
3527
3721
|
{
|
|
3528
3722
|
type: "button",
|
|
@@ -3535,20 +3729,20 @@ function FilterFacetGroup({ facet, selected, counts, onToggle }) {
|
|
|
3535
3729
|
"hover:text-text"
|
|
3536
3730
|
),
|
|
3537
3731
|
children: [
|
|
3538
|
-
/* @__PURE__ */
|
|
3539
|
-
selectedCount > 0 && /* @__PURE__ */
|
|
3540
|
-
/* @__PURE__ */
|
|
3732
|
+
/* @__PURE__ */ jsx50("span", { className: "flex-1 text-left", children: facet.label }),
|
|
3733
|
+
selectedCount > 0 && /* @__PURE__ */ jsx50(Badge, { size: "sm", variant: "neutral", children: selectedCount }),
|
|
3734
|
+
/* @__PURE__ */ jsx50("span", { "aria-hidden": true, className: "text-[10px] opacity-70", children: isOpen ? "\u25BE" : "\u25B8" })
|
|
3541
3735
|
]
|
|
3542
3736
|
}
|
|
3543
|
-
) : /* @__PURE__ */
|
|
3544
|
-
/* @__PURE__ */
|
|
3545
|
-
selectedCount > 0 && /* @__PURE__ */
|
|
3737
|
+
) : /* @__PURE__ */ jsxs42("div", { className: cn(headingClass, "px-1 py-[2px]"), children: [
|
|
3738
|
+
/* @__PURE__ */ jsx50("span", { className: "flex-1", children: facet.label }),
|
|
3739
|
+
selectedCount > 0 && /* @__PURE__ */ jsx50(Badge, { size: "sm", variant: "neutral", children: selectedCount })
|
|
3546
3740
|
] }),
|
|
3547
|
-
isOpen && /* @__PURE__ */
|
|
3741
|
+
isOpen && /* @__PURE__ */ jsx50("ul", { className: "m-0 flex list-none flex-col gap-[2px] p-0", children: facet.options.map((option) => {
|
|
3548
3742
|
const isSelected = selected.includes(option.value);
|
|
3549
3743
|
const count = counts?.[option.value];
|
|
3550
|
-
return /* @__PURE__ */
|
|
3551
|
-
/* @__PURE__ */
|
|
3744
|
+
return /* @__PURE__ */ jsxs42("li", { className: "flex items-center gap-2 px-1 py-[3px]", children: [
|
|
3745
|
+
/* @__PURE__ */ jsx50(
|
|
3552
3746
|
Checkbox,
|
|
3553
3747
|
{
|
|
3554
3748
|
checked: isSelected,
|
|
@@ -3556,25 +3750,25 @@ function FilterFacetGroup({ facet, selected, counts, onToggle }) {
|
|
|
3556
3750
|
label: option.label
|
|
3557
3751
|
}
|
|
3558
3752
|
),
|
|
3559
|
-
typeof count === "number" && /* @__PURE__ */
|
|
3753
|
+
typeof count === "number" && /* @__PURE__ */ jsx50("span", { className: "text-text-dim ml-auto font-mono text-[10px] tabular-nums", children: count })
|
|
3560
3754
|
] }, option.value);
|
|
3561
3755
|
}) })
|
|
3562
3756
|
] });
|
|
3563
3757
|
}
|
|
3564
3758
|
|
|
3565
3759
|
// src/patterns/HealthScore/HealthScore.tsx
|
|
3566
|
-
import { forwardRef as
|
|
3760
|
+
import { forwardRef as forwardRef50 } from "react";
|
|
3567
3761
|
|
|
3568
3762
|
// src/patterns/RadialProgress/RadialProgress.tsx
|
|
3569
|
-
import { forwardRef as
|
|
3570
|
-
import { jsx as
|
|
3763
|
+
import { forwardRef as forwardRef49 } from "react";
|
|
3764
|
+
import { jsx as jsx51, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
3571
3765
|
var toneStrokeClass = {
|
|
3572
3766
|
accent: "stroke-accent",
|
|
3573
3767
|
ok: "stroke-ok",
|
|
3574
3768
|
warn: "stroke-warn",
|
|
3575
3769
|
err: "stroke-err"
|
|
3576
3770
|
};
|
|
3577
|
-
var RadialProgress =
|
|
3771
|
+
var RadialProgress = forwardRef49(
|
|
3578
3772
|
function RadialProgress2({
|
|
3579
3773
|
value,
|
|
3580
3774
|
max = 100,
|
|
@@ -3592,7 +3786,7 @@ var RadialProgress = forwardRef48(
|
|
|
3592
3786
|
const c = 2 * Math.PI * r;
|
|
3593
3787
|
const dash = pct / 100 * c;
|
|
3594
3788
|
const resolvedTone = tone ?? (clamped >= max ? "ok" : "accent");
|
|
3595
|
-
return /* @__PURE__ */
|
|
3789
|
+
return /* @__PURE__ */ jsxs43(
|
|
3596
3790
|
"div",
|
|
3597
3791
|
{
|
|
3598
3792
|
ref,
|
|
@@ -3605,8 +3799,8 @@ var RadialProgress = forwardRef48(
|
|
|
3605
3799
|
style: { width: size, height: size },
|
|
3606
3800
|
...props,
|
|
3607
3801
|
children: [
|
|
3608
|
-
/* @__PURE__ */
|
|
3609
|
-
/* @__PURE__ */
|
|
3802
|
+
/* @__PURE__ */ jsxs43("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, children: [
|
|
3803
|
+
/* @__PURE__ */ jsx51(
|
|
3610
3804
|
"circle",
|
|
3611
3805
|
{
|
|
3612
3806
|
cx: size / 2,
|
|
@@ -3617,7 +3811,7 @@ var RadialProgress = forwardRef48(
|
|
|
3617
3811
|
className: "stroke-panel-2"
|
|
3618
3812
|
}
|
|
3619
3813
|
),
|
|
3620
|
-
/* @__PURE__ */
|
|
3814
|
+
/* @__PURE__ */ jsx51(
|
|
3621
3815
|
"circle",
|
|
3622
3816
|
{
|
|
3623
3817
|
cx: size / 2,
|
|
@@ -3635,7 +3829,7 @@ var RadialProgress = forwardRef48(
|
|
|
3635
3829
|
}
|
|
3636
3830
|
)
|
|
3637
3831
|
] }),
|
|
3638
|
-
/* @__PURE__ */
|
|
3832
|
+
/* @__PURE__ */ jsx51("div", { className: "absolute inset-0 grid place-items-center font-mono text-[11px] font-medium tabular-nums", children: children ?? `${Math.round(pct)}%` })
|
|
3639
3833
|
]
|
|
3640
3834
|
}
|
|
3641
3835
|
);
|
|
@@ -3644,7 +3838,7 @@ var RadialProgress = forwardRef48(
|
|
|
3644
3838
|
RadialProgress.displayName = "RadialProgress";
|
|
3645
3839
|
|
|
3646
3840
|
// src/patterns/HealthScore/HealthScore.tsx
|
|
3647
|
-
import { jsx as
|
|
3841
|
+
import { jsx as jsx52, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
3648
3842
|
function deltaTone(delta) {
|
|
3649
3843
|
if (delta > 0) return "ok";
|
|
3650
3844
|
if (delta < 0) return "err";
|
|
@@ -3661,7 +3855,7 @@ var toneTextClass = {
|
|
|
3661
3855
|
warn: "text-warn",
|
|
3662
3856
|
err: "text-err"
|
|
3663
3857
|
};
|
|
3664
|
-
var HealthScore =
|
|
3858
|
+
var HealthScore = forwardRef50(function HealthScore2({
|
|
3665
3859
|
value,
|
|
3666
3860
|
max = 100,
|
|
3667
3861
|
delta,
|
|
@@ -3676,7 +3870,7 @@ var HealthScore = forwardRef49(function HealthScore2({
|
|
|
3676
3870
|
const pct = max > 0 ? Math.round(Math.min(max, Math.max(0, value)) / max * 100) : 0;
|
|
3677
3871
|
const resolvedTone = tone ?? (pct >= 80 ? "ok" : pct >= 50 ? "accent" : "warn");
|
|
3678
3872
|
const indicatorTone = typeof delta === "number" ? deltaTone(delta) : "accent";
|
|
3679
|
-
const core = /* @__PURE__ */
|
|
3873
|
+
const core = /* @__PURE__ */ jsxs44(
|
|
3680
3874
|
"div",
|
|
3681
3875
|
{
|
|
3682
3876
|
ref,
|
|
@@ -3684,10 +3878,10 @@ var HealthScore = forwardRef49(function HealthScore2({
|
|
|
3684
3878
|
"aria-label": ariaLabel ?? `${pct}% health`,
|
|
3685
3879
|
...props,
|
|
3686
3880
|
children: [
|
|
3687
|
-
/* @__PURE__ */
|
|
3688
|
-
label && /* @__PURE__ */
|
|
3689
|
-
typeof delta === "number" && /* @__PURE__ */
|
|
3690
|
-
/* @__PURE__ */
|
|
3881
|
+
/* @__PURE__ */ jsx52(RadialProgress, { value, max, size, tone: resolvedTone }),
|
|
3882
|
+
label && /* @__PURE__ */ jsx52("div", { className: "text-text-muted mt-1 text-[12px] leading-tight", children: label }),
|
|
3883
|
+
typeof delta === "number" && /* @__PURE__ */ jsxs44("div", { className: cn("font-mono text-[11px] tabular-nums", toneTextClass[indicatorTone]), children: [
|
|
3884
|
+
/* @__PURE__ */ jsx52("span", { "aria-hidden": true, children: deltaGlyph(delta) }),
|
|
3691
3885
|
" ",
|
|
3692
3886
|
Math.abs(delta)
|
|
3693
3887
|
] })
|
|
@@ -3697,15 +3891,15 @@ var HealthScore = forwardRef49(function HealthScore2({
|
|
|
3697
3891
|
if (!breakdown || breakdown.length === 0) {
|
|
3698
3892
|
return core;
|
|
3699
3893
|
}
|
|
3700
|
-
return /* @__PURE__ */
|
|
3894
|
+
return /* @__PURE__ */ jsx52(
|
|
3701
3895
|
HoverCard,
|
|
3702
3896
|
{
|
|
3703
|
-
trigger: /* @__PURE__ */
|
|
3704
|
-
content: /* @__PURE__ */
|
|
3705
|
-
/* @__PURE__ */
|
|
3706
|
-
/* @__PURE__ */
|
|
3707
|
-
/* @__PURE__ */
|
|
3708
|
-
/* @__PURE__ */
|
|
3897
|
+
trigger: /* @__PURE__ */ jsx52("span", { className: "inline-flex", children: core }),
|
|
3898
|
+
content: /* @__PURE__ */ jsxs44("div", { className: "flex min-w-[180px] flex-col gap-2", children: [
|
|
3899
|
+
/* @__PURE__ */ jsx52("div", { className: "text-text-dim font-mono text-[9px] tracking-[1.4px] uppercase", children: "Breakdown" }),
|
|
3900
|
+
/* @__PURE__ */ jsx52("ul", { className: "m-0 flex list-none flex-col gap-1 p-0 text-[12px]", children: breakdown.map((entry, i) => /* @__PURE__ */ jsxs44("li", { className: "flex items-center gap-2", children: [
|
|
3901
|
+
/* @__PURE__ */ jsx52("span", { className: "text-text-muted flex-1 truncate", children: entry.label }),
|
|
3902
|
+
/* @__PURE__ */ jsx52(
|
|
3709
3903
|
"span",
|
|
3710
3904
|
{
|
|
3711
3905
|
className: cn(
|
|
@@ -3723,21 +3917,21 @@ var HealthScore = forwardRef49(function HealthScore2({
|
|
|
3723
3917
|
HealthScore.displayName = "HealthScore";
|
|
3724
3918
|
|
|
3725
3919
|
// src/patterns/LargeTitle/LargeTitle.tsx
|
|
3726
|
-
import { forwardRef as
|
|
3727
|
-
import { jsx as
|
|
3728
|
-
var LargeTitle =
|
|
3729
|
-
return /* @__PURE__ */
|
|
3920
|
+
import { forwardRef as forwardRef51 } from "react";
|
|
3921
|
+
import { jsx as jsx53, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
3922
|
+
var LargeTitle = forwardRef51(function LargeTitle2({ title, eyebrow, trailing, className, ...props }, ref) {
|
|
3923
|
+
return /* @__PURE__ */ jsxs45(
|
|
3730
3924
|
"header",
|
|
3731
3925
|
{
|
|
3732
3926
|
ref,
|
|
3733
3927
|
className: cn("px-screen flex items-end justify-between gap-3 py-3 pb-4", className),
|
|
3734
3928
|
...props,
|
|
3735
3929
|
children: [
|
|
3736
|
-
/* @__PURE__ */
|
|
3737
|
-
eyebrow && /* @__PURE__ */
|
|
3738
|
-
/* @__PURE__ */
|
|
3930
|
+
/* @__PURE__ */ jsxs45("div", { className: "min-w-0 flex-1", children: [
|
|
3931
|
+
eyebrow && /* @__PURE__ */ jsx53("div", { className: "text-m-eyebrow text-accent mb-[6px] font-mono tracking-wide uppercase", children: eyebrow }),
|
|
3932
|
+
/* @__PURE__ */ jsx53("h1", { className: "text-m-h1 m-0 truncate leading-tight font-medium tracking-tight", children: title })
|
|
3739
3933
|
] }),
|
|
3740
|
-
trailing && /* @__PURE__ */
|
|
3934
|
+
trailing && /* @__PURE__ */ jsx53("div", { className: "shrink-0", children: trailing })
|
|
3741
3935
|
]
|
|
3742
3936
|
}
|
|
3743
3937
|
);
|
|
@@ -3746,10 +3940,10 @@ LargeTitle.displayName = "LargeTitle";
|
|
|
3746
3940
|
|
|
3747
3941
|
// src/patterns/Menubar/Menubar.tsx
|
|
3748
3942
|
import * as RadixMenubar from "@radix-ui/react-menubar";
|
|
3749
|
-
import { forwardRef as
|
|
3750
|
-
import { jsx as
|
|
3751
|
-
var Menubar =
|
|
3752
|
-
return /* @__PURE__ */
|
|
3943
|
+
import { forwardRef as forwardRef52 } from "react";
|
|
3944
|
+
import { jsx as jsx54, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
3945
|
+
var Menubar = forwardRef52(function Menubar2({ className, ...props }, ref) {
|
|
3946
|
+
return /* @__PURE__ */ jsx54(
|
|
3753
3947
|
RadixMenubar.Root,
|
|
3754
3948
|
{
|
|
3755
3949
|
ref,
|
|
@@ -3763,9 +3957,9 @@ var Menubar = forwardRef51(function Menubar2({ className, ...props }, ref) {
|
|
|
3763
3957
|
});
|
|
3764
3958
|
Menubar.displayName = "Menubar";
|
|
3765
3959
|
var MenubarMenu = RadixMenubar.Menu;
|
|
3766
|
-
var MenubarTrigger =
|
|
3960
|
+
var MenubarTrigger = forwardRef52(
|
|
3767
3961
|
function MenubarTrigger2({ className, ...props }, ref) {
|
|
3768
|
-
return /* @__PURE__ */
|
|
3962
|
+
return /* @__PURE__ */ jsx54(
|
|
3769
3963
|
RadixMenubar.Trigger,
|
|
3770
3964
|
{
|
|
3771
3965
|
ref,
|
|
@@ -3782,9 +3976,9 @@ var MenubarTrigger = forwardRef51(
|
|
|
3782
3976
|
}
|
|
3783
3977
|
);
|
|
3784
3978
|
MenubarTrigger.displayName = "MenubarTrigger";
|
|
3785
|
-
var MenubarContent =
|
|
3979
|
+
var MenubarContent = forwardRef52(
|
|
3786
3980
|
function MenubarContent2({ className, sideOffset = 6, align = "start", ...props }, ref) {
|
|
3787
|
-
return /* @__PURE__ */
|
|
3981
|
+
return /* @__PURE__ */ jsx54(RadixMenubar.Portal, { children: /* @__PURE__ */ jsx54(
|
|
3788
3982
|
RadixMenubar.Content,
|
|
3789
3983
|
{
|
|
3790
3984
|
ref,
|
|
@@ -3806,24 +4000,24 @@ var itemBase3 = cn(
|
|
|
3806
4000
|
"data-[highlighted]:bg-panel-2",
|
|
3807
4001
|
"data-[disabled]:opacity-40 data-[disabled]:cursor-not-allowed"
|
|
3808
4002
|
);
|
|
3809
|
-
var MenubarItem =
|
|
3810
|
-
return /* @__PURE__ */
|
|
4003
|
+
var MenubarItem = forwardRef52(function MenubarItem2({ trailing, destructive, className, children, ...props }, ref) {
|
|
4004
|
+
return /* @__PURE__ */ jsxs46(
|
|
3811
4005
|
RadixMenubar.Item,
|
|
3812
4006
|
{
|
|
3813
4007
|
ref,
|
|
3814
4008
|
className: cn(itemBase3, destructive ? "text-err" : "text-text", className),
|
|
3815
4009
|
...props,
|
|
3816
4010
|
children: [
|
|
3817
|
-
/* @__PURE__ */
|
|
3818
|
-
trailing && /* @__PURE__ */
|
|
4011
|
+
/* @__PURE__ */ jsx54("span", { className: "flex-1", children }),
|
|
4012
|
+
trailing && /* @__PURE__ */ jsx54("span", { className: "text-text-dim font-mono text-[10px]", children: trailing })
|
|
3819
4013
|
]
|
|
3820
4014
|
}
|
|
3821
4015
|
);
|
|
3822
4016
|
});
|
|
3823
4017
|
MenubarItem.displayName = "MenubarItem";
|
|
3824
|
-
var MenubarSeparator =
|
|
4018
|
+
var MenubarSeparator = forwardRef52(
|
|
3825
4019
|
function MenubarSeparator2({ className, ...props }, ref) {
|
|
3826
|
-
return /* @__PURE__ */
|
|
4020
|
+
return /* @__PURE__ */ jsx54(
|
|
3827
4021
|
RadixMenubar.Separator,
|
|
3828
4022
|
{
|
|
3829
4023
|
ref,
|
|
@@ -3838,22 +4032,22 @@ MenubarSeparator.displayName = "MenubarSeparator";
|
|
|
3838
4032
|
// src/patterns/NavBar/NavBar.tsx
|
|
3839
4033
|
import * as RadixNav from "@radix-ui/react-navigation-menu";
|
|
3840
4034
|
import {
|
|
3841
|
-
forwardRef as
|
|
3842
|
-
useCallback as
|
|
3843
|
-
useEffect as
|
|
3844
|
-
useRef as
|
|
3845
|
-
useState as
|
|
4035
|
+
forwardRef as forwardRef54,
|
|
4036
|
+
useCallback as useCallback11,
|
|
4037
|
+
useEffect as useEffect10,
|
|
4038
|
+
useRef as useRef8,
|
|
4039
|
+
useState as useState15
|
|
3846
4040
|
} from "react";
|
|
3847
4041
|
|
|
3848
4042
|
// src/patterns/Sidebar/Sidebar.tsx
|
|
3849
4043
|
import {
|
|
3850
|
-
forwardRef as
|
|
3851
|
-
useCallback as
|
|
3852
|
-
useState as
|
|
4044
|
+
forwardRef as forwardRef53,
|
|
4045
|
+
useCallback as useCallback10,
|
|
4046
|
+
useState as useState14
|
|
3853
4047
|
} from "react";
|
|
3854
|
-
import { Fragment as Fragment2, jsx as
|
|
3855
|
-
var Sidebar =
|
|
3856
|
-
return /* @__PURE__ */
|
|
4048
|
+
import { Fragment as Fragment2, jsx as jsx55, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
4049
|
+
var Sidebar = forwardRef53(function Sidebar2({ width = 240, className, style, ...props }, ref) {
|
|
4050
|
+
return /* @__PURE__ */ jsx55(
|
|
3857
4051
|
"aside",
|
|
3858
4052
|
{
|
|
3859
4053
|
ref,
|
|
@@ -3867,12 +4061,12 @@ var Sidebar = forwardRef52(function Sidebar2({ width = 240, className, style, ..
|
|
|
3867
4061
|
);
|
|
3868
4062
|
});
|
|
3869
4063
|
Sidebar.displayName = "Sidebar";
|
|
3870
|
-
var NavItem =
|
|
4064
|
+
var NavItem = forwardRef53(
|
|
3871
4065
|
function NavItem2({ icon, label, active, badge, href, disabled, className, ...props }, ref) {
|
|
3872
|
-
const inner = /* @__PURE__ */
|
|
3873
|
-
icon && /* @__PURE__ */
|
|
3874
|
-
/* @__PURE__ */
|
|
3875
|
-
badge != null && /* @__PURE__ */
|
|
4066
|
+
const inner = /* @__PURE__ */ jsxs47(Fragment2, { children: [
|
|
4067
|
+
icon && /* @__PURE__ */ jsx55("span", { "aria-hidden": true, className: "w-[14px] text-center opacity-80", children: icon }),
|
|
4068
|
+
/* @__PURE__ */ jsx55("span", { className: "flex-1 truncate", children: label }),
|
|
4069
|
+
badge != null && /* @__PURE__ */ jsx55(
|
|
3876
4070
|
"span",
|
|
3877
4071
|
{
|
|
3878
4072
|
className: cn(
|
|
@@ -3893,7 +4087,7 @@ var NavItem = forwardRef52(
|
|
|
3893
4087
|
);
|
|
3894
4088
|
if (href) {
|
|
3895
4089
|
const anchorProps = props;
|
|
3896
|
-
return /* @__PURE__ */
|
|
4090
|
+
return /* @__PURE__ */ jsx55(
|
|
3897
4091
|
"a",
|
|
3898
4092
|
{
|
|
3899
4093
|
ref,
|
|
@@ -3907,7 +4101,7 @@ var NavItem = forwardRef52(
|
|
|
3907
4101
|
);
|
|
3908
4102
|
}
|
|
3909
4103
|
const buttonProps = props;
|
|
3910
|
-
return /* @__PURE__ */
|
|
4104
|
+
return /* @__PURE__ */ jsx55(
|
|
3911
4105
|
"button",
|
|
3912
4106
|
{
|
|
3913
4107
|
ref,
|
|
@@ -3922,7 +4116,7 @@ var NavItem = forwardRef52(
|
|
|
3922
4116
|
}
|
|
3923
4117
|
);
|
|
3924
4118
|
NavItem.displayName = "NavItem";
|
|
3925
|
-
var NavSection =
|
|
4119
|
+
var NavSection = forwardRef53(function NavSection2({
|
|
3926
4120
|
label,
|
|
3927
4121
|
icon,
|
|
3928
4122
|
action,
|
|
@@ -3936,16 +4130,16 @@ var NavSection = forwardRef52(function NavSection2({
|
|
|
3936
4130
|
...props
|
|
3937
4131
|
}, ref) {
|
|
3938
4132
|
const isControlled = open !== void 0;
|
|
3939
|
-
const [internalOpen, setInternalOpen] =
|
|
4133
|
+
const [internalOpen, setInternalOpen] = useState14(defaultOpen);
|
|
3940
4134
|
const isOpen = !collapsible || (isControlled ? open : internalOpen);
|
|
3941
|
-
const toggle =
|
|
4135
|
+
const toggle = useCallback10(() => {
|
|
3942
4136
|
const next = !isOpen;
|
|
3943
4137
|
if (!isControlled) setInternalOpen(next);
|
|
3944
4138
|
onOpenChange?.(next);
|
|
3945
4139
|
}, [isOpen, isControlled, onOpenChange]);
|
|
3946
4140
|
const eyebrowClass = "text-text-dim flex items-center gap-[6px] px-2 pt-2 font-mono text-[9px] tracking-[1.4px] uppercase";
|
|
3947
|
-
return /* @__PURE__ */
|
|
3948
|
-
collapsible ? /* @__PURE__ */
|
|
4141
|
+
return /* @__PURE__ */ jsxs47("div", { ref, className: cn("flex flex-col gap-1", className), ...props, children: [
|
|
4142
|
+
collapsible ? /* @__PURE__ */ jsxs47(
|
|
3949
4143
|
"button",
|
|
3950
4144
|
{
|
|
3951
4145
|
type: "button",
|
|
@@ -3958,18 +4152,18 @@ var NavSection = forwardRef52(function NavSection2({
|
|
|
3958
4152
|
"hover:text-text-muted"
|
|
3959
4153
|
),
|
|
3960
4154
|
children: [
|
|
3961
|
-
icon != null && /* @__PURE__ */
|
|
3962
|
-
/* @__PURE__ */
|
|
4155
|
+
icon != null && /* @__PURE__ */ jsx55("span", { "aria-hidden": true, className: "opacity-80", children: icon }),
|
|
4156
|
+
/* @__PURE__ */ jsx55("span", { className: "flex-1 text-left", children: label }),
|
|
3963
4157
|
action,
|
|
3964
|
-
/* @__PURE__ */
|
|
4158
|
+
/* @__PURE__ */ jsx55("span", { "aria-hidden": true, className: "text-[10px] opacity-70", children: isOpen ? "\u25BE" : "\u25B8" })
|
|
3965
4159
|
]
|
|
3966
4160
|
}
|
|
3967
|
-
) : /* @__PURE__ */
|
|
3968
|
-
icon != null && /* @__PURE__ */
|
|
3969
|
-
/* @__PURE__ */
|
|
4161
|
+
) : /* @__PURE__ */ jsxs47("div", { className: eyebrowClass, children: [
|
|
4162
|
+
icon != null && /* @__PURE__ */ jsx55("span", { "aria-hidden": true, className: "opacity-80", children: icon }),
|
|
4163
|
+
/* @__PURE__ */ jsx55("span", { className: "flex-1", children: label }),
|
|
3970
4164
|
action
|
|
3971
4165
|
] }),
|
|
3972
|
-
isOpen && /* @__PURE__ */
|
|
4166
|
+
isOpen && /* @__PURE__ */ jsx55(
|
|
3973
4167
|
"div",
|
|
3974
4168
|
{
|
|
3975
4169
|
className: cn("flex flex-col gap-[2px]", indent > 0 && "border-border ml-2 border-l"),
|
|
@@ -3982,12 +4176,12 @@ var NavSection = forwardRef52(function NavSection2({
|
|
|
3982
4176
|
NavSection.displayName = "NavSection";
|
|
3983
4177
|
|
|
3984
4178
|
// src/patterns/NavBar/NavBar.tsx
|
|
3985
|
-
import { Fragment as Fragment3, jsx as
|
|
4179
|
+
import { Fragment as Fragment3, jsx as jsx56, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
3986
4180
|
function isActiveTree(item, activeId) {
|
|
3987
4181
|
if (item.id === activeId) return true;
|
|
3988
4182
|
return item.children?.some((c) => isActiveTree(c, activeId)) ?? false;
|
|
3989
4183
|
}
|
|
3990
|
-
var NavBar =
|
|
4184
|
+
var NavBar = forwardRef54(function NavBar2({
|
|
3991
4185
|
orientation = "horizontal",
|
|
3992
4186
|
items,
|
|
3993
4187
|
brand,
|
|
@@ -4001,17 +4195,17 @@ var NavBar = forwardRef53(function NavBar2({
|
|
|
4001
4195
|
...props
|
|
4002
4196
|
}, ref) {
|
|
4003
4197
|
const isControlled = value !== void 0;
|
|
4004
|
-
const [internalValue, setInternalValue] =
|
|
4198
|
+
const [internalValue, setInternalValue] = useState15(defaultValue);
|
|
4005
4199
|
const activeId = isControlled ? value : internalValue;
|
|
4006
|
-
const [drawerOpen, setDrawerOpen] =
|
|
4007
|
-
const select =
|
|
4200
|
+
const [drawerOpen, setDrawerOpen] = useState15(false);
|
|
4201
|
+
const select = useCallback11(
|
|
4008
4202
|
(id) => {
|
|
4009
4203
|
if (!isControlled) setInternalValue(id);
|
|
4010
4204
|
onValueChange?.(id);
|
|
4011
4205
|
},
|
|
4012
4206
|
[isControlled, onValueChange]
|
|
4013
4207
|
);
|
|
4014
|
-
const handleItemActivate =
|
|
4208
|
+
const handleItemActivate = useCallback11(
|
|
4015
4209
|
(id) => {
|
|
4016
4210
|
select(id);
|
|
4017
4211
|
setDrawerOpen(false);
|
|
@@ -4023,7 +4217,7 @@ var NavBar = forwardRef53(function NavBar2({
|
|
|
4023
4217
|
// drawer is open on a viewport that's resizing past `md`, both navs can
|
|
4024
4218
|
// sit in the DOM together. Identical accessible names would trip axe's
|
|
4025
4219
|
// `landmark-unique` rule.
|
|
4026
|
-
/* @__PURE__ */
|
|
4220
|
+
/* @__PURE__ */ jsx56("nav", { "aria-label": "Mobile navigation", className: "flex flex-col gap-1", children: items.map((item) => /* @__PURE__ */ jsx56(
|
|
4027
4221
|
VerticalItem,
|
|
4028
4222
|
{
|
|
4029
4223
|
item,
|
|
@@ -4033,14 +4227,14 @@ var NavBar = forwardRef53(function NavBar2({
|
|
|
4033
4227
|
item.id
|
|
4034
4228
|
)) })
|
|
4035
4229
|
);
|
|
4036
|
-
const mobileBar = responsive ? /* @__PURE__ */
|
|
4230
|
+
const mobileBar = responsive ? /* @__PURE__ */ jsxs48(
|
|
4037
4231
|
"div",
|
|
4038
4232
|
{
|
|
4039
4233
|
className: cn(
|
|
4040
4234
|
"border-border bg-panel z-overlay sticky top-0 flex h-[52px] items-center gap-4 border-b px-5 md:hidden"
|
|
4041
4235
|
),
|
|
4042
4236
|
children: [
|
|
4043
|
-
/* @__PURE__ */
|
|
4237
|
+
/* @__PURE__ */ jsx56(
|
|
4044
4238
|
"button",
|
|
4045
4239
|
{
|
|
4046
4240
|
type: "button",
|
|
@@ -4050,15 +4244,15 @@ var NavBar = forwardRef53(function NavBar2({
|
|
|
4050
4244
|
children: "\u2630"
|
|
4051
4245
|
}
|
|
4052
4246
|
),
|
|
4053
|
-
brand && /* @__PURE__ */
|
|
4054
|
-
actions && /* @__PURE__ */
|
|
4247
|
+
brand && /* @__PURE__ */ jsx56("div", { className: "flex flex-1 items-center text-[13px] font-medium whitespace-nowrap", children: brand }),
|
|
4248
|
+
actions && /* @__PURE__ */ jsx56("div", { className: "flex items-center gap-3", children: actions })
|
|
4055
4249
|
]
|
|
4056
4250
|
}
|
|
4057
4251
|
) : null;
|
|
4058
4252
|
if (orientation === "horizontal") {
|
|
4059
|
-
return /* @__PURE__ */
|
|
4253
|
+
return /* @__PURE__ */ jsxs48(Fragment3, { children: [
|
|
4060
4254
|
mobileBar,
|
|
4061
|
-
/* @__PURE__ */
|
|
4255
|
+
/* @__PURE__ */ jsxs48(
|
|
4062
4256
|
"header",
|
|
4063
4257
|
{
|
|
4064
4258
|
ref,
|
|
@@ -4069,10 +4263,10 @@ var NavBar = forwardRef53(function NavBar2({
|
|
|
4069
4263
|
),
|
|
4070
4264
|
...props,
|
|
4071
4265
|
children: [
|
|
4072
|
-
brand && /* @__PURE__ */
|
|
4073
|
-
/* @__PURE__ */
|
|
4074
|
-
/* @__PURE__ */
|
|
4075
|
-
(item) => item.children?.length ? /* @__PURE__ */
|
|
4266
|
+
brand && /* @__PURE__ */ jsx56("div", { className: "shrink-0 text-[13px] font-medium whitespace-nowrap", children: brand }),
|
|
4267
|
+
/* @__PURE__ */ jsxs48(RadixNav.Root, { className: "relative flex-1", delayDuration: 120, children: [
|
|
4268
|
+
/* @__PURE__ */ jsx56(RadixNav.List, { className: "m-0! flex list-none! items-center gap-1 p-0! [&_li]:m-0!", children: items.map(
|
|
4269
|
+
(item) => item.children?.length ? /* @__PURE__ */ jsx56(
|
|
4076
4270
|
HorizontalDropdown,
|
|
4077
4271
|
{
|
|
4078
4272
|
item,
|
|
@@ -4081,7 +4275,7 @@ var NavBar = forwardRef53(function NavBar2({
|
|
|
4081
4275
|
onActivate: handleItemActivate
|
|
4082
4276
|
},
|
|
4083
4277
|
item.id
|
|
4084
|
-
) : /* @__PURE__ */
|
|
4278
|
+
) : /* @__PURE__ */ jsx56(RadixNav.Item, { children: /* @__PURE__ */ jsx56(
|
|
4085
4279
|
HorizontalLink,
|
|
4086
4280
|
{
|
|
4087
4281
|
item,
|
|
@@ -4090,13 +4284,13 @@ var NavBar = forwardRef53(function NavBar2({
|
|
|
4090
4284
|
}
|
|
4091
4285
|
) }, item.id)
|
|
4092
4286
|
) }),
|
|
4093
|
-
/* @__PURE__ */
|
|
4287
|
+
/* @__PURE__ */ jsx56("div", { className: "z-popover absolute top-full left-0 flex justify-start", children: /* @__PURE__ */ jsx56(RadixNav.Viewport, { className: "origin-top-left data-[state=open]:animate-[ship-fade-in_120ms_var(--easing-out)]" }) })
|
|
4094
4288
|
] }),
|
|
4095
|
-
actions && /* @__PURE__ */
|
|
4289
|
+
actions && /* @__PURE__ */ jsx56("div", { className: "flex items-center gap-3", children: actions })
|
|
4096
4290
|
]
|
|
4097
4291
|
}
|
|
4098
4292
|
),
|
|
4099
|
-
responsive && /* @__PURE__ */
|
|
4293
|
+
responsive && /* @__PURE__ */ jsx56(
|
|
4100
4294
|
Drawer,
|
|
4101
4295
|
{
|
|
4102
4296
|
open: drawerOpen,
|
|
@@ -4109,9 +4303,9 @@ var NavBar = forwardRef53(function NavBar2({
|
|
|
4109
4303
|
)
|
|
4110
4304
|
] });
|
|
4111
4305
|
}
|
|
4112
|
-
return /* @__PURE__ */
|
|
4306
|
+
return /* @__PURE__ */ jsxs48(Fragment3, { children: [
|
|
4113
4307
|
mobileBar,
|
|
4114
|
-
/* @__PURE__ */
|
|
4308
|
+
/* @__PURE__ */ jsxs48(
|
|
4115
4309
|
"aside",
|
|
4116
4310
|
{
|
|
4117
4311
|
ref,
|
|
@@ -4124,8 +4318,8 @@ var NavBar = forwardRef53(function NavBar2({
|
|
|
4124
4318
|
),
|
|
4125
4319
|
...props,
|
|
4126
4320
|
children: [
|
|
4127
|
-
brand && /* @__PURE__ */
|
|
4128
|
-
/* @__PURE__ */
|
|
4321
|
+
brand && /* @__PURE__ */ jsx56("div", { className: "px-2 py-1 text-[13px] font-medium", children: brand }),
|
|
4322
|
+
/* @__PURE__ */ jsx56("nav", { "aria-label": "Sidebar navigation", className: "flex flex-1 flex-col gap-1 overflow-y-auto", children: items.map((item) => /* @__PURE__ */ jsx56(
|
|
4129
4323
|
VerticalItem,
|
|
4130
4324
|
{
|
|
4131
4325
|
item,
|
|
@@ -4134,11 +4328,11 @@ var NavBar = forwardRef53(function NavBar2({
|
|
|
4134
4328
|
},
|
|
4135
4329
|
item.id
|
|
4136
4330
|
)) }),
|
|
4137
|
-
actions && /* @__PURE__ */
|
|
4331
|
+
actions && /* @__PURE__ */ jsx56("div", { className: "border-border mt-auto flex flex-col gap-2 border-t pt-3", children: actions })
|
|
4138
4332
|
]
|
|
4139
4333
|
}
|
|
4140
4334
|
),
|
|
4141
|
-
responsive && /* @__PURE__ */
|
|
4335
|
+
responsive && /* @__PURE__ */ jsx56(
|
|
4142
4336
|
Drawer,
|
|
4143
4337
|
{
|
|
4144
4338
|
open: drawerOpen,
|
|
@@ -4167,13 +4361,13 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
4167
4361
|
}
|
|
4168
4362
|
onActivate(item.id);
|
|
4169
4363
|
};
|
|
4170
|
-
const inner = /* @__PURE__ */
|
|
4171
|
-
item.icon != null && /* @__PURE__ */
|
|
4172
|
-
/* @__PURE__ */
|
|
4173
|
-
item.badge != null && /* @__PURE__ */
|
|
4364
|
+
const inner = /* @__PURE__ */ jsxs48(Fragment3, { children: [
|
|
4365
|
+
item.icon != null && /* @__PURE__ */ jsx56("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
4366
|
+
/* @__PURE__ */ jsx56("span", { children: item.label }),
|
|
4367
|
+
item.badge != null && /* @__PURE__ */ jsx56(ItemBadge, { active, children: item.badge })
|
|
4174
4368
|
] });
|
|
4175
4369
|
if (item.href) {
|
|
4176
|
-
return /* @__PURE__ */
|
|
4370
|
+
return /* @__PURE__ */ jsx56(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ jsx56(
|
|
4177
4371
|
"a",
|
|
4178
4372
|
{
|
|
4179
4373
|
href: item.href,
|
|
@@ -4185,7 +4379,7 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
4185
4379
|
}
|
|
4186
4380
|
) });
|
|
4187
4381
|
}
|
|
4188
|
-
return /* @__PURE__ */
|
|
4382
|
+
return /* @__PURE__ */ jsx56(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ jsx56(
|
|
4189
4383
|
"button",
|
|
4190
4384
|
{
|
|
4191
4385
|
type: "button",
|
|
@@ -4198,8 +4392,8 @@ function HorizontalLink({ item, active, onActivate }) {
|
|
|
4198
4392
|
) });
|
|
4199
4393
|
}
|
|
4200
4394
|
function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
4201
|
-
return /* @__PURE__ */
|
|
4202
|
-
/* @__PURE__ */
|
|
4395
|
+
return /* @__PURE__ */ jsxs48(RadixNav.Item, { children: [
|
|
4396
|
+
/* @__PURE__ */ jsxs48(
|
|
4203
4397
|
RadixNav.Trigger,
|
|
4204
4398
|
{
|
|
4205
4399
|
className: cn(
|
|
@@ -4211,9 +4405,9 @@ function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
|
4211
4405
|
),
|
|
4212
4406
|
disabled: item.disabled,
|
|
4213
4407
|
children: [
|
|
4214
|
-
item.icon != null && /* @__PURE__ */
|
|
4215
|
-
/* @__PURE__ */
|
|
4216
|
-
/* @__PURE__ */
|
|
4408
|
+
item.icon != null && /* @__PURE__ */ jsx56("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
4409
|
+
/* @__PURE__ */ jsx56("span", { children: item.label }),
|
|
4410
|
+
/* @__PURE__ */ jsx56(
|
|
4217
4411
|
"span",
|
|
4218
4412
|
{
|
|
4219
4413
|
"aria-hidden": true,
|
|
@@ -4224,7 +4418,7 @@ function HorizontalDropdown({ item, active, activeId, onActivate }) {
|
|
|
4224
4418
|
]
|
|
4225
4419
|
}
|
|
4226
4420
|
),
|
|
4227
|
-
/* @__PURE__ */
|
|
4421
|
+
/* @__PURE__ */ jsx56(RadixNav.Content, { className: "border-border bg-panel min-w-[220px] rounded-xs border p-2 shadow-lg", children: /* @__PURE__ */ jsx56("ul", { className: "m-0! flex list-none! flex-col gap-[2px] p-0! [&_li]:m-0!", children: item.children.map((child) => /* @__PURE__ */ jsx56("li", { children: /* @__PURE__ */ jsx56(DropdownLink, { item: child, active: child.id === activeId, onActivate }) }, child.id)) }) })
|
|
4228
4422
|
] });
|
|
4229
4423
|
}
|
|
4230
4424
|
function DropdownLink({ item, active, onActivate }) {
|
|
@@ -4241,13 +4435,13 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
4241
4435
|
}
|
|
4242
4436
|
onActivate(item.id);
|
|
4243
4437
|
};
|
|
4244
|
-
const inner = /* @__PURE__ */
|
|
4245
|
-
item.icon != null && /* @__PURE__ */
|
|
4246
|
-
/* @__PURE__ */
|
|
4247
|
-
item.badge != null && /* @__PURE__ */
|
|
4438
|
+
const inner = /* @__PURE__ */ jsxs48(Fragment3, { children: [
|
|
4439
|
+
item.icon != null && /* @__PURE__ */ jsx56("span", { "aria-hidden": true, className: "opacity-80", children: item.icon }),
|
|
4440
|
+
/* @__PURE__ */ jsx56("span", { className: "flex-1", children: item.label }),
|
|
4441
|
+
item.badge != null && /* @__PURE__ */ jsx56(ItemBadge, { active, children: item.badge })
|
|
4248
4442
|
] });
|
|
4249
4443
|
if (item.href) {
|
|
4250
|
-
return /* @__PURE__ */
|
|
4444
|
+
return /* @__PURE__ */ jsx56(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ jsx56(
|
|
4251
4445
|
"a",
|
|
4252
4446
|
{
|
|
4253
4447
|
href: item.href,
|
|
@@ -4259,7 +4453,7 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
4259
4453
|
}
|
|
4260
4454
|
) });
|
|
4261
4455
|
}
|
|
4262
|
-
return /* @__PURE__ */
|
|
4456
|
+
return /* @__PURE__ */ jsx56(RadixNav.Link, { asChild: true, active, children: /* @__PURE__ */ jsx56(
|
|
4263
4457
|
"button",
|
|
4264
4458
|
{
|
|
4265
4459
|
type: "button",
|
|
@@ -4274,9 +4468,9 @@ function DropdownLink({ item, active, onActivate }) {
|
|
|
4274
4468
|
function VerticalItem({ item, activeId, onActivate }) {
|
|
4275
4469
|
const hasChildren = (item.children?.length ?? 0) > 0;
|
|
4276
4470
|
const treeActive = isActiveTree(item, activeId);
|
|
4277
|
-
const [open, setOpen] =
|
|
4278
|
-
const prevTreeActive =
|
|
4279
|
-
|
|
4471
|
+
const [open, setOpen] = useState15(treeActive);
|
|
4472
|
+
const prevTreeActive = useRef8(treeActive);
|
|
4473
|
+
useEffect10(() => {
|
|
4280
4474
|
if (treeActive && !prevTreeActive.current) setOpen(true);
|
|
4281
4475
|
prevTreeActive.current = treeActive;
|
|
4282
4476
|
}, [treeActive]);
|
|
@@ -4288,7 +4482,7 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
4288
4482
|
}
|
|
4289
4483
|
onActivate(item.id);
|
|
4290
4484
|
};
|
|
4291
|
-
return /* @__PURE__ */
|
|
4485
|
+
return /* @__PURE__ */ jsx56(
|
|
4292
4486
|
NavItem,
|
|
4293
4487
|
{
|
|
4294
4488
|
icon: item.icon,
|
|
@@ -4301,8 +4495,8 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
4301
4495
|
}
|
|
4302
4496
|
);
|
|
4303
4497
|
}
|
|
4304
|
-
return /* @__PURE__ */
|
|
4305
|
-
/* @__PURE__ */
|
|
4498
|
+
return /* @__PURE__ */ jsxs48("div", { className: "flex flex-col", children: [
|
|
4499
|
+
/* @__PURE__ */ jsxs48(
|
|
4306
4500
|
"button",
|
|
4307
4501
|
{
|
|
4308
4502
|
type: "button",
|
|
@@ -4318,18 +4512,18 @@ function VerticalItem({ item, activeId, onActivate }) {
|
|
|
4318
4512
|
item.disabled && "pointer-events-none opacity-50"
|
|
4319
4513
|
),
|
|
4320
4514
|
children: [
|
|
4321
|
-
item.icon != null && /* @__PURE__ */
|
|
4322
|
-
/* @__PURE__ */
|
|
4323
|
-
item.badge != null && /* @__PURE__ */
|
|
4324
|
-
/* @__PURE__ */
|
|
4515
|
+
item.icon != null && /* @__PURE__ */ jsx56("span", { "aria-hidden": true, className: "w-[14px] text-center opacity-80", children: item.icon }),
|
|
4516
|
+
/* @__PURE__ */ jsx56("span", { className: "flex-1 truncate", children: item.label }),
|
|
4517
|
+
item.badge != null && /* @__PURE__ */ jsx56(ItemBadge, { active: treeActive, children: item.badge }),
|
|
4518
|
+
/* @__PURE__ */ jsx56("span", { "aria-hidden": true, className: "text-[10px] opacity-60", children: open ? "\u25BE" : "\u25B8" })
|
|
4325
4519
|
]
|
|
4326
4520
|
}
|
|
4327
4521
|
),
|
|
4328
|
-
open && /* @__PURE__ */
|
|
4522
|
+
open && /* @__PURE__ */ jsx56("div", { className: "border-border mt-1 ml-[18px] flex flex-col gap-[2px] border-l pl-3", children: item.children.map((child) => /* @__PURE__ */ jsx56(VerticalItem, { item: child, activeId, onActivate }, child.id)) })
|
|
4329
4523
|
] });
|
|
4330
4524
|
}
|
|
4331
4525
|
function ItemBadge({ active, children }) {
|
|
4332
|
-
return /* @__PURE__ */
|
|
4526
|
+
return /* @__PURE__ */ jsx56(
|
|
4333
4527
|
"span",
|
|
4334
4528
|
{
|
|
4335
4529
|
className: cn(
|
|
@@ -4342,8 +4536,8 @@ function ItemBadge({ active, children }) {
|
|
|
4342
4536
|
}
|
|
4343
4537
|
|
|
4344
4538
|
// src/patterns/OnboardingChecklist/OnboardingChecklist.tsx
|
|
4345
|
-
import { forwardRef as
|
|
4346
|
-
import { Fragment as Fragment4, jsx as
|
|
4539
|
+
import { forwardRef as forwardRef55 } from "react";
|
|
4540
|
+
import { Fragment as Fragment4, jsx as jsx57, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
4347
4541
|
var statusDot = {
|
|
4348
4542
|
pending: "off",
|
|
4349
4543
|
"in-progress": "sync",
|
|
@@ -4354,11 +4548,11 @@ var labelStateClass = {
|
|
|
4354
4548
|
"in-progress": "text-text",
|
|
4355
4549
|
done: "text-text-dim line-through"
|
|
4356
4550
|
};
|
|
4357
|
-
var OnboardingChecklist =
|
|
4551
|
+
var OnboardingChecklist = forwardRef55(
|
|
4358
4552
|
function OnboardingChecklist2({ items, onItemClick, title = "Get started", progressLabel, hideProgress, className, ...props }, ref) {
|
|
4359
4553
|
const total = items.length;
|
|
4360
4554
|
const done = items.filter((i) => i.status === "done").length;
|
|
4361
|
-
return /* @__PURE__ */
|
|
4555
|
+
return /* @__PURE__ */ jsxs49(
|
|
4362
4556
|
"section",
|
|
4363
4557
|
{
|
|
4364
4558
|
ref,
|
|
@@ -4369,11 +4563,11 @@ var OnboardingChecklist = forwardRef54(
|
|
|
4369
4563
|
),
|
|
4370
4564
|
...props,
|
|
4371
4565
|
children: [
|
|
4372
|
-
/* @__PURE__ */
|
|
4373
|
-
/* @__PURE__ */
|
|
4374
|
-
/* @__PURE__ */
|
|
4566
|
+
/* @__PURE__ */ jsxs49("header", { className: "flex items-center gap-2", children: [
|
|
4567
|
+
/* @__PURE__ */ jsx57("span", { className: "text-[14px] font-medium", children: title }),
|
|
4568
|
+
/* @__PURE__ */ jsx57("span", { className: "text-text-dim ml-auto font-mono text-[11px] tabular-nums", children: progressLabel ?? `${done} of ${total} complete` })
|
|
4375
4569
|
] }),
|
|
4376
|
-
!hideProgress && total > 0 && /* @__PURE__ */
|
|
4570
|
+
!hideProgress && total > 0 && /* @__PURE__ */ jsx57(
|
|
4377
4571
|
"div",
|
|
4378
4572
|
{
|
|
4379
4573
|
role: "progressbar",
|
|
@@ -4382,7 +4576,7 @@ var OnboardingChecklist = forwardRef54(
|
|
|
4382
4576
|
"aria-valuenow": done,
|
|
4383
4577
|
"aria-label": typeof title === "string" ? `${title} progress` : "Setup progress",
|
|
4384
4578
|
className: "bg-panel-2 h-[3px] w-full overflow-hidden rounded-full",
|
|
4385
|
-
children: /* @__PURE__ */
|
|
4579
|
+
children: /* @__PURE__ */ jsx57(
|
|
4386
4580
|
"span",
|
|
4387
4581
|
{
|
|
4388
4582
|
"aria-hidden": true,
|
|
@@ -4395,10 +4589,10 @@ var OnboardingChecklist = forwardRef54(
|
|
|
4395
4589
|
)
|
|
4396
4590
|
}
|
|
4397
4591
|
),
|
|
4398
|
-
/* @__PURE__ */
|
|
4592
|
+
/* @__PURE__ */ jsx57("ul", { className: "m-0 flex list-none flex-col gap-1 p-0", children: items.map((item) => {
|
|
4399
4593
|
const interactive = typeof onItemClick === "function";
|
|
4400
|
-
const labelBlock = /* @__PURE__ */
|
|
4401
|
-
/* @__PURE__ */
|
|
4594
|
+
const labelBlock = /* @__PURE__ */ jsxs49(Fragment4, { children: [
|
|
4595
|
+
/* @__PURE__ */ jsx57(
|
|
4402
4596
|
StatusDot,
|
|
4403
4597
|
{
|
|
4404
4598
|
state: statusDot[item.status],
|
|
@@ -4407,17 +4601,17 @@ var OnboardingChecklist = forwardRef54(
|
|
|
4407
4601
|
className: "mt-[3px]"
|
|
4408
4602
|
}
|
|
4409
4603
|
),
|
|
4410
|
-
/* @__PURE__ */
|
|
4411
|
-
/* @__PURE__ */
|
|
4412
|
-
item.description && /* @__PURE__ */
|
|
4604
|
+
/* @__PURE__ */ jsxs49("div", { className: "flex min-w-0 flex-1 flex-col gap-[2px]", children: [
|
|
4605
|
+
/* @__PURE__ */ jsx57("span", { className: cn("text-[13px]", labelStateClass[item.status]), children: item.label }),
|
|
4606
|
+
item.description && /* @__PURE__ */ jsx57("span", { className: "text-text-muted text-[12px] leading-[1.45]", children: item.description })
|
|
4413
4607
|
] })
|
|
4414
4608
|
] });
|
|
4415
4609
|
const labelRegionClass = cn(
|
|
4416
4610
|
"flex flex-1 items-start gap-3 rounded-md px-2 py-2 text-left transition-colors duration-(--duration-micro)",
|
|
4417
4611
|
interactive && "cursor-pointer outline-none hover:bg-panel-2 focus-visible:ring-[3px] focus-visible:ring-accent-dim"
|
|
4418
4612
|
);
|
|
4419
|
-
return /* @__PURE__ */
|
|
4420
|
-
interactive ? /* @__PURE__ */
|
|
4613
|
+
return /* @__PURE__ */ jsxs49("li", { className: "flex items-start gap-2", children: [
|
|
4614
|
+
interactive ? /* @__PURE__ */ jsx57(
|
|
4421
4615
|
"button",
|
|
4422
4616
|
{
|
|
4423
4617
|
type: "button",
|
|
@@ -4426,8 +4620,8 @@ var OnboardingChecklist = forwardRef54(
|
|
|
4426
4620
|
className: labelRegionClass,
|
|
4427
4621
|
children: labelBlock
|
|
4428
4622
|
}
|
|
4429
|
-
) : /* @__PURE__ */
|
|
4430
|
-
item.action && /* @__PURE__ */
|
|
4623
|
+
) : /* @__PURE__ */ jsx57("div", { className: labelRegionClass, children: labelBlock }),
|
|
4624
|
+
item.action && /* @__PURE__ */ jsx57("div", { className: "shrink-0 self-center", children: item.action })
|
|
4431
4625
|
] }, item.id);
|
|
4432
4626
|
}) })
|
|
4433
4627
|
]
|
|
@@ -4438,8 +4632,8 @@ var OnboardingChecklist = forwardRef54(
|
|
|
4438
4632
|
OnboardingChecklist.displayName = "OnboardingChecklist";
|
|
4439
4633
|
|
|
4440
4634
|
// src/patterns/Pagination/Pagination.tsx
|
|
4441
|
-
import { forwardRef as
|
|
4442
|
-
import { jsx as
|
|
4635
|
+
import { forwardRef as forwardRef56 } from "react";
|
|
4636
|
+
import { jsx as jsx58, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
4443
4637
|
function buildRange(page, total, siblings) {
|
|
4444
4638
|
if (total <= 0) return [];
|
|
4445
4639
|
const items = [];
|
|
@@ -4452,9 +4646,9 @@ function buildRange(page, total, siblings) {
|
|
|
4452
4646
|
if (total > 1) items.push(total);
|
|
4453
4647
|
return items;
|
|
4454
4648
|
}
|
|
4455
|
-
var Pagination =
|
|
4649
|
+
var Pagination = forwardRef56(function Pagination2({ page, total, onPageChange, siblings = 1, className, ...props }, ref) {
|
|
4456
4650
|
const items = buildRange(page, total, siblings);
|
|
4457
|
-
return /* @__PURE__ */
|
|
4651
|
+
return /* @__PURE__ */ jsxs50(
|
|
4458
4652
|
"nav",
|
|
4459
4653
|
{
|
|
4460
4654
|
ref,
|
|
@@ -4462,7 +4656,7 @@ var Pagination = forwardRef55(function Pagination2({ page, total, onPageChange,
|
|
|
4462
4656
|
className: cn("inline-flex items-center gap-1", className),
|
|
4463
4657
|
...props,
|
|
4464
4658
|
children: [
|
|
4465
|
-
/* @__PURE__ */
|
|
4659
|
+
/* @__PURE__ */ jsx58(
|
|
4466
4660
|
IconButton,
|
|
4467
4661
|
{
|
|
4468
4662
|
size: "sm",
|
|
@@ -4475,7 +4669,7 @@ var Pagination = forwardRef55(function Pagination2({ page, total, onPageChange,
|
|
|
4475
4669
|
),
|
|
4476
4670
|
items.map((item, i) => {
|
|
4477
4671
|
if (item === "start-ellipsis" || item === "end-ellipsis") {
|
|
4478
|
-
return /* @__PURE__ */
|
|
4672
|
+
return /* @__PURE__ */ jsx58(
|
|
4479
4673
|
"span",
|
|
4480
4674
|
{
|
|
4481
4675
|
"aria-hidden": true,
|
|
@@ -4486,7 +4680,7 @@ var Pagination = forwardRef55(function Pagination2({ page, total, onPageChange,
|
|
|
4486
4680
|
);
|
|
4487
4681
|
}
|
|
4488
4682
|
const isActive = item === page;
|
|
4489
|
-
return /* @__PURE__ */
|
|
4683
|
+
return /* @__PURE__ */ jsx58(
|
|
4490
4684
|
"button",
|
|
4491
4685
|
{
|
|
4492
4686
|
type: "button",
|
|
@@ -4504,7 +4698,7 @@ var Pagination = forwardRef55(function Pagination2({ page, total, onPageChange,
|
|
|
4504
4698
|
item
|
|
4505
4699
|
);
|
|
4506
4700
|
}),
|
|
4507
|
-
/* @__PURE__ */
|
|
4701
|
+
/* @__PURE__ */ jsx58(
|
|
4508
4702
|
IconButton,
|
|
4509
4703
|
{
|
|
4510
4704
|
size: "sm",
|
|
@@ -4522,10 +4716,10 @@ var Pagination = forwardRef55(function Pagination2({ page, total, onPageChange,
|
|
|
4522
4716
|
Pagination.displayName = "Pagination";
|
|
4523
4717
|
|
|
4524
4718
|
// src/patterns/Progress/Progress.tsx
|
|
4525
|
-
import { cva as
|
|
4526
|
-
import { forwardRef as
|
|
4527
|
-
import { jsx as
|
|
4528
|
-
var trackStyles =
|
|
4719
|
+
import { cva as cva12 } from "class-variance-authority";
|
|
4720
|
+
import { forwardRef as forwardRef57 } from "react";
|
|
4721
|
+
import { jsx as jsx59, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
4722
|
+
var trackStyles = cva12("w-full rounded-full bg-panel-2 overflow-hidden", {
|
|
4529
4723
|
variants: {
|
|
4530
4724
|
size: {
|
|
4531
4725
|
sm: "h-[3px]",
|
|
@@ -4535,7 +4729,7 @@ var trackStyles = cva11("w-full rounded-full bg-panel-2 overflow-hidden", {
|
|
|
4535
4729
|
},
|
|
4536
4730
|
defaultVariants: { size: "md" }
|
|
4537
4731
|
});
|
|
4538
|
-
var fillStyles =
|
|
4732
|
+
var fillStyles = cva12("h-full rounded-full transition-[width] duration-(--duration-step)", {
|
|
4539
4733
|
variants: {
|
|
4540
4734
|
tone: {
|
|
4541
4735
|
accent: "bg-accent",
|
|
@@ -4546,7 +4740,7 @@ var fillStyles = cva11("h-full rounded-full transition-[width] duration-(--durat
|
|
|
4546
4740
|
},
|
|
4547
4741
|
defaultVariants: { tone: "accent" }
|
|
4548
4742
|
});
|
|
4549
|
-
var Progress =
|
|
4743
|
+
var Progress = forwardRef57(function Progress2({
|
|
4550
4744
|
value = 0,
|
|
4551
4745
|
max = 100,
|
|
4552
4746
|
indeterminate = false,
|
|
@@ -4560,15 +4754,15 @@ var Progress = forwardRef56(function Progress2({
|
|
|
4560
4754
|
const clamped = Math.min(max, Math.max(0, value));
|
|
4561
4755
|
const pct = max > 0 ? clamped / max * 100 : 0;
|
|
4562
4756
|
const display = Math.round(pct);
|
|
4563
|
-
return /* @__PURE__ */
|
|
4564
|
-
label != null && /* @__PURE__ */
|
|
4565
|
-
/* @__PURE__ */
|
|
4566
|
-
showValue && !indeterminate && /* @__PURE__ */
|
|
4757
|
+
return /* @__PURE__ */ jsxs51("div", { ref, className: cn("flex w-full flex-col gap-2", className), ...props, children: [
|
|
4758
|
+
label != null && /* @__PURE__ */ jsxs51("div", { className: "flex text-[12px]", children: [
|
|
4759
|
+
/* @__PURE__ */ jsx59("span", { className: "text-text-muted", children: label }),
|
|
4760
|
+
showValue && !indeterminate && /* @__PURE__ */ jsxs51("span", { className: "text-text ml-auto font-mono tabular-nums", children: [
|
|
4567
4761
|
display,
|
|
4568
4762
|
"%"
|
|
4569
4763
|
] })
|
|
4570
4764
|
] }),
|
|
4571
|
-
/* @__PURE__ */
|
|
4765
|
+
/* @__PURE__ */ jsx59(
|
|
4572
4766
|
"div",
|
|
4573
4767
|
{
|
|
4574
4768
|
role: "progressbar",
|
|
@@ -4577,7 +4771,7 @@ var Progress = forwardRef56(function Progress2({
|
|
|
4577
4771
|
"aria-valuenow": indeterminate ? void 0 : display,
|
|
4578
4772
|
"aria-label": typeof label === "string" ? label : void 0,
|
|
4579
4773
|
className: trackStyles({ size }),
|
|
4580
|
-
children: indeterminate ? /* @__PURE__ */
|
|
4774
|
+
children: indeterminate ? /* @__PURE__ */ jsx59(
|
|
4581
4775
|
"span",
|
|
4582
4776
|
{
|
|
4583
4777
|
"aria-hidden": true,
|
|
@@ -4587,7 +4781,7 @@ var Progress = forwardRef56(function Progress2({
|
|
|
4587
4781
|
"animate-[ship-indeterminate_1.4s_linear_infinite]"
|
|
4588
4782
|
)
|
|
4589
4783
|
}
|
|
4590
|
-
) : /* @__PURE__ */
|
|
4784
|
+
) : /* @__PURE__ */ jsx59("span", { "aria-hidden": true, className: fillStyles({ tone }), style: { width: `${pct}%` } })
|
|
4591
4785
|
}
|
|
4592
4786
|
)
|
|
4593
4787
|
] });
|
|
@@ -4595,18 +4789,18 @@ var Progress = forwardRef56(function Progress2({
|
|
|
4595
4789
|
Progress.displayName = "Progress";
|
|
4596
4790
|
|
|
4597
4791
|
// src/patterns/PullToRefresh/PullToRefresh.tsx
|
|
4598
|
-
import { forwardRef as
|
|
4599
|
-
import { jsx as
|
|
4792
|
+
import { forwardRef as forwardRef58 } from "react";
|
|
4793
|
+
import { jsx as jsx60, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
4600
4794
|
var labels = {
|
|
4601
4795
|
idle: "Pull to refresh",
|
|
4602
4796
|
pulling: "Pull to refresh",
|
|
4603
4797
|
ready: "Release to refresh",
|
|
4604
4798
|
loading: "Refreshing\u2026"
|
|
4605
4799
|
};
|
|
4606
|
-
var PullToRefresh =
|
|
4800
|
+
var PullToRefresh = forwardRef58(function PullToRefresh2({ state = "idle", label, className, ...props }, ref) {
|
|
4607
4801
|
const isLoading = state === "loading";
|
|
4608
4802
|
const transform = state === "ready" ? "rotate(180deg)" : state === "pulling" ? "rotate(90deg)" : "rotate(0deg)";
|
|
4609
|
-
return /* @__PURE__ */
|
|
4803
|
+
return /* @__PURE__ */ jsxs52(
|
|
4610
4804
|
"div",
|
|
4611
4805
|
{
|
|
4612
4806
|
ref,
|
|
@@ -4616,7 +4810,7 @@ var PullToRefresh = forwardRef57(function PullToRefresh2({ state = "idle", label
|
|
|
4616
4810
|
className: cn("text-text-muted flex flex-col items-center gap-[6px] py-3", className),
|
|
4617
4811
|
...props,
|
|
4618
4812
|
children: [
|
|
4619
|
-
/* @__PURE__ */
|
|
4813
|
+
/* @__PURE__ */ jsx60(
|
|
4620
4814
|
"div",
|
|
4621
4815
|
{
|
|
4622
4816
|
"aria-hidden": true,
|
|
@@ -4632,7 +4826,7 @@ var PullToRefresh = forwardRef57(function PullToRefresh2({ state = "idle", label
|
|
|
4632
4826
|
}
|
|
4633
4827
|
}
|
|
4634
4828
|
),
|
|
4635
|
-
/* @__PURE__ */
|
|
4829
|
+
/* @__PURE__ */ jsx60("span", { className: "text-m-eyebrow font-mono tracking-wide uppercase", children: label ?? labels[state] })
|
|
4636
4830
|
]
|
|
4637
4831
|
}
|
|
4638
4832
|
);
|
|
@@ -4640,8 +4834,8 @@ var PullToRefresh = forwardRef57(function PullToRefresh2({ state = "idle", label
|
|
|
4640
4834
|
PullToRefresh.displayName = "PullToRefresh";
|
|
4641
4835
|
|
|
4642
4836
|
// src/patterns/Sparkline/Sparkline.tsx
|
|
4643
|
-
import { forwardRef as
|
|
4644
|
-
import { jsx as
|
|
4837
|
+
import { forwardRef as forwardRef59, useMemo as useMemo5 } from "react";
|
|
4838
|
+
import { jsx as jsx61, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
4645
4839
|
function buildPath(values, w, h) {
|
|
4646
4840
|
if (values.length === 0) return { line: "", area: "" };
|
|
4647
4841
|
const pad = 2;
|
|
@@ -4660,7 +4854,7 @@ function buildPath(values, w, h) {
|
|
|
4660
4854
|
)} L${pad.toFixed(2)},${(h - pad).toFixed(2)} Z`;
|
|
4661
4855
|
return { line, area };
|
|
4662
4856
|
}
|
|
4663
|
-
var Sparkline =
|
|
4857
|
+
var Sparkline = forwardRef59(function Sparkline2({
|
|
4664
4858
|
values,
|
|
4665
4859
|
width = 160,
|
|
4666
4860
|
height = 32,
|
|
@@ -4672,7 +4866,7 @@ var Sparkline = forwardRef58(function Sparkline2({
|
|
|
4672
4866
|
...props
|
|
4673
4867
|
}, ref) {
|
|
4674
4868
|
const { line, area } = useMemo5(() => buildPath(values, width, height), [values, width, height]);
|
|
4675
|
-
return /* @__PURE__ */
|
|
4869
|
+
return /* @__PURE__ */ jsxs53(
|
|
4676
4870
|
"svg",
|
|
4677
4871
|
{
|
|
4678
4872
|
ref,
|
|
@@ -4684,8 +4878,8 @@ var Sparkline = forwardRef58(function Sparkline2({
|
|
|
4684
4878
|
className: cn("inline-block", className),
|
|
4685
4879
|
...props,
|
|
4686
4880
|
children: [
|
|
4687
|
-
fill && /* @__PURE__ */
|
|
4688
|
-
/* @__PURE__ */
|
|
4881
|
+
fill && /* @__PURE__ */ jsx61("path", { d: area, fill: stroke, fillOpacity: 0.16, stroke: "none" }),
|
|
4882
|
+
/* @__PURE__ */ jsx61(
|
|
4689
4883
|
"path",
|
|
4690
4884
|
{
|
|
4691
4885
|
d: line,
|
|
@@ -4703,16 +4897,16 @@ var Sparkline = forwardRef58(function Sparkline2({
|
|
|
4703
4897
|
Sparkline.displayName = "Sparkline";
|
|
4704
4898
|
|
|
4705
4899
|
// src/patterns/Spinner/Spinner.tsx
|
|
4706
|
-
import { forwardRef as
|
|
4707
|
-
import { jsx as
|
|
4900
|
+
import { forwardRef as forwardRef60 } from "react";
|
|
4901
|
+
import { jsx as jsx62 } from "react/jsx-runtime";
|
|
4708
4902
|
var sizes = {
|
|
4709
4903
|
sm: { box: "h-3 w-3", border: "border-[2px]" },
|
|
4710
4904
|
md: { box: "h-4 w-4", border: "border-[2px]" },
|
|
4711
4905
|
lg: { box: "h-5 w-5", border: "border-[2px]" }
|
|
4712
4906
|
};
|
|
4713
|
-
var Spinner2 =
|
|
4907
|
+
var Spinner2 = forwardRef60(function Spinner3({ size = "md", label = "Loading", className, ...props }, ref) {
|
|
4714
4908
|
const s = sizes[size];
|
|
4715
|
-
return /* @__PURE__ */
|
|
4909
|
+
return /* @__PURE__ */ jsx62(
|
|
4716
4910
|
"span",
|
|
4717
4911
|
{
|
|
4718
4912
|
ref,
|
|
@@ -4720,7 +4914,7 @@ var Spinner2 = forwardRef59(function Spinner3({ size = "md", label = "Loading",
|
|
|
4720
4914
|
"aria-label": label,
|
|
4721
4915
|
className: cn("inline-block", className),
|
|
4722
4916
|
...props,
|
|
4723
|
-
children: /* @__PURE__ */
|
|
4917
|
+
children: /* @__PURE__ */ jsx62(
|
|
4724
4918
|
"span",
|
|
4725
4919
|
{
|
|
4726
4920
|
"aria-hidden": true,
|
|
@@ -4737,8 +4931,8 @@ var Spinner2 = forwardRef59(function Spinner3({ size = "md", label = "Loading",
|
|
|
4737
4931
|
Spinner2.displayName = "Spinner";
|
|
4738
4932
|
|
|
4739
4933
|
// src/patterns/Stepper/Stepper.tsx
|
|
4740
|
-
import { forwardRef as
|
|
4741
|
-
import { jsx as
|
|
4934
|
+
import { forwardRef as forwardRef61, Fragment as Fragment5 } from "react";
|
|
4935
|
+
import { jsx as jsx63, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
4742
4936
|
var dotBase = "h-6 w-6 rounded-full grid place-items-center text-[11px] font-mono font-semibold border";
|
|
4743
4937
|
var dotStateClass = {
|
|
4744
4938
|
done: "bg-accent text-on-accent border-accent",
|
|
@@ -4755,8 +4949,8 @@ function stateFor(index, current) {
|
|
|
4755
4949
|
if (index === current) return "current";
|
|
4756
4950
|
return "upcoming";
|
|
4757
4951
|
}
|
|
4758
|
-
var Stepper =
|
|
4759
|
-
return /* @__PURE__ */
|
|
4952
|
+
var Stepper = forwardRef61(function Stepper2({ steps, current, className, ...props }, ref) {
|
|
4953
|
+
return /* @__PURE__ */ jsx63(
|
|
4760
4954
|
"ol",
|
|
4761
4955
|
{
|
|
4762
4956
|
ref,
|
|
@@ -4768,19 +4962,19 @@ var Stepper = forwardRef60(function Stepper2({ steps, current, className, ...pro
|
|
|
4768
4962
|
const id = typeof step === "string" ? void 0 : step.id;
|
|
4769
4963
|
const state = stateFor(i, current);
|
|
4770
4964
|
const connectorActive = i < current;
|
|
4771
|
-
return /* @__PURE__ */
|
|
4772
|
-
/* @__PURE__ */
|
|
4965
|
+
return /* @__PURE__ */ jsxs54(Fragment5, { children: [
|
|
4966
|
+
/* @__PURE__ */ jsxs54(
|
|
4773
4967
|
"li",
|
|
4774
4968
|
{
|
|
4775
4969
|
"aria-current": state === "current" ? "step" : void 0,
|
|
4776
4970
|
className: "flex items-center gap-2",
|
|
4777
4971
|
children: [
|
|
4778
|
-
/* @__PURE__ */
|
|
4779
|
-
/* @__PURE__ */
|
|
4972
|
+
/* @__PURE__ */ jsx63("span", { "aria-hidden": true, className: cn(dotBase, dotStateClass[state]), children: state === "done" ? "\u2713" : i + 1 }),
|
|
4973
|
+
/* @__PURE__ */ jsx63("span", { className: cn("text-[12px]", labelStateClass2[state]), children: label })
|
|
4780
4974
|
]
|
|
4781
4975
|
}
|
|
4782
4976
|
),
|
|
4783
|
-
i < steps.length - 1 && /* @__PURE__ */
|
|
4977
|
+
i < steps.length - 1 && /* @__PURE__ */ jsx63(
|
|
4784
4978
|
"span",
|
|
4785
4979
|
{
|
|
4786
4980
|
"aria-hidden": true,
|
|
@@ -4796,16 +4990,16 @@ Stepper.displayName = "Stepper";
|
|
|
4796
4990
|
|
|
4797
4991
|
// src/patterns/TabBar/TabBar.tsx
|
|
4798
4992
|
import {
|
|
4799
|
-
forwardRef as
|
|
4800
|
-
useCallback as
|
|
4801
|
-
useState as
|
|
4993
|
+
forwardRef as forwardRef62,
|
|
4994
|
+
useCallback as useCallback12,
|
|
4995
|
+
useState as useState16
|
|
4802
4996
|
} from "react";
|
|
4803
|
-
import { jsx as
|
|
4804
|
-
var TabBar =
|
|
4997
|
+
import { jsx as jsx64, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
4998
|
+
var TabBar = forwardRef62(function TabBar2({ items, value, defaultValue, onValueChange, className, ...props }, ref) {
|
|
4805
4999
|
const isControlled = value !== void 0;
|
|
4806
|
-
const [internalValue, setInternalValue] =
|
|
5000
|
+
const [internalValue, setInternalValue] = useState16(defaultValue);
|
|
4807
5001
|
const activeId = isControlled ? value : internalValue;
|
|
4808
|
-
const handleSelect =
|
|
5002
|
+
const handleSelect = useCallback12(
|
|
4809
5003
|
(id, e) => {
|
|
4810
5004
|
if (!isControlled) setInternalValue(id);
|
|
4811
5005
|
onValueChange?.(id);
|
|
@@ -4813,7 +5007,7 @@ var TabBar = forwardRef61(function TabBar2({ items, value, defaultValue, onValue
|
|
|
4813
5007
|
},
|
|
4814
5008
|
[isControlled, onValueChange]
|
|
4815
5009
|
);
|
|
4816
|
-
return /* @__PURE__ */
|
|
5010
|
+
return /* @__PURE__ */ jsx64(
|
|
4817
5011
|
"nav",
|
|
4818
5012
|
{
|
|
4819
5013
|
ref,
|
|
@@ -4828,7 +5022,7 @@ var TabBar = forwardRef61(function TabBar2({ items, value, defaultValue, onValue
|
|
|
4828
5022
|
children: items.map((item) => {
|
|
4829
5023
|
const isActive = item.id === activeId;
|
|
4830
5024
|
if (item.elevated) {
|
|
4831
|
-
return /* @__PURE__ */
|
|
5025
|
+
return /* @__PURE__ */ jsx64("div", { className: "grid place-items-center", children: /* @__PURE__ */ jsxs55(
|
|
4832
5026
|
"button",
|
|
4833
5027
|
{
|
|
4834
5028
|
type: "button",
|
|
@@ -4844,13 +5038,13 @@ var TabBar = forwardRef61(function TabBar2({ items, value, defaultValue, onValue
|
|
|
4844
5038
|
"disabled:cursor-not-allowed disabled:opacity-40"
|
|
4845
5039
|
),
|
|
4846
5040
|
children: [
|
|
4847
|
-
/* @__PURE__ */
|
|
4848
|
-
/* @__PURE__ */
|
|
5041
|
+
/* @__PURE__ */ jsx64("span", { "aria-hidden": true, children: item.icon }),
|
|
5042
|
+
/* @__PURE__ */ jsx64("span", { className: "sr-only", children: item.label })
|
|
4849
5043
|
]
|
|
4850
5044
|
}
|
|
4851
5045
|
) }, item.id);
|
|
4852
5046
|
}
|
|
4853
|
-
return /* @__PURE__ */
|
|
5047
|
+
return /* @__PURE__ */ jsxs55(
|
|
4854
5048
|
"button",
|
|
4855
5049
|
{
|
|
4856
5050
|
type: "button",
|
|
@@ -4865,9 +5059,9 @@ var TabBar = forwardRef61(function TabBar2({ items, value, defaultValue, onValue
|
|
|
4865
5059
|
isActive ? "text-accent-text" : "text-text-muted hover:text-text"
|
|
4866
5060
|
),
|
|
4867
5061
|
children: [
|
|
4868
|
-
/* @__PURE__ */
|
|
5062
|
+
/* @__PURE__ */ jsxs55("span", { className: "relative inline-flex", "aria-hidden": true, children: [
|
|
4869
5063
|
item.icon,
|
|
4870
|
-
item.badge != null && /* @__PURE__ */
|
|
5064
|
+
item.badge != null && /* @__PURE__ */ jsx64(
|
|
4871
5065
|
"span",
|
|
4872
5066
|
{
|
|
4873
5067
|
className: cn(
|
|
@@ -4878,9 +5072,9 @@ var TabBar = forwardRef61(function TabBar2({ items, value, defaultValue, onValue
|
|
|
4878
5072
|
}
|
|
4879
5073
|
)
|
|
4880
5074
|
] }),
|
|
4881
|
-
/* @__PURE__ */
|
|
5075
|
+
/* @__PURE__ */ jsxs55("span", { className: "text-[10px] font-medium tracking-tight", children: [
|
|
4882
5076
|
item.label,
|
|
4883
|
-
item.badge != null && /* @__PURE__ */
|
|
5077
|
+
item.badge != null && /* @__PURE__ */ jsxs55("span", { className: "sr-only", children: [
|
|
4884
5078
|
", ",
|
|
4885
5079
|
item.badge,
|
|
4886
5080
|
" unread"
|
|
@@ -4898,11 +5092,11 @@ TabBar.displayName = "TabBar";
|
|
|
4898
5092
|
|
|
4899
5093
|
// src/patterns/Tabs/Tabs.tsx
|
|
4900
5094
|
import * as RadixTabs from "@radix-ui/react-tabs";
|
|
4901
|
-
import { cva as
|
|
4902
|
-
import { createContext as createContext2, forwardRef as
|
|
4903
|
-
import { jsx as
|
|
5095
|
+
import { cva as cva13 } from "class-variance-authority";
|
|
5096
|
+
import { createContext as createContext2, forwardRef as forwardRef63, useContext as useContext2 } from "react";
|
|
5097
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
4904
5098
|
var TabsVariantContext = createContext2("underline");
|
|
4905
|
-
var tabsListStyles =
|
|
5099
|
+
var tabsListStyles = cva13("", {
|
|
4906
5100
|
variants: {
|
|
4907
5101
|
variant: {
|
|
4908
5102
|
underline: "flex gap-6 border-b border-border",
|
|
@@ -4910,7 +5104,7 @@ var tabsListStyles = cva12("", {
|
|
|
4910
5104
|
}
|
|
4911
5105
|
}
|
|
4912
5106
|
});
|
|
4913
|
-
var tabsTriggerStyles =
|
|
5107
|
+
var tabsTriggerStyles = cva13(
|
|
4914
5108
|
"cursor-pointer outline-none transition-colors duration-(--duration-micro) focus-visible:ring-[3px] focus-visible:ring-accent-dim",
|
|
4915
5109
|
{
|
|
4916
5110
|
variants: {
|
|
@@ -4931,8 +5125,8 @@ var tabsTriggerStyles = cva12(
|
|
|
4931
5125
|
}
|
|
4932
5126
|
}
|
|
4933
5127
|
);
|
|
4934
|
-
var Tabs =
|
|
4935
|
-
return /* @__PURE__ */
|
|
5128
|
+
var Tabs = forwardRef63(function Tabs2({ variant = "underline", className, ...props }, ref) {
|
|
5129
|
+
return /* @__PURE__ */ jsx65(TabsVariantContext.Provider, { value: variant, children: /* @__PURE__ */ jsx65(
|
|
4936
5130
|
RadixTabs.Root,
|
|
4937
5131
|
{
|
|
4938
5132
|
ref,
|
|
@@ -4942,14 +5136,14 @@ var Tabs = forwardRef62(function Tabs2({ variant = "underline", className, ...pr
|
|
|
4942
5136
|
) });
|
|
4943
5137
|
});
|
|
4944
5138
|
Tabs.displayName = "Tabs";
|
|
4945
|
-
var TabsList =
|
|
5139
|
+
var TabsList = forwardRef63(function TabsList2({ className, ...props }, ref) {
|
|
4946
5140
|
const variant = useContext2(TabsVariantContext);
|
|
4947
|
-
return /* @__PURE__ */
|
|
5141
|
+
return /* @__PURE__ */ jsx65(RadixTabs.List, { ref, className: cn(tabsListStyles({ variant }), className), ...props });
|
|
4948
5142
|
});
|
|
4949
5143
|
TabsList.displayName = "TabsList";
|
|
4950
|
-
var Tab =
|
|
5144
|
+
var Tab = forwardRef63(function Tab2({ className, ...props }, ref) {
|
|
4951
5145
|
const variant = useContext2(TabsVariantContext);
|
|
4952
|
-
return /* @__PURE__ */
|
|
5146
|
+
return /* @__PURE__ */ jsx65(
|
|
4953
5147
|
RadixTabs.Trigger,
|
|
4954
5148
|
{
|
|
4955
5149
|
ref,
|
|
@@ -4959,9 +5153,9 @@ var Tab = forwardRef62(function Tab2({ className, ...props }, ref) {
|
|
|
4959
5153
|
);
|
|
4960
5154
|
});
|
|
4961
5155
|
Tab.displayName = "Tab";
|
|
4962
|
-
var TabsContent =
|
|
5156
|
+
var TabsContent = forwardRef63(
|
|
4963
5157
|
function TabsContent2({ className, ...props }, ref) {
|
|
4964
|
-
return /* @__PURE__ */
|
|
5158
|
+
return /* @__PURE__ */ jsx65(
|
|
4965
5159
|
RadixTabs.Content,
|
|
4966
5160
|
{
|
|
4967
5161
|
ref,
|
|
@@ -4977,8 +5171,8 @@ var TabsContent = forwardRef62(
|
|
|
4977
5171
|
TabsContent.displayName = "TabsContent";
|
|
4978
5172
|
|
|
4979
5173
|
// src/patterns/Timeline/Timeline.tsx
|
|
4980
|
-
import { forwardRef as
|
|
4981
|
-
import { jsx as
|
|
5174
|
+
import { forwardRef as forwardRef64 } from "react";
|
|
5175
|
+
import { jsx as jsx66, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
4982
5176
|
var ringClass = {
|
|
4983
5177
|
accent: "border-accent",
|
|
4984
5178
|
ok: "border-ok",
|
|
@@ -4986,8 +5180,8 @@ var ringClass = {
|
|
|
4986
5180
|
err: "border-err",
|
|
4987
5181
|
muted: "border-text-dim"
|
|
4988
5182
|
};
|
|
4989
|
-
var Timeline =
|
|
4990
|
-
return /* @__PURE__ */
|
|
5183
|
+
var Timeline = forwardRef64(function Timeline2({ events, className, children, ...props }, ref) {
|
|
5184
|
+
return /* @__PURE__ */ jsx66(
|
|
4991
5185
|
"ol",
|
|
4992
5186
|
{
|
|
4993
5187
|
ref,
|
|
@@ -4997,14 +5191,14 @@ var Timeline = forwardRef63(function Timeline2({ events, className, children, ..
|
|
|
4997
5191
|
className
|
|
4998
5192
|
),
|
|
4999
5193
|
...props,
|
|
5000
|
-
children: events ? events.map((e, i) => /* @__PURE__ */
|
|
5194
|
+
children: events ? events.map((e, i) => /* @__PURE__ */ jsx66(TimelineItem, { tone: e.tone, time: e.time, description: e.description, children: e.title }, i)) : children
|
|
5001
5195
|
}
|
|
5002
5196
|
);
|
|
5003
5197
|
});
|
|
5004
5198
|
Timeline.displayName = "Timeline";
|
|
5005
|
-
var TimelineItem =
|
|
5006
|
-
return /* @__PURE__ */
|
|
5007
|
-
/* @__PURE__ */
|
|
5199
|
+
var TimelineItem = forwardRef64(function TimelineItem2({ tone = "accent", description, time, className, children, ...props }, ref) {
|
|
5200
|
+
return /* @__PURE__ */ jsxs56("li", { ref, className: cn("relative mb-[18px] last:mb-0", className), ...props, children: [
|
|
5201
|
+
/* @__PURE__ */ jsx66(
|
|
5008
5202
|
"span",
|
|
5009
5203
|
{
|
|
5010
5204
|
"aria-hidden": true,
|
|
@@ -5014,15 +5208,15 @@ var TimelineItem = forwardRef63(function TimelineItem2({ tone = "accent", descri
|
|
|
5014
5208
|
)
|
|
5015
5209
|
}
|
|
5016
5210
|
),
|
|
5017
|
-
/* @__PURE__ */
|
|
5018
|
-
description && /* @__PURE__ */
|
|
5019
|
-
time && /* @__PURE__ */
|
|
5211
|
+
/* @__PURE__ */ jsx66("div", { className: "text-[13px] font-medium", children }),
|
|
5212
|
+
description && /* @__PURE__ */ jsx66("div", { className: "text-text-muted text-[12px]", children: description }),
|
|
5213
|
+
time && /* @__PURE__ */ jsx66("div", { className: "text-text-dim mt-[2px] font-mono text-[10px]", children: time })
|
|
5020
5214
|
] });
|
|
5021
5215
|
});
|
|
5022
5216
|
TimelineItem.displayName = "TimelineItem";
|
|
5023
5217
|
|
|
5024
5218
|
// src/patterns/Timeline/ActivityTimeline.tsx
|
|
5025
|
-
import { forwardRef as
|
|
5219
|
+
import { forwardRef as forwardRef65 } from "react";
|
|
5026
5220
|
|
|
5027
5221
|
// src/patterns/Timeline/formatRelative.ts
|
|
5028
5222
|
var SECOND = 1e3;
|
|
@@ -5057,7 +5251,7 @@ function formatRelative(input, now = /* @__PURE__ */ new Date()) {
|
|
|
5057
5251
|
}
|
|
5058
5252
|
|
|
5059
5253
|
// src/patterns/Timeline/ActivityTimeline.tsx
|
|
5060
|
-
import { jsx as
|
|
5254
|
+
import { jsx as jsx67, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
5061
5255
|
var ringClass2 = {
|
|
5062
5256
|
accent: "border-accent",
|
|
5063
5257
|
ok: "border-ok",
|
|
@@ -5065,10 +5259,10 @@ var ringClass2 = {
|
|
|
5065
5259
|
err: "border-err",
|
|
5066
5260
|
muted: "border-text-dim"
|
|
5067
5261
|
};
|
|
5068
|
-
var ActivityTimeline =
|
|
5262
|
+
var ActivityTimeline = forwardRef65(
|
|
5069
5263
|
function ActivityTimeline2({ events, relativeNow, className, ...props }, ref) {
|
|
5070
5264
|
const now = relativeNow ?? /* @__PURE__ */ new Date();
|
|
5071
|
-
return /* @__PURE__ */
|
|
5265
|
+
return /* @__PURE__ */ jsx67(
|
|
5072
5266
|
"ol",
|
|
5073
5267
|
{
|
|
5074
5268
|
ref,
|
|
@@ -5081,8 +5275,8 @@ var ActivityTimeline = forwardRef64(
|
|
|
5081
5275
|
children: events.map((event) => {
|
|
5082
5276
|
const tone = event.tone ?? "accent";
|
|
5083
5277
|
const time = formatRelative(event.at, now);
|
|
5084
|
-
return /* @__PURE__ */
|
|
5085
|
-
/* @__PURE__ */
|
|
5278
|
+
return /* @__PURE__ */ jsxs57("li", { className: "relative mb-4 last:mb-0", children: [
|
|
5279
|
+
/* @__PURE__ */ jsx67(
|
|
5086
5280
|
"span",
|
|
5087
5281
|
{
|
|
5088
5282
|
"aria-hidden": true,
|
|
@@ -5092,16 +5286,16 @@ var ActivityTimeline = forwardRef64(
|
|
|
5092
5286
|
)
|
|
5093
5287
|
}
|
|
5094
5288
|
),
|
|
5095
|
-
/* @__PURE__ */
|
|
5096
|
-
event.icon && /* @__PURE__ */
|
|
5097
|
-
/* @__PURE__ */
|
|
5098
|
-
time && /* @__PURE__ */
|
|
5289
|
+
/* @__PURE__ */ jsxs57("div", { className: "flex items-baseline gap-2", children: [
|
|
5290
|
+
event.icon && /* @__PURE__ */ jsx67("span", { "aria-hidden": true, className: "text-text-muted font-mono text-[12px]", children: event.icon }),
|
|
5291
|
+
/* @__PURE__ */ jsx67("div", { className: "text-[13px] font-medium", children: event.title }),
|
|
5292
|
+
time && /* @__PURE__ */ jsx67("time", { className: "text-text-dim ml-auto font-mono text-[10px]", children: time })
|
|
5099
5293
|
] }),
|
|
5100
|
-
event.actor && /* @__PURE__ */
|
|
5101
|
-
event.actor.avatar && /* @__PURE__ */
|
|
5102
|
-
/* @__PURE__ */
|
|
5294
|
+
event.actor && /* @__PURE__ */ jsxs57("div", { className: "text-text-muted mt-[2px] flex items-center gap-[6px] text-[12px]", children: [
|
|
5295
|
+
event.actor.avatar && /* @__PURE__ */ jsx67("span", { "aria-hidden": true, className: "inline-flex", children: event.actor.avatar }),
|
|
5296
|
+
/* @__PURE__ */ jsx67("span", { children: event.actor.name })
|
|
5103
5297
|
] }),
|
|
5104
|
-
event.payload && /* @__PURE__ */
|
|
5298
|
+
event.payload && /* @__PURE__ */ jsx67("div", { className: "border-border bg-panel-2 mt-2 rounded-md border px-3 py-2 font-mono text-[11px] leading-[1.5]", children: event.payload })
|
|
5105
5299
|
] }, event.id);
|
|
5106
5300
|
})
|
|
5107
5301
|
}
|
|
@@ -5111,9 +5305,9 @@ var ActivityTimeline = forwardRef64(
|
|
|
5111
5305
|
ActivityTimeline.displayName = "ActivityTimeline";
|
|
5112
5306
|
|
|
5113
5307
|
// src/patterns/Topbar/Topbar.tsx
|
|
5114
|
-
import { forwardRef as
|
|
5115
|
-
import { jsx as
|
|
5116
|
-
var Topbar =
|
|
5308
|
+
import { forwardRef as forwardRef66 } from "react";
|
|
5309
|
+
import { jsx as jsx68, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
5310
|
+
var Topbar = forwardRef66(function Topbar2({
|
|
5117
5311
|
title,
|
|
5118
5312
|
eyebrow,
|
|
5119
5313
|
leading,
|
|
@@ -5127,7 +5321,7 @@ var Topbar = forwardRef65(function Topbar2({
|
|
|
5127
5321
|
}, ref) {
|
|
5128
5322
|
const isTouch = density === "touch";
|
|
5129
5323
|
const backHandler = typeof back === "function" ? back : back ? onBack : void 0;
|
|
5130
|
-
return /* @__PURE__ */
|
|
5324
|
+
return /* @__PURE__ */ jsxs58(
|
|
5131
5325
|
"header",
|
|
5132
5326
|
{
|
|
5133
5327
|
ref,
|
|
@@ -5138,7 +5332,7 @@ var Topbar = forwardRef65(function Topbar2({
|
|
|
5138
5332
|
),
|
|
5139
5333
|
...props,
|
|
5140
5334
|
children: [
|
|
5141
|
-
isTouch && back && /* @__PURE__ */
|
|
5335
|
+
isTouch && back && /* @__PURE__ */ jsx68(
|
|
5142
5336
|
"button",
|
|
5143
5337
|
{
|
|
5144
5338
|
type: "button",
|
|
@@ -5152,7 +5346,7 @@ var Topbar = forwardRef65(function Topbar2({
|
|
|
5152
5346
|
"hover:bg-panel-2 h-touch w-touch",
|
|
5153
5347
|
"focus-visible:ring-accent-dim outline-none focus-visible:ring-[3px]"
|
|
5154
5348
|
),
|
|
5155
|
-
children: /* @__PURE__ */
|
|
5349
|
+
children: /* @__PURE__ */ jsx68(
|
|
5156
5350
|
"svg",
|
|
5157
5351
|
{
|
|
5158
5352
|
width: "20",
|
|
@@ -5162,15 +5356,15 @@ var Topbar = forwardRef65(function Topbar2({
|
|
|
5162
5356
|
stroke: "currentColor",
|
|
5163
5357
|
strokeWidth: "2",
|
|
5164
5358
|
"aria-hidden": true,
|
|
5165
|
-
children: /* @__PURE__ */
|
|
5359
|
+
children: /* @__PURE__ */ jsx68("path", { d: "m15 18-6-6 6-6" })
|
|
5166
5360
|
}
|
|
5167
5361
|
)
|
|
5168
5362
|
}
|
|
5169
5363
|
),
|
|
5170
5364
|
leading,
|
|
5171
|
-
(title || isTouch && eyebrow) && /* @__PURE__ */
|
|
5172
|
-
isTouch && eyebrow && /* @__PURE__ */
|
|
5173
|
-
title && /* @__PURE__ */
|
|
5365
|
+
(title || isTouch && eyebrow) && /* @__PURE__ */ jsxs58("div", { className: cn("min-w-0", isTouch && "flex-1"), children: [
|
|
5366
|
+
isTouch && eyebrow && /* @__PURE__ */ jsx68("div", { className: "text-m-eyebrow text-accent font-mono tracking-wide uppercase", children: eyebrow }),
|
|
5367
|
+
title && /* @__PURE__ */ jsx68(
|
|
5174
5368
|
"div",
|
|
5175
5369
|
{
|
|
5176
5370
|
className: cn(
|
|
@@ -5180,8 +5374,8 @@ var Topbar = forwardRef65(function Topbar2({
|
|
|
5180
5374
|
}
|
|
5181
5375
|
)
|
|
5182
5376
|
] }),
|
|
5183
|
-
!isTouch && /* @__PURE__ */
|
|
5184
|
-
actions && /* @__PURE__ */
|
|
5377
|
+
!isTouch && /* @__PURE__ */ jsx68("div", { className: "flex flex-1 items-center" }),
|
|
5378
|
+
actions && /* @__PURE__ */ jsx68("div", { className: cn("flex items-center", isTouch ? "gap-1" : "gap-3"), children: actions }),
|
|
5185
5379
|
children
|
|
5186
5380
|
]
|
|
5187
5381
|
}
|
|
@@ -5191,14 +5385,14 @@ Topbar.displayName = "Topbar";
|
|
|
5191
5385
|
|
|
5192
5386
|
// src/patterns/Tree/Tree.tsx
|
|
5193
5387
|
import {
|
|
5194
|
-
forwardRef as
|
|
5195
|
-
useCallback as
|
|
5196
|
-
useEffect as
|
|
5388
|
+
forwardRef as forwardRef67,
|
|
5389
|
+
useCallback as useCallback13,
|
|
5390
|
+
useEffect as useEffect11,
|
|
5197
5391
|
useMemo as useMemo6,
|
|
5198
|
-
useRef as
|
|
5199
|
-
useState as
|
|
5392
|
+
useRef as useRef9,
|
|
5393
|
+
useState as useState17
|
|
5200
5394
|
} from "react";
|
|
5201
|
-
import { jsx as
|
|
5395
|
+
import { jsx as jsx69, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
5202
5396
|
var EMPTY_SET2 = /* @__PURE__ */ new Set();
|
|
5203
5397
|
function flattenVisible(items, expanded, level, parentId, out) {
|
|
5204
5398
|
for (const item of items) {
|
|
@@ -5209,7 +5403,7 @@ function flattenVisible(items, expanded, level, parentId, out) {
|
|
|
5209
5403
|
}
|
|
5210
5404
|
}
|
|
5211
5405
|
}
|
|
5212
|
-
var Tree =
|
|
5406
|
+
var Tree = forwardRef67(function Tree2({
|
|
5213
5407
|
items,
|
|
5214
5408
|
expanded: expandedProp,
|
|
5215
5409
|
defaultExpanded,
|
|
@@ -5237,8 +5431,8 @@ var Tree = forwardRef66(function Tree2({
|
|
|
5237
5431
|
flattenVisible(items, expandedSet, 1, null, out);
|
|
5238
5432
|
return out;
|
|
5239
5433
|
}, [items, expandedSet]);
|
|
5240
|
-
const [activeId, setActiveId] =
|
|
5241
|
-
|
|
5434
|
+
const [activeId, setActiveId] = useState17(null);
|
|
5435
|
+
useEffect11(() => {
|
|
5242
5436
|
if (activeId && !flatVisible.some((f) => f.id === activeId)) {
|
|
5243
5437
|
setActiveId(null);
|
|
5244
5438
|
}
|
|
@@ -5248,8 +5442,8 @@ var Tree = forwardRef66(function Tree2({
|
|
|
5248
5442
|
if (value && flatVisible.some((f) => f.id === value)) return value;
|
|
5249
5443
|
return flatVisible[0]?.id ?? null;
|
|
5250
5444
|
}, [activeId, flatVisible, value]);
|
|
5251
|
-
const listRef =
|
|
5252
|
-
const setRefs =
|
|
5445
|
+
const listRef = useRef9(null);
|
|
5446
|
+
const setRefs = useCallback13(
|
|
5253
5447
|
(node) => {
|
|
5254
5448
|
listRef.current = node;
|
|
5255
5449
|
if (typeof ref === "function") ref(node);
|
|
@@ -5257,20 +5451,20 @@ var Tree = forwardRef66(function Tree2({
|
|
|
5257
5451
|
},
|
|
5258
5452
|
[ref]
|
|
5259
5453
|
);
|
|
5260
|
-
const focusItem =
|
|
5454
|
+
const focusItem = useCallback13((id) => {
|
|
5261
5455
|
const root = listRef.current;
|
|
5262
5456
|
if (!root) return;
|
|
5263
5457
|
const el = root.querySelector(`[data-treeitem-id="${CSS.escape(id)}"]`);
|
|
5264
5458
|
el?.focus();
|
|
5265
5459
|
}, []);
|
|
5266
|
-
const moveActive =
|
|
5460
|
+
const moveActive = useCallback13(
|
|
5267
5461
|
(id) => {
|
|
5268
5462
|
setActiveId(id);
|
|
5269
5463
|
queueMicrotask(() => focusItem(id));
|
|
5270
5464
|
},
|
|
5271
5465
|
[focusItem]
|
|
5272
5466
|
);
|
|
5273
|
-
const toggle =
|
|
5467
|
+
const toggle = useCallback13(
|
|
5274
5468
|
(id) => {
|
|
5275
5469
|
setExpanded((prev) => {
|
|
5276
5470
|
const next = new Set(prev ?? EMPTY_SET2);
|
|
@@ -5281,7 +5475,7 @@ var Tree = forwardRef66(function Tree2({
|
|
|
5281
5475
|
},
|
|
5282
5476
|
[setExpanded]
|
|
5283
5477
|
);
|
|
5284
|
-
const expand =
|
|
5478
|
+
const expand = useCallback13(
|
|
5285
5479
|
(id) => {
|
|
5286
5480
|
setExpanded((prev) => {
|
|
5287
5481
|
const base = prev ?? EMPTY_SET2;
|
|
@@ -5293,7 +5487,7 @@ var Tree = forwardRef66(function Tree2({
|
|
|
5293
5487
|
},
|
|
5294
5488
|
[setExpanded]
|
|
5295
5489
|
);
|
|
5296
|
-
const collapse =
|
|
5490
|
+
const collapse = useCallback13(
|
|
5297
5491
|
(id) => {
|
|
5298
5492
|
setExpanded((prev) => {
|
|
5299
5493
|
const base = prev ?? EMPTY_SET2;
|
|
@@ -5305,13 +5499,13 @@ var Tree = forwardRef66(function Tree2({
|
|
|
5305
5499
|
},
|
|
5306
5500
|
[setExpanded]
|
|
5307
5501
|
);
|
|
5308
|
-
const selectItem =
|
|
5502
|
+
const selectItem = useCallback13(
|
|
5309
5503
|
(id) => {
|
|
5310
5504
|
setValue(id);
|
|
5311
5505
|
},
|
|
5312
5506
|
[setValue]
|
|
5313
5507
|
);
|
|
5314
|
-
const handleKeyDown =
|
|
5508
|
+
const handleKeyDown = useCallback13(
|
|
5315
5509
|
(e) => {
|
|
5316
5510
|
onKeyDown?.(e);
|
|
5317
5511
|
if (e.defaultPrevented) return;
|
|
@@ -5391,7 +5585,7 @@ var Tree = forwardRef66(function Tree2({
|
|
|
5391
5585
|
toggle
|
|
5392
5586
|
]
|
|
5393
5587
|
);
|
|
5394
|
-
return /* @__PURE__ */
|
|
5588
|
+
return /* @__PURE__ */ jsx69(
|
|
5395
5589
|
"ul",
|
|
5396
5590
|
{
|
|
5397
5591
|
ref: setRefs,
|
|
@@ -5399,7 +5593,7 @@ var Tree = forwardRef66(function Tree2({
|
|
|
5399
5593
|
className: cn("flex flex-col gap-px text-[12px]", className),
|
|
5400
5594
|
onKeyDown: handleKeyDown,
|
|
5401
5595
|
...props,
|
|
5402
|
-
children: items.map((item) => /* @__PURE__ */
|
|
5596
|
+
children: items.map((item) => /* @__PURE__ */ jsx69(
|
|
5403
5597
|
TreeItemRow,
|
|
5404
5598
|
{
|
|
5405
5599
|
item,
|
|
@@ -5434,8 +5628,8 @@ function TreeItemRow({
|
|
|
5434
5628
|
const isExpanded = hasChildren && expanded.has(item.id);
|
|
5435
5629
|
const isSelected = selected === item.id;
|
|
5436
5630
|
const isTabStop = tabStopId === item.id;
|
|
5437
|
-
return /* @__PURE__ */
|
|
5438
|
-
/* @__PURE__ */
|
|
5631
|
+
return /* @__PURE__ */ jsxs59("li", { role: "none", children: [
|
|
5632
|
+
/* @__PURE__ */ jsxs59(
|
|
5439
5633
|
"div",
|
|
5440
5634
|
{
|
|
5441
5635
|
role: "treeitem",
|
|
@@ -5458,14 +5652,14 @@ function TreeItemRow({
|
|
|
5458
5652
|
isSelected ? "bg-accent-dim text-accent" : "text-text hover:bg-panel-2"
|
|
5459
5653
|
),
|
|
5460
5654
|
children: [
|
|
5461
|
-
/* @__PURE__ */
|
|
5462
|
-
item.icon && /* @__PURE__ */
|
|
5463
|
-
/* @__PURE__ */
|
|
5655
|
+
/* @__PURE__ */ jsx69("span", { "aria-hidden": true, className: "text-text-dim grid w-3 place-items-center text-[10px]", children: hasChildren ? isExpanded ? "\u25BE" : "\u25B8" : "" }),
|
|
5656
|
+
item.icon && /* @__PURE__ */ jsx69("span", { "aria-hidden": true, className: "text-[12px] opacity-80", children: item.icon }),
|
|
5657
|
+
/* @__PURE__ */ jsx69("span", { className: "flex-1 truncate", children: item.label }),
|
|
5464
5658
|
item.trailing
|
|
5465
5659
|
]
|
|
5466
5660
|
}
|
|
5467
5661
|
),
|
|
5468
|
-
hasChildren && isExpanded && /* @__PURE__ */
|
|
5662
|
+
hasChildren && isExpanded && /* @__PURE__ */ jsx69("ul", { role: "group", className: "flex flex-col gap-px", children: (item.children ?? []).map((child) => /* @__PURE__ */ jsx69(
|
|
5469
5663
|
TreeItemRow,
|
|
5470
5664
|
{
|
|
5471
5665
|
item: child,
|
|
@@ -5484,9 +5678,9 @@ function TreeItemRow({
|
|
|
5484
5678
|
|
|
5485
5679
|
// src/patterns/WizardDialog/WizardDialog.tsx
|
|
5486
5680
|
import * as RadixDialog5 from "@radix-ui/react-dialog";
|
|
5487
|
-
import { forwardRef as
|
|
5488
|
-
import { jsx as
|
|
5489
|
-
var WizardDialog =
|
|
5681
|
+
import { forwardRef as forwardRef68, useCallback as useCallback14, useMemo as useMemo7, useState as useState18 } from "react";
|
|
5682
|
+
import { jsx as jsx70, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
5683
|
+
var WizardDialog = forwardRef68(function WizardDialog2({
|
|
5490
5684
|
open,
|
|
5491
5685
|
defaultOpen,
|
|
5492
5686
|
onOpenChange,
|
|
@@ -5502,18 +5696,18 @@ var WizardDialog = forwardRef67(function WizardDialog2({
|
|
|
5502
5696
|
cancelLabel,
|
|
5503
5697
|
onCancel
|
|
5504
5698
|
}, ref) {
|
|
5505
|
-
const [current, setCurrent] =
|
|
5699
|
+
const [current, setCurrent] = useState18(initialStep);
|
|
5506
5700
|
const total = steps.length;
|
|
5507
5701
|
const safeCurrent = Math.min(current, Math.max(0, total - 1));
|
|
5508
5702
|
const step = steps[safeCurrent];
|
|
5509
|
-
const goTo =
|
|
5703
|
+
const goTo = useCallback14(
|
|
5510
5704
|
(index) => {
|
|
5511
5705
|
setCurrent(Math.min(Math.max(0, index), Math.max(0, total - 1)));
|
|
5512
5706
|
},
|
|
5513
5707
|
[total]
|
|
5514
5708
|
);
|
|
5515
|
-
const goNext =
|
|
5516
|
-
const goBack =
|
|
5709
|
+
const goNext = useCallback14(() => setCurrent((c) => Math.min(c + 1, total - 1)), [total]);
|
|
5710
|
+
const goBack = useCallback14(() => setCurrent((c) => Math.max(c - 1, 0)), []);
|
|
5517
5711
|
const ctx = useMemo7(
|
|
5518
5712
|
() => ({
|
|
5519
5713
|
current: safeCurrent,
|
|
@@ -5537,23 +5731,23 @@ var WizardDialog = forwardRef67(function WizardDialog2({
|
|
|
5537
5731
|
goNext();
|
|
5538
5732
|
}
|
|
5539
5733
|
};
|
|
5540
|
-
return /* @__PURE__ */
|
|
5541
|
-
title && /* @__PURE__ */
|
|
5542
|
-
description && /* @__PURE__ */
|
|
5543
|
-
/* @__PURE__ */
|
|
5544
|
-
/* @__PURE__ */
|
|
5545
|
-
/* @__PURE__ */
|
|
5546
|
-
cancelLabel && /* @__PURE__ */
|
|
5547
|
-
/* @__PURE__ */
|
|
5548
|
-
/* @__PURE__ */
|
|
5734
|
+
return /* @__PURE__ */ jsx70(DialogRoot, { open, defaultOpen, onOpenChange, children: /* @__PURE__ */ jsxs60(DialogContent, { ref, width, children: [
|
|
5735
|
+
title && /* @__PURE__ */ jsx70(WizardTitle, { children: title }),
|
|
5736
|
+
description && /* @__PURE__ */ jsx70(WizardDescription, { children: description }),
|
|
5737
|
+
/* @__PURE__ */ jsx70("div", { className: "mb-5", children: /* @__PURE__ */ jsx70(Stepper, { steps: stepperSteps, current: safeCurrent }) }),
|
|
5738
|
+
/* @__PURE__ */ jsx70("div", { className: "mb-5", children: body }),
|
|
5739
|
+
/* @__PURE__ */ jsxs60("div", { className: "flex justify-end gap-2", children: [
|
|
5740
|
+
cancelLabel && /* @__PURE__ */ jsx70(Button, { type: "button", variant: "ghost", onClick: onCancel, children: cancelLabel }),
|
|
5741
|
+
/* @__PURE__ */ jsx70(Button, { type: "button", variant: "secondary", onClick: goBack, disabled: ctx.isFirst, children: backLabel }),
|
|
5742
|
+
/* @__PURE__ */ jsx70(Button, { type: "button", variant: "primary", onClick: handlePrimary, disabled: !canAdvance, children: ctx.isLast ? completeLabel : nextLabel })
|
|
5549
5743
|
] })
|
|
5550
5744
|
] }) });
|
|
5551
5745
|
});
|
|
5552
5746
|
function WizardTitle({ children }) {
|
|
5553
|
-
return /* @__PURE__ */
|
|
5747
|
+
return /* @__PURE__ */ jsx70(RadixDialog5.Title, { className: "mb-2 text-[16px] font-medium", children });
|
|
5554
5748
|
}
|
|
5555
5749
|
function WizardDescription({ children }) {
|
|
5556
|
-
return /* @__PURE__ */
|
|
5750
|
+
return /* @__PURE__ */ jsx70(RadixDialog5.Description, { className: "text-text-muted mb-4 text-[13px] leading-[1.55]", children });
|
|
5557
5751
|
}
|
|
5558
5752
|
WizardDialog.displayName = "WizardDialog";
|
|
5559
5753
|
export {
|
|
@@ -5618,6 +5812,7 @@ export {
|
|
|
5618
5812
|
HoverCardRoot,
|
|
5619
5813
|
HoverCardTrigger,
|
|
5620
5814
|
IconButton,
|
|
5815
|
+
InlineEdit,
|
|
5621
5816
|
Input,
|
|
5622
5817
|
Kbd,
|
|
5623
5818
|
LargeTitle,
|