@bioturing/components 0.28.1 → 0.29.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.
- package/dist/components/breadcrumb/style.css +1 -1
- package/dist/components/checkbox/style.css +1 -1
- package/dist/components/choice-list/component.js +137 -50
- package/dist/components/choice-list/component.js.map +1 -1
- package/dist/components/choice-list/style.css +1 -1
- package/dist/components/code-block/component.js +8 -8
- package/dist/components/color-select/style.css +1 -1
- package/dist/components/combobox/component.js +171 -141
- package/dist/components/combobox/component.js.map +1 -1
- package/dist/components/combobox/style.css +1 -1
- package/dist/components/drag-drop/style.css +1 -1
- package/dist/components/dropdown-menu/component.js +110 -100
- package/dist/components/dropdown-menu/component.js.map +1 -1
- package/dist/components/dropdown-menu/item.css +1 -1
- package/dist/components/dropdown-menu/item.js +52 -49
- package/dist/components/dropdown-menu/item.js.map +1 -1
- package/dist/components/dropdown-menu/style.css +1 -1
- package/dist/components/ds-root/component.js +22 -17
- package/dist/components/ds-root/component.js.map +1 -1
- package/dist/components/ds-root/style.css +1 -1
- package/dist/components/form/style.css +1 -1
- package/dist/components/modal/style.css +1 -1
- package/dist/components/nav/style.css +1 -1
- package/dist/components/resizable/component.js +27 -26
- package/dist/components/resizable/component.js.map +1 -1
- package/dist/components/scroll-area/component.js +70 -24
- package/dist/components/scroll-area/component.js.map +1 -1
- package/dist/components/scroll-area/style.css +1 -1
- package/dist/components/select-trigger/component.js +150 -0
- package/dist/components/select-trigger/component.js.map +1 -0
- package/dist/components/select-trigger/style.css +1 -0
- package/dist/components/switch/style.css +1 -1
- package/dist/components/table/style.css +1 -1
- package/dist/components/theme-provider/component.js.map +1 -1
- package/dist/components/theme-provider/style.css +1 -1
- package/dist/components/toast/component.js +13 -13
- package/dist/components/toast/component.js.map +1 -1
- package/dist/components/tour/style.css +1 -1
- package/dist/components/utils/WithRenderProp.js.map +1 -1
- package/dist/index.d.ts +101 -42
- package/dist/index.js +125 -125
- package/dist/tokens/and-theme/tokens.js +12 -12
- package/dist/tokens/and-theme/tokens.js.map +1 -1
- package/package.json +6 -6
- package/dist/components/combobox/trigger.js +0 -89
- package/dist/components/combobox/trigger.js.map +0 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { XCircleIcon as K, CaretDownIcon as V } from "@bioturing/assets";
|
|
4
|
+
import W from "merge-refs";
|
|
5
|
+
import { forwardRef as X, useCallback as E, useRef as q, useEffect as B } from "react";
|
|
6
|
+
import { WithRenderProp as F } from "../utils/WithRenderProp.js";
|
|
7
|
+
import './style.css';/* empty css */
|
|
8
|
+
import { useCls as G } from "../utils/antdUtils.js";
|
|
9
|
+
import { clsx as l } from "../utils/cn.js";
|
|
10
|
+
const H = X(
|
|
11
|
+
({
|
|
12
|
+
size: h = "middle",
|
|
13
|
+
disabled: n = !1,
|
|
14
|
+
open: o = !1,
|
|
15
|
+
status: w,
|
|
16
|
+
placeholder: b = "Select...",
|
|
17
|
+
value: c,
|
|
18
|
+
prefix: x,
|
|
19
|
+
allowClear: u = !1,
|
|
20
|
+
suffixIcon: k,
|
|
21
|
+
clearIcon: m,
|
|
22
|
+
onClear: d,
|
|
23
|
+
onOpenChange: f,
|
|
24
|
+
classNames: e,
|
|
25
|
+
render: S,
|
|
26
|
+
role: j = "combobox",
|
|
27
|
+
className: L,
|
|
28
|
+
...P
|
|
29
|
+
}, T) => {
|
|
30
|
+
const r = G(), g = c != null && c !== "", $ = {
|
|
31
|
+
disabled: n,
|
|
32
|
+
open: o,
|
|
33
|
+
hasValue: g,
|
|
34
|
+
size: h
|
|
35
|
+
}, R = E(
|
|
36
|
+
(i) => {
|
|
37
|
+
i.stopPropagation(), d == null || d();
|
|
38
|
+
},
|
|
39
|
+
[d]
|
|
40
|
+
), y = q(null);
|
|
41
|
+
B(() => {
|
|
42
|
+
const i = y.current;
|
|
43
|
+
if (!i) return;
|
|
44
|
+
const v = (D) => {
|
|
45
|
+
D.key === "ArrowDown" && !n && !o && (D.preventDefault(), f == null || f(!0));
|
|
46
|
+
};
|
|
47
|
+
return i.addEventListener("keydown", v), () => {
|
|
48
|
+
i.removeEventListener("keydown", v);
|
|
49
|
+
};
|
|
50
|
+
}, [n, o, f]);
|
|
51
|
+
const A = E(
|
|
52
|
+
(i) => /* @__PURE__ */ p("button", { ...i, children: [
|
|
53
|
+
/* @__PURE__ */ t(
|
|
54
|
+
"span",
|
|
55
|
+
{
|
|
56
|
+
className: l(r("select-trigger-content"), e == null ? void 0 : e.content),
|
|
57
|
+
children: g ? /* @__PURE__ */ p("span", { className: r("select-trigger-value-with-prefix"), children: [
|
|
58
|
+
x,
|
|
59
|
+
/* @__PURE__ */ t(
|
|
60
|
+
"span",
|
|
61
|
+
{
|
|
62
|
+
className: l(
|
|
63
|
+
r("select-trigger-value"),
|
|
64
|
+
e == null ? void 0 : e.value
|
|
65
|
+
),
|
|
66
|
+
children: c
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] }) : /* @__PURE__ */ t(
|
|
70
|
+
"span",
|
|
71
|
+
{
|
|
72
|
+
className: l(
|
|
73
|
+
r("select-trigger-placeholder"),
|
|
74
|
+
e == null ? void 0 : e.placeholder
|
|
75
|
+
),
|
|
76
|
+
children: b
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ p(
|
|
82
|
+
"span",
|
|
83
|
+
{
|
|
84
|
+
className: l(r("select-trigger-suffix"), e == null ? void 0 : e.suffix),
|
|
85
|
+
children: [
|
|
86
|
+
u && g && /* @__PURE__ */ t(
|
|
87
|
+
"span",
|
|
88
|
+
{
|
|
89
|
+
className: r("select-trigger-clear"),
|
|
90
|
+
unselectable: "on",
|
|
91
|
+
"aria-hidden": "true",
|
|
92
|
+
onClick: R,
|
|
93
|
+
children: m || /* @__PURE__ */ t("span", { className: r("select-trigger-clear-icon"), children: /* @__PURE__ */ t(K, { weight: "fill" }) })
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
(!u || !g) && /* @__PURE__ */ t(
|
|
97
|
+
"span",
|
|
98
|
+
{
|
|
99
|
+
className: r("select-trigger-arrow"),
|
|
100
|
+
unselectable: "on",
|
|
101
|
+
"aria-hidden": "true",
|
|
102
|
+
children: k || /* @__PURE__ */ t("span", { className: r("select-trigger-arrow-icon"), children: /* @__PURE__ */ t(V, { weight: "bold" }) })
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
] }),
|
|
109
|
+
[
|
|
110
|
+
g,
|
|
111
|
+
c,
|
|
112
|
+
x,
|
|
113
|
+
b,
|
|
114
|
+
u,
|
|
115
|
+
k,
|
|
116
|
+
m,
|
|
117
|
+
r,
|
|
118
|
+
e,
|
|
119
|
+
R
|
|
120
|
+
]
|
|
121
|
+
);
|
|
122
|
+
return /* @__PURE__ */ t(
|
|
123
|
+
F,
|
|
124
|
+
{
|
|
125
|
+
as: "button",
|
|
126
|
+
ref: W(T, y),
|
|
127
|
+
state: $,
|
|
128
|
+
className: l(
|
|
129
|
+
r("select-trigger"),
|
|
130
|
+
r(`select-trigger-${h}`),
|
|
131
|
+
n && r("select-trigger-disabled"),
|
|
132
|
+
o && r("select-trigger-open"),
|
|
133
|
+
w && r(`select-trigger-${w}`),
|
|
134
|
+
e == null ? void 0 : e.trigger,
|
|
135
|
+
L
|
|
136
|
+
),
|
|
137
|
+
disabled: n,
|
|
138
|
+
role: j,
|
|
139
|
+
"aria-expanded": o,
|
|
140
|
+
render: S || A,
|
|
141
|
+
...P
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
H.displayName = "SelectTrigger";
|
|
147
|
+
export {
|
|
148
|
+
H as SelectTrigger
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/select-trigger/component.tsx"],"sourcesContent":["\"use client\";\nimport { CaretDownIcon, XCircleIcon } from \"@bioturing/assets\";\nimport mergeRefs from \"merge-refs\";\nimport React, { forwardRef, useCallback, useEffect, useRef } from \"react\";\nimport { clsx, useCls } from \"../utils\";\nimport { WithRenderProp, WithRenderPropProps } from \"../utils/WithRenderProp\";\nimport { ValidateStatus } from \"antd/es/form/FormItem\";\nimport \"./style.css\";\n\nexport type SelectTriggerState = {\n disabled: boolean;\n open: boolean;\n hasValue: boolean;\n size: \"small\" | \"middle\" | \"large\";\n};\n\nexport interface SelectTriggerProps\n extends Omit<\n WithRenderPropProps<\"button\", SelectTriggerState>,\n \"value\" | \"prefix\"\n > {\n /** Size variant */\n size?: \"small\" | \"middle\" | \"large\";\n /** Whether the component is disabled */\n disabled?: boolean;\n /** Whether the dropdown/popup is open */\n open?: boolean;\n /** Validation status */\n status?: ValidateStatus;\n /** Placeholder text */\n placeholder?: string;\n /** Current value/content to display */\n value?: React.ReactNode;\n /** Prefix content to display before the value (e.g., icon) */\n prefix?: React.ReactNode;\n /** Whether to show clear button when there's a value */\n allowClear?: boolean;\n /** Custom suffix icon (arrow icon) */\n suffixIcon?: React.ReactNode;\n /** Custom clear icon */\n clearIcon?: React.ReactNode;\n /** Clear handler */\n onClear?: () => void;\n /** Open state change handler */\n onOpenChange?: (open: boolean) => void;\n /** Custom class names */\n classNames?: {\n trigger?: string;\n content?: string;\n suffix?: string;\n placeholder?: string;\n value?: string;\n };\n}\n\nexport const SelectTrigger = forwardRef<HTMLButtonElement, SelectTriggerProps>(\n (\n {\n size = \"middle\",\n disabled = false,\n open = false,\n status,\n placeholder = \"Select...\",\n value,\n prefix,\n allowClear = false,\n suffixIcon,\n clearIcon,\n onClear,\n onOpenChange,\n classNames,\n render,\n role = \"combobox\",\n className,\n ...rest\n },\n ref\n ) => {\n const cls = useCls();\n const hasValue = value !== undefined && value !== null && value !== \"\";\n\n const triggerState: SelectTriggerState = {\n disabled,\n open,\n hasValue,\n size,\n };\n\n const handleClearClick = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n onClear?.();\n },\n [onClear]\n );\n\n // Internal ref for the button element\n const buttonRef = useRef<HTMLButtonElement>(null);\n\n // Handle keyboard shortcuts with addEventListener\n useEffect(() => {\n const buttonElement = buttonRef.current;\n if (!buttonElement) return;\n\n const handleKeyDown = (e: KeyboardEvent) => {\n // Alt + Down Arrow to open dropdown\n if (e.key === \"ArrowDown\" && !disabled && !open) {\n e.preventDefault();\n onOpenChange?.(true);\n }\n // Escape to close dropdown\n // Comment because Popover would handle it\n // if (e.key === \"Escape\" && open) {\n // e.preventDefault();\n // onOpenChange?.(false);\n // }\n };\n\n buttonElement.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n buttonElement.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [disabled, open, onOpenChange]);\n\n const defaultRender = useCallback(\n (props: React.ComponentPropsWithoutRef<\"button\">) => (\n <button {...props}>\n <span\n className={clsx(cls(\"select-trigger-content\"), classNames?.content)}\n >\n {hasValue ? (\n <span className={cls(\"select-trigger-value-with-prefix\")}>\n {prefix}\n <span\n className={clsx(\n cls(\"select-trigger-value\"),\n classNames?.value\n )}\n >\n {value}\n </span>\n </span>\n ) : (\n <span\n className={clsx(\n cls(\"select-trigger-placeholder\"),\n classNames?.placeholder\n )}\n >\n {placeholder}\n </span>\n )}\n </span>\n <span\n className={clsx(cls(\"select-trigger-suffix\"), classNames?.suffix)}\n >\n {allowClear && hasValue && (\n <span\n className={cls(\"select-trigger-clear\")}\n unselectable=\"on\"\n aria-hidden=\"true\"\n onClick={handleClearClick}\n >\n {clearIcon || (\n <span className={cls(\"select-trigger-clear-icon\")}>\n <XCircleIcon weight=\"fill\" />\n </span>\n )}\n </span>\n )}\n {(!allowClear || !hasValue) && (\n <span\n className={cls(\"select-trigger-arrow\")}\n unselectable=\"on\"\n aria-hidden=\"true\"\n >\n {suffixIcon || (\n <span className={cls(\"select-trigger-arrow-icon\")}>\n <CaretDownIcon weight=\"bold\" />\n </span>\n )}\n </span>\n )}\n </span>\n </button>\n ),\n [\n hasValue,\n value,\n prefix,\n placeholder,\n allowClear,\n suffixIcon,\n clearIcon,\n cls,\n classNames,\n handleClearClick,\n ]\n );\n\n return (\n <WithRenderProp\n as=\"button\"\n ref={mergeRefs(ref, buttonRef)}\n state={triggerState}\n className={clsx(\n cls(\"select-trigger\"),\n cls(`select-trigger-${size}`),\n disabled && cls(\"select-trigger-disabled\"),\n open && cls(\"select-trigger-open\"),\n status && cls(`select-trigger-${status}`),\n classNames?.trigger,\n className\n )}\n disabled={disabled}\n role={role}\n aria-expanded={open}\n render={render || defaultRender}\n {...rest}\n />\n );\n }\n);\n\nSelectTrigger.displayName = \"SelectTrigger\";\n"],"names":["SelectTrigger","forwardRef","size","disabled","open","status","placeholder","value","prefix","allowClear","suffixIcon","clearIcon","onClear","onOpenChange","classNames","render","role","className","rest","ref","cls","useCls","hasValue","triggerState","handleClearClick","useCallback","e","buttonRef","useRef","useEffect","buttonElement","handleKeyDown","defaultRender","props","jsxs","jsx","clsx","XCircleIcon","CaretDownIcon","WithRenderProp","mergeRefs"],"mappings":";;;;;;;;;AAuDO,MAAMA,IAAgBC;AAAA,EAC3B,CACE;AAAA,IACE,MAAAC,IAAO;AAAA,IACP,UAAAC,IAAW;AAAA,IACX,MAAAC,IAAO;AAAA,IACP,QAAAC;AAAA,IACA,aAAAC,IAAc;AAAA,IACd,OAAAC;AAAA,IACA,QAAAC;AAAA,IACA,YAAAC,IAAa;AAAA,IACb,YAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC,IAAO;AAAA,IACP,WAAAC;AAAA,IACA,GAAGC;AAAA,KAELC,MACG;AACH,UAAMC,IAAMC,EAAO,GACbC,IAAkCf,KAAU,QAAQA,MAAU,IAE9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B,OAAOJ;AAAA,QACP,WAAWa;AAAA,UACThB,EAAI,gBAAgB;AAAA,UACpBA,EAAI,kBAAkBlB,CAAI,EAAE;AAAA,UAC5BC,KAAYiB,EAAI,yBAAyB;AAAA,UACzChB,KAAQgB,EAAI,qBAAqB;AAAA,UACjCf,KAAUe,EAAI,kBAAkBf,CAAM,EAAE;AAAA,UACxCS,KAAA,gBAAAA,EAAY;AAAA,UACZG;AAAA,QACF;AAAA,QACA,UAAAd;AAAA,QACA,MAAAa;AAAA,QACA,iBAAeZ;AAAA,QACf,QAAQW,KAAUiB;AAAA,QACjB,GAAGd;AAAA,MAAA;AAAA,IACN;AAAA,EAAA;AAGN;AAEAlB,EAAc,cAAc;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer components{.ds-select-trigger{position:relative;display:inline-flex;align-items:center;cursor:pointer;width:100%;background-color:var(--ds-control-color-bg);border:1px solid var(--ds-control-color-border);border-radius:var(--ds-control-border-radius);transition:var(--ds-control-transition);text-align:left}.ds-select-trigger:focus,.ds-select-trigger:focus-visible{outline:none}.ds-select-trigger:hover:not(.ds-select-trigger-disabled){border-color:var(--ds-control-color-border-hover)}.ds-select-trigger:focus,.ds-select-trigger:focus-visible,.ds-select-trigger-focused{border:var(--ds-control-border-active);box-shadow:var(--ds-control-shadow-active)}.ds-select-trigger-open{border:var(--ds-control-border-active)}.ds-select-trigger-disabled{background-color:var(--ds-control-color-bg-disabled);border:var(--ds-control-color-border);cursor:not-allowed;color:var(--ds-control-color-text-disabled)}.ds-select-trigger-error{border:var(--ds-control-border-error-active)}.ds-select-trigger-error:focus,.ds-select-trigger-error:focus-visible,.ds-select-trigger-error.ds-select-trigger-focused{border:var(--ds-control-border-error-active);box-shadow:var(--ds-control-shadow-error-active)}.ds-select-trigger-warning{border:var(--ds-control-border-warning-active)}.ds-select-trigger-warning:focus,.ds-select-trigger-warning:focus-visible,.ds-select-trigger-warning.ds-select-trigger-focused{border:var(--ds-control-border-warning-active);box-shadow:var(--ds-control-shadow-warning-active)}.ds-select-trigger-content{display:flex;align-items:center;flex:1;min-width:0;overflow:hidden}.ds-select-trigger-value{flex:1;color:var(--ds-control-color-text);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}.ds-select-trigger-value-with-prefix{display:flex;align-items:center;gap:8px;flex:1;min-width:0}.ds-select-trigger-placeholder{flex:1;color:var(--ds-control-color-text-placeholder);pointer-events:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}.ds-select-trigger-suffix{display:flex;align-items:center;justify-content:center;width:var(--ds-control-icon-size);height:var(--ds-control-icon-size);position:relative;font-size:var(--ds-control-icon-size);flex-shrink:0}.ds-select-trigger-arrow{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;color:var(--ds-control-color-icon);width:var(--ds-control-icon-size);height:var(--ds-control-icon-size);pointer-events:none}.ds-select-trigger-arrow-icon{display:flex;align-items:center;justify-content:center;transition:transform .2s ease}.ds-select-trigger-open .ds-select-trigger-arrow-icon{transform:rotate(180deg)}.ds-select-trigger-clear{position:absolute;top:0;left:0;display:flex;align-items:center;justify-content:center;color:var(--ds-control-color-icon);width:var(--ds-control-icon-size);height:var(--ds-control-icon-size);cursor:pointer;transition:color .2s ease}.ds-select-trigger-clear:hover{color:var(--ds-control-color-icon-hover)}.ds-select-trigger-clear-icon{display:flex;align-items:center;justify-content:center}.ds-select-trigger-small{padding:var(--ds-control-padding-small);min-height:var(--ds-control-min-height-small);line-height:var(--ds-control-line-height)}.ds-select-trigger-middle{padding:var(--ds-control-padding-middle);min-height:var(--ds-control-min-height-middle);line-height:var(--ds-control-line-height)}.ds-select-trigger-large{padding:var(--ds-control-padding-large);min-height:var(--ds-control-min-height-large);line-height:var(--ds-control-line-height)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{
|
|
1
|
+
@layer components{.ds-switch .ds-switch-inner span.ds-switch-inner-checked,.ds-switch .ds-switch-inner span.ds-switch-inner-unchecked{display:flex;justify-items:center;align-items:center}}
|
|
@@ -1 +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}
|
|
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}.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}.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}.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;min-height:0;min-width:0}.ds-table-zebra .ds-table{background:transparent}.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table>.ds-table-thead>tr>th,.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table>.ds-table-thead>tr>td{background:transparent}.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table>.ds-table-thead>tr>th,.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table>.ds-table-thead>tr>td,.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table>.ds-table-tbody>tr>th,.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table>.ds-table-tbody>tr>td{border-bottom:0}.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table>.ds-table-tbody>.ds-table-row:nth-child(2n) .ds-table-cell{background-color:var(--ds-color-fill-tertiary)}.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table>.ds-table-tbody>.ds-table-row:nth-child(2n) .ds-table-cell:first-child{border-top-left-radius:var(--ds-border-radius);border-bottom-left-radius:var(--ds-border-radius)}.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table>.ds-table-tbody>.ds-table-row:nth-child(2n) .ds-table-cell:last-child{border-top-right-radius:var(--ds-border-radius);border-bottom-right-radius:var(--ds-border-radius)}.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table>.ds-table-tbody>.ds-table-row:nth-child(2n)>.ds-table-cell-row-hover{background-color:var(--ds-color-fill-secondary)}.ds-table-zebra>.ds-spin-nested-loading>.ds-spin-container>.ds-table>.ds-table-container>.ds-table-content>table>.ds-table-tbody>tr>td.ds-table-column-sort{background-color:unset}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/theme-provider/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, useAntdCssVarClassname } from \"../utils\";\nimport { StyleProvider } from \"@ant-design/cssinjs\";\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 cssVars = useAntdCssVarClassname();\n const className = clsx(cls(\"theme-provider\"), theme.toString(), cssVars);\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
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/theme-provider/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, useAntdCssVarClassname } from \"../utils\";\nimport { StyleProvider } from \"@ant-design/cssinjs\";\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 cssVars = useAntdCssVarClassname();\n const className = clsx(cls(\"theme-provider\"), theme.toString(), cssVars);\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","cssVars","useAntdCssVarClassname","className","clsx","useLayoutEffect","classes","el","Children","child","isValidElement","cloneElement","ThemeProvider","jsx","StyleProvider","ConfigProvider","lightTheme","darkTheme"],"mappings":";;;;;;;;;AAkBA,MAAMA,IAAY,CAAC;AAAA,EACjB,UAAAC;AAAA,EACA,OAAAC;AAAA,EACA,iBAAAC;AACF,MAIM;AACJ,QAAMC,IAAMC,EAAO,GACbC,IAAUC,EAAuB,GACjCC,IAAYC,EAAKL,EAAI,gBAAgB,GAAGF,EAAM,YAAYI,CAAO;AACvE,SAAAI,EAAgB,MAAM;AACd,UAAAC,IAAUH,EAAU,MAAM,GAAG,GAC7BI,IACJ,OAAOT,KAAoB,WACvB,SAAS,cAAcA,CAAe,IACtCA;AACN,WAAIS,KACCA,EAAA,UAAU,IAAI,GAAGD,CAAO,GAEtB,MAAM;AACX,MAAIC,KACCA,EAAA,UAAU,OAAO,GAAGD,CAAO;AAAA,IAElC;AAAA,EAAA,GACC,CAACR,GAAiBK,CAAS,CAAC,GACxBL,MAAoB,SACvBU,EAAS,IAAIZ,GAAU,CAACa,MAClBC,EAAeD,CAAK,IACfE,EAAaF,GAAO;AAAA,IACzB,WAAWL;AAAA,MACRK,EAAM,MAAiC;AAAA,MACxCN;AAAA,IAAA;AAAA,EACF,CACwB,IACrBM,CACR,IACDb;AACN,GAEagB,IAAgB,CAAC;AAAA,EAC5B,OAAAf;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAF;AACF,MAEI,gBAAAiB,EAACC,GAAc,EAAA,OAAK,IAClB,UAAA,gBAAAD;AAAA,EAACE;AAAA,EAAA;AAAA,IACC,OAAOlB,KAAS,UAAUmB,IAAaC;AAAA,IACvC,WAAU;AAAA,IAEV,UAAC,gBAAAJ,EAAAlB,GAAA,EAAU,OAAAE,GAAc,iBAAAC,GACtB,UAAAF,EACH,CAAA;AAAA,EAAA;AAAA,GAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{@keyframes ds-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ds-theme-provider{--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-modal-color-border), 2px 2px 5px rgba(0, 0, 0, .05);--ds-
|
|
1
|
+
@layer components{@keyframes ds-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ds-theme-provider{--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-modal-color-border), 2px 2px 5px rgba(0, 0, 0, .05);--ds-control-border-radius: 6px;--ds-control-transition: all .2s;--ds-control-padding-small: 1px 8px;--ds-control-padding-middle: 5px 12px;--ds-control-padding-large: 9px 12px;--ds-control-min-height-small: 24px;--ds-control-min-height-middle: 32px;--ds-control-min-height-large: 40px;--ds-control-line-height: 20px;--ds-control-color-border-hover: var(--ds-color-primary-hover);--ds-control-color-border-focus: var(--ds-color-primary);--ds-control-color-bg-disabled: var(--ds-color-bg-container-disabled);--ds-control-color-text-disabled: var(--ds-color-text-disabled);--ds-control-icon-size: 12px;--ds-control-color-bg: var(--ds-color-bg-container);--ds-control-color-border: var(--ds-color-border);--ds-control-color-border-active: var(--ds-color-primary);--ds-control-color-border-error-active: var(--ds-color-error);--ds-control-color-border-warning-active: var(--ds-color-warning);--ds-control-color-icon: var(--ds-color-text-quaternary);--ds-control-color-icon-hover: var(--ds-color-icon-hover);--ds-control-border: 1px solid var(--ds-control-color-border);--ds-control-border-active: 1px solid var(--ds-control-color-border-active);--ds-control-border-error-active: 1px solid var(--ds-control-color-border-error-active);--ds-control-border-warning-active: 1px solid var(--ds-control-color-border-warning-active);--ds-control-shadow-active: 0 0 0 2px color-mix(in oklab, var(--ds-color-primary) 20%, transparent);--ds-form-label-required-mark-color: var(--ds-color-error);--ds-control-shadow-error-active: 0 0 0 2px color-mix(in oklab, var(--ds-color-error) 20%, transparent);--ds-control-shadow-warning-active: 0 0 0 2px color-mix(in oklab, var(--ds-color-warning) 20%, transparent);--ds-control-color-text-placeholder: var(--ds-color-text-placeholder);--ds-inter: "Inter", Helvetica, Arial, sans-serif;--ds-roboto-mono: "Roboto Mono", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--ds-animate-spin: ds-spin 1s linear infinite;--ds-segment-color-bg-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-modal-color-border: rgba(0, 0, 0, .24)}@supports (font-variation-settings: normal){.ds-theme-provider{--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}}.ds-theme-provider.dark{--ds-modal-color-border: rgba(255, 255, 255, .55);--ds-segment-color-bg-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%)}}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { XIcon as g, CircleNotchIcon as w, CheckCircleIcon as C, XCircleIcon as I, WarningCircleIcon as T, InfoIcon as k } from "@bioturing/assets";
|
|
4
4
|
import { Toast as t } from "@base-ui-components/react";
|
|
5
5
|
import { toastManager as a } from "./function.js";
|
|
6
|
-
import { useEffect as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { Modal as
|
|
6
|
+
import { useEffect as b, useCallback as v } from "react";
|
|
7
|
+
import { Button as x } from "../button/component.js";
|
|
8
|
+
import { Modal as P } from "../modal/index.js";
|
|
9
9
|
import './style.css';/* empty css */
|
|
10
|
-
import { isTracebackError as
|
|
10
|
+
import { isTracebackError as B } from "../utils/isTracebackError.js";
|
|
11
11
|
import { CodeBlock as M } from "../code-block/component.js";
|
|
12
12
|
import { useCls as f } from "../utils/antdUtils.js";
|
|
13
13
|
import { IconButton as j } from "../icon-button/component.js";
|
|
@@ -17,16 +17,16 @@ function u({
|
|
|
17
17
|
}) {
|
|
18
18
|
var l;
|
|
19
19
|
const o = f(), n = {
|
|
20
|
-
info: /* @__PURE__ */ r(
|
|
21
|
-
warning: /* @__PURE__ */ r(
|
|
22
|
-
error: /* @__PURE__ */ r(
|
|
20
|
+
info: /* @__PURE__ */ r(k, { weight: "fill" }),
|
|
21
|
+
warning: /* @__PURE__ */ r(T, { weight: "fill" }),
|
|
22
|
+
error: /* @__PURE__ */ r(I, { weight: "fill" }),
|
|
23
23
|
success: /* @__PURE__ */ r(C, { weight: "fill" }),
|
|
24
24
|
progress: /* @__PURE__ */ r(w, {})
|
|
25
|
-
}, i = ((l = e.data) == null ? void 0 : l.type) || "info", s =
|
|
26
|
-
|
|
25
|
+
}, i = ((l = e.data) == null ? void 0 : l.type) || "info", s = B(e == null ? void 0 : e.description);
|
|
26
|
+
b(() => {
|
|
27
27
|
s && a.update(e.id, { timeout: 0 });
|
|
28
28
|
}, [s, e.id]);
|
|
29
|
-
const h =
|
|
29
|
+
const h = v(
|
|
30
30
|
(N) => {
|
|
31
31
|
const { children: d, className: m, ...p } = N;
|
|
32
32
|
return s ? /* @__PURE__ */ c(
|
|
@@ -45,11 +45,11 @@ function u({
|
|
|
45
45
|
"Please contact us with error details for support."
|
|
46
46
|
] }),
|
|
47
47
|
/* @__PURE__ */ r("p", { children: /* @__PURE__ */ r(
|
|
48
|
-
|
|
48
|
+
x,
|
|
49
49
|
{
|
|
50
50
|
size: "small",
|
|
51
51
|
onClick: () => {
|
|
52
|
-
|
|
52
|
+
P.open({
|
|
53
53
|
title: "Error details",
|
|
54
54
|
content: /* @__PURE__ */ r(M, { children: d }),
|
|
55
55
|
hideOkButton: !0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/toast/component.tsx"],"sourcesContent":["\"use client\";\nimport { useCls, clsx } from \"../utils\";\nimport {\n
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/toast/component.tsx"],"sourcesContent":["\"use client\";\nimport { useCls, clsx } from \"../utils\";\nimport {\n CheckCircleIcon,\n CircleNotchIcon,\n InfoIcon,\n WarningCircleIcon,\n XIcon,\n XCircleIcon,\n} from \"@bioturing/assets\";\nimport { Toast as BaseToast } from \"@base-ui-components/react\";\nimport { IconButton } from \"../icon-button\";\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 \"../code-block\";\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: <InfoIcon weight=\"fill\" />,\n warning: <WarningCircleIcon weight=\"fill\" />,\n error: <XCircleIcon weight=\"fill\" />,\n success: <CheckCircleIcon weight=\"fill\" />,\n progress: <CircleNotchIcon />,\n };\n const type = toast.data?.type || \"info\";\n const isTraceback = isTracebackError(toast?.description);\n\n // Update manager timeout for traceback to disable auto-dismiss\n useEffect(() => {\n if (isTraceback) {\n toastManager.update(toast.id, { timeout: 0 });\n }\n }, [isTraceback, toast.id]);\n // console.log(toast);\n const renderDescription: BaseToast.Description.Props[\"render\"] = useCallback(\n (props: GenericHTMLProps) => {\n const { children, className, ...rest } = props;\n if (isTraceback) {\n return (\n <div\n {...rest}\n className={cls(\n \"toast-description\",\n isTraceback ? \"toast-description-traceback\" : \"\",\n className\n )}\n >\n <p>\n An unexpected error occurred.\n <br />\n Please contact us with error details for support.\n </p>\n <p>\n <Button\n size=\"small\"\n onClick={() => {\n Modal.open({\n title: \"Error details\",\n content: <CodeBlock>{children}</CodeBlock>,\n hideOkButton: true,\n });\n toastManager.close(toast.id);\n }}\n >\n View error details\n </Button>\n </p>\n </div>\n );\n }\n return (\n <p {...rest} className={cls(\"toast-description\", className)}>\n {children}\n </p>\n );\n },\n [isTraceback, cls, toast.id]\n );\n return (\n <BaseToast.Root toast={toast} className={cls(\"toast\")}>\n <span className={cls(\"toast-icon-wrap\")}>\n <span className={cls(\"toast-icon\", `toast-icon-${type}`)}>\n {toastIconMap[type]}\n </span>\n </span>\n <div className={cls(\"toast-content\")}>\n <BaseToast.Title className={cls(\"toast-title\")} />\n <BaseToast.Description render={renderDescription} />\n </div>\n <BaseToast.Close\n className={cls(\"toast-close\")}\n render={\n <span>\n <IconButton size=\"small\">\n <XIcon />\n </IconButton>\n </span>\n }\n ></BaseToast.Close>\n </BaseToast.Root>\n );\n}\n\nfunction ToastList({ className }: { className?: string }) {\n const { toasts } = BaseToast.useToastManager();\n const cls = useCls();\n\n return (\n <BaseToast.Portal>\n <BaseToast.Viewport className={clsx(cls(\"toast-viewport\"), className)}>\n {toasts.map((toast) => (\n <InnerToast key={toast.id} toast={toast} />\n ))}\n </BaseToast.Viewport>\n </BaseToast.Portal>\n );\n}\n\nfunction ToastProvider(props: BaseToast.Provider.Props) {\n return <BaseToast.Provider toastManager={toastManager} {...props} />;\n}\n\nexport const Toast = Object.assign(InnerToast, {\n List: ToastList,\n Provider: ToastProvider,\n});\n"],"names":["InnerToast","toast","cls","useCls","toastIconMap","jsx","InfoIcon","WarningCircleIcon","XCircleIcon","CheckCircleIcon","CircleNotchIcon","type","_a","isTraceback","isTracebackError","useEffect","toastManager","renderDescription","useCallback","props","children","className","rest","jsxs","Button","Modal","CodeBlock","BaseToast","IconButton","XIcon","ToastList","toasts","clsx","ToastProvider","Toast"],"mappings":";;;;;;;;;;;;;;AAuBA,SAASA,EAAW;AAAA,EAClB,OAAAC;AACF,GAEG;;AACD,QAAMC,IAAMC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AACsB,EAAU,UAAV,EAAmB,WAAWK,EAAK9B,EAAI,gBAAgB,GAAGmB,CAAS,GACjE,UAAAU,EAAO,IAAI,CAAC9B,MACX,gBAAAI,EAACL,GAA0B,EAAA,OAAAC,EAAA,GAAVA,EAAM,EAAkB,CAC1C,EAAA,CACH,EACF,CAAA;AAEJ;AAEA,SAASgC,EAAcd,GAAiC;AACtD,2BAAQQ,EAAU,UAAV,EAAmB,cAAAX,GAA6B,GAAGG,GAAO;AACpE;AAEa,MAAAe,IAAQ,OAAO,OAAOlC,GAAY;AAAA,EAC7C,MAAM8B;AAAA,EACN,UAAUG;AACZ,CAAC;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer components{.ds-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)}
|
|
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)}.ds-tour .ds-tour-description p:not(:first-child),.ds-tour .ds-tour-description ul:not(:first-child),.ds-tour .ds-tour-description ol:not(:first-child){margin-top:.875rem}.ds-tour .ds-tour-description strong{font-weight:600}.ds-tour .ds-tour-description ul{list-style:disc;padding-left:1rem}.ds-tour .ds-tour-description ol{list-style:decimal;padding-left:1rem}.ds-tour .ds-tour-description li{padding-left:.5rem}.ds-tour .ds-tour-description li:not(:first-child){margin-top:.5rem}.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}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WithRenderProp.js","sources":["../../../src/components/utils/WithRenderProp.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { useRender } from \"@base-ui-components/react/use-render\";\nimport { ElementTypeToDOMType } from \"./types\";\n\nexport type WithRenderPropProps<\n T extends React.ElementType = \"div\",\n State extends Record<string, unknown> = Record
|
|
1
|
+
{"version":3,"file":"WithRenderProp.js","sources":["../../../src/components/utils/WithRenderProp.tsx"],"sourcesContent":["import React, { forwardRef } from \"react\";\nimport { useRender } from \"@base-ui-components/react/use-render\";\nimport { ElementTypeToDOMType } from \"./types\";\n\nexport type WithRenderPropProps<\n T extends React.ElementType = \"div\",\n State extends Record<string | number | symbol, unknown> = Record<\n string,\n unknown\n >\n> = React.ComponentPropsWithoutRef<T> & {\n render?: useRender.RenderProp<State>;\n as?: T;\n state?: State;\n};\n\nconst WithRenderPropInner = <\n T extends React.ElementType = \"div\",\n State extends Record<string, unknown> = Record<string, unknown>\n>(\n props: WithRenderPropProps<T, State>,\n ref: React.ForwardedRef<T>\n) => {\n const { render, as: Tag = \"div\", state, ...etc } = props;\n const renderedElement = useRender({\n render: render || ((props) => <Tag {...props} />),\n props: etc,\n state,\n ref: ref as unknown as React.Ref<ElementTypeToDOMType<T>>,\n });\n return renderedElement;\n};\n\nexport const WithRenderProp = forwardRef(WithRenderPropInner) as <\n T extends React.ElementType = \"div\",\n State extends Record<string, unknown> = Record<string, unknown>\n>(\n props: WithRenderPropProps<T, State> & {\n ref?: React.Ref<ElementTypeToDOMType<T>>;\n }\n) => ReturnType<typeof WithRenderPropInner>;\n"],"names":["WithRenderPropInner","props","ref","render","Tag","state","etc","useRender","jsx","WithRenderProp","forwardRef"],"mappings":";;;AAgBA,MAAMA,IAAsB,CAI1BC,GACAC,MACG;AACG,QAAA,EAAE,QAAAC,GAAQ,IAAIC,IAAM,OAAO,OAAAC,GAAO,GAAGC,MAAQL;AAO5C,SANiBM,EAAU;AAAA,IAChC,QAAQJ,MAAW,CAACF,MAAW,gBAAAO,EAAAJ,GAAA,EAAK,GAAGH,EAAO,CAAA;AAAA,IAC9C,OAAOK;AAAA,IACP,OAAAD;AAAA,IACA,KAAAH;AAAA,EAAA,CACD;AAEH,GAEaO,IAAiBC,EAAWV,CAAmB;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -248,6 +248,7 @@ import { useLayoutEffect } from 'react';
|
|
|
248
248
|
import { useRender } from '@base-ui-components/react/use-render';
|
|
249
249
|
import { useRender as useRender_2 } from '@base-ui-components/react';
|
|
250
250
|
import { useWatch } from 'antd/es/form/Form';
|
|
251
|
+
import { ValidateStatus } from 'antd/es/form/FormItem';
|
|
251
252
|
import { version } from 'antd';
|
|
252
253
|
import { Watermark } from 'antd';
|
|
253
254
|
import { WatermarkProps } from 'antd';
|
|
@@ -455,19 +456,40 @@ declare type Children = {
|
|
|
455
456
|
children?: default_2.ReactNode;
|
|
456
457
|
};
|
|
457
458
|
|
|
458
|
-
export declare const ChoiceList: <M extends boolean = false>({ items, multiple, value, onChange, searchProps, className, ...rest }: ChoiceListProps<M>) => JSX.Element;
|
|
459
|
+
export declare const ChoiceList: <M extends boolean = false>({ items, multiple, value, defaultValue, onChange, searchProps, showSelectAll, className, placeholder, disabled: disabledProp, status: statusProp, getItemKeywords, ...rest }: ChoiceListProps<M>) => JSX.Element;
|
|
459
460
|
|
|
460
461
|
export declare type ChoiceListItem = {
|
|
461
462
|
label: React.ReactNode;
|
|
462
463
|
value?: string;
|
|
463
464
|
};
|
|
464
465
|
|
|
465
|
-
export declare interface ChoiceListProps<M extends boolean = false> extends Omit<CommandProps, "value" | "onChange"> {
|
|
466
|
+
export declare interface ChoiceListProps<M extends boolean = false> extends Omit<CommandProps, "value" | "onChange" | "defaultValue"> {
|
|
466
467
|
items: ChoiceListItem[];
|
|
467
468
|
multiple?: M;
|
|
468
469
|
value?: M extends true ? string[] : string;
|
|
470
|
+
defaultValue?: M extends true ? string[] : string;
|
|
469
471
|
onChange?: (value: M extends true ? string[] : string) => void;
|
|
470
472
|
searchProps?: React.ComponentProps<typeof pkg.Input>;
|
|
473
|
+
/**
|
|
474
|
+
* Show select all option when in multiple mode
|
|
475
|
+
* @default false
|
|
476
|
+
*/
|
|
477
|
+
showSelectAll?: boolean;
|
|
478
|
+
placeholder?: string;
|
|
479
|
+
/**
|
|
480
|
+
* Whether the choice list is disabled
|
|
481
|
+
* @default false
|
|
482
|
+
*/
|
|
483
|
+
disabled?: boolean;
|
|
484
|
+
/**
|
|
485
|
+
* Validation status
|
|
486
|
+
*/
|
|
487
|
+
status?: "error" | "warning" | "success" | "validating";
|
|
488
|
+
/**
|
|
489
|
+
* Function to extract keywords from the item for search filtering
|
|
490
|
+
* @default (item) => [item.value, reactNodeToString(item.label)]
|
|
491
|
+
*/
|
|
492
|
+
getItemKeywords?: (item: ChoiceListItem) => string[];
|
|
471
493
|
}
|
|
472
494
|
|
|
473
495
|
export declare interface ClassArray extends Array<ClassValue> {
|
|
@@ -975,6 +997,8 @@ export declare interface ComboboxProps {
|
|
|
975
997
|
placeholder?: string;
|
|
976
998
|
/** Whether the combobox is disabled */
|
|
977
999
|
disabled?: boolean;
|
|
1000
|
+
/** Validation status */
|
|
1001
|
+
status?: ValidateStatus;
|
|
978
1002
|
/** Whether to allow clearing the selection */
|
|
979
1003
|
allowClear?: boolean;
|
|
980
1004
|
/** Whether to allow multiple selections */
|
|
@@ -1022,7 +1046,7 @@ export declare interface ComboboxProps {
|
|
|
1022
1046
|
/**
|
|
1023
1047
|
* Props to pass to the combobox trigger
|
|
1024
1048
|
*/
|
|
1025
|
-
triggerProps?:
|
|
1049
|
+
triggerProps?: default_2.ComponentPropsWithoutRef<typeof SelectTrigger>;
|
|
1026
1050
|
searchProps?: {
|
|
1027
1051
|
placeholder?: string;
|
|
1028
1052
|
onValueChange?: (value: string) => void;
|
|
@@ -1054,39 +1078,6 @@ export declare interface ComboboxProps {
|
|
|
1054
1078
|
}) => default_2.ReactNode;
|
|
1055
1079
|
}
|
|
1056
1080
|
|
|
1057
|
-
export declare const ComboboxTrigger: default_2.ForwardRefExoticComponent<ComboboxTriggerProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
1058
|
-
|
|
1059
|
-
export declare interface ComboboxTriggerProps extends default_2.ComponentPropsWithoutRef<"button"> {
|
|
1060
|
-
/** Selected options */
|
|
1061
|
-
selectedOptions: ComboboxOption[];
|
|
1062
|
-
/** Placeholder text */
|
|
1063
|
-
placeholder?: string;
|
|
1064
|
-
/** Whether multiple selection is enabled */
|
|
1065
|
-
multiple?: boolean;
|
|
1066
|
-
/** Whether the component is disabled */
|
|
1067
|
-
disabled?: boolean;
|
|
1068
|
-
/** Whether the dropdown is open */
|
|
1069
|
-
open?: boolean;
|
|
1070
|
-
/** Size variant */
|
|
1071
|
-
size?: "small" | "middle" | "large";
|
|
1072
|
-
/** Whether to show clear button */
|
|
1073
|
-
allowClear?: boolean;
|
|
1074
|
-
/** Custom suffix icon */
|
|
1075
|
-
suffixIcon?: default_2.ReactNode;
|
|
1076
|
-
/** Custom clear icon */
|
|
1077
|
-
clearIcon?: default_2.ReactNode;
|
|
1078
|
-
/** Custom class names */
|
|
1079
|
-
classNames?: {
|
|
1080
|
-
trigger?: string;
|
|
1081
|
-
};
|
|
1082
|
-
/** Clear handler */
|
|
1083
|
-
onClear?: () => void;
|
|
1084
|
-
/** Show selection summary instead of individual tags when multiple */
|
|
1085
|
-
showSelectionSummary?: boolean;
|
|
1086
|
-
/** Render function for the selection summary in multiple case */
|
|
1087
|
-
selectionSummaryRender?: (selectedValues: Array<string | number>) => default_2.ReactNode;
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
1081
|
declare type CommandFilter = (value: string, search: string, keywords?: string[]) => number;
|
|
1091
1082
|
|
|
1092
1083
|
declare type CommandProps = Children & DivProps & {
|
|
@@ -1570,7 +1561,7 @@ export { Descriptions }
|
|
|
1570
1561
|
|
|
1571
1562
|
export { DescriptionsProps }
|
|
1572
1563
|
|
|
1573
|
-
declare const DirectoryTreeInner: <T extends DataNode =
|
|
1564
|
+
declare const DirectoryTreeInner: <T extends DataNode = TreeDataNode>(props: DirectoryTreeProps<T>, ref: React.Ref<React.ComponentRef<typeof default_7<T>>>) => JSX.Element;
|
|
1574
1565
|
|
|
1575
1566
|
export declare interface DirectoryTreeProps<T extends DataNode = TreeDataNode> extends Omit<DirectoryTreeProps_2<T>, "treeData" | "expandedKeys" | "defaultExpandedKeys" | "onExpand" | "checkedKeys" | "defaultCheckedKeys" | "onCheck" | "draggable"> {
|
|
1576
1567
|
treeData?: T[];
|
|
@@ -1810,7 +1801,7 @@ export declare const DROPDOWN_COLLISION_AVOIDANCE: {
|
|
|
1810
1801
|
readonly fallbackAxisSide: "none";
|
|
1811
1802
|
};
|
|
1812
1803
|
|
|
1813
|
-
export declare const DropdownMenu: ({ children, items, placement, openOnHover, open: outsideOpen, onOpenChange: outsideOnOpenChange, className, itemRender, classNames, size, showSearch, searchProps, popupMatchTriggerWidth, beforeList, afterList, keepOpenOnSelect, highlightedItemKey, selectedItemKeys, showCheckbox, }: DropdownMenuProps) => JSX.Element;
|
|
1804
|
+
export declare const DropdownMenu: ({ children, items, placement, openOnHover, open: outsideOpen, onOpenChange: outsideOnOpenChange, className, itemRender, classNames, size, showSearch, searchProps, popupMatchTriggerWidth, beforeList, afterList, keepOpenOnSelect, highlightedItemKey, selectedItemKeys, showCheckbox, getItemKeywords, }: DropdownMenuProps) => JSX.Element;
|
|
1814
1805
|
|
|
1815
1806
|
export declare const DropdownMenuItem: default_2.FC<DropdownMenuItemProps>;
|
|
1816
1807
|
|
|
@@ -1852,6 +1843,13 @@ export declare interface DropdownMenuItemProps {
|
|
|
1852
1843
|
* @default false
|
|
1853
1844
|
*/
|
|
1854
1845
|
indeterminate?: boolean;
|
|
1846
|
+
/**
|
|
1847
|
+
* Function to extract keywords from the item for search filtering
|
|
1848
|
+
* @default (item) => [String(item.key), reactNodeToString(item.label)]
|
|
1849
|
+
*/
|
|
1850
|
+
getItemKeywords?: (item: DropdownMenuItemType & {
|
|
1851
|
+
type: "item";
|
|
1852
|
+
}) => string[];
|
|
1855
1853
|
}
|
|
1856
1854
|
|
|
1857
1855
|
export declare type DropdownMenuItemType = {
|
|
@@ -2019,6 +2017,13 @@ export declare interface DropdownMenuProps {
|
|
|
2019
2017
|
* @default false
|
|
2020
2018
|
*/
|
|
2021
2019
|
showCheckbox?: boolean;
|
|
2020
|
+
/**
|
|
2021
|
+
* Function to extract keywords from the item for search filtering
|
|
2022
|
+
* @default (item) => [String(item.key), reactNodeToString(item.label)]
|
|
2023
|
+
*/
|
|
2024
|
+
getItemKeywords?: (item: DropdownMenuItemType & {
|
|
2025
|
+
type: "item";
|
|
2026
|
+
}) => string[];
|
|
2022
2027
|
}
|
|
2023
2028
|
|
|
2024
2029
|
export { DropDownProps }
|
|
@@ -2282,7 +2287,7 @@ declare const MainSelectInner: <ValueType = unknown, OptionType extends SelectBa
|
|
|
2282
2287
|
|
|
2283
2288
|
declare const MainSwitchInner: ({ ...rest }: SwitchProps, ref: React.Ref<React.ComponentRef<typeof default_4>>) => JSX.Element;
|
|
2284
2289
|
|
|
2285
|
-
declare const MainTreeInner: <T extends DataNode =
|
|
2290
|
+
declare const MainTreeInner: <T extends DataNode = TreeDataNode>(props: TreeProps<T>, ref: React.Ref<React.ComponentRef<typeof default_7<T>>>) => JSX.Element;
|
|
2286
2291
|
|
|
2287
2292
|
export { MappingAlgorithm }
|
|
2288
2293
|
|
|
@@ -2785,7 +2790,8 @@ declare enum PopupPanelSize {
|
|
|
2785
2790
|
xlarge = "840px"
|
|
2786
2791
|
}
|
|
2787
2792
|
|
|
2788
|
-
export declare const processTreeData: <T extends DataNode = DataNode>(nodes: T[] | undefined, expandedOriginalKeys: Set<Key>,
|
|
2793
|
+
export declare const processTreeData: <T extends DataNode = DataNode>(nodes: T[] | undefined, expandedOriginalKeys: Set<Key>, // Use Set for faster lookups
|
|
2794
|
+
parentKeyPrefix: string, keyMap: Map<Key, Key>) => T[] | undefined;
|
|
2789
2795
|
|
|
2790
2796
|
export { Progress }
|
|
2791
2797
|
|
|
@@ -3367,7 +3373,7 @@ export { Row }
|
|
|
3367
3373
|
|
|
3368
3374
|
export { RowProps }
|
|
3369
3375
|
|
|
3370
|
-
export declare const ScrollArea: ({ children, className, classNames, orientation, }: ScrollAreaProps) => JSX.Element;
|
|
3376
|
+
export declare const ScrollArea: ({ children, className, classNames, orientation, fadeEdges, onScroll, }: ScrollAreaProps) => JSX.Element;
|
|
3371
3377
|
|
|
3372
3378
|
export declare interface ScrollAreaProps {
|
|
3373
3379
|
children: ReactNode;
|
|
@@ -3397,6 +3403,15 @@ export declare interface ScrollAreaProps {
|
|
|
3397
3403
|
* @default "vertical"
|
|
3398
3404
|
*/
|
|
3399
3405
|
orientation?: "vertical" | "horizontal";
|
|
3406
|
+
/**
|
|
3407
|
+
* Enable fade-out effect at scrollable edges
|
|
3408
|
+
* @default false
|
|
3409
|
+
*/
|
|
3410
|
+
fadeEdges?: boolean;
|
|
3411
|
+
/**
|
|
3412
|
+
* Callback fired when the scroll position changes
|
|
3413
|
+
*/
|
|
3414
|
+
onScroll?: (event: Event) => void;
|
|
3400
3415
|
}
|
|
3401
3416
|
|
|
3402
3417
|
declare const SearchInner: ({ enterButton, onSearch, prefix, onPressEnter, onClear, loading, ...rest }: SearchProps, ref: React.Ref<InputRef>) => JSX.Element;
|
|
@@ -3463,6 +3478,50 @@ export declare interface SelectProps<ValueType = unknown, OptionType extends Sel
|
|
|
3463
3478
|
}) => default_2.ReactNode;
|
|
3464
3479
|
}
|
|
3465
3480
|
|
|
3481
|
+
export declare const SelectTrigger: default_2.ForwardRefExoticComponent<SelectTriggerProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
3482
|
+
|
|
3483
|
+
export declare interface SelectTriggerProps extends Omit<WithRenderPropProps<"button", SelectTriggerState>, "value" | "prefix"> {
|
|
3484
|
+
/** Size variant */
|
|
3485
|
+
size?: "small" | "middle" | "large";
|
|
3486
|
+
/** Whether the component is disabled */
|
|
3487
|
+
disabled?: boolean;
|
|
3488
|
+
/** Whether the dropdown/popup is open */
|
|
3489
|
+
open?: boolean;
|
|
3490
|
+
/** Validation status */
|
|
3491
|
+
status?: ValidateStatus;
|
|
3492
|
+
/** Placeholder text */
|
|
3493
|
+
placeholder?: string;
|
|
3494
|
+
/** Current value/content to display */
|
|
3495
|
+
value?: default_2.ReactNode;
|
|
3496
|
+
/** Prefix content to display before the value (e.g., icon) */
|
|
3497
|
+
prefix?: default_2.ReactNode;
|
|
3498
|
+
/** Whether to show clear button when there's a value */
|
|
3499
|
+
allowClear?: boolean;
|
|
3500
|
+
/** Custom suffix icon (arrow icon) */
|
|
3501
|
+
suffixIcon?: default_2.ReactNode;
|
|
3502
|
+
/** Custom clear icon */
|
|
3503
|
+
clearIcon?: default_2.ReactNode;
|
|
3504
|
+
/** Clear handler */
|
|
3505
|
+
onClear?: () => void;
|
|
3506
|
+
/** Open state change handler */
|
|
3507
|
+
onOpenChange?: (open: boolean) => void;
|
|
3508
|
+
/** Custom class names */
|
|
3509
|
+
classNames?: {
|
|
3510
|
+
trigger?: string;
|
|
3511
|
+
content?: string;
|
|
3512
|
+
suffix?: string;
|
|
3513
|
+
placeholder?: string;
|
|
3514
|
+
value?: string;
|
|
3515
|
+
};
|
|
3516
|
+
}
|
|
3517
|
+
|
|
3518
|
+
export declare type SelectTriggerState = {
|
|
3519
|
+
disabled: boolean;
|
|
3520
|
+
open: boolean;
|
|
3521
|
+
hasValue: boolean;
|
|
3522
|
+
size: "small" | "middle" | "large";
|
|
3523
|
+
};
|
|
3524
|
+
|
|
3466
3525
|
export declare const SEQUENTIAL_PALETTE_NAMES: readonly ["YlOrBr", "YlOrRd", "OrRd", "PuRd", "RdPu", "BuPu", "GnBu", "PuBu", "YlGnBu", "PuBuGn", "BuGn", "YlGn"];
|
|
3467
3526
|
|
|
3468
3527
|
export declare const SEQUENTIAL_PALETTES: Record<SequentialPaletteName, Record<Theme, string[]>>;
|
|
@@ -4141,7 +4200,7 @@ export declare const WithRenderProp: <T extends default_2.ElementType = "div", S
|
|
|
4141
4200
|
|
|
4142
4201
|
declare const WithRenderPropInner: <T extends default_2.ElementType = "div", State extends Record<string, unknown> = Record<string, unknown>>(props: WithRenderPropProps<T, State>, ref: default_2.ForwardedRef<T>) => null;
|
|
4143
4202
|
|
|
4144
|
-
export declare type WithRenderPropProps<T extends default_2.ElementType = "div", State extends Record<string, unknown> = Record<string, unknown>> = default_2.ComponentPropsWithoutRef<T> & {
|
|
4203
|
+
export declare type WithRenderPropProps<T extends default_2.ElementType = "div", State extends Record<string | number | symbol, unknown> = Record<string, unknown>> = default_2.ComponentPropsWithoutRef<T> & {
|
|
4145
4204
|
render?: useRender.RenderProp<State>;
|
|
4146
4205
|
as?: T;
|
|
4147
4206
|
state?: State;
|