@ember-marquetry/joinery 0.0.0-stage → 1.0.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 (221) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/LICENSE.md +21 -0
  3. package/NOTICE +13 -0
  4. package/README.md +414 -2
  5. package/addon-main.cjs +4 -0
  6. package/declarations/a2ui.d.ts +753 -0
  7. package/declarations/a2ui.d.ts.map +1 -0
  8. package/declarations/add-ons/a2ui/catalog.d.ts +381 -0
  9. package/declarations/add-ons/a2ui/catalog.d.ts.map +1 -0
  10. package/declarations/add-ons/a2ui/content.d.ts +12 -0
  11. package/declarations/add-ons/a2ui/content.d.ts.map +1 -0
  12. package/declarations/add-ons/a2ui/controls.d.ts +12 -0
  13. package/declarations/add-ons/a2ui/controls.d.ts.map +1 -0
  14. package/declarations/add-ons/a2ui/icons.d.ts +69 -0
  15. package/declarations/add-ons/a2ui/icons.d.ts.map +1 -0
  16. package/declarations/add-ons/a2ui/layout.d.ts +16 -0
  17. package/declarations/add-ons/a2ui/layout.d.ts.map +1 -0
  18. package/declarations/add-ons/a2ui/props.d.ts +75 -0
  19. package/declarations/add-ons/a2ui/props.d.ts.map +1 -0
  20. package/declarations/add-ons/a2ui/registry.d.ts +151 -0
  21. package/declarations/add-ons/a2ui/registry.d.ts.map +1 -0
  22. package/declarations/add-ons/chart/catalog.d.ts +159 -0
  23. package/declarations/add-ons/chart/catalog.d.ts.map +1 -0
  24. package/declarations/add-ons/chart/charts.d.ts +12 -0
  25. package/declarations/add-ons/chart/charts.d.ts.map +1 -0
  26. package/declarations/add-ons/chart/config.d.ts +25 -0
  27. package/declarations/add-ons/chart/config.d.ts.map +1 -0
  28. package/declarations/add-ons/chart/registry.d.ts +85 -0
  29. package/declarations/add-ons/chart/registry.d.ts.map +1 -0
  30. package/declarations/add-ons/code-block/catalog.d.ts +35 -0
  31. package/declarations/add-ons/code-block/catalog.d.ts.map +1 -0
  32. package/declarations/add-ons/code-block/code-block.d.ts +5 -0
  33. package/declarations/add-ons/code-block/code-block.d.ts.map +1 -0
  34. package/declarations/add-ons/code-block/registry.d.ts +29 -0
  35. package/declarations/add-ons/code-block/registry.d.ts.map +1 -0
  36. package/declarations/add-ons/data-table/catalog.d.ts +43 -0
  37. package/declarations/add-ons/data-table/catalog.d.ts.map +1 -0
  38. package/declarations/add-ons/data-table/data-table.d.ts +51 -0
  39. package/declarations/add-ons/data-table/data-table.d.ts.map +1 -0
  40. package/declarations/add-ons/data-table/format.d.ts +15 -0
  41. package/declarations/add-ons/data-table/format.d.ts.map +1 -0
  42. package/declarations/add-ons/data-table/registry.d.ts +5 -0
  43. package/declarations/add-ons/data-table/registry.d.ts.map +1 -0
  44. package/declarations/catalog/chat.d.ts +95 -0
  45. package/declarations/catalog/chat.d.ts.map +1 -0
  46. package/declarations/catalog/display.d.ts +195 -0
  47. package/declarations/catalog/display.d.ts.map +1 -0
  48. package/declarations/catalog/inputs.d.ts +321 -0
  49. package/declarations/catalog/inputs.d.ts.map +1 -0
  50. package/declarations/catalog/layout.d.ts +317 -0
  51. package/declarations/catalog/layout.d.ts.map +1 -0
  52. package/declarations/catalog/menus.d.ts +115 -0
  53. package/declarations/catalog/menus.d.ts.map +1 -0
  54. package/declarations/catalog/overlays.d.ts +189 -0
  55. package/declarations/catalog/overlays.d.ts.map +1 -0
  56. package/declarations/chart.d.ts +159 -0
  57. package/declarations/chart.d.ts.map +1 -0
  58. package/declarations/code-block.d.ts +37 -0
  59. package/declarations/code-block.d.ts.map +1 -0
  60. package/declarations/components/chat/chat.d.ts +12 -0
  61. package/declarations/components/chat/chat.d.ts.map +1 -0
  62. package/declarations/components/confirm.d.ts +10 -0
  63. package/declarations/components/confirm.d.ts.map +1 -0
  64. package/declarations/components/content.d.ts +11 -0
  65. package/declarations/components/content.d.ts.map +1 -0
  66. package/declarations/components/display/alert.d.ts +5 -0
  67. package/declarations/components/display/alert.d.ts.map +1 -0
  68. package/declarations/components/display/aspect-ratio.d.ts +5 -0
  69. package/declarations/components/display/aspect-ratio.d.ts.map +1 -0
  70. package/declarations/components/display/avatar.d.ts +5 -0
  71. package/declarations/components/display/avatar.d.ts.map +1 -0
  72. package/declarations/components/display/badge.d.ts +5 -0
  73. package/declarations/components/display/badge.d.ts.map +1 -0
  74. package/declarations/components/display/breadcrumb.d.ts +5 -0
  75. package/declarations/components/display/breadcrumb.d.ts.map +1 -0
  76. package/declarations/components/display/card.d.ts +5 -0
  77. package/declarations/components/display/card.d.ts.map +1 -0
  78. package/declarations/components/display/empty.d.ts +5 -0
  79. package/declarations/components/display/empty.d.ts.map +1 -0
  80. package/declarations/components/display/item.d.ts +5 -0
  81. package/declarations/components/display/item.d.ts.map +1 -0
  82. package/declarations/components/display/kbd.d.ts +5 -0
  83. package/declarations/components/display/kbd.d.ts.map +1 -0
  84. package/declarations/components/display/pagination.d.ts +15 -0
  85. package/declarations/components/display/pagination.d.ts.map +1 -0
  86. package/declarations/components/display/progress.d.ts +5 -0
  87. package/declarations/components/display/progress.d.ts.map +1 -0
  88. package/declarations/components/display/rating.d.ts +5 -0
  89. package/declarations/components/display/rating.d.ts.map +1 -0
  90. package/declarations/components/display/scroll-area.d.ts +5 -0
  91. package/declarations/components/display/scroll-area.d.ts.map +1 -0
  92. package/declarations/components/display/separator.d.ts +5 -0
  93. package/declarations/components/display/separator.d.ts.map +1 -0
  94. package/declarations/components/display/skeleton.d.ts +5 -0
  95. package/declarations/components/display/skeleton.d.ts.map +1 -0
  96. package/declarations/components/display/spinner.d.ts +5 -0
  97. package/declarations/components/display/spinner.d.ts.map +1 -0
  98. package/declarations/components/display/table.d.ts +5 -0
  99. package/declarations/components/display/table.d.ts.map +1 -0
  100. package/declarations/components/grid-areas.d.ts +15 -0
  101. package/declarations/components/grid-areas.d.ts.map +1 -0
  102. package/declarations/components/inputs/button-group.d.ts +5 -0
  103. package/declarations/components/inputs/button-group.d.ts.map +1 -0
  104. package/declarations/components/inputs/button.d.ts +5 -0
  105. package/declarations/components/inputs/button.d.ts.map +1 -0
  106. package/declarations/components/inputs/calendar.d.ts +22 -0
  107. package/declarations/components/inputs/calendar.d.ts.map +1 -0
  108. package/declarations/components/inputs/checkbox.d.ts +5 -0
  109. package/declarations/components/inputs/checkbox.d.ts.map +1 -0
  110. package/declarations/components/inputs/combobox.d.ts +11 -0
  111. package/declarations/components/inputs/combobox.d.ts.map +1 -0
  112. package/declarations/components/inputs/control-field.d.ts +35 -0
  113. package/declarations/components/inputs/control-field.d.ts.map +1 -0
  114. package/declarations/components/inputs/input-otp.d.ts +5 -0
  115. package/declarations/components/inputs/input-otp.d.ts.map +1 -0
  116. package/declarations/components/inputs/input.d.ts +5 -0
  117. package/declarations/components/inputs/input.d.ts.map +1 -0
  118. package/declarations/components/inputs/native-select.d.ts +5 -0
  119. package/declarations/components/inputs/native-select.d.ts.map +1 -0
  120. package/declarations/components/inputs/radio-group.d.ts +5 -0
  121. package/declarations/components/inputs/radio-group.d.ts.map +1 -0
  122. package/declarations/components/inputs/select.d.ts +5 -0
  123. package/declarations/components/inputs/select.d.ts.map +1 -0
  124. package/declarations/components/inputs/slider.d.ts +5 -0
  125. package/declarations/components/inputs/slider.d.ts.map +1 -0
  126. package/declarations/components/inputs/switch.d.ts +5 -0
  127. package/declarations/components/inputs/switch.d.ts.map +1 -0
  128. package/declarations/components/inputs/textarea.d.ts +5 -0
  129. package/declarations/components/inputs/textarea.d.ts.map +1 -0
  130. package/declarations/components/inputs/toggle-group.d.ts +5 -0
  131. package/declarations/components/inputs/toggle-group.d.ts.map +1 -0
  132. package/declarations/components/inputs/toggle.d.ts +5 -0
  133. package/declarations/components/inputs/toggle.d.ts.map +1 -0
  134. package/declarations/components/menus/command.d.ts +12 -0
  135. package/declarations/components/menus/command.d.ts.map +1 -0
  136. package/declarations/components/menus/menu-groups.d.ts +25 -0
  137. package/declarations/components/menus/menu-groups.d.ts.map +1 -0
  138. package/declarations/components/menus/menus.d.ts +9 -0
  139. package/declarations/components/menus/menus.d.ts.map +1 -0
  140. package/declarations/components/menus/navigation-menu.d.ts +6 -0
  141. package/declarations/components/menus/navigation-menu.d.ts.map +1 -0
  142. package/declarations/components/overlays/accordion.d.ts +16 -0
  143. package/declarations/components/overlays/accordion.d.ts.map +1 -0
  144. package/declarations/components/overlays/alert-dialog.d.ts +15 -0
  145. package/declarations/components/overlays/alert-dialog.d.ts.map +1 -0
  146. package/declarations/components/overlays/collapsible.d.ts +5 -0
  147. package/declarations/components/overlays/collapsible.d.ts.map +1 -0
  148. package/declarations/components/overlays/dialog.d.ts +5 -0
  149. package/declarations/components/overlays/dialog.d.ts.map +1 -0
  150. package/declarations/components/overlays/popups.d.ts +9 -0
  151. package/declarations/components/overlays/popups.d.ts.map +1 -0
  152. package/declarations/components/overlays/sheet.d.ts +8 -0
  153. package/declarations/components/overlays/sheet.d.ts.map +1 -0
  154. package/declarations/components/overlays/tabs.d.ts +20 -0
  155. package/declarations/components/overlays/tabs.d.ts.map +1 -0
  156. package/declarations/components/pages.d.ts +38 -0
  157. package/declarations/components/pages.d.ts.map +1 -0
  158. package/declarations/components/split.d.ts +8 -0
  159. package/declarations/components/split.d.ts.map +1 -0
  160. package/declarations/components/stack.d.ts +14 -0
  161. package/declarations/components/stack.d.ts.map +1 -0
  162. package/declarations/components/trigger.d.ts +27 -0
  163. package/declarations/components/trigger.d.ts.map +1 -0
  164. package/declarations/context.d.ts +62 -0
  165. package/declarations/context.d.ts.map +1 -0
  166. package/declarations/data-table.d.ts +48 -0
  167. package/declarations/data-table.d.ts.map +1 -0
  168. package/declarations/grid-check.d.ts +22 -0
  169. package/declarations/grid-check.d.ts.map +1 -0
  170. package/declarations/helpers.d.ts +20 -0
  171. package/declarations/helpers.d.ts.map +1 -0
  172. package/declarations/icons.d.ts +13 -0
  173. package/declarations/icons.d.ts.map +1 -0
  174. package/declarations/index.d.ts +2389 -0
  175. package/declarations/index.d.ts.map +1 -0
  176. package/declarations/messages.d.ts +77 -0
  177. package/declarations/messages.d.ts.map +1 -0
  178. package/declarations/options.d.ts +22 -0
  179. package/declarations/options.d.ts.map +1 -0
  180. package/declarations/registry/chat.d.ts +38 -0
  181. package/declarations/registry/chat.d.ts.map +1 -0
  182. package/declarations/registry/display.d.ts +3045 -0
  183. package/declarations/registry/display.d.ts.map +1 -0
  184. package/declarations/registry/inputs.d.ts +4011 -0
  185. package/declarations/registry/inputs.d.ts.map +1 -0
  186. package/declarations/registry/layout.d.ts +59 -0
  187. package/declarations/registry/layout.d.ts.map +1 -0
  188. package/declarations/registry/menus.d.ts +161 -0
  189. package/declarations/registry/menus.d.ts.map +1 -0
  190. package/declarations/registry/overlays.d.ts +418 -0
  191. package/declarations/registry/overlays.d.ts.map +1 -0
  192. package/declarations/responsive.d.ts +22 -0
  193. package/declarations/responsive.d.ts.map +1 -0
  194. package/declarations/test-support/index.d.ts +97 -0
  195. package/declarations/test-support/index.d.ts.map +1 -0
  196. package/declarations/tracks.d.ts +22 -0
  197. package/declarations/tracks.d.ts.map +1 -0
  198. package/declarations/types.d.ts +7 -0
  199. package/declarations/types.d.ts.map +1 -0
  200. package/declarations/url.d.ts +26 -0
  201. package/declarations/url.d.ts.map +1 -0
  202. package/declarations/vars.d.ts +12 -0
  203. package/declarations/vars.d.ts.map +1 -0
  204. package/dist/a2ui.js +720 -0
  205. package/dist/a2ui.js.map +1 -0
  206. package/dist/chart.js +266 -0
  207. package/dist/chart.js.map +1 -0
  208. package/dist/code-block.js +61 -0
  209. package/dist/code-block.js.map +1 -0
  210. package/dist/data-table.js +281 -0
  211. package/dist/data-table.js.map +1 -0
  212. package/dist/index.js +1969 -0
  213. package/dist/index.js.map +1 -0
  214. package/dist/marquetry.css +465 -0
  215. package/dist/messages-BmxTYJTM.js +107 -0
  216. package/dist/messages-BmxTYJTM.js.map +1 -0
  217. package/dist/options-vLEe4d6g.js +444 -0
  218. package/dist/options-vLEe4d6g.js.map +1 -0
  219. package/dist/test-support/index.js +213 -0
  220. package/dist/test-support/index.js.map +1 -0
  221. package/package.json +147 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,34 @@
