@canonical/design-system 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (451) hide show
  1. package/.github/PULL_REQUEST_TEMPLATE.md +15 -6
  2. package/.github/workflows/ci.yml +14 -4
  3. package/.github/workflows/sync-coda-manual.yml +13 -0
  4. package/.github/workflows/sync-coda-scheduled.yml +9 -0
  5. package/.github/workflows/sync-coda.yml +65 -1
  6. package/README.md +132 -79
  7. package/bun.lock +51 -12
  8. package/data/apps/component/file_tree.ttl +6 -1
  9. package/data/apps/component/key_value_pair.ttl +5 -1
  10. package/data/apps/component/navigation.ttl +5 -1
  11. package/data/apps/component/notification.ttl +5 -1
  12. package/data/apps/component/side_navigation.ttl +11 -0
  13. package/data/apps/component/skeleton_loading.ttl +5 -1
  14. package/data/apps/component/status_bar.ttl +5 -1
  15. package/data/apps/component/toolbar.ttl +5 -1
  16. package/data/apps/group/key_value_pairs.ttl +11 -0
  17. package/data/apps/group/notifications.ttl +5 -1
  18. package/data/apps/layout/application_layout.ttl +4 -0
  19. package/data/apps/layout/content_layout.ttl +11 -1
  20. package/data/apps/layout/empty_layout.ttl +5 -1
  21. package/data/apps/layout/list_page_layout.ttl +5 -1
  22. package/data/apps/layout/settings_page_layout.ttl +5 -1
  23. package/data/apps/layout/view_layout.ttl +4 -0
  24. package/data/apps/pattern/action_bar.ttl +11 -0
  25. package/data/apps/pattern/code_diff.ttl +5 -1
  26. package/data/apps/pattern/data_table.ttl +205 -2
  27. package/data/apps/pattern/destructive_modal.ttl +5 -1
  28. package/data/apps/pattern/drawer.ttl +12 -0
  29. package/data/apps/pattern/keyboard_shortcuts.ttl +5 -1
  30. package/data/apps/pattern/notification_center.ttl +19 -1
  31. package/data/apps/pattern/side_panel.ttl +6 -1
  32. package/data/apps/pattern/sidepanel_stacked.ttl +5 -1
  33. package/data/apps/subcomponent/data_table-action_bar.ttl +27 -0
  34. package/data/apps/subcomponent/data_table-body_cell.ttl +106 -0
  35. package/data/apps/subcomponent/data_table-group_header_row.ttl +58 -0
  36. package/data/apps/subcomponent/data_table-header_cell.ttl +73 -0
  37. package/data/apps/subcomponent/data_table-pagination_bar.ttl +44 -0
  38. package/data/apps/subcomponent/data_table-persistent_selection.ttl +50 -0
  39. package/data/apps/subcomponent/data_table-settings_menu.ttl +63 -0
  40. package/data/apps/subcomponent/drawer-content.ttl +12 -0
  41. package/data/apps/subcomponent/drawer-footer.ttl +12 -0
  42. package/data/apps/subcomponent/drawer-header.ttl +12 -0
  43. package/data/apps/subcomponent/file_tree-node.ttl +5 -1
  44. package/data/apps/subcomponent/log.ttl +11 -0
  45. package/data/apps/subcomponent/side_panel-content.ttl +12 -0
  46. package/data/apps/subcomponent/side_panel-footer.ttl +12 -0
  47. package/data/apps/subcomponent/side_panel-header.ttl +12 -0
  48. package/data/apps_anbox/component/theme_switcher.ttl +10 -0
  49. package/data/apps_anbox/pattern/side_menu.ttl +11 -1
  50. package/data/apps_debcrafters/component/example.ttl +10 -0
  51. package/data/apps_debcrafters/component/my_fancy_component.ttl +11 -0
  52. package/data/apps_debcrafters.ttl +4 -0
  53. package/data/apps_juju/pattern/single_select_multi_layered.ttl +4 -1
  54. package/data/apps_landscape/component/password_constraints.ttl +4 -1
  55. package/data/apps_landscape/component/truncated_cell.ttl +38 -0
  56. package/data/apps_launchpad/component/avatar.ttl +31 -0
  57. package/data/apps_launchpad/component/badge.ttl +11 -9
  58. package/data/apps_launchpad/component/breadcrumbs.ttl +5 -2
  59. package/data/apps_launchpad/component/button.ttl +11 -9
  60. package/data/apps_launchpad/component/checkbox_input.ttl +31 -0
  61. package/data/apps_launchpad/component/chip.ttl +11 -8
  62. package/data/apps_launchpad/component/combobox.ttl +16 -11
  63. package/data/apps_launchpad/component/description_list.ttl +8 -3
  64. package/data/apps_launchpad/component/drawer.ttl +38 -0
  65. package/data/apps_launchpad/component/log.ttl +58 -0
  66. package/data/apps_launchpad/component/modal.ttl +44 -0
  67. package/data/apps_launchpad/component/radio_input.ttl +37 -0
  68. package/data/apps_launchpad/component/select_input.ttl +38 -0
  69. package/data/apps_launchpad/component/switch.ttl +8 -4
  70. package/data/apps_launchpad/component/text_input.ttl +13 -9
  71. package/data/apps_launchpad/component/textarea_input.ttl +39 -0
  72. package/data/apps_launchpad/component/tooltip.ttl +12 -8
  73. package/data/apps_launchpad/subcomponent/combobox-checkbox_option.ttl +11 -9
  74. package/data/apps_launchpad/subcomponent/combobox-footer.ttl +8 -3
  75. package/data/apps_launchpad/subcomponent/combobox-group.ttl +10 -6
  76. package/data/apps_launchpad/subcomponent/combobox-helper.ttl +11 -6
  77. package/data/apps_launchpad/subcomponent/combobox-loading.ttl +9 -3
  78. package/data/apps_launchpad/subcomponent/combobox-no_results.ttl +8 -3
  79. package/data/apps_launchpad/subcomponent/combobox-radio_option.ttl +12 -10
  80. package/data/apps_launchpad/subcomponent/combobox-search.ttl +10 -6
  81. package/data/apps_launchpad/subcomponent/description_list-item.ttl +8 -3
  82. package/data/apps_launchpad/subcomponent/log-line.ttl +38 -0
  83. package/data/apps_launchpad/subcomponent/modal-content-body.ttl +18 -0
  84. package/data/apps_launchpad/subcomponent/modal-content-footer.ttl +18 -0
  85. package/data/apps_launchpad/subcomponent/modal-content-header-close_button.ttl +11 -0
  86. package/data/apps_launchpad/subcomponent/modal-content-header.ttl +19 -0
  87. package/data/apps_launchpad/subcomponent/modal-content.ttl +20 -0
  88. package/data/apps_launchpad/subcomponent/side_panel-content-body.ttl +11 -0
  89. package/data/apps_launchpad/subcomponent/side_panel-content-footer.ttl +11 -0
  90. package/data/apps_launchpad/subcomponent/side_panel-content-header-close_button.ttl +11 -0
  91. package/data/apps_launchpad/subcomponent/side_panel-content-header.ttl +12 -0
  92. package/data/apps_launchpad/subcomponent/side_panel-content.ttl +12 -0
  93. package/data/apps_lxd/component/back_link.ttl +29 -0
  94. package/data/apps_lxd/component/code_snippet_with_copy_button.ttl +54 -0
  95. package/data/apps_lxd/component/confirmation_checkbox.ttl +19 -3
  96. package/data/apps_lxd/component/doc_link.ttl +45 -0
  97. package/data/apps_lxd/component/meter.ttl +37 -0
  98. package/data/apps_lxd/component/output_field.ttl +48 -0
  99. package/data/apps_lxd/component/rename_header.ttl +74 -0
  100. package/data/apps_lxd/component/tab_links.ttl +35 -0
  101. package/data/apps_lxd/subcomponent/copy_to_clipboard.ttl +39 -0
  102. package/data/apps_lxd/view/network_topology.ttl +16 -2
  103. package/data/apps_notary.ttl +4 -0
  104. package/data/apps_portal/component/badge.ttl +3 -0
  105. package/data/apps_portal/component/credit_card_input.ttl +10 -0
  106. package/data/apps_portal/component/key_value_pair.ttl +10 -0
  107. package/data/apps_portal/pattern/purchase_summary.ttl +10 -0
  108. package/data/apps_portal/subcomponent/read_only_modal.ttl +10 -0
  109. package/data/apps_workplaceengineering/component/label-highlight.ttl +18 -0
  110. package/data/apps_workplaceengineering/component/rule.ttl +11 -0
  111. package/data/apps_workplaceengineering/component/skip_link.ttl +10 -0
  112. package/data/apps_workplaceengineering/component/theme_switcher.ttl +11 -0
  113. package/data/apps_workplaceengineering/pattern/callout_numbers_card.ttl +11 -0
  114. package/data/apps_workplaceengineering/pattern/event_timeline.ttl +11 -0
  115. package/data/apps_workplaceengineering/pattern/group_card.ttl +11 -0
  116. package/data/apps_workplaceengineering/pattern/travel_provider_card.ttl +12 -0
  117. package/data/apps_workplaceengineering.ttl +4 -0
  118. package/data/documentation/layout/documentation_layout.ttl +5 -1
  119. package/data/documentation/pattern/library_side_navigation.ttl +6 -2
  120. package/data/global/component/accordion.ttl +61 -2
  121. package/data/global/component/announcement.ttl +12 -2
  122. package/data/global/component/avatar.ttl +11 -0
  123. package/data/global/component/badge.ttl +42 -1
  124. package/data/global/component/breadcrumbs.ttl +18 -2
  125. package/data/global/component/button.ttl +36 -8
  126. package/data/global/component/button_link.ttl +5 -1
  127. package/data/global/component/card.ttl +33 -2
  128. package/data/global/component/checkbox_field.ttl +11 -0
  129. package/data/global/component/chip.ttl +74 -2
  130. package/data/global/component/choices_field.ttl +11 -0
  131. package/data/global/component/code_snippet-content.ttl +6 -2
  132. package/data/global/component/code_snippet-header.ttl +6 -2
  133. package/data/global/component/code_snippet.ttl +13 -2
  134. package/data/global/component/color_field.ttl +11 -0
  135. package/data/global/component/combobox_field.ttl +11 -0
  136. package/data/global/component/contextual_menu.ttl +22 -2
  137. package/data/global/component/data_tooltip.ttl +84 -0
  138. package/data/global/component/date_field.ttl +11 -0
  139. package/data/global/component/date_time_field.ttl +11 -0
  140. package/data/global/component/dropdown_button.ttl +18 -0
  141. package/data/global/component/file_upload_field.ttl +11 -0
  142. package/data/global/component/heading.ttl +5 -1
  143. package/data/global/component/hidden_field.ttl +11 -0
  144. package/data/global/component/icon.ttl +6 -2
  145. package/data/global/component/icon_in_container.ttl +5 -1
  146. package/data/global/component/inline_code.ttl +11 -0
  147. package/data/global/component/keyboard_key.ttl +7 -3
  148. package/data/global/component/markdown_field.ttl +11 -0
  149. package/data/global/component/mode_switcher.ttl +11 -0
  150. package/data/global/component/month_field.ttl +11 -0
  151. package/data/global/component/notification_inline.ttl +5 -1
  152. package/data/global/component/notification_toast.ttl +5 -1
  153. package/data/global/component/number_field.ttl +11 -0
  154. package/data/global/component/pagination.ttl +6 -2
  155. package/data/global/component/password_field.ttl +11 -0
  156. package/data/global/component/phone_field.ttl +11 -0
  157. package/data/global/component/popover.ttl +5 -1
  158. package/data/global/component/range_field.ttl +11 -0
  159. package/data/global/component/rating_field.ttl +11 -0
  160. package/data/global/component/relative_timestamp.ttl +10 -0
  161. package/data/global/component/rich_choices_field.ttl +11 -0
  162. package/data/global/component/rich_text_field.ttl +11 -0
  163. package/data/global/component/search_field.ttl +11 -0
  164. package/data/global/component/segmented_control_field.ttl +11 -0
  165. package/data/global/component/select_field.ttl +11 -0
  166. package/data/global/component/switch_field.ttl +11 -0
  167. package/data/global/component/table.ttl +7 -2
  168. package/data/global/component/tabs.ttl +7 -3
  169. package/data/global/component/tag.ttl +18 -0
  170. package/data/global/component/text_field.ttl +11 -0
  171. package/data/global/component/textarea_field.ttl +11 -0
  172. package/data/global/component/tile.ttl +24 -3
  173. package/data/global/component/time_field.ttl +11 -0
  174. package/data/global/component/timestamp.ttl +10 -0
  175. package/data/global/component/tooltip.ttl +75 -56
  176. package/data/global/component/tooltip_wrapper.ttl +81 -0
  177. package/data/global/group/buttons.ttl +12 -1
  178. package/data/global/group/cards.ttl +9 -1
  179. package/data/global/group/code_snippets.ttl +5 -1
  180. package/data/global/group/keyboard_keys.ttl +7 -3
  181. package/data/global/group/tiles.ttl +5 -1
  182. package/data/global/layout/error_layout.ttl +5 -1
  183. package/data/global/layout/form_layout.ttl +5 -1
  184. package/data/global/layout/identity_page_form.ttl +5 -1
  185. package/data/global/modifier/dark.ttl +1 -1
  186. package/data/global/modifier/information.ttl +1 -1
  187. package/data/global/modifier/light.ttl +1 -1
  188. package/data/global/modifier/modal.ttl +6 -0
  189. package/data/global/modifier/surface1.ttl +6 -0
  190. package/data/global/modifier/surface2.ttl +6 -0
  191. package/data/global/modifier/surface3.ttl +6 -0
  192. package/data/global/modifier_family/_emphasis.ttl +2 -1
  193. package/data/global/modifier_family/_other.ttl +2 -1
  194. package/data/global/modifier_family/anticipation.ttl +2 -1
  195. package/data/global/modifier_family/criticality.ttl +2 -1
  196. package/data/global/modifier_family/density.ttl +2 -1
  197. package/data/global/modifier_family/importance.ttl +2 -1
  198. package/data/global/modifier_family/lifecycle.ttl +2 -1
  199. package/data/global/modifier_family/mode.ttl +7 -0
  200. package/data/global/modifier_family/release.ttl +2 -1
  201. package/data/global/modifier_family/surface.ttl +7 -0
  202. package/data/global/pattern/description_list.ttl +11 -0
  203. package/data/global/pattern/field.ttl +11 -0
  204. package/data/global/pattern/form.ttl +10 -0
  205. package/data/global/pattern/form_login.ttl +10 -0
  206. package/data/global/pattern/info_table.ttl +5 -1
  207. package/data/global/pattern/modal.ttl +7 -2
  208. package/data/global/pattern/navigation.ttl +5 -1
  209. package/data/global/pattern/stepper.ttl +5 -1
  210. package/data/global/pattern/table_of_contents.ttl +5 -1
  211. package/data/global/pattern/timeline.ttl +33 -2
  212. package/data/global/subcomponent/accordion-item.ttl +10 -5
  213. package/data/global/subcomponent/breadcrumbs-item.ttl +7 -3
  214. package/data/global/subcomponent/card-content.ttl +8 -3
  215. package/data/global/subcomponent/card-footer.ttl +12 -0
  216. package/data/global/subcomponent/card-header.ttl +8 -3
  217. package/data/global/subcomponent/card-image.ttl +8 -3
  218. package/data/global/subcomponent/card-thumbnail.ttl +6 -1
  219. package/data/global/subcomponent/chart_legend.ttl +11 -0
  220. package/data/global/subcomponent/chart_legend_item.ttl +11 -0
  221. package/data/global/subcomponent/checkbox_input.ttl +11 -0
  222. package/data/global/subcomponent/color_input.ttl +11 -0
  223. package/data/global/subcomponent/combobox_input.ttl +11 -0
  224. package/data/global/subcomponent/date_input.ttl +11 -0
  225. package/data/global/subcomponent/date_time_input.ttl +11 -0
  226. package/data/global/subcomponent/field-description.ttl +11 -0
  227. package/data/global/subcomponent/field-label.ttl +11 -0
  228. package/data/global/subcomponent/file_upload_input.ttl +11 -0
  229. package/data/global/subcomponent/hidden_input.ttl +11 -0
  230. package/data/global/subcomponent/kvp_container.ttl +11 -0
  231. package/data/global/subcomponent/kvpitem_base.ttl +11 -0
  232. package/data/global/subcomponent/markdown_input.ttl +11 -0
  233. package/data/global/subcomponent/modal-content.ttl +5 -1
  234. package/data/global/subcomponent/modal-footer.ttl +5 -1
  235. package/data/global/subcomponent/modal-header.ttl +5 -1
  236. package/data/global/subcomponent/month_input.ttl +11 -0
  237. package/data/global/subcomponent/number_input.ttl +11 -0
  238. package/data/global/subcomponent/password_input.ttl +11 -0
  239. package/data/global/subcomponent/phone_input.ttl +11 -0
  240. package/data/global/subcomponent/radio_input.ttl +11 -0
  241. package/data/global/subcomponent/range_input.ttl +11 -0
  242. package/data/global/subcomponent/rating_input.ttl +11 -0
  243. package/data/global/subcomponent/rich_text_input.ttl +11 -0
  244. package/data/global/subcomponent/search_input.ttl +26 -0
  245. package/data/global/subcomponent/segmented_control_input.ttl +11 -0
  246. package/data/global/subcomponent/select_input.ttl +11 -0
  247. package/data/global/subcomponent/spin_button.ttl +11 -0
  248. package/data/global/subcomponent/spinner.ttl +7 -3
  249. package/data/global/subcomponent/switch_input.ttl +11 -0
  250. package/data/global/subcomponent/table-cell.ttl +5 -1
  251. package/data/global/subcomponent/table-row.ttl +5 -1
  252. package/data/global/subcomponent/text_input.ttl +11 -0
  253. package/data/global/subcomponent/textarea_input.ttl +33 -0
  254. package/data/global/subcomponent/tile-content.ttl +7 -3
  255. package/data/global/subcomponent/tile-header.ttl +13 -4
  256. package/data/global/subcomponent/time_input.ttl +11 -0
  257. package/data/global/subcomponent/timeline-content.ttl +7 -2
  258. package/data/global/subcomponent/timeline-event.ttl +8 -3
  259. package/data/global/subcomponent/timeline-expansion_indicator.ttl +6 -1
  260. package/data/global/subcomponent/timeline-header.ttl +6 -1
  261. package/data/global/variant/tooltip_dense.ttl +14 -0
  262. package/data/global/view/settings_view.ttl +5 -1
  263. package/data/sites/component/blog_card.ttl +11 -0
  264. package/data/sites/component/quote.ttl +11 -0
  265. package/data/sites/component/rule.ttl +11 -0
  266. package/data/sites/component/section.ttl +11 -0
  267. package/data/sites/group/blog_cards.ttl +11 -0
  268. package/data/sites/group/xblog_elements.ttl +10 -0
  269. package/data/sites/layout/blog_page_layout.ttl +11 -0
  270. package/data/{site → sites}/layout/case_study_layout.ttl +6 -2
  271. package/data/sites/layout/site_layout.ttl +11 -0
  272. package/data/sites/pattern/hero-github.ttl +11 -0
  273. package/data/sites/pattern/hero.ttl +11 -0
  274. package/data/sites/pattern/info_table.ttl +11 -0
  275. package/data/sites/pattern/pricing_section.ttl +11 -0
  276. package/data/sites/pattern/pricing_table.ttl +11 -0
  277. package/data/sites/pattern/read_more_section.ttl +11 -0
  278. package/data/sites/pattern/skip_link.ttl +11 -0
  279. package/data/{site.ttl → sites.ttl} +2 -2
  280. package/data/sites_webcomponentsprototype/component/blog_cards.ttl +4 -1
  281. package/data/sites_webcomponentsprototype/component/ctablock.ttl +4 -1
  282. package/data/sites_webcomponentsprototype/component/list.ttl +5 -2
  283. package/data/sites_webcomponentsprototype/component/tabs.ttl +5 -2
  284. package/data/sites_webcomponentsprototype/layout/site_layout.ttl +3 -0
  285. package/data/sites_webcomponentsprototype/pattern/basic_section.ttl +4 -1
  286. package/data/sites_webcomponentsprototype/pattern/blog_section.ttl +4 -1
  287. package/data/sites_webcomponentsprototype/pattern/ctasection.ttl +5 -2
  288. package/data/sites_webcomponentsprototype/pattern/equal_heights.ttl +5 -2
  289. package/data/sites_webcomponentsprototype/pattern/hero.ttl +5 -2
  290. package/data/sites_webcomponentsprototype/pattern/logo_section.ttl +5 -2
  291. package/data/sites_webcomponentsprototype/pattern/quote_wrapper.ttl +5 -2
  292. package/data/sites_webcomponentsprototype/pattern/tiered_list.ttl +5 -2
  293. package/data/tag/allgood.ttl +7 -0
  294. package/data/tag/beta.ttl +7 -0
  295. package/data/tag/candidate.ttl +7 -0
  296. package/data/tag/devbatch1.ttl +7 -0
  297. package/data/tag/devbatch2.ttl +7 -0
  298. package/data/tag/devexternal.ttl +7 -0
  299. package/data/tag/devreactapproved.ttl +7 -0
  300. package/data/tag/devreactbase.ttl +7 -0
  301. package/data/tag/devreactpreapproved.ttl +7 -0
  302. package/data/tag/devspecial.ttl +7 -0
  303. package/data/tag/devsveltedone.ttl +7 -0
  304. package/data/tag/devsveltein-progress.ttl +7 -0
  305. package/data/tag/divergent.ttl +7 -0
  306. package/data/tag/docscomplete.ttl +7 -0
  307. package/data/tag/draft.ttl +7 -0
  308. package/data/tag/edge.ttl +7 -0
  309. package/data/tag/global-docs-missing.ttl +7 -0
  310. package/data/tag/has-no-global-entry.ttl +7 -0
  311. package/data/tag/lpto-be-upstreamed.ttl +7 -0
  312. package/data/tag/lptriageblocked-reqs-design.ttl +7 -0
  313. package/data/tag/lptriageno-upstream.ttl +7 -0
  314. package/data/tag/lptriagereimplement-and-deprecate.ttl +7 -0
  315. package/data/tag/lptriagereimplement-and-keep.ttl +7 -0
  316. package/data/tag/lptriageupstream-and-deprecate.ttl +7 -0
  317. package/data/tag/minimal.ttl +7 -0
  318. package/data/tag/needsdefinition.ttl +7 -0
  319. package/data/tag/needsdiscussion.ttl +7 -0
  320. package/data/tag/needsdocumentation.ttl +7 -0
  321. package/data/tag/needsreview.ttl +7 -0
  322. package/data/tag/needstriage.ttl +7 -0
  323. package/data/tag/needsupdate.ttl +7 -0
  324. package/data/tag/notstarted.ttl +7 -0
  325. package/data/tag/specialadoption-docs.ttl +7 -0
  326. package/data/tag/stable.ttl +7 -0
  327. package/data/tag/stylesready.ttl +7 -0
  328. package/data/tag/triagedbacklog.ttl +7 -0
  329. package/data/tag/triagedrejected.ttl +7 -0
  330. package/data/tag/upstream-candidate.ttl +7 -0
  331. package/data/tag/upstream-compliant.ttl +7 -0
  332. package/data/tag/upstreamcandidate.ttl +7 -0
  333. package/data/tag/waiting-for-delta-review.ttl +7 -0
  334. package/data/tag/wpeinital-implementation.ttl +7 -0
  335. package/data/tag/wpetriageupstream-and-deprecate.ttl +6 -0
  336. package/data/tagcategory/channel.ttl +4 -0
  337. package/data/tagcategory/concept-status.ttl +4 -0
  338. package/data/tagcategory/concept-type.ttl +4 -0
  339. package/data/tagcategory/documentation-stage.ttl +4 -0
  340. package/data/tagcategory/implementation-status.ttl +4 -0
  341. package/data/tagcategory/lpupstream.ttl +4 -0
  342. package/data/tagcategory/review-status.ttl +4 -0
  343. package/data/tagcategory/tmp.ttl +4 -0
  344. package/definitions/ontology.ttl +133 -14
  345. package/examples/form-roster.target.json +550 -0
  346. package/package.json +5 -2
  347. package/skills/adoption-a1-styles/SKILL.md +115 -0
  348. package/skills/adoption-a2-components/SKILL.md +170 -0
  349. package/skills/adoption-a3-forms/SKILL.md +134 -0
  350. package/skills/anatomy-author/ANATOMY_DSL_SPEC.md +89 -106
  351. package/skills/anatomy-author/SKILL.md +318 -141
  352. package/skills/implement-component/SKILL.md +223 -0
  353. package/skills/specify-component/SKILL.md +195 -0
  354. package/skills/specify-pattern/SKILL.md +157 -0
  355. package/source.json +64 -2
  356. package/specs/README.md +17 -0
  357. package/src/cli.ts +23 -10
  358. package/src/commands/index.ts +1 -0
  359. package/src/commands/sync.tests.ts +430 -0
  360. package/src/commands/sync.ts +418 -0
  361. package/src/commands/transform.tests.ts +190 -5
  362. package/src/commands/transform.ts +163 -67
  363. package/src/constants.ts +1 -0
  364. package/src/providers/CodaProvider.tests.ts +94 -0
  365. package/src/providers/CodaProvider.ts +211 -1
  366. package/src/providers/detectSmartChips.tests.ts +42 -0
  367. package/src/providers/detectSmartChips.ts +60 -0
  368. package/src/scripts/checkDataDeletion.ts +68 -0
  369. package/src/scripts/evaluateDataDeletion.tests.ts +100 -0
  370. package/src/scripts/evaluateDataDeletion.ts +100 -0
  371. package/src/sync/constants.ts +52 -0
  372. package/src/sync/diffRoster.tests.ts +455 -0
  373. package/src/sync/diffRoster.ts +241 -0
  374. package/src/sync/loadTargetSpec.tests.ts +208 -0
  375. package/src/sync/loadTargetSpec.ts +139 -0
  376. package/src/sync/renderPlan.tests.ts +144 -0
  377. package/src/sync/renderPlan.ts +88 -0
  378. package/src/sync/snapshotTable.tests.ts +31 -0
  379. package/src/sync/snapshotTable.ts +20 -0
  380. package/src/sync/toLiveEntries.tests.ts +76 -0
  381. package/src/sync/toLiveEntries.ts +55 -0
  382. package/src/sync/types.ts +101 -0
  383. package/src/transform/collectDataMetrics.tests.ts +108 -0
  384. package/src/transform/collectDataMetrics.ts +114 -0
  385. package/src/transform/deltaGuards.tests.ts +136 -0
  386. package/src/transform/deltaGuards.ts +118 -0
  387. package/src/transform/expectedTables.tests.ts +99 -0
  388. package/src/transform/expectedTables.ts +34 -0
  389. package/src/transform/isValidReferenceUri.tests.ts +45 -0
  390. package/src/transform/isValidReferenceUri.ts +55 -0
  391. package/src/transform/materializeInverses.tests.ts +81 -0
  392. package/src/transform/materializeInverses.ts +78 -0
  393. package/src/transform/transform.tests.ts +22 -0
  394. package/src/transform/transform.ts +31 -3
  395. package/src/transform/transformRow.malformedRefs.tests.ts +127 -0
  396. package/src/transform/transformRow.tests.ts +82 -0
  397. package/src/transform/transformRow.ts +90 -7
  398. package/src/transform/types.ts +11 -0
  399. package/vitest.config.ts +29 -0
  400. package/data/apps/pattern/key_value_summary.ttl +0 -7
  401. package/data/apps_anbox/component/copy_to_clipboard.ttl +0 -7
  402. package/data/apps_launchpad/component/checkbox.ttl +0 -28
  403. package/data/apps_launchpad/component/radio.ttl +0 -34
  404. package/data/apps_launchpad/component/select.ttl +0 -34
  405. package/data/apps_launchpad/component/textarea.ttl +0 -35
  406. package/data/apps_launchpad/component/user_avatar.ttl +0 -25
  407. package/data/apps_lxd/component/copy_to_clipboard.ttl +0 -7
  408. package/data/apps_workplace/component/label-highlight.ttl +0 -7
  409. package/data/apps_workplace.ttl +0 -4
  410. package/data/apps_wpe.ttl +0 -4
  411. package/data/global/component/code.ttl +0 -7
  412. package/data/global/component/label.ttl +0 -14
  413. package/data/global/component/rich_text_editor.ttl +0 -7
  414. package/data/global/component/search_bar.ttl +0 -7
  415. package/data/global/component/theme_switcher.ttl +0 -7
  416. package/data/global/modifier/paper.ttl +0 -6
  417. package/data/global/pattern/dropdown_button.ttl +0 -7
  418. package/data/global/subcomponent/divider.ttl +0 -7
  419. package/data/global_form/component/checkbox_input.ttl +0 -7
  420. package/data/global_form/component/choices_input.ttl +0 -7
  421. package/data/global_form/component/combobox_input.ttl +0 -7
  422. package/data/global_form/component/custom_choices_input.ttl +0 -7
  423. package/data/global_form/component/datepicker_input.ttl +0 -7
  424. package/data/global_form/component/rating_input.ttl +0 -7
  425. package/data/global_form/component/rich_text_input.ttl +0 -7
  426. package/data/global_form/component/segmented_control_input.ttl +0 -7
  427. package/data/global_form/component/slider_input.ttl +0 -7
  428. package/data/global_form/component/switch_input.ttl +0 -7
  429. package/data/global_form/component/text_input.ttl +0 -7
  430. package/data/global_form/component/textarea_input.ttl +0 -7
  431. package/data/global_form/component/wysiwginput.ttl +0 -7
  432. package/data/global_form/pattern/field.ttl +0 -7
  433. package/data/global_form/pattern/form.ttl +0 -7
  434. package/data/global_form/subcomponent/field-description.ttl +0 -7
  435. package/data/global_form/subcomponent/field-label.ttl +0 -7
  436. package/data/global_form.ttl +0 -4
  437. package/data/site/component/blog_card.ttl +0 -7
  438. package/data/site/component/quote.ttl +0 -7
  439. package/data/site/component/rule.ttl +0 -7
  440. package/data/site/component/section.ttl +0 -7
  441. package/data/site/group/blog_cards.ttl +0 -7
  442. package/data/site/layout/blog_page_layout.ttl +0 -7
  443. package/data/site/layout/site_layout.ttl +0 -7
  444. package/data/site/pattern/hero-github.ttl +0 -7
  445. package/data/site/pattern/hero.ttl +0 -7
  446. package/data/site/pattern/info_table.ttl +0 -7
  447. package/data/site/pattern/pricing_section.ttl +0 -7
  448. package/data/site/pattern/pricing_table.ttl +0 -7
  449. package/data/site/pattern/read_more_section.ttl +0 -7
  450. package/data/site/pattern/skip_link.ttl +0 -7
  451. package/skills/component-specifier/SKILL.md +0 -412
