@kolking/react-ui 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/{Input-DbQTM4UI.js → Input-D46mAsdt.js} +1 -1
  2. package/dist/ValidationTooltip-D8d9O6Re.js +31 -0
  3. package/dist/components/Avatar/Avatar.js +29 -20
  4. package/dist/components/Badge/Badge.js +11 -11
  5. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +13 -0
  6. package/dist/components/Breadcrumbs/Breadcrumbs.js +40 -0
  7. package/dist/components/Breadcrumbs/index.d.ts +1 -0
  8. package/dist/components/Breadcrumbs/index.js +4 -0
  9. package/dist/components/Button/Button.js +1 -1
  10. package/dist/components/Dialog/Dialog.d.ts +9 -5
  11. package/dist/components/Dialog/Dialog.js +68 -45
  12. package/dist/components/Dialog/useDialog.d.ts +2 -1
  13. package/dist/components/Dialog/useDialog.js +29 -42
  14. package/dist/components/Dialog/withDialog.d.ts +1 -1
  15. package/dist/components/Fields/Checkbox.js +15 -15
  16. package/dist/components/Fields/Input.js +2 -2
  17. package/dist/components/Fields/Numeric.d.ts +8 -2
  18. package/dist/components/Fields/Numeric.js +22 -22
  19. package/dist/components/Fields/Radio.js +11 -11
  20. package/dist/components/Fields/Range.d.ts +20 -0
  21. package/dist/components/Fields/Range.js +54 -0
  22. package/dist/components/Fields/Select.js +1 -1
  23. package/dist/components/Fields/Switch.js +11 -11
  24. package/dist/components/Fields/Textarea.js +1 -1
  25. package/dist/components/Fields/ValidationTooltip.d.ts +1 -1
  26. package/dist/components/Fields/ValidationTooltip.js +3 -2
  27. package/dist/components/Fields/index.d.ts +1 -0
  28. package/dist/components/Fields/index.js +14 -12
  29. package/dist/components/Heading/Heading.js +12 -12
  30. package/dist/components/Icon/Icon.js +7 -7
  31. package/dist/components/Menu/Menu.d.ts +6 -2
  32. package/dist/components/Menu/Menu.js +57 -51
  33. package/dist/components/Menu/MenuContext.d.ts +1 -0
  34. package/dist/components/Menu/MenuItem.d.ts +2 -3
  35. package/dist/components/Menu/MenuItem.js +23 -29
  36. package/dist/components/Notice/Notice.js +30 -30
  37. package/dist/components/Progress/ProgressBar.js +30 -23
  38. package/dist/components/Progress/ProgressCircular.js +13 -12
  39. package/dist/components/Segmented/Segmented.js +42 -34
  40. package/dist/components/Spinner/Spinner.js +1 -1
  41. package/dist/components/Tag/Tag.js +12 -12
  42. package/dist/components/ToggleButton/ToggleButton.d.ts +15 -1
  43. package/dist/components/ToggleButton/ToggleButton.js +17 -12
  44. package/dist/components/ToggleButton/ToggleGroup.js +34 -31
  45. package/dist/components/Tooltip/Tooltip.d.ts +2 -1
  46. package/dist/components/Tooltip/Tooltip.js +59 -56
  47. package/dist/index.d.ts +1 -0
  48. package/dist/index.js +66 -62
  49. package/dist/styles/_theme-default.scss +36 -35
  50. package/dist/styles/style.css +1 -1
  51. package/dist/styles.module-D1F3R7Vi.js +11 -0
  52. package/dist/utils/helpers.d.ts +1 -1
  53. package/dist/utils/helpers.js +3 -3
  54. package/package.json +3 -1
  55. package/dist/ValidationTooltip-BgSwl0hJ.js +0 -30
  56. package/dist/components/Dialog/DialogFocusTrap.d.ts +0 -2
  57. package/dist/components/Dialog/DialogFocusTrap.js +0 -17
  58. package/dist/styles.module-CUhWny5T.js +0 -11
