@canonical/design-system 0.1.2 → 0.2.1
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 +15 -6
- package/.github/workflows/ci.yml +14 -4
- 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/README.md +132 -79
- package/bun.lock +51 -12
- 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 -9
- package/data/apps_launchpad/component/breadcrumbs.ttl +5 -2
- package/data/apps_launchpad/component/button.ttl +11 -9
- 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 -11
- 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 -9
- package/data/apps_launchpad/component/textarea_input.ttl +39 -0
- package/data/apps_launchpad/component/tooltip.ttl +12 -8
- 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 -8
- 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 +5 -1
- 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 +75 -56
- 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 +33 -2
- 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 +133 -14
- package/examples/form-roster.target.json +550 -0
- package/package.json +5 -2
- package/skills/adoption-a1-styles/SKILL.md +159 -0
- package/skills/adoption-a2-components/SKILL.md +186 -0
- package/skills/adoption-a3-forms/SKILL.md +155 -0
- package/skills/anatomy-author/ANATOMY_DSL_SPEC.md +89 -106
- package/skills/anatomy-author/SKILL.md +350 -141
- package/skills/design-auditor/SKILL.md +197 -274
- package/skills/implement-component/SKILL.md +244 -0
- package/skills/specify-component/SKILL.md +232 -0
- package/skills/specify-pattern/SKILL.md +192 -0
- package/source.json +64 -2
- package/specs/README.md +17 -0
- package/src/cli.ts +23 -10
- package/src/commands/index.ts +1 -0
- package/src/commands/sync.tests.ts +430 -0
- package/src/commands/sync.ts +418 -0
- package/src/commands/transform.tests.ts +190 -5
- package/src/commands/transform.ts +163 -67
- package/src/constants.ts +1 -0
- package/src/providers/CodaProvider.tests.ts +94 -0
- package/src/providers/CodaProvider.ts +211 -1
- package/src/providers/detectSmartChips.tests.ts +42 -0
- package/src/providers/detectSmartChips.ts +60 -0
- package/src/scripts/checkDataDeletion.ts +68 -0
- package/src/scripts/evaluateDataDeletion.tests.ts +100 -0
- package/src/scripts/evaluateDataDeletion.ts +100 -0
- 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/transform.tests.ts +22 -0
- package/src/transform/transform.ts +31 -3
- package/src/transform/transformRow.malformedRefs.tests.ts +127 -0
- package/src/transform/transformRow.tests.ts +82 -0
- package/src/transform/transformRow.ts +90 -7
- package/src/transform/types.ts +11 -0
- package/vitest.config.ts +29 -0
- 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 -412
|
@@ -14,52 +14,106 @@ 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 (`
|
|
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
|
+
## Working mode: assistant to a design authority
|
|
30
|
+
|
|
31
|
+
Most of the time this skill runs in collaboration with a senior designer or engineer —
|
|
32
|
+
they are the design authority, you are the assistant whose job is to make them
|
|
33
|
+
successful. Default to that mode: lay out where the flow stands, do the legwork
|
|
34
|
+
(discovery queries, template drafting, validation) and return digestible findings, and
|
|
35
|
+
bring structural decisions to the person as a recommendation plus a question rather
|
|
36
|
+
than a fait accompli. An anatomy encodes opinions the graph cannot settle alone —
|
|
37
|
+
draw the person's knowledge out and use it.
|
|
38
|
+
|
|
39
|
+
Full autonomy is the exception, not the default: run the whole flow alone only when
|
|
40
|
+
explicitly asked to. Even then, list every judgment call made unilaterally in the
|
|
41
|
+
final report so a human can revisit them.
|
|
42
|
+
|
|
43
|
+
Decision gates — in collaboration, pause at each and resolve it WITH the person:
|
|
44
|
+
|
|
45
|
+
1. Node boundaries: what is a named subcomponent vs. an anonymous structural role.
|
|
46
|
+
2. Slot names — they become API surface.
|
|
47
|
+
3. Cardinality choices, especially optional vs. required parts.
|
|
48
|
+
4. What the anatomy fixes vs. what is deliberately left free.
|
|
49
|
+
|
|
50
|
+
The full specification ships beside this file as `ANATOMY_DSL_SPEC.md` in the
|
|
51
|
+
installed skill folder — `pragma skill lookup anatomy-author` renders only this
|
|
52
|
+
SKILL.md, so open the sibling file directly when you need the complete spec (the
|
|
53
|
+
appendix below carries its type system).
|
|
54
|
+
|
|
28
55
|
## Discovery Flow
|
|
29
56
|
|
|
30
57
|
Before writing an anatomy, understand the component's context:
|
|
31
58
|
|
|
59
|
+
```bash
|
|
60
|
+
pragma block list # every component, pattern, layout and subcomponent, with its type and tier
|
|
61
|
+
pragma block lookup Card # full spec: anatomy, modifiers, properties (MCP: block_lookup)
|
|
62
|
+
pragma graph inspect ds:global.component.card # every triple on the entity
|
|
32
63
|
```
|
|
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
64
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
65
|
+
A bare name can match blocks in several tiers, and `block lookup` silently picks one —
|
|
66
|
+
it resolves `ds:name` globally and cannot be steered to a tier.
|
|
67
|
+
Confirm the tier the lookup picked from its own `- Tier:` line; the name query below lists every tier that carries the name.
|
|
68
|
+
The name query in Workflow §1 is the one that lists them, with each block's IRI. If the
|
|
69
|
+
lookup picked the wrong tier's block, read the block you want with
|
|
70
|
+
`pragma graph inspect <IRI from that row>`, so the lookup step and the inspect step
|
|
71
|
+
describe the same block. If the name has no row at all, the block may be a Group —
|
|
72
|
+
`block list` covers no groups; the group pre-step in Workflow §1 lists them.
|
|
42
73
|
|
|
43
74
|
### Discovery Queries
|
|
44
75
|
|
|
76
|
+
Common prefixes (`ds:`, `cs:`) are applied automatically — no PREFIX preamble needed.
|
|
77
|
+
|
|
45
78
|
**Find components by tier:**
|
|
46
|
-
```
|
|
47
|
-
SELECT ?component ?name WHERE {
|
|
79
|
+
```bash
|
|
80
|
+
pragma graph query "SELECT ?component ?name WHERE {
|
|
48
81
|
?component a ds:Component ;
|
|
49
82
|
ds:name ?name ;
|
|
50
83
|
ds:tier ds:global .
|
|
51
|
-
}
|
|
84
|
+
}"
|
|
52
85
|
```
|
|
53
86
|
|
|
54
87
|
**Find subcomponents of a component:**
|
|
55
|
-
```
|
|
56
|
-
SELECT ?sub ?name WHERE {
|
|
88
|
+
```bash
|
|
89
|
+
pragma graph query "SELECT ?sub ?name WHERE {
|
|
57
90
|
?sub a ds:Subcomponent ;
|
|
58
91
|
ds:name ?name ;
|
|
59
|
-
ds:parentComponent ds
|
|
60
|
-
}
|
|
92
|
+
ds:parentComponent <https://ds.canonical.com/global.component.card> .
|
|
93
|
+
}"
|
|
61
94
|
```
|
|
62
95
|
|
|
96
|
+
Inside a SPARQL body, a local name with MORE THAN ONE dot (`ds:global.component.card`)
|
|
97
|
+
does not parse — use the full IRI there: join `https://ds.canonical.com/` with the
|
|
98
|
+
dotted local name (giving `<https://ds.canonical.com/global.component.card>`), or copy
|
|
99
|
+
one from `pragma graph query` output, which prints absolute IRIs. Prefixed names with
|
|
100
|
+
no dot (`ds:global`, `ds:Component`) or a single dot (`ds:tag.needsdefinition`) work
|
|
101
|
+
as-is.
|
|
102
|
+
|
|
103
|
+
### The empty-anatomy worklist
|
|
104
|
+
|
|
105
|
+
The Coda sync emits `ds:anatomyDsl` as an empty string for blocks whose anatomy is not
|
|
106
|
+
yet written — this query IS the to-do list; pick from it, never from a copied table:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
pragma graph query "SELECT ?b ?name WHERE { ?b ds:anatomyDsl ?a ; ds:name ?name . FILTER(STR(?a) = '') }"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
The worklist rows point at blocks whose data lives under `data/` — never hand-edit
|
|
113
|
+
that tree: it is regenerated destructively from Coda by CI, and hand edits are
|
|
114
|
+
overwritten by the next sync. An authored DSL lands in the block's spec draft under
|
|
115
|
+
`specs/` (see `specs/README.md`) or is pasted into Coda by a human.
|
|
116
|
+
|
|
63
117
|
## DSL Reference
|
|
64
118
|
|
|
65
119
|
### YAML Format
|
|
@@ -101,6 +155,7 @@ Switch
|
|
|
101
155
|
SwitchCase
|
|
102
156
|
-> uri?: string (shorthand)
|
|
103
157
|
-> node?: Node (full form)
|
|
158
|
+
-> default?: boolean (marks the default case)
|
|
104
159
|
|
|
105
160
|
Relation
|
|
106
161
|
-> cardinality: string ("1", "0..1", "0..*", "1..*")
|
|
@@ -114,7 +169,7 @@ URIs follow turtle conventions with dot-separated paths: `tier.type.name`
|
|
|
114
169
|
| Symbol | Meaning | Example |
|
|
115
170
|
|--------|---------|---------|
|
|
116
171
|
| `.` | Path hierarchy | `global.component.button` |
|
|
117
|
-
| `_` | Word boundary from PascalCase | `
|
|
172
|
+
| `_` | Word boundary from PascalCase | `ChartLegend` → `chart_legend` |
|
|
118
173
|
| `-` | Dot in compound names | `Card.Header` → `card-header` |
|
|
119
174
|
|
|
120
175
|
**Examples:**
|
|
@@ -123,17 +178,25 @@ URIs follow turtle conventions with dot-separated paths: `tier.type.name`
|
|
|
123
178
|
|-----------|-----|
|
|
124
179
|
| `Button` | `global.component.button` |
|
|
125
180
|
| `Accordion.Item` | `global.subcomponent.accordion-item` |
|
|
126
|
-
| `
|
|
181
|
+
| `ChartLegend` | `global.subcomponent.chart_legend` |
|
|
182
|
+
| `Card.Header` | `global.subcomponent.card-header` |
|
|
127
183
|
|
|
128
184
|
**Tiers and Types:**
|
|
129
185
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
|
135
|
-
|
|
136
|
-
| `
|
|
186
|
+
The tier segment comes from the live tier set — run `pragma tier list` for the tiers
|
|
187
|
+
that exist today; never assign a tier from a remembered list. The type segment is one
|
|
188
|
+
of the ontology's UIBlock classes:
|
|
189
|
+
|
|
190
|
+
| Type | Use Case |
|
|
191
|
+
|------|----------|
|
|
192
|
+
| `component` | Standalone components |
|
|
193
|
+
| `subcomponent` | Parts of components (user-instantiable) |
|
|
194
|
+
| `pattern` | UX solutions combining components |
|
|
195
|
+
| `layout` | Space-dividing containers |
|
|
196
|
+
| `group` | Repeating series of ONE sibling block (the plural of a Component) |
|
|
197
|
+
|
|
198
|
+
(`pragma block list` omits groups — read them from the graph:
|
|
199
|
+
`pragma graph query "SELECT ?b ?name WHERE { ?b a ds:Group ; ds:name ?name }"`.)
|
|
137
200
|
|
|
138
201
|
**Parent Reference in Subcomponents:**
|
|
139
202
|
|
|
@@ -141,8 +204,8 @@ Subcomponents must reference their parent in the name:
|
|
|
141
204
|
|
|
142
205
|
| Labelled Name | Turtle URI |
|
|
143
206
|
|---------------|------------|
|
|
144
|
-
| `Timeline.
|
|
145
|
-
| `
|
|
207
|
+
| `Timeline.Event` | `global.subcomponent.timeline-event` |
|
|
208
|
+
| `Timeline.ExpansionIndicator` | `global.subcomponent.timeline-expansion_indicator` |
|
|
146
209
|
|
|
147
210
|
### Named vs Anonymous
|
|
148
211
|
|
|
@@ -155,7 +218,7 @@ Subcomponents must reference their parent in the name:
|
|
|
155
218
|
|
|
156
219
|
### DRY Principle
|
|
157
220
|
|
|
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.
|
|
221
|
+
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
222
|
|
|
160
223
|
```yaml
|
|
161
224
|
# Correct: reference only
|
|
@@ -165,7 +228,7 @@ edges:
|
|
|
165
228
|
relation:
|
|
166
229
|
cardinality: "1"
|
|
167
230
|
|
|
168
|
-
# Incorrect:
|
|
231
|
+
# Incorrect: copying the child's own definition
|
|
169
232
|
edges:
|
|
170
233
|
- node:
|
|
171
234
|
uri: global.component.button
|
|
@@ -173,6 +236,16 @@ edges:
|
|
|
173
236
|
# ... full button styles duplicated here
|
|
174
237
|
relation:
|
|
175
238
|
cardinality: "1"
|
|
239
|
+
|
|
240
|
+
# Permitted: contextual style overrides (the live password_constraints → icon pair)
|
|
241
|
+
edges:
|
|
242
|
+
- node:
|
|
243
|
+
uri: global.component.icon
|
|
244
|
+
styles:
|
|
245
|
+
size.width: size/icon/small
|
|
246
|
+
size.height: size/icon/small
|
|
247
|
+
relation:
|
|
248
|
+
cardinality: "1"
|
|
176
249
|
```
|
|
177
250
|
|
|
178
251
|
### Cardinality Notation
|
|
@@ -183,7 +256,7 @@ edges:
|
|
|
183
256
|
| `"0..1"` | Zero or one (optional) | Card header, Card footer |
|
|
184
257
|
| `"0..*"` | Zero or more | List items |
|
|
185
258
|
| `"1..*"` | One or more | Accordion items (need at least one) |
|
|
186
|
-
| `"2..5"` | Between 2 and 5 |
|
|
259
|
+
| `"2..5"` | Between 2 and 5 | Bounded repeats — live: KeyboardKeys' `"2..*"` (see the Group template below) |
|
|
187
260
|
|
|
188
261
|
### Switch Construct
|
|
189
262
|
|
|
@@ -210,9 +283,13 @@ edges:
|
|
|
210
283
|
| Value | Meaning | Use Case |
|
|
211
284
|
|-------|---------|----------|
|
|
212
285
|
| `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 |
|
|
286
|
+
| `internal` | Component manages choice internally | AsyncButton shows Loading/Success/Error based on state (hypothetical — see the labelled example below) |
|
|
214
287
|
| `override` | Consumer can replace with custom component | Timeline accepts custom Event component via slot |
|
|
215
288
|
|
|
289
|
+
This enum is NORMATIVE. Live anatomies that predate it may carry qualified
|
|
290
|
+
discriminators (`props/<prop>`) or a `with:` map in exploratory drafts — do not
|
|
291
|
+
copy those into new anatomies.
|
|
292
|
+
|
|
216
293
|
#### Shorthand Expansion
|
|
217
294
|
|
|
218
295
|
The shorthand `- uri: X` expands to `- node: { uri: X }`. This allows cases to be expressed concisely when no additional metadata is needed:
|
|
@@ -220,12 +297,12 @@ The shorthand `- uri: X` expands to `- node: { uri: X }`. This allows cases to b
|
|
|
220
297
|
```yaml
|
|
221
298
|
# Shorthand (common case)
|
|
222
299
|
cases:
|
|
223
|
-
- uri: global.
|
|
300
|
+
- uri: global.subcomponent.checkbox_input
|
|
224
301
|
|
|
225
302
|
# Expands to full form
|
|
226
303
|
cases:
|
|
227
304
|
- node:
|
|
228
|
-
uri: global.
|
|
305
|
+
uri: global.subcomponent.checkbox_input
|
|
229
306
|
```
|
|
230
307
|
|
|
231
308
|
When a case requires additional properties (styles, nested edges), use the full node form:
|
|
@@ -233,7 +310,7 @@ When a case requires additional properties (styles, nested edges), use the full
|
|
|
233
310
|
```yaml
|
|
234
311
|
cases:
|
|
235
312
|
- node:
|
|
236
|
-
uri: global.
|
|
313
|
+
uri: global.subcomponent.textarea_input
|
|
237
314
|
styles:
|
|
238
315
|
size.height: hug
|
|
239
316
|
size.min.height: size/input/multiline
|
|
@@ -256,33 +333,34 @@ cases:
|
|
|
256
333
|
```yaml
|
|
257
334
|
---
|
|
258
335
|
node:
|
|
259
|
-
uri: global.
|
|
336
|
+
uri: global.pattern.field
|
|
260
337
|
edges:
|
|
261
338
|
- switch:
|
|
262
339
|
on: props
|
|
263
340
|
cases:
|
|
264
|
-
- uri: global.
|
|
265
|
-
- uri: global.
|
|
266
|
-
- uri: global.
|
|
341
|
+
- uri: global.subcomponent.checkbox_input
|
|
342
|
+
- uri: global.subcomponent.radio_input
|
|
343
|
+
- uri: global.subcomponent.text_input
|
|
267
344
|
relation:
|
|
268
345
|
cardinality: "1"
|
|
269
346
|
slotName: input
|
|
270
347
|
```
|
|
271
348
|
|
|
272
|
-
**Async button with internal state switch
|
|
349
|
+
**Async button with internal state switch** (the `async_button` family is hypothetical —
|
|
350
|
+
an illustration of the `internal` discriminator, not a live block):
|
|
273
351
|
|
|
274
352
|
```yaml
|
|
275
353
|
---
|
|
276
354
|
node:
|
|
277
|
-
uri: global.component.
|
|
355
|
+
uri: global.component.async_button
|
|
278
356
|
edges:
|
|
279
357
|
- switch:
|
|
280
358
|
on: internal
|
|
281
359
|
cases:
|
|
282
|
-
- uri: global.subcomponent.
|
|
283
|
-
- uri: global.subcomponent.
|
|
284
|
-
- uri: global.subcomponent.
|
|
285
|
-
- uri: global.subcomponent.
|
|
360
|
+
- uri: global.subcomponent.async_button-idle
|
|
361
|
+
- uri: global.subcomponent.async_button-loading
|
|
362
|
+
- uri: global.subcomponent.async_button-success
|
|
363
|
+
- uri: global.subcomponent.async_button-error
|
|
286
364
|
relation:
|
|
287
365
|
cardinality: "1"
|
|
288
366
|
```
|
|
@@ -292,7 +370,7 @@ node:
|
|
|
292
370
|
```yaml
|
|
293
371
|
---
|
|
294
372
|
node:
|
|
295
|
-
uri: global.
|
|
373
|
+
uri: global.pattern.timeline
|
|
296
374
|
edges:
|
|
297
375
|
- switch:
|
|
298
376
|
on: override
|
|
@@ -390,7 +468,7 @@ object.position: center | top
|
|
|
390
468
|
|
|
391
469
|
```yaml
|
|
392
470
|
node:
|
|
393
|
-
uri: {tier}
|
|
471
|
+
uri: {tier}.component.{name}
|
|
394
472
|
styles:
|
|
395
473
|
# Structural (invariant)
|
|
396
474
|
layout.type: stack
|
|
@@ -402,7 +480,7 @@ node:
|
|
|
402
480
|
|
|
403
481
|
edges:
|
|
404
482
|
- node:
|
|
405
|
-
uri: {tier}
|
|
483
|
+
uri: {tier}.subcomponent.{name}-content
|
|
406
484
|
relation:
|
|
407
485
|
cardinality: "1..1"
|
|
408
486
|
slotName: default
|
|
@@ -412,7 +490,7 @@ node:
|
|
|
412
490
|
|
|
413
491
|
```yaml
|
|
414
492
|
node:
|
|
415
|
-
uri:
|
|
493
|
+
uri: global.component.card
|
|
416
494
|
styles:
|
|
417
495
|
layout.type: stack
|
|
418
496
|
layout.direction: vertical
|
|
@@ -421,31 +499,22 @@ node:
|
|
|
421
499
|
appearance.radius: shape/rounded/full
|
|
422
500
|
|
|
423
501
|
edges:
|
|
502
|
+
# Named children reference their URI only (DRY Principle above) — each
|
|
503
|
+
# carries its own styles in its own anatomy; the live Card does the same.
|
|
424
504
|
- node:
|
|
425
|
-
uri:
|
|
426
|
-
styles:
|
|
427
|
-
layout.type: flow
|
|
428
|
-
layout.direction: horizontal
|
|
429
|
-
spacing.internal: spacing/medium
|
|
505
|
+
uri: global.subcomponent.card-header
|
|
430
506
|
relation:
|
|
431
507
|
cardinality: "0..1" # optional
|
|
432
508
|
slotName: header
|
|
433
509
|
|
|
434
510
|
- node:
|
|
435
|
-
uri:
|
|
436
|
-
styles:
|
|
437
|
-
layout.type: stack
|
|
438
|
-
spacing.internal: spacing/large
|
|
511
|
+
uri: global.subcomponent.card-content
|
|
439
512
|
relation:
|
|
440
513
|
cardinality: "1..1" # required
|
|
441
|
-
slotName:
|
|
514
|
+
slotName: default
|
|
442
515
|
|
|
443
516
|
- node:
|
|
444
|
-
uri:
|
|
445
|
-
styles:
|
|
446
|
-
layout.type: flow
|
|
447
|
-
layout.justify: space-between
|
|
448
|
-
spacing.internal: spacing/small
|
|
517
|
+
uri: global.subcomponent.card-footer
|
|
449
518
|
relation:
|
|
450
519
|
cardinality: "0..1" # optional
|
|
451
520
|
slotName: footer
|
|
@@ -455,37 +524,86 @@ node:
|
|
|
455
524
|
|
|
456
525
|
```yaml
|
|
457
526
|
node:
|
|
458
|
-
uri:
|
|
527
|
+
uri: global.component.accordion
|
|
459
528
|
styles:
|
|
460
529
|
layout.type: stack
|
|
461
530
|
layout.direction: vertical
|
|
462
531
|
appearance.border: border/style/accordion
|
|
463
532
|
|
|
464
533
|
edges:
|
|
534
|
+
# The repeating child is NAMED — reference its URI only (DRY Principle
|
|
535
|
+
# above); its subtree lives in its own anatomy. The live Accordion does
|
|
536
|
+
# the same.
|
|
465
537
|
- node:
|
|
466
|
-
uri:
|
|
538
|
+
uri: global.subcomponent.accordion-item
|
|
539
|
+
relation:
|
|
540
|
+
cardinality: "1..*" # one or more items
|
|
541
|
+
slotName: default
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
The child's own anatomy — a separate spec on `global.subcomponent.accordion-item`
|
|
545
|
+
(transcribed from the live block) — is where the subtree lives; its parts are
|
|
546
|
+
anonymous roles:
|
|
547
|
+
|
|
548
|
+
```yaml
|
|
549
|
+
node:
|
|
550
|
+
uri: global.subcomponent.accordion-item
|
|
551
|
+
styles:
|
|
552
|
+
layout.type: stack
|
|
553
|
+
layout.direction: vertical
|
|
554
|
+
edges:
|
|
555
|
+
- node:
|
|
556
|
+
role: header tab
|
|
557
|
+
styles:
|
|
558
|
+
layout.type: flow
|
|
559
|
+
layout.direction: horizontal
|
|
560
|
+
layout.align: center
|
|
561
|
+
interaction.cursor: pointer
|
|
467
562
|
edges:
|
|
468
563
|
- node:
|
|
469
|
-
|
|
564
|
+
role: control
|
|
470
565
|
styles:
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
interaction.cursor: pointer
|
|
566
|
+
size.width: size/icon/small
|
|
567
|
+
size.height: size/icon/small
|
|
474
568
|
relation:
|
|
475
|
-
cardinality: "1
|
|
476
|
-
slotName: header
|
|
477
|
-
|
|
569
|
+
cardinality: "1"
|
|
478
570
|
- node:
|
|
479
|
-
|
|
480
|
-
styles:
|
|
481
|
-
layout.overflow: hidden
|
|
482
|
-
spacing.internal: spacing/large
|
|
571
|
+
role: heading
|
|
483
572
|
relation:
|
|
484
|
-
cardinality: "1
|
|
573
|
+
cardinality: "1"
|
|
485
574
|
slotName: default
|
|
575
|
+
relation:
|
|
576
|
+
cardinality: "1"
|
|
577
|
+
slotName: header
|
|
486
578
|
|
|
579
|
+
- node:
|
|
580
|
+
role: content panel
|
|
581
|
+
styles:
|
|
582
|
+
layout.overflow: hidden
|
|
487
583
|
relation:
|
|
488
|
-
cardinality: "1
|
|
584
|
+
cardinality: "1"
|
|
585
|
+
slotName: default
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
### Group (repeating siblings)
|
|
589
|
+
|
|
590
|
+
A Group is the plural of ONE sibling block: a named root carrying only layout and
|
|
591
|
+
spacing styles, and a single URI-only edge whose cardinality bounds the repetition.
|
|
592
|
+
Transcribed from the live `global.group.keyboard_keys`:
|
|
593
|
+
|
|
594
|
+
```yaml
|
|
595
|
+
node:
|
|
596
|
+
uri: global.group.keyboard_keys
|
|
597
|
+
styles:
|
|
598
|
+
layout.display: inline-flex
|
|
599
|
+
layout.align: center
|
|
600
|
+
spacing.gap: spacing/horizontal/xsmall
|
|
601
|
+
edges:
|
|
602
|
+
- node:
|
|
603
|
+
uri: global.component.keyboard_key
|
|
604
|
+
relation:
|
|
605
|
+
cardinality: "2..*" # a group needs at least two keys
|
|
606
|
+
slotName: default
|
|
489
607
|
```
|
|
490
608
|
|
|
491
609
|
### Anonymous Wrapper Node
|
|
@@ -494,7 +612,7 @@ Use when you need a structural element without design system identity:
|
|
|
494
612
|
|
|
495
613
|
```yaml
|
|
496
614
|
node:
|
|
497
|
-
uri:
|
|
615
|
+
uri: global.pattern.modal
|
|
498
616
|
styles:
|
|
499
617
|
layout.type: stack
|
|
500
618
|
appearance.background: color/surface/modal
|
|
@@ -517,24 +635,28 @@ node:
|
|
|
517
635
|
spacing.internal: spacing/large
|
|
518
636
|
edges:
|
|
519
637
|
- node:
|
|
520
|
-
uri:
|
|
638
|
+
uri: global.subcomponent.modal-header
|
|
521
639
|
relation:
|
|
522
640
|
cardinality: "0..1"
|
|
523
641
|
slotName: header
|
|
524
642
|
- node:
|
|
525
|
-
uri:
|
|
643
|
+
uri: global.subcomponent.modal-content
|
|
526
644
|
relation:
|
|
527
645
|
cardinality: "1..1"
|
|
528
|
-
slotName:
|
|
646
|
+
slotName: default
|
|
529
647
|
relation:
|
|
530
648
|
cardinality: "1..1"
|
|
531
649
|
```
|
|
532
650
|
|
|
533
651
|
### Simple Button Example
|
|
534
652
|
|
|
653
|
+
The live Button models its icon and label as ANONYMOUS roles — a user writes `<Button>`
|
|
654
|
+
with props and children, never a `Button.Icon` — so the children carry `role`, not `uri`
|
|
655
|
+
(the Named vs Anonymous rule above):
|
|
656
|
+
|
|
535
657
|
```yaml
|
|
536
658
|
node:
|
|
537
|
-
uri:
|
|
659
|
+
uri: global.component.button
|
|
538
660
|
styles:
|
|
539
661
|
# Structural
|
|
540
662
|
layout.type: flow
|
|
@@ -556,7 +678,7 @@ node:
|
|
|
556
678
|
|
|
557
679
|
edges:
|
|
558
680
|
- node:
|
|
559
|
-
|
|
681
|
+
role: icon
|
|
560
682
|
styles:
|
|
561
683
|
size.width: size/icon/small
|
|
562
684
|
size.height: size/icon/small
|
|
@@ -565,30 +687,58 @@ node:
|
|
|
565
687
|
slotName: icon
|
|
566
688
|
|
|
567
689
|
- node:
|
|
568
|
-
|
|
690
|
+
role: label
|
|
569
691
|
styles:
|
|
570
692
|
typography.size: font/size/button
|
|
571
693
|
typography.color: color/text/on-action
|
|
572
694
|
relation:
|
|
573
|
-
cardinality: "
|
|
574
|
-
slotName:
|
|
695
|
+
cardinality: "0..1"
|
|
696
|
+
slotName: default
|
|
575
697
|
```
|
|
576
698
|
|
|
577
699
|
## Workflow
|
|
578
700
|
|
|
579
701
|
### 1. Identify the Component
|
|
580
702
|
|
|
581
|
-
First,
|
|
703
|
+
First, a pre-step: could the name be a Group? Run the group query before the
|
|
704
|
+
lookup — neither `pragma block lookup` nor `pragma block list` covers groups, and
|
|
705
|
+
a name can be BOTH a Group and another tier's block (`BlogCards` is the Group
|
|
706
|
+
`sites.group.blog_cards` AND the Component
|
|
707
|
+
`sites_webcomponentsprototype.component.blog_cards`; the lookup answers with the
|
|
708
|
+
component and never mentions the group):
|
|
582
709
|
|
|
583
|
-
```
|
|
584
|
-
|
|
710
|
+
```bash
|
|
711
|
+
pragma graph query "SELECT ?b ?name WHERE { ?b a ds:Group ; ds:name ?name }"
|
|
585
712
|
```
|
|
586
713
|
|
|
587
|
-
If
|
|
588
|
-
|
|
589
|
-
|
|
714
|
+
If the name is in the answer and the Group is the block you were asked to write,
|
|
715
|
+
it is an existing block: take the URI from that query row (no §3 derivation),
|
|
716
|
+
gather its context with `pragma graph inspect <IRI>`, and continue from §2.
|
|
717
|
+
|
|
718
|
+
Otherwise, determine if the component exists in the design system:
|
|
719
|
+
|
|
720
|
+
```bash
|
|
721
|
+
pragma block lookup Card
|
|
590
722
|
```
|
|
591
723
|
|
|
724
|
+
Two branches:
|
|
725
|
+
|
|
726
|
+
- **Not found** (`ENTITY_NOT_FOUND`) — this is a NEW block: derive its URI in §3
|
|
727
|
+
below, then continue from §2.
|
|
728
|
+
- **Found** — this is a draft for an existing block (the empty-anatomy worklist path):
|
|
729
|
+
take the URI from the block's `pragma block list` row and skip §3. The list carries a
|
|
730
|
+
row per block it covers, not per tier declaring the name, and the lookup above
|
|
731
|
+
resolved it globally — the name query
|
|
732
|
+
`pragma graph query "SELECT ?b WHERE { ?b ds:name ?n . FILTER(LCASE(?n) = LCASE('<Name>')) }"`
|
|
733
|
+
lists every tier's IRI, so you take the one you meant.
|
|
734
|
+
Gather the full context — anatomy, modifiers, properties come with the lookup (a
|
|
735
|
+
bare name can match several tiers: see the multi-tier note in the Discovery Flow
|
|
736
|
+
above); every raw triple with:
|
|
737
|
+
|
|
738
|
+
```bash
|
|
739
|
+
pragma graph inspect ds:global.component.card
|
|
740
|
+
```
|
|
741
|
+
|
|
592
742
|
### 2. Gather Structural Requirements
|
|
593
743
|
|
|
594
744
|
Ask:
|
|
@@ -599,13 +749,19 @@ Ask:
|
|
|
599
749
|
|
|
600
750
|
### 3. Determine Tier and Type
|
|
601
751
|
|
|
752
|
+
The URI is `{tier}.{type}.{snake_name}` (see URI Encoding Convention above). The tier
|
|
753
|
+
segment comes from the live tier set — run `pragma tier list` and pick from what it
|
|
754
|
+
answers, never from a remembered list; the type segment is one of the ontology's
|
|
755
|
+
UIBlock classes:
|
|
756
|
+
|
|
602
757
|
| Question | Answer | Result |
|
|
603
758
|
|----------|--------|--------|
|
|
604
|
-
| Is it universal? | Yes | `
|
|
605
|
-
| Is it app-specific? | Yes | `
|
|
606
|
-
| Is it a subpart? | Yes | `{tier}
|
|
607
|
-
| Is it a UX solution? | Yes | `{tier}
|
|
608
|
-
| Does it divide space? | Yes | `{tier}
|
|
759
|
+
| Is it universal? | Yes | `global.component.{name}` |
|
|
760
|
+
| Is it app-specific? | Yes | `{apps_tier}.component.{name}` — the app's own tier from `pragma tier list` (e.g. `apps_lxd`) |
|
|
761
|
+
| Is it a subpart? | Yes | `{tier}.subcomponent.{parent}-{part}` |
|
|
762
|
+
| Is it a UX solution? | Yes | `{tier}.pattern.{name}` |
|
|
763
|
+
| Does it divide space? | Yes | `{tier}.layout.{name}` |
|
|
764
|
+
| Is it many instances of ONE sibling block laid out together? | Yes | `{tier}.group.{name}` |
|
|
609
765
|
|
|
610
766
|
### 4. Define Edges
|
|
611
767
|
|
|
@@ -636,6 +792,9 @@ Check your anatomy against:
|
|
|
636
792
|
- [ ] Style keys follow CTI convention
|
|
637
793
|
- [ ] Token paths use `/` delimiter
|
|
638
794
|
- [ ] Anonymous nodes have `role`, not `uri`
|
|
795
|
+
- [ ] Multi-word names encode word boundaries with `_`; `-` appears only where the name carries a dot (per the URI Encoding Convention table)
|
|
796
|
+
- [ ] 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)
|
|
797
|
+
- [ ] Named (`uri:`) children carry no copy of their own subtree — contextual style overrides only
|
|
639
798
|
- [ ] Nested components make semantic sense
|
|
640
799
|
|
|
641
800
|
## Response Format
|
|
@@ -645,7 +804,7 @@ When creating an anatomy, respond with:
|
|
|
645
804
|
```markdown
|
|
646
805
|
## Anatomy: {ComponentName}
|
|
647
806
|
|
|
648
|
-
**URI:** `{tier}
|
|
807
|
+
**URI:** `{tier}.{type}.{snake_name}`
|
|
649
808
|
**Tier:** {tier} - {rationale}
|
|
650
809
|
|
|
651
810
|
### Structure Overview
|
|
@@ -664,9 +823,9 @@ When creating an anatomy, respond with:
|
|
|
664
823
|
- {Design decision 2}
|
|
665
824
|
|
|
666
825
|
### Next Steps
|
|
667
|
-
1.
|
|
668
|
-
|
|
669
|
-
|
|
826
|
+
1. Land the DSL in the block's spec draft under `specs/` (see `specs/README.md`) —
|
|
827
|
+
as step 7 of a specify flow that is the step-6 spec file; never under `data/`
|
|
828
|
+
2. A human enters the content into Coda, the database of record
|
|
670
829
|
```
|
|
671
830
|
|
|
672
831
|
## Tips
|
|
@@ -674,6 +833,7 @@ When creating an anatomy, respond with:
|
|
|
674
833
|
1. **Start simple**: Begin with just structure, add styles incrementally
|
|
675
834
|
2. **Use discovery**: Query existing components for patterns and consistency
|
|
676
835
|
3. **Name thoughtfully**: URIs are identifiers - choose clear, consistent names
|
|
836
|
+
(see the URI Encoding Convention table above)
|
|
677
837
|
4. **Annotate decisions**: Use YAML comments for non-obvious choices
|
|
678
838
|
5. **Validate cardinality**: Think through edge cases (empty states, maximums)
|
|
679
839
|
6. **Separate concerns**: Structural styles vs themeable styles
|
|
@@ -720,7 +880,7 @@ This specification presents a DSL to represent design system anatomies, providin
|
|
|
720
880
|
- The children of a node MUST be modelled through a reified relation for annotation purposes
|
|
721
881
|
- The DSL MUST support anonymous nodes (nodes that are not named components). In this case, the DSL should support role annotations
|
|
722
882
|
- 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)
|
|
883
|
+
- The DSL MUST support all classes of UI Blocks identified in the ontology (Layout, Pattern, Component, Subcomponent, Group)
|
|
724
884
|
|
|
725
885
|
### Type System
|
|
726
886
|
|
|
@@ -743,7 +903,7 @@ The children one-to-many relation follows inspiration from the [Relay connection
|
|
|
743
903
|
* - Invariant (structural): layout.type, layout.direction, size.width: "fill"
|
|
744
904
|
* - Themeable (brand/theme): appearance.*, spacing.* (when using tokens)
|
|
745
905
|
*/
|
|
746
|
-
type Styles = Record<string, TokenPath | PrimitiveValue>;
|
|
906
|
+
type Styles = Record<string, TokenPath | TokenPath[] | PrimitiveValue>;
|
|
747
907
|
|
|
748
908
|
/**
|
|
749
909
|
* TokenPath: Forward-slash delimited path to a design token.
|
|
@@ -804,8 +964,8 @@ interface BaseNode {
|
|
|
804
964
|
*/
|
|
805
965
|
interface NamedNode extends BaseNode {
|
|
806
966
|
/**
|
|
807
|
-
* Unique identifier following "tier
|
|
808
|
-
* Examples: "
|
|
967
|
+
* Unique identifier following "tier.type.name" pattern.
|
|
968
|
+
* Examples: "global.component.button", "apps.layout.application_layout"
|
|
809
969
|
*/
|
|
810
970
|
uri: string;
|
|
811
971
|
}
|
|
@@ -823,8 +983,39 @@ interface AnonymousNode extends BaseNode {
|
|
|
823
983
|
|
|
824
984
|
type Node = NamedNode | AnonymousNode;
|
|
825
985
|
|
|
986
|
+
/**
|
|
987
|
+
* A switch fills one position with ONE of several alternatives.
|
|
988
|
+
* The discriminator says who chooses: "props" (consumer chooses via
|
|
989
|
+
* component props), "internal" (the component chooses from its own
|
|
990
|
+
* state), "override" (the consumer may replace the default with a
|
|
991
|
+
* custom component).
|
|
992
|
+
*/
|
|
993
|
+
interface Switch {
|
|
994
|
+
on: "props" | "internal" | "override";
|
|
995
|
+
cases: SwitchCase[];
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
/**
|
|
999
|
+
* One switch alternative — exactly one of `uri` or `node`.
|
|
1000
|
+
* `uri` is the shorthand for `node: { uri }`; use the full `node` form
|
|
1001
|
+
* when the case carries styles or edges. The reserved URI `$custom`
|
|
1002
|
+
* marks a case filled by a user-provided component.
|
|
1003
|
+
*/
|
|
1004
|
+
interface SwitchCase {
|
|
1005
|
+
uri?: string;
|
|
1006
|
+
node?: Node;
|
|
1007
|
+
|
|
1008
|
+
/** Marks the default case. */
|
|
1009
|
+
default?: boolean;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
826
1012
|
interface Edge {
|
|
827
|
-
node
|
|
1013
|
+
/** The child node — exactly one of `node` or `switch`. */
|
|
1014
|
+
node?: Node;
|
|
1015
|
+
|
|
1016
|
+
/** A polymorphic position (mutually exclusive with node). */
|
|
1017
|
+
switch?: Switch;
|
|
1018
|
+
|
|
828
1019
|
relation: Relation;
|
|
829
1020
|
}
|
|
830
1021
|
|
|
@@ -853,7 +1044,7 @@ Alternatives considered and rejected:
|
|
|
853
1044
|
|
|
854
1045
|
```yaml
|
|
855
1046
|
node:
|
|
856
|
-
uri:
|
|
1047
|
+
uri: global.component.accordion
|
|
857
1048
|
styles:
|
|
858
1049
|
# Structural (invariant)
|
|
859
1050
|
layout.type: stack
|
|
@@ -863,49 +1054,56 @@ node:
|
|
|
863
1054
|
appearance.border: border/style/accordion
|
|
864
1055
|
|
|
865
1056
|
edges:
|
|
1057
|
+
# The repeating child is NAMED — reference its URI only (DRY Principle);
|
|
1058
|
+
# its subtree lives in its own anatomy. The live Accordion does the same.
|
|
866
1059
|
- node:
|
|
867
|
-
uri:
|
|
1060
|
+
uri: global.subcomponent.accordion-item
|
|
1061
|
+
relation:
|
|
1062
|
+
cardinality: "1..*"
|
|
1063
|
+
slotName: default
|
|
1064
|
+
```
|
|
1065
|
+
|
|
1066
|
+
The child's own anatomy — a separate spec on `global.subcomponent.accordion-item`
|
|
1067
|
+
(transcribed from the live block) — carries the subtree as anonymous roles:
|
|
1068
|
+
|
|
1069
|
+
```yaml
|
|
1070
|
+
node:
|
|
1071
|
+
uri: global.subcomponent.accordion-item
|
|
1072
|
+
styles:
|
|
1073
|
+
layout.type: stack
|
|
1074
|
+
layout.direction: vertical
|
|
1075
|
+
edges:
|
|
1076
|
+
- node:
|
|
1077
|
+
role: header tab
|
|
1078
|
+
styles:
|
|
1079
|
+
layout.type: flow
|
|
1080
|
+
layout.direction: horizontal
|
|
1081
|
+
layout.align: center
|
|
1082
|
+
interaction.cursor: pointer
|
|
868
1083
|
edges:
|
|
869
1084
|
- node:
|
|
870
|
-
|
|
1085
|
+
role: control
|
|
871
1086
|
styles:
|
|
872
|
-
|
|
873
|
-
|
|
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
|
-
|
|
1087
|
+
size.width: size/icon/small
|
|
1088
|
+
size.height: size/icon/small
|
|
888
1089
|
relation:
|
|
889
|
-
cardinality: "1
|
|
890
|
-
slotName: header
|
|
891
|
-
|
|
1090
|
+
cardinality: "1"
|
|
892
1091
|
- node:
|
|
893
|
-
|
|
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
|
-
|
|
1092
|
+
role: heading
|
|
903
1093
|
relation:
|
|
904
|
-
cardinality: "1
|
|
1094
|
+
cardinality: "1"
|
|
905
1095
|
slotName: default
|
|
1096
|
+
relation:
|
|
1097
|
+
cardinality: "1"
|
|
1098
|
+
slotName: header
|
|
906
1099
|
|
|
1100
|
+
- node:
|
|
1101
|
+
role: content panel
|
|
1102
|
+
styles:
|
|
1103
|
+
layout.overflow: hidden
|
|
907
1104
|
relation:
|
|
908
|
-
cardinality: "1
|
|
1105
|
+
cardinality: "1"
|
|
1106
|
+
slotName: default
|
|
909
1107
|
```
|
|
910
1108
|
|
|
911
1109
|
### Future Work
|
|
@@ -914,3 +1112,14 @@ The following features would require additional work:
|
|
|
914
1112
|
- Representation of related nodes displayed in portals
|
|
915
1113
|
- Representation of conditional display
|
|
916
1114
|
- Inheritance reference for styles (e.g., "NetworkCard inherits from Card")
|
|
1115
|
+
|
|
1116
|
+
## Support
|
|
1117
|
+
|
|
1118
|
+
If this skill leads somewhere broken — a command that errors, guidance that
|
|
1119
|
+
contradicts what the live system answers, a gap the flow cannot cover — you are not
|
|
1120
|
+
stuck:
|
|
1121
|
+
|
|
1122
|
+
- Raise an issue in the pragma repo: https://github.com/canonical/pragma/issues —
|
|
1123
|
+
include the skill name, what was run, and expected vs. actual outcome.
|
|
1124
|
+
- Or contact the design-system team owners directly through your organization's
|
|
1125
|
+
professional messaging channels for assistance.
|