@pibit.ai/cure-design-system 0.3.21 → 0.3.24

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 (68) hide show
  1. package/dist/index.d.ts +3 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +157 -136
  4. package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
  5. package/dist/patterns/table/TableWrapper.js +330 -323
  6. package/dist/patterns/table/index.d.ts +5 -2
  7. package/dist/patterns/table/index.d.ts.map +1 -1
  8. package/dist/patterns/table/integrateTableUndoRedo.d.ts +41 -0
  9. package/dist/patterns/table/integrateTableUndoRedo.d.ts.map +1 -0
  10. package/dist/patterns/table/integrateTableUndoRedo.js +63 -0
  11. package/dist/patterns/table/storyHelpers/useMockTableState.d.ts +3 -1
  12. package/dist/patterns/table/storyHelpers/useMockTableState.d.ts.map +1 -1
  13. package/dist/patterns/table/table.d.ts +2 -1
  14. package/dist/patterns/table/table.d.ts.map +1 -1
  15. package/dist/patterns/table/table.js +181 -155
  16. package/dist/patterns/table/tableUndoRedo.d.ts +38 -0
  17. package/dist/patterns/table/tableUndoRedo.d.ts.map +1 -0
  18. package/dist/patterns/table/tableUndoRedo.js +147 -0
  19. package/dist/patterns/table/toolbar/AlignDropdown.d.ts.map +1 -1
  20. package/dist/patterns/table/toolbar/AlignDropdown.js +5 -11
  21. package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts +4 -0
  22. package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts.map +1 -1
  23. package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +81 -77
  24. package/dist/patterns/table/toolbar/GroupByDropdown.d.ts.map +1 -1
  25. package/dist/patterns/table/toolbar/GroupByDropdown.js +48 -43
  26. package/dist/patterns/table/toolbar/TableToolbar.d.ts +12 -1
  27. package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -1
  28. package/dist/patterns/table/toolbar/TableToolbar.js +164 -114
  29. package/dist/patterns/table/toolbar/index.d.ts +2 -2
  30. package/dist/patterns/table/toolbar/index.d.ts.map +1 -1
  31. package/dist/patterns/table/toolbar/tableToolbarHelpers.d.ts +10 -1
  32. package/dist/patterns/table/toolbar/tableToolbarHelpers.d.ts.map +1 -1
  33. package/dist/patterns/table/toolbar/tableToolbarHelpers.js +116 -116
  34. package/dist/patterns/table/toolbar/useUndoRedoShortcuts.d.ts +9 -0
  35. package/dist/patterns/table/toolbar/useUndoRedoShortcuts.d.ts.map +1 -0
  36. package/dist/patterns/table/toolbar/useUndoRedoShortcuts.js +21 -0
  37. package/dist/patterns/table/types.d.ts +5 -1
  38. package/dist/patterns/table/types.d.ts.map +1 -1
  39. package/dist/patterns/table/useTableUndoRedo.d.ts +41 -0
  40. package/dist/patterns/table/useTableUndoRedo.d.ts.map +1 -0
  41. package/dist/patterns/table/useTableUndoRedo.js +168 -0
  42. package/dist/primitives/badge/badge.js +5 -5
  43. package/dist/primitives/input/input.d.ts +1 -1
  44. package/dist/primitives/input/input.d.ts.map +1 -1
  45. package/dist/primitives/input/input.js +63 -62
  46. package/dist/primitives/multi-chips-select/MultiChipsSelect.d.ts +20 -0
  47. package/dist/primitives/multi-chips-select/MultiChipsSelect.d.ts.map +1 -0
  48. package/dist/primitives/multi-chips-select/MultiChipsSelect.js +233 -0
  49. package/dist/primitives/multi-chips-select/index.d.ts +3 -0
  50. package/dist/primitives/multi-chips-select/index.d.ts.map +1 -0
  51. package/dist/primitives/multi-chips-select/tagKeyFromLabel.d.ts +3 -0
  52. package/dist/primitives/multi-chips-select/tagKeyFromLabel.d.ts.map +1 -0
  53. package/dist/primitives/multi-chips-select/tagKeyFromLabel.js +6 -0
  54. package/dist/primitives/select/ExpandableSearchInput.d.ts +3 -1
  55. package/dist/primitives/select/ExpandableSearchInput.d.ts.map +1 -1
  56. package/dist/primitives/select/ExpandableSearchInput.js +100 -78
  57. package/dist/primitives/select/SearchInput.d.ts +5 -1
  58. package/dist/primitives/select/SearchInput.d.ts.map +1 -1
  59. package/dist/primitives/select/SearchInput.js +101 -80
  60. package/dist/primitives/select/combobox.d.ts.map +1 -1
  61. package/dist/primitives/select/combobox.js +48 -47
  62. package/dist/primitives/select/multi-select.d.ts.map +1 -1
  63. package/dist/primitives/select/multi-select.js +50 -49
  64. package/dist/styles/components.css +1 -1
  65. package/dist/utils/keyboard-shortcut.d.ts +4 -0
  66. package/dist/utils/keyboard-shortcut.d.ts.map +1 -0
  67. package/dist/utils/keyboard-shortcut.js +29 -0
  68. package/package.json +1 -1
