@cscfi/csc-ui 4.0.0-alpha.9 → 4.0.0-rc.2

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.
Files changed (203) hide show
  1. package/README.md +36 -2
  2. package/dist/csc-ui.js +22771 -14908
  3. package/dist/custom-elements.json +8943 -5632
  4. package/dist/docs/c-accordion/usage.md +60 -0
  5. package/dist/docs/c-accordion-item/usage.md +1 -0
  6. package/dist/docs/c-alert/usage.md +5 -5
  7. package/dist/docs/c-autocomplete/usage.md +156 -0
  8. package/dist/docs/c-badge/usage.md +50 -0
  9. package/dist/docs/c-breadcrumb/usage.md +104 -0
  10. package/dist/docs/c-breadcrumb-item/usage.md +1 -0
  11. package/dist/docs/c-button/usage.md +13 -0
  12. package/dist/docs/c-button-group/usage.md +16 -2
  13. package/dist/docs/c-card/usage.md +55 -0
  14. package/dist/docs/c-card-actions/usage.md +1 -0
  15. package/dist/docs/c-card-content/usage.md +1 -0
  16. package/dist/docs/c-card-title/usage.md +3 -0
  17. package/dist/docs/c-checkbox/usage.md +37 -5
  18. package/dist/docs/c-color-picker/usage.md +160 -0
  19. package/dist/docs/c-csc-logo/usage.md +25 -0
  20. package/dist/docs/c-data-table/usage.md +180 -0
  21. package/dist/docs/c-date-picker/usage.md +224 -0
  22. package/dist/docs/c-divider/usage.md +36 -0
  23. package/dist/docs/c-file-upload/usage.md +189 -0
  24. package/dist/docs/c-icon/usage.md +51 -0
  25. package/dist/docs/c-icon-button/usage.md +80 -0
  26. package/dist/docs/c-link/usage.md +45 -1
  27. package/dist/docs/c-list/usage.md +50 -0
  28. package/dist/docs/c-list-item/usage.md +1 -0
  29. package/dist/docs/c-list-item-title/usage.md +1 -0
  30. package/dist/docs/c-loader/usage.md +52 -1
  31. package/dist/docs/c-login-button/usage.md +1 -0
  32. package/dist/docs/c-login-buttons/usage.md +48 -0
  33. package/dist/docs/c-login-card/usage.md +45 -0
  34. package/dist/docs/c-login-card-actions/usage.md +1 -0
  35. package/dist/docs/c-login-card-content/usage.md +1 -0
  36. package/dist/docs/c-login-card-title/usage.md +3 -0
  37. package/dist/docs/c-main/usage.md +21 -1
  38. package/dist/docs/c-menu/usage.md +15 -0
  39. package/dist/docs/c-menu-item/usage.md +11 -0
  40. package/dist/docs/c-message/usage.md +56 -0
  41. package/dist/docs/c-modal/usage.md +18 -12
  42. package/dist/docs/c-navigation-button/usage.md +32 -0
  43. package/dist/docs/c-number-field/usage.md +114 -0
  44. package/dist/docs/c-option/usage.md +1 -0
  45. package/dist/docs/c-option-value/usage.md +1 -0
  46. package/dist/docs/c-otp-input/usage.md +95 -0
  47. package/dist/docs/c-page/usage.md +44 -0
  48. package/dist/docs/c-pagination/usage.md +69 -0
  49. package/dist/docs/c-popover/usage.md +1 -1
  50. package/dist/docs/c-progress-bar/usage.md +1 -1
  51. package/dist/docs/c-progress-circle/usage.md +1 -1
  52. package/dist/docs/c-radio/usage.md +9 -6
  53. package/dist/docs/c-radio-group/usage.md +5 -6
  54. package/dist/docs/c-select/usage.md +131 -0
  55. package/dist/docs/c-side-navigation/usage.md +70 -0
  56. package/dist/docs/c-side-navigation-item/usage.md +1 -0
  57. package/dist/docs/c-side-navigation-title/usage.md +1 -0
  58. package/dist/docs/c-slider/usage.md +78 -0
  59. package/dist/docs/c-spinner/usage.md +1 -1
  60. package/dist/docs/c-status/usage.md +46 -0
  61. package/dist/docs/c-step/usage.md +1 -0
  62. package/dist/docs/c-steps/usage.md +35 -0
  63. package/dist/docs/c-sub-navigation-item/usage.md +1 -0
  64. package/dist/docs/c-switch/usage.md +10 -3
  65. package/dist/docs/c-tab/usage.md +1 -0
  66. package/dist/docs/c-tab-buttons/usage.md +15 -0
  67. package/dist/docs/c-tab-item/usage.md +1 -0
  68. package/dist/docs/c-tab-items/usage.md +1 -0
  69. package/dist/docs/c-table/usage.md +1 -1
  70. package/dist/docs/c-tabs/usage.md +77 -0
  71. package/dist/docs/c-tag/usage.md +1 -0
  72. package/dist/docs/c-tags/usage.md +85 -0
  73. package/dist/docs/c-text-field/usage.md +109 -0
  74. package/dist/docs/c-time-picker/usage.md +170 -0
  75. package/dist/docs/c-toasts/usage.md +27 -3
  76. package/dist/docs/c-toolbar/usage.md +17 -0
  77. package/dist/docs/c-tree-select/usage.md +156 -0
  78. package/dist/floating-ui.dom-DvzxEaDJ.js +1292 -0
  79. package/dist/styles/css/tailwind-theme.css +2 -1
  80. package/dist/styles/css/tokens.css +609 -178
  81. package/dist/vscode.css-custom-data.json +556 -99
  82. package/dist/vscode.html-custom-data.json +1050 -480
  83. package/dist/web-types.json +3303 -1707
  84. package/dist-types/components/c-accordion/CAccordion.vue.d.ts +21 -25
  85. package/dist-types/components/c-accordion-item/CAccordionItem.vue.d.ts +13 -12
  86. package/dist-types/components/c-alert/CAlert.vue.d.ts +12 -17
  87. package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +124 -31
  88. package/dist-types/components/c-breadcrumb/CBreadcrumb.vue.d.ts +35 -0
  89. package/dist-types/components/c-breadcrumb/fit.d.ts +29 -0
  90. package/dist-types/components/c-breadcrumb-item/CBreadcrumbItem.vue.d.ts +31 -0
  91. package/dist-types/components/c-button/CButton.vue.d.ts +52 -63
  92. package/dist-types/components/c-button-group/CButtonGroup.vue.d.ts +16 -14
  93. package/dist-types/components/c-card/CCard.vue.d.ts +2 -3
  94. package/dist-types/components/c-card-actions/CCardActions.vue.d.ts +5 -7
  95. package/dist-types/components/c-card-title/CCardTitle.vue.d.ts +11 -1
  96. package/dist-types/components/c-checkbox/CCheckbox.vue.d.ts +33 -52
  97. package/dist-types/components/c-color-picker/CColorPicker.vue.d.ts +189 -0
  98. package/dist-types/components/c-color-picker/colors.d.ts +66 -0
  99. package/dist-types/components/c-csc-logo/CCscLogo.vue.d.ts +1 -3
  100. package/dist-types/components/c-data-table/CDataTable.vue.d.ts +75 -51
  101. package/dist-types/components/c-date-picker/CDatePicker.vue.d.ts +277 -0
  102. package/dist-types/components/c-date-picker/dates.d.ts +119 -0
  103. package/dist-types/components/c-dropdown/CDropdown.vue.d.ts +51 -8
  104. package/dist-types/components/c-file-upload/CFileUpload.vue.d.ts +204 -0
  105. package/dist-types/components/c-file-upload/files.d.ts +99 -0
  106. package/dist-types/components/c-icon-button/CIconButton.vue.d.ts +23 -36
  107. package/dist-types/components/c-input/CInput.vue.d.ts +21 -43
  108. package/dist-types/components/c-link/CLink.vue.d.ts +6 -14
  109. package/dist-types/components/c-list/CList.vue.d.ts +4 -6
  110. package/dist-types/components/c-list-item/CListItem.vue.d.ts +14 -19
  111. package/dist-types/components/c-list-item-title/CListItemTitle.vue.d.ts +3 -2
  112. package/dist-types/components/c-loader/CLoader.vue.d.ts +13 -29
  113. package/dist-types/components/c-login-button/CLoginButton.vue.d.ts +9 -9
  114. package/dist-types/components/c-login-card/CLoginCard.vue.d.ts +11 -16
  115. package/dist-types/components/c-login-card-actions/CLoginCardActions.vue.d.ts +5 -7
  116. package/dist-types/components/c-login-card-title/CLoginCardTitle.vue.d.ts +11 -1
  117. package/dist-types/components/c-main/CMain.vue.d.ts +12 -5
  118. package/dist-types/components/c-menu/CMenu.vue.d.ts +17 -16
  119. package/dist-types/components/c-menu-item/CMenuItem.vue.d.ts +27 -35
  120. package/dist-types/components/c-message/CMessage.vue.d.ts +5 -15
  121. package/dist-types/components/c-modal/CModal.vue.d.ts +3 -3
  122. package/dist-types/components/c-navigation-button/CNavigationButton.vue.d.ts +20 -1
  123. package/dist-types/components/c-number-field/CNumberField.vue.d.ts +169 -0
  124. package/dist-types/components/c-number-field/numbers.d.ts +58 -0
  125. package/dist-types/components/c-option/COption.vue.d.ts +1 -1
  126. package/dist-types/components/c-otp-input/COtpInput.vue.d.ts +16 -30
  127. package/dist-types/components/c-page/CPage.vue.d.ts +2 -3
  128. package/dist-types/components/c-pagination/CPagination.vue.d.ts +56 -26
  129. package/dist-types/components/c-popover/CPopover.vue.d.ts +11 -7
  130. package/dist-types/components/c-progress-bar/CProgressBar.vue.d.ts +10 -14
  131. package/dist-types/components/c-progress-circle/CProgressCircle.vue.d.ts +7 -7
  132. package/dist-types/components/c-radio-group/CRadioGroup.vue.d.ts +11 -8
  133. package/dist-types/components/c-select/CSelect.vue.d.ts +119 -35
  134. package/dist-types/components/c-side-navigation/CSideNavigation.vue.d.ts +10 -18
  135. package/dist-types/components/c-side-navigation-item/CSideNavigationItem.vue.d.ts +22 -14
  136. package/dist-types/components/c-slider/CSlider.vue.d.ts +29 -73
  137. package/dist-types/components/c-spinner/CSpinner.vue.d.ts +4 -8
  138. package/dist-types/components/c-status/CStatus.vue.d.ts +8 -9
  139. package/dist-types/components/c-step/CStep.vue.d.ts +6 -4
  140. package/dist-types/components/c-steps/CSteps.vue.d.ts +3 -7
  141. package/dist-types/components/c-sub-navigation-item/CSubNavigationItem.vue.d.ts +23 -17
  142. package/dist-types/components/c-switch/CSwitch.vue.d.ts +17 -30
  143. package/dist-types/components/c-tab/CTab.vue.d.ts +11 -28
  144. package/dist-types/components/c-tab-buttons/CTabButtons.vue.d.ts +11 -13
  145. package/dist-types/components/c-tab-item/CTabItem.vue.d.ts +4 -5
  146. package/dist-types/components/c-tab-items/CTabItems.vue.d.ts +5 -4
  147. package/dist-types/components/c-table/CTable.vue.d.ts +7 -7
  148. package/dist-types/components/c-tabs/CTabs.vue.d.ts +13 -20
  149. package/dist-types/components/c-tag/CTag.vue.d.ts +22 -21
  150. package/dist-types/components/c-tags/CTags.vue.d.ts +9 -10
  151. package/dist-types/components/c-text-field/CTextField.vue.d.ts +74 -77
  152. package/dist-types/components/c-time-picker/CTimePicker.vue.d.ts +205 -0
  153. package/dist-types/components/c-time-picker/times.d.ts +82 -0
  154. package/dist-types/components/c-toast/CToast.vue.d.ts +3 -4
  155. package/dist-types/components/c-toast/swipe.d.ts +40 -0
  156. package/dist-types/components/c-toasts/CToasts.vue.d.ts +14 -16
  157. package/dist-types/components/c-toolbar/CToolbar.vue.d.ts +10 -1
  158. package/dist-types/components/c-tooltip/CTooltip.vue.d.ts +12 -8
  159. package/dist-types/components/c-tree-select/CTreeSelect.vue.d.ts +257 -0
  160. package/dist-types/index.d.ts +41 -32
  161. package/dist-types/registry.d.ts +9 -0
  162. package/dist-types/shared/FieldMessage.vue.d.ts +8 -5
  163. package/dist-types/shared/PanelHeadingRow.vue.d.ts +13 -0
  164. package/dist-types/shared/SelectionIndicator.vue.d.ts +21 -0
  165. package/dist-types/shared/TypedField.vue.d.ts +48 -0
  166. package/dist-types/shared/appDefaults.d.ts +75 -0
  167. package/dist-types/shared/defineElement.d.ts +1 -0
  168. package/dist-types/shared/inputMask.d.ts +106 -0
  169. package/dist-types/shared/lightDismiss.d.ts +35 -0
  170. package/dist-types/shared/modalStack.d.ts +4 -3
  171. package/dist-types/shared/navigationDrawer.d.ts +4 -0
  172. package/dist-types/shared/optionLabel.d.ts +18 -0
  173. package/dist-types/shared/pageLock.d.ts +26 -0
  174. package/dist-types/shared/peekCap.d.ts +35 -0
  175. package/dist-types/shared/popoverChain.d.ts +13 -10
  176. package/dist-types/shared/positionArea.d.ts +9 -4
  177. package/dist-types/shared/reducedMotion.d.ts +10 -0
  178. package/dist-types/shared/selectAll.d.ts +29 -0
  179. package/dist-types/shared/splitMatches.d.ts +18 -0
  180. package/dist-types/shared/useAnchoredPanel.d.ts +107 -0
  181. package/dist-types/shared/useControlAttrs.d.ts +8 -0
  182. package/dist-types/shared/useDesignatedTrigger.d.ts +5 -4
  183. package/dist-types/shared/useFallbackPosition.d.ts +71 -0
  184. package/dist-types/shared/useHostEmit.d.ts +38 -0
  185. package/dist-types/shared/useIdReferences.d.ts +39 -0
  186. package/dist-types/shared/useKeyboardModality.d.ts +7 -0
  187. package/dist-types/shared/useNarrowViewport.d.ts +19 -0
  188. package/dist-types/shared/useScrollStrip.d.ts +39 -0
  189. package/dist-types/shared/useStatusAnnouncer.d.ts +33 -0
  190. package/dist-types/shared/useTypedField.d.ts +108 -0
  191. package/dist-types/shared/valueEvents.d.ts +41 -0
  192. package/dist-types/shared/visualViewport.d.ts +51 -0
  193. package/dist-types/tag-name-map.d.ts +1572 -672
  194. package/dist-types/theme/applyTheme.d.ts +6 -6
  195. package/dist-types/theme/chart-data.d.ts +51 -0
  196. package/dist-types/theme/ramp.d.ts +38 -0
  197. package/dist-types/theme/themeMode.d.ts +51 -0
  198. package/dist-types/types.d.ts +7 -11
  199. package/package.json +32 -21
  200. package/dist/css-anchor-positioning-fn-RTxo68pt.js +0 -6447
  201. package/dist/docs/c-toast/usage.md +0 -1
  202. package/dist-types/shared/anchorPolyfill.d.ts +0 -24
  203. package/dist-types/shared/emitModelValue.d.ts +0 -37
