@gtivr4/a1-design-system-react 0.1.0 → 0.2.4

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 (111) hide show
  1. package/guidelines/Guidelines.md +228 -0
  2. package/package.json +4 -1
  3. package/src/breakpoints.css +29 -0
  4. package/src/color-scheme.css +586 -24
  5. package/src/components/accordion/Accordion.jsx +80 -0
  6. package/src/components/accordion/accordion.css +118 -0
  7. package/src/components/banner/Banner.jsx +66 -0
  8. package/src/components/banner/banner.css +205 -0
  9. package/src/components/bleed/Bleed.jsx +27 -0
  10. package/src/components/bleed/bleed.css +5 -0
  11. package/src/components/blockquote/Blockquote.jsx +40 -0
  12. package/src/components/blockquote/blockquote.css +166 -0
  13. package/src/components/breadcrumb/Breadcrumb.jsx +82 -0
  14. package/src/components/breadcrumb/breadcrumb.css +133 -0
  15. package/src/components/button/button.css +42 -12
  16. package/src/components/button-container/ButtonContainer.jsx +20 -1
  17. package/src/components/button-container/button-container.css +19 -1
  18. package/src/components/calendar/Calendar.jsx +383 -0
  19. package/src/components/calendar/calendar.css +225 -0
  20. package/src/components/card/Card.jsx +50 -12
  21. package/src/components/card/card.css +178 -14
  22. package/src/components/checkbox-group/CheckboxGroup.jsx +120 -0
  23. package/src/components/checkbox-group/checkbox-group.css +304 -0
  24. package/src/components/cluster/Cluster.jsx +52 -0
  25. package/src/components/cluster/cluster.css +9 -0
  26. package/src/components/code/Code.jsx +135 -0
  27. package/src/components/code/code.css +60 -0
  28. package/src/components/data-table/DataTable.jsx +721 -0
  29. package/src/components/data-table/DataTableFilters.jsx +339 -0
  30. package/src/components/data-table/data-table-filters.css +259 -0
  31. package/src/components/data-table/data-table.css +425 -0
  32. package/src/components/dialog/Dialog.jsx +45 -2
  33. package/src/components/dialog/dialog.css +13 -4
  34. package/src/components/divider/Divider.jsx +64 -0
  35. package/src/components/divider/divider.css +170 -0
  36. package/src/components/field/CreditCardField.jsx +131 -0
  37. package/src/components/field/DateField.jsx +11 -0
  38. package/src/components/field/NumberField.jsx +11 -0
  39. package/src/components/field/PhoneField.jsx +107 -0
  40. package/src/components/field/SelectField.jsx +86 -0
  41. package/src/components/field/TextField.jsx +83 -0
  42. package/src/components/field/TextareaField.jsx +147 -0
  43. package/src/components/field/TimeField.jsx +11 -0
  44. package/src/components/field/ZipField.jsx +114 -0
  45. package/src/components/field/credit-card.css +30 -0
  46. package/src/components/field/field.css +380 -0
  47. package/src/components/field/textarea-field.css +185 -0
  48. package/src/components/field-row/FieldRow.jsx +23 -0
  49. package/src/components/field-row/field-row.css +51 -0
  50. package/src/components/fieldset/Fieldset.jsx +49 -0
  51. package/src/components/fieldset/fieldset.css +75 -0
  52. package/src/components/figure/Figure.jsx +63 -0
  53. package/src/components/figure/figure.css +97 -0
  54. package/src/components/grid/Grid.jsx +36 -2
  55. package/src/components/grid/grid.css +129 -4
  56. package/src/components/heading/Heading.jsx +41 -1
  57. package/src/components/heading/heading.css +65 -4
  58. package/src/components/icon/icon.css +1 -0
  59. package/src/components/icon-button/icon-button.css +1 -0
  60. package/src/components/inline/inline.css +51 -0
  61. package/src/components/inline-editable/InlineEditable.jsx +77 -0
  62. package/src/components/inline-editable/inline-editable.css +47 -0
  63. package/src/components/inset/Inset.jsx +27 -0
  64. package/src/components/inset/inset.css +6 -0
  65. package/src/components/labels/Labels.jsx +5 -5
  66. package/src/components/link/Link.jsx +2 -3
  67. package/src/components/link/link.css +30 -1
  68. package/src/components/list/List.jsx +92 -0
  69. package/src/components/list/list.css +178 -0
  70. package/src/components/menu/Menu.jsx +243 -10
  71. package/src/components/menu/menu.css +157 -17
  72. package/src/components/message/Message.jsx +25 -50
  73. package/src/components/message/message.css +50 -33
  74. package/src/components/notification/Notification.jsx +1 -1
  75. package/src/components/page-layout/PageLayout.jsx +16 -1
  76. package/src/components/page-layout/page-layout.css +97 -4
  77. package/src/components/page-nav/PageNav.jsx +110 -0
  78. package/src/components/page-nav/page-nav.css +167 -0
  79. package/src/components/paragraph/Paragraph.jsx +35 -2
  80. package/src/components/paragraph/paragraph.css +38 -1
  81. package/src/components/radio-group/RadioGroup.jsx +121 -0
  82. package/src/components/radio-group/radio-group.css +268 -0
  83. package/src/components/section/Section.jsx +108 -0
  84. package/src/components/section/section.css +280 -0
  85. package/src/components/segmented-control/SegmentedControl.jsx +4 -0
  86. package/src/components/segmented-control/segmented.css +13 -0
  87. package/src/components/side-nav/SideNav.jsx +29 -9
  88. package/src/components/side-nav/scrim.css +1 -1
  89. package/src/components/side-nav/side-nav.css +70 -32
  90. package/src/components/snackbar/Snackbar.jsx +56 -0
  91. package/src/components/snackbar/snackbar.css +113 -0
  92. package/src/components/spacer/Spacer.jsx +36 -0
  93. package/src/components/spacer/spacer.css +44 -0
  94. package/src/components/stack/Stack.jsx +100 -0
  95. package/src/components/stack/stack.css +37 -0
  96. package/src/components/switch/Switch.jsx +114 -0
  97. package/src/components/switch/switch.css +276 -0
  98. package/src/components/system-banner/SystemBanner.jsx +57 -0
  99. package/src/components/system-banner/system-banner.css +118 -0
  100. package/src/components/tabs/Tabs.jsx +96 -28
  101. package/src/components/tabs/tabs.css +352 -15
  102. package/src/components/token-select/TokenSelect.jsx +159 -0
  103. package/src/components/token-select/token-select.css +110 -0
  104. package/src/components/top-header/TopHeader.jsx +641 -0
  105. package/src/components/top-header/top-header.css +337 -0
  106. package/src/illustrations/ComponentThumbnails.jsx +227 -0
  107. package/src/index.js +41 -5
  108. package/src/themes.css +256 -5
  109. package/src/tokens.css +919 -0
  110. package/src/utilities/spacing.css +8 -0
  111. package/src/utilities/sr-only.css +16 -0
