@giro-ds/react 4.0.0 → 5.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/dist/dts-temp/components/Calendar/Calendar.d.ts +3 -0
- package/dist/dts-temp/components/Calendar/Calendar.types.d.ts +55 -0
- package/dist/{components → dts-temp/components}/DatePicker/DatePicker.types.d.ts +5 -3
- package/dist/dts-temp/components/DatePicker/Utils/DateUtils.d.ts +6 -0
- package/dist/{components → dts-temp/components}/Dialog/Dialog.types.d.ts +3 -4
- package/dist/dts-temp/components/Drawer/Drawer.d.ts +4 -0
- package/dist/{components → dts-temp/components}/Drawer/Drawer.types.d.ts +2 -0
- package/dist/{components → dts-temp/components}/Filter/Filter.types.d.ts +15 -6
- package/dist/dts-temp/components/Filter/index.d.ts +2 -0
- package/dist/dts-temp/components/Popover/Popover.types.d.ts +25 -0
- package/dist/{components → dts-temp/components}/Table/TableHeader.d.ts +5 -3
- package/dist/dts-temp/components/TextArea/TextArea.d.ts +4 -0
- package/dist/dts-temp/components/TextArea/TextArea.types.d.ts +56 -0
- package/dist/dts-temp/components/TextArea/index.d.ts +2 -0
- package/dist/{components → dts-temp/components}/TextField/TextField.types.d.ts +9 -1
- package/dist/dts-temp/components/TextField/utils/__tests__/validation.test.d.ts +1 -0
- package/dist/dts-temp/components/Toast/__tests__/Toast.test.d.ts +1 -0
- package/dist/dts-temp/components/Tooltip/__tests__/Tooltip.test.d.ts +1 -0
- package/dist/{components → dts-temp/components}/index.d.ts +2 -2
- package/dist/dts-temp/index.d.ts +1 -0
- package/dist/index.cjs +429 -703
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +431 -705
- package/dist/index.esm.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/components/Calendar/Calendar.d.ts +0 -3
- package/dist/components/Calendar/Calendar.types.d.ts +0 -109
- package/dist/components/DatePicker/DateUtils.d.ts +0 -23
- package/dist/components/Drawer/Drawer.d.ts +0 -9
- package/dist/components/Dropdown/Dropdown.d.ts +0 -4
- package/dist/components/Dropdown/Dropdown.types.d.ts +0 -91
- package/dist/components/Dropdown/DropdownUtils.d.ts +0 -8
- package/dist/components/Dropdown/index.d.ts +0 -2
- package/dist/components/Filter/index.d.ts +0 -2
- package/dist/components/Popover/Popover.types.d.ts +0 -8
- package/dist/index.d.ts +0 -1618
- /package/dist/{components → dts-temp/components}/Avatar/Avatar.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Avatar/Avatar.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Avatar/__tests__/Avatar.test.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Avatar/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Badge/Badge.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Badge/Badge.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Badge/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Button/Button.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Button/Button.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Button/__tests__/Button.test.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Button/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Calendar/__tests__/Calendar.test.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Calendar/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Callout/Callout.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Callout/Callout.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Callout/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Checkbox/Checkbox.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Checkbox/Checkbox.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Checkbox/__tests__/Checkbox.test.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Checkbox/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Chips/Chips.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Chips/Chips.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Chips/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Container/Container.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Container/Container.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Container/__tests__/Container.test.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/DatePicker/DatePicker.d.ts +0 -0
- /package/dist/{components/Dialog/__tests__/Dialog.test.d.ts → dts-temp/components/DatePicker/__test__/DatePicker.test.d.ts} +0 -0
- /package/dist/{components → dts-temp/components}/DatePicker/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Dialog/Dialog.d.ts +0 -0
- /package/dist/{components/Menu/__tests__/Menu.test.d.ts → dts-temp/components/Dialog/__tests__/Dialog.test.d.ts} +0 -0
- /package/dist/{components → dts-temp/components}/Dialog/index.d.ts +0 -0
- /package/dist/{components/Popover/__test__/Popover.test.d.ts → dts-temp/components/Drawer/__tests__/Drawer.test.d.ts} +0 -0
- /package/dist/{components → dts-temp/components}/Drawer/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Filter/Filter.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/ListItem/ListItem.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/ListItem/ListItem.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/ListItem/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Menu/Menu.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Menu/Menu.types.d.ts +0 -0
- /package/dist/{components/Radio/__tests__/Radio.test.d.ts → dts-temp/components/Menu/__tests__/Menu.test.d.ts} +0 -0
- /package/dist/{components → dts-temp/components}/Menu/components/MenuItem.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Menu/hooks/useMenuLogic.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Menu/hooks/useSearchLogic.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Menu/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Popover/Popover.d.ts +0 -0
- /package/dist/{components/Search/__tests__/Search.test.d.ts → dts-temp/components/Popover/__test__/Popover.test.d.ts} +0 -0
- /package/dist/{components → dts-temp/components}/Popover/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Quantity/Quantity.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Quantity/Quantity.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Quantity/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Radio/Radio.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Radio/Radio.types.d.ts +0 -0
- /package/dist/{components/Select/__tests__/SelectRadix.test.d.ts → dts-temp/components/Radio/__tests__/Radio.test.d.ts} +0 -0
- /package/dist/{components → dts-temp/components}/Radio/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Search/Search.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Search/Search.types.d.ts +0 -0
- /package/dist/{components/Switch/__tests__/Switch.test.d.ts → dts-temp/components/Search/__tests__/Search.test.d.ts} +0 -0
- /package/dist/{components → dts-temp/components}/Search/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Select/Select.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Select/Select.types.d.ts +0 -0
- /package/dist/{components/TextField/__tests__/Textfield.test.d.ts → dts-temp/components/Select/__tests__/SelectRadix.test.d.ts} +0 -0
- /package/dist/{components → dts-temp/components}/Select/components/CheckboxSelectItem.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Select/components/ExpandableSelectItem.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Select/components/SelectItem.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Select/hooks/useSelectLogic.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Select/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Switch/Switch.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Switch/Switch.types.d.ts +0 -0
- /package/dist/{components/TextField/utils/__tests__/validation.test.d.ts → dts-temp/components/Switch/__tests__/Switch.test.d.ts} +0 -0
- /package/dist/{components → dts-temp/components}/Switch/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Table/EmptyRows150Color.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Table/LoaderList.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Table/MultiLineText/MultiLineText.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Table/MultiLineText/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Table/Table.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Table/Table.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Table/TablePagination.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Table/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Table/utils/tableActions.d.ts +0 -0
- /package/dist/{components/Toast/__tests__/Toast.test.d.ts → dts-temp/components/TextArea/__tests__/TextArea.test.d.ts} +0 -0
- /package/dist/{components → dts-temp/components}/TextField/TextField.d.ts +0 -0
- /package/dist/{components/Tooltip/__tests__/Tooltip.test.d.ts → dts-temp/components/TextField/__tests__/Textfield.test.d.ts} +0 -0
- /package/dist/{components → dts-temp/components}/TextField/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/TextField/utils/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/TextField/utils/validation.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Toast/Toast.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Toast/Toast.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Toast/components/ToastContainer.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Toast/components/ToastProvider.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Toast/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Tooltip/Tooltip.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Tooltip/Tooltip.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/Tooltip/index.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/VerificationCode/VerificationCode.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/VerificationCode/VerificationCode.types.d.ts +0 -0
- /package/dist/{components → dts-temp/components}/VerificationCode/index.d.ts +0 -0
- /package/dist/{contexts → dts-temp/contexts}/ToastContext.d.ts +0 -0
- /package/dist/{hooks → dts-temp/hooks}/ApiSimulation.d.ts +0 -0
- /package/dist/{hooks → dts-temp/hooks}/InfiniteScroll.d.ts +0 -0
- /package/dist/{hooks → dts-temp/hooks}/NormalizeText.d.ts +0 -0
- /package/dist/{hooks → dts-temp/hooks}/useToast.d.ts +0 -0
- /package/dist/{shared → dts-temp/shared}/Label/index.d.ts +0 -0
- /package/dist/{shared → dts-temp/shared}/icons/CheckHalf.d.ts +0 -0
- /package/dist/{shared → dts-temp/shared}/icons/CheckSmall.d.ts +0 -0
- /package/dist/{shared → dts-temp/shared}/icons/index.d.ts +0 -0
- /package/dist/{types → dts-temp/types}/common.types.d.ts +0 -0
- /package/dist/{types → dts-temp/types}/index.d.ts +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CalendarProps } from "./Calendar.types";
|
|
2
|
+
declare const Calendar: ({ selected, currentDate, defaultMonth, startMonth, endMonth, onDaySelect, onDateChange, onClear: _onClear, minDate, maxDate, disabled, format: _format, locale, autoFocus, id, "aria-label": ariaLabel, }: CalendarProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default Calendar;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { BaseProps, Locale } from '../../types/common.types';
|
|
2
|
+
import type { Matcher } from 'react-day-picker';
|
|
3
|
+
/** Formato de exibição da data aceito pelo componente. */
|
|
4
|
+
export type DateFormat = 'dd/mm/yyyy' | 'mm/dd/yyyy' | (string & {});
|
|
5
|
+
interface CalendarBaseProps extends Omit<BaseProps, 'disabled'> {
|
|
6
|
+
/** Data selecionada atualmente (usada pelo DatePicker). */
|
|
7
|
+
selected?: Date | null;
|
|
8
|
+
/**
|
|
9
|
+
* Mês exibido no calendário. Use junto com `onDateChange` para
|
|
10
|
+
* controlar a navegação externamente.
|
|
11
|
+
*/
|
|
12
|
+
currentDate?: Date | null;
|
|
13
|
+
/**
|
|
14
|
+
* Mês inicial padrão exibido quando não controlado.
|
|
15
|
+
* @default currentDate
|
|
16
|
+
*/
|
|
17
|
+
defaultMonth?: Date;
|
|
18
|
+
/** Primeiro mês navegável. */
|
|
19
|
+
startMonth?: Date;
|
|
20
|
+
/** Último mês navegável. */
|
|
21
|
+
endMonth?: Date;
|
|
22
|
+
/** Chamado quando o usuário seleciona um dia. */
|
|
23
|
+
onDaySelect?: (date: Date) => void;
|
|
24
|
+
/** Chamado quando o usuário navega entre meses. */
|
|
25
|
+
onDateChange?: (date: Date) => void;
|
|
26
|
+
/** Chamado quando o usuário limpa a seleção. */
|
|
27
|
+
onClear?: () => void;
|
|
28
|
+
/** Data mínima selecionável. */
|
|
29
|
+
minDate?: Date;
|
|
30
|
+
/** Data máxima selecionável. */
|
|
31
|
+
maxDate?: Date;
|
|
32
|
+
/**
|
|
33
|
+
* Dias desabilitados — aceita qualquer `Matcher` do react-day-picker
|
|
34
|
+
* (Date, DateRange, DateBefore, DateAfter, DayOfWeek, função…).
|
|
35
|
+
*/
|
|
36
|
+
disabled?: Matcher | Matcher[];
|
|
37
|
+
/**
|
|
38
|
+
* Formato de exibição da data.
|
|
39
|
+
* @example 'dd/mm/yyyy' | 'mm/dd/yyyy'
|
|
40
|
+
*/
|
|
41
|
+
format?: DateFormat;
|
|
42
|
+
/**
|
|
43
|
+
* Locale da interface — aceita os códigos internos do design system.
|
|
44
|
+
* @default 'pt-br'
|
|
45
|
+
*/
|
|
46
|
+
locale?: Locale;
|
|
47
|
+
/** Atributo `aria-label` para o elemento raiz. */
|
|
48
|
+
'aria-label'?: string;
|
|
49
|
+
/** Foca automaticamente o primeiro dia selecionado ou hoje. */
|
|
50
|
+
autoFocus?: boolean;
|
|
51
|
+
/** Substitui os `classNames` padrão do react-day-picker. */
|
|
52
|
+
classNames?: Partial<Record<string, string>>;
|
|
53
|
+
}
|
|
54
|
+
export type CalendarProps = CalendarBaseProps;
|
|
55
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Locale, BaseProps,
|
|
1
|
+
import { Locale, BaseProps, Side, Align } from '../../types/common.types';
|
|
2
2
|
/**
|
|
3
3
|
* Props do componente DatePicker
|
|
4
4
|
* @example
|
|
@@ -17,7 +17,7 @@ import { Locale, BaseProps, Position } from '../../types/common.types';
|
|
|
17
17
|
* required
|
|
18
18
|
* helperText="Selecione a data de início do projeto"
|
|
19
19
|
* minDate={new Date()}
|
|
20
|
-
*
|
|
20
|
+
* calendarSide="right"
|
|
21
21
|
* error={errorMessage}
|
|
22
22
|
* />
|
|
23
23
|
* ```
|
|
@@ -26,7 +26,9 @@ export interface DatePickerProps extends BaseProps {
|
|
|
26
26
|
/** Locale para formatação da data */
|
|
27
27
|
locale?: Locale;
|
|
28
28
|
/** Posição do calendário em relação ao campo */
|
|
29
|
-
|
|
29
|
+
calendarSide?: Side;
|
|
30
|
+
/** Alinhamento do calendário em relação ao campo */
|
|
31
|
+
calendarAlign?: Exclude<Align, 'center'>;
|
|
30
32
|
/** Texto de ajuda exibido abaixo do campo */
|
|
31
33
|
helperText?: string;
|
|
32
34
|
/** Define se o campo é obrigatório */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Locale } from '../../../types/common.types';
|
|
2
|
+
export declare function formatDate(date: Date, locale?: Locale): string;
|
|
3
|
+
export declare function applyDateMask(value: string, locale?: Locale): string;
|
|
4
|
+
export declare function isValidDateFormat(value: string, locale?: Locale): boolean;
|
|
5
|
+
export declare function parseDate(dateString: string, locale?: Locale): Date | null;
|
|
6
|
+
export declare function validatePartialDate(value: string, locale?: Locale): 'valid' | 'invalid' | 'incomplete';
|
|
@@ -6,13 +6,12 @@ import { BaseProps } from '../../types/common.types';
|
|
|
6
6
|
* <Dialog
|
|
7
7
|
* title="Confirmar ação"
|
|
8
8
|
* bodyContent="Tem certeza que deseja continuar?"
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* textPrimaryAction="Confirmar"
|
|
10
|
+
* textSecondaryAction="Cancelar"
|
|
11
11
|
* />
|
|
12
12
|
*/
|
|
13
13
|
export interface DialogProps extends BaseProps, React.HTMLAttributes<HTMLDivElement> {
|
|
14
|
-
|
|
15
|
-
show: boolean;
|
|
14
|
+
show?: boolean;
|
|
16
15
|
/** Título exibido no cabeçalho do diálogo */
|
|
17
16
|
title?: string;
|
|
18
17
|
/** Texto ou conteúdo do corpo do diálogo */
|
|
@@ -32,6 +32,8 @@ import { Variant, BaseProps } from '../../types/common.types';
|
|
|
32
32
|
export interface DrawerProps extends BaseProps {
|
|
33
33
|
/** Conteúdo a ser exibido dentro do drawer */
|
|
34
34
|
children?: ReactNode;
|
|
35
|
+
/** Conteúdo customizado do cabeçalho */
|
|
36
|
+
headerContent?: ReactNode;
|
|
35
37
|
/** Largura customizada do drawer (ex: '400px', '50%') */
|
|
36
38
|
customWidth?: string;
|
|
37
39
|
/** Callback executado ao fechar o drawer: () => void */
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { ReactNode, ReactElement } from 'react';
|
|
2
|
-
import { Variant, BaseProps, Locale,
|
|
3
|
-
|
|
2
|
+
import { Variant, BaseProps, Locale, Side, Align } from '../../types/common.types';
|
|
3
|
+
export interface FilterItem {
|
|
4
|
+
id?: string;
|
|
5
|
+
text: string;
|
|
6
|
+
subText?: string;
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type FilterType = 'text' | 'checkbox' | 'icon' | 'calendar';
|
|
4
11
|
/**
|
|
5
12
|
* Props do componente Filter
|
|
6
13
|
* @example
|
|
@@ -27,9 +34,9 @@ import { DropdownItem, DropdownType } from '../Dropdown/Dropdown.types';
|
|
|
27
34
|
*/
|
|
28
35
|
export interface FilterProps extends BaseProps {
|
|
29
36
|
/** Array de itens para filtros do tipo dropdown */
|
|
30
|
-
items?:
|
|
37
|
+
items?: FilterItem[];
|
|
31
38
|
/** Tipo do filtro (dropdown ou calendário) */
|
|
32
|
-
type?:
|
|
39
|
+
type?: FilterType;
|
|
33
40
|
/** IDs dos itens selecionados */
|
|
34
41
|
selectedIds?: string[];
|
|
35
42
|
/** Callback executado ao aplicar filtro: (selectedIds) => void */
|
|
@@ -48,8 +55,10 @@ export interface FilterProps extends BaseProps {
|
|
|
48
55
|
onOpen?: () => void;
|
|
49
56
|
/** Callback executado ao fechar o filtro: () => void */
|
|
50
57
|
onClose?: () => void;
|
|
51
|
-
/** Posição do
|
|
52
|
-
|
|
58
|
+
/** Posição do popover em relação ao botão */
|
|
59
|
+
side?: Side;
|
|
60
|
+
/** Alinhamento do popover em relação ao botão */
|
|
61
|
+
align?: Exclude<Align, 'center'>;
|
|
53
62
|
/** Data selecionada (para tipo calendar) */
|
|
54
63
|
selectedDate?: Date | null;
|
|
55
64
|
/** Callback executado ao selecionar data: (date) => void */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Align, Side } from '../../types/common.types';
|
|
2
|
+
export interface PopoverProps {
|
|
3
|
+
trigger: React.ReactNode;
|
|
4
|
+
content: React.ReactNode;
|
|
5
|
+
align?: Align;
|
|
6
|
+
side?: Side;
|
|
7
|
+
/** Distância em pixels entre o conteúdo e o trigger */
|
|
8
|
+
sideOffset?: number;
|
|
9
|
+
/** Controla o estado de abertura em modo controlado */
|
|
10
|
+
open?: boolean;
|
|
11
|
+
/** Callback chamado quando o estado de abertura muda */
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
/**
|
|
14
|
+
* Quando `true`, o trigger atua como âncora de posicionamento e o popover
|
|
15
|
+
* é aberto/fechado exclusivamente via `open`/`onOpenChange` (modo DatePicker).
|
|
16
|
+
* Quando `false` (padrão), o trigger continua abrindo/fechando o popover
|
|
17
|
+
* normalmente, mas o estado pode ser sincronizado via `open`/`onOpenChange`
|
|
18
|
+
* (modo Filter).
|
|
19
|
+
*/
|
|
20
|
+
asAnchor?: boolean;
|
|
21
|
+
/** Callback chamado quando o foco automático é ativado ao abrir o popover */
|
|
22
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
23
|
+
/** Callback chamado quando o foco automático é ativado ao fechar o popover */
|
|
24
|
+
onCloseAutoFocus?: (event: Event) => void;
|
|
25
|
+
}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Side, Align } from '../../types/common.types';
|
|
3
|
+
import type { FilterItem as FilterListItem } from '../Filter';
|
|
3
4
|
interface BaseFilterItem {
|
|
4
5
|
id?: string;
|
|
5
6
|
buttonText: string | React.ReactNode;
|
|
6
7
|
icon?: React.ReactElement;
|
|
7
|
-
|
|
8
|
+
side?: Side;
|
|
9
|
+
align?: Exclude<Align, 'center'>;
|
|
8
10
|
disabled?: boolean;
|
|
9
11
|
onToggle?: (isOpen: boolean) => void;
|
|
10
12
|
tooltip?: string;
|
|
11
13
|
}
|
|
12
14
|
interface CheckboxFilterItem extends BaseFilterItem {
|
|
13
15
|
type: 'checkbox' | 'text' | 'icon';
|
|
14
|
-
items:
|
|
16
|
+
items: FilterListItem[];
|
|
15
17
|
selectedIds?: string[];
|
|
16
18
|
onSelectionChange?: (selectedIds: string[]) => void;
|
|
17
19
|
placeholder?: string;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Side, Align } from '../../types/common.types';
|
|
3
|
+
/**
|
|
4
|
+
* Props do componente TextArea
|
|
5
|
+
* @example
|
|
6
|
+
* ```tsx
|
|
7
|
+
* <TextArea
|
|
8
|
+
* label="Descrição"
|
|
9
|
+
* value={description}
|
|
10
|
+
* onChange={setDescription}
|
|
11
|
+
* placeholder="Digite uma descrição"
|
|
12
|
+
* />
|
|
13
|
+
* ```
|
|
14
|
+
* @example
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <TextArea
|
|
17
|
+
* label="Comentário"
|
|
18
|
+
* required
|
|
19
|
+
* maxLength={500}
|
|
20
|
+
* showCharCount
|
|
21
|
+
* helperText="Máximo de 500 caracteres"
|
|
22
|
+
* errorMessage={error}
|
|
23
|
+
* />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export interface TextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'onChange' | 'value'> {
|
|
27
|
+
/** Valor controlado do campo */
|
|
28
|
+
value?: string;
|
|
29
|
+
/** Callback executado quando o valor muda: (value) => void */
|
|
30
|
+
onChange?: (value: string) => void;
|
|
31
|
+
/** Label do campo */
|
|
32
|
+
label?: string;
|
|
33
|
+
/** Texto de ajuda exibido abaixo do campo */
|
|
34
|
+
helperText?: string;
|
|
35
|
+
/** Habilita tooltip */
|
|
36
|
+
tooltip?: boolean;
|
|
37
|
+
/** Texto do tooltip */
|
|
38
|
+
tooltipText?: string;
|
|
39
|
+
/** Lado onde o tooltip aparece */
|
|
40
|
+
side?: Side;
|
|
41
|
+
/** Alinhamento do tooltip */
|
|
42
|
+
align?: Align;
|
|
43
|
+
/**
|
|
44
|
+
* Mensagem de erro exibida no campo.
|
|
45
|
+
* Usada tanto pela validação interna (required, etc.)
|
|
46
|
+
* quanto pelo controle externo via formulários (react-hook-form, formik, etc.)
|
|
47
|
+
*/
|
|
48
|
+
errorMessage?: string;
|
|
49
|
+
/** Sinaliza erro externo para controle via formulários (react-hook-form, formik, etc.) */
|
|
50
|
+
error?: boolean;
|
|
51
|
+
/** Controla o redimensionamento do textarea */
|
|
52
|
+
resize?: 'none' | 'vertical' | 'both';
|
|
53
|
+
/** Exibe contador de caracteres (requer maxLength) */
|
|
54
|
+
showCharCount?: boolean;
|
|
55
|
+
height?: number;
|
|
56
|
+
}
|
|
@@ -47,10 +47,18 @@ export interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInput
|
|
|
47
47
|
side?: Side;
|
|
48
48
|
/** Alinhamento do tooltip */
|
|
49
49
|
align?: Align;
|
|
50
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Mensagem de erro exibida no campo.
|
|
52
|
+
* Usada tanto pela validação interna (required, formato, etc.)
|
|
53
|
+
* quanto pelo controle externo via formulários (react-hook-form, formik, etc.)
|
|
54
|
+
*/
|
|
51
55
|
errorMessage?: string;
|
|
56
|
+
/** Sinaliza erro externo para controle via formulários (react-hook-form, formik, etc.) */
|
|
57
|
+
error?: boolean;
|
|
52
58
|
/** Ícone a ser exibido no campo */
|
|
53
59
|
icon?: React.ReactNode;
|
|
60
|
+
/** Mantém o ícone visível mesmo quando o campo tem valor */
|
|
61
|
+
persistIcon?: boolean;
|
|
54
62
|
}
|
|
55
63
|
/**
|
|
56
64
|
* Parâmetros para validação do TextField
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -20,8 +20,6 @@ export { default as Dialog } from './Dialog';
|
|
|
20
20
|
export { type DialogProps } from './Dialog/Dialog.types';
|
|
21
21
|
export { default as Drawer } from './Drawer';
|
|
22
22
|
export { type DrawerProps } from './Drawer/Drawer.types';
|
|
23
|
-
export { default as Dropdown } from './Dropdown';
|
|
24
|
-
export { type DropdownProps, type DropdownItem, type DropdownType } from './Dropdown/Dropdown.types';
|
|
25
23
|
export { default as Filter } from './Filter';
|
|
26
24
|
export { type FilterProps } from './Filter/Filter.types';
|
|
27
25
|
export { default as ListItem } from './ListItem';
|
|
@@ -44,6 +42,8 @@ export { default as TablePagination } from './Table/TablePagination';
|
|
|
44
42
|
export { type TableProps } from './Table/Table.types';
|
|
45
43
|
export { type TablePaginationProps } from './Table/TablePagination';
|
|
46
44
|
export { type TableHeaderProps, type FilterItem } from './Table/TableHeader';
|
|
45
|
+
export { default as TextArea } from './TextArea';
|
|
46
|
+
export { type TextAreaProps } from './TextArea/TextArea.types';
|
|
47
47
|
export { default as TextField } from './TextField';
|
|
48
48
|
export { type TextFieldProps } from './TextField/TextField.types';
|
|
49
49
|
export { Toast, ToastProvider, ToastContainer, useToast } from './Toast';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components';
|