@directo-ui/web 0.0.0-stage → 1.0.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 +25 -2
- package/dist/bundle.d.ts +2 -0
- package/dist/components/Accordion.d.ts +16 -0
- package/dist/components/Alert.d.ts +14 -0
- package/dist/components/Avatar.d.ts +16 -0
- package/dist/components/Badge.d.ts +11 -0
- package/dist/components/BottomSheet.d.ts +9 -0
- package/dist/components/Breadcrumb.d.ts +15 -0
- package/dist/components/Button.d.ts +3 -0
- package/dist/components/Card.d.ts +15 -0
- package/dist/components/Checkbox.d.ts +4 -0
- package/dist/components/DatePicker.d.ts +15 -0
- package/dist/components/Dialog.d.ts +28 -0
- package/dist/components/Divider.d.ts +6 -0
- package/dist/components/Dropdown.d.ts +20 -0
- package/dist/components/EmptyState.d.ts +9 -0
- package/dist/components/IconButton.d.ts +10 -0
- package/dist/components/Loading.d.ts +31 -0
- package/dist/components/Pagination.d.ts +9 -0
- package/dist/components/RadioGroup.d.ts +6 -0
- package/dist/components/Select.d.ts +5 -0
- package/dist/components/SlidingButton.d.ts +7 -0
- package/dist/components/Switch.d.ts +4 -0
- package/dist/components/Tabs.d.ts +6 -0
- package/dist/components/TextField.d.ts +11 -0
- package/dist/components/Textarea.d.ts +10 -0
- package/dist/components/Toast.d.ts +7 -0
- package/dist/components/Tooltip.d.ts +10 -0
- package/dist/components/index.d.ts +28 -0
- package/dist/core/dates.d.ts +6 -0
- package/dist/core/generated.d.ts +34 -0
- package/dist/core/index.d.ts +2 -0
- package/dist/core/pagination.d.ts +3 -0
- package/dist/core/toast.d.ts +19 -0
- package/dist/core/tokens.d.ts +178 -0
- package/dist/core/types.d.ts +227 -0
- package/dist/figma-components-directo.js +1288 -0
- package/dist/figma-components-directo.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/styles.css +2 -0
- package/dist/tokens.css +321 -0
- package/package.json +51 -4
package/README.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @directo-ui/web (React)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
27 componentes React 18/19 del sistema de diseño Directo, con tipos TypeScript, `ref` en controles nativos y compatibles con SSR.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install @directo-ui/web
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import '@directo-ui/web/styles.css'; // una sola vez (tokens + componentes, sin reset ni Tailwind)
|
|
11
|
+
import { Button, TextField, ToastProvider, useToast } from '@directo-ui/web';
|
|
12
|
+
|
|
13
|
+
<ToastProvider>
|
|
14
|
+
<TextField label="Destino" name="destination" onChange={setDestination} />
|
|
15
|
+
<Button type="submit">Solicitar viaje</Button>
|
|
16
|
+
</ToastProvider>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- `react` y `react-dom` son peer dependencies; Radix UI y `phosphor-react` se instalan con el paquete.
|
|
20
|
+
- `Button` es un `<button>` nativo con `type="button"` por defecto. `TextField`/`Textarea` entregan el texto (no el evento) en `onChange`.
|
|
21
|
+
- Solo tokens: `import '@directo-ui/web/tokens';`.
|
|
22
|
+
- Modo oscuro: `class="dark"` o `data-theme="dark"` en `<html>`.
|
|
23
|
+
|
|
24
|
+
**Exportaciones:** Button, IconButton, SlidingButton, Dropdown, TextField, Textarea, Select/SelectItem, Checkbox, RadioGroup/RadioItem, Switch, DatePicker, Tabs/TabList/Tab/TabPanel, Breadcrumb, Pagination (+ `paginationRange`), Accordion/AccordionItem, Alert, ToastProvider/useToast, Spinner, Skeleton, Progress, Loading, EmptyState, Dialog (+ Trigger, Content, Header, Title, Description, Body, Footer, Close), BottomSheet, Tooltip, Card, Badge, Avatar/AvatarGroup, Divider.
|
|
25
|
+
|
|
26
|
+
Documentación con ejemplos en vivo y API: `corepack pnpm dev` en la raíz del monorrepo.
|
package/dist/bundle.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface AccordionProps {
|
|
3
|
+
variant?: 'default' | 'separated';
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export interface AccordionItemProps {
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Items sharing a name behave exclusively (only one open) in modern browsers. */
|
|
11
|
+
name?: string;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/** Built on native <details>/<summary>: keyboard and screen-reader support without JS. */
|
|
15
|
+
export declare function Accordion({ variant, children }: AccordionProps): import("react").JSX.Element;
|
|
16
|
+
export declare function AccordionItem({ title, defaultOpen, disabled, name, children }: AccordionItemProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface AlertProps {
|
|
3
|
+
variant?: 'info' | 'success' | 'warning' | 'error';
|
|
4
|
+
title: string;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
dismissible?: boolean;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
/** Buttons or links rendered below the description. */
|
|
9
|
+
actions?: ReactNode;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** Inline status message. Errors use role="alert"; the rest role="status". */
|
|
14
|
+
export declare function Alert({ variant, title, description, dismissible, icon, actions, onClose, children }: AlertProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface AvatarProps {
|
|
3
|
+
src?: string;
|
|
4
|
+
/** Person name: used for the accessible label and the initials fallback. */
|
|
5
|
+
alt?: string;
|
|
6
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
7
|
+
/** Explicit initials; computed from `alt` when omitted. */
|
|
8
|
+
fallback?: string;
|
|
9
|
+
status?: 'online' | 'offline' | 'away' | 'busy';
|
|
10
|
+
shape?: 'circle' | 'rounded' | 'square';
|
|
11
|
+
}
|
|
12
|
+
export declare function Avatar({ src, alt, size, fallback, status, shape }: AvatarProps): import("react").JSX.Element;
|
|
13
|
+
export declare function AvatarGroup({ children, label }: {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
label?: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface BadgeProps {
|
|
3
|
+
variant?: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error' | 'neutral' | 'solid' | 'outline';
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
dot?: boolean;
|
|
6
|
+
removable?: boolean;
|
|
7
|
+
removeLabel?: string;
|
|
8
|
+
onRemove?: () => void;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function Badge({ variant, size, dot, removable, removeLabel, onRemove, children }: BadgeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface BottomSheetProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
title?: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
/** A sheet is a modal dialog: keeps focus, Escape and background inertness. */
|
|
9
|
+
export declare function BottomSheet({ isOpen, onClose, title, children }: BottomSheetProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { MouseEvent, ReactNode } from 'react';
|
|
2
|
+
export interface BreadcrumbItem {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
href?: string;
|
|
5
|
+
onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
|
|
6
|
+
}
|
|
7
|
+
export interface BreadcrumbProps {
|
|
8
|
+
items: BreadcrumbItem[];
|
|
9
|
+
separator?: 'chevron' | 'slash';
|
|
10
|
+
label?: string;
|
|
11
|
+
/** Custom link renderer, e.g. React Router's <Link>. */
|
|
12
|
+
renderLink?: (item: BreadcrumbItem) => ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/** The last item is the current page and is not a link. */
|
|
15
|
+
export declare function Breadcrumb({ items, separator, label, renderLink }: BreadcrumbProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ButtonProps } from '../core/index.js';
|
|
2
|
+
/** Native button: forms, keyboard, refs and every standard HTML attribute keep working. */
|
|
3
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface CardProps {
|
|
3
|
+
variant?: 'default' | 'elevated' | 'outlined' | 'filled' | 'interactive';
|
|
4
|
+
padding?: 'none' | 'sm' | 'md' | 'lg';
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
/** Enables Enter/Space activation; keep nested links and controls outside the card. */
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
header?: ReactNode;
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
footer?: ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export declare function Card({ variant, padding, selected, onClick, header, title, description, footer, className, children }: CardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
2
|
+
import type { CheckboxProps } from '../core/index.js';
|
|
3
|
+
export declare function Checkbox({ checked, onCheckedChange, disabled, label, id, ...props }: CheckboxProps): import("react").JSX.Element;
|
|
4
|
+
export { CheckboxPrimitive };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface DatePickerProps {
|
|
2
|
+
value?: Date;
|
|
3
|
+
defaultValue?: Date;
|
|
4
|
+
onChange?: (date: Date) => void;
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** dd/MM/yyyy (default) or yyyy-MM-dd */
|
|
8
|
+
format?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
min?: Date;
|
|
13
|
+
max?: Date;
|
|
14
|
+
}
|
|
15
|
+
export declare function DatePicker({ value, defaultValue, onChange, placeholder, disabled, format, name, id, label, min, max }: DatePickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { DialogProps, DialogTriggerProps, DialogContentProps } from '../core/index.js';
|
|
4
|
+
/** Modal dialog built on Radix: focus trap, Escape, scroll lock and inert background. */
|
|
5
|
+
export declare function Dialog({ open, onOpenChange, children, ...props }: DialogProps): import("react").JSX.Element;
|
|
6
|
+
/** Without `asChild` it renders a primary Button; with `asChild` it reuses your element. */
|
|
7
|
+
export declare function DialogTrigger({ children, asChild }: DialogTriggerProps): import("react").JSX.Element;
|
|
8
|
+
export declare function DialogContent({ children, className, size, showClose, ...props }: DialogContentProps): import("react").JSX.Element;
|
|
9
|
+
export declare function DialogHeader({ children }: {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}): import("react").JSX.Element;
|
|
12
|
+
export declare function DialogTitle({ children }: {
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
export declare function DialogDescription({ children }: {
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
export declare function DialogBody({ children }: {
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
export declare function DialogFooter({ children }: {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
/** Wrap one element (usually a Button) to close the dialog when activated. */
|
|
25
|
+
export declare function DialogClose({ children }: {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
28
|
+
export { DialogPrimitive };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface DropdownItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
shortcut?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
danger?: boolean;
|
|
9
|
+
/** Renders a separator instead of an item. */
|
|
10
|
+
divider?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface DropdownProps {
|
|
13
|
+
/** Must be a single focusable element, usually a Button or IconButton. */
|
|
14
|
+
trigger: ReactNode;
|
|
15
|
+
items: DropdownItem[];
|
|
16
|
+
onSelect: (id: string) => void;
|
|
17
|
+
label?: string;
|
|
18
|
+
align?: 'start' | 'center' | 'end';
|
|
19
|
+
}
|
|
20
|
+
export declare function Dropdown({ trigger, items, onSelect, label, align }: DropdownProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface EmptyStateProps {
|
|
3
|
+
variant?: 'default' | 'no-data' | 'error' | 'no-results';
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
action?: ReactNode;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function EmptyState({ variant, title, description, action, icon }: EmptyStateProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'icon';
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
/** Required accessible name: icon-only buttons have no visible text. */
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const IconButton: import("react").ForwardRefExoticComponent<IconButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface LoadingProps {
|
|
2
|
+
variant?: 'spinner' | 'dots' | 'skeleton' | 'progress';
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
label?: string;
|
|
5
|
+
progress?: number;
|
|
6
|
+
}
|
|
7
|
+
/** Convenience wrapper over Spinner, Skeleton and Progress. */
|
|
8
|
+
export declare function Loading({ variant, size, label, progress }: LoadingProps): import("react").JSX.Element;
|
|
9
|
+
export interface SpinnerProps {
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
|
+
label?: string;
|
|
12
|
+
showLabel?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function Spinner({ size, label, showLabel }: SpinnerProps): import("react").JSX.Element;
|
|
15
|
+
export interface SkeletonProps {
|
|
16
|
+
lines?: number;
|
|
17
|
+
avatar?: boolean;
|
|
18
|
+
label?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function Skeleton({ lines, avatar, label }: SkeletonProps): import("react").JSX.Element;
|
|
21
|
+
export interface ProgressProps {
|
|
22
|
+
value?: number;
|
|
23
|
+
max?: number;
|
|
24
|
+
label?: string;
|
|
25
|
+
showValue?: boolean;
|
|
26
|
+
size?: 'sm' | 'md' | 'lg';
|
|
27
|
+
variant?: 'primary' | 'success' | 'warning' | 'error';
|
|
28
|
+
/** Unknown duration: animated bar without aria-valuenow. */
|
|
29
|
+
indeterminate?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare function Progress({ value, max, label, showValue, size, variant, indeterminate }: ProgressProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface PaginationProps {
|
|
2
|
+
page: number;
|
|
3
|
+
totalPages: number;
|
|
4
|
+
onPageChange: (page: number) => void;
|
|
5
|
+
siblings?: number;
|
|
6
|
+
variant?: 'default' | 'outlined';
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function Pagination({ page, totalPages, onPageChange, siblings, variant, label }: PaginationProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
2
|
+
import type { RadioGroupProps, RadioItemProps } from '../core/index.js';
|
|
3
|
+
/** Arrow keys move the selection; Tab enters and leaves the whole group. */
|
|
4
|
+
export declare function RadioGroup({ value, defaultValue, name, onValueChange, disabled, ariaLabel, orientation, children }: RadioGroupProps): import("react").JSX.Element;
|
|
5
|
+
export declare function RadioItem({ value, disabled, label, id }: RadioItemProps): import("react").JSX.Element;
|
|
6
|
+
export { RadioGroupPrimitive };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
2
|
+
import type { SelectProps, SelectItemProps } from '../core/index.js';
|
|
3
|
+
export declare function Select({ value, onValueChange, placeholder, disabled, children, id, ariaLabel, label, supportingText, error, ...props }: SelectProps): import("react").JSX.Element;
|
|
4
|
+
export declare function SelectItem({ value, disabled, children }: SelectItemProps): import("react").JSX.Element;
|
|
5
|
+
export { SelectPrimitive };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface SlidingButtonProps {
|
|
2
|
+
variant?: 'default' | 'libre' | 'ocupado' | 'desactivar';
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
label?: string;
|
|
5
|
+
onComplete?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function SlidingButton({ variant, disabled, label, onComplete }: SlidingButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
2
|
+
import type { SwitchProps } from '../core/index.js';
|
|
3
|
+
export declare function Switch({ checked, onCheckedChange, disabled, label, id, ...props }: SwitchProps): import("react").JSX.Element;
|
|
4
|
+
export { SwitchPrimitive };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TabsProps, TabListProps, TabProps, TabPanelProps } from '../core/index.js';
|
|
2
|
+
/** Accessible tabs (Radix): arrow keys move between tabs, Tab moves into the panel. */
|
|
3
|
+
export declare function Tabs({ defaultValue, value, onValueChange, orientation, children }: TabsProps): import("react").JSX.Element;
|
|
4
|
+
export declare function TabList({ variant, children }: TabListProps): import("react").JSX.Element;
|
|
5
|
+
export declare function Tab({ value, disabled, children }: TabProps): import("react").JSX.Element;
|
|
6
|
+
export declare function TabPanel({ value, children }: TabPanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size'> {
|
|
3
|
+
label?: string;
|
|
4
|
+
supportingText?: string;
|
|
5
|
+
error?: boolean;
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
leftIcon?: ReactNode;
|
|
8
|
+
rightIcon?: ReactNode;
|
|
9
|
+
onChange?: (value: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const TextField: import("react").ForwardRefExoticComponent<TextFieldProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TextareaHTMLAttributes } from 'react';
|
|
2
|
+
export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange'> {
|
|
3
|
+
label?: string;
|
|
4
|
+
supportingText?: string;
|
|
5
|
+
error?: boolean;
|
|
6
|
+
/** Shows a live character counter when `maxLength` is set. */
|
|
7
|
+
showCount?: boolean;
|
|
8
|
+
onChange?: (value: string) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface ToastProviderProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
position?: 'bottom-right' | 'top-right' | 'top-center' | 'bottom-center';
|
|
5
|
+
}
|
|
6
|
+
/** Wrap the app once; then call `useToast().toast({...})` anywhere. */
|
|
7
|
+
export declare function ToastProvider({ children, position }: ToastProviderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface TooltipProps {
|
|
3
|
+
content: string;
|
|
4
|
+
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
5
|
+
delay?: number;
|
|
6
|
+
/** A single focusable element (button, link…). */
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** Short supplementary text on hover and keyboard focus. Never hide essential info here. */
|
|
10
|
+
export declare function Tooltip({ content, position, delay, children }: TooltipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export { Button } from './Button.js';
|
|
2
|
+
export { IconButton } from './IconButton.js';
|
|
3
|
+
export { SlidingButton } from './SlidingButton.js';
|
|
4
|
+
export { Tabs, TabList, Tab, TabPanel } from './Tabs.js';
|
|
5
|
+
export { Select, SelectItem, SelectPrimitive } from './Select.js';
|
|
6
|
+
export { Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogBody, DialogFooter, DialogClose, DialogPrimitive } from './Dialog.js';
|
|
7
|
+
export { Checkbox, CheckboxPrimitive } from './Checkbox.js';
|
|
8
|
+
export { RadioGroup, RadioItem, RadioGroupPrimitive } from './RadioGroup.js';
|
|
9
|
+
export { Switch, SwitchPrimitive } from './Switch.js';
|
|
10
|
+
export { Alert } from './Alert.js';
|
|
11
|
+
export { Avatar, AvatarGroup } from './Avatar.js';
|
|
12
|
+
export { Badge } from './Badge.js';
|
|
13
|
+
export { Card } from './Card.js';
|
|
14
|
+
export { Tooltip } from './Tooltip.js';
|
|
15
|
+
export { Loading, Spinner, Skeleton, Progress } from './Loading.js';
|
|
16
|
+
export { EmptyState } from './EmptyState.js';
|
|
17
|
+
export { BottomSheet } from './BottomSheet.js';
|
|
18
|
+
export { Dropdown } from './Dropdown.js';
|
|
19
|
+
export { TextField } from './TextField.js';
|
|
20
|
+
export { Textarea } from './Textarea.js';
|
|
21
|
+
export { DatePicker } from './DatePicker.js';
|
|
22
|
+
export { Accordion, AccordionItem } from './Accordion.js';
|
|
23
|
+
export { Breadcrumb } from './Breadcrumb.js';
|
|
24
|
+
export { Pagination } from './Pagination.js';
|
|
25
|
+
export { paginationRange } from '../core/pagination.js';
|
|
26
|
+
export { Divider } from './Divider.js';
|
|
27
|
+
export { ToastProvider } from './Toast.js';
|
|
28
|
+
export { useToast } from '../core/toast.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function isValidDate(date: Date | undefined): date is Date;
|
|
2
|
+
export declare function dateKey(date: Date): string;
|
|
3
|
+
export declare function calendarDays(month: Date): Date[];
|
|
4
|
+
export declare function addDays(date: Date, days: number): Date;
|
|
5
|
+
export declare function addMonths(date: Date, months: number): Date;
|
|
6
|
+
export declare function withinRange(date: Date, min?: Date, max?: Date): boolean;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const colors: {
|
|
2
|
+
readonly brand: {
|
|
3
|
+
readonly primary: "#0A50E6";
|
|
4
|
+
readonly hover: "#0840B8";
|
|
5
|
+
readonly pressed: "#3A71EF";
|
|
6
|
+
readonly secondary: "#E9F0FE";
|
|
7
|
+
};
|
|
8
|
+
readonly neutral: {
|
|
9
|
+
readonly "50": "#F2F4FA";
|
|
10
|
+
readonly "100": "#E2E6F0";
|
|
11
|
+
readonly "200": "#CAD0E0";
|
|
12
|
+
readonly "300": "#A9B0C4";
|
|
13
|
+
readonly "400": "#858DA3";
|
|
14
|
+
readonly "500": "#676F88";
|
|
15
|
+
readonly "600": "#525A70";
|
|
16
|
+
readonly "700": "#3F4658";
|
|
17
|
+
readonly "800": "#2C313A";
|
|
18
|
+
readonly "900": "#1E222B";
|
|
19
|
+
};
|
|
20
|
+
readonly white: "#FFFFFF";
|
|
21
|
+
readonly black: "#12141A";
|
|
22
|
+
readonly success: {
|
|
23
|
+
readonly primary: "#159A27";
|
|
24
|
+
readonly secondary: "#C5F4CB";
|
|
25
|
+
};
|
|
26
|
+
readonly warning: {
|
|
27
|
+
readonly primary: "#E09400";
|
|
28
|
+
readonly secondary: "#FDEFC2";
|
|
29
|
+
};
|
|
30
|
+
readonly error: {
|
|
31
|
+
readonly primary: "#D60E0A";
|
|
32
|
+
readonly secondary: "#FBD5D4";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ToastVariant = 'info' | 'success' | 'warning' | 'error';
|
|
2
|
+
export interface ToastOptions {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
variant?: ToastVariant;
|
|
6
|
+
/** Milliseconds before auto-dismiss. Use 0 to keep it until closed. Default 5000. */
|
|
7
|
+
duration?: number;
|
|
8
|
+
action?: {
|
|
9
|
+
label: string;
|
|
10
|
+
onClick: () => void;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface ToastApi {
|
|
14
|
+
toast: (options: ToastOptions) => number;
|
|
15
|
+
dismiss: (id: number) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare const ToastContext: import("react").Context<ToastApi | null>;
|
|
18
|
+
/** Access the toast API. Requires <ToastProvider> higher in the tree. */
|
|
19
|
+
export declare function useToast(): ToastApi;
|