atlas-react-kit 0.4.0 → 0.5.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 (53) hide show
  1. package/COMPONENTS.md +122 -39
  2. package/DESIGN_RULES.md +66 -19
  3. package/README.md +56 -10
  4. package/dist/accordion.d.ts +8 -0
  5. package/dist/accordion.js +20 -0
  6. package/dist/alert.d.ts +19 -0
  7. package/dist/alert.js +37 -0
  8. package/dist/avatar.d.ts +9 -0
  9. package/dist/avatar.js +16 -0
  10. package/dist/badge.d.ts +2 -2
  11. package/dist/breadcrumb.d.ts +16 -0
  12. package/dist/breadcrumb.js +33 -0
  13. package/dist/button.d.ts +6 -5
  14. package/dist/button.js +6 -5
  15. package/dist/calendar.d.ts +1 -1
  16. package/dist/calendar.js +19 -1
  17. package/dist/card.d.ts +2 -2
  18. package/dist/card.js +6 -6
  19. package/dist/combobox.d.ts +4 -1
  20. package/dist/combobox.js +10 -5
  21. package/dist/date-picker.js +14 -3
  22. package/dist/date-time-picker.d.ts +36 -0
  23. package/dist/date-time-picker.js +105 -0
  24. package/dist/dropdown-menu.d.ts +26 -0
  25. package/dist/dropdown-menu.js +56 -0
  26. package/dist/error-boundary.d.ts +1 -1
  27. package/dist/field.js +1 -1
  28. package/dist/form/date-time-picker-field.d.ts +16 -0
  29. package/dist/form/date-time-picker-field.js +12 -0
  30. package/dist/form/text-field.d.ts +7 -1
  31. package/dist/form/text-field.js +3 -3
  32. package/dist/pagination.d.ts +18 -0
  33. package/dist/pagination.js +35 -0
  34. package/dist/progress.d.ts +8 -0
  35. package/dist/progress.js +13 -0
  36. package/dist/radio-group.d.ts +13 -0
  37. package/dist/radio-group.js +20 -0
  38. package/dist/spinner.d.ts +8 -0
  39. package/dist/spinner.js +13 -0
  40. package/dist/switch.d.ts +9 -0
  41. package/dist/switch.js +14 -0
  42. package/dist/table.d.ts +7 -0
  43. package/dist/table.js +32 -3
  44. package/dist/tabs.d.ts +6 -3
  45. package/dist/tabs.js +5 -2
  46. package/dist/theme-provider.d.ts +2 -1
  47. package/dist/theme-provider.js +28 -4
  48. package/dist/toggle.js +1 -1
  49. package/dist/tooltip.d.ts +15 -0
  50. package/dist/tooltip.js +26 -0
  51. package/package.json +58 -5
  52. package/skills/atlas-react-kit/SKILL.md +139 -0
  53. package/theme.css +44 -5