@@ -14,52 +14,85 @@ Write component anatomy specifications using the Design System Anatomy DSL. This
14
14
  - Discussing component composition with the team ("these nodes should be siblings, not parent-child")
15
15
  - Auditing a codebase against its specifications
16
16
  - Supporting code generation from specifications
17
+ - Serving as step 7 of the `specify-component` flow (and of `specify-pattern`)
17
18
 
18
19
  ## Description
19
20
 
20
21
  The Anatomy DSL represents design system components as YAML trees with:
21
- - **Named nodes**: Components with URIs (`core:component:Button`)
22
+ - **Named nodes**: Components with URIs (`global.component.button`)
22
23
  - **Anonymous nodes**: Structural elements with roles (`content wrapper`)
23
24
  - **Edges**: Parent-child relationships with cardinality and slot names
24
25
  - **Styles**: Platform-agnostic properties using CTI-inspired keys
25
26
 
26
27
  This skill helps you author these specifications correctly and consistently.
27
28
 
29
+ The full specification ships beside this file as `ANATOMY_DSL_SPEC.md` in the
30
+ installed skill folder — `pragma skill lookup anatomy-author` renders only this
31
+ SKILL.md, so open the sibling file directly when you need the complete spec (the
32
+ appendix below carries its type system).
33
+
28
34
  ## Discovery Flow
