@kapiuara/ui 0.14.0 → 0.15.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 (116) hide show
  1. package/README.md +234 -1
  2. package/dist/components/chat/KapiChatList.js +19 -19
  3. package/dist/components/chat/KapiChatThread.js +23 -23
  4. package/dist/components/chat/KapiComposer.js +19 -19
  5. package/dist/components/chat/KapiMessageBubble.js +4 -4
  6. package/dist/components/chat/KapiTypingIndicator.js +4 -4
  7. package/dist/components/closeReason.d.ts +34 -0
  8. package/dist/components/data/KapiBarChart.js +1 -1
  9. package/dist/components/data/KapiDataTable.js +31 -31
  10. package/dist/components/data/KapiEventCalendar.js +78 -78
  11. package/dist/components/data/KapiHeatmap.js +23 -23
  12. package/dist/components/data/KapiLineChart.js +1 -1
  13. package/dist/components/data/KapiPagination.js +4 -4
  14. package/dist/components/data/KapiSparkline.js +1 -1
  15. package/dist/components/data/KapiTable.js +122 -122
  16. package/dist/components/data/KapiTableFilter.js +18 -18
  17. package/dist/components/data/KapiTableRow.js +24 -24
  18. package/dist/components/data/KapiTableToolbar.js +49 -49
  19. package/dist/components/data/chartFrame.js +21 -21
  20. package/dist/components/data/useColumnResize.js +8 -8
  21. package/dist/components/data/useTableSelection.js +8 -8
  22. package/dist/components/display/KapiAnnotation.js +53 -53
  23. package/dist/components/display/KapiComment.js +4 -4
  24. package/dist/components/display/KapiCommentComposer.js +16 -16
  25. package/dist/components/display/KapiFileItem.js +6 -6
  26. package/dist/components/display/KapiFileViewer.js +9 -9
  27. package/dist/components/display/KapiTruncate.js +7 -7
  28. package/dist/components/feedback/KapiAlert.d.ts +2 -1
  29. package/dist/components/feedback/KapiAlert.js +8 -8
  30. package/dist/components/feedback/KapiCountdown.js +8 -8
  31. package/dist/components/feedback/KapiFab.js +31 -31
  32. package/dist/components/feedback/KapiOfflineBanner.js +8 -8
  33. package/dist/components/feedback/KapiToastContainer.js +21 -21
  34. package/dist/components/feedback/KapiTour.d.ts +2 -1
  35. package/dist/components/feedback/KapiTour.js +32 -32
  36. package/dist/components/inputs/KapiAutocomplete.js +14 -14
  37. package/dist/components/inputs/KapiButton.d.ts +17 -1
  38. package/dist/components/inputs/KapiButton.js +41 -25
  39. package/dist/components/inputs/KapiCalendar.js +5 -5
  40. package/dist/components/inputs/KapiCalendarGrid.js +10 -10
  41. package/dist/components/inputs/KapiChecklist.js +71 -71
  42. package/dist/components/inputs/KapiDatePicker.js +28 -28
  43. package/dist/components/inputs/KapiDateRangePicker.js +27 -27
  44. package/dist/components/inputs/KapiFacetedSearch.js +24 -24
  45. package/dist/components/inputs/KapiField.js +14 -14
  46. package/dist/components/inputs/KapiFileUpload.js +27 -27
  47. package/dist/components/inputs/KapiIconButton.d.ts +9 -1
  48. package/dist/components/inputs/KapiIconButton.js +27 -10
  49. package/dist/components/inputs/KapiInput.js +21 -21
  50. package/dist/components/inputs/KapiInputGroup.js +8 -8
  51. package/dist/components/inputs/KapiMaskedInput.js +22 -22
  52. package/dist/components/inputs/KapiNumberStepper.js +12 -12
  53. package/dist/components/inputs/KapiRating.js +1 -1
  54. package/dist/components/inputs/KapiSearchChip.js +8 -8
  55. package/dist/components/inputs/KapiSegmented.js +27 -27
  56. package/dist/components/inputs/KapiSelect.js +166 -166
  57. package/dist/components/inputs/KapiSelectMenu.js +60 -60
  58. package/dist/components/inputs/KapiSlider.js +1 -1
  59. package/dist/components/inputs/KapiSwitch.js +6 -6
  60. package/dist/components/inputs/KapiTagInput.js +22 -22
  61. package/dist/components/inputs/KapiTextarea.js +8 -8
  62. package/dist/components/inputs/ownField.js +4 -4
  63. package/dist/components/layout/KapiAccountMenu.d.ts +2 -1
  64. package/dist/components/layout/KapiAccountMenu.js +51 -51
  65. package/dist/components/layout/KapiContextSlot.js +35 -35
  66. package/dist/components/layout/KapiMasonry.js +6 -6
  67. package/dist/components/layout/KapiNotificationBell.js +60 -60
  68. package/dist/components/layout/KapiPageHeader.js +19 -19
  69. package/dist/components/layout/KapiRail.js +60 -60
  70. package/dist/components/layout/KapiRailAccount.js +9 -9
  71. package/dist/components/layout/KapiRoot.js +21 -21
  72. package/dist/components/layout/KapiScrollArea.js +11 -11
  73. package/dist/components/layout/KapiShell.js +12 -12
  74. package/dist/components/locale/KapiLocaleProvider.js +13 -13
  75. package/dist/components/navigation/KapiAccordion.js +12 -12
  76. package/dist/components/navigation/KapiBreadcrumb.js +11 -11
  77. package/dist/components/navigation/KapiCollapsiblePanel.js +23 -23
  78. package/dist/components/navigation/KapiContextPanel.js +76 -76
  79. package/dist/components/navigation/KapiFilterChips.js +9 -9
  80. package/dist/components/navigation/KapiNavBadge.d.ts +4 -2
  81. package/dist/components/navigation/KapiNavBadge.js +11 -10
  82. package/dist/components/navigation/KapiPanelGroup.js +25 -25
  83. package/dist/components/navigation/KapiSteps.js +4 -4
  84. package/dist/components/navigation/KapiTabs.d.ts +4 -1
  85. package/dist/components/navigation/KapiTabs.js +18 -17
  86. package/dist/components/navigation/KapiTree.js +72 -72
  87. package/dist/components/navigation/KapiWizard.d.ts +2 -1
  88. package/dist/components/navigation/KapiWizard.js +30 -30
  89. package/dist/components/overlays/KapiCanvasForm.d.ts +6 -2
  90. package/dist/components/overlays/KapiCanvasForm.js +12 -12
  91. package/dist/components/overlays/KapiCommandPalette.d.ts +2 -1
  92. package/dist/components/overlays/KapiCommandPalette.js +23 -23
  93. package/dist/components/overlays/KapiConfirm.d.ts +2 -1
  94. package/dist/components/overlays/KapiConfirm.js +12 -12
  95. package/dist/components/overlays/KapiContextMenu.d.ts +2 -1
  96. package/dist/components/overlays/KapiContextMenu.js +15 -15
  97. package/dist/components/overlays/KapiDialogHost.js +22 -22
  98. package/dist/components/overlays/KapiLoading.js +16 -16
  99. package/dist/components/overlays/KapiMenuButton.js +12 -12
  100. package/dist/components/overlays/KapiModal.d.ts +2 -1
  101. package/dist/components/overlays/KapiModal.js +28 -28
  102. package/dist/components/overlays/KapiOffcanvas.d.ts +3 -2
  103. package/dist/components/overlays/KapiOffcanvas.js +63 -63
  104. package/dist/components/overlays/KapiOffcanvasStack.js +38 -38
  105. package/dist/components/overlays/KapiPhotoView.js +14 -14
  106. package/dist/components/overlays/KapiPopover.d.ts +2 -1
  107. package/dist/components/overlays/KapiPopover.js +7 -7
  108. package/dist/components/overlays/KapiShapeSheet.js +17 -17
  109. package/dist/components/overlays/KapiSplitModal.js +29 -29
  110. package/dist/components/overlays/KapiTooltip.js +20 -20
  111. package/dist/components/overlays/menuList.js +60 -60
  112. package/dist/components/renderSlot.d.ts +27 -0
  113. package/dist/components/renderSlot.js +23 -0
  114. package/dist/hooks/portalRoot.js +6 -6
  115. package/dist/index.d.ts +2 -0
  116. package/package.json +1 -1
