@bearmenu/ui 0.5.2 → 0.6.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 (223) hide show
  1. package/dist/{chunk-ERMIA7NP.js → chunk-7PPCH42H.js} +3 -3
  2. package/dist/{chunk-HLQ2IRE7.js → chunk-BAZFVSSG.js} +3 -3
  3. package/dist/chunk-D5QHEHXJ.js +26 -0
  4. package/dist/{chunk-UISA4CIG.js → chunk-N2KNBPAQ.js} +2 -2
  5. package/dist/{chunk-7H54PTVH.js → chunk-PSR7N36A.js} +38 -10
  6. package/dist/chunk-RIDXFY6M.js +38 -0
  7. package/dist/chunk-UUJVXN2O.js +82 -0
  8. package/dist/chunk-WKMLZDUT.js +122 -0
  9. package/dist/chunk-XK2ZDQVE.js +122 -0
  10. package/dist/{chunk-4KOMHDZD.js → chunk-Y5D5LP4A.js} +18 -3
  11. package/dist/chunk-YJ6OBKZJ.js +32 -0
  12. package/dist/{chunk-ESO2EM3L.js → chunk-ZBBUKXM5.js} +2 -2
  13. package/dist/chunk-ZFNOCP6W.js +106 -0
  14. package/dist/components/accordion.js +11 -5
  15. package/dist/components/alert-dialog.js +5 -3
  16. package/dist/components/alert.d.ts +5 -2
  17. package/dist/components/alert.js +25 -9
  18. package/dist/components/avatar.d.ts +17 -2
  19. package/dist/components/avatar.js +91 -12
  20. package/dist/components/badge.d.ts +1 -1
  21. package/dist/components/badge.js +1 -1
  22. package/dist/components/breadcrumb.js +5 -2
  23. package/dist/components/button-group.d.ts +14 -0
  24. package/dist/components/button-group.js +39 -0
  25. package/dist/components/button.d.ts +4 -2
  26. package/dist/components/button.js +1 -1
  27. package/dist/components/calendar.js +3 -3
  28. package/dist/components/card.d.ts +13 -5
  29. package/dist/components/card.js +2 -2
  30. package/dist/components/carousel.d.ts +20 -3
  31. package/dist/components/carousel.js +72 -12
  32. package/dist/components/checkbox.js +1 -1
  33. package/dist/components/circular-progress.d.ts +16 -0
  34. package/dist/components/circular-progress.js +105 -0
  35. package/dist/components/combobox.d.ts +27 -0
  36. package/dist/components/combobox.js +102 -0
  37. package/dist/components/command.d.ts +29 -16
  38. package/dist/components/command.js +2 -2
  39. package/dist/components/currency-input.d.ts +1 -0
  40. package/dist/components/currency-input.js +73 -52
  41. package/dist/components/date-input.d.ts +10 -0
  42. package/dist/components/date-input.js +40 -0
  43. package/dist/components/description-list.d.ts +15 -0
  44. package/dist/components/description-list.js +67 -0
  45. package/dist/components/dialog.d.ts +13 -2
  46. package/dist/components/dialog.js +1 -1
  47. package/dist/components/drawer.d.ts +5 -2
  48. package/dist/components/drawer.js +47 -9
  49. package/dist/components/dropdown-menu.d.ts +7 -2
  50. package/dist/components/dropdown-menu.js +22 -6
  51. package/dist/components/empty-state.js +2 -2
  52. package/dist/components/field.d.ts +22 -0
  53. package/dist/components/field.js +130 -0
  54. package/dist/components/form.d.ts +2 -1
  55. package/dist/components/form.js +11 -1
  56. package/dist/components/haptic-button.js +3 -3
  57. package/dist/components/input-group.d.ts +18 -0
  58. package/dist/components/input-group.js +92 -0
  59. package/dist/components/input.d.ts +8 -2
  60. package/dist/components/input.js +1 -1
  61. package/dist/components/item.d.ts +23 -0
  62. package/dist/components/item.js +120 -0
  63. package/dist/components/kbd.d.ts +13 -0
  64. package/dist/components/kbd.js +49 -0
  65. package/dist/components/lazy-markdown.d.ts +3 -1
  66. package/dist/components/lazy-markdown.js +7 -7
  67. package/dist/components/link-button.js +1 -1
  68. package/dist/components/multi-select-combobox.js +92 -83
  69. package/dist/components/multi-select-menu.d.ts +0 -4
  70. package/dist/components/multi-select-menu.js +28 -17
  71. package/dist/components/native-select.d.ts +12 -0
  72. package/dist/components/native-select.js +49 -0
  73. package/dist/components/pagination.d.ts +5 -2
  74. package/dist/components/pagination.js +66 -7
  75. package/dist/components/place-about-tab.js +4 -4
  76. package/dist/components/place-card.js +1 -1
  77. package/dist/components/place-details-mobile.js +4 -4
  78. package/dist/components/popover.d.ts +7 -1
  79. package/dist/components/popover.js +1 -1
  80. package/dist/components/progress.d.ts +5 -1
  81. package/dist/components/progress.js +17 -3
  82. package/dist/components/radio-group.js +12 -3
  83. package/dist/components/rating.d.ts +2 -0
  84. package/dist/components/rating.js +88 -70
  85. package/dist/components/search-bar.d.ts +1 -2
  86. package/dist/components/search-bar.js +37 -60
  87. package/dist/components/searchable-select.js +76 -72
  88. package/dist/components/select.d.ts +5 -1
  89. package/dist/components/select.js +30 -14
  90. package/dist/components/selection-bar.d.ts +11 -0
  91. package/dist/components/selection-bar.js +65 -0
  92. package/dist/components/separator.js +3 -2
  93. package/dist/components/sheet.d.ts +1 -1
  94. package/dist/components/sheet.js +1 -1
  95. package/dist/components/skeleton-card.js +1 -1
  96. package/dist/components/skeleton.js +1 -1
  97. package/dist/components/slider.js +21 -4
  98. package/dist/components/sliding-panels.js +9 -6
  99. package/dist/components/spinner.d.ts +17 -0
  100. package/dist/components/spinner.js +50 -0
  101. package/dist/components/stepper.d.ts +18 -0
  102. package/dist/components/stepper.js +199 -0
  103. package/dist/components/switch.js +4 -3
  104. package/dist/components/table.d.ts +23 -5
  105. package/dist/components/table.js +121 -35
  106. package/dist/components/tabs.d.ts +3 -1
  107. package/dist/components/tabs.js +37 -9
  108. package/dist/components/tag-group.d.ts +9 -0
  109. package/dist/components/tag-group.js +26 -0
  110. package/dist/components/tag.d.ts +17 -0
  111. package/dist/components/tag.js +61 -0
  112. package/dist/components/text.d.ts +3 -3
  113. package/dist/components/text.js +1 -1
  114. package/dist/components/textarea.js +2 -1
  115. package/dist/components/toast.js +1 -1
  116. package/dist/components/toaster.js +1 -1
  117. package/dist/components/toggle-group.js +1 -1
  118. package/dist/components/toggle.js +1 -1
  119. package/dist/components/tooltip.d.ts +3 -2
  120. package/dist/components/tooltip.js +16 -2
  121. package/package.json +44 -26
  122. package/src/components/accordion.tsx +11 -6
  123. package/src/components/alert-dialog.tsx +4 -2
  124. package/src/components/alert.tsx +20 -8
  125. package/src/components/avatar.tsx +106 -13
  126. package/src/components/badge.tsx +12 -11
  127. package/src/components/breadcrumb.tsx +5 -2
  128. package/src/components/button-group.stories.tsx +52 -0
  129. package/src/components/button-group.tsx +40 -0
  130. package/src/components/button.test.tsx +174 -0
  131. package/src/components/button.tsx +42 -19
  132. package/src/components/calendar.tsx +2 -2
  133. package/src/components/card.tsx +55 -13
  134. package/src/components/carousel.tsx +85 -13
  135. package/src/components/checkbox.test.tsx +58 -0
  136. package/src/components/checkbox.tsx +8 -3
  137. package/src/components/circular-progress.stories.tsx +39 -0
  138. package/src/components/circular-progress.tsx +102 -0
  139. package/src/components/collapsible.stories.tsx +7 -3
  140. package/src/components/combobox.stories.tsx +82 -0
  141. package/src/components/combobox.test.tsx +118 -0
  142. package/src/components/combobox.tsx +136 -0
  143. package/src/components/command.test.tsx +91 -0
  144. package/src/components/command.tsx +38 -15
  145. package/src/components/currency-input.test.tsx +63 -0
  146. package/src/components/currency-input.tsx +84 -66
  147. package/src/components/date-input.stories.tsx +31 -0
  148. package/src/components/date-input.tsx +43 -0
  149. package/src/components/description-list.stories.tsx +62 -0
  150. package/src/components/description-list.tsx +68 -0
  151. package/src/components/dialog.test.tsx +84 -0
  152. package/src/components/dialog.tsx +64 -24
  153. package/src/components/drawer.tsx +72 -23
  154. package/src/components/dropdown-menu.test.tsx +180 -0
  155. package/src/components/dropdown-menu.tsx +31 -6
  156. package/src/components/field.stories.tsx +36 -0
  157. package/src/components/field.test.tsx +157 -0
  158. package/src/components/field.tsx +146 -0
  159. package/src/components/form.stories.tsx +3 -2
  160. package/src/components/form.test.tsx +95 -0
  161. package/src/components/form.tsx +9 -0
  162. package/src/components/haptic-button.tsx +1 -1
  163. package/src/components/input-group.stories.tsx +61 -0
  164. package/src/components/input-group.tsx +99 -0
  165. package/src/components/input.test.tsx +103 -0
  166. package/src/components/input.tsx +24 -7
  167. package/src/components/item.stories.tsx +52 -0
  168. package/src/components/item.tsx +115 -0
  169. package/src/components/kbd.stories.tsx +33 -0
  170. package/src/components/kbd.tsx +46 -0
  171. package/src/components/lazy-markdown.tsx +10 -7
  172. package/src/components/multi-select-combobox.test.tsx +101 -0
  173. package/src/components/multi-select-combobox.tsx +85 -82
  174. package/src/components/multi-select-menu.tsx +49 -41
  175. package/src/components/native-select.stories.tsx +52 -0
  176. package/src/components/native-select.tsx +45 -0
  177. package/src/components/pagination.tsx +64 -5
  178. package/src/components/popover.tsx +66 -3
  179. package/src/components/progress.tsx +27 -4
  180. package/src/components/radio-group.test.tsx +64 -0
  181. package/src/components/radio-group.tsx +11 -3
  182. package/src/components/rating.test.tsx +112 -0
  183. package/src/components/rating.tsx +97 -82
  184. package/src/components/search-bar.stories.tsx +1 -32
  185. package/src/components/search-bar.tsx +22 -59
  186. package/src/components/searchable-select.tsx +69 -73
  187. package/src/components/select.tsx +34 -19
  188. package/src/components/selection-bar.stories.tsx +37 -0
  189. package/src/components/selection-bar.tsx +65 -0
  190. package/src/components/separator.tsx +5 -2
  191. package/src/components/sheet.tsx +1 -1
  192. package/src/components/skeleton.tsx +2 -2
  193. package/src/components/slider.test.tsx +45 -0
  194. package/src/components/slider.tsx +31 -12
  195. package/src/components/sliding-panels.tsx +8 -5
  196. package/src/components/spinner.stories.tsx +35 -0
  197. package/src/components/spinner.tsx +50 -0
  198. package/src/components/stepper.stories.tsx +71 -0
  199. package/src/components/stepper.tsx +220 -0
  200. package/src/components/switch.test.tsx +52 -0
  201. package/src/components/switch.tsx +4 -3
  202. package/src/components/table.tsx +140 -35
  203. package/src/components/tabs.test.tsx +107 -0
  204. package/src/components/tabs.tsx +70 -23
  205. package/src/components/tag-group.stories.tsx +39 -0
  206. package/src/components/tag-group.tsx +28 -0
  207. package/src/components/tag.stories.tsx +50 -0
  208. package/src/components/tag.tsx +63 -0
  209. package/src/components/text.test.tsx +1 -1
  210. package/src/components/text.tsx +19 -3
  211. package/src/components/textarea.test.tsx +48 -0
  212. package/src/components/textarea.tsx +2 -1
  213. package/src/components/toast.tsx +4 -3
  214. package/src/components/toggle.tsx +2 -2
  215. package/src/components/tooltip.tsx +12 -2
  216. package/src/globals.css +126 -90
  217. package/dist/chunk-2BMJRXQX.js +0 -80
  218. package/dist/chunk-4AVS6CV4.js +0 -89
  219. package/dist/chunk-4UO73SKC.js +0 -26
  220. package/dist/chunk-CW24PLDW.js +0 -24
  221. package/dist/chunk-IQASCH2V.js +0 -25
  222. package/dist/chunk-NKHH23YK.js +0 -31
  223. package/dist/chunk-QJ54Z7TC.js +0 -83
