@boilerhaus-ui/boilerhaus-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/README.md +73 -0
- package/dist/components/Accordion/Accordion.d.ts +22 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Alert/Alert.d.ts +34 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/AspectRatio/AspectRatio.d.ts +23 -0
- package/dist/components/AspectRatio/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +40 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +14 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +52 -0
- package/dist/components/Breadcrumb/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +19 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +39 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +22 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Combobox/Combobox.d.ts +27 -0
- package/dist/components/Combobox/index.d.ts +2 -0
- package/dist/components/DataTable/DataTable.d.ts +34 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.d.ts +17 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts +53 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +51 -0
- package/dist/components/DropdownMenu/index.d.ts +2 -0
- package/dist/components/FileUpload/FileUpload.d.ts +26 -0
- package/dist/components/FileUpload/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +23 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Label/Label.d.ts +20 -0
- package/dist/components/Label/index.d.ts +2 -0
- package/dist/components/PageShell/PageShell.d.ts +73 -0
- package/dist/components/PageShell/index.d.ts +2 -0
- package/dist/components/Popover/Popover.d.ts +24 -0
- package/dist/components/Popover/index.d.ts +2 -0
- package/dist/components/Progress/Progress.d.ts +26 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +29 -0
- package/dist/components/RadioGroup/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +32 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +12 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Spinner/Spinner.d.ts +18 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Stat/Stat.d.ts +22 -0
- package/dist/components/Stat/index.d.ts +2 -0
- package/dist/components/Stepper/Stepper.d.ts +24 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +17 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +73 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +28 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +23 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/Toast/Toast.d.ts +17 -0
- package/dist/components/Toast/index.d.ts +4 -0
- package/dist/components/Toast/use-toast.d.ts +26 -0
- package/dist/components/Tooltip/Tooltip.d.ts +24 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/index.d.ts +64 -0
- package/dist/index.cjs +51 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +81 -0
- package/dist/index.js +10475 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cn.d.ts +7 -0
- package/dist/tokens.css +163 -0
- package/package.json +91 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
|
|
9
|
+
|
|
10
|
+
## React Compiler
|
|
11
|
+
|
|
12
|
+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
13
|
+
|
|
14
|
+
## Expanding the ESLint configuration
|
|
15
|
+
|
|
16
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
export default defineConfig([
|
|
20
|
+
globalIgnores(['dist']),
|
|
21
|
+
{
|
|
22
|
+
files: ['**/*.{ts,tsx}'],
|
|
23
|
+
extends: [
|
|
24
|
+
// Other configs...
|
|
25
|
+
|
|
26
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
+
tseslint.configs.recommendedTypeChecked,
|
|
28
|
+
// Alternatively, use this for stricter rules
|
|
29
|
+
tseslint.configs.strictTypeChecked,
|
|
30
|
+
// Optionally, add this for stylistic rules
|
|
31
|
+
tseslint.configs.stylisticTypeChecked,
|
|
32
|
+
|
|
33
|
+
// Other configs...
|
|
34
|
+
],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: {
|
|
37
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
+
tsconfigRootDir: import.meta.dirname,
|
|
39
|
+
},
|
|
40
|
+
// other options...
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
])
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// eslint.config.js
|
|
50
|
+
import reactX from 'eslint-plugin-react-x'
|
|
51
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
52
|
+
|
|
53
|
+
export default defineConfig([
|
|
54
|
+
globalIgnores(['dist']),
|
|
55
|
+
{
|
|
56
|
+
files: ['**/*.{ts,tsx}'],
|
|
57
|
+
extends: [
|
|
58
|
+
// Other configs...
|
|
59
|
+
// Enable lint rules for React
|
|
60
|
+
reactX.configs['recommended-typescript'],
|
|
61
|
+
// Enable lint rules for React DOM
|
|
62
|
+
reactDom.configs.recommended,
|
|
63
|
+
],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
parserOptions: {
|
|
66
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
+
tsconfigRootDir: import.meta.dirname,
|
|
68
|
+
},
|
|
69
|
+
// other options...
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
])
|
|
73
|
+
```
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as AccordionPrimitive from '@radix-ui/react-accordion';
|
|
2
|
+
export declare const Accordion: import("react").ForwardRefExoticComponent<(AccordionPrimitive.AccordionSingleProps | AccordionPrimitive.AccordionMultipleProps) & import("react").RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export interface AccordionItemProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item> {
|
|
4
|
+
}
|
|
5
|
+
export interface AccordionTriggerProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger> {
|
|
6
|
+
}
|
|
7
|
+
export interface AccordionContentProps extends React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content> {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Wrapper for one collapsible section. Requires a unique `value` prop.
|
|
11
|
+
*/
|
|
12
|
+
export declare function AccordionItem({ className, ...props }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
/**
|
|
14
|
+
* Clickable header that toggles the section open/closed.
|
|
15
|
+
* Renders a rotating chevron on the right — pass children for the label.
|
|
16
|
+
*/
|
|
17
|
+
export declare function AccordionTrigger({ className, children, ...props }: AccordionTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* Collapsible body panel. Animates height via CSS keyframes that consume
|
|
20
|
+
* `--radix-accordion-content-height`.
|
|
21
|
+
*/
|
|
22
|
+
export declare function AccordionContent({ className, children, ...props }: AccordionContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type AlertVariant = 'neutral' | 'info' | 'warning' | 'danger' | 'success';
|
|
2
|
+
export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Semantic intent conveyed by the alert. Defaults to 'neutral'. */
|
|
4
|
+
variant?: AlertVariant;
|
|
5
|
+
/** Bold heading line above the description. */
|
|
6
|
+
title?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Override the default variant icon.
|
|
9
|
+
* Pass `null` to suppress the icon entirely.
|
|
10
|
+
*/
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Callback for the dismiss (×) button.
|
|
14
|
+
* When provided, an × button is rendered — the consumer is responsible
|
|
15
|
+
* for removing the alert from the DOM on click.
|
|
16
|
+
*/
|
|
17
|
+
onDismiss?: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Inline status banner. Use for form errors, page-level warnings,
|
|
21
|
+
* and contextual success/info messages.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <Alert variant="danger" title="Save failed">
|
|
25
|
+
* Check your connection and try again.
|
|
26
|
+
* </Alert>
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* // Dismissible
|
|
30
|
+
* {show && (
|
|
31
|
+
* <Alert variant="success" title="Changes saved" onDismiss={() => setShow(false)} />
|
|
32
|
+
* )}
|
|
33
|
+
*/
|
|
34
|
+
export declare function Alert({ variant, title, icon, onDismiss, className, children, ...props }: AlertProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
2
|
+
export interface AspectRatioProps extends React.ComponentPropsWithoutRef<typeof AspectRatioPrimitive.Root> {
|
|
3
|
+
/**
|
|
4
|
+
* Width-to-height ratio. Defaults to 16/9.
|
|
5
|
+
* Pass a number: `ratio={4/3}`, `ratio={1}`, `ratio={16/9}`.
|
|
6
|
+
*/
|
|
7
|
+
ratio?: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Constrains children to a fixed aspect ratio box.
|
|
11
|
+
* Children should fill the box with `w-full h-full`; use `object-cover` on `<img>`.
|
|
12
|
+
* Overlay content can be positioned absolutely inside.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <AspectRatio ratio={16 / 9}>
|
|
16
|
+
* <img src={src} alt={alt} className="w-full h-full object-cover" />
|
|
17
|
+
* </AspectRatio>
|
|
18
|
+
*
|
|
19
|
+
* <AspectRatio ratio={1} className="rounded-md overflow-hidden">
|
|
20
|
+
* <Skeleton className="w-full h-full" />
|
|
21
|
+
* </AspectRatio>
|
|
22
|
+
*/
|
|
23
|
+
export declare function AspectRatio({ ratio, className, ...props }: AspectRatioProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
3
|
+
export type AvatarSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
export interface AvatarProps extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root> {
|
|
5
|
+
/** Image URL. When absent or broken the initials fallback renders. */
|
|
6
|
+
src?: string;
|
|
7
|
+
/** Person's name — used for initials fallback and alt text. */
|
|
8
|
+
alt?: string;
|
|
9
|
+
/** Visual size. Defaults to 'md'. */
|
|
10
|
+
size?: AvatarSize;
|
|
11
|
+
}
|
|
12
|
+
export interface AvatarGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
/** Maximum avatars to display before showing an overflow count. Defaults to 4. */
|
|
14
|
+
max?: number;
|
|
15
|
+
/** Size forwarded to the overflow badge. Match the size used on child Avatars. Defaults to 'md'. */
|
|
16
|
+
size?: AvatarSize;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Circular user avatar — shows an image when available, falls back to
|
|
20
|
+
* coloured initials derived from `alt`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <Avatar src="/avatars/jlee.jpg" alt="Jordan Lee" />
|
|
24
|
+
* <Avatar alt="Jordan Lee" /> // initials fallback
|
|
25
|
+
* <Avatar alt="Jordan Lee" size="lg" />
|
|
26
|
+
*/
|
|
27
|
+
export declare function Avatar({ src, alt, size, className, ...props }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* Stacks multiple Avatars with overlap rings. Shows a "+N" overflow badge
|
|
30
|
+
* when children exceed `max`.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* <AvatarGroup max={3}>
|
|
34
|
+
* <Avatar alt="Alex Kovacs" />
|
|
35
|
+
* <Avatar alt="Jordan Lee" />
|
|
36
|
+
* <Avatar alt="Maria da Silva" />
|
|
37
|
+
* <Avatar alt="Sam Chen" /> // → "+1" badge
|
|
38
|
+
* </AvatarGroup>
|
|
39
|
+
*/
|
|
40
|
+
export declare function AvatarGroup({ children, max, size, className, ...props }: AvatarGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type BadgeVariant = 'neutral' | 'active' | 'warning' | 'danger' | 'success';
|
|
2
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
/** Semantic status conveyed by this badge. Defaults to 'neutral'. */
|
|
4
|
+
variant?: BadgeVariant;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Non-interactive status label.
|
|
8
|
+
* Conveys project state, change-order state, or any categorical label.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <Badge variant="active">In Progress</Badge>
|
|
12
|
+
* <Badge variant="danger">Blocked</Badge>
|
|
13
|
+
*/
|
|
14
|
+
export declare function Badge({ variant, className, children, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface BreadcrumbProps extends React.HTMLAttributes<HTMLElement> {
|
|
2
|
+
}
|
|
3
|
+
/**
|
|
4
|
+
* Root `<nav>` wrapper. Sets aria-label="breadcrumb".
|
|
5
|
+
*/
|
|
6
|
+
export declare function Breadcrumb({ className, ...props }: BreadcrumbProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export interface BreadcrumbListProps extends React.HTMLAttributes<HTMLOListElement> {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* `<ol>` that lays out breadcrumb items horizontally with wrapping.
|
|
11
|
+
*/
|
|
12
|
+
export declare function BreadcrumbList({ className, ...props }: BreadcrumbListProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export interface BreadcrumbItemProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `<li>` wrapper for a link or the current page label.
|
|
17
|
+
*/
|
|
18
|
+
export declare function BreadcrumbItem({ className, ...props }: BreadcrumbItemProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export interface BreadcrumbLinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
20
|
+
/** Render as child component (e.g. React Router `<Link>` or Next.js `<Link>`). */
|
|
21
|
+
asChild?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Ancestor crumb link. Use `asChild` to render as a router `<Link>`.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* <BreadcrumbLink href="/projects">Projects</BreadcrumbLink>
|
|
28
|
+
* <BreadcrumbLink asChild><Link to="/projects">Projects</Link></BreadcrumbLink>
|
|
29
|
+
*/
|
|
30
|
+
export declare function BreadcrumbLink({ asChild, className, ...props }: BreadcrumbLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export interface BreadcrumbPageProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The final (current) crumb — rendered as a `<span>` with `aria-current="page"`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function BreadcrumbPage({ className, ...props }: BreadcrumbPageProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export interface BreadcrumbSeparatorProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Separator between crumbs. Defaults to "/" — pass children to customise.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* <BreadcrumbSeparator />
|
|
44
|
+
* <BreadcrumbSeparator><ChevronRightIcon /></BreadcrumbSeparator>
|
|
45
|
+
*/
|
|
46
|
+
export declare function BreadcrumbSeparator({ children, className, ...props }: BreadcrumbSeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export interface BreadcrumbEllipsisProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Placeholder for collapsed intermediate crumbs.
|
|
51
|
+
*/
|
|
52
|
+
export declare function BreadcrumbEllipsis({ className, ...props }: BreadcrumbEllipsisProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, BreadcrumbEllipsis, } from './Breadcrumb';
|
|
2
|
+
export type { BreadcrumbProps, BreadcrumbListProps, BreadcrumbItemProps, BreadcrumbLinkProps, BreadcrumbPageProps, BreadcrumbSeparatorProps, BreadcrumbEllipsisProps, } from './Breadcrumb';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'destructive';
|
|
2
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
/** Visual treatment of the button. Defaults to 'primary'. */
|
|
4
|
+
variant?: ButtonVariant;
|
|
5
|
+
/**
|
|
6
|
+
* Render as a child element instead of <button>.
|
|
7
|
+
* Useful for routing links: <Button asChild><a href="/path">Go</a></Button>
|
|
8
|
+
*/
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The foundational interactive element.
|
|
13
|
+
* All styles are derived from Bauhaus design tokens.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* <Button variant="primary">Submit</Button>
|
|
17
|
+
* <Button variant="destructive" asChild><a href="/delete">Delete</a></Button>
|
|
18
|
+
*/
|
|
19
|
+
export declare function Button({ variant, asChild, className, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
}
|
|
3
|
+
export interface CardHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
}
|
|
5
|
+
export interface CardBodyProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
}
|
|
7
|
+
export interface CardFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Elevated container for project summaries, scope items, and change orders.
|
|
11
|
+
* Compose with CardHeader, CardBody, CardFooter as needed.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <Card>
|
|
15
|
+
* <CardHeader>
|
|
16
|
+
* <span>Kitchen Reno</span>
|
|
17
|
+
* <Badge variant="active">In Progress</Badge>
|
|
18
|
+
* </CardHeader>
|
|
19
|
+
* <CardBody>…</CardBody>
|
|
20
|
+
* <CardFooter>
|
|
21
|
+
* <Button variant="ghost">View</Button>
|
|
22
|
+
* </CardFooter>
|
|
23
|
+
* </Card>
|
|
24
|
+
*/
|
|
25
|
+
export declare function Card({ className, children, ...props }: CardProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
/**
|
|
27
|
+
* Optional header slot. Renders a flex row — ideal for a title + Badge.
|
|
28
|
+
* Separated from the body by a 1px rule border.
|
|
29
|
+
*/
|
|
30
|
+
export declare function CardHeader({ className, children, ...props }: CardHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* Main content area. Handles its own padding.
|
|
33
|
+
*/
|
|
34
|
+
export declare function CardBody({ className, children, ...props }: CardBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
/**
|
|
36
|
+
* Optional footer slot. Renders a flex row for action buttons.
|
|
37
|
+
* Separated from the body by a 1px rule border.
|
|
38
|
+
*/
|
|
39
|
+
export declare function CardFooter({ className, children, ...props }: CardFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
2
|
+
export interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root> {
|
|
3
|
+
}
|
|
4
|
+
/**
|
|
5
|
+
* Accessible checkbox. Compose with Label for labelled form fields.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Unlabelled
|
|
9
|
+
* <Checkbox id="approved" checked={approved} onCheckedChange={setApproved} />
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // Labelled
|
|
13
|
+
* <div className="flex items-center gap-2">
|
|
14
|
+
* <Checkbox id="approved" />
|
|
15
|
+
* <Label htmlFor="approved">Mark as approved</Label>
|
|
16
|
+
* </div>
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Indeterminate (select-all pattern)
|
|
20
|
+
* <Checkbox checked="indeterminate" />
|
|
21
|
+
*/
|
|
22
|
+
export declare function Checkbox({ checked, className, ...props }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface ComboboxOption {
|
|
2
|
+
value: string;
|
|
3
|
+
label: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ComboboxProps {
|
|
8
|
+
options: ComboboxOption[];
|
|
9
|
+
/** Controlled selected value. */
|
|
10
|
+
value?: string;
|
|
11
|
+
onValueChange?: (value: string) => void;
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
searchPlaceholder?: string;
|
|
14
|
+
emptyMessage?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
id?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Searchable select — a text input that filters a dropdown list.
|
|
21
|
+
* Built on Radix Popover with a custom listbox for full token compliance.
|
|
22
|
+
* Keyboard: ArrowDown/Up navigate, Enter selects, Escape closes.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* <Combobox options={trades} placeholder="Select trade…" onValueChange={setTrade} />
|
|
26
|
+
*/
|
|
27
|
+
export declare function Combobox({ options, value, onValueChange, placeholder, searchPlaceholder, emptyMessage, disabled, className, id, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface DataTableColumn<T> {
|
|
3
|
+
/** Column identifier — also the default sort key via `(row as any)[key]`. */
|
|
4
|
+
key: string;
|
|
5
|
+
header: string;
|
|
6
|
+
/** Custom cell renderer. If omitted, renders `(row as any)[key]` as a string. */
|
|
7
|
+
cell?: (row: T) => React.ReactNode;
|
|
8
|
+
sortable?: boolean;
|
|
9
|
+
headerClassName?: string;
|
|
10
|
+
cellClassName?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface DataTableProps<T> {
|
|
13
|
+
columns: DataTableColumn<T>[];
|
|
14
|
+
data: T[];
|
|
15
|
+
/** Returns a stable unique string key for each row. */
|
|
16
|
+
rowKey: (row: T) => string;
|
|
17
|
+
/** Enables pagination; omit to show all rows. */
|
|
18
|
+
pageSize?: number;
|
|
19
|
+
/** Renders a search input above the table. */
|
|
20
|
+
searchable?: boolean;
|
|
21
|
+
searchPlaceholder?: string;
|
|
22
|
+
emptyMessage?: string;
|
|
23
|
+
/** Called when a row is clicked. */
|
|
24
|
+
onRowClick?: (row: T) => void;
|
|
25
|
+
className?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Full-featured data table with optional column sorting, search, and pagination.
|
|
29
|
+
* Wraps the base `Table` component and manages all UI state internally.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* <DataTable columns={cols} data={rows} rowKey={(r) => r.id} pageSize={10} searchable />
|
|
33
|
+
*/
|
|
34
|
+
export declare function DataTable<T>({ columns, data, rowKey, pageSize, searchable, searchPlaceholder, emptyMessage, onRowClick, className, }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface DatePickerProps {
|
|
2
|
+
/** Controlled selected date. */
|
|
3
|
+
value?: Date;
|
|
4
|
+
onValueChange?: (date: Date) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
id?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Date input with a calendar popover.
|
|
12
|
+
* Built on Radix Popover — handles portal, focus, outside-click.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* <DatePicker value={date} onValueChange={setDate} placeholder="Select date…" />
|
|
16
|
+
*/
|
|
17
|
+
export declare function DatePicker({ value, onValueChange, placeholder, disabled, className, id, }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
/** Controls open/close state. Wrap all Dialog parts with this. */
|
|
3
|
+
export declare const Dialog: import("react").FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
/** Renders the element that opens the dialog. Use asChild with a Button. */
|
|
5
|
+
export declare const DialogTrigger: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
/**
|
|
7
|
+
* Closes the dialog without additional action.
|
|
8
|
+
* Use asChild with a Button:
|
|
9
|
+
* @example
|
|
10
|
+
* <DialogClose asChild><Button variant="secondary">Cancel</Button></DialogClose>
|
|
11
|
+
*/
|
|
12
|
+
export declare const DialogClose: import("react").ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
export interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The dialog panel — rendered in a portal above an overlay.
|
|
17
|
+
* Always include DialogTitle for accessibility.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* <Dialog>
|
|
21
|
+
* <DialogTrigger asChild><Button>Open</Button></DialogTrigger>
|
|
22
|
+
* <DialogContent>
|
|
23
|
+
* <DialogTitle>Confirm Action</DialogTitle>
|
|
24
|
+
* <DialogDescription>This cannot be undone.</DialogDescription>
|
|
25
|
+
* <DialogFooter>
|
|
26
|
+
* <DialogClose asChild><Button variant="secondary">Cancel</Button></DialogClose>
|
|
27
|
+
* <Button variant="destructive">Delete</Button>
|
|
28
|
+
* </DialogFooter>
|
|
29
|
+
* </DialogContent>
|
|
30
|
+
* </Dialog>
|
|
31
|
+
*/
|
|
32
|
+
export declare function DialogContent({ className, children, ...props }: DialogContentProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export interface DialogTitleProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title> {
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Required for accessibility — sets the dialog's accessible name.
|
|
37
|
+
* Rendered as a heading in display font.
|
|
38
|
+
*/
|
|
39
|
+
export declare function DialogTitle({ className, ...props }: DialogTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export interface DialogDescriptionProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description> {
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Optional supporting text below the title.
|
|
44
|
+
* Sets the dialog's accessible description.
|
|
45
|
+
*/
|
|
46
|
+
export declare function DialogDescription({ className, ...props }: DialogDescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export interface DialogFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Action button row. Renders right-aligned by default.
|
|
51
|
+
* Reverses to column on small screens for touch accessibility.
|
|
52
|
+
*/
|
|
53
|
+
export declare function DialogFooter({ className, ...props }: DialogFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
2
|
+
export declare const DropdownMenu: import("react").FC<DropdownMenuPrimitive.DropdownMenuProps>;
|
|
3
|
+
export declare const DropdownMenuTrigger: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
export declare const DropdownMenuGroup: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const DropdownMenuSub: import("react").FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
6
|
+
export declare const DropdownMenuRadioGroup: import("react").ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export interface DropdownMenuContentProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content> {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The floating menu panel. Rendered in a portal, anchored to the trigger.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* <DropdownMenu>
|
|
14
|
+
* <DropdownMenuTrigger asChild>
|
|
15
|
+
* <Button variant="ghost" size="icon" aria-label="Row actions">⋯</Button>
|
|
16
|
+
* </DropdownMenuTrigger>
|
|
17
|
+
* <DropdownMenuContent align="end">
|
|
18
|
+
* <DropdownMenuItem>Edit</DropdownMenuItem>
|
|
19
|
+
* <DropdownMenuItem>Duplicate</DropdownMenuItem>
|
|
20
|
+
* <DropdownMenuSeparator />
|
|
21
|
+
* <DropdownMenuItem destructive>Delete</DropdownMenuItem>
|
|
22
|
+
* </DropdownMenuContent>
|
|
23
|
+
* </DropdownMenu>
|
|
24
|
+
*/
|
|
25
|
+
export declare function DropdownMenuContent({ className, sideOffset, align, ...props }: DropdownMenuContentProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export interface DropdownMenuItemProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> {
|
|
27
|
+
/** Renders in signal-red — use for delete / destructive actions. */
|
|
28
|
+
destructive?: boolean;
|
|
29
|
+
/** Optional leading icon node. */
|
|
30
|
+
icon?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export declare function DropdownMenuItem({ destructive, icon, className, children, ...props }: DropdownMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export interface DropdownMenuCheckboxItemProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem> {
|
|
34
|
+
}
|
|
35
|
+
export declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: DropdownMenuCheckboxItemProps): import("react/jsx-runtime").JSX.Element;
|
|
36
|
+
export interface DropdownMenuRadioItemProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem> {
|
|
37
|
+
}
|
|
38
|
+
export declare function DropdownMenuRadioItem({ className, children, ...props }: DropdownMenuRadioItemProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export interface DropdownMenuLabelProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> {
|
|
40
|
+
}
|
|
41
|
+
/** Section label — not interactive. */
|
|
42
|
+
export declare function DropdownMenuLabel({ className, ...props }: DropdownMenuLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export interface DropdownMenuSeparatorProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator> {
|
|
44
|
+
}
|
|
45
|
+
export declare function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export interface DropdownMenuSubTriggerProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> {
|
|
47
|
+
}
|
|
48
|
+
export declare function DropdownMenuSubTrigger({ className, children, ...props }: DropdownMenuSubTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export interface DropdownMenuSubContentProps extends React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent> {
|
|
50
|
+
}
|
|
51
|
+
export declare function DropdownMenuSubContent({ className, ...props }: DropdownMenuSubContentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuGroup, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, } from './DropdownMenu';
|
|
2
|
+
export type { DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuCheckboxItemProps, DropdownMenuRadioItemProps, DropdownMenuLabelProps, DropdownMenuSeparatorProps, DropdownMenuSubTriggerProps, DropdownMenuSubContentProps, } from './DropdownMenu';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface FileUploadProps {
|
|
2
|
+
/** Accepted MIME types or extensions, e.g. ".pdf,image/*". Passed to <input>. */
|
|
3
|
+
accept?: string;
|
|
4
|
+
multiple?: boolean;
|
|
5
|
+
/** Max bytes per file. Violations are reported as errors, not silently dropped. */
|
|
6
|
+
maxSize?: number;
|
|
7
|
+
/** Max total files. Additional files beyond this are ignored with an error. */
|
|
8
|
+
maxFiles?: number;
|
|
9
|
+
onFilesChange?: (files: File[]) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
/** Override the primary drop zone label. */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Short helper text shown below the label inside the drop zone. */
|
|
14
|
+
hint?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Drag-and-drop file upload zone.
|
|
20
|
+
* Validates file size and count; reports errors inline.
|
|
21
|
+
* Use `accept` to restrict file types (passed straight to `<input type="file">`).
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* <FileUpload accept=".pdf" multiple maxSize={10 * 1024 * 1024} onFilesChange={setDocs} />
|
|
25
|
+
*/
|
|
26
|
+
export declare function FileUpload({ accept, multiple, maxSize, maxFiles, onFilesChange, disabled, label, hint, className, id, }: FileUploadProps): import("react/jsx-runtime").JSX.Element;
|