@bioturing/components 0.25.0 → 0.26.2

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,12 +1,20 @@
1
1
  "use client";
2
- import { jsx as t } from "react/jsx-runtime";
2
+ import { jsx as m } from "react/jsx-runtime";
3
3
  import { Checkbox as o } from "antd";
4
- import { forwardRef as c } from "react";
4
+ import { forwardRef as i } from "react";
5
5
  import './style.css';/* empty css */
6
- const n = (r, e) => /* @__PURE__ */ t(o, { ref: e, ...r }), i = c(n), b = Object.assign(i, {
6
+ import { useCls as a } from "../utils/antdUtils.js";
7
+ import { clsx as l } from "../utils/cn.js";
8
+ const p = ({ variant: e = "default", className: r, ...c }, s) => {
9
+ const t = a(), n = l(
10
+ r,
11
+ e === "outlined" && t("checkbox-outlined")
12
+ );
13
+ return /* @__PURE__ */ m(o, { ref: s, className: n, ...c });
14
+ }, x = i(p), d = Object.assign(x, {
7
15
  Group: o.Group
8
16
  });
9
17
  export {
10
- b as Checkbox
18
+ d as Checkbox
11
19
  };
12
20
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/checkbox/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n Checkbox as AntCheckbox,\n type CheckboxProps as AntCheckboxProps,\n} from \"antd\";\nimport { forwardRef } from \"react\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define props interface extending Ant Design's CheckboxProps\nexport interface CheckboxProps extends AntCheckboxProps {}\n\n// Create inner function\nconst MainCheckboxInner = (\n props: CheckboxProps,\n ref: React.Ref<React.ComponentRef<typeof AntCheckbox>>\n) => {\n return <AntCheckbox ref={ref} {...props} />;\n};\n\n// Use forwardRef with type assertion\nconst MainCheckbox = forwardRef(MainCheckboxInner) as (\n props: CheckboxProps & {\n ref?: React.ForwardedRef<React.ComponentRef<typeof AntCheckbox>>;\n }\n) => ReturnType<typeof MainCheckboxInner>;\n\n// Create the final component with Group property\nexport const Checkbox = Object.assign(MainCheckbox, {\n Group: AntCheckbox.Group,\n});\n"],"names":["MainCheckboxInner","props","ref","jsx","AntCheckbox","MainCheckbox","forwardRef","Checkbox"],"mappings":";;;;;AAcA,MAAMA,IAAoB,CACxBC,GACAC,MAEQ,gBAAAC,EAAAC,GAAA,EAAY,KAAAF,GAAW,GAAGD,EAAO,CAAA,GAIrCI,IAAeC,EAAWN,CAAiB,GAOpCO,IAAW,OAAO,OAAOF,GAAc;AAAA,EAClD,OAAOD,EAAY;AACrB,CAAC;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/checkbox/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n Checkbox as AntCheckbox,\n type CheckboxProps as AntCheckboxProps,\n} from \"antd\";\nimport { forwardRef } from \"react\";\nimport { clsx, useCls } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define props interface extending Ant Design's CheckboxProps\nexport interface CheckboxProps extends AntCheckboxProps {\n /**\n * Checkbox appearance variant\n * @default 'default'\n */\n variant?: 'default' | 'outlined';\n}\n\n// Create inner function\nconst MainCheckboxInner = (\n { variant = 'default', className, ...props }: CheckboxProps,\n ref: React.Ref<React.ComponentRef<typeof AntCheckbox>>\n) => {\n const cls = useCls();\n const combinedClassName = clsx(\n className,\n variant === 'outlined' && cls('checkbox-outlined')\n );\n \n return <AntCheckbox ref={ref} className={combinedClassName} {...props} />;\n};\n\n// Use forwardRef with type assertion\nconst MainCheckbox = forwardRef(MainCheckboxInner) as (\n props: CheckboxProps & {\n ref?: React.ForwardedRef<React.ComponentRef<typeof AntCheckbox>>;\n }\n) => ReturnType<typeof MainCheckboxInner>;\n\n// Create the final component with Group property\nexport const Checkbox = Object.assign(MainCheckbox, {\n Group: AntCheckbox.Group,\n});\n"],"names":["MainCheckboxInner","variant","className","props","ref","cls","useCls","combinedClassName","clsx","AntCheckbox","MainCheckbox","forwardRef","Checkbox"],"mappings":";;;;;;;AAqBA,MAAMA,IAAoB,CACxB,EAAE,SAAAC,IAAU,WAAW,WAAAC,GAAW,GAAGC,EAAM,GAC3CC,MACG;AACH,QAAMC,IAAMC,EAAO,GACbC,IAAoBC;AAAA,IACxBN;AAAA,IACAD,MAAY,cAAcI,EAAI,mBAAmB;AAAA,EACnD;AAEA,2BAAQI,GAAY,EAAA,KAAAL,GAAU,WAAWG,GAAoB,GAAGJ,GAAO;AACzE,GAGMO,IAAeC,EAAWX,CAAiB,GAOpCY,IAAW,OAAO,OAAOF,GAAc;AAAA,EAClD,OAAOD,EAAY;AACrB,CAAC;"}
@@ -1 +1 @@
1
- @layer components{:is(.ds-checkbox-wrapper .ds-checkbox.ds-checkbox-indeterminate) .ds-checkbox-inner{background-color:var(--ds-color-primary)!important;border-color:var(--ds-color-primary)!important}:is(:is(.ds-checkbox-wrapper .ds-checkbox.ds-checkbox-indeterminate) .ds-checkbox-inner):after{background-color:var(--ds-color-white);height:.125rem;border-radius:.125rem}}
1
+ @layer components{:is(.ds-checkbox-wrapper .ds-checkbox.ds-checkbox-indeterminate) .ds-checkbox-inner{background-color:var(--ds-color-primary);border-color:var(--ds-color-primary)}:is(:is(.ds-checkbox-wrapper .ds-checkbox.ds-checkbox-indeterminate) .ds-checkbox-inner):after{background-color:var(--ds-color-white);height:.125rem;border-radius:.125rem}:is(.ds-checkbox-outlined.ds-checkbox-wrapper .ds-checkbox) .ds-checkbox-inner{background-color:transparent}.ds-checkbox-checked:is(.ds-checkbox-outlined.ds-checkbox-wrapper .ds-checkbox) .ds-checkbox-inner{background-color:transparent;--ds-color-border: var(--ds-color-primary);border-color:var(--ds-color-border)}:is(.ds-checkbox-checked:is(.ds-checkbox-outlined.ds-checkbox-wrapper .ds-checkbox) .ds-checkbox-inner):hover{--ds-color-border: var(--ds-color-primary-hover);border-color:var(--ds-color-border)}:is(.ds-checkbox-checked:is(.ds-checkbox-outlined.ds-checkbox-wrapper .ds-checkbox) .ds-checkbox-inner):after{border-color:var(--ds-color-primary)}.ds-checkbox-indeterminate:is(.ds-checkbox-outlined.ds-checkbox-wrapper .ds-checkbox) .ds-checkbox-inner{background-color:transparent;--ds-color-border: var(--ds-color-primary)}:is(.ds-checkbox-indeterminate:is(.ds-checkbox-outlined.ds-checkbox-wrapper .ds-checkbox) .ds-checkbox-inner):after{background-color:var(--ds-color-primary)}:is(.ds-checkbox-checked:is(.ds-checkbox-outlined.ds-checkbox-wrapper .ds-checkbox):hover,.ds-checkbox-indeterminate:is(.ds-checkbox-outlined.ds-checkbox-wrapper .ds-checkbox):hover) .ds-checkbox-inner{background-color:transparent;border-color:var( --ds-color-primary-hover, var(--ds-color-primary) )}}
@@ -1,40 +1,43 @@
1
1
  "use client";