1
+ # @ember-marquetry/joinery
2
+
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 8f2790b: The first release of Marquetry: generative UI for Ember.
8
+
9
+ - `core`: the spec format, the JSONL patch stream, expressions, actions, the catalog, agent events, chat threads and stream replay.
10
+ - `ember`: the `<Render>` component and the `Generation` state machine.
11
+ - `joinery`: a catalog of 69 Joinery components, with layout templates and the chart, data table and code block add-ons. The `/a2ui` subpath is the A2UI v0.9.1 basic catalog on Joinery components, for the specs of `a2ui`.
12
+ - `chat`: a chat thread on Joinery components, with streamed markdown, agent surfaces, tool calls, approvals and MCP Apps.
13
+ - `formwright`: forms with validation from a JSON Schema, field rules and named validators.
14
+ - `inspector`: a dev panel for `<Render>` that shows the spec, the patches with their line numbers, the state and the problems.
15
+ - `ai-sdk`, `ag-ui`, `a2ui` and `sse`: adapters and chat transports for the AI SDK, AG-UI 1.0, A2UI v0.9.1 and plain JSONL or SSE endpoints.
16
+ - `markdown`: a streamed markdown parser that makes no HTML.
17
+ - `mcp-apps`: a host for MCP Apps in a sandbox frame on a second origin.
18
+ - `eslint-plugin`, `skills`, `test-support` and the `ember-marquetry` CLI: tools for catalog authors and app developers.
19
+
20
+ Safety defaults in 1.0:
21
+
22
+ - `joinery`: a URL that the browser loads with no click (the `src` of `Image` and `Avatar`, the `image` of `Attachment`, and the `url` of the A2UI `Image`, `Video` and `AudioPlayer`) must be relative, unless `urls.mediaHosts` lists its host. `isSafeMediaUrl` is the check. `urls.hosts` applies only to links.
23
+ - `markdown` and `chat`: an image must pass `isSafeImageUrl` (`<Chat @isSafeImageUrl>`, `<Markdown @isSafeImageUrl>`). The default, `isRelativeUrl`, accepts only a relative URL. A block of more than 20,000 characters is plain text.
24
+ - `chat`: `<McpApp>` and `McpAppsConfig` have `approveDomain`. Without it, the app gets no domain that it declares in its CSP. An app cannot call a tool that needs the approval of the user (`@needsApproval`).
25
+ - `mcp-apps`: the proxy puts the CSP meta at offset 0 of the app HTML, and gives its own page a `frame-src` with only the approved frame domains.
26
+ - `ai-sdk` and `ag-ui`: a problem in one item is a `data` event named `stream-error`, and a value that the reader does not convert is a `data` event named `unconverted`. `error` is only for a failed run.
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies [8f2790b]
31
+ - @ember-marquetry/a2ui@1.0.0
32
+ - @ember-marquetry/core@1.0.0
33
+ - @ember-marquetry/ember@1.0.0
34
+ - @ember-marquetry/test-support@1.0.0
package/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Joe Gaudet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,13 @@
1
+ Marquetry
2
+ Copyright (c) 2026 Joe Gaudet. MIT licensed; see LICENSE.md.
3
+
4
+ Marquetry is an original design. Two projects gave it ideas and formats, and Marquetry copies
5
+ no code from them:
6
+
7
+ - json-render (Vercel, Apache 2.0): the idea of a catalog that limits a model, a flat element
8
+ map, and a spec that streams as JSON Lines of RFC 6902 patches.
9
+ - A2UI (Google, Apache 2.0): the v0.9 message format that @ember-marquetry/a2ui reads.
10
+
11
+ @ember-marquetry/ag-ui reads the event format of the AG-UI protocol, and
12
+ @ember-marquetry/ai-sdk reads the UI message stream format of the Vercel AI SDK. Marquetry
13
+ depends on neither package.
package/README.md CHANGED
@@ -1,3 +1,415 @@
1
- # Temporary Holding Version
1
+ # @ember-marquetry/joinery
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The Marquetry catalog and registry of [Joinery](https://github.com/joegaudet/ember-joinery)
4
+ components. A model builds a user interface from these components: it streams a spec, the
5
+ catalog validates the spec, and `<Render>` shows it with the Glimmer components of the registry.
6
+
7
+ The package has 69 components in six groups, layout parts and page templates, and four
8
+ add-ons: charts, a data table, a code block and the A2UI basic catalog.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ pnpm add @ember-marquetry/joinery @ember-marquetry/core @ember-marquetry/ember \
14
+ @ember-joinery/ember @ember-joinery/primitives @ember-marquetry/sse
15
+ ```
16
+
17
+ Import the CSS of the layout parts once, for example in `app/app.ts`:
18
+
19
+ ```ts
20
+ import '@ember-marquetry/joinery/marquetry.css'
21
+ ```
22
+
23
+ Joinery gives the theme and the CSS of its components. Configure Joinery first, as its guide
24
+ tells you.
25
+
26
+ ## Use it with `<Render>` and `Generation`
27
+
28
+ `catalog` tells the model what it can use. `registry` renders each component of the catalog.
29
+
30
+ ```gts
31
+ import Component from '@glimmer/component'
32
+ import { Generation, Render } from '@ember-marquetry/ember'
33
+ import { catalog, Confirm, registry } from '@ember-marquetry/joinery'
34
+ import { streamFrom } from '@ember-marquetry/sse'
35
+
36
+ export default class Assistant extends Component {
37
+ generation = new Generation({ owner: this, catalog })
38
+
39
+ ask = (prompt: string) => {
40
+ this.generation.run(streamFrom('/api/ui', { method: 'POST', body: prompt }))
41
+ }
42
+
43
+ <template>
44
+ <Render
45
+ @spec={{this.generation.spec}}
46
+ @catalog={{catalog}}
47
+ @registry={{registry}}
48
+ @streaming={{this.generation.isStreaming}}
49
+ @Confirm={{Confirm}}
50
+ />
51
+ </template>
52
+ }
53
+ ```
54
+
55
+ On the server, send `catalog.prompt()` as the system prompt. `Confirm` is the dialog that an
56
+ action with `confirm` opens before it runs.
57
+
58
+ ## Options
59
+
60
+ `catalog` uses the safe defaults. To change them, make your own catalog with
61
+ `createJoineryCatalog`. The `registry` renders each catalog that this function makes.
62
+
63
+ ```ts
64
+ import { createJoineryCatalog } from '@ember-marquetry/joinery'
65
+ import { Rocket } from 'lucide'
66
+
67
+ export const catalog = createJoineryCatalog({
68
+ urls: { hosts: ['example.com', '*.example.com'], mediaHosts: ['cdn.example.com'] },
69
+ icons: { rocket: Rocket },
70
+ })
71
+ ```
72
+
73
+ | Option | What it does |
74
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
75
+ | `urls.hosts` | The hosts that an absolute link (`href`) can have. `*.example.com` permits each subdomain. Without the list, each host is permitted. |
76
+ | `urls.mediaHosts` | The hosts that an absolute URL that the browser loads with no click can have: the `src` of `Image` and `Avatar`, the `image` of `Attachment`, and the `url` of the A2UI `Image`, `Video` and `AudioPlayer`. Without the list, such a URL must be relative. |
77
+ | `icons` | More icons: a name and a `lucide` icon node. They add to the curated icons. |
78
+
79
+ ## The components
80
+
81
+ A test reads this list and the catalog, and fails when a component is not here.
82
+
83
+ | Group | Components |
84
+ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
85
+ | Layout | `Text`, `Heading`, `Link`, `Image`, `Icon`, `Stack`, `Grid`, `Split`, `SplitPane`, `GridAreas`, `GridArea`, `DashboardPage`, `DetailPage`, `WizardPage`, `WizardStep` |
86
+ | Display | `Card`, `Table`, `Alert`, `Badge`, `Avatar`, `Separator`, `Progress`, `Skeleton`, `Empty`, `Item`, `Kbd`, `Spinner`, `AspectRatio`, `ScrollArea`, `Breadcrumb`, `Pagination`, `Rating` |
87
+ | Inputs | `Button`, `Input`, `Select`, `ButtonGroup`, `Textarea`, `Checkbox`, `Switch`, `RadioGroup`, `NativeSelect`, `Combobox`, `Slider`, `Toggle`, `ToggleGroup`, `InputOTP`, `Calendar` |
88
+ | Overlays | `Tabs`, `Tab`, `Dialog`, `Collapsible`, `Accordion`, `AccordionItem`, `AlertDialog`, `Sheet`, `Drawer`, `Popover`, `Tooltip`, `HoverCard` |
89
+ | Menus | `DropdownMenu`, `ContextMenu`, `Menubar`, `NavigationMenu`, `Command` |
90
+ | Chat | `Message`, `Bubble`, `Marker`, `Trace`, `Attachment` |
91
+
92
+ The add-ons have more components (see [Add-ons](#add-ons)):
93
+
94
+ | Add-on | Components |
95
+ | ------------ | ----------------------------------------------------------------------------- |
96
+ | `chart` | `AreaChart`, `BarChart`, `LineChart`, `RadarChart`, `PieChart`, `RadialChart` |
97
+ | `data-table` | `DataTable` |
98
+ | `code-block` | `CodeBlock` |
99
+
100
+ ### Compound components
101
+
102
+ A Joinery component with parts becomes one of three shapes in a spec:
103
+
104
+ - **A fixed part is a prop or a named slot.** A popup has a `trigger` slot. Put one `Button` in
105
+ it: the button opens the popup. `Dialog`, `Sheet` and `Drawer` also have a `footer` slot.
106
+ - **A repeated part with content is a child element.** `Tabs` has `Tab` children, and
107
+ `Accordion` has `AccordionItem` children. `Split` has `SplitPane` children, and `GridAreas` has
108
+ `GridArea` children.
109
+ - **A repeated part that is plain data is a prop array.** The options of `Select`, the items of
110
+ a menu and the columns of `Table` are arrays of objects.
111
+
112
+ ```json
113
+ {
114
+ "type": "Dialog",
115
+ "props": { "title": "Delete the project?" },
116
+ "slots": { "trigger": ["open-button"] },
117
+ "children": ["warning"]
118
+ }
119
+ ```
120
+
121
+ ### Selections: bind, then emit
122
+
123
+ A control that the user changes has a value prop: `value`, `checked`, `open`, `page`, `step` or
124
+ `selection`. Bind it with `$bind` to a state path. When the user changes it, the component
125
+ writes the new value to the state first. Then it starts the actions of the event (`change`,
126
+ `openChange`, `select`, `selectionChange`). An action thus reads the new value from the state.
127
+
128
+ ```json
129
+ {
130
+ "type": "Select",
131
+ "props": { "label": "Plan", "value": { "$bind": "/plan" }, "options": [] },
132
+ "on": { "change": { "action": "savePlan", "params": { "plan": { "$state": "/plan" } } } }
133
+ }
134
+ ```
135
+
136
+ Without a binding, the component keeps its own value.
137
+
138
+ ## Layout
139
+
140
+ The layout has three levels.
141
+
142
+ 1. **Parts.** `Stack` puts its children in a column or a row. `Grid` puts them in equal
143
+ columns. `Split` makes panes that the user can resize. `Card`, `Tabs`, `Accordion`, `Sheet`,
144
+ `Dialog` and `ScrollArea` also arrange content.
145
+ 2. **Page templates.** `DashboardPage` has the slots `actions`, `metrics` and `aside`.
146
+ `DetailPage` has the slots `breadcrumb`, `actions` and `aside`. `WizardPage` has `WizardStep`
147
+ children, one step at a time, and Back, Next and Finish buttons. Each template has a `title`
148
+ and an optional `description`. The children are the main content.
149
+ 3. **The free grid.** `GridAreas` has named areas, and its `GridArea` children fill them.
150
+
151
+ The layout props can have one value, or a value for each breakpoint: `base`, `sm`, `md`, `lg`
152
+ and `xl`. `base` applies from a width of zero.
153
+
154
+ ### The grammar of the free grid
155
+
156
+ ```json
157
+ {
158
+ "type": "GridAreas",
159
+ "props": {
160
+ "areas": {
161
+ "base": [["header"], ["main"]],
162
+ "md": [
163
+ ["header", "header"],
164
+ ["main", "side"]
165
+ ]
166
+ },
167
+ "columns": { "md": ["2fr", "1fr"] },
168
+ "gap": 4
169
+ },
170
+ "children": ["a-header", "a-main", "a-side"]
171
+ }
172
+ ```
173
+
174
+ - `areas` is a list of rows. Each row has one area name for each column. Repeat a name to make
175
+ an area larger. `.` is an empty cell. An area must be a rectangle.
176
+ - An area name has letters, digits, `_` and `-`, and it starts with a letter.
177
+ - A track size is `<n>fr`, `<n>px`, `<n>rem`, `<n>%`, `0`, `auto`, `min-content`,
178
+ `max-content`, or `minmax(a, b)` of those.
179
+ - Each `GridArea` names an area of its parent. It does not show at a breakpoint that does not
180
+ have its area.
181
+
182
+ `validateGridAreas(spec)` finds the problems. `repairGridAreas(spec)` repairs what it can.
183
+
184
+ ## Safety
185
+
186
+ - **No HTML.** The renderer shows only catalog components. Each string from the model is text.
187
+ The code of `CodeBlock` and the cells of `Table` and `DataTable` are text too.
188
+ - **URLs.** Each link (`href`) has one check, `isSafeUrl`. It permits `http:`, `https:`,
189
+ `mailto:`, `tel:` and relative URLs. With `urls.hosts`, an absolute URL must have a host from
190
+ the list.
191
+ - **Media URLs.** The browser loads an image, a video or audio with no click. A `$template` can
192
+ put the state in the URL, so a URL of any host could send what the user types to that host.
193
+ Each such URL has the check `isSafeMediaUrl`: a relative URL, or an `http:` or `https:` URL
194
+ with a host of `urls.mediaHosts`. Repair removes an optional media prop that fails, so an
195
+ `Avatar` shows its initials.
196
+ - **Icons.** An icon name must be in the list: the curated icons and the icons of your options.
197
+ - **Styles.** A style comes only from numbers and enums that a schema validated. The free grid
198
+ accepts only its grammar, and the CSS text comes from the parsed parts. A chart colour comes
199
+ from a fixed enum, and a chart key must be a plain name. A chart gives Joinery only the
200
+ values of its keys from each row, so a row cannot set a `fill` or a `stroke`.
201
+
202
+ ## A smaller prompt: `catalog.pick()`
203
+
204
+ The full catalog makes a long prompt. On 2026-12-01, the prompt of the 69 components was 51,327
205
+ characters (about 13,000 tokens). A pick of ten components for a dashboard was 10,275
206
+ characters. Send only the components that a request needs:
207
+
208
+ ```ts
209
+ const dashboard = catalog.pick(['DashboardPage', 'Card', 'Table', 'Badge', 'Stack'])
210
+ const system = dashboard.prompt()
211
+ ```
212
+
213
+ Use the same catalog, or a larger one, in `<Render>`. On the server, mark the prompt for caching.
214
+
215
+ ## Add-ons
216
+
217
+ Each add-on is a subpath export with an optional peer dependency. The main entry does not import
218
+ them, so an app that does not use them does not load their packages.
219
+
220
+ | Subpath | Peer dependency | Catalog and registry |
221
+ | ------------------------------------- | --------------------------- | --------------------------------------- |
222
+ | `@ember-marquetry/joinery/chart` | `@ember-joinery/chart` | `chartCatalog`, `chartRegistry` |
223
+ | `@ember-marquetry/joinery/data-table` | `@ember-joinery/data-table` | `dataTableCatalog`, `dataTableRegistry` |
224
+ | `@ember-marquetry/joinery/code-block` | `@ember-joinery/code-block` | `codeBlockCatalog`, `codeBlockRegistry` |
225
+ | `@ember-marquetry/joinery/a2ui` | `@ember-marquetry/a2ui` | `a2uiCatalog`, `a2uiRegistry` |
226
+
227
+ Install the peer dependency, then merge the add-on into your catalog and your registry. Do not
228
+ merge the A2UI add-on: see [A2UI basic catalog](#a2ui-basic-catalog).
229
+
230
+ ```ts
231
+ import { mergeCatalogs } from '@ember-marquetry/core'
232
+ import { mergeRegistries } from '@ember-marquetry/ember'
233
+ import { catalog, registry } from '@ember-marquetry/joinery'
234
+ import { chartCatalog, chartRegistry } from '@ember-marquetry/joinery/chart'
235
+
236
+ export const appCatalog = mergeCatalogs(catalog, chartCatalog)
237
+ export const appRegistry = mergeRegistries(registry, chartRegistry)
238
+ ```
239
+
240
+ Each subpath also exports its definitions (`chartDefinitions()`, `dataTableDefinitions()`,
241
+ `codeBlockDefinitions()`), to build a catalog with `defineCatalog`. The add-ons do not use the
242
+ options of `createJoineryCatalog`.
243
+
244
+ The prompt of each add-on alone, measured on 2026-12-01: charts 11,576 characters, the data
245
+ table 4,737 characters, the code block 3,538 characters. Each number includes the rules of the
246
+ spec format, which each prompt has. Thus the cost of an add-on in a merged catalog is less.
247
+
248
+ ### Charts
249
+
250
+ The charts draw plain data: `data` is a list of rows.
251
+
252
+ - `AreaChart`, `BarChart` and `LineChart` take `xKey` (the category of each row) and `series`.
253
+ Each series has a `key` of the rows, a `label` and a `color`.
254
+ - `RadarChart` takes `angleKey` and `series`.
255
+ - `PieChart` and `RadialChart` take `nameKey`, `valueKey` and `categories`. Each category has a
256
+ `key` (a value of `nameKey`), a `label` and a `color`. A row with no category is grey.
257
+ - A `color` is `chart-1` to `chart-5`: the chart colours of the theme.
258
+ - Each chart has a `title`, its accessible name. `legend` (default: false) and `tooltip`
259
+ (default: true) show a legend and a tooltip.
260
+
261
+ ```json
262
+ {
263
+ "type": "BarChart",
264
+ "props": {
265
+ "title": "Visits by month",
266
+ "data": { "$state": "/visits" },
267
+ "xKey": "month",
268
+ "series": [{ "key": "desktop", "label": "Desktop", "color": "chart-1" }],
269
+ "legend": true
270
+ }
271
+ }
272
+ ```
273
+
274
+ ### Data table
275
+
276
+ `DataTable` shows `rows` in `columns`. A column has a `key`, a `label`, and optional `sortable`,
277
+ `align` and `format`. A format is `text`, `number`, `currency`, `percent`, `date` or `badge`.
278
+ `currency` (an ISO 4217 code) and `locale` (a BCP 47 tag) set the formats.
279
+
280
+ - `filter: true` shows a box that filters the rows.
281
+ - `pageSize` puts the rows on pages, with Previous and Next buttons.
282
+ - `selectable: true` shows a checkbox on each row. Bind `selection` to read the selected rows:
283
+ it holds the value of `rowKey` of each row. A change writes `selection`, then starts
284
+ `selectionChange`.
285
+
286
+ ### Code block
287
+
288
+ `CodeBlock` shows `code` as text, with an optional `filename`, `lineNumbers` and a copy button
289
+ (`copy`, default: true). `language` colours the code. It is one of `bash`, `css`, `diff`,
290
+ `html`, `javascript`, `json`, `jsx`, `markdown`, `python`, `sql`, `tsx`, `typescript` and
291
+ `yaml`. Without `language`, the code is plain text.
292
+
293
+ ### A2UI basic catalog
294
+
295
+ `@ember-marquetry/joinery/a2ui` is the catalog and the registry for the specs that
296
+ [`@ember-marquetry/a2ui`](../a2ui/README.md) makes from A2UI v0.9.1 messages. The components
297
+ have the A2UI names and the A2UI props, and they render with Joinery components. Use the catalog
298
+ as it is. Do not merge it with the Joinery catalog, because the two catalogs have the same names
299
+ (`Text`, `Image`, `Icon`, `Card`, `Tabs`, `Button`, `Slider`).
300
+
301
+ ```ts
302
+ import { a2uiCatalog, a2uiEventHandler, a2uiRegistry } from '@ember-marquetry/joinery/a2ui'
303
+
304
+ const actions = {
305
+ // Makes the A2UI client message with `toA2uiAction`, and gives it to your function.
306
+ 'a2ui.event': a2uiEventHandler(message => agent.send(message)),
307
+ 'a2ui.openUrl': ({ url }) => window.open(String(url), '_blank', 'noopener,noreferrer'),
308
+ }
309
+ ```
310
+
311
+ ```hbs
312
+ <Render
313
+ @spec={{this.spec}}
314
+ @catalog={{a2uiCatalog}}
315
+ @registry={{a2uiRegistry}}
316
+ @actions={{this.actions}}
317
+ />
318
+ ```
319
+
320
+ | A2UI | Joinery |
321
+ | --------------- | --------------------------------------------------------------------------------- |
322
+ | `Text` | A paragraph. `h1` to `h5` are headings. `caption` is small, muted text. |
323
+ | `Image` | An image. `fit` and `variant` set the size. |
324
+ | `Icon` | A lucide icon for each A2UI icon name. |
325
+ | `Video` | The video player of the browser. |
326
+ | `AudioPlayer` | The audio player of the browser, with `description` below it. |
327
+ | `Row`, `Column` | `Stack`. |
328
+ | `List` | `Stack`, which scrolls. |
329
+ | `Card` | `Card`. |
330
+ | `Tabs` | Joinery `Tabs`. Each child is the panel of the tab at the same position. |
331
+ | `Modal` | Joinery `Dialog`. The `trigger` opens it. |
332
+ | `Divider` | `Separator`. |
333
+ | `Button` | A Joinery button around its child. `primary` is the default style of Joinery. |
334
+ | `TextField` | `Input`, or `Textarea` for `longText`. `number` and `obscured` set the type. |
335
+ | `CheckBox` | `Checkbox`. |
336
+ | `ChoicePicker` | `RadioGroup` for one value, `ToggleGroup` for chips or for more than one value. |
337
+ | `Slider` | `Slider`, with 100 steps between `min` and `max`. |
338
+ | `DateTimeInput` | The date, time or date and time input of the browser. The value is ISO 8601 text. |
339
+
340
+ Each component accepts `weight` (the flex-grow in a `Row` or a `Column`). A container and a
341
+ media component accept `accessibility.label`, its accessible name. A control accepts
342
+ `accessibility.label` as a hidden label, and `accessibility.description` as help text.
343
+
344
+ What the catalog does not accept is a validation error from `catalog.validate(spec)`:
345
+
346
+ - `validationRegexp` of `TextField`, and `filterable: true` of `ChoicePicker`.
347
+ - An `Icon` from an `svgPath`, and an icon name that is not in the list.
348
+ - `accessibility` on `Text` and on `Divider`.
349
+ - A media URL that the URL rules of the catalog do not permit, such as `file:` or `data:`.
350
+ - A `Slider` or a `DateTimeInput` with no `label` and no `accessibility.label`.
351
+
352
+ The converter reports `checks` and the functions that it cannot convert. `Text` shows markdown
353
+ as plain text. A `DateTimeInput` value with a time zone (`Z` or `+02:00`) shows with no zone, and
354
+ the component reports it to `@onError`. A `Modal` with no `accessibility.label` gets the name "Dialog"
355
+ (`messages.a2uiModalTitle`).
356
+
357
+ ## Copy the components: `npx ember-marquetry add`
358
+
359
+ The `ember-marquetry` CLI copies the source of a component into your app, as the `add` command
360
+ of shadcn does. You can then change the copy.
361
+
362
+ ```bash
363
+ npx ember-marquetry add input
364
+ ```
365
+
366
+ Put your copy in the registry in place of the component of the package:
367
+
368
+ ```ts
369
+ import { mergeRegistries } from '@ember-marquetry/ember'
370
+ import { registry } from '@ember-marquetry/joinery'
371
+ import { Input } from './marquetry/components/inputs/input'
372
+
373
+ export const myRegistry = mergeRegistries(registry, { Input })
374
+ ```
375
+
376
+ The CLI copies the components of the six groups. It does not copy the add-ons. See the README of
377
+ `ember-marquetry` for each command.
378
+
379
+ ## Test support
380
+
381
+ `@ember-marquetry/joinery/test-support` has harnesses for the layout parts and the page
382
+ templates. A harness finds the element of a spec element by its id, with the
383
+ `data-test-mq-element` attribute.
384
+
385
+ | Harness | What it reads |
386
+ | ---------------------- | ------------------------------------------------------------------------------------ |
387
+ | `StackHarness` | `direction`, `gap`, `align`, `justify`, `wraps` |
388
+ | `GridHarness` | `columns`, `gap` |
389
+ | `GridAreasHarness` | `areas`, `shownAreas`, `areaElements`, `area(name)`, `columnTracks()`, `rowTracks()` |
390
+ | `DashboardPageHarness` | `title`, `description`, `headingLevel`, `main`, `actions`, `metrics`, `aside` |
391
+ | `DetailPageHarness` | `title`, `description`, `headingLevel`, `main`, `actions`, `breadcrumb`, `aside` |
392
+ | `WizardPageHarness` | `steps`, `currentStep`, `isLastStep`, `back()`, `next()`, `finish()` |
393
+
394
+ ```ts
395
+ import { GridAreasHarness } from '@ember-marquetry/joinery/test-support'
396
+
397
+ const grid = new GridAreasHarness('layout')
398
+ assert.deepEqual(grid.shownAreas, ['header', 'main', 'side'])
399
+ ```
400
+
401
+ The other components render Joinery components, and each one gets the spec id as its `@name`.
402
+ Thus the harnesses of Joinery find them by the spec id:
403
+
404
+ - `@ember-joinery/test-support` for the core groups, such as `new TabsHarness('settings')`.
405
+ A `Split` is a `ResizableHarness`.
406
+ - `@ember-joinery/chart/test-support` for the charts: `ChartHarness` and `PolarChartHarness`.
407
+ - `@ember-joinery/data-table/test-support` for `DataTable`: `DataTableHarness`.
408
+ - `@ember-joinery/code-block/test-support` for `CodeBlock`: `CodeBlockHarness` and
409
+ `setupClipboard`.
410
+ - `@ember-joinery/test-support` for the A2UI components too. For example, a `TextField` is an
411
+ `InputHarness`, a `ChoicePicker` is a `RadioGroupHarness` or a `ToggleGroupHarness`, and a
412
+ `Modal` is a `DialogHarness`. A `Tabs` tab has the value of its position: `'0'`, `'1'`.
413
+
414
+ `@ember-marquetry/test-support` has `RenderHarness`, for the fallbacks and the confirm dialog of
415
+ `<Render>`, and `scriptedStream`, for a stream that a test controls.
package/addon-main.cjs ADDED
@@ -0,0 +1,4 @@
1
+ 'use strict'
2
+
3
+ const { addonV1Shim } = require('@embroider/addon-shim')
4
+ module.exports = addonV1Shim(__dirname)