@dinofront/design_system 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 +65 -0
- package/dist/components/Accordion/Accordion.d.ts +3 -0
- package/dist/components/Accordion/Accordion.types.d.ts +21 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +3 -0
- package/dist/components/Avatar/Avatar.types.d.ts +18 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +2 -0
- package/dist/components/Badge/Badge.types.d.ts +14 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +2 -0
- package/dist/components/Button/Button.types.d.ts +15 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +2 -0
- package/dist/components/ButtonGroup/ButtonGroup.types.d.ts +6 -0
- package/dist/components/ButtonGroup/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +2 -0
- package/dist/components/Card/Card.types.d.ts +14 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +11 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.types.d.ts +24 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.d.ts +2 -0
- package/dist/components/Drawer/Drawer.types.d.ts +23 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +7 -0
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +37 -0
- package/dist/components/DropdownMenu/index.d.ts +2 -0
- package/dist/components/Filter/Filter.d.ts +2 -0
- package/dist/components/Filter/Filter.types.d.ts +17 -0
- package/dist/components/Filter/index.d.ts +2 -0
- package/dist/components/IconTile/IconTile.d.ts +2 -0
- package/dist/components/IconTile/IconTile.types.d.ts +13 -0
- package/dist/components/IconTile/index.d.ts +2 -0
- package/dist/components/InfoField/InfoField.d.ts +2 -0
- package/dist/components/InfoField/InfoField.types.d.ts +16 -0
- package/dist/components/InfoField/index.d.ts +2 -0
- package/dist/components/InlineAlert/InlineAlert.d.ts +2 -0
- package/dist/components/InlineAlert/InlineAlert.types.d.ts +15 -0
- package/dist/components/InlineAlert/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +2 -0
- package/dist/components/Input/Input.types.d.ts +15 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/Modal/Modal.d.ts +2 -0
- package/dist/components/Modal/Modal.types.d.ts +21 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +2 -0
- package/dist/components/MultiSelect/MultiSelect.types.d.ts +44 -0
- package/dist/components/MultiSelect/index.d.ts +2 -0
- package/dist/components/NotificationBadge/NotificationBadge.d.ts +2 -0
- package/dist/components/NotificationBadge/NotificationBadge.types.d.ts +15 -0
- package/dist/components/NotificationBadge/index.d.ts +2 -0
- package/dist/components/Pagination/Pagination.d.ts +2 -0
- package/dist/components/Pagination/Pagination.types.d.ts +14 -0
- package/dist/components/Pagination/index.d.ts +2 -0
- package/dist/components/PersonCard/PersonCard.d.ts +2 -0
- package/dist/components/PersonCard/PersonCard.types.d.ts +20 -0
- package/dist/components/PersonCard/index.d.ts +2 -0
- package/dist/components/Radio/Radio.d.ts +3 -0
- package/dist/components/Radio/Radio.types.d.ts +22 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +2 -0
- package/dist/components/Select/Select.types.d.ts +24 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.d.ts +3 -0
- package/dist/components/Sidebar/Sidebar.types.d.ts +25 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Snackbar/Snackbar.d.ts +3 -0
- package/dist/components/Snackbar/Snackbar.types.d.ts +28 -0
- package/dist/components/Snackbar/index.d.ts +2 -0
- package/dist/components/Status/Status.d.ts +2 -0
- package/dist/components/Status/Status.types.d.ts +12 -0
- package/dist/components/Status/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +2 -0
- package/dist/components/Switch/Switch.types.d.ts +9 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +8 -0
- package/dist/components/Table/Table.types.d.ts +55 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +5 -0
- package/dist/components/Tabs/Tabs.types.d.ts +26 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Text/Text.d.ts +2 -0
- package/dist/components/Text/Text.types.d.ts +15 -0
- package/dist/components/Text/index.d.ts +2 -0
- package/dist/components/TextArea/TextArea.d.ts +2 -0
- package/dist/components/TextArea/TextArea.types.d.ts +10 -0
- package/dist/components/TextArea/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.types.d.ts +15 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Upload/Upload.d.ts +3 -0
- package/dist/components/Upload/Upload.types.d.ts +24 -0
- package/dist/components/Upload/index.d.ts +2 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +2663 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/cn.d.ts +8 -0
- package/dist/styles.css +2624 -0
- package/dist/tailwind/preset.d.ts +41 -0
- package/dist/tailwind/preset.js +151 -0
- package/dist/tailwind/preset.js.map +1 -0
- package/dist/tailwind/tokens.d.ts +141 -0
- package/dist/tokens/colors.d.ts +286 -0
- package/dist/tokens/index.d.ts +5 -0
- package/dist/tokens/radius.d.ts +15 -0
- package/dist/tokens/shadows.d.ts +13 -0
- package/dist/tokens/spacing.d.ts +18 -0
- package/dist/tokens/typography.d.ts +161 -0
- package/dist/types/base.d.ts +5 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +78 -0
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Design System
|
|
2
|
+
|
|
3
|
+
An enterprise React component library and design system built on
|
|
4
|
+
[Tailwind CSS v4](https://tailwindcss.com/) and React 19. It ships as an ESM
|
|
5
|
+
package with a separately-built stylesheet and an optional Tailwind
|
|
6
|
+
v3-style preset for consumers still on a JS config.
|
|
7
|
+
|
|
8
|
+
## Stack
|
|
9
|
+
|
|
10
|
+
- React 19
|
|
11
|
+
- Tailwind CSS v4 (CSS-first `@theme` config, no `tailwind.config.js`)
|
|
12
|
+
- TypeScript 5.9
|
|
13
|
+
- Storybook 10 (`@storybook/react-vite`)
|
|
14
|
+
- Vite 8
|
|
15
|
+
- `class-variance-authority`, `clsx` + `tailwind-merge`
|
|
16
|
+
- `lucide-react` for icons
|
|
17
|
+
- ESLint 9 flat config + Prettier
|
|
18
|
+
|
|
19
|
+
## Design tokens
|
|
20
|
+
|
|
21
|
+
Tokens (palette, semantic aliases, radii, shadows, typography) are defined
|
|
22
|
+
in two parallel representations that are kept in sync by hand:
|
|
23
|
+
|
|
24
|
+
- **CSS custom properties** — `src/styles/tokens.css` (raw palette scales,
|
|
25
|
+
radii, shadows, typography) and `src/styles/theme.css` (semantic
|
|
26
|
+
aliases + dark mode), both using Tailwind v4's `@theme { ... }` directive.
|
|
27
|
+
`src/styles/globals.css` is the entry point.
|
|
28
|
+
- **JS/TS token objects** — `src/tokens/*.ts`, plus a Tailwind v3-style
|
|
29
|
+
preset at `src/tailwind/preset.ts` for consumers on a JS Tailwind config.
|
|
30
|
+
|
|
31
|
+
Prefer semantic aliases (`bg-default`, `fg-brand`, `border-danger`, ...)
|
|
32
|
+
over raw palette classes (`brand-500`, `red-700`, ...) in component code.
|
|
33
|
+
|
|
34
|
+
## Component architecture
|
|
35
|
+
|
|
36
|
+
Each component lives under `src/components/<Name>/` with a fixed file set:
|
|
37
|
+
|
|
38
|
+
```
|
|
39
|
+
src/components/<Name>/
|
|
40
|
+
<Name>.tsx # implementation
|
|
41
|
+
<Name>.types.ts # exported prop types
|
|
42
|
+
<Name>.stories.tsx # Storybook stories
|
|
43
|
+
<Name>.docs.mdx # hand-authored docs page
|
|
44
|
+
index.ts # barrel: re-export the component + its types
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Getting started
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npm install
|
|
51
|
+
npm run dev # Storybook dev server on port 6008
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Scripts
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm run build # tsc --noEmit -> vite build (lib) -> build:css (Tailwind CLI)
|
|
58
|
+
npm run build:storybook # storybook build
|
|
59
|
+
npm run lint # eslint .
|
|
60
|
+
npm run format # prettier --write .
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
MIT
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AccordionItemProps, AccordionProps } from './Accordion.types';
|
|
2
|
+
export declare const Accordion: import('react').ForwardRefExoticComponent<AccordionProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const AccordionItem: import('react').ForwardRefExoticComponent<AccordionItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type AccordionType = 'single' | 'multiple';
|
|
4
|
+
export interface AccordionProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
5
|
+
/** `'single'` keeps at most one item open at a time; `'multiple'` allows any number. */
|
|
6
|
+
type?: AccordionType;
|
|
7
|
+
/** Uncontrolled initial open value(s) — a single string for `'single'`, an array for `'multiple'`. */
|
|
8
|
+
defaultValue?: string | string[];
|
|
9
|
+
/** Controlled open value(s). Pass alongside `onValueChange` to fully control which item(s) are open. */
|
|
10
|
+
value?: string | string[];
|
|
11
|
+
onValueChange?: (value: string | string[]) => void;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface AccordionItemProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>, BaseProps {
|
|
15
|
+
/** Unique identifier used to track open/closed state within the parent `Accordion`. */
|
|
16
|
+
value: string;
|
|
17
|
+
title: ReactNode;
|
|
18
|
+
icon?: ReactNode;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AvatarGroupProps, AvatarProps } from './Avatar.types';
|
|
2
|
+
export declare const Avatar: import('react').ForwardRefExoticComponent<AvatarProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
3
|
+
export declare const AvatarGroup: import('react').ForwardRefExoticComponent<AvatarGroupProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type AvatarSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
4
|
+
export type AvatarStatus = 'online' | 'offline' | 'away' | 'busy';
|
|
5
|
+
export interface AvatarProps extends HTMLAttributes<HTMLSpanElement>, BaseProps {
|
|
6
|
+
src?: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
size?: AvatarSize;
|
|
10
|
+
status?: AvatarStatus;
|
|
11
|
+
shape?: 'circle' | 'square';
|
|
12
|
+
fallback?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface AvatarGroupProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
15
|
+
size?: AvatarSize;
|
|
16
|
+
max?: number;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type BadgeVariant = 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'info' | 'privacy';
|
|
4
|
+
export type BadgeStyle = 'filled' | 'outline' | 'accent';
|
|
5
|
+
export type BadgeSize = 'lg' | 'md' | 'sm' | 'xs';
|
|
6
|
+
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement>, BaseProps {
|
|
7
|
+
variant?: BadgeVariant;
|
|
8
|
+
appearance?: BadgeStyle;
|
|
9
|
+
size?: BadgeSize;
|
|
10
|
+
leftIcon?: ReactNode;
|
|
11
|
+
rightIcon?: ReactNode;
|
|
12
|
+
/** Renders a trailing dismiss button (replacing `rightIcon`) that calls this on click. */
|
|
13
|
+
onDismiss?: () => void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'danger';
|
|
4
|
+
export type ButtonSize = 'lg' | 'md' | 'sm';
|
|
5
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, BaseProps {
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
leftIcon?: ReactNode;
|
|
9
|
+
rightIcon?: ReactNode;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
iconOnly?: boolean;
|
|
12
|
+
fullWidth?: boolean;
|
|
13
|
+
/** Toggle/active state — renders as pressed and blocks interaction while true. */
|
|
14
|
+
pressed?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type ButtonGroupOrientation = 'horizontal' | 'vertical';
|
|
4
|
+
export interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
5
|
+
orientation?: ButtonGroupOrientation;
|
|
6
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type CardVariant = 'elevated' | 'outlined' | 'filled';
|
|
4
|
+
export type CardPadding = 'none' | 'sm' | 'md' | 'lg';
|
|
5
|
+
export interface CardProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
6
|
+
variant?: CardVariant;
|
|
7
|
+
padding?: CardPadding;
|
|
8
|
+
/** Renders a top slot inside the card, separated by a subtle divider. */
|
|
9
|
+
header?: ReactNode;
|
|
10
|
+
/** Renders a bottom slot inside the card, separated by a subtle divider. */
|
|
11
|
+
footer?: ReactNode;
|
|
12
|
+
/** When true, the whole card reacts to hover (border highlight + raised shadow). */
|
|
13
|
+
interactive?: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type CheckboxSize = 'md' | 'sm';
|
|
4
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'>, BaseProps {
|
|
5
|
+
size?: CheckboxSize;
|
|
6
|
+
label?: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
/** Renders the mixed/"some selected" visual state (`aria-checked="mixed"`). */
|
|
9
|
+
indeterminate?: boolean;
|
|
10
|
+
error?: boolean;
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type DatePickerSize = 'lg' | 'md' | 'sm';
|
|
4
|
+
export interface DateRange {
|
|
5
|
+
start: Date | null;
|
|
6
|
+
end: Date | null;
|
|
7
|
+
}
|
|
8
|
+
export interface DatePickerProps extends BaseProps {
|
|
9
|
+
value?: Date | null;
|
|
10
|
+
onChange?: (date: Date) => void;
|
|
11
|
+
/** Enable range-selection mode. */
|
|
12
|
+
range?: boolean;
|
|
13
|
+
rangeValue?: DateRange;
|
|
14
|
+
onChangeRange?: (range: DateRange) => void;
|
|
15
|
+
size?: DatePickerSize;
|
|
16
|
+
label?: ReactNode;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
/** Fill the parent's width (like Input/Select) instead of the intrinsic
|
|
19
|
+
* min-width. Use inside form grids so dates line up with other fields. */
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
id?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
wrapperClassName?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type DrawerSide = 'right' | 'left' | 'top' | 'bottom';
|
|
4
|
+
export type DrawerSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
export interface DrawerProps extends BaseProps {
|
|
6
|
+
/** Whether the drawer is rendered and visible. */
|
|
7
|
+
open: boolean;
|
|
8
|
+
/** Called when the drawer requests to be closed (Escape, overlay click, close button). */
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
/** Edge of the viewport the drawer slides in from. */
|
|
11
|
+
side?: DrawerSide;
|
|
12
|
+
/** Panel size — width when `side` is left/right, height when top/bottom. */
|
|
13
|
+
size?: DrawerSize;
|
|
14
|
+
title?: ReactNode;
|
|
15
|
+
description?: ReactNode;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
footer?: ReactNode;
|
|
18
|
+
/** Whether clicking the overlay backdrop calls `onClose`. */
|
|
19
|
+
closeOnOverlayClick?: boolean;
|
|
20
|
+
/** Whether the built-in close (X) button is rendered. */
|
|
21
|
+
showClose?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DropdownContentProps, DropdownItemProps, DropdownLabelProps, DropdownMenuProps, DropdownSeparatorProps, DropdownTriggerProps } from './DropdownMenu.types';
|
|
2
|
+
export declare const DropdownMenu: import('react').ForwardRefExoticComponent<DropdownMenuProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare function DropdownTrigger({ children }: DropdownTriggerProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
4
|
+
export declare const DropdownContent: import('react').ForwardRefExoticComponent<DropdownContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare const DropdownItem: import('react').ForwardRefExoticComponent<DropdownItemProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
export declare const DropdownSeparator: import('react').ForwardRefExoticComponent<DropdownSeparatorProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const DropdownLabel: import('react').ForwardRefExoticComponent<DropdownLabelProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type DropdownContentAlign = 'start' | 'end';
|
|
4
|
+
export interface DropdownMenuProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Uncontrolled initial open state. */
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
/** Controlled open state. Pass alongside `onOpenChange` to fully control the menu. */
|
|
9
|
+
open?: boolean;
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface DropdownTriggerProps {
|
|
13
|
+
/** A single element cloned with the click handler and `aria-haspopup`/`aria-expanded` that open the menu. */
|
|
14
|
+
children: ReactElement;
|
|
15
|
+
}
|
|
16
|
+
export interface DropdownContentProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
/** Horizontal alignment of the panel relative to the trigger. */
|
|
19
|
+
align?: DropdownContentAlign;
|
|
20
|
+
}
|
|
21
|
+
export interface DropdownItemProps extends ButtonHTMLAttributes<HTMLButtonElement>, BaseProps {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
/** Called on click, after any native `onClick`, then closes the menu. */
|
|
24
|
+
onSelect?: () => void;
|
|
25
|
+
icon?: ReactNode;
|
|
26
|
+
/** Trailing hint text, e.g. a keyboard shortcut. */
|
|
27
|
+
shortcut?: ReactNode;
|
|
28
|
+
/** Renders the item in the danger palette for destructive actions. */
|
|
29
|
+
destructive?: boolean;
|
|
30
|
+
/** Renders a leading check mark when `true`; reserves the space (unchecked) when `false`. Omit entirely for items with no check state. */
|
|
31
|
+
checked?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface DropdownSeparatorProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
34
|
+
}
|
|
35
|
+
export interface DropdownLabelProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { DropdownContent, DropdownItem, DropdownLabel, DropdownMenu, DropdownSeparator, DropdownTrigger, } from './DropdownMenu';
|
|
2
|
+
export type { DropdownContentAlign, DropdownContentProps, DropdownItemProps, DropdownLabelProps, DropdownMenuProps, DropdownSeparatorProps, DropdownTriggerProps, } from './DropdownMenu.types';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type FilterSize = 'lg' | 'md' | 'sm';
|
|
4
|
+
export interface FilterProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
5
|
+
/** Trigger label, always visible. */
|
|
6
|
+
label: ReactNode;
|
|
7
|
+
/** Selected value rendered after the label, separated by a dot. Its presence (even `""`) marks the filter as active. */
|
|
8
|
+
value?: ReactNode;
|
|
9
|
+
/** Forces the active (selected) visual style regardless of `value`. */
|
|
10
|
+
active?: boolean;
|
|
11
|
+
size?: FilterSize;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Called when the clear (×) affordance is activated. Only rendered when the filter is active. */
|
|
14
|
+
onClear?: () => void;
|
|
15
|
+
/** Popover content shown below the trigger while open. */
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
|
+
import { BaseProps } from '../../types';
|
|
4
|
+
export type IconTileTone = 'brand' | 'info' | 'gray' | 'purple' | 'pink' | 'yellow' | 'success' | 'warning' | 'danger';
|
|
5
|
+
export type IconTileSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
export type IconTileShape = 'rounded' | 'circle';
|
|
7
|
+
export interface IconTileProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
8
|
+
/** Any lucide-react icon component, rendered centered inside the tile. */
|
|
9
|
+
icon: LucideIcon;
|
|
10
|
+
tone?: IconTileTone;
|
|
11
|
+
size?: IconTileSize;
|
|
12
|
+
shape?: IconTileShape;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
|
+
import { BaseProps } from '../../types';
|
|
4
|
+
import { IconTileTone } from '../IconTile';
|
|
5
|
+
export interface InfoFieldProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
|
|
6
|
+
/** Leading lucide-react icon. */
|
|
7
|
+
icon: LucideIcon;
|
|
8
|
+
/** IconTile tone for the leading badge. Defaults to "brand". */
|
|
9
|
+
iconTone?: IconTileTone;
|
|
10
|
+
/** Small uppercase label above the value. */
|
|
11
|
+
label: string;
|
|
12
|
+
/** The actual value — string or any node (chips, links, etc). */
|
|
13
|
+
value: ReactNode;
|
|
14
|
+
/** Optional right-aligned slot for inline actions (edit button, pill, link). */
|
|
15
|
+
action?: ReactNode;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type InlineAlertVariant = 'success' | 'warning' | 'danger' | 'info' | 'discovery';
|
|
4
|
+
export interface InlineAlertProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'>, BaseProps {
|
|
5
|
+
variant?: InlineAlertVariant;
|
|
6
|
+
/** Overrides the native `title` (tooltip) attribute — rendered as the alert's heading. */
|
|
7
|
+
title?: ReactNode;
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
/** Renders a trailing dismiss button that calls this on click. */
|
|
10
|
+
onDismiss?: () => void;
|
|
11
|
+
/** Extra content (typically buttons) rendered below the description. */
|
|
12
|
+
actions?: ReactNode;
|
|
13
|
+
/** Overrides the variant's default icon. */
|
|
14
|
+
icon?: ReactNode;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type InputSize = 'lg' | 'md' | 'sm';
|
|
4
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'>, BaseProps {
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
helperText?: ReactNode;
|
|
7
|
+
errorText?: ReactNode;
|
|
8
|
+
size?: InputSize;
|
|
9
|
+
leftIcon?: ReactNode;
|
|
10
|
+
rightIcon?: ReactNode;
|
|
11
|
+
leftAddon?: ReactNode;
|
|
12
|
+
rightAddon?: ReactNode;
|
|
13
|
+
error?: boolean;
|
|
14
|
+
wrapperClassName?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
4
|
+
export interface ModalProps extends BaseProps {
|
|
5
|
+
/** Whether the modal is mounted and visible. Nothing renders (not even to the portal) when false. */
|
|
6
|
+
open: boolean;
|
|
7
|
+
/** Called when the user presses Escape, clicks the overlay (if enabled), or clicks the close button. */
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
/** Rendered in a bordered footer row, right-aligned — typically action buttons. */
|
|
13
|
+
footer?: ReactNode;
|
|
14
|
+
size?: ModalSize;
|
|
15
|
+
/** Close the modal when the backdrop is clicked. Defaults to `true`. */
|
|
16
|
+
closeOnOverlayClick?: boolean;
|
|
17
|
+
/** Show the close (X) button in the header. Defaults to `true`. */
|
|
18
|
+
showClose?: boolean;
|
|
19
|
+
/** Merged with the panel's own classes via `cn()` — last conflicting utility wins. */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type MultiSelectSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export interface MultiSelectOption {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
/** Optional second line under the label in the dropdown. */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Optional avatar image — shown on the chip and the dropdown row. */
|
|
10
|
+
avatarSrc?: string;
|
|
11
|
+
/** Non-selectable option (shown dimmed in the list). */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Small tag rendered on the chip, e.g. "You". */
|
|
14
|
+
badge?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export interface MultiSelectProps extends BaseProps {
|
|
17
|
+
options: MultiSelectOption[];
|
|
18
|
+
/** Selected option values (controlled). */
|
|
19
|
+
value: string[];
|
|
20
|
+
onChange: (values: string[]) => void;
|
|
21
|
+
size?: MultiSelectSize;
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
/** Placeholder once at least one chip exists. Defaults to "Add another…". */
|
|
24
|
+
addMorePlaceholder?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
error?: boolean;
|
|
27
|
+
label?: ReactNode;
|
|
28
|
+
helperText?: ReactNode;
|
|
29
|
+
errorText?: ReactNode;
|
|
30
|
+
required?: boolean;
|
|
31
|
+
/** Values whose chips can't be removed. */
|
|
32
|
+
lockedValues?: string[];
|
|
33
|
+
/** Cap on how many can be selected (default: unlimited). */
|
|
34
|
+
max?: number;
|
|
35
|
+
/** Set false for a click-to-open picker with no text filter. */
|
|
36
|
+
searchable?: boolean;
|
|
37
|
+
/** Dropdown header shown when the query is empty. */
|
|
38
|
+
suggestionsLabel?: string;
|
|
39
|
+
/** Message shown when nothing matches. */
|
|
40
|
+
emptyText?: string;
|
|
41
|
+
id?: string;
|
|
42
|
+
className?: string;
|
|
43
|
+
wrapperClassName?: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export type NotificationBadgeSize = 'lg' | 'sm';
|
|
4
|
+
export type NotificationBadgeVariant = 'brand' | 'danger' | 'success' | 'warning' | 'info';
|
|
5
|
+
export type NotificationBadgeKind = 'count' | 'dot';
|
|
6
|
+
export interface NotificationBadgeProps extends HTMLAttributes<HTMLSpanElement>, BaseProps {
|
|
7
|
+
count?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
kind?: NotificationBadgeKind;
|
|
10
|
+
size?: NotificationBadgeSize;
|
|
11
|
+
variant?: NotificationBadgeVariant;
|
|
12
|
+
/** Element the badge overlays. Omit to render the badge as a standalone element. */
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
showZero?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { BaseProps } from '../../types';
|
|
3
|
+
export interface PaginationProps extends HTMLAttributes<HTMLElement>, BaseProps {
|
|
4
|
+
/** Current active page, 1-indexed. */
|
|
5
|
+
page: number;
|
|
6
|
+
/** Total number of pages. */
|
|
7
|
+
pageCount: number;
|
|
8
|
+
/** Called with the target page number when a page, previous, or next control is activated. */
|
|
9
|
+
onPageChange: (page: number) => void;
|
|
10
|
+
/** How many page numbers to show on each side of the current page. @default 1 */
|
|
11
|
+
siblingCount?: number;
|
|
12
|
+
/** How many page numbers to always show at the start and end of the range. @default 1 */
|
|
13
|
+
boundaryCount?: number;
|
|
14
|
+
}
|