@lindle/linoardo 1.0.36 → 1.0.38
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/{ExpansionPanelItem-BZHk28zn.d.ts → ExpansionPanelItem-CFm8a8R_.d.ts} +1 -1
- package/dist/{ExpansionPanelItem-Dln5DHGW.d.cts → ExpansionPanelItem-ufS2RIZf.d.cts} +1 -1
- package/dist/badge.d.cts +1 -1
- package/dist/badge.d.ts +1 -1
- package/dist/block.d.cts +1 -1
- package/dist/block.d.ts +1 -1
- package/dist/button.cjs +1 -0
- package/dist/button.cjs.map +1 -1
- package/dist/button.d.cts +1 -1
- package/dist/button.d.ts +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -5
- package/dist/card.cjs.map +1 -1
- package/dist/card.d.cts +1 -1
- package/dist/card.d.ts +1 -1
- package/dist/card.js +1 -1
- package/dist/chip.cjs +2 -2
- package/dist/chip.cjs.map +1 -1
- package/dist/chip.d.cts +4 -4
- package/dist/chip.d.ts +4 -4
- package/dist/chip.js +1 -1
- package/dist/{chunk-YRY7DJK2.js → chunk-5MVIF5GP.js} +10 -9
- package/dist/chunk-5MVIF5GP.js.map +1 -0
- package/dist/{chunk-F2G2JRKA.js → chunk-DIWGVTWO.js} +3 -2
- package/dist/chunk-DIWGVTWO.js.map +1 -0
- package/dist/chunk-GQVYBLWK.js +157 -0
- package/dist/chunk-GQVYBLWK.js.map +1 -0
- package/dist/{chunk-XPEOXO2T.js → chunk-HJFHZNOV.js} +4 -4
- package/dist/{chunk-XPEOXO2T.js.map → chunk-HJFHZNOV.js.map} +1 -1
- package/dist/{chunk-5WQW6YSJ.js → chunk-L4UUC4EF.js} +48 -16
- package/dist/chunk-L4UUC4EF.js.map +1 -0
- package/dist/{chunk-AK7LFJI4.js → chunk-NADLY6LM.js} +17 -26
- package/dist/chunk-NADLY6LM.js.map +1 -0
- package/dist/{chunk-5NWM6RVD.js → chunk-U4P2VJCV.js} +3 -7
- package/dist/chunk-U4P2VJCV.js.map +1 -0
- package/dist/expansion-panel/item.d.cts +2 -2
- package/dist/expansion-panel/item.d.ts +2 -2
- package/dist/expansion-panel.d.cts +3 -3
- package/dist/expansion-panel.d.ts +3 -3
- package/dist/{global.types-DJiKqSJa.d.cts → global.types-D-o85tuX.d.cts} +2 -2
- package/dist/{global.types-DJiKqSJa.d.ts → global.types-D-o85tuX.d.ts} +2 -2
- package/dist/hero.d.cts +1 -1
- package/dist/hero.d.ts +1 -1
- package/dist/icon.d.cts +1 -1
- package/dist/icon.d.ts +1 -1
- package/dist/{index-Ddkv_t7Y.d.cts → index-B7xZzSwm.d.cts} +1 -1
- package/dist/{index-BoPiZNIB.d.ts → index-BhfThlf0.d.ts} +1 -1
- package/dist/index.cjs +196 -160
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +32 -7
- package/dist/index.js.map +1 -1
- package/dist/input.d.cts +2 -2
- package/dist/input.d.ts +2 -2
- package/dist/list/item.cjs +46 -14
- package/dist/list/item.cjs.map +1 -1
- package/dist/list/item.d.cts +2 -2
- package/dist/list/item.d.ts +2 -2
- package/dist/list/item.js +1 -1
- package/dist/list.cjs +60 -37
- package/dist/list.cjs.map +1 -1
- package/dist/list.d.cts +8 -8
- package/dist/list.d.ts +8 -8
- package/dist/list.js +2 -2
- package/dist/notification.d.cts +1 -1
- package/dist/notification.d.ts +1 -1
- package/dist/profileCard.cjs +8 -6
- package/dist/profileCard.cjs.map +1 -1
- package/dist/profileCard.d.cts +2 -1
- package/dist/profileCard.d.ts +2 -1
- package/dist/profileCard.js +2 -2
- package/dist/select.cjs +106 -113
- package/dist/select.cjs.map +1 -1
- package/dist/select.d.cts +23 -17
- package/dist/select.d.ts +23 -17
- package/dist/select.js +2 -1
- package/dist/slider.d.cts +1 -1
- package/dist/slider.d.ts +1 -1
- package/dist/styles.css +174 -2
- package/dist/switch.d.cts +1 -1
- package/dist/switch.d.ts +1 -1
- package/dist/{types-CBIsqeyE.d.ts → types-CbQEphC3.d.ts} +1 -1
- package/dist/{types-B3b-GFjA.d.cts → types-DqPSePni.d.cts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-5NWM6RVD.js.map +0 -1
- package/dist/chunk-5WQW6YSJ.js.map +0 -1
- package/dist/chunk-AK7LFJI4.js.map +0 -1
- package/dist/chunk-BZVDAMMY.js +0 -164
- package/dist/chunk-BZVDAMMY.js.map +0 -1
- package/dist/chunk-F2G2JRKA.js.map +0 -1
- package/dist/chunk-YRY7DJK2.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -215,6 +215,7 @@ var Button = React4__namespace.forwardRef(
|
|
|
215
215
|
Component,
|
|
216
216
|
{
|
|
217
217
|
...rest,
|
|
218
|
+
type,
|
|
218
219
|
ref,
|
|
219
220
|
onClick,
|
|
220
221
|
disabled: isNativeButton ? isDisabled : void 0,
|
|
@@ -437,9 +438,9 @@ var Chip = React4.forwardRef(
|
|
|
437
438
|
onKeyDown: isInteractive ? handleKeyDown : onKeyDown,
|
|
438
439
|
children: [
|
|
439
440
|
filterAdornment,
|
|
440
|
-
prependIconClassName && /* @__PURE__ */ jsxRuntime.jsx("i", { className: tailwindMerge.twMerge("text-[
|
|
441
|
+
prependIconClassName && /* @__PURE__ */ jsxRuntime.jsx("i", { className: tailwindMerge.twMerge("text-[1.125em] leading-none", prependIconClassName), "aria-hidden": true }),
|
|
441
442
|
renderableChildren,
|
|
442
|
-
appendIconClassName && /* @__PURE__ */ jsxRuntime.jsx("i", { className: tailwindMerge.twMerge("text-[
|
|
443
|
+
appendIconClassName && /* @__PURE__ */ jsxRuntime.jsx("i", { className: tailwindMerge.twMerge("text-[1.125em] leading-none", appendIconClassName), "aria-hidden": true }),
|
|
443
444
|
closable && /* @__PURE__ */ jsxRuntime.jsx(
|
|
444
445
|
"button",
|
|
445
446
|
{
|
|
@@ -641,7 +642,7 @@ var Alert = ({ className, children, ...rest }) => {
|
|
|
641
642
|
] });
|
|
642
643
|
};
|
|
643
644
|
var Alert_default = Alert;
|
|
644
|
-
var listItemBaseClasses = "relative flex w-full items-center gap-4 bg-transparent text-left text-sm transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-white hover:bg-neutral-200";
|
|
645
|
+
var listItemBaseClasses = "relative flex w-full items-center gap-4 bg-transparent text-left text-sm transition-colors duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-white hover:bg-neutral-200 dark:focus-visible:ring-offset-gray-900 dark:hover:bg-white/5";
|
|
645
646
|
var densityClasses = {
|
|
646
647
|
default: "px-4 py-3 text-base",
|
|
647
648
|
comfortable: "px-4 py-2.5 text-sm",
|
|
@@ -653,14 +654,46 @@ var lineClasses = {
|
|
|
653
654
|
three: "min-h-[4.5rem]"
|
|
654
655
|
};
|
|
655
656
|
var accentClasses = {
|
|
656
|
-
primary: {
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
657
|
+
primary: {
|
|
658
|
+
text: "text-primary dark:text-primary",
|
|
659
|
+
bg: "bg-primary/10 dark:bg-primary/15",
|
|
660
|
+
indicator: "bg-primary"
|
|
661
|
+
},
|
|
662
|
+
neutral: {
|
|
663
|
+
text: "text-gray-900 dark:text-gray-100",
|
|
664
|
+
bg: "bg-gray-100 dark:bg-white/10",
|
|
665
|
+
indicator: "bg-gray-900 dark:bg-gray-100"
|
|
666
|
+
},
|
|
667
|
+
info: {
|
|
668
|
+
text: "text-sky-600 dark:text-sky-400",
|
|
669
|
+
bg: "bg-sky-50 dark:bg-sky-500/15",
|
|
670
|
+
indicator: "bg-sky-500"
|
|
671
|
+
},
|
|
672
|
+
success: {
|
|
673
|
+
text: "text-emerald-600 dark:text-emerald-400",
|
|
674
|
+
bg: "bg-emerald-50 dark:bg-emerald-500/15",
|
|
675
|
+
indicator: "bg-emerald-500"
|
|
676
|
+
},
|
|
677
|
+
warning: {
|
|
678
|
+
text: "text-amber-700 dark:text-amber-400",
|
|
679
|
+
bg: "bg-amber-50 dark:bg-amber-500/15",
|
|
680
|
+
indicator: "bg-amber-500"
|
|
681
|
+
},
|
|
682
|
+
danger: {
|
|
683
|
+
text: "text-red-600 dark:text-red-400",
|
|
684
|
+
bg: "bg-red-50 dark:bg-red-500/15",
|
|
685
|
+
indicator: "bg-red-500"
|
|
686
|
+
},
|
|
687
|
+
surface: {
|
|
688
|
+
text: "text-gray-900 dark:text-gray-100",
|
|
689
|
+
bg: "bg-gray-100 dark:bg-white/10",
|
|
690
|
+
indicator: "bg-gray-900 dark:bg-gray-100"
|
|
691
|
+
},
|
|
692
|
+
bw: {
|
|
693
|
+
text: "text-gray-900 dark:text-gray-100",
|
|
694
|
+
bg: "bg-gray-100 dark:bg-white/10",
|
|
695
|
+
indicator: "bg-gray-900 dark:bg-gray-100"
|
|
696
|
+
}
|
|
664
697
|
};
|
|
665
698
|
var ListItem = React4__namespace.forwardRef((props, ref) => {
|
|
666
699
|
const {
|
|
@@ -745,39 +778,39 @@ var ListItem = React4__namespace.forwardRef((props, ref) => {
|
|
|
745
778
|
)
|
|
746
779
|
}
|
|
747
780
|
),
|
|
748
|
-
prepend && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center text-base text-gray-500", children: prepend }),
|
|
781
|
+
prepend && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex h-10 w-10 shrink-0 items-center justify-center text-base text-gray-500 dark:text-gray-400", children: prepend }),
|
|
749
782
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col gap-0.5 text-left", children: [
|
|
750
|
-
overline && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.65rem] font-semibold uppercase tracking-wide text-gray-500", children: overline }),
|
|
783
|
+
overline && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[0.65rem] font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400", children: overline }),
|
|
751
784
|
title && /* @__PURE__ */ jsxRuntime.jsx(
|
|
752
785
|
"span",
|
|
753
786
|
{
|
|
754
787
|
className: tailwindMerge.twMerge(
|
|
755
|
-
"truncate font-medium text-gray-900",
|
|
788
|
+
"truncate font-medium text-gray-900 dark:text-gray-100",
|
|
756
789
|
active ? accent.text : void 0
|
|
757
790
|
),
|
|
758
791
|
children: title
|
|
759
792
|
}
|
|
760
793
|
),
|
|
761
|
-
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-500", children: subtitle }),
|
|
794
|
+
subtitle && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: subtitle }),
|
|
762
795
|
children
|
|
763
796
|
] }),
|
|
764
|
-
append && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto flex items-center gap-2 whitespace-nowrap text-sm text-gray-500", children: append })
|
|
797
|
+
append && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto flex items-center gap-2 whitespace-nowrap text-sm text-gray-500 dark:text-gray-400", children: append })
|
|
765
798
|
]
|
|
766
799
|
}
|
|
767
800
|
);
|
|
768
801
|
});
|
|
769
802
|
ListItem.displayName = "ListItem";
|
|
770
803
|
var Item_default = ListItem;
|
|
771
|
-
var listBaseClasses = "flex w-full min-w-0 flex-col text-gray-900 transition-colors duration-150";
|
|
804
|
+
var listBaseClasses = "flex w-full min-w-0 flex-col text-gray-900 transition-colors duration-150 dark:text-gray-100";
|
|
772
805
|
var listVariantClasses = {
|
|
773
|
-
solid: "bg-white border border-gray-200 shadow-sm shadow-gray-900/5",
|
|
774
|
-
sharp: "bg-white border border-gray-200 shadow-sm shadow-gray-900/5 rounded-none",
|
|
775
|
-
outline: "bg-transparent border border-gray-300",
|
|
776
|
-
ghost: "bg-gray-50 border border-transparent",
|
|
806
|
+
solid: "bg-white border border-gray-200 shadow-sm shadow-gray-900/5 dark:bg-gray-900 dark:border-gray-800 dark:shadow-black/20",
|
|
807
|
+
sharp: "bg-white border border-gray-200 shadow-sm shadow-gray-900/5 rounded-none dark:bg-gray-900 dark:border-gray-800 dark:shadow-black/20",
|
|
808
|
+
outline: "bg-transparent border border-gray-300 dark:border-gray-700",
|
|
809
|
+
ghost: "bg-gray-50 border border-transparent dark:bg-gray-900/60",
|
|
777
810
|
text: "bg-transparent border border-transparent",
|
|
778
|
-
filled: "bg-gray-50 border border-gray-200 shadow-inner shadow-gray-900/5",
|
|
779
|
-
underlined: "bg-transparent border border-transparent border-b border-gray-200 rounded-none",
|
|
780
|
-
rounded: "bg-white border border-gray-200 shadow-lg shadow-gray-900/10"
|
|
811
|
+
filled: "bg-gray-50 border border-gray-200 shadow-inner shadow-gray-900/5 dark:bg-gray-900/70 dark:border-gray-800 dark:shadow-black/30",
|
|
812
|
+
underlined: "bg-transparent border border-transparent border-b border-gray-200 rounded-none dark:border-gray-800",
|
|
813
|
+
rounded: "bg-white border border-gray-200 shadow-lg shadow-gray-900/10 dark:bg-gray-900 dark:border-gray-800 dark:shadow-black/30"
|
|
781
814
|
};
|
|
782
815
|
var listRoundedClasses = {
|
|
783
816
|
none: "rounded-none",
|
|
@@ -811,7 +844,7 @@ var List = React4__namespace.forwardRef((props, ref) => {
|
|
|
811
844
|
const isSharpVariant = variant === "sharp";
|
|
812
845
|
const variantClass = listVariantClasses[variant] ?? listVariantClasses.solid;
|
|
813
846
|
const roundedClass = isSharpVariant ? "rounded-none" : listRoundedClasses[rounded] ?? listRoundedClasses.lg;
|
|
814
|
-
const dividerClass = divided ? "divide-y divide-gray-100" : void 0;
|
|
847
|
+
const dividerClass = divided ? "divide-y divide-gray-100 dark:divide-gray-800" : void 0;
|
|
815
848
|
const gapClass = divided ? "p-0" : "gap-1 p-1";
|
|
816
849
|
const navClass = nav ? "py-1" : void 0;
|
|
817
850
|
const accentColor = color;
|
|
@@ -830,10 +863,7 @@ var List = React4__namespace.forwardRef((props, ref) => {
|
|
|
830
863
|
});
|
|
831
864
|
}
|
|
832
865
|
if (child.props && typeof child.props === "object" && "children" in child.props) {
|
|
833
|
-
const nestedChildren = React4__namespace.Children.map(
|
|
834
|
-
child.props.children,
|
|
835
|
-
enhanceChild
|
|
836
|
-
);
|
|
866
|
+
const nestedChildren = React4__namespace.Children.map(child.props.children, enhanceChild);
|
|
837
867
|
if (nestedChildren !== child.props.children) {
|
|
838
868
|
return React4__namespace.cloneElement(child, void 0, nestedChildren);
|
|
839
869
|
}
|
|
@@ -847,21 +877,15 @@ var List = React4__namespace.forwardRef((props, ref) => {
|
|
|
847
877
|
...rest,
|
|
848
878
|
ref,
|
|
849
879
|
role: role ?? "list",
|
|
850
|
-
className: tailwindMerge.twMerge(
|
|
851
|
-
listBaseClasses,
|
|
852
|
-
variantClass,
|
|
853
|
-
roundedClass,
|
|
854
|
-
dividerClass,
|
|
855
|
-
gapClass,
|
|
856
|
-
navClass,
|
|
857
|
-
className
|
|
858
|
-
),
|
|
880
|
+
className: tailwindMerge.twMerge(listBaseClasses, variantClass, roundedClass, dividerClass, gapClass, navClass, className),
|
|
859
881
|
children: resolvedChildren
|
|
860
882
|
}
|
|
861
883
|
);
|
|
862
884
|
});
|
|
863
885
|
List.displayName = "List";
|
|
864
|
-
var
|
|
886
|
+
var ListWithItem = List;
|
|
887
|
+
ListWithItem.Item = Item_default;
|
|
888
|
+
var List_default = ListWithItem;
|
|
865
889
|
var placementClasses = {
|
|
866
890
|
"bottom-start": "left-0 top-full origin-top-left",
|
|
867
891
|
bottom: "left-1/2 top-full -translate-x-1/2 origin-top",
|
|
@@ -1602,11 +1626,7 @@ var elevationClasses = {
|
|
|
1602
1626
|
3: "shadow-md",
|
|
1603
1627
|
4: "shadow-lg",
|
|
1604
1628
|
5: "shadow-xl",
|
|
1605
|
-
6: "shadow-2xl"
|
|
1606
|
-
7: "shadow-2xl",
|
|
1607
|
-
8: "shadow-2xl",
|
|
1608
|
-
9: "shadow-2xl",
|
|
1609
|
-
10: "shadow-2xl"
|
|
1629
|
+
6: "shadow-2xl"
|
|
1610
1630
|
};
|
|
1611
1631
|
var CardRoot = React4.forwardRef(function Card({ className, children, variant = "solid", padding = "md", overflow = "hidden", interactive = false, dividers = true, elevation = 0, ...rest }, ref) {
|
|
1612
1632
|
const variantClass = variantClasses[variant] ?? variantClasses.solid;
|
|
@@ -2110,11 +2130,7 @@ var elevationClasses2 = {
|
|
|
2110
2130
|
3: "shadow-md",
|
|
2111
2131
|
4: "shadow-lg",
|
|
2112
2132
|
5: "shadow-xl",
|
|
2113
|
-
6: "shadow-2xl"
|
|
2114
|
-
7: "shadow-2xl",
|
|
2115
|
-
8: "shadow-2xl",
|
|
2116
|
-
9: "shadow-2xl",
|
|
2117
|
-
10: "shadow-2xl"
|
|
2133
|
+
6: "shadow-2xl"
|
|
2118
2134
|
};
|
|
2119
2135
|
var cardRadiusMap = {
|
|
2120
2136
|
solid: "rounded-2xl",
|
|
@@ -2169,6 +2185,7 @@ var ProfileCard = ({
|
|
|
2169
2185
|
layout = "classic",
|
|
2170
2186
|
variant = "solid",
|
|
2171
2187
|
elevation = 0,
|
|
2188
|
+
interactive = false,
|
|
2172
2189
|
className,
|
|
2173
2190
|
...rest
|
|
2174
2191
|
}) => {
|
|
@@ -2179,6 +2196,8 @@ var ProfileCard = ({
|
|
|
2179
2196
|
const muted = dark ? "text-white/70" : "text-gray-600";
|
|
2180
2197
|
const accent = dark ? "text-white" : "text-gray-900";
|
|
2181
2198
|
const elevationClass = elevationClasses2[elevation] ?? elevationClasses2[0];
|
|
2199
|
+
const interactiveClass = interactive ? "transition-all duration-200 hover:-translate-y-0.5 hover:shadow-xl hover:z-10 focus-within:z-10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-offset-slate-900" : void 0;
|
|
2200
|
+
const tabIndexValue = interactive && rest.tabIndex === void 0 ? 0 : rest.tabIndex;
|
|
2182
2201
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2183
2202
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
2184
2203
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
@@ -2227,11 +2246,13 @@ var ProfileCard = ({
|
|
|
2227
2246
|
"article",
|
|
2228
2247
|
{
|
|
2229
2248
|
...rest,
|
|
2249
|
+
tabIndex: tabIndexValue,
|
|
2230
2250
|
className: tailwindMerge.twMerge(
|
|
2231
|
-
"profile-card relative overflow-hidden p-6 transition
|
|
2251
|
+
"profile-card relative overflow-hidden p-6 transition-colors",
|
|
2232
2252
|
baseVariant,
|
|
2233
2253
|
cardRadius,
|
|
2234
2254
|
elevationClass,
|
|
2255
|
+
interactiveClass,
|
|
2235
2256
|
className
|
|
2236
2257
|
),
|
|
2237
2258
|
children: layoutMap[layout] ?? layoutMap.classic
|
|
@@ -2879,7 +2900,7 @@ var variantClasses4 = {
|
|
|
2879
2900
|
text: "rounded-none border-0 border-b border-transparent pl-0 pr-10 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",
|
|
2880
2901
|
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",
|
|
2881
2902
|
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",
|
|
2882
|
-
underlined: "rounded-none border-0 border-b border-gray-300 pl-0 pr-10 bg-transparent focus-visible:border-primary focus-visible:ring-0 focus-visible:ring-transparent dark:border-b-gray-
|
|
2903
|
+
underlined: "rounded-none border-0 border-b border-gray-300 pl-0 pr-10 bg-transparent focus-visible:border-primary focus-visible:ring-0 focus-visible:ring-transparent dark:border-b-gray-300 dark:focus-visible:border-primary/70",
|
|
2883
2904
|
rounded: "rounded-full pl-4 pr-10 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"
|
|
2884
2905
|
};
|
|
2885
2906
|
var sizeClasses2 = {
|
|
@@ -2895,6 +2916,31 @@ var normalizeOption = (option) => {
|
|
|
2895
2916
|
}
|
|
2896
2917
|
return option;
|
|
2897
2918
|
};
|
|
2919
|
+
var resolveIconClassName5 = (icon) => {
|
|
2920
|
+
if (!icon) {
|
|
2921
|
+
return void 0;
|
|
2922
|
+
}
|
|
2923
|
+
if (typeof icon === "string") {
|
|
2924
|
+
const trimmed = icon.trim();
|
|
2925
|
+
if (!trimmed) {
|
|
2926
|
+
return void 0;
|
|
2927
|
+
}
|
|
2928
|
+
if (trimmed.includes(" ")) {
|
|
2929
|
+
return trimmed;
|
|
2930
|
+
}
|
|
2931
|
+
const normalizedName2 = trimmed.startsWith("mdi-") ? trimmed : `mdi-${trimmed}`;
|
|
2932
|
+
return ["mdi", normalizedName2].join(" ");
|
|
2933
|
+
}
|
|
2934
|
+
const [library, iconNameRaw] = icon;
|
|
2935
|
+
const baseClasses = iconBaseClasses[library] ?? [library];
|
|
2936
|
+
const iconName = iconNameRaw.trim();
|
|
2937
|
+
if (!iconName) {
|
|
2938
|
+
return baseClasses.join(" ");
|
|
2939
|
+
}
|
|
2940
|
+
const normalizedName = iconName.startsWith("mdi-") ? iconName : `mdi-${iconName}`;
|
|
2941
|
+
const classes = [...baseClasses, normalizedName];
|
|
2942
|
+
return Array.from(new Set(classes)).join(" ");
|
|
2943
|
+
};
|
|
2898
2944
|
var Select = ({
|
|
2899
2945
|
options,
|
|
2900
2946
|
label,
|
|
@@ -2906,124 +2952,92 @@ var Select = ({
|
|
|
2906
2952
|
id,
|
|
2907
2953
|
name,
|
|
2908
2954
|
multiple,
|
|
2909
|
-
onFocus,
|
|
2910
|
-
onBlur,
|
|
2911
|
-
onChange,
|
|
2912
2955
|
value,
|
|
2913
2956
|
defaultValue,
|
|
2957
|
+
error,
|
|
2958
|
+
helperText,
|
|
2959
|
+
disabled,
|
|
2960
|
+
required,
|
|
2961
|
+
onChange,
|
|
2914
2962
|
...props
|
|
2915
2963
|
}) => {
|
|
2916
2964
|
const selectId = id || name || generateString();
|
|
2917
|
-
const selectName = name || selectId;
|
|
2918
2965
|
const variantClass = variantClasses4[variant] ?? variantClasses4.outline;
|
|
2919
2966
|
const sizeConfig = sizeClasses2[size] ?? sizeClasses2.medium;
|
|
2920
2967
|
const sizeClass = `${sizeConfig.padding} ${sizeConfig.text}`;
|
|
2921
2968
|
const normalizedOptions = options.map(normalizeOption);
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
return;
|
|
2954
|
-
}
|
|
2955
|
-
if (Array.isArray(value)) {
|
|
2956
|
-
setHasValue(value.length > 0 ? String(value[0]).length > 0 : false);
|
|
2957
|
-
return;
|
|
2958
|
-
}
|
|
2959
|
-
setHasValue(String(value).length > 0);
|
|
2960
|
-
}, [isControlled, multiple, value]);
|
|
2961
|
-
const placeholderOptionLabel = hidePlaceholderUntilFocus && !isFocused ? " " : placeholderText;
|
|
2962
|
-
const shouldRenderPlaceholder = !multiple && placeholderText !== void 0;
|
|
2963
|
-
const labelShouldFloat = hasValue || isFocused;
|
|
2964
|
-
const labelLeftClass = "left-3";
|
|
2965
|
-
const labelBgDefault = ["outline", "text", "underlined"].includes(variant) ? "bg-transparent" : "bg-white/90 dark:bg-slate-900";
|
|
2966
|
-
const handleFocus = (event) => {
|
|
2967
|
-
if (hidePlaceholderUntilFocus) setIsFocused(true);
|
|
2968
|
-
onFocus?.(event);
|
|
2969
|
-
};
|
|
2970
|
-
const handleBlur = (event) => {
|
|
2971
|
-
if (hidePlaceholderUntilFocus) setIsFocused(false);
|
|
2972
|
-
onBlur?.(event);
|
|
2973
|
-
};
|
|
2974
|
-
const handleChange = (event) => {
|
|
2975
|
-
if (!isControlled) {
|
|
2976
|
-
const nextHasValue = multiple ? event.target.selectedOptions.length > 0 : event.target.value !== "";
|
|
2977
|
-
setHasValue(nextHasValue);
|
|
2978
|
-
}
|
|
2979
|
-
onChange?.(event);
|
|
2980
|
-
};
|
|
2981
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tailwindMerge.twMerge("flex flex-col gap-1", wrapperClassName), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex items-center", children: [
|
|
2982
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2983
|
-
"select",
|
|
2984
|
-
{
|
|
2985
|
-
...props,
|
|
2986
|
-
id: selectId,
|
|
2987
|
-
name: selectName,
|
|
2988
|
-
multiple,
|
|
2989
|
-
value,
|
|
2990
|
-
defaultValue: value === void 0 ? defaultValue : void 0,
|
|
2991
|
-
onFocus: handleFocus,
|
|
2992
|
-
onBlur: handleBlur,
|
|
2993
|
-
onChange: handleChange,
|
|
2994
|
-
className: tailwindMerge.twMerge("peer", baseClass2, variantClass, sizeClass, className),
|
|
2995
|
-
children: [
|
|
2996
|
-
shouldRenderPlaceholder && /* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: props.required, hidden: hasValue, children: placeholderOptionLabel }),
|
|
2997
|
-
normalizedOptions.map((option, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
2998
|
-
"option",
|
|
2969
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tailwindMerge.twMerge("flex flex-col gap-1", wrapperClassName), children: [
|
|
2970
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
2971
|
+
/* @__PURE__ */ jsxRuntime.jsxs("details", { className: "group w-full", ...props, open: void 0, children: [
|
|
2972
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2973
|
+
"summary",
|
|
2974
|
+
{
|
|
2975
|
+
className: tailwindMerge.twMerge(
|
|
2976
|
+
baseClass2,
|
|
2977
|
+
variantClass,
|
|
2978
|
+
sizeClass,
|
|
2979
|
+
"list-none cursor-pointer flex items-center justify-between pr-10 relative [&::-webkit-details-marker]:hidden",
|
|
2980
|
+
error && "border-red-500 focus-visible:border-red-500 focus-visible:ring-red-500",
|
|
2981
|
+
disabled && "pointer-events-none opacity-50 cursor-not-allowed",
|
|
2982
|
+
className
|
|
2983
|
+
),
|
|
2984
|
+
style: { minHeight: "2.75rem" },
|
|
2985
|
+
onClick: (e) => disabled && e.preventDefault(),
|
|
2986
|
+
children: [
|
|
2987
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: tailwindMerge.twMerge("truncate", !value && !defaultValue && "text-gray-500 dark:text-gray-400"), children: label || placeholder || "\xA0" }),
|
|
2988
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none absolute inset-y-0 right-3 flex items-center text-gray-500 dark:text-gray-300", children: /* @__PURE__ */ jsxRuntime.jsx("i", { className: "mdi mdi-chevron-down text-base leading-none transition-transform duration-200 group-open:rotate-180", "aria-hidden": true }) })
|
|
2989
|
+
]
|
|
2990
|
+
}
|
|
2991
|
+
),
|
|
2992
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute z-50 mt-1 max-h-60 w-full overflow-auto rounded-lg border border-gray-200 bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none dark:bg-slate-800 dark:border-slate-700", children: normalizedOptions.map((option, index) => {
|
|
2993
|
+
const optionValueStr = String(option.value);
|
|
2994
|
+
const isSelected = Array.isArray(value) ? value.map(String).includes(optionValueStr) : String(value) === optionValueStr;
|
|
2995
|
+
const isDefaultSelected = Array.isArray(defaultValue) ? defaultValue.map(String).includes(optionValueStr) : String(defaultValue) === optionValueStr;
|
|
2996
|
+
const iconClassName = resolveIconClassName5(option.icon);
|
|
2997
|
+
const inputId = `-opt-`;
|
|
2998
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2999
|
+
"label",
|
|
2999
3000
|
{
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3001
|
+
htmlFor: inputId,
|
|
3002
|
+
className: tailwindMerge.twMerge(
|
|
3003
|
+
"relative flex cursor-pointer select-none items-center gap-2 px-4 py-2 text-sm text-gray-900 hover:bg-gray-50 dark:text-gray-100 dark:hover:bg-slate-700",
|
|
3004
|
+
option.disabled && "cursor-not-allowed opacity-50"
|
|
3005
|
+
),
|
|
3006
|
+
children: [
|
|
3007
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3008
|
+
"input",
|
|
3009
|
+
{
|
|
3010
|
+
type: multiple ? "checkbox" : "radio",
|
|
3011
|
+
id: inputId,
|
|
3012
|
+
name: name || selectId,
|
|
3013
|
+
value: option.value,
|
|
3014
|
+
disabled: option.disabled || disabled,
|
|
3015
|
+
checked: value !== void 0 ? isSelected : void 0,
|
|
3016
|
+
defaultChecked: defaultValue !== void 0 ? isDefaultSelected : void 0,
|
|
3017
|
+
onChange,
|
|
3018
|
+
required: required && !multiple,
|
|
3019
|
+
className: "peer sr-only"
|
|
3020
|
+
}
|
|
3021
|
+
),
|
|
3022
|
+
iconClassName && /* @__PURE__ */ jsxRuntime.jsx("i", { className: tailwindMerge.twMerge(iconClassName, "text-lg text-gray-500 peer-checked:text-primary dark:text-gray-400") }),
|
|
3023
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 truncate peer-checked:font-medium peer-checked:text-primary", children: option.label }),
|
|
3024
|
+
/* @__PURE__ */ jsxRuntime.jsx("i", { className: "mdi mdi-check invisible ml-auto text-primary peer-checked:visible" })
|
|
3025
|
+
]
|
|
3003
3026
|
},
|
|
3004
|
-
`${
|
|
3005
|
-
)
|
|
3006
|
-
|
|
3007
|
-
}
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
"-top-1.5 left-1 text-xs px-1",
|
|
3019
|
-
isFocused ? "-translate-y-1/2 text-gray-600" : "-translate-y-2/3",
|
|
3020
|
-
labelBgDefault
|
|
3021
|
-
].join(" ") : "top-1/2 -translate-y-1/2 text-sm text-gray-500"
|
|
3022
|
-
),
|
|
3023
|
-
children: label
|
|
3024
|
-
}
|
|
3025
|
-
)
|
|
3026
|
-
] }) });
|
|
3027
|
+
`${option.value}-`
|
|
3028
|
+
);
|
|
3029
|
+
}) })
|
|
3030
|
+
] }),
|
|
3031
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
3032
|
+
"label",
|
|
3033
|
+
{
|
|
3034
|
+
className: tailwindMerge.twMerge("absolute left-3 -top-1.5 text-xs bg-white px-1 text-gray-500 transition-all dark:bg-slate-900 dark:text-gray-400"),
|
|
3035
|
+
children: label
|
|
3036
|
+
}
|
|
3037
|
+
)
|
|
3038
|
+
] }),
|
|
3039
|
+
helperText && /* @__PURE__ */ jsxRuntime.jsx("p", { className: tailwindMerge.twMerge("mt-1 text-xs text-gray-500", error && "text-red-500"), children: helperText })
|
|
3040
|
+
] });
|
|
3027
3041
|
};
|
|
3028
3042
|
var Select_default = Select;
|
|
3029
3043
|
var paletteValues = {
|
|
@@ -3445,7 +3459,7 @@ var resolveVariantClass3 = (variant, type) => {
|
|
|
3445
3459
|
return "bg-white/95 text-gray-900 border border-gray-200";
|
|
3446
3460
|
}
|
|
3447
3461
|
};
|
|
3448
|
-
var
|
|
3462
|
+
var resolveIconClassName6 = (icon) => {
|
|
3449
3463
|
if (!icon) return void 0;
|
|
3450
3464
|
if (typeof icon === "string") {
|
|
3451
3465
|
const trimmed = icon.trim();
|
|
@@ -3460,7 +3474,7 @@ var resolveIconClassName5 = (icon) => {
|
|
|
3460
3474
|
};
|
|
3461
3475
|
var resolveIconNode = (icon, fallbackClassName) => {
|
|
3462
3476
|
if (React4__namespace.isValidElement(icon)) return icon;
|
|
3463
|
-
const iconClassName =
|
|
3477
|
+
const iconClassName = resolveIconClassName6(icon) ?? fallbackClassName;
|
|
3464
3478
|
if (!iconClassName) return null;
|
|
3465
3479
|
const hasBase = iconClassName.split(" ").some((token) => token.trim() === "mdi");
|
|
3466
3480
|
const hasGlyph = iconClassName.includes("mdi-");
|
|
@@ -3590,6 +3604,27 @@ var Notification = ({
|
|
|
3590
3604
|
)) });
|
|
3591
3605
|
};
|
|
3592
3606
|
var Notification_default = Notification;
|
|
3607
|
+
var useNotification = (defaultMessage) => {
|
|
3608
|
+
const [messages, setMessages] = React4.useState([]);
|
|
3609
|
+
const clearNotifications = (key) => {
|
|
3610
|
+
setMessages((prev) => key ? prev.filter((notification) => notification.key !== key) : []);
|
|
3611
|
+
};
|
|
3612
|
+
const showNotification = (notification) => {
|
|
3613
|
+
const key = `${Date.now()}-${Math.random()}`;
|
|
3614
|
+
setMessages((prev) => [
|
|
3615
|
+
...prev,
|
|
3616
|
+
{
|
|
3617
|
+
duration: 4e3,
|
|
3618
|
+
onClose: () => clearNotifications(key),
|
|
3619
|
+
...defaultMessage,
|
|
3620
|
+
...notification,
|
|
3621
|
+
key
|
|
3622
|
+
}
|
|
3623
|
+
]);
|
|
3624
|
+
};
|
|
3625
|
+
return { messages, showNotification };
|
|
3626
|
+
};
|
|
3627
|
+
var useNotification_default = useNotification;
|
|
3593
3628
|
var clampPercent = (value) => {
|
|
3594
3629
|
if (value === void 0 || value === null || Number.isNaN(value)) {
|
|
3595
3630
|
return 0;
|
|
@@ -3920,5 +3955,6 @@ exports.Slider = Slider_default;
|
|
|
3920
3955
|
exports.Switch = Switch_default;
|
|
3921
3956
|
exports.TextArea = TextArea_default;
|
|
3922
3957
|
exports.ToolTip = ToolTip_default;
|
|
3958
|
+
exports.useNotification = useNotification_default;
|
|
3923
3959
|
//# sourceMappingURL=index.cjs.map
|
|
3924
3960
|
//# sourceMappingURL=index.cjs.map
|