@cscfi/csc-ui 4.0.0-rc.3 → 4.0.0-rc.4
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/dist/csc-ui.js +3412 -3374
- package/dist/custom-elements.json +77 -5
- package/dist/docs/c-button/usage.md +33 -8
- package/dist/docs/c-icon-button/usage.md +19 -8
- package/dist/styles/css/tokens.css +13 -9
- package/dist/vscode.html-custom-data.json +27 -3
- package/dist/web-types.json +36 -8
- package/dist-types/components/c-button/CButton.vue.d.ts +20 -4
- package/dist-types/components/c-icon-button/CIconButton.vue.d.ts +18 -2
- package/dist-types/components/c-list-item/CListItem.vue.d.ts +1 -1
- package/dist-types/components/c-side-navigation-item/CSideNavigationItem.vue.d.ts +1 -1
- package/dist-types/components/c-sub-navigation-item/CSubNavigationItem.vue.d.ts +1 -1
- package/dist-types/index.d.ts +2 -2
- package/dist-types/shared/appDefaults.d.ts +8 -1
- package/dist-types/shared/buttonVariant.d.ts +5 -0
- package/dist-types/tag-name-map.d.ts +25 -7
- package/package.json +1 -1
|
@@ -103,6 +103,13 @@
|
|
|
103
103
|
"name": "CButtonType",
|
|
104
104
|
"owner": "c-button"
|
|
105
105
|
},
|
|
106
|
+
{
|
|
107
|
+
"declaration": "export type CButtonVariant =\n | 'danger'\n | 'info'\n | 'primary'\n | 'secondary'\n | 'success'\n | 'warning';",
|
|
108
|
+
"description": "The colour a button takes: `primary` (unless set) and `secondary`, the\nbrand families, or a status colour — `success`, `info`, `warning` and\n`danger`, a destructive action in the error colour.",
|
|
109
|
+
"kind": "type-alias",
|
|
110
|
+
"name": "CButtonVariant",
|
|
111
|
+
"owner": "c-button"
|
|
112
|
+
},
|
|
106
113
|
{
|
|
107
114
|
"declaration": "export type CButtonGroupSize = 'default' | 'small';",
|
|
108
115
|
"description": "Size of the button group. `small` renders a more compact control; the size\nis also propagated to every slotted `<c-button>`. Omitting the attribute\nrenders the default size.",
|
|
@@ -362,6 +369,13 @@
|
|
|
362
369
|
"name": "CIconButtonSize",
|
|
363
370
|
"owner": "c-icon-button"
|
|
364
371
|
},
|
|
372
|
+
{
|
|
373
|
+
"declaration": "export type CIconButtonVariant =\n | 'danger'\n | 'info'\n | 'primary'\n | 'secondary'\n | 'success'\n | 'warning';",
|
|
374
|
+
"description": "The colour an icon button takes — `c-button`'s variants: `primary` (unless\nset) and `secondary`, the brand families, or a status colour — `success`,\n`info`, `warning` and `danger`, a destructive action in the error colour.",
|
|
375
|
+
"kind": "type-alias",
|
|
376
|
+
"name": "CIconButtonVariant",
|
|
377
|
+
"owner": "c-icon-button"
|
|
378
|
+
},
|
|
365
379
|
{
|
|
366
380
|
"declaration": "export type CLoginCardBlendMode =\n | 'color-burn'\n | 'color-dodge'\n | 'color'\n | 'darken'\n | 'difference'\n | 'exclusion'\n | 'hard-light'\n | 'hue'\n | 'lighten'\n | 'luminosity'\n | 'multiply'\n | 'normal'\n | 'overlay'\n | 'saturation'\n | 'screen'\n | 'soft-light';",
|
|
367
381
|
"description": "CSS `mix-blend-mode` applied to the primary-coloured overlay drawn over\nthe background image when `overlay` is set.",
|
|
@@ -1980,7 +1994,7 @@
|
|
|
1980
1994
|
"kind": "class",
|
|
1981
1995
|
"name": "CButton",
|
|
1982
1996
|
"tagName": "c-button",
|
|
1983
|
-
"description": "Buttons trigger actions — submitting a form, opening a modal, confirming a choice. Use one
|
|
1997
|
+
"description": "Buttons trigger actions — submitting a form, opening a modal, confirming a choice. Use one filled button (the default `appearance`) per view for its main action; other actions use `appearance=\"outlined\"`, `\"ghost\"` or `\"text\"`.",
|
|
1984
1998
|
"csc": {
|
|
1985
1999
|
"usage": "docs/c-button/usage.md"
|
|
1986
2000
|
},
|
|
@@ -2007,7 +2021,8 @@
|
|
|
2007
2021
|
{
|
|
2008
2022
|
"fieldName": "danger",
|
|
2009
2023
|
"name": "danger",
|
|
2010
|
-
"description": "Danger look for a destructive action: the
|
|
2024
|
+
"description": "Danger look for a destructive action: the error colour.",
|
|
2025
|
+
"deprecated": "Use `variant=\"danger\"`.",
|
|
2011
2026
|
"type": {
|
|
2012
2027
|
"text": "boolean"
|
|
2013
2028
|
},
|
|
@@ -2143,6 +2158,19 @@
|
|
|
2143
2158
|
"type": {
|
|
2144
2159
|
"text": "number | string"
|
|
2145
2160
|
}
|
|
2161
|
+
},
|
|
2162
|
+
{
|
|
2163
|
+
"fieldName": "variant",
|
|
2164
|
+
"name": "variant",
|
|
2165
|
+
"description": "The button's colour, in every appearance: `primary` unless set (or\nchanged app-wide), `secondary`, `success`, `info`, `warning`, or `danger`\nfor a destructive action.",
|
|
2166
|
+
"type": {
|
|
2167
|
+
"text": "'danger' | 'info' | 'primary' | 'secondary' | 'success' | 'warning'"
|
|
2168
|
+
},
|
|
2169
|
+
"default": "'primary'",
|
|
2170
|
+
"csc": {
|
|
2171
|
+
"typeAlias": "CButtonVariant",
|
|
2172
|
+
"defaultable": true
|
|
2173
|
+
}
|
|
2146
2174
|
}
|
|
2147
2175
|
],
|
|
2148
2176
|
"cssParts": [
|
|
@@ -2188,7 +2216,8 @@
|
|
|
2188
2216
|
"kind": "field",
|
|
2189
2217
|
"name": "danger",
|
|
2190
2218
|
"privacy": "public",
|
|
2191
|
-
"description": "Danger look for a destructive action: the
|
|
2219
|
+
"description": "Danger look for a destructive action: the error colour.",
|
|
2220
|
+
"deprecated": "Use `variant=\"danger\"`.",
|
|
2192
2221
|
"type": {
|
|
2193
2222
|
"text": "boolean"
|
|
2194
2223
|
},
|
|
@@ -2337,6 +2366,20 @@
|
|
|
2337
2366
|
"type": {
|
|
2338
2367
|
"text": "number | string"
|
|
2339
2368
|
}
|
|
2369
|
+
},
|
|
2370
|
+
{
|
|
2371
|
+
"kind": "field",
|
|
2372
|
+
"name": "variant",
|
|
2373
|
+
"privacy": "public",
|
|
2374
|
+
"description": "The button's colour, in every appearance: `primary` unless set (or\nchanged app-wide), `secondary`, `success`, `info`, `warning`, or `danger`\nfor a destructive action.",
|
|
2375
|
+
"type": {
|
|
2376
|
+
"text": "'danger' | 'info' | 'primary' | 'secondary' | 'success' | 'warning'"
|
|
2377
|
+
},
|
|
2378
|
+
"default": "'primary'",
|
|
2379
|
+
"csc": {
|
|
2380
|
+
"typeAlias": "CButtonVariant",
|
|
2381
|
+
"defaultable": true
|
|
2382
|
+
}
|
|
2340
2383
|
}
|
|
2341
2384
|
],
|
|
2342
2385
|
"slots": [
|
|
@@ -6038,7 +6081,8 @@
|
|
|
6038
6081
|
{
|
|
6039
6082
|
"fieldName": "danger",
|
|
6040
6083
|
"name": "danger",
|
|
6041
|
-
"description": "Danger look for a destructive action: the
|
|
6084
|
+
"description": "Danger look for a destructive action: the error colour.",
|
|
6085
|
+
"deprecated": "Use `variant=\"danger\"`.",
|
|
6042
6086
|
"type": {
|
|
6043
6087
|
"text": "boolean"
|
|
6044
6088
|
},
|
|
@@ -6124,6 +6168,19 @@
|
|
|
6124
6168
|
"text": "boolean"
|
|
6125
6169
|
},
|
|
6126
6170
|
"default": "false"
|
|
6171
|
+
},
|
|
6172
|
+
{
|
|
6173
|
+
"fieldName": "variant",
|
|
6174
|
+
"name": "variant",
|
|
6175
|
+
"description": "The button's colour, in every appearance: `primary` unless set (or\nchanged app-wide), `secondary`, `success`, `info`, `warning`, or `danger`\nfor a destructive action.",
|
|
6176
|
+
"type": {
|
|
6177
|
+
"text": "'danger' | 'info' | 'primary' | 'secondary' | 'success' | 'warning'"
|
|
6178
|
+
},
|
|
6179
|
+
"default": "'primary'",
|
|
6180
|
+
"csc": {
|
|
6181
|
+
"typeAlias": "CIconButtonVariant",
|
|
6182
|
+
"defaultable": true
|
|
6183
|
+
}
|
|
6127
6184
|
}
|
|
6128
6185
|
],
|
|
6129
6186
|
"cssParts": [
|
|
@@ -6170,7 +6227,8 @@
|
|
|
6170
6227
|
"kind": "field",
|
|
6171
6228
|
"name": "danger",
|
|
6172
6229
|
"privacy": "public",
|
|
6173
|
-
"description": "Danger look for a destructive action: the
|
|
6230
|
+
"description": "Danger look for a destructive action: the error colour.",
|
|
6231
|
+
"deprecated": "Use `variant=\"danger\"`.",
|
|
6174
6232
|
"type": {
|
|
6175
6233
|
"text": "boolean"
|
|
6176
6234
|
},
|
|
@@ -6264,6 +6322,20 @@
|
|
|
6264
6322
|
"text": "boolean"
|
|
6265
6323
|
},
|
|
6266
6324
|
"default": "false"
|
|
6325
|
+
},
|
|
6326
|
+
{
|
|
6327
|
+
"kind": "field",
|
|
6328
|
+
"name": "variant",
|
|
6329
|
+
"privacy": "public",
|
|
6330
|
+
"description": "The button's colour, in every appearance: `primary` unless set (or\nchanged app-wide), `secondary`, `success`, `info`, `warning`, or `danger`\nfor a destructive action.",
|
|
6331
|
+
"type": {
|
|
6332
|
+
"text": "'danger' | 'info' | 'primary' | 'secondary' | 'success' | 'warning'"
|
|
6333
|
+
},
|
|
6334
|
+
"default": "'primary'",
|
|
6335
|
+
"csc": {
|
|
6336
|
+
"typeAlias": "CIconButtonVariant",
|
|
6337
|
+
"defaultable": true
|
|
6338
|
+
}
|
|
6267
6339
|
}
|
|
6268
6340
|
],
|
|
6269
6341
|
"slots": [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Buttons trigger actions — submitting a form, opening a modal, confirming a
|
|
2
|
-
choice. Use one
|
|
3
|
-
|
|
2
|
+
choice. Use one filled button (the default `appearance`) per view for its
|
|
3
|
+
main action; other actions use `appearance="outlined"`, `"ghost"` or
|
|
4
|
+
`"text"`.
|
|
4
5
|
|
|
5
6
|
## When to use
|
|
6
7
|
|
|
@@ -16,16 +17,40 @@ secondary actions use `appearance="outlined"`, `"ghost"` or `"text"`.
|
|
|
16
17
|
## Appearances
|
|
17
18
|
|
|
18
19
|
`appearance` sets how strongly a button reads: `filled` (the default) for the
|
|
19
|
-
main action, then `outlined` (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
brand-coloured backdrop: it paints the `inverse-*` family, which looks the
|
|
24
|
-
same in both theme modes.
|
|
20
|
+
main action, then `outlined` (an outline, no fill), `ghost` (a light tint)
|
|
21
|
+
and `text` (no fill or outline) for lower emphasis. `inverted` is for a fixed
|
|
22
|
+
dark or brand-coloured backdrop: it paints the `inverse-*` family, which looks
|
|
23
|
+
the same in both theme modes.
|
|
25
24
|
|
|
26
25
|
The `outlined`, `ghost` and `text` boolean attributes of 3.x still work until
|
|
27
26
|
5.0; `appearance` wins when both are set.
|
|
28
27
|
|
|
28
|
+
## Variants
|
|
29
|
+
|
|
30
|
+
`variant` sets the button's colour, in every appearance: `primary` (the
|
|
31
|
+
default) and `secondary`, the brand colours; `success`, `info` and `warning`;
|
|
32
|
+
and `danger` for a destructive action, in the error colour. A colour is not an
|
|
33
|
+
emphasis level — make a less important action lighter with `appearance`, not
|
|
34
|
+
`secondary`.
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<c-button variant="danger">Delete</c-button>
|
|
38
|
+
<c-button appearance="outlined" variant="success">Approve</c-button>
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The filled success, info and warning buttons have a dark label, which stays
|
|
42
|
+
readable (WCAG AA) on their lighter fills. Inverted, only the filled look shows
|
|
43
|
+
the colour, as its label on the white button; the lighter appearances stay
|
|
44
|
+
white.
|
|
45
|
+
|
|
46
|
+
An app can change the default colour of every `c-button` with
|
|
47
|
+
`applyDefaults({ 'c-button': { variant: 'secondary' } })`. The buttons the
|
|
48
|
+
library draws inside its own components keep `primary`, and so do the buttons
|
|
49
|
+
of `c-tab-buttons`, whose sliding indicator has one colour.
|
|
50
|
+
|
|
51
|
+
The `danger` attribute of earlier releases still works until 5.0; `variant`
|
|
52
|
+
wins when both are set.
|
|
53
|
+
|
|
29
54
|
## In a form
|
|
30
55
|
|
|
31
56
|
`type="submit"` submits the `<form>` around the button (validating it first,
|
|
@@ -6,7 +6,7 @@ the button itself (the slot wins when both are given). Listen to the native
|
|
|
6
6
|
`click` event; a disabled or loading button does not deliver it.
|
|
7
7
|
|
|
8
8
|
```vue
|
|
9
|
-
<c-icon-button aria-label="Delete" danger @click="remove">
|
|
9
|
+
<c-icon-button aria-label="Delete" variant="danger" @click="remove">
|
|
10
10
|
<c-icon :path="mdiDelete" />
|
|
11
11
|
</c-icon-button>
|
|
12
12
|
```
|
|
@@ -22,13 +22,24 @@ the button itself (the slot wins when both are given). Listen to the native
|
|
|
22
22
|
|
|
23
23
|
## Appearances
|
|
24
24
|
|
|
25
|
-
`appearance` matches `c-button`'s: `filled` (the default)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
`appearance` matches `c-button`'s: `filled` (the default) for the main
|
|
26
|
+
action, then `outlined`, `ghost` (a light tint) and `text` (no fill) for lower
|
|
27
|
+
emphasis. The 3.x `outlined`, `ghost` and `text` boolean attributes still work
|
|
28
|
+
until 5.0; `appearance` wins when both are set. `inverted` is for a fixed dark
|
|
29
|
+
or brand-coloured backdrop: it paints the `inverse-*` family, which looks the
|
|
30
|
+
same in both theme modes.
|
|
31
|
+
|
|
32
|
+
## Variants
|
|
33
|
+
|
|
34
|
+
`variant` matches `c-button`'s and colours every appearance: `primary` (the
|
|
35
|
+
default), `secondary`, `success`, `info`, `warning`, or `danger` for a
|
|
36
|
+
destructive action. The filled success, info and warning buttons draw a dark
|
|
37
|
+
icon, which stays visible on their lighter fills; inverted, only the filled
|
|
38
|
+
look shows the colour. An app can change the default with
|
|
39
|
+
`applyDefaults({ 'c-icon-button': { variant: 'secondary' } })`; the icon
|
|
40
|
+
buttons the library draws inside its own components keep `primary`. The
|
|
41
|
+
`danger` attribute of earlier releases still works until 5.0; `variant` wins
|
|
42
|
+
when both are set.
|
|
32
43
|
|
|
33
44
|
## Sizes
|
|
34
45
|
|
|
@@ -148,6 +148,10 @@
|
|
|
148
148
|
--c-inverse-on: var(--c-white);
|
|
149
149
|
--c-inverse-primary: var(--c-primary-600);
|
|
150
150
|
--c-inverse-error: var(--c-error-600);
|
|
151
|
+
--c-inverse-info: var(--c-info-600);
|
|
152
|
+
--c-inverse-secondary: var(--c-secondary-600);
|
|
153
|
+
--c-inverse-success: var(--c-success-700);
|
|
154
|
+
--c-inverse-warning: var(--c-warning-600);
|
|
151
155
|
--c-scrim: var(--c-black);
|
|
152
156
|
}
|
|
153
157
|
|
|
@@ -196,19 +200,19 @@
|
|
|
196
200
|
--c-on-accent-subtle: var(--c-accent-700);
|
|
197
201
|
--c-success: var(--c-success-500);
|
|
198
202
|
--c-success-hover: var(--c-success-300);
|
|
199
|
-
--c-on-success: var(--c-
|
|
203
|
+
--c-on-success: var(--c-success-950);
|
|
200
204
|
--c-success-subtle: var(--c-success-100);
|
|
201
205
|
--c-success-subtle-hover: var(--c-success-50);
|
|
202
206
|
--c-on-success-subtle: var(--c-success-700);
|
|
203
207
|
--c-info: var(--c-info-500);
|
|
204
208
|
--c-info-hover: var(--c-info-300);
|
|
205
|
-
--c-on-info: var(--c-
|
|
209
|
+
--c-on-info: var(--c-black);
|
|
206
210
|
--c-info-subtle: var(--c-info-100);
|
|
207
211
|
--c-info-subtle-hover: var(--c-info-50);
|
|
208
212
|
--c-on-info-subtle: var(--c-info-700);
|
|
209
213
|
--c-warning: var(--c-warning-500);
|
|
210
214
|
--c-warning-hover: var(--c-warning-300);
|
|
211
|
-
--c-on-warning: var(--c-
|
|
215
|
+
--c-on-warning: var(--c-warning-950);
|
|
212
216
|
--c-warning-subtle: var(--c-warning-100);
|
|
213
217
|
--c-warning-subtle-hover: var(--c-warning-50);
|
|
214
218
|
--c-on-warning-subtle: var(--c-warning-700);
|
|
@@ -597,19 +601,19 @@
|
|
|
597
601
|
--c-on-accent-subtle: var(--c-accent-700);
|
|
598
602
|
--c-success: var(--c-success-500);
|
|
599
603
|
--c-success-hover: var(--c-success-300);
|
|
600
|
-
--c-on-success: var(--c-
|
|
604
|
+
--c-on-success: var(--c-success-950);
|
|
601
605
|
--c-success-subtle: var(--c-success-100);
|
|
602
606
|
--c-success-subtle-hover: var(--c-success-50);
|
|
603
607
|
--c-on-success-subtle: var(--c-success-700);
|
|
604
608
|
--c-info: var(--c-info-500);
|
|
605
609
|
--c-info-hover: var(--c-info-300);
|
|
606
|
-
--c-on-info: var(--c-
|
|
610
|
+
--c-on-info: var(--c-black);
|
|
607
611
|
--c-info-subtle: var(--c-info-100);
|
|
608
612
|
--c-info-subtle-hover: var(--c-info-50);
|
|
609
613
|
--c-on-info-subtle: var(--c-info-700);
|
|
610
614
|
--c-warning: var(--c-warning-500);
|
|
611
615
|
--c-warning-hover: var(--c-warning-300);
|
|
612
|
-
--c-on-warning: var(--c-
|
|
616
|
+
--c-on-warning: var(--c-warning-950);
|
|
613
617
|
--c-warning-subtle: var(--c-warning-100);
|
|
614
618
|
--c-warning-subtle-hover: var(--c-warning-50);
|
|
615
619
|
--c-on-warning-subtle: var(--c-warning-700);
|
|
@@ -701,19 +705,19 @@
|
|
|
701
705
|
--c-on-accent-subtle: var(--c-accent-700);
|
|
702
706
|
--c-success: var(--c-success-500);
|
|
703
707
|
--c-success-hover: var(--c-success-300);
|
|
704
|
-
--c-on-success: var(--c-
|
|
708
|
+
--c-on-success: var(--c-success-950);
|
|
705
709
|
--c-success-subtle: var(--c-success-100);
|
|
706
710
|
--c-success-subtle-hover: var(--c-success-50);
|
|
707
711
|
--c-on-success-subtle: var(--c-success-700);
|
|
708
712
|
--c-info: var(--c-info-500);
|
|
709
713
|
--c-info-hover: var(--c-info-300);
|
|
710
|
-
--c-on-info: var(--c-
|
|
714
|
+
--c-on-info: var(--c-black);
|
|
711
715
|
--c-info-subtle: var(--c-info-100);
|
|
712
716
|
--c-info-subtle-hover: var(--c-info-50);
|
|
713
717
|
--c-on-info-subtle: var(--c-info-700);
|
|
714
718
|
--c-warning: var(--c-warning-500);
|
|
715
719
|
--c-warning-hover: var(--c-warning-300);
|
|
716
|
-
--c-on-warning: var(--c-
|
|
720
|
+
--c-on-warning: var(--c-warning-950);
|
|
717
721
|
--c-warning-subtle: var(--c-warning-100);
|
|
718
722
|
--c-warning-subtle-hover: var(--c-warning-50);
|
|
719
723
|
--c-on-warning-subtle: var(--c-warning-700);
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
"name": "c-button",
|
|
212
|
-
"description": "Buttons trigger actions — submitting a form, opening a modal, confirming a choice. Use one
|
|
212
|
+
"description": "Buttons trigger actions — submitting a form, opening a modal, confirming a choice. Use one filled button (the default `appearance`) per view for its main action; other actions use `appearance=\"outlined\"`, `\"ghost\"` or `\"text\"`.\n---\n\n\n### **Slots:**\n - **default** - Button label content.\n- **icon** - Leading icon, vertically centered before the label.\n- **description** - Secondary text rendered below the label.\n\n### **CSS Parts:**\n - **root** - The native `<button>` / `<a>` element carrying the visual styling.\n- **content** - Layout wrapper for the label, icon and description.\n- **description** - Wrapper of the `description` slot.",
|
|
213
213
|
"attributes": [
|
|
214
214
|
{
|
|
215
215
|
"name": "active",
|
|
@@ -228,7 +228,7 @@
|
|
|
228
228
|
},
|
|
229
229
|
{
|
|
230
230
|
"name": "danger",
|
|
231
|
-
"description": "
|
|
231
|
+
"description": "@deprecated Use `variant=\"danger\"`.\n\nDanger look for a destructive action: the error colour.",
|
|
232
232
|
"values": []
|
|
233
233
|
},
|
|
234
234
|
{
|
|
@@ -303,6 +303,18 @@
|
|
|
303
303
|
"name": "value",
|
|
304
304
|
"description": "The button's value in a `c-button-group`; in `c-tab-buttons`, the `value`\nof the `c-tab-item` panel it shows.",
|
|
305
305
|
"values": []
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
"name": "variant",
|
|
309
|
+
"description": "The button's colour, in every appearance: `primary` unless set (or\nchanged app-wide), `secondary`, `success`, `info`, `warning`, or `danger`\nfor a destructive action.",
|
|
310
|
+
"values": [
|
|
311
|
+
{ "name": "danger" },
|
|
312
|
+
{ "name": "info" },
|
|
313
|
+
{ "name": "primary" },
|
|
314
|
+
{ "name": "secondary" },
|
|
315
|
+
{ "name": "success" },
|
|
316
|
+
{ "name": "warning" }
|
|
317
|
+
]
|
|
306
318
|
}
|
|
307
319
|
],
|
|
308
320
|
"references": []
|
|
@@ -898,7 +910,7 @@
|
|
|
898
910
|
},
|
|
899
911
|
{
|
|
900
912
|
"name": "danger",
|
|
901
|
-
"description": "
|
|
913
|
+
"description": "@deprecated Use `variant=\"danger\"`.\n\nDanger look for a destructive action: the error colour.",
|
|
902
914
|
"values": []
|
|
903
915
|
},
|
|
904
916
|
{
|
|
@@ -944,6 +956,18 @@
|
|
|
944
956
|
"name": "text",
|
|
945
957
|
"description": "@deprecated Use `appearance=\"text\"`.\n\nText appearance: no fill or outline, the lightest look.",
|
|
946
958
|
"values": []
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
"name": "variant",
|
|
962
|
+
"description": "The button's colour, in every appearance: `primary` unless set (or\nchanged app-wide), `secondary`, `success`, `info`, `warning`, or `danger`\nfor a destructive action.",
|
|
963
|
+
"values": [
|
|
964
|
+
{ "name": "danger" },
|
|
965
|
+
{ "name": "info" },
|
|
966
|
+
{ "name": "primary" },
|
|
967
|
+
{ "name": "secondary" },
|
|
968
|
+
{ "name": "success" },
|
|
969
|
+
{ "name": "warning" }
|
|
970
|
+
]
|
|
947
971
|
}
|
|
948
972
|
],
|
|
949
973
|
"references": []
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@cscfi/csc-ui",
|
|
4
|
-
"version": "4.0.0-rc.
|
|
4
|
+
"version": "4.0.0-rc.4",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -694,7 +694,7 @@
|
|
|
694
694
|
},
|
|
695
695
|
{
|
|
696
696
|
"name": "c-button",
|
|
697
|
-
"description": "Buttons trigger actions — submitting a form, opening a modal, confirming a choice. Use one
|
|
697
|
+
"description": "Buttons trigger actions — submitting a form, opening a modal, confirming a choice. Use one filled button (the default `appearance`) per view for its main action; other actions use `appearance=\"outlined\"`, `\"ghost\"` or `\"text\"`.\n---\n\n\n### **Slots:**\n - **default** - Button label content.\n- **icon** - Leading icon, vertically centered before the label.\n- **description** - Secondary text rendered below the label.\n\n### **CSS Parts:**\n - **root** - The native `<button>` / `<a>` element carrying the visual styling.\n- **content** - Layout wrapper for the label, icon and description.\n- **description** - Wrapper of the `description` slot.",
|
|
698
698
|
"doc-url": "",
|
|
699
699
|
"attributes": [
|
|
700
700
|
{
|
|
@@ -713,11 +713,12 @@
|
|
|
713
713
|
},
|
|
714
714
|
{
|
|
715
715
|
"name": "danger",
|
|
716
|
-
"description": "
|
|
716
|
+
"description": "@deprecated Use `variant=\"danger\"`.\n\nDanger look for a destructive action: the error colour.",
|
|
717
717
|
"value": {
|
|
718
718
|
"type": "boolean",
|
|
719
719
|
"default": "false"
|
|
720
|
-
}
|
|
720
|
+
},
|
|
721
|
+
"deprecated": "Use `variant=\"danger\"`."
|
|
721
722
|
},
|
|
722
723
|
{
|
|
723
724
|
"name": "disabled",
|
|
@@ -824,6 +825,14 @@
|
|
|
824
825
|
"value": {
|
|
825
826
|
"type": "number | string"
|
|
826
827
|
}
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
"name": "variant",
|
|
831
|
+
"description": "The button's colour, in every appearance: `primary` unless set (or\nchanged app-wide), `secondary`, `success`, `info`, `warning`, or `danger`\nfor a destructive action.",
|
|
832
|
+
"value": {
|
|
833
|
+
"type": "'danger' | 'info' | 'primary' | 'secondary' | 'success' | 'warning'",
|
|
834
|
+
"default": "'primary'"
|
|
835
|
+
}
|
|
827
836
|
}
|
|
828
837
|
],
|
|
829
838
|
"slots": [
|
|
@@ -855,7 +864,7 @@
|
|
|
855
864
|
},
|
|
856
865
|
{
|
|
857
866
|
"name": "danger",
|
|
858
|
-
"description": "Danger look for a destructive action: the
|
|
867
|
+
"description": "Danger look for a destructive action: the error colour.",
|
|
859
868
|
"type": "boolean"
|
|
860
869
|
},
|
|
861
870
|
{
|
|
@@ -922,6 +931,11 @@
|
|
|
922
931
|
"name": "value",
|
|
923
932
|
"description": "The button's value in a `c-button-group`; in `c-tab-buttons`, the `value`\nof the `c-tab-item` panel it shows.",
|
|
924
933
|
"type": "number | string"
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
"name": "variant",
|
|
937
|
+
"description": "The button's colour, in every appearance: `primary` unless set (or\nchanged app-wide), `secondary`, `success`, `info`, `warning`, or `danger`\nfor a destructive action.",
|
|
938
|
+
"type": "'danger' | 'info' | 'primary' | 'secondary' | 'success' | 'warning'"
|
|
925
939
|
}
|
|
926
940
|
],
|
|
927
941
|
"events": []
|
|
@@ -2795,11 +2809,12 @@
|
|
|
2795
2809
|
},
|
|
2796
2810
|
{
|
|
2797
2811
|
"name": "danger",
|
|
2798
|
-
"description": "
|
|
2812
|
+
"description": "@deprecated Use `variant=\"danger\"`.\n\nDanger look for a destructive action: the error colour.",
|
|
2799
2813
|
"value": {
|
|
2800
2814
|
"type": "boolean",
|
|
2801
2815
|
"default": "false"
|
|
2802
|
-
}
|
|
2816
|
+
},
|
|
2817
|
+
"deprecated": "Use `variant=\"danger\"`."
|
|
2803
2818
|
},
|
|
2804
2819
|
{
|
|
2805
2820
|
"name": "disabled",
|
|
@@ -2867,6 +2882,14 @@
|
|
|
2867
2882
|
"default": "false"
|
|
2868
2883
|
},
|
|
2869
2884
|
"deprecated": "Use `appearance=\"text\"`."
|
|
2885
|
+
},
|
|
2886
|
+
{
|
|
2887
|
+
"name": "variant",
|
|
2888
|
+
"description": "The button's colour, in every appearance: `primary` unless set (or\nchanged app-wide), `secondary`, `success`, `info`, `warning`, or `danger`\nfor a destructive action.",
|
|
2889
|
+
"value": {
|
|
2890
|
+
"type": "'danger' | 'info' | 'primary' | 'secondary' | 'success' | 'warning'",
|
|
2891
|
+
"default": "'primary'"
|
|
2892
|
+
}
|
|
2870
2893
|
}
|
|
2871
2894
|
],
|
|
2872
2895
|
"slots": [
|
|
@@ -2890,7 +2913,7 @@
|
|
|
2890
2913
|
},
|
|
2891
2914
|
{
|
|
2892
2915
|
"name": "danger",
|
|
2893
|
-
"description": "Danger look for a destructive action: the
|
|
2916
|
+
"description": "Danger look for a destructive action: the error colour.",
|
|
2894
2917
|
"type": "boolean"
|
|
2895
2918
|
},
|
|
2896
2919
|
{
|
|
@@ -2932,6 +2955,11 @@
|
|
|
2932
2955
|
"name": "text",
|
|
2933
2956
|
"description": "Text appearance: no fill or outline, the lightest look.",
|
|
2934
2957
|
"type": "boolean"
|
|
2958
|
+
},
|
|
2959
|
+
{
|
|
2960
|
+
"name": "variant",
|
|
2961
|
+
"description": "The button's colour, in every appearance: `primary` unless set (or\nchanged app-wide), `secondary`, `success`, `info`, `warning`, or `danger`\nfor a destructive action.",
|
|
2962
|
+
"type": "'danger' | 'info' | 'primary' | 'secondary' | 'success' | 'warning'"
|
|
2935
2963
|
}
|
|
2936
2964
|
],
|
|
2937
2965
|
"events": []
|
|
@@ -12,6 +12,12 @@ export type CButtonSize = 'default' | 'large' | 'small';
|
|
|
12
12
|
* turns the component into a link.
|
|
13
13
|
*/
|
|
14
14
|
export type CButtonType = 'button' | 'reset' | 'submit';
|
|
15
|
+
/**
|
|
16
|
+
* The colour a button takes: `primary` (unless set) and `secondary`, the
|
|
17
|
+
* brand families, or a status colour — `success`, `info`, `warning` and
|
|
18
|
+
* `danger`, a destructive action in the error colour.
|
|
19
|
+
*/
|
|
20
|
+
export type CButtonVariant = 'danger' | 'info' | 'primary' | 'secondary' | 'success' | 'warning';
|
|
15
21
|
interface CButtonProps {
|
|
16
22
|
/**
|
|
17
23
|
* Pressed (toggle) state — renders the selected look and sets
|
|
@@ -34,8 +40,9 @@ interface CButtonProps {
|
|
|
34
40
|
*/
|
|
35
41
|
asTab?: boolean;
|
|
36
42
|
/**
|
|
37
|
-
* Danger look for a destructive action: the
|
|
38
|
-
*
|
|
43
|
+
* Danger look for a destructive action: the error colour.
|
|
44
|
+
*
|
|
45
|
+
* @deprecated Use `variant="danger"`.
|
|
39
46
|
*/
|
|
40
47
|
danger?: boolean;
|
|
41
48
|
/**
|
|
@@ -117,6 +124,14 @@ interface CButtonProps {
|
|
|
117
124
|
* of the `c-tab-item` panel it shows.
|
|
118
125
|
*/
|
|
119
126
|
value?: number | string;
|
|
127
|
+
/**
|
|
128
|
+
* The button's colour, in every appearance: `primary` unless set (or
|
|
129
|
+
* changed app-wide), `secondary`, `success`, `info`, `warning`, or `danger`
|
|
130
|
+
* for a destructive action.
|
|
131
|
+
*
|
|
132
|
+
* @defaultable 'primary'
|
|
133
|
+
*/
|
|
134
|
+
variant?: CButtonVariant;
|
|
120
135
|
}
|
|
121
136
|
declare const _default: typeof __VLS_export;
|
|
122
137
|
export default _default;
|
|
@@ -127,18 +142,19 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CButto
|
|
|
127
142
|
type: CButtonType;
|
|
128
143
|
size: CButtonSize;
|
|
129
144
|
fit: boolean;
|
|
145
|
+
variant: CButtonVariant;
|
|
130
146
|
disabled: boolean;
|
|
131
147
|
loading: boolean;
|
|
132
|
-
href: string;
|
|
133
|
-
target: string;
|
|
134
148
|
active: boolean;
|
|
135
149
|
appearance: CButtonAppearance;
|
|
136
150
|
asTab: boolean;
|
|
137
151
|
danger: boolean;
|
|
138
152
|
ghost: boolean;
|
|
153
|
+
href: string;
|
|
139
154
|
inverted: boolean;
|
|
140
155
|
noRadius: boolean;
|
|
141
156
|
noRipple: boolean;
|
|
157
|
+
target: string;
|
|
142
158
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
143
159
|
icon?: (props: {}) => any;
|
|
144
160
|
} & {
|
|
@@ -9,6 +9,12 @@ export type CIconButtonAppearance = 'filled' | 'ghost' | 'outlined' | 'text';
|
|
|
9
9
|
* compact buttons; omitting the attribute renders the default size.
|
|
10
10
|
*/
|
|
11
11
|
export type CIconButtonSize = 'default' | 'small' | 'x-small';
|
|
12
|
+
/**
|
|
13
|
+
* The colour an icon button takes — `c-button`'s variants: `primary` (unless
|
|
14
|
+
* set) and `secondary`, the brand families, or a status colour — `success`,
|
|
15
|
+
* `info`, `warning` and `danger`, a destructive action in the error colour.
|
|
16
|
+
*/
|
|
17
|
+
export type CIconButtonVariant = 'danger' | 'info' | 'primary' | 'secondary' | 'success' | 'warning';
|
|
12
18
|
interface CIconButtonProps {
|
|
13
19
|
/**
|
|
14
20
|
* The button's look: `filled` (unless set) for the main action; `outlined`
|
|
@@ -22,8 +28,9 @@ interface CIconButtonProps {
|
|
|
22
28
|
*/
|
|
23
29
|
badge?: null | number | string;
|
|
24
30
|
/**
|
|
25
|
-
* Danger look for a destructive action: the
|
|
26
|
-
*
|
|
31
|
+
* Danger look for a destructive action: the error colour.
|
|
32
|
+
*
|
|
33
|
+
* @deprecated Use `variant="danger"`.
|
|
27
34
|
*/
|
|
28
35
|
danger?: boolean;
|
|
29
36
|
/**
|
|
@@ -70,6 +77,14 @@ interface CIconButtonProps {
|
|
|
70
77
|
* @deprecated Use `appearance="text"`.
|
|
71
78
|
*/
|
|
72
79
|
text?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The button's colour, in every appearance: `primary` unless set (or
|
|
82
|
+
* changed app-wide), `secondary`, `success`, `info`, `warning`, or `danger`
|
|
83
|
+
* for a destructive action.
|
|
84
|
+
*
|
|
85
|
+
* @defaultable 'primary'
|
|
86
|
+
*/
|
|
87
|
+
variant?: CIconButtonVariant;
|
|
73
88
|
}
|
|
74
89
|
declare const _default: typeof __VLS_export;
|
|
75
90
|
export default _default;
|
|
@@ -78,6 +93,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CIconB
|
|
|
78
93
|
text: boolean;
|
|
79
94
|
outlined: boolean;
|
|
80
95
|
size: CIconButtonSize;
|
|
96
|
+
variant: CIconButtonVariant;
|
|
81
97
|
disabled: boolean;
|
|
82
98
|
loading: boolean;
|
|
83
99
|
appearance: CIconButtonAppearance;
|
|
@@ -49,9 +49,9 @@ type __VLS_Slots = {} & {
|
|
|
49
49
|
};
|
|
50
50
|
declare const __VLS_base: import("vue").DefineComponent<CListItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CListItemProps> & Readonly<{}>, {
|
|
51
51
|
disabled: boolean;
|
|
52
|
+
active: boolean;
|
|
52
53
|
href: string;
|
|
53
54
|
target: string;
|
|
54
|
-
active: boolean;
|
|
55
55
|
disabledByParent: boolean;
|
|
56
56
|
hoverable: boolean;
|
|
57
57
|
ripple: boolean;
|
|
@@ -59,9 +59,9 @@ declare const __VLS_base: import("vue").DefineComponent<CSideNavigationItemProps
|
|
|
59
59
|
expanded: boolean;
|
|
60
60
|
value: string;
|
|
61
61
|
loading: boolean;
|
|
62
|
+
active: boolean;
|
|
62
63
|
href: string;
|
|
63
64
|
target: string;
|
|
64
|
-
active: boolean;
|
|
65
65
|
collapsed: boolean;
|
|
66
66
|
current: boolean;
|
|
67
67
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|