@next-degree/pickle-shared-js 0.5.31 → 0.6.44

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 (239) hide show
  1. package/dist/company_service_latest-DQ5joNqO.d.cts +4243 -0
  2. package/dist/company_service_latest-DQ5joNqO.d.ts +4243 -0
  3. package/dist/components/buttons/BackButton.cjs +161 -0
  4. package/dist/components/buttons/BackButton.cjs.map +1 -0
  5. package/dist/components/buttons/BackButton.d.cts +9 -0
  6. package/dist/components/buttons/BackButton.d.ts +9 -0
  7. package/dist/components/buttons/BackButton.js +137 -0
  8. package/dist/components/buttons/BackButton.js.map +1 -0
  9. package/dist/components/company/CompanyBenefits.cjs +38 -0
  10. package/dist/components/company/CompanyBenefits.cjs.map +1 -0
  11. package/dist/components/company/CompanyBenefits.d.cts +8 -0
  12. package/dist/components/company/CompanyBenefits.d.ts +8 -0
  13. package/dist/components/company/CompanyBenefits.js +13 -0
  14. package/dist/components/company/CompanyBenefits.js.map +1 -0
  15. package/dist/components/company/CompanyInformation.cjs +112 -0
  16. package/dist/components/company/CompanyInformation.cjs.map +1 -0
  17. package/dist/components/company/CompanyInformation.d.cts +12 -0
  18. package/dist/components/company/CompanyInformation.d.ts +12 -0
  19. package/dist/components/company/CompanyInformation.js +75 -0
  20. package/dist/components/company/CompanyInformation.js.map +1 -0
  21. package/dist/components/company/CompanyTake.cjs +140 -0
  22. package/dist/components/company/CompanyTake.cjs.map +1 -0
  23. package/dist/components/company/CompanyTake.d.cts +9 -0
  24. package/dist/components/company/CompanyTake.d.ts +9 -0
  25. package/dist/components/company/CompanyTake.js +104 -0
  26. package/dist/components/company/CompanyTake.js.map +1 -0
  27. package/dist/components/jobPost/JobDescription.cjs +205 -0
  28. package/dist/components/jobPost/JobDescription.cjs.map +1 -0
  29. package/dist/components/jobPost/JobDescription.d.cts +8 -0
  30. package/dist/components/jobPost/JobDescription.d.ts +8 -0
  31. package/dist/components/jobPost/JobDescription.js +168 -0
  32. package/dist/components/jobPost/JobDescription.js.map +1 -0
  33. package/dist/components/jobPost/JobHeader.cjs +436 -0
  34. package/dist/components/jobPost/JobHeader.cjs.map +1 -0
  35. package/dist/components/jobPost/JobHeader.d.cts +26 -0
  36. package/dist/components/jobPost/JobHeader.d.ts +26 -0
  37. package/dist/components/jobPost/JobHeader.js +423 -0
  38. package/dist/components/jobPost/JobHeader.js.map +1 -0
  39. package/dist/components/jobPost/JobPost.cjs +1371 -0
  40. package/dist/components/jobPost/JobPost.cjs.map +1 -0
  41. package/dist/components/jobPost/JobPost.d.cts +16 -0
  42. package/dist/components/jobPost/JobPost.d.ts +16 -0
  43. package/dist/components/jobPost/JobPost.js +1358 -0
  44. package/dist/components/jobPost/JobPost.js.map +1 -0
  45. package/dist/components/primitives/avatar.cjs +88 -0
  46. package/dist/components/primitives/avatar.cjs.map +1 -0
  47. package/dist/components/primitives/avatar.d.cts +13 -0
  48. package/dist/components/primitives/avatar.d.ts +13 -0
  49. package/dist/components/primitives/avatar.js +52 -0
  50. package/dist/components/primitives/avatar.js.map +1 -0
  51. package/dist/components/primitives/command.d.cts +3 -3
  52. package/dist/components/primitives/command.d.ts +3 -3
  53. package/dist/components/ui/Avatar.cjs +117 -0
  54. package/dist/components/ui/Avatar.cjs.map +1 -0
  55. package/dist/components/ui/Avatar.d.cts +16 -0
  56. package/dist/components/ui/Avatar.d.ts +16 -0
  57. package/dist/components/ui/Avatar.js +79 -0
  58. package/dist/components/ui/Avatar.js.map +1 -0
  59. package/dist/components/ui/Icon.cjs +114 -0
  60. package/dist/components/ui/Icon.cjs.map +1 -0
  61. package/dist/components/ui/Icon.d.cts +15 -0
  62. package/dist/components/ui/Icon.d.ts +15 -0
  63. package/dist/components/ui/Icon.js +89 -0
  64. package/dist/components/ui/Icon.js.map +1 -0
  65. package/dist/{app/layout.cjs → components/ui/LinkButton.cjs} +25 -35
  66. package/dist/components/ui/LinkButton.cjs.map +1 -0
  67. package/dist/components/ui/LinkButton.d.cts +29 -0
  68. package/dist/components/ui/LinkButton.d.ts +29 -0
  69. package/dist/components/ui/LinkButton.js +26 -0
  70. package/dist/components/ui/LinkButton.js.map +1 -0
  71. package/dist/components/ui/ReadMore.cjs +194 -0
  72. package/dist/components/ui/ReadMore.cjs.map +1 -0
  73. package/dist/components/ui/ReadMore.d.cts +9 -0
  74. package/dist/components/ui/ReadMore.d.ts +9 -0
  75. package/dist/components/ui/ReadMore.js +160 -0
  76. package/dist/components/ui/ReadMore.js.map +1 -0
  77. package/dist/contexts/WindowHistoryProvider.cjs +48 -0
  78. package/dist/contexts/WindowHistoryProvider.cjs.map +1 -0
  79. package/dist/contexts/WindowHistoryProvider.d.cts +11 -0
  80. package/dist/contexts/WindowHistoryProvider.d.ts +11 -0
  81. package/dist/contexts/WindowHistoryProvider.js +23 -0
  82. package/dist/contexts/WindowHistoryProvider.js.map +1 -0
  83. package/dist/displayText-BvUjsvAx.d.cts +48 -0
  84. package/dist/displayText-CDK-QDbc.d.ts +48 -0
  85. package/dist/hooks/useDisplayText.cjs +502 -0
  86. package/dist/hooks/useDisplayText.cjs.map +1 -0
  87. package/dist/hooks/useDisplayText.d.cts +8 -0
  88. package/dist/hooks/useDisplayText.d.ts +8 -0
  89. package/dist/hooks/useDisplayText.js +477 -0
  90. package/dist/hooks/useDisplayText.js.map +1 -0
  91. package/dist/hooks/useWindowHistory.cjs +46 -0
  92. package/dist/hooks/useWindowHistory.cjs.map +1 -0
  93. package/dist/hooks/useWindowHistory.d.cts +7 -0
  94. package/dist/hooks/useWindowHistory.d.ts +7 -0
  95. package/dist/hooks/useWindowHistory.js +21 -0
  96. package/dist/hooks/useWindowHistory.js.map +1 -0
  97. package/dist/index.cjs +1459 -2
  98. package/dist/index.cjs.map +1 -1
  99. package/dist/index.d.cts +21 -0
  100. package/dist/index.d.ts +21 -0
  101. package/dist/index.js +1468 -1
  102. package/dist/index.js.map +1 -1
  103. package/dist/job_posting_service_latest-Uc2AcDWn.d.cts +4109 -0
  104. package/dist/job_posting_service_latest-Uc2AcDWn.d.ts +4109 -0
  105. package/dist/lib/icons.cjs +53 -0
  106. package/dist/lib/icons.cjs.map +1 -0
  107. package/dist/lib/icons.d.cts +27 -0
  108. package/dist/lib/icons.d.ts +27 -0
  109. package/dist/lib/icons.js +49 -0
  110. package/dist/lib/icons.js.map +1 -0
  111. package/dist/lib/locations.cjs +45 -0
  112. package/dist/lib/locations.cjs.map +1 -0
  113. package/dist/lib/locations.d.cts +8 -0
  114. package/dist/lib/locations.d.ts +8 -0
  115. package/dist/lib/locations.js +19 -0
  116. package/dist/lib/locations.js.map +1 -0
  117. package/dist/lib/mappings.cjs +443 -0
  118. package/dist/lib/mappings.cjs.map +1 -0
  119. package/dist/lib/mappings.d.cts +4 -0
  120. package/dist/lib/mappings.d.ts +4 -0
  121. package/dist/lib/mappings.js +409 -0
  122. package/dist/lib/mappings.js.map +1 -0
  123. package/dist/lib/salaryRange.cjs +111 -0
  124. package/dist/lib/salaryRange.cjs.map +1 -0
  125. package/dist/lib/salaryRange.d.cts +6 -0
  126. package/dist/lib/salaryRange.d.ts +6 -0
  127. package/dist/lib/salaryRange.js +84 -0
  128. package/dist/lib/salaryRange.js.map +1 -0
  129. package/dist/services/displayText.cjs +470 -0
  130. package/dist/services/displayText.cjs.map +1 -0
  131. package/dist/services/displayText.d.cts +4 -0
  132. package/dist/services/displayText.d.ts +4 -0
  133. package/dist/services/displayText.js +443 -0
  134. package/dist/services/displayText.js.map +1 -0
  135. package/dist/shared_pickle_output_latest-DUO_efBh.d.cts +334 -0
  136. package/dist/shared_pickle_output_latest-DUO_efBh.d.ts +334 -0
  137. package/dist/styles/globals.css +817 -0
  138. package/dist/styles/globals.css.map +1 -1
  139. package/dist/types/data/company_service_latest.cjs +249 -0
  140. package/dist/types/data/company_service_latest.cjs.map +1 -0
  141. package/dist/types/data/company_service_latest.d.cts +2 -0
  142. package/dist/types/data/company_service_latest.d.ts +2 -0
  143. package/dist/types/data/company_service_latest.js +208 -0
  144. package/dist/types/data/company_service_latest.js.map +1 -0
  145. package/dist/types/data/job_posting_service_latest.cjs +289 -0
  146. package/dist/types/data/job_posting_service_latest.cjs.map +1 -0
  147. package/dist/types/data/job_posting_service_latest.d.cts +2 -0
  148. package/dist/types/data/job_posting_service_latest.d.ts +2 -0
  149. package/dist/types/data/job_posting_service_latest.js +253 -0
  150. package/dist/types/data/job_posting_service_latest.js.map +1 -0
  151. package/dist/types/data/shared_pickle_output_latest.cjs +107 -0
  152. package/dist/types/data/shared_pickle_output_latest.cjs.map +1 -0
  153. package/dist/types/data/shared_pickle_output_latest.d.cts +2 -0
  154. package/dist/types/data/shared_pickle_output_latest.d.ts +2 -0
  155. package/dist/types/data/shared_pickle_output_latest.js +73 -0
  156. package/dist/types/data/shared_pickle_output_latest.js.map +1 -0
  157. package/dist/types/displayText.errors.cjs +44 -0
  158. package/dist/types/displayText.errors.cjs.map +1 -0
  159. package/dist/types/displayText.errors.d.cts +8 -0
  160. package/dist/types/displayText.errors.d.ts +8 -0
  161. package/dist/types/displayText.errors.js +18 -0
  162. package/dist/types/displayText.errors.js.map +1 -0
  163. package/package.json +19 -7
  164. package/dist/AmbitBold-3SZZPYLH.otf +0 -0
  165. package/dist/AmbitBoldItalic-JSHFTN4A.otf +0 -0
  166. package/dist/AmbitRegular-MB5U7O3L.otf +0 -0
  167. package/dist/app/layout.cjs.map +0 -1
  168. package/dist/app/layout.css +0 -1423
  169. package/dist/app/layout.css.map +0 -1
  170. package/dist/app/layout.d.cts +0 -11
  171. package/dist/app/layout.d.ts +0 -11
  172. package/dist/app/layout.js +0 -36
  173. package/dist/app/layout.js.map +0 -1
  174. package/dist/app/page.cjs +0 -1607
  175. package/dist/app/page.cjs.map +0 -1
  176. package/dist/app/page.d.cts +0 -5
  177. package/dist/app/page.d.ts +0 -5
  178. package/dist/app/page.js +0 -1581
  179. package/dist/app/page.js.map +0 -1
  180. package/dist/assets/fonts/AmbitBold.cjs +0 -3
  181. package/dist/assets/fonts/AmbitBold.cjs.map +0 -1
  182. package/dist/assets/fonts/AmbitBold.d.cts +0 -2
  183. package/dist/assets/fonts/AmbitBold.d.ts +0 -2
  184. package/dist/assets/fonts/AmbitBold.js +0 -6
  185. package/dist/assets/fonts/AmbitBold.js.map +0 -1
  186. package/dist/assets/fonts/AmbitBoldItalic.cjs +0 -3
  187. package/dist/assets/fonts/AmbitBoldItalic.cjs.map +0 -1
  188. package/dist/assets/fonts/AmbitBoldItalic.d.cts +0 -2
  189. package/dist/assets/fonts/AmbitBoldItalic.d.ts +0 -2
  190. package/dist/assets/fonts/AmbitBoldItalic.js +0 -6
  191. package/dist/assets/fonts/AmbitBoldItalic.js.map +0 -1
  192. package/dist/assets/fonts/AmbitRegular.cjs +0 -3
  193. package/dist/assets/fonts/AmbitRegular.cjs.map +0 -1
  194. package/dist/assets/fonts/AmbitRegular.d.cts +0 -2
  195. package/dist/assets/fonts/AmbitRegular.d.ts +0 -2
  196. package/dist/assets/fonts/AmbitRegular.js +0 -6
  197. package/dist/assets/fonts/AmbitRegular.js.map +0 -1
  198. package/dist/components/demos/ComboboxDemo.cjs +0 -814
  199. package/dist/components/demos/ComboboxDemo.cjs.map +0 -1
  200. package/dist/components/demos/ComboboxDemo.d.cts +0 -5
  201. package/dist/components/demos/ComboboxDemo.d.ts +0 -5
  202. package/dist/components/demos/ComboboxDemo.js +0 -786
  203. package/dist/components/demos/ComboboxDemo.js.map +0 -1
  204. package/dist/components/demos/CounterDemo.cjs +0 -270
  205. package/dist/components/demos/CounterDemo.cjs.map +0 -1
  206. package/dist/components/demos/CounterDemo.d.cts +0 -5
  207. package/dist/components/demos/CounterDemo.d.ts +0 -5
  208. package/dist/components/demos/CounterDemo.js +0 -238
  209. package/dist/components/demos/CounterDemo.js.map +0 -1
  210. package/dist/components/demos/InputDemo.cjs +0 -225
  211. package/dist/components/demos/InputDemo.cjs.map +0 -1
  212. package/dist/components/demos/InputDemo.d.cts +0 -5
  213. package/dist/components/demos/InputDemo.d.ts +0 -5
  214. package/dist/components/demos/InputDemo.js +0 -192
  215. package/dist/components/demos/InputDemo.js.map +0 -1
  216. package/dist/components/demos/MapComponentDemo.cjs +0 -129
  217. package/dist/components/demos/MapComponentDemo.cjs.map +0 -1
  218. package/dist/components/demos/MapComponentDemo.d.cts +0 -5
  219. package/dist/components/demos/MapComponentDemo.d.ts +0 -5
  220. package/dist/components/demos/MapComponentDemo.js +0 -107
  221. package/dist/components/demos/MapComponentDemo.js.map +0 -1
  222. package/dist/components/demos/PlacesQueryInputDemo.cjs +0 -341
  223. package/dist/components/demos/PlacesQueryInputDemo.cjs.map +0 -1
  224. package/dist/components/demos/PlacesQueryInputDemo.d.cts +0 -5
  225. package/dist/components/demos/PlacesQueryInputDemo.d.ts +0 -5
  226. package/dist/components/demos/PlacesQueryInputDemo.js +0 -309
  227. package/dist/components/demos/PlacesQueryInputDemo.js.map +0 -1
  228. package/dist/components/demos/SelectDemo.cjs +0 -365
  229. package/dist/components/demos/SelectDemo.cjs.map +0 -1
  230. package/dist/components/demos/SelectDemo.d.cts +0 -5
  231. package/dist/components/demos/SelectDemo.d.ts +0 -5
  232. package/dist/components/demos/SelectDemo.js +0 -337
  233. package/dist/components/demos/SelectDemo.js.map +0 -1
  234. package/dist/components/demos/index.cjs +0 -1600
  235. package/dist/components/demos/index.cjs.map +0 -1
  236. package/dist/components/demos/index.d.cts +0 -5
  237. package/dist/components/demos/index.d.ts +0 -5
  238. package/dist/components/demos/index.js +0 -1574
  239. package/dist/components/demos/index.js.map +0 -1
