@pibit.ai/cure-design-system 0.6.26 → 0.6.27
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/patterns/alert/alert.d.ts +1 -2
- package/dist/patterns/alert/alert.d.ts.map +1 -1
- package/dist/patterns/alert/alert.js +22 -22
- package/dist/patterns/empty-state/empty-state.d.ts +2 -1
- package/dist/patterns/empty-state/empty-state.d.ts.map +1 -1
- package/dist/patterns/empty-state/empty-state.js +16 -16
- package/dist/patterns/expandable-drawer/expandable-drawer.d.ts.map +1 -1
- package/dist/patterns/expandable-drawer/expandable-drawer.js +42 -39
- package/dist/patterns/filters/filter-list-section.d.ts.map +1 -1
- package/dist/patterns/filters/filter-list-section.js +34 -34
- package/dist/patterns/tabs/tabs.d.ts.map +1 -1
- package/dist/patterns/tabs/tabs.js +32 -32
- package/dist/patterns/tree-view/indented-tree.d.ts.map +1 -1
- package/dist/patterns/tree-view/indented-tree.js +136 -118
- package/dist/primitives/featured-icon/featured-icon.d.ts +2 -1
- package/dist/primitives/featured-icon/featured-icon.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -13,8 +13,7 @@ export interface AlertFloatingProps {
|
|
|
13
13
|
*/
|
|
14
14
|
confirmLabel?: string;
|
|
15
15
|
/**
|
|
16
|
-
* The label for the dismiss button.
|
|
17
|
-
* @default "Dismiss"
|
|
16
|
+
* The label for the dismiss link button. Without one, only the X is shown; it is then named "Dismiss".
|
|
18
17
|
*/
|
|
19
18
|
dismissLabel?: string;
|
|
20
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/patterns/alert/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA+C3C,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB
|
|
1
|
+
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../src/patterns/alert/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA+C3C,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3F;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,EAAE,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,SAAS,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,GAAI,iGAU3B,kBAAkB,4CA+CpB,CAAC"}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { isValidElement as g } from "react";
|
|
3
|
-
import { InfoCircle as l, CheckCircle as u, AlertCircle as
|
|
4
|
-
import { cx as
|
|
5
|
-
import { FeaturedIcon as
|
|
6
|
-
import { Button as
|
|
3
|
+
import { InfoCircle as l, CheckCircle as u, AlertCircle as d } from "@untitledui/icons";
|
|
4
|
+
import { cx as p } from "../../utils/cn.js";
|
|
5
|
+
import { FeaturedIcon as b } from "../../primitives/featured-icon/featured-icon.js";
|
|
6
|
+
import { Button as f } from "../../primitives/button/button.js";
|
|
7
7
|
import { CloseButton as y } from "../../primitives/close-button/close-button.js";
|
|
8
8
|
const h = {
|
|
9
9
|
default: l,
|
|
10
10
|
info: l,
|
|
11
11
|
brand: l,
|
|
12
12
|
gray: l,
|
|
13
|
-
error:
|
|
14
|
-
warning:
|
|
13
|
+
error: d,
|
|
14
|
+
warning: d,
|
|
15
15
|
success: u,
|
|
16
16
|
notice: l
|
|
17
17
|
}, v = {
|
|
@@ -33,44 +33,44 @@ const h = {
|
|
|
33
33
|
success: "text-green-800",
|
|
34
34
|
notice: "text-[#F7F7F7]"
|
|
35
35
|
}, A = ({
|
|
36
|
-
title:
|
|
37
|
-
description:
|
|
38
|
-
confirmLabel:
|
|
36
|
+
title: m,
|
|
37
|
+
description: o,
|
|
38
|
+
confirmLabel: a,
|
|
39
39
|
onClose: r,
|
|
40
|
-
onConfirm:
|
|
40
|
+
onConfirm: c,
|
|
41
41
|
color: e = "default",
|
|
42
|
-
dismissLabel:
|
|
43
|
-
icon:
|
|
42
|
+
dismissLabel: n = "",
|
|
43
|
+
icon: s = null,
|
|
44
44
|
className: x = ""
|
|
45
45
|
}) => /* @__PURE__ */ i(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
|
-
className:
|
|
48
|
+
className: p(
|
|
49
49
|
`${e ? v[e] : "bg-blue-50"} flex flex-col justify-between items-center gap-4 rounded-xl border border-primary p-2.5 shadow-xs md:flex-row`,
|
|
50
50
|
x
|
|
51
51
|
),
|
|
52
52
|
children: [
|
|
53
53
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-center gap-4", children: [
|
|
54
|
-
g(
|
|
55
|
-
|
|
54
|
+
g(s) ? /* @__PURE__ */ t("div", { className: "flex items-center justify-center", children: s }) : /* @__PURE__ */ t(
|
|
55
|
+
b,
|
|
56
56
|
{
|
|
57
|
-
icon:
|
|
57
|
+
icon: s || h[e],
|
|
58
58
|
color: e === "default" || e === "info" ? "gray" : e === "notice" ? "brand" : e,
|
|
59
59
|
theme: e === "default" || e === "info" ? "modern" : "outline",
|
|
60
60
|
size: "sm"
|
|
61
61
|
}
|
|
62
62
|
),
|
|
63
63
|
/* @__PURE__ */ t("div", { className: "flex justify-center items-center flex-1 flex-col", children: /* @__PURE__ */ i("div", { className: "flex items-center justify-center flex-col gap-1 overflow-auto", children: [
|
|
64
|
-
/* @__PURE__ */ t("p", { className: `${w[e]} pr-8 text-sm font-semibold md:pr-0`, children:
|
|
65
|
-
|
|
64
|
+
/* @__PURE__ */ t("p", { className: `${w[e]} pr-8 text-sm font-semibold md:pr-0`, children: m }),
|
|
65
|
+
o && /* @__PURE__ */ t("p", { className: "text-sm text-tertiary", children: o })
|
|
66
66
|
] }) })
|
|
67
67
|
] }),
|
|
68
68
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-center gap-2", children: [
|
|
69
|
-
(
|
|
70
|
-
r && /* @__PURE__ */ t(
|
|
71
|
-
|
|
69
|
+
(c && a || r && n) && /* @__PURE__ */ i("div", { className: "flex gap-3", children: [
|
|
70
|
+
r && n && /* @__PURE__ */ t(f, { size: "xs", onClick: r, color: "link-gray", children: n }),
|
|
71
|
+
c && a && /* @__PURE__ */ t(f, { onClick: c, size: "xs", color: "link-color", children: a })
|
|
72
72
|
] }),
|
|
73
|
-
r && /* @__PURE__ */ t(y, { onClick: r, size: "xs", label:
|
|
73
|
+
r && /* @__PURE__ */ t(y, { onClick: r, size: "xs", label: n || "Dismiss" })
|
|
74
74
|
] })
|
|
75
75
|
]
|
|
76
76
|
}
|
|
@@ -15,7 +15,8 @@ export interface EmptyStateHeaderProps extends ComponentPropsWithRef<"div"> {
|
|
|
15
15
|
declare const Header: ({ pattern, patternSize, ...props }: EmptyStateHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
declare const Content: (props: ComponentPropsWithRef<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
declare const Footer: (props: ComponentPropsWithRef<"div">) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
|
|
18
|
+
/** An `h2`: the page around an empty state already has its own `h1`. */
|
|
19
|
+
declare const Title: (props: ComponentPropsWithRef<"h2">) => import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
declare const Description: (props: ComponentPropsWithRef<"p">) => import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
declare const EmptyState: typeof Root & {
|
|
21
22
|
Title: typeof Title;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../../src/patterns/empty-state/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAGnD,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAW9E,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAID,MAAM,WAAW,eAAgB,SAAQ,qBAAqB,CAAC,KAAK,CAAC,EAAE,gBAAgB;CAAG;AAE1F,QAAA,MAAM,IAAI,GAAI,oBAA2B,eAAe,4CASvD,CAAC;AAEF,QAAA,MAAM,YAAY,GAAI,wCAMnB,qBAAqB,CAAC,OAAO,gBAAgB,CAAC,4CAIhD,CAAC;AAEF,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB,CAAC,KAAK,CAAC;IACzE,iHAAiH;IACjH,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC5B,WAAW,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAClC;AAED,QAAA,MAAM,MAAM,GAAI,oCAAsD,qBAAqB,4CAc1F,CAAC;AAEF,QAAA,MAAM,OAAO,GAAI,OAAO,qBAAqB,CAAC,KAAK,CAAC,4CAanD,CAAC;AAEF,QAAA,MAAM,MAAM,GAAI,OAAO,qBAAqB,CAAC,KAAK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GAAI,oCAAsD,qBAAqB,4CAc1F,CAAC;AAEF,QAAA,MAAM,OAAO,GAAI,OAAO,qBAAqB,CAAC,KAAK,CAAC,4CAanD,CAAC;AAEF,QAAA,MAAM,MAAM,GAAI,OAAO,qBAAqB,CAAC,KAAK,CAAC,4CAElD,CAAC;AAEF,wEAAwE;AACxE,QAAA,MAAM,KAAK,GAAI,OAAO,qBAAqB,CAAC,IAAI,CAAC,4CAchD,CAAC;AAEF,QAAA,MAAM,WAAW,GAAI,OAAO,qBAAqB,CAAC,GAAG,CAAC,4CAMrD,CAAC;AAEF,QAAA,MAAM,UAAU,EAAW,OAAO,IAAI,GAAG;IACvC,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,YAAY,EAAE,OAAO,YAAY,CAAC;CACnC,CAAC;AASF,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as s, jsxs as x } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as d, useContext as
|
|
2
|
+
import { createContext as d, useContext as c } from "react";
|
|
3
3
|
import { SearchLg as u } from "@untitledui/icons";
|
|
4
4
|
import { cx as o } from "../../utils/cn.js";
|
|
5
5
|
import { Circle as f } from "./circle-pattern.js";
|
|
@@ -14,14 +14,14 @@ const r = d({ size: "lg" }), N = ({ size: e = "lg", ...t }) => /* @__PURE__ */ s
|
|
|
14
14
|
color: e = "gray",
|
|
15
15
|
theme: t = "modern",
|
|
16
16
|
icon: a = u,
|
|
17
|
-
size:
|
|
18
|
-
...
|
|
17
|
+
size: l = "lg",
|
|
18
|
+
...m
|
|
19
19
|
}) => {
|
|
20
|
-
const { size: i } =
|
|
21
|
-
return /* @__PURE__ */ s(g, { ...
|
|
20
|
+
const { size: i } = c(r);
|
|
21
|
+
return /* @__PURE__ */ s(g, { ...m, color: e, theme: t, icon: a, size: i === "lg" ? "xl" : l });
|
|
22
22
|
}, y = ({ pattern: e = "circle", patternSize: t = "md", ...a }) => {
|
|
23
|
-
const { size:
|
|
24
|
-
return /* @__PURE__ */ x("header", { ...a, className: o("relative mb-4", (
|
|
23
|
+
const { size: l } = c(r);
|
|
24
|
+
return /* @__PURE__ */ x("header", { ...a, className: o("relative mb-4", (l === "md" || l === "lg") && "mb-5", a.className), children: [
|
|
25
25
|
e !== "none" && /* @__PURE__ */ s(
|
|
26
26
|
f,
|
|
27
27
|
{
|
|
@@ -32,9 +32,9 @@ const r = d({ size: "lg" }), N = ({ size: e = "lg", ...t }) => /* @__PURE__ */ s
|
|
|
32
32
|
a.children
|
|
33
33
|
] });
|
|
34
34
|
}, b = (e) => {
|
|
35
|
-
const { size: t } =
|
|
35
|
+
const { size: t } = c(r);
|
|
36
36
|
return /* @__PURE__ */ s(
|
|
37
|
-
"
|
|
37
|
+
"div",
|
|
38
38
|
{
|
|
39
39
|
...e,
|
|
40
40
|
className: o(
|
|
@@ -44,10 +44,10 @@ const r = d({ size: "lg" }), N = ({ size: e = "lg", ...t }) => /* @__PURE__ */ s
|
|
|
44
44
|
)
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
|
-
}, h = (e) => /* @__PURE__ */ s("footer", { ...e, className: o("z-10 flex gap-3", e.className) }),
|
|
48
|
-
const { size: t } =
|
|
47
|
+
}, h = (e) => /* @__PURE__ */ s("footer", { ...e, className: o("z-10 flex gap-3", e.className) }), v = (e) => {
|
|
48
|
+
const { size: t } = c(r);
|
|
49
49
|
return /* @__PURE__ */ s(
|
|
50
|
-
"
|
|
50
|
+
"h2",
|
|
51
51
|
{
|
|
52
52
|
...e,
|
|
53
53
|
className: o(
|
|
@@ -58,15 +58,15 @@ const r = d({ size: "lg" }), N = ({ size: e = "lg", ...t }) => /* @__PURE__ */ s
|
|
|
58
58
|
)
|
|
59
59
|
}
|
|
60
60
|
);
|
|
61
|
-
},
|
|
62
|
-
const { size: t } =
|
|
61
|
+
}, C = (e) => {
|
|
62
|
+
const { size: t } = c(r);
|
|
63
63
|
return /* @__PURE__ */ s("p", { ...e, className: o("text-center text-xs text-tertiary", t === "lg" && "text-sm", e.className) });
|
|
64
64
|
}, n = N;
|
|
65
|
-
n.Title =
|
|
65
|
+
n.Title = v;
|
|
66
66
|
n.Header = y;
|
|
67
67
|
n.Footer = h;
|
|
68
68
|
n.Content = b;
|
|
69
|
-
n.Description =
|
|
69
|
+
n.Description = C;
|
|
70
70
|
n.FeaturedIcon = z;
|
|
71
71
|
export {
|
|
72
72
|
n as EmptyState
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expandable-drawer.d.ts","sourceRoot":"","sources":["../../../src/patterns/expandable-drawer/expandable-drawer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAQlE,MAAM,MAAM,0BAA0B,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAM1E,MAAM,WAAW,0BAA0B;IACzC,iFAAiF;IACjF,KAAK,EAAE,0BAA0B,CAAC;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,yGAAyG;IACzG,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,8BAA8B;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+EAA+E;IAC/E,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C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AC5C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,4GAA4G;IAC5G,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,iFAAiF;IACjF,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CA0KtE,CAAC"}
|
|
@@ -1,68 +1,71 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
1
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
2
|
import { Minimize01 as H, Expand01 as K, X as F } from "@untitledui/icons";
|
|
3
3
|
import { useState as U, useId as Y, useRef as G, useEffect as J } from "react";
|
|
4
4
|
import { motion as Q } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
5
5
|
const Z = 512, W = "calc(100vw - 140px)", C = { type: "tween", duration: 0.3, ease: "easeInOut" }, se = ({
|
|
6
6
|
state: o,
|
|
7
|
-
onClose:
|
|
8
|
-
header:
|
|
9
|
-
title:
|
|
7
|
+
onClose: g,
|
|
8
|
+
header: s,
|
|
9
|
+
title: u = "",
|
|
10
10
|
subtitle: y,
|
|
11
11
|
children: z,
|
|
12
|
-
normalWidth:
|
|
13
|
-
maxWidth:
|
|
14
|
-
width:
|
|
12
|
+
normalWidth: D = Z,
|
|
13
|
+
maxWidth: k = W,
|
|
14
|
+
width: R,
|
|
15
15
|
minWidth: a = 480,
|
|
16
|
-
maxResizableWidth:
|
|
16
|
+
maxResizableWidth: M,
|
|
17
17
|
onWidthChange: r,
|
|
18
18
|
onExpandedChange: c,
|
|
19
|
-
headerActions:
|
|
20
|
-
className:
|
|
21
|
-
headerClassName:
|
|
22
|
-
bodyClassName:
|
|
19
|
+
headerActions: P,
|
|
20
|
+
className: S = "",
|
|
21
|
+
headerClassName: E = "",
|
|
22
|
+
bodyClassName: V = ""
|
|
23
23
|
}) => {
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
const
|
|
24
|
+
const [w, L] = U(!1), m = o !== "hidden";
|
|
25
|
+
m && !w && L(!0);
|
|
26
|
+
const N = c !== void 0, b = o === "expanded", l = o === "hidden" ? 0 : o === "expanded" ? k : R ?? D, f = Math.max(M ?? Number.POSITIVE_INFINITY, a), p = o === "normal" && m && typeof l == "number" && r !== void 0, v = (e) => Math.min(Math.max(e, a), f), h = Y(), i = G(null);
|
|
27
27
|
J(() => () => {
|
|
28
28
|
var e;
|
|
29
|
-
return (e =
|
|
29
|
+
return (e = i.current) == null ? void 0 : e.call(i);
|
|
30
30
|
}, []);
|
|
31
31
|
const T = (e) => {
|
|
32
|
-
if (!
|
|
32
|
+
if (!p || typeof l != "number") return;
|
|
33
33
|
e.preventDefault(), e.stopPropagation();
|
|
34
34
|
const d = e.clientX, $ = l, O = document.body.style.cursor, q = document.body.style.userSelect;
|
|
35
35
|
document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
|
|
36
|
-
const
|
|
37
|
-
r == null || r(
|
|
36
|
+
const I = (B) => {
|
|
37
|
+
r == null || r(v($ + d - B.clientX));
|
|
38
38
|
}, x = () => {
|
|
39
|
-
document.body.style.cursor = O, document.body.style.userSelect = q, window.removeEventListener("pointermove",
|
|
39
|
+
document.body.style.cursor = O, document.body.style.userSelect = q, window.removeEventListener("pointermove", I), window.removeEventListener("pointerup", x), i.current = null;
|
|
40
40
|
};
|
|
41
|
-
|
|
41
|
+
i.current = x, window.addEventListener("pointermove", I), window.addEventListener("pointerup", x);
|
|
42
42
|
}, X = (e) => {
|
|
43
|
-
if (!
|
|
43
|
+
if (!p || typeof l != "number") return;
|
|
44
44
|
const d = e.shiftKey ? 50 : 16;
|
|
45
|
-
e.key === "ArrowLeft" && (e.preventDefault(), r == null || r(
|
|
45
|
+
e.key === "ArrowLeft" && (e.preventDefault(), r == null || r(v(l + d))), e.key === "ArrowRight" && (e.preventDefault(), r == null || r(v(l - d)));
|
|
46
46
|
}, _ = {
|
|
47
47
|
backgroundImage: "linear-gradient(90deg, rgba(6, 132, 240, 0.1) 0%, rgba(6, 132, 240, 0.1) 100%), linear-gradient(0deg, rgba(255, 255, 255, 0) 60.66%, rgba(255, 255, 255, 0.5) 100%), linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.3) 100%)"
|
|
48
|
-
}, j = `flex items-center justify-between pl-6 pr-2 border-b border-secondary gap-2 py-4 ${
|
|
48
|
+
}, j = `flex items-center justify-between pl-6 pr-2 border-b border-secondary gap-2 py-4 ${E}`, A = `flex min-h-0 flex-1 flex-col overflow-y-auto pb-3 ${V} ${s ? "" : "px-5"}`;
|
|
49
49
|
return /* @__PURE__ */ t(
|
|
50
50
|
Q.div,
|
|
51
51
|
{
|
|
52
|
-
className: `relative flex flex-col flex-shrink-0 overflow-hidden min-w-0 h-[calc(98vh-85px)] z-1000 ${
|
|
52
|
+
className: `relative flex flex-col flex-shrink-0 overflow-hidden min-w-0 h-[calc(98vh-85px)] z-1000 ${S}`,
|
|
53
53
|
initial: !1,
|
|
54
54
|
animate: {
|
|
55
55
|
width: l,
|
|
56
56
|
minWidth: o === "hidden" ? 0 : a || void 0
|
|
57
57
|
},
|
|
58
58
|
transition: C,
|
|
59
|
-
children:
|
|
59
|
+
children: m && /* @__PURE__ */ n(
|
|
60
60
|
"div",
|
|
61
61
|
{
|
|
62
|
+
role: "region",
|
|
63
|
+
"aria-labelledby": s == null ? h : void 0,
|
|
64
|
+
"aria-label": s != null && u ? u : void 0,
|
|
62
65
|
className: "h-full w-full min-w-0 flex flex-col rounded-2xl border-l border-t border-b border-white backdrop-blur-[3px] p-2",
|
|
63
66
|
style: _,
|
|
64
67
|
children: [
|
|
65
|
-
|
|
68
|
+
p && /* @__PURE__ */ t(
|
|
66
69
|
"div",
|
|
67
70
|
{
|
|
68
71
|
role: "separator",
|
|
@@ -77,29 +80,29 @@ const Z = 512, W = "calc(100vw - 140px)", C = { type: "tween", duration: 0.3, ea
|
|
|
77
80
|
className: "absolute left-0 top-0 z-10 h-full w-2 -translate-x-1 cursor-col-resize touch-none focus-visible:outline-none"
|
|
78
81
|
}
|
|
79
82
|
),
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */ t("h2", { id:
|
|
83
|
+
/* @__PURE__ */ n("div", { className: "h-full w-full bg-white rounded-lg overflow-hidden flex flex-col min-w-0", children: [
|
|
84
|
+
s ?? /* @__PURE__ */ n("header", { className: j, children: [
|
|
85
|
+
/* @__PURE__ */ n("div", { className: `flex-1 flex flex-col gap-0 min-w-0 ${N ? "pr-2" : "pr-16"}`, children: [
|
|
86
|
+
/* @__PURE__ */ t("h2", { id: h, className: "text-lg font-semibold leading-7 text-[#06060a] truncate", children: u }),
|
|
84
87
|
y && /* @__PURE__ */ t("p", { className: "text-sm text-secondary truncate", children: y })
|
|
85
88
|
] }),
|
|
86
|
-
/* @__PURE__ */
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
|
|
90
|
+
P,
|
|
91
|
+
N && /* @__PURE__ */ t(
|
|
89
92
|
"button",
|
|
90
93
|
{
|
|
91
94
|
type: "button",
|
|
92
|
-
onClick: () => c == null ? void 0 : c(!
|
|
95
|
+
onClick: () => c == null ? void 0 : c(!b),
|
|
93
96
|
className: "flex items-center justify-center p-2 rounded-lg hover:bg-primary_hover transition-colors cursor-pointer",
|
|
94
|
-
"aria-label":
|
|
95
|
-
children:
|
|
97
|
+
"aria-label": b ? "Collapse sidebar" : "Expand sidebar",
|
|
98
|
+
children: b ? /* @__PURE__ */ t(H, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 }) : /* @__PURE__ */ t(K, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 })
|
|
96
99
|
}
|
|
97
100
|
),
|
|
98
101
|
/* @__PURE__ */ t(
|
|
99
102
|
"button",
|
|
100
103
|
{
|
|
101
104
|
type: "button",
|
|
102
|
-
onClick:
|
|
105
|
+
onClick: g,
|
|
103
106
|
className: "flex items-center justify-center p-2 rounded-lg hover:bg-primary_hover transition-colors cursor-pointer",
|
|
104
107
|
"aria-label": "Close",
|
|
105
108
|
children: /* @__PURE__ */ t(F, { size: 20, className: "text-fg-quaternary", strokeWidth: 1.67 })
|
|
@@ -107,7 +110,7 @@ const Z = 512, W = "calc(100vw - 140px)", C = { type: "tween", duration: 0.3, ea
|
|
|
107
110
|
)
|
|
108
111
|
] })
|
|
109
112
|
] }),
|
|
110
|
-
/* @__PURE__ */ t("
|
|
113
|
+
/* @__PURE__ */ t("div", { className: A, children: w ? z : null })
|
|
111
114
|
] })
|
|
112
115
|
]
|
|
113
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-list-section.d.ts","sourceRoot":"","sources":["../../../src/patterns/filters/filter-list-section.tsx"],"names":[],"mappings":"AAYA,MAAM,MAAM,cAAc,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1E,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,cAAc;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAEnC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAEnC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAEjC,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAExC,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAE9B,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAcD,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,cAAc,EAAE,EAC1D,KAAK,EACL,KAAK,EACL,cAAc,EACd,SAAS,EACT,MAAM,EACN,WAAsB,EACtB,UAAU,EACV,YAAkC,EAClC,YAAkC,EAClC,UAA8B,EAC9B,cAAc,EACd,iBAAiB,EACjB,YAAY,GACb,EAAE,sBAAsB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"filter-list-section.d.ts","sourceRoot":"","sources":["../../../src/patterns/filters/filter-list-section.tsx"],"names":[],"mappings":"AAYA,MAAM,MAAM,cAAc,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1E,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,cAAc;IAC9D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAEnC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAEnC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAC;IAEjC,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAExC,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAE9B,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC;AAcD,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,cAAc,EAAE,EAC1D,KAAK,EACL,KAAK,EACL,cAAc,EACd,SAAS,EACT,MAAM,EACN,WAAsB,EACtB,UAAU,EACV,YAAkC,EAClC,YAAkC,EAClC,UAA8B,EAC9B,cAAc,EACd,iBAAiB,EACjB,YAAY,GACb,EAAE,sBAAsB,CAAC,CAAC,CAAC,2CA8F3B"}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
import { jsxs as n, jsx as
|
|
1
|
+
import { jsxs as n, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { MinusSquare as N } from "@untitledui/icons";
|
|
3
3
|
import g from "../../primitives/select/SearchInput.js";
|
|
4
|
-
import { Checkbox as m } from "../../primitives/checkbox/checkbox.js";
|
|
5
|
-
import { Avatar as
|
|
6
|
-
function
|
|
7
|
-
return
|
|
4
|
+
import { Checkbox as m, CheckboxBase as b } from "../../primitives/checkbox/checkbox.js";
|
|
5
|
+
import { Avatar as S } from "../../primitives/avatar/avatar.js";
|
|
6
|
+
function C(a) {
|
|
7
|
+
return a.label ?? String(a.value ?? "");
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
return
|
|
9
|
+
function k(a) {
|
|
10
|
+
return a.value ?? String(a.id ?? "");
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
12
|
+
function w(a) {
|
|
13
|
+
return a.id ?? a.value;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
title:
|
|
15
|
+
function _({
|
|
16
|
+
title: a,
|
|
17
17
|
items: c,
|
|
18
|
-
selectedValues:
|
|
18
|
+
selectedValues: t,
|
|
19
19
|
selectAll: o,
|
|
20
20
|
search: l,
|
|
21
21
|
placeholder: u = "Search",
|
|
22
22
|
showAvatar: h,
|
|
23
|
-
getItemLabel:
|
|
24
|
-
getItemValue: f =
|
|
25
|
-
getItemKey: x =
|
|
23
|
+
getItemLabel: i = C,
|
|
24
|
+
getItemValue: f = k,
|
|
25
|
+
getItemKey: x = w,
|
|
26
26
|
onSearchChange: p,
|
|
27
27
|
onToggleSelectAll: s,
|
|
28
28
|
onToggleItem: v
|
|
29
29
|
}) {
|
|
30
30
|
const y = c.filter(
|
|
31
|
-
(e) =>
|
|
31
|
+
(e) => i(e).toLowerCase().includes(l.toLowerCase())
|
|
32
32
|
);
|
|
33
33
|
return /* @__PURE__ */ n("div", { children: [
|
|
34
34
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 mb-4", children: [
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
/* @__PURE__ */ r("h3", { className: "text-sm font-medium text-gray-900", children: a }),
|
|
36
|
+
t.length > 0 && /* @__PURE__ */ n("span", { className: "text-xs", children: [
|
|
37
|
+
t.length,
|
|
38
38
|
" selected"
|
|
39
39
|
] })
|
|
40
40
|
] }),
|
|
41
41
|
/* @__PURE__ */ n("div", { className: "space-y-1", children: [
|
|
42
|
-
(c.length > 10 || l) && /* @__PURE__ */
|
|
42
|
+
(c.length > 10 || l) && /* @__PURE__ */ r(
|
|
43
43
|
g,
|
|
44
44
|
{
|
|
45
45
|
className: "bg-secondary_subtle ring-0 rounded-md",
|
|
@@ -51,7 +51,7 @@ function K({
|
|
|
51
51
|
),
|
|
52
52
|
/* @__PURE__ */ n("div", { className: "max-h-48 overflow-y-auto", children: [
|
|
53
53
|
/* @__PURE__ */ n("div", { className: "flex items-center gap-3 p-2", children: [
|
|
54
|
-
o ? /* @__PURE__ */
|
|
54
|
+
o ? /* @__PURE__ */ r(
|
|
55
55
|
m,
|
|
56
56
|
{
|
|
57
57
|
className: "cursor-pointer",
|
|
@@ -59,22 +59,22 @@ function K({
|
|
|
59
59
|
isSelected: o,
|
|
60
60
|
onChange: s
|
|
61
61
|
}
|
|
62
|
-
) : /* @__PURE__ */
|
|
62
|
+
) : /* @__PURE__ */ r(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
65
|
onClick: s,
|
|
66
66
|
role: "checkbox",
|
|
67
|
-
"aria-checked":
|
|
67
|
+
"aria-checked": t.length > 0 ? "mixed" : !1,
|
|
68
68
|
"aria-label": "Select all",
|
|
69
69
|
tabIndex: 0,
|
|
70
70
|
onKeyDown: (e) => {
|
|
71
71
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), s());
|
|
72
72
|
},
|
|
73
73
|
className: "h-4 w-4 flex items-center justify-center overflow-hidden cursor-pointer",
|
|
74
|
-
children: /* @__PURE__ */
|
|
74
|
+
children: t.length > 0 ? /* @__PURE__ */ r(N, { size: 18, className: "text-utility-brand-600" }) : /* @__PURE__ */ r(b, { isSelected: !1 })
|
|
75
75
|
}
|
|
76
76
|
),
|
|
77
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ r("span", { className: "text-sm font-medium text-gray-900", children: "Select All" })
|
|
78
78
|
] }),
|
|
79
79
|
y.map((e) => {
|
|
80
80
|
const d = f(e);
|
|
@@ -83,23 +83,23 @@ function K({
|
|
|
83
83
|
{
|
|
84
84
|
className: "flex items-center gap-3 hover:bg-primary_hover rounded-md p-2",
|
|
85
85
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
86
|
+
/* @__PURE__ */ r(
|
|
87
87
|
m,
|
|
88
88
|
{
|
|
89
|
-
"aria-label":
|
|
90
|
-
isSelected:
|
|
89
|
+
"aria-label": i(e),
|
|
90
|
+
isSelected: t.includes(d),
|
|
91
91
|
onChange: () => v(d)
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
|
-
h ? /* @__PURE__ */
|
|
95
|
-
|
|
94
|
+
h ? /* @__PURE__ */ r(
|
|
95
|
+
S,
|
|
96
96
|
{
|
|
97
97
|
size: "xs",
|
|
98
|
-
initials:
|
|
99
|
-
alt:
|
|
98
|
+
initials: i(e).charAt(0),
|
|
99
|
+
alt: i(e)
|
|
100
100
|
}
|
|
101
101
|
) : null,
|
|
102
|
-
/* @__PURE__ */
|
|
102
|
+
/* @__PURE__ */ r("span", { className: "text-sm text-gray-700", children: i(e) })
|
|
103
103
|
]
|
|
104
104
|
},
|
|
105
105
|
x(e)
|
|
@@ -110,5 +110,5 @@ function K({
|
|
|
110
110
|
] });
|
|
111
111
|
}
|
|
112
112
|
export {
|
|
113
|
-
|
|
113
|
+
_ as FilterListSection
|
|
114
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/patterns/tabs/tabs.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,QAAQ,IAAI,YAAY,EACxB,cAAc,IAAI,kBAAkB,EACrC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAGL,QAAQ,IAAI,YAAY,EACxB,IAAI,IAAI,QAAQ,EAGjB,MAAM,uBAAuB,CAAC;AAY/B,KAAK,WAAW,GAAG,YAAY,GAAG,UAAU,CAAC;AAG7C,KAAK,eAAe,GAChB,cAAc,GACd,aAAa,GACb,eAAe,GACf,gBAAgB,GAChB,WAAW,GACX,eAAe,CAAC;AACpB,KAAK,aAAa,GAAG,cAAc,GAAG,aAAa,GAAG,eAAe,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAClG,KAAK,aAAa,CAAC,CAAC,IAAI,CAAC,SAAS,YAAY,GAAG,eAAe,GAAG,aAAa,CAAC;AAsDjF,QAAA,MAAM,KAAK,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,I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EF,eAAO,MAAM,QAAQ,GAAI,OAAO,qBAAqB,CAAC,OAAO,YAAY,CAAC,4CAYzE,CAAC;AAEF,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,4BAA4B;IAC5B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,kBAAkB,KAAK,SAAS,CAAC,CAAC;IAClE,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,oCAAoC;IACpC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAKD,eAAO,MAAM,GAAG,GAAI,OAAO,iBAAiB,4CA8C3C,CAAC;AAEF,eAAO,MAAM,IAAI;8BAA6B,qBAAqB,CAAC,OAAO,QAAQ,CAAC;mBA9EpD,qBAAqB,CAAC,OAAO,YAAY,CAAC;WA/ClD,CAAC,SAAS,WAAW,sGAS1C,qBAAqB,CAAC,iBAAiB,EAAE,CAAC,CAAC;kBAoEnB,iBAAiB;CAgE3C,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as b, jsxs as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { Tabs as
|
|
1
|
+
import { jsx as b, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as v, useContext as T, Fragment as w } from "react";
|
|
3
|
+
import { Tabs as z, useSlottedContext as N, TabsContext as B, TabList as C, Tab as L, TabPanel as P } from "react-aria-components";
|
|
4
4
|
import { cx as e } from "../../utils/cn.js";
|
|
5
5
|
import { Badge as p } from "../../primitives/badge/badge.js";
|
|
6
|
-
const
|
|
6
|
+
const j = ({ isFocusVisible: t, isSelected: n, isHovered: o, isDisabled: a }) => ({
|
|
7
7
|
"button-brand": e(
|
|
8
8
|
"outline-focus-ring",
|
|
9
9
|
t && "outline-2 -outline-offset-2",
|
|
@@ -51,7 +51,7 @@ const P = ({ isFocusVisible: t, isSelected: n, isHovered: o, isDisabled: a }) =>
|
|
|
51
51
|
!n && "before:shadow-[4px_4px_0_0_transparent] after:shadow-[-4px_4px_0_0_transparent]",
|
|
52
52
|
!n && !a && o && "bg-primary_hover text-primary"
|
|
53
53
|
)
|
|
54
|
-
}),
|
|
54
|
+
}), $ = {
|
|
55
55
|
xs: {
|
|
56
56
|
"button-brand": "text-xs font-semibold px-2",
|
|
57
57
|
"button-gray": "text-xs font-semibold px-2",
|
|
@@ -78,7 +78,7 @@ const P = ({ isFocusVisible: t, isSelected: n, isHovered: o, isDisabled: a }) =>
|
|
|
78
78
|
line: "text-md font-semibold pr-3.5 pl-3 py-1",
|
|
79
79
|
"button-curved": "py-2.5 px-5"
|
|
80
80
|
}
|
|
81
|
-
},
|
|
81
|
+
}, I = ({ size: t, fullWidth: n }) => ({
|
|
82
82
|
"button-brand": "gap-1",
|
|
83
83
|
"button-gray": "gap-1",
|
|
84
84
|
"button-border": e(
|
|
@@ -90,14 +90,14 @@ const P = ({ isFocusVisible: t, isSelected: n, isHovered: o, isDisabled: a }) =>
|
|
|
90
90
|
line: "gap-2",
|
|
91
91
|
"button-curved": "gap-0"
|
|
92
92
|
});
|
|
93
|
-
function
|
|
93
|
+
function k(t) {
|
|
94
94
|
return t.some((n) => {
|
|
95
95
|
if (!("badge" in n)) return !1;
|
|
96
96
|
const o = n.badge;
|
|
97
97
|
return o != null && String(o).length > 0;
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const A = {
|
|
101
101
|
xs: "!min-h-8",
|
|
102
102
|
sm: "!min-h-9",
|
|
103
103
|
md: "!min-h-10"
|
|
@@ -109,11 +109,11 @@ const k = {
|
|
|
109
109
|
underline: t || n ? "brand" : "gray",
|
|
110
110
|
line: t || n ? "brand" : "gray",
|
|
111
111
|
"button-curved": "gray"
|
|
112
|
-
}),
|
|
112
|
+
}), y = v({
|
|
113
113
|
size: "sm",
|
|
114
114
|
type: "button-brand",
|
|
115
115
|
reserveBadgeSlot: !1
|
|
116
|
-
}),
|
|
116
|
+
}), M = ({
|
|
117
117
|
size: t = "sm",
|
|
118
118
|
type: n = "button-brand",
|
|
119
119
|
orientation: o,
|
|
@@ -123,15 +123,15 @@ const k = {
|
|
|
123
123
|
items: u,
|
|
124
124
|
...r
|
|
125
125
|
}) => {
|
|
126
|
-
const i =
|
|
127
|
-
return /* @__PURE__ */ b(
|
|
126
|
+
const i = N(B), s = o ?? (i == null ? void 0 : i.orientation) ?? "horizontal", l = s === "horizontal" && n === "underline" && k(u);
|
|
127
|
+
return /* @__PURE__ */ b(y.Provider, { value: { size: t, type: n, orientation: s, fullWidth: a, reserveBadgeSlot: l }, children: /* @__PURE__ */ b(
|
|
128
128
|
C,
|
|
129
129
|
{
|
|
130
130
|
...r,
|
|
131
131
|
items: u,
|
|
132
132
|
className: (f) => e(
|
|
133
133
|
"group flex",
|
|
134
|
-
|
|
134
|
+
I({
|
|
135
135
|
size: t,
|
|
136
136
|
fullWidth: a
|
|
137
137
|
})[n],
|
|
@@ -140,11 +140,11 @@ const k = {
|
|
|
140
140
|
s === "horizontal" && n === "underline" && "relative before:absolute before:inset-x-0 before:bottom-0 before:h-px before:bg-border-secondary",
|
|
141
141
|
typeof d == "function" ? d(f) : d
|
|
142
142
|
),
|
|
143
|
-
children: m ?? ((f) => /* @__PURE__ */ b(
|
|
143
|
+
children: m ?? ((f) => /* @__PURE__ */ b(h, { ...f, children: f.children }))
|
|
144
144
|
}
|
|
145
145
|
) });
|
|
146
|
-
},
|
|
147
|
-
|
|
146
|
+
}, W = (t) => /* @__PURE__ */ b(
|
|
147
|
+
P,
|
|
148
148
|
{
|
|
149
149
|
...t,
|
|
150
150
|
className: (n) => e(
|
|
@@ -152,23 +152,23 @@ const k = {
|
|
|
152
152
|
typeof t.className == "function" ? t.className(n) : t.className
|
|
153
153
|
)
|
|
154
154
|
}
|
|
155
|
-
),
|
|
156
|
-
const { label: n, children: o, badge: a, leadingBadge: d, badgeClassName: m, ...u } = t, { size: r = "sm", type: i = "button-brand", fullWidth: s } =
|
|
155
|
+
), c = (t) => t != null && t !== "", h = (t) => {
|
|
156
|
+
const { label: n, children: o, badge: a, leadingBadge: d, badgeClassName: m, ...u } = t, { size: r = "sm", type: i = "button-brand", fullWidth: s } = T(y);
|
|
157
157
|
return /* @__PURE__ */ b(
|
|
158
|
-
|
|
158
|
+
L,
|
|
159
159
|
{
|
|
160
160
|
...u,
|
|
161
161
|
className: (l) => e(
|
|
162
162
|
"z-10 flex h-max cursor-pointer items-center justify-center gap-1 rounded-md whitespace-nowrap text-secondary transition duration-100 ease-linear",
|
|
163
163
|
"group-orientation-vertical:justify-start",
|
|
164
164
|
s && "w-full flex-1",
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
165
|
+
A[r],
|
|
166
|
+
$[r][i],
|
|
167
|
+
j(l)[i],
|
|
168
168
|
typeof t.className == "function" ? t.className(l) : t.className
|
|
169
169
|
),
|
|
170
|
-
children: (l) => /* @__PURE__ */
|
|
171
|
-
d && /* @__PURE__ */ b(
|
|
170
|
+
children: (l) => /* @__PURE__ */ _(w, { children: [
|
|
171
|
+
c(d) && /* @__PURE__ */ b(
|
|
172
172
|
p,
|
|
173
173
|
{
|
|
174
174
|
size: r === "xs" ? "sm" : r,
|
|
@@ -179,7 +179,7 @@ const k = {
|
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
181
|
typeof o == "function" ? o(l) : o || n,
|
|
182
|
-
a && /* @__PURE__ */ b(
|
|
182
|
+
c(a) && /* @__PURE__ */ b(
|
|
183
183
|
p,
|
|
184
184
|
{
|
|
185
185
|
size: r === "xs" ? "sm" : r,
|
|
@@ -193,7 +193,7 @@ const k = {
|
|
|
193
193
|
}
|
|
194
194
|
);
|
|
195
195
|
}, x = ({ className: t, ...n }) => /* @__PURE__ */ b(
|
|
196
|
-
|
|
196
|
+
z,
|
|
197
197
|
{
|
|
198
198
|
keyboardActivation: "manual",
|
|
199
199
|
...n,
|
|
@@ -206,12 +206,12 @@ const k = {
|
|
|
206
206
|
)
|
|
207
207
|
}
|
|
208
208
|
);
|
|
209
|
-
x.Panel =
|
|
210
|
-
x.List =
|
|
211
|
-
x.Item =
|
|
209
|
+
x.Panel = W;
|
|
210
|
+
x.List = M;
|
|
211
|
+
x.Item = h;
|
|
212
212
|
export {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
h as Tab,
|
|
214
|
+
M as TabList,
|
|
215
|
+
W as TabPanel,
|
|
216
216
|
x as Tabs
|
|
217
217
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indented-tree.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/indented-tree.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,UAAU,GAAG,KAAK,CAAC,EAAE,CAAC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,0HAS1B,iBAAiB,
|
|
1
|
+
{"version":3,"file":"indented-tree.d.ts","sourceRoot":"","sources":["../../../src/patterns/tree-view/indented-tree.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,UAAU,GAAG,KAAK,CAAC,EAAE,CAAC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,UAAU,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAExE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,EAAE,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,0HAS1B,iBAAiB,4CAuHnB,CAAC"}
|
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
import { jsx as n, jsxs as b } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { ChevronRight as
|
|
4
|
-
import { motion as
|
|
5
|
-
import { AnimatePresence as
|
|
6
|
-
const
|
|
7
|
-
tree:
|
|
8
|
-
onToggle:
|
|
9
|
-
CustomNode:
|
|
2
|
+
import { useRef as S, useState as j, useMemo as C, useId as M } from "react";
|
|
3
|
+
import { ChevronRight as _ } from "@untitledui/icons";
|
|
4
|
+
import { motion as D } from "../../node_modules/framer-motion/dist/es/render/components/motion/proxy.js";
|
|
5
|
+
import { AnimatePresence as B } from "../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.js";
|
|
6
|
+
const q = ({
|
|
7
|
+
tree: r,
|
|
8
|
+
onToggle: d,
|
|
9
|
+
CustomNode: v,
|
|
10
10
|
onNodeClick: c,
|
|
11
|
-
selectedNodeId:
|
|
12
|
-
keyboardNavigation:
|
|
13
|
-
canSelectNode:
|
|
14
|
-
"aria-label":
|
|
11
|
+
selectedNodeId: w,
|
|
12
|
+
keyboardNavigation: t,
|
|
13
|
+
canSelectNode: h,
|
|
14
|
+
"aria-label": f
|
|
15
15
|
}) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
var O;
|
|
17
|
+
const m = S(null), [u, $] = j(null), l = C(() => {
|
|
18
|
+
const i = [];
|
|
19
|
+
function e(s, o = "", A) {
|
|
20
|
+
s.forEach((p, E) => {
|
|
21
|
+
const P = o ? `${o}-${E}` : String(E);
|
|
22
|
+
i.push({ node: p, path: P, parentId: A }), p.isOpen && e(p.children, P, p.id);
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
|
-
return
|
|
25
|
-
}, [
|
|
26
|
-
function
|
|
27
|
-
var
|
|
28
|
-
const
|
|
29
|
-
`[data-tree-node-id="${CSS.escape(
|
|
25
|
+
return e(r), i;
|
|
26
|
+
}, [r]);
|
|
27
|
+
function a(i) {
|
|
28
|
+
var s;
|
|
29
|
+
const e = (s = m.current) == null ? void 0 : s.querySelector(
|
|
30
|
+
`[data-tree-node-id="${CSS.escape(i)}"]`
|
|
30
31
|
);
|
|
31
|
-
|
|
32
|
+
e == null || e.focus({ preventScroll: !0 }), e == null || e.scrollIntoView({ block: "nearest", behavior: "instant" });
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
if (!
|
|
35
|
-
const
|
|
34
|
+
function x(i) {
|
|
35
|
+
if (!t || i.nativeEvent.isComposing) return;
|
|
36
|
+
const e = i.target.closest(
|
|
36
37
|
"[data-tree-node-id]"
|
|
37
|
-
),
|
|
38
|
-
({ node:
|
|
38
|
+
), s = l.findIndex(
|
|
39
|
+
({ node: E }) => E.id === (e == null ? void 0 : e.dataset.treeNodeId)
|
|
39
40
|
);
|
|
40
|
-
if (
|
|
41
|
-
const { node:
|
|
41
|
+
if (s < 0) return;
|
|
42
|
+
const { node: o, path: A, parentId: p } = l[s];
|
|
42
43
|
if ([
|
|
43
44
|
"ArrowDown",
|
|
44
45
|
"ArrowUp",
|
|
@@ -48,111 +49,119 @@ const _ = ({
|
|
|
48
49
|
"End",
|
|
49
50
|
"Enter",
|
|
50
51
|
" "
|
|
51
|
-
].includes(
|
|
52
|
-
switch (
|
|
52
|
+
].includes(i.key) && !((i.key === "Enter" || i.key === " ") && i.target.closest("button")))
|
|
53
|
+
switch (i.preventDefault(), i.stopPropagation(), i.key) {
|
|
53
54
|
case "ArrowDown":
|
|
54
|
-
|
|
55
|
+
a(l[Math.min(s + 1, l.length - 1)].node.id);
|
|
55
56
|
break;
|
|
56
57
|
case "ArrowUp":
|
|
57
|
-
|
|
58
|
-
l[(a - 1 + l.length) % l.length].node.id
|
|
59
|
-
);
|
|
58
|
+
a(l[Math.max(s - 1, 0)].node.id);
|
|
60
59
|
break;
|
|
61
60
|
case "Home":
|
|
62
|
-
|
|
61
|
+
a(l[0].node.id);
|
|
63
62
|
break;
|
|
64
63
|
case "End":
|
|
65
|
-
|
|
64
|
+
a(l[l.length - 1].node.id);
|
|
66
65
|
break;
|
|
67
66
|
case "ArrowRight":
|
|
68
|
-
|
|
67
|
+
o.children.length && !o.isOpen ? d(A) : o.children.length && a(o.children[0].id);
|
|
69
68
|
break;
|
|
70
69
|
case "ArrowLeft":
|
|
71
|
-
|
|
70
|
+
o.children.length && o.isOpen ? d(A) : p && a(p);
|
|
72
71
|
break;
|
|
73
72
|
default:
|
|
74
|
-
(!
|
|
73
|
+
(!h || h(o)) && (c == null || c(o));
|
|
75
74
|
}
|
|
76
75
|
}
|
|
76
|
+
const I = u && l.some(({ node: i }) => i.id === u) ? u : (O = l[0]) == null ? void 0 : O.node.id;
|
|
77
|
+
function g(i) {
|
|
78
|
+
var s;
|
|
79
|
+
const e = (s = i.target.closest("[data-tree-node-id]")) == null ? void 0 : s.dataset.treeNodeId;
|
|
80
|
+
e && $(e);
|
|
81
|
+
}
|
|
77
82
|
return /* @__PURE__ */ n(
|
|
78
83
|
"div",
|
|
79
84
|
{
|
|
80
|
-
ref:
|
|
81
|
-
role:
|
|
82
|
-
"aria-label":
|
|
83
|
-
onKeyDown:
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
ref: m,
|
|
86
|
+
role: t ? "tree" : void 0,
|
|
87
|
+
"aria-label": t ? f : void 0,
|
|
88
|
+
onKeyDown: x,
|
|
89
|
+
onFocus: t ? g : void 0,
|
|
90
|
+
children: /* @__PURE__ */ n("div", { className: "flex flex-col gap-2", children: r.map((i, e) => /* @__PURE__ */ n(
|
|
91
|
+
R,
|
|
86
92
|
{
|
|
87
|
-
node:
|
|
88
|
-
path: String(
|
|
89
|
-
onToggle:
|
|
93
|
+
node: i,
|
|
94
|
+
path: String(e),
|
|
95
|
+
onToggle: d,
|
|
90
96
|
onNodeClick: c,
|
|
91
|
-
CustomNode:
|
|
92
|
-
keyboardNavigation:
|
|
93
|
-
selectedNodeId:
|
|
94
|
-
canSelectNode:
|
|
97
|
+
CustomNode: v,
|
|
98
|
+
keyboardNavigation: t,
|
|
99
|
+
selectedNodeId: w,
|
|
100
|
+
canSelectNode: h,
|
|
101
|
+
tabStopId: I,
|
|
95
102
|
level: 1,
|
|
96
|
-
position:
|
|
97
|
-
siblingCount:
|
|
103
|
+
position: e + 1,
|
|
104
|
+
siblingCount: r.length
|
|
98
105
|
},
|
|
99
|
-
|
|
106
|
+
i.id || e
|
|
100
107
|
)) })
|
|
101
108
|
}
|
|
102
109
|
);
|
|
103
|
-
},
|
|
104
|
-
node:
|
|
105
|
-
path:
|
|
106
|
-
onToggle:
|
|
110
|
+
}, R = ({
|
|
111
|
+
node: r,
|
|
112
|
+
path: d,
|
|
113
|
+
onToggle: v,
|
|
107
114
|
onNodeClick: c,
|
|
108
|
-
CustomNode:
|
|
109
|
-
keyboardNavigation:
|
|
110
|
-
selectedNodeId:
|
|
111
|
-
canSelectNode:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
+
CustomNode: w,
|
|
116
|
+
keyboardNavigation: t,
|
|
117
|
+
selectedNodeId: h,
|
|
118
|
+
canSelectNode: f,
|
|
119
|
+
tabStopId: m,
|
|
120
|
+
level: u,
|
|
121
|
+
position: $,
|
|
122
|
+
siblingCount: l
|
|
115
123
|
}) => {
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
},
|
|
119
|
-
|
|
124
|
+
const a = r.children.length > 0, x = M(), I = t && a && !!r.isOpen, g = h != null && r.id === h, O = (e) => {
|
|
125
|
+
e.stopPropagation(), v(d);
|
|
126
|
+
}, i = (e) => {
|
|
127
|
+
e.stopPropagation(), c == null || c(r);
|
|
120
128
|
};
|
|
121
129
|
return /* @__PURE__ */ b("div", { className: "relative", children: [
|
|
122
130
|
/* @__PURE__ */ b(
|
|
123
131
|
"div",
|
|
124
132
|
{
|
|
125
|
-
className: `flex items-center gap-2 py-0.5 ${
|
|
126
|
-
"data-tree-node-id":
|
|
127
|
-
role:
|
|
128
|
-
tabIndex:
|
|
129
|
-
"aria-
|
|
130
|
-
"aria-
|
|
131
|
-
"aria-
|
|
132
|
-
"aria-
|
|
133
|
-
"aria-
|
|
134
|
-
"aria-
|
|
133
|
+
className: `flex items-center gap-2 py-0.5 ${t ? "rounded-md outline-none hover:bg-primary_hover focus:bg-primary_hover" : ""}`,
|
|
134
|
+
"data-tree-node-id": r.id,
|
|
135
|
+
role: t ? "treeitem" : void 0,
|
|
136
|
+
tabIndex: t ? r.id === m ? 0 : -1 : void 0,
|
|
137
|
+
"aria-owns": I ? x : void 0,
|
|
138
|
+
"aria-label": t ? r.label : void 0,
|
|
139
|
+
"aria-level": t ? u : void 0,
|
|
140
|
+
"aria-posinset": t ? $ : void 0,
|
|
141
|
+
"aria-setsize": t ? l : void 0,
|
|
142
|
+
"aria-expanded": t && a ? !!r.isOpen : void 0,
|
|
143
|
+
"aria-selected": t && (!f || f(r)) ? g : void 0,
|
|
135
144
|
children: [
|
|
136
145
|
/* @__PURE__ */ n(
|
|
137
146
|
"div",
|
|
138
147
|
{
|
|
139
148
|
className: "w-4 h-4 flex-shrink-0",
|
|
140
|
-
onClick: (
|
|
141
|
-
children:
|
|
149
|
+
onClick: (e) => e.stopPropagation(),
|
|
150
|
+
children: a && /* @__PURE__ */ n(
|
|
142
151
|
"button",
|
|
143
152
|
{
|
|
144
153
|
type: "button",
|
|
145
|
-
tabIndex:
|
|
146
|
-
onClick:
|
|
154
|
+
tabIndex: t ? -1 : void 0,
|
|
155
|
+
onClick: O,
|
|
147
156
|
className: "cursor-pointer hover:bg-secondary_subtle rounded p-0.5 transition-colors flex items-center justify-center",
|
|
148
|
-
"aria-label":
|
|
157
|
+
"aria-label": r.isOpen ? "Collapse" : "Expand",
|
|
149
158
|
children: /* @__PURE__ */ n(
|
|
150
|
-
|
|
159
|
+
D.div,
|
|
151
160
|
{
|
|
152
161
|
initial: !1,
|
|
153
|
-
animate: { rotate:
|
|
162
|
+
animate: { rotate: r.isOpen ? 90 : 0 },
|
|
154
163
|
transition: { duration: 0.2, ease: "easeOut" },
|
|
155
|
-
children: /* @__PURE__ */ n(
|
|
164
|
+
children: /* @__PURE__ */ n(_, { className: "w-4 h-4 text-[var(--color-gray-400)]" })
|
|
156
165
|
}
|
|
157
166
|
)
|
|
158
167
|
}
|
|
@@ -162,28 +171,28 @@ const _ = ({
|
|
|
162
171
|
/* @__PURE__ */ n(
|
|
163
172
|
"div",
|
|
164
173
|
{
|
|
165
|
-
onClick:
|
|
174
|
+
onClick: i,
|
|
166
175
|
className: "flex-1 min-w-0 cursor-pointer",
|
|
167
|
-
children: /* @__PURE__ */ n(
|
|
176
|
+
children: /* @__PURE__ */ n(w, { node: r, isSelected: g })
|
|
168
177
|
}
|
|
169
178
|
)
|
|
170
179
|
]
|
|
171
180
|
}
|
|
172
181
|
),
|
|
173
|
-
/* @__PURE__ */ n(
|
|
174
|
-
|
|
182
|
+
/* @__PURE__ */ n(B, { initial: !1, children: a && r.isOpen && /* @__PURE__ */ n(
|
|
183
|
+
D.div,
|
|
175
184
|
{
|
|
176
|
-
initial:
|
|
185
|
+
initial: t ? !1 : { opacity: 0, height: 0 },
|
|
177
186
|
animate: {
|
|
178
187
|
opacity: 1,
|
|
179
188
|
height: "auto",
|
|
180
189
|
transition: {
|
|
181
190
|
height: {
|
|
182
|
-
duration:
|
|
191
|
+
duration: t ? 0 : 0.1,
|
|
183
192
|
ease: "easeOut"
|
|
184
193
|
},
|
|
185
194
|
opacity: {
|
|
186
|
-
duration:
|
|
195
|
+
duration: t ? 0 : 0.1,
|
|
187
196
|
ease: "easeOut"
|
|
188
197
|
}
|
|
189
198
|
}
|
|
@@ -193,11 +202,11 @@ const _ = ({
|
|
|
193
202
|
height: 0,
|
|
194
203
|
transition: {
|
|
195
204
|
height: {
|
|
196
|
-
duration:
|
|
205
|
+
duration: t ? 0 : 0.3,
|
|
197
206
|
ease: "easeIn"
|
|
198
207
|
},
|
|
199
208
|
opacity: {
|
|
200
|
-
duration:
|
|
209
|
+
duration: t ? 0 : 0.2,
|
|
201
210
|
ease: "easeIn"
|
|
202
211
|
}
|
|
203
212
|
}
|
|
@@ -205,28 +214,37 @@ const _ = ({
|
|
|
205
214
|
style: { overflow: "clip" },
|
|
206
215
|
children: /* @__PURE__ */ b("div", { className: "ml-6 relative", children: [
|
|
207
216
|
/* @__PURE__ */ n("div", { className: "absolute left-[-17px] top-[-6px] bottom-0 w-px bg-[var(--color-gray-200)]" }),
|
|
208
|
-
/* @__PURE__ */ n(
|
|
209
|
-
|
|
217
|
+
/* @__PURE__ */ n(
|
|
218
|
+
"div",
|
|
210
219
|
{
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
220
|
+
id: I ? x : void 0,
|
|
221
|
+
role: t ? "group" : void 0,
|
|
222
|
+
className: "flex flex-col gap-2",
|
|
223
|
+
children: r.children.map((e, s) => /* @__PURE__ */ n(
|
|
224
|
+
R,
|
|
225
|
+
{
|
|
226
|
+
node: e,
|
|
227
|
+
path: `${d}-${s}`,
|
|
228
|
+
onToggle: v,
|
|
229
|
+
onNodeClick: c,
|
|
230
|
+
CustomNode: w,
|
|
231
|
+
keyboardNavigation: t,
|
|
232
|
+
selectedNodeId: h,
|
|
233
|
+
canSelectNode: f,
|
|
234
|
+
tabStopId: m,
|
|
235
|
+
level: u + 1,
|
|
236
|
+
position: s + 1,
|
|
237
|
+
siblingCount: r.children.length
|
|
238
|
+
},
|
|
239
|
+
e.id || `${d}-${s}`
|
|
240
|
+
))
|
|
241
|
+
}
|
|
242
|
+
)
|
|
225
243
|
] })
|
|
226
244
|
}
|
|
227
245
|
) })
|
|
228
246
|
] });
|
|
229
247
|
};
|
|
230
248
|
export {
|
|
231
|
-
|
|
249
|
+
q as IndentedTree
|
|
232
250
|
};
|
|
@@ -7,7 +7,8 @@ export interface FeaturedIconProps {
|
|
|
7
7
|
className?: string;
|
|
8
8
|
}> | ReactNode;
|
|
9
9
|
size?: "sm" | "md" | "lg" | "xl";
|
|
10
|
-
|
|
10
|
+
/** @default "brand" */
|
|
11
|
+
color?: "brand" | "gray" | "success" | "warning" | "error";
|
|
11
12
|
theme?: "light" | "gradient" | "dark" | "outline" | "modern" | "modern-neue";
|
|
12
13
|
}
|
|
13
14
|
export declare const FeaturedIcon: (props: FeaturedIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"featured-icon.d.ts","sourceRoot":"","sources":["../../../src/primitives/featured-icon/featured-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAA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