@next-degree/pickle-shared-js 0.3.21 → 0.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/layout.css +22 -5
- package/dist/app/layout.css.map +1 -1
- package/dist/app/page.cjs +265 -12
- package/dist/app/page.cjs.map +1 -1
- package/dist/app/page.js +270 -12
- package/dist/app/page.js.map +1 -1
- package/dist/components/demos/ComboboxDemo.cjs +16 -8
- package/dist/components/demos/ComboboxDemo.cjs.map +1 -1
- package/dist/components/demos/ComboboxDemo.js +16 -8
- package/dist/components/demos/ComboboxDemo.js.map +1 -1
- package/dist/components/demos/SelectDemo.cjs +323 -0
- package/dist/components/demos/SelectDemo.cjs.map +1 -0
- package/dist/components/demos/SelectDemo.d.cts +5 -0
- package/dist/components/demos/SelectDemo.d.ts +5 -0
- package/dist/components/demos/SelectDemo.js +295 -0
- package/dist/components/demos/SelectDemo.js.map +1 -0
- package/dist/components/demos/index.cjs +263 -10
- package/dist/components/demos/index.cjs.map +1 -1
- package/dist/components/demos/index.js +268 -10
- package/dist/components/demos/index.js.map +1 -1
- package/dist/components/ui/Combobox.cjs +16 -8
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.js +16 -8
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/ErrorMessage.cjs +41 -0
- package/dist/components/ui/ErrorMessage.cjs.map +1 -0
- package/dist/components/ui/ErrorMessage.d.cts +9 -0
- package/dist/components/ui/ErrorMessage.d.ts +9 -0
- package/dist/components/ui/ErrorMessage.js +18 -0
- package/dist/components/ui/ErrorMessage.js.map +1 -0
- package/dist/components/ui/Select.cjs +124 -105
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.d.cts +3 -1
- package/dist/components/ui/Select.d.ts +3 -1
- package/dist/components/ui/Select.js +124 -105
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/index.cjs +205 -178
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +191 -164
- package/dist/index.js.map +1 -1
- package/dist/styles/globals.css +22 -5
- package/dist/styles/globals.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15,11 +15,19 @@ function cn(...inputs) {
|
|
|
15
15
|
return twMerge(clsx(inputs));
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
// src/components/ui/
|
|
18
|
+
// src/components/ui/ErrorMessage.tsx
|
|
19
19
|
import { jsx } from "react/jsx-runtime";
|
|
20
|
+
function ErrorMessage({ message, className, ...props }) {
|
|
21
|
+
if (!message) return null;
|
|
22
|
+
return /* @__PURE__ */ jsx("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
|
|
23
|
+
}
|
|
24
|
+
var ErrorMessage_default = ErrorMessage;
|
|
25
|
+
|
|
26
|
+
// src/components/ui/Label.tsx
|
|
27
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
20
28
|
function Label({ text, className, ...props }) {
|
|
21
29
|
if (!text) return null;
|
|
22
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ jsx2(
|
|
23
31
|
"label",
|
|
24
32
|
{
|
|
25
33
|
className: cn(
|
|
@@ -36,8 +44,8 @@ var Label_default = Label;
|
|
|
36
44
|
// src/components/ui/Chip.tsx
|
|
37
45
|
import { cva } from "cva";
|
|
38
46
|
import { twMerge as twMerge2 } from "tailwind-merge";
|
|
39
|
-
import { jsx as
|
|
40
|
-
var Chip = ({ className, variant, size, ...props }) => /* @__PURE__ */
|
|
47
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
48
|
+
var Chip = ({ className, variant, size, ...props }) => /* @__PURE__ */ jsx3("div", { className: twMerge2(chipVariants({ variant, size, className })), ...props });
|
|
41
49
|
var chipVariants = cva(["flex", "items-center", "rounded-3xl", "border", "w-fit"], {
|
|
42
50
|
variants: {
|
|
43
51
|
variant: {
|
|
@@ -62,8 +70,8 @@ var Chip_default = Chip;
|
|
|
62
70
|
// src/components/primitives/separator.tsx
|
|
63
71
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
64
72
|
import * as React from "react";
|
|
65
|
-
import { jsx as
|
|
66
|
-
var Separator = React.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */
|
|
73
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
74
|
+
var Separator = React.forwardRef(({ className, orientation = "horizontal", decorative = true, ...props }, ref) => /* @__PURE__ */ jsx4(
|
|
67
75
|
SeparatorPrimitive.Root,
|
|
68
76
|
{
|
|
69
77
|
ref,
|
|
@@ -80,9 +88,9 @@ var Separator = React.forwardRef(({ className, orientation = "horizontal", decor
|
|
|
80
88
|
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
81
89
|
|
|
82
90
|
// src/components/ui/Select.tsx
|
|
83
|
-
import { jsx as
|
|
91
|
+
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
84
92
|
var Select = forwardRef2(
|
|
85
|
-
({ label, options, placeholder, multiselect, classNames, ...props }, ref) => {
|
|
93
|
+
({ label, options, placeholder, multiselect, classNames, error, id, ...props }, ref) => {
|
|
86
94
|
const { value, defaultValue, dir, className, onChange, ...rest } = props;
|
|
87
95
|
const [selected, setSelected] = useState([]);
|
|
88
96
|
const [open, setOpen] = useState(false);
|
|
@@ -112,104 +120,115 @@ var Select = forwardRef2(
|
|
|
112
120
|
});
|
|
113
121
|
onChange?.(multiselect ? newSelected : newValue);
|
|
114
122
|
}
|
|
115
|
-
return /* @__PURE__ */ jsxs(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
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",
|
|
158
|
-
position: "popper",
|
|
159
|
-
sideOffset: 4,
|
|
160
|
-
onPointerDownOutside: toggleOpen,
|
|
161
|
-
onKeyDown: closeOnEscape,
|
|
162
|
-
children: /* @__PURE__ */ jsxs(SelectPrimitive.Viewport, { children: [
|
|
163
|
-
multiselect && !!chipLabels?.length && /* @__PURE__ */ jsx4(
|
|
164
|
-
SelectPrimitive.Group,
|
|
165
|
-
{
|
|
166
|
-
className: "mb-2 flex flex-row flex-wrap gap-1 px-2",
|
|
167
|
-
"data-testid": "selected-labels",
|
|
168
|
-
children: chipLabels?.map(
|
|
169
|
-
(chip) => chip && /* @__PURE__ */ jsxs(Chip_default, { size: "small", variant: "primary", children: [
|
|
170
|
-
/* @__PURE__ */ jsx4("span", { children: chip.title }),
|
|
171
|
-
/* @__PURE__ */ jsx4(
|
|
172
|
-
X,
|
|
173
|
-
{
|
|
174
|
-
size: 18,
|
|
175
|
-
"data-testid": `chip-remove-${chip.value}`,
|
|
176
|
-
className: "cursor-pointer",
|
|
177
|
-
onClick: () => handleChange(chip.value)
|
|
178
|
-
}
|
|
179
|
-
)
|
|
180
|
-
] }, chip.title)
|
|
123
|
+
return /* @__PURE__ */ jsxs(
|
|
124
|
+
"div",
|
|
125
|
+
{
|
|
126
|
+
className: cn("flex flex-col space-y-1", className),
|
|
127
|
+
ref: containerRef,
|
|
128
|
+
"data-testid": `${(label ?? id)?.toLowerCase()}-select-element`,
|
|
129
|
+
children: [
|
|
130
|
+
/* @__PURE__ */ jsx5(Label_default, { text: label, className: classNames?.label }),
|
|
131
|
+
/* @__PURE__ */ jsxs(
|
|
132
|
+
SelectPrimitive.Root,
|
|
133
|
+
{
|
|
134
|
+
open,
|
|
135
|
+
value: selected.join(","),
|
|
136
|
+
onOpenChange: handleOnOpenChange,
|
|
137
|
+
onValueChange: multiselect ? void 0 : handleChange,
|
|
138
|
+
defaultValue: typeof defaultValue === "string" ? defaultValue : void 0,
|
|
139
|
+
dir: dir === "rtl" ? "rtl" : "ltr",
|
|
140
|
+
...rest,
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ jsxs(
|
|
143
|
+
SelectPrimitive.Trigger,
|
|
144
|
+
{
|
|
145
|
+
ref,
|
|
146
|
+
className: cn(
|
|
147
|
+
"group flex h-11 min-w-80 flex-row items-center justify-between gap-3 rounded-lg border px-4 py-3 text-sm font-normal focus:outline-purple-100 disabled:bg-grey-5 data-[placeholder]:text-grey-50 data-[placeholder]:disabled:text-grey-40",
|
|
148
|
+
classNames?.trigger
|
|
149
|
+
),
|
|
150
|
+
children: [
|
|
151
|
+
/* @__PURE__ */ jsx5("span", { className: "truncate", children: /* @__PURE__ */ jsx5(
|
|
152
|
+
SelectPrimitive.Value,
|
|
153
|
+
{
|
|
154
|
+
placeholder: placeholder ?? "Select an option",
|
|
155
|
+
"aria-label": handleLabels(),
|
|
156
|
+
children: handleLabels()
|
|
157
|
+
}
|
|
158
|
+
) }),
|
|
159
|
+
/* @__PURE__ */ jsx5(
|
|
160
|
+
ChevronDownIcon,
|
|
161
|
+
{
|
|
162
|
+
className: "transform text-black group-data-[state=open]:rotate-180",
|
|
163
|
+
size: "16"
|
|
164
|
+
}
|
|
181
165
|
)
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
),
|
|
169
|
+
/* @__PURE__ */ jsx5(SelectPrimitive.Portal, { container: containerRef.current, children: /* @__PURE__ */ jsx5(
|
|
170
|
+
SelectPrimitive.Content,
|
|
171
|
+
{
|
|
172
|
+
hideWhenDetached: true,
|
|
173
|
+
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",
|
|
174
|
+
position: "popper",
|
|
175
|
+
sideOffset: 4,
|
|
176
|
+
onPointerDownOutside: toggleOpen,
|
|
177
|
+
onKeyDown: closeOnEscape,
|
|
178
|
+
children: /* @__PURE__ */ jsxs(SelectPrimitive.Viewport, { children: [
|
|
179
|
+
multiselect && !!chipLabels?.length && /* @__PURE__ */ jsx5(
|
|
180
|
+
SelectPrimitive.Group,
|
|
181
|
+
{
|
|
182
|
+
className: "mb-2 flex flex-row flex-wrap gap-1 px-2",
|
|
183
|
+
"data-testid": "selected-labels",
|
|
184
|
+
children: chipLabels?.map(
|
|
185
|
+
(chip) => chip && /* @__PURE__ */ jsxs(Chip_default, { size: "small", variant: "primary", children: [
|
|
186
|
+
/* @__PURE__ */ jsx5("span", { children: chip.title }),
|
|
187
|
+
/* @__PURE__ */ jsx5(
|
|
188
|
+
X,
|
|
189
|
+
{
|
|
190
|
+
size: 18,
|
|
191
|
+
"data-testid": `chip-remove-${chip.value}`,
|
|
192
|
+
className: "cursor-pointer",
|
|
193
|
+
onClick: () => handleChange(chip.value)
|
|
194
|
+
}
|
|
195
|
+
)
|
|
196
|
+
] }, chip.title)
|
|
197
|
+
)
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
/* @__PURE__ */ jsx5(Separator, {}),
|
|
201
|
+
options?.map(({ id: id2, title, value: value2 }) => /* @__PURE__ */ jsxs(
|
|
202
|
+
SelectPrimitive.Item,
|
|
203
|
+
{
|
|
204
|
+
value: value2,
|
|
205
|
+
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",
|
|
206
|
+
"data-state": selected.includes(value2) ? "checked" : "unchecked",
|
|
207
|
+
onKeyDown: (e) => setValueOnEnter(e, value2),
|
|
208
|
+
onClick: () => handleChange(value2),
|
|
209
|
+
children: [
|
|
210
|
+
/* @__PURE__ */ jsx5(SelectPrimitive.ItemText, { children: title }),
|
|
211
|
+
/* @__PURE__ */ jsx5(
|
|
212
|
+
CheckIcon,
|
|
213
|
+
{
|
|
214
|
+
className: "absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block",
|
|
215
|
+
size: 16
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
]
|
|
219
|
+
},
|
|
220
|
+
id2
|
|
221
|
+
))
|
|
222
|
+
] })
|
|
223
|
+
}
|
|
224
|
+
) })
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
),
|
|
228
|
+
/* @__PURE__ */ jsx5(ErrorMessage_default, { message: error, className: "mt-1" })
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
);
|
|
213
232
|
}
|
|
214
233
|
);
|
|
215
234
|
Select.displayName = "Select";
|
|
@@ -221,8 +240,8 @@ import { Check, Minus } from "lucide-react";
|
|
|
221
240
|
import {
|
|
222
241
|
forwardRef as forwardRef3
|
|
223
242
|
} from "react";
|
|
224
|
-
import { jsx as
|
|
225
|
-
var CheckboxToggle = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */
|
|
243
|
+
import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
244
|
+
var CheckboxToggle = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
226
245
|
CheckboxPrimitive.Root,
|
|
227
246
|
{
|
|
228
247
|
ref,
|
|
@@ -253,8 +272,8 @@ var CheckboxToggle = forwardRef3(({ className, ...props }, ref) => /* @__PURE__
|
|
|
253
272
|
),
|
|
254
273
|
...props,
|
|
255
274
|
children: /* @__PURE__ */ jsxs2(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ jsx6(Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }),
|
|
276
|
+
/* @__PURE__ */ jsx6(Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
|
|
258
277
|
] })
|
|
259
278
|
}
|
|
260
279
|
));
|
|
@@ -265,8 +284,8 @@ var Checkbox = forwardRef3(
|
|
|
265
284
|
const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`;
|
|
266
285
|
const labelClassName = disabled ? "text-grey-40 pointer-events-none" : "";
|
|
267
286
|
return /* @__PURE__ */ jsxs2("div", { className: cn("flex space-x-2", classNames?.wrapper), children: [
|
|
268
|
-
/* @__PURE__ */
|
|
269
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ jsx6(CheckboxToggle, { id, disabled, ref, ...props }),
|
|
288
|
+
/* @__PURE__ */ jsx6("label", { htmlFor: id, className: cn(labelClassName, classNames?.label), children })
|
|
270
289
|
] });
|
|
271
290
|
}
|
|
272
291
|
);
|
|
@@ -276,7 +295,7 @@ var Checkbox_default = Checkbox;
|
|
|
276
295
|
// src/components/ui/ListItem.tsx
|
|
277
296
|
import { CheckIcon as CheckIcon2 } from "lucide-react";
|
|
278
297
|
import { icons } from "lucide-react";
|
|
279
|
-
import { jsx as
|
|
298
|
+
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
280
299
|
function ListItem({
|
|
281
300
|
icon,
|
|
282
301
|
hasCheckbox,
|
|
@@ -290,7 +309,7 @@ function ListItem({
|
|
|
290
309
|
const getIconIfValid = (icon2) => {
|
|
291
310
|
if (icon2 in icons) {
|
|
292
311
|
const IconComponent = icons[icon2];
|
|
293
|
-
return /* @__PURE__ */
|
|
312
|
+
return /* @__PURE__ */ jsx7(IconComponent, { size: 14 });
|
|
294
313
|
}
|
|
295
314
|
return null;
|
|
296
315
|
};
|
|
@@ -305,13 +324,13 @@ function ListItem({
|
|
|
305
324
|
...props,
|
|
306
325
|
"data-state": isSelected ? "checked" : "unchecked",
|
|
307
326
|
children: [
|
|
308
|
-
optionIcon && /* @__PURE__ */
|
|
309
|
-
hasCheckbox && /* @__PURE__ */
|
|
327
|
+
optionIcon && /* @__PURE__ */ jsx7("span", { className: "mr-2", children: optionIcon }),
|
|
328
|
+
hasCheckbox && /* @__PURE__ */ jsx7(Checkbox_default, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
|
|
310
329
|
/* @__PURE__ */ jsxs3("div", { children: [
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ jsx7("p", { children: title }),
|
|
331
|
+
/* @__PURE__ */ jsx7("p", { className: "text-xs text-grey-80", children: description })
|
|
313
332
|
] }),
|
|
314
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ jsx7(
|
|
315
334
|
CheckIcon2,
|
|
316
335
|
{
|
|
317
336
|
className: "absolute inset-y-0 right-0 my-auto hidden w-6 text-green-100 group-data-[state=checked]:block",
|
|
@@ -328,11 +347,11 @@ var ListItem_default = ListItem;
|
|
|
328
347
|
import { Slot } from "@radix-ui/react-slot";
|
|
329
348
|
import { cva as cva2 } from "cva";
|
|
330
349
|
import { forwardRef as forwardRef4 } from "react";
|
|
331
|
-
import { jsx as
|
|
350
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
332
351
|
var Button = forwardRef4(
|
|
333
352
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
334
353
|
const Component = asChild ? Slot : "button";
|
|
335
|
-
return /* @__PURE__ */
|
|
354
|
+
return /* @__PURE__ */ jsx8(
|
|
336
355
|
Component,
|
|
337
356
|
{
|
|
338
357
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -447,9 +466,9 @@ import * as React4 from "react";
|
|
|
447
466
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
448
467
|
import { X as X2 } from "lucide-react";
|
|
449
468
|
import * as React3 from "react";
|
|
450
|
-
import { jsx as
|
|
469
|
+
import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
451
470
|
var DialogPortal = DialogPrimitive.Portal;
|
|
452
|
-
var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
471
|
+
var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
453
472
|
DialogPrimitive.Overlay,
|
|
454
473
|
{
|
|
455
474
|
ref,
|
|
@@ -462,7 +481,7 @@ var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
462
481
|
));
|
|
463
482
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
464
483
|
var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs4(DialogPortal, { children: [
|
|
465
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ jsx9(DialogOverlay, {}),
|
|
466
485
|
/* @__PURE__ */ jsxs4(
|
|
467
486
|
DialogPrimitive.Content,
|
|
468
487
|
{
|
|
@@ -475,17 +494,17 @@ var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) =
|
|
|
475
494
|
children: [
|
|
476
495
|
children,
|
|
477
496
|
/* @__PURE__ */ jsxs4(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: [
|
|
478
|
-
/* @__PURE__ */
|
|
479
|
-
/* @__PURE__ */
|
|
497
|
+
/* @__PURE__ */ jsx9(X2, { className: "h-4 w-4" }),
|
|
498
|
+
/* @__PURE__ */ jsx9("span", { className: "sr-only", children: "Close" })
|
|
480
499
|
] })
|
|
481
500
|
]
|
|
482
501
|
}
|
|
483
502
|
)
|
|
484
503
|
] }));
|
|
485
504
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
486
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
505
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx9("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
487
506
|
DialogHeader.displayName = "DialogHeader";
|
|
488
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
507
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx9(
|
|
489
508
|
"div",
|
|
490
509
|
{
|
|
491
510
|
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
|
|
@@ -493,7 +512,7 @@ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx8(
|
|
|
493
512
|
}
|
|
494
513
|
);
|
|
495
514
|
DialogFooter.displayName = "DialogFooter";
|
|
496
|
-
var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
515
|
+
var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
497
516
|
DialogPrimitive.Title,
|
|
498
517
|
{
|
|
499
518
|
ref,
|
|
@@ -502,7 +521,7 @@ var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
502
521
|
}
|
|
503
522
|
));
|
|
504
523
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
505
|
-
var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
524
|
+
var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
506
525
|
DialogPrimitive.Description,
|
|
507
526
|
{
|
|
508
527
|
ref,
|
|
@@ -513,8 +532,8 @@ var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
513
532
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
514
533
|
|
|
515
534
|
// src/components/primitives/command.tsx
|
|
516
|
-
import { jsx as
|
|
517
|
-
var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
535
|
+
import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
536
|
+
var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
518
537
|
CommandPrimitive,
|
|
519
538
|
{
|
|
520
539
|
ref,
|
|
@@ -527,8 +546,8 @@ var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
527
546
|
));
|
|
528
547
|
Command.displayName = CommandPrimitive.displayName;
|
|
529
548
|
var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs5("div", { className: "m-1 flex items-center rounded-xl border px-3", "cmdk-input-wrapper": "", children: [
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
-
/* @__PURE__ */
|
|
549
|
+
/* @__PURE__ */ jsx10(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
550
|
+
/* @__PURE__ */ jsx10(
|
|
532
551
|
CommandPrimitive.Input,
|
|
533
552
|
{
|
|
534
553
|
ref,
|
|
@@ -541,7 +560,7 @@ var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
541
560
|
)
|
|
542
561
|
] }));
|
|
543
562
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
544
|
-
var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
563
|
+
var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
545
564
|
CommandPrimitive.List,
|
|
546
565
|
{
|
|
547
566
|
ref,
|
|
@@ -550,9 +569,9 @@ var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
550
569
|
}
|
|
551
570
|
));
|
|
552
571
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
553
|
-
var CommandEmpty = React4.forwardRef((props, ref) => /* @__PURE__ */
|
|
572
|
+
var CommandEmpty = React4.forwardRef((props, ref) => /* @__PURE__ */ jsx10(CommandPrimitive.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
|
|
554
573
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
555
|
-
var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
574
|
+
var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
556
575
|
CommandPrimitive.Group,
|
|
557
576
|
{
|
|
558
577
|
ref,
|
|
@@ -564,7 +583,7 @@ var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
564
583
|
}
|
|
565
584
|
));
|
|
566
585
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
567
|
-
var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
586
|
+
var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
568
587
|
CommandPrimitive.Separator,
|
|
569
588
|
{
|
|
570
589
|
ref,
|
|
@@ -573,7 +592,7 @@ var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
573
592
|
}
|
|
574
593
|
));
|
|
575
594
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
576
|
-
var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
595
|
+
var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
577
596
|
CommandPrimitive.Item,
|
|
578
597
|
{
|
|
579
598
|
ref,
|
|
@@ -586,7 +605,7 @@ var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
586
605
|
));
|
|
587
606
|
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
588
607
|
var CommandShortcut = ({ className, ...props }) => {
|
|
589
|
-
return /* @__PURE__ */
|
|
608
|
+
return /* @__PURE__ */ jsx10(
|
|
590
609
|
"span",
|
|
591
610
|
{
|
|
592
611
|
className: cn("ml-auto text-xs tracking-widest text-neutral-500", className),
|
|
@@ -599,10 +618,10 @@ CommandShortcut.displayName = "CommandShortcut";
|
|
|
599
618
|
// src/components/primitives/popover.tsx
|
|
600
619
|
import * as React5 from "react";
|
|
601
620
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
602
|
-
import { jsx as
|
|
621
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
603
622
|
var Popover = PopoverPrimitive.Root;
|
|
604
623
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
605
|
-
var PopoverContent = React5.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
624
|
+
var PopoverContent = React5.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx11(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx11(
|
|
606
625
|
PopoverPrimitive.Content,
|
|
607
626
|
{
|
|
608
627
|
ref,
|
|
@@ -619,7 +638,7 @@ PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
|
619
638
|
|
|
620
639
|
// src/components/ui/Badge.tsx
|
|
621
640
|
import { cva as cva3 } from "cva";
|
|
622
|
-
import { jsx as
|
|
641
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
623
642
|
var badgeVariants = cva3("rounded-full px-2 py-0.5 text-xs font-semibold", {
|
|
624
643
|
variants: {
|
|
625
644
|
variant: {
|
|
@@ -633,11 +652,11 @@ var badgeVariants = cva3("rounded-full px-2 py-0.5 text-xs font-semibold", {
|
|
|
633
652
|
}
|
|
634
653
|
});
|
|
635
654
|
function Badge({ className, variant, ...props }) {
|
|
636
|
-
return /* @__PURE__ */
|
|
655
|
+
return /* @__PURE__ */ jsx12("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
637
656
|
}
|
|
638
657
|
|
|
639
658
|
// src/components/ui/Combobox.tsx
|
|
640
|
-
import { jsx as
|
|
659
|
+
import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
641
660
|
var Combobox = forwardRef8((props, ref) => {
|
|
642
661
|
const {
|
|
643
662
|
value,
|
|
@@ -691,10 +710,10 @@ var Combobox = forwardRef8((props, ref) => {
|
|
|
691
710
|
return isDefault ? defaultLabel : label;
|
|
692
711
|
};
|
|
693
712
|
return /* @__PURE__ */ jsxs6("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
694
|
-
isDefault && label && /* @__PURE__ */
|
|
713
|
+
isDefault && label && /* @__PURE__ */ jsx13(Label_default, { text: label, className: classNames?.label }),
|
|
695
714
|
/* @__PURE__ */ jsxs6("div", { className: "relative flex", children: [
|
|
696
715
|
/* @__PURE__ */ jsxs6(Popover, { open, onOpenChange: setOpen, children: [
|
|
697
|
-
/* @__PURE__ */
|
|
716
|
+
/* @__PURE__ */ jsx13(
|
|
698
717
|
PopoverTrigger,
|
|
699
718
|
{
|
|
700
719
|
asChild: true,
|
|
@@ -711,9 +730,9 @@ var Combobox = forwardRef8((props, ref) => {
|
|
|
711
730
|
),
|
|
712
731
|
"aria-expanded": open,
|
|
713
732
|
children: [
|
|
714
|
-
isDefault && IconComponent && /* @__PURE__ */
|
|
715
|
-
isChip && !isEmpty && /* @__PURE__ */
|
|
716
|
-
/* @__PURE__ */
|
|
733
|
+
isDefault && IconComponent && /* @__PURE__ */ jsx13(IconComponent, { className: "h-4 w-4 shrink-0" }),
|
|
734
|
+
isChip && !isEmpty && /* @__PURE__ */ jsx13(Badge, { variant: "purple", children: selected.length }),
|
|
735
|
+
/* @__PURE__ */ jsx13(
|
|
717
736
|
"span",
|
|
718
737
|
{
|
|
719
738
|
className: cn(
|
|
@@ -723,7 +742,7 @@ var Combobox = forwardRef8((props, ref) => {
|
|
|
723
742
|
children: handleDisplayValue()
|
|
724
743
|
}
|
|
725
744
|
),
|
|
726
|
-
showChevron && /* @__PURE__ */
|
|
745
|
+
showChevron && /* @__PURE__ */ jsx13(
|
|
727
746
|
ChevronDownIcon2,
|
|
728
747
|
{
|
|
729
748
|
className: "shrink-0 transform group-data-[state=open]:rotate-180",
|
|
@@ -735,7 +754,7 @@ var Combobox = forwardRef8((props, ref) => {
|
|
|
735
754
|
)
|
|
736
755
|
}
|
|
737
756
|
),
|
|
738
|
-
/* @__PURE__ */
|
|
757
|
+
/* @__PURE__ */ jsx13(
|
|
739
758
|
PopoverContent,
|
|
740
759
|
{
|
|
741
760
|
className: cn(
|
|
@@ -747,32 +766,40 @@ var Combobox = forwardRef8((props, ref) => {
|
|
|
747
766
|
sideOffset: 4,
|
|
748
767
|
align: "start",
|
|
749
768
|
children: /* @__PURE__ */ jsxs6(Command, { children: [
|
|
750
|
-
!hideSearchBox && /* @__PURE__ */
|
|
769
|
+
!hideSearchBox && /* @__PURE__ */ jsx13(CommandInput, { placeholder: "Search..." }),
|
|
751
770
|
/* @__PURE__ */ jsxs6(CommandList, { children: [
|
|
752
|
-
/* @__PURE__ */
|
|
753
|
-
/* @__PURE__ */
|
|
754
|
-
|
|
771
|
+
/* @__PURE__ */ jsx13(CommandEmpty, { children: "No results" }),
|
|
772
|
+
/* @__PURE__ */ jsx13(CommandGroup, { children: options.map(({ id, ...option }) => /* @__PURE__ */ jsx13(
|
|
773
|
+
CommandItem,
|
|
755
774
|
{
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
775
|
+
value: option.title,
|
|
776
|
+
onSelect: () => handleSelect(option.value),
|
|
777
|
+
children: /* @__PURE__ */ jsx13(
|
|
778
|
+
ListItem_default,
|
|
779
|
+
{
|
|
780
|
+
className: cn(classNames?.items, "truncate py-1"),
|
|
781
|
+
isSelected: selected.some((s) => s.value === option.value),
|
|
782
|
+
hasCheckbox: multiselect,
|
|
783
|
+
...option
|
|
784
|
+
}
|
|
785
|
+
)
|
|
786
|
+
},
|
|
787
|
+
id
|
|
788
|
+
)) })
|
|
762
789
|
] }),
|
|
763
|
-
!!footer && /* @__PURE__ */
|
|
790
|
+
!!footer && /* @__PURE__ */ jsx13(Separator, {}),
|
|
764
791
|
footer && footer({ close })
|
|
765
792
|
] })
|
|
766
793
|
}
|
|
767
794
|
)
|
|
768
795
|
] }),
|
|
769
|
-
isDefault && !isEmpty && /* @__PURE__ */
|
|
796
|
+
isDefault && !isEmpty && /* @__PURE__ */ jsx13(
|
|
770
797
|
"button",
|
|
771
798
|
{
|
|
772
799
|
type: "button",
|
|
773
800
|
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",
|
|
774
801
|
onClick: handleClear,
|
|
775
|
-
children: /* @__PURE__ */
|
|
802
|
+
children: /* @__PURE__ */ jsx13(CircleX, { className: "h-4 w-4 text-green-100" })
|
|
776
803
|
}
|
|
777
804
|
)
|
|
778
805
|
] })
|