@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
|
@@ -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/demos/InputDemo.tsx
|
|
@@ -26,7 +36,7 @@ module.exports = __toCommonJS(InputDemo_exports);
|
|
|
26
36
|
|
|
27
37
|
// src/components/ui/Input.tsx
|
|
28
38
|
var import_cva = require("cva");
|
|
29
|
-
var
|
|
39
|
+
var import_lucide_react2 = require("lucide-react");
|
|
30
40
|
var import_react = require("react");
|
|
31
41
|
|
|
32
42
|
// src/lib/utils.ts
|
|
@@ -44,49 +54,86 @@ function ErrorMessage({ message, className, ...props }) {
|
|
|
44
54
|
}
|
|
45
55
|
var ErrorMessage_default = ErrorMessage;
|
|
46
56
|
|
|
47
|
-
// src/components/
|
|
57
|
+
// src/components/primitives/tooltip.tsx
|
|
58
|
+
var TooltipPrimitive = __toESM(require("@radix-ui/react-tooltip"), 1);
|
|
59
|
+
var React = __toESM(require("react"), 1);
|
|
48
60
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
49
|
-
|
|
61
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
62
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
63
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
64
|
+
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
65
|
+
TooltipPrimitive.Content,
|
|
66
|
+
{
|
|
67
|
+
ref,
|
|
68
|
+
sideOffset,
|
|
69
|
+
className: cn(
|
|
70
|
+
"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",
|
|
71
|
+
className
|
|
72
|
+
),
|
|
73
|
+
...props
|
|
74
|
+
}
|
|
75
|
+
));
|
|
76
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
77
|
+
|
|
78
|
+
// src/components/ui/Label.tsx
|
|
79
|
+
var import_lucide_react = require("lucide-react");
|
|
80
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
81
|
+
function Label({ text, required, description, className, ...props }) {
|
|
50
82
|
if (!text) return null;
|
|
51
|
-
return /* @__PURE__ */ (0,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
83
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex w-full flex-row gap-1", children: [
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
85
|
+
"label",
|
|
86
|
+
{
|
|
87
|
+
className: cn(
|
|
88
|
+
"text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
89
|
+
className
|
|
90
|
+
),
|
|
91
|
+
...props,
|
|
92
|
+
children: [
|
|
93
|
+
text,
|
|
94
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-red-600", children: "\xA0*" })
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
!!description && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Tooltip, { children: [
|
|
99
|
+
/* @__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" }) }),
|
|
100
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TooltipContent, { className: "max-w-48", children: description })
|
|
101
|
+
] }) })
|
|
102
|
+
] });
|
|
65
103
|
}
|
|
66
104
|
var Label_default = Label;
|
|
67
105
|
|
|
68
106
|
// src/components/ui/Input.tsx
|
|
69
|
-
var
|
|
107
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
70
108
|
var Input = (0, import_react.forwardRef)(
|
|
71
|
-
({ label, error, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
109
|
+
({ label, error, description, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
72
110
|
const handleClear = () => {
|
|
73
111
|
onChange?.({ target: { value: "" } });
|
|
74
112
|
onClear?.();
|
|
75
113
|
};
|
|
76
|
-
const IconComponent = icon &&
|
|
114
|
+
const IconComponent = icon && import_lucide_react2.icons[icon];
|
|
77
115
|
const placeholder = props.placeholder ?? (icon === "Search" ? "Search..." : "");
|
|
78
116
|
const hasIcon = !!icon;
|
|
79
117
|
const iconColor = theme === "dark" ? "text-white" : "text-grey-80";
|
|
80
|
-
return /* @__PURE__ */ (0,
|
|
81
|
-
label && /* @__PURE__ */ (0,
|
|
82
|
-
|
|
83
|
-
|
|
118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "group flex w-full flex-col gap-1", "data-testid": `input-wrapper-${props.id}`, children: [
|
|
119
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
120
|
+
Label_default,
|
|
121
|
+
{
|
|
122
|
+
text: label,
|
|
123
|
+
htmlFor: props.name,
|
|
124
|
+
required: props.required,
|
|
125
|
+
description,
|
|
126
|
+
className: classNames?.label
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "relative flex flex-row items-center", children: [
|
|
130
|
+
IconComponent && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
84
131
|
IconComponent,
|
|
85
132
|
{
|
|
86
133
|
className: `absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`
|
|
87
134
|
}
|
|
88
135
|
),
|
|
89
|
-
/* @__PURE__ */ (0,
|
|
136
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
90
137
|
"input",
|
|
91
138
|
{
|
|
92
139
|
className: cn(inputVariants({ theme, hasIcon })),
|
|
@@ -98,8 +145,8 @@ var Input = (0, import_react.forwardRef)(
|
|
|
98
145
|
...props
|
|
99
146
|
}
|
|
100
147
|
),
|
|
101
|
-
hasIcon && value && /* @__PURE__ */ (0,
|
|
102
|
-
|
|
148
|
+
hasIcon && value && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
149
|
+
import_lucide_react2.X,
|
|
103
150
|
{
|
|
104
151
|
className: `absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`,
|
|
105
152
|
onClick: handleClear,
|
|
@@ -107,7 +154,7 @@ var Input = (0, import_react.forwardRef)(
|
|
|
107
154
|
}
|
|
108
155
|
)
|
|
109
156
|
] }),
|
|
110
|
-
/* @__PURE__ */ (0,
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ErrorMessage_default, { message: error })
|
|
111
158
|
] });
|
|
112
159
|
}
|
|
113
160
|
);
|
|
@@ -163,14 +210,14 @@ var inputVariants = (0, import_cva.cva)(
|
|
|
163
210
|
var Input_default = Input;
|
|
164
211
|
|
|
165
212
|
// src/components/demos/InputDemo.tsx
|
|
166
|
-
var
|
|
213
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
167
214
|
function InputDemo() {
|
|
168
|
-
return /* @__PURE__ */ (0,
|
|
169
|
-
/* @__PURE__ */ (0,
|
|
170
|
-
/* @__PURE__ */ (0,
|
|
171
|
-
/* @__PURE__ */ (0,
|
|
172
|
-
/* @__PURE__ */ (0,
|
|
173
|
-
/* @__PURE__ */ (0,
|
|
215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "m-4", children: [
|
|
216
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h3", { children: "Input" }),
|
|
217
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "flex flex-col gap-2 md:flex-row", children: [
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "bg-green-80 p-2", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Input_default, { theme: "dark", icon: "Search" }) }),
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Input_default, { label: "Required input", required: true, description: "This is a tooltip" }) }),
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "p-2", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Input_default, { icon: "MapPin" }) })
|
|
174
221
|
] })
|
|
175
222
|
] });
|
|
176
223
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/demos/InputDemo.tsx","../../../src/components/ui/Input.tsx","../../../src/lib/utils.ts","../../../src/components/ui/ErrorMessage.tsx","../../../src/components/ui/Label.tsx"],"sourcesContent":["import Input from '@/components/ui/Input'\n\nfunction InputDemo() {\n return (\n <div className='m-4'>\n <h3>Input</h3>\n <div className=\"flex flex-col gap-2 md:flex-row\">\n <div className=\"bg-green-80 p-2\">\n <Input theme=\"dark\" icon=\"Search\" />\n </div>\n <div className=\"p-2\">\n <Input />\n </div>\n <div className=\"p-2\">\n <Input icon=\"MapPin\" />\n </div>\n </div>\n </div>\n )\n}\n\nexport default InputDemo\n","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 onClear?: () => void\n classNames?: { label?: string }\n}\n\nconst Input = forwardRef<HTMLInputElement, Props>(\n ({ label, error, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {\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\" data-testid={`input-wrapper-${props.id}`}>\n {label && (\n <Label text={label} htmlFor={props.name} className={cn('body mb-1', classNames?.label)} />\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} className=\"mt-1\" />\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","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n}\n\nfunction Label({ text, required, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\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}\n\nexport default Label\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,iBAAuC;AACvC,0BAAyB;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;;;ACLX,IAAAA,sBAAA;AAJJ,SAAS,MAAM,EAAE,MAAM,UAAU,WAAW,GAAG,MAAM,GAAoB;AACvE,MAAI,CAAC,KAAM,QAAO;AAElB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,YAAY,6CAAC,UAAK,WAAU,gBAAe,mBAAO;AAAA;AAAA;AAAA,EACrD;AAEJ;AAEA,IAAO,gBAAQ;;;AHOL,IAAAC,sBAAA;AAjBV,IAAM,YAAQ;AAAA,EACZ,CAAC,EAAE,OAAO,OAAO,OAAO,MAAM,SAAS,OAAO,UAAU,YAAY,GAAG,MAAM,GAAG,QAAQ;AACtF,UAAM,cAAc,MAAM;AACxB,iBAAW,EAAE,QAAQ,EAAE,OAAO,GAAG,EAAE,CAAkC;AACrE,gBAAU;AAA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AAA,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;;;AD9GT,IAAAC,sBAAA;AAHN,SAAS,YAAY;AACnB,SACE,8CAAC,SAAI,WAAU,OACb;AAAA,iDAAC,QAAG,mBAAK;AAAA,IACT,8CAAC,SAAI,WAAU,mCACb;AAAA,mDAAC,SAAI,WAAU,mBACb,uDAAC,iBAAM,OAAM,QAAO,MAAK,UAAS,GACpC;AAAA,MACA,6CAAC,SAAI,WAAU,OACb,uDAAC,iBAAM,GACT;AAAA,MACA,6CAAC,SAAI,WAAU,OACb,uDAAC,iBAAM,MAAK,UAAS,GACvB;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,IAAO,oBAAQ;","names":["import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/demos/InputDemo.tsx","../../../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 Input from '@/components/ui/Input'\n\nfunction InputDemo() {\n return (\n <div className=\"m-4\">\n <h3>Input</h3>\n <div className=\"flex flex-col gap-2 md:flex-row\">\n <div className=\"bg-green-80 p-2\">\n <Input theme=\"dark\" icon=\"Search\" />\n </div>\n <div className=\"p-2\">\n <Input label=\"Required input\" required description=\"This is a tooltip\" />\n </div>\n <div className=\"p-2\">\n <Input icon=\"MapPin\" />\n </div>\n </div>\n </div>\n )\n}\n\nexport default InputDemo\n","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;;;ACAA,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,GAA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ACA;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;;;ADxHT,IAAAC,sBAAA;AAHN,SAAS,YAAY;AACnB,SACE,8CAAC,SAAI,WAAU,OACb;AAAA,iDAAC,QAAG,mBAAK;AAAA,IACT,8CAAC,SAAI,WAAU,mCACb;AAAA,mDAAC,SAAI,WAAU,mBACb,uDAAC,iBAAM,OAAM,QAAO,MAAK,UAAS,GACpC;AAAA,MACA,6CAAC,SAAI,WAAU,OACb,uDAAC,iBAAM,OAAM,kBAAiB,UAAQ,MAAC,aAAY,qBAAoB,GACzE;AAAA,MACA,6CAAC,SAAI,WAAU,OACb,uDAAC,iBAAM,MAAK,UAAS,GACvB;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,IAAO,oBAAQ;","names":["import_lucide_react","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime","import_jsx_runtime"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/components/ui/Input.tsx
|
|
2
2
|
import { cva } from "cva";
|
|
3
3
|
import { icons, X } from "lucide-react";
|
|
4
|
-
import { forwardRef } from "react";
|
|
4
|
+
import { forwardRef as forwardRef2 } from "react";
|
|
5
5
|
|
|
6
6
|
// src/lib/utils.ts
|
|
7
7
|
import { clsx } from "clsx";
|
|
@@ -18,31 +18,59 @@ function ErrorMessage({ message, className, ...props }) {
|
|
|
18
18
|
}
|
|
19
19
|
var ErrorMessage_default = ErrorMessage;
|
|
20
20
|
|
|
21
|
+
// src/components/primitives/tooltip.tsx
|
|
22
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
23
|
+
import * as React from "react";
|
|
24
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
25
|
+
var TooltipProvider = TooltipPrimitive.Provider;
|
|
26
|
+
var Tooltip = TooltipPrimitive.Root;
|
|
27
|
+
var TooltipTrigger = TooltipPrimitive.Trigger;
|
|
28
|
+
var TooltipContent = React.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx2(
|
|
29
|
+
TooltipPrimitive.Content,
|
|
30
|
+
{
|
|
31
|
+
ref,
|
|
32
|
+
sideOffset,
|
|
33
|
+
className: cn(
|
|
34
|
+
"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",
|
|
35
|
+
className
|
|
36
|
+
),
|
|
37
|
+
...props
|
|
38
|
+
}
|
|
39
|
+
));
|
|
40
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
41
|
+
|
|
21
42
|
// src/components/ui/Label.tsx
|
|
22
|
-
import {
|
|
23
|
-
|
|
43
|
+
import { InfoIcon } from "lucide-react";
|
|
44
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
45
|
+
function Label({ text, required, description, className, ...props }) {
|
|
24
46
|
if (!text) return null;
|
|
25
|
-
return /* @__PURE__ */ jsxs(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
47
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex w-full flex-row gap-1", children: [
|
|
48
|
+
/* @__PURE__ */ jsxs(
|
|
49
|
+
"label",
|
|
50
|
+
{
|
|
51
|
+
className: cn(
|
|
52
|
+
"text-xs text-grey-80 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
|
|
53
|
+
className
|
|
54
|
+
),
|
|
55
|
+
...props,
|
|
56
|
+
children: [
|
|
57
|
+
text,
|
|
58
|
+
required && /* @__PURE__ */ jsx3("span", { className: "text-red-600", children: "\xA0*" })
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
!!description && /* @__PURE__ */ jsx3(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
63
|
+
/* @__PURE__ */ jsx3(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx3(InfoIcon, { className: "h-4 w-4" }) }),
|
|
64
|
+
/* @__PURE__ */ jsx3(TooltipContent, { className: "max-w-48", children: description })
|
|
65
|
+
] }) })
|
|
66
|
+
] });
|
|
39
67
|
}
|
|
40
68
|
var Label_default = Label;
|
|
41
69
|
|
|
42
70
|
// src/components/ui/Input.tsx
|
|
43
|
-
import { jsx as
|
|
44
|
-
var Input =
|
|
45
|
-
({ label, error, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
71
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
72
|
+
var Input = forwardRef2(
|
|
73
|
+
({ label, error, description, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {
|
|
46
74
|
const handleClear = () => {
|
|
47
75
|
onChange?.({ target: { value: "" } });
|
|
48
76
|
onClear?.();
|
|
@@ -51,16 +79,25 @@ var Input = forwardRef(
|
|
|
51
79
|
const placeholder = props.placeholder ?? (icon === "Search" ? "Search..." : "");
|
|
52
80
|
const hasIcon = !!icon;
|
|
53
81
|
const iconColor = theme === "dark" ? "text-white" : "text-grey-80";
|
|
54
|
-
return /* @__PURE__ */ jsxs2("div", { className: "group flex w-full flex-col", "data-testid": `input-wrapper-${props.id}`, children: [
|
|
55
|
-
label && /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ jsxs2("div", { className: "group flex w-full flex-col gap-1", "data-testid": `input-wrapper-${props.id}`, children: [
|
|
83
|
+
label && /* @__PURE__ */ jsx4(
|
|
84
|
+
Label_default,
|
|
85
|
+
{
|
|
86
|
+
text: label,
|
|
87
|
+
htmlFor: props.name,
|
|
88
|
+
required: props.required,
|
|
89
|
+
description,
|
|
90
|
+
className: classNames?.label
|
|
91
|
+
}
|
|
92
|
+
),
|
|
56
93
|
/* @__PURE__ */ jsxs2("div", { className: "relative flex flex-row items-center", children: [
|
|
57
|
-
IconComponent && /* @__PURE__ */
|
|
94
|
+
IconComponent && /* @__PURE__ */ jsx4(
|
|
58
95
|
IconComponent,
|
|
59
96
|
{
|
|
60
97
|
className: `absolute left-3 h-4 w-4 ${iconColor} opacity-50 group-hover:opacity-100`
|
|
61
98
|
}
|
|
62
99
|
),
|
|
63
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ jsx4(
|
|
64
101
|
"input",
|
|
65
102
|
{
|
|
66
103
|
className: cn(inputVariants({ theme, hasIcon })),
|
|
@@ -72,7 +109,7 @@ var Input = forwardRef(
|
|
|
72
109
|
...props
|
|
73
110
|
}
|
|
74
111
|
),
|
|
75
|
-
hasIcon && value && /* @__PURE__ */
|
|
112
|
+
hasIcon && value && /* @__PURE__ */ jsx4(
|
|
76
113
|
X,
|
|
77
114
|
{
|
|
78
115
|
className: `absolute right-3 h-4 w-4 cursor-pointer ${iconColor}`,
|
|
@@ -81,7 +118,7 @@ var Input = forwardRef(
|
|
|
81
118
|
}
|
|
82
119
|
)
|
|
83
120
|
] }),
|
|
84
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ jsx4(ErrorMessage_default, { message: error })
|
|
85
122
|
] });
|
|
86
123
|
}
|
|
87
124
|
);
|
|
@@ -137,14 +174,14 @@ var inputVariants = cva(
|
|
|
137
174
|
var Input_default = Input;
|
|
138
175
|
|
|
139
176
|
// src/components/demos/InputDemo.tsx
|
|
140
|
-
import { jsx as
|
|
177
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
141
178
|
function InputDemo() {
|
|
142
179
|
return /* @__PURE__ */ jsxs3("div", { className: "m-4", children: [
|
|
143
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ jsx5("h3", { children: "Input" }),
|
|
144
181
|
/* @__PURE__ */ jsxs3("div", { className: "flex flex-col gap-2 md:flex-row", children: [
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
/* @__PURE__ */
|
|
147
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ jsx5("div", { className: "bg-green-80 p-2", children: /* @__PURE__ */ jsx5(Input_default, { theme: "dark", icon: "Search" }) }),
|
|
183
|
+
/* @__PURE__ */ jsx5("div", { className: "p-2", children: /* @__PURE__ */ jsx5(Input_default, { label: "Required input", required: true, description: "This is a tooltip" }) }),
|
|
184
|
+
/* @__PURE__ */ jsx5("div", { className: "p-2", children: /* @__PURE__ */ jsx5(Input_default, { icon: "MapPin" }) })
|
|
148
185
|
] })
|
|
149
186
|
] });
|
|
150
187
|
}
|
|
@@ -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","../../../src/components/demos/InputDemo.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 onClear?: () => void\n classNames?: { label?: string }\n}\n\nconst Input = forwardRef<HTMLInputElement, Props>(\n ({ label, error, theme, icon, onClear, value, onChange, classNames, ...props }, ref) => {\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\" data-testid={`input-wrapper-${props.id}`}>\n {label && (\n <Label text={label} htmlFor={props.name} className={cn('body mb-1', classNames?.label)} />\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} className=\"mt-1\" />\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","import { type ComponentPropsWithoutRef } from 'react'\n\nimport { cn } from '@/lib/utils'\n\ninterface Props extends ComponentPropsWithoutRef<'label'> {\n text?: string\n required?: boolean\n}\n\nfunction Label({ text, required, className, ...props }: Readonly<Props>) {\n if (!text) return null\n\n return (\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}\n\nexport default Label\n","import Input from '@/components/ui/Input'\n\nfunction InputDemo() {\n return (\n <div className='m-4'>\n <h3>Input</h3>\n <div className=\"flex flex-col gap-2 md:flex-row\">\n <div className=\"bg-green-80 p-2\">\n <Input theme=\"dark\" icon=\"Search\" />\n </div>\n <div className=\"p-2\">\n <Input />\n </div>\n <div className=\"p-2\">\n <Input icon=\"MapPin\" />\n </div>\n </div>\n </div>\n )\n}\n\nexport default InputDemo\n"],"mappings":";AAAA,SAAS,WAA8B;A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,IACX;AAAA,EACF;AACF;AAEA,IAAO,gBAAQ;;;AI9GT,gBAAAE,MACA,QAAAC,aADA;AAHN,SAAS,YAAY;AACnB,SACE,gBAAAA,MAAC,SAAI,WAAU,OACb;AAAA,oBAAAD,KAAC,QAAG,mBAAK;AAAA,IACT,gBAAAC,MAAC,SAAI,WAAU,mCACb;AAAA,sBAAAD,KAAC,SAAI,WAAU,mBACb,0BAAAA,KAAC,iBAAM,OAAM,QAAO,MAAK,UAAS,GACpC;AAAA,MACA,gBAAAA,KAAC,SAAI,WAAU,OACb,0BAAAA,KAAC,iBAAM,GACT;AAAA,MACA,gBAAAA,KAAC,SAAI,WAAU,OACb,0BAAAA,KAAC,iBAAM,MAAK,UAAS,GACvB;AAAA,OACF;AAAA,KACF;AAEJ;AAEA,IAAO,oBAAQ;","names":["jsx","jsx","jsxs","jsx","jsxs"]}
|
|
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","../../../src/components/demos/InputDemo.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","import Input from '@/components/ui/Input'\n\nfunction InputDemo() {\n return (\n <div className=\"m-4\">\n <h3>Input</h3>\n <div className=\"flex flex-col gap-2 md:flex-row\">\n <div className=\"bg-green-80 p-2\">\n <Input theme=\"dark\" icon=\"Search\" />\n </div>\n <div className=\"p-2\">\n <Input label=\"Required input\" required description=\"This is a tooltip\" />\n </div>\n <div className=\"p-2\">\n <Input icon=\"MapPin\" />\n </div>\n </div>\n </div>\n )\n}\n\nexport default InputDemo\n"],"mappings":";AAAA,SAAS,WAA8B;AACvC,SAAS,OAAO,SAAS;AACzB,SAA2B,cAAAA,mBAA4C;;;ACFvE,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;AA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