@@ -0,0 +1,139 @@
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
+ | One date, or a from/to range | `DatePickerButton` from `date-picker` (`mode="range"` for ranges) |
57
+ | Date and time (not `datetime-local`) | `DateTimePickerButton` from `date-time-picker` |
58
+ | Labelled field with error text | `FormTextField`, `FormSelectField`, `FormDatePickerField`, `FormDateTimePickerField` from `form/*` |
59
+ | Form-level error (save failed) | `FormFeedbackField` from `form/feedback-field` |
60
+ | Content panels on one page | `Tabs`, `TabsList`, `TabsTrigger`, `TabsContent` from `tabs` |
61
+ | View switch that changes the URL | `TabsNav` with links: `TabsNavLink` from `next/tabs-nav-link` in Next, else `tabsTriggerVariants()` |
62
+ | Status chip (paid, pending, failed) | `Badge variant="soft"` with `tone="success"`, `"warning"`, `"destructive"`, or `"neutral"` |
63
+ | Data table | `Table` family from `table`; `SortableTableHead`; `TableBodySkeleton` while loading |
64
+ | Nothing to show yet | `EmptyPanel` from `empty-panel` |
65
+ | Grouped content | `Card` family from `card`; `<Card flush>` for an edge-to-edge table or list |
66
+ | Modal | `Dialog` family from `dialog` |
67
+ | Label for an icon button, or a short hint | `Tooltip` from `tooltip`; keep `aria-label` on icon buttons |
68
+ | Row actions or an overflow menu of commands | `DropdownMenu` family from `dropdown-menu` |
69
+ | Setting that applies immediately | `Switch` from `switch`; `Checkbox` for choices submitted with a form |
70
+ | One choice from a few visible options | `RadioGroup` and `RadioGroupItem` from `radio-group` |
71
+ | Inline message about a page or section | `Alert` from `alert` (`success`, `warning`, `destructive` variants) |
72
+ | Person or workspace image | `Avatar`, `AvatarImage`, `AvatarFallback` from `avatar` |
73
+ | Sections that expand in place | `Accordion` family from `accordion` |
74
+ | Pages of a long list | `Pagination` family from `pagination` |
75
+ | Where the page sits in a hierarchy | `Breadcrumb` family from `breadcrumb` |
76
+ | Work in progress | `Progress` from `progress` when the percent is known, else `Spinner` from `spinner` |
77
+ | Crash recovery around a section | `ErrorBoundary` from `error-boundary` |
78
+ | Conditional classes | `cn` from `utils` |
79
+
80
+ If nothing fits, build the piece in the app from kit primitives and semantic
81
+ tokens. Do not copy kit source into the app; a missing shared component belongs
82
+ in the atlas-design-system repository.
83
+
84
+ Existing app code may predate the kit (raw colors, rounded boxes, hand-styled
85
+ buttons). Don't copy that style into new UI. Move what the task touches onto kit
86
+ components and tokens, and mention the rest to the user instead of rewriting
87
+ files the task doesn't need.
88
+
89
+ ## 4. Style with tokens, not values
90
+
91
+ These rules are what make Atlas look like Atlas. `DESIGN_RULES.md` has the full
92
+ list; the ones that come up most:
93
+
94
+ - **Semantic colors only**: `bg-primary`, `text-muted-foreground`,
95
+ `border-border`, `bg-card`, `text-destructive`. Raw palette classes
96
+ (`bg-purple-600`, `text-gray-500`) and paired `dark:` colors drift from the
97
+ theme; tokens already switch with light and dark.
98
+ - **Selected and active state**: `bg-selected text-selected-foreground` for the
99
+ current nav item, chip, row, or toggle. Grey fills read as hover, not
100
+ selection.
101
+ - **Status**: `success`, `warning`, and `destructive` for good, caution, and
102
+ bad. Use them as text or soft tints (the `Badge` tones), which meet AA in
103
+ both themes. Don't override a soft badge's colors. There is no foreground
104
+ token for text on a solid status fill, so avoid that combination.
105
+ - **Brand-colored text**: `text-selected-foreground`, not `text-primary`,
106
+ which is too dark to read on the dark background.
107
+ - **Accessibility**: the kit targets WCAG 2.2 AA. Give every control a name
108
+ (`Label htmlFor`, or `aria-label` on icon-only buttons and an unlabelled
109
+ `Combobox`), keep the shipped focus rings, and don't lower contrast with raw
110
+ colors or opacity.
111
+ - **Square corners**: primitives have none. Use `rounded-full` only for real
112
+ circles (avatars, dots). Adding `rounded-md` to a card or button breaks the
113
+ system.
114
+ - **Don't restyle kit controls**: `Input`, `SelectTrigger`, `DatePickerButton`,
115
+ `DateTimePickerButton`, and `Combobox` share 40px form-control chrome.
116
+ Overriding their height, padding, or border makes one field look different
117
+ from its neighbors.
118
+ - **Layout overrides**: `CardContent className="px-0"` makes one section flush
119
+ without `!important`. Tables already scroll horizontally inside cards, so do
120
+ not wrap them in another overflow container.
121
+ - **Headings**: `CardTitle` and `DialogTitle` already apply the uppercase,
122
+ tracked heading style; use `font-heading` for other headings.
123
+
124
+ ## 5. Check before you finish
125
+
126
+ Run these over the files you changed and fix what they find (an app's own
127
+ brand colors, kept outside kit components, are the only expected hits):
128
+
129
+ ```sh
130
+ # Raw palette colors instead of tokens
131
+ 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>
132
+ # Rounded corners on primitives
133
+ grep -nE '\brounded-(sm|md|lg|xl|2xl|3xl)\b' <files>
134
+ # Non-public imports
135
+ grep -nE "from ['\"]atlas-react-kit(/dist|/internal|['\"])" <files>
136
+ ```
137
+
138
+ Then typecheck: wrong prop names usually mean the component was guessed rather
139
+ than read from `COMPONENTS.md` or the `.d.ts`.
package/theme.css CHANGED
@@ -96,18 +96,18 @@
96
96
  --secondary: oklch(0.967 0.001 286.375);
