@kenlo/kdls-design-system 2.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 +27 -0
- package/dist/components/Accordion/Accordion.d.ts +44 -0
- package/dist/components/Accordion/Accordion.test.d.ts +1 -0
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/AccordionGroup/AccordionGroup.d.ts +13 -0
- package/dist/components/AccordionGroup/AccordionGroup.test.d.ts +1 -0
- package/dist/components/AccordionGroup/index.d.ts +1 -0
- package/dist/components/Alert/Alert.d.ts +37 -0
- package/dist/components/Alert/Alert.test.d.ts +1 -0
- package/dist/components/Alert/index.d.ts +2 -0
- package/dist/components/AttachmentList/AttachmentList.d.ts +63 -0
- package/dist/components/AttachmentList/AttachmentList.test.d.ts +1 -0
- package/dist/components/AttachmentList/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +18 -0
- package/dist/components/Avatar/Avatar.test.d.ts +1 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +32 -0
- package/dist/components/Badge/Badge.test.d.ts +1 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/BottomSheet/BottomSheet.d.ts +59 -0
- package/dist/components/BottomSheet/BottomSheet.test.d.ts +1 -0
- package/dist/components/BottomSheet/index.d.ts +2 -0
- package/dist/components/BulkActionBar/BulkActionBar.d.ts +69 -0
- package/dist/components/BulkActionBar/BulkActionBar.test.d.ts +1 -0
- package/dist/components/BulkActionBar/index.d.ts +1 -0
- package/dist/components/Button/Button.d.ts +39 -0
- package/dist/components/Button/Button.test.d.ts +1 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +126 -0
- package/dist/components/Card/Card.test.d.ts +1 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +36 -0
- package/dist/components/Checkbox/Checkbox.test.d.ts +1 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/ColorPicker/ColorPicker.d.ts +22 -0
- package/dist/components/ColorPicker/ColorPicker.test.d.ts +1 -0
- package/dist/components/ColorPicker/index.d.ts +1 -0
- package/dist/components/ColorScheme/ColorScheme.d.ts +15 -0
- package/dist/components/ColorScheme/index.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +84 -0
- package/dist/components/DatePicker/DatePicker.test.d.ts +1 -0
- package/dist/components/DatePicker/dateUtils.d.ts +18 -0
- package/dist/components/DatePicker/index.d.ts +3 -0
- package/dist/components/Drawer/Drawer.d.ts +90 -0
- package/dist/components/Drawer/Drawer.test.d.ts +1 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Field/Field.d.ts +44 -0
- package/dist/components/Field/Field.test.d.ts +1 -0
- package/dist/components/Field/index.d.ts +1 -0
- package/dist/components/Floating/Floating.d.ts +25 -0
- package/dist/components/Form/Form.d.ts +13 -0
- package/dist/components/Form/index.d.ts +3 -0
- package/dist/components/Grid/Grid.d.ts +35 -0
- package/dist/components/Grid/index.d.ts +2 -0
- package/dist/components/Header/Header.d.ts +48 -0
- package/dist/components/Header/Header.test.d.ts +1 -0
- package/dist/components/Header/index.d.ts +2 -0
- package/dist/components/Icon/Icon.d.ts +31 -0
- package/dist/components/Icon/Icon.test.d.ts +1 -0
- package/dist/components/Icon/custom/index.d.ts +10 -0
- package/dist/components/Icon/products/index.d.ts +27 -0
- package/dist/components/Icon/social/index.d.ts +24 -0
- package/dist/components/IconButton/IconButton.d.ts +24 -0
- package/dist/components/IconButton/IconButton.test.d.ts +1 -0
- package/dist/components/IconButton/index.d.ts +2 -0
- package/dist/components/Incrementer/Incrementer.d.ts +20 -0
- package/dist/components/Incrementer/index.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +136 -0
- package/dist/components/Input/Input.test.d.ts +1 -0
- package/dist/components/Input/index.d.ts +2 -0
- package/dist/components/KenloLogo/KenloLogo.d.ts +13 -0
- package/dist/components/KenloLogo/KenloLogo.test.d.ts +1 -0
- package/dist/components/KenloLogo/index.d.ts +2 -0
- package/dist/components/LyaLogo/LyaLogo.d.ts +11 -0
- package/dist/components/LyaLogo/LyaLogo.test.d.ts +1 -0
- package/dist/components/LyaLogo/index.d.ts +2 -0
- package/dist/components/Menu/Menu.d.ts +171 -0
- package/dist/components/Menu/Menu.test.d.ts +1 -0
- package/dist/components/Menu/index.d.ts +1 -0
- package/dist/components/Modal/Modal.d.ts +81 -0
- package/dist/components/Modal/Modal.test.d.ts +1 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Nav/Nav.d.ts +42 -0
- package/dist/components/Nav/index.d.ts +1 -0
- package/dist/components/Notification/Notification.d.ts +24 -0
- package/dist/components/Notification/Notification.test.d.ts +1 -0
- package/dist/components/Notification/index.d.ts +2 -0
- package/dist/components/Pagination/Pagination.d.ts +24 -0
- package/dist/components/Pagination/Pagination.test.d.ts +1 -0
- package/dist/components/Pagination/index.d.ts +1 -0
- package/dist/components/Pill/Pill.d.ts +38 -0
- package/dist/components/Pill/Pill.test.d.ts +1 -0
- package/dist/components/Pill/index.d.ts +2 -0
- package/dist/components/Popover/Popover.d.ts +24 -0
- package/dist/components/Popover/Popover.test.d.ts +1 -0
- package/dist/components/Popover/index.d.ts +1 -0
- package/dist/components/Radio/Radio.d.ts +21 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +43 -0
- package/dist/components/RadioGroup/RadioGroup.test.d.ts +1 -0
- package/dist/components/RadioGroup/index.d.ts +2 -0
- package/dist/components/SearchBar/SearchBar.d.ts +31 -0
- package/dist/components/SearchBar/SearchBar.test.d.ts +1 -0
- package/dist/components/SearchBar/index.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +117 -0
- package/dist/components/Select/Select.test.d.ts +1 -0
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Separator/Separator.d.ts +11 -0
- package/dist/components/Separator/Separator.test.d.ts +1 -0
- package/dist/components/Separator/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +62 -0
- package/dist/components/Skeleton/Skeleton.test.d.ts +1 -0
- package/dist/components/Skeleton/index.d.ts +1 -0
- package/dist/components/Spinner/Spinner.d.ts +20 -0
- package/dist/components/Spinner/Spinner.test.d.ts +1 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/StatCard/StatCard.d.ts +23 -0
- package/dist/components/StatCard/StatCard.test.d.ts +1 -0
- package/dist/components/StatCard/index.d.ts +1 -0
- package/dist/components/Switch/Switch.d.ts +27 -0
- package/dist/components/Switch/Switch.test.d.ts +1 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +88 -0
- package/dist/components/Table/Table.test.d.ts +1 -0
- package/dist/components/Table/index.d.ts +1 -0
- package/dist/components/Text/Text.d.ts +24 -0
- package/dist/components/Text/Text.test.d.ts +1 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/components/TextEditor/TextEditor.d.ts +11 -0
- package/dist/components/TextEditor/index.d.ts +1 -0
- package/dist/components/Toast/Toast.d.ts +30 -0
- package/dist/components/Toast/Toast.imperative.test.d.ts +1 -0
- package/dist/components/Toast/Toast.test.d.ts +1 -0
- package/dist/components/Toast/Toaster.d.ts +4 -0
- package/dist/components/Toast/index.d.ts +5 -0
- package/dist/components/Toast/toast-api.d.ts +19 -0
- package/dist/components/Toast/toast-store.d.ts +47 -0
- package/dist/components/Toggle/Toggle.d.ts +33 -0
- package/dist/components/Toggle/Toggle.test.d.ts +1 -0
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +15 -0
- package/dist/components/Tooltip/Tooltip.test.d.ts +1 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Uploader/Uploader.d.ts +34 -0
- package/dist/components/Uploader/Uploader.test.d.ts +1 -0
- package/dist/components/Uploader/index.d.ts +1 -0
- package/dist/components/getVisibleBounds.d.ts +6 -0
- package/dist/components/index.d.ts +51 -0
- package/dist/components/useFloatingPosition.d.ts +54 -0
- package/dist/components/useFloatingPosition.test.d.ts +1 -0
- package/dist/components/useIsMobile.d.ts +1 -0
- package/dist/foundations/Scrollbar/index.d.ts +5 -0
- package/dist/index.cjs +3 -0
- package/dist/index.css +1 -0
- package/dist/index.js +6509 -0
- package/foundations/Scrollbar/Scrollbar.css +26 -0
- package/foundations/styles.css +269 -0
- package/foundations/tailwind-preset.cjs +39 -0
- package/foundations/tokens.css +1338 -0
- package/package.json +73 -0
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# KDLS Design System
|
|
2
|
+
|
|
3
|
+
`@kenlo/kdls-design-system` — biblioteca de componentes React + tokens da Kenlo.
|
|
4
|
+
|
|
5
|
+
## Estrutura
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
kdls-design-system/
|
|
9
|
+
├── foundations/ # tokens.scss/tokens.css (fonte única de tokens) + Scrollbar (utilitário CSS)
|
|
10
|
+
├── components/ # biblioteca de componentes React (em construção)
|
|
11
|
+
├── portal/ # app de documentação interativa (playgrounds)
|
|
12
|
+
├── docs/ # PATTERNS.md (receitas de UI)
|
|
13
|
+
├── .claude/ # CLAUDE.md (índice), component-rules.md, component-standard.md, tokens-reference.md (regras)
|
|
14
|
+
└── scripts/ # geradores (ex.: styles.css)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Tokens
|
|
18
|
+
|
|
19
|
+
Os tokens ficam em `foundations/tokens.css` como CSS custom properties (`var(--spacing-4)`, `var(--color-primary-50)`), com auto-inversão light/dark. Escala de espaçamento em múltiplos de 4px. Catálogo completo em [`.claude/tokens-reference.md`](.claude/tokens-reference.md).
|
|
20
|
+
|
|
21
|
+
## Portal
|
|
22
|
+
|
|
23
|
+
`npm run dev` sobe o portal de documentação, com os playgrounds de cada componente e as páginas de fundação (cores, tipografia, espaçamento, grid, ícones).
|
|
24
|
+
|
|
25
|
+
## Status
|
|
26
|
+
|
|
27
|
+
Em construção — ainda não publicado no npm.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconElement } from '../Icon/Icon';
|
|
3
|
+
import { TooltipPosition } from '../Tooltip';
|
|
4
|
+
import './Accordion.css';
|
|
5
|
+
export interface AccordionProps {
|
|
6
|
+
/** Header title — accepts text or content (badge, etc.) */
|
|
7
|
+
title: React.ReactNode;
|
|
8
|
+
/** Content shown when the Accordion is open */
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
/** Optional icon to the left of the title (e.g. <SearchRegular />). The component handles size/alignment. */
|
|
11
|
+
icon?: IconElement;
|
|
12
|
+
/** Title size: 'md' = 16px | 'lg' = 20px (default, with larger vertical padding) */
|
|
13
|
+
size?: 'md' | 'lg';
|
|
14
|
+
/**
|
|
15
|
+
* Shows a 1px neutral-20 border around the component. `false` by default.
|
|
16
|
+
* Use `true` when the container background matches the Accordion's own background (--component-bg-color) —
|
|
17
|
+
* the border is what distinguishes the component from the surrounding surface.
|
|
18
|
+
*/
|
|
19
|
+
bordered?: boolean;
|
|
20
|
+
/** Text for the optional action (link) button in the header */
|
|
21
|
+
actionLabel?: string;
|
|
22
|
+
/** Action button callback. When it returns a Promise, the spinner activates automatically */
|
|
23
|
+
onAction?: () => void | Promise<void>;
|
|
24
|
+
/** Shows a spinner on the action button. Also activated automatically when onAction returns a Promise */
|
|
25
|
+
actionLoading?: boolean;
|
|
26
|
+
/** Disables the action button */
|
|
27
|
+
actionDisabled?: boolean;
|
|
28
|
+
/** Tooltip text shown when the action button is disabled */
|
|
29
|
+
actionDisabledTooltip?: string;
|
|
30
|
+
/** Position of the disabled action button's tooltip — default 'top' */
|
|
31
|
+
actionDisabledTooltipPosition?: TooltipPosition;
|
|
32
|
+
/** Initial open state (uncontrolled) */
|
|
33
|
+
defaultOpen?: boolean;
|
|
34
|
+
/** Controlled open state */
|
|
35
|
+
open?: boolean;
|
|
36
|
+
/** Callback fired when opening/closing (controlled mode) */
|
|
37
|
+
onOpenChange?: (open: boolean) => void;
|
|
38
|
+
/** Removes the content from the DOM when closed. By default the content stays in the DOM (enables animation and preserves internal state) */
|
|
39
|
+
destroyOnClose?: boolean;
|
|
40
|
+
/** Additional CSS classes */
|
|
41
|
+
className?: string;
|
|
42
|
+
}
|
|
43
|
+
export declare const Accordion: React.FC<AccordionProps>;
|
|
44
|
+
export default Accordion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Accordion';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AccordionProps } from '../Accordion/Accordion';
|
|
3
|
+
import './AccordionGroup.css';
|
|
4
|
+
export interface AccordionGroupProps {
|
|
5
|
+
/** Two or more Accordions. The group manages which one is open, closing the others automatically */
|
|
6
|
+
children: React.ReactElement<AccordionProps> | React.ReactElement<AccordionProps>[];
|
|
7
|
+
/** 'connected' = collapsed borders as a single block · 'spaced' = each accordion independent, with space between them */
|
|
8
|
+
variant?: 'connected' | 'spaced';
|
|
9
|
+
/** Additional CSS classes */
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const AccordionGroup: React.FC<AccordionGroupProps>;
|
|
13
|
+
export default AccordionGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AccordionGroup';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconElement } from '../Icon/Icon';
|
|
3
|
+
import './Alert.css';
|
|
4
|
+
import { TooltipPosition } from '../Tooltip';
|
|
5
|
+
export type AlertVariant = 'success' | 'alert' | 'error' | 'neutral' | 'info';
|
|
6
|
+
export interface AlertProps {
|
|
7
|
+
/** Alert's main text */
|
|
8
|
+
message: string;
|
|
9
|
+
/** Semantic variant — defines the alert's color palette */
|
|
10
|
+
variant?: AlertVariant;
|
|
11
|
+
/** Icon (24px; sm: 16px) — e.g. <InfoRegular /> */
|
|
12
|
+
icon?: IconElement;
|
|
13
|
+
/** 'lg' = body-md 16px + icon 24px · 'md' = body-sm 14px + icon 20px · 'sm' = label-sm 12px + icon 16px */
|
|
14
|
+
size?: 'lg' | 'md' | 'sm';
|
|
15
|
+
/** Width: 'hug' = fits content · 'fill' = 100% (default) */
|
|
16
|
+
width?: 'hug' | 'fill';
|
|
17
|
+
/** Shows a 1px border in the -30 shade of the variant */
|
|
18
|
+
bordered?: boolean;
|
|
19
|
+
/** Action button label */
|
|
20
|
+
actionLabel?: string;
|
|
21
|
+
/** Action button callback. When it returns a Promise, the spinner activates automatically */
|
|
22
|
+
onAction?: () => void | Promise<void>;
|
|
23
|
+
/** Shows a spinner on the action button. Also activated automatically when onAction returns a Promise */
|
|
24
|
+
actionLoading?: boolean;
|
|
25
|
+
/** Disables the action button */
|
|
26
|
+
actionDisabled?: boolean;
|
|
27
|
+
/** Tooltip text shown when the action button is disabled */
|
|
28
|
+
actionDisabledTooltip?: string;
|
|
29
|
+
/** Position of the disabled action button's tooltip — default 'top' */
|
|
30
|
+
actionDisabledTooltipPosition?: TooltipPosition;
|
|
31
|
+
/** Callback fired when clicking close — when provided, shows the close button (✕) */
|
|
32
|
+
onDismiss?: () => void;
|
|
33
|
+
/** Additional CSS classes */
|
|
34
|
+
className?: string;
|
|
35
|
+
}
|
|
36
|
+
export declare const Alert: React.FC<AlertProps>;
|
|
37
|
+
export default Alert;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconElement } from '../Icon/Icon';
|
|
3
|
+
import './AttachmentList.css';
|
|
4
|
+
export interface AttachmentRowProps {
|
|
5
|
+
/** File name shown in the row */
|
|
6
|
+
name: string;
|
|
7
|
+
/** File-type icon (always 24px) */
|
|
8
|
+
icon?: IconElement;
|
|
9
|
+
/** Secondary info below the name — e.g. "PDF • 1.3Mb" */
|
|
10
|
+
meta?: string;
|
|
11
|
+
/** Badge or status text shown to the left of the action buttons — e.g. `<Badge variant="success" label="Signed" />` */
|
|
12
|
+
badge?: React.ReactNode;
|
|
13
|
+
/** Shows the delete button (fixed icon). Called on click. When it returns a Promise, the button shows a spinner automatically until it resolves */
|
|
14
|
+
onDelete?: () => void | Promise<void>;
|
|
15
|
+
/** Shows the download button (fixed icon). Called on click. When it returns a Promise, the button shows a spinner automatically until it resolves */
|
|
16
|
+
onDownload?: () => void | Promise<void>;
|
|
17
|
+
/** Shows the view-details button — chevron (fixed icon). Called on click */
|
|
18
|
+
onViewDetails?: () => void;
|
|
19
|
+
/** Disables the delete button on this row, keeping alignment with the others. Default: false */
|
|
20
|
+
disabledDelete?: boolean;
|
|
21
|
+
/** Disables the download button on this row, keeping alignment with the others. Default: false */
|
|
22
|
+
disabledDownload?: boolean;
|
|
23
|
+
/** Disables the view-details button on this row, keeping alignment with the others. Default: false */
|
|
24
|
+
disabledViewDetails?: boolean;
|
|
25
|
+
/** Truncates the name to a single line with ellipsis instead of wrapping across lines. Shows a tooltip with the full name, only when the text was actually truncated. Pass false to keep the full name, wrapping across lines. Default: true */
|
|
26
|
+
truncateName?: boolean;
|
|
27
|
+
/** Additional CSS classes */
|
|
28
|
+
className?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const AttachmentRow: React.FC<AttachmentRowProps>;
|
|
31
|
+
export interface AttachDocument {
|
|
32
|
+
/** Unique file identifier — passed through to the onDelete/onDownload/onViewDetails callbacks */
|
|
33
|
+
id: string;
|
|
34
|
+
/** File name shown in the row */
|
|
35
|
+
name: string;
|
|
36
|
+
/** File-type icon (always 24px) */
|
|
37
|
+
icon?: IconElement;
|
|
38
|
+
/** Secondary info below the name — e.g. "PDF • 1.3Mb" */
|
|
39
|
+
meta?: string;
|
|
40
|
+
/** Badge or status text shown to the left of the action buttons — e.g. `<Badge variant="success" label="Signed" />` */
|
|
41
|
+
badge?: React.ReactNode;
|
|
42
|
+
/** Disables the delete button only on this row, even with onDelete set on AttachmentList. Keeps the button visible to preserve alignment with other rows. Default: false */
|
|
43
|
+
disabledDelete?: boolean;
|
|
44
|
+
/** Disables the download button only on this row, even with onDownload set on AttachmentList. Keeps the button visible to preserve alignment with other rows. Default: false */
|
|
45
|
+
disabledDownload?: boolean;
|
|
46
|
+
/** Disables the view-details button only on this row, even with onViewDetails set on AttachmentList. Keeps the button visible to preserve alignment with other rows. Default: false */
|
|
47
|
+
disabledViewDetails?: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface AttachmentListProps {
|
|
50
|
+
/** List of files — one row is rendered automatically per item */
|
|
51
|
+
documents: AttachDocument[];
|
|
52
|
+
/** Called with the file id when clicking delete. Shows the button on every row in `documents`. When it returns a Promise, the button shows a spinner automatically until it resolves */
|
|
53
|
+
onDelete?: (id: string) => void | Promise<void>;
|
|
54
|
+
/** Called with the file id when clicking download. Shows the button on every row in `documents`. When it returns a Promise, the button shows a spinner automatically until it resolves */
|
|
55
|
+
onDownload?: (id: string) => void | Promise<void>;
|
|
56
|
+
/** Called with the file id when clicking view details. Shows the button on every row in `documents` */
|
|
57
|
+
onViewDetails?: (id: string) => void;
|
|
58
|
+
/** Truncates every row's name to a single line, with ellipsis and tooltip when truncated. Pass false to keep the full name, wrapping across lines. Default: true */
|
|
59
|
+
truncateName?: boolean;
|
|
60
|
+
/** Additional CSS classes */
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
63
|
+
export declare const AttachmentList: React.FC<AttachmentListProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Avatar.css';
|
|
3
|
+
export interface AvatarProps {
|
|
4
|
+
/** Photo URL — when present, overrides the initials */
|
|
5
|
+
src?: string;
|
|
6
|
+
/** Initials shown in the placeholder when there's no src (e.g. 'KL') */
|
|
7
|
+
initials?: string;
|
|
8
|
+
/** Alt text for accessibility (image or placeholder) */
|
|
9
|
+
alt?: string;
|
|
10
|
+
/** Avatar size — 'sm' 40px · 'md' 48px · 'lg' 56px. Default: 'sm' */
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
/** Click callback — when provided, makes the Avatar interactive (hover, pressed, focused) */
|
|
13
|
+
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
14
|
+
/** Additional CSS classes */
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const Avatar: React.FC<AvatarProps>;
|
|
18
|
+
export default Avatar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconElement } from '../Icon/Icon';
|
|
3
|
+
import './Badge.css';
|
|
4
|
+
export type BadgeVariant = 'neutral' | 'primary' | 'secondary' | 'tertiary' | 'scheme-color' | 'lya' | 'success' | 'alert' | 'error' | 'leaf' | 'sand' | 'wood' | 'clay' | 'flower' | 'dusk' | 'sky' | 'sea' | 'lake';
|
|
5
|
+
export type BadgeAppearance = 'outline' | 'tone-10' | 'tone-20' | 'tone-30' | 'tone-40' | 'tone-50';
|
|
6
|
+
export type BadgeSize = 'sm' | 'md' | 'lg';
|
|
7
|
+
export interface BadgeProps {
|
|
8
|
+
/** Label text */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Color variant */
|
|
11
|
+
variant?: BadgeVariant;
|
|
12
|
+
/** Fill intensity — 'outline' = outline, no background · 'tone-10' to 'tone-50' = progressive tint, 'tone-50' = full color */
|
|
13
|
+
appearance?: BadgeAppearance;
|
|
14
|
+
/** Left icon — always decorative, never clickable */
|
|
15
|
+
iconLeft?: IconElement;
|
|
16
|
+
/** Right icon — always clickable, never decorative. Use together with onClickIconRight */
|
|
17
|
+
iconRight?: IconElement;
|
|
18
|
+
/** Callback when clicking iconRight — required whenever iconRight is passed. When it returns a Promise, the spinner activates automatically until it resolves */
|
|
19
|
+
onClickIconRight?: () => void | Promise<void>;
|
|
20
|
+
/** Shows a spinner in place of iconRight. Also activated automatically when onClickIconRight returns a Promise */
|
|
21
|
+
iconRightLoading?: boolean;
|
|
22
|
+
/** Disables iconRight — blocks the click and applies the disabled icon color */
|
|
23
|
+
iconRightDisabled?: boolean;
|
|
24
|
+
/** Size: sm (12px) | md (14px) | lg (16px) */
|
|
25
|
+
size?: BadgeSize;
|
|
26
|
+
/** Width: 'hug' = content | 'fill' = 100% */
|
|
27
|
+
width?: 'hug' | 'fill';
|
|
28
|
+
/** Additional CSS classes */
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const Badge: React.FC<BadgeProps>;
|
|
32
|
+
export default Badge;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconElement } from '../Icon/Icon';
|
|
3
|
+
import './BottomSheet.css';
|
|
4
|
+
import '../../foundations/Scrollbar/Scrollbar.css';
|
|
5
|
+
/** Shape of one row of the `options` list — covers the common "pick one/several values" case */
|
|
6
|
+
export interface BottomSheetOption {
|
|
7
|
+
/** Unique value — compared against `value`/returned by `onChange` */
|
|
8
|
+
value: string;
|
|
9
|
+
/** Text shown in the row */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Icon shown before the label */
|
|
12
|
+
iconLeft?: IconElement;
|
|
13
|
+
/** Icon shown after the label — auto-pushed to the end. Hides the active check when present */
|
|
14
|
+
iconRight?: IconElement;
|
|
15
|
+
/** Disables this option */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface BottomSheetProps {
|
|
19
|
+
/** Controls visibility */
|
|
20
|
+
isOpen: boolean;
|
|
21
|
+
/** Called when overlay is clicked, Escape is pressed, or the close button is clicked */
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
/** Optional label shown above the scrollable body */
|
|
24
|
+
title?: string;
|
|
25
|
+
/** Fixed slot between title and scrollable body — ideal for custom search/filter widgets that don't fit `searchable` (e.g. a list not driven by `options`) */
|
|
26
|
+
search?: React.ReactNode;
|
|
27
|
+
/** Renders a built-in search field above the list and filters `options` by label — same look and filter logic as Select's searchable */
|
|
28
|
+
searchable?: boolean;
|
|
29
|
+
/** Placeholder of the built-in search field. Only has effect with searchable */
|
|
30
|
+
searchPlaceholder?: string;
|
|
31
|
+
/** Called on every change of the built-in search field. Only has effect with searchable */
|
|
32
|
+
onSearch?: (query: string) => void;
|
|
33
|
+
/** Sheet body content (scrollable) — free-form, rendered above `options` when both are passed. Use for custom headers or rows that don't fit the value/onChange shape (links, one-off actions) */
|
|
34
|
+
children?: React.ReactNode;
|
|
35
|
+
/** Shortcut for the common case: renders the option rows automatically from a plain array — no manual list/row markup, no per-row active comparison */
|
|
36
|
+
options?: BottomSheetOption[];
|
|
37
|
+
/** Selects multiple options at once — renders a checkbox per row. `value`/`onChange` become string[], and changes are only committed when the Apply button (footer) is pressed */
|
|
38
|
+
multiple?: boolean;
|
|
39
|
+
/** Shows a pinned "Selecionar todos" checkbox above the list. Requires multiple */
|
|
40
|
+
showSelectAll?: boolean;
|
|
41
|
+
/** Selected value(s), controlled. Single select: string | null. Multiple: string[] */
|
|
42
|
+
value?: string | string[] | null;
|
|
43
|
+
/** Initial value(s) in uncontrolled mode — same shape as value; ignored when value is passed */
|
|
44
|
+
defaultValue?: string | string[] | null;
|
|
45
|
+
/** Called with the updated value. Single select fires immediately and closes the sheet; multiple only fires when Apply is pressed */
|
|
46
|
+
onChange?: (value: string | string[] | null) => void;
|
|
47
|
+
/** Shows a "Limpar" action that resets the value to empty and closes the sheet */
|
|
48
|
+
clearable?: boolean;
|
|
49
|
+
/** Sticky footer below the scrollable body. Overrides the auto-generated Limpar/Aplicar footer built from `clearable`/`multiple` */
|
|
50
|
+
footer?: React.ReactNode;
|
|
51
|
+
/** aria-label of the close button */
|
|
52
|
+
closeLabel?: string;
|
|
53
|
+
/** Label of the auto-generated Apply button in multiple mode (ignored when footer is passed) */
|
|
54
|
+
applyLabel?: string;
|
|
55
|
+
/** Extra className on the sheet panel */
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
export declare const BottomSheet: React.FC<BottomSheetProps>;
|
|
59
|
+
export default BottomSheet;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './BulkActionBar.css';
|
|
3
|
+
export interface BulkActionButton {
|
|
4
|
+
/** Button text */
|
|
5
|
+
label: string;
|
|
6
|
+
/** Button callback. When it returns a Promise, the spinner activates automatically */
|
|
7
|
+
onClick: () => void | Promise<void>;
|
|
8
|
+
/** Shows a spinner on the button. Also activated automatically when onClick returns a Promise */
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
/** Disables the button */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Tooltip text shown when the button is disabled — always above the button */
|
|
13
|
+
disabledTooltip?: string;
|
|
14
|
+
}
|
|
15
|
+
interface BulkActionGroupWithLabel {
|
|
16
|
+
/** Label shown above all buttons in this group (e.g. "Action group") */
|
|
17
|
+
groupLabel: string;
|
|
18
|
+
/** Buttons in this group — as many as you want */
|
|
19
|
+
actions: BulkActionButton[];
|
|
20
|
+
}
|
|
21
|
+
interface BulkActionGroupNoLabel {
|
|
22
|
+
groupLabel?: never;
|
|
23
|
+
/** Buttons in this group — as many as you want */
|
|
24
|
+
actions: BulkActionButton[];
|
|
25
|
+
}
|
|
26
|
+
/** An item in the `groups` array. Within this array, either every group has `groupLabel`, or none does */
|
|
27
|
+
export type BulkActionGroup = BulkActionGroupWithLabel | BulkActionGroupNoLabel;
|
|
28
|
+
interface BulkActionBarBase {
|
|
29
|
+
/** Selection count text (e.g. "3 selected") */
|
|
30
|
+
countLabel: React.ReactNode;
|
|
31
|
+
/** Grouped action sets, each with an optional label above the buttons (see BulkActionGroup table) */
|
|
32
|
+
groups?: BulkActionGroupWithLabel[] | BulkActionGroupNoLabel[];
|
|
33
|
+
/** Primary button text, shown prominently. Without this text, the button doesn't appear */
|
|
34
|
+
primaryLabel?: string;
|
|
35
|
+
/** Primary button callback. When it returns a Promise, the spinner activates automatically */
|
|
36
|
+
onPrimary?: () => void | Promise<void>;
|
|
37
|
+
/** Shows a spinner on the primary button. Also activated automatically when onPrimary returns a Promise */
|
|
38
|
+
primaryLoading?: boolean;
|
|
39
|
+
/** Disables the primary button */
|
|
40
|
+
primaryDisabled?: boolean;
|
|
41
|
+
/** Tooltip text shown when the primary button is disabled — always above the button */
|
|
42
|
+
primaryDisabledTooltip?: string;
|
|
43
|
+
/** Secondary button text, shown before the primary one. Without this text, the button doesn't appear */
|
|
44
|
+
secondaryLabel?: string;
|
|
45
|
+
/** Secondary button callback. When it returns a Promise, the spinner activates automatically */
|
|
46
|
+
onSecondary?: () => void | Promise<void>;
|
|
47
|
+
/** Shows a spinner on the secondary button. Also activated automatically when onSecondary returns a Promise */
|
|
48
|
+
secondaryLoading?: boolean;
|
|
49
|
+
/** Disables the secondary button */
|
|
50
|
+
secondaryDisabled?: boolean;
|
|
51
|
+
/** Tooltip text shown when the secondary button is disabled — always above the button */
|
|
52
|
+
secondaryDisabledTooltip?: string;
|
|
53
|
+
/** Additional CSS classes */
|
|
54
|
+
className?: string;
|
|
55
|
+
}
|
|
56
|
+
interface BulkActionBarClearProps {
|
|
57
|
+
/** Called when clicking "Limpar", shown after countLabel. Mutually exclusive with onDismiss. The callback decides what "clear" means — including whether the bar should disappear afterward (it doesn't control that on its own) */
|
|
58
|
+
onClear: () => void;
|
|
59
|
+
onDismiss?: never;
|
|
60
|
+
}
|
|
61
|
+
interface BulkActionBarDismissProps {
|
|
62
|
+
/** Called when clicking the ✕ icon, shown before countLabel. Mutually exclusive with onClear. The callback decides what this means — including whether the bar should disappear afterward (it doesn't control that on its own) */
|
|
63
|
+
onDismiss: () => void;
|
|
64
|
+
onClear?: never;
|
|
65
|
+
}
|
|
66
|
+
/** onClear XOR onDismiss — always one of the two, never both, never neither */
|
|
67
|
+
export type BulkActionBarProps = BulkActionBarBase & (BulkActionBarClearProps | BulkActionBarDismissProps);
|
|
68
|
+
export declare const BulkActionBar: React.FC<BulkActionBarProps>;
|
|
69
|
+
export default BulkActionBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './BulkActionBar';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconElement } from '../Icon/Icon';
|
|
3
|
+
import { TooltipPosition } from '../Tooltip';
|
|
4
|
+
import './Button.css';
|
|
5
|
+
export type ButtonVariant = 'primary' | 'ghost' | 'link' | 'pill' | 'pillFilled';
|
|
6
|
+
export type ButtonSize = 'md' | 'lg';
|
|
7
|
+
export type ButtonState = 'enabled' | 'hover' | 'pressed' | 'focused' | 'disabled';
|
|
8
|
+
export interface ButtonProps {
|
|
9
|
+
/** Button label */
|
|
10
|
+
label: string;
|
|
11
|
+
/** Callback fired when clicking the button */
|
|
12
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
13
|
+
/** Button's visual hierarchy */
|
|
14
|
+
variant?: ButtonVariant;
|
|
15
|
+
/** Left icon */
|
|
16
|
+
iconLeft?: IconElement;
|
|
17
|
+
/** Right icon */
|
|
18
|
+
iconRight?: IconElement;
|
|
19
|
+
/** Size: medium=48px | large=56px */
|
|
20
|
+
size?: ButtonSize;
|
|
21
|
+
/** Width: 'hug' = fits content | 'fill' = 100% */
|
|
22
|
+
width?: 'hug' | 'fill';
|
|
23
|
+
/** Shows a spinner and blocks clicks while an async action is in progress */
|
|
24
|
+
isLoading?: boolean;
|
|
25
|
+
/** Disabled state */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** Tooltip text shown on hover when the button is disabled */
|
|
28
|
+
disabledTooltip?: string;
|
|
29
|
+
/** Position of the disabled tooltip — default 'top', flips to 'bottom' automatically if it doesn't fit */
|
|
30
|
+
disabledTooltipPosition?: TooltipPosition;
|
|
31
|
+
/** Native button element type. Default: 'button' */
|
|
32
|
+
type?: 'button' | 'submit' | 'reset';
|
|
33
|
+
/** Accessibility — aria-label when there's no visible text */
|
|
34
|
+
ariaLabel?: string;
|
|
35
|
+
/** Additional CSS classes */
|
|
36
|
+
className?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
39
|
+
export default Button;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Card.css';
|
|
3
|
+
export interface CardProps {
|
|
4
|
+
/** Card content — usually Card.Header, Card.Body, Card.Section, and Card.Footer, in the desired order */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/** Cover image or media. By default sits at the top, no padding, with rounded corners on the corresponding side */
|
|
7
|
+
cover?: React.ReactNode;
|
|
8
|
+
/** Fixed cover width in px, horizontal mode only — default 296px when not set. Height always follows the card */
|
|
9
|
+
coverWidth?: number;
|
|
10
|
+
/** Fixed cover height in px, vertical mode only — when passed, fixes the height to this value instead of the default 16/9, with width always taking 100% of the card as usual */
|
|
11
|
+
coverHeight?: number;
|
|
12
|
+
/** Content positioned at the top-left corner of the cover (badges, tags) — works in both vertical and horizontal modes */
|
|
13
|
+
coverBadges?: React.ReactNode;
|
|
14
|
+
/** Places the cover on the left and the rest of the content on the right, instead of stacked */
|
|
15
|
+
horizontal?: boolean;
|
|
16
|
+
/** Internal padding size for the sub-parts (Header/Body/Footer/Section) — sm = 16px, md (default) = 24px. Doesn't affect any gap */
|
|
17
|
+
size?: 'sm' | 'md';
|
|
18
|
+
/** Shows a 1px neutral-20 border around the card. `false` by default. Use `true` when the card sits on a surface matching its own background — the border is what distinguishes the two */
|
|
19
|
+
bordered?: boolean;
|
|
20
|
+
/** Elevates the card with a shadow and pointer cursor on hover — use when the whole card is clickable */
|
|
21
|
+
hoverable?: boolean;
|
|
22
|
+
/** Callback when clicking the card. Together with hoverable, the card becomes role="button", focusable and keyboard-navigable (Enter/Space) */
|
|
23
|
+
onClick?: () => void;
|
|
24
|
+
/** Number of lines in the skeleton's paragraph block (the "body area"), when loading is true */
|
|
25
|
+
loadingRows?: number;
|
|
26
|
+
/** Number of lines in the skeleton's header block, when loading is true — counts the title too: 0 = no lines, 1 = title only, 2 (default) = title + subtitle */
|
|
27
|
+
loadingTitleRows?: number;
|
|
28
|
+
/** Shows a loading skeleton in place of the content — title+line (header) and paragraph lines (body); the cover, when present, becomes an image block. Doesn't represent Card.Footer */
|
|
29
|
+
loading?: boolean;
|
|
30
|
+
/** Additional CSS classes applied to the root element */
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface CardHeaderProps {
|
|
34
|
+
/** Header's main title */
|
|
35
|
+
title?: React.ReactNode;
|
|
36
|
+
/** Subtitle or complementary description — sits on its own line below title/left, in the same column. Doesn't invade the right's space — width stops where right begins */
|
|
37
|
+
subtitle?: React.ReactNode;
|
|
38
|
+
/** Extra content to the left of the title (e.g. status badge) — aligned only to title, unrelated to subtitle. With title, sits next to it with an automatic 16px gap. Without title, stands alone, no gap */
|
|
39
|
+
left?: React.ReactNode;
|
|
40
|
+
/** Right-side content — always vertically centered relative to the title+subtitle column, regardless of each one's height (filter pills, icon buttons, more-options menu) */
|
|
41
|
+
right?: React.ReactNode;
|
|
42
|
+
/** Extra free-form content, rendered after the slots above */
|
|
43
|
+
children?: React.ReactNode;
|
|
44
|
+
/** Shows the bottom border separating the header from the rest of the card. Use `false` when the header is the only content, or when the card has no divider at all between sections (e.g. list/funnel card) */
|
|
45
|
+
bordered?: boolean;
|
|
46
|
+
/** Additional CSS classes */
|
|
47
|
+
className?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface CardBodyProps {
|
|
50
|
+
/** Card's main content */
|
|
51
|
+
children: React.ReactNode;
|
|
52
|
+
/** Additional CSS classes */
|
|
53
|
+
className?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface CardFooterProps {
|
|
56
|
+
/** Footer content — usually action buttons */
|
|
57
|
+
children: React.ReactNode;
|
|
58
|
+
/** Footer alignment. By default stacks items in a column, like Card.Body — `right` returns to a row layout, right-aligned */
|
|
59
|
+
align?: 'right';
|
|
60
|
+
/** Additional CSS classes */
|
|
61
|
+
className?: string;
|
|
62
|
+
}
|
|
63
|
+
export interface CardSectionProps {
|
|
64
|
+
/** Section title, shown above the content */
|
|
65
|
+
title?: string;
|
|
66
|
+
/** Section content */
|
|
67
|
+
children: React.ReactNode;
|
|
68
|
+
/** Shows the top border separating the section from the previous content. Use `false` for a block with the same padding, no separator at all */
|
|
69
|
+
bordered?: boolean;
|
|
70
|
+
/** Additional CSS classes */
|
|
71
|
+
className?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface CardInfoRowProps {
|
|
74
|
+
/** The row's Card.InfoPair items — as many as you want, shown in a grid */
|
|
75
|
+
children: React.ReactNode;
|
|
76
|
+
/** Number of grid columns */
|
|
77
|
+
columns?: 2 | 3 | 4;
|
|
78
|
+
/** Additional CSS classes */
|
|
79
|
+
className?: string;
|
|
80
|
+
}
|
|
81
|
+
export interface CardInfoPairProps {
|
|
82
|
+
/** Label shown above the value */
|
|
83
|
+
label: string;
|
|
84
|
+
/** Value shown below the label */
|
|
85
|
+
value: React.ReactNode;
|
|
86
|
+
/** Additional CSS classes */
|
|
87
|
+
className?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface CardCollapsibleProps {
|
|
90
|
+
/** Content hidden by default, revealed by clicking the trigger */
|
|
91
|
+
children: React.ReactNode;
|
|
92
|
+
/** Trigger text when the content is closed */
|
|
93
|
+
showLabel?: string;
|
|
94
|
+
/** Trigger text when the content is open */
|
|
95
|
+
hideLabel?: string;
|
|
96
|
+
/** Trigger alignment */
|
|
97
|
+
align?: 'right' | 'center';
|
|
98
|
+
/** Initial state (uncontrolled) */
|
|
99
|
+
defaultOpen?: boolean;
|
|
100
|
+
/** Controlled state */
|
|
101
|
+
open?: boolean;
|
|
102
|
+
/** Callback fired when opening/closing (controlled mode) */
|
|
103
|
+
onOpenChange?: (open: boolean) => void;
|
|
104
|
+
/** Shows the arrow icon next to the trigger text */
|
|
105
|
+
showIcon?: boolean;
|
|
106
|
+
/** Classes CSS adicionais */
|
|
107
|
+
className?: string;
|
|
108
|
+
}
|
|
109
|
+
declare const CardHeader: React.FC<CardHeaderProps>;
|
|
110
|
+
declare const CardBody: React.FC<CardBodyProps>;
|
|
111
|
+
declare const CardFooter: React.FC<CardFooterProps>;
|
|
112
|
+
declare const CardSection: React.FC<CardSectionProps>;
|
|
113
|
+
declare const CardInfoRow: React.FC<CardInfoRowProps>;
|
|
114
|
+
declare const CardInfoPair: React.FC<CardInfoPairProps>;
|
|
115
|
+
declare const CardCollapsible: React.FC<CardCollapsibleProps>;
|
|
116
|
+
export interface CardComponent extends React.FC<CardProps> {
|
|
117
|
+
Header: typeof CardHeader;
|
|
118
|
+
Body: typeof CardBody;
|
|
119
|
+
Footer: typeof CardFooter;
|
|
120
|
+
Section: typeof CardSection;
|
|
121
|
+
InfoRow: typeof CardInfoRow;
|
|
122
|
+
InfoPair: typeof CardInfoPair;
|
|
123
|
+
Collapsible: typeof CardCollapsible;
|
|
124
|
+
}
|
|
125
|
+
declare const Card: CardComponent;
|
|
126
|
+
export { Card };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Card';
|