@scalewing/react 1.45.0 → 1.47.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 +16 -0
- package/README.md +105 -3
- package/dist/app-shell.test-support.d.ts +5 -0
- package/dist/app-shell.test-support.js +45 -0
- package/dist/components/AppShell.d.ts +12 -0
- package/dist/components/AppShell.js +48 -0
- package/dist/components/Button.d.ts +14 -1
- package/dist/components/Button.js +5 -2
- package/dist/components/FileField.d.ts +18 -2
- package/dist/components/FileField.js +26 -22
- package/dist/components/ListGroup.d.ts +8 -3
- package/dist/components/ListGroup.js +13 -5
- 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/Select.d.ts +8 -5
- package/dist/components/Select.js +7 -4
- 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 +87 -0
- package/dist/components/app-shell/types.js +1 -0
- package/dist/components/app-shell/validate.d.ts +6 -0
- package/dist/components/app-shell/validate.js +52 -0
- package/dist/components/file-field/ChosenFile.d.ts +45 -0
- package/dist/components/file-field/ChosenFile.js +48 -0
- package/dist/components/file-field/file-field-checks.d.ts +5 -2
- package/dist/components/file-field/file-field-checks.js +7 -2
- package/dist/components/nav-items.d.ts +21 -0
- package/dist/components/nav-items.js +26 -0
- package/dist/components/select/select-naming.d.ts +34 -0
- package/dist/components/select/select-naming.js +22 -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.d.ts +4 -0
- package/dist/css/css-app-shell.js +150 -0
- package/dist/css/css-button-width.d.ts +11 -0
- package/dist/css/css-button-width.js +36 -0
- package/dist/css/css-button.js +3 -0
- package/dist/css/css-components.js +3 -0
- package/dist/css/css-count-pill.d.ts +7 -0
- package/dist/css/css-count-pill.js +42 -12
- package/dist/css/css-file-field-compact.d.ts +2 -0
- package/dist/css/css-file-field-compact.js +106 -0
- package/dist/css/css-file-field.js +4 -0
- package/dist/css/css-list-tiles.d.ts +6 -0
- package/dist/css/css-list-tiles.js +50 -0
- package/dist/css/css-list.js +5 -1
- package/dist/css/stylesheet.js +2 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +3 -0
- package/dist/list-options.d.ts +12 -5
- package/dist/list-options.js +19 -5
- package/dist/styles.css +443 -7
- package/package.json +1 -1
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
import { typographyVariants } from '@scalewing/tokens';
|
|
2
|
+
import { toneTintFill, toneTintInk } from './tone-tint.js';
|
|
2
3
|
const caption = typographyVariants.caption;
|
|
3
|
-
/** The counts drawn as the pill: SectionNav's
|
|
4
|
-
const pills = [
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
/** The counts drawn as the pill: SectionNav's, a Nav word's and AppShell's. */
|
|
5
|
+
const pills = [
|
|
6
|
+
'sw-section-nav-count',
|
|
7
|
+
'sw-nav-count',
|
|
8
|
+
'sw-app-shell-count',
|
|
9
|
+
];
|
|
10
|
+
/** The pills that take a tone modifier: NavCount's and AppShell's item count. */
|
|
11
|
+
const tonedPills = ['sw-nav-count', 'sw-app-shell-count'];
|
|
12
|
+
/** The tones other than the pill's own danger. */
|
|
13
|
+
const pillTones = ['accent', 'warning'];
|
|
14
|
+
/** A toned pill's modifier class, such as `sw-nav-count-warning`. */
|
|
15
|
+
export function countToneClass(pill, tone) {
|
|
16
|
+
return `${pill}-${tone}`;
|
|
17
|
+
}
|
|
18
|
+
function tonedSelector(tone) {
|
|
19
|
+
return tonedPills
|
|
20
|
+
.map((pill) => `[data-theme] .${pill}.${countToneClass(pill, tone)}`)
|
|
21
|
+
.join(',\n');
|
|
22
|
+
}
|
|
7
23
|
/*
|
|
8
24
|
* A count after a destination's words (a number waiting there, such as
|
|
9
25
|
* tasks to do) is a filled pill: the danger colour with its on-colour
|
|
10
26
|
* figures (4.5:1 in every palette, as a danger Button's label), caption
|
|
11
27
|
* size at weight 700, a space-5 less space-1 (20) high and at least as
|
|
12
|
-
* wide. Forced colours draw its edge. SectionNav's item count
|
|
13
|
-
* NavCount share it, so an area's count reads
|
|
28
|
+
* wide. Forced colours draw its edge. SectionNav's item count, Nav's
|
|
29
|
+
* NavCount and AppShell's item count share it, so an area's count reads
|
|
30
|
+
* the same in each.
|
|
14
31
|
*/
|
|
15
32
|
export function cssCountPillClasses() {
|
|
16
33
|
const selector = pills.map((name) => `[data-theme] .${name}`).join(',\n');
|
|
@@ -33,16 +50,26 @@ export function cssCountPillClasses() {
|
|
|
33
50
|
}
|
|
34
51
|
|
|
35
52
|
/*
|
|
36
|
-
*
|
|
37
|
-
* was added since the person last looked),
|
|
38
|
-
* on-colour figures (4.5:1 in every palette, as
|
|
39
|
-
*
|
|
53
|
+
* \`tone="accent"\` (NavCount, an AppShell item's \`countTone\`): a count that
|
|
54
|
+
* is news, not work waiting (what was added since the person last looked),
|
|
55
|
+
* is the accent fill with its on-colour figures (4.5:1 in every palette, as
|
|
56
|
+
* a primary Button's label). \`tone="warning"\`: work that needs the person
|
|
57
|
+
* but is not urgent is amber, the warning tint with the warning ink (a
|
|
58
|
+
* warning Notice's, 4.5:1 on the tint in every palette) inside the warning
|
|
59
|
+
* edge a warning Badge draws. One class more specific than the pill, so
|
|
60
|
+
* each wins in any order.
|
|
40
61
|
*/
|
|
41
|
-
|
|
62
|
+
${tonedSelector('accent')} {
|
|
42
63
|
background: var(--sw-color-accent);
|
|
43
64
|
color: var(--sw-color-onAccent);
|
|
44
65
|
}
|
|
45
66
|
|
|
67
|
+
${tonedSelector('warning')} {
|
|
68
|
+
background: ${toneTintFill('warning')};
|
|
69
|
+
border: 1px solid var(--sw-color-warning);
|
|
70
|
+
color: ${toneTintInk('warning')};
|
|
71
|
+
}
|
|
72
|
+
|
|
46
73
|
/*
|
|
47
74
|
* A Nav link holding a count lays out as SectionNav's link does: the words
|
|
48
75
|
* and the pill centred on one line a space-2 apart (the space text node
|
|
@@ -63,5 +90,8 @@ export function cssCountPillClasses() {
|
|
|
63
90
|
}`;
|
|
64
91
|
}
|
|
65
92
|
export function countPillClassCatalog() {
|
|
66
|
-
return [
|
|
93
|
+
return [
|
|
94
|
+
...pills,
|
|
95
|
+
...tonedPills.flatMap((pill) => pillTones.map((tone) => countToneClass(pill, tone))),
|
|
96
|
+
];
|
|
67
97
|
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { typographyVariants } from '@scalewing/tokens';
|
|
2
|
+
import { touchTarget } from './touch-target.js';
|
|
3
|
+
const body = typographyVariants.body;
|
|
4
|
+
/*
|
|
5
|
+
* Remove beside a chosen file in the full field: the change button and
|
|
6
|
+
* Remove together at the row's end, a space-2 apart.
|
|
7
|
+
*/
|
|
8
|
+
function actionsRules() {
|
|
9
|
+
return `.sw-file-field-actions {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex: none;
|
|
12
|
+
flex-wrap: wrap;
|
|
13
|
+
gap: var(--sw-space-2);
|
|
14
|
+
margin-inline-start: auto;
|
|
15
|
+
}`;
|
|
16
|
+
}
|
|
17
|
+
/*
|
|
18
|
+
* A compact field is a text field's height (the md control, 44 px), on
|
|
19
|
+
* one line. Empty, its zone holds the choose words at its start. Chosen,
|
|
20
|
+
* the row is the change button (the thumbnail or mark a space-1 from the
|
|
21
|
+
* frame's start, then the name in the body weight cut to one line) and a
|
|
22
|
+
* quiet Remove at its end. The button's focus ring sits inside the frame.
|
|
23
|
+
*/
|
|
24
|
+
function compactRules() {
|
|
25
|
+
return `.sw-file-field-compact.sw-file-field-chosen {
|
|
26
|
+
flex-wrap: nowrap;
|
|
27
|
+
gap: var(--sw-space-1);
|
|
28
|
+
min-height: ${touchTarget};
|
|
29
|
+
padding-block: 0;
|
|
30
|
+
padding-inline: 0 var(--sw-space-1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.sw-file-field-compact .sw-file-field-zone {
|
|
34
|
+
justify-content: flex-start;
|
|
35
|
+
padding: var(--sw-space-2) var(--sw-space-4);
|
|
36
|
+
text-align: start;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.sw-file-field-pick {
|
|
40
|
+
align-items: center;
|
|
41
|
+
appearance: none;
|
|
42
|
+
background: transparent;
|
|
43
|
+
border: 0;
|
|
44
|
+
border-radius: inherit;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
color: var(--sw-color-text);
|
|
47
|
+
cursor: pointer;
|
|
48
|
+
display: flex;
|
|
49
|
+
flex: 1 1 auto;
|
|
50
|
+
font-family: var(--sw-font-sans);
|
|
51
|
+
gap: var(--sw-space-3);
|
|
52
|
+
margin: 0;
|
|
53
|
+
min-height: ${touchTarget};
|
|
54
|
+
min-width: 0;
|
|
55
|
+
padding-block: var(--sw-space-1);
|
|
56
|
+
padding-inline: var(--sw-space-1) var(--sw-space-2);
|
|
57
|
+
text-align: start;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.sw-file-field-pick:focus { outline: none; }
|
|
61
|
+
|
|
62
|
+
.sw-file-field-pick:focus-visible {
|
|
63
|
+
outline: var(--sw-focus-ring-width) solid var(--sw-color-accent);
|
|
64
|
+
outline-offset: calc(-1 * var(--sw-focus-ring-width));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.sw-file-field-pick:disabled { cursor: not-allowed; }
|
|
68
|
+
|
|
69
|
+
.sw-file-field-pick .sw-file-field-name {
|
|
70
|
+
font-weight: ${body.fontWeight};
|
|
71
|
+
min-width: 0;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
overflow-wrap: normal;
|
|
74
|
+
text-overflow: ellipsis;
|
|
75
|
+
white-space: nowrap;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* With no thumbnail or mark, the name starts where a text field's words do. */
|
|
79
|
+
.sw-file-field-pick > .sw-file-field-name:first-child { margin-inline-start: var(--sw-space-3); }
|
|
80
|
+
|
|
81
|
+
.sw-file-field-compact .sw-file-field-preview,
|
|
82
|
+
.sw-file-field-compact .sw-file-field-icon { margin-inline-start: var(--sw-space-1); }
|
|
83
|
+
|
|
84
|
+
.sw-file-field-remove { flex: none; }
|
|
85
|
+
|
|
86
|
+
@media (forced-colors: active) {
|
|
87
|
+
.sw-file-field-pick { color: ButtonText; }
|
|
88
|
+
.sw-file-field-pick:disabled { color: GrayText; }
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* Disabled, the row fades as its Remove does. */
|
|
92
|
+
.sw-file-field-pick:disabled { opacity: var(--sw-disabled-opacity); }`;
|
|
93
|
+
}
|
|
94
|
+
export function cssFileFieldCompactClasses() {
|
|
95
|
+
return `${actionsRules()}
|
|
96
|
+
|
|
97
|
+
${compactRules()}`;
|
|
98
|
+
}
|
|
99
|
+
export function fileFieldCompactClassCatalog() {
|
|
100
|
+
return [
|
|
101
|
+
'sw-file-field-actions',
|
|
102
|
+
'sw-file-field-compact',
|
|
103
|
+
'sw-file-field-pick',
|
|
104
|
+
'sw-file-field-remove',
|
|
105
|
+
];
|
|
106
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { typographyVariants } from '@scalewing/tokens';
|
|
2
2
|
import { disabledControlSurface } from './css-document.js';
|
|
3
|
+
import { cssFileFieldCompactClasses, fileFieldCompactClassCatalog, } from './css-file-field-compact.js';
|
|
3
4
|
import { coarsePointerQuery, touchTarget } from './touch-target.js';
|
|
4
5
|
const label = typographyVariants.label;
|
|
5
6
|
const caption = typographyVariants.caption;
|
|
@@ -172,6 +173,8 @@ ${zoneRules()}
|
|
|
172
173
|
|
|
173
174
|
${fileRules()}
|
|
174
175
|
|
|
176
|
+
${cssFileFieldCompactClasses()}
|
|
177
|
+
|
|
175
178
|
${forcedColorRules()}`;
|
|
176
179
|
}
|
|
177
180
|
export function fileFieldClassCatalog() {
|
|
@@ -190,5 +193,6 @@ export function fileFieldClassCatalog() {
|
|
|
190
193
|
'sw-file-field-file',
|
|
191
194
|
'sw-file-field-name',
|
|
192
195
|
'sw-file-field-detail',
|
|
196
|
+
...fileFieldCompactClassCatalog(),
|
|
193
197
|
];
|
|
194
198
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** How many tiles share a row from `md` up; one a row below it. */
|
|
2
|
+
export declare const listTileColumnCounts: readonly [2, 3, 4];
|
|
3
|
+
export type ListGroupTileColumns = (typeof listTileColumnCounts)[number];
|
|
4
|
+
export declare function listTileColumnsClass(columns: ListGroupTileColumns): string;
|
|
5
|
+
export declare function cssListTilesClasses(): string;
|
|
6
|
+
export declare function listTilesClassCatalog(): string[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { breakpointQuery } from './breakpoints.js';
|
|
2
|
+
/** How many tiles share a row from `md` up; one a row below it. */
|
|
3
|
+
export const listTileColumnCounts = [2, 3, 4];
|
|
4
|
+
export function listTileColumnsClass(columns) {
|
|
5
|
+
return `sw-list-group-tiles-${columns}`;
|
|
6
|
+
}
|
|
7
|
+
const tiles = '.sw-list-group-tiles';
|
|
8
|
+
/*
|
|
9
|
+
* A tiled ListGroup is still one list (`sw-list`), its rows laid out as
|
|
10
|
+
* tiles: equal columns a space-3 apart from `md` up, one column below it,
|
|
11
|
+
* each row its own bordered panel on the surface (the panel variant's
|
|
12
|
+
* look, per row), with no hairlines between them. A row's press fill and
|
|
13
|
+
* its inset focus ring stay inside its tile.
|
|
14
|
+
*
|
|
15
|
+
* Generated after the list's hairline rules (css-list.ts), whose
|
|
16
|
+
* `.sw-list > .sw-list-item + .sw-list-item` has the same specificity as
|
|
17
|
+
* the tile rule: being later is what lets a tile's own border replace the
|
|
18
|
+
* hairline. `list-group-tiles.test.tsx` holds that order.
|
|
19
|
+
*/
|
|
20
|
+
export function cssListTilesClasses() {
|
|
21
|
+
const columns = listTileColumnCounts.map((count) => `.${listTileColumnsClass(count)} > .sw-list { grid-template-columns: repeat(${count}, minmax(0, 1fr)); }`);
|
|
22
|
+
return `${tiles} > .sw-list {
|
|
23
|
+
display: grid;
|
|
24
|
+
gap: var(--sw-space-3);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
${columns.join('\n')}
|
|
28
|
+
|
|
29
|
+
${tiles} > .sw-list > .sw-list-item {
|
|
30
|
+
background: var(--sw-color-surface);
|
|
31
|
+
border: 1px solid var(--sw-color-border);
|
|
32
|
+
border-radius: var(--sw-radius-md);
|
|
33
|
+
min-width: 0;
|
|
34
|
+
overflow: clip;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media ${breakpointQuery('below', 'md')} {
|
|
38
|
+
${tiles} > .sw-list { grid-template-columns: minmax(0, 1fr); }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media (forced-colors: active) {
|
|
42
|
+
${tiles} > .sw-list > .sw-list-item { border-color: CanvasText; }
|
|
43
|
+
}`;
|
|
44
|
+
}
|
|
45
|
+
export function listTilesClassCatalog() {
|
|
46
|
+
return [
|
|
47
|
+
'sw-list-group-tiles',
|
|
48
|
+
...listTileColumnCounts.map((count) => listTileColumnsClass(count)),
|
|
49
|
+
];
|
|
50
|
+
}
|
package/dist/css/css-list.js
CHANGED
|
@@ -2,6 +2,7 @@ import { typographyVariants } from '@scalewing/tokens';
|
|
|
2
2
|
import { cssListRowClasses, listRowClassCatalog } from './css-list-row.js';
|
|
3
3
|
import { cssListRowTrailingClasses, listRowTrailingClassCatalog, } from './css-list-row-trailing.js';
|
|
4
4
|
import { cssListRowTruncateClasses, listRowTruncateClassCatalog, } from './css-list-row-truncate.js';
|
|
5
|
+
import { cssListTilesClasses, listTilesClassCatalog, } from './css-list-tiles.js';
|
|
5
6
|
import { blockEdgeShadeRules, scrollRegionRules } from './css-scroll-region.js';
|
|
6
7
|
const label = typographyVariants.label;
|
|
7
8
|
const caption = typographyVariants.caption;
|
|
@@ -75,7 +76,9 @@ ${cssListRowClasses()}
|
|
|
75
76
|
|
|
76
77
|
${cssListRowTrailingClasses()}
|
|
77
78
|
|
|
78
|
-
${cssListRowTruncateClasses()}
|
|
79
|
+
${cssListRowTruncateClasses()}
|
|
80
|
+
|
|
81
|
+
${cssListTilesClasses()}`;
|
|
79
82
|
}
|
|
80
83
|
export function listClassCatalog() {
|
|
81
84
|
return [
|
|
@@ -86,6 +89,7 @@ export function listClassCatalog() {
|
|
|
86
89
|
'sw-list-group-plain',
|
|
87
90
|
'sw-list-group-scroll',
|
|
88
91
|
'sw-list-group-footer',
|
|
92
|
+
...listTilesClassCatalog(),
|
|
89
93
|
...listRowClassCatalog(),
|
|
90
94
|
...listRowTrailingClassCatalog(),
|
|
91
95
|
...listRowTruncateClassCatalog(),
|
package/dist/css/stylesheet.js
CHANGED
|
@@ -50,6 +50,7 @@ import { segmentedClassCatalog } from './css-segmented.js';
|
|
|
50
50
|
import { tableClassCatalog } from './css-table.js';
|
|
51
51
|
import { chromeClassCatalog } from './css-chrome.js';
|
|
52
52
|
import { sectionNavClassCatalog } from './css-section-nav.js';
|
|
53
|
+
import { appShellClassCatalog } from './css-app-shell.js';
|
|
53
54
|
import { dialogClassCatalog } from './css-dialog.js';
|
|
54
55
|
import { dialogBandedClassCatalog } from './css-dialog-banded.js';
|
|
55
56
|
import { dialogFrameClassCatalog } from './css-dialog-frame.js';
|
|
@@ -93,6 +94,7 @@ export function utilityClassCatalog() {
|
|
|
93
94
|
...paginationClassCatalog(),
|
|
94
95
|
...chromeClassCatalog(),
|
|
95
96
|
...sectionNavClassCatalog(),
|
|
97
|
+
...appShellClassCatalog(),
|
|
96
98
|
...dialogClassCatalog(),
|
|
97
99
|
...dialogFrameClassCatalog(),
|
|
98
100
|
...dialogBandedClassCatalog(),
|
package/dist/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export { ListGroup, type ListGroupProps } from './components/ListGroup.js';
|
|
|
13
13
|
export { inspectMarkdown, markdownOmissionKinds, MarkdownView, type MarkdownHeading, type MarkdownInspection, type MarkdownImage, type MarkdownImageResolver, type MarkdownOmission, type MarkdownOmissionCounts, type MarkdownOmissionKind, type MarkdownOptions, type MarkdownViewProps, } from './components/MarkdownView.js';
|
|
14
14
|
export { ListRow, type ListRowProps } from './components/ListRow.js';
|
|
15
15
|
export { listGroupVariants, listRowTitleAppearances, listRowTones, listRowValueTones, type ListGroupMaxHeight, type ListGroupVariant, type ListRowTitleAppearance, type ListRowTone, type ListRowValueTone, } from './list-options.js';
|
|
16
|
+
export { listTileColumnCounts, type ListGroupTileColumns, } from './css/css-list-tiles.js';
|
|
16
17
|
export { Checkbox, type CheckboxProps } from './components/Checkbox.js';
|
|
17
18
|
export { Spinner, type SpinnerProps, type SpinnerSize, } from './components/Spinner.js';
|
|
18
19
|
export { GlyphTile, glyphTileSizes, type GlyphTileHue, type GlyphTileProps, type GlyphTileSize, } from './components/GlyphTile.js';
|
|
@@ -29,7 +30,8 @@ export { ColumnChart, type ColumnChartCallout, type ColumnChartLine, type Column
|
|
|
29
30
|
export { LineChart, type LineChartCurve, type LineChartMarker, type LineChartPeriod, type LineChartPoint, type LineChartProps, lineChartCurves, } from './components/LineChart.js';
|
|
30
31
|
export { DataBar, type DataBarProps, type DataBarTone, dataBarTones, } from './components/DataBar.js';
|
|
31
32
|
export { Pagination, type PaginationLabels, type PaginationProps, } from './components/Pagination.js';
|
|
32
|
-
export { Button, type ButtonDisabledAppearance, type ButtonProps, type ButtonSize, type ButtonVariant, } from './components/Button.js';
|
|
33
|
+
export { Button, type ButtonDisabledAppearance, type ButtonProps, type ButtonSize, type ButtonVariant, type ButtonWidth, } from './components/Button.js';
|
|
34
|
+
export { buttonWidths } from './css/css-button-width.js';
|
|
33
35
|
export { buttonDisabledAppearances, webButtonVariants, } from './css/css-button.js';
|
|
34
36
|
export { Box, type BoxBorder, type BoxElement, type BoxLink, type BoxProps, } from './components/Box.js';
|
|
35
37
|
export { boxLinkAppearances } from './css/css-box-link.js';
|
|
@@ -50,6 +52,7 @@ export { Split } from './components/Split.js';
|
|
|
50
52
|
export type { SplitProps } from './components/Split.js';
|
|
51
53
|
export { Nav, navAppearances, type NavAppearance, type NavProps, } from './components/Nav.js';
|
|
52
54
|
export { NavCount, navCountTones, type NavCountProps, type NavCountTone, } from './components/NavCount.js';
|
|
55
|
+
export { AppShell, type AppShellLabels, type AppShellNavGroup, type AppShellNavItem, type AppShellProps, } from './components/AppShell.js';
|
|
53
56
|
export { SectionNav, sectionNavAppearances, type SectionNavAppearance, type SectionNavItem, type SectionNavProps, } from './components/SectionNav.js';
|
|
54
57
|
export { SegmentedControl, type SegmentedControlProps, type SegmentedControlVariant, segmentedSizes, type SegmentedSize, type SegmentedItem, } from './components/SegmentedControl.js';
|
|
55
58
|
export { Combobox, comboboxSizes, type ComboboxAction, type ComboboxBadge, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type ComboboxSize, } from './components/Combobox.js';
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { ListGroup } from './components/ListGroup.js';
|
|
|
12
12
|
export { inspectMarkdown, markdownOmissionKinds, MarkdownView, } from './components/MarkdownView.js';
|
|
13
13
|
export { ListRow } from './components/ListRow.js';
|
|
14
14
|
export { listGroupVariants, listRowTitleAppearances, listRowTones, listRowValueTones, } from './list-options.js';
|
|
15
|
+
export { listTileColumnCounts, } from './css/css-list-tiles.js';
|
|
15
16
|
export { Checkbox } from './components/Checkbox.js';
|
|
16
17
|
export { Spinner, } from './components/Spinner.js';
|
|
17
18
|
export { GlyphTile, glyphTileSizes, } from './components/GlyphTile.js';
|
|
@@ -29,6 +30,7 @@ export { LineChart, lineChartCurves, } from './components/LineChart.js';
|
|
|
29
30
|
export { DataBar, dataBarTones, } from './components/DataBar.js';
|
|
30
31
|
export { Pagination, } from './components/Pagination.js';
|
|
31
32
|
export { Button, } from './components/Button.js';
|
|
33
|
+
export { buttonWidths } from './css/css-button-width.js';
|
|
32
34
|
export { buttonDisabledAppearances, webButtonVariants, } from './css/css-button.js';
|
|
33
35
|
export { Box, } from './components/Box.js';
|
|
34
36
|
export { boxLinkAppearances } from './css/css-box-link.js';
|
|
@@ -47,6 +49,7 @@ export { Inline } from './components/Inline.js';
|
|
|
47
49
|
export { Split } from './components/Split.js';
|
|
48
50
|
export { Nav, navAppearances, } from './components/Nav.js';
|
|
49
51
|
export { NavCount, navCountTones, } from './components/NavCount.js';
|
|
52
|
+
export { AppShell, } from './components/AppShell.js';
|
|
50
53
|
export { SectionNav, sectionNavAppearances, } from './components/SectionNav.js';
|
|
51
54
|
export { SegmentedControl, segmentedSizes, } from './components/SegmentedControl.js';
|
|
52
55
|
export { Combobox, comboboxSizes, } from './components/Combobox.js';
|
package/dist/list-options.d.ts
CHANGED
|
@@ -4,9 +4,11 @@ import { listRowValueTones, type ListRowValueTone } from './css/css-list-row.js'
|
|
|
4
4
|
/**
|
|
5
5
|
* `panel` (the default) is one bordered panel on the surface; `plain`
|
|
6
6
|
* draws no panel and a hairline above the first row too, for rows inside
|
|
7
|
-
* a surface that already has one, such as a Card
|
|
7
|
+
* a surface that already has one, such as a Card; `tiles` lays the rows
|
|
8
|
+
* out as tiles, each its own panel, in equal columns (one a row below
|
|
9
|
+
* `md`).
|
|
8
10
|
*/
|
|
9
|
-
export declare const listGroupVariants: readonly ["panel", "plain"];
|
|
11
|
+
export declare const listGroupVariants: readonly ["panel", "plain", "tiles"];
|
|
10
12
|
export type ListGroupVariant = (typeof listGroupVariants)[number];
|
|
11
13
|
/**
|
|
12
14
|
* A list's bounded height, counted in rows: as tall as `rows` rows of a
|
|
@@ -30,13 +32,18 @@ export type ListGroupInput = {
|
|
|
30
32
|
labelledBy: string | undefined;
|
|
31
33
|
variant: unknown;
|
|
32
34
|
maxHeight: ListGroupMaxHeight | undefined;
|
|
35
|
+
tileColumns: unknown;
|
|
36
|
+
hasFooter: boolean;
|
|
33
37
|
};
|
|
34
38
|
/**
|
|
35
39
|
* Fails closed on a ListGroup it cannot draw: an unknown variant, a
|
|
36
|
-
* `maxHeight` that is not a whole row count from 1,
|
|
37
|
-
* no name (its scroll region is a keyboard stop and must say what it
|
|
40
|
+
* `maxHeight` that is not a whole row count from 1, a bounded list with
|
|
41
|
+
* no name (its scroll region is a keyboard stop and must say what it
|
|
42
|
+
* holds), `tileColumns` other than 2, 3 or 4 or on a list that is not
|
|
43
|
+
* tiles, or tiles with `maxHeight` or a `footer` (tiles neither scroll as
|
|
44
|
+
* rows nor add up to a total).
|
|
38
45
|
*/
|
|
39
|
-
export declare function assertListGroup({ label, labelledBy, variant, maxHeight, }: ListGroupInput): void;
|
|
46
|
+
export declare function assertListGroup({ label, labelledBy, variant, maxHeight, tileColumns, hasFooter, }: ListGroupInput): void;
|
|
40
47
|
/** The row count the generated `sw-list-group-scroll` height reads. */
|
|
41
48
|
export declare function listMaxHeightStyle(maxHeight: ListGroupMaxHeight): CSSProperties;
|
|
42
49
|
export type ListRowInput = {
|
package/dist/list-options.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { badgeTones } from './css/css-data.js';
|
|
2
2
|
import { listRowValueTones, } from './css/css-list-row.js';
|
|
3
|
+
import { listTileColumnCounts } from './css/css-list-tiles.js';
|
|
3
4
|
import { isOneOf } from './is-one-of.js';
|
|
4
5
|
/**
|
|
5
6
|
* `panel` (the default) is one bordered panel on the surface; `plain`
|
|
6
7
|
* draws no panel and a hairline above the first row too, for rows inside
|
|
7
|
-
* a surface that already has one, such as a Card
|
|
8
|
+
* a surface that already has one, such as a Card; `tiles` lays the rows
|
|
9
|
+
* out as tiles, each its own panel, in equal columns (one a row below
|
|
10
|
+
* `md`).
|
|
8
11
|
*/
|
|
9
|
-
export const listGroupVariants = ['panel', 'plain'];
|
|
12
|
+
export const listGroupVariants = ['panel', 'plain', 'tiles'];
|
|
10
13
|
/** `danger` draws the title in the danger colour, for a row that ends something. */
|
|
11
14
|
export const listRowTones = ['default', 'danger'];
|
|
12
15
|
/** `strong` (the default) sets the title at the label weight; `plain` at the body's. */
|
|
@@ -17,12 +20,23 @@ function isBlank(text) {
|
|
|
17
20
|
}
|
|
18
21
|
/**
|
|
19
22
|
* Fails closed on a ListGroup it cannot draw: an unknown variant, a
|
|
20
|
-
* `maxHeight` that is not a whole row count from 1,
|
|
21
|
-
* no name (its scroll region is a keyboard stop and must say what it
|
|
23
|
+
* `maxHeight` that is not a whole row count from 1, a bounded list with
|
|
24
|
+
* no name (its scroll region is a keyboard stop and must say what it
|
|
25
|
+
* holds), `tileColumns` other than 2, 3 or 4 or on a list that is not
|
|
26
|
+
* tiles, or tiles with `maxHeight` or a `footer` (tiles neither scroll as
|
|
27
|
+
* rows nor add up to a total).
|
|
22
28
|
*/
|
|
23
|
-
export function assertListGroup({ label, labelledBy, variant, maxHeight, }) {
|
|
29
|
+
export function assertListGroup({ label, labelledBy, variant, maxHeight, tileColumns, hasFooter, }) {
|
|
24
30
|
if (!isOneOf(listGroupVariants, variant))
|
|
25
31
|
throw new RangeError(`Unknown ListGroup variant: ${String(variant)}`);
|
|
32
|
+
if (tileColumns !== undefined) {
|
|
33
|
+
if (variant !== 'tiles')
|
|
34
|
+
throw new RangeError('ListGroup tileColumns needs variant="tiles"');
|
|
35
|
+
if (!listTileColumnCounts.includes(tileColumns))
|
|
36
|
+
throw new RangeError(`ListGroup tileColumns must be 2, 3 or 4: ${String(tileColumns)}`);
|
|
37
|
+
}
|
|
38
|
+
if (variant === 'tiles' && (maxHeight !== undefined || hasFooter))
|
|
39
|
+
throw new RangeError('A ListGroup of tiles takes no maxHeight or footer');
|
|
26
40
|
if (maxHeight === undefined)
|
|
27
41
|
return;
|
|
28
42
|
const rows = typeof maxHeight === 'object' && maxHeight !== null
|