@canonical/design-system 0.1.2 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/PULL_REQUEST_TEMPLATE.md +15 -6
- package/.github/workflows/ci.yml +14 -4
- package/.github/workflows/sync-coda-manual.yml +13 -0
- package/.github/workflows/sync-coda-scheduled.yml +9 -0
- package/.github/workflows/sync-coda.yml +65 -1
- package/README.md +132 -79
- package/bun.lock +51 -12
- package/data/apps/component/file_tree.ttl +6 -1
- package/data/apps/component/key_value_pair.ttl +5 -1
- package/data/apps/component/navigation.ttl +5 -1
- package/data/apps/component/notification.ttl +5 -1
- package/data/apps/component/side_navigation.ttl +11 -0
- package/data/apps/component/skeleton_loading.ttl +5 -1
- package/data/apps/component/status_bar.ttl +5 -1
- package/data/apps/component/toolbar.ttl +5 -1
- package/data/apps/group/key_value_pairs.ttl +11 -0
- package/data/apps/group/notifications.ttl +5 -1
- package/data/apps/layout/application_layout.ttl +4 -0
- package/data/apps/layout/content_layout.ttl +11 -1
- package/data/apps/layout/empty_layout.ttl +5 -1
- package/data/apps/layout/list_page_layout.ttl +5 -1
- package/data/apps/layout/settings_page_layout.ttl +5 -1
- package/data/apps/layout/view_layout.ttl +4 -0
- package/data/apps/pattern/action_bar.ttl +11 -0
- package/data/apps/pattern/code_diff.ttl +5 -1
- package/data/apps/pattern/data_table.ttl +205 -2
- package/data/apps/pattern/destructive_modal.ttl +5 -1
- package/data/apps/pattern/drawer.ttl +12 -0
- package/data/apps/pattern/keyboard_shortcuts.ttl +5 -1
- package/data/apps/pattern/notification_center.ttl +19 -1
- package/data/apps/pattern/side_panel.ttl +6 -1
- package/data/apps/pattern/sidepanel_stacked.ttl +5 -1
- package/data/apps/subcomponent/data_table-action_bar.ttl +27 -0
- package/data/apps/subcomponent/data_table-body_cell.ttl +106 -0
- package/data/apps/subcomponent/data_table-group_header_row.ttl +58 -0
- package/data/apps/subcomponent/data_table-header_cell.ttl +73 -0
- package/data/apps/subcomponent/data_table-pagination_bar.ttl +44 -0
- package/data/apps/subcomponent/data_table-persistent_selection.ttl +50 -0
- package/data/apps/subcomponent/data_table-settings_menu.ttl +63 -0
- package/data/apps/subcomponent/drawer-content.ttl +12 -0
- package/data/apps/subcomponent/drawer-footer.ttl +12 -0
- package/data/apps/subcomponent/drawer-header.ttl +12 -0
- package/data/apps/subcomponent/file_tree-node.ttl +5 -1
- package/data/apps/subcomponent/log.ttl +11 -0
- package/data/apps/subcomponent/side_panel-content.ttl +12 -0
- package/data/apps/subcomponent/side_panel-footer.ttl +12 -0
- package/data/apps/subcomponent/side_panel-header.ttl +12 -0
- package/data/apps_anbox/component/theme_switcher.ttl +10 -0
- package/data/apps_anbox/pattern/side_menu.ttl +11 -1
- package/data/apps_debcrafters/component/example.ttl +10 -0
- package/data/apps_debcrafters/component/my_fancy_component.ttl +11 -0
- package/data/apps_debcrafters.ttl +4 -0
- package/data/apps_juju/pattern/single_select_multi_layered.ttl +4 -1
- package/data/apps_landscape/component/password_constraints.ttl +4 -1
- package/data/apps_landscape/component/truncated_cell.ttl +38 -0
- package/data/apps_launchpad/component/avatar.ttl +31 -0
- package/data/apps_launchpad/component/badge.ttl +11 -9
- package/data/apps_launchpad/component/breadcrumbs.ttl +5 -2
- package/data/apps_launchpad/component/button.ttl +11 -9
- package/data/apps_launchpad/component/checkbox_input.ttl +31 -0
- package/data/apps_launchpad/component/chip.ttl +11 -8
- package/data/apps_launchpad/component/combobox.ttl +16 -11
- package/data/apps_launchpad/component/description_list.ttl +8 -3
- package/data/apps_launchpad/component/drawer.ttl +38 -0
- package/data/apps_launchpad/component/log.ttl +58 -0
- package/data/apps_launchpad/component/modal.ttl +44 -0
- package/data/apps_launchpad/component/radio_input.ttl +37 -0
- package/data/apps_launchpad/component/select_input.ttl +38 -0
- package/data/apps_launchpad/component/switch.ttl +8 -4
- package/data/apps_launchpad/component/text_input.ttl +13 -9
- package/data/apps_launchpad/component/textarea_input.ttl +39 -0
- package/data/apps_launchpad/component/tooltip.ttl +12 -8
- package/data/apps_launchpad/subcomponent/combobox-checkbox_option.ttl +11 -9
- package/data/apps_launchpad/subcomponent/combobox-footer.ttl +8 -3
- package/data/apps_launchpad/subcomponent/combobox-group.ttl +10 -6
- package/data/apps_launchpad/subcomponent/combobox-helper.ttl +11 -6
- package/data/apps_launchpad/subcomponent/combobox-loading.ttl +9 -3
- package/data/apps_launchpad/subcomponent/combobox-no_results.ttl +8 -3
- package/data/apps_launchpad/subcomponent/combobox-radio_option.ttl +12 -10
- package/data/apps_launchpad/subcomponent/combobox-search.ttl +10 -6
- package/data/apps_launchpad/subcomponent/description_list-item.ttl +8 -3
- package/data/apps_launchpad/subcomponent/log-line.ttl +38 -0
- package/data/apps_launchpad/subcomponent/modal-content-body.ttl +18 -0
- package/data/apps_launchpad/subcomponent/modal-content-footer.ttl +18 -0
- package/data/apps_launchpad/subcomponent/modal-content-header-close_button.ttl +11 -0
- package/data/apps_launchpad/subcomponent/modal-content-header.ttl +19 -0
- package/data/apps_launchpad/subcomponent/modal-content.ttl +20 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-body.ttl +11 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-footer.ttl +11 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-header-close_button.ttl +11 -0
- package/data/apps_launchpad/subcomponent/side_panel-content-header.ttl +12 -0
- package/data/apps_launchpad/subcomponent/side_panel-content.ttl +12 -0
- package/data/apps_lxd/component/back_link.ttl +29 -0
- package/data/apps_lxd/component/code_snippet_with_copy_button.ttl +54 -0
- package/data/apps_lxd/component/confirmation_checkbox.ttl +19 -3
- package/data/apps_lxd/component/doc_link.ttl +45 -0
- package/data/apps_lxd/component/meter.ttl +37 -0
- package/data/apps_lxd/component/output_field.ttl +48 -0
- package/data/apps_lxd/component/rename_header.ttl +74 -0
- package/data/apps_lxd/component/tab_links.ttl +35 -0
- package/data/apps_lxd/subcomponent/copy_to_clipboard.ttl +39 -0
- package/data/apps_lxd/view/network_topology.ttl +16 -2
- package/data/apps_notary.ttl +4 -0
- package/data/apps_portal/component/badge.ttl +3 -0
- package/data/apps_portal/component/credit_card_input.ttl +10 -0
- package/data/apps_portal/component/key_value_pair.ttl +10 -0
- package/data/apps_portal/pattern/purchase_summary.ttl +10 -0
- package/data/apps_portal/subcomponent/read_only_modal.ttl +10 -0
- package/data/apps_workplaceengineering/component/label-highlight.ttl +18 -0
- package/data/apps_workplaceengineering/component/rule.ttl +11 -0
- package/data/apps_workplaceengineering/component/skip_link.ttl +10 -0
- package/data/apps_workplaceengineering/component/theme_switcher.ttl +11 -0
- package/data/apps_workplaceengineering/pattern/callout_numbers_card.ttl +11 -0
- package/data/apps_workplaceengineering/pattern/event_timeline.ttl +11 -0
- package/data/apps_workplaceengineering/pattern/group_card.ttl +11 -0
- package/data/apps_workplaceengineering/pattern/travel_provider_card.ttl +12 -0
- package/data/apps_workplaceengineering.ttl +4 -0
- package/data/documentation/layout/documentation_layout.ttl +5 -1
- package/data/documentation/pattern/library_side_navigation.ttl +6 -2
- package/data/global/component/accordion.ttl +61 -2
- package/data/global/component/announcement.ttl +12 -2
- package/data/global/component/avatar.ttl +11 -0
- package/data/global/component/badge.ttl +42 -1
- package/data/global/component/breadcrumbs.ttl +18 -2
- package/data/global/component/button.ttl +36 -8
- package/data/global/component/button_link.ttl +5 -1
- package/data/global/component/card.ttl +33 -2
- package/data/global/component/checkbox_field.ttl +11 -0
- package/data/global/component/chip.ttl +74 -2
- package/data/global/component/choices_field.ttl +11 -0
- package/data/global/component/code_snippet-content.ttl +6 -2
- package/data/global/component/code_snippet-header.ttl +6 -2
- package/data/global/component/code_snippet.ttl +13 -2
- package/data/global/component/color_field.ttl +11 -0
- package/data/global/component/combobox_field.ttl +11 -0
- package/data/global/component/contextual_menu.ttl +22 -2
- package/data/global/component/data_tooltip.ttl +84 -0
- package/data/global/component/date_field.ttl +11 -0
- package/data/global/component/date_time_field.ttl +11 -0
- package/data/global/component/dropdown_button.ttl +18 -0
- package/data/global/component/file_upload_field.ttl +11 -0
- package/data/global/component/heading.ttl +5 -1
- package/data/global/component/hidden_field.ttl +11 -0
- package/data/global/component/icon.ttl +6 -2
- package/data/global/component/icon_in_container.ttl +5 -1
- package/data/global/component/inline_code.ttl +11 -0
- package/data/global/component/keyboard_key.ttl +7 -3
- package/data/global/component/markdown_field.ttl +11 -0
- package/data/global/component/mode_switcher.ttl +11 -0
- package/data/global/component/month_field.ttl +11 -0
- package/data/global/component/notification_inline.ttl +5 -1
- package/data/global/component/notification_toast.ttl +5 -1
- package/data/global/component/number_field.ttl +11 -0
- package/data/global/component/pagination.ttl +6 -2
- package/data/global/component/password_field.ttl +11 -0
- package/data/global/component/phone_field.ttl +11 -0
- package/data/global/component/popover.ttl +5 -1
- package/data/global/component/range_field.ttl +11 -0
- package/data/global/component/rating_field.ttl +11 -0
- package/data/global/component/relative_timestamp.ttl +10 -0
- package/data/global/component/rich_choices_field.ttl +11 -0
- package/data/global/component/rich_text_field.ttl +11 -0
- package/data/global/component/search_field.ttl +11 -0
- package/data/global/component/segmented_control_field.ttl +11 -0
- package/data/global/component/select_field.ttl +11 -0
- package/data/global/component/switch_field.ttl +11 -0
- package/data/global/component/table.ttl +7 -2
- package/data/global/component/tabs.ttl +7 -3
- package/data/global/component/tag.ttl +18 -0
- package/data/global/component/text_field.ttl +11 -0
- package/data/global/component/textarea_field.ttl +11 -0
- package/data/global/component/tile.ttl +24 -3
- package/data/global/component/time_field.ttl +11 -0
- package/data/global/component/timestamp.ttl +10 -0
- package/data/global/component/tooltip.ttl +75 -56
- package/data/global/component/tooltip_wrapper.ttl +81 -0
- package/data/global/group/buttons.ttl +12 -1
- package/data/global/group/cards.ttl +9 -1
- package/data/global/group/code_snippets.ttl +5 -1
- package/data/global/group/keyboard_keys.ttl +7 -3
- package/data/global/group/tiles.ttl +5 -1
- package/data/global/layout/error_layout.ttl +5 -1
- package/data/global/layout/form_layout.ttl +5 -1
- package/data/global/layout/identity_page_form.ttl +5 -1
- package/data/global/modifier/dark.ttl +1 -1
- package/data/global/modifier/information.ttl +1 -1
- package/data/global/modifier/light.ttl +1 -1
- package/data/global/modifier/modal.ttl +6 -0
- package/data/global/modifier/surface1.ttl +6 -0
- package/data/global/modifier/surface2.ttl +6 -0
- package/data/global/modifier/surface3.ttl +6 -0
- package/data/global/modifier_family/_emphasis.ttl +2 -1
- package/data/global/modifier_family/_other.ttl +2 -1
- package/data/global/modifier_family/anticipation.ttl +2 -1
- package/data/global/modifier_family/criticality.ttl +2 -1
- package/data/global/modifier_family/density.ttl +2 -1
- package/data/global/modifier_family/importance.ttl +2 -1
- package/data/global/modifier_family/lifecycle.ttl +2 -1
- package/data/global/modifier_family/mode.ttl +7 -0
- package/data/global/modifier_family/release.ttl +2 -1
- package/data/global/modifier_family/surface.ttl +7 -0
- package/data/global/pattern/description_list.ttl +11 -0
- package/data/global/pattern/field.ttl +11 -0
- package/data/global/pattern/form.ttl +10 -0
- package/data/global/pattern/form_login.ttl +10 -0
- package/data/global/pattern/info_table.ttl +5 -1
- package/data/global/pattern/modal.ttl +7 -2
- package/data/global/pattern/navigation.ttl +5 -1
- package/data/global/pattern/stepper.ttl +5 -1
- package/data/global/pattern/table_of_contents.ttl +5 -1
- package/data/global/pattern/timeline.ttl +33 -2
- package/data/global/subcomponent/accordion-item.ttl +10 -5
- package/data/global/subcomponent/breadcrumbs-item.ttl +7 -3
- package/data/global/subcomponent/card-content.ttl +8 -3
- package/data/global/subcomponent/card-footer.ttl +12 -0
- package/data/global/subcomponent/card-header.ttl +8 -3
- package/data/global/subcomponent/card-image.ttl +8 -3
- package/data/global/subcomponent/card-thumbnail.ttl +6 -1
- package/data/global/subcomponent/chart_legend.ttl +11 -0
- package/data/global/subcomponent/chart_legend_item.ttl +11 -0
- package/data/global/subcomponent/checkbox_input.ttl +11 -0
- package/data/global/subcomponent/color_input.ttl +11 -0
- package/data/global/subcomponent/combobox_input.ttl +11 -0
- package/data/global/subcomponent/date_input.ttl +11 -0
- package/data/global/subcomponent/date_time_input.ttl +11 -0
- package/data/global/subcomponent/field-description.ttl +11 -0
- package/data/global/subcomponent/field-label.ttl +11 -0
- package/data/global/subcomponent/file_upload_input.ttl +11 -0
- package/data/global/subcomponent/hidden_input.ttl +11 -0
- package/data/global/subcomponent/kvp_container.ttl +11 -0
- package/data/global/subcomponent/kvpitem_base.ttl +11 -0
- package/data/global/subcomponent/markdown_input.ttl +11 -0
- package/data/global/subcomponent/modal-content.ttl +5 -1
- package/data/global/subcomponent/modal-footer.ttl +5 -1
- package/data/global/subcomponent/modal-header.ttl +5 -1
- package/data/global/subcomponent/month_input.ttl +11 -0
- package/data/global/subcomponent/number_input.ttl +11 -0
- package/data/global/subcomponent/password_input.ttl +11 -0
- package/data/global/subcomponent/phone_input.ttl +11 -0
- package/data/global/subcomponent/radio_input.ttl +11 -0
- package/data/global/subcomponent/range_input.ttl +11 -0
- package/data/global/subcomponent/rating_input.ttl +11 -0
- package/data/global/subcomponent/rich_text_input.ttl +11 -0
- package/data/global/subcomponent/search_input.ttl +26 -0
- package/data/global/subcomponent/segmented_control_input.ttl +11 -0
- package/data/global/subcomponent/select_input.ttl +11 -0
- package/data/global/subcomponent/spin_button.ttl +11 -0
- package/data/global/subcomponent/spinner.ttl +7 -3
- package/data/global/subcomponent/switch_input.ttl +11 -0
- package/data/global/subcomponent/table-cell.ttl +5 -1
- package/data/global/subcomponent/table-row.ttl +5 -1
- package/data/global/subcomponent/text_input.ttl +11 -0
- package/data/global/subcomponent/textarea_input.ttl +33 -0
- package/data/global/subcomponent/tile-content.ttl +7 -3
- package/data/global/subcomponent/tile-header.ttl +13 -4
- package/data/global/subcomponent/time_input.ttl +11 -0
- package/data/global/subcomponent/timeline-content.ttl +7 -2
- package/data/global/subcomponent/timeline-event.ttl +8 -3
- package/data/global/subcomponent/timeline-expansion_indicator.ttl +6 -1
- package/data/global/subcomponent/timeline-header.ttl +6 -1
- package/data/global/variant/tooltip_dense.ttl +14 -0
- package/data/global/view/settings_view.ttl +5 -1
- package/data/sites/component/blog_card.ttl +11 -0
- package/data/sites/component/quote.ttl +11 -0
- package/data/sites/component/rule.ttl +11 -0
- package/data/sites/component/section.ttl +11 -0
- package/data/sites/group/blog_cards.ttl +11 -0
- package/data/sites/group/xblog_elements.ttl +10 -0
- package/data/sites/layout/blog_page_layout.ttl +11 -0
- package/data/{site → sites}/layout/case_study_layout.ttl +6 -2
- package/data/sites/layout/site_layout.ttl +11 -0
- package/data/sites/pattern/hero-github.ttl +11 -0
- package/data/sites/pattern/hero.ttl +11 -0
- package/data/sites/pattern/info_table.ttl +11 -0
- package/data/sites/pattern/pricing_section.ttl +11 -0
- package/data/sites/pattern/pricing_table.ttl +11 -0
- package/data/sites/pattern/read_more_section.ttl +11 -0
- package/data/sites/pattern/skip_link.ttl +11 -0
- package/data/{site.ttl → sites.ttl} +2 -2
- package/data/sites_webcomponentsprototype/component/blog_cards.ttl +4 -1
- package/data/sites_webcomponentsprototype/component/ctablock.ttl +4 -1
- package/data/sites_webcomponentsprototype/component/list.ttl +5 -2
- package/data/sites_webcomponentsprototype/component/tabs.ttl +5 -2
- package/data/sites_webcomponentsprototype/layout/site_layout.ttl +3 -0
- package/data/sites_webcomponentsprototype/pattern/basic_section.ttl +4 -1
- package/data/sites_webcomponentsprototype/pattern/blog_section.ttl +4 -1
- package/data/sites_webcomponentsprototype/pattern/ctasection.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/equal_heights.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/hero.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/logo_section.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/quote_wrapper.ttl +5 -2
- package/data/sites_webcomponentsprototype/pattern/tiered_list.ttl +5 -2
- package/data/tag/allgood.ttl +7 -0
- package/data/tag/beta.ttl +7 -0
- package/data/tag/candidate.ttl +7 -0
- package/data/tag/devbatch1.ttl +7 -0
- package/data/tag/devbatch2.ttl +7 -0
- package/data/tag/devexternal.ttl +7 -0
- package/data/tag/devreactapproved.ttl +7 -0
- package/data/tag/devreactbase.ttl +7 -0
- package/data/tag/devreactpreapproved.ttl +7 -0
- package/data/tag/devspecial.ttl +7 -0
- package/data/tag/devsveltedone.ttl +7 -0
- package/data/tag/devsveltein-progress.ttl +7 -0
- package/data/tag/divergent.ttl +7 -0
- package/data/tag/docscomplete.ttl +7 -0
- package/data/tag/draft.ttl +7 -0
- package/data/tag/edge.ttl +7 -0
- package/data/tag/global-docs-missing.ttl +7 -0
- package/data/tag/has-no-global-entry.ttl +7 -0
- package/data/tag/lpto-be-upstreamed.ttl +7 -0
- package/data/tag/lptriageblocked-reqs-design.ttl +7 -0
- package/data/tag/lptriageno-upstream.ttl +7 -0
- package/data/tag/lptriagereimplement-and-deprecate.ttl +7 -0
- package/data/tag/lptriagereimplement-and-keep.ttl +7 -0
- package/data/tag/lptriageupstream-and-deprecate.ttl +7 -0
- package/data/tag/minimal.ttl +7 -0
- package/data/tag/needsdefinition.ttl +7 -0
- package/data/tag/needsdiscussion.ttl +7 -0
- package/data/tag/needsdocumentation.ttl +7 -0
- package/data/tag/needsreview.ttl +7 -0
- package/data/tag/needstriage.ttl +7 -0
- package/data/tag/needsupdate.ttl +7 -0
- package/data/tag/notstarted.ttl +7 -0
- package/data/tag/specialadoption-docs.ttl +7 -0
- package/data/tag/stable.ttl +7 -0
- package/data/tag/stylesready.ttl +7 -0
- package/data/tag/triagedbacklog.ttl +7 -0
- package/data/tag/triagedrejected.ttl +7 -0
- package/data/tag/upstream-candidate.ttl +7 -0
- package/data/tag/upstream-compliant.ttl +7 -0
- package/data/tag/upstreamcandidate.ttl +7 -0
- package/data/tag/waiting-for-delta-review.ttl +7 -0
- package/data/tag/wpeinital-implementation.ttl +7 -0
- package/data/tag/wpetriageupstream-and-deprecate.ttl +6 -0
- package/data/tagcategory/channel.ttl +4 -0
- package/data/tagcategory/concept-status.ttl +4 -0
- package/data/tagcategory/concept-type.ttl +4 -0
- package/data/tagcategory/documentation-stage.ttl +4 -0
- package/data/tagcategory/implementation-status.ttl +4 -0
- package/data/tagcategory/lpupstream.ttl +4 -0
- package/data/tagcategory/review-status.ttl +4 -0
- package/data/tagcategory/tmp.ttl +4 -0
- package/definitions/ontology.ttl +133 -14
- package/examples/form-roster.target.json +550 -0
- package/package.json +5 -2
- package/skills/adoption-a1-styles/SKILL.md +115 -0
- package/skills/adoption-a2-components/SKILL.md +170 -0
- package/skills/adoption-a3-forms/SKILL.md +134 -0
- package/skills/anatomy-author/ANATOMY_DSL_SPEC.md +89 -106
- package/skills/anatomy-author/SKILL.md +318 -141
- package/skills/implement-component/SKILL.md +223 -0
- package/skills/specify-component/SKILL.md +195 -0
- package/skills/specify-pattern/SKILL.md +157 -0
- package/source.json +64 -2
- package/specs/README.md +17 -0
- package/src/cli.ts +23 -10
- package/src/commands/index.ts +1 -0
- package/src/commands/sync.tests.ts +430 -0
- package/src/commands/sync.ts +418 -0
- package/src/commands/transform.tests.ts +190 -5
- package/src/commands/transform.ts +163 -67
- package/src/constants.ts +1 -0
- package/src/providers/CodaProvider.tests.ts +94 -0
- package/src/providers/CodaProvider.ts +211 -1
- package/src/providers/detectSmartChips.tests.ts +42 -0
- package/src/providers/detectSmartChips.ts +60 -0
- package/src/scripts/checkDataDeletion.ts +68 -0
- package/src/scripts/evaluateDataDeletion.tests.ts +100 -0
- package/src/scripts/evaluateDataDeletion.ts +100 -0
- package/src/sync/constants.ts +52 -0
- package/src/sync/diffRoster.tests.ts +455 -0
- package/src/sync/diffRoster.ts +241 -0
- package/src/sync/loadTargetSpec.tests.ts +208 -0
- package/src/sync/loadTargetSpec.ts +139 -0
- package/src/sync/renderPlan.tests.ts +144 -0
- package/src/sync/renderPlan.ts +88 -0
- package/src/sync/snapshotTable.tests.ts +31 -0
- package/src/sync/snapshotTable.ts +20 -0
- package/src/sync/toLiveEntries.tests.ts +76 -0
- package/src/sync/toLiveEntries.ts +55 -0
- package/src/sync/types.ts +101 -0
- package/src/transform/collectDataMetrics.tests.ts +108 -0
- package/src/transform/collectDataMetrics.ts +114 -0
- package/src/transform/deltaGuards.tests.ts +136 -0
- package/src/transform/deltaGuards.ts +118 -0
- package/src/transform/expectedTables.tests.ts +99 -0
- package/src/transform/expectedTables.ts +34 -0
- package/src/transform/isValidReferenceUri.tests.ts +45 -0
- package/src/transform/isValidReferenceUri.ts +55 -0
- package/src/transform/materializeInverses.tests.ts +81 -0
- package/src/transform/materializeInverses.ts +78 -0
- package/src/transform/transform.tests.ts +22 -0
- package/src/transform/transform.ts +31 -3
- package/src/transform/transformRow.malformedRefs.tests.ts +127 -0
- package/src/transform/transformRow.tests.ts +82 -0
- package/src/transform/transformRow.ts +90 -7
- package/src/transform/types.ts +11 -0
- package/vitest.config.ts +29 -0
- package/data/apps/pattern/key_value_summary.ttl +0 -7
- package/data/apps_anbox/component/copy_to_clipboard.ttl +0 -7
- package/data/apps_launchpad/component/checkbox.ttl +0 -28
- package/data/apps_launchpad/component/radio.ttl +0 -34
- package/data/apps_launchpad/component/select.ttl +0 -34
- package/data/apps_launchpad/component/textarea.ttl +0 -35
- package/data/apps_launchpad/component/user_avatar.ttl +0 -25
- package/data/apps_lxd/component/copy_to_clipboard.ttl +0 -7
- package/data/apps_workplace/component/label-highlight.ttl +0 -7
- package/data/apps_workplace.ttl +0 -4
- package/data/apps_wpe.ttl +0 -4
- package/data/global/component/code.ttl +0 -7
- package/data/global/component/label.ttl +0 -14
- package/data/global/component/rich_text_editor.ttl +0 -7
- package/data/global/component/search_bar.ttl +0 -7
- package/data/global/component/theme_switcher.ttl +0 -7
- package/data/global/modifier/paper.ttl +0 -6
- package/data/global/pattern/dropdown_button.ttl +0 -7
- package/data/global/subcomponent/divider.ttl +0 -7
- package/data/global_form/component/checkbox_input.ttl +0 -7
- package/data/global_form/component/choices_input.ttl +0 -7
- package/data/global_form/component/combobox_input.ttl +0 -7
- package/data/global_form/component/custom_choices_input.ttl +0 -7
- package/data/global_form/component/datepicker_input.ttl +0 -7
- package/data/global_form/component/rating_input.ttl +0 -7
- package/data/global_form/component/rich_text_input.ttl +0 -7
- package/data/global_form/component/segmented_control_input.ttl +0 -7
- package/data/global_form/component/slider_input.ttl +0 -7
- package/data/global_form/component/switch_input.ttl +0 -7
- package/data/global_form/component/text_input.ttl +0 -7
- package/data/global_form/component/textarea_input.ttl +0 -7
- package/data/global_form/component/wysiwginput.ttl +0 -7
- package/data/global_form/pattern/field.ttl +0 -7
- package/data/global_form/pattern/form.ttl +0 -7
- package/data/global_form/subcomponent/field-description.ttl +0 -7
- package/data/global_form/subcomponent/field-label.ttl +0 -7
- package/data/global_form.ttl +0 -4
- package/data/site/component/blog_card.ttl +0 -7
- package/data/site/component/quote.ttl +0 -7
- package/data/site/component/rule.ttl +0 -7
- package/data/site/component/section.ttl +0 -7
- package/data/site/group/blog_cards.ttl +0 -7
- package/data/site/layout/blog_page_layout.ttl +0 -7
- package/data/site/layout/site_layout.ttl +0 -7
- package/data/site/pattern/hero-github.ttl +0 -7
- package/data/site/pattern/hero.ttl +0 -7
- package/data/site/pattern/info_table.ttl +0 -7
- package/data/site/pattern/pricing_section.ttl +0 -7
- package/data/site/pattern/pricing_table.ttl +0 -7
- package/data/site/pattern/read_more_section.ttl +0 -7
- package/data/site/pattern/skip_link.ttl +0 -7
- package/skills/component-specifier/SKILL.md +0 -412
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps.subcomponent.data_table-header_cell a ds:Subcomponent;
|
|
4
|
+
ds:name "DataTable.HeaderCell";
|
|
5
|
+
ds:summary "The header cell is the interactive column header element within a data table. It handles sorting, resizing, reordering, and pinning for its column. It is a sub-component and cannot function outside of a data table.\n\n\n\nThe header cell is distinct from the body cell. While the body cell displays data values and provides row-level interactions such as inline editing and row actions, the header cell is responsible for column-level controls that affect how the entire column behaves.";
|
|
6
|
+
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "https://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3340-5297&t=8RN2Hpk8UX3gMX3u-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=4604-105392&t=2fO23I8WsyT0YVJ1-4";
|
|
8
|
+
ds:usage "Every column in the data table has a header cell. Its primary purpose is to display the column label. The label should clearly and concisely describe the data shown in the column, so users can scan the header row and immediately understand what each column contains. Choose labels that are specific and unambiguous. For example, \"Last updated\" is more useful than \"Date\", and \"Assigned to\" is clearer than \"User\". Beyond labeling, the header cell also serves as the interface for column-level controls such as sorting, resizing, reordering, and pinning. The designer configures which of these features are available on each column. Not every column needs all capabilities. Focus on enabling the controls that match how users work with the data in that column.\n\n### Sortable columns\n\nSortability is not enabled by default. The designer must explicitly enable sorting on each column. Enable sorting only for columns where the sort order is obvious and helpful to the user. For example, sorting on a MAC address column would not be obvious or helpful, so it should not be enabled. Similarly, utility columns such as an actions column (containing edit/delete buttons) should never be sortable.\n\n### Column resizing configuration\n\nResize handles are shown by default, but the designer can choose to hide them.\n\nColumns that have been resized by the user count as fixed-size columns and no longer participate in the automatic growth behavior of the columns, unless the size is reset to auto (through double-selecting the resize handle or pressing Option + 0).\n\nThe fixed width of a resized column is persisted in browser storage across sessions.";
|
|
9
|
+
ds:guidelines "# Interactions\n\n## Sorting\n\n### Sort interaction cycle\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-53162&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-54052&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-54942&t=2PBanDq6QA2yNcI2-4\n\nSorting follows a three-step cycle on the column header:\n\n1. **First select - sort ascending.** The sort icon changes from the neutral “sort both” (up-and-down arrows) icon to the “sort up” icon. The header cell receives focus (visible focus ring).\n2. **Second select - sort descending.** The icon changes from “sort up” to “sort down”. The arrow animates with a 180-degree clockwise rotation from up to down.\n3. **Third select - return to unsorted.** The icon returns to the neutral “sort both” state. The table data returns to its original unsorted order.\n\nAfter the cycle completes, the next interaction starts the cycle again from ascending.\n\n### Header cell states\n\n**Default (unsorted, not hovered)**\n\nNo sort icon is shown on sortable column headers in their resting state.\n\n**Hover**\n\n**https://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-53162&t=2PBanDq6QA2yNcI2-4**\n\nWhen the user hovers a sortable column header, the header cell receives a hover background color and the cursor becomes a pointer. The “sort both” icon appears (if the column is not currently sorted) to indicate the column is sortable and interactive.\n\nIf the column is already sorted (ascending or descending), hovering still shows the pointer cursor, and the existing sort direction icon remains visible. The header stays interactive.\n\n**Active sort column (not focused)**\n\n**https://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-55830&t=2PBanDq6QA2yNcI2-4**\n\nWhile a column is the active sort column, its header cell retains the hover-style background color persistently, even when the cell is no longer focused. The sort direction icon (up or down) remains visible. This persistent highlight communicates which column the table is currently sorted by.\n\n**Focused**\n\n**https://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-56714&t=2PBanDq6QA2yNcI2-4**\n\nImmediately after selecting to sort, the header cell shows a blue focus ring in addition to the hover-style background and the sort direction icon.\n\n### Sorting with pagination\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-57610&t=2PBanDq6QA2yNcI2-4\n\n**Offset pagination**\n\nIf the table is offset-paginated and the user is not on page 1, selecting a sort header triggers a modal warning before sorting is applied. The warning informs the user that sorting will reset pagination back to page 1. After the user confirms, the table is sorted and pagination resets to page 1.\n\n**Sorting with selection (simple selection)**\n\nIf the table has an active simple selection (not persistent selection), the modal also warns that the selection will be dropped. If both pagination reset and selection drop apply, the two messages are combined into a single warning.\n\n**Warning modal**\n\nThe modal has the title “Sorting will reset pagination and selection” and the body text: “Are you sure you want to sort? Sorting the table differently will reset the pagination and selection.” It contains a “Don’t ask again” checkbox, a “Cancel” button, and a primary action button labeled “Sort and reset the table”. The user can dismiss this warning permanently through the checkbox.\n\n**Keyset pagination**\n\nSorting is not practical on keyset-paginated tables. Sorting must be disabled entirely on keyset-paginated tables. If sorting is needed for a given use case, change the table to offset pagination instead.\n\n\n\n### Backend vs. frontend pagination\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-58594&t=2PBanDq6QA2yNcI2-4\n\nWhen the table is paginated on the backend, selecting a sort column puts the table body into a loading/skeleton state while the newly sorted page is fetched. Column headers remain visible and readable during loading. Only the body rows show gray skeleton placeholder bars. Once the data is fetched, the table displays the sorted results.\n\nIf the table is paginated on the frontend, the sorted results can be shown immediately without a loading state.\n\n### Double row state\n\nIn a double row configuration (where columns are collapsed into stacked rows within cells due to a narrower viewport), a column can only be sorted by its first row.\n\nIf the second row was previously an independent column that was sorted, and the user then decreases the viewport so that column becomes the second row of a double row, the table remains sorted by that second-row value. The header it belongs to shows the sorting state. However, selecting that header cell sorts by the first row instead. After that point, sorting by the second row is no longer possible while in the double row state.\n\n## Column resizing\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-60460&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-61348&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-62238&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-63126&t=2PBanDq6QA2yNcI2-4\n\n### Resize handles\n\nResize handles are thin vertical lines shown at the right edge of each column header. They indicate that a column can be resized. The interaction target for the resize handle is more generous than it appears, to make it easier to grab even for users with lower dexterity. The selectable area extends beyond the visible thin line.\n\nResize handles do not appear:\n\n- **After a checkbox column.** The checkbox column cannot be resized. No resize handle appears between the checkbox column and the first data column.\n- **After the last column.** There is no resize handle at the trailing edge of the last column.\n\n### Mouse interaction\n\n**Header cell hover**\n\nIf a cell header is hovered, the background color change does not extend to the resize handle. The hover background intentionally stops short of the resize handle area.\n\n**Resize handle hover**\n\nWhen the user hovers over the resize handle, the cursor changes to `col-resize`. After hovering the resize handle for 500 ms, the column line gets highlighted with a more visible vertical line extending from the header row down through all data rows. This provides a clear visual indicator of which column border will be resized.\n\n**Dragging**\n\nOnce the user starts dragging the resize handle, a blue “focus” line appears at the column’s edge to indicate which column border is being resized. The column resizes by the amount the user drags left or right. A column cannot be resized beyond its min-width. Only horizontal mouse position changes are taken into account. Vertical movement is ignored.\n\n**Double-select to reset**\n\nThe user can reset a column’s custom size back to the default growth behavior by double-selecting the resize handle.\n\n### Keyboard interaction\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-64014&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-64911&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-65810&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-66694&t=2PBanDq6QA2yNcI2-4\n\n**Initiating a resize**\n\nTo resize a column with the keyboard, the user must first focus the header cell (the header cell shows a visible focus ring).\n\nThe user then presses **Option/Alt + Left/Right arrow keys** to resize the column. While this combination is held, the resize column border indicator (the same one used for mouse interaction) is shown instead of the header cell focus ring.\n\n**Debounce behavior**\n\nThere is a slight debounce after the user stops pressing the keyboard combination, so that the UI does not jump between focus on the header cell and focus on the column border if the user pauses briefly (for example, stops for half a second) and then resumes resizing. After the debounce completes, focus returns to the header cell.\n\n**Reset with keyboard**\n\nIf the user presses **Option/Alt + 0** while a column header is focused, the column size resets to the default auto-sizing behavior.\n\n\n\n## Column reordering\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-67592&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-68484&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-69377&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-70279&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-71181&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-72085&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-72987&t=2PBanDq6QA2yNcI2-4\n\n### Mouse / pointer interaction\n\n**Hover state**\n\nIf the user hovers a header cell, it enters the hovered state and shows the sort icon. This is the entry point for initiating a drag.\n\n**Starting a drag**\n\nIf the user starts dragging, the hover effect on the column header disappears (including the sort both-ways icon). Instead the whole column receives a **3px focused outline**.\n\nAbove the dragged column, a **gray-translucent ghost column** appears. It follows the user’s pointer.\n\n- The **focused column** indicates what column is being dragged.\n- The **ghost column** indicates where the column is being dragged to.\n\n**Moving the ghost column**\n\nAs the user moves while dragging, the ghost column follows. A **drop zone indicator line** also appears. It indicates where the column would be dropped if the user released the column.\n\n**Drop position logic**\n\nWhere the column will be dropped is determined by the edges of the ghost column crossing the **horizontal midpoint** of a target column. For example, if the right edge of the ghost column has crossed a target column’s midpoint, the dragged column will be dropped to the right of that target column.\n\n**Releasing the column**\n\nWhen the user releases the ghost column, the actual column moves to where the drop zone indicator line indicated. **The move is animated.**\n\n**Completed state**\n\nAfter the column has been moved:\n\n- The drop zone indicator line disappears.\n- The column is no longer focused.\n- The ghost column disappears.\n\nThe table returns to a clean, resting state with the new column order.\n\n\n\n### Keyboard interaction\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-73870&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-74768&t=2PBanDq6QA2yNcI2-4\n\n**Initiating a keyboard move**\n\nTo move a column with the keyboard, the user must have a table header cell focused.\n\n**Key combination**\n\nIf a table header cell is focused and **Shift + Arrow Left/Right** is pressed, the column moves left or right (if it can).\n\n**Animation and focus retention**\n\nThe move is animated. The header cell **remains focused** after the move, allowing continued keyboard interaction without re-focusing.\n\n### Constraints\n\n**Immovable columns**\n\n- **Checkbox column:** The checkbox column cannot be moved, and no column can be moved before the checkbox column. It serves as the fixed left boundary.\n- **Action column:** The action column cannot be moved, and no column can be moved after the action column. It serves as the fixed right boundary.\n\n**Pinned column behavior during drag**\n\n- If a **pinned column** is dragged between non-pinned columns, that column becomes **non-pinned**.\n- If a **non-pinned column** is dragged to the left of a pinned column, it becomes **pinned** as well.\n\n## Column pinning\n\n### How to pin a column\n\nThe user pins a column through the **table settings panel** (opened from the gear icon on the far right of the header row). The settings panel displays a list of all columns, each with a pin icon and a delete icon. Selecting the pin icon on a column pins it.\n\nWhen the user **hovers** the pin icon, a tooltip appears explaining what the button does. The tooltip also states that pinning only takes effect when the table is horizontally scrolling, so users are not confused if pinning has no visible result on a table that fits within the viewport.\n\n### Column repositioning on pin\n\nIf the user pins a column that is not already adjacent to the left edge, the column is **moved to the left** into the pinned column group. The settings panel column order updates to reflect the new arrangement.";
|
|
10
|
+
ds:tier ds:apps;
|
|
11
|
+
ds:documentationStage ds:tag.needsdefinition;
|
|
12
|
+
ds:hasProperty [
|
|
13
|
+
a ds:Property;
|
|
14
|
+
ds:name "label";
|
|
15
|
+
ds:summary "The column name displayed in the header cell. Should clearly and concisely describe the data in the column.";
|
|
16
|
+
ds:propertyType "text";
|
|
17
|
+
ds:optional "false"
|
|
18
|
+
], [
|
|
19
|
+
a ds:Property;
|
|
20
|
+
ds:name "sortable";
|
|
21
|
+
ds:summary "Whether the column header responds to sort interactions. Enable only for columns where the sort order is obvious and helpful to the user.";
|
|
22
|
+
ds:propertyType "boolean";
|
|
23
|
+
ds:optional "true";
|
|
24
|
+
ds:constraints "Not available on checkbox or action variants. Disabled entirely on keyset-paginated tables.";
|
|
25
|
+
ds:defaultValue "false"
|
|
26
|
+
], [
|
|
27
|
+
a ds:Property;
|
|
28
|
+
ds:name "resizable";
|
|
29
|
+
ds:summary "Whether the resize handle is shown at the right edge of the header cell.";
|
|
30
|
+
ds:propertyType "boolean";
|
|
31
|
+
ds:optional "true";
|
|
32
|
+
ds:constraints "Not available on checkbox or action variants.";
|
|
33
|
+
ds:defaultValue "true"
|
|
34
|
+
], [
|
|
35
|
+
a ds:Property;
|
|
36
|
+
ds:name "reorderable";
|
|
37
|
+
ds:summary "Whether the column can be dragged to a new position through the header cell or the settings menu.";
|
|
38
|
+
ds:propertyType "boolean";
|
|
39
|
+
ds:optional "true";
|
|
40
|
+
ds:constraints "Checkbox and action columns are never reorderable.";
|
|
41
|
+
ds:defaultValue "true"
|
|
42
|
+
], [
|
|
43
|
+
a ds:Property;
|
|
44
|
+
ds:name "pinnable";
|
|
45
|
+
ds:summary "Whether the column can be pinned to the left side of the table through the settings menu.";
|
|
46
|
+
ds:propertyType "boolean";
|
|
47
|
+
ds:optional "true";
|
|
48
|
+
ds:constraints "Subject to smart pinning constraints. Pinning only takes effect during horizontal scrolling.";
|
|
49
|
+
ds:defaultValue "true"
|
|
50
|
+
], [
|
|
51
|
+
a ds:Property;
|
|
52
|
+
ds:name "sort-direction";
|
|
53
|
+
ds:summary "The current sort state of the column. Follows a three-step cycle: ascending, descending, unsorted.";
|
|
54
|
+
ds:propertyType "choice";
|
|
55
|
+
ds:optional "true";
|
|
56
|
+
ds:constraints "Only applies when sortable is true.";
|
|
57
|
+
ds:defaultValue "unsorted"
|
|
58
|
+
], [
|
|
59
|
+
a ds:Property;
|
|
60
|
+
ds:name "column-width";
|
|
61
|
+
ds:summary "The width of the column. Defined as a fractional unit (fr) for proportional sizing or a fixed pixel value. Columns resized by the user become fixed-width and no longer participate in automatic growth.";
|
|
62
|
+
ds:propertyType "text";
|
|
63
|
+
ds:optional "true";
|
|
64
|
+
ds:defaultValue "auto"
|
|
65
|
+
], [
|
|
66
|
+
a ds:Property;
|
|
67
|
+
ds:name "min-width";
|
|
68
|
+
ds:summary "The minimum width of the column. A column cannot be resized below this value.";
|
|
69
|
+
ds:propertyType "number";
|
|
70
|
+
ds:optional "true";
|
|
71
|
+
ds:constraints "Must be a positive value in rem."
|
|
72
|
+
];
|
|
73
|
+
ds:parentComponent ds:apps.pattern.data_table.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps.subcomponent.data_table-pagination_bar a ds:Subcomponent;
|
|
4
|
+
ds:name "DataTable.PaginationBar";
|
|
5
|
+
ds:summary "The pagination bar is the navigation bar anchored to the bottom of the table that lets users move between pages of data. The data table supports two pagination variants, offset and keyset, chosen based on the backend's pagination model. Both variants share a common pagination bar but differ in the controls and information they expose.";
|
|
6
|
+
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "https://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3340-6556&t=8RN2Hpk8UX3gMX3u-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=4571-81816&t=2fO23I8WsyT0YVJ1-4";
|
|
8
|
+
ds:usage "Pagination splits a large dataset into discrete pages, loading and displaying only a subset of rows at a time. This reduces initial load time, keeps the interface responsive, and prevents the browser from rendering thousands of rows at once. Without pagination, the table loads the entire dataset upfront, which works for small, static datasets but becomes a performance and usability problem as the row count grows.\n\nThe decision to paginate depends on both the size of the dataset and how users interact with it. If users need to see all items at a glance or rely on browser search to find specific rows, pagination can get in the way. If the dataset is large, dynamic, or backend-driven, pagination is almost always the right choice.\n\n## When to use\n\n- The dataset contains more than a few dozen rows.\n- Data is fetched from a backend and loading all items at once would be slow or impractical.\n- Users work through data page by page rather than needing a complete view of all items simultaneously.\n- Users benefit from stable page positions as a reference point. Pagination gives users a sense of location within the dataset, making it easier to return to a previously seen item or communicate its position to others (for example, “it’s on page 3”).\n- The table supports sorting, filtering, or grouping that triggers new data fetches.\n\n## When not to use\n\n- The dataset is small and static, such as a configuration table with fewer than 20 rows.\n- Users need to see all items at once to compare or scan across the full set.\n- The table is used for display only and the full dataset is already available on the frontend.\n\n## Offset vs. keyset pagination\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-76133&t=2PBanDq6QA2yNcI2-4\n\nOffset pagination is for backends that support offset-based pagination. It provides full random-access navigation across pages.\n\nKeyset pagination is for backends that support keyset-based pagination. Because the backend cannot report a total item count or support arbitrary page jumps, the UI adapts accordingly.\n\n## Page-size options\n\nThe default page-size options are **50, 75, 100**. The designer can change these when the context demands different amounts. For example, a table displaying log entries or audit events may benefit from larger page sizes (such as 100, 250, 500) because users typically scan many rows quickly. A table displaying detailed records where each row requires careful reading may work better with smaller page sizes (such as 10, 25, 50) to avoid overwhelming the user.\n\n## Positioning\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-76173&t=2PBanDq6QA2yNcI2-4\n\nThe pagination bar is **sticky** and always visible at the bottom of the table container, even when the table body is scrolled. This makes sure users can navigate between pages without scrolling to the bottom of the table first. On dedicated table pages, the pagination bar sits at the bottom of the page.\n\n**Border treatment** varies with scroll state:\n\n- **1px border** when there are no items scrolled underneath (content does not overflow).\n- **2px border** when there are items below the visible area (content overflows).\n\nWhen **multiple tables** appear on the same page, each table gets its own pagination bar that hugs the table’s content directly, rather than being pushed to the bottom of the page.";
|
|
9
|
+
ds:guidelines "# Interactions\n\n## Page selector\n\nThe page selector allows the user to jump directly to a specific page without stepping through pages one at a time. It is a **browser-native dropdown** rather than a free-text input field. This avoids the need for input validation and error states inside a pagination bar, which are difficult to handle well. A dropdown restricts the user to valid inputs only. When the dropdown is focused, the user can still type a number and the dropdown selects the matching entry.\n\n## Navigation buttons\n\nIn offset pagination, four buttons are provided:\n\n- Jump to **first page** (double left arrow)\n- Go **one page back** (single left arrow)\n- Go **one page forward** (single right arrow)\n- Jump to **last page** (double right arrow)\n\nIn keyset pagination, only the previous and next buttons are shown.\n\nWhen an action is not possible, for example the previous-page button when the user is already on the first page, the button is **disabled**.\n\n## Keyset item count tooltip\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-76134&t=2PBanDq6QA2yNcI2-4\n\nA **tooltip** is available on hover over the item count summary in keyset pagination. It explains why no definite total can be given. This addresses potential user confusion about the “more than X items” messaging by clarifying that keyset pagination does not provide a total count.\n\n";
|
|
10
|
+
ds:tier ds:apps;
|
|
11
|
+
ds:documentationStage ds:tag.needsdefinition;
|
|
12
|
+
ds:hasProperty [
|
|
13
|
+
a ds:Property;
|
|
14
|
+
ds:name "pagination-mode";
|
|
15
|
+
ds:summary "The pagination strategy. Offset provides random-access page navigation with a page selector, jump-to-first, and jump-to-last buttons. Keyset supports forward and back navigation only and displays an approximate item count.";
|
|
16
|
+
ds:propertyType "choice";
|
|
17
|
+
ds:optional "false";
|
|
18
|
+
ds:constraints "Inherited from the data table. Keyset pagination is incompatible with grouping and sorting.";
|
|
19
|
+
ds:defaultValue "offset"
|
|
20
|
+
], [
|
|
21
|
+
a ds:Property;
|
|
22
|
+
ds:name "page-size-options";
|
|
23
|
+
ds:summary "The set of page sizes available in the page-size selector dropdown. The first value in the list is used as the default page size.";
|
|
24
|
+
ds:propertyType "list of text";
|
|
25
|
+
ds:optional "true";
|
|
26
|
+
ds:constraints "Inherited from the data table. Each value must be a positive integer.";
|
|
27
|
+
ds:defaultValue "50, 75, 100"
|
|
28
|
+
], [
|
|
29
|
+
a ds:Property;
|
|
30
|
+
ds:name "item-label";
|
|
31
|
+
ds:summary "A context-specific noun used in the item amount label and the item count summary in place of \"Items\" (for example, \"Machines\" or \"Orders\").";
|
|
32
|
+
ds:propertyType "text";
|
|
33
|
+
ds:optional "true";
|
|
34
|
+
ds:constraints "Inherited from the data table.";
|
|
35
|
+
ds:defaultValue "Items"
|
|
36
|
+
], [
|
|
37
|
+
a ds:Property;
|
|
38
|
+
ds:name "item-count-display";
|
|
39
|
+
ds:summary "How the total item count is shown. Offset pagination displays an exact total (for example, \"out of 942 items\"). Keyset pagination displays an approximate total (for example, \"of more than 150 items\") because the backend cannot report a definitive count. A tooltip on the keyset item count explains why no exact total is available.";
|
|
40
|
+
ds:propertyType "choice";
|
|
41
|
+
ds:optional "true";
|
|
42
|
+
ds:defaultValue "Determined by pagination-mode."
|
|
43
|
+
];
|
|
44
|
+
ds:parentComponent ds:apps.pattern.data_table.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps.subcomponent.data_table-persistent_selection a ds:Subcomponent;
|
|
4
|
+
ds:name "DataTable.PersistentSelection";
|
|
5
|
+
ds:summary "The persistent selection panel is a floating panel that shows the current selection in persistent selection mode. It displays selected items by their human-readable unique ID and provides an expanded view for reviewing the full selection with all columns visible. The panel only appears when the table uses persistent selection mode.";
|
|
6
|
+
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "https://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3340-7087&t=8RN2Hpk8UX3gMX3u-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=4815-84027&t=2fO23I8WsyT0YVJ1-4";
|
|
8
|
+
ds:usage "The persistent selection panel supports workflows where users need to build up a selection of items across multiple table pages before performing a bulk action. Without it, users would lose their selection every time they navigate to a different page, sort, or filter. The panel makes the current selection visible and manageable at all times.\n\nIn enterprise applications, users often work with large datasets where the items they need to act on are not conveniently grouped on a single page. For example, a system administrator managing a fleet of machines may need to select specific instances across several pages to reassign them to a different team, apply a configuration change, or schedule maintenance. The persistent selection panel lets them browse through pages, pick items as they go, and review the full selection before committing to the action. Without persistent selection, this workflow would require the user to memorize or manually track which items they need, then act on them one page at a time.\n\n## When to use\n\n- Users need to select items across multiple table pages before performing a bulk action.\n- The dataset is large enough that relevant items are spread across different pages.\n- Users need to review and adjust their selection before committing to an action.\n\n## When not to use\n\n- All selectable items fit on a single table page. Simple selection is sufficient in this case.\n- The table does not support row selection at all.\n- Bulk actions are not a feature of the table.\n\n## Large selections\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-78504&t=2PBanDq6QA2yNcI2-4\n\nFor tables with hundreds of thousands of items, users could potentially select a very large number. It would be impractical to show all of them in the compact panel. After a certain threshold, a warning message appears when the user scrolls to the bottom of the panel, telling them that the selection is too large to show inline and that they should use the expand function to view the full selection.\n\nIf there are performance concerns related to the number of selected items or frontend pagination of the selection, a hard limit on the number of items a user can select may need to be considered.";
|
|
9
|
+
ds:guidelines "# Interactions\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3486-78505&t=2PBanDq6QA2yNcI2-4\n\n## Opening the panel\n\nSelecting the persistent selection button in the action bar opens the dark panel labeled “Current selection:” that shows the list of selected items.\n\n## Item display and ordering\n\nEach item in the panel shows its human-readable unique ID, usually the value from the first column (the name column). Each item has an “X” button to remove it individually from the selection. This per-row deselect behavior is the same in both the floating and expanded views.\n\nThe panel shows selected items in the order they were selected, with the most recently selected item on top.\n\n## Panel growth and scrolling\n\nAs the user selects more items, the panel grows in size until it reaches a maximum height. After that, the panel content becomes scrollable.\n\n## https://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3579-69949&t=2PBanDq6QA2yNcI2-4\n\n\n\n## Expanded (popped out) view\n\nBefore performing a bulk action, a user might want to inspect their selection more closely, for example using the supporting information in other columns. Sometimes they might not remember the full picture of their selection based on the name column alone.\n\nTo support this, the action bar and persistent selection panel can be “popped out” into an expanded view that shows the selection as a full table with all columns visible. The transition between the floating action bar and the expanded view is animated. The smaller floating action bar visually transforms into the expanded modal-style selection and action bar in a seamless transition.\n\nThere are two ways to close the expanded view:\n\n1. **Collapse button** - selecting the decrease/collapse icon at the top right of the expanded panel returns it to the floating version. The same animated transition plays in reverse.\n2. **Persistent selection button** - selecting the persistent selection button closes the popped-out state entirely, returning to the floating version and also closing the panel.\n\nThe expanded view has a maximum height. Once reached, the table body becomes scrollable. The table cannot show more than 50 items per page. If there are more than 50 items in the selection, a simplified pagination control appears, allowing the user to page through the selection (for example, “of 4 pages” with forward/back navigation arrows).\n\n\n\nA prototype of the rough interaction of the collapse and expand of the panel can be found here: {\"Name\":\"Expand Action Bar Prototype\",\"Image\":{\"type\":\"imageurlref\",\"url\":\"https://s3-alpha.figma.com/thumbnails/a3563251-6cd3-4486-9b57-4f3321524cee?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAQ4GOSFWC2FGOZM5C%2F20260816%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20260816T120000Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=349a083b5f3d8f998c60130c06516666d353b48eefbd5ad518554b4a501703a8\",\"outline\":true},\"Url\":{\"type\":\"urlref\",\"url\":\"https://www.figma.com/make/4V5OfFCOm2lYDgYnMVKxTl/Expand-Action-Bar-Prototype?t=hWsBoH4yq28uty6g-1\",\"name\":\"\"},\"Modified\":{\"type\":\"dt\",\"input\":\"5/21/2026 3:52:33 PM\",\"epoch\":1779371553.337,\"formatted\":\"5/21/2026\"},\"ModifiedBy\":{\"type\":\"obj\",\"value\":{\"Handle\":\"Maximilian Blazek\",\"Avatar\":{\"type\":\"imageurlref\",\"url\":\"https://s3-alpha.figma.com/profile/534b2668-e456-4568-98c9-60d645790fdc\",\"outline\":true}}},\"Label\":\"2356039340008127983\",\"CommentsCount\":0}\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3579-72617&t=2PBanDq6QA2yNcI2-4\n\n## Deselecting items\n\nUsers can deselect individual items by selecting the “X” button on each row in either the floating panel or the expanded view.\n\nSelecting the main deselect (X) button in the action bar deselects everything. If the expanded view is open, the modal closes, and the floating bar is also hidden since nothing remains selected.\n\nAfter the user deselects everything through the main deselect button, a toast notification appears with a message such as “Deselected everything by accident?” with an undo option. This toast disappears after 10 seconds. Proper accessibility needs to be provided for this toast.\n\n## Tooltips\n\nAll interactive selection elements have tooltips on hover:\n\nTable 6\n\n";
|
|
10
|
+
ds:tier ds:apps;
|
|
11
|
+
ds:documentationStage ds:tag.needsdefinition;
|
|
12
|
+
ds:hasProperty [
|
|
13
|
+
a ds:Property;
|
|
14
|
+
ds:name "unique-identifier-field";
|
|
15
|
+
ds:summary "The column or field used to identify each selected item in the panel. Usually the first column (the name column). The panel displays this value as the human-readable label for each selected item.";
|
|
16
|
+
ds:propertyType "text";
|
|
17
|
+
ds:optional "false";
|
|
18
|
+
ds:constraints "Inherited from the data table."
|
|
19
|
+
], [
|
|
20
|
+
a ds:Property;
|
|
21
|
+
ds:name "max-selection-count";
|
|
22
|
+
ds:summary "A hard limit on the number of items a user can select. Use when there are performance concerns related to the number of selected items or frontend pagination of the selection.";
|
|
23
|
+
ds:propertyType "number";
|
|
24
|
+
ds:optional "true";
|
|
25
|
+
ds:constraints "Inherited from the data table. Must be a positive integer."
|
|
26
|
+
], [
|
|
27
|
+
a ds:Property;
|
|
28
|
+
ds:name "max-items-per-page";
|
|
29
|
+
ds:summary "The maximum number of selected items shown per page in the expanded view before simplified pagination controls appear.";
|
|
30
|
+
ds:propertyType "number";
|
|
31
|
+
ds:optional "true";
|
|
32
|
+
ds:constraints "Must be a positive integer.";
|
|
33
|
+
ds:defaultValue "50"
|
|
34
|
+
], [
|
|
35
|
+
a ds:Property;
|
|
36
|
+
ds:name "undo-toast-duration";
|
|
37
|
+
ds:summary "How long the undo toast remains visible after the user deselects all items through the main deselect button.";
|
|
38
|
+
ds:propertyType "number";
|
|
39
|
+
ds:optional "true";
|
|
40
|
+
ds:constraints "Must be a positive integer, in seconds.";
|
|
41
|
+
ds:defaultValue "10"
|
|
42
|
+
], [
|
|
43
|
+
a ds:Property;
|
|
44
|
+
ds:name "large-selection-threshold";
|
|
45
|
+
ds:summary "The number of selected items after which a warning message appears at the bottom of the compact panel, advising the user to use the expanded view. When not set, no threshold warning is shown.";
|
|
46
|
+
ds:propertyType "number";
|
|
47
|
+
ds:optional "true";
|
|
48
|
+
ds:constraints "Must be a positive integer."
|
|
49
|
+
];
|
|
50
|
+
ds:parentComponent ds:apps.pattern.data_table.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps.subcomponent.data_table-settings_menu a ds:Subcomponent;
|
|
4
|
+
ds:name "DataTable.SettingsMenu";
|
|
5
|
+
ds:summary "Almost all configurable aspects of the table are available through the table settings menu. This menu provides a centralized interface accessed through a settings wheel (gear) icon button in the table header for column reordering, column pinning, column visibility, and resetting user customizations. It also links to a keyboard shortcuts reference modal.";
|
|
6
|
+
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "https://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3350-3178&t=8RN2Hpk8UX3gMX3u-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3350-3916&t=8RN2Hpk8UX3gMX3u-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=4820-93903&t=2fO23I8WsyT0YVJ1-4";
|
|
8
|
+
ds:usage "The settings menu gives users control over how the table is structured and displayed. It is enabled by default on every data table. It is the central place for adjusting column order, visibility, and pinning without leaving the table context. If any of these customization features are enabled on the table, the settings menu must be present to provide access to them. The settings menu is only hidden when the designer has actively disabled all customization features, making the table fully static.\n\nFor example, a network operations team may want to pin a status column and hide columns irrelevant to their role, while a capacity planning team viewing the same table may prioritize different columns entirely.\n\n## When to use\n\n- The table has enough columns that users benefit from hiding, reordering, or pinning them.\n- Different users or roles interact with the same table but care about different columns.\n- The table is a core part of the user’s daily workflow and they are likely to customize it over time.\n\n## When not to use\n\n- The designer has disabled all customization features (column reordering, pinning, and visibility). Only then can the settings menu be hidden.\n- The table is temporary or shown briefly, such as in a modal or a summary view, where customization adds no value.";
|
|
9
|
+
ds:guidelines "# Interactions\n\n## Button states\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3579-76790&t=2PBanDq6QA2yNcI2-4\n\n- **Hover** - the gear icon displays a hover effect. A tooltip appears (for example, “Open table settings”).\n- **Select** - selecting the gear icon opens the settings dropdown menu.\n\n## Column reordering through drag-and-drop\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3579-78680&t=2PBanDq6QA2yNcI2-4\n\n\n\nUsers can reorder columns by dragging items in the settings menu. The first item corresponds to the first table column, the second to the second column, and so on.\n\n### Starting a drag\n\nThe user initiates a drag from the **drag handle area** on the left side of a menu item. When dragging begins:\n\n- The item being reordered receives a **3px focus outline** (border-primary color) and stays in its original position throughout the drag. This prevents items from shifting around during the interaction, which could lead to accidental misplacement.\n- A **“ghost item”** appears directly over the original item. The ghost has a gray background with opacity and a blue secondary border.\n\n### During the drag\n\n- The ghost item follows the cursor as the user drags up or down.\n- A **3px-wide drop zone indicator line** (border-primary color) appears between items, showing where the item will land if the user releases.\n- The original item retains its focus outline so the user always knows which item is being moved.\n\n### Drop zone change logic\n\nThe drop position updates based on a **halfway-point rule**: the drop zone shifts past an item once the upper or lower edge of the ghost item crosses the vertical midpoint of the item currently being dragged over. For example, if the ghost item’s bottom edge has not yet crossed the midpoint of a given row, the drop zone remains above that row. Once it crosses, the drop zone moves below it.\n\n### Completing the drop\n\nWhen the user releases, the item moves to the position indicated by the drop zone line. The reorder **is animated**.\n\n### \n\n## Column reordering through keyboard\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3579-78937&t=2PBanDq6QA2yNcI2-4\n\nTo reorder columns using the keyboard:\n\n1. Focus a column item in the settings menu.\n2. Press **Shift + Arrow Up** or **Shift + Arrow Down** to move the item.\n\nThe move happens immediately on key press, is animated, and the item remains focused after moving.\n\n## Column pinning toggle\n\nSelecting the **pin icon** on a menu item pins the corresponding column. Refer to the column pinning section for full pinning behavior.\n\n## Column visibility toggle\n\nSelecting the **eye (show/hide) icon** on a menu item toggles the corresponding column between visible and hidden.\n\n## Tooltips\n\nEvery interactive element in the settings menu and the settings button itself displays a tooltip on hover:\n\nTable 2\n\n## Reset table settings\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3579-78939&t=2PBanDq6QA2yNcI2-4\n\nThe “Reset table settings” action link at the bottom of the menu resets all user-made table customizations to their defaults. This includes column resizing, column reordering, column pinning, column visibility, and any other saved preferences.\n\nThese table settings are persisted in **browser cross-session storage**. Resetting clears everything written to that storage.\n\nA **confirmation modal** is shown after selecting the link. The table is only reset if the user confirms.\n\n## Keyboard shortcuts modal\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3579-79945&t=2PBanDq6QA2yNcI2-4\n\nhttps://www.figma.com/design/WGHcOmGMEUF9hMAEoRafL8/%F0%9F%93%95-Pragma---documentation-visuals?node-id=3579-81019&t=2PBanDq6QA2yNcI2-4\n\nThe “Table keyboard shortcuts” action link at the bottom of the menu opens a **modal dialog** titled “Table keyboard shortcuts”. The modal has a two-column layout with “Command” and “Shortcut” headers.\n\n### General navigation\n\nTable 3\n\n### While a header cell is focused\n\nTable 4\n\n### While a table settings item is focused\n\nTable 5";
|
|
10
|
+
ds:tier ds:apps;
|
|
11
|
+
ds:documentationStage ds:tag.needsdefinition;
|
|
12
|
+
ds:hasProperty [
|
|
13
|
+
a ds:Property;
|
|
14
|
+
ds:name "settings-menu";
|
|
15
|
+
ds:summary "Whether the settings gear icon and menu are shown in the header row.";
|
|
16
|
+
ds:propertyType "boolean";
|
|
17
|
+
ds:optional "false";
|
|
18
|
+
ds:constraints "Inherited from the data table. Only set to false when all column customization features are disabled.";
|
|
19
|
+
ds:defaultValue "true"
|
|
20
|
+
], [
|
|
21
|
+
a ds:Property;
|
|
22
|
+
ds:name "grouping-columns";
|
|
23
|
+
ds:summary "The set of columns that support grouping. Columns in this list display a \"Group by\" button in the settings menu.";
|
|
24
|
+
ds:propertyType "list of text";
|
|
25
|
+
ds:optional "false";
|
|
26
|
+
ds:constraints "Inherited from the data table. Each value must reference an enumerated-value column."
|
|
27
|
+
], [
|
|
28
|
+
a ds:Property;
|
|
29
|
+
ds:name "reorderable-columns";
|
|
30
|
+
ds:summary "Whether columns can be reordered through drag-and-drop or keyboard in the settings menu. When false, drag handles are hidden.";
|
|
31
|
+
ds:propertyType "boolean";
|
|
32
|
+
ds:optional "false";
|
|
33
|
+
ds:defaultValue "true"
|
|
34
|
+
], [
|
|
35
|
+
a ds:Property;
|
|
36
|
+
ds:name "pinnable-columns";
|
|
37
|
+
ds:summary "Whether the pin icon is available on column items in the settings menu. When false, pin icons are hidden.";
|
|
38
|
+
ds:propertyType "boolean";
|
|
39
|
+
ds:optional "false";
|
|
40
|
+
ds:defaultValue "true"
|
|
41
|
+
], [
|
|
42
|
+
a ds:Property;
|
|
43
|
+
ds:name "hideable-columns";
|
|
44
|
+
ds:summary "Whether the eye (visibility) icon is available on column items in the settings menu. When false, visibility icons are hidden.";
|
|
45
|
+
ds:propertyType "boolean";
|
|
46
|
+
ds:optional "false";
|
|
47
|
+
ds:defaultValue "true"
|
|
48
|
+
], [
|
|
49
|
+
a ds:Property;
|
|
50
|
+
ds:name "reset-enabled";
|
|
51
|
+
ds:summary "Whether the \"Reset table settings\" action link is shown at the bottom of the menu. Resetting clears all user customizations persisted in browser storage.";
|
|
52
|
+
ds:propertyType "boolean";
|
|
53
|
+
ds:optional "false";
|
|
54
|
+
ds:defaultValue "true"
|
|
55
|
+
], [
|
|
56
|
+
a ds:Property;
|
|
57
|
+
ds:name "keyboard-shortcuts-enabled";
|
|
58
|
+
ds:summary "Whether the \"Table keyboard shortcuts\" action link is shown at the bottom of the menu.";
|
|
59
|
+
ds:propertyType "boolean";
|
|
60
|
+
ds:optional "false";
|
|
61
|
+
ds:defaultValue "true"
|
|
62
|
+
];
|
|
63
|
+
ds:parentComponent ds:apps.pattern.data_table.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps.subcomponent.drawer-content a ds:Subcomponent;
|
|
4
|
+
ds:name "Drawer.Content";
|
|
5
|
+
ds:summary "";
|
|
6
|
+
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "";
|
|
8
|
+
ds:usage "";
|
|
9
|
+
ds:guidelines "";
|
|
10
|
+
ds:tier ds:apps;
|
|
11
|
+
ds:documentationStage ds:tag.needsdefinition;
|
|
12
|
+
ds:parentComponent ds:apps.pattern.drawer.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps.subcomponent.drawer-footer a ds:Subcomponent;
|
|
4
|
+
ds:name "Drawer.Footer";
|
|
5
|
+
ds:summary "";
|
|
6
|
+
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "";
|
|
8
|
+
ds:usage "";
|
|
9
|
+
ds:guidelines "";
|
|
10
|
+
ds:tier ds:apps;
|
|
11
|
+
ds:documentationStage ds:tag.needsdefinition;
|
|
12
|
+
ds:parentComponent ds:apps.pattern.drawer.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps.subcomponent.drawer-header a ds:Subcomponent;
|
|
4
|
+
ds:name "Drawer.Header";
|
|
5
|
+
ds:summary "";
|
|
6
|
+
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "";
|
|
8
|
+
ds:usage "";
|
|
9
|
+
ds:guidelines "";
|
|
10
|
+
ds:tier ds:apps;
|
|
11
|
+
ds:documentationStage ds:tag.needsdefinition;
|
|
12
|
+
ds:parentComponent ds:apps.pattern.drawer.
|
|
@@ -4,4 +4,8 @@ ds:apps.subcomponent.file_tree-node a ds:Subcomponent;
|
|
|
4
4
|
ds:name "FileTree.Node";
|
|
5
5
|
ds:summary "";
|
|
6
6
|
ds:anatomyDsl "";
|
|
7
|
-
ds:
|
|
7
|
+
ds:anatomyClassic "";
|
|
8
|
+
ds:usage "";
|
|
9
|
+
ds:guidelines "";
|
|
10
|
+
ds:tier ds:apps;
|
|
11
|
+
ds:parentComponent ds:apps.component.file_tree.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps.subcomponent.log a ds:Subcomponent;
|
|
4
|
+
ds:name "Log";
|
|
5
|
+
ds:summary "";
|
|
6
|
+
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "";
|
|
8
|
+
ds:usage "";
|
|
9
|
+
ds:guidelines "";
|
|
10
|
+
ds:tier ds:apps;
|
|
11
|
+
ds:documentationStage ds:tag.needstriage.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps.subcomponent.side_panel-content a ds:Subcomponent;
|
|
4
|
+
ds:name "SidePanel.Content";
|
|
5
|
+
ds:summary "";
|
|
6
|
+
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "";
|
|
8
|
+
ds:usage "";
|
|
9
|
+
ds:guidelines "";
|
|
10
|
+
ds:tier ds:apps;
|
|
11
|
+
ds:documentationStage ds:tag.needsdefinition;
|
|
12
|
+
ds:parentComponent ds:apps.pattern.side_panel.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps.subcomponent.side_panel-footer a ds:Subcomponent;
|
|
4
|
+
ds:name "SidePanel.Footer";
|
|
5
|
+
ds:summary "";
|
|
6
|
+
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "";
|
|
8
|
+
ds:usage "";
|
|
9
|
+
ds:guidelines "";
|
|
10
|
+
ds:tier ds:apps;
|
|
11
|
+
ds:documentationStage ds:tag.needsdefinition;
|
|
12
|
+
ds:parentComponent ds:apps.pattern.side_panel.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps.subcomponent.side_panel-header a ds:Subcomponent;
|
|
4
|
+
ds:name "SidePanel.Header";
|
|
5
|
+
ds:summary "";
|
|
6
|
+
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "";
|
|
8
|
+
ds:usage "";
|
|
9
|
+
ds:guidelines "";
|
|
10
|
+
ds:tier ds:apps;
|
|
11
|
+
ds:documentationStage ds:tag.needsdefinition;
|
|
12
|
+
ds:parentComponent ds:apps.pattern.side_panel.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps_anbox.component.theme_switcher a ds:Component;
|
|
4
|
+
ds:name "ThemeSwitcher";
|
|
5
|
+
ds:summary "A control used to switch the interface theme between light and dark modes. It helps users quickly choose the visual appearance that is most comfortable for their environment, preference, or accessibility needs. Use it when the product supports multiple visual themes and users may need an explicit, persistent way to change them.\n\n";
|
|
6
|
+
ds:anatomyDsl "@prefix ds: <https://ds.canonical.com/> .\n\nds:global.component.theme_switcher a ds:Component ; \n ds:name \"Theme switcher\" ; \n ds:description \"Control that lets users switch the interface theme between light and dark modes, typically represented with sun and moon visuals.\" ; \n ds:tier ds:global ; \n ds:whenToUse \"When a product supports multiple themes and users need a quick, explicit way to change the interface appearance.\" ; \n ds:whenNotToUse \"When the product supports only one theme, or when theme changes are controlled automatically without user override.\" ; \n ds:guidelines \"Use clear sun and moon affordances, preserve the user's selection, provide accessible labels and keyboard support, and communicate the current state clearly to assistive technologies.\" .";
|
|
7
|
+
ds:anatomyClassic "The theme switcher is composed of a small set of visual and interactive elements that communicate state and afford interaction clearly.\n\n### Parts\n\n- **Container**\n - The clickable/tappable area that wraps the entire control.\n - Defines hit area, spacing, and layout.\n - Appears as an icon highlighting the current state of the switcher.\n- **Toggle / Button**\n - The main interactive element.\n - Handles user input (click, tap, keyboard).\n - Visually represents the current state.\n- **Icon (light)**\n - Typically a sun symbol.\n - Represents the light theme state.\n - May be shown when active or as part of a transition.\n- **Icon (dark)**\n - Typically a moon symbol.\n - Represents the dark theme state.\n - May replace or animate from the light icon.\n- **Focus indicator**\n - Visible outline or highlight when the component receives keyboard focus.\n - Must be clearly visible in both light and dark themes.\n- **Label (optional)**\n - Text describing the control (e.g., “Light”, “Dark”, “Theme”).\n - Can be visible or accessible-only.\n\n\n\n### States\n\n- **Default**\n - Shows current theme (sun or moon).\n- **Hover**\n - Indicates interactivity on pointer devices.\n- **Active / Pressed**\n - Brief feedback when user activates the control.\n- **Focused**\n - Visible focus ring for keyboard navigation.\n- **Selected (Light)**\n - Light theme is active.\n- **Selected (Dark)**\n - Dark theme is active.\n- **Disabled**\n - Non-interactive state when switching is unavailable.";
|
|
8
|
+
ds:usage "## When to use\n\nUse this component when users need a direct way to switch between supported visual themes.\n\nRecommended usage scenarios:\n\n- **User preference override** \nUse the theme switcher when users should be able to choose light or dark mode regardless of the system default.\n- **Long-running applications** \nUse it in products users keep open for long periods, where lighting conditions may change during use.\n- **Accessibility and comfort** \nUse it when darker or lighter interfaces may improve readability, reduce glare, or better fit user comfort.\n- **Global application setting** \nUse it when theme is a product-level preference that should affect the full interface consistently.\n\n## When not to use\n\nAvoid using this component when changing theme is not a real user choice or when it affects too small a scope.\n\nAvoid usage:\n\n- **Single-theme products** \nDo not show a theme switcher if only one visual theme is available.\n- **Temporary visual effects** \nDo not use it for controls that only change a local surface, card, or panel rather than the product theme.\n- **Unclear or decorative toggles** \nAvoid using icon-only controls without an accessible name or without a clear indication of the current state.\n- **Automatic-only behavior** \nAvoid showing it if the theme is always inherited from system settings and the user cannot override it.";
|
|
9
|
+
ds:guidelines "## **Accessibility**\n\n### **Accessible name**\n\nThe component must expose a clear accessible name such as “Toggle theme”, “Switch to dark mode”, or “Switch to light mode”.\n\n### **State communication**\n\nAssistive technologies must be able to understand the current state. If implemented as a toggle, expose whether it is on or off in a way that maps clearly to the selected theme.\n\n### **Contrast**\n\nEnsure the control, icons, focus indicator, and any labels remain visible and meet contrast requirements in both light and dark themes.\n\n### **Target size**\n\nThe interactive area should be large enough for pointer and touch interaction, not just the visible icon.\n\n## Device specification\n\n### **Desktop**\n\nPlace the theme switcher in a predictable global location, such as the top navigation bar, settings area, or profile/preferences menu.\n\n### **Mobile**\n\nUse a touch-friendly target and avoid placing the control too close to other global actions.";
|
|
10
|
+
ds:tier ds:apps_anbox.
|
|
@@ -4,10 +4,20 @@ ds:apps_anbox.pattern.side_menu a ds:Pattern;
|
|
|
4
4
|
ds:name "SideMenu";
|
|
5
5
|
ds:summary "A left-hand side menu that is open by default but can also be closed via a button. Can contain multiple other children.";
|
|
6
6
|
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "";
|
|
8
|
+
ds:usage "## When to use\n\nUse the side menu when you want to give users the ability to close it and increase the amount of screen width available.\n\n## When not to use\n\nAvoid using the side menu when its children would be pretty small in width e.g: only icons and you don’t need to give users the ability to collapse the menu.";
|
|
9
|
+
ds:guidelines "";
|
|
7
10
|
ds:tier ds:apps_anbox;
|
|
8
11
|
ds:hasProperty [
|
|
9
12
|
a ds:Property;
|
|
10
13
|
ds:name "children";
|
|
11
|
-
ds:
|
|
14
|
+
ds:summary "The elements to render inside the menu";
|
|
15
|
+
ds:propertyType "element";
|
|
12
16
|
ds:optional "false"
|
|
17
|
+
];
|
|
18
|
+
ds:changeLog [
|
|
19
|
+
a ds:ChangeLogEntry;
|
|
20
|
+
ds:timestamp "2026-02-04T00:00:00.000+01:00";
|
|
21
|
+
ds:change "Initial draft";
|
|
22
|
+
ds:changeType "change"
|
|
13
23
|
].
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps_debcrafters.component.my_fancy_component a ds:Component;
|
|
4
|
+
ds:name "MyFancyComponent";
|
|
5
|
+
ds:summary "MyFancyComponent allows to navigate between different views, and by doing so allows users to perform X or Y …";
|
|
6
|
+
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "";
|
|
8
|
+
ds:usage "";
|
|
9
|
+
ds:guidelines "";
|
|
10
|
+
ds:tier ds:apps_debcrafters;
|
|
11
|
+
ds:documentationStage ds:tag.specialadoption-docs.
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
ds:apps_juju.pattern.single_select_multi_layered a ds:Pattern;
|
|
4
4
|
ds:name "Single select , multi-layered";
|
|
5
|
-
ds:summary "Single select in a multi-layered experience\nThere are multiple points where in Juju you’re required to specify a version of a model/controller/charm. Those come in multiple major, minor, patch versions or channels, tracks, risks, revisions. This results in unreasonably long lists where another layer of grouping/dropdowns could help reduce the number of items a users is exposed to when trying to find the specific version of thing they need. I would suggest the ability to create nested layer or groups for these cases, where we could present users with a grouping of major version, i. e. Juju 3, under which we could then further group all minor versions, i.e. 3.1.X, under which the users could finally have the ability to see the list of specific versions, without needing to dig through the list of path versions that doesn’t interest them. \nhttps://www.figma.com/design/Rs1v3IS0oY2RK4CU4yo4Ly/25.10-JAAS-model-management---Juju?node-id=1028-97057&t=L2pdIMYBm1sntzHC-11\nhttps://www.figma.com/design/Rs1v3IS0oY2RK4CU4yo4Ly/25.10-JAAS-model-management---Juju?node-id=1023-94964&t=L2pdIMYBm1sntzHC-11\nhttps://www.figma.com/design/Rs1v3IS0oY2RK4CU4yo4Ly/25.10-JAAS-model-management---Juju?node-id=1104-80714&t=L2pdIMYBm1sntzHC-11";
|
|
5
|
+
ds:summary "Single select in a multi-layered experience\n\nThere are multiple points where in Juju you’re required to specify a version of a model/controller/charm. Those come in multiple major, minor, patch versions or channels, tracks, risks, revisions. This results in unreasonably long lists where another layer of grouping/dropdowns could help reduce the number of items a users is exposed to when trying to find the specific version of thing they need. I would suggest the ability to create nested layer or groups for these cases, where we could present users with a grouping of major version, i. e. Juju 3, under which we could then further group all minor versions, i.e. 3.1.X, under which the users could finally have the ability to see the list of specific versions, without needing to dig through the list of path versions that doesn’t interest them. \n\nhttps://www.figma.com/design/Rs1v3IS0oY2RK4CU4yo4Ly/25.10-JAAS-model-management---Juju?node-id=1028-97057&t=L2pdIMYBm1sntzHC-11\n\nhttps://www.figma.com/design/Rs1v3IS0oY2RK4CU4yo4Ly/25.10-JAAS-model-management---Juju?node-id=1023-94964&t=L2pdIMYBm1sntzHC-11\n\nhttps://www.figma.com/design/Rs1v3IS0oY2RK4CU4yo4Ly/25.10-JAAS-model-management---Juju?node-id=1104-80714&t=L2pdIMYBm1sntzHC-11";
|
|
6
6
|
ds:anatomyDsl "";
|
|
7
|
+
ds:anatomyClassic "";
|
|
8
|
+
ds:usage "";
|
|
9
|
+
ds:guidelines "";
|
|
7
10
|
ds:tier ds:apps_juju.
|
|
@@ -2,8 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
ds:apps_landscape.component.password_constraints a ds:Component;
|
|
4
4
|
ds:name "PasswordConstraints";
|
|
5
|
-
ds:summary "The Password Constraints component is a validation feedback list that helps users ensure their password meets security requirements in real-time. It displays a list of criteria (length, casing, numbers) that update visually to indicate success, failure, or neutral states based on the user's input
|
|
5
|
+
ds:summary "The **Password Constraints** component is a validation feedback list that helps users ensure their password meets security requirements in real-time. It displays a list of criteria (length, casing, numbers) that update visually to indicate success, failure, or neutral states based on the user's input.\n\n\n\n";
|
|
6
6
|
ds:anatomyDsl "---\n# 1. Container (Root)\nnode:\n uri: global.component.password-constraints\n styles:\n # Structural\n layout.display: block\n layout.type: stack\n layout.direction: vertical\n # Themeable\n spacing.gap: spacing/vertical/small\n\n edges:\n # 2. Title\n - node:\n role: title label\n styles:\n typography.size: font/size/small # Maps to .p-text--small\n typography.color: color/text/muted # Maps to .u-text--muted\n spacing.margin.bottom: spacing/vertical/small\n relation:\n cardinality: \"1\"\n\n # 3. Constraints List\n - node:\n role: constraints list container\n styles:\n layout.display: block\n edges:\n # 4. Constraint Item (Repeating)\n - node:\n role: constraint item\n styles:\n # Structural (from .constraint class)\n layout.type: flow # Maps to display: flex\n layout.direction: horizontal\n layout.align: center # Maps to align-items: center\n\n # Themeable\n spacing.gap: spacing/small # Maps to column-gap: $sph--small\n spacing.margin.bottom: spacing/small # Maps to margin-bottom: $spv--small\n\n # Dynamic Appearance (State-based)\n # Maps to .passed, .default, .failed classes\n typography.color: [color/positive, color/text/muted, color/negative]\n\n edges:\n # 5. Status Icon\n - node:\n uri: global.component.icon\n styles:\n size.width: size/icon/small\n size.height: size/icon/small\n relation:\n cardinality: \"1\"\n\n # 6. Constraint Label\n - node:\n role: label text\n styles:\n typography.size: font/size/small # Maps to .p-text--small\n relation:\n cardinality: \"1\"\n\n relation:\n cardinality: \"4\" # Fixed at 4 items in the original code\n relation:\n cardinality: \"1\"";
|
|
7
|
+
ds:anatomyClassic "Table\n\n";
|
|
8
|
+
ds:usage "**When to Use**\n\n- **Password Creation:** Use in registration or \"change password\" forms where specific complexity rules are enforced.\n- **Real-time Validation:** Use to provide immediate feedback as the user types, rather than waiting for form submission.\n\n**When Not to Use**\n\n- **Simple Inputs:** Do not use for standard text fields that do not require complex validation logic.\n- **Hidden logic:** Do not use if the password requirements are not publicly disclosed to the user.";
|
|
9
|
+
ds:guidelines "Do not rely solely on color (red/green) to convey the state of a constraint. The component correctly uses icons (checkmarks/crosses) alongside text to ensure users with color blindness can distinguish between passed and failed states.\n\n\n\nValidation logic triggers on every keystroke (`password` prop update). Ensure the icons transition smoothly between states to prevent visual jarring (flickering).\n\n";
|
|
7
10
|
ds:tier ds:apps_landscape;
|
|
8
11
|
ds:hasProperty [
|
|
9
12
|
a ds:Property;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps_landscape.component.truncated_cell a ds:Component;
|
|
4
|
+
ds:name "TruncatedCell";
|
|
5
|
+
ds:summary "The **TruncatedCell** component is a layout utility designed to handle overflowing content within constrained spaces, most commonly used in dense data tables. It prevents layout breakage by truncating text or inline elements and provides users with an interactive trigger (such as \"Show more\" or a numeric badge like \"+3\") to expand and view the full content in a contextual pop-out box.";
|
|
6
|
+
ds:anatomyDsl "---\n# 1. Container (Root)\nnode:\n uri: global.component.truncated-cell\n styles:\n # Dynamic Appearance (State-based)\n # Maps to .container (only applied when isExpanded is true)\n layout.height: 100%\n layout.position: relative\n\n edges:\n # 2. State Wrapper\n - node:\n role: state wrapper\n styles:\n # Dynamic Layout (State-based)\n # Maps to .collapsed, .expanded classes\n layout.display: [flex, block]\n layout.position: [static, absolute]\n \n # Collapsed specific (.collapsed)\n spacing.gap: spacing/small # Maps to column-gap: $sph--small\n \n # Expanded specific (.expanded)\n theme.background: color/background/default\n theme.border: border/default\n theme.shadow: shadow/small\n spacing.padding: spacing/small # Maps to padding: calc($spv--small - 1px) $sph--small $spv--small\n relation:\n cardinality: \"1\"\n\n edges:\n # 3. Content Area\n - node:\n role: content area\n styles:\n # Dynamic Layout (State-based)\n # Maps to .truncated, .expandedContent classes\n layout.overflow: [hidden, auto]\n \n # Collapsed specific (.truncated)\n text.wrap: nowrap\n text.overflow: ellipsis\n \n # Expanded specific (.expandedContent)\n layout.display: block\n layout.max-height: size/large # Maps to max-height: 8rem\n relation:\n cardinality: \"1\"\n\n # 4. Expand Button (Conditional)\n - node:\n uri: global.component.button\n styles:\n # Component specific (.button)\n text.wrap: nowrap\n \n # Global utility classes mapped\n typography.size: font/size/small # Maps to .p-text--small\n spacing.margin.bottom: none # Maps to .u-no-margin--bottom\n relation:\n cardinality: \"0..1\" # Only renders when overflownChildCount exists and !isExpanded\n \n edges:\n # 5. Button Text Label\n - node:\n role: button text\n styles:\n typography.color: color/text/muted # Maps to .u-text--muted\n relation:\n cardinality: \"1\"";
|
|
7
|
+
ds:anatomyClassic "Table 8\n\n";
|
|
8
|
+
ds:usage "**When to Use**\n\n- **Data Tables:** Use in table columns (like logs, descriptions, or scripts) where strings or data points are frequently longer than the allocated column width.\n- **Overflowing Chip/Tag Lists:** Use when displaying a list of badges/chips (e.g., \"Assigned Users\") where showing the exact count of hidden items via the `showCount` prop is more useful than a generic truncation.\n\n**When Not to Use**\n\n- **Critical Information:** Do not use if the hidden information is critical for the user to understand the immediate context of the page without interacting.\n- **Standard Paragraphs:** Do not use for standard body copy or article text; use standard text clamping or a \"Read more\" accordion instead.";
|
|
9
|
+
ds:guidelines "**Resize Handling** The component automatically utilizes a `ResizeObserver` to monitor its parent container. If the browser window is resized or the table column width changes, the component will dynamically recalculate if the content overflows and mount/unmount the trigger button accordingly.\n\n**Accessibility** Because the expanded content acts as an overlaid absolute element, ensure that when `onExpand` is triggered, users can easily dismiss the expanded state (e.g., clicking outside the cell or pressing the `Escape` key). *Note: Dismissal logic should be handled by the parent component managing the* `*isExpanded*` *state.*\n\n**Performance** When utilizing the `showCount` prop, ensure the `content` passed consists of distinct inline block nodes (like spans or chips). The component iterates through `childNodes` to measure bounding boxes against the parent; passing a single long text string will not yield a numerical count, and standard text truncation will apply instead.";
|
|
10
|
+
ds:tier ds:apps_landscape;
|
|
11
|
+
ds:hasProperty [
|
|
12
|
+
a ds:Property;
|
|
13
|
+
ds:name "content";
|
|
14
|
+
ds:summary "The actual content or data to be displayed inside the cell.";
|
|
15
|
+
ds:propertyType "ReactNode";
|
|
16
|
+
ds:optional "false"
|
|
17
|
+
], [
|
|
18
|
+
a ds:Property;
|
|
19
|
+
ds:name "isExpanded";
|
|
20
|
+
ds:summary "Controls whether the cell is in its collapsed (truncated) or expanded (pop-out) state.";
|
|
21
|
+
ds:propertyType "boolean";
|
|
22
|
+
ds:optional "false";
|
|
23
|
+
ds:constraints "Controlled by parent state."
|
|
24
|
+
], [
|
|
25
|
+
a ds:Property;
|
|
26
|
+
ds:name "onExpand";
|
|
27
|
+
ds:summary "The callback fired when the user clicks the \"Show more\" or count button.";
|
|
28
|
+
ds:propertyType "function";
|
|
29
|
+
ds:optional "false";
|
|
30
|
+
ds:constraints "Must accept a `MouseEvent`."
|
|
31
|
+
], [
|
|
32
|
+
a ds:Property;
|
|
33
|
+
ds:name "showCount";
|
|
34
|
+
ds:summary "If true, evaluates the number of hidden child nodes and displays +X instead of \"Show more\".";
|
|
35
|
+
ds:propertyType "boolean";
|
|
36
|
+
ds:optional "true";
|
|
37
|
+
ds:constraints "Requires `content` to be a list of DOM nodes to evaluate correctly."
|
|
38
|
+
].
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
|
|
3
|
+
ds:apps_launchpad.component.avatar a ds:Component;
|
|
4
|
+
ds:name "Avatar";
|
|
5
|
+
ds:summary "The **UserAvatar** component is used to represent a user. It can display an image, initials, or a fallback icon.\n\n**Main Use Cases:**\n\n- **User Profile:** Display the user’s profile picture.\n- **Comments:** Show the avatar of the user who wrote a comment.\n- **Lists:** Represent users in a list of participants or contacts.";
|
|
6
|
+
ds:anatomyDsl "---\nnode:\n uri: app-launchpad.component.user-avatar\n styles:\n layout.display: inline-grid\n layout.align: center\n layout.justify: center\n size.width: size/medium\n size.height: size/medium\n appearance.background: color/background/alt\n appearance.border: border/style/default\n typography.size: typography/paragraph/default/strong\n edges:\n - switch:\n on: props\n cases:\n - node:\n role: image\n styles:\n size.width: 100%\n size.height: 100%\n - node:\n role: initials\n styles:\n typography.transform: uppercase\n - node:\n role: fallback icon\n relation:\n cardinality: \"1\"\n slotName: default";
|
|
7
|
+
ds:anatomyClassic "The UserAvatar is composed of a main container that can contain an image, initials, or a fallback icon.\n\n1. **Container:** The outermost wrapper that defines the shape and size of the avatar.\n2. **Image:** The user’s profile picture.\n3. **Initials:** The user’s initials, used as a fallback when an image is not available.\n4. **Fallback Icon:** A generic icon used when neither an image nor initials are available.\n\nhttps://www.figma.com/design/zLPPWH90vDkSUaTnYC0em0/Launchpad-components--new-?node-id=3085-629388&m=dev";
|
|
8
|
+
ds:usage "### 1. General Description\n\nUserAvatars are used to visually represent users in the interface. They help to create a more personal and engaging user experience.\n\n### 2. Implementation Guidelines\n\n2.1 When to Use\n\n- **User representation:** Use whenever you need to represent a user in the UI.\n- **Personalization:** Use to personalize the user experience.\n\n2.2 When Not to Use\n\n- **Anonymous users:** Do not use for anonymous users. Use a generic icon instead.";
|
|
9
|
+
ds:guidelines "### Accessibility\n\n- **Alt text:** If the avatar is an image, provide descriptive alt text.\n- **Aria-label:** If the avatar is just an icon or initials, provide an aria-label with the user’s name.";
|
|
10
|
+
ds:tier ds:apps_launchpad;
|
|
11
|
+
ds:hasProperty [
|
|
12
|
+
a ds:Property;
|
|
13
|
+
ds:name "src";
|
|
14
|
+
ds:summary "The URL of the user's profile picture.";
|
|
15
|
+
ds:propertyType "url";
|
|
16
|
+
ds:optional "true"
|
|
17
|
+
], [
|
|
18
|
+
a ds:Property;
|
|
19
|
+
ds:name "name";
|
|
20
|
+
ds:summary "The name of the user, used to generate initials.";
|
|
21
|
+
ds:propertyType "text";
|
|
22
|
+
ds:optional "true"
|
|
23
|
+
], [
|
|
24
|
+
a ds:Property;
|
|
25
|
+
ds:name "size";
|
|
26
|
+
ds:summary "The size of the avatar.";
|
|
27
|
+
ds:propertyType "choice";
|
|
28
|
+
ds:optional "true";
|
|
29
|
+
ds:constraints "small, medium, large";
|
|
30
|
+
ds:defaultValue "medium"
|
|
31
|
+
].
|