97
97
  --secondary-foreground: oklch(0.21 0.006 285.885);
98
98
  --muted: oklch(0.97 0 0);
99
- --muted-foreground: oklch(0.556 0 0);
99
+ /* 4.8:1 on --muted and 5.3:1 on the page, so muted text also works on muted fills. */
100
+ --muted-foreground: oklch(0.53 0 0);
100
101
  --accent: oklch(0.97 0 0);
101
102
  --accent-foreground: oklch(0.205 0 0);
102
103
  /* Soft brand-purple wash for selected/active chrome (nav, tabs, chips, rows). */
103
104
  --selected: color-mix(in oklch, var(--primary) 12%, var(--background));
104
105
  --selected-foreground: var(--primary);
105
- --destructive: oklch(0.577 0.245 27.325);
106
+ /* AA as text on the page (6.4:1) and on its own /10 and /15 tints. */
107
+ --destructive: oklch(0.505 0.213 27.518);
106
108
  /* Status tones: AA (4.5:1) as text on the page, on a card, and on a /10–/25
107
109
  tint of themselves; also used as solid fills (meters). No -foreground:
108
- nothing puts text on a solid fill. See DESIGN_RULES.md. --destructive
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). */
110
+ nothing puts text on a solid fill. See DESIGN_RULES.md. */
111
111
  --success: oklch(0.45 0.11 160);
112
112
  --warning: oklch(0.48 0.115 70);
113
113
  --border: oklch(0.922 0 0);
@@ -202,4 +202,43 @@
202
202
  [data-slot="card-footer"].border-t {
203
203
  padding-top: var(--card-p);
204
204
  }
205
+
206
+ /*
207
+ * Horizontal scroll shadows: edge fades stay pinned (`scroll`) while
208
+ * matching covers ride with the content (`local`), so a clipped column
209
+ * like LICENSE is visible as overflow instead of looking truncated.
210
+ */
211
+ [data-slot="table-container"] {
212
+ --table-scroll-fade: var(--background);
213
+ background:
214
+ linear-gradient(to right, var(--table-scroll-fade) 40%, transparent),
215
+ linear-gradient(to left, var(--table-scroll-fade) 40%, transparent),
216
+ linear-gradient(
217
+ to right,
218
+ color-mix(in oklch, var(--foreground) 16%, transparent),
219
+ transparent 80%
220
+ ),
221
+ linear-gradient(
222
+ to left,
223
+ color-mix(in oklch, var(--foreground) 16%, transparent),
224
+ transparent 80%
225
+ );
226
+ background-repeat: no-repeat;
227
+ background-size:
228
+ 1.5rem 100%,
229
+ 1.5rem 100%,
230
+ 0.75rem 100%,
231
+ 0.75rem 100%;
232
+ background-position:
233
+ left center,
234
+ right center,
235
+ left center,
236
+ right center;
237
+ background-attachment: local, local, scroll, scroll;
238
+ }
239
+
240
+ /* Covers match the card face so the fade does not flash the page background. */
241
+ [data-slot="card"] [data-slot="table-container"] {
242
+ --table-scroll-fade: var(--card);
243
+ }
205
244
  }