@lindle/linoardo 1.0.30 → 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-LIEBZOLG.js → chunk-NJU7XT54.js} +57 -43
- package/dist/chunk-NJU7XT54.js.map +1 -0
- package/dist/chunk-P3ESW6KM.js +172 -0
- package/dist/chunk-P3ESW6KM.js.map +1 -0
- package/dist/{chunk-DDQ7ICWD.js → chunk-ZTP2JSQ6.js} +12 -9
- package/dist/{chunk-DDQ7ICWD.js.map → chunk-ZTP2JSQ6.js.map} +1 -1
- package/dist/dialog.cjs +55 -41
- package/dist/dialog.cjs.map +1 -1
- package/dist/dialog.d.cts +3 -0
- package/dist/dialog.d.ts +3 -0
- package/dist/dialog.js +1 -1
- 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 +201 -180
- 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 +4 -4
- 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/menu.cjs +10 -7
- package/dist/menu.cjs.map +1 -1
- package/dist/menu.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-LIEBZOLG.js.map +0 -1
- package/dist/chunk-LYP7V32H.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var React4 = require('react');
|
|
4
4
|
var tailwindMerge = require('tailwind-merge');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var reactDom = require('react-dom');
|
|
6
7
|
var react = require('@tiptap/react');
|
|
7
8
|
var StarterKit = require('@tiptap/starter-kit');
|
|
8
9
|
var marked = require('marked');
|
|
@@ -905,20 +906,23 @@ var Menu = React4__namespace.forwardRef((props, ref) => {
|
|
|
905
906
|
...rest
|
|
906
907
|
} = props;
|
|
907
908
|
const hasContent = children !== void 0 && children !== null;
|
|
908
|
-
const
|
|
909
|
-
const
|
|
910
|
-
const
|
|
909
|
+
const isControlled = open !== void 0;
|
|
910
|
+
const isOpen = open === true;
|
|
911
|
+
const allowHoverTrigger = openOnHover && !isControlled;
|
|
912
|
+
const allowFocusTrigger = openOnFocus && !isControlled;
|
|
913
|
+
const shouldRenderContent = hasContent && (keepMounted || isOpen || allowHoverTrigger || allowFocusTrigger);
|
|
914
|
+
const shouldRenderOverlay = scrim && hasContent && (isOpen || allowHoverTrigger || allowFocusTrigger);
|
|
911
915
|
const verticalPlacement = placement.startsWith("top") ? "top" : "bottom";
|
|
912
916
|
const visibilityClasses = tailwindMerge.twMerge(
|
|
913
917
|
"pointer-events-none opacity-0 scale-95",
|
|
914
918
|
isOpen ? "pointer-events-auto opacity-100 scale-100" : void 0,
|
|
915
|
-
|
|
916
|
-
|
|
919
|
+
allowHoverTrigger ? "group-hover/menu:pointer-events-auto group-hover/menu:opacity-100 group-hover/menu:scale-100" : void 0,
|
|
920
|
+
allowFocusTrigger ? "group-focus-within/menu:pointer-events-auto group-focus-within/menu:opacity-100 group-focus-within/menu:scale-100" : void 0
|
|
917
921
|
);
|
|
918
922
|
const overlayVisibilityClasses = tailwindMerge.twMerge(
|
|
919
923
|
"pointer-events-none opacity-0 transition-opacity duration-150",
|
|
920
|
-
|
|
921
|
-
|
|
924
|
+
allowHoverTrigger ? "group-hover/menu:opacity-100" : void 0,
|
|
925
|
+
allowFocusTrigger ? "group-focus-within/menu:opacity-100" : void 0,
|
|
922
926
|
isOpen ? "pointer-events-auto opacity-100" : void 0
|
|
923
927
|
);
|
|
924
928
|
const {
|
|
@@ -1352,9 +1356,12 @@ var Dialog = React4__namespace.forwardRef((props, forwardedRef) => {
|
|
|
1352
1356
|
fullscreen = false,
|
|
1353
1357
|
maxWidth = "32rem",
|
|
1354
1358
|
width,
|
|
1359
|
+
onClose,
|
|
1355
1360
|
containerClassName,
|
|
1356
1361
|
overlayClassName,
|
|
1357
1362
|
overlayProps,
|
|
1363
|
+
portal = true,
|
|
1364
|
+
portalContainer,
|
|
1358
1365
|
className,
|
|
1359
1366
|
style,
|
|
1360
1367
|
role: roleProp = "dialog",
|
|
@@ -1365,6 +1372,7 @@ var Dialog = React4__namespace.forwardRef((props, forwardedRef) => {
|
|
|
1365
1372
|
} = props;
|
|
1366
1373
|
const state = open ? "open" : "closed";
|
|
1367
1374
|
const shouldRenderDialog = keepMounted || open;
|
|
1375
|
+
const resolvedPortalContainer = portalContainer ?? (typeof document !== "undefined" ? document.body : null);
|
|
1368
1376
|
const resolvedStyle = { ...style };
|
|
1369
1377
|
if (fullscreen) {
|
|
1370
1378
|
if (resolvedStyle.maxWidth === void 0) {
|
|
@@ -1388,58 +1396,67 @@ var Dialog = React4__namespace.forwardRef((props, forwardedRef) => {
|
|
|
1388
1396
|
}
|
|
1389
1397
|
}
|
|
1390
1398
|
const ariaModal = ariaModalProp ?? (roleProp === "dialog" || roleProp === "alertdialog" ? true : void 0);
|
|
1391
|
-
const {
|
|
1399
|
+
const {
|
|
1400
|
+
className: overlayExtraClassName,
|
|
1401
|
+
onClick: overlayOnClick,
|
|
1402
|
+
...restOverlayProps
|
|
1403
|
+
} = overlayProps ?? {};
|
|
1392
1404
|
const overlayNode = shouldRenderDialog && scrim ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1393
1405
|
"div",
|
|
1394
1406
|
{
|
|
1395
1407
|
...restOverlayProps,
|
|
1396
1408
|
className: tailwindMerge.twMerge(overlayBaseClasses2, overlayClassName, overlayExtraClassName),
|
|
1409
|
+
onClick: (event) => {
|
|
1410
|
+
overlayOnClick?.(event);
|
|
1411
|
+
if (!event.defaultPrevented) {
|
|
1412
|
+
onClose?.();
|
|
1413
|
+
}
|
|
1414
|
+
},
|
|
1397
1415
|
"data-state": state,
|
|
1398
1416
|
"aria-hidden": true
|
|
1399
1417
|
}
|
|
1400
1418
|
) : null;
|
|
1419
|
+
const dialogNode = shouldRenderDialog ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1420
|
+
"div",
|
|
1421
|
+
{
|
|
1422
|
+
className: tailwindMerge.twMerge(containerBaseClasses, containerClassName),
|
|
1423
|
+
"data-state": state,
|
|
1424
|
+
"aria-hidden": !open,
|
|
1425
|
+
children: [
|
|
1426
|
+
overlayNode,
|
|
1427
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1428
|
+
"div",
|
|
1429
|
+
{
|
|
1430
|
+
className: tailwindMerge.twMerge(panelWrapperClasses, fullscreen ? "h-full items-stretch" : "mx-auto"),
|
|
1431
|
+
"data-state": state,
|
|
1432
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1433
|
+
"div",
|
|
1434
|
+
{
|
|
1435
|
+
...rest,
|
|
1436
|
+
ref: forwardedRef,
|
|
1437
|
+
id,
|
|
1438
|
+
role: roleProp,
|
|
1439
|
+
tabIndex,
|
|
1440
|
+
"aria-modal": ariaModal,
|
|
1441
|
+
className: tailwindMerge.twMerge(
|
|
1442
|
+
panelBaseClasses,
|
|
1443
|
+
fullscreen ? "h-full w-full max-w-none rounded-none" : void 0,
|
|
1444
|
+
className
|
|
1445
|
+
),
|
|
1446
|
+
style: resolvedStyle,
|
|
1447
|
+
"data-state": state,
|
|
1448
|
+
children
|
|
1449
|
+
}
|
|
1450
|
+
)
|
|
1451
|
+
}
|
|
1452
|
+
)
|
|
1453
|
+
]
|
|
1454
|
+
}
|
|
1455
|
+
) : null;
|
|
1456
|
+
const outputNode = portal && resolvedPortalContainer && dialogNode ? reactDom.createPortal(dialogNode, resolvedPortalContainer) : dialogNode;
|
|
1401
1457
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1402
1458
|
activator ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "inline-flex", children: activator }) : null,
|
|
1403
|
-
|
|
1404
|
-
"div",
|
|
1405
|
-
{
|
|
1406
|
-
className: tailwindMerge.twMerge(containerBaseClasses, containerClassName),
|
|
1407
|
-
"data-state": state,
|
|
1408
|
-
"aria-hidden": !open,
|
|
1409
|
-
children: [
|
|
1410
|
-
overlayNode,
|
|
1411
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1412
|
-
"div",
|
|
1413
|
-
{
|
|
1414
|
-
className: tailwindMerge.twMerge(
|
|
1415
|
-
panelWrapperClasses,
|
|
1416
|
-
fullscreen ? "h-full items-stretch" : "mx-auto"
|
|
1417
|
-
),
|
|
1418
|
-
"data-state": state,
|
|
1419
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1420
|
-
"div",
|
|
1421
|
-
{
|
|
1422
|
-
...rest,
|
|
1423
|
-
ref: forwardedRef,
|
|
1424
|
-
id,
|
|
1425
|
-
role: roleProp,
|
|
1426
|
-
tabIndex,
|
|
1427
|
-
"aria-modal": ariaModal,
|
|
1428
|
-
className: tailwindMerge.twMerge(
|
|
1429
|
-
panelBaseClasses,
|
|
1430
|
-
fullscreen ? "h-full w-full max-w-none rounded-none" : void 0,
|
|
1431
|
-
className
|
|
1432
|
-
),
|
|
1433
|
-
style: resolvedStyle,
|
|
1434
|
-
"data-state": state,
|
|
1435
|
-
children
|
|
1436
|
-
}
|
|
1437
|
-
)
|
|
1438
|
-
}
|
|
1439
|
-
)
|
|
1440
|
-
]
|
|
1441
|
-
}
|
|
1442
|
-
) : null
|
|
1459
|
+
outputNode
|
|
1443
1460
|
] });
|
|
1444
1461
|
});
|
|
1445
1462
|
Dialog.displayName = "Dialog";
|
|
@@ -2303,138 +2320,142 @@ var resolveIconClassName4 = (icon) => {
|
|
|
2303
2320
|
const classes = [...baseClasses, normalizedName];
|
|
2304
2321
|
return Array.from(new Set(classes)).join(" ");
|
|
2305
2322
|
};
|
|
2306
|
-
var Input = (
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
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
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
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
|
-
}
|
|
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";
|
|
2438
2459
|
var Input_default = Input;
|
|
2439
2460
|
|
|
2440
2461
|
// src/utils/helpers/randomStr.ts
|