@luxfi/ui 7.1.0 → 7.2.0
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/alert.cjs +22 -50
- package/dist/alert.js +22 -50
- package/dist/bank.d.cts +1 -1
- package/dist/bank.d.ts +1 -1
- package/dist/index.cjs +105 -172
- package/dist/index.js +105 -172
- package/dist/input.cjs +25 -36
- package/dist/input.js +25 -36
- package/dist/tag.cjs +15 -35
- package/dist/tag.js +15 -35
- package/dist/textarea.cjs +25 -36
- package/dist/textarea.js +25 -36
- package/package.json +1 -2
- package/src/alert.tsx +23 -51
- package/src/input.tsx +27 -36
- package/src/tag.tsx +17 -35
- package/src/textarea.tsx +27 -36
package/dist/index.js
CHANGED
|
@@ -5,7 +5,6 @@ import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
|
5
5
|
import * as React29 from 'react';
|
|
6
6
|
import React29__default from 'react';
|
|
7
7
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
|
-
import { cva } from 'class-variance-authority';
|
|
9
8
|
import { styled, View, Text } from '@hanzogui/core';
|
|
10
9
|
import * as RadixAvatar from '@radix-ui/react-avatar';
|
|
11
10
|
import { TooltipGroup, Tooltip as Tooltip$1 } from '@hanzogui/tooltip';
|
|
@@ -454,52 +453,22 @@ var SkeletonText = React29.forwardRef(
|
|
|
454
453
|
}
|
|
455
454
|
);
|
|
456
455
|
var IndicatorIcon2 = ({ className }) => /* @__PURE__ */ jsx("svg", { className, viewBox: "0 0 20 20", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm.75-11.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM9.25 10a.75.75 0 011.5 0v3a.75.75 0 01-1.5 0v-3z" }) });
|
|
457
|
-
var
|
|
458
|
-
|
|
459
|
-
"
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
},
|
|
474
|
-
defaultVariants: {
|
|
475
|
-
status: "info",
|
|
476
|
-
size: "md"
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
);
|
|
480
|
-
var alertContent = cva("flex flex-1", {
|
|
481
|
-
variants: {
|
|
482
|
-
inline: {
|
|
483
|
-
"true": "inline-flex flex-row items-center",
|
|
484
|
-
"false": "flex flex-col"
|
|
485
|
-
}
|
|
486
|
-
},
|
|
487
|
-
defaultVariants: {
|
|
488
|
-
inline: true
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
var INDICATOR_BASE = "inline-flex items-center justify-center shrink-0 w-5 h-5 text-[var(--color-alert-fg)] [&>svg]:w-full [&>svg]:h-full";
|
|
492
|
-
var indicatorVariants = cva(INDICATOR_BASE, {
|
|
493
|
-
variants: {
|
|
494
|
-
size: {
|
|
495
|
-
sm: "w-5 h-5 my-0",
|
|
496
|
-
md: "w-5 h-5 my-[2px]"
|
|
497
|
-
}
|
|
498
|
-
},
|
|
499
|
-
defaultVariants: {
|
|
500
|
-
size: "md"
|
|
501
|
-
}
|
|
502
|
-
});
|
|
456
|
+
var ALERT_BASE = "w-full flex items-start relative rounded text-[var(--color-alert-fg)]";
|
|
457
|
+
var STATUS_CLASSES = {
|
|
458
|
+
info: "bg-[var(--color-alert-bg-info)]",
|
|
459
|
+
warning: "bg-[var(--color-alert-bg-warning)]",
|
|
460
|
+
warning_table: "bg-[var(--color-alert-bg-warning-table)]",
|
|
461
|
+
success: "bg-[var(--color-alert-bg-success)]",
|
|
462
|
+
error: "bg-[var(--color-alert-bg-error)]"
|
|
463
|
+
};
|
|
464
|
+
var SIZE_CLASSES = {
|
|
465
|
+
sm: "gap-2 px-2 py-2 text-xs",
|
|
466
|
+
md: "gap-2 px-3 py-2 text-base"
|
|
467
|
+
};
|
|
468
|
+
var INDICATOR_SIZE_CLASSES = {
|
|
469
|
+
sm: "w-5 h-5 my-0",
|
|
470
|
+
md: "w-5 h-5 my-[2px]"
|
|
471
|
+
};
|
|
503
472
|
var Alert = React29.forwardRef(
|
|
504
473
|
function Alert2(props, ref) {
|
|
505
474
|
const {
|
|
@@ -535,7 +504,10 @@ var Alert = React29.forwardRef(
|
|
|
535
504
|
if (!showIcon && icon === void 0) {
|
|
536
505
|
return null;
|
|
537
506
|
}
|
|
538
|
-
return /* @__PURE__ */ jsx("span", { className:
|
|
507
|
+
return /* @__PURE__ */ jsx("span", { className: cn(
|
|
508
|
+
"inline-flex items-center justify-center shrink-0 text-[var(--color-alert-fg)] [&>svg]:w-full [&>svg]:h-full",
|
|
509
|
+
INDICATOR_SIZE_CLASSES[resolvedSize]
|
|
510
|
+
), children: icon || defaultIcon });
|
|
539
511
|
})();
|
|
540
512
|
const handleClose = React29.useCallback(() => {
|
|
541
513
|
setIsOpen(false);
|
|
@@ -568,12 +540,12 @@ var Alert = React29.forwardRef(
|
|
|
568
540
|
"div",
|
|
569
541
|
{
|
|
570
542
|
ref,
|
|
571
|
-
className: cn(
|
|
543
|
+
className: cn(ALERT_BASE, STATUS_CLASSES[status], SIZE_CLASSES[resolvedSize], className),
|
|
572
544
|
style: alertStyle,
|
|
573
545
|
...alertRest,
|
|
574
546
|
children: [
|
|
575
547
|
iconElement,
|
|
576
|
-
children ? /* @__PURE__ */ jsxs("div", { className:
|
|
548
|
+
children ? /* @__PURE__ */ jsxs("div", { className: cn("flex flex-1", inline ? "inline-flex flex-row items-center" : "flex flex-col"), children: [
|
|
577
549
|
title && /* @__PURE__ */ jsx("div", { className: "font-semibold", children: title }),
|
|
578
550
|
/* @__PURE__ */ jsx(
|
|
579
551
|
"div",
|
|
@@ -598,7 +570,7 @@ var Alert = React29.forwardRef(
|
|
|
598
570
|
) });
|
|
599
571
|
}
|
|
600
572
|
);
|
|
601
|
-
var
|
|
573
|
+
var SIZE_CLASSES2 = {
|
|
602
574
|
xs: "h-6 w-6 text-[10px]",
|
|
603
575
|
sm: "h-8 w-8 text-xs",
|
|
604
576
|
md: "h-10 w-10 text-sm",
|
|
@@ -643,7 +615,7 @@ var Avatar = React29.forwardRef(
|
|
|
643
615
|
ref,
|
|
644
616
|
className: cn(
|
|
645
617
|
"relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full align-middle",
|
|
646
|
-
|
|
618
|
+
SIZE_CLASSES2[size],
|
|
647
619
|
VARIANT_CLASSES[variant],
|
|
648
620
|
!isBorderless && "ring-2 ring-white dark:ring-gray-900",
|
|
649
621
|
className
|
|
@@ -851,7 +823,7 @@ function TruncatedTextTooltip({ label, children }) {
|
|
|
851
823
|
return /* @__PURE__ */ jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
|
|
852
824
|
}
|
|
853
825
|
var BASE_CLASSES = "inline-flex items-center rounded-sm gap-1 font-medium w-fit max-w-full whitespace-nowrap select-text";
|
|
854
|
-
var
|
|
826
|
+
var SIZE_CLASSES3 = {
|
|
855
827
|
sm: "text-xs p-1 h-[18px] min-h-[18px]",
|
|
856
828
|
md: "text-sm px-1 py-0.5 min-h-6",
|
|
857
829
|
lg: "text-sm px-2 py-1 min-h-7 font-semibold"
|
|
@@ -921,7 +893,7 @@ var Badge = React29__default.forwardRef(
|
|
|
921
893
|
ref,
|
|
922
894
|
className: cn(
|
|
923
895
|
BASE_CLASSES,
|
|
924
|
-
|
|
896
|
+
SIZE_CLASSES3[size],
|
|
925
897
|
COLOR_PALETTE_CLASSES[colorPalette],
|
|
926
898
|
className
|
|
927
899
|
),
|
|
@@ -1221,7 +1193,7 @@ var Button = React29.forwardRef(
|
|
|
1221
1193
|
return button;
|
|
1222
1194
|
}
|
|
1223
1195
|
);
|
|
1224
|
-
var
|
|
1196
|
+
var SIZE_CLASSES4 = {
|
|
1225
1197
|
"2xs": "px-2 h-5 min-w-5 text-xs rounded-sm gap-1",
|
|
1226
1198
|
xs: "px-2 h-6 min-w-6 text-sm rounded-sm gap-1",
|
|
1227
1199
|
sm: "px-3 h-8 min-w-8 text-sm rounded-md gap-1",
|
|
@@ -1230,7 +1202,7 @@ var SIZE_CLASSES3 = {
|
|
|
1230
1202
|
function buttonVariants(opts) {
|
|
1231
1203
|
const v = opts?.variant ?? "solid";
|
|
1232
1204
|
const s = opts?.size ?? "md";
|
|
1233
|
-
return [BASE_CLASSES2, VARIANT_CLASSES2[v] ?? "",
|
|
1205
|
+
return [BASE_CLASSES2, VARIANT_CLASSES2[v] ?? "", SIZE_CLASSES4[s] ?? ""].filter(Boolean).join(" ");
|
|
1234
1206
|
}
|
|
1235
1207
|
var ButtonGroup = React29.forwardRef(
|
|
1236
1208
|
function ButtonGroup2(props, ref) {
|
|
@@ -1347,7 +1319,7 @@ var CheckboxGroupBase = React29.forwardRef(
|
|
|
1347
1319
|
}
|
|
1348
1320
|
);
|
|
1349
1321
|
var CheckboxGroup2 = CheckboxGroupBase;
|
|
1350
|
-
var
|
|
1322
|
+
var SIZE_CLASSES5 = {
|
|
1351
1323
|
sm: {
|
|
1352
1324
|
root: "gap-1.5",
|
|
1353
1325
|
control: "h-3.5 w-3.5 rounded-sm",
|
|
@@ -1457,7 +1429,7 @@ var CheckboxBase = React29.forwardRef(
|
|
|
1457
1429
|
},
|
|
1458
1430
|
[readOnly, isControlled, isInGroup, group, value, onCheckedChange, onChange]
|
|
1459
1431
|
);
|
|
1460
|
-
const sizeClasses2 =
|
|
1432
|
+
const sizeClasses2 = SIZE_CLASSES5[size];
|
|
1461
1433
|
return /* @__PURE__ */ jsxs(
|
|
1462
1434
|
"label",
|
|
1463
1435
|
{
|
|
@@ -2153,7 +2125,7 @@ var PLACEMENT_CLASSES = {
|
|
|
2153
2125
|
"data-[state=closed]:animate-out data-[state=closed]:slide-out-to-bottom"
|
|
2154
2126
|
].join(" ")
|
|
2155
2127
|
};
|
|
2156
|
-
var
|
|
2128
|
+
var SIZE_CLASSES6 = {
|
|
2157
2129
|
right: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
|
|
2158
2130
|
left: { xs: "w-60", sm: "w-80", md: "w-96", lg: "w-[480px]", xl: "w-[640px]", full: "w-screen" },
|
|
2159
2131
|
top: { xs: "h-40", sm: "h-60", md: "h-80", lg: "h-96", xl: "h-[480px]", full: "h-screen" },
|
|
@@ -2182,7 +2154,7 @@ var DrawerContent = React29.forwardRef(
|
|
|
2182
2154
|
className: cn(
|
|
2183
2155
|
"fixed z-50 flex flex-col bg-[var(--color-drawer-bg)] shadow-[var(--shadow-drawer)] duration-300",
|
|
2184
2156
|
PLACEMENT_CLASSES[placement] ?? PLACEMENT_CLASSES.right,
|
|
2185
|
-
|
|
2157
|
+
SIZE_CLASSES6[placement]?.[size] ?? SIZE_CLASSES6.right?.md,
|
|
2186
2158
|
className
|
|
2187
2159
|
),
|
|
2188
2160
|
...rest,
|
|
@@ -2806,46 +2778,36 @@ var Image2 = React29__default.forwardRef(
|
|
|
2806
2778
|
] });
|
|
2807
2779
|
}
|
|
2808
2780
|
);
|
|
2809
|
-
var
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
2833
|
-
unstyled: "border-0 bg-transparent p-0 h-auto"
|
|
2834
|
-
}
|
|
2835
|
-
},
|
|
2836
|
-
defaultVariants: {
|
|
2837
|
-
size: "md",
|
|
2838
|
-
variant: "outline"
|
|
2839
|
-
}
|
|
2840
|
-
}
|
|
2841
|
-
);
|
|
2781
|
+
var INPUT_BASE = [
|
|
2782
|
+
"w-full appearance-none outline-none transition-colors",
|
|
2783
|
+
"bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]",
|
|
2784
|
+
"placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]",
|
|
2785
|
+
"hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]",
|
|
2786
|
+
"focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]",
|
|
2787
|
+
"focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]",
|
|
2788
|
+
"disabled:opacity-40 disabled:cursor-not-allowed",
|
|
2789
|
+
"read-only:opacity-70",
|
|
2790
|
+
"data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]"
|
|
2791
|
+
].join(" ");
|
|
2792
|
+
var INPUT_SIZE_CLASSES = {
|
|
2793
|
+
xs: "h-6 px-2 text-xs rounded",
|
|
2794
|
+
sm: "h-8 px-3 text-sm rounded-md",
|
|
2795
|
+
md: "h-10 px-4 text-base rounded-md",
|
|
2796
|
+
lg: "h-12 px-4 text-lg rounded-lg",
|
|
2797
|
+
"2xl": "h-14 px-4 text-xl rounded-lg"
|
|
2798
|
+
};
|
|
2799
|
+
var INPUT_VARIANT_CLASSES = {
|
|
2800
|
+
outline: "border border-solid",
|
|
2801
|
+
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
2802
|
+
unstyled: "border-0 bg-transparent p-0 h-auto"
|
|
2803
|
+
};
|
|
2842
2804
|
var Input = React29__default.forwardRef(
|
|
2843
|
-
({ size, variant, className, ...rest }, ref) => {
|
|
2805
|
+
({ size = "md", variant = "outline", className, ...rest }, ref) => {
|
|
2844
2806
|
return /* @__PURE__ */ jsx(
|
|
2845
2807
|
"input",
|
|
2846
2808
|
{
|
|
2847
2809
|
ref,
|
|
2848
|
-
className: cn(
|
|
2810
|
+
className: cn(INPUT_BASE, INPUT_SIZE_CLASSES[size], INPUT_VARIANT_CLASSES[variant], className),
|
|
2849
2811
|
...rest
|
|
2850
2812
|
}
|
|
2851
2813
|
);
|
|
@@ -3228,7 +3190,7 @@ var MenuTriggerItem = React29.forwardRef(function MenuTriggerItem2(props, ref) {
|
|
|
3228
3190
|
}
|
|
3229
3191
|
) });
|
|
3230
3192
|
});
|
|
3231
|
-
var
|
|
3193
|
+
var INPUT_BASE2 = [
|
|
3232
3194
|
"w-10 h-10",
|
|
3233
3195
|
"text-center text-sm font-medium",
|
|
3234
3196
|
"border-2 rounded-md",
|
|
@@ -3359,7 +3321,7 @@ var PinInput = React29.forwardRef(
|
|
|
3359
3321
|
"aria-invalid": invalid || void 0,
|
|
3360
3322
|
value: values[index] || "",
|
|
3361
3323
|
className: cn(
|
|
3362
|
-
|
|
3324
|
+
INPUT_BASE2,
|
|
3363
3325
|
values[index] && INPUT_FILLED,
|
|
3364
3326
|
invalid && INPUT_INVALID,
|
|
3365
3327
|
attached && index > 0 && "-ml-0.5"
|
|
@@ -3610,7 +3572,7 @@ var PopoverDescription = React29.forwardRef(function PopoverDescription2(props,
|
|
|
3610
3572
|
}
|
|
3611
3573
|
);
|
|
3612
3574
|
});
|
|
3613
|
-
var
|
|
3575
|
+
var SIZE_CLASSES7 = {
|
|
3614
3576
|
sm: "h-1",
|
|
3615
3577
|
md: "h-2",
|
|
3616
3578
|
lg: "h-3",
|
|
@@ -3668,7 +3630,7 @@ var Progress = React29.forwardRef(
|
|
|
3668
3630
|
className: cn(
|
|
3669
3631
|
"w-full overflow-hidden rounded-full",
|
|
3670
3632
|
"bg-[var(--color-progress-track)]",
|
|
3671
|
-
|
|
3633
|
+
SIZE_CLASSES7[size],
|
|
3672
3634
|
trackProps?.className
|
|
3673
3635
|
),
|
|
3674
3636
|
style: trackStyle,
|
|
@@ -3807,7 +3769,7 @@ var ProgressCircleValueText = React29.forwardRef(function ProgressCircleValueTex
|
|
|
3807
3769
|
}
|
|
3808
3770
|
);
|
|
3809
3771
|
});
|
|
3810
|
-
var
|
|
3772
|
+
var SIZE_CLASSES8 = {
|
|
3811
3773
|
xs: {
|
|
3812
3774
|
root: "gap-1.5",
|
|
3813
3775
|
control: "h-3 w-3",
|
|
@@ -3888,7 +3850,7 @@ var RadioBase = React29.forwardRef(
|
|
|
3888
3850
|
function Radio(props, ref) {
|
|
3889
3851
|
const { children, inputProps, rootRef, value, disabled, className, ...rest } = props;
|
|
3890
3852
|
const size = React29.useContext(RadioSizeContext);
|
|
3891
|
-
const sizeClasses2 =
|
|
3853
|
+
const sizeClasses2 = SIZE_CLASSES8[size];
|
|
3892
3854
|
return /* @__PURE__ */ jsxs(
|
|
3893
3855
|
"label",
|
|
3894
3856
|
{
|
|
@@ -4546,7 +4508,7 @@ function SliderMarks(props) {
|
|
|
4546
4508
|
}
|
|
4547
4509
|
var NOOP3 = () => {
|
|
4548
4510
|
};
|
|
4549
|
-
var
|
|
4511
|
+
var SIZE_CLASSES9 = {
|
|
4550
4512
|
sm: {
|
|
4551
4513
|
root: "h-4 w-7",
|
|
4552
4514
|
thumb: "h-3 w-3 data-[state=checked]:translate-x-3",
|
|
@@ -4596,7 +4558,7 @@ var SwitchBase = React29.forwardRef(
|
|
|
4596
4558
|
},
|
|
4597
4559
|
[isControlled, onCheckedChange]
|
|
4598
4560
|
);
|
|
4599
|
-
const sizeClasses2 =
|
|
4561
|
+
const sizeClasses2 = SIZE_CLASSES9[size];
|
|
4600
4562
|
const isRtl = direction === "rtl";
|
|
4601
4563
|
return /* @__PURE__ */ jsxs(
|
|
4602
4564
|
"label",
|
|
@@ -5281,39 +5243,18 @@ var nbsp = String.fromCharCode(160);
|
|
|
5281
5243
|
function TruncatedTextTooltip2({ label, children }) {
|
|
5282
5244
|
return /* @__PURE__ */ jsx(Tooltip, { content: label, positioning: { placement: "top" }, children });
|
|
5283
5245
|
}
|
|
5284
|
-
var
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
"hover:opacity-76"
|
|
5297
|
-
].join(" "),
|
|
5298
|
-
filter: "bg-[var(--color-tag-filter-bg)]",
|
|
5299
|
-
select: [
|
|
5300
|
-
"cursor-pointer",
|
|
5301
|
-
"bg-[var(--color-tag-select-bg)] text-[var(--color-tag-select-fg)]",
|
|
5302
|
-
"hover:text-[var(--color-hover)] hover:opacity-76"
|
|
5303
|
-
].join(" ")
|
|
5304
|
-
},
|
|
5305
|
-
size: {
|
|
5306
|
-
sm: "px-1 py-0.5 min-h-5 gap-1 text-xs",
|
|
5307
|
-
md: "px-1 py-0.5 min-h-6 gap-1 text-sm",
|
|
5308
|
-
lg: "px-1.5 py-1.5 min-h-8 min-w-8 gap-1 text-sm"
|
|
5309
|
-
}
|
|
5310
|
-
},
|
|
5311
|
-
defaultVariants: {
|
|
5312
|
-
variant: "subtle",
|
|
5313
|
-
size: "md"
|
|
5314
|
-
}
|
|
5315
|
-
}
|
|
5316
|
-
);
|
|
5246
|
+
var TAG_BASE = "inline-flex items-center align-top max-w-full select-text rounded-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-500";
|
|
5247
|
+
var TAG_VARIANT_CLASSES = {
|
|
5248
|
+
subtle: "bg-[var(--color-tag-subtle-bg)] text-[var(--color-tag-subtle-fg)]",
|
|
5249
|
+
clickable: "cursor-pointer bg-[var(--color-tag-clickable-bg)] text-[var(--color-tag-clickable-fg)] hover:opacity-76",
|
|
5250
|
+
filter: "bg-[var(--color-tag-filter-bg)]",
|
|
5251
|
+
select: "cursor-pointer bg-[var(--color-tag-select-bg)] text-[var(--color-tag-select-fg)] hover:text-[var(--color-hover)] hover:opacity-76"
|
|
5252
|
+
};
|
|
5253
|
+
var TAG_SIZE_CLASSES = {
|
|
5254
|
+
sm: "px-1 py-0.5 min-h-5 gap-1 text-xs",
|
|
5255
|
+
md: "px-1 py-0.5 min-h-6 gap-1 text-sm",
|
|
5256
|
+
lg: "px-1.5 py-1.5 min-h-8 min-w-8 gap-1 text-sm"
|
|
5257
|
+
};
|
|
5317
5258
|
var TAG_SELECTED_CLASSES = [
|
|
5318
5259
|
"bg-[var(--color-tag-select-selected-bg)]",
|
|
5319
5260
|
"text-[var(--color-tag-select-selected-fg)]",
|
|
@@ -5355,7 +5296,9 @@ var Tag = React29.forwardRef(
|
|
|
5355
5296
|
{
|
|
5356
5297
|
ref,
|
|
5357
5298
|
className: cn(
|
|
5358
|
-
|
|
5299
|
+
TAG_BASE,
|
|
5300
|
+
TAG_VARIANT_CLASSES[variant ?? "subtle"],
|
|
5301
|
+
TAG_SIZE_CLASSES[size ?? "md"],
|
|
5359
5302
|
selected && !loading && TAG_SELECTED_CLASSES,
|
|
5360
5303
|
disabled && TAG_DISABLED_CLASSES,
|
|
5361
5304
|
className
|
|
@@ -5383,46 +5326,36 @@ var Tag = React29.forwardRef(
|
|
|
5383
5326
|
) });
|
|
5384
5327
|
}
|
|
5385
5328
|
);
|
|
5386
|
-
var
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
5410
|
-
unstyled: "border-0 bg-transparent p-0"
|
|
5411
|
-
}
|
|
5412
|
-
},
|
|
5413
|
-
defaultVariants: {
|
|
5414
|
-
size: "md",
|
|
5415
|
-
variant: "outline"
|
|
5416
|
-
}
|
|
5417
|
-
}
|
|
5418
|
-
);
|
|
5329
|
+
var TEXTAREA_BASE = [
|
|
5330
|
+
"w-full appearance-none outline-none transition-colors resize-y",
|
|
5331
|
+
"bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]",
|
|
5332
|
+
"placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]",
|
|
5333
|
+
"hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]",
|
|
5334
|
+
"focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]",
|
|
5335
|
+
"focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]",
|
|
5336
|
+
"disabled:opacity-40 disabled:cursor-not-allowed",
|
|
5337
|
+
"read-only:opacity-70",
|
|
5338
|
+
"data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]"
|
|
5339
|
+
].join(" ");
|
|
5340
|
+
var TEXTAREA_SIZE_CLASSES = {
|
|
5341
|
+
xs: "px-2 py-1 text-xs rounded",
|
|
5342
|
+
sm: "px-3 py-2 text-sm rounded-md",
|
|
5343
|
+
md: "px-4 py-2 text-base rounded-md",
|
|
5344
|
+
lg: "px-4 py-3 text-lg rounded-lg",
|
|
5345
|
+
"2xl": "px-4 py-3 text-xl rounded-lg"
|
|
5346
|
+
};
|
|
5347
|
+
var TEXTAREA_VARIANT_CLASSES = {
|
|
5348
|
+
outline: "border border-solid",
|
|
5349
|
+
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
5350
|
+
unstyled: "border-0 bg-transparent p-0"
|
|
5351
|
+
};
|
|
5419
5352
|
var Textarea = React29__default.forwardRef(
|
|
5420
|
-
({ size, variant, className, ...rest }, ref) => {
|
|
5353
|
+
({ size = "md", variant = "outline", className, ...rest }, ref) => {
|
|
5421
5354
|
return /* @__PURE__ */ jsx(
|
|
5422
5355
|
"textarea",
|
|
5423
5356
|
{
|
|
5424
5357
|
ref,
|
|
5425
|
-
className: cn(
|
|
5358
|
+
className: cn(TEXTAREA_BASE, TEXTAREA_SIZE_CLASSES[size], TEXTAREA_VARIANT_CLASSES[variant], className),
|
|
5426
5359
|
...rest
|
|
5427
5360
|
}
|
|
5428
5361
|
);
|
package/dist/input.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var classVarianceAuthority = require('class-variance-authority');
|
|
5
4
|
var React = require('react');
|
|
6
5
|
var clsx = require('clsx');
|
|
7
6
|
var tailwindMerge = require('tailwind-merge');
|
|
@@ -15,46 +14,36 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
15
14
|
function cn(...inputs) {
|
|
16
15
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
17
16
|
}
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
42
|
-
unstyled: "border-0 bg-transparent p-0 h-auto"
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
defaultVariants: {
|
|
46
|
-
size: "md",
|
|
47
|
-
variant: "outline"
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
);
|
|
17
|
+
var INPUT_BASE = [
|
|
18
|
+
"w-full appearance-none outline-none transition-colors",
|
|
19
|
+
"bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]",
|
|
20
|
+
"placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]",
|
|
21
|
+
"hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]",
|
|
22
|
+
"focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]",
|
|
23
|
+
"focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]",
|
|
24
|
+
"disabled:opacity-40 disabled:cursor-not-allowed",
|
|
25
|
+
"read-only:opacity-70",
|
|
26
|
+
"data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]"
|
|
27
|
+
].join(" ");
|
|
28
|
+
var INPUT_SIZE_CLASSES = {
|
|
29
|
+
xs: "h-6 px-2 text-xs rounded",
|
|
30
|
+
sm: "h-8 px-3 text-sm rounded-md",
|
|
31
|
+
md: "h-10 px-4 text-base rounded-md",
|
|
32
|
+
lg: "h-12 px-4 text-lg rounded-lg",
|
|
33
|
+
"2xl": "h-14 px-4 text-xl rounded-lg"
|
|
34
|
+
};
|
|
35
|
+
var INPUT_VARIANT_CLASSES = {
|
|
36
|
+
outline: "border border-solid",
|
|
37
|
+
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
38
|
+
unstyled: "border-0 bg-transparent p-0 h-auto"
|
|
39
|
+
};
|
|
51
40
|
var Input = React__default.default.forwardRef(
|
|
52
|
-
({ size, variant, className, ...rest }, ref) => {
|
|
41
|
+
({ size = "md", variant = "outline", className, ...rest }, ref) => {
|
|
53
42
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
54
43
|
"input",
|
|
55
44
|
{
|
|
56
45
|
ref,
|
|
57
|
-
className: cn(
|
|
46
|
+
className: cn(INPUT_BASE, INPUT_SIZE_CLASSES[size], INPUT_VARIANT_CLASSES[variant], className),
|
|
58
47
|
...rest
|
|
59
48
|
}
|
|
60
49
|
);
|
package/dist/input.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { cva } from 'class-variance-authority';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { clsx } from 'clsx';
|
|
5
4
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -9,46 +8,36 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
9
8
|
function cn(...inputs) {
|
|
10
9
|
return twMerge(clsx(inputs));
|
|
11
10
|
}
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
36
|
-
unstyled: "border-0 bg-transparent p-0 h-auto"
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
defaultVariants: {
|
|
40
|
-
size: "md",
|
|
41
|
-
variant: "outline"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
);
|
|
11
|
+
var INPUT_BASE = [
|
|
12
|
+
"w-full appearance-none outline-none transition-colors",
|
|
13
|
+
"bg-[var(--color-input-bg)] text-[var(--color-input-fg)] border-[var(--color-input-border)]",
|
|
14
|
+
"placeholder:text-[var(--color-input-placeholder,theme(colors.gray.400))]",
|
|
15
|
+
"hover:border-[var(--color-input-border-hover,theme(colors.gray.400))]",
|
|
16
|
+
"focus:border-[var(--color-input-border-focus,theme(colors.blue.500))]",
|
|
17
|
+
"focus:placeholder:text-[var(--color-input-placeholder-focus,theme(colors.gray.300))]",
|
|
18
|
+
"disabled:opacity-40 disabled:cursor-not-allowed",
|
|
19
|
+
"read-only:opacity-70",
|
|
20
|
+
"data-[invalid]:border-[var(--color-input-border-invalid,theme(colors.red.500))]"
|
|
21
|
+
].join(" ");
|
|
22
|
+
var INPUT_SIZE_CLASSES = {
|
|
23
|
+
xs: "h-6 px-2 text-xs rounded",
|
|
24
|
+
sm: "h-8 px-3 text-sm rounded-md",
|
|
25
|
+
md: "h-10 px-4 text-base rounded-md",
|
|
26
|
+
lg: "h-12 px-4 text-lg rounded-lg",
|
|
27
|
+
"2xl": "h-14 px-4 text-xl rounded-lg"
|
|
28
|
+
};
|
|
29
|
+
var INPUT_VARIANT_CLASSES = {
|
|
30
|
+
outline: "border border-solid",
|
|
31
|
+
filled: "border-0 bg-[var(--color-input-filled-bg,theme(colors.gray.100))]",
|
|
32
|
+
unstyled: "border-0 bg-transparent p-0 h-auto"
|
|
33
|
+
};
|
|
45
34
|
var Input = React.forwardRef(
|
|
46
|
-
({ size, variant, className, ...rest }, ref) => {
|
|
35
|
+
({ size = "md", variant = "outline", className, ...rest }, ref) => {
|
|
47
36
|
return /* @__PURE__ */ jsx(
|
|
48
37
|
"input",
|
|
49
38
|
{
|
|
50
39
|
ref,
|
|
51
|
-
className: cn(
|
|
40
|
+
className: cn(INPUT_BASE, INPUT_SIZE_CLASSES[size], INPUT_VARIANT_CLASSES[variant], className),
|
|
52
41
|
...rest
|
|
53
42
|
}
|
|
54
43
|
);
|