@next-degree/pickle-shared-js 0.3.22 → 0.3.23

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 (35) hide show
  1. package/dist/app/layout.css +22 -5
  2. package/dist/app/layout.css.map +1 -1
  3. package/dist/app/page.cjs +249 -4
  4. package/dist/app/page.cjs.map +1 -1
  5. package/dist/app/page.js +254 -4
  6. package/dist/app/page.js.map +1 -1
  7. package/dist/components/demos/SelectDemo.cjs +323 -0
  8. package/dist/components/demos/SelectDemo.cjs.map +1 -0
  9. package/dist/components/demos/SelectDemo.d.cts +5 -0
  10. package/dist/components/demos/SelectDemo.d.ts +5 -0
  11. package/dist/components/demos/SelectDemo.js +295 -0
  12. package/dist/components/demos/SelectDemo.js.map +1 -0
  13. package/dist/components/demos/index.cjs +247 -2
  14. package/dist/components/demos/index.cjs.map +1 -1
  15. package/dist/components/demos/index.js +252 -2
  16. package/dist/components/demos/index.js.map +1 -1
  17. package/dist/components/ui/ErrorMessage.cjs +41 -0
  18. package/dist/components/ui/ErrorMessage.cjs.map +1 -0
  19. package/dist/components/ui/ErrorMessage.d.cts +9 -0
  20. package/dist/components/ui/ErrorMessage.d.ts +9 -0
  21. package/dist/components/ui/ErrorMessage.js +18 -0
  22. package/dist/components/ui/ErrorMessage.js.map +1 -0
  23. package/dist/components/ui/Select.cjs +124 -105
  24. package/dist/components/ui/Select.cjs.map +1 -1
  25. package/dist/components/ui/Select.d.cts +3 -1
  26. package/dist/components/ui/Select.d.ts +3 -1
  27. package/dist/components/ui/Select.js +124 -105
  28. package/dist/components/ui/Select.js.map +1 -1
  29. package/dist/index.cjs +191 -172
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.js +177 -158
  32. package/dist/index.js.map +1 -1
  33. package/dist/styles/globals.css +22 -5
  34. package/dist/styles/globals.css.map +1 -1
  35. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -54,11 +54,19 @@ function cn(...inputs) {
54
54
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
55
55
  }
56
56
 
57
- // src/components/ui/Label.tsx
57
+ // src/components/ui/ErrorMessage.tsx
58
58
  var import_jsx_runtime = require("react/jsx-runtime");
