@lindle/linoardo 1.0.31 → 1.0.32
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/chip.d.cts +3 -3
- package/dist/chip.d.ts +3 -3
- package/dist/{chunk-LYP7V32H.js → chunk-HBF4S2KY.js} +2 -2
- package/dist/chunk-HBF4S2KY.js.map +1 -0
- package/dist/chunk-P3ESW6KM.js +172 -0
- package/dist/chunk-P3ESW6KM.js.map +1 -0
- package/dist/expansion-panel.cjs +0 -1
- package/dist/expansion-panel.cjs.map +1 -1
- package/dist/expansion-panel.js +1 -1
- package/dist/index.cjs +136 -132
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/input.cjs +136 -132
- package/dist/input.cjs.map +1 -1
- package/dist/input.d.cts +8 -2
- package/dist/input.d.ts +8 -2
- package/dist/input.js +1 -1
- package/dist/select.d.cts +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/{types-BCqIOkp1.d.cts → types-BJC99riF.d.cts} +1 -9
- package/dist/{types-ChXN4u7x.d.ts → types-CTq2JZpg.d.ts} +1 -9
- package/package.json +1 -1
- package/dist/chunk-AUFMBVXA.js +0 -168
- package/dist/chunk-AUFMBVXA.js.map +0 -1
- package/dist/chunk-LYP7V32H.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -2320,138 +2320,142 @@ var resolveIconClassName4 = (icon) => {
|
|
|
2320
2320
|
const classes = [...baseClasses, normalizedName];
|
|
2321
2321
|
return Array.from(new Set(classes)).join(" ");
|
|
2322
2322
|
};
|
|
2323
|
-
var Input = (
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
}
|
|
2323
|
+
var Input = React4__namespace.default.forwardRef(
|
|
2324
|
+
({
|
|
2325
|
+
variant = "outline",
|
|
2326
|
+
size = "medium",
|
|
2327
|
+
success,
|
|
2328
|
+
error,
|
|
2329
|
+
warn,
|
|
2330
|
+
icon,
|
|
2331
|
+
className,
|
|
2332
|
+
wrapperClassName,
|
|
2333
|
+
label,
|
|
2334
|
+
...props
|
|
2335
|
+
}, ref) => {
|
|
2336
|
+
const { placeholder, onFocus, onBlur, ...inputProps } = props;
|
|
2337
|
+
const reactId = React4__namespace.default.useId();
|
|
2338
|
+
const hasLabel = Boolean(label);
|
|
2339
|
+
const hasProvidedPlaceholder = typeof placeholder === "string" && placeholder.trim().length > 0;
|
|
2340
|
+
const hidePlaceholderUntilFocus = hasLabel && hasProvidedPlaceholder;
|
|
2341
|
+
const [isFocused, setIsFocused] = React4__namespace.default.useState(false);
|
|
2342
|
+
const classBase = "input-base focus-visible:outline-none focus-visible:ring-primary transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed w-full text-gray-900 dark:text-gray-100 placeholder:text-gray-500 dark:placeholder:text-gray-400";
|
|
2343
|
+
const variantClasses5 = {
|
|
2344
|
+
solid: "rounded border border-gray-400 bg-white shadow-sm focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/30 dark:border-gray-600 dark:bg-slate-900 dark:shadow-black/20 dark:focus-visible:border-primary/70 dark:focus-visible:ring-primary/40",
|
|
2345
|
+
sharp: "rounded-none border border-gray-400 bg-white shadow-sm focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/30 dark:border-gray-600 dark:bg-slate-900 dark:shadow-black/20 dark:focus-visible:border-primary/70 dark:focus-visible:ring-primary/40",
|
|
2346
|
+
outline: "rounded border-2 border-black bg-white focus-visible:border-black focus-visible:ring-2 focus-visible:ring-black/30 dark:border-black dark:bg-transparent dark:focus-visible:border-black dark:focus-visible:ring-black/40",
|
|
2347
|
+
text: "rounded-none border-0 border-b border-transparent px-0 bg-transparent focus-visible:border-primary focus-visible:ring-0 focus-visible:ring-transparent dark:border-b-gray-600 dark:focus-visible:border-primary/70",
|
|
2348
|
+
ghost: "rounded border border-transparent bg-gray-50 text-gray-900 focus-visible:bg-white focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/15 dark:bg-slate-800 dark:text-gray-100 dark:focus-visible:bg-slate-700 dark:focus-visible:border-primary/60 dark:focus-visible:ring-primary/25",
|
|
2349
|
+
filled: "rounded border border-gray-200 bg-gray-100 focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/25 dark:border-gray-700 dark:bg-slate-800 dark:focus-visible:border-primary/60 dark:focus-visible:ring-primary/30",
|
|
2350
|
+
underlined: "rounded-none border-0 border-b border-gray-300 px-0 bg-transparent focus-visible:border-primary focus-visible:ring-0 focus-visible:ring-transparent dark:border-b-gray-600 dark:focus-visible:border-primary/70",
|
|
2351
|
+
rounded: "rounded-full px-4 border border-gray-300 bg-white focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/20 shadow-sm dark:border-gray-600 dark:bg-slate-900 dark:focus-visible:border-primary/70 dark:focus-visible:ring-primary/30 dark:shadow-black/20"
|
|
2352
|
+
};
|
|
2353
|
+
const sizeClasses4 = {
|
|
2354
|
+
"x-small": { paddingNoIcon: "px-2 py-2", paddingWithIcon: "pl-8 pr-2 py-2", text: "text-xs" },
|
|
2355
|
+
small: {
|
|
2356
|
+
paddingNoIcon: "px-2.5 py-2.5",
|
|
2357
|
+
paddingWithIcon: "pl-9 pr-2.5 py-2.5",
|
|
2358
|
+
text: "text-sm"
|
|
2359
|
+
},
|
|
2360
|
+
medium: { paddingNoIcon: "px-3 py-3", paddingWithIcon: "pl-10 pr-3 py-3", text: "text-base" },
|
|
2361
|
+
large: {
|
|
2362
|
+
paddingNoIcon: "px-3.5 py-3.5",
|
|
2363
|
+
paddingWithIcon: "pl-11 pr-3.5 py-3.5",
|
|
2364
|
+
text: "text-lg"
|
|
2365
|
+
},
|
|
2366
|
+
"x-large": { paddingNoIcon: "px-4 py-4", paddingWithIcon: "pl-12 pr-4 py-4", text: "text-xl" }
|
|
2367
|
+
};
|
|
2368
|
+
const status = error ? { tone: "error", message: error } : warn ? { tone: "warn", message: warn } : success ? { tone: "success", message: success } : void 0;
|
|
2369
|
+
const statusClasses = {
|
|
2370
|
+
error: "border-red-500 focus:border-red-500 focus:ring-red-400",
|
|
2371
|
+
warn: "border-amber-500 focus:border-amber-500 focus:ring-amber-400",
|
|
2372
|
+
success: "border-emerald-500 focus:border-emerald-500 focus:ring-emerald-400"
|
|
2373
|
+
};
|
|
2374
|
+
const statusMessageClasses = {
|
|
2375
|
+
error: "text-red-600 dark:text-red-300",
|
|
2376
|
+
warn: "text-amber-600 dark:text-amber-300",
|
|
2377
|
+
success: "text-emerald-600 dark:text-emerald-300"
|
|
2378
|
+
};
|
|
2379
|
+
const variantClass = variantClasses5[variant] ?? variantClasses5.outline;
|
|
2380
|
+
const toneClass = status ? statusClasses[status.tone] : void 0;
|
|
2381
|
+
let prependIconClass = resolveIconClassName4(icon);
|
|
2382
|
+
const sizeConfig = sizeClasses4[size] ?? sizeClasses4.medium;
|
|
2383
|
+
const sizeClass = [
|
|
2384
|
+
prependIconClass ? sizeConfig.paddingWithIcon : sizeConfig.paddingNoIcon,
|
|
2385
|
+
sizeConfig.text
|
|
2386
|
+
].join(" ");
|
|
2387
|
+
const inputName = inputProps.name || reactId;
|
|
2388
|
+
const basePlaceholder = placeholder ?? (hasLabel ? " " : void 0);
|
|
2389
|
+
const placeholderValue = hidePlaceholderUntilFocus ? isFocused ? placeholder : " " : basePlaceholder;
|
|
2390
|
+
const placeholderClass = hidePlaceholderUntilFocus ? "placeholder-transparent focus:placeholder-gray-500 focus:dark:placeholder-gray-400" : void 0;
|
|
2391
|
+
const labelLeftClass = prependIconClass ? "left-10" : "left-3";
|
|
2392
|
+
const labelBgDefault = ["outline", "text", "underlined"].includes(variant) ? "bg-transparent" : "bg-white/90 dark:bg-slate-900";
|
|
2393
|
+
const handleFocus = (event) => {
|
|
2394
|
+
if (hidePlaceholderUntilFocus) setIsFocused(true);
|
|
2395
|
+
onFocus?.(event);
|
|
2396
|
+
};
|
|
2397
|
+
const handleBlur = (event) => {
|
|
2398
|
+
if (hidePlaceholderUntilFocus) setIsFocused(false);
|
|
2399
|
+
onBlur?.(event);
|
|
2400
|
+
};
|
|
2401
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex flex-col gap-1", wrapperClassName), children: [
|
|
2402
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center", children: [
|
|
2403
|
+
prependIconClass && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2404
|
+
"i",
|
|
2405
|
+
{
|
|
2406
|
+
className: tailwindMerge.twMerge(
|
|
2407
|
+
"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-gray-500 dark:text-gray-400",
|
|
2408
|
+
status?.tone && statusMessageClasses[status?.tone] || "",
|
|
2409
|
+
prependIconClass
|
|
2410
|
+
),
|
|
2411
|
+
"aria-hidden": true
|
|
2412
|
+
}
|
|
2413
|
+
),
|
|
2414
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2415
|
+
"input",
|
|
2416
|
+
{
|
|
2417
|
+
...inputProps,
|
|
2418
|
+
ref,
|
|
2419
|
+
id: inputName,
|
|
2420
|
+
name: inputName,
|
|
2421
|
+
placeholder: placeholderValue,
|
|
2422
|
+
onFocus: handleFocus,
|
|
2423
|
+
onBlur: handleBlur,
|
|
2424
|
+
className: tailwindMerge.twMerge(
|
|
2425
|
+
"peer",
|
|
2426
|
+
classBase,
|
|
2427
|
+
variantClass,
|
|
2428
|
+
toneClass,
|
|
2429
|
+
sizeClass,
|
|
2430
|
+
placeholderClass,
|
|
2431
|
+
className
|
|
2432
|
+
)
|
|
2433
|
+
}
|
|
2434
|
+
),
|
|
2435
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2436
|
+
"label",
|
|
2437
|
+
{
|
|
2438
|
+
htmlFor: inputName,
|
|
2439
|
+
className: tailwindMerge.twMerge(
|
|
2440
|
+
"absolute transition-all duration-150 pointer-events-none text-gray-700 rounded dark:text-gray-200",
|
|
2441
|
+
labelLeftClass,
|
|
2442
|
+
// Floated state: center label's vertical middle on the top border line
|
|
2443
|
+
"-top-1.5 left-1 peer-focus:left-7 -translate-y-2/3 text-xs px-1",
|
|
2444
|
+
labelBgDefault,
|
|
2445
|
+
// focus state mirrors floated state (keeps center on border)
|
|
2446
|
+
"peer-focus:top-0 peer-focus:-translate-y-1/2 peer-focus:text-xs peer-focus:px-1 peer-focus:bg-white peer-focus:text-gray-600 dark:peer-focus:bg-slate-900 dark:peer-focus:text-gray-300",
|
|
2447
|
+
// when input is empty (placeholder shown) -> center label inside input
|
|
2448
|
+
"peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:text-sm peer-placeholder-shown:bg-transparent peer-placeholder-shown:text-gray-500 dark:peer-placeholder-shown:text-gray-400"
|
|
2449
|
+
),
|
|
2450
|
+
children: label
|
|
2451
|
+
}
|
|
2452
|
+
)
|
|
2453
|
+
] }),
|
|
2454
|
+
status?.message && /* @__PURE__ */ jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("text-sm", statusMessageClasses[status.tone]), children: status.message })
|
|
2455
|
+
] });
|
|
2456
|
+
}
|
|
2457
|
+
);
|
|
2458
|
+
Input.displayName = "Input";
|
|
2455
2459
|
var Input_default = Input;
|
|
2456
2460
|
|
|
2457
2461
|
// src/utils/helpers/randomStr.ts
|