@cscfi/csc-ui 4.0.0-alpha.17 → 4.0.0-alpha.18
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 +1702 -1691
- package/dist/custom-elements.json +11 -4
- package/dist/docs/c-main/usage.md +2 -2
- package/dist/docs/c-side-navigation/usage.md +21 -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 +9 -1
- package/dist/vscode.html-custom-data.json +2 -2
- package/dist/web-types.json +19 -6
- package/dist-types/tag-name-map.d.ts +1 -0
- package/package.json +1 -1
|
@@ -6057,7 +6057,12 @@
|
|
|
6057
6057
|
"description": "The main element carrying the page canvas and the dashboard grid layout"
|
|
6058
6058
|
}
|
|
6059
6059
|
],
|
|
6060
|
-
"cssProperties": [
|
|
6060
|
+
"cssProperties": [
|
|
6061
|
+
{
|
|
6062
|
+
"name": "--c-main-viewport-height",
|
|
6063
|
+
"description": "Height of the scroll viewport the layout pins against (default `100dvh`); a bounded shell with its own scrollbar sets it to its box height"
|
|
6064
|
+
}
|
|
6065
|
+
],
|
|
6061
6066
|
"cssStates": [],
|
|
6062
6067
|
"events": [],
|
|
6063
6068
|
"members": [
|
|
@@ -9107,7 +9112,9 @@
|
|
|
9107
9112
|
"kind": "class",
|
|
9108
9113
|
"name": "CSideNavigation",
|
|
9109
9114
|
"tagName": "c-side-navigation",
|
|
9115
|
+
"description": "The dashboard layout's left-hand menu: section titles, navigation items and their sub-items in a drawer that is pinned beside the page on desktop and slides in over it on mobile.",
|
|
9110
9116
|
"csc": {
|
|
9117
|
+
"usage": "docs/c-side-navigation/usage.md",
|
|
9111
9118
|
"subcomponents": [
|
|
9112
9119
|
"c-side-navigation-item",
|
|
9113
9120
|
"c-side-navigation-title",
|
|
@@ -9137,7 +9144,7 @@
|
|
|
9137
9144
|
"cssParts": [
|
|
9138
9145
|
{
|
|
9139
9146
|
"name": "root",
|
|
9140
|
-
"description": "The outer drawer container"
|
|
9147
|
+
"description": "The outer drawer container: the item list above the bottom slot's region"
|
|
9141
9148
|
},
|
|
9142
9149
|
{
|
|
9143
9150
|
"name": "nav",
|
|
@@ -9190,11 +9197,11 @@
|
|
|
9190
9197
|
"slots": [
|
|
9191
9198
|
{
|
|
9192
9199
|
"name": "default",
|
|
9193
|
-
"description": "
|
|
9200
|
+
"description": "The navigation items: titles, items and their sub-items"
|
|
9194
9201
|
},
|
|
9195
9202
|
{
|
|
9196
9203
|
"name": "bottom",
|
|
9197
|
-
"description": "
|
|
9204
|
+
"description": "Trailing content below the items, such as a sign-out button; it stays at the drawer's bottom edge while the items scroll"
|
|
9198
9205
|
}
|
|
9199
9206
|
]
|
|
9200
9207
|
}
|
|
@@ -2,7 +2,7 @@ The page shell of an application: it paints the page canvas and lays out the too
|
|
|
2
2
|
|
|
3
3
|
## Dashboard layout
|
|
4
4
|
|
|
5
|
-
Slot the layout components as direct children and `c-main` places them: `c-toolbar` spans the top, `c-side-navigation` takes the left column and `c-page` fills the rest. The toolbar pins itself to the top of the viewport; `c-main` pins the desktop side navigation beneath it
|
|
5
|
+
Slot the layout components as direct children and `c-main` places them: `c-toolbar` spans the top, `c-side-navigation` takes the left column and `c-page` fills the rest. The toolbar pins itself to the top of the viewport; `c-main` pins the desktop side navigation beneath it and moves its pin to the top edge when the toolbar is `static`. The drawer is sized to the pinned height: a short menu fills the column, a long one scrolls inside the drawer, and the side navigation's bottom slot stays at the bottom edge of the viewport — also while a banner or a static toolbar is still above the drawer. The 3.x `autoheight` host class is ignored here, and the mobile drawer is not touched.
|
|
6
6
|
|
|
7
7
|
## Banner
|
|
8
8
|
|
|
@@ -18,4 +18,4 @@ The document scrolls, so browser scroll restoration, anchors, find-in-page and m
|
|
|
18
18
|
|
|
19
19
|
## Customization
|
|
20
20
|
|
|
21
|
-
Structural styling via `::part(root)`. To show the layout inside a bounded box — a demo, a preview — give the part a height together with `min-height: 0` and `overflow-y: auto
|
|
21
|
+
Structural styling via `::part(root)`. To show the layout inside a bounded box — a demo, a preview — give the part a height together with `min-height: 0` and `overflow-y: auto`, and set `--c-main-viewport-height` to the same height so the pinned side navigation is sized to the box instead of the viewport; the toolbar and side navigation then pin inside that box.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The dashboard layout's left-hand menu: section titles, navigation items and their sub-items in a drawer that is pinned beside the page on desktop and slides in over it on mobile.
|
|
2
|
+
|
|
3
|
+
## Inside c-main
|
|
4
|
+
|
|
5
|
+
Slot it as a direct child of `c-main` and the dashboard layout places and pins it: the drawer sits beneath the toolbar — or at the top edge once a `static` toolbar has scrolled away — is sized to the pinned height, and scrolls a long menu on its own. No host class is needed; the 3.x `autoheight` class is ignored there.
|
|
6
|
+
|
|
7
|
+
## Bottom slot
|
|
8
|
+
|
|
9
|
+
Trailing content — a sign-out button, a help link — goes in the `bottom` slot. It stays at the drawer's bottom edge while the items scroll above it: the viewport's bottom edge on desktop, the panel's in the mobile drawer. It is reached without scrolling the menu and is not a menu item.
|
|
10
|
+
|
|
11
|
+
## Mobile
|
|
12
|
+
|
|
13
|
+
Set `mobile` to render the drawer as a panel that slides in from the right over a backdrop. `menu-visible` opens and closes it, and a `c-navigation-button` anywhere on the page toggles it. Closing from within — the close button or the backdrop — emits `change:menu-visible`.
|
|
14
|
+
|
|
15
|
+
## Standalone
|
|
16
|
+
|
|
17
|
+
Outside `c-main` the drawer is an ordinary block that grows with its items. The `autoheight` host class sizes it to the viewport minus the toolbar height and lets its item list scroll, for a shell that pins the drawer itself.
|
|
18
|
+
|
|
19
|
+
## Customization
|
|
20
|
+
|
|
21
|
+
Structural styling via `::part(root)` (the drawer) and `::part(nav)` (the scrolling item list). The surface is the `nav-surface` token role; override the tokens to re-theme.
|
|
@@ -113,6 +113,7 @@
|
|
|
113
113
|
--color-on-nav: var(--c-on-nav);
|
|
114
114
|
--color-nav-active: var(--c-nav-active);
|
|
115
115
|
--color-on-nav-active: var(--c-on-nav-active);
|
|
116
|
+
--color-nav-sub-active: var(--c-nav-sub-active);
|
|
116
117
|
|
|
117
118
|
--color-logo-wordmark: var(--c-logo-wordmark);
|
|
118
119
|
--color-logo-teal: var(--c-logo-teal);
|
|
@@ -220,6 +220,7 @@
|
|
|
220
220
|
--c-on-nav: var(--c-white);
|
|
221
221
|
--c-nav-active: var(--c-primary-100);
|
|
222
222
|
--c-on-nav-active: var(--c-primary-700);
|
|
223
|
+
--c-nav-sub-active: var(--c-white);
|
|
223
224
|
--c-chart-1: oklch(0.6534 0.1710 247.9336);
|
|
224
225
|
--c-chart-2: oklch(0.5906 0.1462 343.7182);
|
|
225
226
|
--c-chart-3: oklch(0.6697 0.1291 89.0072);
|
|
@@ -315,6 +316,7 @@
|
|
|
315
316
|
--c-on-nav: var(--c-primary-100);
|
|
316
317
|
--c-nav-active: var(--c-primary-500);
|
|
317
318
|
--c-on-nav-active: var(--c-white);
|
|
319
|
+
--c-nav-sub-active: color-mix(in srgb, var(--c-white) 18%, transparent);
|
|
318
320
|
--c-chart-1: oklch(0.6504 0.1710 247.9858);
|
|
319
321
|
--c-chart-2: oklch(0.5920 0.1445 343.8493);
|
|
320
322
|
--c-chart-3: oklch(0.6696 0.1303 89.2281);
|
|
@@ -411,6 +413,7 @@
|
|
|
411
413
|
--c-on-nav: var(--c-primary-100);
|
|
412
414
|
--c-nav-active: var(--c-primary-500);
|
|
413
415
|
--c-on-nav-active: var(--c-white);
|
|
416
|
+
--c-nav-sub-active: color-mix(in srgb, var(--c-white) 18%, transparent);
|
|
414
417
|
--c-chart-1: oklch(0.6504 0.1710 247.9858);
|
|
415
418
|
--c-chart-2: oklch(0.5920 0.1445 343.8493);
|
|
416
419
|
--c-chart-3: oklch(0.6696 0.1303 89.2281);
|
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
"name": "--c-font-family",
|
|
7
7
|
"description": "Font stack applied to the label (native buttons do not inherit it).",
|
|
8
8
|
"values": []
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "--c-main-viewport-height",
|
|
12
|
+
"description": "Height of the scroll viewport the layout pins against (default `100dvh`); a bounded shell with its own scrollbar sets it to its box height",
|
|
13
|
+
"values": []
|
|
9
14
|
}
|
|
10
15
|
],
|
|
11
16
|
"pseudoElements": [
|
|
@@ -577,7 +582,10 @@
|
|
|
577
582
|
"name": "::part(tag-root)",
|
|
578
583
|
"description": "The pill box inside each tag (the `c-tag` `root` part), for colours and borders"
|
|
579
584
|
},
|
|
580
|
-
{
|
|
585
|
+
{
|
|
586
|
+
"name": "::part(root)",
|
|
587
|
+
"description": "The outer drawer container: the item list above the bottom slot's region"
|
|
588
|
+
},
|
|
581
589
|
{
|
|
582
590
|
"name": "::part(nav)",
|
|
583
591
|
"description": "The scrollable `<nav>` element holding the navigation items"
|
|
@@ -937,7 +937,7 @@
|
|
|
937
937
|
},
|
|
938
938
|
{
|
|
939
939
|
"name": "c-main",
|
|
940
|
-
"description": "The page shell of an application: it paints the page canvas and lays out the toolbar, the side navigation and the page in the dashboard layout. It is at least a viewport tall and grows with its content, so the document — not a component — is what scrolls.\n---\n\n\n### **Slots:**\n - **default** - Contents of the page: the toolbar, side navigation and page\n- **banner** - A full-width message strip above the toolbar; it scrolls away with the page\n\n### **CSS Parts:**\n - **root** - The main element carrying the page canvas and the dashboard grid layout",
|
|
940
|
+
"description": "The page shell of an application: it paints the page canvas and lays out the toolbar, the side navigation and the page in the dashboard layout. It is at least a viewport tall and grows with its content, so the document — not a component — is what scrolls.\n---\n\n\n### **Slots:**\n - **default** - Contents of the page: the toolbar, side navigation and page\n- **banner** - A full-width message strip above the toolbar; it scrolls away with the page\n\n### **CSS Properties:**\n - **--c-main-viewport-height** - Height of the scroll viewport the layout pins against (default `100dvh`); a bounded shell with its own scrollbar sets it to its box height _(default: undefined)_\n\n### **CSS Parts:**\n - **root** - The main element carrying the page canvas and the dashboard grid layout",
|
|
941
941
|
"attributes": [
|
|
942
942
|
{
|
|
943
943
|
"name": "disable-layout",
|
|
@@ -1461,7 +1461,7 @@
|
|
|
1461
1461
|
},
|
|
1462
1462
|
{
|
|
1463
1463
|
"name": "c-side-navigation",
|
|
1464
|
-
"description": "
|
|
1464
|
+
"description": "The dashboard layout's left-hand menu: section titles, navigation items and their sub-items in a drawer that is pinned beside the page on desktop and slides in over it on mobile.\n---\n\n\n### **Events:**\n - **change:menu-visible** - Fired when the drawer is closed from within (the mobile close button or\nthe backdrop overlay), carrying the new visibility (`false`).\nNamed `change:menu-visible`, not `update:menuVisible`: Vue's runtime\nsilently drops `onUpdate:*` listeners on custom elements\n(`isModelListener`), so a template `@update:menu-visible` would never be\nattached.\n\n### **Slots:**\n - **default** - The navigation items: titles, items and their sub-items\n- **bottom** - Trailing content below the items, such as a sign-out button; it stays at the drawer's bottom edge while the items scroll\n\n### **CSS Parts:**\n - **root** - The outer drawer container: the item list above the bottom slot's region\n- **nav** - The scrollable `<nav>` element holding the navigation items",
|
|
1465
1465
|
"attributes": [
|
|
1466
1466
|
{
|
|
1467
1467
|
"name": "menu-visible",
|
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.18",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -2456,7 +2456,7 @@
|
|
|
2456
2456
|
},
|
|
2457
2457
|
{
|
|
2458
2458
|
"name": "c-main",
|
|
2459
|
-
"description": "The page shell of an application: it paints the page canvas and lays out the toolbar, the side navigation and the page in the dashboard layout. It is at least a viewport tall and grows with its content, so the document — not a component — is what scrolls.\n---\n\n\n### **Slots:**\n - **default** - Contents of the page: the toolbar, side navigation and page\n- **banner** - A full-width message strip above the toolbar; it scrolls away with the page\n\n### **CSS Parts:**\n - **root** - The main element carrying the page canvas and the dashboard grid layout",
|
|
2459
|
+
"description": "The page shell of an application: it paints the page canvas and lays out the toolbar, the side navigation and the page in the dashboard layout. It is at least a viewport tall and grows with its content, so the document — not a component — is what scrolls.\n---\n\n\n### **Slots:**\n - **default** - Contents of the page: the toolbar, side navigation and page\n- **banner** - A full-width message strip above the toolbar; it scrolls away with the page\n\n### **CSS Properties:**\n - **--c-main-viewport-height** - Height of the scroll viewport the layout pins against (default `100dvh`); a bounded shell with its own scrollbar sets it to its box height _(default: undefined)_\n\n### **CSS Parts:**\n - **root** - The main element carrying the page canvas and the dashboard grid layout",
|
|
2460
2460
|
"doc-url": "",
|
|
2461
2461
|
"attributes": [
|
|
2462
2462
|
{
|
|
@@ -3858,7 +3858,7 @@
|
|
|
3858
3858
|
},
|
|
3859
3859
|
{
|
|
3860
3860
|
"name": "c-side-navigation",
|
|
3861
|
-
"description": "
|
|
3861
|
+
"description": "The dashboard layout's left-hand menu: section titles, navigation items and their sub-items in a drawer that is pinned beside the page on desktop and slides in over it on mobile.\n---\n\n\n### **Events:**\n - **change:menu-visible** - Fired when the drawer is closed from within (the mobile close button or\nthe backdrop overlay), carrying the new visibility (`false`).\nNamed `change:menu-visible`, not `update:menuVisible`: Vue's runtime\nsilently drops `onUpdate:*` listeners on custom elements\n(`isModelListener`), so a template `@update:menu-visible` would never be\nattached.\n\n### **Slots:**\n - **default** - The navigation items: titles, items and their sub-items\n- **bottom** - Trailing content below the items, such as a sign-out button; it stays at the drawer's bottom edge while the items scroll\n\n### **CSS Parts:**\n - **root** - The outer drawer container: the item list above the bottom slot's region\n- **nav** - The scrollable `<nav>` element holding the navigation items",
|
|
3862
3862
|
"doc-url": "",
|
|
3863
3863
|
"attributes": [
|
|
3864
3864
|
{
|
|
@@ -3873,8 +3873,14 @@
|
|
|
3873
3873
|
}
|
|
3874
3874
|
],
|
|
3875
3875
|
"slots": [
|
|
3876
|
-
{
|
|
3877
|
-
|
|
3876
|
+
{
|
|
3877
|
+
"name": "default",
|
|
3878
|
+
"description": "The navigation items: titles, items and their sub-items"
|
|
3879
|
+
},
|
|
3880
|
+
{
|
|
3881
|
+
"name": "bottom",
|
|
3882
|
+
"description": "Trailing content below the items, such as a sign-out button; it stays at the drawer's bottom edge while the items scroll"
|
|
3883
|
+
}
|
|
3878
3884
|
],
|
|
3879
3885
|
"events": [
|
|
3880
3886
|
{
|
|
@@ -5848,6 +5854,10 @@
|
|
|
5848
5854
|
{
|
|
5849
5855
|
"name": "--c-font-family",
|
|
5850
5856
|
"description": "Font stack applied to the label (native buttons do not inherit it)."
|
|
5857
|
+
},
|
|
5858
|
+
{
|
|
5859
|
+
"name": "--c-main-viewport-height",
|
|
5860
|
+
"description": "Height of the scroll viewport the layout pins against (default `100dvh`); a bounded shell with its own scrollbar sets it to its box height"
|
|
5851
5861
|
}
|
|
5852
5862
|
],
|
|
5853
5863
|
"pseudo-elements": [
|
|
@@ -6431,7 +6441,10 @@
|
|
|
6431
6441
|
"name": "part(tag-root)",
|
|
6432
6442
|
"description": "The pill box inside each tag (the `c-tag` `root` part), for colours and borders"
|
|
6433
6443
|
},
|
|
6434
|
-
{
|
|
6444
|
+
{
|
|
6445
|
+
"name": "part(root)",
|
|
6446
|
+
"description": "The outer drawer container: the item list above the bottom slot's region"
|
|
6447
|
+
},
|
|
6435
6448
|
{
|
|
6436
6449
|
"name": "part(nav)",
|
|
6437
6450
|
"description": "The scrollable `<nav>` element holding the navigation items"
|
|
@@ -1212,6 +1212,7 @@ export interface CSideNavigationElementEventMap {
|
|
|
1212
1212
|
*/
|
|
1213
1213
|
'change:menu-visible': CustomEvent<boolean>;
|
|
1214
1214
|
}
|
|
1215
|
+
/** The dashboard layout's left-hand menu: section titles, navigation items and their sub-items in a drawer that is pinned beside the page on desktop and slides in over it on mobile. */
|
|
1215
1216
|
export interface CSideNavigationElement extends Omit<HTMLElement, 'menuVisible' | 'mobile' | 'styles'> {
|
|
1216
1217
|
/** Mobile version menu visibility */
|
|
1217
1218
|
menuVisible?: boolean;
|
package/package.json
CHANGED