@dloizides/ui-layout 1.45.0 → 1.46.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 +6 -0
- package/dist/index.d.mts +138 -45
- package/dist/index.d.ts +138 -45
- package/dist/index.js +358 -128
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +349 -130
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
MODC-1 D-MC-641 "One page layout for all pages", UI-ATOMIC-1.
|
|
6
|
+
|
|
7
|
+
- New organism `SectionIndexLayout`: from `SECTION_INDEX_BREAKPOINT` (1024) an "On this page" index (molecule `SectionIndex`) beside every section stacked, a press scrolls to its section; below it a wrapping row of chips (molecule `SectionChips`) shows one section at a time, the first by default, so nothing is removed. Hit boxes >= 44 px; labels are pre-localized props. Options, defaults keep the plain behaviour: `density` (`SectionDensity` comfortable or dense gaps), `stickyIndex` (web, default false), `chipOverflow` (`ChipOverflow` wrap or scroll).
|
|
8
|
+
|
|
3
9
|
## 1.44.0
|
|
4
10
|
|
|
5
11
|
MODC-1 "Module C unified console" (AC-UI-1, AC-UI-7), UI-ATOMIC-1 "Reuse first, extract what is new, layer atom / molecule / organism".
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,46 @@
|
|
|
1
1
|
import React, { RefObject } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, TextStyle,
|
|
2
|
+
import { Text, StyleProp, ViewStyle, TextStyle, View } from 'react-native';
|
|
3
3
|
import { UiTheme } from '@dloizides/ui-feedback';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Heading — themed section heading text, rendered as a REAL `<h1>`–`<h6>` on web.
|
|
7
|
+
*
|
|
8
|
+
* ## Why `level` exists
|
|
9
|
+
*
|
|
10
|
+
* `accessibilityRole="header"` maps to the ARIA `heading` role, which react-native-web turns
|
|
11
|
+
* into a real heading element — but with no `aria-level` it always emits `<h1>`. A screen
|
|
12
|
+
* having several `<h1>`s and no `<h2>` is a flat document: heading navigation, the primary way
|
|
13
|
+
* assistive-tech users move around a long page, lists every section as a peer of the page title.
|
|
14
|
+
*
|
|
15
|
+
* `level` supplies `aria-level`, which RN-web uses to pick `h{level}`. It defaults to 2 rather
|
|
16
|
+
* than 1 on purpose: a page has exactly ONE `<h1>` (its title) and many section headings, so the
|
|
17
|
+
* common case must be the safe one. A second `<h1>` is a defect that renders identically to a
|
|
18
|
+
* correct heading, so nothing about the page would reveal the mistake.
|
|
19
|
+
*
|
|
20
|
+
* The visual size is deliberately NOT derived from `level`. Heading level is document structure;
|
|
21
|
+
* type scale is design. Tying them together is what pushes authors to pick a level for its font
|
|
22
|
+
* size and break the outline to get the look they want.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** `h1`–`h6`; HTML defines no `h7`. */
|
|
26
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
27
|
+
interface HeadingProps {
|
|
28
|
+
text?: string;
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Document outline depth → `<h1>`–`<h6>` on web, `aria-level` on native. Defaults to 2.
|
|
32
|
+
* Pick it from the page's STRUCTURE, never from how large you want the text to look.
|
|
33
|
+
*/
|
|
34
|
+
level?: HeadingLevel;
|
|
35
|
+
/**
|
|
36
|
+
* Merged AFTER the themed base, for the genuine one-off — a page title that needs to be
|
|
37
|
+
* visibly larger than a section heading. Structure stays in `level`; size lives here.
|
|
38
|
+
*/
|
|
39
|
+
style?: React.ComponentProps<typeof Text>['style'];
|
|
40
|
+
testID?: string;
|
|
41
|
+
}
|
|
42
|
+
declare const Heading: ({ text, children, level, style, testID, }: HeadingProps) => React.ReactElement;
|
|
43
|
+
|
|
5
44
|
declare enum SectionVariant {
|
|
6
45
|
Panel = "panel",
|
|
7
46
|
Card = "card"
|
|
@@ -15,9 +54,11 @@ interface SectionProps {
|
|
|
15
54
|
children?: React.ReactNode;
|
|
16
55
|
style?: StyleProp<ViewStyle>;
|
|
17
56
|
variant?: SectionVariant;
|
|
57
|
+
title?: string;
|
|
58
|
+
titleLevel?: HeadingLevel;
|
|
18
59
|
testID?: string;
|
|
19
60
|
}
|
|
20
|
-
declare const Section: ({ children, style, variant, testID, }: SectionProps) => React.ReactElement;
|
|
61
|
+
declare const Section: ({ children, style, variant, title, titleLevel, testID, }: SectionProps) => React.ReactElement;
|
|
21
62
|
|
|
22
63
|
declare enum TextKind {
|
|
23
64
|
Title = "title",
|
|
@@ -43,45 +84,6 @@ interface ScreenColumnProps {
|
|
|
43
84
|
}
|
|
44
85
|
declare const ScreenColumn: ({ children, narrow }: ScreenColumnProps) => React.ReactElement;
|
|
45
86
|
|
|
46
|
-
/**
|
|
47
|
-
* Heading — themed section heading text, rendered as a REAL `<h1>`–`<h6>` on web.
|
|
48
|
-
*
|
|
49
|
-
* ## Why `level` exists
|
|
50
|
-
*
|
|
51
|
-
* `accessibilityRole="header"` maps to the ARIA `heading` role, which react-native-web turns
|
|
52
|
-
* into a real heading element — but with no `aria-level` it always emits `<h1>`. A screen
|
|
53
|
-
* having several `<h1>`s and no `<h2>` is a flat document: heading navigation, the primary way
|
|
54
|
-
* assistive-tech users move around a long page, lists every section as a peer of the page title.
|
|
55
|
-
*
|
|
56
|
-
* `level` supplies `aria-level`, which RN-web uses to pick `h{level}`. It defaults to 2 rather
|
|
57
|
-
* than 1 on purpose: a page has exactly ONE `<h1>` (its title) and many section headings, so the
|
|
58
|
-
* common case must be the safe one. A second `<h1>` is a defect that renders identically to a
|
|
59
|
-
* correct heading, so nothing about the page would reveal the mistake.
|
|
60
|
-
*
|
|
61
|
-
* The visual size is deliberately NOT derived from `level`. Heading level is document structure;
|
|
62
|
-
* type scale is design. Tying them together is what pushes authors to pick a level for its font
|
|
63
|
-
* size and break the outline to get the look they want.
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
/** `h1`–`h6`; HTML defines no `h7`. */
|
|
67
|
-
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
68
|
-
interface HeadingProps {
|
|
69
|
-
text?: string;
|
|
70
|
-
children?: React.ReactNode;
|
|
71
|
-
/**
|
|
72
|
-
* Document outline depth → `<h1>`–`<h6>` on web, `aria-level` on native. Defaults to 2.
|
|
73
|
-
* Pick it from the page's STRUCTURE, never from how large you want the text to look.
|
|
74
|
-
*/
|
|
75
|
-
level?: HeadingLevel;
|
|
76
|
-
/**
|
|
77
|
-
* Merged AFTER the themed base, for the genuine one-off — a page title that needs to be
|
|
78
|
-
* visibly larger than a section heading. Structure stays in `level`; size lives here.
|
|
79
|
-
*/
|
|
80
|
-
style?: React.ComponentProps<typeof Text>['style'];
|
|
81
|
-
testID?: string;
|
|
82
|
-
}
|
|
83
|
-
declare const Heading: ({ text, children, level, style, testID, }: HeadingProps) => React.ReactElement;
|
|
84
|
-
|
|
85
87
|
declare const enum BadgeTone {
|
|
86
88
|
Neutral = "neutral",
|
|
87
89
|
Info = "info",
|
|
@@ -141,12 +143,14 @@ interface SplitPanesProps {
|
|
|
141
143
|
layout?: SplitLayout;
|
|
142
144
|
startWeight?: number;
|
|
143
145
|
endWeight?: number;
|
|
146
|
+
endWidth?: number;
|
|
144
147
|
gap?: number;
|
|
145
148
|
breakpoint?: number;
|
|
146
149
|
testID?: string;
|
|
147
150
|
}
|
|
148
|
-
/** Two panes; the default Auto stacks below `breakpoint` (phones), pass Side to keep them side by side at 360.
|
|
149
|
-
|
|
151
|
+
/** Two panes; the default Auto stacks below `breakpoint` (phones), pass Side to keep them side by side at 360.
|
|
152
|
+
* `endWidth` fixes the end pane (a rail) at that width while side by side; stacked it stays full width. */
|
|
153
|
+
declare const SplitPanes: ({ start, end, layout, startWeight, endWeight, endWidth, gap, breakpoint, testID, }: SplitPanesProps) => React.ReactElement;
|
|
150
154
|
|
|
151
155
|
/** Whether the panes sit side by side: always for Side, never for Stack, from `breakpoint` up for Auto. */
|
|
152
156
|
declare function isSplitSideBySide(layout: SplitLayout, width: number, breakpoint: number): boolean;
|
|
@@ -230,6 +234,8 @@ interface SegmentedControlProps<V extends string = string> {
|
|
|
230
234
|
onChange: (value: V) => void;
|
|
231
235
|
/** Accessible name for the whole group (the `tablist`). */
|
|
232
236
|
accessibilityLabel: string;
|
|
237
|
+
/** Optional hint for the whole group. */
|
|
238
|
+
accessibilityHint?: string;
|
|
233
239
|
/** Optional style override merged LAST onto the track. */
|
|
234
240
|
style?: StyleProp<ViewStyle>;
|
|
235
241
|
testID?: string;
|
|
@@ -238,7 +244,7 @@ interface SegmentedControlProps<V extends string = string> {
|
|
|
238
244
|
* A segmented toggle. Generic over the value union so callers get a typed `onChange`
|
|
239
245
|
* (e.g. `SegmentedControl<'peps' | 'leaders'>`).
|
|
240
246
|
*/
|
|
241
|
-
declare function SegmentedControl<V extends string = string>({ options, value, onChange, accessibilityLabel, style, testID, }: SegmentedControlProps<V>): React.ReactElement;
|
|
247
|
+
declare function SegmentedControl<V extends string = string>({ options, value, onChange, accessibilityLabel, accessibilityHint, style, testID, }: SegmentedControlProps<V>): React.ReactElement;
|
|
242
248
|
|
|
243
249
|
/**
|
|
244
250
|
* How the COLLAPSED (mobile) {@link import('./Tabs').Tabs} menu trigger presents.
|
|
@@ -1175,4 +1181,91 @@ interface RowLook {
|
|
|
1175
1181
|
/** Resolves a row's container style and text colours from its selected style and state. */
|
|
1176
1182
|
declare function resolveRowLook(style: RowSelectedStyle, state: RowState, palette: RowPalette): RowLook;
|
|
1177
1183
|
|
|
1178
|
-
|
|
1184
|
+
declare enum ChipOverflow {
|
|
1185
|
+
Wrap = "wrap",
|
|
1186
|
+
Scroll = "scroll"
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
declare enum SectionDensity {
|
|
1190
|
+
Comfortable = "comfortable",
|
|
1191
|
+
Dense = "dense"
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
interface SectionIndexEntry {
|
|
1195
|
+
key: string;
|
|
1196
|
+
title: string;
|
|
1197
|
+
content: React.ReactNode;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
interface SectionIndexLayoutProps {
|
|
1201
|
+
sections: ReadonlyArray<SectionIndexEntry>;
|
|
1202
|
+
indexHeading: string;
|
|
1203
|
+
itemHint: string;
|
|
1204
|
+
initialKey?: string;
|
|
1205
|
+
breakpoint?: number;
|
|
1206
|
+
density?: SectionDensity;
|
|
1207
|
+
stickyIndex?: boolean;
|
|
1208
|
+
chipOverflow?: ChipOverflow;
|
|
1209
|
+
testID?: string;
|
|
1210
|
+
}
|
|
1211
|
+
declare const SectionIndexLayout: ({ sections, indexHeading, itemHint, initialKey, breakpoint, density, stickyIndex, chipOverflow, testID, }: SectionIndexLayoutProps) => React.ReactElement;
|
|
1212
|
+
|
|
1213
|
+
interface SectionIndexProps {
|
|
1214
|
+
sections: ReadonlyArray<SectionIndexEntry>;
|
|
1215
|
+
activeKey: string;
|
|
1216
|
+
heading: string;
|
|
1217
|
+
itemHint: string;
|
|
1218
|
+
onSelect: (key: string) => void;
|
|
1219
|
+
testID: string;
|
|
1220
|
+
}
|
|
1221
|
+
declare const SectionIndex: ({ sections, activeKey, heading, itemHint, onSelect, testID }: SectionIndexProps) => React.ReactElement;
|
|
1222
|
+
|
|
1223
|
+
interface SectionChipsProps {
|
|
1224
|
+
sections: ReadonlyArray<SectionIndexEntry>;
|
|
1225
|
+
activeKey: string;
|
|
1226
|
+
groupLabel: string;
|
|
1227
|
+
itemHint: string;
|
|
1228
|
+
overflow?: ChipOverflow;
|
|
1229
|
+
onSelect: (key: string) => void;
|
|
1230
|
+
testID: string;
|
|
1231
|
+
}
|
|
1232
|
+
declare const SectionChips: ({ sections, activeKey, groupLabel, itemHint, overflow, onSelect, testID }: SectionChipsProps) => React.ReactElement;
|
|
1233
|
+
|
|
1234
|
+
declare const SECTION_INDEX_BREAKPOINT = 1024;
|
|
1235
|
+
declare function resolveActiveKey(sections: ReadonlyArray<SectionIndexEntry>, wanted: string | undefined): string;
|
|
1236
|
+
|
|
1237
|
+
interface DayCardProps {
|
|
1238
|
+
label: string;
|
|
1239
|
+
badge: string;
|
|
1240
|
+
count: number;
|
|
1241
|
+
accessibilityLabel: string;
|
|
1242
|
+
accessibilityHint: string;
|
|
1243
|
+
badgeTone?: BadgeTone;
|
|
1244
|
+
testID?: string;
|
|
1245
|
+
children: React.ReactNode;
|
|
1246
|
+
}
|
|
1247
|
+
/** One day of a list: its label, an age badge and the item count over a card holding the day's rows. */
|
|
1248
|
+
declare const DayCard: ({ label, badge, count, accessibilityLabel, accessibilityHint, badgeTone, testID, children, }: DayCardProps) => React.ReactElement;
|
|
1249
|
+
|
|
1250
|
+
/** The style of one figure cell: an equal share of the strip when wide, half a row when narrow; span widens it. */
|
|
1251
|
+
declare function figureCell(wide: boolean, span?: number): StyleProp<ViewStyle>;
|
|
1252
|
+
interface FigureStripProps {
|
|
1253
|
+
children: React.ReactNode;
|
|
1254
|
+
testID?: string;
|
|
1255
|
+
}
|
|
1256
|
+
/** A row of figure tiles that wraps into two columns when narrow; each child sizes itself with figureCell. */
|
|
1257
|
+
declare const FigureStrip: ({ children, testID }: FigureStripProps) => React.ReactElement;
|
|
1258
|
+
|
|
1259
|
+
interface ToggleSectionProps {
|
|
1260
|
+
wide: boolean;
|
|
1261
|
+
title: string;
|
|
1262
|
+
toggleLabel: string;
|
|
1263
|
+
toggleHint: string;
|
|
1264
|
+
forceOpen?: boolean;
|
|
1265
|
+
testID: string;
|
|
1266
|
+
children: React.ReactNode;
|
|
1267
|
+
}
|
|
1268
|
+
/** A titled card when wide; when narrow the same content sits behind one toggle button, open when forced. */
|
|
1269
|
+
declare const ToggleSection: ({ wide, title, toggleLabel, toggleHint, forceOpen, testID, children }: ToggleSectionProps) => React.ReactElement;
|
|
1270
|
+
|
|
1271
|
+
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, AppText, type AppTextProps, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, type BottomSheetProps, BuildInfoFooter, type BuildInfoFooterProps, COPY_FEEDBACK_MS, ChipOverflow, ConfirmDialog, ConfirmDialogFocus, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, CountBadge, type CountBadgeProps, DEFAULT_BILLING_ROUTE, DayCard, type DayCardProps, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, FigureStrip, type FigureStripProps, FormDialog, type FormDialogProps, HEADER_STACK_BREAKPOINT, Heading, type HeadingLevel, type HeadingProps, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListRow, type ListRowProps, type ListRowTone, MIN_TARGET_PX, MODAL_FOOTER_STACK_BELOW, Modal, ModalDropdown, type ModalDropdownProps, type ModalProps, ModalShell, type ModalShellProps, type ModalSize, PageFrame, type PageFrameProps, type PageSize, type RowLook, type RowPalette, RowSelectedStyle, type RowState, SECTION_INDEX_BREAKPOINT, type ScaledFrame, ScreenColumn, type ScreenColumnProps, Section, SectionChips, type SectionChipsProps, SectionDensity, SectionIndex, type SectionIndexEntry, SectionIndexLayout, type SectionIndexLayoutProps, type SectionIndexProps, type SectionProps, SectionVariant, SegmentedControl, type SegmentedControlProps, type SegmentedOption, SelectedMarker, SideSheet, type SideSheetProps, SplitLayout, SplitPanes, type SplitPanesProps, StatusBadge, type StatusBadgeProps, StickyPreview, type StickyPreviewProps, TYPE_SCALE_BREAKPOINT, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TextKind, ToggleSection, type ToggleSectionProps, type ToneColors, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveRowLook, resolveToneColors, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,46 @@
|
|
|
1
1
|
import React, { RefObject } from 'react';
|
|
2
|
-
import { StyleProp, ViewStyle, TextStyle,
|
|
2
|
+
import { Text, StyleProp, ViewStyle, TextStyle, View } from 'react-native';
|
|
3
3
|
import { UiTheme } from '@dloizides/ui-feedback';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Heading — themed section heading text, rendered as a REAL `<h1>`–`<h6>` on web.
|
|
7
|
+
*
|
|
8
|
+
* ## Why `level` exists
|
|
9
|
+
*
|
|
10
|
+
* `accessibilityRole="header"` maps to the ARIA `heading` role, which react-native-web turns
|
|
11
|
+
* into a real heading element — but with no `aria-level` it always emits `<h1>`. A screen
|
|
12
|
+
* having several `<h1>`s and no `<h2>` is a flat document: heading navigation, the primary way
|
|
13
|
+
* assistive-tech users move around a long page, lists every section as a peer of the page title.
|
|
14
|
+
*
|
|
15
|
+
* `level` supplies `aria-level`, which RN-web uses to pick `h{level}`. It defaults to 2 rather
|
|
16
|
+
* than 1 on purpose: a page has exactly ONE `<h1>` (its title) and many section headings, so the
|
|
17
|
+
* common case must be the safe one. A second `<h1>` is a defect that renders identically to a
|
|
18
|
+
* correct heading, so nothing about the page would reveal the mistake.
|
|
19
|
+
*
|
|
20
|
+
* The visual size is deliberately NOT derived from `level`. Heading level is document structure;
|
|
21
|
+
* type scale is design. Tying them together is what pushes authors to pick a level for its font
|
|
22
|
+
* size and break the outline to get the look they want.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/** `h1`–`h6`; HTML defines no `h7`. */
|
|
26
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
27
|
+
interface HeadingProps {
|
|
28
|
+
text?: string;
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* Document outline depth → `<h1>`–`<h6>` on web, `aria-level` on native. Defaults to 2.
|
|
32
|
+
* Pick it from the page's STRUCTURE, never from how large you want the text to look.
|
|
33
|
+
*/
|
|
34
|
+
level?: HeadingLevel;
|
|
35
|
+
/**
|
|
36
|
+
* Merged AFTER the themed base, for the genuine one-off — a page title that needs to be
|
|
37
|
+
* visibly larger than a section heading. Structure stays in `level`; size lives here.
|
|
38
|
+
*/
|
|
39
|
+
style?: React.ComponentProps<typeof Text>['style'];
|
|
40
|
+
testID?: string;
|
|
41
|
+
}
|
|
42
|
+
declare const Heading: ({ text, children, level, style, testID, }: HeadingProps) => React.ReactElement;
|
|
43
|
+
|
|
5
44
|
declare enum SectionVariant {
|
|
6
45
|
Panel = "panel",
|
|
7
46
|
Card = "card"
|
|
@@ -15,9 +54,11 @@ interface SectionProps {
|
|
|
15
54
|
children?: React.ReactNode;
|
|
16
55
|
style?: StyleProp<ViewStyle>;
|
|
17
56
|
variant?: SectionVariant;
|
|
57
|
+
title?: string;
|
|
58
|
+
titleLevel?: HeadingLevel;
|
|
18
59
|
testID?: string;
|
|
19
60
|
}
|
|
20
|
-
declare const Section: ({ children, style, variant, testID, }: SectionProps) => React.ReactElement;
|
|
61
|
+
declare const Section: ({ children, style, variant, title, titleLevel, testID, }: SectionProps) => React.ReactElement;
|
|
21
62
|
|
|
22
63
|
declare enum TextKind {
|
|
23
64
|
Title = "title",
|
|
@@ -43,45 +84,6 @@ interface ScreenColumnProps {
|
|
|
43
84
|
}
|
|
44
85
|
declare const ScreenColumn: ({ children, narrow }: ScreenColumnProps) => React.ReactElement;
|
|
45
86
|
|
|
46
|
-
/**
|
|
47
|
-
* Heading — themed section heading text, rendered as a REAL `<h1>`–`<h6>` on web.
|
|
48
|
-
*
|
|
49
|
-
* ## Why `level` exists
|
|
50
|
-
*
|
|
51
|
-
* `accessibilityRole="header"` maps to the ARIA `heading` role, which react-native-web turns
|
|
52
|
-
* into a real heading element — but with no `aria-level` it always emits `<h1>`. A screen
|
|
53
|
-
* having several `<h1>`s and no `<h2>` is a flat document: heading navigation, the primary way
|
|
54
|
-
* assistive-tech users move around a long page, lists every section as a peer of the page title.
|
|
55
|
-
*
|
|
56
|
-
* `level` supplies `aria-level`, which RN-web uses to pick `h{level}`. It defaults to 2 rather
|
|
57
|
-
* than 1 on purpose: a page has exactly ONE `<h1>` (its title) and many section headings, so the
|
|
58
|
-
* common case must be the safe one. A second `<h1>` is a defect that renders identically to a
|
|
59
|
-
* correct heading, so nothing about the page would reveal the mistake.
|
|
60
|
-
*
|
|
61
|
-
* The visual size is deliberately NOT derived from `level`. Heading level is document structure;
|
|
62
|
-
* type scale is design. Tying them together is what pushes authors to pick a level for its font
|
|
63
|
-
* size and break the outline to get the look they want.
|
|
64
|
-
*/
|
|
65
|
-
|
|
66
|
-
/** `h1`–`h6`; HTML defines no `h7`. */
|
|
67
|
-
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
68
|
-
interface HeadingProps {
|
|
69
|
-
text?: string;
|
|
70
|
-
children?: React.ReactNode;
|
|
71
|
-
/**
|
|
72
|
-
* Document outline depth → `<h1>`–`<h6>` on web, `aria-level` on native. Defaults to 2.
|
|
73
|
-
* Pick it from the page's STRUCTURE, never from how large you want the text to look.
|
|
74
|
-
*/
|
|
75
|
-
level?: HeadingLevel;
|
|
76
|
-
/**
|
|
77
|
-
* Merged AFTER the themed base, for the genuine one-off — a page title that needs to be
|
|
78
|
-
* visibly larger than a section heading. Structure stays in `level`; size lives here.
|
|
79
|
-
*/
|
|
80
|
-
style?: React.ComponentProps<typeof Text>['style'];
|
|
81
|
-
testID?: string;
|
|
82
|
-
}
|
|
83
|
-
declare const Heading: ({ text, children, level, style, testID, }: HeadingProps) => React.ReactElement;
|
|
84
|
-
|
|
85
87
|
declare const enum BadgeTone {
|
|
86
88
|
Neutral = "neutral",
|
|
87
89
|
Info = "info",
|
|
@@ -141,12 +143,14 @@ interface SplitPanesProps {
|
|
|
141
143
|
layout?: SplitLayout;
|
|
142
144
|
startWeight?: number;
|
|
143
145
|
endWeight?: number;
|
|
146
|
+
endWidth?: number;
|
|
144
147
|
gap?: number;
|
|
145
148
|
breakpoint?: number;
|
|
146
149
|
testID?: string;
|
|
147
150
|
}
|
|
148
|
-
/** Two panes; the default Auto stacks below `breakpoint` (phones), pass Side to keep them side by side at 360.
|
|
149
|
-
|
|
151
|
+
/** Two panes; the default Auto stacks below `breakpoint` (phones), pass Side to keep them side by side at 360.
|
|
152
|
+
* `endWidth` fixes the end pane (a rail) at that width while side by side; stacked it stays full width. */
|
|
153
|
+
declare const SplitPanes: ({ start, end, layout, startWeight, endWeight, endWidth, gap, breakpoint, testID, }: SplitPanesProps) => React.ReactElement;
|
|
150
154
|
|
|
151
155
|
/** Whether the panes sit side by side: always for Side, never for Stack, from `breakpoint` up for Auto. */
|
|
152
156
|
declare function isSplitSideBySide(layout: SplitLayout, width: number, breakpoint: number): boolean;
|
|
@@ -230,6 +234,8 @@ interface SegmentedControlProps<V extends string = string> {
|
|
|
230
234
|
onChange: (value: V) => void;
|
|
231
235
|
/** Accessible name for the whole group (the `tablist`). */
|
|
232
236
|
accessibilityLabel: string;
|
|
237
|
+
/** Optional hint for the whole group. */
|
|
238
|
+
accessibilityHint?: string;
|
|
233
239
|
/** Optional style override merged LAST onto the track. */
|
|
234
240
|
style?: StyleProp<ViewStyle>;
|
|
235
241
|
testID?: string;
|
|
@@ -238,7 +244,7 @@ interface SegmentedControlProps<V extends string = string> {
|
|
|
238
244
|
* A segmented toggle. Generic over the value union so callers get a typed `onChange`
|
|
239
245
|
* (e.g. `SegmentedControl<'peps' | 'leaders'>`).
|
|
240
246
|
*/
|
|
241
|
-
declare function SegmentedControl<V extends string = string>({ options, value, onChange, accessibilityLabel, style, testID, }: SegmentedControlProps<V>): React.ReactElement;
|
|
247
|
+
declare function SegmentedControl<V extends string = string>({ options, value, onChange, accessibilityLabel, accessibilityHint, style, testID, }: SegmentedControlProps<V>): React.ReactElement;
|
|
242
248
|
|
|
243
249
|
/**
|
|
244
250
|
* How the COLLAPSED (mobile) {@link import('./Tabs').Tabs} menu trigger presents.
|
|
@@ -1175,4 +1181,91 @@ interface RowLook {
|
|
|
1175
1181
|
/** Resolves a row's container style and text colours from its selected style and state. */
|
|
1176
1182
|
declare function resolveRowLook(style: RowSelectedStyle, state: RowState, palette: RowPalette): RowLook;
|
|
1177
1183
|
|
|
1178
|
-
|
|
1184
|
+
declare enum ChipOverflow {
|
|
1185
|
+
Wrap = "wrap",
|
|
1186
|
+
Scroll = "scroll"
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
declare enum SectionDensity {
|
|
1190
|
+
Comfortable = "comfortable",
|
|
1191
|
+
Dense = "dense"
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
interface SectionIndexEntry {
|
|
1195
|
+
key: string;
|
|
1196
|
+
title: string;
|
|
1197
|
+
content: React.ReactNode;
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
interface SectionIndexLayoutProps {
|
|
1201
|
+
sections: ReadonlyArray<SectionIndexEntry>;
|
|
1202
|
+
indexHeading: string;
|
|
1203
|
+
itemHint: string;
|
|
1204
|
+
initialKey?: string;
|
|
1205
|
+
breakpoint?: number;
|
|
1206
|
+
density?: SectionDensity;
|
|
1207
|
+
stickyIndex?: boolean;
|
|
1208
|
+
chipOverflow?: ChipOverflow;
|
|
1209
|
+
testID?: string;
|
|
1210
|
+
}
|
|
1211
|
+
declare const SectionIndexLayout: ({ sections, indexHeading, itemHint, initialKey, breakpoint, density, stickyIndex, chipOverflow, testID, }: SectionIndexLayoutProps) => React.ReactElement;
|
|
1212
|
+
|
|
1213
|
+
interface SectionIndexProps {
|
|
1214
|
+
sections: ReadonlyArray<SectionIndexEntry>;
|
|
1215
|
+
activeKey: string;
|
|
1216
|
+
heading: string;
|
|
1217
|
+
itemHint: string;
|
|
1218
|
+
onSelect: (key: string) => void;
|
|
1219
|
+
testID: string;
|
|
1220
|
+
}
|
|
1221
|
+
declare const SectionIndex: ({ sections, activeKey, heading, itemHint, onSelect, testID }: SectionIndexProps) => React.ReactElement;
|
|
1222
|
+
|
|
1223
|
+
interface SectionChipsProps {
|
|
1224
|
+
sections: ReadonlyArray<SectionIndexEntry>;
|
|
1225
|
+
activeKey: string;
|
|
1226
|
+
groupLabel: string;
|
|
1227
|
+
itemHint: string;
|
|
1228
|
+
overflow?: ChipOverflow;
|
|
1229
|
+
onSelect: (key: string) => void;
|
|
1230
|
+
testID: string;
|
|
1231
|
+
}
|
|
1232
|
+
declare const SectionChips: ({ sections, activeKey, groupLabel, itemHint, overflow, onSelect, testID }: SectionChipsProps) => React.ReactElement;
|
|
1233
|
+
|
|
1234
|
+
declare const SECTION_INDEX_BREAKPOINT = 1024;
|
|
1235
|
+
declare function resolveActiveKey(sections: ReadonlyArray<SectionIndexEntry>, wanted: string | undefined): string;
|
|
1236
|
+
|
|
1237
|
+
interface DayCardProps {
|
|
1238
|
+
label: string;
|
|
1239
|
+
badge: string;
|
|
1240
|
+
count: number;
|
|
1241
|
+
accessibilityLabel: string;
|
|
1242
|
+
accessibilityHint: string;
|
|
1243
|
+
badgeTone?: BadgeTone;
|
|
1244
|
+
testID?: string;
|
|
1245
|
+
children: React.ReactNode;
|
|
1246
|
+
}
|
|
1247
|
+
/** One day of a list: its label, an age badge and the item count over a card holding the day's rows. */
|
|
1248
|
+
declare const DayCard: ({ label, badge, count, accessibilityLabel, accessibilityHint, badgeTone, testID, children, }: DayCardProps) => React.ReactElement;
|
|
1249
|
+
|
|
1250
|
+
/** The style of one figure cell: an equal share of the strip when wide, half a row when narrow; span widens it. */
|
|
1251
|
+
declare function figureCell(wide: boolean, span?: number): StyleProp<ViewStyle>;
|
|
1252
|
+
interface FigureStripProps {
|
|
1253
|
+
children: React.ReactNode;
|
|
1254
|
+
testID?: string;
|
|
1255
|
+
}
|
|
1256
|
+
/** A row of figure tiles that wraps into two columns when narrow; each child sizes itself with figureCell. */
|
|
1257
|
+
declare const FigureStrip: ({ children, testID }: FigureStripProps) => React.ReactElement;
|
|
1258
|
+
|
|
1259
|
+
interface ToggleSectionProps {
|
|
1260
|
+
wide: boolean;
|
|
1261
|
+
title: string;
|
|
1262
|
+
toggleLabel: string;
|
|
1263
|
+
toggleHint: string;
|
|
1264
|
+
forceOpen?: boolean;
|
|
1265
|
+
testID: string;
|
|
1266
|
+
children: React.ReactNode;
|
|
1267
|
+
}
|
|
1268
|
+
/** A titled card when wide; when narrow the same content sits behind one toggle button, open when forced. */
|
|
1269
|
+
declare const ToggleSection: ({ wide, title, toggleLabel, toggleHint, forceOpen, testID, children }: ToggleSectionProps) => React.ReactElement;
|
|
1270
|
+
|
|
1271
|
+
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, AppText, type AppTextProps, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, type BottomSheetProps, BuildInfoFooter, type BuildInfoFooterProps, COPY_FEEDBACK_MS, ChipOverflow, ConfirmDialog, ConfirmDialogFocus, type ConfirmDialogProps, CopyStatus, type CopyToClipboard, CopyableId, type CopyableIdProps, CountBadge, type CountBadgeProps, DEFAULT_BILLING_ROUTE, DayCard, type DayCardProps, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, FigureStrip, type FigureStripProps, FormDialog, type FormDialogProps, HEADER_STACK_BREAKPOINT, Heading, type HeadingLevel, type HeadingProps, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListRow, type ListRowProps, type ListRowTone, MIN_TARGET_PX, MODAL_FOOTER_STACK_BELOW, Modal, ModalDropdown, type ModalDropdownProps, type ModalProps, ModalShell, type ModalShellProps, type ModalSize, PageFrame, type PageFrameProps, type PageSize, type RowLook, type RowPalette, RowSelectedStyle, type RowState, SECTION_INDEX_BREAKPOINT, type ScaledFrame, ScreenColumn, type ScreenColumnProps, Section, SectionChips, type SectionChipsProps, SectionDensity, SectionIndex, type SectionIndexEntry, SectionIndexLayout, type SectionIndexLayoutProps, type SectionIndexProps, type SectionProps, SectionVariant, SegmentedControl, type SegmentedControlProps, type SegmentedOption, SelectedMarker, SideSheet, type SideSheetProps, SplitLayout, SplitPanes, type SplitPanesProps, StatusBadge, type StatusBadgeProps, StickyPreview, type StickyPreviewProps, TYPE_SCALE_BREAKPOINT, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TextKind, ToggleSection, type ToggleSectionProps, type ToneColors, TruncatedText, type TruncatedTextProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveRowLook, resolveToneColors, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
|