@@ -1,78 +1,84 @@
1
- import { jsxs as E, Fragment as I, jsx as t } from "react/jsx-runtime";
2
- import N, { useState as r, useRef as d, useMemo as j, useEffect as B } from "react";
3
- import { flushSync as L } from "react-dom";
4
- import { useFloating as O, offset as W, flip as _, size as b, autoUpdate as k, useInteractions as A, useDismiss as D, useRole as H, useClick as U, useListNavigation as q, FloatingPortal as G, FloatingFocusManager as J, FloatingList as K } from "@floating-ui/react";
5
- import Q from "classnames";
6
- import { MenuContext as T } from "./MenuContext.js";
7
- import { s as V } from "../../styles.module-CUhWny5T.js";
8
- const ne = ({
9
- placement: p = "bottom-start",
1
+ import { jsxs as B, Fragment as L, jsx as t } from "react/jsx-runtime";
2
+ import O, { useState as r, useRef as p, useMemo as W, useEffect as _ } from "react";
3
+ import { flushSync as b } from "react-dom";
4
+ import { useFloating as k, offset as A, flip as D, size as H, autoUpdate as U, useInteractions as q, useDismiss as G, useRole as J, useClick as K, useListNavigation as Q, FloatingPortal as T, FloatingFocusManager as V, FloatingList as X } from "@floating-ui/react";
5
+ import Y from "classnames";
6
+ import { MenuContext as Z } from "./MenuContext.js";
7
+ import { cssProps as $ } from "../../utils/helpers.js";
8
+ import { s as ee } from "../../styles.module-D1F3R7Vi.js";
9
+ const me = ({
10
+ size: g,
11
+ placement: h = "bottom-start",
10
12
  trigger: a,
11
- minWidth: g,
12
- maxWidth: h,
13
- className: R,
14
- children: v,
15
- ...x
13
+ minWidth: R,
14
+ maxWidth: v,
15
+ minHeight: x,
16
+ maxHeight: F,
17
+ className: P,
18
+ children: y,
19
+ onSelect: l,
20
+ ...z
16
21
  }) => {
17
- const [l, c] = r(!1), [i, F] = r(null), [y, M] = r({}), m = d([]), u = d(null), { refs: o, context: e, floatingStyles: P } = O({
18
- open: l,
19
- placement: p,
22
+ const [m, c] = r(!1), [i, M] = r(null), [w, C] = r({}), u = p([]), f = p(null), { refs: o, context: e, floatingStyles: E } = k({
23
+ open: m,
24
+ placement: h,
20
25
  onOpenChange: c,
21
- whileElementsMounted: k,
26
+ whileElementsMounted: U,
22
27
  middleware: [
23
- W(5),
24
- _({ padding: 10 }),
25
- b({
28
+ A(5),
29
+ D({ padding: 10 }),
30
+ H({
26
31
  padding: 10,
27
- apply({ rects: n, availableWidth: s, availableHeight: z }) {
28
- L(() => {
29
- M({
30
- minWidth: n.reference.width,
31
- maxWidth: s,
32
- maxHeight: z
32
+ apply({ rects: n, availableWidth: s, availableHeight: j }) {
33
+ b(() => {
34
+ C({
35
+ minHeight: x,
36
+ minWidth: R ?? n.reference.width,
37
+ maxWidth: v ?? s,
38
+ maxHeight: F ?? j
33
39
  });
34
40
  });
35
41
  }
36
42
  })
37
43
  ]
38
- }), { getReferenceProps: w, getFloatingProps: C, getItemProps: f } = A([
39
- D(e),
40
- H(e, { role: "menu" }),
41
- U(e, { event: "mousedown" }),
42
- q(e, {
43
- listRef: m,
44
+ }), { getReferenceProps: I, getFloatingProps: N, getItemProps: d } = q([
45
+ G(e),
46
+ J(e, { role: "menu" }),
47
+ K(e, { event: "mousedown" }),
48
+ Q(e, {
49
+ listRef: u,
44
50
  loop: !0,
45
51
  activeIndex: i,
46
- onNavigate: F
52
+ onNavigate: M
47
53
  })
48
- ]), S = j(
49
- () => ({ active: i, setOpen: c, getItemProps: f }),
50
- [i, f]
54
+ ]), S = W(
55
+ () => ({ active: i, setOpen: c, getItemProps: d, onSelect: l }),
56
+ [i, d, l]
51
57
  );
52
- return B(() => {
58
+ return _(() => {
53
59
  var s;
54
60
  const n = (s = o.domReference.current) == null ? void 0 : s.closest("[data-floating-root]");
55
- n && (u.current = n);
56
- }, [o]), /* @__PURE__ */ E(I, { children: [
57
- N.cloneElement(a, {
61
+ n && (f.current = n);
62
+ }, [o]), /* @__PURE__ */ B(L, { children: [
63
+ O.cloneElement(a, {
58
64
  ref: o.setReference,
59
- "data-menu": "trigger",
60
- ...w(a.props)
65
+ ...I(a.props),
66
+ "data-menu-trigger": !0
61
67
  }),
62
- /* @__PURE__ */ t(T.Provider, { value: S, children: l && /* @__PURE__ */ t(G, { root: u, children: /* @__PURE__ */ t(J, { context: e, modal: !1, initialFocus: -1, children: /* @__PURE__ */ t(
68
+ /* @__PURE__ */ t(Z.Provider, { value: S, children: m && /* @__PURE__ */ t(T, { root: f, children: /* @__PURE__ */ t(V, { context: e, modal: !1, initialFocus: -1, children: /* @__PURE__ */ t(
63
69
  "div",
64
70
  {
65
- ...x,
71
+ ...z,
72
+ ...N(),
66
73
  ref: o.setFloating,
67
- "data-menu": "content",
68
- className: Q(V.menu, R),
69
- style: { ...P, ...y, minWidth: g, maxWidth: h },
70
- ...C(),
71
- children: /* @__PURE__ */ t(K, { elementsRef: m, children: v })
74
+ "data-menu": !0,
75
+ className: Y(ee.menu, P),
76
+ style: { ...E, ...w, ...$({ size: g }) },
77
+ children: /* @__PURE__ */ t(X, { elementsRef: u, children: y })
72
78
  }
73
79
  ) }) }) })
74
80
  ] });
75
81
  };
76
82
  export {
77
- ne as Menu
83
+ me as Menu
78
84
  };
@@ -4,5 +4,6 @@ export type MenuContextProps = {
4
4
  active: number | null;
5
5
  setOpen: (value: boolean) => void;
6
6
  getItemProps: UseInteractionsReturn['getItemProps'];
7
+ onSelect?: (index: number) => void;
7
8
  };
8
9
  export declare const MenuContext: React.Context<MenuContextProps>;
@@ -1,7 +1,6 @@
1
- export type MenuItemProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
2
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
1
+ export type MenuItemProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'title'> & {
3
2
  scheme?: 'default' | 'negative' | 'positive' | 'warning';
4
3
  icon?: React.ReactElement;
5
4
  title?: React.ReactNode;
6
5
  };
7
- export declare const MenuItem: ({ size, scheme, icon, title, children, className, style, onClick, ...props }: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const MenuItem: ({ scheme, icon, title, children, className, onClick, ...props }: MenuItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,50 +1,44 @@
1
- import { jsx as i, jsxs as h, Fragment as j } from "react/jsx-runtime";
2
- import { useContext as M, useCallback as N } from "react";
3
- import { useListItem as P } from "@floating-ui/react";
4
- import v from "classnames";
1
+ import { jsx as I, jsxs as g, Fragment as h } from "react/jsx-runtime";
2
+ import { useContext as j, useCallback as y } from "react";
3
+ import { useListItem as M } from "@floating-ui/react";
4
+ import N from "classnames";
5
5
  import { MenuContext as w } from "./MenuContext.js";
6
- import { cssProps as A } from "../../utils/helpers.js";
7
- import { s as n } from "../../styles.module-CUhWny5T.js";
8
- function a(t) {
9
- return typeof t == "string" ? /* @__PURE__ */ i("span", { children: t }) : t;
10
- }
11
- const D = ({
12
- size: t,
6
+ import { wrapNode as n } from "../../utils/helpers.js";
7
+ import { s as i } from "../../styles.module-D1F3R7Vi.js";
8
+ const B = ({
13
9
  scheme: p = "default",
14
- icon: c,
10
+ icon: u,
15
11
  title: r,
16
12
  children: s,
17
13
  className: f,
18
- style: u,
19
- onClick: e,
14
+ onClick: t,
20
15
  ...d
21
16
  }) => {
22
- const { active: x, setOpen: o, getItemProps: l } = M(w), { ref: b, index: y } = P(), m = y === x, I = N(
23
- (g) => {
24
- o(!1), e == null || e(g);
17
+ const { active: c, setOpen: o, getItemProps: x, onSelect: e } = j(w), { ref: b, index: m } = M(), a = m === c, l = y(
18
+ (v) => {
19
+ o(!1), e == null || e(m), t == null || t(v);
25
20
  },
26
- [o, e]
21
+ [m, o, e, t]
27
22
  );
28
- return /* @__PURE__ */ i(
23
+ return /* @__PURE__ */ I(
29
24
  "button",
30
25
  {
31
26
  ...d,
32
27
  ref: b,
33
28
  type: "button",
34
29
  role: "menuitem",
35
- "data-menu": "item",
36
- "data-active": m,
37
- tabIndex: m ? 0 : -1,
38
- className: v(n.menuitem, n[p], f),
39
- style: { ...u, ...A({ size: t }) },
40
- ...l({ onClick: I }),
41
- children: s ? a(s) : /* @__PURE__ */ h(j, { children: [
42
- c,
43
- r && a(r)
30
+ "data-menu-item": !0,
31
+ "data-active": a,
32
+ tabIndex: a ? 0 : -1,
33
+ className: N(i.menuitem, i[p], f),
34
+ ...x({ onClick: l }),
35
+ children: s ? n(s, "span") : /* @__PURE__ */ g(h, { children: [
36
+ u,
37
+ r !== void 0 && n(r, "span")
44
38
  ] })
45
39
  }
46
40
  );
47
41
  };
48
42
  export {
49
- D as MenuItem
43
+ B as MenuItem
50
44
  };
@@ -1,19 +1,19 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
2
  import v from "classnames";
3
3
  import { cssProps as p, getErrorMessage as y } from "../../utils/helpers.js";
4
4
  import { Icon as w } from "../Icon/Icon.js";
5
- const h = "Notice_info_tgW7c", z = "Notice_error_ClIfR", j = "Notice_success_-vXfu", x = "Notice_warning_zFUFN", C = "Notice_neutral_Vryzr", F = "Notice_container_d9QoU", I = "Notice_content_cvC5c", k = "Notice_message_hI1yz", M = "Notice_accessory_AjvqC", Q = "Notice_vertical_DsMZQ", U = "Notice_plain_l9FV5", c = {
6
- info: h,
7
- error: z,
8
- success: j,
9
- warning: x,
10
- neutral: C,
11
- container: F,
12
- content: I,
13
- message: k,
14
- accessory: M,
15
- vertical: Q,
16
- plain: U
5
+ const h = "Notice_container_d9QoU", z = "Notice_content_cvC5c", j = "Notice_message_hI1yz", x = "Notice_accessory_AjvqC", C = "Notice_vertical_DsMZQ", F = "Notice_plain_l9FV5", I = "Notice_info_tgW7c", k = "Notice_error_ClIfR", M = "Notice_success_-vXfu", Q = "Notice_warning_zFUFN", U = "Notice_neutral_Vryzr", c = {
6
+ container: h,
7
+ content: z,
8
+ message: j,
9
+ accessory: x,
10
+ vertical: C,
11
+ plain: F,
12
+ info: I,
13
+ error: k,
14
+ success: M,
15
+ warning: Q,
16
+ neutral: U
17
17
  }, a = {
18
18
  info: "info-circle",
19
19
  warning: "warning",
@@ -21,33 +21,33 @@ const h = "Notice_info_tgW7c", z = "Notice_error_ClIfR", j = "Notice_success_-vX
21
21
  success: "checkmark-circle",
22
22
  neutral: "info-outline"
23
23
  }, E = ({
24
- error: n,
25
- scheme: o = n ? "error" : "neutral",
26
- layout: t = "horizontal",
24
+ error: t,
25
+ scheme: e = t ? "error" : "neutral",
26
+ layout: n = "horizontal",
27
27
  variant: l = "default",
28
28
  size: _,
29
29
  icon: s,
30
30
  accessory: r,
31
31
  margin: N,
32
- padding: m,
33
- className: d,
34
- style: f,
35
- children: g,
36
- ...u
32
+ padding: d,
33
+ className: m,
34
+ style: u,
35
+ children: f,
36
+ ...g
37
37
  }) => /* @__PURE__ */ i(
38
38
  "div",
39
39
  {
40
- ...u,
41
- "data-notice": o,
42
- "data-layout": t,
43
- className: v(c.container, c[o], c[t], c[l], d),
44
- style: { ...f, ...p({ size: _, margin: N, padding: m }) },
40
+ ...g,
41
+ "data-notice": e,
42
+ "data-layout": n,
43
+ className: v(c.container, c[e], c[n], c[l], m),
44
+ style: { ...u, ...p({ size: _, margin: N, padding: d }) },
45
45
  children: [
46
- /* @__PURE__ */ i("div", { className: c.content, children: [
47
- s !== void 0 ? s : a[o] && /* @__PURE__ */ e(w, { name: a[o] }),
48
- /* @__PURE__ */ e("div", { className: c.message, children: n ? y(n) : g })
46
+ /* @__PURE__ */ i("div", { "data-notice-content": !0, className: c.content, children: [
47
+ s !== void 0 ? s : a[e] && /* @__PURE__ */ o(w, { name: a[e] }),
48
+ /* @__PURE__ */ o("div", { "data-notice-message": !0, className: c.message, children: t ? y(t) : f })
49
49
  ] }),
50
- r && /* @__PURE__ */ e("div", { className: c.accessory, children: r })
50
+ r && /* @__PURE__ */ o("div", { "data-notice-accessory": !0, className: c.accessory, children: r })
51
51
  ]
52
52
  }
53
53
  );
@@ -1,43 +1,50 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
- import f from "react";
2
+ import u from "react";
3
3
  import _ from "classnames";
4
- import { cssProps as u, clamp as v } from "../../utils/helpers.js";
5
- const P = "Progress_progress_LSrhF", w = "Progress_bar_ywPS-", e = {
6
- progress: P,
7
- bar: w
8
- }, R = f.forwardRef(
4
+ import { cssProps as v, clamp as b } from "../../utils/helpers.js";
5
+ const w = "Progress_progress_LSrhF", P = "Progress_indicator_KDwMt", e = {
6
+ progress: w,
7
+ indicator: P
8
+ }, R = u.forwardRef(
9
9
  ({
10
10
  value: s,
11
11
  width: o,
12
12
  height: t,
13
13
  color: i,
14
- trackColor: p,
15
- minWidth: n,
16
- maxWidth: m,
17
- margin: l,
18
- style: c,
19
- className: g,
20
- ...d
21
- }, b) => {
22
- const r = s ? v(s, 0, 100) : void 0;
14
+ trackColor: n,
15
+ minWidth: c,
16
+ maxWidth: p,
17
+ margin: d,
18
+ style: m,
19
+ className: l,
20
+ ...g
21
+ }, f) => {
22
+ const r = s ? b(s, 0, 100) : void 0;
23
23
  return /* @__PURE__ */ a(
24
24
  "div",
25
25
  {
26
- ...d,
27
- ref: b,
26
+ "aria-label": r ? `${r} percent` : "indeterminate",
27
+ ...g,
28
+ ref: f,
28
29
  role: "progressbar",
29
30
  "aria-valuemin": 0,
30
31
  "aria-valuemax": 100,
31
32
  "aria-valuenow": r,
32
- "aria-label": r ? `${r} percent` : "indeterminate",
33
- "data-progress": "bar",
33
+ "data-progress-bar": !0,
34
34
  "data-progress-value": r ?? "indeterminate",
35
- className: _(e.progress, g),
35
+ className: _(e.progress, l),
36
36
  style: {
37
- ...c,
38
- ...u({ width: o, height: t, color: i, trackColor: p, minWidth: n, maxWidth: m, margin: l })
37
+ ...m,
38
+ ...v({ width: o, height: t, color: i, trackColor: n, minWidth: c, maxWidth: p, margin: d })
39
39
  },
40
- children: /* @__PURE__ */ a("span", { className: e.bar, style: { width: `${r}%` } })
40
+ children: /* @__PURE__ */ a(
41
+ "span",
42
+ {
43
+ "data-progress-bar-indicator": !0,
44
+ className: e.indicator,
45
+ style: { width: `${r}%` }
46
+ }
47
+ )
41
48
  }
42
49
  );
43
50
  }
@@ -1,8 +1,8 @@
1
- import { jsxs as c, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
2
  import j from "react";
3
3
  import N from "classnames";
4
4
  import { cssProps as k, clamp as w } from "../../utils/helpers.js";
5
- const b = "Progress_inner_Zoiac", h = "Progress_container_tFVew", x = "Progress_range_uqjFb", y = "Progress_progress_MHEjj", C = "Progress_track_jWvrX", a = {
5
+ const b = "Progress_inner_Zoiac", h = "Progress_container_tFVew", x = "Progress_range_uqjFb", y = "Progress_progress_MHEjj", C = "Progress_track_jWvrX", n = {
6
6
  inner: b,
7
7
  container: h,
8
8
  range: x,
@@ -29,20 +29,21 @@ const H = j.forwardRef(
29
29
  children: t,
30
30
  ...v
31
31
  }, P) => {
32
- const o = e !== null ? w(e, r, s) : void 0;
32
+ const a = e !== null ? w(e, r, s) : void 0;
33
33
  return /* @__PURE__ */ c(
34
34
  "div",
35
35
  {
36
+ "aria-label": a ? `${a} percent` : "indeterminate",
36
37
  ...v,
37
38
  ref: P,
38
39
  role: "progressbar",
39
40
  "aria-valuemin": r,
40
41
  "aria-valuemax": s,
41
- "aria-valuenow": o,
42
- "data-progress": "circular",
42
+ "aria-valuenow": a,
43
+ "data-progress-circular": !0,
43
44
  "data-countdown": l,
44
- "data-progress-value": o ?? "indeterminate",
45
- className: N(a.container, _),
45
+ "data-progress-value": a ?? "indeterminate",
46
+ className: N(n.container, _),
46
47
  style: {
47
48
  ...f,
48
49
  ...k({
@@ -52,15 +53,15 @@ const H = j.forwardRef(
52
53
  color: d,
53
54
  trackColor: p,
54
55
  margin: m,
55
- value: F(r, s, o)
56
+ value: F(r, s, a)
56
57
  })
57
58
  },
58
59
  children: [
59
- /* @__PURE__ */ c("svg", { "aria-hidden": !0, className: a.progress, children: [
60
- /* @__PURE__ */ n("circle", { fill: "none", className: a.track }),
61
- /* @__PURE__ */ n("circle", { fill: "none", className: a.range })
60
+ /* @__PURE__ */ c("svg", { "aria-hidden": !0, className: n.progress, children: [
61
+ /* @__PURE__ */ o("circle", { fill: "none", className: n.track }),
62
+ /* @__PURE__ */ o("circle", { fill: "none", className: n.range })
62
63
  ] }),
63
- t && /* @__PURE__ */ n("div", { className: a.inner, children: t })
64
+ t && /* @__PURE__ */ o("div", { className: n.inner, children: t })
64
65
  ]
65
66
  }
66
67
  );
@@ -1,49 +1,57 @@
1
- import { jsx as r } from "react/jsx-runtime";
2
- import p from "classnames";
3
- import { cssProps as i } from "../../utils/helpers.js";
4
- const h = "Segmented_segmented_UOs8Z", S = {
5
- segmented: h
6
- }, b = ({
7
- size: n,
8
- items: o,
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import i from "classnames";
3
+ import { Composite as l, CompositeItem as h } from "@floating-ui/react";
4
+ import { cssProps as f, wrapNode as u } from "../../utils/helpers.js";
5
+ const S = "Segmented_segmented_UOs8Z", y = {
6
+ segmented: S
7
+ }, _ = ({
8
+ size: s,
9
+ items: r,
9
10
  selected: t,
10
- disabled: s,
11
- margin: m,
12
- className: g,
13
- style: a,
14
- onSelect: c,
15
- ...d
16
- }) => /* @__PURE__ */ r(
17
- "div",
11
+ disabled: m,
12
+ margin: n,
13
+ className: a,
14
+ style: d,
15
+ onSelect: g,
16
+ ...p
17
+ }) => /* @__PURE__ */ o(
18
+ l,
18
19
  {
19
- ...d,
20
+ ...p,
20
21
  role: "radiogroup",
21
- "data-segmented": t,
22
- className: p(S.segmented, g),
22
+ "data-segmented": !0,
23
+ "data-disabled": m,
24
+ className: i(y.segmented, a),
23
25
  style: {
24
- ...a,
25
- ...i({
26
- size: n,
27
- margin: m,
28
- length: o.length.toString(),
26
+ ...d,
27
+ ...f({
28
+ size: s,
29
+ margin: n,
30
+ length: r.length.toString(),
29
31
  selected: t.toString()
30
32
  })
31
33
  },
32
- children: o.map((l, e) => /* @__PURE__ */ r(
33
- "button",
34
+ children: r.map((c, e) => /* @__PURE__ */ o(
35
+ h,
34
36
  {
35
- role: "radio",
36
- type: "button",
37
- disabled: s,
38
- "aria-checked": e === t,
39
- "data-selected": e === t,
40
- onClick: () => e !== t && c(e),
41
- children: l
37
+ render: /* @__PURE__ */ o(
38
+ "button",
39
+ {
40
+ role: "radio",
41
+ type: "button",
42
+ disabled: m,
43
+ "data-segmented-item": e,
44
+ "aria-checked": e === t,
45
+ "data-selected": e === t,
46
+ onClick: () => e !== t && g(e),
47
+ children: u(c, "span")
48
+ }
49
+ )
42
50
  },
43
51
  e
44
52
  ))
45
53
  }
46
54
  );
47
55
  export {
48
- b as Segmented
56
+ _ as Segmented
49
57
  };
@@ -11,10 +11,10 @@ const f = "Spinner_container_CGGmW", g = "Spinner_spinner_vU3LR", S = "Spinner_t
11
11
  ({ size: e, color: a, overlay: s, overlayColor: i, className: t, style: o, ...c }, l) => /* @__PURE__ */ r(
12
12
  "span",
13
13
  {
14
+ "aria-label": "loading",
14
15
  ...c,
15
16
  ref: l,
16
17
  role: "status",
17
- "aria-label": "loading",
18
18
  "data-spinner": !0,
19
19
  "data-overlay": s,
20
20
  className: d(n.container, t),
@@ -1,10 +1,12 @@
1
- import { jsx as f, jsxs as i, Fragment as T } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as f, Fragment as T } from "react/jsx-runtime";
2
2
  import c from "classnames";
3
3
  import { wrapNode as t, cssProps as p } from "../../utils/helpers.js";
4
4
  const y = "Tag_tag_-ovOm", _ = {
5
5
  tag: y,
6
6
  "default-gray": "Tag_default-gray_Ju2wo",
7
7
  "solid-gray": "Tag_solid-gray_q6GO4",
8
+ "default-brown": "Tag_default-brown_csCrz",
9
+ "solid-brown": "Tag_solid-brown_5IxVx",
8
10
  "default-red": "Tag_default-red_5NeXY",
9
11
  "solid-red": "Tag_solid-red_uPhj-",
10
12
  "default-orange": "Tag_default-orange_fuy0F",
@@ -23,8 +25,6 @@ const y = "Tag_tag_-ovOm", _ = {
23
25
  "solid-indigo": "Tag_solid-indigo_2gfJj",
24
26
  "default-purple": "Tag_default-purple_oBbek",
25
27
  "solid-purple": "Tag_solid-purple_e10WH",
26
- "default-brown": "Tag_default-brown_csCrz",
27
- "solid-brown": "Tag_solid-brown_5IxVx",
28
28
  "default-accent": "Tag_default-accent_uUXnO",
29
29
  "solid-accent": "Tag_solid-accent_bbTSM"
30
30
  }, j = ({
@@ -33,23 +33,23 @@ const y = "Tag_tag_-ovOm", _ = {
33
33
  scheme: l = "gray",
34
34
  title: e,
35
35
  icon: d,
36
- iconPosition: g = "start",
36
+ iconPosition: o = "start",
37
37
  className: r,
38
38
  style: u,
39
- children: o,
40
- ...n
41
- }) => /* @__PURE__ */ f(
39
+ children: g,
40
+ ...i
41
+ }) => /* @__PURE__ */ n(
42
42
  "span",
43
43
  {
44
- ...n,
44
+ ...i,
45
45
  "data-tag": a,
46
46
  "data-scheme": l,
47
47
  className: c(_.tag, _[`${a}-${l}`], r),
48
48
  style: { ...u, ...p({ size: s }) },
49
- children: o ? t(o, "span") : /* @__PURE__ */ i(T, { children: [
50
- g === "start" && d,
51
- e && t(e, "span"),
52
- g === "end" && d
49
+ children: g ? t(g, "span") : /* @__PURE__ */ f(T, { children: [
50
+ o === "start" && d,
51
+ e !== void 0 && t(e, "span"),
52
+ o === "end" && d
53
53
  ] })
54
54
  }
55
55
  );
@@ -1,5 +1,19 @@
1
+ import { default as React } from 'react';
1
2
  import { ButtonProps } from '../Button';
2
3
  export type ToggleButtonProps = Omit<ButtonProps, 'variant'> & {
3
4
  selected?: boolean;
4
5
  };
5
- export declare const ToggleButton: ({ selected, role, ...props }: ToggleButtonProps) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const ToggleButton: React.ForwardRefExoticComponent<Omit<ButtonProps, "variant"> & {
7
+ selected?: boolean;
8
+ } & React.RefAttributes<(<T extends React.ElementType = "button">(props: {
9
+ as?: T | undefined;
10
+ size?: "xs" | "sm" | "md" | "lg" | "xl";
11
+ variant?: "primary" | "secondary" | "tertiary";
12
+ scheme?: "default" | "negative" | "positive" | "warning";
13
+ minWidth?: React.CSSProperties["minWidth"];
14
+ maxWidth?: React.CSSProperties["maxWidth"];
15
+ busy?: boolean;
16
+ title?: React.ReactNode;
17
+ icon?: React.ReactElement;
18
+ iconPosition?: "start" | "end";
19
+ } & Omit<React.PropsWithoutRef<React.ComponentProps<T>>, "title" | "size" | "as" | "icon" | "scheme" | "minWidth" | "maxWidth" | "variant" | "busy" | "iconPosition"> & React.RefAttributes<unknown>) => React.ReactElement | null)>>;