@next-degree/pickle-shared-js 0.3.25 → 0.3.30

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 (73) hide show
  1. package/dist/app/layout.css +30 -13
  2. package/dist/app/layout.css.map +1 -1
  3. package/dist/app/page.cjs +347 -116
  4. package/dist/app/page.cjs.map +1 -1
  5. package/dist/app/page.js +328 -97
  6. package/dist/app/page.js.map +1 -1
  7. package/dist/components/demos/ComboboxDemo.cjs +97 -54
  8. package/dist/components/demos/ComboboxDemo.cjs.map +1 -1
  9. package/dist/components/demos/ComboboxDemo.js +91 -48
  10. package/dist/components/demos/ComboboxDemo.js.map +1 -1
  11. package/dist/components/demos/CounterDemo.cjs +270 -0
  12. package/dist/components/demos/CounterDemo.cjs.map +1 -0
  13. package/dist/components/demos/CounterDemo.d.cts +5 -0
  14. package/dist/components/demos/CounterDemo.d.ts +5 -0
  15. package/dist/components/demos/CounterDemo.js +238 -0
  16. package/dist/components/demos/CounterDemo.js.map +1 -0
  17. package/dist/components/demos/InputDemo.cjs +82 -35
  18. package/dist/components/demos/InputDemo.cjs.map +1 -1
  19. package/dist/components/demos/InputDemo.js +68 -31
  20. package/dist/components/demos/InputDemo.js.map +1 -1
  21. package/dist/components/demos/SelectDemo.cjs +92 -53
  22. package/dist/components/demos/SelectDemo.cjs.map +1 -1
  23. package/dist/components/demos/SelectDemo.js +83 -44
  24. package/dist/components/demos/SelectDemo.js.map +1 -1
  25. package/dist/components/demos/index.cjs +345 -114
  26. package/dist/components/demos/index.cjs.map +1 -1
  27. package/dist/components/demos/index.js +326 -95
  28. package/dist/components/demos/index.js.map +1 -1
  29. package/dist/components/primitives/tooltip.cjs +75 -0
  30. package/dist/components/primitives/tooltip.cjs.map +1 -0
  31. package/dist/components/primitives/tooltip.d.cts +9 -0
  32. package/dist/components/primitives/tooltip.d.ts +9 -0
  33. package/dist/components/primitives/tooltip.js +38 -0
  34. package/dist/components/primitives/tooltip.js.map +1 -0
  35. package/dist/components/ui/Combobox.cjs +83 -42
  36. package/dist/components/ui/Combobox.cjs.map +1 -1
  37. package/dist/components/ui/Combobox.d.cts +5 -2
  38. package/dist/components/ui/Combobox.d.ts +5 -2
  39. package/dist/components/ui/Combobox.js +77 -36
  40. package/dist/components/ui/Combobox.js.map +1 -1
  41. package/dist/components/ui/Counter.cjs +248 -0
  42. package/dist/components/ui/Counter.cjs.map +1 -0
  43. package/dist/components/ui/Counter.d.cts +28 -0
  44. package/dist/components/ui/Counter.d.ts +28 -0
  45. package/dist/components/ui/Counter.js +214 -0
  46. package/dist/components/ui/Counter.js.map +1 -0
  47. package/dist/components/ui/Input.cjs +75 -28
  48. package/dist/components/ui/Input.cjs.map +1 -1
  49. package/dist/components/ui/Input.d.cts +2 -1
  50. package/dist/components/ui/Input.d.ts +2 -1
  51. package/dist/components/ui/Input.js +63 -26
  52. package/dist/components/ui/Input.js.map +1 -1
  53. package/dist/components/ui/Label.cjs +54 -16
  54. package/dist/components/ui/Label.cjs.map +1 -1
  55. package/dist/components/ui/Label.d.cts +2 -1
  56. package/dist/components/ui/Label.d.ts +2 -1
  57. package/dist/components/ui/Label.js +44 -16
  58. package/dist/components/ui/Label.js.map +1 -1
  59. package/dist/components/ui/Select.cjs +83 -46
  60. package/dist/components/ui/Select.cjs.map +1 -1
  61. package/dist/components/ui/Select.d.cts +3 -2
  62. package/dist/components/ui/Select.d.ts +3 -2
  63. package/dist/components/ui/Select.js +75 -38
  64. package/dist/components/ui/Select.js.map +1 -1
  65. package/dist/index.cjs +344 -140
  66. package/dist/index.cjs.map +1 -1
  67. package/dist/index.d.cts +1 -0
  68. package/dist/index.d.ts +1 -0
  69. package/dist/index.js +318 -115
  70. package/dist/index.js.map +1 -1
  71. package/dist/styles/globals.css +30 -13
  72. package/dist/styles/globals.css.map +1 -1
  73. package/package.json +1 -1
package/dist/app/page.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { useState as useState2 } from "react";
3
3
 
4
4
  // src/components/ui/Combobox.tsx
5
- import { forwardRef as forwardRef6, useEffect, useState } from "react";
5
+ import { forwardRef as forwardRef7, useEffect, useState } from "react";
6
6
  import { ChevronDownIcon, CircleX, icons as icons2 } from "lucide-react";
7
7
  import { cva as cva2 } from "cva";
