@next-degree/pickle-shared-js 0.7.52 → 0.9.2

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 (107) hide show
  1. package/dist/components/jobPost/JobDescription.cjs +2 -1
  2. package/dist/components/jobPost/JobDescription.cjs.map +1 -1
  3. package/dist/components/jobPost/JobDescription.js +2 -1
  4. package/dist/components/jobPost/JobDescription.js.map +1 -1
  5. package/dist/components/jobPost/JobPost.cjs +2 -1
  6. package/dist/components/jobPost/JobPost.cjs.map +1 -1
  7. package/dist/components/jobPost/JobPost.d.cts +1 -1
  8. package/dist/components/jobPost/JobPost.d.ts +1 -1
  9. package/dist/components/jobPost/JobPost.js +2 -1
  10. package/dist/components/jobPost/JobPost.js.map +1 -1
  11. package/dist/components/primitives/command.d.cts +7 -7
  12. package/dist/components/primitives/command.d.ts +7 -7
  13. package/dist/components/primitives/input-otp.d.cts +2 -2
  14. package/dist/components/primitives/input-otp.d.ts +2 -2
  15. package/dist/components/primitives/radio-group.cjs +74 -0
  16. package/dist/components/primitives/radio-group.cjs.map +1 -0
  17. package/dist/components/primitives/radio-group.d.cts +9 -0
  18. package/dist/components/primitives/radio-group.d.ts +9 -0
  19. package/dist/components/primitives/radio-group.js +39 -0
  20. package/dist/components/primitives/radio-group.js.map +1 -0
  21. package/dist/components/ui/Button.cjs +2 -1
  22. package/dist/components/ui/Button.cjs.map +1 -1
  23. package/dist/components/ui/Button.d.cts +1 -1
  24. package/dist/components/ui/Button.d.ts +1 -1
  25. package/dist/components/ui/Button.js +2 -1
  26. package/dist/components/ui/Button.js.map +1 -1
  27. package/dist/components/ui/Checkbox.cjs +38 -13
  28. package/dist/components/ui/Checkbox.cjs.map +1 -1
  29. package/dist/components/ui/Checkbox.d.cts +2 -1
  30. package/dist/components/ui/Checkbox.d.ts +2 -1
  31. package/dist/components/ui/Checkbox.js +31 -11
  32. package/dist/components/ui/Checkbox.js.map +1 -1
  33. package/dist/components/ui/Combobox.cjs +62 -41
  34. package/dist/components/ui/Combobox.cjs.map +1 -1
  35. package/dist/components/ui/Combobox.js +53 -32
  36. package/dist/components/ui/Combobox.js.map +1 -1
  37. package/dist/components/ui/DatePicker.cjs +133 -149
  38. package/dist/components/ui/DatePicker.cjs.map +1 -1
  39. package/dist/components/ui/DatePicker.js +132 -148
  40. package/dist/components/ui/DatePicker.js.map +1 -1
  41. package/dist/components/ui/ListItem.cjs +40 -21
  42. package/dist/components/ui/ListItem.cjs.map +1 -1
  43. package/dist/components/ui/ListItem.js +36 -17
  44. package/dist/components/ui/ListItem.js.map +1 -1
  45. package/dist/components/ui/Radio.cjs +177 -0
  46. package/dist/components/ui/Radio.cjs.map +1 -0
  47. package/dist/components/ui/Radio.d.cts +27 -0
  48. package/dist/components/ui/Radio.d.ts +27 -0
  49. package/dist/components/ui/Radio.js +142 -0
  50. package/dist/components/ui/Radio.js.map +1 -0
  51. package/dist/components/ui/ReadMore.cjs +2 -1
  52. package/dist/components/ui/ReadMore.cjs.map +1 -1
  53. package/dist/components/ui/ReadMore.js +2 -1
  54. package/dist/components/ui/ReadMore.js.map +1 -1
  55. package/dist/components/ui/Select.cjs +48 -24
  56. package/dist/components/ui/Select.cjs.map +1 -1
  57. package/dist/components/ui/Select.js +49 -25
  58. package/dist/components/ui/Select.js.map +1 -1
  59. package/dist/components/ui/Switch.cjs +83 -0
  60. package/dist/components/ui/Switch.cjs.map +1 -0
  61. package/dist/components/ui/Switch.d.cts +10 -0
  62. package/dist/components/ui/Switch.d.ts +10 -0
  63. package/dist/components/ui/Switch.js +48 -0
  64. package/dist/components/ui/Switch.js.map +1 -0
  65. package/dist/components/ui/buttonShadcn.cjs +2 -9
  66. package/dist/components/ui/buttonShadcn.cjs.map +1 -1
  67. package/dist/components/ui/buttonShadcn.d.cts +2 -2
  68. package/dist/components/ui/buttonShadcn.d.ts +2 -2
  69. package/dist/components/ui/buttonShadcn.js +2 -9
  70. package/dist/components/ui/buttonShadcn.js.map +1 -1
  71. package/dist/components/ui/calendar.cjs +7 -17
  72. package/dist/components/ui/calendar.cjs.map +1 -1
  73. package/dist/components/ui/calendar.js +7 -17
  74. package/dist/components/ui/calendar.js.map +1 -1
  75. package/dist/{displayText-6TMMBOmQ.d.cts → displayText-ca_ofoAC.d.cts} +2 -2
  76. package/dist/{displayText-BCC_oy5I.d.ts → displayText-eoAHqSNz.d.ts} +2 -2
  77. package/dist/hooks/useDisplayText.d.cts +3 -3
  78. package/dist/hooks/useDisplayText.d.ts +3 -3
  79. package/dist/index.cjs +454 -327
  80. package/dist/index.cjs.map +1 -1
  81. package/dist/index.d.cts +12 -7
  82. package/dist/index.d.ts +12 -7
  83. package/dist/index.js +434 -309
  84. package/dist/index.js.map +1 -1
  85. package/dist/lib/locations.d.cts +2 -2
  86. package/dist/lib/locations.d.ts +2 -2
  87. package/dist/lib/mappings.d.cts +3 -3
  88. package/dist/lib/mappings.d.ts +3 -3
  89. package/dist/lib/salaryRange.d.cts +1 -1
  90. package/dist/lib/salaryRange.d.ts +1 -1
  91. package/dist/services/displayText.d.cts +3 -3
  92. package/dist/services/displayText.d.ts +3 -3
  93. package/dist/styles/globals.css +78 -0
  94. package/dist/styles/globals.css.map +1 -1
  95. package/dist/types/data/company_service_latest.d.cts +1 -1
  96. package/dist/types/data/company_service_latest.d.ts +1 -1
  97. package/dist/types/data/job_posting_service_latest.d.cts +1 -1
  98. package/dist/types/data/job_posting_service_latest.d.ts +1 -1
  99. package/dist/types/data/shared_pickle_output_latest.d.cts +1 -1
  100. package/dist/types/data/shared_pickle_output_latest.d.ts +1 -1
  101. package/package.json +7 -10
  102. package/dist/{company_service_latest-BUKbZgpZ.d.cts → company_service_latest-CRQFzMep.d.cts} +366 -366
  103. package/dist/{company_service_latest-BUKbZgpZ.d.ts → company_service_latest-CRQFzMep.d.ts} +366 -366
  104. package/dist/{job_posting_service_latest-2KcpupDl.d.cts → job_posting_service_latest-BOVbz68F.d.cts} +324 -324
  105. package/dist/{job_posting_service_latest-2KcpupDl.d.ts → job_posting_service_latest-BOVbz68F.d.ts} +324 -324
  106. package/dist/{shared_pickle_output_latest-D2n-PRlx.d.cts → shared_pickle_output_latest-DKOmTyYk.d.cts} +20 -20
  107. package/dist/{shared_pickle_output_latest-D2n-PRlx.d.ts → shared_pickle_output_latest-DKOmTyYk.d.ts} +20 -20
