@tedi-design-system/react 19.1.0-rc.2 → 19.1.0-rc.3
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 +308 -0
- package/README.md +28 -0
- package/_virtual/index.es13.js +2 -2
- package/_virtual/index.es14.js +2 -2
- package/bundle-stats.html +1 -1
- package/component.manifest.json +1191 -0
- package/external/react-is/index.cjs.js +1 -1
- package/external/react-is/index.es.js +1 -1
- package/external/toposort/index.cjs.js +1 -1
- package/external/toposort/index.es.js +1 -1
- package/index.css +1 -1
- package/package.json +1 -1
- package/src/tedi/components/filter/filter/filter.cjs.js +1 -1
- package/src/tedi/components/filter/filter/filter.d.ts +5 -0
- package/src/tedi/components/filter/filter/filter.es.js +154 -144
- package/src/tedi/components/filter/filter/filter.module.scss.cjs.js +1 -1
- package/src/tedi/components/filter/filter/filter.module.scss.es.js +2 -1
- package/src/tedi/components/overlays/dropdown/dropdown.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown.d.ts +8 -0
- package/src/tedi/components/overlays/dropdown/dropdown.es.js +82 -74
- package/src/tedi/components/overlays/dropdown/dropdown.module.scss.cjs.js +1 -1
- package/src/tedi/components/overlays/dropdown/dropdown.module.scss.es.js +1 -0
package/DESIGN.md
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
---
|
|
2
|
+
version: "alpha"
|
|
3
|
+
name: "TEDI Design System (React)"
|
|
4
|
+
description: "Tokens and tedi-ready component rules for @tedi-design-system/react."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# TEDI Design System — React
|
|
8
|
+
|
|
9
|
+
> Scope: **tedi-ready** components only, imported from `@tedi-design-system/react/tedi`.
|
|
10
|
+
> Detailed usage, setup, providers, theming and forms live in the **`tedi-react` skill**
|
|
11
|
+
> (`skills/tedi-react/`, references `components.md` / `theming.md` / `forms.md`). This file is
|
|
12
|
+
> the token- and rule-level ground truth AI agents read before generating UI; it does not
|
|
13
|
+
> duplicate the skill.
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
<!-- prose:overview -->
|
|
18
|
+
TEDI is the accessible design system for Estonian public-sector services, published for React as
|
|
19
|
+
`@tedi-design-system/react`. Components ship under two namespaces: **tedi-ready** (reviewed,
|
|
20
|
+
production-grade, imported from `@tedi-design-system/react/tedi`) and **community**
|
|
21
|
+
(contributed, imported from `@tedi-design-system/react/community`). Generate against tedi-ready
|
|
22
|
+
only. The system's personality is clear, calm and trustworthy — a restrained blue-led palette,
|
|
23
|
+
generous spacing and strong WCAG-compliant contrast, favouring legibility over decoration. This
|
|
24
|
+
file is the token- and rule-level ground truth an AI agent reads before generating UI; the
|
|
25
|
+
detailed usage, setup, props and examples live in the **`tedi-react` skill**
|
|
26
|
+
(`skills/tedi-react/`). When the two overlap, follow this file for tokens and rules and the skill
|
|
27
|
+
for how to wire components together.
|
|
28
|
+
<!-- /prose:overview -->
|
|
29
|
+
|
|
30
|
+
## Design tokens
|
|
31
|
+
|
|
32
|
+
**Look token values up; do not read them from this file.** They live in
|
|
33
|
+
`@tedi-design-system/core/tokens.json`, generated in core from Figma and published with the
|
|
34
|
+
stylesheet it describes, so it ships to every consumer:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
T=node_modules/@tedi-design-system/core/tokens.json
|
|
38
|
+
# one token: both the var() chain and the computed value
|
|
39
|
+
python3 -c "import json,sys;print(json.load(open(sys.argv[1]))['themes']['default']['semantic']['general-surface-primary'])" $T
|
|
40
|
+
# every member of a family
|
|
41
|
+
python3 -c "import json,sys;print([k for k in json.load(open(sys.argv[1]))['themes']['default']['semantic'] if k.startswith('general-text-')])" $T
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
That file is also the only place the **dark theme** (`themes.dark`) and the **per-breakpoint**
|
|
45
|
+
(`breakpoints.mobile`, `breakpoints.tablet`) overrides exist. A default-theme value is not the
|
|
46
|
+
value: treat every role token as theme-dependent unless you have checked.
|
|
47
|
+
|
|
48
|
+
The table below is a map of the vocabulary, not a data source. It groups the `general-*` and
|
|
49
|
+
`form-*` **role** tokens of the semantic tier into families so you can see which roles exist and
|
|
50
|
+
roughly how granular each is. Reach for these, never raw `--tedi-*` primitives. Note that the
|
|
51
|
+
heavily-populated `form-<component>-*` families (`form-checkbox-*`, `form-toggle-*`,
|
|
52
|
+
`form-slider-*`) are component internals; an application author normally writes `general-*`,
|
|
53
|
+
`form-field-*`, `form-input-*` and `form-general-*`.
|
|
54
|
+
|
|
55
|
+
<!-- tokens:start -->
|
|
56
|
+
| Role family | Tokens | Example members |
|
|
57
|
+
| --- | --- | --- |
|
|
58
|
+
| `form-calendar-*` | 1 | `form-calendar-date-width` |
|
|
59
|
+
| `form-checkbox-*` | 72 | `form-checkbox-radio-card-checkbox-icon-padding-y`, `form-checkbox-radio-card-checkbox-indicator-padding-y` |
|
|
60
|
+
| `form-datepicker-*` | 11 | `form-datepicker-date-active`, `form-datepicker-date-available` |
|
|
61
|
+
| `form-field-*` | 18 | `form-field-button-height`, `form-field-button-height-sm` |
|
|
62
|
+
| `form-general-*` | 9 | `form-general-background-action-background`, `form-general-background-default` |
|
|
63
|
+
| `form-hidden-*` | 2 | `form-hidden-default`, `form-hidden-hover` |
|
|
64
|
+
| `form-input-*` | 10 | `form-input-background-default`, `form-input-background-disabled` |
|
|
65
|
+
| `form-label-*` | 1 | `form-label` |
|
|
66
|
+
| `form-number-*` | 2 | `form-number-input-min-width`, `form-number-min-width` |
|
|
67
|
+
| `form-select-*` | 2 | `form-select-area-max-height`, `form-select-area-radius` |
|
|
68
|
+
| `form-slider-*` | 23 | `form-slider-active-background-active`, `form-slider-active-background-default` |
|
|
69
|
+
| `form-textarea-*` | 1 | `form-textarea-min-height` |
|
|
70
|
+
| `form-toggle-*` | 34 | `form-toggle-colored-active-active`, `form-toggle-colored-active-default` |
|
|
71
|
+
| `general-border-*` | 8 | `general-border-accent`, `general-border-brand` |
|
|
72
|
+
| `general-effect-*` | 10 | `general-effect-colors-elevation-dropdown-area-drop-shadow`, `general-effect-colors-elevation-general-primary` |
|
|
73
|
+
| `general-icon-*` | 15 | `general-icon-accent`, `general-icon-background-brand-primary` |
|
|
74
|
+
| `general-separator-*` | 1 | `general-separator-primary` |
|
|
75
|
+
| `general-status-*` | 23 | `general-status-danger-background-primary`, `general-status-danger-background-secondary` |
|
|
76
|
+
| `general-surface-*` | 17 | `general-surface-accent`, `general-surface-active` |
|
|
77
|
+
| `general-text-*` | 8 | `general-text-brand`, `general-text-dark` |
|
|
78
|
+
<!-- tokens:end -->
|
|
79
|
+
|
|
80
|
+
## Colors, Typography, Shapes, Layout
|
|
81
|
+
|
|
82
|
+
<!-- prose:foundations -->
|
|
83
|
+
**Token layers.** Tokens come in exactly two layers, the same two the design system defines in
|
|
84
|
+
Figma. **Base** tokens (`--tedi-*`, e.g. `--tedi-color-blue-700`) are the raw scale and are an
|
|
85
|
+
internal implementation detail — never reference them directly. **Semantic** tokens map a role to a
|
|
86
|
+
base token and are what re-theme cleanly, so always consume those. The semantic layer holds both
|
|
87
|
+
the general-purpose roles (`general-*`, `form-*`) and component-scoped ones (`button-*`, `card-*`,
|
|
88
|
+
`separator-*`, …); the component-scoped tokens are consumed by the components themselves, so in
|
|
89
|
+
your own CSS reach for the `general-*` / `form-*` roles listed in the table above. Everything is in
|
|
90
|
+
`@tedi-design-system/core/tokens.json` under `themes.default.semantic` if you need a value the
|
|
91
|
+
table does not list. The single exception to "never touch base" is the `--tedi-dimensions-*`
|
|
92
|
+
spacing scale, which the semantic spacing roles are themselves built from — see *Typography,
|
|
93
|
+
spacing, radius, dimensions* below for when to reach for it directly.
|
|
94
|
+
|
|
95
|
+
**Colour, by role.** Semantic colours are grouped by intent, so pick the role that matches meaning,
|
|
96
|
+
not appearance:
|
|
97
|
+
|
|
98
|
+
- **Text** — `general-text-*` (`primary`, `secondary`, `tertiary`, `brand`, `disabled`, `white`).
|
|
99
|
+
- **Surface / background** — `general-surface-*` for panels and fills, `general-icon-background-*`
|
|
100
|
+
for icon chips.
|
|
101
|
+
- **Border & separators** — `general-border-*` and `general-separator-primary`.
|
|
102
|
+
- **Icons** — `general-icon-*` (`primary`, `brand`, `danger`, `success`, `warning`, …).
|
|
103
|
+
- **Status** — `general-status-{info,success,warning,danger,neutral}-*` for feedback surfaces,
|
|
104
|
+
borders and text.
|
|
105
|
+
- **Forms** — `form-*` roles (`form-input-*`, `form-field-*`, `form-label`, `form-checkbox-radio-*`,
|
|
106
|
+
`form-toggle-*`, `form-slider-*`, `form-datepicker-*`) already drive the built-in form controls;
|
|
107
|
+
reuse them only when building form-adjacent UI.
|
|
108
|
+
|
|
109
|
+
**Typography, spacing, radius, dimensions.** These also come from tokens — sizing/spacing/radius
|
|
110
|
+
values such as `form-field-height`, `form-field-radius` and role-level spacing like
|
|
111
|
+
`form-field-inner-spacing` rather than hardcoded pixels. The underlying scale is
|
|
112
|
+
`--tedi-dimensions-00` … `--tedi-dimensions-25` (`0` → `24rem`); prefer a semantic role token where
|
|
113
|
+
one exists, and fall back to the dimensions scale for layout spacing that has no role. Use the
|
|
114
|
+
token; do not invent a value.
|
|
115
|
+
|
|
116
|
+
**Theming.** A theme is a CSS class on `<html>` (`tedi-theme--default`, `tedi-theme--dark`) set by
|
|
117
|
+
`ThemeProvider`. Dark mode is a semantic-token override subset — see `themes.dark` in
|
|
118
|
+
`@tedi-design-system/core/tokens.json`. Because you only ever reference semantic tokens, correctly built UI
|
|
119
|
+
follows the active theme automatically. For the how-to (provider setup, custom themes, SCSS token
|
|
120
|
+
usage) see `skills/tedi-react/references/theming.md`.
|
|
121
|
+
<!-- /prose:foundations -->
|
|
122
|
+
|
|
123
|
+
## Components
|
|
124
|
+
|
|
125
|
+
Authoritative catalog: `component.manifest.json` (tedi-ready, importable from
|
|
126
|
+
`@tedi-design-system/react/tedi`). For usage patterns see the `tedi-react` skill.
|
|
127
|
+
|
|
128
|
+
<!-- prose:components -->
|
|
129
|
+
The authoritative, machine-readable catalog of tedi-ready components (with categories and source
|
|
130
|
+
paths) is `component.manifest.json`; all of them import from
|
|
131
|
+
`@tedi-design-system/react/tedi`. Detailed props, variants and copy-paste examples live in
|
|
132
|
+
`skills/tedi-react/references/components.md`, with form controls covered in
|
|
133
|
+
`skills/tedi-react/references/forms.md`. High-level rules for generation:
|
|
134
|
+
|
|
135
|
+
- **Prefer composition.** Many components are compound (e.g. `Card.Header`, `Dropdown.Item`) or
|
|
136
|
+
polymorphic via an `as` prop — assemble from the provided parts rather than rebuilding markup.
|
|
137
|
+
- **Prefer tedi-ready over community.** Only reach for `@tedi-design-system/react/community` when no
|
|
138
|
+
tedi-ready equivalent exists.
|
|
139
|
+
- **Forms follow standard React.** Every form control supports both **controlled** (`value` +
|
|
140
|
+
`onChange`) and **uncontrolled** (`defaultValue`) modes; use inline feedback via the `helper` prop
|
|
141
|
+
rather than custom error markup. See the forms reference for the full control list.
|
|
142
|
+
<!-- /prose:components -->
|
|
143
|
+
|
|
144
|
+
## Do's and Don'ts
|
|
145
|
+
|
|
146
|
+
<!-- prose:dosdonts -->
|
|
147
|
+
**Do**
|
|
148
|
+
|
|
149
|
+
- Import components from `@tedi-design-system/react/tedi`.
|
|
150
|
+
- Wrap the app in `ThemeProvider` → `LabelProvider` → `StyleProvider`, and import the base styles
|
|
151
|
+
with `import '@tedi-design-system/react/index.css'` (or `@use '@tedi-design-system/core/scss'`).
|
|
152
|
+
- Use semantic tokens (`general-*` / `form-*`) for every colour, spacing, radius and dimension.
|
|
153
|
+
- Prefer tedi-ready components; assemble from compound/polymorphic parts instead of custom markup.
|
|
154
|
+
- Wire forms as controlled or uncontrolled per `skills/tedi-react/references/forms.md`, and show
|
|
155
|
+
validation via the `helper` prop.
|
|
156
|
+
- Defer to the `tedi-react` skill for setup, theming and forms details.
|
|
157
|
+
- In scaffolds that also ship a utility CSS framework (Tailwind in Figma Make), reach for a TEDI
|
|
158
|
+
component first and fall back to utilities only where TEDI has no equivalent — see
|
|
159
|
+
*Using TEDI in Figma Make*.
|
|
160
|
+
|
|
161
|
+
**Don't**
|
|
162
|
+
|
|
163
|
+
- Don't import from `@tedi-design-system/react/community` when a tedi-ready component exists.
|
|
164
|
+
- Don't hardcode hex/rgb colours or pixel values, and don't reference raw `--tedi-*` primitive
|
|
165
|
+
tokens — go through the semantic layer. The one exception is the `--tedi-dimensions-*` scale,
|
|
166
|
+
which semantic spacing roles are themselves built from: use it directly only for spacing that has
|
|
167
|
+
no semantic role.
|
|
168
|
+
- Don't add `var()` fallbacks — write `var(--token-name)`, not `var(--token-name, #fff)`.
|
|
169
|
+
- Don't hand-roll inputs, dropdowns, modals or date/time pickers that TEDI already provides.
|
|
170
|
+
- Don't skip the providers or the stylesheet import — components render unstyled or without theming.
|
|
171
|
+
- Don't rebuild a TEDI component out of utility classes, and don't restyle one with utility colour,
|
|
172
|
+
spacing or typography classes — both bypass the semantic token layer and drift from the system.
|
|
173
|
+
<!-- /prose:dosdonts -->
|
|
174
|
+
|
|
175
|
+
## Where to look things up
|
|
176
|
+
|
|
177
|
+
In priority order. **Story source wins** when this file, an agent's memory, and generated
|
|
178
|
+
summaries disagree:
|
|
179
|
+
|
|
180
|
+
1. **Story source** — `src/tedi/components/**/<name>.stories.tsx`. Real, compiling usage
|
|
181
|
+
code; authoritative, and readable by both humans and agents.
|
|
182
|
+
2. **`*.d.ts`** — the prop contract.
|
|
183
|
+
3. **Live Storybook** — for a **human** to look at rendered output:
|
|
184
|
+
- `rc` (current development line): https://storybook.tedi.ee/react/rc/
|
|
185
|
+
- `main` (latest stable release): https://storybook.tedi.ee/react/main/
|
|
186
|
+
- Deep links: `?path=/docs/tedi-ready-<group>-<component>--docs`, e.g.
|
|
187
|
+
[SideNav](https://storybook.tedi.ee/react/rc/?path=/docs/tedi-ready-layout-sidenav--docs).
|
|
188
|
+
- The bare `https://storybook.tedi.ee` is a framework picker, not the React build.
|
|
189
|
+
|
|
190
|
+
> **AI agents: do not fetch Storybook URLs as a reference.** Storybook is a
|
|
191
|
+
> client-rendered app — fetching a `?path=/docs/…` URL returns an empty shell with no
|
|
192
|
+
> props and no examples. Read the story source instead. The only machine-readable
|
|
193
|
+
> endpoint is `/react/rc/index.json` (story ids and titles), which helps you *find* a
|
|
194
|
+
> story, not read one.
|
|
195
|
+
|
|
196
|
+
Generated summaries are lossy in two specific ways worth knowing: prop descriptions are
|
|
197
|
+
truncated in some tooling, and types referenced by props are often not expanded. When a
|
|
198
|
+
description ends mid-sentence, assume there is more and go to the source.
|
|
199
|
+
|
|
200
|
+
## Using TEDI in Claude Design
|
|
201
|
+
|
|
202
|
+
[claude.ai/design](https://claude.ai/design) can host TEDI as a design system, so
|
|
203
|
+
prototypes are built from real TEDI components rather than approximations.
|
|
204
|
+
|
|
205
|
+
> **Creating the design system from this repository's URL does not work.** It produces
|
|
206
|
+
> token-level styling and approximated markup, not working TEDI components — TEDI's class
|
|
207
|
+
> names are hashed CSS Modules, so there is no class contract an importer can target from
|
|
208
|
+
> source. Committing the compiled bundle to the repo was tested (2026-08-11) and did not
|
|
209
|
+
> close the gap either. Use the flow below.
|
|
210
|
+
|
|
211
|
+
**You cannot be given access to the TEHIK-owned project.** Design-system projects are
|
|
212
|
+
org-scoped — sharing is `invited` or `org`, and neither crosses an organisation boundary.
|
|
213
|
+
Each organisation runs its own. That is also the better outcome: you own a project you can
|
|
214
|
+
refresh on your own schedule rather than waiting on someone else.
|
|
215
|
+
|
|
216
|
+
### The flow
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
git clone https://github.com/TEDI-Design-System/react.git
|
|
220
|
+
cd react
|
|
221
|
+
nvm use # Node >= 24, npm >= 11
|
|
222
|
+
npm ci
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Then, in Claude Code inside the repo:
|
|
226
|
+
|
|
227
|
+
```text
|
|
228
|
+
/design-sync
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
The skill runs the library build, builds the reference Storybook, converts, renders and
|
|
232
|
+
grades every component, and uploads — you do not run those steps yourself.
|
|
233
|
+
|
|
234
|
+
**There is nothing to configure.** The committed config pins the TEHIK-owned project; the
|
|
235
|
+
sync checks whether it can write there and, when it can't, creates a design system in your
|
|
236
|
+
own organisation instead. You will not be asked to edit a config file or supply an id.
|
|
237
|
+
|
|
238
|
+
### What you get
|
|
239
|
+
|
|
240
|
+
**82 TEDI-Ready components**, each with its real TypeScript prop contract (including the
|
|
241
|
+
shapes of referenced types), a live preview rendering the actual compiled component, and
|
|
242
|
+
per-component usage docs with the silent-failure gotchas. Designs the agent produces are
|
|
243
|
+
made of real TEDI parts and map to code your engineers can ship.
|
|
244
|
+
|
|
245
|
+
Everything repo-specific is already committed under `.design-sync/` — converter config,
|
|
246
|
+
provider chain, per-component overrides, adapter forks, the conventions header and
|
|
247
|
+
per-component docs — so you inherit the setup rather than rediscovering it. This is
|
|
248
|
+
verified, not assumed: rebuilding `dist/` and the reference Storybook from source and
|
|
249
|
+
re-running the converter reproduces a byte-identical result.
|
|
250
|
+
|
|
251
|
+
### Timing
|
|
252
|
+
|
|
253
|
+
The mechanical pipeline is about **two minutes** (library build ~1–1.5 min, Storybook
|
|
254
|
+
~1 min, converter ~35 s). The rest of a first run is the verification pass — every
|
|
255
|
+
component rendered and compared against Storybook — which is the part to budget for.
|
|
256
|
+
Later refreshes only touch what changed.
|
|
257
|
+
|
|
258
|
+
## Using TEDI in Figma Make
|
|
259
|
+
|
|
260
|
+
Figma Make consumes TEDI through a **Make kit** (`@make-kits/tedi-kit`, published to TEHIK's private
|
|
261
|
+
Figma npm registry), which installs `@tedi-design-system/react` from npm. Prototypes are therefore
|
|
262
|
+
built from real TEDI components, not approximations. Note that Make installs packages fresh from
|
|
263
|
+
npm and does **not** read this repository — Code Connect mappings play no part here either, they
|
|
264
|
+
serve Dev Mode and the MCP server only.
|
|
265
|
+
|
|
266
|
+
> **This section is the source of truth, but Make does not read it.** Make reads the markdown
|
|
267
|
+
> guidelines bundled in the kit. The rules below only affect generated output once they are
|
|
268
|
+
> mirrored into those guidelines; changing this file alone changes nothing in Make.
|
|
269
|
+
|
|
270
|
+
### Styling precedence
|
|
271
|
+
|
|
272
|
+
TEDI does not dictate a consuming project's toolchain — teams integrate it alongside whatever
|
|
273
|
+
styling tools they already use, and that is fine. What matters is precedence, not which libraries
|
|
274
|
+
are installed. Where a generating agent has utility classes available it will reach for them instead
|
|
275
|
+
of a component, silently, and the result looks plausible — the drift only surfaces when someone
|
|
276
|
+
tries to implement the prototype. Order of preference:
|
|
277
|
+
|
|
278
|
+
1. **A tedi-ready component's own props**, from `@tedi-design-system/react/tedi`.
|
|
279
|
+
2. **A community component**, from `@tedi-design-system/react/community`, only when no tedi-ready
|
|
280
|
+
equivalent exists.
|
|
281
|
+
3. **TEDI layout primitives** — `Row` / `Col`, `VerticalSpacing`, `ShowAt` / `HideAt`.
|
|
282
|
+
4. **Whatever the project already uses** for the remainder — plain CSS, CSS modules, a utility
|
|
283
|
+
framework — driven by real TEDI tokens: semantic roles for colour
|
|
284
|
+
(`var(--general-border-primary)`), the dimensions scale for spacing
|
|
285
|
+
(`var(--tedi-dimensions-10)`). Another library's own palette and scale are not TEDI's and will
|
|
286
|
+
not follow the active theme.
|
|
287
|
+
|
|
288
|
+
**Bare utility classes for spacing and flex layout are unsafe.** `index.css` ships 261 of TEDI's own
|
|
289
|
+
Bootstrap-style utilities (`gap-*`, `flex-*`, `order-*`, `justify-content-*`, `align-items-*`), all
|
|
290
|
+
declared `!important`, and the names overlap common utility frameworks at different values — TEDI's
|
|
291
|
+
`gap-3`/`gap-4`/`gap-5` are `1rem`/`1.5rem`/`3rem` against Tailwind's `0.75rem`/`1rem`/`1.25rem`,
|
|
292
|
+
while `gap-0`–`gap-2` coincide. TEDI wins every collision regardless of import order, so the
|
|
293
|
+
mismatch only surfaces at larger spacing. Prefer `Row` / `Col` and `VerticalSpacing`; where you need
|
|
294
|
+
raw spacing, write token-backed values that cannot collide (`gap: var(--tedi-dimensions-10)`) rather
|
|
295
|
+
than a bare utility class.
|
|
296
|
+
|
|
297
|
+
Two rules hold whatever the stack: never rebuild something TEDI already provides, and never restyle
|
|
298
|
+
a TEDI component from outside it. Reach for the component's own props first, and treat the absence
|
|
299
|
+
of a prop as a signal that the design is off-system rather than a reason to override it.
|
|
300
|
+
|
|
301
|
+
### Keeping a kit healthy
|
|
302
|
+
|
|
303
|
+
- **Import `@tedi-design-system/react/index.css`** and wrap the app in the provider chain
|
|
304
|
+
(`ThemeProvider` → `LabelProvider` → `StyleProvider`). Without these, components render unstyled
|
|
305
|
+
or unthemed — which pushes an agent toward rebuilding them in Tailwind.
|
|
306
|
+
- **Keep the kit's version pin current.** A caret range cannot cross a major boundary, so a kit
|
|
307
|
+
pinned to an older major silently loses every component added since — and Make will invent
|
|
308
|
+
Tailwind substitutes for them rather than fail. Bump the pin as part of the release checklist.
|
package/README.md
CHANGED
|
@@ -25,6 +25,34 @@ The Storybook documentation covers:
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
+
## AI Agent Skills
|
|
29
|
+
|
|
30
|
+
This repository ships an **integration skill** for AI coding agents that consume `@tedi-design-system/react` in a downstream application. The skill lives at [`skills/tedi-react/`](./skills/tedi-react) and conforms to the [skill.sh](https://skill.sh) standard, so it works with any modern AI tool that supports skills.
|
|
31
|
+
|
|
32
|
+
It teaches an agent:
|
|
33
|
+
|
|
34
|
+
- The canonical import paths (`/tedi` vs `/community`), required providers, and setup snippet
|
|
35
|
+
- How to read the current component roster and props out of the **installed package** (the generated `component.manifest.json` plus the shipped `.d.ts` tree), so the agent never works from a stale prop list
|
|
36
|
+
- Component patterns: polymorphic `as`, per-breakpoint props, compound sub-components
|
|
37
|
+
- Form control conventions (controlled/uncontrolled, helpers, validation)
|
|
38
|
+
- Theming with design tokens from `@tedi-design-system/core`, looked up in its `tokens.json`
|
|
39
|
+
- Behaviour the types don't express: composition constraints, responsive quirks, and the accessibility requirements a prop signature won't tell you
|
|
40
|
+
- Common pitfalls to avoid (deprecated Community components, hardcoded colors, `var()` fallbacks, etc.)
|
|
41
|
+
|
|
42
|
+
### Install
|
|
43
|
+
|
|
44
|
+
Use the [skills.sh](https://skills.sh) CLI from your project root:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npx skills add TEDI-Design-System/react
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The CLI auto-discovers the `tedi-react` skill under [`skills/`](./skills) and registers it for any compatible agent. Once installed, the agent will trigger the skill whenever you work with TEDI React components.
|
|
51
|
+
|
|
52
|
+
> Skills for **contributing to** the TEDI Design System (contributor skills, standards validation, etc.) live in a separate repo: [TEDI-Design-System/ai-skills](https://github.com/TEDI-Design-System/ai-skills).
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
28
56
|
## Repository Development Guide (Contributors)
|
|
29
57
|
|
|
30
58
|
The following instructions apply only if you are working on this repository itself
|
package/_virtual/index.es13.js
CHANGED
package/_virtual/index.es14.js
CHANGED