29
35
 
30
36
  Before writing an anatomy, understand the component's context:
31
37
 
38
+ ```bash
39
+ pragma block list # every component, pattern, layout and subcomponent, with its type and tier
40
+ pragma block lookup Card # full spec: anatomy, modifiers, properties (MCP: block_lookup)
41
+ pragma graph inspect ds:global.component.card # every triple on the entity
32
42
  ```
33
- 1. sem_lookup(type: "ds:Component", filters: {"ds:tier": "ds:global"})
34
- -> Find existing components in the target tier
35
-
36
- 2. sem_context(node: "ds:global.component.button")
37
- -> See modifier families and relationships
38
43
 
39
- 3. sem_lookup(type: "ds:Subcomponent", filters: {"ds:parentComponent": "ds:global.component.card"})
40
- -> Find existing subcomponents for composition patterns
41
- ```
44
+ A bare name can match blocks in several tiers, and `block lookup` silently picks one —
45
+ it resolves `ds:name` globally and cannot be steered to a tier.
46
+ Confirm the tier the lookup picked from its own `- Tier:` line; the name query below lists every tier that carries the name.
47
+ The name query in Workflow §1 is the one that lists them, with each block's IRI. If the
48
+ lookup picked the wrong tier's block, read the block you want with
49
+ `pragma graph inspect <IRI from that row>`, so the lookup step and the inspect step
50
+ describe the same block. If the name has no row at all, the block may be a Group —
51
+ `block list` covers no groups; the group pre-step in Workflow §1 lists them.
42
52
 
43
53
  ### Discovery Queries
44
54
 
55
+ Common prefixes (`ds:`, `cs:`) are applied automatically — no PREFIX preamble needed.
56
+
45
57
  **Find components by tier:**
46
- ```sparql
47
- SELECT ?component ?name WHERE {
58
+ ```bash
59
+ pragma graph query "SELECT ?component ?name WHERE {
48
60
  ?component a ds:Component ;
49
61
  ds:name ?name ;
50
62
  ds:tier ds:global .
51
- }
63
+ }"
52
64
  ```
53
65
 
54
66
  **Find subcomponents of a component:**
55
- ```sparql
56
- SELECT ?sub ?name WHERE {
67
+ ```bash
68
+ pragma graph query "SELECT ?sub ?name WHERE {
57
69
  ?sub a ds:Subcomponent ;
58
70
  ds:name ?name ;
59
- ds:parentComponent ds:global.component.card .
60
- }
71
+ ds:parentComponent <https://ds.canonical.com/global.component.card> .
72
+ }"
61
73
  ```
62
74
 
75
+ Inside a SPARQL body, a local name with MORE THAN ONE dot (`ds:global.component.card`)
76
+ does not parse — use the full IRI there: join `https://ds.canonical.com/` with the
77
+ dotted local name (giving `<https://ds.canonical.com/global.component.card>`), or copy
78
+ one from `pragma graph query` output, which prints absolute IRIs. Prefixed names with
79
+ no dot (`ds:global`, `ds:Component`) or a single dot (`ds:tag.needsdefinition`) work
80
+ as-is.
81
+
82
+ ### The empty-anatomy worklist
83
+
84
+ The Coda sync emits `ds:anatomyDsl` as an empty string for blocks whose anatomy is not
85
+ yet written — this query IS the to-do list; pick from it, never from a copied table:
86
+
87
+ ```bash
88
+ pragma graph query "SELECT ?b ?name WHERE { ?b ds:anatomyDsl ?a ; ds:name ?name . FILTER(STR(?a) = '') }"
89
+ ```
90
+
91
+ The worklist rows point at blocks whose data lives under `data/` — never hand-edit
92
+ that tree: it is regenerated destructively from Coda by CI, and hand edits are
93
+ overwritten by the next sync. An authored DSL lands in the block's spec draft under
94
+ `specs/` (see `specs/README.md`) or is pasted into Coda by a human.
95
+
63
96
  ## DSL Reference
