chesai-ui 0.1.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/LICENSE +21 -0
- package/README.md +18 -0
- package/dist/chesai-ui.css +1 -0
- package/dist/chesai-ui.es.js +23190 -0
- package/dist/chesai-ui.umd.js +148 -0
- package/dist/components/accordion/index.d.ts +16 -0
- package/dist/components/appbar/index.d.ts +32 -0
- package/dist/components/avatar/AvatarGroup.d.ts +7 -0
- package/dist/components/avatar/index.d.ts +14 -0
- package/dist/components/badge/index.d.ts +10 -0
- package/dist/components/bottom-tabs/index.d.ts +31 -0
- package/dist/components/bouncy-box/index.d.ts +7 -0
- package/dist/components/button/index.d.ts +14 -0
- package/dist/components/button-group/index.d.ts +11 -0
- package/dist/components/calendar/index.d.ts +8 -0
- package/dist/components/card/index.d.ts +12 -0
- package/dist/components/checkbox/index.d.ts +5 -0
- package/dist/components/chip/index.d.ts +11 -0
- package/dist/components/context-menu/index.d.ts +34 -0
- package/dist/components/date-picker/header.d.ts +9 -0
- package/dist/components/date-picker/index.d.ts +10 -0
- package/dist/components/date-picker/input-view.d.ts +9 -0
- package/dist/components/date-picker/paginated-calendar.d.ts +8 -0
- package/dist/components/dialog/index.d.ts +37 -0
- package/dist/components/dropdown-menu/index.d.ts +31 -0
- package/dist/components/elastic-scroll-area/index.d.ts +24 -0
- package/dist/components/fab/index.d.ts +15 -0
- package/dist/components/icon-button/index.d.ts +12 -0
- package/dist/components/index.d.ts +28 -0
- package/dist/components/input/index.d.ts +18 -0
- package/dist/components/item/index.d.ts +30 -0
- package/dist/components/menubar/index.d.ts +38 -0
- package/dist/components/navigation-menu/index.d.ts +23 -0
- package/dist/components/otp-field/index.d.ts +34 -0
- package/dist/components/pull-to-refresh/index.d.ts +17 -0
- package/dist/components/radio-group/index.d.ts +18 -0
- package/dist/components/select/index.d.ts +51 -0
- package/dist/components/shallow-router/index.d.ts +63 -0
- package/dist/components/sheet/index.d.ts +41 -0
- package/dist/components/sidebar/index.d.ts +76 -0
- package/dist/components/slider/index.d.ts +9 -0
- package/dist/components/split-button/index.d.ts +19 -0
- package/dist/components/switch/index.d.ts +12 -0
- package/dist/components/table/index.d.ts +43 -0
- package/dist/components/tabs/index.d.ts +42 -0
- package/dist/components/taskbar/index.d.ts +23 -0
- package/dist/components/textarea/index.d.ts +17 -0
- package/dist/components/time-picker/index.d.ts +12 -0
- package/dist/components/toast/index.d.ts +9 -0
- package/dist/components/tooltip/index.d.ts +33 -0
- package/dist/components/typography/index.d.ts +30 -0
- package/dist/components/window-controls/index.d.ts +2 -0
- package/dist/context/List.context.d.ts +12 -0
- package/dist/hooks/use-calender.d.ts +16 -0
- package/dist/hooks/use-time-picker.d.ts +15 -0
- package/dist/hooks/useAppBar.d.ts +36 -0
- package/dist/hooks/useShallowRouter.d.ts +25 -0
- package/dist/index.d.ts +1 -0
- package/dist/storybook-utils.d.ts +4 -0
- package/package.json +50 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface RadioGroupItemProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
label?: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLInputElement>>;
|
|
7
|
+
interface RadioGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
label?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
onValueChange?: (value: string) => void;
|
|
11
|
+
name?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const Radio: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>> & {
|
|
16
|
+
Item: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLInputElement>>;
|
|
17
|
+
};
|
|
18
|
+
export { Radio, RadioGroup, RadioGroupItem };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
4
|
+
interface SelectContextProps {
|
|
5
|
+
variant: "primary" | "secondary";
|
|
6
|
+
shape: "full" | "minimal" | "sharp";
|
|
7
|
+
size: "sm" | "md" | "lg";
|
|
8
|
+
}
|
|
9
|
+
declare const selectTriggerVariants: (props?: {
|
|
10
|
+
variant?: "primary" | "secondary";
|
|
11
|
+
shape?: "full" | "minimal" | "sharp";
|
|
12
|
+
size?: "md" | "lg" | "sm";
|
|
13
|
+
isErrored?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
} & import('class-variance-authority/dist/types').ClassProp) => string;
|
|
16
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
18
|
+
interface SelectProps extends SelectPrimitive.SelectProps {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
variant?: SelectContextProps["variant"];
|
|
21
|
+
shape?: SelectContextProps["shape"];
|
|
22
|
+
size?: SelectContextProps["size"];
|
|
23
|
+
}
|
|
24
|
+
declare const Select: React.FC<SelectProps>;
|
|
25
|
+
interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {
|
|
26
|
+
error?: string;
|
|
27
|
+
variant?: VariantProps<typeof selectTriggerVariants>["variant"];
|
|
28
|
+
shape?: VariantProps<typeof selectTriggerVariants>["shape"];
|
|
29
|
+
size?: VariantProps<typeof selectTriggerVariants>["size"];
|
|
30
|
+
}
|
|
31
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
32
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
36
|
+
interface SelectWrapperProps extends Omit<SelectProps, "children" | "onChange">, VariantProps<typeof selectTriggerVariants> {
|
|
37
|
+
label?: string;
|
|
38
|
+
error?: string;
|
|
39
|
+
placeholder?: string;
|
|
40
|
+
items: {
|
|
41
|
+
value: string;
|
|
42
|
+
label: string;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
}[];
|
|
45
|
+
id?: string;
|
|
46
|
+
contentPosition?: React.ComponentProps<typeof SelectContent>["position"];
|
|
47
|
+
onValueChange?: (value: string) => void;
|
|
48
|
+
value?: string;
|
|
49
|
+
}
|
|
50
|
+
declare const SelectInput: React.ForwardRefExoticComponent<SelectWrapperProps & React.RefAttributes<HTMLButtonElement>>;
|
|
51
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectInput, };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { default as React, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { default as useShallowRouter } from '../../hooks/useShallowRouter';
|
|
3
|
+
type RouterMode = "search" | "pathname";
|
|
4
|
+
interface RouterOptions {
|
|
5
|
+
mode: RouterMode;
|
|
6
|
+
paramName: string;
|
|
7
|
+
basePath: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A custom hook to consume the ShallowRouter context.
|
|
11
|
+
* Provides access to routing functions like `push`, `replace`, and the current `path`.
|
|
12
|
+
*
|
|
13
|
+
* @returns {ReturnType<typeof useShallowRouter>} The router instance.
|
|
14
|
+
* @throws {Error} If used outside of a `<ShallowRouter>` provider.
|
|
15
|
+
*/
|
|
16
|
+
export declare const useRouter: () => ReturnType<typeof useShallowRouter>;
|
|
17
|
+
/**
|
|
18
|
+
* A custom hook to access the configuration options of the nearest ShallowRouter provider.
|
|
19
|
+
* Useful for components that need to behave differently based on the routing mode.
|
|
20
|
+
*
|
|
21
|
+
* @returns {RouterOptions} The router's configuration options.
|
|
22
|
+
* @throws {Error} If used outside of a `<ShallowRouter>` provider.
|
|
23
|
+
*/
|
|
24
|
+
export declare const useRouterOptions: () => RouterOptions;
|
|
25
|
+
interface ShallowRouterProps {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
mode?: RouterMode;
|
|
28
|
+
paramName?: string;
|
|
29
|
+
basePath?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A provider component that initializes the shallow router and makes its
|
|
33
|
+
* state and methods available to all descendant components.
|
|
34
|
+
*/
|
|
35
|
+
export declare const ShallowRouter: React.FC<ShallowRouterProps>;
|
|
36
|
+
interface ShallowRouteProps {
|
|
37
|
+
/** The path to match. Supports a trailing wildcard `*` for prefix matching. */
|
|
38
|
+
path: string;
|
|
39
|
+
children: ReactNode;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Conditionally renders its children only when its `path` prop matches the current router path.
|
|
43
|
+
* Supports a trailing wildcard `*` for prefix matching (e.g., `/users/*`).
|
|
44
|
+
*/
|
|
45
|
+
export declare const ShallowRoute: React.FC<ShallowRouteProps>;
|
|
46
|
+
interface ShallowPageProps extends HTMLAttributes<HTMLDivElement> {
|
|
47
|
+
/** The path that this page corresponds to. Used by `ShallowSwitch` to identify the active page. */
|
|
48
|
+
path: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A simple container for a page's content.
|
|
52
|
+
* It should be used as a direct child of `ShallowSwitch`.
|
|
53
|
+
*/
|
|
54
|
+
export declare const ShallowPage: React.ForwardRefExoticComponent<ShallowPageProps & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
interface ShallowSwitchProps {
|
|
56
|
+
children: React.ReactElement<ShallowPageProps> | React.ReactElement<ShallowPageProps>[];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Manages rendering `<ShallowPage>` components. It identifies the active
|
|
60
|
+
* page based on the current route and renders only that page.
|
|
61
|
+
*/
|
|
62
|
+
export declare const ShallowSwitch: React.FC<ShallowSwitchProps>;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { Drawer as VaulDrawer } from 'vaul';
|
|
4
|
+
type SheetProps = React.ComponentProps<typeof VaulDrawer.Root> & {
|
|
5
|
+
mode?: "normal" | "detached";
|
|
6
|
+
shape?: "full" | "minimal" | "sharp";
|
|
7
|
+
side?: "left" | "right";
|
|
8
|
+
/**
|
|
9
|
+
* If true, the sheet will always render as a bottom sheet,
|
|
10
|
+
* overriding the responsive behavior on desktop viewports.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
forceBottomSheet?: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare const contentVariants: (props?: {
|
|
16
|
+
side?: "bottom" | "left" | "right" | "top";
|
|
17
|
+
height?: "auto" | "snap";
|
|
18
|
+
shape?: "full" | "minimal" | "sharp";
|
|
19
|
+
mode?: "normal" | "detached";
|
|
20
|
+
} & import('class-variance-authority/dist/types').ClassProp) => string;
|
|
21
|
+
type SheetContentProps = React.ComponentProps<typeof VaulDrawer.Content> & VariantProps<typeof contentVariants>;
|
|
22
|
+
export declare const Sheet: React.FC<SheetProps> & {
|
|
23
|
+
Trigger: React.ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
24
|
+
Content: React.ForwardRefExoticComponent<Omit<SheetContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
Close: React.ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
26
|
+
Title: React.ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
27
|
+
Description: React.ForwardRefExoticComponent<import('@radix-ui/react-dialog').DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
28
|
+
Header: {
|
|
29
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
};
|
|
32
|
+
Footer: {
|
|
33
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
displayName: string;
|
|
35
|
+
};
|
|
36
|
+
Grabber: {
|
|
37
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { MotionValue } from 'framer-motion';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
type DesktopVariant = "permanent" | "modal";
|
|
4
|
+
type MobileVariant = "modal" | "push";
|
|
5
|
+
type SidebarSide = "left" | "right";
|
|
6
|
+
interface SidebarContextProps {
|
|
7
|
+
isDesktop: boolean;
|
|
8
|
+
isExpanded: boolean;
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
activeItem: string;
|
|
11
|
+
desktopVariant: DesktopVariant;
|
|
12
|
+
mobileVariant: MobileVariant;
|
|
13
|
+
side: SidebarSide;
|
|
14
|
+
collapsible: boolean;
|
|
15
|
+
indicatorId: string;
|
|
16
|
+
variant: "primary" | "secondary";
|
|
17
|
+
sidebarX: MotionValue<number>;
|
|
18
|
+
expandedWidth: number;
|
|
19
|
+
toggle: () => void;
|
|
20
|
+
onOpenChange: (isOpen: boolean) => void;
|
|
21
|
+
handleItemPress: (itemKey: string) => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Hook to access sidebar state and actions. Must be used within a <Sidebar> component.
|
|
25
|
+
*/
|
|
26
|
+
export declare const useSidebar: () => SidebarContextProps;
|
|
27
|
+
interface SidebarProps {
|
|
28
|
+
children: [
|
|
29
|
+
React.ReactElement<SidebarContainerProps>,
|
|
30
|
+
React.ReactElement<SidebarContentProps>
|
|
31
|
+
];
|
|
32
|
+
activeItem: string;
|
|
33
|
+
onItemPress: (itemKey: string) => void;
|
|
34
|
+
isOpen?: boolean;
|
|
35
|
+
onOpenChange?: (isOpen: boolean) => void;
|
|
36
|
+
defaultOpen?: boolean;
|
|
37
|
+
desktopVariant?: DesktopVariant;
|
|
38
|
+
mobileVariant?: MobileVariant;
|
|
39
|
+
side?: SidebarSide;
|
|
40
|
+
collapsible?: boolean;
|
|
41
|
+
}
|
|
42
|
+
interface SidebarContainerProps {
|
|
43
|
+
children: React.ReactNode;
|
|
44
|
+
className?: string;
|
|
45
|
+
variant?: "primary" | "secondary";
|
|
46
|
+
}
|
|
47
|
+
interface PrimaryActionProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
48
|
+
icon: React.ReactNode;
|
|
49
|
+
variant?: "primary" | "secondary";
|
|
50
|
+
}
|
|
51
|
+
interface SidebarNavProps extends React.HTMLAttributes<HTMLElement> {
|
|
52
|
+
size?: "sm" | "md" | "lg";
|
|
53
|
+
shape?: "full" | "minimal" | "sharp";
|
|
54
|
+
}
|
|
55
|
+
interface NavItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
56
|
+
itemKey: string;
|
|
57
|
+
icon: React.ReactNode;
|
|
58
|
+
endAdornment?: React.ReactNode;
|
|
59
|
+
size?: "sm" | "md" | "lg";
|
|
60
|
+
shape?: "full" | "minimal" | "sharp";
|
|
61
|
+
}
|
|
62
|
+
interface SidebarContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
63
|
+
}
|
|
64
|
+
export declare const Sidebar: React.FC<SidebarProps> & {
|
|
65
|
+
Container: React.NamedExoticComponent<SidebarContainerProps & React.RefAttributes<HTMLElement>>;
|
|
66
|
+
Header: React.MemoExoticComponent<(props: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element>;
|
|
67
|
+
PrimaryAction: React.NamedExoticComponent<PrimaryActionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
68
|
+
Nav: React.MemoExoticComponent<({ children, className, size, shape, ...props }: SidebarNavProps) => import("react/jsx-runtime").JSX.Element>;
|
|
69
|
+
Item: React.NamedExoticComponent<NavItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
70
|
+
Footer: React.MemoExoticComponent<(props: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element>;
|
|
71
|
+
Separator: React.MemoExoticComponent<(props: React.HTMLAttributes<HTMLHRElement>) => import("react/jsx-runtime").JSX.Element>;
|
|
72
|
+
SectionHeader: React.MemoExoticComponent<(props: React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element>;
|
|
73
|
+
DragHandle: React.MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
74
|
+
Content: React.NamedExoticComponent<SidebarContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
75
|
+
};
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import * as RadixSlider from "@radix-ui/react-slider";
|
|
4
|
+
declare const Slider: React.ForwardRefExoticComponent<Omit<RadixSlider.SliderProps & React.RefAttributes<HTMLSpanElement>, "ref"> & VariantProps<(props?: {
|
|
5
|
+
variant?: "linear" | "bar";
|
|
6
|
+
direction?: "horizontal" | "vertical";
|
|
7
|
+
size?: "md" | "lg" | "sm" | "xl" | "2xl";
|
|
8
|
+
} & import('class-variance-authority/dist/types').ClassProp) => string> & React.RefAttributes<HTMLSpanElement>>;
|
|
9
|
+
export { Slider };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type ButtonShape = "full" | "minimal" | "sharp";
|
|
3
|
+
type SplitButtonChildren = [
|
|
4
|
+
React.ReactElement<{
|
|
5
|
+
className?: string;
|
|
6
|
+
}>,
|
|
7
|
+
React.ReactElement<{
|
|
8
|
+
className?: string;
|
|
9
|
+
}>
|
|
10
|
+
];
|
|
11
|
+
interface SplitButtonProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
children: SplitButtonChildren;
|
|
13
|
+
shape?: ButtonShape;
|
|
14
|
+
}
|
|
15
|
+
export declare const SplitButton: {
|
|
16
|
+
({ children, className, shape, ...props }: SplitButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
declare const switchTrackVariants: (props?: {
|
|
4
|
+
size?: "md" | "lg" | "sm";
|
|
5
|
+
shape?: "full" | "minimal" | "sharp";
|
|
6
|
+
} & import('class-variance-authority/dist/types').ClassProp) => string;
|
|
7
|
+
export interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, // Omit the conflicting 'size' prop
|
|
8
|
+
VariantProps<typeof switchTrackVariants> {
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLInputElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ColumnDef, Row, Table as TanstackTable } from '@tanstack/react-table';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
declare module "@tanstack/react-table" {
|
|
5
|
+
interface ColumnMeta<TData, TValue> {
|
|
6
|
+
isAccordionHeader?: boolean;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export type { ColumnDef };
|
|
10
|
+
type ResponsiveLayout = "scroll" | "custom";
|
|
11
|
+
declare const tableVariants: (props?: {
|
|
12
|
+
layout?: "custom" | "scroll" | "desktop";
|
|
13
|
+
} & import('class-variance-authority/dist/types').ClassProp) => string;
|
|
14
|
+
export interface TableRootProps<TData> extends React.HTMLAttributes<HTMLTableElement>, VariantProps<typeof tableVariants> {
|
|
15
|
+
table: TanstackTable<TData>;
|
|
16
|
+
responsiveLayout?: ResponsiveLayout;
|
|
17
|
+
breakpoint?: "sm" | "md" | "lg";
|
|
18
|
+
stickyCellVariant?: "card" | "secondary";
|
|
19
|
+
/**
|
|
20
|
+
* A function to render a custom component for each row on mobile viewports.
|
|
21
|
+
* Required when `responsiveLayout` is set to `'custom'`.
|
|
22
|
+
* @param row The TanStack Table `row` object.
|
|
23
|
+
*/
|
|
24
|
+
renderMobileRow?: (row: Row<TData>) => React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export declare const Table: {
|
|
27
|
+
<TData extends {}>({ className, table, responsiveLayout, breakpoint, stickyCellVariant, renderMobileRow, ...props }: TableRootProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
} & {
|
|
30
|
+
Row: {
|
|
31
|
+
<TData extends {}>({ row, ...rest }: {
|
|
32
|
+
row: Row<TData>;
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
Head: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & {
|
|
38
|
+
colIndex: number;
|
|
39
|
+
} & React.RefAttributes<HTMLTableCellElement>>;
|
|
40
|
+
Cell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & {
|
|
41
|
+
colIndex: number;
|
|
42
|
+
} & React.RefAttributes<HTMLTableCellElement>>;
|
|
43
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
type TabVariant = "primary" | "secondary";
|
|
3
|
+
type PageTransition = "slide" | "fade";
|
|
4
|
+
interface TabsContextProps {
|
|
5
|
+
activeTab: string;
|
|
6
|
+
setActiveTab: (value: string) => void;
|
|
7
|
+
variant: TabVariant;
|
|
8
|
+
pageTransition: PageTransition;
|
|
9
|
+
indicatorId: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const useTabs: () => TabsContextProps;
|
|
12
|
+
interface TabsProps {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
defaultValue: string;
|
|
15
|
+
variant?: TabVariant;
|
|
16
|
+
pageTransition?: PageTransition;
|
|
17
|
+
routingMode?: "search" | "pathname";
|
|
18
|
+
routingParamName?: string;
|
|
19
|
+
/**
|
|
20
|
+
* For 'pathname' mode, specifies which tab to redirect to on initial load
|
|
21
|
+
* if the current path is the base path.
|
|
22
|
+
*/
|
|
23
|
+
initialTab?: string;
|
|
24
|
+
}
|
|
25
|
+
interface TabsListProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
26
|
+
}
|
|
27
|
+
interface TabsTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
28
|
+
value: string;
|
|
29
|
+
icon?: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
interface TabsContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
32
|
+
}
|
|
33
|
+
interface TabsPanelProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
34
|
+
value: string;
|
|
35
|
+
}
|
|
36
|
+
export declare const Tabs: React.FC<TabsProps> & {
|
|
37
|
+
List: React.ForwardRefExoticComponent<TabsListProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
Trigger: React.ForwardRefExoticComponent<TabsTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
39
|
+
Content: React.ForwardRefExoticComponent<TabsContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
40
|
+
Panel: React.ForwardRefExoticComponent<TabsPanelProps & React.RefAttributes<HTMLDivElement>>;
|
|
41
|
+
};
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
declare const taskbarVariants: (props?: {
|
|
4
|
+
variant?: "card" | "secondary" | "transparent";
|
|
5
|
+
bordered?: boolean;
|
|
6
|
+
size?: "md" | "lg" | "sm";
|
|
7
|
+
} & import('class-variance-authority/dist/types').ClassProp) => string;
|
|
8
|
+
export interface TaskbarProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof taskbarVariants> {
|
|
9
|
+
/** Content to render at the start of the taskbar (e.g., app icon, title). */
|
|
10
|
+
startAdornment?: React.ReactNode;
|
|
11
|
+
/** Content to render in the center (e.g., navigation menu). */
|
|
12
|
+
centerAdornment?: React.ReactNode;
|
|
13
|
+
/** Determines if the maximize icon should show the 'restore' state. */
|
|
14
|
+
isMaximized?: boolean;
|
|
15
|
+
/** Callback fired when the minimize button is clicked. */
|
|
16
|
+
onMinimize?: () => void;
|
|
17
|
+
/** Callback fired when the maximize/restore button is clicked. */
|
|
18
|
+
onMaximize?: () => void;
|
|
19
|
+
/** Callback fired when the close button is clicked. */
|
|
20
|
+
onClose?: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare const Taskbar: React.ForwardRefExoticComponent<TaskbarProps & React.RefAttributes<HTMLElement>>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
declare const textAreaWrapperVariants: (props?: {
|
|
4
|
+
variant?: "primary" | "secondary" | "minimal";
|
|
5
|
+
shape?: "full" | "minimal" | "sharp";
|
|
6
|
+
size?: "md" | "lg" | "sm";
|
|
7
|
+
isErrored?: boolean;
|
|
8
|
+
isFocused?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
} & import('class-variance-authority/dist/types').ClassProp) => string;
|
|
11
|
+
export interface TextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "size">, VariantProps<typeof textAreaWrapperVariants> {
|
|
12
|
+
label?: string;
|
|
13
|
+
error?: string;
|
|
14
|
+
wrapperClassName?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
import { inputWrapperVariants } from '../input';
|
|
4
|
+
export interface TimePickerProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "value" | "onChange" | "size">, VariantProps<typeof inputWrapperVariants> {
|
|
5
|
+
label?: string;
|
|
6
|
+
error?: string;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
value?: Date;
|
|
9
|
+
onChange?: (date: Date) => void;
|
|
10
|
+
variant?: "docked" | "modal";
|
|
11
|
+
}
|
|
12
|
+
export declare const TimePicker: React.ForwardRefExoticComponent<TimePickerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Toaster as Sonner } from 'sonner';
|
|
2
|
+
type ToasterProps = React.ComponentProps<typeof Sonner>;
|
|
3
|
+
/**
|
|
4
|
+
* A toaster component that displays notifications. It is a styled wrapper
|
|
5
|
+
* around the `sonner` library, configured to match the chesai-ui theme.
|
|
6
|
+
*/
|
|
7
|
+
declare const Toaster: ({ ...props }: ToasterProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { toast } from 'sonner';
|
|
9
|
+
export { Toaster };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useFloating } from '@floating-ui/react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
declare const tooltipVariants: (props?: {
|
|
5
|
+
variant?: "primary" | "secondary";
|
|
6
|
+
size?: "md" | "lg" | "sm";
|
|
7
|
+
shape?: "full" | "minimal" | "sharp";
|
|
8
|
+
} & import('class-variance-authority/dist/types').ClassProp) => string;
|
|
9
|
+
export interface TooltipProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof tooltipVariants> {
|
|
10
|
+
}
|
|
11
|
+
interface TooltipContextType {
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
14
|
+
getReferenceProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
15
|
+
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
16
|
+
floatingStyles: React.CSSProperties;
|
|
17
|
+
refs: {
|
|
18
|
+
setReference: (node: HTMLElement | null) => void;
|
|
19
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
20
|
+
};
|
|
21
|
+
middlewareData: ReturnType<typeof useFloating>["middlewareData"];
|
|
22
|
+
placement: ReturnType<typeof useFloating>["placement"];
|
|
23
|
+
arrowRef: React.RefObject<HTMLDivElement>;
|
|
24
|
+
}
|
|
25
|
+
export declare const useTooltip: () => TooltipContextType;
|
|
26
|
+
export declare const TooltipProvider: ({ children, }: {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<React.HTMLProps<HTMLElement> & {
|
|
30
|
+
asChild?: boolean;
|
|
31
|
+
}, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
32
|
+
export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
declare const variants: {
|
|
3
|
+
h1: string;
|
|
4
|
+
h2: string;
|
|
5
|
+
h3: string;
|
|
6
|
+
h4: string;
|
|
7
|
+
p: string;
|
|
8
|
+
blockquote: string;
|
|
9
|
+
highlight: string;
|
|
10
|
+
lead: string;
|
|
11
|
+
large: string;
|
|
12
|
+
small: string;
|
|
13
|
+
muted: string;
|
|
14
|
+
};
|
|
15
|
+
type TypographyOwnProps = {
|
|
16
|
+
variant?: keyof typeof variants;
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
type PolymorphicComponentProps<C extends React.ElementType, P extends object> = P & Omit<React.ComponentPropsWithoutRef<C>, keyof P>;
|
|
20
|
+
type TypographyProps<C extends React.ElementType> = PolymorphicComponentProps<C, TypographyOwnProps & {
|
|
21
|
+
as?: C;
|
|
22
|
+
}>;
|
|
23
|
+
type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>["ref"];
|
|
24
|
+
type TypographyComponent = (<C extends React.ElementType = "p">(props: TypographyProps<C> & {
|
|
25
|
+
ref?: PolymorphicRef<C>;
|
|
26
|
+
}) => React.ReactElement | null) & {
|
|
27
|
+
displayName?: string;
|
|
28
|
+
};
|
|
29
|
+
export declare const Typography: TypographyComponent;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ListContextProps {
|
|
2
|
+
isSelectionMode: boolean;
|
|
3
|
+
setIsSelectionMode: (value: boolean) => void;
|
|
4
|
+
selectedItems: Set<string | number>;
|
|
5
|
+
toggleSelection: (id: string | number) => void;
|
|
6
|
+
isSelectable: boolean;
|
|
7
|
+
isReorderable: boolean;
|
|
8
|
+
variant: 'primary' | 'secondary';
|
|
9
|
+
shape: 'full' | 'minimal' | 'sharp';
|
|
10
|
+
size: 'sm' | 'md' | 'lg';
|
|
11
|
+
}
|
|
12
|
+
export declare const ListContext: import('react').Context<ListContextProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DateRange } from 'react-day-picker';
|
|
2
|
+
export declare const useCalendar: (cursorDate: Date, value?: Date | DateRange, mode?: "single" | "range") => {
|
|
3
|
+
daysInMonth: import('date-fns').EachDayOfIntervalResult<{
|
|
4
|
+
start: Date;
|
|
5
|
+
end: Date;
|
|
6
|
+
}, undefined>;
|
|
7
|
+
weekdays: string[];
|
|
8
|
+
getDayProps: (day: Date) => {
|
|
9
|
+
isCurrentMonth: boolean;
|
|
10
|
+
isToday: boolean;
|
|
11
|
+
isSelected: boolean;
|
|
12
|
+
isRangeStart: boolean;
|
|
13
|
+
isRangeEnd: boolean;
|
|
14
|
+
isInRange: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const useTimePicker: (initialDate: Date) => {
|
|
2
|
+
time: Date;
|
|
3
|
+
setTime: import('react').Dispatch<import('react').SetStateAction<Date>>;
|
|
4
|
+
displayHour: number;
|
|
5
|
+
minutes: number;
|
|
6
|
+
period: string;
|
|
7
|
+
setHour: (hour: number) => void;
|
|
8
|
+
setMinute: (minute: number) => void;
|
|
9
|
+
setPeriod: (newPeriod: "AM" | "PM") => void;
|
|
10
|
+
formattedTime: {
|
|
11
|
+
hour: string;
|
|
12
|
+
minute: string;
|
|
13
|
+
period: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MotionStyle } from 'framer-motion';
|
|
2
|
+
import { AppBarSharedProps } from '../components/appbar';
|
|
3
|
+
export type UseAppBarOptions = AppBarSharedProps;
|
|
4
|
+
export declare const useAppBar: (options: UseAppBarOptions & {
|
|
5
|
+
appBarColor?: "background" | "card" | "primary" | "secondary";
|
|
6
|
+
}) => {
|
|
7
|
+
isScrolled: boolean;
|
|
8
|
+
contentPaddingTop: number;
|
|
9
|
+
headerProps: {
|
|
10
|
+
style: MotionStyle;
|
|
11
|
+
};
|
|
12
|
+
mainRowProps: {
|
|
13
|
+
ref: import('react').RefObject<HTMLDivElement>;
|
|
14
|
+
style: {
|
|
15
|
+
height: number | import('motion-dom').MotionValue<number>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
largeContentProps: {
|
|
19
|
+
ref: import('react').RefObject<HTMLDivElement>;
|
|
20
|
+
style: MotionStyle;
|
|
21
|
+
};
|
|
22
|
+
childrenContainerProps: {
|
|
23
|
+
style: {
|
|
24
|
+
opacity: number | import('motion-dom').MotionValue<number>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
smallHeaderProps: {
|
|
28
|
+
style: {
|
|
29
|
+
opacity: import('motion-dom').MotionValue<number>;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
finalColor: "background" | "card" | "primary" | "secondary";
|
|
33
|
+
finalShadow: "md" | "none";
|
|
34
|
+
isCollapsible: boolean;
|
|
35
|
+
shouldRenderLargeContent: boolean;
|
|
36
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
type HistoryMode = "search" | "pathname";
|
|
2
|
+
interface UseHistoryOptions {
|
|
3
|
+
mode?: HistoryMode;
|
|
4
|
+
paramName?: string;
|
|
5
|
+
basePath?: string;
|
|
6
|
+
}
|
|
7
|
+
type Params = Record<string, string | number | boolean | null | undefined>;
|
|
8
|
+
declare const useShallowRouter: (options?: UseHistoryOptions) => {
|
|
9
|
+
path: string;
|
|
10
|
+
searchParams: URLSearchParams;
|
|
11
|
+
otherParams: URLSearchParams;
|
|
12
|
+
push: (path: string, additionalParams?: Params, state?: any) => void;
|
|
13
|
+
replace: (path: string, additionalParams?: Params, state?: any) => void;
|
|
14
|
+
goBack: () => void;
|
|
15
|
+
goForward: () => void;
|
|
16
|
+
go: (n: number) => void;
|
|
17
|
+
updateParams: (params: Params, replaceHistory?: boolean) => void;
|
|
18
|
+
clearParams: (keepPath?: boolean) => void;
|
|
19
|
+
getParam: (key: string) => string;
|
|
20
|
+
hasParam: (key: string) => boolean;
|
|
21
|
+
length: number;
|
|
22
|
+
href: string;
|
|
23
|
+
basename: string;
|
|
24
|
+
};
|
|
25
|
+
export default useShallowRouter;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|