@webtides/element-library 0.3.0 → 0.4.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/CHANGELOG.md +208 -0
- package/README.md +72 -56
- package/all.js +16 -0
- package/catalog.js +17 -1
- package/custom-elements.json +14731 -10193
- package/package.json +1 -1
- package/src/components/accordion/accordion.changelog.md +11 -0
- package/src/components/accordion/accordion.js +15 -3
- package/src/components/accordion/accordion.readme.md +27 -1
- package/src/components/accordion/accordion.style.js +19 -0
- package/src/components/app-bar/app-bar.changelog.md +24 -0
- package/src/components/app-bar/app-bar.define.js +3 -0
- package/src/components/app-bar/app-bar.js +91 -0
- package/src/components/app-bar/app-bar.readme.md +130 -0
- package/src/components/app-bar/app-bar.style.js +103 -0
- package/src/components/app-frame/app-frame.changelog.md +45 -0
- package/src/components/app-frame/app-frame.define.js +3 -0
- package/src/components/app-frame/app-frame.events.js +6 -0
- package/src/components/app-frame/app-frame.js +1073 -0
- package/src/components/app-frame/app-frame.readme.md +416 -0
- package/src/components/app-frame/app-frame.style.js +527 -0
- package/src/components/button/button.changelog.md +25 -0
- package/src/components/button/button.events.js +3 -0
- package/src/components/button/button.js +209 -14
- package/src/components/button/button.readme.md +82 -6
- package/src/components/button/button.style.js +161 -7
- package/src/components/checkbox-field/checkbox-field.changelog.md +6 -0
- package/src/components/checkbox-field/checkbox-field.js +7 -1
- package/src/components/description-list/description-list.changelog.md +25 -0
- package/src/components/description-list/description-list.define.js +3 -0
- package/src/components/description-list/description-list.js +44 -0
- package/src/components/description-list/description-list.readme.md +135 -0
- package/src/components/description-list/description-list.style.js +140 -0
- package/src/components/dialog/dialog.changelog.md +7 -0
- package/src/components/dialog/dialog.readme.md +5 -0
- package/src/components/dialog/dialog.style.js +17 -2
- package/src/components/drawer/drawer.changelog.md +7 -0
- package/src/components/drawer/drawer.readme.md +7 -6
- package/src/components/drawer/drawer.style.js +35 -2
- package/src/components/dropdown/dropdown.readme.md +6 -1
- package/src/components/list/list.changelog.md +24 -0
- package/src/components/list/list.define.js +3 -0
- package/src/components/list/list.js +66 -0
- package/src/components/list/list.readme.md +122 -0
- package/src/components/list/list.style.js +56 -0
- package/src/components/list-item/list-item.changelog.md +24 -0
- package/src/components/list-item/list-item.define.js +3 -0
- package/src/components/list-item/list-item.js +128 -0
- package/src/components/list-item/list-item.readme.md +126 -0
- package/src/components/list-item/list-item.style.js +234 -0
- package/src/components/menu/menu.changelog.md +27 -0
- package/src/components/menu/menu.define.js +3 -0
- package/src/components/menu/menu.events.js +5 -0
- package/src/components/menu/menu.js +570 -0
- package/src/components/menu/menu.readme.md +272 -0
- package/src/components/menu/menu.style.js +55 -0
- package/src/components/menu-group/menu-group.changelog.md +20 -0
- package/src/components/menu-group/menu-group.define.js +3 -0
- package/src/components/menu-group/menu-group.js +44 -0
- package/src/components/menu-group/menu-group.readme.md +74 -0
- package/src/components/menu-group/menu-group.style.js +38 -0
- package/src/components/menu-item/menu-item.changelog.md +24 -0
- package/src/components/menu-item/menu-item.define.js +3 -0
- package/src/components/menu-item/menu-item.js +130 -0
- package/src/components/menu-item/menu-item.readme.md +94 -0
- package/src/components/menu-item/menu-item.style.js +87 -0
- package/src/components/nav/nav.changelog.md +35 -0
- package/src/components/nav/nav.define.js +3 -0
- package/src/components/nav/nav.js +212 -0
- package/src/components/nav/nav.readme.md +248 -0
- package/src/components/nav/nav.style.js +269 -0
- package/src/components/nav-item/nav-item.changelog.md +25 -0
- package/src/components/nav-item/nav-item.define.js +3 -0
- package/src/components/nav-item/nav-item.js +75 -0
- package/src/components/nav-item/nav-item.readme.md +111 -0
- package/src/components/nav-item/nav-item.style.js +159 -0
- package/src/components/pagination/pagination.changelog.md +8 -0
- package/src/components/pagination/pagination.js +123 -49
- package/src/components/pagination/pagination.readme.md +24 -6
- package/src/components/pagination/pagination.style.js +11 -1
- package/src/components/scroll-to-top/scroll-to-top.changelog.md +7 -5
- package/src/components/scroll-to-top/scroll-to-top.js +16 -12
- package/src/components/scroll-to-top/scroll-to-top.readme.md +2 -0
- package/src/components/segmented-field/segmented-field.changelog.md +27 -0
- package/src/components/segmented-field/segmented-field.define.js +3 -0
- package/src/components/segmented-field/segmented-field.js +175 -0
- package/src/components/segmented-field/segmented-field.readme.md +140 -0
- package/src/components/segmented-field/segmented-field.style.js +193 -0
- package/src/components/splitter/splitter.changelog.md +24 -0
- package/src/components/splitter/splitter.define.js +3 -0
- package/src/components/splitter/splitter.events.js +4 -0
- package/src/components/splitter/splitter.js +237 -0
- package/src/components/splitter/splitter.readme.md +164 -0
- package/src/components/splitter/splitter.style.js +100 -0
- package/src/components/status-bar/status-bar.changelog.md +25 -0
- package/src/components/status-bar/status-bar.define.js +3 -0
- package/src/components/status-bar/status-bar.js +74 -0
- package/src/components/status-bar/status-bar.readme.md +139 -0
- package/src/components/status-bar/status-bar.style.js +122 -0
- package/src/components/switch-field/switch-field.changelog.md +6 -0
- package/src/components/switch-field/switch-field.js +7 -1
- package/src/components/tab-group/tab-group.changelog.md +7 -0
- package/src/components/tab-group/tab-group.js +30 -9
- package/src/components/tab-group/tab-group.readme.md +14 -0
- package/src/components/toast/toast.changelog.md +6 -0
- package/src/components/toast/toast.readme.md +5 -3
- package/src/components/toast/toast.style.js +22 -6
- package/src/components/toolbar/toolbar.changelog.md +24 -0
- package/src/components/toolbar/toolbar.define.js +3 -0
- package/src/components/toolbar/toolbar.js +233 -0
- package/src/components/toolbar/toolbar.readme.md +156 -0
- package/src/components/toolbar/toolbar.style.js +49 -0
- package/src/components/tooltip/tooltip.changelog.md +11 -0
- package/src/components/tooltip/tooltip.js +51 -4
- package/src/components/tooltip/tooltip.readme.md +26 -1
- package/src/components/tree/tree.changelog.md +23 -0
- package/src/components/tree/tree.define.js +3 -0
- package/src/components/tree/tree.js +138 -0
- package/src/components/tree/tree.readme.md +119 -0
- package/src/components/tree/tree.style.js +16 -0
- package/src/components/tree-item/tree-item.changelog.md +23 -0
- package/src/components/tree-item/tree-item.define.js +3 -0
- package/src/components/tree-item/tree-item.events.js +3 -0
- package/src/components/tree-item/tree-item.js +246 -0
- package/src/components/tree-item/tree-item.readme.md +128 -0
- package/src/components/tree-item/tree-item.style.js +226 -0
- package/src/styles/appearance.style.js +47 -0
- package/src/styles/choice-group.style.js +1 -1
- package/src/styles/modal.style.js +14 -1
- package/src/styles/size.style.js +41 -0
- package/src/utils/focus.js +69 -0
- package/src/utils/scroll.js +24 -0
- package/types/all.d.ts +16 -0
- package/types/src/components/accordion/accordion.d.ts +3 -1
- package/types/src/components/app-bar/app-bar.d.ts +43 -0
- package/types/src/components/app-bar/app-bar.define.d.ts +1 -0
- package/types/src/components/app-bar/app-bar.style.d.ts +2 -0
- package/types/src/components/app-frame/app-frame.d.ts +491 -0
- package/types/src/components/app-frame/app-frame.define.d.ts +1 -0
- package/types/src/components/app-frame/app-frame.events.d.ts +7 -0
- package/types/src/components/app-frame/app-frame.style.d.ts +8 -0
- package/types/src/components/button/button.d.ts +97 -7
- package/types/src/components/button/button.events.d.ts +4 -0
- package/types/src/components/description-list/description-list.d.ts +29 -0
- package/types/src/components/description-list/description-list.define.d.ts +1 -0
- package/types/src/components/description-list/description-list.style.d.ts +2 -0
- package/types/src/components/list/list.d.ts +39 -0
- package/types/src/components/list/list.define.d.ts +1 -0
- package/types/src/components/list/list.style.d.ts +2 -0
- package/types/src/components/list-item/list-item.d.ts +62 -0
- package/types/src/components/list-item/list-item.define.d.ts +1 -0
- package/types/src/components/list-item/list-item.style.d.ts +2 -0
- package/types/src/components/menu/menu.d.ts +266 -0
- package/types/src/components/menu/menu.define.d.ts +1 -0
- package/types/src/components/menu/menu.events.d.ts +6 -0
- package/types/src/components/menu/menu.style.d.ts +2 -0
- package/types/src/components/menu-group/menu-group.d.ts +24 -0
- package/types/src/components/menu-group/menu-group.define.d.ts +1 -0
- package/types/src/components/menu-group/menu-group.style.d.ts +2 -0
- package/types/src/components/menu-item/menu-item.d.ts +59 -0
- package/types/src/components/menu-item/menu-item.define.d.ts +1 -0
- package/types/src/components/menu-item/menu-item.style.d.ts +2 -0
- package/types/src/components/nav/nav.d.ts +103 -0
- package/types/src/components/nav/nav.define.d.ts +1 -0
- package/types/src/components/nav/nav.style.d.ts +2 -0
- package/types/src/components/nav-item/nav-item.d.ts +39 -0
- package/types/src/components/nav-item/nav-item.define.d.ts +1 -0
- package/types/src/components/nav-item/nav-item.style.d.ts +2 -0
- package/types/src/components/pagination/pagination.d.ts +31 -2
- package/types/src/components/scroll-to-top/scroll-to-top.d.ts +6 -5
- package/types/src/components/segmented-field/segmented-field.d.ts +85 -0
- package/types/src/components/segmented-field/segmented-field.define.d.ts +1 -0
- package/types/src/components/segmented-field/segmented-field.style.d.ts +2 -0
- package/types/src/components/splitter/splitter.d.ts +127 -0
- package/types/src/components/splitter/splitter.define.d.ts +1 -0
- package/types/src/components/splitter/splitter.events.d.ts +5 -0
- package/types/src/components/splitter/splitter.style.d.ts +2 -0
- package/types/src/components/status-bar/status-bar.d.ts +44 -0
- package/types/src/components/status-bar/status-bar.define.d.ts +1 -0
- package/types/src/components/status-bar/status-bar.style.d.ts +2 -0
- package/types/src/components/tab-group/tab-group.d.ts +17 -0
- package/types/src/components/toolbar/toolbar.d.ts +96 -0
- package/types/src/components/toolbar/toolbar.define.d.ts +1 -0
- package/types/src/components/toolbar/toolbar.style.d.ts +2 -0
- package/types/src/components/tooltip/tooltip.d.ts +26 -0
- package/types/src/components/tree/tree.d.ts +62 -0
- package/types/src/components/tree/tree.define.d.ts +1 -0
- package/types/src/components/tree/tree.style.d.ts +2 -0
- package/types/src/components/tree-item/tree-item.d.ts +106 -0
- package/types/src/components/tree-item/tree-item.define.d.ts +1 -0
- package/types/src/components/tree-item/tree-item.events.d.ts +4 -0
- package/types/src/components/tree-item/tree-item.style.d.ts +2 -0
- package/types/src/styles/appearance.style.d.ts +31 -0
- package/types/src/styles/choice-group.style.d.ts +1 -1
- package/types/src/styles/modal.style.d.ts +5 -0
- package/types/src/styles/size.style.d.ts +24 -0
- package/types/src/utils/focus.d.ts +25 -0
- package/types/src/utils/scroll.d.ts +11 -0
- package/web-types.json +2530 -393
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
import hostStyle from '../../styles/host.style.js';
|
|
2
|
+
|
|
3
|
+
const css = String.raw;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The widths from which a frame can be wide. A stylesheet cannot read the width of a query from a
|
|
7
|
+
* custom property, so there is a query per step, and the frame names the one that counts.
|
|
8
|
+
*/
|
|
9
|
+
export const STEPS = ['30rem', '40rem', '48rem', '64rem', '80rem'];
|
|
10
|
+
export const DEFAULT_STEP = '48rem';
|
|
11
|
+
|
|
12
|
+
/* A line between two regions. A border: it stays where the user forces colours. */
|
|
13
|
+
const line = 'var(--_el-app-frame-line-width) solid var(--el-color-border, transparent)';
|
|
14
|
+
|
|
15
|
+
/* What a region tells the components in it: how far its surface reaches past its content, on each
|
|
16
|
+
side. An app bar in the header draws its surface that far, under the status bar of a phone. */
|
|
17
|
+
const noInsets = css`
|
|
18
|
+
--_el-context-inset-block-start: 0px;
|
|
19
|
+
--_el-context-inset-block-end: 0px;
|
|
20
|
+
--_el-context-inset-inline-start: 0px;
|
|
21
|
+
--_el-context-inset-inline-end: 0px;
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
const style = css`
|
|
25
|
+
/*
|
|
26
|
+
* The frame fills what the browser shows: it is fixed to the four edges of the viewport, which
|
|
27
|
+
* move with the address bar of a phone. It is out of the flow of the page, so it adds nothing
|
|
28
|
+
* to scroll, whatever margin the body has.
|
|
29
|
+
*
|
|
30
|
+
* A page that wants a frame in a box of its own sets the position and a height on the element.
|
|
31
|
+
*/
|
|
32
|
+
:host {
|
|
33
|
+
/* The room the system takes at the edges of the screen: the notch, the rounded corners,
|
|
34
|
+
the home indicator. Nothing without viewport-fit=cover. */
|
|
35
|
+
--_el-app-frame-top: env(safe-area-inset-top, 0px);
|
|
36
|
+
--_el-app-frame-bottom: env(safe-area-inset-bottom, 0px);
|
|
37
|
+
--_el-app-frame-start: env(safe-area-inset-left, 0px);
|
|
38
|
+
--_el-app-frame-end: env(safe-area-inset-right, 0px);
|
|
39
|
+
--_el-app-frame-line-width: var(--el-border-width, 0px);
|
|
40
|
+
|
|
41
|
+
display: block;
|
|
42
|
+
position: fixed;
|
|
43
|
+
inset: 0;
|
|
44
|
+
/* The frame is wide or narrow by its own width. */
|
|
45
|
+
container-type: inline-size;
|
|
46
|
+
/* Headless without a theme: the page shows through. */
|
|
47
|
+
background: var(--el-color-bg, transparent);
|
|
48
|
+
color: var(--el-color-fg, inherit);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Asked of the host: with \`dir\` on an element around the frame, Chromium does not match
|
|
52
|
+
\`:dir(rtl)\` for an element inside the shadow root. */
|
|
53
|
+
:host(:dir(rtl)) {
|
|
54
|
+
--_el-app-frame-start: env(safe-area-inset-right, 0px);
|
|
55
|
+
--_el-app-frame-end: env(safe-area-inset-left, 0px);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/*
|
|
59
|
+
* An on-screen keyboard covers the lower part of the viewport, and the browser has moved the
|
|
60
|
+
* page behind it: the frame is where the script says what shows is, and as high. Its lower
|
|
61
|
+
* edge is the keyboard and not the edge of the screen, so there is no home indicator to keep
|
|
62
|
+
* clear of.
|
|
63
|
+
*/
|
|
64
|
+
:host(:state(keyboard)) {
|
|
65
|
+
--_el-app-frame-bottom: 0px;
|
|
66
|
+
|
|
67
|
+
inset-block: var(--_el-app-frame-visible-start, 0px) auto;
|
|
68
|
+
block-size: var(--_el-app-frame-visible-size, 100%);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Where the user forces colours, a line is what tells two regions apart: it is there without
|
|
72
|
+
a theme as well. */
|
|
73
|
+
@media (forced-colors: active) {
|
|
74
|
+
:host {
|
|
75
|
+
--_el-app-frame-line-width: max(var(--el-border-width, 0px), 1px);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* ── The link that skips to the content ───────────────────────────────── */
|
|
80
|
+
|
|
81
|
+
.skip {
|
|
82
|
+
position: absolute;
|
|
83
|
+
z-index: 1;
|
|
84
|
+
inset-block-start: calc(var(--_el-app-frame-top) + var(--el-space-2, 0.5rem));
|
|
85
|
+
inset-inline-start: calc(var(--_el-app-frame-start) + var(--el-space-2, 0.5rem));
|
|
86
|
+
padding: var(--el-space-2, 0.5rem) var(--el-space-3, 0.75rem);
|
|
87
|
+
/* It lies on the header, so it has a surface without a theme as well. */
|
|
88
|
+
background: var(--el-color-bg, Canvas);
|
|
89
|
+
color: var(--el-color-fg, CanvasText);
|
|
90
|
+
border: max(var(--el-border-width, 0px), 1px) solid var(--el-color-border, currentColor);
|
|
91
|
+
border-radius: var(--el-radius-md, 0);
|
|
92
|
+
font-size: var(--el-font-size-sm, 0.875rem);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/* Off the screen until the Tab key gets to it, and there for assistive technology. */
|
|
96
|
+
.skip:not(:focus) {
|
|
97
|
+
width: 1px;
|
|
98
|
+
height: 1px;
|
|
99
|
+
margin: -1px;
|
|
100
|
+
padding: 0;
|
|
101
|
+
border: 0;
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
clip-path: inset(50%);
|
|
104
|
+
white-space: nowrap;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.skip:focus-visible {
|
|
108
|
+
outline: var(--el-focus-ring-width, 2px) solid var(--el-color-focus-ring, currentColor);
|
|
109
|
+
outline-offset: 2px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* ── The regions ──────────────────────────────────────────────────────── */
|
|
113
|
+
|
|
114
|
+
/*
|
|
115
|
+
* Narrow, which is the frame without a query: the header, one column that scrolls, the footer.
|
|
116
|
+
*/
|
|
117
|
+
.frame {
|
|
118
|
+
/* What the script asks: the stylesheet decides whether the frame is wide. */
|
|
119
|
+
--_el-app-frame-view: narrow;
|
|
120
|
+
|
|
121
|
+
display: grid;
|
|
122
|
+
grid-template-columns: minmax(0, 1fr);
|
|
123
|
+
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
124
|
+
grid-template-areas:
|
|
125
|
+
'header'
|
|
126
|
+
'body'
|
|
127
|
+
'footer';
|
|
128
|
+
block-size: 100%;
|
|
129
|
+
/* Without a header or a footer the frame keeps their edge of the screen clear itself.
|
|
130
|
+
The content does not scroll under the status bar then. */
|
|
131
|
+
padding-block: var(--_el-app-frame-top) var(--_el-app-frame-bottom);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.frame--header {
|
|
135
|
+
padding-block-start: 0;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.frame--footer {
|
|
139
|
+
padding-block-end: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* The surface of the header reaches the edges of the screen, and what is in it stays clear of
|
|
143
|
+
them: the padding is the room of the system. */
|
|
144
|
+
.header {
|
|
145
|
+
--_el-context-inset-block-start: var(--_el-app-frame-top);
|
|
146
|
+
--_el-context-inset-block-end: 0px;
|
|
147
|
+
--_el-context-inset-inline-start: var(--_el-app-frame-start);
|
|
148
|
+
--_el-context-inset-inline-end: var(--_el-app-frame-end);
|
|
149
|
+
/* The line to the content is drawn here: a bar in the region leaves its own out. */
|
|
150
|
+
--_el-context-line-block-end: 0px;
|
|
151
|
+
|
|
152
|
+
grid-area: header;
|
|
153
|
+
padding-block-start: var(--_el-app-frame-top);
|
|
154
|
+
padding-inline: var(--_el-app-frame-start) var(--_el-app-frame-end);
|
|
155
|
+
border-block-end: ${line};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.footer {
|
|
159
|
+
--_el-context-inset-block-start: 0px;
|
|
160
|
+
--_el-context-inset-block-end: var(--_el-app-frame-bottom);
|
|
161
|
+
--_el-context-inset-inline-start: var(--_el-app-frame-start);
|
|
162
|
+
--_el-context-inset-inline-end: var(--_el-app-frame-end);
|
|
163
|
+
--_el-context-line-block-start: 0px;
|
|
164
|
+
|
|
165
|
+
grid-area: footer;
|
|
166
|
+
padding-block-end: var(--_el-app-frame-bottom);
|
|
167
|
+
padding-inline: var(--_el-app-frame-start) var(--_el-app-frame-end);
|
|
168
|
+
border-block-start: ${line};
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* The navigation does not show where the frame is narrow. The script puts it into a drawer
|
|
172
|
+
there, which opens from any element with data-navigation-toggle. */
|
|
173
|
+
.navigation {
|
|
174
|
+
display: none;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/* An el-button that opens the navigation is not there where there is nothing to open: no
|
|
178
|
+
navigation, one for the wide frame only, or one that is a bar at the lower edge. It reads
|
|
179
|
+
this in its own stylesheet. */
|
|
180
|
+
.frame:not(.frame--navigation),
|
|
181
|
+
.frame[data-wide-only~='navigation'],
|
|
182
|
+
.frame[data-narrow-navigation='bar'] {
|
|
183
|
+
--_el-context-navigation-toggle-display: none;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/*
|
|
187
|
+
* The navigation as a bar: its region lies at the lower edge, over the footer. It is a surface
|
|
188
|
+
* of the frame there, as the footer is: it reaches the sides of the screen, and the lower edge
|
|
189
|
+
* where no footer is below it, and what is in it stays clear of them.
|
|
190
|
+
*/
|
|
191
|
+
.frame[data-narrow-navigation='bar'] {
|
|
192
|
+
grid-template-rows: auto minmax(0, 1fr) auto auto;
|
|
193
|
+
grid-template-areas:
|
|
194
|
+
'header'
|
|
195
|
+
'body'
|
|
196
|
+
'navigation'
|
|
197
|
+
'footer';
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.frame[data-narrow-navigation='bar'] .navigation {
|
|
201
|
+
--_el-context-inset-block-start: 0px;
|
|
202
|
+
--_el-context-inset-block-end: 0px;
|
|
203
|
+
--_el-context-inset-inline-start: var(--_el-app-frame-start);
|
|
204
|
+
--_el-context-inset-inline-end: var(--_el-app-frame-end);
|
|
205
|
+
--_el-context-line-block-start: 0px;
|
|
206
|
+
|
|
207
|
+
display: block;
|
|
208
|
+
grid-area: navigation;
|
|
209
|
+
padding-inline: var(--_el-app-frame-start) var(--_el-app-frame-end);
|
|
210
|
+
border-block-start: ${line};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.frame[data-narrow-navigation='bar'].frame--navigation:not(.frame--footer) {
|
|
214
|
+
padding-block-end: 0;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.frame[data-narrow-navigation='bar']:not(.frame--footer) .navigation {
|
|
218
|
+
--_el-context-inset-block-end: var(--_el-app-frame-bottom);
|
|
219
|
+
|
|
220
|
+
padding-block-end: var(--_el-app-frame-bottom);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/* The drawer of the navigation: as wide as the column is, and the navigation of the page
|
|
224
|
+
brings its own padding. */
|
|
225
|
+
.drawer {
|
|
226
|
+
--el-drawer-size: var(--el-app-frame-navigation-size, 16rem);
|
|
227
|
+
/* An el-nav in the drawer has its destinations below each other. */
|
|
228
|
+
--_el-context-nav-column: ;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.drawer::part(body) {
|
|
232
|
+
padding: 0;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/* A drawer hides what is in it while it is closed, but only once it has rendered. Until then
|
|
236
|
+
the navigation of the page would show in the place of the drawer, for a frame. */
|
|
237
|
+
.drawer:not(:state(connected)) {
|
|
238
|
+
display: none;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* The edges the user drags are at the sides of columns: there are none where the frame is
|
|
242
|
+
narrow. An edge that has not rendered yet is not there either. */
|
|
243
|
+
.edge {
|
|
244
|
+
display: none;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/* The one thing that scrolls: the content and the aside below each other. */
|
|
248
|
+
.body {
|
|
249
|
+
${noInsets}
|
|
250
|
+
|
|
251
|
+
grid-area: body;
|
|
252
|
+
min-block-size: 0;
|
|
253
|
+
overflow-y: auto;
|
|
254
|
+
/* The end of the content is the end: the page behind the frame does not move. */
|
|
255
|
+
overscroll-behavior: contain;
|
|
256
|
+
padding-inline: var(--_el-app-frame-start) var(--_el-app-frame-end);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.aside {
|
|
260
|
+
border-block-start: ${line};
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/* A region the page has only where the frame is wide is not there while it is narrow. The
|
|
264
|
+
frame keeps the edge of a header or a footer that is not there clear itself. */
|
|
265
|
+
.frame[data-wide-only~='header'] .header,
|
|
266
|
+
.frame[data-wide-only~='navigation'] .navigation,
|
|
267
|
+
.frame[data-wide-only~='aside'] .aside,
|
|
268
|
+
.frame[data-wide-only~='footer'] .footer {
|
|
269
|
+
display: none;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
.frame[data-wide-only~='header'] {
|
|
273
|
+
padding-block-start: var(--_el-app-frame-top);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.frame[data-wide-only~='footer'] {
|
|
277
|
+
padding-block-end: var(--_el-app-frame-bottom);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/* A region that scrolls takes the focus of the keyboard where nothing in it does. The ring is
|
|
281
|
+
inside: around the region there is the edge of the screen. */
|
|
282
|
+
.body:focus-visible,
|
|
283
|
+
.content:focus-visible,
|
|
284
|
+
.navigation:focus-visible,
|
|
285
|
+
.aside:focus-visible {
|
|
286
|
+
outline: var(--el-focus-ring-width, 2px) solid var(--el-color-focus-ring, currentColor);
|
|
287
|
+
outline-offset: calc(-1 * var(--el-focus-ring-width, 2px));
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/* The skip link has put the focus here, for the keys that scroll. A region is no control. */
|
|
291
|
+
.content[tabindex='-1']:focus {
|
|
292
|
+
outline: none;
|
|
293
|
+
}
|
|
294
|
+
`;
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Wide: the navigation and the aside are columns beside the content, and each of the three
|
|
298
|
+
* scrolls on its own. The same rules for every step, each in the query of its width.
|
|
299
|
+
* @param {string} step
|
|
300
|
+
* @returns {string}
|
|
301
|
+
*/
|
|
302
|
+
const wideStyle = (step) => {
|
|
303
|
+
const frame = `.frame[data-wide-from='${step}']`;
|
|
304
|
+
|
|
305
|
+
return css`
|
|
306
|
+
@container (min-width: ${step}) {
|
|
307
|
+
${frame} {
|
|
308
|
+
--_el-app-frame-view: wide;
|
|
309
|
+
/* The navigation is a column: there is no drawer to open. */
|
|
310
|
+
--_el-context-navigation-toggle-display: none;
|
|
311
|
+
|
|
312
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
313
|
+
grid-template-areas:
|
|
314
|
+
'header header header'
|
|
315
|
+
'navigation content aside'
|
|
316
|
+
'footer footer footer';
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/* The three are regions of the frame itself now. */
|
|
320
|
+
${frame} .body {
|
|
321
|
+
display: contents;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
${frame} .navigation,
|
|
325
|
+
${frame} .content,
|
|
326
|
+
${frame} .aside {
|
|
327
|
+
min-block-size: 0;
|
|
328
|
+
overflow-y: auto;
|
|
329
|
+
overscroll-behavior: contain;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/* The width the page sets is the width of what is in the region: the room of the
|
|
333
|
+
system and the line come on top. */
|
|
334
|
+
${frame} .navigation,
|
|
335
|
+
${frame} .aside {
|
|
336
|
+
box-sizing: content-box;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
${frame} .navigation {
|
|
340
|
+
${noInsets}
|
|
341
|
+
--_el-context-inset-inline-start: var(--_el-app-frame-start);
|
|
342
|
+
/* The region draws the line to the content, and an el-nav in it is a column: a
|
|
343
|
+
rail or a list. */
|
|
344
|
+
--_el-context-line-inline-end: 0px;
|
|
345
|
+
--_el-context-nav-column: ;
|
|
346
|
+
--_el-context-line-block-start: initial;
|
|
347
|
+
|
|
348
|
+
display: block;
|
|
349
|
+
grid-area: navigation;
|
|
350
|
+
inline-size: var(--_el-app-frame-navigation-size, var(--el-app-frame-navigation-size, 16rem));
|
|
351
|
+
padding-block-end: 0;
|
|
352
|
+
padding-inline: var(--_el-app-frame-start) 0;
|
|
353
|
+
border-block-start: 0;
|
|
354
|
+
border-inline-end: ${line};
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/* The column of a navigation that is a bar where the frame is narrow is as wide as
|
|
358
|
+
what is in it: a rail. */
|
|
359
|
+
${frame}[data-narrow-navigation='bar'] .navigation {
|
|
360
|
+
inline-size: var(--_el-app-frame-navigation-size, var(--el-app-frame-navigation-size, auto));
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
${frame}[data-narrow-navigation='bar'] {
|
|
364
|
+
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
${frame}[data-narrow-navigation='bar'].frame--navigation:not(.frame--footer) {
|
|
368
|
+
padding-block-end: var(--_el-app-frame-bottom);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/* The column does not reach the lower edge of the screen as the bar did: the frame
|
|
372
|
+
keeps that edge clear. */
|
|
373
|
+
${frame}[data-narrow-navigation='bar']:not(.frame--footer) .navigation {
|
|
374
|
+
--_el-context-inset-block-end: 0px;
|
|
375
|
+
|
|
376
|
+
padding-block-end: 0;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
${frame} .aside {
|
|
380
|
+
grid-area: aside;
|
|
381
|
+
inline-size: var(--_el-app-frame-aside-size, var(--el-app-frame-aside-size, 20rem));
|
|
382
|
+
padding-inline-end: var(--_el-app-frame-end);
|
|
383
|
+
border-block-start: 0;
|
|
384
|
+
border-inline-start: ${line};
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/*
|
|
388
|
+
* A column whose edge the user drags keeps between a least and a greatest width,
|
|
389
|
+
* whatever width is kept for it: the stylesheet holds the limits, before the script
|
|
390
|
+
* has run and when the frame gets narrower. The greatest one is a share of the frame
|
|
391
|
+
* by default, so the content keeps a part of it.
|
|
392
|
+
*/
|
|
393
|
+
${frame}[data-resizable~='navigation'] .navigation {
|
|
394
|
+
min-inline-size: var(--el-app-frame-navigation-min-size, 10rem);
|
|
395
|
+
max-inline-size: var(--el-app-frame-navigation-max-size, min(30rem, 40cqi));
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
${frame}[data-resizable~='aside'] .aside {
|
|
399
|
+
min-inline-size: var(--el-app-frame-aside-min-size, 10rem);
|
|
400
|
+
max-inline-size: var(--el-app-frame-aside-max-size, min(30rem, 40cqi));
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/* The edge lies on the line of its column, which the column draws: it is in the
|
|
404
|
+
place of the column in the grid, at the side that faces the content. */
|
|
405
|
+
${frame} .edge:state(connected) {
|
|
406
|
+
--el-splitter-line-width: 0px;
|
|
407
|
+
|
|
408
|
+
display: block;
|
|
409
|
+
min-block-size: 0;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
${frame} .edge--navigation {
|
|
413
|
+
grid-area: navigation;
|
|
414
|
+
justify-self: end;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
${frame} .edge--aside {
|
|
418
|
+
grid-area: aside;
|
|
419
|
+
justify-self: start;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* The content keeps the edge of the screen clear where no column is beside it. */
|
|
423
|
+
${frame} .content {
|
|
424
|
+
grid-area: content;
|
|
425
|
+
min-inline-size: 0;
|
|
426
|
+
padding-inline: var(--_el-app-frame-start) var(--_el-app-frame-end);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
${frame}.frame--navigation .content {
|
|
430
|
+
padding-inline-start: 0;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
${frame}.frame--aside .content {
|
|
434
|
+
padding-inline-end: 0;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/* The regions the page has only where the frame is wide are there now, and the ones
|
|
438
|
+
it has only where the frame is narrow are not. What was beside or above them keeps
|
|
439
|
+
that edge of the screen clear. */
|
|
440
|
+
${frame}[data-wide-only~='header'] .header,
|
|
441
|
+
${frame}[data-wide-only~='navigation'] .navigation,
|
|
442
|
+
${frame}[data-wide-only~='aside'] .aside,
|
|
443
|
+
${frame}[data-wide-only~='footer'] .footer {
|
|
444
|
+
display: block;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
${frame}[data-wide-only~='header'].frame--header {
|
|
448
|
+
padding-block-start: 0;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
${frame}[data-wide-only~='footer'].frame--footer {
|
|
452
|
+
padding-block-end: 0;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
${frame}[data-narrow-only~='header'] .header,
|
|
456
|
+
${frame}[data-narrow-only~='navigation'] .navigation,
|
|
457
|
+
${frame}[data-narrow-only~='navigation'] .edge--navigation,
|
|
458
|
+
${frame}[data-narrow-only~='aside'] .aside,
|
|
459
|
+
${frame}[data-narrow-only~='aside'] .edge--aside,
|
|
460
|
+
${frame}[data-narrow-only~='footer'] .footer {
|
|
461
|
+
display: none;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
${frame}[data-narrow-only~='header'] {
|
|
465
|
+
padding-block-start: var(--_el-app-frame-top);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
${frame}[data-narrow-only~='footer'] {
|
|
469
|
+
padding-block-end: var(--_el-app-frame-bottom);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
${frame}[data-narrow-only~='navigation'] .content {
|
|
473
|
+
padding-inline-start: var(--_el-app-frame-start);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
${frame}[data-narrow-only~='aside'] .content {
|
|
477
|
+
padding-inline-end: var(--_el-app-frame-end);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
`;
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
/*
|
|
484
|
+
* On paper there is no viewport to fill: the frame is as long as its content, and nothing is cut
|
|
485
|
+
* off. After the queries, and with selectors of their weight: paper can be wide or narrow.
|
|
486
|
+
*/
|
|
487
|
+
const printStyle = css`
|
|
488
|
+
@media print {
|
|
489
|
+
:host {
|
|
490
|
+
position: static;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
.frame[data-wide-from] {
|
|
494
|
+
display: block;
|
|
495
|
+
block-size: auto;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.frame[data-wide-from] .body {
|
|
499
|
+
display: block;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.frame[data-wide-from] .body,
|
|
503
|
+
.frame[data-wide-from] .navigation,
|
|
504
|
+
.frame[data-wide-from] .content,
|
|
505
|
+
.frame[data-wide-from] .aside {
|
|
506
|
+
inline-size: auto;
|
|
507
|
+
overflow: visible;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/* And a column has no limits of its width. */
|
|
511
|
+
.frame[data-wide-from][data-resizable] .navigation,
|
|
512
|
+
.frame[data-wide-from][data-resizable] .aside {
|
|
513
|
+
min-inline-size: 0;
|
|
514
|
+
max-inline-size: none;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.frame[data-wide-from] .edge:state(connected) {
|
|
518
|
+
display: none;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.skip {
|
|
522
|
+
display: none;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
`;
|
|
526
|
+
|
|
527
|
+
export default [hostStyle(), style, ...STEPS.map(wideStyle), printStyle].join('\n');
|
|
@@ -12,6 +12,31 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
|
|
|
12
12
|
|
|
13
13
|
## Unreleased
|
|
14
14
|
|
|
15
|
+
## [0.4.0] - 2026-11-27
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- `toggle`: the button is a toggle button, one that stays pressed. A click flips `pressed`, and so do the Space and the Enter key; the control has `aria-pressed` with the state, so a screen reader announces a toggle button. `pressed` is a property and an attribute the page can set and read, and a toggle button writes the attribute itself (`pressed="true"`, `"false"`). `toggle` is ignored on a button with `href`. ([#172](https://github.com/webtides/element-library/issues/172))
|
|
20
|
+
- `button-toggle`, fired when a click has flipped a toggle button, with the new state in `detail.pressed`. Not fired when `pressed` is set from a script. A `click` listener of the page that calls `preventDefault()` keeps the button from flipping. ([#172](https://github.com/webtides/element-library/issues/172))
|
|
21
|
+
- A pressed button shows that it is pressed: a ring inside of its edge in the colour of its label, in every variant and appearance, and a tint of the text colour where the button has no fill. The ring is a border, so it stays where the user forces colours, and it has the corners of the button, the joined ones of an `el-button-group` as well. Before, no rule selected a pressed button, and it looked like one that is not pressed. ([#172](https://github.com/webtides/element-library/issues/172))
|
|
22
|
+
- In a container that gives its controls a size and an appearance, an `el-toolbar`, the button takes them from it, while the page has not set `size` or `appearance` on the button itself. A button that names its own keeps it, the defaults included (`appearance="filled"`, `size="medium"`). The container says both in CSS properties that are inherited, and the button reads them in its stylesheet: its attributes are not written, and outside of such a container nothing changes. ([#194](https://github.com/webtides/element-library/issues/194))
|
|
23
|
+
- An `el-button` with `data-navigation-toggle`, the button that opens the navigation of an `el-app-frame`, is not there where the navigation is a column beside the content. The frame says so in a CSS property that is inherited, so this holds before any script has run. Outside of a frame the attribute changes nothing. ([#177](https://github.com/webtides/element-library/issues/177))
|
|
24
|
+
- In a container that has the edge of the screen around it, an `el-status-bar`, the focus ring of a theme is inside of the button and not around it. The container says so in a CSS property that is inherited (`--_el-context-focus-ring-offset`); outside of such a container the ring is where it was. ([#180](https://github.com/webtides/element-library/issues/180))
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- A button with `aria-pressed="true"` that the page sets itself shows the ring of a pressed button as well. The attribute goes to the control as before, and no click changes it. ([#172](https://github.com/webtides/element-library/issues/172))
|
|
29
|
+
|
|
30
|
+
## [0.3.1] - 2026-11-17
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- A button of the type `submit` makes its hidden native `<button type="submit">` when the form is first submitted with it: with a click, or with Enter in an `<input>` or a `<select>` of the form. Before, it appended that button as soon as it started. Until the first submit the children of the `el-button` are what the page wrote, and `form.querySelector('[type="submit"]')` does not find a native button in it. When the page replaces the content of the button, the native button is made again with the next submit, and no longer with the next render. A native submit button that the page writes is taken as before. ([#184](https://github.com/webtides/element-library/issues/184))
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- A server-rendered `el-button` of the type `submit` no longer breaks the hydration of its page. The element appended its native submit button as soon as it started, and a framework that hydrated after that found a child it had not rendered (Svelte 5: `hydration_mismatch`, the page was built again, and what the user had typed into the form by then was gone). See "On a page that a framework hydrates" in the readme. ([#184](https://github.com/webtides/element-library/issues/184))
|
|
39
|
+
|
|
15
40
|
## [0.3.0] - 2026-11-17
|
|
16
41
|
|
|
17
42
|
### Added
|