@dextinity/agent-features 10.0.1-canary-20260814073232 → 10.0.1

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 (38) hide show
  1. package/package.json +6 -1
  2. package/rules/coding-guidelines/api-nestjs.instructions.md +107 -0
  3. package/rules/coding-guidelines/cdn.instructions.md +24 -0
  4. package/rules/coding-guidelines/general.instructions.md +30 -0
  5. package/rules/coding-guidelines/git.instructions.md +37 -0
  6. package/rules/coding-guidelines/kubernetes.instructions.md +59 -0
  7. package/rules/coding-guidelines/libraries.instructions.md +34 -0
  8. package/rules/coding-guidelines/naming.instructions.md +39 -0
  9. package/rules/coding-guidelines/postgresql.instructions.md +40 -0
  10. package/rules/coding-guidelines/react.instructions.md +102 -0
  11. package/rules/coding-guidelines/security.instructions.md +44 -0
  12. package/rules/coding-guidelines/styling.instructions.md +50 -0
  13. package/rules/coding-guidelines/typescript.instructions.md +50 -0
  14. package/skills/.gitkeep +0 -0
  15. package/skills/dev-pm/SKILL.md +100 -0
  16. package/skills/dextinity-admin-ui/SKILL.md +544 -0
  17. package/skills/dextinity-block/SKILL.md +252 -0
  18. package/skills/dextinity-block/references/admin-patterns.md +192 -0
  19. package/skills/dextinity-block/references/api-patterns.md +183 -0
  20. package/skills/dextinity-block/references/block-loader.md +368 -0
  21. package/skills/dextinity-block/references/block-types.md +210 -0
  22. package/skills/dextinity-block/references/custom-block-field.md +266 -0
  23. package/skills/dextinity-block/references/fixtures.md +436 -0
  24. package/skills/dextinity-block/references/image.md +341 -0
  25. package/skills/dextinity-block/references/migration.md +597 -0
  26. package/skills/dextinity-block/references/registration.md +167 -0
  27. package/skills/dextinity-block/references/response-summary.md +102 -0
  28. package/skills/dextinity-block/references/rich-text.md +309 -0
  29. package/skills/dextinity-block/references/select.md +176 -0
  30. package/skills/dextinity-block/references/site-patterns.md +202 -0
  31. package/skills/dextinity-core-admin-component-authoring/SKILL.md +92 -0
  32. package/skills/dextinity-mail-react/SKILL.md +647 -0
  33. package/skills/dextinity-mail-react/references/components-and-theme.md +448 -0
  34. package/skills/dextinity-mail-react/references/layout-patterns.md +315 -0
  35. package/skills/dextinity-mail-react/references/styling-and-customization.md +306 -0
  36. package/skills/dextinity-major-migration/SKILL.md +161 -0
  37. package/skills/dextinity-major-migration/references/migration-smoke-test.md +196 -0
  38. package/skills/dextinity-minor-update/SKILL.md +191 -0
