@caspeco/casper-ui-library 7.7.2 → 7.7.4

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.
@@ -10,9 +10,5 @@ export type CheckboxProps = CustomChakraBoxProps & LayoutProps & MarginProps & P
10
10
  variant?: "addon";
11
11
  isIndeterminate?: false;
12
12
  size: "lg";
13
- } | {
14
- variant?: "normal";
15
- isIndeterminate: true;
16
- size?: "sm" | "md";
17
13
  });
18
14
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/checkbox/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACxG,OAAO,KAAK,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE7E,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9C,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEjD,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAC/C,WAAW,GACX,WAAW,GACX,YAAY,GACZ,UAAU,GACV,IAAI,CACH,mBAAmB,EACnB,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,WAAW,GAAG,iBAAiB,GAAG,OAAO,GAAG,UAAU,CAChG,GACD,CACG;IAAE,OAAO,CAAC,EAAE,QAAQ,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAA;CAAE,GACtE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GAC1D;IAAE,OAAO,CAAC,EAAE,QAAQ,CAAC;IAAC,eAAe,EAAE,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CAAE,CACnE,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/checkbox/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACxG,OAAO,KAAK,EAAE,aAAa,IAAI,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE7E,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC9C,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEjD,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAC/C,WAAW,GACX,WAAW,GACX,YAAY,GACZ,UAAU,GACV,IAAI,CACH,mBAAmB,EACnB,UAAU,GAAG,YAAY,GAAG,WAAW,GAAG,WAAW,GAAG,iBAAiB,GAAG,OAAO,GAAG,UAAU,CAChG,GACD,CACG;IAAE,OAAO,CAAC,EAAE,QAAQ,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAA;CAAE,GACtE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,CAC5D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"combobox-button.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox-button.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAsBlD,wBAAgB,cAAc,CAAC,EAC9B,EAAE,EACF,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,IAAI,EACJ,OAAO,EACP,KAAK,EACL,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,cAAc,GACd,EAAE,kBAAkB,2CAsLpB"}
1
+ {"version":3,"file":"combobox-button.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox-button.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAsBlD,wBAAgB,cAAc,CAAC,EAC9B,EAAE,EACF,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,IAAI,EACJ,OAAO,EACP,KAAK,EACL,eAAe,EACf,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,QAAQ,EACR,cAAc,GACd,EAAE,kBAAkB,2CAsMpB"}
@@ -1,14 +1,14 @@
1
- import { jsxs as p, jsx as i } from "react/jsx-runtime";
2
- import { useStyleConfig as N, Flex as c, Box as d, Input as X } from "@chakra-ui/react";
3
- import { Fragment as $ } from "react";
1
+ import { jsxs as f, jsx as i } from "react/jsx-runtime";
2
+ import { useStyleConfig as L, Flex as c, Box as u, Input as N } from "@chakra-ui/react";
3
+ import { Fragment as X } from "react";
4
4
  import { ComboboxItem as _ } from "./combobox-item.js";
5
- import { Tag as v } from "../tag/tag.js";
5
+ import { Tag as $ } from "../tag/tag.js";
6
6
  import { Icon as K } from "../icon/icon.js";
7
7
  import { Icons as T } from "../icon/types.js";
