@baishuyun/ui-base 6.20.1 → 6.21.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.
Files changed (57) hide show
  1. package/dist/Amap/index.js +1 -1
  2. package/dist/Calendar/{Calendar-qL5eoYtX.js → Calendar-BaIHL7cB.js} +1 -1
  3. package/dist/Calendar/index.js +3 -3
  4. package/dist/Card/index.js +1 -1
  5. package/dist/CheckBox/CheckBox-BErX3YWP.js +75 -0
  6. package/dist/CheckBox/CheckBox-Dp7hxT2F.js +37 -0
  7. package/dist/CheckBox/index.js +3 -3
  8. package/dist/ColorPicker/index.js +1 -1
  9. package/dist/ConfigProvider/index.js +1 -1
  10. package/dist/DatePicker/{DatePicker-zoV0C8jf.js → DatePicker-CbfmdBaK.js} +1 -1
  11. package/dist/DatePicker/{DatePickerPanel-BZJJDbjG.js → DatePickerPanel-BDJYZs1q.js} +1 -1
  12. package/dist/DatePicker/index.js +2 -2
  13. package/dist/DropDown/index.js +1 -1
  14. package/dist/Editor/index.js +15 -12
  15. package/dist/Gantt/index.js +1 -1
  16. package/dist/Icon/index.js +1 -1
  17. package/dist/InputTag/index.js +1 -1
  18. package/dist/Loading/index.js +1 -1
  19. package/dist/Modal/index.js +1 -1
  20. package/dist/NotFoundContent/index.js +1 -1
  21. package/dist/Overlay/index.js +1 -1
  22. package/dist/Radio/Radio-C0OAW-K-.js +96 -0
  23. package/dist/Radio/index.js +2 -2
  24. package/dist/ScrollBar/index.js +1 -1
  25. package/dist/Segmented/index.js +1 -1
  26. package/dist/Select/{Select-VIy6OKEj.js → Select-DryXF1Tp.js} +2 -2
  27. package/dist/Select/index.js +6 -6
  28. package/dist/Table/index.js +1 -1
  29. package/dist/Tabs/Tabs-Imowx4vq.js +401 -0
  30. package/dist/Tabs/index.js +2 -2
  31. package/dist/Tooltip/index.js +1 -1
  32. package/dist/Tree/index.js +4 -4
  33. package/dist/components/CheckBox/CheckBox.d.ts +2 -45
  34. package/dist/components/CheckBox/Group.d.ts +3 -33
  35. package/dist/components/CheckBox/index.d.ts +1 -1
  36. package/dist/components/CheckBox/interface.d.ts +142 -0
  37. package/dist/components/CheckBox/style/resolveCheckBoxThemeVars.d.ts +2 -0
  38. package/dist/components/Radio/index.d.ts +1 -0
  39. package/dist/components/Radio/interface.d.ts +67 -0
  40. package/dist/components/Radio/style/resolveRadioThemeVars.d.ts +2 -0
  41. package/dist/components/Tabs/Tab/Tab.d.ts +1 -2
  42. package/dist/components/Tabs/TabSelect/interface.d.ts +8 -1
  43. package/dist/components/Tabs/context/TabContext.d.ts +0 -1
  44. package/dist/components/Tabs/index.d.ts +1 -0
  45. package/dist/components/Tabs/interface.d.ts +70 -2
  46. package/dist/components/Tabs/style/index.d.ts +1 -0
  47. package/dist/components/Tabs/style/resolveTabsThemeVars.d.ts +2 -0
  48. package/dist/components/index.d.ts +3 -0
  49. package/dist/index.js +9 -9
  50. package/dist/style.css +1 -1
  51. package/dist/vendors/{Tree-D0Q1IZ2D.js → Tree-DWK-JPnJ.js} +2 -2
  52. package/dist/vendors/{version-CkTjB1Kb.js → version-CyVENVWD.js} +1 -1
  53. package/package.json +1 -1
  54. package/dist/CheckBox/CheckBox-CM24-quL.js +0 -33
  55. package/dist/CheckBox/CheckBox-CcHskTz_.js +0 -67
  56. package/dist/Radio/Radio-D9jhW7K6.js +0 -85
  57. package/dist/Tabs/Tabs-DnoZ8BO0.js +0 -413