59
+ function ErrorMessage({ message, className, ...props }) {
60
+ if (!message) return null;
61
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
62
+ }
63
+ var ErrorMessage_default = ErrorMessage;
64
+
65
+ // src/components/ui/Label.tsx
66
+ var import_jsx_runtime2 = require("react/jsx-runtime");
59
67
  function Label({ text, className, ...props }) {
60
68
  if (!text) return null;
61
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
69
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
62
70
  "label",
63
71
  {
64
72
  className: cn(
@@ -75,8 +83,8 @@ var Label_default = Label;
75
83
  // src/components/ui/Chip.tsx
76
84
  var import_cva = require("cva");
77
85
  var import_tailwind_merge2 = require("tailwind-merge");
78
- var import_jsx_runtime2 = require("react/jsx-runtime");
79
- var Chip = ({ className, variant, size, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: (0, import_tailwind_merge2.twMerge)(chipVariants({ variant, size, className })), ...props });
86
+ var import_jsx_runtime3 = require("react/jsx-runtime");
87
+ var Chip = ({ className, variant, size, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_tailwind_merge2.twMerge)(chipVariants({ variant, size, className })), ...props });
80
88
  var chipVariants = (0, import_cva.cva)(["flex", "items-center", "rounded-3xl", "border", "w-fit"], {
81
89
  variants: {
82
90
  variant: {
@@ -101,8 +109,8 @@ var Chip_default = Chip;
101
109
  // src/components/primitives/separator.tsx
102
110
  var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
103
111
  var React = __toESM(require("react"), 1);
104
- var import_jsx_runtime3 = require("react/jsx-runtime");
105
- var Separator = React.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
112
+ var import_jsx_runtime4 = require("react/jsx-runtime");
113
+ var Separator = React.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
106
114
  SeparatorPrimitive.Root,
107
115
  {
108
116
  ref,
@@ -119,9 +127,9 @@ var Separator = React.forwardRef(({ className, orientation = "horizontal", decor
119
127
  Separator.displayName = SeparatorPrimitive.Root.displayName;
120
128
 
121
129
  // src/components/ui/Select.tsx
122
- var import_jsx_runtime4 = require("react/jsx-runtime");
130
+ var import_jsx_runtime5 = require("react/jsx-runtime");
123
131
  var Select = (0, import_react.forwardRef)(
124
- ({ label, options, placeholder, multiselect, classNames, ...props }, ref) => {
132
+ ({ label, options, placeholder, multiselect, classNames, error, id, ...props }, ref) => {
125
133
  const { value, defaultValue, dir, className, onChange, ...rest } = props;
126
134
  const [selected, setSelected] = (0, import_react.useState)([]);
127
135
  const [open, setOpen] = (0, import_react.useState)(false);
@@ -151,104 +159,115 @@ var Select = (0, import_react.forwardRef)(
151
159
  });
152
160
  onChange?.(multiselect ? newSelected : newValue);
153
161
  }
154
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: cn("flex flex-col space-y-2", className), ref: containerRef, children: [
155
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Label_default, { text: label, className: classNames?.label }),
156
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
157
- SelectPrimitive.Root,
158
- {
159
- open,
160
- value: selected.join(","),
161
- onOpenChange: handleOnOpenChange,
162
- onValueChange: multiselect ? void 0 : handleChange,
163
- defaultValue: typeof defaultValue === "string" ? defaultValue : void 0,
164
- dir: dir === "rtl" ? "rtl" : "ltr",
165
- ...rest,
166
- children: [
167
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
168
- SelectPrimitive.Trigger,
169
- {
170
- ref,
171
- "data-testid": `${label.toLowerCase()}-select-element`,
172
- className: "group flex min-w-80 flex-row items-center justify-between gap-3 rounded-lg border border-grey-20 px-4 py-3 text-sm font-normal focus:outline-purple-100 disabled:bg-grey-5 data-[placeholder]:text-grey-50 data-[placeholder]:disabled:text-grey-40",
173
- children: [
174
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "truncate", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
175
- SelectPrimitive.Value,
176
- {
177
- placeholder: placeholder ?? "Select an option",
178
- "aria-label": handleLabels(),
179
- children: handleLabels()
180
- }
181
- ) }),
182
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
183
- import_lucide_react.ChevronDownIcon,
184
- {
185
- className: "transform text-black group-data-[state=open]:rotate-180",
186
- size: "16"
187
- }
188
- )
189
- ]
190
- }
191
- ),
192
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectPrimitive.Portal, { container: containerRef.current, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
193
- SelectPrimitive.Content,
194
- {
195
- hideWhenDetached: true,
196
- className: "z-10 max-h-[var(--radix-select-content-available-height)] w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md bg-white py-2 shadow-lg",
197
- position: "popper",
198
- sideOffset: 4,
199
- onPointerDownOutside: toggleOpen,
200
- onKeyDown: closeOnEscape,
201
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(SelectPrimitive.Viewport, { children: [
202
- multiselect && !!chipLabels?.length && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
203
- SelectPrimitive.Group,
204
- {
205
- className: "mb-2 flex flex-row flex-wrap gap-1 px-2",
206
- "data-testid": "selected-labels",
207
- children: chipLabels?.map(
208
- (chip) => chip && /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Chip_default, { size: "small", variant: "primary", children: [
209
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: chip.title }),
210
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
211
- import_lucide_react.X,
212
- {
213
- size: 18,
214
- "data-testid": `chip-remove-${chip.value}`,
215
- className: "cursor-pointer",
216
- onClick: () => handleChange(chip.value)
217
- }
218
- )
219
- ] }, chip.title)
162
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
163
+ "div",
164
+ {
165
+ className: cn("flex flex-col space-y-1", className),
166
+ ref: containerRef,
167
+ "data-testid": `${(label ?? id)?.toLowerCase()}-select-element`,
168
+ children: [
169
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Label_default, { text: label, className: classNames?.label }),
170
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
171
+ SelectPrimitive.Root,
172
+ {
173
+ open,
174
+ value: selected.join(","),
175
+ onOpenChange: handleOnOpenChange,
176
+ onValueChange: multiselect ? void 0 : handleChange,
177
+ defaultValue: typeof defaultValue === "string" ? defaultValue : void 0,
178
+ dir: dir === "rtl" ? "rtl" : "ltr",
179
+ ...rest,
180
+ children: [
181
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
182
+ SelectPrimitive.Trigger,
183
+ {
184
+ ref,
185
+ className: cn(
186
+ "group flex h-11 min-w-80 flex-row items-center justify-between gap-3 rounded-lg border px-4 py-3 text-sm font-normal focus:outline-purple-100 disabled:bg-grey-5 data-[placeholder]:text-grey-50 data-[placeholder]:disabled:text-grey-40",
187
+ classNames?.trigger
188
+ ),
189
+ children: [
190
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "truncate", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
191
+ SelectPrimitive.Value,
192
+ {
193
+ placeholder: placeholder ?? "Select an option",
194
+ "aria-label": handleLabels(),
195
+ children: handleLabels()
196
+ }
197
+ ) }),
198
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
199
+ import_lucide_react.ChevronDownIcon,
200
+ {
201
+ className: "transform text-black group-data-[state=open]:rotate-180",
202
+ size: "16"
203
+ }
220
204
  )
221
- }
222
- ),
223
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Separator, {}),
224
- options?.map(({ id, title, value: value2 }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
225
- SelectPrimitive.Item,
226
- {
227
- value: value2,
228
- className: "group relative cursor-pointer px-4 py-2 text-left text-sm hover:bg-purple-50 focus:bg-purple-50 focus:outline-none data-[state=checked]:bg-purple-50 data-[state=checked]:pr-10 data-[state=checked]:text-purple-100",
229
- "data-state": selected.includes(value2) ? "checked" : "unchecked",
230
- onKeyDown: (e) => setValueOnEnter(e, value2),
231
- onClick: () => handleChange(value2),
232
- children: [
233
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(SelectPrimitive.ItemText, { children: title }),
234
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
235
- import_lucide_react.CheckIcon,
236
- {
237
- className: "absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block",
238
- size: 16
239
- }
240
- )
241
- ]
242
- },
243
- id
244
- ))
245
- ] })
246
- }
247
- ) })
248
- ]
249
- }
250
- )
251
- ] });
205
+ ]
206
+ }
207
+ ),
208
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectPrimitive.Portal, { container: containerRef.current, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
209
+ SelectPrimitive.Content,
210
+ {
211
+ hideWhenDetached: true,
212
+ className: "z-10 max-h-[var(--radix-select-content-available-height)] w-[var(--radix-select-trigger-width)] overflow-hidden rounded-md bg-white py-2 shadow-lg",
213
+ position: "popper",
214
+ sideOffset: 4,
215
+ onPointerDownOutside: toggleOpen,
216
+ onKeyDown: closeOnEscape,
217
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(SelectPrimitive.Viewport, { children: [
218
+ multiselect && !!chipLabels?.length && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
219
+ SelectPrimitive.Group,
220
+ {
221
+ className: "mb-2 flex flex-row flex-wrap gap-1 px-2",
222
+ "data-testid": "selected-labels",
223
+ children: chipLabels?.map(
224
+ (chip) => chip && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(Chip_default, { size: "small", variant: "primary", children: [
225
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: chip.title }),
226
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
227
+ import_lucide_react.X,
228
+ {
229
+ size: 18,
230
+ "data-testid": `chip-remove-${chip.value}`,
231
+ className: "cursor-pointer",
232
+ onClick: () => handleChange(chip.value)
233
+ }
234
+ )
235
+ ] }, chip.title)
236
+ )
237
+ }
238
+ ),
239
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Separator, {}),
240
+ options?.map(({ id: id2, title, value: value2 }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
241
+ SelectPrimitive.Item,
242
+ {
243
+ value: value2,
244
+ className: "group relative cursor-pointer px-4 py-2 text-left text-sm hover:bg-purple-50 focus:bg-purple-50 focus:outline-none data-[state=checked]:bg-purple-50 data-[state=checked]:pr-10 data-[state=checked]:text-purple-100",
245
+ "data-state": selected.includes(value2) ? "checked" : "unchecked",
246
+ onKeyDown: (e) => setValueOnEnter(e, value2),
247
+ onClick: () => handleChange(value2),
248
+ children: [
249
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SelectPrimitive.ItemText, { children: title }),
250
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
251
+ import_lucide_react.CheckIcon,
252
+ {
253
+ className: "absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block",
254
+ size: 16
255
+ }
256
+ )
257
+ ]
258
+ },
259
+ id2
260
+ ))
261
+ ] })
262
+ }
263
+ ) })
264
+ ]
265
+ }
266
+ ),
267
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ErrorMessage_default, { message: error, className: "mt-1" })
268
+ ]
269
+ }
270
+ );
252
271
  }
