@jfrader/ui 0.5.0 → 0.5.1

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 (179) hide show
  1. package/dist/accordion-DLul6vIl.js +205 -0
  2. package/dist/accordion.js +1 -1
  3. package/dist/{announcement-bar-B58xempt.js → announcement-bar-Dlbq5-9D.js} +1 -1
  4. package/dist/announcement-bar.js +1 -1
  5. package/dist/avatar-CaGJHy1N.js +145 -0
  6. package/dist/{avatar-group-DOQQuV51.js → avatar-group-M1opAQEG.js} +1 -1
  7. package/dist/avatar-group.js +1 -1
  8. package/dist/avatar.js +1 -1
  9. package/dist/badge-CjM5Agqk.js +119 -0
  10. package/dist/badge.js +1 -1
  11. package/dist/{bottom-sheet-DPJBFkie.js → bottom-sheet-DjZOPq4k.js} +10 -9
  12. package/dist/bottom-sheet.js +1 -1
  13. package/dist/{breadcrumbs-Cfw_hgt2.js → breadcrumbs-BDK_LiwH.js} +10 -3
  14. package/dist/breadcrumbs.js +1 -1
  15. package/dist/{button-C92uYFJW.js → button-NLY0h6EJ.js} +7 -7
  16. package/dist/button.js +1 -1
  17. package/dist/{calendar-B3Svu0X2.js → calendar-BzJdv_SZ.js} +3 -1
  18. package/dist/calendar.js +1 -1
  19. package/dist/card-Ca4KQKYQ.js +154 -0
  20. package/dist/card.js +1 -1
  21. package/dist/carousel-B7OrvD6J.js +474 -0
  22. package/dist/carousel.js +1 -1
  23. package/dist/{checkbox-cFquiSdy.js → checkbox-DKSzExj2.js} +16 -15
  24. package/dist/checkbox.js +1 -1
  25. package/dist/{chip-group-DTQd_M-G.js → chip-group-DjQ0_6Y9.js} +2 -1
  26. package/dist/chip-group.js +1 -1
  27. package/dist/{code-block-ahnRi-g8.js → code-block-B5we2lZa.js} +75 -74
  28. package/dist/code-block.js +1 -1
  29. package/dist/{combobox-Bhzvu9ma.js → combobox-DFFqOBCi.js} +114 -109
  30. package/dist/combobox.js +1 -1
  31. package/dist/command-palette-BmQu2w4H.js +391 -0
  32. package/dist/command-palette.js +1 -1
  33. package/dist/comment-thread-ASaXDcGo.js +1410 -0
  34. package/dist/comment-thread.js +2 -0
  35. package/dist/context-menu-__1c2Dk9.js +370 -0
  36. package/dist/context-menu.js +2 -0
  37. package/dist/{copy-button-ByiA6D3R.js → copy-button-DCSLcYS-.js} +1 -1
  38. package/dist/copy-button.js +1 -1
  39. package/dist/{date-picker-5zKSSuFF.js → date-picker-BiPN7yeK.js} +4 -4
  40. package/dist/date-picker.js +1 -1
  41. package/dist/date-range-picker-DQpUeKqV.js +570 -0
  42. package/dist/date-range-picker.js +1 -1
  43. package/dist/{dialog-ciiv9H2b.js → dialog-BX1zYMs-.js} +2 -1
  44. package/dist/dialog.js +1 -1
  45. package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
  46. package/dist/divider.js +1 -1
  47. package/dist/elastic-slider-BG6K019r.js +395 -0
  48. package/dist/elastic-slider.js +2 -0
  49. package/dist/{expandable-card-C-qJcZ14.js → expandable-card-rUATve0o.js} +8 -1
  50. package/dist/expandable-card.js +1 -1
  51. package/dist/expanding-search-BxOwtdwt.js +238 -0
  52. package/dist/expanding-search.js +2 -0
  53. package/dist/file-dropzone-BuXm3Tea.js +457 -0
  54. package/dist/file-dropzone.js +1 -1
  55. package/dist/{filter-toolbar-D5KEKTSe.js → filter-toolbar-Cy5Hqur-.js} +4 -2
  56. package/dist/filter-toolbar.js +1 -1
  57. package/dist/{hover-card-B-nrCIy2.js → hover-card-CoMJKg1g.js} +7 -7
  58. package/dist/hover-card.js +1 -1
  59. package/dist/{image-compare-ciuhPtQZ.js → image-compare-BxY8Ykzt.js} +1 -1
  60. package/dist/image-compare.js +1 -1
  61. package/dist/index.js +81 -76
  62. package/dist/{json-viewer-BcySQfjZ.js → json-viewer-DgWqyU75.js} +7 -3
  63. package/dist/json-viewer.js +1 -1
  64. package/dist/mention-input-sq61si9L.js +600 -0
  65. package/dist/mention-input.js +1 -1
  66. package/dist/menu-DDKgmK2F.js +295 -0
  67. package/dist/menu.js +1 -1
  68. package/dist/{metric-card-Bh9K4fZs.js → metric-card--lVTz5Wn.js} +2 -2
  69. package/dist/metric-card.js +1 -1
  70. package/dist/{multi-select-Pce_IYnz.js → multi-select-DG1BCFX7.js} +14 -6
  71. package/dist/multi-select.js +1 -1
  72. package/dist/{navigation-sP5fiuQS.js → navigation-CC26JDr-.js} +20 -14
  73. package/dist/navigation.js +1 -1
  74. package/dist/{overlay-layer-SeUyyEPD.js → overlay-layer-qEbpEtb8.js} +16 -2
  75. package/dist/{pagination-DmXZ8E85.js → pagination-BfkeWbmP.js} +23 -22
  76. package/dist/pagination.js +1 -1
  77. package/dist/pill-BaS-uIbn.js +58 -0
  78. package/dist/pill.js +1 -1
  79. package/dist/popover-CErIw2q3.js +125 -0
  80. package/dist/popover.js +1 -1
  81. package/dist/{progress-CbOWBUdA.js → progress-DAQkfhPd.js} +1 -1
  82. package/dist/progress.js +1 -1
  83. package/dist/{radio-cards-D2QZENI_.js → radio-cards-Cu9cBssN.js} +35 -34
  84. package/dist/radio-cards.js +1 -1
  85. package/dist/{radio-group-E6mMRgo7.js → radio-group-TIK0-iPX.js} +18 -15
  86. package/dist/radio-group.js +1 -1
  87. package/dist/{resizable-panels-BhjUVXZZ.js → resizable-panels-DUpQEpwG.js} +3 -2
  88. package/dist/resizable-panels.js +1 -1
  89. package/dist/{search-field-IxF0IJXm.js → search-field-DMvho0KQ.js} +2 -2
  90. package/dist/search-field.js +1 -1
  91. package/dist/{segmented-control-yO1K1nbi.js → segmented-control-8ZUGnsZm.js} +2 -1
  92. package/dist/segmented-control.js +1 -1
  93. package/dist/{select-n_H52W1Z.js → select-D5rhJ8gi.js} +3 -2
  94. package/dist/select.js +1 -1
  95. package/dist/{signature-pad-q2SAsrdD.js → signature-pad-_bTeguN9.js} +256 -251
  96. package/dist/signature-pad.js +1 -1
  97. package/dist/slider-DVG6-Awh.js +308 -0
  98. package/dist/slider.js +1 -1
  99. package/dist/{sortable-data-table-tirqlLY2.js → sortable-data-table-CYKT_Ng7.js} +2 -2
  100. package/dist/sortable-data-table.js +1 -1
  101. package/dist/{split-button-Cb3EHs64.js → split-button-BCw4zZom.js} +75 -81
  102. package/dist/split-button.js +1 -1
  103. package/dist/{swipe-actions-DiZC57-3.js → swipe-actions-CBuJREU1.js} +4 -2
  104. package/dist/swipe-actions.js +1 -1
  105. package/dist/switch-C1WrKrf-.js +145 -0
  106. package/dist/switch.js +1 -1
  107. package/dist/tabs-XluwRjgg.js +210 -0
  108. package/dist/tabs.js +1 -1
  109. package/dist/{text-field-C8TWG-tY.js → text-field-hU72iSVS.js} +15 -13
  110. package/dist/text-field.js +1 -1
  111. package/dist/{textarea-BrW0XcG_.js → textarea-3k4Y0QQ3.js} +18 -16
  112. package/dist/textarea.js +1 -1
  113. package/dist/theme-root.js +1 -1
  114. package/dist/theme-switch-C505TtU8.js +166 -0
  115. package/dist/theme-switch.js +2 -0
  116. package/dist/{time-picker-Db8D49cP.js → time-picker-CPlhW0tr.js} +26 -20
  117. package/dist/time-picker.js +1 -1
  118. package/dist/{timeline-k3nURuCP.js → timeline-B0uAAVfT.js} +8 -2
  119. package/dist/timeline.js +1 -1
  120. package/dist/{toast-BHxI32ZA.js → toast-B7wo3sX1.js} +98 -79
  121. package/dist/{toast-stack-DqrAzdg5.js → toast-stack-B40VpS4M.js} +18 -4
  122. package/dist/toast-stack.js +1 -1
  123. package/dist/toast.js +1 -1
  124. package/dist/{toggle-group-fcjzpifI.js → toggle-group-B2fpFZwV.js} +1 -1
  125. package/dist/toggle-group.js +1 -1
  126. package/dist/tooltip-BvgVTCTN.js +120 -0
  127. package/dist/tooltip.js +1 -1
  128. package/dist/{tree-view-C2liIxqy.js → tree-view-j8qLqkb_.js} +5 -1
  129. package/dist/tree-view.js +1 -1
  130. package/dist/types/components/checkbox/checkbox.d.ts +1 -1
  131. package/dist/types/components/command-palette/command-palette.d.ts +1 -1
  132. package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
  133. package/dist/types/components/comment-thread/index.d.ts +1 -0
  134. package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
  135. package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
  136. package/dist/types/components/context-menu/context-menu.d.ts +55 -0
  137. package/dist/types/components/context-menu/index.d.ts +2 -0
  138. package/dist/types/components/date-range-picker/date-range-picker.d.ts +1 -1
  139. package/dist/types/components/elastic-slider/elastic-slider.d.ts +53 -0
  140. package/dist/types/components/elastic-slider/index.d.ts +1 -0
  141. package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
  142. package/dist/types/components/expanding-search/index.d.ts +1 -0
  143. package/dist/types/components/menu/menu.d.ts +50 -7
  144. package/dist/types/components/pagination/pagination.d.ts +1 -1
  145. package/dist/types/components/radio-cards/radio-cards.d.ts +1 -1
  146. package/dist/types/components/radio-group/radio-group.d.ts +1 -1
  147. package/dist/types/components/slider/slider-style.d.ts +14 -0
  148. package/dist/types/components/slider/slider.d.ts +2 -10
  149. package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
  150. package/dist/types/components/split-button/split-button.d.ts +2 -2
  151. package/dist/types/components/tabs/tabs.d.ts +1 -1
  152. package/dist/types/components/text-field/text-field.d.ts +1 -1
  153. package/dist/types/components/textarea/textarea.d.ts +1 -1
  154. package/dist/types/components/theme-switch/index.d.ts +1 -0
  155. package/dist/types/components/theme-switch/theme-switch.d.ts +33 -0
  156. package/dist/types/components/tooltip/tooltip.d.ts +1 -1
  157. package/dist/types/index.d.ts +5 -0
  158. package/dist/types/overlay/overlay-layer.d.ts +20 -0
  159. package/dist/types/overlay/use-overlay-floating.d.ts +9 -2
  160. package/dist/{use-overlay-floating-DvJifLpF.js → use-overlay-floating-Bx2jBKAA.js} +8 -6
  161. package/dist/use-slider-interaction-ChL-208h.js +234 -0
  162. package/package.json +22 -2
  163. package/dist/accordion-xCI_u0BV.js +0 -198
  164. package/dist/avatar-BahDVO9t.js +0 -132
  165. package/dist/badge-B_sLygxU.js +0 -108
  166. package/dist/card-D-aI2QHx.js +0 -158
  167. package/dist/carousel-IvPqN-oM.js +0 -472
  168. package/dist/command-palette-BQ5LleGb.js +0 -384
  169. package/dist/date-range-picker-B5uFWsm-.js +0 -562
  170. package/dist/file-dropzone-pR4v7owg.js +0 -457
  171. package/dist/mention-input-BcQKX2EJ.js +0 -599
  172. package/dist/menu-xwOOUtWP.js +0 -275
  173. package/dist/pill-DO2gHzMb.js +0 -56
  174. package/dist/popover-QHcEvf9c.js +0 -119
  175. package/dist/slider-t0B5cecO.js +0 -477
  176. package/dist/switch-qwv8jQnR.js +0 -142
  177. package/dist/tabs-CAVJndX1.js +0 -203
  178. package/dist/tooltip-CkeiW9C1.js +0 -113
  179. package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