64
97
 
65
98
  ### YAML Format
@@ -101,6 +134,7 @@ Switch
101
134
  SwitchCase
102
135
  -> uri?: string (shorthand)
103
136
  -> node?: Node (full form)
137
+ -> default?: boolean (marks the default case)
104
138
 
105
139
  Relation
106
140
  -> cardinality: string ("1", "0..1", "0..*", "1..*")
@@ -114,7 +148,7 @@ URIs follow turtle conventions with dot-separated paths: `tier.type.name`
114
148
  | Symbol | Meaning | Example |
115
149
  |--------|---------|---------|
116
150
  | `.` | Path hierarchy | `global.component.button` |
117
- | `_` | Word boundary from PascalCase | `CardHeader` → `card_header` |
151
+ | `_` | Word boundary from PascalCase | `ChartLegend` → `chart_legend` |
118
152
  | `-` | Dot in compound names | `Card.Header` → `card-header` |
119
153
 
120
154
  **Examples:**
@@ -123,17 +157,25 @@ URIs follow turtle conventions with dot-separated paths: `tier.type.name`
123
157
  |-----------|-----|
124
158
  | `Button` | `global.component.button` |
125
159
  | `Accordion.Item` | `global.subcomponent.accordion-item` |
126
- | `CardHeader` | `global.subcomponent.card_header` |
160
+ | `ChartLegend` | `global.subcomponent.chart_legend` |
161
+ | `Card.Header` | `global.subcomponent.card-header` |
127
162
 