@@ -0,0 +1,131 @@
1
+ A value-selection field: a readonly field that opens a listbox of options — slotted `c-option` elements or an `items` array — and holds the picked value, emitting the value events that back `v-model`.
2
+
3
+ ## Options
4
+
5
+ Options are slotted `c-option` elements or an `items` array of
6
+ `{ name, value }` entries. A slotted option's label — the text shown in the
7
+ closed field and, in `multiple` mode, in its tag — is its `name` attribute,
8
+ else the text of a `c-option-value` inside it, else the option's whole text.
9
+ Wrap the label in `c-option-value` when an option carries more than its
10
+ label, such as a description; the rest of the option's markup still renders
11
+ in the list row.
12
+
13
+ `<c-option selected>` sets the initial value of plain HTML: once, only while
14
+ the value is empty, and silently — no value event, so a bound `v-model` does
15
+ not learn it. With a bound value, initialise the model instead.
16
+
17
+ The row shows a copy of the option's markup, re-created from its HTML inside
18
+ the list. A component nested in an option — a `c-icon`, say — is therefore
19
+ configured through attributes, or props with an attribute form (strings,
20
+ numbers, booleans); object props and event listeners on option content do not
21
+ carry over. Page CSS does not reach the copy either: give the content a `part`
22
+ and style it through the field, which forwards every `part` named inside its
23
+ options:
24
+
25
+ ```html
26
+ <c-option value="ts">
27
+ <div part="language">
28
+ <c-option-value>TypeScript</c-option-value>
29
+ <c-icon path="…"></c-icon>
30
+ </div>
31
+ </c-option>
32
+ ```
33
+
34
+ ```css
35
+ c-select::part(language) {
36
+ display: flex;
37
+ align-items: center;
38
+ gap: 0.5rem;
39
+ }
40
+ ```
41
+
42
+ ## Multiple selection
43
+
44
+ Set `multiple` to let the user pick several options. The value is then an
45
+ array of the picked options' values in the order they were picked (an array
46
+ of `{ name, value }` items with `return-object`), and `[]` when nothing is
47
+ picked. Arrays have no attribute form — bind `value` as a DOM property
48
+ (`v-model` or `:value="…"` in Vue; the React wrapper and property
49
+ assignment do this naturally). Picking an option toggles it and keeps the
50
+ list open; `clearable` clears the whole selection. `option-as-selection`
51
+ has no effect in this mode.
52
+
53
+ Each picked option shows as a tag inside the field, and the field grows as
54
+ the tags wrap. A tag's close button removes that option; Backspace in the
55
+ closed field removes the last one. Set `max-tags` to show only that many
56
+ tags and fold the rest into a single "+N more" tag, or `max-tags="0"` to
57
+ show no tags at all — the field then reads "N selected". Assistive
58
+ technology always hears the full selection as the field's value.
59
+
60
+ Set `select-all` to pin a select-all row at the top of the list. Its checkbox
61
+ shows whether none, some or all enabled options are selected; activating it
62
+ selects every enabled option, or unselects them all when they already are.
63
+ Disabled options are left alone, and the row only appears while there is
64
+ something to select. Its label is `texts.selectAll`, a function receiving the
65
+ number of listed options.
66
+
67
+ The row checkboxes recolour like c-checkbox's (`::part(indicator)`,
68
+ `::part(mark)`), the select-all row is the `select-all` part, and the tags are
69
+ stylable through the `tags`, `tag` and `tag-root` parts:
70
+
71
+ ```css
72
+ c-select::part(tag-root) {
73
+ background: var(--c-primary-subtle);
74
+ }
75
+ ```
76
+
77
+ ## Texts
78
+
79
+ Every built-in string — the clear and toggle button labels, a tag's remove
80
+ label, the overflow and count texts, the select-all row's label — can be
81
+ replaced for another language
82
+ through the `texts` object, merged over the English defaults. Count and
83
+ label texts are functions, so the object must be bound as a DOM property:
84
+
85
+ ```vue
86
+ <c-select
87
+ :texts="{
88
+ more: (n) => `+${n} lisää`,
89
+ remove: (label) => `Poista ${label}`,
90
+ }"
91
+ multiple
92
+ />
93
+ ```
94
+
95
+ To translate every select at once, set `texts` app-wide with
96
+ `applyDefaults({ 'c-select': { texts } })` (Customization → App-wide prop
97
+ defaults); a per-instance `texts` still wins key by key.
98
+
99
+ ## Scrolling
100
+
101
+ The list shows `items-per-page` full rows (six by default) and then a
102
+ half-visible row instead of a scrollbar: the cut row is the cue that more
103
+ options follow, and the wheel, touch and arrow keys scroll as usual. Set
104
+ `items-per-page="0"` to let the list grow to the space the viewport allows;
105
+ it still ends on a half row when it overflows. To bring the native scrollbar
106
+ back:
107
+
108
+ ```css
109
+ c-select::part(list) {
110
+ scrollbar-width: auto;
111
+ }
112
+ ```
113
+
114
+ ## Narrow viewports
115
+
116
+ On a viewport narrower than 760px the panel opens as a **fullscreen panel**
117
+ instead of dropping under the field: a heading row with the field's `label` and
118
+ a close button, then the options filling the rest of the screen — the field
119
+ itself stays where it is in the page. The panel keeps covering the screen and
120
+ the heading row stays in view while the on-screen keyboard is open; the close button and
121
+ Escape both return focus to the field; the page behind the panel is inert until
122
+ it closes, and the list has no half-row cut — the screen edge is the cue. The
123
+ threshold is the viewport's width, never the field's, so a narrow field on a
124
+ desktop keeps its anchored panel. The close button's label is the `closePanel`
125
+ text, and the row's parts are `heading-row`, `heading` and `close`:
126
+
127
+ ```css
128
+ c-select::part(heading-row) {
129
+ border-bottom-color: var(--c-primary);
130
+ }
131
+ ```
@@ -0,0 +1,70 @@
1
+ The dashboard layout's left-hand menu: section titles, navigation items and their sub-items in a drawer that is pinned beside the page on desktop and slides in over it on mobile.
2
+
3
+ ## Titles, items and sub-items
4
+
5
+ Author the menu as a flat list of `c-side-navigation-title` and `c-side-navigation-item` elements: a title heads the items that follow it, up to the next title.
6
+
7
+ Write an item's sub-items as `c-sub-navigation-item` children inside it; the item slots them itself, including sub-items added later. An item with sub-items is an expandable parent with a chevron: activating it toggles its `active` state, which shows or hides the sub-items, and activating any top-level item collapses the other parents, so one stays open at a time. A parent only expands and collapses — activating it does not close the mobile drawer. The sub-items of a collapsed parent leave the Tab order.
8
+
9
+ On a parent, `active` means expanded; on an item without sub-items and on a sub-item it marks the current page (`aria-current="page"`). To mark a page under a parent, set `active` on both:
10
+
11
+ ```html
12
+ <c-side-navigation>
13
+ <c-side-navigation-title>My project</c-side-navigation-title>
14
+ <c-side-navigation-item value="dashboard">Dashboard</c-side-navigation-item>
15
+ <c-side-navigation-item value="projects" active>
16
+ Projects
17
+ <c-sub-navigation-item value="active" active>
18
+ Active projects
19
+ </c-sub-navigation-item>
20
+ <c-sub-navigation-item value="archived">
21
+ Archived projects
22
+ </c-sub-navigation-item>
23
+ </c-side-navigation-item>
24
+ </c-side-navigation>
25
+ ```
26
+
27
+ ## Selecting an item
28
+
29
+ Activating an item — a click, or Enter — fires `select` with `{ value }`, the
30
+ item's `value`. Sub-items fire it too, and it bubbles, so one listener on the
31
+ navigation can route every item:
32
+
33
+ ```vue
34
+ <c-side-navigation @select="navigate($event.detail.value)">
35
+ <c-side-navigation-item
36
+ value="/dashboard"
37
+ :active="route.path === '/dashboard'"
38
+ >
39
+ Dashboard
40
+ </c-side-navigation-item>
41
+ </c-side-navigation>
42
+ ```
43
+
44
+ The navigation does not mark the current page itself: set `active` on the item, or sub-item, of the page shown, from your router or the URL. The highlight then follows the page, not the click, so a navigation your router cancels leaves it where it was.
45
+
46
+ ## Inside c-main
47
+
48
+ Slot it as a direct child of `c-main` and the dashboard layout places and pins it: the drawer sits beneath the toolbar — or at the top edge once a `static` toolbar has scrolled away — is sized to the pinned height, and scrolls a long menu on its own. No host class is needed; the 3.x `autoheight` class is ignored there.
49
+
50
+ ## Bottom slot
51
+
52
+ Trailing content — a sign-out button, a help link — goes in the `bottom` slot. It stays at the drawer's bottom edge while the items scroll above it: the viewport's bottom edge on desktop, the panel's in the mobile drawer. It is reached without scrolling the menu and is not a menu item.
53
+
54
+ ## Mobile
55
+
56
+ Set `mobile` to render the drawer as a panel that slides in from the right over a backdrop. `open` opens and closes it, and a `c-navigation-button` anywhere on the page toggles it. Whenever the user opens or closes it — the navigation button, the close button, the backdrop, or activating an item, which closes it — the drawer fires `change:open` with the new state. Without `mobile` the drawer is always shown: a `c-navigation-button` and activating an item leave it as it is, and fire nothing.
57
+
58
+ The open mobile drawer is a modal dialog named "Menu": focus moves to its close button, the page behind it is inert and stops scrolling, and Escape closes it, as the close button and the backdrop do. Closing returns focus to where it was, usually the navigation button.
59
+
60
+ ## Standalone
61
+
62
+ Outside `c-main` the drawer is an ordinary block that grows with its items. The `autoheight` host class sizes it to the viewport minus the toolbar height and lets its item list scroll, for a shell that pins the drawer itself.
63
+
64
+ ## Accessibility
65
+
66
+ The navigation is a `<nav>` landmark; an `aria-label` on the element names it, which helps beside other navigation on the page. Items are what they do: an item or sub-item with `href` is a link, one without is a button, and a parent is a disclosure button that reports its sub-items as expanded or collapsed. Tab moves through the items; there is no arrow-key model. The current page carries `aria-current="page"`, and section titles are headings (level 2). The close button's name and the drawer's "Menu" are fixed English strings.
67
+
68
+ ## Customization
69
+
70
+ Structural styling via `::part(root)` (the drawer) and `::part(nav)` (the scrolling item list). The surface is the `nav-surface` token role; override the tokens to re-theme.
@@ -0,0 +1 @@
1
+ One entry of a `c-side-navigation`: its label text, after an optional leading `c-icon`, goes in the default slot, and activating it fires `select` with its `value`; with `href` it is a real link, opened in `target`, and without one a button. Write `c-sub-navigation-item` children inside it to make it an expandable parent, whose `active` then means expanded rather than the current page.
@@ -0,0 +1 @@
1
+ A section title in a `c-side-navigation`: uppercase text over a divider line, placed before the items it groups. It is a heading (level 2), so screen-reader users can jump between sections, and cannot be activated.
@@ -0,0 +1,78 @@
1
+ A slider for picking a number from a range by dragging a thumb along a track,
2
+ with a label, a value bubble and optional tick marks.
3
+
4
+ Set the range with `min`, `max` and `step` (0, 100 and 1 by default) and bind
5
+ the value:
6
+
7
+ ```vue
8
+ <c-slider v-model="volume" label="Volume" unit="%" />
9
+ ```
10
+
11
+ ## When to use
12
+
13
+ - Picking a value in a bounded range where the position on the track helps
14
+ the user judge it: a volume, a percentage, a small count with tick marks.
15
+ - For an exact number, or a range too wide to drag through precisely, use
16
+ `c-number-field`.
17
+
18
+ ## Value
19
+
20
+ The value is a number between `min` and `max`. While the thumb is dragged,
21
+ `update:value` and `input` fire on every move; `change` fires once, on the
22
+ release that ends the drag, and on each key press that moves the thumb. Save
23
+ or fetch on `change` rather than on every move:
24
+
25
+ ```vue
26
+ <c-slider
27
+ :value="cores"
28
+ label="CPU cores"
29
+ max="8"
30
+ @change="cores = $event.detail"
31
+ />
32
+ ```
33
+
34
+ Setting `value` moves the thumb and fires nothing. Set one: the built-in
35
+ default is `50` whatever `min` and `max` are, held within them, so a slider
36
+ with `max="8"` and no value starts at 8.
37
+
38
+ `name` is passed to the inner range input, but the component is not
39
+ form-associated, so the value does not submit with a `<form>`.
40
+
41
+ ## Value bubble and unit
42
+
43
+ While the slider is hovered, pressed or focused, a bubble above the thumb shows
44
+ the value followed by `unit`, written with as many decimals as `step` has and
45
+ the separators of the page's `lang` (`2,5` for `fi`, `2.5` for `en`). The unit
46
+ is appended as written, so include a space where one belongs (`unit=" GB"`).
47
+ Set `disable-tooltip` to turn the bubble off.
48
+
49
+ ## Tick marks
50
+
51
+ `ticks` draws marks along the track, dividing it into `segments` equal parts
52
+ (ten by default) from `min` to `max`, and `labels` writes a number under each
53
+ mark, formatted like the bubble's. The marks are
54
+ independent of `step`: for a mark on every value, match `segments` to the
55
+ range.
56
+
57
+ ```html
58
+ <c-slider label="Cores" max="8" segments="8" value="2" labels ticks></c-slider>
59
+ ```
60
+
61
+ ## Accessibility
62
+
63
+ The control is a native `<input type="range">`, so it is announced as a slider
64
+ and works from the keyboard: the arrow keys move it one `step`, Home and End
65
+ jump to `min` and `max`. The value is announced with its `unit`.
66
+
67
+ Name it with `label`, which renders a visible label for the range input.
68
+ Without a visible label, set `aria-label` on the `c-slider` element; it names
69
+ the range input instead. The bubble, the marks and their numbers are hidden
70
+ from assistive technology.
71
+
72
+ ## Customization
73
+
74
+ Restyle via CSS parts: `::part(root)` wraps the label, the range input and the
75
+ track; `::part(label)` is the label; `::part(ticks)` is the visible track under
76
+ the thumb, carrying the fill and the tick marks. The thumb and the fill paint
77
+ the primary role, and a `disabled` slider greys them out; re-theme through the
78
+ tokens.
@@ -14,7 +14,7 @@ The stroke defaults to the primary role, so a standalone spinner is brand-colour
14
14
 