@@ -1,4 +1,4 @@
1
- import { Button } from '../chunk-2BMJRXQX.js';
1
+ import { Button } from '../chunk-ZFNOCP6W.js';
2
2
  import '../chunk-R47NEOSI.js';
3
3
  import { cn } from '../chunk-FEK5XGZW.js';
4
4
  import { __objRest, __spreadProps, __spreadValues } from '../chunk-3GWWZKX7.js';
@@ -21,6 +21,7 @@ function Carousel(_a) {
21
21
  opts,
22
22
  setApi,
23
23
  plugins,
24
+ gap = 16,
24
25
  className,
25
26
  children
26
27
  } = _b, props = __objRest(_b, [
@@ -28,6 +29,7 @@ function Carousel(_a) {
28
29
  "opts",
29
30
  "setApi",
30
31
  "plugins",
32
+ "gap",
31
33
  "className",
32
34
  "children"
33
35
  ]);
@@ -39,10 +41,14 @@ function Carousel(_a) {
39
41
  );
40
42
  const [canScrollPrev, setCanScrollPrev] = React.useState(false);
41
43
  const [canScrollNext, setCanScrollNext] = React.useState(false);
44
+ const [selectedIndex, setSelectedIndex] = React.useState(0);
45
+ const [slideCount, setSlideCount] = React.useState(0);
42
46
  const onSelect = React.useCallback((api2) => {
43
47
  if (!api2) return;
44
48
  setCanScrollPrev(api2.canScrollPrev());
45
49
  setCanScrollNext(api2.canScrollNext());
50
+ setSelectedIndex(api2.selectedScrollSnap());
51
+ setSlideCount(api2.scrollSnapList().length);
46
52
  }, []);
47
53
  const scrollPrev = React.useCallback(() => {
48
54
  api == null ? void 0 : api.scrollPrev();
@@ -50,6 +56,12 @@ function Carousel(_a) {
50
56
  const scrollNext = React.useCallback(() => {
51
57
  api == null ? void 0 : api.scrollNext();
52
58
  }, [api]);
59
+ const scrollTo = React.useCallback(
60
+ (index) => {
61
+ api == null ? void 0 : api.scrollTo(index);
62
+ },
63
+ [api]
64
+ );
53
65
  const handleKeyDown = React.useCallback(
54
66
  (event) => {
55
67
  if (event.key === "ArrowLeft") {
@@ -83,10 +95,14 @@ function Carousel(_a) {
83
95
  api,
84
96
  opts,
85
97
  orientation: orientation || ((opts == null ? void 0 : opts.axis) === "y" ? "vertical" : "horizontal"),
98
+ gap,
86
99
  scrollPrev,
87
100
  scrollNext,
101
+ scrollTo,
88
102
  canScrollPrev,
89
- canScrollNext
103
+ canScrollNext,
104
+ selectedIndex,
105
+ slideCount
90
106
  },
91
107
  children: /* @__PURE__ */ jsx(
92
108
  "div",
@@ -105,28 +121,26 @@ function Carousel(_a) {
105
121
  }
106
122
  function CarouselContent(_a) {
107
123
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
108
- const { carouselRef, orientation } = useCarousel();
124
+ const { carouselRef, orientation, gap } = useCarousel();
109
125
  return /* @__PURE__ */ jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: /* @__PURE__ */ jsx(
110
126
  "div",
111
127
  __spreadValues({
112
- className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className)
128
+ className: cn("flex", orientation === "horizontal" ? "" : "flex-col", className),
129
+ style: orientation === "horizontal" ? { marginLeft: `-${gap}px` } : { marginTop: `-${gap}px` }
113
130
  }, props)
114
131
  ) });
115
132
  }
116
133
  function CarouselItem(_a) {
117
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
118
- const { orientation } = useCarousel();
134
+ var _b = _a, { className, style } = _b, props = __objRest(_b, ["className", "style"]);
135
+ const { orientation, gap } = useCarousel();
119
136
  return /* @__PURE__ */ jsx(
120
137
  "div",
121
138
  __spreadValues({
122
139
  role: "group",
123
140
  "aria-roledescription": "slide",
124
141
  "data-slot": "carousel-item",
125
- className: cn(
126
- "min-w-0 shrink-0 grow-0 basis-full",
127
- orientation === "horizontal" ? "pl-4" : "pt-4",
128
- className
129
- )
142
+ className: cn("min-w-0 shrink-0 grow-0 basis-full", className),
143
+ style: __spreadValues(__spreadValues({}, orientation === "horizontal" ? { paddingLeft: `${gap}px` } : { paddingTop: `${gap}px` }), style)
130
144
  }, props)
131
145
  );
132
146
  }
@@ -194,5 +208,51 @@ function CarouselNext(_a) {
194
208
  })
195
209
  );
196
210
  }
211
+ function CarouselDots(_a) {
212
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
213
+ const { slideCount, selectedIndex, scrollTo } = useCarousel();
214
+ if (slideCount === 0) return null;
215
+ return /* @__PURE__ */ jsx(
216
+ "div",
217
+ __spreadProps(__spreadValues({
218
+ "data-slot": "carousel-dots",
219
+ className: cn("flex items-center justify-center gap-1.5", className)
220
+ }, props), {
221
+ children: Array.from({ length: slideCount }).map((_, i) => /* @__PURE__ */ jsx(
222
+ "button",
223
+ {
224
+ type: "button",
225
+ "aria-label": `Go to slide ${i + 1}`,
226
+ "aria-current": i === selectedIndex ? "true" : void 0,
227
+ onClick: () => scrollTo(i),
228
+ className: cn(
229
+ "size-2 rounded-full transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
230
+ i === selectedIndex ? "w-6 bg-primary" : "bg-muted-foreground/30 hover:bg-muted-foreground/50"
231
+ )
232
+ },
233
+ i
234
+ ))
235
+ })
236
+ );
237
+ }
238
+ function CarouselCounter(_a) {
239
+ var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
240
+ const { slideCount, selectedIndex } = useCarousel();
241
+ if (slideCount === 0) return null;
242
+ return /* @__PURE__ */ jsxs(
243
+ "div",
244
+ __spreadProps(__spreadValues({
245
+ "data-slot": "carousel-counter",
246
+ "aria-live": "polite",
247
+ className: cn("text-xs tabular-nums text-muted-foreground", className)
248
+ }, props), {
249
+ children: [
250
+ selectedIndex + 1,
251
+ " / ",
252
+ slideCount
253
+ ]
254
+ })
255
+ );
256
+ }
197
257
 
198
- export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious };
258
+ export { Carousel, CarouselContent, CarouselCounter, CarouselDots, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
@@ -1,3 +1,3 @@
1
- export { Checkbox } from '../chunk-IQASCH2V.js';
1
+ export { Checkbox } from '../chunk-D5QHEHXJ.js';
2
2
  import '../chunk-FEK5XGZW.js';
3
3
  import '../chunk-3GWWZKX7.js';
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+
3
+ declare const CircularProgress: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
4
+ value?: number;
5
+ max?: number;
6
+ size?: number;
7
+ strokeWidth?: number;
8
+ tone?: "primary" | "success" | "warning" | "destructive";
9
+ showLabel?: boolean;
10
+ /** Indeterminate spinner mode. */
11
+ indeterminate?: boolean;
12
+ /** Accessible label. Defaults to "Progress". */
13
+ label?: string;
14
+ } & React.RefAttributes<HTMLDivElement>>;
15
+
16
+ export { CircularProgress };
@@ -0,0 +1,105 @@
1
+ import { cn } from '../chunk-FEK5XGZW.js';
2
+ import { __objRest, __spreadProps, __spreadValues } from '../chunk-3GWWZKX7.js';
3
+ import * as React from 'react';
4
+ import { jsxs, jsx } from 'react/jsx-runtime';
5
+
6
+ var toneClasses = {
7
+ primary: "stroke-primary",
8
+ success: "stroke-success",
9
+ warning: "stroke-warning",
10
+ destructive: "stroke-destructive"
11
+ };
12
+ var CircularProgress = React.forwardRef(
13
+ (_a, ref) => {
14
+ var _b = _a, {
15
+ className,
16
+ value = 0,
17
+ max = 100,
18
+ size = 40,
19
+ strokeWidth = 4,
20
+ tone = "primary",
21
+ showLabel = false,
22
+ indeterminate = false,
23
+ label = "Progress"
24
+ } = _b, props = __objRest(_b, [
25
+ "className",
26
+ "value",
27
+ "max",
28
+ "size",
29
+ "strokeWidth",
30
+ "tone",
31
+ "showLabel",
32
+ "indeterminate",
33
+ "label"
34
+ ]);
35
+ const radius = (size - strokeWidth) / 2;
36
+ const circumference = 2 * Math.PI * radius;
37
+ const clampedValue = Math.min(Math.max(value, 0), max);
38
+ const percent = clampedValue / max * 100;
39
+ const dashOffset = circumference - circumference * percent / 100;
40
+ return /* @__PURE__ */ jsxs(
41
+ "div",
42
+ __spreadProps(__spreadValues({
43
+ ref,
44
+ "data-slot": "circular-progress",
45
+ role: "progressbar",
46
+ "aria-valuemin": 0,
47
+ "aria-valuemax": max,
48
+ "aria-valuenow": indeterminate ? void 0 : clampedValue,
49
+ "aria-label": label,
50
+ className: cn("relative inline-flex shrink-0 items-center justify-center", className),
51
+ style: { width: size, height: size }
52
+ }, props), {
53
+ children: [
54
+ /* @__PURE__ */ jsxs(
55
+ "svg",
56
+ {
57
+ width: size,
58
+ height: size,
59
+ viewBox: `0 0 ${size} ${size}`,
60
+ className: cn(indeterminate && "animate-spin"),
61
+ children: [
62
+ /* @__PURE__ */ jsx(
63
+ "circle",
64
+ {
65
+ cx: size / 2,
66
+ cy: size / 2,
67
+ r: radius,
68
+ strokeWidth,
69
+ fill: "none",
70
+ className: "stroke-muted"
71
+ }
72
+ ),
73
+ /* @__PURE__ */ jsx(
74
+ "circle",
75
+ {
76
+ cx: size / 2,
77
+ cy: size / 2,
78
+ r: radius,
79
+ strokeWidth,
80
+ fill: "none",
81
+ strokeLinecap: "round",
82
+ className: cn("transition-[stroke-dashoffset] duration-300 ease-out", toneClasses[tone]),
83
+ style: {
84
+ strokeDasharray: circumference,
85
+ strokeDashoffset: indeterminate ? circumference * 0.75 : dashOffset,
86
+ transform: `rotate(-90deg)`,
87
+ transformOrigin: `${size / 2}px ${size / 2}px`
88
+ }
89
+ }
90
+ )
91
+ ]
92
+ }
93
+ ),
94
+ showLabel && !indeterminate && /* @__PURE__ */ jsxs("span", { className: "absolute text-xs font-medium tabular-nums text-foreground", children: [
95
+ Math.round(percent),
96
+ "%"
97
+ ] })
98
+ ]
99
+ })
100
+ );
101
+ }
102
+ );
103
+ CircularProgress.displayName = "CircularProgress";
104
+
105
+ export { CircularProgress };
@@ -0,0 +1,27 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+
3
+ interface ComboboxOption {
4
+ value: string;
5
+ label: string;
6
+ description?: string;
7
+ disabled?: boolean;
8
+ }
9
+ interface ComboboxProps {
10
+ options: ComboboxOption[];
11
+ value: string | undefined;
12
+ onValueChange: (value: string | undefined) => void;
13
+ placeholder?: string;
14
+ searchPlaceholder?: string;
15
+ emptyText?: string;
16
+ loadingText?: string;
17
+ className?: string;
18
+ disabled?: boolean;
19
+ loading?: boolean;
20
+ /** Allow clearing the selection. Defaults to true. */
21
+ clearable?: boolean;
22
+ /** If set, external search drives the option list (controlled). */
23
+ onSearchChange?: (search: string) => void;
24
+ }
25
+ declare function Combobox({ options, value, onValueChange, placeholder, searchPlaceholder, emptyText, loadingText, className, disabled, loading, clearable, onSearchChange, }: ComboboxProps): react_jsx_runtime.JSX.Element;
26
+
27
+ export { Combobox, type ComboboxOption };
@@ -0,0 +1,102 @@
1
+ import { Popover, PopoverTrigger, PopoverContent } from '../chunk-UUJVXN2O.js';
2
+ import { Command, CommandInput, CommandList, CommandLoading, CommandEmpty, CommandGroup, CommandItem } from '../chunk-PSR7N36A.js';
3
+ import '../chunk-WKMLZDUT.js';
4
+ import { Button } from '../chunk-ZFNOCP6W.js';
5
+ import '../chunk-R47NEOSI.js';
6
+ import { cn } from '../chunk-FEK5XGZW.js';
7
+ import '../chunk-3GWWZKX7.js';
8
+ import * as React from 'react';
9
+ import { ChevronsUpDown, Check, X } from 'lucide-react';
10
+ import { jsxs, jsx } from 'react/jsx-runtime';
11
+
12
+ function Combobox({
13
+ options,
14
+ value,
15
+ onValueChange,
16
+ placeholder = "Select...",
17
+ searchPlaceholder = "Search...",
18
+ emptyText = "No results.",
19
+ loadingText = "Loading\u2026",
20
+ className,
21
+ disabled = false,
22
+ loading = false,
23
+ clearable = true,
24
+ onSearchChange
25
+ }) {
26
+ const [open, setOpen] = React.useState(false);
27
+ const selected = options.find((o) => o.value === value);
28
+ return /* @__PURE__ */ jsxs("div", { className: cn("relative", className), children: [
29
+ /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
30
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
31
+ Button,
32
+ {
33
+ variant: "outline",
34
+ role: "combobox",
35
+ "aria-expanded": open,
36
+ "aria-haspopup": "listbox",
37
+ disabled,
38
+ className: cn("w-full justify-between font-normal", !selected && "text-muted-foreground", value && clearable && !disabled && "pr-16"),
39
+ children: [
40
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: (selected == null ? void 0 : selected.label) || placeholder }),
41
+ /* @__PURE__ */ jsx(ChevronsUpDown, { className: "size-4 shrink-0 opacity-50" })
42
+ ]
43
+ }
44
+ ) }),
45
+ /* @__PURE__ */ jsx(
46
+ PopoverContent,
47
+ {
48
+ align: "start",
49
+ className: "w-[var(--radix-popover-trigger-width)] p-0",
50
+ children: /* @__PURE__ */ jsxs(Command, { shouldFilter: !onSearchChange, children: [
51
+ /* @__PURE__ */ jsx(CommandInput, { placeholder: searchPlaceholder, onValueChange: onSearchChange }),
52
+ /* @__PURE__ */ jsxs(CommandList, { children: [
53
+ loading ? /* @__PURE__ */ jsx(CommandLoading, { children: loadingText }) : /* @__PURE__ */ jsx(CommandEmpty, { children: emptyText }),
54
+ /* @__PURE__ */ jsx(CommandGroup, { children: options.map((option) => /* @__PURE__ */ jsxs(
55
+ CommandItem,
56
+ {
57
+ value: option.value,
58
+ disabled: option.disabled,
59
+ onSelect: () => {
60
+ onValueChange(option.value === value ? void 0 : option.value);
61
+ setOpen(false);
62
+ },
63
+ children: [
64
+ /* @__PURE__ */ jsx(
65
+ Check,
66
+ {
67
+ className: cn(
68
+ "mr-2 size-4",
69
+ value === option.value ? "opacity-100" : "opacity-0"
70
+ )
71
+ }
72
+ ),
73
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
74
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: option.label }),
75
+ option.description && /* @__PURE__ */ jsx("span", { className: "truncate text-xs text-muted-foreground", children: option.description })
76
+ ] })
77
+ ]
78
+ },
79
+ option.value
80
+ )) })
81
+ ] })
82
+ ] })
83
+ }
84
+ )
85
+ ] }),
86
+ value && clearable && !disabled && /* @__PURE__ */ jsx(
87
+ "button",
88
+ {
89
+ type: "button",
90
+ "aria-label": "Clear selection",
91
+ onClick: (e) => {
92
+ e.stopPropagation();
93
+ onValueChange(void 0);
94
+ },
95
+ className: "absolute right-9 top-1/2 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
96
+ children: /* @__PURE__ */ jsx(X, { className: "size-3.5" })
97
+ }
98
+ )
99
+ ] });
100
+ }
101
+
102
+ export { Combobox };
@@ -4,11 +4,11 @@ import { DialogProps } from '@radix-ui/react-dialog';
4
4
 
