@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.
Files changed (80) hide show
  1. package/LICENSE +27 -27
  2. package/dist/assets/flags/Brazil-rounded.svg +15 -15
  3. package/dist/assets/flags/Brazil-square.svg +16 -16
  4. package/dist/assets/flags/Chile-rounded.svg +10 -10
  5. package/dist/assets/flags/Chile-square.svg +10 -10
  6. package/dist/assets/flags/Colombia-rounded.svg +9 -9
  7. package/dist/assets/flags/Colombia-square.svg +9 -9
  8. package/dist/assets/flags/EUA-rounded.svg +10 -10
  9. package/dist/assets/flags/EUA-square.svg +10 -10
  10. package/dist/assets/flags/EUR-rounded.svg +8 -8
  11. package/dist/assets/flags/EUR-square.svg +8 -8
  12. package/dist/assets/flags/Mexico-rounded.svg +18 -18
  13. package/dist/assets/flags/Mexico-square.svg +18 -18
  14. package/dist/assets/icon-attrus-dark.svg +2 -2
  15. package/dist/assets/icon-attrus-light.svg +2 -2
  16. package/dist/assets/logo-attrus-dark.svg +7 -7
  17. package/dist/assets/logo-attrus-light.svg +7 -7
  18. package/dist/css/components/buttons.css +301 -301
  19. package/dist/css/components/callout.css +195 -195
  20. package/dist/css/components/cards.css +272 -272
  21. package/dist/css/components/combobox.css +319 -319
  22. package/dist/css/components/empty-states.css +61 -61
  23. package/dist/css/components/inputs.css +975 -975
  24. package/dist/css/components/number-input.css +138 -138
  25. package/dist/css/components/overlays.css +374 -374
  26. package/dist/css/components/primitives.css +314 -314
  27. package/dist/css/components/sidebar.css +179 -179
  28. package/dist/css/components/smart-search.css +91 -91
  29. package/dist/css/components/status-pills.css +207 -207
  30. package/dist/css/components/stepper.css +309 -309
  31. package/dist/css/components/table.css +602 -602
  32. package/dist/css/components/tabs.css +319 -319
  33. package/dist/css/components/toast.css +243 -243
  34. package/dist/css/components/tooltip.css +231 -231
  35. package/dist/css/components/topbar.css +148 -148
  36. package/dist/css/tokens.css +713 -666
  37. package/dist/react/AppSidebar/AppSidebar.d.ts +50 -50
  38. package/dist/react/AppSidebar/AppSidebar.tsx +197 -197
  39. package/dist/react/AppTopbar/AppTopbar.d.ts +58 -58
  40. package/dist/react/AppTopbar/AppTopbar.tsx +203 -203
  41. package/dist/react/Atoms/Atoms.d.ts +149 -149
  42. package/dist/react/Atoms/Atoms.tsx +407 -407
  43. package/dist/react/Button/Button.d.ts +25 -25
  44. package/dist/react/Button/Button.tsx +83 -83
  45. package/dist/react/Callout/Callout.d.ts +29 -29
  46. package/dist/react/Callout/Callout.tsx +98 -98
  47. package/dist/react/Card/Card.d.ts +38 -38
  48. package/dist/react/Card/Card.tsx +93 -93
  49. package/dist/react/Combobox/Combobox.d.ts +52 -52
  50. package/dist/react/Combobox/Combobox.tsx +254 -254
  51. package/dist/react/DataTable/DataTable.d.ts +81 -81
  52. package/dist/react/DataTable/DataTable.tsx +308 -308
  53. package/dist/react/Drawer/Drawer.d.ts +35 -35
  54. package/dist/react/Drawer/Drawer.tsx +226 -226
  55. package/dist/react/Input/Input.d.ts +155 -155
  56. package/dist/react/Input/Input.tsx +478 -478
  57. package/dist/react/Modal/Modal.d.ts +27 -27
  58. package/dist/react/Modal/Modal.tsx +173 -173
  59. package/dist/react/NumberInput/NumberInput.d.ts +25 -25
  60. package/dist/react/NumberInput/NumberInput.tsx +117 -117
  61. package/dist/react/Pill/Pill.d.ts +31 -31
  62. package/dist/react/Pill/Pill.tsx +104 -104
  63. package/dist/react/SearchPill/SearchPill.d.ts +14 -14
  64. package/dist/react/SearchPill/SearchPill.tsx +40 -40
  65. package/dist/react/SmartSearch/SmartSearch.d.ts +65 -65
  66. package/dist/react/SmartSearch/SmartSearch.tsx +271 -271
  67. package/dist/react/Stepper/Stepper.d.ts +25 -25
  68. package/dist/react/Stepper/Stepper.tsx +94 -94
  69. package/dist/react/Tabs/Tabs.d.ts +32 -32
  70. package/dist/react/Tabs/Tabs.tsx +147 -147
  71. package/dist/react/Toast/Toast.d.ts +30 -30
  72. package/dist/react/Toast/Toast.tsx +94 -94
  73. package/dist/react/Tooltip/Tooltip.d.ts +23 -23
  74. package/dist/react/Tooltip/Tooltip.tsx +80 -80
  75. package/dist/react/ZeroState/ZeroState.d.ts +17 -17
  76. package/dist/react/ZeroState/ZeroState.tsx +45 -45
  77. package/dist/react/index.ts +35 -35
  78. package/dist/tokens/attrus-tokens.flat.json +1234 -1234
  79. package/dist/tokens/attrus-tokens.json +1089 -1089
  80. package/package.json +66 -64
