@cscfi/csc-ui 4.0.0-rc.7 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/csc-ui.js +4343 -4217
- package/dist/custom-elements.json +123 -7
- package/dist/docs/c-accordion-item/usage.md +4 -0
- package/dist/docs/c-breadcrumb/usage.md +3 -2
- package/dist/docs/c-button/usage.md +14 -0
- package/dist/docs/c-file-upload/usage.md +6 -0
- package/dist/docs/c-icon/usage.md +5 -1
- package/dist/docs/c-icon-button/usage.md +4 -3
- package/dist/docs/c-menu-item/usage.md +3 -1
- package/dist/docs/c-status/usage.md +69 -13
- package/dist/vscode.css-custom-data.json +5 -1
- package/dist/vscode.html-custom-data.json +25 -2
- package/dist/web-types.json +52 -5
- package/dist-types/components/c-accordion-item/CAccordionItem.vue.d.ts +3 -1
- package/dist-types/components/c-breadcrumb-item/CBreadcrumbItem.vue.d.ts +3 -1
- package/dist-types/components/c-button/CButton.vue.d.ts +4 -2
- package/dist-types/components/c-file-upload/CFileUpload.vue.d.ts +3 -3
- package/dist-types/components/c-file-upload/files.d.ts +12 -4
- package/dist-types/components/c-icon/CIcon.vue.d.ts +6 -1
- package/dist-types/components/c-icon-button/CIconButton.vue.d.ts +1 -1
- package/dist-types/components/c-menu-item/CMenuItem.vue.d.ts +3 -1
- package/dist-types/components/c-status/CStatus.vue.d.ts +44 -1
- package/dist-types/index.d.ts +1 -1
- package/dist-types/shared/statusIcons.d.ts +4 -0
- package/dist-types/tag-name-map.d.ts +23 -2
- package/package.json +1 -1
|
@@ -314,7 +314,7 @@
|
|
|
314
314
|
"owner": "c-file-upload"
|
|
315
315
|
},
|
|
316
316
|
{
|
|
317
|
-
"declaration": "export interface CFileUploadEntry {\n /** The rejection text shown for a failed upload. */\n error?: string;\n\n /** The browser file, for a file the user added. Absent on a server file. */\n file?: File;\n\n /** Stable identity: generated for an added file, the consumer's own for a server file. */\n id: string;\n\n /** The file name. */\n name: string;\n\n /** What the upload function resolved to. */\n result?: unknown;\n\n /** The size in bytes. */\n size: number;\n\n /** Where the entry stands. */\n status: CFileUploadStatus;\n\n /** The media type,
|
|
317
|
+
"declaration": "export interface CFileUploadEntry {\n /** The rejection text shown for a failed upload. */\n error?: string;\n\n /** The browser file, for a file the user added, typed as `type` says. Absent on a server file. */\n file?: File;\n\n /** Stable identity: generated for an added file, the consumer's own for a server file. */\n id: string;\n\n /** The file name. */\n name: string;\n\n /** What the upload function resolved to. */\n result?: unknown;\n\n /** The size in bytes. */\n size: number;\n\n /** Where the entry stands. */\n status: CFileUploadStatus;\n\n /** The media type: the browser's, or the one its extension implies when the browser reports none. */\n type?: string;\n}",
|
|
318
318
|
"description": "One file a `c-file-upload` holds (CONTEXT.md \"File entry\").",
|
|
319
319
|
"kind": "interface",
|
|
320
320
|
"name": "CFileUploadEntry",
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
"owner": "c-file-upload"
|
|
329
329
|
},
|
|
330
330
|
{
|
|
331
|
-
"declaration": "export interface CFileUploadRejection {\n /** The refused file. */\n file: File;\n\n /** Why it was refused. */\n reason: CFileUploadRejectReason;\n}",
|
|
331
|
+
"declaration": "export interface CFileUploadRejection {\n /** The refused file, as the browser handed it. */\n file: File;\n\n /** Why it was refused. */\n reason: CFileUploadRejectReason;\n}",
|
|
332
332
|
"description": "One rejected file, as the `reject` event reports it.",
|
|
333
333
|
"kind": "interface",
|
|
334
334
|
"name": "CFileUploadRejection",
|
|
@@ -467,6 +467,27 @@
|
|
|
467
467
|
"name": "CSelectValue",
|
|
468
468
|
"owner": "c-select"
|
|
469
469
|
},
|
|
470
|
+
{
|
|
471
|
+
"declaration": "export type CStatusAppearance = 'filled' | 'outlined';",
|
|
472
|
+
"description": "How the pill reads: `filled` paints the status tint, `outlined` keeps the\nground and colours only the marker.",
|
|
473
|
+
"kind": "type-alias",
|
|
474
|
+
"name": "CStatusAppearance",
|
|
475
|
+
"owner": "c-status"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"declaration": "export type CStatusMarker = 'dot' | 'icon' | 'none';",
|
|
479
|
+
"description": "The symbol before the text: the status icon on a tinted halo, a dot in the\nstatus colour, or none.",
|
|
480
|
+
"kind": "type-alias",
|
|
481
|
+
"name": "CStatusMarker",
|
|
482
|
+
"owner": "c-status"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"declaration": "export type CStatusSize = 'default' | 'large' | 'small';",
|
|
486
|
+
"description": "Size of the pill: 20px `small`, 24px `default` or 32px `large`.",
|
|
487
|
+
"kind": "type-alias",
|
|
488
|
+
"name": "CStatusSize",
|
|
489
|
+
"owner": "c-status"
|
|
490
|
+
},
|
|
470
491
|
{
|
|
471
492
|
"declaration": "export type CStatusType = 'error' | 'info' | 'success' | 'warning';",
|
|
472
493
|
"description": "Status type of the pill. Each value paints the matching semantic status\ncolours; omitting the attribute renders the neutral grey pill.",
|
|
@@ -6007,11 +6028,14 @@
|
|
|
6007
6028
|
{
|
|
6008
6029
|
"fieldName": "size",
|
|
6009
6030
|
"name": "size",
|
|
6010
|
-
"description": "Icon size in pixels.",
|
|
6031
|
+
"description": "Icon size in pixels. Unset, the icon takes the size of the icon slot it\nsits in.",
|
|
6011
6032
|
"type": {
|
|
6012
6033
|
"text": "number"
|
|
6013
6034
|
},
|
|
6014
|
-
"default": "24"
|
|
6035
|
+
"default": "24",
|
|
6036
|
+
"csc": {
|
|
6037
|
+
"unsetUntilSet": true
|
|
6038
|
+
}
|
|
6015
6039
|
}
|
|
6016
6040
|
],
|
|
6017
6041
|
"cssParts": [
|
|
@@ -6053,11 +6077,14 @@
|
|
|
6053
6077
|
"kind": "field",
|
|
6054
6078
|
"name": "size",
|
|
6055
6079
|
"privacy": "public",
|
|
6056
|
-
"description": "Icon size in pixels.",
|
|
6080
|
+
"description": "Icon size in pixels. Unset, the icon takes the size of the icon slot it\nsits in.",
|
|
6057
6081
|
"type": {
|
|
6058
6082
|
"text": "number"
|
|
6059
6083
|
},
|
|
6060
|
-
"default": "24"
|
|
6084
|
+
"default": "24",
|
|
6085
|
+
"csc": {
|
|
6086
|
+
"unsetUntilSet": true
|
|
6087
|
+
}
|
|
6061
6088
|
}
|
|
6062
6089
|
],
|
|
6063
6090
|
"slots": []
|
|
@@ -12315,6 +12342,45 @@
|
|
|
12315
12342
|
"usage": "docs/c-status/usage.md"
|
|
12316
12343
|
},
|
|
12317
12344
|
"attributes": [
|
|
12345
|
+
{
|
|
12346
|
+
"fieldName": "appearance",
|
|
12347
|
+
"name": "appearance",
|
|
12348
|
+
"description": "`filled` (unless set, or changed app-wide) paints the status tint;\n`outlined` keeps the ground behind the pill and colours only the marker.",
|
|
12349
|
+
"type": {
|
|
12350
|
+
"text": "'filled' | 'outlined'"
|
|
12351
|
+
},
|
|
12352
|
+
"default": "'filled'",
|
|
12353
|
+
"csc": {
|
|
12354
|
+
"typeAlias": "CStatusAppearance",
|
|
12355
|
+
"defaultable": true
|
|
12356
|
+
}
|
|
12357
|
+
},
|
|
12358
|
+
{
|
|
12359
|
+
"fieldName": "marker",
|
|
12360
|
+
"name": "marker",
|
|
12361
|
+
"description": "The symbol before the text: `icon` (the status icon on a tinted halo),\n`dot`, or `none` (unless set, or changed app-wide). A slotted icon\nreplaces it.",
|
|
12362
|
+
"type": {
|
|
12363
|
+
"text": "'dot' | 'icon' | 'none'"
|
|
12364
|
+
},
|
|
12365
|
+
"default": "'none'",
|
|
12366
|
+
"csc": {
|
|
12367
|
+
"typeAlias": "CStatusMarker",
|
|
12368
|
+
"defaultable": true
|
|
12369
|
+
}
|
|
12370
|
+
},
|
|
12371
|
+
{
|
|
12372
|
+
"fieldName": "size",
|
|
12373
|
+
"name": "size",
|
|
12374
|
+
"description": "Size of the pill: `small`, `default` (unless set, or changed app-wide)\nor `large`.",
|
|
12375
|
+
"type": {
|
|
12376
|
+
"text": "'default' | 'large' | 'small'"
|
|
12377
|
+
},
|
|
12378
|
+
"default": "'default'",
|
|
12379
|
+
"csc": {
|
|
12380
|
+
"typeAlias": "CStatusSize",
|
|
12381
|
+
"defaultable": true
|
|
12382
|
+
}
|
|
12383
|
+
},
|
|
12318
12384
|
{
|
|
12319
12385
|
"fieldName": "type",
|
|
12320
12386
|
"name": "type",
|
|
@@ -12330,13 +12396,59 @@
|
|
|
12330
12396
|
"cssParts": [
|
|
12331
12397
|
{
|
|
12332
12398
|
"name": "root",
|
|
12333
|
-
"description": "The status pill wrapping the slotted text"
|
|
12399
|
+
"description": "The status pill wrapping the marker and the slotted text"
|
|
12400
|
+
},
|
|
12401
|
+
{
|
|
12402
|
+
"name": "marker",
|
|
12403
|
+
"description": "The marker before the text: the icon's halo, or the dot"
|
|
12334
12404
|
}
|
|
12335
12405
|
],
|
|
12336
12406
|
"cssProperties": [],
|
|
12337
12407
|
"cssStates": [],
|
|
12338
12408
|
"events": [],
|
|
12339
12409
|
"members": [
|
|
12410
|
+
{
|
|
12411
|
+
"kind": "field",
|
|
12412
|
+
"name": "appearance",
|
|
12413
|
+
"privacy": "public",
|
|
12414
|
+
"description": "`filled` (unless set, or changed app-wide) paints the status tint;\n`outlined` keeps the ground behind the pill and colours only the marker.",
|
|
12415
|
+
"type": {
|
|
12416
|
+
"text": "'filled' | 'outlined'"
|
|
12417
|
+
},
|
|
12418
|
+
"default": "'filled'",
|
|
12419
|
+
"csc": {
|
|
12420
|
+
"typeAlias": "CStatusAppearance",
|
|
12421
|
+
"defaultable": true
|
|
12422
|
+
}
|
|
12423
|
+
},
|
|
12424
|
+
{
|
|
12425
|
+
"kind": "field",
|
|
12426
|
+
"name": "marker",
|
|
12427
|
+
"privacy": "public",
|
|
12428
|
+
"description": "The symbol before the text: `icon` (the status icon on a tinted halo),\n`dot`, or `none` (unless set, or changed app-wide). A slotted icon\nreplaces it.",
|
|
12429
|
+
"type": {
|
|
12430
|
+
"text": "'dot' | 'icon' | 'none'"
|
|
12431
|
+
},
|
|
12432
|
+
"default": "'none'",
|
|
12433
|
+
"csc": {
|
|
12434
|
+
"typeAlias": "CStatusMarker",
|
|
12435
|
+
"defaultable": true
|
|
12436
|
+
}
|
|
12437
|
+
},
|
|
12438
|
+
{
|
|
12439
|
+
"kind": "field",
|
|
12440
|
+
"name": "size",
|
|
12441
|
+
"privacy": "public",
|
|
12442
|
+
"description": "Size of the pill: `small`, `default` (unless set, or changed app-wide)\nor `large`.",
|
|
12443
|
+
"type": {
|
|
12444
|
+
"text": "'default' | 'large' | 'small'"
|
|
12445
|
+
},
|
|
12446
|
+
"default": "'default'",
|
|
12447
|
+
"csc": {
|
|
12448
|
+
"typeAlias": "CStatusSize",
|
|
12449
|
+
"defaultable": true
|
|
12450
|
+
}
|
|
12451
|
+
},
|
|
12340
12452
|
{
|
|
12341
12453
|
"kind": "field",
|
|
12342
12454
|
"name": "type",
|
|
@@ -12354,6 +12466,10 @@
|
|
|
12354
12466
|
{
|
|
12355
12467
|
"name": "default",
|
|
12356
12468
|
"description": "The status text, such as Active or Failed"
|
|
12469
|
+
},
|
|
12470
|
+
{
|
|
12471
|
+
"name": "icon",
|
|
12472
|
+
"description": "An icon, such as a `c-icon`, that replaces the marker"
|
|
12357
12473
|
}
|
|
12358
12474
|
]
|
|
12359
12475
|
}
|
|
@@ -1 +1,5 @@
|
|
|
1
1
|
One collapsible section of a `c-accordion`: a header button showing its `heading` (or the `heading` slot) and an optional icon, above the content in the default slot. Place it directly inside the accordion and give it a `value`: the accordion expands items by value and leaves an item without one collapsed.
|
|
2
|
+
|
|
3
|
+
The icon goes in the `icon` slot, before the heading. The item sizes it to
|
|
4
|
+
24px unless the `c-icon` sets its own `size`; a plain `<svg>` or `<img>` is
|
|
5
|
+
sized the same.
|
|
@@ -6,8 +6,9 @@ Each `c-breadcrumb-item` is a crumb, written in order from the top of the
|
|
|
6
6
|
hierarchy down. A crumb with an `href` is a link; the last crumb is always the
|
|
7
7
|
current page — shown as plain text and announced as the current page, with no
|
|
8
8
|
attribute to set — and a crumb without an `href` names a level that has no page
|
|
9
|
-
of its own. An icon goes in a crumb's `icon` slot
|
|
10
|
-
`
|
|
9
|
+
of its own. An icon goes in a crumb's `icon` slot, sized 20px in the row and
|
|
10
|
+
18px in the fold panel unless the `c-icon` sets its own `size`; give an
|
|
11
|
+
icon-only crumb an `aria-label`, which names its link:
|
|
11
12
|
|
|
12
13
|
```vue
|
|
13
14
|
<c-breadcrumb>
|
|
@@ -51,6 +51,20 @@ of `c-tab-buttons`, whose sliding indicator has one colour.
|
|
|
51
51
|
The `danger` attribute of earlier releases still works until 5.0; `variant`
|
|
52
52
|
wins when both are set.
|
|
53
53
|
|
|
54
|
+
## Icon
|
|
55
|
+
|
|
56
|
+
A leading icon goes in the `icon` slot, before the label. The button sizes it
|
|
57
|
+
to match: 24px, or 20px on a small button. That covers a `c-icon` without
|
|
58
|
+
`size` and a plain `<svg>` or `<img>`; a `c-icon` with its own `size` keeps
|
|
59
|
+
it, for a glyph that looks too small or too large at the button's size.
|
|
60
|
+
|
|
61
|
+
```html
|
|
62
|
+
<c-button>
|
|
63
|
+
<c-icon slot="icon" path="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"></c-icon>
|
|
64
|
+
Add
|
|
65
|
+
</c-button>
|
|
66
|
+
```
|
|
67
|
+
|
|
54
68
|
## In a form
|
|
55
69
|
|
|
56
70
|
`type="submit"` submits the button's `<form>` — the one around it, or the one
|
|
@@ -139,6 +139,12 @@ field holds:
|
|
|
139
139
|
/>
|
|
140
140
|
```
|
|
141
141
|
|
|
142
|
+
When the browser reports no media type for a file — Chrome on Windows does
|
|
143
|
+
for a `.pptx` when Office is not installed — the field takes it from the
|
|
144
|
+
extension. The entry's `type`, its `file` and the file the upload function
|
|
145
|
+
receives all carry that type, so a server that checks it gets the right one,
|
|
146
|
+
not `application/octet-stream`.
|
|
147
|
+
|
|
142
148
|
Sizes are shown in decimal units — `1 MB` is 1,000,000 bytes, as on most
|
|
143
149
|
phones and Macs — so write `max-size` in decimal bytes. Name the accepted
|
|
144
150
|
types and limits in the `hint`; the field does not generate that text.
|
|
@@ -5,6 +5,10 @@ Pass the icon path in `path`: the path data of an icon drawn on a 24×24 grid,
|
|
|
5
5
|
typically an export of `@mdi/js` (Material Design Icons). The icon renders at
|
|
6
6
|
24px; `size` sets another width and height in pixels.
|
|
7
7
|
|
|
8
|
+
In the icon slot of another component, such as `c-button`, `c-menu-item` or
|
|
9
|
+
`c-status`, leave `size` unset: the component sizes the icon to match.
|
|
10
|
+
`c-status` sizes it whatever its `size`; elsewhere a `size` of its own wins.
|
|
11
|
+
|
|
8
12
|
```vue
|
|
9
13
|
<script setup lang="ts">
|
|
10
14
|
import { mdiCheckCircle } from '@mdi/js';
|
|
@@ -47,5 +51,5 @@ The icon is an unnamed `<svg>` unless the element has an `aria-label`.
|
|
|
47
51
|
## Customization
|
|
48
52
|
|
|
49
53
|
`::part(root)` is the `<svg>`. Its width and height are set inline from
|
|
50
|
-
`size`, so size the icon with the prop. A `color` set on the part recolours
|
|
54
|
+
`size`, or from the icon slot it sits in, so size the icon with the prop. A `color` set on the part recolours
|
|
51
55
|
an icon that has no `color` prop of its own.
|
|
@@ -43,9 +43,10 @@ when both are set.
|
|
|
43
43
|
|
|
44
44
|
## Sizes
|
|
45
45
|
|
|
46
|
-
`size` is `default` (40px), `small` (32px) or `x-small` (28px).
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
`size` is `default` (40px), `small` (32px) or `x-small` (28px). The slotted
|
|
47
|
+
icon is sized to match (24, 22 or 18px): a `c-icon` without `size`, or a
|
|
48
|
+
plain `<svg>` or `<img>`. A `c-icon` with its own `size` keeps it, for a
|
|
49
|
+
glyph that looks too small or too large at the button's size. An icon drawn
|
|
49
50
|
from `path` is always 24px.
|
|
50
51
|
|
|
51
52
|
## Badge
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
A single command in a `c-menu`.
|
|
2
2
|
|
|
3
|
-
Put a leading icon in the `icon` slot (`<c-icon slot="icon" path="…">`).
|
|
3
|
+
Put a leading icon in the `icon` slot (`<c-icon slot="icon" path="…">`). The
|
|
4
|
+
item sizes it to 18px, as its check mark, unless the `c-icon` sets its own
|
|
5
|
+
`size`; a plain `<svg>` or `<img>` is sized the same. For
|
|
4
6
|
a set of choices, give each item `type="radio"` and mark the current one
|
|
5
7
|
`checked`: it shows a check mark and `aria-checked`. The menu only fires
|
|
6
8
|
`select`; checking the item is yours to do.
|
|
@@ -2,8 +2,8 @@ A status pill: a short word naming the state of a record, such as Active,
|
|
|
2
2
|
Pending or Failed, tinted with the colours of its status type.
|
|
3
3
|
|
|
4
4
|
Put the text in the default slot and pick a `type`. `info`, `success`,
|
|
5
|
-
`warning` and `error` paint that status family's
|
|
6
|
-
|
|
5
|
+
`warning` and `error` paint that status family's colours; omitting `type`
|
|
6
|
+
renders a neutral grey pill.
|
|
7
7
|
|
|
8
8
|
```html
|
|
9
9
|
<c-status type="success">Active</c-status>
|
|
@@ -21,26 +21,82 @@ outlined in the same ink; omitting `type` renders a neutral grey pill.
|
|
|
21
21
|
a `c-tags`; a status pill is not interactive.
|
|
22
22
|
- For a count on another element, use `c-badge`.
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Appearances
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
`appearance` sets how the pill reads. `filled` (the default) paints the status
|
|
27
|
+
family's tint, its text in the tint's ink and its edge in a lighter shade of
|
|
28
|
+
the status colour. `outlined` keeps the ground behind the pill, with a grey
|
|
29
|
+
edge and plain text, so only the marker carries the colour: use it where a
|
|
30
|
+
column of filled pills would crowd a view with colour.
|
|
31
|
+
|
|
32
|
+
## Markers
|
|
33
|
+
|
|
34
|
+
`marker` puts a symbol before the text:
|
|
35
|
+
|
|
36
|
+
- `icon`: the status icon on a tinted halo, the same icon `c-alert` and
|
|
37
|
+
`c-toast` draw for the status. A neutral pill's halo holds a dot.
|
|
38
|
+
- `dot`: a dot in the status colour.
|
|
39
|
+
- `none` (the default): text only.
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<c-status type="warning" marker="icon">Expiring</c-status>
|
|
43
|
+
<c-status type="success" appearance="outlined" marker="dot">Active</c-status>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For a state the status icons do not fit, put your own icon in the `icon` slot.
|
|
47
|
+
It replaces the marker whatever `marker` says, sits in the same halo and takes
|
|
48
|
+
the marker's colour. The pill sizes it to match the status icons: 14px, or
|
|
49
|
+
11px on a small pill and 18px on a large one, whatever the icon's own `size`.
|
|
50
|
+
A plain `<svg>` or `<img>` works too.
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<c-status type="info">
|
|
54
|
+
<c-icon
|
|
55
|
+
slot="icon"
|
|
56
|
+
path="M3,3H21V7H3V3M4,8H20V21H4V8M9.5,11A0.5,0.5 0 0,0 9,11.5V13H15V11.5A0.5,0.5 0 0,0 14.5,11H9.5Z"
|
|
57
|
+
></c-icon>
|
|
58
|
+
Archived
|
|
59
|
+
</c-status>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Sizes
|
|
63
|
+
|
|
64
|
+
`size` is `small` (20px tall), `default` (24px) or `large` (32px), for a state
|
|
65
|
+
beside a page or card heading. The pill is as wide as its text; to line up
|
|
66
|
+
pills of different lengths in a column, give them a common minimum width:
|
|
67
|
+
|
|
68
|
+
```css
|
|
69
|
+
c-status::part(root) {
|
|
70
|
+
min-width: 88px;
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## App defaults
|
|
75
|
+
|
|
76
|
+
`appearance`, `marker` and `size` take an app default, so an app sets its
|
|
77
|
+
house style once:
|
|
78
|
+
`applyDefaults({ 'c-status': { appearance: 'outlined', marker: 'dot' } })`. A
|
|
79
|
+
pill's own attribute wins, and `marker="none"` takes the marker off one pill.
|
|
28
80
|
|
|
29
81
|
## Accessibility
|
|
30
82
|
|
|
31
83
|
The pill has no role and is not focusable: assistive technology reads its
|
|
32
|
-
text inline, and its colour is not conveyed.
|
|
33
|
-
|
|
34
|
-
|
|
84
|
+
text inline, and its colour is not conveyed. The marker, a slotted icon
|
|
85
|
+
included, is hidden from assistive technology. Make the text name the state
|
|
86
|
+
on its own. A changed status is not announced; when the user must hear about
|
|
87
|
+
the change, tell them through a live region, such as a `c-alert` or a toast.
|
|
35
88
|
|
|
36
89
|
## Customization
|
|
37
90
|
|
|
38
|
-
`::part(root)` is the pill
|
|
39
|
-
|
|
40
|
-
|
|
91
|
+
`::part(root)` is the pill and `::part(marker)` its marker: the icon's halo, or
|
|
92
|
+
the dot. The icon and the dot draw in `currentColor`, so setting `color` on the
|
|
93
|
+
marker part recolours them; the halo is the part's background.
|
|
94
|
+
|
|
95
|
+
The filled pill takes the status family's `*-subtle` fill and `on-*-subtle`
|
|
96
|
+
ink, and its edge is the status colour mixed into that fill.
|
|
41
97
|
|
|
42
98
|
```css
|
|
43
|
-
c-status::part(
|
|
44
|
-
|
|
99
|
+
c-status::part(marker) {
|
|
100
|
+
color: var(--my-brand);
|
|
45
101
|
}
|
|
46
102
|
```
|
|
@@ -855,7 +855,11 @@
|
|
|
855
855
|
},
|
|
856
856
|
{
|
|
857
857
|
"name": "::part(root)",
|
|
858
|
-
"description": "The status pill wrapping the slotted text"
|
|
858
|
+
"description": "The status pill wrapping the marker and the slotted text"
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
"name": "::part(marker)",
|
|
862
|
+
"description": "The marker before the text: the icon's halo, or the dot"
|
|
859
863
|
},
|
|
860
864
|
{
|
|
861
865
|
"name": "::part(root)",
|
|
@@ -902,7 +902,11 @@
|
|
|
902
902
|
"description": "Svg `path` `d` attribute value.",
|
|
903
903
|
"values": []
|
|
904
904
|
},
|
|
905
|
-
{
|
|
905
|
+
{
|
|
906
|
+
"name": "size",
|
|
907
|
+
"description": "Icon size in pixels. Unset, the icon takes the size of the icon slot it\nsits in.",
|
|
908
|
+
"values": []
|
|
909
|
+
}
|
|
906
910
|
],
|
|
907
911
|
"references": []
|
|
908
912
|
},
|
|
@@ -2042,8 +2046,27 @@
|
|
|
2042
2046
|
},
|
|
2043
2047
|
{
|
|
2044
2048
|
"name": "c-status",
|
|
2045
|
-
"description": "A status pill: a short word naming the state of a record, such as Active, Pending or Failed, tinted with the colours of its status type.\n---\n\n\n### **Slots:**\n - **default** - The status text, such as Active or Failed\n\n### **CSS Parts:**\n - **root** - The status pill wrapping the slotted text",
|
|
2049
|
+
"description": "A status pill: a short word naming the state of a record, such as Active, Pending or Failed, tinted with the colours of its status type.\n---\n\n\n### **Slots:**\n - **default** - The status text, such as Active or Failed\n- **icon** - An icon, such as a `c-icon`, that replaces the marker\n\n### **CSS Parts:**\n - **root** - The status pill wrapping the marker and the slotted text\n- **marker** - The marker before the text: the icon's halo, or the dot",
|
|
2046
2050
|
"attributes": [
|
|
2051
|
+
{
|
|
2052
|
+
"name": "appearance",
|
|
2053
|
+
"description": "`filled` (unless set, or changed app-wide) paints the status tint;\n`outlined` keeps the ground behind the pill and colours only the marker.",
|
|
2054
|
+
"values": [{ "name": "filled" }, { "name": "outlined" }]
|
|
2055
|
+
},
|
|
2056
|
+
{
|
|
2057
|
+
"name": "marker",
|
|
2058
|
+
"description": "The symbol before the text: `icon` (the status icon on a tinted halo),\n`dot`, or `none` (unless set, or changed app-wide). A slotted icon\nreplaces it.",
|
|
2059
|
+
"values": [{ "name": "dot" }, { "name": "icon" }, { "name": "none" }]
|
|
2060
|
+
},
|
|
2061
|
+
{
|
|
2062
|
+
"name": "size",
|
|
2063
|
+
"description": "Size of the pill: `small`, `default` (unless set, or changed app-wide)\nor `large`.",
|
|
2064
|
+
"values": [
|
|
2065
|
+
{ "name": "default" },
|
|
2066
|
+
{ "name": "large" },
|
|
2067
|
+
{ "name": "small" }
|
|
2068
|
+
]
|
|
2069
|
+
},
|
|
2047
2070
|
{
|
|
2048
2071
|
"name": "type",
|
|
2049
2072
|
"description": "The status family whose tint and ink paint the pill; without it the\npill is neutral grey.",
|
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
|
|
4
|
+
"version": "4.0.0",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -2770,7 +2770,7 @@
|
|
|
2770
2770
|
},
|
|
2771
2771
|
{
|
|
2772
2772
|
"name": "size",
|
|
2773
|
-
"description": "Icon size in pixels.",
|
|
2773
|
+
"description": "Icon size in pixels. Unset, the icon takes the size of the icon slot it\nsits in.",
|
|
2774
2774
|
"value": {
|
|
2775
2775
|
"type": "number",
|
|
2776
2776
|
"default": "24"
|
|
@@ -2793,7 +2793,7 @@
|
|
|
2793
2793
|
},
|
|
2794
2794
|
{
|
|
2795
2795
|
"name": "size",
|
|
2796
|
-
"description": "Icon size in pixels.",
|
|
2796
|
+
"description": "Icon size in pixels. Unset, the icon takes the size of the icon slot it\nsits in.",
|
|
2797
2797
|
"type": "number"
|
|
2798
2798
|
}
|
|
2799
2799
|
],
|
|
@@ -6059,9 +6059,33 @@
|
|
|
6059
6059
|
},
|
|
6060
6060
|
{
|
|
6061
6061
|
"name": "c-status",
|
|
6062
|
-
"description": "A status pill: a short word naming the state of a record, such as Active, Pending or Failed, tinted with the colours of its status type.\n---\n\n\n### **Slots:**\n - **default** - The status text, such as Active or Failed\n\n### **CSS Parts:**\n - **root** - The status pill wrapping the slotted text",
|
|
6062
|
+
"description": "A status pill: a short word naming the state of a record, such as Active, Pending or Failed, tinted with the colours of its status type.\n---\n\n\n### **Slots:**\n - **default** - The status text, such as Active or Failed\n- **icon** - An icon, such as a `c-icon`, that replaces the marker\n\n### **CSS Parts:**\n - **root** - The status pill wrapping the marker and the slotted text\n- **marker** - The marker before the text: the icon's halo, or the dot",
|
|
6063
6063
|
"doc-url": "",
|
|
6064
6064
|
"attributes": [
|
|
6065
|
+
{
|
|
6066
|
+
"name": "appearance",
|
|
6067
|
+
"description": "`filled` (unless set, or changed app-wide) paints the status tint;\n`outlined` keeps the ground behind the pill and colours only the marker.",
|
|
6068
|
+
"value": {
|
|
6069
|
+
"type": "'filled' | 'outlined'",
|
|
6070
|
+
"default": "'filled'"
|
|
6071
|
+
}
|
|
6072
|
+
},
|
|
6073
|
+
{
|
|
6074
|
+
"name": "marker",
|
|
6075
|
+
"description": "The symbol before the text: `icon` (the status icon on a tinted halo),\n`dot`, or `none` (unless set, or changed app-wide). A slotted icon\nreplaces it.",
|
|
6076
|
+
"value": {
|
|
6077
|
+
"type": "'dot' | 'icon' | 'none'",
|
|
6078
|
+
"default": "'none'"
|
|
6079
|
+
}
|
|
6080
|
+
},
|
|
6081
|
+
{
|
|
6082
|
+
"name": "size",
|
|
6083
|
+
"description": "Size of the pill: `small`, `default` (unless set, or changed app-wide)\nor `large`.",
|
|
6084
|
+
"value": {
|
|
6085
|
+
"type": "'default' | 'large' | 'small'",
|
|
6086
|
+
"default": "'default'"
|
|
6087
|
+
}
|
|
6088
|
+
},
|
|
6065
6089
|
{
|
|
6066
6090
|
"name": "type",
|
|
6067
6091
|
"description": "The status family whose tint and ink paint the pill; without it the\npill is neutral grey.",
|
|
@@ -6074,11 +6098,30 @@
|
|
|
6074
6098
|
{
|
|
6075
6099
|
"name": "default",
|
|
6076
6100
|
"description": "The status text, such as Active or Failed"
|
|
6101
|
+
},
|
|
6102
|
+
{
|
|
6103
|
+
"name": "icon",
|
|
6104
|
+
"description": "An icon, such as a `c-icon`, that replaces the marker"
|
|
6077
6105
|
}
|
|
6078
6106
|
],
|
|
6079
6107
|
"events": [],
|
|
6080
6108
|
"js": {
|
|
6081
6109
|
"properties": [
|
|
6110
|
+
{
|
|
6111
|
+
"name": "appearance",
|
|
6112
|
+
"description": "`filled` (unless set, or changed app-wide) paints the status tint;\n`outlined` keeps the ground behind the pill and colours only the marker.",
|
|
6113
|
+
"type": "'filled' | 'outlined'"
|
|
6114
|
+
},
|
|
6115
|
+
{
|
|
6116
|
+
"name": "marker",
|
|
6117
|
+
"description": "The symbol before the text: `icon` (the status icon on a tinted halo),\n`dot`, or `none` (unless set, or changed app-wide). A slotted icon\nreplaces it.",
|
|
6118
|
+
"type": "'dot' | 'icon' | 'none'"
|
|
6119
|
+
},
|
|
6120
|
+
{
|
|
6121
|
+
"name": "size",
|
|
6122
|
+
"description": "Size of the pill: `small`, `default` (unless set, or changed app-wide)\nor `large`.",
|
|
6123
|
+
"type": "'default' | 'large' | 'small'"
|
|
6124
|
+
},
|
|
6082
6125
|
{
|
|
6083
6126
|
"name": "type",
|
|
6084
6127
|
"description": "The status family whose tint and ink paint the pill; without it the\npill is neutral grey.",
|
|
@@ -9121,7 +9164,11 @@
|
|
|
9121
9164
|
},
|
|
9122
9165
|
{
|
|
9123
9166
|
"name": "part(root)",
|
|
9124
|
-
"description": "The status pill wrapping the slotted text"
|
|
9167
|
+
"description": "The status pill wrapping the marker and the slotted text"
|
|
9168
|
+
},
|
|
9169
|
+
{
|
|
9170
|
+
"name": "part(marker)",
|
|
9171
|
+
"description": "The marker before the text: the icon's halo, or the dot"
|
|
9125
9172
|
},
|
|
9126
9173
|
{
|
|
9127
9174
|
"name": "part(root)",
|
|
@@ -32,7 +32,9 @@ interface CAccordionItemProps {
|
|
|
32
32
|
*/
|
|
33
33
|
value?: number | string;
|
|
34
34
|
}
|
|
35
|
-
declare var __VLS_1: {
|
|
35
|
+
declare var __VLS_1: {
|
|
36
|
+
class: string;
|
|
37
|
+
}, __VLS_3: {}, __VLS_5: {};
|
|
36
38
|
type __VLS_Slots = {} & {
|
|
37
39
|
icon?: (props: typeof __VLS_1) => any;
|
|
38
40
|
} & {
|
|
@@ -20,7 +20,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CBread
|
|
|
20
20
|
href: string;
|
|
21
21
|
target: string;
|
|
22
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
23
|
-
icon?: (props: {
|
|
23
|
+
icon?: (props: {
|
|
24
|
+
class: string;
|
|
25
|
+
}) => any;
|
|
24
26
|
} & {
|
|
25
27
|
default?: (props: {}) => any;
|
|
26
28
|
}>;
|
|
@@ -145,10 +145,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CButto
|
|
|
145
145
|
size: CButtonSize;
|
|
146
146
|
fit: boolean;
|
|
147
147
|
variant: CButtonVariant;
|
|
148
|
+
appearance: CButtonAppearance;
|
|
148
149
|
disabled: boolean;
|
|
149
150
|
loading: boolean;
|
|
150
151
|
active: boolean;
|
|
151
|
-
appearance: CButtonAppearance;
|
|
152
152
|
asTab: boolean;
|
|
153
153
|
danger: boolean;
|
|
154
154
|
ghost: boolean;
|
|
@@ -158,7 +158,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CButto
|
|
|
158
158
|
noRipple: boolean;
|
|
159
159
|
target: string;
|
|
160
160
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
161
|
-
icon?: (props: {
|
|
161
|
+
icon?: (props: {
|
|
162
|
+
class: string;
|
|
163
|
+
}) => any;
|
|
162
164
|
} & {
|
|
163
165
|
default?: (props: {
|
|
164
166
|
class: string;
|
|
@@ -12,7 +12,7 @@ export interface CFileUploadContext {
|
|
|
12
12
|
export interface CFileUploadEntry {
|
|
13
13
|
/** The rejection text shown for a failed upload. */
|
|
14
14
|
error?: string;
|
|
15
|
-
/** The browser file, for a file the user added. Absent on a server file. */
|
|
15
|
+
/** The browser file, for a file the user added, typed as `type` says. Absent on a server file. */
|
|
16
16
|
file?: File;
|
|
17
17
|
/** Stable identity: generated for an added file, the consumer's own for a server file. */
|
|
18
18
|
id: string;
|
|
@@ -24,14 +24,14 @@ export interface CFileUploadEntry {
|
|
|
24
24
|
size: number;
|
|
25
25
|
/** Where the entry stands. */
|
|
26
26
|
status: CFileUploadStatus;
|
|
27
|
-
/** The media type,
|
|
27
|
+
/** The media type: the browser's, or the one its extension implies when the browser reports none. */
|
|
28
28
|
type?: string;
|
|
29
29
|
}
|
|
30
30
|
/** Sends one file; resolves to the entry's `result` or rejects to mark it failed. */
|
|
31
31
|
export type CFileUploadFunction = (file: File, context: CFileUploadContext) => Promise<unknown>;
|
|
32
32
|
/** One rejected file, as the `reject` event reports it. */
|
|
33
33
|
export interface CFileUploadRejection {
|
|
34
|
-
/** The refused file. */
|
|
34
|
+
/** The refused file, as the browser handed it. */
|
|
35
35
|
file: File;
|
|
36
36
|
/** Why it was refused. */
|
|
37
37
|
reason: CFileUploadRejectReason;
|