128
163
  **Tiers and Types:**
129
164
 
130
- | Tier | Type | Use Case |
131
- |------|------|----------|
132
- | `global` | `component` | Universal standalone components |
133
- | `global` | `subcomponent` | Parts of components (user-instantiable) |
134
- | `global` | `pattern` | UX solutions combining components |
135
- | `global` | `layout` | Space-dividing containers |
136
- | `apps` | `component` | Application-specific components |
165
+ The tier segment comes from the live tier set — run `pragma tier list` for the tiers
166
+ that exist today; never assign a tier from a remembered list. The type segment is one
167
+ of the ontology's UIBlock classes:
168
+
169
+ | Type | Use Case |
170
+ |------|----------|
171
+ | `component` | Standalone components |
172
+ | `subcomponent` | Parts of components (user-instantiable) |
173
+ | `pattern` | UX solutions combining components |
174
+ | `layout` | Space-dividing containers |
175
+ | `group` | Repeating series of ONE sibling block (the plural of a Component) |
176
+
177
+ (`pragma block list` omits groups — read them from the graph:
178
+ `pragma graph query "SELECT ?b ?name WHERE { ?b a ds:Group ; ds:name ?name }"`.)
137
179
 
138
180
  **Parent Reference in Subcomponents:**
139
181
 
@@ -141,8 +183,8 @@ Subcomponents must reference their parent in the name:
141
183
 
142
184
  | Labelled Name | Turtle URI |
143
185
  |---------------|------------|
144
- | `Timeline.Item` | `global.subcomponent.timeline-item` |
145
- | `Accordion.ItemHeader` | `global.subcomponent.accordion-item_header` |
186
+ | `Timeline.Event` | `global.subcomponent.timeline-event` |
187
+ | `Timeline.ExpansionIndicator` | `global.subcomponent.timeline-expansion_indicator` |
146
188
 
147
189
  ### Named vs Anonymous
148
190
 
@@ -155,7 +197,7 @@ Subcomponents must reference their parent in the name:
155
197
 
156
198
  ### DRY Principle
157
199
 
158
- When a node has a URI (is not anonymous), it references its own DSL file. Do not inline the full tree—reference the URI only.
200
+ When a node has a URI (is not anonymous), it references its own DSL file. Do not inline the full tree—reference the URI only. A named child MAY carry `styles:` that override its own anatomy in this context — live, `apps_landscape.component.password_constraints` sizes down its `global.component.icon` child — but never a copy of its subtree.
159
201
 
160
202
  ```yaml
161
203
  # Correct: reference only
@@ -165,7 +207,7 @@ edges:
165
207
  relation:
166
208
  cardinality: "1"
167
209
 
168
- # Incorrect: inlining full definition
210
+ # Incorrect: copying the child's own definition
169
211
  edges:
170
212
  - node:
171
213
  uri: global.component.button
@@ -173,6 +215,16 @@ edges:
173
215
  # ... full button styles duplicated here
174
216
  relation:
175
217
  cardinality: "1"
218
+
219
+ # Permitted: contextual style overrides (the live password_constraints → icon pair)
220
+ edges:
221
+ - node:
222
+ uri: global.component.icon
223
+ styles:
224
+ size.width: size/icon/small
225
+ size.height: size/icon/small
226
+ relation:
227
+ cardinality: "1"
176
228
  ```