@@ -3,12 +3,12 @@ import { r as e, t } from "./sx-Dx9JUKp5.js";
3
3
  import { t as n } from "./use-latest-callback-cj1OOQL6.js";
4
4
  import { t as r } from "./use-controlled-state-DpeVQZNR.js";
5
5
  import { t as i } from "./renderable-DzcIj1Lo.js";
6
- import { t as a } from "./overlay-layer-SeUyyEPD.js";
6
+ import { t as a } from "./overlay-layer-qEbpEtb8.js";
7
7
  import { a as o, i as s, n as c, o as l, r as u, s as d, t as f } from "./listbox-style-WX-RASp1.js";
8
8
  import { a as p, r as m, t as h } from "./collection-registry-k6JcD3Jr.js";
9
9
  import { t as g } from "./overlay-portal-C4JZFq2M.js";
10
- import { t as _ } from "./use-overlay-floating-DvJifLpF.js";
11
- import { t as v } from "./text-field-C8TWG-tY.js";
10
+ import { t as _ } from "./use-overlay-floating-Bx2jBKAA.js";
11
+ import { t as v } from "./text-field-hU72iSVS.js";
12
12
  import { createContext as y, useCallback as b, useContext as x, useId as S, useLayoutEffect as C, useMemo as w, useRef as T, useState as E } from "react";