@@ -48,9 +48,17 @@ function cn(...inputs) {
48
48
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
49
49
  }
50
50
 
51
- // src/components/ui/Checkbox.tsx
51
+ // src/components/ui/ErrorMessage.tsx
52
52
  var import_jsx_runtime = require("react/jsx-runtime");
53
- var CheckboxToggle = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
53
+ function ErrorMessage({ message, className, ...props }) {
54
+ if (!message) return null;
55
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
56
+ }
57
+ var ErrorMessage_default = ErrorMessage;
58
+
59
+ // src/components/ui/Checkbox.tsx
60
+ var import_jsx_runtime2 = require("react/jsx-runtime");
61
+ var CheckboxToggle = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
54
62
  CheckboxPrimitive.Root,
55
63
  {
56
64
  ref,
@@ -80,29 +88,40 @@ var CheckboxToggle = (0, import_react.forwardRef)(({ className, ...props }, ref)
80
88
  className
81
89
  ),
82
90
  ...props,
83
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
84
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }),
85
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
91
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
92
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }),
93
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react.Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
86
94
  ] })
87
95
  }
88
96
  ));
89
97
  CheckboxToggle.displayName = CheckboxPrimitive.Root.displayName;
90
98
  var Checkbox = (0, import_react.forwardRef)(
91
- ({ classNames, children, ...props }, ref) => {
92
- const { disabled } = props;
99
+ ({ error, classNames, children, ...props }, ref) => {
93
100
  const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`;
94
- const labelClassName = disabled ? "text-grey-40 pointer-events-none" : "";
95
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: cn("flex space-x-2", classNames?.wrapper), children: [
96
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CheckboxToggle, { id, disabled, ref, ...props }),
97
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: id, className: cn(labelClassName, classNames?.label), children })
101
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: cn("flex space-x-2", classNames?.wrapper), children: [
102
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CheckboxToggle, { id, ref, ...props }),
103
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
104
+ "label",
105
+ {
106
+ htmlFor: id,
107
+ className: cn(
108
+ "text-sm",
109
+ props.disabled && "pointer-events-none text-grey-40",
110
+ classNames?.label
111
+ ),
112
+ children: [
113
+ children,
114
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ErrorMessage_default, { message: error, className: "mt-1" })
115
+ ]
116
+ }
117
+ )
98
118
  ] });
99
119
  }
100
120
  );
101
121
  Checkbox.displayName = "Checkbox";
102
- var Checkbox_default = Checkbox;
103
122
 
104
123
  // src/components/ui/ListItem.tsx
105
- var import_jsx_runtime2 = require("react/jsx-runtime");
124
+ var import_jsx_runtime3 = require("react/jsx-runtime");
106
125
  function ListItem({
107
126
  icon,
108
127
  hasCheckbox,
@@ -116,12 +135,12 @@ function ListItem({
116
135
  const getIconIfValid = (icon2) => {
117
136
  if (icon2 in import_lucide_react3.icons) {
118
137
  const IconComponent = import_lucide_react3.icons[icon2];
119
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(IconComponent, { size: 14 });
138
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(IconComponent, { size: 14 });
120
139
  }
121
140
  return null;
122
141
  };
123
142
  const optionIcon = icon ? getIconIfValid(icon) : void 0;
124
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
143
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
125
144
  "li",
126
145
  {
127
146
  className: cn(
@@ -131,13 +150,13 @@ function ListItem({
131
150
  ...props,
132
151
  "data-state": isSelected ? "checked" : "unchecked",
133
152
  children: [
134
- optionIcon && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "mr-2", children: optionIcon }),
135
- hasCheckbox && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Checkbox_default, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
136
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
137
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: title }),
138
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "text-xs text-grey-80", children: description })
153
+ optionIcon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "mr-2", children: optionIcon }),
154
+ hasCheckbox && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Checkbox, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
155
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
156
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { children: title }),
157
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-xs text-grey-80", children: description })
139
158
  ] }),
140
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
159
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
141
160
  import_lucide_react2.CheckIcon,
142
161
  {
143
162
  className: "absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ui/ListItem.tsx","../../../src/components/ui/Checkbox.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import { CheckIcon } from 'lucide-react'\nimport { icons } from 'lucide-react'\nimport { type ComponentPropsWithoutRef, type ReactNode } from 'react'\n\nimport Checkbox from '@/components/ui/Checkbox'\nimport { cn } from '@/lib/utils'\n\ntype IconKey = keyof typeof icons\n\ninterface ListItemProps extends ComponentPropsWithoutRef<'li'> {\n icon?: string\n hasCheckbox?: boolean\n isSelected?: boolean\n title: string\n value: string\n description?: string\n}\n\nfunction ListItem({\n icon,\n hasCheckbox,\n isSelected,\n className,\n title,\n value,\n description,\n ...props\n}: ListItemProps) {\n const getIconIfValid = (icon: string): ReactNode => {\n if (icon in icons) {\n const IconComponent = icons[icon as IconKey]\n return <IconComponent size={14} />\n }\n return null\n }\n\n const optionIcon = icon ? getIconIfValid(icon) : undefined\n\n return (\n <li\n className={cn(\n 'group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm',\n className\n )}\n {...props}\n data-state={isSelected ? 'checked' : 'unchecked'}\n >\n {optionIcon && <span className=\"mr-2\">{optionIcon}</span>}\n {hasCheckbox && (\n <Checkbox id={value} checked={isSelected} onClick={(e) => e.preventDefault()} />\n )}\n <div>\n <p>{title}</p>\n <p className=\"text-xs text-grey-80\">{description}</p>\n </div>\n\n <CheckIcon\n className=\"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block\"\n size={16}\n />\n </li>\n )\n}\n\nexport default ListItem\n","'use client'\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n type ElementRef,\n forwardRef,\n type PropsWithChildren,\n} from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst CheckboxToggle = forwardRef<\n ElementRef<typeof CheckboxPrimitive.Root>,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group',\n 'peer',\n 'h-5',\n 'w-5',\n 'shrink-0',\n 'rounded-md',\n 'border',\n 'border-grey-10',\n 'outline',\n 'outline-1',\n 'outline-offset-2',\n 'outline-transparent',\n 'hover:border-grey-20',\n 'focus:outline-purple-100',\n 'active:border-green-80',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'data-[state=checked]:bg-green-80',\n 'data-[state=indeterminate]:bg-green-80',\n 'data-[state=checked]:text-white',\n 'data-[state=indeterminate]:text-primary-foreground',\n props.disabled &&\n 'data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <Check className=\"hidden h-4 w-4 group-data-[state=checked]:block\" />\n <Minus className=\"hidden h-4 w-4 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckboxToggle.displayName = CheckboxPrimitive.Root.displayName\n\ninterface Props extends CheckboxPrimitive.CheckboxProps, PropsWithChildren {\n error?: string\n classNames?: {\n wrapper?: string\n label?: string\n }\n}\n\nconst Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(\n ({ classNames, children, ...props }, ref) => {\n const { disabled } = props\n const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`\n const labelClassName = disabled ? 'text-grey-40 pointer-events-none' : ''\n return (\n <div className={cn('flex space-x-2', classNames?.wrapper)}>\n <CheckboxToggle id={id} disabled={disabled} ref={ref} {...props} />\n <label htmlFor={id} className={cn(labelClassName, classNames?.label)}>\n {children}\n </label>\n </div>\n )\n }\n)\nCheckbox.displayName = 'Checkbox'\n\nexport default Checkbox\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,uBAA0B;AAC1B,IAAAA,uBAAsB;;;ACCtB,wBAAmC;AACnC,0BAA6B;AAC7B,mBAKO;;;ACTP,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;AD0CI;AAlCJ,IAAM,qBAAiB,yBAGrB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAmB;AAAA,EAAlB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM,YACJ;AAAA,MACF;AAAA,IACF;AAAA,IACC,GAAG;AAAA,IAEJ,uDAAmB,6BAAlB,EAA4B,WAAU,iDACrC;AAAA,kDAAC,6BAAM,WAAU,mDAAkD;AAAA,MACnE,4CAAC,6BAAM,WAAU,yDAAwD;AAAA,OAC3E;AAAA;AACF,CACD;AACD,eAAe,cAAgC,uBAAK;AAUpD,IAAM,eAAW;AAAA,EACf,CAAC,EAAE,YAAY,UAAU,GAAG,MAAM,GA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AAAA,QACR;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,mBAAQ;","names":["import_lucide_react","import_jsx_runtime","icon"]}
1
+ {"version":3,"sources":["../../../src/components/ui/ListItem.tsx","../../../src/components/ui/Checkbox.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx"],"sourcesContent":["import { CheckIcon } from 'lucide-react'\nimport { icons } from 'lucide-react'\nimport { type ComponentPropsWithoutRef, type ReactNode } from 'react'\n\nimport { Checkbox } from '@/components/ui/Checkbox'\nimport { cn } from '@/lib/utils'\n\ntype IconKey = keyof typeof icons\n\ninterface ListItemProps extends ComponentPropsWithoutRef<'li'> {\n icon?: string\n hasCheckbox?: boolean\n isSelected?: boolean\n title: string\n value: string\n description?: string\n}\n\nfunction ListItem({\n icon,\n hasCheckbox,\n isSelected,\n className,\n title,\n value,\n description,\n ...props\n}: ListItemProps) {\n const getIconIfValid = (icon: string): ReactNode => {\n if (icon in icons) {\n const IconComponent = icons[icon as IconKey]\n return <IconComponent size={14} />\n }\n return null\n }\n\n const optionIcon = icon ? getIconIfValid(icon) : undefined\n\n return (\n <li\n className={cn(\n 'group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm',\n className\n )}\n {...props}\n data-state={isSelected ? 'checked' : 'unchecked'}\n >\n {optionIcon && <span className=\"mr-2\">{optionIcon}</span>}\n {hasCheckbox && (\n <Checkbox id={value} checked={isSelected} onClick={(e) => e.preventDefault()} />\n )}\n <div>\n <p>{title}</p>\n <p className=\"text-xs text-grey-80\">{description}</p>\n </div>\n\n <CheckIcon\n className=\"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block\"\n size={16}\n />\n </li>\n )\n}\n\nexport default ListItem\n","'use client'\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n type ElementRef,\n forwardRef,\n type PropsWithChildren,\n} from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport { cn } from '@/lib/utils'\n\nexport const CheckboxToggle = forwardRef<\n ElementRef<typeof CheckboxPrimitive.Root>,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group',\n 'peer',\n 'h-5',\n 'w-5',\n 'shrink-0',\n 'rounded-md',\n 'border',\n 'border-grey-10',\n 'outline',\n 'outline-1',\n 'outline-offset-2',\n 'outline-transparent',\n 'hover:border-grey-20',\n 'focus:outline-purple-100',\n 'active:border-green-80',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'data-[state=checked]:bg-green-80',\n 'data-[state=indeterminate]:bg-green-80',\n 'data-[state=checked]:text-white',\n 'data-[state=indeterminate]:text-primary-foreground',\n props.disabled &&\n 'data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <Check className=\"hidden h-4 w-4 group-data-[state=checked]:block\" />\n <Minus className=\"hidden h-4 w-4 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckboxToggle.displayName = CheckboxPrimitive.Root.displayName\n\ninterface Props extends CheckboxPrimitive.CheckboxProps, PropsWithChildren {\n error?: string\n classNames?: {\n wrapper?: string\n label?: string\n }\n}\n\nexport const Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(\n ({ error, classNames, children, ...props }, ref) => {\n const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`\n return (\n <div className={cn('flex space-x-2', classNames?.wrapper)}>\n <CheckboxToggle id={id} ref={ref} {...props} />\n <label\n htmlFor={id}\n className={cn(\n 'text-sm',\n props.disabled && 'pointer-events-none text-grey-40',\n classNames?.label\n )}\n >\n {children}\n\n <ErrorMessage message={error} className=\"mt-1\" />\n </label>\n </div>\n )\n }\n)\nCheckbox.displayName = 'Checkbox'\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,uBAA0B;AAC1B,IAAAA,uBAAsB;;;ACCtB,wBAAmC;AACnC,0BAA6B;AAC7B,mBAKO;;;ACTP,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACOI;AAJJ,SAAS,aAAa,EAAE,SAAS,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,QAAS,QAAO;AAErB,SACE,4CAAC,OAAE,WAAW,GAAG,6BAA6B,SAAS,GAAI,GAAG,OAC3D,mBACH;AAEJ;AAEA,IAAO,uBAAQ;;;AF8BX,IAAAC,sBAAA;AAlCG,IAAM,qBAAiB,yBAG5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAmB;AAAA,EAAlB;AAAA,IACC;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AA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AA,MACJ,cAAY,aAAa,YAAY;AAAA,MAEpC;AAAA,sBAAc,6CAAC,UAAK,WAAU,QAAQ,sBAAW;AAAA,QACjD,eACC,6CAAC,YAAS,IAAI,OAAO,SAAS,YAAY,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG;AAAA,QAEhF,8CAAC,SACC;AAAA,uDAAC,OAAG,iBAAM;AAAA,UACV,6CAAC,OAAE,WAAU,wBAAwB,uBAAY;AAAA,WACnD;AAAA,QAEA;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,MAAM;AAAA;AAAA,QACR;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,mBAAQ;","names":["import_lucide_react","import_jsx_runtime","import_jsx_runtime","icon"]}
@@ -16,9 +16,17 @@ function cn(...inputs) {
16
16
  return twMerge(clsx(inputs));
17
17
  }
18
18
 
19
+ // src/components/ui/ErrorMessage.tsx
20
+ import { jsx } from "react/jsx-runtime";
21
+ function ErrorMessage({ message, className, ...props }) {
22
+ if (!message) return null;
23
+ return /* @__PURE__ */ jsx("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
24
+ }
25
+ var ErrorMessage_default = ErrorMessage;
26
+
19
27
  // src/components/ui/Checkbox.tsx
20
- import { jsx, jsxs } from "react/jsx-runtime";
21
- var CheckboxToggle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
28
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
29
+ var CheckboxToggle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx2(
22
30
  CheckboxPrimitive.Root,
23
31
  {
24
32
  ref,
@@ -49,28 +57,39 @@ var CheckboxToggle = forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
49
57
  ),
50
58
  ...props,
51
59
  children: /* @__PURE__ */ jsxs(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
52
- /* @__PURE__ */ jsx(Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }),
53
- /* @__PURE__ */ jsx(Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
60
+ /* @__PURE__ */ jsx2(Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }),
61
+ /* @__PURE__ */ jsx2(Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
54
62
  ] })
55
63
  }
56
64
  ));
