@next-degree/pickle-shared-js 0.3.27 → 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 -2
- package/dist/app/layout.css.map +1 -1
- package/dist/app/page.cjs +324 -114
- package/dist/app/page.cjs.map +1 -1
- package/dist/app/page.js +302 -92
- package/dist/app/page.js.map +1 -1
- package/dist/components/demos/ComboboxDemo.cjs +91 -52
- package/dist/components/demos/ComboboxDemo.cjs.map +1 -1
- package/dist/components/demos/ComboboxDemo.js +84 -45
- 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 +74 -35
- package/dist/components/demos/InputDemo.cjs.map +1 -1
- package/dist/components/demos/InputDemo.js +59 -30
- package/dist/components/demos/InputDemo.js.map +1 -1
- package/dist/components/demos/SelectDemo.cjs +83 -53
- package/dist/components/demos/SelectDemo.cjs.map +1 -1
- package/dist/components/demos/SelectDemo.js +73 -43
- package/dist/components/demos/SelectDemo.js.map +1 -1
- package/dist/components/demos/index.cjs +322 -112
- package/dist/components/demos/index.cjs.map +1 -1
- package/dist/components/demos/index.js +300 -90
- 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 +78 -40
- 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 +71 -33
- 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 +67 -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 +54 -25
- 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 +75 -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 +67 -38
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/index.cjs +323 -138
- 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 +295 -111
- package/dist/index.js.map +1 -1
- package/dist/styles/globals.css +30 -2
- package/dist/styles/globals.css.map +1 -1
- package/package.json +1 -1
package/dist/app/page.cjs
CHANGED
|
@@ -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,29 +376,57 @@ 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 {
|
|
404
432
|
id,
|
|
@@ -407,6 +435,7 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
407
435
|
label,
|
|
408
436
|
options,
|
|
409
437
|
required,
|
|
438
|
+
description,
|
|
410
439
|
classNames,
|
|
411
440
|
multiselect,
|
|
412
441
|
placeholder,
|
|
@@ -419,7 +448,7 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
419
448
|
} = props;
|
|
420
449
|
const [selected, setSelected] = (0, import_react2.useState)([]);
|
|
421
450
|
const [open, setOpen] = (0, import_react2.useState)(false);
|
|
422
|
-
const IconComponent = icon &&
|
|
451
|
+
const IconComponent = icon && import_lucide_react7.icons[icon];
|
|
423
452
|
const hideSearchBox = options?.length <= 5;
|
|
424
453
|
const isDefault = variant === "default";
|
|
425
454
|
const isChip = variant === "chip";
|
|
@@ -454,17 +483,26 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
454
483
|
const defaultLabel = !isEmpty ? selected.map((s) => s.title).join(", ") : placeholder;
|
|
455
484
|
return isDefault ? defaultLabel : label;
|
|
456
485
|
};
|
|
457
|
-
return /* @__PURE__ */ (0,
|
|
458
|
-
isDefault && /* @__PURE__ */ (0,
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
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)(
|
|
462
500
|
PopoverTrigger,
|
|
463
501
|
{
|
|
464
502
|
asChild: true,
|
|
465
503
|
disabled: options.length === 0,
|
|
466
504
|
"data-testid": `${id ?? name}-combobox-trigger`,
|
|
467
|
-
children: /* @__PURE__ */ (0,
|
|
505
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
468
506
|
"div",
|
|
469
507
|
{
|
|
470
508
|
ref,
|
|
@@ -475,9 +513,9 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
475
513
|
),
|
|
476
514
|
"aria-expanded": open,
|
|
477
515
|
children: [
|
|
478
|
-
isDefault && IconComponent && /* @__PURE__ */ (0,
|
|
479
|
-
isChip && !isEmpty && /* @__PURE__ */ (0,
|
|
480
|
-
/* @__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)(
|
|
481
519
|
"span",
|
|
482
520
|
{
|
|
483
521
|
className: cn(
|
|
@@ -487,8 +525,8 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
487
525
|
children: handleDisplayValue()
|
|
488
526
|
}
|
|
489
527
|
),
|
|
490
|
-
showChevron && /* @__PURE__ */ (0,
|
|
491
|
-
|
|
528
|
+
showChevron && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
529
|
+
import_lucide_react7.ChevronDownIcon,
|
|
492
530
|
{
|
|
493
531
|
className: "shrink-0 transform group-data-[state=open]:rotate-180",
|
|
494
532
|
size: "16"
|
|
@@ -499,7 +537,7 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
499
537
|
)
|
|
500
538
|
}
|
|
501
539
|
),
|
|
502
|
-
/* @__PURE__ */ (0,
|
|
540
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
503
541
|
PopoverContent,
|
|
504
542
|
{
|
|
505
543
|
className: cn(
|
|
@@ -510,16 +548,16 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
510
548
|
collisionPadding: 8,
|
|
511
549
|
sideOffset: 4,
|
|
512
550
|
align: "start",
|
|
513
|
-
children: /* @__PURE__ */ (0,
|
|
514
|
-
!hideSearchBox && /* @__PURE__ */ (0,
|
|
515
|
-
/* @__PURE__ */ (0,
|
|
516
|
-
/* @__PURE__ */ (0,
|
|
517
|
-
/* @__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)(
|
|
518
556
|
CommandItem,
|
|
519
557
|
{
|
|
520
558
|
value: option.title,
|
|
521
559
|
onSelect: () => handleSelect(option.value),
|
|
522
|
-
children: /* @__PURE__ */ (0,
|
|
560
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
523
561
|
ListItem_default,
|
|
524
562
|
{
|
|
525
563
|
className: cn(classNames?.items, "truncate py-1"),
|
|
@@ -532,19 +570,19 @@ var Combobox = (0, import_react2.forwardRef)((props, ref) => {
|
|
|
532
570
|
id2
|
|
533
571
|
)) })
|
|
534
572
|
] }),
|
|
535
|
-
!!footer && /* @__PURE__ */ (0,
|
|
573
|
+
!!footer && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Separator, {}),
|
|
536
574
|
footer && footer({ close })
|
|
537
575
|
] })
|
|
538
576
|
}
|
|
539
577
|
)
|
|
540
578
|
] }),
|
|
541
|
-
isDefault && !isEmpty && /* @__PURE__ */ (0,
|
|
579
|
+
isDefault && !isEmpty && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
542
580
|
"button",
|
|
543
581
|
{
|
|
544
582
|
type: "button",
|
|
545
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",
|
|
546
584
|
onClick: handleClear,
|
|
547
|
-
children: /* @__PURE__ */ (0,
|
|
585
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react7.CircleX, { className: "h-4 w-4 text-green-100" })
|
|
548
586
|
}
|
|
549
587
|
)
|
|
550
588
|
] })
|
|
@@ -581,11 +619,11 @@ var triggerVariants = (0, import_cva2.cva)(
|
|
|
581
619
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
582
620
|
var import_cva3 = require("cva");
|
|
583
621
|
var import_react3 = require("react");
|
|
584
|
-
var
|
|
622
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
585
623
|
var Button = (0, import_react3.forwardRef)(
|
|
586
624
|
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
587
625
|
const Component = asChild ? import_react_slot.Slot : "button";
|
|
588
|
-
return /* @__PURE__ */ (0,
|
|
626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
589
627
|
Component,
|
|
590
628
|
{
|
|
591
629
|
className: cn(buttonVariants({ variant, size, className })),
|
|
@@ -687,7 +725,7 @@ var buttonVariants = (0, import_cva3.cva)(
|
|
|
687
725
|
);
|
|
688
726
|
|
|
689
727
|
// src/components/demos/ComboboxDemo.tsx
|
|
690
|
-
var
|
|
728
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
691
729
|
function ComboboxDemo() {
|
|
692
730
|
const [selectedBands, setSelectedBands] = (0, import_react4.useState)([]);
|
|
693
731
|
const [selectedFruit, setSelectedFruit] = (0, import_react4.useState)("");
|
|
@@ -727,8 +765,8 @@ function ComboboxDemo() {
|
|
|
727
765
|
{ title: "Cherry", value: "Cherry", id: "1", icon: "Cherry" },
|
|
728
766
|
{ title: "Grape", value: "Grape", id: "2", icon: "Grape" }
|
|
729
767
|
];
|
|
730
|
-
return /* @__PURE__ */ (0,
|
|
731
|
-
/* @__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)(
|
|
732
770
|
Combobox,
|
|
733
771
|
{
|
|
734
772
|
required: true,
|
|
@@ -738,11 +776,12 @@ function ComboboxDemo() {
|
|
|
738
776
|
options: bands,
|
|
739
777
|
id: "bands",
|
|
740
778
|
multiselect: true,
|
|
779
|
+
description: "This is a tooltip",
|
|
741
780
|
onChange: setSelectedBands,
|
|
742
781
|
value: selectedBands
|
|
743
782
|
}
|
|
744
783
|
),
|
|
745
|
-
/* @__PURE__ */ (0,
|
|
784
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
746
785
|
Combobox,
|
|
747
786
|
{
|
|
748
787
|
label: "US bands from the 90's",
|
|
@@ -754,7 +793,7 @@ function ComboboxDemo() {
|
|
|
754
793
|
value: selectedBands
|
|
755
794
|
}
|
|
756
795
|
),
|
|
757
|
-
/* @__PURE__ */ (0,
|
|
796
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
758
797
|
Combobox,
|
|
759
798
|
{
|
|
760
799
|
label: "Fruit label",
|
|
@@ -762,36 +801,36 @@ function ComboboxDemo() {
|
|
|
762
801
|
options: fruits,
|
|
763
802
|
value: selectedFruit,
|
|
764
803
|
onChange: setSelectedFruit,
|
|
765
|
-
children: ({ close }) => /* @__PURE__ */ (0,
|
|
766
|
-
/* @__PURE__ */ (0,
|
|
767
|
-
/* @__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" })
|
|
768
807
|
] })
|
|
769
808
|
}
|
|
770
809
|
),
|
|
771
|
-
selectedBands.map((band) => /* @__PURE__ */ (0,
|
|
772
|
-
/* @__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 })
|
|
773
812
|
] });
|
|
774
813
|
}
|
|
775
814
|
var ComboboxDemo_default = ComboboxDemo;
|
|
776
815
|
|
|
777
816
|
// src/components/ui/Select.tsx
|
|
778
817
|
var SelectPrimitive = __toESM(require("@radix-ui/react-select"), 1);
|
|
779
|
-
var
|
|
818
|
+
var import_lucide_react8 = require("lucide-react");
|
|
780
819
|
var import_react5 = require("react");
|
|
781
820
|
|
|
782
821
|
// src/components/ui/ErrorMessage.tsx
|
|
783
|
-
var
|
|
822
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
784
823
|
function ErrorMessage({ message, className, ...props }) {
|
|
785
824
|
if (!message) return null;
|
|
786
|
-
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 });
|
|
787
826
|
}
|
|
788
827
|
var ErrorMessage_default = ErrorMessage;
|
|
789
828
|
|
|
790
829
|
// src/components/ui/Chip.tsx
|
|
791
830
|
var import_cva4 = require("cva");
|
|
792
831
|
var import_tailwind_merge2 = require("tailwind-merge");
|
|
793
|
-
var
|
|
794
|
-
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 });
|
|
795
834
|
var chipVariants = (0, import_cva4.cva)(["flex", "items-center", "rounded-3xl", "border", "w-fit"], {
|
|
796
835
|
variants: {
|
|
797
836
|
variant: {
|
|
@@ -814,9 +853,9 @@ var chipVariants = (0, import_cva4.cva)(["flex", "items-center", "rounded-3xl",
|
|
|
814
853
|
var Chip_default = Chip;
|
|
815
854
|
|
|
816
855
|
// src/components/ui/Select.tsx
|
|
817
|
-
var
|
|
856
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
818
857
|
var Select = (0, import_react5.forwardRef)(
|
|
819
|
-
({ label, options, placeholder, multiselect, classNames, error, id, ...props }, ref) => {
|
|
858
|
+
({ label, options, placeholder, multiselect, description, classNames, error, id, ...props }, ref) => {
|
|
820
859
|
const { value, defaultValue, dir, className, onChange, ...rest } = props;
|
|
821
860
|
const [selected, setSelected] = (0, import_react5.useState)([]);
|
|
822
861
|
const [open, setOpen] = (0, import_react5.useState)(false);
|
|
@@ -846,23 +885,24 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
846
885
|
});
|
|
847
886
|
onChange?.(multiselect ? newSelected : newValue);
|
|
848
887
|
}
|
|
849
|
-
return /* @__PURE__ */ (0,
|
|
888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
850
889
|
"div",
|
|
851
890
|
{
|
|
852
|
-
className: cn("flex flex-col gap-1", className),
|
|
891
|
+
className: cn("flex w-full flex-col gap-1", className),
|
|
853
892
|
ref: containerRef,
|
|
854
893
|
"data-testid": `${(label ?? id)?.toLowerCase()}-select-element`,
|
|
855
894
|
children: [
|
|
856
|
-
/* @__PURE__ */ (0,
|
|
895
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
857
896
|
Label_default,
|
|
858
897
|
{
|
|
859
898
|
text: label,
|
|
860
899
|
htmlFor: props.name,
|
|
861
900
|
required: props.required,
|
|
901
|
+
description,
|
|
862
902
|
className: classNames?.label
|
|
863
903
|
}
|
|
864
904
|
),
|
|
865
|
-
/* @__PURE__ */ (0,
|
|
905
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
866
906
|
SelectPrimitive.Root,
|
|
867
907
|
{
|
|
868
908
|
open,
|
|
@@ -873,16 +913,16 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
873
913
|
dir: dir === "rtl" ? "rtl" : "ltr",
|
|
874
914
|
...rest,
|
|
875
915
|
children: [
|
|
876
|
-
/* @__PURE__ */ (0,
|
|
916
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
877
917
|
SelectPrimitive.Trigger,
|
|
878
918
|
{
|
|
879
919
|
ref,
|
|
880
920
|
className: cn(
|
|
881
|
-
"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",
|
|
882
922
|
classNames?.trigger
|
|
883
923
|
),
|
|
884
924
|
children: [
|
|
885
|
-
/* @__PURE__ */ (0,
|
|
925
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "truncate", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
886
926
|
SelectPrimitive.Value,
|
|
887
927
|
{
|
|
888
928
|
placeholder: placeholder ?? "Select an option",
|
|
@@ -890,8 +930,8 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
890
930
|
children: handleLabels()
|
|
891
931
|
}
|
|
892
932
|
) }),
|
|
893
|
-
/* @__PURE__ */ (0,
|
|
894
|
-
|
|
933
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
934
|
+
import_lucide_react8.ChevronDownIcon,
|
|
895
935
|
{
|
|
896
936
|
className: "transform text-black group-data-[state=open]:rotate-180",
|
|
897
937
|
size: "16"
|
|
@@ -900,7 +940,7 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
900
940
|
]
|
|
901
941
|
}
|
|
902
942
|
),
|
|
903
|
-
/* @__PURE__ */ (0,
|
|
943
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectPrimitive.Portal, { container: containerRef.current, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
904
944
|
SelectPrimitive.Content,
|
|
905
945
|
{
|
|
906
946
|
hideWhenDetached: true,
|
|
@@ -909,17 +949,17 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
909
949
|
sideOffset: 4,
|
|
910
950
|
onPointerDownOutside: toggleOpen,
|
|
911
951
|
onKeyDown: closeOnEscape,
|
|
912
|
-
children: /* @__PURE__ */ (0,
|
|
913
|
-
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)(
|
|
914
954
|
SelectPrimitive.Group,
|
|
915
955
|
{
|
|
916
956
|
className: "mb-2 flex flex-row flex-wrap gap-1 px-2",
|
|
917
957
|
"data-testid": "selected-labels",
|
|
918
958
|
children: chipLabels?.map(
|
|
919
|
-
(chip) => chip && /* @__PURE__ */ (0,
|
|
920
|
-
/* @__PURE__ */ (0,
|
|
921
|
-
/* @__PURE__ */ (0,
|
|
922
|
-
|
|
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,
|
|
923
963
|
{
|
|
924
964
|
size: 18,
|
|
925
965
|
"data-testid": `chip-remove-${chip.value}`,
|
|
@@ -931,8 +971,8 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
931
971
|
)
|
|
932
972
|
}
|
|
933
973
|
),
|
|
934
|
-
/* @__PURE__ */ (0,
|
|
935
|
-
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)(
|
|
936
976
|
SelectPrimitive.Item,
|
|
937
977
|
{
|
|
938
978
|
value: value2,
|
|
@@ -941,9 +981,9 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
941
981
|
onKeyDown: (e) => setValueOnEnter(e, value2),
|
|
942
982
|
onClick: () => handleChange(value2),
|
|
943
983
|
children: [
|
|
944
|
-
/* @__PURE__ */ (0,
|
|
945
|
-
/* @__PURE__ */ (0,
|
|
946
|
-
|
|
984
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(SelectPrimitive.ItemText, { children: title }),
|
|
985
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
986
|
+
import_lucide_react8.CheckIcon,
|
|
947
987
|
{
|
|
948
988
|
className: "absolute inset-y-0 right-3 my-auto hidden w-6 text-purple-100 group-data-[state=checked]:block",
|
|
949
989
|
size: 16
|
|
@@ -959,7 +999,7 @@ var Select = (0, import_react5.forwardRef)(
|
|
|
959
999
|
]
|
|
960
1000
|
}
|
|
961
1001
|
),
|
|
962
|
-
/* @__PURE__ */ (0,
|
|
1002
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(ErrorMessage_default, { message: error })
|
|
963
1003
|
]
|
|
964
1004
|
}
|
|
965
1005
|
);
|
|
@@ -969,12 +1009,12 @@ Select.displayName = "Select";
|
|
|
969
1009
|
var Select_default = Select;
|
|
970
1010
|
|
|
971
1011
|
// src/components/demos/SelectDemo.tsx
|
|
972
|
-
var
|
|
1012
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
973
1013
|
function SelectDemo() {
|
|
974
|
-
return /* @__PURE__ */ (0,
|
|
975
|
-
/* @__PURE__ */ (0,
|
|
976
|
-
/* @__PURE__ */ (0,
|
|
977
|
-
/* @__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)(
|
|
978
1018
|
Select_default,
|
|
979
1019
|
{
|
|
980
1020
|
required: true,
|
|
@@ -987,12 +1027,13 @@ function SelectDemo() {
|
|
|
987
1027
|
]
|
|
988
1028
|
}
|
|
989
1029
|
),
|
|
990
|
-
/* @__PURE__ */ (0,
|
|
1030
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
991
1031
|
Select_default,
|
|
992
1032
|
{
|
|
993
1033
|
multiselect: true,
|
|
994
1034
|
label: "Label - Multiselect",
|
|
995
1035
|
placeholder: "Select an option",
|
|
1036
|
+
description: "This is a tooltip",
|
|
996
1037
|
options: [
|
|
997
1038
|
{ id: "1", value: "1", title: "Option 1" },
|
|
998
1039
|
{ id: "2", value: "2", title: "Option 2" },
|
|
@@ -1007,7 +1048,7 @@ function SelectDemo() {
|
|
|
1007
1048
|
]
|
|
1008
1049
|
}
|
|
1009
1050
|
),
|
|
1010
|
-
/* @__PURE__ */ (0,
|
|
1051
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1011
1052
|
Select_default,
|
|
1012
1053
|
{
|
|
1013
1054
|
disabled: true,
|
|
@@ -1027,37 +1068,38 @@ var SelectDemo_default = SelectDemo;
|
|
|
1027
1068
|
|
|
1028
1069
|
// src/components/ui/Input.tsx
|
|
1029
1070
|
var import_cva5 = require("cva");
|
|
1030
|
-
var
|
|
1071
|
+
var import_lucide_react9 = require("lucide-react");
|
|
1031
1072
|
var import_react6 = require("react");
|
|
1032
|
-
var
|
|
1073
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1033
1074
|
var Input = (0, import_react6.forwardRef)(
|
|
1034
|
-
({ label, error, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
1075
|
+
({ label, error, description, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
1035
1076
|
const handleClear = () => {
|
|
1036
1077
|
onChange?.({ target: { value: "" } });
|
|
1037
1078
|
onClear?.();
|
|
1038
1079
|
};
|
|
1039
|
-
const IconComponent = icon &&
|
|
1080
|
+
const IconComponent = icon && import_lucide_react9.icons[icon];
|
|
1040
1081
|
const placeholder = props.placeholder ?? (icon === "Search" ? "Search..." : "");
|
|
1041
1082
|
const hasIcon = !!icon;
|
|
1042
1083
|
const iconColor = theme === "dark" ? "text-white" : "text-grey-80";
|
|
1043
|
-
return /* @__PURE__ */ (0,
|
|
1044
|
-
label && /* @__PURE__ */ (0,
|
|
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)(
|
|
1045
1086
|
Label_default,
|
|
1046
1087
|
{
|
|
1047
1088
|
text: label,
|
|
1048
1089
|
htmlFor: props.name,
|
|
1049
1090
|
required: props.required,
|
|
1091
|
+
description,
|
|
1050
1092
|
className: classNames?.label
|
|
1051
1093
|
}
|
|
1052
1094
|
),
|
|
1053
|
-
/* @__PURE__ */ (0,
|
|
1054
|
-
IconComponent && /* @__PURE__ */ (0,
|
|
1095
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "relative flex flex-row items-center", children: [
|
|
1096
|
+
IconComponent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1055
1097
|
IconComponent,
|
|
1056
1098
|
{
|
|
1057
1099
|
className: `absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`
|
|
1058
1100
|
}
|
|
1059
1101
|
),
|
|
1060
|
-
/* @__PURE__ */ (0,
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1061
1103
|
"input",
|
|
1062
1104
|
{
|
|
1063
1105
|
className: cn(inputVariants({ theme, hasIcon })),
|
|
@@ -1069,8 +1111,8 @@ var Input = (0, import_react6.forwardRef)(
|
|
|
1069
1111
|
...props
|
|
1070
1112
|
}
|
|
1071
1113
|
),
|
|
1072
|
-
hasIcon && value && /* @__PURE__ */ (0,
|
|
1073
|
-
|
|
1114
|
+
hasIcon && value && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1115
|
+
import_lucide_react9.X,
|
|
1074
1116
|
{
|
|
1075
1117
|
className: `absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`,
|
|
1076
1118
|
onClick: handleClear,
|
|
@@ -1078,7 +1120,7 @@ var Input = (0, import_react6.forwardRef)(
|
|
|
1078
1120
|
}
|
|
1079
1121
|
)
|
|
1080
1122
|
] }),
|
|
1081
|
-
/* @__PURE__ */ (0,
|
|
1123
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ErrorMessage_default, { message: error })
|
|
1082
1124
|
] });
|
|
1083
1125
|
}
|
|
1084
1126
|
);
|
|
@@ -1134,34 +1176,202 @@ var inputVariants = (0, import_cva5.cva)(
|
|
|
1134
1176
|
var Input_default = Input;
|
|
1135
1177
|
|
|
1136
1178
|
// src/components/demos/InputDemo.tsx
|
|
1137
|
-
var
|
|
1179
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1138
1180
|
function InputDemo() {
|
|
1139
|
-
return /* @__PURE__ */ (0,
|
|
1140
|
-
/* @__PURE__ */ (0,
|
|
1141
|
-
/* @__PURE__ */ (0,
|
|
1142
|
-
/* @__PURE__ */ (0,
|
|
1143
|
-
/* @__PURE__ */ (0,
|
|
1144
|
-
/* @__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" }) })
|
|
1145
1187
|
] })
|
|
1146
1188
|
] });
|
|
1147
1189
|
}
|
|
1148
1190
|
var InputDemo_default = InputDemo;
|
|
1149
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
|
+
|
|
1150
1359
|
// src/components/demos/index.tsx
|
|
1151
|
-
var
|
|
1360
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1152
1361
|
function Demos() {
|
|
1153
|
-
return /* @__PURE__ */ (0,
|
|
1154
|
-
/* @__PURE__ */ (0,
|
|
1155
|
-
/* @__PURE__ */ (0,
|
|
1156
|
-
/* @__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, {})
|
|
1157
1367
|
] });
|
|
1158
1368
|
}
|
|
1159
1369
|
var demos_default = Demos;
|
|
1160
1370
|
|
|
1161
1371
|
// src/app/page.tsx
|
|
1162
|
-
var
|
|
1372
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1163
1373
|
async function Page() {
|
|
1164
|
-
return /* @__PURE__ */ (0,
|
|
1374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(demos_default, {});
|
|
1165
1375
|
}
|
|
1166
1376
|
var page_default = Page;
|
|
1167
1377
|
//# sourceMappingURL=page.cjs.map
|