5
5
  declare const Command: React.ForwardRefExoticComponent<Omit<{
6
6
  children?: React.ReactNode;
7
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
7
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
8
8
  ref?: React.Ref<HTMLDivElement>;
9
9
  } & {
10
10
  asChild?: boolean;
11
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
11
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key"> & {
12
12
  label?: string;
13
13
  shouldFilter?: boolean;
14
14
  filter?: (value: string, search: string, keywords?: string[]) => number;
@@ -19,57 +19,70 @@ declare const Command: React.ForwardRefExoticComponent<Omit<{
19
19
  disablePointerSelection?: boolean;
20
20
  vimBindings?: boolean;
21
21
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
22
- type CommandDialogProps = DialogProps;
23
- declare const CommandDialog: ({ children, ...props }: CommandDialogProps) => react_jsx_runtime.JSX.Element;
22
+ type CommandDialogProps = DialogProps & {
23
+ title?: string;
24
+ description?: string;
25
+ };
26
+ declare const CommandDialog: ({ title, description, children, ...props }: CommandDialogProps) => react_jsx_runtime.JSX.Element;
24
27
  declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
25
28
  ref?: React.Ref<HTMLInputElement>;
26
29
  } & {
27
30
  asChild?: boolean;
28
- }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
31
+ }, "asChild" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "type" | "value"> & {
29
32
  value?: string;
30
33
  onValueChange?: (search: string) => void;
31
34
  } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
