@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,94 +1,94 @@
1
- import * as React from 'react';
2
-
3
- /**
4
- * ATTRUS Toast — typed wrapper over the canonical `.toast` system
5
- * (preview/components/toast.css). Ephemeral feedback: glassy surface,
6
- * tone accent rule, optional action link, close button and auto-dismiss
7
- * progress hairline. Compose inside a <ToastStack/> for positioning.
8
- */
9
-
10
- export type ToastTone = 'success' | 'warning' | 'danger' | 'info' | 'brand' | 'inverse';
11
- export type ToastStackPosition = 'tr' | 'tl' | 'tc' | 'br' | 'bl' | 'bc';
12
-
13
- export interface ToastProps extends React.HTMLAttributes<HTMLDivElement> {
14
- tone?: ToastTone;
15
- /** Leading icon slot (.toast-icon). */
16
- icon?: React.ReactNode;
17
- /** Bold first line. */
18
- title?: React.ReactNode;
19
- /** Inline action link (.toast-action). */
20
- action?: React.ReactNode;
21
- onActionClick?: () => void;
22
- /** Renders the × and calls back. */
23
- onClose?: () => void;
24
- /** Auto-dismiss countdown hairline (.toast-progress). */
25
- progress?: boolean;
26
- /** Exit animation hook (.is-leaving) — set just before removal. */
27
- leaving?: boolean;
28
- }
29
-
30
- const XGlyph: React.FC = () => (
31
- <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeLinecap="round" aria-hidden="true">
32
- <line x1="18" y1="6" x2="6" y2="18" />
33
- <line x1="6" y1="6" x2="18" y2="18" />
34
- </svg>
35
- );
36
-
37
- export const Toast: React.FC<ToastProps> = ({
38
- tone,
39
- icon,
40
- title,
41
- action,
42
- onActionClick,
43
- onClose,
44
- progress = false,
45
- leaving = false,
46
- className,
47
- children,
48
- ...rest
49
- }) => {
50
- const cls = ['toast', tone ? `toast-${tone}` : '', leaving ? 'is-leaving' : '', className || '']
51
- .filter(Boolean)
52
- .join(' ');
53
- return (
54
- <div className={cls} role={tone === 'danger' ? 'alert' : 'status'} {...rest}>
55
- {icon != null ? <span className="toast-icon">{icon}</span> : <span />}
56
- <div className="toast-body">
57
- {title != null ? <div className="toast-title">{title}</div> : null}
58
- {children != null ? <div className="toast-desc">{children}</div> : null}
59
- {action != null ? (
60
- <a
61
- className="toast-action"
62
- role="button"
63
- tabIndex={0}
64
- onClick={onActionClick}
65
- style={{ cursor: 'pointer' }}
66
- >
67
- {action}
68
- </a>
69
- ) : null}
70
- </div>
71
- {onClose ? (
72
- <button type="button" className="toast-close" aria-label="Dismiss" onClick={onClose}>
73
- <XGlyph />
74
- </button>
75
- ) : (
76
- <span />
77
- )}
78
- {progress ? <span className="toast-progress" /> : null}
79
- </div>
80
- );
81
- };
82
-
83
- export interface ToastStackProps extends React.HTMLAttributes<HTMLDivElement> {
84
- /** Corner: tr (default) · tl · tc · br · bl · bc. */
85
- position?: ToastStackPosition;
86
- }
87
-
88
- export const ToastStack: React.FC<ToastStackProps> = ({ position = 'tr', className, children, ...rest }) => (
89
- <div className={['toast-stack', `toast-stack-${position}`, className || ''].filter(Boolean).join(' ')} {...rest}>
90
- {children}
91
- </div>
92
- );
93
-
94
- export default Toast;
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * ATTRUS Toast — typed wrapper over the canonical `.toast` system
5
+ * (preview/components/toast.css). Ephemeral feedback: glassy surface,
6
+ * tone accent rule, optional action link, close button and auto-dismiss
7
+ * progress hairline. Compose inside a <ToastStack/> for positioning.
8
+ */
9
+
10
+ export type ToastTone = 'success' | 'warning' | 'danger' | 'info' | 'brand' | 'inverse';
11
+ export type ToastStackPosition = 'tr' | 'tl' | 'tc' | 'br' | 'bl' | 'bc';
12
+
13
+ export interface ToastProps extends React.HTMLAttributes<HTMLDivElement> {
14
+ tone?: ToastTone;
15
+ /** Leading icon slot (.toast-icon). */
16
+ icon?: React.ReactNode;
17
+ /** Bold first line. */
18
+ title?: React.ReactNode;
19
+ /** Inline action link (.toast-action). */
20
+ action?: React.ReactNode;
21
+ onActionClick?: () => void;
22
+ /** Renders the × and calls back. */
23
+ onClose?: () => void;
24
+ /** Auto-dismiss countdown hairline (.toast-progress). */
25
+ progress?: boolean;
26
+ /** Exit animation hook (.is-leaving) — set just before removal. */
27
+ leaving?: boolean;
28
+ }
29
+
30
+ const XGlyph: React.FC = () => (
31
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeLinecap="round" aria-hidden="true">
32
+ <line x1="18" y1="6" x2="6" y2="18" />
33
+ <line x1="6" y1="6" x2="18" y2="18" />
34
+ </svg>
35
+ );
36
+
37
+ export const Toast: React.FC<ToastProps> = ({
38
+ tone,
39
+ icon,
40
+ title,
41
+ action,
42
+ onActionClick,
43
+ onClose,
44
+ progress = false,
45
+ leaving = false,
46
+ className,
47
+ children,
48
+ ...rest
49
+ }) => {
50
+ const cls = ['toast', tone ? `toast-${tone}` : '', leaving ? 'is-leaving' : '', className || '']
51
+ .filter(Boolean)
52
+ .join(' ');
53
+ return (
54
+ <div className={cls} role={tone === 'danger' ? 'alert' : 'status'} {...rest}>
55
+ {icon != null ? <span className="toast-icon">{icon}</span> : <span />}
56
+ <div className="toast-body">
57
+ {title != null ? <div className="toast-title">{title}</div> : null}
58
+ {children != null ? <div className="toast-desc">{children}</div> : null}
59
+ {action != null ? (
60
+ <a
61
+ className="toast-action"
62
+ role="button"
63
+ tabIndex={0}
64
+ onClick={onActionClick}
65
+ style={{ cursor: 'pointer' }}
66
+ >
67
+ {action}
68
+ </a>
69
+ ) : null}
70
+ </div>
71
+ {onClose ? (
72
+ <button type="button" className="toast-close" aria-label="Dismiss" onClick={onClose}>
73
+ <XGlyph />
74
+ </button>
75
+ ) : (
76
+ <span />
77
+ )}
78
+ {progress ? <span className="toast-progress" /> : null}
79
+ </div>
80
+ );
81
+ };
82
+
83
+ export interface ToastStackProps extends React.HTMLAttributes<HTMLDivElement> {
84
+ /** Corner: tr (default) · tl · tc · br · bl · bc. */
85
+ position?: ToastStackPosition;
86
+ }
87
+
88
+ export const ToastStack: React.FC<ToastStackProps> = ({ position = 'tr', className, children, ...rest }) => (
89
+ <div className={['toast-stack', `toast-stack-${position}`, className || ''].filter(Boolean).join(' ')} {...rest}>
90
+ {children}
91
+ </div>
92
+ );
93
+
94
+ export default Toast;
@@ -1,23 +1,23 @@
1
- import * as React from 'react';
2
-
3
- export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
4
-
5
- export interface TooltipProps extends React.HTMLAttributes<HTMLSpanElement> {
6
- /** Tooltip content — plain label, or rich blocks when rich=true. */
7
- content: React.ReactNode;
8
- placement?: TooltipPlacement;
9
- /** Larger interactive panel (.tooltip-rich) that stays open on hover. */
10
- rich?: boolean;
11
- /** Force-show (testing / controlled cases) — .is-open. */
12
- open?: boolean;
13
- /** Keyboard hint — renders a trailing <kbd> (`.tooltip-kbd`). */
14
- shortcut?: string;
15
- /** The trigger element(s). */
16
- children: React.ReactNode;
17
- }
18
-
19
- export declare const Tooltip: React.FC<TooltipProps>;
20
- export declare const TooltipTitle: React.FC<React.HTMLAttributes<HTMLDivElement>>;
21
- export declare const TooltipDesc: React.FC<React.HTMLAttributes<HTMLParagraphElement>>;
22
- export declare const TooltipRow: React.FC<{ k: React.ReactNode; v: React.ReactNode } & React.HTMLAttributes<HTMLDivElement>>;
23
- export default Tooltip;
1
+ import * as React from 'react';
2
+
3
+ export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
4
+
5
+ export interface TooltipProps extends React.HTMLAttributes<HTMLSpanElement> {
6
+ /** Tooltip content — plain label, or rich blocks when rich=true. */
7
+ content: React.ReactNode;
8
+ placement?: TooltipPlacement;
9
+ /** Larger interactive panel (.tooltip-rich) that stays open on hover. */
10
+ rich?: boolean;
11
+ /** Force-show (testing / controlled cases) — .is-open. */
12
+ open?: boolean;
13
+ /** Keyboard hint — renders a trailing <kbd> (`.tooltip-kbd`). */
14
+ shortcut?: string;
15
+ /** The trigger element(s). */
16
+ children: React.ReactNode;
17
+ }
18
+
19
+ export declare const Tooltip: React.FC<TooltipProps>;
20
+ export declare const TooltipTitle: React.FC<React.HTMLAttributes<HTMLDivElement>>;
21
+ export declare const TooltipDesc: React.FC<React.HTMLAttributes<HTMLParagraphElement>>;
22
+ export declare const TooltipRow: React.FC<{ k: React.ReactNode; v: React.ReactNode } & React.HTMLAttributes<HTMLDivElement>>;
23
+ export default Tooltip;
@@ -1,80 +1,80 @@
1
- import * as React from 'react';
2
-
3
- /**
4
- * ATTRUS Tooltip — typed wrapper over the canonical `.tooltip` system
5
- * (preview/components/tooltip.css). Wraps the trigger in .tooltip-target;
6
- * visibility is pure CSS (:hover / :focus-within) — no JS listeners.
7
- * `rich` enables the larger interactive panel (title/desc/rows blocks).
8
- */
9
-
10
- export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
11
-
12
- export interface TooltipProps extends React.HTMLAttributes<HTMLSpanElement> {
13
- /** Tooltip content — plain label, or rich blocks when rich=true. */
14
- content: React.ReactNode;
15
- placement?: TooltipPlacement;
16
- /** Larger interactive panel (.tooltip-rich) that stays open on hover. */
17
- rich?: boolean;
18
- /** Force-show (testing / controlled cases) — .is-open. */
19
- open?: boolean;
20
- /** Keyboard hint — renders a trailing <kbd> (`.tooltip-kbd`). */
21
- shortcut?: string;
22
- /** The trigger element(s). */
23
- children: React.ReactNode;
24
- }
25
-
26
- export const Tooltip: React.FC<TooltipProps> = ({
27
- content,
28
- placement = 'top',
29
- rich = false,
30
- open = false,
31
- shortcut,
32
- className,
33
- children,
34
- ...rest
35
- }) => {
36
- const tipCls = [
37
- 'tooltip',
38
- `tooltip-${placement}`,
39
- rich ? 'tooltip-rich' : '',
40
- shortcut ? 'tooltip-kbd' : '',
41
- open ? 'is-open' : '',
42
- ]
43
- .filter(Boolean)
44
- .join(' ');
45
- // Escape hides the tooltip while focus stays on the target (doc a11y
46
- // contract); suppression clears on blur or when the pointer re-enters.
47
- const [suppressed, setSuppressed] = React.useState(false);
48
- return (
49
- <span
50
- className={['tooltip-target', suppressed ? 'is-suppressed' : '', className || ''].filter(Boolean).join(' ')}
51
- tabIndex={0}
52
- onKeyDown={(e) => { if (e.key === 'Escape') setSuppressed(true); }}
53
- onBlur={() => setSuppressed(false)}
54
- onMouseEnter={() => setSuppressed(false)}
55
- {...rest}
56
- >
57
- {children}
58
- <span className={tipCls} role="tooltip">
59
- {content}
60
- {shortcut ? <kbd>{shortcut}</kbd> : null}
61
- </span>
62
- </span>
63
- );
64
- };
65
-
66
- /* Rich-panel slots — compose inside `content` with rich=true. */
67
- export const TooltipTitle: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({ className, ...rest }) => (
68
- <div className={['tooltip-title', className || ''].filter(Boolean).join(' ')} {...rest} />
69
- );
70
- export const TooltipDesc: React.FC<React.HTMLAttributes<HTMLParagraphElement>> = ({ className, ...rest }) => (
71
- <p className={['tooltip-desc', className || ''].filter(Boolean).join(' ')} {...rest} />
72
- );
73
- export const TooltipRow: React.FC<{ k: React.ReactNode; v: React.ReactNode } & React.HTMLAttributes<HTMLDivElement>> = ({ k, v, className, ...rest }) => (
74
- <div className={['tooltip-row', className || ''].filter(Boolean).join(' ')} {...rest}>
75
- <span className="k">{k}</span>
76
- <span className="v">{v}</span>
77
- </div>
78
- );
79
-
80
- export default Tooltip;
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * ATTRUS Tooltip — typed wrapper over the canonical `.tooltip` system
5
+ * (preview/components/tooltip.css). Wraps the trigger in .tooltip-target;
6
+ * visibility is pure CSS (:hover / :focus-within) — no JS listeners.
7
+ * `rich` enables the larger interactive panel (title/desc/rows blocks).
8
+ */
9
+
10
+ export type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
11
+
12
+ export interface TooltipProps extends React.HTMLAttributes<HTMLSpanElement> {
13
+ /** Tooltip content — plain label, or rich blocks when rich=true. */
14
+ content: React.ReactNode;
15
+ placement?: TooltipPlacement;
16
+ /** Larger interactive panel (.tooltip-rich) that stays open on hover. */
17
+ rich?: boolean;
18
+ /** Force-show (testing / controlled cases) — .is-open. */
19
+ open?: boolean;
20
+ /** Keyboard hint — renders a trailing <kbd> (`.tooltip-kbd`). */
21
+ shortcut?: string;
22
+ /** The trigger element(s). */
23
+ children: React.ReactNode;
24
+ }
25
+
26
+ export const Tooltip: React.FC<TooltipProps> = ({
27
+ content,
28
+ placement = 'top',
29
+ rich = false,
30
+ open = false,
31
+ shortcut,
32
+ className,
33
+ children,
34
+ ...rest
35
+ }) => {
36
+ const tipCls = [
37
+ 'tooltip',
38
+ `tooltip-${placement}`,
39
+ rich ? 'tooltip-rich' : '',
40
+ shortcut ? 'tooltip-kbd' : '',
41
+ open ? 'is-open' : '',
42
+ ]
43
+ .filter(Boolean)
44
+ .join(' ');
45
+ // Escape hides the tooltip while focus stays on the target (doc a11y
46
+ // contract); suppression clears on blur or when the pointer re-enters.
47
+ const [suppressed, setSuppressed] = React.useState(false);
48
+ return (
49
+ <span
50
+ className={['tooltip-target', suppressed ? 'is-suppressed' : '', className || ''].filter(Boolean).join(' ')}
51
+ tabIndex={0}
52
+ onKeyDown={(e) => { if (e.key === 'Escape') setSuppressed(true); }}
53
+ onBlur={() => setSuppressed(false)}
54
+ onMouseEnter={() => setSuppressed(false)}
55
+ {...rest}
56
+ >
57
+ {children}
58
+ <span className={tipCls} role="tooltip">
59
+ {content}
60
+ {shortcut ? <kbd>{shortcut}</kbd> : null}
61
+ </span>
62
+ </span>
63
+ );
64
+ };
65
+
66
+ /* Rich-panel slots — compose inside `content` with rich=true. */
67
+ export const TooltipTitle: React.FC<React.HTMLAttributes<HTMLDivElement>> = ({ className, ...rest }) => (
68
+ <div className={['tooltip-title', className || ''].filter(Boolean).join(' ')} {...rest} />
69
+ );
70
+ export const TooltipDesc: React.FC<React.HTMLAttributes<HTMLParagraphElement>> = ({ className, ...rest }) => (
71
+ <p className={['tooltip-desc', className || ''].filter(Boolean).join(' ')} {...rest} />
72
+ );
73
+ export const TooltipRow: React.FC<{ k: React.ReactNode; v: React.ReactNode } & React.HTMLAttributes<HTMLDivElement>> = ({ k, v, className, ...rest }) => (
74
+ <div className={['tooltip-row', className || ''].filter(Boolean).join(' ')} {...rest}>
75
+ <span className="k">{k}</span>
76
+ <span className="v">{v}</span>
77
+ </div>
78
+ );
79
+
80
+ export default Tooltip;
@@ -1,17 +1,17 @@
1
- import * as React from 'react';
2
-
3
- export interface ZeroStateProps extends React.HTMLAttributes<HTMLDivElement> {
4
- /** Illustration slot (.empty-illo) — SVG or image. */
5
- illo?: React.ReactNode;
6
- /** Heading (h4). */
7
- title: React.ReactNode;
8
- /** Action row (.empty-actions) — canonical Buttons. */
9
- actions?: React.ReactNode;
10
- /** Dense variant for cards/panels (.empty-compact). */
11
- compact?: boolean;
12
- /** Warning tone — tinted panel (.empty-warning). */
13
- warning?: boolean;
14
- }
15
-
16
- export declare const ZeroState: React.FC<ZeroStateProps>;
17
- export default ZeroState;
1
+ import * as React from 'react';
2
+
3
+ export interface ZeroStateProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ /** Illustration slot (.empty-illo) — SVG or image. */
5
+ illo?: React.ReactNode;
6
+ /** Heading (h4). */
7
+ title: React.ReactNode;
8
+ /** Action row (.empty-actions) — canonical Buttons. */
9
+ actions?: React.ReactNode;
10
+ /** Dense variant for cards/panels (.empty-compact). */
11
+ compact?: boolean;
12
+ /** Warning tone — tinted panel (.empty-warning). */
13
+ warning?: boolean;
14
+ }
15
+
16
+ export declare const ZeroState: React.FC<ZeroStateProps>;
17
+ export default ZeroState;
@@ -1,45 +1,45 @@
1
- import * as React from 'react';
2
-
3
- /**
4
- * ATTRUS ZeroState — typed wrapper over the canonical `.empty` block
5
- * (preview/components/empty-states.css): centered illustration + title +
6
- * body + actions for zero-data surfaces.
7
- * (Module named ZeroState — "EmptyState" collides with the legacy
8
- * ui_kits/dashboard/EmptyState.jsx still consumed by the app.)
9
- */
10
-
11
- export interface ZeroStateProps extends React.HTMLAttributes<HTMLDivElement> {
12
- /** Illustration slot (.empty-illo) — SVG or image. */
13
- illo?: React.ReactNode;
14
- /** Heading (h4). */
15
- title: React.ReactNode;
16
- /** Action row (.empty-actions) — canonical Buttons. */
17
- actions?: React.ReactNode;
18
- /** Dense variant for cards/panels (.empty-compact). */
19
- compact?: boolean;
20
- /** Warning tone — tinted panel (.empty-warning). */
21
- warning?: boolean;
22
- }
23
-
24
- export const ZeroState: React.FC<ZeroStateProps> = ({
25
- illo,
26
- title,
27
- actions,
28
- compact = false,
29
- warning = false,
30
- className,
31
- children,
32
- ...rest
33
- }) => (
34
- <div
35
- className={['empty', compact ? 'empty-compact' : 'empty-default', warning ? 'empty-warning' : '', className || ''].filter(Boolean).join(' ')}
36
- {...rest}
37
- >
38
- {illo != null ? <span className="empty-illo">{illo}</span> : null}
39
- <h4>{title}</h4>
40
- {children != null ? <p>{children}</p> : null}
41
- {actions != null ? <div className="empty-actions">{actions}</div> : null}
42
- </div>
43
- );
44
-
45
- export default ZeroState;
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * ATTRUS ZeroState — typed wrapper over the canonical `.empty` block
5
+ * (preview/components/empty-states.css): centered illustration + title +
6
+ * body + actions for zero-data surfaces.
7
+ * (Module named ZeroState — "EmptyState" collides with the legacy
8
+ * ui_kits/dashboard/EmptyState.jsx still consumed by the app.)
9
+ */
10
+
11
+ export interface ZeroStateProps extends React.HTMLAttributes<HTMLDivElement> {
12
+ /** Illustration slot (.empty-illo) — SVG or image. */
13
+ illo?: React.ReactNode;
14
+ /** Heading (h4). */
15
+ title: React.ReactNode;
16
+ /** Action row (.empty-actions) — canonical Buttons. */
17
+ actions?: React.ReactNode;
18
+ /** Dense variant for cards/panels (.empty-compact). */
19
+ compact?: boolean;
20
+ /** Warning tone — tinted panel (.empty-warning). */
21
+ warning?: boolean;
22
+ }
23
+
24
+ export const ZeroState: React.FC<ZeroStateProps> = ({
25
+ illo,
26
+ title,
27
+ actions,
28
+ compact = false,
29
+ warning = false,
30
+ className,
31
+ children,
32
+ ...rest
33
+ }) => (
34
+ <div
35
+ className={['empty', compact ? 'empty-compact' : 'empty-default', warning ? 'empty-warning' : '', className || ''].filter(Boolean).join(' ')}
36
+ {...rest}
37
+ >
38
+ {illo != null ? <span className="empty-illo">{illo}</span> : null}
39
+ <h4>{title}</h4>
40
+ {children != null ? <p>{children}</p> : null}
41
+ {actions != null ? <div className="empty-actions">{actions}</div> : null}
42
+ </div>
43
+ );
44
+
45
+ export default ZeroState;
@@ -1,35 +1,35 @@
1
- /* ============================================================
2
- @attrus-ds/core/react — typed React component layer.
3
-
4
- These components are thin, typed wrappers over the canonical
5
- ATTRUS / Cabiros CSS (the CSS stays the single visual source of
6
- truth — see ../components). They only compose class names and add
7
- a typed API on top, so the markup-only consumer path stays valid.
8
-
9
- Shipped as TSX source + .d.ts contracts (no bundler): your app's
10
- toolchain compiles them. `react` is a peer dependency.
11
-
12
- Styles are NOT imported here — load them once at your app root:
13
- import "@attrus-ds/core/css";
14
- ============================================================ */
15
-
16
- export * from "./AppSidebar/AppSidebar";
17
- export * from "./AppTopbar/AppTopbar";
18
- export * from "./Atoms/Atoms";
19
- export * from "./Button/Button";
20
- export * from "./Callout/Callout";
21
- export * from "./Card/Card";
22
- export * from "./Combobox/Combobox";
23
- export * from "./DataTable/DataTable";
24
- export * from "./Drawer/Drawer";
25
- export * from "./Input/Input";
26
- export * from "./Modal/Modal";
27
- export * from "./NumberInput/NumberInput";
28
- export * from "./Pill/Pill";
29
- export * from "./SearchPill/SearchPill";
30
- export * from "./SmartSearch/SmartSearch";
31
- export * from "./Stepper/Stepper";
32
- export * from "./Tabs/Tabs";
33
- export * from "./Toast/Toast";
34
- export * from "./Tooltip/Tooltip";
35
- export * from "./ZeroState/ZeroState";
1
+ /* ============================================================
2
+ @attrus-ds/core/react — typed React component layer.
3
+
4
+ These components are thin, typed wrappers over the canonical
5
+ ATTRUS / Cabiros CSS (the CSS stays the single visual source of
6
+ truth — see ../components). They only compose class names and add
7
+ a typed API on top, so the markup-only consumer path stays valid.
8
+
9
+ Shipped as TSX source + .d.ts contracts (no bundler): your app's
10
+ toolchain compiles them. `react` is a peer dependency.
11
+
12
+ Styles are NOT imported here — load them once at your app root:
13
+ import "@attrus-ds/core/css";
14
+ ============================================================ */
15
+
16
+ export * from "./AppSidebar/AppSidebar";
17
+ export * from "./AppTopbar/AppTopbar";
18
+ export * from "./Atoms/Atoms";
19
+ export * from "./Button/Button";
20
+ export * from "./Callout/Callout";
21
+ export * from "./Card/Card";
22
+ export * from "./Combobox/Combobox";
23
+ export * from "./DataTable/DataTable";
24
+ export * from "./Drawer/Drawer";
25
+ export * from "./Input/Input";
26
+ export * from "./Modal/Modal";
27
+ export * from "./NumberInput/NumberInput";
28
+ export * from "./Pill/Pill";
29
+ export * from "./SearchPill/SearchPill";
30
+ export * from "./SmartSearch/SmartSearch";
31
+ export * from "./Stepper/Stepper";
32
+ export * from "./Tabs/Tabs";
33
+ export * from "./Toast/Toast";
34
+ export * from "./Tooltip/Tooltip";
35
+ export * from "./ZeroState/ZeroState";