177
229
 
178
230
  ### Cardinality Notation
@@ -183,7 +235,7 @@ edges:
183
235
  | `"0..1"` | Zero or one (optional) | Card header, Card footer |
184
236
  | `"0..*"` | Zero or more | List items |
185
237
  | `"1..*"` | One or more | Accordion items (need at least one) |
186
- | `"2..5"` | Between 2 and 5 | Tab panel (min/max tabs) |
238
+ | `"2..5"` | Between 2 and 5 | Bounded repeats — live: KeyboardKeys' `"2..*"` (see the Group template below) |
187
239
 
188
240
  ### Switch Construct
189
241
 
@@ -210,9 +262,13 @@ edges:
210
262
  | Value | Meaning | Use Case |
211
263
  |-------|---------|----------|
212
264
  | `props` | Consumer chooses via component props | `<Field type="checkbox">` renders Checkbox vs Radio |
213
- | `internal` | Component manages choice internally | AsyncButton shows Loading/Success/Error based on state |
265
+ | `internal` | Component manages choice internally | AsyncButton shows Loading/Success/Error based on state (hypothetical — see the labelled example below) |
214
266
  | `override` | Consumer can replace with custom component | Timeline accepts custom Event component via slot |
215
267
 
268
+ This enum is NORMATIVE. Live anatomies that predate it may carry qualified
269
+ discriminators (`props/<prop>`) or a `with:` map in exploratory drafts — do not
270
+ copy those into new anatomies.
271
+
216
272
  #### Shorthand Expansion
217
273
 
218
274
  The shorthand `- uri: X` expands to `- node: { uri: X }`. This allows cases to be expressed concisely when no additional metadata is needed:
@@ -220,12 +276,12 @@ The shorthand `- uri: X` expands to `- node: { uri: X }`. This allows cases to b
220
276
  ```yaml
221
277
  # Shorthand (common case)
222
278
  cases:
223
- - uri: global.component.checkbox
279
+ - uri: global.subcomponent.checkbox_input
224
280
 
225
281
  # Expands to full form
226
282
  cases:
227
283
  - node:
228
- uri: global.component.checkbox
284
+ uri: global.subcomponent.checkbox_input
229
285
  ```
230
286
 
231
287
  When a case requires additional properties (styles, nested edges), use the full node form:
@@ -233,7 +289,7 @@ When a case requires additional properties (styles, nested edges), use the full
233
289
  ```yaml
234
290
  cases:
235
291
  - node:
236
- uri: global.component.textarea
292
+ uri: global.subcomponent.textarea_input
237
293
  styles:
238
294
  size.height: hug
239
295
  size.min.height: size/input/multiline
@@ -256,33 +312,34 @@ cases:
256
312
  ```yaml
257
313
  ---
258
314
  node:
259
- uri: global.component.field
315
+ uri: global.pattern.field
260
316
  edges:
261
317
  - switch:
262
318
  on: props
263
319
  cases:
264
- - uri: global.component.checkbox
265
- - uri: global.component.radio
266
- - uri: global.component.text-input
320
+ - uri: global.subcomponent.checkbox_input
321
+ - uri: global.subcomponent.radio_input
322
+ - uri: global.subcomponent.text_input
267
323
  relation:
268
324
  cardinality: "1"
269
325
  slotName: input
270
326
  ```
271
327
 
272
- **Async button with internal state switch:**
328
+ **Async button with internal state switch** (the `async_button` family is hypothetical —
329
+ an illustration of the `internal` discriminator, not a live block):
273
330
 
274
331
  ```yaml
275
332
  ---
276
333
  node:
277
- uri: global.component.async-button
334
+ uri: global.component.async_button
278
335
  edges:
279
336
  - switch:
280
337
  on: internal
281
338
  cases:
282
- - uri: global.subcomponent.async-button-idle
283
- - uri: global.subcomponent.async-button-loading
284
- - uri: global.subcomponent.async-button-success
285
- - uri: global.subcomponent.async-button-error
339
+ - uri: global.subcomponent.async_button-idle
340
+ - uri: global.subcomponent.async_button-loading
341
+ - uri: global.subcomponent.async_button-success
342
+ - uri: global.subcomponent.async_button-error
286
343
  relation:
287
344
  cardinality: "1"
288
345
  ```
@@ -292,7 +349,7 @@ node:
292
349
  ```yaml
293
350
  ---
294
351
  node:
295
- uri: global.component.timeline
352
+ uri: global.pattern.timeline
296
353
  edges:
297
354
  - switch:
298
355
  on: override
@@ -390,7 +447,7 @@ object.position: center | top
390
447
 
391
448
  ```yaml
392
449
  node:
393
- uri: {tier}:component:{Name}
450
+ uri: {tier}.component.{name}
394
451
  styles:
395
452
  # Structural (invariant)
396
453
  layout.type: stack
@@ -402,7 +459,7 @@ node:
402
459
 
403
460
  edges:
404
461
  - node:
405
- uri: {tier}:element:{Name}Content
462
+ uri: {tier}.subcomponent.{name}-content
406
463
  relation:
407
464
  cardinality: "1..1"
408
465
  slotName: default
@@ -412,7 +469,7 @@ node:
412
469
 
413
470
  ```yaml
414
471
  node:
415
- uri: core:component:Card
472
+ uri: global.component.card
416
473
  styles:
417
474
  layout.type: stack
418
475
  layout.direction: vertical
@@ -421,31 +478,22 @@ node:
421
478
  appearance.radius: shape/rounded/full
422
479
 
423
480
  edges:
481
+ # Named children reference their URI only (DRY Principle above) — each
482
+ # carries its own styles in its own anatomy; the live Card does the same.
424
483
  - node:
425
- uri: core:element:CardHeader
426
- styles:
427
- layout.type: flow
428
- layout.direction: horizontal
429
- spacing.internal: spacing/medium
484
+ uri: global.subcomponent.card-header
430
485
  relation:
431
486
  cardinality: "0..1" # optional
432
487
  slotName: header
433
488
 
434
489
  - node:
435
- uri: core:element:CardBody
436
- styles:
437
- layout.type: stack
438
- spacing.internal: spacing/large
490
+ uri: global.subcomponent.card-content
439
491
  relation:
440
492
  cardinality: "1..1" # required
441
- slotName: body
493
+ slotName: default
442
494
 
443
495
  - node:
444
- uri: core:element:CardFooter
445
- styles:
446
- layout.type: flow
447
- layout.justify: space-between
448
- spacing.internal: spacing/small
496
+ uri: global.subcomponent.card-footer
449
497
  relation:
450
498
  cardinality: "0..1" # optional
451
499
  slotName: footer
@@ -455,37 +503,86 @@ node:
455
503
 