@@ -0,0 +1,228 @@
1
+ # A1 Design System — Guidelines Hub
2
+
3
+ Design system package: `@gtivr4/a1-design-system-react`
4
+
5
+ ---
6
+
7
+ ## Reading order
8
+
9
+ Always read first:
10
+ - `Guidelines.md` — this file; the main hub and entry point
11
+ - `tokens.md` — foundational design tokens (color, typography, spacing); also covers required CSS imports and theming
12
+
13
+ Read on-demand:
14
+ - `components.md` — read BEFORE using any design-system component
15
+ - `icon-discovery.md` — read BEFORE using any icons
16
+ - `styles.md` — read when building page layouts or applying custom spacing
17
+
18
+ ---
19
+
20
+ ## Companion guideline files
21
+
22
+ These files live alongside `Guidelines.md` in the `/guidelines/` directory and should be consulted for their respective focus areas when building UIs with this design system.
23
+
24
+ | File | Focus |
25
+ |---|---|
26
+ | `components.md` | Component imports, props/API surfaces, variants, composition patterns, and usage examples |
27
+ | `icon-discovery.md` | Icon naming convention, import path, available sizes, and how to search for icons |
28
+ | `tokens.md` | Design tokens, color/typography/shadow/border tokens, theming, and CSS custom properties |
29
+ | `styles.md` | Spacing scales, layout primitives, responsive patterns, and CSS methodology |
30
+ | `setup.md` | Project setup instructions, provider configuration, required CSS imports, and peer dependency requirements |
31
+
32
+ ---
33
+
34
+ ## Quick-start checklist
35
+
36
+ 1. **Install**: `pnpm add @gtivr4/a1-design-system-react`
37
+ 2. **Import CSS** at your app entry point — **all four imports are required**:
38
+ ```ts
39
+ import "@gtivr4/a1-design-system-react/tokens.css";
40
+ import "@gtivr4/a1-design-system-react/themes.css";
41
+ import "@gtivr4/a1-design-system-react/color-scheme.css";
42
+ ```
43
+ - `tokens.css` — base `:root` design tokens (spacing, shadows, radii, component dimensions, colors). **Must be first.**
44
+ - `themes.css` — theme-selector overrides (heritage, accessible, etc.).
45
+ - `color-scheme.css` — dark-mode inverse surface tokens and global box-model reset.
46
+ 3. **Load Material Symbols font** in `/src/styles/fonts.css`:
47
+ ```css
48
+ @import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');
49
+ ```
50
+ 4. **Import components**:
51
+ ```ts
52
+ import { Button, Card, Heading, Paragraph } from "@gtivr4/a1-design-system-react";
53
+ ```
54
+ 5. **Optionally import spacing utilities**:
55
+ ```ts
56
+ import "@gtivr4/a1-design-system-react/utilities/spacing.css";
57
+ ```
58
+ 6. **Configure PostCSS** (required for responsive Grid, Stack breakpoints, and other components). Add a `postcss.config.mjs` at your project root:
59
+ ```js
60
+ import postcssGlobalData from "@csstools/postcss-global-data";
61
+ import postcssCustomMedia from "postcss-custom-media";
62
+ import { createRequire } from "module";
63
+ const require = createRequire(import.meta.url);
64
+ const breakpoints = require.resolve("@gtivr4/a1-design-system-react/breakpoints.css");
65
+ export default {
66
+ plugins: [
67
+ postcssGlobalData({ files: [breakpoints] }),
68
+ postcssCustomMedia(),
69
+ ],
70
+ };
71
+ ```
72
+ Install the PostCSS dependencies: `pnpm add -D postcss-custom-media @csstools/postcss-global-data`
73
+
74
+ ---
75
+
76
+ ## All exported components
77
+
78
+ Every named export from `@gtivr4/a1-design-system-react` — verified against `src/index.js`:
79
+
80
+ ### Layout
81
+
82
+ > **Always prefer these over raw `<div style={{ display: "flex" }}>` or custom CSS.** Check this table before writing any layout CSS.
83
+
84
+ | Component(s) | Notes |
85
+ |---|---|
86
+ | `Stack` | Flex column or row; `direction`, `gap`, `align`, `justify`, `wrap`, `as`. Use instead of `<div style={{ display: "flex" }}>`. |
87
+ | `Inset` | Padding wrapper; `space`, `block`, `inline`, `as`. Use instead of `<div style={{ padding: "..." }}>`. |
88
+ | `Section` | Page section with surface/padding/gradient; `padding`, `surface`, `gradient`, `contentWidth`, `height`, `inverse`, `as` |
89
+ | `Cluster` | Wrapping flex row for inline groups of elements |
90
+ | `Grid` / `GridItem` | Responsive CSS grid; `columns`, `gap` (on Grid); `span`, `rowSpan` (on GridItem) |
91
+ | `Bleed` | Negative-margin breakout for full-width elements inside constrained content |
92
+ | `Spacer` | Empty space block; `size` |
93
+ | `Inverse` | Activates dark/inverted color context on its subtree without changing the global theme |
94
+ | `PageLayout` | Full-page shell; `header`, `footer`, `sidebar`, `sidebarPlacement`, `stickyHeader` |
95
+ | `ButtonContainer` | Aligns a row of buttons; `align="start\|center\|end"` |
96
+ | `Figure` | Captioned media wrapper; `caption`, `ratio` |
97
+
98
+ ### Actions
99
+
100
+ | Component(s) | Notes |
101
+ |---|---|
102
+ | `Button` | `variant="primary\|secondary\|tertiary\|destructive\|success"`, `size="sm\|md\|lg"`, `icon`, `iconPosition`, `as` |
103
+ | `IconButton` | Icon-only button; requires `label` (aria); `icon`, `variant`, `size`, `disabled` |
104
+ | `Switch` | Toggle switch; `checked`, `onChange`, `label`, `disabled` |
105
+
106
+ ### Navigation
107
+
108
+ | Component(s) | Notes |
109
+ |---|---|
110
+ | `TopHeader` | App header with nav and actions; `logoText`, `logo`, `logoHref`, `navItems`, `actions`, `loginButton`. Do not hand-roll a header — use this. |
111
+ | `SideNav` / `SideNavItem` / `SideNavGroup` | Collapsible sidebar; supports controlled and uncontrolled group state |
112
+ | `Tabs` / `TabList` / `Tab` / `TabPanel` | Controlled; `value`, `onChange`, `variant`, `level` |
113
+ | `Breadcrumb` | `items` array with `label` and `href` |
114
+ | `PageNav` | In-page anchor navigation |
115
+ | `Pagination` | Controlled; `page`, `totalPages`, `onChange`, `siblings`, `size` |
116
+ | `SegmentedControl` | Controlled radio group; `options`, `value`, `onChange`, `fullWidth` |
117
+ | `Link` | `as`, `size`, `weight`, `icon`, `iconPosition` |
118
+
119
+ ### Inputs
120
+
121
+ > Do not use raw `<input>`, `<select>`, or `<textarea>` elements. Always use the field components below.
122
+
123
+ | Component(s) | Notes |
124
+ |---|---|
125
+ | `TextField` | Text, email, search, password, number, etc.; `label`, `hint`, `error`, `size`, `required`, `disabled`, `readOnly`, `type` |
126
+ | `SelectField` | Dropdown select; `label`, `hint`, `error`, `options`, `size`, `required` |
127
+ | `TextareaField` | Multi-line text; `label`, `hint`, `error`, `size`, `required` |
128
+ | `CheckboxGroup` | Group of checkboxes; `legend`, `options`, `value`, `onChange`, `size` |
129
+ | `RadioGroup` | Group of radio buttons; `legend`, `options`, `value`, `onChange`, `size` |
130
+ | `Fieldset` | Groups related fields with a legend; `legend`, `size`, `labelPosition` |
131
+ | `FieldRow` | Lays out fields horizontally |
132
+ | `DateField` | Date input with formatting |
133
+ | `NumberField` | Numeric input with formatting |
134
+ | `PhoneField` | US phone number with mask |
135
+ | `ZipField` | ZIP code with mask |
136
+ | `CreditCardField` | Credit card number with mask |
137
+ | `TimeField` | Time input |
138
+ | `InlineEditable` | Click-to-edit text field |
139
+
140
+ ### Typography
141
+
142
+ | Component(s) | Notes |
143
+ |---|---|
144
+ | `Heading` | `as`, `type="heading\|display"`, `size`, `color`, `align`, `margin` |
145
+ | `Paragraph` | `as`, `size`, `color`, `align` |
146
+ | `Blockquote` | Styled quotation block |
147
+ | `List` / `ListItem` | `List`: `variant="unordered\|ordered\|icon\|divider"`, `size`, `color`, `icon`. `ListItem`: `icon` (overrides list icon). Always use these instead of raw `<ul>/<li>`. |
148
+ | `Code` | Inline or block code; `variant="inline\|block"`, `wrapping`, `copyCode` |
149
+ | `Divider` | Horizontal rule |
150
+ | `Icon` | Material Symbols ligature; `name`, `fill`, `weight`, `grade`, `opticalSize`. Verify icon names in `icon-discovery.md` — never guess. |
151
+
152
+ ### Feedback
153
+
154
+ | Component(s) | Notes |
155
+ |---|---|
156
+ | `Banner` | Inline status banner; `status`, `title`, `icon`, `onDismiss` |
157
+ | `MessageBadge` | Inline status chip; `status="neutral\|info\|success\|warn\|error"`, `subtle` (boolean), `size`, `icon`. Note: `subtle` is a boolean prop — do not use `variant="subtle"`. |
158
+ | `MessageEmptyState` | Empty state block; `scale="page\|section\|card"`, `icon`, `title`, `description`, `action` |
159
+ | `Notification` | Badge wrapper; `count`, `label`, `dot`, `variant`, `position`, `max` |
160
+ | `Snackbar` | Toast notification; `open`, `onClose`, `message`, `action` |
161
+ | `SystemBanner` | Full-width system alert; `status`, `title`, `message`, `onDismiss` |
162
+
163
+ ### Overlay
164
+
165
+ | Component(s) | Notes |
166
+ |---|---|
167
+ | `Dialog` | Native `<dialog>`; `open`, `onClose`, `title`, `footer` |
168
+ | `Menu` / `MenuSection` / `MenuItem` | Dropdown menu; `open`, `onClose`, `aria-label` on Menu; `icon`, `href`, `variant`, `onClick` on MenuItem |
169
+
170
+ ### Data and disclosure
171
+
172
+ | Component(s) | Notes |
173
+ |---|---|
174
+ | `DataTable` / `DataTableFilters` | Tabular data with sorting and filtering |
175
+ | `Calendar` | Date display; `variant="scroll\|paginated"`, `initialMonth`, `monthsToShow`, `highlightToday`, `dimPast` |
176
+ | `Accordion` | Disclosure component; `items` with `title` and `content` |
177
+
178
+ ### Utility
179
+
180
+ | Component(s) | Notes |
181
+ |---|---|
182
+ | `LabelsProvider` / `useLabel` | i18n/brand label resolution; wrap at app root |
183
+
184
+ ---
185
+
186
+ ## Before using a component
187
+
188
+ 1. Check `components.md` for the component's import path, props, and variants.
189
+ 2. Use the component's own props (`variant`, `size`, `icon`, etc.) rather than overriding its CSS classes.
190
+ 3. Use `--semantic-color-*` and `--base-spacing-*` CSS custom properties for any surrounding custom styles.
191
+
192
+ ---
193
+
194
+ ## Before using an icon
195
+
196
+ 1. Check `icon-discovery.md` for available icons.
197
+ 2. Do NOT guess icon names — verify the icon exists first.
198
+ 3. If an icon doesn't exist, pick a different one and verify.
199
+
200
+ ---
201
+
202
+ ## Theming
203
+
204
+ | Class on `<html>` | Effect |
205
+ |---|---|
206
+ | (none) | Default A1 light theme |
207
+ | `.a1-theme-dark` | Global dark mode |
208
+ | `.a1-theme-light` | Force light mode (inside dark) |
209
+ | `.a1-theme-heritage` | Warm neutral / editorial theme |
210
+ | `.a1-theme-accessible` | Larger sizes, filled icons |
211
+
212
+ Wrap any section in `<Inverse>` to render it in the inverted (dark) color context without changing the global theme.
213
+
214
+ ---
215
+
216
+ ## Key rules
217
+
218
+ - **Use layout components before custom CSS.** Before writing `display: flex`, `display: grid`, `gap`, or `padding` as inline styles, check `Stack`, `Inset`, `Section`, `Cluster`, `Grid`, and `PageLayout` first. Custom layout CSS is a last resort.
219
+ - **Never use raw `<input>`, `<select>`, `<textarea>`, `<ul>`, or `<li>`.** Always use the corresponding design-system component.
220
+ - **Never shadow a design-system import with a local function of the same name.** If you need a custom header, name it `AppHeader`, not `TopHeader`.
221
+ - Always check `components.md` before creating any UI element — use the design-system component if one exists.
222
+ - Use `--semantic-color-*` tokens for color; never hard-code hex values.
223
+ - Use `--base-spacing-{n}` tokens for spacing; stick to the defined scale.
224
+ - Icons use Material Symbols ligature names (snake_case strings). Never invent names — always verify in `icon-discovery.md`.
225
+ - The `Heading` component supports `type="heading"` and `type="display"` — choose the right scale.
226
+ - `Dialog` and `Menu` use the native `<dialog>` element; always provide `open` + `onClose`.
227
+ - `PageLayout` is the correct shell for full-page layouts — don't hand-roll header/sidebar/footer structure.
228
+ - `MessageBadge` uses `subtle` (a boolean prop), not `variant="subtle"`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gtivr4/a1-design-system-react",
3
- "version": "0.1.0",
3
+ "version": "0.2.4",
4
4
  "description": "React components for the A1 token-driven design system.",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
