@bioturing/components 0.18.0 → 0.19.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.
@@ -1,36 +1,46 @@
1
1
  "use client";
2
- import { jsxs as u, jsx as s } from "react/jsx-runtime";
3
- import m from "antd/es/button";
2
+ import { jsx as s } from "react/jsx-runtime";
3
+ import a from "antd/es/button";
4
4
  import { forwardRef as l } from "react";
5
5
  import './style.css';/* empty css */
6
- import { useCls as a } from "../utils/antdUtils.js";
7
- const f = ({ negativeMargin: p = !0, type: t, size: n, variant: r, ...o }, e) => {
8
- const c = p && (r === "text" || r === "link" || t == "text" || t === "link"), i = a();
9
- return c ? /* @__PURE__ */ u(
6
+ import { useCls as u } from "../utils/antdUtils.js";
7
+ const w = ({ negativeMargin: c = !0, type: t, size: o, variant: n, icon: r, ...m }, p) => {
8
+ const i = c && (n === "text" || n === "link" || t == "text" || t === "link"), e = u();
9
+ return i ? /* @__PURE__ */ s(
10
10
  "span",
11
11
  {
12
- className: i(
12
+ className: e(
13
13
  "btn-wrapper",
14
14
  "btn-negative-margin-wrapper",
15
- "btn-wrapper-" + n
15
+ "btn-wrapper-" + o
16
16
  ),
17
- children: [
18
- /* @__PURE__ */ s(
19
- m,
20
- {
21
- ref: e,
22
- type: t,
23
- size: n,
24
- variant: r,
25
- ...o
26
- }
27
- ),
28
- " "
29
- ]
17
+ children: /* @__PURE__ */ s(
18
+ a,
19
+ {
20
+ ref: p,
21
+ type: t,
22
+ size: o,
23
+ variant: n,
24
+ icon: r,
25
+ className: r ? e("btn-with-icon") : "",
26
+ ...m
27
+ }
28
+ )
30
29
  }
31
- ) : /* @__PURE__ */ s(m, { ref: e, type: t, size: n, variant: r, ...o });
32
- }, B = l(f);
30
+ ) : /* @__PURE__ */ s(
31
+ a,
32
+ {
33
+ ref: p,
34
+ type: t,
35
+ size: o,
36
+ variant: n,
37
+ icon: r,
38
+ className: r ? e("btn-with-icon") : "",
39
+ ...m
40
+ }
41
+ );
42
+ }, d = l(w);
33
43
  export {
34
- B as Button
44
+ d as Button
35
45
  };
36
46
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/Button/component.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n default as AntdButton,\n type ButtonProps as AntdButtonProps,\n} from \"antd/es/button\";\nimport { forwardRef } from \"react\";\n\n// Import component-specific styles\nimport { useCls } from \"../utils\";\nimport \"./style.css\";\n\nexport interface ButtonProps extends AntdButtonProps {\n /**\n * If true, negative margin will be applied to the text and link buttons to make it align with content\n * @default true\n */\n negativeMargin?: boolean;\n}\n\nconst ButtonInner = (\n { negativeMargin = true, type, size, variant, ...rest }: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n) => {\n const useNegativeMargin =\n negativeMargin &&\n (variant === \"text\" ||\n variant === \"link\" ||\n type == \"text\" ||\n type === \"link\");\n const cls = useCls();\n return useNegativeMargin ? (\n <span\n className={cls(\n \"btn-wrapper\",\n \"btn-negative-margin-wrapper\",\n \"btn-wrapper-\" + size\n )}\n >\n <AntdButton\n ref={ref}\n type={type}\n size={size}\n variant={variant}\n {...rest}\n />{\" \"}\n </span>\n ) : (\n <AntdButton ref={ref} type={type} size={size} variant={variant} {...rest} />\n );\n};\n\nexport const Button = forwardRef(ButtonInner) as (\n props: ButtonProps & {\n ref?: React.ForwardedRef<HTMLButtonElement | HTMLAnchorElement>;\n }\n) => ReturnType<typeof ButtonInner>;\n"],"names":["ButtonInner","negativeMargin","type","size","variant","rest","ref","useNegativeMargin","cls","useCls","jsxs","jsx","AntdButton","Button","forwardRef"],"mappings":";;;;;;AAoBA,MAAMA,IAAc,CAClB,EAAE,gBAAAC,IAAiB,IAAM,MAAAC,GAAM,MAAAC,GAAM,SAAAC,GAAS,GAAGC,EAAK,GACtDC,MACG;AACG,QAAAC,IACJN,MACCG,MAAY,UACXA,MAAY,UACZF,KAAQ,UACRA,MAAS,SACPM,IAAMC,EAAO;AACnB,SAAOF,IACL,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWF;AAAA,QACT;AAAA,QACA;AAAA,QACA,iBAAiBL;AAAA,MACnB;AAAA,MAEA,UAAA;AAAA,QAAA,gBAAAQ;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,KAAAN;AAAA,YACA,MAAAJ;AAAA,YACA,MAAAC;AAAA,YACA,SAAAC;AAAA,YACC,GAAGC;AAAA,UAAA;AAAA,QACN;AAAA,QAAG;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,sBAGJO,GAAW,EAAA,KAAAN,GAAU,MAAAJ,GAAY,MAAAC,GAAY,SAAAC,GAAmB,GAAGC,GAAM;AAE9E,GAEaQ,IAASC,EAAWd,CAAW;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/Button/component.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n default as AntdButton,\n type ButtonProps as AntdButtonProps,\n} from \"antd/es/button\";\nimport { forwardRef } from \"react\";\n\n// Import component-specific styles\nimport { useCls } from \"../utils\";\nimport \"./style.css\";\n\nexport interface ButtonProps extends AntdButtonProps {\n /**\n * If true, negative margin will be applied to the text and link buttons to make it align with content\n * @default true\n */\n negativeMargin?: boolean;\n}\n\nconst ButtonInner = (\n { negativeMargin = true, type, size, variant, icon, ...rest }: ButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>\n) => {\n const useNegativeMargin =\n negativeMargin &&\n (variant === \"text\" ||\n variant === \"link\" ||\n type == \"text\" ||\n type === \"link\");\n const cls = useCls();\n return useNegativeMargin ? (\n <span\n className={cls(\n \"btn-wrapper\",\n \"btn-negative-margin-wrapper\",\n \"btn-wrapper-\" + size\n )}\n >\n <AntdButton\n ref={ref}\n type={type}\n size={size}\n variant={variant}\n icon={icon}\n className={icon ? cls(\"btn-with-icon\") : \"\"}\n {...rest}\n />\n </span>\n ) : (\n <AntdButton\n ref={ref}\n type={type}\n size={size}\n variant={variant}\n icon={icon}\n className={icon ? cls(\"btn-with-icon\") : \"\"}\n {...rest}\n />\n );\n};\n\nexport const Button = forwardRef(ButtonInner) as (\n props: ButtonProps & {\n ref?: React.ForwardedRef<HTMLButtonElement | HTMLAnchorElement>;\n }\n) => ReturnType<typeof ButtonInner>;\n"],"names":["ButtonInner","negativeMargin","type","size","variant","icon","rest","ref","useNegativeMargin","cls","useCls","jsx","AntdButton","Button","forwardRef"],"mappings":";;;;;;AAoBA,MAAMA,IAAc,CAClB,EAAE,gBAAAC,IAAiB,IAAM,MAAAC,GAAM,MAAAC,GAAM,SAAAC,GAAS,MAAAC,GAAM,GAAGC,EAAK,GAC5DC,MACG;AACG,QAAAC,IACJP,MACCG,MAAY,UACXA,MAAY,UACZF,KAAQ,UACRA,MAAS,SACPO,IAAMC,EAAO;AACnB,SAAOF,IACL,gBAAAG;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWF;AAAA,QACT;AAAA,QACA;AAAA,QACA,iBAAiBN;AAAA,MACnB;AAAA,MAEA,UAAA,gBAAAQ;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,KAAAL;AAAA,UACA,MAAAL;AAAA,UACA,MAAAC;AAAA,UACA,SAAAC;AAAA,UACA,MAAAC;AAAA,UACA,WAAWA,IAAOI,EAAI,eAAe,IAAI;AAAA,UACxC,GAAGH;AAAA,QAAA;AAAA,MAAA;AAAA,IACN;AAAA,EAAA,IAGF,gBAAAK;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAL;AAAA,MACA,MAAAL;AAAA,MACA,MAAAC;AAAA,MACA,SAAAC;AAAA,MACA,MAAAC;AAAA,MACA,WAAWA,IAAOI,EAAI,eAAe,IAAI;AAAA,MACxC,GAAGH;AAAA,IAAA;AAAA,EACN;AAEJ,GAEaO,IAASC,EAAWd,CAAW;"}
@@ -1 +1 @@
1
- @layer components{span.ds-btn-icon{display:flex;align-items:center}.ds-btn-negative-margin-wrapper{display:inline-flex;flex-shrink:0}.ds-btn-negative-margin-wrapper,.ds-btn-negative-margin-wrapper.ds-btn-wrapper-lg{margin-inline:-1rem}.ds-btn-negative-margin-wrapper.ds-btn-wrapper-sm{margin-inline:-.5rem}.ds-btn-loading .ds-btn-loading-icon{position:absolute}.ds-btn-loading>span:not(.ds-btn-loading-icon){opacity:0}}
1
+ @layer components{span.ds-btn-icon{display:flex;align-items:center}.ds-btn-negative-margin-wrapper{display:inline-flex;flex-shrink:0}.ds-btn-negative-margin-wrapper,.ds-btn-negative-margin-wrapper.ds-btn-wrapper-lg{margin-inline:-1rem}.ds-btn-negative-margin-wrapper.ds-btn-wrapper-sm{margin-inline:-.5rem}.ds-btn-loading:not(.ds-btn-with-icon) .ds-btn-loading-icon{position:absolute}.ds-btn-loading:not(.ds-btn-with-icon)>span:not(.ds-btn-loading-icon){opacity:0}}
@@ -1,36 +1,37 @@
1
1
  "use client";