@@ -1,11 +1,12 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/inputs/KapiButton.css";
3
- import { buttonLookModifier as e, resolveButtonLook as t } from "../tone.js";
3
+ import { renderSlot as e } from "../renderSlot.js";
4
+ import { buttonLookModifier as t, resolveButtonLook as n } from "../tone.js";
4
5
  /* empty css */
5
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
6
+ import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
6
7
  //#region src/components/inputs/KapiButton.tsx
7
- var a = ({ tone: n, variant: r, size: i = "md", iconOnly: a = !1, bordered: o = !1, loading: s = !1, className: c = "" } = {}) => {
8
- let l = e(t(n, r));
8
+ var o = ({ tone: e, variant: r, size: i = "md", iconOnly: a = !1, bordered: o = !1, loading: s = !1, className: c = "" } = {}) => {
9
+ let l = t(n(e, r));
9
10
  return [
10
11
  "kapi-btn",
11
12
  l !== null && `kapi-btn--${l}`,
@@ -15,28 +16,43 @@ var a = ({ tone: n, variant: r, size: i = "md", iconOnly: a = !1, bordered: o =
15
16
  s && "is-loading",
16
17
  c
17
18
  ].filter(Boolean).join(" ");
18
- }, o = ({ tone: e, variant: t, size: o = "md", iconOnly: s = !1, bordered: c = !1, icon: l, loading: u = !1, disabled: d, className: f, type: p = "button", children: m, ref: h, ...g }) => /* @__PURE__ */ r("button", {
19
- ref: h,
20
- type: p,
21
- className: a({
22
- tone: e,
23
- variant: t,
24
- size: o,
25
- iconOnly: s,
26
- bordered: c,
27
- loading: u,
28
- className: f
29
- }),
30
- ...g,
31
- disabled: u || d,
32
- ...u ? { "aria-busy": !0 } : {},
33
- children: u ? /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("span", {
19
+ }, s = ({ tone: t, variant: n, size: s = "md", iconOnly: c = !1, bordered: l = !1, icon: u, loading: d = !1, disabled: f, className: p, type: m = "button", children: h, ref: g, render: _, ...v }) => {
20
+ let y = d || f, b = d ? /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ i("span", {
34
21
  className: "kapi-spinner kapi-btn__spinner",
35
22
  "aria-hidden": "true"
36
- }), /* @__PURE__ */ i("span", {
23
+ }), /* @__PURE__ */ a("span", {
37
24
  className: "kapi-btn__content",
38
- children: [l, m]
39
- })] }) : /* @__PURE__ */ i(n, { children: [l, m] })
40
- });
25
+ children: [u, h]
26
+ })] }) : /* @__PURE__ */ a(r, { children: [u, h] }), x = {
27
+ className: o({
28
+ tone: t,
29
+ variant: n,
30
+ size: s,
31
+ iconOnly: c,
32
+ bordered: l,
33
+ loading: d,
34
+ className: p
35
+ }),
36
+ ...v
37
+ };
38
+ return _ === void 0 ? /* @__PURE__ */ i("button", {
39
+ ref: g,
40
+ type: m,
41
+ ...x,
42
+ disabled: y,
43
+ ...d ? { "aria-busy": !0 } : {},
44
+ children: b
45
+ }) : e(_, x, {
46
+ "aria-disabled": y || void 0,
47
+ "aria-busy": d || void 0,
48
+ onClick: y ? (e) => e.preventDefault() : void 0,
49
+ ref: g,
50
+ children: b
51
+ }, (e) => /* @__PURE__ */ i("button", {
52
+ ...e,
53
+ type: m,
54
+ children: b
55
+ }));
56
+ };
41
57
  //#endregion