@@ -15,6 +15,7 @@
15
15
  ],
16
16
  "files": [
17
17
  "README.md",
18
+ "guidelines/**/*.md",
18
19
  "src/**/*.css",
19
20
  "src/**/*.jsx",
20
21
  "src/index.js",
@@ -26,7 +27,9 @@
26
27
  ],
27
28
  "exports": {
28
29
  ".": "./src/index.js",
30
+ "./tokens.css": "./src/tokens.css",
29
31
  "./themes.css": "./src/themes.css",
32
+ "./breakpoints.css": "./src/breakpoints.css",
30
33
  "./color-scheme.css": "./src/color-scheme.css",
31
34
  "./utilities/spacing.css": "./src/utilities/spacing.css",
32
35
  "./components/*": "./src/components/*"
@@ -0,0 +1,29 @@
1
+ /* ─── Breakpoints ─────────────────────────────────────────────────────────────
2
+ Generated from system/tokens/breakpoint.json via Style Dictionary.
3
+ @custom-media rules follow the CSS Media Queries Level 5 draft.
4
+ Use postcss-custom-media to expand these at build time, or reference
5
+ the --breakpoint-* CSS custom properties in JavaScript.
6
+ ─────────────────────────────────────────────────────────────────────────── */
7
+
8
+ /* XS — up to 480px */
9
+ @custom-media --bp-xs (max-width: 480px);
10
+ @custom-media --bp-xs-down (max-width: 480px);
11
+
12
+ /* SM — 481px – 640px */
13
+ @custom-media --bp-sm (min-width: 481px) and (max-width: 640px);
14
+ @custom-media --bp-sm-up (min-width: 481px);
15
+ @custom-media --bp-sm-down (max-width: 640px);
16
+
17
+ /* MD — 641px – 1024px */
18
+ @custom-media --bp-md (min-width: 641px) and (max-width: 1024px);
19
+ @custom-media --bp-md-up (min-width: 641px);
20
+ @custom-media --bp-md-down (max-width: 1024px);
21
+
22
+ /* LG — 1025px – 1440px */
23
+ @custom-media --bp-lg (min-width: 1025px) and (max-width: 1440px);
24
+ @custom-media --bp-lg-up (min-width: 1025px);
25
+ @custom-media --bp-lg-down (max-width: 1440px);
26
+
27
+ /* XL — 1441px and above */
28
+ @custom-media --bp-xl (min-width: 1441px);
29
+ @custom-media --bp-xl-up (min-width: 1441px);