32
35
  declare const CommandList: React.ForwardRefExoticComponent<Omit<{
33
36
  children?: React.ReactNode;
34
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
37
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
35
38
  ref?: React.Ref<HTMLDivElement>;
36
39
  } & {
37
40
  asChild?: boolean;
38
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
41
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key"> & {
39
42
  label?: string;
40
43
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
41
44
  declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
42
45
  children?: React.ReactNode;
43
- } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
46
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
44
47
  ref?: React.Ref<HTMLDivElement>;
45
48
  } & {
46
49
  asChild?: boolean;
47
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
50
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
51
+ declare const CommandLoading: React.ForwardRefExoticComponent<Omit<{
52
+ children?: React.ReactNode;
53
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
54
+ ref?: React.Ref<HTMLDivElement>;
55
+ } & {
56
+ asChild?: boolean;
57
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key"> & {
58
+ progress?: number;
59
+ label?: string;
60
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
48
61
  declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
49
62
  children?: React.ReactNode;
50
- } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
63
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
51
64
  ref?: React.Ref<HTMLDivElement>;
52
65
  } & {
53
66
  asChild?: boolean;
54
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "heading" | "value"> & {
67
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key">, "heading" | "value"> & {
55
68
  heading?: React.ReactNode;
56
69
  value?: string;
57
70
  forceMount?: boolean;
58
71
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
59
- declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
72
+ declare const CommandSeparator: React.ForwardRefExoticComponent<Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
60
73
  ref?: React.Ref<HTMLDivElement>;
61
74
  } & {
62
75
  asChild?: boolean;
63
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
76
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key"> & {
64
77
  alwaysRender?: boolean;
65
78
  } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
66
79
  declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
67
80
  children?: React.ReactNode;
68
- } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
81
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.HTMLAttributes<HTMLDivElement> | "key"> & {
69
82
  ref?: React.Ref<HTMLDivElement>;
70
83
  } & {
71
84
  asChild?: boolean;
72
- }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "disabled" | "value"> & {
85
+ }, keyof React.HTMLAttributes<HTMLDivElement> | "asChild" | "key">, "onSelect" | "disabled" | "value"> & {
73
86
  disabled?: boolean;
74
87
  onSelect?: (value: string) => void;
75
88
  value?: string;
@@ -81,4 +94,4 @@ declare const CommandShortcut: {
81
94
  displayName: string;
82
95
  };
83
96
 
84
- export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut };
97
+ export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut };
@@ -1,4 +1,4 @@
1
- export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut } from '../chunk-7H54PTVH.js';
2
- import '../chunk-4AVS6CV4.js';
1
+ export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut } from '../chunk-PSR7N36A.js';
2
+ import '../chunk-WKMLZDUT.js';
3
3
  import '../chunk-FEK5XGZW.js';
4
4
  import '../chunk-3GWWZKX7.js';
@@ -11,6 +11,7 @@ interface CurrencyInputProps {
11
11
  disabled?: boolean;
12
12
  className?: string;
13
13
  error?: string;
14
+ id?: string;
14
15
  }
15
16
  declare const CurrencyInput: React.ForwardRefExoticComponent<CurrencyInputProps & React.RefAttributes<HTMLInputElement>>;
16
17