@scalewing/react 1.29.0 → 1.31.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 +54 -0
- package/README.md +13 -3
- package/dist/components/ActionMenu.d.ts +14 -0
- package/dist/components/ActionMenu.js +4 -0
- package/dist/components/ButtonGroup.d.ts +9 -1
- package/dist/components/ButtonGroup.js +2 -2
- package/dist/components/Combobox.d.ts +14 -0
- package/dist/components/Combobox.js +125 -0
- package/dist/components/Field.d.ts +17 -0
- package/dist/components/Field.js +54 -5
- package/dist/components/FilterChips.d.ts +17 -1
- package/dist/components/FilterChips.js +11 -6
- package/dist/components/ScrollRegion.d.ts +6 -2
- package/dist/components/ScrollRegion.js +9 -3
- package/dist/components/SectionNav.d.ts +25 -2
- package/dist/components/SectionNav.js +13 -4
- package/dist/components/Table.d.ts +49 -5
- package/dist/components/Table.js +11 -4
- package/dist/components/action-menu/ActionMenuList.js +7 -7
- package/dist/components/combobox/ComboboxPopup.d.ts +25 -0
- package/dist/components/combobox/ComboboxPopup.js +68 -0
- package/dist/components/combobox/entries.d.ts +18 -0
- package/dist/components/combobox/entries.js +34 -0
- package/dist/components/combobox/types.d.ts +63 -0
- package/dist/components/combobox/types.js +1 -0
- package/dist/components/combobox/validate.d.ts +3 -0
- package/dist/components/combobox/validate.js +44 -0
- package/dist/components/field/SearchFrame.d.ts +16 -0
- package/dist/components/field/SearchFrame.js +32 -0
- package/dist/components/table/TableCell.d.ts +8 -0
- package/dist/components/table/TableCell.js +4 -2
- package/dist/components/table/TableRow.d.ts +39 -0
- package/dist/components/table/TableRow.js +8 -0
- package/dist/components/use-scroll-overflow.d.ts +8 -3
- package/dist/components/use-scroll-overflow.js +15 -4
- package/dist/css/css-action-menu.js +41 -0
- package/dist/css/css-button-group-attached.d.ts +2 -0
- package/dist/css/css-button-group-attached.js +70 -0
- package/dist/css/css-button.js +5 -1
- package/dist/css/css-combobox.d.ts +2 -0
- package/dist/css/css-combobox.js +135 -0
- package/dist/css/css-components.js +4 -0
- package/dist/css/css-field-search.d.ts +2 -0
- package/dist/css/css-field-search.js +118 -0
- package/dist/css/css-field.js +4 -0
- package/dist/css/css-filter-chips.js +26 -0
- package/dist/css/css-section-nav-filled.d.ts +6 -0
- package/dist/css/css-section-nav-filled.js +80 -0
- package/dist/css/css-section-nav.js +4 -0
- package/dist/css/css-table-footer.d.ts +2 -0
- package/dist/css/css-table-footer.js +57 -0
- package/dist/css/css-table-ledger.d.ts +10 -0
- package/dist/css/css-table-ledger.js +122 -0
- package/dist/css/css-table.js +8 -0
- package/dist/css/stacking.d.ts +9 -3
- package/dist/css/stacking.js +28 -8
- package/dist/css/stylesheet.js +2 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -3
- package/dist/styles.css +483 -7
- package/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { typographyVariants } from '@scalewing/tokens';
|
|
2
|
+
import { coarsePointerQuery, touchTarget } from './touch-target.js';
|
|
3
|
+
const caption = typographyVariants.caption;
|
|
4
|
+
const label = typographyVariants.label;
|
|
5
|
+
/** How a section navigation marks its current item. */
|
|
6
|
+
export const sectionNavAppearances = ['underline', 'filled'];
|
|
7
|
+
export function assertSectionNavAppearance(appearance) {
|
|
8
|
+
if (!sectionNavAppearances.includes(appearance))
|
|
9
|
+
throw new RangeError(`SectionNav appearance must be one of ${sectionNavAppearances.join(', ')}`);
|
|
10
|
+
}
|
|
11
|
+
/*
|
|
12
|
+
* `filled`: a quiet bar of page buttons, as an area's sub-navigation beside
|
|
13
|
+
* its name. No hairline under the row and no underline or start bar, in
|
|
14
|
+
* the row and the side list; every link is the sm control (32; the 44 px
|
|
15
|
+
* target on a coarse pointer) with the sm radius and the control's
|
|
16
|
+
* padding at weight 500, and the current one takes a soft muted fill in
|
|
17
|
+
* the text colour at the label weight (600), so it reads apart from a
|
|
18
|
+
* hovered link. A 2 px transparent border keeps room for forced colours,
|
|
19
|
+
* where the current link's border turns Highlight.
|
|
20
|
+
*
|
|
21
|
+
* A count after a label (a number waiting there) is a filled pill: the
|
|
22
|
+
* danger colour with its on-colour figures (4.5:1 in every palette, as a
|
|
23
|
+
* danger Button's label), caption size at weight 700, a space-5 less
|
|
24
|
+
* space-1 (20) high and at least as wide. Forced colours draw its edge.
|
|
25
|
+
*/
|
|
26
|
+
export function cssSectionNavFilledClasses() {
|
|
27
|
+
// Two classes, so every filled rule outranks the side list's (one class
|
|
28
|
+
// and :dir), not by source order alone.
|
|
29
|
+
const filled = '.sw-section-nav.sw-section-nav-filled';
|
|
30
|
+
return `${filled} .sw-section-nav-list {
|
|
31
|
+
border-bottom: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/* (0,4,0): outranks the underline and the side list's start bar. */
|
|
35
|
+
[data-theme] ${filled} .sw-section-nav-link {
|
|
36
|
+
border: 2px solid transparent;
|
|
37
|
+
border-radius: var(--sw-radius-sm);
|
|
38
|
+
font-weight: 500;
|
|
39
|
+
margin-bottom: 0;
|
|
40
|
+
min-height: var(--sw-control-sm-min-height);
|
|
41
|
+
padding-inline: var(--sw-control-sm-padding-inline);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[data-theme] ${filled} .sw-section-nav-link[aria-current] {
|
|
45
|
+
background: color-mix(in srgb, var(--sw-color-muted) 18%, transparent);
|
|
46
|
+
border-color: transparent;
|
|
47
|
+
color: var(--sw-color-text);
|
|
48
|
+
font-weight: ${label.fontWeight};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
[data-theme] .sw-section-nav-count {
|
|
52
|
+
align-items: center;
|
|
53
|
+
background: var(--sw-color-danger);
|
|
54
|
+
border-radius: var(--sw-radius-pill);
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
color: var(--sw-color-onDanger);
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
font-size: ${caption.fontSize}px;
|
|
59
|
+
font-variant-numeric: tabular-nums;
|
|
60
|
+
font-weight: 700;
|
|
61
|
+
justify-content: center;
|
|
62
|
+
letter-spacing: ${caption.letterSpacing}px;
|
|
63
|
+
line-height: 1;
|
|
64
|
+
min-height: calc(var(--sw-space-5) - var(--sw-space-1));
|
|
65
|
+
min-width: calc(var(--sw-space-5) - var(--sw-space-1));
|
|
66
|
+
padding-inline: var(--sw-space-1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media ${coarsePointerQuery} {
|
|
70
|
+
[data-theme] ${filled} .sw-section-nav-link { min-height: ${touchTarget}; }
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@media (forced-colors: active) {
|
|
74
|
+
[data-theme] ${filled} .sw-section-nav-link[aria-current] { border-color: Highlight; }
|
|
75
|
+
[data-theme] .sw-section-nav-count { border: 1px solid CanvasText; }
|
|
76
|
+
}`;
|
|
77
|
+
}
|
|
78
|
+
export function sectionNavFilledClassCatalog() {
|
|
79
|
+
return ['sw-section-nav-filled', 'sw-section-nav-count'];
|
|
80
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { typographyVariants } from '@scalewing/tokens';
|
|
2
2
|
import { breakpointQuery, breakpoints, } from './breakpoints.js';
|
|
3
|
+
import { cssSectionNavFilledClasses, sectionNavFilledClassCatalog, } from './css-section-nav-filled.js';
|
|
3
4
|
import { coarsePointerQuery, touchTarget } from './touch-target.js';
|
|
4
5
|
const label = typographyVariants.label;
|
|
5
6
|
export function sectionNavVerticalClass(breakpoint) {
|
|
@@ -100,6 +101,8 @@ export function cssSectionNavClasses() {
|
|
|
100
101
|
|
|
101
102
|
${verticalRules()}
|
|
102
103
|
|
|
104
|
+
${cssSectionNavFilledClasses()}
|
|
105
|
+
|
|
103
106
|
@media ${coarsePointerQuery} {
|
|
104
107
|
[data-theme] .sw-section-nav-link { min-height: ${touchTarget}; }
|
|
105
108
|
}
|
|
@@ -116,5 +119,6 @@ export function sectionNavClassCatalog() {
|
|
|
116
119
|
'sw-section-nav-link',
|
|
117
120
|
'sw-section-nav-icon',
|
|
118
121
|
...breakpoints.map(sectionNavVerticalClass),
|
|
122
|
+
...sectionNavFilledClassCatalog(),
|
|
119
123
|
];
|
|
120
124
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { zIndex } from './stacking.js';
|
|
2
|
+
/*
|
|
3
|
+
* A table footer holds a total: its cells at weight 600 under a heavier
|
|
4
|
+
* rule, a 2 px line in the border colour across the top of its first row.
|
|
5
|
+
* The line is each cell's ::before (absolutely placed, a border, so forced
|
|
6
|
+
* colours keep it), not the cell's own collapsed border, which a sticky
|
|
7
|
+
* cell would leave behind as it moved.
|
|
8
|
+
*
|
|
9
|
+
* A sticky footer pins its cells to the bottom edge on the header's glass
|
|
10
|
+
* (solid surface under reduced transparency, the system canvas in forced
|
|
11
|
+
* colours, as the pinned header cells), on the `stickyFooter` layer: over
|
|
12
|
+
* the cells and the pinned header cells, under the ActionBar, which covers
|
|
13
|
+
* it, so a page does not pair the two. A table's region is a scroll box,
|
|
14
|
+
* which would pin it to the region's own bottom; while the table fits its
|
|
15
|
+
* width (`sw-scroll-fits`) a region that holds a sticky footer stops being
|
|
16
|
+
* one, so the footer pins to the page's bottom and the sticky header to
|
|
17
|
+
* its top, under any sticky top chrome (an AppHeader covers it). A table
|
|
18
|
+
* wider than its region scrolls sideways in it and pins to the region.
|
|
19
|
+
*/
|
|
20
|
+
export function cssTableFooterClasses() {
|
|
21
|
+
return `.sw-table tfoot :is(th, td) {
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
position: relative;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.sw-table tfoot > tr:first-child > :is(th, td)::before {
|
|
27
|
+
border-top: 2px solid var(--sw-color-border);
|
|
28
|
+
content: '';
|
|
29
|
+
/* Over the last body row's 1 px border, so the rule reads 2 px. */
|
|
30
|
+
inset-block-start: -1px;
|
|
31
|
+
inset-inline: 0;
|
|
32
|
+
pointer-events: none;
|
|
33
|
+
position: absolute;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.sw-table .sw-table-footer-sticky :is(th, td) {
|
|
37
|
+
background: var(--sw-glass-fill);
|
|
38
|
+
backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
|
|
39
|
+
-webkit-backdrop-filter: blur(var(--sw-glass-blur)) saturate(var(--sw-glass-saturate));
|
|
40
|
+
bottom: 0;
|
|
41
|
+
position: sticky;
|
|
42
|
+
${zIndex('stickyFooter')}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.sw-table-wrap.sw-scroll-fits:has(> .sw-table > .sw-table-footer-sticky) {
|
|
46
|
+
overflow: visible;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@media (forced-colors: active) {
|
|
50
|
+
.sw-table tfoot > tr:first-child > :is(th, td)::before { border-color: CanvasText; }
|
|
51
|
+
.sw-table .sw-table-footer-sticky :is(th, td),
|
|
52
|
+
.sw-table-sticky thead th { background: Canvas; backdrop-filter: none; -webkit-backdrop-filter: none; }
|
|
53
|
+
}`;
|
|
54
|
+
}
|
|
55
|
+
export function tableFooterClassCatalog() {
|
|
56
|
+
return ['sw-table-footer-sticky', 'sw-scroll-fits'];
|
|
57
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** The colours a cell's text can take: a signed figure or a quiet value. */
|
|
2
|
+
export declare const tableCellTones: readonly ["success", "danger", "muted", "accent"];
|
|
3
|
+
export type TableCellTone = (typeof tableCellTones)[number];
|
|
4
|
+
/** A row's place in the table: a row of its own, or one under the row above. */
|
|
5
|
+
export declare const tableRowVariants: readonly ["default", "sub"];
|
|
6
|
+
export type TableRowVariant = (typeof tableRowVariants)[number];
|
|
7
|
+
export declare function assertTableCellTone(tone: unknown): void;
|
|
8
|
+
export declare function assertTableRowVariant(variant: unknown): void;
|
|
9
|
+
export declare function cssTableLedgerClasses(): string;
|
|
10
|
+
export declare function tableLedgerClassCatalog(): string[];
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/** The colours a cell's text can take: a signed figure or a quiet value. */
|
|
2
|
+
export const tableCellTones = ['success', 'danger', 'muted', 'accent'];
|
|
3
|
+
/** A row's place in the table: a row of its own, or one under the row above. */
|
|
4
|
+
export const tableRowVariants = ['default', 'sub'];
|
|
5
|
+
export function assertTableCellTone(tone) {
|
|
6
|
+
if (tone !== undefined && !tableCellTones.includes(tone))
|
|
7
|
+
throw new RangeError(`Unknown TableCell tone: ${String(tone)}`);
|
|
8
|
+
}
|
|
9
|
+
export function assertTableRowVariant(variant) {
|
|
10
|
+
if (!tableRowVariants.includes(variant))
|
|
11
|
+
throw new RangeError(`Unknown TableRow variant: ${String(variant)}`);
|
|
12
|
+
}
|
|
13
|
+
function toneRules() {
|
|
14
|
+
return tableCellTones
|
|
15
|
+
.map((tone) => `.sw-table .sw-table-tone-${tone} {
|
|
16
|
+
color: var(--sw-color-${tone});
|
|
17
|
+
}`)
|
|
18
|
+
.join('\n\n');
|
|
19
|
+
}
|
|
20
|
+
/*
|
|
21
|
+
* Ledger rules, for a table read across as well as down.
|
|
22
|
+
*
|
|
23
|
+
* A cell tone colours the cell's text in the theme's semantic colour, as
|
|
24
|
+
* Text color does: 4.5:1 on the surface and the canvas in the default
|
|
25
|
+
* palettes and most named ones (the test names the few palette gaps). A
|
|
26
|
+
* struck row mutes its toned cells, so no tone sits on the subtle fill.
|
|
27
|
+
*
|
|
28
|
+
* Column rules draw a hairline at the inline start of every cell after a
|
|
29
|
+
* row's first, so bill columns read as columns. A border, so forced
|
|
30
|
+
* colours keep it and RTL mirrors it; a sticky header cell draws it on
|
|
31
|
+
* its ::after.
|
|
32
|
+
*
|
|
33
|
+
* A row header in the body (`th scope="row"`, such as an entry's name)
|
|
34
|
+
* reads as body text, not as a column header. The reset is no stronger
|
|
35
|
+
* than `.sw-table th`, so a cell's numeric, tone and struck rules win.
|
|
36
|
+
*
|
|
37
|
+
* A sub row sits under the row above it: its row header is indented a
|
|
38
|
+
* space-6 step with a guide bar at the indent, so a batch's items or a
|
|
39
|
+
* change's parts read as parts of one entry. The bar is the header's
|
|
40
|
+
* ::after (::before is the selected row's bar) and a border, so forced
|
|
41
|
+
* colours keep it.
|
|
42
|
+
*
|
|
43
|
+
* A struck row is a voided one kept on the record: the subtle fill, the
|
|
44
|
+
* text muted and struck through. A Badge in it (an inline-flex box) is not
|
|
45
|
+
* struck when it sits in a line of text (it is an atomic inline box; one
|
|
46
|
+
* that is itself a flex item is struck), so its tag, such as "Voided",
|
|
47
|
+
* stays plain; its words say why the row is struck, since a line-through
|
|
48
|
+
* is not read aloud.
|
|
49
|
+
*/
|
|
50
|
+
export function cssTableLedgerClasses() {
|
|
51
|
+
return `${toneRules()}
|
|
52
|
+
|
|
53
|
+
.sw-table-column-rules :is(th, td) + :is(th, td) {
|
|
54
|
+
border-inline-start: 1px solid var(--sw-color-border);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* A sticky header cell is positioned, so the next cell's fill covers a
|
|
58
|
+
collapsed border; its rule is a border on its own ::after instead, so
|
|
59
|
+
forced colours keep it and the logical inset mirrors it. */
|
|
60
|
+
.sw-table-sticky.sw-table-column-rules thead :is(th, td) + :is(th, td)::after {
|
|
61
|
+
border-inline-start: 1px solid var(--sw-color-border);
|
|
62
|
+
content: '';
|
|
63
|
+
inset-block: 0;
|
|
64
|
+
inset-inline-start: 0;
|
|
65
|
+
pointer-events: none;
|
|
66
|
+
position: absolute;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
:where(.sw-table tbody, .sw-table tfoot) th[scope='row'] {
|
|
70
|
+
color: inherit;
|
|
71
|
+
font: inherit;
|
|
72
|
+
letter-spacing: inherit;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.sw-table-row-sub > th[scope='row'] {
|
|
76
|
+
padding-inline-start: calc(var(--sw-space-3) + var(--sw-space-6) + var(--sw-space-3));
|
|
77
|
+
position: relative;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.sw-table-compact .sw-table-row-sub > th[scope='row'] {
|
|
81
|
+
padding-inline-start: calc(var(--sw-space-2) + var(--sw-space-6) + var(--sw-space-3));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.sw-table-row-sub > th[scope='row']::after {
|
|
85
|
+
block-size: var(--sw-space-5);
|
|
86
|
+
border-inline-start: 2px solid var(--sw-color-border);
|
|
87
|
+
content: '';
|
|
88
|
+
inset-block-start: 50%;
|
|
89
|
+
inset-inline-start: calc(var(--sw-space-3) + var(--sw-space-6));
|
|
90
|
+
pointer-events: none;
|
|
91
|
+
position: absolute;
|
|
92
|
+
transform: translateY(-50%);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.sw-table-compact .sw-table-row-sub > th[scope='row']::after {
|
|
96
|
+
inset-inline-start: calc(var(--sw-space-2) + var(--sw-space-6));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.sw-table .sw-table-row-struck > :is(td, th) {
|
|
100
|
+
background: var(--sw-color-subtle);
|
|
101
|
+
color: var(--sw-color-muted);
|
|
102
|
+
text-decoration: line-through;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.sw-table .sw-table-row-struck > [class*='sw-table-tone-'] {
|
|
106
|
+
color: var(--sw-color-muted);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@media (forced-colors: active) {
|
|
110
|
+
.sw-table-column-rules :is(th, td) + :is(th, td),
|
|
111
|
+
.sw-table-sticky.sw-table-column-rules thead :is(th, td) + :is(th, td)::after { border-color: CanvasText; }
|
|
112
|
+
.sw-table-row-sub > th[scope='row']::after { border-color: CanvasText; }
|
|
113
|
+
}`;
|
|
114
|
+
}
|
|
115
|
+
export function tableLedgerClassCatalog() {
|
|
116
|
+
return [
|
|
117
|
+
...tableCellTones.map((tone) => `sw-table-tone-${tone}`),
|
|
118
|
+
'sw-table-column-rules',
|
|
119
|
+
'sw-table-row-sub',
|
|
120
|
+
'sw-table-row-struck',
|
|
121
|
+
];
|
|
122
|
+
}
|
package/dist/css/css-table.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { typographyVariants } from '@scalewing/tokens';
|
|
2
2
|
import { scrollRegionRules } from './css-scroll-region.js';
|
|
3
3
|
import { cssTableLayoutClasses, tableLayoutClassCatalog, } from './css-table-layout.js';
|
|
4
|
+
import { cssTableLedgerClasses, tableLedgerClassCatalog, } from './css-table-ledger.js';
|
|
5
|
+
import { cssTableFooterClasses, tableFooterClassCatalog, } from './css-table-footer.js';
|
|
4
6
|
import { cssTableSortClasses, tableSortClassCatalog, } from './css-table-sort.js';
|
|
5
7
|
import { zIndex } from './stacking.js';
|
|
6
8
|
const caption = typographyVariants.caption;
|
|
@@ -89,6 +91,10 @@ ${cssTableLayoutClasses()}
|
|
|
89
91
|
|
|
90
92
|
${cssTableSortClasses()}
|
|
91
93
|
|
|
94
|
+
${cssTableLedgerClasses()}
|
|
95
|
+
|
|
96
|
+
${cssTableFooterClasses()}
|
|
97
|
+
|
|
92
98
|
${selectedRowRules()}`;
|
|
93
99
|
}
|
|
94
100
|
export function tableClassCatalog() {
|
|
@@ -103,5 +109,7 @@ export function tableClassCatalog() {
|
|
|
103
109
|
'sw-table-row-selected',
|
|
104
110
|
...tableLayoutClassCatalog(),
|
|
105
111
|
...tableSortClassCatalog(),
|
|
112
|
+
...tableLedgerClassCatalog(),
|
|
113
|
+
...tableFooterClassCatalog(),
|
|
106
114
|
];
|
|
107
115
|
}
|
package/dist/css/stacking.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
export declare const stackingOrder: {
|
|
2
2
|
readonly stickyCell: 1;
|
|
3
|
-
readonly
|
|
4
|
-
readonly
|
|
5
|
-
readonly
|
|
3
|
+
readonly stickyFooter: 2;
|
|
4
|
+
readonly bottomChrome: 3;
|
|
5
|
+
readonly popupHost: 4;
|
|
6
|
+
readonly topChrome: 5;
|
|
6
7
|
readonly popup: 10;
|
|
7
8
|
};
|
|
8
9
|
export type StackingLayer = keyof typeof stackingOrder;
|
|
10
|
+
export declare const joinedControlOrder: {
|
|
11
|
+
readonly pressed: 1;
|
|
12
|
+
readonly focused: 2;
|
|
13
|
+
};
|
|
14
|
+
export declare function joinedZIndex(layer: keyof typeof joinedControlOrder): string;
|
|
9
15
|
export declare function zIndex(layer: StackingLayer): string;
|
|
10
16
|
export declare function cssPopupHostRules(): string;
|
package/dist/css/stacking.js
CHANGED
|
@@ -4,28 +4,45 @@
|
|
|
4
4
|
*
|
|
5
5
|
* 1. `stickyCell`: a sticky table header cell or row label over the cells
|
|
6
6
|
* that scroll under it.
|
|
7
|
-
* 2. `
|
|
8
|
-
*
|
|
7
|
+
* 2. `stickyFooter`: a sticky table footer (a pinned total row) over the
|
|
8
|
+
* cells and pinned header cells that scroll under it, and under the
|
|
9
|
+
* ActionBar, which stays the page's last word at the bottom edge.
|
|
10
|
+
* 3. `bottomChrome`: the sticky ActionBar over the page flow it follows.
|
|
11
|
+
* 4. `popupHost`: a glass surface (glass Card, Accordion) while it holds an
|
|
9
12
|
* open popup. Backdrop blur makes that surface its own stacking context, so
|
|
10
13
|
* its popup can only paint as high as the surface does; lifting the surface
|
|
11
14
|
* over the ActionBar keeps an open list tappable where the bar would cover
|
|
12
15
|
* it, and over the next surface in the flow.
|
|
13
|
-
*
|
|
16
|
+
* 5. `topChrome`: the sticky AppHeader or sticky Tabs strip, over a lifted
|
|
14
17
|
* surface that scrolls up under it (the header is the page's way back, the
|
|
15
18
|
* strip its way between sections, and a popup opens downward).
|
|
16
|
-
*
|
|
17
|
-
* list, MultiSelect panel, Tooltip, the DateField and CalendarButton
|
|
19
|
+
* 6. `popup`: a popup outside any lifted surface (Select list, ActionMenu
|
|
20
|
+
* list, MultiSelect panel, Combobox list, Tooltip, the DateField and CalendarButton
|
|
18
21
|
* calendar) over everything in the page.
|
|
19
22
|
*
|
|
20
23
|
* Dialog and Toast sit on the browser's top layer, above all of these.
|
|
21
24
|
*/
|
|
22
25
|
export const stackingOrder = {
|
|
23
26
|
stickyCell: 1,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
stickyFooter: 2,
|
|
28
|
+
bottomChrome: 3,
|
|
29
|
+
popupHost: 4,
|
|
30
|
+
topChrome: 5,
|
|
27
31
|
popup: 10,
|
|
28
32
|
};
|
|
33
|
+
/*
|
|
34
|
+
* The order inside a joined control (an attached ButtonGroup), which is
|
|
35
|
+
* its own stacking context (`isolation: isolate`), so these never meet the
|
|
36
|
+
* page's layers: a pressed button's ring over its neighbours, and the
|
|
37
|
+
* focused button's ring over both.
|
|
38
|
+
*/
|
|
39
|
+
export const joinedControlOrder = {
|
|
40
|
+
pressed: 1,
|
|
41
|
+
focused: 2,
|
|
42
|
+
};
|
|
43
|
+
export function joinedZIndex(layer) {
|
|
44
|
+
return `z-index: ${joinedControlOrder[layer]};`;
|
|
45
|
+
}
|
|
29
46
|
export function zIndex(layer) {
|
|
30
47
|
return `z-index: ${stackingOrder[layer]};`;
|
|
31
48
|
}
|
|
@@ -36,6 +53,9 @@ const openPopups = [
|
|
|
36
53
|
// MultiSelect's panel. Rendered only while open; on the top layer where
|
|
37
54
|
// the popover API exists.
|
|
38
55
|
'.sw-multi-select-panel',
|
|
56
|
+
// Combobox's list. Rendered only while open; on the top layer where the
|
|
57
|
+
// popover API exists.
|
|
58
|
+
'.sw-combobox-popup',
|
|
39
59
|
'.sw-tooltip:not([hidden])',
|
|
40
60
|
// DateField and CalendarButton share it. Rendered only while open; on the
|
|
41
61
|
// top layer where the popover API exists.
|
package/dist/css/stylesheet.js
CHANGED
|
@@ -39,6 +39,7 @@ import { dialogClassCatalog } from './css-dialog.js';
|
|
|
39
39
|
import { dialogFrameClassCatalog } from './css-dialog-frame.js';
|
|
40
40
|
import { selectClassCatalog } from './css-select.js';
|
|
41
41
|
import { multiSelectClassCatalog } from './css-multi-select.js';
|
|
42
|
+
import { comboboxClassCatalog } from './css-combobox.js';
|
|
42
43
|
import { splitClassCatalog } from './css-split.js';
|
|
43
44
|
import { toastClassCatalog } from './css-toast.js';
|
|
44
45
|
import { toastCardClassCatalog } from './css-toast-card.js';
|
|
@@ -74,6 +75,7 @@ export function utilityClassCatalog() {
|
|
|
74
75
|
...selectClassCatalog(),
|
|
75
76
|
...actionMenuClassCatalog(),
|
|
76
77
|
...multiSelectClassCatalog(),
|
|
78
|
+
...comboboxClassCatalog(),
|
|
77
79
|
...actionBarClassCatalog(),
|
|
78
80
|
...switchClassCatalog(),
|
|
79
81
|
...dateFieldClassCatalog(),
|
package/dist/index.d.ts
CHANGED
|
@@ -25,20 +25,21 @@ export { StatTile, type StatTileEmphasis, type StatTileProps, type StatTileTone,
|
|
|
25
25
|
export { TabPanel, type TabItem, type TabPanelProps, Tabs, type TabsProps, tabId, tabPanelId, } from './components/Tabs.js';
|
|
26
26
|
export { Toast, toastPlacements, toastTones, type ToastAction, type ToastPlacement, } from './components/Toast.js';
|
|
27
27
|
export type { ToastProps, ToastTone } from './components/Toast.js';
|
|
28
|
-
export { Field, type FieldProps, type FieldSize } from './components/Field.js';
|
|
28
|
+
export { Field, fieldVariants, type FieldProps, type FieldSize, type FieldVariant, } from './components/Field.js';
|
|
29
29
|
export { Step, type StepHeadingLevel, type StepProps, Steps, type StepsLabels, type StepsProps, type StepStatus, } from './components/Steps.js';
|
|
30
30
|
export { Stepper, type StepperProps, type StepperWidth, } from './components/Stepper.js';
|
|
31
31
|
export { Inline, type InlineProps } from './components/Inline.js';
|
|
32
32
|
export { Split } from './components/Split.js';
|
|
33
33
|
export type { SplitProps } from './components/Split.js';
|
|
34
34
|
export { Nav, type NavProps } from './components/Nav.js';
|
|
35
|
-
export { SectionNav, type SectionNavItem, type SectionNavProps, } from './components/SectionNav.js';
|
|
35
|
+
export { SectionNav, sectionNavAppearances, type SectionNavAppearance, type SectionNavItem, type SectionNavProps, } from './components/SectionNav.js';
|
|
36
36
|
export { SegmentedControl, type SegmentedControlProps, type SegmentedControlVariant, type SegmentedItem, } from './components/SegmentedControl.js';
|
|
37
|
+
export { Combobox, comboboxSizes, type ComboboxAction, type ComboboxBadge, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type ComboboxSize, } from './components/Combobox.js';
|
|
37
38
|
export { Select } from './components/Select.js';
|
|
38
39
|
export type { SelectAction, SelectOption, SelectProps, SelectWidth, } from './components/Select.js';
|
|
39
40
|
export { MultiSelect, type MultiSelectAlign, type MultiSelectOption, type MultiSelectProps, } from './components/MultiSelect.js';
|
|
40
41
|
export { Stack, type Align, type Justify, type StackProps, } from './components/Stack.js';
|
|
41
|
-
export { Table, TableBody, TableCell, TableHeader, TableRow, type TableBodyProps, type TableCellProps, type TableColumnWidth, type TableDensity, type TableHeaderProps, type TableLayout, type TableProps, type TableRowProps, type TableSort, type TableVerticalAlign, } from './components/Table.js';
|
|
42
|
+
export { Table, TableBody, TableCell, TableFooter, TableHeader, TableRow, tableCellTones, tableRowVariants, type TableBodyProps, type TableCellProps, type TableCellTone, type TableColumnWidth, type TableDensity, type TableFooterProps, type TableHeaderProps, type TableLayout, type TableProps, type TableRowProps, type TableRowVariant, type TableSort, type TableVerticalAlign, } from './components/Table.js';
|
|
42
43
|
export { Text, type TextAlign, type TextElement, type TextProps, } from './components/Text.js';
|
|
43
44
|
export { ThemeProvider, useTheme, type ThemeProviderProps, } from './theme/ThemeProvider.js';
|
|
44
45
|
export { utilityClassCatalog } from './css/stylesheet.js';
|
package/dist/index.js
CHANGED
|
@@ -23,18 +23,19 @@ export { Dialog, dialogSizes, } from './components/Dialog.js';
|
|
|
23
23
|
export { StatTile, statTileTones, } from './components/StatTile.js';
|
|
24
24
|
export { TabPanel, Tabs, tabId, tabPanelId, } from './components/Tabs.js';
|
|
25
25
|
export { Toast, toastPlacements, toastTones, } from './components/Toast.js';
|
|
26
|
-
export { Field } from './components/Field.js';
|
|
26
|
+
export { Field, fieldVariants, } from './components/Field.js';
|
|
27
27
|
export { Step, Steps, } from './components/Steps.js';
|
|
28
28
|
export { Stepper, } from './components/Stepper.js';
|
|
29
29
|
export { Inline } from './components/Inline.js';
|
|
30
30
|
export { Split } from './components/Split.js';
|
|
31
31
|
export { Nav } from './components/Nav.js';
|
|
32
|
-
export { SectionNav, } from './components/SectionNav.js';
|
|
32
|
+
export { SectionNav, sectionNavAppearances, } from './components/SectionNav.js';
|
|
33
33
|
export { SegmentedControl, } from './components/SegmentedControl.js';
|
|
34
|
+
export { Combobox, comboboxSizes, } from './components/Combobox.js';
|
|
34
35
|
export { Select } from './components/Select.js';
|
|
35
36
|
export { MultiSelect, } from './components/MultiSelect.js';
|
|
36
37
|
export { Stack, } from './components/Stack.js';
|
|
37
|
-
export { Table, TableBody, TableCell, TableHeader, TableRow, } from './components/Table.js';
|
|
38
|
+
export { Table, TableBody, TableCell, TableFooter, TableHeader, TableRow, tableCellTones, tableRowVariants, } from './components/Table.js';
|
|
38
39
|
export { Text, } from './components/Text.js';
|
|
39
40
|
export { ThemeProvider, useTheme, } from './theme/ThemeProvider.js';
|
|
40
41
|
export { utilityClassCatalog } from './css/stylesheet.js';
|