8
8
 
@@ -342,34 +342,66 @@ function Badge({ className, variant, ...props }) {
342
342
  return /* @__PURE__ */ jsx7("div", { className: cn(badgeVariants({ variant }), className), ...props });
343
343
  }
344
344
 
345
+ // src/components/primitives/tooltip.tsx
346
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
347
+ import * as React5 from "react";
348
+ import { jsx as jsx8 } from "react/jsx-runtime";
349
+ var TooltipProvider = TooltipPrimitive.Provider;
350
+ var Tooltip = TooltipPrimitive.Root;
351
+ var TooltipTrigger = TooltipPrimitive.Trigger;
352
+ var TooltipContent = React5.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx8(
353
+ TooltipPrimitive.Content,
354
+ {
355
+ ref,
356
+ sideOffset,
357
+ className: cn(
358
+ "z-50 overflow-hidden rounded-md border border-neutral-200 bg-white px-3 py-1.5 text-sm text-neutral-950 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50",
359
+ className
360
+ ),
361
+ ...props
362
+ }
363
+ ));
364
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
365
+
345
366
  // src/components/ui/Label.tsx
346
- import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
347
- function Label({ text, required, className, ...props }) {
367
+ import { InfoIcon } from "lucide-react";
368
+ import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
369
+ function Label({ text, required, description, className, ...props }) {
348
370
  if (!text) return null;
349
- return /* @__PURE__ */ jsxs5(
350
- "label",
351
- {
352
- className: cn(
353
- "text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
354
- className
355
- ),
356
- ...props,
357
- children: [
358
- text,
359
- required && /* @__PURE__ */ jsx8("span", { className: "text-red-600", children: "\xA0*" })
360
- ]
361
- }
362
- );
371
+ return /* @__PURE__ */ jsxs5("div", { className: "flex w-full flex-row gap-1", children: [
372
+ /* @__PURE__ */ jsxs5(
373
+ "label",
374
+ {
375
+ className: cn(
376
+ "text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
377
+ className
378
+ ),
379
+ ...props,
380
+ children: [
381
+ text,
382
+ required && /* @__PURE__ */ jsx9("span", { className: "text-red-600", children: "\xA0*" })
383
+ ]
384
+ }
385
+ ),
386
+ !!description && /* @__PURE__ */ jsx9(TooltipProvider, { children: /* @__PURE__ */ jsxs5(Tooltip, { children: [
387
+ /* @__PURE__ */ jsx9(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx9(InfoIcon, { className: "h-4 w-4" }) }),
388
+ /* @__PURE__ */ jsx9(TooltipContent, { className: "max-w-48", children: description })
389
+ ] }) })
390
+ ] });
363
391
  }
364
392
  var Label_default = Label;
365
393
 
366
394
  // src/components/ui/Combobox.tsx
