@lolmath/ui 2.6.0 → 2.8.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/index.cjs +163 -43
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -3
- package/dist/index.d.ts +14 -3
- package/dist/index.js +158 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(src_exports, {
|
|
|
25
25
|
AccordionItem: () => AccordionItem,
|
|
26
26
|
AccordionTrigger: () => AccordionTrigger,
|
|
27
27
|
Button: () => Button,
|
|
28
|
+
Card: () => Card,
|
|
28
29
|
Checkbox: () => Checkbox,
|
|
29
30
|
DialogButtons: () => DialogButtons,
|
|
30
31
|
DialogTrigger: () => DialogTrigger,
|
|
@@ -47,7 +48,10 @@ __export(src_exports, {
|
|
|
47
48
|
TabPanel: () => TabPanel,
|
|
48
49
|
Tabs: () => Tabs,
|
|
49
50
|
TextArea: () => TextArea,
|
|
50
|
-
TextField: () => TextField
|
|
51
|
+
TextField: () => TextField,
|
|
52
|
+
Tooltip: () => Tooltip,
|
|
53
|
+
TooltipTrigger: () => import_react_aria_components16.TooltipTrigger,
|
|
54
|
+
borderInverted: () => borderInverted
|
|
51
55
|
});
|
|
52
56
|
module.exports = __toCommonJS(src_exports);
|
|
53
57
|
|
|
@@ -57,10 +61,10 @@ var import_react_aria_components = require("react-aria-components");
|
|
|
57
61
|
var import_tailwind_merge = require("tailwind-merge");
|
|
58
62
|
|
|
59
63
|
// src/utilities/border.tsx
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
+
var borderGradient = "from-[#785b28] via-[#c89c3c] to-[#c8aa6e] bg-gradient-to-t";
|
|
65
|
+
var borderGradientHover = "from-[#c89c3c] via-[#dcc188] to-[#f0e6d8]";
|
|
66
|
+
var borderGradientPressed = "from-lol-gold-600 via-lol-gold-600 to-lol-gold-700";
|
|
67
|
+
var borderGradientDisabled = "from-[#5c5b57] via-[#5c5b57] to-[#5c5b57]";
|
|
64
68
|
|
|
65
69
|
// src/utilities/resolve-classname.ts
|
|
66
70
|
function resolveClassname(className, values) {
|
|
@@ -69,7 +73,14 @@ function resolveClassname(className, values) {
|
|
|
69
73
|
|
|
70
74
|
// src/components/button.tsx
|
|
71
75
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
72
|
-
function _Button({
|
|
76
|
+
function _Button({
|
|
77
|
+
children,
|
|
78
|
+
className,
|
|
79
|
+
priority = "secondary",
|
|
80
|
+
isRounded = false,
|
|
81
|
+
isSquared = false,
|
|
82
|
+
...props
|
|
83
|
+
}, ref) {
|
|
73
84
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
85
|
import_react_aria_components.Button,
|
|
75
86
|
{
|
|
@@ -77,13 +88,18 @@ function _Button({ children, className, priority = "secondary", ...props }, ref)
|
|
|
77
88
|
...props,
|
|
78
89
|
className: (values) => {
|
|
79
90
|
return (0, import_tailwind_merge.twMerge)(
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
91
|
+
"transition-colors duration-200 outline-none",
|
|
92
|
+
(priority === "primary" || priority === "secondary") && [
|
|
93
|
+
"bg-gradient-to-t",
|
|
94
|
+
borderGradient,
|
|
95
|
+
values.isHovered && borderGradientHover,
|
|
96
|
+
values.isPressed && borderGradientPressed,
|
|
97
|
+
values.isDisabled && borderGradientDisabled,
|
|
98
|
+
values.isFocused && "",
|
|
99
|
+
values.isFocusVisible && "outline outline-yellow-50 outline-offset-2"
|
|
100
|
+
],
|
|
101
|
+
isRounded && "rounded-full aspect-square",
|
|
102
|
+
isSquared && "aspect-square",
|
|
87
103
|
resolveClassname(className, values)
|
|
88
104
|
);
|
|
89
105
|
},
|
|
@@ -92,17 +108,26 @@ function _Button({ children, className, priority = "secondary", ...props }, ref)
|
|
|
92
108
|
"span",
|
|
93
109
|
{
|
|
94
110
|
className: (0, import_tailwind_merge.twMerge)(
|
|
95
|
-
"block
|
|
96
|
-
priority === "primary"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
111
|
+
"block transition-colors duration-200 text-lol-gold-300 tracking-wide font-beaufort font-black uppercase",
|
|
112
|
+
(priority === "primary" || priority === "secondary") && [
|
|
113
|
+
"m-0.5 px-4 py-2 bg-lol-gray-950"
|
|
114
|
+
],
|
|
115
|
+
priority === "primary" && "from-lol-gold-700 via-lol-gold-800 to-lol-gold-900 bg-gradient-to-b",
|
|
116
|
+
priority === "tertiary" && !isRounded && 'relative after:content-[""] after:absolute after:-top-2 after:-bottom-2 after:-left-2 after:-right-2',
|
|
117
|
+
(isSquared || isRounded) && "aspect-square p-1.5",
|
|
118
|
+
isRounded && "rounded-full",
|
|
119
|
+
values.isHovered && [
|
|
120
|
+
"text-lol-gold-100",
|
|
121
|
+
priority === "primary" && "from-lol-gold-700 via-lol-gold-600 to-lol-gold-600",
|
|
122
|
+
priority === "tertiary" && (isRounded || isSquared) && "bg-lol-gray-900"
|
|
123
|
+
],
|
|
124
|
+
values.isPressed && [
|
|
125
|
+
"text-lol-gray-500",
|
|
126
|
+
priority === "primary" && "text-lol-gold-600 from-lol-gold-900 via-lol-gold-900 to-lol-gold-900"
|
|
127
|
+
],
|
|
100
128
|
values.isDisabled && "text-lol-gray-500",
|
|
101
129
|
values.isFocused && "",
|
|
102
|
-
values.isFocusVisible && ""
|
|
103
|
-
priority === "primary" && "from-lol-gold-700 via-lol-gold-800 to-lol-gold-900",
|
|
104
|
-
priority === "primary" && values.isHovered && "from-[#604522] via-[#846745] to-[#725634]",
|
|
105
|
-
priority === "primary" && values.isPressed && "from-[#261b0d] via-[#261b0d] to-[#261b0d] text-[#67604c]"
|
|
130
|
+
values.isFocusVisible && ""
|
|
106
131
|
),
|
|
107
132
|
children: typeof children === "function" ? children(values) : children
|
|
108
133
|
}
|
|
@@ -139,10 +164,10 @@ function Select({
|
|
|
139
164
|
{
|
|
140
165
|
className: (buttonValues) => (0, import_tailwind_merge2.twMerge)(
|
|
141
166
|
"inline-block outline-none",
|
|
142
|
-
|
|
143
|
-
buttonValues.isHovered &&
|
|
144
|
-
(buttonValues.isPressed || values.isOpen) &&
|
|
145
|
-
buttonValues.isDisabled &&
|
|
167
|
+
borderGradient,
|
|
168
|
+
buttonValues.isHovered && borderGradientHover,
|
|
169
|
+
(buttonValues.isPressed || values.isOpen) && borderGradientPressed,
|
|
170
|
+
buttonValues.isDisabled && borderGradientDisabled,
|
|
146
171
|
buttonValues.isFocused && "",
|
|
147
172
|
buttonValues.isFocusVisible && outlineClassName
|
|
148
173
|
),
|
|
@@ -212,7 +237,7 @@ function SearchField({
|
|
|
212
237
|
className: (values) => {
|
|
213
238
|
return (0, import_tailwind_merge3.twMerge)(
|
|
214
239
|
"flex flex-col outline-none",
|
|
215
|
-
|
|
240
|
+
borderGradient,
|
|
216
241
|
"focus-within:from-lol-gold-300 focus-within:via-lol-gold-200 focus-within:to-lol-gold-50",
|
|
217
242
|
props.isDisabled && "from-lol-gray-700 via-lol-gray-700 to-lol-gray-700",
|
|
218
243
|
resolveClassname(props.className, values)
|
|
@@ -411,10 +436,10 @@ function Switch({
|
|
|
411
436
|
{
|
|
412
437
|
className: (0, import_tailwind_merge5.twMerge)(
|
|
413
438
|
"h-6 w-14 shrink-0 cursor-default rounded-full p-0.5",
|
|
414
|
-
|
|
415
|
-
values.isHovered &&
|
|
416
|
-
values.isPressed &&
|
|
417
|
-
values.isDisabled &&
|
|
439
|
+
borderGradient,
|
|
440
|
+
values.isHovered && borderGradientHover,
|
|
441
|
+
values.isPressed && borderGradientPressed,
|
|
442
|
+
values.isDisabled && borderGradientDisabled,
|
|
418
443
|
values.isFocused && "",
|
|
419
444
|
values.isFocusVisible && "outline outline-1 outline-offset-2 outline-yellow-50"
|
|
420
445
|
),
|
|
@@ -435,10 +460,10 @@ function Switch({
|
|
|
435
460
|
className: (0, import_tailwind_merge5.twMerge)(
|
|
436
461
|
"absolute -left-2 -top-1.5 h-8 w-8 rounded-full p-0.5 shadow-md ring-0 transition-[left] duration-200 ease-in-out",
|
|
437
462
|
values.isSelected && "left-[calc(100%-1.75rem)]",
|
|
438
|
-
|
|
439
|
-
values.isHovered &&
|
|
440
|
-
values.isPressed &&
|
|
441
|
-
values.isDisabled &&
|
|
463
|
+
borderGradient,
|
|
464
|
+
values.isHovered && borderGradientHover,
|
|
465
|
+
values.isPressed && borderGradientPressed,
|
|
466
|
+
values.isDisabled && borderGradientDisabled
|
|
442
467
|
),
|
|
443
468
|
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "block h-full w-full rounded-full bg-lol-gray-950" })
|
|
444
469
|
}
|
|
@@ -463,7 +488,7 @@ function ProgressBar({
|
|
|
463
488
|
...props
|
|
464
489
|
}) {
|
|
465
490
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_aria_components6.ProgressBar, { className: "flex w-56 flex-col gap-1 text-sm", ...props, children: ({ percentage, valueText }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
466
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex font-
|
|
491
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex font-beaufort font-bold uppercase text-lol-gold-100", children: [
|
|
467
492
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_aria_components6.Label, { className: "flex-1 ", children: label ?? "Loading" }),
|
|
468
493
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { children: valueText })
|
|
469
494
|
] }),
|
|
@@ -471,7 +496,7 @@ function ProgressBar({
|
|
|
471
496
|
"div",
|
|
472
497
|
{
|
|
473
498
|
className: (0, import_tailwind_merge6.twMerge)(
|
|
474
|
-
|
|
499
|
+
borderGradient,
|
|
475
500
|
"-ml-0.5 -mr-1 h-3 rounded-full p-px"
|
|
476
501
|
),
|
|
477
502
|
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
@@ -533,7 +558,7 @@ function Accordion({ children, className }) {
|
|
|
533
558
|
"div",
|
|
534
559
|
{
|
|
535
560
|
className: (0, import_tailwind_merge7.twMerge)(
|
|
536
|
-
"bg-lol-blue-950 border-lol-gold-500
|
|
561
|
+
"bg-lol-blue-950 border-lol-gold-500 border",
|
|
537
562
|
className
|
|
538
563
|
),
|
|
539
564
|
style: {
|
|
@@ -618,7 +643,7 @@ function TextField({
|
|
|
618
643
|
...props,
|
|
619
644
|
className: (values) => (0, import_tailwind_merge8.twMerge)(
|
|
620
645
|
"flex flex-col outline-none",
|
|
621
|
-
|
|
646
|
+
borderGradient,
|
|
622
647
|
"focus-within:from-lol-gold-300 focus-within:via-lol-gold-200 focus-within:to-lol-gold-50",
|
|
623
648
|
props.isDisabled && "from-lol-gray-700 via-lol-gray-700 to-lol-gray-700",
|
|
624
649
|
resolveClassname(props.className, values)
|
|
@@ -727,7 +752,7 @@ function NumberField({
|
|
|
727
752
|
const finalClassName = resolveClassname(groupProps.className, values);
|
|
728
753
|
return (0, import_tailwind_merge11.twMerge)(
|
|
729
754
|
"grid grid-cols-[auto_1fr_auto] outline-none gap-px p-px",
|
|
730
|
-
|
|
755
|
+
borderGradient,
|
|
731
756
|
"focus-within:from-lol-gold-300 focus-within:via-lol-gold-200 focus-within:to-lol-gold-50",
|
|
732
757
|
props.isDisabled && "from-lol-gray-700 via-lol-gray-700 to-lol-gray-700",
|
|
733
758
|
finalClassName
|
|
@@ -822,7 +847,7 @@ function Modal({
|
|
|
822
847
|
{
|
|
823
848
|
className: (0, import_tailwind_merge13.twMerge)(
|
|
824
849
|
"text-left align-middle shadow-xl p-0.5 bg-gradient-to-t",
|
|
825
|
-
|
|
850
|
+
borderGradientPressed
|
|
826
851
|
),
|
|
827
852
|
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "bg-black", children: typeof children === "function" ? children(dialogRenderProps) : children })
|
|
828
853
|
}
|
|
@@ -990,7 +1015,7 @@ function TextArea({
|
|
|
990
1015
|
...props,
|
|
991
1016
|
className: (values) => (0, import_tailwind_merge16.twMerge)(
|
|
992
1017
|
"flex flex-col outline-none",
|
|
993
|
-
|
|
1018
|
+
borderGradient,
|
|
994
1019
|
"focus-within:from-lol-gold-300 focus-within:via-lol-gold-200 focus-within:to-lol-gold-50",
|
|
995
1020
|
props.isDisabled && "from-lol-gray-700 via-lol-gray-700 to-lol-gray-700",
|
|
996
1021
|
resolveClassname(props.className, values)
|
|
@@ -1020,6 +1045,97 @@ function TextArea({
|
|
|
1020
1045
|
}
|
|
1021
1046
|
);
|
|
1022
1047
|
}
|
|
1048
|
+
|
|
1049
|
+
// src/components/tooltip.tsx
|
|
1050
|
+
var import_react_aria_components15 = require("react-aria-components");
|
|
1051
|
+
var import_tailwind_merge17 = require("tailwind-merge");
|
|
1052
|
+
var import_react_aria_components16 = require("react-aria-components");
|
|
1053
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1054
|
+
function Tooltip({ children, ...props }) {
|
|
1055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1056
|
+
import_react_aria_components15.Tooltip,
|
|
1057
|
+
{
|
|
1058
|
+
...props,
|
|
1059
|
+
className: (values) => (0, import_tailwind_merge17.twMerge)(
|
|
1060
|
+
`p-0.5 drop-shadow-lg bg-black`,
|
|
1061
|
+
borderGradient,
|
|
1062
|
+
"w-[280px]",
|
|
1063
|
+
values.isEntering && "animate-in fade-in data-[placement=bottom]:slide-in-from-top-1 data-[placement=top]:slide-in-from-bottom-1 ease-out duration-200 fill-mode-forwards",
|
|
1064
|
+
values.isExiting && "animate-out fade-out data-[placement=bottom]:slide-out-to-top-1 data-[placement=top]:slide-out-to-bottom-1 ease-in duration-150 fill-mode-forwards",
|
|
1065
|
+
values.placement === "bottom" && "mt-2",
|
|
1066
|
+
values.placement === "top" && "mb-2",
|
|
1067
|
+
resolveClassname(props.className, values)
|
|
1068
|
+
),
|
|
1069
|
+
children: (values) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1070
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react_aria_components15.OverlayArrow, { className: "transform translate-y-1", children: (values2) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
|
|
1071
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1072
|
+
"svg",
|
|
1073
|
+
{
|
|
1074
|
+
viewBox: "0 0 12 12",
|
|
1075
|
+
className: (0, import_tailwind_merge17.twMerge)(
|
|
1076
|
+
"block fill-lol-gold-600 w-5 h-5 absolute",
|
|
1077
|
+
values2.placement === "top" && "-translate-y-[1px] -left-0.5 ",
|
|
1078
|
+
values2.placement === "bottom" && "-translate-y-[3px] rotate-180 -left-0.5 fill-lol-gold-400",
|
|
1079
|
+
values2.placement === "left" && "-translate-x-px -rotate-90 -top-0.5 fill-lol-gold-500",
|
|
1080
|
+
values2.placement === "right" && "-translate-x-[3px] rotate-90 -top-0.5 fill-lol-gold-500"
|
|
1081
|
+
),
|
|
1082
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M0 0,L6 6,L12 0" })
|
|
1083
|
+
}
|
|
1084
|
+
),
|
|
1085
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1086
|
+
"svg",
|
|
1087
|
+
{
|
|
1088
|
+
viewBox: "0 0 12 12",
|
|
1089
|
+
className: (0, import_tailwind_merge17.twMerge)(
|
|
1090
|
+
"block fill-lol-gray-900 w-4 h-4",
|
|
1091
|
+
values2.placement === "top" && "-translate-y-0.5",
|
|
1092
|
+
values2.placement === "bottom" && "translate-y-0.5 rotate-180",
|
|
1093
|
+
values2.placement === "left" && "-translate-x-0.5 -rotate-90",
|
|
1094
|
+
values2.placement === "right" && "translate-x-0.5 rotate-90"
|
|
1095
|
+
),
|
|
1096
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("path", { d: "M0 0,L6 6,L12 0" })
|
|
1097
|
+
}
|
|
1098
|
+
)
|
|
1099
|
+
] }) }),
|
|
1100
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "bg-lol-gray-900", children: typeof children === "function" ? children(values) : children })
|
|
1101
|
+
] })
|
|
1102
|
+
}
|
|
1103
|
+
);
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
// src/components/card.tsx
|
|
1107
|
+
var import_tailwind_merge18 = require("tailwind-merge");
|
|
1108
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1109
|
+
function Card({ children, className, style, borderProps }) {
|
|
1110
|
+
const r = `1rem`;
|
|
1111
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1112
|
+
"div",
|
|
1113
|
+
{
|
|
1114
|
+
...borderProps ?? {},
|
|
1115
|
+
className: (0, import_tailwind_merge18.twMerge)("p-[3px]", borderGradient, borderProps?.className),
|
|
1116
|
+
style: {
|
|
1117
|
+
WebkitMask: borderInverted(r),
|
|
1118
|
+
mask: borderInverted(r),
|
|
1119
|
+
...borderProps?.style ?? {}
|
|
1120
|
+
},
|
|
1121
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1122
|
+
"div",
|
|
1123
|
+
{
|
|
1124
|
+
className: (0, import_tailwind_merge18.twMerge)("bg-black w-full", className),
|
|
1125
|
+
style: {
|
|
1126
|
+
WebkitMask: borderInverted(r),
|
|
1127
|
+
mask: borderInverted(r),
|
|
1128
|
+
...style ?? {}
|
|
1129
|
+
},
|
|
1130
|
+
children
|
|
1131
|
+
}
|
|
1132
|
+
)
|
|
1133
|
+
}
|
|
1134
|
+
);
|
|
1135
|
+
}
|
|
1136
|
+
function borderInverted(r) {
|
|
1137
|
+
return `radial-gradient(${r} at ${r} ${r},#0000 98%,#000) -${r} -${r}`;
|
|
1138
|
+
}
|
|
1023
1139
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1024
1140
|
0 && (module.exports = {
|
|
1025
1141
|
Accordion,
|
|
@@ -1027,6 +1143,7 @@ function TextArea({
|
|
|
1027
1143
|
AccordionItem,
|
|
1028
1144
|
AccordionTrigger,
|
|
1029
1145
|
Button,
|
|
1146
|
+
Card,
|
|
1030
1147
|
Checkbox,
|
|
1031
1148
|
DialogButtons,
|
|
1032
1149
|
DialogTrigger,
|
|
@@ -1049,6 +1166,9 @@ function TextArea({
|
|
|
1049
1166
|
TabPanel,
|
|
1050
1167
|
Tabs,
|
|
1051
1168
|
TextArea,
|
|
1052
|
-
TextField
|
|
1169
|
+
TextField,
|
|
1170
|
+
Tooltip,
|
|
1171
|
+
TooltipTrigger,
|
|
1172
|
+
borderInverted
|
|
1053
1173
|
});
|
|
1054
1174
|
//# sourceMappingURL=index.cjs.map
|