456
504
  ```yaml
457
505
  node:
458
- uri: core:component:Accordion
506
+ uri: global.component.accordion
459
507
  styles:
460
508
  layout.type: stack
461
509
  layout.direction: vertical
462
510
  appearance.border: border/style/accordion
463
511
 
464
512
  edges:
513
+ # The repeating child is NAMED — reference its URI only (DRY Principle
514
+ # above); its subtree lives in its own anatomy. The live Accordion does
515
+ # the same.
465
516
  - node:
466
- uri: core:component:AccordionItem
517
+ uri: global.subcomponent.accordion-item
518
+ relation:
519
+ cardinality: "1..*" # one or more items
520
+ slotName: default
521
+ ```
522
+
523
+ The child's own anatomy — a separate spec on `global.subcomponent.accordion-item`
524
+ (transcribed from the live block) — is where the subtree lives; its parts are
525
+ anonymous roles:
526
+
527
+ ```yaml
528
+ node:
529
+ uri: global.subcomponent.accordion-item
530
+ styles:
531
+ layout.type: stack
532
+ layout.direction: vertical
533
+ edges:
534
+ - node:
535
+ role: header tab
536
+ styles:
537
+ layout.type: flow
538
+ layout.direction: horizontal
539
+ layout.align: center
540
+ interaction.cursor: pointer
467
541
  edges:
468
542
  - node:
469
- uri: core:element:AccordionItemHeader
543
+ role: control
470
544
  styles:
471
- layout.type: flow
472
- layout.align: center
473
- interaction.cursor: pointer
545
+ size.width: size/icon/small
546
+ size.height: size/icon/small
474
547
  relation:
475
- cardinality: "1..1"
476
- slotName: header
477
-
548
+ cardinality: "1"
478
549
  - node:
479
- uri: core:element:AccordionItemContent
480
- styles:
481
- layout.overflow: hidden
482
- spacing.internal: spacing/large
550
+ role: heading
483
551
  relation:
484
- cardinality: "1..1"
552
+ cardinality: "1"
485
553
  slotName: default
554
+ relation:
555
+ cardinality: "1"
556
+ slotName: header
486
557
 
558
+ - node:
559
+ role: content panel
560
+ styles:
561
+ layout.overflow: hidden
487
562
  relation:
488
- cardinality: "1..*" # one or more items
563
+ cardinality: "1"
564
+ slotName: default
565
+ ```
566
+
567
+ ### Group (repeating siblings)
568
+
569
+ A Group is the plural of ONE sibling block: a named root carrying only layout and
570
+ spacing styles, and a single URI-only edge whose cardinality bounds the repetition.
571
+ Transcribed from the live `global.group.keyboard_keys`:
572
+
573
+ ```yaml
574
+ node:
575
+ uri: global.group.keyboard_keys
576
+ styles:
577
+ layout.display: inline-flex
578
+ layout.align: center
579
+ spacing.gap: spacing/horizontal/xsmall
580
+ edges:
581
+ - node:
582
+ uri: global.component.keyboard_key
583
+ relation:
584
+ cardinality: "2..*" # a group needs at least two keys
585
+ slotName: default
489
586
  ```
490
587
 
491
588
  ### Anonymous Wrapper Node
@@ -494,7 +591,7 @@ Use when you need a structural element without design system identity:
494
591
 
495
592
  ```yaml
496
593
  node:
497
- uri: core:component:Modal
594
+ uri: global.pattern.modal
498
595
  styles:
499
596
  layout.type: stack
500
597
  appearance.background: color/surface/modal
@@ -517,24 +614,28 @@ node:
517
614
  spacing.internal: spacing/large
518
615
  edges:
519
616
  - node:
520
- uri: core:element:ModalHeader
617
+ uri: global.subcomponent.modal-header
521
618
  relation:
522
619
  cardinality: "0..1"
523
620
  slotName: header
524
621
  - node:
525
- uri: core:element:ModalBody
622
+ uri: global.subcomponent.modal-content
526
623
  relation:
527
624
  cardinality: "1..1"
528
- slotName: body
625
+ slotName: default
529
626
  relation:
530
627
  cardinality: "1..1"
531
628
  ```
532
629
 
533
630
  ### Simple Button Example
534
631
 
632
+ The live Button models its icon and label as ANONYMOUS roles — a user writes `<Button>`
633
+ with props and children, never a `Button.Icon` — so the children carry `role`, not `uri`
634
+ (the Named vs Anonymous rule above):
635
+
535
636
  ```yaml
536
637
  node:
537
- uri: core:component:Button
638
+ uri: global.component.button
538
639
  styles:
539
640
  # Structural
540
641
  layout.type: flow
@@ -556,7 +657,7 @@ node:
556
657
 
557
658
  edges:
558
659
  - node:
559
- uri: core:element:ButtonIcon
660
+ role: icon
560
661
  styles:
561
662
  size.width: size/icon/small
562
663
  size.height: size/icon/small
@@ -565,30 +666,58 @@ node:
565
666
  slotName: icon
566
667
 
567
668
  - node:
568
- uri: core:element:ButtonLabel
669
+ role: label
569
670
  styles:
570
671
  typography.size: font/size/button
571
672
  typography.color: color/text/on-action
572
673
  relation:
573
- cardinality: "1..1"
574
- slotName: label
674
+ cardinality: "0..1"
675
+ slotName: default
575
676
  ```
576
677
 
577
678
  ## Workflow
578
679
 
579
680
  ### 1. Identify the Component
580
681
 
581
- First, determine if the component exists in the design system:
682
+ First, a pre-step: could the name be a Group? Run the group query before the
683
+ lookup — neither `pragma block lookup` nor `pragma block list` covers groups, and
684
+ a name can be BOTH a Group and another tier's block (`BlogCards` is the Group
685
+ `sites.group.blog_cards` AND the Component
686
+ `sites_webcomponentsprototype.component.blog_cards`; the lookup answers with the
687
+ component and never mentions the group):
582
688
 
583
- ```
584
- sem_lookup(type: "ds:Component", filters: {"ds:name": "Button"})
689
+ ```bash
690
+ pragma graph query "SELECT ?b ?name WHERE { ?b a ds:Group ; ds:name ?name }"
585
691
  ```
586
692
 
587
- If it exists, gather context:
588
- ```
589
- sem_context(node: "ds:global.component.button", depth: 2)
693
+ If the name is in the answer and the Group is the block you were asked to write,
694
+ it is an existing block: take the URI from that query row (no §3 derivation),
695
+ gather its context with `pragma graph inspect <IRI>`, and continue from §2.
696
+
697
+ Otherwise, determine if the component exists in the design system:
698
+
699
+ ```bash
700
+ pragma block lookup Card
590
701
  ```
591
702
 
703
+ Two branches:
704
+
705
+ - **Not found** (`ENTITY_NOT_FOUND`) — this is a NEW block: derive its URI in §3
706
+ below, then continue from §2.
707
+ - **Found** — this is a draft for an existing block (the empty-anatomy worklist path):
708
+ take the URI from the block's `pragma block list` row and skip §3. The list carries a
709
+ row per block it covers, not per tier declaring the name, and the lookup above
710
+ resolved it globally — the name query
711
+ `pragma graph query "SELECT ?b WHERE { ?b ds:name ?n . FILTER(LCASE(?n) = LCASE('<Name>')) }"`
712
+ lists every tier's IRI, so you take the one you meant.
713
+ Gather the full context — anatomy, modifiers, properties come with the lookup (a
714
+ bare name can match several tiers: see the multi-tier note in the Discovery Flow
715
+ above); every raw triple with:
716
+
717
+ ```bash
718
+ pragma graph inspect ds:global.component.card
719
+ ```
720
+
592
721
  ### 2. Gather Structural Requirements
593
722
 
594
723
  Ask:
@@ -599,13 +728,19 @@ Ask:
599
728
 
600
729
  ### 3. Determine Tier and Type
601
730
 
731
+ The URI is `{tier}.{type}.{snake_name}` (see URI Encoding Convention above). The tier
732
+ segment comes from the live tier set — run `pragma tier list` and pick from what it
733
+ answers, never from a remembered list; the type segment is one of the ontology's
734
+ UIBlock classes:
735
+
602
736
  | Question | Answer | Result |
603
737
  |----------|--------|--------|
604
- | Is it universal? | Yes | `core:component:` |
605
- | Is it app-specific? | Yes | `app:component:` |
606
- | Is it a subpart? | Yes | `{tier}:element:` |
607
- | Is it a UX solution? | Yes | `{tier}:pattern:` |
608
- | Does it divide space? | Yes | `{tier}:layout:` |
738
+ | Is it universal? | Yes | `global.component.{name}` |
739
+ | Is it app-specific? | Yes | `{apps_tier}.component.{name}` — the app's own tier from `pragma tier list` (e.g. `apps_lxd`) |
740
+ | Is it a subpart? | Yes | `{tier}.subcomponent.{parent}-{part}` |
741
+ | Is it a UX solution? | Yes | `{tier}.pattern.{name}` |
742
+ | Does it divide space? | Yes | `{tier}.layout.{name}` |
743
+ | Is it many instances of ONE sibling block laid out together? | Yes | `{tier}.group.{name}` |
609
744
 
610
745
  ### 4. Define Edges
611
746
 
@@ -636,6 +771,9 @@ Check your anatomy against:
636
771
  - [ ] Style keys follow CTI convention
637
772
  - [ ] Token paths use `/` delimiter
638
773
  - [ ] Anonymous nodes have `role`, not `uri`
