tw-react-components 0.0.134 → 0.0.137
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/index.cjs.js +537 -200
- package/index.css +101 -0
- package/index.esm.js +431 -101
- package/package.json +5 -2
- package/src/components/Form/controls/custom/date-time/DateSelector.d.ts +2 -2
- package/src/components/Form/controls/custom/date-time/DaysView.d.ts +2 -2
- package/src/components/Form/controls/custom/date-time/MonthsView.d.ts +2 -2
- package/src/components/Form/controls/custom/date-time/TimeSelector.d.ts +2 -2
- package/src/components/Form/controls/custom/date-time/YearsView.d.ts +2 -2
- package/src/components/Form/controls/custom/date-time/index.d.ts +4 -4
- package/src/components/Form/controls/custom/file.d.ts +11 -0
- package/src/components/Form/controls/custom/index.d.ts +1 -0
- package/src/components/Form/controls/custom/select/index.d.ts +1 -1
- package/src/components/Form/controls/primitive/BasicInput.d.ts +2 -3
- package/src/components/Form/controls/primitive/NumberInput.d.ts +7 -2
- package/src/components/Form/controls/with-form.d.ts +6 -1
- package/src/components/Layout/index.d.ts +23 -2
- package/src/components/Separator/index.d.ts +2 -0
- package/src/components/Sheet/index.d.ts +26 -0
- package/src/components/Sidebar/index.d.ts +82 -23
- package/src/components/Skeleton/index.d.ts +2 -0
- package/src/components/index.d.ts +3 -0
- package/src/contexts/LayoutContext.d.ts +0 -3
- package/src/hooks/index.d.ts +1 -0
- package/src/hooks/useIsMobile.d.ts +1 -0
- package/tailwindcss-plugin.cjs +88 -0
- package/src/components/Sidebar/SidebarItem.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tw-react-components",
|
|
3
3
|
"description": "A set of React components build with TailwindCSS to make a nice dashboard.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.137",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://bacali95.github.io/tw-react-components",
|
|
7
7
|
"author": {
|
|
@@ -23,7 +23,10 @@
|
|
|
23
23
|
"import": "./index.cjs.mjs",
|
|
24
24
|
"default": "./index.cjs.js"
|
|
25
25
|
},
|
|
26
|
-
"./
|
|
26
|
+
"./css": {
|
|
27
|
+
"default": "./index.css"
|
|
28
|
+
},
|
|
29
|
+
"./config": {
|
|
27
30
|
"default": "./tailwindcss-plugin.cjs"
|
|
28
31
|
},
|
|
29
32
|
"./package.json": "./package.json"
|
|
@@ -3,8 +3,8 @@ export type View = 'days' | 'months' | 'years';
|
|
|
3
3
|
type DateSelectorProps = {
|
|
4
4
|
date: Date;
|
|
5
5
|
value?: string | Date | null;
|
|
6
|
-
minDate?: Date;
|
|
7
|
-
maxDate?: Date;
|
|
6
|
+
minDate?: Date | null;
|
|
7
|
+
maxDate?: Date | null;
|
|
8
8
|
locale?: string;
|
|
9
9
|
calendarView: View;
|
|
10
10
|
setCalendarView: (view: View) => void;
|
|
@@ -2,8 +2,8 @@ import { FC } from 'react';
|
|
|
2
2
|
type TimeSelectorProps = {
|
|
3
3
|
date: Date;
|
|
4
4
|
step?: number;
|
|
5
|
-
minDate?: Date;
|
|
6
|
-
maxDate?: Date;
|
|
5
|
+
minDate?: Date | null;
|
|
6
|
+
maxDate?: Date | null;
|
|
7
7
|
setNewDate: (date: Date) => void;
|
|
8
8
|
};
|
|
9
9
|
export declare const TimeSelector: FC<TimeSelectorProps>;
|
|
@@ -3,8 +3,8 @@ type YearsViewProps = {
|
|
|
3
3
|
date: Date;
|
|
4
4
|
value?: string | Date | null;
|
|
5
5
|
years: number[];
|
|
6
|
-
minDate?: Date;
|
|
7
|
-
maxDate?: Date;
|
|
6
|
+
minDate?: Date | null;
|
|
7
|
+
maxDate?: Date | null;
|
|
8
8
|
selectYear: (month: number) => () => void;
|
|
9
9
|
};
|
|
10
10
|
export declare const YearsView: FC<YearsViewProps>;
|
|
@@ -6,8 +6,8 @@ export type DateTimeInputProps = {
|
|
|
6
6
|
hasErrors?: boolean;
|
|
7
7
|
clearable?: boolean;
|
|
8
8
|
step?: number;
|
|
9
|
-
minDate?: Date;
|
|
10
|
-
maxDate?: Date;
|
|
9
|
+
minDate?: Date | null;
|
|
10
|
+
maxDate?: Date | null;
|
|
11
11
|
displayFormat?: string;
|
|
12
12
|
displayLocale?: string;
|
|
13
13
|
onChange?: (date?: Date | null) => void;
|
|
@@ -18,8 +18,8 @@ export declare const DateTimeInput: import("react").ForwardRefExoticComponent<{
|
|
|
18
18
|
hasErrors?: boolean;
|
|
19
19
|
clearable?: boolean;
|
|
20
20
|
step?: number;
|
|
21
|
-
minDate?: Date;
|
|
22
|
-
maxDate?: Date;
|
|
21
|
+
minDate?: Date | null;
|
|
22
|
+
maxDate?: Date | null;
|
|
23
23
|
displayFormat?: string;
|
|
24
24
|
displayLocale?: string;
|
|
25
25
|
onChange?: (date?: Date | null) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BasicInputProps } from '../primitive';
|
|
2
|
+
export type FileInputProps = {
|
|
3
|
+
value?: string | null;
|
|
4
|
+
onChange?: (item?: string) => void;
|
|
5
|
+
onFileChange?: (file?: File) => void;
|
|
6
|
+
} & Pick<BasicInputProps<'text'>, 'className' | 'inputClassName' | 'extensionClassName' | 'name' | 'label' | 'placeholder' | 'description' | 'size' | 'accept' | 'required' | 'hasErrors' | 'disabled'>;
|
|
7
|
+
export declare const FileInput: import("react").ForwardRefExoticComponent<{
|
|
8
|
+
value?: string | null;
|
|
9
|
+
onChange?: (item?: string) => void;
|
|
10
|
+
onFileChange?: (file?: File) => void;
|
|
11
|
+
} & Pick<BasicInputProps<"text">, "size" | "label" | "accept" | "disabled" | "name" | "placeholder" | "required" | "className" | "inputClassName" | "extensionClassName" | "description" | "hasErrors"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -30,7 +30,7 @@ export type SelectInputProps<T = any> = {
|
|
|
30
30
|
multiple: true;
|
|
31
31
|
value: T[];
|
|
32
32
|
onChange?: (item?: T[]) => void;
|
|
33
|
-
}) & Pick<BasicInputProps<'text'>, 'className' | 'inputClassName' | 'extensionClassName' | 'name' | 'label' | 'size' | 'placeholder' | 'required' | 'hasErrors' | 'disabled' | 'readOnly'>;
|
|
33
|
+
}) & Pick<BasicInputProps<'text'>, 'className' | 'inputClassName' | 'extensionClassName' | 'name' | 'label' | 'description' | 'size' | 'placeholder' | 'required' | 'hasErrors' | 'disabled' | 'readOnly'>;
|
|
34
34
|
export declare const SelectInput: (<T>(props: SelectInputProps<T> & {
|
|
35
35
|
ref?: ForwardedRef<HTMLDivElement>;
|
|
36
36
|
}) => JSX.Element) & {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { LucideIcon } from 'lucide-react';
|
|
2
1
|
import { ComponentProps, FC, MouseEvent, PropsWithChildren, ReactNode } from 'react';
|
|
3
2
|
import { Size } from '../../../types';
|
|
4
3
|
export type InputType = ComponentProps<'input'>['type'] | 'textarea';
|
|
@@ -11,7 +10,7 @@ export type BasicInputProps<Type extends InputType> = {
|
|
|
11
10
|
size?: Size;
|
|
12
11
|
hasErrors?: boolean;
|
|
13
12
|
clearable?: boolean;
|
|
14
|
-
suffixIcon?:
|
|
13
|
+
suffixIcon?: FC<ComponentProps<'svg'>>;
|
|
15
14
|
onClear?: () => void;
|
|
16
15
|
onSuffixIconClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
17
16
|
} & Omit<Type extends 'textarea' ? ComponentProps<'textarea'> : ComponentProps<'input'>, 'id' | 'ref' | 'size'>;
|
|
@@ -24,7 +23,7 @@ export declare const BasicInput: import("react").ForwardRefExoticComponent<{
|
|
|
24
23
|
size?: Size;
|
|
25
24
|
hasErrors?: boolean;
|
|
26
25
|
clearable?: boolean;
|
|
27
|
-
suffixIcon?:
|
|
26
|
+
suffixIcon?: FC<ComponentProps<"svg">>;
|
|
28
27
|
onClear?: () => void;
|
|
29
28
|
onSuffixIconClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
30
29
|
} & Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> | import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "id" | "ref" | "size"> & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { BasicInputProps } from './BasicInput';
|
|
2
|
-
export type NumberInputProps = Omit<BasicInputProps<'number'>, 'type'
|
|
3
|
-
|
|
3
|
+
export type NumberInputProps = Omit<BasicInputProps<'number'>, 'type'> & {
|
|
4
|
+
unit?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const NumberInput: import("react").ForwardRefExoticComponent<Omit<BasicInputProps<"number">, "type"> & {
|
|
7
|
+
unit?: ReactNode;
|
|
8
|
+
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ForwardRefExoticComponent } from 'react';
|
|
2
2
|
import { ControllerRenderProps, Validate } from 'react-hook-form';
|
|
3
|
-
import { DateTimeInputProps, DateTimeInputType, SelectInputProps, SelectInputType } from './custom';
|
|
3
|
+
import { DateTimeInputProps, DateTimeInputType, FileInputProps, SelectInputProps, SelectInputType } from './custom';
|
|
4
4
|
import { BasicInputProps, CheckboxInputProps, EmailInputProps, InputType, NumberInputProps, PasswordInputProps, TextInputProps, TextareaInputProps } from './primitive';
|
|
5
5
|
export type WithFormProps<Type extends InputType | SelectInputType, Props = Type extends DateTimeInputType ? DateTimeInputProps : Type extends SelectInputType ? SelectInputProps : Omit<BasicInputProps<Type>, 'type'>> = {
|
|
6
6
|
name: string;
|
|
@@ -48,4 +48,9 @@ export declare const FormInputs: {
|
|
|
48
48
|
pattern?: RegExp;
|
|
49
49
|
validate?: Validate<any, any> | undefined;
|
|
50
50
|
} & Omit<SelectInputProps, "pattern" | "ref" | "name" | "value" | "onChange" | "onBlur"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
51
|
+
File: ForwardRefExoticComponent<{
|
|
52
|
+
name: string;
|
|
53
|
+
pattern?: RegExp;
|
|
54
|
+
validate?: Validate<string, any> | undefined;
|
|
55
|
+
} & Omit<FileInputProps, "pattern" | "ref" | "name" | "value" | "onChange" | "onBlur"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
51
56
|
};
|
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LucideIcon } from 'lucide-react';
|
|
2
|
+
import { ComponentProps, FC, PropsWithChildren, ReactNode } from 'react';
|
|
2
3
|
import { NavbarProps } from '../Navbar';
|
|
3
|
-
import {
|
|
4
|
+
import { Sidebar } from '../Sidebar';
|
|
5
|
+
export type SidebarItem = {
|
|
6
|
+
pathname: string;
|
|
7
|
+
title: string;
|
|
8
|
+
Icon?: LucideIcon;
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
items?: SidebarItem[];
|
|
11
|
+
};
|
|
12
|
+
export type SidebarProps = {
|
|
13
|
+
root?: ComponentProps<typeof Sidebar>;
|
|
14
|
+
basePath?: string;
|
|
15
|
+
smallLogo?: ReactNode;
|
|
16
|
+
fullLogo?: ReactNode;
|
|
17
|
+
items: (({
|
|
18
|
+
type: 'item';
|
|
19
|
+
} & SidebarItem) | {
|
|
20
|
+
type: 'group';
|
|
21
|
+
title?: string;
|
|
22
|
+
items: SidebarItem[];
|
|
23
|
+
})[];
|
|
24
|
+
};
|
|
4
25
|
type Props = {
|
|
5
26
|
className?: string;
|
|
6
27
|
sidebarProps: SidebarProps;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import * as SeparatorPrimitive from '@radix-ui/react-separator';
|
|
2
|
+
export declare const Separator: import("react").ForwardRefExoticComponent<Omit<SeparatorPrimitive.SeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as SheetPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const sheetVariants: (props?: ({
|
|
5
|
+
side?: "top" | "bottom" | "left" | "right" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
7
|
+
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
8
|
+
}
|
|
9
|
+
export declare const Sheet: React.FC<SheetPrimitive.DialogProps> & {
|
|
10
|
+
Portal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
11
|
+
Overlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
Trigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
Close: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
Content: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
Header: {
|
|
16
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
Footer: {
|
|
20
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
Title: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
24
|
+
Description: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -1,26 +1,85 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
import { Tooltip } from '../Tooltip';
|
|
4
|
+
export type SidebarContext = {
|
|
5
|
+
state: 'expanded' | 'collapsed';
|
|
6
|
+
open: boolean;
|
|
7
|
+
setOpen: (open: boolean) => void;
|
|
8
|
+
openMobile: boolean;
|
|
9
|
+
setOpenMobile: (open: boolean) => void;
|
|
10
|
+
isMobile: boolean;
|
|
11
|
+
toggleSidebar: () => void;
|
|
7
12
|
};
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
label?: ReactNode;
|
|
13
|
-
Icon: LucideIcon;
|
|
14
|
-
hidden?: boolean;
|
|
15
|
-
items?: SidebarItem[];
|
|
16
|
-
};
|
|
17
|
-
export type SidebarProps = {
|
|
13
|
+
export declare const SidebarContext: import("react").Context<SidebarContext | null>;
|
|
14
|
+
export declare function useSidebar(): SidebarContext;
|
|
15
|
+
export declare const SidebarContextProvider: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
16
|
+
defaultOpen?: boolean;
|
|
18
17
|
open?: boolean;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
onOpenChange?: (open: boolean) => void;
|
|
19
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
export declare const Sidebar: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
21
|
+
side?: "left" | "right";
|
|
22
|
+
variant?: "sidebar" | "floating" | "inset";
|
|
23
|
+
collapsible?: "offcanvas" | "icon" | "none";
|
|
24
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
25
|
+
Content: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
|
+
Footer: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
+
Group: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
28
|
+
GroupAction: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
29
|
+
asChild?: boolean;
|
|
30
|
+
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
31
|
+
GroupContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
32
|
+
GroupLabel: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
33
|
+
asChild?: boolean;
|
|
34
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
35
|
+
Header: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
36
|
+
Input: import("react").ForwardRefExoticComponent<Omit<{
|
|
37
|
+
inputClassName?: string;
|
|
38
|
+
extensionClassName?: string;
|
|
39
|
+
type?: import("../Form").InputType;
|
|
40
|
+
label?: string;
|
|
41
|
+
description?: import("react").ReactNode;
|
|
42
|
+
size?: import("..").Size;
|
|
43
|
+
hasErrors?: boolean;
|
|
44
|
+
clearable?: boolean;
|
|
45
|
+
suffixIcon?: import("react").FC<ComponentProps<"svg">>;
|
|
46
|
+
onClear?: () => void;
|
|
47
|
+
onSuffixIconClick?: (event: import("react").MouseEvent<HTMLDivElement>) => void;
|
|
48
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> | import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref" | "id" | "size"> & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>, "ref"> & import("react").RefAttributes<HTMLInputElement | HTMLTextAreaElement>>;
|
|
49
|
+
Inset: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
50
|
+
Menu: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
51
|
+
MenuAction: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
52
|
+
asChild?: boolean;
|
|
53
|
+
showOnHover?: boolean;
|
|
54
|
+
}, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
55
|
+
MenuBadge: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
56
|
+
MenuButton: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
57
|
+
asChild?: boolean;
|
|
58
|
+
isActive?: boolean;
|
|
59
|
+
tooltip?: string | ComponentProps<typeof Tooltip>;
|
|
60
|
+
} & VariantProps<(props?: ({
|
|
61
|
+
variant?: "default" | "outline" | null | undefined;
|
|
62
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
63
|
+
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
64
|
+
MenuItem: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
65
|
+
MenuSkeleton: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
66
|
+
showIcon?: boolean;
|
|
67
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
68
|
+
MenuSub: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
69
|
+
MenuSubButton: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLAnchorElement> & import("react").AnchorHTMLAttributes<HTMLAnchorElement> & {
|
|
70
|
+
asChild?: boolean;
|
|
71
|
+
size?: "sm" | "md";
|
|
72
|
+
isActive?: boolean;
|
|
73
|
+
}, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
74
|
+
MenuSubItem: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
75
|
+
Rail: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
76
|
+
Separator: import("react").ForwardRefExoticComponent<Omit<Omit<import("@radix-ui/react-separator").SeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
77
|
+
Trigger: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
78
|
+
size?: import("..").Size;
|
|
79
|
+
color?: import("..").Color;
|
|
80
|
+
variant?: import("../Button").ButtonVariant;
|
|
81
|
+
rounded?: boolean;
|
|
82
|
+
prefixIcon?: import("lucide-react").LucideIcon;
|
|
83
|
+
suffixIcon?: import("lucide-react").LucideIcon;
|
|
84
|
+
} & import("react").RefAttributes<HTMLButtonElement>, "ref"> & import("react").RefAttributes<HTMLButtonElement>>;
|
|
25
85
|
};
|
|
26
|
-
export declare const Sidebar: import("react").ForwardRefExoticComponent<SidebarProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -14,7 +14,10 @@ export * from './ListSorter';
|
|
|
14
14
|
export * from './Navbar';
|
|
15
15
|
export * from './Pagination';
|
|
16
16
|
export * from './Popover';
|
|
17
|
+
export * from './Separator';
|
|
18
|
+
export * from './Sheet';
|
|
17
19
|
export * from './Sidebar';
|
|
20
|
+
export * from './Skeleton';
|
|
18
21
|
export * from './Spinner';
|
|
19
22
|
export * from './Switch';
|
|
20
23
|
export * from './Table';
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { FC, PropsWithChildren } from 'react';
|
|
2
2
|
export type LayoutContext = {
|
|
3
3
|
theme: ThemeState;
|
|
4
|
-
sidebarOpen: boolean;
|
|
5
4
|
toggleTheme: () => void;
|
|
6
|
-
setSidebarOpen: (open: boolean) => void;
|
|
7
5
|
};
|
|
8
6
|
export declare const LayoutContext: import("react").Context<LayoutContext | undefined>;
|
|
9
7
|
export declare const LayoutContextProvider: FC<PropsWithChildren>;
|
|
10
8
|
export declare function useLayoutContext(): LayoutContext;
|
|
11
9
|
export type ThemeState = 'dark' | 'light';
|
|
12
10
|
export declare const THEME_KEY = "tw-react-components__theme";
|
|
13
|
-
export declare const SIDEBAR_KEY = "tw-react-components__sidebar";
|
package/src/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsMobile(): boolean;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
const { fontFamily } = require('tailwindcss/defaultTheme');
|
|
2
|
+
const plugin = require('tailwindcss/plugin');
|
|
3
|
+
|
|
4
|
+
module.exports = plugin(
|
|
5
|
+
() => {
|
|
6
|
+
// do nothing
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
theme: {
|
|
10
|
+
container: {
|
|
11
|
+
center: true,
|
|
12
|
+
padding: '2rem',
|
|
13
|
+
screens: {
|
|
14
|
+
'2xl': '1400px',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
extend: {
|
|
18
|
+
colors: {
|
|
19
|
+
border: 'hsl(var(--border))',
|
|
20
|
+
input: 'hsl(var(--input))',
|
|
21
|
+
ring: 'hsl(var(--ring))',
|
|
22
|
+
background: 'hsl(var(--background))',
|
|
23
|
+
foreground: 'hsl(var(--foreground))',
|
|
24
|
+
primary: {
|
|
25
|
+
DEFAULT: 'hsl(var(--primary))',
|
|
26
|
+
foreground: 'hsl(var(--primary-foreground))',
|
|
27
|
+
},
|
|
28
|
+
secondary: {
|
|
29
|
+
DEFAULT: 'hsl(var(--secondary))',
|
|
30
|
+
foreground: 'hsl(var(--secondary-foreground))',
|
|
31
|
+
},
|
|
32
|
+
destructive: {
|
|
33
|
+
DEFAULT: 'hsl(var(--destructive))',
|
|
34
|
+
foreground: 'hsl(var(--destructive-foreground))',
|
|
35
|
+
},
|
|
36
|
+
muted: {
|
|
37
|
+
DEFAULT: 'hsl(var(--muted))',
|
|
38
|
+
foreground: 'hsl(var(--muted-foreground))',
|
|
39
|
+
},
|
|
40
|
+
accent: {
|
|
41
|
+
DEFAULT: 'hsl(var(--accent))',
|
|
42
|
+
foreground: 'hsl(var(--accent-foreground))',
|
|
43
|
+
},
|
|
44
|
+
popover: {
|
|
45
|
+
DEFAULT: 'hsl(var(--popover))',
|
|
46
|
+
foreground: 'hsl(var(--popover-foreground))',
|
|
47
|
+
},
|
|
48
|
+
card: {
|
|
49
|
+
DEFAULT: 'hsl(var(--card))',
|
|
50
|
+
foreground: 'hsl(var(--card-foreground))',
|
|
51
|
+
},
|
|
52
|
+
sidebar: {
|
|
53
|
+
DEFAULT: 'hsl(var(--sidebar-background))',
|
|
54
|
+
foreground: 'hsl(var(--sidebar-foreground))',
|
|
55
|
+
primary: 'hsl(var(--sidebar-primary))',
|
|
56
|
+
'primary-foreground': 'hsl(var(--sidebar-primary-foreground))',
|
|
57
|
+
accent: 'hsl(var(--sidebar-accent))',
|
|
58
|
+
'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
|
|
59
|
+
border: 'hsl(var(--sidebar-border))',
|
|
60
|
+
ring: 'hsl(var(--sidebar-ring))',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
borderRadius: {
|
|
64
|
+
lg: `var(--radius)`,
|
|
65
|
+
md: `calc(var(--radius) - 2px)`,
|
|
66
|
+
sm: 'calc(var(--radius) - 4px)',
|
|
67
|
+
},
|
|
68
|
+
fontFamily: {
|
|
69
|
+
sans: ['var(--font-sans)', ...fontFamily.sans],
|
|
70
|
+
},
|
|
71
|
+
keyframes: {
|
|
72
|
+
'accordion-down': {
|
|
73
|
+
from: { height: '0' },
|
|
74
|
+
to: { height: 'var(--radix-accordion-content-height)' },
|
|
75
|
+
},
|
|
76
|
+
'accordion-up': {
|
|
77
|
+
from: { height: 'var(--radix-accordion-content-height)' },
|
|
78
|
+
to: { height: '0' },
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
animation: {
|
|
82
|
+
'accordion-down': 'accordion-down 0.2s ease-out',
|
|
83
|
+
'accordion-up': 'accordion-up 0.2s ease-out',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { type SidebarItem } from '.';
|
|
3
|
-
export type SidebarItemProps = SidebarItem & {
|
|
4
|
-
active?: boolean;
|
|
5
|
-
isChild?: boolean;
|
|
6
|
-
basePath: string;
|
|
7
|
-
sidebarOpen: boolean;
|
|
8
|
-
onClick?: () => void;
|
|
9
|
-
};
|
|
10
|
-
export declare const SidebarItemComp: FC<SidebarItemProps>;
|