@@ -1,93 +1,93 @@
1
- import * as React from 'react';
2
-
3
- /**
4
- * ATTRUS Card — typed wrapper over the canonical `.card` system
5
- * (preview/components/cards.css). CSS stays the visual source of truth.
6
- *
7
- * Slots: compose with <CardHeader/>, <CardBody/>, <CardFooter/>,
8
- * <CardCanvas/>, <CardDivider/> — the CSS `:has()` rules drop the base
9
- * padding automatically when slots are present (each slot pads itself).
10
- */
11
-
12
- export type CardVariant = 'default' | 'flat' | 'subtle' | 'sunken' | 'raised' | 'floating' | 'hero' | 'inverse';
13
- export type CardAccent = 'success' | 'warning' | 'danger' | 'info';
14
- export type CardDensity = 'compact' | 'default' | 'spacious';
15
-
16
- export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
17
- /** Surface role. Default: surface + hairline + xs shadow. */
18
- variant?: CardVariant;
19
- /** Semantic banner tint (success/warning/danger/info). */
20
- accent?: CardAccent;
21
- /** Padding density for the card and its slots. */
22
- density?: CardDensity;
23
- /** Clip children to the rounded corners (tables, images). */
24
- clip?: boolean;
25
- /** Hover/press affordance (`.card.interactive`) — wrap the card in an <a>/<button>, or pass onClick. */
26
- interactive?: boolean;
27
- }
28
-
29
- export const Card: React.FC<CardProps> = ({
30
- variant = 'default',
31
- accent,
32
- density = 'default',
33
- clip = false,
34
- interactive = false,
35
- className,
36
- style,
37
- children,
38
- ...rest
39
- }) => {
40
- const cls = [
41
- 'card',
42
- variant !== 'default' ? variant : '',
43
- accent ? `accent-${accent}` : '',
44
- density !== 'default' ? density : '',
45
- interactive ? 'interactive' : '',
46
- className || '',
47
- ]
48
- .filter(Boolean)
49
- .join(' ');
50
- return (
51
- <div className={cls} style={clip ? { overflow: 'hidden', ...style } : style} {...rest}>
52
- {children}
53
- </div>
54
- );
55
- };
56
-
57
- export interface CardSlotProps extends React.HTMLAttributes<HTMLDivElement> {}
58
-
59
- export const CardHeader: React.FC<CardSlotProps> = ({ className, ...rest }) => (
60
- <div className={['card-header', className || ''].filter(Boolean).join(' ')} {...rest} />
61
- );
62
- export const CardBody: React.FC<CardSlotProps> = ({ className, ...rest }) => (
63
- <div className={['card-body', className || ''].filter(Boolean).join(' ')} {...rest} />
64
- );
65
- export const CardFooter: React.FC<CardSlotProps> = ({ className, ...rest }) => (
66
- <div className={['card-footer', className || ''].filter(Boolean).join(' ')} {...rest} />
67
- );
68
- export const CardCanvas: React.FC<CardSlotProps> = ({ className, ...rest }) => (
69
- <div className={['card-canvas', className || ''].filter(Boolean).join(' ')} {...rest} />
70
- );
71
- export const CardDivider: React.FC<CardSlotProps> = ({ className, ...rest }) => (
72
- <div className={['card-divider', className || ''].filter(Boolean).join(' ')} {...rest} />
73
- );
74
-
75
- /** KPI/stat layout inside a card — `.card-stat` (mono label, bold value, tinted delta). */
76
- export interface CardStatProps extends React.HTMLAttributes<HTMLDivElement> {
77
- label: React.ReactNode;
78
- value: React.ReactNode;
79
- /** Delta text, e.g. "+8.2%". */
80
- delta?: React.ReactNode;
81
- /** Direction tints the delta: up=success, down=danger, flat=muted. Default: 'flat'. */
82
- deltaDirection?: 'up' | 'down' | 'flat';
83
- }
84
- export const CardStat: React.FC<CardStatProps> = ({ label, value, delta, deltaDirection = 'flat', className, children, ...rest }) => (
85
- <div className={['card-stat', className || ''].filter(Boolean).join(' ')} {...rest}>
86
- <span className="stat-label">{label}</span>
87
- <span className="stat-value">{value}</span>
88
- {delta != null ? <span className={`stat-delta ${deltaDirection}`}>{delta}</span> : null}
89
- {children}
90
- </div>
91
- );
92
-
93
- export default Card;
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * ATTRUS Card — typed wrapper over the canonical `.card` system
5
+ * (preview/components/cards.css). CSS stays the visual source of truth.
6
+ *
7
+ * Slots: compose with <CardHeader/>, <CardBody/>, <CardFooter/>,
8
+ * <CardCanvas/>, <CardDivider/> — the CSS `:has()` rules drop the base
9
+ * padding automatically when slots are present (each slot pads itself).
10
+ */
11
+
12
+ export type CardVariant = 'default' | 'flat' | 'subtle' | 'sunken' | 'raised' | 'floating' | 'hero' | 'inverse';
13
+ export type CardAccent = 'success' | 'warning' | 'danger' | 'info';
14
+ export type CardDensity = 'compact' | 'default' | 'spacious';
15
+
16
+ export interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
17
+ /** Surface role. Default: surface + hairline + xs shadow. */
18
+ variant?: CardVariant;
19
+ /** Semantic banner tint (success/warning/danger/info). */
20
+ accent?: CardAccent;
21
+ /** Padding density for the card and its slots. */
22
+ density?: CardDensity;
23
+ /** Clip children to the rounded corners (tables, images). */
24
+ clip?: boolean;
25
+ /** Hover/press affordance (`.card.interactive`) — wrap the card in an <a>/<button>, or pass onClick. */
26
+ interactive?: boolean;
27
+ }
28
+
29
+ export const Card: React.FC<CardProps> = ({
30
+ variant = 'default',
31
+ accent,
32
+ density = 'default',
33
+ clip = false,
34
+ interactive = false,
35
+ className,
36
+ style,
37
+ children,
38
+ ...rest
39
+ }) => {
40
+ const cls = [
41
+ 'card',
42
+ variant !== 'default' ? variant : '',
43
+ accent ? `accent-${accent}` : '',
44
+ density !== 'default' ? density : '',
45
+ interactive ? 'interactive' : '',
46
+ className || '',
47
+ ]
48
+ .filter(Boolean)
49
+ .join(' ');
50
+ return (
51
+ <div className={cls} style={clip ? { overflow: 'hidden', ...style } : style} {...rest}>
52
+ {children}
53
+ </div>
54
+ );
55
+ };
56
+
57
+ export interface CardSlotProps extends React.HTMLAttributes<HTMLDivElement> {}
58
+
59
+ export const CardHeader: React.FC<CardSlotProps> = ({ className, ...rest }) => (
60
+ <div className={['card-header', className || ''].filter(Boolean).join(' ')} {...rest} />
61
+ );
62
+ export const CardBody: React.FC<CardSlotProps> = ({ className, ...rest }) => (
63
+ <div className={['card-body', className || ''].filter(Boolean).join(' ')} {...rest} />
64
+ );
65
+ export const CardFooter: React.FC<CardSlotProps> = ({ className, ...rest }) => (
66
+ <div className={['card-footer', className || ''].filter(Boolean).join(' ')} {...rest} />
67
+ );
68
+ export const CardCanvas: React.FC<CardSlotProps> = ({ className, ...rest }) => (
69
+ <div className={['card-canvas', className || ''].filter(Boolean).join(' ')} {...rest} />
70
+ );
71
+ export const CardDivider: React.FC<CardSlotProps> = ({ className, ...rest }) => (
72
+ <div className={['card-divider', className || ''].filter(Boolean).join(' ')} {...rest} />
73
+ );
74
+
75
+ /** KPI/stat layout inside a card — `.card-stat` (mono label, bold value, tinted delta). */
76
+ export interface CardStatProps extends React.HTMLAttributes<HTMLDivElement> {
77
+ label: React.ReactNode;
78
+ value: React.ReactNode;
79
+ /** Delta text, e.g. "+8.2%". */
80
+ delta?: React.ReactNode;
81
+ /** Direction tints the delta: up=success, down=danger, flat=muted. Default: 'flat'. */
82
+ deltaDirection?: 'up' | 'down' | 'flat';
83
+ }
84
+ export const CardStat: React.FC<CardStatProps> = ({ label, value, delta, deltaDirection = 'flat', className, children, ...rest }) => (
85
+ <div className={['card-stat', className || ''].filter(Boolean).join(' ')} {...rest}>
86
+ <span className="stat-label">{label}</span>
87
+ <span className="stat-value">{value}</span>
88
+ {delta != null ? <span className={`stat-delta ${deltaDirection}`}>{delta}</span> : null}
89
+ {children}
90
+ </div>
91
+ );
92
+
93
+ export default Card;
@@ -1,52 +1,52 @@
1
- import * as React from 'react';
2
-
3
- export interface ComboOption {
4
- value: string;
5
- label: React.ReactNode;
6
- /** Secondary line under the label. */
7
- meta?: React.ReactNode;
8
- /** Right-aligned mono hint (e.g. a code). */
9
- trailing?: React.ReactNode;
10
- /** Optional group header this option sits under. */
11
- group?: string;
12
- /** Non-selectable (`.is-disabled`). */
13
- disabled?: boolean;
14
- /** Text used by the search filter when label isn't a plain string. */
15
- searchText?: string;
16
- }
17
-
18
- export type ComboboxStatus = 'default' | 'error';
19
-
20
- export interface ComboboxProps {
21
- options: ComboOption[];
22
- value?: string | null;
23
- onChange?: (value: string) => void;
24
- placeholder?: string;
25
- /** Shows the search header inside the popover. */
26
- searchable?: boolean;
27
- searchPlaceholder?: string;
28
- /** Trigger leading icon (`.combobox-trigger-icon`). */
29
- icon?: React.ReactNode;
30
- /** Validation state — error ring on the trigger (`.combobox.is-invalid` on the wrapper). */
31
- status?: ComboboxStatus;
32
- /** Filter-chip row inside the popover (`.combobox-filters`). */
33
- filters?: React.ReactNode;
34
- /** Results meta line above the list (`.combobox-meta`). */
35
- meta?: React.ReactNode;
36
- /** Muted meta line below the list (`.combobox-foot-meta`). */
37
- footMeta?: React.ReactNode;
38
- /** Popover starts open (galleries/docs). */
39
- defaultOpen?: boolean;
40
- /** Footer action (e.g. "Create new counterparty"). */
41
- footer?: React.ReactNode;
42
- onFooterClick?: () => void;
43
- emptyTitle?: React.ReactNode;
44
- emptySub?: React.ReactNode;
45
- disabled?: boolean;
46
- className?: string;
47
- style?: React.CSSProperties;
48
- 'aria-label'?: string;
49
- }
50
-
51
- export declare const Combobox: React.FC<ComboboxProps>;
52
- export default Combobox;
1
+ import * as React from 'react';
2
+
3
+ export interface ComboOption {
4
+ value: string;
5
+ label: React.ReactNode;
6
+ /** Secondary line under the label. */
7
+ meta?: React.ReactNode;
8
+ /** Right-aligned mono hint (e.g. a code). */
9
+ trailing?: React.ReactNode;
10
+ /** Optional group header this option sits under. */
11
+ group?: string;
12
+ /** Non-selectable (`.is-disabled`). */
13
+ disabled?: boolean;
14
+ /** Text used by the search filter when label isn't a plain string. */
15
+ searchText?: string;
16
+ }
17
+
18
+ export type ComboboxStatus = 'default' | 'error';
19
+
20
+ export interface ComboboxProps {
21
+ options: ComboOption[];
22
+ value?: string | null;
23
+ onChange?: (value: string) => void;
24
+ placeholder?: string;
25
+ /** Shows the search header inside the popover. */
26
+ searchable?: boolean;
27
+ searchPlaceholder?: string;
28
+ /** Trigger leading icon (`.combobox-trigger-icon`). */
29
+ icon?: React.ReactNode;
30
+ /** Validation state — error ring on the trigger (`.combobox.is-invalid` on the wrapper). */
31
+ status?: ComboboxStatus;
32
+ /** Filter-chip row inside the popover (`.combobox-filters`). */
33
+ filters?: React.ReactNode;
34
+ /** Results meta line above the list (`.combobox-meta`). */
35
+ meta?: React.ReactNode;
36
+ /** Muted meta line below the list (`.combobox-foot-meta`). */
37
+ footMeta?: React.ReactNode;
38
+ /** Popover starts open (galleries/docs). */
39
+ defaultOpen?: boolean;
40
+ /** Footer action (e.g. "Create new counterparty"). */
41
+ footer?: React.ReactNode;
42
+ onFooterClick?: () => void;
43
+ emptyTitle?: React.ReactNode;
44
+ emptySub?: React.ReactNode;
45
+ disabled?: boolean;
46
+ className?: string;
47
+ style?: React.CSSProperties;
48
+ 'aria-label'?: string;
49
+ }
50
+
51
+ export declare const Combobox: React.FC<ComboboxProps>;
52
+ export default Combobox;