@cscfi/csc-ui 4.0.0-rc.2 → 4.0.0-rc.3

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 (46) hide show
  1. package/dist/csc-ui.js +6496 -6443
  2. package/dist/custom-elements.json +579 -23
  3. package/dist/docs/c-button/usage.md +15 -2
  4. package/dist/docs/c-card/usage.md +2 -2
  5. package/dist/docs/c-checkbox/usage.md +1 -1
  6. package/dist/docs/c-icon-button/usage.md +3 -2
  7. package/dist/docs/c-link/usage.md +1 -1
  8. package/dist/docs/c-loader/usage.md +3 -2
  9. package/dist/docs/c-otp-input/usage.md +1 -1
  10. package/dist/docs/c-radio-group/usage.md +1 -1
  11. package/dist/docs/c-side-navigation/usage.md +6 -6
  12. package/dist/docs/c-side-navigation-item/usage.md +1 -1
  13. package/dist/docs/c-slider/usage.md +10 -3
  14. package/dist/docs/c-spinner/usage.md +2 -2
  15. package/dist/docs/c-sub-navigation-item/usage.md +1 -1
  16. package/dist/docs/c-toasts/usage.md +7 -3
  17. package/dist/vscode.css-custom-data.json +12 -12
  18. package/dist/vscode.html-custom-data.json +178 -46
  19. package/dist/web-types.json +2090 -496
  20. package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +9 -0
  21. package/dist-types/components/c-button/CButton.vue.d.ts +22 -4
  22. package/dist-types/components/c-card/CCard.vue.d.ts +8 -0
  23. package/dist-types/components/c-checkbox/CCheckbox.vue.d.ts +8 -0
  24. package/dist-types/components/c-color-picker/CColorPicker.vue.d.ts +9 -0
  25. package/dist-types/components/c-date-picker/CDatePicker.vue.d.ts +9 -0
  26. package/dist-types/components/c-file-upload/CFileUpload.vue.d.ts +9 -0
  27. package/dist-types/components/c-icon-button/CIconButton.vue.d.ts +23 -4
  28. package/dist-types/components/c-loader/CLoader.vue.d.ts +7 -0
  29. package/dist-types/components/c-number-field/CNumberField.vue.d.ts +9 -0
  30. package/dist-types/components/c-otp-input/COtpInput.vue.d.ts +8 -0
  31. package/dist-types/components/c-radio-group/CRadioGroup.vue.d.ts +8 -0
  32. package/dist-types/components/c-select/CSelect.vue.d.ts +9 -0
  33. package/dist-types/components/c-side-navigation-item/CSideNavigationItem.vue.d.ts +16 -0
  34. package/dist-types/components/c-slider/CSlider.vue.d.ts +8 -0
  35. package/dist-types/components/c-spinner/CSpinner.vue.d.ts +7 -0
  36. package/dist-types/components/c-step/CStep.vue.d.ts +1 -1
  37. package/dist-types/components/c-sub-navigation-item/CSubNavigationItem.vue.d.ts +9 -0
  38. package/dist-types/components/c-text-field/CTextField.vue.d.ts +9 -0
  39. package/dist-types/components/c-time-picker/CTimePicker.vue.d.ts +9 -0
  40. package/dist-types/components/c-toasts/CToasts.vue.d.ts +26 -0
  41. package/dist-types/components/c-tree-select/CTreeSelect.vue.d.ts +9 -0
  42. package/dist-types/index.d.ts +3 -3
  43. package/dist-types/shared/appDefaults.d.ts +8 -1
  44. package/dist-types/shared/buttonAppearance.d.ts +20 -0
  45. package/dist-types/tag-name-map.d.ts +281 -70
  46. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  Buttons trigger actions — submitting a form, opening a modal, confirming a
2
- choice. Use one primary (default appearance) button per view; secondary
3
- actions use the `outlined`, `ghost` or `text` appearances.
2
+ choice. Use one primary (filled, the default `appearance`) button per view;
3
+ secondary actions use `appearance="outlined"`, `"ghost"` or `"text"`.
4
4
 