@@ -0,0 +1,448 @@
1
+ # Components & Theme Reference
2
+
3
+ Theme system, module augmentation, scoped theming, and the component behavior for `@dextinity/mail-react` that its types and TSDoc don't capture on their own. For prop names, types, and defaults, read the types and their TSDoc.
4
+
5
+ ## Table of Contents
6
+
7
+ 1. [Theme tokens](#theme-tokens)
8
+ 2. [Module Augmentation Interfaces](#module-augmentation-interfaces)
9
+ 3. [MjmlMailRoot](#mjmlmailroot)
10
+ 4. [MjmlSection](#mjmlsection)
11
+ 5. [MjmlWrapper](#mjmlwrapper)
12
+ 6. [Text Components](#text-components)
13
+ 7. [HtmlInlineLink](#htmlinlinelink)
14
+ 8. [Image](#image)
15
+ 9. [Divider](#divider)
16
+ 10. [Button](#button)
17
+ 11. [Scoped Theming](#scoped-theming)
18
+ 12. [MJML Component Re-exports](#mjml-component-re-exports)
19
+
20
+ ---
21
+
22
+ ## Theme tokens
23
+
24
+ `createTheme(overrides?)` merges partial overrides into the default theme; every token is optional and the `Theme` type lists them. Defaults live in `createTheme`. One behavior isn't visible from the types: **the default breakpoint derives from `sizes.bodyWidth`** unless `breakpoints.default` is overridden — they describe the same boundary, so setting them apart silently desyncs the layout.
25
+
26
+ ### Breakpoints
27
+
28
+ Breakpoint values are created with `createBreakpoint(pixelWidth)`:
29
+
30
+ ```ts
31
+ createBreakpoint(420);
32
+ // → { value: 420, belowMediaQuery: "@media (max-width: 419px)" }
33
+ ```
34
+
35
+ The `belowMediaQuery` string is ready to use in `registerStyles` calls.
36
+
37
+ ### Responsive Values
38
+
39
+ Many theme properties accept responsive values — objects keyed by breakpoint name:
40
+
41
+ ```ts
42
+ const theme = createTheme({
43
+ sizes: {
44
+ contentIndentation: { default: 40, tablet: 30, mobile: 20 },
45
+ },
46
+ list: {
47
+ indent: { default: 24, tablet: 16, mobile: 8 },
48
+ },
49
+ });
50
+ ```
51
+
52
+ The `default` key provides the base value (rendered inline). Other keys generate media query overrides automatically.
53
+
54
+ ### List Markers
55
+
56
+ `list.unorderedMarker` and `list.orderedMarker` set the markers of the lists the RichText block renders: a fixed node, or a function receiving the item's zero-based `index` and the `depth` of its list. Use plain HTML and React elements, not MJML components:
57
+
58
+ ```tsx
59
+ const theme = createTheme({
60
+ list: {
61
+ unorderedMarker: ({ depth }) => ["▪", "–", "·"][depth % 3],
62
+ // 97 is the code of "a", so nested items are lettered a., b., c.
63
+ orderedMarker: ({ index, depth }) => (depth === 0 ? `${index + 1}.` : `${String.fromCharCode(97 + index)}.`),
64
+ },
65
+ });
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Module Augmentation Interfaces
71
+
72
+ These interfaces are empty by default, designed for consumers to extend via `declare module`. Place augmentations in your theme file alongside `createTheme()`, generally below the `createTheme` call.
73
+
74
+ ### TextVariants
75
+
76
+ Controls the `variant` prop on `MjmlText` and `HtmlText`:
77
+
78
+ ```ts
79
+ const theme = createTheme({
80
+ text: {
81
+ defaultVariant: "body",
82
+ variants: {
83
+ heading: { fontSize: "32px", fontWeight: 700, lineHeight: "40px" },
84
+ body: { fontSize: "16px", lineHeight: "24px" },
85
+ caption: { fontSize: "12px", lineHeight: "16px", color: "#666666" },
86
+ },
87
+ },
88
+ });
89
+
90
+ declare module "@dextinity/mail-react" {
91
+ interface TextVariants {
92
+ heading: true;
93
+ body: true;
94
+ caption: true;
95
+ }
96
+ }
97
+ ```
98
+
99
+ Variant properties accept responsive values:
100
+
101
+ ```ts
102
+ heading: {
103
+ fontSize: { default: "32px", mobile: "24px" },
104
+ lineHeight: { default: "40px", mobile: "30px" },
105
+ bottomSpacing: { default: "24px", mobile: "16px" },
106
+ fontWeight: 700,
107
+ },
108
+ ```
109
+
110
+ ### DividerVariants
111
+
112
+ Controls the `variant` prop on `MjmlDivider` and `HtmlDivider`:
113
+
114
+ ```ts
115
+ const theme = createTheme({
116
+ divider: {
117
+ defaultVariant: "thin",
118
+ variants: {
119
+ thin: { height: 1, backgroundColor: "#999999" },
120
+ thick: { height: { default: 12, mobile: 8 }, backgroundColor: "#222222" },
121
+ },
122
+ },
123
+ });
124
+
125
+ declare module "@dextinity/mail-react" {
126
+ interface DividerVariants {
127
+ thin: true;
128
+ thick: true;
129
+ }
130
+ }
131
+ ```
132
+
133
+ Variant properties (`height`, `backgroundColor`, `backgroundImage`) accept responsive values.
134
+
135
+ ### ButtonVariants
136
+
137
+ Controls the `variant` prop on `MjmlButton` and `HtmlButton`:
138
+
139
+ ```ts
140
+ const theme = createTheme({
141
+ button: {
142
+ defaultVariant: "primary",
143
+ variants: {
144
+ primary: { backgroundColor: "#5B4FC7", color: "#FFFFFF" },
145
+ gradient: {
146
+ backgroundColor: "#5B4FC7",
147
+ backgroundImage: "linear-gradient(90deg, #5B4FC7, #9C5BC7)",
148
+ },
149
+ },
150
+ },
151
+ });
152
+
153
+ declare module "@dextinity/mail-react" {
154
+ interface ButtonVariants {
155
+ primary: true;
156
+ gradient: true;
157
+ }
158
+ }
159
+ ```
160
+
161
+ Variant properties (`color`, `backgroundColor`, `backgroundImage`, `border`, `borderRadius`, `fontFamily`, `fontSize`, `fontWeight`, `lineHeight`, `padding`) accept responsive values.
162
+
163
+ ### ThemeBreakpoints
164
+
165
+ Built-in keys are `default` and `mobile`. Add custom breakpoints:
166
+
167
+ ```ts
168
+ import { createBreakpoint, type ThemeBreakpoint } from "@dextinity/mail-react";
169
+
170
+ const theme = createTheme({
171
+ breakpoints: { tablet: createBreakpoint(540) },
172
+ sizes: {
173
+ contentIndentation: { default: 40, tablet: 30, mobile: 20 },
174
+ },
175
+ });
176
+
177
+ declare module "@dextinity/mail-react" {
178
+ interface ThemeBreakpoints {
179
+ tablet: ThemeBreakpoint;
180
+ }
181
+ }
182
+ ```
183
+
184
+ New breakpoint keys automatically become available in all responsive theme values.
185
+
186
+ ### ThemeBackgroundColors and ThemeColors
187
+
188
+ Add project-specific color tokens:
189
+
190
+ ```ts
191
+ const theme = createTheme({
192
+ colors: {
193
+ background: { highlight: "#FFF3CD", footer: "#1A1A2E" },
194
+ brand: { primary: "#0066CC", secondary: "#004499" },
195
+ },
196
+ });
197
+
198
+ declare module "@dextinity/mail-react" {
199
+ interface ThemeBackgroundColors {
200
+ highlight: string;
201
+ footer: string;
202
+ }
203
+ interface ThemeColors {
204
+ brand: { primary: string; secondary: string };
205
+ }
206
+ }
207
+ ```
208
+
209
+ ---
210
+
211
+ ## MjmlMailRoot
212
+
213
+ Root element for every email template. Renders the full MJML skeleton (`<mjml>`, `<mj-head>`, `<mj-body>`) and provides the theme to all descendant components.
214
+
215
+ **What it configures from the theme:**
216
+
217
+ - Body width from `theme.sizes.bodyWidth`
218
+ - Body background from `theme.colors.background.body`
219
+ - MJML breakpoint from `theme.breakpoints.mobile` (controls when columns stack)
220
+ - Base font family from `theme.text.fontFamily`
221
+ - Zero default padding on all components
222
+ - Renders all registered styles (`registerStyles`) in the `<head>`
223
+
224
+ **In Storybook:** the decorator wraps stories automatically — pass a custom theme via `parameters.theme`. **Outside Storybook:** wrap content in `MjmlMailRoot` yourself.
225
+
226
+ ---
227
+
228
+ ## MjmlSection
229
+
230
+ Full-width horizontal row with theme integration.
231
+
232
+ **CSS classes:** `.mjmlSection`, `.mjmlSection--indented` (when `indent` is set).
233
+
234
+ ```tsx
235
+ <MjmlSection indent>
236
+ <MjmlColumn><MjmlText>Indented content</MjmlText></MjmlColumn>
237
+ </MjmlSection>
238
+
239
+ <MjmlSection disableResponsiveBehavior slotProps={{ group: { width: "100%" } }}>
240
+ <MjmlColumn><MjmlText>Won't stack</MjmlText></MjmlColumn>
241
+ <MjmlColumn><MjmlText>on mobile</MjmlText></MjmlColumn>
242
+ </MjmlSection>
243
+ ```
244
+
245
+ Indentation values come from `theme.sizes.contentIndentation`, which supports responsive values.
246
+
247
+ **Inside `MjmlWrapper`:** the theme-default `backgroundColor` is suppressed so the wrapper's background shows through. An explicit `backgroundColor` prop still wins.
248
+
249
+ ---
250
+
251
+ ## MjmlWrapper
252
+
253
+ Groups multiple `MjmlSection`s that share a background. Must be a direct child of `MjmlBody`; sections go inside.
254
+
255
+ The wrapper takes the theme's content background by default. Inner `MjmlSection`s suppress their own theme-default background so the wrapper's color shows through; an explicit `backgroundColor` on an inner section still wins.
256
+
257
+ ```tsx
258
+ <MjmlWrapper backgroundColor="#dddddd">
259
+ <MjmlSection indent>
260
+ <MjmlColumn>
261
+ <MjmlText>First row</MjmlText>
262
+ </MjmlColumn>
263
+ </MjmlSection>
264
+ <MjmlSection indent>
265
+ <MjmlColumn>
266
+ <MjmlText>Second row</MjmlText>
267
+ </MjmlColumn>
268
+ </MjmlSection>
269
+ </MjmlWrapper>
270
+ ```
271
+
272
+ Typical uses: multi-section footers with their own color, or grouping sections behind a shared outer padding (e.g., the `direction="rtl"` workaround in [`layout-patterns.md`](layout-patterns.md)). For a region that also needs different default text color or variants, combine `MjmlWrapper` with a scoped `ThemeProvider` — see Scoped Theming below.
273
+
274
+ ---
275
+
276
+ ## Text Components
277
+
278
+ ### MjmlText
279
+
280
+ MJML text component — use inside `MjmlColumn` following the standard layout model.
281
+
282
+ **CSS classes:** `.mjmlText`, `.mjmlText--{variant}`, `.mjmlText--bottomSpacing`.
283
+
284
+ ```tsx
285
+ <MjmlText variant="heading" bottomSpacing>Large heading with spacing</MjmlText>
286
+ <MjmlText variant="body">Regular body text</MjmlText>
287
+ <MjmlText>Uses defaultVariant if set in theme</MjmlText>
288
+ ```
289
+
290
+ Variant styles merge on top of base theme text styles — properties not set by the variant inherit from the base.
291
+
292
+ ### HtmlText
293
+
294
+ Themed text for use inside ending tags (`MjmlText`, `MjmlRaw`) or custom HTML structures where MJML components can't be used. Renders a plain HTML element.
295
+
296
+ **CSS classes:** `.htmlText`, `.htmlText--{variant}`, `.htmlText--bottomSpacing`.
297
+
298
+ ```tsx
299
+ <MjmlColumn>
300
+ <MjmlRaw>
301
+ <tr>
302
+ <HtmlText variant="body">Themed text in a row of the column's table</HtmlText>
303
+ </tr>
304
+ </MjmlRaw>
305
+ </MjmlColumn>
306
+
307
+ <MjmlText>
308
+ <HtmlText element="div" variant="caption">Rendered as a div</HtmlText>
309
+ </MjmlText>
310
+ ```
311
+
312
+ ### Bottom Spacing
313
+
314
+ Use `bottomSpacing` to add consistent vertical spacing below text elements:
315
+
316
+ ```tsx
317
+ <MjmlText bottomSpacing>First paragraph with spacing below</MjmlText>
318
+ <MjmlText bottomSpacing>Second paragraph with spacing below</MjmlText>
319
+ <MjmlText>Last paragraph, no extra spacing</MjmlText>
320
+ ```
321
+
322
+ The base spacing value comes from `theme.text.bottomSpacing`. Variants can override it individually with their own `bottomSpacing` property (which also supports responsive values).
323
+
324
+ ---
325
+
326
+ ## HtmlInlineLink
327
+
328
+ `<a>` element for use inside `MjmlText` or `HtmlText`. Inherits parent's font styles — even on Outlook Desktop, which normally overrides link typography with its own defaults.
329
+
330
+ **CSS class:** `.htmlInlineLink`.
331
+
332
+ ```tsx
333
+ <MjmlText variant="body">
334
+ Visit our <HtmlInlineLink href="https://example.com">website</HtmlInlineLink> for more.
335
+ </MjmlText>
336
+ ```
337
+
338
+ ### Outlook Workaround
339
+
340
+ Outlook Desktop ignores `<style>` blocks and applies its own "Hyperlink" style to `<a>` tags, overriding inherited CSS. `HtmlInlineLink` counters this by setting explicit inline styles for font properties (sourced from the parent text component's context). On modern clients, a responsive CSS reset ensures the link adapts when responsive variant overrides apply.
341
+
342
+ ### Custom Color
343
+
344
+ Use `!important` when setting a custom link color — the responsive reset uses `inherit !important`, which would otherwise take precedence:
345
+
346
+ ```tsx
347
+ <HtmlInlineLink href="https://example.com" style={{ color: "#0066cc !important" }}>
348
+ link text
349
+ </HtmlInlineLink>
350
+ ```
351
+
352
+ ---
353
+
354
+ ## Image
355
+
356
+ `MjmlImage` and `HtmlImage` are responsive — the image scales down to fit narrow viewports.
357
+
358
+ **CSS classes:** `.mjmlImage`, `.htmlImage`.
359
+
360
+ ## Divider
361
+
362
+ Themed horizontal line, styled from `theme.divider` (base styles plus variants). Falls back to a built-in default when no theme is in scope; only `variant` requires a theme.
363
+
364
+ - **`MjmlDivider`** — inside `MjmlColumn`. Classes `.mjmlDivider`, `.mjmlDivider--{variant}`.
365
+ - **`HtmlDivider`** — inside ending tags (`MjmlRaw`) or raw HTML. Classes `.htmlDivider`, `.htmlDivider--{variant}`.
366
+
367
+ ```tsx
368
+ <MjmlDivider variant="thick" />
369
+ ```
370
+
371
+ ---
372
+
373
+ ## Button
374
+
375
+ Themed button, styled from `theme.button` (base styles plus variants). Falls back to a built-in default when no theme is in scope; only `variant` requires a theme.
376
+
377
+ - **`MjmlButton`** — inside `MjmlColumn`. Classes `.mjmlButton`, `.mjmlButton--{variant}`, `.mjmlButton--fullWidth`.
378
+ - **`HtmlButton`** — inside ending tags (`MjmlRaw`) or any non-MJML context. Classes `.htmlButton`, `.htmlButton--{variant}`, `.htmlButton--fullWidth`.
379
+
380
+ `theme.button.padding` is the inner spacing around the label; `MjmlButton`'s `padding` prop is the outer spacing. `fullWidth` makes the button span its container. A gradient `backgroundImage` overlays the solid `backgroundColor`, which stays the fallback for clients that drop `background-image` (Outlook). Outlook ignores `border-radius`, so rounded buttons render with square corners there.
381
+
382
+ ```tsx
383
+ <MjmlButton variant="primary" fullWidth href="https://example.com">
384
+ Click me
385
+ </MjmlButton>
386
+ ```
387
+
388
+ ---
389
+
390
+ ## Scoped Theming
391
+
392
+ `ThemeProvider` applies a different theme to a subtree. Common use: dark-background sections.
393
+
394
+ **Prefer `MjmlWrapper` when only the background color changes.** Reach for `ThemeProvider` when text color, variants, or other theme values also need to differ — cloning a theme is overkill for a background-only change.
395
+
396
+ ```tsx
397
+ import { ThemeProvider } from "@dextinity/mail-react";
398
+ import { theme } from "./theme";
399
+
400
+ const darkSectionTheme = {
401
+ ...theme,
402
+ colors: {
403
+ ...theme.colors,
404
+ background: {
405
+ ...theme.colors.background,
406
+ content: "#1A1A2E",
407
+ },
408
+ },
409
+ text: {
410
+ ...theme.text,
411
+ color: "#FFFFFF",
412
+ },
413
+ };
414
+
415
+ function EmailWithDarkFooter() {
416
+ return (
417
+ <>
418
+ <MjmlSection indent>
419
+ <MjmlColumn>
420
+ <MjmlText>Regular content</MjmlText>
421
+ </MjmlColumn>
422
+ </MjmlSection>
423
+
424
+ <ThemeProvider theme={darkSectionTheme}>
425
+ <MjmlSection indent>
426
+ <MjmlColumn>
427
+ <MjmlText>Dark footer with white text</MjmlText>
428
+ </MjmlColumn>
429
+ </MjmlSection>
430
+ </ThemeProvider>
431
+ </>
432
+ );
433
+ }
434
+ ```
435
+
436
+ `ThemeProvider` **replaces** the theme — it does not merge with the parent. Spread the root theme and override only what needs to change to preserve settings like font family, variants, and breakpoints.
437
+
438
+ Theme-aware `registerStyles` entries always resolve against the **root theme** from `MjmlMailRoot`, not nested `ThemeProvider` scopes.
439
+
440
+ ---
441
+
442
+ ## MJML Component Re-exports
443
+
444
+ `@dextinity/mail-react` re-exports all MJML components from `@faire/mjml-react`. Consumers import everything from `@dextinity/mail-react` — never from `@faire/mjml-react` directly.
445
+
446
+ Common re-exports: `MjmlColumn`, `MjmlSpacer`, `MjmlTable`, `MjmlRaw`, `MjmlGroup`, `MjmlAttributes`, `MjmlAll`, `MjmlClass`, `MjmlStyle`, `MjmlComment`, `MjmlConditionalComment`.
447
+
448
+ For the full MJML tag reference: https://documentation.mjml.io/