367
- import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
368
- var Combobox = forwardRef6((props, ref) => {
395
+ import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
396
+ var Combobox = forwardRef7((props, ref) => {
369
397
  const {
398
+ id,
399
+ name,
370
400
  value,
371
401
  label,
372
402
  options,
403
+ required,
404
+ description,
373
405
  classNames,
374
406
  multiselect,
375
407
  placeholder,
@@ -417,16 +449,25 @@ var Combobox = forwardRef6((props, ref) => {
417
449
  const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(", ") : placeholder;
418
450
  return isDefault ? defaultLabel : label;
419
451
  };
420
- return /* @__PURE__ */ jsxs6("div", { className: cn("flex flex-col gap-2", className), children: [
421
- isDefault && label && /* @__PURE__ */ jsx9(Label_default, { text: label, className: classNames?.label }),
452
+ return /* @__PURE__ */ jsxs6("div", { className: cn("flex flex-col gap-1", className), children: [
453
+ isDefault && /* @__PURE__ */ jsx10(
454
+ Label_default,
455
+ {
456
+ text: label,
457
+ htmlFor: name,
458
+ required,
459
+ description,
460
+ className: classNames?.label
461
+ }
462
+ ),
422
463
  /* @__PURE__ */ jsxs6("div", { className: "relative flex", children: [
423
464
  /* @__PURE__ */ jsxs6(Popover, { open, onOpenChange: setOpen, children: [
424
- /* @__PURE__ */ jsx9(
465
+ /* @__PURE__ */ jsx10(
425
466
  PopoverTrigger,
426
467
  {
427
468
  asChild: true,
428
469
  disabled: options.length === 0,
429
- "data-testid": `${props.id ?? props.name}-combobox-trigger`,
470
+ "data-testid": `${id ?? name}-combobox-trigger`,
430
471
  children: /* @__PURE__ */ jsxs6(
431
472
  "div",
432
473
  {
@@ -438,9 +479,9 @@ var Combobox = forwardRef6((props, ref) => {
438
479
  ),
439
480
  "aria-expanded": open,
440
481
  children: [
441
- isDefault && IconComponent && /* @__PURE__ */ jsx9(IconComponent, { className: "h-4 w-4 shrink-0" }),
442
- isChip && !isEmpty && /* @__PURE__ */ jsx9(Badge, { variant: "purple", children: selected.length }),
443
- /* @__PURE__ */ jsx9(
482
+ isDefault && IconComponent && /* @__PURE__ */ jsx10(IconComponent, { className: "h-4 w-4 shrink-0" }),
483
+ isChip && !isEmpty && /* @__PURE__ */ jsx10(Badge, { variant: "purple", children: selected.length }),
484
+ /* @__PURE__ */ jsx10(
444
485
  "span",
445
486
  {
446
487
  className: cn(
@@ -450,7 +491,7 @@ var Combobox = forwardRef6((props, ref) => {
450
491
  children: handleDisplayValue()
451
492
  }
452
493
  ),
453
- showChevron && /* @__PURE__ */ jsx9(
494
+ showChevron && /* @__PURE__ */ jsx10(
454
495
  ChevronDownIcon,
455
496
  {
456
497
  className: "shrink-0 transform group-data-[state=open]:rotate-180",
@@ -462,7 +503,7 @@ var Combobox = forwardRef6((props, ref) => {
462
503
  )
463
504
  }
464
505
  ),
465
- /* @__PURE__ */ jsx9(
506
+ /* @__PURE__ */ jsx10(
466
507
  PopoverContent,
467
508
  {
468
509
  className: cn(
@@ -474,15 +515,15 @@ var Combobox = forwardRef6((props, ref) => {
474
515
  sideOffset: 4,
475
516
  align: "start",
476
517
  children: /* @__PURE__ */ jsxs6(Command, { children: [
477
- !hideSearchBox && /* @__PURE__ */ jsx9(CommandInput, { placeholder: "Search..." }),
518
+ !hideSearchBox && /* @__PURE__ */ jsx10(CommandInput, { placeholder: "Search..." }),
478
519
  /* @__PURE__ */ jsxs6(CommandList, { children: [
479
- /* @__PURE__ */ jsx9(CommandEmpty, { children: "No results" }),
480
- /* @__PURE__ */ jsx9(CommandGroup, { children: options.map(({ id, ...option }) => /* @__PURE__ */ jsx9(
520
+ /* @__PURE__ */ jsx10(CommandEmpty, { children: "No results" }),
521
+ /* @__PURE__ */ jsx10(CommandGroup, { children: options.map(({ id: id2, ...option }) => /* @__PURE__ */ jsx10(
481
522
  CommandItem,
482
523
  {
483
524
  value: option.title,
484
525
  onSelect: () => handleSelect(option.value),
485
- children: /* @__PURE__ */ jsx9(
526
+ children: /* @__PURE__ */ jsx10(
486
527
  ListItem_default,
487
528
  {
488
529
  className: cn(classNames?.items, "truncate py-1"),
@@ -492,22 +533,22 @@ var Combobox = forwardRef6((props, ref) => {
492
533
  }
493
534
  )
494
535
  },
495
- id
536
+ id2
496
537
  )) })
497
538
  ] }),
498
- !!footer && /* @__PURE__ */ jsx9(Separator, {}),
539
+ !!footer && /* @__PURE__ */ jsx10(Separator, {}),
499
540
  footer && footer({ close })
500
541
  ] })
501
542
  }
502
543
  )
503
544
  ] }),
504
- isDefault && !isEmpty && /* @__PURE__ */ jsx9(
545
+ isDefault && !isEmpty && /* @__PURE__ */ jsx10(
505
546
  "button",
506
547
  {
507
548
  type: "button",
508
549
  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",
509
550
  onClick: handleClear,
510
- children: /* @__PURE__ */ jsx9(CircleX, { className: "h-4 w-4 text-green-100" })
551
+ children: /* @__PURE__ */ jsx10(CircleX, { className: "h-4 w-4 text-green-100" })
511
552
  }
512
553
  )
513
554
  ] })
@@ -543,12 +584,12 @@ var triggerVariants = cva2(
543
584
  // src/components/ui/Button.tsx
544
585
  import { Slot } from "@radix-ui/react-slot";
545
586
  import { cva as cva3 } from "cva";
546
- import { forwardRef as forwardRef7 } from "react";
547
- import { jsx as jsx10 } from "react/jsx-runtime";
548
- var Button = forwardRef7(
587
+ import { forwardRef as forwardRef8 } from "react";
588
+ import { jsx as jsx11 } from "react/jsx-runtime";
589
+ var Button = forwardRef8(
549
590
  ({ className, variant, size, asChild = false, ...props }, ref) => {
550
591
  const Component = asChild ? Slot : "button";
551
- return /* @__PURE__ */ jsx10(
592
+ return /* @__PURE__ */ jsx11(
552
593
  Component,
553
594
  {
554
595
  className: cn(buttonVariants({ variant, size, className })),
@@ -650,7 +691,7 @@ var buttonVariants = cva3(
650
691
  );
651
692
 
652
693
  // src/components/demos/ComboboxDemo.tsx
653
- import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
694
+ import { jsx as jsx12, jsxs as jsxs7 } from "react/jsx-runtime";
654
695
  function ComboboxDemo() {
655
696
  const [selectedBands, setSelectedBands] = useState2([]);
656
697
  const [selectedFruit, setSelectedFruit] = useState2("");
@@ -691,20 +732,22 @@ function ComboboxDemo() {
691
732
  { title: "Grape", value: "Grape", id: "2", icon: "Grape" }
692
733
  ];
693
734
  return /* @__PURE__ */ jsxs7("div", { className: "flex max-w-sm flex-col flex-wrap gap-4 p-4", children: [
694
- /* @__PURE__ */ jsx11(
735
+ /* @__PURE__ */ jsx12(
695
736
  Combobox,
696
737
  {
738
+ required: true,
697
739
  label: "US bands from the 90's",
698
740
  placeholder: "Select a band",
699
741
  icon: "Music",
700
742
  options: bands,
701
743
  id: "bands",
702
744
  multiselect: true,
745
+ description: "This is a tooltip",
703
746
  onChange: setSelectedBands,
704
747
  value: selectedBands
705
748
  }
706
749
  ),
707
- /* @__PURE__ */ jsx11(
750
+ /* @__PURE__ */ jsx12(
708
751
  Combobox,
709
752
  {
710
753
  label: "US bands from the 90's",
@@ -716,7 +759,7 @@ function ComboboxDemo() {
716
759
  value: selectedBands
717
760
  }
718
761
  ),
719
- /* @__PURE__ */ jsx11(
762
+ /* @__PURE__ */ jsx12(
720
763
  Combobox,
721
764
  {
722
765
  label: "Fruit label",
@@ -725,13 +768,13 @@ function ComboboxDemo() {
725
768
  value: selectedFruit,
726
769
  onChange: setSelectedFruit,
727
770
  children: ({ close }) => /* @__PURE__ */ jsxs7("div", { className: "flex flex-row items-center justify-between bg-white p-2 pl-4", children: [
728
- /* @__PURE__ */ jsx11(Button, { variant: "link", tabIndex: -1, onClick: close, children: "Clear" }),
729
- /* @__PURE__ */ jsx11(Button, { variant: "primary", size: "small", tabIndex: -1, children: "Apply" })
771
+ /* @__PURE__ */ jsx12(Button, { variant: "link", tabIndex: -1, onClick: close, children: "Clear" }),
772
+ /* @__PURE__ */ jsx12(Button, { variant: "primary", size: "small", tabIndex: -1, children: "Apply" })
730
773
  ] })
731
774
  }
732
775
  ),
733
- selectedBands.map((band) => /* @__PURE__ */ jsx11("span", { className: "text-green-80", children: band }, band)),
734
- /* @__PURE__ */ jsx11("span", { className: "text-purple-100", children: selectedFruit })
776
+ selectedBands.map((band) => /* @__PURE__ */ jsx12("span", { className: "text-green-80", children: band }, band)),
777
+ /* @__PURE__ */ jsx12("span", { className: "text-purple-100", children: selectedFruit })
735
778
  ] });
736
779
  }
737
780
  var ComboboxDemo_default = ComboboxDemo;
@@ -740,25 +783,25 @@ var ComboboxDemo_default = ComboboxDemo;
740
783
  import * as SelectPrimitive from "@radix-ui/react-select";
741
784
  import { CheckIcon as CheckIcon2, ChevronDownIcon as ChevronDownIcon2, X as X2 } from "lucide-react";
742
785
  import {
743
- forwardRef as forwardRef8,
786
+ forwardRef as forwardRef9,
744
787
  useEffect as useEffect2,
745
788
  useRef,
746
789
  useState as useState3
747
790
  } from "react";
748
791
 
749
792
  // src/components/ui/ErrorMessage.tsx
750
- import { jsx as jsx12 } from "react/jsx-runtime";
793
+ import { jsx as jsx13 } from "react/jsx-runtime";
751
794
  function ErrorMessage({ message, className, ...props }) {
752
795
  if (!message) return null;
753
- return /* @__PURE__ */ jsx12("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
796
+ return /* @__PURE__ */ jsx13("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
754
797
  }
755
798
  var ErrorMessage_default = ErrorMessage;
756
799
 
757
800
  // src/components/ui/Chip.tsx
758
801
  import { cva as cva4 } from "cva";
759
802
  import { twMerge as twMerge2 } from "tailwind-merge";
760
- import { jsx as jsx13 } from "react/jsx-runtime";
761
- var Chip = ({ className, variant, size, ...props }) => /* @__PURE__ */ jsx13("div", { className: twMerge2(chipVariants({ variant, size, className })), ...props });
803
+ import { jsx as jsx14 } from "react/jsx-runtime";
804
+ var Chip = ({ className, variant, size, ...props }) => /* @__PURE__ */ jsx14("div", { className: twMerge2(chipVariants({ variant, size, className })), ...props });
762
805
  var chipVariants = cva4(["flex", "items-center", "rounded-3xl", "border", "w-fit"], {
763
806
  variants: {
764
807
  variant: {
@@ -781,9 +824,9 @@ var chipVariants = cva4(["flex", "items-center", "rounded-3xl", "border", "w-fit
781
824
  var Chip_default = Chip;
782
825
 
783
826
  // src/components/ui/Select.tsx
784
- import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
785
- var Select = forwardRef8(
786
- ({ label, options, placeholder, multiselect, classNames, error, id, ...props }, ref) => {
827
+ import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
828
+ var Select = forwardRef9(
829
+ ({ label, options, placeholder, multiselect, description, classNames, error, id, ...props }, ref) => {
787
830
  const { value, defaultValue, dir, className, onChange, ...rest } = props;
788
831
  const [selected, setSelected] = useState3([]);
789
832
  const [open, setOpen] = useState3(false);
@@ -816,11 +859,20 @@ var Select = forwardRef8(
816
859
  return /* @__PURE__ */ jsxs8(
817
860
  "div",
818
861
  {
819
- className: cn("flex flex-col space-y-1", className),
862
+ className: cn("flex w-full flex-col gap-1", className),
820
863
  ref: containerRef,
821
864
  "data-testid": `${(label ?? id)?.toLowerCase()}-select-element`,
822
865
  children: [
823
- /* @__PURE__ */ jsx14(Label_default, { text: label, className: classNames?.label }),
866
+ /* @__PURE__ */ jsx15(
867
+ Label_default,
868
+ {
869
+ text: label,
870
+ htmlFor: props.name,
871
+ required: props.required,
872
+ description,
873
+ className: classNames?.label
874
+ }
875
+ ),
824
876
  /* @__PURE__ */ jsxs8(
825
877
  SelectPrimitive.Root,
826
878
  {
@@ -837,11 +889,11 @@ var Select = forwardRef8(
837
889
  {
838
890
  ref,
839
891
  className: cn(
840
- "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",
892
+ "group flex h-11 w-full 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",
841
893
  classNames?.trigger
842
894
  ),
843
895
  children: [
844
- /* @__PURE__ */ jsx14("span", { className: "truncate", children: /* @__PURE__ */ jsx14(
896
+ /* @__PURE__ */ jsx15("span", { className: "truncate", children: /* @__PURE__ */ jsx15(
845
897
  SelectPrimitive.Value,
846
898
  {
847
899
  placeholder: placeholder ?? "Select an option",
@@ -849,7 +901,7 @@ var Select = forwardRef8(
849
901
  children: handleLabels()
850
902
  }
851
903
  ) }),
852
- /* @__PURE__ */ jsx14(
904
+ /* @__PURE__ */ jsx15(
853
905
  ChevronDownIcon2,
854
906
  {
855
907
  className: "transform text-black group-data-[state=open]:rotate-180",
@@ -859,7 +911,7 @@ var Select = forwardRef8(
859
911
  ]
860
912
  }
861
913
  ),
862
- /* @__PURE__ */ jsx14(SelectPrimitive.Portal, { container: containerRef.current, children: /* @__PURE__ */ jsx14(
914
+ /* @__PURE__ */ jsx15(SelectPrimitive.Portal, { container: containerRef.current, children: /* @__PURE__ */ jsx15(
863
915
  SelectPrimitive.Content,
864
916
  {
865
917
  hideWhenDetached: true,
@@ -869,15 +921,15 @@ var Select = forwardRef8(
869
921
  onPointerDownOutside: toggleOpen,
870
922
  onKeyDown: closeOnEscape,
871
923
  children: /* @__PURE__ */ jsxs8(SelectPrimitive.Viewport, { children: [
872
- multiselect && !!chipLabels?.length && /* @__PURE__ */ jsx14(
924
+ multiselect && !!chipLabels?.length && /* @__PURE__ */ jsx15(
873
925
  SelectPrimitive.Group,
874
926
  {
875
927
  className: "mb-2 flex flex-row flex-wrap gap-1 px-2",
876
928
  "data-testid": "selected-labels",
877
929
  children: chipLabels?.map(
878
930
  (chip) => chip && /* @__PURE__ */ jsxs8(Chip_default, { size: "small", variant: "primary", children: [
879
- /* @__PURE__ */ jsx14("span", { children: chip.title }),
880
- /* @__PURE__ */ jsx14(
931
+ /* @__PURE__ */ jsx15("span", { children: chip.title }),
932
+ /* @__PURE__ */ jsx15(
881
933
  X2,
882
934
  {
883
935
  size: 18,
@@ -890,7 +942,7 @@ var Select = forwardRef8(
890
942
  )
891
943
  }
892
944
  ),
893
- /* @__PURE__ */ jsx14(Separator, {}),
945
+ /* @__PURE__ */ jsx15(Separator, {}),
894
946
  options?.map(({ id: id2, title, value: value2 }) => /* @__PURE__ */ jsxs8(
895
947
  SelectPrimitive.Item,
896
948
  {
@@ -900,8 +952,8 @@ var Select = forwardRef8(
900
952
  onKeyDown: (e) => setValueOnEnter(e, value2),
901
953
  onClick: () => handleChange(value2),
902
954
  children: [
903
- /* @__PURE__ */ jsx14(SelectPrimitive.ItemText, { children: title }),
904
- /* @__PURE__ */ jsx14(
955
+ /* @__PURE__ */ jsx15(SelectPrimitive.ItemText, { children: title }),
956
+ /* @__PURE__ */ jsx15(
905
957
  CheckIcon2,
906
958
  {
907
959
  className: "absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block",
@@ -918,7 +970,7 @@ var Select = forwardRef8(
918
970
  ]
919
971
  }
920
972
  ),
921
- /* @__PURE__ */ jsx14(ErrorMessage_default, { message: error, className: "mt-1" })
973
+ /* @__PURE__ */ jsx15(ErrorMessage_default, { message: error })
922
974
  ]
923
975
  }
924
976
  );
@@ -928,14 +980,15 @@ Select.displayName = "Select";
928
980
  var Select_default = Select;
929
981
 
930
982
  // src/components/demos/SelectDemo.tsx
931
- import { jsx as jsx15, jsxs as jsxs9 } from "react/jsx-runtime";
983
+ import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
932
984
  function SelectDemo() {
933
985
  return /* @__PURE__ */ jsxs9("div", { className: "m-4", children: [
934
- /* @__PURE__ */ jsx15("h3", { children: "Select" }),
935
- /* @__PURE__ */ jsxs9("div", { className: "flex max-w-sm flex-col gap-4 mt-2", children: [
936
- /* @__PURE__ */ jsx15(
986
+ /* @__PURE__ */ jsx16("h3", { children: "Select" }),
987
+ /* @__PURE__ */ jsxs9("div", { className: "mt-2 flex max-w-sm flex-col gap-4", children: [
988
+ /* @__PURE__ */ jsx16(
937
989
  Select_default,
938
990
  {
991
+ required: true,
939
992
  label: "Label - Singleselect",
940
993
  placeholder: "Select an option",
941
994
  options: [
@@ -945,12 +998,13 @@ function SelectDemo() {
945
998
  ]
946
999
  }
947
1000
  ),
948
- /* @__PURE__ */ jsx15(
1001
+ /* @__PURE__ */ jsx16(
949
1002
  Select_default,
950
1003
  {
951
1004
  multiselect: true,
952
1005
  label: "Label - Multiselect",
953
1006
  placeholder: "Select an option",
1007
+ description: "This is a tooltip",
954
1008
  options: [
955
1009
  { id: "1", value: "1", title: "Option 1" },
956
1010
  { id: "2", value: "2", title: "Option 2" },
@@ -965,7 +1019,7 @@ function SelectDemo() {
965
1019
  ]
966
1020
  }
967
1021
  ),
968
- /* @__PURE__ */ jsx15(
1022
+ /* @__PURE__ */ jsx16(
969
1023
  Select_default,
970
1024
  {
971
1025
  disabled: true,
@@ -986,10 +1040,10 @@ var SelectDemo_default = SelectDemo;
986
1040
  // src/components/ui/Input.tsx
987
1041
  import { cva as cva5 } from "cva";
988
1042
  import { icons as icons3, X as X3 } from "lucide-react";
989
- import { forwardRef as forwardRef9 } from "react";
990
- import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
991
- var Input = forwardRef9(
992
- ({ label, error, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
1043
+ import { forwardRef as forwardRef10 } from "react";
1044
+ import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
1045
+ var Input = forwardRef10(
1046
+ ({ label, error, description, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
993
1047
  const handleClear = () => {
994
1048
  onChange?.({ target: { value: "" } });
995
1049
  onClear?.();
@@ -998,16 +1052,25 @@ var Input = forwardRef9(
998
1052
  const placeholder = props.placeholder ?? (icon === "Search" ? "Search..." : "");
999
1053
  const hasIcon = !!icon;
1000
1054
  const iconColor = theme === "dark" ? "text-white" : "text-grey-80";
1001
- return /* @__PURE__ */ jsxs10("div", { className: "group flex w-full flex-col", "data-testid": `input-wrapper-${props.id}`, children: [
1002
- label && /* @__PURE__ */ jsx16(Label_default, { text: label, htmlFor: props.name, className: cn("body mb-1", classNames?.label) }),
1055
+ return /* @__PURE__ */ jsxs10("div", { className: "group flex w-full flex-col gap-1", "data-testid": `input-wrapper-${props.id}`, children: [
1056
+ label && /* @__PURE__ */ jsx17(
1057
+ Label_default,
1058
+ {
1059
+ text: label,
1060
+ htmlFor: props.name,
1061
+ required: props.required,
1062
+ description,
1063
+ className: classNames?.label
1064
+ }
1065
+ ),
1003
1066
  /* @__PURE__ */ jsxs10("div", { className: "relative flex flex-row items-center", children: [
1004
- IconComponent && /* @__PURE__ */ jsx16(
1067
+ IconComponent && /* @__PURE__ */ jsx17(
1005
1068
  IconComponent,
1006
1069
  {
1007
1070
  className: `absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`
1008
1071
  }
1009
1072
  ),
1010
- /* @__PURE__ */ jsx16(
1073
+ /* @__PURE__ */ jsx17(
1011
1074
  "input",
1012
1075
  {
1013
1076
  className: cn(inputVariants({ theme, hasIcon })),
@@ -1019,7 +1082,7 @@ var Input = forwardRef9(
1019
1082
  ...props
1020
1083
  }
1021
1084
  ),
1022
- hasIcon && value && /* @__PURE__ */ jsx16(
1085
+ hasIcon && value && /* @__PURE__ */ jsx17(
1023
1086
  X3,
1024
1087
  {
1025
1088
  className: `absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`,
@@ -1028,7 +1091,7 @@ var Input = forwardRef9(
1028
1091
  }
1029
1092
  )
1030
1093
  ] }),
1031
- /* @__PURE__ */ jsx16(ErrorMessage_default, { message: error, className: "mt-1" })
1094
+ /* @__PURE__ */ jsx17(ErrorMessage_default, { message: error })
1032
1095
  ] });
1033
1096
  }
1034
1097
  );
@@ -1084,34 +1147,202 @@ var inputVariants = cva5(
1084
1147
  var Input_default = Input;
1085
1148
 
1086
1149
  // src/components/demos/InputDemo.tsx
1087
- import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
1150
+ import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
1088
1151
  function InputDemo() {
1089
1152
  return /* @__PURE__ */ jsxs11("div", { className: "m-4", children: [
1090
- /* @__PURE__ */ jsx17("h3", { children: "Input" }),
1153
+ /* @__PURE__ */ jsx18("h3", { children: "Input" }),
1091
1154
  /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2 md:flex-row", children: [
1092
- /* @__PURE__ */ jsx17("div", { className: "bg-green-80 p-2", children: /* @__PURE__ */ jsx17(Input_default, { theme: "dark", icon: "Search" }) }),
1093
- /* @__PURE__ */ jsx17("div", { className: "p-2", children: /* @__PURE__ */ jsx17(Input_default, {}) }),
1094
- /* @__PURE__ */ jsx17("div", { className: "p-2", children: /* @__PURE__ */ jsx17(Input_default, { icon: "MapPin" }) })
1155
+ /* @__PURE__ */ jsx18("div", { className: "bg-green-80 p-2", children: /* @__PURE__ */ jsx18(Input_default, { theme: "dark", icon: "Search" }) }),
1156
+ /* @__PURE__ */ jsx18("div", { className: "p-2", children: /* @__PURE__ */ jsx18(Input_default, { label: "Required input", required: true, description: "This is a tooltip" }) }),
1157
+ /* @__PURE__ */ jsx18("div", { className: "p-2", children: /* @__PURE__ */ jsx18(Input_default, { icon: "MapPin" }) })
1095
1158
  ] })
1096
1159
  ] });
1097
1160
  }
1098
1161
  var InputDemo_default = InputDemo;
1099
1162
 
1163
+ // src/components/ui/Counter.tsx
1164
+ import { cva as cva6 } from "cva";
1165
+ import { Minus as Minus2, Plus } from "lucide-react";
1166
+ import { forwardRef as forwardRef11, useEffect as useEffect3, useState as useState4 } from "react";
1167
+ import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
1168
+ var Counter = forwardRef11(
1169
+ ({ label, error, min, max, step = 1, description, theme, value, classNames, onChange, ...props }, ref) => {
1170
+ const [count, setCount] = useState4(0);
1171
+ useEffect3(() => {
1172
+ setCount(value ?? 0);
1173
+ }, [value]);
1174
+ const handleChange = (e) => {
1175
+ const newValue = parseInt(e.target.value.replace(/\D/g, ""), 10);
1176
+ if (isNaN(newValue)) return;
1177
+ if (min && newValue < min) {
1178
+ onChange?.(min);
1179
+ setCount(min);
1180
+ return;
1181
+ }
1182
+ if (max && newValue > max) {
1183
+ onChange?.(max);
1184
+ setCount(max);
1185
+ return;
1186
+ }
1187
+ onChange?.(newValue);
1188
+ setCount(newValue);
1189
+ };
1190
+ const decrement = () => {
1191
+ const proposedValue = count - step;
1192
+ const newValue = Math.max(min ?? -Infinity, proposedValue);
1193
+ onChange?.(newValue);
1194
+ setCount(newValue);
1195
+ };
1196
+ const increment = () => {
1197
+ const proposedValue = count + step;
1198
+ const newValue = Math.min(max ?? Infinity, proposedValue);
1199
+ onChange?.(newValue);
1200
+ setCount(newValue);
1201
+ };
1202
+ return /* @__PURE__ */ jsxs12(
1203
+ "div",
1204
+ {
1205
+ className: cn("flex w-auto flex-col gap-1", classNames?.root),
1206
+ "data-testid": `counter-wrapper-${props.id}`,
1207
+ children: [
1208
+ label && /* @__PURE__ */ jsx19(
1209
+ Label_default,
1210
+ {
1211
+ text: label,
1212
+ htmlFor: props.name,
1213
+ required: props.required,
1214
+ description,
1215
+ className: classNames?.label
1216
+ }
1217
+ ),
1218
+ /* @__PURE__ */ jsxs12("div", { className: "relative flex w-[122px] flex-row items-center", children: [
1219
+ /* @__PURE__ */ jsx19(
1220
+ "button",
1221
+ {
1222
+ type: "button",
1223
+ className: "absolute inset-y-0 left-1 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20",
1224
+ onClick: decrement,
1225
+ children: /* @__PURE__ */ jsx19(Minus2, { className: "h-4 w-4 text-green-100" })
1226
+ }
1227
+ ),
1228
+ /* @__PURE__ */ jsx19(
1229
+ "input",
1230
+ {
1231
+ className: cn(counterVariants({ theme }), classNames?.input),
1232
+ ref,
1233
+ value: count,
1234
+ onChange: handleChange,
1235
+ "data-testid": `counter-element-${props.id}`,
1236
+ ...props
1237
+ }
1238
+ ),
1239
+ /* @__PURE__ */ jsx19(
1240
+ "button",
1241
+ {
1242
+ type: "button",
1243
+ 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",
1244
+ onClick: increment,
1245
+ children: /* @__PURE__ */ jsx19(Plus, { className: "h-4 w-4 text-green-100" })
1246
+ }
1247
+ )
1248
+ ] }),
1249
+ /* @__PURE__ */ jsx19(ErrorMessage_default, { message: error })
1250
+ ]
1251
+ }
1252
+ );
1253
+ }
1254
+ );
1255
+ Counter.displayName = "Counter";
1256
+ var counterVariants = cva6(
1257
+ [
1258
+ "border-input",
1259
+ "placeholder:text-muted-foreground",
1260
+ "focus-visible:ring-ring",
1261
+ "inline-flex",
1262
+ "w-[122px]",
1263
+ "h-11",
1264
+ "items-center",
1265
+ "justify-start",
1266
+ "gap-3",
1267
+ "rounded-lg",
1268
+ "bg-transparent",
1269
+ "px-3",
1270
+ "pt-0.5",
1271
+ "text-sm",
1272
+ "text-center",
1273
+ "shadow-sm",
1274
+ "ring-grey-50",
1275
+ "transition-colors",
1276
+ "focus-visible:outline-none",
1277
+ "focus-visible:ring-1",
1278
+ "disabled:cursor-not-allowed",
1279
+ "disabled:opacity-50",
1280
+ "appearance-none",
1281
+ "[&::-webkit-search-cancel-button]:appearance-none",
1282
+ "[&::-webkit-search-decoration]:appearance-none",
1283
+ "[&::-webkit-search-results-button]:appearance-none",
1284
+ "[&::-webkit-search-results-decoration]:appearance-none",
1285
+ "[&::-ms-clear]:display-none",
1286
+ "[&::-ms-reveal]:display-none"
1287
+ ],
1288
+ {
1289
+ variants: {
1290
+ theme: {
1291
+ light: "text-grey-80 border",
1292
+ dark: "text-white"
1293
+ },
1294
+ hasIcon: {
1295
+ false: "pl-3",
1296
+ true: "pl-8"
1297
+ }
1298
+ },
1299
+ defaultVariants: {
1300
+ theme: "light",
1301
+ hasIcon: false
1302
+ }
1303
+ }
1304
+ );
1305
+
1306
+ // src/components/demos/CounterDemo.tsx
1307
+ import { useState as useState5 } from "react";
1308
+ import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
1309
+ function CounterDemo() {
1310
+ const [count, setCount] = useState5(0);
1311
+ return /* @__PURE__ */ jsxs13("div", { className: "m-4", children: [
1312
+ /* @__PURE__ */ jsx20("h3", { children: "Counter" }),
1313
+ /* @__PURE__ */ jsxs13("div", { className: "flex flex-col gap-2 md:flex-row", children: [
1314
+ /* @__PURE__ */ jsx20("div", { className: "p-2", children: /* @__PURE__ */ jsx20(
1315
+ Counter,
1316
+ {
1317
+ label: "Required Counter",
1318
+ required: true,
1319
+ value: count,
1320
+ onChange: setCount,
1321
+ description: "This is a tooltip"
1322
+ }
1323
+ ) }),
1324
+ /* @__PURE__ */ jsx20("div", { className: "p-2", children: /* @__PURE__ */ jsx20(Counter, { min: 0, max: 10, step: 2 }) })
1325
+ ] })
1326
+ ] });
1327
+ }
1328
+ var CounterDemo_default = CounterDemo;
1329
+
1100
1330
  // src/components/demos/index.tsx
1101
- import { jsx as jsx18, jsxs as jsxs12 } from "react/jsx-runtime";
1331
+ import { jsx as jsx21, jsxs as jsxs14 } from "react/jsx-runtime";
1102
1332
  function Demos() {
1103
- return /* @__PURE__ */ jsxs12("div", { children: [
1104
- /* @__PURE__ */ jsx18(ComboboxDemo_default, {}),
1105
- /* @__PURE__ */ jsx18(SelectDemo_default, {}),
1106
- /* @__PURE__ */ jsx18(InputDemo_default, {})
1333
+ return /* @__PURE__ */ jsxs14("div", { children: [
1334
+ /* @__PURE__ */ jsx21(ComboboxDemo_default, {}),
1335
+ /* @__PURE__ */ jsx21(SelectDemo_default, {}),
1336
+ /* @__PURE__ */ jsx21(InputDemo_default, {}),
1337
+ /* @__PURE__ */ jsx21(CounterDemo_default, {})
1107
1338
  ] });
1108
1339
  }
1109
1340
  var demos_default = Demos;
1110
1341
 
1111
1342
  // src/app/page.tsx
1112
- import { jsx as jsx19 } from "react/jsx-runtime";
1343
+ import { jsx as jsx22 } from "react/jsx-runtime";
1113
1344
  async function Page() {
1114
- return /* @__PURE__ */ jsx19(demos_default, {});
1345
+ return /* @__PURE__ */ jsx22(demos_default, {});
1115
1346
  }
1116
1347
  var page_default = Page;
1117
1348
  export {