5
5
  ## When to use
6
6
 
@@ -13,6 +13,19 @@ actions use the `outlined`, `ghost` or `text` appearances.
13
13
  - Inline navigation within text — use `c-link`.
14
14
  - Toggling a persistent on/off state — use `c-switch`.
15
15
 
16
+ ## Appearances
17
+
18
+ `appearance` sets how strongly a button reads: `filled` (the default) for the
19
+ main action, then `outlined` (a primary outline, no fill), `ghost` (a light
20
+ primary tint) and `text` (no fill or outline) for lower emphasis. `danger`
21
+ turns the filled button into the error role for a destructive action; it has
22
+ no effect on the other appearances. `inverted` is for a fixed dark or
23
+ brand-coloured backdrop: it paints the `inverse-*` family, which looks the
24
+ same in both theme modes.
25
+
26
+ The `outlined`, `ghost` and `text` boolean attributes of 3.x still work until
27
+ 5.0; `appearance` wins when both are set.
28
+
16
29
  ## In a form
17
30
 
18
31
  `type="submit"` submits the `<form>` around the button (validating it first,
@@ -11,7 +11,7 @@ Build the card from its sections, in this order: `c-card-title` for the heading,
11
11
  </c-card-content>
12
12
 
13
13
  <c-card-actions justify="end">
14
- <c-button text>Cancel</c-button>
14
+ <c-button appearance="text">Cancel</c-button>
15
15
  <c-button>Save</c-button>
16
16
  </c-card-actions>
17
17
  </c-card>
@@ -34,7 +34,7 @@ Content slotted straight into the card, outside a section, keeps the vertical sp
34
34
 
35
35
  ## Fullscreen
36
36
 
37
- `fullscreen` adds a round toggle button in the card's top-right corner. Pressing it shows the card in the browser's fullscreen mode; pressing it again, or Escape, returns the card to the page. In fullscreen the card fills the screen with square corners and scrolls its own content. The toggle sits at the end of the heading row, and a `c-card-title` keeps its text and `actions` clear of it.
37
+ `show-fullscreen` (the 3.x `fullscreen`, which still works until 5.0) adds a round toggle button in the card's top-right corner. Pressing it shows the card in the browser's fullscreen mode; pressing it again, or Escape, returns the card to the page. In fullscreen the card fills the screen with square corners and scrolls its own content. The toggle sits at the end of the heading row, and a `c-card-title` keeps its text and `actions` clear of it.
38
38
 
39
39
  `enterFullscreen()` and `exitFullscreen()` do the same from code, with or without the toggle; `exitFullscreen()` ends only the card's own fullscreen, never another element's. A browser grants fullscreen only in response to a user action, so call `enterFullscreen()` from a click handler; a refused request logs a console warning and the card stays on the page.
40
40
 
@@ -38,7 +38,7 @@ const onSelectAll = (event) => {
38
38
  ```
39
39
 
40
40
  Set `hint` for a persistent helper line below the control; while `invalid` is
41
- set, `error-message` replaces it. `hide-details` removes the message area
41
+ set, `error-message` replaces it. `hide-message` removes the message area
42
42
  entirely.
43
43
 
44
44
  ## When to use
@@ -22,9 +22,10 @@ the button itself (the slot wins when both are given). Listen to the native
22
22
 
23
23
  ## Appearances
24
24
 
25
- The appearances match `c-button`'s: the default filled primary button for
25
+ `appearance` matches `c-button`'s: `filled` (the default) primary button for
26
26
  the main action, then `outlined`, `ghost` (a light primary tint) and `text`
27
- (no fill) for lower emphasis. `danger` turns the filled button into the error
27
+ (no fill) for lower emphasis. The 3.x `outlined`, `ghost` and `text` boolean
28
+ attributes still work until 5.0; `appearance` wins when both are set. `danger` turns the filled button into the error
28
29
  role for a destructive action; it has no effect on the other appearances.
29
30
  `inverted` is for a fixed dark or brand-coloured backdrop: it paints the
30
31
  `inverse-*` family, which looks the same in both theme modes.
@@ -12,7 +12,7 @@ one.
12
12
  ## When to use
13
13
 
14
14
  - Navigation in running text, or a list of links.
15
- - For an action, use `c-button` (its `text` appearance looks the lightest);
15
+ - For an action, use `c-button` (`appearance="text"` looks the lightest);
16
16
  for a link that looks like a button, use `c-button` with `href`.
17
17
 
18
18
  ## Underline
@@ -27,8 +27,9 @@ removing it with `v-if` would skip.
27
27
 
28
28
  Slot a short message to explain the wait. It fades in below the spinner
29
29
  after `content-delay` milliseconds (0 by default), so a delay keeps a quick
30
- load down to the spinner alone. `size` and `width` set the spinner's diameter
31
- and stroke in pixels (48 and 4 by default).
30
+ load down to the spinner alone. `size` and `thickness` set the spinner's
31
+ diameter and stroke in pixels (48 and 4 by default); the 3.x `width` still
32
+ sets the stroke until 5.0, and `thickness` wins when both are set.
32
33
 
33
34
  ## Accessibility
34
35
 
@@ -64,7 +64,7 @@ Validation is yours too: set `invalid` and an `error-message` explaining why.
64
64
  The boxes take the error colour and the message replaces the `hint`. While
65
65
  invalid without an `error-message`, the boxes are still coloured but the hint
66
66
  keeps rendering as a hint. Checking the code on `completion` or `change` fits
67
- most flows. `hide-details` hides the hint and the error message.
67
+ most flows. `hide-message` hides the hint and the error message.
68
68
 
69
69
  ## Accessibility
70
70
 
@@ -53,7 +53,7 @@ label.
53
53
  Validation is your job: set `invalid` and supply an `error-message`
54
54
  explaining why. While invalid without an `error-message`,
55
55
  the `hint` keeps rendering as a hint. The message area reserves its height
56
- (unless `hide-details`), so an error appearing at runtime doesn't shift the
56
+ (unless `hide-message`), so an error appearing at runtime doesn't shift the
57
57
  layout.
58
58
 
59
59
  ## Accessibility
@@ -4,17 +4,17 @@ The dashboard layout's left-hand menu: section titles, navigation items and thei
4
4
 
5
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
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.
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 `expanded` 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. Set `expanded` on a parent to open it initially. 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
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:
9
+ `current` marks the item, or sub-item, of the page shown (`aria-current="page"`). To mark a page under a parent, set `current` on the sub-item and `expanded` on its parent. The 3.x `active` still works until 5.0, meaning expanded on a parent and current elsewhere; `current` and `expanded` win when set.
10
10
 
11
11
  ```html
12
12
  <c-side-navigation>
13
13
  <c-side-navigation-title>My project</c-side-navigation-title>
14
14
  <c-side-navigation-item value="dashboard">Dashboard</c-side-navigation-item>
15
- <c-side-navigation-item value="projects" active>
15
+ <c-side-navigation-item value="projects" expanded>
16
16
  Projects
17
- <c-sub-navigation-item value="active" active>
17
+ <c-sub-navigation-item value="active" current>
18
18
  Active projects
19
19
  </c-sub-navigation-item>
20
20
  <c-sub-navigation-item value="archived">
@@ -34,14 +34,14 @@ navigation can route every item:
34
34
  <c-side-navigation @select="navigate($event.detail.value)">
35
35
  <c-side-navigation-item
36
36
  value="/dashboard"
37
- :active="route.path === '/dashboard'"
37
+ :current="route.path === '/dashboard'"
38
38
  >
39
39
  Dashboard
40
40
  </c-side-navigation-item>
41
41
  </c-side-navigation>
42
42
  ```
43
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.
44
+ The navigation does not mark the current page itself: set `current` 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
45
 
46
46
  ## Inside c-main
47
47
 
@@ -1 +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.
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, shown open while `expanded`; an item without sub-items marks the page shown with `current`.
@@ -49,13 +49,20 @@ Set `disable-tooltip` to turn the bubble off.
49
49
  ## Tick marks
50
50
 
51
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
52
+ (ten by default) from `min` to `max`, and `tick-labels` writes a number under
53
+ each mark, formatted like the bubble's (the 3.x `labels` still does until 5.0). The marks are
54
54
  independent of `step`: for a mark on every value, match `segments` to the
55
55
  range.
56
56
 
57
57
  ```html
58
- <c-slider label="Cores" max="8" segments="8" value="2" labels ticks></c-slider>
58
+ <c-slider
59
+ label="Cores"
60
+ max="8"
61
+ segments="8"
62
+ value="2"
63
+ tick-labels
64
+ ticks
65
+ ></c-slider>
59
66
  ```
60
67
 
61
68
  ## Accessibility
@@ -1,6 +1,6 @@
1
1
  A circular indeterminate activity indicator — pure motion with no value, for waits of unknown duration.
2
2
 
3
- Size the spinner with the `size` (diameter) and `width` (stroke) props, both in pixels. It spins forever; there is nothing to bind. If the wait has a known completion percentage, use `c-progress-circle` instead — the boundary is the axis (pure activity vs known value), not the shape.
3
+ Size the spinner with the `size` (diameter) and `thickness` (stroke) props, both in pixels; the 3.x `width` still sets the stroke until 5.0, and `thickness` wins when both are set. It spins forever; there is nothing to bind. If the wait has a known completion percentage, use `c-progress-circle` instead — the boundary is the axis (pure activity vs known value), not the shape.
4
4
 
5
5
  ## When to use
6
6
 
@@ -18,4 +18,4 @@ The spinner is purely visual and exposes nothing to assistive technology. Announ
18
18
 
19
19
  ## Customization
20
20
 
21
- `::part(root)` targets the `<svg>` drawing the circle. Prefer the `size`/`width`/`color` props for geometry and colour — the dash animation is computed from the size.
21
+ `::part(root)` targets the `<svg>` drawing the circle. Prefer the `size`/`thickness`/`color` props for geometry and colour — the dash animation is computed from the size.
@@ -1 +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
+ 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 `expanded`. Activating it fires `select` with its `value` and closes the mobile drawer. It does not mark itself as the current page: set `current` on the sub-item of the page shown, and `expanded` on its parent.
@@ -32,9 +32,13 @@ Place the default (fixed-position) `c-toasts` as a direct child of `body` or
32
32
  and stay fully interactive — close buttons and hover-to-pause keep working
33
33
  while a modal blocks the rest of the page.
34
34
 
35
- The `absolute` variant positions the stack inside a container for
36
- in-container notifications. It lives inside your page's stacking contexts,
37
- so it does **not** carry the above-modal guarantee.
35
+ `position` places the stack: `bottom` (the default), `bottom-start`,
36
+ `bottom-end`, `top`, `top-start` or `top-end`, start being the left edge and
37
+ end the right. `contained` keeps the stack inside its nearest positioned
38
+ ancestor instead of the viewport, for in-container notifications. A contained
39
+ stack lives inside your page's stacking contexts, so it does **not** carry the
40
+ above-modal guarantee. The 3.x `vertical`, `horizontal` and `absolute` still
41
+ work until 5.0; `position` and `contained` win when set.
38
42
 
39
43
  ## Accessibility
40
44
 
@@ -106,7 +106,7 @@
106
106
  },
107
107
  {
108
108
  "name": "::part(message)",
109
- "description": "The hint / error message area below the field (always reserved unless `hide-details`)"
109
+ "description": "The hint / error message area below the field (always reserved unless `hide-message`)"
110
110
  },
111
111
  {
112
112
  "name": "::part(root)",
@@ -175,7 +175,7 @@
175
175
  },
176
176
  {
177
177
  "name": "::part(fullscreen-toggle)",
178
- "description": "The round fullscreen toggle button, shown when `fullscreen` is set"
178
+ "description": "The round fullscreen toggle button, shown when `show-fullscreen` is set"
179
179
  },
180
180
  {
181
181
  "name": "::part(root)",
@@ -227,7 +227,7 @@
227
227
  },
228
228
  {
229
229
  "name": "::part(message)",
230
- "description": "The hint / error message area below the checkbox (always reserved unless `hide-details`)"
230
+ "description": "The hint / error message area below the checkbox (always reserved unless `hide-message`)"
231
231
  },
232
232
  {
233
233
  "name": "::part(input)",
@@ -307,7 +307,7 @@
307
307
  },
308
308
  {
309
309
  "name": "::part(message)",
310
- "description": "The hint / error message area below the field (always reserved unless `hide-details`)"
310
+ "description": "The hint / error message area below the field (always reserved unless `hide-message`)"
311
311
  },
312
312
  {
313
313
  "name": "::part(root)",
@@ -452,7 +452,7 @@
452
452
  },
453
453
  {
454
454
  "name": "::part(message)",
455
- "description": "The hint / error message area below the field (always reserved unless `hide-details`)"
455
+ "description": "The hint / error message area below the field (always reserved unless `hide-message`)"
456
456
  },
457
457
  {
458
458
  "name": "::part(root)",
@@ -469,7 +469,7 @@
469
469
  },
470
470
  {
471
471
  "name": "::part(message)",
472
- "description": "The hint/error message area under the drop zone (always reserved unless `hide-details`)"
472
+ "description": "The hint/error message area under the drop zone (always reserved unless `hide-message`)"
473
473
  },
474
474
  {
475
475
  "name": "::part(list)",
@@ -633,7 +633,7 @@
633
633
  },
634
634
  {
635
635
  "name": "::part(message)",
636
- "description": "The hint / error message area below the field (always reserved unless `hide-details`)"
636
+ "description": "The hint / error message area below the field (always reserved unless `hide-message`)"
637
637
  },
638
638
  {
639
639
  "name": "::part(root)",
@@ -739,7 +739,7 @@
739
739
  },
740
740
  {
741
741
  "name": "::part(message)",
742
- "description": "The hint/error message area below the radios (always reserved unless `hide-details`)"
742
+ "description": "The hint/error message area below the radios (always reserved unless `hide-message`)"
743
743
  },
744
744
  {
745
745
  "name": "::part(panel)",
@@ -795,7 +795,7 @@
795
795
  },
796
796
  {
797
797
  "name": "::part(message)",
798
- "description": "The hint / error message area below the field (always reserved unless `hide-details`)"
798
+ "description": "The hint / error message area below the field (always reserved unless `hide-message`)"
799
799
  },
800
800
  {
801
801
  "name": "::part(root)",
@@ -953,7 +953,7 @@
953
953
  },
954
954
  {
955
955
  "name": "::part(message)",
956
- "description": "The hint / error message area below the field (always reserved unless `hide-details`)"
956
+ "description": "The hint / error message area below the field (always reserved unless `hide-message`)"
957
957
  },
958
958
  {
959
959
  "name": "::part(input)",
@@ -1011,7 +1011,7 @@
1011
1011
  },
1012
1012
  {
1013
1013
  "name": "::part(message)",
1014
- "description": "The hint / error message area below the field (always reserved unless `hide-details`)"
1014
+ "description": "The hint / error message area below the field (always reserved unless `hide-message`)"
1015
1015
  },
1016
1016
  {
1017
1017
  "name": "::part(root)",
@@ -1120,7 +1120,7 @@
1120
1120
  },
1121
1121
  {
1122
1122
  "name": "::part(message)",
1123
- "description": "The hint / error message area below the field (always reserved unless `hide-details`)"
1123
+ "description": "The hint / error message area below the field (always reserved unless `hide-message`)"
1124
1124
  }
1125
1125
  ]
1126
1126
  }