@@ -1,22 +1,23 @@
1
- import { jsx as r, jsxs as x, Fragment as B } from "react/jsx-runtime";
1
+ import { jsx as n, jsxs as x, Fragment as B } from "react/jsx-runtime";
2
2
  import { useRef as C, useState as E, useCallback as q, useContext as O, useEffect as W } from "react";
3
3
  import { SearchLg as z, ChevronDown as I } from "@untitledui/icons";
4
4
  import { ComboBox as T, ListBox as M, ComboBoxStateContext as j, Group as _, Input as A } from "react-aria-components";
5
- import { SelectContext as G, sizes as k } from "./select.js";
5
+ import { SelectContext as G, sizes as S } from "./select.js";
6
6
  import { cx as c } from "../../utils/cn.js";
7
- import { Label as H } from "../input/label.js";
8
- import { Popover as K } from "./popover.js";
7
+ import { getPlatformShortcutLabel as H } from "../../utils/keyboard-shortcut.js";
8
+ import { Label as K } from "../input/label.js";
9
+ import { Popover as P } from "./popover.js";
9
10
  import { HintText as $ } from "../input/hint-text.js";
10
11
  import { useResizeObserver as J } from "../../hooks/use-resize-observer.js";
11
- const S = {
12
+ const k = {
12
13
  sm: "text-xs",
13
14
  md: "text-sm",
14
15
  lg: "text-md"
15
- }, P = {
16
+ }, Q = {
16
17
  sm: "text-xs",
17
18
  md: "text-xs",
18
19
  lg: "text-sm"
19
- }, Q = ({
20
+ }, U = ({
20
21
  // @ts-ignore
21
22
  size: d,
22
23
  shortcut: b,
@@ -30,42 +31,42 @@ const S = {
30
31
  W(() => {
31
32
  var f;
32
33
  if (!(e != null && e.isFocused) || !t) return;
33
- const n = (f = i.current) == null ? void 0 : f.querySelector("input"), o = l.current;
34
- if (!n || !o) return;
34
+ const r = (f = i.current) == null ? void 0 : f.querySelector("input"), o = l.current;
35
+ if (!r || !o) return;
35
36
  const a = () => {
36
- const y = n.scrollWidth - n.clientWidth, N = o.scrollWidth - o.clientWidth;
37
+ const y = r.scrollWidth - r.clientWidth, N = o.scrollWidth - o.clientWidth;
37
38
  if (N <= 0) return;
38
- const F = n.scrollLeft <= 0 ? 0 : y <= 0 || n.scrollLeft >= y ? N : n.scrollLeft / y * N;
39
+ const F = r.scrollLeft <= 0 ? 0 : y <= 0 || r.scrollLeft >= y ? N : r.scrollLeft / y * N;
39
40
  o.scrollLeft = F;
40
41
  };
41
- return a(), n.addEventListener("scroll", a), n.addEventListener("keyup", a), () => {
42
- n.removeEventListener("scroll", a), n.removeEventListener("keyup", a);
42
+ return a(), r.addEventListener("scroll", a), r.addEventListener("keyup", a), () => {
43
+ r.removeEventListener("scroll", a), r.removeEventListener("keyup", a);
43
44
  };
44
45
  }, [e == null ? void 0 : e.isFocused, t]);
45
46
  const h = q(() => {
46
47
  e != null && e.isFocused && !(e != null && e.isOpen) && e.open(null, "manual");
47
48
  }, [e]);
48
- return /* @__PURE__ */ r(
49
+ return /* @__PURE__ */ n(
49
50
  _,
50
51
  {
51
52
  ...w,
52
53
  onClick: h,
53
- className: ({ isFocusWithin: n, isDisabled: o }) => c(
54
+ className: ({ isFocusWithin: r, isDisabled: o }) => c(
54
55
  "relative flex w-full items-center gap-2 rounded-lg bg-primary shadow-xs ring-1 ring-primary outline-hidden transition-shadow duration-100 ease-linear ring-inset",
55
56
  o && "cursor-not-allowed bg-disabled_subtle",
56
- n && "ring-2 ring-brand",
57
+ r && "ring-2 ring-brand",
57
58
  // @ts-ignore
58
- k[d].root
59
+ S[d].root
59
60
  ),
60
- children: ({ isDisabled: n }) => /* @__PURE__ */ x(B, { children: [
61
- v && /* @__PURE__ */ r(z, { className: "pointer-events-none size-3.5 shrink-0 text-fg-quaternary" }),
61
+ children: ({ isDisabled: r }) => /* @__PURE__ */ x(B, { children: [
62
+ v && /* @__PURE__ */ n(z, { className: "pointer-events-none size-3.5 shrink-0 text-fg-quaternary" }),
62
63
  /* @__PURE__ */ x(
63
64
  "div",
64
65
  {
65
66
  ref: i,
66
67
  className: "relative flex items-center min-w-0 flex-1",
67
68
  children: [
68
- t && /* @__PURE__ */ r(
69
+ t && /* @__PURE__ */ n(
69
70
  "div",
70
71
  {
71
72
  ref: l,
@@ -80,16 +81,16 @@ const S = {
80
81
  className: c(
81
82
  "text-primary whitespace-nowrap",
82
83
  e != null && e.isFocused ? "w-max" : "min-w-0 flex-1 truncate",
83
- S[d]
84
+ k[d]
84
85
  ),
85
86
  children: [
86
- /* @__PURE__ */ r("span", { className: n ? "text-disabled" : "", children: m.trim() }),
87
+ /* @__PURE__ */ n("span", { className: r ? "text-disabled" : "", children: m.trim() }),
87
88
  s != null && s !== "" && /* @__PURE__ */ x(
88
89
  "span",
89
90
  {
90
91
  className: c(
91
92
  "-ml-0.75 text-tertiary",
92
- n && "text-disabled"
93
+ r && "text-disabled"
93
94
  ),
94
95
  children: [
95
96
  " ",
@@ -102,60 +103,60 @@ const S = {
102
103
  )
103
104
  }
104
105
  ),
105
- /* @__PURE__ */ r(
106
+ /* @__PURE__ */ n(
106
107
  A,
107
108
  {
108
109
  placeholder: g,
109
110
  className: c(
110
111
  "relative z-10 w-full min-w-0 appearance-none bg-transparent text-transparent caret-alpha-black/90 placeholder:text-placeholder focus:outline-hidden disabled:cursor-not-allowed disabled:text-disabled disabled:placeholder:text-disabled",
111
- S[d]
112
+ k[d]
112
113
  )
113
114
  }
114
115
  )
115
116
  ]
116
117
  }
117
118
  ),
118
- b && /* @__PURE__ */ r(
119
+ b && /* @__PURE__ */ n(
119
120
  "div",
120
121
  {
121
122
  className: c(
122
123
  "absolute inset-y-0.5 right-0.5 z-10 flex items-center rounded-r-[inherit] bg-linear-to-r from-transparent to-bg-primary to-40% pl-8",
123
- n && "to-bg-disabled_subtle",
124
+ r && "to-bg-disabled_subtle",
124
125
  // @ts-ignore
125
- k[d].shortcut,
126
+ S[d].shortcut,
126
127
  u
127
128
  ),
128
- children: /* @__PURE__ */ r(
129
+ children: /* @__PURE__ */ n(
129
130
  "span",
130
131
  {
131
132
  className: c(
132
133
  "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset",
133
- n && "bg-transparent text-disabled"
134
+ r && "bg-transparent text-disabled"
134
135
  ),
135
136
  "aria-hidden": "true",
136
- children: "K"
137
+ children: H(["meta"], "K")
137
138
  }
138
139
  )
139
140
  }
140
141
  ),
141
- /* @__PURE__ */ r(
142
+ /* @__PURE__ */ n(
142
143
  "button",
143
144
  {
144
145
  type: "button",
145
146
  tabIndex: -1,
146
- disabled: n,
147
+ disabled: r,
147
148
  onMouseDown: (o) => {
148
149
  o.preventDefault(), o.stopPropagation();
149
150
  },
150
151
  onClick: (o) => {
151
- o.preventDefault(), o.stopPropagation(), !n && e && (e.isOpen ? e.close() : e.open(null, "manual"), requestAnimationFrame(() => {
152
+ o.preventDefault(), o.stopPropagation(), !r && e && (e.isOpen ? e.close() : e.open(null, "manual"), requestAnimationFrame(() => {
152
153
  var a, f;
153
154
  (f = (a = i.current) == null ? void 0 : a.querySelector("input")) == null || f.focus();
154
155
  }));
155
156
  },
156
157
  className: "cursor-pointer p-0.5 -m-0.5 rounded outline-hidden focus-visible:ring-2 focus-visible:ring-brand disabled:pointer-events-none disabled:opacity-50",
157
158
  "aria-label": e != null && e.isOpen ? "Close dropdown" : "Open dropdown",
158
- children: /* @__PURE__ */ r(
159
+ children: /* @__PURE__ */ n(
159
160
  I,
160
161
  {
161
162
  className: c(
@@ -170,7 +171,7 @@ const S = {
170
171
  ] })
171
172
  }
172
173
  );
173
- }, oe = ({
174
+ }, le = ({
174
175
  showPrefixIcon: d = !0,
175
176
  placeholder: b = "Search",
176
177
  shortcut: g = !0,
@@ -190,18 +191,18 @@ const S = {
190
191
  ref: l,
191
192
  box: "border-box",
192
193
  onResize: m
193
- }), /* @__PURE__ */ r(G.Provider, { value: { size: u }, children: /* @__PURE__ */ r(T, { menuTrigger: "focus", ...i, children: (s) => /* @__PURE__ */ x("div", { className: "flex flex-col gap-1.5", children: [
194
- i.label && /* @__PURE__ */ r(
195
- H,
194
+ }), /* @__PURE__ */ n(G.Provider, { value: { size: u }, children: /* @__PURE__ */ n(T, { menuTrigger: "focus", ...i, children: (s) => /* @__PURE__ */ x("div", { className: "flex flex-col gap-1.5", children: [
195
+ i.label && /* @__PURE__ */ n(
196
+ K,
196
197
  {
197
198
  isRequired: s.isRequired,
198
199
  tooltip: i.tooltip,
199
- className: P[u],
200
+ className: Q[u],
200
201
  children: i.label
201
202
  }
202
203
  ),
203
- /* @__PURE__ */ r(
204
- Q,
204
+ /* @__PURE__ */ n(
205
+ U,
205
206
  {
206
207
  ref: l,
207
208
  placeholder: b,
@@ -213,19 +214,19 @@ const S = {
213
214
  showPrefixIcon: d
214
215
  }
215
216
  ),
216
- /* @__PURE__ */ r(
217
- K,
217
+ /* @__PURE__ */ n(
218
+ P,
218
219
  {
219
220
  size: u,
220
221
  triggerRef: l,
221
222
  style: { width: p },
222
223
  className: i.popoverClassName,
223
- children: /* @__PURE__ */ r(M, { items: w, className: "size-full outline-hidden", children: v })
224
+ children: /* @__PURE__ */ n(M, { items: w, className: "size-full outline-hidden", children: v })
224
225
  }
225
226
  ),
226
- i.hint && /* @__PURE__ */ r($, { isInvalid: s.isInvalid, children: i.hint })
227
+ i.hint && /* @__PURE__ */ n($, { isInvalid: s.isInvalid, children: i.hint })
227
228
  ] }) }) });
228
229
  };
229
230
  export {
230
- oe as ComboBox
231
+ le as ComboBox
231
232
  };
@@ -1 +1 @@
1
- {"version":3,"file":"multi-select.d.ts","sourceRoot":"","sources":["../../../src/primitives/select/multi-select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAEjB,mBAAmB,EACnB,aAAa,EACb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C3C,QAAQ,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC,UAAU,CAAC,CAAC;IACvD,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,GAAI,mLAgB7B,gBAAgB,4CA8IlB,CAAC;AA6JF,eAAO,MAAM,oBAAoB,GAAI,6HAUlC,kBAAkB,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,4CAgC7C,CAAC;AAEF,QAAA,MAAM,WAAW,EAAsB,OAAO,eAAe,GAAG;IAC9D,IAAI,EAAE,OAAO,UAAU,CAAC;CACzB,CAAC;AAIF,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as i, jsxs as N, Fragment as _ } from "react/jsx-runtime";
2
- import { useCallback as z, useRef as E, useState as L, createContext as q, useContext as D } from "react";
2
+ import { useCallback as z, useRef as L, useState as E, createContext as q, useContext as D } from "react";
3
3
  import { ComboBox as j, ListBox as C, Group as V, ComboBoxStateContext as W, Input as G } from "react-aria-components";
4
4
  import { Avatar as H } from "../avatar/avatar.js";
5
5
  import { HintText as U } from "../input/hint-text.js";
@@ -9,15 +9,16 @@ import { sizes as O } from "./select.js";
9
9
  import { TagCloseX as Q } from "../tags/base-components/tag-close-x.js";
10
10
  import { SelectItem as Y } from "./select-item.js";
11
11
  import { cx as w } from "../../utils/cn.js";
12
- import { useResizeObserver as Z } from "../../hooks/use-resize-observer.js";
13
- import { useFilter as M } from "../../node_modules/@react-aria/i18n/dist/useFilter.js";
14
- import { useListData as B } from "../../node_modules/@react-stately/data/dist/useListData.js";
15
- import { FocusScope as I, useFocusManager as ee } from "../../node_modules/@react-aria/focus/dist/FocusScope.js";
16
- const te = {
12
+ import { getPlatformShortcutLabel as Z } from "../../utils/keyboard-shortcut.js";
13
+ import { useResizeObserver as M } from "../../hooks/use-resize-observer.js";
14
+ import { useFilter as B } from "../../node_modules/@react-aria/i18n/dist/useFilter.js";
15
+ import { useListData as I } from "../../node_modules/@react-stately/data/dist/useListData.js";
16
+ import { FocusScope as ee, useFocusManager as te } from "../../node_modules/@react-aria/focus/dist/FocusScope.js";
17
+ const re = {
17
18
  sm: "text-xs",
18
19
  md: "text-sm",
19
20
  lg: "text-md"
20
- }, K = q({
21
+ }, P = q({
21
22
  size: "sm",
22
23
  selectedKeys: [],
23
24
  selectedItems: {},
@@ -34,7 +35,7 @@ const te = {
34
35
  selectedItems: l,
35
36
  onItemCleared: c,
36
37
  onItemInserted: t,
37
- shortcut: s,
38
+ shortcut: r,
38
39
  placeholder: d = "Search",
39
40
  showAvatar: p = !0,
40
41
  readOnly: g = !1,
@@ -45,37 +46,37 @@ const te = {
45
46
  ...n
46
47
  }) => {
47
48
  var A;
48
- const { contains: x } = M({ sensitivity: "base" }), u = (A = l == null ? void 0 : l.items) != null && A.length ? l.items.map((r) => r.id) : [], e = z(
49
- (r, a) => !u.includes(r.id) && x(r.label || r.supportingText || "", a),
49
+ const { contains: x } = B({ sensitivity: "base" }), u = (A = l == null ? void 0 : l.items) != null && A.length ? l.items.map((s) => s.id) : [], e = z(
50
+ (s, a) => !u.includes(s.id) && x(s.label || s.supportingText || "", a),
50
51
  [x, u]
51
- ), o = B({
52
+ ), o = I({
52
53
  initialItems: m,
53
54
  filter: e
54
55
  }), v = z(
55
- (r) => {
56
- const a = r.values().next().value;
56
+ (s) => {
57
+ const a = s.values().next().value;
57
58
  a && (l.remove(a), c == null || c(a));
58
59
  },
59
60
  [l, c]
60
- ), S = (r) => {
61
- if (!r)
61
+ ), S = (s) => {
62
+ if (!s)
62
63
  return;
63
- const a = o.getItem(r);
64
- a && (u.includes(r) || (l.append(a), t == null || t(r)), o.setFilterText(""));
65
- }, y = (r) => {
66
- g || o.setFilterText(r);
67
- }, f = E(null), [P, F] = L(""), $ = z(() => {
64
+ const a = o.getItem(s);
65
+ a && (u.includes(s) || (l.append(a), t == null || t(s)), o.setFilterText(""));
66
+ }, y = (s) => {
67
+ g || o.setFilterText(s);
68
+ }, f = L(null), [K, F] = E(""), $ = z(() => {
68
69
  var a;
69
70
  if (!f.current) return;
70
- let r = (a = f.current) == null ? void 0 : a.getBoundingClientRect();
71
- F(r.width + "px");
71
+ let s = (a = f.current) == null ? void 0 : a.getBoundingClientRect();
72
+ F(s.width + "px");
72
73
  }, [f, F]);
73
- return Z({
74
+ return M({
74
75
  ref: f,
75
76
  onResize: $,
76
77
  box: "border-box"
77
78
  }), /* @__PURE__ */ i(
78
- K.Provider,
79
+ P.Provider,
79
80
  {
80
81
  value: {
81
82
  size: h,
@@ -98,15 +99,15 @@ const te = {
98
99
  selectedKey: null,
99
100
  onSelectionChange: S,
100
101
  ...n,
101
- children: (r) => {
102
+ children: (s) => {
102
103
  var a;
103
104
  return /* @__PURE__ */ N("div", { className: "flex flex-col gap-1.5", children: [
104
- n.label && /* @__PURE__ */ i(X, { isRequired: r.isRequired, tooltip: n.tooltip, children: n.label }),
105
+ n.label && /* @__PURE__ */ i(X, { isRequired: s.isRequired, tooltip: n.tooltip, children: n.label }),
105
106
  /* @__PURE__ */ i(
106
- ie,
107
+ ae,
107
108
  {
108
109
  size: h,
109
- shortcut: s,
110
+ shortcut: r,
110
111
  ref: f,
111
112
  placeholder: d,
112
113
  readOnly: g,
@@ -119,7 +120,7 @@ const te = {
119
120
  {
120
121
  size: "md",
121
122
  triggerRef: f,
122
- style: { width: P },
123
+ style: { width: K },
123
124
  className: n == null ? void 0 : n.popoverClassName,
124
125
  children: /* @__PURE__ */ i(
125
126
  C,
@@ -131,14 +132,14 @@ const te = {
131
132
  )
132
133
  }
133
134
  ),
134
- n.hint && /* @__PURE__ */ i(U, { isInvalid: r.isInvalid, children: n.hint })
135
+ n.hint && /* @__PURE__ */ i(U, { isInvalid: s.isInvalid, children: n.hint })
135
136
  ] });
136
137
  }
137
138
  }
138
139
  )
139
140
  }
140
141
  );
141
- }, re = ({
142
+ }, ie = ({
142
143
  isDisabled: m,
143
144
  shortcut: b,
144
145
  shortcutClassName: h,
@@ -146,7 +147,7 @@ const te = {
146
147
  readOnly: c = !1
147
148
  }) => {
148
149
  var T, n, x, u;
149
- const t = ee(), s = D(K), d = D(W), p = (e) => {
150
+ const t = te(), r = D(P), d = D(W), p = (e) => {
150
151
  if (!(!(e.currentTarget.selectionStart === 0 && e.currentTarget.selectionEnd === 0) && e.currentTarget.value !== ""))
151
152
  switch (e.key) {
152
153
  case "Backspace":
@@ -164,12 +165,12 @@ const te = {
164
165
  if (e.key === "Tab")
165
166
  return;
166
167
  e.preventDefault();
167
- const v = ((f = (y = (S = s == null ? void 0 : s.selectedItems) == null ? void 0 : S.items) == null ? void 0 : y[0]) == null ? void 0 : f.id) === o;
168
+ const v = ((f = (y = (S = r == null ? void 0 : r.selectedItems) == null ? void 0 : S.items) == null ? void 0 : y[0]) == null ? void 0 : f.id) === o;
168
169
  switch (e.key) {
169
170
  case " ":
170
171
  case "Enter":
171
172
  case "Backspace":
172
- v ? t == null || t.focusNext({ wrap: !1, tabbable: !1 }) : t == null || t.focusPrevious({ wrap: !1, tabbable: !1 }), s.onRemove(/* @__PURE__ */ new Set([o]));
173
+ v ? t == null || t.focusNext({ wrap: !1, tabbable: !1 }) : t == null || t.focusPrevious({ wrap: !1, tabbable: !1 }), r.onRemove(/* @__PURE__ */ new Set([o]));
173
174
  break;
174
175
  case "ArrowLeft":
175
176
  t == null || t.focusPrevious({ wrap: !1, tabbable: !1 });
@@ -181,17 +182,17 @@ const te = {
181
182
  d == null || d.close();
182
183
  break;
183
184
  }
184
- }, R = ((n = (T = s == null ? void 0 : s.selectedItems) == null ? void 0 : T.items) == null ? void 0 : n.length) === 0;
185
+ }, R = ((n = (T = r == null ? void 0 : r.selectedItems) == null ? void 0 : T.items) == null ? void 0 : n.length) === 0;
185
186
  return /* @__PURE__ */ N("div", { className: "relative flex w-full flex-1 flex-row flex-wrap items-center justify-start gap-1.5", children: [
186
- !R && ((u = (x = s == null ? void 0 : s.selectedItems) == null ? void 0 : x.items) == null ? void 0 : u.map((e) => /* @__PURE__ */ N(
187
+ !R && ((u = (x = r == null ? void 0 : r.selectedItems) == null ? void 0 : x.items) == null ? void 0 : u.map((e) => /* @__PURE__ */ N(
187
188
  "span",
188
189
  {
189
190
  className: w(
190
191
  "flex items-center rounded-md bg-primary py-0.5 pr-1 pl-1.25 ring-1 ring-[var(--color-gray-100)] ring-inset",
191
- s == null ? void 0 : s.chipClassName
192
+ r == null ? void 0 : r.chipClassName
192
193
  ),
193
194
  children: [
194
- (s == null ? void 0 : s.showAvatar) && /* @__PURE__ */ i(
195
+ (r == null ? void 0 : r.showAvatar) && /* @__PURE__ */ i(
195
196
  H,
196
197
  {
197
198
  size: "sm",
@@ -208,7 +209,7 @@ const te = {
208
209
  isDisabled: m,
209
210
  className: "ml-0.75",
210
211
  onKeyDown: (o) => k(o, e.id),
211
- onPress: () => s.onRemove(/* @__PURE__ */ new Set([e.id]))
212
+ onPress: () => r.onRemove(/* @__PURE__ */ new Set([e.id]))
212
213
  }
213
214
  )
214
215
  ]
@@ -234,7 +235,7 @@ const te = {
234
235
  className: w(
235
236
  "w-full flex-[1_0_0] appearance-none bg-transparent text-ellipsis text-primary caret-alpha-black/90 outline-none placeholder:text-placeholder_subtle focus:outline-hidden disabled:cursor-not-allowed disabled:text-disabled disabled:placeholder:text-disabled",
236
237
  c && "cursor-default",
237
- te[(s == null ? void 0 : s.size) || "sm"]
238
+ re[(r == null ? void 0 : r.size) || "sm"]
238
239
  )
239
240
  }
240
241
  ),
@@ -253,7 +254,7 @@ const te = {
253
254
  "pointer-events-none rounded px-1 py-px text-xs font-medium text-quaternary ring-1 ring-secondary select-none ring-inset",
254
255
  m && "bg-transparent text-disabled"
255
256
  ),
256
- children: "K"
257
+ children: Z(["meta"], "K")
257
258
  }
258
259
  )
259
260
  }
@@ -262,7 +263,7 @@ const te = {
262
263
  }
263
264
  )
264
265
  ] });
265
- }, ie = ({
266
+ }, ae = ({
266
267
  size: m,
267
268
  shortcut: b,
268
269
  placeholder: h,
@@ -270,7 +271,7 @@ const te = {
270
271
  placeholderIcon: c = null,
271
272
  readOnly: t = !1,
272
273
  // Omit this prop to avoid invalid HTML attribute warning
273
- isDisabled: s,
274
+ isDisabled: r,
274
275
  ...d
275
276
  }) => /* @__PURE__ */ i(
276
277
  V,
@@ -284,8 +285,8 @@ const te = {
284
285
  ),
285
286
  children: ({ isDisabled: p }) => /* @__PURE__ */ N(_, { children: [
286
287
  c && /* @__PURE__ */ i(c, { className: "pointer-events-none size-5 text-fg-quaternary" }),
287
- /* @__PURE__ */ i(I, { contain: !1, autoFocus: !1, restoreFocus: !1, children: /* @__PURE__ */ i(
288
- re,
288
+ /* @__PURE__ */ i(ee, { contain: !1, autoFocus: !1, restoreFocus: !1, children: /* @__PURE__ */ i(
289
+ ie,
289
290
  {
290
291
  isDisabled: p,
291
292
  size: m,
@@ -297,10 +298,10 @@ const te = {
297
298
  ) })
298
299
  ] })
299
300
  }
300
- ), ae = se;
301
- ae.Item = Y;
301
+ ), le = se;
302
+ le.Item = Y;
302
303
  export {
303
- ae as MultiSelect,
304
+ le as MultiSelect,
304
305
  se as MultiSelectBase,
305
- ie as MultiSelectTagsValue
306
+ ae as MultiSelectTagsValue
306
307
  };