@actioneer/ads 1.0.5 → 1.0.6
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/DESIGN.md +1 -1
- package/README.md +205 -0
- package/manifest.json +1 -1
- package/package.json +1 -1
package/DESIGN.md
CHANGED
|
@@ -179,7 +179,7 @@ components:
|
|
|
179
179
|
|
|
180
180
|
TASTE.md puts it in one line: On a quiet, neutral ground, colour and motion are spent like money — rarely, deliberately, and only where the eye should go.
|
|
181
181
|
|
|
182
|
-
ADS 1.0.
|
|
182
|
+
ADS 1.0.6 is a library first and a look second. 323 components across 10 families (Primitives / utilities, Foundations, Form controls, Overlays, Data display, Feedback, Navigation, Layout, AI Elements, Chat) ship from one barrel, and every product that consumes them inherits the judgment encoded in 56 semantic tokens and 11 principles rather than re-deciding it per screen.
|
|
183
183
|
|
|
184
184
|
The ground is warm grey and the ink is warm near-black. One hue is spent by default, the Studio teal CTA family, and four more carry semantic status. Everything else stays neutral. A consumer product may narrow that further, and one already does: Baby Sentinel drops the teal and runs every action on ink.
|
|
185
185
|
|
package/README.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# @actioneer/ads
|
|
2
|
+
|
|
3
|
+
The **Actioneer Design System**: React 19 components, Tailwind CSS v4 tokens,
|
|
4
|
+
bundled Aribau Grotesk fonts, and accessible interactions with built-in motion.
|
|
5
|
+
|
|
6
|
+
[Browse components in Storybook](https://actioneer-ads-storybook.himanshu-563.workers.dev).
|
|
7
|
+
|
|
8
|
+
> **The one rule:** build UI **only** from the exact named exports of
|
|
9
|
+
> `@actioneer/ads`, and reference tokens — never raw color/dimension literals.
|
|
10
|
+
> Never fork, alias, deep-import, or hand-roll a copy of a component.
|
|
11
|
+
> `@actioneer/ads-lint` enforces this.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 1. Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @actioneer/ads motion
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Use an existing **React 19 + Tailwind CSS v4** application with an ESM-capable
|
|
22
|
+
bundler. `react` and `react-dom` are peer dependencies; the application owns the
|
|
23
|
+
React instance. The setup below uses Next.js App Router paths.
|
|
24
|
+
|
|
25
|
+
The bootstrap configures styles and providers and creates the lint config:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npx @actioneer/ads init
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
`init` adds the CSS import, creates `ads-providers.tsx` (or `.jsx`), and writes a
|
|
32
|
+
consumer `ads-lint.config.mjs`. It wraps detected Next.js layouts and reports any
|
|
33
|
+
manual setup still needed. Run it from your application directory after setting
|
|
34
|
+
up Tailwind v4. The manual setup follows.
|
|
35
|
+
|
|
36
|
+
## 2. Tailwind v4 + `styles.css` (import order matters)
|
|
37
|
+
|
|
38
|
+
In your global stylesheet, import ADS's stylesheet **immediately after**
|
|
39
|
+
Tailwind:
|
|
40
|
+
|
|
41
|
+
```css
|
|
42
|
+
/* app/globals.css */
|
|
43
|
+
@import "tailwindcss";
|
|
44
|
+
@import "@actioneer/ads/styles.css";
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`styles.css` carries three things that must live in the **same CSS graph** as
|
|
48
|
+
`tailwindcss`:
|
|
49
|
+
|
|
50
|
+
- the `@theme` **design tokens** (colors, typography, spacing, and radii),
|
|
51
|
+
- the **Aribau Grotesk** `@font-face` rules (served package-relative — no
|
|
52
|
+
`/public` copy needed), and
|
|
53
|
+
- a baked `@source "./**/*.{js,mjs}"` so Tailwind scans ADS's own class usage and
|
|
54
|
+
generates its utilities in your build.
|
|
55
|
+
|
|
56
|
+
> ⚠️ Import order is load-bearing. If you `@import "@actioneer/ads/styles.css"`
|
|
57
|
+
> **before** `@import "tailwindcss"` — or import it into a stylesheet that isn't
|
|
58
|
+
> part of the Tailwind graph — its `@theme` is an unknown at-rule and **no tokens
|
|
59
|
+
> emit** (you'll get an unstyled, "blank" render).
|
|
60
|
+
|
|
61
|
+
Granular entries are also exported if you need them: `@actioneer/ads/theme.css`
|
|
62
|
+
(tokens only) and `@actioneer/ads/fonts.css` (`@font-face` only).
|
|
63
|
+
|
|
64
|
+
## 3. Required providers
|
|
65
|
+
|
|
66
|
+
Wrap your app root **once** with all three providers. `npx @actioneer/ads init`
|
|
67
|
+
generates this as `app/ads-providers.tsx` (beside the layout when using `src/app`):
|
|
68
|
+
|
|
69
|
+
```tsx
|
|
70
|
+
// app/ads-providers.tsx
|
|
71
|
+
"use client";
|
|
72
|
+
|
|
73
|
+
import type { ReactNode } from "react";
|
|
74
|
+
import { TooltipProvider, ToastProvider } from "@actioneer/ads";
|
|
75
|
+
import { MotionConfig } from "motion/react";
|
|
76
|
+
|
|
77
|
+
export function Providers({ children }: { children: ReactNode }) {
|
|
78
|
+
return (
|
|
79
|
+
<MotionConfig reducedMotion="user">
|
|
80
|
+
<ToastProvider>
|
|
81
|
+
<TooltipProvider>{children}</TooltipProvider>
|
|
82
|
+
</ToastProvider>
|
|
83
|
+
</MotionConfig>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
// app/layout.tsx
|
|
90
|
+
import type { ReactNode } from "react";
|
|
91
|
+
import { Providers } from "./ads-providers";
|
|
92
|
+
import "./globals.css";
|
|
93
|
+
|
|
94
|
+
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
95
|
+
return (
|
|
96
|
+
<html lang="en">
|
|
97
|
+
<body><Providers>{children}</Providers></body>
|
|
98
|
+
</html>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- **`TooltipProvider`** — required. The vendored tooltip/attachment chips crash
|
|
104
|
+
the tree without an ancestor provider.
|
|
105
|
+
- **`ToastProvider`** — required to render toasts.
|
|
106
|
+
- **`<MotionConfig reducedMotion="user">`** — honors the OS reduced-motion
|
|
107
|
+
setting across every ADS animation.
|
|
108
|
+
|
|
109
|
+
For other React frameworks, import the global stylesheet and wrap the application
|
|
110
|
+
root with `Providers` in the framework's entry point.
|
|
111
|
+
|
|
112
|
+
## 4. Usage
|
|
113
|
+
|
|
114
|
+
Import the **exact named export** from the package barrel:
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
// app/page.tsx
|
|
118
|
+
"use client";
|
|
119
|
+
|
|
120
|
+
import { Button, InputField } from "@actioneer/ads";
|
|
121
|
+
|
|
122
|
+
export default function Example() {
|
|
123
|
+
return (
|
|
124
|
+
<main className="mx-auto flex max-w-sm flex-col gap-4 p-6">
|
|
125
|
+
<InputField label="Workspace name" defaultValue="Actioneer" />
|
|
126
|
+
<div className="flex gap-2">
|
|
127
|
+
<Button variant="solid" size="md">Save</Button>
|
|
128
|
+
<Button variant="secondary">Cancel</Button>
|
|
129
|
+
</div>
|
|
130
|
+
</main>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Do **not**:
|
|
136
|
+
|
|
137
|
+
| ❌ Anti-pattern | ✅ Instead |
|
|
138
|
+
|----------------|-----------|
|
|
139
|
+
| `import { Button } from "@actioneer/ads/button"` (deep import) | `import { Button } from "@actioneer/ads"` |
|
|
140
|
+
| `import { Card as Panel } from "@actioneer/ads"` (alias) | use the export's real name, `Card` |
|
|
141
|
+
| `import Button from "@actioneer/ads"` (default) / `import * as ADS` (namespace) | named imports only |
|
|
142
|
+
| copy a component's source into your repo and edit it (fork) | import it; request an ADS change upstream |
|
|
143
|
+
| `class="bg-[#0a0a0b]"` / `"#0a0a0b"` (literal) | a semantic token, e.g. `bg-brand` |
|
|
144
|
+
| `import { Dialog } from "@radix-ui/react-dialog"` (external UI) | the ADS primitive (`Modal`, `Popover`, …) |
|
|
145
|
+
|
|
146
|
+
**Why:** ADS is a single source of truth. A token or motion fix ships to the
|
|
147
|
+
whole fleet with one version bump — but only if every consumer imports the
|
|
148
|
+
canonical export instead of a divergent fork.
|
|
149
|
+
|
|
150
|
+
**Discover exact names:** the machine-readable catalog ships in the package —
|
|
151
|
+
`@actioneer/ads/manifest.json` (every export → name, family, kind, variants,
|
|
152
|
+
props, showcase URL) and `@actioneer/ads/llms.txt` (the LLM-facing index). Point
|
|
153
|
+
your coding agent at those, or use the ADS MCP server.
|
|
154
|
+
|
|
155
|
+
Reference the semantic tokens (e.g. `bg-brand`, `text-muted-foreground`,
|
|
156
|
+
`border-input`, `ring-ring`) rather than raw values; the full token list is in
|
|
157
|
+
`manifest.json` under `tokens`.
|
|
158
|
+
|
|
159
|
+
Shared motion presets are named exports from `@actioneer/ads`. Components already
|
|
160
|
+
include their own interaction motion; use the exported presets for additional
|
|
161
|
+
application state changes.
|
|
162
|
+
|
|
163
|
+
## 5. Wire up `ads-lint`
|
|
164
|
+
|
|
165
|
+
`@actioneer/ads-lint` enforces the contract above on your changed files.
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npm install -D @actioneer/ads-lint typescript
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Drop a **consumer-mode** config at your repo root (`init` writes this for you):
|
|
172
|
+
|
|
173
|
+
```js
|
|
174
|
+
// ads-lint.config.mjs
|
|
175
|
+
export default {
|
|
176
|
+
imports: {
|
|
177
|
+
libraryPackage: "@actioneer/ads",
|
|
178
|
+
libraryRoot: null, // consumer mode: every file is a consumer
|
|
179
|
+
},
|
|
180
|
+
};
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Run it:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
# lint everything
|
|
187
|
+
npx ads-lint --all
|
|
188
|
+
# or just what changed (pre-commit / CI)
|
|
189
|
+
npx ads-lint --staged
|
|
190
|
+
npx ads-lint --diff origin/main
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
It flags deep imports, aliased/default/namespace barrel imports, external-UI
|
|
194
|
+
imports, hardcoded color/dimension literals, and banned/weak motion — the same
|
|
195
|
+
rules ADS holds itself to. A CI job that runs `npx ads-lint --diff <base>` keeps
|
|
196
|
+
every consuming repo honest.
|
|
197
|
+
|
|
198
|
+
## Documentation and license
|
|
199
|
+
|
|
200
|
+
- [Storybook: components and recipes](https://actioneer-ads-storybook.himanshu-563.workers.dev)
|
|
201
|
+
- [ADS MCP: component discovery for coding agents](https://www.npmjs.com/package/@actioneer/ads-mcp)
|
|
202
|
+
- Bundled references: `@actioneer/ads/manifest.json`, `@actioneer/ads/llms.txt`,
|
|
203
|
+
and `@actioneer/ads/DESIGN.md`.
|
|
204
|
+
|
|
205
|
+
MIT licensed.
|
package/manifest.json
CHANGED