@cscfi/csc-ui 4.0.0-alpha.5 → 4.0.0-alpha.6
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 +3776 -3704
- package/dist/custom-elements.json +153 -7
- package/dist/docs/c-alert/usage.md +24 -0
- package/dist/docs/c-checkbox/usage.md +50 -0
- package/dist/docs/c-radio/usage.md +17 -0
- package/dist/docs/c-switch/usage.md +36 -0
- package/dist/docs/c-table/usage.md +14 -0
- package/dist/styles/css/tailwind-theme.css +1 -0
- package/dist/styles/css/tokens.css +3 -0
- package/dist/vscode.css-custom-data.json +11 -3
- package/dist/vscode.html-custom-data.json +10 -5
- package/dist/web-types.json +37 -11
- package/dist-types/components/c-alert/CAlert.vue.d.ts +8 -1
- package/dist-types/components/c-radio/CRadio.vue.d.ts +7 -1
- package/dist-types/components/c-table/CTable.vue.d.ts +11 -1
- package/dist-types/components/c-table/injectTableStyles.d.ts +1 -0
- package/dist-types/shared/useHostStates.d.ts +25 -0
- package/dist-types/tag-name-map.d.ts +10 -1
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
A persistent, in-flow status message: a tinted box whose type carries a status family's colours through the icon, heading and accent edge, while the body copy stays neutral.
|
|
2
|
+
|
|
3
|
+
Give the alert a `heading` with the prop for plain text; the `heading` slot overrides the prop when rich content (links, emphasis) is needed. The message goes in the default slot.
|
|
4
|
+
|
|
5
|
+
## When to use
|
|
6
|
+
|
|
7
|
+
- Persistent status that belongs to the page or a section: a maintenance notice, a failed validation summary, a quota warning.
|
|
8
|
+
- Not for transient feedback on an action — use `c-toasts`, which overlays and dismisses itself; the alert stays in the layout until the consumer removes it.
|
|
9
|
+
|
|
10
|
+
## Types
|
|
11
|
+
|
|
12
|
+
The four status types (`error`, `info`, `success`, `warning`) carry their status family's colours and icon; `default` — equivalently, omitting the attribute — renders the brand-primary look. Severity is signalled by the icon, the heading's ink and the accent edge, never by colouring the body text.
|
|
13
|
+
|
|
14
|
+
## Dismissal
|
|
15
|
+
|
|
16
|
+
`dismissible` renders a dismiss button, but pressing it only emits the `dismiss` event — removing the alert from the page stays the consumer's job.
|
|
17
|
+
|
|
18
|
+
## Accessibility
|
|
19
|
+
|
|
20
|
+
The alert manages its own live-region role: `warning` and `error` interrupt (`role="alert"`), while the other types announce politely (`role="status"`). Content that is present at page load is not announced — live regions only announce changes.
|
|
21
|
+
|
|
22
|
+
## Customization
|
|
23
|
+
|
|
24
|
+
Structural styling via `::part(root)`, `::part(icon)`, `::part(content)`, `::part(heading)` and `::part(dismiss)`. Colours come from the status-family semantic tokens; override the tokens to re-theme.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
A form control for a single on/off choice: a native checkbox with a label,
|
|
2
|
+
an optional hint, and validation messaging.
|
|
3
|
+
|
|
4
|
+
Bind the state with a plain `v-model` (or the `checked` prop); `true-value` /
|
|
5
|
+
`false-value` map the checked state onto custom values. Set `indeterminate`
|
|
6
|
+
for the mixed "some but not all" state of a parent checkbox.
|
|
7
|
+
|
|
8
|
+
```html
|
|
9
|
+
<c-checkbox v-model="accepted" label="I accept the terms" />
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Set `hint` for a persistent helper line below the control; while `valid` is
|
|
13
|
+
`false`, `error-message` replaces it. `hide-details` removes the message area
|
|
14
|
+
entirely.
|
|
15
|
+
|
|
16
|
+
## When to use
|
|
17
|
+
|
|
18
|
+
- A single independent yes/no choice (consent, feature toggle in a form).
|
|
19
|
+
- A list where several options can be selected at once.
|
|
20
|
+
|
|
21
|
+
## When not to use
|
|
22
|
+
|
|
23
|
+
- Choosing exactly one of several options — use `c-radio-group`.
|
|
24
|
+
- Switching a setting that takes effect immediately — use `c-switch`.
|
|
25
|
+
|
|
26
|
+
## Customization
|
|
27
|
+
|
|
28
|
+
Restyle via CSS parts from your own stylesheet. The `indicator` part is the
|
|
29
|
+
checkbox box and `mark` is the check glyph inside it; the host exposes the
|
|
30
|
+
`checked` and `indeterminate` custom states, so the box is stylable per
|
|
31
|
+
state:
|
|
32
|
+
|
|
33
|
+
```css
|
|
34
|
+
c-checkbox:state(checked)::part(indicator) {
|
|
35
|
+
background: var(--my-green);
|
|
36
|
+
border-color: var(--my-green);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
c-checkbox:not(:state(checked))::part(indicator) {
|
|
40
|
+
border-color: gray;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* The mark draws with currentColor — recolour it via `color`. */
|
|
44
|
+
c-checkbox:state(checked)::part(mark) {
|
|
45
|
+
color: black;
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
For app-wide recolouring prefer the design tokens (`--c-primary` seed) over
|
|
50
|
+
per-component rules.
|
|
@@ -25,3 +25,20 @@ Outside a group a radio still renders and operates — it can be selected but
|
|
|
25
25
|
never unselected, like a native radio without siblings. Grouping behavior
|
|
26
26
|
(exclusivity, arrow-key navigation, form value) requires the parent
|
|
27
27
|
`c-radio-group`.
|
|
28
|
+
|
|
29
|
+
## Customization
|
|
30
|
+
|
|
31
|
+
Restyle via CSS parts from your own stylesheet. The `indicator` part is the
|
|
32
|
+
radio ring; the selection dot is its `::after` pseudo-element. Ring and dot
|
|
33
|
+
both draw with `currentColor`, so `color` recolours the whole indicator. The
|
|
34
|
+
host exposes the `checked` and `disabled` custom states (both also cover
|
|
35
|
+
group-driven selection and disabling):
|
|
36
|
+
|
|
37
|
+
```css
|
|
38
|
+
c-radio:state(checked)::part(indicator) {
|
|
39
|
+
color: var(--my-green);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
For app-wide recolouring prefer the design tokens (`--c-primary` seed) over
|
|
44
|
+
per-component rules.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
A toggle for a binary setting that takes effect immediately: a native
|
|
2
|
+
switch control with a label, an optional hint, and validation messaging.
|
|
3
|
+
|
|
4
|
+
Bind the state with a plain `v-model` (or the `checked` prop); `true-value` /
|
|
5
|
+
`false-value` map the on/off state onto custom values.
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<c-switch v-model="notifications">Email notifications</c-switch>
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## When to use
|
|
12
|
+
|
|
13
|
+
- Turning a setting or mode on/off with immediate effect (no submit step).
|
|
14
|
+
|
|
15
|
+
## When not to use
|
|
16
|
+
|
|
17
|
+
- A choice that is collected and submitted with a form — use `c-checkbox`.
|
|
18
|
+
|
|
19
|
+
## Customization
|
|
20
|
+
|
|
21
|
+
Restyle via CSS parts from your own stylesheet. The `slider` part is the
|
|
22
|
+
toggle track (its `::before` pseudo-element is the handle); the host exposes
|
|
23
|
+
the `checked` custom state, so the track is stylable per state:
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
c-switch:state(checked)::part(slider) {
|
|
27
|
+
background: var(--my-green);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
c-switch:state(checked)::part(slider)::before {
|
|
31
|
+
background: white;
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
For app-wide recolouring prefer the design tokens (`--c-primary` seed) over
|
|
36
|
+
per-component rules.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
A styled wrapper for a table you author yourself: slot in a plain `<table>` and c-table gives it the CSC look plus an optional responsive card layout on narrow screens. The table stays in your own DOM — your stylesheets, your framework's rendering, and `::part()` selectors on components nested in cells (a `c-tag` status chip, a `c-pagination` footer) all keep working.
|
|
2
|
+
|
|
3
|
+
Write regular, semantic table markup: `<thead>` with `<th>` headers, `<tbody>` rows, optionally a `<tfoot>`. c-table styles it through a scoped stylesheet it installs once per page; it never takes the markup over, so rows added or removed by your framework are picked up automatically.
|
|
4
|
+
|
|
5
|
+
## Responsive mode
|
|
6
|
+
|
|
7
|
+
With `responsive`, the table collapses into stacked cards when it is narrower than `mobile-breakpoint` (pixels, default 600). Each cell then shows a label cloned from its column header so the card stays readable without the header row.
|
|
8
|
+
|
|
9
|
+
- Rows that should not receive labels (a full-width action row, a `colspan` summary) opt out with a `no-mobile-labels` attribute on the `<tr>`.
|
|
10
|
+
- The labels are real `<span class="c-table__mobile-label">` elements prepended into your cells, so your framework will see them. Label creation is idempotent, but if a keyed re-render replaces the cell elements, call the element's `updateMobileLabels()` method afterwards to restore them.
|
|
11
|
+
|
|
12
|
+
## Styling
|
|
13
|
+
|
|
14
|
+
Cell content is yours to style: page CSS reaches everything inside the table, including `::part()` on nested components. The table's own defaults are applied at `c-table > table.c-table …` specificity — to override one of them (say, cell padding), match that scope: `c-table table.c-table td { padding: 8px; }`.
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
--color-on-surface-sunken: var(--c-on-surface-sunken);
|
|
36
36
|
--color-border: var(--c-border);
|
|
37
37
|
--color-border-strong: var(--c-border-strong);
|
|
38
|
+
--color-divider: var(--c-divider);
|
|
38
39
|
--color-ring: var(--c-ring);
|
|
39
40
|
|
|
40
41
|
/* Inverted-surface tier (ADR-0032): mode-aware contrast flip — not the
|
|
@@ -158,6 +158,7 @@
|
|
|
158
158
|
--c-on-surface-sunken: var(--c-primary-700);
|
|
159
159
|
--c-border: var(--c-tertiary-200);
|
|
160
160
|
--c-border-strong: var(--c-tertiary-600);
|
|
161
|
+
--c-divider: color-mix(in srgb, var(--c-black) 12%, transparent);
|
|
161
162
|
--c-ring: var(--c-primary-500);
|
|
162
163
|
--c-surface-inverted: var(--c-slate-950);
|
|
163
164
|
--c-on-surface-inverted: var(--c-white);
|
|
@@ -252,6 +253,7 @@
|
|
|
252
253
|
--c-on-surface-sunken: var(--c-slate-100);
|
|
253
254
|
--c-border: var(--c-slate-700);
|
|
254
255
|
--c-border-strong: var(--c-slate-400);
|
|
256
|
+
--c-divider: color-mix(in srgb, var(--c-white) 12%, transparent);
|
|
255
257
|
--c-ring: var(--c-primary-300);
|
|
256
258
|
--c-surface-inverted: var(--c-white);
|
|
257
259
|
--c-on-surface-inverted: var(--c-slate-900);
|
|
@@ -347,6 +349,7 @@
|
|
|
347
349
|
--c-on-surface-sunken: var(--c-slate-100);
|
|
348
350
|
--c-border: var(--c-slate-700);
|
|
349
351
|
--c-border-strong: var(--c-slate-400);
|
|
352
|
+
--c-divider: color-mix(in srgb, var(--c-white) 12%, transparent);
|
|
350
353
|
--c-ring: var(--c-primary-300);
|
|
351
354
|
--c-surface-inverted: var(--c-white);
|
|
352
355
|
--c-on-surface-inverted: var(--c-slate-900);
|
|
@@ -36,7 +36,11 @@
|
|
|
36
36
|
{ "name": "::part(icon)", "description": "The status icon svg" },
|
|
37
37
|
{
|
|
38
38
|
"name": "::part(content)",
|
|
39
|
-
"description": "The wrapper around the
|
|
39
|
+
"description": "The wrapper around the heading and message content"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"name": "::part(heading)",
|
|
43
|
+
"description": "The heading paragraph rendered from the `heading` prop"
|
|
40
44
|
},
|
|
41
45
|
{
|
|
42
46
|
"name": "::part(dismiss)",
|
|
@@ -133,7 +137,11 @@
|
|
|
133
137
|
},
|
|
134
138
|
{
|
|
135
139
|
"name": "::part(indicator)",
|
|
136
|
-
"description": "The
|
|
140
|
+
"description": "The checkbox box itself — the bordered square that fills when checked"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "::part(mark)",
|
|
144
|
+
"description": "The SVG check / indeterminate glyph revealed inside the indicator; draws with `currentColor`, so `color` recolours it"
|
|
137
145
|
},
|
|
138
146
|
{
|
|
139
147
|
"name": "::part(content)",
|
|
@@ -437,7 +445,7 @@
|
|
|
437
445
|
},
|
|
438
446
|
{
|
|
439
447
|
"name": "::part(indicator)",
|
|
440
|
-
"description": "The
|
|
448
|
+
"description": "The radio ring itself; the selection dot is its `::after` — both follow `currentColor`, so `color` recolours the whole indicator"
|
|
441
449
|
},
|
|
442
450
|
{
|
|
443
451
|
"name": "::part(content)",
|
|
@@ -58,13 +58,18 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"name": "c-alert",
|
|
61
|
-
"description": "
|
|
61
|
+
"description": "A persistent, in-flow status message: a tinted box whose type carries a status family's colours through the icon, heading and accent edge, while the body copy stays neutral.\n---\n\n\n### **Events:**\n - **dismiss** - Fired when the dismiss button is pressed. The alert does not hide\nitself — the consumer owns removal.\n\n### **Slots:**\n - **heading** - Rich heading content; overrides the `heading` prop\n- **default** - Default slot\n\n### **CSS Parts:**\n - **root** - The tinted box carrying the type's wash, hairline border and accent edge\n- **icon** - The status icon svg\n- **content** - The wrapper around the heading and message content\n- **heading** - The heading paragraph rendered from the `heading` prop\n- **dismiss** - The dismiss button rendered when `dismissible` is set",
|
|
62
62
|
"attributes": [
|
|
63
63
|
{
|
|
64
64
|
"name": "dismissible",
|
|
65
65
|
"description": "Show a dismiss button. The alert only emits `dismiss` — removing it from\nthe page stays the consumer's job.",
|
|
66
66
|
"values": []
|
|
67
67
|
},
|
|
68
|
+
{
|
|
69
|
+
"name": "heading",
|
|
70
|
+
"description": "Heading rendered above the message. The `heading` slot overrides it for\nrich content.",
|
|
71
|
+
"values": []
|
|
72
|
+
},
|
|
68
73
|
{
|
|
69
74
|
"name": "type",
|
|
70
75
|
"description": "Type of the alert",
|
|
@@ -355,7 +360,7 @@
|
|
|
355
360
|
},
|
|
356
361
|
{
|
|
357
362
|
"name": "c-checkbox",
|
|
358
|
-
"description": "
|
|
363
|
+
"description": "A form control for a single on/off choice: a native checkbox with a label, an optional hint, and validation messaging.\n---\n\n\n### **Events:**\n - **change** - Standard bubbling DOM change event, re-dispatched from the host when the\ncheckbox is toggled (the inner input's change does not cross the shadow\nboundary). No detail; read the new value from the host's `value` property.\n- **changeValue** - Fired when the checkbox is toggled, carrying the new value —\n`trueValue` when checked, `falseValue` when unchecked. Also dispatched as `change-value` — bind that name in Vue templates.\n- **input** - Native bubbling input event fired on toggle so a plain Vue `v-model`\nworks without the `v-control` directive. No detail.\n- **update:value** - v-model contract event fired on toggle, carrying the new value —\n`trueValue` when checked, `falseValue` when unchecked.\n\n### **Slots:**\n - **default** - Default slot for the label\n\n### **CSS Parts:**\n - **root** - The outer wrapper containing the checkbox, label and message\n- **label** - The `<label>` element wrapping the indicator and the label content\n- **indicator** - The checkbox box itself — the bordered square that fills when checked\n- **mark** - The SVG check / indeterminate glyph revealed inside the indicator; draws with `currentColor`, so `color` recolours it\n- **content** - Wrapper around the label text or slotted label content\n- **message** - The hint / error message area below the checkbox (always reserved unless `hide-details`)",
|
|
359
364
|
"attributes": [
|
|
360
365
|
{
|
|
361
366
|
"name": "checked",
|
|
@@ -1264,7 +1269,7 @@
|
|
|
1264
1269
|
},
|
|
1265
1270
|
{
|
|
1266
1271
|
"name": "c-radio",
|
|
1267
|
-
"description": "A single radio option inside a `c-radio-group`: a native radio input whose default slot is its clickable, announced label.\n---\n\n\n### **Events:**\n - **change** - Fired when the radio is selected by the user, carrying its `value`.\nBubbles composed so the parent `<c-radio-group>` — whose shadow root a\nlight-DOM event never enters — catches it on its host; a consumer\nlistening on the group hears it too, with the radio as `target`.\n\n### **Slots:**\n - **default** - The radio's label content, rendered inside the shadow `<label>` so it stays click-associated and announced\n\n### **CSS Parts:**\n - **root** - The `<label>` row wrapping the input, indicator and label content\n- **indicator** - The
|
|
1272
|
+
"description": "A single radio option inside a `c-radio-group`: a native radio input whose default slot is its clickable, announced label.\n---\n\n\n### **Events:**\n - **change** - Fired when the radio is selected by the user, carrying its `value`.\nBubbles composed so the parent `<c-radio-group>` — whose shadow root a\nlight-DOM event never enters — catches it on its host; a consumer\nlistening on the group hears it too, with the radio as `target`.\n\n### **Slots:**\n - **default** - The radio's label content, rendered inside the shadow `<label>` so it stays click-associated and announced\n\n### **CSS Parts:**\n - **root** - The `<label>` row wrapping the input, indicator and label content\n- **indicator** - The radio ring itself; the selection dot is its `::after` — both follow `currentColor`, so `color` recolours the whole indicator\n- **content** - Wrapper around the slotted label content",
|
|
1268
1273
|
"attributes": [
|
|
1269
1274
|
{
|
|
1270
1275
|
"name": "disabled",
|
|
@@ -1563,7 +1568,7 @@
|
|
|
1563
1568
|
},
|
|
1564
1569
|
{
|
|
1565
1570
|
"name": "c-switch",
|
|
1566
|
-
"description": "
|
|
1571
|
+
"description": "A toggle for a binary setting that takes effect immediately: a native switch control with a label, an optional hint, and validation messaging.\n---\n\n\n### **Events:**\n - **change** - Standard bubbling DOM change event, re-dispatched from the host when the\nswitch is toggled (the inner input's change does not cross the shadow\nboundary). No detail; read the new value from the host's `value` property.\n- **changeValue** - Fired when the switch is toggled, carrying the new value —\n`trueValue` when on, `falseValue` when off. Also dispatched as `change-value` — bind that name in Vue templates.\n- **input** - Native bubbling input event fired on toggle so a plain Vue `v-model`\nworks without the `v-control` directive. No detail.\n- **update:value** - v-model contract event fired on toggle, carrying the new value —\n`trueValue` when on, `falseValue` when off.\n\n### **Slots:**\n - **default** - The visible label of the switch (fallback when the `label` prop is not set)\n\n### **CSS Parts:**\n - **root** - The `<label>` element wrapping the toggle and the label text\n- **slider** - The toggle track (its `::before` pseudo-element is the handle)\n- **label** - Wrapper around the label text or slotted label content",
|
|
1567
1572
|
"attributes": [
|
|
1568
1573
|
{
|
|
1569
1574
|
"name": "checked",
|
|
@@ -1676,7 +1681,7 @@
|
|
|
1676
1681
|
},
|
|
1677
1682
|
{
|
|
1678
1683
|
"name": "c-table",
|
|
1679
|
-
"description": "
|
|
1684
|
+
"description": "A styled wrapper for a table you author yourself: slot in a plain `<table>` and c-table gives it the CSC look plus an optional responsive card layout on narrow screens. The table stays in your own DOM — your stylesheets, your framework's rendering, and `::part()` selectors on components nested in cells (a `c-tag` status chip, a `c-pagination` footer) all keep working.\n---\n\n\n### **Slots:**\n - **default** - The consumer-authored `<table>` element",
|
|
1680
1685
|
"attributes": [
|
|
1681
1686
|
{
|
|
1682
1687
|
"name": "mobile-breakpoint",
|
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-alpha.
|
|
4
|
+
"version": "4.0.0-alpha.6",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
},
|
|
188
188
|
{
|
|
189
189
|
"name": "c-alert",
|
|
190
|
-
"description": "
|
|
190
|
+
"description": "A persistent, in-flow status message: a tinted box whose type carries a status family's colours through the icon, heading and accent edge, while the body copy stays neutral.\n---\n\n\n### **Events:**\n - **dismiss** - Fired when the dismiss button is pressed. The alert does not hide\nitself — the consumer owns removal.\n\n### **Slots:**\n - **heading** - Rich heading content; overrides the `heading` prop\n- **default** - Default slot\n\n### **CSS Parts:**\n - **root** - The tinted box carrying the type's wash, hairline border and accent edge\n- **icon** - The status icon svg\n- **content** - The wrapper around the heading and message content\n- **heading** - The heading paragraph rendered from the `heading` prop\n- **dismiss** - The dismiss button rendered when `dismissible` is set",
|
|
191
191
|
"doc-url": "",
|
|
192
192
|
"attributes": [
|
|
193
193
|
{
|
|
@@ -195,6 +195,11 @@
|
|
|
195
195
|
"description": "Show a dismiss button. The alert only emits `dismiss` — removing it from\nthe page stays the consumer's job.",
|
|
196
196
|
"value": { "type": "boolean", "default": "false" }
|
|
197
197
|
},
|
|
198
|
+
{
|
|
199
|
+
"name": "heading",
|
|
200
|
+
"description": "Heading rendered above the message. The `heading` slot overrides it for\nrich content.",
|
|
201
|
+
"value": { "type": "string" }
|
|
202
|
+
},
|
|
198
203
|
{
|
|
199
204
|
"name": "type",
|
|
200
205
|
"description": "Type of the alert",
|
|
@@ -205,7 +210,10 @@
|
|
|
205
210
|
}
|
|
206
211
|
],
|
|
207
212
|
"slots": [
|
|
208
|
-
{
|
|
213
|
+
{
|
|
214
|
+
"name": "heading",
|
|
215
|
+
"description": "Rich heading content; overrides the `heading` prop"
|
|
216
|
+
},
|
|
209
217
|
{ "name": "default", "description": "Default slot" }
|
|
210
218
|
],
|
|
211
219
|
"events": [
|
|
@@ -222,6 +230,11 @@
|
|
|
222
230
|
"description": "Show a dismiss button. The alert only emits `dismiss` — removing it from\nthe page stays the consumer's job.",
|
|
223
231
|
"type": "boolean"
|
|
224
232
|
},
|
|
233
|
+
{
|
|
234
|
+
"name": "heading",
|
|
235
|
+
"description": "Heading rendered above the message. The `heading` slot overrides it for\nrich content.",
|
|
236
|
+
"type": "string"
|
|
237
|
+
},
|
|
225
238
|
{
|
|
226
239
|
"name": "type",
|
|
227
240
|
"description": "Type of the alert",
|
|
@@ -949,7 +962,7 @@
|
|
|
949
962
|
},
|
|
950
963
|
{
|
|
951
964
|
"name": "c-checkbox",
|
|
952
|
-
"description": "
|
|
965
|
+
"description": "A form control for a single on/off choice: a native checkbox with a label, an optional hint, and validation messaging.\n---\n\n\n### **Events:**\n - **change** - Standard bubbling DOM change event, re-dispatched from the host when the\ncheckbox is toggled (the inner input's change does not cross the shadow\nboundary). No detail; read the new value from the host's `value` property.\n- **changeValue** - Fired when the checkbox is toggled, carrying the new value —\n`trueValue` when checked, `falseValue` when unchecked. Also dispatched as `change-value` — bind that name in Vue templates.\n- **input** - Native bubbling input event fired on toggle so a plain Vue `v-model`\nworks without the `v-control` directive. No detail.\n- **update:value** - v-model contract event fired on toggle, carrying the new value —\n`trueValue` when checked, `falseValue` when unchecked.\n\n### **Slots:**\n - **default** - Default slot for the label\n\n### **CSS Parts:**\n - **root** - The outer wrapper containing the checkbox, label and message\n- **label** - The `<label>` element wrapping the indicator and the label content\n- **indicator** - The checkbox box itself — the bordered square that fills when checked\n- **mark** - The SVG check / indeterminate glyph revealed inside the indicator; draws with `currentColor`, so `color` recolours it\n- **content** - Wrapper around the label text or slotted label content\n- **message** - The hint / error message area below the checkbox (always reserved unless `hide-details`)",
|
|
953
966
|
"doc-url": "",
|
|
954
967
|
"attributes": [
|
|
955
968
|
{
|
|
@@ -3266,7 +3279,7 @@
|
|
|
3266
3279
|
},
|
|
3267
3280
|
{
|
|
3268
3281
|
"name": "c-radio",
|
|
3269
|
-
"description": "A single radio option inside a `c-radio-group`: a native radio input whose default slot is its clickable, announced label.\n---\n\n\n### **Events:**\n - **change** - Fired when the radio is selected by the user, carrying its `value`.\nBubbles composed so the parent `<c-radio-group>` — whose shadow root a\nlight-DOM event never enters — catches it on its host; a consumer\nlistening on the group hears it too, with the radio as `target`.\n\n### **Slots:**\n - **default** - The radio's label content, rendered inside the shadow `<label>` so it stays click-associated and announced\n\n### **CSS Parts:**\n - **root** - The `<label>` row wrapping the input, indicator and label content\n- **indicator** - The
|
|
3282
|
+
"description": "A single radio option inside a `c-radio-group`: a native radio input whose default slot is its clickable, announced label.\n---\n\n\n### **Events:**\n - **change** - Fired when the radio is selected by the user, carrying its `value`.\nBubbles composed so the parent `<c-radio-group>` — whose shadow root a\nlight-DOM event never enters — catches it on its host; a consumer\nlistening on the group hears it too, with the radio as `target`.\n\n### **Slots:**\n - **default** - The radio's label content, rendered inside the shadow `<label>` so it stays click-associated and announced\n\n### **CSS Parts:**\n - **root** - The `<label>` row wrapping the input, indicator and label content\n- **indicator** - The radio ring itself; the selection dot is its `::after` — both follow `currentColor`, so `color` recolours the whole indicator\n- **content** - Wrapper around the slotted label content",
|
|
3270
3283
|
"doc-url": "",
|
|
3271
3284
|
"attributes": [
|
|
3272
3285
|
{
|
|
@@ -4244,7 +4257,7 @@
|
|
|
4244
4257
|
},
|
|
4245
4258
|
{
|
|
4246
4259
|
"name": "c-switch",
|
|
4247
|
-
"description": "
|
|
4260
|
+
"description": "A toggle for a binary setting that takes effect immediately: a native switch control with a label, an optional hint, and validation messaging.\n---\n\n\n### **Events:**\n - **change** - Standard bubbling DOM change event, re-dispatched from the host when the\nswitch is toggled (the inner input's change does not cross the shadow\nboundary). No detail; read the new value from the host's `value` property.\n- **changeValue** - Fired when the switch is toggled, carrying the new value —\n`trueValue` when on, `falseValue` when off. Also dispatched as `change-value` — bind that name in Vue templates.\n- **input** - Native bubbling input event fired on toggle so a plain Vue `v-model`\nworks without the `v-control` directive. No detail.\n- **update:value** - v-model contract event fired on toggle, carrying the new value —\n`trueValue` when on, `falseValue` when off.\n\n### **Slots:**\n - **default** - The visible label of the switch (fallback when the `label` prop is not set)\n\n### **CSS Parts:**\n - **root** - The `<label>` element wrapping the toggle and the label text\n- **slider** - The toggle track (its `::before` pseudo-element is the handle)\n- **label** - Wrapper around the label text or slotted label content",
|
|
4248
4261
|
"doc-url": "",
|
|
4249
4262
|
"attributes": [
|
|
4250
4263
|
{
|
|
@@ -4637,7 +4650,7 @@
|
|
|
4637
4650
|
},
|
|
4638
4651
|
{
|
|
4639
4652
|
"name": "c-table",
|
|
4640
|
-
"description": "
|
|
4653
|
+
"description": "A styled wrapper for a table you author yourself: slot in a plain `<table>` and c-table gives it the CSC look plus an optional responsive card layout on narrow screens. The table stays in your own DOM — your stylesheets, your framework's rendering, and `::part()` selectors on components nested in cells (a `c-tag` status chip, a `c-pagination` footer) all keep working.\n---\n\n\n### **Slots:**\n - **default** - The consumer-authored `<table>` element",
|
|
4641
4654
|
"doc-url": "",
|
|
4642
4655
|
"attributes": [
|
|
4643
4656
|
{
|
|
@@ -4651,7 +4664,12 @@
|
|
|
4651
4664
|
"value": { "type": "boolean", "default": "false" }
|
|
4652
4665
|
}
|
|
4653
4666
|
],
|
|
4654
|
-
"slots": [
|
|
4667
|
+
"slots": [
|
|
4668
|
+
{
|
|
4669
|
+
"name": "default",
|
|
4670
|
+
"description": "The consumer-authored `<table>` element"
|
|
4671
|
+
}
|
|
4672
|
+
],
|
|
4655
4673
|
"events": [],
|
|
4656
4674
|
"js": {
|
|
4657
4675
|
"properties": [
|
|
@@ -5440,7 +5458,11 @@
|
|
|
5440
5458
|
{ "name": "part(icon)", "description": "The status icon svg" },
|
|
5441
5459
|
{
|
|
5442
5460
|
"name": "part(content)",
|
|
5443
|
-
"description": "The wrapper around the
|
|
5461
|
+
"description": "The wrapper around the heading and message content"
|
|
5462
|
+
},
|
|
5463
|
+
{
|
|
5464
|
+
"name": "part(heading)",
|
|
5465
|
+
"description": "The heading paragraph rendered from the `heading` prop"
|
|
5444
5466
|
},
|
|
5445
5467
|
{
|
|
5446
5468
|
"name": "part(dismiss)",
|
|
@@ -5540,7 +5562,11 @@
|
|
|
5540
5562
|
},
|
|
5541
5563
|
{
|
|
5542
5564
|
"name": "part(indicator)",
|
|
5543
|
-
"description": "The
|
|
5565
|
+
"description": "The checkbox box itself — the bordered square that fills when checked"
|
|
5566
|
+
},
|
|
5567
|
+
{
|
|
5568
|
+
"name": "part(mark)",
|
|
5569
|
+
"description": "The SVG check / indeterminate glyph revealed inside the indicator; draws with `currentColor`, so `color` recolours it"
|
|
5544
5570
|
},
|
|
5545
5571
|
{
|
|
5546
5572
|
"name": "part(content)",
|
|
@@ -5850,7 +5876,7 @@
|
|
|
5850
5876
|
},
|
|
5851
5877
|
{
|
|
5852
5878
|
"name": "part(indicator)",
|
|
5853
|
-
"description": "The
|
|
5879
|
+
"description": "The radio ring itself; the selection dot is its `::after` — both follow `currentColor`, so `color` recolours the whole indicator"
|
|
5854
5880
|
},
|
|
5855
5881
|
{
|
|
5856
5882
|
"name": "part(content)",
|
|
@@ -9,6 +9,13 @@ export interface CAlertProps {
|
|
|
9
9
|
* the page stays the consumer's job.
|
|
10
10
|
*/
|
|
11
11
|
dismissible?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Heading rendered above the message. The `heading` slot overrides it for
|
|
14
|
+
* rich content.
|
|
15
|
+
*
|
|
16
|
+
* @freeform
|
|
17
|
+
*/
|
|
18
|
+
heading?: string;
|
|
12
19
|
/**
|
|
13
20
|
* Type of the alert
|
|
14
21
|
*
|
|
@@ -28,7 +35,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CAlert
|
|
|
28
35
|
type: CAlertType;
|
|
29
36
|
dismissible: boolean;
|
|
30
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
31
|
-
|
|
38
|
+
heading?: (props: {}) => any;
|
|
32
39
|
} & {
|
|
33
40
|
default?: (props: {}) => any;
|
|
34
41
|
}>;
|
|
@@ -14,7 +14,13 @@ declare var __VLS_1: {};
|
|
|
14
14
|
type __VLS_Slots = {} & {
|
|
15
15
|
default?: (props: typeof __VLS_1) => any;
|
|
16
16
|
};
|
|
17
|
-
declare const __VLS_base: import("vue").DefineComponent<CRadioProps, {
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<CRadioProps, {
|
|
18
|
+
_syncGroupState: (state: {
|
|
19
|
+
checked: boolean;
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
tabIndex: number;
|
|
22
|
+
}) => void;
|
|
23
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CRadioProps> & Readonly<{}>, {
|
|
18
24
|
value: string;
|
|
19
25
|
disabled: boolean;
|
|
20
26
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -12,9 +12,19 @@ interface CTableProps {
|
|
|
12
12
|
*/
|
|
13
13
|
responsive?: boolean;
|
|
14
14
|
}
|
|
15
|
-
declare
|
|
15
|
+
declare var __VLS_1: {};
|
|
16
|
+
type __VLS_Slots = {} & {
|
|
17
|
+
default?: (props: typeof __VLS_1) => any;
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_base: import("vue").DefineComponent<CTableProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CTableProps> & Readonly<{}>, {
|
|
16
20
|
mobileBreakpoint: number;
|
|
17
21
|
responsive: boolean;
|
|
18
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
19
24
|
declare const _default: typeof __VLS_export;
|
|
20
25
|
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ensureTableStyles: () => void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Host custom-state exposure — the single path for publishing a component's
|
|
3
|
+
* internal state to consumer CSS as `:state(<name>)` selectors (ADR-0035).
|
|
4
|
+
*
|
|
5
|
+
* Selection controls keep their live state (checked, indeterminate, …) on a
|
|
6
|
+
* hidden `<input>` inside the shadow root, where no consumer selector can see
|
|
7
|
+
* it. `ElementInternals.states` republishes it on the host, so a consumer can
|
|
8
|
+
* write per-state `::part()` rules:
|
|
9
|
+
*
|
|
10
|
+
* c-checkbox:state(checked)::part(indicator) { background: green; }
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
*
|
|
14
|
+
* const setState = useHostStates();
|
|
15
|
+
* watch(isChecked, (on) => setState('checked', on), { immediate: true });
|
|
16
|
+
*
|
|
17
|
+
* Each exposed state name is public API — curated like parts, documented with
|
|
18
|
+
* a `@cssstate` docblock tag so it lands in the manifest.
|
|
19
|
+
*
|
|
20
|
+
* `attachInternals()` may be called only once per element; this composable
|
|
21
|
+
* owns that call. Everything degrades to a silent no-op where internals or
|
|
22
|
+
* `states` are unavailable (SSR, tests, an ancient browser) — the component
|
|
23
|
+
* still renders and behaves, only the `:state()` selector surface is absent.
|
|
24
|
+
*/
|
|
25
|
+
export declare const useHostStates: () => ((name: string, on: boolean) => void);
|
|
@@ -95,12 +95,18 @@ export interface CAlertElementEventMap {
|
|
|
95
95
|
*/
|
|
96
96
|
dismiss: CustomEvent<void>;
|
|
97
97
|
}
|
|
98
|
-
|
|
98
|
+
/** A persistent, in-flow status message: a tinted box whose type carries a status family's colours through the icon, heading and accent edge, while the body copy stays neutral. */
|
|
99
|
+
export interface CAlertElement extends Omit<HTMLElement, 'dismissible' | 'heading' | 'type'> {
|
|
99
100
|
/**
|
|
100
101
|
* Show a dismiss button. The alert only emits `dismiss` — removing it from
|
|
101
102
|
* the page stays the consumer's job.
|
|
102
103
|
*/
|
|
103
104
|
dismissible?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Heading rendered above the message. The `heading` slot overrides it for
|
|
107
|
+
* rich content.
|
|
108
|
+
*/
|
|
109
|
+
heading?: string;
|
|
104
110
|
/** Type of the alert */
|
|
105
111
|
type?: 'default' | 'error' | 'info' | 'success' | 'warning';
|
|
106
112
|
addEventListener<K extends keyof CAlertElementEventMap>(type: K, listener: (this: CAlertElement, ev: CAlertElementEventMap[K]) => void, options?: boolean | AddEventListenerOptions): void;
|
|
@@ -337,6 +343,7 @@ export interface CCheckboxElementEventMap {
|
|
|
337
343
|
*/
|
|
338
344
|
'update:value': CustomEvent<boolean | number | string>;
|
|
339
345
|
}
|
|
346
|
+
/** A form control for a single on/off choice: a native checkbox with a label, an optional hint, and validation messaging. */
|
|
340
347
|
export interface CCheckboxElement extends Omit<HTMLElement, 'checked' | 'disabled' | 'errorMessage' | 'falseValue' | 'hideDetails' | 'hint' | 'hostId' | 'hostName' | 'indeterminate' | 'label' | 'required' | 'trueValue' | 'valid' | 'value'> {
|
|
341
348
|
/** If `true`, the checkbox is selected. */
|
|
342
349
|
checked?: boolean;
|
|
@@ -1241,6 +1248,7 @@ export interface CSwitchElementEventMap {
|
|
|
1241
1248
|
*/
|
|
1242
1249
|
'update:value': CustomEvent<boolean | number | string>;
|
|
1243
1250
|
}
|
|
1251
|
+
/** A toggle for a binary setting that takes effect immediately: a native switch control with a label, an optional hint, and validation messaging. */
|
|
1244
1252
|
export interface CSwitchElement extends Omit<HTMLElement, 'checked' | 'disabled' | 'falseValue' | 'hostId' | 'label' | 'loading' | 'required' | 'trueValue' | 'value'> {
|
|
1245
1253
|
/** If `true`, the checkbox is selected. */
|
|
1246
1254
|
checked?: boolean;
|
|
@@ -1358,6 +1366,7 @@ export interface CTabItemsElement extends Omit<HTMLElement, 'disableAnimation' |
|
|
|
1358
1366
|
/** Currently active tab */
|
|
1359
1367
|
value?: number | string;
|
|
1360
1368
|
}
|
|
1369
|
+
/** A styled wrapper for a table you author yourself: slot in a plain `<table>` and c-table gives it the CSC look plus an optional responsive card layout on narrow screens. The table stays in your own DOM — your stylesheets, your framework's rendering, and `::part()` selectors on components nested in cells (a `c-tag` status chip, a `c-pagination` footer) all keep working. */
|
|
1361
1370
|
export interface CTableElement extends Omit<HTMLElement, 'mobileBreakpoint' | 'responsive'> {
|
|
1362
1371
|
/** Mobile breakpoint in pixels */
|
|
1363
1372
|
mobileBreakpoint?: number;
|
package/package.json
CHANGED