2
- import { jsx as e } from "react/jsx-runtime";
3
- import f from "antd/es/form/FormItem";
4
- import { FormLabel as s } from "./label.js";
5
- import { isPlainObject as c } from "es-toolkit";
6
- const k = ({
7
- tooltip: n,
2
+ import { jsx as a } from "react/jsx-runtime";
3
+ import q from "antd/es/form/FormItem";
4
+ import { FormLabel as F } from "./label.js";
5
+ import { isPlainObject as b } from "es-toolkit";
6
+ const L = ({
7
+ tooltip: p,
8
8
  label: t,
9
- optionalMark: a = !1,
10
- requiredMark: p = !0,
11
- required: i,
9
+ optionalMark: d = !1,
10
+ requiredMark: s = !0,
11
+ labelRender: i,
12
+ required: m,
12
13
  rules: o,
13
- ...d
14
+ children: c,
15
+ ...f
14
16
  }) => {
15
- const m = i || (o == null ? void 0 : o.some(
16
- (r) => c(r) && "required" in r && r.required
17
- ));
18
- return /* @__PURE__ */ e(
19
- f,
17
+ const e = m || (o == null ? void 0 : o.some(
18
+ (r) => b(r) && "required" in r && r.required
19
+ )), n = t ? /* @__PURE__ */ a(
20
+ F,
20
21
  {
21
- required: i,
22
- label: t ? /* @__PURE__ */ e(
23
- s,
24
- {
25
- label: t,
26
- tooltip: n,
27
- optionalMark: !m && a,
28
- requiredMark: m && p,
29
- as: "span"
30
- }
31
- ) : void 0,
22
+ label: t,
23
+ tooltip: p,
24
+ optionalMark: !e && d,
25
+ requiredMark: e && s,
26
+ as: "span"
27
+ }
28
+ ) : void 0;
29
+ return /* @__PURE__ */ a(
30
+ q,
31
+ {
32
+ required: m,
33
+ label: i ? i(n) : n,
32
34
  rules: o,
33
- ...d
35
+ ...f,
36
+ children: c
34
37
  }
35
38
  );
36
39
  };
37
40
  export {
38
- k as FormItem
41
+ L as FormItem
39
42
  };
40
43
  //# sourceMappingURL=item.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.js","sources":["../../../src/components/form/item.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntdFormItem,\n type FormItemProps as AntdFormItemProps,\n} from \"antd/es/form/FormItem\";\nimport { FormLabel } from \"./label\";\nimport { isPlainObject } from \"es-toolkit\";\n\nexport interface FormItemProps<Values = unknown>\n extends AntdFormItemProps<Values> {\n // tooltip?: React.ReactNode | TooltipProps;\n /**\n * Whether show the optional mark. By default, optional item will not show the optional mark.\n * @default false\n */\n optionalMark?: boolean | React.ReactNode;\n /**\n * Whether show the asterisk when the field is required\n * @default true\n */\n requiredMark?: boolean | React.ReactNode;\n}\n\nexport const FormItem = <Values = unknown,>({\n tooltip,\n label,\n optionalMark = false,\n requiredMark = true,\n required,\n rules,\n ...rest\n}: FormItemProps<Values>) => {\n const isRequired =\n required ||\n rules?.some(\n (rule) => isPlainObject(rule) && \"required\" in rule && rule.required\n );\n return (\n <AntdFormItem\n required={required}\n label={\n label ? (\n <FormLabel\n label={label}\n tooltip={tooltip}\n optionalMark={!isRequired && optionalMark}\n requiredMark={isRequired && requiredMark}\n as=\"span\"\n />\n ) : undefined\n }\n rules={rules}\n {...rest}\n />\n );\n};\n"],"names":["FormItem","tooltip","label","optionalMark","requiredMark","required","rules","rest","isRequired","rule","isPlainObject","jsx","AntdFormItem","FormLabel"],"mappings":";;;;;AAuBO,MAAMA,IAAW,CAAoB;AAAA,EAC1C,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,cAAAC,IAAe;AAAA,EACf,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,MAA6B;AACrB,QAAAC,IACJH,MACAC,KAAA,gBAAAA,EAAO;AAAA,IACL,CAACG,MAASC,EAAcD,CAAI,KAAK,cAAcA,KAAQA,EAAK;AAAA;AAG9D,SAAA,gBAAAE;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,UAAAP;AAAA,MACA,OACEH,IACE,gBAAAS;AAAA,QAACE;AAAA,QAAA;AAAA,UACC,OAAAX;AAAA,UACA,SAAAD;AAAA,UACA,cAAc,CAACO,KAAcL;AAAA,UAC7B,cAAcK,KAAcJ;AAAA,UAC5B,IAAG;AAAA,QAAA;AAAA,MAAA,IAEH;AAAA,MAEN,OAAAE;AAAA,MACC,GAAGC;AAAA,IAAA;AAAA,EACN;AAEJ;"}
1
+ {"version":3,"file":"item.js","sources":["../../../src/components/form/item.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntdFormItem,\n type FormItemProps as AntdFormItemProps,\n} from \"antd/es/form/FormItem\";\nimport { FormLabel } from \"./label\";\nimport { isPlainObject } from \"es-toolkit\";\nimport type React from \"react\";\n\nexport interface FormItemProps<Values = unknown>\n extends Omit<AntdFormItemProps<Values>, \"children\"> {\n // tooltip?: React.ReactNode | TooltipProps;\n /**\n * Whether show the optional mark. By default, optional item will not show the optional mark.\n * @default false\n */\n optionalMark?: boolean | React.ReactNode;\n /**\n * Whether show the asterisk when the field is required\n * @default true\n */\n requiredMark?: boolean | React.ReactNode;\n /**\n * Custom render function for the label\n */\n labelRender?: (label: React.ReactElement) => React.ReactElement;\n /**\n * Form item children - can be React nodes or render functions\n */\n children?: AntdFormItemProps<Values>[\"children\"];\n}\n\nexport const FormItem = <Values = unknown,>({\n tooltip,\n label,\n optionalMark = false,\n requiredMark = true,\n labelRender,\n required,\n rules,\n children,\n ...rest\n}: FormItemProps<Values>) => {\n const isRequired =\n required ||\n rules?.some(\n (rule) => isPlainObject(rule) && \"required\" in rule && rule.required\n );\n const renderedLabel = label ? (\n <FormLabel\n label={label}\n tooltip={tooltip}\n optionalMark={!isRequired && optionalMark}\n requiredMark={isRequired && requiredMark}\n as=\"span\"\n />\n ) : undefined;\n\n return (\n <AntdFormItem\n required={required}\n label={labelRender ? labelRender(renderedLabel) : renderedLabel}\n rules={rules}\n {...rest}\n >\n {children}\n </AntdFormItem>\n );\n};\n"],"names":["FormItem","tooltip","label","optionalMark","requiredMark","labelRender","required","rules","children","rest","isRequired","rule","isPlainObject","renderedLabel","jsx","FormLabel","AntdFormItem"],"mappings":";;;;;AAgCO,MAAMA,IAAW,CAAoB;AAAA,EAC1C,SAAAC;AAAA,EACA,OAAAC;AAAA,EACA,cAAAC,IAAe;AAAA,EACf,cAAAC,IAAe;AAAA,EACf,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAA6B;AACrB,QAAAC,IACJJ,MACAC,KAAA,gBAAAA,EAAO;AAAA,IACL,CAACI,MAASC,EAAcD,CAAI,KAAK,cAAcA,KAAQA,EAAK;AAAA,MAE1DE,IAAgBX,IACpB,gBAAAY;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAAb;AAAA,MACA,SAAAD;AAAA,MACA,cAAc,CAACS,KAAcP;AAAA,MAC7B,cAAcO,KAAcN;AAAA,MAC5B,IAAG;AAAA,IAAA;AAAA,EAAA,IAEH;AAGF,SAAA,gBAAAU;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,UAAAV;AAAA,MACA,OAAOD,IAAcA,EAAYQ,CAAa,IAAIA;AAAA,MAClD,OAAAN;AAAA,MACC,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EACH;AAEJ;"}
@@ -1 +1 @@
1
- @layer components{.ds-form-item-label-inner{display:inline-flex;align-items:center;gap:.25rem}.ds-form-item-label-optional-mark{color:var(--ds-color-text-tertiary)}:is(.ds-form-item-label>label.ds-form-item-required):after{display:none}:is(.ds-form-item-label>label.ds-form-item-required):before{display:none}.ds-form-item-label-required-mark{display:inline-block;font-size:var(--ds-font-size);font-family:Inter,sans-serif;line-height:1;content:"*"}.ds-form-item-label-required-mark.ds-form-item-label-required-mark-asterisk{color:var(--ds-form-label-required-mark-color)}.ds-form-item .ds-form-item-label>label:after{display:none}.ds-form-horizontal .ds-form-item .ds-form-item-label .ds-form-item-label-inner:after{content:":";position:relative;margin-block:0;margin-inline-start:var(--ds-form-label-colon-margin-inline-start);margin-inline-end:var(--ds-form-label-colon-margin-inline-end)}.ds-form-item-explain{margin-top:.25rem}.ds-form-item-margin-offset{margin:0!important}}
1
+ @layer components{.ds-form-item-label-inner{display:inline-flex;align-items:center;gap:.25rem}.ds-form-item-label-optional-mark{color:var(--ds-color-text-tertiary)}:is(.ds-form-item-label>label.ds-form-item-required):after{display:none}:is(.ds-form-item-label>label.ds-form-item-required):before{display:none}.ds-form-item-label-required-mark{display:inline-block;font-size:var(--ds-font-size);font-family:Inter,sans-serif;line-height:1;content:"*"}.ds-form-item-label-required-mark.ds-form-item-label-required-mark-asterisk{color:var(--ds-form-label-required-mark-color)}.ds-form-item .ds-form-item-label>label:after{display:none}.ds-form-horizontal .ds-form-item .ds-form-item-label .ds-form-item-label-inner:after{content:":";position:relative;margin-block:0;margin-inline-start:var(--ds-form-label-colon-margin-inline-start);margin-inline-end:var(--ds-form-label-colon-margin-inline-end)}.ds-form-item-explain{margin-top:.25rem}.ds-form-item-margin-offset{margin:0!important}.ds-form-item-label{overflow:visible}.ds-form-item-row .ds-form-item-label label{width:100%}}
@@ -1,41 +1,12 @@
1
1
  "use client";
2
- import { jsx as l } from "react/jsx-runtime";
3
- import n from "antd/es/splitter/Splitter";
4
- import p from "antd/es/splitter/Panel";
2
+ import { MainSplitter as t } from "./splitter.js";
3
+ import { SplitterPanel as i } from "./splitter-panel.js";
5
4
  import './style.css';/* empty css */
6
- import { useCls as m } from "../utils/antdUtils.js";
7
- import { clsx as c } from "../utils/cn.js";
8
- const a = ({
9
- children: t,
10
- className: r,
11
- style: e,
12
- ...i
13
- }) => /* @__PURE__ */ l(p, { className: r, style: e, ...i, children: t }), S = ({
14
- children: t,
15
- className: r = "",
16
- style: e = {},
17
- showSplitBar: i = !0,
18
- ...o
19
- }) => {
20
- const s = m();
21
- return /* @__PURE__ */ l(
22
- n,
23
- {
24
- className: c(
25
- s("splitter"),
26
- !i && s("splitter-hidden-split-bar"),
27
- r
28
- ),
29
- style: e,
30
- ...o,
31
- children: t
32
- }
33
- );
34
- }, f = Object.assign(S, {
35
- Panel: a
36
- }), A = f;
5
+ const e = Object.assign(t, {
6
+ Panel: i
7
+ }), l = e;
37
8
  export {
38
- A as Split,
39
- f as Splitter
9
+ l as Split,
10
+ e as Splitter
40
11
  };
41
12
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../../src/components/splitter/component.tsx"],"sourcesContent":["\"use client\";\nimport React from \"react\";\nimport { default as AntdSplitter } from \"antd/es/splitter/Splitter\";\nimport { default as AntdSplitterPanel } from \"antd/es/splitter/Panel\";\nimport type {\n SplitterProps as AntdSplitterProps,\n PanelProps as AntdSplitterPanelProps,\n} from \"antd/es/splitter/interface\";\nimport { useCls, clsx } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport type SplitterProps = React.PropsWithChildren<AntdSplitterProps> & {\n showSplitBar?: boolean;\n};\n\nexport type SplitterPanelProps =\n React.PropsWithChildren<AntdSplitterPanelProps>;\n\nconst SplitterPanel: React.FC<SplitterPanelProps> = ({\n children,\n className,\n style,\n ...rest\n}) => {\n return (\n <AntdSplitterPanel className={className} style={style} {...rest}>\n {children}\n </AntdSplitterPanel>\n );\n};\n\nconst MainSplitter: React.FC<SplitterProps> = ({\n children,\n className = \"\",\n style = {},\n showSplitBar = true,\n ...rest\n}) => {\n const cls = useCls();\n return (\n <AntdSplitter\n className={clsx(\n cls(\"splitter\"),\n !showSplitBar && cls(\"splitter-hidden-split-bar\"),\n className\n )}\n style={style}\n {...rest}\n >\n {children}\n </AntdSplitter>\n );\n};\n\nexport const Splitter = Object.assign(MainSplitter, {\n Panel: SplitterPanel,\n});\n\n// For backward compatibility\nexport const Split = Splitter;\n"],"names":["SplitterPanel","children","className","style","rest","AntdSplitterPanel","MainSplitter","showSplitBar","cls","useCls","jsx","AntdSplitter","clsx","Splitter","Split"],"mappings":";;;;;;;AAoBA,MAAMA,IAA8C,CAAC;AAAA,EACnD,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,GAAGC;AACL,wBAEKC,GAAkB,EAAA,WAAAH,GAAsB,OAAAC,GAAe,GAAGC,GACxD,UAAAH,GACH,GAIEK,IAAwC,CAAC;AAAA,EAC7C,UAAAL;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,OAAAC,IAAQ,CAAC;AAAA,EACT,cAAAI,IAAe;AAAA,EACf,GAAGH;AACL,MAAM;AACJ,QAAMI,IAAMC,EAAO;AAEjB,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTJ,EAAI,UAAU;AAAA,QACd,CAACD,KAAgBC,EAAI,2BAA2B;AAAA,QAChDN;AAAA,MACF;AAAA,MACA,OAAAC;AAAA,MACC,GAAGC;AAAA,MAEH,UAAAH;AAAA,IAAA;AAAA,EACH;AAEJ,GAEaY,IAAW,OAAO,OAAOP,GAAc;AAAA,EAClD,OAAON;AACT,CAAC,GAGYc,IAAQD;"}
1
+ {"version":3,"file":"component.js","sources":["../../../src/components/splitter/component.tsx"],"sourcesContent":["\"use client\";\nimport { MainSplitter, type SplitterProps } from \"./splitter\";\nimport { SplitterPanel, type SplitterPanelProps } from \"./splitter-panel\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Export types\nexport type { SplitterProps, SplitterPanelProps };\n\n// Create the compound component\nexport const Splitter = Object.assign(MainSplitter, {\n Panel: SplitterPanel,\n});\n\n// For backward compatibility\nexport const Split = Splitter;\n"],"names":["Splitter","MainSplitter","SplitterPanel","Split"],"mappings":";;;;AAWa,MAAAA,IAAW,OAAO,OAAOC,GAAc;AAAA,EAClD,OAAOC;AACT,CAAC,GAGYC,IAAQH;"}
@@ -0,0 +1,6 @@
1
+ import t from "react";
2
+ const o = t.createContext({});
3
+ export {
4
+ o as SplitterContext
5
+ };
6
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sources":["../../../src/components/splitter/context.ts"],"sourcesContent":["import React from \"react\";\n\n// Context to provide layout direction to panels\nexport const SplitterContext = React.createContext<{ layout?: 'horizontal' | 'vertical' }>({});"],"names":["SplitterContext","React"],"mappings":";AAGO,MAAMA,IAAkBC,EAAM,cAAsD,CAAE,CAAA;"}
@@ -0,0 +1,52 @@
1
+ "use client";
2
+ import { jsx as v } from "react/jsx-runtime";
3
+ import u, { useRef as z, useState as E, useContext as R, useEffect as w } from "react";
4
+ import { SplitterContext as I } from "./context.js";
5
+ import { InternalPanel as N } from "antd/es/splitter/Panel";
6
+ import { useCls as M } from "../utils/antdUtils.js";
7
+ import { clsx as O } from "../utils/cn.js";
8
+ const V = ({
9
+ children: o,
10
+ className: p,
11
+ style: f,
12
+ defaultSize: t,
13
+ ...h
14
+ }) => {
15
+ const y = M(), s = z(null), [d, C] = E(), { layout: i = "horizontal" } = R(I), n = t === "max-content" || t === "min-content" || t === "fit-content";
16
+ w(() => {
17
+ if (!n || !s.current)
18
+ return;
19
+ const r = s.current, l = () => {
20
+ const e = r.cloneNode(!0);
21
+ e.style.position = "absolute", e.style.visibility = "hidden", e.style.pointerEvents = "none", e.style.zIndex = "-1", e.style.top = "0", e.style.left = "0", i === "horizontal" ? (e.style.width = t, e.style.height = "100%") : (e.style.width = "100%", e.style.height = t), document.body.appendChild(e);
22
+ const m = e.getBoundingClientRect(), a = i === "horizontal" ? m.width : m.height;
23
+ document.body.removeChild(e), a > 0 && C(Math.ceil(a));
24
+ }, g = setTimeout(l, 0), c = new ResizeObserver(() => {
25
+ l();
26
+ });
27
+ return c.observe(r), () => {
28
+ clearTimeout(g), c.disconnect();
29
+ };
30
+ }, [n, i, o, t]);
31
+ const b = n ? d : t, x = O(
32
+ p,
33
+ n && y(`splitter-panel-${t}`)
34
+ );
35
+ return /* @__PURE__ */ v(
36
+ N,
37
+ {
38
+ className: x,
39
+ style: f,
40
+ defaultSize: b,
41
+ ...h,
42
+ children: n && u.isValidElement(o) ? u.cloneElement(
43
+ o,
44
+ { ref: s }
45
+ ) : o
46
+ }
47
+ );
48
+ };
49
+ export {
50
+ V as SplitterPanel
51
+ };
52
+ //# sourceMappingURL=splitter-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splitter-panel.js","sources":["../../../src/components/splitter/splitter-panel.tsx"],"sourcesContent":["\"use client\";\nimport React, { useEffect, useRef, useState, useContext } from \"react\";\nimport { useCls, clsx } from \"../utils\";\nimport { SplitterContext } from \"./context\";\nimport { InternalPanel } from \"antd/es/splitter/Panel\";\nimport type { InternalPanelProps } from \"antd/es/splitter/interface\";\n\nexport type SplitterPanelProps = InternalPanelProps & {\n children?: React.ReactNode | undefined;\n} & React.RefAttributes<HTMLDivElement> & {\n /**\n * Default size of the panel. Can be a percentage string, number, or CSS intrinsic sizing values\n */\n defaultSize?: string | number | \"max-content\" | \"min-content\" | \"fit-content\";\n };\n\nexport const SplitterPanel: React.FC<SplitterPanelProps> = ({\n children,\n className,\n style,\n defaultSize,\n ...rest\n}) => {\n const cls = useCls();\n const contentRef = useRef<HTMLDivElement>(null);\n const [measuredSize, setMeasuredSize] = useState<number | undefined>();\n const { layout = \"horizontal\" } = useContext(SplitterContext);\n\n // Handle intrinsic sizing\n const isIntrinsicSizing = defaultSize === \"max-content\" || defaultSize === \"min-content\" || defaultSize === \"fit-content\";\n\n useEffect(() => {\n if (!isIntrinsicSizing) {\n return;\n }\n\n if (!contentRef.current) {\n return;\n }\n\n const element = contentRef.current;\n const measureContent = () => {\n // Clone the entire element to preserve all styles including padding, borders, etc.\n const clonedElement = element.cloneNode(true) as HTMLElement;\n \n // Set up the cloned element for measurement\n clonedElement.style.position = \"absolute\";\n clonedElement.style.visibility = \"hidden\";\n clonedElement.style.pointerEvents = \"none\";\n clonedElement.style.zIndex = \"-1\";\n clonedElement.style.top = \"0\";\n clonedElement.style.left = \"0\";\n\n if (layout === \"horizontal\") {\n clonedElement.style.width = defaultSize as string;\n clonedElement.style.height = \"100%\";\n } else {\n clonedElement.style.width = \"100%\";\n clonedElement.style.height = defaultSize as string;\n }\n\n document.body.appendChild(clonedElement);\n\n const rect = clonedElement.getBoundingClientRect();\n const size = layout === \"horizontal\" ? rect.width : rect.height;\n\n document.body.removeChild(clonedElement);\n\n if (size > 0) {\n setMeasuredSize(Math.ceil(size));\n }\n };\n\n // Small delay to ensure content is rendered\n const timeoutId = setTimeout(measureContent, 0);\n\n // Use ResizeObserver to track content size changes\n const resizeObserver = new ResizeObserver(() => {\n measureContent();\n });\n\n resizeObserver.observe(element);\n\n return () => {\n clearTimeout(timeoutId);\n resizeObserver.disconnect();\n };\n }, [isIntrinsicSizing, layout, children, defaultSize]);\n\n const finalDefaultSize = isIntrinsicSizing ? measuredSize : defaultSize;\n const finalClassName = clsx(\n className,\n isIntrinsicSizing && cls(`splitter-panel-${defaultSize}`)\n );\n\n return (\n <InternalPanel\n className={finalClassName}\n style={style}\n defaultSize={finalDefaultSize}\n {...rest}\n >\n {isIntrinsicSizing && React.isValidElement(children)\n ? React.cloneElement(\n children as React.ReactElement<React.RefAttributes<HTMLElement>>,\n { ref: contentRef }\n )\n : children}\n </InternalPanel>\n );\n};\n"],"names":["SplitterPanel","children","className","style","defaultSize","rest","cls","useCls","contentRef","useRef","measuredSize","setMeasuredSize","useState","layout","useContext","SplitterContext","isIntrinsicSizing","useEffect","element","measureContent","clonedElement","rect","size","timeoutId","resizeObserver","finalDefaultSize","finalClassName","clsx","jsx","InternalPanel","React"],"mappings":";;;;;;;AAgBO,MAAMA,IAA8C,CAAC;AAAA,EAC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BT,IAAoBN,IAAeN,GACtDsB,IAAiBC;AAAA,IACrBzB;AAAA,IACAc,KAAqBV,EAAI,kBAAkBF,CAAW,EAAE;AAAA,EAC1D;AAGE,SAAA,gBAAAwB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWH;AAAA,MACX,OAAAvB;AAAA,MACA,aAAasB;AAAA,MACZ,GAAGpB;AAAA,MAEH,UAAqBW,KAAAc,EAAM,eAAe7B,CAAQ,IAC/C6B,EAAM;AAAA,QACJ7B;AAAA,QACA,EAAE,KAAKO,EAAW;AAAA,MAAA,IAEpBP;AAAA,IAAA;AAAA,EACN;AAEJ;"}
@@ -0,0 +1,157 @@
1
+ import { jsx as c, jsxs as I } from "react/jsx-runtime";
2
+ import O, { useState as Se } from "react";
3
+ import ue from "rc-resize-observer";
4
+ import { useEvent as u } from "rc-util";
5
+ import { devUseWarning as ze } from "antd/es/_util/warning";
6
+ import { useComponentConfig as Ce } from "antd/es/config-provider/context";
7
+ import he from "antd/es/config-provider/hooks/useCSSVarCls";
8
+ import de from "antd/es/splitter/hooks/useItems";
9
+ import ge from "antd/es/splitter/hooks/useResizable";
10
+ import ve from "antd/es/splitter/hooks/useResize";
11
+ import Ne from "antd/es/splitter/hooks/useSizes";
12
+ import { SplitterPanel as be } from "./splitter-panel.js";
13
+ import Me from "antd/es/splitter/SplitBar";
14
+ import xe from "antd/es/splitter/style";
15
+ import { SplitterContext as ye } from "./context.js";
16
+ import { clsx as P } from "../utils/cn.js";
17
+ const Ie = ($) => {
18
+ const {
19
+ prefixCls: E,
20
+ className: V,
21
+ style: U,
22
+ layout: f = "horizontal",
23
+ children: k,
24
+ rootClassName: w,
25
+ onResizeStart: z,
26
+ onResize: n,
27
+ onResizeEnd: o,
28
+ lazy: B,
29
+ showSplitBar: W = !0
30
+ } = $, {
31
+ getPrefixCls: j,
32
+ direction: D,
33
+ className: R,
34
+ style: _
35
+ } = Ce("splitter"), i = j("splitter", E), v = he(i), [q, F, H] = xe(i, v), m = f === "vertical", p = D === "rtl", L = !m && p, a = de(k);
36
+ if (process.env.NODE_ENV !== "production") {
37
+ const t = ze("Splitter");
38
+ let e = !1, s = !1;
39
+ a.forEach((r) => {
40
+ r.size !== void 0 ? e = !0 : s = !0;
41
+ }), e && s && !n && t(
42
+ !1,
43
+ "usage",
44
+ "When part of `Splitter.Panel` has `size`, `onResize` is required or change `size` to `defaultSize`."
45
+ );
46
+ }
47
+ const [C, T] = Se(), A = (t) => {
48
+ const { offsetWidth: e, offsetHeight: s } = t, r = m ? s : e;
49
+ r !== 0 && T(r);
50
+ }, [
51
+ G,
52
+ h,
53
+ d,
54
+ N,
55
+ b,
56
+ J
57
+ ] = Ne(a, C), M = ge(a, h, p), [K, Q, X, Y, x] = ve(
58
+ a,
59
+ M,
60
+ d,
61
+ C,
62
+ J,
63
+ p
64
+ ), Z = u((t) => {
65
+ K(t), z == null || z(h);
66
+ }), ee = u(
67
+ (t, e, s) => {
68
+ const r = Q(t, e);
69
+ s ? o == null || o(r) : n == null || n(r);
70
+ }
71
+ ), te = u((t) => {
72
+ X(), t || o == null || o(h);
73
+ }), se = u(
74
+ (t, e) => {
75
+ const s = Y(t, e);
76
+ n == null || n(s), o == null || o(s);
77
+ }
78
+ ), re = P(
79
+ i,
80
+ V,
81
+ `${i}-${f}`,
82
+ {
83
+ [`${i}-rtl`]: p,
84
+ [`${i}-hide-bars`]: !W
85
+ },
86
+ w,
87
+ R,
88
+ H,
89
+ v,
90
+ F
91
+ ), y = `${i}-mask`, l = O.useMemo(() => {
92
+ const t = [];
93
+ let e = 0;
94
+ for (let s = 0; s < a.length; s += 1)
95
+ e += d[s], t.push(e);
96
+ return t;
97
+ }, [d]), oe = { ..._, ...U };
98
+ return q(
99
+ /* @__PURE__ */ c(ye.Provider, { value: { layout: f }, children: /* @__PURE__ */ c(ue, { onResize: A, children: /* @__PURE__ */ I("div", { style: oe, className: re, children: [
100
+ a.map((t, e) => {
101
+ const s = /* @__PURE__ */ c(
102
+ be,
103
+ {
104
+ ...t,
105
+ prefixCls: i,
106
+ size: G[e]
107
+ }
108
+ );
109
+ let r = null;
110
+ const S = M[e];
111
+ if (S) {
112
+ const ie = (l[e - 1] || 0) + N[e], ne = (l[e + 1] || 100) - b[e + 1], ae = (l[e - 1] || 0) + b[e], le = (l[e + 1] || 100) - N[e + 1];
113
+ r = /* @__PURE__ */ c(
114
+ Me,
115
+ {
116
+ lazy: B,
117
+ index: e,
118
+ active: x === e,
119
+ prefixCls: i,
120
+ vertical: m,
121
+ resizable: S.resizable,
122
+ ariaNow: l[e] * 100,
123
+ ariaMin: Math.max(ie, ne) * 100,
124
+ ariaMax: Math.min(ae, le) * 100,
125
+ startCollapsible: S.startCollapsible,
126
+ endCollapsible: S.endCollapsible,
127
+ onOffsetStart: Z,
128
+ onOffsetUpdate: (ce, fe, me, pe) => {
129
+ let g = m ? me : fe;
130
+ L && (g = -g), ee(ce, g, pe);
131
+ },
132
+ onOffsetEnd: te,
133
+ onCollapse: se,
134
+ containerSize: C || 0
135
+ }
136
+ );
137
+ }
138
+ return /* @__PURE__ */ I(O.Fragment, { children: [
139
+ s,
140
+ r
141
+ ] }, `split-panel-${e}`);
142
+ }),
143
+ typeof x == "number" && /* @__PURE__ */ c(
144
+ "div",
145
+ {
146
+ "aria-hidden": !0,
147
+ className: P(y, `${y}-${f}`)
148
+ }
149
+ )
150
+ ] }) }) })
151
+ );
152
+ };
153
+ process.env.NODE_ENV !== "production" && (Ie.displayName = "Splitter");
154
+ export {
155
+ Ie as MainSplitter
156
+ };
157
+ //# sourceMappingURL=splitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"splitter.js","sources":["../../../src/components/splitter/splitter.tsx"],"sourcesContent":["import React, { useState } from \"react\";\nimport { clsx } from \"../utils\";\nimport ResizeObserver from \"rc-resize-observer\";\nimport { useEvent } from \"rc-util\";\n\nimport type { GetProp } from \"antd/es/_util/type\";\nimport { devUseWarning } from \"antd/es/_util/warning\";\nimport { useComponentConfig } from \"antd/es/config-provider/context\";\nimport useCSSVarCls from \"antd/es/config-provider/hooks/useCSSVarCls\";\nimport useItems from \"antd/es/splitter/hooks/useItems\";\nimport useResizable from \"antd/es/splitter/hooks/useResizable\";\nimport useResize from \"antd/es/splitter/hooks/useResize\";\nimport useSizes from \"antd/es/splitter/hooks/useSizes\";\nimport type { SplitterProps as AntdSplitterProps } from \"antd/es/splitter/interface\";\nimport { SplitterPanel } from \"./splitter-panel\";\nimport SplitBar from \"antd/es/splitter/SplitBar\";\nimport useStyle from \"antd/es/splitter/style\";\nimport { SplitterContext } from \"./context\";\n\nexport interface SplitterProps extends AntdSplitterProps {\n /**\n * Whether to show the split bars between panels\n * @default true\n */\n showSplitBar?: boolean;\n}\n\nexport const MainSplitter: React.FC<React.PropsWithChildren<SplitterProps>> = (\n props\n) => {\n const {\n prefixCls: customizePrefixCls,\n className,\n style,\n layout = \"horizontal\",\n children,\n rootClassName,\n onResizeStart,\n onResize,\n onResizeEnd,\n lazy,\n showSplitBar = true,\n } = props;\n\n const {\n getPrefixCls,\n direction,\n className: contextClassName,\n style: contextStyle,\n } = useComponentConfig(\"splitter\");\n const prefixCls = getPrefixCls(\"splitter\", customizePrefixCls);\n const rootCls = useCSSVarCls(prefixCls);\n const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls, rootCls);\n\n // ======================== Direct ========================\n const isVertical = layout === \"vertical\";\n const isRTL = direction === \"rtl\";\n const reverse = !isVertical && isRTL;\n\n // ====================== Items Data ======================\n const items = useItems(children);\n\n // >>> Warning for uncontrolled\n if (process.env.NODE_ENV !== \"production\") {\n const warning = devUseWarning(\"Splitter\");\n\n let existSize = false;\n let existUndefinedSize = false;\n\n items.forEach((item) => {\n if (item.size !== undefined) {\n existSize = true;\n } else {\n existUndefinedSize = true;\n }\n });\n\n if (existSize && existUndefinedSize && !onResize) {\n warning(\n false,\n \"usage\",\n \"When part of `Splitter.Panel` has `size`, `onResize` is required or change `size` to `defaultSize`.\"\n );\n }\n }\n\n // ====================== Container =======================\n const [containerSize, setContainerSize] = useState<number | undefined>();\n\n const onContainerResize: GetProp<typeof ResizeObserver, \"onResize\"> = (\n size\n ) => {\n const { offsetWidth, offsetHeight } = size;\n const containerSize = isVertical ? offsetHeight : offsetWidth;\n // Skip when container has no size, Such as nested in a hidden tab panel\n // to fix: https://github.com/ant-design/ant-design/issues/51106\n if (containerSize === 0) {\n return;\n }\n setContainerSize(containerSize);\n };\n\n // ========================= Size =========================\n const [\n panelSizes,\n itemPxSizes,\n itemPtgSizes,\n itemPtgMinSizes,\n itemPtgMaxSizes,\n updateSizes,\n ] = useSizes(items, containerSize);\n\n // ====================== Resizable =======================\n const resizableInfos = useResizable(items, itemPxSizes, isRTL);\n\n const [onOffsetStart, onOffsetUpdate, onOffsetEnd, onCollapse, movingIndex] =\n useResize(\n items,\n resizableInfos,\n itemPtgSizes,\n containerSize,\n updateSizes,\n isRTL\n );\n\n // ======================== Events ========================\n const onInternalResizeStart = useEvent((index: number) => {\n onOffsetStart(index);\n onResizeStart?.(itemPxSizes);\n });\n\n const onInternalResizeUpdate = useEvent(\n (index: number, offset: number, lazyEnd?: boolean) => {\n const nextSizes = onOffsetUpdate(index, offset);\n\n if (lazyEnd) {\n onResizeEnd?.(nextSizes);\n } else {\n onResize?.(nextSizes);\n }\n }\n );\n\n const onInternalResizeEnd = useEvent((lazyEnd?: boolean) => {\n onOffsetEnd();\n\n if (!lazyEnd) {\n onResizeEnd?.(itemPxSizes);\n }\n });\n\n const onInternalCollapse = useEvent(\n (index: number, type: \"start\" | \"end\") => {\n const nextSizes = onCollapse(index, type);\n onResize?.(nextSizes);\n onResizeEnd?.(nextSizes);\n }\n );\n\n // ======================== Styles ========================\n const containerClassName = clsx(\n prefixCls,\n className,\n `${prefixCls}-${layout}`,\n {\n [`${prefixCls}-rtl`]: isRTL,\n [`${prefixCls}-hide-bars`]: !showSplitBar,\n },\n rootClassName,\n contextClassName,\n cssVarCls,\n rootCls,\n hashId\n );\n\n // ======================== Render ========================\n const maskCls = `${prefixCls}-mask`;\n\n const stackSizes = React.useMemo(() => {\n const mergedSizes: number[] = [];\n\n let stack = 0;\n for (let i = 0; i < items.length; i += 1) {\n stack += itemPtgSizes[i];\n mergedSizes.push(stack);\n }\n\n return mergedSizes;\n }, [itemPtgSizes]);\n\n const mergedStyle: React.CSSProperties = { ...contextStyle, ...style };\n\n return wrapCSSVar(\n <SplitterContext.Provider value={{ layout }}>\n <ResizeObserver onResize={onContainerResize}>\n <div style={mergedStyle} className={containerClassName}>\n {items.map((item, idx) => {\n // Panel\n const panel = (\n <SplitterPanel\n {...item}\n prefixCls={prefixCls}\n size={panelSizes[idx]}\n />\n );\n\n // Split Bar\n let splitBar: React.ReactElement | null = null;\n\n const resizableInfo = resizableInfos[idx];\n if (resizableInfo) {\n const ariaMinStart =\n (stackSizes[idx - 1] || 0) + itemPtgMinSizes[idx];\n const ariaMinEnd =\n (stackSizes[idx + 1] || 100) - itemPtgMaxSizes[idx + 1];\n\n const ariaMaxStart =\n (stackSizes[idx - 1] || 0) + itemPtgMaxSizes[idx];\n const ariaMaxEnd =\n (stackSizes[idx + 1] || 100) - itemPtgMinSizes[idx + 1];\n\n splitBar = (\n <SplitBar\n lazy={lazy}\n index={idx}\n active={movingIndex === idx}\n prefixCls={prefixCls}\n vertical={isVertical}\n resizable={resizableInfo.resizable}\n ariaNow={stackSizes[idx] * 100}\n ariaMin={Math.max(ariaMinStart, ariaMinEnd) * 100}\n ariaMax={Math.min(ariaMaxStart, ariaMaxEnd) * 100}\n startCollapsible={resizableInfo.startCollapsible}\n endCollapsible={resizableInfo.endCollapsible}\n onOffsetStart={onInternalResizeStart}\n onOffsetUpdate={(index, offsetX, offsetY, lazyEnd) => {\n let offset = isVertical ? offsetY : offsetX;\n if (reverse) {\n offset = -offset;\n }\n onInternalResizeUpdate(index, offset, lazyEnd);\n }}\n onOffsetEnd={onInternalResizeEnd}\n onCollapse={onInternalCollapse}\n containerSize={containerSize || 0}\n />\n );\n }\n\n return (\n <React.Fragment key={`split-panel-${idx}`}>\n {panel}\n {splitBar}\n </React.Fragment>\n );\n })}\n\n {/* Fake mask for cursor */}\n {typeof movingIndex === \"number\" && (\n <div\n aria-hidden\n className={clsx(maskCls, `${maskCls}-${layout}`)}\n />\n )}\n </div>\n </ResizeObserver>\n </SplitterContext.Provider>\n );\n};\n\nif (process.env.NODE_ENV !== \"production\") {\n MainSplitter.displayName = \"Splitter\";\n}\n"],"names":["MainSplitter","props","customizePrefixCls","className","style","layout","children","rootClassName","onResizeStart","onResize","onResizeEnd","lazy","showSplitBar","getPrefixCls","direction","contextClassName","contextStyle","useComponentConfig","prefixCls","rootCls","useCSSVarCls","wrapCSSVar","hashId","cssVarCls","useStyle","isVertical","isRTL","reverse","items","useItems","warning","devUseWarning","existSize","existUndefinedSize","item","containerSize","setContainerSize","useState","onContainerResize","size","offsetWidth","offsetHeight","panelSizes","itemPxSizes","itemPtgSizes","itemPtgMinSizes","itemPtgMaxSizes","updateSizes","useSizes","resizableInfos","useResizable","onOffsetStart","onOffsetUpdate","onOffsetEnd","onCollapse","movingIndex","useResize","onInternalResizeStart","useEvent","index","onInternalResizeUpdate","offset","lazyEnd","nextSizes","onInternalResizeEnd","onInternalCollapse","type","containerClassName","clsx","maskCls","stackSizes","React","mergedSizes","stack","i","mergedStyle","SplitterContext","jsx","ResizeObserver","jsxs","idx","panel","SplitterPanel","splitBar","resizableInfo","ariaMinStart","ariaMinEnd","ariaMaxStart","ariaMaxEnd","SplitBar","offsetX","offsetY"],"mappings":";;;;;;;;;;;;;;;;AA2Ba,MAAAA,KAAiE,CAC5EC,MACG;AACG,QAAA;AAAA,IACJ,WAAWC;AAAA,IACX,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,UAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,MAAAC;AAAA,IACA,cAAAC,IAAe;AAAA,EAAA,IACbX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AaE;AAAA,cACb,YAAYC;AAAA,cACZ,eAAe9B,KAAiB;AAAA,YAAA;AAAA,UAClC;AAAA,QAAA;AAKF,eAAA,gBAAA4C,EAACR,EAAM,UAAN,EACE,UAAA;AAAA,UAAAU;AAAA,UACAE;AAAA,QAFkB,EAAA,GAAA,eAAeH,CAAG,EAGvC;AAAA,MAAA,CAEH;AAAA,MAGA,OAAOzB,KAAgB,YACtB,gBAAAsB;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,eAAW;AAAA,UACX,WAAWT,EAAKC,GAAS,GAAGA,CAAO,IAAIhE,CAAM,EAAE;AAAA,QAAA;AAAA,MAAA;AAAA,IACjD,EAEJ,CAAA,EACF,CAAA,EACF,CAAA;AAAA,EACF;AACF;AAEI,QAAQ,IAAI,aAAa,iBAC3BL,GAAa,cAAc;"}
@@ -1 +1 @@
1
- @layer components{.ds-splitter>.ds-splitter-bar .ds-splitter-bar-collapse-bar.ds-splitter-bar-collapse-bar-start{opacity:1}}
1
+ @layer components{.ds-splitter>.ds-splitter-bar .ds-splitter-bar-collapse-bar.ds-splitter-bar-collapse-bar-start{opacity:1}.ds-splitter-hide-bars .ds-splitter-bar{opacity:0;pointer-events:none;transition:opacity .2s ease}.ds-splitter-hide-bars .ds-splitter-bar:hover{opacity:1;pointer-events:auto}.ds-splitter-panel-max-content,.ds-splitter-panel-min-content,.ds-splitter-panel-fit-content{flex-shrink:0}}
package/dist/index.d.ts CHANGED
@@ -111,6 +111,7 @@ import { InputNumber } from 'antd';
111
111
  import { InputNumberProps } from 'antd';
