@zentauri-ui/zentauri-components 0.0.84 → 0.0.91
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/README.md +47 -29
- package/dist/ui/accordion.cjs +311 -0
- package/dist/ui/accordion.cjs.map +1 -0
- package/dist/ui/accordion.d.cts +70 -0
- package/dist/ui/accordion.d.ts +70 -0
- package/dist/ui/accordion.js +286 -0
- package/dist/ui/accordion.js.map +1 -0
- package/dist/ui/alert.cjs +257 -0
- package/dist/ui/alert.cjs.map +1 -0
- package/dist/ui/alert.d.cts +66 -0
- package/dist/ui/alert.d.ts +66 -0
- package/dist/ui/alert.js +224 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/badge.cjs +192 -0
- package/dist/ui/badge.cjs.map +1 -0
- package/dist/ui/badge.d.cts +37 -0
- package/dist/ui/badge.d.ts +37 -0
- package/dist/ui/badge.js +165 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/buttons.cjs +202 -0
- package/dist/ui/buttons.cjs.map +1 -0
- package/dist/ui/buttons.d.cts +27 -0
- package/dist/ui/buttons.d.ts +27 -0
- package/dist/ui/buttons.js +176 -0
- package/dist/ui/buttons.js.map +1 -0
- package/dist/ui/card.cjs +293 -0
- package/dist/ui/card.cjs.map +1 -0
- package/dist/ui/card.d.cts +77 -0
- package/dist/ui/card.d.ts +77 -0
- package/dist/ui/card.js +258 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/divider.cjs +229 -0
- package/dist/ui/divider.cjs.map +1 -0
- package/dist/ui/divider.d.cts +39 -0
- package/dist/ui/divider.d.ts +39 -0
- package/dist/ui/divider.js +200 -0
- package/dist/ui/divider.js.map +1 -0
- package/dist/ui/drawer.cjs +408 -0
- package/dist/ui/drawer.cjs.map +1 -0
- package/dist/ui/drawer.d.cts +81 -0
- package/dist/ui/drawer.d.ts +81 -0
- package/dist/ui/drawer.js +383 -0
- package/dist/ui/drawer.js.map +1 -0
- package/dist/ui/dropdown.cjs +302 -0
- package/dist/ui/dropdown.cjs.map +1 -0
- package/dist/ui/dropdown.d.cts +50 -0
- package/dist/ui/dropdown.d.ts +50 -0
- package/dist/ui/dropdown.js +278 -0
- package/dist/ui/dropdown.js.map +1 -0
- package/dist/ui/empty-state.cjs +186 -0
- package/dist/ui/empty-state.cjs.map +1 -0
- package/dist/ui/empty-state.d.cts +55 -0
- package/dist/ui/empty-state.d.ts +55 -0
- package/dist/ui/empty-state.js +154 -0
- package/dist/ui/empty-state.js.map +1 -0
- package/dist/ui/index.d.cts +27 -1164
- package/dist/ui/index.d.ts +27 -1164
- package/dist/ui/inputs.cjs +458 -0
- package/dist/ui/inputs.cjs.map +1 -0
- package/dist/ui/inputs.d.cts +35 -0
- package/dist/ui/inputs.d.ts +35 -0
- package/dist/ui/inputs.js +432 -0
- package/dist/ui/inputs.js.map +1 -0
- package/dist/ui/modal.cjs +406 -0
- package/dist/ui/modal.cjs.map +1 -0
- package/dist/ui/modal.d.cts +84 -0
- package/dist/ui/modal.d.ts +84 -0
- package/dist/ui/modal.js +384 -0
- package/dist/ui/modal.js.map +1 -0
- package/dist/ui/pagination.cjs +523 -0
- package/dist/ui/pagination.cjs.map +1 -0
- package/dist/ui/pagination.d.cts +114 -0
- package/dist/ui/pagination.d.ts +114 -0
- package/dist/ui/pagination.js +494 -0
- package/dist/ui/pagination.js.map +1 -0
- package/dist/ui/progress.cjs +268 -0
- package/dist/ui/progress.cjs.map +1 -0
- package/dist/ui/progress.d.cts +61 -0
- package/dist/ui/progress.d.ts +61 -0
- package/dist/ui/progress.js +237 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/select.cjs +360 -0
- package/dist/ui/select.cjs.map +1 -0
- package/dist/ui/select.d.cts +73 -0
- package/dist/ui/select.d.ts +73 -0
- package/dist/ui/select.js +327 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui/skeleton.cjs +576 -0
- package/dist/ui/skeleton.cjs.map +1 -0
- package/dist/ui/skeleton.d.cts +90 -0
- package/dist/ui/skeleton.d.ts +90 -0
- package/dist/ui/skeleton.js +544 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/spinner.cjs +219 -0
- package/dist/ui/spinner.cjs.map +1 -0
- package/dist/ui/spinner.d.cts +27 -0
- package/dist/ui/spinner.d.ts +27 -0
- package/dist/ui/spinner.js +193 -0
- package/dist/ui/spinner.js.map +1 -0
- package/dist/ui/table.cjs +328 -0
- package/dist/ui/table.cjs.map +1 -0
- package/dist/ui/table.d.cts +81 -0
- package/dist/ui/table.d.ts +81 -0
- package/dist/ui/table.js +293 -0
- package/dist/ui/table.js.map +1 -0
- package/dist/ui/tabs.cjs +300 -0
- package/dist/ui/tabs.cjs.map +1 -0
- package/dist/ui/tabs.d.cts +58 -0
- package/dist/ui/tabs.d.ts +58 -0
- package/dist/ui/tabs.js +274 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/toast.cjs +285 -0
- package/dist/ui/toast.cjs.map +1 -0
- package/dist/ui/toast.d.cts +86 -0
- package/dist/ui/toast.d.ts +86 -0
- package/dist/ui/toast.js +258 -0
- package/dist/ui/toast.js.map +1 -0
- package/dist/ui/toggle.cjs +185 -0
- package/dist/ui/toggle.cjs.map +1 -0
- package/dist/ui/toggle.d.cts +37 -0
- package/dist/ui/toggle.d.ts +37 -0
- package/dist/ui/toggle.js +158 -0
- package/dist/ui/toggle.js.map +1 -0
- package/dist/ui/tooltip.cjs +242 -0
- package/dist/ui/tooltip.cjs.map +1 -0
- package/dist/ui/tooltip.d.cts +46 -0
- package/dist/ui/tooltip.d.ts +46 -0
- package/dist/ui/tooltip.js +214 -0
- package/dist/ui/tooltip.js.map +1 -0
- package/dist/variants-1Bx3BEeS.d.cts +8 -0
- package/dist/variants-1Bx3BEeS.d.ts +8 -0
- package/package.json +7 -1
|
@@ -0,0 +1,458 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/ui/inputs/index.ts
|
|
21
|
+
var inputs_exports = {};
|
|
22
|
+
__export(inputs_exports, {
|
|
23
|
+
Input: () => Input,
|
|
24
|
+
inputAnimationPresets: () => inputAnimationPresets,
|
|
25
|
+
inputVariants: () => inputVariants
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(inputs_exports);
|
|
28
|
+
|
|
29
|
+
// src/ui/inputs/animations.ts
|
|
30
|
+
var inputAnimationPresets = {
|
|
31
|
+
none: {},
|
|
32
|
+
lift: {
|
|
33
|
+
whileHover: { y: -1 },
|
|
34
|
+
whileFocus: { y: -1 },
|
|
35
|
+
transition: { type: "spring", stiffness: 480, damping: 32 }
|
|
36
|
+
},
|
|
37
|
+
press: {
|
|
38
|
+
whileTap: { scale: 0.99 },
|
|
39
|
+
transition: { type: "spring", stiffness: 520, damping: 30 }
|
|
40
|
+
},
|
|
41
|
+
glow: {
|
|
42
|
+
whileFocus: {
|
|
43
|
+
boxShadow: "0 0 0 1px rgba(255,255,255,0.2), 0 12px 28px rgba(15,23,42,0.35)"
|
|
44
|
+
},
|
|
45
|
+
whileHover: {
|
|
46
|
+
boxShadow: "0 0 0 1px rgba(255,255,255,0.12), 0 8px 20px rgba(15,23,42,0.25)"
|
|
47
|
+
},
|
|
48
|
+
transition: { duration: 0.2, ease: "easeOut" }
|
|
49
|
+
},
|
|
50
|
+
tilt: {
|
|
51
|
+
whileHover: { scale: 1.005 },
|
|
52
|
+
whileFocus: { scale: 1.008 },
|
|
53
|
+
whileTap: { scale: 0.995 },
|
|
54
|
+
transition: { type: "spring", stiffness: 380, damping: 24 }
|
|
55
|
+
},
|
|
56
|
+
bounce: {
|
|
57
|
+
whileFocus: { y: -2, scale: 1.01 },
|
|
58
|
+
whileHover: { y: -1, scale: 1.005 },
|
|
59
|
+
transition: { type: "spring", bounce: 0.35, duration: 0.4 }
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
// src/ui/inputs/input.tsx
|
|
64
|
+
var import_react = require("react");
|
|
65
|
+
var import_framer_motion = require("framer-motion");
|
|
66
|
+
|
|
67
|
+
// src/lib/utils.ts
|
|
68
|
+
var import_clsx = require("clsx");
|
|
69
|
+
var import_tailwind_merge = require("tailwind-merge");
|
|
70
|
+
function cn(...inputs) {
|
|
71
|
+
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// src/ui/inputs/variants.ts
|
|
75
|
+
var import_class_variance_authority = require("class-variance-authority");
|
|
76
|
+
var inputVariants = (0, import_class_variance_authority.cva)(
|
|
77
|
+
[
|
|
78
|
+
"w-full min-w-0 rounded-xl border bg-white/5 text-slate-50 shadow-[0_1px_2px_rgba(15,23,42,0.12)]",
|
|
79
|
+
"ring-offset-slate-950 transition-colors",
|
|
80
|
+
"placeholder:text-slate-500",
|
|
81
|
+
"focus-visible:outline-none",
|
|
82
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
83
|
+
"read-only:cursor-default read-only:bg-white/[0.03]",
|
|
84
|
+
"file:h-8"
|
|
85
|
+
],
|
|
86
|
+
{
|
|
87
|
+
variants: {
|
|
88
|
+
as: {
|
|
89
|
+
input: "",
|
|
90
|
+
textarea: "h-auto! resize-y py-2 align-top",
|
|
91
|
+
file: [
|
|
92
|
+
// Reset native padding so we control it fully
|
|
93
|
+
"p-0! cursor-pointer",
|
|
94
|
+
// File-selector button base styles
|
|
95
|
+
"file:cursor-pointer file:border-0 file:border-r file:border-white/10",
|
|
96
|
+
"file:bg-white/10 file:text-slate-200 file:font-medium",
|
|
97
|
+
"file:transition-colors file:duration-200",
|
|
98
|
+
"hover:file:bg-white/15",
|
|
99
|
+
// Content area padding
|
|
100
|
+
"[&:not(:disabled)]:file:hover:text-white",
|
|
101
|
+
"disabled:file:cursor-not-allowed"
|
|
102
|
+
],
|
|
103
|
+
checkbox: [
|
|
104
|
+
"shrink-0 cursor-pointer appearance-none relative",
|
|
105
|
+
"min-h-0! shadow-none outline-none",
|
|
106
|
+
"border-2 border-white/30 [&:not(:checked)]:bg-transparent",
|
|
107
|
+
"transition-[color,box-shadow,border-color,background-color]",
|
|
108
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
109
|
+
"read-only:cursor-default",
|
|
110
|
+
"checked:after:absolute checked:after:content-[''] checked:after:size-3 checked:after:top-1/2 checked:after:left-1/2 checked:after:-translate-x-1/2 checked:after:-translate-y-1/2 checked:after:rounded-full checked:after:bg-current"
|
|
111
|
+
],
|
|
112
|
+
radio: [
|
|
113
|
+
"shrink-0 cursor-pointer appearance-none rounded-full",
|
|
114
|
+
"min-h-0! shadow-none outline-none",
|
|
115
|
+
"border-2 border-white/30 bg-transparent! read-only:bg-transparent!",
|
|
116
|
+
"ring-2 ring-white/20 ring-offset-2 ring-offset-slate-950",
|
|
117
|
+
"transition-[color,box-shadow,background-color,border-color,box-shadow]",
|
|
118
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
119
|
+
"read-only:cursor-default"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
appearance: {
|
|
123
|
+
default: "border-white/10 focus-visible:border-white/20",
|
|
124
|
+
warning: "border-yellow-500/80 text-yellow-50 placeholder:text-yellow-300/70 focus-visible:border-yellow-400 focus-visible:ring-yellow-400/80",
|
|
125
|
+
error: "border-rose-500/80 text-rose-50 placeholder:text-rose-300/70 focus-visible:border-rose-400 focus-visible:ring-rose-400/80",
|
|
126
|
+
success: "border-emerald-500/70 text-emerald-50 placeholder:text-emerald-300/70 focus-visible:border-emerald-400 focus-visible:ring-emerald-400/80",
|
|
127
|
+
info: "border-blue-500/80 text-blue-50 placeholder:text-blue-300/70 focus-visible:border-blue-400 focus-visible:ring-blue-400/80",
|
|
128
|
+
violet: "border-violet-500/80 text-violet-50 placeholder:text-violet-300/70 focus-visible:border-violet-400 focus-visible:ring-violet-400/80",
|
|
129
|
+
amber: "border-amber-500/80 text-amber-50 placeholder:text-amber-300/70 focus-visible:border-amber-400 focus-visible:ring-amber-400/80",
|
|
130
|
+
pink: "border-pink-500/80 text-pink-50 placeholder:text-pink-300/70 focus-visible:border-pink-400 focus-visible:ring-pink-400/80",
|
|
131
|
+
indigo: "border-indigo-500/80 text-indigo-50 placeholder:text-indigo-300/70 focus-visible:border-indigo-400 focus-visible:ring-indigo-400/80",
|
|
132
|
+
orange: "border-orange-500/80 text-orange-50 placeholder:text-orange-300/70 focus-visible:border-orange-400 focus-visible:ring-orange-400/80"
|
|
133
|
+
},
|
|
134
|
+
size: {
|
|
135
|
+
sm: "h-8 px-3 text-xs",
|
|
136
|
+
md: "h-9 md:h-11 px-4 text-sm",
|
|
137
|
+
lg: "h-10 md:h-12 px-5 text-base"
|
|
138
|
+
},
|
|
139
|
+
ring: {
|
|
140
|
+
true: "focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
141
|
+
false: ""
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
defaultVariants: {
|
|
145
|
+
as: "input",
|
|
146
|
+
appearance: "default",
|
|
147
|
+
size: "md",
|
|
148
|
+
ring: true
|
|
149
|
+
},
|
|
150
|
+
compoundVariants: [
|
|
151
|
+
// ── textarea size overrides ──────────────────────────────────────────
|
|
152
|
+
{
|
|
153
|
+
as: "textarea",
|
|
154
|
+
size: "sm",
|
|
155
|
+
class: "min-h-[5rem]"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
as: "textarea",
|
|
159
|
+
size: "md",
|
|
160
|
+
class: "min-h-[6rem]"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
as: "textarea",
|
|
164
|
+
size: "lg",
|
|
165
|
+
class: "min-h-[7.5rem]"
|
|
166
|
+
},
|
|
167
|
+
// ── file input: size – height & file-button padding ──────────────────
|
|
168
|
+
{
|
|
169
|
+
as: "file",
|
|
170
|
+
size: "sm",
|
|
171
|
+
class: "h-8 text-xs pl-1 file:h-8 file:px-3 file:text-xs"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
as: "file",
|
|
175
|
+
size: "md",
|
|
176
|
+
class: "h-9 md:h-11 text-sm pl-1 file:h-9 md:file:h-11 file:px-4 file:text-sm"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
as: "file",
|
|
180
|
+
size: "lg",
|
|
181
|
+
class: "h-10 md:h-12 text-base pl-1 file:h-10 md:file:h-12 file:px-5 file:text-base"
|
|
182
|
+
},
|
|
183
|
+
// ── file input: appearance – file-button accent colour ───────────────
|
|
184
|
+
{
|
|
185
|
+
as: "file",
|
|
186
|
+
appearance: "default",
|
|
187
|
+
class: "file:text-slate-200"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
as: "file",
|
|
191
|
+
appearance: "warning",
|
|
192
|
+
class: "file:bg-yellow-500/20 file:text-yellow-200 file:border-yellow-500/40 hover:file:bg-yellow-500/30"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
as: "file",
|
|
196
|
+
appearance: "error",
|
|
197
|
+
class: "file:bg-rose-500/20 file:text-rose-200 file:border-rose-500/40 hover:file:bg-rose-500/30"
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
as: "file",
|
|
201
|
+
appearance: "success",
|
|
202
|
+
class: "file:bg-emerald-500/20 file:text-emerald-200 file:border-emerald-500/40 hover:file:bg-emerald-500/30"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
as: "file",
|
|
206
|
+
appearance: "info",
|
|
207
|
+
class: "file:bg-blue-500/20 file:text-blue-200 file:border-blue-500/40 hover:file:bg-blue-500/30"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
as: "file",
|
|
211
|
+
appearance: "violet",
|
|
212
|
+
class: "file:bg-violet-500/20 file:text-violet-200 file:border-violet-500/40 hover:file:bg-violet-500/30"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
as: "file",
|
|
216
|
+
appearance: "amber",
|
|
217
|
+
class: "file:bg-amber-500/20 file:text-amber-200 file:border-amber-500/40 hover:file:bg-amber-500/30"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
as: "file",
|
|
221
|
+
appearance: "pink",
|
|
222
|
+
class: "file:bg-pink-500/20 file:text-pink-200 file:border-pink-500/40 hover:file:bg-pink-500/30"
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
as: "file",
|
|
226
|
+
appearance: "indigo",
|
|
227
|
+
class: "file:bg-indigo-500/20 file:text-indigo-200 file:border-indigo-500/40 hover:file:bg-indigo-500/30"
|
|
228
|
+
},
|
|
229
|
+
// ── checkbox / radio: size (overrides text-field height & padding) ───
|
|
230
|
+
{
|
|
231
|
+
as: "checkbox",
|
|
232
|
+
size: "sm",
|
|
233
|
+
class: "h-4! w-4! min-h-0! rounded-[0.35rem]! px-0! py-0!"
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
as: "checkbox",
|
|
237
|
+
size: "md",
|
|
238
|
+
class: "h-5! w-5! min-h-0! rounded-md! px-0! py-0!"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
as: "checkbox",
|
|
242
|
+
size: "lg",
|
|
243
|
+
class: "h-6! w-6! min-h-0! rounded-md! px-0! py-0!"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
as: "radio",
|
|
247
|
+
size: "sm",
|
|
248
|
+
class: "h-4! w-4! min-h-0! px-0! py-0!"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
as: "radio",
|
|
252
|
+
size: "md",
|
|
253
|
+
class: "h-5! w-5! min-h-0! px-0! py-0!"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
as: "radio",
|
|
257
|
+
size: "lg",
|
|
258
|
+
class: "h-6! w-6! min-h-0! px-0! py-0!"
|
|
259
|
+
},
|
|
260
|
+
// ── checkbox: appearance (border + tick color; fill stays transparent) ─
|
|
261
|
+
{
|
|
262
|
+
as: "checkbox",
|
|
263
|
+
appearance: "default",
|
|
264
|
+
class: "border-slate-400/70! checked:border-slate-200 checked:text-slate-200 hover:border-slate-300 focus-visible:border-slate-300 focus-visible:ring-slate-400/70"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
as: "checkbox",
|
|
268
|
+
appearance: "warning",
|
|
269
|
+
class: "border-yellow-500/70! checked:border-yellow-400 checked:text-yellow-300 hover:border-yellow-400 focus-visible:border-yellow-400 focus-visible:ring-yellow-400/80"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
as: "checkbox",
|
|
273
|
+
appearance: "error",
|
|
274
|
+
class: "border-rose-500/70! checked:border-rose-400 checked:text-rose-300 hover:border-rose-400 focus-visible:border-rose-400 focus-visible:ring-rose-400/80"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
as: "checkbox",
|
|
278
|
+
appearance: "success",
|
|
279
|
+
class: "border-emerald-500/70! checked:border-emerald-400 checked:text-emerald-300 hover:border-emerald-400 focus-visible:border-emerald-400 focus-visible:ring-emerald-400/80"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
as: "checkbox",
|
|
283
|
+
appearance: "info",
|
|
284
|
+
class: "border-blue-500/70! checked:border-blue-400 checked:text-blue-300 hover:border-blue-400 focus-visible:border-blue-400 focus-visible:ring-blue-400/80"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
as: "checkbox",
|
|
288
|
+
appearance: "violet",
|
|
289
|
+
class: "border-violet-500/70! checked:after:bg-violet-400 checked:border-violet-400 checked:text-violet-300 hover:border-violet-400 focus-visible:border-violet-400 focus-visible:ring-violet-400/80"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
as: "checkbox",
|
|
293
|
+
appearance: "amber",
|
|
294
|
+
class: "border-amber-500/70! checked:border-amber-400! checked:text-amber-300 hover:border-amber-400! focus-visible:border-amber-400! focus-visible:ring-amber-400/80!"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
as: "checkbox",
|
|
298
|
+
appearance: "pink",
|
|
299
|
+
class: "border-pink-500/70! checked:border-pink-400 checked:text-pink-300 hover:border-pink-400 focus-visible:border-pink-400 focus-visible:ring-pink-400/80"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
as: "checkbox",
|
|
303
|
+
appearance: "indigo",
|
|
304
|
+
class: "border-indigo-500/70! checked:border-indigo-400! checked:text-indigo-300 hover:border-indigo-400! focus-visible:border-indigo-400! focus-visible:ring-indigo-400/80!"
|
|
305
|
+
},
|
|
306
|
+
// ── radio: appearance (transparent fill, inner dot, coloured offset ring) ─
|
|
307
|
+
{
|
|
308
|
+
as: "radio",
|
|
309
|
+
appearance: "default",
|
|
310
|
+
class: "border-slate-400/70! checked:border-slate-200 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(226,232,240)]! hover:border-slate-300 focus-visible:border-slate-300 focus-visible:ring-slate-400/70 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-slate-300/90!"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
as: "radio",
|
|
314
|
+
appearance: "warning",
|
|
315
|
+
class: "border-yellow-500/70! checked:border-yellow-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(250,204,21)]! hover:border-yellow-400 focus-visible:border-yellow-400 focus-visible:ring-yellow-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-yellow-400/90!"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
as: "radio",
|
|
319
|
+
appearance: "error",
|
|
320
|
+
class: "border-rose-500/70! checked:border-rose-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(251,113,133)]! hover:border-rose-400 focus-visible:border-rose-400 focus-visible:ring-rose-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-rose-400/90!"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
as: "radio",
|
|
324
|
+
appearance: "success",
|
|
325
|
+
class: "border-emerald-500/70! checked:border-emerald-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(52,211,153)]! hover:border-emerald-400 focus-visible:border-emerald-400 focus-visible:ring-emerald-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-emerald-400/90!"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
as: "radio",
|
|
329
|
+
appearance: "info",
|
|
330
|
+
class: "border-blue-500/70! checked:border-blue-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(96,165,250)]! hover:border-blue-400 focus-visible:border-blue-400 focus-visible:ring-blue-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-blue-400/90!"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
as: "radio",
|
|
334
|
+
appearance: "violet",
|
|
335
|
+
class: "border-violet-500/70! checked:border-violet-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(167,139,250)]! hover:border-violet-400 focus-visible:border-violet-400 focus-visible:ring-violet-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-violet-400/90!"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
as: "radio",
|
|
339
|
+
appearance: "amber",
|
|
340
|
+
class: "border-amber-500/70! checked:border-amber-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(251,191,36)]! hover:border-amber-400 focus-visible:border-amber-400 focus-visible:ring-amber-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-amber-400/90!"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
as: "radio",
|
|
344
|
+
appearance: "pink",
|
|
345
|
+
class: "border-pink-500/70! checked:border-pink-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(244,114,182)]! hover:border-pink-400 focus-visible:border-pink-400 focus-visible:ring-pink-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-pink-400/90!"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
as: "radio",
|
|
349
|
+
appearance: "indigo",
|
|
350
|
+
class: "border-indigo-500/70! checked:border-indigo-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(129,140,248)]! hover:border-indigo-400 focus-visible:border-indigo-400 focus-visible:ring-indigo-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-indigo-400/90!"
|
|
351
|
+
}
|
|
352
|
+
]
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
|
|
356
|
+
// src/ui/inputs/input.tsx
|
|
357
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
358
|
+
var Input = (props) => {
|
|
359
|
+
const generatedId = (0, import_react.useId)();
|
|
360
|
+
if (props.as === "textarea") {
|
|
361
|
+
const {
|
|
362
|
+
className: className2,
|
|
363
|
+
appearance: appearance2,
|
|
364
|
+
size: size2,
|
|
365
|
+
animation: animation2 = "none",
|
|
366
|
+
ring: ring2 = true,
|
|
367
|
+
ref: ref2,
|
|
368
|
+
"aria-invalid": ariaInvalidProp2,
|
|
369
|
+
errorMessage: errorMessage2,
|
|
370
|
+
id: id2,
|
|
371
|
+
as: as2,
|
|
372
|
+
...rest2
|
|
373
|
+
} = props;
|
|
374
|
+
const controlId2 = id2 ?? generatedId;
|
|
375
|
+
const errorId2 = `${controlId2}-error`;
|
|
376
|
+
const motionProps2 = inputAnimationPresets[animation2];
|
|
377
|
+
const ariaInvalid2 = ariaInvalidProp2 !== void 0 ? ariaInvalidProp2 : appearance2 === "error" ? true : void 0;
|
|
378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
379
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
380
|
+
import_framer_motion.motion.textarea,
|
|
381
|
+
{
|
|
382
|
+
ref: ref2,
|
|
383
|
+
id: controlId2,
|
|
384
|
+
"data-slot": "input",
|
|
385
|
+
className: cn(
|
|
386
|
+
inputVariants({ appearance: appearance2, size: size2, ring: ring2, as: as2 }),
|
|
387
|
+
className2
|
|
388
|
+
),
|
|
389
|
+
initial: false,
|
|
390
|
+
"aria-invalid": ariaInvalid2,
|
|
391
|
+
"aria-describedby": errorMessage2 && appearance2 === "error" ? errorId2 : void 0,
|
|
392
|
+
...motionProps2,
|
|
393
|
+
...rest2
|
|
394
|
+
}
|
|
395
|
+
),
|
|
396
|
+
errorMessage2 && appearance2 === "error" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
397
|
+
"p",
|
|
398
|
+
{
|
|
399
|
+
id: errorId2,
|
|
400
|
+
className: "text-sm text-rose-500 mt-2 pl-4 wrap-break-word",
|
|
401
|
+
children: errorMessage2
|
|
402
|
+
}
|
|
403
|
+
)
|
|
404
|
+
] });
|
|
405
|
+
}
|
|
406
|
+
const {
|
|
407
|
+
className,
|
|
408
|
+
appearance,
|
|
409
|
+
size,
|
|
410
|
+
animation = "none",
|
|
411
|
+
ring = true,
|
|
412
|
+
ref,
|
|
413
|
+
"aria-invalid": ariaInvalidProp,
|
|
414
|
+
errorMessage,
|
|
415
|
+
id,
|
|
416
|
+
as,
|
|
417
|
+
...rest
|
|
418
|
+
} = props;
|
|
419
|
+
const controlId = id ?? generatedId;
|
|
420
|
+
const errorId = `${controlId}-error`;
|
|
421
|
+
const motionProps = inputAnimationPresets[animation];
|
|
422
|
+
const ariaInvalid = ariaInvalidProp !== void 0 ? ariaInvalidProp : appearance === "error" ? true : void 0;
|
|
423
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
424
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
425
|
+
import_framer_motion.motion.input,
|
|
426
|
+
{
|
|
427
|
+
ref,
|
|
428
|
+
id: controlId,
|
|
429
|
+
"data-slot": "input",
|
|
430
|
+
className: cn(
|
|
431
|
+
inputVariants({ appearance, size, ring, as: as ?? "input" }),
|
|
432
|
+
className
|
|
433
|
+
),
|
|
434
|
+
initial: false,
|
|
435
|
+
"aria-invalid": ariaInvalid,
|
|
436
|
+
"aria-describedby": errorMessage && appearance === "error" ? errorId : void 0,
|
|
437
|
+
...motionProps,
|
|
438
|
+
...rest
|
|
439
|
+
}
|
|
440
|
+
),
|
|
441
|
+
errorMessage && appearance === "error" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
442
|
+
"p",
|
|
443
|
+
{
|
|
444
|
+
id: errorId,
|
|
445
|
+
className: "text-sm text-rose-500 mt-2 pl-4 wrap-break-word",
|
|
446
|
+
children: errorMessage
|
|
447
|
+
}
|
|
448
|
+
)
|
|
449
|
+
] });
|
|
450
|
+
};
|
|
451
|
+
Input.displayName = "Input";
|
|
452
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
453
|
+
0 && (module.exports = {
|
|
454
|
+
Input,
|
|
455
|
+
inputAnimationPresets,
|
|
456
|
+
inputVariants
|
|
457
|
+
});
|
|
458
|
+
//# sourceMappingURL=inputs.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/ui/inputs/index.ts","../../src/ui/inputs/animations.ts","../../src/ui/inputs/input.tsx","../../src/lib/utils.ts","../../src/ui/inputs/variants.ts"],"sourcesContent":["export { inputAnimationPresets } from \"./animations\";\nexport { Input } from \"./input\";\nexport type {\n InputAnimation,\n InputAnimationPresets,\n InputProps,\n} from \"./types\";\nexport { inputVariants } from \"./variants\";\n","import type { InputAnimationPresets } from \"./types\";\n\nexport const inputAnimationPresets: InputAnimationPresets = {\n none: {},\n lift: {\n whileHover: { y: -1 },\n whileFocus: { y: -1 },\n transition: { type: \"spring\", stiffness: 480, damping: 32 },\n },\n press: {\n whileTap: { scale: 0.99 },\n transition: { type: \"spring\", stiffness: 520, damping: 30 },\n },\n glow: {\n whileFocus: {\n boxShadow:\n \"0 0 0 1px rgba(255,255,255,0.2), 0 12px 28px rgba(15,23,42,0.35)\",\n },\n whileHover: {\n boxShadow:\n \"0 0 0 1px rgba(255,255,255,0.12), 0 8px 20px rgba(15,23,42,0.25)\",\n },\n transition: { duration: 0.2, ease: \"easeOut\" },\n },\n tilt: {\n whileHover: { scale: 1.005 },\n whileFocus: { scale: 1.008 },\n whileTap: { scale: 0.995 },\n transition: { type: \"spring\", stiffness: 380, damping: 24 },\n },\n bounce: {\n whileFocus: { y: -2, scale: 1.01 },\n whileHover: { y: -1, scale: 1.005 },\n transition: { type: \"spring\", bounce: 0.35, duration: 0.4 },\n },\n};\n","\"use client\";\n\nimport { useId } from \"react\";\nimport { motion } from \"framer-motion\";\n\nimport { cn } from \"../../lib/utils\";\nimport { inputAnimationPresets } from \"./animations\";\nimport type { InputProps } from \"./types\";\nimport { inputVariants } from \"./variants\";\n\nexport const Input = (props: InputProps) => {\n const generatedId = useId();\n\n if (props.as === \"textarea\") {\n const {\n className,\n appearance,\n size,\n animation = \"none\",\n ring = true,\n ref,\n \"aria-invalid\": ariaInvalidProp,\n errorMessage,\n id,\n as,\n ...rest\n } = props;\n\n const controlId = id ?? generatedId;\n const errorId = `${controlId}-error`;\n const motionProps = inputAnimationPresets[animation];\n const ariaInvalid =\n ariaInvalidProp !== undefined\n ? ariaInvalidProp\n : appearance === \"error\"\n ? true\n : undefined;\n\n return (\n <>\n <motion.textarea\n ref={ref}\n id={controlId}\n data-slot=\"input\"\n className={cn(\n inputVariants({ appearance, size, ring, as }),\n className,\n )}\n initial={false}\n aria-invalid={ariaInvalid}\n aria-describedby={\n errorMessage && appearance === \"error\" ? errorId : undefined\n }\n {...motionProps}\n {...rest}\n />\n {errorMessage && appearance === \"error\" && (\n <p\n id={errorId}\n className=\"text-sm text-rose-500 mt-2 pl-4 wrap-break-word\"\n >\n {errorMessage}\n </p>\n )}\n </>\n );\n }\n\n const {\n className,\n appearance,\n size,\n animation = \"none\",\n ring = true,\n ref,\n \"aria-invalid\": ariaInvalidProp,\n errorMessage,\n id,\n as,\n ...rest\n } = props;\n\n const controlId = id ?? generatedId;\n const errorId = `${controlId}-error`;\n const motionProps = inputAnimationPresets[animation];\n const ariaInvalid =\n ariaInvalidProp !== undefined\n ? ariaInvalidProp\n : appearance === \"error\"\n ? true\n : undefined;\n\n return (\n <>\n <motion.input\n ref={ref}\n id={controlId}\n data-slot=\"input\"\n className={cn(\n inputVariants({ appearance, size, ring, as: as ?? \"input\" }),\n className,\n )}\n initial={false}\n aria-invalid={ariaInvalid}\n aria-describedby={\n errorMessage && appearance === \"error\" ? errorId : undefined\n }\n {...motionProps}\n {...rest}\n />\n {errorMessage && appearance === \"error\" && (\n <p\n id={errorId}\n className=\"text-sm text-rose-500 mt-2 pl-4 wrap-break-word\"\n >\n {errorMessage}\n </p>\n )}\n </>\n );\n};\n\nInput.displayName = \"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}","import { cva } from \"class-variance-authority\";\n\nexport const inputVariants = cva(\n [\n \"w-full min-w-0 rounded-xl border bg-white/5 text-slate-50 shadow-[0_1px_2px_rgba(15,23,42,0.12)]\",\n \"ring-offset-slate-950 transition-colors\",\n \"placeholder:text-slate-500\",\n \"focus-visible:outline-none\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n \"read-only:cursor-default read-only:bg-white/[0.03]\",\n \"file:h-8\"\n ],\n {\n variants: {\n as: {\n input: \"\",\n textarea: \"h-auto! resize-y py-2 align-top\",\n file: [\n // Reset native padding so we control it fully\n \"p-0! cursor-pointer\",\n // File-selector button base styles\n \"file:cursor-pointer file:border-0 file:border-r file:border-white/10\",\n \"file:bg-white/10 file:text-slate-200 file:font-medium\",\n \"file:transition-colors file:duration-200\",\n \"hover:file:bg-white/15\",\n // Content area padding\n \"[&:not(:disabled)]:file:hover:text-white\",\n \"disabled:file:cursor-not-allowed\",\n ],\n checkbox: [\n \"shrink-0 cursor-pointer appearance-none relative\",\n \"min-h-0! shadow-none outline-none\",\n \"border-2 border-white/30 [&:not(:checked)]:bg-transparent\",\n \"transition-[color,box-shadow,border-color,background-color]\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n \"read-only:cursor-default\",\n \"checked:after:absolute checked:after:content-[''] checked:after:size-3 checked:after:top-1/2 checked:after:left-1/2 checked:after:-translate-x-1/2 checked:after:-translate-y-1/2 checked:after:rounded-full checked:after:bg-current\"\n ],\n radio: [\n \"shrink-0 cursor-pointer appearance-none rounded-full\",\n \"min-h-0! shadow-none outline-none\",\n \"border-2 border-white/30 bg-transparent! read-only:bg-transparent!\",\n \"ring-2 ring-white/20 ring-offset-2 ring-offset-slate-950\",\n \"transition-[color,box-shadow,background-color,border-color,box-shadow]\",\n \"disabled:cursor-not-allowed disabled:opacity-50\",\n \"read-only:cursor-default\",\n ],\n },\n appearance: {\n default: \"border-white/10 focus-visible:border-white/20\",\n warning: \"border-yellow-500/80 text-yellow-50 placeholder:text-yellow-300/70 focus-visible:border-yellow-400 focus-visible:ring-yellow-400/80\",\n error:\n \"border-rose-500/80 text-rose-50 placeholder:text-rose-300/70 focus-visible:border-rose-400 focus-visible:ring-rose-400/80\",\n success:\n \"border-emerald-500/70 text-emerald-50 placeholder:text-emerald-300/70 focus-visible:border-emerald-400 focus-visible:ring-emerald-400/80\",\n info: \"border-blue-500/80 text-blue-50 placeholder:text-blue-300/70 focus-visible:border-blue-400 focus-visible:ring-blue-400/80\",\n violet: \"border-violet-500/80 text-violet-50 placeholder:text-violet-300/70 focus-visible:border-violet-400 focus-visible:ring-violet-400/80\",\n amber: \"border-amber-500/80 text-amber-50 placeholder:text-amber-300/70 focus-visible:border-amber-400 focus-visible:ring-amber-400/80\",\n pink: \"border-pink-500/80 text-pink-50 placeholder:text-pink-300/70 focus-visible:border-pink-400 focus-visible:ring-pink-400/80\",\n indigo: \"border-indigo-500/80 text-indigo-50 placeholder:text-indigo-300/70 focus-visible:border-indigo-400 focus-visible:ring-indigo-400/80\",\n orange: \"border-orange-500/80 text-orange-50 placeholder:text-orange-300/70 focus-visible:border-orange-400 focus-visible:ring-orange-400/80\",\n\n },\n size: {\n sm: \"h-8 px-3 text-xs\",\n md: \"h-9 md:h-11 px-4 text-sm\",\n lg: \"h-10 md:h-12 px-5 text-base\",\n },\n ring: {\n true: \"focus-visible:ring-2 focus-visible:ring-offset-2\",\n false: \"\",\n },\n },\n defaultVariants: {\n as: \"input\",\n appearance: \"default\",\n size: \"md\",\n ring: true,\n },\n compoundVariants: [\n // ── textarea size overrides ──────────────────────────────────────────\n {\n as: \"textarea\",\n size: \"sm\",\n class: \"min-h-[5rem]\",\n },\n {\n as: \"textarea\",\n size: \"md\",\n class: \"min-h-[6rem]\",\n },\n {\n as: \"textarea\",\n size: \"lg\",\n class: \"min-h-[7.5rem]\",\n },\n // ── file input: size – height & file-button padding ──────────────────\n {\n as: \"file\",\n size: \"sm\",\n class: \"h-8 text-xs pl-1 file:h-8 file:px-3 file:text-xs\",\n },\n {\n as: \"file\",\n size: \"md\",\n class: \"h-9 md:h-11 text-sm pl-1 file:h-9 md:file:h-11 file:px-4 file:text-sm\",\n },\n {\n as: \"file\",\n size: \"lg\",\n class: \"h-10 md:h-12 text-base pl-1 file:h-10 md:file:h-12 file:px-5 file:text-base\",\n },\n // ── file input: appearance – file-button accent colour ───────────────\n {\n as: \"file\",\n appearance: \"default\",\n class: \"file:text-slate-200\",\n },\n {\n as: \"file\",\n appearance: \"warning\",\n class: \"file:bg-yellow-500/20 file:text-yellow-200 file:border-yellow-500/40 hover:file:bg-yellow-500/30\",\n },\n {\n as: \"file\",\n appearance: \"error\",\n class: \"file:bg-rose-500/20 file:text-rose-200 file:border-rose-500/40 hover:file:bg-rose-500/30\",\n },\n {\n as: \"file\",\n appearance: \"success\",\n class: \"file:bg-emerald-500/20 file:text-emerald-200 file:border-emerald-500/40 hover:file:bg-emerald-500/30\",\n },\n {\n as: \"file\",\n appearance: \"info\",\n class: \"file:bg-blue-500/20 file:text-blue-200 file:border-blue-500/40 hover:file:bg-blue-500/30\",\n },\n {\n as: \"file\",\n appearance: \"violet\",\n class: \"file:bg-violet-500/20 file:text-violet-200 file:border-violet-500/40 hover:file:bg-violet-500/30\",\n },\n {\n as: \"file\",\n appearance: \"amber\",\n class: \"file:bg-amber-500/20 file:text-amber-200 file:border-amber-500/40 hover:file:bg-amber-500/30\",\n },\n {\n as: \"file\",\n appearance: \"pink\",\n class: \"file:bg-pink-500/20 file:text-pink-200 file:border-pink-500/40 hover:file:bg-pink-500/30\",\n },\n {\n as: \"file\",\n appearance: \"indigo\",\n class: \"file:bg-indigo-500/20 file:text-indigo-200 file:border-indigo-500/40 hover:file:bg-indigo-500/30\",\n },\n // ── checkbox / radio: size (overrides text-field height & padding) ───\n {\n as: \"checkbox\",\n size: \"sm\",\n class:\n \"h-4! w-4! min-h-0! rounded-[0.35rem]! px-0! py-0!\",\n },\n {\n as: \"checkbox\",\n size: \"md\",\n class:\n \"h-5! w-5! min-h-0! rounded-md! px-0! py-0!\",\n },\n {\n as: \"checkbox\",\n size: \"lg\",\n class:\n \"h-6! w-6! min-h-0! rounded-md! px-0! py-0!\",\n },\n {\n as: \"radio\",\n size: \"sm\",\n class: \"h-4! w-4! min-h-0! px-0! py-0!\",\n },\n {\n as: \"radio\",\n size: \"md\",\n class: \"h-5! w-5! min-h-0! px-0! py-0!\",\n },\n {\n as: \"radio\",\n size: \"lg\",\n class: \"h-6! w-6! min-h-0! px-0! py-0!\",\n },\n // ── checkbox: appearance (border + tick color; fill stays transparent) ─\n {\n as: \"checkbox\",\n appearance: \"default\",\n class:\n \"border-slate-400/70! checked:border-slate-200 checked:text-slate-200 hover:border-slate-300 focus-visible:border-slate-300 focus-visible:ring-slate-400/70\",\n },\n {\n as: \"checkbox\",\n appearance: \"warning\",\n class:\n \"border-yellow-500/70! checked:border-yellow-400 checked:text-yellow-300 hover:border-yellow-400 focus-visible:border-yellow-400 focus-visible:ring-yellow-400/80\",\n },\n {\n as: \"checkbox\",\n appearance: \"error\",\n class:\n \"border-rose-500/70! checked:border-rose-400 checked:text-rose-300 hover:border-rose-400 focus-visible:border-rose-400 focus-visible:ring-rose-400/80\",\n },\n {\n as: \"checkbox\",\n appearance: \"success\",\n class:\n \"border-emerald-500/70! checked:border-emerald-400 checked:text-emerald-300 hover:border-emerald-400 focus-visible:border-emerald-400 focus-visible:ring-emerald-400/80\",\n },\n {\n as: \"checkbox\",\n appearance: \"info\",\n class:\n \"border-blue-500/70! checked:border-blue-400 checked:text-blue-300 hover:border-blue-400 focus-visible:border-blue-400 focus-visible:ring-blue-400/80\",\n },\n {\n as: \"checkbox\",\n appearance: \"violet\",\n class:\n \"border-violet-500/70! checked:after:bg-violet-400 checked:border-violet-400 checked:text-violet-300 hover:border-violet-400 focus-visible:border-violet-400 focus-visible:ring-violet-400/80\",\n },\n {\n as: \"checkbox\",\n appearance: \"amber\",\n class:\n \"border-amber-500/70! checked:border-amber-400! checked:text-amber-300 hover:border-amber-400! focus-visible:border-amber-400! focus-visible:ring-amber-400/80!\",\n },\n {\n as: \"checkbox\",\n appearance: \"pink\",\n class:\n \"border-pink-500/70! checked:border-pink-400 checked:text-pink-300 hover:border-pink-400 focus-visible:border-pink-400 focus-visible:ring-pink-400/80\",\n },\n {\n as: \"checkbox\",\n appearance: \"indigo\",\n class:\n \"border-indigo-500/70! checked:border-indigo-400! checked:text-indigo-300 hover:border-indigo-400! focus-visible:border-indigo-400! focus-visible:ring-indigo-400/80!\",\n },\n // ── radio: appearance (transparent fill, inner dot, coloured offset ring) ─\n {\n as: \"radio\",\n appearance: \"default\",\n class:\n \"border-slate-400/70! checked:border-slate-200 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(226,232,240)]! hover:border-slate-300 focus-visible:border-slate-300 focus-visible:ring-slate-400/70 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-slate-300/90!\",\n },\n {\n as: \"radio\",\n appearance: \"warning\",\n class:\n \"border-yellow-500/70! checked:border-yellow-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(250,204,21)]! hover:border-yellow-400 focus-visible:border-yellow-400 focus-visible:ring-yellow-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-yellow-400/90!\",\n },\n {\n as: \"radio\",\n appearance: \"error\",\n class:\n \"border-rose-500/70! checked:border-rose-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(251,113,133)]! hover:border-rose-400 focus-visible:border-rose-400 focus-visible:ring-rose-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-rose-400/90!\",\n },\n {\n as: \"radio\",\n appearance: \"success\",\n class:\n \"border-emerald-500/70! checked:border-emerald-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(52,211,153)]! hover:border-emerald-400 focus-visible:border-emerald-400 focus-visible:ring-emerald-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-emerald-400/90!\",\n },\n {\n as: \"radio\",\n appearance: \"info\",\n class:\n \"border-blue-500/70! checked:border-blue-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(96,165,250)]! hover:border-blue-400 focus-visible:border-blue-400 focus-visible:ring-blue-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-blue-400/90!\",\n },\n {\n as: \"radio\",\n appearance: \"violet\",\n class:\n \"border-violet-500/70! checked:border-violet-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(167,139,250)]! hover:border-violet-400 focus-visible:border-violet-400 focus-visible:ring-violet-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-violet-400/90!\",\n },\n {\n as: \"radio\",\n appearance: \"amber\",\n class:\n \"border-amber-500/70! checked:border-amber-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(251,191,36)]! hover:border-amber-400 focus-visible:border-amber-400 focus-visible:ring-amber-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-amber-400/90!\",\n },\n {\n as: \"radio\",\n appearance: \"pink\",\n class:\n \"border-pink-500/70! checked:border-pink-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(244,114,182)]! hover:border-pink-400 focus-visible:border-pink-400 focus-visible:ring-pink-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-pink-400/90!\",\n },\n {\n as: \"radio\",\n appearance: \"indigo\",\n class:\n \"border-indigo-500/70! checked:border-indigo-400 checked:bg-transparent! checked:shadow-[inset_0_0_0_0.28rem_rgb(129,140,248)]! hover:border-indigo-400 focus-visible:border-indigo-400 focus-visible:ring-indigo-400/80 checked:ring-2! checked:ring-offset-2! checked:ring-offset-slate-950! checked:ring-indigo-400/90!\",\n },\n ],\n },\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,wBAA+C;AAAA,EAC1D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AA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AAEJ,QAAM,YAAY,MAAM;AACxB,QAAM,UAAU,GAAG,SAAS;AAC5B,QAAM,cAAc,sBAAsB,SAAS;AACnD,QAAM,cACJ,oBAAoB,SAChB,kBACA,eAAe,UACb,OACA;AAER,SACE,4EACE;AAAA;AAAA,MAAC,4BAAO;AAAA,MAAP;AAAA,QACC;AAAA,QACA,IAAI;AAAA,QACJ,aAAU;AAAA,QACV,WAAW;AAAA,UACT,cAAc,EAAE,YAAY,MAAM,MAAM,IAAI,MAAM,QAAQ,CAAC;AAAA,UAC3D;AAAA,QACF;AAAA,QACA,SAAS;AAAA,QACT,gBAAc;AAAA,QACd,oBACE,gBAAgB,eAAe,UAAU,UAAU;AAAA,QAEpD,GAAG;AAAA,QACH,GAAG;AAAA;AAAA,IACN;AAAA,IACC,gBAAgB,eAAe,WAC9B;AAAA,MAAC;AAAA;AAAA,QACC,IAAI;AAAA,QACJ,WAAU;AAAA,QAET;AAAA;AAAA,IACH;AAAA,KAEJ;AAEJ;AAEA,MAAM,cAAc;","names":["className","appearance","size","animation","ring","ref","ariaInvalidProp","errorMessage","id","as","rest","controlId","errorId","motionProps","ariaInvalid"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
declare const inputVariants: (props?: ({
|
|
7
|
+
as?: "input" | "textarea" | "checkbox" | "radio" | "file" | null | undefined;
|
|
8
|
+
appearance?: "default" | "pink" | "orange" | "indigo" | "success" | "warning" | "error" | "info" | "violet" | "amber" | null | undefined;
|
|
9
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
10
|
+
ring?: boolean | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
|
|
13
|
+
type InputAnimation = "none" | "lift" | "press" | "glow" | "tilt" | "bounce";
|
|
14
|
+
type InputSharedProps = Omit<VariantProps<typeof inputVariants>, "as"> & {
|
|
15
|
+
animation?: InputAnimation;
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
};
|
|
18
|
+
/** Motion props applied by presets on `motion.input` / `motion.textarea`. */
|
|
19
|
+
type InputPresetMotionProps = Pick<HTMLMotionProps<"input">, "style" | "transition" | "whileHover" | "whileTap" | "whileFocus">;
|
|
20
|
+
/** Omit native `size` (character width) so the design-system `size` variant can use the same name. */
|
|
21
|
+
type InputProps = (InputSharedProps & Omit<HTMLMotionProps<"input">, "size" | "as"> & {
|
|
22
|
+
as?: "input" | "file" | "checkbox" | "radio";
|
|
23
|
+
}) | (InputSharedProps & Omit<HTMLMotionProps<"textarea">, "size" | "as"> & {
|
|
24
|
+
as: "textarea";
|
|
25
|
+
});
|
|
26
|
+
type InputAnimationPresets = Record<InputAnimation, InputPresetMotionProps>;
|
|
27
|
+
|
|
28
|
+
declare const inputAnimationPresets: InputAnimationPresets;
|
|
29
|
+
|
|
30
|
+
declare const Input: {
|
|
31
|
+
(props: InputProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { Input, type InputAnimation, type InputAnimationPresets, type InputProps, inputAnimationPresets, inputVariants };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { HTMLMotionProps } from 'framer-motion';
|
|
3
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
declare const inputVariants: (props?: ({
|
|
7
|
+
as?: "input" | "textarea" | "checkbox" | "radio" | "file" | null | undefined;
|
|
8
|
+
appearance?: "default" | "pink" | "orange" | "indigo" | "success" | "warning" | "error" | "info" | "violet" | "amber" | null | undefined;
|
|
9
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
10
|
+
ring?: boolean | null | undefined;
|
|
11
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
12
|
+
|
|
13
|
+
type InputAnimation = "none" | "lift" | "press" | "glow" | "tilt" | "bounce";
|
|
14
|
+
type InputSharedProps = Omit<VariantProps<typeof inputVariants>, "as"> & {
|
|
15
|
+
animation?: InputAnimation;
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
};
|
|
18
|
+
/** Motion props applied by presets on `motion.input` / `motion.textarea`. */
|
|
19
|
+
type InputPresetMotionProps = Pick<HTMLMotionProps<"input">, "style" | "transition" | "whileHover" | "whileTap" | "whileFocus">;
|
|
20
|
+
/** Omit native `size` (character width) so the design-system `size` variant can use the same name. */
|
|
21
|
+
type InputProps = (InputSharedProps & Omit<HTMLMotionProps<"input">, "size" | "as"> & {
|
|
22
|
+
as?: "input" | "file" | "checkbox" | "radio";
|
|
23
|
+
}) | (InputSharedProps & Omit<HTMLMotionProps<"textarea">, "size" | "as"> & {
|
|
24
|
+
as: "textarea";
|
|
25
|
+
});
|
|
26
|
+
type InputAnimationPresets = Record<InputAnimation, InputPresetMotionProps>;
|
|
27
|
+
|
|
28
|
+
declare const inputAnimationPresets: InputAnimationPresets;
|
|
29
|
+
|
|
30
|
+
declare const Input: {
|
|
31
|
+
(props: InputProps): react_jsx_runtime.JSX.Element;
|
|
32
|
+
displayName: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { Input, type InputAnimation, type InputAnimationPresets, type InputProps, inputAnimationPresets, inputVariants };
|