@fluityy/designsystem 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 +66 -0
- package/dist/components/Accordion/Accordion.d.ts +11 -0
- package/dist/components/Alert/Alert.d.ts +10 -0
- package/dist/components/Avatar/Avatar.d.ts +12 -0
- package/dist/components/Badge/Badge.d.ts +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +7 -0
- package/dist/components/Button/Button.d.ts +9 -0
- package/dist/components/Card/Card.d.ts +5 -0
- package/dist/components/Checkbox/Checkbox.d.ts +5 -0
- package/dist/components/Divider/Divider.d.ts +6 -0
- package/dist/components/Drawer/Drawer.d.ts +14 -0
- package/dist/components/Dropdown/Dropdown.d.ts +18 -0
- package/dist/components/Input/Input.d.ts +9 -0
- package/dist/components/Modal/Modal.d.ts +12 -0
- package/dist/components/Popover/Popover.d.ts +12 -0
- package/dist/components/Progress/Progress.d.ts +7 -0
- package/dist/components/Radio/Radio.d.ts +12 -0
- package/dist/components/Select/Select.d.ts +9 -0
- package/dist/components/Spinner/Spinner.d.ts +9 -0
- package/dist/components/StatCard/StatCard.d.ts +13 -0
- package/dist/components/Switch/Switch.d.ts +12 -0
- package/dist/components/Tabs/Tabs.d.ts +15 -0
- package/dist/components/Textarea/Textarea.d.ts +7 -0
- package/dist/components/Toast/Toast.d.ts +16 -0
- package/dist/components/Tooltip/Tooltip.d.ts +11 -0
- package/dist/components/index.d.ts +25 -0
- package/dist/hooks/useControllableState.d.ts +9 -0
- package/dist/hooks/useDismissable.d.ts +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2559 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +264 -0
- package/dist/theme/ThemeProvider.d.ts +34 -0
- package/dist/tokens/tokens.d.ts +10 -0
- package/dist/utils/Portal.d.ts +4 -0
- package/dist/utils/cn.d.ts +3 -0
- package/package.json +60 -0
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Flui Design System
|
|
2
|
+
|
|
3
|
+
Design system multiplataforma. Os **tokens** (em JSON) são a fonte única da
|
|
4
|
+
verdade; o Style Dictionary gera a saída para cada plataforma. Hoje: **React +
|
|
5
|
+
Vite**. Amanhã: **Flutter** (sem duplicar tokens).
|
|
6
|
+
|
|
7
|
+
## Arquitetura
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
tokens/*.json ← FONTE DA VERDADE (platform-agnostic)
|
|
11
|
+
│ style-dictionary.config.mjs
|
|
12
|
+
▼
|
|
13
|
+
src/styles/tokens.css ← CSS vars (--flui-*) [web, gerado]
|
|
14
|
+
src/lib/tokens/tokens.ts ← manifesto p/ o editor [web, gerado]
|
|
15
|
+
build/flutter/*.dart ← constantes Dart [futuro, gerado]
|
|
16
|
+
|
|
17
|
+
src/lib/ ← biblioteca de componentes (React + CVA)
|
|
18
|
+
src/showcase/ ← plataforma de showcase + editor de tokens ao vivo
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Camadas de token:
|
|
22
|
+
1. **Primitivos** (`color.brand.500`) — paleta crua, não usar em componentes.
|
|
23
|
+
2. **Semânticos** (`semantic.primary.default`) — intenção; é o que os
|
|
24
|
+
componentes consomem. Referenciam primitivos via `var()`, então editar um
|
|
25
|
+
primitivo cascateia para os semânticos automaticamente.
|
|
26
|
+
|
|
27
|
+
Os componentes nunca usam valores hard-coded — só utilitários do Tailwind
|
|
28
|
+
mapeados para as CSS vars em [src/styles/global.css](src/styles/global.css)
|
|
29
|
+
(`bg-primary`, `text-fg`, `rounded-md`, etc.).
|
|
30
|
+
|
|
31
|
+
## Scripts
|
|
32
|
+
|
|
33
|
+
| Comando | O que faz |
|
|
34
|
+
| -------------------- | ---------------------------------------------------- |
|
|
35
|
+
| `npm run dev` | Gera tokens + sobe o showcase (Vite) |
|
|
36
|
+
| `npm run build` | Gera tokens + typecheck + build de produção |
|
|
37
|
+
| `npm run tokens` | Regenera CSS/TS a partir de `tokens/*.json` |
|
|
38
|
+
| `npm run tokens:watch` | Regenera os tokens em watch enquanto edita o JSON |
|
|
39
|
+
|
|
40
|
+
## Showcase + editor ao vivo
|
|
41
|
+
|
|
42
|
+
`npm run dev` → o painel esquerdo lista todos os tokens. Editar um valor
|
|
43
|
+
sobrescreve a CSS var correspondente em runtime (`setProperty`), os componentes
|
|
44
|
+
reagem na hora, e a alteração é salva no `localStorage`.
|
|
45
|
+
|
|
46
|
+
- **Exportar JSON** baixa só os tokens alterados (keyed por path, ex.
|
|
47
|
+
`"color.brand.500"`), pronto para revisar e aplicar nos `tokens/*.json`.
|
|
48
|
+
- **Resetar** (por token ou tudo) remove o override e volta ao valor original.
|
|
49
|
+
|
|
50
|
+
> O editor é uma camada de _experimentação_. Para tornar uma mudança permanente,
|
|
51
|
+
> aplique o valor no JSON de origem e rode `npm run tokens`.
|
|
52
|
+
|
|
53
|
+
## Como estender
|
|
54
|
+
|
|
55
|
+
**Novo token:** edite/crie um arquivo em `tokens/` e rode `npm run tokens`. Para
|
|
56
|
+
expô-lo como utilitário do Tailwind, adicione o mapeamento no bloco `@theme` de
|
|
57
|
+
[src/styles/global.css](src/styles/global.css).
|
|
58
|
+
|
|
59
|
+
**Novo componente:** crie `src/lib/components/<Nome>/<Nome>.tsx` usando `cva`
|
|
60
|
+
para variantes e apenas utilitários baseados em token; exporte em
|
|
61
|
+
[src/lib/components/index.ts](src/lib/components/index.ts); adicione uma seção em
|
|
62
|
+
[src/showcase/Gallery.tsx](src/showcase/Gallery.tsx).
|
|
63
|
+
|
|
64
|
+
**Suporte a Flutter:** descomente o bloco `flutter` em
|
|
65
|
+
[style-dictionary.config.mjs](style-dictionary.config.mjs). Os mesmos
|
|
66
|
+
`tokens/*.json` passam a gerar `build/flutter/flui_tokens.dart`.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface AccordionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
type?: "single" | "multiple";
|
|
3
|
+
defaultValue?: string | string[];
|
|
4
|
+
}
|
|
5
|
+
export declare function Accordion({ type, defaultValue, className, children, ...props }: AccordionProps): import("react").JSX.Element;
|
|
6
|
+
export interface AccordionItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function AccordionItem({ value, children, ...props }: AccordionItemProps): import("react").JSX.Element;
|
|
10
|
+
export declare function AccordionTrigger({ className, children, ...props }: React.ButtonHTMLAttributes<HTMLButtonElement>): import("react").JSX.Element;
|
|
11
|
+
export declare function AccordionContent({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const alertVariants: (props?: ({
|
|
3
|
+
variant?: "danger" | "success" | "warning" | "info" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
export interface AlertProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">, VariantProps<typeof alertVariants> {
|
|
6
|
+
title?: React.ReactNode;
|
|
7
|
+
onClose?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Alert: import('react').ForwardRefExoticComponent<AlertProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const sizeVariants: (props?: ({
|
|
3
|
+
size?: "sm" | "md" | "lg" | "xs" | "xl" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
export interface AvatarProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof sizeVariants> {
|
|
6
|
+
src?: string;
|
|
7
|
+
alt?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
status?: "online" | "busy" | "away" | "offline";
|
|
10
|
+
}
|
|
11
|
+
export declare const Avatar: import('react').ForwardRefExoticComponent<AvatarProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const badgeVariants: (props?: ({
|
|
3
|
+
variant?: "primary" | "outline" | "accent" | "danger" | "neutral" | "accent-bold" | "success" | "warning" | null | undefined;
|
|
4
|
+
size?: "sm" | "md" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
export declare const Badge: import('react').ForwardRefExoticComponent<BadgeProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const Breadcrumb: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLElement> & import('react').RefAttributes<HTMLElement>>;
|
|
2
|
+
export interface BreadcrumbItemProps extends React.LiHTMLAttributes<HTMLLIElement> {
|
|
3
|
+
href?: string;
|
|
4
|
+
current?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function BreadcrumbItem({ href, current, className, children, ...props }: BreadcrumbItemProps): import("react").JSX.Element;
|
|
7
|
+
export declare function BreadcrumbSeparator(): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const buttonVariants: (props?: ({
|
|
3
|
+
variant?: "primary" | "secondary" | "outline" | "ghost" | "accent" | "danger" | null | undefined;
|
|
4
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
5
|
+
fullWidth?: boolean | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
8
|
+
}
|
|
9
|
+
export declare const Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const Card: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
2
|
+
export declare const CardHeader: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export declare const CardTitle: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLHeadingElement> & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
4
|
+
export declare const CardDescription: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLParagraphElement> & import('react').RefAttributes<HTMLParagraphElement>>;
|
|
5
|
+
export declare const CardContent: import('react').ForwardRefExoticComponent<import('react').HTMLAttributes<HTMLDivElement> & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size" | "type"> {
|
|
2
|
+
label?: React.ReactNode;
|
|
3
|
+
indeterminate?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const Checkbox: import('react').ForwardRefExoticComponent<CheckboxProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface DividerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
orientation?: "horizontal" | "vertical";
|
|
3
|
+
/** rótulo central (apenas horizontal) */
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const Divider: import('react').ForwardRefExoticComponent<DividerProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Side = "left" | "right" | "top" | "bottom";
|
|
2
|
+
export interface DrawerProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onOpenChange?: (open: boolean) => void;
|
|
5
|
+
side?: Side;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function Drawer({ open, onOpenChange, side, children }: DrawerProps): import("react").JSX.Element | null;
|
|
9
|
+
export declare function DrawerContent({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
10
|
+
export declare function DrawerHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
11
|
+
export declare function DrawerTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): import("react").JSX.Element;
|
|
12
|
+
export declare function DrawerBody({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
13
|
+
export declare function DrawerFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export declare function Dropdown({ children }: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
export declare function DropdownTrigger({ children }: {
|
|
6
|
+
children: ReactElement<any>;
|
|
7
|
+
}): ReactElement<any, string | import('react').JSXElementConstructor<any>>;
|
|
8
|
+
export declare function DropdownContent({ children, align, className, }: {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
align?: "start" | "end";
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element | null;
|
|
13
|
+
export interface DropdownItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
14
|
+
onSelect?: () => void;
|
|
15
|
+
destructive?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function DropdownItem({ children, onSelect, destructive, className, ...props }: DropdownItemProps): import("react").JSX.Element;
|
|
18
|
+
export declare function DropdownSeparator(): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const inputVariants: (props?: ({
|
|
3
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
4
|
+
invalid?: boolean | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, VariantProps<typeof inputVariants> {
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ModalProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onOpenChange?: (open: boolean) => void;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare function Modal({ open, onOpenChange, children }: ModalProps): import("react").JSX.Element | null;
|
|
7
|
+
export declare function ModalContent({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
8
|
+
export declare function ModalHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
9
|
+
export declare function ModalTitle({ className, ...props }: React.HTMLAttributes<HTMLHeadingElement>): import("react").JSX.Element;
|
|
10
|
+
export declare function ModalDescription({ className, ...props }: React.HTMLAttributes<HTMLParagraphElement>): import("react").JSX.Element;
|
|
11
|
+
export declare function ModalBody({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
12
|
+
export declare function ModalFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export declare function Popover({ children }: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}): import("react").JSX.Element;
|
|
5
|
+
export declare function PopoverTrigger({ children }: {
|
|
6
|
+
children: ReactElement<any>;
|
|
7
|
+
}): ReactElement<any, string | import('react').JSXElementConstructor<any>>;
|
|
8
|
+
export declare function PopoverContent({ children, align, className, }: {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
align?: "start" | "end";
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ProgressProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
/** 0–100. Omita (ou use indeterminate) para estado indeterminado. */
|
|
3
|
+
value?: number;
|
|
4
|
+
max?: number;
|
|
5
|
+
indeterminate?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const Progress: import('react').ForwardRefExoticComponent<ProgressProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
2
|
+
value?: string;
|
|
3
|
+
defaultValue?: string;
|
|
4
|
+
onValueChange?: (value: string) => void;
|
|
5
|
+
name?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function RadioGroup({ value, defaultValue, onValueChange, name, className, children, ...props }: RadioGroupProps): import("react").JSX.Element;
|
|
8
|
+
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "onChange"> {
|
|
9
|
+
value: string;
|
|
10
|
+
label?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const Radio: import('react').ForwardRefExoticComponent<RadioProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const selectVariants: (props?: ({
|
|
3
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
4
|
+
invalid?: boolean | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "size">, VariantProps<typeof selectVariants> {
|
|
7
|
+
}
|
|
8
|
+
export declare const Select: import('react').ForwardRefExoticComponent<SelectProps & import('react').RefAttributes<HTMLSelectElement>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const spinnerVariants: (props?: ({
|
|
3
|
+
size?: "sm" | "md" | "lg" | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
export interface SpinnerProps extends React.SVGAttributes<SVGSVGElement>, VariantProps<typeof spinnerVariants> {
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const Spinner: import('react').ForwardRefExoticComponent<SpinnerProps & import('react').RefAttributes<SVGSVGElement>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface StatCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
2
|
+
label: React.ReactNode;
|
|
3
|
+
value?: React.ReactNode;
|
|
4
|
+
/** Valor numérico para animação tipo cassino. Usa `formatCount` para exibir. */
|
|
5
|
+
countUp?: number;
|
|
6
|
+
/** Formata o número animado. Default: toLocaleString('pt-BR'). */
|
|
7
|
+
formatCount?: (n: number) => string;
|
|
8
|
+
/** variação percentual; positivo = alta (success), negativo = baixa (danger) */
|
|
9
|
+
delta?: number;
|
|
10
|
+
helpText?: React.ReactNode;
|
|
11
|
+
icon?: React.ReactNode;
|
|
12
|
+
}
|
|
13
|
+
export declare const StatCard: import('react').ForwardRefExoticComponent<StatCardProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
declare const trackVariants: (props?: ({
|
|
3
|
+
size?: "sm" | "md" | null | undefined;
|
|
4
|
+
checked?: boolean | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onChange">, VariantProps<typeof trackVariants> {
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
defaultChecked?: boolean;
|
|
9
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const Switch: import('react').ForwardRefExoticComponent<SwitchProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
2
|
+
value?: string;
|
|
3
|
+
defaultValue?: string;
|
|
4
|
+
onValueChange?: (value: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function Tabs({ value, defaultValue, onValueChange, className, children, ...props }: TabsProps): import("react").JSX.Element;
|
|
7
|
+
export declare function TabsList({ className, children, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
8
|
+
export interface TabsTriggerProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
9
|
+
value: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function TabsTrigger({ value, className, ...props }: TabsTriggerProps): import("react").JSX.Element;
|
|
12
|
+
export interface TabsContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
13
|
+
value: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function TabsContent({ value, className, ...props }: TabsContentProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
export declare const textareaVariants: (props?: ({
|
|
3
|
+
invalid?: boolean | null | undefined;
|
|
4
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
5
|
+
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement>, VariantProps<typeof textareaVariants> {
|
|
6
|
+
}
|
|
7
|
+
export declare const Textarea: import('react').ForwardRefExoticComponent<TextareaProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type ToastVariant = "info" | "success" | "warning" | "danger";
|
|
2
|
+
interface ToastOptions {
|
|
3
|
+
title: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
variant?: ToastVariant;
|
|
6
|
+
duration?: number;
|
|
7
|
+
}
|
|
8
|
+
interface ToastContextValue {
|
|
9
|
+
toast: (options: ToastOptions) => number;
|
|
10
|
+
dismiss: (id: number) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function ToastProvider({ children }: {
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
export declare function useToast(): ToastContextValue;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface TooltipProps {
|
|
2
|
+
content: React.ReactNode;
|
|
3
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Tooltip leve baseado em hover/focus. O posicionamento é relativo ao gatilho
|
|
9
|
+
* (sem detecção de colisão com a borda da tela — para isso, usar Floating UI).
|
|
10
|
+
*/
|
|
11
|
+
export declare function Tooltip({ content, side, children, className }: TooltipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export * from './Button/Button';
|
|
2
|
+
export * from './Input/Input';
|
|
3
|
+
export * from './Card/Card';
|
|
4
|
+
export * from './Switch/Switch';
|
|
5
|
+
export * from './Checkbox/Checkbox';
|
|
6
|
+
export * from './Radio/Radio';
|
|
7
|
+
export * from './Select/Select';
|
|
8
|
+
export * from './Dropdown/Dropdown';
|
|
9
|
+
export * from './Badge/Badge';
|
|
10
|
+
export * from './Avatar/Avatar';
|
|
11
|
+
export * from './Spinner/Spinner';
|
|
12
|
+
export * from './Progress/Progress';
|
|
13
|
+
export * from './Divider/Divider';
|
|
14
|
+
export * from './Breadcrumb/Breadcrumb';
|
|
15
|
+
export * from './StatCard/StatCard';
|
|
16
|
+
export * from './Alert/Alert';
|
|
17
|
+
export * from './Tabs/Tabs';
|
|
18
|
+
export * from './Accordion/Accordion';
|
|
19
|
+
export * from './Tooltip/Tooltip';
|
|
20
|
+
export * from './Popover/Popover';
|
|
21
|
+
export * from './Modal/Modal';
|
|
22
|
+
export * from './Drawer/Drawer';
|
|
23
|
+
export * from './Toast/Toast';
|
|
24
|
+
export * from './Textarea/Textarea';
|
|
25
|
+
export * from '../theme/ThemeProvider';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Suporta componentes controlados e não-controlados com a mesma API.
|
|
3
|
+
* Se `value` for fornecido, o componente é controlado; senão usa estado interno.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useControllableState<T>({ value, defaultValue, onChange, }: {
|
|
6
|
+
value?: T;
|
|
7
|
+
defaultValue: T;
|
|
8
|
+
onChange?: (value: T) => void;
|
|
9
|
+
}): readonly [T, (next: T) => void];
|
package/dist/index.d.ts
ADDED