112
112
  import { InputProps as InputProps_2 } from 'antd';
113
113
  import { InputRef } from 'antd';
114
+ import { InternalPanelProps } from 'antd/es/splitter/interface';
114
115
  import { JSX } from 'react/jsx-runtime';
115
116
  import { JSX as JSX_2 } from 'react';
116
117
  import { JSXElementConstructor } from 'react';
@@ -142,7 +143,6 @@ import { OptionFC } from 'rc-select/lib/Option';
142
143
  import { OptionGroupFC } from 'rc-select/lib/OptGroup';
143
144
  import { Pagination } from 'antd';
144
145
  import { PaginationProps } from 'antd';
145
- import { PanelProps } from 'antd/es/splitter/interface';
146
146
  import { PasswordProps as PasswordProps_2 } from 'antd/es/input';
147
147
  import { Popconfirm } from 'antd';
148
148
  import { PopconfirmProps } from 'antd';
@@ -150,6 +150,7 @@ import { Popover as Popover_2 } from '@base-ui-components/react/popover';
150
150
  import { PopoverProps as PopoverProps_2 } from 'antd/es/popover';
151
151
  import { Progress } from 'antd';
152
152
  import { ProgressProps } from 'antd';
153
+ import { PropsWithChildren } from 'react';
153
154
  import { QRCode } from 'antd';
