@lolmath/ui 2.1.0 → 2.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/index.cjs +84 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +86 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ComponentProps } from 'react';
|
|
3
|
-
import { ButtonProps as ButtonProps$1, ItemProps, SelectProps as SelectProps$1, SearchFieldProps, Input, SliderProps, SliderTrackProps, SliderThumbProps, SliderTrackRenderProps, SwitchProps, ProgressBarProps as ProgressBarProps$1, TextFieldProps, RadioGroupProps, RadioProps, LabelProps, NumberFieldProps, Group } from 'react-aria-components';
|
|
3
|
+
import { ButtonProps as ButtonProps$1, ItemProps, SelectProps as SelectProps$1, SearchFieldProps, Input, SliderProps, SliderTrackProps, SliderThumbProps, SliderTrackRenderProps, SwitchProps, ProgressBarProps as ProgressBarProps$1, TextFieldProps, RadioGroupProps, RadioProps, LabelProps, NumberFieldProps, Group, HeadingProps, DialogTriggerProps, ModalOverlayProps, DialogProps } from 'react-aria-components';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
interface ButtonProps extends ButtonProps$1 {
|
|
@@ -80,4 +80,16 @@ interface SpinnerProps {
|
|
|
80
80
|
}
|
|
81
81
|
declare function Spinner({ className }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
interface ModalProps extends Omit<ModalOverlayProps, "children"> {
|
|
84
|
+
modalOverlayClassName?: ModalOverlayProps["className"];
|
|
85
|
+
dialogProps?: Omit<DialogProps, "children">;
|
|
86
|
+
children?: DialogProps["children"];
|
|
87
|
+
}
|
|
88
|
+
declare function Modal({ modalOverlayClassName, dialogProps, children, className, ...modalProps }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
89
|
+
declare function Heading(props: HeadingProps): react_jsx_runtime.JSX.Element;
|
|
90
|
+
declare function DialogButtons({ children }: {
|
|
91
|
+
children: React.ReactNode;
|
|
92
|
+
}): react_jsx_runtime.JSX.Element;
|
|
93
|
+
declare function DialogTrigger(props: DialogTriggerProps): react_jsx_runtime.JSX.Element;
|
|
94
|
+
|
|
95
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Button, DialogButtons, DialogTrigger, Heading, Item, Label, Modal, NumberField, ProgressBar, Radio, RadioGroup, SearchField, Select, Slider, SliderLabel, Spinner, Switch, TextField };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, ComponentProps } from 'react';
|
|
3
|
-
import { ButtonProps as ButtonProps$1, ItemProps, SelectProps as SelectProps$1, SearchFieldProps, Input, SliderProps, SliderTrackProps, SliderThumbProps, SliderTrackRenderProps, SwitchProps, ProgressBarProps as ProgressBarProps$1, TextFieldProps, RadioGroupProps, RadioProps, LabelProps, NumberFieldProps, Group } from 'react-aria-components';
|
|
3
|
+
import { ButtonProps as ButtonProps$1, ItemProps, SelectProps as SelectProps$1, SearchFieldProps, Input, SliderProps, SliderTrackProps, SliderThumbProps, SliderTrackRenderProps, SwitchProps, ProgressBarProps as ProgressBarProps$1, TextFieldProps, RadioGroupProps, RadioProps, LabelProps, NumberFieldProps, Group, HeadingProps, DialogTriggerProps, ModalOverlayProps, DialogProps } from 'react-aria-components';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
interface ButtonProps extends ButtonProps$1 {
|
|
@@ -80,4 +80,16 @@ interface SpinnerProps {
|
|
|
80
80
|
}
|
|
81
81
|
declare function Spinner({ className }: SpinnerProps): react_jsx_runtime.JSX.Element;
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
interface ModalProps extends Omit<ModalOverlayProps, "children"> {
|
|
84
|
+
modalOverlayClassName?: ModalOverlayProps["className"];
|
|
85
|
+
dialogProps?: Omit<DialogProps, "children">;
|
|
86
|
+
children?: DialogProps["children"];
|
|
87
|
+
}
|
|
88
|
+
declare function Modal({ modalOverlayClassName, dialogProps, children, className, ...modalProps }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
89
|
+
declare function Heading(props: HeadingProps): react_jsx_runtime.JSX.Element;
|
|
90
|
+
declare function DialogButtons({ children }: {
|
|
91
|
+
children: React.ReactNode;
|
|
92
|
+
}): react_jsx_runtime.JSX.Element;
|
|
93
|
+
declare function DialogTrigger(props: DialogTriggerProps): react_jsx_runtime.JSX.Element;
|
|
94
|
+
|
|
95
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Button, DialogButtons, DialogTrigger, Heading, Item, Label, Modal, NumberField, ProgressBar, Radio, RadioGroup, SearchField, Select, Slider, SliderLabel, Spinner, Switch, TextField };
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { twMerge } from "tailwind-merge";
|
|
|
8
8
|
// src/utilities/border.tsx
|
|
9
9
|
var borderClassName = "from-[#785b28] via-[#c89c3c] to-[#c8aa6e] bg-gradient-to-t";
|
|
10
10
|
var borderHoverClassName = "from-[#c89c3c] via-[#dcc188] to-[#f0e6d8]";
|
|
11
|
-
var borderPressedClassName = "from-
|
|
11
|
+
var borderPressedClassName = "from-lol-gold-600 via-lol-gold-600 to-lol-gold-700";
|
|
12
12
|
var borderDisabledClassName = "from-[#5c5b57] via-[#5c5b57] to-[#5c5b57]";
|
|
13
13
|
|
|
14
14
|
// src/components/button.tsx
|
|
@@ -736,14 +736,99 @@ function Spinner({ className }) {
|
|
|
736
736
|
}
|
|
737
737
|
);
|
|
738
738
|
}
|
|
739
|
+
|
|
740
|
+
// src/components/modal.tsx
|
|
741
|
+
import {
|
|
742
|
+
Modal as AriaModal,
|
|
743
|
+
Dialog,
|
|
744
|
+
DialogTrigger as AriaDialogTrigger,
|
|
745
|
+
Heading as AriaHeading,
|
|
746
|
+
ModalOverlay
|
|
747
|
+
} from "react-aria-components";
|
|
748
|
+
import { twMerge as twMerge13 } from "tailwind-merge";
|
|
749
|
+
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
750
|
+
function Modal({
|
|
751
|
+
modalOverlayClassName,
|
|
752
|
+
dialogProps = {},
|
|
753
|
+
children,
|
|
754
|
+
className,
|
|
755
|
+
...modalProps
|
|
756
|
+
}) {
|
|
757
|
+
return /* @__PURE__ */ jsx13(
|
|
758
|
+
ModalOverlay,
|
|
759
|
+
{
|
|
760
|
+
...modalProps,
|
|
761
|
+
className: (values) => {
|
|
762
|
+
return twMerge13(
|
|
763
|
+
"fixed inset-0 z-10 overflow-y-auto bg-black bg-opacity-25 flex min-h-full items-center justify-center text-center backdrop-blur flex-col px-4",
|
|
764
|
+
resolveClassname(modalOverlayClassName, values)
|
|
765
|
+
);
|
|
766
|
+
},
|
|
767
|
+
children: /* @__PURE__ */ jsx13(
|
|
768
|
+
AriaModal,
|
|
769
|
+
{
|
|
770
|
+
...modalProps,
|
|
771
|
+
className: (values) => twMerge13("w-full max-w-md", resolveClassname(className, values)),
|
|
772
|
+
children: /* @__PURE__ */ jsx13(
|
|
773
|
+
Dialog,
|
|
774
|
+
{
|
|
775
|
+
role: "alertdialog",
|
|
776
|
+
...dialogProps,
|
|
777
|
+
className: twMerge13(
|
|
778
|
+
"outline-none relative max-h-screen py-4",
|
|
779
|
+
dialogProps.className
|
|
780
|
+
),
|
|
781
|
+
children: (dialogRenderProps) => /* @__PURE__ */ jsxs8(Fragment5, { children: [
|
|
782
|
+
/* @__PURE__ */ jsx13("div", { className: "relative h-1", children: /* @__PURE__ */ jsx13("div", { className: "border-lol-gold-700 border bg-black absolute border-b-0 rounded-full h-full left-5 right-5" }) }),
|
|
783
|
+
/* @__PURE__ */ jsx13(
|
|
784
|
+
"div",
|
|
785
|
+
{
|
|
786
|
+
className: twMerge13(
|
|
787
|
+
"text-left align-middle shadow-xl p-0.5 bg-gradient-to-t",
|
|
788
|
+
borderPressedClassName
|
|
789
|
+
),
|
|
790
|
+
children: /* @__PURE__ */ jsx13("div", { className: "bg-black", children: typeof children === "function" ? children(dialogRenderProps) : children })
|
|
791
|
+
}
|
|
792
|
+
),
|
|
793
|
+
/* @__PURE__ */ jsx13("div", { className: "relative h-1", children: /* @__PURE__ */ jsx13("div", { className: "border-lol-gold-600 border bg-black absolute border-t-0 rounded-full h-full left-5 right-5" }) })
|
|
794
|
+
] })
|
|
795
|
+
}
|
|
796
|
+
)
|
|
797
|
+
}
|
|
798
|
+
)
|
|
799
|
+
}
|
|
800
|
+
);
|
|
801
|
+
}
|
|
802
|
+
function Heading(props) {
|
|
803
|
+
return /* @__PURE__ */ jsx13(
|
|
804
|
+
AriaHeading,
|
|
805
|
+
{
|
|
806
|
+
...props,
|
|
807
|
+
className: twMerge13(
|
|
808
|
+
"text-lol-gold-100 uppercase font-beaufort font-bold text-lg",
|
|
809
|
+
props.className
|
|
810
|
+
)
|
|
811
|
+
}
|
|
812
|
+
);
|
|
813
|
+
}
|
|
814
|
+
function DialogButtons({ children }) {
|
|
815
|
+
return /* @__PURE__ */ jsx13("div", { className: "flex justify-center translate-y-0.5", children: /* @__PURE__ */ jsx13("div", { className: "flex gap-1 bg-black px-1", children }) });
|
|
816
|
+
}
|
|
817
|
+
function DialogTrigger(props) {
|
|
818
|
+
return /* @__PURE__ */ jsx13(AriaDialogTrigger, { ...props });
|
|
819
|
+
}
|
|
739
820
|
export {
|
|
740
821
|
Accordion,
|
|
741
822
|
AccordionContent,
|
|
742
823
|
AccordionItem,
|
|
743
824
|
AccordionTrigger,
|
|
744
825
|
Button,
|
|
826
|
+
DialogButtons,
|
|
827
|
+
DialogTrigger,
|
|
828
|
+
Heading,
|
|
745
829
|
Item,
|
|
746
830
|
Label3 as Label,
|
|
831
|
+
Modal,
|
|
747
832
|
NumberField,
|
|
748
833
|
ProgressBar,
|
|
749
834
|
Radio,
|