@scalewing/react 1.40.0 → 1.42.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 +38 -0
- package/README.md +274 -7
- package/dist/calendar-labels.d.ts +2 -0
- package/dist/calendar-labels.js +7 -0
- package/dist/components/Article.d.ts +60 -0
- package/dist/components/Article.js +42 -0
- package/dist/components/BarChart.d.ts +20 -4
- package/dist/components/BarChart.js +13 -6
- package/dist/components/ButtonGroup.d.ts +8 -1
- package/dist/components/ButtonGroup.js +11 -2
- package/dist/components/DateField.d.ts +14 -2
- package/dist/components/DateField.js +14 -11
- package/dist/components/DenominationGrid.d.ts +3 -2
- package/dist/components/DenominationGrid.js +21 -3
- package/dist/components/Dialog.d.ts +29 -13
- package/dist/components/Dialog.js +22 -20
- package/dist/components/DocumentViewer.d.ts +41 -0
- package/dist/components/DocumentViewer.js +72 -0
- package/dist/components/Field.d.ts +13 -2
- package/dist/components/Field.js +14 -38
- package/dist/components/FileField.d.ts +44 -0
- package/dist/components/FileField.js +66 -0
- package/dist/components/FilterChips.d.ts +7 -37
- package/dist/components/FilterChips.js +32 -24
- package/dist/components/ListRow.d.ts +33 -3
- package/dist/components/ListRow.js +18 -17
- package/dist/components/MarkdownView.d.ts +39 -0
- package/dist/components/MarkdownView.js +30 -0
- package/dist/components/NavCount.d.ts +15 -2
- package/dist/components/NavCount.js +16 -6
- package/dist/components/SegmentedControl.d.ts +17 -1
- package/dist/components/SegmentedControl.js +11 -3
- package/dist/components/Switch.d.ts +16 -1
- package/dist/components/Switch.js +17 -6
- package/dist/components/action-bar/ActionBarSummary.d.ts +10 -2
- package/dist/components/action-bar/ActionBarSummary.js +11 -2
- package/dist/components/chart/use-chart-width.js +2 -24
- package/dist/components/date-field/CalendarEntryButton.d.ts +24 -0
- package/dist/components/date-field/CalendarEntryButton.js +16 -0
- package/dist/components/date-field/TypedEntry.d.ts +26 -0
- package/dist/components/date-field/TypedEntry.js +13 -0
- package/dist/components/denomination-grid/CountCell.d.ts +16 -0
- package/dist/components/denomination-grid/CountCell.js +14 -0
- package/dist/components/denomination-grid/DenominationStrip.d.ts +4 -1
- package/dist/components/denomination-grid/DenominationStrip.js +2 -2
- package/dist/components/denomination-grid/EntryCell.d.ts +3 -1
- package/dist/components/denomination-grid/EntryCell.js +2 -2
- package/dist/components/denomination-grid/StripRow.js +1 -10
- package/dist/components/denomination-grid/TransposedStrip.d.ts +17 -0
- package/dist/components/denomination-grid/TransposedStrip.js +43 -0
- package/dist/components/denomination-grid/types.d.ts +31 -0
- package/dist/components/denomination-grid/types.js +7 -1
- package/dist/components/denomination-grid/validate-options.d.ts +7 -0
- package/dist/components/denomination-grid/validate-options.js +27 -0
- package/dist/components/dialog/DialogFooter.d.ts +6 -5
- package/dist/components/dialog/DialogFooter.js +6 -6
- package/dist/components/dialog/validate.d.ts +24 -0
- package/dist/components/dialog/validate.js +23 -0
- package/dist/components/document-viewer/document-viewer-labels.d.ts +23 -0
- package/dist/components/document-viewer/document-viewer-labels.js +23 -0
- package/dist/components/document-viewer/page-box.d.ts +8 -0
- package/dist/components/document-viewer/page-box.js +12 -0
- package/dist/components/document-viewer/pdf-document.d.ts +32 -0
- package/dist/components/document-viewer/pdf-document.js +66 -0
- package/dist/components/document-viewer/pdf-options.d.ts +36 -0
- package/dist/components/document-viewer/pdf-options.js +46 -0
- package/dist/components/document-viewer/render-pdf-page.d.ts +20 -0
- package/dist/components/document-viewer/render-pdf-page.js +38 -0
- package/dist/components/document-viewer/scroll-chain.d.ts +6 -0
- package/dist/components/document-viewer/scroll-chain.js +23 -0
- package/dist/components/document-viewer/use-error-report.d.ts +5 -0
- package/dist/components/document-viewer/use-error-report.js +13 -0
- package/dist/components/document-viewer/use-page-render.d.ts +21 -0
- package/dist/components/document-viewer/use-page-render.js +70 -0
- package/dist/components/document-viewer/use-pdf-document.d.ts +22 -0
- package/dist/components/document-viewer/use-pdf-document.js +47 -0
- package/dist/components/document-viewer/use-pinch-zoom.d.ts +12 -0
- package/dist/components/document-viewer/use-pinch-zoom.js +67 -0
- package/dist/components/document-viewer/use-zoom.d.ts +23 -0
- package/dist/components/document-viewer/use-zoom.js +70 -0
- package/dist/components/document-viewer/zoom.d.ts +29 -0
- package/dist/components/document-viewer/zoom.js +37 -0
- package/dist/components/field/field-checks.d.ts +34 -0
- package/dist/components/field/field-checks.js +42 -0
- package/dist/components/file-field/file-field-checks.d.ts +13 -0
- package/dist/components/file-field/file-field-checks.js +21 -0
- package/dist/components/file-field/use-file-drop.d.ts +34 -0
- package/dist/components/file-field/use-file-drop.js +78 -0
- package/dist/components/file-field/use-swap-focus.d.ts +15 -0
- package/dist/components/file-field/use-swap-focus.js +40 -0
- package/dist/components/filter-chips/FilterChip.d.ts +16 -0
- package/dist/components/filter-chips/FilterChip.js +20 -0
- package/dist/components/filter-chips/options.d.ts +75 -0
- package/dist/components/filter-chips/options.js +11 -0
- package/dist/components/filter-chips/validate.d.ts +9 -0
- package/dist/components/filter-chips/validate.js +48 -0
- package/dist/components/list/ListRowContent.d.ts +8 -2
- package/dist/components/list/ListRowContent.js +6 -3
- package/dist/components/list/ListRowItem.d.ts +10 -0
- package/dist/components/list/ListRowItem.js +17 -0
- package/dist/components/list/row-naming.d.ts +17 -0
- package/dist/components/list/row-naming.js +19 -0
- package/dist/components/list/row-slot.d.ts +8 -0
- package/dist/components/list/row-slot.js +12 -0
- package/dist/components/markdown/markdown-limits.d.ts +14 -0
- package/dist/components/markdown/markdown-limits.js +14 -0
- package/dist/components/markdown/markdown-model.d.ts +94 -0
- package/dist/components/markdown/markdown-model.js +8 -0
- package/dist/components/markdown/markdown-options.d.ts +18 -0
- package/dist/components/markdown/markdown-options.js +10 -0
- package/dist/components/markdown/markdown-rules.d.ts +28 -0
- package/dist/components/markdown/markdown-rules.js +81 -0
- package/dist/components/markdown/markdown-text.d.ts +17 -0
- package/dist/components/markdown/markdown-text.js +86 -0
- package/dist/components/markdown/parse-markdown.d.ts +4 -0
- package/dist/components/markdown/parse-markdown.js +21 -0
- package/dist/components/markdown/read-blocks.d.ts +8 -0
- package/dist/components/markdown/read-blocks.js +168 -0
- package/dist/components/markdown/read-inlines.d.ts +12 -0
- package/dist/components/markdown/read-inlines.js +126 -0
- package/dist/components/markdown/read-markdown.d.ts +9 -0
- package/dist/components/markdown/read-markdown.js +27 -0
- package/dist/components/markdown/reading-context.d.ts +18 -0
- package/dist/components/markdown/reading-context.js +35 -0
- package/dist/components/markdown/render-markdown.d.ts +10 -0
- package/dist/components/markdown/render-markdown.js +52 -0
- package/dist/components/use-element-width.d.ts +11 -0
- package/dist/components/use-element-width.js +38 -0
- package/dist/css/chart-tones.d.ts +2 -0
- package/dist/css/chart-tones.js +5 -1
- package/dist/css/css-article.d.ts +2 -0
- package/dist/css/css-article.js +110 -0
- package/dist/css/css-bar-chart.d.ts +17 -2
- package/dist/css/css-bar-chart.js +38 -7
- package/dist/css/css-button-group-attached.d.ts +3 -0
- package/dist/css/css-button-group-attached.js +18 -1
- package/dist/css/css-canvas-grouped.d.ts +17 -0
- package/dist/css/css-canvas-grouped.js +40 -0
- package/dist/css/css-components.js +18 -0
- package/dist/css/css-count-pill.js +14 -1
- package/dist/css/css-date-field-calendar-entry.d.ts +11 -0
- package/dist/css/css-date-field-calendar-entry.js +50 -0
- package/dist/css/css-date-field.js +4 -0
- package/dist/css/css-denomination-grid.js +4 -0
- package/dist/css/css-denomination-transposed.d.ts +4 -0
- package/dist/css/css-denomination-transposed.js +178 -0
- package/dist/css/css-dialog-canvas.d.ts +3 -0
- package/dist/css/css-dialog-canvas.js +20 -0
- package/dist/css/css-dialog-frame.js +19 -2
- package/dist/css/css-dialog-grabber.d.ts +4 -0
- package/dist/css/css-dialog-grabber.js +56 -0
- package/dist/css/css-dialog.js +3 -2
- package/dist/css/css-document-viewer.d.ts +2 -0
- package/dist/css/css-document-viewer.js +186 -0
- package/dist/css/css-document.js +3 -0
- package/dist/css/css-field-width.d.ts +12 -0
- package/dist/css/css-field-width.js +49 -0
- package/dist/css/css-field.js +4 -0
- package/dist/css/css-file-field.d.ts +2 -0
- package/dist/css/css-file-field.js +180 -0
- package/dist/css/css-filter-chips-layout.d.ts +2 -0
- package/dist/css/css-filter-chips-layout.js +42 -0
- package/dist/css/css-filter-chips.js +4 -0
- package/dist/css/css-list-row-trailing.d.ts +2 -0
- package/dist/css/css-list-row-trailing.js +91 -0
- package/dist/css/css-list-row.d.ts +6 -0
- package/dist/css/css-list-row.js +19 -3
- package/dist/css/css-list.js +5 -1
- package/dist/css/css-markdown.d.ts +2 -0
- package/dist/css/css-markdown.js +144 -0
- package/dist/css/css-segmented-sizing.d.ts +13 -0
- package/dist/css/css-segmented-sizing.js +66 -0
- package/dist/css/css-segmented.js +4 -0
- package/dist/css/css-switch.d.ts +6 -0
- package/dist/css/css-switch.js +39 -0
- package/dist/css/css-variables.js +1 -0
- package/dist/css/stacking.d.ts +1 -0
- package/dist/css/stacking.js +4 -1
- package/dist/css/stylesheet.js +12 -0
- package/dist/date-field-labels.d.ts +5 -0
- package/dist/date-field-labels.js +1 -0
- package/dist/document-viewer-worker.d.ts +9 -0
- package/dist/document-viewer-worker.js +9 -0
- package/dist/index.d.ts +15 -9
- package/dist/index.js +13 -7
- package/dist/list-options.d.ts +11 -7
- package/dist/list-options.js +20 -8
- package/dist/styles.css +889 -44
- package/dist/theme/ThemeProvider.d.ts +11 -1
- package/dist/theme/ThemeProvider.js +4 -2
- package/package.json +10 -2
package/dist/css/css-switch.js
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
import { typographyVariants } from '@scalewing/tokens';
|
|
2
2
|
const label = typographyVariants.label;
|
|
3
3
|
const caption = typographyVariants.caption;
|
|
4
|
+
/** Where the control sits: before its label, or at the row's end after it. */
|
|
5
|
+
export const switchLayouts = ['leading', 'trailing'];
|
|
6
|
+
/** The track's colour while on. */
|
|
7
|
+
export const switchCheckedTones = ['accent', 'success'];
|
|
8
|
+
/*
|
|
9
|
+
* A trailing switch is a row as wide as its column: the label and its
|
|
10
|
+
* description take the room, the control sits at the end, a step apart,
|
|
11
|
+
* lined up with the label's first line. A success switch fills its track
|
|
12
|
+
* with the success colour while on (3:1 or more against the surface in
|
|
13
|
+
* every palette, as the accent is); forced colours keep Highlight.
|
|
14
|
+
*/
|
|
15
|
+
function optionRules() {
|
|
16
|
+
return `.sw-switch-trailing {
|
|
17
|
+
align-items: flex-start;
|
|
18
|
+
display: flex;
|
|
19
|
+
gap: var(--sw-space-3);
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.sw-switch-trailing .sw-switch-copy {
|
|
25
|
+
flex: 1 1 auto;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
padding-block: calc((var(--sw-control-md-min-height) - ${label.lineHeight}px) / 2);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.sw-switch-success .sw-switch-input:checked + .sw-switch-track {
|
|
31
|
+
background: var(--sw-color-success);
|
|
32
|
+
border-color: var(--sw-color-success);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@media (forced-colors: active) {
|
|
36
|
+
.sw-switch-success .sw-switch-input:checked + .sw-switch-track { background: Highlight; border-color: Highlight; }
|
|
37
|
+
}`;
|
|
38
|
+
}
|
|
4
39
|
export function cssSwitchClasses() {
|
|
5
40
|
return `.sw-switch {
|
|
6
41
|
align-items: center;
|
|
@@ -90,6 +125,8 @@ export function cssSwitchClasses() {
|
|
|
90
125
|
line-height: ${caption.lineHeight}px;
|
|
91
126
|
}
|
|
92
127
|
|
|
128
|
+
${optionRules()}
|
|
129
|
+
|
|
93
130
|
@media (prefers-reduced-motion: reduce) {
|
|
94
131
|
.sw-switch-thumb { transition: none; }
|
|
95
132
|
}
|
|
@@ -111,5 +148,7 @@ export function switchClassCatalog() {
|
|
|
111
148
|
'sw-switch-copy',
|
|
112
149
|
'sw-switch-label',
|
|
113
150
|
'sw-switch-description',
|
|
151
|
+
'sw-switch-trailing',
|
|
152
|
+
'sw-switch-success',
|
|
114
153
|
];
|
|
115
154
|
}
|
package/dist/css/stacking.d.ts
CHANGED
package/dist/css/stacking.js
CHANGED
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
* 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
|
-
* 6. `
|
|
20
|
+
* 6. `sheetGrabber`: a bottom sheet's grabber, inside its dialog, over the
|
|
21
|
+
* banded title band that sticks under it.
|
|
22
|
+
* 7. `popup`: a popup outside any lifted surface (Select list, ActionMenu
|
|
21
23
|
* list, MultiSelect panel, Combobox list, Tooltip, the DateField and CalendarButton
|
|
22
24
|
* calendar) over everything in the page.
|
|
23
25
|
*
|
|
@@ -29,6 +31,7 @@ export const stackingOrder = {
|
|
|
29
31
|
bottomChrome: 3,
|
|
30
32
|
popupHost: 4,
|
|
31
33
|
topChrome: 5,
|
|
34
|
+
sheetGrabber: 6,
|
|
32
35
|
popup: 10,
|
|
33
36
|
};
|
|
34
37
|
/*
|
package/dist/css/stylesheet.js
CHANGED
|
@@ -7,7 +7,11 @@ import { switchClassCatalog } from './css-switch.js';
|
|
|
7
7
|
import { dateFieldClassCatalog } from './css-date-field.js';
|
|
8
8
|
import { calendarButtonClassCatalog } from './css-calendar-button.js';
|
|
9
9
|
import { dateRangeClassCatalog } from './css-date-range.js';
|
|
10
|
+
import { fileFieldClassCatalog } from './css-file-field.js';
|
|
11
|
+
import { articleClassCatalog } from './css-article.js';
|
|
12
|
+
import { documentViewerClassCatalog } from './css-document-viewer.js';
|
|
10
13
|
import { listClassCatalog } from './css-list.js';
|
|
14
|
+
import { markdownClassCatalog } from './css-markdown.js';
|
|
11
15
|
import { countPillClassCatalog } from './css-count-pill.js';
|
|
12
16
|
import { checkboxClassCatalog } from './css-checkbox.js';
|
|
13
17
|
import { radioGroupClassCatalog } from './css-radio-group.js';
|
|
@@ -48,6 +52,8 @@ import { sectionNavClassCatalog } from './css-section-nav.js';
|
|
|
48
52
|
import { dialogClassCatalog } from './css-dialog.js';
|
|
49
53
|
import { dialogBandedClassCatalog } from './css-dialog-banded.js';
|
|
50
54
|
import { dialogFrameClassCatalog } from './css-dialog-frame.js';
|
|
55
|
+
import { dialogCanvasClassCatalog } from './css-dialog-canvas.js';
|
|
56
|
+
import { dialogGrabberClassCatalog } from './css-dialog-grabber.js';
|
|
51
57
|
import { selectClassCatalog } from './css-select.js';
|
|
52
58
|
import { multiSelectClassCatalog } from './css-multi-select.js';
|
|
53
59
|
import { comboboxClassCatalog } from './css-combobox.js';
|
|
@@ -89,6 +95,8 @@ export function utilityClassCatalog() {
|
|
|
89
95
|
...dialogClassCatalog(),
|
|
90
96
|
...dialogFrameClassCatalog(),
|
|
91
97
|
...dialogBandedClassCatalog(),
|
|
98
|
+
...dialogCanvasClassCatalog(),
|
|
99
|
+
...dialogGrabberClassCatalog(),
|
|
92
100
|
...accordionClassCatalog(),
|
|
93
101
|
...selectClassCatalog(),
|
|
94
102
|
...actionMenuClassCatalog(),
|
|
@@ -100,6 +108,10 @@ export function utilityClassCatalog() {
|
|
|
100
108
|
...calendarButtonClassCatalog(),
|
|
101
109
|
...dateRangeClassCatalog(),
|
|
102
110
|
...listClassCatalog(),
|
|
111
|
+
...fileFieldClassCatalog(),
|
|
112
|
+
...articleClassCatalog(),
|
|
113
|
+
...documentViewerClassCatalog(),
|
|
114
|
+
...markdownClassCatalog(),
|
|
103
115
|
...countPillClassCatalog(),
|
|
104
116
|
...checkboxClassCatalog(),
|
|
105
117
|
...radioGroupClassCatalog(),
|
|
@@ -28,6 +28,11 @@ export type DateFieldLabels = {
|
|
|
28
28
|
* outside `min` and `max`.
|
|
29
29
|
*/
|
|
30
30
|
outOfRange: string;
|
|
31
|
+
/**
|
|
32
|
+
* Said after a calendar entry's name while the field is required (a
|
|
33
|
+
* button has no required state of its own), such as "Required".
|
|
34
|
+
*/
|
|
35
|
+
required: string;
|
|
31
36
|
/** Placeholder letters, arranged in the locale's field order. */
|
|
32
37
|
dayPlaceholder: string;
|
|
33
38
|
monthPlaceholder: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The PDF.js worker for `DocumentViewer`, at the exact PDF.js version
|
|
3
|
+
* Scalewing pins and from the same legacy build: a module worker entry
|
|
4
|
+
* that starts PDF.js's worker on import. A consumer bundles it as a worker
|
|
5
|
+
* and passes its URL as `workerSrc`, such as Vite's
|
|
6
|
+
* `import workerSrc from '@scalewing/react/document-viewer-worker?worker&url'`,
|
|
7
|
+
* so the viewer and its worker are always the same version.
|
|
8
|
+
*/
|
|
9
|
+
import 'pdfjs-dist/legacy/build/pdf.worker.min.mjs';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The PDF.js worker for `DocumentViewer`, at the exact PDF.js version
|
|
3
|
+
* Scalewing pins and from the same legacy build: a module worker entry
|
|
4
|
+
* that starts PDF.js's worker on import. A consumer bundles it as a worker
|
|
5
|
+
* and passes its URL as `workerSrc`, such as Vite's
|
|
6
|
+
* `import workerSrc from '@scalewing/react/document-viewer-worker?worker&url'`,
|
|
7
|
+
* so the viewer and its worker are always the same version.
|
|
8
|
+
*/
|
|
9
|
+
import 'pdfjs-dist/legacy/build/pdf.worker.min.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,15 @@ export { ActionMenu, type ActionMenuAlign, type ActionMenuItem, type ActionMenuP
|
|
|
2
2
|
export { ActionBar, type ActionBarProps, type ActionBarSummary, type ActionBarSummaryTone, } from './components/ActionBar.js';
|
|
3
3
|
export { Accordion } from './components/Accordion.js';
|
|
4
4
|
export type { AccordionProps, AccordionSize } from './components/Accordion.js';
|
|
5
|
-
export { Switch, type SwitchProps } from './components/Switch.js';
|
|
6
|
-
export { DateField, type DateFieldLabels, type DateFieldProps, type WeekStart, } from './components/DateField.js';
|
|
5
|
+
export { Switch, switchCheckedTones, switchLayouts, type SwitchCheckedTone, type SwitchLayout, type SwitchProps, } from './components/Switch.js';
|
|
6
|
+
export { DateField, dateFieldEntries, type DateFieldEntry, type DateFieldLabels, type DateFieldProps, type WeekStart, } from './components/DateField.js';
|
|
7
7
|
export { CalendarButton, type CalendarButtonLabels, type CalendarButtonProps, type CalendarButtonRange, } from './components/CalendarButton.js';
|
|
8
8
|
export { DateRangeButton, type DateRangeButtonLabels, type DateRangeButtonProps, type DateRangeButtonValue, type DateRangePreset, } from './components/DateRangeButton.js';
|
|
9
|
+
export { Article, articleTitleElements, type ArticleCover, type ArticleProps, type ArticleTitleElement, } from './components/Article.js';
|
|
10
|
+
export { FileField, type FileFieldProps, type FileFieldValue, } from './components/FileField.js';
|
|
11
|
+
export { DocumentViewer, type DocumentViewerLabels, type DocumentViewerProps, } from './components/DocumentViewer.js';
|
|
9
12
|
export { ListGroup, type ListGroupProps } from './components/ListGroup.js';
|
|
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';
|
|
10
14
|
export { ListRow, type ListRowProps } from './components/ListRow.js';
|
|
11
15
|
export { listGroupVariants, listRowTitleAppearances, listRowTones, listRowValueTones, type ListGroupMaxHeight, type ListGroupVariant, type ListRowTitleAppearance, type ListRowTone, type ListRowValueTone, } from './list-options.js';
|
|
12
16
|
export { Checkbox, type CheckboxProps } from './components/Checkbox.js';
|
|
@@ -19,7 +23,7 @@ export { InfoTip, type InfoTipProps } from './components/InfoTip.js';
|
|
|
19
23
|
export { RadioGroup, type RadioGroupOption, type RadioGroupProps, } from './components/RadioGroup.js';
|
|
20
24
|
export { AppHeader, appHeaderAppearances, type AppHeaderAppearance, type AppHeaderProps, } from './components/AppHeader.js';
|
|
21
25
|
export { Badge, type BadgeProps, type BadgeSize, type BadgeTone, badgeSizes, badgeTones, } from './components/Badge.js';
|
|
22
|
-
export { BarChart, type BarChartItem, type BarChartProps, type BarChartTone, barChartTones, } from './components/BarChart.js';
|
|
26
|
+
export { BarChart, barChartAppearances, type BarChartAppearance, type BarChartItem, type BarChartProps, type BarChartTone, barChartTones, } from './components/BarChart.js';
|
|
23
27
|
export { ChartLegend, type ChartFillTone, type ChartLegendItem, type ChartLegendProps, type ChartLegendSwatch, type ChartStrokeTone, type ChartTone, chartFillTones, chartLegendSwatches, chartStrokeTones, } from './components/ChartLegend.js';
|
|
24
28
|
export { ColumnChart, type ColumnChartCallout, type ColumnChartLine, type ColumnChartMode, type ColumnChartProps, type ColumnChartSeries, columnChartModes, } from './components/ColumnChart.js';
|
|
25
29
|
export { LineChart, type LineChartCurve, type LineChartMarker, type LineChartPeriod, type LineChartPoint, type LineChartProps, lineChartCurves, } from './components/LineChart.js';
|
|
@@ -37,6 +41,7 @@ export { TabPanel, type TabItem, type TabPanelProps, Tabs, type TabsProps, tabId
|
|
|
37
41
|
export { Toast, toastPlacements, toastTones, type ToastAction, type ToastPlacement, } from './components/Toast.js';
|
|
38
42
|
export type { ToastProps, ToastTone } from './components/Toast.js';
|
|
39
43
|
export { Field, fieldVariants, type FieldProps, type FieldSize, type FieldVariant, } from './components/Field.js';
|
|
44
|
+
export { fieldWidths, type FieldWidth } from './css/css-field-width.js';
|
|
40
45
|
export { requiredMarks, type RequiredMark, } from './components/FieldLabelText.js';
|
|
41
46
|
export { Step, type StepHeadingLevel, type StepProps, Steps, type StepsLabels, type StepsProps, type StepStatus, } from './components/Steps.js';
|
|
42
47
|
export { Stepper, stepperLimitAppearances, type StepperLimitAppearance, type StepperProps, type StepperWidth, } from './components/Stepper.js';
|
|
@@ -44,9 +49,9 @@ export { Inline, type InlineProps } from './components/Inline.js';
|
|
|
44
49
|
export { Split } from './components/Split.js';
|
|
45
50
|
export type { SplitProps } from './components/Split.js';
|
|
46
51
|
export { Nav, navAppearances, type NavAppearance, type NavProps, } from './components/Nav.js';
|
|
47
|
-
export { NavCount, type NavCountProps } from './components/NavCount.js';
|
|
52
|
+
export { NavCount, navCountTones, type NavCountProps, type NavCountTone, } from './components/NavCount.js';
|
|
48
53
|
export { SectionNav, sectionNavAppearances, type SectionNavAppearance, type SectionNavItem, type SectionNavProps, } from './components/SectionNav.js';
|
|
49
|
-
export { SegmentedControl, type SegmentedControlProps, type SegmentedControlVariant, type SegmentedItem, } from './components/SegmentedControl.js';
|
|
54
|
+
export { SegmentedControl, type SegmentedControlProps, type SegmentedControlVariant, segmentedSizes, type SegmentedSize, type SegmentedItem, } from './components/SegmentedControl.js';
|
|
50
55
|
export { Combobox, comboboxSizes, type ComboboxAction, type ComboboxBadge, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type ComboboxSize, } from './components/Combobox.js';
|
|
51
56
|
export { Select } from './components/Select.js';
|
|
52
57
|
export type { SelectAction, SelectOption, SelectProps, SelectWidth, } from './components/Select.js';
|
|
@@ -55,6 +60,7 @@ export { Stack, type Align, type Justify, type StackProps, } from './components/
|
|
|
55
60
|
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 TableMaxHeight, type TableProps, type TableRowProps, type TableRowVariant, type TableSort, type TableStickyHeader, type TableVerticalAlign, } from './components/Table.js';
|
|
56
61
|
export { Text, type TextAlign, type TextElement, type TextProps, } from './components/Text.js';
|
|
57
62
|
export { ThemeProvider, useTheme, type ThemeProviderProps, } from './theme/ThemeProvider.js';
|
|
63
|
+
export { themeCanvases, type ThemeCanvas } from './css/css-canvas-grouped.js';
|
|
58
64
|
export { utilityClassCatalog } from './css/stylesheet.js';
|
|
59
65
|
export type { VisibilityProps } from './visibility-classes.js';
|
|
60
66
|
export type { Breakpoint, BreakpointDirection, VisibilityBreakpoint, } from './css/breakpoints.js';
|
|
@@ -67,7 +73,7 @@ export { Grid } from './components/Grid.js';
|
|
|
67
73
|
export type { GridColumns, GridProps } from './components/Grid.js';
|
|
68
74
|
export type { GridColumnSpan } from './css/css-grid-span.js';
|
|
69
75
|
export type { ColumnSpanProps } from './column-span-classes.js';
|
|
70
|
-
export { DenominationGrid, denominationCellToneAppearances, denominationGridFrames, denominationLabelAppearances, denominationTotalEmphases, } from './components/DenominationGrid.js';
|
|
71
|
-
export type { DenominationCellToneAppearance, DenominationGridColumn, DenominationGridEntry, DenominationGridFrame, DenominationGridLayout, DenominationGridProps, DenominationGridRow, DenominationGridRowEmphasis, DenominationGridRowRole, DenominationGridTone, DenominationGridValueRow, DenominationLabelAppearance, DenominationLabelWidth, DenominationTotalEmphasis, } from './components/DenominationGrid.js';
|
|
72
|
-
export { FilterChips } from './components/FilterChips.js';
|
|
73
|
-
export type { FilterChipOption, FilterChipsProps, } from './components/FilterChips.js';
|
|
76
|
+
export { DenominationGrid, denominationCellToneAppearances, denominationGridFrames, denominationLabelAppearances, denominationNegativeAppearances, denominationTotalEmphases, denominationTransposeBreakpoints, } from './components/DenominationGrid.js';
|
|
77
|
+
export type { DenominationCellToneAppearance, DenominationGridColumn, DenominationGridEntry, DenominationGridFrame, DenominationGridLayout, DenominationGridNegativeAppearance, DenominationGridProps, DenominationGridRow, DenominationGridRowEmphasis, DenominationGridRowRole, DenominationGridTone, DenominationGridValueRow, DenominationLabelAppearance, DenominationLabelWidth, DenominationTotalEmphasis, DenominationTransposeBreakpoint, } from './components/DenominationGrid.js';
|
|
78
|
+
export { FilterChips, filterChipCountAppearances, filterChipsOverflows, } from './components/FilterChips.js';
|
|
79
|
+
export type { FilterChipCountAppearance, FilterChipOption, FilterChipsOverflow, FilterChipsProps, } from './components/FilterChips.js';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export { ActionMenu, actionMenuTriggerAppearances, } from './components/ActionMenu.js';
|
|
2
2
|
export { ActionBar, } from './components/ActionBar.js';
|
|
3
3
|
export { Accordion } from './components/Accordion.js';
|
|
4
|
-
export { Switch } from './components/Switch.js';
|
|
5
|
-
export { DateField, } from './components/DateField.js';
|
|
4
|
+
export { Switch, switchCheckedTones, switchLayouts, } from './components/Switch.js';
|
|
5
|
+
export { DateField, dateFieldEntries, } from './components/DateField.js';
|
|
6
6
|
export { CalendarButton, } from './components/CalendarButton.js';
|
|
7
7
|
export { DateRangeButton, } from './components/DateRangeButton.js';
|
|
8
|
+
export { Article, articleTitleElements, } from './components/Article.js';
|
|
9
|
+
export { FileField, } from './components/FileField.js';
|
|
10
|
+
export { DocumentViewer, } from './components/DocumentViewer.js';
|
|
8
11
|
export { ListGroup } from './components/ListGroup.js';
|
|
12
|
+
export { inspectMarkdown, markdownOmissionKinds, MarkdownView, } from './components/MarkdownView.js';
|
|
9
13
|
export { ListRow } from './components/ListRow.js';
|
|
10
14
|
export { listGroupVariants, listRowTitleAppearances, listRowTones, listRowValueTones, } from './list-options.js';
|
|
11
15
|
export { Checkbox } from './components/Checkbox.js';
|
|
@@ -18,7 +22,7 @@ export { InfoTip } from './components/InfoTip.js';
|
|
|
18
22
|
export { RadioGroup, } from './components/RadioGroup.js';
|
|
19
23
|
export { AppHeader, appHeaderAppearances, } from './components/AppHeader.js';
|
|
20
24
|
export { Badge, badgeSizes, badgeTones, } from './components/Badge.js';
|
|
21
|
-
export { BarChart, barChartTones, } from './components/BarChart.js';
|
|
25
|
+
export { BarChart, barChartAppearances, barChartTones, } from './components/BarChart.js';
|
|
22
26
|
export { ChartLegend, chartFillTones, chartLegendSwatches, chartStrokeTones, } from './components/ChartLegend.js';
|
|
23
27
|
export { ColumnChart, columnChartModes, } from './components/ColumnChart.js';
|
|
24
28
|
export { LineChart, lineChartCurves, } from './components/LineChart.js';
|
|
@@ -35,15 +39,16 @@ export { StatTile, statTileAppearances, statTileTones, } from './components/Stat
|
|
|
35
39
|
export { TabPanel, Tabs, tabId, tabPanelId, } from './components/Tabs.js';
|
|
36
40
|
export { Toast, toastPlacements, toastTones, } from './components/Toast.js';
|
|
37
41
|
export { Field, fieldVariants, } from './components/Field.js';
|
|
42
|
+
export { fieldWidths } from './css/css-field-width.js';
|
|
38
43
|
export { requiredMarks, } from './components/FieldLabelText.js';
|
|
39
44
|
export { Step, Steps, } from './components/Steps.js';
|
|
40
45
|
export { Stepper, stepperLimitAppearances, } from './components/Stepper.js';
|
|
41
46
|
export { Inline } from './components/Inline.js';
|
|
42
47
|
export { Split } from './components/Split.js';
|
|
43
48
|
export { Nav, navAppearances, } from './components/Nav.js';
|
|
44
|
-
export { NavCount } from './components/NavCount.js';
|
|
49
|
+
export { NavCount, navCountTones, } from './components/NavCount.js';
|
|
45
50
|
export { SectionNav, sectionNavAppearances, } from './components/SectionNav.js';
|
|
46
|
-
export { SegmentedControl, } from './components/SegmentedControl.js';
|
|
51
|
+
export { SegmentedControl, segmentedSizes, } from './components/SegmentedControl.js';
|
|
47
52
|
export { Combobox, comboboxSizes, } from './components/Combobox.js';
|
|
48
53
|
export { Select } from './components/Select.js';
|
|
49
54
|
export { MultiSelect, } from './components/MultiSelect.js';
|
|
@@ -51,10 +56,11 @@ export { Stack, } from './components/Stack.js';
|
|
|
51
56
|
export { Table, TableBody, TableCell, TableFooter, TableHeader, TableRow, tableCellTones, tableRowVariants, } from './components/Table.js';
|
|
52
57
|
export { Text, } from './components/Text.js';
|
|
53
58
|
export { ThemeProvider, useTheme, } from './theme/ThemeProvider.js';
|
|
59
|
+
export { themeCanvases } from './css/css-canvas-grouped.js';
|
|
54
60
|
export { utilityClassCatalog } from './css/stylesheet.js';
|
|
55
61
|
export { breakpointQuery } from './css/breakpoints.js';
|
|
56
62
|
export { Separator } from './components/Separator.js';
|
|
57
63
|
export { DescriptionItem, DescriptionList, } from './components/DescriptionList.js';
|
|
58
64
|
export { Grid } from './components/Grid.js';
|
|
59
|
-
export { DenominationGrid, denominationCellToneAppearances, denominationGridFrames, denominationLabelAppearances, denominationTotalEmphases, } from './components/DenominationGrid.js';
|
|
60
|
-
export { FilterChips } from './components/FilterChips.js';
|
|
65
|
+
export { DenominationGrid, denominationCellToneAppearances, denominationGridFrames, denominationLabelAppearances, denominationNegativeAppearances, denominationTotalEmphases, denominationTransposeBreakpoints, } from './components/DenominationGrid.js';
|
|
66
|
+
export { FilterChips, filterChipCountAppearances, filterChipsOverflows, } from './components/FilterChips.js';
|
package/dist/list-options.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties } from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type BadgeTone } from './css/css-data.js';
|
|
3
|
+
import { listRowValueTones, type ListRowValueTone } from './css/css-list-row.js';
|
|
3
4
|
/**
|
|
4
5
|
* `panel` (the default) is one bordered panel on the surface; `plain`
|
|
5
6
|
* draws no panel and a hairline above the first row too, for rows inside
|
|
@@ -21,9 +22,7 @@ export type ListRowTone = (typeof listRowTones)[number];
|
|
|
21
22
|
/** `strong` (the default) sets the title at the label weight; `plain` at the body's. */
|
|
22
23
|
export declare const listRowTitleAppearances: readonly ["strong", "plain"];
|
|
23
24
|
export type ListRowTitleAppearance = (typeof listRowTitleAppearances)[number];
|
|
24
|
-
|
|
25
|
-
export declare const listRowValueTones: readonly ["success", "danger", "muted", "accent"];
|
|
26
|
-
export type ListRowValueTone = TableCellTone;
|
|
25
|
+
export { listRowValueTones, type ListRowValueTone };
|
|
27
26
|
/** What ends a row: a chevron (it opens something), a check (chosen), or none. */
|
|
28
27
|
export type ListRowAccessory = 'chevron' | 'check' | 'none';
|
|
29
28
|
export type ListGroupInput = {
|
|
@@ -48,14 +47,19 @@ export type ListRowInput = {
|
|
|
48
47
|
accessory: unknown;
|
|
49
48
|
value: string | undefined;
|
|
50
49
|
valueDetail: string | undefined;
|
|
50
|
+
valueBadge: BadgeTone | undefined;
|
|
51
51
|
selected: boolean | undefined;
|
|
52
52
|
pressable: boolean;
|
|
53
|
+
unread: boolean;
|
|
54
|
+
unreadLabel: string | undefined;
|
|
53
55
|
};
|
|
54
56
|
/**
|
|
55
57
|
* Fails closed on a ListRow it cannot draw: an empty title or value, an
|
|
56
|
-
* unknown tone, title appearance, value tone or accessory, a
|
|
57
|
-
*
|
|
58
|
-
*
|
|
58
|
+
* unknown tone, title appearance, value tone, badge tone or accessory, a
|
|
59
|
+
* `valueDetail`, `valueTone` or `valueBadge` with no value, a value both
|
|
60
|
+
* toned and a badge, `selected` on a row that is not a button or link
|
|
61
|
+
* (its check would be a state nothing can read), or an unread row with no
|
|
62
|
+
* words for its dot (a colour alone says nothing).
|
|
59
63
|
*/
|
|
60
64
|
export declare function assertListRow(input: ListRowInput): void;
|
|
61
65
|
/**
|
package/dist/list-options.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { badgeTones } from './css/css-data.js';
|
|
2
|
+
import { listRowValueTones, } from './css/css-list-row.js';
|
|
2
3
|
import { isOneOf } from './is-one-of.js';
|
|
3
4
|
/**
|
|
4
5
|
* `panel` (the default) is one bordered panel on the surface; `plain`
|
|
@@ -10,8 +11,7 @@ export const listGroupVariants = ['panel', 'plain'];
|
|
|
10
11
|
export const listRowTones = ['default', 'danger'];
|
|
11
12
|
/** `strong` (the default) sets the title at the label weight; `plain` at the body's. */
|
|
12
13
|
export const listRowTitleAppearances = ['strong', 'plain'];
|
|
13
|
-
|
|
14
|
-
export const listRowValueTones = tableCellTones;
|
|
14
|
+
export { listRowValueTones };
|
|
15
15
|
function isBlank(text) {
|
|
16
16
|
return typeof text !== 'string' || text.trim() === '';
|
|
17
17
|
}
|
|
@@ -39,9 +39,11 @@ export function listMaxHeightStyle(maxHeight) {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Fails closed on a ListRow it cannot draw: an empty title or value, an
|
|
42
|
-
* unknown tone, title appearance, value tone or accessory, a
|
|
43
|
-
*
|
|
44
|
-
*
|
|
42
|
+
* unknown tone, title appearance, value tone, badge tone or accessory, a
|
|
43
|
+
* `valueDetail`, `valueTone` or `valueBadge` with no value, a value both
|
|
44
|
+
* toned and a badge, `selected` on a row that is not a button or link
|
|
45
|
+
* (its check would be a state nothing can read), or an unread row with no
|
|
46
|
+
* words for its dot (a colour alone says nothing).
|
|
45
47
|
*/
|
|
46
48
|
export function assertListRow(input) {
|
|
47
49
|
if (isBlank(input.title))
|
|
@@ -55,13 +57,23 @@ export function assertListRow(input) {
|
|
|
55
57
|
throw new RangeError(`Unknown ListRow valueTone: ${String(input.valueTone)}`);
|
|
56
58
|
if (!isOneOf(['chevron', 'none'], input.accessory))
|
|
57
59
|
throw new RangeError(`Unknown ListRow accessory: ${String(input.accessory)}`);
|
|
60
|
+
if (input.valueBadge !== undefined && !isOneOf(badgeTones, input.valueBadge))
|
|
61
|
+
throw new RangeError(`Unknown ListRow valueBadge: ${String(input.valueBadge)}`);
|
|
62
|
+
if (input.valueBadge !== undefined && input.valueTone !== undefined)
|
|
63
|
+
throw new RangeError('A ListRow value is a toned figure or a badge, not both');
|
|
58
64
|
if (input.value !== undefined && isBlank(input.value))
|
|
59
65
|
throw new RangeError('ListRow value must be non-empty text');
|
|
66
|
+
if (input.unreadLabel !== undefined && isBlank(input.unreadLabel))
|
|
67
|
+
throw new RangeError('ListRow unreadLabel must be non-empty text');
|
|
68
|
+
if (input.unread && input.unreadLabel === undefined)
|
|
69
|
+
throw new RangeError('An unread ListRow needs an unreadLabel to say so');
|
|
60
70
|
if (input.selected !== undefined && !input.pressable)
|
|
61
71
|
throw new RangeError('A ListRow choice (selected) needs onPress or href to say its state');
|
|
62
72
|
if (input.value === undefined &&
|
|
63
|
-
(input.valueDetail !== undefined ||
|
|
64
|
-
|
|
73
|
+
(input.valueDetail !== undefined ||
|
|
74
|
+
input.valueTone !== undefined ||
|
|
75
|
+
input.valueBadge !== undefined))
|
|
76
|
+
throw new RangeError('ListRow valueDetail, valueTone and valueBadge need a value');
|
|
65
77
|
}
|
|
66
78
|
/**
|
|
67
79
|
* The row's end: a check while `selected`, nothing for an unchosen choice,
|