@next-degree/pickle-shared-js 0.3.23 → 0.3.25
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 +84 -0
- package/dist/app/layout.css.map +1 -1
- package/dist/app/page.cjs +127 -9
- package/dist/app/page.cjs.map +1 -1
- package/dist/app/page.js +148 -30
- package/dist/app/page.js.map +1 -1
- package/dist/components/demos/ComboboxDemo.cjs +6 -3
- package/dist/components/demos/ComboboxDemo.cjs.map +1 -1
- package/dist/components/demos/ComboboxDemo.js +17 -14
- package/dist/components/demos/ComboboxDemo.js.map +1 -1
- package/dist/components/demos/InputDemo.cjs +178 -0
- package/dist/components/demos/InputDemo.cjs.map +1 -0
- package/dist/components/demos/InputDemo.d.cts +5 -0
- package/dist/components/demos/InputDemo.d.ts +5 -0
- package/dist/components/demos/InputDemo.js +155 -0
- package/dist/components/demos/InputDemo.js.map +1 -0
- package/dist/components/demos/SelectDemo.cjs +6 -3
- package/dist/components/demos/SelectDemo.cjs.map +1 -1
- package/dist/components/demos/SelectDemo.js +17 -14
- package/dist/components/demos/SelectDemo.js.map +1 -1
- package/dist/components/demos/index.cjs +125 -7
- package/dist/components/demos/index.cjs.map +1 -1
- package/dist/components/demos/index.js +146 -28
- package/dist/components/demos/index.js.map +1 -1
- package/dist/components/ui/Combobox.cjs +6 -3
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.js +14 -11
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/Input.cjs +162 -0
- package/dist/components/ui/Input.cjs.map +1 -0
- package/dist/components/ui/Input.d.cts +22 -0
- package/dist/components/ui/Input.d.ts +22 -0
- package/dist/components/ui/Input.js +141 -0
- package/dist/components/ui/Input.js.map +1 -0
- package/dist/components/ui/Label.cjs +6 -3
- package/dist/components/ui/Label.cjs.map +1 -1
- package/dist/components/ui/Label.d.cts +2 -1
- package/dist/components/ui/Label.d.ts +2 -1
- package/dist/components/ui/Label.js +7 -4
- package/dist/components/ui/Label.js.map +1 -1
- package/dist/components/ui/Select.cjs +6 -3
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.js +14 -11
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/index.cjs +175 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +184 -80
- package/dist/index.js.map +1 -1
- package/dist/styles/globals.css +84 -0
- package/dist/styles/globals.css.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24,10 +24,10 @@ function ErrorMessage({ message, className, ...props }) {
|
|
|
24
24
|
var ErrorMessage_default = ErrorMessage;
|
|
25
25
|
|
|
26
26
|
// src/components/ui/Label.tsx
|
|
27
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
28
|
-
function Label({ text, className, ...props }) {
|
|
27
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
28
|
+
function Label({ text, required, className, ...props }) {
|
|
29
29
|
if (!text) return null;
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ jsxs(
|
|
31
31
|
"label",
|
|
32
32
|
{
|
|
33
33
|
className: cn(
|
|
@@ -35,7 +35,10 @@ function Label({ text, className, ...props }) {
|
|
|
35
35
|
className
|
|
36
36
|
),
|
|
37
37
|
...props,
|
|
38
|
-
children:
|
|
38
|
+
children: [
|
|
39
|
+
text,
|
|
40
|
+
required && /* @__PURE__ */ jsx2("span", { className: "text-red-600", children: "\xA0*" })
|
|
41
|
+
]
|
|
39
42
|
}
|
|
40
43
|
);
|
|
41
44
|
}
|
|
@@ -88,7 +91,7 @@ var Separator = React.forwardRef(({ className, orientation = "horizontal", decor
|
|
|
88
91
|
Separator.displayName = SeparatorPrimitive.Root.displayName;
|
|
89
92
|
|
|
90
93
|
// src/components/ui/Select.tsx
|
|
91
|
-
import { jsx as jsx5, jsxs } from "react/jsx-runtime";
|
|
94
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
92
95
|
var Select = forwardRef2(
|
|
93
96
|
({ label, options, placeholder, multiselect, classNames, error, id, ...props }, ref) => {
|
|
94
97
|
const { value, defaultValue, dir, className, onChange, ...rest } = props;
|
|
@@ -120,7 +123,7 @@ var Select = forwardRef2(
|
|
|
120
123
|
});
|
|
121
124
|
onChange?.(multiselect ? newSelected : newValue);
|
|
122
125
|
}
|
|
123
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ jsxs2(
|
|
124
127
|
"div",
|
|
125
128
|
{
|
|
126
129
|
className: cn("flex flex-col space-y-1", className),
|
|
@@ -128,7 +131,7 @@ var Select = forwardRef2(
|
|
|
128
131
|
"data-testid": `${(label ?? id)?.toLowerCase()}-select-element`,
|
|
129
132
|
children: [
|
|
130
133
|
/* @__PURE__ */ jsx5(Label_default, { text: label, className: classNames?.label }),
|
|
131
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ jsxs2(
|
|
132
135
|
SelectPrimitive.Root,
|
|
133
136
|
{
|
|
134
137
|
open,
|
|
@@ -139,7 +142,7 @@ var Select = forwardRef2(
|
|
|
139
142
|
dir: dir === "rtl" ? "rtl" : "ltr",
|
|
140
143
|
...rest,
|
|
141
144
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ jsxs2(
|
|
143
146
|
SelectPrimitive.Trigger,
|
|
144
147
|
{
|
|
145
148
|
ref,
|
|
@@ -175,14 +178,14 @@ var Select = forwardRef2(
|
|
|
175
178
|
sideOffset: 4,
|
|
176
179
|
onPointerDownOutside: toggleOpen,
|
|
177
180
|
onKeyDown: closeOnEscape,
|
|
178
|
-
children: /* @__PURE__ */
|
|
181
|
+
children: /* @__PURE__ */ jsxs2(SelectPrimitive.Viewport, { children: [
|
|
179
182
|
multiselect && !!chipLabels?.length && /* @__PURE__ */ jsx5(
|
|
180
183
|
SelectPrimitive.Group,
|
|
181
184
|
{
|
|
182
185
|
className: "mb-2 flex flex-row flex-wrap gap-1 px-2",
|
|
183
186
|
"data-testid": "selected-labels",
|
|
184
187
|
children: chipLabels?.map(
|
|
185
|
-
(chip) => chip && /* @__PURE__ */
|
|
188
|
+
(chip) => chip && /* @__PURE__ */ jsxs2(Chip_default, { size: "small", variant: "primary", children: [
|
|
186
189
|
/* @__PURE__ */ jsx5("span", { children: chip.title }),
|
|
187
190
|
/* @__PURE__ */ jsx5(
|
|
188
191
|
X,
|
|
@@ -198,7 +201,7 @@ var Select = forwardRef2(
|
|
|
198
201
|
}
|
|
199
202
|
),
|
|
200
203
|
/* @__PURE__ */ jsx5(Separator, {}),
|
|
201
|
-
options?.map(({ id: id2, title, value: value2 }) => /* @__PURE__ */
|
|
204
|
+
options?.map(({ id: id2, title, value: value2 }) => /* @__PURE__ */ jsxs2(
|
|
202
205
|
SelectPrimitive.Item,
|
|
203
206
|
{
|
|
204
207
|
value: value2,
|
|
@@ -240,7 +243,7 @@ import { Check, Minus } from "lucide-react";
|
|
|
240
243
|
import {
|
|
241
244
|
forwardRef as forwardRef3
|
|
242
245
|
} from "react";
|
|
243
|
-
import { jsx as jsx6, jsxs as
|
|
246
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
244
247
|
var CheckboxToggle = forwardRef3(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
245
248
|
CheckboxPrimitive.Root,
|
|
246
249
|
{
|
|
@@ -271,7 +274,7 @@ var CheckboxToggle = forwardRef3(({ className, ...props }, ref) => /* @__PURE__
|
|
|
271
274
|
className
|
|
272
275
|
),
|
|
273
276
|
...props,
|
|
274
|
-
children: /* @__PURE__ */
|
|
277
|
+
children: /* @__PURE__ */ jsxs3(CheckboxPrimitive.Indicator, { className: "flex items-center justify-center text-current", children: [
|
|
275
278
|
/* @__PURE__ */ jsx6(Check, { className: "hidden h-4 w-4 group-data-[state=checked]:block" }),
|
|
276
279
|
/* @__PURE__ */ jsx6(Minus, { className: "hidden h-4 w-4 group-data-[state=indeterminate]:block" })
|
|
277
280
|
] })
|
|
@@ -283,7 +286,7 @@ var Checkbox = forwardRef3(
|
|
|
283
286
|
const { disabled } = props;
|
|
284
287
|
const id = props.id ?? `${props.name ?? props.value?.toString()}-checkbox`;
|
|
285
288
|
const labelClassName = disabled ? "text-grey-40 pointer-events-none" : "";
|
|
286
|
-
return /* @__PURE__ */
|
|
289
|
+
return /* @__PURE__ */ jsxs3("div", { className: cn("flex space-x-2", classNames?.wrapper), children: [
|
|
287
290
|
/* @__PURE__ */ jsx6(CheckboxToggle, { id, disabled, ref, ...props }),
|
|
288
291
|
/* @__PURE__ */ jsx6("label", { htmlFor: id, className: cn(labelClassName, classNames?.label), children })
|
|
289
292
|
] });
|
|
@@ -295,7 +298,7 @@ var Checkbox_default = Checkbox;
|
|
|
295
298
|
// src/components/ui/ListItem.tsx
|
|
296
299
|
import { CheckIcon as CheckIcon2 } from "lucide-react";
|
|
297
300
|
import { icons } from "lucide-react";
|
|
298
|
-
import { jsx as jsx7, jsxs as
|
|
301
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
299
302
|
function ListItem({
|
|
300
303
|
icon,
|
|
301
304
|
hasCheckbox,
|
|
@@ -314,7 +317,7 @@ function ListItem({
|
|
|
314
317
|
return null;
|
|
315
318
|
};
|
|
316
319
|
const optionIcon = icon ? getIconIfValid(icon) : void 0;
|
|
317
|
-
return /* @__PURE__ */
|
|
320
|
+
return /* @__PURE__ */ jsxs4(
|
|
318
321
|
"li",
|
|
319
322
|
{
|
|
320
323
|
className: cn(
|
|
@@ -326,7 +329,7 @@ function ListItem({
|
|
|
326
329
|
children: [
|
|
327
330
|
optionIcon && /* @__PURE__ */ jsx7("span", { className: "mr-2", children: optionIcon }),
|
|
328
331
|
hasCheckbox && /* @__PURE__ */ jsx7(Checkbox_default, { id: value, checked: isSelected, onClick: (e) => e.preventDefault() }),
|
|
329
|
-
/* @__PURE__ */
|
|
332
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
330
333
|
/* @__PURE__ */ jsx7("p", { children: title }),
|
|
331
334
|
/* @__PURE__ */ jsx7("p", { className: "text-xs text-grey-80", children: description })
|
|
332
335
|
] }),
|
|
@@ -343,15 +346,115 @@ function ListItem({
|
|
|
343
346
|
}
|
|
344
347
|
var ListItem_default = ListItem;
|
|
345
348
|
|
|
346
|
-
// src/components/ui/
|
|
347
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
349
|
+
// src/components/ui/Input.tsx
|
|
348
350
|
import { cva as cva2 } from "cva";
|
|
351
|
+
import { icons as icons2, X as X2 } from "lucide-react";
|
|
349
352
|
import { forwardRef as forwardRef4 } from "react";
|
|
350
|
-
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
351
|
-
var
|
|
353
|
+
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
354
|
+
var Input = forwardRef4(
|
|
355
|
+
({ label, error, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
356
|
+
const handleClear = () => {
|
|
357
|
+
onChange?.({ target: { value: "" } });
|
|
358
|
+
onClear?.();
|
|
359
|
+
};
|
|
360
|
+
const IconComponent = icon && icons2[icon];
|
|
361
|
+
const placeholder = props.placeholder ?? (icon === "Search" ? "Search..." : "");
|
|
362
|
+
const hasIcon = !!icon;
|
|
363
|
+
const iconColor = theme === "dark" ? "text-white" : "text-grey-80";
|
|
364
|
+
return /* @__PURE__ */ jsxs5("div", { className: "group flex w-full flex-col", "data-testid": `input-wrapper-${props.id}`, children: [
|
|
365
|
+
label && /* @__PURE__ */ jsx8(Label_default, { text: label, htmlFor: props.name, className: cn("body mb-1", classNames?.label) }),
|
|
366
|
+
/* @__PURE__ */ jsxs5("div", { className: "relative flex flex-row items-center", children: [
|
|
367
|
+
IconComponent && /* @__PURE__ */ jsx8(
|
|
368
|
+
IconComponent,
|
|
369
|
+
{
|
|
370
|
+
className: `absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`
|
|
371
|
+
}
|
|
372
|
+
),
|
|
373
|
+
/* @__PURE__ */ jsx8(
|
|
374
|
+
"input",
|
|
375
|
+
{
|
|
376
|
+
className: cn(inputVariants({ theme, hasIcon })),
|
|
377
|
+
ref,
|
|
378
|
+
placeholder,
|
|
379
|
+
value,
|
|
380
|
+
onChange,
|
|
381
|
+
"data-testid": `input-element-${props.id}`,
|
|
382
|
+
...props
|
|
383
|
+
}
|
|
384
|
+
),
|
|
385
|
+
hasIcon && value && /* @__PURE__ */ jsx8(
|
|
386
|
+
X2,
|
|
387
|
+
{
|
|
388
|
+
className: `absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`,
|
|
389
|
+
onClick: handleClear,
|
|
390
|
+
"data-testid": "clear-button"
|
|
391
|
+
}
|
|
392
|
+
)
|
|
393
|
+
] }),
|
|
394
|
+
/* @__PURE__ */ jsx8(ErrorMessage_default, { message: error, className: "mt-1" })
|
|
395
|
+
] });
|
|
396
|
+
}
|
|
397
|
+
);
|
|
398
|
+
Input.displayName = "Input";
|
|
399
|
+
var inputVariants = cva2(
|
|
400
|
+
[
|
|
401
|
+
"border-input",
|
|
402
|
+
"placeholder:text-muted-foreground",
|
|
403
|
+
"focus-visible:ring-ring",
|
|
404
|
+
"inline-flex",
|
|
405
|
+
"w-full",
|
|
406
|
+
"h-11",
|
|
407
|
+
"items-center",
|
|
408
|
+
"justify-start",
|
|
409
|
+
"gap-3",
|
|
410
|
+
"rounded-lg",
|
|
411
|
+
"bg-transparent",
|
|
412
|
+
"px-3",
|
|
413
|
+
"pt-0.5",
|
|
414
|
+
"text-sm",
|
|
415
|
+
"shadow-sm",
|
|
416
|
+
"ring-grey-50",
|
|
417
|
+
"transition-colors",
|
|
418
|
+
"focus-visible:outline-none",
|
|
419
|
+
"focus-visible:ring-1",
|
|
420
|
+
"disabled:cursor-not-allowed",
|
|
421
|
+
"disabled:opacity-50",
|
|
422
|
+
"appearance-none",
|
|
423
|
+
"[&::-webkit-search-cancel-button]:appearance-none",
|
|
424
|
+
"[&::-webkit-search-decoration]:appearance-none",
|
|
425
|
+
"[&::-webkit-search-results-button]:appearance-none",
|
|
426
|
+
"[&::-webkit-search-results-decoration]:appearance-none",
|
|
427
|
+
"[&::-ms-clear]:display-none",
|
|
428
|
+
"[&::-ms-reveal]:display-none"
|
|
429
|
+
],
|
|
430
|
+
{
|
|
431
|
+
variants: {
|
|
432
|
+
theme: {
|
|
433
|
+
light: "text-grey-80 border",
|
|
434
|
+
dark: "text-white"
|
|
435
|
+
},
|
|
436
|
+
hasIcon: {
|
|
437
|
+
false: "pl-3",
|
|
438
|
+
true: "pl-8"
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
defaultVariants: {
|
|
442
|
+
theme: "light",
|
|
443
|
+
hasIcon: false
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
);
|
|
447
|
+
var Input_default = Input;
|
|
448
|
+
|
|
449
|
+
// src/components/ui/Button.tsx
|
|
450
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
451
|
+
import { cva as cva3 } from "cva";
|
|
452
|
+
import { forwardRef as forwardRef5 } from "react";
|
|
453
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
454
|
+
var Button = forwardRef5(
|
|
352
455
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
353
456
|
const Component = asChild ? Slot : "button";
|
|
354
|
-
return /* @__PURE__ */
|
|
457
|
+
return /* @__PURE__ */ jsx9(
|
|
355
458
|
Component,
|
|
356
459
|
{
|
|
357
460
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -362,7 +465,7 @@ var Button = forwardRef4(
|
|
|
362
465
|
}
|
|
363
466
|
);
|
|
364
467
|
Button.displayName = "Button";
|
|
365
|
-
var buttonVariants =
|
|
468
|
+
var buttonVariants = cva3(
|
|
366
469
|
[
|
|
367
470
|
"flex",
|
|
368
471
|
"items-center",
|
|
@@ -453,9 +556,9 @@ var buttonVariants = cva2(
|
|
|
453
556
|
);
|
|
454
557
|
|
|
455
558
|
// src/components/ui/Combobox.tsx
|
|
456
|
-
import { forwardRef as
|
|
457
|
-
import { ChevronDownIcon as ChevronDownIcon2, CircleX, icons as
|
|
458
|
-
import { cva as
|
|
559
|
+
import { forwardRef as forwardRef9, useEffect as useEffect2, useState as useState2 } from "react";
|
|
560
|
+
import { ChevronDownIcon as ChevronDownIcon2, CircleX, icons as icons3 } from "lucide-react";
|
|
561
|
+
import { cva as cva5 } from "cva";
|
|
459
562
|
|
|
460
563
|
// src/components/primitives/command.tsx
|
|
461
564
|
import { Command as CommandPrimitive } from "cmdk";
|
|
@@ -464,11 +567,11 @@ import * as React4 from "react";
|
|
|
464
567
|
|
|
465
568
|
// src/components/primitives/dialog.tsx
|
|
466
569
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
467
|
-
import { X as
|
|
570
|
+
import { X as X3 } from "lucide-react";
|
|
468
571
|
import * as React3 from "react";
|
|
469
|
-
import { jsx as
|
|
572
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
470
573
|
var DialogPortal = DialogPrimitive.Portal;
|
|
471
|
-
var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
574
|
+
var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
472
575
|
DialogPrimitive.Overlay,
|
|
473
576
|
{
|
|
474
577
|
ref,
|
|
@@ -480,9 +583,9 @@ var DialogOverlay = React3.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
480
583
|
}
|
|
481
584
|
));
|
|
482
585
|
DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
483
|
-
var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
484
|
-
/* @__PURE__ */
|
|
485
|
-
/* @__PURE__ */
|
|
586
|
+
var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs6(DialogPortal, { children: [
|
|
587
|
+
/* @__PURE__ */ jsx10(DialogOverlay, {}),
|
|
588
|
+
/* @__PURE__ */ jsxs6(
|
|
486
589
|
DialogPrimitive.Content,
|
|
487
590
|
{
|
|
488
591
|
ref,
|
|
@@ -493,18 +596,18 @@ var DialogContent = React3.forwardRef(({ className, children, ...props }, ref) =
|
|
|
493
596
|
...props,
|
|
494
597
|
children: [
|
|
495
598
|
children,
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ jsxs6(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: [
|
|
600
|
+
/* @__PURE__ */ jsx10(X3, { className: "h-4 w-4" }),
|
|
601
|
+
/* @__PURE__ */ jsx10("span", { className: "sr-only", children: "Close" })
|
|
499
602
|
] })
|
|
500
603
|
]
|
|
501
604
|
}
|
|
502
605
|
)
|
|
503
606
|
] }));
|
|
504
607
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
505
|
-
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */
|
|
608
|
+
var DialogHeader = ({ className, ...props }) => /* @__PURE__ */ jsx10("div", { className: cn("flex flex-col space-y-1.5 text-center sm:text-left", className), ...props });
|
|
506
609
|
DialogHeader.displayName = "DialogHeader";
|
|
507
|
-
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */
|
|
610
|
+
var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx10(
|
|
508
611
|
"div",
|
|
509
612
|
{
|
|
510
613
|
className: cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", className),
|
|
@@ -512,7 +615,7 @@ var DialogFooter = ({ className, ...props }) => /* @__PURE__ */ jsx9(
|
|
|
512
615
|
}
|
|
513
616
|
);
|
|
514
617
|
DialogFooter.displayName = "DialogFooter";
|
|
515
|
-
var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
618
|
+
var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
516
619
|
DialogPrimitive.Title,
|
|
517
620
|
{
|
|
518
621
|
ref,
|
|
@@ -521,7 +624,7 @@ var DialogTitle = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
521
624
|
}
|
|
522
625
|
));
|
|
523
626
|
DialogTitle.displayName = DialogPrimitive.Title.displayName;
|
|
524
|
-
var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
627
|
+
var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx10(
|
|
525
628
|
DialogPrimitive.Description,
|
|
526
629
|
{
|
|
527
630
|
ref,
|
|
@@ -532,8 +635,8 @@ var DialogDescription = React3.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
532
635
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
533
636
|
|
|
534
637
|
// src/components/primitives/command.tsx
|
|
535
|
-
import { jsx as
|
|
536
|
-
var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
638
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
639
|
+
var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
537
640
|
CommandPrimitive,
|
|
538
641
|
{
|
|
539
642
|
ref,
|
|
@@ -545,9 +648,9 @@ var Command = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ *
|
|
|
545
648
|
}
|
|
546
649
|
));
|
|
547
650
|
Command.displayName = CommandPrimitive.displayName;
|
|
548
|
-
var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
-
/* @__PURE__ */
|
|
651
|
+
var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs7("div", { className: "m-1 flex items-center rounded-xl border px-3", "cmdk-input-wrapper": "", children: [
|
|
652
|
+
/* @__PURE__ */ jsx11(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
653
|
+
/* @__PURE__ */ jsx11(
|
|
551
654
|
CommandPrimitive.Input,
|
|
552
655
|
{
|
|
553
656
|
ref,
|
|
@@ -560,7 +663,7 @@ var CommandInput = React4.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
560
663
|
)
|
|
561
664
|
] }));
|
|
562
665
|
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
563
|
-
var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
666
|
+
var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
564
667
|
CommandPrimitive.List,
|
|
565
668
|
{
|
|
566
669
|
ref,
|
|
@@ -569,9 +672,9 @@ var CommandList = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
569
672
|
}
|
|
570
673
|
));
|
|
571
674
|
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
572
|
-
var CommandEmpty = React4.forwardRef((props, ref) => /* @__PURE__ */
|
|
675
|
+
var CommandEmpty = React4.forwardRef((props, ref) => /* @__PURE__ */ jsx11(CommandPrimitive.Empty, { ref, className: "py-6 text-center text-sm", ...props }));
|
|
573
676
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
574
|
-
var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
677
|
+
var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
575
678
|
CommandPrimitive.Group,
|
|
576
679
|
{
|
|
577
680
|
ref,
|
|
@@ -583,7 +686,7 @@ var CommandGroup = React4.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
583
686
|
}
|
|
584
687
|
));
|
|
585
688
|
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
586
|
-
var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
689
|
+
var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
587
690
|
CommandPrimitive.Separator,
|
|
588
691
|
{
|
|
589
692
|
ref,
|
|
@@ -592,7 +695,7 @@ var CommandSeparator = React4.forwardRef(({ className, ...props }, ref) => /* @_
|
|
|
592
695
|
}
|
|
593
696
|
));
|
|
594
697
|
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
595
|
-
var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
698
|
+
var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
|
|
596
699
|
CommandPrimitive.Item,
|
|
597
700
|
{
|
|
598
701
|
ref,
|
|
@@ -605,7 +708,7 @@ var CommandItem = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
605
708
|
));
|
|
606
709
|
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
607
710
|
var CommandShortcut = ({ className, ...props }) => {
|
|
608
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ jsx11(
|
|
609
712
|
"span",
|
|
610
713
|
{
|
|
611
714
|
className: cn("ml-auto text-xs tracking-widest text-neutral-500", className),
|
|
@@ -618,10 +721,10 @@ CommandShortcut.displayName = "CommandShortcut";
|
|
|
618
721
|
// src/components/primitives/popover.tsx
|
|
619
722
|
import * as React5 from "react";
|
|
620
723
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
621
|
-
import { jsx as
|
|
724
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
622
725
|
var Popover = PopoverPrimitive.Root;
|
|
623
726
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
624
|
-
var PopoverContent = React5.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */
|
|
727
|
+
var PopoverContent = React5.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx12(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx12(
|
|
625
728
|
PopoverPrimitive.Content,
|
|
626
729
|
{
|
|
627
730
|
ref,
|
|
@@ -637,9 +740,9 @@ var PopoverContent = React5.forwardRef(({ className, align = "center", sideOffse
|
|
|
637
740
|
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
638
741
|
|
|
639
742
|
// src/components/ui/Badge.tsx
|
|
640
|
-
import { cva as
|
|
641
|
-
import { jsx as
|
|
642
|
-
var badgeVariants =
|
|
743
|
+
import { cva as cva4 } from "cva";
|
|
744
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
745
|
+
var badgeVariants = cva4("rounded-full px-2 py-0.5 text-xs font-semibold", {
|
|
643
746
|
variants: {
|
|
644
747
|
variant: {
|
|
645
748
|
green: "bg-green-90 text-white",
|
|
@@ -652,12 +755,12 @@ var badgeVariants = cva3("rounded-full px-2 py-0.5 text-xs font-semibold", {
|
|
|
652
755
|
}
|
|
653
756
|
});
|
|
654
757
|
function Badge({ className, variant, ...props }) {
|
|
655
|
-
return /* @__PURE__ */
|
|
758
|
+
return /* @__PURE__ */ jsx13("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
656
759
|
}
|
|
657
760
|
|
|
658
761
|
// src/components/ui/Combobox.tsx
|
|
659
|
-
import { jsx as
|
|
660
|
-
var Combobox =
|
|
762
|
+
import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
763
|
+
var Combobox = forwardRef9((props, ref) => {
|
|
661
764
|
const {
|
|
662
765
|
value,
|
|
663
766
|
label,
|
|
@@ -674,7 +777,7 @@ var Combobox = forwardRef8((props, ref) => {
|
|
|
674
777
|
} = props;
|
|
675
778
|
const [selected, setSelected] = useState2([]);
|
|
676
779
|
const [open, setOpen] = useState2(false);
|
|
677
|
-
const IconComponent = icon &&
|
|
780
|
+
const IconComponent = icon && icons3[icon];
|
|
678
781
|
const hideSearchBox = options?.length <= 5;
|
|
679
782
|
const isDefault = variant === "default";
|
|
680
783
|
const isChip = variant === "chip";
|
|
@@ -709,17 +812,17 @@ var Combobox = forwardRef8((props, ref) => {
|
|
|
709
812
|
const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(", ") : placeholder;
|
|
710
813
|
return isDefault ? defaultLabel : label;
|
|
711
814
|
};
|
|
712
|
-
return /* @__PURE__ */
|
|
713
|
-
isDefault && label && /* @__PURE__ */
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
-
/* @__PURE__ */
|
|
716
|
-
/* @__PURE__ */
|
|
815
|
+
return /* @__PURE__ */ jsxs8("div", { className: cn("flex flex-col gap-2", className), children: [
|
|
816
|
+
isDefault && label && /* @__PURE__ */ jsx14(Label_default, { text: label, className: classNames?.label }),
|
|
817
|
+
/* @__PURE__ */ jsxs8("div", { className: "relative flex", children: [
|
|
818
|
+
/* @__PURE__ */ jsxs8(Popover, { open, onOpenChange: setOpen, children: [
|
|
819
|
+
/* @__PURE__ */ jsx14(
|
|
717
820
|
PopoverTrigger,
|
|
718
821
|
{
|
|
719
822
|
asChild: true,
|
|
720
823
|
disabled: options.length === 0,
|
|
721
824
|
"data-testid": `${props.id ?? props.name}-combobox-trigger`,
|
|
722
|
-
children: /* @__PURE__ */
|
|
825
|
+
children: /* @__PURE__ */ jsxs8(
|
|
723
826
|
"div",
|
|
724
827
|
{
|
|
725
828
|
ref,
|
|
@@ -730,9 +833,9 @@ var Combobox = forwardRef8((props, ref) => {
|
|
|
730
833
|
),
|
|
731
834
|
"aria-expanded": open,
|
|
732
835
|
children: [
|
|
733
|
-
isDefault && IconComponent && /* @__PURE__ */
|
|
734
|
-
isChip && !isEmpty && /* @__PURE__ */
|
|
735
|
-
/* @__PURE__ */
|
|
836
|
+
isDefault && IconComponent && /* @__PURE__ */ jsx14(IconComponent, { className: "h-4 w-4 shrink-0" }),
|
|
837
|
+
isChip && !isEmpty && /* @__PURE__ */ jsx14(Badge, { variant: "purple", children: selected.length }),
|
|
838
|
+
/* @__PURE__ */ jsx14(
|
|
736
839
|
"span",
|
|
737
840
|
{
|
|
738
841
|
className: cn(
|
|
@@ -742,7 +845,7 @@ var Combobox = forwardRef8((props, ref) => {
|
|
|
742
845
|
children: handleDisplayValue()
|
|
743
846
|
}
|
|
744
847
|
),
|
|
745
|
-
showChevron && /* @__PURE__ */
|
|
848
|
+
showChevron && /* @__PURE__ */ jsx14(
|
|
746
849
|
ChevronDownIcon2,
|
|
747
850
|
{
|
|
748
851
|
className: "shrink-0 transform group-data-[state=open]:rotate-180",
|
|
@@ -754,7 +857,7 @@ var Combobox = forwardRef8((props, ref) => {
|
|
|
754
857
|
)
|
|
755
858
|
}
|
|
756
859
|
),
|
|
757
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ jsx14(
|
|
758
861
|
PopoverContent,
|
|
759
862
|
{
|
|
760
863
|
className: cn(
|
|
@@ -765,16 +868,16 @@ var Combobox = forwardRef8((props, ref) => {
|
|
|
765
868
|
collisionPadding: 8,
|
|
766
869
|
sideOffset: 4,
|
|
767
870
|
align: "start",
|
|
768
|
-
children: /* @__PURE__ */
|
|
769
|
-
!hideSearchBox && /* @__PURE__ */
|
|
770
|
-
/* @__PURE__ */
|
|
771
|
-
/* @__PURE__ */
|
|
772
|
-
/* @__PURE__ */
|
|
871
|
+
children: /* @__PURE__ */ jsxs8(Command, { children: [
|
|
872
|
+
!hideSearchBox && /* @__PURE__ */ jsx14(CommandInput, { placeholder: "Search..." }),
|
|
873
|
+
/* @__PURE__ */ jsxs8(CommandList, { children: [
|
|
874
|
+
/* @__PURE__ */ jsx14(CommandEmpty, { children: "No results" }),
|
|
875
|
+
/* @__PURE__ */ jsx14(CommandGroup, { children: options.map(({ id, ...option }) => /* @__PURE__ */ jsx14(
|
|
773
876
|
CommandItem,
|
|
774
877
|
{
|
|
775
878
|
value: option.title,
|
|
776
879
|
onSelect: () => handleSelect(option.value),
|
|
777
|
-
children: /* @__PURE__ */
|
|
880
|
+
children: /* @__PURE__ */ jsx14(
|
|
778
881
|
ListItem_default,
|
|
779
882
|
{
|
|
780
883
|
className: cn(classNames?.items, "truncate py-1"),
|
|
@@ -787,26 +890,26 @@ var Combobox = forwardRef8((props, ref) => {
|
|
|
787
890
|
id
|
|
788
891
|
)) })
|
|
789
892
|
] }),
|
|
790
|
-
!!footer && /* @__PURE__ */
|
|
893
|
+
!!footer && /* @__PURE__ */ jsx14(Separator, {}),
|
|
791
894
|
footer && footer({ close })
|
|
792
895
|
] })
|
|
793
896
|
}
|
|
794
897
|
)
|
|
795
898
|
] }),
|
|
796
|
-
isDefault && !isEmpty && /* @__PURE__ */
|
|
899
|
+
isDefault && !isEmpty && /* @__PURE__ */ jsx14(
|
|
797
900
|
"button",
|
|
798
901
|
{
|
|
799
902
|
type: "button",
|
|
800
903
|
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",
|
|
801
904
|
onClick: handleClear,
|
|
802
|
-
children: /* @__PURE__ */
|
|
905
|
+
children: /* @__PURE__ */ jsx14(CircleX, { className: "h-4 w-4 text-green-100" })
|
|
803
906
|
}
|
|
804
907
|
)
|
|
805
908
|
] })
|
|
806
909
|
] });
|
|
807
910
|
});
|
|
808
911
|
Combobox.displayName = "Combobox";
|
|
809
|
-
var triggerVariants =
|
|
912
|
+
var triggerVariants = cva5(
|
|
810
913
|
"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",
|
|
811
914
|
{
|
|
812
915
|
variants: {
|
|
@@ -837,6 +940,7 @@ export {
|
|
|
837
940
|
Checkbox_default as Checkbox,
|
|
838
941
|
Chip_default as Chip,
|
|
839
942
|
Combobox,
|
|
943
|
+
Input_default as Input,
|
|
840
944
|
Label_default as Label,
|
|
841
945
|
ListItem_default as ListItem,
|
|
842
946
|
Select_default as Select,
|