@bioturing/components 0.16.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Badge/component.js +7 -20
- package/dist/components/Badge/component.js.map +1 -1
- package/dist/components/ColorSelect/component.js +138 -0
- package/dist/components/ColorSelect/component.js.map +1 -0
- package/dist/components/ColorSelect/style.css +1 -0
- package/dist/components/DragDrop/context.js +18 -0
- package/dist/components/DragDrop/context.js.map +1 -0
- package/dist/components/DragDrop/draggable.js +64 -0
- package/dist/components/DragDrop/draggable.js.map +1 -0
- package/dist/components/DragDrop/droppable.js +48 -0
- package/dist/components/DragDrop/droppable.js.map +1 -0
- package/dist/components/DragDrop/hooks.js +139 -0
- package/dist/components/DragDrop/hooks.js.map +1 -0
- package/dist/components/DragDrop/index.js +45 -0
- package/dist/components/DragDrop/index.js.map +1 -0
- package/dist/components/DragDrop/style.css +1 -0
- package/dist/components/IconButton/component.js +54 -43
- package/dist/components/IconButton/component.js.map +1 -1
- package/dist/components/IconButton/style.css +1 -1
- package/dist/components/Nav/context.js +7 -0
- package/dist/components/Nav/context.js.map +1 -0
- package/dist/components/Nav/group.js +16 -0
- package/dist/components/Nav/group.js.map +1 -0
- package/dist/components/Nav/heading.js +16 -0
- package/dist/components/Nav/heading.js.map +1 -0
- package/dist/components/Nav/index.js +13 -0
- package/dist/components/Nav/index.js.map +1 -0
- package/dist/components/Nav/item.js +36 -0
- package/dist/components/Nav/item.js.map +1 -0
- package/dist/components/Nav/style.css +1 -0
- package/dist/components/PopupPanel/component.js +69 -74
- package/dist/components/PopupPanel/component.js.map +1 -1
- package/dist/components/Stack/Stack.js +40 -34
- package/dist/components/Stack/Stack.js.map +1 -1
- package/dist/components/Stack/StackChild.js +59 -54
- package/dist/components/Stack/StackChild.js.map +1 -1
- package/dist/components/Tag/component.js +59 -24
- package/dist/components/Tag/component.js.map +1 -1
- package/dist/components/Tag/style.css +1 -1
- package/dist/components/ThemeProvider/component.js +18 -18
- package/dist/components/ThemeProvider/component.js.map +1 -1
- package/dist/components/ThemeProvider/style.css +1 -1
- package/dist/components/Toast/component.js +29 -35
- package/dist/components/Toast/component.js.map +1 -1
- package/dist/components/Tooltip/component.js +4 -22
- package/dist/components/Tooltip/component.js.map +1 -1
- package/dist/components/VerticalCollapsiblePanel/component.js +37 -37
- package/dist/components/VerticalCollapsiblePanel/component.js.map +1 -1
- package/dist/components/hooks/useCharts.js +19 -17
- package/dist/components/hooks/useCharts.js.map +1 -1
- package/dist/components/utils/colors.js +5 -0
- package/dist/components/utils/colors.js.map +1 -0
- package/dist/index.d.ts +724 -23
- package/dist/index.js +186 -162
- package/dist/index.js.map +1 -1
- package/dist/metadata.js +45 -7
- package/dist/metadata.js.map +1 -1
- package/dist/tailwind.css +1 -1
- package/dist/tokens/and-theme/tokens.js +13 -7
- package/dist/tokens/and-theme/tokens.js.map +1 -1
- package/dist/tokens/charts/{tokens.js → palettes/cloudscape.js} +22 -12
- package/dist/tokens/charts/palettes/cloudscape.js.map +1 -0
- package/dist/tokens/charts/palettes/colorbrewer.js +1525 -0
- package/dist/tokens/charts/palettes/colorbrewer.js.map +1 -0
- package/dist/tokens/charts/palettes/index.js +61 -0
- package/dist/tokens/charts/palettes/index.js.map +1 -0
- package/dist/tokens/charts/palettes/tableau.js +112 -0
- package/dist/tokens/charts/palettes/tableau.js.map +1 -0
- package/dist/tokens/utils.js.map +1 -1
- package/package.json +2 -2
- package/dist/tokens/charts/index.js +0 -18
- package/dist/tokens/charts/index.js.map +0 -1
- package/dist/tokens/charts/tokens.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import { X as
|
|
4
|
-
import { Toast as
|
|
3
|
+
import { X as g, CircleNotch as w, CheckCircle as C, XCircle as T, WarningCircle as k, Info as b } from "@bioturing/assets";
|
|
4
|
+
import { Toast as t } from "@base-ui-components/react";
|
|
5
5
|
import { toastManager as a } from "./function.js";
|
|
6
6
|
import { useEffect as v, useCallback as x } from "react";
|
|
7
7
|
import { Button as B } from "../Button/component.js";
|
|
@@ -9,33 +9,33 @@ import { Modal as I } from "../Modal/index.js";
|
|
|
9
9
|
import './style.css';/* empty css */
|
|
10
10
|
import { isTracebackError as M } from "../utils/isTracebackError.js";
|
|
11
11
|
import { CodeBlock as P } from "../CodeBlock/component.js";
|
|
12
|
-
import { useCls as f
|
|
12
|
+
import { useCls as f } from "../utils/antdUtils.js";
|
|
13
13
|
import { IconButton as j } from "../IconButton/component.js";
|
|
14
14
|
import { clsx as E } from "../utils/cn.js";
|
|
15
15
|
function u({
|
|
16
16
|
toast: e
|
|
17
17
|
}) {
|
|
18
18
|
var l;
|
|
19
|
-
const
|
|
19
|
+
const o = f(), n = {
|
|
20
20
|
info: /* @__PURE__ */ r(b, { weight: "fill" }),
|
|
21
21
|
warning: /* @__PURE__ */ r(k, { weight: "fill" }),
|
|
22
22
|
error: /* @__PURE__ */ r(T, { weight: "fill" }),
|
|
23
|
-
success: /* @__PURE__ */ r(
|
|
24
|
-
progress: /* @__PURE__ */ r(
|
|
25
|
-
}, i = ((l = e.data) == null ? void 0 : l.type) || "info",
|
|
23
|
+
success: /* @__PURE__ */ r(C, { weight: "fill" }),
|
|
24
|
+
progress: /* @__PURE__ */ r(w, {})
|
|
25
|
+
}, i = ((l = e.data) == null ? void 0 : l.type) || "info", s = M(e == null ? void 0 : e.description);
|
|
26
26
|
v(() => {
|
|
27
|
-
|
|
28
|
-
}, [
|
|
27
|
+
s && a.update(e.id, { timeout: 0 });
|
|
28
|
+
}, [s, e.id]);
|
|
29
29
|
const h = x(
|
|
30
|
-
(
|
|
31
|
-
const { children: m, className: d, ...p } =
|
|
32
|
-
return
|
|
30
|
+
(N) => {
|
|
31
|
+
const { children: m, className: d, ...p } = N;
|
|
32
|
+
return s ? /* @__PURE__ */ c(
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
35
|
...p,
|
|
36
|
-
className:
|
|
36
|
+
className: o(
|
|
37
37
|
"toast-description",
|
|
38
|
-
|
|
38
|
+
s ? "toast-description-traceback" : "",
|
|
39
39
|
d
|
|
40
40
|
),
|
|
41
41
|
children: [
|
|
@@ -60,43 +60,37 @@ function u({
|
|
|
60
60
|
) })
|
|
61
61
|
]
|
|
62
62
|
}
|
|
63
|
-
) : /* @__PURE__ */ r("p", { ...p, className:
|
|
63
|
+
) : /* @__PURE__ */ r("p", { ...p, className: o("toast-description", d), children: m });
|
|
64
64
|
},
|
|
65
|
-
[
|
|
65
|
+
[s, o, e.id]
|
|
66
66
|
);
|
|
67
|
-
return /* @__PURE__ */ c(
|
|
68
|
-
/* @__PURE__ */ r("span", { className:
|
|
69
|
-
/* @__PURE__ */ c("div", { className:
|
|
70
|
-
/* @__PURE__ */ r(
|
|
71
|
-
/* @__PURE__ */ r(
|
|
67
|
+
return /* @__PURE__ */ c(t.Root, { toast: e, className: o("toast"), children: [
|
|
68
|
+
/* @__PURE__ */ r("span", { className: o("toast-icon-wrap"), children: /* @__PURE__ */ r("span", { className: o("toast-icon", `toast-icon-${i}`), children: n[i] }) }),
|
|
69
|
+
/* @__PURE__ */ c("div", { className: o("toast-content"), children: [
|
|
70
|
+
/* @__PURE__ */ r(t.Title, { className: o("toast-title") }),
|
|
71
|
+
/* @__PURE__ */ r(t.Description, { render: h })
|
|
72
72
|
] }),
|
|
73
73
|
/* @__PURE__ */ r(
|
|
74
|
-
|
|
74
|
+
t.Close,
|
|
75
75
|
{
|
|
76
|
-
className:
|
|
77
|
-
render: /* @__PURE__ */ r(j, { size: "small", children: /* @__PURE__ */ r(
|
|
76
|
+
className: o("toast-close"),
|
|
77
|
+
render: /* @__PURE__ */ r(j, { size: "small", children: /* @__PURE__ */ r(g, {}) })
|
|
78
78
|
}
|
|
79
79
|
)
|
|
80
80
|
] });
|
|
81
81
|
}
|
|
82
82
|
function y({ className: e }) {
|
|
83
|
-
const { toasts:
|
|
84
|
-
return /* @__PURE__ */ r(
|
|
85
|
-
s.Viewport,
|
|
86
|
-
{
|
|
87
|
-
className: E(n("toast-viewport"), i, e),
|
|
88
|
-
children: t.map((o) => /* @__PURE__ */ r(u, { toast: o }, o.id))
|
|
89
|
-
}
|
|
90
|
-
);
|
|
83
|
+
const { toasts: o } = t.useToastManager(), n = f();
|
|
84
|
+
return /* @__PURE__ */ r(t.Viewport, { className: E(n("toast-viewport"), e), children: o.map((i) => /* @__PURE__ */ r(u, { toast: i }, i.id)) });
|
|
91
85
|
}
|
|
92
86
|
function z(e) {
|
|
93
|
-
return /* @__PURE__ */ r(
|
|
87
|
+
return /* @__PURE__ */ r(t.Provider, { toastManager: a, ...e });
|
|
94
88
|
}
|
|
95
|
-
const
|
|
89
|
+
const J = Object.assign(u, {
|
|
96
90
|
List: y,
|
|
97
91
|
Provider: z
|
|
98
92
|
});
|
|
99
93
|
export {
|
|
100
|
-
|
|
94
|
+
J as Toast
|
|
101
95
|
};
|
|
102
96
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/Toast/component.tsx"],"sourcesContent":["\"use client\";\nimport {
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Toast/component.tsx"],"sourcesContent":["\"use client\";\nimport { useCls, clsx } from \"../utils\";\nimport {\n CheckCircle,\n CircleNotch,\n Info,\n WarningCircle,\n X,\n XCircle,\n} from \"@bioturing/assets\";\nimport { Toast as BaseToast } from \"@base-ui-components/react\";\nimport { IconButton } from \"../IconButton\";\nimport { ToastData } from \"./types\";\nimport { toastManager } from \"./function\";\nimport { isTracebackError, type GenericHTMLProps } from \"../utils\";\nimport { useCallback, useEffect } from \"react\";\nimport { Button } from \"../Button/component\";\nimport { Modal } from \"../Modal\";\nimport { CodeBlock } from \"../CodeBlock\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nfunction InnerToast({\n toast,\n}: {\n toast: BaseToast.Root.ToastObject<ToastData>;\n}) {\n const cls = useCls();\n const toastIconMap = {\n info: <Info weight=\"fill\" />,\n warning: <WarningCircle weight=\"fill\" />,\n error: <XCircle weight=\"fill\" />,\n success: <CheckCircle weight=\"fill\" />,\n progress: <CircleNotch />,\n };\n const type = toast.data?.type || \"info\";\n const isTraceback = isTracebackError(toast?.description);\n\n // Update manager timeout for traceback to disable auto-dismiss\n useEffect(() => {\n if (isTraceback) {\n toastManager.update(toast.id, { timeout: 0 });\n }\n }, [isTraceback, toast.id]);\n // console.log(toast);\n const renderDescription: BaseToast.Description.Props[\"render\"] = useCallback(\n (props: GenericHTMLProps) => {\n const { children, className, ...rest } = props;\n if (isTraceback) {\n return (\n <div\n {...rest}\n className={cls(\n \"toast-description\",\n isTraceback ? \"toast-description-traceback\" : \"\",\n className\n )}\n >\n <p>\n An unexpected error occurred.\n <br />\n Please contact us with error details for support.\n </p>\n <p>\n <Button\n size=\"small\"\n onClick={() => {\n Modal.open({\n title: \"Error details\",\n content: <CodeBlock>{children}</CodeBlock>,\n hideOkButton: true,\n });\n toastManager.close(toast.id);\n }}\n >\n View error details\n </Button>\n </p>\n </div>\n );\n }\n return (\n <p {...rest} className={cls(\"toast-description\", className)}>\n {children}\n </p>\n );\n },\n [isTraceback, cls, toast.id]\n );\n return (\n <BaseToast.Root toast={toast} className={cls(\"toast\")}>\n <span className={cls(\"toast-icon-wrap\")}>\n <span className={cls(\"toast-icon\", `toast-icon-${type}`)}>\n {toastIconMap[type]}\n </span>\n </span>\n <div className={cls(\"toast-content\")}>\n <BaseToast.Title className={cls(\"toast-title\")} />\n <BaseToast.Description render={renderDescription} />\n </div>\n <BaseToast.Close\n className={cls(\"toast-close\")}\n render={\n <IconButton size=\"small\">\n <X />\n </IconButton>\n }\n ></BaseToast.Close>\n </BaseToast.Root>\n );\n}\n\nfunction ToastList({ className }: { className?: string }) {\n const { toasts } = BaseToast.useToastManager();\n const cls = useCls();\n\n return (\n <BaseToast.Viewport className={clsx(cls(\"toast-viewport\"), className)}>\n {toasts.map((toast) => (\n <InnerToast key={toast.id} toast={toast} />\n ))}\n </BaseToast.Viewport>\n );\n}\n\nfunction ToastProvider(props: BaseToast.Provider.Props) {\n return <BaseToast.Provider toastManager={toastManager} {...props} />;\n}\n\nexport const Toast = Object.assign(InnerToast, {\n List: ToastList,\n Provider: ToastProvider,\n});\n"],"names":["InnerToast","toast","cls","useCls","toastIconMap","jsx","Info","WarningCircle","XCircle","CheckCircle","CircleNotch","type","_a","isTraceback","isTracebackError","useEffect","toastManager","renderDescription","useCallback","props","children","className","rest","jsxs","Button","Modal","CodeBlock","BaseToast","IconButton","X","ToastList","toasts","clsx","ToastProvider","Toast"],"mappings":";;;;;;;;;;;;;;AAuBA,SAASA,EAAW;AAAA,EAClB,OAAAC;AACF,GAEG;;AACD,QAAMC,IAAMC,EAAO,GACbC,IAAe;AAAA,IACnB,MAAM,gBAAAC,EAACC,GAAK,EAAA,QAAO,OAAO,CAAA;AAAA,IAC1B,SAAS,gBAAAD,EAACE,GAAc,EAAA,QAAO,OAAO,CAAA;AAAA,IACtC,OAAO,gBAAAF,EAACG,GAAQ,EAAA,QAAO,OAAO,CAAA;AAAA,IAC9B,SAAS,gBAAAH,EAACI,GAAY,EAAA,QAAO,OAAO,CAAA;AAAA,IACpC,4BAAWC,GAAY,CAAA,CAAA;AAAA,EACzB,GACMC,MAAOC,IAAAX,EAAM,SAAN,gBAAAW,EAAY,SAAQ,QAC3BC,IAAcC,EAAiBb,KAAA,gBAAAA,EAAO,WAAW;AAGvD,EAAAc,EAAU,MAAM;AACd,IAAIF,KACFG,EAAa,OAAOf,EAAM,IAAI,EAAE,SAAS,GAAG;AAAA,EAE7C,GAAA,CAACY,GAAaZ,EAAM,EAAE,CAAC;AAE1B,QAAMgB,IAA2DC;AAAA,IAC/D,CAACC,MAA4B;AAC3B,YAAM,EAAE,UAAAC,GAAU,WAAAC,GAAW,GAAGC,EAAS,IAAAH;AACzC,aAAIN,IAEA,gBAAAU;AAAA,QAAC;A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AsB,QAAQV,EAAmB,CAAA;AAAA,IAAA,GACpD;AAAA,IACA,gBAAAZ;AAAA,MAACsB,EAAU;AAAA,MAAV;AAAA,QACC,WAAWzB,EAAI,aAAa;AAAA,QAC5B,QACG,gBAAAG,EAAAuB,GAAA,EAAW,MAAK,SACf,UAAA,gBAAAvB,EAACwB,KAAE,EACL,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEH,GACH;AAEJ;AAEA,SAASC,EAAU,EAAE,WAAAT,KAAqC;AACxD,QAAM,EAAE,QAAAU,EAAA,IAAWJ,EAAU,gBAAgB,GACvCzB,IAAMC,EAAO;AAGjB,SAAA,gBAAAE,EAACsB,EAAU,UAAV,EAAmB,WAAWK,EAAK9B,EAAI,gBAAgB,GAAGmB,CAAS,GACjE,UAAOU,EAAA,IAAI,CAAC9B,MACX,gBAAAI,EAACL,KAA0B,OAAAC,EAAV,GAAAA,EAAM,EAAkB,CAC1C,GACH;AAEJ;AAEA,SAASgC,EAAcd,GAAiC;AACtD,2BAAQQ,EAAU,UAAV,EAAmB,cAAAX,GAA6B,GAAGG,GAAO;AACpE;AAEa,MAAAe,IAAQ,OAAO,OAAOlC,GAAY;AAAA,EAC7C,MAAM8B;AAAA,EACN,UAAUG;AACZ,CAAC;"}
|
|
@@ -1,27 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
2
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import i from "antd/es/tooltip";
|
|
4
4
|
import './style.css';/* empty css */
|
|
5
|
-
|
|
6
|
-
import { clsx as e } from "../utils/cn.js";
|
|
7
|
-
const x = ({
|
|
8
|
-
className: o,
|
|
9
|
-
style: t,
|
|
10
|
-
arrow: r = !1,
|
|
11
|
-
...s
|
|
12
|
-
}) => {
|
|
13
|
-
const m = p();
|
|
14
|
-
return /* @__PURE__ */ i(
|
|
15
|
-
l,
|
|
16
|
-
{
|
|
17
|
-
className: e(m("tooltip"), o),
|
|
18
|
-
arrow: r,
|
|
19
|
-
style: t,
|
|
20
|
-
...s
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
};
|
|
5
|
+
const l = ({ arrow: o = !1, ...t }) => /* @__PURE__ */ r(i, { arrow: o, ...t });
|
|
24
6
|
export {
|
|
25
|
-
|
|
7
|
+
l as Tooltip
|
|
26
8
|
};
|
|
27
9
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/Tooltip/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntTooltip,\n type TooltipProps as AntTooltipProps,\n} from \"antd/es/tooltip\";\
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Tooltip/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntTooltip,\n type TooltipProps as AntTooltipProps,\n} from \"antd/es/tooltip\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define props interface extending Ant Design's TooltipProps\nexport type TooltipProps = AntTooltipProps & {\n /**\n * Arrow config for of the tooltip\n * @default false\n */\n arrow?: AntTooltipProps[\"arrow\"];\n};\n\n// Create Tooltip component\nexport const Tooltip = ({ arrow = false, ...rest }: TooltipProps) => {\n return <AntTooltip arrow={arrow} {...rest} />;\n};\n"],"names":["Tooltip","arrow","rest","jsx","AntTooltip"],"mappings":";;;;AAmBO,MAAMA,IAAU,CAAC,EAAE,OAAAC,IAAQ,IAAO,GAAGC,QAClC,gBAAAC,EAAAC,GAAA,EAAW,OAAAH,GAAe,GAAGC,EAAM,CAAA;"}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as r, jsx as l } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
3
|
+
import { useState as I, useRef as g, useEffect as j } from "react";
|
|
4
4
|
import { Collapsible as n } from "@base-ui-components/react";
|
|
5
|
-
import { MinusCircle as
|
|
6
|
-
import { useControlledState as
|
|
7
|
-
import { Truncate as
|
|
5
|
+
import { MinusCircle as M, PlusCircle as R } from "@bioturing/assets";
|
|
6
|
+
import { useControlledState as S } from "../hooks/useControlledState.js";
|
|
7
|
+
import { Truncate as A } from "../Truncate/component.js";
|
|
8
8
|
import './style.css';/* empty css */
|
|
9
9
|
import { Transition as E } from "../Transition/component.js";
|
|
10
|
-
import { useCls as T
|
|
11
|
-
import { useAnimationsFinished as
|
|
12
|
-
import { clsx as
|
|
10
|
+
import { useCls as T } from "../utils/antdUtils.js";
|
|
11
|
+
import { useAnimationsFinished as V } from "../hooks/base-ui.js";
|
|
12
|
+
import { clsx as a } from "../utils/cn.js";
|
|
13
13
|
import { IconButton as f } from "../IconButton/component.js";
|
|
14
|
-
const
|
|
14
|
+
const X = ({
|
|
15
15
|
children: h,
|
|
16
16
|
title: i,
|
|
17
|
-
defaultOpen:
|
|
18
|
-
open:
|
|
17
|
+
defaultOpen: b = !1,
|
|
18
|
+
open: u,
|
|
19
19
|
onOpenChange: N,
|
|
20
|
-
className:
|
|
21
|
-
headerClassName:
|
|
22
|
-
headerInnerClassName:
|
|
20
|
+
className: x,
|
|
21
|
+
headerClassName: y,
|
|
22
|
+
headerInnerClassName: C,
|
|
23
23
|
bodyClassName: v,
|
|
24
|
-
contentPadding:
|
|
25
|
-
afterTitle:
|
|
24
|
+
contentPadding: o = "16px",
|
|
25
|
+
afterTitle: p,
|
|
26
26
|
actions: O,
|
|
27
|
-
useTitleAsTrigger:
|
|
27
|
+
useTitleAsTrigger: c = !0,
|
|
28
28
|
keepMounted: w = !1
|
|
29
29
|
}) => {
|
|
30
|
-
const e = T(), [s, t] =
|
|
31
|
-
|
|
30
|
+
const e = T(), [s, t] = S(
|
|
31
|
+
u,
|
|
32
32
|
N,
|
|
33
|
-
|
|
34
|
-
), [k, B] =
|
|
33
|
+
b
|
|
34
|
+
), [k, B] = I(s), m = g(null), d = V(m, {
|
|
35
35
|
waitForNextTick: s
|
|
36
|
-
})
|
|
36
|
+
});
|
|
37
37
|
return j(() => {
|
|
38
38
|
d(() => {
|
|
39
39
|
B(s);
|
|
@@ -41,29 +41,29 @@ const Z = ({
|
|
|
41
41
|
}, [s, d]), /* @__PURE__ */ r(
|
|
42
42
|
n.Root,
|
|
43
43
|
{
|
|
44
|
-
className:
|
|
44
|
+
className: a(e("collapsible-panel"), x),
|
|
45
45
|
open: s,
|
|
46
46
|
onOpenChange: t,
|
|
47
47
|
ref: m,
|
|
48
48
|
children: [
|
|
49
|
-
/* @__PURE__ */ r("div", { className:
|
|
49
|
+
/* @__PURE__ */ r("div", { className: a(e("collapsible-panel-header"), y), children: [
|
|
50
50
|
/* @__PURE__ */ r(
|
|
51
51
|
"div",
|
|
52
52
|
{
|
|
53
|
-
className:
|
|
53
|
+
className: a(
|
|
54
54
|
e("collapsible-panel-header-inner"),
|
|
55
|
-
|
|
55
|
+
C
|
|
56
56
|
),
|
|
57
57
|
children: [
|
|
58
58
|
/* @__PURE__ */ l(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
className: e("collapsible-panel-header-text"),
|
|
62
|
-
onClick:
|
|
63
|
-
style:
|
|
62
|
+
onClick: c ? () => t((F) => !F) : void 0,
|
|
63
|
+
style: c ? {
|
|
64
64
|
cursor: "pointer"
|
|
65
65
|
} : {},
|
|
66
|
-
children: typeof i == "string" ? /* @__PURE__ */ l(
|
|
66
|
+
children: typeof i == "string" ? /* @__PURE__ */ l(A, { children: i }) : i
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
69
|
/* @__PURE__ */ r("div", { className: e("collapsible-panel-header-actions"), children: [
|
|
@@ -73,19 +73,19 @@ const Z = ({
|
|
|
73
73
|
{
|
|
74
74
|
className: e("collapsible-panel-trigger"),
|
|
75
75
|
render: s ? /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
|
|
76
|
-
|
|
76
|
+
M,
|
|
77
77
|
{
|
|
78
78
|
weight: "bold",
|
|
79
|
-
className:
|
|
79
|
+
className: a(
|
|
80
80
|
e("collapsible-panel-caret"),
|
|
81
81
|
s && e("collapsible-panel-caret-open")
|
|
82
82
|
)
|
|
83
83
|
}
|
|
84
84
|
) }) : /* @__PURE__ */ l(f, { children: /* @__PURE__ */ l(
|
|
85
|
-
|
|
85
|
+
R,
|
|
86
86
|
{
|
|
87
87
|
weight: "bold",
|
|
88
|
-
className:
|
|
88
|
+
className: a(
|
|
89
89
|
e("collapsible-panel-caret"),
|
|
90
90
|
s && e("collapsible-panel-caret-open")
|
|
91
91
|
)
|
|
@@ -97,21 +97,21 @@ const Z = ({
|
|
|
97
97
|
]
|
|
98
98
|
}
|
|
99
99
|
),
|
|
100
|
-
s &&
|
|
100
|
+
s && p && /* @__PURE__ */ l("div", { className: e("collapsible-panel-header-after"), children: p })
|
|
101
101
|
] }),
|
|
102
102
|
/* @__PURE__ */ l(
|
|
103
103
|
n.Panel,
|
|
104
104
|
{
|
|
105
105
|
className: e("collapsible-panel-content"),
|
|
106
|
-
style: typeof
|
|
107
|
-
"--ds-content-padding":
|
|
106
|
+
style: typeof o < "u" ? {
|
|
107
|
+
"--ds-content-padding": o === !1 || o === 0 ? "0" : typeof o == "number" ? `${o}px` : o
|
|
108
108
|
} : {},
|
|
109
109
|
keepMounted: w,
|
|
110
110
|
children: /* @__PURE__ */ l(
|
|
111
111
|
E,
|
|
112
112
|
{
|
|
113
113
|
show: k,
|
|
114
|
-
className:
|
|
114
|
+
className: a(e("collapsible-panel-body"), v),
|
|
115
115
|
keepMounted: !0,
|
|
116
116
|
children: /* @__PURE__ */ l("div", { children: h })
|
|
117
117
|
}
|
|
@@ -123,6 +123,6 @@ const Z = ({
|
|
|
123
123
|
);
|
|
124
124
|
};
|
|
125
125
|
export {
|
|
126
|
-
|
|
126
|
+
X as VerticalCollapsiblePanel
|
|
127
127
|
};
|
|
128
128
|
//# sourceMappingURL=component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/VerticalCollapsiblePanel/component.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { Collapsible } from \"@base-ui-components/react\";\nimport { MinusCircle, PlusCircle } from \"@bioturing/assets\";\nimport { useCls, clsx
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/VerticalCollapsiblePanel/component.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useRef, useState } from \"react\";\nimport { Collapsible } from \"@base-ui-components/react\";\nimport { MinusCircle, PlusCircle } from \"@bioturing/assets\";\nimport { useCls, clsx } from \"../utils\";\nimport { useControlledState } from \"../hooks/useControlledState\";\nimport { Transition } from \"../Transition\";\nimport { useAnimationsFinished } from \"../hooks\";\nimport { IconButton } from \"../IconButton\";\nimport { Truncate } from \"../Truncate/component\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport interface VerticalCollapsiblePanelProps {\n /**\n * The content of the panel that will be toggled\n */\n children: React.ReactNode;\n /**\n * The header of the panel\n */\n title?: React.ReactNode;\n /**\n * Indicate if the title should be used as a trigger\n * @default true\n */\n useTitleAsTrigger?: boolean;\n /**\n * Custom Content Padding\n * @default \"24px\"\n */\n contentPadding?: number | string | boolean;\n /**\n * Add more content below the title\n * Only show when panel is open\n */\n afterTitle?: React.ReactNode;\n\n /**\n * Whether the panel is expanded by default\n */\n defaultOpen?: boolean;\n /**\n * Control the open state (makes the component controlled)\n */\n open?: boolean;\n /**\n * Callback when the open state changes\n */\n onOpenChange?: (open: boolean) => void;\n /**\n * Additional class name for the component\n */\n className?: string;\n /**\n * Addtional class name for the header\n */\n headerClassName?: string;\n /**\n * Addtional class name for the header\n */\n headerInnerClassName?: string;\n /**\n * Addtional class name for the body\n * */\n bodyClassName?: string;\n /**\n * Actions to be displayed in the header\n * Only show when panel is open\n */\n actions?: React.ReactNode;\n /**\n * Keeping it as mounted, just hide the content\n */\n keepMounted?: boolean;\n}\n\nexport const VerticalCollapsiblePanel: React.FC<\n VerticalCollapsiblePanelProps\n> = ({\n children,\n title,\n defaultOpen = false,\n open: controlledOpen,\n onOpenChange,\n className,\n headerClassName,\n headerInnerClassName,\n bodyClassName,\n contentPadding = \"16px\",\n afterTitle,\n actions,\n useTitleAsTrigger = true,\n keepMounted = false,\n}) => {\n const cls = useCls();\n // Use useControlledState for open state\n const [isOpen, setIsOpen] = useControlledState(\n controlledOpen,\n onOpenChange,\n defaultOpen\n );\n const [isBodyOpen, setIsBodyOpen] = useState(isOpen);\n const ref = useRef<HTMLDivElement>(null);\n const runOnceAnimationsFinish = useAnimationsFinished(ref, {\n waitForNextTick: isOpen,\n });\n useEffect(() => {\n runOnceAnimationsFinish(() => {\n setIsBodyOpen(isOpen);\n });\n }, [isOpen, runOnceAnimationsFinish]);\n return (\n <Collapsible.Root\n className={clsx(cls(\"collapsible-panel\"), className)}\n open={isOpen}\n onOpenChange={setIsOpen}\n ref={ref}\n >\n <div className={clsx(cls(\"collapsible-panel-header\"), headerClassName)}>\n <div\n className={clsx(\n cls(\"collapsible-panel-header-inner\"),\n headerInnerClassName\n )}\n >\n <div\n className={cls(\"collapsible-panel-header-text\")}\n onClick={\n useTitleAsTrigger ? () => setIsOpen((open) => !open) : undefined\n }\n style={\n useTitleAsTrigger\n ? {\n cursor: \"pointer\",\n }\n : {}\n }\n >\n {typeof title == \"string\" ? <Truncate>{title}</Truncate> : title}\n </div>\n <div className={cls(\"collapsible-panel-header-actions\")}>\n {isOpen && actions}\n <Collapsible.Trigger\n className={cls(\"collapsible-panel-trigger\")}\n render={\n isOpen ? (\n <IconButton>\n <MinusCircle\n weight=\"bold\"\n className={clsx(\n cls(\"collapsible-panel-caret\"),\n isOpen && cls(\"collapsible-panel-caret-open\")\n )}\n />\n </IconButton>\n ) : (\n <IconButton>\n <PlusCircle\n weight=\"bold\"\n className={clsx(\n cls(\"collapsible-panel-caret\"),\n isOpen && cls(\"collapsible-panel-caret-open\")\n )}\n />\n </IconButton>\n )\n }\n ></Collapsible.Trigger>\n </div>\n </div>\n {isOpen && afterTitle && (\n <div className={cls(\"collapsible-panel-header-after\")}>\n {afterTitle}\n </div>\n )}\n </div>\n <Collapsible.Panel\n className={cls(\"collapsible-panel-content\")}\n style={\n (typeof contentPadding != \"undefined\"\n ? {\n \"--ds-content-padding\":\n contentPadding === false || contentPadding === 0\n ? \"0\"\n : typeof contentPadding == \"number\"\n ? `${contentPadding}px`\n : contentPadding,\n }\n : {}) as React.CSSProperties\n }\n keepMounted={keepMounted}\n >\n <Transition\n show={isBodyOpen}\n className={clsx(cls(\"collapsible-panel-body\"), bodyClassName)}\n keepMounted\n >\n <div>{children}</div>\n </Transition>\n </Collapsible.Panel>\n </Collapsible.Root>\n );\n};\n"],"names":["VerticalCollapsiblePanel","children","title","defaultOpen","controlledOpen","onOpenChange","className","headerClassName","headerInnerClassName","bodyClassName","contentPadding","afterTitle","actions","useTitleAsTrigger","keepMounted","cls","useCls","isOpen","setIsOpen","useControlledState","isBodyOpen","setIsBodyOpen","useState","ref","useRef","runOnceAnimationsFinish","useAnimationsFinished","useEffect","jsxs","Collapsible","clsx","jsx","open","Truncate","IconButton","MinusCircle","PlusCircle","Transition"],"mappings":";;;;;;;;;;;;;AA8EO,MAAMA,IAET,CAAC;AAAA,EACH,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,MAAMC;AAAA,EACN,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,sBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,YAAAC;AAAA,EACA,SAAAC;AAAA,EACA,mBAAAC,IAAoB;AAAA,EACpB,aAAAC,IAAc;AAChB,MAAM;AACJ,QAAMC,IAAMC,EAAO,GAEb,CAACC,GAAQC,CAAS,IAAIC;AAAA,IAC1Bf;AAAA,IACAC;AAAA,IACAF;AAAA,EACF,GACM,CAACiB,GAAYC,CAAa,IAAIC,EAASL,CAAM,GAC7CM,IAAMC,EAAuB,IAAI,GACjCC,IAA0BC,EAAsBH,GAAK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
|
-
|
|
8
|
-
|
|
9
|
-
)
|
|
1
|
+
import { useDS as c } from "../DSRoot/context.js";
|
|
2
|
+
import { getTokensByTheme as C } from "../../tokens/utils.js";
|
|
3
|
+
import { chartColorTokens as h } from "../../tokens/charts/palettes/cloudscape.js";
|
|
4
|
+
import { CATEGORICAL_PALETTE_NAMES as m, getCategoricalChartColors as L, SEQUENTIAL_PALETTE_NAMES as A, getSequentialChartColors as p } from "../../tokens/charts/palettes/index.js";
|
|
5
|
+
const S = (r = {
|
|
6
|
+
palette: "cloudscape",
|
|
7
|
+
theme: void 0
|
|
8
|
+
}) => {
|
|
9
|
+
const { theme: a } = c(), o = r.theme || a, t = C(h, o), s = t.colorChartsLineAxis, l = t.colorChartsLineGrid, i = t.colorChartsLabelAxis, e = r.palette, n = m.includes(
|
|
10
|
+
e
|
|
11
|
+
) ? L(e, o) : A.includes(e) ? p(e, o) : [];
|
|
10
12
|
return {
|
|
11
|
-
axisLineColor:
|
|
12
|
-
splitLineColor:
|
|
13
|
-
axisLabelColor:
|
|
14
|
-
|
|
13
|
+
axisLineColor: s,
|
|
14
|
+
splitLineColor: l,
|
|
15
|
+
axisLabelColor: i,
|
|
16
|
+
chartColors: n,
|
|
15
17
|
echartsAxisConfig: {
|
|
16
|
-
axisLine: { lineStyle: { color:
|
|
17
|
-
splitLine: { lineStyle: { color:
|
|
18
|
+
axisLine: { lineStyle: { color: s } },
|
|
19
|
+
splitLine: { lineStyle: { color: l } },
|
|
18
20
|
axisLabel: {
|
|
19
|
-
color:
|
|
21
|
+
color: i,
|
|
20
22
|
fontFamily: "InterVariable, Inter, Helvetica, Arial, sans-serif"
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
};
|
|
24
26
|
};
|
|
25
27
|
export {
|
|
26
|
-
|
|
28
|
+
S as useCharts
|
|
27
29
|
};
|
|
28
30
|
//# sourceMappingURL=useCharts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCharts.js","sources":["../../../src/components/hooks/useCharts.ts"],"sourcesContent":["import { useDS } from \"../DSRoot/context\";\nimport { getColorsByTheme, getTokensByTheme } from \"../../tokens/utils\";\nimport {\n chartColorTokens,\n categoricalChartColorTokens,\n} from \"../../tokens/charts\";\n\nexport const useCharts = () => {\n const { theme } = useDS();\n const themedChartColorTokens = getTokensByTheme(chartColorTokens, theme);\n const axisLineColor = themedChartColorTokens[\"colorChartsLineAxis\"];\n const splitLineColor = themedChartColorTokens[\"colorChartsLineGrid\"];\n const axisLabelColor = themedChartColorTokens[\"colorChartsLabelAxis\"];\n const
|
|
1
|
+
{"version":3,"file":"useCharts.js","sources":["../../../src/components/hooks/useCharts.ts"],"sourcesContent":["import { useDS } from \"../DSRoot/context\";\nimport { getColorsByTheme, getTokensByTheme } from \"../../tokens/utils\";\nimport {\n chartColorTokens,\n categoricalChartColorTokens,\n} from \"../../tokens/charts/palettes/cloudscape\";\n\nimport {\n SequentialPaletteName,\n CategoricalPaletteName,\n CATEGORICAL_PALETTE_NAMES,\n getCategoricalChartColors,\n getSequentialChartColors,\n SEQUENTIAL_PALETTE_NAMES,\n Theme,\n} from \"../../tokens\";\n\nexport interface UseChartsOptions {\n /**\n * The palette to use for the charts.\n * @default \"cloudscape\"\n */\n palette?: SequentialPaletteName | CategoricalPaletteName;\n /**\n * The theme to use for the charts.\n * @default \"light\"\n */\n theme?: Theme;\n}\n\n/**\n * Get chart colors and axis configuration based on the current theme.\n * @param options\n * @returns\n */\nexport const useCharts = (\n options: UseChartsOptions = {\n palette: \"cloudscape\",\n theme: undefined,\n }\n) => {\n const { theme: themeContext } = useDS();\n const theme = options.theme || themeContext;\n const themedChartColorTokens = getTokensByTheme(chartColorTokens, theme);\n const axisLineColor = themedChartColorTokens[\"colorChartsLineAxis\"];\n const splitLineColor = themedChartColorTokens[\"colorChartsLineGrid\"];\n const axisLabelColor = themedChartColorTokens[\"colorChartsLabelAxis\"];\n\n const palette = options.palette;\n\n const chartColors = CATEGORICAL_PALETTE_NAMES.includes(\n palette as CategoricalPaletteName\n )\n ? getCategoricalChartColors(palette as CategoricalPaletteName, theme)\n : SEQUENTIAL_PALETTE_NAMES.includes(palette as SequentialPaletteName)\n ? getSequentialChartColors(palette as SequentialPaletteName, theme)\n : [];\n const echartsAxisConfig = {\n axisLine: { lineStyle: { color: axisLineColor } },\n splitLine: { lineStyle: { color: splitLineColor } },\n axisLabel: {\n color: axisLabelColor,\n fontFamily: \"InterVariable, Inter, Helvetica, Arial, sans-serif\",\n },\n };\n\n return {\n axisLineColor,\n splitLineColor,\n axisLabelColor,\n chartColors,\n echartsAxisConfig,\n };\n};\n"],"names":["useCharts","options","themeContext","useDS","theme","themedChartColorTokens","getTokensByTheme","chartColorTokens","axisLineColor","splitLineColor","axisLabelColor","palette","chartColors","CATEGORICAL_PALETTE_NAMES","getCategoricalChartColors","SEQUENTIAL_PALETTE_NAMES","getSequentialChartColors"],"mappings":";;;;AAmCa,MAAAA,IAAY,CACvBC,IAA4B;AAAA,EAC1B,SAAS;AAAA,EACT,OAAO;AACT,MACG;AACH,QAAM,EAAE,OAAOC,EAAa,IAAIC,EAAM,GAChCC,IAAQH,EAAQ,SAASC,GACzBG,IAAyBC,EAAiBC,GAAkBH,CAAK,GACjEI,IAAgBH,EAAuB,qBACvCI,IAAiBJ,EAAuB,qBACxCK,IAAiBL,EAAuB,sBAExCM,IAAUV,EAAQ,SAElBW,IAAcC,EAA0B;AAAA,IAC5CF;AAAA,EAEE,IAAAG,EAA0BH,GAAmCP,CAAK,IAClEW,EAAyB,SAASJ,CAAgC,IAClEK,EAAyBL,GAAkCP,CAAK,IAChE,CAAC;AAUE,SAAA;AAAA,IACL,eAAAI;AAAA,IACA,gBAAAC;AAAA,IACA,gBAAAC;AAAA,IACA,aAAAE;AAAA,IACA,mBAdwB;AAAA,MACxB,UAAU,EAAE,WAAW,EAAE,OAAOJ,IAAgB;AAAA,MAChD,WAAW,EAAE,WAAW,EAAE,OAAOC,IAAiB;AAAA,MAClD,WAAW;AAAA,QACT,OAAOC;AAAA,QACP,YAAY;AAAA,MAAA;AAAA,IAEhB;AAAA,EAQA;AACF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.js","sources":["../../../src/components/utils/colors.ts"],"sourcesContent":["export const isValidHexColor = (\n hex: string,\n acceptWithoutPrefix: boolean = false\n) => {\n // Accepts both with and without # prefix\n const hexRegex = acceptWithoutPrefix\n ? /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/\n : /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;\n return hexRegex.test(hex);\n};\n"],"names":["isValidHexColor","hex","acceptWithoutPrefix"],"mappings":"AAAO,MAAMA,IAAkB,CAC7BC,GACAC,IAA+B,QAGdA,IACb,wCACA,sCACY,KAAKD,CAAG;"}
|