@attrus-ds/core 0.2.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +27 -27
- package/dist/assets/flags/Brazil-rounded.svg +15 -15
- package/dist/assets/flags/Brazil-square.svg +16 -16
- package/dist/assets/flags/Chile-rounded.svg +10 -10
- package/dist/assets/flags/Chile-square.svg +10 -10
- package/dist/assets/flags/Colombia-rounded.svg +9 -9
- package/dist/assets/flags/Colombia-square.svg +9 -9
- package/dist/assets/flags/EUA-rounded.svg +10 -10
- package/dist/assets/flags/EUA-square.svg +10 -10
- package/dist/assets/flags/EUR-rounded.svg +8 -8
- package/dist/assets/flags/EUR-square.svg +8 -8
- package/dist/assets/flags/Mexico-rounded.svg +18 -18
- package/dist/assets/flags/Mexico-square.svg +18 -18
- package/dist/assets/icon-attrus-dark.svg +2 -2
- package/dist/assets/icon-attrus-light.svg +2 -2
- package/dist/assets/logo-attrus-dark.svg +7 -7
- package/dist/assets/logo-attrus-light.svg +7 -7
- package/dist/css/components/buttons.css +301 -301
- package/dist/css/components/callout.css +195 -195
- package/dist/css/components/cards.css +272 -272
- package/dist/css/components/combobox.css +319 -319
- package/dist/css/components/empty-states.css +61 -61
- package/dist/css/components/inputs.css +975 -975
- package/dist/css/components/number-input.css +138 -138
- package/dist/css/components/overlays.css +374 -374
- package/dist/css/components/primitives.css +314 -314
- package/dist/css/components/sidebar.css +179 -179
- package/dist/css/components/smart-search.css +91 -91
- package/dist/css/components/status-pills.css +207 -207
- package/dist/css/components/stepper.css +309 -309
- package/dist/css/components/table.css +602 -602
- package/dist/css/components/tabs.css +319 -319
- package/dist/css/components/toast.css +243 -243
- package/dist/css/components/tooltip.css +231 -231
- package/dist/css/components/topbar.css +148 -148
- package/dist/css/tokens.css +713 -666
- package/dist/react/AppSidebar/AppSidebar.d.ts +50 -50
- package/dist/react/AppSidebar/AppSidebar.tsx +197 -197
- package/dist/react/AppTopbar/AppTopbar.d.ts +58 -58
- package/dist/react/AppTopbar/AppTopbar.tsx +203 -203
- package/dist/react/Atoms/Atoms.d.ts +149 -149
- package/dist/react/Atoms/Atoms.tsx +407 -407
- package/dist/react/Button/Button.d.ts +25 -25
- package/dist/react/Button/Button.tsx +83 -83
- package/dist/react/Callout/Callout.d.ts +29 -29
- package/dist/react/Callout/Callout.tsx +98 -98
- package/dist/react/Card/Card.d.ts +38 -38
- package/dist/react/Card/Card.tsx +93 -93
- package/dist/react/Combobox/Combobox.d.ts +52 -52
- package/dist/react/Combobox/Combobox.tsx +254 -254
- package/dist/react/DataTable/DataTable.d.ts +81 -81
- package/dist/react/DataTable/DataTable.tsx +308 -308
- package/dist/react/Drawer/Drawer.d.ts +35 -35
- package/dist/react/Drawer/Drawer.tsx +226 -226
- package/dist/react/Input/Input.d.ts +155 -155
- package/dist/react/Input/Input.tsx +478 -478
- package/dist/react/Modal/Modal.d.ts +27 -27
- package/dist/react/Modal/Modal.tsx +173 -173
- package/dist/react/NumberInput/NumberInput.d.ts +25 -25
- package/dist/react/NumberInput/NumberInput.tsx +117 -117
- package/dist/react/Pill/Pill.d.ts +31 -31
- package/dist/react/Pill/Pill.tsx +104 -104
- package/dist/react/SearchPill/SearchPill.d.ts +14 -14
- package/dist/react/SearchPill/SearchPill.tsx +40 -40
- package/dist/react/SmartSearch/SmartSearch.d.ts +65 -65
- package/dist/react/SmartSearch/SmartSearch.tsx +271 -271
- package/dist/react/Stepper/Stepper.d.ts +25 -25
- package/dist/react/Stepper/Stepper.tsx +94 -94
- package/dist/react/Tabs/Tabs.d.ts +32 -32
- package/dist/react/Tabs/Tabs.tsx +147 -147
- package/dist/react/Toast/Toast.d.ts +30 -30
- package/dist/react/Toast/Toast.tsx +94 -94
- package/dist/react/Tooltip/Tooltip.d.ts +23 -23
- package/dist/react/Tooltip/Tooltip.tsx +80 -80
- package/dist/react/ZeroState/ZeroState.d.ts +17 -17
- package/dist/react/ZeroState/ZeroState.tsx +45 -45
- package/dist/react/index.ts +35 -35
- package/dist/tokens/attrus-tokens.flat.json +1234 -1234
- package/dist/tokens/attrus-tokens.json +1089 -1089
- package/package.json +66 -64
|
@@ -1,155 +1,155 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
export type InputSize = 'sm' | 'md' | 'lg';
|
|
4
|
-
export type InputStatus = 'default' | 'error' | 'success' | 'warning';
|
|
5
|
-
|
|
6
|
-
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
|
|
7
|
-
/** Field label (renders the .field wrapper). */
|
|
8
|
-
label?: React.ReactNode;
|
|
9
|
-
/** Helper line under the control; takes the status tone. */
|
|
10
|
-
help?: React.ReactNode;
|
|
11
|
-
/** Validation state: error/success border + focus ring + help tone. */
|
|
12
|
-
status?: InputStatus;
|
|
13
|
-
/** sm=32px, md=40px (default), lg=48px. */
|
|
14
|
-
size?: InputSize;
|
|
15
|
-
/** Leading icon (decorative) — .affix.lead-pad. */
|
|
16
|
-
leadIcon?: React.ReactNode;
|
|
17
|
-
/** Trailing icon (decorative) — .affix.trail-pad. */
|
|
18
|
-
trailIcon?: React.ReactNode;
|
|
19
|
-
/** Makes the trailing slot a clickable .trail-btn (clear, reveal…). */
|
|
20
|
-
onTrailClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
21
|
-
/** Trailing button accessible label (required with onTrailClick). */
|
|
22
|
-
trailLabel?: string;
|
|
23
|
-
/** Attached prefix cell — .group .fix.l (e.g. "USD"). */
|
|
24
|
-
prefix?: React.ReactNode;
|
|
25
|
-
/** Attached suffix cell — .group .fix.r (e.g. ".00"). */
|
|
26
|
-
suffix?: React.ReactNode;
|
|
27
|
-
/** Dark-surface treatment (.on-inverse). */
|
|
28
|
-
onInverse?: boolean;
|
|
29
|
-
/** Quiet read-only: value only, no border (.is-readonly). */
|
|
30
|
-
readOnlyQuiet?: boolean;
|
|
31
|
-
/** Quiet / ghost input — bottom hairline only (`.input.underline`). */
|
|
32
|
-
underline?: boolean;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export declare const Input: React.FC<InputProps>;
|
|
36
|
-
|
|
37
|
-
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
38
|
-
label?: React.ReactNode;
|
|
39
|
-
help?: React.ReactNode;
|
|
40
|
-
status?: InputStatus;
|
|
41
|
-
/** sm / md (default) / lg — maps to textarea.input.input-{size}. */
|
|
42
|
-
inputSize?: InputSize;
|
|
43
|
-
}
|
|
44
|
-
export declare const Textarea: React.FC<TextareaProps>;
|
|
45
|
-
|
|
46
|
-
export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
47
|
-
label?: React.ReactNode;
|
|
48
|
-
help?: React.ReactNode;
|
|
49
|
-
status?: InputStatus;
|
|
50
|
-
inputSize?: InputSize;
|
|
51
|
-
}
|
|
52
|
-
export declare const Select: React.FC<SelectProps>;
|
|
53
|
-
|
|
54
|
-
export interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
55
|
-
children?: React.ReactNode;
|
|
56
|
-
}
|
|
57
|
-
export declare const Switch: React.FC<SwitchProps>;
|
|
58
|
-
|
|
59
|
-
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
60
|
-
children?: React.ReactNode;
|
|
61
|
-
/** Mixed state — sets input.indeterminate. */
|
|
62
|
-
indeterminate?: boolean;
|
|
63
|
-
/** Error ring on the box (`.check.is-error`). */
|
|
64
|
-
error?: boolean;
|
|
65
|
-
}
|
|
66
|
-
export declare const Checkbox: React.FC<CheckboxProps>;
|
|
67
|
-
|
|
68
|
-
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
69
|
-
children?: React.ReactNode;
|
|
70
|
-
}
|
|
71
|
-
export declare const Radio: React.FC<RadioProps>;
|
|
72
|
-
|
|
73
|
-
/* ---------- Specialised inputs (inputs.html §8–13) ---------- */
|
|
74
|
-
|
|
75
|
-
export interface DateTriggerProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
|
|
76
|
-
/** Filled label (e.g. "April 17, 2026" or a range). Empty → placeholder. */
|
|
77
|
-
value?: React.ReactNode;
|
|
78
|
-
placeholder?: React.ReactNode;
|
|
79
|
-
/** Leading icon (calendar / calendar-range / clock). */
|
|
80
|
-
icon?: React.ReactNode;
|
|
81
|
-
/** Error ring (`.is-error`). */
|
|
82
|
-
error?: boolean;
|
|
83
|
-
}
|
|
84
|
-
export declare const DateTrigger: React.FC<DateTriggerProps>;
|
|
85
|
-
|
|
86
|
-
export interface ChipsInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
87
|
-
/** Current chips (controlled). */
|
|
88
|
-
values: string[];
|
|
89
|
-
/** Enter/comma in the embedded input adds a chip. */
|
|
90
|
-
onAdd?: (value: string) => void;
|
|
91
|
-
/** × on a chip (or Backspace on empty input) removes. */
|
|
92
|
-
onRemove?: (value: string) => void;
|
|
93
|
-
placeholder?: string;
|
|
94
|
-
disabled?: boolean;
|
|
95
|
-
}
|
|
96
|
-
export declare const ChipsInput: React.FC<ChipsInputProps>;
|
|
97
|
-
|
|
98
|
-
export interface OtpProps {
|
|
99
|
-
/** Number of digit cells. Default 6. */
|
|
100
|
-
length?: number;
|
|
101
|
-
/** Current code (controlled). */
|
|
102
|
-
value: string;
|
|
103
|
-
onChange?: (code: string) => void;
|
|
104
|
-
/** Error ring on every cell. */
|
|
105
|
-
error?: boolean;
|
|
106
|
-
disabled?: boolean;
|
|
107
|
-
'aria-label'?: string;
|
|
108
|
-
className?: string;
|
|
109
|
-
style?: React.CSSProperties;
|
|
110
|
-
}
|
|
111
|
-
export declare const Otp: React.FC<OtpProps>;
|
|
112
|
-
|
|
113
|
-
export interface FileDropProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
114
|
-
onFiles?: (files: File[]) => void;
|
|
115
|
-
multiple?: boolean;
|
|
116
|
-
accept?: string;
|
|
117
|
-
title?: React.ReactNode;
|
|
118
|
-
/** Sub line — `.anchor` span = click-to-browse affordance. */
|
|
119
|
-
sub?: React.ReactNode;
|
|
120
|
-
icon?: React.ReactNode;
|
|
121
|
-
disabled?: boolean;
|
|
122
|
-
}
|
|
123
|
-
export declare const FileDrop: React.FC<FileDropProps>;
|
|
124
|
-
|
|
125
|
-
export type FileRowStatus = 'ok' | 'pending' | 'err';
|
|
126
|
-
export interface FileRowProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
127
|
-
/** Icon tile tint via `data-kind` (img / sheet / doc / pdf…). */
|
|
128
|
-
kind?: string;
|
|
129
|
-
icon?: React.ReactNode;
|
|
130
|
-
/** Corner tag text on the tile (e.g. "PDF"). */
|
|
131
|
-
tag?: React.ReactNode;
|
|
132
|
-
name: React.ReactNode;
|
|
133
|
-
/** Mono sub line (size · date); err status tints it. */
|
|
134
|
-
sub?: React.ReactNode;
|
|
135
|
-
/** ok · pending · err. */
|
|
136
|
-
status?: FileRowStatus;
|
|
137
|
-
statusLabel?: React.ReactNode;
|
|
138
|
-
/** 0–100 — uploading hairline. */
|
|
139
|
-
progress?: number;
|
|
140
|
-
onRemove?: () => void;
|
|
141
|
-
}
|
|
142
|
-
export declare const FileRow: React.FC<FileRowProps>;
|
|
143
|
-
|
|
144
|
-
export interface FileListBoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
145
|
-
head?: React.ReactNode;
|
|
146
|
-
/** Head-right action (e.g. "Clear all"). */
|
|
147
|
-
action?: React.ReactNode;
|
|
148
|
-
onActionClick?: () => void;
|
|
149
|
-
}
|
|
150
|
-
export declare const FileListBox: React.FC<FileListBoxProps>;
|
|
151
|
-
|
|
152
|
-
export interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {}
|
|
153
|
-
export declare const Slider: React.FC<SliderProps>;
|
|
154
|
-
|
|
155
|
-
export default Input;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
export type InputSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export type InputStatus = 'default' | 'error' | 'success' | 'warning';
|
|
5
|
+
|
|
6
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
|
|
7
|
+
/** Field label (renders the .field wrapper). */
|
|
8
|
+
label?: React.ReactNode;
|
|
9
|
+
/** Helper line under the control; takes the status tone. */
|
|
10
|
+
help?: React.ReactNode;
|
|
11
|
+
/** Validation state: error/success border + focus ring + help tone. */
|
|
12
|
+
status?: InputStatus;
|
|
13
|
+
/** sm=32px, md=40px (default), lg=48px. */
|
|
14
|
+
size?: InputSize;
|
|
15
|
+
/** Leading icon (decorative) — .affix.lead-pad. */
|
|
16
|
+
leadIcon?: React.ReactNode;
|
|
17
|
+
/** Trailing icon (decorative) — .affix.trail-pad. */
|
|
18
|
+
trailIcon?: React.ReactNode;
|
|
19
|
+
/** Makes the trailing slot a clickable .trail-btn (clear, reveal…). */
|
|
20
|
+
onTrailClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
21
|
+
/** Trailing button accessible label (required with onTrailClick). */
|
|
22
|
+
trailLabel?: string;
|
|
23
|
+
/** Attached prefix cell — .group .fix.l (e.g. "USD"). */
|
|
24
|
+
prefix?: React.ReactNode;
|
|
25
|
+
/** Attached suffix cell — .group .fix.r (e.g. ".00"). */
|
|
26
|
+
suffix?: React.ReactNode;
|
|
27
|
+
/** Dark-surface treatment (.on-inverse). */
|
|
28
|
+
onInverse?: boolean;
|
|
29
|
+
/** Quiet read-only: value only, no border (.is-readonly). */
|
|
30
|
+
readOnlyQuiet?: boolean;
|
|
31
|
+
/** Quiet / ghost input — bottom hairline only (`.input.underline`). */
|
|
32
|
+
underline?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export declare const Input: React.FC<InputProps>;
|
|
36
|
+
|
|
37
|
+
export interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
38
|
+
label?: React.ReactNode;
|
|
39
|
+
help?: React.ReactNode;
|
|
40
|
+
status?: InputStatus;
|
|
41
|
+
/** sm / md (default) / lg — maps to textarea.input.input-{size}. */
|
|
42
|
+
inputSize?: InputSize;
|
|
43
|
+
}
|
|
44
|
+
export declare const Textarea: React.FC<TextareaProps>;
|
|
45
|
+
|
|
46
|
+
export interface SelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
47
|
+
label?: React.ReactNode;
|
|
48
|
+
help?: React.ReactNode;
|
|
49
|
+
status?: InputStatus;
|
|
50
|
+
inputSize?: InputSize;
|
|
51
|
+
}
|
|
52
|
+
export declare const Select: React.FC<SelectProps>;
|
|
53
|
+
|
|
54
|
+
export interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
55
|
+
children?: React.ReactNode;
|
|
56
|
+
}
|
|
57
|
+
export declare const Switch: React.FC<SwitchProps>;
|
|
58
|
+
|
|
59
|
+
export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
60
|
+
children?: React.ReactNode;
|
|
61
|
+
/** Mixed state — sets input.indeterminate. */
|
|
62
|
+
indeterminate?: boolean;
|
|
63
|
+
/** Error ring on the box (`.check.is-error`). */
|
|
64
|
+
error?: boolean;
|
|
65
|
+
}
|
|
66
|
+
export declare const Checkbox: React.FC<CheckboxProps>;
|
|
67
|
+
|
|
68
|
+
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
69
|
+
children?: React.ReactNode;
|
|
70
|
+
}
|
|
71
|
+
export declare const Radio: React.FC<RadioProps>;
|
|
72
|
+
|
|
73
|
+
/* ---------- Specialised inputs (inputs.html §8–13) ---------- */
|
|
74
|
+
|
|
75
|
+
export interface DateTriggerProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'> {
|
|
76
|
+
/** Filled label (e.g. "April 17, 2026" or a range). Empty → placeholder. */
|
|
77
|
+
value?: React.ReactNode;
|
|
78
|
+
placeholder?: React.ReactNode;
|
|
79
|
+
/** Leading icon (calendar / calendar-range / clock). */
|
|
80
|
+
icon?: React.ReactNode;
|
|
81
|
+
/** Error ring (`.is-error`). */
|
|
82
|
+
error?: boolean;
|
|
83
|
+
}
|
|
84
|
+
export declare const DateTrigger: React.FC<DateTriggerProps>;
|
|
85
|
+
|
|
86
|
+
export interface ChipsInputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
87
|
+
/** Current chips (controlled). */
|
|
88
|
+
values: string[];
|
|
89
|
+
/** Enter/comma in the embedded input adds a chip. */
|
|
90
|
+
onAdd?: (value: string) => void;
|
|
91
|
+
/** × on a chip (or Backspace on empty input) removes. */
|
|
92
|
+
onRemove?: (value: string) => void;
|
|
93
|
+
placeholder?: string;
|
|
94
|
+
disabled?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export declare const ChipsInput: React.FC<ChipsInputProps>;
|
|
97
|
+
|
|
98
|
+
export interface OtpProps {
|
|
99
|
+
/** Number of digit cells. Default 6. */
|
|
100
|
+
length?: number;
|
|
101
|
+
/** Current code (controlled). */
|
|
102
|
+
value: string;
|
|
103
|
+
onChange?: (code: string) => void;
|
|
104
|
+
/** Error ring on every cell. */
|
|
105
|
+
error?: boolean;
|
|
106
|
+
disabled?: boolean;
|
|
107
|
+
'aria-label'?: string;
|
|
108
|
+
className?: string;
|
|
109
|
+
style?: React.CSSProperties;
|
|
110
|
+
}
|
|
111
|
+
export declare const Otp: React.FC<OtpProps>;
|
|
112
|
+
|
|
113
|
+
export interface FileDropProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
114
|
+
onFiles?: (files: File[]) => void;
|
|
115
|
+
multiple?: boolean;
|
|
116
|
+
accept?: string;
|
|
117
|
+
title?: React.ReactNode;
|
|
118
|
+
/** Sub line — `.anchor` span = click-to-browse affordance. */
|
|
119
|
+
sub?: React.ReactNode;
|
|
120
|
+
icon?: React.ReactNode;
|
|
121
|
+
disabled?: boolean;
|
|
122
|
+
}
|
|
123
|
+
export declare const FileDrop: React.FC<FileDropProps>;
|
|
124
|
+
|
|
125
|
+
export type FileRowStatus = 'ok' | 'pending' | 'err';
|
|
126
|
+
export interface FileRowProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
127
|
+
/** Icon tile tint via `data-kind` (img / sheet / doc / pdf…). */
|
|
128
|
+
kind?: string;
|
|
129
|
+
icon?: React.ReactNode;
|
|
130
|
+
/** Corner tag text on the tile (e.g. "PDF"). */
|
|
131
|
+
tag?: React.ReactNode;
|
|
132
|
+
name: React.ReactNode;
|
|
133
|
+
/** Mono sub line (size · date); err status tints it. */
|
|
134
|
+
sub?: React.ReactNode;
|
|
135
|
+
/** ok · pending · err. */
|
|
136
|
+
status?: FileRowStatus;
|
|
137
|
+
statusLabel?: React.ReactNode;
|
|
138
|
+
/** 0–100 — uploading hairline. */
|
|
139
|
+
progress?: number;
|
|
140
|
+
onRemove?: () => void;
|
|
141
|
+
}
|
|
142
|
+
export declare const FileRow: React.FC<FileRowProps>;
|
|
143
|
+
|
|
144
|
+
export interface FileListBoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
145
|
+
head?: React.ReactNode;
|
|
146
|
+
/** Head-right action (e.g. "Clear all"). */
|
|
147
|
+
action?: React.ReactNode;
|
|
148
|
+
onActionClick?: () => void;
|
|
149
|
+
}
|
|
150
|
+
export declare const FileListBox: React.FC<FileListBoxProps>;
|
|
151
|
+
|
|
152
|
+
export interface SliderProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {}
|
|
153
|
+
export declare const Slider: React.FC<SliderProps>;
|
|
154
|
+
|
|
155
|
+
export default Input;
|