@scalewing/react 1.41.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 +14 -0
- package/README.md +120 -1
- package/dist/components/Article.d.ts +60 -0
- package/dist/components/Article.js +42 -0
- package/dist/components/DocumentViewer.d.ts +41 -0
- package/dist/components/DocumentViewer.js +72 -0
- package/dist/components/FileField.d.ts +44 -0
- package/dist/components/FileField.js +66 -0
- package/dist/components/ListRow.d.ts +23 -2
- package/dist/components/ListRow.js +17 -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/chart/use-chart-width.js +2 -24
- 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/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/list/ListRowContent.d.ts +6 -2
- package/dist/components/list/ListRowContent.js +5 -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/css-article.d.ts +2 -0
- package/dist/css/css-article.js +110 -0
- package/dist/css/css-components.js +12 -0
- package/dist/css/css-count-pill.js +14 -1
- package/dist/css/css-document-viewer.d.ts +2 -0
- package/dist/css/css-document-viewer.js +186 -0
- package/dist/css/css-file-field.d.ts +2 -0
- package/dist/css/css-file-field.js +180 -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.js +5 -1
- package/dist/css/css-markdown.d.ts +2 -0
- package/dist/css/css-markdown.js +144 -0
- package/dist/css/css-variables.js +1 -0
- package/dist/css/stylesheet.js +8 -0
- package/dist/document-viewer-worker.d.ts +9 -0
- package/dist/document-viewer-worker.js +9 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +5 -1
- package/dist/list-options.d.ts +5 -2
- package/dist/list-options.js +7 -2
- package/dist/styles.css +504 -0
- package/package.json +10 -2
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,11 @@ export { Switch, switchCheckedTones, switchLayouts, type SwitchCheckedTone, type
|
|
|
6
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';
|
|
@@ -45,7 +49,7 @@ export { Inline, type InlineProps } from './components/Inline.js';
|
|
|
45
49
|
export { Split } from './components/Split.js';
|
|
46
50
|
export type { SplitProps } from './components/Split.js';
|
|
47
51
|
export { Nav, navAppearances, type NavAppearance, type NavProps, } from './components/Nav.js';
|
|
48
|
-
export { NavCount, type NavCountProps } from './components/NavCount.js';
|
|
52
|
+
export { NavCount, navCountTones, type NavCountProps, type NavCountTone, } from './components/NavCount.js';
|
|
49
53
|
export { SectionNav, sectionNavAppearances, type SectionNavAppearance, type SectionNavItem, type SectionNavProps, } from './components/SectionNav.js';
|
|
50
54
|
export { SegmentedControl, type SegmentedControlProps, type SegmentedControlVariant, segmentedSizes, type SegmentedSize, type SegmentedItem, } from './components/SegmentedControl.js';
|
|
51
55
|
export { Combobox, comboboxSizes, type ComboboxAction, type ComboboxBadge, type ComboboxGroup, type ComboboxOption, type ComboboxProps, type ComboboxSize, } from './components/Combobox.js';
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,11 @@ export { Switch, switchCheckedTones, switchLayouts, } from './components/Switch.
|
|
|
5
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';
|
|
@@ -42,7 +46,7 @@ export { Stepper, stepperLimitAppearances, } from './components/Stepper.js';
|
|
|
42
46
|
export { Inline } from './components/Inline.js';
|
|
43
47
|
export { Split } from './components/Split.js';
|
|
44
48
|
export { Nav, navAppearances, } from './components/Nav.js';
|
|
45
|
-
export { NavCount } from './components/NavCount.js';
|
|
49
|
+
export { NavCount, navCountTones, } from './components/NavCount.js';
|
|
46
50
|
export { SectionNav, sectionNavAppearances, } from './components/SectionNav.js';
|
|
47
51
|
export { SegmentedControl, segmentedSizes, } from './components/SegmentedControl.js';
|
|
48
52
|
export { Combobox, comboboxSizes, } from './components/Combobox.js';
|
package/dist/list-options.d.ts
CHANGED
|
@@ -50,13 +50,16 @@ export type ListRowInput = {
|
|
|
50
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
58
|
* unknown tone, title appearance, value tone, badge tone or accessory, a
|
|
57
59
|
* `valueDetail`, `valueTone` or `valueBadge` with no value, a value both
|
|
58
|
-
* toned and a badge,
|
|
59
|
-
* (its check would be a state nothing can read)
|
|
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).
|
|
60
63
|
*/
|
|
61
64
|
export declare function assertListRow(input: ListRowInput): void;
|
|
62
65
|
/**
|
package/dist/list-options.js
CHANGED
|
@@ -41,8 +41,9 @@ export function listMaxHeightStyle(maxHeight) {
|
|
|
41
41
|
* Fails closed on a ListRow it cannot draw: an empty title or value, an
|
|
42
42
|
* unknown tone, title appearance, value tone, badge tone or accessory, a
|
|
43
43
|
* `valueDetail`, `valueTone` or `valueBadge` with no value, a value both
|
|
44
|
-
* toned and a badge,
|
|
45
|
-
* (its check would be a state nothing can read)
|
|
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).
|
|
46
47
|
*/
|
|
47
48
|
export function assertListRow(input) {
|
|
48
49
|
if (isBlank(input.title))
|
|
@@ -62,6 +63,10 @@ export function assertListRow(input) {
|
|
|
62
63
|
throw new RangeError('A ListRow value is a toned figure or a badge, not both');
|
|
63
64
|
if (input.value !== undefined && isBlank(input.value))
|
|
64
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');
|
|
65
70
|
if (input.selected !== undefined && !input.pressable)
|
|
66
71
|
throw new RangeError('A ListRow choice (selected) needs onPress or href to say its state');
|
|
67
72
|
if (input.value === undefined &&
|
package/dist/styles.css
CHANGED
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
--sw-dialog-max: 32rem;
|
|
58
58
|
--sw-dialog-max-lg: 56rem;
|
|
59
59
|
--sw-dialog-max-xl: 65rem;
|
|
60
|
+
--sw-reading-max: 46rem;
|
|
60
61
|
--sw-select-max: 16rem;
|
|
61
62
|
--sw-split-min: 14rem;
|
|
62
63
|
--sw-split-size: 22rem;
|
|
@@ -130,6 +131,7 @@
|
|
|
130
131
|
--sw-dialog-max: 32rem;
|
|
131
132
|
--sw-dialog-max-lg: 56rem;
|
|
132
133
|
--sw-dialog-max-xl: 65rem;
|
|
134
|
+
--sw-reading-max: 46rem;
|
|
133
135
|
--sw-select-max: 16rem;
|
|
134
136
|
--sw-split-min: 14rem;
|
|
135
137
|
--sw-split-size: 22rem;
|
|
@@ -2940,6 +2942,497 @@ body {
|
|
|
2940
2942
|
.sw-list-row-check { border-color: CanvasText; }
|
|
2941
2943
|
}
|
|
2942
2944
|
|
|
2945
|
+
.sw-list-row-unread {
|
|
2946
|
+
border: calc(var(--sw-space-2) / 2) solid var(--sw-color-accent);
|
|
2947
|
+
border-radius: var(--sw-radius-pill);
|
|
2948
|
+
box-sizing: border-box;
|
|
2949
|
+
display: inline-block;
|
|
2950
|
+
height: var(--sw-space-2);
|
|
2951
|
+
margin-inline-start: var(--sw-space-2);
|
|
2952
|
+
vertical-align: middle;
|
|
2953
|
+
width: var(--sw-space-2);
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2956
|
+
@media (forced-colors: active) {
|
|
2957
|
+
.sw-list-row-unread { border-color: CanvasText; }
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
.sw-list-row-tag {
|
|
2961
|
+
align-self: center;
|
|
2962
|
+
display: inline-flex;
|
|
2963
|
+
flex: none;
|
|
2964
|
+
white-space: nowrap;
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2967
|
+
.sw-list-item-action {
|
|
2968
|
+
align-items: center;
|
|
2969
|
+
display: flex;
|
|
2970
|
+
}
|
|
2971
|
+
|
|
2972
|
+
.sw-list-item-action > .sw-list-row {
|
|
2973
|
+
flex: 1 1 auto;
|
|
2974
|
+
min-width: 0;
|
|
2975
|
+
padding-inline-end: var(--sw-space-2);
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
.sw-list-row-action {
|
|
2979
|
+
display: inline-flex;
|
|
2980
|
+
flex: none;
|
|
2981
|
+
padding-inline-end: var(--sw-space-4);
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
.sw-list-group-plain .sw-list-row-action { padding-inline-end: 0; }
|
|
2985
|
+
|
|
2986
|
+
@supports selector(:has(*)) {
|
|
2987
|
+
@media (hover: hover) {
|
|
2988
|
+
.sw-list-item-action:has(> .sw-list-row-pressable:hover:not(.sw-list-row-disabled)) {
|
|
2989
|
+
background: color-mix(in srgb, var(--sw-color-muted) 16%, transparent);
|
|
2990
|
+
}
|
|
2991
|
+
|
|
2992
|
+
.sw-list-item-action > .sw-list-row-pressable:hover:not(.sw-list-row-disabled) {
|
|
2993
|
+
background: transparent;
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
.sw-file-field-frame {
|
|
2999
|
+
border: 1px solid var(--sw-color-border);
|
|
3000
|
+
border-radius: var(--sw-radius-md);
|
|
3001
|
+
box-sizing: border-box;
|
|
3002
|
+
min-width: 0;
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
.sw-file-field-empty { background: var(--sw-color-subtle); }
|
|
3006
|
+
|
|
3007
|
+
.sw-file-field-chosen {
|
|
3008
|
+
align-items: center;
|
|
3009
|
+
background: var(--sw-color-surface);
|
|
3010
|
+
display: flex;
|
|
3011
|
+
flex-wrap: wrap;
|
|
3012
|
+
gap: var(--sw-space-2) var(--sw-space-3);
|
|
3013
|
+
padding: var(--sw-space-2) var(--sw-space-2) var(--sw-space-2) var(--sw-space-4);
|
|
3014
|
+
}
|
|
3015
|
+
|
|
3016
|
+
.sw-field-invalid .sw-file-field-frame { border-color: var(--sw-color-danger); }
|
|
3017
|
+
|
|
3018
|
+
/* A drag wins over an error's edge: it says where the file goes. */
|
|
3019
|
+
.sw-file-field-frame.sw-file-field-dragging {
|
|
3020
|
+
background: var(--sw-color-accentSubtle);
|
|
3021
|
+
border-color: var(--sw-color-accent);
|
|
3022
|
+
outline: 1px solid var(--sw-color-accent);
|
|
3023
|
+
}
|
|
3024
|
+
|
|
3025
|
+
/* On the tint, muted words fall under 4.5:1 in light palettes: every word takes the text colour. */
|
|
3026
|
+
.sw-file-field-dragging :is(.sw-file-field-choose, .sw-file-field-drop, .sw-file-field-detail, .sw-file-field-icon) {
|
|
3027
|
+
color: var(--sw-color-text);
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3030
|
+
/* Disabled, the frame's hairline is dashed, as a disabled text control's. */
|
|
3031
|
+
.sw-file-field-disabled { border-style: dashed; }
|
|
3032
|
+
|
|
3033
|
+
.sw-file-field-zone {
|
|
3034
|
+
align-items: center;
|
|
3035
|
+
appearance: none;
|
|
3036
|
+
background: transparent;
|
|
3037
|
+
border: 0;
|
|
3038
|
+
border-radius: inherit;
|
|
3039
|
+
box-sizing: border-box;
|
|
3040
|
+
color: var(--sw-color-text);
|
|
3041
|
+
cursor: pointer;
|
|
3042
|
+
display: flex;
|
|
3043
|
+
flex-wrap: wrap;
|
|
3044
|
+
font-family: var(--sw-font-sans);
|
|
3045
|
+
font-size: 15px;
|
|
3046
|
+
gap: var(--sw-space-1);
|
|
3047
|
+
justify-content: center;
|
|
3048
|
+
line-height: 20px;
|
|
3049
|
+
margin: 0;
|
|
3050
|
+
min-height: var(--sw-control-md-min-height);
|
|
3051
|
+
padding: var(--sw-space-6) var(--sw-space-4);
|
|
3052
|
+
text-align: center;
|
|
3053
|
+
width: 100%;
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
.sw-file-field-zone:focus { outline: none; }
|
|
3057
|
+
|
|
3058
|
+
.sw-file-field-zone:focus-visible {
|
|
3059
|
+
outline: var(--sw-focus-ring-width) solid var(--sw-color-accent);
|
|
3060
|
+
outline-offset: calc(-1 * var(--sw-focus-ring-width));
|
|
3061
|
+
}
|
|
3062
|
+
|
|
3063
|
+
.sw-file-field-choose {
|
|
3064
|
+
color: var(--sw-color-text);
|
|
3065
|
+
font-weight: 600;
|
|
3066
|
+
}
|
|
3067
|
+
|
|
3068
|
+
.sw-file-field-drop { color: var(--sw-color-muted); }
|
|
3069
|
+
|
|
3070
|
+
.sw-file-field-zone:disabled {
|
|
3071
|
+
background-color: var(--sw-color-subtle);
|
|
3072
|
+
border-style: dashed;
|
|
3073
|
+
cursor: not-allowed;
|
|
3074
|
+
opacity: 1;
|
|
3075
|
+
-webkit-text-fill-color: currentColor;
|
|
3076
|
+
border-radius: inherit;
|
|
3077
|
+
}
|
|
3078
|
+
|
|
3079
|
+
.sw-file-field-zone:disabled .sw-file-field-choose { color: var(--sw-color-muted); }
|
|
3080
|
+
|
|
3081
|
+
@media (pointer: coarse) {
|
|
3082
|
+
.sw-file-field-drop { display: none; }
|
|
3083
|
+
}
|
|
3084
|
+
|
|
3085
|
+
.sw-file-field-icon {
|
|
3086
|
+
align-items: center;
|
|
3087
|
+
color: var(--sw-color-muted);
|
|
3088
|
+
display: flex;
|
|
3089
|
+
flex: none;
|
|
3090
|
+
}
|
|
3091
|
+
|
|
3092
|
+
.sw-file-field-file {
|
|
3093
|
+
display: flex;
|
|
3094
|
+
flex: 1 1 calc(4 * var(--sw-space-8));
|
|
3095
|
+
flex-direction: column;
|
|
3096
|
+
min-width: 0;
|
|
3097
|
+
}
|
|
3098
|
+
|
|
3099
|
+
.sw-file-field-name {
|
|
3100
|
+
font-size: 15px;
|
|
3101
|
+
font-weight: 600;
|
|
3102
|
+
line-height: 20px;
|
|
3103
|
+
overflow-wrap: anywhere;
|
|
3104
|
+
}
|
|
3105
|
+
|
|
3106
|
+
.sw-file-field-detail {
|
|
3107
|
+
color: var(--sw-color-muted);
|
|
3108
|
+
font-size: 13px;
|
|
3109
|
+
line-height: 18px;
|
|
3110
|
+
}
|
|
3111
|
+
|
|
3112
|
+
.sw-file-field-chosen > .sw-button {
|
|
3113
|
+
flex: none;
|
|
3114
|
+
margin-inline-start: auto;
|
|
3115
|
+
}
|
|
3116
|
+
|
|
3117
|
+
@media (forced-colors: active) {
|
|
3118
|
+
.sw-file-field-frame { border-color: CanvasText; }
|
|
3119
|
+
.sw-field-invalid .sw-file-field-frame { border-color: Mark; }
|
|
3120
|
+
.sw-file-field-frame.sw-file-field-dragging { border-color: Highlight; outline-color: Highlight; }
|
|
3121
|
+
.sw-file-field-choose { color: ButtonText; }
|
|
3122
|
+
.sw-file-field-zone:disabled,
|
|
3123
|
+
.sw-file-field-zone:disabled .sw-file-field-choose { color: GrayText; }
|
|
3124
|
+
}
|
|
3125
|
+
|
|
3126
|
+
.sw-article {
|
|
3127
|
+
box-sizing: border-box;
|
|
3128
|
+
display: flex;
|
|
3129
|
+
flex-direction: column;
|
|
3130
|
+
max-inline-size: var(--sw-reading-max);
|
|
3131
|
+
min-width: 0;
|
|
3132
|
+
}
|
|
3133
|
+
|
|
3134
|
+
.sw-article-cover {
|
|
3135
|
+
aspect-ratio: 3 / 1;
|
|
3136
|
+
background: var(--sw-color-subtle);
|
|
3137
|
+
border-start-end-radius: inherit;
|
|
3138
|
+
border-start-start-radius: inherit;
|
|
3139
|
+
display: block;
|
|
3140
|
+
inline-size: 100%;
|
|
3141
|
+
object-fit: cover;
|
|
3142
|
+
}
|
|
3143
|
+
|
|
3144
|
+
.sw-article-body {
|
|
3145
|
+
display: flex;
|
|
3146
|
+
flex-direction: column;
|
|
3147
|
+
min-width: 0;
|
|
3148
|
+
padding: var(--sw-space-6) var(--sw-space-8);
|
|
3149
|
+
}
|
|
3150
|
+
|
|
3151
|
+
.sw-article-header {
|
|
3152
|
+
display: flex;
|
|
3153
|
+
flex-direction: column;
|
|
3154
|
+
margin-block-end: var(--sw-space-3);
|
|
3155
|
+
min-width: 0;
|
|
3156
|
+
}
|
|
3157
|
+
|
|
3158
|
+
.sw-article-top {
|
|
3159
|
+
align-items: center;
|
|
3160
|
+
display: flex;
|
|
3161
|
+
flex-wrap: wrap;
|
|
3162
|
+
gap: var(--sw-space-3);
|
|
3163
|
+
justify-content: space-between;
|
|
3164
|
+
margin-block-end: var(--sw-space-3);
|
|
3165
|
+
}
|
|
3166
|
+
|
|
3167
|
+
.sw-article-eyebrow {
|
|
3168
|
+
color: var(--sw-color-muted);
|
|
3169
|
+
font-size: 13px;
|
|
3170
|
+
font-weight: 600;
|
|
3171
|
+
letter-spacing: -0.08px;
|
|
3172
|
+
line-height: 18px;
|
|
3173
|
+
min-width: 0;
|
|
3174
|
+
overflow-wrap: anywhere;
|
|
3175
|
+
}
|
|
3176
|
+
|
|
3177
|
+
.sw-article-actions {
|
|
3178
|
+
display: flex;
|
|
3179
|
+
flex-wrap: wrap;
|
|
3180
|
+
gap: var(--sw-space-2);
|
|
3181
|
+
}
|
|
3182
|
+
|
|
3183
|
+
.sw-article-actions:only-child { margin-inline-start: auto; }
|
|
3184
|
+
|
|
3185
|
+
.sw-article-title { overflow-wrap: anywhere; }
|
|
3186
|
+
|
|
3187
|
+
.sw-article-meta {
|
|
3188
|
+
color: var(--sw-color-muted);
|
|
3189
|
+
font-size: 13px;
|
|
3190
|
+
letter-spacing: -0.08px;
|
|
3191
|
+
line-height: 18px;
|
|
3192
|
+
margin-block-start: var(--sw-space-3);
|
|
3193
|
+
overflow-wrap: anywhere;
|
|
3194
|
+
}
|
|
3195
|
+
|
|
3196
|
+
.sw-article-content {
|
|
3197
|
+
margin-block-start: var(--sw-space-4);
|
|
3198
|
+
min-width: 0;
|
|
3199
|
+
}
|
|
3200
|
+
|
|
3201
|
+
@media not all and (min-width: 48rem) {
|
|
3202
|
+
.sw-article-cover { aspect-ratio: 2 / 1; }
|
|
3203
|
+
.sw-article-body { padding: var(--sw-space-5); }
|
|
3204
|
+
}
|
|
3205
|
+
|
|
3206
|
+
.sw-document-viewer {
|
|
3207
|
+
background: color-mix(in srgb, var(--sw-color-muted) 16%, transparent);
|
|
3208
|
+
border-radius: var(--sw-radius-lg);
|
|
3209
|
+
display: flex;
|
|
3210
|
+
flex-direction: column;
|
|
3211
|
+
min-width: 0;
|
|
3212
|
+
padding-block-end: var(--sw-space-4);
|
|
3213
|
+
}
|
|
3214
|
+
|
|
3215
|
+
.sw-document-viewer-stage {
|
|
3216
|
+
box-sizing: border-box;
|
|
3217
|
+
min-width: 0;
|
|
3218
|
+
overflow-x: auto;
|
|
3219
|
+
overscroll-behavior-x: contain;
|
|
3220
|
+
padding: var(--sw-space-5);
|
|
3221
|
+
touch-action: pan-x pan-y;
|
|
3222
|
+
}
|
|
3223
|
+
|
|
3224
|
+
@media not all and (min-width: 48rem) {
|
|
3225
|
+
.sw-document-viewer-stage { padding: var(--sw-space-3); }
|
|
3226
|
+
}
|
|
3227
|
+
|
|
3228
|
+
.sw-document-viewer-stage:focus { outline: none; }
|
|
3229
|
+
|
|
3230
|
+
.sw-document-viewer-stage:focus-visible {
|
|
3231
|
+
border-radius: var(--sw-radius-lg);
|
|
3232
|
+
outline: var(--sw-focus-ring-width) solid var(--sw-color-accent);
|
|
3233
|
+
outline-offset: calc(-1 * var(--sw-focus-ring-width));
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3236
|
+
.sw-document-viewer-page {
|
|
3237
|
+
aspect-ratio: 1 / var(--sw-document-page-aspect);
|
|
3238
|
+
background: var(--sw-color-surface);
|
|
3239
|
+
box-shadow: var(--sw-elevation-sm);
|
|
3240
|
+
margin-inline: auto;
|
|
3241
|
+
position: relative;
|
|
3242
|
+
width: var(--sw-document-page-width);
|
|
3243
|
+
}
|
|
3244
|
+
|
|
3245
|
+
.sw-document-viewer-page > canvas {
|
|
3246
|
+
display: block;
|
|
3247
|
+
height: 100%;
|
|
3248
|
+
width: 100%;
|
|
3249
|
+
}
|
|
3250
|
+
|
|
3251
|
+
.sw-document-viewer-text {
|
|
3252
|
+
--scale-round-x: 1px;
|
|
3253
|
+
--scale-round-y: 1px;
|
|
3254
|
+
--min-font-size: 1;
|
|
3255
|
+
--text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
|
|
3256
|
+
--min-font-size-inv: calc(1 / var(--min-font-size));
|
|
3257
|
+
forced-color-adjust: none;
|
|
3258
|
+
inset: 0;
|
|
3259
|
+
letter-spacing: normal;
|
|
3260
|
+
line-height: 1;
|
|
3261
|
+
overflow: clip;
|
|
3262
|
+
position: absolute;
|
|
3263
|
+
text-align: initial;
|
|
3264
|
+
text-size-adjust: none;
|
|
3265
|
+
transform-origin: 0 0;
|
|
3266
|
+
word-spacing: normal;
|
|
3267
|
+
}
|
|
3268
|
+
|
|
3269
|
+
.sw-document-viewer-text :is(span, br) {
|
|
3270
|
+
color: transparent;
|
|
3271
|
+
cursor: text;
|
|
3272
|
+
position: absolute;
|
|
3273
|
+
transform-origin: 0% 0%;
|
|
3274
|
+
user-select: text;
|
|
3275
|
+
white-space: pre;
|
|
3276
|
+
}
|
|
3277
|
+
|
|
3278
|
+
.sw-document-viewer-text > :not(.markedContent),
|
|
3279
|
+
.sw-document-viewer-text .markedContent span:not(.markedContent) {
|
|
3280
|
+
--font-height: 0;
|
|
3281
|
+
--scale-x: 1;
|
|
3282
|
+
--rotate: 0deg;
|
|
3283
|
+
font-size: calc(var(--text-scale-factor) * var(--font-height));
|
|
3284
|
+
transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
|
|
3285
|
+
}
|
|
3286
|
+
|
|
3287
|
+
.sw-document-viewer-text .markedContent { display: contents; }
|
|
3288
|
+
|
|
3289
|
+
.sw-document-viewer-text ::selection {
|
|
3290
|
+
background: color-mix(in srgb, var(--sw-color-accent) 30%, transparent);
|
|
3291
|
+
color: transparent;
|
|
3292
|
+
}
|
|
3293
|
+
|
|
3294
|
+
.sw-document-viewer-bar {
|
|
3295
|
+
align-items: center;
|
|
3296
|
+
display: flex;
|
|
3297
|
+
gap: var(--sw-space-3);
|
|
3298
|
+
justify-content: center;
|
|
3299
|
+
padding-inline: var(--sw-space-3);
|
|
3300
|
+
}
|
|
3301
|
+
|
|
3302
|
+
.sw-button.sw-document-viewer-step {
|
|
3303
|
+
border-radius: var(--sw-radius-pill);
|
|
3304
|
+
flex: none;
|
|
3305
|
+
min-height: var(--sw-space-8);
|
|
3306
|
+
min-width: var(--sw-space-8);
|
|
3307
|
+
padding-inline: 0;
|
|
3308
|
+
}
|
|
3309
|
+
|
|
3310
|
+
.sw-document-viewer-status {
|
|
3311
|
+
font-family: var(--sw-font-sans);
|
|
3312
|
+
font-size: 15px;
|
|
3313
|
+
font-variant-numeric: tabular-nums;
|
|
3314
|
+
line-height: 20px;
|
|
3315
|
+
text-align: center;
|
|
3316
|
+
}
|
|
3317
|
+
|
|
3318
|
+
.sw-document-viewer-message {
|
|
3319
|
+
align-items: center;
|
|
3320
|
+
display: flex;
|
|
3321
|
+
flex-direction: column;
|
|
3322
|
+
gap: var(--sw-space-2);
|
|
3323
|
+
justify-content: center;
|
|
3324
|
+
min-height: calc(4 * var(--sw-space-8));
|
|
3325
|
+
text-align: center;
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
.sw-document-viewer-actions {
|
|
3329
|
+
display: flex;
|
|
3330
|
+
flex-wrap: wrap;
|
|
3331
|
+
gap: var(--sw-space-2);
|
|
3332
|
+
justify-content: center;
|
|
3333
|
+
margin-block-start: var(--sw-space-2);
|
|
3334
|
+
}
|
|
3335
|
+
|
|
3336
|
+
@media (forced-colors: active) {
|
|
3337
|
+
.sw-document-viewer { border: 1px solid CanvasText; }
|
|
3338
|
+
.sw-document-viewer-page { outline: 1px solid CanvasText; }
|
|
3339
|
+
}
|
|
3340
|
+
|
|
3341
|
+
.sw-markdown {
|
|
3342
|
+
color: var(--sw-color-text);
|
|
3343
|
+
font-family: var(--sw-font-sans);
|
|
3344
|
+
font-size: 17px;
|
|
3345
|
+
letter-spacing: -0.2px;
|
|
3346
|
+
line-height: 25px;
|
|
3347
|
+
overflow-wrap: anywhere;
|
|
3348
|
+
}
|
|
3349
|
+
|
|
3350
|
+
:where(.sw-markdown) > *,
|
|
3351
|
+
:where(.sw-markdown-quote) > *,
|
|
3352
|
+
:where(.sw-markdown-list li) > * { margin-block: 0; }
|
|
3353
|
+
|
|
3354
|
+
:where(.sw-markdown, .sw-markdown-quote, .sw-markdown-list li) > * + * {
|
|
3355
|
+
margin-block-start: var(--sw-space-4);
|
|
3356
|
+
}
|
|
3357
|
+
|
|
3358
|
+
:where(.sw-markdown) > * + .sw-markdown-heading { margin-block-start: var(--sw-space-6); }
|
|
3359
|
+
:where(.sw-markdown) > .sw-markdown-heading + * { margin-block-start: var(--sw-space-2); }
|
|
3360
|
+
|
|
3361
|
+
.sw-markdown-heading {
|
|
3362
|
+
color: var(--sw-color-text);
|
|
3363
|
+
font-weight: 600;
|
|
3364
|
+
scroll-margin-block-start: var(--sw-space-6);
|
|
3365
|
+
}
|
|
3366
|
+
|
|
3367
|
+
.sw-markdown-heading-1 {
|
|
3368
|
+
font-size: 20px;
|
|
3369
|
+
letter-spacing: -0.3px;
|
|
3370
|
+
line-height: 28px;
|
|
3371
|
+
}
|
|
3372
|
+
|
|
3373
|
+
.sw-markdown-heading-2 {
|
|
3374
|
+
font-size: 17px;
|
|
3375
|
+
line-height: 25px;
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3378
|
+
.sw-markdown-heading-3 {
|
|
3379
|
+
font-size: 15px;
|
|
3380
|
+
letter-spacing: -0.2px;
|
|
3381
|
+
line-height: 20px;
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
.sw-markdown-list {
|
|
3385
|
+
padding-inline-start: var(--sw-space-5);
|
|
3386
|
+
}
|
|
3387
|
+
|
|
3388
|
+
.sw-markdown-list > li + li { margin-block-start: var(--sw-space-2); }
|
|
3389
|
+
|
|
3390
|
+
[data-theme] .sw-markdown-link {
|
|
3391
|
+
color: var(--sw-color-accent);
|
|
3392
|
+
text-decoration-line: underline;
|
|
3393
|
+
}
|
|
3394
|
+
|
|
3395
|
+
[data-theme] .sw-markdown-link:hover {
|
|
3396
|
+
text-decoration-thickness: var(--sw-focus-ring-width);
|
|
3397
|
+
}
|
|
3398
|
+
|
|
3399
|
+
[data-theme] .sw-markdown-quote :is(.sw-markdown-link, .sw-markdown-caption) {
|
|
3400
|
+
color: var(--sw-color-text);
|
|
3401
|
+
}
|
|
3402
|
+
|
|
3403
|
+
.sw-markdown-quote {
|
|
3404
|
+
background: var(--sw-color-accentSubtle);
|
|
3405
|
+
border-inline-start: var(--sw-space-1) solid var(--sw-color-accent);
|
|
3406
|
+
border-radius: var(--sw-radius-sm);
|
|
3407
|
+
margin-inline: 0;
|
|
3408
|
+
padding: var(--sw-space-3) var(--sw-space-4);
|
|
3409
|
+
}
|
|
3410
|
+
|
|
3411
|
+
.sw-markdown-figure {
|
|
3412
|
+
display: flex;
|
|
3413
|
+
flex-direction: column;
|
|
3414
|
+
gap: var(--sw-space-2);
|
|
3415
|
+
margin-inline: 0;
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
.sw-markdown-image {
|
|
3419
|
+
border-radius: var(--sw-radius-md);
|
|
3420
|
+
display: block;
|
|
3421
|
+
height: auto;
|
|
3422
|
+
width: 100%;
|
|
3423
|
+
}
|
|
3424
|
+
|
|
3425
|
+
.sw-markdown-caption {
|
|
3426
|
+
color: var(--sw-color-muted);
|
|
3427
|
+
font-size: 13px;
|
|
3428
|
+
letter-spacing: -0.08px;
|
|
3429
|
+
line-height: 18px;
|
|
3430
|
+
}
|
|
3431
|
+
|
|
3432
|
+
@media (forced-colors: active) {
|
|
3433
|
+
.sw-markdown-quote { border: 1px solid CanvasText; border-inline-start-width: var(--sw-space-1); }
|
|
3434
|
+
}
|
|
3435
|
+
|
|
2943
3436
|
[data-theme] .sw-section-nav-count,
|
|
2944
3437
|
[data-theme] .sw-nav-count {
|
|
2945
3438
|
align-items: center;
|
|
@@ -2959,6 +3452,17 @@ body {
|
|
|
2959
3452
|
padding-inline: var(--sw-space-1);
|
|
2960
3453
|
}
|
|
2961
3454
|
|
|
3455
|
+
/*
|
|
3456
|
+
* NavCount's `tone="accent"`: a count that is news, not work waiting (what
|
|
3457
|
+
* was added since the person last looked), is the accent fill with its
|
|
3458
|
+
* on-colour figures (4.5:1 in every palette, as a primary Button's label).
|
|
3459
|
+
* One class more specific than the pill, so it wins in any order.
|
|
3460
|
+
*/
|
|
3461
|
+
[data-theme] .sw-nav-count.sw-nav-count-accent {
|
|
3462
|
+
background: var(--sw-color-accent);
|
|
3463
|
+
color: var(--sw-color-onAccent);
|
|
3464
|
+
}
|
|
3465
|
+
|
|
2962
3466
|
/*
|
|
2963
3467
|
* A Nav link holding a count lays out as SectionNav's link does: the words
|
|
2964
3468
|
* and the pill centred on one line a space-2 apart (the space text node
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalewing/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.42.0",
|
|
4
4
|
"description": "Scalewing DOM components and package-owned CSS utilities.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,13 +14,18 @@
|
|
|
14
14
|
"url": "https://github.com/nestor-garcia-dev/scalewing/issues"
|
|
15
15
|
},
|
|
16
16
|
"sideEffects": [
|
|
17
|
-
"*.css"
|
|
17
|
+
"*.css",
|
|
18
|
+
"./*/document-viewer-worker.*"
|
|
18
19
|
],
|
|
19
20
|
"exports": {
|
|
20
21
|
".": {
|
|
21
22
|
"types": "./dist/index.d.ts",
|
|
22
23
|
"import": "./dist/index.js"
|
|
23
24
|
},
|
|
25
|
+
"./document-viewer-worker": {
|
|
26
|
+
"types": "./dist/document-viewer-worker.d.ts",
|
|
27
|
+
"import": "./dist/document-viewer-worker.js"
|
|
28
|
+
},
|
|
24
29
|
"./styles.css": {
|
|
25
30
|
"types": "./styles.css.d.ts",
|
|
26
31
|
"default": "./dist/styles.css"
|
|
@@ -38,6 +43,8 @@
|
|
|
38
43
|
"README.md"
|
|
39
44
|
],
|
|
40
45
|
"dependencies": {
|
|
46
|
+
"markdown-it": "14.3.2",
|
|
47
|
+
"pdfjs-dist": "6.4.299",
|
|
41
48
|
"@scalewing/tokens": "^1.5.0"
|
|
42
49
|
},
|
|
43
50
|
"peerDependencies": {
|
|
@@ -47,6 +54,7 @@
|
|
|
47
54
|
"devDependencies": {
|
|
48
55
|
"@testing-library/react": "^16.3.0",
|
|
49
56
|
"@testing-library/user-event": "14.6.1",
|
|
57
|
+
"@types/markdown-it": "14.2.0",
|
|
50
58
|
"@types/react": "^19.2.2",
|
|
51
59
|
"@types/react-dom": "^19.2.2",
|
|
52
60
|
"jsdom": "^27.0.0",
|