@bioturing/components 0.14.1 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Badge/component.js +21 -0
- package/dist/components/Badge/component.js.map +1 -0
- package/dist/components/Badge/style.css +1 -0
- package/dist/components/Breadcrumb/component.js +46 -0
- package/dist/components/Breadcrumb/component.js.map +1 -0
- package/dist/components/Breadcrumb/style.css +1 -0
- package/dist/components/Breadcrumb/useItemRender.js +27 -0
- package/dist/components/Breadcrumb/useItemRender.js.map +1 -0
- package/dist/components/Button/component.js +9 -0
- package/dist/components/Button/component.js.map +1 -0
- package/dist/components/Button/style.css +1 -0
- package/dist/components/Checkbox/component.js +11 -0
- package/dist/components/Checkbox/component.js.map +1 -0
- package/dist/components/Checkbox/style.css +1 -0
- package/dist/components/CodeBlock/component.js +127 -0
- package/dist/components/CodeBlock/component.js.map +1 -0
- package/dist/components/CodeBlock/style.css +1 -0
- package/dist/components/DSRoot/component.js +21 -0
- package/dist/components/DSRoot/component.js.map +1 -0
- package/dist/components/DSRoot/context.js +9 -0
- package/dist/components/DSRoot/context.js.map +1 -0
- package/dist/components/DSRoot/style.css +1 -0
- package/dist/components/DropdownMenu/component.js +103 -0
- package/dist/components/DropdownMenu/component.js.map +1 -0
- package/dist/components/DropdownMenu/style.css +1 -0
- package/dist/components/Empty/component.js +48 -0
- package/dist/components/Empty/component.js.map +1 -0
- package/dist/components/Empty/style.css +1 -0
- package/dist/components/Field/component.js +30 -0
- package/dist/components/Field/component.js.map +1 -0
- package/dist/components/Field/style.css +1 -0
- package/dist/components/Form/component.js +23 -0
- package/dist/components/Form/component.js.map +1 -0
- package/dist/components/Form/item.js +30 -0
- package/dist/components/Form/item.js.map +1 -0
- package/dist/components/Form/style.css +1 -0
- package/dist/components/IconButton/component.js +49 -0
- package/dist/components/IconButton/component.js.map +1 -0
- package/dist/components/IconButton/style.css +1 -0
- package/dist/components/Input/component.js +25 -0
- package/dist/components/Input/component.js.map +1 -0
- package/dist/components/Modal/Modal.js +161 -0
- package/dist/components/Modal/Modal.js.map +1 -0
- package/dist/components/Modal/ModalProvider.js +70 -0
- package/dist/components/Modal/ModalProvider.js.map +1 -0
- package/dist/components/Modal/ModalService.js +25 -0
- package/dist/components/Modal/ModalService.js.map +1 -0
- package/dist/components/Modal/constants.js +5 -0
- package/dist/components/Modal/constants.js.map +1 -0
- package/dist/components/Modal/functions.js +27 -0
- package/dist/components/Modal/functions.js.map +1 -0
- package/dist/components/Modal/index.js +20 -0
- package/dist/components/Modal/index.js.map +1 -0
- package/dist/components/Modal/style.css +1 -0
- package/dist/components/Popover/component.js +12 -0
- package/dist/components/Popover/component.js.map +1 -0
- package/dist/components/PopupPanel/component.js +190 -0
- package/dist/components/PopupPanel/component.js.map +1 -0
- package/dist/components/PopupPanel/constants.js +5 -0
- package/dist/components/PopupPanel/constants.js.map +1 -0
- package/dist/components/PopupPanel/style.css +1 -0
- package/dist/components/Radio/component.js +22 -0
- package/dist/components/Radio/component.js.map +1 -0
- package/dist/components/Radio/style.css +1 -0
- package/dist/components/ScrollArea/component.js +40 -0
- package/dist/components/ScrollArea/component.js.map +1 -0
- package/dist/components/ScrollArea/style.css +1 -0
- package/dist/components/Segmented/component.js +9 -0
- package/dist/components/Segmented/component.js.map +1 -0
- package/dist/components/Segmented/style.css +1 -0
- package/dist/components/Select/component.js +135 -0
- package/dist/components/Select/component.js.map +1 -0
- package/dist/components/Select/style.css +1 -0
- package/dist/components/Slider/component.js +23 -0
- package/dist/components/Slider/component.js.map +1 -0
- package/dist/components/Spin/component.js +12 -0
- package/dist/components/Spin/component.js.map +1 -0
- package/dist/components/Spin/style.css +1 -0
- package/dist/components/Splitter/component.js +40 -0
- package/dist/components/Splitter/component.js.map +1 -0
- package/dist/components/Splitter/style.css +1 -0
- package/dist/components/Stack/Stack.js +37 -0
- package/dist/components/Stack/Stack.js.map +1 -0
- package/dist/components/Stack/StackChild.js +57 -0
- package/dist/components/Stack/StackChild.js.map +1 -0
- package/dist/components/Stack/index.js +9 -0
- package/dist/components/Stack/index.js.map +1 -0
- package/dist/components/Stack/style.css +1 -0
- package/dist/components/Switch/component.js +9 -0
- package/dist/components/Switch/component.js.map +1 -0
- package/dist/components/Switch/style.css +1 -0
- package/dist/components/Table/component.js +68 -0
- package/dist/components/Table/component.js.map +1 -0
- package/dist/components/Table/style.css +1 -0
- package/dist/components/Tag/component.js +30 -0
- package/dist/components/Tag/component.js.map +1 -0
- package/dist/components/Tag/style.css +1 -0
- package/dist/components/ThemeProvider/component.js +41 -0
- package/dist/components/ThemeProvider/component.js.map +1 -0
- package/dist/components/ThemeProvider/style.css +1 -0
- package/dist/components/Toast/component.js +101 -0
- package/dist/components/Toast/component.js.map +1 -0
- package/dist/components/Toast/function.js +25 -0
- package/dist/components/Toast/function.js.map +1 -0
- package/dist/components/Toast/style.css +1 -0
- package/dist/components/Tooltip/component.js +26 -0
- package/dist/components/Tooltip/component.js.map +1 -0
- package/dist/components/Tooltip/style.css +1 -0
- package/dist/components/Tour/component.js +35 -0
- package/dist/components/Tour/component.js.map +1 -0
- package/dist/components/Tour/style.css +1 -0
- package/dist/components/Transition/component.js +44 -0
- package/dist/components/Transition/component.js.map +1 -0
- package/dist/components/Tree/components.js +67 -0
- package/dist/components/Tree/components.js.map +1 -0
- package/dist/components/Tree/helpers.js +53 -0
- package/dist/components/Tree/helpers.js.map +1 -0
- package/dist/components/Tree/useTreeCommon.js +86 -0
- package/dist/components/Tree/useTreeCommon.js.map +1 -0
- package/dist/components/Tree/useUniqueKeysTree.js +142 -0
- package/dist/components/Tree/useUniqueKeysTree.js.map +1 -0
- package/dist/components/Truncate/component.js +93 -0
- package/dist/components/Truncate/component.js.map +1 -0
- package/dist/components/Truncate/helpers.js +36 -0
- package/dist/components/Truncate/helpers.js.map +1 -0
- package/dist/components/Truncate/style.css +1 -0
- package/dist/components/Upload/component.js +39 -0
- package/dist/components/Upload/component.js.map +1 -0
- package/dist/components/Upload/dragger.js +23 -0
- package/dist/components/Upload/dragger.js.map +1 -0
- package/dist/components/Upload/hooks.js +18 -0
- package/dist/components/Upload/hooks.js.map +1 -0
- package/dist/components/Upload/item.js +84 -0
- package/dist/components/Upload/item.js.map +1 -0
- package/dist/components/Upload/utils.js +7 -0
- package/dist/components/Upload/utils.js.map +1 -0
- package/dist/components/VerticalCollapsiblePanel/component.js +125 -0
- package/dist/components/VerticalCollapsiblePanel/component.js.map +1 -0
- package/dist/components/VerticalCollapsiblePanel/style.css +1 -0
- package/dist/components/hooks/antd.js +22 -0
- package/dist/components/hooks/antd.js.map +1 -0
- package/dist/components/hooks/base-ui.js +47 -0
- package/dist/components/hooks/base-ui.js.map +1 -0
- package/dist/components/hooks/useCharts.js +28 -0
- package/dist/components/hooks/useCharts.js.map +1 -0
- package/dist/components/hooks/useControlledState.js +15 -0
- package/dist/components/hooks/useControlledState.js.map +1 -0
- package/dist/components/utils/WithAntdTokens.js +24 -0
- package/dist/components/utils/WithAntdTokens.js.map +1 -0
- package/dist/components/utils/antdUtils.js +58 -0
- package/dist/components/utils/antdUtils.js.map +1 -0
- package/dist/components/utils/cn.js +27 -0
- package/dist/components/utils/cn.js.map +1 -0
- package/dist/components/utils/isTracebackError.js +10 -0
- package/dist/components/utils/isTracebackError.js.map +1 -0
- package/dist/components/utils/reactToString.js +23 -0
- package/dist/components/utils/reactToString.js.map +1 -0
- package/dist/index.d.ts +2497 -2
- package/dist/index.js +188 -3376
- package/dist/index.js.map +1 -0
- package/dist/metadata.js +513 -0
- package/dist/metadata.js.map +1 -0
- package/dist/tailwind.css +1 -4
- package/dist/tailwind.d.ts +1 -0
- package/dist/tokens/and-theme/tokens.js +351 -0
- package/dist/tokens/and-theme/tokens.js.map +1 -0
- package/dist/tokens/charts/index.js +18 -0
- package/dist/tokens/charts/index.js.map +1 -0
- package/dist/tokens/charts/tokens.js +208 -0
- package/dist/tokens/charts/tokens.js.map +1 -0
- package/dist/tokens/utils.js +37 -0
- package/dist/tokens/utils.js.map +1 -0
- package/package.json +10 -108
- package/dist/Badge.js +0 -41
- package/dist/Breadcrumb.js +0 -92
- package/dist/Checkbox.js +0 -12
- package/dist/CodeBlock.js +0 -641
- package/dist/Collapse.js +0 -49
- package/dist/DSRoot.js +0 -1181
- package/dist/DropdownMenu.js +0 -211
- package/dist/Empty.js +0 -53
- package/dist/Field.js +0 -66
- package/dist/Form.js +0 -125
- package/dist/IconButton.js +0 -82
- package/dist/Input.js +0 -48
- package/dist/Modal.js +0 -430
- package/dist/Popover.js +0 -10
- package/dist/PopupPanel.css +0 -116
- package/dist/PopupPanel.js +0 -333
- package/dist/Radio.js +0 -24
- package/dist/ScrollArea.js +0 -50
- package/dist/Segmented.js +0 -10
- package/dist/Select.js +0 -157
- package/dist/Slider.js +0 -39
- package/dist/Spin.js +0 -33
- package/dist/Splitter.js +0 -47
- package/dist/Switch.js +0 -10
- package/dist/Table.js +0 -126
- package/dist/Tag.js +0 -24
- package/dist/ThemeProvider.js +0 -403
- package/dist/Toast.js +0 -1154
- package/dist/Tooltip.js +0 -36
- package/dist/Tour.js +0 -54
- package/dist/Tree.js +0 -318
- package/dist/Truncate.js +0 -160
- package/dist/Upload.js +0 -460
- package/dist/VerticalCollapsiblePanel.js +0 -413
- package/dist/components/Badge/component.d.ts +0 -3
- package/dist/components/Badge/index.d.ts +0 -1
- package/dist/components/Breadcrumb/component.d.ts +0 -5
- package/dist/components/Breadcrumb/index.d.ts +0 -2
- package/dist/components/Breadcrumb/types.d.ts +0 -18
- package/dist/components/Breadcrumb/useItemRender.d.ts +0 -6
- package/dist/components/Button/component.d.ts +0 -7
- package/dist/components/Button/index.d.ts +0 -1
- package/dist/components/Checkbox/component.d.ts +0 -10
- package/dist/components/Checkbox/index.d.ts +0 -1
- package/dist/components/CodeBlock/component.d.ts +0 -2
- package/dist/components/CodeBlock/index.d.ts +0 -2
- package/dist/components/CodeBlock/types.d.ts +0 -47
- package/dist/components/Collapse/component.d.ts +0 -13
- package/dist/components/Collapse/index.d.ts +0 -1
- package/dist/components/DSRoot/component.d.ts +0 -13
- package/dist/components/DSRoot/context.d.ts +0 -7
- package/dist/components/DSRoot/index.d.ts +0 -1
- package/dist/components/DropdownMenu/component.d.ts +0 -30
- package/dist/components/DropdownMenu/index.d.ts +0 -2
- package/dist/components/Empty/component.d.ts +0 -12
- package/dist/components/Empty/index.d.ts +0 -1
- package/dist/components/Field/component.d.ts +0 -41
- package/dist/components/Field/index.d.ts +0 -1
- package/dist/components/Form/component.d.ts +0 -18
- package/dist/components/Form/index.d.ts +0 -1
- package/dist/components/Form/item.d.ts +0 -5
- package/dist/components/IconButton/component.d.ts +0 -29
- package/dist/components/IconButton/index.d.ts +0 -1
- package/dist/components/Input/component.d.ts +0 -30
- package/dist/components/Input/index.d.ts +0 -1
- package/dist/components/Modal/Modal.d.ts +0 -84
- package/dist/components/Modal/ModalProvider.d.ts +0 -5
- package/dist/components/Modal/ModalService.d.ts +0 -33
- package/dist/components/Modal/constants.d.ts +0 -9
- package/dist/components/Modal/functions.d.ts +0 -27
- package/dist/components/Modal/index.d.ts +0 -14
- package/dist/components/Popover/component.d.ts +0 -9
- package/dist/components/Popover/index.d.ts +0 -1
- package/dist/components/PopupPanel/component.d.ts +0 -61
- package/dist/components/PopupPanel/constants.d.ts +0 -7
- package/dist/components/PopupPanel/index.d.ts +0 -1
- package/dist/components/Radio/component.d.ts +0 -7
- package/dist/components/Radio/index.d.ts +0 -2
- package/dist/components/Radio/interface.d.ts +0 -5
- package/dist/components/ScrollArea/component.d.ts +0 -10
- package/dist/components/ScrollArea/index.d.ts +0 -1
- package/dist/components/Segmented/component.d.ts +0 -9
- package/dist/components/Segmented/index.d.ts +0 -1
- package/dist/components/Select/component.d.ts +0 -23
- package/dist/components/Select/index.d.ts +0 -1
- package/dist/components/Slider/component.d.ts +0 -5
- package/dist/components/Slider/index.d.ts +0 -1
- package/dist/components/Spin/component.d.ts +0 -3
- package/dist/components/Spin/index.d.ts +0 -1
- package/dist/components/Splitter/component.d.ts +0 -12
- package/dist/components/Splitter/index.d.ts +0 -1
- package/dist/components/Switch/component.d.ts +0 -8
- package/dist/components/Switch/index.d.ts +0 -1
- package/dist/components/Table/component.d.ts +0 -19
- package/dist/components/Table/index.d.ts +0 -1
- package/dist/components/Tag/component.d.ts +0 -11
- package/dist/components/Tag/index.d.ts +0 -1
- package/dist/components/ThemeProvider/component.d.ts +0 -6
- package/dist/components/ThemeProvider/index.d.ts +0 -1
- package/dist/components/Toast/component.d.ts +0 -14
- package/dist/components/Toast/function.d.ts +0 -10
- package/dist/components/Toast/index.d.ts +0 -3
- package/dist/components/Toast/types.d.ts +0 -3
- package/dist/components/Tooltip/component.d.ts +0 -9
- package/dist/components/Tooltip/index.d.ts +0 -1
- package/dist/components/Tour/component.d.ts +0 -7
- package/dist/components/Tour/index.d.ts +0 -1
- package/dist/components/Transition/component.d.ts +0 -17
- package/dist/components/Transition/index.d.ts +0 -1
- package/dist/components/Tree/components.d.ts +0 -13
- package/dist/components/Tree/helpers.d.ts +0 -4
- package/dist/components/Tree/index.d.ts +0 -4
- package/dist/components/Tree/types.d.ts +0 -55
- package/dist/components/Tree/useTreeCommon.d.ts +0 -178
- package/dist/components/Tree/useUniqueKeysTree.d.ts +0 -33
- package/dist/components/Truncate/component.d.ts +0 -12
- package/dist/components/Truncate/helpers.d.ts +0 -5
- package/dist/components/Truncate/index.d.ts +0 -1
- package/dist/components/Upload/component.d.ts +0 -16
- package/dist/components/Upload/dragger.d.ts +0 -13
- package/dist/components/Upload/hooks.d.ts +0 -5
- package/dist/components/Upload/index.d.ts +0 -3
- package/dist/components/Upload/item.d.ts +0 -11
- package/dist/components/Upload/utils.d.ts +0 -1
- package/dist/components/VerticalCollapsiblePanel/component.d.ts +0 -64
- package/dist/components/VerticalCollapsiblePanel/index.d.ts +0 -1
- package/dist/components/hooks/antd.d.ts +0 -11
- package/dist/components/hooks/base-ui.d.ts +0 -7
- package/dist/components/hooks/index.d.ts +0 -4
- package/dist/components/hooks/useCharts.d.ts +0 -22
- package/dist/components/hooks/useControlledState.d.ts +0 -1
- package/dist/components/index.d.ts +0 -40
- package/dist/components/utils/WithAntdTokens.d.ts +0 -7
- package/dist/components/utils/antdUtils.d.ts +0 -15
- package/dist/components/utils/client.d.ts +0 -2
- package/dist/components/utils/cn.d.ts +0 -4
- package/dist/components/utils/index.d.ts +0 -3
- package/dist/components/utils/isTracebackError.d.ts +0 -1
- package/dist/components/utils/main.d.ts +0 -3
- package/dist/components/utils/reactToString.d.ts +0 -2
- package/dist/components/utils/types.d.ts +0 -9
- package/dist/hooks.js +0 -961
- package/dist/index.css +0 -116
- package/dist/style.css +0 -1392
- package/dist/style.js +0 -0
- package/dist/tailwind.js +0 -0
- package/dist/tokens/and-theme/index.d.ts +0 -1
- package/dist/tokens/and-theme/tokens.d.ts +0 -5
- package/dist/tokens/charts/index.d.ts +0 -6
- package/dist/tokens/charts/tokens.d.ts +0 -455
- package/dist/tokens/index.d.ts +0 -2
- package/dist/tokens/utils.d.ts +0 -16
- package/dist/utils.js +0 -120
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { cn as m } from "../utils/cn.js";
|
|
3
|
+
import { useCls as n } from "../utils/antdUtils.js";
|
|
4
|
+
const g = ({
|
|
5
|
+
hug: s = !1,
|
|
6
|
+
align: a = "flex-start",
|
|
7
|
+
justify: c = "flex-start",
|
|
8
|
+
vertical: r = !1,
|
|
9
|
+
gap: l = 0,
|
|
10
|
+
wrap: o = !1,
|
|
11
|
+
className: e,
|
|
12
|
+
children: f,
|
|
13
|
+
...k
|
|
14
|
+
}) => {
|
|
15
|
+
const t = n();
|
|
16
|
+
return /* @__PURE__ */ i(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: m(
|
|
20
|
+
t("stack"),
|
|
21
|
+
t(s ? "stack-hug" : "stack-fill"),
|
|
22
|
+
t(`stack-gap-${l}`),
|
|
23
|
+
t(r ? "stack-vertical" : "stack-horizontal"),
|
|
24
|
+
o && t("stack-wrap"),
|
|
25
|
+
t(`stack-align-${a}`),
|
|
26
|
+
t(`stack-justify-${c}`),
|
|
27
|
+
e
|
|
28
|
+
),
|
|
29
|
+
...k,
|
|
30
|
+
children: f
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
g as Stack
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=Stack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stack.js","sources":["../../../src/components/Stack/Stack.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn, useCls } from \"../utils\";\n\nexport type StackGap = 0 | 1 | 2 | 4 | 8 | 12 | 16 | 24;\n\nexport interface StackProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Whether the stack should hug its content (inline-flex) instead of filling available space\n * @default false\n */\n hug?: boolean;\n\n /**\n * Vertical alignment of items within the stack\n * @default \"flex-start\"\n */\n align?: \"flex-start\" | \"flex-end\" | \"center\" | \"stretch\" | \"baseline\";\n\n /**\n * Horizontal alignment of items within the stack\n * @default \"flex-start\"\n */\n justify?:\n | \"flex-start\"\n | \"flex-end\"\n | \"center\"\n | \"space-between\"\n | \"space-around\"\n | \"space-evenly\";\n\n /**\n * Whether the stack should render items vertically\n * @default false\n */\n vertical?: boolean;\n\n /**\n * Gap between stack items in pixels\n * @default 0\n */\n gap?: StackGap;\n\n /**\n * Wrap items to multiple lines if needed\n * @default false\n */\n wrap?: boolean;\n\n /**\n * Children of the stack\n */\n children?: React.ReactNode;\n}\n\nexport const Stack: React.FC<StackProps> = ({\n hug = false,\n align = \"flex-start\",\n justify = \"flex-start\",\n vertical = false,\n gap = 0,\n wrap = false,\n className,\n children,\n ...rest\n}) => {\n const cls = useCls();\n\n return (\n <div\n className={cn(\n cls(\"stack\"),\n hug ? cls(\"stack-hug\") : cls(\"stack-fill\"),\n cls(`stack-gap-${gap}`),\n vertical ? cls(\"stack-vertical\") : cls(\"stack-horizontal\"),\n wrap && cls(\"stack-wrap\"),\n cls(`stack-align-${align}`),\n cls(`stack-justify-${justify}`),\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n"],"names":["Stack","hug","align","justify","vertical","gap","wrap","className","children","rest","cls","useCls","jsx","cn"],"mappings":";;;AAsDO,MAAMA,IAA8B,CAAC;AAAA,EAC1C,KAAAC,IAAM;AAAA,EACN,OAAAC,IAAQ;AAAA,EACR,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,KAAAC,IAAM;AAAA,EACN,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAMC,EAAO;AAGjB,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTH,EAAI,OAAO;AAAA,QACLA,EAANT,IAAU,cAAmB,YAAR;AAAA,QACrBS,EAAI,aAAaL,CAAG,EAAE;AAAA,QACXK,EAAXN,IAAe,mBAAwB,kBAAR;AAAA,QAC/BE,KAAQI,EAAI,YAAY;AAAA,QACxBA,EAAI,eAAeR,CAAK,EAAE;AAAA,QAC1BQ,EAAI,iBAAiBP,CAAO,EAAE;AAAA,QAC9BI;AAAA,MACF;AAAA,MACC,GAAGE;AAAA,MAEH,UAAAD;AAAA,IAAA;AAAA,EACH;AAEJ;"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import g from "react";
|
|
3
|
+
import { useRender as N } from "@base-ui-components/react/use-render";
|
|
4
|
+
import { mergeProps as v } from "@base-ui-components/react/merge-props";
|
|
5
|
+
import { Stack as E } from "./Stack.js";
|
|
6
|
+
import { useCls as P } from "../utils/antdUtils.js";
|
|
7
|
+
import { cn as R } from "../utils/cn.js";
|
|
8
|
+
const B = ({
|
|
9
|
+
flex: s,
|
|
10
|
+
grow: l = !1,
|
|
11
|
+
shrink: c = !1,
|
|
12
|
+
children: e,
|
|
13
|
+
style: m,
|
|
14
|
+
stack: f = !1,
|
|
15
|
+
// stack props
|
|
16
|
+
hug: i = !1,
|
|
17
|
+
align: n = "flex-start",
|
|
18
|
+
justify: p = "flex-start",
|
|
19
|
+
vertical: d = !1,
|
|
20
|
+
gap: k = 0,
|
|
21
|
+
wrap: u = !1,
|
|
22
|
+
className: x,
|
|
23
|
+
...h
|
|
24
|
+
}) => {
|
|
25
|
+
const t = P(), y = {
|
|
26
|
+
hug: i,
|
|
27
|
+
align: n,
|
|
28
|
+
justify: p,
|
|
29
|
+
vertical: d,
|
|
30
|
+
gap: k,
|
|
31
|
+
wrap: u
|
|
32
|
+
};
|
|
33
|
+
let o = "";
|
|
34
|
+
typeof s == "boolean" && (o = t(s ? "stack-child-flex-1" : "stack-child-flex-0"));
|
|
35
|
+
const r = R(
|
|
36
|
+
t("stack-child"),
|
|
37
|
+
l && t("stack-child-grow"),
|
|
38
|
+
c && t("stack-child-shrink"),
|
|
39
|
+
o,
|
|
40
|
+
x
|
|
41
|
+
), C = typeof s == "string" || typeof s == "number" ? s : void 0, { renderElement: b } = N({
|
|
42
|
+
render: () => g.isValidElement(e) ? e : /* @__PURE__ */ a("div", { children: e }),
|
|
43
|
+
props: v({
|
|
44
|
+
className: r,
|
|
45
|
+
style: {
|
|
46
|
+
...m,
|
|
47
|
+
flex: C
|
|
48
|
+
},
|
|
49
|
+
...h
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
return f ? /* @__PURE__ */ a(E, { ...y, className: r, children: e }) : b();
|
|
53
|
+
};
|
|
54
|
+
export {
|
|
55
|
+
B as StackChild
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=StackChild.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StackChild.js","sources":["../../../src/components/Stack/StackChild.tsx"],"sourcesContent":["import React 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: React.FC<StackChildProps> = ({\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\n className,\n ...rest\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 { renderElement } = useRender({\n render: () =>\n React.isValidElement(children) ? children : <div>{children}</div>,\n props: mergeProps<\"div\">({\n className: combinedClassName,\n style: {\n ...style,\n flex: flexValue,\n },\n ...rest,\n }),\n });\n\n return stack ? (\n <Stack {...stackProps} className={combinedClassName}>\n {children}\n </Stack>\n ) : (\n renderElement()\n );\n};\n"],"names":["StackChild","flex","grow","shrink","children","style","stack","hug","align","justify","vertical","gap","wrap","className","rest","cls","useCls","stackProps","flexClass","combinedClassName","cn","flexValue","renderElement","useRender","React","jsx","mergeProps","Stack"],"mappings":";;;;;;;AAqCO,MAAMA,IAAwC,CAAC;AAAA,EACpD,MAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA;AAAA,EAER,KAAAC,IAAM;AAAA,EACN,OAAAC,IAAQ;AAAA,EACR,SAAAC,IAAU;AAAA,EACV,UAAAC,IAAW;AAAA,EACX,KAAAC,IAAM;AAAA,EACN,MAAAC,IAAO;AAAA,EAEP,WAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAMC,EAAO,GACbC,IAAa;AAAA,IACjB,KAAAV;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,KAAAC;AAAA,IACA,MAAAC;AAAA,EACF;AAGA,MAAIM,IAAY;AACZ,EAAA,OAAOjB,KAAS,cAClBiB,IAAmBH,EAAPd,IAAW,uBAA4B,oBAAR;AAI7C,QAAMkB,IAAoBC;AAAA,IACxBL,EAAI,aAAa;AAAA,IACjBb,KAAQa,EAAI,kBAAkB;AAAA,IAC9BZ,KAAUY,EAAI,oBAAoB;AAAA,IAClCG;AAAA,IACAL;AAAA,EACF,GAGMQ,IACJ,OAAOpB,KAAS,YAAY,OAAOA,KAAS,WAAWA,IAAO,QAG1D,EAAE,eAAAqB,EAAc,IAAIC,EAAU;AAAA,IAClC,QAAQ,MACNC,EAAM,eAAepB,CAAQ,IAAIA,IAAY,gBAAAqB,EAAA,OAAA,EAAK,UAAArB,GAAS;AAAA,IAC7D,OAAOsB,EAAkB;AAAA,MACvB,WAAWP;AAAA,MACX,OAAO;AAAA,QACL,GAAGd;AAAA,QACH,MAAMgB;AAAA,MACR;AAAA,MACA,GAAGP;AAAA,IACJ,CAAA;AAAA,EAAA,CACF;AAEM,SAAAR,sBACJqB,GAAO,EAAA,GAAGV,GAAY,WAAWE,GAC/B,UAAAf,GACH,IAEAkB,EAAc;AAElB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Stack/index.ts"],"sourcesContent":["import { Stack as MainStack, type StackProps } from \"./Stack\";\nimport { StackChild, type StackChildProps } from \"./StackChild\";\n\nimport \"./style.css\";\n\nexport { StackChild };\nexport { StackProps, StackChildProps };\n\nexport const Stack = Object.assign(MainStack, { Child: StackChild });\n"],"names":["Stack","MainStack","StackChild"],"mappings":";;;AAQO,MAAMA,IAAQ,OAAO,OAAOC,GAAW,EAAE,OAAOC,EAAY,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{.ds-stack{display:flex}.ds-stack-hug{display:inline-flex}.ds-stack-horizontal{flex-direction:row}.ds-stack-vertical{flex-direction:column}.ds-stack-fill.ds-stack-vertical{height:100%}.ds-stack-fill.ds-stack-horizontal{width:100%}.ds-stack-wrap{flex-wrap:wrap}.ds-stack-gap-0{gap:0}.ds-stack-gap-1{gap:1px}.ds-stack-gap-2{gap:2px}.ds-stack-gap-4{gap:4px}.ds-stack-gap-8{gap:8px}.ds-stack-gap-12{gap:12px}.ds-stack-gap-16{gap:16px}.ds-stack-gap-24,.ds-stack-gap-32{gap:24px}.ds-stack-align-flex-start{align-items:flex-start}.ds-stack-align-flex-end{align-items:flex-end}.ds-stack-align-center{align-items:center}.ds-stack-align-stretch{align-items:stretch}.ds-stack-align-baseline{align-items:baseline}.ds-stack-justify-flex-start{justify-content:flex-start}.ds-stack-justify-flex-end{justify-content:flex-end}.ds-stack-justify-center{justify-content:center}.ds-stack-justify-space-between{justify-content:space-between}.ds-stack-justify-space-around{justify-content:space-around}.ds-stack-justify-space-evenly{justify-content:space-evenly}.ds-stack-child{min-width:0;min-height:0}.ds-stack-child-flex-0{flex:0}.ds-stack-child-flex-1{flex:1}.ds-stack-child-grow{flex-grow:1}.ds-stack-child-shrink{flex-shrink:1}}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import i from "antd/es/switch";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import './style.css';/* empty css */
|
|
5
|
+
const c = ({ ...t }, r) => /* @__PURE__ */ o(i, { ref: r, ...t }), m = n(c), h = m;
|
|
6
|
+
export {
|
|
7
|
+
h as Switch
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Switch/component.tsx"],"sourcesContent":["import {\n default as AntSwitch,\n type SwitchProps as AntSwitchProps,\n} from \"antd/es/switch\";\nimport { forwardRef } from \"react\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define props interface extending Ant Design's SwitchProps\nexport interface SwitchProps extends AntSwitchProps {}\n\n// Create inner function\nconst MainSwitchInner = (\n { ...rest }: SwitchProps,\n ref: React.Ref<React.ComponentRef<typeof AntSwitch>>\n) => {\n return <AntSwitch ref={ref} {...rest} />;\n};\n\n// Use forwardRef with type assertion\nconst MainSwitch = forwardRef(MainSwitchInner) as (\n props: SwitchProps & {\n ref?: React.ForwardedRef<React.ComponentRef<typeof AntSwitch>>;\n }\n) => ReturnType<typeof MainSwitchInner>;\n\nexport const Switch = MainSwitch;\n"],"names":["MainSwitchInner","rest","ref","jsx","AntSwitch","MainSwitch","forwardRef","Switch"],"mappings":";;;;AAaA,MAAMA,IAAkB,CACtB,EAAE,GAAGC,EAAA,GACLC,MAEQ,gBAAAC,EAAAC,GAAA,EAAU,KAAAF,GAAW,GAAGD,EAAM,CAAA,GAIlCI,IAAaC,EAAWN,CAAe,GAMhCO,IAASF;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{:is(.ds-switch .ds-switch-inner) span.ds-switch-inner-checked,:is(.ds-switch .ds-switch-inner) span.ds-switch-inner-unchecked{display:flex;justify-items:center;align-items:center}}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as n, jsxs as C, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import e from "antd/es/table";
|
|
3
|
+
import { Funnel as T, CaretUp as r, CaretDown as a } from "@bioturing/assets";
|
|
4
|
+
import { Empty as I } from "../Empty/component.js";
|
|
5
|
+
import './style.css';/* empty css */
|
|
6
|
+
import { useCls as O } from "../utils/antdUtils.js";
|
|
7
|
+
const d = ({
|
|
8
|
+
columns: s,
|
|
9
|
+
locale: m,
|
|
10
|
+
emptyDescription: c,
|
|
11
|
+
loading: t,
|
|
12
|
+
scroll: p = {},
|
|
13
|
+
...N
|
|
14
|
+
}) => {
|
|
15
|
+
const l = O(), E = s ? s.map((u) => ({
|
|
16
|
+
sortIcon: ({ sortOrder: o }) => /* @__PURE__ */ n(
|
|
17
|
+
"span",
|
|
18
|
+
{
|
|
19
|
+
className: l(
|
|
20
|
+
"table-column-sort-icon",
|
|
21
|
+
o ? `table-column-sort-icon-${o}` : "table-column-sort-icon-none"
|
|
22
|
+
),
|
|
23
|
+
children: o ? o === "ascend" ? /* @__PURE__ */ n(r, { weight: "fill" }) : /* @__PURE__ */ n(a, { weight: "fill" }) : /* @__PURE__ */ C(L, { children: [
|
|
24
|
+
/* @__PURE__ */ n(r, { weight: "fill" }),
|
|
25
|
+
" ",
|
|
26
|
+
/* @__PURE__ */ n(a, { weight: "fill" })
|
|
27
|
+
] })
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
filterIcon: (o) => /* @__PURE__ */ n("span", { className: l("table-column-filter-icon"), children: /* @__PURE__ */ n(T, { weight: "fill" }) }),
|
|
31
|
+
...u
|
|
32
|
+
})) : void 0, f = {
|
|
33
|
+
emptyText: /* @__PURE__ */ n(I, { description: c }),
|
|
34
|
+
...m
|
|
35
|
+
};
|
|
36
|
+
let i;
|
|
37
|
+
return typeof t == "boolean" ? i = {
|
|
38
|
+
spinning: t,
|
|
39
|
+
indicator: /* @__PURE__ */ n("span", { className: l("spin-loader") })
|
|
40
|
+
} : typeof t == "object" && (i = {
|
|
41
|
+
spinning: !0,
|
|
42
|
+
indicator: /* @__PURE__ */ n("span", { className: l("spin-loader") }),
|
|
43
|
+
...t
|
|
44
|
+
}), /* @__PURE__ */ n(
|
|
45
|
+
e,
|
|
46
|
+
{
|
|
47
|
+
columns: E,
|
|
48
|
+
loading: i,
|
|
49
|
+
locale: f,
|
|
50
|
+
scroll: { x: "fit-content", ...p },
|
|
51
|
+
...N
|
|
52
|
+
}
|
|
53
|
+
);
|
|
54
|
+
}, y = Object.assign(d, {
|
|
55
|
+
Column: e.Column,
|
|
56
|
+
ColumnGroup: e.ColumnGroup,
|
|
57
|
+
SELECTION_COLUMN: e.SELECTION_COLUMN,
|
|
58
|
+
EXPAND_COLUMN: e.EXPAND_COLUMN,
|
|
59
|
+
SELECTION_ALL: e.SELECTION_ALL,
|
|
60
|
+
SELECTION_INVERT: e.SELECTION_INVERT,
|
|
61
|
+
SELECTION_NONE: e.SELECTION_NONE,
|
|
62
|
+
Summary: e.Summary
|
|
63
|
+
});
|
|
64
|
+
export {
|
|
65
|
+
y as Table,
|
|
66
|
+
y as default
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Table/component.tsx"],"sourcesContent":["import {\n default as AntTable,\n type ColumnType,\n type TableProps as AntTableProps,\n} from \"antd/es/table\";\nimport { CaretDown, CaretUp, Funnel } from \"@bioturing/assets\";\nimport { useCls } from \"../utils\";\nimport Empty from \"../Empty/component\";\nimport { SpinProps } from \"antd/es/spin\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define interface with all the generic type parameters from AntTable without any\nexport interface TableProps<RecordType extends object = object>\n extends AntTableProps<RecordType> {\n /**\n * Add empty description for the table\n */\n emptyDescription?: React.ReactNode;\n}\n\n// Simple wrapper component with proper generics\nconst InternalTable = <RecordType extends object = object>({\n columns,\n locale,\n emptyDescription,\n loading,\n scroll = {},\n ...rest\n}: TableProps<RecordType>) => {\n const cls = useCls();\n const modifiedColumns = columns\n ? columns.map((column: ColumnType<RecordType>): ColumnType<RecordType> => {\n return {\n sortIcon: ({ sortOrder }) => {\n return (\n <span\n className={cls(\n \"table-column-sort-icon\",\n sortOrder\n ? `table-column-sort-icon-${sortOrder}`\n : `table-column-sort-icon-none`\n )}\n >\n {!sortOrder ? (\n <>\n <CaretUp weight=\"fill\" /> <CaretDown weight=\"fill\" />\n </>\n ) : sortOrder === \"ascend\" ? (\n <CaretUp weight=\"fill\" />\n ) : (\n <CaretDown weight=\"fill\" />\n )}\n </span>\n );\n },\n filterIcon: (_filtered) => {\n return (\n <span className={cls(\"table-column-filter-icon\")}>\n <Funnel weight=\"fill\" />\n </span>\n );\n },\n ...column,\n };\n })\n : undefined;\n const modifiedLocale = {\n emptyText: <Empty description={emptyDescription} />,\n ...locale,\n };\n let spinProps: SpinProps | undefined;\n if (typeof loading === \"boolean\") {\n spinProps = {\n spinning: loading,\n indicator: <span className={cls(\"spin-loader\")} />,\n };\n } else if (typeof loading === \"object\") {\n spinProps = {\n spinning: true,\n indicator: <span className={cls(\"spin-loader\")} />,\n ...loading,\n };\n }\n return (\n <AntTable\n columns={modifiedColumns}\n loading={spinProps}\n locale={modifiedLocale}\n scroll={{ x: \"fit-content\", ...scroll }}\n {...rest}\n />\n );\n};\n\n// Create the final component with all static properties\nexport const Table = Object.assign(InternalTable, {\n Column: AntTable.Column,\n ColumnGroup: AntTable.ColumnGroup,\n SELECTION_COLUMN: AntTable.SELECTION_COLUMN,\n EXPAND_COLUMN: AntTable.EXPAND_COLUMN,\n SELECTION_ALL: AntTable.SELECTION_ALL,\n SELECTION_INVERT: AntTable.SELECTION_INVERT,\n SELECTION_NONE: AntTable.SELECTION_NONE,\n Summary: AntTable.Summary,\n}) as typeof InternalTable & {\n Column: typeof AntTable.Column;\n ColumnGroup: typeof AntTable.ColumnGroup;\n SELECTION_COLUMN: typeof AntTable.SELECTION_COLUMN;\n EXPAND_COLUMN: typeof AntTable.EXPAND_COLUMN;\n SELECTION_ALL: typeof AntTable.SELECTION_ALL;\n SELECTION_INVERT: typeof AntTable.SELECTION_INVERT;\n SELECTION_NONE: typeof AntTable.SELECTION_NONE;\n Summary: typeof AntTable.Summary;\n};\n\nexport default Table;\n"],"names":["InternalTable","columns","locale","emptyDescription","loading","scroll","rest","cls","useCls","modifiedColumns","column","sortOrder","jsx","CaretUp","CaretDown","jsxs","Fragment","_filtered","Funnel","modifiedLocale","Empty","spinProps","AntTable","Table"],"mappings":";;;;;;AAuBA,MAAMA,IAAgB,CAAqC;AAAA,EACzD,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,SAAAC;AAAA,EACA,QAAAC,IAAS,CAAC;AAAA,EACV,GAAGC;AACL,MAA8B;AAC5B,QAAMC,IAAMC,EAAO,GACbC,IAAkBR,IACpBA,EAAQ,IAAI,CAACS,OACJ;AAAA,IACL,UAAU,CAAC,EAAE,WAAAC,QAET,gBAAAC;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWL;AAAA,UACT;AAAA,UACAI,IACI,0BAA0BA,CAAS,KACnC;AAAA,QACN;AAAA,QAEC,UAACA,IAIEA,MAAc,WACf,gBAAAC,EAAAC,GAAA,EAAQ,QAAO,OAAA,CAAO,IAEvB,gBAAAD,EAACE,GAAU,EAAA,QAAO,OAAO,CAAA,IALvB,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,UAAC,gBAAAJ,EAAAC,GAAA,EAAQ,QAAO,OAAO,CAAA;AAAA,UAAE;AAAA,UAAC,gBAAAD,EAACE,GAAU,EAAA,QAAO,OAAO,CAAA;AAAA,QACrD,EAAA,CAAA;AAAA,MAIyB;AAAA,IAE7B;AAAA,IAGJ,YAAY,CAACG,MAET,gBAAAL,EAAC,QAAK,EAAA,WAAWL,EAAI,0BAA0B,GAC7C,UAAC,gBAAAK,EAAAM,GAAA,EAAO,QAAO,OAAA,CAAO,EACxB,CAAA;AAAA,IAGJ,GAAGR;AAAA,EACL,EACD,IACD,QACES,IAAiB;AAAA,IACrB,WAAW,gBAAAP,EAACQ,GAAM,EAAA,aAAajB,EAAkB,CAAA;AAAA,IACjD,GAAGD;AAAA,EACL;AACI,MAAAmB;AACA,SAAA,OAAOjB,KAAY,YACTiB,IAAA;AAAA,IACV,UAAUjB;AAAA,IACV,WAAY,gBAAAQ,EAAA,QAAA,EAAK,WAAWL,EAAI,aAAa,EAAG,CAAA;AAAA,EAClD,IACS,OAAOH,KAAY,aAChBiB,IAAA;AAAA,IACV,UAAU;AAAA,IACV,WAAY,gBAAAT,EAAA,QAAA,EAAK,WAAWL,EAAI,aAAa,GAAG;AAAA,IAChD,GAAGH;AAAA,EACL,IAGA,gBAAAQ;AAAA,IAACU;AAAA,IAAA;AAAA,MACC,SAASb;AAAA,MACT,SAASY;AAAA,MACT,QAAQF;AAAA,MACR,QAAQ,EAAE,GAAG,eAAe,GAAGd,EAAO;AAAA,MACrC,GAAGC;AAAA,IAAA;AAAA,EACN;AAEJ,GAGaiB,IAAQ,OAAO,OAAOvB,GAAe;AAAA,EAChD,QAAQsB,EAAS;AAAA,EACjB,aAAaA,EAAS;AAAA,EACtB,kBAAkBA,EAAS;AAAA,EAC3B,eAAeA,EAAS;AAAA,EACxB,eAAeA,EAAS;AAAA,EACxB,kBAAkBA,EAAS;AAAA,EAC3B,gBAAgBA,EAAS;AAAA,EACzB,SAASA,EAAS;AACpB,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{.ds-table-column-sort-icon{display:flex;flex-direction:column}.ds-table-column-sort-icon svg{color:var(--ds-color-text-disabled);font-size:1rem}:is(.ds-table-column-sort-icon svg):hover{color:var(--ds-color-text-secondary)}.ds-table-column-sort-icon.ds-table-column-sort-icon-none svg{font-size:.75rem}.ds-table-column-sort-icon.ds-table-column-sort-icon-none>svg:first-child{margin-bottom:-2px}.ds-table-column-sort-icon.ds-table-column-sort-icon-none>svg:last-child{margin-top:-2px}.ds-table-column-filter-icon{display:flex;flex-direction:column}.ds-table-column-filter-icon svg{color:var(--ds-color-text-disabled);font-size:.875rem}:is(.ds-table-column-filter-icon svg):hover{color:var(--ds-color-text-secondary)}.ds-table-column-filter-icon.ds-table-column-filter-icon-active svg{color:var(--ds-color-primary)}.ds-table-wrapper .ds-table-ping-left .ds-table-cell-fix-left-first:after,.ds-table-wrapper .ds-table-ping-left .ds-table-cell-fix-left-last:after{box-shadow:inset 10px 0 8px -8px var(--ds-color-table-fixed-column-shadow)}.ds-table-wrapper .ds-table-ping-right .ds-table-cell-fix-right-first:after,.ds-table-wrapper .ds-table-ping-right .ds-table-cell-fix-right-last:after{box-shadow:inset -10px 0 8px -8px var(--ds-color-table-fixed-column-shadow)}.ds-table-wrapper .ds-table-ping-right:not(.ds-table-has-fix-right) .ds-table-container:after{box-shadow:inset -10px 0 8px -8px var(--ds-color-table-fixed-column-shadow)}.ds-table-wrapper .ds-table-ping-left:not(.ds-table-has-fix-left) .ds-table-container:before{box-shadow:inset 10px 0 8px -8px var(--ds-color-table-fixed-column-shadow)}.ds-table-wrapper{display:flex;flex-direction:column}.ds-table-wrapper .ds-spin-nested-loading,.ds-table-wrapper .ds-spin-container{display:flex;flex-direction:column;flex-shrink:1;flex-grow:1;min-height:0}:is(.ds-table-wrapper .ds-spin-container) .ds-table{flex-shrink:1;flex-grow:1;min-height:0}.ds-table{display:flex;flex-direction:column}.ds-table-container{flex-shrink:1;min-height:0;display:flex;flex-direction:column}.ds-table-header{flex-shrink:0}.ds-table-body{flex-shrink:1}}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { X as d } from "@bioturing/assets";
|
|
3
|
+
import r from "antd/es/tag";
|
|
4
|
+
import './style.css';/* empty css */
|
|
5
|
+
const g = ({
|
|
6
|
+
className: t,
|
|
7
|
+
active: n = !1,
|
|
8
|
+
color: a,
|
|
9
|
+
style: c,
|
|
10
|
+
closeIcon: s,
|
|
11
|
+
closable: e,
|
|
12
|
+
...i
|
|
13
|
+
}) => /* @__PURE__ */ o(
|
|
14
|
+
r,
|
|
15
|
+
{
|
|
16
|
+
className: t,
|
|
17
|
+
color: a,
|
|
18
|
+
style: c,
|
|
19
|
+
closable: e,
|
|
20
|
+
closeIcon: e ? s || /* @__PURE__ */ o(d, { weight: "bold" }) : void 0,
|
|
21
|
+
...n ? { "data-active": "true" } : {},
|
|
22
|
+
...i
|
|
23
|
+
}
|
|
24
|
+
), C = Object.assign(g, {
|
|
25
|
+
CheckableTag: r.CheckableTag
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
C as Tag
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Tag/component.tsx"],"sourcesContent":["\"use client\";\nimport { X } from \"@bioturing/assets\";\nimport { default as AntTag, type TagProps as AntTagProps } from \"antd/es/tag\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define props interface extending Ant Design's TagProps\nexport interface TagProps extends AntTagProps {\n /**\n * Indicates if the tag is active\n * @default false\n */\n active?: boolean;\n}\n\n// Create Tag component\nconst InternalTag = ({\n className,\n active = false,\n color,\n style,\n closeIcon,\n closable,\n ...rest\n}: TagProps) => {\n const renderedCloseIcon = <X weight=\"bold\" />;\n return (\n <AntTag\n className={className}\n color={color}\n style={style}\n closable={closable}\n closeIcon={closable ? closeIcon || renderedCloseIcon : undefined}\n {...(active ? { \"data-active\": \"true\" } : {})}\n {...rest}\n />\n );\n};\n\nexport const Tag = Object.assign(InternalTag, {\n CheckableTag: AntTag.CheckableTag,\n});\n"],"names":["InternalTag","className","active","color","style","closeIcon","closable","rest","jsx","AntTag","X","Tag"],"mappings":";;;;AAiBA,MAAMA,IAAc,CAAC;AAAA,EACnB,WAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAGI,gBAAAC;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,WAAAR;AAAA,IACA,OAAAE;AAAA,IACA,OAAAC;AAAA,IACA,UAAAE;AAAA,IACA,WAAWA,IAAWD,KAPA,gBAAAG,EAACE,GAAE,EAAA,QAAO,OAAO,CAAA,IAOgB;AAAA,IACtD,GAAIR,IAAS,EAAE,eAAe,WAAW,CAAC;AAAA,IAC1C,GAAGK;AAAA,EAAA;AACN,GAISI,IAAM,OAAO,OAAOX,GAAa;AAAA,EAC5C,cAAcS,EAAO;AACvB,CAAC;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{.ds-tag{display:inline-flex;align-items:center}.ds-tag[data-active]{background-color:var(--ds-color-primary-bg);border-color:var(--ds-color-primary);color:var(--ds-color-primary)}.ds-tag .ds-tag-close-icon{color:var(--ds-color-icon)}}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import n from "antd/es/config-provider";
|
|
3
|
+
import { useLayoutEffect as f, Children as u, isValidElement as p, cloneElement as a } from "react";
|
|
4
|
+
import { lightTheme as d, darkTheme as v } from "../../tokens/and-theme/tokens.js";
|
|
5
|
+
import { StyleProvider as g } from "@ant-design/cssinjs";
|
|
6
|
+
import './style.css';/* empty css */
|
|
7
|
+
import { useCls as h } from "../utils/antdUtils.js";
|
|
8
|
+
import { clsx as c } from "../utils/cn.js";
|
|
9
|
+
const y = ({
|
|
10
|
+
children: e,
|
|
11
|
+
theme: m,
|
|
12
|
+
appendClassesTo: r
|
|
13
|
+
}) => {
|
|
14
|
+
const l = h(), i = c(l("theme-provider"), m.toString());
|
|
15
|
+
return f(() => {
|
|
16
|
+
const t = i.split(" "), o = typeof r == "string" ? document.querySelector(r) : r;
|
|
17
|
+
return o && o.classList.add(...t), () => {
|
|
18
|
+
o && o.classList.remove(...t);
|
|
19
|
+
};
|
|
20
|
+
}, [r, i]), r === void 0 ? u.map(e, (t) => p(t) ? a(t, {
|
|
21
|
+
className: c(
|
|
22
|
+
t.props.className,
|
|
23
|
+
i
|
|
24
|
+
)
|
|
25
|
+
}) : t) : e;
|
|
26
|
+
}, q = ({
|
|
27
|
+
theme: e,
|
|
28
|
+
appendClassesTo: m,
|
|
29
|
+
children: r
|
|
30
|
+
}) => /* @__PURE__ */ s(g, { layer: !0, children: /* @__PURE__ */ s(
|
|
31
|
+
n,
|
|
32
|
+
{
|
|
33
|
+
theme: e == "light" ? d : v,
|
|
34
|
+
prefixCls: "ds",
|
|
35
|
+
children: /* @__PURE__ */ s(y, { theme: e, appendClassesTo: m, children: r })
|
|
36
|
+
}
|
|
37
|
+
) });
|
|
38
|
+
export {
|
|
39
|
+
q as ThemeProvider
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/ThemeProvider/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as ConfigProvider,\n type ConfigProviderProps,\n} from \"antd/es/config-provider\";\nimport { Children, cloneElement, isValidElement, useLayoutEffect } from \"react\";\nimport { darkTheme, lightTheme } from \"../../tokens/and-theme/tokens\";\nimport { useCls, clsx } from \"../utils\";\nimport { StyleProvider } from \"@ant-design/cssinjs\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\nexport interface ThemeProviderProps\n extends Omit<ConfigProviderProps, \"theme\" | \"prefixCls\"> {\n theme: \"light\" | \"dark\";\n appendClassesTo?: string | HTMLElement;\n}\n\nconst DSWrapper = ({\n children,\n theme,\n appendClassesTo,\n}: {\n children: React.ReactNode;\n theme: \"light\" | \"dark\";\n appendClassesTo?: string | HTMLElement;\n}) => {\n const cls = useCls();\n const className = clsx(cls(\"theme-provider\"), theme.toString());\n useLayoutEffect(() => {\n const classes = className.split(\" \");\n const el =\n typeof appendClassesTo === \"string\"\n ? document.querySelector(appendClassesTo)\n : appendClassesTo;\n if (el) {\n el.classList.add(...classes);\n }\n return () => {\n if (el) {\n el.classList.remove(...classes);\n }\n };\n }, [appendClassesTo, className]);\n return appendClassesTo === undefined\n ? Children.map(children, (child) => {\n if (isValidElement(child))\n return cloneElement(child, {\n className: clsx(\n (child.props as { className?: string }).className,\n className\n ),\n } as { className: string });\n return child;\n })\n : children;\n};\n\nexport const ThemeProvider = ({\n theme,\n appendClassesTo,\n children,\n}: ThemeProviderProps) => {\n return (\n <StyleProvider layer>\n <ConfigProvider\n theme={theme == \"light\" ? lightTheme : darkTheme}\n prefixCls=\"ds\"\n >\n <DSWrapper theme={theme} appendClassesTo={appendClassesTo}>\n {children}\n </DSWrapper>\n </ConfigProvider>\n </StyleProvider>\n );\n};\n"],"names":["DSWrapper","children","theme","appendClassesTo","cls","useCls","className","clsx","useLayoutEffect","classes","el","Children","child","isValidElement","cloneElement","ThemeProvider","jsx","StyleProvider","ConfigProvider","lightTheme","darkTheme"],"mappings":";;;;;;;;AAmBA,MAAMA,IAAY,CAAC;AAAA,EACjB,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,iBAAAC;AACF,MAIM;AACJ,QAAMC,IAAMC,EAAO,GACbC,IAAYC,EAAKH,EAAI,gBAAgB,GAAGF,EAAM,UAAU;AAC9D,SAAAM,EAAgB,MAAM;AACd,UAAAC,IAAUH,EAAU,MAAM,GAAG,GAC7BI,IACJ,OAAOP,KAAoB,WACvB,SAAS,cAAcA,CAAe,IACtCA;AACN,WAAIO,KACCA,EAAA,UAAU,IAAI,GAAGD,CAAO,GAEtB,MAAM;AACX,MAAIC,KACCA,EAAA,UAAU,OAAO,GAAGD,CAAO;AAAA,IAElC;AAAA,EAAA,GACC,CAACN,GAAiBG,CAAS,CAAC,GACxBH,MAAoB,SACvBQ,EAAS,IAAIV,GAAU,CAACW,MAClBC,EAAeD,CAAK,IACfE,EAAaF,GAAO;AAAA,IACzB,WAAWL;AAAA,MACRK,EAAM,MAAiC;AAAA,MACxCN;AAAA,IAAA;AAAA,EACF,CACwB,IACrBM,CACR,IACDX;AACN,GAEac,IAAgB,CAAC;AAAA,EAC5B,OAAAb;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAF;AACF,MAEI,gBAAAe,EAACC,GAAc,EAAA,OAAK,IAClB,UAAA,gBAAAD;AAAA,EAACE;AAAA,EAAA;AAAA,IACC,OAAOhB,KAAS,UAAUiB,IAAaC;AAAA,IACvC,WAAU;AAAA,IAEV,UAAC,gBAAAJ,EAAAhB,GAAA,EAAU,OAAAE,GAAc,iBAAAC,GACtB,UAAAF,EACH,CAAA;AAAA,EAAA;AAAA,GAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{--ds-modal-padding: 24px;--ds-modal-edge-padding: 16px;--ds-popup-panel-padding: 16px;--ds-scrollbar-width: auto;--ds-scrollbar-width-legacy: 15;--ds-box-shadow-popover-arrow: 0px 0px 1px 0px var(--ds-color-border-modal), 2px 2px 5px rgba(0, 0, 0, .05)}:root{--ds-inter: "Inter", Helvetica, Arial, sans-serif;--ds-roboto-mono: "Roboto Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}@supports (font-variation-settings: normal){:root{--ds-inter: "InterVariable", Inter, Helvetica, Arial, sans-serif;--ds-roboto-mono: "Roboto Mono Variable", Roboto Mono, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-optical-sizing:auto}}@layer components{.ds-theme-provider{--ds-color-bg-segment-active: #ffffff;--ds-scrollbar-color-thumb: rgba(0, 0, 0, .2);--ds-scrollbar-color-track: rgba(0, 0, 0, 0);--ds-color-base-solid: #000000;--ds-color-table-fixed-column-shadow: rgb(0 0 0 / 10%);--ds-color-border-modal: rgba(0, 0, 0, .24)}.ds-theme-provider.dark{--ds-color-border-modal: rgba(255, 255, 255, .55);--ds-color-bg-segment-active: #424248;--ds-scrollbar-color-thumb: rgba(255, 255, 255, .2);--ds-scrollbar-color-track: rgba(0, 0, 0, 0);--ds-color-base-solid: #ffffff;--ds-color-table-fixed-column-shadow: rgb(0 0 0 / 20%)}}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { X as N, CircleNotch as g, CheckCircle as w, XCircle as T, WarningCircle as k, Info as b } from "@bioturing/assets";
|
|
3
|
+
import { Toast as s } from "@base-ui-components/react";
|
|
4
|
+
import { toastManager as a } from "./function.js";
|
|
5
|
+
import { useEffect as v, useCallback as x } from "react";
|
|
6
|
+
import { Button as B } from "../Button/component.js";
|
|
7
|
+
import { Modal as I } from "../Modal/index.js";
|
|
8
|
+
import './style.css';/* empty css */
|
|
9
|
+
import { isTracebackError as M } from "../utils/isTracebackError.js";
|
|
10
|
+
import { CodeBlock as P } from "../CodeBlock/component.js";
|
|
11
|
+
import { useCls as f, useAntdCssVarClassname as V } from "../utils/antdUtils.js";
|
|
12
|
+
import { IconButton as j } from "../IconButton/component.js";
|
|
13
|
+
import { clsx as E } from "../utils/cn.js";
|
|
14
|
+
function u({
|
|
15
|
+
toast: e
|
|
16
|
+
}) {
|
|
17
|
+
var l;
|
|
18
|
+
const o = f(), n = {
|
|
19
|
+
info: /* @__PURE__ */ r(b, { weight: "fill" }),
|
|
20
|
+
warning: /* @__PURE__ */ r(k, { weight: "fill" }),
|
|
21
|
+
error: /* @__PURE__ */ r(T, { weight: "fill" }),
|
|
22
|
+
success: /* @__PURE__ */ r(w, { weight: "fill" }),
|
|
23
|
+
progress: /* @__PURE__ */ r(g, {})
|
|
24
|
+
}, i = ((l = e.data) == null ? void 0 : l.type) || "info", t = M(e == null ? void 0 : e.description);
|
|
25
|
+
v(() => {
|
|
26
|
+
t && a.update(e.id, { timeout: 0 });
|
|
27
|
+
}, [t, e.id]);
|
|
28
|
+
const h = x(
|
|
29
|
+
(C) => {
|
|
30
|
+
const { children: m, className: d, ...p } = C;
|
|
31
|
+
return t ? /* @__PURE__ */ c(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
...p,
|
|
35
|
+
className: o(
|
|
36
|
+
"toast-description",
|
|
37
|
+
t ? "toast-description-traceback" : "",
|
|
38
|
+
d
|
|
39
|
+
),
|
|
40
|
+
children: [
|
|
41
|
+
/* @__PURE__ */ c("p", { children: [
|
|
42
|
+
"An unexpected error occurred.",
|
|
43
|
+
/* @__PURE__ */ r("br", {}),
|
|
44
|
+
"Please contact us with error details for support."
|
|
45
|
+
] }),
|
|
46
|
+
/* @__PURE__ */ r("p", { children: /* @__PURE__ */ r(
|
|
47
|
+
B,
|
|
48
|
+
{
|
|
49
|
+
size: "small",
|
|
50
|
+
onClick: () => {
|
|
51
|
+
I.open({
|
|
52
|
+
title: "Error details",
|
|
53
|
+
content: /* @__PURE__ */ r(P, { children: m }),
|
|
54
|
+
hideOkButton: !0
|
|
55
|
+
}), a.close(e.id);
|
|
56
|
+
},
|
|
57
|
+
children: "View error details"
|
|
58
|
+
}
|
|
59
|
+
) })
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
) : /* @__PURE__ */ r("p", { ...p, className: o("toast-description", d), children: m });
|
|
63
|
+
},
|
|
64
|
+
[t, o, e.id]
|
|
65
|
+
);
|
|
66
|
+
return /* @__PURE__ */ c(s.Root, { toast: e, className: o("toast"), children: [
|
|
67
|
+
/* @__PURE__ */ r("span", { className: o("toast-icon-wrap"), children: /* @__PURE__ */ r("span", { className: o("toast-icon", `toast-icon-${i}`), children: n[i] }) }),
|
|
68
|
+
/* @__PURE__ */ c("div", { className: o("toast-content"), children: [
|
|
69
|
+
/* @__PURE__ */ r(s.Title, { className: o("toast-title") }),
|
|
70
|
+
/* @__PURE__ */ r(s.Description, { render: h })
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ r(
|
|
73
|
+
s.Close,
|
|
74
|
+
{
|
|
75
|
+
className: o("toast-close"),
|
|
76
|
+
render: /* @__PURE__ */ r(j, { size: "small", children: /* @__PURE__ */ r(N, {}) })
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] });
|
|
80
|
+
}
|
|
81
|
+
function y({ className: e }) {
|
|
82
|
+
const { toasts: o } = s.useToastManager(), n = f(), i = V();
|
|
83
|
+
return /* @__PURE__ */ r(
|
|
84
|
+
s.Viewport,
|
|
85
|
+
{
|
|
86
|
+
className: E(n("toast-viewport"), i, e),
|
|
87
|
+
children: o.map((t) => /* @__PURE__ */ r(u, { toast: t }, t.id))
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
function z(e) {
|
|
92
|
+
return /* @__PURE__ */ r(s.Provider, { toastManager: a, ...e });
|
|
93
|
+
}
|
|
94
|
+
const K = Object.assign(u, {
|
|
95
|
+
List: y,
|
|
96
|
+
Provider: z
|
|
97
|
+
});
|
|
98
|
+
export {
|
|
99
|
+
K as Toast
|
|
100
|
+
};
|
|
101
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Toast/component.tsx"],"sourcesContent":["\"use client\";\nimport { useAntdCssVarClassname, 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 const cssVars = useAntdCssVarClassname();\n\n return (\n <BaseToast.Viewport\n className={clsx(cls(\"toast-viewport\"), cssVars, className)}\n >\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","cssVars","useAntdCssVarClassname","clsx","ToastProvider","Toast"],"mappings":";;;;;;;;;;;;;AAuBA,SAASA,EAAW;AAAA,EAClB,OAAAC;AACF,GAEG;;AACD,QAAMC,IAAMC,EAAO,GACbC,IAAe;AAAA,IACnB,MAAM,gBAAAC,EAACC,GAAK,EAAA,QAAO,OAAO,CAAA;AAAA,IAC1B,SAAS,gBAAAD,EAACE,GAAc,EAAA,QAAO,OAAO,CAAA;AAAA,IACtC,OAAO,gBAAAF,EAACG,GAAQ,EAAA,QAAO,OAAO,CAAA;AAAA,IAC9B,SAAS,gBAAAH,EAACI,GAAY,EAAA,QAAO,OAAO,CAAA;AAAA,IACpC,4BAAWC,GAAY,CAAA,CAAA;AAAA,EACzB,GACMC,MAAOC,IAAAX,EAAM,SAAN,gBAAAW,EAAY,SAAQ,QAC3BC,IAAcC,EAAiBb,KAAA,gBAAAA,EAAO,WAAW;AAGvD,EAAAc,EAAU,MAAM;AACd,IAAIF,KACFG,EAAa,OAAOf,EAAM,IAAI,EAAE,SAAS,GAAG;AAAA,EAE7C,GAAA,CAACY,GAAaZ,EAAM,EAAE,CAAC;AAE1B,QAAMgB,IAA2DC;AAAA,IAC/D,CAACC,MAA4B;AAC3B,YAAM,EAAE,UAAAC,GAAU,WAAAC,GAAW,GAAGC,EAAS,IAAAH;AACzC,aAAIN,IAEA,gBAAAU;AAAA,QAAC;AAAA,QAAA;AAAA,UACE,GAAGD;AAAA,UACJ,WAAWpB;AAAA,YACT;AAAA,YACAW,IAAc,gCAAgC;AAAA,YAC9CQ;AAAA,UACF;AAAA,UAEA,UAAA;AAAA,YAAA,gBAAAE,EAAC,KAAE,EAAA,UAAA;AAAA,cAAA;AAAA,gCAEA,MAAG,EAAA;AAAA,cAAE;AAAA,YAAA,GAER;AAAA,8BACC,KACC,EAAA,UAAA,gBAAAlB;AAAA,cAACmB;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS,MAAM;AACb,kBAAAC,EAAM,KAAK;AAAA,oBACT,OAAO;AAAA,oBACP,SAAU,gBAAApB,EAAAqB,GAAA,EAAW,UAAAN,EAAS,CAAA;AAAA,oBAC9B,cAAc;AAAA,kBAAA,CACf,GACYJ,EAAA,MAAMf,EAAM,EAAE;AAAA,gBAC7B;AAAA,gBACD,UAAA;AAAA,cAAA;AAAA,YAAA,EAGH,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACF,IAIF,gBAAAI,EAAC,OAAG,GAAGiB,GAAM,WAAWpB,EAAI,qBAAqBmB,CAAS,GACvD,UAAAD,GACH;AAAA,IAEJ;AAAA,IACA,CAACP,GAAaX,GAAKD,EAAM,EAAE;AAAA,EAC7B;AAEE,SAAA,gBAAAsB,EAACI,EAAU,MAAV,EAAe,OAAA1B,GAAc,WAAWC,EAAI,OAAO,GAClD,UAAA;AAAA,IAAA,gBAAAG,EAAC,UAAK,WAAWH,EAAI,iBAAiB,GACpC,4BAAC,QAAK,EAAA,WAAWA,EAAI,cAAc,cAAcS,CAAI,EAAE,GACpD,UAAaP,EAAAO,CAAI,EACpB,CAAA,GACF;AAAA,IACC,gBAAAY,EAAA,OAAA,EAAI,WAAWrB,EAAI,eAAe,GACjC,UAAA;AAAA,MAAA,gBAAAG,EAACsB,EAAU,OAAV,EAAgB,WAAWzB,EAAI,aAAa,GAAG;AAAA,MAC/C,gBAAAG,EAAAsB,EAAU,aAAV,EAAsB,QAAQV,EAAmB,CAAA;AAAA,IAAA,GACpD;AAAA,IACA,gBAAAZ;AAAA,MAACsB,EAAU;AAAA,MAAV;AAAA,QACC,WAAWzB,EAAI,aAAa;AAAA,QAC5B,QACG,gBAAAG,EAAAuB,GAAA,EAAW,MAAK,SACf,UAAA,gBAAAvB,EAACwB,KAAE,EACL,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAEH,GACH;AAEJ;AAEA,SAASC,EAAU,EAAE,WAAAT,KAAqC;AACxD,QAAM,EAAE,QAAAU,EAAA,IAAWJ,EAAU,gBAAgB,GACvCzB,IAAMC,EAAO,GACb6B,IAAUC,EAAuB;AAGrC,SAAA,gBAAA5B;AAAA,IAACsB,EAAU;AAAA,IAAV;AAAA,MACC,WAAWO,EAAKhC,EAAI,gBAAgB,GAAG8B,GAASX,CAAS;AAAA,MAExD,UAAAU,EAAO,IAAI,CAAC9B,wBACVD,GAA0B,EAAA,OAAAC,EAAA,GAAVA,EAAM,EAAkB,CAC1C;AAAA,IAAA;AAAA,EACH;AAEJ;AAEA,SAASkC,EAAchB,GAAiC;AACtD,2BAAQQ,EAAU,UAAV,EAAmB,cAAAX,GAA6B,GAAGG,GAAO;AACpE;AAEa,MAAAiB,IAAQ,OAAO,OAAOpC,GAAY;AAAA,EAC7C,MAAM8B;AAAA,EACN,UAAUK;AACZ,CAAC;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Toast as n } from "@base-ui-components/react";
|
|
2
|
+
const a = n.createToastManager();
|
|
3
|
+
function r(o) {
|
|
4
|
+
return (s, t) => a.add({
|
|
5
|
+
description: s,
|
|
6
|
+
data: {
|
|
7
|
+
type: o
|
|
8
|
+
},
|
|
9
|
+
// progress and error toasts should not auto close
|
|
10
|
+
...o === "progress" || o === "error" ? { timeout: 0 } : {},
|
|
11
|
+
...t
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
const i = Object.assign(r("info"), {
|
|
15
|
+
info: r("info"),
|
|
16
|
+
success: r("success"),
|
|
17
|
+
error: r("error"),
|
|
18
|
+
warning: r("warning"),
|
|
19
|
+
progress: r("progress")
|
|
20
|
+
});
|
|
21
|
+
export {
|
|
22
|
+
i as toast,
|
|
23
|
+
a as toastManager
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"function.js","sources":["../../../src/components/Toast/function.ts"],"sourcesContent":["\"use client\";\nimport { Toast as BaseToast } from \"@base-ui-components/react\";\nimport type { ToastData } from \"./types\";\n\nexport const toastManager = BaseToast.createToastManager();\n\nfunction createToastTypeFunction(type: ToastData[\"type\"]) {\n return (\n message: string,\n options?: Omit<\n BaseToast.useToastManager.AddOptions<ToastData>,\n \"data\" | \"description\"\n >\n ) => {\n const toastId = toastManager.add<ToastData>({\n description: message,\n data: {\n type: type,\n },\n // progress and error toasts should not auto close\n ...(type === \"progress\" || type === \"error\" ? { timeout: 0 } : {}),\n ...options,\n });\n return toastId;\n };\n}\n\nexport const toast = Object.assign(createToastTypeFunction(\"info\"), {\n info: createToastTypeFunction(\"info\"),\n success: createToastTypeFunction(\"success\"),\n error: createToastTypeFunction(\"error\"),\n warning: createToastTypeFunction(\"warning\"),\n progress: createToastTypeFunction(\"progress\"),\n});\n"],"names":["toastManager","BaseToast","createToastTypeFunction","type","message","options","toast"],"mappings":";AAIa,MAAAA,IAAeC,EAAU,mBAAmB;AAEzD,SAASC,EAAwBC,GAAyB;AACjD,SAAA,CACLC,GACAC,MAKgBL,EAAa,IAAe;AAAA,IAC1C,aAAaI;AAAA,IACb,MAAM;AAAA,MACJ,MAAAD;AAAA,IACF;AAAA;AAAA,IAEA,GAAIA,MAAS,cAAcA,MAAS,UAAU,EAAE,SAAS,EAAE,IAAI,CAAC;AAAA,IAChE,GAAGE;AAAA,EAAA,CACJ;AAGL;AAEO,MAAMC,IAAQ,OAAO,OAAOJ,EAAwB,MAAM,GAAG;AAAA,EAClE,MAAMA,EAAwB,MAAM;AAAA,EACpC,SAASA,EAAwB,SAAS;AAAA,EAC1C,OAAOA,EAAwB,OAAO;AAAA,EACtC,SAASA,EAAwB,SAAS;AAAA,EAC1C,UAAUA,EAAwB,UAAU;AAC9C,CAAC;"}
|
|
@@ -0,0 +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)}}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import i from "antd/es/tooltip";
|
|
3
|
+
import './style.css';/* empty css */
|
|
4
|
+
import { useCls as l } from "../utils/antdUtils.js";
|
|
5
|
+
import { clsx as c } from "../utils/cn.js";
|
|
6
|
+
const u = ({
|
|
7
|
+
className: o,
|
|
8
|
+
style: t,
|
|
9
|
+
arrow: r = !1,
|
|
10
|
+
...m
|
|
11
|
+
}) => {
|
|
12
|
+
const s = l();
|
|
13
|
+
return /* @__PURE__ */ p(
|
|
14
|
+
i,
|
|
15
|
+
{
|
|
16
|
+
className: c(s("tooltip"), o),
|
|
17
|
+
arrow: r,
|
|
18
|
+
style: t,
|
|
19
|
+
...m
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
u as Tooltip
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Tooltip/component.tsx"],"sourcesContent":["\"use client\";\nimport {\n default as AntTooltip,\n type TooltipProps as AntTooltipProps,\n} from \"antd/es/tooltip\";\nimport { clsx, useCls } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define props interface extending Ant Design's TooltipProps\nexport type TooltipProps = AntTooltipProps & {\n /**\n * Arrow config for of the tooltip\n * @default false\n */\n arrow?: AntTooltipProps[\"arrow\"];\n};\n\n// Create Tooltip component\nexport const Tooltip = ({\n className,\n style,\n arrow = false,\n ...rest\n}: TooltipProps) => {\n const cls = useCls();\n return (\n <AntTooltip\n className={clsx(cls(\"tooltip\"), className)}\n arrow={arrow}\n style={style}\n {...rest}\n />\n );\n};\n"],"names":["Tooltip","className","style","arrow","rest","cls","useCls","jsx","AntTooltip","clsx"],"mappings":";;;;;AAoBO,MAAMA,IAAU,CAAC;AAAA,EACtB,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,GAAGC;AACL,MAAoB;AAClB,QAAMC,IAAMC,EAAO;AAEjB,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAKJ,EAAI,SAAS,GAAGJ,CAAS;AAAA,MACzC,OAAAE;AAAA,MACA,OAAAD;AAAA,MACC,GAAGE;AAAA,IAAA;AAAA,EACN;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{.ds-tooltip .ds-tooltip-inner{min-height:auto}}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
2
|
+
import c from "antd/es/tour";
|
|
3
|
+
import './style.css';/* empty css */
|
|
4
|
+
import { useCls as d } from "../utils/antdUtils.js";
|
|
5
|
+
import { clsx as m } from "../utils/cn.js";
|
|
6
|
+
const N = ({ indicatorsRender: e, ...n }) => {
|
|
7
|
+
const r = d();
|
|
8
|
+
return /* @__PURE__ */ o(
|
|
9
|
+
c,
|
|
10
|
+
{
|
|
11
|
+
indicatorsRender: e || ((t, i) => /* @__PURE__ */ s("div", { className: r("tour-indicator-wrapper"), children: [
|
|
12
|
+
/* @__PURE__ */ s("span", { className: r("tour-indicator-summary-text"), children: [
|
|
13
|
+
t + 1,
|
|
14
|
+
"/",
|
|
15
|
+
i
|
|
16
|
+
] }),
|
|
17
|
+
/* @__PURE__ */ o("div", { children: Array.from({ length: i }).map((p, a) => /* @__PURE__ */ o(
|
|
18
|
+
"span",
|
|
19
|
+
{
|
|
20
|
+
className: m(
|
|
21
|
+
a === t && r("tour-indicator-active"),
|
|
22
|
+
r("tour-indicator")
|
|
23
|
+
)
|
|
24
|
+
},
|
|
25
|
+
a
|
|
26
|
+
)) })
|
|
27
|
+
] })),
|
|
28
|
+
...n
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
N as Tour
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/Tour/component.tsx"],"sourcesContent":["\"use client\";\nimport { default as AntTour } from \"antd/es/tour\";\nimport {\n type TourProps as AntTourProps,\n type TourStepProps as AntTourStepProps,\n} from \"antd/es/tour/interface\";\nimport { useCls, clsx } from \"../utils\";\n\n// Import component-specific styles\nimport \"./style.css\";\n\n// Define props interface extending Ant Design's TourProps\nexport interface TourProps extends AntTourProps {}\n\n// Define props interface for TourStepProps\nexport interface TourStepProps extends AntTourStepProps {}\n\n// Create Tour component\nconst Tour = ({ indicatorsRender, ...rest }: TourProps) => {\n const cls = useCls();\n const defaultIndicatorRender = (current: number, total: number) => (\n <div className={cls(\"tour-indicator-wrapper\")}>\n <span className={cls(\"tour-indicator-summary-text\")}>\n {current + 1}/{total}\n </span>\n <div>\n {Array.from({ length: total }).map<React.ReactNode>((_, index) => (\n <span\n key={index}\n className={clsx(\n index === current && cls(`tour-indicator-active`),\n cls(\"tour-indicator\")\n )}\n />\n ))}\n </div>\n </div>\n );\n return (\n <AntTour\n indicatorsRender={indicatorsRender || defaultIndicatorRender}\n {...rest}\n />\n );\n};\n\nexport { Tour };\n"],"names":["Tour","indicatorsRender","rest","cls","useCls","jsx","AntTour","current","total","jsxs","_","index","clsx"],"mappings":";;;;;AAkBA,MAAMA,IAAO,CAAC,EAAE,kBAAAC,GAAkB,GAAGC,QAAsB;AACzD,QAAMC,IAAMC,EAAO;AAoBjB,SAAA,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,kBAAkBL,MApBS,CAACM,GAAiBC,wBAC9C,OAAI,EAAA,WAAWL,EAAI,wBAAwB,GAC1C,UAAA;AAAA,QAAA,gBAAAM,EAAC,QAAK,EAAA,WAAWN,EAAI,6BAA6B,GAC/C,UAAA;AAAA,UAAUI,IAAA;AAAA,UAAE;AAAA,UAAEC;AAAA,QAAA,GACjB;AAAA,QACC,gBAAAH,EAAA,OAAA,EACE,UAAM,MAAA,KAAK,EAAE,QAAQG,EAAO,CAAA,EAAE,IAAqB,CAACE,GAAGC,MACtD,gBAAAN;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAWO;AAAA,cACTD,MAAUJ,KAAWJ,EAAI,uBAAuB;AAAA,cAChDA,EAAI,gBAAgB;AAAA,YAAA;AAAA,UACtB;AAAA,UAJKQ;AAAA,QAAA,CAMR,EACH,CAAA;AAAA,MAAA,GACF;AAAA,MAKG,GAAGT;AAAA,IAAA;AAAA,EACN;AAEJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{.ds-tour .ds-tour-header{padding-top:1rem;padding-bottom:.75rem}.ds-tour .ds-tour-title{font-size:var(--text-ds-h5);font-weight:var(--text-ds-h5--font-weight);line-height:var(--text-ds-h5--line-height)}.ds-tour .ds-tour-description{font-size:var(--text-ds-md);font-weight:var(--text-ds-md--font-weight);line-height:var(--text-ds-md--line-height)}:is(:is(.ds-tour .ds-tour-description) p,:is(.ds-tour .ds-tour-description) ul,:is(.ds-tour .ds-tour-description) ol):not(:first-child){margin-top:.875rem}:is(.ds-tour .ds-tour-description) strong{font-weight:600}:is(.ds-tour .ds-tour-description) ul{list-style:disc;padding-left:1rem}:is(.ds-tour .ds-tour-description) ol{list-style:decimal;padding-left:1rem}:is(.ds-tour .ds-tour-description) li{padding-left:.5rem}:is(.ds-tour .ds-tour-description) li:not(:first-child){margin-top:.5rem}:is(.ds-tour .ds-tour-description) li svg{display:inline-block;font-size:1.25rem;margin-bottom:-.25rem}.ds-tour .ds-tour-footer{padding-top:1rem}.ds-tour .ds-tour-indicator-wrapper{display:inline-flex;align-items:center;width:100%;height:100%;gap:.5rem}.ds-tour .ds-tour-indicator-summary-text{font-size:var(--text-ds-sm);font-weight:var(--text-ds-sm--font-weight);line-height:var(--text-ds-sm--line-height);color:var(--ds-color-text-tertiary);display:inline-flex;align-items:center;padding-top:.25rem}}
|