@scalewing/react 1.46.0 → 1.48.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 +74 -0
- package/README.md +228 -4
- package/dist/app-shell.test-support.d.ts +5 -0
- package/dist/app-shell.test-support.js +45 -0
- package/dist/command-palette.test-support.d.ts +21 -0
- package/dist/command-palette.test-support.js +55 -0
- package/dist/components/AppHeader.d.ts +3 -0
- package/dist/components/AppShell.d.ts +13 -0
- package/dist/components/AppShell.js +65 -0
- package/dist/components/Band.d.ts +30 -0
- package/dist/components/Band.js +23 -0
- package/dist/components/ButtonLink.d.ts +33 -0
- package/dist/components/ButtonLink.js +27 -0
- package/dist/components/CommandPalette.d.ts +12 -0
- package/dist/components/CommandPalette.js +143 -0
- package/dist/components/CommandPaletteTrigger.d.ts +9 -0
- package/dist/components/CommandPaletteTrigger.js +16 -0
- package/dist/components/ContextSwitcher.d.ts +12 -0
- package/dist/components/ContextSwitcher.js +62 -0
- package/dist/components/FixtureGroup.d.ts +9 -0
- package/dist/components/FixtureGroup.js +16 -0
- package/dist/components/FixtureRow.d.ts +10 -0
- package/dist/components/FixtureRow.js +46 -0
- package/dist/components/GlyphTile.d.ts +9 -3
- package/dist/components/GlyphTile.js +15 -4
- package/dist/components/NavCount.d.ts +12 -5
- package/dist/components/NavCount.js +9 -4
- package/dist/components/SectionNav.d.ts +2 -1
- package/dist/components/SectionNav.js +3 -19
- package/dist/components/SiteFooter.d.ts +12 -0
- package/dist/components/SiteFooter.js +23 -0
- package/dist/components/SiteHeader.d.ts +14 -0
- package/dist/components/SiteHeader.js +24 -0
- package/dist/components/Skeleton.d.ts +22 -0
- package/dist/components/Skeleton.js +30 -0
- package/dist/components/app-shell/AppShellBar.d.ts +23 -0
- package/dist/components/app-shell/AppShellBar.js +25 -0
- package/dist/components/app-shell/AppShellDrawer.d.ts +24 -0
- package/dist/components/app-shell/AppShellDrawer.js +17 -0
- package/dist/components/app-shell/AppShellLink.d.ts +14 -0
- package/dist/components/app-shell/AppShellLink.js +27 -0
- package/dist/components/app-shell/AppShellNav.d.ts +15 -0
- package/dist/components/app-shell/AppShellNav.js +29 -0
- package/dist/components/app-shell/AppShellSidebar.d.ts +18 -0
- package/dist/components/app-shell/AppShellSidebar.js +18 -0
- package/dist/components/app-shell/types.d.ts +122 -0
- package/dist/components/app-shell/types.js +1 -0
- package/dist/components/app-shell/validate.d.ts +7 -0
- package/dist/components/app-shell/validate.js +70 -0
- package/dist/components/command-palette/PaletteList.d.ts +20 -0
- package/dist/components/command-palette/PaletteList.js +21 -0
- package/dist/components/command-palette/shortcut.d.ts +19 -0
- package/dist/components/command-palette/shortcut.js +75 -0
- package/dist/components/command-palette/types.d.ts +72 -0
- package/dist/components/command-palette/types.js +2 -0
- package/dist/components/command-palette/validate.d.ts +10 -0
- package/dist/components/command-palette/validate.js +50 -0
- package/dist/components/context-switcher/SwitcherOption.d.ts +17 -0
- package/dist/components/context-switcher/SwitcherOption.js +20 -0
- package/dist/components/context-switcher/SwitcherPopup.d.ts +31 -0
- package/dist/components/context-switcher/SwitcherPopup.js +111 -0
- package/dist/components/context-switcher/options.d.ts +33 -0
- package/dist/components/context-switcher/options.js +60 -0
- package/dist/components/context-switcher/types.d.ts +96 -0
- package/dist/components/context-switcher/types.js +1 -0
- package/dist/components/context-switcher/use-switcher-list.d.ts +29 -0
- package/dist/components/context-switcher/use-switcher-list.js +93 -0
- package/dist/components/context-switcher/validate.d.ts +8 -0
- package/dist/components/context-switcher/validate.js +94 -0
- package/dist/components/fixture/fixture-list-context.d.ts +4 -0
- package/dist/components/fixture/fixture-list-context.js +9 -0
- package/dist/components/fixture/types.d.ts +50 -0
- package/dist/components/fixture/types.js +1 -0
- package/dist/components/fixture/validate.d.ts +8 -0
- package/dist/components/fixture/validate.js +36 -0
- package/dist/components/nav-items.d.ts +21 -0
- package/dist/components/nav-items.js +26 -0
- package/dist/components/site-footer/types.d.ts +31 -0
- package/dist/components/site-footer/types.js +1 -0
- package/dist/components/site-footer/validate.d.ts +7 -0
- package/dist/components/site-footer/validate.js +22 -0
- package/dist/components/site-header/SiteHeaderLinks.d.ts +7 -0
- package/dist/components/site-header/SiteHeaderLinks.js +7 -0
- package/dist/components/site-header/types.d.ts +38 -0
- package/dist/components/site-header/types.js +1 -0
- package/dist/components/site-header/use-menu-dismiss.d.ts +8 -0
- package/dist/components/site-header/use-menu-dismiss.js +62 -0
- package/dist/components/site-header/validate.d.ts +7 -0
- package/dist/components/site-header/validate.js +17 -0
- package/dist/components/use-element-height.d.ts +10 -0
- package/dist/components/use-element-height.js +35 -0
- package/dist/context-switcher.test-support.d.ts +9 -0
- package/dist/context-switcher.test-support.js +41 -0
- package/dist/css/css-app-shell-drawer.d.ts +2 -0
- package/dist/css/css-app-shell-drawer.js +91 -0
- package/dist/css/css-app-shell-nav.d.ts +3 -0
- package/dist/css/css-app-shell-nav.js +167 -0
- package/dist/css/css-app-shell-page-bar.d.ts +3 -0
- package/dist/css/css-app-shell-page-bar.js +81 -0
- package/dist/css/css-app-shell.d.ts +4 -0
- package/dist/css/css-app-shell.js +155 -0
- package/dist/css/css-band.d.ts +10 -0
- package/dist/css/css-band.js +101 -0
- package/dist/css/css-button-link.d.ts +3 -0
- package/dist/css/css-button-link.js +48 -0
- package/dist/css/css-command-palette-key.d.ts +1 -0
- package/dist/css/css-command-palette-key.js +33 -0
- package/dist/css/css-command-palette-trigger.d.ts +2 -0
- package/dist/css/css-command-palette-trigger.js +88 -0
- package/dist/css/css-command-palette.d.ts +2 -0
- package/dist/css/css-command-palette.js +209 -0
- package/dist/css/css-components.js +27 -0
- package/dist/css/css-context-switcher-trigger.d.ts +15 -0
- package/dist/css/css-context-switcher-trigger.js +175 -0
- package/dist/css/css-context-switcher.d.ts +4 -0
- package/dist/css/css-context-switcher.js +219 -0
- package/dist/css/css-count-pill.d.ts +7 -0
- package/dist/css/css-count-pill.js +50 -12
- package/dist/css/css-fixture.d.ts +5 -0
- package/dist/css/css-fixture.js +260 -0
- package/dist/css/css-glyph-tile.d.ts +2 -0
- package/dist/css/css-glyph-tile.js +29 -1
- package/dist/css/css-site-footer.d.ts +2 -0
- package/dist/css/css-site-footer.js +152 -0
- package/dist/css/css-site-header.d.ts +2 -0
- package/dist/css/css-site-header.js +262 -0
- package/dist/css/css-skeleton.d.ts +10 -0
- package/dist/css/css-skeleton.js +110 -0
- package/dist/css/stacking.js +7 -4
- package/dist/css/stylesheet.js +18 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +11 -0
- package/dist/styles.css +2122 -512
- package/package.json +2 -2
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { typographyVariants } from '@scalewing/tokens';
|
|
2
|
+
import { breakpointQuery } from './breakpoints.js';
|
|
3
|
+
import { quietFill } from './quiet-fill.js';
|
|
4
|
+
import { zIndex } from './stacking.js';
|
|
5
|
+
const label = typographyVariants.label;
|
|
6
|
+
const title = typographyVariants.title;
|
|
7
|
+
/** The bar's height: 56 px on a phone, 72 px from `lg`. */
|
|
8
|
+
const compactHeight = 'calc(var(--sw-control-md-min-height) + var(--sw-space-3))';
|
|
9
|
+
const wideHeight = 'calc(var(--sw-control-md-min-height) + var(--sw-space-5) + var(--sw-space-1))';
|
|
10
|
+
const wide = breakpointQuery('from', 'lg');
|
|
11
|
+
/*
|
|
12
|
+
* The bar: the solid surface with a hairline under it, its content in the
|
|
13
|
+
* page container with the page gutter. Below `lg` it holds the brand, the
|
|
14
|
+
* compact actions and the menu button; from `lg` the brand, the
|
|
15
|
+
* destinations (the current one at label weight over a bar in the words'
|
|
16
|
+
* colour, as tall as the bar) and the actions, spread apart.
|
|
17
|
+
*/
|
|
18
|
+
function barRules() {
|
|
19
|
+
return `.sw-site-header {
|
|
20
|
+
--sw-site-header-height: ${compactHeight};
|
|
21
|
+
background: var(--sw-color-surface);
|
|
22
|
+
border-bottom: 1px solid var(--sw-color-border);
|
|
23
|
+
color: var(--sw-color-text);
|
|
24
|
+
font-family: var(--sw-font-sans);
|
|
25
|
+
position: relative;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.sw-site-header-sticky {
|
|
29
|
+
position: sticky;
|
|
30
|
+
top: 0;
|
|
31
|
+
${zIndex('topChrome')}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.sw-site-header-bar {
|
|
35
|
+
align-items: center;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
display: flex;
|
|
38
|
+
gap: var(--sw-space-5);
|
|
39
|
+
justify-content: space-between;
|
|
40
|
+
margin-inline: auto;
|
|
41
|
+
max-width: calc(var(--sw-container-max) + 2 * var(--sw-space-5));
|
|
42
|
+
min-height: var(--sw-site-header-height);
|
|
43
|
+
padding-inline: var(--sw-space-4);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.sw-site-header-brand {
|
|
47
|
+
align-items: center;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex: none;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.sw-site-header-nav,
|
|
53
|
+
.sw-site-header-actions {
|
|
54
|
+
display: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.sw-site-header-compact {
|
|
58
|
+
align-items: center;
|
|
59
|
+
display: flex;
|
|
60
|
+
gap: var(--sw-space-1);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.sw-site-header-list {
|
|
64
|
+
list-style: none;
|
|
65
|
+
margin: 0;
|
|
66
|
+
padding: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.sw-site-header-nav .sw-site-header-list {
|
|
70
|
+
display: flex;
|
|
71
|
+
gap: var(--sw-space-5);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
[data-theme] .sw-site-header-nav .sw-site-header-link {
|
|
75
|
+
align-items: center;
|
|
76
|
+
color: var(--sw-color-text);
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
font-size: ${label.fontSize}px;
|
|
79
|
+
font-weight: 400;
|
|
80
|
+
letter-spacing: ${label.letterSpacing}px;
|
|
81
|
+
line-height: ${label.lineHeight}px;
|
|
82
|
+
min-height: var(--sw-site-header-height);
|
|
83
|
+
text-decoration: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
[data-theme] .sw-site-header-nav .sw-site-header-link:hover {
|
|
87
|
+
box-shadow: inset 0 -2px 0 var(--sw-color-border);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
[data-theme] .sw-site-header-nav .sw-site-header-link[aria-current] {
|
|
91
|
+
box-shadow: inset 0 -2px 0 currentColor;
|
|
92
|
+
font-weight: ${label.fontWeight};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
[data-theme] .sw-site-header-nav .sw-site-header-link:focus-visible {
|
|
96
|
+
outline-offset: calc(-1 * var(--sw-focus-ring-width));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.sw-site-header-actions {
|
|
100
|
+
align-items: center;
|
|
101
|
+
gap: var(--sw-space-4);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media ${breakpointQuery('from', 'md')} {
|
|
105
|
+
.sw-site-header-bar { padding-inline: var(--sw-space-5); }
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@media ${wide} {
|
|
109
|
+
.sw-site-header { --sw-site-header-height: ${wideHeight}; }
|
|
110
|
+
.sw-site-header-nav { display: block; }
|
|
111
|
+
.sw-site-header-actions { display: flex; }
|
|
112
|
+
.sw-site-header-compact { display: none; }
|
|
113
|
+
}`;
|
|
114
|
+
}
|
|
115
|
+
/*
|
|
116
|
+
* The menu is a native \`details\`: its \`summary\` is the button (the menu
|
|
117
|
+
* glyph and its name while closed, the close glyph and its name while
|
|
118
|
+
* open, the other pair hidden so only one is read), and its panel lies
|
|
119
|
+
* under the bar over the rest of the window, the destinations as large
|
|
120
|
+
* rows with hairlines and the menu's actions at the panel's foot. It
|
|
121
|
+
* scrolls on its own when the window is short.
|
|
122
|
+
*/
|
|
123
|
+
function menuRules() {
|
|
124
|
+
return `.sw-site-header-menu > summary {
|
|
125
|
+
list-style: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.sw-site-header-menu > summary::-webkit-details-marker {
|
|
129
|
+
display: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.sw-site-header-menu-button {
|
|
133
|
+
align-items: center;
|
|
134
|
+
border-radius: var(--sw-radius-pill);
|
|
135
|
+
box-sizing: border-box;
|
|
136
|
+
color: var(--sw-color-text);
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
display: inline-flex;
|
|
139
|
+
height: var(--sw-control-md-min-height);
|
|
140
|
+
justify-content: center;
|
|
141
|
+
width: var(--sw-control-md-min-height);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.sw-site-header-menu-button:hover {
|
|
145
|
+
background: ${quietFill};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.sw-site-header-menu-button:focus-visible {
|
|
149
|
+
outline: var(--sw-focus-ring-width) solid var(--sw-color-accent);
|
|
150
|
+
outline-offset: calc(-1 * var(--sw-focus-ring-width));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.sw-site-header-menu-open,
|
|
154
|
+
.sw-site-header-menu-close,
|
|
155
|
+
.sw-site-header-glyph {
|
|
156
|
+
align-items: center;
|
|
157
|
+
display: inline-flex;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.sw-site-header-menu[open] .sw-site-header-menu-open,
|
|
161
|
+
.sw-site-header-menu:not([open]) .sw-site-header-menu-close {
|
|
162
|
+
display: none;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.sw-site-header-panel {
|
|
166
|
+
background: var(--sw-color-surface);
|
|
167
|
+
box-sizing: border-box;
|
|
168
|
+
display: flex;
|
|
169
|
+
flex-direction: column;
|
|
170
|
+
height: calc(100dvh - var(--sw-site-header-height) - 1px);
|
|
171
|
+
inset-inline: 0;
|
|
172
|
+
overflow-y: auto;
|
|
173
|
+
padding: var(--sw-space-2) var(--sw-space-4) var(--sw-space-6);
|
|
174
|
+
position: absolute;
|
|
175
|
+
top: calc(100% + 1px);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.sw-site-header-menu-nav .sw-site-header-list {
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-direction: column;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
[data-theme] .sw-site-header-menu-nav .sw-site-header-link {
|
|
184
|
+
align-items: center;
|
|
185
|
+
border-bottom: 1px solid var(--sw-color-border);
|
|
186
|
+
color: var(--sw-color-text);
|
|
187
|
+
display: flex;
|
|
188
|
+
font-size: ${title.fontSize}px;
|
|
189
|
+
font-weight: ${title.fontWeight};
|
|
190
|
+
letter-spacing: ${title.letterSpacing}px;
|
|
191
|
+
line-height: ${title.lineHeight}px;
|
|
192
|
+
min-height: ${compactHeight};
|
|
193
|
+
text-decoration: none;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
[data-theme] .sw-site-header-menu-nav .sw-site-header-link[aria-current] {
|
|
197
|
+
color: var(--sw-color-accent);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
[data-theme] .sw-site-header-menu-nav .sw-site-header-link:focus-visible {
|
|
201
|
+
outline-offset: calc(-1 * var(--sw-focus-ring-width));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.sw-site-header-menu-actions {
|
|
205
|
+
display: flex;
|
|
206
|
+
flex-direction: column;
|
|
207
|
+
gap: var(--sw-space-3);
|
|
208
|
+
margin-top: auto;
|
|
209
|
+
padding-top: var(--sw-space-5);
|
|
210
|
+
}`;
|
|
211
|
+
}
|
|
212
|
+
export function cssSiteHeaderClasses() {
|
|
213
|
+
return `${barRules()}
|
|
214
|
+
|
|
215
|
+
${menuRules()}
|
|
216
|
+
|
|
217
|
+
/*
|
|
218
|
+
* Forced colours drop box shadows, so the current destination's bar is a
|
|
219
|
+
* thick underline there.
|
|
220
|
+
*/
|
|
221
|
+
@media (forced-colors: active) {
|
|
222
|
+
.sw-site-header,
|
|
223
|
+
[data-theme] .sw-site-header-menu-nav .sw-site-header-link {
|
|
224
|
+
border-color: CanvasText;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
[data-theme] .sw-site-header-link[aria-current] {
|
|
228
|
+
color: Highlight;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
[data-theme] .sw-site-header-nav .sw-site-header-link[aria-current] {
|
|
232
|
+
text-decoration: underline;
|
|
233
|
+
text-decoration-thickness: 2px;
|
|
234
|
+
text-underline-offset: var(--sw-space-2);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.sw-site-header-menu-button {
|
|
238
|
+
border: 1px solid ButtonText;
|
|
239
|
+
}
|
|
240
|
+
}`;
|
|
241
|
+
}
|
|
242
|
+
export function siteHeaderClassCatalog() {
|
|
243
|
+
return [
|
|
244
|
+
'sw-site-header',
|
|
245
|
+
'sw-site-header-sticky',
|
|
246
|
+
'sw-site-header-bar',
|
|
247
|
+
'sw-site-header-brand',
|
|
248
|
+
'sw-site-header-nav',
|
|
249
|
+
'sw-site-header-actions',
|
|
250
|
+
'sw-site-header-compact',
|
|
251
|
+
'sw-site-header-list',
|
|
252
|
+
'sw-site-header-link',
|
|
253
|
+
'sw-site-header-menu',
|
|
254
|
+
'sw-site-header-menu-button',
|
|
255
|
+
'sw-site-header-menu-open',
|
|
256
|
+
'sw-site-header-menu-close',
|
|
257
|
+
'sw-site-header-glyph',
|
|
258
|
+
'sw-site-header-panel',
|
|
259
|
+
'sw-site-header-menu-nav',
|
|
260
|
+
'sw-site-header-menu-actions',
|
|
261
|
+
];
|
|
262
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const skeletonVariants: readonly ["lines", "rows"];
|
|
2
|
+
/** `lines` is bars of text in a column; `rows` is list rows with hairlines. */
|
|
3
|
+
export type SkeletonVariant = (typeof skeletonVariants)[number];
|
|
4
|
+
/** How many bars or rows a Skeleton draws. */
|
|
5
|
+
export declare const skeletonLineRange: {
|
|
6
|
+
readonly min: 1;
|
|
7
|
+
readonly max: 6;
|
|
8
|
+
};
|
|
9
|
+
export declare function cssSkeletonClasses(): string;
|
|
10
|
+
export declare function skeletonClassCatalog(): string[];
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { typographyVariants } from '@scalewing/tokens';
|
|
2
|
+
import { quietFill } from './quiet-fill.js';
|
|
3
|
+
import { coarsePointerQuery, touchTarget } from './touch-target.js';
|
|
4
|
+
const body = typographyVariants.body;
|
|
5
|
+
export const skeletonVariants = ['lines', 'rows'];
|
|
6
|
+
/** How many bars or rows a Skeleton draws. */
|
|
7
|
+
export const skeletonLineRange = { min: 1, max: 6 };
|
|
8
|
+
/*
|
|
9
|
+
* The widths the bars take in turn, so a column reads as text with ragged
|
|
10
|
+
* ends rather than a grid; the last bar of `lines` is shorter still.
|
|
11
|
+
*/
|
|
12
|
+
const barWidths = ['100%', '92%', '84%', '96%', '88%', '80%'];
|
|
13
|
+
function barWidthRules(parent) {
|
|
14
|
+
return barWidths
|
|
15
|
+
.map((width, index) => `${parent} > .sw-skeleton-bar:nth-of-type(${index + 1}) { width: ${width}; }`)
|
|
16
|
+
.join('\n');
|
|
17
|
+
}
|
|
18
|
+
/*
|
|
19
|
+
* Skeleton: grey placeholder bars in the quiet fill, rounded, a text
|
|
20
|
+
* line's height apart. `rows` draws each as a list row: a mark (space-6,
|
|
21
|
+
* the small radius) and a bar at the control height (44 px on a coarse
|
|
22
|
+
* pointer, as a pressable row there), hairlines between. The bars pulse
|
|
23
|
+
* between full and 60 % opacity over the travel duration, and stay still
|
|
24
|
+
* under reduced motion. Forced colours, which drop fills, draw each bar's
|
|
25
|
+
* edge in GrayText so the shape stays.
|
|
26
|
+
*/
|
|
27
|
+
export function cssSkeletonClasses() {
|
|
28
|
+
return `.sw-skeleton {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
gap: var(--sw-space-3);
|
|
32
|
+
width: 100%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.sw-skeleton-bar,
|
|
36
|
+
.sw-skeleton-mark {
|
|
37
|
+
animation: sw-skeleton-pulse calc(2 * var(--sw-motion-travel)) var(--sw-motion-travel-easing) infinite alternate;
|
|
38
|
+
background: ${quietFill};
|
|
39
|
+
border-radius: var(--sw-radius-sm);
|
|
40
|
+
box-sizing: border-box;
|
|
41
|
+
display: block;
|
|
42
|
+
flex: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.sw-skeleton-bar {
|
|
46
|
+
height: calc(${body.fontSize}px * 0.8);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
${barWidthRules('.sw-skeleton-lines')}
|
|
50
|
+
.sw-skeleton-lines > .sw-skeleton-bar:last-of-type:not(:first-of-type) { width: 60%; }
|
|
51
|
+
|
|
52
|
+
.sw-skeleton-rows {
|
|
53
|
+
gap: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.sw-skeleton-row {
|
|
57
|
+
align-items: center;
|
|
58
|
+
box-sizing: border-box;
|
|
59
|
+
display: flex;
|
|
60
|
+
gap: var(--sw-space-3);
|
|
61
|
+
min-height: var(--sw-control-md-min-height);
|
|
62
|
+
padding-block: var(--sw-space-2);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.sw-skeleton-row + .sw-skeleton-row {
|
|
66
|
+
border-top: 1px solid var(--sw-color-border);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.sw-skeleton-row .sw-skeleton-bar {
|
|
70
|
+
flex: 0 1 60%;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.sw-skeleton-row:nth-of-type(even) .sw-skeleton-bar {
|
|
74
|
+
flex-basis: 45%;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.sw-skeleton-mark {
|
|
78
|
+
height: var(--sw-space-6);
|
|
79
|
+
width: var(--sw-space-6);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@keyframes sw-skeleton-pulse {
|
|
83
|
+
from { opacity: 1; }
|
|
84
|
+
to { opacity: 0.6; }
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@media ${coarsePointerQuery} {
|
|
88
|
+
.sw-skeleton-row { min-height: ${touchTarget}; }
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@media (prefers-reduced-motion: reduce) {
|
|
92
|
+
.sw-skeleton-bar,
|
|
93
|
+
.sw-skeleton-mark { animation: none; }
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@media (forced-colors: active) {
|
|
97
|
+
.sw-skeleton-bar,
|
|
98
|
+
.sw-skeleton-mark { border: 1px solid GrayText; }
|
|
99
|
+
.sw-skeleton-row + .sw-skeleton-row { border-color: GrayText; }
|
|
100
|
+
}`;
|
|
101
|
+
}
|
|
102
|
+
export function skeletonClassCatalog() {
|
|
103
|
+
return [
|
|
104
|
+
'sw-skeleton',
|
|
105
|
+
...skeletonVariants.map((variant) => `sw-skeleton-${variant}`),
|
|
106
|
+
'sw-skeleton-bar',
|
|
107
|
+
'sw-skeleton-row',
|
|
108
|
+
'sw-skeleton-mark',
|
|
109
|
+
];
|
|
110
|
+
}
|
package/dist/css/stacking.js
CHANGED
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
* its popup can only paint as high as the surface does; lifting the surface
|
|
14
14
|
* over the ActionBar keeps an open list tappable where the bar would cover
|
|
15
15
|
* it, and over the next surface in the flow.
|
|
16
|
-
* 5. `topChrome`: the sticky AppHeader
|
|
17
|
-
* Dialog's title band, inside its dialog), over a lifted
|
|
16
|
+
* 5. `topChrome`: the sticky AppHeader, sticky Tabs strip or AppShell page
|
|
17
|
+
* bar (and a banded Dialog's title band, inside its dialog), over a lifted
|
|
18
18
|
* surface that scrolls up under it (the header is the page's way back, the
|
|
19
19
|
* strip its way between sections, and a popup opens downward).
|
|
20
20
|
* 6. `sheetGrabber`: a bottom sheet's grabber, inside its dialog, over the
|
|
21
21
|
* banded title band that sticks under it.
|
|
22
22
|
* 7. `popup`: a popup outside any lifted surface (Select list, ActionMenu
|
|
23
|
-
* list, MultiSelect panel, Combobox list, Tooltip,
|
|
24
|
-
* calendar) over everything in the page.
|
|
23
|
+
* list, ContextSwitcher popup, MultiSelect panel, Combobox list, Tooltip,
|
|
24
|
+
* the DateField and CalendarButton calendar) over everything in the page.
|
|
25
25
|
*
|
|
26
26
|
* Dialog and Toast sit on the browser's top layer, above all of these.
|
|
27
27
|
*/
|
|
@@ -60,6 +60,9 @@ const openPopups = [
|
|
|
60
60
|
// Combobox's list. Rendered only while open; on the top layer where the
|
|
61
61
|
// popover API exists.
|
|
62
62
|
'.sw-combobox-popup',
|
|
63
|
+
// ContextSwitcher's popup. Rendered only while open; on the top layer
|
|
64
|
+
// where the popover API exists.
|
|
65
|
+
'.sw-context-switcher-popup',
|
|
63
66
|
'.sw-tooltip:not([hidden])',
|
|
64
67
|
// DateField, CalendarButton and DateRangeButton share it. Rendered only
|
|
65
68
|
// while open; on the top layer where the popover API exists.
|
package/dist/css/stylesheet.js
CHANGED
|
@@ -2,6 +2,8 @@ import { cardVariants, darkTheme, lightTheme, typographyVariants, } from '@scale
|
|
|
2
2
|
import { chartToneClassCatalog } from './chart-tones.js';
|
|
3
3
|
import { actionBarClassCatalog } from './css-action-bar.js';
|
|
4
4
|
import { actionMenuClassCatalog } from './css-action-menu.js';
|
|
5
|
+
import { commandPaletteClassCatalog } from './css-command-palette.js';
|
|
6
|
+
import { contextSwitcherClassCatalog } from './css-context-switcher.js';
|
|
5
7
|
import { accordionClassCatalog } from './css-accordion.js';
|
|
6
8
|
import { switchClassCatalog } from './css-switch.js';
|
|
7
9
|
import { dateFieldClassCatalog } from './css-date-field.js';
|
|
@@ -10,11 +12,13 @@ import { dateRangeClassCatalog } from './css-date-range.js';
|
|
|
10
12
|
import { fileFieldClassCatalog } from './css-file-field.js';
|
|
11
13
|
import { articleClassCatalog } from './css-article.js';
|
|
12
14
|
import { documentViewerClassCatalog } from './css-document-viewer.js';
|
|
15
|
+
import { fixtureClassCatalog } from './css-fixture.js';
|
|
13
16
|
import { listClassCatalog } from './css-list.js';
|
|
14
17
|
import { markdownClassCatalog } from './css-markdown.js';
|
|
15
18
|
import { countPillClassCatalog } from './css-count-pill.js';
|
|
16
19
|
import { checkboxClassCatalog } from './css-checkbox.js';
|
|
17
20
|
import { radioGroupClassCatalog } from './css-radio-group.js';
|
|
21
|
+
import { skeletonClassCatalog } from './css-skeleton.js';
|
|
18
22
|
import { spinnerClassCatalog } from './css-spinner.js';
|
|
19
23
|
import { progressClassCatalog } from './css-progress.js';
|
|
20
24
|
import { noticeClassCatalog } from './css-notice.js';
|
|
@@ -22,6 +26,9 @@ import { glyphTileClassCatalog } from './css-glyph-tile.js';
|
|
|
22
26
|
import { tooltipClassCatalog } from './css-tooltip.js';
|
|
23
27
|
import { infoTipClassCatalog } from './css-info-tip.js';
|
|
24
28
|
import { separatorClassCatalog } from './css-separator.js';
|
|
29
|
+
import { bandClassCatalog } from './css-band.js';
|
|
30
|
+
import { siteFooterClassCatalog } from './css-site-footer.js';
|
|
31
|
+
import { siteHeaderClassCatalog } from './css-site-header.js';
|
|
25
32
|
import { statTileClassCatalog } from './css-stat-tile.js';
|
|
26
33
|
import { descriptionListClassCatalog } from './css-description-list.js';
|
|
27
34
|
import { tabsClassCatalog } from './css-tabs.js';
|
|
@@ -39,6 +46,7 @@ import { boxBorderClassCatalog } from './css-box-border.js';
|
|
|
39
46
|
import { boxLinkClassCatalog } from './css-box-link.js';
|
|
40
47
|
import { cssComponentClasses } from './css-components.js';
|
|
41
48
|
import { buttonClassCatalog } from './css-button.js';
|
|
49
|
+
import { buttonLinkClassCatalog } from './css-button-link.js';
|
|
42
50
|
import { barChartClassCatalog } from './css-bar-chart.js';
|
|
43
51
|
import { chartLegendClassCatalog } from './css-chart-legend.js';
|
|
44
52
|
import { chartPlotClassCatalog } from './css-chart-plot.js';
|
|
@@ -50,6 +58,7 @@ import { segmentedClassCatalog } from './css-segmented.js';
|
|
|
50
58
|
import { tableClassCatalog } from './css-table.js';
|
|
51
59
|
import { chromeClassCatalog } from './css-chrome.js';
|
|
52
60
|
import { sectionNavClassCatalog } from './css-section-nav.js';
|
|
61
|
+
import { appShellClassCatalog } from './css-app-shell.js';
|
|
53
62
|
import { dialogClassCatalog } from './css-dialog.js';
|
|
54
63
|
import { dialogBandedClassCatalog } from './css-dialog-banded.js';
|
|
55
64
|
import { dialogFrameClassCatalog } from './css-dialog-frame.js';
|
|
@@ -80,6 +89,7 @@ export function utilityClassCatalog() {
|
|
|
80
89
|
'sw-tabular',
|
|
81
90
|
...Object.keys(typographyVariants).map((name) => `sw-text-${name}`),
|
|
82
91
|
...buttonClassCatalog(),
|
|
92
|
+
...buttonLinkClassCatalog(),
|
|
83
93
|
...dataClassCatalog(),
|
|
84
94
|
...segmentedClassCatalog(),
|
|
85
95
|
...tableClassCatalog(),
|
|
@@ -93,6 +103,7 @@ export function utilityClassCatalog() {
|
|
|
93
103
|
...paginationClassCatalog(),
|
|
94
104
|
...chromeClassCatalog(),
|
|
95
105
|
...sectionNavClassCatalog(),
|
|
106
|
+
...appShellClassCatalog(),
|
|
96
107
|
...dialogClassCatalog(),
|
|
97
108
|
...dialogFrameClassCatalog(),
|
|
98
109
|
...dialogBandedClassCatalog(),
|
|
@@ -101,6 +112,8 @@ export function utilityClassCatalog() {
|
|
|
101
112
|
...accordionClassCatalog(),
|
|
102
113
|
...selectClassCatalog(),
|
|
103
114
|
...actionMenuClassCatalog(),
|
|
115
|
+
...contextSwitcherClassCatalog(),
|
|
116
|
+
...commandPaletteClassCatalog(),
|
|
104
117
|
...multiSelectClassCatalog(),
|
|
105
118
|
...comboboxClassCatalog(),
|
|
106
119
|
...actionBarClassCatalog(),
|
|
@@ -109,6 +122,7 @@ export function utilityClassCatalog() {
|
|
|
109
122
|
...calendarButtonClassCatalog(),
|
|
110
123
|
...dateRangeClassCatalog(),
|
|
111
124
|
...listClassCatalog(),
|
|
125
|
+
...fixtureClassCatalog(),
|
|
112
126
|
...fileFieldClassCatalog(),
|
|
113
127
|
...articleClassCatalog(),
|
|
114
128
|
...documentViewerClassCatalog(),
|
|
@@ -117,12 +131,16 @@ export function utilityClassCatalog() {
|
|
|
117
131
|
...checkboxClassCatalog(),
|
|
118
132
|
...radioGroupClassCatalog(),
|
|
119
133
|
...spinnerClassCatalog(),
|
|
134
|
+
...skeletonClassCatalog(),
|
|
120
135
|
...progressClassCatalog(),
|
|
121
136
|
...noticeClassCatalog(),
|
|
122
137
|
...glyphTileClassCatalog(),
|
|
123
138
|
...tooltipClassCatalog(),
|
|
124
139
|
...infoTipClassCatalog(),
|
|
125
140
|
...separatorClassCatalog(),
|
|
141
|
+
...bandClassCatalog(),
|
|
142
|
+
...siteFooterClassCatalog(),
|
|
143
|
+
...siteHeaderClassCatalog(),
|
|
126
144
|
...statTileClassCatalog(),
|
|
127
145
|
...descriptionListClassCatalog(),
|
|
128
146
|
...tabsClassCatalog(),
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { listGroupVariants, listRowTitleAppearances, listRowTones, listRowValueT
|
|
|
16
16
|
export { listTileColumnCounts, type ListGroupTileColumns, } from './css/css-list-tiles.js';
|
|
17
17
|
export { Checkbox, type CheckboxProps } from './components/Checkbox.js';
|
|
18
18
|
export { Spinner, type SpinnerProps, type SpinnerSize, } from './components/Spinner.js';
|
|
19
|
+
export { Skeleton, skeletonVariants, type SkeletonProps, type SkeletonVariant, } from './components/Skeleton.js';
|
|
19
20
|
export { GlyphTile, glyphTileSizes, type GlyphTileHue, type GlyphTileProps, type GlyphTileSize, } from './components/GlyphTile.js';
|
|
20
21
|
export { Notice, noticeTones, noticeVariants, type NoticeProps, type NoticeRole, type NoticeTone, type NoticeVariant, } from './components/Notice.js';
|
|
21
22
|
export { Progress, progressTones, type ProgressProps, type ProgressTone, } from './components/Progress.js';
|
|
@@ -31,6 +32,7 @@ export { LineChart, type LineChartCurve, type LineChartMarker, type LineChartPer
|
|
|
31
32
|
export { DataBar, type DataBarProps, type DataBarTone, dataBarTones, } from './components/DataBar.js';
|
|
32
33
|
export { Pagination, type PaginationLabels, type PaginationProps, } from './components/Pagination.js';
|
|
33
34
|
export { Button, type ButtonDisabledAppearance, type ButtonProps, type ButtonSize, type ButtonVariant, type ButtonWidth, } from './components/Button.js';
|
|
35
|
+
export { ButtonLink, type ButtonLinkProps } from './components/ButtonLink.js';
|
|
34
36
|
export { buttonWidths } from './css/css-button-width.js';
|
|
35
37
|
export { buttonDisabledAppearances, webButtonVariants, } from './css/css-button.js';
|
|
36
38
|
export { Box, type BoxBorder, type BoxElement, type BoxLink, type BoxProps, } from './components/Box.js';
|
|
@@ -52,6 +54,12 @@ export { Split } from './components/Split.js';
|
|
|
52
54
|
export type { SplitProps } from './components/Split.js';
|
|
53
55
|
export { Nav, navAppearances, type NavAppearance, type NavProps, } from './components/Nav.js';
|
|
54
56
|
export { NavCount, navCountTones, type NavCountProps, type NavCountTone, } from './components/NavCount.js';
|
|
57
|
+
export { FixtureGroup, type FixtureGroupProps, } from './components/FixtureGroup.js';
|
|
58
|
+
export { FixtureRow, type FixtureRowProps, type FixtureSide, type FixtureStatus, } from './components/FixtureRow.js';
|
|
59
|
+
export { CommandPalette, commandPaletteShortcuts, type CommandPaletteGroup, type CommandPaletteItem, type CommandPaletteProps, type CommandPaletteShortcut, } from './components/CommandPalette.js';
|
|
60
|
+
export { CommandPaletteTrigger, type CommandPaletteTriggerProps, } from './components/CommandPaletteTrigger.js';
|
|
61
|
+
export { ContextSwitcher, contextSwitcherTriggerAppearances, contextSwitcherWidths, type ContextSwitcherAction, type ContextSwitcherBadge, type ContextSwitcherFilter, type ContextSwitcherGroup, type ContextSwitcherOption, type ContextSwitcherProps, type ContextSwitcherTriggerAppearance, type ContextSwitcherWidth, } from './components/ContextSwitcher.js';
|
|
62
|
+
export { AppShell, type AppShellLabels, type AppShellNavGroup, type AppShellNavItem, type AppShellProps, } from './components/AppShell.js';
|
|
55
63
|
export { SectionNav, sectionNavAppearances, type SectionNavAppearance, type SectionNavItem, type SectionNavProps, } from './components/SectionNav.js';
|
|
56
64
|
export { SegmentedControl, type SegmentedControlProps, type SegmentedControlVariant, segmentedSizes, type SegmentedSize, type SegmentedItem, } from './components/SegmentedControl.js';
|
|
57
65
|
export { Combobox, comboboxSizes, type ComboboxAction, type ComboboxBadge, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type ComboboxSize, } from './components/Combobox.js';
|
|
@@ -67,6 +75,12 @@ export { utilityClassCatalog } from './css/stylesheet.js';
|
|
|
67
75
|
export type { VisibilityProps } from './visibility-classes.js';
|
|
68
76
|
export type { Breakpoint, BreakpointDirection, VisibilityBreakpoint, } from './css/breakpoints.js';
|
|
69
77
|
export { breakpointQuery } from './css/breakpoints.js';
|
|
78
|
+
export { Band, bandElements, bandTones, bandWidths, } from './components/Band.js';
|
|
79
|
+
export type { BandElement, BandProps, BandTone, BandWidth, } from './components/Band.js';
|
|
80
|
+
export { SiteHeader } from './components/SiteHeader.js';
|
|
81
|
+
export type { SiteHeaderItem, SiteHeaderLabels, SiteHeaderProps, } from './components/SiteHeader.js';
|
|
82
|
+
export { SiteFooter } from './components/SiteFooter.js';
|
|
83
|
+
export type { SiteFooterGroup, SiteFooterLink, SiteFooterProps, } from './components/SiteFooter.js';
|
|
70
84
|
export { Separator } from './components/Separator.js';
|
|
71
85
|
export type { SeparatorOrientation, SeparatorProps, } from './components/Separator.js';
|
|
72
86
|
export { DescriptionItem, DescriptionList, descriptionListLayouts, } from './components/DescriptionList.js';
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { listGroupVariants, listRowTitleAppearances, listRowTones, listRowValueT
|
|
|
15
15
|
export { listTileColumnCounts, } from './css/css-list-tiles.js';
|
|
16
16
|
export { Checkbox } from './components/Checkbox.js';
|
|
17
17
|
export { Spinner, } from './components/Spinner.js';
|
|
18
|
+
export { Skeleton, skeletonVariants, } from './components/Skeleton.js';
|
|
18
19
|
export { GlyphTile, glyphTileSizes, } from './components/GlyphTile.js';
|
|
19
20
|
export { Notice, noticeTones, noticeVariants, } from './components/Notice.js';
|
|
20
21
|
export { Progress, progressTones, } from './components/Progress.js';
|
|
@@ -30,6 +31,7 @@ export { LineChart, lineChartCurves, } from './components/LineChart.js';
|
|
|
30
31
|
export { DataBar, dataBarTones, } from './components/DataBar.js';
|
|
31
32
|
export { Pagination, } from './components/Pagination.js';
|
|
32
33
|
export { Button, } from './components/Button.js';
|
|
34
|
+
export { ButtonLink } from './components/ButtonLink.js';
|
|
33
35
|
export { buttonWidths } from './css/css-button-width.js';
|
|
34
36
|
export { buttonDisabledAppearances, webButtonVariants, } from './css/css-button.js';
|
|
35
37
|
export { Box, } from './components/Box.js';
|
|
@@ -49,6 +51,12 @@ export { Inline } from './components/Inline.js';
|
|
|
49
51
|
export { Split } from './components/Split.js';
|
|
50
52
|
export { Nav, navAppearances, } from './components/Nav.js';
|
|
51
53
|
export { NavCount, navCountTones, } from './components/NavCount.js';
|
|
54
|
+
export { FixtureGroup, } from './components/FixtureGroup.js';
|
|
55
|
+
export { FixtureRow, } from './components/FixtureRow.js';
|
|
56
|
+
export { CommandPalette, commandPaletteShortcuts, } from './components/CommandPalette.js';
|
|
57
|
+
export { CommandPaletteTrigger, } from './components/CommandPaletteTrigger.js';
|
|
58
|
+
export { ContextSwitcher, contextSwitcherTriggerAppearances, contextSwitcherWidths, } from './components/ContextSwitcher.js';
|
|
59
|
+
export { AppShell, } from './components/AppShell.js';
|
|
52
60
|
export { SectionNav, sectionNavAppearances, } from './components/SectionNav.js';
|
|
53
61
|
export { SegmentedControl, segmentedSizes, } from './components/SegmentedControl.js';
|
|
54
62
|
export { Combobox, comboboxSizes, } from './components/Combobox.js';
|
|
@@ -61,6 +69,9 @@ export { ThemeProvider, useTheme, } from './theme/ThemeProvider.js';
|
|
|
61
69
|
export { themeCanvases } from './css/css-canvas-grouped.js';
|
|
62
70
|
export { utilityClassCatalog } from './css/stylesheet.js';
|
|
63
71
|
export { breakpointQuery } from './css/breakpoints.js';
|
|
72
|
+
export { Band, bandElements, bandTones, bandWidths, } from './components/Band.js';
|
|
73
|
+
export { SiteHeader } from './components/SiteHeader.js';
|
|
74
|
+
export { SiteFooter } from './components/SiteFooter.js';
|
|
64
75
|
export { Separator } from './components/Separator.js';
|
|
65
76
|
export { DescriptionItem, DescriptionList, descriptionListLayouts, } from './components/DescriptionList.js';
|
|
66
77
|
export { Grid } from './components/Grid.js';
|