@dloizides/ui-layout 1.64.0 → 1.66.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 +4 -0
- package/dist/index.d.mts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +12 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.65.0
|
|
4
|
+
|
|
5
|
+
- MODC-1 "Module C unified console" scroll-0 fix. With the scroll spy on, the scroller at its top marks the first section current, even when `initialKey` names a later one or a short first section lets the second cross the activation line (`ScrollViewport` gains `atStart`). The collapsed (chips) layout opens on `collapsedKey` only, else the first chip; `initialKey` no longer applies below the index breakpoint.
|
|
6
|
+
|
|
3
7
|
## 1.60.1
|
|
4
8
|
|
|
5
9
|
- Ships the 1.60.0 `SectionIndexLayout` `collapsedKey` change; 1.60.0 never reached npm (its test used a wrong index testID).
|
package/dist/index.d.mts
CHANGED
|
@@ -1333,6 +1333,11 @@ declare const enum DayCardLayout {
|
|
|
1333
1333
|
Separate = "separate"
|
|
1334
1334
|
}
|
|
1335
1335
|
|
|
1336
|
+
/** Explicit badge fill and ink, e.g. a brand colour from the app's theme config. */
|
|
1337
|
+
interface DayBadgeColors {
|
|
1338
|
+
backgroundColor: string;
|
|
1339
|
+
color: string;
|
|
1340
|
+
}
|
|
1336
1341
|
interface DayCardProps {
|
|
1337
1342
|
label: string;
|
|
1338
1343
|
badge: string;
|
|
@@ -1341,13 +1346,14 @@ interface DayCardProps {
|
|
|
1341
1346
|
accessibilityHint: string;
|
|
1342
1347
|
badgeTone?: BadgeTone;
|
|
1343
1348
|
badgeFill?: DayBadgeFill;
|
|
1349
|
+
badgeColors?: DayBadgeColors;
|
|
1344
1350
|
badgeIcon?: IconName;
|
|
1345
1351
|
layout?: DayCardLayout;
|
|
1346
1352
|
testID?: string;
|
|
1347
1353
|
children: React.ReactNode;
|
|
1348
1354
|
}
|
|
1349
1355
|
/** One day of a list: its label, an age badge and the item count over the day's rows, in one card or one card per row (`layout`). */
|
|
1350
|
-
declare const DayCard: ({ label, badge, count, accessibilityLabel, accessibilityHint, badgeTone, badgeFill, badgeIcon, layout, testID, children, }: DayCardProps) => React.ReactElement;
|
|
1356
|
+
declare const DayCard: ({ label, badge, count, accessibilityLabel, accessibilityHint, badgeTone, badgeFill, badgeColors, badgeIcon, layout, testID, children, }: DayCardProps) => React.ReactElement;
|
|
1351
1357
|
|
|
1352
1358
|
/** The style of one figure cell: an equal share of the strip when wide, half a row when narrow; span widens it. */
|
|
1353
1359
|
declare function figureCell(wide: boolean, span?: number): StyleProp<ViewStyle>;
|
|
@@ -1608,4 +1614,4 @@ interface ListDetailVisibility {
|
|
|
1608
1614
|
/** Wide shows both panes; narrow shows one, the detail only when asked for and present. */
|
|
1609
1615
|
declare function resolveListDetailPanes(wide: boolean, narrowPane: ListDetailPane, hasDetail: boolean): ListDetailVisibility;
|
|
1610
1616
|
|
|
1611
|
-
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, AppText, type AppTextProps, BUILD_INFO_PREFIX, BadgeSize, 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, SPY_ACTIVATION_RATIO, SPY_CLICK_LOCK_MS, type ScaledFrame, ScreenColumn, type ScreenColumnProps, type ScrollSpyControl, type ScrollSpyOptions, 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, type StickyIndexConfig, 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, pickActiveIndex, resolveActiveKey, resolveListDetailPanes, resolveRowLook, resolveTintColors, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useScrollSpy, useVisibleViewport };
|
|
1617
|
+
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, AppText, type AppTextProps, BUILD_INFO_PREFIX, BadgeSize, 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, type DayBadgeColors, 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, SPY_ACTIVATION_RATIO, SPY_CLICK_LOCK_MS, type ScaledFrame, ScreenColumn, type ScreenColumnProps, type ScrollSpyControl, type ScrollSpyOptions, 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, type StickyIndexConfig, 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, pickActiveIndex, resolveActiveKey, resolveListDetailPanes, resolveRowLook, resolveTintColors, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useScrollSpy, useVisibleViewport };
|
package/dist/index.d.ts
CHANGED
|
@@ -1333,6 +1333,11 @@ declare const enum DayCardLayout {
|
|
|
1333
1333
|
Separate = "separate"
|
|
1334
1334
|
}
|
|
1335
1335
|
|
|
1336
|
+
/** Explicit badge fill and ink, e.g. a brand colour from the app's theme config. */
|
|
1337
|
+
interface DayBadgeColors {
|
|
1338
|
+
backgroundColor: string;
|
|
1339
|
+
color: string;
|
|
1340
|
+
}
|
|
1336
1341
|
interface DayCardProps {
|
|
1337
1342
|
label: string;
|
|
1338
1343
|
badge: string;
|
|
@@ -1341,13 +1346,14 @@ interface DayCardProps {
|
|
|
1341
1346
|
accessibilityHint: string;
|
|
1342
1347
|
badgeTone?: BadgeTone;
|
|
1343
1348
|
badgeFill?: DayBadgeFill;
|
|
1349
|
+
badgeColors?: DayBadgeColors;
|
|
1344
1350
|
badgeIcon?: IconName;
|
|
1345
1351
|
layout?: DayCardLayout;
|
|
1346
1352
|
testID?: string;
|
|
1347
1353
|
children: React.ReactNode;
|
|
1348
1354
|
}
|
|
1349
1355
|
/** One day of a list: its label, an age badge and the item count over the day's rows, in one card or one card per row (`layout`). */
|
|
1350
|
-
declare const DayCard: ({ label, badge, count, accessibilityLabel, accessibilityHint, badgeTone, badgeFill, badgeIcon, layout, testID, children, }: DayCardProps) => React.ReactElement;
|
|
1356
|
+
declare const DayCard: ({ label, badge, count, accessibilityLabel, accessibilityHint, badgeTone, badgeFill, badgeColors, badgeIcon, layout, testID, children, }: DayCardProps) => React.ReactElement;
|
|
1351
1357
|
|
|
1352
1358
|
/** The style of one figure cell: an equal share of the strip when wide, half a row when narrow; span widens it. */
|
|
1353
1359
|
declare function figureCell(wide: boolean, span?: number): StyleProp<ViewStyle>;
|
|
@@ -1608,4 +1614,4 @@ interface ListDetailVisibility {
|
|
|
1608
1614
|
/** Wide shows both panes; narrow shows one, the detail only when asked for and present. */
|
|
1609
1615
|
declare function resolveListDetailPanes(wide: boolean, narrowPane: ListDetailPane, hasDetail: boolean): ListDetailVisibility;
|
|
1610
1616
|
|
|
1611
|
-
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, AppText, type AppTextProps, BUILD_INFO_PREFIX, BadgeSize, 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, SPY_ACTIVATION_RATIO, SPY_CLICK_LOCK_MS, type ScaledFrame, ScreenColumn, type ScreenColumnProps, type ScrollSpyControl, type ScrollSpyOptions, 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, type StickyIndexConfig, 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, pickActiveIndex, resolveActiveKey, resolveListDetailPanes, resolveRowLook, resolveTintColors, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useScrollSpy, useVisibleViewport };
|
|
1617
|
+
export { A4_PAGE, API_COMMIT_SEPARATOR, Accordion, AccordionItem, type AccordionItemProps, type AccordionProps, type AccordionVariant, AppText, type AppTextProps, BUILD_INFO_PREFIX, BadgeSize, 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, type DayBadgeColors, 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, SPY_ACTIVATION_RATIO, SPY_CLICK_LOCK_MS, type ScaledFrame, ScreenColumn, type ScreenColumnProps, type ScrollSpyControl, type ScrollSpyOptions, 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, type StickyIndexConfig, 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, pickActiveIndex, resolveActiveKey, resolveListDetailPanes, resolveRowLook, resolveTintColors, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useScrollSpy, useVisibleViewport };
|
package/dist/index.js
CHANGED
|
@@ -1014,6 +1014,7 @@ var styles11 = reactNative.StyleSheet.create({
|
|
|
1014
1014
|
track: {
|
|
1015
1015
|
flexDirection: "row",
|
|
1016
1016
|
alignSelf: "flex-start",
|
|
1017
|
+
maxWidth: "100%",
|
|
1017
1018
|
alignItems: "center",
|
|
1018
1019
|
gap: TRACK_PADDING + 1,
|
|
1019
1020
|
padding: TRACK_PADDING,
|
|
@@ -1021,6 +1022,7 @@ var styles11 = reactNative.StyleSheet.create({
|
|
|
1021
1022
|
borderWidth: BORDER_WIDTH
|
|
1022
1023
|
},
|
|
1023
1024
|
segment: {
|
|
1025
|
+
flexShrink: 1,
|
|
1024
1026
|
minHeight: MIN_TARGET_PX,
|
|
1025
1027
|
justifyContent: "center",
|
|
1026
1028
|
paddingHorizontal: SEGMENT_PAD_H,
|
|
@@ -3551,6 +3553,7 @@ function pickActiveIndex(tops, line) {
|
|
|
3551
3553
|
return tops.reduce((picked, top, index) => top <= line ? index : picked, 0);
|
|
3552
3554
|
}
|
|
3553
3555
|
function pickSpyIndex(tops, viewport, activationRatio) {
|
|
3556
|
+
if (viewport.atStart) return 0;
|
|
3554
3557
|
if (viewport.atEnd) return Math.max(tops.length - 1, 0);
|
|
3555
3558
|
return pickActiveIndex(tops, viewport.top + viewport.height * activationRatio);
|
|
3556
3559
|
}
|
|
@@ -3580,6 +3583,9 @@ function scrollParent(element) {
|
|
|
3580
3583
|
}
|
|
3581
3584
|
return null;
|
|
3582
3585
|
}
|
|
3586
|
+
function isAtStart(scrolled) {
|
|
3587
|
+
return scrolled <= 0;
|
|
3588
|
+
}
|
|
3583
3589
|
function isAtEnd(scrolled, visible, total) {
|
|
3584
3590
|
return scrolled > 0 && scrolled + visible >= total - END_TOLERANCE_PX;
|
|
3585
3591
|
}
|
|
@@ -3587,9 +3593,9 @@ function scrollViewport(anchor) {
|
|
|
3587
3593
|
const parent = scrollParent(anchor);
|
|
3588
3594
|
if (parent === null) {
|
|
3589
3595
|
const root = document.scrollingElement ?? document.documentElement;
|
|
3590
|
-
return { top: 0, height: window.innerHeight, atEnd: isAtEnd(window.scrollY, window.innerHeight, root.scrollHeight) };
|
|
3596
|
+
return { top: 0, height: window.innerHeight, atStart: isAtStart(window.scrollY), atEnd: isAtEnd(window.scrollY, window.innerHeight, root.scrollHeight) };
|
|
3591
3597
|
}
|
|
3592
|
-
return { top: parent.getBoundingClientRect().top, height: parent.clientHeight, atEnd: isAtEnd(parent.scrollTop, parent.clientHeight, parent.scrollHeight) };
|
|
3598
|
+
return { top: parent.getBoundingClientRect().top, height: parent.clientHeight, atStart: isAtStart(parent.scrollTop), atEnd: isAtEnd(parent.scrollTop, parent.clientHeight, parent.scrollHeight) };
|
|
3593
3599
|
}
|
|
3594
3600
|
|
|
3595
3601
|
// src/SectionIndexLayout/useScrollSpy.ts
|
|
@@ -3623,10 +3629,9 @@ function useScrollSpy({ anchorIds, enabled, activationRatio, onActive }) {
|
|
|
3623
3629
|
const tops = anchors.map((anchor) => anchor.element.getBoundingClientRect().top);
|
|
3624
3630
|
const picked = pickSpyIndex(tops, scrollViewport(first.element), activationRatio);
|
|
3625
3631
|
const index = anchors[picked]?.index ?? 0;
|
|
3626
|
-
const primed = last.current !== UNPRIMED;
|
|
3627
3632
|
if (index === last.current) return;
|
|
3628
3633
|
last.current = index;
|
|
3629
|
-
|
|
3634
|
+
onActiveRef.current(index);
|
|
3630
3635
|
};
|
|
3631
3636
|
document.addEventListener("scroll", evaluate, LISTEN_OPTIONS);
|
|
3632
3637
|
window.addEventListener("resize", evaluate, LISTEN_OPTIONS);
|
|
@@ -3695,7 +3700,7 @@ var SectionIndexLayout = ({
|
|
|
3695
3700
|
const wide = useIsWideViewport(fold.wide);
|
|
3696
3701
|
const stacked = useIsWideViewport(fold.stackFrom);
|
|
3697
3702
|
const sticky = resolveSticky(stickyIndex);
|
|
3698
|
-
const preferredKey = wide ? initialKey : collapsedKey
|
|
3703
|
+
const preferredKey = wide ? initialKey : collapsedKey;
|
|
3699
3704
|
const { activeKey, pick, select } = useSectionSelection({ sections, testID, preferredKey, spyEnabled: wide && sections.length > 1, sticky });
|
|
3700
3705
|
const dense = density === "dense" /* Dense */;
|
|
3701
3706
|
const gap = { gap: dense ? DENSE_GAP : COMFORTABLE_GAP };
|
|
@@ -3762,6 +3767,7 @@ var DayCard = ({
|
|
|
3762
3767
|
accessibilityHint,
|
|
3763
3768
|
badgeTone = "warning" /* Warning */,
|
|
3764
3769
|
badgeFill = "solid" /* Solid */,
|
|
3770
|
+
badgeColors,
|
|
3765
3771
|
badgeIcon,
|
|
3766
3772
|
layout = "grouped" /* Grouped */,
|
|
3767
3773
|
testID,
|
|
@@ -3769,7 +3775,7 @@ var DayCard = ({
|
|
|
3769
3775
|
}) => {
|
|
3770
3776
|
const { theme } = uiFeedback.useUi();
|
|
3771
3777
|
const { colors } = theme;
|
|
3772
|
-
const tint = badgeFill === "tint" /* Tint */ ? resolveTintColors(theme, badgeTone) : void 0;
|
|
3778
|
+
const tint = badgeColors ?? (badgeFill === "tint" /* Tint */ ? resolveTintColors(theme, badgeTone) : void 0);
|
|
3773
3779
|
const surface = { backgroundColor: colors.surface, borderColor: colors.border };
|
|
3774
3780
|
const iconInk = tint?.color ?? colors.textSecondary;
|
|
3775
3781
|
const icon = badgeIcon === void 0 ? void 0 : /* @__PURE__ */ jsxRuntime.jsx(uiIcons.SvgIcon, { color: iconInk, name: badgeIcon, size: BADGE_ICON_SIZE });
|