@kapiuara/ui 0.13.0 → 0.14.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 (40) hide show
  1. package/README.md +5 -0
  2. package/dist/components/chat/KapiChatDivider.d.ts +7 -3
  3. package/dist/components/chat/KapiChatDivider.js +6 -6
  4. package/dist/components/chat/index.d.ts +1 -1
  5. package/dist/components/display/KapiAnnotation.js +4 -4
  6. package/dist/components/feedback/KapiFab.js +4 -4
  7. package/dist/components/feedback/KapiToastContainer.js +5 -5
  8. package/dist/components/feedback/KapiTour.js +4 -4
  9. package/dist/components/inputs/KapiDatePicker.js +124 -122
  10. package/dist/components/inputs/KapiDateRangePicker.js +138 -136
  11. package/dist/components/inputs/KapiFacetedSearch.js +8 -8
  12. package/dist/components/inputs/KapiMaskedInput.d.ts +8 -3
  13. package/dist/components/inputs/KapiMaskedInput.js +66 -53
  14. package/dist/components/inputs/KapiNumberStepper.js +29 -29
  15. package/dist/components/inputs/KapiRating.js +61 -59
  16. package/dist/components/inputs/KapiSegmented.js +68 -58
  17. package/dist/components/inputs/KapiSelect.js +204 -194
  18. package/dist/components/inputs/KapiTagInput.js +82 -80
  19. package/dist/components/inputs/misuseWarnings.d.ts +37 -0
  20. package/dist/components/inputs/misuseWarnings.js +36 -0
  21. package/dist/components/inputs/numberStepLogic.d.ts +10 -0
  22. package/dist/components/inputs/numberStepLogic.js +16 -7
  23. package/dist/components/layout/KapiAccountMenu.js +4 -4
  24. package/dist/components/navigation/CtxSlidingList.js +4 -4
  25. package/dist/components/navigation/KapiTabs.js +58 -51
  26. package/dist/components/navigation/KapiTree.js +5 -5
  27. package/dist/components/overlays/KapiContextMenu.js +4 -4
  28. package/dist/components/overlays/KapiMenuButton.js +4 -4
  29. package/dist/components/overlays/KapiPhotoView.js +1 -1
  30. package/dist/components/overlays/KapiPopover.js +4 -4
  31. package/dist/components/overlays/KapiShapeSheet.js +4 -4
  32. package/dist/components/overlays/KapiTooltip.js +1 -1
  33. package/dist/css/components/chat/chat.css +1 -1
  34. package/dist/hooks/useControllableState.d.ts +6 -2
  35. package/dist/hooks/useControllableState.js +14 -11
  36. package/dist/hooks/useFormReset.d.ts +22 -0
  37. package/dist/hooks/useFormReset.js +17 -0
  38. package/dist/kapi.css +1 -1
  39. package/dist/kapi.layered.css +1 -1
  40. package/package.json +5 -2
@@ -1,15 +1,15 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/inputs/inputsExtra.css";
3
- import { fieldControlProps as e, joinIds as t, resolveFieldClassName as n, resolveReadOnly as r, resolveValidation as i } from "./fieldLogic.js";
4
- import { useOwnField as a } from "./ownField.js";
5
- import { useLabels as o } from "../locale/KapiLocaleProvider.js";
3
+ import { fieldControlProps as e, joinIds as t, resolveFieldClassName as n, resolveReadOnly as ee, resolveValidation as r } from "./fieldLogic.js";
4
+ import { useOwnField as i } from "./ownField.js";
5
+ import { useLabels as a } from "../locale/KapiLocaleProvider.js";
6
6
  /* empty css */
