@alfadocs/ui-kit 0.0.12 → 0.0.13
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/README.md +74 -138
- package/dist/agent-catalog.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,152 +1,88 @@
|
|
|
1
1
|
# @alfadocs/ui-kit
|
|
2
2
|
|
|
3
|
-
The AlfaDocs
|
|
3
|
+
The AlfaDocs design system — React components, tokens, and translations.
|
|
4
4
|
|
|
5
|
-
**
|
|
6
|
-
**Repo:** `alfadocs/design_system`
|
|
7
|
-
**Package:** `@alfadocs/ui-kit` (published to GitHub Packages, `npm.pkg.github.com`)
|
|
8
|
-
**Visual reference:** https://new-alfa-docs.vercel.app/ (saved locally in [`reference/vercel-reference.html`](./reference/vercel-reference.html))
|
|
5
|
+
> **Pre-release.** APIs may change between minor versions before 1.0.
|
|
9
6
|
|
|
10
|
-
|
|
7
|
+
## Install
|
|
11
8
|
|
|
12
|
-
|
|
9
|
+
```bash
|
|
10
|
+
npm install @alfadocs/ui-kit
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Requires React 18+ and Node ≥ 22.6.
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|---|---|
|
|
16
|
-
| Language | React 18 + TypeScript (strict) |
|
|
17
|
-
| Component foundation | shadcn/ui + Radix UI primitives |
|
|
18
|
-
| Styling | Tailwind CSS v4 + CVA (class-variance-authority), tokens in `src/tokens/index.css` |
|
|
19
|
-
| Build | Vite (library mode) |
|
|
20
|
-
| Documentation | Storybook 10 (`@storybook/react-vite`) |
|
|
21
|
-
| Testing | Vitest + Playwright (browser mode) via `@storybook/addon-vitest` + axe-core |
|
|
22
|
-
| i18n | `react-i18next` (18 locales, RTL for `ar`) |
|
|
15
|
+
## Usage
|
|
23
16
|
|
|
24
|
-
|
|
17
|
+
### Tokens
|
|
25
18
|
|
|
19
|
+
Import the design tokens once at your app root so the CSS custom
|
|
20
|
+
properties are available everywhere:
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import '@alfadocs/ui-kit/tokens';
|
|
26
24
|
```
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
├── tokens/
|
|
35
|
-
│ ├── index.css single source of truth for CSS custom properties
|
|
36
|
-
│ ├── ag-grid-theme.css
|
|
37
|
-
│ ├── apexcharts-theme.ts
|
|
38
|
-
│ └── themes/bridges/ fullcalendar, react-day-picker, tiptap, stripe
|
|
39
|
-
├── brand/ colour tables, type specimens, logo assets, *.mdx
|
|
40
|
-
├── components/ 95 components, each with .tsx / .stories.tsx / .test.tsx / .mdx
|
|
41
|
-
├── patterns/ composition layer — realistic AlfaDocs workflows
|
|
42
|
-
├── hooks/ use-prefers-reduced-motion, …
|
|
43
|
-
├── i18n/ config.ts + resources.ts (bundled locales)
|
|
44
|
-
├── docs/ PRS §§ 01–25 + examples/
|
|
45
|
-
└── user_stories/ foundations + feature stories (done/ and to-do/)
|
|
25
|
+
|
|
26
|
+
Then apply a theme class on the root element:
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
<html class="theme-light">
|
|
30
|
+
<!-- or theme-dark, optionally combined with theme-accessible -->
|
|
31
|
+
</html>
|
|
46
32
|
```
|
|
47
33
|
|
|
48
|
-
|
|
34
|
+
### Components
|
|
49
35
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
36
|
+
Each component is also available as its own subpath import for
|
|
37
|
+
narrower bundles:
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { Button } from '@alfadocs/ui-kit/button';
|
|
41
|
+
import { Card } from '@alfadocs/ui-kit/card';
|
|
42
|
+
|
|
43
|
+
export function Example() {
|
|
44
|
+
return (
|
|
45
|
+
<Card>
|
|
46
|
+
<Card.Body>
|
|
47
|
+
<Button intent="primary">Save</Button>
|
|
48
|
+
</Card.Body>
|
|
49
|
+
</Card>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
53
52
|
```
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
##
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
- [06 — Internationalisation](./src/docs/06-i18n.mdx)
|
|
91
|
-
|
|
92
|
-
### Library
|
|
93
|
-
- [07 — Component Library](./src/docs/07-component-library.mdx)
|
|
94
|
-
- [08 — Third-Party Library Stack](./src/docs/08-third-party.mdx)
|
|
95
|
-
- [09 — Centralisation Strategy](./src/docs/09-centralisation.mdx)
|
|
96
|
-
|
|
97
|
-
### Design & docs
|
|
98
|
-
- [11 — Storybook](./src/docs/11-storybook.mdx)
|
|
99
|
-
|
|
100
|
-
### Non-functional
|
|
101
|
-
- [12 — Security](./src/docs/12-security.mdx)
|
|
102
|
-
- [13 — Maintainability](./src/docs/13-maintainability.mdx)
|
|
103
|
-
- [14 — Browser & Device Compatibility](./src/docs/14-browser-compat.mdx)
|
|
104
|
-
- [15 — Responsive Design & Breakpoints](./src/docs/15-responsive.mdx)
|
|
105
|
-
- [16 — Print Styles & PDF Generation](./src/docs/16-print.mdx)
|
|
106
|
-
- [17 — Error Handling & Resilience](./src/docs/17-error-handling.mdx)
|
|
107
|
-
- [18 — Animation & Motion Tokens](./src/docs/18-animation.mdx)
|
|
108
|
-
- [19 — Performance Requirements](./src/docs/19-performance.mdx)
|
|
109
|
-
|
|
110
|
-
### Process
|
|
111
|
-
- [20 — Versioning & Release Strategy](./src/docs/20-versioning.mdx)
|
|
112
|
-
- [21 — Contribution Guidelines & Governance](./src/docs/21-contribution.mdx)
|
|
113
|
-
- [22 — Agent Instructions](./src/docs/22-agents.mdx)
|
|
114
|
-
- [23 — Mandatory Constraints](./src/docs/23-constraints.mdx)
|
|
115
|
-
- [24 — Experimentation](./src/docs/24-experimentation.mdx)
|
|
116
|
-
- [25 — Consuming the Kit](./src/docs/25-consuming.mdx)
|
|
117
|
-
|
|
118
|
-
## Hard constraints
|
|
119
|
-
|
|
120
|
-
The full list is in [`src/docs/23-constraints.mdx`](./src/docs/23-constraints.mdx). Highlights CI enforces:
|
|
121
|
-
|
|
122
|
-
- Tokens only — no hardcoded colours, spacing, radii, shadows, fonts in components
|
|
123
|
-
- CSS logical properties only — `ms-*`/`me-*`/`ps-*`/`pe-*`, never `ml-*`/`mr-*`/`pl-*`/`pr-*`
|
|
124
|
-
- No inline `style={{…}}`; Tailwind classes only
|
|
125
|
-
- All user-visible strings routed through `useTranslation()`; `ui.*` namespace for kit, `app.*` for consumers
|
|
126
|
-
- axe-core zero violations per story
|
|
127
|
-
- TypeScript strict, no `any`, no PropTypes, `forwardRef` where a ref is exposed
|
|
128
|
-
- No `dangerouslySetInnerHTML` outside the `SafeHtml` helper
|
|
129
|
-
- No jQuery (and no library that depends on it)
|
|
130
|
-
- CVA for every component's variants
|
|
131
|
-
- Co-located `.stories.tsx` and `.test.tsx` for every component
|
|
132
|
-
- Four themes compose through class names on the theme root: `theme-light`, `theme-dark`, each optionally with `theme-accessible` (AAA)
|
|
133
|
-
|
|
134
|
-
## Agents & skills
|
|
135
|
-
|
|
136
|
-
Project-scoped agents (`.claude/agents/`) and user-invocable skills (`.claude/skills/`) are tracked in git. See [`CLAUDE.md`](./CLAUDE.md#agents--skills) for the full catalogue; common entry points:
|
|
137
|
-
|
|
138
|
-
| Invocation | Purpose |
|
|
139
|
-
|---|---|
|
|
140
|
-
| `/new-component <Name> [category]` | scaffold a new component and self-check it |
|
|
141
|
-
| `/component-gate <component-path>` | verify one component against the 9-row acceptance gate |
|
|
142
|
-
| `/ds-check [path-or-diff]` | run `token-auditor` + `a11y-reviewer` in parallel and merge findings |
|
|
143
|
-
|
|
144
|
-
Every feature implementation runs through `code-reviewer`, `a11y-reviewer`, and `token-auditor` in parallel before being declared done — see the "Post-implementation review" section in `CLAUDE.md`.
|
|
145
|
-
|
|
146
|
-
## Environment variables
|
|
147
|
-
|
|
148
|
-
Non-secret build-time values live in `.env` at the repo root and are read by Vite (and therefore Storybook). Anything genuinely secret goes in `.env.local` (gitignored).
|
|
149
|
-
|
|
150
|
-
| Variable | Committed? | Purpose |
|
|
151
|
-
|---|---|---|
|
|
152
|
-
| `VITE_FULLCALENDAR_LICENSE_KEY` | ✔ `.env` | Scheduler premium key for `resourceTimeline` in `Calendar`. Domain-bound, ships in the client bundle, not a cryptographic secret. Without it, FullCalendar renders an "invalid license" watermark. |
|
|
54
|
+
Or import everything from the root entry:
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
import { Button, Card } from '@alfadocs/ui-kit';
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### i18n
|
|
61
|
+
|
|
62
|
+
The kit ships with `react-i18next` pre-configured and locale bundles
|
|
63
|
+
in `dist/locales/`:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
import i18n from '@alfadocs/ui-kit/i18n';
|
|
67
|
+
import en from '@alfadocs/ui-kit/locales/en.json';
|
|
68
|
+
|
|
69
|
+
i18n.addResourceBundle('en', 'ui', en);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Peer dependencies
|
|
73
|
+
|
|
74
|
+
`react`, `react-dom`, `react-i18next`, `i18next`. Tailwind CSS is not
|
|
75
|
+
required to consume the kit — components ship pre-styled, and the
|
|
76
|
+
tokens stylesheet exposes CSS custom properties you can reference from
|
|
77
|
+
your own styles.
|
|
78
|
+
|
|
79
|
+
## License
|
|
80
|
+
|
|
81
|
+
[Business Source License 1.1](./LICENSE) — production use is
|
|
82
|
+
permitted; offering the Licensed Work, or a substantial portion of it,
|
|
83
|
+
as a competing hosted, embedded, or rebranded design-system or
|
|
84
|
+
component-library product is not. The Licensed Work converts to the
|
|
85
|
+
Apache License 2.0 on the Change Date specified in the LICENSE.
|
|
86
|
+
|
|
87
|
+
For commercial licensing arrangements outside the BUSL grant, contact
|
|
88
|
+
AlfaDocs GmbH.
|
package/dist/agent-catalog.json
CHANGED
package/package.json
CHANGED