@luz-ds/ai 0.0.0-stage → 0.2.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 (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +153 -2
  3. package/dist/skills/luz/LICENSE +21 -0
  4. package/dist/skills/luz/SKILL.md +120 -0
  5. package/dist/skills/luz/agents/openai.yaml +7 -0
  6. package/dist/skills/luz/assets/agents/luz-agent-accessibility.md +64 -0
  7. package/dist/skills/luz/assets/agents/luz-agent-legal.md +60 -0
  8. package/dist/skills/luz/assets/agents/luz-agent-optimiza.md +59 -0
  9. package/dist/skills/luz/assets/agents/luz-agent-seogeo.md +63 -0
  10. package/dist/skills/luz/assets/agents/luz-agent-ux.md +55 -0
  11. package/dist/skills/luz/assets/examples/landing-service/app.js +51 -0
  12. package/dist/skills/luz/assets/examples/landing-service/index.html.tpl +83 -0
  13. package/dist/skills/luz/assets/facts.json +53 -0
  14. package/dist/skills/luz/assets/fields.json +104 -0
  15. package/dist/skills/luz/assets/skills/luz-license/SKILL.md +54 -0
  16. package/dist/skills/luz/assets/skills/luz-license/references/notices.md +68 -0
  17. package/dist/skills/luz/assets/skills/luz-license/references/reading.md +24 -0
  18. package/dist/skills/luz/assets/skills/luz-meta/SKILL.md +57 -0
  19. package/dist/skills/luz/assets/skills/luz-meta/references/files.md +37 -0
  20. package/dist/skills/luz/assets/skills/luz-meta/references/head.md +36 -0
  21. package/dist/skills/luz/assets/skills/luz-migrate/SKILL.md +58 -0
  22. package/dist/skills/luz/assets/skills/luz-migrate/references/costs.md +11 -0
  23. package/dist/skills/luz/assets/skills/luz-migrate/references/steps.md +45 -0
  24. package/dist/skills/luz/assets/skills/luz-readme/SKILL.md +88 -0
  25. package/dist/skills/luz/assets/skills/luz-readme/references/ai-tells.md +82 -0
  26. package/dist/skills/luz/assets/skills/luz-readme/references/anatomy.md +211 -0
  27. package/dist/skills/luz/assets/skills/luz-readme/references/audit.md +51 -0
  28. package/dist/skills/luz/assets/skills/luz-readme/references/creative-toolkit.md +71 -0
  29. package/dist/skills/luz/assets/skills/luz-readme/references/structure-by-type.md +66 -0
  30. package/dist/skills/luz/assets/skills/luz-theme/SKILL.md +56 -0
  31. package/dist/skills/luz/assets/skills/luz-theme/references/checks.md +20 -0
  32. package/dist/skills/luz/assets/skills/luz-theme/references/tokens.md +32 -0
  33. package/dist/skills/luz/assets/skills/luz-translate/SKILL.md +53 -0
  34. package/dist/skills/luz/assets/skills/luz-translate/references/glossary.md +29 -0
  35. package/dist/skills/luz/assets/skills/luz-translate/references/rules.md +37 -0
  36. package/dist/skills/luz/assets/templates/app.html.tpl +72 -0
  37. package/dist/skills/luz/assets/templates/blog.html.tpl +54 -0
  38. package/dist/skills/luz/assets/templates/docs.html.tpl +49 -0
  39. package/dist/skills/luz/assets/templates/landing.html.tpl +56 -0
  40. package/dist/skills/luz/assets/tool-map.json +16 -0
  41. package/dist/skills/luz/references/agents.md +21 -0
  42. package/dist/skills/luz/references/components/accordion.md +16 -0
  43. package/dist/skills/luz/references/components/alert.md +13 -0
  44. package/dist/skills/luz/references/components/app-bar.md +34 -0
  45. package/dist/skills/luz/references/components/badge.md +7 -0
  46. package/dist/skills/luz/references/components/bar-list.md +18 -0
  47. package/dist/skills/luz/references/components/breadcrumb.md +13 -0
  48. package/dist/skills/luz/references/components/button-link.md +7 -0
  49. package/dist/skills/luz/references/components/button.md +7 -0
  50. package/dist/skills/luz/references/components/card.md +10 -0
  51. package/dist/skills/luz/references/components/checkbox.md +10 -0
  52. package/dist/skills/luz/references/components/code-block.md +9 -0
  53. package/dist/skills/luz/references/components/copy.md +8 -0
  54. package/dist/skills/luz/references/components/dashboard.md +27 -0
  55. package/dist/skills/luz/references/components/date.md +11 -0
  56. package/dist/skills/luz/references/components/dropdown.md +17 -0
  57. package/dist/skills/luz/references/components/email.md +11 -0
  58. package/dist/skills/luz/references/components/faq.md +38 -0
  59. package/dist/skills/luz/references/components/fieldset.md +17 -0
  60. package/dist/skills/luz/references/components/figure.md +12 -0
  61. package/dist/skills/luz/references/components/hero.md +24 -0
  62. package/dist/skills/luz/references/components/meter.md +8 -0
  63. package/dist/skills/luz/references/components/modal.md +26 -0
  64. package/dist/skills/luz/references/components/navbar.md +23 -0
  65. package/dist/skills/luz/references/components/number.md +11 -0
  66. package/dist/skills/luz/references/components/objects-actions.md +20 -0
  67. package/dist/skills/luz/references/components/objects-grid.md +15 -0
  68. package/dist/skills/luz/references/components/objects-list.md +10 -0
  69. package/dist/skills/luz/references/components/objects-media.md +12 -0
  70. package/dist/skills/luz/references/components/objects-page.md +18 -0
  71. package/dist/skills/luz/references/components/objects-shell.md +15 -0
  72. package/dist/skills/luz/references/components/page-header.md +12 -0
  73. package/dist/skills/luz/references/components/pagination.md +15 -0
  74. package/dist/skills/luz/references/components/progress.md +8 -0
  75. package/dist/skills/luz/references/components/prose.md +19 -0
  76. package/dist/skills/luz/references/components/radio.md +13 -0
  77. package/dist/skills/luz/references/components/range.md +10 -0
  78. package/dist/skills/luz/references/components/section.md +26 -0
  79. package/dist/skills/luz/references/components/select.md +14 -0
  80. package/dist/skills/luz/references/components/sidebar.md +23 -0
  81. package/dist/skills/luz/references/components/site-footer.md +17 -0
  82. package/dist/skills/luz/references/components/site-header.md +26 -0
  83. package/dist/skills/luz/references/components/skip-link.md +11 -0
  84. package/dist/skills/luz/references/components/stat.md +17 -0
  85. package/dist/skills/luz/references/components/switch.md +11 -0
  86. package/dist/skills/luz/references/components/table-sort.md +23 -0
  87. package/dist/skills/luz/references/components/table.md +17 -0
  88. package/dist/skills/luz/references/components/tabs.md +12 -0
  89. package/dist/skills/luz/references/components/tag.md +7 -0
  90. package/dist/skills/luz/references/components/text.md +11 -0
  91. package/dist/skills/luz/references/components/textarea.md +11 -0
  92. package/dist/skills/luz/references/components/toast.md +15 -0
  93. package/dist/skills/luz/references/components/tool.md +38 -0
  94. package/dist/skills/luz/references/components.md +101 -0
  95. package/dist/skills/luz/references/design.md +204 -0
  96. package/dist/skills/luz/references/done.md +45 -0
  97. package/dist/skills/luz/references/kinds/app.md +19 -0
  98. package/dist/skills/luz/references/kinds/blog.md +14 -0
  99. package/dist/skills/luz/references/kinds/docs.md +13 -0
  100. package/dist/skills/luz/references/kinds/landing.md +15 -0
  101. package/dist/skills/luz/references/levels.md +23 -0
  102. package/dist/skills/luz/references/magic.md +84 -0
  103. package/dist/skills/luz/references/reviewers.md +45 -0
  104. package/dist/skills/luz/references/skills.md +23 -0
  105. package/dist/skills/luz/references/stacks.md +8 -0
  106. package/dist/skills/luz/scripts/luz.mjs +1551 -0
  107. package/package.json +42 -3
@@ -0,0 +1,23 @@
1
+ # sidebar
2
+
3
+ The navigation of an app with four views or more.
4
+
5
+ Needs `components/sidebar.css` of catalog.
6
+
7
+ ```html
8
+ <header>
9
+ <button class="luz-nav-toggle" type="button" popovertarget="site-nav" aria-label="Menu">
10
+ <span class="luz-nav-toggle__bar"></span>
11
+ <span class="luz-nav-toggle__bar"></span>
12
+ <span class="luz-nav-toggle__bar"></span>
13
+ </button>
14
+ </header>
15
+
16
+ <nav class="luz-sidebar" id="site-nav" popover aria-label="Main">
17
+ <div class="luz-sidebar__section">
18
+ <div class="luz-sidebar__section-label">Account</div>
19
+ <a class="luz-sidebar__link is-active" href="/profile/" aria-current="page">Profile</a>
20
+ <a class="luz-sidebar__link" href="/billing/">Billing</a>
21
+ </div>
22
+ </nav>
23
+ ```
@@ -0,0 +1,17 @@
1
+ # site-footer
2
+
3
+ The footer of a site.
4
+
5
+ Needs `components/site-footer.css` of catalog.
6
+
7
+ ```html
8
+ <footer class="luz-site-footer">
9
+ <div class="o-container o-container--inline o-row">
10
+ <p>Acme Inc. · MIT licence</p>
11
+ <nav class="o-actions" aria-label="Links">
12
+ <a class="luz-btn luz-btn--ghost luz-btn--sm" href="/status/">Service status</a>
13
+ <a class="luz-btn luz-btn--ghost luz-btn--sm" href="/accessibility/">Accessibility statement</a>
14
+ </nav>
15
+ </div>
16
+ </footer>
17
+ ```
@@ -0,0 +1,26 @@
1
+ # site-header
2
+
3
+ The header of a site: the name and its links.
4
+
5
+ Needs `components/navbar.css` and `components/sidebar.css` and `components/site-header.css` of catalog.
6
+
7
+ ```html
8
+ <header class="luz-site-header o-sticky">
9
+ <div class="o-container o-container--inline o-row">
10
+ <button class="luz-nav-toggle" type="button" popovertarget="site-nav" aria-label="Menu">
11
+ <svg viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h16M4 12h16M4 18h16"/></g></svg>
12
+ </button>
13
+ <a class="luz-site-header__brand" href="/">Acme Summit</a>
14
+ <nav class="luz-navbar" id="site-nav" aria-label="Main" popover>
15
+ <ul class="luz-navbar__list">
16
+ <li><a class="luz-navbar__link" href="/programme/" aria-current="page">Programme</a></li>
17
+ <li><a class="luz-navbar__link" href="/speakers/">Speakers</a></li>
18
+ <li><a class="luz-navbar__link" href="/tickets/">Tickets</a></li>
19
+ </ul>
20
+ </nav>
21
+ <div class="o-row luz-site-header__actions">
22
+ <a class="luz-btn luz-btn--ghost" href="/account/">Log in</a>
23
+ </div>
24
+ </div>
25
+ </header>
26
+ ```
@@ -0,0 +1,11 @@
1
+ # skip-link
2
+
3
+ The first link of every page, to the main content.
4
+
5
+ ```html
6
+ <body>
7
+ <a class="luz-skip-link" href="#main-content">Skip to main content</a>
8
+ <header class="o-sticky">…</header>
9
+ <main id="main-content" tabindex="-1">…</main>
10
+ </body>
11
+ ```
@@ -0,0 +1,17 @@
1
+ # stat
2
+
3
+ A figure and what it counts.
4
+
5
+ Needs `components/section.css` and `components/stat.css` of catalog.
6
+
7
+ ```html
8
+ <ul class="o-grid o-grid--3">
9
+ <li>
10
+ <div class="luz-stat">
11
+ <p class="luz-stat__value">4,000+</p>
12
+ <p class="luz-stat__label">teams on the platform</p>
13
+ </div>
14
+ </li>
15
+ <!-- one li for each stat; a card is a li.luz-card -->
16
+ </ul>
17
+ ```
@@ -0,0 +1,11 @@
1
+ # switch
2
+
3
+ A setting that takes effect at once.
4
+
5
+ ```html
6
+ <label class="luz-toggle">
7
+ <input class="luz-toggle__input" type="checkbox" role="switch">
8
+ <span class="luz-toggle__track" aria-hidden="true"><span class="luz-toggle__thumb"></span></span>
9
+ <span class="luz-toggle__label">Weekly digest</span>
10
+ </label>
11
+ ```
@@ -0,0 +1,23 @@
1
+ # table-sort
2
+
3
+ A table the reader sorts by a column.
4
+
5
+ ```html
6
+ <table class="luz-table" id="routes">
7
+ <caption>Parcels per route</caption>
8
+ <thead>
9
+ <tr>
10
+ <!-- With a link: it sorts on the server without JavaScript -->
11
+ <th scope="col" data-luz-sort><a href="?sort=route#routes">Route</a></th>
12
+ <!-- Plain text: the script makes it a button -->
13
+ <th scope="col" class="luz-table__numeric" data-luz-sort>Parcels</th>
14
+ </tr>
15
+ </thead>
16
+ <tbody>
17
+ <tr>
18
+ <td data-label="Route">Sevilla to Madrid</td>
19
+ <td class="luz-table__numeric" data-label="Parcels" data-sort-value="1204">1,204</td>
20
+ </tr>
21
+ </tbody>
22
+ </table>
23
+ ```
@@ -0,0 +1,17 @@
1
+ # table
2
+
3
+ Rows and columns of data, with a horizontal scroll inside its wrapper.
4
+
5
+ ```html
6
+ <div class="luz-table-wrap" role="region" aria-label="Invoices" tabindex="0">
7
+ <table class="luz-table">
8
+ <caption>Invoices</caption>
9
+ <thead>
10
+ <tr><th scope="col">Number</th><th scope="col">Date</th><th scope="col">Amount (€)</th></tr>
11
+ </thead>
12
+ <tbody>
13
+ <tr><td data-label="Number">INV-0042</td><td data-label="Date">1 Oct 2026</td><td data-label="Amount (€)">120.00</td></tr>
14
+ </tbody>
15
+ </table>
16
+ </div>
17
+ ```
@@ -0,0 +1,12 @@
1
+ # tabs
2
+
3
+ Two to five views of the same thing, one at a time.
4
+
5
+ ```html
6
+ <nav class="luz-tabs" aria-label="Project">
7
+ <a class="luz-tab" href="#project-summary">Summary</a>
8
+ <a class="luz-tab" href="#project-settings">Settings</a>
9
+ </nav>
10
+ <div class="luz-tabpanel" id="project-summary">…</div>
11
+ <div class="luz-tabpanel" id="project-settings">…</div>
12
+ ```
@@ -0,0 +1,7 @@
1
+ # tag
2
+
3
+ A short label of a category.
4
+
5
+ ```html
6
+ <span class="luz-tag luz-tag--green luz-tag--dot">Running</span>
7
+ ```
@@ -0,0 +1,11 @@
1
+ # text
2
+
3
+ A text field: label, control, help text and error.
4
+
5
+ ```html
6
+ <div class="luz-field">
7
+ <label class="luz-field__label" for="name">Project name</label>
8
+ <input class="luz-input" id="name" type="text" aria-describedby="name-hint">
9
+ <div class="luz-field__helper" id="name-hint">Shown on the dashboard.</div>
10
+ </div>
11
+ ```
@@ -0,0 +1,11 @@
1
+ # textarea
2
+
3
+ A text of several lines.
4
+
5
+ ```html
6
+ <div class="luz-field">
7
+ <label class="luz-field__label" for="textarea">Message</label>
8
+ <textarea class="luz-input luz-input--textarea" id="textarea" rows="4" maxlength="500" aria-describedby="textarea-hint"></textarea>
9
+ <div class="luz-field__helper" id="textarea-hint">Up to 500 characters.</div>
10
+ </div>
11
+ ```
@@ -0,0 +1,15 @@
1
+ # toast
2
+
3
+ A short message after an action, that goes away.
4
+
5
+ ```html
6
+ <div role="status">
7
+ <div class="luz-toast">
8
+ <div class="luz-toast__content">
9
+ <div class="luz-toast__kind">Saved</div>
10
+ <div class="luz-toast__msg">Draft saved.</div>
11
+ </div>
12
+ <button class="luz-toast__close" type="button" aria-label="Dismiss notification">×</button>
13
+ </div>
14
+ </div>
15
+ ```
@@ -0,0 +1,38 @@
1
+ # tool
2
+
3
+ A page that is a tool: the settings and the result, side by side when both fit.
4
+
5
+ Needs `components/tool.css` of catalog.
6
+
7
+ ```html
8
+ <div class="luz-tool">
9
+ <form class="luz-tool__settings o-stack" aria-labelledby="settings-title">
10
+ <h2 id="settings-title">Settings</h2>
11
+ <div class="o-grid o-grid--split">
12
+ <div class="luz-field">
13
+ <label class="luz-field__label" for="country">Country</label>
14
+ <select class="luz-select" id="country">…</select>
15
+ </div>
16
+ <div class="luz-field">
17
+ <label class="luz-field__label" for="rows">Rows</label>
18
+ <input class="luz-input" id="rows" type="number" value="20" min="1" max="1000">
19
+ </div>
20
+ </div>
21
+ <details>
22
+ <summary>More options</summary>
23
+ <fieldset class="luz-fieldset">…</fieldset>
24
+ </details>
25
+ </form>
26
+ <section class="luz-tool__result o-stack" aria-labelledby="result-title">
27
+ <div class="o-row">
28
+ <h2 id="result-title">Result</h2>
29
+ <button class="luz-btn luz-btn--primary" type="button">Download CSV</button>
30
+ <button class="luz-btn luz-btn--ghost" type="button">Copy</button>
31
+ </div>
32
+ <p role="status">20 rows for Spain</p>
33
+ <div class="luz-table-wrap" role="region" aria-label="Rows made" tabindex="0">
34
+ <table class="luz-table">…</table>
35
+ </div>
36
+ </section>
37
+ </div>
38
+ ```
@@ -0,0 +1,101 @@
1
+ # Components to copy
2
+
3
+ The pieces a page is built from, as LUZ documents them. This file is the index: open the file of a piece only when the page needs it, `references/components/<id>.md`, and copy its block, changing its words, never its classes. A piece that is not here is the plain HTML element, with no class, and a class of your own in `@layer site` for its look (R5). A piece of catalog needs its stylesheet linked after core: the starter page links the ones of its kind, and the file of the piece names it.
4
+
5
+ ## Layout
6
+
7
+ - `objects-page`: A page: the header, the main content in a centred column, the footer.
8
+ - `objects-shell`: An app: a sidebar and the main area. Only with four destinations or more.
9
+ - `objects-actions`: Two columns that stack on a phone, and a row of two or three actions.
10
+ - `objects-grid`: As many equal columns as fit, none narrower than 16rem.
11
+ - `objects-list`: A list of cards laid out as a grid.
12
+ - `objects-media`: An icon or a picture next to its text.
13
+
14
+ ## Forms
15
+
16
+ - `text`: A text field: label, control, help text and error.
17
+ - `email`: An e-mail address.
18
+ - `number`: A number, with its unit in the label.
19
+ - `date`: A date.
20
+ - `textarea`: A text of several lines.
21
+ - `range`: A value on a scale, with its output.
22
+
23
+ ## Choices
24
+
25
+ - `select`: One option of a list longer than five.
26
+ - `checkbox`: Several options of a short list, in a group.
27
+ - `radio`: One option of two to five, all visible.
28
+ - `switch`: A setting that takes effect at once.
29
+
30
+ ## Groups of fields
31
+
32
+ - `fieldset`: Related fields under one legend.
33
+
34
+ ## Actions
35
+
36
+ - `button`: The one main action of the view: primary. The others are secondary, outline or ghost.
37
+ - `button-link`: A link that looks like a button: it goes somewhere, it does not act.
38
+ - `dropdown`: A menu of actions behind one button.
39
+ - `copy`: Copies a text, and says it did.
40
+
41
+ ## Content
42
+
43
+ - `card`: One item of a set: a title, a short text, an action.
44
+ - `table`: Rows and columns of data, with a horizontal scroll inside its wrapper.
45
+ - `table-sort`: A table the reader sorts by a column.
46
+ - `accordion`: Sections the reader opens one at a time: options that are rarely changed.
47
+ - `tabs`: Two to five views of the same thing, one at a time.
48
+ - `code-block`: A block of code or of generated text.
49
+ - `figure`: A picture, a chart or a code sample with its caption.
50
+ - `prose`: Running text written elsewhere (Markdown, a CMS).
51
+ - `tag`: A short label of a category.
52
+ - `badge`: A count or a status next to a name.
53
+
54
+ ## Feedback
55
+
56
+ - `alert`: A message that stays: a result, a warning, an error of the whole form.
57
+ - `toast`: A short message after an action, that goes away.
58
+ - `progress`: How far a task has gone.
59
+ - `meter`: A measure within a known range.
60
+ - `modal`: A question that must be answered before going on. Rarely the right choice.
61
+
62
+ ## Navigation
63
+
64
+ - `breadcrumb`: Where the page is in a tree of three levels or more.
65
+ - `pagination`: The pages of a long list.
66
+ - `skip-link`: The first link of every page, to the main content.
67
+
68
+ ## Catalog: the parts of a page
69
+
70
+ - `site-header`: The header of a site: the name and its links.
71
+ - `navbar`: The links of the header, folded behind a button on a phone.
72
+ - `hero`: The top of a landing page: the headline, the benefit, one action.
73
+ - `section`: A section of a landing page with its title.
74
+ - `stat`: A figure and what it counts.
75
+ - `page-header`: The title and the lead of an inner page.
76
+ - `faq`: Questions and answers.
77
+ - `site-footer`: The footer of a site.
78
+
79
+ ## Catalog: apps
80
+
81
+ - `sidebar`: The navigation of an app with four views or more.
82
+ - `app-bar`: The bar at the top of an app: the product and the account.
83
+ - `dashboard`: Panels of figures and data.
84
+ - `tool`: A page that is a tool: the settings and the result, side by side when both fit.
85
+ - `bar-list`: Named values compared as bars.
86
+
87
+ ## Tokens
88
+
89
+ A site's own CSS reads these names, in the layer `site`, and never a value typed again. The values are LUZ's: never redefine one in a page.
90
+
91
+ - Space (gaps, padding, margins): `--luz-space-3xs`, `--luz-space-2xs`, `--luz-space-xs`, `--luz-space-sm`, `--luz-space-md`, `--luz-space-lg`, `--luz-space-xl`, `--luz-space-2xl`, `--luz-space-3xl`, `--luz-space-4xl`
92
+ - Type sizes: `--luz-text-xs`, `--luz-text-sm`, `--luz-text-md`, `--luz-text-base`, `--luz-text-lg`, `--luz-text-xl`, `--luz-text-2xl`, `--luz-text-3xl`, `--luz-text-4xl`
93
+ - Fonts: `--luz-font-sans`, `--luz-font-serif`, `--luz-font-mono`, `--luz-font-heading`, `--luz-font-body`
94
+ - Text colours: `--luz-text-body`, `--luz-text-primary`, `--luz-text-secondary`, `--luz-text-muted`, `--luz-text-disabled`, `--luz-text-on-fill`
95
+ - Surfaces and lines: `--luz-surface-page`, `--luz-surface`, `--luz-surface-hover`, `--luz-surface-pressed`, `--luz-surface-muted`, `--luz-surface-strong`, `--luz-surface-media`, `--luz-divider`, `--luz-outline`, `--luz-input-bg`, `--luz-input-border`
96
+ - Brand: `--luz-brand-primary`, `--luz-brand-hover`, `--luz-brand-active`, `--luz-brand-subtle`, `--luz-brand-fill`, `--luz-brand-fill-hover`, `--luz-brand-fill-active`
97
+ - States: `--luz-color-success`, `--luz-color-success-bg`, `--luz-color-danger`, `--luz-color-danger-bg`, `--luz-color-danger-fill`, `--luz-color-warning`, `--luz-color-warning-accent`, `--luz-color-warning-bg`, `--luz-color-info`, `--luz-color-info-bg`, `--luz-color-teal`, `--luz-color-teal-bg`, `--luz-color-purple`, `--luz-color-purple-bg`, `--luz-color-code`
98
+ - Radius, shadow and focus: `--luz-radius-none`, `--luz-radius-sm`, `--luz-radius-md`, `--luz-radius-full`, `--luz-shadow-sm`, `--luz-shadow-md`, `--luz-shadow-lg`, `--luz-shadow-icon`, `--luz-focus-ring`
99
+ - Sizes of controls: `--luz-control-sm`, `--luz-control-md`, `--luz-control-lg`, `--luz-control-xl`
100
+ - Motion: `--luz-duration-instant`, `--luz-duration-fast`, `--luz-duration-base`, `--luz-duration-slow`, `--luz-duration-slower`, `--luz-duration-lazy`, `--luz-easing-standard`, `--luz-easing-enter`, `--luz-easing-exit`, `--luz-easing-spring`, `--luz-easing-linear`
101
+ - Charts: `--luz-chart-1`, `--luz-chart-2`, `--luz-chart-3`, `--luz-chart-4`, `--luz-chart-5`, `--luz-chart-6`, `--luz-chart-track`, `--luz-chart-grid`
@@ -0,0 +1,204 @@
1
+ # Designing the page
2
+
3
+ Read this before you fill in a page (step 6, and Magic). The check says the markup is valid LUZ; it never says the page is good. A page is good when the person finds what they came for at once, sees the one thing to do, and gets a visible answer when they do it. Build the page from a recipe below and the markup of `references/components.md`, then judge it with `references/done.md`.
4
+
5
+ ## The rules
6
+
7
+ Each one can be checked on the page or in its HTML.
8
+
9
+ 1. **What the person comes to get goes first and gets the most room.** What they set up goes beside it, or folded. A result, an answer or the product is never more than one screen below the top.
10
+ 2. **One primary action per view** (`luz-btn luz-btn--primary`, or a bare `button` with no `type`). Every other action is `luz-btn--secondary`, `luz-btn--outline` or `luz-btn--ghost`.
11
+ 3. **Forms are short.** Two short fields side by side on a wide screen (`o-grid o-grid--split`). More than seven controls are grouped in `fieldset`s, and the ones rarely changed are folded in a `details`. The default values already give a result.
12
+ 4. **Labels have one to three words.** The explanation goes in the help text (`luz-field__helper`) or out of the form; a technical detail in brackets never goes in a label.
13
+ 5. **Navigation fits the page.** No sidebar under four real destinations, and no menu button for links that fit in a row. A page of one view has a header with its name and no navigation.
14
+ 6. **Tables never break an identifier.** A table sits in its `luz-table-wrap` and scrolls sideways inside it; an id, a code or a number stays on one line (put it in `<code>`, and in your own CSS give that column `white-space: nowrap`).
15
+ 7. **A phone gets the task, not a long scroll.** Never more than three full-width buttons in a row; actions that belong together share a row (`o-row`). The result is one tap away: it comes first, or a link at the top jumps to it.
16
+ 8. **Every action answers where the person looks.** The button says what happened (`Copied`), a count changes, a `role="status"` line says what was made. Never silence, and never only a line far from the action.
17
+ 9. **What can update by itself does.** When the result follows from the settings in the browser at once, there is no "Generate" button: it changes as the settings change.
18
+ 10. **One rhythm.** Spacing comes from the layout objects (`o-stack`, `o-row`, `o-grid`) and the `--luz-space-*` steps, never a margin typed on one element. Related things sit close, unrelated things apart.
19
+
20
+ ## Choose a direction first
21
+
22
+ Before you write, decide three things and say them in one line (in Magic, with the spec). Two pages made by the skill should not look the same.
23
+
24
+ - **The composition of the top of the page**, one of four:
25
+ 1. *Split*: the headline and lead on one side, the product (a tool, a picture, a figure) on the other. The default for a landing page.
26
+ 2. *Stacked*: a large headline, one sentence, then the product the whole width below. For a tool that needs room.
27
+ 3. *Editorial*: a very large headline over a narrow column of text, the product further down. For a person, an essay, an event.
28
+ 4. *Tool first*: the product at the top, the headline a line above it. For a page people come back to use (an app, a utility).
29
+ - **The voice of the type**: the serif for headings (LUZ's default, warm, editorial) or the sans (`font-family: var(--luz-font-sans)` on the headings, in your own CSS: plain, technical).
30
+ - **The density**: airy (sections `--luz-space-4xl` apart, a large lead) or compact (`--luz-space-2xl`, more on one screen). A tool is compact; a landing page about a person is airy.
31
+
32
+ ## Recipes
33
+
34
+ Pick the recipe of the page, then copy the blocks it names from `references/components.md`. When none fits, use the simplest (a page with one column, `objects-page`) and say so in the report.
35
+
36
+ ### Tool: settings and a result
37
+
38
+ For a generator, a converter, a calculator, a formatter: the person sets a few things and takes a result away.
39
+
40
+ ```
41
+ Wide (72rem and up) Phone
42
+ +-------------+-------------------+ +----------------+
43
+ | Settings | Result | | Name, one line |
44
+ | (stays put) | actions on top | | Settings, short|
45
+ | More [v] | table or output | | [See result] |
46
+ +-------------+-------------------+ | Result |
47
+ +----------------+
48
+ ```
49
+
50
+ ```html
51
+ <main id="main-content" class="o-container o-stack" tabindex="-1">
52
+ <h1>…</h1>
53
+ <p>…one sentence: what it makes…</p>
54
+ <div class="luz-tool">
55
+ <form class="luz-tool__settings o-stack" aria-labelledby="settings-title">
56
+ <h2 id="settings-title">Settings</h2>
57
+ <div class="o-grid o-grid--split">…two short fields, from components.md…</div>
58
+ <details>
59
+ <summary>More options</summary>
60
+ <fieldset class="luz-fieldset">…the options rarely changed…</fieldset>
61
+ </details>
62
+ <!-- no button when the result follows the settings at once (rule 9) -->
63
+ <button class="luz-btn luz-btn--primary">…verb…</button>
64
+ </form>
65
+ <section class="luz-tool__result o-stack" id="result" aria-labelledby="result-title">
66
+ <div class="o-row">
67
+ <h2 id="result-title">Result</h2>
68
+ <button class="luz-btn luz-btn--secondary" type="button">Copy</button>
69
+ <button class="luz-btn luz-btn--ghost" type="button">Download</button>
70
+ </div>
71
+ <p role="status">…what was made: 20 rows, CSV…</p>
72
+ <div class="luz-table-wrap" role="region" aria-label="…what the rows are…" tabindex="0">
73
+ <table class="luz-table">…</table>
74
+ </div>
75
+ </section>
76
+ </div>
77
+ </main>
78
+ ```
79
+
80
+ `luz-tool` is a pattern of catalog: link `components/tool.css` after core (the app and landing starters link it). The settings and the result sit side by side when both fit and stack below about 640px, with no CSS of yours. Give the table wrapper a name of its own: two regions named "Result" confuse a screen reader.
81
+
82
+ The settings and the result are the page: no sidebar, no dashboard of cards, no hero.
83
+
84
+ ### Dashboard: figures and data
85
+
86
+ For a back office or a summary. Four figures at most in the first row (cards with the figure and what it counts), then the one table or chart that matters most, wide. Filters sit in one row above the data they filter. Use the app starter: `luz-dashboard`, `o-grid o-grid--auto` for the figures, `luz-dashboard__panel--wide` for the table.
87
+
88
+ ### List and detail
89
+
90
+ For orders, messages, records. On a wide screen the list on one side and the item on the other (`o-grid o-grid--split`); on a phone the list, and the item on its own page or below. The list says how many there are and has one search field above it. An empty list says what to do to fill it.
91
+
92
+ ### Long form
93
+
94
+ For a sign-up, a request, settings. One column, as narrow as the longest field needs. `fieldset`s of three to six fields, each with a `legend`; the optional part folded in a `details`. One primary button at the end, named by what it does (`Send request`), and the errors next to their fields and in an alert above the form after a failed send.
95
+
96
+ ### Landing page
97
+
98
+ For a product, an event, a person, leading to a step that happens later. The hero says what it is, the benefit, and has one primary button; then three to five sections in reading order, each with a title that says what follows; the footer. Use the landing starter (`luz-hero`, `luz-section`, `luz-site-footer`).
99
+
100
+ ### Landing page with an integrated service
101
+
102
+ For one tool presented to visitors (a converter in a page that also explains it). The hero is the tool itself: the headline, one sentence, then the settings and the result side by side, laid out by `luz-tool`, in place of the picture. Nothing else comes between the headline and the tool, so the result is in the first screen at 1440 px. The sections that explain it come below. Actions go in an `o-row`: a button straight inside an `o-stack` takes the whole width.
103
+
104
+ A whole page of this kind that works is `assets/examples/landing-service/`: `index.html.tpl` (the example already filled in, the limit under the field, the facts in place of social proof) and `app.js` (the state in one object, the result drawn from it, a copy that says "Copied" and selects the text when the clipboard is refused). Copy both into the site (the first as `index.html`), then change every word, the conversion and the facts.
105
+
106
+ ```html
107
+ <section class="luz-hero" aria-labelledby="hero-title">
108
+ <div class="luz-hero__copy">
109
+ <h1 class="luz-hero__title" id="hero-title">…what it does…</h1>
110
+ <p class="luz-hero__lead">…one sentence…</p>
111
+ </div>
112
+ <div class="luz-tool">
113
+ <form class="luz-tool__settings o-stack" aria-labelledby="settings-title">…two fields a row, from components.md…</form>
114
+ <section class="luz-tool__result o-stack" aria-labelledby="result-title">
115
+ <div class="o-row"><h2 id="result-title">…</h2><button class="luz-btn luz-btn--primary" type="button">…verb…</button></div>
116
+ <p role="status">…the result…</p>
117
+ </section>
118
+ </div>
119
+ </section>
120
+ ```
121
+
122
+ ### Article and documentation
123
+
124
+ For a post, a page of docs. One column of running text, about 45 to 75 characters a line, the title and its lead first, headings that say what follows. Use the blog or docs starter; the table of contents is for a page with four sections or more.
125
+
126
+ ## Typography
127
+
128
+ LUZ's scale has a base of 16 px and a ratio of 1.25: `--luz-text-sm` 14, `base` 16, `lg` 20, `xl` 25, `2xl` 31, `3xl` 39, `4xl` 49 px. A page uses four or five steps, no more, with these settings. Line height and letter spacing are plain numbers in your own CSS; sizes are always the steps.
129
+
130
+ | Part | Size | Line height | Letter spacing | Longest line |
131
+ | --- | --- | --- | --- | --- |
132
+ | Display title (the h1 of a landing page) | `clamp(var(--luz-text-3xl), calc(var(--luz-text-2xl) + 3vw), calc(var(--luz-text-4xl) * 1.6))` | 1 to 1.05 | -0.02em | `max-inline-size: 20ch` |
133
+ | Page title (the h1 of an app or a docs page) | `--luz-text-2xl` or `3xl` | 1.15 | -0.01em | one line |
134
+ | Section title (h2) | `--luz-text-xl` or `2xl` | 1.2 | 0 | one line |
135
+ | Lead (the sentence under a title) | `--luz-text-lg` or `xl` | 1.45 | 0 | `max-inline-size: 45ch` |
136
+ | Body | `--luz-text-base` | 1.6 | 0 | `max-inline-size: 65ch` |
137
+ | Label over a section or a field (an eyebrow) | `--luz-text-xs`, `--luz-font-sans`, upper case | 1.3 | 0.08em | one line |
138
+ | Help text, captions, small print | `--luz-text-sm` | 1.5 | 0 | `65ch` |
139
+
140
+ - The contrast between the display title and the body is what makes a page look made: a title three steps above the body at least.
141
+ - Figures that compare (a price list, a table of results) use `font-variant-numeric: tabular-nums`.
142
+
143
+ ## Colour and rhythm
144
+
145
+ A page has one accent and a short list of neutrals, all LUZ's tokens; the dark and high contrast modes change their values, never your rules.
146
+
147
+ - **Neutrals:** the page `--luz-surface-page`; a panel `--luz-surface`; a quiet band or the background of a result `--luz-surface-muted`; lines `--luz-divider`; ink `--luz-text-primary` for titles and body, `--luz-text-secondary` for leads and labels, `--luz-text-muted` for small print.
148
+ - **One accent:** `--luz-brand-fill` (the primary button) and `--luz-brand-primary` (links, one highlighted word or figure). Nowhere else. The colours of the states (`--luz-color-success`, `danger`, `warning`, `info`) mean a state, never decoration.
149
+ - **One radius and one shadow:** `--luz-radius-md` everywhere it rounds, and `--luz-shadow-sm` or no shadow at all.
150
+ - **One width and one vertical rhythm:** the content in `o-container` (`--luz-content-max`, 1100 px); every section the same distance apart, `padding-block: clamp(var(--luz-space-2xl), 6vw, var(--luz-space-4xl))`; inside a section, `o-stack` and `o-grid` with their own steps.
151
+ - A brand's own colours and fonts are a theme, made with the luz-theme skill (`/luz add luz-theme`), never `--luz-*` values redefined in a page.
152
+
153
+ ## States of interaction
154
+
155
+ Every one of these is in the page, with LUZ's markup. `shot --click` takes a picture after a click, to see the answer.
156
+
157
+ | State | What the person sees | Markup |
158
+ | --- | --- | --- |
159
+ | Copy | The button says "Copied" for a moment, and a status line is read aloud. If the clipboard is refused, the text is still on the page to select | `<button class="luz-copy-btn" type="button" data-copy="…">Copy</button>`: core's script copies, changes the label and announces it; for a result your script makes, set `data-copy` when the result changes, and keep the result in an `<output>` or a read-only `<textarea>` |
160
+ | Result made | One line says what was made, with its count | `<p role="status">20 rows, CSV</p>`, updated when the result changes, never on every key |
161
+ | Empty | What is missing and the one action that fills it | a `<p>` in the panel, and the action as the panel's primary button |
162
+ | No results | That nothing matched, and how to widen it | a `<p>` where the list would be; the search keeps what was typed |
163
+ | Loading | That it is working, and on what | `aria-busy="true"` on the region and a `<progress class="luz-progress">` |
164
+ | Error of the page | What went wrong and what to do | `<div class="luz-alert luz-alert--error" role="alert">` with a title and one sentence |
165
+ | Error of a field | Which field and how to fix it, next to it | `aria-invalid="true"` on the control and `<p class="luz-field__error" id="…">` named by `aria-describedby` |
166
+ | Disabled | Why it cannot be used yet, near it | `disabled` on the control, and the reason in its help text |
167
+ | Focus | Where the keyboard is | core's ring; never `outline: none` |
168
+ | Keyboard | Arrows move in tabs and lists, Enter acts, Escape closes | core's tabs (`luz-tabs`), a native `<dialog>` and `<details>`, a `popover`: they do it with no script of yours |
169
+ | Less motion | Nothing slides or zooms | `@media (prefers-reduced-motion: reduce)` in CSS, and `matchMedia("(prefers-reduced-motion: reduce)")` before any animation in a script |
170
+
171
+ ## When LUZ has no piece for it
172
+
173
+ Each rule that says no has a way to do it with LUZ:
174
+
175
+ - **A piece LUZ does not have** (a pill toggle, a stepper, a special card): write the plain HTML element, then a class of your own (no `luz-`, `o-` or `u-` prefix) in `@layer site`, with LUZ's tokens for every colour, space, size and radius. Never a copy of a LUZ component under another name (`.btn`, `.card`): use LUZ's and add a class of your own beside it.
176
+ - **A size between two steps:** `calc()` of a step (`calc(var(--luz-text-4xl) * 1.3)`), never a literal in px or rem.
177
+ - **A brand's look:** a theme with the luz-theme skill, not tokens redefined in the page.
178
+ - **Motion:** `--luz-duration-*` and `--luz-easing-*`, inside a reduced-motion query.
179
+
180
+ ## When there is no social proof
181
+
182
+ Never a review, a rating, a client logo or a usage counter you were not given. In their place, facts the page can prove:
183
+
184
+ - figures about the product itself: "58 formats", "200 rows a batch", "4 steps";
185
+ - its limits, said plainly: "files up to 10 MB", "works offline";
186
+ - privacy, said first: "nothing leaves your browser", "0 bytes uploaded";
187
+ - how it is made: open source, MIT, no account.
188
+
189
+ ## What not to ship
190
+
191
+ Seen in real runs of `/luz magic`. Each row is a page that passed the check and was still bad.
192
+
193
+ | Bad | Good |
194
+ | --- | --- |
195
+ | Every card the same weight, small titles, setup and result equal | The result large and first; the settings smaller, beside it |
196
+ | One narrow column on a wide screen, half of it empty | The tool recipe: `luz-tool`, settings and result side by side |
197
+ | A "Generate" button at the end of a long form, and six more buttons that look like it | One primary button; copy and download as secondary and ghost, next to the result |
198
+ | Seven fields one under the other, each with help text, and some forty checkboxes in view | Two fields a row, groups in `fieldset`, the rare ones folded in `details`, defaults that work |
199
+ | A label of eight words with a technical note in brackets | A label of one to three words; the note in the help text |
200
+ | A UUID broken over four lines in a cell | The id on one line, the table scrolling inside its wrapper |
201
+ | A full sidebar, and a menu button on a phone, for three anchors of one page | A header with the name, and no navigation |
202
+ | Seven full-width buttons stacked on a phone, three screens before any data | Actions in one row next to the result; the result one tap away |
203
+ | Copy and download that answer with a line of text far away | The button says `Copied`, and a status line says what was made |
204
+ | Paragraphs touching the next label, blocks with no space between them | `o-stack` and `o-grid` space every block by the same steps |
@@ -0,0 +1,45 @@
1
+ # When the page is done
2
+
3
+ Read this after the check passes (step 7, and Magic), before you report. The check reads classes; this reads the page as a person meets it. Fix every point that fails, then report the ones you could not see.
4
+
5
+ ## How to look
6
+
7
+ Looking is not optional: the faults a person sees first (a gap, tabs that look like buttons, a result off the screen) pass every check.
8
+
9
+ - **Run `shot --target <folder>`** after every change of the layout, not only at the end. It prints, for 390, 820 and 1440 px, the path of a picture of the first screen and what it measured: how far the page scrolls sideways, how many screens long it is, where the first primary action is and whether it is in the first screen, how many primary actions there are and how many "…" are left. Add `--click <selector>` to see the answer to an action (a copy button, a tab).
10
+ - **Open every picture and say in one line what you see in it** before you change anything else ("390: the result is under three fields and a long lead; the button wraps"). The line goes in your message, so the person can follow.
11
+ - **If you cannot see images**, judge on the measures and the HTML, and say in the report that nobody looked at the pictures.
12
+ - **If `shot` found no browser or wrote no picture**, read the HTML against each point below, and say in the report that nobody looked at the page rendered, and at which widths the person should look.
13
+
14
+ ## Criteria
15
+
16
+ The check warns about three of them in the HTML (`design/primary-many`, `design/sidebar-few`, `design/form-crowded`): a warning there is a point at 0.
17
+
18
+ 1. At 1440 px, the main action and what it produces are both in the first screen, with no scroll.
19
+ 2. At 390 px, nothing scrolls sideways except a table inside its wrapper, and the result is in the first screen or one link away.
20
+ 3. One primary action per view; every other action is secondary, outline or ghost.
21
+ 4. Every label has one to three words; explanations are help text.
22
+ 5. More than seven controls in a form are grouped in `fieldset`s or folded in `details`, and the default values give a result.
23
+ 6. Every view says something when it is empty, while it loads (if it loads) and when it fails, in words.
24
+ 7. Every action shows a visible answer next to where the person acted.
25
+ 8. No content of the starter page is left (`…`, a sample name, a sample row), and no navigation is left that leads nowhere.
26
+ 9. No sidebar with fewer than four destinations.
27
+ 10. The type follows the table of `references/design.md`: a display title three steps above the body, leads and body within their longest line.
28
+ 11. One accent, one radius, one shadow, one width and one distance between sections.
29
+ 12. Every state of the table of `references/design.md` that the page has is there: copy, result made, empty, no results, loading, errors, focus, less motion.
30
+
31
+ ## Score
32
+
33
+ Give each point 0 (missing), 1 (there, but weak) or 2 (right). Fix everything at 0 and everything at 1 you can; you are done when every point is 2, or when each point left at 1 has its reason written in the report, one line each. Say the score in the report.
34
+
35
+ | Point | 2 means |
36
+ | --- | --- |
37
+ | Hierarchy | The eye finds the result or the product first, the setup second |
38
+ | Layout | The width is used: no empty half of a wide screen, no sideways scroll on a phone |
39
+ | Main action | One primary action, named by its verb, where the eye ends up |
40
+ | Form | Short labels, groups, folded options, defaults that work |
41
+ | Phone | The task works at 390 px in under two screens |
42
+ | Answer | Every action answers visibly; empty and error states have words |
43
+ | Type | The table of `references/design.md`: a strong display title, short leads, body at 16 px and 1.6 |
44
+ | Colour | One accent, the neutrals of LUZ, one radius and one shadow |
45
+ | States | Copy, empty, no results, loading, error, focus and less motion, each where the page has it |
@@ -0,0 +1,19 @@
1
+ ## The kind of site: an app
2
+
3
+ An app is a web application: dashboard, back office, tool. Ask:
4
+
5
+ 1. The navigation: a sidebar (from four views up), a header only (fewer views), or both. A tool of one view has no navigation.
6
+ 2. The first views by name: dashboard, list, detail, form, settings.
7
+ 3. What the data comes from (an API, a store) and who renders it (server or client).
8
+ 4. The empty, loading and error states of each view: their text.
9
+ 5. Whether it needs JavaScript to work at all (a tool that computes in the browser), or only to enhance what the server sends.
10
+
11
+ A tool of one view (settings and a result) is an app with no sidebar: read the tool recipe in `references/design.md`, and remove the sidebar, its toggle and the dashboard from the starter.
12
+
13
+ Start from this skeleton. `luz-nav-toggle` needs `components/sidebar.css`. A menu is a `luz-dropdown` with a `popover`; `luz-btn` is never a `summary`. Numbers are cards; tables, forms, dialogs, tabs and alerts are core's. Data views (bar list, column chart, stacked bar, heat map, line chart) each draw a native table or list that stays in the page; the author supplies the data. A line chart is `<luz-chart>`. A stacked bar part is sized by `style="--v: 62"`, a column or heat map cell by `--v: 0.8` (0 to 1): the one `style` allowed.
14
+
15
+ The skeleton of the page is `assets/templates/app.html.tpl`: `site new --kind app` writes it, and you fill it in.
16
+
17
+ ### JavaScript
18
+
19
+ An app that needs a script to work (it computes or fetches in the browser) has one module, `app.js`, linked with `<script type="module" src="app.js"></script>` after LUZ's scripts, with relative paths so it works from any folder (GitHub Pages too). Keep the state in one object and draw the page from it. Build new elements with `createElement` and `textContent`, never `innerHTML` with data. Use LUZ's elements as they are: a `button` acts, a `form` sends, a `details` folds, a `dialog` asks. The page keeps its heading, its text and its form without the script, and says in a `<noscript>` what does not work without it and why. A second module only past about 300 lines.