7
- import { inputClasses as s } from "./KapiInput.js";
8
- import { useControllableState as c } from "../../hooks/useControllableState.js";
9
- import { canDecrement as l, canIncrement as u, clampNumber as d, stepValue as f } from "./numberStepLogic.js";
10
- import { jsx as p, jsxs as m } from "react/jsx-runtime";
11
- import { useEffect as h, useState as ee } from "react";
12
- import { Minus as te, Plus as g } from "lucide-react";
7
+ import { inputClasses as o } from "./KapiInput.js";
8
+ import { useControllableState as s } from "../../hooks/useControllableState.js";
9
+ import { canDecrement as te, canIncrement as c, clampNumber as l, parseTypedNumber as u, snapToStep as d, stepValue as ne } from "./numberStepLogic.js";
10
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
11
+ import { useEffect as m, useState as h } from "react";
12
+ import { Minus as g, Plus as re } from "lucide-react";
13
13
  //#region src/components/inputs/KapiNumberStepper.tsx
14
14
  var _ = ({ size: e = "md", className: t = "" } = {}) => [
15
15
  "kapi-stepper",
@@ -19,11 +19,11 @@ var _ = ({ size: e = "md", className: t = "" } = {}) => [
19
19
  decrease: "Disminuir",
20
20
  increase: "Aumentar"
21
21
  }, y = ({ value: y, defaultValue: b, onChange: x, min: S, max: C, step: w = 1, size: T = "md", invalid: E, status: D, required: O, label: k, help: A, fieldClassName: j, wrapperClassName: M, labels: N, className: P, disabled: F, readOnly: I, id: L, ...R }) => {
22
- let z = o("numberStepper", v, N), [B, V] = c(y, () => d(b ?? 0, {
22
+ let z = a("numberStepper", v, N), [B, V] = s(y, () => l(b ?? 0, {
23
23
  min: S,
24
24
  max: C,
25
25
  step: w
26
- }), x), { invalid: H, status: U } = i(E, D), W = a({
26
+ }), x), { invalid: H, status: U } = r(E, D), W = i({
27
27
  id: L,
28
28
  label: k,
29
29
  help: A,
@@ -31,42 +31,42 @@ var _ = ({ size: e = "md", className: t = "" } = {}) => [
31
31
  invalid: E,
32
32
  status: D,
33
33
  readOnly: I
34
- }), G = W.controlId ?? W.autoId, { helpId: K } = W, q = r(I, W.field), J = {
34
+ }), G = W.controlId ?? W.autoId, { helpId: K } = W, q = ee(I, W.field), J = {
35
35
  min: S,
36
36
  max: C,
37
37
  step: w
38
- }, [Y, X] = ee(null);
39
- h(() => X(null), [B]);
38
+ }, [Y, X] = h(null);
39
+ m(() => X(null), [B]);
40
40
  let Z = (e) => {
41
- let t = d(e, J);
41
+ let t = l(e, J);
42
42
  t !== B && V(t), X(null);
43
43
  }, Q = () => {
44
44
  if (Y === null) return;
45
- let e = Number(Y.replace(",", "."));
46
- Z(Y.trim() === "" || Number.isNaN(e) ? B : e);
45
+ let e = u(Y);
46
+ Z(e === null ? B : d(e, J));
47
47
  }, $ = (e) => {
48
48
  if (q) return;
49
- let t = Y === null || Y.trim() === "" ? NaN : Number(Y.replace(",", "."));
50
- Z(f(Number.isNaN(t) ? B : t, e, J));
51
- }, ne = /* @__PURE__ */ m("div", {
49
+ let t = Y === null ? null : u(Y), n = t === null ? B : d(t, J);
50
+ Z(ne(n, e, J));
51
+ }, ie = /* @__PURE__ */ p("div", {
52
52
  className: _({
53
53
  size: T,
54
54
  className: n(j, M)
55
55
  }),
56
56
  children: [
57
- /* @__PURE__ */ p("button", {
57
+ /* @__PURE__ */ f("button", {
58
58
  type: "button",
59
59
  className: "kapi-stepper__btn",
60
60
  "aria-label": z.decrease,
61
61
  tabIndex: -1,
62
- disabled: F || q || !l(B, J),
62
+ disabled: F || q || !te(B, J),
63
63
  onClick: () => $(-1),
64
- children: /* @__PURE__ */ p(te, {
64
+ children: /* @__PURE__ */ f(g, {
65
65
  size: 15,
66
66
  strokeWidth: 2.4
67
67
  })
68
68
  }),
69
- /* @__PURE__ */ p("input", {
69
+ /* @__PURE__ */ f("input", {
70
70
  ...R,
71
71
  ...e(W.outer, {
72
72
  id: G,
@@ -81,7 +81,7 @@ var _ = ({ size: e = "md", className: t = "" } = {}) => [
81
81
  "aria-valuenow": B,
82
82
  "aria-valuemin": S,
83
83
  "aria-valuemax": C,
84
- className: s({
84
+ className: o({
85
85
  size: T,
86
86
  status: U,
87
87
  num: !0,
@@ -95,21 +95,21 @@ var _ = ({ size: e = "md", className: t = "" } = {}) => [
95
95
  e.key === "ArrowUp" ? (e.preventDefault(), $(1)) : e.key === "ArrowDown" ? (e.preventDefault(), $(-1)) : e.key === "Enter" && Q();
96
96
  }
97
97
  }),
98
- /* @__PURE__ */ p("button", {
98
+ /* @__PURE__ */ f("button", {
99
99
  type: "button",
100
100
  className: "kapi-stepper__btn",
101
101
  "aria-label": z.increase,
102
102
  tabIndex: -1,
103
- disabled: F || q || !u(B, J),
103
+ disabled: F || q || !c(B, J),
104
104
  onClick: () => $(1),
105
- children: /* @__PURE__ */ p(g, {
105
+ children: /* @__PURE__ */ f(re, {
106
106
  size: 15,
107
107
  strokeWidth: 2.4
108
108
  })
109
109
  })
110
110
  ]
111
111
  });
112
- return W.wrap(ne);
112
+ return W.wrap(ie);
113
113
  };
114
114
  //#endregion
115
115
  export { v as DEFAULT_NUMBER_STEPPER_LABELS, y as KapiNumberStepper, _ as stepperClasses };
@@ -5,110 +5,112 @@ import { useOwnField as n } from "./ownField.js";
5
5
  import { useLabels as r } from "../locale/KapiLocaleProvider.js";
6
6
  /* empty css */
7
7
  import { useControllableState as i } from "../../hooks/useControllableState.js";
8
- import { directionOf as a, logicalKeyOf as ee } from "../../hooks/directionLogic.js";
9
- import { normalizeRating as o, ratingFromKey as s, ratingFromPointer as c, starFills as l } from "./ratingLogic.js";
10
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
11
- import { useState as te } from "react";
12
- import { Star as f } from "lucide-react";
8
+ import { directionOf as ee, logicalKeyOf as te } from "../../hooks/directionLogic.js";
9
+ import { useFormReset as ne } from "../../hooks/useFormReset.js";
10
+ import { useMergedRefs as a } from "../../hooks/mergeRefs.js";
11
+ import { normalizeRating as o, ratingFromKey as s, ratingFromPointer as c, starFills as re } from "./ratingLogic.js";
12
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
13
+ import { useState as ie } from "react";
14
+ import { Star as d } from "lucide-react";
13
15
  //#region src/components/inputs/KapiRating.tsx
14
- var p = {
16
+ var f = {
15
17
  rating: "Calificación",
16
18
  of: "de"
17
- }, m = {
19
+ }, p = {
18
20
  sm: 16,
19
21
  md: 22,
20
22
  lg: 30
21
- }, h = ({ size: e = "md", interactive: t = !1, disabled: n = !1, readOnly: r = !1, className: i = "" } = {}) => [
23
+ }, m = ({ size: e = "md", interactive: t = !1, disabled: n = !1, readOnly: r = !1, className: i = "" } = {}) => [
22
24
  "kapi-rating",
23
25
  e !== "md" && `kapi-rating--${e}`,
24
26
  t && "kapi-rating--interactive",
25
27
  n && "kapi-rating--disabled",
26
28
  r && "kapi-rating--readonly",
27
29
  i
28
- ].filter(Boolean).join(" "), g = ({ value: g, defaultValue: _, onChange: v, max: y = 5, size: b = "md", disabled: x = !1, allowHalf: S = !1, className: ne, labels: C, "aria-label": w, name: T, invalid: E, required: D, label: re, help: O, fieldClassName: k, readOnly: A, id: j, "aria-describedby": M, ref: N, ...P }) => {
29
- let F = r("rating", p, C), I = n({
30
+ ].filter(Boolean).join(" "), h = ({ value: h, defaultValue: g, onChange: _, max: v = 5, size: y = "md", disabled: b = !1, allowHalf: x = !1, className: ae, labels: S, "aria-label": C, name: w, invalid: T, required: E, label: D, help: O, fieldClassName: k, readOnly: A, id: j, "aria-describedby": M, ref: oe, ...N }) => {
31
+ let P = r("rating", f, S), F = n({
30
32
  id: j,
31
- label: re,
33
+ label: D,
32
34
  help: O,
33
- required: D,
34
- invalid: E,
35
+ required: E,
36
+ invalid: T,
35
37
  readOnly: A,
36
38
  fieldClassName: k
37
- }), L = I.field, R = t(A, L), [z, B] = te(null), [V, H] = i(g, _ ?? 0, v), U = (v !== void 0 || g === void 0 && _ !== void 0) && !x, W = U && !R, G = e(U ? L : null, {
39
+ }), I = F.field, L = t(A, I), [R, z] = ie(null), [B, V, , H] = i(h, g ?? 0, _), U = a(oe, ne(H)), W = (_ !== void 0 || h === void 0 && g !== void 0) && !b, G = W && !L, K = e(W ? I : null, {
38
40
  id: j,
39
41
  describedBy: M,
40
- invalid: E,
41
- required: D,
42
+ invalid: T,
43
+ required: E,
42
44
  labelable: !1,
43
- ariaLabel: w
44
- }), K = w ?? F.rating, q = o(V, y, S), J = T ? /* @__PURE__ */ u("input", {
45
+ ariaLabel: C
46
+ }), q = C ?? P.rating, J = o(B, v, x), Y = w ? /* @__PURE__ */ l("input", {
45
47
  type: "hidden",
46
- name: T,
47
- value: q,
48
- disabled: x
49
- }) : null, Y = l(W && z !== null ? z : q, y, S), X = m[b], Z = (e, t) => {
50
- let n = e.currentTarget.getBoundingClientRect(), r = a(e.currentTarget) === "rtl" ? n.right - e.clientX : e.clientX - n.left, i = n.width > 0 ? r / n.width : 1;
51
- return c(t, i, S);
52
- }, ie = (e) => {
53
- if (!W) return;
54
- let t = s(ee(e), q, y, S);
55
- t !== null && (e.preventDefault(), t !== q && H(t));
56
- }, Q = Y.map((e, t) => /* @__PURE__ */ d("span", {
48
+ name: w,
49
+ value: J,
50
+ disabled: b
51
+ }) : null, se = re(G && R !== null ? R : J, v, x), X = p[y], Z = (e, t) => {
52
+ let n = e.currentTarget.getBoundingClientRect(), r = ee(e.currentTarget) === "rtl" ? n.right - e.clientX : e.clientX - n.left, i = n.width > 0 ? r / n.width : 1;
53
+ return c(t, i, x);
54
+ }, ce = (e) => {
55
+ if (!G) return;
56
+ let t = s(te(e), J, v, x);
57
+ t !== null && (e.preventDefault(), t !== J && V(t));
58
+ }, Q = se.map((e, t) => /* @__PURE__ */ u("span", {
57
59
  className: "kapi-rating__star",
58
60
  "data-fill": e,
59
- onMouseMove: W ? (e) => B(Z(e, t)) : void 0,
60
- onClick: W ? (e) => {
61
+ onMouseMove: G ? (e) => z(Z(e, t)) : void 0,
62
+ onClick: G ? (e) => {
61
63
  let n = Z(e, t);
62
- H(n === q ? 0 : n);
64
+ V(n === J ? 0 : n);
63
65
  } : void 0,
64
- children: [/* @__PURE__ */ u(f, {
66
+ children: [/* @__PURE__ */ l(d, {
65
67
  size: X,
66
68
  strokeWidth: 2,
67
69
  className: "kapi-rating__base",
68
70
  "aria-hidden": "true"
69
- }), e !== "empty" && /* @__PURE__ */ u("span", {
71
+ }), e !== "empty" && /* @__PURE__ */ l("span", {
70
72
  className: "kapi-rating__fill",
71
73
  style: { width: e === "half" ? "50%" : "100%" },
72
- children: /* @__PURE__ */ u(f, {
74
+ children: /* @__PURE__ */ l(d, {
73
75
  size: X,
74
76
  strokeWidth: 2,
75
77
  fill: "currentColor",
76
78
  "aria-hidden": "true"
77
79
  })
78
80
  })]
79
- }, t)), $ = h({
80
- size: b,
81
- interactive: U,
82
- disabled: x,
83
- readOnly: U && R,
84
- className: ne
81
+ }, t)), $ = m({
82
+ size: y,
83
+ interactive: W,
84
+ disabled: b,
85
+ readOnly: W && L,
86
+ className: ae
85
87
  });
86
- return U ? I.wrap(/* @__PURE__ */ d("div", {
87
- ...P,
88
- ...G,
89
- ref: N,
88
+ return W ? F.wrap(/* @__PURE__ */ u("div", {
89
+ ...N,
90
+ ...K,
91
+ ref: U,
90
92
  className: $,
91
93
  role: "slider",
92
94
  tabIndex: 0,
93
- "aria-label": G["aria-labelledby"] ? void 0 : K,
95
+ "aria-label": K["aria-labelledby"] ? void 0 : q,
94
96
  "aria-valuemin": 0,
95
- "aria-valuemax": y,
96
- "aria-valuenow": q,
97
- "aria-valuetext": `${q} ${F.of} ${y}`,
98
- "aria-readonly": R || void 0,
99
- onKeyDown: ie,
100
- onMouseLeave: () => B(null),
101
- children: [Q, J]
102
- })) : I.wrap(/* @__PURE__ */ d("div", {
103
- ...P,
104
- ref: N,
97
+ "aria-valuemax": v,
98
+ "aria-valuenow": J,
99
+ "aria-valuetext": `${J} ${P.of} ${v}`,
100
+ "aria-readonly": L || void 0,
101
+ onKeyDown: ce,
102
+ onMouseLeave: () => z(null),
103
+ children: [Q, Y]
104
+ })) : F.wrap(/* @__PURE__ */ u("div", {
105
+ ...N,
106
+ ref: U,
105
107
  id: j,
106
108
  "aria-describedby": M,
107
109
  className: $,
108
110
  role: "img",
109
- "aria-label": `${K}: ${q} ${F.of} ${y}`,
110
- children: [Q, J]
111
+ "aria-label": `${q}: ${J} ${P.of} ${v}`,
112
+ children: [Q, Y]
111
113
  }));
112
114
  };
113
115
  //#endregion
114
- export { p as DEFAULT_RATING_LABELS, g as KapiRating, h as ratingClasses };
116
+ export { f as DEFAULT_RATING_LABELS, h as KapiRating, m as ratingClasses };
@@ -8,99 +8,109 @@ import { useKapiFormatLocale as a } from "../locale/KapiLocaleProvider.js";
8
8
  import { joinClasses as o } from "../rootProps.js";
9
9
  import { useControllableState as s } from "../../hooks/useControllableState.js";
10
10
  import { logicalKeyOf as c } from "../../hooks/directionLogic.js";
11
- import { useSlidingIndicator as l } from "../../hooks/useSlidingIndicator.js";
12
- import { formatCount as u } from "../../hooks/numberFormatLogic.js";
13
- import { KapiTooltip as d } from "../overlays/KapiTooltip.js";
14
- import { nextRadioIndex as f } from "./segmentedLogic.js";
15
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
11
+ import { useDuplicateValueWarning as l, useMutedControlWarning as ee } from "./misuseWarnings.js";
12
+ import { useFormReset as u } from "../../hooks/useFormReset.js";
13
+ import { useSlidingIndicator as d } from "../../hooks/useSlidingIndicator.js";
14
+ import { formatCount as f } from "../../hooks/numberFormatLogic.js";
15
+ import { KapiTooltip as p } from "../overlays/KapiTooltip.js";
16
+ import { nextRadioIndex as m } from "./segmentedLogic.js";
17
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
18
+ import { useMemo as v } from "react";
16
19
  //#region src/components/inputs/KapiSegmented.tsx
17
- var g = (t) => e(t.activeTone, t.color, void 0), _ = ({ items: e, value: _, defaultValue: v, onChange: y, variant: b = "text", "aria-label": x, className: S, name: C, onBlur: w, invalid: T, required: E, label: D, help: O, fieldClassName: k, disabled: A = !1, readOnly: j, size: M = "md", id: N, "aria-describedby": P, ref: F, ...I }) => {
18
- let L = a(), R = i({
19
- id: N,
20
- label: D,
21
- help: O,
22
- required: E,
23
- invalid: T,
24
- readOnly: j,
25
- fieldClassName: k
26
- }), z = r(j, R.field), B = (t) => A || e[t]?.disabled === !0, V = n(R.field, {
27
- id: N,
28
- describedBy: P,
29
- invalid: T,
30
- required: E,
20
+ var y = (t) => e(t.activeTone, t.color, void 0), b = ({ items: e, value: b, defaultValue: x, onChange: S, variant: C = "text", "aria-label": w, className: T, name: E, onBlur: D, invalid: O, required: k, label: A, help: j, fieldClassName: M, disabled: N = !1, readOnly: P, size: F = "md", id: I, "aria-describedby": L, ref: R, ...z }) => {
21
+ let B = a(), V = i({
22
+ id: I,
23
+ label: A,
24
+ help: j,
25
+ required: k,
26
+ invalid: O,
27
+ readOnly: P,
28
+ fieldClassName: M
29
+ }), H = r(P, V.field), U = (t) => N || e[t]?.disabled === !0, W = n(V.field, {
30
+ id: I,
31
+ describedBy: L,
32
+ invalid: O,
33
+ required: k,
31
34
  labelable: !1,
32
- ariaLabel: x
33
- }), [H, U] = s(_, () => v ?? e[0]?.id, y), W = e.find((e) => e.id === H), { containerRef: G, indicatorRef: K } = l({
34
- active: H ?? null,
35
- deps: [e, b],
35
+ ariaLabel: w
36
+ }), [G, K, , q] = s(b, () => x ?? e[0]?.id, S), J = u(q), Y = v(() => e.map((e) => e.id), [e]);
37
+ l("KapiSegmented", Y), ee("KapiSegmented", {
38
+ controlled: b !== void 0,
39
+ hasOnChange: !!S,
40
+ readOnly: H,
41
+ disabled: N
42
+ });
43
+ let X = e.find((e) => e.id === G), { containerRef: Z, indicatorRef: Q } = d({
44
+ active: G ?? null,
45
+ deps: [e, C],
36
46
  findActive: (e) => e.querySelector("[role=\"radio\"][aria-checked=\"true\"]")
37
- }), q = e.findIndex((e) => e.id === H), J = q >= 0 && !B(q) ? q : e.findIndex((e, t) => !B(t)), Y = (t) => {
38
- if (z) return;
39
- let n = f(e.length, q, c(t), B), r = n === void 0 ? void 0 : e[n];
40
- n !== void 0 && r && (t.preventDefault(), U(r.id), G.current?.querySelectorAll("[role=\"radio\"]")[n]?.focus());
41
- }, X = (e) => {
42
- e.currentTarget.contains(e.relatedTarget) || w?.(e);
47
+ }), $ = e.findIndex((e) => e.id === G), te = $ >= 0 && !U($) ? $ : e.findIndex((e, t) => !U(t)), ne = (t) => {
48
+ if (H) return;
49
+ let n = m(e.length, $, c(t), U), r = n === void 0 ? void 0 : e[n];
50
+ n !== void 0 && r && (t.preventDefault(), K(r.id), Z.current?.querySelectorAll("[role=\"radio\"]")[n]?.focus());
51
+ }, re = (e) => {
52
+ e.currentTarget.contains(e.relatedTarget) || D?.(e);
43
53
  };
44
- return R.wrap(/* @__PURE__ */ h("div", {
45
- ...I,
46
- ...V,
54
+ return V.wrap(/* @__PURE__ */ _("div", {
55
+ ...z,
56
+ ...W,
47
57
  ref: (e) => {
48
- G.current = e, t(F, e);
58
+ Z.current = e, J(e), t(R, e);
49
59
  },
50
- className: o("kapi-seg", M === "sm" && "kapi-seg--sm", z && "kapi-seg--readonly", S),
60
+ className: o("kapi-seg", F === "sm" && "kapi-seg--sm", H && "kapi-seg--readonly", T),
51
61
  role: "radiogroup",
52
- "aria-label": x,
53
- "aria-disabled": A || void 0,
54
- "aria-readonly": z || void 0,
55
- onKeyDown: Y,
56
- onBlur: X,
62
+ "aria-label": w,
63
+ "aria-disabled": N || void 0,
64
+ "aria-readonly": H || void 0,
65
+ onKeyDown: ne,
66
+ onBlur: re,
57
67
  children: [
58
- /* @__PURE__ */ m("span", {
59
- ref: K,
68
+ /* @__PURE__ */ g("span", {
69
+ ref: Q,
60
70
  className: "kapi-seg__indicator",
61
- "data-color": W ? g(W) : void 0,
71
+ "data-color": X ? y(X) : void 0,
62
72
  "aria-hidden": "true"
63
73
  }),
64
74
  e.map((e, t) => {
65
- let n = H === e.id, r = /* @__PURE__ */ h("button", {
75
+ let n = G === e.id, r = /* @__PURE__ */ _("button", {
66
76
  type: "button",
67
77
  role: "radio",
68
78
  "aria-checked": n,
69
- tabIndex: t === J ? 0 : -1,
70
- "aria-label": b === "icon" ? e.label : void 0,
79
+ tabIndex: t === te ? 0 : -1,
80
+ "aria-label": C === "icon" ? e.label : void 0,
71
81
  className: `kapi-seg__btn${n ? " is-on" : ""}`,
72
- "data-color": n ? g(e) : void 0,
82
+ "data-color": n ? y(e) : void 0,
73
83
  "data-tone": e.tone,
74
- disabled: B(t) || void 0,
84
+ disabled: U(t) || void 0,
75
85
  onClick: () => {
76
- z || U(e.id);
86
+ H || K(e.id);
77
87
  },
78
88
  children: [
79
- (b === "icon" || b === "both") && e.icon && /* @__PURE__ */ m("span", {
89
+ (C === "icon" || C === "both") && e.icon && /* @__PURE__ */ g("span", {
80
90
  className: "kapi-seg__ico",
81
91
  children: e.icon
82
92
  }),
83
- b !== "icon" && /* @__PURE__ */ m("span", { children: e.label }),
84
- e.count != null && /* @__PURE__ */ h(p, { children: [" ", /* @__PURE__ */ m("span", {
93
+ C !== "icon" && /* @__PURE__ */ g("span", { children: e.label }),
94
+ e.count != null && /* @__PURE__ */ _(h, { children: [" ", /* @__PURE__ */ g("span", {
85
95
  className: "kapi-seg__n",
86
- children: u(e.count, L)
96
+ children: f(e.count, B)
87
97
  })] })
88
98
  ]
89
99
  }, e.id);
90
- return b === "icon" && e.label ? /* @__PURE__ */ m(d, {
100
+ return C === "icon" && e.label ? /* @__PURE__ */ g(p, {
91
101
  label: e.label,
92
102
  prefer: "top",
93
103
  children: r
94
104
  }, e.id) : r;
95
105
  }),
96
- C && /* @__PURE__ */ m("input", {
106
+ E && /* @__PURE__ */ g("input", {
97
107
  type: "hidden",
98
- name: C,
99
- value: H === void 0 ? "" : String(H),
100
- disabled: A || void 0
108
+ name: E,
109
+ value: G === void 0 ? "" : String(G),
110
+ disabled: N || void 0
101
111
  })
102
112
  ]
103
113
  }));
104
114
  };
105
115
  //#endregion
106
- export { _ as KapiSegmented };
116
+ export { b as KapiSegmented };