package/dist/app/page.cjs DELETED
@@ -1,1607 +0,0 @@
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/app/page.tsx
31
- var page_exports = {};
32
- __export(page_exports, {
33
- default: () => page_default
34
- });
35
- module.exports = __toCommonJS(page_exports);
36
-
37
- // src/components/demos/ComboboxDemo.tsx
38
- var import_react4 = require("react");
39
-
40
- // src/components/ui/Combobox.tsx
41
- var import_react2 = require("react");
42
- var import_lucide_react7 = require("lucide-react");
43
- var import_cva2 = require("cva");
44
-
45
- // src/lib/utils.ts
46
- var import_clsx = require("clsx");
47
- var import_tailwind_merge = require("tailwind-merge");
48
- function cn(...inputs) {
49
- return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
50
- }
51
-
52
- // src/components/primitives/command.tsx
53
- var import_cmdk = require("cmdk");
54
- var import_lucide_react2 = require("lucide-react");
55
- var React2 = __toESM(require("react"), 1);
56
-
57
- // src/components/primitives/dialog.tsx
58
- var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"), 1);
59
- var import_lucide_react = require("lucide-react");
60
- var React = __toESM(require("react"), 1);
61
- var import_jsx_runtime = require("react/jsx-runtime");
62
- var DialogPortal = DialogPrimitive.Portal;
63
- var DialogOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
64
- DialogPrimitive.Overlay,
65
- {
66
- ref,
67
- className: cn(
68
- "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
69
- className
70
- ),
71
- ...props
72
- }
73
- ));
74
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
75
- var DialogContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(DialogPortal, { children: [
76
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DialogOverlay, {}),
77
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
78
- DialogPrimitive.Content,
79
- {
80
- ref,
81
- className: cn(
82
- "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-neutral-200 bg-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg dark:border-neutral-800 dark:bg-neutral-950",
83
- className
84
- ),
85
- ...props,
86
- children: [
87
- children,
88
- /* @__PURE__ */ (0, import_jsx_runtime.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: [
89
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.X, { className: "h-4 w-4" }),
90
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "sr-only", children: "Close" })
91
- ] })
92
- ]
93
- }
94
- )
95
- ] }));
96
- DialogContent.displayName = DialogPrimitive.Content.displayName;
97
- var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
98
- DialogHeader.displayName = "DialogHeader";
99
- var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
100
- "div",
101
- {
102
- className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
103
- ...props
104
- }
105
- );
106
- DialogFooter.displayName = "DialogFooter";
107
- var DialogTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
108
- DialogPrimitive.Title,
109
- {
110
- ref,
111
- className: cn("text-lg font-semibold leading-none tracking-tight", className),
112
- ...props
113
- }
114
- ));
115
- DialogTitle.displayName = DialogPrimitive.Title.displayName;
116
- var DialogDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
117
- DialogPrimitive.Description,
118
- {
119
- ref,
120
- className: cn("text-sm text-neutral-500 dark:text-neutral-400", className),
121
- ...props
122
- }
123
- ));
124
- DialogDescription.displayName = DialogPrimitive.Description.displayName;
125
-
126
- // src/components/primitives/command.tsx
127
- var import_jsx_runtime2 = require("react/jsx-runtime");
128
- var Command = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
129
- import_cmdk.Command,
130
- {
131
- ref,
132
- className: cn(
133
- "flex h-full w-full flex-col overflow-hidden rounded-xl bg-white text-neutral-950",
134
- className
135
- ),
136
- ...props
137
- }
138
- ));
139
- Command.displayName = import_cmdk.Command.displayName;
140
- var CommandInput = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "m-1 flex items-center rounded-xl border px-3", "cmdk-input-wrapper": "", children: [
141
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
142
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
143
- import_cmdk.Command.Input,
144
- {
145
- ref,
146
- className: cn(
147
- "flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-neutral-500 disabled:cursor-not-allowed disabled:opacity-50",
148
- className
149
- ),
150
- ...props
151
- }
152
- )
153
- ] }));
154
- CommandInput.displayName = import_cmdk.Command.Input.displayName;
155
- var CommandList = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
156
- import_cmdk.Command.List,
157
- {
158
- ref,
159
- className: cn("overflow-y-auto overflow-x-hidden", className),
160
- ...props
161
- }
162
- ));
163
- CommandList.displayName = import_cmdk.Command.List.displayName;
164
- var CommandEmpty = React2.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_cmdk.Command.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
165
- CommandEmpty.displayName = import_cmdk.Command.Empty.displayName;
166
- var CommandGroup = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
167
- import_cmdk.Command.Group,
168
- {
169
- ref,
170
- className: cn(
171
- "overflow-hidden p-1 text-neutral-950 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-neutral-500",
172
- className
173
- ),
174
- ...props
175
- }
176
- ));
177
- CommandGroup.displayName = import_cmdk.Command.Group.displayName;
178
- var CommandSeparator = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
179
- import_cmdk.Command.Separator,
180
- {
181
- ref,
182
- className: cn("-mx-1 h-px bg-neutral-200", className),
183
- ...props
184
- }
185
- ));
186
- CommandSeparator.displayName = import_cmdk.Command.Separator.displayName;
187
- var CommandItem = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
188
- import_cmdk.Command.Item,
189
- {
190
- ref,
191
- className: cn(
192
- "relative flex cursor-pointer select-none items-center rounded-xl px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-neutral-100 data-[selected=true]:text-neutral-900 data-[disabled=true]:opacity-50",
193
- className
194
- ),
195
- ...props
196
- }
197
- ));
198
- CommandItem.displayName = import_cmdk.Command.Item.displayName;
199
- var CommandShortcut = ({ className, ...props }) => {
200
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
201
- "span",
202
- {
203
- className: cn("ml-auto text-xs tracking-widest text-neutral-500", className),
204
- ...props
205
- }
206
- );
207
- };
208
- CommandShortcut.displayName = "CommandShortcut";
209
-
210
- // src/components/primitives/popover.tsx
211
- var React3 = __toESM(require("react"), 1);
212
- var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"), 1);
213
- var import_jsx_runtime3 = require("react/jsx-runtime");
214
- var Popover = PopoverPrimitive.Root;
215
- var PopoverTrigger = PopoverPrimitive.Trigger;
216
- var PopoverContent = React3.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
217
- PopoverPrimitive.Content,
218
- {
219
- ref,
220
- align,
221
- sideOffset,
222
- className: cn(
223
- "z-50 rounded-2xl border bg-white p-4 text-black shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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",
224
- className
225
- ),
226
- ...props
227
- }
228
- ) }));
229
- PopoverContent.displayName = PopoverPrimitive.Content.displayName;
230
-
231
- // src/components/primitives/separator.tsx
232
- var SeparatorPrimitive = __toESM(require("@radix-ui/react-separator"), 1);
233
- var React4 = __toESM(require("react"), 1);
234
- var import_jsx_runtime4 = require("react/jsx-runtime");
235
- var Separator = React4.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
236
- SeparatorPrimitive.Root,
237
- {
238
- ref,
239
- decorative,
240
- orientation,
241
- className: cn(
242
- "shrink-0 bg-grey-10",
243
- orientation === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]",
244
- className
245
- ),
246
- ...props
247
- }
248
- ));
249
- Separator.displayName = SeparatorPrimitive.Root.displayName;
250
-
251
- // src/components/ui/ListItem.tsx
252
- var import_lucide_react4 = require("lucide-react");
253
-
254
- // src/components/ui/Checkbox.tsx
255
- var CheckboxPrimitive = __toESM(require("@radix-ui/react-checkbox"), 1);
256
- var import_lucide_react3 = require("lucide-react");
257
- var import_react = require("react");
258
- var import_jsx_runtime5 = require("react/jsx-runtime");
259
- var CheckboxToggle = (0, import_react.forwardRef)(({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
260
- CheckboxPrimitive.Root,
261
- {
262
- ref,
263
- className: cn(
264
- "group",
265
- "peer",
266
- "h-5",
267
- "w-5",
268
- "shrink-0",
269
- "rounded-md",
270
- "border",
271
- "border-grey-10",
272
- "outline",
273
- "outline-1",
274
- "outline-offset-2",
275
- "outline-transparent",
276
- "hover:border-grey-20",
277
- "focus:outline-purple-100",
278
- "active:border-green-80",
279
- "disabled:cursor-not-allowed",
280
- "disabled:opacity-50",
281
- "data-[state=checked]:bg-green-80",
282
- "data-[state=indeterminate]:bg-green-80",
283
- "data-[state=checked]:text-white",
284
- "data-[state=indeterminate]:text-primary-foreground",
285
- props.disabled && "data-[state=checked]:text-foreground bg-grey-20 data-[state=checked]:bg-grey-20",
286
- className
287
- ),
288
- ...props,
289
- children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
290
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react3.Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }),
291
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react3.Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
292
- ] })
293
- }
294
- ));
295
- CheckboxToggle.displayName = CheckboxPrimitive.Root.displayName;
296
- var Checkbox = (0, import_react.forwardRef)(
297
- ({ classNames, children, ...props }, ref) => {
298
- const { disabled } = props;
299
- const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`;
300
- const labelClassName = disabled ? "text-grey-40 pointer-events-none" : "";
301
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: cn("flex space-x-2", classNames?.wrapper), children: [
302
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CheckboxToggle, { id, disabled, ref, ...props }),
303
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: id, className: cn(labelClassName, classNames?.label), children })
304
- ] });
305
- }
306
- );
307
- Checkbox.displayName = "Checkbox";
308
- var Checkbox_default = Checkbox;
309
-
310
- // src/components/ui/ListItem.tsx
311
- var import_lucide_react5 = require("lucide-react");
312
- var import_jsx_runtime6 = require("react/jsx-runtime");
313
- function ListItem({
314
- icon,
315
- hasCheckbox,
316
- isSelected,
317
- className,
318
- title,
319
- value,
320
- description,
321
- ...props
322
- }) {
323
- const getIconIfValid = (icon2) => {
324
- if (icon2 in import_lucide_react5.icons) {
325
- const IconComponent = import_lucide_react5.icons[icon2];
326
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconComponent, { size: 14 });
327
- }
328
- return null;
329
- };
330
- const optionIcon = icon ? getIconIfValid(icon) : void 0;
331
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
332
- "li",
333
- {
334
- className: cn(
335
- "group relative flex w-72 cursor-pointer flex-row items-center text-left text-sm",
336
- className
337
- ),
338
- ...props,
339
- "data-state": isSelected ? "checked" : "unchecked",
340
- children: [
341
- optionIcon && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "mr-2", children: optionIcon }),
342
- hasCheckbox && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Checkbox_default, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
343
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
344
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: title }),
345
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-xs text-grey-80", children: description })
346
- ] }),
347
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
348
- import_lucide_react4.CheckIcon,
349
- {
350
- className: "absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",
351
- size: 16
352
- }
353
- )
354
- ]
355
- }
356
- );
357
- }
358
- var ListItem_default = ListItem;
359
-
360
- // src/components/ui/Badge.tsx
361
- var import_cva = require("cva");
362
- var import_jsx_runtime7 = require("react/jsx-runtime");
363
- var badgeVariants = (0, import_cva.cva)("rounded-full px-2 py-0.5 text-xs font-semibold", {
364
- variants: {
365
- variant: {
366
- green: "bg-green-90 text-white",
367
- pickle: "bg-pickle-100 text-black",
368
- purple: "bg-purple-100 text-white"
369
- }
370
- },
371
- defaultVariants: {
372
- variant: "green"
373
- }
374
- });
375
- function Badge({ className, variant, ...props }) {
376
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
377
- }
378
-
379
- // src/components/primitives/tooltip.tsx
380
- var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
381
- var React5 = __toESM(require("react"), 1);
382
- var import_jsx_runtime8 = require("react/jsx-runtime");
383
- var TooltipProvider = TooltipPrimitive.Provider;
384
- var Tooltip = TooltipPrimitive.Root;
385
- var TooltipTrigger = TooltipPrimitive.Trigger;
386
- var TooltipContent = React5.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
387
- TooltipPrimitive.Content,
388
- {
389
- ref,
390
- sideOffset,
391
- className: cn(
392
- "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",
393
- className
394
- ),
395
- ...props
396
- }
397
- ));
398
- TooltipContent.displayName = TooltipPrimitive.Content.displayName;
399
-
400
- // src/components/ui/Label.tsx
401
- var import_lucide_react6 = require("lucide-react");
402
- var import_jsx_runtime9 = require("react/jsx-runtime");
403
- function Label({ text, required, description, className, ...props }) {
404
- if (!text) return null;
405
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex w-full flex-row gap-1", children: [
406
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
407
- "label",
408
- {
409
- className: cn(
410
- "text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
411
- className
412
- ),
413
- ...props,
414
- children: [
415
- text,
416
- required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-red-600", children: "\xA0*" })
417
- ]
418
- }
419
- ),
420
- !!description && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(Tooltip, { children: [
421
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react6.InfoIcon, { className: "h-4 w-4" }) }),
422
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipContent, { className: "max-w-48", children: description })
423
- ] }) })
424
- ] });
425
- }
426
- var Label_default = Label;
427
-
428
- // src/components/ui/Combobox.tsx
429
- var import_jsx_runtime10 = require("react/jsx-runtime");
430
- var Combobox = (0, import_react2.forwardRef)((props, ref) => {
431
- const {
432
- id,
433
- name,
434
- value,
435
- label,
436
- options,
437
- required,
438
- description,
439
- classNames,
440
- multiselect,
441
- placeholder,
442
- variant = "default",
443
- size,
444
- icon,
445
- className,
446
- onChange: handleChange,
447
- children: footer
448
- } = props;
449
- const [selected, setSelected] = (0, import_react2.useState)([]);
450
- const [open, setOpen] = (0, import_react2.useState)(false);
451
- const IconComponent = icon && import_lucide_react7.icons[icon];
452
- const hideSearchBox = options?.length <= 5;
453
- const isDefault = variant === "default";
454
- const isChip = variant === "chip";
455
- const isEmpty = selected.length == 0;
456
- const showChevron = isDefault ? isEmpty : true;
457
- const close = () => setOpen(false);
458
- (0, import_react2.useEffect)(() => {
459
- const valueArray = multiselect ? value ?? [] : value ? [value] : [];
460
- setSelected(
461
- valueArray.map((v) => options.find((o) => o.value === v)).filter((v) => v !== void 0)
462
- );
463
- }, [value]);
464
- const handleSelect = (value2) => {
465
- const option = options.find((o) => o.value === value2);
466
- if (!option) return;
467
- if (multiselect) {
468
- return setSelected((prev) => {
469
- const newSelected = prev.some((o) => o.value === value2) ? prev.filter((v) => v !== option) : [...prev, option];
470
- handleChange?.(newSelected.map((o) => o.value));
471
- return newSelected;
472
- });
473
- }
474
- setSelected([option]);
475
- handleChange?.(option.value);
476
- close();
477
- };
478
- const handleClear = () => {
479
- setSelected([]);
480
- multiselect ? handleChange?.([]) : handleChange?.("");
481
- };
482
- const handleDisplayValue = () => {
483
- const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(", ") : placeholder;
484
- return isDefault ? defaultLabel : label;
485
- };
486
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: cn("flex flex-col gap-1", className), children: [
487
- isDefault && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
488
- Label_default,
489
- {
490
- text: label,
491
- htmlFor: name,
492
- required,
493
- description,
494
- className: classNames?.label
495
- }
496
- ),
497
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative flex", children: [
498
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Popover, { open, onOpenChange: setOpen, children: [
499
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
500
- PopoverTrigger,
501
- {
502
- asChild: true,
503
- disabled: options.length === 0,
504
- "data-testid": `${id ?? name}-combobox-trigger`,
505
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
506
- "div",
507
- {
508
- ref,
509
- className: cn(
510
- triggerVariants({ variant, size }),
511
- isDefault && !isEmpty && "pr-10",
512
- classNames?.trigger
513
- ),
514
- "aria-expanded": open,
515
- children: [
516
- isDefault && IconComponent && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(IconComponent, { className: "h-4 w-4 shrink-0" }),
517
- isChip && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Badge, { variant: "purple", children: selected.length }),
518
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
519
- "span",
520
- {
521
- className: cn(
522
- "w-full truncate leading-normal",
523
- isDefault && isEmpty && "text-grey-40"
524
- ),
525
- children: handleDisplayValue()
526
- }
527
- ),
528
- showChevron && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
529
- import_lucide_react7.ChevronDownIcon,
530
- {
531
- className: "shrink-0 transform group-data-[state=open]:rotate-180",
532
- size: "16"
533
- }
534
- )
535
- ]
536
- }
537
- )
538
- }
539
- ),
540
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
541
- PopoverContent,
542
- {
543
- className: cn(
544
- "flex w-full max-w-xs flex-col overflow-hidden p-0",
545
- "max-h-[--radix-popover-content-available-height]",
546
- classNames?.content
547
- ),
548
- collisionPadding: 8,
549
- sideOffset: 4,
550
- align: "start",
551
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Command, { children: [
552
- !hideSearchBox && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CommandInput, { placeholder: "Search..." }),
553
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(CommandList, { children: [
554
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CommandEmpty, { children: "No results" }),
555
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(CommandGroup, { children: options.map(({ id: id2, ...option }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
556
- CommandItem,
557
- {
558
- value: option.title,
559
- onSelect: () => handleSelect(option.value),
560
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
561
- ListItem_default,
562
- {
563
- className: cn(classNames?.items, "truncate py-1"),
564
- isSelected: selected.some((s) => s.value === option.value),
565
- hasCheckbox: multiselect,
566
- ...option
567
- }
568
- )
569
- },
570
- id2
571
- )) })
572
- ] }),
573
- !!footer && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Separator, {}),
574
- footer && footer({ close })
575
- ] })
576
- }
577
- )
578
- ] }),
579
- isDefault && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
580
- "button",
581
- {
582
- type: "button",
583
- 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",
584
- onClick: handleClear,
585
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react7.CircleX, { className: "h-4 w-4 text-green-100" })
586
- }
587
- )
588
- ] })
589
- ] });
590
- });
591
- Combobox.displayName = "Combobox";
592
- var triggerVariants = (0, import_cva2.cva)(
593
- "group relative cursor-pointer text-green-100 flex flex-row items-center justify-between gap-2 border border-grey-20 focus:outline-green-80 disabled:bg-grey-5",
594
- {
595
- variants: {
596
- variant: {
597
- default: ["w-full", "rounded-lg"],
598
- chip: [
599
- "font-bold",
600
- "rounded-3xl",
601
- "data-[state=open]:bg-black",
602
- "data-[state=open]:text-white"
603
- ]
604
- },
605
- size: {
606
- small: ["h-8", "py-1", "px-2", "text-xs"],
607
- normal: ["h-9", "py-2", "px-3", "text-sm"],
608
- large: ["h-10", "py-3", "px-4", "text-base"]
609
- }
610
- },
611
- defaultVariants: {
612
- variant: "default",
613
- size: "normal"
614
- }
615
- }
616
- );
617
-
618
- // src/components/ui/Button.tsx
619
- var import_react_slot = require("@radix-ui/react-slot");
620
- var import_cva3 = require("cva");
621
- var import_react3 = require("react");
622
- var import_jsx_runtime11 = require("react/jsx-runtime");
623
- var Button = (0, import_react3.forwardRef)(
624
- ({ className, variant, size, asChild = false, ...props }, ref) => {
625
- const Component = asChild ? import_react_slot.Slot : "button";
626
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
627
- Component,
628
- {
629
- className: cn(buttonVariants({ variant, size, className })),
630
- ref,
631
- ...props
632
- }
633
- );
634
- }
635
- );
636
- Button.displayName = "Button";
637
- var buttonVariants = (0, import_cva3.cva)(
638
- [
639
- "flex",
640
- "items-center",
641
- "justify-center",
642
- "gap-2",
643
- "rounded-full",
644
- "font-bold",
645
- "outline-2",
646
- "outline-offset-2",
647
- "outline-dashed",
648
- "outline-transparent"
649
- ],
650
- {
651
- variants: {
652
- variant: {
653
- neutral: [
654
- "bg-black",
655
- "text-white",
656
- "hover:bg-grey-90",
657
- "active:bg-grey-80",
658
- "focus:outline-purple-100",
659
- "disabled:text-grey-40",
660
- "disabled:bg-grey-10"
661
- ],
662
- primary: [
663
- "bg-pickle-100",
664
- "text-black",
665
- "hover:bg-pickle-80",
666
- "active:bg-pickle-60",
667
- "focus:outline-purple-100",
668
- "disabled:text-grey-40",
669
- "disabled:bg-grey-10"
670
- ],
671
- secondary: [
672
- "bg-green-80",
673
- "text-white",
674
- "hover:bg-green-90",
675
- "active:bg-green-100",
676
- "focus:outline-pickle-100",
677
- "disabled:text-grey-40",
678
- "disabled:bg-grey-10"
679
- ],
680
- transparent: [
681
- "text-white",
682
- "hover:bg-green-80",
683
- "active:bg-green-100",
684
- "focus:outline-pickle-100",
685
- "disabled:text-grey-40"
686
- ],
687
- link: [
688
- "leading-tight",
689
- "text-black",
690
- "underline",
691
- "hover:text-purple-100",
692
- "focus:text-black",
693
- "focus:outline-purple-100",
694
- "active:text-purple-80"
695
- ]
696
- },
697
- size: {
698
- small: ["h-10", "text-sm", "px-4", "py-2"],
699
- medium: ["h-12", "text-base", "px-6", "py-3"],
700
- large: ["h-14", "text-lg", "px-8", "py-4"]
701
- }
702
- },
703
- defaultVariants: {
704
- variant: "neutral",
705
- size: "medium"
706
- },
707
- compoundVariants: [
708
- {
709
- variant: "link",
710
- size: "small",
711
- class: ["h-3", "text-xs", "p-0"]
712
- },
713
- {
714
- variant: "link",
715
- size: "medium",
716
- class: ["h-4", "text-sm", "p-0"]
717
- },
718
- {
719
- variant: "link",
720
- size: "large",
721
- class: ["h-6", "text-base", "p-0"]
722
- }
723
- ]
724
- }
725
- );
726
-
727
- // src/components/demos/ComboboxDemo.tsx
728
- var import_jsx_runtime12 = require("react/jsx-runtime");
729
- function ComboboxDemo() {
730
- const [selectedBands, setSelectedBands] = (0, import_react4.useState)([]);
731
- const [selectedFruit, setSelectedFruit] = (0, import_react4.useState)("");
732
- const bands = [
733
- {
734
- title: "Nirvana",
735
- value: "Nirvana",
736
- description: "Come As You Are",
737
- id: "1"
738
- },
739
- { title: "Pearl Jam", value: "Pearl Jam", description: "Jeremy", id: "2" },
740
- {
741
- title: "Soundgarden",
742
- value: "Soundgarden",
743
- description: "Rusty Cage",
744
- id: "3"
745
- },
746
- {
747
- title: "Alice in Chains",
748
- value: "Alice in Chains",
749
- description: "Would?",
750
- id: "4"
751
- },
752
- { title: "Stone Temple Pilots", value: "Stone Temple Pilots", id: "5" },
753
- { title: "Hole", value: "Hole", id: "6" },
754
- { title: "Mudhoney", value: "Mudhoney", id: "7" },
755
- { title: "Screaming Trees", value: "Screaming Trees", id: "8" },
756
- { title: "L7", value: "L7", id: "9" },
757
- { title: "Sonic Youth", value: "Sonic Youth", id: "10" },
758
- {
759
- title: "And You Will Know Us by the Trail of Dead",
760
- value: "And You Will Know Us by the Trail of Dead",
761
- id: "11"
762
- }
763
- ];
764
- const fruits = [
765
- { title: "Cherry", value: "Cherry", id: "1", icon: "Cherry" },
766
- { title: "Grape", value: "Grape", id: "2", icon: "Grape" }
767
- ];
768
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex max-w-sm flex-col flex-wrap gap-4 p-4", children: [
769
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
770
- Combobox,
771
- {
772
- required: true,
773
- label: "US bands from the 90's",
774
- placeholder: "Select a band",
775
- icon: "Music",
776
- options: bands,
777
- id: "bands",
778
- multiselect: true,
779
- description: "This is a tooltip",
780
- onChange: setSelectedBands,
781
- value: selectedBands
782
- }
783
- ),
784
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
785
- Combobox,
786
- {
787
- label: "US bands from the 90's",
788
- options: bands,
789
- variant: "chip",
790
- multiselect: true,
791
- name: "bands 2",
792
- onChange: setSelectedBands,
793
- value: selectedBands
794
- }
795
- ),
796
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
797
- Combobox,
798
- {
799
- label: "Fruit label",
800
- variant: "chip",
801
- options: fruits,
802
- value: selectedFruit,
803
- onChange: setSelectedFruit,
804
- children: ({ close }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-row items-center justify-between bg-white p-2 pl-4", children: [
805
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button, { variant: "link", tabIndex: -1, onClick: close, children: "Clear" }),
806
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Button, { variant: "primary", size: "small", tabIndex: -1, children: "Apply" })
807
- ] })
808
- }
809
- ),
810
- selectedBands.map((band) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-green-80", children: band }, band)),
811
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-purple-100", children: selectedFruit })
812
- ] });
813
- }
814
- var ComboboxDemo_default = ComboboxDemo;
815
-
816
- // src/components/ui/Select.tsx
817
- var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
818
- var import_lucide_react8 = require("lucide-react");
819
- var import_react5 = require("react");
820
-
821
- // src/components/ui/ErrorMessage.tsx
822
- var import_jsx_runtime13 = require("react/jsx-runtime");
823
- function ErrorMessage({ message, className, ...props }) {
824
- if (!message) return null;
825
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
826
- }
827
- var ErrorMessage_default = ErrorMessage;
828
-
829
- // src/components/ui/Chip.tsx
830
- var import_cva4 = require("cva");
831
- var import_tailwind_merge2 = require("tailwind-merge");
832
- var import_jsx_runtime14 = require("react/jsx-runtime");
833
- var Chip = ({ className, variant, size, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: (0, import_tailwind_merge2.twMerge)(chipVariants({ variant, size, className })), ...props });
834
- var chipVariants = (0, import_cva4.cva)(["flex", "items-center", "rounded-3xl", "border", "w-fit"], {
835
- variants: {
836
- variant: {
837
- neutral: ["text-grey-80", "border-grey-10"],
838
- primary: ["text-purple-100", "border-purple-20"],
839
- danger: ["text-pumpkin-100", "border-pumpkin-20"],
840
- onboarding: ["text-green-100", "bg-green-10", "cursor-pointer"],
841
- onboardingSelected: ["text-white", "bg-green-90", "cursor-pointer"]
842
- },
843
- size: {
844
- small: ["text-sm", "leading-5", "px-2", "py-1", "gap-1.5"],
845
- medium: ["text-base", "leading-6", "px-3", "py-2", "gap-2"]
846
- }
847
- },
848
- defaultVariants: {
849
- variant: "neutral",
850
- size: "medium"
851
- }
852
- });
853
- var Chip_default = Chip;
854
-
855
- // src/components/ui/Select.tsx
856
- var import_jsx_runtime15 = require("react/jsx-runtime");
857
- var Select = (0, import_react5.forwardRef)(
858
- ({ label, options, placeholder, multiselect, description, classNames, error, id, ...props }, ref) => {
859
- const { value, defaultValue, dir, className, onChange, ...rest } = props;
860
- const [selected, setSelected] = (0, import_react5.useState)([]);
861
- const [open, setOpen] = (0, import_react5.useState)(false);
862
- const containerRef = (0, import_react5.useRef)(null);
863
- (0, import_react5.useEffect)(() => {
864
- if (!value) return setSelected([]);
865
- setSelected(Array.isArray(value) ? value : [value]);
866
- }, [value]);
867
- const toggleOpen = () => setOpen((prev) => !prev);
868
- const closeOnEscape = (event) => event.key === "Escape" && setOpen(false);
869
- const setValueOnEnter = (event, value2) => event.key === "Enter" && handleChange(value2);
870
- const chipLabels = selected?.map((s) => options?.find(({ value: value2 }) => value2 === s)).filter(Boolean);
871
- function handleLabels() {
872
- if (multiselect) {
873
- return selected.map((o) => options?.find((option) => option.value === o)?.title).join(", ");
874
- }
875
- return options?.find((option) => option.value === selected.join())?.title;
876
- }
877
- function handleOnOpenChange(isOpen) {
878
- if (!multiselect || isOpen) setOpen(isOpen);
879
- }
880
- function handleChange(newValue) {
881
- let newSelected = [];
882
- setSelected((prev) => {
883
- newSelected = prev.includes(newValue) ? prev.filter((item) => item !== newValue) : [...prev, newValue];
884
- return multiselect ? newSelected : [newValue];
885
- });
886
- onChange?.(multiselect ? newSelected : newValue);
887
- }
888
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
889
- "div",
890
- {
891
- className: cn("flex w-full flex-col gap-1", className),
892
- ref: containerRef,
893
- "data-testid": `${(label ?? id)?.toLowerCase()}-select-element`,
894
- children: [
895
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
896
- Label_default,
897
- {
898
- text: label,
899
- htmlFor: props.name,
900
- required: props.required,
901
- description,
902
- className: classNames?.label
903
- }
904
- ),
905
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
906
- SelectPrimitive.Root,
907
- {
908
- open,
909
- value: selected.join(","),
910
- onOpenChange: handleOnOpenChange,
911
- onValueChange: multiselect ? void 0 : handleChange,
912
- defaultValue: typeof defaultValue === "string" ? defaultValue : void 0,
913
- dir: dir === "rtl" ? "rtl" : "ltr",
914
- ...rest,
915
- children: [
916
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
917
- SelectPrimitive.Trigger,
918
- {
919
- ref,
920
- className: cn(
921
- "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",
922
- classNames?.trigger
923
- ),
924
- children: [
925
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "truncate", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
926
- SelectPrimitive.Value,
927
- {
928
- placeholder: placeholder ?? "Select an option",
929
- "aria-label": handleLabels(),
930
- children: handleLabels()
931
- }
932
- ) }),
933
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
934
- import_lucide_react8.ChevronDownIcon,
935
- {
936
- className: "transform text-black group-data-[state=open]:rotate-180",
937
- size: "16"
938
- }
939
- )
940
- ]
941
- }
942
- ),
943
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectPrimitive.Portal, { container: containerRef.current, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
944
- SelectPrimitive.Content,
945
- {
946
- hideWhenDetached: true,
947
- 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",
948
- position: "popper",
949
- sideOffset: 4,
950
- onPointerDownOutside: toggleOpen,
951
- onKeyDown: closeOnEscape,
952
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(SelectPrimitive.Viewport, { children: [
953
- multiselect && !!chipLabels?.length && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
954
- SelectPrimitive.Group,
955
- {
956
- className: "mb-2 flex flex-row flex-wrap gap-1 px-2",
957
- "data-testid": "selected-labels",
958
- children: chipLabels?.map(
959
- (chip) => chip && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Chip_default, { size: "small", variant: "primary", children: [
960
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { children: chip.title }),
961
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
962
- import_lucide_react8.X,
963
- {
964
- size: 18,
965
- "data-testid": `chip-remove-${chip.value}`,
966
- className: "cursor-pointer",
967
- onClick: () => handleChange(chip.value)
968
- }
969
- )
970
- ] }, chip.title)
971
- )
972
- }
973
- ),
974
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Separator, {}),
975
- options?.map(({ id: id2, title, value: value2 }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
976
- SelectPrimitive.Item,
977
- {
978
- value: value2,
979
- 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",
980
- "data-state": selected.includes(value2) ? "checked" : "unchecked",
981
- onKeyDown: (e) => setValueOnEnter(e, value2),
982
- onClick: () => handleChange(value2),
983
- children: [
984
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectPrimitive.ItemText, { children: title }),
985
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
986
- import_lucide_react8.CheckIcon,
987
- {
988
- className: "absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block",
989
- size: 16
990
- }
991
- )
992
- ]
993
- },
994
- id2
995
- ))
996
- ] })
997
- }
998
- ) })
999
- ]
1000
- }
1001
- ),
1002
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ErrorMessage_default, { message: error })
1003
- ]
1004
- }
1005
- );
1006
- }
1007
- );
1008
- Select.displayName = "Select";
1009
- var Select_default = Select;
1010
-
1011
- // src/components/demos/SelectDemo.tsx
1012
- var import_jsx_runtime16 = require("react/jsx-runtime");
1013
- function SelectDemo() {
1014
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "m-4", children: [
1015
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("h3", { children: "Select" }),
1016
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "mt-2 flex max-w-sm flex-col gap-4", children: [
1017
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1018
- Select_default,
1019
- {
1020
- required: true,
1021
- label: "Label - Singleselect",
1022
- placeholder: "Select an option",
1023
- options: [
1024
- { id: "1", value: "1", title: "Option 1" },
1025
- { id: "2", value: "2", title: "Option 2" },
1026
- { id: "3", value: "3", title: "Option 3" }
1027
- ]
1028
- }
1029
- ),
1030
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1031
- Select_default,
1032
- {
1033
- multiselect: true,
1034
- label: "Label - Multiselect",
1035
- placeholder: "Select an option",
1036
- description: "This is a tooltip",
1037
- options: [
1038
- { id: "1", value: "1", title: "Option 1" },
1039
- { id: "2", value: "2", title: "Option 2" },
1040
- { id: "3", value: "3", title: "Option 3" },
1041
- { id: "4", value: "4", title: "Option 4" },
1042
- { id: "5", value: "5", title: "Option 5" },
1043
- { id: "6", value: "6", title: "Option 6" },
1044
- { id: "7", value: "7", title: "Option 7" },
1045
- { id: "8", value: "8", title: "Option 8" },
1046
- { id: "9", value: "9", title: "Option 9" },
1047
- { id: "10", value: "10", title: "Option 10" }
1048
- ]
1049
- }
1050
- ),
1051
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1052
- Select_default,
1053
- {
1054
- disabled: true,
1055
- label: "Label - Disabled",
1056
- placeholder: "Select an option",
1057
- options: [
1058
- { id: "1", value: "1", title: "Option 1" },
1059
- { id: "2", value: "2", title: "Option 2" },
1060
- { id: "3", value: "3", title: "Option 3" }
1061
- ]
1062
- }
1063
- )
1064
- ] })
1065
- ] });
1066
- }
1067
- var SelectDemo_default = SelectDemo;
1068
-
1069
- // src/components/ui/Input.tsx
1070
- var import_cva5 = require("cva");
1071
- var import_lucide_react9 = require("lucide-react");
1072
- var import_react6 = require("react");
1073
- var import_jsx_runtime17 = require("react/jsx-runtime");
1074
- var Input = (0, import_react6.forwardRef)(
1075
- ({ label, error, description, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
1076
- const handleClear = () => {
1077
- onChange?.({ target: { value: "" } });
1078
- onClear?.();
1079
- };
1080
- const IconComponent = icon && import_lucide_react9.icons[icon];
1081
- const placeholder = props.placeholder ?? (icon === "Search" ? "Search..." : "");
1082
- const hasIcon = !!icon;
1083
- const iconColor = theme === "dark" ? "text-white" : "text-grey-80";
1084
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "group flex w-full flex-col gap-1", "data-testid": `input-wrapper-${props.id}`, children: [
1085
- label && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1086
- Label_default,
1087
- {
1088
- text: label,
1089
- htmlFor: props.name,
1090
- required: props.required,
1091
- description,
1092
- className: classNames?.label
1093
- }
1094
- ),
1095
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative flex flex-row items-center", children: [
1096
- IconComponent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1097
- IconComponent,
1098
- {
1099
- className: `absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`
1100
- }
1101
- ),
1102
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1103
- "input",
1104
- {
1105
- className: cn(inputVariants({ theme, hasIcon })),
1106
- ref,
1107
- placeholder,
1108
- value,
1109
- onChange,
1110
- "data-testid": `input-element-${props.id}`,
1111
- ...props
1112
- }
1113
- ),
1114
- hasIcon && value && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1115
- import_lucide_react9.X,
1116
- {
1117
- className: `absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`,
1118
- onClick: handleClear,
1119
- "data-testid": "clear-button"
1120
- }
1121
- )
1122
- ] }),
1123
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ErrorMessage_default, { message: error })
1124
- ] });
1125
- }
1126
- );
1127
- Input.displayName = "Input";
1128
- var inputVariants = (0, import_cva5.cva)(
1129
- [
1130
- "border-input",
1131
- "placeholder:text-muted-foreground",
1132
- "focus-visible:ring-ring",
1133
- "inline-flex",
1134
- "w-full",
1135
- "h-11",
1136
- "items-center",
1137
- "justify-start",
1138
- "gap-3",
1139
- "rounded-lg",
1140
- "bg-transparent",
1141
- "px-3",
1142
- "pt-0.5",
1143
- "text-sm",
1144
- "shadow-sm",
1145
- "ring-grey-50",
1146
- "transition-colors",
1147
- "focus-visible:outline-none",
1148
- "focus-visible:ring-1",
1149
- "disabled:cursor-not-allowed",
1150
- "disabled:opacity-50",
1151
- "appearance-none",
1152
- "[&::-webkit-search-cancel-button]:appearance-none",
1153
- "[&::-webkit-search-decoration]:appearance-none",
1154
- "[&::-webkit-search-results-button]:appearance-none",
1155
- "[&::-webkit-search-results-decoration]:appearance-none",
1156
- "[&::-ms-clear]:display-none",
1157
- "[&::-ms-reveal]:display-none"
1158
- ],
1159
- {
1160
- variants: {
1161
- theme: {
1162
- light: "text-grey-80 border",
1163
- dark: "text-white"
1164
- },
1165
- hasIcon: {
1166
- false: "pl-3",
1167
- true: "pl-8"
1168
- }
1169
- },
1170
- defaultVariants: {
1171
- theme: "light",
1172
- hasIcon: false
1173
- }
1174
- }
1175
- );
1176
- var Input_default = Input;
1177
-
1178
- // src/components/demos/InputDemo.tsx
1179
- var import_jsx_runtime18 = require("react/jsx-runtime");
1180
- function InputDemo() {
1181
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "m-4", children: [
1182
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { children: "Input" }),
1183
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col gap-2 md:flex-row", children: [
1184
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "bg-green-80 p-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Input_default, { theme: "dark", icon: "Search" }) }),
1185
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Input_default, { label: "Required input", required: true, description: "This is a tooltip" }) }),
1186
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Input_default, { icon: "MapPin" }) })
1187
- ] })
1188
- ] });
1189
- }
1190
- var InputDemo_default = InputDemo;
1191
-
1192
- // src/components/ui/Counter.tsx
1193
- var import_cva6 = require("cva");
1194
- var import_lucide_react10 = require("lucide-react");
1195
- var import_react7 = require("react");
1196
- var import_jsx_runtime19 = require("react/jsx-runtime");
1197
- var Counter = (0, import_react7.forwardRef)(
1198
- ({ label, error, min, max, step = 1, description, theme, value, classNames, onChange, ...props }, ref) => {
1199
- const [count, setCount] = (0, import_react7.useState)(0);
1200
- (0, import_react7.useEffect)(() => {
1201
- setCount(value ?? 0);
1202
- }, [value]);
1203
- const handleChange = (e) => {
1204
- const newValue = parseInt(e.target.value.replace(/\D/g, ""), 10);
1205
- if (isNaN(newValue)) return;
1206
- if (min && newValue < min) {
1207
- onChange?.(min);
1208
- setCount(min);
1209
- return;
1210
- }
1211
- if (max && newValue > max) {
1212
- onChange?.(max);
1213
- setCount(max);
1214
- return;
1215
- }
1216
- onChange?.(newValue);
1217
- setCount(newValue);
1218
- };
1219
- const decrement = () => {
1220
- const proposedValue = count - step;
1221
- const newValue = Math.max(min ?? -Infinity, proposedValue);
1222
- onChange?.(newValue);
1223
- setCount(newValue);
1224
- };
1225
- const increment = () => {
1226
- const proposedValue = count + step;
1227
- const newValue = Math.min(max ?? Infinity, proposedValue);
1228
- onChange?.(newValue);
1229
- setCount(newValue);
1230
- };
1231
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
1232
- "div",
1233
- {
1234
- className: cn("flex w-auto flex-col gap-1", classNames?.root),
1235
- "data-testid": `counter-wrapper-${props.id}`,
1236
- children: [
1237
- label && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1238
- Label_default,
1239
- {
1240
- text: label,
1241
- htmlFor: props.name,
1242
- required: props.required,
1243
- description,
1244
- className: classNames?.label
1245
- }
1246
- ),
1247
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "relative flex w-[122px] flex-row items-center", children: [
1248
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1249
- "button",
1250
- {
1251
- type: "button",
1252
- 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",
1253
- onClick: decrement,
1254
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react10.Minus, { className: "h-4 w-4 text-green-100" })
1255
- }
1256
- ),
1257
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1258
- "input",
1259
- {
1260
- className: cn(counterVariants({ theme }), classNames?.input),
1261
- ref,
1262
- value: count,
1263
- onChange: handleChange,
1264
- "data-testid": `counter-element-${props.id}`,
1265
- ...props
1266
- }
1267
- ),
1268
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
1269
- "button",
1270
- {
1271
- type: "button",
1272
- 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",
1273
- onClick: increment,
1274
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react10.Plus, { className: "h-4 w-4 text-green-100" })
1275
- }
1276
- )
1277
- ] }),
1278
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ErrorMessage_default, { message: error })
1279
- ]
1280
- }
1281
- );
1282
- }
1283
- );
1284
- Counter.displayName = "Counter";
1285
- var counterVariants = (0, import_cva6.cva)(
1286
- [
1287
- "border-input",
1288
- "placeholder:text-muted-foreground",
1289
- "focus-visible:ring-ring",
1290
- "inline-flex",
1291
- "w-[122px]",
1292
- "h-11",
1293
- "items-center",
1294
- "justify-start",
1295
- "gap-3",
1296
- "rounded-lg",
1297
- "bg-transparent",
1298
- "px-3",
1299
- "pt-0.5",
1300
- "text-sm",
1301
- "text-center",
1302
- "shadow-sm",
1303
- "ring-grey-50",
1304
- "transition-colors",
1305
- "focus-visible:outline-none",
1306
- "focus-visible:ring-1",
1307
- "disabled:cursor-not-allowed",
1308
- "disabled:opacity-50",
1309
- "appearance-none",
1310
- "[&::-webkit-search-cancel-button]:appearance-none",
1311
- "[&::-webkit-search-decoration]:appearance-none",
1312
- "[&::-webkit-search-results-button]:appearance-none",
1313
- "[&::-webkit-search-results-decoration]:appearance-none",
1314
- "[&::-ms-clear]:display-none",
1315
- "[&::-ms-reveal]:display-none"
1316
- ],
1317
- {
1318
- variants: {
1319
- theme: {
1320
- light: "text-grey-80 border",
1321
- dark: "text-white"
1322
- },
1323
- hasIcon: {
1324
- false: "pl-3",
1325
- true: "pl-8"
1326
- }
1327
- },
1328
- defaultVariants: {
1329
- theme: "light",
1330
- hasIcon: false
1331
- }
1332
- }
1333
- );
1334
-
1335
- // src/components/demos/CounterDemo.tsx
1336
- var import_react8 = require("react");
1337
- var import_jsx_runtime20 = require("react/jsx-runtime");
1338
- function CounterDemo() {
1339
- const [count, setCount] = (0, import_react8.useState)(0);
1340
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "m-4", children: [
1341
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("h3", { children: "Counter" }),
1342
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "flex flex-col gap-2 md:flex-row", children: [
1343
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
1344
- Counter,
1345
- {
1346
- label: "Required Counter",
1347
- required: true,
1348
- value: count,
1349
- onChange: setCount,
1350
- description: "This is a tooltip"
1351
- }
1352
- ) }),
1353
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Counter, { min: 0, max: 10, step: 2 }) })
1354
- ] })
1355
- ] });
1356
- }
1357
- var CounterDemo_default = CounterDemo;
1358
-
1359
- // src/lib/google.ts
1360
- var import_google_maps_services_js = require("@googlemaps/google-maps-services-js");
1361
- var client = new import_google_maps_services_js.Client();
1362
- var autocomplete = async (input, key) => {
1363
- try {
1364
- const response = await client.placeAutocomplete({
1365
- params: { input, key, types: import_google_maps_services_js.PlaceAutocompleteType.address }
1366
- });
1367
- return response.data.predictions;
1368
- } catch (error) {
1369
- console.error(error);
1370
- }
1371
- };
1372
- var fetchLocation = async (place, key) => {
1373
- try {
1374
- if (place.place_id) {
1375
- const placeDetails = await getPlaceDetails(place.place_id, key);
1376
- if (placeDetails) return placeDetails;
1377
- }
1378
- if (place.address) {
1379
- const result = await geocode(place.address, key);
1380
- const firstAddress = result?.[0];
1381
- return firstAddress;
1382
- }
1383
- return void 0;
1384
- } catch (error) {
1385
- console.error("Error fetching location:", error);
1386
- }
1387
- };
1388
- var getPlaceDetails = async (place_id, key) => {
1389
- try {
1390
- const response = await client.placeDetails({
1391
- params: { place_id, key }
1392
- });
1393
- return response.data.result;
1394
- } catch (error) {
1395
- console.error(error);
1396
- }
1397
- };
1398
- var geocode = async (address, key) => {
1399
- try {
1400
- const response = await client.geocode({
1401
- params: { address, key }
1402
- });
1403
- return response.data.results;
1404
- } catch (error) {
1405
- console.error(error);
1406
- }
1407
- };
1408
-
1409
- // src/components/ui/PlacesQueryInput.tsx
1410
- var import_lucide_react11 = require("lucide-react");
1411
- var import_react9 = require("react");
1412
- var import_jsx_runtime21 = require("react/jsx-runtime");
1413
- function PlacesQueryInput({
1414
- apiKey,
1415
- selected,
1416
- onSelect,
1417
- className
1418
- }) {
1419
- const [predictions, setPredictions] = (0, import_react9.useState)(null);
1420
- const [input, setInput] = (0, import_react9.useState)(selected?.description ?? "");
1421
- const [isLoadingPredictions, setIsLoadingPredictions] = (0, import_react9.useState)(false);
1422
- const [shouldOpenUpward, setShouldOpenUpward] = (0, import_react9.useState)(false);
1423
- const timeoutRef = (0, import_react9.useRef)(null);
1424
- const inputRef = (0, import_react9.useRef)(null);
1425
- const debouncedAutocomplete = (0, import_react9.useCallback)((value) => {
1426
- if (timeoutRef.current) {
1427
- clearTimeout(timeoutRef.current);
1428
- }
1429
- timeoutRef.current = setTimeout(async () => {
1430
- if (value.length > 2) {
1431
- setIsLoadingPredictions(true);
1432
- const fetchedPredictions = await autocomplete(value, apiKey);
1433
- fetchedPredictions && setIsLoadingPredictions(false);
1434
- setPredictions(fetchedPredictions ?? []);
1435
- } else {
1436
- setPredictions(null);
1437
- }
1438
- }, 300);
1439
- }, []);
1440
- const handleInputChange = (value) => {
1441
- setInput(value);
1442
- debouncedAutocomplete(value);
1443
- };
1444
- const handleSelect = (prediction) => {
1445
- onSelect(prediction);
1446
- setPredictions(null);
1447
- setInput(prediction.description);
1448
- };
1449
- const handleClear = () => {
1450
- onSelect();
1451
- setPredictions(null);
1452
- setInput("");
1453
- };
1454
- const handleBlur = () => setTimeout(() => setPredictions(null), 200);
1455
- (0, import_react9.useEffect)(() => {
1456
- const checkDropdownPosition = () => {
1457
- if (inputRef.current) {
1458
- const rect = inputRef.current.getBoundingClientRect();
1459
- const windowHeight = window.innerHeight;
1460
- setShouldOpenUpward(rect.bottom + 200 > windowHeight);
1461
- }
1462
- };
1463
- checkDropdownPosition();
1464
- window.addEventListener("resize", checkDropdownPosition);
1465
- return () => window.removeEventListener("resize", checkDropdownPosition);
1466
- }, []);
1467
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: cn("relative w-full", className), ref: inputRef, onBlur: handleBlur, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Command, { children: [
1468
- /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "relative w-full", children: [
1469
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1470
- CommandInput,
1471
- {
1472
- placeholder: "Type an address to search...",
1473
- value: input,
1474
- onValueChange: handleInputChange,
1475
- className: "truncate pr-8"
1476
- }
1477
- ),
1478
- isLoadingPredictions && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.LoaderCircle, { className: "absolute inset-y-0 right-2 my-auto flex h-8 w-8 animate-spin items-center justify-center rounded-full text-green-100" }),
1479
- input && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1480
- "button",
1481
- {
1482
- type: "button",
1483
- className: "absolute inset-y-0 right-2 my-auto flex h-8 w-8 cursor-pointer items-center justify-center rounded-full hover:bg-pickle-20",
1484
- onClick: handleClear,
1485
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react11.CircleX, { className: "h-4 w-4 text-green-100" })
1486
- }
1487
- )
1488
- ] }),
1489
- predictions && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
1490
- CommandList,
1491
- {
1492
- className: cn(
1493
- "absolute z-50 w-full rounded-md border bg-white shadow-lg",
1494
- shouldOpenUpward ? "bottom-full" : "top-full"
1495
- ),
1496
- children: [
1497
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CommandEmpty, { children: "No results" }),
1498
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CommandGroup, { children: predictions.map((prediction) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
1499
- CommandItem,
1500
- {
1501
- onSelect: () => handleSelect(prediction),
1502
- className: "truncate",
1503
- children: prediction.description
1504
- },
1505
- prediction.place_id
1506
- )) })
1507
- ]
1508
- }
1509
- )
1510
- ] }) });
1511
- }
1512
- var PlacesQueryInput_default = PlacesQueryInput;
1513
-
1514
- // src/components/demos/PlacesQueryInputDemo.tsx
1515
- var import_react10 = require("react");
1516
- var import_jsx_runtime22 = require("react/jsx-runtime");
1517
- function PlacesQueryInputDemo() {
1518
- const [selected, setSelected] = (0, import_react10.useState)();
1519
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex h-24 flex-col p-4", children: [
1520
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
1521
- PlacesQueryInput_default,
1522
- {
1523
- className: "max-w-96",
1524
- apiKey: process.env.NEXT_PUBLIC_GOOGLE_API_KEY ?? "",
1525
- selected,
1526
- onSelect: setSelected
1527
- }
1528
- ),
1529
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("h3", { className: "px-3", children: selected?.description })
1530
- ] });
1531
- }
1532
- var PlacesQueryInputDemo_default = PlacesQueryInputDemo;
1533
-
1534
- // src/components/ui/MapComponent.tsx
1535
- var import_react_google_maps = require("@vis.gl/react-google-maps");
1536
- var import_jsx_runtime23 = require("react/jsx-runtime");
1537
- function MapComponent({ apiKey, mapId, position, className, zoom = 15 }) {
1538
- const defaultPosition = { lat: 40.715021, lng: -74.00459 };
1539
- const defaultZoom = 11;
1540
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_google_maps.APIProvider, { apiKey, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cn("h-screen max-w-full", className), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
1541
- import_react_google_maps.Map,
1542
- {
1543
- zoom: position ? zoom : defaultZoom,
1544
- center: position || defaultPosition,
1545
- mapId,
1546
- keyboardShortcuts: false,
1547
- disableDefaultUI: true,
1548
- children: position && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_google_maps.AdvancedMarker, { position, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_google_maps.Pin, { background: "#0B5441", borderColor: "#EBFDF1", glyphColor: "#D4F500" }) })
1549
- }
1550
- ) }) });
1551
- }
1552
- var MapComponent_default = MapComponent;
1553
-
1554
- // src/components/demos/MapComponentDemo.tsx
1555
- var import_react11 = require("react");
1556
- var import_jsx_runtime24 = require("react/jsx-runtime");
1557
- var API_KEY = process.env.NEXT_PUBLIC_GOOGLE_API_KEY ?? "";
1558
- var MAP_ID = process.env.NEXT_PUBLIC_GOOGLE_MAP_ID ?? "";
1559
- function MapComponentDemo() {
1560
- const [position, setPosition] = (0, import_react11.useState)();
1561
- const place = {
1562
- place_id: "ChIJaXQRs6lZwokRY6EFpJnhNNE",
1563
- // Empire State Building Place ID
1564
- address: "Empire State Building, New York, NY, USA"
1565
- };
1566
- (0, import_react11.useEffect)(() => {
1567
- fetchLocation(place, API_KEY).then((location) => {
1568
- if (location) {
1569
- const { lat, lng } = location.geometry?.location ?? {};
1570
- if (!lat || !lng) return;
1571
- setPosition({ lat, lng });
1572
- }
1573
- });
1574
- }, []);
1575
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
1576
- MapComponent_default,
1577
- {
1578
- apiKey: API_KEY,
1579
- mapId: MAP_ID,
1580
- className: "h-[36rem] w-[36rem] p-4",
1581
- position
1582
- }
1583
- );
1584
- }
1585
- var MapComponentDemo_default = MapComponentDemo;
1586
-
1587
- // src/components/demos/index.tsx
1588
- var import_jsx_runtime25 = require("react/jsx-runtime");
1589
- function Demos() {
1590
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
1591
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ComboboxDemo_default, {}),
1592
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(SelectDemo_default, {}),
1593
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(InputDemo_default, {}),
1594
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CounterDemo_default, {}),
1595
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PlacesQueryInputDemo_default, {}),
1596
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MapComponentDemo_default, {})
1597
- ] });
1598
- }
1599
- var demos_default = Demos;
1600
-
1601
- // src/app/page.tsx
1602
- var import_jsx_runtime26 = require("react/jsx-runtime");
1603
- async function Page() {
1604
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(demos_default, {});
1605
- }
1606
- var page_default = Page;
1607
- //# sourceMappingURL=page.cjs.map