Compare commits
3 Commits
637b3a0c34
...
c55ce3ad77
| Author | SHA1 | Date | |
|---|---|---|---|
|
c55ce3ad77
|
|||
|
434a27d90d
|
|||
|
94f0f3ca13
|
@@ -1 +1,5 @@
|
|||||||
|
# Mattrixwv React Components
|
||||||
|
|
||||||
|
[](https://sonarqube.mattrixwv.com/dashboard?id=MattrixwvReactComponents)
|
||||||
|
|
||||||
Under Construction
|
Under Construction
|
||||||
|
|||||||
@@ -27,12 +27,15 @@ export default function DragAndDropFileInput({
|
|||||||
<label
|
<label
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"flex flex-col items-center justify-center border-2 rounded-lg cursor-pointer",
|
"flex flex-col items-center justify-center border-2 rounded-lg cursor-pointer",
|
||||||
//TODO: Make hover classes
|
"data-drag:border-primary data-drag:text-primary",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
onDragOver={(e) => e.preventDefault()}
|
onDragOver={(e) => { e.preventDefault(); e.currentTarget.dataset.drag = "true"; }}
|
||||||
|
onDragLeave={(e) => { e.preventDefault(); delete e.currentTarget.dataset.drag; }}
|
||||||
onDrop={(e) => {
|
onDrop={(e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
delete e.currentTarget.dataset.drag;
|
||||||
|
|
||||||
const currentFile = e.dataTransfer.files[0];
|
const currentFile = e.dataTransfer.files[0];
|
||||||
setFile(currentFile);
|
setFile(currentFile);
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import type { LoadingWifiProps } from "$/types/LoadingTypes";
|
import type { LoadingWifiProps } from "$/types/LoadingTypes";
|
||||||
|
import { useId } from "react";
|
||||||
|
|
||||||
|
|
||||||
export default function Wifi({
|
export default function Wifi({
|
||||||
@@ -9,9 +10,9 @@ export default function Wifi({
|
|||||||
fadeDuration = 0.001,
|
fadeDuration = 0.001,
|
||||||
stroke,
|
stroke,
|
||||||
fill
|
fill
|
||||||
}: LoadingWifiProps){
|
}: Readonly<LoadingWifiProps>){
|
||||||
//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/wifi.svg
|
//https://github.com/n3r4zzurr0/svg-spinners/blob/main/svg-smil/wifi.svg
|
||||||
const id = crypto.randomUUID().replaceAll("-", "");
|
const id = useId();
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -3,17 +3,14 @@ import { Dialog, DialogBackdrop, DialogPanel } from "@headlessui/react";
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
|
|
||||||
export default function Modal(props: ModalProps){
|
export default function Modal({
|
||||||
const {
|
|
||||||
display,
|
display,
|
||||||
onClose,
|
onClose,
|
||||||
className,
|
className,
|
||||||
backgroundType = "blur",
|
backgroundType = "blur",
|
||||||
top,
|
top,
|
||||||
children
|
children
|
||||||
} = props;
|
}: Readonly<ModalProps>){
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog
|
<Dialog
|
||||||
open={display}
|
open={display}
|
||||||
|
|||||||
@@ -2,19 +2,18 @@ import type { ModalBodyProps } from "$/types/ModalTypes";
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
|
|
||||||
export default function ModalBody(props: ModalBodyProps){
|
export default function ModalBody({
|
||||||
const {
|
|
||||||
className,
|
className,
|
||||||
children
|
children,
|
||||||
} = props;
|
...props
|
||||||
|
}: Readonly<ModalBodyProps>){
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"flex flex-col items-center justify-start h-full w-full overflow-scroll",
|
"flex flex-col items-center justify-start h-full w-full overflow-scroll",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
|
{...props}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,19 +2,18 @@ import type { ModalFooterProps } from "$/types/ModalTypes";
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
|
|
||||||
export default function ModalFooter(props: ModalFooterProps){
|
export default function ModalFooter({
|
||||||
const {
|
|
||||||
className,
|
className,
|
||||||
children
|
children,
|
||||||
} = props;
|
...props
|
||||||
|
}: Readonly<ModalFooterProps>){
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"flex flex-row items-center justify-center w-full rounded-b-lg",
|
"flex flex-row items-center justify-center w-full rounded-b-lg",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
|
{...props}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="flex flex-row items-center justify-center mx-8 my-3"
|
className="flex flex-row items-center justify-center mx-8 my-3"
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
|
import Button from "$/component/button/Button";
|
||||||
import type { ModalHeaderProps } from "$/types/ModalTypes";
|
import type { ModalHeaderProps } from "$/types/ModalTypes";
|
||||||
import { DialogTitle } from "@headlessui/react";
|
import { DialogTitle } from "@headlessui/react";
|
||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { BsXLg } from "react-icons/bs";
|
import { BsXLg } from "react-icons/bs";
|
||||||
|
|
||||||
|
|
||||||
export default function ModalHeader(props: ModalHeaderProps){
|
export default function ModalHeader({
|
||||||
const {
|
|
||||||
onClose,
|
onClose,
|
||||||
className,
|
className,
|
||||||
children
|
children,
|
||||||
} = props;
|
...props
|
||||||
|
}: Readonly<ModalHeaderProps>){
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
"flex flex-row items-center justify-center w-full rounded-t-lg",
|
"flex flex-row items-center justify-center w-full rounded-t-lg",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
|
{...props}
|
||||||
>
|
>
|
||||||
<DialogTitle
|
<DialogTitle
|
||||||
as="div"
|
as="div"
|
||||||
@@ -27,14 +27,14 @@ export default function ModalHeader(props: ModalHeaderProps){
|
|||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
{
|
{
|
||||||
onClose &&
|
onClose &&
|
||||||
<div
|
<Button
|
||||||
className="absolute top-1 right-1 cursor-pointer"
|
className="absolute top-1 right-1 cursor-pointer"
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
>
|
>
|
||||||
<BsXLg
|
<BsXLg
|
||||||
size={20}
|
size={20}
|
||||||
/>
|
/>
|
||||||
</div>
|
</Button>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export default function DarkModeSwitch(){
|
|||||||
|
|
||||||
const updateTheme = () => {
|
const updateTheme = () => {
|
||||||
if(theme === "system"){
|
if(theme === "system"){
|
||||||
if(window.document.documentElement.classList.contains("dark")){
|
if(globalThis.document.documentElement.classList.contains("dark")){
|
||||||
setTheme("light");
|
setTheme("light");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
|||||||
@@ -2,13 +2,11 @@ import type { NavBarProps } from "$/types/NavTypes";
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
|
|
||||||
export default function NavBar(props: NavBarProps){
|
export default function NavBar({
|
||||||
const {
|
|
||||||
className,
|
className,
|
||||||
children
|
children,
|
||||||
} = props;
|
...props
|
||||||
|
}: Readonly<NavBarProps>){
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav
|
<nav
|
||||||
className={clsx(
|
className={clsx(
|
||||||
@@ -16,6 +14,7 @@ export default function NavBar(props: NavBarProps){
|
|||||||
"fixed top-0 left-0 w-full z-10",
|
"fixed top-0 left-0 w-full z-10",
|
||||||
"flex flex-row flex-nowrap items-center justify-center"
|
"flex flex-row flex-nowrap items-center justify-center"
|
||||||
)}
|
)}
|
||||||
|
{...props}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -3,14 +3,11 @@ import { Popover, PopoverButton, PopoverPanel } from "@headlessui/react";
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
import { RiArrowRightSLine } from "react-icons/ri";
|
import { RiArrowRightSLine } from "react-icons/ri";
|
||||||
|
|
||||||
export default function PopoverMenu(props: PopoverMenuProps){
|
export default function PopoverMenu({
|
||||||
const {
|
|
||||||
buttonContent,
|
buttonContent,
|
||||||
anchor,
|
anchor,
|
||||||
children
|
children
|
||||||
} = props;
|
}: Readonly<PopoverMenuProps>){
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover>
|
<Popover>
|
||||||
<PopoverButton
|
<PopoverButton
|
||||||
|
|||||||
@@ -3,12 +3,9 @@ import { Tab } from "@headlessui/react";
|
|||||||
import clsx from "clsx";
|
import clsx from "clsx";
|
||||||
|
|
||||||
|
|
||||||
export default function MattrixwvTab(props: MattrixwvTabProps){
|
export default function MattrixwvTab({
|
||||||
const {
|
|
||||||
children
|
children
|
||||||
} = props;
|
}: Readonly<MattrixwvTabProps>){
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tab
|
<Tab
|
||||||
className={clsx(
|
className={clsx(
|
||||||
|
|||||||
@@ -7,13 +7,10 @@ import MattrixwvTabPanel from "./MattrixwvTabPanel";
|
|||||||
import MattrixwvTabPanels from "./MattrixwvTabPanels";
|
import MattrixwvTabPanels from "./MattrixwvTabPanels";
|
||||||
|
|
||||||
|
|
||||||
export default function MattrixwvTabGroup(props: MattrixwvTabGroupProps){
|
export default function MattrixwvTabGroup({
|
||||||
const {
|
|
||||||
tabs,
|
tabs,
|
||||||
className
|
className
|
||||||
} = props;
|
}: Readonly<MattrixwvTabGroupProps>){
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TabGroup
|
<TabGroup
|
||||||
className={clsx(
|
className={clsx(
|
||||||
@@ -24,9 +21,7 @@ export default function MattrixwvTabGroup(props: MattrixwvTabGroupProps){
|
|||||||
<MattrixwvTabList>
|
<MattrixwvTabList>
|
||||||
{
|
{
|
||||||
tabs.map((tab, index) => (
|
tabs.map((tab, index) => (
|
||||||
<MattrixwvTab
|
<MattrixwvTab key={index}>
|
||||||
key={index}
|
|
||||||
>
|
|
||||||
{tab.tab}
|
{tab.tab}
|
||||||
</MattrixwvTab>
|
</MattrixwvTab>
|
||||||
))
|
))
|
||||||
@@ -35,9 +30,7 @@ export default function MattrixwvTabGroup(props: MattrixwvTabGroupProps){
|
|||||||
<MattrixwvTabPanels>
|
<MattrixwvTabPanels>
|
||||||
{
|
{
|
||||||
tabs.map((tab, index) => (
|
tabs.map((tab, index) => (
|
||||||
<MattrixwvTabPanel
|
<MattrixwvTabPanel key={index}>
|
||||||
key={index}
|
|
||||||
>
|
|
||||||
{tab.content}
|
{tab.content}
|
||||||
</MattrixwvTabPanel>
|
</MattrixwvTabPanel>
|
||||||
))
|
))
|
||||||
|
|||||||
@@ -2,16 +2,11 @@ import type { MattrixwvTabListProps } from "$/types/TabTypes";
|
|||||||
import { TabList } from "@headlessui/react";
|
import { TabList } from "@headlessui/react";
|
||||||
|
|
||||||
|
|
||||||
export default function MattrixwvTabList(props: MattrixwvTabListProps){
|
export default function MattrixwvTabList({
|
||||||
const {
|
|
||||||
children
|
children
|
||||||
} = props;
|
}: Readonly<MattrixwvTabListProps>){
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TabList
|
<TabList className="flex flex-row items-center justify-start w-full border-b">
|
||||||
className="flex flex-row items-center justify-start w-full border-b"
|
|
||||||
>
|
|
||||||
{children}
|
{children}
|
||||||
</TabList>
|
</TabList>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,16 +2,11 @@ import type { MattrixwvTabPanelProps } from "$/types/TabTypes";
|
|||||||
import { TabPanel } from "@headlessui/react";
|
import { TabPanel } from "@headlessui/react";
|
||||||
|
|
||||||
|
|
||||||
export default function MattrixwvTabPanel(props: MattrixwvTabPanelProps){
|
export default function MattrixwvTabPanel({
|
||||||
const {
|
|
||||||
children
|
children
|
||||||
} = props;
|
}: Readonly<MattrixwvTabPanelProps>){
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TabPanel
|
<TabPanel className="flex flex-row items-start justify-center w-full h-full">
|
||||||
className="flex flex-row items-start justify-center w-full h-full"
|
|
||||||
>
|
|
||||||
{children}
|
{children}
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,16 +2,11 @@ import type { MattrixwvTabPanelsProps } from "$/types/TabTypes";
|
|||||||
import { TabPanels } from "@headlessui/react";
|
import { TabPanels } from "@headlessui/react";
|
||||||
|
|
||||||
|
|
||||||
export default function MattrixwvTabPanels(props: MattrixwvTabPanelsProps){
|
export default function MattrixwvTabPanels({
|
||||||
const {
|
|
||||||
children
|
children
|
||||||
} = props;
|
}: Readonly<MattrixwvTabPanelsProps>){
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TabPanels
|
<TabPanels className="flex flex-row items-start justify-center w-full h-full overflow-scroll">
|
||||||
className="flex flex-row items-start justify-center w-full h-full overflow-scroll"
|
|
||||||
>
|
|
||||||
{children}
|
{children}
|
||||||
</TabPanels>
|
</TabPanels>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import clsx from "clsx";
|
|||||||
export default function Toaster({
|
export default function Toaster({
|
||||||
toast,
|
toast,
|
||||||
className
|
className
|
||||||
}: ToasterProps){
|
}: Readonly<ToasterProps>){
|
||||||
return (
|
return (
|
||||||
<Transition
|
<Transition
|
||||||
show={toast.length > 1 || (toast.length === 1 && toast[0].hideTime > new Date())}
|
show={toast.length > 1 || (toast.length === 1 && toast[0].hideTime > new Date())}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const themeInitialState: ThemeProviderState = {
|
|||||||
const ThemeProviderContext = createContext<ThemeProviderState>(themeInitialState);
|
const ThemeProviderContext = createContext<ThemeProviderState>(themeInitialState);
|
||||||
|
|
||||||
|
|
||||||
export default function ThemeProvider(props: ThemeProviderProps){
|
export default function ThemeProvider(props: Readonly<ThemeProviderProps>){
|
||||||
const {
|
const {
|
||||||
children,
|
children,
|
||||||
defaultTheme = "system",
|
defaultTheme = "system",
|
||||||
@@ -20,12 +20,12 @@ export default function ThemeProvider(props: ThemeProviderProps){
|
|||||||
const [ theme, setTheme ] = useState<Theme>((localStorage.getItem(storageKey) as Theme) || defaultTheme);
|
const [ theme, setTheme ] = useState<Theme>((localStorage.getItem(storageKey) as Theme) || defaultTheme);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const root = window.document.documentElement;
|
const root = globalThis.document.documentElement;
|
||||||
|
|
||||||
root.classList.remove("light", "dark");
|
root.classList.remove("light", "dark");
|
||||||
|
|
||||||
if(theme === "system"){
|
if(theme === "system"){
|
||||||
const systemTheme = window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark";
|
const systemTheme = globalThis.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark";
|
||||||
|
|
||||||
root.classList.add(systemTheme);
|
root.classList.add(systemTheme);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const ToasterProviderContext = createContext<ToastProviderState>(toastInitialSta
|
|||||||
export default function ToasterProvider({
|
export default function ToasterProvider({
|
||||||
className,
|
className,
|
||||||
children
|
children
|
||||||
}: ToastProviderProps){
|
}: Readonly<ToastProviderProps>){
|
||||||
const [ toast, setToast ] = useState<Toast[]>([]);
|
const [ toast, setToast ] = useState<Toast[]>([]);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { ButtonHTMLAttributes } from "react";
|
import type { ComponentProps } from "react";
|
||||||
|
|
||||||
|
|
||||||
export type ButtonRounding = "none" | "sm" | "md" | "lg" | "full";
|
export type ButtonRounding = "none" | "sm" | "md" | "lg" | "full";
|
||||||
@@ -7,7 +7,7 @@ export type ButtonSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|||||||
export type ButtonVariant = "standard" | "outline" | "ghost" | "outline-ghost" | "icon";
|
export type ButtonVariant = "standard" | "outline" | "ghost" | "outline-ghost" | "icon";
|
||||||
|
|
||||||
|
|
||||||
export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "size" | "type"> {
|
export interface ButtonProps extends Omit<ComponentProps<"button">, "size" | "type"> {
|
||||||
type?: "button" | "submit" | "reset";
|
type?: "button" | "submit" | "reset";
|
||||||
rounding?: ButtonRounding;
|
rounding?: ButtonRounding;
|
||||||
shape?: ButtonShape;
|
shape?: ButtonShape;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type React from "react";
|
import type React from "react";
|
||||||
import type { ChangeEventHandler, InputHTMLAttributes } from "react";
|
import type { ChangeEventHandler, ComponentProps } from "react";
|
||||||
|
|
||||||
|
|
||||||
export interface TextInputProps {
|
export interface TextInputProps {
|
||||||
@@ -167,7 +167,7 @@ export interface RadioListProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface DateInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "onChange" | "step">{
|
export interface DateInputProps extends Omit<ComponentProps<"input">, "value" | "onChange" | "step">{
|
||||||
step?: number;
|
step?: number;
|
||||||
value: Date | undefined;
|
value: Date | undefined;
|
||||||
onChange: (newValue: Date | undefined) => void;
|
onChange: (newValue: Date | undefined) => void;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { HTMLProps } from "react";
|
import type { ComponentProps } from "react";
|
||||||
|
|
||||||
|
|
||||||
export interface MessageBlockProps extends HTMLProps<HTMLDivElement> {
|
export interface MessageBlockProps extends ComponentProps<"div"> {
|
||||||
outline?: "none" | "sm" | "md" | "lg";
|
outline?: "none" | "sm" | "md" | "lg";
|
||||||
rounded?: "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
rounded?: "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,21 @@
|
|||||||
|
import type { ComponentProps } from "react";
|
||||||
|
|
||||||
|
|
||||||
export type ModalBackgroundType = "darken" | "lighten" | "blur" | "darken-blur" | "lighten-blur" | "darken-blur-radial" | "lighten-blur-radial" | "transparent" | "none";
|
export type ModalBackgroundType = "darken" | "lighten" | "blur" | "darken-blur" | "lighten-blur" | "darken-blur-radial" | "lighten-blur-radial" | "transparent" | "none";
|
||||||
|
|
||||||
|
|
||||||
export interface ModalHeaderProps {
|
export interface ModalHeaderProps extends ComponentProps<"div"> {
|
||||||
onClose?: () => void;
|
onClose?: () => void;
|
||||||
className?: string;
|
className?: string;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ModalFooterProps {
|
export interface ModalFooterProps extends ComponentProps<"div"> {
|
||||||
className?: string;
|
className?: string;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ModalBodyProps {
|
export interface ModalBodyProps extends ComponentProps<"div"> {
|
||||||
className?: string;
|
className?: string;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
import type { ComponentProps } from "react";
|
||||||
|
|
||||||
|
|
||||||
export type Align = "start" | "end";
|
export type Align = "start" | "end";
|
||||||
export type Placement = "top" | "bottom" | "left" | "right";
|
export type Placement = "top" | "bottom" | "left" | "right";
|
||||||
export type AnchorTo = `${Placement}` | `${Placement} ${Align}`;
|
export type AnchorTo = `${Placement}` | `${Placement} ${Align}`;
|
||||||
@@ -9,7 +12,7 @@ export interface PopoverMenuProps {
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface NavBarProps {
|
export interface NavBarProps extends ComponentProps<"nav"> {
|
||||||
className?: string;
|
className?: string;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -120,10 +120,10 @@ function generateTabContent(Fn: (props: ButtonProps) => JSX.Element, onClick: ()
|
|||||||
function ButtonDisplay({
|
function ButtonDisplay({
|
||||||
title,
|
title,
|
||||||
children
|
children
|
||||||
}:{
|
}: Readonly<{
|
||||||
title: React.ReactNode;
|
title: React.ReactNode;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}){
|
}>){
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="flex flex-col items-center justify-center gap-y-2"
|
className="flex flex-col items-center justify-center gap-y-2"
|
||||||
|
|||||||
@@ -77,10 +77,10 @@ function ModalPage(){
|
|||||||
function DemoCenteredModal({
|
function DemoCenteredModal({
|
||||||
display,
|
display,
|
||||||
onClose
|
onClose
|
||||||
}:{
|
}: Readonly<{
|
||||||
display: boolean;
|
display: boolean;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}){
|
}>){
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
display={display}
|
display={display}
|
||||||
@@ -97,10 +97,10 @@ function DemoCenteredModal({
|
|||||||
function DemoTopModal({
|
function DemoTopModal({
|
||||||
display,
|
display,
|
||||||
onClose
|
onClose
|
||||||
}:{
|
}: Readonly<{
|
||||||
display: boolean;
|
display: boolean;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
}){
|
}>){
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
display={display}
|
display={display}
|
||||||
|
|||||||
@@ -128,13 +128,13 @@ function ProgressPage() {
|
|||||||
function ProgressBlock({
|
function ProgressBlock({
|
||||||
label,
|
label,
|
||||||
children
|
children
|
||||||
}:{
|
}: Readonly<{
|
||||||
label: string;
|
label: string;
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}){
|
}>){
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="flex flex-col items-center justify-center w-128 gap-y-2"
|
className="flex flex-col items-center justify-center w-lg gap-y-2"
|
||||||
>
|
>
|
||||||
<h3
|
<h3
|
||||||
className="font-bold text-2xl"
|
className="font-bold text-2xl"
|
||||||
|
|||||||
@@ -579,13 +579,13 @@ export function TextContent(){
|
|||||||
<div
|
<div
|
||||||
className="flex flex-col items-center justify-center gap-y-8 mt-8 w-full"
|
className="flex flex-col items-center justify-center gap-y-8 mt-8 w-full"
|
||||||
>
|
>
|
||||||
<TextDisplay title="Text Input">
|
<GeneralInputDisplay title="Text Input">
|
||||||
<TextInput placeholder="Text Input" labelClassName="bg-(--bg-color) peer-focus:bg-(--bg-color)"/>
|
<TextInput placeholder="Text Input" labelClassName="bg-(--bg-color) peer-focus:bg-(--bg-color)"/>
|
||||||
</TextDisplay>
|
</GeneralInputDisplay>
|
||||||
<TextDisplay title="Text Area">
|
<GeneralInputDisplay title="Text Area">
|
||||||
<TextArea placeholder="Textarea" className="resize" labelClassName="bg-(--bg-color) peer-focus:bg-(--bg-color)"/>
|
<TextArea placeholder="Textarea" className="resize" labelClassName="bg-(--bg-color) peer-focus:bg-(--bg-color)"/>
|
||||||
</TextDisplay>
|
</GeneralInputDisplay>
|
||||||
<TextDisplay title="Select">
|
<GeneralInputDisplay title="Select">
|
||||||
<SelectInput placeholder={selected.label} onChange={(newValue) => setSelected(selectOptions.find((option) => option.value === newValue) || selectOptions[0])}>
|
<SelectInput placeholder={selected.label} onChange={(newValue) => setSelected(selectOptions.find((option) => option.value === newValue) || selectOptions[0])}>
|
||||||
{
|
{
|
||||||
selectOptions.map((option) => (
|
selectOptions.map((option) => (
|
||||||
@@ -599,8 +599,8 @@ export function TextContent(){
|
|||||||
))
|
))
|
||||||
}
|
}
|
||||||
</SelectInput>
|
</SelectInput>
|
||||||
</TextDisplay>
|
</GeneralInputDisplay>
|
||||||
<TextDisplay
|
<GeneralInputDisplay
|
||||||
title="Number Input"
|
title="Number Input"
|
||||||
>
|
>
|
||||||
<NumberInput
|
<NumberInput
|
||||||
@@ -610,9 +610,9 @@ export function TextContent(){
|
|||||||
>
|
>
|
||||||
Number Test
|
Number Test
|
||||||
</NumberInput>
|
</NumberInput>
|
||||||
</TextDisplay>
|
</GeneralInputDisplay>
|
||||||
{/* */
|
{/* */
|
||||||
<TextDisplay
|
<GeneralInputDisplay
|
||||||
title="Number Slider"
|
title="Number Slider"
|
||||||
>
|
>
|
||||||
<NumberSlider
|
<NumberSlider
|
||||||
@@ -621,13 +621,13 @@ export function TextContent(){
|
|||||||
value={numberValue}
|
value={numberValue}
|
||||||
onChange={setNumberValue}
|
onChange={setNumberValue}
|
||||||
/>
|
/>
|
||||||
</TextDisplay>
|
</GeneralInputDisplay>
|
||||||
/* */}
|
/* */}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function TextDisplay({
|
function GeneralInputDisplay({
|
||||||
title,
|
title,
|
||||||
children
|
children
|
||||||
}:Readonly<{
|
}:Readonly<{
|
||||||
@@ -649,13 +649,13 @@ export function FileContent(){
|
|||||||
<div
|
<div
|
||||||
className="flex flex-col items-center justify-center gap-y-8 mt-8 w-full"
|
className="flex flex-col items-center justify-center gap-y-8 mt-8 w-full"
|
||||||
>
|
>
|
||||||
<FileDisplay title="File Input">
|
<GeneralInputDisplay title="File Input">
|
||||||
<FileInput
|
<FileInput
|
||||||
showFileName={true}
|
showFileName={true}
|
||||||
showSize={true}
|
showSize={true}
|
||||||
/>
|
/>
|
||||||
</FileDisplay>
|
</GeneralInputDisplay>
|
||||||
<FileDisplay title="Drag and Drop File Input">
|
<GeneralInputDisplay title="Drag and Drop File Input">
|
||||||
<DragAndDropFileInput
|
<DragAndDropFileInput
|
||||||
showFileName={true}
|
showFileName={true}
|
||||||
showSize={true}
|
showSize={true}
|
||||||
@@ -664,24 +664,7 @@ export function FileContent(){
|
|||||||
>
|
>
|
||||||
Drag And Drop File Input
|
Drag And Drop File Input
|
||||||
</DragAndDropFileInput>
|
</DragAndDropFileInput>
|
||||||
</FileDisplay>
|
</GeneralInputDisplay>
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function FileDisplay({
|
|
||||||
title,
|
|
||||||
children
|
|
||||||
}:Readonly<{
|
|
||||||
title: React.ReactNode;
|
|
||||||
children: React.ReactNode;
|
|
||||||
}>){
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className="flex flex-col items-center justify-center gap-y-2 w-full"
|
|
||||||
>
|
|
||||||
<h2 className="text-2xl">{title}</h2>
|
|
||||||
{children}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -691,7 +674,7 @@ export function CheckboxContent(){
|
|||||||
<div
|
<div
|
||||||
className="flex flex-col items-center justify-center gap-y-8 mt-8 w-full"
|
className="flex flex-col items-center justify-center gap-y-8 mt-8 w-full"
|
||||||
>
|
>
|
||||||
<CheckboxDisplay title="Checkbox">
|
<GeneralInputDisplay title="Checkbox">
|
||||||
<div className="flex flex-row items-center justify-center gap-x-8">
|
<div className="flex flex-row items-center justify-center gap-x-8">
|
||||||
<MattrixwvCheckbox className="group-data-checked:stroke-white group-data-checked:bg-amber-400" defaultChecked={true}>Default</MattrixwvCheckbox>
|
<MattrixwvCheckbox className="group-data-checked:stroke-white group-data-checked:bg-amber-400" defaultChecked={true}>Default</MattrixwvCheckbox>
|
||||||
<PrimaryCheckbox defaultChecked={true} >Primary</PrimaryCheckbox>
|
<PrimaryCheckbox defaultChecked={true} >Primary</PrimaryCheckbox>
|
||||||
@@ -705,8 +688,8 @@ export function CheckboxContent(){
|
|||||||
<LightCheckbox defaultChecked={true}>Light</LightCheckbox>
|
<LightCheckbox defaultChecked={true}>Light</LightCheckbox>
|
||||||
<DarkCheckbox defaultChecked={true}>Dark</DarkCheckbox>
|
<DarkCheckbox defaultChecked={true}>Dark</DarkCheckbox>
|
||||||
</div>
|
</div>
|
||||||
</CheckboxDisplay>
|
</GeneralInputDisplay>
|
||||||
<CheckboxDisplay title="Checks">
|
<GeneralInputDisplay title="Checks">
|
||||||
<div className="flex flex-row items-center justify-center gap-x-8">
|
<div className="flex flex-row items-center justify-center gap-x-8">
|
||||||
<MattrixwvCheckbox className="group-data-checked:stroke-amber-400" defaultChecked={true} showBox={false}>Default</MattrixwvCheckbox>
|
<MattrixwvCheckbox className="group-data-checked:stroke-amber-400" defaultChecked={true} showBox={false}>Default</MattrixwvCheckbox>
|
||||||
<PrimaryCheckbox defaultChecked={true} showBox={false}>Primary</PrimaryCheckbox>
|
<PrimaryCheckbox defaultChecked={true} showBox={false}>Primary</PrimaryCheckbox>
|
||||||
@@ -720,24 +703,7 @@ export function CheckboxContent(){
|
|||||||
<LightCheckbox defaultChecked={true} showBox={false}>Light</LightCheckbox>
|
<LightCheckbox defaultChecked={true} showBox={false}>Light</LightCheckbox>
|
||||||
<DarkCheckbox defaultChecked={true} showBox={false}>Dark</DarkCheckbox>
|
<DarkCheckbox defaultChecked={true} showBox={false}>Dark</DarkCheckbox>
|
||||||
</div>
|
</div>
|
||||||
</CheckboxDisplay>
|
</GeneralInputDisplay>
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function CheckboxDisplay({
|
|
||||||
title,
|
|
||||||
children
|
|
||||||
}:Readonly<{
|
|
||||||
title: React.ReactNode;
|
|
||||||
children: React.ReactNode;
|
|
||||||
}>){
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className="flex flex-col items-center justify-center gap-y-2 w-full"
|
|
||||||
>
|
|
||||||
<h2 className="text-2xl">{title}</h2>
|
|
||||||
{children}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -747,7 +713,7 @@ export function RadioContent(){
|
|||||||
<div
|
<div
|
||||||
className="flex flex-col items-center justify-center gap-y-8 mt-8 w-full"
|
className="flex flex-col items-center justify-center gap-y-8 mt-8 w-full"
|
||||||
>
|
>
|
||||||
<RadioDisplay title="Sizes">
|
<GeneralInputDisplay title="Sizes">
|
||||||
<RadioList
|
<RadioList
|
||||||
>
|
>
|
||||||
<PrimaryRadioButton size="xs" value="xs">Extra Small</PrimaryRadioButton>
|
<PrimaryRadioButton size="xs" value="xs">Extra Small</PrimaryRadioButton>
|
||||||
@@ -756,8 +722,8 @@ export function RadioContent(){
|
|||||||
<PrimaryRadioButton size="lg" value="lg">Large</PrimaryRadioButton>
|
<PrimaryRadioButton size="lg" value="lg">Large</PrimaryRadioButton>
|
||||||
<PrimaryRadioButton size="xl" value="xl">Extra Large</PrimaryRadioButton>
|
<PrimaryRadioButton size="xl" value="xl">Extra Large</PrimaryRadioButton>
|
||||||
</RadioList>
|
</RadioList>
|
||||||
</RadioDisplay>
|
</GeneralInputDisplay>
|
||||||
<RadioDisplay title="Radio Checked">
|
<GeneralInputDisplay title="Radio Checked">
|
||||||
<div
|
<div
|
||||||
className="flex flex-row items-center justify-center gap-x-8"
|
className="flex flex-row items-center justify-center gap-x-8"
|
||||||
>
|
>
|
||||||
@@ -772,8 +738,8 @@ export function RadioContent(){
|
|||||||
<RadioList value="Light"><LightRadioButton value="Light">Light</LightRadioButton></RadioList>
|
<RadioList value="Light"><LightRadioButton value="Light">Light</LightRadioButton></RadioList>
|
||||||
<RadioList value="Dark"><DarkRadioButton value="Dark">Dark</DarkRadioButton></RadioList>
|
<RadioList value="Dark"><DarkRadioButton value="Dark">Dark</DarkRadioButton></RadioList>
|
||||||
</div>
|
</div>
|
||||||
</RadioDisplay>
|
</GeneralInputDisplay>
|
||||||
<RadioDisplay title="Radio Horizontal">
|
<GeneralInputDisplay title="Radio Horizontal">
|
||||||
<RadioList
|
<RadioList
|
||||||
direction="horizontal"
|
direction="horizontal"
|
||||||
>
|
>
|
||||||
@@ -789,8 +755,8 @@ export function RadioContent(){
|
|||||||
<LightRadioButton value="light">Light</LightRadioButton>
|
<LightRadioButton value="light">Light</LightRadioButton>
|
||||||
<DarkRadioButton value="dark">Dark</DarkRadioButton>
|
<DarkRadioButton value="dark">Dark</DarkRadioButton>
|
||||||
</RadioList>
|
</RadioList>
|
||||||
</RadioDisplay>
|
</GeneralInputDisplay>
|
||||||
<RadioDisplay title="Radio Vertical">
|
<GeneralInputDisplay title="Radio Vertical">
|
||||||
<RadioList
|
<RadioList
|
||||||
direction="vertical"
|
direction="vertical"
|
||||||
>
|
>
|
||||||
@@ -806,24 +772,7 @@ export function RadioContent(){
|
|||||||
<LightRadioButton value="light">Light</LightRadioButton>
|
<LightRadioButton value="light">Light</LightRadioButton>
|
||||||
<DarkRadioButton value="dark">Dark</DarkRadioButton>
|
<DarkRadioButton value="dark">Dark</DarkRadioButton>
|
||||||
</RadioList>
|
</RadioList>
|
||||||
</RadioDisplay>
|
</GeneralInputDisplay>
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function RadioDisplay({
|
|
||||||
title,
|
|
||||||
children
|
|
||||||
}:Readonly<{
|
|
||||||
title: React.ReactNode;
|
|
||||||
children: React.ReactNode;
|
|
||||||
}>){
|
|
||||||
return (
|
|
||||||
<div
|
|
||||||
className="flex flex-col items-center justify-center gap-y-2 w-full"
|
|
||||||
>
|
|
||||||
<h2 className="text-2xl">{title}</h2>
|
|
||||||
{children}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,10 +47,10 @@ import type { JSX } from "react";
|
|||||||
function LoadingGroup({
|
function LoadingGroup({
|
||||||
label,
|
label,
|
||||||
elements
|
elements
|
||||||
}:{
|
}: Readonly<{
|
||||||
label: React.ReactNode;
|
label: React.ReactNode;
|
||||||
elements: JSX.Element[];
|
elements: JSX.Element[];
|
||||||
}){
|
}>){
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="flex flex-col items-center justify-center"
|
className="flex flex-col items-center justify-center"
|
||||||
|
|||||||
Reference in New Issue
Block a user