@engrate/components 0.0.5 → 0.1.1
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/README.md +9 -19
- package/dist/components/index.d.ts +1 -0
- package/dist/components/ui/AlertDialog/AlertDialog.d.ts +36 -0
- package/dist/components/ui/AlertDialog/index.d.ts +2 -0
- package/dist/components/ui/Badge/Badge.d.ts +24 -0
- package/dist/components/ui/Badge/index.d.ts +2 -0
- package/dist/components/ui/Breadcrumbs/Breadcrumbs.d.ts +44 -0
- package/dist/components/ui/Breadcrumbs/index.d.ts +2 -0
- package/dist/components/ui/Button/Button.d.ts +24 -0
- package/dist/components/ui/Button/index.d.ts +2 -0
- package/dist/components/ui/Card/Card.d.ts +29 -0
- package/dist/components/ui/Card/index.d.ts +1 -0
- package/dist/components/ui/Checkbox/Checkbox.d.ts +18 -0
- package/dist/components/ui/Checkbox/index.d.ts +2 -0
- package/dist/components/ui/ContextMenu/ContextMenu.d.ts +40 -0
- package/dist/components/ui/ContextMenu/index.d.ts +2 -0
- package/dist/components/ui/DatePicker/DatePicker.d.ts +47 -0
- package/dist/components/ui/DatePicker/index.d.ts +2 -0
- package/dist/components/ui/DateTimePicker/DateTimePicker.d.ts +51 -0
- package/dist/components/ui/DateTimePicker/index.d.ts +2 -0
- package/dist/components/ui/Divider/Divider.d.ts +32 -0
- package/dist/components/ui/Divider/index.d.ts +2 -0
- package/dist/components/ui/DropdownMenu/DropdownMenu.d.ts +45 -0
- package/dist/components/ui/DropdownMenu/index.d.ts +2 -0
- package/dist/components/ui/Eyebrow/Eyebrow.d.ts +11 -0
- package/dist/components/ui/Eyebrow/index.d.ts +2 -0
- package/dist/components/ui/FormField/FormField.d.ts +32 -0
- package/dist/components/ui/FormField/index.d.ts +2 -0
- package/dist/components/ui/FormMessage/FormMessage.d.ts +18 -0
- package/dist/components/ui/FormMessage/index.d.ts +2 -0
- package/dist/components/ui/Grid/Grid.d.ts +94 -0
- package/dist/components/ui/Grid/index.d.ts +2 -0
- package/dist/components/ui/Heading/Heading.d.ts +20 -0
- package/dist/components/ui/Heading/index.d.ts +1 -0
- package/dist/components/ui/Input/Input.d.ts +20 -0
- package/dist/components/ui/Input/index.d.ts +2 -0
- package/dist/components/ui/Label/Label.d.ts +21 -0
- package/dist/components/ui/Label/index.d.ts +2 -0
- package/dist/components/ui/Link/Link.d.ts +24 -0
- package/dist/components/ui/Link/index.d.ts +2 -0
- package/dist/components/ui/Modal/Modal.d.ts +32 -0
- package/dist/components/ui/Modal/index.d.ts +2 -0
- package/dist/components/ui/ProgressIndicator/ProgressIndicator.d.ts +33 -0
- package/dist/components/ui/ProgressIndicator/index.d.ts +2 -0
- package/dist/components/ui/Radio/Radio.d.ts +29 -0
- package/dist/components/ui/Radio/index.d.ts +2 -0
- package/dist/components/ui/Select/Select.d.ts +39 -0
- package/dist/components/ui/Select/index.d.ts +2 -0
- package/dist/components/ui/Skeleton/Skeleton.d.ts +25 -0
- package/dist/components/ui/Skeleton/index.d.ts +2 -0
- package/dist/components/ui/Spinner/Spinner.d.ts +24 -0
- package/dist/components/ui/Spinner/index.d.ts +2 -0
- package/dist/components/ui/Stack/Stack.d.ts +36 -0
- package/dist/components/ui/Stack/index.d.ts +2 -0
- package/dist/components/ui/Switch/Switch.d.ts +18 -0
- package/dist/components/ui/Switch/index.d.ts +2 -0
- package/dist/components/ui/TabList/TabList.d.ts +61 -0
- package/dist/components/ui/TabList/index.d.ts +2 -0
- package/dist/components/ui/Table/Table.d.ts +88 -0
- package/dist/components/ui/Table/index.d.ts +2 -0
- package/dist/components/ui/Text/Text.d.ts +21 -0
- package/dist/components/ui/Text/index.d.ts +1 -0
- package/dist/components/ui/Textarea/Textarea.d.ts +22 -0
- package/dist/components/ui/Textarea/index.d.ts +2 -0
- package/dist/components/ui/Toast/Toast.d.ts +27 -0
- package/dist/components/ui/Toast/index.d.ts +2 -0
- package/dist/components/ui/Tooltip/Tooltip.d.ts +34 -0
- package/dist/components/ui/Tooltip/index.d.ts +2 -0
- package/dist/components/ui/index.d.ts +33 -0
- package/dist/index.cjs.js +20 -20
- package/dist/index.d.ts +2 -857
- package/dist/index.es.js +5202 -3482
- package/dist/lib/utils.d.ts +11 -0
- package/dist/styles.css +1 -1
- package/dist/tailwind.preset.d.ts +47 -0
- package/dist/test/setup.d.ts +0 -0
- package/package.json +8 -5
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const gridVariants: (props?: ({
|
|
3
|
+
cols?: 1 | 2 | 3 | 4 | 5 | 6 | 12 | null | undefined;
|
|
4
|
+
gap?: "sm" | "lg" | "none" | "md" | "xl" | "xs" | "2xl" | null | undefined;
|
|
5
|
+
align?: "end" | "start" | "center" | "stretch" | "baseline" | null | undefined;
|
|
6
|
+
justify?: "end" | "start" | "center" | "stretch" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
type ColsValue = 1 | 2 | 3 | 4 | 5 | 6 | 12;
|
|
9
|
+
type GapValue = 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
10
|
+
type AlignValue = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
11
|
+
type JustifyValue = 'start' | 'center' | 'end' | 'stretch';
|
|
12
|
+
type ResponsiveValue<T> = T | {
|
|
13
|
+
base?: T;
|
|
14
|
+
sm?: T;
|
|
15
|
+
md?: T;
|
|
16
|
+
lg?: T;
|
|
17
|
+
xl?: T;
|
|
18
|
+
'2xl'?: T;
|
|
19
|
+
};
|
|
20
|
+
interface GridProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'cols'> {
|
|
21
|
+
/** Number of columns in the grid. Supports responsive values. */
|
|
22
|
+
cols?: ResponsiveValue<ColsValue>;
|
|
23
|
+
/** Gap between grid items. Supports responsive values. */
|
|
24
|
+
gap?: ResponsiveValue<GapValue>;
|
|
25
|
+
/** Vertical alignment of items. Supports responsive values. */
|
|
26
|
+
align?: ResponsiveValue<AlignValue>;
|
|
27
|
+
/** Horizontal alignment of items. Supports responsive values. */
|
|
28
|
+
justify?: ResponsiveValue<JustifyValue>;
|
|
29
|
+
/** Render as a child component using Slot */
|
|
30
|
+
asChild?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Grid component for consistent layout structures.
|
|
34
|
+
* Provides a flexible grid system with configurable columns, gaps, and alignment.
|
|
35
|
+
* Supports responsive values for mobile-first responsive layouts.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* // Simple usage
|
|
40
|
+
* <Grid cols={3} gap="lg">
|
|
41
|
+
* <Card>Item 1</Card>
|
|
42
|
+
* <Card>Item 2</Card>
|
|
43
|
+
* <Card>Item 3</Card>
|
|
44
|
+
* </Grid>
|
|
45
|
+
*
|
|
46
|
+
* // Responsive usage
|
|
47
|
+
* <Grid cols={{ base: 1, md: 2, lg: 3 }} gap={{ base: 'md', lg: 'xl' }}>
|
|
48
|
+
* <Card>Item 1</Card>
|
|
49
|
+
* <Card>Item 2</Card>
|
|
50
|
+
* <Card>Item 3</Card>
|
|
51
|
+
* </Grid>
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
declare const gridItemVariants: (props?: ({
|
|
56
|
+
colSpan?: 1 | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 10 | "full" | 7 | 8 | 9 | null | undefined;
|
|
57
|
+
rowSpan?: 1 | 2 | 3 | 4 | 5 | 6 | "full" | null | undefined;
|
|
58
|
+
colStart?: 1 | "auto" | 2 | 3 | 4 | 5 | 6 | 11 | 12 | 10 | 7 | 8 | 9 | null | undefined;
|
|
59
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
60
|
+
type ColSpanValue = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'full';
|
|
61
|
+
type RowSpanValue = 1 | 2 | 3 | 4 | 5 | 6 | 'full';
|
|
62
|
+
type ColStartValue = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'auto';
|
|
63
|
+
interface GridItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
64
|
+
/** Column span for the item. Supports responsive values. */
|
|
65
|
+
colSpan?: ResponsiveValue<ColSpanValue>;
|
|
66
|
+
/** Row span for the item. Supports responsive values. */
|
|
67
|
+
rowSpan?: ResponsiveValue<RowSpanValue>;
|
|
68
|
+
/** Column start position for the item. Supports responsive values. */
|
|
69
|
+
colStart?: ResponsiveValue<ColStartValue>;
|
|
70
|
+
/** Render as a child component using Slot */
|
|
71
|
+
asChild?: boolean;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* GridItem component for controlling individual item placement within a Grid.
|
|
75
|
+
* Supports responsive values for mobile-first responsive layouts.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```tsx
|
|
79
|
+
* // Simple usage
|
|
80
|
+
* <Grid cols={12}>
|
|
81
|
+
* <GridItem colSpan={8}>Main content</GridItem>
|
|
82
|
+
* <GridItem colSpan={4}>Sidebar</GridItem>
|
|
83
|
+
* </Grid>
|
|
84
|
+
*
|
|
85
|
+
* // Responsive usage
|
|
86
|
+
* <Grid cols={{ base: 1, lg: 12 }}>
|
|
87
|
+
* <GridItem colSpan={{ base: 'full', lg: 8 }}>Main content</GridItem>
|
|
88
|
+
* <GridItem colSpan={{ base: 'full', lg: 4 }}>Sidebar</GridItem>
|
|
89
|
+
* </Grid>
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
declare const GridItem: React.ForwardRefExoticComponent<GridItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
93
|
+
export { Grid, gridVariants, GridItem, gridItemVariants };
|
|
94
|
+
export type { GridProps, GridItemProps, ResponsiveValue };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const headingVariants: (props?: ({
|
|
4
|
+
level?: "hero" | "h1" | "h2" | "h3" | "h4" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
type HeadingElement = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
7
|
+
interface HeadingProps extends React.HTMLAttributes<HTMLHeadingElement>, VariantProps<typeof headingVariants> {
|
|
8
|
+
/**
|
|
9
|
+
* Render as a different element using Radix Slot
|
|
10
|
+
*/
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Override the default HTML element for semantic flexibility
|
|
14
|
+
* @default Matches the level prop (hero renders as h1)
|
|
15
|
+
*/
|
|
16
|
+
as?: HeadingElement;
|
|
17
|
+
}
|
|
18
|
+
declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
19
|
+
export { Heading, headingVariants };
|
|
20
|
+
export type { HeadingProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Heading';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const inputVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "error" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, VariantProps<typeof inputVariants> {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Text input component following Engrate brand guidelines.
|
|
10
|
+
* Features rounded corners, subtle background, and sunflower focus ring.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Input placeholder="Enter your email" />
|
|
15
|
+
* <Input variant="error" placeholder="Invalid input" />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
19
|
+
export { Input, inputVariants };
|
|
20
|
+
export type { InputProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
declare const labelVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "default" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
interface LabelProps extends React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>, VariantProps<typeof labelVariants> {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Form label component following Engrate brand guidelines.
|
|
11
|
+
* Uses text-tertiary color and Work Sans font.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Label htmlFor="email">Email address</Label>
|
|
16
|
+
* <Label size="sm">Small label</Label>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
20
|
+
export { Label, labelVariants };
|
|
21
|
+
export type { LabelProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const linkVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "nav" | "muted" | null | undefined;
|
|
5
|
+
size?: "sm" | "default" | "lg" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement>, VariantProps<typeof linkVariants> {
|
|
8
|
+
/** Render as a child component (for use with Next.js Link, etc.) */
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Link component for navigation following Engrate brand guidelines.
|
|
13
|
+
* Supports multiple variants for different use cases.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Link href="/about">About us</Link>
|
|
18
|
+
* <Link href="/docs" variant="nav">Documentation</Link>
|
|
19
|
+
* <Link asChild><NextLink href="/page">Next.js Link</NextLink></Link>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
23
|
+
export { Link, linkVariants };
|
|
24
|
+
export type { LinkProps };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
4
|
+
declare const Modal: React.FC<DialogPrimitive.DialogProps>;
|
|
5
|
+
declare const ModalTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
declare const ModalPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
7
|
+
declare const ModalClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
interface ModalOverlayProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay> {
|
|
9
|
+
}
|
|
10
|
+
declare const ModalOverlay: React.ForwardRefExoticComponent<ModalOverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const modalContentVariants: (props?: ({
|
|
12
|
+
size?: "sm" | "default" | "lg" | "full" | null | undefined;
|
|
13
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
14
|
+
interface ModalContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>, VariantProps<typeof modalContentVariants> {
|
|
15
|
+
/** Whether to show the default close button in the top-right corner */
|
|
16
|
+
showCloseButton?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const ModalContent: React.ForwardRefExoticComponent<ModalContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
interface ModalHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
20
|
+
}
|
|
21
|
+
declare const ModalHeader: React.ForwardRefExoticComponent<ModalHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
interface ModalFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
}
|
|
24
|
+
declare const ModalFooter: React.ForwardRefExoticComponent<ModalFooterProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
interface ModalTitleProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title> {
|
|
26
|
+
}
|
|
27
|
+
declare const ModalTitle: React.ForwardRefExoticComponent<ModalTitleProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
28
|
+
interface ModalDescriptionProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description> {
|
|
29
|
+
}
|
|
30
|
+
declare const ModalDescription: React.ForwardRefExoticComponent<ModalDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
|
|
31
|
+
export { Modal, ModalTrigger, ModalPortal, ModalOverlay, ModalContent, ModalClose, ModalHeader, ModalFooter, ModalTitle, ModalDescription, modalContentVariants, };
|
|
32
|
+
export type { ModalOverlayProps, ModalContentProps, ModalHeaderProps, ModalFooterProps, ModalTitleProps, ModalDescriptionProps, };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Modal, ModalTrigger, ModalPortal, ModalOverlay, ModalContent, ModalClose, ModalHeader, ModalFooter, ModalTitle, ModalDescription, modalContentVariants, } from './Modal';
|
|
2
|
+
export type { ModalOverlayProps, ModalContentProps, ModalHeaderProps, ModalFooterProps, ModalTitleProps, ModalDescriptionProps, } from './Modal';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const progressIndicatorVariants: (props?: ({
|
|
4
|
+
size?: "sm" | "default" | "lg" | "xl" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
declare const progressBarVariants: (props?: ({
|
|
7
|
+
variant?: "default" | "muted" | "success" | null | undefined;
|
|
8
|
+
animated?: boolean | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
interface ProgressIndicatorProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof progressIndicatorVariants>, VariantProps<typeof progressBarVariants> {
|
|
11
|
+
/** Current progress value (0-100) */
|
|
12
|
+
value?: number;
|
|
13
|
+
/** Maximum progress value */
|
|
14
|
+
max?: number;
|
|
15
|
+
/** Accessible label for screen readers */
|
|
16
|
+
label?: string;
|
|
17
|
+
/** Whether to show indeterminate loading state */
|
|
18
|
+
indeterminate?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Progress indicator component following Engrate brand guidelines.
|
|
22
|
+
* Uses Sunflower yellow as the default color for the progress bar.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* <ProgressIndicator value={50} />
|
|
27
|
+
* <ProgressIndicator value={75} size="lg" variant="success" />
|
|
28
|
+
* <ProgressIndicator indeterminate label="Loading..." />
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare const ProgressIndicator: React.ForwardRefExoticComponent<ProgressIndicatorProps & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
+
export { ProgressIndicator, progressIndicatorVariants, progressBarVariants };
|
|
33
|
+
export type { ProgressIndicatorProps };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Radio group container component.
|
|
5
|
+
* Built on Radix UI RadioGroup for accessibility.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* <RadioGroup defaultValue="option1">
|
|
10
|
+
* <RadioGroupItem value="option1" id="option1" />
|
|
11
|
+
* <RadioGroupItem value="option2" id="option2" />
|
|
12
|
+
* </RadioGroup>
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
interface RadioGroupItemProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> {
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Radio group item component following Engrate brand guidelines.
|
|
20
|
+
* Features sunflower accent when selected.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <RadioGroupItem value="option1" id="option1" />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
28
|
+
export { RadioGroup, RadioGroupItem };
|
|
29
|
+
export type { RadioGroupItemProps };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
4
|
+
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
|
+
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
+
interface SelectTriggerProps extends React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> {
|
|
7
|
+
variant?: 'default' | 'error';
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Select trigger button following Engrate brand guidelines.
|
|
11
|
+
* Features rounded corners, subtle background, and sunflower focus ring.
|
|
12
|
+
*/
|
|
13
|
+
declare const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
/**
|
|
15
|
+
* Scrollable upward button for Select content.
|
|
16
|
+
*/
|
|
17
|
+
declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
/**
|
|
19
|
+
* Scrollable downward button for Select content.
|
|
20
|
+
*/
|
|
21
|
+
declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
/**
|
|
23
|
+
* Select dropdown content following Engrate brand guidelines.
|
|
24
|
+
*/
|
|
25
|
+
declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
26
|
+
/**
|
|
27
|
+
* Select label for grouping items.
|
|
28
|
+
*/
|
|
29
|
+
declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
30
|
+
/**
|
|
31
|
+
* Individual select option following Engrate brand guidelines.
|
|
32
|
+
*/
|
|
33
|
+
declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
/**
|
|
35
|
+
* Separator between select items.
|
|
36
|
+
*/
|
|
37
|
+
declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
38
|
+
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton, };
|
|
39
|
+
export type { SelectTriggerProps };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const skeletonVariants: (props?: ({
|
|
4
|
+
variant?: "text" | "default" | "circular" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
interface SkeletonProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof skeletonVariants> {
|
|
7
|
+
/** Width of the skeleton (CSS value or Tailwind class) */
|
|
8
|
+
width?: string | number;
|
|
9
|
+
/** Height of the skeleton (CSS value or Tailwind class) */
|
|
10
|
+
height?: string | number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Skeleton component for indicating loading states.
|
|
14
|
+
* Displays a pulsing placeholder while content is loading.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <Skeleton width={200} height={20} />
|
|
19
|
+
* <Skeleton variant="circular" width={40} height={40} />
|
|
20
|
+
* <Skeleton variant="text" className="w-full h-4" />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
|
+
export { Skeleton, skeletonVariants };
|
|
25
|
+
export type { SkeletonProps };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const spinnerVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "muted" | "inverted" | null | undefined;
|
|
5
|
+
size?: "sm" | "default" | "lg" | "xl" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
interface SpinnerProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof spinnerVariants> {
|
|
8
|
+
/** Accessible label for screen readers */
|
|
9
|
+
label?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Loading spinner component following Engrate brand guidelines.
|
|
13
|
+
* Uses Sunflower yellow as the default color.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Spinner />
|
|
18
|
+
* <Spinner size="lg" variant="muted" />
|
|
19
|
+
* <Spinner label="Loading data..." />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
declare const Spinner: React.ForwardRefExoticComponent<SpinnerProps & React.RefAttributes<HTMLSpanElement>>;
|
|
23
|
+
export { Spinner, spinnerVariants };
|
|
24
|
+
export type { SpinnerProps };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const stackVariants: (props?: ({
|
|
4
|
+
direction?: "horizontal" | "vertical" | null | undefined;
|
|
5
|
+
gap?: "sm" | "lg" | "none" | "md" | "xl" | "xs" | "2xl" | null | undefined;
|
|
6
|
+
align?: "end" | "start" | "center" | "stretch" | "baseline" | null | undefined;
|
|
7
|
+
justify?: "end" | "start" | "center" | "between" | "around" | "evenly" | null | undefined;
|
|
8
|
+
wrap?: "wrap" | "nowrap" | "wrap-reverse" | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
interface StackProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof stackVariants> {
|
|
11
|
+
/** Render as a child component using Slot */
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Stack component for arranging elements in a vertical or horizontal stack.
|
|
16
|
+
* Provides a flexible layout system with configurable direction, gaps, and alignment.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* // Vertical stack (default)
|
|
21
|
+
* <Stack gap="lg">
|
|
22
|
+
* <Card>Item 1</Card>
|
|
23
|
+
* <Card>Item 2</Card>
|
|
24
|
+
* <Card>Item 3</Card>
|
|
25
|
+
* </Stack>
|
|
26
|
+
*
|
|
27
|
+
* // Horizontal stack
|
|
28
|
+
* <Stack direction="horizontal" gap="md" align="center">
|
|
29
|
+
* <Button>Action 1</Button>
|
|
30
|
+
* <Button>Action 2</Button>
|
|
31
|
+
* </Stack>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare const Stack: React.ForwardRefExoticComponent<StackProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
|
+
export { Stack, stackVariants };
|
|
36
|
+
export type { StackProps };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root> {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Switch component following Engrate brand guidelines.
|
|
7
|
+
* Built on Radix UI Switch for accessibility.
|
|
8
|
+
* Features sunflower background when on.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <Switch id="notifications" />
|
|
13
|
+
* <Switch defaultChecked />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export { Switch };
|
|
18
|
+
export type { SwitchProps };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface TabsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** The default active tab value */
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
/** Controlled active tab value */
|
|
7
|
+
value?: string;
|
|
8
|
+
/** Callback when active tab changes */
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Root container for the tabs component.
|
|
13
|
+
* Manages the active tab state and provides context to child components.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Tabs defaultValue="tab1">
|
|
18
|
+
* <TabList>
|
|
19
|
+
* <TabTrigger value="tab1">Tab 1</TabTrigger>
|
|
20
|
+
* <TabTrigger value="tab2">Tab 2</TabTrigger>
|
|
21
|
+
* </TabList>
|
|
22
|
+
* <TabContent value="tab1">Content 1</TabContent>
|
|
23
|
+
* <TabContent value="tab2">Content 2</TabContent>
|
|
24
|
+
* </Tabs>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
declare const Tabs: React.ForwardRefExoticComponent<TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
declare const tabListVariants: (props?: ({
|
|
29
|
+
variant?: "default" | "pills" | null | undefined;
|
|
30
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
31
|
+
interface TabListProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof tabListVariants> {
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Container for tab triggers. Renders the row of clickable tabs.
|
|
35
|
+
*/
|
|
36
|
+
declare const TabList: React.ForwardRefExoticComponent<TabListProps & React.RefAttributes<HTMLDivElement>>;
|
|
37
|
+
declare const tabTriggerVariants: (props?: ({
|
|
38
|
+
variant?: "default" | "pills" | null | undefined;
|
|
39
|
+
size?: "sm" | "default" | "lg" | null | undefined;
|
|
40
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
41
|
+
interface TabTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof tabTriggerVariants> {
|
|
42
|
+
/** Unique value identifying this tab */
|
|
43
|
+
value: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Individual tab trigger button. Clicking activates the associated TabContent.
|
|
47
|
+
*/
|
|
48
|
+
declare const TabTrigger: React.ForwardRefExoticComponent<TabTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
49
|
+
declare const tabContentVariants: (props?: ({
|
|
50
|
+
size?: "sm" | "default" | "lg" | null | undefined;
|
|
51
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
52
|
+
interface TabContentProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof tabContentVariants> {
|
|
53
|
+
/** Value matching the TabTrigger this content belongs to */
|
|
54
|
+
value: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Content panel for a tab. Only visible when the matching tab is active.
|
|
58
|
+
*/
|
|
59
|
+
declare const TabContent: React.ForwardRefExoticComponent<TabContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
export { Tabs, TabList, tabListVariants, TabTrigger, tabTriggerVariants, TabContent, tabContentVariants, };
|
|
61
|
+
export type { TabsProps, TabListProps, TabTriggerProps, TabContentProps };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const tableVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "striped" | null | undefined;
|
|
5
|
+
size?: "default" | "compact" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
declare const tableRowVariants: (props?: ({
|
|
8
|
+
variant?: "default" | "striped" | null | undefined;
|
|
9
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
10
|
+
declare const tableHeadVariants: (props?: ({
|
|
11
|
+
sortable?: boolean | null | undefined;
|
|
12
|
+
size?: "default" | "compact" | null | undefined;
|
|
13
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
14
|
+
interface TableProps extends React.HTMLAttributes<HTMLTableElement>, VariantProps<typeof tableVariants> {
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Table root component following Engrate brand guidelines.
|
|
18
|
+
* Features light gray backgrounds and subtle borders.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <Table>
|
|
23
|
+
* <TableHeader>
|
|
24
|
+
* <TableRow>
|
|
25
|
+
* <TableHead>Name</TableHead>
|
|
26
|
+
* </TableRow>
|
|
27
|
+
* </TableHeader>
|
|
28
|
+
* <TableBody>
|
|
29
|
+
* <TableRow>
|
|
30
|
+
* <TableCell>John Doe</TableCell>
|
|
31
|
+
* </TableRow>
|
|
32
|
+
* </TableBody>
|
|
33
|
+
* </Table>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>>;
|
|
37
|
+
interface TableHeaderProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
38
|
+
}
|
|
39
|
+
declare const TableHeader: React.ForwardRefExoticComponent<TableHeaderProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
40
|
+
interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
41
|
+
}
|
|
42
|
+
declare const TableBody: React.ForwardRefExoticComponent<TableBodyProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
43
|
+
interface TableFooterProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
44
|
+
}
|
|
45
|
+
declare const TableFooter: React.ForwardRefExoticComponent<TableFooterProps & React.RefAttributes<HTMLTableSectionElement>>;
|
|
46
|
+
interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement>, VariantProps<typeof tableRowVariants> {
|
|
47
|
+
}
|
|
48
|
+
declare const TableRow: React.ForwardRefExoticComponent<TableRowProps & React.RefAttributes<HTMLTableRowElement>>;
|
|
49
|
+
type SortDirection = 'asc' | 'desc' | null;
|
|
50
|
+
interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement>, Omit<VariantProps<typeof tableHeadVariants>, 'size'> {
|
|
51
|
+
/** Enable sorting for this column */
|
|
52
|
+
sortable?: boolean;
|
|
53
|
+
/** Current sort direction */
|
|
54
|
+
sortDirection?: SortDirection;
|
|
55
|
+
/** Callback when sort is triggered */
|
|
56
|
+
onSort?: () => void;
|
|
57
|
+
}
|
|
58
|
+
declare const TableHead: React.ForwardRefExoticComponent<TableHeadProps & React.RefAttributes<HTMLTableCellElement>>;
|
|
59
|
+
interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement> {
|
|
60
|
+
}
|
|
61
|
+
declare const TableCell: React.ForwardRefExoticComponent<TableCellProps & React.RefAttributes<HTMLTableCellElement>>;
|
|
62
|
+
interface TableCaptionProps extends React.HTMLAttributes<HTMLTableCaptionElement> {
|
|
63
|
+
}
|
|
64
|
+
declare const TableCaption: React.ForwardRefExoticComponent<TableCaptionProps & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
65
|
+
interface UseSortableTableOptions<T> {
|
|
66
|
+
data: T[];
|
|
67
|
+
initialSortKey?: keyof T | null;
|
|
68
|
+
initialSortDirection?: 'asc' | 'desc';
|
|
69
|
+
}
|
|
70
|
+
interface UseSortableTableReturn<T> {
|
|
71
|
+
sortedData: T[];
|
|
72
|
+
sortKey: keyof T | null;
|
|
73
|
+
sortDirection: SortDirection;
|
|
74
|
+
handleSort: (key: keyof T) => void;
|
|
75
|
+
}
|
|
76
|
+
declare function useSortableTable<T>({ data, initialSortKey, initialSortDirection, }: UseSortableTableOptions<T>): UseSortableTableReturn<T>;
|
|
77
|
+
interface UseFilterableTableOptions<T> {
|
|
78
|
+
data: T[];
|
|
79
|
+
filterKeys?: (keyof T)[];
|
|
80
|
+
}
|
|
81
|
+
interface UseFilterableTableReturn<T> {
|
|
82
|
+
filteredData: T[];
|
|
83
|
+
filterValue: string;
|
|
84
|
+
setFilterValue: (value: string) => void;
|
|
85
|
+
}
|
|
86
|
+
declare function useFilterableTable<T>({ data, filterKeys, }: UseFilterableTableOptions<T>): UseFilterableTableReturn<T>;
|
|
87
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption, tableVariants, useSortableTable, useFilterableTable, };
|
|
88
|
+
export type { TableProps, TableHeadProps, TableRowProps, SortDirection };
|