774
+ - [ ] Multi-word names encode word boundaries with `_`; `-` appears only where the name carries a dot (per the URI Encoding Convention table)
775
+ - [ ] Every non-root `uri:` either resolves (`pragma graph inspect ds:<uri>`) or is `$custom`, a template placeholder, or a new block or child this same spec introduces (§3)
776
+ - [ ] Named (`uri:`) children carry no copy of their own subtree — contextual style overrides only
639
777
  - [ ] Nested components make semantic sense
640
778
 
641
779
  ## Response Format
@@ -645,7 +783,7 @@ When creating an anatomy, respond with:
645
783
  ```markdown
646
784
  ## Anatomy: {ComponentName}
647
785
 
648
- **URI:** `{tier}:component:{name}`
786
+ **URI:** `{tier}.{type}.{snake_name}`
649
787
  **Tier:** {tier} - {rationale}
650
788
 
651
789
  ### Structure Overview
@@ -664,9 +802,9 @@ When creating an anatomy, respond with:
664
802
  - {Design decision 2}
665
803
 
666
804
  ### Next Steps
667
- 1. Review with design team
668
- 2. Link to Figma component
669
- 3. Use for implementation guidance
805
+ 1. Land the DSL in the block's spec draft under `specs/` (see `specs/README.md`) —
806
+ as step 7 of a specify flow that is the step-6 spec file; never under `data/`
807
+ 2. A human enters the content into Coda, the database of record
670
808
  ```
671
809
 
672
810
  ## Tips
@@ -674,6 +812,7 @@ When creating an anatomy, respond with:
674
812
  1. **Start simple**: Begin with just structure, add styles incrementally
675
813
  2. **Use discovery**: Query existing components for patterns and consistency
676
814
  3. **Name thoughtfully**: URIs are identifiers - choose clear, consistent names
815
+ (see the URI Encoding Convention table above)
677
816
  4. **Annotate decisions**: Use YAML comments for non-obvious choices
678
817
  5. **Validate cardinality**: Think through edge cases (empty states, maximums)
679
818
  6. **Separate concerns**: Structural styles vs themeable styles
@@ -720,7 +859,7 @@ This specification presents a DSL to represent design system anatomies, providin
720
859
  - The children of a node MUST be modelled through a reified relation for annotation purposes
721
860
  - The DSL MUST support anonymous nodes (nodes that are not named components). In this case, the DSL should support role annotations
722
861
  - The DSL MUST support reified annotations of cardinality
723
- - The DSL MUST support all classes of UI Blocks identified in the ontology (Layout, Pattern, Component, Subcomponent)
862
+ - The DSL MUST support all classes of UI Blocks identified in the ontology (Layout, Pattern, Component, Subcomponent, Group)
724
863
 
725
864
  ### Type System
726
865
 
@@ -743,7 +882,7 @@ The children one-to-many relation follows inspiration from the [Relay connection
743
882
  * - Invariant (structural): layout.type, layout.direction, size.width: "fill"
744
883
  * - Themeable (brand/theme): appearance.*, spacing.* (when using tokens)
745
884
  */
746
- type Styles = Record<string, TokenPath | PrimitiveValue>;
885
+ type Styles = Record<string, TokenPath | TokenPath[] | PrimitiveValue>;
747
886
 
748
887
  /**
749
888
  * TokenPath: Forward-slash delimited path to a design token.
@@ -804,8 +943,8 @@ interface BaseNode {
804
943
  */
805
944
  interface NamedNode extends BaseNode {
806
945
  /**
807
- * Unique identifier following "tier:type:name" pattern.
808
- * Examples: "core:component:Button", "app:layout:AppLayout"
946
+ * Unique identifier following "tier.type.name" pattern.
947
+ * Examples: "global.component.button", "apps.layout.application_layout"
809
948
  */
810
949
  uri: string;
811
950
  }
@@ -823,8 +962,39 @@ interface AnonymousNode extends BaseNode {
823
962
 
824
963
  type Node = NamedNode | AnonymousNode;
825
964
 
965
+ /**
966
+ * A switch fills one position with ONE of several alternatives.
967
+ * The discriminator says who chooses: "props" (consumer chooses via
968
+ * component props), "internal" (the component chooses from its own
969
+ * state), "override" (the consumer may replace the default with a
970
+ * custom component).
971
+ */
972
+ interface Switch {
973
+ on: "props" | "internal" | "override";
974
+ cases: SwitchCase[];
975
+ }
976
+
977
+ /**
978
+ * One switch alternative — exactly one of `uri` or `node`.
979
+ * `uri` is the shorthand for `node: { uri }`; use the full `node` form
980
+ * when the case carries styles or edges. The reserved URI `$custom`
981
+ * marks a case filled by a user-provided component.
982
+ */
983
+ interface SwitchCase {
984
+ uri?: string;
985
+ node?: Node;
986
+
987
+ /** Marks the default case. */
988
+ default?: boolean;
989
+ }
990
+
826
991
  interface Edge {
827
- node: Node;
992
+ /** The child node — exactly one of `node` or `switch`. */
993
+ node?: Node;
994
+
995
+ /** A polymorphic position (mutually exclusive with node). */
996
+ switch?: Switch;
997
+
828
998
  relation: Relation;
829
999
  }
830
1000
 
@@ -853,7 +1023,7 @@ Alternatives considered and rejected:
853
1023
 
854
1024
  ```yaml
855
1025
  node:
856
- uri: core:component:Accordion
1026
+ uri: global.component.accordion
857
1027
  styles:
858
1028
  # Structural (invariant)
859
1029
  layout.type: stack
@@ -863,49 +1033,56 @@ node:
863
1033
  appearance.border: border/style/accordion
864
1034
 
865
1035
  edges:
1036
+ # The repeating child is NAMED — reference its URI only (DRY Principle);
1037
+ # its subtree lives in its own anatomy. The live Accordion does the same.
866
1038
  - node:
867
- uri: core:component:AccordionItem
1039
+ uri: global.subcomponent.accordion-item
1040
+ relation:
1041
+ cardinality: "1..*"
1042
+ slotName: default
1043
+ ```
1044
+
1045
+ The child's own anatomy — a separate spec on `global.subcomponent.accordion-item`
1046
+ (transcribed from the live block) — carries the subtree as anonymous roles:
1047
+
1048
+ ```yaml
1049
+ node:
1050
+ uri: global.subcomponent.accordion-item
1051
+ styles:
1052
+ layout.type: stack
1053
+ layout.direction: vertical
1054
+ edges:
1055
+ - node:
1056
+ role: header tab
1057
+ styles:
1058
+ layout.type: flow
1059
+ layout.direction: horizontal
1060
+ layout.align: center
1061
+ interaction.cursor: pointer
868
1062
  edges:
869
1063
  - node:
870
- uri: core:element:AccordionItemHeader
1064
+ role: control
871
1065
  styles:
872
- # Structural (invariant)
873
- layout.type: flow
874
- layout.direction: horizontal
875
- layout.align: center
876
-
877
- # Interaction (invariant)
878
- interaction.cursor: pointer
879
- interaction.transition.property: background
880
- interaction.transition.timing: ease
881
-
882
- # Themeable
883
- spacing.internal: spacing/medium
884
- appearance.background: color/surface/header
885
- typography.weight: font/weight/semibold
886
- interaction.transition.duration: transition/duration
887
-
1066
+ size.width: size/icon/small
1067
+ size.height: size/icon/small
888
1068
  relation:
889
- cardinality: "1..1"
890
- slotName: header
891
-
1069
+ cardinality: "1"
892
1070
  - node:
893
- uri: core:element:AccordionItemContent
894
- styles:
895
- # Structural (invariant)
896
- layout.display: block
897
- layout.overflow: hidden
898
-
899
- # Themeable
900
- spacing.internal: spacing/large
901
- appearance.background: color/surface/content
902
-
1071
+ role: heading
903
1072
  relation:
904
- cardinality: "1..1"
1073
+ cardinality: "1"
905
1074
  slotName: default
1075
+ relation:
1076
+ cardinality: "1"
1077
+ slotName: header
906
1078
 
1079
+ - node:
1080
+ role: content panel
1081
+ styles:
1082
+ layout.overflow: hidden
907
1083
  relation:
908
- cardinality: "1..*"
1084
+ cardinality: "1"
1085
+ slotName: default
909
1086
  ```
910
1087
 
911
1088
  ### Future Work