@canonical/design-system 0.1.1 → 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.
- package/.github/PULL_REQUEST_TEMPLATE.md +22 -0
- package/.github/workflows/ci.yml +49 -0
- package/.github/workflows/sync-coda-manual.yml +13 -0
- package/.github/workflows/sync-coda-scheduled.yml +9 -0
- package/.github/workflows/sync-coda.yml +65 -1
- package/.mcp.json +1 -3
- package/README.md +132 -79
- package/biome.json +1 -1
- package/bun.lock +80 -38
- package/data/apps/component/file_tree.ttl +6 -1
- package/data/apps/component/key_value_pair.ttl +5 -1
- package/data/apps/component/navigation.ttl +5 -1
- package/data/apps/component/notification.ttl +5 -1
- package/data/apps/component/side_navigation.ttl +11 -0
- package/data/apps/component/skeleton_loading.ttl +5 -1
- package/data/apps/component/status_bar.ttl +5 -1
- package/data/apps/component/toolbar.ttl +5 -1
- package/data/apps/group/key_value_pairs.ttl +11 -0
- package/data/apps/group/notifications.ttl +5 -1
- package/data/apps/layout/application_layout.ttl +4 -0
- package/data/apps/layout/content_layout.ttl +11 -1
- package/data/apps/layout/empty_layout.ttl +5 -1
- package/data/apps/layout/list_page_layout.ttl +5 -1
- package/data/apps/layout/settings_page_layout.ttl +5 -1
- package/data/apps/layout/view_layout.ttl +4 -0
- package/data/apps/pattern/action_bar.ttl +11 -0
- package/data/apps/pattern/code_diff.ttl +5 -1
- package/data/apps/pattern/data_table.ttl +205 -2
- package/data/apps/pattern/destructive_modal.ttl +5 -1
- package/data/apps/pattern/drawer.ttl +12 -0
- package/data/apps/pattern/keyboard_shortcuts.ttl +5 -1
- package/data/apps/pattern/notification_center.ttl +19 -1
- package/data/apps/pattern/side_panel.ttl +6 -1
- package/data/apps/pattern/sidepanel_stacked.ttl +5 -1
- package/data/apps/subcomponent/data_table-action_bar.ttl +27 -0
- package/data/apps/subcomponent/data_table-body_cell.ttl +106 -0
- package/data/apps/subcomponent/data_table-group_header_row.ttl +58 -0
- package/data/apps/subcomponent/data_table-header_cell.ttl +73 -0
- package/data/apps/subcomponent/data_table-pagination_bar.ttl +44 -0
- package/data/apps/subcomponent/data_table-persistent_selection.ttl +50 -0
- package/data/apps/subcomponent/data_table-settings_menu.ttl +63 -0
- package/data/apps/subcomponent/drawer-content.ttl +12 -0
- package/data/apps/subcomponent/drawer-footer.ttl +12 -0
- package/data/apps/subcomponent/drawer-header.ttl +12 -0
- package/data/apps/subcomponent/file_tree-node.ttl +5 -1
- package/data/apps/subcomponent/log.ttl +11 -0
- package/data/apps/subcomponent/side_panel-content.ttl +12 -0
- package/data/apps/subcomponent/side_panel-footer.ttl +12 -0
- package/data/apps/subcomponent/side_panel-header.ttl +12 -0
- package/data/apps_anbox/component/theme_switcher.ttl +10 -0
- package/data/apps_anbox/pattern/side_menu.ttl +11 -1
- package/data/apps_debcrafters/component/example.ttl +10 -0
- package/data/apps_debcrafters/component/my_fancy_component.ttl +11 -0
- package/data/apps_debcrafters.ttl +4 -0
- package/data/apps_juju/pattern/single_select_multi_layered.ttl +4 -1
- package/data/apps_landscape/component/password_constraints.ttl +4 -1
- package/data/apps_landscape/component/truncated_cell.ttl +38 -0
- package/data/apps_launchpad/component/avatar.ttl +31 -0
- package/data/apps_launchpad/component/badge.ttl +11 -8
- package/data/apps_launchpad/component/breadcrumbs.ttl +5 -2
- package/data/apps_launchpad/component/button.ttl +10 -7
- package/data/apps_launchpad/component/checkbox_input.ttl +31 -0
- package/data/apps_launchpad/component/chip.ttl +11 -8
- package/data/apps_launchpad/component/combobox.ttl +16 -10
- package/data/apps_launchpad/component/description_list.ttl +8 -3
- package/data/apps_launchpad/component/drawer.ttl +38 -0
- package/data/apps_launchpad/component/log.ttl +58 -0
- package/data/apps_launchpad/component/modal.ttl +44 -0
- package/data/apps_launchpad/component/radio_input.ttl +37 -0
- package/data/apps_launchpad/component/select_input.ttl +38 -0
- package/data/apps_launchpad/component/switch.ttl +8 -4
- package/data/apps_launchpad/component/text_input.ttl +13 -8
- package/data/apps_launchpad/component/textarea_input.ttl +39 -0
- package/data/apps_launchpad/component/tooltip.ttl +12 -7
- package/data/apps_launchpad/subcomponent/combobox-checkbox_option.ttl +11 -9
- package/data/apps_launchpad/subcomponent/combobox-footer.ttl +8 -3
- package/data/apps_launchpad/subcomponent/combobox-group.ttl +10 -6
- package/data/apps_launchpad/subcomponent/combobox-helper.ttl +11 -6
- package/data/apps_launchpad/subcomponent/combobox-loading.ttl +9 -3
- package/data/apps_launchpad/subcomponent/combobox-no_results.ttl +8 -3
- package/data/apps_launchpad/subcomponent/combobox-radio_option.ttl +12 -10
- package/data/apps_launchpad/subcomponent/combobox-search.ttl +10 -6
- package/data/apps_launchpad/subcomponent/description_list-item.ttl +8 -3
- package/data/apps_launchpad/subcomponent/log-line.ttl +38 -0
- package/data/apps_launchpad/subcomponent/modal-content-body.ttl +18 -0
- package/data/apps_launchpad/subcomponent/modal-content-footer.ttl +18 -0
- package/data/apps_launchpad/subcomponent/modal-content-header-close_button.ttl +11 -0
- package/data/apps_launchpad/subcomponent/modal-content-header.ttl +19 -0
- package/data/apps_launchpad/subcomponent/modal-content.ttl +20 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-body.ttl +11 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-footer.ttl +11 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-header-close_button.ttl +11 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-header.ttl +12 -0
- package/data/apps_launchpad/subcomponent/side_panel-content.ttl +12 -0
- package/data/apps_lxd/component/back_link.ttl +29 -0
- package/data/apps_lxd/component/code_snippet_with_copy_button.ttl +54 -0
- package/data/apps_lxd/component/confirmation_checkbox.ttl +19 -3
- package/data/apps_lxd/component/doc_link.ttl +45 -0
- package/data/apps_lxd/component/meter.ttl +37 -0
- package/data/apps_lxd/component/output_field.ttl +48 -0
- package/data/apps_lxd/component/rename_header.ttl +74 -0
- package/data/apps_lxd/component/tab_links.ttl +35 -0
- package/data/apps_lxd/subcomponent/copy_to_clipboard.ttl +39 -0
- package/data/apps_lxd/view/network_topology.ttl +16 -2
- package/data/apps_notary.ttl +4 -0
- package/data/apps_portal/component/badge.ttl +3 -0
- package/data/apps_portal/component/credit_card_input.ttl +10 -0
- package/data/apps_portal/component/key_value_pair.ttl +10 -0
- package/data/apps_portal/pattern/purchase_summary.ttl +10 -0
- package/data/apps_portal/subcomponent/read_only_modal.ttl +10 -0
- package/data/apps_workplaceengineering/component/label-highlight.ttl +18 -0
- package/data/apps_workplaceengineering/component/rule.ttl +11 -0
- package/data/apps_workplaceengineering/component/skip_link.ttl +10 -0
- package/data/apps_workplaceengineering/component/theme_switcher.ttl +11 -0
- package/data/apps_workplaceengineering/pattern/callout_numbers_card.ttl +11 -0
- package/data/apps_workplaceengineering/pattern/event_timeline.ttl +11 -0
- package/data/apps_workplaceengineering/pattern/group_card.ttl +11 -0
- package/data/apps_workplaceengineering/pattern/travel_provider_card.ttl +12 -0
- package/data/apps_workplaceengineering.ttl +4 -0
- package/data/documentation/layout/documentation_layout.ttl +5 -1
- package/data/documentation/pattern/library_side_navigation.ttl +6 -2
- package/data/global/component/accordion.ttl +61 -2
- package/data/global/component/announcement.ttl +12 -2
- package/data/global/component/avatar.ttl +11 -0
- package/data/global/component/badge.ttl +42 -1
- package/data/global/component/breadcrumbs.ttl +18 -2
- package/data/global/component/button.ttl +36 -6
- package/data/global/component/button_link.ttl +5 -1
- package/data/global/component/card.ttl +33 -2
- package/data/global/component/checkbox_field.ttl +11 -0
- package/data/global/component/chip.ttl +74 -2
- package/data/global/component/choices_field.ttl +11 -0
- package/data/global/component/code_snippet-content.ttl +6 -2
- package/data/global/component/code_snippet-header.ttl +6 -2
- package/data/global/component/code_snippet.ttl +13 -2
- package/data/global/component/color_field.ttl +11 -0
- package/data/global/component/combobox_field.ttl +11 -0
- package/data/global/component/contextual_menu.ttl +22 -2
- package/data/global/component/data_tooltip.ttl +84 -0
- package/data/global/component/date_field.ttl +11 -0
- package/data/global/component/date_time_field.ttl +11 -0
- package/data/global/component/dropdown_button.ttl +18 -0
- package/data/global/component/file_upload_field.ttl +11 -0
- package/data/global/component/heading.ttl +7 -2
- package/data/global/component/hidden_field.ttl +11 -0
- package/data/global/component/icon.ttl +6 -2
- package/data/global/component/icon_in_container.ttl +5 -1
- package/data/global/component/inline_code.ttl +11 -0
- package/data/global/component/keyboard_key.ttl +7 -3
- package/data/global/component/markdown_field.ttl +11 -0
- package/data/global/component/mode_switcher.ttl +11 -0
- package/data/global/component/month_field.ttl +11 -0
- package/data/global/component/notification_inline.ttl +5 -1
- package/data/global/component/notification_toast.ttl +5 -1
- package/data/global/component/number_field.ttl +11 -0
- package/data/global/component/pagination.ttl +6 -2
- package/data/global/component/password_field.ttl +11 -0
- package/data/global/component/phone_field.ttl +11 -0
- package/data/global/component/popover.ttl +5 -1
- package/data/global/component/range_field.ttl +11 -0
- package/data/global/component/rating_field.ttl +11 -0
- package/data/global/component/relative_timestamp.ttl +10 -0
- package/data/global/component/rich_choices_field.ttl +11 -0
- package/data/global/component/rich_text_field.ttl +11 -0
- package/data/global/component/search_field.ttl +11 -0
- package/data/global/component/segmented_control_field.ttl +11 -0
- package/data/global/component/select_field.ttl +11 -0
- package/data/global/component/switch_field.ttl +11 -0
- package/data/global/component/table.ttl +7 -2
- package/data/global/component/tabs.ttl +7 -3
- package/data/global/component/tag.ttl +18 -0
- package/data/global/component/text_field.ttl +11 -0
- package/data/global/component/textarea_field.ttl +11 -0
- package/data/global/component/tile.ttl +24 -3
- package/data/global/component/time_field.ttl +11 -0
- package/data/global/component/timestamp.ttl +10 -0
- package/data/global/component/tooltip.ttl +56 -18
- package/data/global/component/tooltip_wrapper.ttl +81 -0
- package/data/global/group/buttons.ttl +12 -1
- package/data/global/group/cards.ttl +9 -1
- package/data/global/group/code_snippets.ttl +5 -1
- package/data/global/group/keyboard_keys.ttl +7 -3
- package/data/global/group/tiles.ttl +5 -1
- package/data/global/layout/error_layout.ttl +5 -1
- package/data/global/layout/form_layout.ttl +5 -1
- package/data/global/layout/identity_page_form.ttl +5 -1
- package/data/global/modifier/dark.ttl +1 -1
- package/data/global/modifier/information.ttl +1 -1
- package/data/global/modifier/light.ttl +1 -1
- package/data/global/modifier/modal.ttl +6 -0
- package/data/global/modifier/surface1.ttl +6 -0
- package/data/global/modifier/surface2.ttl +6 -0
- package/data/global/modifier/surface3.ttl +6 -0
- package/data/global/modifier_family/_emphasis.ttl +2 -1
- package/data/global/modifier_family/_other.ttl +2 -1
- package/data/global/modifier_family/anticipation.ttl +2 -1
- package/data/global/modifier_family/criticality.ttl +2 -1
- package/data/global/modifier_family/density.ttl +2 -1
- package/data/global/modifier_family/importance.ttl +2 -1
- package/data/global/modifier_family/lifecycle.ttl +2 -1
- package/data/global/modifier_family/mode.ttl +7 -0
- package/data/global/modifier_family/release.ttl +2 -1
- package/data/global/modifier_family/surface.ttl +7 -0
- package/data/global/pattern/description_list.ttl +11 -0
- package/data/global/pattern/field.ttl +11 -0
- package/data/global/pattern/form.ttl +10 -0
- package/data/global/pattern/form_login.ttl +10 -0
- package/data/global/pattern/info_table.ttl +5 -1
- package/data/global/pattern/modal.ttl +7 -2
- package/data/global/pattern/navigation.ttl +5 -1
- package/data/global/pattern/stepper.ttl +5 -1
- package/data/global/pattern/table_of_contents.ttl +5 -1
- package/data/global/pattern/timeline.ttl +41 -6
- package/data/global/subcomponent/accordion-item.ttl +10 -5
- package/data/global/subcomponent/breadcrumbs-item.ttl +7 -3
- package/data/global/subcomponent/card-content.ttl +8 -3
- package/data/global/subcomponent/card-footer.ttl +12 -0
- package/data/global/subcomponent/card-header.ttl +8 -3
- package/data/global/subcomponent/card-image.ttl +8 -3
- package/data/global/subcomponent/card-thumbnail.ttl +6 -1
- package/data/global/subcomponent/chart_legend.ttl +11 -0
- package/data/global/subcomponent/chart_legend_item.ttl +11 -0
- package/data/global/subcomponent/checkbox_input.ttl +11 -0
- package/data/global/subcomponent/color_input.ttl +11 -0
- package/data/global/subcomponent/combobox_input.ttl +11 -0
- package/data/global/subcomponent/date_input.ttl +11 -0
- package/data/global/subcomponent/date_time_input.ttl +11 -0
- package/data/global/subcomponent/field-description.ttl +11 -0
- package/data/global/subcomponent/field-label.ttl +11 -0
- package/data/global/subcomponent/file_upload_input.ttl +11 -0
- package/data/global/subcomponent/hidden_input.ttl +11 -0
- package/data/global/subcomponent/kvp_container.ttl +11 -0
- package/data/global/subcomponent/kvpitem_base.ttl +11 -0
- package/data/global/subcomponent/markdown_input.ttl +11 -0
- package/data/global/subcomponent/modal-content.ttl +5 -1
- package/data/global/subcomponent/modal-footer.ttl +5 -1
- package/data/global/subcomponent/modal-header.ttl +5 -1
- package/data/global/subcomponent/month_input.ttl +11 -0
- package/data/global/subcomponent/number_input.ttl +11 -0
- package/data/global/subcomponent/password_input.ttl +11 -0
- package/data/global/subcomponent/phone_input.ttl +11 -0
- package/data/global/subcomponent/radio_input.ttl +11 -0
- package/data/global/subcomponent/range_input.ttl +11 -0
- package/data/global/subcomponent/rating_input.ttl +11 -0
- package/data/global/subcomponent/rich_text_input.ttl +11 -0
- package/data/global/subcomponent/search_input.ttl +26 -0
- package/data/global/subcomponent/segmented_control_input.ttl +11 -0
- package/data/global/subcomponent/select_input.ttl +11 -0
- package/data/global/subcomponent/spin_button.ttl +11 -0
- package/data/global/subcomponent/spinner.ttl +7 -3
- package/data/global/subcomponent/switch_input.ttl +11 -0
- package/data/global/subcomponent/table-cell.ttl +5 -1
- package/data/global/subcomponent/table-row.ttl +5 -1
- package/data/global/subcomponent/text_input.ttl +11 -0
- package/data/global/subcomponent/textarea_input.ttl +33 -0
- package/data/global/subcomponent/tile-content.ttl +7 -3
- package/data/global/subcomponent/tile-header.ttl +13 -4
- package/data/global/subcomponent/time_input.ttl +11 -0
- package/data/global/subcomponent/timeline-content.ttl +7 -2
- package/data/global/subcomponent/timeline-event.ttl +8 -3
- package/data/global/subcomponent/timeline-expansion_indicator.ttl +6 -1
- package/data/global/subcomponent/timeline-header.ttl +6 -1
- package/data/global/variant/tooltip_dense.ttl +14 -0
- package/data/global/view/settings_view.ttl +5 -1
- package/data/sites/component/blog_card.ttl +11 -0
- package/data/sites/component/quote.ttl +11 -0
- package/data/sites/component/rule.ttl +11 -0
- package/data/sites/component/section.ttl +11 -0
- package/data/sites/group/blog_cards.ttl +11 -0
- package/data/sites/group/xblog_elements.ttl +10 -0
- package/data/sites/layout/blog_page_layout.ttl +11 -0
- package/data/{site → sites}/layout/case_study_layout.ttl +6 -2
- package/data/sites/layout/site_layout.ttl +11 -0
- package/data/sites/pattern/hero-github.ttl +11 -0
- package/data/sites/pattern/hero.ttl +11 -0
- package/data/sites/pattern/info_table.ttl +11 -0
- package/data/sites/pattern/pricing_section.ttl +11 -0
- package/data/sites/pattern/pricing_table.ttl +11 -0
- package/data/sites/pattern/read_more_section.ttl +11 -0
- package/data/sites/pattern/skip_link.ttl +11 -0
- package/data/{site.ttl → sites.ttl} +2 -2
- package/data/sites_webcomponentsprototype/component/blog_cards.ttl +4 -1
- package/data/sites_webcomponentsprototype/component/ctablock.ttl +4 -1
- package/data/sites_webcomponentsprototype/component/list.ttl +5 -2
- package/data/sites_webcomponentsprototype/component/tabs.ttl +5 -2
- package/data/sites_webcomponentsprototype/layout/site_layout.ttl +3 -0
- package/data/sites_webcomponentsprototype/pattern/basic_section.ttl +4 -1
- package/data/sites_webcomponentsprototype/pattern/blog_section.ttl +4 -1
- package/data/sites_webcomponentsprototype/pattern/ctasection.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/equal_heights.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/hero.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/logo_section.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/quote_wrapper.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/tiered_list.ttl +5 -2
- package/data/tag/allgood.ttl +7 -0
- package/data/tag/beta.ttl +7 -0
- package/data/tag/candidate.ttl +7 -0
- package/data/tag/devbatch1.ttl +7 -0
- package/data/tag/devbatch2.ttl +7 -0
- package/data/tag/devexternal.ttl +7 -0
- package/data/tag/devreactapproved.ttl +7 -0
- package/data/tag/devreactbase.ttl +7 -0
- package/data/tag/devreactpreapproved.ttl +7 -0
- package/data/tag/devspecial.ttl +7 -0
- package/data/tag/devsveltedone.ttl +7 -0
- package/data/tag/devsveltein-progress.ttl +7 -0
- package/data/tag/divergent.ttl +7 -0
- package/data/tag/docscomplete.ttl +7 -0
- package/data/tag/draft.ttl +7 -0
- package/data/tag/edge.ttl +7 -0
- package/data/tag/global-docs-missing.ttl +7 -0
- package/data/tag/has-no-global-entry.ttl +7 -0
- package/data/tag/lpto-be-upstreamed.ttl +7 -0
- package/data/tag/lptriageblocked-reqs-design.ttl +7 -0
- package/data/tag/lptriageno-upstream.ttl +7 -0
- package/data/tag/lptriagereimplement-and-deprecate.ttl +7 -0
- package/data/tag/lptriagereimplement-and-keep.ttl +7 -0
- package/data/tag/lptriageupstream-and-deprecate.ttl +7 -0
- package/data/tag/minimal.ttl +7 -0
- package/data/tag/needsdefinition.ttl +7 -0
- package/data/tag/needsdiscussion.ttl +7 -0
- package/data/tag/needsdocumentation.ttl +7 -0
- package/data/tag/needsreview.ttl +7 -0
- package/data/tag/needstriage.ttl +7 -0
- package/data/tag/needsupdate.ttl +7 -0
- package/data/tag/notstarted.ttl +7 -0
- package/data/tag/specialadoption-docs.ttl +7 -0
- package/data/tag/stable.ttl +7 -0
- package/data/tag/stylesready.ttl +7 -0
- package/data/tag/triagedbacklog.ttl +7 -0
- package/data/tag/triagedrejected.ttl +7 -0
- package/data/tag/upstream-candidate.ttl +7 -0
- package/data/tag/upstream-compliant.ttl +7 -0
- package/data/tag/upstreamcandidate.ttl +7 -0
- package/data/tag/waiting-for-delta-review.ttl +7 -0
- package/data/tag/wpeinital-implementation.ttl +7 -0
- package/data/tag/wpetriageupstream-and-deprecate.ttl +6 -0
- package/data/tagcategory/channel.ttl +4 -0
- package/data/tagcategory/concept-status.ttl +4 -0
- package/data/tagcategory/concept-type.ttl +4 -0
- package/data/tagcategory/documentation-stage.ttl +4 -0
- package/data/tagcategory/implementation-status.ttl +4 -0
- package/data/tagcategory/lpupstream.ttl +4 -0
- package/data/tagcategory/review-status.ttl +4 -0
- package/data/tagcategory/tmp.ttl +4 -0
- package/definitions/ontology.ttl +237 -171
- package/examples/form-roster.target.json +550 -0
- package/package.json +5 -2
- package/skills/adoption-a1-styles/SKILL.md +115 -0
- package/skills/adoption-a2-components/SKILL.md +170 -0
- package/skills/adoption-a3-forms/SKILL.md +134 -0
- package/skills/anatomy-author/ANATOMY_DSL_SPEC.md +89 -106
- package/skills/anatomy-author/SKILL.md +323 -141
- package/skills/design-auditor/SKILL.md +5 -0
- package/skills/implement-component/SKILL.md +223 -0
- package/skills/specify-component/SKILL.md +195 -0
- package/skills/specify-pattern/SKILL.md +157 -0
- package/source.json +71 -4
- package/specs/README.md +17 -0
- package/src/cli.ts +48 -35
- package/src/collect/generateTurtle.tests.ts +181 -176
- package/src/collect/generateTurtle.ts +189 -138
- package/src/collect/index.ts +5 -2
- package/src/collect/scanAnnotations.tests.ts +116 -110
- package/src/collect/scanAnnotations.ts +35 -33
- package/src/collect/types.ts +34 -33
- package/src/collect/validateCollectConfig.tests.ts +135 -112
- package/src/collect/validateCollectConfig.ts +60 -54
- package/src/collect-implementations.ts +101 -88
- package/src/commands/extract.tests.ts +31 -32
- package/src/commands/extract.ts +29 -27
- package/src/commands/index.ts +2 -1
- package/src/commands/list.tests.ts +13 -14
- package/src/commands/list.ts +9 -9
- package/src/commands/sync.tests.ts +430 -0
- package/src/commands/sync.ts +418 -0
- package/src/commands/transform.tests.ts +210 -25
- package/src/commands/transform.ts +215 -115
- package/src/config/types.ts +40 -40
- package/src/config/validateConfig.tests.ts +31 -31
- package/src/config/validateConfig.ts +9 -9
- package/src/constants.ts +8 -8
- package/src/graph/GraphStore.tests.ts +111 -111
- package/src/graph/GraphStore.ts +205 -189
- package/src/graph/PrefixMap.tests.ts +124 -122
- package/src/graph/PrefixMap.ts +77 -77
- package/src/graph/buildUri.tests.ts +116 -116
- package/src/graph/buildUri.ts +45 -45
- package/src/graph/index.ts +2 -2
- package/src/graph/types.ts +3 -3
- package/src/providers/CodaProvider.tests.ts +327 -233
- package/src/providers/CodaProvider.ts +355 -145
- package/src/providers/CodaProvider.types.generated.ts +12484 -12123
- package/src/providers/detectSmartChips.tests.ts +42 -0
- package/src/providers/detectSmartChips.ts +60 -0
- package/src/providers/index.ts +13 -13
- package/src/scripts/checkDataDeletion.ts +68 -0
- package/src/scripts/evaluateDataDeletion.tests.ts +100 -0
- package/src/scripts/evaluateDataDeletion.ts +100 -0
- package/src/serializers/JSONSerializer.tests.ts +64 -64
- package/src/serializers/JSONSerializer.ts +51 -51
- package/src/serializers/TTLSerializer.tests.ts +45 -45
- package/src/serializers/TTLSerializer.ts +64 -57
- package/src/serializers/index.ts +4 -1
- package/src/serializers/types.ts +3 -3
- package/src/sync/constants.ts +52 -0
- package/src/sync/diffRoster.tests.ts +455 -0
- package/src/sync/diffRoster.ts +241 -0
- package/src/sync/loadTargetSpec.tests.ts +208 -0
- package/src/sync/loadTargetSpec.ts +139 -0
- package/src/sync/renderPlan.tests.ts +144 -0
- package/src/sync/renderPlan.ts +88 -0
- package/src/sync/snapshotTable.tests.ts +31 -0
- package/src/sync/snapshotTable.ts +20 -0
- package/src/sync/toLiveEntries.tests.ts +76 -0
- package/src/sync/toLiveEntries.ts +55 -0
- package/src/sync/types.ts +101 -0
- package/src/transform/collectDataMetrics.tests.ts +108 -0
- package/src/transform/collectDataMetrics.ts +114 -0
- package/src/transform/deltaGuards.tests.ts +136 -0
- package/src/transform/deltaGuards.ts +118 -0
- package/src/transform/expectedTables.tests.ts +99 -0
- package/src/transform/expectedTables.ts +34 -0
- package/src/transform/isValidReferenceUri.tests.ts +45 -0
- package/src/transform/isValidReferenceUri.ts +55 -0
- package/src/transform/materializeInverses.tests.ts +81 -0
- package/src/transform/materializeInverses.ts +78 -0
- package/src/transform/resolveReferences.tests.ts +47 -43
- package/src/transform/resolveReferences.ts +18 -18
- package/src/transform/resolveValue.tests.ts +55 -49
- package/src/transform/resolveValue.ts +48 -48
- package/src/transform/transform.tests.ts +126 -91
- package/src/transform/transform.ts +105 -77
- package/src/transform/transformRow.malformedRefs.tests.ts +127 -0
- package/src/transform/transformRow.tests.ts +454 -356
- package/src/transform/transformRow.ts +305 -191
- package/src/transform/types.ts +15 -4
- package/tsconfig.json +2 -1
- package/vitest.config.ts +29 -0
- package/.gemini/settings.json +0 -14
- package/data/apps/pattern/key_value_summary.ttl +0 -7
- package/data/apps_anbox/component/copy_to_clipboard.ttl +0 -7
- package/data/apps_launchpad/component/checkbox.ttl +0 -28
- package/data/apps_launchpad/component/radio.ttl +0 -34
- package/data/apps_launchpad/component/select.ttl +0 -34
- package/data/apps_launchpad/component/textarea.ttl +0 -35
- package/data/apps_launchpad/component/user_avatar.ttl +0 -25
- package/data/apps_lxd/component/copy_to_clipboard.ttl +0 -7
- package/data/apps_workplace/component/label-highlight.ttl +0 -7
- package/data/apps_workplace.ttl +0 -4
- package/data/apps_wpe.ttl +0 -4
- package/data/global/component/code.ttl +0 -7
- package/data/global/component/label.ttl +0 -14
- package/data/global/component/rich_text_editor.ttl +0 -7
- package/data/global/component/search_bar.ttl +0 -7
- package/data/global/component/theme_switcher.ttl +0 -7
- package/data/global/modifier/paper.ttl +0 -6
- package/data/global/pattern/dropdown_button.ttl +0 -7
- package/data/global/subcomponent/divider.ttl +0 -7
- package/data/global_form/component/checkbox_input.ttl +0 -7
- package/data/global_form/component/choices_input.ttl +0 -7
- package/data/global_form/component/combobox_input.ttl +0 -7
- package/data/global_form/component/custom_choices_input.ttl +0 -7
- package/data/global_form/component/datepicker_input.ttl +0 -7
- package/data/global_form/component/rating_input.ttl +0 -7
- package/data/global_form/component/rich_text_input.ttl +0 -7
- package/data/global_form/component/segmented_control_input.ttl +0 -7
- package/data/global_form/component/slider_input.ttl +0 -7
- package/data/global_form/component/switch_input.ttl +0 -7
- package/data/global_form/component/text_input.ttl +0 -7
- package/data/global_form/component/textarea_input.ttl +0 -7
- package/data/global_form/component/wysiwginput.ttl +0 -7
- package/data/global_form/pattern/field.ttl +0 -7
- package/data/global_form/pattern/form.ttl +0 -7
- package/data/global_form/subcomponent/field-description.ttl +0 -7
- package/data/global_form/subcomponent/field-label.ttl +0 -7
- package/data/global_form.ttl +0 -4
- package/data/site/component/blog_card.ttl +0 -7
- package/data/site/component/quote.ttl +0 -7
- package/data/site/component/rule.ttl +0 -7
- package/data/site/component/section.ttl +0 -7
- package/data/site/group/blog_cards.ttl +0 -7
- package/data/site/layout/blog_page_layout.ttl +0 -7
- package/data/site/layout/site_layout.ttl +0 -7
- package/data/site/pattern/hero-github.ttl +0 -7
- package/data/site/pattern/hero.ttl +0 -7
- package/data/site/pattern/info_table.ttl +0 -7
- package/data/site/pattern/pricing_section.ttl +0 -7
- package/data/site/pattern/pricing_table.ttl +0 -7
- package/data/site/pattern/read_more_section.ttl +0 -7
- package/data/site/pattern/skip_link.ttl +0 -7
- package/skills/component-specifier/SKILL.md +0 -409
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: anatomy-author
|
|
3
|
+
description: Write component anatomy specifications using the Design System Anatomy DSL
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# Anatomy Author
|
|
2
7
|
|
|
3
8
|
Write component anatomy specifications using the Design System Anatomy DSL. This skill combines semantic discovery (understanding existing components) with procedural authoring (creating well-formed YAML specifications).
|
|
@@ -9,52 +14,85 @@ Write component anatomy specifications using the Design System Anatomy DSL. This
|
|
|
9
14
|
- Discussing component composition with the team ("these nodes should be siblings, not parent-child")
|
|
10
15
|
- Auditing a codebase against its specifications
|
|
11
16
|
- Supporting code generation from specifications
|
|
17
|
+
- Serving as step 7 of the `specify-component` flow (and of `specify-pattern`)
|
|
12
18
|
|
|
13
19
|
## Description
|
|
14
20
|
|
|
15
21
|
The Anatomy DSL represents design system components as YAML trees with:
|
|
16
|
-
- **Named nodes**: Components with URIs (`
|
|
22
|
+
- **Named nodes**: Components with URIs (`global.component.button`)
|
|
17
23
|
- **Anonymous nodes**: Structural elements with roles (`content wrapper`)
|
|
18
24
|
- **Edges**: Parent-child relationships with cardinality and slot names
|
|
19
25
|
- **Styles**: Platform-agnostic properties using CTI-inspired keys
|
|
20
26
|
|
|
21
27
|
This skill helps you author these specifications correctly and consistently.
|
|
22
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
|
+
|
|
23
34
|
## Discovery Flow
|
|
24
35
|
|
|
25
36
|
Before writing an anatomy, understand the component's context:
|
|
26
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
|
|
27
42
|
```
|
|
28
|
-
1. sem_lookup(type: "ds:Component", filters: {"ds:tier": "ds:global"})
|
|
29
|
-
-> Find existing components in the target tier
|
|
30
43
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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.
|
|
37
52
|
|
|
38
53
|
### Discovery Queries
|
|
39
54
|
|
|
55
|
+
Common prefixes (`ds:`, `cs:`) are applied automatically — no PREFIX preamble needed.
|
|
56
|
+
|
|
40
57
|
**Find components by tier:**
|
|
41
|
-
```
|
|
42
|
-
SELECT ?component ?name WHERE {
|
|
58
|
+
```bash
|
|
59
|
+
pragma graph query "SELECT ?component ?name WHERE {
|
|
43
60
|
?component a ds:Component ;
|
|
44
61
|
ds:name ?name ;
|
|
45
62
|
ds:tier ds:global .
|
|
46
|
-
}
|
|
63
|
+
}"
|
|
47
64
|
```
|
|
48
65
|
|
|
49
66
|
**Find subcomponents of a component:**
|
|
50
|
-
```
|
|
51
|
-
SELECT ?sub ?name WHERE {
|
|
67
|
+
```bash
|
|
68
|
+
pragma graph query "SELECT ?sub ?name WHERE {
|
|
52
69
|
?sub a ds:Subcomponent ;
|
|
53
70
|
ds:name ?name ;
|
|
54
|
-
ds:parentComponent ds
|
|
55
|
-
}
|
|
71
|
+
ds:parentComponent <https://ds.canonical.com/global.component.card> .
|
|
72
|
+
}"
|
|
56
73
|
```
|
|
57
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
|
+
|
|
58
96
|
## DSL Reference
|
|
59
97
|
|
|
60
98
|
### YAML Format
|
|
@@ -96,6 +134,7 @@ Switch
|
|
|
96
134
|
SwitchCase
|
|
97
135
|
-> uri?: string (shorthand)
|
|
98
136
|
-> node?: Node (full form)
|
|
137
|
+
-> default?: boolean (marks the default case)
|
|
99
138
|
|
|
100
139
|
Relation
|
|
101
140
|
-> cardinality: string ("1", "0..1", "0..*", "1..*")
|
|
@@ -109,7 +148,7 @@ URIs follow turtle conventions with dot-separated paths: `tier.type.name`
|
|
|
109
148
|
| Symbol | Meaning | Example |
|
|
110
149
|
|--------|---------|---------|
|
|
111
150
|
| `.` | Path hierarchy | `global.component.button` |
|
|
112
|
-
| `_` | Word boundary from PascalCase | `
|
|
151
|
+
| `_` | Word boundary from PascalCase | `ChartLegend` → `chart_legend` |
|
|
113
152
|
| `-` | Dot in compound names | `Card.Header` → `card-header` |
|
|
114
153
|
|
|
115
154
|
**Examples:**
|
|
@@ -118,17 +157,25 @@ URIs follow turtle conventions with dot-separated paths: `tier.type.name`
|
|
|
118
157
|
|-----------|-----|
|
|
119
158
|
| `Button` | `global.component.button` |
|
|
120
159
|
| `Accordion.Item` | `global.subcomponent.accordion-item` |
|
|
121
|
-
| `
|
|
160
|
+
| `ChartLegend` | `global.subcomponent.chart_legend` |
|
|
161
|
+
| `Card.Header` | `global.subcomponent.card-header` |
|
|
122
162
|
|
|
123
163
|
**Tiers and Types:**
|
|
124
164
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
|
130
|
-
|
|
131
|
-
| `
|
|
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 }"`.)
|
|
132
179
|
|
|
133
180
|
**Parent Reference in Subcomponents:**
|
|
134
181
|
|
|
@@ -136,8 +183,8 @@ Subcomponents must reference their parent in the name:
|
|
|
136
183
|
|
|
137
184
|
| Labelled Name | Turtle URI |
|
|
138
185
|
|---------------|------------|
|
|
139
|
-
| `Timeline.
|
|
140
|
-
| `
|
|
186
|
+
| `Timeline.Event` | `global.subcomponent.timeline-event` |
|
|
187
|
+
| `Timeline.ExpansionIndicator` | `global.subcomponent.timeline-expansion_indicator` |
|
|
141
188
|
|
|
142
189
|
### Named vs Anonymous
|
|
143
190
|
|
|
@@ -150,7 +197,7 @@ Subcomponents must reference their parent in the name:
|
|
|
150
197
|
|
|
151
198
|
### DRY Principle
|
|
152
199
|
|
|
153
|
-
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.
|
|
154
201
|
|
|
155
202
|
```yaml
|
|
156
203
|
# Correct: reference only
|
|
@@ -160,7 +207,7 @@ edges:
|
|
|
160
207
|
relation:
|
|
161
208
|
cardinality: "1"
|
|
162
209
|
|
|
163
|
-
# Incorrect:
|
|
210
|
+
# Incorrect: copying the child's own definition
|
|
164
211
|
edges:
|
|
165
212
|
- node:
|
|
166
213
|
uri: global.component.button
|
|
@@ -168,6 +215,16 @@ edges:
|
|
|
168
215
|
# ... full button styles duplicated here
|
|
169
216
|
relation:
|
|
170
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"
|
|
171
228
|
```
|
|
172
229
|
|
|
173
230
|
### Cardinality Notation
|
|
@@ -178,7 +235,7 @@ edges:
|
|
|
178
235
|
| `"0..1"` | Zero or one (optional) | Card header, Card footer |
|
|
179
236
|
| `"0..*"` | Zero or more | List items |
|
|
180
237
|
| `"1..*"` | One or more | Accordion items (need at least one) |
|
|
181
|
-
| `"2..5"` | Between 2 and 5 |
|
|
238
|
+
| `"2..5"` | Between 2 and 5 | Bounded repeats — live: KeyboardKeys' `"2..*"` (see the Group template below) |
|
|
182
239
|
|
|
183
240
|
### Switch Construct
|
|
184
241
|
|
|
@@ -205,9 +262,13 @@ edges:
|
|
|
205
262
|
| Value | Meaning | Use Case |
|
|
206
263
|
|-------|---------|----------|
|
|
207
264
|
| `props` | Consumer chooses via component props | `<Field type="checkbox">` renders Checkbox vs Radio |
|
|
208
|
-
| `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) |
|
|
209
266
|
| `override` | Consumer can replace with custom component | Timeline accepts custom Event component via slot |
|
|
210
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
|
+
|
|
211
272
|
#### Shorthand Expansion
|
|
212
273
|
|
|
213
274
|
The shorthand `- uri: X` expands to `- node: { uri: X }`. This allows cases to be expressed concisely when no additional metadata is needed:
|
|
@@ -215,12 +276,12 @@ The shorthand `- uri: X` expands to `- node: { uri: X }`. This allows cases to b
|
|
|
215
276
|
```yaml
|
|
216
277
|
# Shorthand (common case)
|
|
217
278
|
cases:
|
|
218
|
-
- uri: global.
|
|
279
|
+
- uri: global.subcomponent.checkbox_input
|
|
219
280
|
|
|
220
281
|
# Expands to full form
|
|
221
282
|
cases:
|
|
222
283
|
- node:
|
|
223
|
-
uri: global.
|
|
284
|
+
uri: global.subcomponent.checkbox_input
|
|
224
285
|
```
|
|
225
286
|
|
|
226
287
|
When a case requires additional properties (styles, nested edges), use the full node form:
|
|
@@ -228,7 +289,7 @@ When a case requires additional properties (styles, nested edges), use the full
|
|
|
228
289
|
```yaml
|
|
229
290
|
cases:
|
|
230
291
|
- node:
|
|
231
|
-
uri: global.
|
|
292
|
+
uri: global.subcomponent.textarea_input
|
|
232
293
|
styles:
|
|
233
294
|
size.height: hug
|
|
234
295
|
size.min.height: size/input/multiline
|
|
@@ -251,33 +312,34 @@ cases:
|
|
|
251
312
|
```yaml
|
|
252
313
|
---
|
|
253
314
|
node:
|
|
254
|
-
uri: global.
|
|
315
|
+
uri: global.pattern.field
|
|
255
316
|
edges:
|
|
256
317
|
- switch:
|
|
257
318
|
on: props
|
|
258
319
|
cases:
|
|
259
|
-
- uri: global.
|
|
260
|
-
- uri: global.
|
|
261
|
-
- uri: global.
|
|
320
|
+
- uri: global.subcomponent.checkbox_input
|
|
321
|
+
- uri: global.subcomponent.radio_input
|
|
322
|
+
- uri: global.subcomponent.text_input
|
|
262
323
|
relation:
|
|
263
324
|
cardinality: "1"
|
|
264
325
|
slotName: input
|
|
265
326
|
```
|
|
266
327
|
|
|
267
|
-
**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):
|
|
268
330
|
|
|
269
331
|
```yaml
|
|
270
332
|
---
|
|
271
333
|
node:
|
|
272
|
-
uri: global.component.
|
|
334
|
+
uri: global.component.async_button
|
|
273
335
|
edges:
|
|
274
336
|
- switch:
|
|
275
337
|
on: internal
|
|
276
338
|
cases:
|
|
277
|
-
- uri: global.subcomponent.
|
|
278
|
-
- uri: global.subcomponent.
|
|
279
|
-
- uri: global.subcomponent.
|
|
280
|
-
- uri: global.subcomponent.
|
|
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
|
|
281
343
|
relation:
|
|
282
344
|
cardinality: "1"
|
|
283
345
|
```
|
|
@@ -287,7 +349,7 @@ node:
|
|
|
287
349
|
```yaml
|
|
288
350
|
---
|
|
289
351
|
node:
|
|
290
|
-
uri: global.
|
|
352
|
+
uri: global.pattern.timeline
|
|
291
353
|
edges:
|
|
292
354
|
- switch:
|
|
293
355
|
on: override
|
|
@@ -385,7 +447,7 @@ object.position: center | top
|
|
|
385
447
|
|
|
386
448
|
```yaml
|
|
387
449
|
node:
|
|
388
|
-
uri: {tier}
|
|
450
|
+
uri: {tier}.component.{name}
|
|
389
451
|
styles:
|
|
390
452
|
# Structural (invariant)
|
|
391
453
|
layout.type: stack
|
|
@@ -397,7 +459,7 @@ node:
|
|
|
397
459
|
|
|
398
460
|
edges:
|
|
399
461
|
- node:
|
|
400
|
-
uri: {tier}
|
|
462
|
+
uri: {tier}.subcomponent.{name}-content
|
|
401
463
|
relation:
|
|
402
464
|
cardinality: "1..1"
|
|
403
465
|
slotName: default
|
|
@@ -407,7 +469,7 @@ node:
|
|
|
407
469
|
|
|
408
470
|
```yaml
|
|
409
471
|
node:
|
|
410
|
-
uri:
|
|
472
|
+
uri: global.component.card
|
|
411
473
|
styles:
|
|
412
474
|
layout.type: stack
|
|
413
475
|
layout.direction: vertical
|
|
@@ -416,31 +478,22 @@ node:
|
|
|
416
478
|
appearance.radius: shape/rounded/full
|
|
417
479
|
|
|
418
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.
|
|
419
483
|
- node:
|
|
420
|
-
uri:
|
|
421
|
-
styles:
|
|
422
|
-
layout.type: flow
|
|
423
|
-
layout.direction: horizontal
|
|
424
|
-
spacing.internal: spacing/medium
|
|
484
|
+
uri: global.subcomponent.card-header
|
|
425
485
|
relation:
|
|
426
486
|
cardinality: "0..1" # optional
|
|
427
487
|
slotName: header
|
|
428
488
|
|
|
429
489
|
- node:
|
|
430
|
-
uri:
|
|
431
|
-
styles:
|
|
432
|
-
layout.type: stack
|
|
433
|
-
spacing.internal: spacing/large
|
|
490
|
+
uri: global.subcomponent.card-content
|
|
434
491
|
relation:
|
|
435
492
|
cardinality: "1..1" # required
|
|
436
|
-
slotName:
|
|
493
|
+
slotName: default
|
|
437
494
|
|
|
438
495
|
- node:
|
|
439
|
-
uri:
|
|
440
|
-
styles:
|
|
441
|
-
layout.type: flow
|
|
442
|
-
layout.justify: space-between
|
|
443
|
-
spacing.internal: spacing/small
|
|
496
|
+
uri: global.subcomponent.card-footer
|
|
444
497
|
relation:
|
|
445
498
|
cardinality: "0..1" # optional
|
|
446
499
|
slotName: footer
|
|
@@ -450,37 +503,86 @@ node:
|
|
|
450
503
|
|
|
451
504
|
```yaml
|
|
452
505
|
node:
|
|
453
|
-
uri:
|
|
506
|
+
uri: global.component.accordion
|
|
454
507
|
styles:
|
|
455
508
|
layout.type: stack
|
|
456
509
|
layout.direction: vertical
|
|
457
510
|
appearance.border: border/style/accordion
|
|
458
511
|
|
|
459
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.
|
|
460
516
|
- node:
|
|
461
|
-
uri:
|
|
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
|
|
462
541
|
edges:
|
|
463
542
|
- node:
|
|
464
|
-
|
|
543
|
+
role: control
|
|
465
544
|
styles:
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
interaction.cursor: pointer
|
|
545
|
+
size.width: size/icon/small
|
|
546
|
+
size.height: size/icon/small
|
|
469
547
|
relation:
|
|
470
|
-
cardinality: "1
|
|
471
|
-
slotName: header
|
|
472
|
-
|
|
548
|
+
cardinality: "1"
|
|
473
549
|
- node:
|
|
474
|
-
|
|
475
|
-
styles:
|
|
476
|
-
layout.overflow: hidden
|
|
477
|
-
spacing.internal: spacing/large
|
|
550
|
+
role: heading
|
|
478
551
|
relation:
|
|
479
|
-
cardinality: "1
|
|
552
|
+
cardinality: "1"
|
|
480
553
|
slotName: default
|
|
554
|
+
relation:
|
|
555
|
+
cardinality: "1"
|
|
556
|
+
slotName: header
|
|
481
557
|
|
|
558
|
+
- node:
|
|
559
|
+
role: content panel
|
|
560
|
+
styles:
|
|
561
|
+
layout.overflow: hidden
|
|
482
562
|
relation:
|
|
483
|
-
cardinality: "1
|
|
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
|
|
484
586
|
```
|
|
485
587
|
|
|
486
588
|
### Anonymous Wrapper Node
|
|
@@ -489,7 +591,7 @@ Use when you need a structural element without design system identity:
|
|
|
489
591
|
|
|
490
592
|
```yaml
|
|
491
593
|
node:
|
|
492
|
-
uri:
|
|
594
|
+
uri: global.pattern.modal
|
|
493
595
|
styles:
|
|
494
596
|
layout.type: stack
|
|
495
597
|
appearance.background: color/surface/modal
|
|
@@ -512,24 +614,28 @@ node:
|
|
|
512
614
|
spacing.internal: spacing/large
|
|
513
615
|
edges:
|
|
514
616
|
- node:
|
|
515
|
-
uri:
|
|
617
|
+
uri: global.subcomponent.modal-header
|
|
516
618
|
relation:
|
|
517
619
|
cardinality: "0..1"
|
|
518
620
|
slotName: header
|
|
519
621
|
- node:
|
|
520
|
-
uri:
|
|
622
|
+
uri: global.subcomponent.modal-content
|
|
521
623
|
relation:
|
|
522
624
|
cardinality: "1..1"
|
|
523
|
-
slotName:
|
|
625
|
+
slotName: default
|
|
524
626
|
relation:
|
|
525
627
|
cardinality: "1..1"
|
|
526
628
|
```
|
|
527
629
|
|
|
528
630
|
### Simple Button Example
|
|
529
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
|
+
|
|
530
636
|
```yaml
|
|
531
637
|
node:
|
|
532
|
-
uri:
|
|
638
|
+
uri: global.component.button
|
|
533
639
|
styles:
|
|
534
640
|
# Structural
|
|
535
641
|
layout.type: flow
|
|
@@ -551,7 +657,7 @@ node:
|
|
|
551
657
|
|
|
552
658
|
edges:
|
|
553
659
|
- node:
|
|
554
|
-
|
|
660
|
+
role: icon
|
|
555
661
|
styles:
|
|
556
662
|
size.width: size/icon/small
|
|
557
663
|
size.height: size/icon/small
|
|
@@ -560,30 +666,58 @@ node:
|
|
|
560
666
|
slotName: icon
|
|
561
667
|
|
|
562
668
|
- node:
|
|
563
|
-
|
|
669
|
+
role: label
|
|
564
670
|
styles:
|
|
565
671
|
typography.size: font/size/button
|
|
566
672
|
typography.color: color/text/on-action
|
|
567
673
|
relation:
|
|
568
|
-
cardinality: "
|
|
569
|
-
slotName:
|
|
674
|
+
cardinality: "0..1"
|
|
675
|
+
slotName: default
|
|
570
676
|
```
|
|
571
677
|
|
|
572
678
|
## Workflow
|
|
573
679
|
|
|
574
680
|
### 1. Identify the Component
|
|
575
681
|
|
|
576
|
-
First,
|
|
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):
|
|
577
688
|
|
|
578
|
-
```
|
|
579
|
-
|
|
689
|
+
```bash
|
|
690
|
+
pragma graph query "SELECT ?b ?name WHERE { ?b a ds:Group ; ds:name ?name }"
|
|
580
691
|
```
|
|
581
692
|
|
|
582
|
-
If
|
|
583
|
-
|
|
584
|
-
|
|
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
|
|
585
701
|
```
|
|
586
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
|
+
|
|
587
721
|
### 2. Gather Structural Requirements
|
|
588
722
|
|
|
589
723
|
Ask:
|
|
@@ -594,13 +728,19 @@ Ask:
|
|
|
594
728
|
|
|
595
729
|
### 3. Determine Tier and Type
|
|
596
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
|
+
|
|
597
736
|
| Question | Answer | Result |
|
|
598
737
|
|----------|--------|--------|
|
|
599
|
-
| Is it universal? | Yes | `
|
|
600
|
-
| Is it app-specific? | Yes | `
|
|
601
|
-
| Is it a subpart? | Yes | `{tier}
|
|
602
|
-
| Is it a UX solution? | Yes | `{tier}
|
|
603
|
-
| Does it divide space? | Yes | `{tier}
|
|
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}` |
|
|
604
744
|
|
|
605
745
|
### 4. Define Edges
|
|
606
746
|
|
|
@@ -631,6 +771,9 @@ Check your anatomy against:
|
|
|
631
771
|
- [ ] Style keys follow CTI convention
|
|
632
772
|
- [ ] Token paths use `/` delimiter
|
|
633
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
|
|
634
777
|
- [ ] Nested components make semantic sense
|
|
635
778
|
|
|
636
779
|
## Response Format
|
|
@@ -640,7 +783,7 @@ When creating an anatomy, respond with:
|
|
|
640
783
|
```markdown
|
|
641
784
|
## Anatomy: {ComponentName}
|
|
642
785
|
|
|
643
|
-
**URI:** `{tier}
|
|
786
|
+
**URI:** `{tier}.{type}.{snake_name}`
|
|
644
787
|
**Tier:** {tier} - {rationale}
|
|
645
788
|
|
|
646
789
|
### Structure Overview
|
|
@@ -659,9 +802,9 @@ When creating an anatomy, respond with:
|
|
|
659
802
|
- {Design decision 2}
|
|
660
803
|
|
|
661
804
|
### Next Steps
|
|
662
|
-
1.
|
|
663
|
-
|
|
664
|
-
|
|
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
|
|
665
808
|
```
|
|
666
809
|
|
|
667
810
|
## Tips
|
|
@@ -669,6 +812,7 @@ When creating an anatomy, respond with:
|
|
|
669
812
|
1. **Start simple**: Begin with just structure, add styles incrementally
|
|
670
813
|
2. **Use discovery**: Query existing components for patterns and consistency
|
|
671
814
|
3. **Name thoughtfully**: URIs are identifiers - choose clear, consistent names
|
|
815
|
+
(see the URI Encoding Convention table above)
|
|
672
816
|
4. **Annotate decisions**: Use YAML comments for non-obvious choices
|
|
673
817
|
5. **Validate cardinality**: Think through edge cases (empty states, maximums)
|
|
674
818
|
6. **Separate concerns**: Structural styles vs themeable styles
|
|
@@ -715,7 +859,7 @@ This specification presents a DSL to represent design system anatomies, providin
|
|
|
715
859
|
- The children of a node MUST be modelled through a reified relation for annotation purposes
|
|
716
860
|
- The DSL MUST support anonymous nodes (nodes that are not named components). In this case, the DSL should support role annotations
|
|
717
861
|
- The DSL MUST support reified annotations of cardinality
|
|
718
|
-
- 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)
|
|
719
863
|
|
|
720
864
|
### Type System
|
|
721
865
|
|
|
@@ -738,7 +882,7 @@ The children one-to-many relation follows inspiration from the [Relay connection
|
|
|
738
882
|
* - Invariant (structural): layout.type, layout.direction, size.width: "fill"
|
|
739
883
|
* - Themeable (brand/theme): appearance.*, spacing.* (when using tokens)
|
|
740
884
|
*/
|
|
741
|
-
type Styles = Record<string, TokenPath | PrimitiveValue>;
|
|
885
|
+
type Styles = Record<string, TokenPath | TokenPath[] | PrimitiveValue>;
|
|
742
886
|
|
|
743
887
|
/**
|
|
744
888
|
* TokenPath: Forward-slash delimited path to a design token.
|
|
@@ -799,8 +943,8 @@ interface BaseNode {
|
|
|
799
943
|
*/
|
|
800
944
|
interface NamedNode extends BaseNode {
|
|
801
945
|
/**
|
|
802
|
-
* Unique identifier following "tier
|
|
803
|
-
* Examples: "
|
|
946
|
+
* Unique identifier following "tier.type.name" pattern.
|
|
947
|
+
* Examples: "global.component.button", "apps.layout.application_layout"
|
|
804
948
|
*/
|
|
805
949
|
uri: string;
|
|
806
950
|
}
|
|
@@ -818,8 +962,39 @@ interface AnonymousNode extends BaseNode {
|
|
|
818
962
|
|
|
819
963
|
type Node = NamedNode | AnonymousNode;
|
|
820
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
|
+
|
|
821
991
|
interface Edge {
|
|
822
|
-
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
|
+
|
|
823
998
|
relation: Relation;
|
|
824
999
|
}
|
|
825
1000
|
|
|
@@ -848,7 +1023,7 @@ Alternatives considered and rejected:
|
|
|
848
1023
|
|
|
849
1024
|
```yaml
|
|
850
1025
|
node:
|
|
851
|
-
uri:
|
|
1026
|
+
uri: global.component.accordion
|
|
852
1027
|
styles:
|
|
853
1028
|
# Structural (invariant)
|
|
854
1029
|
layout.type: stack
|
|
@@ -858,49 +1033,56 @@ node:
|
|
|
858
1033
|
appearance.border: border/style/accordion
|
|
859
1034
|
|
|
860
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.
|
|
861
1038
|
- node:
|
|
862
|
-
uri:
|
|
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
|
|
863
1062
|
edges:
|
|
864
1063
|
- node:
|
|
865
|
-
|
|
1064
|
+
role: control
|
|
866
1065
|
styles:
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
layout.direction: horizontal
|
|
870
|
-
layout.align: center
|
|
871
|
-
|
|
872
|
-
# Interaction (invariant)
|
|
873
|
-
interaction.cursor: pointer
|
|
874
|
-
interaction.transition.property: background
|
|
875
|
-
interaction.transition.timing: ease
|
|
876
|
-
|
|
877
|
-
# Themeable
|
|
878
|
-
spacing.internal: spacing/medium
|
|
879
|
-
appearance.background: color/surface/header
|
|
880
|
-
typography.weight: font/weight/semibold
|
|
881
|
-
interaction.transition.duration: transition/duration
|
|
882
|
-
|
|
1066
|
+
size.width: size/icon/small
|
|
1067
|
+
size.height: size/icon/small
|
|
883
1068
|
relation:
|
|
884
|
-
cardinality: "1
|
|
885
|
-
slotName: header
|
|
886
|
-
|
|
1069
|
+
cardinality: "1"
|
|
887
1070
|
- node:
|
|
888
|
-
|
|
889
|
-
styles:
|
|
890
|
-
# Structural (invariant)
|
|
891
|
-
layout.display: block
|
|
892
|
-
layout.overflow: hidden
|
|
893
|
-
|
|
894
|
-
# Themeable
|
|
895
|
-
spacing.internal: spacing/large
|
|
896
|
-
appearance.background: color/surface/content
|
|
897
|
-
|
|
1071
|
+
role: heading
|
|
898
1072
|
relation:
|
|
899
|
-
cardinality: "1
|
|
1073
|
+
cardinality: "1"
|
|
900
1074
|
slotName: default
|
|
1075
|
+
relation:
|
|
1076
|
+
cardinality: "1"
|
|
1077
|
+
slotName: header
|
|
901
1078
|
|
|
1079
|
+
- node:
|
|
1080
|
+
role: content panel
|
|
1081
|
+
styles:
|
|
1082
|
+
layout.overflow: hidden
|
|
902
1083
|
relation:
|
|
903
|
-
cardinality: "1
|
|
1084
|
+
cardinality: "1"
|
|
1085
|
+
slotName: default
|
|
904
1086
|
```
|
|
905
1087
|
|
|
906
1088
|
### Future Work
|