8
- import { ThemeColorVariable as r, ThemeSpaceVariable as u, ThemeRadiusVariable as U, ThemeIconSizeVariable as q } from "../../theme/theme-types.js";
8
+ import { ThemeColorVariable as r, ThemeSpaceVariable as d, ThemeRadiusVariable as U, ThemeIconSizeVariable as q } from "../../theme/theme-types.js";
9
9
  function E() {
10
10
  return /* @__PURE__ */ i(
11
- d,
11
+ u,
12
12
  {
13
13
  backgroundColor: r.NeutralContainer,
14
14
  width: "8px",
@@ -26,7 +26,7 @@ function E() {
26
26
  }
27
27
  );
28
28
  }
29
- function P({
29
+ function I({
30
30
  id: j,
31
31
  asPlainText: e,
32
32
  inputValue: b,
@@ -39,38 +39,38 @@ function P({
39
39
  size: V,
40
40
  variant: W,
41
41
  label: S,
42
- placeHolderText: z,
42
+ placeHolderText: v,
43
43
  isDisabled: h,
44
44
  isReadOnly: m,
45
- isInvalid: w,
46
- collapsed: k,
47
- hasPendingDelete: g,
48
- setHasPendingDelete: t,
49
- setInputValue: s,
45
+ isInvalid: t,
46
+ collapsed: s,
47
+ hasPendingDelete: w,
48
+ setHasPendingDelete: g,
49
+ setInputValue: k,
50
50
  onSearch: O,
51
- isSingleSelect: A
51
+ isSingleSelect: z
52
52
  }) {
53
- const D = N("Combobox", { size: V, variant: W }), F = (o) => {
53
+ const A = L("Combobox", { size: V, variant: W }), D = (o) => {
54
54
  if (o.key === "Enter" && (o.preventDefault(), o.stopPropagation(), a.isOpen ? C(B[l.index]) : a.open()), o.key === "Escape") {
55
55
  if (!a.isOpen) return;
56
- o.preventDefault(), o.stopPropagation(), a.close(), e || (s(""), O?.(""));
56
+ o.preventDefault(), o.stopPropagation(), a.close(), e || (k(""), O?.(""));
57
57
  }
58
- o.key === "Backspace" ? b.length === 0 && n.length > 0 && !e && (g ? (C(n[n.length - 1]), t(!1)) : t(!0)) : t(!1), o.key === "ArrowDown" && (a.isOpen ? l.next() : a.open()), o.key === "ArrowUp" && (a.isOpen ? l.previous() : a.open());
59
- }, L = (o) => {
58
+ o.key === "Backspace" ? b.length === 0 && n.length > 0 && !e && (w ? (C(n[n.length - 1]), g(!1)) : g(!0)) : g(!1), o.key === "ArrowDown" && (a.isOpen ? l.next() : a.open()), o.key === "ArrowUp" && (a.isOpen ? l.previous() : a.open());
59
+ }, F = (o) => {
60
60
  o.preventDefault(), o.stopPropagation();
61
- const f = o.target.value;
62
- s(f), O?.(f), l.set(0), a.open();
61
+ const p = o.target.value;
62
+ k(p), O?.(p), l.set(0), a.open();
63
63
  }, x = n[0], y = n[n.length - 1];
64
- return /* @__PURE__ */ p(
64
+ return /* @__PURE__ */ f(
65
65
  c,
66
66
  {
67
- __css: D,
67
+ __css: A,
68
68
  "aria-disabled": h,
69
69
  "aria-readonly": m,
70
- "aria-invalid": w,
70
+ "aria-invalid": t,
71
71
  borderRadius: U.Small,
72
- padding: u.Small,
73
- _focusWithin: w ? {
72
+ padding: d.Small,
73
+ _focusWithin: t ? {
74
74
  borderColor: r.Error,
75
75
  boxShadow: `0 0 0 4px ${r.ErrorContainer}`,
76
76
  backgroundColor: r.Surface
@@ -84,18 +84,18 @@ function P({
84
84
  backgroundColor: r.SurfaceDisabled
85
85
  },
86
86
  children: [
87
- /* @__PURE__ */ p(
87
+ /* @__PURE__ */ f(
88
88
  c,
89
89
  {
90
- flexWrap: k || A ? "nowrap" : "wrap",
91
- gap: u.Small,
90
+ flexWrap: s || z ? "nowrap" : "wrap",
91
+ gap: d.Small,
92
92
  overflow: "hidden",
93
93
  children: [
94
- S && /* @__PURE__ */ i(d, { whiteSpace: "nowrap", children: S }),
95
- !e && (k ? n.length > 0 && y && /* @__PURE__ */ p(
94
+ S && /* @__PURE__ */ i(u, { whiteSpace: "nowrap", children: S }),
95
+ !e && (s ? n.length > 0 && y && /* @__PURE__ */ f(
96
96
  c,
97
97
  {
98
- gap: u.XSmall,
98
+ gap: d.XSmall,
99
99
  flexShrink: "1",
100
100
  overflow: "hidden",
101
101
  whiteSpace: "nowrap",
@@ -103,29 +103,29 @@ function P({
103
103
  children: [
104
104
  n.length > 3 && /* @__PURE__ */ i(E, {}),
105
105
  n.length > 2 && /* @__PURE__ */ i(E, {}),
106
- n.length > 1 && /* @__PURE__ */ i(v, { children: n.length - 1 }),
106
+ n.length > 1 && /* @__PURE__ */ i($, { children: n.length - 1 }),
107
107
  /* @__PURE__ */ i(
108
108
  _,
109
109
  {
110
- isDeleting: g,
110
+ isDeleting: w,
111
111
  item: y,
112
112
  asPlainText: e
113
113
  }
114
114
  )
115
115
  ]
116
116
  }
117
- ) : n.map((o, f) => /* @__PURE__ */ i(
117
+ ) : n.map((o, p) => /* @__PURE__ */ i(
118
118
  _,
119
119
  {
120
120
  item: o,
121
121
  asPlainText: e,
122
- isDeleting: f === n.length - 1 && g
122
+ isDeleting: p === n.length - 1 && w
123
123
  },
124
124
  o.id
125
125
  ))),
126
- e && n.length > 0 && x && b === x.label && R[x.id]?.map((o) => /* @__PURE__ */ p($, { children: [
126
+ e && n.length > 0 && x && b === x.label && R[x.id]?.map((o) => /* @__PURE__ */ f(X, { children: [
127
127
  /* @__PURE__ */ i(
128
- d,
128
+ u,
129
129
  {
130
130
  color: r.OnSurfaceSubdued,
131
131
  textOverflow: "ellipsis",
@@ -134,22 +134,22 @@ function P({
134
134
  children: o
135
135
  }
136
136
  ),
137
- /* @__PURE__ */ i(d, { color: r.OnSurfaceSubdued, children: "/" })
137
+ /* @__PURE__ */ i(u, { color: r.OnSurfaceSubdued, children: "/" })
138
138
  ] }, o)),
139
139
  /* @__PURE__ */ i(
140
- X,
140
+ N,
141
141
  {
142
142
  id: j,
143
143
  isDisabled: h,
144
144
  isReadOnly: m,
145
- isInvalid: w,
146
- onKeyDown: F,
145
+ isInvalid: t,
146
+ onKeyDown: D,
147
147
  variant: "unstyled",
148
148
  value: b,
149
149
  autoComplete: "off",
150
- minWidth: u.XLarge,
151
- onChange: L,
152
- placeholder: z,
150
+ minWidth: d.XLarge,
151
+ onChange: F,
152
+ placeholder: v,
153
153
  border: "none",
154
154
  flex: 1,
155
155
  color: r.OnSurface,
@@ -160,6 +160,17 @@ function P({
160
160
  _disabled: {
161
161
  cursor: "not-allowed",
162
162
  color: r.OnSurfaceSubdued
163
+ },
164
+ sx: a.isOpen ? {} : {
165
+ position: "absolute",
166
+ width: "1px",
167
+ height: "1px",
168
+ padding: 0,
169
+ margin: "-1px",
170
+ overflow: "hidden",
171
+ clipPath: "inset(50%)",
172
+ whiteSpace: "nowrap",
173
+ border: 0
163
174
  }
164
175
  }
165
176
  )
@@ -179,5 +190,5 @@ function P({
179
190
  );
180
191
  }
181
192
  export {
182
- P as ComboboxButton
193
+ I as ComboboxButton
183
194
  };
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAIX,aAAa,EAKb,MAAM,SAAS,CAAC;AAiGjB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACxB,EAAE,EACF,KAAU,EACV,cAAsB,EACtB,aAAkB,EAClB,MAAgB,EAChB,IAAW,EACX,OAAmB,EACnB,WAAmB,EACnB,QAAQ,EACR,KAAK,EACL,eAAe,EACf,QAAQ,EACR,MAAM,EACN,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,SAAiB,EACjB,GAAG,KAAK,EACR,EAAE,aAAa,2CA+Lf"}
1
+ {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../lib/components/combobox/combobox.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAIX,aAAa,EAKb,MAAM,SAAS,CAAC;AAqGjB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACxB,EAAE,EACF,KAAU,EACV,cAAsB,EACtB,aAAkB,EAClB,MAAgB,EAChB,IAAW,EACX,OAAmB,EACnB,WAAmB,EACnB,QAAQ,EACR,KAAK,EACL,eAAe,EACf,QAAQ,EACR,MAAM,EACN,UAAU,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,SAAS,EACT,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,SAAiB,EACjB,GAAG,KAAK,EACR,EAAE,aAAa,2CAgMf"}
@@ -1,69 +1,69 @@
1
1
  import { jsxs as ee, jsx as V } from "react/jsx-runtime";
2
2
  import { Box as ne } from "@chakra-ui/react";
3
- import { useState as p, useRef as _, useEffect as q, useMemo as U } from "react";
3
+ import { useState as g, useRef as _, useEffect as q, useMemo as U } from "react";
4
4
  import { ComboboxButton as te } from "./combobox-button.js";
5
5
  import { ComboboxMenu as re } from "./combobox-menu.js";
6
6
  import { translations as oe } from "./translations.js";
7
- const le = (o, c) => {
8
- const [n, e] = p(0), i = (l) => {
9
- if (!c.current) return;
10
- const b = [...c.current.querySelectorAll("li")];
11
- b[l] && (b[l]?.scrollIntoView({
7
+ const le = (r, i) => {
8
+ const [n, e] = g(0), c = (l) => {
9
+ if (!i.current) return;
10
+ const f = [...i.current.querySelectorAll("li")];
11
+ f[l] && (f[l]?.scrollIntoView({
12
12
  behavior: "smooth",
13
13
  block: "nearest"
14
14
  }), e(l));
15
15
  };
16
16
  return {
17
17
  index: n,
18
- set: i,
19
- next: () => i((n + 1) % o.length),
20
- previous: () => i((n - 1 + o.length) % o.length)
18
+ set: c,
19
+ next: () => c((n + 1) % r.length),
20
+ previous: () => c((n - 1 + r.length) % r.length)
21
21
  };
22
- }, se = (o, c, n, e) => {
23
- const [i, r] = p(!1);
22
+ }, se = (r, i, n, e, c) => {
23
+ const [o, a] = g(!1);
24
24
  return q(() => {
25
- e && r(!1);
26
- }, [e, r]), { isOpen: i, close: () => {
27
- c || n(""), r(!1);
25
+ e && a(!1);
26
+ }, [e, a]), { isOpen: o, close: () => {
27
+ i || (n(""), c?.("")), a(!1);
28
28
  }, open: () => {
29
- i || e || (r(!0), o.set(0));
29
+ o || e || (a(!0), r.set(0));
30
30
  } };
31
- }, ie = (o, c) => {
32
- const [n, e] = p([]), i = U(() => {
33
- if (!n.length) return o;
34
- const r = n[n.length - 1], h = {
31
+ }, ie = (r, i) => {
32
+ const [n, e] = g([]), c = U(() => {
33
+ if (!n.length) return r;
34
+ const o = n[n.length - 1], a = {
35
35
  id: "_back",
36
- label: c.back
36
+ label: i.back
37
37
  }, l = n[n.length - 1]?.children || [];
38
- return r?.isSelectableParent ? [h, r, ...l] : [h, ...l];
39
- }, [n, o, c]);
38
+ return o?.isSelectableParent ? [a, o, ...l] : [a, ...l];
39
+ }, [n, r, i]);
40
40
  return {
41
- open: (r) => {
42
- e((h) => [...h, r]);
41
+ open: (o) => {
42
+ e((a) => [...a, o]);
43
43
  },
44
44
  back: () => {
45
- n.length && e((r) => [...r.slice(0, n.length - 1)]);
45
+ n.length && e((o) => [...o.slice(0, n.length - 1)]);
46
46
  },
47
47
  opened: n,
48
- current: i
48
+ current: c
49
49
  };
50
- }, ce = (o) => U(() => {
51
- const c = {};
52
- function n(e, i) {
53
- c[e.id] = [...i], e.children && e.children.forEach((r) => n(r, [...i, e.label]));
50
+ }, ce = (r) => U(() => {
51
+ const i = {};
52
+ function n(e, c) {
53
+ i[e.id] = [...c], e.children && e.children.forEach((o) => n(o, [...c, e.label]));
54
54
  }
55
- return o.forEach((e) => n(e, [])), c;
56
- }, [o]);
55
+ return r.forEach((e) => n(e, [])), i;
56
+ }, [r]);
57
57
  function be({
58
- id: o,
59
- label: c = "",
58
+ id: r,
59
+ label: i = "",
60
60
  isSingleSelect: n = !1,
61
61
  selectedItems: e = [],
62
- locale: i = "en-US",
63
- size: r = "md",
64
- variant: h = "outline",
62
+ locale: c = "en-US",
63
+ size: o = "md",
64
+ variant: a = "outline",
65
65
  asPlainText: l = !1,
66
- onSearch: b,
66
+ onSearch: f,
67
67
  items: I,
68
68
  maxVisibleItems: M,
69
69
  onChange: L,
@@ -79,60 +79,60 @@ function be({
79
79
  collapsed: K = !1,
80
80
  ...Q
81
81
  }) {
82
- const [H, g] = p(""), [X, j] = p(!1), k = oe[i], w = _(null), O = _(null), f = ie(I, k), Y = H.toLowerCase() === e[0]?.label.toLowerCase(), v = H.length > 0 && !(l && Y);
83
- let u = f.current;
82
+ const [H, b] = g(""), [X, j] = g(!1), k = oe[c], w = _(null), O = _(null), d = ie(I, k), Y = H.toLowerCase() === e[0]?.label.toLowerCase(), v = H.length > 0 && !(l && Y);
83
+ let h = d.current;
84
84
  if (v) {
85
- const t = [], d = (s) => {
86
- t.push(s), s.children && s.children.forEach(d);
85
+ const t = [], p = (s) => {
86
+ t.push(s), s.children && s.children.forEach(p);
87
87
  };
88
- I.forEach(d), u = t.filter((s) => {
88
+ I.forEach(p), h = t.filter((s) => {
89
89
  const F = s.label.toLowerCase().includes(H.toLowerCase());
90
90
  return (!(s.children && s.children.length > 0) || s.isSelectableParent) && F;
91
91
  });
92
92
  }
93
- const E = le(u, O), a = se(E, l, g, S);
93
+ const E = le(h, O), u = se(E, l, b, S, f);
94
94
  q(() => {
95
- l && !a.isOpen && g(e[0]?.label || "");
96
- }, [a.isOpen, e, l]);
97
- const [P, Z] = p([]);
95
+ l && !u.isOpen && b(e[0]?.label || "");
96
+ }, [u.isOpen, e, l]);
97
+ const [P, Z] = g([]);
98
98
  q(() => {
99
- !a.isOpen || n || Z(e);
100
- }, [a.isOpen]), v || (u = [
99
+ !u.isOpen || n || Z(e);
100
+ }, [u.isOpen]), v || (h = [
101
101
  ...P,
102
- ...u.filter((t) => !P.find((d) => d.label === t.label))
102
+ ...h.filter((t) => !P.find((p) => p.label === t.label))
103
103
  ]);
104
104
  let y = !1;
105
- x ? u = e : (y = u.length > (M ?? 1 / 0), u = u.slice(0, M));
105
+ x ? h = e : (y = h.length > (M ?? 1 / 0), h = h.slice(0, M));
106
106
  const $ = ce(I), R = (t) => {
107
107
  if (!t || x || S)
108
108
  return;
109
109
  if (O.current?.parentNode?.querySelector("input")?.focus(), t.id === "_back") {
110
- f.back();
110
+ d.back();
111
111
  return;
112
112
  }
113
- const d = f.opened.length > 0 && f.opened[f.opened.length - 1]?.id === t.id;
114
- if (!v && !d && t.children && t.children.length > 0) {
115
- f.open(t), requestAnimationFrame(() => E.set(1));
113
+ const p = d.opened.length > 0 && d.opened[d.opened.length - 1]?.id === t.id;
114
+ if (!v && !p && t.children && t.children.length > 0) {
115
+ d.open(t), requestAnimationFrame(() => E.set(1));
116
116
  return;
117
117
  }
118
118
  let s = [t];
119
- n || (e.some((C) => C.id === t.id) ? s = e.filter((C) => C.id !== t.id) : s = [...e, t]), g(l ? s[0]?.label ?? "" : ""), n && (s.length === 0 ? a.open() : a.close()), L && L(s);
119
+ n || (e.some((C) => C.id === t.id) ? s = e.filter((C) => C.id !== t.id) : s = [...e, t]), l ? b(s[0]?.label ?? "") : (b(""), f?.("")), n && (s.length === 0 ? u.open() : u.close()), L && L(s);
120
120
  }, T = e.length === 0 ? m ?? k.search : void 0, D = (t) => {
121
- w.current?.contains(t.relatedTarget) || (a.close(), j(!1), N && N(e));
121
+ w.current?.contains(t.relatedTarget) || (u.close(), j(!1), N && N(e));
122
122
  }, A = {
123
- id: o,
123
+ id: r,
124
124
  asPlainText: l,
125
125
  inputValue: H,
126
126
  selectedItems: e,
127
- displayItems: u,
127
+ displayItems: h,
128
128
  toggleItem: R,
129
129
  highlightState: E,
130
- openState: a,
130
+ openState: u,
131
131
  parentStrings: $,
132
132
  // Button
133
- size: r,
134
- variant: h,
135
- label: c,
133
+ size: o,
134
+ variant: a,
135
+ label: i,
136
136
  placeHolderText: T,
137
137
  isDisabled: S,
138
138
  isReadOnly: x,
@@ -140,8 +140,8 @@ function be({
140
140
  collapsed: K,
141
141
  hasPendingDelete: X,
142
142
  setHasPendingDelete: j,
143
- setInputValue: g,
144
- onSearch: b,
143
+ setInputValue: b,
144
+ onSearch: f,
145
145
  // Menu
146
146
  isSingleSelect: n,
147
147
  isSearching: v,
@@ -152,7 +152,7 @@ function be({
152
152
  parentRef: w,
153
153
  popupRef: O,
154
154
  footerContent: z,
155
- subMenuState: f,
155
+ subMenuState: d,
156
156
  translation: k
157
157
  };
158
158
  return /* @__PURE__ */ ee(
@@ -160,14 +160,14 @@ function be({
160
160
  {
161
161
  role: "combobox",
162
162
  as: "label",
163
- htmlFor: o,
163
+ htmlFor: r,
164
164
  className: "combobox",
165
165
  ref: w,
166
- onClick: a.open,
166
+ onClick: u.open,
167
167
  onBlur: D,
168
168
  overflow: "visible",
169
169
  width: "100%",
170
- "aria-expanded": a.isOpen,
170
+ "aria-expanded": u.isOpen,
171
171
  "aria-invalid": B,
172
172
  "aria-required": W,
173
173
  "aria-disabled": S,
@@ -175,7 +175,7 @@ function be({
175
175
  ...Q,
176
176
  children: [
177
177
  /* @__PURE__ */ V(te, { ...A }),
178
- a.isOpen && /* @__PURE__ */ V(re, { ...A })
178
+ u.isOpen && /* @__PURE__ */ V(re, { ...A })
179
179
  ]
180
180
  }
181
181
  );
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../lib/components/table/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,GAAG,EACH,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,YAAY,EACX,WAAW,EACX,SAAS,EACT,aAAa,EACb,GAAG,EACH,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GACf,CAAC;AAEF,UAAU,OAAO,CAAC,KAAK,SAAS,SAAS;IACxC,OAAO,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;CAC5B;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAEnF,UAAU,cAAc,CAAC,KAAK,S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,EAAE,MAAM,EAAE,CAAC;IAE1B,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;CACrC;AAED,MAAM,MAAM,UAAU,CAAC,KAAK,SAAS,SAAS,GAAG,SAAS,IAAI,iBAAiB,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;AAEvG,MAAM,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC/B,CAAC;AAEF;;;GAGG;AACH,OAAO,QAAQ,uBAAuB,CAAC;IACtC,UAAU,UAAU,CAAC,KAAK,SAAS,OAAO,EAAE,MAAM;QACjD,SAAS,CAAC,EAAE,OAAO,CAAC;QAEpB,WAAW,CAAC,EAAE,KAAK,CAAC;QAEpB,YAAY,CAAC,EAAE,MAAM,CAAC;KACtB;IACD,UAAU,SAAS,CAAC,KAAK,SAAS,OAAO;QACxC,KAAK,CAAC,EAAE,KAAK,CAAC;KACd;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caspeco/casper-ui-library",
3
- "version": "7.7.2",
3
+ "version": "7.7.4",
4
4
  "prettier": "@caspeco/prettier-config",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "devDependencies": {
30
30
  "@arethetypeswrong/cli": "^0.18.2",
31
- "@caspeco/eslint-config-react": "^5.0.0",
31
+ "@caspeco/eslint-config-react": "^5.0.2",
32
32
  "@caspeco/prettier-config": "^1.0.7",
33
33
  "@eslint/js": "^9.39.1",
34
34
  "@testing-library/jest-dom": "^6.9.1",
@@ -46,11 +46,11 @@
46
46
  "jsdom": "^27.2.0",
47
47
  "tsc-alias": "^1.8.16",
48
48
  "typescript": "~5.9.3",
49
- "typescript-eslint": "^8.46.4",
50
- "vite": "^7.2.2",
49
+ "typescript-eslint": "^8.48.0",
50
+ "vite": "^7.2.4",
51
51
  "vite-plugin-dts": "^4.5.4",
52
52
  "vite-tsconfig-paths": "^5.1.4",
53
- "vitest": "^4.0.9"
53
+ "vitest": "^4.0.14"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "@chakra-ui/react": "^2.8.2",
@@ -62,7 +62,7 @@
62
62
  "@chakra-ui/anatomy": "^2.3.4",
63
63
  "@floating-ui/dom": "^1.7.4",
64
64
  "@tanstack/react-table": "^8.21.3",
65
- "csstype": "^3.2.2",
65
+ "csstype": "^3.2.3",
66
66
  "date-fns": "^4.1.0"
67
67
  }
68
68
  }