@next-degree/pickle-shared-js 0.3.25 → 0.3.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/layout.css +30 -13
- package/dist/app/layout.css.map +1 -1
- package/dist/app/page.cjs +347 -116
- package/dist/app/page.cjs.map +1 -1
- package/dist/app/page.js +328 -97
- package/dist/app/page.js.map +1 -1
- package/dist/components/demos/ComboboxDemo.cjs +97 -54
- package/dist/components/demos/ComboboxDemo.cjs.map +1 -1
- package/dist/components/demos/ComboboxDemo.js +91 -48
- package/dist/components/demos/ComboboxDemo.js.map +1 -1
- package/dist/components/demos/CounterDemo.cjs +270 -0
- package/dist/components/demos/CounterDemo.cjs.map +1 -0
- package/dist/components/demos/CounterDemo.d.cts +5 -0
- package/dist/components/demos/CounterDemo.d.ts +5 -0
- package/dist/components/demos/CounterDemo.js +238 -0
- package/dist/components/demos/CounterDemo.js.map +1 -0
- package/dist/components/demos/InputDemo.cjs +82 -35
- package/dist/components/demos/InputDemo.cjs.map +1 -1
- package/dist/components/demos/InputDemo.js +68 -31
- package/dist/components/demos/InputDemo.js.map +1 -1
- package/dist/components/demos/SelectDemo.cjs +92 -53
- package/dist/components/demos/SelectDemo.cjs.map +1 -1
- package/dist/components/demos/SelectDemo.js +83 -44
- package/dist/components/demos/SelectDemo.js.map +1 -1
- package/dist/components/demos/index.cjs +345 -114
- package/dist/components/demos/index.cjs.map +1 -1
- package/dist/components/demos/index.js +326 -95
- package/dist/components/demos/index.js.map +1 -1
- package/dist/components/primitives/tooltip.cjs +75 -0
- package/dist/components/primitives/tooltip.cjs.map +1 -0
- package/dist/components/primitives/tooltip.d.cts +9 -0
- package/dist/components/primitives/tooltip.d.ts +9 -0
- package/dist/components/primitives/tooltip.js +38 -0
- package/dist/components/primitives/tooltip.js.map +1 -0
- package/dist/components/ui/Combobox.cjs +83 -42
- package/dist/components/ui/Combobox.cjs.map +1 -1
- package/dist/components/ui/Combobox.d.cts +5 -2
- package/dist/components/ui/Combobox.d.ts +5 -2
- package/dist/components/ui/Combobox.js +77 -36
- package/dist/components/ui/Combobox.js.map +1 -1
- package/dist/components/ui/Counter.cjs +248 -0
- package/dist/components/ui/Counter.cjs.map +1 -0
- package/dist/components/ui/Counter.d.cts +28 -0
- package/dist/components/ui/Counter.d.ts +28 -0
- package/dist/components/ui/Counter.js +214 -0
- package/dist/components/ui/Counter.js.map +1 -0
- package/dist/components/ui/Input.cjs +75 -28
- package/dist/components/ui/Input.cjs.map +1 -1
- package/dist/components/ui/Input.d.cts +2 -1
- package/dist/components/ui/Input.d.ts +2 -1
- package/dist/components/ui/Input.js +63 -26
- package/dist/components/ui/Input.js.map +1 -1
- package/dist/components/ui/Label.cjs +54 -16
- 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 +44 -16
- package/dist/components/ui/Label.js.map +1 -1
- package/dist/components/ui/Select.cjs +83 -46
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.d.cts +3 -2
- package/dist/components/ui/Select.d.ts +3 -2
- package/dist/components/ui/Select.js +75 -38
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/index.cjs +344 -140
- 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 +318 -115
- package/dist/index.js.map +1 -1
- package/dist/styles/globals.css +30 -13
- package/dist/styles/globals.css.map +1 -1
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ var import_react4 = require("react");
|
|
|
39
39
|
|
|
40
40
|
// src/components/ui/Combobox.tsx
|
|
41
41
|
var import_react2 = require("react");
|
|
42
|
-
var
|
|
42
|
+
var import_lucide_react7 = require("lucide-react");
|
|
43
43
|
var import_cva2 = require("cva");
|
|
44
44
|
|
|
45
45
|
// src/lib/utils.ts
|
|
@@ -376,34 +376,66 @@ function Badge({ className, variant, ...props }) {
|
|
|
376
376
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: cn(badgeVariants({ variant }), className), ...props });
|
|
377
377
|
}
|
|
378
378
|
|
|
379
|
-
// src/components/
|
|
379
|
+
// src/components/primitives/tooltip.tsx
|
|
380
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
381
|
+
var React5 = __toESM(require("react"), 1);
|
|
380
382
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
381
|
-
|
|
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 }) {
|
|
382
404
|
if (!text) return null;
|
|
383
|
-
return /* @__PURE__ */ (0,
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
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
|
+
] });
|
|
397
425
|
}
|
|
398
426
|
var Label_default = Label;
|
|
399
427
|
|
|
400
428
|
// src/components/ui/Combobox.tsx
|
|
401
|
-
var
|
|
429
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
402
430
|
var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
403
431
|
const {
|
|
432
|
+
id,
|
|
433
|
+
name,
|
|
404
434
|
value,
|
|
405
435
|
label,
|
|
406
436
|
options,
|
|
437
|
+
required,
|
|
438
|
+
description,
|
|
407
439
|
classNames,
|
|
408
440
|
multiselect,
|
|
409
441
|
placeholder,
|
|
@@ -416,7 +448,7 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
416
448
|
} = props;
|
|
417
449
|
const [selected, setSelected] = (0, import_react2.useState)([]);
|
|
418
450
|
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
419
|
-
const IconComponent = icon &&
|
|
451
|
+
const IconComponent = icon && import_lucide_react7.icons[icon];
|
|
420
452
|
const hideSearchBox = options?.length <= 5;
|
|
421
453
|
const isDefault = variant === "default";
|
|
422
454
|
const isChip = variant === "chip";
|
|
@@ -451,17 +483,26 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
451
483
|
const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(", ") : placeholder;
|
|
452
484
|
return isDefault ? defaultLabel : label;
|
|
453
485
|
};
|
|
454
|
-
return /* @__PURE__ */ (0,
|
|
455
|
-
isDefault &&
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
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)(
|
|
459
500
|
PopoverTrigger,
|
|
460
501
|
{
|
|
461
502
|
asChild: true,
|
|
462
503
|
disabled: options.length === 0,
|
|
463
|
-
"data-testid": `${
|
|
464
|
-
children: /* @__PURE__ */ (0,
|
|
504
|
+
"data-testid": `${id ?? name}-combobox-trigger`,
|
|
505
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
465
506
|
"div",
|
|
466
507
|
{
|
|
467
508
|
ref,
|
|
@@ -472,9 +513,9 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
472
513
|
),
|
|
473
514
|
"aria-expanded": open,
|
|
474
515
|
children: [
|
|
475
|
-
isDefault && IconComponent && /* @__PURE__ */ (0,
|
|
476
|
-
isChip && !isEmpty && /* @__PURE__ */ (0,
|
|
477
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
478
519
|
"span",
|
|
479
520
|
{
|
|
480
521
|
className: cn(
|
|
@@ -484,8 +525,8 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
484
525
|
children: handleDisplayValue()
|
|
485
526
|
}
|
|
486
527
|
),
|
|
487
|
-
showChevron && /* @__PURE__ */ (0,
|
|
488
|
-
|
|
528
|
+
showChevron && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
529
|
+
import_lucide_react7.ChevronDownIcon,
|
|
489
530
|
{
|
|
490
531
|
className: "shrink-0 transform group-data-[state=open]:rotate-180",
|
|
491
532
|
size: "16"
|
|
@@ -496,7 +537,7 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
496
537
|
)
|
|
497
538
|
}
|
|
498
539
|
),
|
|
499
|
-
/* @__PURE__ */ (0,
|
|
540
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
500
541
|
PopoverContent,
|
|
501
542
|
{
|
|
502
543
|
className: cn(
|
|
@@ -507,16 +548,16 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
507
548
|
collisionPadding: 8,
|
|
508
549
|
sideOffset: 4,
|
|
509
550
|
align: "start",
|
|
510
|
-
children: /* @__PURE__ */ (0,
|
|
511
|
-
!hideSearchBox && /* @__PURE__ */ (0,
|
|
512
|
-
/* @__PURE__ */ (0,
|
|
513
|
-
/* @__PURE__ */ (0,
|
|
514
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
515
556
|
CommandItem,
|
|
516
557
|
{
|
|
517
558
|
value: option.title,
|
|
518
559
|
onSelect: () => handleSelect(option.value),
|
|
519
|
-
children: /* @__PURE__ */ (0,
|
|
560
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
520
561
|
ListItem_default,
|
|
521
562
|
{
|
|
522
563
|
className: cn(classNames?.items, "truncate py-1"),
|
|
@@ -526,22 +567,22 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
526
567
|
}
|
|
527
568
|
)
|
|
528
569
|
},
|
|
529
|
-
|
|
570
|
+
id2
|
|
530
571
|
)) })
|
|
531
572
|
] }),
|
|
532
|
-
!!footer && /* @__PURE__ */ (0,
|
|
573
|
+
!!footer && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Separator, {}),
|
|
533
574
|
footer && footer({ close })
|
|
534
575
|
] })
|
|
535
576
|
}
|
|
536
577
|
)
|
|
537
578
|
] }),
|
|
538
|
-
isDefault && !isEmpty && /* @__PURE__ */ (0,
|
|
579
|
+
isDefault && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
539
580
|
"button",
|
|
540
581
|
{
|
|
541
582
|
type: "button",
|
|
542
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",
|
|
543
584
|
onClick: handleClear,
|
|
544
|
-
children: /* @__PURE__ */ (0,
|
|
585
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react7.CircleX, { className: "h-4 w-4 text-green-100" })
|
|
545
586
|
}
|
|
546
587
|
)
|
|
547
588
|
] })
|
|
@@ -578,11 +619,11 @@ var triggerVariants = (0, import_cva2.cva)(
|
|
|
578
619
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
579
620
|
var import_cva3 = require("cva");
|
|
580
621
|
var import_react3 = require("react");
|
|
581
|
-
var
|
|
622
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
582
623
|
var Button = (0, import_react3.forwardRef)(
|
|
583
624
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
584
625
|
const Component = asChild ? import_react_slot.Slot : "button";
|
|
585
|
-
return /* @__PURE__ */ (0,
|
|
626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
586
627
|
Component,
|
|
587
628
|
{
|
|
588
629
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -684,7 +725,7 @@ var buttonVariants = (0, import_cva3.cva)(
|
|
|
684
725
|
);
|
|
685
726
|
|
|
686
727
|
// src/components/demos/ComboboxDemo.tsx
|
|
687
|
-
var
|
|
728
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
688
729
|
function ComboboxDemo() {
|
|
689
730
|
const [selectedBands, setSelectedBands] = (0, import_react4.useState)([]);
|
|
690
731
|
const [selectedFruit, setSelectedFruit] = (0, import_react4.useState)("");
|
|
@@ -724,21 +765,23 @@ function ComboboxDemo() {
|
|
|
724
765
|
{ title: "Cherry", value: "Cherry", id: "1", icon: "Cherry" },
|
|
725
766
|
{ title: "Grape", value: "Grape", id: "2", icon: "Grape" }
|
|
726
767
|
];
|
|
727
|
-
return /* @__PURE__ */ (0,
|
|
728
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
729
770
|
Combobox,
|
|
730
771
|
{
|
|
772
|
+
required: true,
|
|
731
773
|
label: "US bands from the 90's",
|
|
732
774
|
placeholder: "Select a band",
|
|
733
775
|
icon: "Music",
|
|
734
776
|
options: bands,
|
|
735
777
|
id: "bands",
|
|
736
778
|
multiselect: true,
|
|
779
|
+
description: "This is a tooltip",
|
|
737
780
|
onChange: setSelectedBands,
|
|
738
781
|
value: selectedBands
|
|
739
782
|
}
|
|
740
783
|
),
|
|
741
|
-
/* @__PURE__ */ (0,
|
|
784
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
742
785
|
Combobox,
|
|
743
786
|
{
|
|
744
787
|
label: "US bands from the 90's",
|
|
@@ -750,7 +793,7 @@ function ComboboxDemo() {
|
|
|
750
793
|
value: selectedBands
|
|
751
794
|
}
|
|
752
795
|
),
|
|
753
|
-
/* @__PURE__ */ (0,
|
|
796
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
754
797
|
Combobox,
|
|
755
798
|
{
|
|
756
799
|
label: "Fruit label",
|
|
@@ -758,36 +801,36 @@ function ComboboxDemo() {
|
|
|
758
801
|
options: fruits,
|
|
759
802
|
value: selectedFruit,
|
|
760
803
|
onChange: setSelectedFruit,
|
|
761
|
-
children: ({ close }) => /* @__PURE__ */ (0,
|
|
762
|
-
/* @__PURE__ */ (0,
|
|
763
|
-
/* @__PURE__ */ (0,
|
|
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" })
|
|
764
807
|
] })
|
|
765
808
|
}
|
|
766
809
|
),
|
|
767
|
-
selectedBands.map((band) => /* @__PURE__ */ (0,
|
|
768
|
-
/* @__PURE__ */ (0,
|
|
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 })
|
|
769
812
|
] });
|
|
770
813
|
}
|
|
771
814
|
var ComboboxDemo_default = ComboboxDemo;
|
|
772
815
|
|
|
773
816
|
// src/components/ui/Select.tsx
|
|
774
817
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
|
|
775
|
-
var
|
|
818
|
+
var import_lucide_react8 = require("lucide-react");
|
|
776
819
|
var import_react5 = require("react");
|
|
777
820
|
|
|
778
821
|
// src/components/ui/ErrorMessage.tsx
|
|
779
|
-
var
|
|
822
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
780
823
|
function ErrorMessage({ message, className, ...props }) {
|
|
781
824
|
if (!message) return null;
|
|
782
|
-
return /* @__PURE__ */ (0,
|
|
825
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
|
|
783
826
|
}
|
|
784
827
|
var ErrorMessage_default = ErrorMessage;
|
|
785
828
|
|
|
786
829
|
// src/components/ui/Chip.tsx
|
|
787
830
|
var import_cva4 = require("cva");
|
|
788
831
|
var import_tailwind_merge2 = require("tailwind-merge");
|
|
789
|
-
var
|
|
790
|
-
var Chip = ({ className, variant, size, ...props }) => /* @__PURE__ */ (0,
|
|
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 });
|
|
791
834
|
var chipVariants = (0, import_cva4.cva)(["flex", "items-center", "rounded-3xl", "border", "w-fit"], {
|
|
792
835
|
variants: {
|
|
793
836
|
variant: {
|
|
@@ -810,9 +853,9 @@ var chipVariants = (0, import_cva4.cva)(["flex", "items-center", "rounded-3xl",
|
|
|
810
853
|
var Chip_default = Chip;
|
|
811
854
|
|
|
812
855
|
// src/components/ui/Select.tsx
|
|
813
|
-
var
|
|
856
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
814
857
|
var Select = (0, import_react5.forwardRef)(
|
|
815
|
-
({ label, options, placeholder, multiselect, classNames, error, id, ...props }, ref) => {
|
|
858
|
+
({ label, options, placeholder, multiselect, description, classNames, error, id, ...props }, ref) => {
|
|
816
859
|
const { value, defaultValue, dir, className, onChange, ...rest } = props;
|
|
817
860
|
const [selected, setSelected] = (0, import_react5.useState)([]);
|
|
818
861
|
const [open, setOpen] = (0, import_react5.useState)(false);
|
|
@@ -842,15 +885,24 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
842
885
|
});
|
|
843
886
|
onChange?.(multiselect ? newSelected : newValue);
|
|
844
887
|
}
|
|
845
|
-
return /* @__PURE__ */ (0,
|
|
888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
846
889
|
"div",
|
|
847
890
|
{
|
|
848
|
-
className: cn("flex flex-col
|
|
891
|
+
className: cn("flex w-full flex-col gap-1", className),
|
|
849
892
|
ref: containerRef,
|
|
850
893
|
"data-testid": `${(label ?? id)?.toLowerCase()}-select-element`,
|
|
851
894
|
children: [
|
|
852
|
-
/* @__PURE__ */ (0,
|
|
853
|
-
|
|
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)(
|
|
854
906
|
SelectPrimitive.Root,
|
|
855
907
|
{
|
|
856
908
|
open,
|
|
@@ -861,16 +913,16 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
861
913
|
dir: dir === "rtl" ? "rtl" : "ltr",
|
|
862
914
|
...rest,
|
|
863
915
|
children: [
|
|
864
|
-
/* @__PURE__ */ (0,
|
|
916
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
865
917
|
SelectPrimitive.Trigger,
|
|
866
918
|
{
|
|
867
919
|
ref,
|
|
868
920
|
className: cn(
|
|
869
|
-
"group flex h-11
|
|
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",
|
|
870
922
|
classNames?.trigger
|
|
871
923
|
),
|
|
872
924
|
children: [
|
|
873
|
-
/* @__PURE__ */ (0,
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "truncate", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
874
926
|
SelectPrimitive.Value,
|
|
875
927
|
{
|
|
876
928
|
placeholder: placeholder ?? "Select an option",
|
|
@@ -878,8 +930,8 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
878
930
|
children: handleLabels()
|
|
879
931
|
}
|
|
880
932
|
) }),
|
|
881
|
-
/* @__PURE__ */ (0,
|
|
882
|
-
|
|
933
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
934
|
+
import_lucide_react8.ChevronDownIcon,
|
|
883
935
|
{
|
|
884
936
|
className: "transform text-black group-data-[state=open]:rotate-180",
|
|
885
937
|
size: "16"
|
|
@@ -888,7 +940,7 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
888
940
|
]
|
|
889
941
|
}
|
|
890
942
|
),
|
|
891
|
-
/* @__PURE__ */ (0,
|
|
943
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectPrimitive.Portal, { container: containerRef.current, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
892
944
|
SelectPrimitive.Content,
|
|
893
945
|
{
|
|
894
946
|
hideWhenDetached: true,
|
|
@@ -897,17 +949,17 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
897
949
|
sideOffset: 4,
|
|
898
950
|
onPointerDownOutside: toggleOpen,
|
|
899
951
|
onKeyDown: closeOnEscape,
|
|
900
|
-
children: /* @__PURE__ */ (0,
|
|
901
|
-
multiselect && !!chipLabels?.length && /* @__PURE__ */ (0,
|
|
952
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(SelectPrimitive.Viewport, { children: [
|
|
953
|
+
multiselect && !!chipLabels?.length && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
902
954
|
SelectPrimitive.Group,
|
|
903
955
|
{
|
|
904
956
|
className: "mb-2 flex flex-row flex-wrap gap-1 px-2",
|
|
905
957
|
"data-testid": "selected-labels",
|
|
906
958
|
children: chipLabels?.map(
|
|
907
|
-
(chip) => chip && /* @__PURE__ */ (0,
|
|
908
|
-
/* @__PURE__ */ (0,
|
|
909
|
-
/* @__PURE__ */ (0,
|
|
910
|
-
|
|
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,
|
|
911
963
|
{
|
|
912
964
|
size: 18,
|
|
913
965
|
"data-testid": `chip-remove-${chip.value}`,
|
|
@@ -919,8 +971,8 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
919
971
|
)
|
|
920
972
|
}
|
|
921
973
|
),
|
|
922
|
-
/* @__PURE__ */ (0,
|
|
923
|
-
options?.map(({ id: id2, title, value: value2 }) => /* @__PURE__ */ (0,
|
|
974
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Separator, {}),
|
|
975
|
+
options?.map(({ id: id2, title, value: value2 }) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
924
976
|
SelectPrimitive.Item,
|
|
925
977
|
{
|
|
926
978
|
value: value2,
|
|
@@ -929,9 +981,9 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
929
981
|
onKeyDown: (e) => setValueOnEnter(e, value2),
|
|
930
982
|
onClick: () => handleChange(value2),
|
|
931
983
|
children: [
|
|
932
|
-
/* @__PURE__ */ (0,
|
|
933
|
-
/* @__PURE__ */ (0,
|
|
934
|
-
|
|
984
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectPrimitive.ItemText, { children: title }),
|
|
985
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
986
|
+
import_lucide_react8.CheckIcon,
|
|
935
987
|
{
|
|
936
988
|
className: "absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block",
|
|
937
989
|
size: 16
|
|
@@ -947,7 +999,7 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
947
999
|
]
|
|
948
1000
|
}
|
|
949
1001
|
),
|
|
950
|
-
/* @__PURE__ */ (0,
|
|
1002
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ErrorMessage_default, { message: error })
|
|
951
1003
|
]
|
|
952
1004
|
}
|
|
953
1005
|
);
|
|
@@ -957,14 +1009,15 @@ Select.displayName = "Select";
|
|
|
957
1009
|
var Select_default = Select;
|
|
958
1010
|
|
|
959
1011
|
// src/components/demos/SelectDemo.tsx
|
|
960
|
-
var
|
|
1012
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
961
1013
|
function SelectDemo() {
|
|
962
|
-
return /* @__PURE__ */ (0,
|
|
963
|
-
/* @__PURE__ */ (0,
|
|
964
|
-
/* @__PURE__ */ (0,
|
|
965
|
-
/* @__PURE__ */ (0,
|
|
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)(
|
|
966
1018
|
Select_default,
|
|
967
1019
|
{
|
|
1020
|
+
required: true,
|
|
968
1021
|
label: "Label - Singleselect",
|
|
969
1022
|
placeholder: "Select an option",
|
|
970
1023
|
options: [
|
|
@@ -974,12 +1027,13 @@ function SelectDemo() {
|
|
|
974
1027
|
]
|
|
975
1028
|
}
|
|
976
1029
|
),
|
|
977
|
-
/* @__PURE__ */ (0,
|
|
1030
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
978
1031
|
Select_default,
|
|
979
1032
|
{
|
|
980
1033
|
multiselect: true,
|
|
981
1034
|
label: "Label - Multiselect",
|
|
982
1035
|
placeholder: "Select an option",
|
|
1036
|
+
description: "This is a tooltip",
|
|
983
1037
|
options: [
|
|
984
1038
|
{ id: "1", value: "1", title: "Option 1" },
|
|
985
1039
|
{ id: "2", value: "2", title: "Option 2" },
|
|
@@ -994,7 +1048,7 @@ function SelectDemo() {
|
|
|
994
1048
|
]
|
|
995
1049
|
}
|
|
996
1050
|
),
|
|
997
|
-
/* @__PURE__ */ (0,
|
|
1051
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
998
1052
|
Select_default,
|
|
999
1053
|
{
|
|
1000
1054
|
disabled: true,
|
|
@@ -1014,29 +1068,38 @@ var SelectDemo_default = SelectDemo;
|
|
|
1014
1068
|
|
|
1015
1069
|
// src/components/ui/Input.tsx
|
|
1016
1070
|
var import_cva5 = require("cva");
|
|
1017
|
-
var
|
|
1071
|
+
var import_lucide_react9 = require("lucide-react");
|
|
1018
1072
|
var import_react6 = require("react");
|
|
1019
|
-
var
|
|
1073
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1020
1074
|
var Input = (0, import_react6.forwardRef)(
|
|
1021
|
-
({ label, error, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
1075
|
+
({ label, error, description, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
1022
1076
|
const handleClear = () => {
|
|
1023
1077
|
onChange?.({ target: { value: "" } });
|
|
1024
1078
|
onClear?.();
|
|
1025
1079
|
};
|
|
1026
|
-
const IconComponent = icon &&
|
|
1080
|
+
const IconComponent = icon && import_lucide_react9.icons[icon];
|
|
1027
1081
|
const placeholder = props.placeholder ?? (icon === "Search" ? "Search..." : "");
|
|
1028
1082
|
const hasIcon = !!icon;
|
|
1029
1083
|
const iconColor = theme === "dark" ? "text-white" : "text-grey-80";
|
|
1030
|
-
return /* @__PURE__ */ (0,
|
|
1031
|
-
label && /* @__PURE__ */ (0,
|
|
1032
|
-
|
|
1033
|
-
|
|
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)(
|
|
1034
1097
|
IconComponent,
|
|
1035
1098
|
{
|
|
1036
1099
|
className: `absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`
|
|
1037
1100
|
}
|
|
1038
1101
|
),
|
|
1039
|
-
/* @__PURE__ */ (0,
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1040
1103
|
"input",
|
|
1041
1104
|
{
|
|
1042
1105
|
className: cn(inputVariants({ theme, hasIcon })),
|
|
@@ -1048,8 +1111,8 @@ var Input = (0, import_react6.forwardRef)(
|
|
|
1048
1111
|
...props
|
|
1049
1112
|
}
|
|
1050
1113
|
),
|
|
1051
|
-
hasIcon && value && /* @__PURE__ */ (0,
|
|
1052
|
-
|
|
1114
|
+
hasIcon && value && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1115
|
+
import_lucide_react9.X,
|
|
1053
1116
|
{
|
|
1054
1117
|
className: `absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`,
|
|
1055
1118
|
onClick: handleClear,
|
|
@@ -1057,7 +1120,7 @@ var Input = (0, import_react6.forwardRef)(
|
|
|
1057
1120
|
}
|
|
1058
1121
|
)
|
|
1059
1122
|
] }),
|
|
1060
|
-
/* @__PURE__ */ (0,
|
|
1123
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ErrorMessage_default, { message: error })
|
|
1061
1124
|
] });
|
|
1062
1125
|
}
|
|
1063
1126
|
);
|
|
@@ -1113,26 +1176,194 @@ var inputVariants = (0, import_cva5.cva)(
|
|
|
1113
1176
|
var Input_default = Input;
|
|
1114
1177
|
|
|
1115
1178
|
// src/components/demos/InputDemo.tsx
|
|
1116
|
-
var
|
|
1179
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1117
1180
|
function InputDemo() {
|
|
1118
|
-
return /* @__PURE__ */ (0,
|
|
1119
|
-
/* @__PURE__ */ (0,
|
|
1120
|
-
/* @__PURE__ */ (0,
|
|
1121
|
-
/* @__PURE__ */ (0,
|
|
1122
|
-
/* @__PURE__ */ (0,
|
|
1123
|
-
/* @__PURE__ */ (0,
|
|
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" }) })
|
|
1124
1187
|
] })
|
|
1125
1188
|
] });
|
|
1126
1189
|
}
|
|
1127
1190
|
var InputDemo_default = InputDemo;
|
|
1128
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
|
+
|
|
1129
1359
|
// src/components/demos/index.tsx
|
|
1130
|
-
var
|
|
1360
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1131
1361
|
function Demos() {
|
|
1132
|
-
return /* @__PURE__ */ (0,
|
|
1133
|
-
/* @__PURE__ */ (0,
|
|
1134
|
-
/* @__PURE__ */ (0,
|
|
1135
|
-
/* @__PURE__ */ (0,
|
|
1362
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
1363
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ComboboxDemo_default, {}),
|
|
1364
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(SelectDemo_default, {}),
|
|
1365
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(InputDemo_default, {}),
|
|
1366
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CounterDemo_default, {})
|
|
1136
1367
|
] });
|
|
1137
1368
|
}
|
|
1138
1369
|
var demos_default = Demos;
|