@canonical/design-system 0.46.0 → 0.47.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/data/apps/pattern/data_views.ttl +85 -0
- package/data/apps/pattern/datatable.ttl +3 -73
- package/data/apps/pattern/page_header.ttl +50 -5
- package/data/apps/subcomponent/data_table-action_bar.ttl +2 -2
- package/data/apps/subcomponent/data_table-pagination_bar.ttl +2 -2
- package/data/apps/subcomponent/data_table-persistent_selection.ttl +1 -1
- package/data/apps/subcomponent/data_views-filters.ttl +13 -0
- package/data/apps/subcomponent/data_views-saved_views.ttl +13 -0
- package/data/apps/subcomponent/data_views-sort_panel.ttl +13 -0
- package/data/apps/subcomponent/side_panel-footer.ttl +1 -1
- package/data/apps_launchpad/component/modal.ttl +2 -2
- package/data/{apps_workplaceengineering → apps_workplace}/component/complex_multi_select.ttl +3 -3
- package/data/{apps_workplaceengineering → apps_workplace}/component/label-highlight.ttl +4 -4
- package/data/{apps_workplaceengineering → apps_workplace}/component/org_chart.ttl +2 -2
- package/data/{apps_workplaceengineering → apps_workplace}/component/rule.ttl +2 -2
- package/data/{apps_workplaceengineering → apps_workplace}/component/skip_link.ttl +2 -2
- package/data/{apps_workplaceengineering → apps_workplace}/component/theme_switcher.ttl +2 -2
- package/data/{apps_workplaceengineering → apps_workplace}/pattern/callout_numbers_card.ttl +2 -2
- package/data/{apps_workplaceengineering → apps_workplace}/pattern/confirmation_modal.ttl +2 -2
- package/data/{apps_workplaceengineering → apps_workplace}/pattern/org_event_card.ttl +2 -2
- package/data/{apps_workplaceengineering → apps_workplace}/subcomponent/multi_select_input.ttl +2 -2
- package/data/{apps_workplaceengineering.ttl → apps_workplace.ttl} +2 -2
- package/data/concept/Accessibility.ttl +9 -0
- package/data/concept/Breakpoints.ttl +9 -0
- package/data/concept/Design-tokens-Overview.ttl +10 -0
- package/data/concept/Filtering-patterns.ttl +0 -1
- package/data/concept/Foundations-Baseline.ttl +0 -1
- package/data/concept/Foundations-Color.ttl +10 -0
- package/data/concept/Foundations-Density--the-form-channel.ttl +0 -1
- package/data/concept/Foundations-Grid--Layout.ttl +1 -2
- package/data/concept/Foundations-Spacing/-Element-vs-container-owned.ttl +0 -1
- package/data/concept/Foundations-Spacing.ttl +0 -1
- package/data/concept/Foundations-Surfaces.ttl +0 -1
- package/data/concept/Foundations-Typography.ttl +1 -2
- package/data/concept/How-to-choose-between-question-mark-and-information-icon.ttl +10 -0
- package/data/concept/How-to-differentiate-types-of-UI-blocks-.ttl +0 -1
- package/data/concept/How-to-indicate-required-fields-in-forms.ttl +0 -1
- package/data/concept/How-to-support-modifiers-in-a-component.ttl +0 -1
- package/data/concept/Intentional-friction.ttl +0 -1
- package/data/concept/Overflow.ttl +0 -1
- package/data/concept/Understanding-the-modifier-contract.ttl +0 -1
- package/data/documentation/pattern/library_side_navigation.ttl +2 -2
- package/data/global/component/accordion.ttl +2 -2
- package/data/global/component/announcement.ttl +2 -1
- package/data/global/component/avatar.ttl +1 -1
- package/data/global/component/badge.ttl +2 -2
- package/data/global/component/breadcrumbs.ttl +3 -3
- package/data/global/component/button.ttl +3 -3
- package/data/global/component/button_link.ttl +1 -1
- package/data/global/component/card.ttl +3 -7
- package/data/global/component/chip.ttl +1 -0
- package/data/global/component/code_snippet.ttl +1 -1
- package/data/global/component/drag_and_drop_list.ttl +1 -1
- package/data/global/component/dropdown_button.ttl +2 -2
- package/data/global/component/file_upload_field.ttl +509 -60
- package/data/global/component/icon.ttl +1 -1
- package/data/global/component/icon_button.ttl +26 -4
- package/data/{apps → global}/component/key_value_pair.ttl +2 -2
- package/data/global/{subcomponent/markdown_input.ttl → component/markdown_editor_field.ttl} +3 -3
- package/data/global/component/mode_switcher.ttl +1 -1
- package/data/global/component/number_field.ttl +1 -1
- package/data/global/component/range_field.ttl +0 -80
- package/data/global/component/table.ttl +2 -2
- package/data/global/component/tile.ttl +1 -1
- package/data/global/component/tooltip.ttl +51 -91
- package/data/global/component/{data_tooltip.ttl → tooltip_data.ttl} +31 -23
- package/data/global/component/tooltip_wrapper.ttl +70 -14
- package/data/global/group/cards.ttl +1 -1
- package/data/{apps → global}/group/key_value_pairs.ttl +2 -2
- package/data/global/modifier/constructive.ttl +1 -1
- package/data/global/modifier/elevated.ttl +1 -1
- package/data/global/modifier_family/_emphasis.ttl +1 -2
- package/data/global/modifier_family/_other.ttl +1 -2
- package/data/global/modifier_family/surface.ttl +1 -1
- package/data/global/pattern/description_list.ttl +1 -1
- package/data/global/pattern/modal.ttl +1 -1
- package/data/global/pattern/timeline.ttl +1 -1
- package/data/global/pattern/{navigation.ttl → top_navigation.ttl} +2 -2
- package/data/global/subcomponent/chart_legend.ttl +1 -1
- package/data/global/subcomponent/chart_legend_item.ttl +1 -1
- package/data/global/subcomponent/file_upload_input.ttl +503 -50
- package/data/global/subcomponent/markdown_editor_input.ttl +13 -0
- package/data/global/subcomponent/modal-footer.ttl +1 -1
- package/data/global/subcomponent/number_input.ttl +1 -1
- package/data/global/subcomponent/range_input.ttl +3 -84
- package/data/global/{component/markdown_field.ttl → subcomponent/text_editor_input.ttl} +3 -3
- package/data/global/variant/tooltip_dense.ttl +86 -5
- package/data/global_dataviews/component/filter_button.ttl +487 -0
- package/data/global_dataviews/component/query_bar.ttl +1639 -0
- package/data/global_dataviews/component/query_chip.ttl +605 -0
- package/data/global_dataviews/group/query_chips.ttl +565 -0
- package/data/global_dataviews/modifier/exclusion.ttl +8 -0
- package/data/global_dataviews/modifier/inclusion.ttl +8 -0
- package/data/global_dataviews/modifier/match.ttl +8 -0
- package/data/global_dataviews/modifier/presence.ttl +8 -0
- package/data/global_dataviews/modifier/range.ttl +8 -0
- package/data/global_dataviews/modifier_family/condition.ttl +9 -0
- package/data/global_dataviews/subcomponent/query_chip-entry.ttl +186 -0
- package/data/global_dataviews/subcomponent/query_chip-segment.ttl +241 -0
- package/data/global_dataviews/subcomponent/query_input.ttl +1287 -0
- package/data/global_dataviews.ttl +6 -0
- package/data/sites/component/store_card.ttl +1 -1
- package/data/tag/{wpeinital-implementation.ttl → workplaceinitial-implementation.ttl} +2 -2
- package/data/tag/{wpetriageupstream-and-deprecate.ttl → workplacetriageupstream-and-deprecate.ttl} +2 -2
- package/definitions/ontology.ttl +8 -2
- package/package.json +6 -6
- package/skills/adoption-a1-styles/SKILL.md +11 -0
- package/skills/adoption-a2-components/SKILL.md +82 -2
- package/skills/anatomy-author/SKILL.md +278 -95
- package/skills/anatomy-author/clarification-guidelines.md +150 -0
- package/skills/anatomy-author/completeness-checklist.md +224 -0
- package/skills/implement-component/SKILL.md +2 -2
- package/skills/map-journeys/SKILL.md +395 -0
- package/skills/map-journeys/journey-graph.example.html +298 -0
- package/skills/model-domains/SKILL.md +502 -0
- package/data/concept/Question-mark-vs-information-icon.ttl +0 -11
- package/data/global/modifier/editable.ttl +0 -8
- package/data/global/modifier/focused.ttl +0 -8
- package/data/global/modifier/highlighted.ttl +0 -8
- package/data/global/modifier/loading.ttl +0 -8
- package/data/global/modifier/muted.ttl +0 -8
- package/data/global/modifier/wireframe.ttl +0 -8
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:global_dataviews.subcomponent.query_chip-entry a ds:Subcomponent;
|
|
6
|
+
ds:name "QueryChip.Entry";
|
|
7
|
+
ds:summary "The part of a query chip being typed or edited: a text input inside the chip, where its field, operator or value is chosen. A chip holds at most one. When a part is settled, the host replaces the Entry with a Segment, or moves it to the next part.";
|
|
8
|
+
ds:anatomyDsl "---\n# TODO implementation: no reference in @canonical/react-ds-global or react-ds-global-form\n# The part being typed: a native <input>, never a <textarea>, which admits no combobox\n# role. It renders only once scripts run, takes role=\"combobox\", and reads QueryInput's\n# suggestions through QueryInput's context. It has its own look, an input fill with an\n# underline, so the chip needs no editing state. The chip's body draws the focus ring\n# around the clause.\nnode:\n uri: global_dataviews.subcomponent.query_chip-entry\n styles:\n layout.type: inline-flex\n layout.align: center\n layout.position: relative\n size.min.width: 4ch\n size.min.height: dimension.300\n spacing.internal.inline.start: 0.375rem\n spacing.internal.inline.end: 0.375rem\n appearance.background: [surface.color.foreground.input, color.foreground.input]\n # @disabled is drawn from the chip's data attribute while the chip is disabled.\n appearance.background@disabled: color.foreground.input.disabled\n appearance.border.style: solid\n appearance.border.width: 0\n appearance.border.bottom.width: dimension.stroke.thickness.medium\n appearance.border.bottom.color: color.border.highlighted\n appearance.border.bottom.color@invalid: color.border.error\n typography.font: typography.text.secondary\n typography.color: color.text\n typography.color@disabled: color.text.disabled\n edges:\n - node:\n # The remaining props reach it.\n role: entry input\n styles:\n layout.flex.grow: 1\n size.min.width: 1ch\n appearance.native: none\n appearance.border.style: none\n appearance.background: transparent\n appearance.outline.style: none\n typography.font: typography.text.secondary\n typography.color: inherit\n spacing.internal.block.start: 0\n spacing.internal.block.end: 0\n spacing.internal.inline.start: 0\n spacing.internal.inline.end: 0\n edges:\n - node:\n # Drawn as ::placeholder.\n role: placeholder\n styles:\n typography.color: color.text.muted\n relation:\n cardinality: \"0..1\"\n relation:\n cardinality: \"1\"\n - node:\n # An aria-hidden template behind the typed text: YYYY-MM-DD, or a range. The muted\n # text symbol keeps the untyped part above 4.5:1.\n role: format template\n styles:\n layout.position: absolute\n interaction.pointerEvents: none\n typography.whiteSpace: pre\n typography.color: color.text.muted\n relation:\n cardinality: \"0..1\"\n - node:\n # Text after the typed text, such as a unit (\"GiB\"), from `suffix`.\n role: suffix\n styles:\n typography.color: color.text.muted\n relation:\n cardinality: \"0..1\"\n - node:\n # The `formatDescription`, as a `hidden` element with an id, which the input's\n # aria-describedby points at first and still resolves.\n role: format description\n relation:\n cardinality: \"0..1\"\n - node:\n # The `description` while invalid, as a `hidden` element with an id, which the input's\n # aria-describedby points at after the format description.\n role: description\n relation:\n cardinality: \"0..1\"";
|
|
9
|
+
ds:anatomyClassic "";
|
|
10
|
+
ds:usage "### When to use\n\n- Inside a QueryChip, for the one part being typed: the next part of a draft chip, or the part \nbeing edited.\n\n### When not to use\n\n- For a settled part: use **QueryChip.Segment**.\n- For free text, or the field of a new clause: that is **QueryInput**’s own entry.\n- On its own: use **TextInput** or **ComboboxInput**.";
|
|
11
|
+
ds:guidelines "### Accessibility\n\n- The Entry is a native `<input>`, never a `<textarea>`, which admits no combobox role. A long \nvalue scrolls inside the input rather than wrapping.\n- It renders only once scripts run. It takes `role=\"combobox\"` and is named by `label`, such as \n“Value for status”. It reads QueryInput’s suggestions through QueryInput’s context, and while \nit has focus it carries `aria-controls`, `aria-expanded` and `aria-activedescendant` for \nQueryInput’s listbox. It keeps focus while an option is highlighted.\n- Inside a roving composite, the Entry is its chip’s toolbar item while it is present, as \n`<id>:entry`, and takes `tabindex=\"0\"` only while it holds the tab stop.\n- Its accessible description is always its `formatDescription`, when given, followed while \ninvalid by its `description`, and, while QueryInput’s suggestions are open and carry a \n`footer`, by that footer, which QueryInput supplies through its context. While invalid it \nalso carries `aria-invalid`.\n- A format template is hidden from assistive technology; `formatDescription` says the format \nin words.\n- Typing is never blocked by key filtering, so paste, dictation and input methods work. The \nhost parses what was typed.\n\n### States & interaction\n\nThe Entry is default, focused, invalid, or disabled when its chip is disabled. It has its own \nlook, an input fill with an underline, so the chip shows no editing state. While invalid it \nshows the error underline; it takes no error fill and no glyph. Keys the combobox does not \nhandle reach the host, which owns moving between parts and chips. Blur ends an edit only when \nfocus leaves QueryInput’s root, a `focusout` whose `relatedTarget` is outside it.";
|
|
12
|
+
ds:tier ds:global_dataviews;
|
|
13
|
+
ds:documentationStage ds:tag.needstriage;
|
|
14
|
+
ds:hasProperty [
|
|
15
|
+
a ds:Property;
|
|
16
|
+
ds:name "value";
|
|
17
|
+
ds:summary "The typed text.";
|
|
18
|
+
ds:propertyType "text";
|
|
19
|
+
ds:optional "false"
|
|
20
|
+
], [
|
|
21
|
+
a ds:Property;
|
|
22
|
+
ds:name "on_value_change";
|
|
23
|
+
ds:summary "Called with the typed text after each input.";
|
|
24
|
+
ds:propertyType "callback";
|
|
25
|
+
ds:optional "false"
|
|
26
|
+
], [
|
|
27
|
+
a ds:Property;
|
|
28
|
+
ds:name "label";
|
|
29
|
+
ds:summary "The accessible name, such as \"Value for status\".";
|
|
30
|
+
ds:propertyType "text";
|
|
31
|
+
ds:optional "false"
|
|
32
|
+
], [
|
|
33
|
+
a ds:Property;
|
|
34
|
+
ds:name "placeholder";
|
|
35
|
+
ds:summary "Shown while nothing is typed.";
|
|
36
|
+
ds:propertyType "text";
|
|
37
|
+
ds:optional "true"
|
|
38
|
+
], [
|
|
39
|
+
a ds:Property;
|
|
40
|
+
ds:name "template";
|
|
41
|
+
ds:summary "```A format template shown behind the typed text, such as `YYYY-MM-DD`.```";
|
|
42
|
+
ds:propertyType "text";
|
|
43
|
+
ds:optional "true"
|
|
44
|
+
], [
|
|
45
|
+
a ds:Property;
|
|
46
|
+
ds:name "format_description";
|
|
47
|
+
ds:summary "```The format in words, such as \"Date, format YYYY-MM-DD\", from the host's messages. It is always in the accessible description, before `description` while invalid.```";
|
|
48
|
+
ds:propertyType "text";
|
|
49
|
+
ds:optional "true";
|
|
50
|
+
ds:constraints "```required with `template````"
|
|
51
|
+
], [
|
|
52
|
+
a ds:Property;
|
|
53
|
+
ds:name "suffix";
|
|
54
|
+
ds:summary "```Text after the typed text, such as a unit, as TextInput's `suffix` is.```";
|
|
55
|
+
ds:propertyType "text";
|
|
56
|
+
ds:optional "true"
|
|
57
|
+
], [
|
|
58
|
+
a ds:Property;
|
|
59
|
+
ds:name "is_invalid";
|
|
60
|
+
ds:summary "Marks the typed text invalid.";
|
|
61
|
+
ds:propertyType "boolean";
|
|
62
|
+
ds:optional "true";
|
|
63
|
+
ds:constraints "```requires `description````";
|
|
64
|
+
ds:defaultValue "false"
|
|
65
|
+
], [
|
|
66
|
+
a ds:Property;
|
|
67
|
+
ds:name "description";
|
|
68
|
+
ds:summary "The message, such as \"Invalid: <message>\".";
|
|
69
|
+
ds:propertyType "text";
|
|
70
|
+
ds:optional "true";
|
|
71
|
+
ds:constraints "```required with `is_invalid````"
|
|
72
|
+
];
|
|
73
|
+
ds:parentComponent ds:global_dataviews.component.query_chip;
|
|
74
|
+
ds:hasTokenBinding [
|
|
75
|
+
a ds:TokenBinding;
|
|
76
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
77
|
+
ds:node "$root";
|
|
78
|
+
anatomy:styleKey "size.min.height";
|
|
79
|
+
anatomy:styleState "default";
|
|
80
|
+
ds:rank 1;
|
|
81
|
+
ds:consumesSymbol dt:dimension.300
|
|
82
|
+
], [
|
|
83
|
+
a ds:TokenBinding;
|
|
84
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
85
|
+
ds:node "$root";
|
|
86
|
+
anatomy:styleKey "appearance.background";
|
|
87
|
+
anatomy:styleState "default";
|
|
88
|
+
ds:rank 1;
|
|
89
|
+
ds:consumesSymbol dt:surface.color.foreground.input
|
|
90
|
+
], [
|
|
91
|
+
a ds:TokenBinding;
|
|
92
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
93
|
+
ds:node "$root";
|
|
94
|
+
anatomy:styleKey "appearance.background";
|
|
95
|
+
anatomy:styleState "default";
|
|
96
|
+
ds:rank 2;
|
|
97
|
+
ds:consumesSymbol dt:color.foreground.input
|
|
98
|
+
], [
|
|
99
|
+
a ds:TokenBinding;
|
|
100
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
101
|
+
ds:node "$root";
|
|
102
|
+
anatomy:styleKey "appearance.background";
|
|
103
|
+
anatomy:styleState "disabled";
|
|
104
|
+
ds:rank 1;
|
|
105
|
+
ds:consumesSymbol dt:color.foreground.input.disabled
|
|
106
|
+
], [
|
|
107
|
+
a ds:TokenBinding;
|
|
108
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
109
|
+
ds:node "$root";
|
|
110
|
+
anatomy:styleKey "appearance.border.bottom.width";
|
|
111
|
+
anatomy:styleState "default";
|
|
112
|
+
ds:rank 1;
|
|
113
|
+
ds:consumesSymbol dt:dimension.stroke.thickness.medium
|
|
114
|
+
], [
|
|
115
|
+
a ds:TokenBinding;
|
|
116
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
117
|
+
ds:node "$root";
|
|
118
|
+
anatomy:styleKey "appearance.border.bottom.color";
|
|
119
|
+
anatomy:styleState "default";
|
|
120
|
+
ds:rank 1;
|
|
121
|
+
ds:consumesSymbol dt:color.border.highlighted
|
|
122
|
+
], [
|
|
123
|
+
a ds:TokenBinding;
|
|
124
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
125
|
+
ds:node "$root";
|
|
126
|
+
anatomy:styleKey "appearance.border.bottom.color";
|
|
127
|
+
anatomy:styleState "invalid";
|
|
128
|
+
ds:rank 1;
|
|
129
|
+
ds:consumesSymbol dt:color.border.error
|
|
130
|
+
], [
|
|
131
|
+
a ds:TokenBinding;
|
|
132
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
133
|
+
ds:node "$root";
|
|
134
|
+
anatomy:styleKey "typography.font";
|
|
135
|
+
anatomy:styleState "default";
|
|
136
|
+
ds:rank 1;
|
|
137
|
+
ds:consumesSymbol dt:typography.text.secondary
|
|
138
|
+
], [
|
|
139
|
+
a ds:TokenBinding;
|
|
140
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
141
|
+
ds:node "$root";
|
|
142
|
+
anatomy:styleKey "typography.color";
|
|
143
|
+
anatomy:styleState "default";
|
|
144
|
+
ds:rank 1;
|
|
145
|
+
ds:consumesSymbol dt:color.text
|
|
146
|
+
], [
|
|
147
|
+
a ds:TokenBinding;
|
|
148
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
149
|
+
ds:node "$root";
|
|
150
|
+
anatomy:styleKey "typography.color";
|
|
151
|
+
anatomy:styleState "disabled";
|
|
152
|
+
ds:rank 1;
|
|
153
|
+
ds:consumesSymbol dt:color.text.disabled
|
|
154
|
+
], [
|
|
155
|
+
a ds:TokenBinding;
|
|
156
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
157
|
+
ds:node "$root/entry input";
|
|
158
|
+
anatomy:styleKey "typography.font";
|
|
159
|
+
anatomy:styleState "default";
|
|
160
|
+
ds:rank 1;
|
|
161
|
+
ds:consumesSymbol dt:typography.text.secondary
|
|
162
|
+
], [
|
|
163
|
+
a ds:TokenBinding;
|
|
164
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
165
|
+
ds:node "$root/entry input/placeholder";
|
|
166
|
+
anatomy:styleKey "typography.color";
|
|
167
|
+
anatomy:styleState "default";
|
|
168
|
+
ds:rank 1;
|
|
169
|
+
ds:consumesSymbol dt:color.text.muted
|
|
170
|
+
], [
|
|
171
|
+
a ds:TokenBinding;
|
|
172
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
173
|
+
ds:node "$root/format template";
|
|
174
|
+
anatomy:styleKey "typography.color";
|
|
175
|
+
anatomy:styleState "default";
|
|
176
|
+
ds:rank 1;
|
|
177
|
+
ds:consumesSymbol dt:color.text.muted
|
|
178
|
+
], [
|
|
179
|
+
a ds:TokenBinding;
|
|
180
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-entry;
|
|
181
|
+
ds:node "$root/suffix";
|
|
182
|
+
anatomy:styleKey "typography.color";
|
|
183
|
+
anatomy:styleState "default";
|
|
184
|
+
ds:rank 1;
|
|
185
|
+
ds:consumesSymbol dt:color.text.muted
|
|
186
|
+
].
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
@prefix ds: <https://ds.canonical.com/>.
|
|
2
|
+
@prefix anatomy: <https://anatomy.canonical.com/>.
|
|
3
|
+
@prefix dt: <https://dt.canonical.com/>.
|
|
4
|
+
|
|
5
|
+
ds:global_dataviews.subcomponent.query_chip-segment a ds:Subcomponent;
|
|
6
|
+
ds:name "QueryChip.Segment";
|
|
7
|
+
ds:summary "One settled part of a query chip, such as its field, its operator or its value: a piece of text with its own fill, which can be activated on its own; under the default `separated` unity it is also hovered and marked invalid on its own. The host composes one Segment for each settled part.";
|
|
8
|
+
ds:anatomyDsl "---\n# TODO implementation: no reference in @canonical/react-ds-global or react-ds-global-form\n# Tone: a Segment reads the modifier channels. The host sets the operator Segment's\n# `condition`. Each Condition value is to have its own positions, which are to alias at\n# first to two tones:\n# Inclusion, Match, Range and Presence to the Information symbols, and Exclusion to a\n# negation tone of its own. No semantic negation symbol exists yet, so that tone is a\n# stand-in from the teal palette primitives, light and dark, which the Condition\n# specification lists. The invalid state binds the error symbols directly.\n# Element: once scripts run, and when it has onActivate, a Segment is a native <button>, so a\n# click, Enter or Space activates it. Otherwise, and before scripts run, it is plain text;\n# when its label differs from its text, the text is aria-hidden and the label is visually\n# hidden text beside it. It draws no focus ring of its own: the chip's body draws one ring\n# around the clause while focus is within it.\n# Selected: a selected chip sets @selected on all its Segments. Under `joined`, the chip's\n# hover and invalid reach every Segment the same way, from the chip's data attributes.\n# Refused: the chip's Criticality value is `error` and its Segments carry no Condition\n# value, so the channels give every Segment the error tone; Error's glyph shows on the first\n# Segment. Other Criticality values tint only. Invalid: the Segment at fault takes\n# @invalid, which wins over the channels, and shows the glyph.\n# Hover and the text cursor apply only while the Segment is a button.\nnode:\n uri: global_dataviews.subcomponent.query_chip-segment\n styles:\n layout.type: inline-flex\n layout.align: center\n # 24 by 24 px at least, whatever the text, so a one-glyph operator is a full target.\n size.min.width: dimension.300\n size.min.height: dimension.300\n layout.justify: center\n # A native <button> does not inherit the chip's font, so it is set here.\n typography.font: typography.text.secondary\n # 6 px, which no symbol declares. --query-chip-segment-padding-inline\n spacing.internal.inline.start: 0.375rem\n spacing.internal.inline.end: 0.375rem\n spacing.internal.block.start: dimension.025\n spacing.internal.block.end: dimension.025\n interaction.cursor: text\n # The secondary fills have no Surface positions yet, so the fill does not follow the\n # layer beneath the chip. --query-chip-segment-background\n appearance.background: [modifier.color.foreground.secondary, color.foreground.secondary]\n appearance.background@hover: color.foreground.secondary.hover\n # @selected is drawn from a data attribute, never aria-selected, which a button does\n # not support; selection reaches assistive technology through focus.\n appearance.background@selected: color.foreground.secondary.active\n appearance.background@disabled: color.foreground.secondary.disabled\n appearance.background@invalid: color.foreground.secondary.error\n # --query-chip-segment-text\n typography.color:\n - modifier.color.text.onForegroundSecondary\n - color.text.onForegroundSecondary\n typography.color@disabled: color.text.onForegroundSecondary.disabled\n typography.color@invalid: color.text.onForegroundSecondary.error\n edges:\n - node:\n # Present on the Segment at fault of an invalid chip, and on the first Segment of a\n # refused chip, only. The glyph follows the modifier, as the colours do: Criticality\n # Error's own glyph is `error`, and @canonical/styles maps each Criticality value to\n # the glyph of the same name. No channel carries a glyph yet, so the Error value's\n # glyph is written here until one does.\n uri: global.component.icon\n props:\n icon: error\n styles:\n size.width: dimension.200\n size.height: dimension.200\n typography.color: color.icon.onForegroundSecondary.error\n spacing.external.inline.end: dimension.050\n relation:\n cardinality: \"0..1\"\n - node:\n # Present on a Segment with a `condition`, before its text, for every Condition\n # value. Its glyph is the Condition value's; no channel carries a glyph yet, so only\n # colour is bound. No channel routes the on-secondary icon symbols per value yet, so\n # the colour is the paired symbol. aria-hidden: the Segment's label speaks the\n # operator.\n role: condition mark\n styles:\n size.width: dimension.200\n size.height: dimension.200\n typography.color: color.icon.onForegroundSecondary\n spacing.external.inline.end: dimension.050\n relation:\n cardinality: \"0..1\"\n - node:\n role: segment text\n styles:\n typography.overflow: ellipsis\n relation:\n cardinality: \"1\"\n slotName: default\n - node:\n # The `label`, as visually hidden text, while the Segment is plain text and its\n # label differs from its text; the text is then aria-hidden.\n role: spoken label\n relation:\n cardinality: \"0..1\"\n - node:\n # The `description`, as an element with the `hidden` attribute and an id. The\n # aria-describedby of the invalid Segment, the first Segment and a refused read-only\n # chip's remove control still resolves it, while the Segment's name from content and\n # browse mode skip it, so it never joins the button's name.\n role: description\n relation:\n cardinality: \"0..1\"";
|
|
9
|
+
ds:anatomyClassic "";
|
|
10
|
+
ds:usage "### When to use\n\n- Inside a QueryChip, for each part that is not being typed.\n\n### When not to use\n\n- For the part being typed or edited: use **QueryChip.Entry**.\n- On its own. A lone piece of interactive text is a **Chip**.";
|
|
11
|
+
ds:guidelines "### Accessibility\n\n- Once scripts run, and when it has `onActivate`, a Segment is a native button named by its \ntext, or by its `label` when one is given. Otherwise, and before scripts run, it is plain \ntext; when its `label` differs from its text, the text is `aria-hidden` and the label renders \nbeside it as visually hidden text, so a symbol such as `≥` is spoken as “at least”.\n- A Segment with a `condition` shows that Condition value’s mark before its text. The mark is \nhidden from assistive technology, because the `label` speaks the operator.\n- Inside a roving composite, the chip’s first Segment is the chip’s toolbar item and takes \n`tabindex=\"0\"` only while it holds the tab stop; every other Segment button takes \n`tabindex=\"-1\"`, reached by Enter on the chip, then Tab.\n- Each Segment button is at least 24 by 24 px, whatever its text, so a one-glyph operator such \nas `≥` is still a full target.\n- An invalid Segment carries its state in its accessible description, through \n`aria-describedby` on its `description`, because `aria-invalid` does not apply to a button. \nThe `description` renders as a `hidden` element, which `aria-describedby` still resolves, so \nit never joins the Segment’s name from content or reads inline in browse mode. \nWhile it is invalid, the chip’s first Segment is described by it too.\n\n### States & interaction\n\nA Segment is default, hovered, selected, invalid or disabled. It is selected when its chip is \nselected, and disabled when its chip is disabled. Its tone comes from its `condition`, or from \nthe chip’s Criticality value, which tints every Segment; Error also marks the chip refused. Its \nown `@invalid` state wins over either. Every transition belongs to the host.";
|
|
12
|
+
ds:tier ds:global_dataviews;
|
|
13
|
+
ds:documentationStage ds:tag.needstriage;
|
|
14
|
+
ds:hasProperty [
|
|
15
|
+
a ds:Property;
|
|
16
|
+
ds:name "children";
|
|
17
|
+
ds:summary "The part’s text, such as `status` or `≥`.";
|
|
18
|
+
ds:propertyType "node";
|
|
19
|
+
ds:optional "false";
|
|
20
|
+
ds:constraints "text"
|
|
21
|
+
], [
|
|
22
|
+
a ds:Property;
|
|
23
|
+
ds:name "label";
|
|
24
|
+
ds:summary "```The spoken text when it differs from the shown text, such as \"at least\" for `≥`.```";
|
|
25
|
+
ds:propertyType "text";
|
|
26
|
+
ds:optional "true"
|
|
27
|
+
], [
|
|
28
|
+
a ds:Property;
|
|
29
|
+
ds:name "condition";
|
|
30
|
+
ds:summary "The Condition value, on the operator Segment.";
|
|
31
|
+
ds:propertyType "choice";
|
|
32
|
+
ds:optional "true"
|
|
33
|
+
], [
|
|
34
|
+
a ds:Property;
|
|
35
|
+
ds:name "is_invalid";
|
|
36
|
+
ds:summary "Marks the part at fault.";
|
|
37
|
+
ds:propertyType "boolean";
|
|
38
|
+
ds:optional "true";
|
|
39
|
+
ds:constraints "```requires `description````";
|
|
40
|
+
ds:defaultValue "false"
|
|
41
|
+
], [
|
|
42
|
+
a ds:Property;
|
|
43
|
+
ds:name "description";
|
|
44
|
+
ds:summary "The accessible description, such as \"Invalid: <message>\", or on the first Segment of a refused chip \"Refused: <reason>\".";
|
|
45
|
+
ds:propertyType "text";
|
|
46
|
+
ds:optional "true";
|
|
47
|
+
ds:constraints "```required with `is_invalid````"
|
|
48
|
+
], [
|
|
49
|
+
a ds:Property;
|
|
50
|
+
ds:name "on_activate";
|
|
51
|
+
ds:summary "Called when the Segment is activated. Passing it makes the Segment a button; without it, it is plain text.";
|
|
52
|
+
ds:propertyType "callback";
|
|
53
|
+
ds:optional "true"
|
|
54
|
+
];
|
|
55
|
+
ds:hasModifierFamily ds:global_dataviews.modifier_family.condition;
|
|
56
|
+
ds:parentComponent ds:global_dataviews.component.query_chip;
|
|
57
|
+
ds:hasTokenBinding [
|
|
58
|
+
a ds:TokenBinding;
|
|
59
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
60
|
+
ds:node "$root";
|
|
61
|
+
anatomy:styleKey "size.min.width";
|
|
62
|
+
anatomy:styleState "default";
|
|
63
|
+
ds:rank 1;
|
|
64
|
+
ds:consumesSymbol dt:dimension.300
|
|
65
|
+
], [
|
|
66
|
+
a ds:TokenBinding;
|
|
67
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
68
|
+
ds:node "$root";
|
|
69
|
+
anatomy:styleKey "size.min.height";
|
|
70
|
+
anatomy:styleState "default";
|
|
71
|
+
ds:rank 1;
|
|
72
|
+
ds:consumesSymbol dt:dimension.300
|
|
73
|
+
], [
|
|
74
|
+
a ds:TokenBinding;
|
|
75
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
76
|
+
ds:node "$root";
|
|
77
|
+
anatomy:styleKey "typography.font";
|
|
78
|
+
anatomy:styleState "default";
|
|
79
|
+
ds:rank 1;
|
|
80
|
+
ds:consumesSymbol dt:typography.text.secondary
|
|
81
|
+
], [
|
|
82
|
+
a ds:TokenBinding;
|
|
83
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
84
|
+
ds:node "$root";
|
|
85
|
+
anatomy:styleKey "spacing.internal.block.start";
|
|
86
|
+
anatomy:styleState "default";
|
|
87
|
+
ds:rank 1;
|
|
88
|
+
ds:consumesSymbol dt:dimension.025
|
|
89
|
+
], [
|
|
90
|
+
a ds:TokenBinding;
|
|
91
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
92
|
+
ds:node "$root";
|
|
93
|
+
anatomy:styleKey "spacing.internal.block.end";
|
|
94
|
+
anatomy:styleState "default";
|
|
95
|
+
ds:rank 1;
|
|
96
|
+
ds:consumesSymbol dt:dimension.025
|
|
97
|
+
], [
|
|
98
|
+
a ds:TokenBinding;
|
|
99
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
100
|
+
ds:node "$root";
|
|
101
|
+
anatomy:styleKey "appearance.background";
|
|
102
|
+
anatomy:styleState "default";
|
|
103
|
+
ds:rank 1;
|
|
104
|
+
ds:consumesSymbol dt:modifier.color.foreground.secondary
|
|
105
|
+
], [
|
|
106
|
+
a ds:TokenBinding;
|
|
107
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
108
|
+
ds:node "$root";
|
|
109
|
+
anatomy:styleKey "appearance.background";
|
|
110
|
+
anatomy:styleState "default";
|
|
111
|
+
ds:rank 2;
|
|
112
|
+
ds:consumesSymbol dt:color.foreground.secondary
|
|
113
|
+
], [
|
|
114
|
+
a ds:TokenBinding;
|
|
115
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
116
|
+
ds:node "$root";
|
|
117
|
+
anatomy:styleKey "appearance.background";
|
|
118
|
+
anatomy:styleState "hover";
|
|
119
|
+
ds:rank 1;
|
|
120
|
+
ds:consumesSymbol dt:color.foreground.secondary.hover
|
|
121
|
+
], [
|
|
122
|
+
a ds:TokenBinding;
|
|
123
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
124
|
+
ds:node "$root";
|
|
125
|
+
anatomy:styleKey "appearance.background";
|
|
126
|
+
anatomy:styleState "selected";
|
|
127
|
+
ds:rank 1;
|
|
128
|
+
ds:consumesSymbol dt:color.foreground.secondary.active
|
|
129
|
+
], [
|
|
130
|
+
a ds:TokenBinding;
|
|
131
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
132
|
+
ds:node "$root";
|
|
133
|
+
anatomy:styleKey "appearance.background";
|
|
134
|
+
anatomy:styleState "disabled";
|
|
135
|
+
ds:rank 1;
|
|
136
|
+
ds:consumesSymbol dt:color.foreground.secondary.disabled
|
|
137
|
+
], [
|
|
138
|
+
a ds:TokenBinding;
|
|
139
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
140
|
+
ds:node "$root";
|
|
141
|
+
anatomy:styleKey "appearance.background";
|
|
142
|
+
anatomy:styleState "invalid";
|
|
143
|
+
ds:rank 1;
|
|
144
|
+
ds:consumesSymbol dt:color.foreground.secondary.error
|
|
145
|
+
], [
|
|
146
|
+
a ds:TokenBinding;
|
|
147
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
148
|
+
ds:node "$root";
|
|
149
|
+
anatomy:styleKey "typography.color";
|
|
150
|
+
anatomy:styleState "default";
|
|
151
|
+
ds:rank 1;
|
|
152
|
+
ds:consumesSymbol dt:modifier.color.text.onForegroundSecondary
|
|
153
|
+
], [
|
|
154
|
+
a ds:TokenBinding;
|
|
155
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
156
|
+
ds:node "$root";
|
|
157
|
+
anatomy:styleKey "typography.color";
|
|
158
|
+
anatomy:styleState "default";
|
|
159
|
+
ds:rank 2;
|
|
160
|
+
ds:consumesSymbol dt:color.text.onForegroundSecondary
|
|
161
|
+
], [
|
|
162
|
+
a ds:TokenBinding;
|
|
163
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
164
|
+
ds:node "$root";
|
|
165
|
+
anatomy:styleKey "typography.color";
|
|
166
|
+
anatomy:styleState "disabled";
|
|
167
|
+
ds:rank 1;
|
|
168
|
+
ds:consumesSymbol dt:color.text.onForegroundSecondary.disabled
|
|
169
|
+
], [
|
|
170
|
+
a ds:TokenBinding;
|
|
171
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
172
|
+
ds:node "$root";
|
|
173
|
+
anatomy:styleKey "typography.color";
|
|
174
|
+
anatomy:styleState "invalid";
|
|
175
|
+
ds:rank 1;
|
|
176
|
+
ds:consumesSymbol dt:color.text.onForegroundSecondary.error
|
|
177
|
+
], [
|
|
178
|
+
a ds:TokenBinding;
|
|
179
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
180
|
+
ds:node "$root/global.component.icon";
|
|
181
|
+
anatomy:styleKey "size.width";
|
|
182
|
+
anatomy:styleState "default";
|
|
183
|
+
ds:rank 1;
|
|
184
|
+
ds:consumesSymbol dt:dimension.200
|
|
185
|
+
], [
|
|
186
|
+
a ds:TokenBinding;
|
|
187
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
188
|
+
ds:node "$root/global.component.icon";
|
|
189
|
+
anatomy:styleKey "size.height";
|
|
190
|
+
anatomy:styleState "default";
|
|
191
|
+
ds:rank 1;
|
|
192
|
+
ds:consumesSymbol dt:dimension.200
|
|
193
|
+
], [
|
|
194
|
+
a ds:TokenBinding;
|
|
195
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
196
|
+
ds:node "$root/global.component.icon";
|
|
197
|
+
anatomy:styleKey "typography.color";
|
|
198
|
+
anatomy:styleState "default";
|
|
199
|
+
ds:rank 1;
|
|
200
|
+
ds:consumesSymbol dt:color.icon.onForegroundSecondary.error
|
|
201
|
+
], [
|
|
202
|
+
a ds:TokenBinding;
|
|
203
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
204
|
+
ds:node "$root/global.component.icon";
|
|
205
|
+
anatomy:styleKey "spacing.external.inline.end";
|
|
206
|
+
anatomy:styleState "default";
|
|
207
|
+
ds:rank 1;
|
|
208
|
+
ds:consumesSymbol dt:dimension.050
|
|
209
|
+
], [
|
|
210
|
+
a ds:TokenBinding;
|
|
211
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
212
|
+
ds:node "$root/condition mark";
|
|
213
|
+
anatomy:styleKey "size.width";
|
|
214
|
+
anatomy:styleState "default";
|
|
215
|
+
ds:rank 1;
|
|
216
|
+
ds:consumesSymbol dt:dimension.200
|
|
217
|
+
], [
|
|
218
|
+
a ds:TokenBinding;
|
|
219
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
220
|
+
ds:node "$root/condition mark";
|
|
221
|
+
anatomy:styleKey "size.height";
|
|
222
|
+
anatomy:styleState "default";
|
|
223
|
+
ds:rank 1;
|
|
224
|
+
ds:consumesSymbol dt:dimension.200
|
|
225
|
+
], [
|
|
226
|
+
a ds:TokenBinding;
|
|
227
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
228
|
+
ds:node "$root/condition mark";
|
|
229
|
+
anatomy:styleKey "typography.color";
|
|
230
|
+
anatomy:styleState "default";
|
|
231
|
+
ds:rank 1;
|
|
232
|
+
ds:consumesSymbol dt:color.icon.onForegroundSecondary
|
|
233
|
+
], [
|
|
234
|
+
a ds:TokenBinding;
|
|
235
|
+
ds:viaBlock ds:global_dataviews.subcomponent.query_chip-segment;
|
|
236
|
+
ds:node "$root/condition mark";
|
|
237
|
+
anatomy:styleKey "spacing.external.inline.end";
|
|
238
|
+
anatomy:styleState "default";
|
|
239
|
+
ds:rank 1;
|
|
240
|
+
ds:consumesSymbol dt:dimension.050
|
|
241
|
+
].
|