@kolking/react-ui 1.8.15 → 1.8.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,11 @@
1
1
  import { jsx as h } from "react/jsx-runtime";
2
2
  import { useRef as _, useLayoutEffect as w, useEffect as l } from "react";
3
3
  import E from "classnames";
4
- import { wrapNode as P, cssProps as M } from "../../utils/helpers.js";
5
- const x = "Badge_badge_-mEE7", H = "Badge_appear_LbxbS", L = "Badge_gray_7jA-J", I = "Badge_brown_x1GS7", R = "Badge_red_zPgCR", S = "Badge_orange_EoLmF", X = "Badge_yellow_qvbb6", j = "Badge_green_XX-1c", v = "Badge_teal_VHoFK", C = "Badge_cyan_1ksBn", F = "Badge_blue_YulfT", K = "Badge_indigo_2KXUy", N = "Badge_purple_o55fQ", O = "Badge_accent_BIYve", g = {
6
- badge: x,
7
- appear: H,
4
+ import { wrapNode as P, cssProps as H } from "../../utils/helpers.js";
5
+ const M = "Badge_badge_-mEE7", k = "Badge_appear_LbxbS", x = "Badge_accent_BIYve", L = "Badge_gray_7jA-J", I = "Badge_brown_x1GS7", R = "Badge_red_zPgCR", S = "Badge_orange_EoLmF", X = "Badge_yellow_qvbb6", j = "Badge_green_XX-1c", v = "Badge_teal_VHoFK", C = "Badge_cyan_1ksBn", F = "Badge_blue_YulfT", K = "Badge_indigo_2KXUy", N = "Badge_purple_o55fQ", O = "Badge_pink_T5H--", g = {
6
+ badge: M,
7
+ appear: k,
8
+ accent: x,
8
9
  gray: L,
9
10
  brown: I,
10
11
  red: R,
@@ -16,9 +17,9 @@ const x = "Badge_badge_-mEE7", H = "Badge_appear_LbxbS", L = "Badge_gray_7jA-J",
16
17
  blue: F,
17
18
  indigo: K,
18
19
  purple: N,
19
- accent: O
20
+ pink: O
20
21
  };
21
- function Y(a) {
22
+ function T(a) {
22
23
  const n = _();
23
24
  return l(() => {
24
25
  n.current = a;
@@ -34,7 +35,7 @@ const A = ({
34
35
  style: f,
35
36
  ...y
36
37
  }) => {
37
- const e = !o, p = Y(e), t = _(null);
38
+ const e = !o, p = T(e), t = _(null);
38
39
  if (w(() => {
39
40
  var r;
40
41
  p && !e && ((r = t.current) == null || r.classList.add(g.appear));
@@ -43,12 +44,12 @@ const A = ({
43
44
  const r = t.current.clientHeight, d = t.current.parentElement, i = d ? Math.min(
44
45
  parseInt(getComputedStyle(d).getPropertyValue("border-radius")),
45
46
  d.clientHeight / 2
46
- ) : 0, B = i * (1 - Math.sin(45 * Math.PI / 180)), m = (1 + Math.min(i / r, 1)) * (r / 4);
47
- t.current.style.setProperty("--offset", `${B - m}px`);
47
+ ) : 0, b = i * (1 - Math.sin(45 * Math.PI / 180)), m = (1 + Math.min(i / r, 1)) * (r / 4);
48
+ t.current.style.setProperty("--offset", `${b - m}px`);
48
49
  }
49
50
  }, [e, s]), e)
50
51
  return null;
51
- const b = typeof o == "number" && c > 0 && o > c;
52
+ const B = typeof o == "number" && c > 0 && o > c;
52
53
  return /* @__PURE__ */ h(
53
54
  "div",
54
55
  {
@@ -57,8 +58,8 @@ const A = ({
57
58
  "data-badge": n,
58
59
  "data-placement": s,
59
60
  className: E(g.badge, g[n], u),
60
- style: { ...f, ...M({ size: a }) },
61
- children: P(b ? `${c}+` : o, "span")
61
+ style: { ...f, ...H({ size: a }) },
62
+ children: P(B ? `${c}+` : o, "span")
62
63
  }
63
64
  );
64
65
  };
@@ -1,62 +1,48 @@
1
- import { jsxs as u, jsx as v, Fragment as B } from "react/jsx-runtime";
2
- import b from "classnames";
3
- import { fixedForwardRef as w, wrapNode as d, cssProps as x } from "../../utils/helpers.js";
1
+ import { jsxs as m, jsx as y, Fragment as j } from "react/jsx-runtime";
2
+ import w from "classnames";
3
+ import { fixedForwardRef as E, wrapNode as i, cssProps as F } from "../../utils/helpers.js";
4
4
  import { Spinner as N } from "../Spinner/Spinner.js";
5
- const h = "Button_button_WuG2z", y = {
6
- button: h,
7
- "primary-default": "Button_primary-default_lVt-V",
8
- "secondary-default": "Button_secondary-default_yggNH",
9
- "tertiary-default": "Button_tertiary-default_qSFa6",
10
- "primary-negative": "Button_primary-negative_AupXJ",
11
- "secondary-negative": "Button_secondary-negative_bZbAE",
12
- "tertiary-negative": "Button_tertiary-negative_7Dh-3",
13
- "primary-positive": "Button_primary-positive_4Mnfc",
14
- "secondary-positive": "Button_secondary-positive_h1UJg",
15
- "tertiary-positive": "Button_tertiary-positive_oTrM5",
16
- "primary-warning": "Button_primary-warning_9A3NY",
17
- "secondary-warning": "Button_secondary-warning_mbIUl",
18
- "tertiary-warning": "Button_tertiary-warning_gM2um"
19
- };
20
- function A({
21
- as: _,
5
+ import { s as l } from "../../styles.module-q4f7jLJ9.js";
6
+ function $({
7
+ as: p,
22
8
  variant: r = "primary",
23
- scheme: a = "default",
24
- size: p,
25
- minWidth: m,
26
- maxWidth: l,
9
+ scheme: e = "default",
10
+ size: f,
11
+ minWidth: u,
12
+ maxWidth: c,
27
13
  busy: t,
28
- title: e,
29
- icon: n,
30
- iconPosition: i = "start",
31
- children: o,
32
- className: g,
33
- style: c,
34
- ...s
35
- }, f) {
36
- return /* @__PURE__ */ u(
37
- _ ?? "button",
14
+ title: a,
15
+ icon: o,
16
+ iconPosition: s = "start",
17
+ children: d,
18
+ className: b,
19
+ style: x,
20
+ ...n
21
+ }, v) {
22
+ return /* @__PURE__ */ m(
23
+ p ?? "button",
38
24
  {
39
- ...s,
40
- ref: f,
25
+ ...n,
26
+ ref: v,
41
27
  "data-busy": t,
42
28
  "data-button": r,
43
- "data-scheme": a,
44
- "aria-disabled": s.disabled,
29
+ "data-scheme": e,
30
+ "aria-disabled": n.disabled,
45
31
  "aria-live": t ? "polite" : void 0,
46
- className: b(y.button, y[`${r}-${a}`], g),
47
- style: { ...c, ...x({ size: p, minWidth: m, maxWidth: l }) },
32
+ className: w(l.button, l[`${r}-${e}`], b),
33
+ style: { ...x, ...F({ size: f, minWidth: u, maxWidth: c }) },
48
34
  children: [
49
- o ? d(o, "span") : /* @__PURE__ */ u(B, { children: [
50
- i === "start" && n,
51
- e !== void 0 && d(e, "span"),
52
- i === "end" && n
35
+ d ? i(d, "span") : /* @__PURE__ */ m(j, { children: [
36
+ s === "start" && o,
37
+ a !== void 0 && i(a, "span"),
38
+ s === "end" && o
53
39
  ] }),
54
- t && /* @__PURE__ */ v(N, { overlay: !0 })
40
+ t && /* @__PURE__ */ y(N, { overlay: !0 })
55
41
  ]
56
42
  }
57
43
  );
58
44
  }
59
- const S = w(A);
45
+ const q = E($);
60
46
  export {
61
- S as Button
47
+ q as Button
62
48
  };
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export type ButtonGroupProps = React.HTMLAttributes<HTMLDivElement> & {
3
+ children: React.ReactElement[];
4
+ minWidth?: React.CSSProperties['minWidth'];
5
+ maxWidth?: React.CSSProperties['maxWidth'];
6
+ flexBasis?: React.CSSProperties['flexBasis'];
7
+ };
8
+ export declare const ButtonGroup: ({ minWidth, maxWidth, flexBasis, className, style, children, ...props }: ButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import e from "classnames";
3
+ import { cssProps as i } from "../../utils/helpers.js";
4
+ import { s as c } from "../../styles.module-q4f7jLJ9.js";
5
+ const g = ({
6
+ minWidth: o,
7
+ maxWidth: r,
8
+ flexBasis: t,
9
+ className: s,
10
+ style: m,
11
+ children: p,
12
+ ...u
13
+ }) => /* @__PURE__ */ a(
14
+ "div",
15
+ {
16
+ ...u,
17
+ "data-button-group": !0,
18
+ className: e(c.group, s),
19
+ style: { ...m, ...i({ flexBasis: t, minWidth: o, maxWidth: r }) },
20
+ children: p
21
+ }
22
+ );
23
+ export {
24
+ g as ButtonGroup
25
+ };
@@ -1 +1,2 @@
1
1
  export * from './Button';
2
+ export * from './ButtonGroup';
@@ -1,4 +1,6 @@
1
1
  import { Button as r } from "./Button.js";
2
+ import { ButtonGroup as u } from "./ButtonGroup.js";
2
3
  export {
3
- r as Button
4
+ r as Button,
5
+ u as ButtonGroup
4
6
  };
@@ -2,6 +2,7 @@ import { default as React } from 'react';
2
2
  export interface FieldConfig {
3
3
  id?: string;
4
4
  label?: React.ReactNode;
5
+ labelId?: string;
5
6
  labelAccessory?: React.ReactNode;
6
7
  help?: React.ReactNode;
7
8
  required?: boolean;
@@ -14,7 +15,7 @@ export type FieldLabelProps = React.LabelHTMLAttributes<HTMLLabelElement> & {
14
15
  required?: boolean;
15
16
  };
16
17
  export declare const FieldLabel: ({ label, required, className, children, ...props }: FieldLabelProps) => import("react/jsx-runtime").JSX.Element;
17
- export type FieldDescriptionProps = React.HTMLAttributes<HTMLDivElement>;
18
+ export type FieldDescriptionProps = React.HTMLAttributes<HTMLSpanElement>;
18
19
  export declare const FieldDescription: ({ className, children, ...props }: FieldDescriptionProps) => import("react/jsx-runtime").JSX.Element;
19
20
  export type FieldProps = React.HTMLAttributes<HTMLDivElement> & FieldConfig;
20
- export declare const Field: ({ id, label, labelAccessory, help, required, minWidth, maxWidth, className, children, style, ...props }: FieldProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const Field: ({ id, label, labelId, labelAccessory, help, required, minWidth, maxWidth, className, children, style, ...props }: FieldProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,53 +1,54 @@
1
- import { jsxs as i, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
2
  import d from "classnames";
3
- import _ from "react";
4
- import { cssProps as p } from "../../utils/helpers.js";
5
- const u = "styles_field_hqzKT", b = "styles_header_Iwsz6", N = "styles_label_zRVTS", F = "styles_accessory_S4ccn", v = "styles_description_fZnNW", a = {
6
- field: u,
7
- header: b,
8
- label: N,
9
- accessory: F,
10
- description: v
11
- }, x = ({ label: e, required: s, className: l, children: t, ...c }) => /* @__PURE__ */ i("div", { "data-field-header": !0, className: a.header, children: [
12
- /* @__PURE__ */ r(
3
+ import p from "react";
4
+ import { cssProps as u } from "../../utils/helpers.js";
5
+ const b = "styles_field_hqzKT", N = "styles_header_Iwsz6", F = "styles_label_zRVTS", v = "styles_accessory_S4ccn", x = "styles_description_fZnNW", t = {
6
+ field: b,
7
+ header: N,
8
+ label: F,
9
+ accessory: v,
10
+ description: x
11
+ }, z = ({ label: e, required: s, className: l, children: r, ...c }) => /* @__PURE__ */ i("div", { "data-field-header": !0, className: t.header, children: [
12
+ /* @__PURE__ */ a(
13
13
  "label",
14
14
  {
15
15
  ...c,
16
16
  "data-field-label": !0,
17
17
  "data-required": s,
18
- className: d(a.label, l),
18
+ className: d(t.label, l),
19
19
  children: e
20
20
  }
21
21
  ),
22
- _.Children.toArray(t).length > 0 && /* @__PURE__ */ r("div", { "data-field-accessory": !0, className: a.accessory, children: t })
23
- ] }), z = ({ className: e, children: s, ...l }) => /* @__PURE__ */ r("small", { ...l, "data-field-description": !0, className: d(a.description, e), children: s }), T = ({
22
+ p.Children.toArray(r).length > 0 && /* @__PURE__ */ a("div", { "data-field-accessory": !0, className: t.accessory, children: r })
23
+ ] }), j = ({ className: e, children: s, ...l }) => /* @__PURE__ */ a("small", { ...l, "data-field-description": !0, className: d(t.description, e), children: s }), g = ({
24
24
  id: e,
25
25
  label: s,
26
- labelAccessory: l,
27
- help: t,
28
- required: c,
29
- minWidth: o,
30
- maxWidth: n,
31
- className: f,
32
- children: m,
33
- style: y,
34
- ...h
26
+ labelId: l,
27
+ labelAccessory: r,
28
+ help: c,
29
+ required: o,
30
+ minWidth: n,
31
+ maxWidth: f,
32
+ className: m,
33
+ children: y,
34
+ style: h,
35
+ ..._
35
36
  }) => /* @__PURE__ */ i(
36
37
  "div",
37
38
  {
38
- ...h,
39
+ ..._,
39
40
  "data-field": e || !0,
40
- className: d(a.field, f),
41
- style: { ...y, ...p({ minWidth: o, maxWidth: n }) },
41
+ className: d(t.field, m),
42
+ style: { ...h, ...u({ minWidth: n, maxWidth: f }) },
42
43
  children: [
43
- s && /* @__PURE__ */ r(x, { htmlFor: e, label: s, required: c, children: l }),
44
- m,
45
- t && /* @__PURE__ */ r(z, { children: t })
44
+ s && /* @__PURE__ */ a(z, { id: l, htmlFor: e, label: s, required: o, children: r }),
45
+ y,
46
+ c && /* @__PURE__ */ a(j, { children: c })
46
47
  ]
47
48
  }
48
49
  );
49
50
  export {
50
- T as Field,
51
- z as FieldDescription,
52
- x as FieldLabel
51
+ g as Field,
52
+ j as FieldDescription,
53
+ z as FieldLabel
53
54
  };
@@ -2,20 +2,21 @@ import { jsxs as f, jsx as a } from "react/jsx-runtime";
2
2
  import y from "classnames";
3
3
  import _, { useRef as h, useImperativeHandle as v, useCallback as s } from "react";
4
4
  import { Icon as i } from "../Icon/Icon.js";
5
- import { Button as l } from "../Button/Button.js";
5
+ import { Button as o } from "../Button/Button.js";
6
+ import "../../utils/helpers.js";
6
7
  import { I as w } from "../../Input-D46mAsdt.js";
7
8
  const E = "styles_numeric_dzUSE", R = "styles_increase_5S-Jo", g = "styles_decrease_j8UR6", c = {
8
9
  numeric: E,
9
10
  increase: R,
10
11
  decrease: g
11
- }, x = _.forwardRef(
12
- ({ labelIncrease: o = "increase", labelDecrease: d = "decrease", className: u, ...n }, m) => {
12
+ }, C = _.forwardRef(
13
+ ({ labelIncrease: l = "increase", labelDecrease: d = "decrease", className: u, ...n }, m) => {
13
14
  const e = h(null);
14
15
  v(m, () => e.current);
15
- const b = s(() => {
16
+ const p = s(() => {
16
17
  var r, t;
17
18
  (r = e.current) == null || r.stepUp(), (t = e.current) == null || t.dispatchEvent(new Event("change", { bubbles: !0 }));
18
- }, []), p = s(() => {
19
+ }, []), b = s(() => {
19
20
  var r, t;
20
21
  (r = e.current) == null || r.stepDown(), (t = e.current) == null || t.dispatchEvent(new Event("change", { bubbles: !0 }));
21
22
  }, []);
@@ -29,19 +30,19 @@ const E = "styles_numeric_dzUSE", R = "styles_increase_5S-Jo", g = "styles_decre
29
30
  className: y(c.numeric, u),
30
31
  children: [
31
32
  /* @__PURE__ */ a(
32
- l,
33
+ o,
33
34
  {
34
35
  type: "button",
35
36
  variant: "secondary",
36
- "aria-label": o,
37
+ "aria-label": l,
37
38
  disabled: n.disabled || n.readOnly,
38
39
  className: c.increase,
39
40
  icon: /* @__PURE__ */ a(i, { name: "triangle-up" }),
40
- onClick: b
41
+ onClick: p
41
42
  }
42
43
  ),
43
44
  /* @__PURE__ */ a(
44
- l,
45
+ o,
45
46
  {
46
47
  type: "button",
47
48
  variant: "secondary",
@@ -49,7 +50,7 @@ const E = "styles_numeric_dzUSE", R = "styles_increase_5S-Jo", g = "styles_decre
49
50
  disabled: n.disabled || n.readOnly,
50
51
  className: c.decrease,
51
52
  icon: /* @__PURE__ */ a(i, { name: "triangle-down" }),
52
- onClick: p
53
+ onClick: b
53
54
  }
54
55
  )
55
56
  ]
@@ -58,5 +59,5 @@ const E = "styles_numeric_dzUSE", R = "styles_increase_5S-Jo", g = "styles_decre
58
59
  }
59
60
  );
60
61
  export {
61
- x as Numeric
62
+ C as Numeric
62
63
  };
@@ -1,9 +1,14 @@
1
- export type SegmentedProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> & {
1
+ export type SegmentedItem<T> = {
2
+ value: T;
3
+ label: React.ReactNode;
4
+ disabled?: boolean;
5
+ };
6
+ export type SegmentedProps<T> = Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> & {
2
7
  size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
3
- items: React.ReactNode[];
4
- selected: number;
8
+ items: SegmentedItem<T>[];
9
+ selected?: T;
5
10
  disabled?: boolean;
6
11
  margin?: React.CSSProperties['margin'];
7
- onSelect: (index: number) => void;
12
+ onSelect?: (value: T) => void;
8
13
  };
9
- export declare const Segmented: ({ size, items, selected, disabled, margin, children, className, style, onSelect, ...props }: SegmentedProps) => import("react/jsx-runtime").JSX.Element;
14
+ export declare const Segmented: <T>({ size, items, selected, disabled, margin, children, className, style, onSelect, ...props }: SegmentedProps<T>) => import("react/jsx-runtime").JSX.Element;
@@ -1,53 +1,64 @@
1
- import { jsxs as l, jsx as s } from "react/jsx-runtime";
2
- import f from "classnames";
3
- import { Composite as u, CompositeItem as h } from "@floating-ui/react";
4
- import { cssProps as y, wrapNode as C } from "../../utils/helpers.js";
5
- const b = "Segmented_segmented_UOs8Z", j = {
6
- segmented: b
7
- }, w = ({
8
- size: m,
9
- items: r,
10
- selected: t,
11
- disabled: o,
12
- margin: a,
13
- children: n,
14
- className: d,
15
- style: p,
16
- onSelect: c,
17
- ...g
18
- }) => /* @__PURE__ */ l(
19
- u,
20
- {
21
- ...g,
22
- role: "radiogroup",
23
- "data-segmented": !0,
24
- "data-disabled": o,
25
- className: f(j.segmented, d),
26
- style: { ...p, ...y({ size: m, margin: a }) },
27
- children: [
28
- r.map((i, e) => /* @__PURE__ */ s(
29
- h,
30
- {
31
- render: /* @__PURE__ */ s(
32
- "button",
33
- {
34
- role: "radio",
35
- type: "button",
36
- disabled: o,
37
- "data-segmented-item": e,
38
- "aria-checked": e === t,
39
- "data-selected": e === t,
40
- onClick: () => e !== t && c(e),
41
- children: C(i, "span")
42
- }
43
- )
44
- },
45
- e
46
- )),
47
- n
48
- ]
49
- }
50
- );
1
+ import { jsxs as f, jsx as m } from "react/jsx-runtime";
2
+ import v from "classnames";
3
+ import { useState as h, useEffect as _ } from "react";
4
+ import { Composite as y, CompositeItem as C } from "@floating-ui/react";
5
+ import { cssProps as N, wrapNode as j } from "../../utils/helpers.js";
6
+ const k = "Segmented_button_FPqA0", x = "Segmented_segmented_UOs8Z", l = {
7
+ button: k,
8
+ segmented: x
9
+ }, A = ({
10
+ size: u,
11
+ items: a,
12
+ selected: t = a[0].value,
13
+ disabled: s,
14
+ margin: p,
15
+ children: c,
16
+ className: i,
17
+ style: g,
18
+ onSelect: o,
19
+ ...b
20
+ }) => {
21
+ const [r, n] = h(t);
22
+ return _(() => {
23
+ n(t);
24
+ }, [t]), /* @__PURE__ */ f(
25
+ y,
26
+ {
27
+ ...b,
28
+ role: "radiogroup",
29
+ orientation: "horizontal",
30
+ "data-segmented": !0,
31
+ "data-disabled": s,
32
+ className: v(l.segmented, i),
33
+ style: { ...g, ...N({ size: u, margin: p }) },
34
+ children: [
35
+ a.map((e, d) => /* @__PURE__ */ m(
36
+ C,
37
+ {
38
+ render: /* @__PURE__ */ m(
39
+ "button",
40
+ {
41
+ role: "radio",
42
+ type: "button",
43
+ disabled: s || e.disabled,
44
+ "data-segmented-item": d,
45
+ "aria-checked": e.value === r,
46
+ "data-selected": e.value === r,
47
+ className: l.button,
48
+ onClick: () => {
49
+ n(e.value), o == null || o(e.value);
50
+ },
51
+ children: j(e.label, "span")
52
+ }
53
+ )
54
+ },
55
+ d
56
+ )),
57
+ c
58
+ ]
59
+ }
60
+ );
61
+ };
51
62
  export {
52
- w as Segmented
63
+ A as Segmented
53
64
  };
@@ -3,6 +3,9 @@ import T from "classnames";
3
3
  import { fixedForwardRef as f, wrapNode as c, cssProps as y } from "../../utils/helpers.js";
4
4
  const b = "Tag_tag_-ovOm", _ = {
5
5
  tag: b,
6
+ "default-accent": "Tag_default-accent_uUXnO",
7
+ "solid-accent": "Tag_solid-accent_bbTSM",
8
+ "plain-accent": "Tag_plain-accent_cqQHI",
6
9
  "default-gray": "Tag_default-gray_Ju2wo",
7
10
  "solid-gray": "Tag_solid-gray_q6GO4",
8
11
  "plain-gray": "Tag_plain-gray_VOC5n",
@@ -36,41 +39,41 @@ const b = "Tag_tag_-ovOm", _ = {
36
39
  "default-purple": "Tag_default-purple_oBbek",
37
40
  "solid-purple": "Tag_solid-purple_e10WH",
38
41
  "plain-purple": "Tag_plain-purple_sVJ5H",
39
- "default-accent": "Tag_default-accent_uUXnO",
40
- "solid-accent": "Tag_solid-accent_bbTSM",
41
- "plain-accent": "Tag_plain-accent_cqQHI"
42
+ "default-pink": "Tag_default-pink_OAPbj",
43
+ "solid-pink": "Tag_solid-pink_MDD-Z",
44
+ "plain-pink": "Tag_plain-pink_cFBKk"
42
45
  };
43
46
  function w({
44
47
  as: d,
45
48
  size: g,
46
49
  variant: a = "default",
47
50
  scheme: l = "gray",
48
- title: o,
51
+ title: i,
49
52
  icon: e,
50
53
  iconPosition: n = "start",
51
- className: i,
54
+ className: o,
52
55
  style: t,
53
56
  children: r,
54
- ...u
55
- }, p) {
57
+ ...p
58
+ }, u) {
56
59
  return /* @__PURE__ */ s(
57
60
  d ?? "span",
58
61
  {
59
- ...u,
60
- ref: p,
62
+ ...p,
63
+ ref: u,
61
64
  "data-tag": a,
62
65
  "data-scheme": l,
63
- className: T(_.tag, _[`${a}-${l}`], i),
66
+ className: T(_.tag, _[`${a}-${l}`], o),
64
67
  style: { ...t, ...y({ size: g }) },
65
68
  children: [
66
69
  n === "start" && e,
67
- c(r || o, "span"),
70
+ c(r || i, "span"),
68
71
  n === "end" && e
69
72
  ]
70
73
  }
71
74
  );
72
75
  }
73
- const x = f(w);
76
+ const V = f(w);
74
77
  export {
75
- x as Tag
78
+ V as Tag
76
79
  };
@@ -1,21 +1,23 @@
1
1
  import { jsx as i } from "react/jsx-runtime";
2
2
  import d from "react";
3
- import { Button as f } from "../Button/Button.js";
4
- const e = d.forwardRef(
5
- ({ selected: a = !1, role: o, ...r }, t) => /* @__PURE__ */ i(
6
- f,
3
+ import { Button as m } from "../Button/Button.js";
4
+ import "classnames";
5
+ import "../../utils/helpers.js";
6
+ const g = d.forwardRef(
7
+ ({ selected: o = !1, role: r, ...a }, t) => /* @__PURE__ */ i(
8
+ m,
7
9
  {
8
- ...r,
10
+ ...a,
9
11
  ref: t,
10
- role: o,
12
+ role: r,
11
13
  "data-toggle-button": !0,
12
- "data-selected": a,
13
- variant: a ? "primary" : "secondary",
14
- "aria-checked": o === "radio" ? a : void 0,
15
- "aria-pressed": o !== "radio" ? a : void 0
14
+ "data-selected": o,
15
+ variant: o ? "primary" : "secondary",
16
+ "aria-checked": r === "radio" ? o : void 0,
17
+ "aria-pressed": r !== "radio" ? o : void 0
16
18
  }
17
19
  )
18
20
  );
19
21
  export {
20
- e as ToggleButton
22
+ g as ToggleButton
21
23
  };
@@ -1,12 +1,11 @@
1
1
  import { default as React } from 'react';
2
2
  export type ToggleGroupProps = Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> & {
3
- variant?: 'inline' | 'block';
4
- selected: number;
3
+ selected?: number;
5
4
  disabled?: boolean;
6
- equalWidth?: boolean;
7
5
  children: React.ReactElement[];
8
6
  minWidth?: React.CSSProperties['minWidth'];
9
7
  maxWidth?: React.CSSProperties['maxWidth'];
10
- onSelect: (index: number) => void;
8
+ flexBasis?: React.CSSProperties['flexBasis'];
9
+ onSelect?: (index: number) => void;
11
10
  };
12
- export declare const ToggleGroup: ({ variant, selected, disabled, equalWidth, minWidth, maxWidth, className, style, children, onSelect, ...props }: ToggleGroupProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const ToggleGroup: ({ selected, disabled, minWidth, maxWidth, flexBasis, className, style, children, onSelect, ...props }: ToggleGroupProps) => import("react/jsx-runtime").JSX.Element;