@lolmath/ui 1.2.0 → 1.3.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 +86 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.js +90 -35
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37,15 +37,15 @@ function _Button({ children, className, priority = "secondary", ...props }, ref)
|
|
|
37
37
|
"span",
|
|
38
38
|
{
|
|
39
39
|
className: twMerge(
|
|
40
|
-
"block m-0.5 px-4 py-2 bg-
|
|
40
|
+
"block m-0.5 px-4 py-2 bg-lol-gray-950 transition-colors duration-200",
|
|
41
41
|
priority === "primary" && "bg-gradient-to-b",
|
|
42
42
|
"text-[#cdbe91] tracking-wide",
|
|
43
|
-
values.isHovered && "text-
|
|
44
|
-
values.isPressed && "text-
|
|
45
|
-
values.isDisabled && "text-
|
|
43
|
+
values.isHovered && "text-lol-gold-100",
|
|
44
|
+
values.isPressed && "text-lol-gray-500",
|
|
45
|
+
values.isDisabled && "text-lol-gray-500",
|
|
46
46
|
values.isFocused && "",
|
|
47
47
|
values.isFocusVisible && "",
|
|
48
|
-
priority === "primary" && "from-
|
|
48
|
+
priority === "primary" && "from-lol-gold-700 via-lol-gold-800 to-lol-gold-900",
|
|
49
49
|
priority === "primary" && values.isHovered && "from-[#604522] via-[#846745] to-[#725634]",
|
|
50
50
|
priority === "primary" && values.isPressed && "from-[#261b0d] via-[#261b0d] to-[#261b0d] text-[#67604c]"
|
|
51
51
|
),
|
|
@@ -98,7 +98,7 @@ function Select({
|
|
|
98
98
|
"span",
|
|
99
99
|
{
|
|
100
100
|
className: twMerge2(
|
|
101
|
-
"block m-px bg-
|
|
101
|
+
"block m-px bg-lol-gray-950 px-2 py-1 text-[#a09b8c] text-xs font-normal tracking-wide pr-6 bg-no-repeat"
|
|
102
102
|
),
|
|
103
103
|
style: {
|
|
104
104
|
backgroundPosition: "right 0.5rem center",
|
|
@@ -132,7 +132,7 @@ function Item({ className, ...props }) {
|
|
|
132
132
|
const finalClassName = typeof className === "function" ? className(values) : className;
|
|
133
133
|
return twMerge2(
|
|
134
134
|
"px-2 py-0.5 border-b border-[#1f2123] text-[#cdbe91] text-sm font-spiegel font-bold outline-none",
|
|
135
|
-
values.isHovered && "bg-
|
|
135
|
+
values.isHovered && "bg-lol-gray-950 text-lol-gold-100",
|
|
136
136
|
values.isPressed && "bg-[#1e232880] text-[#463714]",
|
|
137
137
|
values.isFocusVisible && outlineClassName,
|
|
138
138
|
values.isFocused && "",
|
|
@@ -166,9 +166,9 @@ function SearchField({
|
|
|
166
166
|
AriaSearchField,
|
|
167
167
|
{
|
|
168
168
|
className: (values) => {
|
|
169
|
-
const finalClassName =
|
|
169
|
+
const finalClassName = resolveClassname(props, values);
|
|
170
170
|
return twMerge3(
|
|
171
|
-
"flex flex-col outline-none
|
|
171
|
+
"flex flex-col outline-none",
|
|
172
172
|
borderClassName,
|
|
173
173
|
"focus-within:from-lol-gold-300 focus-within:via-lol-gold-200 focus-within:to-lol-gold-50",
|
|
174
174
|
props.isDisabled && "from-lol-gray-700 via-lol-gray-700 to-lol-gray-700",
|
|
@@ -176,12 +176,12 @@ function SearchField({
|
|
|
176
176
|
);
|
|
177
177
|
},
|
|
178
178
|
...props,
|
|
179
|
-
children: ({ state }) => /* @__PURE__ */ jsxs2(
|
|
179
|
+
children: ({ state, isDisabled }) => /* @__PURE__ */ jsxs2(
|
|
180
180
|
"div",
|
|
181
181
|
{
|
|
182
182
|
className: twMerge3(
|
|
183
|
-
"m-px bg-
|
|
184
|
-
props.isDisabled && "
|
|
183
|
+
"m-px bg-black flex flex-row focus-within:from-lol-gray-950 focus-within:to-lol-gray-900 focus-within:bg-gradient-to-b",
|
|
184
|
+
props.isDisabled && "bg-lol-gray-950"
|
|
185
185
|
),
|
|
186
186
|
children: [
|
|
187
187
|
/* @__PURE__ */ jsx3(
|
|
@@ -191,7 +191,8 @@ function SearchField({
|
|
|
191
191
|
className: (values) => {
|
|
192
192
|
const finalClassName = resolveClassname(inputProps, values);
|
|
193
193
|
return twMerge3(
|
|
194
|
-
"bg-transparent grow py-2 px-3 text-lol-gold-50 text-xs outline-none font-spiegel tracking-wide",
|
|
194
|
+
"bg-transparent grow py-2 px-3 text-lol-gold-50 text-xs outline-none font-spiegel tracking-wide pl-6",
|
|
195
|
+
props.isDisabled && "text-lol-gray-500",
|
|
195
196
|
finalClassName
|
|
196
197
|
);
|
|
197
198
|
},
|
|
@@ -204,12 +205,12 @@ function SearchField({
|
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
),
|
|
207
|
-
state.value.length > 0 && /* @__PURE__ */ jsx3(
|
|
208
|
+
state.value.length > 0 && !isDisabled && /* @__PURE__ */ jsx3(
|
|
208
209
|
AriaButton3,
|
|
209
210
|
{
|
|
210
211
|
className: (buttonValues) => twMerge3(
|
|
211
212
|
"font-black text-[#cdbe91] text-xs px-4",
|
|
212
|
-
buttonValues.isHovered && "text-
|
|
213
|
+
buttonValues.isHovered && "text-lol-gold-100",
|
|
213
214
|
buttonValues.isPressed && "text-[#463714]"
|
|
214
215
|
),
|
|
215
216
|
children: "\u2715"
|
|
@@ -240,12 +241,7 @@ var sliderDisabled = "url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAAB
|
|
|
240
241
|
|
|
241
242
|
// src/components/slider.tsx
|
|
242
243
|
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
243
|
-
function Slider({
|
|
244
|
-
className,
|
|
245
|
-
placeholder,
|
|
246
|
-
label,
|
|
247
|
-
...props
|
|
248
|
-
}) {
|
|
244
|
+
function Slider({ className, label, ...props }) {
|
|
249
245
|
return /* @__PURE__ */ jsx4(AriaSlider, { ...props, className: "", children: ({ state }) => /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
250
246
|
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between font-spiegel text-xs text-[#a09b8c] font-normal tracking-wide", children: [
|
|
251
247
|
/* @__PURE__ */ jsx4(Label, { className: "", children: label }),
|
|
@@ -255,7 +251,7 @@ function Slider({
|
|
|
255
251
|
const left = state2.values.length === 1 ? 0 : state2.getThumbPercent(0) * 100;
|
|
256
252
|
const width = state2.values.length === 1 ? state2.getThumbPercent(0) * 100 : (state2.getThumbPercent(1) - state2.getThumbPercent(0)) * 100;
|
|
257
253
|
return /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
258
|
-
/* @__PURE__ */ jsx4("div", { className: "absolute h-0.5 top-[50%] transform translate-y-[-50%] w-full rounded-full bg-
|
|
254
|
+
/* @__PURE__ */ jsx4("div", { className: "absolute h-0.5 top-[50%] transform translate-y-[-50%] w-full rounded-full bg-lol-gray-950" }),
|
|
259
255
|
/* @__PURE__ */ jsx4(
|
|
260
256
|
"div",
|
|
261
257
|
{
|
|
@@ -331,7 +327,7 @@ function Switch({
|
|
|
331
327
|
"div",
|
|
332
328
|
{
|
|
333
329
|
className: twMerge5(
|
|
334
|
-
"relative grid h-full w-full rounded-full bg-
|
|
330
|
+
"relative grid h-full w-full rounded-full bg-lol-gray-950 transition-colors duration-200 ease-in-out",
|
|
335
331
|
values.isPressed && "",
|
|
336
332
|
values.isSelected && "bg-green-800",
|
|
337
333
|
values.isSelected && values.isPressed && "bg-green-900",
|
|
@@ -349,7 +345,7 @@ function Switch({
|
|
|
349
345
|
values.isPressed && borderPressedClassName,
|
|
350
346
|
values.isDisabled && borderDisabledClassName
|
|
351
347
|
),
|
|
352
|
-
children: /* @__PURE__ */ jsx5("span", { className: "block h-full w-full rounded-full bg-
|
|
348
|
+
children: /* @__PURE__ */ jsx5("span", { className: "block h-full w-full rounded-full bg-lol-gray-950" })
|
|
353
349
|
}
|
|
354
350
|
)
|
|
355
351
|
}
|
|
@@ -375,7 +371,7 @@ function ProgressBar({
|
|
|
375
371
|
...props
|
|
376
372
|
}) {
|
|
377
373
|
return /* @__PURE__ */ jsx6(AriaProgressBar, { className: "flex w-56 flex-col gap-1 text-sm", ...props, children: ({ percentage, valueText }) => /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
378
|
-
/* @__PURE__ */ jsxs5("div", { className: "flex font-[beaufort] font-bold uppercase text-
|
|
374
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex font-[beaufort] font-bold uppercase text-lol-gold-100", children: [
|
|
379
375
|
/* @__PURE__ */ jsx6(Label2, { className: "flex-1 ", children: label ?? "Loading" }),
|
|
380
376
|
/* @__PURE__ */ jsx6("span", { children: valueText })
|
|
381
377
|
] }),
|
|
@@ -386,15 +382,21 @@ function ProgressBar({
|
|
|
386
382
|
borderClassName,
|
|
387
383
|
"-ml-0.5 -mr-1 h-3 rounded-full p-px"
|
|
388
384
|
),
|
|
389
|
-
children: /* @__PURE__ */ jsx6(
|
|
385
|
+
children: /* @__PURE__ */ jsx6(
|
|
390
386
|
"div",
|
|
391
387
|
{
|
|
392
|
-
className: twMerge6(
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
388
|
+
className: twMerge6("h-full w-full rounded-full bg-lol-gray-950"),
|
|
389
|
+
children: /* @__PURE__ */ jsx6(
|
|
390
|
+
"div",
|
|
391
|
+
{
|
|
392
|
+
className: twMerge6(
|
|
393
|
+
"h-full rounded-full bg-gradient-to-r from-[#005A82] via-[#067F9B] to-[#73CCD5]"
|
|
394
|
+
),
|
|
395
|
+
style: { width: `${percentage}%` }
|
|
396
|
+
}
|
|
397
|
+
)
|
|
396
398
|
}
|
|
397
|
-
)
|
|
399
|
+
)
|
|
398
400
|
}
|
|
399
401
|
)
|
|
400
402
|
] }) });
|
|
@@ -495,9 +497,9 @@ function TextField({
|
|
|
495
497
|
AriaTextField,
|
|
496
498
|
{
|
|
497
499
|
className: (values) => {
|
|
498
|
-
const finalClassName =
|
|
500
|
+
const finalClassName = resolveClassname(props, values);
|
|
499
501
|
return twMerge8(
|
|
500
|
-
"flex flex-col outline-none
|
|
502
|
+
"flex flex-col outline-none",
|
|
501
503
|
borderClassName,
|
|
502
504
|
"focus-within:from-lol-gold-300 focus-within:via-lol-gold-200 focus-within:to-lol-gold-50",
|
|
503
505
|
props.isDisabled && "from-lol-gray-700 via-lol-gray-700 to-lol-gray-700",
|
|
@@ -510,16 +512,17 @@ function TextField({
|
|
|
510
512
|
{
|
|
511
513
|
className: twMerge8(
|
|
512
514
|
"m-px bg-black flex flex-row focus-within:from-lol-gray-950 focus-within:to-lol-gray-900 focus-within:bg-gradient-to-b",
|
|
513
|
-
props.isDisabled && "
|
|
515
|
+
props.isDisabled && "bg-lol-gray-950"
|
|
514
516
|
),
|
|
515
517
|
children: /* @__PURE__ */ jsx8(
|
|
516
518
|
AriaInput2,
|
|
517
519
|
{
|
|
518
520
|
...inputProps,
|
|
519
521
|
className: (values) => {
|
|
520
|
-
const finalClassName =
|
|
522
|
+
const finalClassName = resolveClassname(inputProps, values);
|
|
521
523
|
return twMerge8(
|
|
522
524
|
"bg-transparent grow py-2 px-3 text-lol-gold-50 text-xs outline-none font-spiegel tracking-wide",
|
|
525
|
+
values.isDisabled && "text-lol-gray-500",
|
|
523
526
|
finalClassName
|
|
524
527
|
);
|
|
525
528
|
},
|
|
@@ -596,6 +599,57 @@ function Label3({ ...props }) {
|
|
|
596
599
|
}
|
|
597
600
|
);
|
|
598
601
|
}
|
|
602
|
+
|
|
603
|
+
// src/components/number-field.tsx
|
|
604
|
+
import {
|
|
605
|
+
NumberField as AriaNumberField,
|
|
606
|
+
Input as AriaInput3,
|
|
607
|
+
Group,
|
|
608
|
+
Button as Button2
|
|
609
|
+
} from "react-aria-components";
|
|
610
|
+
import { twMerge as twMerge11 } from "tailwind-merge";
|
|
611
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
612
|
+
function NumberField({
|
|
613
|
+
inputProps = {},
|
|
614
|
+
groupProps = {},
|
|
615
|
+
...props
|
|
616
|
+
}) {
|
|
617
|
+
return /* @__PURE__ */ jsx11(AriaNumberField, { ...props, children: /* @__PURE__ */ jsxs7(
|
|
618
|
+
Group,
|
|
619
|
+
{
|
|
620
|
+
...groupProps,
|
|
621
|
+
className: (values) => {
|
|
622
|
+
const finalClassName = resolveClassname(groupProps, values);
|
|
623
|
+
return twMerge11(
|
|
624
|
+
"grid grid-cols-[auto_1fr_auto] outline-none gap-px p-px",
|
|
625
|
+
borderClassName,
|
|
626
|
+
"focus-within:from-lol-gold-300 focus-within:via-lol-gold-200 focus-within:to-lol-gold-50",
|
|
627
|
+
props.isDisabled && "from-lol-gray-700 via-lol-gray-700 to-lol-gray-700",
|
|
628
|
+
finalClassName
|
|
629
|
+
);
|
|
630
|
+
},
|
|
631
|
+
children: [
|
|
632
|
+
/* @__PURE__ */ jsx11(Button2, { className: "text-lol-gray-50 px-2.5 bg-black", slot: "decrement", children: "-" }),
|
|
633
|
+
/* @__PURE__ */ jsx11(
|
|
634
|
+
AriaInput3,
|
|
635
|
+
{
|
|
636
|
+
...inputProps,
|
|
637
|
+
className: (values) => {
|
|
638
|
+
const finalClassName = resolveClassname(inputProps, values);
|
|
639
|
+
return twMerge11(
|
|
640
|
+
"bg-black w-full py-2 px-3 text-lol-gold-50 text-xs outline-none font-spiegel",
|
|
641
|
+
values.isDisabled && "text-lol-gray-500 bg-lol-gray-950",
|
|
642
|
+
values.isFocused && "from-lol-gray-950 to-lol-gray-900 bg-gradient-to-b",
|
|
643
|
+
finalClassName
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
),
|
|
648
|
+
/* @__PURE__ */ jsx11(Button2, { className: "text-lol-gray-50 px-2.5 bg-black", slot: "increment", children: "+" })
|
|
649
|
+
]
|
|
650
|
+
}
|
|
651
|
+
) });
|
|
652
|
+
}
|
|
599
653
|
export {
|
|
600
654
|
Accordion,
|
|
601
655
|
AccordionContent,
|
|
@@ -604,6 +658,7 @@ export {
|
|
|
604
658
|
Button,
|
|
605
659
|
Item,
|
|
606
660
|
Label3 as Label,
|
|
661
|
+
NumberField,
|
|
607
662
|
ProgressBar,
|
|
608
663
|
Radio,
|
|
609
664
|
RadioGroup,
|