@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
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Incrementer.css';
|
|
3
|
+
export interface IncrementerProps {
|
|
4
|
+
/** Current value (controlled) */
|
|
5
|
+
value: number;
|
|
6
|
+
/** Callback fired when incrementing or decrementing — receives the new value */
|
|
7
|
+
onChange: (value: number) => void;
|
|
8
|
+
/** Minimum allowed value — decrement button disables when reached */
|
|
9
|
+
min?: number;
|
|
10
|
+
/** Maximum allowed value — increment button disables when reached */
|
|
11
|
+
max?: number;
|
|
12
|
+
/** Step size for each increment/decrement. Default: 1 */
|
|
13
|
+
step?: number;
|
|
14
|
+
/** Disables both buttons */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Additional CSS classes */
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const Incrementer: React.FC<IncrementerProps>;
|
|
20
|
+
export default Incrementer;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconElement } from '../Icon/Icon';
|
|
3
|
+
import './Input.css';
|
|
4
|
+
import '../../foundations/Scrollbar/Scrollbar.css';
|
|
5
|
+
import type { FormValidateOn } from '../Form/Form';
|
|
6
|
+
export interface InputRule {
|
|
7
|
+
/** Message shown as a hint when the rule fails */
|
|
8
|
+
message: string;
|
|
9
|
+
/** Receives the current value and returns true when the rule passes */
|
|
10
|
+
valid: (value: string) => boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface PhoneCountry {
|
|
13
|
+
code: string;
|
|
14
|
+
ddi: string;
|
|
15
|
+
name: string;
|
|
16
|
+
}
|
|
17
|
+
export type InputFeedback = 'none' | 'success' | 'alert' | 'error';
|
|
18
|
+
export type InputState = 'enabled' | 'hover' | 'filled' | 'focused' | 'disabled';
|
|
19
|
+
type BaseInputProps = {
|
|
20
|
+
/**
|
|
21
|
+
* Field's floating label.
|
|
22
|
+
* Automatic default: "Email" for type="email", "Phone" for type="tel" with phoneInternational.
|
|
23
|
+
*/
|
|
24
|
+
label: string;
|
|
25
|
+
value?: string;
|
|
26
|
+
defaultValue?: string;
|
|
27
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
28
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
29
|
+
/** Number of visible lines — textbox type only. Default: 3 */
|
|
30
|
+
rows?: number;
|
|
31
|
+
/** Visual feedback — when 'none' (default), internal validations may override */
|
|
32
|
+
feedback?: InputFeedback;
|
|
33
|
+
/** Hint message below the input — when absent, internal validation errors show their own message */
|
|
34
|
+
hint?: string;
|
|
35
|
+
/** Left icon (ignored for type="email") */
|
|
36
|
+
iconLeft?: IconElement;
|
|
37
|
+
/** Right icon */
|
|
38
|
+
iconRight?: IconElement;
|
|
39
|
+
/** Callback when clicking iconRight — makes the icon interactive with stopPropagation */
|
|
40
|
+
onClickIconRight?: () => void;
|
|
41
|
+
/** Count badge shown before the right icon (used as a Popover Trigger) */
|
|
42
|
+
notificationCount?: number;
|
|
43
|
+
/** Shows a custom incrementer (+/−) for type="number". The browser's native spinner is always hidden via CSS. */
|
|
44
|
+
showIncrementer?: boolean;
|
|
45
|
+
/** Minimum value (type="number") */
|
|
46
|
+
min?: number;
|
|
47
|
+
/** Maximum value (type="number") */
|
|
48
|
+
max?: number;
|
|
49
|
+
/** Increment step (type="number", default: 1) */
|
|
50
|
+
step?: number;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
/** Shows a spinner in place of iconRight and blocks interaction — use while data is loading */
|
|
53
|
+
isLoading?: boolean;
|
|
54
|
+
/** Required field — exposes aria-required to screen readers */
|
|
55
|
+
required?: boolean;
|
|
56
|
+
placeholder?: string;
|
|
57
|
+
autoFocus?: boolean;
|
|
58
|
+
id?: string;
|
|
59
|
+
name?: string;
|
|
60
|
+
autoComplete?: string;
|
|
61
|
+
readOnly?: boolean;
|
|
62
|
+
tabIndex?: number;
|
|
63
|
+
pattern?: string;
|
|
64
|
+
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
65
|
+
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
66
|
+
/** Validation rules — each rule shows its message as a hint when valid(value) returns false */
|
|
67
|
+
rules?: InputRule[];
|
|
68
|
+
/** When to evaluate the rules. Inherited from the parent Form via context; 'change' when there's no Form */
|
|
69
|
+
validateOn?: FormValidateOn;
|
|
70
|
+
/** Width: 'hug' = fits content | 'fill' = 100% */
|
|
71
|
+
width?: 'hug' | 'fill';
|
|
72
|
+
className?: string;
|
|
73
|
+
/** Enables the country selector for type="tel" */
|
|
74
|
+
phoneInternational?: boolean;
|
|
75
|
+
/** Initial country in the selector (ISO alpha-2, e.g. 'us'). Default: 'br' */
|
|
76
|
+
defaultCountry?: string;
|
|
77
|
+
/** Shows only these countries in the selector (ISO alpha-2) */
|
|
78
|
+
onlyCountries?: string[];
|
|
79
|
+
/** Excludes these countries from the selector (ISO alpha-2) */
|
|
80
|
+
excludeCountries?: string[];
|
|
81
|
+
/** Called when the user selects a country */
|
|
82
|
+
onCountryChange?: (country: PhoneCountry) => void;
|
|
83
|
+
/** Disables algorithm validation for type='cpf', 'cnpj', 'cpf-cnpj'. When false, only validates whether the mask is complete */
|
|
84
|
+
validateDocument?: boolean;
|
|
85
|
+
};
|
|
86
|
+
/** type="text" | "search" | "textbox" — support maxLength, minLength and showCount */
|
|
87
|
+
type TextualInputProps = BaseInputProps & {
|
|
88
|
+
type?: 'text' | 'search' | 'textbox';
|
|
89
|
+
/** Maximum character limit. Blocks input and shows a hint when the limit is reached. */
|
|
90
|
+
maxLength?: number;
|
|
91
|
+
minLength?: number;
|
|
92
|
+
/** Shows a character counter below the input on the right — requires maxLength */
|
|
93
|
+
showCount?: boolean;
|
|
94
|
+
};
|
|
95
|
+
/** type="email" — optional label (default "Email"), supports maxLength, minLength and showCount */
|
|
96
|
+
type EmailInputProps = Omit<BaseInputProps, 'label'> & {
|
|
97
|
+
type: 'email';
|
|
98
|
+
label?: string;
|
|
99
|
+
maxLength?: number;
|
|
100
|
+
minLength?: number;
|
|
101
|
+
showCount?: boolean;
|
|
102
|
+
};
|
|
103
|
+
/** type="password" — optional label (default "Password"), supports maxLength and minLength, but not showCount */
|
|
104
|
+
type PasswordInputProps = Omit<BaseInputProps, 'label'> & {
|
|
105
|
+
type: 'password';
|
|
106
|
+
label?: string;
|
|
107
|
+
maxLength?: number;
|
|
108
|
+
minLength?: number;
|
|
109
|
+
showCount?: never;
|
|
110
|
+
};
|
|
111
|
+
/** type="number" — doesn't support maxLength, minLength, or showCount */
|
|
112
|
+
type RestrictedInputProps = BaseInputProps & {
|
|
113
|
+
type: 'number';
|
|
114
|
+
maxLength?: never;
|
|
115
|
+
minLength?: never;
|
|
116
|
+
showCount?: never;
|
|
117
|
+
};
|
|
118
|
+
/** type="date" — dd/mm/yyyy mask, optional label (default "Date"), doesn't accept maxLength/minLength/showCount */
|
|
119
|
+
type DateInputProps = Omit<BaseInputProps, 'label'> & {
|
|
120
|
+
type: 'date';
|
|
121
|
+
label?: string;
|
|
122
|
+
maxLength?: never;
|
|
123
|
+
minLength?: never;
|
|
124
|
+
showCount?: never;
|
|
125
|
+
};
|
|
126
|
+
/** type="tel" | "cel" | "cep" | "cpf" | "cnpj" | "cpf-cnpj" | "birthdate" — optional label (default per type), doesn't accept maxLength/minLength/showCount */
|
|
127
|
+
type FixedLabelDocInputProps = Omit<BaseInputProps, 'label'> & {
|
|
128
|
+
type: 'tel' | 'cel' | 'cep' | 'cpf' | 'cnpj' | 'cpf-cnpj' | 'birthdate';
|
|
129
|
+
label?: string;
|
|
130
|
+
maxLength?: never;
|
|
131
|
+
minLength?: never;
|
|
132
|
+
showCount?: never;
|
|
133
|
+
};
|
|
134
|
+
export type InputProps = TextualInputProps | EmailInputProps | PasswordInputProps | RestrictedInputProps | DateInputProps | FixedLabelDocInputProps;
|
|
135
|
+
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
136
|
+
export default Input;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './KenloLogo.css';
|
|
3
|
+
export type KenloLogoProduct = 'imob' | 'sites' | 'locacao' | 'leads' | 'base';
|
|
4
|
+
export type KenloLogoVariant = 'primary' | 'neutral';
|
|
5
|
+
export type KenloLogoSize = 16 | 20 | 24 | 32 | 40;
|
|
6
|
+
export interface KenloLogoProps {
|
|
7
|
+
product?: KenloLogoProduct;
|
|
8
|
+
variant?: KenloLogoVariant;
|
|
9
|
+
size?: KenloLogoSize;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const KenloLogo: React.FC<KenloLogoProps>;
|
|
13
|
+
export default KenloLogo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './LyaLogo.css';
|
|
3
|
+
export type LyaLogoVariant = 'full' | 'symbol';
|
|
4
|
+
export type LyaLogoSize = 16 | 20 | 24 | 32 | 40;
|
|
5
|
+
export interface LyaLogoProps {
|
|
6
|
+
variant?: LyaLogoVariant;
|
|
7
|
+
size?: LyaLogoSize;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const LyaLogo: React.FC<LyaLogoProps>;
|
|
11
|
+
export default LyaLogo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipPosition } from '../Tooltip';
|
|
3
|
+
import { IconButtonSize } from '../IconButton/IconButton';
|
|
4
|
+
import { IconElement } from '../Icon/Icon';
|
|
5
|
+
import './Menu.css';
|
|
6
|
+
import '../../foundations/Scrollbar/Scrollbar.css';
|
|
7
|
+
export type MenuPlacement = 'bottom' | 'bottomLeft' | 'bottomRight';
|
|
8
|
+
export type MenuItemKey = string | number;
|
|
9
|
+
export type MenuItemIntent = 'primary' | 'neutral' | 'error' | 'success' | 'alert';
|
|
10
|
+
/** Definition object used in the items array API */
|
|
11
|
+
export interface MenuItemDef {
|
|
12
|
+
/** Unique identity of the entry — used as the React key */
|
|
13
|
+
key: MenuItemKey;
|
|
14
|
+
/** Item label, or the group header when type = 'section' */
|
|
15
|
+
label?: React.ReactNode;
|
|
16
|
+
/** Left icon of the row */
|
|
17
|
+
icon?: IconElement;
|
|
18
|
+
/** Semantic tone of the row — paints hover/active with the matching feedback color */
|
|
19
|
+
intent?: MenuItemIntent;
|
|
20
|
+
/** Child items — renders as SubMenu */
|
|
21
|
+
children?: MenuItemDef[];
|
|
22
|
+
/** 'section': starts a named group | 'divider': horizontal separator */
|
|
23
|
+
type?: 'divider' | 'section';
|
|
24
|
+
/** Action fired on click */
|
|
25
|
+
onClick?: () => void;
|
|
26
|
+
/** Blocks click and dims the row */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
}
|
|
29
|
+
interface MenuCommonProps {
|
|
30
|
+
/** Panel content — Menu.Group, Menu.Item, Menu.SubMenu, Menu.Search, Menu.Separator and Menu.Empty */
|
|
31
|
+
children?: React.ReactNode;
|
|
32
|
+
/** Where the panel opens relative to the trigger — flips upward when there is no room below */
|
|
33
|
+
placement?: MenuPlacement;
|
|
34
|
+
/** Array API, alternative to the compound children — use for dynamic lists */
|
|
35
|
+
items?: MenuItemDef[];
|
|
36
|
+
/** Free slot pinned above the items — for fully custom headers */
|
|
37
|
+
header?: React.ReactNode;
|
|
38
|
+
/** Free slot pinned below the items — stays visible while the list scrolls */
|
|
39
|
+
footer?: React.ReactNode;
|
|
40
|
+
/** Name on the first line of the profile header — passing it renders the whole header */
|
|
41
|
+
name?: string;
|
|
42
|
+
/** Code on the second line of the profile header */
|
|
43
|
+
code?: string;
|
|
44
|
+
/** Agency on the third line of the profile header, prefixed with 'Imobiliária' */
|
|
45
|
+
agency?: string;
|
|
46
|
+
/** Overrides the panel z-index — raise it when the trigger lives inside a sticky header or modal */
|
|
47
|
+
zIndex?: number;
|
|
48
|
+
/** Extra CSS class on the Menu wrapper */
|
|
49
|
+
className?: string;
|
|
50
|
+
}
|
|
51
|
+
/** variant branch — trigger and variant are mutually exclusive */
|
|
52
|
+
interface MenuVariantBranch extends MenuCommonProps {
|
|
53
|
+
/** Label for navButton / pill trigger */
|
|
54
|
+
label?: string;
|
|
55
|
+
/** Built-in trigger type — 'avatar' and 'iconButton' render through their own dedicated props */
|
|
56
|
+
variant?: 'navButton' | 'pill' | 'avatar' | 'iconButton';
|
|
57
|
+
trigger?: never;
|
|
58
|
+
/** Left icon for navButton / pill trigger */
|
|
59
|
+
icon?: IconElement;
|
|
60
|
+
/** variant="avatar" — initials shown in placeholder */
|
|
61
|
+
initials?: string;
|
|
62
|
+
/** variant="avatar" — image source */
|
|
63
|
+
src?: string;
|
|
64
|
+
/** variant="avatar" — avatar size ('sm' 40px · 'md' 48px · 'lg' 56px) */
|
|
65
|
+
avatarSize?: 'sm' | 'md' | 'lg';
|
|
66
|
+
/** variant="iconButton" — the icon to display */
|
|
67
|
+
buttonIcon?: IconElement;
|
|
68
|
+
/** variant="iconButton" — color variant (default 'primary') */
|
|
69
|
+
iconVariant?: 'neutral' | 'primary';
|
|
70
|
+
/** variant="iconButton" — button size (default 'sm') */
|
|
71
|
+
iconSize?: IconButtonSize;
|
|
72
|
+
/** variant="iconButton" — accessible label */
|
|
73
|
+
'aria-label'?: string;
|
|
74
|
+
/** Marks the built-in navButton / pill trigger as active — bold label and reinforced color */
|
|
75
|
+
triggerActive?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/** custom trigger branch — trigger and variant are mutually exclusive */
|
|
78
|
+
interface MenuCustomBranch extends MenuCommonProps {
|
|
79
|
+
/** Custom element used as the trigger — Menu injects onClick, onKeyDown and aria-* via cloneElement */
|
|
80
|
+
trigger: React.ReactElement;
|
|
81
|
+
variant?: never;
|
|
82
|
+
}
|
|
83
|
+
export type MenuProps = MenuVariantBranch | MenuCustomBranch;
|
|
84
|
+
export interface MenuGroupProps {
|
|
85
|
+
/** Group header text */
|
|
86
|
+
label: string;
|
|
87
|
+
/** Menu items inside the group */
|
|
88
|
+
children: React.ReactNode;
|
|
89
|
+
/** Extra CSS class on the group element */
|
|
90
|
+
className?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface MenuItemProps {
|
|
93
|
+
/** Row label */
|
|
94
|
+
children?: React.ReactNode;
|
|
95
|
+
/** Semantic tone — paints hover/active with the matching feedback color */
|
|
96
|
+
intent?: MenuItemIntent;
|
|
97
|
+
/** Left icon of the row */
|
|
98
|
+
icon?: IconElement;
|
|
99
|
+
/** Badge label shown at the right of the row */
|
|
100
|
+
badge?: string;
|
|
101
|
+
/** Navigation route — renders the row as an <a>. Can coexist with onClick */
|
|
102
|
+
href?: string;
|
|
103
|
+
/** Opens the href in a new tab — only meaningful together with href */
|
|
104
|
+
targetBlank?: boolean;
|
|
105
|
+
/** Tooltip content — without tooltipIcon it opens from the label itself */
|
|
106
|
+
tooltip?: string;
|
|
107
|
+
/** Shows the tooltip via the default (fixed) info icon instead of the label. */
|
|
108
|
+
tooltipIcon?: boolean;
|
|
109
|
+
/** Side the tooltip opens on */
|
|
110
|
+
tooltipPosition?: TooltipPosition;
|
|
111
|
+
/** Action fired on click or keyboard activation — the panel closes right after */
|
|
112
|
+
onClick?: () => void;
|
|
113
|
+
/** Marks the row as the selected one — use it to mirror navigation state */
|
|
114
|
+
active?: boolean;
|
|
115
|
+
/** Blocks click and keyboard activation and dims the row */
|
|
116
|
+
disabled?: boolean;
|
|
117
|
+
/** Extra CSS class on the row element */
|
|
118
|
+
className?: string;
|
|
119
|
+
}
|
|
120
|
+
export type MenuSubMenuItemProps = MenuItemProps;
|
|
121
|
+
export interface MenuSubMenuProps {
|
|
122
|
+
/** Trigger row label */
|
|
123
|
+
label: React.ReactNode;
|
|
124
|
+
/** Submenu content — use Menu.SubMenu.Item */
|
|
125
|
+
children: React.ReactNode;
|
|
126
|
+
/** Left icon of the trigger row */
|
|
127
|
+
icon?: IconElement;
|
|
128
|
+
/** Expands as an accordion inside the panel instead of opening a floating fly-out */
|
|
129
|
+
accordion?: boolean;
|
|
130
|
+
/** Blocks opening and dims the trigger row */
|
|
131
|
+
disabled?: boolean;
|
|
132
|
+
/** Extra CSS class on the submenu element */
|
|
133
|
+
className?: string;
|
|
134
|
+
}
|
|
135
|
+
export interface MenuSeparatorProps {
|
|
136
|
+
/** Extra CSS class on the separator element */
|
|
137
|
+
className?: string;
|
|
138
|
+
}
|
|
139
|
+
export interface MenuEmptyProps {
|
|
140
|
+
/** Empty-state message — the consumer owns the text, for translation */
|
|
141
|
+
children: React.ReactNode;
|
|
142
|
+
/** Extra CSS class on the empty-state element */
|
|
143
|
+
className?: string;
|
|
144
|
+
}
|
|
145
|
+
export interface MenuSearchProps {
|
|
146
|
+
/** Current value of the search field — the Menu never filters on its own */
|
|
147
|
+
value: string;
|
|
148
|
+
/** Fired on every keystroke — filter the items yourself with the value received */
|
|
149
|
+
onChange: (value: string) => void;
|
|
150
|
+
/** Floating label of the search field */
|
|
151
|
+
label?: string;
|
|
152
|
+
}
|
|
153
|
+
declare const MenuGroup: React.FC<MenuGroupProps>;
|
|
154
|
+
declare const MenuItem: React.FC<MenuItemProps>;
|
|
155
|
+
declare const MenuSubMenuItem: React.FC<MenuSubMenuItemProps>;
|
|
156
|
+
declare const MenuSeparator: React.FC<MenuSeparatorProps>;
|
|
157
|
+
declare const MenuEmpty: React.FC<MenuEmptyProps>;
|
|
158
|
+
declare const MenuSearch: React.FC<MenuSearchProps>;
|
|
159
|
+
type MenuSubMenuType = React.FC<MenuSubMenuProps> & {
|
|
160
|
+
Item: typeof MenuSubMenuItem;
|
|
161
|
+
};
|
|
162
|
+
type MenuComposition = React.FC<MenuProps> & {
|
|
163
|
+
Group: typeof MenuGroup;
|
|
164
|
+
Item: typeof MenuItem;
|
|
165
|
+
SubMenu: MenuSubMenuType;
|
|
166
|
+
Separator: typeof MenuSeparator;
|
|
167
|
+
Empty: typeof MenuEmpty;
|
|
168
|
+
Search: typeof MenuSearch;
|
|
169
|
+
};
|
|
170
|
+
export declare const Menu: MenuComposition;
|
|
171
|
+
export default Menu;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Menu';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TooltipPosition } from '../Tooltip';
|
|
3
|
+
import './Modal.css';
|
|
4
|
+
import '../../foundations/Scrollbar/Scrollbar.css';
|
|
5
|
+
export interface ModalProps {
|
|
6
|
+
/** Controls visibility */
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
/** Called when overlay or close button is clicked */
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
/** Modal title (SemiBold 20px) */
|
|
11
|
+
title: string;
|
|
12
|
+
/** Tooltip text shown on hover of the info icon (ⓘ) beside the title */
|
|
13
|
+
titleTooltip?: string;
|
|
14
|
+
/** Position of the title tooltip — default 'top' */
|
|
15
|
+
titleTooltipPosition?: TooltipPosition;
|
|
16
|
+
/** Modal body content */
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
/** Custom footer — overrides built-in footer buttons */
|
|
19
|
+
footer?: React.ReactNode;
|
|
20
|
+
/** Tertiary (link) action label */
|
|
21
|
+
tertiaryLabel?: string;
|
|
22
|
+
onTertiary?: () => void | Promise<void>;
|
|
23
|
+
tertiaryLoading?: boolean;
|
|
24
|
+
tertiaryDisabled?: boolean;
|
|
25
|
+
tertiaryDisabledTooltip?: string;
|
|
26
|
+
tertiaryDisabledTooltipPosition?: TooltipPosition;
|
|
27
|
+
/** Secondary (outlined) action label */
|
|
28
|
+
secondaryLabel?: string;
|
|
29
|
+
onSecondary?: () => void | Promise<void>;
|
|
30
|
+
secondaryLoading?: boolean;
|
|
31
|
+
secondaryDisabled?: boolean;
|
|
32
|
+
secondaryDisabledTooltip?: string;
|
|
33
|
+
secondaryDisabledTooltipPosition?: TooltipPosition;
|
|
34
|
+
/** Primary (filled) action label */
|
|
35
|
+
primaryLabel?: string;
|
|
36
|
+
onPrimary?: () => void | Promise<void>;
|
|
37
|
+
/** Shows a loading spinner on the primary button. Also activated automatically when onPrimary returns a Promise */
|
|
38
|
+
primaryLoading?: boolean;
|
|
39
|
+
primaryDisabled?: boolean;
|
|
40
|
+
primaryDisabledTooltip?: string;
|
|
41
|
+
primaryDisabledTooltipPosition?: TooltipPosition;
|
|
42
|
+
/** Extra className on the container */
|
|
43
|
+
className?: string;
|
|
44
|
+
/** Prevent closing when clicking the overlay background */
|
|
45
|
+
disableOverlayClose?: boolean;
|
|
46
|
+
/** z-index override for the overlay */
|
|
47
|
+
zIndex?: number;
|
|
48
|
+
/** Show a confirmation dialog before closing */
|
|
49
|
+
confirmClose?: boolean;
|
|
50
|
+
/** Confirmation dialog title */
|
|
51
|
+
confirmTitle?: string;
|
|
52
|
+
/** Confirmation dialog body message */
|
|
53
|
+
confirmMessage?: string;
|
|
54
|
+
/** Confirmation dialog confirm button label */
|
|
55
|
+
confirmActionLabel?: string;
|
|
56
|
+
/** Confirmation dialog cancel button label */
|
|
57
|
+
confirmCancelLabel?: string;
|
|
58
|
+
/** aria-label for the close button */
|
|
59
|
+
closeLabel?: string;
|
|
60
|
+
}
|
|
61
|
+
export interface ModalConfirmOptions {
|
|
62
|
+
/** Dialog title */
|
|
63
|
+
title: string;
|
|
64
|
+
/** Dialog body content */
|
|
65
|
+
content?: React.ReactNode;
|
|
66
|
+
/** Primary button label (default 'Confirmar') */
|
|
67
|
+
primaryLabel?: string;
|
|
68
|
+
/** Called when primary button is clicked — returning a Promise activates the spinner automatically */
|
|
69
|
+
onPrimary?: () => void | Promise<void>;
|
|
70
|
+
/** Shows a loading spinner on the primary button. Also activated automatically when onPrimary returns a Promise */
|
|
71
|
+
primaryLoading?: boolean;
|
|
72
|
+
/** Secondary button label (default 'Cancelar') */
|
|
73
|
+
secondaryLabel?: string;
|
|
74
|
+
/** Called when secondary button or close is triggered */
|
|
75
|
+
onSecondary?: () => void;
|
|
76
|
+
}
|
|
77
|
+
type ModalComposition = React.FC<ModalProps> & {
|
|
78
|
+
confirm: (options: ModalConfirmOptions) => void;
|
|
79
|
+
};
|
|
80
|
+
export declare const Modal: ModalComposition;
|
|
81
|
+
export default Modal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { MenuItemIntent } from '../Menu/Menu';
|
|
3
|
+
import { TooltipPosition } from '../Tooltip';
|
|
4
|
+
import './Nav.css';
|
|
5
|
+
export interface NavCtx {
|
|
6
|
+
orientation: 'horizontal' | 'vertical';
|
|
7
|
+
}
|
|
8
|
+
export declare const NavContext: React.Context<NavCtx | null>;
|
|
9
|
+
export interface NavProps {
|
|
10
|
+
orientation?: 'horizontal' | 'vertical';
|
|
11
|
+
header?: React.ReactNode;
|
|
12
|
+
footer?: React.ReactNode;
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface NavItemProps {
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
active?: boolean;
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
intent?: MenuItemIntent;
|
|
21
|
+
href?: string;
|
|
22
|
+
targetBlank?: boolean;
|
|
23
|
+
icon?: React.ReactNode;
|
|
24
|
+
badge?: string;
|
|
25
|
+
tooltip?: string;
|
|
26
|
+
/** Shows the tooltip via the default (fixed) info icon instead of the label. */
|
|
27
|
+
tooltipIcon?: boolean;
|
|
28
|
+
tooltipPosition?: TooltipPosition;
|
|
29
|
+
onClick?: () => void;
|
|
30
|
+
className?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface NavSeparatorProps {
|
|
33
|
+
className?: string;
|
|
34
|
+
}
|
|
35
|
+
declare const NavItem: React.FC<NavItemProps>;
|
|
36
|
+
declare const NavSeparator: React.FC<NavSeparatorProps>;
|
|
37
|
+
type NavComposition = React.FC<NavProps> & {
|
|
38
|
+
Item: typeof NavItem;
|
|
39
|
+
Separator: typeof NavSeparator;
|
|
40
|
+
};
|
|
41
|
+
export declare const Nav: NavComposition;
|
|
42
|
+
export default Nav;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Nav';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Notification.css';
|
|
3
|
+
export type NotificationSize = 8 | 16 | 20 | 24;
|
|
4
|
+
export type NotificationVariant = 'primary' | 'neutral' | 'error' | 'alert' | 'success';
|
|
5
|
+
export type NotificationShape = 'circle' | 'square';
|
|
6
|
+
export interface NotificationProps {
|
|
7
|
+
/** Badge size */
|
|
8
|
+
size?: NotificationSize;
|
|
9
|
+
/** Color variant: primary · neutral · error · alert · success */
|
|
10
|
+
variant?: NotificationVariant;
|
|
11
|
+
/** circle = always circular (default) · square = proportional fixed corners: 16→4px · 20→6px · 24→8px */
|
|
12
|
+
shape?: NotificationShape;
|
|
13
|
+
/** Number to display (size 16 and 20). Omit at size 8 */
|
|
14
|
+
count?: number;
|
|
15
|
+
/** Maximum displayed value (e.g. +99) */
|
|
16
|
+
max?: number;
|
|
17
|
+
/** Always shows the + prefix before the number (e.g. +2, +5) */
|
|
18
|
+
showPlus?: boolean;
|
|
19
|
+
/** Shows the badge when count === 0. When false (default), the badge disappears at zero */
|
|
20
|
+
showZero?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const Notification: React.FC<NotificationProps>;
|
|
24
|
+
export default Notification;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './Pagination.css';
|
|
3
|
+
export interface PaginationProps {
|
|
4
|
+
/** Active page (starts at 1) */
|
|
5
|
+
currentPage: number;
|
|
6
|
+
/** Total items — the component computes the number of pages internally */
|
|
7
|
+
totalItems: number;
|
|
8
|
+
/** Fired when navigating or changing pageSize — receives (page, pageSize). When pageSize changes, page is always 1 */
|
|
9
|
+
onChange: (page: number, pageSize: number) => void;
|
|
10
|
+
/** Number of pages shown around the current one before the ellipsis (default 2) */
|
|
11
|
+
siblingCount?: 1 | 2 | 3;
|
|
12
|
+
/** Items per page (controlled). `500` is @internal — only used by the portal's icon catalog
|
|
13
|
+
* to paginate a catalog of thousands of items; it never appears in the items-per-page selector
|
|
14
|
+
* (showSizeChanger), which stays fixed at 10/20/50, the only values in the public API. */
|
|
15
|
+
pageSize?: 10 | 20 | 50 | 500;
|
|
16
|
+
/** Shows the items-per-page selector */
|
|
17
|
+
showSizeChanger?: boolean;
|
|
18
|
+
/** Disables all navigation */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Hides the component when there's only one page */
|
|
21
|
+
hideOnSinglePage?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const Pagination: React.FC<PaginationProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Pagination';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconElement } from '../Icon/Icon';
|
|
3
|
+
import './Pill.css';
|
|
4
|
+
interface PillBase {
|
|
5
|
+
/** Active/selected state — maps to aria-pressed. Marked as required in the props table — mandatory in every public use together with onClick. Optional in the type to allow internal usage (Select, DatePicker) */
|
|
6
|
+
active?: boolean;
|
|
7
|
+
/** Callback fired when clicking the Pill. Marked as required in the props table — mandatory in every public use together with active. Optional in the type to allow internal usage (Select, DatePicker) */
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
/** Icon to the right of the label */
|
|
10
|
+
iconRight?: IconElement;
|
|
11
|
+
/** Width: 'hug' = fits content | 'fill' = 100% */
|
|
12
|
+
width?: 'hug' | 'fill';
|
|
13
|
+
/** @internal Callback fired when clicking iconRight — prevents propagation to onClick */
|
|
14
|
+
onClickIconRight?: () => void;
|
|
15
|
+
/** @internal Shows a notification badge (size 24px) */
|
|
16
|
+
showNotification?: boolean;
|
|
17
|
+
/** @internal Number shown in the notification badge (requires showNotification=true) */
|
|
18
|
+
notificationCount?: number;
|
|
19
|
+
/** @internal Shows a spinner in place of the right-side icons and blocks interaction — use while data is loading */
|
|
20
|
+
isLoading?: boolean;
|
|
21
|
+
/** Disables interaction and applies disabled visual style */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Required when the Pill has no visible label (icon-only) — informs screen readers */
|
|
24
|
+
'aria-label'?: string;
|
|
25
|
+
/** Additional CSS classes */
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Pill needs at least a label or iconLeft — TypeScript prevents usage without either */
|
|
29
|
+
type PillOwnProps = (PillBase & {
|
|
30
|
+
label: string; /** Icon to the left of the label */
|
|
31
|
+
iconLeft?: IconElement;
|
|
32
|
+
}) | (PillBase & {
|
|
33
|
+
label?: string; /** Icon to the left of the label */
|
|
34
|
+
iconLeft: IconElement;
|
|
35
|
+
});
|
|
36
|
+
export type PillProps = PillOwnProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof PillOwnProps | 'type'>;
|
|
37
|
+
export declare const Pill: React.FC<PillProps>;
|
|
38
|
+
export default Pill;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FloatingPlacement, FloatingTriggerMode } from '../Floating/Floating';
|
|
3
|
+
import './Popover.css';
|
|
4
|
+
export type PopoverPlacement = FloatingPlacement;
|
|
5
|
+
export type PopoverTriggerMode = FloatingTriggerMode;
|
|
6
|
+
export interface PopoverProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
content: React.ReactNode;
|
|
9
|
+
title?: React.ReactNode;
|
|
10
|
+
placement?: PopoverPlacement;
|
|
11
|
+
trigger?: PopoverTriggerMode | PopoverTriggerMode[];
|
|
12
|
+
arrow?: boolean;
|
|
13
|
+
matchTriggerWidth?: boolean;
|
|
14
|
+
destroyOnClose?: boolean;
|
|
15
|
+
defaultOpen?: boolean;
|
|
16
|
+
open?: boolean;
|
|
17
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
|
+
zIndex?: number;
|
|
19
|
+
panelClassName?: string;
|
|
20
|
+
titleClassName?: string;
|
|
21
|
+
contentClassName?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const Popover: React.FC<PopoverProps>;
|
|
24
|
+
export default Popover;
|