@cscfi/csc-ui 4.0.0-rc.6 → 4.0.0-rc.8
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 +4375 -4237
- package/dist/custom-elements.json +142 -18
- 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-progress-bar/usage.md +24 -5
- package/dist/docs/c-status/usage.md +69 -13
- package/dist/vscode.css-custom-data.json +16 -4
- package/dist/vscode.html-custom-data.json +31 -8
- package/dist/web-types.json +73 -18
- 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-progress-bar/CProgressBar.vue.d.ts +4 -4
- 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 +27 -6
- 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.",
|
|
@@ -5673,7 +5694,11 @@
|
|
|
5673
5694
|
},
|
|
5674
5695
|
{
|
|
5675
5696
|
"name": "progress",
|
|
5676
|
-
"description": "The progress
|
|
5697
|
+
"description": "The progress track along an uploading row's bottom edge"
|
|
5698
|
+
},
|
|
5699
|
+
{
|
|
5700
|
+
"name": "progress-bar",
|
|
5701
|
+
"description": "The bar inside it showing the row's upload progress, or its looping sweep while indeterminate"
|
|
5677
5702
|
}
|
|
5678
5703
|
],
|
|
5679
5704
|
"cssProperties": [],
|
|
@@ -6003,11 +6028,14 @@
|
|
|
6003
6028
|
{
|
|
6004
6029
|
"fieldName": "size",
|
|
6005
6030
|
"name": "size",
|
|
6006
|
-
"description": "Icon size in pixels.",
|
|
6031
|
+
"description": "Icon size in pixels. Unset, the icon takes the size of the icon slot it\nsits in.",
|
|
6007
6032
|
"type": {
|
|
6008
6033
|
"text": "number"
|
|
6009
6034
|
},
|
|
6010
|
-
"default": "24"
|
|
6035
|
+
"default": "24",
|
|
6036
|
+
"csc": {
|
|
6037
|
+
"unsetUntilSet": true
|
|
6038
|
+
}
|
|
6011
6039
|
}
|
|
6012
6040
|
],
|
|
6013
6041
|
"cssParts": [
|
|
@@ -6049,11 +6077,14 @@
|
|
|
6049
6077
|
"kind": "field",
|
|
6050
6078
|
"name": "size",
|
|
6051
6079
|
"privacy": "public",
|
|
6052
|
-
"description": "Icon size in pixels.",
|
|
6080
|
+
"description": "Icon size in pixels. Unset, the icon takes the size of the icon slot it\nsits in.",
|
|
6053
6081
|
"type": {
|
|
6054
6082
|
"text": "number"
|
|
6055
6083
|
},
|
|
6056
|
-
"default": "24"
|
|
6084
|
+
"default": "24",
|
|
6085
|
+
"csc": {
|
|
6086
|
+
"unsetUntilSet": true
|
|
6087
|
+
}
|
|
6057
6088
|
}
|
|
6058
6089
|
],
|
|
6059
6090
|
"slots": []
|
|
@@ -10055,7 +10086,7 @@
|
|
|
10055
10086
|
{
|
|
10056
10087
|
"fieldName": "hideDetails",
|
|
10057
10088
|
"name": "hide-details",
|
|
10058
|
-
"description": "Hides the details line (the percentage and `label`); `label` still\nnames the bar.",
|
|
10089
|
+
"description": "Hides the details line (the percentage and `label`); `label` still\nnames the progress bar.",
|
|
10059
10090
|
"type": {
|
|
10060
10091
|
"text": "boolean"
|
|
10061
10092
|
},
|
|
@@ -10064,7 +10095,7 @@
|
|
|
10064
10095
|
{
|
|
10065
10096
|
"fieldName": "indeterminate",
|
|
10066
10097
|
"name": "indeterminate",
|
|
10067
|
-
"description": "
|
|
10098
|
+
"description": "Turns the bar into a looping sweep for work of unknown duration,\nhiding the details line and exposing no value.",
|
|
10068
10099
|
"type": {
|
|
10069
10100
|
"text": "boolean"
|
|
10070
10101
|
},
|
|
@@ -10085,7 +10116,7 @@
|
|
|
10085
10116
|
{
|
|
10086
10117
|
"fieldName": "singleLine",
|
|
10087
10118
|
"name": "single-line",
|
|
10088
|
-
"description": "Places the details line beside the
|
|
10119
|
+
"description": "Places the details line beside the progress track instead of below it.",
|
|
10089
10120
|
"type": {
|
|
10090
10121
|
"text": "boolean"
|
|
10091
10122
|
},
|
|
@@ -10094,7 +10125,7 @@
|
|
|
10094
10125
|
{
|
|
10095
10126
|
"fieldName": "value",
|
|
10096
10127
|
"name": "value",
|
|
10097
|
-
"description": "Completion percentage, 0 to 100. The
|
|
10128
|
+
"description": "Completion percentage, 0 to 100. The bar clamps a value outside that\nrange; the details line shows it as given, a negative one in the error\ncolour.",
|
|
10098
10129
|
"type": {
|
|
10099
10130
|
"text": "number"
|
|
10100
10131
|
},
|
|
@@ -10104,11 +10135,15 @@
|
|
|
10104
10135
|
"cssParts": [
|
|
10105
10136
|
{
|
|
10106
10137
|
"name": "root",
|
|
10107
|
-
"description": "The outer flex wrapper around the
|
|
10138
|
+
"description": "The outer flex wrapper around the progress track and the details line"
|
|
10139
|
+
},
|
|
10140
|
+
{
|
|
10141
|
+
"name": "track",
|
|
10142
|
+
"description": "The progress track: the ground the bar grows along, carrying the progressbar role. Its padding is the frame around the bar"
|
|
10108
10143
|
},
|
|
10109
10144
|
{
|
|
10110
10145
|
"name": "bar",
|
|
10111
|
-
"description": "The
|
|
10146
|
+
"description": "The bar showing the value: the fill, or the looping sweep while indeterminate"
|
|
10112
10147
|
},
|
|
10113
10148
|
{
|
|
10114
10149
|
"name": "details",
|
|
@@ -10123,7 +10158,7 @@
|
|
|
10123
10158
|
"kind": "field",
|
|
10124
10159
|
"name": "hideDetails",
|
|
10125
10160
|
"privacy": "public",
|
|
10126
|
-
"description": "Hides the details line (the percentage and `label`); `label` still\nnames the bar.",
|
|
10161
|
+
"description": "Hides the details line (the percentage and `label`); `label` still\nnames the progress bar.",
|
|
10127
10162
|
"type": {
|
|
10128
10163
|
"text": "boolean"
|
|
10129
10164
|
},
|
|
@@ -10133,7 +10168,7 @@
|
|
|
10133
10168
|
"kind": "field",
|
|
10134
10169
|
"name": "indeterminate",
|
|
10135
10170
|
"privacy": "public",
|
|
10136
|
-
"description": "
|
|
10171
|
+
"description": "Turns the bar into a looping sweep for work of unknown duration,\nhiding the details line and exposing no value.",
|
|
10137
10172
|
"type": {
|
|
10138
10173
|
"text": "boolean"
|
|
10139
10174
|
},
|
|
@@ -10156,7 +10191,7 @@
|
|
|
10156
10191
|
"kind": "field",
|
|
10157
10192
|
"name": "singleLine",
|
|
10158
10193
|
"privacy": "public",
|
|
10159
|
-
"description": "Places the details line beside the
|
|
10194
|
+
"description": "Places the details line beside the progress track instead of below it.",
|
|
10160
10195
|
"type": {
|
|
10161
10196
|
"text": "boolean"
|
|
10162
10197
|
},
|
|
@@ -10166,7 +10201,7 @@
|
|
|
10166
10201
|
"kind": "field",
|
|
10167
10202
|
"name": "value",
|
|
10168
10203
|
"privacy": "public",
|
|
10169
|
-
"description": "Completion percentage, 0 to 100. The
|
|
10204
|
+
"description": "Completion percentage, 0 to 100. The bar clamps a value outside that\nrange; the details line shows it as given, a negative one in the error\ncolour.",
|
|
10170
10205
|
"type": {
|
|
10171
10206
|
"text": "number"
|
|
10172
10207
|
},
|
|
@@ -12307,6 +12342,45 @@
|
|
|
12307
12342
|
"usage": "docs/c-status/usage.md"
|
|
12308
12343
|
},
|
|
12309
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
|
+
},
|
|
12310
12384
|
{
|
|
12311
12385
|
"fieldName": "type",
|
|
12312
12386
|
"name": "type",
|
|
@@ -12322,13 +12396,59 @@
|
|
|
12322
12396
|
"cssParts": [
|
|
12323
12397
|
{
|
|
12324
12398
|
"name": "root",
|
|
12325
|
-
"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"
|
|
12326
12404
|
}
|
|
12327
12405
|
],
|
|
12328
12406
|
"cssProperties": [],
|
|
12329
12407
|
"cssStates": [],
|
|
12330
12408
|
"events": [],
|
|
12331
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
|
+
},
|
|
12332
12452
|
{
|
|
12333
12453
|
"kind": "field",
|
|
12334
12454
|
"name": "type",
|
|
@@ -12346,6 +12466,10 @@
|
|
|
12346
12466
|
{
|
|
12347
12467
|
"name": "default",
|
|
12348
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"
|
|
12349
12473
|
}
|
|
12350
12474
|
]
|
|
12351
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.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
A horizontal progress bar that fills a track to a known completion percentage, with an optional details line showing the value and a label.
|
|
2
2
|
|
|
3
|
-
Bind the completion percentage to `value` (0–100; out-of-range values are clamped for the
|
|
3
|
+
Bind the completion percentage to `value` (0–100; out-of-range values are clamped for the bar). By default a details line renders below the progress track — the percentage plus whatever the `label` prop supplies (e.g. "57 % Uploading files"). Hide it with `hide-details`, or place it beside the track with `single-line`.
|
|
4
4
|
|
|
5
|
-
For work of unknown duration the `indeterminate` prop
|
|
5
|
+
For work of unknown duration the `indeterminate` prop turns the bar into a looping sweep and hides the details line.
|
|
6
6
|
|
|
7
7
|
## When to use
|
|
8
8
|
|
|
@@ -12,12 +12,31 @@ For work of unknown duration the `indeterminate` prop replaces the fill with a l
|
|
|
12
12
|
|
|
13
13
|
## Details line
|
|
14
14
|
|
|
15
|
-
The details line shows the raw `value` even when the
|
|
15
|
+
The details line shows the raw `value` even when the bar clamps it, and a negative value renders the line in the error role — a hook for signalling a failed transfer while keeping the bar itself empty.
|
|
16
16
|
|
|
17
17
|
## Accessibility
|
|
18
18
|
|
|
19
|
-
The
|
|
19
|
+
The progress track is the element with `role="progressbar"`, exposing `aria-valuenow` (0 to 100) while determinate; in indeterminate mode no value is exposed. The host mirrors `aria-busy` (true while indeterminate) and a `title` tooltip with the current percentage. The progress bar is named by `label`, or, where a visible label would be redundant (a table cell), by an `aria-label` on the element. Name every progress bar.
|
|
20
20
|
|
|
21
21
|
## Customization
|
|
22
22
|
|
|
23
|
-
Restyle via the parts:
|
|
23
|
+
Restyle via the parts:
|
|
24
|
+
|
|
25
|
+
- `::part(track)`: the progress track the bar grows along. Its `background-color` is the track's colour, its `height` the bar's thickness plus the frame, and its `padding` the frame around the bar.
|
|
26
|
+
- `::part(bar)`: the bar showing the value, also the indeterminate sweep. Its `background-color` is the bar's colour.
|
|
27
|
+
- `::part(root)`: the wrapper around the track and the details line.
|
|
28
|
+
- `::part(details)`: the percentage and label line.
|
|
29
|
+
|
|
30
|
+
By default the bar paints the primary role on a muted track. In a forced-colors mode (Windows High Contrast) the bar paints the system highlight colour whatever its `::part()` colour.
|
|
31
|
+
|
|
32
|
+
```css
|
|
33
|
+
c-progress-bar.quota::part(track) {
|
|
34
|
+
background-color: var(--c-surface-sunken);
|
|
35
|
+
height: 12px;
|
|
36
|
+
padding: 2px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
c-progress-bar.quota::part(bar) {
|
|
40
|
+
background-color: var(--c-warning);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
@@ -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
|
```
|
|
@@ -479,7 +479,11 @@
|
|
|
479
479
|
{ "name": "::part(rejected)", "description": "One rejected file's row" },
|
|
480
480
|
{
|
|
481
481
|
"name": "::part(progress)",
|
|
482
|
-
"description": "The progress
|
|
482
|
+
"description": "The progress track along an uploading row's bottom edge"
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"name": "::part(progress-bar)",
|
|
486
|
+
"description": "The bar inside it showing the row's upload progress, or its looping sweep while indeterminate"
|
|
483
487
|
},
|
|
484
488
|
{
|
|
485
489
|
"name": "::part(root)",
|
|
@@ -693,11 +697,15 @@
|
|
|
693
697
|
},
|
|
694
698
|
{
|
|
695
699
|
"name": "::part(root)",
|
|
696
|
-
"description": "The outer flex wrapper around the
|
|
700
|
+
"description": "The outer flex wrapper around the progress track and the details line"
|
|
701
|
+
},
|
|
702
|
+
{
|
|
703
|
+
"name": "::part(track)",
|
|
704
|
+
"description": "The progress track: the ground the bar grows along, carrying the progressbar role. Its padding is the frame around the bar"
|
|
697
705
|
},
|
|
698
706
|
{
|
|
699
707
|
"name": "::part(bar)",
|
|
700
|
-
"description": "The
|
|
708
|
+
"description": "The bar showing the value: the fill, or the looping sweep while indeterminate"
|
|
701
709
|
},
|
|
702
710
|
{
|
|
703
711
|
"name": "::part(details)",
|
|
@@ -847,7 +855,11 @@
|
|
|
847
855
|
},
|
|
848
856
|
{
|
|
849
857
|
"name": "::part(root)",
|
|
850
|
-
"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"
|
|
851
863
|
},
|
|
852
864
|
{
|
|
853
865
|
"name": "::part(root)",
|