42
- export { o as KapiButton, a as buttonClasses };
58
+ export { s as KapiButton, o as buttonClasses };
@@ -1,21 +1,21 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/inputs/KapiDatePicker.css";
3
- import { useKapiLocale as e, useLabels as t } from "../locale/KapiLocaleProvider.js";
4
- import { joinClasses as n } from "../rootProps.js";
3
+ import { joinClasses as e } from "../rootProps.js";
4
+ import { useKapiLocale as t, useLabels as n } from "../locale/KapiLocaleProvider.js";
5
5
  import { useControllableState as r } from "../../hooks/useControllableState.js";
6
6
  import { localizedCalendarLabels as i, monthTitle as a, sameDay as o } from "./datePickerLogic.js";
7
7
  /* empty css */
8
8
  import { KapiCalendarGrid as s } from "./KapiCalendarGrid.js";
9
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
10
9
  import "react";
10
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
11
11
  import { ChevronLeft as u, ChevronRight as d } from "lucide-react";
12
12
  //#region src/components/inputs/KapiCalendar.tsx
13
13
  var f = ({ value: f, defaultValue: p = null, onChange: m, month: h, defaultMonth: g, onMonthChange: _, labels: v, weekStartsOn: y, className: b, ref: x, ...S }) => {
14
- let C = e(), w = t("calendar", i(C), v), [T, E] = r(f, p, m), [D, O] = r(h, () => g ?? T ?? /* @__PURE__ */ new Date(), _), k = (e) => O(new Date(D.getFullYear(), D.getMonth() + e, 1));
14
+ let C = t(), w = n("calendar", i(C), v), [T, E] = r(f, p, m), [D, O] = r(h, () => g ?? T ?? /* @__PURE__ */ new Date(), _), k = (e) => O(new Date(D.getFullYear(), D.getMonth() + e, 1));
15
15
  return /* @__PURE__ */ l("div", {
16
16
  ...S,
17
17
  ref: x,
18
- className: n("kapi-cal", "kapi-dp__cal", b),
18
+ className: e("kapi-cal", "kapi-dp__cal", b),
19
19
  children: [/* @__PURE__ */ l("div", {
20
20
  className: "kapi-dp__head",
21
21
  children: [
@@ -4,18 +4,18 @@ import { useKapiLocale as e, useKapiWeekStart as t } from "../locale/KapiLocaleP
4
4
  import { logicalKeyOf as n } from "../../hooks/directionLogic.js";
5
5
  import { buildDays as r, calendarDayLabel as i, calendarRows as a, monthTitle as o, moveCalendarFocus as s, sameDay as c, sameMonth as l, weekdayOrder as u } from "./datePickerLogic.js";
6
6
  /* empty css */
7
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
- import { useEffect as p, useRef as m, useState as h } from "react";
7
+ import { useEffect as d, useRef as f, useState as p } from "react";
8
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
9
9
  //#region src/components/inputs/KapiCalendarGrid.tsx
10
10
  var g = ({ view: g, onViewChange: _, labels: v, focusTarget: y, focusRequest: b = 0, isSelected: x, dayClassName: S, onPick: C, onDayHover: w, weekStartsOn: T }) => {
11
- let E = t(T), D = e(), O = /* @__PURE__ */ new Date(), k = m(null), [A, j] = h(null), M = m(!1), N = [
11
+ let E = t(T), D = e(), O = /* @__PURE__ */ new Date(), k = f(null), [A, j] = p(null), M = f(!1), N = [
12
12
  A,
13
13
  y,
14
14
  O
15
15
  ].find((e) => !!e && l(e, g)) ?? new Date(g.getFullYear(), g.getMonth(), 1);
16
- p(() => {
16
+ d(() => {
17
17
  b > 0 && (M.current = !0);
18
- }, [b]), p(() => {
18
+ }, [b]), d(() => {
19
19
  M.current && (M.current = !1, k.current?.querySelector("[role=\"gridcell\"][tabindex=\"0\"]")?.focus());
20
20
  });
21
21
  let P = (e) => {
@@ -25,26 +25,26 @@ var g = ({ view: g, onViewChange: _, labels: v, focusTarget: y, focusRequest: b
25
25
  }, E);
26
26
  t && (e.preventDefault(), j(t), l(t, g) || _(new Date(t.getFullYear(), t.getMonth(), 1)), M.current = !0);
27
27
  }, F = a(r(g.getFullYear(), g.getMonth(), E)), I = u(v.weekdays, E), L = u(v.weekdayNames, E);
28
- return /* @__PURE__ */ f("div", {
28
+ return /* @__PURE__ */ h("div", {
29
29
  ref: k,
30
30
  className: "kapi-dp__grid",
31
31
  role: "grid",
32
32
  "aria-label": o(g, v.months),
33
33
  onKeyDown: P,
34
34
  onMouseLeave: w ? () => w(null) : void 0,
35
- children: [/* @__PURE__ */ d("div", {
35
+ children: [/* @__PURE__ */ m("div", {
36
36
  role: "row",
37
37
  className: "kapi-dp__row",
38
- children: I.map((e, t) => /* @__PURE__ */ d("div", {
38
+ children: I.map((e, t) => /* @__PURE__ */ m("div", {
39
39
  role: "columnheader",
40
40
  className: "kapi-dp__wd",
41
41
  "aria-label": L[t],
42
42
  children: e
43
43
  }, t))
44
- }), F.map((e) => /* @__PURE__ */ d("div", {
44
+ }), F.map((e) => /* @__PURE__ */ m("div", {
45
45
  role: "row",
46
46
  className: "kapi-dp__row",
47
- children: e.map((e) => /* @__PURE__ */ d("button", {
47
+ children: e.map((e) => /* @__PURE__ */ m("button", {
48
48
  type: "button",
49
49
  role: "gridcell",
50
50
  tabIndex: c(e.date, N) ? 0 : -1,
@@ -1,37 +1,37 @@
1
1
  "use client";
2
2
  import "#kapi-css/components/inputs/KapiChecklist.css";
3
- import { fieldControlProps as e, resolveReadOnly as t } from "./fieldLogic.js";
4
- import { useOwnField as n } from "./ownField.js";
5
- import { useLabels as r } from "../locale/KapiLocaleProvider.js";
6
- import { KapiInput as i } from "./KapiInput.js";
7
- import { joinClasses as a } from "../rootProps.js";
8
- import { useRangeSelect as ee } from "../../hooks/useRangeSelect.js";
9
- import { navKeyOf as te, nextEnabledIndex as ne } from "../overlays/menuKeyboardLogic.js";
10
- import { checklistBulkState as re, filterChecklistItems as o, orderedChecklistValue as s, setChecklistItems as c } from "./checklistLogic.js";
3
+ import { joinClasses as e } from "../rootProps.js";
4
+ import { fieldControlProps as t, resolveReadOnly as n } from "./fieldLogic.js";
5
+ import { useOwnField as r } from "./ownField.js";
6
+ import { useLabels as i } from "../locale/KapiLocaleProvider.js";
7
+ import { KapiInput as ee } from "./KapiInput.js";
8
+ import { useRangeSelect as te } from "../../hooks/useRangeSelect.js";
9
+ import { navKeyOf as ne, nextEnabledIndex as a } from "../overlays/menuKeyboardLogic.js";
10
+ import { checklistBulkState as re, filterChecklistItems as o, orderedChecklistValue as s, setChecklistItems as ie } from "./checklistLogic.js";
11
11
  /* empty css */
12
- import { useControllableState as l } from "../../hooks/useControllableState.js";
13
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
14
- import { useEffect as ie, useId as ae, useMemo as f, useRef as p, useState as oe } from "react";
15
- import { Check as se, Search as m } from "lucide-react";
12
+ import { useControllableState as c } from "../../hooks/useControllableState.js";
13
+ import { useEffect as ae, useId as oe, useMemo as l, useRef as u, useState as se } from "react";
14
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
15
+ import { Check as ce, Search as p } from "lucide-react";
16
16
  //#region src/components/inputs/KapiChecklist.tsx
17
- var h = {
17
+ var m = {
18
18
  search: "Buscar en la lista",
19
19
  searchPlaceholder: "Buscar…",
20
20
  selectAll: "Marcar todo",
21
21
  clearAll: "Desmarcar todo",
22
22
  empty: "Sin coincidencias"
23
- }, g = 7;
24
- function _({ items: g, value: _, defaultValue: v, onChange: y, label: b, help: ce, fieldClassName: le, readOnly: x, invalid: S, required: C, searchable: ue, query: de, defaultQuery: fe, onQueryChange: pe, selectAll: me = !1, rangeSelect: w = !0, disabled: T = !1, labels: he, className: ge, "aria-label": E, ..._e }) {
25
- let D = r("checklist", h, he), O = n({
26
- help: ce,
27
- required: C,
28
- invalid: S,
29
- readOnly: x,
30
- fieldClassName: le
31
- }), k = O.field, A = t(x, k), j = ae(), M = `${j}-label`, N = p(null), P = p(null), [F, ve] = l(_, v ?? [], y), I = f(() => new Set(F), [F]), L = (e) => {
32
- A || ve(s(g, e));
33
- }, [R, z] = l(de, fe ?? "", pe), B = ue ?? g.length > 7, V = f(() => o(g, R), [g, R]), H = f(() => V.map((e) => e.id), [V]), U = f(() => T ? [] : V.flatMap((e, t) => e.disabled ? [] : [t]), [V, T]), W = (e) => !T && g.some((t) => t.id === e && !t.disabled), G = ee(), [K, q] = oe(null), J = K === null ? -1 : H.indexOf(K), Y = (e) => `${j}-opt-${g.findIndex((t) => t.id === e)}`;
34
- ie(() => {
23
+ }, h = 7;
24
+ function g({ items: h, value: g, defaultValue: le, onChange: _, label: v, help: ue, fieldClassName: de, readOnly: y, invalid: b, required: x, searchable: S, query: C, defaultQuery: w, onQueryChange: fe, selectAll: pe = !1, rangeSelect: T = !0, disabled: E = !1, labels: me, className: he, "aria-label": ge, ..._e }) {
25
+ let D = i("checklist", m, me), O = r({
26
+ help: ue,
27
+ required: x,
28
+ invalid: b,
29
+ readOnly: y,
30
+ fieldClassName: de
31
+ }), k = O.field, A = n(y, k), j = oe(), M = `${j}-label`, N = u(null), P = u(null), [F, ve] = c(g, le ?? [], _), I = l(() => new Set(F), [F]), L = (e) => {
32
+ A || ve(s(h, e));
33
+ }, [R, z] = c(C, w ?? "", fe), B = S ?? h.length > 7, V = l(() => o(h, R), [h, R]), H = l(() => V.map((e) => e.id), [V]), U = l(() => E ? [] : V.flatMap((e, t) => e.disabled ? [] : [t]), [V, E]), W = (e) => !E && h.some((t) => t.id === e && !t.disabled), G = te(), [K, q] = se(null), J = K === null ? -1 : H.indexOf(K), Y = (e) => `${j}-opt-${h.findIndex((t) => t.id === e)}`;
34
+ ae(() => {
35
35
  J < 0 || N.current?.querySelector(`[data-index="${J}"]`)?.scrollIntoView?.({ block: "nearest" });
36
36
  }, [J]);
37
37
  let X = (e, t) => {
@@ -39,20 +39,20 @@ function _({ items: g, value: _, defaultValue: v, onChange: y, label: b, help: c
39
39
  selected: I,
40
40
  ids: H,
41
41
  target: e,
42
- shift: w && t,
42
+ shift: T && t,
43
43
  isSelectable: W
44
44
  }));
45
45
  }, Z = re(V, I), Q = (e) => {
46
- T || L(c(g, I, H, e));
46
+ E || L(ie(h, I, H, e));
47
47
  }, ye = (e) => {
48
- if (T) return;
49
- let t = te(e.key, "vertical");
48
+ if (E) return;
49
+ let t = ne(e.key, "vertical");
50
50
  if (t) {
51
51
  e.preventDefault();
52
- let n = ne(J, t, U);
52
+ let n = a(J, t, U);
53
53
  if (n < 0) return;
54
54
  let r = t === "next" && n < J || t === "prev" && n > J;
55
- if (e.shiftKey && w && J >= 0) {
55
+ if (e.shiftKey && T && J >= 0) {
56
56
  if (r) return;
57
57
  let e = H[n];
58
58
  L(G.extend({
@@ -67,20 +67,20 @@ function _({ items: g, value: _, defaultValue: v, onChange: y, label: b, help: c
67
67
  } else e.key === " " || e.key === "Enter" ? (e.preventDefault(), K !== null && J >= 0 && X(K, e.shiftKey)) : (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "a" ? (e.preventDefault(), Q(Z !== "all")) : B && e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (e.preventDefault(), z(R + e.key), P.current?.focus());
68
68
  }, be = () => {
69
69
  J < 0 && U.length > 0 && q(H[U[0]]), N.current?.focus();
70
- }, xe = b == null ? { "aria-label": E } : { "aria-labelledby": M }, $ = e(k, {
71
- invalid: S,
72
- required: C
70
+ }, xe = v == null ? { "aria-label": ge } : { "aria-labelledby": M }, $ = t(k, {
71
+ invalid: b,
72
+ required: x
73
73
  });
74
- return O.wrap(/* @__PURE__ */ d("div", {
74
+ return O.wrap(/* @__PURE__ */ f("div", {
75
75
  ..._e,
76
- className: a("kapi-checklist", T && "is-disabled", A && "is-readonly", ge),
76
+ className: e("kapi-checklist", E && "is-disabled", A && "is-readonly", he),
77
77
  children: [
78
- b != null && /* @__PURE__ */ u("div", {
78
+ v != null && /* @__PURE__ */ d("div", {
79
79
  id: M,
80
80
  className: "kapi-checklist__label",
81
- children: b
81
+ children: v
82
82
  }),
83
- B && /* @__PURE__ */ u(i, {
83
+ B && /* @__PURE__ */ d(ee, {
84
84
  ref: P,
85
85
  type: "search",
86
86
  size: "sm",
@@ -88,30 +88,30 @@ function _({ items: g, value: _, defaultValue: v, onChange: y, label: b, help: c
88
88
  "aria-label": D.search,
89
89
  placeholder: D.searchPlaceholder,
90
90
  spellCheck: !1,
91
- startIcon: /* @__PURE__ */ u(m, {}),
91
+ startIcon: /* @__PURE__ */ d(p, {}),
92
92
  clearable: !0,
93
- disabled: T,
93
+ disabled: E,
94
94
  value: R,
95
95
  onChange: (e) => z(e.target.value),
96
96
  onKeyDown: (e) => {
97
97
  (e.key === "ArrowDown" || e.key === "Enter") && (e.preventDefault(), be());
98
98
  }
99
99
  }),
100
- me && /* @__PURE__ */ d("div", {
100
+ pe && /* @__PURE__ */ f("div", {
101
101
  className: "kapi-checklist__bulk",
102
- children: [/* @__PURE__ */ u("button", {
102
+ children: [/* @__PURE__ */ d("button", {
103
103
  type: "button",
104
- disabled: T || A || Z === "all",
104
+ disabled: E || A || Z === "all",
105
105
  onClick: () => Q(!0),
106
106
  children: D.selectAll
107
- }), /* @__PURE__ */ u("button", {
107
+ }), /* @__PURE__ */ d("button", {
108
108
  type: "button",
109
- disabled: T || A || Z === "none",
109
+ disabled: E || A || Z === "none",
110
110
  onClick: () => Q(!1),
111
111
  children: D.clearAll
112
112
  })]
113
113
  }),
114
- V.length > 0 ? /* @__PURE__ */ u("div", {
114
+ V.length > 0 ? /* @__PURE__ */ d("div", {
115
115
  ref: N,
116
116
  role: "listbox",
117
117
  "aria-multiselectable": "true",
@@ -119,57 +119,57 @@ function _({ items: g, value: _, defaultValue: v, onChange: y, label: b, help: c
119
119
  "aria-required": $["aria-required"],
120
120
  "aria-describedby": O.wraps ? $["aria-describedby"] : void 0,
121
121
  "aria-readonly": A || void 0,
122
- "aria-disabled": T || void 0,
122
+ "aria-disabled": E || void 0,
123
123
  "aria-activedescendant": J >= 0 && K !== null ? Y(K) : void 0,
124
- tabIndex: T ? -1 : 0,
124
+ tabIndex: E ? -1 : 0,
125
125
  className: "kapi-checklist__list",
126
126
  onKeyDown: ye,
127
127
  onFocus: (e) => {
128
128
  e.target === e.currentTarget && J < 0 && U.length > 0 && q(H[U[0]]);
129
129
  },
130
130
  ...xe,
131
- children: V.map((e, t) => {
132
- let n = I.has(e.id), r = T || e.disabled === !0;
133
- return /* @__PURE__ */ d("div", {
134
- id: Y(e.id),
135
- "data-index": t,
131
+ children: V.map((t, n) => {
132
+ let r = I.has(t.id), i = E || t.disabled === !0;
133
+ return /* @__PURE__ */ f("div", {
134
+ id: Y(t.id),
135
+ "data-index": n,
136
136
  role: "option",
137
- "aria-selected": n,
138
- "aria-disabled": r || void 0,
139
- "aria-label": typeof e.label == "string" ? void 0 : e.text,
140
- className: a("kapi-checklist__option", n && "is-on", t === J && "is-active", r && "is-disabled"),
137
+ "aria-selected": r,
138
+ "aria-disabled": i || void 0,
139
+ "aria-label": typeof t.label == "string" ? void 0 : t.text,
140
+ className: e("kapi-checklist__option", r && "is-on", n === J && "is-active", i && "is-disabled"),
141
141
  onMouseDown: (e) => {
142
142
  e.shiftKey && e.preventDefault();
143
143
  },
144
- onClick: (t) => {
145
- r || (q(e.id), X(e.id, t.shiftKey));
144
+ onClick: (e) => {
145
+ i || (q(t.id), X(t.id, e.shiftKey));
146
146
  },
147
- children: [/* @__PURE__ */ u("span", {
147
+ children: [/* @__PURE__ */ d("span", {
148
148
  className: "kapi-checklist__box",
149
149
  "aria-hidden": "true",
150
- children: n && /* @__PURE__ */ u(se, {
150
+ children: r && /* @__PURE__ */ d(ce, {
151
151
  size: 12,
152
152
  strokeWidth: 3
153
153
  })
154
- }), /* @__PURE__ */ d("span", {
154
+ }), /* @__PURE__ */ f("span", {
155
155
  className: "kapi-checklist__text",
156
- children: [/* @__PURE__ */ u("span", {
156
+ children: [/* @__PURE__ */ d("span", {
157
157
  className: "kapi-checklist__name",
158
- children: e.label
159
- }), e.description != null && /* @__PURE__ */ u("span", {
158
+ children: t.label
159
+ }), t.description != null && /* @__PURE__ */ d("span", {
160
160
  className: "kapi-checklist__desc",
161
- children: e.description
161
+ children: t.description
162
162
  })]
163
163
  })]
164
- }, e.id);
164
+ }, t.id);
165
165
  })
166
- }) : /* @__PURE__ */ u("div", {
166
+ }) : /* @__PURE__ */ d("div", {
167
167
  className: "kapi-checklist__empty",
168
168
  role: "status",
169
- children: g.length > 0 ? D.empty : null
169
+ children: h.length > 0 ? D.empty : null
170
170
  })
171
171
  ]
172
172
  }));
173
173
  }
174
174
  //#endregion
175
- export { g as CHECKLIST_SEARCH_THRESHOLD, h as DEFAULT_CHECKLIST_LABELS, _ as KapiChecklist };
175
+ export { h as CHECKLIST_SEARCH_THRESHOLD, m as DEFAULT_CHECKLIST_LABELS, g as KapiChecklist };
@@ -14,8 +14,8 @@ import { chipFieldSize as le, datePatternFor as ue, formDateValue as de, formatV
14
14
  import { KapiCalendarGrid as be } from "./KapiCalendarGrid.js";
15
15
  import { useCalendarFocus as xe } from "./useCalendarFocus.js";
16
16
  import { useDatePopSide as Se } from "./useDatePopSide.js";
17
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
18
- import { useId as Ce, useMemo as we, useRef as u, useState as d } from "react";
17
+ import { useId as Ce, useMemo as we, useRef as c, useState as l } from "react";
18
+ import { jsx as u, jsxs as d } from "react/jsx-runtime";
19
19
  import { Calendar as Te, ChevronLeft as Ee, ChevronRight as De, Clock as Oe } from "lucide-react";
20
20
  //#region src/components/inputs/KapiDatePicker.tsx
21
21
  var ke = (e, t) => e === "time" ? "hh:mm" : e === "datetime" ? `${t} hh:mm` : t, Ae = Array.from({ length: 24 }, (e, t) => t), f = ({ mode: f = "date", value: p, defaultValue: je, onChange: Me, placeholder: Ne, variant: Pe, icon: m, chipLabel: h, label: g, help: Fe, fieldClassName: _, readOnly: v, disabled: y = !1, id: b, name: x, className: Ie, style: Le, "aria-label": Re, labels: ze, minuteStep: Be = 1, invalid: S, required: C, ref: Ve, onBlur: He, weekStartsOn: Ue }) => {
@@ -36,7 +36,7 @@ var ke = (e, t) => e === "time" ? "hh:mm" : e === "datetime" ? `${t} hh:mm` : t,
36
36
  invalid: S,
37
37
  readOnly: v,
38
38
  fieldClassName: _
39
- }), M = j.field, N = r(v, M), P = Ne ?? ke(f, E.placeholder), Ge = Ce(), F = b ?? M?.controlId ?? (k ? Ge : void 0), [I, L] = d(!1), Ke = p !== void 0, [R, qe, , Je] = ie(p === void 0 ? void 0 : s(p), s(je ?? null), Me), [z, B] = d(() => i(R, f, E)), [V, H] = d(() => R ?? /* @__PURE__ */ new Date()), U = u(null), Ye = se(U, oe(Je)), W = u(null), G = u(null), { inputRef: Xe, focusRequest: Ze, openFromKeyboard: K, openFromFocus: Qe, returnFocus: q } = xe(L), J = R ? R.getTime() : null, [$e, et] = d(J), [tt, Y] = d(f), [nt, rt] = d(E);
39
+ }), M = j.field, N = r(v, M), P = Ne ?? ke(f, E.placeholder), Ge = Ce(), F = b ?? M?.controlId ?? (k ? Ge : void 0), [I, L] = l(!1), Ke = p !== void 0, [R, qe, , Je] = ie(p === void 0 ? void 0 : s(p), s(je ?? null), Me), [z, B] = l(() => i(R, f, E)), [V, H] = l(() => R ?? /* @__PURE__ */ new Date()), U = c(null), Ye = se(U, oe(Je)), W = c(null), G = c(null), { inputRef: Xe, focusRequest: Ze, openFromKeyboard: K, openFromFocus: Qe, returnFocus: q } = xe(L), J = R ? R.getTime() : null, [$e, et] = l(J), [tt, Y] = l(f), [nt, rt] = l(E);
40
40
  ($e !== J || tt !== f || nt !== E) && (et(J), Y(f), rt(E), B(i(R, f, E)), R && H(R)), ce(I, [U], () => {
41
41
  let e = ae(U.current);
42
42
  e && G.current?.contains(e) && e.blur(), L(!1);
@@ -57,7 +57,7 @@ var ke = (e, t) => e === "time" ? "hh:mm" : e === "datetime" ? `${t} hh:mm` : t,
57
57
  let n = new Date(R ?? /* @__PURE__ */ new Date());
58
58
  e != null && n.setHours(e), t != null && n.setMinutes(t), X(n);
59
59
  }, $ = (e) => H(new Date(V.getFullYear(), V.getMonth() + e, 1)), at = Se(I && !y && !N, W, G);
60
- return j.wrap(/* @__PURE__ */ l("div", {
60
+ return j.wrap(/* @__PURE__ */ d("div", {
61
61
  className: [
62
62
  "kapi-dp",
63
63
  k && "kapi-dp--chip",
@@ -70,17 +70,17 @@ var ke = (e, t) => e === "time" ? "hh:mm" : e === "datetime" ? `${t} hh:mm` : t,
70
70
  n(e.relatedTarget, e.currentTarget) && He?.(e);
71
71
  },
72
72
  children: [
73
- /* @__PURE__ */ l("div", {
73
+ /* @__PURE__ */ d("div", {
74
74
  className: ["kapi-dp__field", k && "kapi-filterchip"].filter(Boolean).join(" "),
75
75
  ref: W,
76
76
  children: [
77
77
  k && m,
78
- A && /* @__PURE__ */ l("label", {
78
+ A && /* @__PURE__ */ d("label", {
79
79
  className: "kapi-dp__label",
80
80
  htmlFor: F,
81
81
  children: [A, ":"]
82
82
  }),
83
- /* @__PURE__ */ c("input", {
83
+ /* @__PURE__ */ u("input", {
84
84
  ref: (t) => {
85
85
  Xe.current = t, e(Ve, t);
86
86
  },
@@ -105,59 +105,59 @@ var ke = (e, t) => e === "time" ? "hh:mm" : e === "datetime" ? `${t} hh:mm` : t,
105
105
  e.key === "Escape" && I && (e.preventDefault(), e.stopPropagation(), L(!1)), e.key === "ArrowDown" && D && !N && (e.preventDefault(), K());
106
106
  }
107
107
  }),
108
- /* @__PURE__ */ c("button", {
108
+ /* @__PURE__ */ u("button", {
109
109
  type: "button",
110
110
  className: "kapi-dp__toggle",
111
111
  disabled: y || N,
112
112
  "aria-label": T.openPicker,
113
113
  "aria-expanded": I,
114
114
  onClick: () => I ? L(!1) : K(),
115
- children: c(D ? Te : Oe, {
115
+ children: u(D ? Te : Oe, {
116
116
  size: 16,
117
117
  strokeWidth: 1.9
118
118
  })
119
119
  })
120
120
  ]
121
121
  }),
122
- x && /* @__PURE__ */ c("input", {
122
+ x && /* @__PURE__ */ u("input", {
123
123
  type: "hidden",
124
124
  name: x,
125
125
  value: de(R, f),
126
126
  disabled: y
127
127
  }),
128
- I && !y && !N && /* @__PURE__ */ l("div", {
128
+ I && !y && !N && /* @__PURE__ */ d("div", {
129
129
  ref: G,
130
130
  className: `kapi-dp__pop${at === "top" ? " kapi-dp__pop--up" : ""}`,
131
131
  onKeyDown: (e) => {
132
132
  e.key === "Escape" && (e.preventDefault(), q());
133
133
  },
134
- children: [D && /* @__PURE__ */ l("div", {
134
+ children: [D && /* @__PURE__ */ d("div", {
135
135
  className: "kapi-dp__cal",
136
136
  children: [
137
- /* @__PURE__ */ l("div", {
137
+ /* @__PURE__ */ d("div", {
138
138
  className: "kapi-dp__head",
139
139
  children: [
140
- /* @__PURE__ */ c("button", {
140
+ /* @__PURE__ */ u("button", {
141
141
  type: "button",
142
142
  className: "kapi-dp__nav",
143
143
  "aria-label": T.prevMonth,
144
144
  onClick: () => $(-1),
145
- children: /* @__PURE__ */ c(Ee, {
145
+ children: /* @__PURE__ */ u(Ee, {
146
146
  className: "kapi-flip-rtl",
147
147
  size: 15,
148
148
  strokeWidth: 2.2
149
149
  })
150
150
  }),
151
- /* @__PURE__ */ c("span", {
151
+ /* @__PURE__ */ u("span", {
152
152
  className: "kapi-dp__title",
153
153
  children: _e(V, T.months)
154
154
  }),
155
- /* @__PURE__ */ c("button", {
155
+ /* @__PURE__ */ u("button", {
156
156
  type: "button",
157
157
  className: "kapi-dp__nav",
158
158
  "aria-label": T.nextMonth,
159
159
  onClick: () => $(1),
160
- children: /* @__PURE__ */ c(De, {
160
+ children: /* @__PURE__ */ u(De, {
161
161
  className: "kapi-flip-rtl",
162
162
  size: 15,
163
163
  strokeWidth: 2.2
@@ -165,7 +165,7 @@ var ke = (e, t) => e === "time" ? "hh:mm" : e === "datetime" ? `${t} hh:mm` : t,
165
165
  })
166
166
  ]
167
167
  }),
168
- /* @__PURE__ */ c(be, {
168
+ /* @__PURE__ */ u(be, {
169
169
  weekStartsOn: Ue,
170
170
  view: V,
171
171
  onViewChange: H,
@@ -176,16 +176,16 @@ var ke = (e, t) => e === "time" ? "hh:mm" : e === "datetime" ? `${t} hh:mm` : t,
176
176
  dayClassName: (e) => o(e, R) && "kapi-dp__day--sel",
177
177
  onPick: Z
178
178
  }),
179
- /* @__PURE__ */ l("div", {
179
+ /* @__PURE__ */ d("div", {
180
180
  className: "kapi-dp__foot",
181
- children: [/* @__PURE__ */ c("button", {
181
+ children: [/* @__PURE__ */ u("button", {
182
182
  type: "button",
183
183
  className: "kapi-dp__link",
184
184
  onClick: () => {
185
185
  X(null), L(!1);
186
186
  },
187
187
  children: T.clear
188
- }), /* @__PURE__ */ c("button", {
188
+ }), /* @__PURE__ */ u("button", {
189
189
  type: "button",
190
190
  className: "kapi-dp__link",
191
191
  onClick: () => {
@@ -196,21 +196,21 @@ var ke = (e, t) => e === "time" ? "hh:mm" : e === "datetime" ? `${t} hh:mm` : t,
196
196
  })]
197
197
  })
198
198
  ]
199
- }), O && /* @__PURE__ */ c("div", {
199
+ }), O && /* @__PURE__ */ u("div", {
200
200
  className: "kapi-dp__time",
201
- children: /* @__PURE__ */ l("div", {
201
+ children: /* @__PURE__ */ d("div", {
202
202
  className: "kapi-dp__time-cols",
203
- children: [/* @__PURE__ */ c("div", {
203
+ children: [/* @__PURE__ */ u("div", {
204
204
  className: "kapi-dp__time-col",
205
- children: Ae.map((e) => /* @__PURE__ */ c("button", {
205
+ children: Ae.map((e) => /* @__PURE__ */ u("button", {
206
206
  type: "button",
207
207
  className: `kapi-dp__time-opt${R?.getHours() === e ? " kapi-dp__time-opt--sel" : ""}`,
208
208
  onClick: () => Q(e, null),
209
209
  children: a(e)
210
210
  }, e))
211
- }), /* @__PURE__ */ c("div", {
211
+ }), /* @__PURE__ */ u("div", {
212
212
  className: "kapi-dp__time-col",
213
- children: ge(Be, R?.getMinutes()).map((e) => /* @__PURE__ */ c("button", {
213
+ children: ge(Be, R?.getMinutes()).map((e) => /* @__PURE__ */ u("button", {
214
214
  type: "button",
215
215
  className: `kapi-dp__time-opt${R?.getMinutes() === e ? " kapi-dp__time-opt--sel" : ""}`,
216
216
  onClick: () => Q(null, e),