154
155
  import { QRCodeProps } from 'antd';
155
156
  import { QRPropsCanvas } from 'antd';
@@ -409,6 +410,11 @@ export { CheckboxChangeEvent }
409
410
  export { CheckboxOptionType }
410
411
 
411
412
  export declare interface CheckboxProps extends CheckboxProps_2 {
413
+ /**
414
+ * Checkbox appearance variant
415
+ * @default 'default'
416
+ */
417
+ variant?: 'default' | 'outlined';
412
418
  }
413
419
 
414
420
  export { CheckboxRef }
@@ -1748,7 +1754,7 @@ export declare const Form: (<Values = unknown>({ ...rest }: InternalFormProps<Va
1748
1754
  useForm: typeof useForm;
1749
1755
  useFormInstance: typeof default_9;
1750
1756
  useWatch: typeof useWatch;
1751
- Item: <Values = unknown>({ tooltip, label, optionalMark, requiredMark, required, rules, ...rest }: FormItemProps<Values>) => JSX.Element;
1757
+ Item: <Values = unknown>({ tooltip, label, optionalMark, requiredMark, labelRender, required, rules, children, ...rest }: FormItemProps<Values>) => JSX.Element;
1752
1758
  List: React_2.FC<FormListProps>;
1753
1759
  ErrorList: React_2.FC<ErrorListProps>;
1754
1760
  Provider: React_2.FC<FormProviderProps>;
@@ -1759,17 +1765,25 @@ export declare const Form: (<Values = unknown>({ ...rest }: InternalFormProps<Va
1759
1765
 
1760
1766
  export { FormInstance }
1761
1767
 
1762
- export declare interface FormItemProps<Values = unknown> extends FormItemProps_2<Values> {
1768
+ export declare interface FormItemProps<Values = unknown> extends Omit<FormItemProps_2<Values>, "children"> {
1763
1769
  /**
1764
1770
  * Whether show the optional mark. By default, optional item will not show the optional mark.
1765
1771
  * @default false
1766
1772
  */
1767
- optionalMark?: boolean | React.ReactNode;
1773
+ optionalMark?: boolean | default_2.ReactNode;
1768
1774
  /**
1769
1775
  * Whether show the asterisk when the field is required
1770
1776
  * @default true
1771
1777
  */
1772
- requiredMark?: boolean | React.ReactNode;
1778
+ requiredMark?: boolean | default_2.ReactNode;
1779
+ /**
1780
+ * Custom render function for the label
1781
+ */
1782
+ labelRender?: (label: default_2.ReactElement) => default_2.ReactElement;
1783
+ /**
1784
+ * Form item children - can be React nodes or render functions
1785
+ */
1786
+ children?: FormItemProps_2<Values>["children"];
1773
1787
  }
1774
1788
 
1775
1789
  export { FormListFieldData }
@@ -1917,7 +1931,7 @@ export { List }
1917
1931
 
1918
1932
  export { ListProps }
1919
1933
 
1920
- declare const MainCheckboxInner: (props: CheckboxProps, ref: React.Ref<React.ComponentRef<typeof Checkbox_2>>) => JSX.Element;
1934
+ declare const MainCheckboxInner: ({ variant, className, ...props }: CheckboxProps, ref: React.Ref<React.ComponentRef<typeof Checkbox_2>>) => JSX.Element;
1921
1935
 
1922
1936
  declare const MainInputInner: (props: InputProps, ref: React.Ref<InputRef>) => JSX.Element;
1923
1937
 
@@ -3030,19 +3044,30 @@ export declare type SpinProps = Omit<SpinProps_2, "size"> & {
3030
3044
  size?: "small" | "default" | "large" | number;
3031
3045
  };
3032
3046
 
3033
- export declare const Split: default_2.FC<SplitterProps> & {
3034
- Panel: default_2.FC<SplitterPanelProps>;
3047
+ export declare const Split: FC<PropsWithChildren<SplitterProps>> & {
3048
+ Panel: FC<SplitterPanelProps>;
3035
3049
  };
3036
3050
 
3037
- export declare const Splitter: default_2.FC<SplitterProps> & {
3038
- Panel: default_2.FC<SplitterPanelProps>;
3051
+ export declare const Splitter: FC<PropsWithChildren<SplitterProps>> & {
3052
+ Panel: FC<SplitterPanelProps>;
3039
3053
  };
3040
3054
 
3041
- export declare type SplitterPanelProps = default_2.PropsWithChildren<PanelProps>;
3055
+ export declare type SplitterPanelProps = InternalPanelProps & {
3056
+ children?: default_2.ReactNode | undefined;
3057
+ } & default_2.RefAttributes<HTMLDivElement> & {
3058
+ /**
3059
+ * Default size of the panel. Can be a percentage string, number, or CSS intrinsic sizing values
3060
+ */
3061
+ defaultSize?: string | number | "max-content" | "min-content" | "fit-content";
3062
+ };
3042
3063
 
3043
- export declare type SplitterProps = default_2.PropsWithChildren<SplitterProps_2> & {
3064
+ export declare interface SplitterProps extends SplitterProps_2 {
3065
+ /**
3066
+ * Whether to show the split bars between panels
3067
+ * @default true
3068
+ */
3044
3069
  showSplitBar?: boolean;
3045
- };
3070
+ }
3046
3071
 
3047
3072
  export declare const Stack: ForwardRefExoticComponent<StackProps & RefAttributes<HTMLDivElement>> & {
3048
3073
  Child: ForwardRefExoticComponent<StackChildProps & RefAttributes<HTMLDivElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bioturing/components",
3
- "version": "0.25.0",
3
+ "version": "0.26.2",
4
4
  "type": "module",
5
5
  "module": "./dist/index.js",
6
6
  "main": "./dist/index.js",
@@ -23,12 +23,14 @@
23
23
  "es-toolkit": "^1.37.2",
24
24
  "merge-refs": "^2.0.0",
25
25
  "prism-react-renderer": "^2.4.1",
26
+ "rc-resize-observer": "^1.4.3",
26
27
  "rc-select": "^14.16.7",
27
28
  "rc-table": "^7.50.4",
28
29
  "rc-tree": "^5.13.1",
30
+ "rc-util": "^5.44.4",
29
31
  "react-use-resizable": "^0.2.0",
30
32
  "tailwind-merge": "^3.3.1",
31
- "@bioturing/assets": "0.19.0"
33
+ "@bioturing/assets": "0.20.0"
32
34
  },
33
35
  "peerDependencies": {
34
36
  "antd": "^5.25.0",