@next-degree/pickle-shared-js 0.3.27 → 0.4.31
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 +59 -2
- package/dist/app/layout.css.map +1 -1
- package/dist/app/page.cjs +464 -114
- package/dist/app/page.cjs.map +1 -1
- package/dist/app/page.js +442 -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/PlacesQueryInputDemo.cjs +341 -0
- package/dist/components/demos/PlacesQueryInputDemo.cjs.map +1 -0
- package/dist/components/demos/PlacesQueryInputDemo.d.cts +5 -0
- package/dist/components/demos/PlacesQueryInputDemo.d.ts +5 -0
- package/dist/components/demos/PlacesQueryInputDemo.js +309 -0
- package/dist/components/demos/PlacesQueryInputDemo.js.map +1 -0
- 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 +462 -112
- package/dist/components/demos/index.cjs.map +1 -1
- package/dist/components/demos/index.js +440 -90
- package/dist/components/demos/index.js.map +1 -1
- package/dist/components/primitives/command.d.cts +1 -1
- package/dist/components/primitives/command.d.ts +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/PlacesQueryInput.cjs +321 -0
- package/dist/components/ui/PlacesQueryInput.cjs.map +1 -0
- package/dist/components/ui/PlacesQueryInput.d.cts +18 -0
- package/dist/components/ui/PlacesQueryInput.d.ts +18 -0
- package/dist/components/ui/PlacesQueryInput.js +289 -0
- package/dist/components/ui/PlacesQueryInput.js.map +1 -0
- 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 +536 -230
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +510 -206
- package/dist/index.js.map +1 -1
- package/dist/lib/google.cjs +43 -0
- package/dist/lib/google.cjs.map +1 -0
- package/dist/lib/google.d.cts +5 -0
- package/dist/lib/google.d.ts +5 -0
- package/dist/lib/google.js +19 -0
- package/dist/lib/google.js.map +1 -0
- package/dist/styles/globals.css +59 -2
- package/dist/styles/globals.css.map +1 -1
- package/package.json +22 -21
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Counter.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/primitives/tooltip.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["'use client'\n\nimport { cva, type VariantProps } from 'cva'\nimport { Minus, Plus } from 'lucide-react'\nimport { ChangeEvent, forwardRef, useEffect, useState, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ntype InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>\ntype CounterVariants = VariantProps<typeof counterVariants>\ntype Props = InputProps &\n CounterVariants & {\n label?: string\n value?: number\n error?: string\n min?: number\n max?: number\n step?: number\n description?: string\n classNames?: { root?: string; input?: string; label?: string }\n onChange?: (n: number) => void\n }\n\nexport const Counter = forwardRef<HTMLInputElement, Props>(\n (\n { label, error, min, max, step = 1, description, theme, value, classNames, onChange, ...props },\n ref\n ) => {\n const [count, setCount] = useState(0)\n\n useEffect(() => {\n setCount(value ?? 0)\n }, [value])\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = parseInt(e.target.value.replace(/\\D/g, ''), 10)\n if (isNaN(newValue)) return\n if (min && newValue < min) {\n onChange?.(min)\n setCount(min)\n return\n }\n if (max && newValue > max) {\n onChange?.(max)\n setCount(max)\n return\n }\n onChange?.(newValue)\n setCount(newValue)\n }\n\n const decrement = () => {\n const proposedValue = count - step\n const newValue = Math.max(min ?? -Infinity, proposedValue)\n onChange?.(newValue)\n setCount(newValue)\n }\n\n const increment = () => {\n const proposedValue = count + step\n const newValue = Math.min(max ?? Infinity, proposedValue)\n onChange?.(newValue)\n setCount(newValue)\n }\n\n return (\n <div\n className={cn('flex w-auto flex-col gap-1', classNames?.root)}\n data-testid={`counter-wrapper-${props.id}`}\n >\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n className={classNames?.label}\n />\n )}\n\n <div className=\"relative flex w-[122px] flex-row items-center\">\n <button\n type=\"button\"\n 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\"\n onClick={decrement}\n >\n <Minus className=\"h-4 w-4 text-green-100\" />\n </button>\n\n <input\n className={cn(counterVariants({ theme }), classNames?.input)}\n ref={ref}\n value={count}\n onChange={handleChange}\n data-testid={`counter-element-${props.id}`}\n {...props}\n />\n\n <button\n type=\"button\"\n 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\"\n onClick={increment}\n >\n <Plus className=\"h-4 w-4 text-green-100\" />\n </button>\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nCounter.displayName = 'Counter'\n\nconst counterVariants = cva(\n [\n 'border-input',\n 'placeholder:text-muted-foreground',\n 'focus-visible:ring-ring',\n 'inline-flex',\n 'w-[122px]',\n 'h-11',\n 'items-center',\n 'justify-start',\n 'gap-3',\n 'rounded-lg',\n 'bg-transparent',\n 'px-3',\n 'pt-0.5',\n 'text-sm',\n 'text-center',\n 'shadow-sm',\n 'ring-grey-50',\n 'transition-colors',\n 'focus-visible:outline-none',\n 'focus-visible:ring-1',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'appearance-none',\n '[&::-webkit-search-cancel-button]:appearance-none',\n '[&::-webkit-search-decoration]:appearance-none',\n '[&::-webkit-search-results-button]:appearance-none',\n '[&::-webkit-search-results-decoration]:appearance-none',\n '[&::-ms-clear]:display-none',\n '[&::-ms-reveal]:display-none',\n ],\n {\n variants: {\n theme: {\n light: 'text-grey-80 border',\n dark: 'text-white',\n },\n hasIcon: {\n false: 'pl-3',\n true: 'pl-8',\n },\n },\n defaultVariants: {\n theme: 'light',\n hasIcon: false,\n },\n }\n)\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n","'use client'\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n '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',\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { InfoIcon } from 'lucide-react'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n description?: string\n}\n\nfunction Label({ text, required, description, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <div className=\"flex w-full flex-row gap-1\">\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n {required && <span className=\"text-red-600\"> *</span>}\n </label>\n\n {!!description && (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <InfoIcon className=\"h-4 w-4\" />\n </TooltipTrigger>\n <TooltipContent className=\"max-w-48\">{description}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n )\n}\n\nexport default Label\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAuC;AACvC,IAAAA,uBAA4B;AAC5B,mBAAuF;;;ACJvF,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACOI;AAJJ,SAAS,aAAa,EAAE,SAAS,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,QAAS,QAAO;AAErB,SACE,4CAAC,OAAE,WAAW,GAAG,6BAA6B,SAAS,GAAI,GAAG,OAC3D,m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C3D;AAAA,gBACA,OAAO;AAAA,gBACP,UAAU;AAAA,gBACV,eAAa,mBAAmB,MAAM,EAAE;AAAA,gBACvC,GAAG;AAAA;AAAA,YACN;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,WAAU;AAAA,gBACV,SAAS;AAAA,gBAET,uDAAC,6BAAK,WAAU,0BAAyB;AAAA;AAAA,YAC3C;AAAA,aACF;AAAA,UAEA,6CAAC,wBAAa,SAAS,OAAO;AAAA;AAAA;AAAA,IAChC;AAAA,EAEJ;AACF;AACA,QAAQ,cAAc;AAEtB,IAAM,sBAAkB;AAAA,EACtB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AACF;","names":["import_lucide_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as cva_types from 'cva/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { InputHTMLAttributes } from 'react';
|
|
4
|
+
import { VariantProps } from 'cva';
|
|
5
|
+
|
|
6
|
+
type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>;
|
|
7
|
+
type CounterVariants = VariantProps<typeof counterVariants>;
|
|
8
|
+
declare const Counter: React.ForwardRefExoticComponent<InputProps & CounterVariants & {
|
|
9
|
+
label?: string;
|
|
10
|
+
value?: number;
|
|
11
|
+
error?: string;
|
|
12
|
+
min?: number;
|
|
13
|
+
max?: number;
|
|
14
|
+
step?: number;
|
|
15
|
+
description?: string;
|
|
16
|
+
classNames?: {
|
|
17
|
+
root?: string;
|
|
18
|
+
input?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
};
|
|
21
|
+
onChange?: (n: number) => void;
|
|
22
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
23
|
+
declare const counterVariants: (props?: ({
|
|
24
|
+
theme?: "light" | "dark" | null | undefined;
|
|
25
|
+
hasIcon?: boolean | null | undefined;
|
|
26
|
+
} & cva_types.ClassProp) | undefined) => string;
|
|
27
|
+
|
|
28
|
+
export { Counter };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as cva_types from 'cva/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { InputHTMLAttributes } from 'react';
|
|
4
|
+
import { VariantProps } from 'cva';
|
|
5
|
+
|
|
6
|
+
type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>;
|
|
7
|
+
type CounterVariants = VariantProps<typeof counterVariants>;
|
|
8
|
+
declare const Counter: React.ForwardRefExoticComponent<InputProps & CounterVariants & {
|
|
9
|
+
label?: string;
|
|
10
|
+
value?: number;
|
|
11
|
+
error?: string;
|
|
12
|
+
min?: number;
|
|
13
|
+
max?: number;
|
|
14
|
+
step?: number;
|
|
15
|
+
description?: string;
|
|
16
|
+
classNames?: {
|
|
17
|
+
root?: string;
|
|
18
|
+
input?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
};
|
|
21
|
+
onChange?: (n: number) => void;
|
|
22
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
23
|
+
declare const counterVariants: (props?: ({
|
|
24
|
+
theme?: "light" | "dark" | null | undefined;
|
|
25
|
+
hasIcon?: boolean | null | undefined;
|
|
26
|
+
} & cva_types.ClassProp) | undefined) => string;
|
|
27
|
+
|
|
28
|
+
export { Counter };
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// src/components/ui/Counter.tsx
|
|
4
|
+
import { cva } from "cva";
|
|
5
|
+
import { Minus, Plus } from "lucide-react";
|
|
6
|
+
import { forwardRef as forwardRef2, useEffect, useState } from "react";
|
|
7
|
+
|
|
8
|
+
// src/lib/utils.ts
|
|
9
|
+
import { clsx } from "clsx";
|
|
10
|
+
import { twMerge } from "tailwind-merge";
|
|
11
|
+
function cn(...inputs) {
|
|
12
|
+
return twMerge(clsx(inputs));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// src/components/ui/ErrorMessage.tsx
|
|
16
|
+
import { jsx } from "react/jsx-runtime";
|
|
17
|
+
function ErrorMessage({ message, className, ...props }) {
|
|
18
|
+
if (!message) return null;
|
|
19
|
+
return /* @__PURE__ */ jsx("p", { className: cn("px-1 text-xs text-red-600", className), ...props, children: message });
|
|
20
|
+
}
|
|
21
|
+
var ErrorMessage_default = ErrorMessage;
|
|
22
|
+
|
|
23
|
+
// src/components/primitives/tooltip.tsx
|
|
24
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
25
|
+
import * as React from "react";
|
|
26
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
27
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
28
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
29
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
30
|
+
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
31
|
+
TooltipPrimitive.Content,
|
|
32
|
+
{
|
|
33
|
+
ref,
|
|
34
|
+
sideOffset,
|
|
35
|
+
className: cn(
|
|
36
|
+
"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",
|
|
37
|
+
className
|
|
38
|
+
),
|
|
39
|
+
...props
|
|
40
|
+
}
|
|
41
|
+
));
|
|
42
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
43
|
+
|
|
44
|
+
// src/components/ui/Label.tsx
|
|
45
|
+
import { InfoIcon } from "lucide-react";
|
|
46
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
47
|
+
function Label({ text, required, description, className, ...props }) {
|
|
48
|
+
if (!text) return null;
|
|
49
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-row gap-1", children: [
|
|
50
|
+
/* @__PURE__ */ jsxs(
|
|
51
|
+
"label",
|
|
52
|
+
{
|
|
53
|
+
className: cn(
|
|
54
|
+
"text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
55
|
+
className
|
|
56
|
+
),
|
|
57
|
+
...props,
|
|
58
|
+
children: [
|
|
59
|
+
text,
|
|
60
|
+
required && /* @__PURE__ */ jsx3("span", { className: "text-red-600", children: "\xA0*" })
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
!!description && /* @__PURE__ */ jsx3(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
65
|
+
/* @__PURE__ */ jsx3(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx3(InfoIcon, { className: "h-4 w-4" }) }),
|
|
66
|
+
/* @__PURE__ */ jsx3(TooltipContent, { className: "max-w-48", children: description })
|
|
67
|
+
] }) })
|
|
68
|
+
] });
|
|
69
|
+
}
|
|
70
|
+
var Label_default = Label;
|
|
71
|
+
|
|
72
|
+
// src/components/ui/Counter.tsx
|
|
73
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
74
|
+
var Counter = forwardRef2(
|
|
75
|
+
({ label, error, min, max, step = 1, description, theme, value, classNames, onChange, ...props }, ref) => {
|
|
76
|
+
const [count, setCount] = useState(0);
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
setCount(value ?? 0);
|
|
79
|
+
}, [value]);
|
|
80
|
+
const handleChange = (e) => {
|
|
81
|
+
const newValue = parseInt(e.target.value.replace(/\D/g, ""), 10);
|
|
82
|
+
if (isNaN(newValue)) return;
|
|
83
|
+
if (min && newValue < min) {
|
|
84
|
+
onChange?.(min);
|
|
85
|
+
setCount(min);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (max && newValue > max) {
|
|
89
|
+
onChange?.(max);
|
|
90
|
+
setCount(max);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
onChange?.(newValue);
|
|
94
|
+
setCount(newValue);
|
|
95
|
+
};
|
|
96
|
+
const decrement = () => {
|
|
97
|
+
const proposedValue = count - step;
|
|
98
|
+
const newValue = Math.max(min ?? -Infinity, proposedValue);
|
|
99
|
+
onChange?.(newValue);
|
|
100
|
+
setCount(newValue);
|
|
101
|
+
};
|
|
102
|
+
const increment = () => {
|
|
103
|
+
const proposedValue = count + step;
|
|
104
|
+
const newValue = Math.min(max ?? Infinity, proposedValue);
|
|
105
|
+
onChange?.(newValue);
|
|
106
|
+
setCount(newValue);
|
|
107
|
+
};
|
|
108
|
+
return /* @__PURE__ */ jsxs2(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
className: cn("flex w-auto flex-col gap-1", classNames?.root),
|
|
112
|
+
"data-testid": `counter-wrapper-${props.id}`,
|
|
113
|
+
children: [
|
|
114
|
+
label && /* @__PURE__ */ jsx4(
|
|
115
|
+
Label_default,
|
|
116
|
+
{
|
|
117
|
+
text: label,
|
|
118
|
+
htmlFor: props.name,
|
|
119
|
+
required: props.required,
|
|
120
|
+
description,
|
|
121
|
+
className: classNames?.label
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ jsxs2("div", { className: "relative flex w-[122px] flex-row items-center", children: [
|
|
125
|
+
/* @__PURE__ */ jsx4(
|
|
126
|
+
"button",
|
|
127
|
+
{
|
|
128
|
+
type: "button",
|
|
129
|
+
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",
|
|
130
|
+
onClick: decrement,
|
|
131
|
+
children: /* @__PURE__ */ jsx4(Minus, { className: "h-4 w-4 text-green-100" })
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ jsx4(
|
|
135
|
+
"input",
|
|
136
|
+
{
|
|
137
|
+
className: cn(counterVariants({ theme }), classNames?.input),
|
|
138
|
+
ref,
|
|
139
|
+
value: count,
|
|
140
|
+
onChange: handleChange,
|
|
141
|
+
"data-testid": `counter-element-${props.id}`,
|
|
142
|
+
...props
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
/* @__PURE__ */ jsx4(
|
|
146
|
+
"button",
|
|
147
|
+
{
|
|
148
|
+
type: "button",
|
|
149
|
+
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",
|
|
150
|
+
onClick: increment,
|
|
151
|
+
children: /* @__PURE__ */ jsx4(Plus, { className: "h-4 w-4 text-green-100" })
|
|
152
|
+
}
|
|
153
|
+
)
|
|
154
|
+
] }),
|
|
155
|
+
/* @__PURE__ */ jsx4(ErrorMessage_default, { message: error })
|
|
156
|
+
]
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
);
|
|
161
|
+
Counter.displayName = "Counter";
|
|
162
|
+
var counterVariants = cva(
|
|
163
|
+
[
|
|
164
|
+
"border-input",
|
|
165
|
+
"placeholder:text-muted-foreground",
|
|
166
|
+
"focus-visible:ring-ring",
|
|
167
|
+
"inline-flex",
|
|
168
|
+
"w-[122px]",
|
|
169
|
+
"h-11",
|
|
170
|
+
"items-center",
|
|
171
|
+
"justify-start",
|
|
172
|
+
"gap-3",
|
|
173
|
+
"rounded-lg",
|
|
174
|
+
"bg-transparent",
|
|
175
|
+
"px-3",
|
|
176
|
+
"pt-0.5",
|
|
177
|
+
"text-sm",
|
|
178
|
+
"text-center",
|
|
179
|
+
"shadow-sm",
|
|
180
|
+
"ring-grey-50",
|
|
181
|
+
"transition-colors",
|
|
182
|
+
"focus-visible:outline-none",
|
|
183
|
+
"focus-visible:ring-1",
|
|
184
|
+
"disabled:cursor-not-allowed",
|
|
185
|
+
"disabled:opacity-50",
|
|
186
|
+
"appearance-none",
|
|
187
|
+
"[&::-webkit-search-cancel-button]:appearance-none",
|
|
188
|
+
"[&::-webkit-search-decoration]:appearance-none",
|
|
189
|
+
"[&::-webkit-search-results-button]:appearance-none",
|
|
190
|
+
"[&::-webkit-search-results-decoration]:appearance-none",
|
|
191
|
+
"[&::-ms-clear]:display-none",
|
|
192
|
+
"[&::-ms-reveal]:display-none"
|
|
193
|
+
],
|
|
194
|
+
{
|
|
195
|
+
variants: {
|
|
196
|
+
theme: {
|
|
197
|
+
light: "text-grey-80 border",
|
|
198
|
+
dark: "text-white"
|
|
199
|
+
},
|
|
200
|
+
hasIcon: {
|
|
201
|
+
false: "pl-3",
|
|
202
|
+
true: "pl-8"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
defaultVariants: {
|
|
206
|
+
theme: "light",
|
|
207
|
+
hasIcon: false
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
export {
|
|
212
|
+
Counter
|
|
213
|
+
};
|
|
214
|
+
//# sourceMappingURL=Counter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Counter.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/primitives/tooltip.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["'use client'\n\nimport { cva, type VariantProps } from 'cva'\nimport { Minus, Plus } from 'lucide-react'\nimport { ChangeEvent, forwardRef, useEffect, useState, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ntype InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'>\ntype CounterVariants = VariantProps<typeof counterVariants>\ntype Props = InputProps &\n CounterVariants & {\n label?: string\n value?: number\n error?: string\n min?: number\n max?: number\n step?: number\n description?: string\n classNames?: { root?: string; input?: string; label?: string }\n onChange?: (n: number) => void\n }\n\nexport const Counter = forwardRef<HTMLInputElement, Props>(\n (\n { label, error, min, max, step = 1, description, theme, value, classNames, onChange, ...props },\n ref\n ) => {\n const [count, setCount] = useState(0)\n\n useEffect(() => {\n setCount(value ?? 0)\n }, [value])\n\n const handleChange = (e: ChangeEvent<HTMLInputElement>) => {\n const newValue = parseInt(e.target.value.replace(/\\D/g, ''), 10)\n if (isNaN(newValue)) return\n if (min && newValue < min) {\n onChange?.(min)\n setCount(min)\n return\n }\n if (max && newValue > max) {\n onChange?.(max)\n setCount(max)\n return\n }\n onChange?.(newValue)\n setCount(newValue)\n }\n\n const decrement = () => {\n const proposedValue = count - step\n const newValue = Math.max(min ?? -Infinity, proposedValue)\n onChange?.(newValue)\n setCount(newValue)\n }\n\n const increment = () => {\n const proposedValue = count + step\n const newValue = Math.min(max ?? Infinity, proposedValue)\n onChange?.(newValue)\n setCount(newValue)\n }\n\n return (\n <div\n className={cn('flex w-auto flex-col gap-1', classNames?.root)}\n data-testid={`counter-wrapper-${props.id}`}\n >\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n className={classNames?.label}\n />\n )}\n\n <div className=\"relative flex w-[122px] flex-row items-center\">\n <button\n type=\"button\"\n 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\"\n onClick={decrement}\n >\n <Minus className=\"h-4 w-4 text-green-100\" />\n </button>\n\n <input\n className={cn(counterVariants({ theme }), classNames?.input)}\n ref={ref}\n value={count}\n onChange={handleChange}\n data-testid={`counter-element-${props.id}`}\n {...props}\n />\n\n <button\n type=\"button\"\n 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\"\n onClick={increment}\n >\n <Plus className=\"h-4 w-4 text-green-100\" />\n </button>\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nCounter.displayName = 'Counter'\n\nconst counterVariants = cva(\n [\n 'border-input',\n 'placeholder:text-muted-foreground',\n 'focus-visible:ring-ring',\n 'inline-flex',\n 'w-[122px]',\n 'h-11',\n 'items-center',\n 'justify-start',\n 'gap-3',\n 'rounded-lg',\n 'bg-transparent',\n 'px-3',\n 'pt-0.5',\n 'text-sm',\n 'text-center',\n 'shadow-sm',\n 'ring-grey-50',\n 'transition-colors',\n 'focus-visible:outline-none',\n 'focus-visible:ring-1',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'appearance-none',\n '[&::-webkit-search-cancel-button]:appearance-none',\n '[&::-webkit-search-decoration]:appearance-none',\n '[&::-webkit-search-results-button]:appearance-none',\n '[&::-webkit-search-results-decoration]:appearance-none',\n '[&::-ms-clear]:display-none',\n '[&::-ms-reveal]:display-none',\n ],\n {\n variants: {\n theme: {\n light: 'text-grey-80 border',\n dark: 'text-white',\n },\n hasIcon: {\n false: 'pl-3',\n true: 'pl-8',\n },\n },\n defaultVariants: {\n theme: 'light',\n hasIcon: false,\n },\n }\n)\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n","'use client'\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n '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',\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { InfoIcon } from 'lucide-react'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n description?: string\n}\n\nfunction Label({ text, required, description, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <div className=\"flex w-full flex-row gap-1\">\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n {required && <span className=\"text-red-600\"> *</span>}\n </label>\n\n {!!description && (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <InfoIcon className=\"h-4 w-4\" />\n </TooltipTrigger>\n <TooltipContent className=\"max-w-48\">{description}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n )\n}\n\nexport default Label\n"],"mappings":";;;AAEA,SAAS,WAA8B;AACvC,SAAS,OAAO,YAAY;AAC5B,SAAsB,cAAAA,aAAY,WAAW,gBAA0C;;;ACJvF,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ACOI;AAJJ,SAAS,aAAa,EAAE,SAAS,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,QAAS,QAAO;AAErB,SACE,oBAAC,OAAE,WAAW,GAAG,6BAA6B,SAAS,GAAI,GAAG,OAC3D,mBACH;AAEJ;AAEA,IAAO,uBAAQ;;;AChBf,YAAY,sBAAsB;AAClC,YAAY,WAAW;AAcrB,gBAAAC,YAAA;AAVF,IAAM,kBAAmC;AAEzC,IAAM,UAA2B;AAEjC,IAAM,iBAAkC;AAExC,IAAM,iBAAuB,iBAG3B,CAAC,EAAE,WAAW,aAAa,GAAG,GAAG,MAAM,GAAG,QAC1C,gBAAAA;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B,yBAAQ;;;AClBtD,SAAS,gBAAgB;AAanB,SAQe,OAAAC,MARf;AALN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AAA;AAAA,IAChC;AAAA,EAEJ;AACF;AACA,QAAQ,cAAc;AAEtB,IAAM,kBAAkB;AAAA,EACtB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AACF;","names":["forwardRef","jsx","jsx","jsx","jsxs","forwardRef"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/components/ui/Input.tsx
|
|
@@ -24,7 +34,7 @@ __export(Input_exports, {
|
|
|
24
34
|
});
|
|
25
35
|
module.exports = __toCommonJS(Input_exports);
|
|
26
36
|
var import_cva = require("cva");
|
|
27
|
-
var
|
|
37
|
+
var import_lucide_react2 = require("lucide-react");
|
|
28
38
|
var import_react = require("react");
|
|
29
39
|
|
|
30
40
|
// src/lib/utils.ts
|
|
@@ -42,57 +52,86 @@ function ErrorMessage({ message, className, ...props }) {
|
|
|
42
52
|
}
|
|
43
53
|
var ErrorMessage_default = ErrorMessage;
|
|
44
54
|
|
|
45
|
-
// src/components/
|
|
55
|
+
// src/components/primitives/tooltip.tsx
|
|
56
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
57
|
+
var React = __toESM(require("react"), 1);
|
|
46
58
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
47
|
-
|
|
59
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
60
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
61
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
62
|
+
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
63
|
+
TooltipPrimitive.Content,
|
|
64
|
+
{
|
|
65
|
+
ref,
|
|
66
|
+
sideOffset,
|
|
67
|
+
className: cn(
|
|
68
|
+
"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",
|
|
69
|
+
className
|
|
70
|
+
),
|
|
71
|
+
...props
|
|
72
|
+
}
|
|
73
|
+
));
|
|
74
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
75
|
+
|
|
76
|
+
// src/components/ui/Label.tsx
|
|
77
|
+
var import_lucide_react = require("lucide-react");
|
|
78
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
79
|
+
function Label({ text, required, description, className, ...props }) {
|
|
48
80
|
if (!text) return null;
|
|
49
|
-
return /* @__PURE__ */ (0,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex w-full flex-row gap-1", children: [
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
83
|
+
"label",
|
|
84
|
+
{
|
|
85
|
+
className: cn(
|
|
86
|
+
"text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
87
|
+
className
|
|
88
|
+
),
|
|
89
|
+
...props,
|
|
90
|
+
children: [
|
|
91
|
+
text,
|
|
92
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-red-600", children: "\xA0*" })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Tooltip, { children: [
|
|
97
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.InfoIcon, { className: "h-4 w-4" }) }),
|
|
98
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipContent, { className: "max-w-48", children: description })
|
|
99
|
+
] }) })
|
|
100
|
+
] });
|
|
63
101
|
}
|
|
64
102
|
var Label_default = Label;
|
|
65
103
|
|
|
66
104
|
// src/components/ui/Input.tsx
|
|
67
|
-
var
|
|
105
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
68
106
|
var Input = (0, import_react.forwardRef)(
|
|
69
|
-
({ label, error, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
107
|
+
({ label, error, description, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
70
108
|
const handleClear = () => {
|
|
71
109
|
onChange?.({ target: { value: "" } });
|
|
72
110
|
onClear?.();
|
|
73
111
|
};
|
|
74
|
-
const IconComponent = icon &&
|
|
112
|
+
const IconComponent = icon && import_lucide_react2.icons[icon];
|
|
75
113
|
const placeholder = props.placeholder ?? (icon === "Search" ? "Search..." : "");
|
|
76
114
|
const hasIcon = !!icon;
|
|
77
115
|
const iconColor = theme === "dark" ? "text-white" : "text-grey-80";
|
|
78
|
-
return /* @__PURE__ */ (0,
|
|
79
|
-
label && /* @__PURE__ */ (0,
|
|
116
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "group flex w-full flex-col gap-1", "data-testid": `input-wrapper-${props.id}`, children: [
|
|
117
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
80
118
|
Label_default,
|
|
81
119
|
{
|
|
82
120
|
text: label,
|
|
83
121
|
htmlFor: props.name,
|
|
84
122
|
required: props.required,
|
|
123
|
+
description,
|
|
85
124
|
className: classNames?.label
|
|
86
125
|
}
|
|
87
126
|
),
|
|
88
|
-
/* @__PURE__ */ (0,
|
|
89
|
-
IconComponent && /* @__PURE__ */ (0,
|
|
127
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "relative flex flex-row items-center", children: [
|
|
128
|
+
IconComponent && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
90
129
|
IconComponent,
|
|
91
130
|
{
|
|
92
131
|
className: `absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`
|
|
93
132
|
}
|
|
94
133
|
),
|
|
95
|
-
/* @__PURE__ */ (0,
|
|
134
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
96
135
|
"input",
|
|
97
136
|
{
|
|
98
137
|
className: cn(inputVariants({ theme, hasIcon })),
|
|
@@ -104,8 +143,8 @@ var Input = (0, import_react.forwardRef)(
|
|
|
104
143
|
...props
|
|
105
144
|
}
|
|
106
145
|
),
|
|
107
|
-
hasIcon && value && /* @__PURE__ */ (0,
|
|
108
|
-
|
|
146
|
+
hasIcon && value && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
147
|
+
import_lucide_react2.X,
|
|
109
148
|
{
|
|
110
149
|
className: `absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`,
|
|
111
150
|
onClick: handleClear,
|
|
@@ -113,7 +152,7 @@ var Input = (0, import_react.forwardRef)(
|
|
|
113
152
|
}
|
|
114
153
|
)
|
|
115
154
|
] }),
|
|
116
|
-
/* @__PURE__ */ (0,
|
|
155
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ErrorMessage_default, { message: error })
|
|
117
156
|
] });
|
|
118
157
|
}
|
|
119
158
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/ui/Input.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'cva'\nimport { icons, X } from 'lucide-react'\nimport { type ChangeEvent, forwardRef, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {\n label?: string\n error?: string\n icon?: keyof typeof icons\n
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/Input.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/primitives/tooltip.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'cva'\nimport { icons, X } from 'lucide-react'\nimport { type ChangeEvent, forwardRef, type InputHTMLAttributes } from 'react'\n\nimport ErrorMessage from '@/components/ui/ErrorMessage'\nimport Label from '@/components/ui/Label'\nimport { cn } from '@/lib/utils'\n\ninterface Props extends InputHTMLAttributes<HTMLInputElement>, VariantProps<typeof inputVariants> {\n label?: string\n error?: string\n icon?: keyof typeof icons\n description?: string\n classNames?: { label?: string }\n onClear?: () => void\n}\n\nconst Input = forwardRef<HTMLInputElement, Props>(\n (\n { label, error, description, theme, icon, onClear, value, onChange, classNames, ...props },\n ref\n ) => {\n const handleClear = () => {\n onChange?.({ target: { value: '' } } as ChangeEvent<HTMLInputElement>)\n onClear?.()\n }\n\n const IconComponent = icon && icons[icon]\n\n const placeholder = props.placeholder ?? (icon === 'Search' ? 'Search...' : '')\n const hasIcon = !!icon\n\n const iconColor = theme === 'dark' ? 'text-white' : 'text-grey-80'\n\n return (\n <div className=\"group flex w-full flex-col gap-1\" data-testid={`input-wrapper-${props.id}`}>\n {label && (\n <Label\n text={label}\n htmlFor={props.name}\n required={props.required}\n description={description}\n className={classNames?.label}\n />\n )}\n <div className=\"relative flex flex-row items-center\">\n {IconComponent && (\n <IconComponent\n className={`absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`}\n />\n )}\n <input\n className={cn(inputVariants({ theme, hasIcon }))}\n ref={ref}\n placeholder={placeholder}\n value={value}\n onChange={onChange}\n data-testid={`input-element-${props.id}`}\n {...props}\n />\n {hasIcon && value && (\n <X\n className={`absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`}\n onClick={handleClear}\n data-testid=\"clear-button\"\n />\n )}\n </div>\n\n <ErrorMessage message={error} />\n </div>\n )\n }\n)\nInput.displayName = 'Input'\n\nconst inputVariants = cva(\n [\n 'border-input',\n 'placeholder:text-muted-foreground',\n 'focus-visible:ring-ring',\n 'inline-flex',\n 'w-full',\n 'h-11',\n 'items-center',\n 'justify-start',\n 'gap-3',\n 'rounded-lg',\n 'bg-transparent',\n 'px-3',\n 'pt-0.5',\n 'text-sm',\n 'shadow-sm',\n 'ring-grey-50',\n 'transition-colors',\n 'focus-visible:outline-none',\n 'focus-visible:ring-1',\n 'disabled:cursor-not-allowed',\n 'disabled:opacity-50',\n 'appearance-none',\n '[&::-webkit-search-cancel-button]:appearance-none',\n '[&::-webkit-search-decoration]:appearance-none',\n '[&::-webkit-search-results-button]:appearance-none',\n '[&::-webkit-search-results-decoration]:appearance-none',\n '[&::-ms-clear]:display-none',\n '[&::-ms-reveal]:display-none',\n ],\n {\n variants: {\n theme: {\n light: 'text-grey-80 border',\n dark: 'text-white',\n },\n hasIcon: {\n false: 'pl-3',\n true: 'pl-8',\n },\n },\n defaultVariants: {\n theme: 'light',\n hasIcon: false,\n },\n }\n)\n\nexport default Input\n","import { type ClassValue, clsx } from 'clsx'\nimport { twMerge } from 'tailwind-merge'\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'p'> {\n message?: string\n}\n\nfunction ErrorMessage({ message, className, ...props }: Readonly<Props>) {\n if (!message) return null\n\n return (\n <p className={cn('px-1 text-xs text-red-600', className)} {...props}>\n {message}\n </p>\n )\n}\n\nexport default ErrorMessage\n","'use client'\n\nimport * as TooltipPrimitive from '@radix-ui/react-tooltip'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst TooltipProvider = TooltipPrimitive.Provider\n\nconst Tooltip = TooltipPrimitive.Root\n\nconst TooltipTrigger = TooltipPrimitive.Trigger\n\nconst TooltipContent = React.forwardRef<\n React.ElementRef<typeof TooltipPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <TooltipPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n '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',\n className\n )}\n {...props}\n />\n))\nTooltipContent.displayName = TooltipPrimitive.Content.displayName\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }\n","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from '@/components/primitives/tooltip'\nimport { InfoIcon } from 'lucide-react'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n description?: string\n}\n\nfunction Label({ text, required, description, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\n <div className=\"flex w-full flex-row gap-1\">\n <label\n className={cn(\n 'text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70',\n className\n )}\n {...props}\n >\n {text}\n {required && <span className=\"text-red-600\"> *</span>}\n </label>\n\n {!!description && (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild>\n <InfoIcon className=\"h-4 w-4\" />\n </TooltipTrigger>\n <TooltipContent className=\"max-w-48\">{description}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n )}\n </div>\n )\n}\n\nexport default Label\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAuC;AACvC,IAAAA,uBAAyB;AACzB,mBAAuE;;;ACFvE,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ACOI;AAJJ,SAAS,aAAa,EAAE,SAAS,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,QAAS,QAAO;AAErB,SACE,4CAAC,OAAE,WAAW,GAAG,6BAA6B,SAAS,GAAI,GAAG,OAC3D,mBACH;AAEJ;AAEA,IAAO,uBAAQ;;;AChBf,uBAAkC;AAClC,YAAuB;AAcrB,IAAAC,sBAAA;AAVF,IAAM,kBAAmC;AAEzC,IAAM,UAA2B;AAEjC,IAAM,iBAAkC;AAExC,IAAM,iBAAuB,iBAG3B,CAAC,EAAE,WAAW,aAAa,GAAG,GAAG,MAAM,GAAG,QAC1C;AAAA,EAAkB;AAAA,EAAjB;AAAA,IACC;AAAA,IACA;AAAA,IACA,WAAW;AAAA,MACT;AAAA,MACA;AAAA,IACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,eAAe,cAA+B,yBAAQ;;;AClBtD,0BAAyB;AAanB,IAAAC,sBAAA;AALN,SAAS,MAAM,EAAE,MAAM,UAAU,aAAa,WAAW,GAAG,MAAM,GAAoB;AACpF,MAAI,CAAC,KAAM,QAAO;AAElB,SACE,8CAAC,SAAI,WAAU,8BACb;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QA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GAAG;AAAA;AAAA,QACN;AAAA,QACC,WAAW,SACV;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,2CAA2C,SAAS;AAAA,YAC/D,SAAS;AAAA,YACT,eAAY;AAAA;AAAA,QACd;AAAA,SAEJ;AAAA,MAEA,6CAAC,wBAAa,SAAS,OAAO;AAAA,OAChC;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;AAEpB,IAAM,oBAAgB;AAAA,EACpB;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,MACA,SAAS;AAAA,QACP,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,OAAO;AAAA,MACP,SAAS;AAAA,IACX;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;","names":["import_lucide_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -8,10 +8,11 @@ interface Props extends InputHTMLAttributes<HTMLInputElement>, VariantProps<type
|
|
|
8
8
|
label?: string;
|
|
9
9
|
error?: string;
|
|
10
10
|
icon?: keyof typeof icons;
|
|
11
|
-
|
|
11
|
+
description?: string;
|
|
12
12
|
classNames?: {
|
|
13
13
|
label?: string;
|
|
14
14
|
};
|
|
15
|
+
onClear?: () => void;
|
|
15
16
|
}
|
|
16
17
|
declare const Input: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
17
18
|
declare const inputVariants: (props?: ({
|
|
@@ -8,10 +8,11 @@ interface Props extends InputHTMLAttributes<HTMLInputElement>, VariantProps<type
|
|
|
8
8
|
label?: string;
|
|
9
9
|
error?: string;
|
|
10
10
|
icon?: keyof typeof icons;
|
|
11
|
-
|
|
11
|
+
description?: string;
|
|
12
12
|
classNames?: {
|
|
13
13
|
label?: string;
|
|
14
14
|
};
|
|
15
|
+
onClear?: () => void;
|
|
15
16
|
}
|
|
16
17
|
declare const Input: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
17
18
|
declare const inputVariants: (props?: ({
|