@canonical/design-system 0.2.1 → 0.2.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/bun.lock +1 -0
- package/data/concept/Foundations-Grid.ttl +9 -0
- package/data/concept/How-to-differentiate-components-variantsinheritance.ttl +9 -0
- package/data/concept/Indicating-required-fields-in-forms.ttl +9 -0
- package/data/concept/Question-mark-vs-information-icon.ttl +9 -0
- package/data/concepttype/Decision-guide.ttl +5 -0
- package/data/concepttype/Explanation.ttl +5 -0
- package/data/concepttype/How-to-guide.ttl +5 -0
- package/data/concepttype/Mental-model.ttl +5 -0
- package/data/concepttype/Reference.ttl +5 -0
- package/data/concepttype/Tutorial.ttl +5 -0
- package/definitions/ontology.ttl +35 -0
- package/package.json +2 -1
- package/skills/adoption-a1-styles/SKILL.md +54 -1
- package/skills/adoption-a2-components/SKILL.md +48 -1
- package/skills/adoption-a3-forms/SKILL.md +48 -1
- package/skills/anatomy-author/SKILL.md +41 -1
- package/skills/design-auditor/SKILL.md +41 -1
- package/skills/implement-component/SKILL.md +28 -1
- package/skills/specify-component/SKILL.md +38 -1
- package/skills/specify-pattern/SKILL.md +40 -1
- package/source.json +36 -1
- package/src/collect/generateTurtle.tests.ts +148 -0
- package/src/collect/generateTurtle.ts +71 -22
- package/src/collect/types.ts +20 -0
- package/src/config/source.schema.json +27 -0
- package/src/config/types.ts +25 -0
- package/src/transform/rowFilter.tests.ts +100 -0
- package/src/transform/rowFilter.ts +55 -0
- package/src/transform/transform.ts +7 -1
package/bun.lock
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:concept.Foundations-Grid a ds:Concept;
|
|
4
|
+
ds:name "Foundations: Grid";
|
|
5
|
+
ds:summary "";
|
|
6
|
+
ds:tier ds:global;
|
|
7
|
+
ds:content "**Status:** Final \n**Version:** 1.0 \n**Last updated:** 2026-04-24\n\n\n\n## Table of contents\n\n1. [Glossary](#glossary)\n2. [Problem statement and scope](#1-problem-statement-and-scope)\n3. [Core principles (universal)](#2-core-principles)\n4. [Editorial and marketing sites](#3-editorial-and-marketing-sites)\n5. [Documentation](#4-documentation)\n6. [Applications](#5-applications)\n7. [Responsive reflow](#6-responsive-reflow)\n8. [When to use the grid](#7-when-to-use-the-grid)\n9. [Form layouts](#8-form-layouts)\n10. [Future work](#9-future-work)\n\n\n\n## Glossary\n\nTable 21\n\n\n\n## 1. Problem statement and scope\n\n### 1.1 The problem\n\nOur design system serves three tiers:\n\n- **Apps:** Application UIs – dashboards, forms, settings pages, admin panels (MAAS, Landscape, Launchpad, Snapcraft, support portal, and ~50 other products)\n- **Sites:** Editorial / marketing sites – [ubuntu.com](http://ubuntu.com), [canonical.com](http://canonical.com), blog content\n- **Docs:** Product documentation\n\nThese tiers have different grid needs. Application UIs require multiple concurrent grid contexts (main content alongside drawers, panels, and toolbars) with fluid, edge-to-edge layouts. Editorial and marketing sites use a single centered grid with a maximum content width and wider gutters that give editorial content more breathing room. Documentation shares the editorial grid model but typically uses narrower content columns with side navigation.\n\nA single grid configuration does not serve all three well. This specification defines the shared column system and the per-tier rules built on top of it.\n\n### 1.2 Scope\n\nThis specification covers the horizontal grid system: column counts, column spans, gutters, outer margins, and layout strategy per tier.\n\n- Column structure and bisection rule\n- Gutter and outer margin values per tier and breakpoint\n- Viewport-based vs container-based grid contexts\n- Drawer and panel sizing (applications)\n- Nested grid alignment\n- When to use the grid vs other layout primitives\n\nOut of scope:\n\n- Vertical spacing and baseline grid (see the [spacing specification](https://coda.io/d/Docs_dTaVNZxkPrA/Spacing-architecture-0-4_su8_Tyhn#Table-11_turSlbF2))\n- Typography specification (referenced where relevant)\n- Implementation details (CSS architecture, component APIs, tooling)\n\n### 1.3 Goals\n\n1. **Predictability:** Grid behaviour is deterministic and learnable across all tiers\n2. **Visual coherence:** Shared column counts and bisection rule produce consistent keylines everywhere\n3. **Tier fit:** Each tier uses the grid model best suited to it\n4. **Composability:** Components placed on the grid in one tier work correctly when reused in another\n\n\n\n## 2. Core principles\n\nThese apply universally across all three tiers.\n\n### 2.1 Column counts\n\nColumn counts are determined by **container width** (applications) or **viewport width** (sites and documentation):\n\nTable 22\n\nThe two 8-column ranges are intentionally separate. Both use the same column count, but the breakpoint between them gives components a second threshold at which to switch layout – for example from stacked to side-by-side – within the mid-range.\n\n**Rationale for 240px minimum**: This is our current default minimum aside width, below which content truncation becomes excessive. It accommodates the minimum comfortable width for form fields, navigation items, and side panels.\n\n**Rationale for column counts**: We intentionally use only 4, 8, or 16 columns to create a structure where keylines either bisect spaces or follow parent keylines. This avoids the awkward offset-by-1 alignment issues that occur with 12-column grids (which permit thirds), and the column rivers that appear when the browser is left to choose a count freely. \n\n\n\n*Order emerging from restraint: 8 column grid with disciplined subdivision on the right compared to a 12 column grid with no restrictions.*\n\n### 2.2 Column span rule\n\nValid spans are power-of-2 fractions of the current column count – half, quarter, or eighth:\n\nTable 23\n\nThis allows uniform rows (e.g. four 2-column-wide cards on an 8-column grid) and the standard 50/50 or 25/75 two-part splits. It disallows thirds and any other non-bisecting division – the same principle that drove the move from 12-column to 8-column grids across the Canonical web portfolio.\n\n### 2.3 Gutter widths and outer margins\n\nGutters and outer margins are set by the **global viewport breakpoint**, not by container width. The tiers share the same values at small viewports but diverge at larger sizes – editorial sites and documentation use wider gutters for the more generous rhythm that content-heavy pages need.\n\n**Sites and documentation:**\n\nTable 24\n\n**Applications:**\n\nTable 25\n\nThe difference is at Large and X-Large: sites and documentation step up to 2rem (32px) gutters, while applications stay at 1.5rem (24px). Application interfaces are denser – tighter gutters give more room to data-heavy content, panels, and multi-column controls. Sites have more breathing room by design, so the wider gutter matches the editorial rhythm.\n\n### 2.4 Nested grids\n\n**All nested grids follow their parent container’s grid structure.** When a component establishes a grid within a parent grid cell, columns can only start at parent column offsets. This creates consistent vertical keylines throughout the interface.\n\nNo column is allowed to start anywhere except at parent column offsets. The grid subdivides through bisection (octree pattern), maintaining alignment at every nesting level.\n\n\n\n\n\n## 3. Editorial and marketing sites\n\nEditorial and marketing sites ([ubuntu.com](http://ubuntu.com), [canonical.com](http://canonical.com), blog content) use a single, viewport-based grid.\n\n### 3.1 Viewport-based grid\n\nThe full page width minus outer margins forms one grid context. There are no independent sub-grids for drawers or panels – the viewport is the only trigger for column count changes. Column count switches at the standard breakpoint thresholds (see §2.1).\n\n### 3.2 Centered, max-width layout\n\nContent is centered within the viewport and constrained to a maximum width of 80rem. At viewports wider than the max-width, the outer margins grow to absorb the excess space. This is the opposite of application layouts, which fill all available space edge-to-edge.\n\n\n\n### 3.3 Responsive reflow\n\nReflow on sites is driven by **viewport breakpoints**. When the viewport crosses a breakpoint threshold, column count and gutter width update together. There are no panels to trigger mid-viewport reflow – the only trigger is the viewport itself resizing.\n\n\n\n## 4. Documentation\n\nDocumentation follows the same grid model as editorial/marketing sites – viewport-based, centered, same gutter values – but uses a three-region layout:\n\n- **Left: site navigation** – persistent side navigation across all documentation pages. Collapses into a drawer at smaller breakpoints.\n- **Centre: content body** – the article or page content.\n- **Right: on-page table of contents** – anchor links to headings within the current page. At smaller breakpoints this stacks directly below the page’s h1 heading.\n\nEach region occupies a fixed column span on the grid. The content area respects the grid boundaries throughout.\n\n\n\n[example: documentation layout with side navigation and content area across breakpoints]\n\n\n\n## 5. Applications\n\nApplication UIs (for example, MAAS, LXD, Landscape) require multiple concurrent grid contexts and fluid, edge-to-edge layouts.\n\n\n\n### 5.1 Container-based grids\n\nEach major layout region (main content, panels/drawers, toolbars) can establish its own grid context based on its available width. **Panels** are layout zones that resize the main content (e.g., desktop navigation), while **drawers** overlay the main content without changing its size. This allows:\n\n- Consistent layouts regardless of panel positioning\n- Predictable behavior when drawers or panels are resized, hidden, or overlayed\n- Reusable components that adapt to their container\n\n**Key principle**: A drawer at any intrinsic width uses the gutters defined by the **global viewport breakpoint**, not by its own width. For example, a 320px side drawer displayed on a 1800px screen uses 1.5rem (24px) gutters (the application large-breakpoint value), not 1rem (16px). This ensures visual consistency across all drawers and the main area at the same screen size.\n\n### 5.2 Fluid layouts\n\n\n\nApplications use fluid grids that expand to fill available space. Unlike editorial sites, applications should not:\n\n- Have a maximum content width that leaves whitespace at large screens\n- Use centered positioning for the main layout container\n\nFluid grids ensure consistent, edge-to-edge space utilisation across application views and window sizes.\n\nThis spec proposes **container queries** to switch column counts: when a container crosses a defined width threshold, its column count explicitly switches to 4, 8, or 16. Gutter and outer margin values are controlled separately by the global viewport breakpoint (see §2.3). This combination gives explicit, predictable control over both column structure and spacing at every screen size.\n\nNote: We’re currently experimenting with an alternative, “intrinsic” grid approach that uses `auto-fill`, `auto-fit`, or `minmax()` to let the browser determine column count dynamically. The main rationale for this approach is support for predominantly left-aligned layouts: as the browser adds columns to fill available width, the grid naturally grows from the left edge, which makes centered compositions difficult and in practice rules them out. That same behavior creates an interesting opportunity for controlled breakout patterns, where a primary content area can remain on an 8-column reading width while additional columns are used for wider elements such as card grids. This should be used deliberately and with care, because it relaxes some of the explicit 4/8/16-column guardrails this spec is designed to preserve and can introduce column counts outside the canonical set. Container queries remain the recommended implementation mechanism whenever the design depends on one of the three defined column counts; intrinsic behavior is better treated as a deliberate exception for left-aligned and breakout use cases, not the default.\n\n### 5.3 Drawers vs panels\n\nWe distinguish between two types of layout regions:\n\n- **Drawers** overlap the main area without changing its size. Drawers sit on top of the main content without changing its size.\n- **Panels** exist in the same plane as the main area and cause the main area to resize.\n\nApplication layouts have one panel slot per browser window edge. That slot can be subdivided internally – for example into a narrow icon rail and a wider navigation list – but from the grid’s perspective it is a single region with a single width. The main content area occupies the remaining space and establishes its own grid context based on its available width.\n\n### 5.4 Panel/Drawer width constraints\n\nEach drawer type defines minimum and maximum widths. When placed in application landmark regions (`<aside>`, `<main>`, etc.), these internally defined constraints apply:\n\nTable 26\n\n**All applications must use these standardised widths on load.** Inconsistent drawer widths have been identified as a recurring problem across our product suite. If additional flexibility is needed, implement user-adjustable resizing within the min/max constraints above – but the default loaded state must always use the standard small/medium/large values.\n\nTable 9\n\n[Examples of 3 panel/drawer widths. A high contrast border in examples 1 and 2 serves as a resize affordance]\n\n### 5.5 Tile grid\n\nDashboard tile layouts are a common use case. We have explored an approach where component padding (on cards and similar elements) is absorbed into the grid gutters, increasing the proportion of space available for content. This is out of scope for the current spec – see [Future work](#9-future-work) for details and examples. For now, align cards to the grid.\n\n\n\n## 6. Responsive reflow\n\nContainer queries (applications) and viewport breakpoints (sites and documentation) drive all layout transitions. Each grid context has a defined layout for every width bracket – the browser moves between those defined states automatically as the width changes. The product designer’s job is to specify the layout at each bracket; the browser handles transitions between them.\n\n### 6.1 Panel-triggered reflow (applications)\n\nWhen a panel opens or is resized, the main area’s available width shrinks. If that crosses a container query threshold, the main area switches to the corresponding column layout automatically – no additional logic required. The same applies to panels themselves: a panel that narrows past a threshold switches to its own narrower layout. This is container queries working as intended, not a special case.\n\n### 6.2 Narrowing strategy (all tiers)\n\nWhen a grid container becomes too narrow to accommodate its current layout:\n\n1. **First**: Move to the narrower width bracket, which may reduce column count and spans (e.g., switch from an 8-column layout to a 4-column layout)\n2. **Then**: Switch from horizontal to vertical stacking if the narrower layout still doesn’t fit\n\nThis ensures content remains readable and functional at any width, whether the trigger is the viewport resizing (sites and documentation) or a panel opening (applications).\n\n\n\n## 7. When to use the grid\n\n### 7.1 Required\n\nThe grid **must** be used when placing blocks of content side by side. Some examples:\n\n- Placing block-level elements side-by-side (e.g., cards, form sections, data panels)\n- Creating multi-column layouts within a content area\n- Positioning elements that should align vertically across rows\n- Laying out dashboard widgets or data visualisations\n\n### 7.2 Optional\n\nThe grid is **optional** for:\n\n- **Tables**: While the table as a whole must span an exact number of columns, Internal column logic takes precedence. **Guideline**: If aligning table columns to the grid won’t hurt the content (i.e., grid column widths are suitable for the data inside), align to the grid. If alignment causes issues with data display, the table’s internal logic takes precedence.\n\n\n\n### 7.3 Not applicable\n\nThe grid is **not applicable** for:\n\n- **Inline content flows**: Tab labels, toolbar buttons, breadcrumbs – these behave like text and use natural inline layout\n- **Single-column content**: Articles, lists, side navigation – no subdivision needed\n\n### 7.4 Examples – sites and documentation\n\n**Landing page** (grid required):\n\n[example needed]\n\n**Article with side navigation** (grid required):\n\n- Sticky side nav in a narrow column span, article body in the remaining span\n- On narrow viewports the side nav stacks above or collapses\n\n\n\n### 7.5 Examples – applications\n\n\n\n**Combobox strip** (grid optional):\n\n- Labels flow inline like text (no grid needed)\n- But the combobox stri[ can be assigned a column span (e.g., “columns 4–8”)\n\n**Toolbar with left/right groups** (grid exempt):\n\n- Heading floated left\n- Right-aligned elements use CSS flexbox/float, not grid columns\n\n**Data table in main area** (grid optional):\n\n- Table has internal column logic\n- If table columns can align to grid without compromising data display: align to grid\n- If alignment causes truncation or awkward column widths: table takes precedence\n\n**Drawer** (grid required):\n\n- \n\n\n\n\n\n## 8. Form layouts\n\nForms align to grid columns based on their context:\n\n- Centered, spanning 4 columns (columns 3–6) on an 8-column grid – a half-width block in the middle of the page \n\n- **Left-aligned** (applications): Left-aligned, starting from the first column \n\n\n\n\n**Summary of constraints:**\n\n*Universal (all tiers):*\n\n- Column counts: 4, 8, or 16 only\n- Column spans: power-of-2 fractions of the column count (half, quarter, eighth) – no thirds or other non-bisecting splits\n- Nested grids: must align to parent column offsets\n- Gutters: At x-small and small breakpoints, gutters are universal (see the table in seciton 2.3). At larger breakpoints, gutter behavior changes, see below. \n\n*Sites and documentation:*\n\n- Grid context: single viewport-based grid\n- Gutters at large/x-large: 2rem (32px)\n- Layout: centered, max-width constrained\n\n*Applications:*\n\n- Grid context: container-based, multiple concurrent contexts\n- Gutters at large/x-large: 1.5rem (24px)\n- Layout: fluid, edge-to-edge\n- Drawer widths: defined min/max per drawer type, with standardised default widths on load\n\n\n\n## 9. Future work\n\n### Tile grid approaches\n\nDashboard views with tile-based content benefit from a specialised grid configuration. Two approaches worth exploring:\n\n- **Gutter-as-padding**: Use a 2px (or more) gap between tiles, with card padding absorbed into the gutter. This maximises content area within each tile.\n- **Half-gutter variant**: Split the gutter value between tile outer spacing and card inner padding, giving more control over the relative weight of gap vs card breathing room.\n- Future work: add examples for:\n\n[example needed: gutter-as-padding layout vs standard grid layout, side by side] \n[example needed: half-gutter variant showing relative padding proportions]";
|
|
8
|
+
ds:knownEdgeCases "";
|
|
9
|
+
ds:conceptType ds:concepttype.Explanation.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:concept.How-to-differentiate-components-variantsinheritance a ds:Concept;
|
|
4
|
+
ds:name "How to differentiate components (variants/inheritance)";
|
|
5
|
+
ds:summary "This decision tree is helps us categorize UI blocks that share certain attributes: deciding whether we are talking about the same or separate UI blocks, if it’s a matter of inheritance, variants of the same UI block, or simply properties of a block. ";
|
|
6
|
+
ds:tier ds:global;
|
|
7
|
+
ds:content "Given two things (X, Y) that share visual kinship: \n\nTEST 1 — AFFORDANCE \n│ Does X enable a fundamentally different user action than Y? \n│ (Different primary affordance: navigate vs act, input vs display, \n│ dismiss vs inform, filter vs label) \n│ \n│ Diagnostic signals: \n│ • Would X and Y require different HTML elements for semantic correctness? \n│ • Does one respond to user interaction where the other does not? \n│ • Would a screen reader announce them with different roles? \n│ • Could you describe X's purpose with a verb and Y's with a different verb? \n│ \n├─ YES → SPLIT into separate components \n│ (Chip / Label, Button / Link, Checkboxes / Radios*) \n│ \n│ *Note: Radios/Checkboxes remain an open discussion. \n│ The group has explored whether \"Choices\" as a unified \n│ component better captures semantic function. \n│ \n└─ NO → continue to Test 2\n\nTEST 2 — INHERITANCE \n│ Does Y specialise X by narrowing its possibility space and increasing its specificity while \n│ preserving X's affordance and anatomy? \n│ \n│ Diagnostic signals: \n│ • Y preconfigures properties that X leaves open \n│ • Y restricts the API surface (fewer valid inputs) \n│ • Y carries domain-specific opinions (branding, context) \n│ • Y would NOT alter structural properties (spacing, layout) [BrandedLabel an edge case bc of historical reasons] \n│ • Y's name naturally takes the form [Qualifier][Parent] \n│ (BrandedLabel > Label, GithubHero > Hero, NumericalBadge > Badge) \n│ \n├─ YES → Model as INHERITANCE (Y inherits from X) \n│ Y receives all of X's characteristics. \n│ Y is named with parent as suffix. \n│ Y's documentation is separate and references parent's core docs. \n│ \n│ Ontological note: This is a conceptual relationship. \n│ Implementation uses composition (hooks, render composition), \n│ not class inheritance. \n│ \n└─ NO → continue to Test 3\n\nTEST 3 — VARIANT \n│ Does the difference represent a design-time choice between \n│ information delivery strategies under the same affordance? \n│ \n│ Diagnostic signals: \n│ • The choice is made AFTER the component/pattern has been selected \n│ • The choice optimises information flow under constraints (not taste) \n│ • The difference can be articulated as \"when you are in X situation, \n│ use this form\" — i.e., the guidance is constraint-driven \n│ • The semantic meaning and primary affordance are unchanged \n│ \n│ Variant subcategories (provisional, not fully resolved): \n│ \n│ a) COMPLEXITY VARIANT — Same affordance, different information density \n│ (ProfileTag: short / medium / long) \n│ (Timeline: simple / detailed) \n│ (Pagination: basic / complex) \n│ (Tooltip: dense / actions / data visualisation) \n│ \n│ b) PLACEMENT VARIANT — Same affordance, different spatial arrangement \n│ (Hero: image left / image right) \n│ \n├─ YES → Model as VARIANT \n│ Single component page with variant-specific guidance. \n│ Guidance documents the constraints informing recommended choice. \n│ Variants do not exist for aesthetic preference alone. \n│ \n└─ NO → It's a property\n\nTEST 4 — MODIFIER FAMILY \n│ Does the difference represent a cross-cutting communicative axis \n│ that multiple components share? \n│ \n│ Diagnostic signals: \n│ • The variation is about status, emphasis, or hierarchy — not structure \n│ • Other components in the system exhibit the same axis of variation \n│ • Members of the family are mutually exclusive within one instance \n│ • A component consuming the family must support ALL its members \n│ • The variation is expressed through visual tokens (colour, weight), \n│ not structural changes \n│ \n│ Existing families: severity, emphasis, importance, criticality, \n│ density, anticipation, lifecycle \n│ \n├─ YES → Model as MODIFIER FAMILY membership \n│ Component opts into existing family. \n│ Modifier docs live at global level; component references them. \n│ \n└─ NO → Variant \n \nontology meeting notes: [https://docs.google.com/document/d/1HHhTD80-nya5CkrWOzWitDsehDdILz0mkPPHzIySahs/edit?usp=sharing](https://docs.google.com/document/d/1HHhTD80-nya5CkrWOzWitDsehDdILz0mkPPHzIySahs/edit?usp=sharing)";
|
|
8
|
+
ds:knownEdgeCases "";
|
|
9
|
+
ds:conceptType ds:concepttype.How-to-guide.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:concept.Indicating-required-fields-in-forms a ds:Concept;
|
|
4
|
+
ds:name "Indicating required fields in forms";
|
|
5
|
+
ds:summary "This guideline documents and explains the decision for marking required fields in forms, while taking into account WCAG accessibility requirements and examining various methods for indicating required fields in forms. ";
|
|
6
|
+
ds:tier ds:global;
|
|
7
|
+
ds:content "# **Rationale**\n\nAt Canonical, various different methods to indicate required fields within forms in different products. Some denotes the required with a “*”, some do it with text in the label, some denote the optional ones with text in the label, while others denote both. This creates inconsistency between products and even within the same product sometimes. Follwing this guide on when to use what method will provide a more consistent and predictable product experience for users.\n\n# Considerations\n\n## **Accessibility**\n\nAccording to WCAG 2.2 [Success Criterion 3.3.2](https://www.w3.org/TR/WCAG22/#labels-or-instructions) and [Technique H90](https://www.w3.org/WAI/WCAG22/Techniques/html/H90):\n\n1. *For each required form control, check that the required status is indicated in the form control's label or legend.*\n2. *For each indicator of required status that is not provided in text, check that the meaning of the indicator is explained before the form control that uses it.*\n\n\n\nIt can easily be interpreted as “marking all required fields” is necessary. However, many people requested clarification on the Success Criterion (SC), and an [official Working Group response](https://github.com/w3c/wcag/issues/3553#issuecomment-2022967832:~:text=which%20are%20optional).-,If%20some%20or%20all%20fields%20are%20required%20for%20submission%2C%20there%20can,above)%20are%20feasible%20and%20not%20ruled%20out%20by%20this%20success%20criterion.,-Other%20criteria%2C%20such) was provided. It is clear that distinguishing the required and the optional fields is necessary. However, some nuances are heavily debated.\n\n- Is it a failure of the SC to indicate required fields with an asterisk (*) *without* a legend to explain the meaning?\n\nSome Working Group (WG) members believe the answer is *no*, with supporting arguments like [this](https://github.com/w3c/wcag/issues/4791#:~:text=But%20I%20would%20be%20concerned%20with%20creating%20a%20failure%20technique%20stating%20unconditionally%20that%20use%20of%20an%20asterisk%20without%20some%20kind%20of%20legend%20is%20a%20failure.).\n\n- Is it necessary to indicate required fields on *well-understood small forms where all fields are required* like a two-field login form and one-field newsletter subscription form?\n\nMost WG members believe the answer is *no*, with supporting arguments like [this](https://github.com/w3c/wcag/issues/4791#issuecomment-3664703933).\n\n\n\nTo summarize, here are the safe methods that should pass SC 3.3.2.\n\n- Indicating optional fields with “optional” in the label (by implication the other fields would be required).\n- Indicating required fields explicitly by adding \"(required)\" after the label.\n- Use a convention like the asterisk and legend to indicate required fields.\n- State \"all fields are required\" at the beginning of the form (if they are).\n- Do not indicate required fields on small, well-understood forms where all fields are required.\n\n## **Common form scenarios**\n\nThe word “scenario”, instead of “type”or “category” is used here because these are not mutually exclusive classifications. They are characterized mostly by intent or context of the form.\n\n### **Conventional small forms**\n\nThese are forms with very few fields (1-3), where all fields are typically required and the purpose is *immediately* clear. Examples: Login, Sign-up, Newsletter Subscription, Search.\n\nMarking required fields in these forms adds more cognitive load than value.\n\n### **Low-motivation forms**\n\nFor these forms, the user's motivation to complete the submission is often low. We are asking for more information than the user originally intended to provide, and because form submission is usually non-essential to their immediate needs, they are likely to abandon the process. This is common for things like customer survey forms and the majority of sites forms.\n\n\n\nMarking optional fields may result in most fields being marked in some forms, making them more wordy than it should be. On the other hand, marking the required fields makes it clear the minimum information needed to proceed, which can arguably improve conversion rate.\n\n### **High-motivation forms**\n\nFor these forms, the user's motivation to complete the submission is often high. We are asking for essential information that directly facilitates the user's immediate needs, and because form submission is crucial to their goal, they are highly likely to complete the process. This is common for things like forms to complete a task or operation in apps.\n\n\n\nUsers are eager to complete the form, so clearly indicating the required fields meets their expectation, gives them more confidence and promotes a smoother flow.\n\n### **Fully required forms**\n\nForms where every single field must be completed to proceed.\n\nMarking every required field may feel a little redundant, especially when the form is long.\n\n## **Consistency**\n\nUsing one method for all forms is dogmatic and unnecessary. Picking a method for each usage scenario seems to be more reasonable. We should also leave room for unknown exceptions as well.\n\n## **Position of the asterisk**\n\nWhen used to mark the required fields, the asterisk can be placed at the start of the label or at the end. \n\nThe industry convention is to place it at the end. Most users should be familiar with this position. On the other hand, placing it at the start makes it a lot easier to scan and find required fields without having to read the labels. It can be very helpful for users who value efficiency and transparency, which is true for most Canonical personas.\n\n\n\nTable 10\n\n\n\nOne thing to note is that wherever it is placed, the asterisk needs to be hidden with aria-hidden=\"true\" so that it is not announced by screen readers.\n\n## How to\n\nTable 11\n\n\n\n# **Further information**\n\n[WCAG 2.2 SC 3.3.2 Labels and instructions](https://www.w3.org/TR/WCAG22/#labels-or-instructions)\n\n[WCAG 2.2 Technique H90: Indicating required form controls using label or legend](https://www.w3.org/WAI/WCAG22/Techniques/html/H90)\n\n\n\nWG discussions:\n\n[https://github.com/w3c/wcag/issues/1698](https://github.com/w3c/wcag/issues/1698)\n\n[https://github.com/w3c/wcag/issues/2357](https://github.com/w3c/wcag/issues/2357)\n\n[https://github.com/w3c/wcag/issues/3553](https://github.com/w3c/wcag/issues/3553)\n\n[https://github.com/w3c/wcag/issues/4791](https://github.com/w3c/wcag/issues/4791)\n\n \nReference: [Spec DE077](https://docs.google.com/document/d/1FGtZ1ZOQ3QcYQ4-3nCh4jnycw7aeEN2l_XgmpFlFHq0/edit?tab=t.0)";
|
|
8
|
+
ds:knownEdgeCases "";
|
|
9
|
+
ds:conceptType ds:concepttype.How-to-guide.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:concept.Question-mark-vs-information-icon a ds:Concept;
|
|
4
|
+
ds:name "Question mark vs information icon";
|
|
5
|
+
ds:summary "*This concept is a stub.*\n\nThis article will help you decide between using the information icon or the question mark icon in your application when you want to signal to users that there is more information available on a specific topic. ";
|
|
6
|
+
ds:tier ds:global;
|
|
7
|
+
ds:content "The information icon signals 'Here is additional context you might find useful,' making it a bit more proactive in offering supplementary details. The question mark icon signals 'Need help understanding this?', making it a bit more reactive and assuming that the user might be confused or unfamiliar with the concept.\n\nThere is a soft convention is that “the question mark icon indicates extensive help is available, provides an interface for someone having a problem to click, and implies that a more sophisticated means of resolving the problem is being offered. The information icon indicates only that some additional explanatory information is available, but not an extensive help system.”1 \n \nWith the `i` the system offers the additional information to the user, that may be useful even when he does not have a question.\n\nSo `i` is the right icon to use if you have information that:\n\n- the user would not ask for, because he's not missing it\n- is useful for a user who is interested in the details.\n\n\n\nWith the `**?**`, the system offers the information to the user, that he needs when he has a question.\n\nSo `?` is the right icon to use if you have information that:\n\n- would unblock the user\n- would offer extensive supplimentary help\n\nIcons depend heavily on the visual conventions a user has been exposed to, so how they interpret an icon will often come down to their cultural background and prior experience. Ultimately, the accompanying text or tooltip is what communicates our intention to the user. However some additional internal research has proven the above assumptions.\n\n\n\n### Source\n\n1. [https://ux.stackexchange.com/questions/64920/info-icon-vs-question-mark](https://ux.stackexchange.com/questions/64920/info-icon-vs-question-mark)\n\n\n\n### References\n\n[https://www.nngroup.com/articles/info-tips-bad/](https://www.nngroup.com/articles/info-tips-bad/)\n\n[https://learn.microsoft.com/en-us/windows/win32/uxguide/vis-std-icons?redirectedfrom=MSDN](https://learn.microsoft.com/en-us/windows/win32/uxguide/vis-std-icons?redirectedfrom=MSDN)\n\n[https://ux.stackexchange.com/questions/80954/is-the-question-mark-internationally-recognised-as-an-icon-for-help](https://ux.stackexchange.com/questions/80954/is-the-question-mark-internationally-recognised-as-an-icon-for-help)\n\n[https://ux.stackexchange.com/questions/21102/best-uses-of-help-and-i-information-icons-in-ui](https://ux.stackexchange.com/questions/21102/best-uses-of-help-and-i-information-icons-in-ui)\n\n";
|
|
8
|
+
ds:knownEdgeCases "";
|
|
9
|
+
ds:conceptType ds:concepttype.How-to-guide.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:concepttype.Explanation a ds:ConceptType;
|
|
4
|
+
ds:name "Explanation";
|
|
5
|
+
ds:summary "*Explanation is a discursive treatment of a subject, that permits reflection. Explanation is* ***understanding-oriented****.*\n\nExplanation deepens and broadens the reader’s understanding of a subject. It brings clarity, light and context.\n\nExplanations can include: principles (a type of documentation that outlines the principles that stay at the foundation of a certain decision)".
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:concepttype.How-to-guide a ds:ConceptType;
|
|
4
|
+
ds:name "How to guide";
|
|
5
|
+
ds:summary "*How-to guides are* ***directions*** *that guide the reader through a problem or towards a result. How-to guides are* ***goal-oriented****.*\n\nA how-to guide helps the user get something done, correctly and safely; it guides the user’s *action*.".
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:concepttype.Reference a ds:ConceptType;
|
|
4
|
+
ds:name "Reference";
|
|
5
|
+
ds:summary "*Reference guides are* ***technical descriptions*** *of the machinery and how to operate it. Reference material is* ***information-oriented****.* \n\nReference material contains *propositional or theoretical* knowledge that a user looks to in their *work*.".
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:concepttype.Tutorial a ds:ConceptType;
|
|
4
|
+
ds:name "Tutorial";
|
|
5
|
+
ds:summary "*A tutorial is an* ***experience*** *that takes place under the guidance of a tutor. A tutorial is always* ***learning-oriented****.*\n\nA tutorial serves the user’s *acquisition* of skills and knowledge - their study. Its purpose is not to help the user get something done, but to help them learn.".
|
package/definitions/ontology.ttl
CHANGED
|
@@ -154,6 +154,18 @@ ds:ChangeLogEntry
|
|
|
154
154
|
rdfs:label "Change Log Entry" ;
|
|
155
155
|
skos:definition "A single dated record of a change to a UIBlock, with a timestamp, the change description, an owner, an optional GitHub link, and a change type." .
|
|
156
156
|
|
|
157
|
+
ds:Concept
|
|
158
|
+
a owl:Class ;
|
|
159
|
+
rdfs:subClassOf ds:Entity ;
|
|
160
|
+
rdfs:label "Concept" ;
|
|
161
|
+
skos:definition "A standalone piece of design-system documentation not bound to a single UIBlock — a cross-cutting guide, disambiguation, foundation, or decision (e.g. 'Foundations: Grid', 'Disambiguation: Badge/Chip/Tag'). Carries a long-form Markdown body (content), an optional short summary, a concept type, and a tier." .
|
|
162
|
+
|
|
163
|
+
ds:ConceptType
|
|
164
|
+
a owl:Class ;
|
|
165
|
+
rdfs:subClassOf ds:Entity ;
|
|
166
|
+
rdfs:label "Concept Type" ;
|
|
167
|
+
skos:definition "A controlled-vocabulary classification of a Concept (e.g. 'Decision guide', 'Foundation', 'Disambiguation')." .
|
|
168
|
+
|
|
157
169
|
###############################################################################
|
|
158
170
|
# 4. PROPERTIES - Entity Base Properties
|
|
159
171
|
###############################################################################
|
|
@@ -249,6 +261,22 @@ ds:guidelines
|
|
|
249
261
|
ds:acceptanceCriteria "These guidelines should contain the best practices for accessibility, responsiveness, content handling, localization, animation and keyboard interaction of this UI block. They should be comprehensive and cover all important aspects of using and implementing the component correctly." ;
|
|
250
262
|
ds:completionGuidance "Provide detailed guidelines for correctly using and implementing the UI block. Include best practices for accessibility, responsiveness, content handling, localization, animation, and keyboard interaction. Ensure that the guidelines are comprehensive and cover all important aspects of using and implementing the component correctly." .
|
|
251
263
|
|
|
264
|
+
ds:content
|
|
265
|
+
a owl:DatatypeProperty ;
|
|
266
|
+
rdfs:domain ds:Concept ;
|
|
267
|
+
rdfs:range xsd:string ;
|
|
268
|
+
rdfs:label "content" ;
|
|
269
|
+
skos:definition "The long-form Markdown body of a Concept — the full documentation text (sections, prose, tables, links). Stored as a plain string literal; the content is Markdown." ;
|
|
270
|
+
ds:acceptanceCriteria "Should be a self-contained Markdown document that fully explains the concept, with clear sections and concrete examples. May reference UIBlocks and other concepts by name or link." ;
|
|
271
|
+
ds:completionGuidance "Write the concept as a complete Markdown document: open with what it is and why it matters, then cover the guidance in structured sections with concrete, real-world examples." .
|
|
272
|
+
|
|
273
|
+
ds:knownEdgeCases
|
|
274
|
+
a owl:DatatypeProperty ;
|
|
275
|
+
rdfs:domain ds:Concept ;
|
|
276
|
+
rdfs:range xsd:string ;
|
|
277
|
+
rdfs:label "known edge cases" ;
|
|
278
|
+
skos:definition "Free-text notes on edge cases, caveats, or open questions for the Concept." .
|
|
279
|
+
|
|
252
280
|
###############################################################################
|
|
253
281
|
# 6. PROPERTIES - Relationships
|
|
254
282
|
###############################################################################
|
|
@@ -393,6 +421,13 @@ ds:category
|
|
|
393
421
|
rdfs:label "category" ;
|
|
394
422
|
skos:definition "The category (facet) a Tag belongs to, e.g. documentation stage, review status, channel, implementation status" .
|
|
395
423
|
|
|
424
|
+
ds:conceptType
|
|
425
|
+
a owl:ObjectProperty ;
|
|
426
|
+
rdfs:domain ds:Concept ;
|
|
427
|
+
rdfs:range ds:ConceptType ;
|
|
428
|
+
rdfs:label "conceptType" ;
|
|
429
|
+
skos:definition "The controlled-vocabulary type a Concept belongs to, e.g. Decision guide, Foundation, Disambiguation" .
|
|
430
|
+
|
|
396
431
|
ds:whenToApply
|
|
397
432
|
a owl:DatatypeProperty ;
|
|
398
433
|
rdfs:domain ds:Tag ;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"types": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "LGPL-3.0",
|
|
7
|
-
"version": "0.2.
|
|
7
|
+
"version": "0.2.3",
|
|
8
8
|
"bin": {
|
|
9
9
|
"collect-implementations": "./src/collect-implementations.ts"
|
|
10
10
|
},
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"ajv": "^8.17.1",
|
|
42
|
+
"tinyglobby": "^0.2.14",
|
|
42
43
|
"jsonld": "^9.0.0",
|
|
43
44
|
"n3": "^2.0.1"
|
|
44
45
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: adoption-a1-styles
|
|
3
|
-
description: Adopt Canonical design-system styles, fonts, and icons in an application (adoption track A1)
|
|
3
|
+
description: Adopt Canonical design-system styles, fonts, and icons in an application (adoption track A1); also runs as a guided tutorial on a worked example
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Adoption A1 — Styles, fonts, icons
|
|
@@ -23,6 +23,31 @@ components.
|
|
|
23
23
|
- Authoring design-system content rather than adopting it — see `specify-component`
|
|
24
24
|
and its sibling skills
|
|
25
25
|
|
|
26
|
+
## Opening move: ask, or offer the tutorial
|
|
27
|
+
|
|
28
|
+
Activation is an opening, not a starting gun. Unless the first message already names
|
|
29
|
+
the work, ask for the starting point — as a suggestion carrying an example, not as a
|
|
30
|
+
form to fill in:
|
|
31
|
+
|
|
32
|
+
> To get started, point me at the app — the repo or directory — and say whether it
|
|
33
|
+
> already pulls in any Canonical styles.
|
|
34
|
+
|
|
35
|
+
"I don't know what's in there" is a fine answer: the install and verify steps
|
|
36
|
+
establish it. Ask again only for what the next step genuinely blocks on.
|
|
37
|
+
|
|
38
|
+
If the activation message already carries the starting point, do not re-ask — say what
|
|
39
|
+
you took it to be, and go.
|
|
40
|
+
|
|
41
|
+
Offer the tutorial in the same breath, because this track doubles as one:
|
|
42
|
+
|
|
43
|
+
> Or if you'd rather see what this track changes before touching your app, I can run
|
|
44
|
+
> it as a tutorial: I'll take a plausible example — a small Vite React app — and walk
|
|
45
|
+
> you through the track on it.
|
|
46
|
+
|
|
47
|
+
Tutorial mode runs the real steps on the example, narrated: name each step before
|
|
48
|
+
running it, show what it changed and why that matters. The tutorial runs on a scratch
|
|
49
|
+
example, not on the person's app — nothing in their repo changes unless they ask.
|
|
50
|
+
|
|
26
51
|
## Install
|
|
27
52
|
|
|
28
53
|
```bash
|
|
@@ -37,6 +62,26 @@ tokens. Two things come with it:
|
|
|
37
62
|
fight specificity.
|
|
38
63
|
- `color-scheme: light dark` on `:root` — the foundation is theme-aware out of the box.
|
|
39
64
|
|
|
65
|
+
## Code standards are the gate
|
|
66
|
+
|
|
67
|
+
Styling work in this track falls under the live code standards — the `styling`, `css`,
|
|
68
|
+
and `icons` categories at minimum (take the actual set from the live output, not from
|
|
69
|
+
this list). Pull them BEFORE touching a stylesheet and hold the Do/Don't pairs open
|
|
70
|
+
while editing, so they shape the change as it is written, not only in review:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
pragma standard categories # the live category set — never from memory
|
|
74
|
+
pragma standard list --category styling # repeat per applicable category
|
|
75
|
+
pragma standard lookup <name> --detail detailed
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Apps follow the code standards as closely as the work allows. Where a change has to
|
|
79
|
+
deviate from a pulled standard, record the deviation in the PR next to the standard's
|
|
80
|
+
name — and ideally file it as an issue, either to bring the app into line later or to
|
|
81
|
+
propose a change to the standard itself. The standards apply even when the app has no
|
|
82
|
+
pragma dependency, and they are open to contribution: a missing or wrong standard is
|
|
83
|
+
something to propose a change for, not to silently work around.
|
|
84
|
+
|
|
40
85
|
## Fonts before styles
|
|
41
86
|
|
|
42
87
|
Fonts are opt-in and must be imported FIRST. The canonical form, in the root stylesheet:
|
|
@@ -65,6 +110,14 @@ The density system is class-driven, and it starts at the root. The app's root el
|
|
|
65
110
|
- **Density** — `comfortable` or `dense`: picks within the context's pair.
|
|
66
111
|
`comfortable` is the default choice unless the product's design calls for `dense`.
|
|
67
112
|
|
|
113
|
+
The requirement, stated as a rule: the root carries EXACTLY ONE class from each
|
|
114
|
+
family — a context (`app` | `site` | `docs`) AND a density (`comfortable` | `dense`).
|
|
115
|
+
That makes six valid combinations (`app comfortable`, `app dense`, `site comfortable`,
|
|
116
|
+
`site dense`, `docs comfortable`, `docs dense`) and nothing else: a single class, a
|
|
117
|
+
value outside either set, or two values from the same family is an invalid surface
|
|
118
|
+
declaration. `app comfortable` is the default for applications; adoption is not done
|
|
119
|
+
until the root carries a valid pair.
|
|
120
|
+
|
|
68
121
|
Components never read these classes directly — they read the `--density-*` custom
|
|
69
122
|
properties the classes emit (control heights, inline padding, vertical spacing rungs,
|
|
70
123
|
baseline seating). A section can locally tighten by carrying its own `dense` class on
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: adoption-a2-components
|
|
3
|
-
description: Swap an application's UI to Canonical design-system components one component type per PR (adoption track A2)
|
|
3
|
+
description: Swap an application's UI to Canonical design-system components one component type per PR (adoption track A2); also runs as a guided tutorial on a worked example
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Adoption A2 — Components
|
|
@@ -25,6 +25,31 @@ a class-less root looks subtly wrong rather than broken.
|
|
|
25
25
|
(An uncovered component TYPE is not a reason to skip the track — it is a per-type
|
|
26
26
|
finding: see "The covered set is queried live" below.)
|
|
27
27
|
|
|
28
|
+
## Opening move: ask, or offer the tutorial
|
|
29
|
+
|
|
30
|
+
Activation is an opening, not a starting gun. Unless the first message already names
|
|
31
|
+
the work, ask for the starting point — as a suggestion carrying an example, not as a
|
|
32
|
+
form to fill in:
|
|
33
|
+
|
|
34
|
+
> To get started, point me at the app and say which component type you'd like swapped
|
|
35
|
+
> first — buttons, say — or let me inventory the app and suggest one.
|
|
36
|
+
|
|
37
|
+
The inventory is cheap, so no preference is a fine answer. Ask again only for what the
|
|
38
|
+
next step genuinely blocks on.
|
|
39
|
+
|
|
40
|
+
If the activation message already carries the starting point, do not re-ask — say what
|
|
41
|
+
you took it to be, and go.
|
|
42
|
+
|
|
43
|
+
Offer the tutorial in the same breath, because this track doubles as one:
|
|
44
|
+
|
|
45
|
+
> Or if you'd rather see what a swap looks like before touching your app, I can run it
|
|
46
|
+
> as a tutorial: I'll take a plausible example — buttons in a small React app — and
|
|
47
|
+
> walk you through one type from inventory to a finished PR.
|
|
48
|
+
|
|
49
|
+
Tutorial mode runs the real steps on the example, narrated: name each step before
|
|
50
|
+
running it, show what it changed and why that matters. The tutorial runs on a scratch
|
|
51
|
+
example, not on the person's app — nothing in their repo changes unless they ask.
|
|
52
|
+
|
|
28
53
|
## Install
|
|
29
54
|
|
|
30
55
|
```bash
|
|
@@ -49,6 +74,28 @@ import { Button, Badge, Card, Tooltip } from "@canonical/react-ds-global";
|
|
|
49
74
|
Named imports; components accept the underlying element's native HTML attributes, so
|
|
50
75
|
existing `onClick`/`aria-*`/`data-*` plumbing carries over.
|
|
51
76
|
|
|
77
|
+
## Code standards are the gate
|
|
78
|
+
|
|
79
|
+
Every swap writes component code, and that code falls under the live code standards —
|
|
80
|
+
the target framework's category (`react`, `svelte`, `lit`), plus `testing` and
|
|
81
|
+
`storybook` where the swap touches those (take the actual set from the live output,
|
|
82
|
+
not from this list). Pull them BEFORE the first swap of a PR and hold the Do/Don't
|
|
83
|
+
pairs open while writing:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
pragma standard categories # the live category set — never from memory
|
|
87
|
+
pragma standard list --category react # swap react for the target framework
|
|
88
|
+
pragma standard lookup <name> --detail detailed
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Apps follow the code standards as closely as the swap allows. Where swapped code has
|
|
92
|
+
to deviate from a pulled standard, record the deviation in the PR next to the
|
|
93
|
+
standard's name — "the old code did it this way" is a deviation to record, not a
|
|
94
|
+
reason to stay silent — and ideally file it as an issue, either to bring the app into
|
|
95
|
+
line later or to propose a change to the standard itself. The standards apply even
|
|
96
|
+
when the app has no pragma dependency, and they are open to contribution: a missing
|
|
97
|
+
or wrong standard is something to propose a change for, not to silently work around.
|
|
98
|
+
|
|
52
99
|
## Inventory first (grep, don't guess)
|
|
53
100
|
|
|
54
101
|
Build the swap list from the code, not from memory:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: adoption-a3-forms
|
|
3
|
-
description: Migrate application forms to the Canonical form system built on react-hook-form (adoption track A3)
|
|
3
|
+
description: Migrate application forms to the Canonical form system built on react-hook-form (adoption track A3); also runs as a guided tutorial on a worked example
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Adoption A3 — Forms
|
|
@@ -23,6 +23,32 @@ of your existing inputs.
|
|
|
23
23
|
- The visual foundation is not in place yet — run `adoption-a1-styles` first
|
|
24
24
|
- Swapping non-form components — that is `adoption-a2-components`
|
|
25
25
|
|
|
26
|
+
## Opening move: ask, or offer the tutorial
|
|
27
|
+
|
|
28
|
+
Activation is an opening, not a starting gun. Unless the first message already names
|
|
29
|
+
the work, ask for the starting point — as a suggestion carrying an example, not as a
|
|
30
|
+
form to fill in:
|
|
31
|
+
|
|
32
|
+
> To get started, point me at the app and say which form you'd like moved first — or
|
|
33
|
+
> let me find the forms and suggest a starting one.
|
|
34
|
+
|
|
35
|
+
The smallest real form is usually the best first move: the programming-model switch is
|
|
36
|
+
easier to see on a short one. Ask again only for what the next step genuinely blocks
|
|
37
|
+
on.
|
|
38
|
+
|
|
39
|
+
If the activation message already carries the starting point, do not re-ask — say what
|
|
40
|
+
you took it to be, and go.
|
|
41
|
+
|
|
42
|
+
Offer the tutorial in the same breath, because this track doubles as one:
|
|
43
|
+
|
|
44
|
+
> Or if you'd rather see the model before touching your forms, I can run it as a
|
|
45
|
+
> tutorial: I'll take a plausible example — a couple of text fields and a select — and
|
|
46
|
+
> walk you through the migration on it.
|
|
47
|
+
|
|
48
|
+
Tutorial mode runs the real steps on the example, narrated: name each step before
|
|
49
|
+
running it, show what it changed and why that matters. The tutorial runs on a scratch
|
|
50
|
+
example, not on the person's app — nothing in their repo changes unless they ask.
|
|
51
|
+
|
|
26
52
|
## Install + the forms styles import
|
|
27
53
|
|
|
28
54
|
```bash
|
|
@@ -47,6 +73,27 @@ classes before judging any form layout: without them the primitives silently fal
|
|
|
47
73
|
to app-comfortable values, and a `dense` or site-surface form renders with the wrong
|
|
48
74
|
geometry.
|
|
49
75
|
|
|
76
|
+
## Code standards are the gate
|
|
77
|
+
|
|
78
|
+
Form migration is component code, and it falls under the live code standards — the
|
|
79
|
+
`react` category at minimum, plus `testing` where the migration touches tests (take
|
|
80
|
+
the actual set from the live output, not from this list). Pull them BEFORE the first
|
|
81
|
+
field conversion and hold the Do/Don't pairs open while writing:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pragma standard categories # the live category set — never from memory
|
|
85
|
+
pragma standard list --category react
|
|
86
|
+
pragma standard lookup <name> --detail detailed
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Apps follow the code standards as closely as the migration allows. Where a
|
|
90
|
+
conversion has to deviate from a pulled standard, record the deviation in the PR next
|
|
91
|
+
to the standard's name — and ideally file it as an issue, either to bring the app
|
|
92
|
+
into line later or to propose a change to the standard itself. The standards apply
|
|
93
|
+
even when the app has no pragma dependency, and they are open to contribution: a
|
|
94
|
+
missing or wrong standard is something to propose a change for, not to silently work
|
|
95
|
+
around.
|
|
96
|
+
|
|
50
97
|
## The react-hook-form switch
|
|
51
98
|
|
|
52
99
|
Form state moves INTO the form system:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: anatomy-author
|
|
3
|
-
description: Write component anatomy specifications using the Design System Anatomy DSL
|
|
3
|
+
description: Write component anatomy specifications using the Design System Anatomy DSL; also runs as a guided tutorial on a worked example
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Anatomy Author
|
|
@@ -52,6 +52,46 @@ installed skill folder — `pragma skill lookup anatomy-author` renders only thi
|
|
|
52
52
|
SKILL.md, so open the sibling file directly when you need the complete spec (the
|
|
53
53
|
appendix below carries its type system).
|
|
54
54
|
|
|
55
|
+
## Opening move: ask, or offer the tutorial
|
|
56
|
+
|
|
57
|
+
Activation is an opening, not a starting gun. Unless the first message already names
|
|
58
|
+
the work, ask for the starting point — as a suggestion carrying an example, not as a
|
|
59
|
+
form to fill in:
|
|
60
|
+
|
|
61
|
+
> To get started, tell me the component whose anatomy we're writing — a name if it is
|
|
62
|
+
> already in the graph, or just a sketch of its parts, like "a card with an image, a
|
|
63
|
+
> title and a row of actions".
|
|
64
|
+
|
|
65
|
+
A sketch is enough to begin: discovery turns it into the real node set, and the sketch
|
|
66
|
+
is what you check that set against. Ask again only for what the next step genuinely
|
|
67
|
+
blocks on.
|
|
68
|
+
|
|
69
|
+
If the activation message already carries the starting point, do not re-ask — say what
|
|
70
|
+
you took it to be, and go.
|
|
71
|
+
|
|
72
|
+
Offer the tutorial in the same breath, because this skill doubles as one:
|
|
73
|
+
|
|
74
|
+
> Or if you'd rather see the flow first, I can run it as a tutorial: I'll take a
|
|
75
|
+
> plausible example — a card, say — and walk you through it from discovery to the
|
|
76
|
+
> emitted anatomy.
|
|
77
|
+
|
|
78
|
+
Tutorial mode runs the real flow on the example, narrated: name each step before
|
|
79
|
+
running it, show what came back and what it means, and reason each structural decision
|
|
80
|
+
out loud before checking the person is with you. Stop short of anything that lands —
|
|
81
|
+
no anatomy written into the graph, no file committed — unless they ask to keep what
|
|
82
|
+
you built.
|
|
83
|
+
|
|
84
|
+
## Anatomy falls under standards too
|
|
85
|
+
|
|
86
|
+
Emitted anatomy is Turtle, and Turtle has standards — the `turtle` category, with
|
|
87
|
+
`ui-blocks` governing block modelling (take the actual set from
|
|
88
|
+
`pragma standard categories`, not from this list). Pull them before authoring and hold
|
|
89
|
+
the Do/Don't pairs open while writing the DSL and its emitted TTL; a deviation from a
|
|
90
|
+
pulled standard is RECORDED next to the anatomy, ideally also filed as an issue. The
|
|
91
|
+
standards apply independent of any package dependency and are open to contribution:
|
|
92
|
+
a missing or wrong modelling rule is something to propose a change for, not to
|
|
93
|
+
silently work around.
|
|
94
|
+
|
|
55
95
|
## Discovery Flow
|
|
56
96
|
|
|
57
97
|
Before writing an anatomy, understand the component's context:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: design-auditor
|
|
3
|
-
description: Audit design system coverage, consistency, and quality
|
|
3
|
+
description: Audit design system coverage, consistency, and quality; also runs as a guided tutorial on a worked example
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Design Auditor
|
|
@@ -52,6 +52,33 @@ Decision gates — in collaboration, pause at each and resolve it WITH the perso
|
|
|
52
52
|
- Fixing what the audit finds — route gaps to `specify-component`/`specify-pattern`,
|
|
53
53
|
missing anatomies to `anatomy-author`
|
|
54
54
|
|
|
55
|
+
## Opening move: ask, or offer the tutorial
|
|
56
|
+
|
|
57
|
+
Activation is an opening, not a starting gun. Unless the first message already names
|
|
58
|
+
the work, ask for the starting point — as a suggestion carrying an example, not as a
|
|
59
|
+
form to fill in:
|
|
60
|
+
|
|
61
|
+
> To get started, tell me what you'd like audited — the whole system, one tier, or
|
|
62
|
+
> just the worry, like "I think our modifier families have drifted".
|
|
63
|
+
|
|
64
|
+
The worry is the most useful of the three: it says which dimensions to run and which
|
|
65
|
+
numbers actually matter to the team. Ask again only for what the next step genuinely
|
|
66
|
+
blocks on.
|
|
67
|
+
|
|
68
|
+
If the activation message already carries the starting point, do not re-ask — say what
|
|
69
|
+
you took it to be, and go.
|
|
70
|
+
|
|
71
|
+
Offer the tutorial in the same breath, because this skill doubles as one:
|
|
72
|
+
|
|
73
|
+
> Or if you'd rather see how an audit works first, I can run it as a tutorial: I'll
|
|
74
|
+
> take one dimension — documentation coverage, say — and walk you through it end to
|
|
75
|
+
> end on the live graph.
|
|
76
|
+
|
|
77
|
+
Tutorial mode runs the real queries, narrated: name each step before running it, show
|
|
78
|
+
what came back and what it means, and reason each judgment out loud before checking
|
|
79
|
+
the person is with you. Stop short of anything that lands — no report filed, no issues
|
|
80
|
+
opened — unless they ask to keep what you found.
|
|
81
|
+
|
|
55
82
|
## Discovery Flow
|
|
56
83
|
|
|
57
84
|
Start with a broad inventory, then drill into specific concerns:
|
|
@@ -99,6 +126,19 @@ How complete is the documentation?
|
|
|
99
126
|
### 4. Usage Audit
|
|
100
127
|
What's connected vs. orphaned?
|
|
101
128
|
|
|
129
|
+
### 5. Standards Audit
|
|
130
|
+
Do the implementations conform to the live code standards?
|
|
131
|
+
|
|
132
|
+
An audit that stops at the graph misses the code. For each audited implementation,
|
|
133
|
+
pull the applicable categories (`pragma standard categories`, then
|
|
134
|
+
`pragma standard list --category <framework>`) and read the Do/Don't pairs against
|
|
135
|
+
the source the implementation links to (`ds:headLink`). A violation is a finding with
|
|
136
|
+
the standard's name attached — as first-class as a missing anatomy. The standards
|
|
137
|
+
apply even where the audited app has no pragma dependency. Findings cut both ways:
|
|
138
|
+
where the team's practice is right and the standard is not, the finding becomes a
|
|
139
|
+
proposed change to the standard — the standards are open to contribution, and audits
|
|
140
|
+
are where their gaps surface.
|
|
141
|
+
|
|
102
142
|
## Key Queries
|
|
103
143
|
|
|
104
144
|
Documentation-completeness queries must catch BOTH the absent predicate and the empty
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implement-component
|
|
3
|
-
description: Implement a specified design-system component with pragma create, following the live code standards
|
|
3
|
+
description: Implement a specified design-system component with pragma create, following the live code standards; also runs as a guided tutorial on a worked example
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Implement Component
|
|
@@ -32,6 +32,33 @@ autonomously (only on explicit request), list those judgment calls in the PR.
|
|
|
32
32
|
- Adopting existing components into an app — the `adoption-a1-styles` /
|
|
33
33
|
`adoption-a2-components` / `adoption-a3-forms` tracks, not this skill
|
|
34
34
|
|
|
35
|
+
## Opening move: ask, or offer the tutorial
|
|
36
|
+
|
|
37
|
+
Activation is an opening, not a starting gun. Unless the first message already names
|
|
38
|
+
the work, ask for the starting point — as a suggestion carrying an example, not as a
|
|
39
|
+
form to fill in:
|
|
40
|
+
|
|
41
|
+
> To get started, tell me which block to implement — a name like "Badge", or point me
|
|
42
|
+
> at the spec it came out of. If the target framework or package isn't obvious, say
|
|
43
|
+
> that too.
|
|
44
|
+
|
|
45
|
+
If you are unsure whether the thing is specified at all, take the name anyway:
|
|
46
|
+
pre-flight is what decides, and it routes to `specify-component` when the spec turns
|
|
47
|
+
out not to be there. Ask again only for what the next step genuinely blocks on.
|
|
48
|
+
|
|
49
|
+
If the activation message already carries the starting point, do not re-ask — say what
|
|
50
|
+
you took it to be, and go.
|
|
51
|
+
|
|
52
|
+
Offer the tutorial in the same breath, because this skill doubles as one:
|
|
53
|
+
|
|
54
|
+
> Or if you'd rather see the flow first, I can run it as a tutorial: I'll pick a small
|
|
55
|
+
> documented block from the graph and walk you through it from pre-flight to review.
|
|
56
|
+
|
|
57
|
+
Tutorial mode runs the real flow on the example, narrated: name each step before
|
|
58
|
+
running it, show what came back and what it means, and reason each decision out loud
|
|
59
|
+
before checking the person is with you. Stop short of anything that lands — no commit,
|
|
60
|
+
no PR — unless they ask to keep what you built.
|
|
61
|
+
|
|
35
62
|
## Pre-flight
|
|
36
63
|
|
|
37
64
|
1. **Read the spec.**
|