15
15
  ## Accessibility
16
16
 
17
- The spinner is purely visual and exposes nothing to assistive technology. Announce the loading state on the region it describes — `aria-busy` on the updating container, or a live-region message — or use `c-loader`, whose slotted message provides visible and announced context.
17
+ The spinner is purely visual and exposes nothing to assistive technology. Announce the loading state on the region it describes — `aria-busy` on the updating container, or a live-region message. `c-loader` does not do this for you either: its slotted message gives visible context but is not announced.
18
18
 
19
19
  ## Customization
20
20
 
@@ -0,0 +1,46 @@
1
+ A status pill: a short word naming the state of a record, such as Active,
2
+ Pending or Failed, tinted with the colours of its status type.
3
+
4
+ Put the text in the default slot and pick a `type`. `info`, `success`,
5
+ `warning` and `error` paint that status family's subtle tint with its ink,
6
+ outlined in the same ink; omitting `type` renders a neutral grey pill.
7
+
8
+ ```html
9
+ <c-status type="success">Active</c-status>
10
+ ```
11
+
12
+ ## When to use
13
+
14
+ - The state of an item in a table cell, list row or card: a job, an account,
15
+ a booking.
16
+ - For a message that explains a situation or asks the user to act, use
17
+ `c-alert`: a persistent box in the page flow with a heading, an icon and a
18
+ live-region role.
19
+ - For feedback on an action the user just took, use `c-toasts`.
20
+ - For items in a set that the user picks or removes, use `c-tag` elements in
21
+ a `c-tags`; a status pill is not interactive.
22
+ - For a count on another element, use `c-badge`.
23
+
24
+ ## Sizing
25
+
26
+ The pill is at least 88px wide and 24px tall, so short labels in a column
27
+ line up; longer text widens it.
28
+
29
+ ## Accessibility
30
+
31
+ The pill has no role and is not focusable: assistive technology reads its
32
+ text inline, and its colour is not conveyed. Make the text name the state on
33
+ its own. A changed status is not announced; when the user must hear about the
34
+ change, tell them through a live region, such as a `c-alert` or a toast.
35
+
36
+ ## Customization
37
+
38
+ `::part(root)` is the pill. Its colours come from the status families'
39
+ `*-subtle` fill and `on-*-subtle` ink roles, and the outline draws in the ink
40
+ colour, so setting `color` on the part recolours text and outline together.
41
+
42
+ ```css
43
+ c-status::part(root) {
44
+ min-width: 0;
45
+ }
46
+ ```
@@ -0,0 +1 @@
1
+ One step of a `c-steps` indicator: its label goes in the default slot, under a dot that is ringed for the current step and becomes a check mark once the step is complete. A step has no props of its own — its state follows the parent's `value`.
@@ -0,0 +1,35 @@
1
+ A step indicator for a multi-step flow: a row of `c-step` dots joined by lines, with the steps before the current one checked off and the current one ringed.
2
+
3
+ Set `value` to the number of the current step, counting from 1 (`value="3"` reads as 3). The steps before it show a check mark and the lines up to it fill in; a `value` one past the last step shows every step complete. The indicator only displays progress: its steps are not clickable and it fires no events, so move between steps with the flow's own controls and update `value` from them.
4
+
5
+ ```vue
6
+ <c-steps :value="step">
7
+ <c-step>Choose resources</c-step>
8
+ <c-step>Billing details</c-step>
9
+ <c-step>Review</c-step>
10
+ </c-steps>
11
+
12
+ <c-button @click="step++">Next</c-button>
13
+ ```
14
+
15
+ `c-steps` inserts the connecting lines between your `c-step` elements, in your own DOM (each line is a `<div class="divider">` after a step), and keeps them in step when you add or remove steps.
16
+
17
+ ## When to use
18
+
19
+ - Showing where the user is in a fixed sequence — a multi-page form, an order flow.
20
+ - For sections the user switches between freely, use `c-tabs`.
21
+ - For a completion percentage, use `c-progress-bar`.
22
+
23
+ ## Narrow containers
24
+
25
+ When the step labels no longer fit side by side within the element's own width, the steps shrink to bare dots joined by lines and the current step's label is shown below the row. The full layout returns once the labels fit again.
26
+
27
+ ## Accessibility
28
+
29
+ The row of dots is hidden from assistive technology. In its place `c-steps` carries a one-sentence summary — for example "Steps, step 2 of 4. Billing details. 1 step marked as completed." — read in its place on the page. It is not a Tab stop, since there is nothing to operate. The summary is a polite status region, so a change of `value` is announced; moving focus to the new step's content, such as its heading, still helps keyboard users.
30
+
31
+ ## Customization
32
+
33
+ `c-steps::part(root)` is the row of steps, and `::part(label)` the current step's label shown below it in the narrow layout. Each step exposes `::part(root)` (the step's box, its dot over its label), `::part(indicator)` around the dot, `::part(dot)` (an incomplete step's circle), `::part(complete)` (a complete step's filled circle with its check mark) and `::part(label)`.
34
+
35
+ The current step's ring, complete steps and the lines leading up to the current step use the primary role, and upcoming steps and their lines the `border-strong` role; override the tokens to re-theme.
@@ -0,0 +1 @@
1
+ A second-level entry of a `c-side-navigation`, written inside the `c-side-navigation-item` it belongs to (no `slot` attribute needed) and shown while that parent is `active`. Activating it fires `select` with its `value` and closes the mobile drawer. It does not mark itself as the current page: set `active` on the sub-item of the page shown, and on its parent so the parent is expanded.
@@ -1,8 +1,11 @@
1
1
  A toggle for a binary setting that takes effect immediately: a native
