@dloizides/ui-layout 1.60.1 → 1.61.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/dist/index.d.mts +13 -4
- package/dist/index.d.ts +13 -4
- package/dist/index.js +41 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1234,6 +1234,11 @@ interface SectionIndexEntry {
|
|
|
1234
1234
|
title: string;
|
|
1235
1235
|
content: React.ReactNode;
|
|
1236
1236
|
}
|
|
1237
|
+
/** Fold widths: from `wide` the index rail shows; from `stackFrom` up to `wide` every section shows stacked, below it chips. */
|
|
1238
|
+
interface SectionFold {
|
|
1239
|
+
wide: number;
|
|
1240
|
+
stackFrom: number;
|
|
1241
|
+
}
|
|
1237
1242
|
|
|
1238
1243
|
interface SectionIndexLayoutProps {
|
|
1239
1244
|
sections: ReadonlyArray<SectionIndexEntry>;
|
|
@@ -1241,7 +1246,7 @@ interface SectionIndexLayoutProps {
|
|
|
1241
1246
|
itemHint: string;
|
|
1242
1247
|
initialKey?: string;
|
|
1243
1248
|
collapsedKey?: string;
|
|
1244
|
-
breakpoint?: number;
|
|
1249
|
+
breakpoint?: number | SectionFold;
|
|
1245
1250
|
density?: SectionDensity;
|
|
1246
1251
|
stickyIndex?: boolean;
|
|
1247
1252
|
chipOverflow?: ChipOverflow;
|
|
@@ -1261,8 +1266,10 @@ interface SectionIndexProps {
|
|
|
1261
1266
|
testID: string;
|
|
1262
1267
|
width?: number;
|
|
1263
1268
|
activeColor?: string;
|
|
1269
|
+
/** Dense: 11/600 heading, 13/19 px items with 6x10 px padding, 2 px apart. */
|
|
1270
|
+
dense?: boolean;
|
|
1264
1271
|
}
|
|
1265
|
-
declare const SectionIndex: ({ sections, activeKey, heading, itemHint, onSelect, testID, width, activeColor }: SectionIndexProps) => React.ReactElement;
|
|
1272
|
+
declare const SectionIndex: ({ sections, activeKey, heading, itemHint, onSelect, testID, width, activeColor, dense }: SectionIndexProps) => React.ReactElement;
|
|
1266
1273
|
|
|
1267
1274
|
interface SectionChipsProps {
|
|
1268
1275
|
sections: ReadonlyArray<SectionIndexEntry>;
|
|
@@ -1271,10 +1278,12 @@ interface SectionChipsProps {
|
|
|
1271
1278
|
itemHint: string;
|
|
1272
1279
|
overflow?: ChipOverflow;
|
|
1273
1280
|
activeColor?: string;
|
|
1281
|
+
/** Dense: 13 px labels, 12 px chip padding, 6 px gutter, active label on the surface colour. */
|
|
1282
|
+
dense?: boolean;
|
|
1274
1283
|
onSelect: (key: string) => void;
|
|
1275
1284
|
testID: string;
|
|
1276
1285
|
}
|
|
1277
|
-
declare const SectionChips: ({ sections, activeKey, groupLabel, itemHint, overflow, activeColor, onSelect, testID }: SectionChipsProps) => React.ReactElement;
|
|
1286
|
+
declare const SectionChips: ({ sections, activeKey, groupLabel, itemHint, overflow, activeColor, dense, onSelect, testID }: SectionChipsProps) => React.ReactElement;
|
|
1278
1287
|
|
|
1279
1288
|
declare const SECTION_INDEX_BREAKPOINT = 1024;
|
|
1280
1289
|
declare function resolveActiveKey(sections: ReadonlyArray<SectionIndexEntry>, wanted: string | undefined): string;
|
|
@@ -1566,4 +1575,4 @@ interface ListDetailVisibility {
|
|
|
1566
1575
|
/** Wide shows both panes; narrow shows one, the detail only when asked for and present. */
|
|
1567
1576
|
declare function resolveListDetailPanes(wide: boolean, narrowPane: ListDetailPane, hasDetail: boolean): ListDetailVisibility;
|
|
1568
1577
|
|
|
1569
|
-
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, AppText, type AppTextProps, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, type BottomSheetProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, BuildInfoFooter, type BuildInfoFooterProps, COPY_FEEDBACK_MS, ChipOverflow, ConfirmDialog, ConfirmDialogFocus, type ConfirmDialogProps, CopyControl, CopyRowEmphasis, CopyStatus, type CopyToClipboard, type CopyValueLabels, CopyValueRow, type CopyValueRowProps, CopyableId, type CopyableIdProps, CountBadge, type CountBadgeProps, DEFAULT_BILLING_ROUTE, DayBadgeFill, DayCard, DayCardLayout, type DayCardProps, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, FigureStrip, type FigureStripProps, FormDialog, type FormDialogProps, HEADER_STACK_BREAKPOINT, Heading, type HeadingLevel, type HeadingProps, IdChip, type IdChipProps, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListDetailLayout, type ListDetailLayoutProps, ListDetailPane, type ListDetailVisibility, 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, PageHead, type PageHeadProps, type PageSize, RecordActionButton, type RecordActionButtonProps, RecordHeader, type RecordHeaderProps, type RowLook, type RowPalette, RowSelectedStyle, type RowSelection, type RowSelectionKeys, type RowState, SECTION_INDEX_BREAKPOINT, SECTION_INDEX_WIDTH, type ScaledFrame, ScreenColumn, type ScreenColumnProps, Section, SectionChips, type SectionChipsProps, SectionDensity, SectionIndex, type SectionIndexEntry, SectionIndexLayout, type SectionIndexLayoutProps, type SectionIndexProps, type SectionPadding, type SectionProps, SectionVariant, SegmentedControl, type SegmentedControlProps, type SegmentedOption, SegmentedVariant, SelectedMarker, SideSheet, type SideSheetProps, SplitLayout, SplitPanes, type SplitPanesProps, StatusBadge, type StatusBadgeProps, StickyActionBar, type StickyActionBarProps, StickyPreview, type StickyPreviewProps, TYPE_SCALE_BREAKPOINT, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TabsVariant, TextKind, Timeline, type TimelineEntry, type TimelineProps, ToggleSection, type ToggleSectionProps, type ToneColors, type TotalsItem, TotalsStrip, type TotalsStripProps, TotalsTone, TransferSlip, type TransferSlipProps, TruncatedText, type TruncatedTextProps, type UnderlineTab, UnderlineTabs, type UnderlineTabsProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, WidgetCard, type WidgetCardProps, copyActionLabel, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isRecordHeaderCompact, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveListDetailPanes, resolveRowLook, resolveTintColors, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
|
|
1578
|
+
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, AppText, type AppTextProps, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, type BottomSheetProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, BuildInfoFooter, type BuildInfoFooterProps, COPY_FEEDBACK_MS, ChipOverflow, ConfirmDialog, ConfirmDialogFocus, type ConfirmDialogProps, CopyControl, CopyRowEmphasis, CopyStatus, type CopyToClipboard, type CopyValueLabels, CopyValueRow, type CopyValueRowProps, CopyableId, type CopyableIdProps, CountBadge, type CountBadgeProps, DEFAULT_BILLING_ROUTE, DayBadgeFill, DayCard, DayCardLayout, type DayCardProps, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, FigureStrip, type FigureStripProps, FormDialog, type FormDialogProps, HEADER_STACK_BREAKPOINT, Heading, type HeadingLevel, type HeadingProps, IdChip, type IdChipProps, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListDetailLayout, type ListDetailLayoutProps, ListDetailPane, type ListDetailVisibility, 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, PageHead, type PageHeadProps, type PageSize, RecordActionButton, type RecordActionButtonProps, RecordHeader, type RecordHeaderProps, type RowLook, type RowPalette, RowSelectedStyle, type RowSelection, type RowSelectionKeys, type RowState, SECTION_INDEX_BREAKPOINT, SECTION_INDEX_WIDTH, type ScaledFrame, ScreenColumn, type ScreenColumnProps, Section, SectionChips, type SectionChipsProps, SectionDensity, type SectionFold, SectionIndex, type SectionIndexEntry, SectionIndexLayout, type SectionIndexLayoutProps, type SectionIndexProps, type SectionPadding, type SectionProps, SectionVariant, SegmentedControl, type SegmentedControlProps, type SegmentedOption, SegmentedVariant, SelectedMarker, SideSheet, type SideSheetProps, SplitLayout, SplitPanes, type SplitPanesProps, StatusBadge, type StatusBadgeProps, StickyActionBar, type StickyActionBarProps, StickyPreview, type StickyPreviewProps, TYPE_SCALE_BREAKPOINT, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TabsVariant, TextKind, Timeline, type TimelineEntry, type TimelineProps, ToggleSection, type ToggleSectionProps, type ToneColors, type TotalsItem, TotalsStrip, type TotalsStripProps, TotalsTone, TransferSlip, type TransferSlipProps, TruncatedText, type TruncatedTextProps, type UnderlineTab, UnderlineTabs, type UnderlineTabsProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, WidgetCard, type WidgetCardProps, copyActionLabel, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isRecordHeaderCompact, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveListDetailPanes, resolveRowLook, resolveTintColors, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
|
package/dist/index.d.ts
CHANGED
|
@@ -1234,6 +1234,11 @@ interface SectionIndexEntry {
|
|
|
1234
1234
|
title: string;
|
|
1235
1235
|
content: React.ReactNode;
|
|
1236
1236
|
}
|
|
1237
|
+
/** Fold widths: from `wide` the index rail shows; from `stackFrom` up to `wide` every section shows stacked, below it chips. */
|
|
1238
|
+
interface SectionFold {
|
|
1239
|
+
wide: number;
|
|
1240
|
+
stackFrom: number;
|
|
1241
|
+
}
|
|
1237
1242
|
|
|
1238
1243
|
interface SectionIndexLayoutProps {
|
|
1239
1244
|
sections: ReadonlyArray<SectionIndexEntry>;
|
|
@@ -1241,7 +1246,7 @@ interface SectionIndexLayoutProps {
|
|
|
1241
1246
|
itemHint: string;
|
|
1242
1247
|
initialKey?: string;
|
|
1243
1248
|
collapsedKey?: string;
|
|
1244
|
-
breakpoint?: number;
|
|
1249
|
+
breakpoint?: number | SectionFold;
|
|
1245
1250
|
density?: SectionDensity;
|
|
1246
1251
|
stickyIndex?: boolean;
|
|
1247
1252
|
chipOverflow?: ChipOverflow;
|
|
@@ -1261,8 +1266,10 @@ interface SectionIndexProps {
|
|
|
1261
1266
|
testID: string;
|
|
1262
1267
|
width?: number;
|
|
1263
1268
|
activeColor?: string;
|
|
1269
|
+
/** Dense: 11/600 heading, 13/19 px items with 6x10 px padding, 2 px apart. */
|
|
1270
|
+
dense?: boolean;
|
|
1264
1271
|
}
|
|
1265
|
-
declare const SectionIndex: ({ sections, activeKey, heading, itemHint, onSelect, testID, width, activeColor }: SectionIndexProps) => React.ReactElement;
|
|
1272
|
+
declare const SectionIndex: ({ sections, activeKey, heading, itemHint, onSelect, testID, width, activeColor, dense }: SectionIndexProps) => React.ReactElement;
|
|
1266
1273
|
|
|
1267
1274
|
interface SectionChipsProps {
|
|
1268
1275
|
sections: ReadonlyArray<SectionIndexEntry>;
|
|
@@ -1271,10 +1278,12 @@ interface SectionChipsProps {
|
|
|
1271
1278
|
itemHint: string;
|
|
1272
1279
|
overflow?: ChipOverflow;
|
|
1273
1280
|
activeColor?: string;
|
|
1281
|
+
/** Dense: 13 px labels, 12 px chip padding, 6 px gutter, active label on the surface colour. */
|
|
1282
|
+
dense?: boolean;
|
|
1274
1283
|
onSelect: (key: string) => void;
|
|
1275
1284
|
testID: string;
|
|
1276
1285
|
}
|
|
1277
|
-
declare const SectionChips: ({ sections, activeKey, groupLabel, itemHint, overflow, activeColor, onSelect, testID }: SectionChipsProps) => React.ReactElement;
|
|
1286
|
+
declare const SectionChips: ({ sections, activeKey, groupLabel, itemHint, overflow, activeColor, dense, onSelect, testID }: SectionChipsProps) => React.ReactElement;
|
|
1278
1287
|
|
|
1279
1288
|
declare const SECTION_INDEX_BREAKPOINT = 1024;
|
|
1280
1289
|
declare function resolveActiveKey(sections: ReadonlyArray<SectionIndexEntry>, wanted: string | undefined): string;
|
|
@@ -1566,4 +1575,4 @@ interface ListDetailVisibility {
|
|
|
1566
1575
|
/** Wide shows both panes; narrow shows one, the detail only when asked for and present. */
|
|
1567
1576
|
declare function resolveListDetailPanes(wide: boolean, narrowPane: ListDetailPane, hasDetail: boolean): ListDetailVisibility;
|
|
1568
1577
|
|
|
1569
|
-
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, AppText, type AppTextProps, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, type BottomSheetProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, BuildInfoFooter, type BuildInfoFooterProps, COPY_FEEDBACK_MS, ChipOverflow, ConfirmDialog, ConfirmDialogFocus, type ConfirmDialogProps, CopyControl, CopyRowEmphasis, CopyStatus, type CopyToClipboard, type CopyValueLabels, CopyValueRow, type CopyValueRowProps, CopyableId, type CopyableIdProps, CountBadge, type CountBadgeProps, DEFAULT_BILLING_ROUTE, DayBadgeFill, DayCard, DayCardLayout, type DayCardProps, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, FigureStrip, type FigureStripProps, FormDialog, type FormDialogProps, HEADER_STACK_BREAKPOINT, Heading, type HeadingLevel, type HeadingProps, IdChip, type IdChipProps, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListDetailLayout, type ListDetailLayoutProps, ListDetailPane, type ListDetailVisibility, 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, PageHead, type PageHeadProps, type PageSize, RecordActionButton, type RecordActionButtonProps, RecordHeader, type RecordHeaderProps, type RowLook, type RowPalette, RowSelectedStyle, type RowSelection, type RowSelectionKeys, type RowState, SECTION_INDEX_BREAKPOINT, SECTION_INDEX_WIDTH, type ScaledFrame, ScreenColumn, type ScreenColumnProps, Section, SectionChips, type SectionChipsProps, SectionDensity, SectionIndex, type SectionIndexEntry, SectionIndexLayout, type SectionIndexLayoutProps, type SectionIndexProps, type SectionPadding, type SectionProps, SectionVariant, SegmentedControl, type SegmentedControlProps, type SegmentedOption, SegmentedVariant, SelectedMarker, SideSheet, type SideSheetProps, SplitLayout, SplitPanes, type SplitPanesProps, StatusBadge, type StatusBadgeProps, StickyActionBar, type StickyActionBarProps, StickyPreview, type StickyPreviewProps, TYPE_SCALE_BREAKPOINT, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TabsVariant, TextKind, Timeline, type TimelineEntry, type TimelineProps, ToggleSection, type ToggleSectionProps, type ToneColors, type TotalsItem, TotalsStrip, type TotalsStripProps, TotalsTone, TransferSlip, type TransferSlipProps, TruncatedText, type TruncatedTextProps, type UnderlineTab, UnderlineTabs, type UnderlineTabsProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, WidgetCard, type WidgetCardProps, copyActionLabel, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isRecordHeaderCompact, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveListDetailPanes, resolveRowLook, resolveTintColors, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
|
|
1578
|
+
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, AppText, type AppTextProps, BUILD_INFO_PREFIX, BadgeTone, BottomSheet, type BottomSheetProps, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, BuildInfoFooter, type BuildInfoFooterProps, COPY_FEEDBACK_MS, ChipOverflow, ConfirmDialog, ConfirmDialogFocus, type ConfirmDialogProps, CopyControl, CopyRowEmphasis, CopyStatus, type CopyToClipboard, type CopyValueLabels, CopyValueRow, type CopyValueRowProps, CopyableId, type CopyableIdProps, CountBadge, type CountBadgeProps, DEFAULT_BILLING_ROUTE, DayBadgeFill, DayCard, DayCardLayout, type DayCardProps, type DropdownOption, type DropdownTriggerState, DropdownVariant, ELLIPSIS, FigureStrip, type FigureStripProps, FormDialog, type FormDialogProps, HEADER_STACK_BREAKPOINT, Heading, type HeadingLevel, type HeadingProps, IdChip, type IdChipProps, LAYOUT_COLLAPSE_BREAKPOINT, LAYOUT_I18N, LAYOUT_TEST_IDS, ListDetailLayout, type ListDetailLayoutProps, ListDetailPane, type ListDetailVisibility, 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, PageHead, type PageHeadProps, type PageSize, RecordActionButton, type RecordActionButtonProps, RecordHeader, type RecordHeaderProps, type RowLook, type RowPalette, RowSelectedStyle, type RowSelection, type RowSelectionKeys, type RowState, SECTION_INDEX_BREAKPOINT, SECTION_INDEX_WIDTH, type ScaledFrame, ScreenColumn, type ScreenColumnProps, Section, SectionChips, type SectionChipsProps, SectionDensity, type SectionFold, SectionIndex, type SectionIndexEntry, SectionIndexLayout, type SectionIndexLayoutProps, type SectionIndexProps, type SectionPadding, type SectionProps, SectionVariant, SegmentedControl, type SegmentedControlProps, type SegmentedOption, SegmentedVariant, SelectedMarker, SideSheet, type SideSheetProps, SplitLayout, SplitPanes, type SplitPanesProps, StatusBadge, type StatusBadgeProps, StickyActionBar, type StickyActionBarProps, StickyPreview, type StickyPreviewProps, TYPE_SCALE_BREAKPOINT, type TabDescriptor, Tabs, TabsCollapsedTrigger, type TabsProps, TabsVariant, TextKind, Timeline, type TimelineEntry, type TimelineProps, ToggleSection, type ToggleSectionProps, type ToneColors, type TotalsItem, TotalsStrip, type TotalsStripProps, TotalsTone, TransferSlip, type TransferSlipProps, TruncatedText, type TruncatedTextProps, type UnderlineTab, UnderlineTabs, type UnderlineTabsProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, WidgetCard, type WidgetCardProps, copyActionLabel, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isRecordHeaderCompact, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveListDetailPanes, resolveRowLook, resolveTintColors, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
|
package/dist/index.js
CHANGED
|
@@ -3386,17 +3386,24 @@ var styles29 = reactNative.StyleSheet.create({
|
|
|
3386
3386
|
root: { flexDirection: "row", flexWrap: "wrap", gap: 8 },
|
|
3387
3387
|
scrollRow: { flexDirection: "row", flexWrap: "nowrap", gap: 8 },
|
|
3388
3388
|
chip: { minHeight: MIN_TARGET_PX, justifyContent: "center", paddingHorizontal: 14, borderRadius: 999, borderWidth: 1 },
|
|
3389
|
-
label: { fontSize: 14, fontWeight: "600" }
|
|
3389
|
+
label: { fontSize: 14, fontWeight: "600" },
|
|
3390
|
+
denseRow: { gap: 6 },
|
|
3391
|
+
denseChip: { paddingHorizontal: 12 },
|
|
3392
|
+
denseLabel: { fontSize: 13 }
|
|
3390
3393
|
});
|
|
3391
3394
|
function ariaSelected(selected) {
|
|
3392
3395
|
return { "aria-selected": selected };
|
|
3393
3396
|
}
|
|
3394
|
-
|
|
3397
|
+
function activeInk(active, dense, colors) {
|
|
3398
|
+
if (!active) return colors.text;
|
|
3399
|
+
return dense ? colors.surface : colors.background;
|
|
3400
|
+
}
|
|
3401
|
+
var SectionChips = ({ sections, activeKey, groupLabel, itemHint, overflow = "wrap" /* Wrap */, activeColor, dense = false, onSelect, testID }) => {
|
|
3395
3402
|
const { theme } = uiFeedback.useUi();
|
|
3396
3403
|
const { colors } = theme;
|
|
3397
3404
|
const fill = activeColor ?? colors.text;
|
|
3398
3405
|
const scroll = overflow === "scroll" /* Scroll */;
|
|
3399
|
-
const row = /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityRole: "tablist", accessibilityLabel: groupLabel, style: scroll ? styles29.scrollRow : styles29.root, testID: `${testID}-chips`, children: sections.map((entry) => {
|
|
3406
|
+
const row = /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { accessibilityRole: "tablist", accessibilityLabel: groupLabel, style: [scroll ? styles29.scrollRow : styles29.root, dense && styles29.denseRow], testID: `${testID}-chips`, children: sections.map((entry) => {
|
|
3400
3407
|
const active = entry.key === activeKey;
|
|
3401
3408
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3402
3409
|
reactNative.Pressable,
|
|
@@ -3405,10 +3412,10 @@ var SectionChips = ({ sections, activeKey, groupLabel, itemHint, overflow = "wra
|
|
|
3405
3412
|
accessibilityRole: "tab",
|
|
3406
3413
|
accessibilityLabel: entry.title,
|
|
3407
3414
|
accessibilityHint: itemHint,
|
|
3408
|
-
style: [styles29.chip, { borderColor: colors.border, backgroundColor: active ? fill : colors.background }],
|
|
3415
|
+
style: [styles29.chip, dense && styles29.denseChip, { borderColor: colors.border, backgroundColor: active ? fill : colors.background }],
|
|
3409
3416
|
testID: `${testID}-chip-${entry.key}`,
|
|
3410
3417
|
onPress: () => onSelect(entry.key),
|
|
3411
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles29.label, { color: active
|
|
3418
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles29.label, dense && styles29.denseLabel, { color: activeInk(active, dense, colors) }], children: entry.title })
|
|
3412
3419
|
},
|
|
3413
3420
|
entry.key
|
|
3414
3421
|
);
|
|
@@ -3425,22 +3432,29 @@ var SectionDensity = /* @__PURE__ */ ((SectionDensity2) => {
|
|
|
3425
3432
|
var SECTION_INDEX_WIDTH = 200;
|
|
3426
3433
|
var ACTIVE_BAR = 3;
|
|
3427
3434
|
var TRANSPARENT3 = "transparent";
|
|
3435
|
+
var DENSE_TARGET_PX = 24;
|
|
3436
|
+
var DENSE_LINE = 19;
|
|
3428
3437
|
var styles30 = reactNative.StyleSheet.create({
|
|
3429
3438
|
root: { flexShrink: 0, gap: 2, alignSelf: "flex-start" },
|
|
3430
3439
|
heading: { fontSize: 12, fontWeight: "700", letterSpacing: 0.6, textTransform: "uppercase", paddingHorizontal: 10, paddingBottom: 6 },
|
|
3431
3440
|
item: { minHeight: MIN_TARGET_PX, justifyContent: "center", paddingHorizontal: 10, borderLeftWidth: ACTIVE_BAR, borderRadius: 6 },
|
|
3432
3441
|
label: { fontSize: 14 },
|
|
3433
|
-
labelActive: { fontWeight: "700" }
|
|
3442
|
+
labelActive: { fontWeight: "700" },
|
|
3443
|
+
denseRoot: { gap: 2 },
|
|
3444
|
+
denseHeading: { fontSize: 11, fontWeight: "600", letterSpacing: 0.66, lineHeight: 16, paddingBottom: 6 },
|
|
3445
|
+
denseItem: { minHeight: DENSE_TARGET_PX, paddingVertical: 6, paddingLeft: 7, paddingRight: 10, borderRadius: 7 },
|
|
3446
|
+
denseLabel: { fontSize: 13, lineHeight: DENSE_LINE },
|
|
3447
|
+
denseLabelActive: { fontWeight: "600" }
|
|
3434
3448
|
});
|
|
3435
3449
|
function ariaCurrent(active) {
|
|
3436
3450
|
return active ? { "aria-current": "location" } : {};
|
|
3437
3451
|
}
|
|
3438
|
-
var SectionIndex = ({ sections, activeKey, heading, itemHint, onSelect, testID, width = SECTION_INDEX_WIDTH, activeColor }) => {
|
|
3452
|
+
var SectionIndex = ({ sections, activeKey, heading, itemHint, onSelect, testID, width = SECTION_INDEX_WIDTH, activeColor, dense = false }) => {
|
|
3439
3453
|
const { theme } = uiFeedback.useUi();
|
|
3440
3454
|
const { colors } = theme;
|
|
3441
3455
|
const bar = activeColor ?? colors.text;
|
|
3442
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { role: "navigation", accessibilityLabel: heading, style: [styles30.root, { width }], testID: `${testID}-index`, children: [
|
|
3443
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles30.heading, { color: colors.textSecondary }], children: heading }),
|
|
3456
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { role: "navigation", accessibilityLabel: heading, style: [styles30.root, dense && styles30.denseRoot, { width }], testID: `${testID}-index`, children: [
|
|
3457
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles30.heading, dense && styles30.denseHeading, { color: colors.textSecondary }], children: heading }),
|
|
3444
3458
|
sections.map((entry) => {
|
|
3445
3459
|
const active = entry.key === activeKey;
|
|
3446
3460
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -3450,10 +3464,10 @@ var SectionIndex = ({ sections, activeKey, heading, itemHint, onSelect, testID,
|
|
|
3450
3464
|
accessibilityRole: "link",
|
|
3451
3465
|
accessibilityLabel: entry.title,
|
|
3452
3466
|
accessibilityHint: itemHint,
|
|
3453
|
-
style: [styles30.item, { borderLeftColor: active ? bar : TRANSPARENT3, backgroundColor: active ? colors.surface : TRANSPARENT3 }],
|
|
3467
|
+
style: [styles30.item, dense && styles30.denseItem, { borderLeftColor: active ? bar : TRANSPARENT3, backgroundColor: active ? colors.surface : TRANSPARENT3 }],
|
|
3454
3468
|
testID: `${testID}-index-${entry.key}`,
|
|
3455
3469
|
onPress: () => onSelect(entry.key),
|
|
3456
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles30.label, active && styles30.labelActive, { color: active ? colors.text : colors.textSecondary }], children: entry.title })
|
|
3470
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles30.label, active && styles30.labelActive, dense && styles30.denseLabel, dense && active && styles30.denseLabelActive, { color: active ? colors.text : colors.textSecondary }], children: entry.title })
|
|
3457
3471
|
},
|
|
3458
3472
|
entry.key
|
|
3459
3473
|
);
|
|
@@ -3478,11 +3492,17 @@ function scrollToSection(anchorId) {
|
|
|
3478
3492
|
}
|
|
3479
3493
|
var COMFORTABLE_GAP = 12;
|
|
3480
3494
|
var DENSE_GAP = 8;
|
|
3495
|
+
var DENSE_WIDE_GAP = 16;
|
|
3481
3496
|
var WEB_STICKY = { position: "sticky", top: 0 };
|
|
3497
|
+
var NO_STACK = Number.POSITIVE_INFINITY;
|
|
3482
3498
|
var styles31 = reactNative.StyleSheet.create({
|
|
3483
3499
|
wide: { flexDirection: "row", alignItems: "flex-start", gap: 20 },
|
|
3484
3500
|
column: { flex: 1, minWidth: 0 }
|
|
3485
3501
|
});
|
|
3502
|
+
function toFold(breakpoint) {
|
|
3503
|
+
return typeof breakpoint === "number" ? { wide: breakpoint, stackFrom: NO_STACK } : breakpoint;
|
|
3504
|
+
}
|
|
3505
|
+
var SectionColumn = ({ sections, testID, style }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style, testID: `${testID}-column`, children: sections.map((entry) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { nativeID: sectionAnchorId(testID, entry.key), testID: sectionAnchorId(testID, entry.key), children: entry.content }, entry.key)) });
|
|
3486
3506
|
var SectionIndexLayout = ({
|
|
3487
3507
|
sections,
|
|
3488
3508
|
indexHeading,
|
|
@@ -3497,11 +3517,15 @@ var SectionIndexLayout = ({
|
|
|
3497
3517
|
activeColor,
|
|
3498
3518
|
testID = "section-index"
|
|
3499
3519
|
}) => {
|
|
3500
|
-
const
|
|
3520
|
+
const fold = toFold(breakpoint);
|
|
3521
|
+
const wide = useIsWideViewport(fold.wide);
|
|
3522
|
+
const stacked = useIsWideViewport(fold.stackFrom);
|
|
3501
3523
|
const [picked, setPicked] = React16.useState(void 0);
|
|
3502
3524
|
const activeKey = resolveActiveKey(sections, picked ?? (wide ? initialKey : collapsedKey ?? initialKey));
|
|
3503
|
-
const
|
|
3525
|
+
const dense = density === "dense" /* Dense */;
|
|
3526
|
+
const gap = { gap: dense ? DENSE_GAP : COMFORTABLE_GAP };
|
|
3504
3527
|
if (sections.length < 2) return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { testID, children: sections[0]?.content });
|
|
3528
|
+
if (!wide && stacked) return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { testID, children: /* @__PURE__ */ jsxRuntime.jsx(SectionColumn, { sections, style: gap, testID }) });
|
|
3505
3529
|
if (!wide) {
|
|
3506
3530
|
const active = sections.find((entry) => entry.key === activeKey);
|
|
3507
3531
|
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: gap, testID, children: [
|
|
@@ -3510,6 +3534,7 @@ var SectionIndexLayout = ({
|
|
|
3510
3534
|
{
|
|
3511
3535
|
activeColor,
|
|
3512
3536
|
activeKey,
|
|
3537
|
+
dense,
|
|
3513
3538
|
groupLabel: indexHeading,
|
|
3514
3539
|
itemHint,
|
|
3515
3540
|
overflow: chipOverflow,
|
|
@@ -3526,9 +3551,9 @@ var SectionIndexLayout = ({
|
|
|
3526
3551
|
scrollToSection(sectionAnchorId(testID, key));
|
|
3527
3552
|
};
|
|
3528
3553
|
const sticky = stickyIndex && reactNative.Platform.OS === "web" ? WEB_STICKY : null;
|
|
3529
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles31.wide, testID, children: [
|
|
3530
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: sticky, children: /* @__PURE__ */ jsxRuntime.jsx(SectionIndex, { activeColor, activeKey, heading: indexHeading, itemHint, sections, testID, width: indexWidth, onSelect: select }) }),
|
|
3531
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3554
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles31.wide, dense && { gap: DENSE_WIDE_GAP }], testID, children: [
|
|
3555
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: sticky, children: /* @__PURE__ */ jsxRuntime.jsx(SectionIndex, { activeColor, activeKey, dense, heading: indexHeading, itemHint, sections, testID, width: indexWidth, onSelect: select }) }),
|
|
3556
|
+
/* @__PURE__ */ jsxRuntime.jsx(SectionColumn, { sections, style: reactNative.StyleSheet.flatten([styles31.column, gap]), testID })
|
|
3532
3557
|
] });
|
|
3533
3558
|
};
|
|
3534
3559
|
|