@@ -0,0 +1,401 @@
1
+ import { t as e } from "../Icon/Icon-DrdQOEJE.js";
2
+ import { a as t, i as n } from "../Overlay/OverlayContext-CVSFoyqN.js";
3
+ import { t as r } from "../vendors/useLocale-Be4e7Xfn.js";
4
+ import { r as i } from "../vendors/animations-ISccYUE3.js";
5
+ import { t as a } from "../vendors/cssVars-UpriQzph.js";
6
+ import { t as o } from "../vendors/useFloatingPortal-DJ1iKmW-.js";
7
+ import { isString as s } from "lodash-es";
8
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ import { createContext as u, useCallback as d, useContext as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
10
+ import _ from "clsx";
11
+ import { useControllableValue as v, useEventListener as y, useMutationObserver as b, useToggle as x } from "ahooks";
12
+ import { AnimatePresence as S, motion as C } from "motion/react";
13
+ import { FloatingPortal as w } from "@floating-ui/react";
14
+ //#region src/components/Tabs/constants.ts
15
+ var T = {
16
+ LINE: "line",
17
+ CARD: "card",
18
+ FILLED_CARD: "filled-card",
19
+ BADGE_CARD: "badge-card"
20
+ }, E = u({ type: T.LINE }), D = "_active_nxjon_18", O = "_disabled_nxjon_26", k = "_line_nxjon_44", A = "_card_nxjon_53", j = {
21
+ "bsy-tab": "_bsy-tab_nxjon_1",
22
+ "badge-card": "_badge-card_nxjon_9",
23
+ active: D,
24
+ disabled: O,
25
+ line: k,
26
+ card: A,
27
+ "filled-card": "_filled-card_nxjon_78"
28
+ }, M = (e, t = 24) => e.length <= t ? e : e.slice(0, t) + "...", N = (e) => typeof e == "string" ? M(e) : e, P = ({ label: e, active: t = !1, onClick: n, tabKey: r }) => {
29
+ let { type: i = T.LINE, disabled: a } = f(E), o = s(e) ? e : "", l = () => {
30
+ a || n?.(r);
31
+ }, u = {
32
+ "data-tab-item": !0,
33
+ "data-tab-key": r,
34
+ role: "tab",
35
+ "aria-selected": t,
36
+ "aria-controls": `panel-${r}`,
37
+ onClick: l
38
+ };
39
+ return i === T.LINE ? /* @__PURE__ */ c("div", {
40
+ ...u,
41
+ className: _(j["bsy-tab"], j.line, {
42
+ [j.disabled]: a,
43
+ [j.active]: t
44
+ }),
45
+ title: o,
46
+ children: N(e)
47
+ }) : i === T.CARD ? /* @__PURE__ */ c("div", {
48
+ ...u,
49
+ className: _(j["bsy-tab"], j.card, {
50
+ [j.active]: t,
51
+ [j.disabled]: a
52
+ }),
53
+ title: o,
54
+ children: /* @__PURE__ */ c("span", { children: N(e) })
55
+ }) : i === T.FILLED_CARD ? /* @__PURE__ */ c("div", {
56
+ ...u,
57
+ className: _(j["bsy-tab"], j["filled-card"], {
58
+ [j.active]: t,
59
+ [j.disabled]: a
60
+ }),
61
+ title: o,
62
+ children: N(e)
63
+ }) : i === T.BADGE_CARD ? /* @__PURE__ */ c("div", {
64
+ ...u,
65
+ className: _(j["bsy-tab"], j["badge-card"], {
66
+ [j.active]: t,
67
+ [j.disabled]: a
68
+ }),
69
+ title: o,
70
+ children: /* @__PURE__ */ c("span", { children: N(e) })
71
+ }) : null;
72
+ };
73
+ P.displayName = "BsyTab";
74
+ //#endregion
75
+ //#region src/components/Tabs/TabList/useTabScroll.ts
76
+ var F = ({ disabled: e, children: t }) => {
77
+ let n = h(null), r = h(null), [i, a] = g(!1), [o, s] = g(!1), [c, l] = g(!1), [u, f] = g(0), m = d(() => {
78
+ let e = n.current, t = r.current;
79
+ if (!e || !t) return;
80
+ let i = e.clientWidth, o = t.scrollWidth, c = o > i;
81
+ a(c), c ? (s(u < 0), l(u > -(o - i))) : (s(!1), l(!1), f(0));
82
+ }, [u]);
83
+ return y("resize", () => m()), p(() => {
84
+ m();
85
+ }, [
86
+ u,
87
+ t,
88
+ m
89
+ ]), {
90
+ listRef: n,
91
+ wrapperRef: r,
92
+ showControls: i,
93
+ canScrollLeft: o,
94
+ canScrollRight: c,
95
+ translateX: u,
96
+ scrollLeft: () => {
97
+ if (!o || e) return;
98
+ let t = n.current;
99
+ if (!t) return;
100
+ let r = t.clientWidth * .6;
101
+ f(Math.min(0, u + r));
102
+ },
103
+ scrollRight: () => {
104
+ if (!c || e) return;
105
+ let t = n.current, i = r.current;
106
+ if (!t || !i) return;
107
+ let a = t.clientWidth * .6, o = t.clientWidth, s = -(i.scrollWidth - o);
108
+ f(Math.max(s, u - a));
109
+ }
110
+ };
111
+ }, I = ({ activeKey: e, type: t, showIndicator: n, wrapperRef: r, items: i }) => {
112
+ let [a, o] = g({
113
+ width: 0,
114
+ left: 0,
115
+ ready: !1
116
+ }), s = d((e) => {
117
+ if (!n || !r.current) return;
118
+ let t = r.current.getBoundingClientRect(), i = e.getBoundingClientRect(), a = i.left - t.left, s = i.width;
119
+ o({
120
+ width: s,
121
+ left: a,
122
+ ready: !0
123
+ });
124
+ }, [n, r]);
125
+ return p(() => {
126
+ if (!e || !r.current) return;
127
+ let t = r.current.querySelector(`[data-tab-key="${e}"]`);
128
+ t && n && s(t);
129
+ }, [
130
+ e,
131
+ n,
132
+ r,
133
+ s,
134
+ t,
135
+ i
136
+ ]), b(() => {
137
+ if (!n) return;
138
+ let e = r.current?.querySelector("[aria-selected=\"true\"]");
139
+ e && s(e);
140
+ }, r, {
141
+ subtree: !0,
142
+ characterData: !0
143
+ }), {
144
+ indicatorStyle: a,
145
+ handleTabClick: (e) => {
146
+ s(e);
147
+ }
148
+ };
149
+ }, L = ({ children: e, activeKey: t, className: n, style: i, items: a }) => {
150
+ let { t: o } = r(), { type: s = T.LINE, disabled: u } = f(E), d = [T.LINE, T.CARD].includes(s), { listRef: p, wrapperRef: m, showControls: h, canScrollLeft: g, canScrollRight: v, translateX: y, scrollLeft: b, scrollRight: x } = F({
151
+ disabled: u,
152
+ children: e
153
+ }), { indicatorStyle: S, handleTabClick: C } = I({
154
+ activeKey: t,
155
+ type: s,
156
+ showIndicator: d,
157
+ wrapperRef: m,
158
+ items: a
159
+ }), w = S.ready, D = (e) => {
160
+ if (u) return;
161
+ let t = e.target.closest("[data-tab-item]");
162
+ t && C(t);
163
+ };
164
+ return /* @__PURE__ */ l("div", {
165
+ className: _("relative max-h-[36px]", n),
166
+ style: i,
167
+ children: [
168
+ h && /* @__PURE__ */ c("button", {
169
+ className: _("absolute left-0 top-0 bottom-0 z-10 w-8 flex items-center justify-center", { "cursor-not-allowed": !g || u }),
170
+ style: { color: g && !u ? "var(--bsy-tabs-color-icon, #4b5563)" : "var(--bsy-tabs-color-icon-disabled, #9ca3af)" },
171
+ onClick: b,
172
+ disabled: !g || u,
173
+ "aria-label": o("tabs.scrollPrev"),
174
+ children: /* @__PURE__ */ c("svg", {
175
+ className: "w-4 h-4",
176
+ fill: "none",
177
+ stroke: "currentColor",
178
+ viewBox: "0 0 24 24",
179
+ children: /* @__PURE__ */ c("path", {
180
+ strokeLinecap: "round",
181
+ strokeLinejoin: "round",
182
+ strokeWidth: 2,
183
+ d: "M15 19l-7-7 7-7"
184
+ })
185
+ })
186
+ }),
187
+ /* @__PURE__ */ c("div", {
188
+ className: _({
189
+ "pl-8": h,
190
+ "pr-8": h
191
+ }),
192
+ children: /* @__PURE__ */ c("div", {
193
+ ref: p,
194
+ className: _("overflow-hidden", {
195
+ "border-b": s === T.LINE,
196
+ "border-b-2": s === T.FILLED_CARD || s === T.BADGE_CARD,
197
+ "pb-[2px]": s === T.BADGE_CARD
198
+ }),
199
+ style: { borderColor: s === T.LINE ? "var(--bsy-tabs-color-border, #e0e0e0)" : s === T.FILLED_CARD || s === T.BADGE_CARD ? "var(--bsy-tabs-color-primary, #0265ff)" : void 0 },
200
+ children: /* @__PURE__ */ l("div", {
201
+ ref: m,
202
+ role: "tablist",
203
+ className: _("relative text-sm flex flex-nowrap", {
204
+ "gap-x-[26px]": s === T.LINE,
205
+ "gap-x-[10px]": s === T.FILLED_CARD || s === T.BADGE_CARD
206
+ }),
207
+ onClick: D,
208
+ style: {
209
+ backgroundColor: s === T.CARD ? "var(--bsy-tabs-item-bg, #f0f0f0)" : void 0,
210
+ transform: `translateX(${y}px)`,
211
+ transition: "transform 0.3s ease-in-out"
212
+ },
213
+ children: [e, d && S.ready && /* @__PURE__ */ c("div", {
214
+ className: _("absolute h-0.5", {
215
+ "bottom-0": s === T.LINE,
216
+ "top-0": s === T.CARD,
217
+ "transition-all duration-300 ease-in-out": w
218
+ }),
219
+ style: {
220
+ backgroundColor: "var(--bsy-tabs-ink-bar, var(--bsy-tabs-color-primary, #0265ff))",
221
+ width: `${S.width}px`,
222
+ left: `${S.left}px`
223
+ }
224
+ })]
225
+ })
226
+ })
227
+ }),
228
+ h && /* @__PURE__ */ c("button", {
229
+ className: _("absolute right-0 top-0 bottom-0 z-10 w-8 flex items-center justify-center", { "cursor-not-allowed": !v || u }),
230
+ style: { color: v && !u ? "var(--bsy-tabs-color-icon, #4b5563)" : "var(--bsy-tabs-color-icon-disabled, #9ca3af)" },
231
+ onClick: x,
232
+ disabled: !v || u,
233
+ "aria-label": o("tabs.scrollNext"),
234
+ children: /* @__PURE__ */ c("svg", {
235
+ className: "w-4 h-4",
236
+ fill: "none",
237
+ stroke: "currentColor",
238
+ viewBox: "0 0 24 24",
239
+ children: /* @__PURE__ */ c("path", {
240
+ strokeLinecap: "round",
241
+ strokeLinejoin: "round",
242
+ strokeWidth: 2,
243
+ d: "M9 5l7 7-7 7"
244
+ })
245
+ })
246
+ })
247
+ ]
248
+ });
249
+ };
250
+ L.displayName = "BsyTabList";
251
+ //#endregion
252
+ //#region src/components/Tabs/TabPanel/TabPanel.tsx
253
+ var R = ({ items: e, activeKey: t, className: n }) => {
254
+ let r = e.find((e) => e.key === t);
255
+ return !r || !r.children ? null : /* @__PURE__ */ c("div", {
256
+ className: n,
257
+ role: "tabpanel",
258
+ "aria-labelledby": `tab-${t}`,
259
+ children: r.children
260
+ });
261
+ };
262
+ R.displayName = "BsyTabPanel";
263
+ //#endregion
264
+ //#region src/components/Tabs/style/resolveTabsThemeVars.ts
265
+ var z = (e, t) => {
266
+ let n = {};
267
+ return a(n, "--bsy-tabs-color-primary", e?.colorPrimary ?? t), a(n, "--bsy-tabs-ink-bar", e?.inkBarColor), a(n, "--bsy-tabs-color-text", e?.colorText), a(n, "--bsy-tabs-item-active-color", e?.itemActiveColor), a(n, "--bsy-tabs-item-bg", e?.itemBg), a(n, "--bsy-tabs-item-hover-bg", e?.itemHoverBg), a(n, "--bsy-tabs-item-active-bg", e?.itemActiveBg), a(n, "--bsy-tabs-item-active-gradient-from", e?.itemActiveGradientFrom), a(n, "--bsy-tabs-item-active-gradient-to", e?.itemActiveGradientTo), a(n, "--bsy-tabs-color-border", e?.colorBorder), a(n, "--bsy-tabs-color-icon", e?.colorIcon), a(n, "--bsy-tabs-color-icon-disabled", e?.colorIconDisabled), n;
268
+ }, B = (e) => {
269
+ let [t, n] = v(e, {
270
+ defaultValuePropName: "defaultActiveKey",
271
+ valuePropName: "activeKey",
272
+ trigger: "onChange"
273
+ }), r = e.items?.some((e) => e.children), i = m(() => z(e.theme, e.color), [e.theme, e.color]);
274
+ return /* @__PURE__ */ c(E.Provider, {
275
+ value: {
276
+ type: e.type,
277
+ disabled: e.disabled
278
+ },
279
+ children: /* @__PURE__ */ l("div", {
280
+ className: _("bsy-tabs", e.className),
281
+ style: {
282
+ ...i,
283
+ ...e.style
284
+ },
285
+ children: [/* @__PURE__ */ c(L, {
286
+ items: e.items,
287
+ activeKey: t,
288
+ children: e.items?.map((e) => /* @__PURE__ */ c(P, {
289
+ tabKey: e.key,
290
+ label: e.label,
291
+ active: t === e.key,
292
+ onClick: (e) => n(e)
293
+ }, e.key))
294
+ }), r && e.items && /* @__PURE__ */ c(R, {
295
+ items: e.items,
296
+ activeKey: t,
297
+ className: "bsy-tabs__content"
298
+ })]
299
+ })
300
+ });
301
+ };
302
+ B.displayName = "BsyTabs";
303
+ //#endregion
304
+ //#region src/components/Tabs/TabSelect/tabSelect.module.scss
305
+ var V = "_active_5a1wn_11", H = "_icon_5a1wn_45", U = {
306
+ "bsy-tabs-select__trigger": "_bsy-tabs-select__trigger_5a1wn_1",
307
+ active: V,
308
+ "bsy-tabs-select__trigger-icon": "_bsy-tabs-select__trigger-icon_5a1wn_14",
309
+ "bsy-tabs-select__trigger-input": "_bsy-tabs-select__trigger-input_5a1wn_17",
310
+ "bsy-tabs-select__panel": "_bsy-tabs-select__panel_5a1wn_21",
311
+ "bsy-tabs-select__panel-item": "_bsy-tabs-select__panel-item_5a1wn_32",
312
+ icon: H
313
+ }, W = (a) => {
314
+ let { color: s, theme: u } = a, { t: d } = r(), f = t(), [p, { toggle: h, setLeft: g }] = x(!1), { refs: y, floatingStyles: b, getFloatingProps: E, getReferenceProps: D, referenceStyle: O } = o({
315
+ isOpen: p,
316
+ close: g,
317
+ offset: {
318
+ x: 0,
319
+ y: 4
320
+ },
321
+ zIndex: f
322
+ }), [k, A] = v(a, {
323
+ trigger: "onChange",
324
+ defaultValuePropName: "defaultValue",
325
+ valuePropName: "value",
326
+ defaultValue: T.LINE
327
+ }), j = Object.values(T).map((e) => ({
328
+ label: e,
329
+ value: e
330
+ })), M = m(() => [
331
+ {
332
+ label: d("tabs.previewTab1"),
333
+ key: "1"
334
+ },
335
+ {
336
+ label: d("tabs.previewTab2"),
337
+ key: "2"
338
+ },
339
+ {
340
+ label: d("tabs.previewTab3"),
341
+ key: "3"
342
+ }
343
+ ], [d]);
344
+ return /* @__PURE__ */ l("div", {
345
+ className: U["bsy-tabs-select"],
346
+ children: [/* @__PURE__ */ l("div", {
347
+ className: _(U["bsy-tabs-select__trigger"], { [U.active]: p }),
348
+ ref: y.setReference,
349
+ ...D(),
350
+ style: O,
351
+ onClick: () => h(),
352
+ children: [/* @__PURE__ */ c("div", {
353
+ className: _(U["bsy-tabs-select__trigger-input"], { [U.active]: k }),
354
+ children: k && /* @__PURE__ */ c(B, {
355
+ activeKey: "1",
356
+ type: k,
357
+ color: s,
358
+ theme: u,
359
+ disabled: !0,
360
+ items: M
361
+ }, k)
362
+ }), /* @__PURE__ */ c("div", {
363
+ className: U["bsy-tabs-select__trigger-icon"],
364
+ children: /* @__PURE__ */ c(e, {
365
+ name: "arrow-down",
366
+ className: _(U.icon, { active: p })
367
+ })
368
+ })]
369
+ }), /* @__PURE__ */ c(w, { children: /* @__PURE__ */ c(n, {
370
+ zIndex: f,
371
+ children: /* @__PURE__ */ c(S, { children: p && /* @__PURE__ */ c("div", {
372
+ ref: y.setFloating,
373
+ style: b,
374
+ ...E(),
375
+ children: /* @__PURE__ */ c(C.div, {
376
+ ...i,
377
+ children: /* @__PURE__ */ c("div", {
378
+ className: U["bsy-tabs-select__panel"],
379
+ children: j.map((e) => /* @__PURE__ */ c("div", {
380
+ className: _(U["bsy-tabs-select__panel-item"], { [U.active]: k === e.value }),
381
+ onClick: () => {
382
+ A(e.value), g();
383
+ },
384
+ children: /* @__PURE__ */ c(B, {
385
+ activeKey: "1",
386
+ type: e.value,
387
+ disabled: !0,
388
+ color: s,
389
+ theme: u,
390
+ items: M
391
+ }, e.value)
392
+ }, e.value))
393
+ })
394
+ })
395
+ }) })
396
+ }) })]
397
+ });
398
+ };
399
+ W.displayName = "BsyTabSelect";
400
+ //#endregion
401
+ export { T as i, B as n, R as r, W as t };
@@ -1,8 +1,8 @@
1
- import "../vendors/version-CkTjB1Kb.js";
1
+ import "../vendors/version-CyVENVWD.js";
2
2
  import "../Icon/Icon-DrdQOEJE.js";
3
3
  import "../vendors/LocaleContext-DXQoOKM2.js";
4
4
  import "../Overlay/OverlayContext-CVSFoyqN.js";
5
5
  import "../vendors/useLocale-Be4e7Xfn.js";
6
6
  import "../vendors/useFloatingPortal-DJ1iKmW-.js";
7
- import { i as e, n as t, r as n, t as r } from "./Tabs-DnoZ8BO0.js";
7
+ import { i as e, n as t, r as n, t as r } from "./Tabs-Imowx4vq.js";
8
8
  export { e as TABS_TYPE, n as TabPanel, r as TabSelect, t as default };
@@ -1,4 +1,4 @@
1
- import "../vendors/version-CkTjB1Kb.js";
1
+ import "../vendors/version-CyVENVWD.js";
2
2
  import "../Overlay/OverlayContext-CVSFoyqN.js";
3
3
  import "../vendors/useLatchedPopupPortalRoot-CC6af8t-.js";
4
4
  import { n as e, t } from "./Tooltip-DBrt3t2r.js";
@@ -1,6 +1,6 @@
1
- import "../vendors/version-CkTjB1Kb.js";
1
+ import "../vendors/version-CyVENVWD.js";
2
2
  import "../Icon/Icon-DrdQOEJE.js";
3
- import { t as e } from "../vendors/Tree-D0Q1IZ2D.js";
4
- import "../CheckBox/CheckBox-CcHskTz_.js";
5
- import "../Radio/Radio-D9jhW7K6.js";
3
+ import { t as e } from "../vendors/Tree-DWK-JPnJ.js";
4
+ import "../CheckBox/CheckBox-BErX3YWP.js";
5
+ import "../Radio/Radio-C0OAW-K-.js";
6
6
  export { e as Tree };
@@ -1,46 +1,3 @@
1
- import { default as React } from 'react';
2
- export interface CheckboxProps {
3
- /**
4
- * @description 是否选中
5
- */
6
- checked?: boolean;
7
- /**
8
- * @description 默认是否选中
9
- */
10
- defaultChecked?: boolean;
11
- /**
12
- * @description 是否禁用
13
- */
14
- disabled?: boolean;
15
- /**
16
- * @description 半选状态
17
- */
18
- indeterminate?: boolean;
19
- /**
20
- * @description 值改变时的回调
21
- */
22
- onChange?: (checked: boolean) => void;
23
- /**
24
- * @description 自定义类名
25
- */
26
- className?: string;
27
- /**
28
- * @description 自定义样式
29
- */
30
- style?: React.CSSProperties;
31
- /**
32
- * @description 子元素
33
- */
34
- children?: React.ReactNode;
35
- /**
36
- * @description label 的位置,默认在右侧
37
- * @default 'right'
38
- */
39
- labelPosition?: 'left' | 'right';
40
- /**
41
- * @description checkbox 的值,用于 checkbox group
42
- */
43
- value?: string | number;
44
- }
45
- declare const BsyCheckbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLDivElement>>;
1
+ import { CheckboxProps } from './interface';
2
+ declare const BsyCheckbox: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLDivElement>>;
46
3
  export default BsyCheckbox;
@@ -1,34 +1,4 @@
1
- import { Layout } from './constants';
2
- export interface CheckboxGroupProps {
3
- /**
4
- * @description 选中的值
5
- */
6
- value?: Array<string | number>;
7
- /**
8
- * @description 默认选中的值
9
- */
10
- defaultValue?: Array<string | number>;
11
- /**
12
- * @description 值改变时的回调
13
- */
14
- onChange?: (checkedValues: Array<string | number>) => void;
15
- /**
16
- * @description 是否禁用
17
- */
18
- disabled?: boolean;
19
- /**
20
- * @description 布局方式
21
- * @default 'none'
22
- */
23
- layout?: Layout;
24
- /**
25
- * @description Checkbox 子元素
26
- */
27
- children?: React.ReactNode;
28
- /**
29
- * @description 自定义类名
30
- */
31
- className?: string;
32
- }
33
- declare const CheckboxGroup: React.FC<CheckboxGroupProps>;
1
+ import { FC } from 'react';
2
+ import { CheckboxGroupProps } from './interface';
3
+ declare const CheckboxGroup: FC<CheckboxGroupProps>;
34
4
  export default CheckboxGroup;
@@ -5,5 +5,5 @@ type CompoundedComponent = typeof InternalCheckbox & {
5
5
  };
6
6
  declare const Checkbox: CompoundedComponent;
7
7
  export default Checkbox;
8
- export type { CheckboxProps } from './CheckBox';
8
+ export type { CheckboxProps, CheckboxGroupProps, CheckBoxTheme } from './interface';
9
9
  export type { Layout } from './constants';
@@ -0,0 +1,142 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { Layout } from './constants';
3
+ export interface CheckBoxTheme {
4
+ /**
5
+ * @description 选中背景色
6
+ */
7
+ checkedBg?: string;
8
+ /**
9
+ * @description 选中边框色
10
+ */
11
+ checkedBorder?: string;
12
+ /**
13
+ * @description 选中勾选图标色
14
+ */
15
+ checkIconColor?: string;
16
+ /**
17
+ * @description 未选背景色
18
+ */
19
+ uncheckedBg?: string;
20
+ /**
21
+ * @description 未选边框色
22
+ */
23
+ colorBorder?: string;
24
+ /**
25
+ * @description 未选悬停边框色
26
+ */
27
+ colorBorderHover?: string;
28
+ /**
29
+ * @description 半选背景色
30
+ */
31
+ indeterminateBg?: string;
32
+ /**
33
+ * @description 半选边框色
34
+ */
35
+ indeterminateBorder?: string;
36
+ /**
37
+ * @description 半选指示条颜色
38
+ */
39
+ indeterminateIndicator?: string;
40
+ /**
41
+ * @description 禁用背景色
42
+ */
43
+ colorBgDisabled?: string;
44
+ /**
45
+ * @description 禁用边框色
46
+ */
47
+ colorBorderDisabled?: string;
48
+ /**
49
+ * @description 禁用勾选图标色
50
+ */
51
+ checkIconColorDisabled?: string;
52
+ /**
53
+ * @description 禁用半选指示条颜色
54
+ */
55
+ indeterminateIndicatorDisabled?: string;
56
+ }
57
+ export interface CheckboxProps {
58
+ /**
59
+ * @description 是否选中
60
+ */
61
+ checked?: boolean;
62
+ /**
63
+ * @description 默认是否选中
64
+ */
65
+ defaultChecked?: boolean;
66
+ /**
67
+ * @description 是否禁用
68
+ */
69
+ disabled?: boolean;
70
+ /**
71
+ * @description 半选状态
72
+ */
73
+ indeterminate?: boolean;
74
+ /**
75
+ * @description 值改变时的回调
76
+ */
77
+ onChange?: (checked: boolean) => void;
78
+ /**
79
+ * @description 自定义类名
80
+ */
81
+ className?: string;
82
+ /**
83
+ * @description 自定义样式
84
+ */
85
+ style?: CSSProperties;
86
+ /**
87
+ * @description 子元素
88
+ */
89
+ children?: ReactNode;
90
+ /**
91
+ * @description label 的位置,默认在右侧
92
+ * @default 'right'
93
+ */
94
+ labelPosition?: 'left' | 'right';
95
+ /**
96
+ * @description checkbox 的值,用于 checkbox group
97
+ */
98
+ value?: string | number;
99
+ /**
100
+ * @description 组件级颜色 token
101
+ */
102
+ theme?: CheckBoxTheme;
103
+ }
104
+ export interface CheckboxGroupProps {
105
+ /**
106
+ * @description 选中的值
107
+ */
108
+ value?: Array<string | number>;
109
+ /**
110
+ * @description 默认选中的值
111
+ */
112
+ defaultValue?: Array<string | number>;
113
+ /**
114
+ * @description 值改变时的回调
115
+ */
116
+ onChange?: (checkedValues: Array<string | number>) => void;
117
+ /**
118
+ * @description 是否禁用
119
+ */
120
+ disabled?: boolean;
121
+ /**
122
+ * @description 布局方式
123
+ * @default 'none'
124
+ */
125
+ layout?: Layout;
126
+ /**
127
+ * @description Checkbox 子元素
128
+ */
129
+ children?: ReactNode;
130
+ /**
131
+ * @description 自定义类名
132
+ */
133
+ className?: string;
134
+ /**
135
+ * @description 自定义样式
136
+ */
137
+ style?: CSSProperties;
138
+ /**
139
+ * @description 组件级颜色 token,子项可覆盖同名变量
140
+ */
141
+ theme?: CheckBoxTheme;
142
+ }
@@ -0,0 +1,2 @@
1
+ import { CheckBoxTheme } from '../interface';
2
+ export declare const resolveCheckBoxThemeVars: (theme?: CheckBoxTheme) => Record<string, string>;
@@ -5,3 +5,4 @@ type CompoundedComponent = typeof InternalRadio & {
5
5
  };
6
6
  declare const Radio: CompoundedComponent;
7
7
  export default Radio;
8
+ export type { RadioProps, RadioGroupProps, RadioTheme } from './interface';