2
- switch control with a label, an optional hint, and validation messaging.
2
+ switch control with a label.
3
3
 
4
- Bind the state with a plain `v-model` (or the `checked` prop); `true-value` /
5
- `false-value` map the on/off state onto custom values.
4
+ Bind the state with a plain `v-model`: `value` is `true-value` while the
5
+ switch is on and `false-value` while it is off (`true` and `false` unless you
6
+ map them onto custom values). `checked` is the same state as a boolean —
7
+ setting it sets `value`, and a `checked` attribute sets the initial state when
8
+ no `value` is bound.
6
9
 
7
10
  ```html
8
11
  <c-switch v-model="notifications">Email notifications</c-switch>
@@ -16,6 +19,10 @@ Bind the state with a plain `v-model` (or the `checked` prop); `true-value` /
16
19
 
17
20
  - A choice that is collected and submitted with a form — use `c-checkbox`.
18
21
 
22
+ ## Accessibility
23
+
24
+ The switch is a native input named by its label. Without a visible label, set `aria-label` on the element: it names the input, as the other ARIA attributes on the element describe it.
25
+
19
26
  ## Customization
20
27
 
21
28
  Restyle via CSS parts from your own stylesheet. The `slider` part is the
@@ -0,0 +1 @@
1
+ One tab in the row of a `c-tabs`: its label goes in the default slot (a `c-badge` there sits on the tab's corner), and its `value` names the `c-tab-item` panel it shows. `c-tabs` decides which tab is active; `disabled` keeps a tab from being selected.
@@ -9,3 +9,18 @@ has an active tab. The sliding indicator that glides to the active tab is
9
9
  this component's own affordance. For a standalone segmented control that
10
10
  holds a form value, use `c-button-group` (which this component wraps
11
11
  internally); there, active buttons paint their own fill and nothing slides.
12
+
13
+ A tab strip is always one row. When it is wider than its box it scrolls
14
+ sideways — by touch, by a mouse drag, by the wheel, or with the edge arrows
15
+ that appear while it overflows — and the tab `c-tabs` makes active is
16
+ scrolled into view. The scrollbar is hidden; the half-visible tab at the
17
+ edge and the arrows are the cue. The underlined tab row of `c-tabs` follows
18
+ the same one-row rule, but scrolls only by touch and with its arrows.
19
+
20
+ ## Accessibility
21
+
22
+ The strip is the tab set's `tablist` and each button a `tab`, its selected
23
+ state announced as `aria-selected` (the buttons are not toggle buttons here);
24
+ the edge arrows sit outside the tablist. An `aria-label` on the `c-tabs`
25
+ around it names the tablist. The arrow keys move focus between the buttons,
26
+ and Enter or Space activates the focused one.
@@ -0,0 +1 @@
1
+ One tab panel inside `c-tab-items`, shown while its `value` equals the `value` of `c-tabs` — give it the same `value` as its `c-tab`. Inactive panels stay in the DOM, hidden, so their content keeps its state across tab switches.
@@ -0,0 +1 @@
1
+ The panel container of a `c-tabs`: slot it in with `slot="items"` and put the `c-tab-item` panels inside it. It shows the panel whose `value` matches the tabs' value and slides between panels; it has no props of its own, as `c-tabs` drives it.
@@ -4,7 +4,7 @@ Write regular, semantic table markup: `<thead>` with `<th>` headers, `<tbody>` r
4
4
 
5
5
  ## Responsive mode
6
6
 
7
- With `responsive`, the table collapses into stacked cards when it is narrower than `mobile-breakpoint` (pixels, default 600). Each cell then shows a label cloned from its column header so the card stays readable without the header row.
7
+ With `responsive`, the table collapses into stacked cards when it is no wider than `mobile-breakpoint` (pixels, default 600). Each cell then shows a label cloned from its column header so the card stays readable without the header row.
8
8
 
9
9
  - Rows that should not receive labels (a full-width action row, a `colspan` summary) opt out with a `no-mobile-labels` attribute on the `<tr>`.
10
10
  - The labels are real `<span class="c-table__mobile-label">` elements prepended into your cells, so your framework will see them. Label creation is idempotent, but if a keyed re-render replaces the cell elements, call the element's `updateMobileLabels()` method afterwards to restore them.
@@ -0,0 +1,77 @@
1
+ A tab set that switches between panels of related content: a row of `c-tab` headers above the `c-tab-item` panels, one panel shown at a time.
2
+
3
+ Give each `c-tab` a `value` and the panel it shows the same `value`. The panels go in a `c-tab-items` slotted into `c-tabs` with `slot="items"`. Bind the active value with `value` (or `v-model`); `change` fires with the new value when the user picks another tab.
4
+
5
+ ```html
6
+ <c-tabs value="summary">
7
+ <c-tab value="summary">Summary</c-tab>
8
+ <c-tab value="members">Members</c-tab>
9
+
10
+ <c-tab-items slot="items">
11
+ <c-tab-item value="summary">…</c-tab-item>
12
+ <c-tab-item value="members">…</c-tab-item>
13
+ </c-tab-items>
14
+ </c-tabs>
15
+ ```
16
+
17
+ ## When to use
18
+
19
+ - Views of one subject that the user does not need side by side — a project's summary, members and settings.
20
+ - For a sequence the user moves through in order, show where they are with `c-steps`.
21
+ - For a choice that is a form value, use `c-button-group`, not tabs.
22
+
23
+ ## Value
24
+
25
+ `value` is the active tab's value. Set it to one of the tabs: with no match, no tab is active, no panel is shown and the tab row has no Tab stop. Values are compared with `===`, and an attribute is always a string, so a tab written `value="2"` does not match a number `2` bound to `c-tabs` — use strings throughout, or bind numbers on the tabs and panels too.
26
+
27
+ `change` carries the new value when the user activates a different tab: a click, or Enter or Space on a focused tab. Activating the active tab fires nothing, and setting `value` from code fires nothing either.
28
+
29
+ ```vue
30
+ <c-tabs :value="tab" @change="tab = $event.detail">…</c-tabs>
31
+ ```
32
+
33
+ ## Keyboard
34
+
35
+ Only the active tab is in the Tab order (the first enabled tab while no tab matches `value`). The Left and Right arrow keys — Up and Down in the `vertical` layout — move focus to the previous or next enabled tab, stopping at the first and the last; Home and End go to the first and the last. A tab out of view scrolls into the row. Moving focus does not switch panels: Enter or Space activates the focused tab.
36
+
37
+ ## Disabled tabs
38
+
39
+ Set `disabled` on a `c-tab` to show it greyed out and keep it from being selected by pointer or keyboard; the arrow keys skip it, and it is announced as disabled. Its panel stays in `c-tab-items` but cannot be reached through the tab.
40
+
41
+ ## Layout
42
+
43
+ - `justify` places the tabs along the row: `stretch` (the default) grows them to fill it; `start`, `center` and `end` keep each tab at its own width.
44
+ - `borderless` removes the line along the tab row.
45
+ - `vertical` stacks the tabs in a column beside the panels, marks the active tab with a bar on the column's edge, and slides the panels vertically. When the `c-tabs` element itself is narrower than `mobile-breakpoint` (640px by default — the element's width, not the viewport's), the column moves above the panels. `mobile-breakpoint` does nothing for horizontal tabs, and `justify` does nothing for vertical ones.
46
+
47
+ ## Overflowing tab row
48
+
49
+ The horizontal tab row is one line and never wraps. When the tabs are wider than the row, arrow buttons appear at both ends; each press scrolls by half the row's width, and on a touch screen the row also pans with a sideways drag (a vertical swipe that starts on the row scrolls the page). A tab that becomes active, or that the arrow keys move to, is scrolled into view. There is no scrollbar. Vertical tabs do not scroll this way.
50
+
51
+ ## Panels
52
+
53
+ Every panel stays in the DOM; only the active one's content is shown. Content in an inactive panel keeps its state across switches, so a half-filled form is still filled in when the user comes back to it.
54
+
55
+ ## Motion
56
+
57
+ The underline glides to the active tab and the panels slide into place. `disable-animation` switches both off, and they stop under the reduced-motion preference too.
58
+
59
+ ## Tab buttons
60
+
61
+ To show the tab list as a segmented control instead of the underlined row, put one `c-tab-buttons` with `c-button` children where the `c-tab` elements would go; each button's `value` names its panel as a tab's would. `c-tabs` still owns `value`, `change` and the panels, while the strip brings its own keyboard handling and sliding indicator (see `c-tab-buttons`). For a segmented control that holds a form value outside tabs, use `c-button-group`.
62
+
63
+ ## Accessibility
64
+
65
+ `c-tabs` applies the tab pattern's roles: the row of tabs is the `tablist` (`aria-orientation="vertical"` in the vertical layout; the scroll arrows and the panels sit outside it), each `c-tab` a `tab` carrying `aria-selected`, and each `c-tab-item` a `tabpanel`; with `c-tab-buttons` its buttons are the tabs. A tab and its panel point at each other through `aria-controls` and `aria-labelledby`; an `id` you set on a tab or a panel is kept, and the others are generated. An `aria-label` on `c-tabs` names the tablist; when a page holds more than one tab set, give each one so they can be told apart.
66
+
67
+ ## Customization
68
+
69
+ The tab row is `::part(container)` (the tabs plus the overflow arrows), with `::part(tabs)` the viewport the tabs scroll inside; `::part(content)` wraps the panels. Each child has a `root` part: `c-tab::part(root)` is the box centring a tab's label, `c-tab-items::part(root)` the track the panels slide on, and `c-tab-item::part(root)` a panel's padded content box.
70
+
71
+ ```css
72
+ c-tab-item::part(root) {
73
+ padding: 16px 0;
74
+ }
75
+ ```
76
+
77
+ Tab labels and the underline use the primary role, a hovered tab the `primary-subtle-hover` fill, and the row's line the `border` role; override the tokens to re-theme.
@@ -0,0 +1 @@
1
+ A pill-shaped tag naming one item — a keyword, a category, an applied filter — authored inside `c-tags`, or on its own where a single tag is needed, such as a status in a table cell. With `closeable` it shows a close button that fires `close` and leaves removing the tag to you; name that button with `close-label`, for example "Remove Chemistry".
@@ -0,0 +1,85 @@
1
+ A group of `c-tag` elements laid out in a wrapping row, with an optional
2
+ group label above them.
3
+
4
+ Put the tags in the default slot; the row wraps onto further lines when it
5
+ runs out of width. The group holds no value and fires no event of its own:
6
+ what a tag means, whether it is active and when it is removed are up to you.
7
+
8
+ ```html
9
+ <c-tags label="Research fields">
10
+ <c-tag active>All</c-tag>
11
+ <c-tag>Biosciences</c-tag>
12
+ <c-tag>Chemistry</c-tag>
13
+ </c-tags>
14
+ ```
15
+
16
+ ## When to use
17
+
18
+ - Showing a set of keywords, categories or applied filters, one tag each.
19
+ - For picking several values in a form, use `c-select` or `c-autocomplete`
20
+ with `multiple`; they show each pick as a tag inside the field.
21
+ - For a small set of choices that holds a value, use `c-button-group`.
22
+
23
+ ## Tags
24
+
25
+ A `c-tag` takes its text in the default slot. These props combine:
26
+
27
+ - `active` paints the filled, selected look. A tag never sets it itself:
28
+ listen for `click` and toggle it.
29
+ - `badge` shows a number or a short text in a small pill at the tag's start.
30
+ - `flat` makes the tag a plain label: no hover effect, not a button, and out
31
+ of the Tab order.
32
+ - `closeable` adds a close button.
33
+
34
+ Pressing the close button fires `close` on that tag. The event does not
35
+ bubble, so listen on each tag; removing the tag stays your job:
36
+
37
+ ```vue
38
+ <c-tags label="Topics">
39
+ <c-tag
40
+ v-for="topic in topics"
41
+ :key="topic.id"
42
+ :close-label="`Remove ${topic.label}`"
43
+ closeable
44
+ @close="remove(topic.id)"
45
+ >
46
+ {{ topic.label }}
47
+ </c-tag>
48
+ </c-tags>
49
+ ```
50
+
51
+ ## Size
52
+
53
+ Set `size` on the group, not on its tags: `size="small"` renders every tag
54
+ in the group compact, and the group's size overrides a tag's own `size`.
55
+
56
+ ## Accessibility
57
+
58
+ - With a `label`, the group is a `role="group"` named by it, and `required`
59
+ adds the required marker. Without one, `aria-label` or `aria-labelledby` on
60
+ the element names the group; with neither the row is a plain container.
61
+ - A plain tag — neither `closeable` nor `flat` — is a toggle button: a Tab
62
+ stop that Enter and Space press, each firing `click` as a mouse click does,
63
+ and announced with `active` as its pressed state. Toggle `active` in your
64
+ `click` handler.
65
+ - A closeable tag is not a Tab stop itself: its close button is. The button's
66
+ accessible name is `close-label`, "Remove" by default, so give each tag a
67
+ label naming what it removes, as in the example above.
68
+ - A flat tag is skipped by Tab.
69
+
70
+ ## Customization
71
+
72
+ Restyle via CSS parts: `::part(root)` stacks the label above the row,
73
+ `::part(label)` is the group label and `::part(items)` is the wrapping row.
74
+ The tags stay in your own markup, so style them directly through their
75
+ `root` part, the tag's visible box:
76
+
77
+ ```css
78
+ c-tags::part(items) {
79
+ gap: 0.5rem;
80
+ }
81
+
82
+ c-tag::part(root) {
83
+ font-weight: 600;
84
+ }
85
+ ```