@canonical/design-system 0.2.5 → 0.43.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/LICENSE +166 -0
- package/README.md +255 -14
- package/data/apps/component/file_tree.ttl +2 -0
- package/data/apps/component/key_value_pair.ttl +2 -0
- package/data/apps/component/navigation.ttl +2 -0
- package/data/apps/component/notification.ttl +2 -0
- package/data/apps/component/side_navigation.ttl +2 -0
- package/data/apps/component/skeleton_loading.ttl +2 -0
- package/data/apps/component/status_bar.ttl +2 -0
- package/data/apps/component/toolbar.ttl +2 -0
- package/data/apps/group/key_value_pairs.ttl +2 -0
- package/data/apps/group/notifications.ttl +2 -0
- package/data/apps/layout/application_layout.ttl +2 -0
- package/data/apps/layout/content_layout.ttl +2 -0
- package/data/apps/layout/empty_layout.ttl +2 -0
- package/data/apps/layout/empty_state.ttl +13 -0
- package/data/apps/layout/list_page_layout.ttl +2 -0
- package/data/apps/layout/settings_page_layout.ttl +2 -0
- package/data/apps/layout/view_layout.ttl +2 -0
- package/data/apps/pattern/action_bar.ttl +4 -2
- package/data/apps/pattern/code_diff.ttl +2 -0
- package/data/apps/pattern/{data_table.ttl → datatable.ttl} +27 -25
- package/data/apps/pattern/destructive_modal.ttl +2 -0
- package/data/apps/pattern/drawer.ttl +2 -0
- package/data/apps/pattern/keyboard_shortcuts.ttl +2 -0
- package/data/apps/pattern/notification_center.ttl +4 -2
- package/data/apps/pattern/side_panel.ttl +39 -4
- package/data/apps/pattern/sidepanel_stacked.ttl +2 -0
- package/data/apps/subcomponent/data_table-action_bar.ttl +7 -5
- package/data/apps/subcomponent/data_table-body_cell.ttl +27 -25
- package/data/apps/subcomponent/data_table-group_header_row.ttl +10 -8
- package/data/apps/subcomponent/data_table-header_cell.ttl +13 -11
- package/data/apps/subcomponent/data_table-pagination_bar.ttl +11 -9
- package/data/apps/subcomponent/data_table-persistent_selection.ttl +12 -10
- package/data/apps/subcomponent/data_table-settings_menu.ttl +17 -15
- package/data/apps/subcomponent/drawer-content.ttl +2 -0
- package/data/apps/subcomponent/drawer-footer.ttl +2 -0
- package/data/apps/subcomponent/drawer-header.ttl +2 -0
- package/data/apps/subcomponent/file_tree-node.ttl +2 -0
- package/data/apps/subcomponent/log.ttl +2 -0
- package/data/apps/subcomponent/side_panel-content.ttl +3 -1
- package/data/apps/subcomponent/side_panel-footer.ttl +3 -1
- package/data/apps/subcomponent/side_panel-header.ttl +3 -1
- package/data/apps.ttl +2 -0
- package/data/apps_anbox/component/theme_switcher.ttl +2 -0
- package/data/apps_anbox/pattern/side_menu.ttl +2 -0
- package/data/apps_anbox.ttl +2 -0
- package/data/apps_debcrafters/component/deb_package_card.ttl +12 -0
- package/data/apps_debcrafters/component/example.ttl +2 -0
- package/data/apps_debcrafters/component/my_fancy_component.ttl +2 -0
- package/data/apps_debcrafters.ttl +2 -0
- package/data/apps_juju/pattern/single_select_multi_layered.ttl +2 -0
- package/data/apps_juju.ttl +2 -0
- package/data/apps_landscape/component/checkbox_group.ttl +110 -0
- package/data/apps_landscape/component/code_editor.ttl +134 -0
- package/data/apps_landscape/component/cron_schedule.ttl +40 -0
- package/data/apps_landscape/component/expandable_radio_group.ttl +106 -0
- package/data/apps_landscape/component/expandable_truncation.ttl +50 -0
- package/data/apps_landscape/component/form_section.ttl +33 -0
- package/data/apps_landscape/component/gpg_key_field.ttl +86 -0
- package/data/apps_landscape/component/grouped_select.ttl +137 -0
- package/data/apps_landscape/component/loading_state.ttl +30 -0
- package/data/apps_landscape/component/managed_file_input.ttl +75 -0
- package/data/apps_landscape/component/multi_select_field.ttl +323 -0
- package/data/apps_landscape/component/pass_rate_filter.ttl +13 -0
- package/data/apps_landscape/component/password_constraints.ttl +3 -0
- package/data/apps_landscape/component/progress_bar.ttl +100 -0
- package/data/apps_landscape/component/read_only_field.ttl +46 -0
- package/data/apps_landscape/component/search_help_popup.ttl +51 -0
- package/data/apps_landscape/component/search_query_editor.ttl +149 -0
- package/data/apps_landscape/component/tag_multi_select.ttl +52 -0
- package/data/apps_landscape/pattern/content_blocks.ttl +70 -0
- package/data/apps_landscape/pattern/dashboard_page_composition.ttl +110 -0
- package/data/apps_landscape/pattern/delivery_scheduling.ttl +24 -0
- package/data/apps_landscape/pattern/form_field_help.ttl +67 -0
- package/data/apps_landscape/pattern/header_search_controls.ttl +106 -0
- package/data/apps_landscape/pattern/ignorable_notification.ttl +60 -0
- package/data/apps_landscape/pattern/information_grid.ttl +93 -0
- package/data/apps_landscape/pattern/instance_association.ttl +29 -0
- package/data/apps_landscape/pattern/process_flow.ttl +52 -0
- package/data/apps_landscape/pattern/progressively_expandable_table.ttl +158 -0
- package/data/apps_landscape/pattern/recurring_schedule.ttl +21 -0
- package/data/apps_landscape/pattern/responsive_action_group.ttl +77 -0
- package/data/apps_landscape/pattern/responsive_header_actions.ttl +83 -0
- package/data/apps_landscape/pattern/responsive_table_filters.ttl +61 -0
- package/data/apps_landscape/pattern/side_panel_form_actions.ttl +126 -0
- package/data/apps_landscape/pattern/sortable_list.ttl +50 -0
- package/data/apps_landscape/pattern/table_filter.ttl +201 -0
- package/data/apps_landscape/pattern/table_filter_chips.ttl +174 -0
- package/data/apps_landscape/pattern/table_pagination.ttl +220 -0
- package/data/apps_landscape/pattern/typed_confirmation_modal.ttl +88 -0
- package/data/apps_landscape/subcomponent/bold_substring.ttl +30 -0
- package/data/apps_landscape/subcomponent/inline_cell_input.ttl +36 -0
- package/data/apps_landscape/subcomponent/label_with_description.ttl +46 -0
- package/data/apps_landscape/subcomponent/nested_dropdown_item.ttl +61 -0
- package/data/apps_landscape/subcomponent/pluralized_bold_count.ttl +36 -0
- package/data/apps_landscape/subcomponent/select_all_results_prompt.ttl +56 -0
- package/data/apps_landscape.ttl +2 -0
- package/data/apps_launchpad/component/accordion.ttl +12 -0
- package/data/apps_launchpad/component/avatar.ttl +4 -2
- package/data/apps_launchpad/component/badge.ttl +4 -2
- package/data/apps_launchpad/component/breadcrumbs.ttl +2 -0
- package/data/apps_launchpad/component/button.ttl +4 -2
- package/data/apps_launchpad/component/checkbox_input.ttl +6 -4
- package/data/apps_launchpad/component/chip.ttl +2 -0
- package/data/apps_launchpad/component/combobox.ttl +4 -2
- package/data/apps_launchpad/component/description_list.ttl +2 -0
- package/data/apps_launchpad/component/drawer.ttl +6 -4
- package/data/apps_launchpad/component/link.ttl +12 -0
- package/data/apps_launchpad/component/log.ttl +2 -0
- package/data/apps_launchpad/component/markdown_editor.ttl +12 -0
- package/data/apps_launchpad/component/modal.ttl +7 -5
- package/data/apps_launchpad/component/pagination.ttl +12 -0
- package/data/apps_launchpad/component/popover.ttl +12 -0
- package/data/apps_launchpad/component/radio_input.ttl +6 -4
- package/data/apps_launchpad/component/relative_timestamp.ttl +12 -0
- package/data/apps_launchpad/component/select_input.ttl +2 -0
- package/data/apps_launchpad/component/spinner.ttl +12 -0
- package/data/apps_launchpad/component/switch.ttl +6 -4
- package/data/apps_launchpad/component/table.ttl +12 -0
- package/data/apps_launchpad/component/text_input.ttl +9 -7
- package/data/apps_launchpad/component/textarea_input.ttl +10 -8
- package/data/apps_launchpad/component/timestamp.ttl +12 -0
- package/data/apps_launchpad/component/tooltip.ttl +4 -2
- package/data/apps_launchpad/subcomponent/combobox-checkbox_option.ttl +2 -0
- package/data/apps_launchpad/subcomponent/combobox-footer.ttl +2 -0
- package/data/apps_launchpad/subcomponent/combobox-group.ttl +2 -0
- package/data/apps_launchpad/subcomponent/combobox-helper.ttl +2 -0
- package/data/apps_launchpad/subcomponent/combobox-loading.ttl +4 -2
- package/data/apps_launchpad/subcomponent/combobox-no_results.ttl +2 -0
- package/data/apps_launchpad/subcomponent/combobox-radio_option.ttl +2 -0
- package/data/apps_launchpad/subcomponent/combobox-search.ttl +6 -4
- package/data/apps_launchpad/subcomponent/description_list-item.ttl +2 -0
- package/data/apps_launchpad/subcomponent/log-line.ttl +2 -0
- package/data/apps_launchpad/subcomponent/modal-content-body.ttl +2 -0
- package/data/apps_launchpad/subcomponent/modal-content-footer.ttl +2 -0
- package/data/apps_launchpad/subcomponent/modal-content-header-close_button.ttl +2 -0
- package/data/apps_launchpad/subcomponent/modal-content-header.ttl +2 -0
- package/data/apps_launchpad/subcomponent/modal-content.ttl +4 -2
- package/data/apps_launchpad/subcomponent/side_panel-content-body.ttl +2 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-footer.ttl +2 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-header-close_button.ttl +2 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-header.ttl +2 -0
- package/data/apps_launchpad/subcomponent/side_panel-content.ttl +2 -0
- package/data/apps_launchpad.ttl +2 -0
- package/data/apps_lxd/component/back_link.ttl +2 -0
- package/data/apps_lxd/component/code_snippet_with_copy_button.ttl +2 -0
- package/data/apps_lxd/component/confirmation_checkbox.ttl +2 -0
- package/data/apps_lxd/component/doc_link.ttl +4 -2
- package/data/apps_lxd/component/meter.ttl +6 -4
- package/data/apps_lxd/component/output_field.ttl +2 -0
- package/data/apps_lxd/component/rename_header.ttl +17 -15
- package/data/apps_lxd/component/tab_links.ttl +6 -4
- package/data/apps_lxd/subcomponent/copy_to_clipboard.ttl +2 -0
- package/data/apps_lxd/view/network_topology.ttl +2 -0
- package/data/apps_lxd.ttl +2 -0
- package/data/apps_notary.ttl +2 -0
- package/data/apps_portal/component/badge.ttl +2 -0
- package/data/apps_portal/component/credit_card_input.ttl +2 -0
- package/data/apps_portal/component/key_value_pair.ttl +2 -0
- package/data/apps_portal/layout/details_view.ttl +18 -0
- package/data/apps_portal/pattern/purchase_summary.ttl +2 -0
- package/data/apps_portal/subcomponent/read_only_modal.ttl +2 -0
- package/data/apps_portal.ttl +2 -0
- package/data/apps_support/component/data_spotlight.ttl +12 -0
- package/data/apps_support/subcomponent/ai_prompt_input.ttl +12 -0
- package/data/apps_support.ttl +6 -0
- package/data/apps_workplaceengineering/component/complex_multi_select.ttl +13 -0
- package/data/apps_workplaceengineering/component/label-highlight.ttl +3 -1
- package/data/apps_workplaceengineering/component/rule.ttl +2 -0
- package/data/apps_workplaceengineering/component/skip_link.ttl +2 -0
- package/data/apps_workplaceengineering/component/theme_switcher.ttl +2 -0
- package/data/apps_workplaceengineering/pattern/callout_numbers_card.ttl +2 -0
- package/data/apps_workplaceengineering/pattern/confirmation_modal.ttl +12 -0
- package/data/apps_workplaceengineering/pattern/event_timeline.ttl +2 -0
- package/data/apps_workplaceengineering/pattern/group_card.ttl +2 -0
- package/data/apps_workplaceengineering/pattern/travel_provider_card.ttl +2 -0
- package/data/apps_workplaceengineering/subcomponent/multi_select_input.ttl +12 -0
- package/data/apps_workplaceengineering.ttl +2 -0
- package/data/concept/Foundations-Baseline.ttl +11 -0
- package/data/concept/Foundations-Density--the-form-channel.ttl +11 -0
- package/data/concept/Foundations-Grid--Layout.ttl +11 -0
- package/data/concept/Foundations-Spacing/-Element-vs-container-owned.ttl +11 -0
- package/data/concept/Foundations-Spacing.ttl +11 -0
- package/data/concept/Foundations-Surfaces.ttl +11 -0
- package/data/concept/Foundations-Typography.ttl +11 -0
- package/data/concept/{How-to-differentiate-components-variantsinheritance.ttl → How-to-differentiate-types-of-UI-blocks-.ttl} +5 -3
- package/data/concept/How-to-indicate-required-fields-in-forms.ttl +11 -0
- package/data/concept/How-to-support-modifiers-in-a-component.ttl +11 -0
- package/data/concept/Intentional-friction.ttl +11 -0
- package/data/concept/Question-mark-vs-information-icon.ttl +3 -1
- package/data/concept/Understanding-the-modifier-contract.ttl +11 -0
- package/data/concepttype/Explanation.ttl +2 -0
- package/data/concepttype/How-to-guide.ttl +2 -0
- package/data/concepttype/Reference.ttl +2 -0
- package/data/concepttype/Tutorial.ttl +2 -0
- package/data/documentation/layout/documentation_layout.ttl +2 -0
- package/data/documentation/pattern/library_side_navigation.ttl +3 -1
- package/data/documentation.ttl +2 -0
- package/data/global/component/accordion.ttl +180 -1
- package/data/global/component/announcement.ttl +13 -2
- package/data/global/component/avatar.ttl +2 -0
- package/data/global/component/badge.ttl +4 -2
- package/data/global/component/breadcrumbs.ttl +77 -2
- package/data/global/component/button.ttl +197 -2
- package/data/global/component/button_link.ttl +2 -0
- package/data/global/component/card.ttl +150 -3
- package/data/global/component/checkbox_field.ttl +269 -2
- package/data/global/component/chip.ttl +3 -1
- package/data/global/component/choices_field.ttl +373 -2
- package/data/global/component/code_snippet-content.ttl +3 -1
- package/data/global/component/code_snippet-header.ttl +21 -2
- package/data/global/component/code_snippet.ttl +28 -1
- package/data/global/component/color_field.ttl +2 -0
- package/data/global/component/combobox_field.ttl +470 -3
- package/data/global/component/contextual_menu.ttl +2 -0
- package/data/global/component/data_tooltip.ttl +149 -2
- package/data/global/component/date_field.ttl +158 -3
- package/data/global/component/date_time_field.ttl +157 -2
- package/data/global/component/drag_and_drop_list.ttl +13 -0
- package/data/global/component/dropdown_button.ttl +2 -0
- package/data/global/component/file_upload_field.ttl +230 -3
- package/data/global/component/heading.ttl +62 -3
- package/data/global/component/hidden_field.ttl +3 -1
- package/data/global/component/icon.ttl +3 -1
- package/data/global/component/icon_in_container.ttl +2 -0
- package/data/global/component/inline_code.ttl +2 -0
- package/data/global/component/keyboard_key.ttl +77 -2
- package/data/global/component/markdown_field.ttl +2 -0
- package/data/global/component/mode_switcher.ttl +2 -0
- package/data/global/component/month_field.ttl +2 -0
- package/data/global/component/notification_inline.ttl +2 -0
- package/data/global/component/notification_toast.ttl +2 -0
- package/data/global/component/number_field.ttl +2 -0
- package/data/global/component/pagination.ttl +2 -0
- package/data/global/component/password_field.ttl +189 -2
- package/data/global/component/phone_field.ttl +173 -2
- package/data/global/component/popover.ttl +2 -0
- package/data/global/component/range_field.ttl +165 -2
- package/data/global/component/rating_field.ttl +2 -0
- package/data/global/component/relative_timestamp.ttl +2 -0
- package/data/global/component/rich_choices_field.ttl +205 -2
- package/data/global/component/rich_text_field.ttl +2 -0
- package/data/global/component/search_field.ttl +2 -0
- package/data/global/component/segmented_control_field.ttl +2 -0
- package/data/global/component/select_field.ttl +158 -3
- package/data/global/component/switch_field.ttl +190 -3
- package/data/global/component/table.ttl +4 -2
- package/data/global/component/tabs.ttl +13 -2
- package/data/global/component/tag.ttl +13 -2
- package/data/global/component/text_field.ttl +173 -2
- package/data/global/component/textarea_field.ttl +157 -2
- package/data/global/component/tile.ttl +108 -1
- package/data/global/component/time_field.ttl +157 -2
- package/data/global/component/timestamp.ttl +2 -0
- package/data/global/component/tooltip.ttl +166 -43
- package/data/global/component/tooltip_wrapper.ttl +61 -2
- package/data/global/group/buttons.ttl +2 -0
- package/data/global/group/cards.ttl +2 -0
- package/data/global/group/code_snippets.ttl +2 -0
- package/data/global/group/keyboard_keys.ttl +101 -2
- package/data/global/group/tiles.ttl +2 -0
- package/data/global/layout/error_layout.ttl +2 -0
- package/data/global/layout/form_layout.ttl +2 -0
- package/data/global/layout/identity_page_form.ttl +2 -0
- package/data/global/modifier/alpha.ttl +2 -0
- package/data/global/modifier/beta.ttl +2 -0
- package/data/global/modifier/caution.ttl +2 -0
- package/data/global/modifier/comfortable.ttl +2 -0
- package/data/global/modifier/completed.ttl +2 -0
- package/data/global/modifier/constructive.ttl +2 -0
- package/data/global/modifier/dark.ttl +2 -0
- package/data/global/modifier/dense.ttl +2 -0
- package/data/global/modifier/destructive.ttl +2 -0
- package/data/global/modifier/editable.ttl +2 -0
- package/data/global/modifier/elevated.ttl +2 -0
- package/data/global/modifier/error.ttl +2 -0
- package/data/global/modifier/experimental.ttl +2 -0
- package/data/global/modifier/failed.ttl +2 -0
- package/data/global/modifier/focused.ttl +2 -0
- package/data/global/modifier/highlighted.ttl +2 -0
- package/data/global/modifier/in_progress.ttl +2 -0
- package/data/global/modifier/information.ttl +2 -0
- package/data/global/modifier/light.ttl +2 -0
- package/data/global/modifier/loading.ttl +2 -0
- package/data/global/modifier/modal.ttl +2 -0
- package/data/global/modifier/muted.ttl +2 -0
- package/data/global/modifier/planned.ttl +2 -0
- package/data/global/modifier/primary.ttl +2 -0
- package/data/global/modifier/secondary.ttl +2 -0
- package/data/global/modifier/stable.ttl +2 -0
- package/data/global/modifier/success.ttl +2 -0
- package/data/global/modifier/surface1.ttl +2 -0
- package/data/global/modifier/surface2.ttl +2 -0
- package/data/global/modifier/surface3.ttl +2 -0
- package/data/global/modifier/tertiary.ttl +2 -0
- package/data/global/modifier/warning.ttl +2 -0
- package/data/global/modifier/wireframe.ttl +2 -0
- package/data/global/modifier_family/_color_luminosity.ttl +2 -0
- package/data/global/modifier_family/_emphasis.ttl +2 -0
- package/data/global/modifier_family/_other.ttl +2 -0
- package/data/global/modifier_family/anticipation.ttl +2 -0
- package/data/global/modifier_family/criticality.ttl +2 -0
- package/data/global/modifier_family/density.ttl +2 -0
- package/data/global/modifier_family/importance.ttl +2 -0
- package/data/global/modifier_family/lifecycle.ttl +2 -0
- package/data/global/modifier_family/mode.ttl +2 -0
- package/data/global/modifier_family/release.ttl +2 -0
- package/data/global/modifier_family/surface.ttl +2 -0
- package/data/global/pattern/description_list.ttl +2 -0
- package/data/global/pattern/field.ttl +2 -0
- package/data/global/pattern/form.ttl +2 -0
- package/data/global/pattern/form_login.ttl +2 -0
- package/data/global/pattern/info_table.ttl +2 -0
- package/data/global/pattern/modal.ttl +431 -4
- package/data/global/pattern/navigation.ttl +2 -0
- package/data/global/pattern/stepper.ttl +2 -0
- package/data/global/pattern/table_of_contents.ttl +85 -2
- package/data/global/pattern/timeline.ttl +48 -13
- package/data/global/subcomponent/accordion-item.ttl +157 -2
- package/data/global/subcomponent/breadcrumbs-item.ttl +69 -2
- package/data/global/subcomponent/card-content.ttl +53 -2
- package/data/global/subcomponent/card-footer.ttl +2 -0
- package/data/global/subcomponent/card-header.ttl +45 -2
- package/data/global/subcomponent/card-image.ttl +13 -2
- package/data/global/subcomponent/card-thumbnail.ttl +37 -2
- package/data/global/subcomponent/chart_legend.ttl +93 -2
- package/data/global/subcomponent/chart_legend_item.ttl +77 -2
- package/data/global/subcomponent/checkbox_input.ttl +165 -2
- package/data/global/subcomponent/color_input.ttl +2 -0
- package/data/global/subcomponent/combobox_input.ttl +398 -3
- package/data/global/subcomponent/date_input.ttl +85 -2
- package/data/global/subcomponent/date_time_input.ttl +85 -2
- package/data/global/subcomponent/field-description.ttl +13 -2
- package/data/global/subcomponent/field-error.ttl +29 -0
- package/data/global/subcomponent/field-label.ttl +37 -2
- package/data/global/subcomponent/file_upload_input.ttl +158 -3
- package/data/global/subcomponent/hidden_input.ttl +3 -1
- package/data/global/subcomponent/kvp_container.ttl +77 -2
- package/data/global/subcomponent/kvpitem_base.ttl +69 -2
- package/data/global/subcomponent/markdown_input.ttl +2 -0
- package/data/global/subcomponent/modal-content.ttl +38 -2
- package/data/global/subcomponent/modal-footer.ttl +262 -2
- package/data/global/subcomponent/modal-header.ttl +294 -2
- package/data/global/subcomponent/month_input.ttl +2 -0
- package/data/global/subcomponent/number_input.ttl +2 -0
- package/data/global/subcomponent/password_input.ttl +117 -2
- package/data/global/subcomponent/phone_input.ttl +101 -2
- package/data/global/subcomponent/radio_input.ttl +94 -3
- package/data/global/subcomponent/range_input.ttl +85 -2
- package/data/global/subcomponent/rating_input.ttl +2 -0
- package/data/global/subcomponent/rich_text_input.ttl +2 -0
- package/data/global/subcomponent/search_input.ttl +5 -3
- package/data/global/subcomponent/segmented_control_input.ttl +2 -0
- package/data/global/subcomponent/select_input.ttl +86 -3
- package/data/global/subcomponent/spin_button.ttl +2 -0
- package/data/global/subcomponent/spinner.ttl +3 -1
- package/data/global/subcomponent/switch_input.ttl +86 -3
- package/data/global/subcomponent/table-cell.ttl +2 -0
- package/data/global/subcomponent/table-row.ttl +2 -0
- package/data/global/subcomponent/text_input.ttl +101 -2
- package/data/global/subcomponent/textarea_input.ttl +85 -2
- package/data/global/subcomponent/tile-content.ttl +45 -2
- package/data/global/subcomponent/tile-header.ttl +45 -2
- package/data/global/subcomponent/time_input.ttl +85 -2
- package/data/global/subcomponent/timeline-content.ttl +37 -2
- package/data/global/subcomponent/timeline-event.ttl +42 -7
- package/data/global/subcomponent/timeline-expansion_indicator.ttl +3 -1
- package/data/global/subcomponent/timeline-header.ttl +3 -1
- package/data/global/variant/tooltip_dense.ttl +2 -0
- package/data/global/view/settings_view.ttl +2 -0
- package/data/global.ttl +2 -0
- package/data/sites/component/blog_card.ttl +2 -0
- package/data/sites/component/quote.ttl +2 -0
- package/data/sites/component/rule.ttl +2 -0
- package/data/sites/component/section.ttl +2 -0
- package/data/sites/group/blog_cards.ttl +2 -0
- package/data/sites/group/xblog_elements.ttl +2 -0
- package/data/sites/layout/blog_page_layout.ttl +2 -0
- package/data/sites/layout/case_study_layout.ttl +2 -0
- package/data/sites/layout/site_layout.ttl +2 -0
- package/data/sites/pattern/hero-github.ttl +2 -0
- package/data/sites/pattern/hero.ttl +2 -0
- package/data/sites/pattern/info_table.ttl +2 -0
- package/data/sites/pattern/pricing_section.ttl +2 -0
- package/data/sites/pattern/pricing_table.ttl +2 -0
- package/data/sites/pattern/read_more_section.ttl +2 -0
- package/data/sites/pattern/skip_link.ttl +2 -0
- package/data/sites.ttl +2 -0
- package/data/sites_webcomponentsprototype/component/blog_cards.ttl +2 -0
- package/data/sites_webcomponentsprototype/component/ctablock.ttl +2 -0
- package/data/sites_webcomponentsprototype/component/list.ttl +2 -0
- package/data/sites_webcomponentsprototype/component/tabs.ttl +2 -0
- package/data/sites_webcomponentsprototype/layout/site_layout.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/basic_section.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/blog_section.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/ctasection.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/equal_heights.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/hero.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/logo_section.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/quote_wrapper.ttl +2 -0
- package/data/sites_webcomponentsprototype/pattern/tiered_list.ttl +2 -0
- package/data/sites_webcomponentsprototype.ttl +2 -0
- package/data/stores.ttl +2 -0
- package/data/tag/allgood.ttl +2 -0
- package/data/tag/beta.ttl +2 -0
- package/data/tag/candidate.ttl +2 -0
- package/data/tag/devbatch1.ttl +2 -0
- package/data/tag/devbatch2.ttl +2 -0
- package/data/tag/devbatch3.ttl +9 -0
- package/data/tag/devexternal.ttl +2 -0
- package/data/tag/devreactapproved.ttl +2 -0
- package/data/tag/devreactbase.ttl +2 -0
- package/data/tag/devreactpreapproved.ttl +2 -0
- package/data/tag/devspecial.ttl +2 -0
- package/data/tag/devsveltedone.ttl +2 -0
- package/data/tag/devsveltein-progress.ttl +2 -0
- package/data/tag/divergent.ttl +2 -0
- package/data/tag/docscomplete.ttl +2 -0
- package/data/tag/draft.ttl +2 -0
- package/data/tag/edge.ttl +2 -0
- package/data/tag/global-docs-missing.ttl +2 -0
- package/data/tag/has-no-global-entry.ttl +2 -0
- package/data/tag/lpto-be-upstreamed.ttl +2 -0
- package/data/tag/lptriageblocked-reqs-design.ttl +2 -0
- package/data/tag/lptriageno-upstream.ttl +2 -0
- package/data/tag/lptriagereimplement-and-deprecate.ttl +2 -0
- package/data/tag/lptriagereimplement-and-keep.ttl +2 -0
- package/data/tag/lptriageupstream-and-deprecate.ttl +2 -0
- package/data/tag/minimal.ttl +2 -0
- package/data/tag/needsdefinition.ttl +2 -0
- package/data/tag/needsdiscussion.ttl +2 -0
- package/data/tag/needsdocumentation.ttl +2 -0
- package/data/tag/needsreview.ttl +2 -0
- package/data/tag/needstriage.ttl +2 -0
- package/data/tag/needsupdate.ttl +2 -0
- package/data/tag/notstarted.ttl +2 -0
- package/data/tag/specialadoption-docs.ttl +2 -0
- package/data/tag/stable.ttl +2 -0
- package/data/tag/stylesready.ttl +2 -0
- package/data/tag/triagedbacklog.ttl +2 -0
- package/data/tag/triagedrejected.ttl +2 -0
- package/data/tag/upstream-candidate.ttl +2 -0
- package/data/tag/upstream-compliant.ttl +2 -0
- package/data/tag/upstreamcandidate.ttl +2 -0
- package/data/tag/waiting-for-delta-review.ttl +2 -0
- package/data/tag/wpeinital-implementation.ttl +2 -0
- package/data/tag/wpetriageupstream-and-deprecate.ttl +2 -0
- package/data/tagcategory/channel.ttl +2 -0
- package/data/tagcategory/concept-status.ttl +2 -0
- package/data/tagcategory/concept-type.ttl +2 -0
- package/data/tagcategory/documentation-stage.ttl +2 -0
- package/data/tagcategory/implementation-status.ttl +2 -0
- package/data/tagcategory/lpupstream.ttl +2 -0
- package/data/tagcategory/review-status.ttl +2 -0
- package/data/tagcategory/tmp.ttl +2 -0
- package/definitions/ontology.ttl +70 -1
- package/package.json +34 -8
- package/skills/adoption-a1-styles/SKILL.md +24 -0
- package/skills/adoption-a2-components/SKILL.md +22 -6
- package/skills/anatomy-author/ANATOMY_DSL_SPEC.md +1397 -327
- package/skills/anatomy-author/SKILL.md +840 -137
- package/skills/design-auditor/SKILL.md +133 -9
- package/skills/implement-component/SKILL.md +192 -23
- package/skills/specify-component/SKILL.md +124 -12
- package/skills/specify-pattern/SKILL.md +47 -8
- package/src/collect-implementations.ts +0 -0
- package/src/serializers/TTLSerializer.tests.ts +101 -0
- package/src/serializers/TTLSerializer.ts +17 -2
- package/.github/ISSUE_TEMPLATE/propose-changes-to-existing-ui-block.md +0 -14
- package/.github/ISSUE_TEMPLATE/propose-new-ui-block.md +0 -26
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -22
- package/.github/workflows/ci.yml +0 -49
- package/.github/workflows/sync-coda-manual.yml +0 -25
- package/.github/workflows/sync-coda-scheduled.yml +0 -22
- package/.github/workflows/sync-coda.yml +0 -102
- package/.mcp.json +0 -12
- package/GEMINI.md +0 -2
- package/biome.json +0 -6
- package/bun.lock +0 -392
- package/data/apps_landscape/component/truncated_cell.ttl +0 -38
- package/data/concept/Foundations-Grid.ttl +0 -9
- package/data/concept/Indicating-required-fields-in-forms.ttl +0 -9
- package/data/concepttype/Decision-guide.ttl +0 -5
- package/data/concepttype/Mental-model.ttl +0 -5
- package/examples/form-roster.target.json +0 -550
- package/source.json +0 -205
- package/specs/README.md +0 -17
- package/src/cli.ts +0 -58
- package/src/commands/extract.tests.ts +0 -40
- package/src/commands/extract.ts +0 -50
- package/src/commands/index.ts +0 -4
- package/src/commands/list.tests.ts +0 -25
- package/src/commands/list.ts +0 -26
- package/src/commands/sync.tests.ts +0 -430
- package/src/commands/sync.ts +0 -418
- package/src/commands/transform.tests.ts +0 -213
- package/src/commands/transform.ts +0 -257
- package/src/config/index.ts +0 -2
- package/src/config/source.schema.json +0 -146
- package/src/config/types.ts +0 -129
- package/src/config/validateConfig.tests.ts +0 -46
- package/src/config/validateConfig.ts +0 -21
- package/src/constants.ts +0 -19
- package/src/providers/CodaProvider.tests.ts +0 -335
- package/src/providers/CodaProvider.ts +0 -384
- package/src/providers/CodaProvider.types.generated.ts +0 -12597
- package/src/providers/detectSmartChips.tests.ts +0 -42
- package/src/providers/detectSmartChips.ts +0 -60
- package/src/providers/index.ts +0 -18
- package/src/scripts/checkDataDeletion.ts +0 -68
- package/src/scripts/evaluateDataDeletion.tests.ts +0 -100
- package/src/scripts/evaluateDataDeletion.ts +0 -100
- package/src/sync/constants.ts +0 -52
- package/src/sync/diffRoster.tests.ts +0 -455
- package/src/sync/diffRoster.ts +0 -241
- package/src/sync/loadTargetSpec.tests.ts +0 -208
- package/src/sync/loadTargetSpec.ts +0 -139
- package/src/sync/renderPlan.tests.ts +0 -144
- package/src/sync/renderPlan.ts +0 -88
- package/src/sync/snapshotTable.tests.ts +0 -31
- package/src/sync/snapshotTable.ts +0 -20
- package/src/sync/toLiveEntries.tests.ts +0 -76
- package/src/sync/toLiveEntries.ts +0 -55
- package/src/sync/types.ts +0 -101
- package/src/transform/collectDataMetrics.tests.ts +0 -108
- package/src/transform/collectDataMetrics.ts +0 -114
- package/src/transform/deltaGuards.tests.ts +0 -136
- package/src/transform/deltaGuards.ts +0 -118
- package/src/transform/expectedTables.tests.ts +0 -99
- package/src/transform/expectedTables.ts +0 -34
- package/src/transform/isValidReferenceUri.tests.ts +0 -45
- package/src/transform/isValidReferenceUri.ts +0 -55
- package/src/transform/materializeInverses.tests.ts +0 -81
- package/src/transform/materializeInverses.ts +0 -78
- package/src/transform/resolveReferences.tests.ts +0 -67
- package/src/transform/resolveReferences.ts +0 -36
- package/src/transform/resolveValue.tests.ts +0 -82
- package/src/transform/resolveValue.ts +0 -87
- package/src/transform/rowFilter.tests.ts +0 -100
- package/src/transform/rowFilter.ts +0 -55
- package/src/transform/transform.tests.ts +0 -132
- package/src/transform/transform.ts +0 -145
- package/src/transform/transformRow.malformedRefs.tests.ts +0 -127
- package/src/transform/transformRow.tests.ts +0 -466
- package/src/transform/transformRow.ts +0 -358
- package/src/transform/types.ts +0 -37
- package/tsconfig.json +0 -9
- package/vite.config.ts +0 -11
- package/vitest.config.ts +0 -50
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
2
4
|
|
|
3
5
|
ds:apps_lxd.component.rename_header a ds:Component;
|
|
4
6
|
ds:name "RenameHeader";
|
|
@@ -13,15 +15,15 @@ ds:apps_lxd.component.rename_header a ds:Component;
|
|
|
13
15
|
ds:name "name";
|
|
14
16
|
ds:summary "The current name/title of the resource being displayed and potentially renamed. This appears in the breadcrumb as the final item and serves as the default value when entering edit mode";
|
|
15
17
|
ds:propertyType "text";
|
|
16
|
-
ds:
|
|
17
|
-
ds:
|
|
18
|
+
ds:constraints "Must be a non-empty string. Should follow the application's naming conventions for the specific resource type";
|
|
19
|
+
ds:optional "false"
|
|
18
20
|
], [
|
|
19
21
|
a ds:Property;
|
|
20
22
|
ds:name "parentItems";
|
|
21
23
|
ds:summary "Array of React elements representing the hierarchical breadcrumb path leading to the current resource. Each item typically contains links or text showing the navigation hierarchy";
|
|
22
24
|
ds:propertyType "list of nodes";
|
|
23
|
-
ds:
|
|
24
|
-
ds:
|
|
25
|
+
ds:constraints "Must be a non-empty array. Each element should represent a clickable or non-clickable breadcrumb item";
|
|
26
|
+
ds:optional "false"
|
|
25
27
|
], [
|
|
26
28
|
a ds:Property;
|
|
27
29
|
ds:name "isLoaded";
|
|
@@ -33,42 +35,42 @@ ds:apps_lxd.component.rename_header a ds:Component;
|
|
|
33
35
|
ds:name "relatedChip";
|
|
34
36
|
ds:summary "Optional chip or badge element displayed alongside the breadcrumb navigation to show additional context about the current resource (e.g., status, type, or relationship indicators)";
|
|
35
37
|
ds:propertyType "node";
|
|
36
|
-
ds:
|
|
37
|
-
ds:
|
|
38
|
+
ds:constraints "Accepts any ReactNode, typically small informational components like chips or badges";
|
|
39
|
+
ds:optional "true"
|
|
38
40
|
], [
|
|
39
41
|
a ds:Property;
|
|
40
42
|
ds:name "titleClassName";
|
|
41
43
|
ds:summary "Additional CSS class names to apply to the title container for custom styling or layout adjustments";
|
|
42
44
|
ds:propertyType "text";
|
|
43
|
-
ds:
|
|
44
|
-
ds:
|
|
45
|
+
ds:constraints "Must be valid CSS class names";
|
|
46
|
+
ds:optional "true"
|
|
45
47
|
], [
|
|
46
48
|
a ds:Property;
|
|
47
49
|
ds:name "centerControls";
|
|
48
50
|
ds:summary "Content displayed in the center area of the header when not in rename mode, typically used for contextual actions or status information";
|
|
49
51
|
ds:propertyType "node";
|
|
50
|
-
ds:
|
|
51
|
-
ds:
|
|
52
|
+
ds:constraints "Accepts any ReactNode. Hidden during rename operations to avoid layout conflicts";
|
|
53
|
+
ds:optional "true"
|
|
52
54
|
], [
|
|
53
55
|
a ds:Property;
|
|
54
56
|
ds:name "controls";
|
|
55
57
|
ds:summary "Primary action controls displayed on the right side of the header when not in rename mode, typically containing main page actions like edit, delete, or settings buttons";
|
|
56
58
|
ds:propertyType "node";
|
|
57
|
-
ds:
|
|
58
|
-
ds:
|
|
59
|
+
ds:constraints "Accepts any ReactNode. Only displayed when isLoaded is true and not in rename mode";
|
|
60
|
+
ds:optional "true"
|
|
59
61
|
], [
|
|
60
62
|
a ds:Property;
|
|
61
63
|
ds:name "renameDisabledReason";
|
|
62
64
|
ds:summary "When provided, disables the rename functionality and shows this message as a tooltip explanation for why renaming is not available (e.g., \"Insufficient permissions\" or \"Resource is read-only\")";
|
|
63
65
|
ds:propertyType "text";
|
|
64
|
-
ds:optional "true";
|
|
65
66
|
ds:constraints "Should be a clear, user-friendly explanation. When undefined, renaming is enabled";
|
|
67
|
+
ds:optional "true";
|
|
66
68
|
ds:defaultValue "undefined (renaming enabled)"
|
|
67
69
|
], [
|
|
68
70
|
a ds:Property;
|
|
69
71
|
ds:name "formik";
|
|
70
72
|
ds:summary "Formik form management object that handles the rename operation state, validation, and submission. Must conform to the RenameHeaderValues interface with name and isRenaming fields";
|
|
71
73
|
ds:propertyType "object";
|
|
72
|
-
ds:
|
|
73
|
-
ds:
|
|
74
|
+
ds:constraints "Must be FormikProps<RenameHeaderValues> object. Required for rename functionality to work. Values must include: name (string), isRenaming (boolean)";
|
|
75
|
+
ds:optional "true"
|
|
74
76
|
].
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
2
4
|
|
|
3
5
|
ds:apps_lxd.component.tab_links a ds:Component;
|
|
4
6
|
ds:name "TabLinks";
|
|
@@ -12,21 +14,21 @@ ds:apps_lxd.component.tab_links a ds:Component;
|
|
|
12
14
|
a ds:Property;
|
|
13
15
|
ds:name "tabs";
|
|
14
16
|
ds:summary "Array of tab definitions that can be either simple string labels or TabLink objects from canonical/react-components";
|
|
15
|
-
ds:
|
|
16
|
-
ds:
|
|
17
|
+
ds:constraints "Must contain at least one tab. When using strings, they will be automatically converted to URL-friendly slugs. When using TabLink objects, they must follow the canonical/react-components TabLink interface";
|
|
18
|
+
ds:optional "false"
|
|
17
19
|
], [
|
|
18
20
|
a ds:Property;
|
|
19
21
|
ds:name "tabUrl";
|
|
20
22
|
ds:summary "Base URL path for the tab navigation. Individual tabs will extend this URL with their slugified names (except the first tab which uses the base URL)";
|
|
21
|
-
ds:optional "false";
|
|
22
23
|
ds:constraints "Must be a valid URL path. Should not include trailing slash as tab paths are appended automatically";
|
|
24
|
+
ds:optional "false";
|
|
23
25
|
ds:propertyType "text"
|
|
24
26
|
], [
|
|
25
27
|
a ds:Property;
|
|
26
28
|
ds:name "activeTab";
|
|
27
29
|
ds:summary "The slug identifier of the currently active tab. Used to determine which tab should display as selected";
|
|
28
|
-
ds:optional "true";
|
|
29
30
|
ds:constraints "Must match the slugified version of a tab name or the id of a TabLink object. If not provided, the first tab becomes active by default";
|
|
31
|
+
ds:optional "true";
|
|
30
32
|
ds:propertyType "text";
|
|
31
33
|
ds:defaultValue "First tab in the tabs array"
|
|
32
34
|
], [
|
package/data/apps_lxd.ttl
CHANGED
package/data/apps_notary.ttl
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:apps_portal.layout.details_view a ds:Layout;
|
|
6
|
+
ds:name "Details view";
|
|
7
|
+
ds:summary "The Details view is the deepest level of navigation, the page for a single object or topic (a token, a user, an order). It sits at the end of a drill-down: a table, or list, or dashboard names a group of objects, the Details view shows everything about one and is where all actions on that thing live. \n \nUse it when a subject has more attributes, settings, or actions than a table row can hold. It groups those into labelled sections (identity, configuration, related resources) so people can read the full state of one entity and act on it in place. If you only need to compare or scan many items, use a list or table instead, reach for a Details view when the user has already chosen which *one*.";
|
|
8
|
+
ds:anatomyDsl "";
|
|
9
|
+
ds:anatomyClassic "TODO figma file in contribution folder\n\nhttps://www.figma.com/design/w6M9LWWabRp66iDFqUderB/26.10-Details-view---Design-system-contributions--Copy-?node-id=1-8";
|
|
10
|
+
ds:usage "# General description\n\nA Details view presents a single entity across stacked sections. Each section pairs a label column with its content and keeps its own actions nearby, so the page reads top-to-bottom as \"here's what this is, here's how it's configured, here's what you can do”. On the eight column layout, the labels occupy the first two columns, main content takes the four columns in the middle, and actions are placed in the last two columns.\n\n# When to use\n\n- A subject has enough attributes, settings, or actions that a table row can't hold them.\n- The user has drilled in from a table or list and needs the full picture of one item.\n- Actions are scoped to this entity (edit details, rename, delete) rather than to a set.\n\n# When not to use\n\n- You're showing many comparable items, use a list or table so people can scan and compare.\n- The object has less than two sections of fields and a single action, use a panel to avoid a full page navigation.\n\n# Guidelines\n\n- One action button per section. One primary button per view, the rest are secondary buttons. If multiple details can be changed, open a panel.\n- Inline actions (like in tables per row) is fine \n- Inline tables may require variations depending on complexity. \n - Simple tables can stay in the middle four columns, or span also the right two columns, depending the number of table columns.\n - If a table involves significant number of attributes, interaction or pagination, it may be better to use a separate tab, within the page connected to the subject.\n\n";
|
|
11
|
+
ds:guidelines "";
|
|
12
|
+
ds:tier ds:apps_portal;
|
|
13
|
+
ds:changeLog [
|
|
14
|
+
a ds:ChangeLogEntry;
|
|
15
|
+
ds:timestamp "2026-08-20T00:00:00.000+02:00";
|
|
16
|
+
ds:change "initial documentation of a found template for a layout";
|
|
17
|
+
ds:changeType "decision"
|
|
18
|
+
].
|
package/data/apps_portal.ttl
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:apps_support.component.data_spotlight a ds:Component;
|
|
6
|
+
ds:name "Data spotlight";
|
|
7
|
+
ds:summary "";
|
|
8
|
+
ds:anatomyDsl "";
|
|
9
|
+
ds:anatomyClassic "";
|
|
10
|
+
ds:usage "";
|
|
11
|
+
ds:guidelines "";
|
|
12
|
+
ds:tier ds:apps_support.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:apps_support.subcomponent.ai_prompt_input a ds:Subcomponent;
|
|
6
|
+
ds:name "AI prompt input";
|
|
7
|
+
ds:summary "";
|
|
8
|
+
ds:anatomyDsl "";
|
|
9
|
+
ds:anatomyClassic "";
|
|
10
|
+
ds:usage "";
|
|
11
|
+
ds:guidelines "";
|
|
12
|
+
ds:tier ds:apps_support.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:apps_workplaceengineering.component.complex_multi_select a ds:Component;
|
|
6
|
+
ds:name "Complex multi select";
|
|
7
|
+
ds:summary "";
|
|
8
|
+
ds:anatomyDsl "";
|
|
9
|
+
ds:anatomyClassic "";
|
|
10
|
+
ds:usage "";
|
|
11
|
+
ds:guidelines "";
|
|
12
|
+
ds:tier ds:apps_workplaceengineering;
|
|
13
|
+
ds:parentComponent ds:apps_workplaceengineering.component.label-highlight.
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
2
4
|
|
|
3
5
|
ds:apps_workplaceengineering.component.label-highlight a ds:Component;
|
|
4
6
|
ds:name "Label.Highlight";
|
|
@@ -8,7 +10,7 @@ ds:apps_workplaceengineering.component.label-highlight a ds:Component;
|
|
|
8
10
|
ds:usage "Usage example (WIP UI as per 19 feb 2026): \n\n\n\n\n\n";
|
|
9
11
|
ds:guidelines "";
|
|
10
12
|
ds:tier ds:apps_workplaceengineering;
|
|
11
|
-
ds:hasSubcomponent ds:apps_workplaceengineering.component.label-highlight;
|
|
13
|
+
ds:hasSubcomponent ds:apps_workplaceengineering.component.label-highlight, ds:apps_workplaceengineering.component.complex_multi_select;
|
|
12
14
|
ds:changeLog [
|
|
13
15
|
a ds:ChangeLogEntry;
|
|
14
16
|
ds:timestamp "2026-02-19T00:00:00.000+01:00";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:apps_workplaceengineering.pattern.confirmation_modal a ds:Pattern;
|
|
6
|
+
ds:name "ConfirmationModal";
|
|
7
|
+
ds:summary "";
|
|
8
|
+
ds:anatomyDsl "";
|
|
9
|
+
ds:anatomyClassic "";
|
|
10
|
+
ds:usage "";
|
|
11
|
+
ds:guidelines "";
|
|
12
|
+
ds:tier ds:apps_workplaceengineering.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:apps_workplaceengineering.subcomponent.multi_select_input a ds:Subcomponent;
|
|
6
|
+
ds:name "MultiSelectInput";
|
|
7
|
+
ds:summary "\n\nA MultiSelect input that allows selection (and selection clearing) over a group of options.\n\n\n\nThis is proposed within Workplace tier first as none of the current React form components support the combobox behavior shown in the design mock above.\n\nWe could adapt the [Launchpad Combobox component](https://ds-svelte-global.canonical.com/?path=/story/components-combobox--in-a-popover). \n\n\n\n";
|
|
8
|
+
ds:anatomyDsl "";
|
|
9
|
+
ds:anatomyClassic "";
|
|
10
|
+
ds:usage "";
|
|
11
|
+
ds:guidelines "";
|
|
12
|
+
ds:tier ds:apps_workplaceengineering.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:concept.Foundations-Baseline a ds:Concept;
|
|
6
|
+
ds:name "Foundations: Baseline";
|
|
7
|
+
ds:summary "This document covers the 4px baseline grid every piece of text in the form system seats itself on: what the grid unit is, how a line of text is placed on it from the font's own metrics, why the placement holds at any font size without per-element tuning, and how control text is kept from drifting off it.";
|
|
8
|
+
ds:tier ds:global;
|
|
9
|
+
ds:content "**Status:** Final \n**Version:** 1.0 \n**Last updated:** 2026-09-11 \n**Source:** `@canonical/react-ds-global-form` Storybook guide — _The Baseline Grid_\n\n\nEvery piece of text in the form system seats itself on a shared 4px baseline\ngrid. A control's label, an input's value, and a paragraph of running prose all\nland their baselines on the same set of horizontal lines, so a form reads as one\ncontinuous rhythm rather than a stack of independently-spaced boxes. This guide\nexplains what the grid is, how text is placed on it, and why the placement holds\nat any font size without per-element tuning.\n\nFor how to _apply_ densities and drive the form's spacing from them, see\n**Density & the Form Channel**.\n\n## The grid unit\n\nThe grid is defined by a single custom property, `--baseline-height`, which the\ntypography engine sets to **4px** (`0.25rem`). Everything vertical is expressed\nas a whole multiple of this unit — a control height, a gap between fields, the\npadding that seats a line of text. Because the unit is a variable, the whole\nsystem re-flows if it changes; nothing hard-codes `4px`.\n\nThroughout this documentation, spacing is quoted in **baseline units** (bU): 1 bU\n= `--baseline-height` = 4px. A 32px control is \"8 bU\"; a 24px gap is \"6 bU\".\n\n## How a line of text seats on the grid\n\nA font does not place its baseline at the top or bottom of its line box — it sits\nsome fraction of the way down, determined by the font's metrics. To land that\nbaseline on a grid line, the system adds a calculated top padding.\n\nThe distance from the top of a `line-height: 1` box to the text baseline is\napproximated, font-relatively, as:\n\n\\`\\`\\`css\n--natural-baseline: calc((1em + 1cap) / 2);\n\\`\\`\\`\n\n`1cap` is the cap height of the current font, `1em` its size. The average of the\ntwo is a close, size-independent stand-in for where the alphabetic baseline sits\n— no magic pixel constant, and correct at any font size because both terms scale\nwith the font. That size-independence is the entire reason for the cap-unit form:\na naive implementation would hard-code a pixel offset per font size and break the\nmoment the size changed; this expression tracks the font automatically.\n\nThe text is then seated on a chosen grid line — the **target baseline** — by\npadding the top with the remaining distance:\n\n\\`\\`\\`css\n--space-before: max(0px, calc(target − --natural-baseline − border-top));\npadding-block-start: var(--space-before);\n\\`\\`\\`\n\nThe result: the first baseline lands exactly on `target`, which is always a whole\nbaseline multiple, so the text is on the grid.\n\n## A worked example\n\nTake **apps-comfortable**, the default cell. Its control height is a whole\nbaseline multiple:\n\n\\`\\`\\`\ncontrol-height = --baseline-height × 8 = 32px (8 bU)\n\\`\\`\\`\n\nThe density model seats a control's single baseline on its **target line**, which\nis two-thirds of the box height, rounded to the _nearest_ baseline:\n\n\\`\\`\\`\ntarget = round(nearest, control-height × 2/3, --baseline-height)\n = round(nearest, 32 × 2/3, 4)\n = round(nearest, 21.33px, 4)\n = 20px (5 bU)\n\\`\\`\\`\n\nRounding to the nearest line (not up) is deliberate. Two-thirds of the height is\nthe optical centre a control's text wants; snapping to the _nearest_ grid line\nstays as close to it as the grid allows. An earlier revision rounded _up_, which\nover-lifted the one cell where `height × 2/3` is fractional — apps-comfortable's\n21.33 was forced a whole step down the page to 24, a baseline too low (the\ndesign-review \"move text one baseline up\" finding). The exact-multiple cells are\nunaffected either way:\n\n\\`\\`\\`\napps-comfortable 32 × 2/3 = 21.33 → 20 (the fix; was 24)\napps-dense 24 × 2/3 = 16.00 → 16 (exact)\nsites-comfortable 36 × 2/3 = 24.00 → 24 (exact)\nsites-dense 28 × 2/3 = 18.67 → 20 (nearest = up here)\n\\`\\`\\`\n\nNow seat a 14px label into that box. With a cap height of roughly 10px for the\nbody face:\n\n\\`\\`\\`\nnatural-baseline = (1em + 1cap) / 2 = (14 + 10) / 2 = 12px\nspace-before = max(0px, 20 − 12 − border-top)\n\\`\\`\\`\n\nFor a borderless label (`border-top = 0`) that is `20 − 12 = 8px` of top\npadding, and the baseline lands exactly on the 5th grid line. Change the font\nsize and both terms move together, so the arithmetic still lands on `20px` — the\ntarget never has to be re-tuned per size.\n\nThe stories below force the baseline overlay on, so this seating can be read\ndirectly: the label's baseline and the input's baseline both rest on the same\npink band boundary.\n\n_(An interactive example accompanies this section in Storybook.)_\n\n## The whole-multiple invariant\n\nThe single rule that keeps _multi-line_ content on the grid:\n\n> A line-height that must stay on the grid has to be a whole multiple of\n> `--baseline-height`.\n\nThe first line seats on the grid via `--space-before` (above). Each subsequent\nline advances by exactly one `line-height`. So every wrapped line lands on a grid\nline **if and only if** the line-height is itself a whole baseline multiple. A\nsingle-line control can use any line-height (only its first baseline matters); a\nparagraph or a textarea cannot — its line-height must be snapped to the grid.\n\nThe typography engine already guarantees this for prose: it computes each tier's\nline-height as `round(up, font-size × ratio, --baseline-height)`, a snapped\nvalue. A `1rem × 1.5` body line snaps to `24px` — exactly 6 bU — so running text\nstays on the grid line after line. This is also why the textarea, alone among the\nform controls, takes the density line-height (a whole multiple) rather than the\n`line-height: 1` crush: it has many rows, and every row must land on a grid line,\nnot just the first.\n\n## Two ways text reaches the grid\n\nThe system seats text through two distinct mechanisms, applied to two disjoint\nsets of elements. Knowing which owns a given element is the key to the whole\nmodel.\n\n- **Controls** — seated by the **density model** on the density _target_ line\n (`round(nearest, height × 2/3, baseline)`, as worked above). This is what\n makes a 32px button's label and a 32px input's value share one line. Boxed\n controls (the button, the single-line input) use the **intrinsic seat**\n described below — their text carries a real line box that _is_ the control\n interior. The field label / description / error, which are bare text rather\n than boxes, use the simpler `line-height: 1` crush + `--space-before` pad.\n\n- **Running prose** — bare `p`, `h1`–`h6`, and anything in an `.editorial`\n context. These are seated by the **typography engine**: each keeps its tier's\n snapped natural line-height and is nudged onto the _nearest_ grid line (via the\n engine's `--start-nudge` / `--end-nudge`), so multi-line reading rhythm is\n preserved and every wrapped line stays on-grid.\n\nThe two never fight over the same element. Density seats controls; the engine\nseats prose. Because they write to **disjoint** element sets, there is no\nspecificity war between them — a point returned to below. A paragraph placed next\nto a control will sit on _a_ grid line, but not necessarily the control's target\nline — controls and prose answer to different seating rules by design.\n\n## The intrinsic control seat\n\nA boxed control (the button, the single-line input chrome) does **not** set a\nheight. Its height _emerges_: the text's own line box is the control interior,\nand border + padding + line-height add up to exactly the density cell.\n\nThe shared styles layer (`@canonical/styles`, `modifiers.density.css`) exports\ntwo pieces:\n\n\\`\\`\\`css\n/* The control's interior line box: the cell minus one baseline of headroom\n per side. 32px cell → 24px line; 24px cell → 16px line. */\n--control-seat-line: calc(\n var(--density-line-height-effective) - 2 * var(--baseline-height)\n);\n/* The unclamped distance from just inside the box's top border down to the\n target baseline, for a --control-seat-line line box. */\n--control-seat-basis: calc(\n var(--density-target-baseline-px) - (var(--control-seat-line) + 1cap) / 2\n);\n\\`\\`\\`\n\nEach control folds its **own** border into that basis and closes the box with a\ncomplement pad — the fold must happen at the component, because a `var()` inside\na custom property is substituted where the property is _declared_ (the density\nscope), so the shared layer can never read a component's border width:\n\n\\`\\`\\`css\n--seat-before: round(\n nearest,\n max(0px, calc(var(--control-seat-basis) - <border-width>)),\n 0.25px\n);\n--seat-after: max(0px, calc(\n var(--density-line-height-effective) - var(--control-seat-line) -\n var(--seat-before) - 2 * <border-width>\n));\nline-height: var(--control-seat-line);\npadding-block: var(--seat-before) var(--seat-after);\n\\`\\`\\`\n\nThe invariant: `border + seat-before + line + seat-after + border = the cell`,\nwith no `block-size` anywhere. Both outer edges land on grid lines, and the text\nbaseline lands on the target — at any font size, because `1cap`/`1em` resolve at\nthe element that applies the seat. (`--seat-before` is rounded to ¼px so the pad\nis exactly representable in the browser's 1/64px layout units; the fractional\ncap term otherwise leaves ~1/60px residues on the box height.)\n\n## The border is always present\n\nFor the geometry above to be _one_ formula, the border must be a **constant** of\nthe control, not a variant knob: every importance carries the same nominal\nborder width, and a \"borderless\" variant paints it `transparent` rather than\nremoving it. The button implements exactly this — its outline flag toggles the\nborder's **colour**, never its width:\n\n\\`\\`\\`css\nborder-width: var(--button-border-width); /* constant, both importances */\nborder-color: color-mix(in srgb,\n var(--modifier-color-border) calc(var(--modifier-outline, 0) * 100%),\n transparent);\n\\`\\`\\`\n\nA width-toggled border (an earlier revision multiplied the width by the flag)\nmakes the borderless variant 2px shorter and seats its label a pixel high — the\nbox geometry forks per importance, which is precisely what the constant border\nexists to prevent. A borderless primary and a bordered secondary are now\nbyte-identical boxes; only the paint differs. The example below places the two\nside by side against the overlay.\n\n_(An interactive example accompanies this section in Storybook.)_\n\n## Why not just set `line-height: 1` everywhere?\n\nCrushing everything to `line-height: 1` seats the _first_ line of any element on\nthe grid, which is why an earlier iteration did exactly that. But it breaks\nrunning prose two ways: it removes the leading that makes multi-line text\nreadable, and — because a crushed line-height is not a whole baseline multiple —\nit lets every _wrapped_ line drift off the grid.\n\nThe first fix (call it \"Stage A\") was to **partition** the two mechanisms:\ndensity seats controls only, and the typography engine owns prose. Because the\ntwo now write to disjoint element sets, `.editorial` composes with density\nwithout a specificity war, and — since the engine snaps prose line-height to a\nwhole baseline multiple — wrapped-prose drift is gone as well.\n\nThe second (\"Stage B\", the intrinsic seat above) retired the crush from the\n**boxed** controls too: the button and the single-line input now carry a real\nline box (`--control-seat-line`) instead of `line-height: 1` + a fixed box\nheight. The crush survives only on the field label / description / error — bare\nsingle-line text where it is harmless — and even there it is an implementation\ndetail of their seat, not a box model.\n\n## The \"control text drift\", solved\n\nEarlier revisions carried an empirical knob, `--control-text-drift-AVOID-USAGE`\n(~2px), to explain why a native `<input>` rendered its text lower than a\n`<span>` at byte-identical CSS. The intrinsic seat exposed the real mechanism —\nit was never a metrics quirk of editable controls:\n\n> **The user agent enforces a `line-height` floor of `normal` (≈1.2em) on a\n> single-line `<input>`.** A specified line-height below the floor is silently\n> clamped.\n\nUnder the old `line-height: 1` crush, the input's 14px line was silently\nrendered as a 16.8px line — the extra 2.8px of half-leading pushed the glyphs\ndown, and the \"drift\" knob was hand-calibrated to cancel a clamp nobody had\nidentified. Give the input a **real** line box (the intrinsic seat's\n`--control-seat-line`, ≥ the floor in the comfortable cells) and it positions\ntext exactly like a `<span>`: measured, the input's baseline lands on the\nlabel's to within 0.01px with **no** drift term.\n\nThe floor still exists, so the input's seat computes with the line the UA will\nactually use:\n\n\\`\\`\\`css\n--seat-line-floored: max(var(--control-seat-line), 1.2em);\n\\`\\`\\`\n\nIn dense cells (16px line < 16.8px floor) the clamped line is what enters both\nthe seat and the closing pad, so the box still lands on the cell. The knob\nsurvives only on the textarea path, pending the same treatment — expect it to be\nthe same artifact.\n\n## The debug overlay\n\nThe Storybook baseline overlay (the stepped pink bands) is driven by the same\n`--baseline-height`, so it always draws the real grid. Turn it on to read any\nelement against the grid: a correctly-seated baseline sits on a band boundary.\nThe overlay is a measuring tool only — it is never part of a shipped component.\nThe example stories above enable it automatically, which is why their controls\nappear striped.";
|
|
10
|
+
ds:knownEdgeCases "";
|
|
11
|
+
ds:conceptType ds:concepttype.Explanation.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:concept.Foundations-Density--the-form-channel a ds:Concept;
|
|
6
|
+
ds:name "Foundations: Density & the form channel";
|
|
7
|
+
ds:summary "This document covers density as a 2x3 matrix of context and density, applied as two classes on an ancestor rather than per control: how a cell is read, how density reaches the form through the cascade, why the layering direction matters, and how gaps and control heights follow.";
|
|
8
|
+
ds:tier ds:global;
|
|
9
|
+
ds:content "**Status:** Final \n**Version:** 1.0 \n**Last updated:** 2026-09-11 \n**Source:** `@canonical/react-ds-global-form` Storybook guide — _Density & the Form Channel_\n\n\nDensity controls how tightly a form is packed: the height of its controls, the\npadding inside them, and the gaps between fields. It is a small, composable\nmodel — two class families on an ancestor — that resolves to a set of generic\nspacing primitives, which the form then maps onto its own tokens. Everything it\nproduces is a whole baseline multiple, so a denser form is still on the grid.\n\nFor the underlying grid and how text seats on it, read\n**The Baseline Grid**\nfirst.\n\n## The 2×3 matrix\n\nDensity is a matrix of two axes:\n\n- **Context** — `.app` / `.site` / `.docs` — the _surface_. `docs` shares its\n values with `site`. A site or docs surface runs one baseline looser than an\n app surface.\n- **Density** — `.comfortable` / `.dense` — the _tightness_ within a context.\n\nApply one class from each axis on an ancestor (the app root, or the Storybook\ntoolbar in this workspace). With no class, a form keeps its plain defaults.\n\nThe matrix, in baseline units (1 bU = `--baseline-height` = 4px):\n\n\\`\\`\\`\n app site / docs\n comfy dense comfy dense\n line-height 32 (8) 24 (6) 36 (9) 28 (7)\n padding-inline 16 (4) 8 (2) 16 (4) 12 (3)\n space-lg 40 (10) 32 (8) 44 (11) 36 (9) ← between fields\n space-md 8 (2) 4 (1) 8 (2) 8 (2) ← label → control\n space-sm 8 (2) 4 (1) 8 (2) 8 (2) ← desc/error → input\n space-xs 4 (1) 4 (1) 4 (1) 4 (1) ← label → description\n\\`\\`\\`\n\nContext sets the `*-comfy` / `*-dense` pair for every value; density picks within\nit. Every cell is a whole baseline multiple, so vertical rhythm holds in all four\ncombinations.\n\n### Reading one cell\n\nTake **site / dense**. The context is `.site`, so it runs one baseline looser\nthan an app; the density is `.dense`, so it picks the `*-dense` half of each of\nthe site's pairs. Read straight down that column:\n\n- **line-height** — 28px, so a control is a 7 bU box (`--baseline-height * 7`).\n- **padding-inline** — 12px = 3 bU of inline padding inside the control and on\n the horizontal label↔input gap.\n- **space-lg** — 36px = 9 bU between one field and the next.\n- **space-md** — 8px = 2 bU from a field's label down to its control.\n- **space-sm** — 8px = 2 bU from a description or error across to the input.\n- **space-xs** — 4px = 1 bU from a field's label down to a leading description.\n\nCompare that to **app / dense** one baseline tighter: the box is 24px (6 bU), the\ninline padding drops to 8px (2 bU), and the label→control / desc→input gaps\ntighten to 4px. The site column never goes below its 8px `space-md`/`space-sm` —\na site stays a touch airier than an app even when dense.\n\n## How to apply density\n\nDensity is two classes on an **ancestor**, not on each control. Put one context\nclass and one density class on a wrapper and every control beneath it sizes and\nseats to that cell:\n\n\\`\\`\\`jsx\n// site / dense — a moderately loose surface, packed tight.\n<div className=\"site dense\">\n <Form>\n <Field name=\"email\" label=\"Email\">\n <TextInput name=\"email\" />\n </Field>\n <Field name=\"role\" label=\"Role\">\n <Select name=\"role\" options={roles} />\n </Field>\n <Button importance=\"primary\">Save</Button>\n </Form>\n</div>\n\\`\\`\\`\n\nThe wrapper carries `.site .dense`; the `Form`, `Field`s and `Button` inside it\ninherit the cell through the cascade. Swap the two classes on the wrapper and the\nwhole form retunes — nothing on the controls changes. In this workspace the\nStorybook toolbar sets the two classes globally so an unwrapped story still has a\ncell; the examples below instead wrap each row in an explicit `.app .comfortable`\n(etc.) so they pin one named cell regardless of the toolbar.\n\n_(An interactive example accompanies this section in Storybook.)_\n\nComfortable is the 32px (8 bU) box; dense drops it to 24px (6 bU). The label text\nstill lands on a grid line in both rows — the seat is computed against the box, so\nit holds as the height changes.\n\n## Context: one baseline looser\n\nThe **context** axis is the surface, and its whole job is to run a site or docs\nsurface one baseline looser than an app. At the same `.comfortable` density an app\ncontrol is 32px (8 bU) and a site control is 36px (9 bU): the extra 4px is the one\nbaseline of headroom that makes a marketing or docs surface breathe. Every rung\nbelow the height lifts to match, so the looser surface is looser everywhere, not\njust taller.\n\n_(An interactive example accompanies this section in Storybook.)_\n\n## How density flows to the form\n\nThe model is layered so each layer knows only about the one below it:\n\n1. **Context classes** set raw pairs — `--density-lh-comfy` / `--density-lh-dense`,\n `--density-pad-inline-comfy` / `--density-pad-inline-dense`, and the three\n vertical rungs `--density-space-{sm,md,lg}-comfy` / `-dense`. (The pre-namespace\n bare names — `--lh-comfy` etc. — remain as back-compat aliases.)\n2. **Density classes** pick within each pair and expose _generic, domain-neutral_\n primitives: `--density-line-height`, `--density-padding-inline`, and\n `--density-space-{sm,md,lg}`. This layer knows nothing about \"form\" or\n \"field\".\n3. **The form** maps its own tokens onto those primitives — this is the only\n place a field concept meets a density value:\n\n\\`\\`\\`css\n--form-input-padding-inline: var(--density-padding-inline); /* inline */\n--form-field-inline-gap: var(--density-padding-inline); /* inline */\n--form-field-block-gap: var(--density-space-lg); /* between fields */\n--form-field-label-gap: var(--density-space-md); /* label → control */\n--form-group-gap: var(--density-space-sm); /* desc/error → input */\n--form-field-label-description-gap: var(--density-space-xs); /* label → description */\n\\`\\`\\`\n\n### Why the layering direction matters\n\nDensity is the lower layer and must **never** reference a `--form-*` token; the\nform reaches _down_ to density, never the reverse. This is not a style\npreference — it is what keeps density reusable and keeps the two layers from\ndeadlocking.\n\nConcretely, imagine the arrow reversed: the density layer setting\n`--density-space-lg: var(--form-field-block-gap)`. Now density is defined in terms\nof a form concept, so density can no longer size anything that is not a form —\nand the form maps `--form-field-block-gap` back onto `--density-space-lg`, so the\ntwo tokens each resolve to the other and the value collapses to nothing. Keeping\ndensity domain-neutral (it only ever emits `--density-*` primitives) means the\nsame layer can one day seat a toolbar, a list row or an Accordion header with no\nform in sight. If a new density-driven spacing is needed, add a primitive to the\ndensity layer and map it in the form — do not reach upward from density.\n\n## Gaps are split by axis\n\nThe form's gap tokens are separated by direction so a density tier can tune each\naxis independently, and so a token's name never lies about its axis:\n\n- **Block (vertical):** `--form-field-block-gap`, `--form-field-label-gap`,\n `--form-group-gap`.\n- **Inline (horizontal):** `--form-field-inline-gap`.\n\n`--form-field-inline-gap` is horizontal only. The vertical label-to-control gap\nis `--form-field-label-gap` — a dedicated block token, not the inline one.\n\nThis split fixes a concrete trap. An earlier version had a single inline token\ndoing double duty: it set the horizontal label↔input gap _and_ was borrowed as a\nvertical `row-gap` for the stacked label-over-control layout. So the moment that\ntoken was retuned to fix horizontal spacing, the vertical gap moved with it —\none edit dragged both axes at once, and there was no way to nudge one without\ndisturbing the other. Giving the vertical gap its own block token\n(`--form-field-label-gap`) means each axis is now tuned in isolation.\n\n## Control height\n\nA density control's height is **intrinsic**: no `block-size` anywhere. The\ncontrol's text carries an interior line box (`--control-seat-line`, the cell\nminus one baseline of headroom per side), a seat pad lands its baseline on the\ndensity _target_ — `round(nearest, height × 2/3, --baseline-height)` — and a\ncomplement pad closes the box so border + pads + line-height add up to\n**exactly** the density cell (32px apps-comfortable, 24px apps-dense, …). Text\nat any font size lands on the grid, and the height is a result, not an input.\nSee **The Baseline Grid**\nfor the full formula.\n\n_(An interactive example accompanies this section in Storybook.)_\n\nA borderless importance (e.g. a primary button) and a bordered one (a\nsecondary) are the same height and seat **identically**, because the border is\na **constant of the control**: every importance carries the same nominal border\nwidth, and the borderless variant paints it `transparent` rather than removing\nit (the outline flag toggles the border's colour, never its width). The\nhistory of getting here is instructive — first the seat subtracted the border\nonly when rendered (the borderless primary sat a pixel high), then a nominal\nsubtraction papered over a width-toggled border (under intrinsic height the\nprimary came out 2px _shorter_). Both bugs had one root: per-importance\ngeometry. The constant border removes the fork entirely.\n\n## Composition: density and running prose\n\nDensity seats **controls**. It does not touch **running prose** — bare `p`,\n`h1`–`h6`, or anything in an `.editorial` context. Those keep their engine-owned\nsnapped line-height and inter-block margins.\n\nThis is the rule that lets a density scope and `.editorial` prose _nest_ without\nconflict — for example a density-sized header above an `.editorial` content\npanel (the future Accordion case). Because density and the typography engine\nwrite to disjoint element sets, there is no specificity war and no override: each\nsystem owns its own elements. An earlier attempt to have density crush prose to\n`line-height: 1` fought the engine and only ever landed the _first_ line on the\ngrid — wrapped lines drifted. Partitioning prose out removed that fight entirely.\n\nPractically:\n\n- Put controls (buttons, inputs, field labels) inside a density scope — they size\n and seat to the density.\n- Let running prose be plain `p` / `h*` or wrap it in `.editorial` — it keeps its\n reading rhythm and stays on the grid, whether or not it sits inside a density\n scope.\n- Do **not** try to make density seat a paragraph. If a text reference must line\n up with controls (as the spike testbed does for its measuring lead), seat that\n one element explicitly; do not change how prose ships.\n\n## A former rough edge, resolved\n\nEarlier revisions lifted native form controls by an empirical ~2px knob\n(`--control-text-drift-AVOID-USAGE`) because an `<input>` rendered its text\nlower than a `<span>` at identical CSS. The intrinsic seat exposed the real\nmechanism: the user agent enforces a `line-height` floor of `normal` (≈1.2em)\non single-line `<input>`s, and the old `line-height: 1` crush was being\nsilently clamped — the \"drift\" was the clamp's extra half-leading. With a real\nline box the input renders exactly like a `<span>`; where the interior line\nwould dip below the floor (dense cells) the seat computes with the floored\nvalue (`max(--control-seat-line, 1.2em)`). The knob is deleted. See\n**Seating by Element Type**\nfor the full account.";
|
|
10
|
+
ds:knownEdgeCases "";
|
|
11
|
+
ds:conceptType ds:concepttype.Explanation.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:concept.Foundations-Grid--Layout a ds:Concept;
|
|
6
|
+
ds:name "Foundations: Grid & Layout";
|
|
7
|
+
ds:summary "This document covers the horizontal grid system: column counts, column spans, gutters, outer margins, and layout strategy per tier.\n\n- Column structure and bisection rule\n- Gutter and outer margin values per tier and breakpoint\n- Viewport-based vs container-based grid contexts\n- Drawer and panel sizing (applications)\n- Nested grid alignment\n- When to use the grid vs other layout primitives";
|
|
8
|
+
ds:tier ds:global;
|
|
9
|
+
ds:content "**Status:** Final \n**Version:** 1.0 \n**Last updated:** 2026-04-24\n\n\n\n## Table of contents\n\n1. [Glossary](#glossary)\n2. [Problem statement and scope](#1-problem-statement-and-scope)\n3. [Core principles (universal)](#2-core-principles)\n4. [Editorial and marketing sites](#3-editorial-and-marketing-sites)\n5. [Documentation](#4-documentation)\n6. [Applications](#5-applications)\n7. [Responsive reflow](#6-responsive-reflow)\n8. [When to use the grid](#7-when-to-use-the-grid)\n9. [Form layouts](#8-form-layouts)\n10. [Future work](#9-future-work)\n\n\n\n## Glossary\n\nTable 21\n\n\n\n## 1. Problem statement and scope\n\n### 1.1 The problem\n\nOur design system serves three tiers:\n\n- [Apps](https://docs.superhuman.com/d/_dNyzE_TLZDh#_tugrid-KdW0T6RE3B/_rui-mWBJDa-kOF) **:** Application UIs – dashboards, forms, settings pages, admin panels (MAAS, Landscape, Launchpad, Snapcraft, support portal, and ~50 other products)\n- [Sites](https://docs.superhuman.com/d/_dNyzE_TLZDh#_tugrid-KdW0T6RE3B/_rui-T4g_fD6A91) : Editorial / marketing sites – [ubuntu.com](http://ubuntu.com), [canonical.com](http://canonical.com), blog content\n- [Documentation](https://docs.superhuman.com/d/_dNyzE_TLZDh#_tugrid-KdW0T6RE3B/_rui-RHPOgKqlyQ) **Docs:** Product documentation\n\nThese tiers have different grid needs. Application UIs require multiple concurrent grid contexts (main content alongside drawers, panels, and toolbars) with fluid, edge-to-edge layouts. Editorial and marketing sites use a single centered grid with a maximum content width and wider gutters that give editorial content more breathing room. Documentation shares the editorial grid model but typically uses narrower content columns with side navigation.\n\nA single grid configuration does not serve all three well. This document defines the shared column system and the per-tier rules built on top of it.\n\n### 1.2 Scope\n\nThis specification covers the horizontal grid system: column counts, column spans, gutters, outer margins, and layout strategy per tier.\n\n- Column structure and bisection rule\n- Gutter and outer margin values per tier and breakpoint\n- Viewport-based vs container-based grid contexts\n- Drawer and panel sizing (applications)\n- Nested grid alignment\n- When to use the grid vs other layout primitives\n\nOut of scope:\n\n- Vertical spacing and baseline grid (see the [spacing specification](https://coda.io/d/Docs_dTaVNZxkPrA/Spacing-architecture-0-4_su8_Tyhn#Table-11_turSlbF2))\n- Typography specification (referenced where relevant)\n- Implementation details (CSS architecture, component APIs, tooling)\n\n### 1.3 Goals\n\n1. **Predictability:** Grid behaviour is deterministic and learnable across all tiers\n2. **Visual coherence:** Shared column counts and bisection rule produce consistent keylines everywhere\n3. **Tier fit:** Each tier uses the grid model best suited to it\n4. **Composability:** Components placed on the grid in one tier work correctly when reused in another\n\n\n\n## 2. Core principles\n\nThese apply universally across all three tiers.\n\n### 2.1 Column counts\n\nColumn counts are determined by **container width** (applications) or **viewport width** (sites and documentation):\n\nTable 22\n\nThe two 8-column ranges are intentionally separate. Both use the same column count, but the breakpoint between them gives components a second threshold at which to switch layout – for example from stacked to side-by-side – within the mid-range.\n\n**Rationale for 240px minimum**: This is our current default minimum aside width, below which content truncation becomes excessive. It accommodates the minimum comfortable width for form fields, navigation items, and side panels.\n\n**Rationale for column counts**: We intentionally use only 4, 8, or 16 columns to create a structure where keylines either bisect spaces or follow parent keylines. This avoids the awkward offset-by-1 alignment issues that occur with 12-column grids (which permit thirds), and the column rivers that appear when the browser is left to choose a count freely. \n\n\n\n*Order emerging from restraint: 8 column grid with disciplined subdivision on the right compared to a 12 column grid with no restrictions.*\n\n### 2.2 Column span rule\n\nValid spans are power-of-2 fractions of the current column count – half, quarter, or eighth:\n\nTable 23\n\nThis allows uniform rows (e.g. four 2-column-wide cards on an 8-column grid) and the standard 50/50 or 25/75 two-part splits. It disallows thirds and any other non-bisecting division – the same principle that drove the move from 12-column to 8-column grids across the Canonical web portfolio.\n\n### 2.3 Gutter widths and outer margins\n\nGutters and outer margins are set by the **global viewport breakpoint**, not by container width. The tiers share the same values at small viewports but diverge at larger sizes – editorial sites and documentation use wider gutters for the more generous rhythm that content-heavy pages need.\n\n**Sites and documentation:**\n\nTable 24\n\n**Applications:**\n\nTable 25\n\nThe difference is at Large and X-Large: sites and documentation step up to 2rem (32px) gutters, while applications stay at 1.5rem (24px). Application interfaces are denser – tighter gutters give more room to data-heavy content, panels, and multi-column controls. Sites have more breathing room by design, so the wider gutter matches the editorial rhythm.\n\n### 2.4 Nested grids\n\n**All nested grids follow their parent container’s grid structure.** When a component establishes a grid within a parent grid cell, columns can only start at parent column offsets. This creates consistent vertical keylines throughout the interface.\n\nNo column is allowed to start anywhere except at parent column offsets. The grid subdivides through bisection (octree pattern), maintaining alignment at every nesting level.\n\n\n\n\n\n## 3. Editorial and marketing sites\n\nEditorial and marketing sites ([ubuntu.com](http://ubuntu.com), [canonical.com](http://canonical.com), blog content) use a single, viewport-based grid.\n\n### 3.1 Viewport-based grid\n\nThe full page width minus outer margins forms one grid context. There are no independent sub-grids for drawers or panels – the viewport is the only trigger for column count changes. Column count switches at the standard breakpoint thresholds (see §2.1).\n\n### 3.2 Centered, max-width layout\n\nContent is centered within the viewport and constrained to a maximum width of 80rem. At viewports wider than the max-width, the outer margins grow to absorb the excess space. This is the opposite of application layouts, which fill all available space edge-to-edge.\n\n\n\n### 3.3 Responsive reflow\n\nReflow on sites is driven by **viewport breakpoints**. When the viewport crosses a breakpoint threshold, column count and gutter width update together. There are no panels to trigger mid-viewport reflow – the only trigger is the viewport itself resizing.\n\n\n\n## 4. Documentation\n\nDocumentation follows the same grid model as editorial/marketing sites – viewport-based, centered, same gutter values – but uses a three-region layout:\n\n- **Left: site navigation** – persistent side navigation across all documentation pages. Collapses into a drawer at smaller breakpoints.\n- **Centre: content body** – the article or page content.\n- **Right: on-page table of contents** – anchor links to headings within the current page. At smaller breakpoints this stacks directly below the page’s h1 heading.\n\nEach region occupies a fixed column span on the grid. The content area respects the grid boundaries throughout.\n\n\n\n[example: documentation layout with side navigation and content area across breakpoints]\n\n\n\n## 5. Applications\n\nApplication UIs (for example, MAAS, LXD, Landscape) require multiple concurrent grid contexts and fluid, edge-to-edge layouts.\n\n\n\n### 5.1 Container-based grids\n\nEach major layout region (main content, panels/drawers, toolbars) can establish its own grid context based on its available width. **Panels** are layout zones that resize the main content (e.g., desktop navigation), while **drawers** overlay the main content without changing its size. This allows:\n\n- Consistent layouts regardless of panel positioning\n- Predictable behavior when drawers or panels are resized, hidden, or overlayed\n- Reusable components that adapt to their container\n\n**Key principle**: A drawer at any intrinsic width uses the gutters defined by the **global viewport breakpoint**, not by its own width. For example, a 320px side drawer displayed on a 1800px screen uses 1.5rem (24px) gutters (the application large-breakpoint value), not 1rem (16px). This ensures visual consistency across all drawers and the main area at the same screen size.\n\n### 5.2 Fluid layouts\n\n\n\nApplications use fluid grids that expand to fill available space. Unlike editorial sites, applications should not:\n\n- Have a maximum content width that leaves whitespace at large screens\n- Use centered positioning for the main layout container\n\nFluid grids ensure consistent, edge-to-edge space utilisation across application views and window sizes.\n\nThis spec proposes **container queries** to switch column counts: when a container crosses a defined width threshold, its column count explicitly switches to 4, 8, or 16. Gutter and outer margin values are controlled separately by the global viewport breakpoint (see §2.3). This combination gives explicit, predictable control over both column structure and spacing at every screen size.\n\nNote: We’re currently experimenting with an alternative, “intrinsic” grid approach that uses `auto-fill`, `auto-fit`, or `minmax()` to let the browser determine column count dynamically. The main rationale for this approach is support for predominantly left-aligned layouts: as the browser adds columns to fill available width, the grid naturally grows from the left edge, which makes centered compositions difficult and in practice rules them out. That same behavior creates an interesting opportunity for controlled breakout patterns, where a primary content area can remain on an 8-column reading width while additional columns are used for wider elements such as card grids. This should be used deliberately and with care, because it relaxes some of the explicit 4/8/16-column guardrails this spec is designed to preserve and can introduce column counts outside the canonical set. Container queries remain the recommended implementation mechanism whenever the design depends on one of the three defined column counts; intrinsic behavior is better treated as a deliberate exception for left-aligned and breakout use cases, not the default.\n\n### 5.3 Drawers vs panels\n\nWe distinguish between two types of layout regions:\n\n- **Drawers** overlap the main area without changing its size. Drawers sit on top of the main content without changing its size.\n- **Panels** exist in the same plane as the main area and cause the main area to resize.\n\nApplication layouts have one panel slot per browser window edge. That slot can be subdivided internally – for example into a narrow icon rail and a wider navigation list – but from the grid’s perspective it is a single region with a single width. The main content area occupies the remaining space and establishes its own grid context based on its available width.\n\n### 5.4 Panel/Drawer width constraints\n\nEach drawer type defines minimum and maximum widths. When placed in application landmark regions (`<aside>`, `<main>`, etc.), these internally defined constraints apply:\n\nTable 26\n\n**All applications must use these standardised widths on load.** Inconsistent drawer widths have been identified as a recurring problem across our product suite. If additional flexibility is needed, implement user-adjustable resizing within the min/max constraints above – but the default loaded state must always use the standard small/medium/large values.\n\nTable 9\n\n[Examples of 3 panel/drawer widths. A high contrast border in examples 1 and 2 serves as a resize affordance]\n\n### 5.5 Tile grid\n\nDashboard tile layouts are a common use case. We have explored an approach where component padding (on cards and similar elements) is absorbed into the grid gutters, increasing the proportion of space available for content. This is out of scope for the current spec – see [Future work](#9-future-work) for details and examples. For now, align cards to the grid.\n\n\n\n## 6. Responsive reflow\n\nContainer queries (applications) and viewport breakpoints (sites and documentation) drive all layout transitions. Each grid context has a defined layout for every width bracket – the browser moves between those defined states automatically as the width changes. The product designer’s job is to specify the layout at each bracket; the browser handles transitions between them.\n\n### 6.1 Panel-triggered reflow (applications)\n\nWhen a panel opens or is resized, the main area’s available width shrinks. If that crosses a container query threshold, the main area switches to the corresponding column layout automatically – no additional logic required. The same applies to panels themselves: a panel that narrows past a threshold switches to its own narrower layout. This is container queries working as intended, not a special case.\n\n### 6.2 Narrowing strategy (all tiers)\n\nWhen a grid container becomes too narrow to accommodate its current layout:\n\n1. **First**: Move to the narrower width bracket, which may reduce column count and spans (e.g., switch from an 8-column layout to a 4-column layout)\n2. **Then**: Switch from horizontal to vertical stacking if the narrower layout still doesn’t fit\n\nThis ensures content remains readable and functional at any width, whether the trigger is the viewport resizing (sites and documentation) or a panel opening (applications).\n\n\n\n## 7. When to use the grid\n\n### 7.1 Required\n\nThe grid **must** be used when placing blocks of content side by side. Some examples:\n\n- Placing block-level elements side-by-side (e.g., cards, form sections, data panels)\n- Creating multi-column layouts within a content area\n- Positioning elements that should align vertically across rows\n- Laying out dashboard widgets or data visualisations\n\n### 7.2 Optional\n\nThe grid is **optional** for:\n\n- **Tables**: While the table as a whole must span an exact number of columns, Internal column logic takes precedence. **Guideline**: If aligning table columns to the grid won’t hurt the content (i.e., grid column widths are suitable for the data inside), align to the grid. If alignment causes issues with data display, the table’s internal logic takes precedence.\n\n\n\n### 7.3 Not applicable\n\nThe grid is **not applicable** for:\n\n- **Inline content flows**: Tab labels, toolbar buttons, breadcrumbs – these behave like text and use natural inline layout\n- **Single-column content**: Articles, lists, side navigation – no subdivision needed\n\n### 7.4 Examples – sites and documentation\n\n**Landing page** (grid required):\n\n[example needed]\n\n**Article with side navigation** (grid required):\n\n- Sticky side nav in a narrow column span, article body in the remaining span\n- On narrow viewports the side nav stacks above or collapses\n\n\n\n### 7.5 Examples – applications\n\n\n\n**Combobox strip** (grid optional):\n\n- Labels flow inline like text (no grid needed)\n- But the combobox stri[ can be assigned a column span (e.g., “columns 4–8”)\n\n**Toolbar with left/right groups** (grid exempt):\n\n- Heading floated left\n- Right-aligned elements use CSS flexbox/float, not grid columns\n\n**Data table in main area** (grid optional):\n\n- Table has internal column logic\n- If table columns can align to grid without compromising data display: align to grid\n- If alignment causes truncation or awkward column widths: table takes precedence\n\n**Drawer** (grid required):\n\n- \n\n\n\n\n\n## 8. Form layouts\n\nForms align to grid columns based on their context:\n\n- Centered, spanning 4 columns (columns 3–6) on an 8-column grid – a half-width block in the middle of the page \n\n- **Left-aligned** (applications): Left-aligned, starting from the first column \n\n\n\n\n**Summary of constraints:**\n\n*Universal (all tiers):*\n\n- Column counts: 4, 8, or 16 only\n- Column spans: power-of-2 fractions of the column count (half, quarter, eighth) – no thirds or other non-bisecting splits\n- Nested grids: must align to parent column offsets\n- Gutters: At x-small and small breakpoints, gutters are universal (see the table in seciton 2.3). At larger breakpoints, gutter behavior changes, see below. \n\n*Sites and documentation:*\n\n- Grid context: single viewport-based grid\n- Gutters at large/x-large: 2rem (32px)\n- Layout: centered, max-width constrained\n\n*Applications:*\n\n- Grid context: container-based, multiple concurrent contexts\n- Gutters at large/x-large: 1.5rem (24px)\n- Layout: fluid, edge-to-edge\n- Drawer widths: defined min/max per drawer type, with standardised default widths on load\n\n\n\n## 9. Future work\n\n### Tile grid approaches\n\nDashboard views with tile-based content benefit from a specialised grid configuration. Two approaches worth exploring:\n\n- **Gutter-as-padding**: Use a 2px (or more) gap between tiles, with card padding absorbed into the gutter. This maximises content area within each tile.\n- **Half-gutter variant**: Split the gutter value between tile outer spacing and card inner padding, giving more control over the relative weight of gap vs card breathing room.\n- Future work: add examples for:\n\n[example needed: gutter-as-padding layout vs standard grid layout, side by side] \n[example needed: half-gutter variant showing relative padding proportions]";
|
|
10
|
+
ds:knownEdgeCases "";
|
|
11
|
+
ds:conceptType ds:concepttype.Explanation.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:concept.Foundations-Spacing.-Element-vs-container-owned a ds:Concept;
|
|
6
|
+
ds:name "Foundations: Spacing. Element vs container-owned";
|
|
7
|
+
ds:summary "This document covers both inter-element spacing (gaps between components and patterns) and intra-component spacing (internal padding and border compensation):\n\n- Vertical and horizontal spacing architecture\n- When and why to use each spacing model\n- Baseline grid and nudge token architecture\n- Invariants that both models must preserve";
|
|
8
|
+
ds:tier ds:global;
|
|
9
|
+
ds:content "\n\n**Status:** Final \n**Version:** 1.0 \n**Last updated:** 2026-04-24\n\n\n\n## Table of contents\n\n1. [Glossary](#glossary)\n2. [Problem statement and scope](#1-problem-statement-and-scope)\n3. [The vertical spacing architecture](#2-the-vertical-spacing-architecture)\n4. [Horizontal spacing](#3-horizontal-spacing)\n5. [Invariants](#4-invariants)\n\n\n\n## Glossary\n\nCopy of Copy of Table 10\n\n\n\n## 1. Problem statement and scope\n\n### 1.1 The problem\n\nOur Design System serves three fundamentally different tiers:\n\n- Application UIs – dashboards, forms, settings pages, admin panels (MAAS, Landscape, Launchpad, Snapcraft, support portal, and ~50 other products)\n- Editorial / marketing sites – [ubuntu.com](http://ubuntu.com), [canonical.com](http://canonical.com), canonical.design, blog content\n- Documentation\n\nThese tiers have different spacing needs. Application UIs benefit from explicit, container-controlled spacing. Editorial content and documentation benefit from semantic, element-owned spacing that preserves typographic hierarchy automatically.\n\nNo single spacing model optimally serves all tiers. A system that forces one model everywhere either frustrates the majority use case (application teams) or sacrifices semantic correctness for editorial and documentation tiers.\n\n### 1.2 Scope\n\nThis specification covers both inter-element spacing (gaps between components and patterns) and intra-component spacing (internal padding and border compensation):\n\n- Vertical and horizontal spacing architecture\n- When and why to use each spacing model\n- Baseline grid and nudge token architecture\n- Invariants that both models must preserve\n\nOut of scope:\n\n- Typography specification (referenced where relevant)\n- Grid system specification (referenced where relevant)\n- Implementation details (CSS architecture, component APIs, tooling)\n\n### 1.3 Goals\n\n1. **Predictability:** Spacing behaviour is deterministic and learnable\n2. **Composability:** Elements compose correctly in both models\n3. **Maintainability:** Spacing changes propagate through tokens, not through container dependencies\n4. **Tier fit:** Each tier uses the model best suited to it\n\n\n\n## 2. Vertical spacing\n\n### 2.1 Thesis\n\nVertical spacing should be owned by elements in content flow and owned by containers in application UIs. This split keeps editorial spacing typographically precise and application spacing simple.\n\nMature design systems implicitly follow this split: [GOV.UK](https://design-system.service.gov.uk/styles/spacing/) uses element-owned spacing for typography; [Material Design 3](https://m3.material.io/foundations/layout/understanding-layout/spacing), [Shopify Polaris](https://polaris.shopify.com/design/layout/spacial-organization), and [Atlassian](https://atlassian.design/foundations/spacing) use container-owned spacing for application UIs. Making this distinction explicit gives us semantic correctness for content and simple composability for UI composition.\n\nCopy of Copy of Table 11\n\n### 2.2 The two modes\n\nCopy of Table 27\n\n\n\n### 2.3 Element-owned spacing\n\nBy default, every element carries semantic margin-bottom. This ensures:\n\n- Developers not familiar with the DS get working spacing immediately\n- Prototyping is straightforward – drop elements on a page and they don’t collide\n- No container boilerplate required for simple pages\n\n2.3.1 Core principle\n\nEach element owns the space below it. Elements declare `margin-bottom` only; no element declares `margin-top`. This follows Harry Roberts’ “[single-direction margin declarations](https://csswizardry.com/2012/06/single-direction-margin-declarations/)” pattern.\n\nThe single-direction rule applies to spacing between elements only: elements use `margin-bottom` (never `margin-top`). The last-child reset (see §2.3.5) prevents external margins and container spacing from doubling up. Internal spacing inside components is handled with padding on any side (for example buttons, inputs, strips, and containers).\n\n**Why bottom (not top):**\n\n- **Resilience to unknown elements.** Content is authored top-down. If an unstyled element enters the flow (a D3 canvas, an embedded iframe, a third-party widget), it arrives with `margin-top: 0`. With bottom-only, the preceding element already declared appropriate space below itself – the unknown element gets reasonable separation for free. With top-only, the unknown element would need to declare its own space above, but since the system doesn’t style it, it won’t. The result: the unknown element crowds whatever is above it. \n \nComparison: \n*[Example: button followed by an unstyled D3 canvas – bottom-only provides separation vs top-only where the canvas crowds the button]* \n\n- **Industry precedent.** InDesign uses “Space After” as the primary typographic control; “Space Before” is avoided because it creates ambiguity at the tops of frames. Figma auto-layout applies gap after each item. [GOV.UK](https://design-system.service.gov.uk/styles/spacing/) typography applies `margin-top: 0` and relies primarily on bottom spacing for flow:\n\n2.3.2 How it works\n\nEvery text element and component ships with a semantic `margin-bottom`:\n\n```\nh1 → margin-bottom based on its role in hierarchy\nh2 → margin-bottom based on its role in hierarchy\np → margin-bottom based on its role in hierarchy\nbutton → margin-bottom based on its role in hierarchy\n```\n\nThe value is determined by the element’s semantic role and visual weight, drawn from the spacing token scale.\n\nElements like buttons may appear at different hierarchy levels (inside cards, at the end of forms, or inside hero sections). In element-owned mode, the button keeps the same semantic `margin-bottom` token across contexts. If a section needs extra separation from the next section, that separation is owned by the parent container (via its own padding or margin), not by changing button spacing. In container-owned mode, the container’s gap controls all spacing and button `margin-bottom` is reset to `0`.\n\n\n\n*[Example: stacked elements with margin-bottom showing semantic spacing values]*\n\n2.3.3 Why this model suits editorial content\n\nIn editorial/content flow, elements are heterogeneous – headings, paragraphs, images, pull quotes, lists. The spacing transition between a heading and a paragraph is semantically different from the transition between two paragraphs.\n\n```\nh2 → larger gap (topic change)\np → standard gap (continuation)\np → standard gap (continuation)\nfigure → larger gap (visual break)\nh2 → larger gap (new topic)\n```\n\nA parent container cannot manage these transitions without encoding knowledge of every child type and order. Element-owned spacing handles this automatically because each element carries its own contextually appropriate spacing.\n\nThis principle extends beyond text elements to higher-level layout devices: sections, figures, and content blocks also carry their own `margin-bottom`, establishing spacing at every level of the document hierarchy.\n\n**Real-world examples:**\n\n- Traditional publishing – element-intrinsic vertical spacing is the norm, implemented via space before/after in paragraph styles for example.\n- Browser defaults and markdown renderers – rely on element-owned margins\n\n2.3.4 Where it applies\n\nElement-owned spacing is the system default. It applies everywhere unless a container explicitly takes over. It is the primary model for:\n\n- Marketing pages with mixed content\n- Blog posts and articles\n- Documentation with semantic heading hierarchy\n- Rich text / markdown-rendered content\n\nThe choice between element-owned and container-owned spacing is made at the **product level** – an entire site or application commits to one mode. Mixing modes within a single product would create inconsistent vertical rhythm and complicate nudge token management, since baseline alignment relies on a single consistent spacing strategy per codebase.\n\n2.3.5 Last-child handling\n\nIn element-owned mode, the last child in a content-flow container still carries its `margin-bottom`. To prevent double spacing (element margin + container padding), the design system’s base CSS automatically resets trailing margins at each flow boundary:\n\n```css\n/* Working selector name for illustration; not a prescriptive API */\n.content-flow-container > :last-child {\n margin-bottom: 0;\n}\n```\n\nNote: This is not a manual step. The rule is part of the system’s CSS foundation. In nested layouts (for example `container > grid-row > col > h2` and `col > p`), each column that hosts content flow should be a content-flow container so each branch resets its own trailing margin.\n\n**Component implementations:** when text elements are wrapped as components (e.g. `<Heading>`, `<Paragraph>`), the last-child reset should be handled by the content-flow container, not by individual components. Components should not need a `:last` variant – the container’s `:last-child` selector targets whatever element renders last, regardless of component wrapper. If a framework prevents CSS child selectors from reaching the rendered element, the container component should apply the reset via its own logic.\n\nThe default reset uses `margin-bottom: 0`. A precision variant that preserves baseline compensation is described in §2.6.2.\n\n**Example: Hero pattern**\n\n```\nHero (padding-bottom: 64px)\n├── h1 \"Sign up today\" (margin-bottom: 24px)\n├── p \"Get started free\" (margin-bottom: 16px)\n├── [Button: Sign up] (margin-bottom: 0) ← last-child reset\n└── (hero padding-bottom provides the 64px separation to next section)\n\n```\n\nWithout the reset, the button’s `margin-bottom` (16px) would stack with the hero’s `padding-bottom` (64px), producing 80px – a double-spacing bug. The automatic reset eliminates this.\n\n### 2.4 Container-owned spacing\n\n2.4.1 Core principle\n\nContainers define spacing between their children. Children inside a container have their `margin-bottom` set to zero; the container controls gaps through `gap` values. Elements are spacing-neutral – the container owns all inter-child spacing.\n\n2.4.2 How it works\n\nA container resets child spacing and applies uniform (or structured) gaps:\n\n```\nContainer with gap (16px)\n ├── TextField (margin-bottom: 0)\n ├── TextField (margin-bottom: 0)\n └── Button (margin-bottom: 0)\n```\n\nThe container takes ownership. Elements become spacing-neutral. \nRecommended safeguard: apply an app-scope element qualifier margin-reset so browser default element margins do not reintroduce element-owned spacing.\n\n2.4.3 Why this model suits application UI\n\nIn application UI, we prioritise simplicity: spacing is owned by containers rather than by individual element semantics.\n\nContainer-owned spacing provides:\n\n- Visible spacing intent – inspect the parent to see spacing decisions\n- Predictable reordering – move children without spacing side effects\n- Density control – choose a container with the desired density level\n- Consolidated control – spacing is configured at the container level\n\n**Nested containers for varying density:**\n\nWhen different parts of an interface need different density, nest containers with different gap values. Each container owns the spacing for its direct children – no element-level margin decisions are needed.\n\n```\nForm (padding: 16px, gap: 16px)\n├── Field group (gap: 4px) ← dense: label, input, helper text\n│ ├── Label: \"Upstream DNS\"\n│ ├── Input: \"8.8.8.8\"\n│ └── Helper: \"Comma-separated list of upstream DNS servers.\"\n└── Field group (gap: 4px) ← same dense group, separated by larger gap\n ├── Label: \"Default TTL\"\n ├── Input: \"30\"\n └── Helper: \"...\"\n```\n\nIn this example, the form’s `gap` separates the two field groups with comfortable spacing. Inside each field group, a small gap keeps the label, input, and helper text tightly bound as a single unit. The form container owns the inter-group spacing; each field group owns its internal density.\n\n**Real-world examples:**\n\n- Material Design 3 – spacing defined via grid and structural primitives\n- Shopify Polaris – Stack primitive controls vertical spacing\n- Atlassian Design System – Stack primitive defines spacing between children\n- Chakra UI – Stack component exists specifically to control spacing\n\n### 2.4.4 Application-specific container provisions\n\nOne container pattern is unique to application layouts:\n\n**Fixed-height status bar.** A status bar is simply a container with a fixed height. Its width can span both the main area and side drawers, or be scoped to the main area only – depending on use case. Like all application containers, it resets child margins to zero and owns the spacing between its children.\n\n### 2.5 Intra-component vertical padding\n\nIntra-component vertical padding is component-owned: each component sets its internal top/bottom padding regardless of context.\n\nFor example, buttons, inputs, and cards keep the same internal top/bottom padding whether they appear alone or inside grouped layouts.\n\nWhen borders change the box model, adjust top/bottom padding so outer component height remains aligned to whole-`bU` steps.\n\n### 2.6 Baseline grid and nudges\n\n2.6.1 The baseline grid\n\nIn our design system, the default baseline unit is 4px (previously 8px). \nWe use the acronym `bU` throughout this specification.\n\n> **Box model consideration:** When elements have borders, the entire box model must be accounted for in height calculations. For example, an element with `padding: 16px` and `border: 1px` should reduce padding to `14px` to maintain the same total height. This principle applies to both spacing modes.\n\n2.6.2 The nudge technique\n\nThe underlying issue is browser line-height centering: CSS centres text vertically within the line-height box rather than anchoring it to a baseline. This means stacking text elements of different sizes produces baselines that land at unpredictable positions – not on any consistent grid.\n\nNudge tokens solve this by adding a small `padding-top` to push each text element’s baseline onto the grid, with a corresponding increase in `margin-bottom` to compensate.\n\nNudges are text-level only. They apply to typographic elements and text-bearing components (for example buttons, inputs, list items, etc), not containers. Containers remain spacing-neutral and use semantic spacing tokens; this preserves substitutability when elements are swapped.\n\nBaseline compensation model:\n\n- `padding-top = nudge`\n- `baseline-compensation = bU - nudge`\n- `margin-bottom = semantic-spacing + baseline-compensation`\n\nFlow-boundary precision reset (for non-zero nudge contexts):\n\n```css\n\n/* Each text element sets semantic spacing and compensation values. Illustration in px for clarity, real values are rem and come from tokens, not css vars */\np {\n --spAfter-sem: var(--space-after-semantic-p); /* e.g. 16px */\n --spAfter-comp: var(--space-after-comp-p); /* e.g. 6.4px */\n}\n\nh1 {\n --spAfter-sem: var(--space-after-semantic-h1); /* e.g. 16px */\n --spAfter-comp: var(--space-after-comp-h1); /* e.g. 2px */\n}\n\n.content-flow-container > * {\n margin-bottom: calc(var(--spAfter-sem, 0px) + var(--spAfter-comp, 0px));\n}\n\n.content-flow-container > :last-child {\n margin-bottom: var(--spAfter-comp, 0px);\n}\n```\n\nThis approach keeps baseline continuity at flow boundaries. \nImplementation can be provided through any equivalent mechanism (for example a prose wrapper component, a utility class, or a scoped element qualifier).\n\n**Last-child reset options**\n\n`Option A (default, simpler):` \nKeep the boundary reset as `margin-bottom: 0` (as described in §2.3.5).\n\n`Option B (precision):` \nUse the precision reset above, which preserves `spAfter` compensation on the last child and trims only semantic spacing. This keeps baselines aligned even at flow boundaries.\n\n2.6.3 Scope\n\nThe nudge technique is reserved for Editorial / marketing and Documentation tiers, where calculated nudge values are used for content-flow typography. Application UI tier is exempt, and all nudge tokens are intentionally set to `0`.\n\n2.6.4 Trade-off summary\n\nCopy of Copy of Table 13\n\n\n\n## 3. Horizontal spacing\n\nHorizontal spacing uses a container-owned model in both vertical modes.\n\nUnlike vertical spacing, horizontal spacing rarely encodes semantic hierarchy or visual weight transitions between adjacent elements. Large separations are typically set by the grid (gutters, margins, keylines). What remains is spacing between smaller grouped elements inside components and patterns, where container-defined gaps are simpler and more consistent.\n\n### 3.1 Layout-level spacing\n\nHorizontal spacing at the layout level is handled by the grid system:\n\nCopy of Copy of Table 14\n\nThe grid provides consistent horizontal rhythm across breakpoints and establishes keylines: shared horizontal offsets that align text and controls across components and patterns, improving scannability. Components placed within grid columns inherit this spacing automatically.\n\n> **Two-dimensional grids:** When layout produces a two-dimensional grid of items (card grids, dashboards, image galleries), the vertical gap between rows must equal the horizontal gutter (24px). This ensures items sit on a uniform spatial grid in both axes.\n\n### 3.2 Horizontal sibling spacing\n\nHorizontal spacing between sibling elements is container-owned: the parent context sets the gap.\n\nFor example, in a row of buttons or chips, the container defines the horizontal gap between items:\n\n\n\n### 3.3 Intra-component horizontal padding\n\nIntra-component horizontal padding is component-owned: each component sets its internal left/right padding regardless of context.\n\nFor example, buttons, inputs, and chips keep the same internal left/right padding whether they appear alone or inside grouped layouts.: \n\n\nWhen borders change the box model, adjust left/right padding to preserve content box width. For bottom-only borders, left/right padding stays unchanged.\n\nCopy of Copy of Table 15\n\n\n\n## 4. Invariants\n\nInvariants are the non-negotiable rules that both spacing modes must preserve. They serve as evaluation criteria for architectural decisions and acceptance criteria for contributions.\n\n### 4.1 The invariant list\n\nCopy of Copy of Table 16\n\n### 4.2 How invariants apply to each mode\n\n**Element-owned (default mode):**\n\n- Substitutability is intrinsic – each element brings its own spacing\n- Locality is intrinsic – no parent knowledge required\n- No double spacing is handled by margin-bottom-only rule (no collapsing margin-top)\n\n**Container-owned mode:**\n\n- Substitutability is preserved because all children have margin-bottom: 0; spacing is uniform from the container\n- Locality is preserved – elements don’t need to know their context; the container resets them unconditionally\n- No double spacing is handled by the reset mechanism (children have no margins to double)\n\n### 4.3 Invariant priority\n\nWhen invariants conflict, resolve in this order:\n\n1. **Substitutability** – composition must remain predictable\n2. **Locality** – knowledge shouldn’t leak across boundaries\n3. **No double spacing** – additive bugs break layouts\n4. **Composition isolation** – parent-child contracts must be stable\n5. **Grid alignment** – vertical rhythm should be maintained\n6. **Predictable removal** – overrides must be safe\n\n> **Note on grid alignment:** In zero-nudge mode, grid alignment refers to element heights being whole multiples of `bU`. True baseline alignment (text sitting on grid lines) is only achieved with non-zero nudge values.\n\n\n\n\n\n## 5. Authoring guidance\n\nThis section translates the architectural model into concrete decisions for the two audiences who apply it daily.\n\n### 5.1 Component designers\n\nSpacing behaviour differs between tiers, but the difference is encoded in the token values – not in how components are designed. A component built correctly for one tier will work in the other once the appropriate tokens are applied.\n\nIn editorial and documentation tiers, text inside components aligns to a baseline grid – the same behaviour as the legacy Vanilla framework this design system replaces. Nudge tokens (`padding-top`) shift each text baseline onto the grid, with a corresponding `margin-bottom` compensation. In application UI tiers, nudge tokens are set to zero; internal padding on elements such as buttons is set so that the entire element aligns to the baseline grid, rather than individual text baselines within it.\n\n**Application UI**\n\nContainers own all inter-child spacing. Components should be spacing-neutral.\n\n- `spAfter` (margin-bottom) is set to `0` at the tier level via zero-nudge tokens – no manual work per component.\n- Internal vertical padding is component-owned. Use values from the spacing scale.\n- If the component has a border that changes the box model, reduce padding to keep total height on whole-`bU` steps.\n\n**Editorial and documentation**\n\nComponents carry their own spacing in content flow.\n\n- Set `margin-bottom` using a semantic spacing token. Never use `margin-top`.\n- If the component contains text, apply the nudge token (`padding-top`) for baseline alignment (§2.6.2).\n- Pick the token that matches the element’s visual weight and hierarchy level.\n\n**Both tiers**\n\n- Internal horizontal padding is always component-owned.\n- For all-side borders, reduce horizontal padding by the border width.\n- Keep all internal padding consistent regardless of layout context.\n\n**Pre-review checklist**\n\n- Spacing values use tokens, not arbitrary px\n- No `margin-top` declared anywhere in the component\n- Text elements: nudge token applied if serving editorial/docs tier\n- Component height is whole-`bU` multiples (account for borders)\n- Tested in composition: followed by a heading, a paragraph, and a button\n\n### 5.2 Pattern designers\n\nPatterns compose components. The principle: patterns don’t re-encode spacing that belongs to components or containers.\n\n**Application UI patterns**\n\nUse container-owned spacing (§2.4).\n\n- Set a gap value on the container. Component tokens are already zeroed; children will be spacing-neutral.\n- Don’t add `margin-bottom` to individual children.\n- Use nested containers for sections of the pattern that need different density (§2.4.3 for an example).\n- For two-dimensional grids (card grids, tile layouts), set the vertical row gap equal to the horizontal gutter (24px, per §3.1).\n\n**Editorial and documentation patterns**\n\nUse element-owned spacing (§2.3).\n\n- Don’t override child `margin-bottom`. If the gap looks wrong, the component needs adjusting – not the pattern.\n- Wrap the pattern in a content-flow container so the last-child reset applies automatically (§2.3.5).\n\n**Tight compositions**\n\nHero heading pairs, button bars, and key–value rows sometimes need less space than the component default. This is not a pattern-level override.\n\n- Request a spacing variant in the component: minimal mode removes semantic spacing while preserving baseline compensation.\n- The pattern references the component variant; it never applies inline spacing values.\n- Substitutability (§4.1) is preserved: swapping the component still composes correctly.\n\n**Slot-based patterns**\n\nWhen a pattern passes arbitrary children through a slot, it can’t guarantee specific spacing.\n\n- Document the expected child types.\n- Wrap the slot in a content-flow container (editorial/docs) or a gap container (application UI).\n\n\n\n\n\n## Appendices\n\n### A. References\n\n- Harry Roberts: [Single-direction margin declarations](https://csswizardry.com/2012/06/single-direction-margin-declarations/)\n- [GOV.UK Design System: Spacing](https://design-system.service.gov.uk/styles/spacing/)\n- Material Design 3: [Layout spacing](https://m3.material.io/foundations/layout/understanding-layout/spacing#9ebf5386-23ca-400a-b68d-e8c679a4a19d)\n- Shopify Polaris: [Stack](https://shopify.dev/docs/api/checkout-ui-extensions/latest/polaris-web-components/layout-and-structure/stack)\n - Atlassian Design System: [Stack](https://atlassian.design/components/primitives/stack/)\n\n";
|
|
10
|
+
ds:knownEdgeCases "";
|
|
11
|
+
ds:conceptType ds:concepttype.Explanation.
|