57
65
  CheckboxToggle.displayName = CheckboxPrimitive.Root.displayName;
58
66
  var Checkbox = forwardRef(
59
- ({ classNames, children, ...props }, ref) => {
60
- const { disabled } = props;
67
+ ({ error, classNames, children, ...props }, ref) => {
61
68
  const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`;
62
- const labelClassName = disabled ? "text-grey-40 pointer-events-none" : "";
63
69
  return /* @__PURE__ */ jsxs("div", { className: cn("flex space-x-2", classNames?.wrapper), children: [
64
- /* @__PURE__ */ jsx(CheckboxToggle, { id, disabled, ref, ...props }),
65
- /* @__PURE__ */ jsx("label", { htmlFor: id, className: cn(labelClassName, classNames?.label), children })
70
+ /* @__PURE__ */ jsx2(CheckboxToggle, { id, ref, ...props }),
71
+ /* @__PURE__ */ jsxs(
72
+ "label",
73
+ {
74
+ htmlFor: id,
75
+ className: cn(
76
+ "text-sm",
77
+ props.disabled && "pointer-events-none text-grey-40",
78
+ classNames?.label
79
+ ),
80
+ children: [
81
+ children,
82
+ /* @__PURE__ */ jsx2(ErrorMessage_default, { message: error, className: "mt-1" })
83
+ ]
84
+ }
85
+ )
66
86
  ] });
67
87
  }
68
88
  );
69
89
  Checkbox.displayName = "Checkbox";
70
- var Checkbox_default = Checkbox;
71
90
 
72
91
  // src/components/ui/ListItem.tsx
73
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
92
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
74
93
  function ListItem({
75
94
  icon,
76
95
  hasCheckbox,
@@ -84,7 +103,7 @@ function ListItem({
84
103
  const getIconIfValid = (icon2) => {
85
104
  if (icon2 in icons) {
86
105
  const IconComponent = icons[icon2];
87
- return /* @__PURE__ */ jsx2(IconComponent, { size: 14 });
106
+ return /* @__PURE__ */ jsx3(IconComponent, { size: 14 });
88
107
  }
89
108
  return null;
90
109
  };
@@ -99,13 +118,13 @@ function ListItem({
99
118
  ...props,
100
119
  "data-state": isSelected ? "checked" : "unchecked",
101
120
  children: [
102
- optionIcon && /* @__PURE__ */ jsx2("span", { className: "mr-2", children: optionIcon }),
103
- hasCheckbox && /* @__PURE__ */ jsx2(Checkbox_default, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
121
+ optionIcon && /* @__PURE__ */ jsx3("span", { className: "mr-2", children: optionIcon }),
122
+ hasCheckbox && /* @__PURE__ */ jsx3(Checkbox, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
104
123
  /* @__PURE__ */ jsxs2("div", { children: [
105
- /* @__PURE__ */ jsx2("p", { children: title }),
106
- /* @__PURE__ */ jsx2("p", { className: "text-xs text-grey-80", children: description })
124
+ /* @__PURE__ */ jsx3("p", { children: title }),
125
+ /* @__PURE__ */ jsx3("p", { className: "text-xs text-grey-80", children: description })
107
126
  ] }),
108
- /* @__PURE__ */ jsx2(
127
+ /* @__PURE__ */ jsx3(
109
128
  CheckIcon,
110
129
  {
111
130
  className: "absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/ui/ListItem.tsx","../../../src/components/ui/Checkbox.tsx","../../../src/lib/utils.ts"],"sourcesContent":["import { CheckIcon } from 'lucide-react'\nimport { icons } from 'lucide-react'\nimport { type ComponentPropsWithoutRef, type ReactNode } from 'react'\n\nimport Checkbox from '@/components/ui/Checkbox'\nimport { cn } from '@/lib/utils'\n\ntype IconKey = keyof typeof icons\n\ninterface ListItemProps extends ComponentPropsWithoutRef<'li'> {\n icon?: string\n hasCheckbox?: boolean\n isSelected?: boolean\n title: string\n value: string\n description?: string\n}\n\nfunction ListItem({\n icon,\n hasCheckbox,\n isSelected,\n className,\n title,\n value,\n description,\n ...props\n}: ListItemProps) {\n const getIconIfValid = (icon: string): ReactNode => {\n if (icon in icons) {\n const IconComponent = icons[icon as IconKey]\n return <IconComponent size={14} />\n }\n return null\n }\n\n const optionIcon = icon ? getIconIfValid(icon) : undefined\n\n return (\n <li\n className={cn(\n 'group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm',\n className\n )}\n {...props}\n data-state={isSelected ? 'checked' : 'unchecked'}\n >\n {optionIcon && <span className=\"mr-2\">{optionIcon}</span>}\n {hasCheckbox && (\n <Checkbox id={value} checked={isSelected} onClick={(e) => e.preventDefault()} />\n )}\n <div>\n <p>{title}</p>\n <p className=\"text-xs text-grey-80\">{description}</p>\n </div>\n\n <CheckIcon\n className=\"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block\"\n size={16}\n />\n </li>\n )\n}\n\nexport default ListItem\n","'use client'\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n type ElementRef,\n forwardRef,\n type PropsWithChildren,\n} from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst CheckboxToggle = forwardRef<\n ElementRef<typeof CheckboxPrimitive.Root>,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group',\n 'peer',\n 'h-5',\n 'w-5',\n 'shrink-0',\n 'rounded-md',\n 'border',\n 'border-grey-10',\n 'outline',\n 'outline-1',\n 'outline-offset-2',\n 'outline-transparent',\n 'hover:border-grey-20',\n 'focus:outline-purple-100',\n 'active:border-green-80',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'data-[state=checked]:bg-green-80',\n 'data-[state=indeterminate]:bg-green-80',\n 'data-[state=checked]:text-white',\n 'data-[state=indeterminate]:text-primary-foreground',\n props.disabled &&\n 'data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <Check className=\"hidden h-4 w-4 group-data-[state=checked]:block\" />\n <Minus className=\"hidden h-4 w-4 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckboxToggle.displayName = CheckboxPrimitive.Root.displayName\n\ninterface Props extends CheckboxPrimitive.CheckboxProps, PropsWithChildren {\n error?: string\n classNames?: {\n wrapper?: string\n label?: string\n }\n}\n\nconst Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(\n ({ classNames, children, ...props }, ref) => {\n const { disabled } = props\n const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`\n const labelClassName = disabled ? 'text-grey-40 pointer-events-none' : ''\n return (\n <div className={cn('flex space-x-2', classNames?.wrapper)}>\n <CheckboxToggle id={id} disabled={disabled} ref={ref} {...props} />\n <label htmlFor={id} className={cn(labelClassName, classNames?.label)}>\n {children}\n </label>\n </div>\n )\n }\n)\nCheckbox.displayName = 'Checkbox'\n\nexport default Checkbox\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,aAAa;;;ACCtB,YAAY,uBAAuB;AACnC,SAAS,OAAO,aAAa;AAC7B;AAAA,EAGE;AAAA,OAEK;;;ACTP,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;AD0CI,SACE,KADF;AAlCJ,IAAM,iBAAiB,WAGrB,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAC1B;AAAA,EAAmB;AAAA,EAAlB;AAAA,IACC;AAAA,IACA,WAAW;AA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iBAAc,MAAM,IAAI;AAAA,IAClC;AACA,WAAO;AAAA,EACT;AAEA,QAAM,aAAa,OAAO,eAAe,IAAI,IAAI;AAEjD,SACE,gBAAAC;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MACJ,cAAY,aAAa,YAAY;AAAA,MAEpC;AAAA,sBAAc,gBAAAD,KAAC,UAAK,WAAU,QAAQ,sBAAW;AAAA,QACjD,eACC,gBAAAA,KAAC,oBAAS,IAAI,OAAO,SAAS,YAAY,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG;AAAA,QAEhF,gBAAAC,MAAC,SACC;AAAA,0BAAAD,KAAC,OAAG,iBAAM;AAAA,UACV,gBAAAA,KAAC,OAAE,WAAU,wBAAwB,uBAAY;AAAA,WACnD;AAAA,QAEA,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,MAAM;AAAA;AAAA,QACR;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,mBAAQ;","names":["jsx","jsxs","icon"]}
1
+ {"version":3,"sources":["../../../src/components/ui/ListItem.tsx","../../../src/components/ui/Checkbox.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx"],"sourcesContent":["import { CheckIcon } from 'lucide-react'\nimport { icons } from 'lucide-react'\nimport { type ComponentPropsWithoutRef, type ReactNode } from 'react'\n\nimport { Checkbox } from '@/components/ui/Checkbox'\nimport { cn } from '@/lib/utils'\n\ntype IconKey = keyof typeof icons\n\ninterface ListItemProps extends ComponentPropsWithoutRef<'li'> {\n icon?: string\n hasCheckbox?: boolean\n isSelected?: boolean\n title: string\n value: string\n description?: string\n}\n\nfunction ListItem({\n icon,\n hasCheckbox,\n isSelected,\n className,\n title,\n value,\n description,\n ...props\n}: ListItemProps) {\n const getIconIfValid = (icon: string): ReactNode => {\n if (icon in icons) {\n const IconComponent = icons[icon as IconKey]\n return <IconComponent size={14} />\n }\n return null\n }\n\n const optionIcon = icon ? getIconIfValid(icon) : undefined\n\n return (\n <li\n className={cn(\n 'group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm',\n className\n )}\n {...props}\n data-state={isSelected ? 'checked' : 'unchecked'}\n >\n {optionIcon && <span className=\"mr-2\">{optionIcon}</span>}\n {hasCheckbox && (\n <Checkbox id={value} checked={isSelected} onClick={(e) => e.preventDefault()} />\n )}\n <div>\n <p>{title}</p>\n <p className=\"text-xs text-grey-80\">{description}</p>\n </div>\n\n <CheckIcon\n className=\"absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block\"\n size={16}\n />\n </li>\n )\n}\n\nexport default ListItem\n","'use client'\n\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { Check, Minus } from 'lucide-react'\nimport {\n type ComponentPropsWithoutRef,\n type ElementRef,\n forwardRef,\n type PropsWithChildren,\n} from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport { cn } from '@/lib/utils'\n\nexport const CheckboxToggle = forwardRef<\n ElementRef<typeof CheckboxPrimitive.Root>,\n ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <CheckboxPrimitive.Root\n ref={ref}\n className={cn(\n 'group',\n 'peer',\n 'h-5',\n 'w-5',\n 'shrink-0',\n 'rounded-md',\n 'border',\n 'border-grey-10',\n 'outline',\n 'outline-1',\n 'outline-offset-2',\n 'outline-transparent',\n 'hover:border-grey-20',\n 'focus:outline-purple-100',\n 'active:border-green-80',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'data-[state=checked]:bg-green-80',\n 'data-[state=indeterminate]:bg-green-80',\n 'data-[state=checked]:text-white',\n 'data-[state=indeterminate]:text-primary-foreground',\n props.disabled &&\n 'data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20',\n className\n )}\n {...props}\n >\n <CheckboxPrimitive.Indicator className=\"flex items-center justify-center text-current\">\n <Check className=\"hidden h-4 w-4 group-data-[state=checked]:block\" />\n <Minus className=\"hidden h-4 w-4 group-data-[state=indeterminate]:block\" />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n))\nCheckboxToggle.displayName = CheckboxPrimitive.Root.displayName\n\ninterface Props extends CheckboxPrimitive.CheckboxProps, PropsWithChildren {\n error?: string\n classNames?: {\n wrapper?: string\n label?: string\n }\n}\n\nexport const Checkbox = forwardRef<ElementRef<typeof CheckboxPrimitive.Root>, Props>(\n ({ error, classNames, children, ...props }, ref) => {\n const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`\n return (\n <div className={cn('flex space-x-2', classNames?.wrapper)}>\n <CheckboxToggle id={id} ref={ref} {...props} />\n <label\n htmlFor={id}\n className={cn(\n 'text-sm',\n props.disabled && 'pointer-events-none text-grey-40',\n classNames?.label\n )}\n >\n {children}\n\n <ErrorMessage message={error} className=\"mt-1\" />\n </label>\n </div>\n )\n }\n)\nCheckbox.displayName = 'Checkbox'\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,aAAa;;;ACCtB,YAAY,uBAAuB;AACnC,SAAS,OAAO,aAAa;AAC7B;AAAA,EAGE;AAAA,OAEK;;;ACTP,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACOI;AAJJ,S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A,UAEC;AAAA;AAAA,YAED,gBAAAA,KAAC,wBAAa,SAAS,OAAO,WAAU,QAAO;AAAA;AAAA;AAAA,MACjD;AAAA,OACF;AAAA,EAEJ;AACF;AACA,SAAS,cAAc;;;ADvDV,gBAAAC,MAoBP,QAAAC,aApBO;AAbb,SAAS,SAAS;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAkB;AAChB,QAAM,iBAAiB,CAACC,UAA4B;AAClD,QAAIA,SAAQ,OAAO;AACjB,YAAM,gBAAgB,MAAMA,KAAe;AAC3C,aAAO,gBAAAF,KAAC,iBAAc,MAAM,IAAI;AAAA,IAClC;AACA,WAAO;AAAA,EACT;AAEA,QAAM,aAAa,OAAO,eAAe,IAAI,IAAI;AAEjD,SACE,gBAAAC;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MACJ,cAAY,aAAa,YAAY;AAAA,MAEpC;AAAA,sBAAc,gBAAAD,KAAC,UAAK,WAAU,QAAQ,sBAAW;AAAA,QACjD,eACC,gBAAAA,KAAC,YAAS,IAAI,OAAO,SAAS,YAAY,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG;AAAA,QAEhF,gBAAAC,MAAC,SACC;AAAA,0BAAAD,KAAC,OAAG,iBAAM;AAAA,UACV,gBAAAA,KAAC,OAAE,WAAU,wBAAwB,uBAAY;AAAA,WACnD;AAAA,QAEA,gBAAAA;AAAA,UAAC;AAAA;AAAA,YACC,WAAU;AAAA,YACV,MAAM;AAAA;AAAA,QACR;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,mBAAQ;","names":["jsx","jsx","jsxs","icon"]}
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/components/ui/Radio.tsx
31
+ var Radio_exports = {};
32
+ __export(Radio_exports, {
33
+ Radio: () => Radio
34
+ });
35
+ module.exports = __toCommonJS(Radio_exports);
36
+ var import_react2 = require("react");
37
+
38
+ // src/components/primitives/radio-group.tsx
39
+ var RadioGroupPrimitive = __toESM(require("@radix-ui/react-radio-group"), 1);
40
+
41
+ // src/lib/utils.ts
42
+ var import_clsx = require("clsx");
43
+ var import_tailwind_merge = require("tailwind-merge");
44
+ function cn(...inputs) {
45
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
46
+ }
47
+
48
+ // src/components/primitives/radio-group.tsx
49
+ var import_react = require("react");
50
+ var import_jsx_runtime = require("react/jsx-runtime");
51
+ var RadioGroup = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadioGroupPrimitive.Root, { className, ...props, ref }));
52
+ RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
53
+ var RadioGroupItem = (0, import_react.forwardRef)(({ className, children, ...props }, ref) => {
54
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "group flex flex-row items-center gap-2", children: [
55
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
56
+ RadioGroupPrimitive.Item,
57
+ {
58
+ ref,
59
+ className: cn(
60
+ "focus-visible:ring-ring peer aspect-square h-4 rounded-full border border-grey-10 shadow outline outline-1 outline-offset-2 outline-transparent focus:outline-none focus:outline-purple-100 focus-visible:ring-1 active:border-green-80 disabled:cursor-not-allowed disabled:opacity-50 group-hover:border-grey-20 data-[state=checked]:border-4 data-[disabled]:border-grey-20 data-[state=checked]:border-green-90 data-[disabled]:bg-grey-10 data-[state=checked]:group-hover:border-green-80",
61
+ className
62
+ ),
63
+ ...props
64
+ }
65
+ ),
66
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { htmlFor: props.id, className: "text-sm peer-data-[disabled]:text-grey-40", children })
67
+ ] });
68
+ });
69
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
70
+
71
+ // src/components/ui/ErrorMessage.tsx
72
+ var import_jsx_runtime2 = require("react/jsx-runtime");
73
+ function ErrorMessage({ message, className, ...props }) {
74
+ if (!message) return null;
75
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
76
+ }
77
+ var ErrorMessage_default = ErrorMessage;
78
+
79
+ // src/components/ui/Label.tsx
80
+ var import_lucide_react = require("lucide-react");
81
+
82
+ // src/components/primitives/tooltip.tsx
83
+ var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
84
+ var React = __toESM(require("react"), 1);
85
+ var import_jsx_runtime3 = require("react/jsx-runtime");
86
+ var TooltipProvider = TooltipPrimitive.Provider;
87
+ var Tooltip = TooltipPrimitive.Root;
88
+ var TooltipTrigger = TooltipPrimitive.Trigger;
89
+ var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
90
+ TooltipPrimitive.Content,
91
+ {
92
+ ref,
93
+ sideOffset,
94
+ className: cn(
95
+ "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",
96
+ className
97
+ ),
98
+ ...props
99
+ }
100
+ ));
101
+ TooltipContent.displayName = TooltipPrimitive.Content.displayName;
102
+
103
+ // src/components/ui/Label.tsx
104
+ var import_jsx_runtime4 = require("react/jsx-runtime");
105
+ function Label({ text, required, description, className, ...props }) {
106
+ if (!text) return null;
107
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex w-full flex-row gap-1", children: [
108
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
109
+ "label",
110
+ {
111
+ className: cn(
112
+ "text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
113
+ className
114
+ ),
115
+ ...props,
116
+ children: [
117
+ text,
118
+ required && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-red-600", children: "\xA0*" })
119
+ ]
120
+ }
121
+ ),
122
+ !!description && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Tooltip, { children: [
123
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react.InfoIcon, { className: "h-4 w-4" }) }),
124
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TooltipContent, { className: "max-w-48", children: description })
125
+ ] }) })
126
+ ] });
127
+ }
128
+ var Label_default = Label;
129
+
130
+ // src/components/ui/Radio.tsx
131
+ var import_jsx_runtime5 = require("react/jsx-runtime");
132
+ var Radio = (0, import_react2.forwardRef)(
133
+ ({
134
+ label,
135
+ error,
136
+ description,
137
+ options,
138
+ classNames,
139
+ onChange: handleValueChange,
140
+ orientation,
141
+ ...props
142
+ }, ref) => {
143
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: cn("flex flex-col gap-1", classNames?.root), children: [
144
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Label_default, { text: label, description, required: props.required }),
145
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
146
+ RadioGroup,
147
+ {
148
+ ref,
149
+ className: cn(
150
+ "flex text-sm",
151
+ orientation === "vertical" ? "flex-col gap-2" : "flex-row gap-4",
152
+ classNames?.group
153
+ ),
154
+ onValueChange: handleValueChange,
155
+ ...props,
156
+ children: options?.map(({ id, title, value }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
157
+ RadioGroupItem,
158
+ {
159
+ value,
160
+ id: `radio-group-item-${title}`,
161
+ className: classNames?.item,
162
+ children: title
163
+ },
164
+ id
165
+ ))
166
+ }
167
+ ),
168
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ErrorMessage_default, { message: error })
169
+ ] });
170
+ }
171
+ );
172
+ Radio.displayName = "Radio";
173
+ // Annotate the CommonJS export names for ESM import in node:
174
+ 0 && (module.exports = {
175
+ Radio
176
+ });
177
+ //# sourceMappingURL=Radio.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/ui/Radio.tsx","../../../src/components/primitives/radio-group.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/ui/Label.tsx","../../../src/components/primitives/tooltip.tsx"],"sourcesContent":["import { ComponentProps, forwardRef } from 'react'\nimport { RadioGroup, RadioGroupItem } from '@/components/primitives/radio-group'\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ntype RadioItem = { id: string | number; title: string; value: string }\ntype RadioClassNames = { root?: string; group?: string; item?: string }\ntype RadioGroupProps = Omit<ComponentProps<typeof RadioGroup>, 'onValueChange'>\nexport type RadioProps = RadioGroupProps & {\n label?: string\n error?: string\n description?: string\n classNames?: RadioClassNames\n options?: RadioItem[]\n onChange?: (value: string) => void\n}\n\nexport const Radio = forwardRef<HTMLInputElement, RadioProps>(\n (\n {\n label,\n error,\n description,\n options,\n classNames,\n onChange: handleValueChange,\n orientation,\n ...props\n },\n ref\n ) => {\n return (\n <div className={cn('flex flex-col gap-1', classNames?.root)}>\n <Label text={label} description={description} required={props.required} />\n\n <RadioGroup\n ref={ref}\n className={cn(\n 'flex text-sm',\n orientation === 'vertical' ? 'flex-col gap-2' : 'flex-row gap-4',\n classNames?.group\n )}\n onValueChange={handleValueChange}\n {...props}\n >\n {options?.map(({ id, title, value }) => (\n <RadioGroupItem\n key={id}\n value={value}\n id={`radio-group-item-${title}`}\n className={classNames?.item}\n >\n {title}\n </RadioGroupItem>\n ))}\n </RadioGroup>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nRadio.displayName = 'Radio'\n","'use client'\n\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group'\n\nimport { cn } from '@/lib/utils'\nimport { ComponentPropsWithoutRef, ElementRef, forwardRef, PropsWithChildren } from 'react'\n\nexport const RadioGroup = forwardRef<\n ElementRef<typeof RadioGroupPrimitive.Root>,\n ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => (\n <RadioGroupPrimitive.Root className={className} {...props} ref={ref} />\n))\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName\n\nexport const RadioGroupItem = forwardRef<\n ElementRef<typeof RadioGroupPrimitive.Item>,\n PropsWithChildren<ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>>\n>(({ className, children, ...props }, ref) => {\n return (\n <div className=\"group flex flex-row items-center gap-2\">\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'focus-visible:ring-ring peer aspect-square h-4 rounded-full border border-grey-10 shadow outline outline-1 outline-offset-2 outline-transparent focus:outline-none focus:outline-purple-100 focus-visible:ring-1 active:border-green-80 disabled:cursor-not-allowed disabled:opacity-50 group-hover:border-grey-20 data-[state=checked]:border-4 data-[disabled]:border-grey-20 data-[state=checked]:border-green-90 data-[disabled]:bg-grey-10 data-[state=checked]:group-hover:border-green-80',\n className\n )}\n {...props}\n />\n <label htmlFor={props.id} className=\"text-sm peer-data-[disabled]:text-grey-40\">\n {children}\n </label>\n </div>\n )\n})\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n","import { InfoIcon } from 'lucide-react'\nimport { type ComponentPropsWithoutRef } from 'react'\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n description?: string\n}\n\nfunction Label({ text, required, description, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <div className=\"flex w-full flex-row gap-1\">\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n {required && <span className=\"text-red-600\">&nbsp;*</span>}\n </label>\n\n {!!description && (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <InfoIcon className=\"h-4 w-4\" />\n </TooltipTrigger>\n <TooltipContent className=\"max-w-48\">{description}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n )\n}\n\nexport default Label\n","'use client'\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n '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',\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,gBAA2C;;;ACE3C,0BAAqC;;;ACFrC,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,wBAAa,SAAS,OAAO;AAAA,OAChC;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":["import_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import { ComponentProps } from 'react';
3
+ import { RadioGroup } from '../primitives/radio-group.cjs';
4
+ import '@radix-ui/react-radio-group';
5
+
6
+ type RadioItem = {
7
+ id: string | number;
8
+ title: string;
9
+ value: string;
10
+ };
11
+ type RadioClassNames = {
12
+ root?: string;
13
+ group?: string;
14
+ item?: string;
15
+ };
16
+ type RadioGroupProps = Omit<ComponentProps<typeof RadioGroup>, 'onValueChange'>;
17
+ type RadioProps = RadioGroupProps & {
18
+ label?: string;
19
+ error?: string;
20
+ description?: string;
21
+ classNames?: RadioClassNames;
22
+ options?: RadioItem[];
23
+ onChange?: (value: string) => void;
24
+ };
25
+ declare const Radio: React.ForwardRefExoticComponent<Omit<RadioProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
26
+
27
+ export { Radio, type RadioProps };
@@ -0,0 +1,27 @@
1
+ import * as React from 'react';
2
+ import { ComponentProps } from 'react';
3
+ import { RadioGroup } from '../primitives/radio-group.js';
4
+ import '@radix-ui/react-radio-group';
5
+
6
+ type RadioItem = {
7
+ id: string | number;
8
+ title: string;
9
+ value: string;
10
+ };
11
+ type RadioClassNames = {
12
+ root?: string;
13
+ group?: string;
14
+ item?: string;
15
+ };
16
+ type RadioGroupProps = Omit<ComponentProps<typeof RadioGroup>, 'onValueChange'>;
17
+ type RadioProps = RadioGroupProps & {
18
+ label?: string;
19
+ error?: string;
20
+ description?: string;
21
+ classNames?: RadioClassNames;
22
+ options?: RadioItem[];
23
+ onChange?: (value: string) => void;
24
+ };
25
+ declare const Radio: React.ForwardRefExoticComponent<Omit<RadioProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
26
+
27
+ export { Radio, type RadioProps };