253
272
  );
254
273
  Select.displayName = "Select";
@@ -258,8 +277,8 @@ var Select_default = Select;
258
277
  var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
259
278
  var import_lucide_react2 = require("lucide-react");
260
279
  var import_react2 = require("react");
261
- var import_jsx_runtime5 = require("react/jsx-runtime");
262
- var CheckboxToggle = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
280
+ var import_jsx_runtime6 = require("react/jsx-runtime");
281
+ var CheckboxToggle = (0, import_react2.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
263
282
  CheckboxPrimitive.Root,
264
283
  {
265
284
  ref,
@@ -289,9 +308,9 @@ var CheckboxToggle = (0, import_react2.forwardRef)(({ className, ...props }, ref
289
308
  className
290
309
  ),
291
310
  ...props,
292
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
293
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }),
294
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
311
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
312
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }),
313
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react2.Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
295
314
  ] })
296
315
  }
297
316
  ));
@@ -301,9 +320,9 @@ var Checkbox = (0, import_react2.forwardRef)(
301
320
  const { disabled } = props;
302
321
  const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`;
303
322
  const labelClassName = disabled ? "text-grey-40 pointer-events-none" : "";
304
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: cn("flex space-x-2", classNames?.wrapper), children: [
305
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckboxToggle, { id, disabled, ref, ...props }),
306
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: id, className: cn(labelClassName, classNames?.label), children })
323
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: cn("flex space-x-2", classNames?.wrapper), children: [
324
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CheckboxToggle, { id, disabled, ref, ...props }),
325
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: id, className: cn(labelClassName, classNames?.label), children })
307
326
  ] });
308
327
  }
309
328
  );
@@ -313,7 +332,7 @@ var Checkbox_default = Checkbox;
313
332
  // src/components/ui/ListItem.tsx
314
333
  var import_lucide_react3 = require("lucide-react");
315
334
  var import_lucide_react4 = require("lucide-react");
316
- var import_jsx_runtime6 = require("react/jsx-runtime");
335
+ var import_jsx_runtime7 = require("react/jsx-runtime");
317
336
  function ListItem({
318
337
  icon,
319
338
  hasCheckbox,
@@ -327,12 +346,12 @@ function ListItem({
327
346
  const getIconIfValid = (icon2) => {
328
347
  if (icon2 in import_lucide_react4.icons) {
329
348
  const IconComponent = import_lucide_react4.icons[icon2];
330
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconComponent, { size: 14 });
349
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconComponent, { size: 14 });
331
350
  }
332
351
  return null;
333
352
  };
334
353
  const optionIcon = icon ? getIconIfValid(icon) : void 0;
335
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
354
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
336
355
  "li",
337
356
  {
338
357
  className: cn(
@@ -342,13 +361,13 @@ function ListItem({
342
361
  ...props,
343
362
  "data-state": isSelected ? "checked" : "unchecked",
344
363
  children: [
345
- optionIcon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "mr-2", children: optionIcon }),
346
- hasCheckbox && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Checkbox_default, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
347
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
348
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: title }),
349
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-xs text-grey-80", children: description })
364
+ optionIcon && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "mr-2", children: optionIcon }),
365
+ hasCheckbox && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Checkbox_default, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
366
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
367
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: title }),
368
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-xs text-grey-80", children: description })
350
369
  ] }),
351
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
370
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
352
371
  import_lucide_react3.CheckIcon,
353
372
  {
354
373
  className: "absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",
@@ -365,11 +384,11 @@ var ListItem_default = ListItem;
365
384
  var import_react_slot = require("@radix-ui/react-slot");
366
385
  var import_cva2 = require("cva");
367
386
  var import_react3 = require("react");
368
- var import_jsx_runtime7 = require("react/jsx-runtime");
387
+ var import_jsx_runtime8 = require("react/jsx-runtime");
369
388
  var Button = (0, import_react3.forwardRef)(
370
389
  ({ className, variant, size, asChild = false, ...props }, ref) => {
371
390
  const Component = asChild ? import_react_slot.Slot : "button";
372
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
391
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
373
392
  Component,
374
393
  {
375
394
  className: cn(buttonVariants({ variant, size, className })),
@@ -484,9 +503,9 @@ var React4 = __toESM(require("react"), 1);
484
503
  var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
485
504
  var import_lucide_react5 = require("lucide-react");
486
505
  var React3 = __toESM(require("react"), 1);
487
- var import_jsx_runtime8 = require("react/jsx-runtime");
506
+ var import_jsx_runtime9 = require("react/jsx-runtime");
488
507
  var DialogPortal = DialogPrimitive.Portal;
489
- var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
508
+ var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
490
509
  DialogPrimitive.Overlay,
491
510
  {
492
511
  ref,
@@ -498,9 +517,9 @@ var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PU
498
517
  }
499
518
  ));
500
519
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
501
- var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DialogPortal, { children: [
502
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogOverlay, {}),
503
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
520
+ var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogPortal, { children: [
521
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DialogOverlay, {}),
522
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
504
523
  DialogPrimitive.Content,
505
524
  {
506
525
  ref,
@@ -511,18 +530,18 @@ var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) =
511
530
  ...props,
512
531
  children: [
513
532
  children,
514
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400", children: [
515
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react5.X, { className: "h-4 w-4" }),
516
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "sr-only", children: "Close" })
533
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 data-[state=open]:text-neutral-500 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800 dark:data-[state=open]:text-neutral-400", children: [
534
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react5.X, { className: "h-4 w-4" }),
535
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "sr-only", children: "Close" })
517
536
  ] })
518
537
  ]
519
538
  }
520
539
  )
521
540
  ] }));
522
541
  DialogContent.displayName = DialogPrimitive.Content.displayName;
523
- var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
542
+ var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
524
543
  DialogHeader.displayName = "DialogHeader";
525
- var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
544
+ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
526
545
  "div",
527
546
  {
528
547
  className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
@@ -530,7 +549,7 @@ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_r
530
549
  }
531
550
  );
532
551
  DialogFooter.displayName = "DialogFooter";
533
- var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
552
+ var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
534
553
  DialogPrimitive.Title,
535
554
  {
536
555
  ref,
@@ -539,7 +558,7 @@ var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE
539
558
  }
540
559
  ));
541
560
  DialogTitle.displayName = DialogPrimitive.Title.displayName;
542
- var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
561
+ var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
543
562
  DialogPrimitive.Description,
544
563
  {
545
564
  ref,
@@ -550,8 +569,8 @@ var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @
550
569
  DialogDescription.displayName = DialogPrimitive.Description.displayName;
551
570
 
552
571
  // src/components/primitives/command.tsx
553
- var import_jsx_runtime9 = require("react/jsx-runtime");
554
- var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
572
+ var import_jsx_runtime10 = require("react/jsx-runtime");
573
+ var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
555
574
  import_cmdk.Command,
556
575
  {
557
576
  ref,
@@ -563,9 +582,9 @@ var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
563
582
  }
564
583
  ));
565
584
  Command.displayName = import_cmdk.Command.displayName;
566
- var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "m-1 flex items-center rounded-xl border px-3", "cmdk-input-wrapper": "", children: [
567
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react6.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
568
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
585
+ var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "m-1 flex items-center rounded-xl border px-3", "cmdk-input-wrapper": "", children: [
586
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react6.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
587
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
569
588
  import_cmdk.Command.Input,
570
589
  {
571
590
  ref,
@@ -578,7 +597,7 @@ var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PUR
578
597
  )
579
598
  ] }));
580
599
  CommandInput.displayName = import_cmdk.Command.Input.displayName;
581
- var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
600
+ var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
582
601
  import_cmdk.Command.List,
583
602
  {
584
603
  ref,
@@ -587,9 +606,9 @@ var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
587
606
  }
588
607
  ));
589
608
  CommandList.displayName = import_cmdk.Command.List.displayName;
590
- var CommandEmpty = React4.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_cmdk.Command.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
609
+ var CommandEmpty = React4.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_cmdk.Command.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
591
610
  CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
592
- var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
611
+ var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
593
612
  import_cmdk.Command.Group,
594
613
  {
595
614
  ref,
@@ -601,7 +620,7 @@ var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PUR
601
620
  }
602
621
  ));
603
622
  CommandGroup.displayName = import_cmdk.Command.Group.displayName;
604
- var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
623
+ var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
605
624
  import_cmdk.Command.Separator,
606
625
  {
607
626
  ref,
@@ -610,7 +629,7 @@ var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @_
610
629
  }
611
630
  ));
612
631
  CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
613
- var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
632
+ var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
614
633
  import_cmdk.Command.Item,
615
634
  {
616
635
  ref,
@@ -623,7 +642,7 @@ var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
623
642
  ));
624
643
  CommandItem.displayName = import_cmdk.Command.Item.displayName;
625
644
  var CommandShortcut = ({ className, ...props }) => {
626
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
645
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
627
646
  "span",
628
647
  {
629
648
  className: cn("ml-auto text-xs tracking-widest text-neutral-500", className),
@@ -636,10 +655,10 @@ CommandShortcut.displayName = "CommandShortcut";
636
655
  // src/components/primitives/popover.tsx
637
656
  var React5 = __toESM(require("react"), 1);
638
657
  var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
639
- var import_jsx_runtime10 = require("react/jsx-runtime");
658
+ var import_jsx_runtime11 = require("react/jsx-runtime");
640
659
  var Popover = PopoverPrimitive.Root;
641
660
  var PopoverTrigger = PopoverPrimitive.Trigger;
642
- var PopoverContent = React5.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
661
+ var PopoverContent = React5.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
643
662
  PopoverPrimitive.Content,
644
663
  {
645
664
  ref,
@@ -656,7 +675,7 @@ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
656
675
 
657
676
  // src/components/ui/Badge.tsx
658
677
  var import_cva3 = require("cva");
659
- var import_jsx_runtime11 = require("react/jsx-runtime");
678
+ var import_jsx_runtime12 = require("react/jsx-runtime");
660
679
  var badgeVariants = (0, import_cva3.cva)("rounded-full px-2 py-0.5 text-xs font-semibold", {
661
680
  variants: {
662
681
  variant: {
@@ -670,11 +689,11 @@ var badgeVariants = (0, import_cva3.cva)("rounded-full px-2 py-0.5 text-xs font-
670
689
  }
671
690
  });
672
691
  function Badge({ className, variant, ...props }) {
673
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
692
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
674
693
  }
675
694
 
676
695
  // src/components/ui/Combobox.tsx
677
- var import_jsx_runtime12 = require("react/jsx-runtime");
696
+ var import_jsx_runtime13 = require("react/jsx-runtime");
678
697
  var Combobox = (0, import_react4.forwardRef)((props, ref) => {
679
698
  const {
680
699
  value,
@@ -727,17 +746,17 @@ var Combobox = (0, import_react4.forwardRef)((props, ref) => {
727
746
  const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(", ") : placeholder;
728
747
  return isDefault ? defaultLabel : label;
729
748
  };
730
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: cn("flex flex-col gap-2", className), children: [
731
- isDefault && label && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Label_default, { text: label, className: classNames?.label }),
732
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative flex", children: [
733
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
734
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
749
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: cn("flex flex-col gap-2", className), children: [
750
+ isDefault && label && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Label_default, { text: label, className: classNames?.label }),
751
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative flex", children: [
752
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
753
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
735
754
  PopoverTrigger,
736
755
  {
737
756
  asChild: true,
738
757
  disabled: options.length === 0,
739
758
  "data-testid": `${props.id ?? props.name}-combobox-trigger`,
740
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
759
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
741
760
  "div",
742
761
  {
743
762
  ref,
@@ -748,9 +767,9 @@ var Combobox = (0, import_react4.forwardRef)((props, ref) => {
748
767
  ),
749
768
  "aria-expanded": open,
750
769
  children: [
751
- isDefault && IconComponent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconComponent, { className: "h-4 w-4 shrink-0" }),
752
- isChip && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Badge, { variant: "purple", children: selected.length }),
753
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
770
+ isDefault && IconComponent && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(IconComponent, { className: "h-4 w-4 shrink-0" }),
771
+ isChip && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Badge, { variant: "purple", children: selected.length }),
772
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
754
773
  "span",
755
774
  {
756
775
  className: cn(
@@ -760,7 +779,7 @@ var Combobox = (0, import_react4.forwardRef)((props, ref) => {
760
779
  children: handleDisplayValue()
761
780
  }
762
781
  ),
763
- showChevron && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
782
+ showChevron && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
764
783
  import_lucide_react7.ChevronDownIcon,
765
784
  {
766
785
  className: "shrink-0 transform group-data-[state=open]:rotate-180",
@@ -772,7 +791,7 @@ var Combobox = (0, import_react4.forwardRef)((props, ref) => {
772
791
  )
773
792
  }
774
793
  ),
775
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
794
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
776
795
  PopoverContent,
777
796
  {
778
797
  className: cn(
@@ -783,16 +802,16 @@ var Combobox = (0, import_react4.forwardRef)((props, ref) => {
783
802
  collisionPadding: 8,
784
803
  sideOffset: 4,
785
804
  align: "start",
786
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Command, { children: [
787
- !hideSearchBox && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CommandInput, { placeholder: "Search..." }),
788
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(CommandList, { children: [
789
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CommandEmpty, { children: "No results" }),
790
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CommandGroup, { children: options.map(({ id, ...option }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
805
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Command, { children: [
806
+ !hideSearchBox && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CommandInput, { placeholder: "Search..." }),
807
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(CommandList, { children: [
808
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CommandEmpty, { children: "No results" }),
809
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CommandGroup, { children: options.map(({ id, ...option }) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
791
810
  CommandItem,
792
811
  {
793
812
  value: option.title,
794
813
  onSelect: () => handleSelect(option.value),
795
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
814
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
796
815
  ListItem_default,
797
816
  {
798
817
  className: cn(classNames?.items, "truncate py-1"),
@@ -805,19 +824,19 @@ var Combobox = (0, import_react4.forwardRef)((props, ref) => {
805
824
  id
806
825
  )) })
807
826
  ] }),
808
- !!footer && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Separator, {}),
827
+ !!footer && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Separator, {}),
809
828
  footer && footer({ close })
810
829
  ] })
811
830
  }
812
831
  )
813
832
  ] }),
814
- isDefault && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
833
+ isDefault && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
815
834
  "button",
816
835
  {
817
836
  type: "button",
818
837
  className: "absolute inset-y-0 right-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20",
819
838
  onClick: handleClear,
820
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.CircleX, { className: "h-4 w-4 text-green-100" })
839
+ children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.CircleX, { className: "h-4 w-4 text-green-100" })
821
840
  }
822
841
  )
823
842
  ] })