2
- import { jsxs as c, jsx as a, Fragment as l } from "react/jsx-runtime";
3
- import { forwardRef as d } from "react";
4
- import { useRender as p } from "@base-ui-components/react/use-render";
5
- import { useCls as f } from "../utils/antdUtils.js";
6
- import { clsx as v } from "../utils/cn.js";
7
- const x = ({
8
- icon: r,
9
- active: s = !1,
10
- render: n,
11
- onClick: N,
12
- className: m,
13
- children: o,
14
- ...t
15
- }, i) => {
16
- const e = f();
17
- return p({
18
- render: n ?? /* @__PURE__ */ a("button", { className: v(e("nav-item"), m) }),
19
- ref: i,
2
+ import { jsxs as p, jsx as a, Fragment as c } from "react/jsx-runtime";
3
+ import f, { forwardRef as u, useMemo as x, isValidElement as N } from "react";
4
+ import { useRender as v } from "@base-ui-components/react/use-render";
5
+ import { useCls as h } from "../utils/antdUtils.js";
6
+ import { clsx as I } from "../utils/cn.js";
7
+ const R = (e) => N(e), j = ({
8
+ icon: e,
9
+ active: r = !1,
10
+ render: m,
11
+ onClick: w,
12
+ className: o,
13
+ children: l,
14
+ changeIconWeightOnActive: s = !0,
15
+ ...n
16
+ }, d) => {
17
+ const t = h(), i = x(() => !s || !r || !R(e) ? e : f.cloneElement(e, { weight: "fill" }), [e, s, r]);
18
+ return v({
19
+ render: m ?? /* @__PURE__ */ a("button", { className: I(t("nav-item"), o) }),
20
+ ref: d,
20
21
  props: {
21
- "data-active": s || void 0,
22
- "aria-expanded": t["aria-expanded"],
22
+ "data-active": r || void 0,
23
+ "aria-expanded": n["aria-expanded"],
23
24
  className: void 0,
24
- ...t,
25
- children: /* @__PURE__ */ c(l, { children: [
26
- /* @__PURE__ */ a("span", { className: e("nav-item-icon"), children: r }),
27
- /* @__PURE__ */ a("span", { className: e("nav-item-content"), children: o })
25
+ ...n,
26
+ children: /* @__PURE__ */ p(c, { children: [
27
+ /* @__PURE__ */ a("span", { className: t("nav-item-icon"), children: i }),
28
+ /* @__PURE__ */ a("span", { className: t("nav-item-content"), children: l })
28
29
  ] })
29
30
  },
30
- state: { active: s, icon: r }
31
+ state: { active: r, icon: e }
31
32
  });
32
- }, R = d(x);
33
+ }, F = u(j);
33
34
  export {
34
- R as NavItem
35
+ F as NavItem
35
36
  };
36
37
  //# sourceMappingURL=item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.js","sources":["../../../src/components/Nav/item.tsx"],"sourcesContent":["\"use client\";\nimport React, { useState, type MouseEvent, forwardRef } from \"react\";\nimport { clsx, useCls } from \"../utils\";\nimport { Transition } from \"../Transition\";\nimport { useRender } from \"@base-ui-components/react/use-render\";\n\nexport interface NavItemProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n icon?: React.ReactNode;\n active?: boolean;\n render?: useRender.RenderProp<{\n active: boolean;\n icon?: React.ReactNode;\n }>;\n size?: \"small\" | \"medium\" | \"large\";\n}\n\nconst NavItemImpl = <T extends HTMLElement>(\n {\n icon,\n active = false,\n render,\n onClick,\n className,\n children,\n ...rest\n }: NavItemProps,\n ref: React.Ref<T>\n) => {\n const cls = useCls();\n\n return useRender({\n render: render ?? <button className={clsx(cls(\"nav-item\"), className)} />,\n ref,\n props: {\n \"data-active\": active || undefined,\n \"aria-expanded\": rest[\"aria-expanded\"],\n className: undefined,\n ...rest,\n children: (\n <>\n <span className={cls(\"nav-item-icon\")}>{icon}</span>\n {/* <Transition\n starting=\"opacity-0 max-w-[0]\"\n ending=\"opacity-0 max-w-[0]\"\n className={cls(\"nav-item-transition\")}\n > */}\n <span className={cls(\"nav-item-content\")}>{children}</span>\n {/* </Transition> */}\n </>\n ),\n },\n state: { active, icon },\n });\n};\n\nconst NavItem = forwardRef(NavItemImpl) as <T extends HTMLElement>(\n props: NavItemProps & { ref?: React.Ref<T> }\n) => ReturnType<typeof NavItemImpl>;\n\nexport { NavItem };\n"],"names":["NavItemImpl","icon","active","render","onClick","className","children","rest","ref","cls","useCls","useRender","jsx","clsx","jsxs","Fragment","NavItem","forwardRef"],"mappings":";;;;;;AAiBA,MAAMA,IAAc,CAClB;AAAA,EACE,MAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IAAMC,EAAO;AAEnB,SAAOC,EAAU;AAAA,IACf,QAAQR,KAAU,gBAAAS,EAAC,UAAO,EAAA,WAAWC,EAAKJ,EAAI,UAAU,GAAGJ,CAAS,EAAG,CAAA;AAAA,IACvE,KAAAG;AAAA,IACA,OAAO;AAAA,MACL,eAAeN,KAAU;AAAA,MACzB,iBAAiBK,EAAK,eAAe;AAAA,MACrC,WAAW;AAAA,MACX,GAAGA;AAAA,MACH,UAEI,gBAAAO,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAH,EAAC,QAAK,EAAA,WAAWH,EAAI,eAAe,GAAI,UAAKR,GAAA;AAAA,0BAM5C,QAAK,EAAA,WAAWQ,EAAI,kBAAkB,GAAI,UAAAH,EAAS,CAAA;AAAA,MAAA,EAEtD,CAAA;AAAA,IAEJ;AAAA,IACA,OAAO,EAAE,QAAAJ,GAAQ,MAAAD,EAAK;AAAA,EAAA,CACvB;AACH,GAEMe,IAAUC,EAAWjB,CAAW;"}
1
+ {"version":3,"file":"item.js","sources":["../../../src/components/Nav/item.tsx"],"sourcesContent":["\"use client\";\nimport React, {\n useState,\n type MouseEvent,\n forwardRef,\n isValidElement,\n useMemo,\n} from \"react\";\nimport { clsx, useCls } from \"../utils\";\nimport { Transition } from \"../Transition\";\nimport { useRender } from \"@base-ui-components/react/use-render\";\n\nexport interface NavItemProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * The icon to display in the nav item\n */\n icon?: React.ReactNode;\n /**\n * Whether the nav item is active\n */\n active?: boolean;\n /**\n * The render prop to render the nav item\n */\n render?: useRender.RenderProp<{\n active: boolean;\n icon?: React.ReactNode;\n }>;\n /**\n * The size of the nav item\n * @default \"medium\"\n */\n size?: \"small\" | \"medium\" | \"large\";\n /**\n * Whether to change the icon weight on active state\n * @default true\n */\n changeIconWeightOnActive?: boolean;\n}\n\n// Define a type for elements that can have a weight prop\ntype ElementWithWeight = React.ReactElement<{ weight?: string }>;\n\n// Type guard to check if an element can accept a weight prop\nconst canHaveWeightProp = (el: React.ReactNode): el is ElementWithWeight => {\n return isValidElement(el);\n};\n\nconst NavItemImpl = <T extends HTMLElement>(\n {\n icon,\n active = false,\n render,\n onClick,\n className,\n children,\n changeIconWeightOnActive = true,\n ...rest\n }: NavItemProps,\n ref: React.Ref<T>\n) => {\n const cls = useCls();\n\n // Apply weight prop only if the element can accept it\n const renderedIcon = useMemo(() => {\n if (!changeIconWeightOnActive || !active || !canHaveWeightProp(icon)) {\n return icon;\n }\n return React.cloneElement(icon, { weight: \"fill\" });\n }, [icon, changeIconWeightOnActive, active]);\n\n return useRender({\n render: render ?? <button className={clsx(cls(\"nav-item\"), className)} />,\n ref,\n props: {\n \"data-active\": active || undefined,\n \"aria-expanded\": rest[\"aria-expanded\"],\n className: undefined,\n ...rest,\n children: (\n <>\n <span className={cls(\"nav-item-icon\")}>{renderedIcon}</span>\n {/* <Transition\n starting=\"opacity-0 max-w-[0]\"\n ending=\"opacity-0 max-w-[0]\"\n className={cls(\"nav-item-transition\")}\n > */}\n <span className={cls(\"nav-item-content\")}>{children}</span>\n {/* </Transition> */}\n </>\n ),\n },\n state: { active, icon },\n });\n};\n\nconst NavItem = forwardRef(NavItemImpl) as <T extends HTMLElement>(\n props: NavItemProps & { ref?: React.Ref<T> }\n) => ReturnType<typeof NavItemImpl>;\n\nexport { NavItem };\n"],"names":["canHaveWeightProp","el","isValidElement","NavItemImpl","icon","active","render","onClick","className","children","changeIconWeightOnActive","rest","ref","cls","useCls","renderedIcon","useMemo","React","useRender","jsx","clsx","jsxs","Fragment","NavItem","forwardRef"],"mappings":";;;;;;AA6CA,MAAMA,IAAoB,CAACC,MAClBC,EAAeD,CAAE,GAGpBE,IAAc,CAClB;AAAA,EACE,MAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,0BAAAC,IAA2B;AAAA,EAC3B,GAAGC;AACL,GACAC,MACG;AACH,QAAMC,IAAMC,EAAO,GAGbC,IAAeC,EAAQ,MACvB,CAACN,KAA4B,CAACL,KAAU,CAACL,EAAkBI,CAAI,IAC1DA,IAEFa,EAAM,aAAab,GAAM,EAAE,QAAQ,QAAQ,GACjD,CAACA,GAAMM,GAA0BL,CAAM,CAAC;AAE3C,SAAOa,EAAU;AAAA,IACf,QAAQZ,KAAU,gBAAAa,EAAC,UAAO,EAAA,WAAWC,EAAKP,EAAI,UAAU,GAAGL,CAAS,EAAG,CAAA;AAAA,IACvE,KAAAI;AAAA,IACA,OAAO;AAAA,MACL,eAAeP,KAAU;AAAA,MACzB,iBAAiBM,EAAK,eAAe;AAAA,MACrC,WAAW;AAAA,MACX,GAAGA;AAAA,MACH,UAEI,gBAAAU,EAAAC,GAAA,EAAA,UAAA;AAAA,QAAA,gBAAAH,EAAC,QAAK,EAAA,WAAWN,EAAI,eAAe,GAAI,UAAaE,GAAA;AAAA,0BAMpD,QAAK,EAAA,WAAWF,EAAI,kBAAkB,GAAI,UAAAJ,EAAS,CAAA;AAAA,MAAA,EAEtD,CAAA;AAAA,IAEJ;AAAA,IACA,OAAO,EAAE,QAAAJ,GAAQ,MAAAD,EAAK;AAAA,EAAA,CACvB;AACH,GAEMmB,IAAUC,EAAWrB,CAAW;"}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx as r } from "react/jsx-runtime";
2
+ import { jsx as c } from "react/jsx-runtime";
3
3
  import b, { forwardRef as g } from "react";
4
4
  import { useRender as R } from "@base-ui-components/react/use-render";
5
5
  import { mergeProps as S } from "@base-ui-components/react/merge-props";
@@ -8,54 +8,54 @@ import { useCls as v } from "../utils/antdUtils.js";
8
8
  import { cn as w } from "../utils/cn.js";
9
9
  const E = g(
10
10
  ({
11
- flex: e,
12
- grow: l = !1,
13
- shrink: c = !1,
11
+ flex: s,
12
+ grow: m = !1,
13
+ shrink: f = !1,
14
14
  children: t,
15
- style: f,
16
- stack: m = !1,
15
+ style: i,
16
+ stack: n = !1,
17
17
  // stack props
18
- hug: i = !1,
19
- align: n = "flex-start",
20
- justify: p = "flex-start",
21
- vertical: d = !1,
22
- gap: k = 0,
23
- wrap: u = !1,
24
- className: x,
25
- ...h
26
- }, y) => {
27
- const s = v(), C = {
28
- hug: i,
29
- align: n,
30
- justify: p,
31
- vertical: d,
32
- gap: k,
33
- wrap: u
18
+ hug: p = !1,
19
+ align: d = "flex-start",
20
+ justify: k = "flex-start",
21
+ vertical: u = !1,
22
+ gap: x = 0,
23
+ wrap: h = !1,
24
+ className: y,
25
+ ...o
26
+ }, a) => {
27
+ const e = v(), C = {
28
+ hug: p,
29
+ align: d,
30
+ justify: k,
31
+ vertical: u,
32
+ gap: x,
33
+ wrap: h
34
34
  };
35
- let o = "";
36
- typeof e == "boolean" && (o = s(e ? "stack-child-flex-1" : "stack-child-flex-0"));
37
- const a = w(
38
- s("stack-child"),
39
- l && s("stack-child-grow"),
40
- c && s("stack-child-shrink"),
41
- o,
42
- x
35
+ let l = "";
36
+ typeof s == "boolean" && (l = e(s ? "stack-child-flex-1" : "stack-child-flex-0"));
37
+ const r = w(
38
+ e("stack-child"),
39
+ m && e("stack-child-grow"),
40
+ f && e("stack-child-shrink"),
41
+ l,
42
+ y
43
43
  ), N = R({
44
- render: () => b.isValidElement(t) ? t : /* @__PURE__ */ r("div", { children: t }),
45
- ref: y,
44
+ render: () => b.isValidElement(t) ? t : /* @__PURE__ */ c("div", { children: t }),
45
+ ref: a,
46
46
  props: S(
47
47
  {
48
- className: a,
48
+ className: r,
49
49
  style: {
50
- ...f,
51
- flex: typeof e == "string" || typeof e == "number" ? e : void 0
50
+ ...i,
51
+ flex: typeof s == "string" || typeof s == "number" ? s : void 0
52
52
  },
53
- ...h
53
+ ...o
54
54
  },
55
55
  {}
56
56
  )
57
57
  });
58
- return m ? /* @__PURE__ */ r(V, { ...C, className: a, children: t }) : N;
58
+ return n ? /* @__PURE__ */ c(V, { ...C, ref: a, className: r, ...o, children: t }) : N;
59
59
  }
60
60
  );
61
61
  E.displayName = "StackChild";
@@ -1 +1 @@
1
- {"version":3,"file":"StackChild.js","sources":["../../../src/components/Stack/StackChild.tsx"],"sourcesContent":["\"use client\";\nimport React, { forwardRef } from \"react\";\nimport { cn, useCls } from \"../utils\";\nimport { useRender } from \"@base-ui-components/react/use-render\";\nimport { mergeProps } from \"@base-ui-components/react/merge-props\";\nimport { Stack, StackProps } from \"./Stack\";\n\nexport interface StackChildProps extends StackProps {\n /**\n * CSS flex property value (e.g. \"1\", \"1 0 auto\", \"0 1 auto\")\n * When boolean: true = 1, false = 0\n * @default undefined\n */\n flex?: string | number | boolean;\n\n /**\n * Whether this child should grow to fill available space\n * @default false\n */\n grow?: boolean;\n\n /**\n * Whether this child should shrink if necessary\n * @default false\n */\n shrink?: boolean;\n\n /**\n * Children of the stack child\n */\n children?: React.ReactNode;\n /**\n * Whether to render the child with a stack wrapper\n * @default false\n */\n stack?: boolean;\n}\n\nexport const StackChild = forwardRef<HTMLDivElement, StackChildProps>(\n (\n {\n flex,\n grow = false,\n shrink = false,\n children,\n style,\n stack = false,\n // stack props\n hug = false,\n align = \"flex-start\",\n justify = \"flex-start\",\n vertical = false,\n gap = 0,\n wrap = false,\n className,\n ...rest\n },\n ref\n ) => {\n const cls = useCls();\n const stackProps = {\n hug,\n align,\n justify,\n vertical,\n gap,\n wrap,\n };\n\n // Determine flex class based on flex prop type\n let flexClass = \"\";\n if (typeof flex === \"boolean\") {\n flexClass = flex ? cls(\"stack-child-flex-1\") : cls(\"stack-child-flex-0\");\n }\n\n // Calculate the combined className\n const combinedClassName = cn(\n cls(\"stack-child\"),\n grow && cls(\"stack-child-grow\"),\n shrink && cls(\"stack-child-shrink\"),\n flexClass,\n className\n );\n\n // Calculate the flex style value\n const flexValue =\n typeof flex === \"string\" || typeof flex === \"number\" ? flex : undefined;\n\n // Use useRender to apply props directly to the child without creating a wrapper\n const renderedElement = useRender({\n render: () =>\n React.isValidElement(children) ? children : <div>{children}</div>,\n ref,\n props: mergeProps<\"div\">(\n {\n className: combinedClassName,\n style: {\n ...style,\n flex: flexValue,\n },\n ...rest,\n },\n {}\n ),\n });\n\n return stack ? (\n <Stack {...stackProps} className={combinedClassName}>\n {children}\n </Stack>\n ) : (\n renderedElement\n );\n }\n);\n\nStackChild.displayName = \"StackChild\";\n"],"names":["StackChild","forwardRef","flex","grow","shrink","children","style","stack","hug","align","justify","vertical","gap","wrap","className","rest","ref","cls","useCls","stackProps","flexClass","combinedClassName","cn","renderedElement","useRender","React","jsx","mergeProps","Stack"],"mappings":";;;;;;;;AAsCO,MAAMA,IAAaC;AAAA,EACxB,CACE;AAAA,IACE,MAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,QAAAC,IAAS;AAAA,IACT,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA;AAAA,IAER,KAAAC,IAAM;AAAA,IACN,OAAAC,IAAQ;AAAA,IACR,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,KAAAC,IAAM;AAAA,IACN,MAAAC,IAAO;AAAA,IACP,WAAAC;AAAA,IACA,GAAGC;AAAA,KAELC,MACG;AACH,UAAMC,IAAMC,EAAO,GACbC,IAAa;AAAA,MACjB,KAAAX;AAAA,MACA,OAAAC;AAAA,MACA,SAAAC;AAAA,MACA,UAAAC;AAAA,MACA,KAAAC;AAAA,MACA,MAAAC;AAAA,IACF;AAGA,QAAIO,IAAY;AACZ,IAAA,OAAOlB,KAAS,cAClBkB,IAAmBH,EAAPf,IAAW,uBAA4B,oBAAR;AAI7C,UAAMmB,IAAoBC;AAAA,MACxBL,EAAI,aAAa;AAAA,MACjBd,KAAQc,EAAI,kBAAkB;AAAA,MAC9Bb,KAAUa,EAAI,oBAAoB;AAAA,MAClCG;AAAA,MACAN;AAAA,IACF,GAOMS,IAAkBC,EAAU;AAAA,MAChC,QAAQ,MACNC,EAAM,eAAepB,CAAQ,IAAIA,IAAY,gBAAAqB,EAAA,OAAA,EAAK,UAAArB,GAAS;AAAA,MAC7D,KAAAW;AAAA,MACA,OAAOW;AAAA,QACL;AAAA,UACE,WAAWN;AAAA,UACX,OAAO;AAAA,YACL,GAAGf;AAAA,YACH,MAZN,OAAOJ,KAAS,YAAY,OAAOA,KAAS,WAAWA,IAAO;AAAA,UAa1D;AAAA,UACA,GAAGa;AAAA,QACL;AAAA,QACA,CAAA;AAAA,MAAC;AAAA,IACH,CACD;AAEM,WAAAR,sBACJqB,GAAO,EAAA,GAAGT,GAAY,WAAWE,GAC/B,UAAAhB,EACH,CAAA,IAEAkB;AAAA,EAAA;AAGN;AAEAvB,EAAW,cAAc;"}
1
+ {"version":3,"file":"StackChild.js","sources":["../../../src/components/Stack/StackChild.tsx"],"sourcesContent":["\"use client\";\nimport React, { forwardRef } from \"react\";\nimport { cn, useCls } from \"../utils\";\nimport { useRender } from \"@base-ui-components/react/use-render\";\nimport { mergeProps } from \"@base-ui-components/react/merge-props\";\nimport { Stack, StackProps } from \"./Stack\";\n\nexport interface StackChildProps extends StackProps {\n /**\n * CSS flex property value (e.g. \"1\", \"1 0 auto\", \"0 1 auto\")\n * When boolean: true = 1, false = 0\n * @default undefined\n */\n flex?: string | number | boolean;\n\n /**\n * Whether this child should grow to fill available space\n * @default false\n */\n grow?: boolean;\n\n /**\n * Whether this child should shrink if necessary\n * @default false\n */\n shrink?: boolean;\n\n /**\n * Children of the stack child\n */\n children?: React.ReactNode;\n /**\n * Whether to render the child with a stack wrapper\n * @default false\n */\n stack?: boolean;\n}\n\nexport const StackChild = forwardRef<HTMLDivElement, StackChildProps>(\n (\n {\n flex,\n grow = false,\n shrink = false,\n children,\n style,\n stack = false,\n // stack props\n hug = false,\n align = \"flex-start\",\n justify = \"flex-start\",\n vertical = false,\n gap = 0,\n wrap = false,\n className,\n ...rest\n },\n ref\n ) => {\n const cls = useCls();\n const stackProps = {\n hug,\n align,\n justify,\n vertical,\n gap,\n wrap,\n };\n\n // Determine flex class based on flex prop type\n let flexClass = \"\";\n if (typeof flex === \"boolean\") {\n flexClass = flex ? cls(\"stack-child-flex-1\") : cls(\"stack-child-flex-0\");\n }\n\n // Calculate the combined className\n const combinedClassName = cn(\n cls(\"stack-child\"),\n grow && cls(\"stack-child-grow\"),\n shrink && cls(\"stack-child-shrink\"),\n flexClass,\n className\n );\n\n // Calculate the flex style value\n const flexValue =\n typeof flex === \"string\" || typeof flex === \"number\" ? flex : undefined;\n\n // Use useRender to apply props directly to the child without creating a wrapper\n const renderedElement = useRender({\n render: () =>\n React.isValidElement(children) ? children : <div>{children}</div>,\n ref,\n props: mergeProps<\"div\">(\n {\n className: combinedClassName,\n style: {\n ...style,\n flex: flexValue,\n },\n ...rest,\n },\n {}\n ),\n });\n\n return stack ? (\n <Stack {...stackProps} ref={ref} className={combinedClassName} {...rest}>\n {children}\n </Stack>\n ) : (\n renderedElement\n );\n }\n);\n\nStackChild.displayName = \"StackChild\";\n"],"names":["StackChild","forwardRef","flex","grow","shrink","children","style","stack","hug","align","justify","vertical","gap","wrap","className","rest","ref","cls","useCls","stackProps","flexClass","combinedClassName","cn","renderedElement","useRender","React","jsx","mergeProps","Stack"],"mappings":";;;;;;;;AAsCO,MAAMA,IAAaC;AAAA,EACxB,CACE;AAAA,IACE,MAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,QAAAC,IAAS;AAAA,IACT,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC,IAAQ;AAAA;AAAA,IAER,KAAAC,IAAM;AAAA,IACN,OAAAC,IAAQ;AAAA,IACR,SAAAC,IAAU;AAAA,IACV,UAAAC,IAAW;AAAA,IACX,KAAAC,IAAM;AAAA,IACN,MAAAC,IAAO;AAAA,IACP,WAAAC;AAAA,IACA,GAAGC;AAAA,KAELC,MACG;AACH,UAAMC,IAAMC,EAAO,GACbC,IAAa;AAAA,MACjB,KAAAX;AAAA,MACA,OAAAC;AAAA,MACA,SAAAC;AAAA,MACA,UAAAC;AAAA,MACA,KAAAC;AAAA,MACA,MAAAC;AAAA,IACF;AAGA,QAAIO,IAAY;AACZ,IAAA,OAAOlB,KAAS,cAClBkB,IAAmBH,EAAPf,IAAW,uBAA4B,oBAAR;AAI7C,UAAMmB,IAAoBC;AAAA,MACxBL,EAAI,aAAa;AAAA,MACjBd,KAAQc,EAAI,kBAAkB;AAAA,MAC9Bb,KAAUa,EAAI,oBAAoB;AAAA,MAClCG;AAAA,MACAN;AAAA,IACF,GAOMS,IAAkBC,EAAU;AAAA,MAChC,QAAQ,MACNC,EAAM,eAAepB,CAAQ,IAAIA,IAAY,gBAAAqB,EAAA,OAAA,EAAK,UAAArB,GAAS;AAAA,MAC7D,KAAAW;AAAA,MACA,OAAOW;AAAA,QACL;AAAA,UACE,WAAWN;AAAA,UACX,OAAO;AAAA,YACL,GAAGf;AAAA,YACH,MAZN,OAAOJ,KAAS,YAAY,OAAOA,KAAS,WAAWA,IAAO;AAAA,UAa1D;AAAA,UACA,GAAGa;AAAA,QACL;AAAA,QACA,CAAA;AAAA,MAAC;AAAA,IACH,CACD;AAEM,WAAAR,IACJ,gBAAAmB,EAAAE,GAAA,EAAO,GAAGT,GAAY,KAAAH,GAAU,WAAWK,GAAoB,GAAGN,GAChE,UAAAV,EAAA,CACH,IAEAkB;AAAA,EAAA;AAGN;AAEAvB,EAAW,cAAc;"}
@@ -4,11 +4,11 @@ import { X as g, CircleNotch as w, CheckCircle as C, XCircle as T, WarningCircle
4
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
- import { Button as B } from "../Button/component.js";
8
- import { Modal as I } from "../Modal/index.js";
7
+ import { Button as P } from "../Button/component.js";
8
+ import { Modal as B } from "../Modal/index.js";
9
9
  import './style.css';/* empty css */
10
- import { isTracebackError as M } from "../utils/isTracebackError.js";
11
- import { CodeBlock as P } from "../CodeBlock/component.js";
10
+ import { isTracebackError as I } from "../utils/isTracebackError.js";
11
+ import { CodeBlock as M } from "../CodeBlock/component.js";
12
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";
@@ -22,13 +22,13 @@ function u({
22
22
  error: /* @__PURE__ */ r(T, { weight: "fill" }),
23
23
  success: /* @__PURE__ */ r(C, { weight: "fill" }),
24
24
  progress: /* @__PURE__ */ r(w, {})
25
- }, i = ((l = e.data) == null ? void 0 : l.type) || "info", s = M(e == null ? void 0 : e.description);
25
+ }, i = ((l = e.data) == null ? void 0 : l.type) || "info", s = I(e == null ? void 0 : e.description);
26
26
  v(() => {
27
27
  s && a.update(e.id, { timeout: 0 });
28
28
  }, [s, e.id]);
29
29
  const h = x(
30
30
  (N) => {
31
- const { children: m, className: d, ...p } = N;
31
+ const { children: d, className: m, ...p } = N;
32
32
  return s ? /* @__PURE__ */ c(
33
33
  "div",
34
34
  {
@@ -36,7 +36,7 @@ function u({
36
36
  className: o(
37
37
  "toast-description",
38
38
  s ? "toast-description-traceback" : "",
39
- d
39
+ m
40
40
  ),
41
41
  children: [
42
42
  /* @__PURE__ */ c("p", { children: [
@@ -45,13 +45,13 @@ function u({
45
45
  "Please contact us with error details for support."
46
46
  ] }),
47
47
  /* @__PURE__ */ r("p", { children: /* @__PURE__ */ r(
48
- B,
48
+ P,
49
49
  {
50
50
  size: "small",
51
51
  onClick: () => {
52
- I.open({
52
+ B.open({
53
53
  title: "Error details",
54
- content: /* @__PURE__ */ r(P, { children: m }),
54
+ content: /* @__PURE__ */ r(M, { children: d }),
55
55
  hideOkButton: !0
56
56
  }), a.close(e.id);
57
57
  },
@@ -60,7 +60,7 @@ function u({
60
60
  ) })
61
61
  ]
62
62
  }
63
- ) : /* @__PURE__ */ r("p", { ...p, className: o("toast-description", d), children: m });
63
+ ) : /* @__PURE__ */ r("p", { ...p, className: o("toast-description", m), children: d });
64
64
  },
65
65
  [s, o, e.id]
66
66
  );
@@ -74,14 +74,14 @@ function u({
74
74
  t.Close,
75
75
  {
76
76
  className: o("toast-close"),
77
- render: /* @__PURE__ */ r(j, { size: "small", children: /* @__PURE__ */ r(g, {}) })
77
+ render: /* @__PURE__ */ r("span", { children: /* @__PURE__ */ r(j, { size: "small", children: /* @__PURE__ */ r(g, {}) }) })
78
78
  }
79
79
  )
80
80
  ] });
81
81
  }
82
82
  function y({ className: e }) {
83
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)) });
84
+ return /* @__PURE__ */ r(t.Portal, { children: /* @__PURE__ */ r(t.Viewport, { className: E(n("toast-viewport"), e), children: o.map((i) => /* @__PURE__ */ r(u, { toast: i }, i.id)) }) });
85
85
  }
86
86
  function z(e) {
87
87
  return /* @__PURE__ */ r(t.Provider, { toastManager: a, ...e });
@@ -1 +1 @@
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,G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AAAA,EACN,UAAUG;AACZ,CAAC;"}
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 <span>\n <IconButton size=\"small\">\n <X />\n </IconButton>\n </span>\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.Portal>\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 </BaseToast.Portal>\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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kB,CAC1C,EAAA,CACH,EACF,CAAA;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 +1 @@
1
- @layer components{.ds-toast-viewport{position:fixed;width:100%;max-width:30rem;margin:0 auto;bottom:2rem;left:50%;transform:translate(-50%);top:auto;z-index:2001;display:flex;justify-content:center}.ds-toast{--gap: .5rem;--offset-y: calc( var(--toast-offset-y) * -1 + (var(--toast-index) * var(--gap) * -1) + var(--toast-swipe-movement-y) );font-family:var(--font-sans);position:absolute;box-sizing:border-box;background:var(--ds-color-bg-elevated);color:var(--ds-color-text);padding:.75rem 1rem;max-width:100%;display:inline-flex;gap:var(--gap);box-shadow:var(--ds-box-shadow-secondary);background-clip:padding-box;border-radius:.5rem;bottom:0;margin-right:0;-webkit-user-select:none;user-select:none;transition:transform .5s cubic-bezier(.22,1,.36,1),opacity .5s;cursor:default;z-index:calc(1000 - var(--toast-index));transform:translate(var(--toast-swipe-movement-x)) translateY(calc(var(--toast-swipe-movement-y) + (var(--toast-index) * -20%))) scale(calc(1 - (var(--toast-index) * .1)))}.ds-toast:after{top:100%}.ds-toast[data-expanded]{transform:translate(var(--toast-swipe-movement-x)) translateY(var(--offset-y))}.ds-toast[data-starting-style],.ds-toast[data-ending-style]:not([data-limited]){transform:translateY(150%)}.ds-toast[data-ending-style]{opacity:0}.ds-toast[data-ending-style][data-swipe-direction=up]{transform:translateY(calc(var(--toast-swipe-movement-y) - 150%))}.ds-toast[data-ending-style][data-swipe-direction=left]{transform:translate(calc(var(--toast-swipe-movement-x) - 150%)) translateY(var(--offset-y))}.ds-toast[data-ending-style][data-swipe-direction=right]{transform:translate(calc(var(--toast-swipe-movement-x) + 150%)) translateY(var(--offset-y))}.ds-toast[data-ending-style][data-swipe-direction=down]{transform:translateY(calc(var(--toast-swipe-movement-y) + 150%))}.ds-toast:after{content:"";position:absolute;width:100%;left:0;height:calc(var(--gap) + 1px)}.ds-toast-content{display:flex;flex:1;flex-direction:column;gap:2}.ds-toast-title{font-size:var(--text-ds-h5);font-weight:var(--text-ds-h5--font-weight);line-height:var(--text-ds-h5--line-height)}.ds-toast-description{font-size:var(--ds-font-size);line-height:var(--ds-line-height)}.ds-toast-description-traceback p:not(:first-child){margin-top:.5rem}.ds-toast-icon-wrap{width:1.25rem;font-size:1.25rem;display:block;flex:0}.ds-toast-icon{width:1.25rem;height:1.25rem;display:block}.ds-toast-icon.ds-toast-icon-info{color:var(--ds-color-primary)}.ds-toast-icon.ds-toast-icon-success{color:var(--ds-color-success)}.ds-toast-icon.ds-toast-icon-warning{color:var(--ds-color-warning)}.ds-toast-icon.ds-toast-icon-error{color:var(--ds-color-error)}.ds-toast-icon.ds-toast-icon-progress{color:var(--ds-color-primary);animation:var(--ds-animate-spin)}}
1
+ @layer components{.ds-toast-viewport{position:fixed;width:100%;max-width:30rem;margin:0 auto;bottom:2rem;left:50%;transform:translate(-50%);top:auto;z-index:2001;display:flex;justify-content:center}.ds-toast{--gap: .5rem;--offset-y: calc( var(--toast-offset-y) * -1 + (var(--toast-index) * var(--gap) * -1) + var(--toast-swipe-movement-y) );font-family:var(--font-sans);position:absolute;box-sizing:border-box;background:var(--ds-color-bg-elevated);color:var(--ds-color-text);padding:.75rem 1rem;max-width:100%;display:inline-flex;gap:var(--gap);box-shadow:var(--ds-box-shadow-secondary);background-clip:padding-box;border-radius:.5rem;bottom:0;margin-right:0;-webkit-user-select:none;user-select:none;transition:transform .5s cubic-bezier(.22,1,.36,1),opacity .5s;cursor:default;z-index:calc(1000 - var(--toast-index));transform:translate(var(--toast-swipe-movement-x)) translateY(calc(var(--toast-swipe-movement-y) + (var(--toast-index) * -20%))) scale(calc(1 - (var(--toast-index) * .1)))}.ds-toast:after{top:100%}.ds-toast[data-expanded]{transform:translate(var(--toast-swipe-movement-x)) translateY(var(--offset-y))}.ds-toast[data-starting-style],.ds-toast[data-ending-style]:not([data-limited]){transform:translateY(150%)}.ds-toast[data-ending-style]{opacity:0}.ds-toast[data-ending-style][data-swipe-direction=up]{transform:translateY(calc(var(--toast-swipe-movement-y) - 150%))}.ds-toast[data-ending-style][data-swipe-direction=left]{transform:translate(calc(var(--toast-swipe-movement-x) - 150%)) translateY(var(--offset-y))}.ds-toast[data-ending-style][data-swipe-direction=right]{transform:translate(calc(var(--toast-swipe-movement-x) + 150%)) translateY(var(--offset-y))}.ds-toast[data-ending-style][data-swipe-direction=down]{transform:translateY(calc(var(--toast-swipe-movement-y) + 150%))}.ds-toast:after{content:"";position:absolute;width:100%;left:0;height:calc(var(--gap) + 1px)}.ds-toast-content{display:flex;flex:1;flex-direction:column;gap:2}.ds-toast-title{font-size:var(--text-ds-h5);font-weight:var(--text-ds-h5--font-weight);line-height:var(--text-ds-h5--line-height)}.ds-toast-description{font-size:var(--ds-font-size);line-height:var(--ds-line-height)}.ds-toast-description:last-child{margin-bottom:0}.ds-toast-description-traceback p:not(:first-child){margin-top:.5rem}.ds-toast-icon-wrap{width:1.25rem;font-size:1.25rem;display:block;flex:0}.ds-toast-icon{width:1.25rem;height:1.25rem;display:block}.ds-toast-icon.ds-toast-icon-info{color:var(--ds-color-primary)}.ds-toast-icon.ds-toast-icon-success{color:var(--ds-color-success)}.ds-toast-icon.ds-toast-icon-warning{color:var(--ds-color-warning)}.ds-toast-icon.ds-toast-icon-error{color:var(--ds-color-error)}.ds-toast-icon.ds-toast-icon-progress{color:var(--ds-color-primary);animation:var(--ds-animate-spin)}.ds-toast-close{margin-top:.125rem;display:flex}}
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ const u = (t) => {
3
+ const s = Array.isArray(t) ? t : [t], n = window.getComputedStyle(document.body);
4
+ return s.reduce((r, e) => {
5
+ const o = e.startsWith("--") ? e : `--${e}`;
6
+ return r[o] = n.getPropertyValue(o), r;
7
+ }, {});
8
+ };
9
+ export {
10
+ u as useCSSVariables
11
+ };
12
+ //# sourceMappingURL=useCSSVariables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCSSVariables.js","sources":["../../../src/components/hooks/useCSSVariables.ts"],"sourcesContent":["\"use client\";\n\n/**\n * Get CSS variables from the document\n * @param variables CSS variable names\n * @returns CSS variable values\n */\nexport const useCSSVariables = (variables: string | string[]) => {\n const variablesList = Array.isArray(variables) ? variables : [variables];\n const el = window.getComputedStyle(document.body);\n return variablesList.reduce((acc, variable) => {\n const variableName = variable.startsWith(\"--\") ? variable : `--${variable}`;\n acc[variableName] = el.getPropertyValue(variableName);\n return acc;\n }, {} as Record<string, string>);\n};\n"],"names":["useCSSVariables","variables","variablesList","el","acc","variable","variableName"],"mappings":";AAOa,MAAAA,IAAkB,CAACC,MAAiC;AAC/D,QAAMC,IAAgB,MAAM,QAAQD,CAAS,IAAIA,IAAY,CAACA,CAAS,GACjEE,IAAK,OAAO,iBAAiB,SAAS,IAAI;AAChD,SAAOD,EAAc,OAAO,CAACE,GAAKC,MAAa;AAC7C,UAAMC,IAAeD,EAAS,WAAW,IAAI,IAAIA,IAAW,KAAKA,CAAQ;AACzE,WAAAD,EAAIE,CAAY,IAAIH,EAAG,iBAAiBG,CAAY,GAC7CF;AAAA,EACT,GAAG,EAA4B;AACjC;"}
@@ -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/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;"}
1
+ {"version":3,"file":"useCharts.js","sources":["../../../src/components/hooks/useCharts.ts"],"sourcesContent":["import { useDS } from \"../DSRoot/context\";\nimport { getTokensByTheme } from \"../../tokens/utils\";\nimport { chartColorTokens } 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":";;;;AAgCa,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;"}
package/dist/index.d.ts CHANGED
@@ -339,7 +339,7 @@ export declare const Button: (props: ButtonProps & {
339
339
  ref?: React.ForwardedRef<HTMLButtonElement | HTMLAnchorElement>;
340
340
  }) => ReturnType<typeof ButtonInner>;
341
341
 
342
- declare const ButtonInner: ({ negativeMargin, type, size, variant, ...rest }: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => JSX.Element;
342
+ declare const ButtonInner: ({ negativeMargin, type, size, variant, icon, ...rest }: ButtonProps, ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>) => JSX.Element;
343
343
 
344
344
  export declare interface ButtonProps extends ButtonProps_2 {
345
345
  /**
@@ -1973,7 +1973,7 @@ export declare function moveTypingCursorToEnd(contentEditableElement: HTMLElemen
1973
1973
  export declare const Nav: {
1974
1974
  Item: <T extends HTMLElement>(props: NavItemProps & {
1975
1975
  ref?: React.Ref<T>;
1976
- }) => ReturnType<(<T_1 extends HTMLElement>({ icon, active, render, onClick, className, children, ...rest }: NavItemProps, ref: React.Ref<T_1>) => null)>;
1976
+ }) => ReturnType<(<T_1 extends HTMLElement>({ icon, active, render, onClick, className, children, changeIconWeightOnActive, ...rest }: NavItemProps, ref: React.Ref<T_1>) => null)>;
1977
1977
  Heading: ({ children, className, ...rest }: NavHeadingProps) => JSX.Element;
1978
1978
  Group: ForwardRefExoticComponent<NavGroupProps & RefAttributes<HTMLDivElement>>;
1979
1979
  };
@@ -1995,13 +1995,31 @@ export declare interface NavHeadingProps extends default_2.HTMLAttributes<HTMLHe
1995
1995
  }
1996
1996
 
1997
1997
  export declare interface NavItemProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
1998
+ /**
1999
+ * The icon to display in the nav item
2000
+ */
1998
2001
  icon?: default_2.ReactNode;
2002
+ /**
2003
+ * Whether the nav item is active
2004
+ */
1999
2005
  active?: boolean;
2006
+ /**
2007
+ * The render prop to render the nav item
2008
+ */
2000
2009
  render?: useRender.RenderProp<{
2001
2010
  active: boolean;
2002
2011
  icon?: default_2.ReactNode;
2003
2012
  }>;
2013
+ /**
2014
+ * The size of the nav item
2015
+ * @default "medium"
2016
+ */
2004
2017
  size?: "small" | "medium" | "large";
2018
+ /**
2019
+ * Whether to change the icon weight on active state
2020
+ * @default true
2021
+ */
2022
+ changeIconWeightOnActive?: boolean;
2005
2023
  }
2006
2024
 
2007
2025
  export { notification }
@@ -3190,6 +3208,13 @@ T | undefined,
3190
3208
  (value: T | ((prev: T | undefined) => T), ...args: K | []) => void
3191
3209
  ];
3192
3210
 
3211
+ /**
3212
+ * Get CSS variables from the document
3213
+ * @param variables CSS variable names
3214
+ * @returns CSS variable values
3215
+ */
3216
+ export declare const useCSSVariables: (variables: string | string[]) => Record<string, string>;
3217
+
3193
3218
  export declare const useDS: () => {
3194
3219
  theme: "light" | "dark";
3195
3220
  };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { componentMetadata as r, getComponentsByCategory as t } from "./metadata.js";
2
- import { Affix as p, Alert as m, Anchor as s, App as f, AutoComplete as l, Avatar as n, BackTop as x, Calendar as i, Card as C, Carousel as c, Cascader as T, Col as u, ColorPicker as d, ConfigProvider as g, DatePicker as S, Descriptions as h, Divider as A, Drawer as E, Dropdown as k, Flex as P, FloatButton as R, Grid as D, InputNumber as b, Layout as y, List as B, Mentions as L, Menu as v, Pagination as I, Popconfirm as M, Progress as F, QRCode as N, Rate as U, Result as w, Row as _, Skeleton as O, Space as W, Statistic as q, Steps as G, Tabs as K, TimePicker as Q, Timeline as V, Transfer as H, TreeSelect as j, Typography as z, Watermark as J, message as X, notification as Y, theme as Z, unstableSetRender as $, version as oo } from "antd";
2
+ import { Affix as p, Alert as m, Anchor as s, App as f, AutoComplete as l, Avatar as n, BackTop as x, Calendar as i, Card as C, Carousel as c, Cascader as T, Col as u, ColorPicker as d, ConfigProvider as g, DatePicker as S, Descriptions as h, Divider as A, Drawer as E, Dropdown as k, Flex as P, FloatButton as R, Grid as b, InputNumber as D, Layout as y, List as B, Mentions as L, Menu as v, Pagination as I, Popconfirm as M, Progress as F, QRCode as N, Rate as U, Result as w, Row as _, Skeleton as O, Space as W, Statistic as q, Steps as G, Tabs as V, TimePicker as K, Timeline as Q, Transfer as H, TreeSelect as j, Typography as z, Watermark as J, message as X, notification as Y, theme as Z, unstableSetRender as $, version as oo } from "antd";
3
3
  import { Select as ro } from "./components/Select/component.js";
4
4
  import { Modal as ao } from "./components/Modal/index.js";
5
5
  import { IconButton as mo } from "./components/IconButton/component.js";
@@ -11,14 +11,14 @@ import { Tag as uo } from "./components/Tag/component.js";
11
11
  import { ThemeProvider as So } from "./components/ThemeProvider/component.js";
12
12
  import { Split as Ao, Splitter as Eo } from "./components/Splitter/component.js";
13
13
  import { Truncate as Po } from "./components/Truncate/component.js";
14
- import { DropdownMenu as Do } from "./components/DropdownMenu/component.js";
14
+ import { DropdownMenu as bo } from "./components/DropdownMenu/component.js";
15
15
  import { clsx as yo, cn as Bo, cx as Lo } from "./components/utils/cn.js";
16
16
  import { reactNodeToString as Io } from "./components/utils/reactToString.js";
17
17
  import { isTracebackError as Fo } from "./components/utils/isTracebackError.js";
18
18
  import { isValidHexColor as Uo } from "./components/utils/colors.js";
19
19
  import { parseAntdPlacement as _o, useAntdCssVarClassname as Oo, useCls as Wo, useGetPrefixCls as qo } from "./components/utils/antdUtils.js";
20
- import { WithAntdTokens as Ko } from "./components/utils/WithAntdTokens.js";
21
- import { changeThemeWithoutTransition as Vo } from "./components/utils/theme.js";
20
+ import { WithAntdTokens as Vo } from "./components/utils/WithAntdTokens.js";
21
+ import { changeThemeWithoutTransition as Qo } from "./components/utils/theme.js";
22
22
  import { moveTypingCursorToEnd as jo } from "./components/utils/selectionRange.js";
23
23
  import { Transition as Jo } from "./components/Transition/component.js";
24
24
  import { DefaultUpload as Yo, Upload as Zo } from "./components/Upload/component.js";
@@ -34,7 +34,7 @@ import { Tree as de } from "./components/Tree/components.js";
34
34
  import { Spin as Se } from "./components/Spin/component.js";
35
35
  import { Empty as Ae, EmptyIcon as Ee } from "./components/Empty/component.js";
36
36
  import { Form as Pe } from "./components/Form/component.js";
37
- import { Field as De } from "./components/Field/component.js";
37
+ import { Field as be } from "./components/Field/component.js";
38
38
  import { Tour as ye } from "./components/Tour/component.js";
39
39
  import { Toast as Le } from "./components/Toast/component.js";
40
40
  import { toast as Ie, toastManager as Me } from "./components/Toast/function.js";
@@ -42,8 +42,8 @@ import { VerticalCollapsiblePanel as Ne } from "./components/VerticalCollapsible
42
42
  import { PopupPanel as we } from "./components/PopupPanel/component.js";
43
43
  import { CodeBlock as Oe } from "./components/CodeBlock/component.js";
44
44
  import { StackChild as qe } from "./components/Stack/StackChild.js";
45
- import { Stack as Ke } from "./components/Stack/index.js";
46
- import { Collapse as Ve } from "./components/Collapse/component.js";
45
+ import { Stack as Ve } from "./components/Stack/index.js";
46
+ import { Collapse as Qe } from "./components/Collapse/component.js";
47
47
  import { Input as je } from "./components/Input/component.js";
48
48
  import { Badge as Je, InternalBadge as Xe } from "./components/Badge/component.js";
49
49
  import { Radio as Ze } from "./components/Radio/component.js";
@@ -56,15 +56,16 @@ import { Nav as ir } from "./components/Nav/index.js";
56
56
  import { useForm as cr, useWatch as Tr } from "antd/es/form/Form";
57
57
  import { useBreakpoint as dr, useMessage as gr, useModal as Sr, useToken as hr } from "./components/hooks/antd.js";
58
58
  import { default as Er } from "antd/es/app/useApp";
59
- import { useAnimationsFinished as Pr, useEnhancedEffect as Rr, useEventCallback as Dr, useLatestRef as br } from "./components/hooks/base-ui.js";
59
+ import { useAnimationsFinished as Pr, useEnhancedEffect as Rr, useEventCallback as br, useLatestRef as Dr } from "./components/hooks/base-ui.js";
60
60
  import { useControlledState as Br } from "./components/hooks/useControlledState.js";
61
61
  import { useCharts as vr } from "./components/hooks/useCharts.js";
62
- import { antdColorTokens as Mr, darkTheme as Fr, lightTheme as Nr } from "./tokens/and-theme/tokens.js";
63
- import { categoricalChartColorKeys as wr, categoricalChartColorTokens as _r, categoricalChartsColors as Or, chartColorTokens as Wr, rawChartColorTokens as qr } from "./tokens/charts/palettes/cloudscape.js";
64
- import { COLORBREWER as Kr } from "./tokens/charts/palettes/colorbrewer.js";
65
- import { tab10 as Vr, tab20 as Hr, tab20b as jr, tab20c as zr } from "./tokens/charts/palettes/tableau.js";
66
- import { CATEGORICAL_PALETTES as Xr, CATEGORICAL_PALETTE_NAMES as Yr, SEQUENTIAL_PALETTES as Zr, SEQUENTIAL_PALETTE_NAMES as $r, getAllCategoricalChartColors as ot, getAllSequentialChartColors as et, getCategoricalChartColors as rt, getSequentialChartColors as tt } from "./tokens/charts/palettes/index.js";
67
- import { getColorsByTheme as pt, getTokensByTheme as mt, resolveColorTokens as st } from "./tokens/utils.js";
62
+ import { useCSSVariables as Mr } from "./components/hooks/useCSSVariables.js";
63
+ import { antdColorTokens as Nr, darkTheme as Ur, lightTheme as wr } from "./tokens/and-theme/tokens.js";
64
+ import { categoricalChartColorKeys as Or, categoricalChartColorTokens as Wr, categoricalChartsColors as qr, chartColorTokens as Gr, rawChartColorTokens as Vr } from "./tokens/charts/palettes/cloudscape.js";
65
+ import { COLORBREWER as Qr } from "./tokens/charts/palettes/colorbrewer.js";
66
+ import { tab10 as jr, tab20 as zr, tab20b as Jr, tab20c as Xr } from "./tokens/charts/palettes/tableau.js";
67
+ import { CATEGORICAL_PALETTES as Zr, CATEGORICAL_PALETTE_NAMES as $r, SEQUENTIAL_PALETTES as ot, SEQUENTIAL_PALETTE_NAMES as et, getAllCategoricalChartColors as rt, getAllSequentialChartColors as tt, getCategoricalChartColors as at, getSequentialChartColors as pt } from "./tokens/charts/palettes/index.js";
68
+ import { getColorsByTheme as st, getTokensByTheme as ft, resolveColorTokens as lt } from "./tokens/utils.js";
68
69
  export {
69
70
  p as Affix,
70
71
  m as Alert,
@@ -76,9 +77,9 @@ export {
76
77
  Je as Badge,
77
78
  ne as Breadcrumb,
78
79
  or as Button,
79
- Xr as CATEGORICAL_PALETTES,
80
- Yr as CATEGORICAL_PALETTE_NAMES,
81
- Kr as COLORBREWER,
80
+ Zr as CATEGORICAL_PALETTES,
81
+ $r as CATEGORICAL_PALETTE_NAMES,
82
+ Qr as COLORBREWER,
82
83
  i as Calendar,
83
84
  C as Card,
84
85
  c as Carousel,
@@ -86,7 +87,7 @@ export {
86
87
  no as Checkbox,
87
88
  Oe as CodeBlock,
88
89
  u as Col,
89
- Ve as Collapse,
90
+ Qe as Collapse,
90
91
  d as ColorPicker,
91
92
  nr as ColorSelect,
92
93
  g as ConfigProvider,
@@ -100,17 +101,17 @@ export {
100
101
  fr as DragDropRoot,
101
102
  E as Drawer,
102
103
  k as Dropdown,
103
- Do as DropdownMenu,
104
+ bo as DropdownMenu,
104
105
  Ae as Empty,
105
106
  Ee as EmptyIcon,
106
- De as Field,
107
+ be as Field,
107
108
  P as Flex,
108
109
  R as FloatButton,
109
110
  Pe as Form,
110
- D as Grid,
111
+ b as Grid,
111
112
  mo as IconButton,
112
113
  je as Input,
113
- b as InputNumber,
114
+ D as InputNumber,
114
115
  Xe as InternalBadge,
115
116
  y as Layout,
116
117
  B as List,
@@ -128,8 +129,8 @@ export {
128
129
  U as Rate,
129
130
  w as Result,
130
131
  _ as Row,
131
- Zr as SEQUENTIAL_PALETTES,
132
- $r as SEQUENTIAL_PALETTE_NAMES,
132
+ ot as SEQUENTIAL_PALETTES,
133
+ et as SEQUENTIAL_PALETTE_NAMES,
133
134
  re as ScrollArea,
134
135
  io as Segmented,
135
136
  ro as Select,
@@ -139,17 +140,17 @@ export {
139
140
  Se as Spin,
140
141
  Ao as Split,
141
142
  Eo as Splitter,
142
- Ke as Stack,
143
+ Ve as Stack,
143
144
  qe as StackChild,
144
145
  q as Statistic,
145
146
  G as Steps,
146
147
  fo as Switch,
147
148
  co as Table,
148
- K as Tabs,
149
+ V as Tabs,
149
150
  uo as Tag,
150
151
  So as ThemeProvider,
151
- Q as TimePicker,
152
- V as Timeline,
152
+ K as TimePicker,
153
+ Q as Timeline,
153
154
  Le as Toast,
154
155
  fe as Tooltip,
155
156
  ye as Tour,
@@ -162,41 +163,41 @@ export {
162
163
  Zo as Upload,
163
164
  Ne as VerticalCollapsiblePanel,
164
165
  J as Watermark,
165
- Ko as WithAntdTokens,
166
- Mr as antdColorTokens,
167
- wr as categoricalChartColorKeys,
168
- _r as categoricalChartColorTokens,
169
- Or as categoricalChartsColors,
170
- Vo as changeThemeWithoutTransition,
171
- Wr as chartColorTokens,
166
+ Vo as WithAntdTokens,
167
+ Nr as antdColorTokens,
168
+ Or as categoricalChartColorKeys,
169
+ Wr as categoricalChartColorTokens,
170
+ qr as categoricalChartsColors,
171
+ Qo as changeThemeWithoutTransition,
172
+ Gr as chartColorTokens,
172
173
  yo as clsx,
173
174
  Bo as cn,
174
175
  r as componentMetadata,
175
176
  Lo as cx,
176
- Fr as darkTheme,
177
- ot as getAllCategoricalChartColors,
178
- et as getAllSequentialChartColors,
179
- rt as getCategoricalChartColors,
180
- pt as getColorsByTheme,
177
+ Ur as darkTheme,
178
+ rt as getAllCategoricalChartColors,
179
+ tt as getAllSequentialChartColors,
180
+ at as getCategoricalChartColors,
181
+ st as getColorsByTheme,
181
182
  t as getComponentsByCategory,
182
- tt as getSequentialChartColors,
183
- mt as getTokensByTheme,
183
+ pt as getSequentialChartColors,
184
+ ft as getTokensByTheme,
184
185
  ce as getUniqueKeysFromOriginals,
185
186
  Fo as isTracebackError,
186
187
  Uo as isValidHexColor,
187
- Nr as lightTheme,
188
+ wr as lightTheme,
188
189
  X as message,
189
190
  jo as moveTypingCursorToEnd,
190
191
  Y as notification,
191
192
  _o as parseAntdPlacement,
192
193
  Te as processTreeData,
193
- qr as rawChartColorTokens,
194
+ Vr as rawChartColorTokens,
194
195
  Io as reactNodeToString,
195
- st as resolveColorTokens,
196
- Vr as tab10,
197
- Hr as tab20,
198
- jr as tab20b,
199
- zr as tab20c,
196
+ lt as resolveColorTokens,
197
+ jr as tab10,
198
+ zr as tab20,
199
+ Jr as tab20b,
200
+ Xr as tab20c,
200
201
  Z as theme,
201
202
  Ie as toast,
202
203
  Me as toastManager,
@@ -205,15 +206,16 @@ export {
205
206
  Oo as useAntdCssVarClassname,
206
207
  Er as useApp,
207
208
  dr as useBreakpoint,
209
+ Mr as useCSSVariables,
208
210
  vr as useCharts,
209
211
  Wo as useCls,
210
212
  Br as useControlledState,
211
213
  pr as useDS,
212
214
  Rr as useEnhancedEffect,
213
- Dr as useEventCallback,
215
+ br as useEventCallback,
214
216
  cr as useForm,
215
217
  qo as useGetPrefixCls,
216
- br as useLatestRef,
218
+ Dr as useLatestRef,
217
219
  gr as useMessage,
218
220
  Sr as useModal,
219
221
  hr as useToken,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,7 +3,7 @@ const o = {
3
3
  // Text colors
4
4
  colorText: {
5
5
  light: "rgba(0, 0, 0, 0.88)",
6
- dark: "rgba(255, 255, 255, 0.85)"
6
+ dark: "rgba(255, 255, 255, 0.88)"
7
7
  },
8
8
  colorTextSecondary: {
9
9
  light: "rgba(0, 0, 0, 0.65)",
@@ -234,38 +234,38 @@ const o = {
234
234
  },
235
235
  // Icon colors
236
236
  colorIcon: {
237
- light: "rgba(0, 0, 0, 0.58)",
237
+ light: "rgba(0, 0, 0, 0.50)",
238
238
  dark: "rgba(255, 255, 255, 0.58)"
239
239
  },
240
240
  colorIconHover: {
241
- light: "rgba(0, 0, 0, 0.88)",
241
+ light: "rgba(0, 0, 0, 0.80)",
242
242
  dark: "rgba(255, 255, 255, 0.88)"
243
243
  },
244
+ colorBgBase: {
245
+ light: "#FFFFFF",
246
+ dark: "#111113"
247
+ },
244
248
  // Background colors
245
249
  colorBgContainer: {
246
250
  light: "#FFFFFF",
247
- dark: "#26262C"
251
+ dark: "#242429"
248
252
  },
249
253
  colorBgElevated: {
250
254
  light: "#FFFFFF",
251
- dark: "#2F2F37"
255
+ dark: "#2B2B31"
252
256
  },
253
257
  colorBgLayout: {
254
- light: "#F5F5F5",
255
- dark: "#1A1A1E"
258
+ light: "#F4F4F5",
259
+ dark: "#18181B"
256
260
  },
257
261
  colorBgSpotlight: {
258
262
  light: "rgba(0, 0, 0, 0.85)",
259
- dark: "#505D5D"
263
+ dark: "#484851"
260
264
  },
261
265
  colorBgMask: {
262
266
  light: "rgba(0, 0, 0, 0.45)",
263
267
  dark: "rgba(0, 0, 0, 0.45)"
264
268
  },
265
- colorBgBase: {
266
- light: "#FFFFFF",
267
- dark: "#13131A"
268
- },
269
269
  // Control
270
270
  controlOutline: {
271
271
  light: "rgba(0, 0, 0, 0.12)",
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.js","sources":["../../../src/tokens/and-theme/tokens.ts"],"sourcesContent":["import { type ThemeConfig } from \"antd\";\nimport { getTokensByTheme } from \"../utils\";\nimport { ColorTokens } from \"../types\";\n\n// Convert Figma variables to Ant Design tokens with light/dark variants\nexport const antdColorTokens: ColorTokens = {\n // Text colors\n colorText: {\n light: \"rgba(0, 0, 0, 0.88)\",\n dark: \"rgba(255, 255, 255, 0.85)\",\n },\n colorTextSecondary: {\n light: \"rgba(0, 0, 0, 0.65)\",\n dark: \"rgba(255, 255, 255, 0.65)\",\n },\n colorTextTertiary: {\n light: \"rgba(0, 0, 0, 0.45)\",\n dark: \"rgba(255, 255, 255, 0.45)\",\n },\n colorTextQuaternary: {\n light: \"rgba(0, 0, 0, 0.25)\",\n dark: \"rgba(255, 255, 255, 0.25)\",\n },\n // Primary colors\n colorPrimary: {\n light: \"#175CD3\",\n dark: \"#2E90FA\",\n },\n colorPrimaryBg: {\n light: \"#E9F2FF\",\n dark: \"#152137\",\n },\n colorPrimaryBgHover: {\n light: \"#D1E9FF\",\n dark: \"#112545\",\n },\n colorPrimaryBorder: {\n light: \"#84CAFF\",\n dark: \"#1C3959\",\n },\n colorPrimaryBorderHover: {\n light: \"#53B1FD\",\n dark: \"#204C7C\",\n },\n colorPrimaryHover: {\n light: \"#1570EF\",\n dark: \"#50A0E8\",\n },\n colorPrimaryActive: {\n light: \"#175CD3\",\n dark: \"#2565AB\",\n },\n colorPrimaryTextHover: {\n light: \"#1570EF\",\n dark: \"#50A0E8\",\n },\n colorPrimaryTextActive: {\n light: \"#175CD3\",\n dark: \"#2565AB\",\n },\n\n // Info colors\n colorInfo: {\n light: \"#175CD3\",\n dark: \"#2E90FA\",\n },\n colorInfoBg: {\n light: \"#E9F2FF\",\n dark: \"#152137\",\n },\n colorInfoBgHover: {\n light: \"#D1E9FF\",\n dark: \"#112545\",\n },\n colorInfoBorder: {\n light: \"#84CAFF\",\n dark: \"#1C3959\",\n },\n colorInfoBorderHover: {\n light: \"#53B1FD\",\n dark: \"#204C7C\",\n },\n colorInfoHover: {\n light: \"#1570EF\",\n dark: \"#50A0E8\",\n },\n colorInfoActive: {\n light: \"#175CD3\",\n dark: \"#2565AB\",\n },\n colorInfoTextHover: {\n light: \"#1570EF\",\n dark: \"#50A0E8\",\n },\n colorInfoTextActive: {\n light: \"#175CD3\",\n dark: \"#2565AB\",\n },\n\n // Success colors\n colorSuccess: {\n light: \"#4CB200\",\n dark: \"#389E0D\",\n },\n colorSuccessBg: {\n light: \"#F6FFF0\",\n dark: \"#162100\",\n },\n colorSuccessBgHover: {\n light: \"#D9F7BE\",\n dark: \"#1D2B00\",\n },\n colorSuccessBorder: {\n light: \"#B7EB8F\",\n dark: \"#274916\",\n },\n colorSuccessBorderHover: {\n light: \"#95DE64\",\n dark: \"#306317\",\n },\n colorSuccessHover: {\n light: \"#73D13D\",\n dark: \"#52C41A\",\n },\n colorSuccessActive: {\n light: \"#389E0D\",\n dark: \"#237804\",\n },\n colorSuccessTextHover: {\n light: \"#237804\",\n dark: \"#52C41A\",\n },\n colorSuccessTextActive: {\n light: \"#092B00\",\n dark: \"#237804\",\n },\n\n // Warning colors\n colorWarning: {\n light: \"#FA8C16\",\n dark: \"#D48806\",\n },\n colorWarningBg: {\n light: \"#FFF7E6\",\n dark: \"#281800\",\n },\n colorWarningBgHover: {\n light: \"#FFE7BA\",\n dark: \"#3D2200\",\n },\n colorWarningBorder: {\n light: \"#FFD591\",\n dark: \"#443B16\",\n },\n colorWarningBorderHover: {\n light: \"#FFC069\",\n dark: \"#594E1A\",\n },\n colorWarningHover: {\n light: \"#FFA940\",\n dark: \"#E8B339\",\n },\n colorWarningActive: {\n light: \"#D46B08\",\n dark: \"#AA7714\",\n },\n colorWarningTextHover: {\n light: \"#AD4E00\",\n dark: \"#E8B339\",\n },\n colorWarningTextActive: {\n light: \"#873800\",\n dark: \"#AA7714\",\n },\n\n // Error colors\n colorError: {\n light: \"#D92D20\",\n dark: \"#CF3D33\",\n },\n colorErrorBg: {\n light: \"#FEF3F2\",\n dark: \"#291414\",\n },\n colorErrorBgHover: {\n light: \"#FEE4E2\",\n dark: \"#411A18\",\n },\n colorErrorBorder: {\n light: \"#FDA29B\",\n dark: \"#562222\",\n },\n colorErrorBorderHover: {\n light: \"#F97066\",\n dark: \"#772A24\",\n },\n colorErrorHover: {\n light: \"#F04438\",\n dark: \"#E5695A\",\n },\n colorErrorActive: {\n light: \"#D92D20\",\n dark: \"#A3332B\",\n },\n colorErrorTextHover: {\n light: \"#F04438\",\n dark: \"#E5695A\",\n },\n colorErrorTextActive: {\n light: \"#D92D20\",\n dark: \"#A3332B\",\n },\n\n // Fill colors\n colorFill: {\n light: \"rgba(0, 0, 0, 0.15)\",\n dark: \"rgba(255, 255, 255, 0.15)\",\n },\n colorFillSecondary: {\n light: \"rgba(0, 0, 0, 0.06)\",\n dark: \"rgba(255, 255, 255, 0.06)\",\n },\n colorFillTertiary: {\n light: \"rgba(0, 0, 0, 0.04)\",\n dark: \"rgba(255, 255, 255, 0.04)\",\n },\n colorFillQuaternary: {\n light: \"rgba(0, 0, 0, 0.02)\",\n dark: \"rgba(255, 255, 255, 0.02)\",\n },\n colorFillAlter: {\n light: \"rgba(0, 0, 0, 0.02)\",\n dark: \"rgba(255, 255, 255, 0.02)\",\n },\n\n // Border colors\n colorBorder: {\n light: \"rgba(0, 0, 0, 0.16)\",\n dark: \"rgba(255, 255, 255, 0.16)\",\n },\n colorBorderSecondary: {\n light: \"rgba(0, 0, 0, 0.06)\",\n dark: \"rgba(255, 255, 255, 0.06)\",\n },\n\n // Icon colors\n colorIcon: {\n light: \"rgba(0, 0, 0, 0.58)\",\n dark: \"rgba(255, 255, 255, 0.58)\",\n },\n colorIconHover: {\n light: \"rgba(0, 0, 0, 0.88)\",\n dark: \"rgba(255, 255, 255, 0.88)\",\n },\n\n // Background colors\n colorBgContainer: {\n light: \"#FFFFFF\",\n dark: \"#26262C\",\n },\n colorBgElevated: {\n light: \"#FFFFFF\",\n dark: \"#2F2F37\",\n },\n colorBgLayout: {\n light: \"#F5F5F5\",\n dark: \"#1A1A1E\",\n },\n colorBgSpotlight: {\n light: \"rgba(0, 0, 0, 0.85)\",\n dark: \"#505D5D\",\n },\n colorBgMask: {\n light: \"rgba(0, 0, 0, 0.45)\",\n dark: \"rgba(0, 0, 0, 0.45)\",\n },\n colorBgBase: {\n light: \"#FFFFFF\",\n dark: \"#13131A\",\n },\n\n // Control\n controlOutline: {\n light: \"rgba(0, 0, 0, 0.12)\",\n dark: \"rgba(255, 255, 255, 0.12)\",\n },\n};\n\nconst sharedTokens: ThemeConfig[\"token\"] = {\n fontFamily: \"var(--ds-inter)\",\n fontFamilyCode: \"var(--ds-roboto-mono)\",\n fontSizeHeading1: 36,\n fontSizeHeading2: 30,\n fontSizeHeading3: 24,\n fontSizeHeading4: 20,\n fontSizeHeading5: 16,\n lineHeightHeading1: 40 / 36,\n lineHeightHeading2: 36 / 30,\n lineHeightHeading3: 32 / 24,\n lineHeightHeading4: 28 / 20,\n lineHeightHeading5: 24 / 16,\n lineHeight: 20 / 14,\n lineHeightLG: 24 / 16,\n lineHeightSM: 16 / 12,\n fontWeightStrong: 600,\n boxShadow:\n \"0px 1px 2px rgba(0, 0, 0, 0.06), 0px 1px 6px rgba(0, 0, 0, 0.04), 0px 2px 10px rgba(0, 0, 0, 0.04)\",\n boxShadowSecondary:\n \"0px 0px 1px 0px var(--ds-modal-color-border), 0px 3px 6px 1px rgba(0, 0, 0, 0.08), 0px 6px 26px 2px rgba(0, 0, 0, 0.08), 0px 4px 52px 0px rgba(0, 0, 0, 0.05)\",\n colorBgSpotlight: \"rgba(0, 0, 0, 0.85)\",\n};\n\nconst sharedThemeConfig: ThemeConfig = {\n cssVar: true,\n components: {\n Input: {\n activeBorderColor: \"var(--ds-input-color-border-active)\",\n activeShadow: \"var(--ds-input-shadow-active)\",\n errorActiveShadow: \"var(--ds-input-shadow-error-active)\",\n warningActiveShadow: \"var(--ds-input-shadow-warning-active)\",\n },\n InputNumber: {\n activeBorderColor: \"var(--ds-input-color-border-active)\",\n activeShadow: \"var(--ds-input-shadow-active)\",\n errorActiveShadow: \"var(--ds-input-shadow-error-active)\",\n warningActiveShadow: \"var(--ds-input-shadow-warning-active)\",\n },\n Button: {\n defaultShadow: undefined,\n primaryShadow: undefined,\n dangerShadow: undefined,\n },\n Select: {},\n Segmented: {\n controlHeightLG: 36,\n controlHeightSM: 24,\n },\n Breadcrumb: {\n separatorColor: \"var(--ds-color-border)\",\n },\n Slider: {\n trackBg: \"var(--ds-color-primary)\",\n trackHoverBg: \"var(--ds-color-primary-hover)\",\n trackBgDisabled: \"var(--ds-color-text-disabled)\",\n railBg: \"var(--ds-control-outline)\",\n railHoverBg: \"var(--ds-color-border)\",\n handleColor: \"var(--ds-color-primary)\",\n handleActiveColor: \"var(--ds-color-primary-active)\",\n handleColorDisabled: \"var(--ds-color-text-disabled)\",\n dotBorderColor: \"var(--ds-color-primary)\",\n dotActiveBorderColor: \"var(--ds-color-primary-active)\",\n },\n Form: {\n itemMarginBottom: 16,\n labelColor: \"var(--ds-color-text)\",\n },\n },\n};\n\n// Export theme configurations\nexport const lightTheme: ThemeConfig = {\n token: {\n ...getTokensByTheme(antdColorTokens, \"light\"),\n ...sharedTokens,\n },\n ...sharedThemeConfig,\n};\n\nexport const darkTheme: ThemeConfig = {\n token: {\n ...getTokensByTheme(antdColorTokens, \"dark\"),\n ...sharedTokens,\n },\n ...sharedThemeConfig,\n};\n"],"names":["antdColorTokens","sharedTokens","sharedThemeConfig","lightTheme","getTokensByTheme","darkTheme"],"mappings":";AAKO,MAAMA,IAA+B;AAAA;AAAA,EAE1C,WAAW;AAAA,IACT,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,oBAAoB;AAAA,IAClB,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,mBAAmB;AAAA,IACjB,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,qBAAqB;AAAA,IACnB,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA;AAAA,EAEA,cAAc;AAAA,IACZ,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,gBAAgB;AAAA,IACd,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,qBAAqB;AAAA,IACnB,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,oBAAoB;AAAA,IAClB,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,yBAAyB;AAAA,IACvB,OAAO;AAAA,IACP,MAAM;AAAA,EACR;AAAA,EACA,mBAAmB;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iB,OAAO;AAAA,IAC5C,GAAGC;AAAA,EACL;AAAA,EACA,GAAGC;AACL,GAEaG,IAAyB;AAAA,EACpC,OAAO;AAAA,IACL,GAAGD,EAAiBJ,GAAiB,MAAM;AAAA,IAC3C,GAAGC;AAAA,EACL;AAAA,EACA,GAAGC;AACL;"}
1
+ {"version":3,"file":"tokens.js","sources":["../../../src/tokens/and-theme/tokens.ts"],"sourcesContent":["import { type ThemeConfig } from \"antd\";\nimport { getTokensByTheme } from \"../utils\";\nimport { ColorTokens } from \"../types\";\n\n// Convert Figma variables to Ant Design tokens with light/dark variants\nexport const antdColorTokens: ColorTokens = {\n // Text colors\n colorText: {\n light: \"rgba(0, 0, 0, 0.88)\",\n dark: \"rgba(255, 255, 255, 0.88)\",\n },\n colorTextSecondary: {\n light: \"rgba(0, 0, 0, 0.65)\",\n dark: \"rgba(255, 255, 255, 0.65)\",\n },\n colorTextTertiary: {\n light: \"rgba(0, 0, 0, 0.45)\",\n dark: \"rgba(255, 255, 255, 0.45)\",\n },\n colorTextQuaternary: {\n light: \"rgba(0, 0, 0, 0.25)\",\n dark: \"rgba(255, 255, 255, 0.25)\",\n },\n // Primary colors\n colorPrimary: {\n light: \"#175CD3\",\n dark: \"#2E90FA\",\n },\n colorPrimaryBg: {\n light: \"#E9F2FF\",\n dark: \"#152137\",\n },\n colorPrimaryBgHover: {\n light: \"#D1E9FF\",\n dark: \"#112545\",\n },\n colorPrimaryBorder: {\n light: \"#84CAFF\",\n dark: \"#1C3959\",\n },\n colorPrimaryBorderHover: {\n light: \"#53B1FD\",\n dark: \"#204C7C\",\n },\n colorPrimaryHover: {\n light: \"#1570EF\",\n dark: \"#50A0E8\",\n },\n colorPrimaryActive: {\n light: \"#175CD3\",\n dark: \"#2565AB\",\n },\n colorPrimaryTextHover: {\n light: \"#1570EF\",\n dark: \"#50A0E8\",\n },\n colorPrimaryTextActive: {\n light: \"#175CD3\",\n dark: \"#2565AB\",\n },\n\n // Info colors\n colorInfo: {\n light: \"#175CD3\",\n dark: \"#2E90FA\",\n },\n colorInfoBg: {\n light: \"#E9F2FF\",\n dark: \"#152137\",\n },\n colorInfoBgHover: {\n light: \"#D1E9FF\",\n dark: \"#112545\",\n },\n colorInfoBorder: {\n light: \"#84CAFF\",\n dark: \"#1C3959\",\n },\n colorInfoBorderHover: {\n light: \"#53B1FD\",\n dark: \"#204C7C\",\n },\n colorInfoHover: {\n light: \"#1570EF\",\n dark: \"#50A0E8\",\n },\n colorInfoActive: {\n light: \"#175CD3\",\n dark: \"#2565AB\",\n },\n colorInfoTextHover: {\n light: \"#1570EF\",\n dark: \"#50A0E8\",\n },\n colorInfoTextActive: {\n light: \"#175CD3\",\n dark: \"#2565AB\",\n },\n\n // Success colors\n colorSuccess: {\n light: \"#4CB200\",\n dark: \"#389E0D\",\n },\n colorSuccessBg: {\n light: \"#F6FFF0\",\n dark: \"#162100\",\n },\n colorSuccessBgHover: {\n light: \"#D9F7BE\",\n dark: \"#1D2B00\",\n },\n colorSuccessBorder: {\n light: \"#B7EB8F\",\n dark: \"#274916\",\n },\n colorSuccessBorderHover: {\n light: \"#95DE64\",\n dark: \"#306317\",\n },\n colorSuccessHover: {\n light: \"#73D13D\",\n dark: \"#52C41A\",\n },\n colorSuccessActive: {\n light: \"#389E0D\",\n dark: \"#237804\",\n },\n colorSuccessTextHover: {\n light: \"#237804\",\n dark: \"#52C41A\",\n },\n colorSuccessTextActive: {\n light: \"#092B00\",\n dark: \"#237804\",\n },\n\n // Warning colors\n colorWarning: {\n light: \"#FA8C16\",\n dark: \"#D48806\",\n },\n colorWarningBg: {\n light: \"#FFF7E6\",\n dark: \"#281800\",\n },\n colorWarningBgHover: {\n light: \"#FFE7BA\",\n dark: \"#3D2200\",\n },\n colorWarningBorder: {\n light: \"#FFD591\",\n dark: \"#443B16\",\n },\n colorWarningBorderHover: {\n light: \"#FFC069\",\n dark: \"#594E1A\",\n },\n colorWarningHover: {\n light: \"#FFA940\",\n dark: \"#E8B339\",\n },\n colorWarningActive: {\n light: \"#D46B08\",\n dark: \"#AA7714\",\n },\n colorWarningTextHover: {\n light: \"#AD4E00\",\n dark: \"#E8B339\",\n },\n colorWarningTextActive: {\n light: \"#873800\",\n dark: \"#AA7714\",\n },\n\n // Error colors\n colorError: {\n light: \"#D92D20\",\n dark: \"#CF3D33\",\n },\n colorErrorBg: {\n light: \"#FEF3F2\",\n dark: \"#291414\",\n },\n colorErrorBgHover: {\n light: \"#FEE4E2\",\n dark: \"#411A18\",\n },\n colorErrorBorder: {\n light: \"#FDA29B\",\n dark: \"#562222\",\n },\n colorErrorBorderHover: {\n light: \"#F97066\",\n dark: \"#772A24\",\n },\n colorErrorHover: {\n light: \"#F04438\",\n dark: \"#E5695A\",\n },\n colorErrorActive: {\n light: \"#D92D20\",\n dark: \"#A3332B\",\n },\n colorErrorTextHover: {\n light: \"#F04438\",\n dark: \"#E5695A\",\n },\n colorErrorTextActive: {\n light: \"#D92D20\",\n dark: \"#A3332B\",\n },\n\n // Fill colors\n colorFill: {\n light: \"rgba(0, 0, 0, 0.15)\",\n dark: \"rgba(255, 255, 255, 0.15)\",\n },\n colorFillSecondary: {\n light: \"rgba(0, 0, 0, 0.06)\",\n dark: \"rgba(255, 255, 255, 0.06)\",\n },\n colorFillTertiary: {\n light: \"rgba(0, 0, 0, 0.04)\",\n dark: \"rgba(255, 255, 255, 0.04)\",\n },\n colorFillQuaternary: {\n light: \"rgba(0, 0, 0, 0.02)\",\n dark: \"rgba(255, 255, 255, 0.02)\",\n },\n colorFillAlter: {\n light: \"rgba(0, 0, 0, 0.02)\",\n dark: \"rgba(255, 255, 255, 0.02)\",\n },\n\n // Border colors\n colorBorder: {\n light: \"rgba(0, 0, 0, 0.16)\",\n dark: \"rgba(255, 255, 255, 0.16)\",\n },\n colorBorderSecondary: {\n light: \"rgba(0, 0, 0, 0.06)\",\n dark: \"rgba(255, 255, 255, 0.06)\",\n },\n\n // Icon colors\n colorIcon: {\n light: \"rgba(0, 0, 0, 0.50)\",\n dark: \"rgba(255, 255, 255, 0.58)\",\n },\n colorIconHover: {\n light: \"rgba(0, 0, 0, 0.80)\",\n dark: \"rgba(255, 255, 255, 0.88)\",\n },\n colorBgBase: {\n light: \"#FFFFFF\",\n dark: \"#111113\",\n },\n\n // Background colors\n colorBgContainer: {\n light: \"#FFFFFF\",\n dark: \"#242429\",\n },\n colorBgElevated: {\n light: \"#FFFFFF\",\n dark: \"#2B2B31\",\n },\n colorBgLayout: {\n light: \"#F4F4F5\",\n dark: \"#18181B\",\n },\n colorBgSpotlight: {\n light: \"rgba(0, 0, 0, 0.85)\",\n dark: \"#484851\",\n },\n colorBgMask: {\n light: \"rgba(0, 0, 0, 0.45)\",\n dark: \"rgba(0, 0, 0, 0.45)\",\n },\n\n // Control\n controlOutline: {\n light: \"rgba(0, 0, 0, 0.12)\",\n dark: \"rgba(255, 255, 255, 0.12)\",\n },\n};\n\nconst sharedTokens: ThemeConfig[\"token\"] = {\n fontFamily: \"var(--ds-inter)\",\n fontFamilyCode: \"var(--ds-roboto-mono)\",\n fontSizeHeading1: 36,\n fontSizeHeading2: 30,\n fontSizeHeading3: 24,\n fontSizeHeading4: 20,\n fontSizeHeading5: 16,\n lineHeightHeading1: 40 / 36,\n lineHeightHeading2: 36 / 30,\n lineHeightHeading3: 32 / 24,\n lineHeightHeading4: 28 / 20,\n lineHeightHeading5: 24 / 16,\n lineHeight: 20 / 14,\n lineHeightLG: 24 / 16,\n lineHeightSM: 16 / 12,\n fontWeightStrong: 600,\n boxShadow:\n \"0px 1px 2px rgba(0, 0, 0, 0.06), 0px 1px 6px rgba(0, 0, 0, 0.04), 0px 2px 10px rgba(0, 0, 0, 0.04)\",\n boxShadowSecondary:\n \"0px 0px 1px 0px var(--ds-modal-color-border), 0px 3px 6px 1px rgba(0, 0, 0, 0.08), 0px 6px 26px 2px rgba(0, 0, 0, 0.08), 0px 4px 52px 0px rgba(0, 0, 0, 0.05)\",\n colorBgSpotlight: \"rgba(0, 0, 0, 0.85)\",\n};\n\nconst sharedThemeConfig: ThemeConfig = {\n cssVar: true,\n components: {\n Input: {\n activeBorderColor: \"var(--ds-input-color-border-active)\",\n activeShadow: \"var(--ds-input-shadow-active)\",\n errorActiveShadow: \"var(--ds-input-shadow-error-active)\",\n warningActiveShadow: \"var(--ds-input-shadow-warning-active)\",\n },\n InputNumber: {\n activeBorderColor: \"var(--ds-input-color-border-active)\",\n activeShadow: \"var(--ds-input-shadow-active)\",\n errorActiveShadow: \"var(--ds-input-shadow-error-active)\",\n warningActiveShadow: \"var(--ds-input-shadow-warning-active)\",\n },\n Button: {\n defaultShadow: undefined,\n primaryShadow: undefined,\n dangerShadow: undefined,\n },\n Select: {},\n Segmented: {\n controlHeightLG: 36,\n controlHeightSM: 24,\n },\n Breadcrumb: {\n separatorColor: \"var(--ds-color-border)\",\n },\n Slider: {\n trackBg: \"var(--ds-color-primary)\",\n trackHoverBg: \"var(--ds-color-primary-hover)\",\n trackBgDisabled: \"var(--ds-color-text-disabled)\",\n railBg: \"var(--ds-control-outline)\",\n railHoverBg: \"var(--ds-color-border)\",\n handleColor: \"var(--ds-color-primary)\",\n handleActiveColor: \"var(--ds-color-primary-active)\",\n handleColorDisabled: \"var(--ds-color-text-disabled)\",\n dotBorderColor: \"var(--ds-color-primary)\",\n dotActiveBorderColor: \"var(--ds-color-primary-active)\",\n },\n Form: {\n itemMarginBottom: 16,\n labelColor: \"var(--ds-color-text)\",\n },\n },\n};\n\n// Export theme configurations\nexport const lightTheme: ThemeConfig = {\n token: {\n ...getTokensByTheme(antdColorTokens, \"light\"),\n ...sharedTokens,\n },\n ...sharedThemeConfig,\n};\n\nexport const darkTheme: ThemeConfig = {\n token: {\n ...getTokensByTheme(antdColorTokens, \"dark\"),\n ...sharedTokens,\n },\n ...sharedThemeConfig,\n};\n"],"names":["antdColorTokens","sharedTokens","sharedThemeConfig","lightTheme","getTokensByTheme","darkTheme"],"mappings":";AAKO,MAAMA,IAA+B;AAAA;AAAA,EAE1C,WAAW;AAAA,IACT,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QAAQ;AAAA,MACN,eAAe;AAAA,MACf,eAAe;AAAA,MACf,cAAc;AAAA,IAChB;AAAA,IACA,QAAQ,CAAC;AAAA,IACT,WAAW;AAAA,MACT,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,IACnB;AAAA,IACA,YAAY;AAAA,MACV,gBAAgB;AAAA,IAClB;AAAA,IACA,QAAQ;AAAA,MACN,SAAS;AAAA,MACT,cAAc;AAAA,MACd,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,aAAa;AAAA,MACb,aAAa;AAAA,MACb,mBAAmB;AAAA,MACnB,qBAAqB;AAAA,MACrB,gBAAgB;AAAA,MAChB,sBAAsB;AAAA,IACxB;AAAA,IACA,MAAM;AAAA,MACJ,kBAAkB;AAAA,MAClB,YAAY;AAAA,IAAA;AAAA,EACd;AAEJ,GAGaC,IAA0B;AAAA,EACrC,OAAO;AAAA,IACL,GAAGC,EAAiBJ,GAAiB,OAAO;AAAA,IAC5C,GAAGC;AAAA,EACL;AAAA,EACA,GAAGC;AACL,GAEaG,IAAyB;AAAA,EACpC,OAAO;AAAA,IACL,GAAGD,EAAiBJ,GAAiB,MAAM;AAAA,IAC3C,GAAGC;AAAA,EACL;AAAA,EACA,GAAGC;AACL;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bioturing/components",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "module": "./dist/index.js",
6
6
  "main": "./dist/index.js",
@@ -62,6 +62,9 @@
62
62
  "description": "BioTuring Design system React component library",
63
63
  "scripts": {
64
64
  "build": "vite build",
65
- "dev": "vite build --watch"
65
+ "dev": "vite build --watch",
66
+ "rslib:build": "rslib build",
67
+ "rslib:dev": "rslib build --watch",
68
+ "tsdown": "tsdown"
66
69
  }
67
70
  }