13
13
  import { vars as D } from "@jfrader/tokens/vars";
14
14
  import { jsx as O, jsxs as ee } from "@emotion/react/jsx-runtime";
@@ -25,19 +25,19 @@ function B(e) {
25
25
  if (!x(R)) throw Error(`Combobox.${e} must be rendered inside <Combobox.List>.`);
26
26
  return t;
27
27
  }
28
- var ne = e({ "&[hidden]": { display: "none" } }), V = e({
28
+ var V = e({ "&[hidden]": { display: "none" } }), H = e({
29
29
  paddingBlock: D.space[1],
30
30
  paddingInline: D.space[2],
31
31
  fontSize: D.textSize.sm,
32
32
  color: D.color.textMuted
33
33
  });
34
- function H({ value: e, defaultValue: t, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, name: c, filter: l = I, onInputChange: u, children: d }) {
35
- let f = S(), [m, h] = E(`${f}-listbox`), [g, v] = E(!1), [y = null, x] = r(e, t ?? null, i), [C = !1, D] = r(a, o, s), [k, M] = E(null), [P, F] = E(""), [R, z] = p(), [B, ne] = E(null), V = T([]), H = T(null), U = n(u), W = b((e, t) => t === "" || l(e, t), [l]), { valuesByIndex: G, skippedIndices: K, matchCount: q } = w(() => {
34
+ function U({ value: e, defaultValue: t, onValueChange: i, open: a, defaultOpen: o = !1, onOpenChange: s, name: c, filter: l = I, onInputChange: u, children: d }) {
35
+ let f = S(), [m, h] = E(`${f}-listbox`), [g, v] = E(!1), [y, x] = E(), [C = null, D] = r(e, t ?? null, i), [k = !1, M] = r(a, o, s), [P, F] = E(null), [R, z] = E(""), [B, V] = p(), [H, U] = E(null), W = T([]), G = T(null), K = n(u), q = b((e, t) => t === "" || l(e, t), [l]), { valuesByIndex: J, skippedIndices: Y, matchCount: X } = w(() => {
36
36
  let e = [], t = /* @__PURE__ */ new Set(), n = 0;
37
- return R.forEach((r, i) => {
37
+ return B.forEach((r, i) => {
38
38
  if (r.index === -1) return;
39
39
  e[r.index] = i;
40
- let a = W(r.label, P);
40
+ let a = q(r.label, R);
41
41
  a && (n += 1), (r.disabled || !a) && t.add(r.index);
42
42
  }), {
43
43
  valuesByIndex: e,
@@ -45,130 +45,132 @@ function H({ value: e, defaultValue: t, onValueChange: i, open: a, defaultOpen:
45
45
  matchCount: n
46
46
  };
47
47
  }, [
48
+ B,
48
49
  R,
49
- P,
50
- W
51
- ]), { refs: J, floatingStyles: Y, context: X } = _({
52
- open: C,
50
+ q
51
+ ]), { refs: ne, floatingStyles: Z, context: Q } = _({
52
+ open: k,
53
53
  placement: N,
54
- onOpenChange: (e) => D(e)
55
- }), Z = te(X, {
54
+ onOpenChange: (e) => M(e)
55
+ }), re = te(Q, {
56
56
  escapeKey: !0,
57
57
  outsidePress: !0
58
- }), re = j(X, {
59
- listRef: V,
60
- activeIndex: k,
61
- onNavigate: M,
58
+ }), ie = j(Q, {
59
+ listRef: W,
60
+ activeIndex: P,
61
+ onNavigate: F,
62
62
  virtual: !0,
63
63
  loop: !0,
64
- disabledIndices: (e) => K.has(e)
65
- }), { getReferenceProps: Q, getFloatingProps: $, getItemProps: ie } = A([Z, re]), ae = w(() => {
64
+ disabledIndices: (e) => Y.has(e)
65
+ }), { getReferenceProps: $, getFloatingProps: ae, getItemProps: oe } = A([re, ie]), se = w(() => {
66
66
  let e = (e) => {
67
- x(e), D(!1), H.current?.commitLabel(R.get(e)?.label ?? "");
67
+ D(e), M(!1), G.current?.commitLabel(B.get(e)?.label ?? "");
68
68
  };
69
69
  return {
70
70
  baseId: f,
71
71
  listId: m,
72
72
  setListId: h,
73
73
  setInputDisabled: v,
74
- open: C,
75
- selectedValue: y,
76
- activeIndex: k,
77
- options: R,
78
- matchCount: q,
79
- inputLabelling: B,
80
- inputHandleRef: H,
81
- refs: J,
82
- floatingStyles: Y,
83
- elementsRef: V,
84
- getReferenceProps: Q,
85
- getFloatingProps: $,
86
- getItemProps: ie,
87
- onInputChange: U,
88
- isVisible: (e) => W(e, P),
74
+ setInputForm: x,
75
+ open: k,
76
+ selectedValue: C,
77
+ activeIndex: P,
78
+ options: B,
79
+ matchCount: X,
80
+ inputLabelling: H,
81
+ inputHandleRef: G,
82
+ refs: ne,
83
+ floatingStyles: Z,
84
+ elementsRef: W,
85
+ getReferenceProps: $,
86
+ getFloatingProps: ae,
87
+ getItemProps: oe,
88
+ onInputChange: K,
89
+ isVisible: (e) => q(e, R),
89
90
  findMatches: (e) => {
90
91
  let t = 0, n = null, r = null;
91
- return R.forEach((i) => {
92
- i.index !== -1 && W(i.label, e) && (t += 1, !i.disabled && ((n === null || i.index < n) && (n = i.index), (r === null || i.index > r) && (r = i.index)));
92
+ return B.forEach((i) => {
93
+ i.index !== -1 && q(i.label, e) && (t += 1, !i.disabled && ((n === null || i.index < n) && (n = i.index), (r === null || i.index > r) && (r = i.index)));
93
94
  }), {
94
95
  count: t,
95
96
  first: n,
96
97
  last: r
97
98
  };
98
99
  },
99
- setQuery: F,
100
- setActiveIndex: M,
100
+ setQuery: z,
101
+ setActiveIndex: F,
101
102
  selectValue: e,
102
103
  selectIndex: (t) => {
103
- let n = G[t];
104
- n === void 0 || K.has(t) || e(n);
104
+ let n = J[t];
105
+ n === void 0 || Y.has(t) || e(n);
105
106
  },
106
- clearValue: () => x(null),
107
- requestOpenChange: D,
108
- registration: z,
109
- setInputLabelling: ne
107
+ clearValue: () => D(null),
108
+ requestOpenChange: M,
109
+ registration: V,
110
+ setInputLabelling: U
110
111
  };
111
112
  }, [
112
113
  f,
113
114
  m,
114
- C,
115
- y,
116
115
  k,
117
- R,
116
+ C,
118
117
  P,
119
- q,
120
118
  B,
121
- J,
122
- Y,
123
- Q,
119
+ R,
120
+ X,
121
+ H,
122
+ ne,
123
+ Z,
124
124
  $,
125
- ie,
126
- U,
127
- W,
128
- G,
125
+ ae,
126
+ oe,
129
127
  K,
130
- x,
128
+ q,
129
+ J,
130
+ Y,
131
131
  D,
132
- z
132
+ M,
133
+ V
133
134
  ]);
134
135
  return /* @__PURE__ */ ee(L.Provider, {
135
- value: ae,
136
+ value: se,
136
137
  children: [d, c !== void 0 && /* @__PURE__ */ O("input", {
137
138
  type: "hidden",
138
139
  name: c,
139
- value: y ?? "",
140
+ form: y,
141
+ value: C ?? "",
140
142
  disabled: g
141
143
  })]
142
144
  });
143
145
  }
144
- function U(e) {
145
- return /* @__PURE__ */ O(a, { children: /* @__PURE__ */ O(H, { ...e }) });
146
+ function W(e) {
147
+ return /* @__PURE__ */ O(a, { children: /* @__PURE__ */ O(U, { ...e }) });
146
148
  }
147
- U.displayName = "Combobox";
148
- function W({ ref: e, inputValue: t, defaultInputValue: n, label: a, description: o, error: s, size: c, slotProps: l, className: u, sx: d, id: f, onChange: p, onKeyDown: m, onBlur: h, disabled: g = !1, ..._ }) {
149
- let { listId: y, open: b, selectedValue: x, activeIndex: w, options: T, inputHandleRef: D, refs: ee, getReferenceProps: k, onInputChange: te, findMatches: A, setQuery: j, setActiveIndex: N, selectIndex: P, clearValue: F, requestOpenChange: I, setInputLabelling: L, setInputDisabled: R } = z("Input"), B = M([ee.setReference, e]), ne = S(), V = f ?? ne, H = `${V}-label`, U = i(a), W = _["aria-labelledby"], G = _["aria-label"], [K, q] = E(n), [J, Y] = E(() => (t ?? n) !== void 0), X = x === null ? void 0 : T.get(x)?.label, Z = t ?? (J ? K ?? "" : X ?? K ?? ""), [, re] = r(Z, void 0, te), Q = (e) => {
150
- re(e), t === void 0 && q(e);
151
- }, $ = t !== void 0 || J ? Z : "", ie = (e) => {
152
- Y(!1), Q(e);
149
+ W.displayName = "Combobox";
150
+ function G({ ref: e, inputValue: t, defaultInputValue: n, label: a, description: o, error: s, size: c, slotProps: l, className: u, sx: d, id: f, onChange: p, onKeyDown: m, onBlur: h, disabled: g = !1, ..._ }) {
151
+ let { listId: y, open: b, selectedValue: x, activeIndex: w, options: T, inputHandleRef: D, refs: ee, getReferenceProps: k, onInputChange: te, findMatches: A, setQuery: j, setActiveIndex: N, selectIndex: P, clearValue: F, requestOpenChange: I, setInputLabelling: L, setInputDisabled: R, setInputForm: B } = z("Input"), V = M([ee.setReference, e]), H = S(), U = f ?? H, W = `${U}-label`, G = i(a), K = _["aria-labelledby"], q = _["aria-label"], [J, Y] = E(n), [X, ne] = E(() => (t ?? n) !== void 0), Z = x === null ? void 0 : T.get(x)?.label, Q = t ?? (X ? J ?? "" : Z ?? J ?? ""), [, re] = r(Q, void 0, te), ie = (e) => {
152
+ re(e), t === void 0 && Y(e);
153
+ }, $ = t !== void 0 || X ? Q : "", ae = (e) => {
154
+ ne(!1), ie(e);
153
155
  };
154
156
  C(() => {
155
157
  j($);
156
- }, [$, j]), C(() => (R(g), () => R(!1)), [g, R]), C(() => (D.current = { commitLabel: ie }, () => {
158
+ }, [$, j]), C(() => (R(g), () => R(!1)), [g, R]), C(() => (B(_.form), () => B(void 0)), [_.form, B]), C(() => (D.current = { commitLabel: ae }, () => {
157
159
  D.current = null;
158
- })), C(() => (L(W !== void 0 || !U ? {
159
- labelledBy: W,
160
- label: G
161
- } : { labelledBy: H }), () => L(null)), [
162
- W,
160
+ })), C(() => (L(K !== void 0 || !G ? {
161
+ labelledBy: K,
162
+ label: q
163
+ } : { labelledBy: W }), () => L(null)), [
164
+ K,
165
+ q,
163
166
  G,
164
- U,
165
- H,
167
+ W,
166
168
  L
167
169
  ]);
168
- let ae = (e) => {
170
+ let oe = (e) => {
169
171
  p?.(e);
170
172
  let n = e.currentTarget.value;
171
- Y(!0), Q(n), n === "" && F();
173
+ ne(!0), ie(n), n === "" && F();
172
174
  let r = t ?? n;
173
175
  if (r === "") {
174
176
  N(null), I(!1);
@@ -176,9 +178,9 @@ function W({ ref: e, inputValue: t, defaultInputValue: n, label: a, description:
176
178
  }
177
179
  let i = A(r);
178
180
  N(i.first), i.count > 0 && I(!0);
179
- }, oe = (e) => {
181
+ }, se = (e) => {
180
182
  if (m?.(e), !e.defaultPrevented) {
181
- if (e.key === "Escape") J && X !== void 0 && ie(X);
183
+ if (e.key === "Escape") X && Z !== void 0 && ae(Z);
182
184
  else if (b) {
183
185
  if (e.key === "Enter" && w !== null) e.preventDefault(), P(w);
184
186
  else if (e.key === "Home" || e.key === "End") {
@@ -188,19 +190,22 @@ function W({ ref: e, inputValue: t, defaultInputValue: n, label: a, description:
188
190
  }
189
191
  }
190
192
  }
191
- }, se = (e) => {
193
+ }, ce = (e) => {
192
194
  h?.(e), b && I(!1);
193
- };
195
+ }, le = k({
196
+ ..._,
197
+ onKeyDown: se,
198
+ onBlur: ce
199
+ });
194
200
  return /* @__PURE__ */ O(v, {
195
- ...k({
196
- ..._,
197
- onKeyDown: oe,
198
- onBlur: se
199
- }),
200
- ref: B,
201
- id: V,
202
- label: U ? /* @__PURE__ */ O("span", {
203
- id: H,
201
+ ...le,
202
+ onKeyDown: (e) => {
203
+ e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229 ? m?.(e) : le.onKeyDown?.(e);
204
+ },
205
+ ref: V,
206
+ id: U,
207
+ label: G ? /* @__PURE__ */ O("span", {
208
+ id: W,
204
209
  children: a
205
210
  }) : a,
206
211
  description: o,
@@ -209,9 +214,9 @@ function W({ ref: e, inputValue: t, defaultInputValue: n, label: a, description:
209
214
  slotProps: l,
210
215
  className: u,
211
216
  sx: d,
212
- value: Z,
217
+ value: Q,
213
218
  disabled: g,
214
- onChange: ae,
219
+ onChange: oe,
215
220
  role: "combobox",
216
221
  autoComplete: "off",
217
222
  "aria-autocomplete": "list",
@@ -221,8 +226,8 @@ function W({ ref: e, inputValue: t, defaultInputValue: n, label: a, description:
221
226
  "data-ui": "combobox-input"
222
227
  });
223
228
  }
224
- W.displayName = "Combobox.Input";
225
- function G({ ref: e, id: n, style: r, onMouseDown: i, children: a, className: o, sx: s, ...c }) {
229
+ G.displayName = "Combobox.Input";
230
+ function K({ ref: e, id: n, style: r, onMouseDown: i, children: a, className: o, sx: s, ...c }) {
226
231
  let { baseId: u, setListId: f, open: p, inputLabelling: m, refs: h, floatingStyles: _, elementsRef: v, getFloatingProps: y } = z("List"), b = n ?? `${u}-listbox`;
227
232
  C(() => (f(b), () => f(`${u}-listbox`)), [
228
233
  u,
@@ -263,8 +268,8 @@ function G({ ref: e, id: n, style: r, onMouseDown: i, children: a, className: o,
263
268
  })
264
269
  }) });
265
270
  }
266
- G.displayName = "Combobox.List";
267
- function K({ ref: e, value: n, disabled: r = !1, onClick: i, children: a, className: l, sx: d, ...p }) {
271
+ K.displayName = "Combobox.List";
272
+ function q({ ref: e, value: n, disabled: r = !1, onClick: i, children: a, className: l, sx: d, ...p }) {
268
273
  let { baseId: g, selectedValue: _, activeIndex: v, options: y, isVisible: b, getItemProps: x, selectValue: S, registration: C } = B("Item"), w = T(null), { ref: E, index: D } = m(n, C, w, (e, t) => ({
269
274
  index: e,
270
275
  label: t,
@@ -278,7 +283,7 @@ function K({ ref: e, value: n, disabled: r = !1, onClick: i, children: a, classN
278
283
  c,
279
284
  f,
280
285
  s,
281
- ne
286
+ V
282
287
  ],
283
288
  sx: d,
284
289
  children: (e) => /* @__PURE__ */ ee("div", {
@@ -307,12 +312,12 @@ function K({ ref: e, value: n, disabled: r = !1, onClick: i, children: a, classN
307
312
  })
308
313
  });
309
314
  }
310
- K.displayName = "Combobox.Item";
311
- function q({ ref: e, children: n, className: r, sx: a, ...o }) {
315
+ q.displayName = "Combobox.Item";
316
+ function J({ ref: e, children: n, className: r, sx: a, ...o }) {
312
317
  let { matchCount: s } = B("Empty");
313
318
  return s > 0 ? null : /* @__PURE__ */ O(t, {
314
319
  className: r,
315
- styles: V,
320
+ styles: H,
316
321
  sx: a,
317
322
  children: (t) => /* @__PURE__ */ O("div", {
318
323
  ...o,
@@ -323,12 +328,12 @@ function q({ ref: e, children: n, className: r, sx: a, ...o }) {
323
328
  })
324
329
  });
325
330
  }
326
- q.displayName = "Combobox.Empty";
327
- var J = Object.assign(U, {
328
- Input: W,
329
- List: G,
330
- Item: K,
331
- Empty: q
331
+ J.displayName = "Combobox.Empty";
332
+ var Y = Object.assign(W, {
333
+ Input: G,
334
+ List: K,
335
+ Item: q,
336
+ Empty: J
332
337
  });
333
338
  //#endregion
334
- export { J as t };
339
+ export { Y as t };
package/dist/combobox.js CHANGED
@@ -1,2 +1,2 @@
1
1
  'use client';
2
- export { t as Combobox } from "./combobox-Bhzvu9ma.js";
2
+ export { t as Combobox } from "./combobox-DFFqOBCi.js";