atlas-react-kit 0.4.1 → 0.6.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/COMPONENTS.md +135 -41
- package/DESIGN_RULES.md +79 -20
- package/README.md +60 -11
- package/dist/accordion.d.ts +8 -0
- package/dist/accordion.js +20 -0
- package/dist/alert.d.ts +19 -0
- package/dist/alert.js +37 -0
- package/dist/avatar.d.ts +9 -0
- package/dist/avatar.js +16 -0
- package/dist/badge.d.ts +2 -2
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.d.ts +16 -0
- package/dist/breadcrumb.js +33 -0
- package/dist/button.d.ts +6 -5
- package/dist/button.js +7 -6
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +20 -2
- package/dist/checkbox.js +1 -1
- package/dist/color-legend.d.ts +22 -0
- package/dist/color-legend.js +11 -0
- package/dist/combobox.d.ts +4 -1
- package/dist/combobox.js +11 -5
- package/dist/date-picker.js +14 -3
- package/dist/date-time-picker.d.ts +36 -0
- package/dist/date-time-picker.js +105 -0
- package/dist/dropdown-menu.d.ts +26 -0
- package/dist/dropdown-menu.js +56 -0
- package/dist/error-boundary.d.ts +1 -1
- package/dist/field.js +1 -1
- package/dist/form/date-time-picker-field.d.ts +16 -0
- package/dist/form/date-time-picker-field.js +12 -0
- package/dist/form/markdown-field.d.ts +17 -0
- package/dist/form/markdown-field.js +26 -0
- package/dist/form/text-field.d.ts +7 -1
- package/dist/form/text-field.js +3 -3
- package/dist/info-tip.d.ts +27 -0
- package/dist/info-tip.js +63 -0
- package/dist/input.js +1 -1
- package/dist/internal/form-control.d.ts +1 -1
- package/dist/internal/form-control.js +1 -1
- package/dist/internal/tabs-styles.js +3 -3
- package/dist/markdown.d.ts +18 -0
- package/dist/markdown.js +62 -0
- package/dist/meter.d.ts +22 -0
- package/dist/meter.js +17 -0
- package/dist/pagination.d.ts +18 -0
- package/dist/pagination.js +35 -0
- package/dist/progress.d.ts +8 -0
- package/dist/progress.js +13 -0
- package/dist/radio-group.d.ts +13 -0
- package/dist/radio-group.js +20 -0
- package/dist/search-picker.d.ts +30 -0
- package/dist/search-picker.js +100 -0
- package/dist/select.js +2 -2
- package/dist/slider.d.ts +20 -0
- package/dist/slider.js +20 -0
- package/dist/spinner.d.ts +8 -0
- package/dist/spinner.js +13 -0
- package/dist/stat-tile.d.ts +21 -0
- package/dist/stat-tile.js +17 -0
- package/dist/switch.d.ts +9 -0
- package/dist/switch.js +14 -0
- package/dist/table.d.ts +2 -0
- package/dist/table.js +26 -2
- package/dist/tabs.d.ts +6 -3
- package/dist/tabs.js +5 -2
- package/dist/textarea.js +1 -1
- package/dist/theme-provider.d.ts +2 -1
- package/dist/theme-provider.js +28 -4
- package/dist/toggle-group.js +2 -2
- package/dist/toggle.d.ts +11 -1
- package/dist/toggle.js +13 -3
- package/dist/tooltip.d.ts +15 -0
- package/dist/tooltip.js +26 -0
- package/package.json +92 -5
- package/skills/atlas-react-kit/SKILL.md +148 -0
- package/theme.css +28 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atlas-react-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Shared React components and Tailwind theme for Atlas",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,16 +13,33 @@
|
|
|
13
13
|
"theme.css",
|
|
14
14
|
"DESIGN_RULES.md",
|
|
15
15
|
"COMPONENTS.md",
|
|
16
|
-
"NOTICE"
|
|
16
|
+
"NOTICE",
|
|
17
|
+
"skills"
|
|
17
18
|
],
|
|
18
19
|
"sideEffects": [
|
|
19
20
|
"**/*.css"
|
|
20
21
|
],
|
|
21
22
|
"exports": {
|
|
23
|
+
"./accordion": {
|
|
24
|
+
"types": "./dist/accordion.d.ts",
|
|
25
|
+
"default": "./dist/accordion.js"
|
|
26
|
+
},
|
|
27
|
+
"./alert": {
|
|
28
|
+
"types": "./dist/alert.d.ts",
|
|
29
|
+
"default": "./dist/alert.js"
|
|
30
|
+
},
|
|
31
|
+
"./avatar": {
|
|
32
|
+
"types": "./dist/avatar.d.ts",
|
|
33
|
+
"default": "./dist/avatar.js"
|
|
34
|
+
},
|
|
22
35
|
"./badge": {
|
|
23
36
|
"types": "./dist/badge.d.ts",
|
|
24
37
|
"default": "./dist/badge.js"
|
|
25
38
|
},
|
|
39
|
+
"./breadcrumb": {
|
|
40
|
+
"types": "./dist/breadcrumb.d.ts",
|
|
41
|
+
"default": "./dist/breadcrumb.js"
|
|
42
|
+
},
|
|
26
43
|
"./button": {
|
|
27
44
|
"types": "./dist/button.d.ts",
|
|
28
45
|
"default": "./dist/button.js"
|
|
@@ -39,6 +56,10 @@
|
|
|
39
56
|
"types": "./dist/checkbox.d.ts",
|
|
40
57
|
"default": "./dist/checkbox.js"
|
|
41
58
|
},
|
|
59
|
+
"./color-legend": {
|
|
60
|
+
"types": "./dist/color-legend.d.ts",
|
|
61
|
+
"default": "./dist/color-legend.js"
|
|
62
|
+
},
|
|
42
63
|
"./combobox": {
|
|
43
64
|
"types": "./dist/combobox.d.ts",
|
|
44
65
|
"default": "./dist/combobox.js"
|
|
@@ -47,10 +68,18 @@
|
|
|
47
68
|
"types": "./dist/date-picker.d.ts",
|
|
48
69
|
"default": "./dist/date-picker.js"
|
|
49
70
|
},
|
|
71
|
+
"./date-time-picker": {
|
|
72
|
+
"types": "./dist/date-time-picker.d.ts",
|
|
73
|
+
"default": "./dist/date-time-picker.js"
|
|
74
|
+
},
|
|
50
75
|
"./dialog": {
|
|
51
76
|
"types": "./dist/dialog.d.ts",
|
|
52
77
|
"default": "./dist/dialog.js"
|
|
53
78
|
},
|
|
79
|
+
"./dropdown-menu": {
|
|
80
|
+
"types": "./dist/dropdown-menu.d.ts",
|
|
81
|
+
"default": "./dist/dropdown-menu.js"
|
|
82
|
+
},
|
|
54
83
|
"./empty-panel": {
|
|
55
84
|
"types": "./dist/empty-panel.d.ts",
|
|
56
85
|
"default": "./dist/empty-panel.js"
|
|
@@ -63,6 +92,10 @@
|
|
|
63
92
|
"types": "./dist/field.d.ts",
|
|
64
93
|
"default": "./dist/field.js"
|
|
65
94
|
},
|
|
95
|
+
"./info-tip": {
|
|
96
|
+
"types": "./dist/info-tip.d.ts",
|
|
97
|
+
"default": "./dist/info-tip.js"
|
|
98
|
+
},
|
|
66
99
|
"./input": {
|
|
67
100
|
"types": "./dist/input.d.ts",
|
|
68
101
|
"default": "./dist/input.js"
|
|
@@ -71,10 +104,34 @@
|
|
|
71
104
|
"types": "./dist/label.d.ts",
|
|
72
105
|
"default": "./dist/label.js"
|
|
73
106
|
},
|
|
107
|
+
"./markdown": {
|
|
108
|
+
"types": "./dist/markdown.d.ts",
|
|
109
|
+
"default": "./dist/markdown.js"
|
|
110
|
+
},
|
|
111
|
+
"./meter": {
|
|
112
|
+
"types": "./dist/meter.d.ts",
|
|
113
|
+
"default": "./dist/meter.js"
|
|
114
|
+
},
|
|
115
|
+
"./pagination": {
|
|
116
|
+
"types": "./dist/pagination.d.ts",
|
|
117
|
+
"default": "./dist/pagination.js"
|
|
118
|
+
},
|
|
74
119
|
"./popover": {
|
|
75
120
|
"types": "./dist/popover.d.ts",
|
|
76
121
|
"default": "./dist/popover.js"
|
|
77
122
|
},
|
|
123
|
+
"./progress": {
|
|
124
|
+
"types": "./dist/progress.d.ts",
|
|
125
|
+
"default": "./dist/progress.js"
|
|
126
|
+
},
|
|
127
|
+
"./radio-group": {
|
|
128
|
+
"types": "./dist/radio-group.d.ts",
|
|
129
|
+
"default": "./dist/radio-group.js"
|
|
130
|
+
},
|
|
131
|
+
"./search-picker": {
|
|
132
|
+
"types": "./dist/search-picker.d.ts",
|
|
133
|
+
"default": "./dist/search-picker.js"
|
|
134
|
+
},
|
|
78
135
|
"./select": {
|
|
79
136
|
"types": "./dist/select.d.ts",
|
|
80
137
|
"default": "./dist/select.js"
|
|
@@ -87,14 +144,30 @@
|
|
|
87
144
|
"types": "./dist/skeleton.d.ts",
|
|
88
145
|
"default": "./dist/skeleton.js"
|
|
89
146
|
},
|
|
90
|
-
"./
|
|
91
|
-
"types": "./dist/
|
|
92
|
-
"default": "./dist/
|
|
147
|
+
"./slider": {
|
|
148
|
+
"types": "./dist/slider.d.ts",
|
|
149
|
+
"default": "./dist/slider.js"
|
|
93
150
|
},
|
|
94
151
|
"./sonner": {
|
|
95
152
|
"types": "./dist/sonner.d.ts",
|
|
96
153
|
"default": "./dist/sonner.js"
|
|
97
154
|
},
|
|
155
|
+
"./sortable-table-head": {
|
|
156
|
+
"types": "./dist/sortable-table-head.d.ts",
|
|
157
|
+
"default": "./dist/sortable-table-head.js"
|
|
158
|
+
},
|
|
159
|
+
"./spinner": {
|
|
160
|
+
"types": "./dist/spinner.d.ts",
|
|
161
|
+
"default": "./dist/spinner.js"
|
|
162
|
+
},
|
|
163
|
+
"./stat-tile": {
|
|
164
|
+
"types": "./dist/stat-tile.d.ts",
|
|
165
|
+
"default": "./dist/stat-tile.js"
|
|
166
|
+
},
|
|
167
|
+
"./switch": {
|
|
168
|
+
"types": "./dist/switch.d.ts",
|
|
169
|
+
"default": "./dist/switch.js"
|
|
170
|
+
},
|
|
98
171
|
"./table": {
|
|
99
172
|
"types": "./dist/table.d.ts",
|
|
100
173
|
"default": "./dist/table.js"
|
|
@@ -123,10 +196,18 @@
|
|
|
123
196
|
"types": "./dist/toggle-group.d.ts",
|
|
124
197
|
"default": "./dist/toggle-group.js"
|
|
125
198
|
},
|
|
199
|
+
"./tooltip": {
|
|
200
|
+
"types": "./dist/tooltip.d.ts",
|
|
201
|
+
"default": "./dist/tooltip.js"
|
|
202
|
+
},
|
|
126
203
|
"./form/date-picker-field": {
|
|
127
204
|
"types": "./dist/form/date-picker-field.d.ts",
|
|
128
205
|
"default": "./dist/form/date-picker-field.js"
|
|
129
206
|
},
|
|
207
|
+
"./form/date-time-picker-field": {
|
|
208
|
+
"types": "./dist/form/date-time-picker-field.d.ts",
|
|
209
|
+
"default": "./dist/form/date-time-picker-field.js"
|
|
210
|
+
},
|
|
130
211
|
"./form/field-error": {
|
|
131
212
|
"types": "./dist/form/field-error.d.ts",
|
|
132
213
|
"default": "./dist/form/field-error.js"
|
|
@@ -135,6 +216,10 @@
|
|
|
135
216
|
"types": "./dist/form/feedback-field.d.ts",
|
|
136
217
|
"default": "./dist/form/feedback-field.js"
|
|
137
218
|
},
|
|
219
|
+
"./form/markdown-field": {
|
|
220
|
+
"types": "./dist/form/markdown-field.d.ts",
|
|
221
|
+
"default": "./dist/form/markdown-field.js"
|
|
222
|
+
},
|
|
138
223
|
"./form/select-field": {
|
|
139
224
|
"types": "./dist/form/select-field.d.ts",
|
|
140
225
|
"default": "./dist/form/select-field.js"
|
|
@@ -187,6 +272,8 @@
|
|
|
187
272
|
"next-themes": "^0.4.6",
|
|
188
273
|
"radix-ui": "^1.4.3",
|
|
189
274
|
"react-day-picker": "^10.0.1",
|
|
275
|
+
"react-markdown": "^10.1.0",
|
|
276
|
+
"remark-gfm": "^4.0.1",
|
|
190
277
|
"sonner": "^2.0.7",
|
|
191
278
|
"tailwind-merge": "^3.6.0",
|
|
192
279
|
"tw-animate-css": "^1.4.0"
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: atlas-react-kit
|
|
3
|
+
description: Build and change React UI with the atlas-react-kit design system (Atlas) instead of hand-rolled markup or another UI library. Use this whenever the project depends on atlas-react-kit (check package.json) and the task touches UI, such as pages, forms, inputs, pickers, selects, dialogs, tables, cards, tabs, badges, toasts, empty or loading states, theming, or dark mode, even if the user never says "Atlas" or "design system". Also use it when the user mentions Atlas components, design tokens, or making UI match the kit.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Atlas React Kit
|
|
7
|
+
|
|
8
|
+
atlas-react-kit is a shared React 19 + Tailwind 4 component library with a fixed
|
|
9
|
+
look: square corners, semantic color tokens, uppercase tracked headings, and a
|
|
10
|
+
purple "selected" wash for active states. Apps compose its components; they do
|
|
11
|
+
not restyle or fork them. Following that keeps every app consistent and makes
|
|
12
|
+
kit upgrades a version bump instead of a merge.
|
|
13
|
+
|
|
14
|
+
## 1. Read the docs for the installed version
|
|
15
|
+
|
|
16
|
+
The package ships its own guides, versioned with the code. Read both before
|
|
17
|
+
writing UI, because props and rules change between releases and your memory of
|
|
18
|
+
a previous version may be wrong:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
KIT=$(dirname "$(node -p "require.resolve('atlas-react-kit/package.json')")")
|
|
22
|
+
cat "$KIT/DESIGN_RULES.md" "$KIT/COMPONENTS.md"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`COMPONENTS.md` lists every import subpath and its props. When a prop is not
|
|
26
|
+
listed there, check the type declarations in `$KIT/dist/<subpath>.d.ts` rather
|
|
27
|
+
than guessing.
|
|
28
|
+
|
|
29
|
+
## 2. Check the project setup once
|
|
30
|
+
|
|
31
|
+
Components render unstyled unless the app's global stylesheet imports the theme
|
|
32
|
+
and tells Tailwind to scan the kit's compiled files:
|
|
33
|
+
|
|
34
|
+
```css
|
|
35
|
+
@import "tailwindcss";
|
|
36
|
+
@import "atlas-react-kit/theme.css";
|
|
37
|
+
@source "../node_modules/atlas-react-kit/dist"; /* relative to this CSS file */
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Dark mode needs `ThemeProvider` from `atlas-react-kit/theme-provider` near the
|
|
41
|
+
root (or a `dark` class on an ancestor). Toasts need one `<Toaster />` from
|
|
42
|
+
`atlas-react-kit/sonner`; call `toast()` from the `sonner` package, which the
|
|
43
|
+
app should list as its own dependency. Fix missing setup rather than working
|
|
44
|
+
around unstyled components.
|
|
45
|
+
|
|
46
|
+
## 3. Pick the kit component for the job
|
|
47
|
+
|
|
48
|
+
Import each component from its subpath, e.g.
|
|
49
|
+
`import { Button } from "atlas-react-kit/button"`. There is no root barrel, and
|
|
50
|
+
`dist/` or `internal/` paths are not public API.
|
|
51
|
+
|
|
52
|
+
| Need | Use |
|
|
53
|
+
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| Short fixed list (a handful of options) | `Select` family from `select` |
|
|
55
|
+
| Long or searchable list (timezones, currencies) | `Combobox` from `combobox` with `{ value, label }[]` options |
|
|
56
|
+
| Always-visible searchable list (places) | `SearchPicker` from `search-picker` |
|
|
57
|
+
| One date, or a from/to range | `DatePickerButton` from `date-picker` (`mode="range"` for ranges) |
|
|
58
|
+
| Date and time (not `datetime-local`) | `DateTimePickerButton` from `date-time-picker` |
|
|
59
|
+
| Labelled field with error text | `FormTextField`, `FormSelectField`, `FormDatePickerField`, `FormDateTimePickerField`, `FormMarkdownField` from `form/*` |
|
|
60
|
+
| Form-level error (save failed) | `FormFeedbackField` from `form/feedback-field` |
|
|
61
|
+
| Content panels on one page | `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent` from `tabs` |
|
|
62
|
+
| View switch that changes the URL | `TabsNav` with links: `TabsNavLink` from `next/tabs-nav-link` in Next, else `tabsTriggerVariants()` |
|
|
63
|
+
| Status chip (paid, pending, failed) | `Badge variant="soft"` with `tone="success"`, `"warning"`, `"destructive"`, or `"neutral"` |
|
|
64
|
+
| Data table | `Table` family from `table`; `SortableTableHead`; `TableBodySkeleton` while loading |
|
|
65
|
+
| Nothing to show yet | `EmptyPanel` from `empty-panel` |
|
|
66
|
+
| Grouped content | `Card` family from `card`; `<Card flush>` for an edge-to-edge table or list |
|
|
67
|
+
| Modal | `Dialog` family from `dialog` |
|
|
68
|
+
| Label for an icon button, or a short hint | `Tooltip` from `tooltip`; keep `aria-label` on icon buttons |
|
|
69
|
+
| Longer help from a glyph | `InfoTip` / `InlineTip` from `info-tip` (not `Tooltip`) |
|
|
70
|
+
| Color scale key | `ColorLegend` from `color-legend` |
|
|
71
|
+
| GitHub-flavoured Markdown | `Markdown` from `markdown`; write/preview with `FormMarkdownField` |
|
|
72
|
+
| Summary figure in a strip | `StatTile` from `stat-tile` (`statTileGrid`, `sectionLabel`) |
|
|
73
|
+
| Value against a scale, optional ticks | `Meter` from `meter` (not `Progress`) |
|
|
74
|
+
| Number on a continuous scale | `Slider` from `slider` |
|
|
75
|
+
| Row actions or an overflow menu of commands | `DropdownMenu` family from `dropdown-menu` |
|
|
76
|
+
| Setting that applies immediately | `Switch` from `switch`; `Checkbox` for choices submitted with a form |
|
|
77
|
+
| One choice from a few visible options | `RadioGroup` and `RadioGroupItem` from `radio-group` |
|
|
78
|
+
| Inline message about a page or section | `Alert` from `alert` (`success`, `warning`, `destructive` variants) |
|
|
79
|
+
| Person or workspace image | `Avatar`, `AvatarImage`, `AvatarFallback` from `avatar` |
|
|
80
|
+
| Sections that expand in place | `Accordion` family from `accordion` |
|
|
81
|
+
| Pages of a long list | `Pagination` family from `pagination` |
|
|
82
|
+
| Where the page sits in a hierarchy | `Breadcrumb` family from `breadcrumb` |
|
|
83
|
+
| Work in progress | `Progress` from `progress` when the percent is known, else `Spinner` from `spinner` |
|
|
84
|
+
| Crash recovery around a section | `ErrorBoundary` from `error-boundary` |
|
|
85
|
+
| Conditional classes | `cn` from `utils` |
|
|
86
|
+
|
|
87
|
+
If nothing fits, build the piece in the app from kit primitives and semantic
|
|
88
|
+
tokens. Do not copy kit source into the app; a missing shared component belongs
|
|
89
|
+
in the atlas-design-system repository.
|
|
90
|
+
|
|
91
|
+
Existing app code may predate the kit (raw colors, rounded boxes, hand-styled
|
|
92
|
+
buttons). Don't copy that style into new UI. Move what the task touches onto kit
|
|
93
|
+
components and tokens, and mention the rest to the user instead of rewriting
|
|
94
|
+
files the task doesn't need.
|
|
95
|
+
|
|
96
|
+
## 4. Style with tokens, not values
|
|
97
|
+
|
|
98
|
+
These rules are what make Atlas look like Atlas. `DESIGN_RULES.md` has the full
|
|
99
|
+
list; the ones that come up most:
|
|
100
|
+
|
|
101
|
+
- **Semantic colors only**: `bg-primary`, `text-muted-foreground`,
|
|
102
|
+
`border-border`, `bg-card`, `text-destructive`. Raw palette classes
|
|
103
|
+
(`bg-purple-600`, `text-gray-500`) and paired `dark:` colors drift from the
|
|
104
|
+
theme; tokens already switch with light and dark.
|
|
105
|
+
- **Selected and active state**: `bg-selected text-selected-foreground` plus
|
|
106
|
+
a `border-selected-foreground` border (or bar) for the current nav item,
|
|
107
|
+
chip, row, or toggle; the wash alone is too faint to show state. Grey fills
|
|
108
|
+
read as hover, not selection.
|
|
109
|
+
- **Status**: `success`, `warning`, and `destructive` for good, caution, and
|
|
110
|
+
bad. Use them as text or soft tints (the `Badge` tones), which meet AA in
|
|
111
|
+
both themes. Don't override a soft badge's colors. There is no foreground
|
|
112
|
+
token for text on a solid status fill, so avoid that combination.
|
|
113
|
+
- **Brand-colored text**: `text-selected-foreground`, not `text-primary`,
|
|
114
|
+
which is too dark to read on the dark background.
|
|
115
|
+
- **Accessibility**: the kit targets WCAG 2.2 AA. Give every control a name
|
|
116
|
+
(`Label htmlFor`, or `aria-label` on icon-only buttons and an unlabelled
|
|
117
|
+
`Combobox`), keep the shipped focus rings (solid `ring-ring`, never
|
|
118
|
+
`ring-ring/30`), keep field borders on `border-input` (3:1; `border-border`
|
|
119
|
+
is for dividers), and don't lower contrast with raw colors or opacity.
|
|
120
|
+
- **Square corners**: primitives have none. Use `rounded-full` only for real
|
|
121
|
+
circles (avatars, dots). Adding `rounded-md` to a card or button breaks the
|
|
122
|
+
system.
|
|
123
|
+
- **Don't restyle kit controls**: `Input`, `SelectTrigger`, `DatePickerButton`,
|
|
124
|
+
`DateTimePickerButton`, and `Combobox` share 40px form-control chrome.
|
|
125
|
+
Overriding their height, padding, or border makes one field look different
|
|
126
|
+
from its neighbors.
|
|
127
|
+
- **Layout overrides**: `CardContent className="px-0"` makes one section flush
|
|
128
|
+
without `!important`. Tables already scroll horizontally inside cards, so do
|
|
129
|
+
not wrap them in another overflow container.
|
|
130
|
+
- **Headings**: `CardTitle` and `DialogTitle` already apply the uppercase,
|
|
131
|
+
tracked heading style; use `font-heading` for other headings.
|
|
132
|
+
|
|
133
|
+
## 5. Check before you finish
|
|
134
|
+
|
|
135
|
+
Run these over the files you changed and fix what they find (an app's own
|
|
136
|
+
brand colors, kept outside kit components, are the only expected hits):
|
|
137
|
+
|
|
138
|
+
```sh
|
|
139
|
+
# Raw palette colors instead of tokens
|
|
140
|
+
grep -nE '\b(bg|text|border|ring|fill|stroke)-(slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-[0-9]{2,3}\b' <files>
|
|
141
|
+
# Rounded corners on primitives
|
|
142
|
+
grep -nE '\brounded-(sm|md|lg|xl|2xl|3xl)\b' <files>
|
|
143
|
+
# Non-public imports
|
|
144
|
+
grep -nE "from ['\"]atlas-react-kit(/dist|/internal|['\"])" <files>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Then typecheck: wrong prop names usually mean the component was guessed rather
|
|
148
|
+
than read from `COMPONENTS.md` or the `.d.ts`.
|
package/theme.css
CHANGED
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
@slot;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
@custom-variant data-on {
|
|
23
|
+
&:where([data-state="on"]) {
|
|
24
|
+
@slot;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
22
27
|
@custom-variant data-disabled {
|
|
23
28
|
&:where([data-disabled="true"]),
|
|
24
29
|
&:where([data-disabled]:not([data-disabled="false"])) {
|
|
@@ -96,23 +101,30 @@
|
|
|
96
101
|
--secondary: oklch(0.967 0.001 286.375);
|
|
97
102
|
--secondary-foreground: oklch(0.21 0.006 285.885);
|
|
98
103
|
--muted: oklch(0.97 0 0);
|
|
99
|
-
--muted
|
|
104
|
+
/* 4.8:1 on --muted and 5.3:1 on the page, so muted text also works on muted fills. */
|
|
105
|
+
--muted-foreground: oklch(0.53 0 0);
|
|
100
106
|
--accent: oklch(0.97 0 0);
|
|
101
107
|
--accent-foreground: oklch(0.205 0 0);
|
|
102
|
-
/* Soft brand-purple wash for selected/active chrome (nav, tabs, chips, rows).
|
|
103
|
-
|
|
108
|
+
/* Soft brand-purple wash for selected/active chrome (nav, tabs, chips, rows).
|
|
109
|
+
Mixed in oklab: in oklch, white's hue (0) pulls the mix toward pink. The
|
|
110
|
+
wash is too faint to mark state alone, so selected chrome also takes a
|
|
111
|
+
`selected-foreground` border or bar (WCAG 1.4.11). */
|
|
112
|
+
--selected: color-mix(in oklab, var(--primary) 12%, var(--background));
|
|
104
113
|
--selected-foreground: var(--primary);
|
|
105
|
-
|
|
114
|
+
/* AA as text on the page (6.4:1) and on its own /10 and /15 tints. */
|
|
115
|
+
--destructive: oklch(0.505 0.213 27.518);
|
|
106
116
|
/* Status tones: AA (4.5:1) as text on the page, on a card, and on a /10–/25
|
|
107
117
|
tint of themselves; also used as solid fills (meters). No -foreground:
|
|
108
|
-
nothing puts text on a solid fill. See DESIGN_RULES.md.
|
|
109
|
-
(above) passes as text on the page and card but not yet on its own tint
|
|
110
|
-
in light mode (about 3.6:1 on /15). */
|
|
118
|
+
nothing puts text on a solid fill. See DESIGN_RULES.md. */
|
|
111
119
|
--success: oklch(0.45 0.11 160);
|
|
112
120
|
--warning: oklch(0.48 0.115 70);
|
|
121
|
+
/* Dividers and card edges: decorative, so no contrast minimum. */
|
|
113
122
|
--border: oklch(0.922 0 0);
|
|
114
|
-
|
|
115
|
-
|
|
123
|
+
/* Form-control boundaries (fields, checkboxes, radios, switch track): 3:1
|
|
124
|
+
on the page and on cards, as WCAG 1.4.11 requires. */
|
|
125
|
+
--input: oklch(0.62 0 0);
|
|
126
|
+
/* Focus ring: solid brand purple, 7.3:1 on the page. */
|
|
127
|
+
--ring: var(--primary);
|
|
116
128
|
--chart-1: oklch(0.87 0 0);
|
|
117
129
|
--chart-2: oklch(0.556 0 0);
|
|
118
130
|
--chart-3: oklch(0.439 0 0);
|
|
@@ -136,7 +148,9 @@
|
|
|
136
148
|
--card-foreground: oklch(0.985 0 0);
|
|
137
149
|
--popover: oklch(0.205 0 0);
|
|
138
150
|
--popover-foreground: oklch(0.985 0 0);
|
|
139
|
-
|
|
151
|
+
/* Light enough for checked fills and borders to reach 3:1 on the page and
|
|
152
|
+
cards, dark enough for primary-foreground text (5:1). */
|
|
153
|
+
--primary: oklch(0.55 0.25 292.7);
|
|
140
154
|
--primary-foreground: oklch(0.969 0.016 293.756);
|
|
141
155
|
--secondary: oklch(0.274 0.006 286.033);
|
|
142
156
|
--secondary-foreground: oklch(0.985 0 0);
|
|
@@ -144,14 +158,14 @@
|
|
|
144
158
|
--muted-foreground: oklch(0.708 0 0);
|
|
145
159
|
--accent: oklch(0.269 0 0);
|
|
146
160
|
--accent-foreground: oklch(0.985 0 0);
|
|
147
|
-
--selected: color-mix(in
|
|
161
|
+
--selected: color-mix(in oklab, var(--primary) 24%, var(--background));
|
|
148
162
|
--selected-foreground: oklch(0.85 0.06 293);
|
|
149
163
|
--destructive: oklch(0.704 0.191 22.216);
|
|
150
164
|
--success: oklch(0.765 0.177 163.223);
|
|
151
165
|
--warning: oklch(0.828 0.189 84.429);
|
|
152
166
|
--border: oklch(1 0 0 / 10%);
|
|
153
|
-
--input: oklch(
|
|
154
|
-
--ring: oklch(0.
|
|
167
|
+
--input: oklch(0.52 0 0);
|
|
168
|
+
--ring: oklch(0.75 0.14 293);
|
|
155
169
|
--chart-1: oklch(0.87 0 0);
|
|
156
170
|
--chart-2: oklch(0.556 0 0);
|
|
157
171
|
--chart-3: oklch(0.439 0 0);
|
|
@@ -169,7 +183,7 @@
|
|
|
169
183
|
|
|
170
184
|
@layer base {
|
|
171
185
|
* {
|
|
172
|
-
@apply border-border outline-ring
|
|
186
|
+
@apply border-border outline-ring;
|
|
173
187
|
}
|
|
174
188
|
body {
|
|
175
189
|
@apply bg-background text-foreground;
|