@dloizides/ui-layout 1.49.3 → 1.50.1

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 CHANGED
@@ -143,14 +143,15 @@ interface SplitPanesProps {
143
143
  layout?: SplitLayout;
144
144
  startWeight?: number;
145
145
  endWeight?: number;
146
+ startWidth?: number;
146
147
  endWidth?: number;
147
148
  gap?: number;
148
149
  breakpoint?: number;
149
150
  testID?: string;
150
151
  }
151
152
  /** 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;
153
+ * `startWidth` / `endWidth` fix that pane (a rail) at that width while side by side; stacked it stays full width. */
154
+ declare const SplitPanes: ({ start, end, layout, startWeight, endWeight, startWidth, endWidth, gap, breakpoint, testID, }: SplitPanesProps) => React.ReactElement;
154
155
 
155
156
  /** Whether the panes sit side by side: always for Side, never for Stack, from `breakpoint` up for Auto. */
156
157
  declare function isSplitSideBySide(layout: SplitLayout, width: number, breakpoint: number): boolean;
@@ -1183,6 +1184,17 @@ interface RowLook {
1183
1184
  /** Resolves a row's container style and text colours from its selected style and state. */
1184
1185
  declare function resolveRowLook(style: RowSelectedStyle, state: RowState, palette: RowPalette): RowLook;
1185
1186
 
1187
+ interface RowSelectionKeys {
1188
+ selectedKey: string | null;
1189
+ shownKey: string | null;
1190
+ }
1191
+ interface RowSelection {
1192
+ selected: boolean;
1193
+ style: RowSelectedStyle;
1194
+ }
1195
+ /** Desktop marks the row whose detail is shown with an accent bar; a phone outlines only the row the user tapped. */
1196
+ declare function rowSelection(isDesktop: boolean, rowKey: string, keys: RowSelectionKeys): RowSelection;
1197
+
1186
1198
  declare enum ChipOverflow {
1187
1199
  Wrap = "wrap",
1188
1200
  Scroll = "scroll"
@@ -1357,10 +1369,11 @@ interface UnderlineTabsProps {
1357
1369
  accessibilityLabel: string;
1358
1370
  accessibilityHint?: string;
1359
1371
  underlineColor?: string;
1372
+ fadeColor?: string;
1360
1373
  testID?: string;
1361
1374
  }
1362
1375
  /** A full-width tab strip with an underline on the selected tab and an optional count per tab. */
1363
- declare const UnderlineTabs: ({ tabs, activeKey, onChange, accessibilityLabel, accessibilityHint, underlineColor, testID }: UnderlineTabsProps) => React.ReactElement;
1376
+ declare const UnderlineTabs: ({ tabs, activeKey, onChange, accessibilityLabel, accessibilityHint, underlineColor, fadeColor, testID }: UnderlineTabsProps) => React.ReactElement;
1364
1377
 
1365
1378
  interface WidgetCardProps {
1366
1379
  title: string;
@@ -1373,4 +1386,4 @@ interface WidgetCardProps {
1373
1386
  /** A titled card for one record or summary block, with an optional header slot and a record action footer. */
1374
1387
  declare const WidgetCard: ({ title, children, icon, headerRight, footer, testID }: WidgetCardProps) => React.ReactElement;
1375
1388
 
1376
- 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, 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, IdChip, type IdChipProps, 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, RecordActionButton, type RecordActionButtonProps, RecordHeader, type RecordHeaderProps, 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, Timeline, type TimelineEntry, type TimelineProps, ToggleSection, type ToggleSectionProps, type ToneColors, TruncatedText, type TruncatedTextProps, type UnderlineTab, UnderlineTabs, type UnderlineTabsProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, WidgetCard, type WidgetCardProps, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isRecordHeaderCompact, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveRowLook, resolveToneColors, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
1389
+ 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, 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, IdChip, type IdChipProps, 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, RecordActionButton, type RecordActionButtonProps, RecordHeader, type RecordHeaderProps, type RowLook, type RowPalette, RowSelectedStyle, type RowSelection, type RowSelectionKeys, 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, Timeline, type TimelineEntry, type TimelineProps, ToggleSection, type ToggleSectionProps, type ToneColors, TruncatedText, type TruncatedTextProps, type UnderlineTab, UnderlineTabs, type UnderlineTabsProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, WidgetCard, type WidgetCardProps, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isRecordHeaderCompact, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveRowLook, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
package/dist/index.d.ts CHANGED
@@ -143,14 +143,15 @@ interface SplitPanesProps {
143
143
  layout?: SplitLayout;
144
144
  startWeight?: number;
145
145
  endWeight?: number;
146
+ startWidth?: number;
146
147
  endWidth?: number;
147
148
  gap?: number;
148
149
  breakpoint?: number;
149
150
  testID?: string;
150
151
  }
151
152
  /** 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;
153
+ * `startWidth` / `endWidth` fix that pane (a rail) at that width while side by side; stacked it stays full width. */
154
+ declare const SplitPanes: ({ start, end, layout, startWeight, endWeight, startWidth, endWidth, gap, breakpoint, testID, }: SplitPanesProps) => React.ReactElement;
154
155
 
155
156
  /** Whether the panes sit side by side: always for Side, never for Stack, from `breakpoint` up for Auto. */
156
157
  declare function isSplitSideBySide(layout: SplitLayout, width: number, breakpoint: number): boolean;
@@ -1183,6 +1184,17 @@ interface RowLook {
1183
1184
  /** Resolves a row's container style and text colours from its selected style and state. */
1184
1185
  declare function resolveRowLook(style: RowSelectedStyle, state: RowState, palette: RowPalette): RowLook;
1185
1186
 
1187
+ interface RowSelectionKeys {
1188
+ selectedKey: string | null;
1189
+ shownKey: string | null;
1190
+ }
1191
+ interface RowSelection {
1192
+ selected: boolean;
1193
+ style: RowSelectedStyle;
1194
+ }
1195
+ /** Desktop marks the row whose detail is shown with an accent bar; a phone outlines only the row the user tapped. */
1196
+ declare function rowSelection(isDesktop: boolean, rowKey: string, keys: RowSelectionKeys): RowSelection;
1197
+
1186
1198
  declare enum ChipOverflow {
1187
1199
  Wrap = "wrap",
1188
1200
  Scroll = "scroll"
@@ -1357,10 +1369,11 @@ interface UnderlineTabsProps {
1357
1369
  accessibilityLabel: string;
1358
1370
  accessibilityHint?: string;
1359
1371
  underlineColor?: string;
1372
+ fadeColor?: string;
1360
1373
  testID?: string;
1361
1374
  }
1362
1375
  /** A full-width tab strip with an underline on the selected tab and an optional count per tab. */
1363
- declare const UnderlineTabs: ({ tabs, activeKey, onChange, accessibilityLabel, accessibilityHint, underlineColor, testID }: UnderlineTabsProps) => React.ReactElement;
1376
+ declare const UnderlineTabs: ({ tabs, activeKey, onChange, accessibilityLabel, accessibilityHint, underlineColor, fadeColor, testID }: UnderlineTabsProps) => React.ReactElement;
1364
1377
 
1365
1378
  interface WidgetCardProps {
1366
1379
  title: string;
@@ -1373,4 +1386,4 @@ interface WidgetCardProps {
1373
1386
  /** A titled card for one record or summary block, with an optional header slot and a record action footer. */
1374
1387
  declare const WidgetCard: ({ title, children, icon, headerRight, footer, testID }: WidgetCardProps) => React.ReactElement;
1375
1388
 
1376
- 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, 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, IdChip, type IdChipProps, 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, RecordActionButton, type RecordActionButtonProps, RecordHeader, type RecordHeaderProps, 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, Timeline, type TimelineEntry, type TimelineProps, ToggleSection, type ToggleSectionProps, type ToneColors, TruncatedText, type TruncatedTextProps, type UnderlineTab, UnderlineTabs, type UnderlineTabsProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, WidgetCard, type WidgetCardProps, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isRecordHeaderCompact, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveRowLook, resolveToneColors, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
1389
+ 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, 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, IdChip, type IdChipProps, 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, RecordActionButton, type RecordActionButtonProps, RecordHeader, type RecordHeaderProps, type RowLook, type RowPalette, RowSelectedStyle, type RowSelection, type RowSelectionKeys, 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, Timeline, type TimelineEntry, type TimelineProps, ToggleSection, type ToggleSectionProps, type ToneColors, TruncatedText, type TruncatedTextProps, type UnderlineTab, UnderlineTabs, type UnderlineTabsProps, UpgradePrompt, type UpgradePromptProps, type VersionResponse, type VisibleViewport, WidgetCard, type WidgetCardProps, copyText, figureCell, formatBuildInfo, formatCount, formatUrlForDisplay, isKeyboardOpen, isModalFooterStacked, isRecordHeaderCompact, isSplitSideBySide, isWideWebViewport, pageScale, resolveActiveKey, resolveRowLook, resolveToneColors, rowSelection, scaledFrame, shortenCommit, trimTrailingSlash, truncateMiddle, useApiCommit, useCopyToClipboard, useFocusTrap, useIsWideViewport, useListRowTone, useVisibleViewport };
package/dist/index.js CHANGED
@@ -283,14 +283,14 @@ function compositeOver(background, surface) {
283
283
  if (top === null || base === null) return null;
284
284
  return mix(base.channels, top.channels, top.alpha);
285
285
  }
286
- function readableRawInk(theme, ink, background) {
287
- const ground = compositeOver(background, theme.colors.surface);
286
+ function readableRawInk(theme, ink, background, ground = theme.colors.surface) {
287
+ const visible = compositeOver(background, ground);
288
288
  const source = designTokens.isHexColor(ink) ? parseHex(ink) : null;
289
289
  const target = designTokens.isHexColor(theme.colors.text) ? parseHex(theme.colors.text) : null;
290
- if (ground === null || source === null || target === null) return ink;
290
+ if (visible === null || source === null || target === null) return ink;
291
291
  for (let step = 0; step <= MIX_STEPS; step += 1) {
292
292
  const candidate = step === 0 ? ink : mix(source.channels, target.channels, step / MIX_STEPS);
293
- if (designTokens.contrastRatio(candidate, ground) >= designTokens.AA_NORMAL_TEXT_RATIO) return candidate;
293
+ if (designTokens.contrastRatio(candidate, visible) >= designTokens.AA_NORMAL_TEXT_RATIO) return candidate;
294
294
  }
295
295
  return theme.colors.text;
296
296
  }
@@ -456,12 +456,17 @@ var styles6 = reactNative.StyleSheet.create({
456
456
  stackPane: { width: "100%", minWidth: 0 },
457
457
  fixedPane: { flexGrow: 0, flexShrink: 0, minWidth: 0 }
458
458
  });
459
+ function sidePaneStyle(weight, fixedWidth) {
460
+ if (fixedWidth === void 0) return [styles6.sidePane, { flexGrow: weight }];
461
+ return [styles6.fixedPane, { width: fixedWidth }];
462
+ }
459
463
  var SplitPanes = ({
460
464
  start,
461
465
  end,
462
466
  layout = "auto" /* Auto */,
463
467
  startWeight = DEFAULT_WEIGHT,
464
468
  endWeight = DEFAULT_WEIGHT,
469
+ startWidth,
465
470
  endWidth,
466
471
  gap = DEFAULT_GAP,
467
472
  breakpoint = LAYOUT_COLLAPSE_BREAKPOINT,
@@ -470,9 +475,8 @@ var SplitPanes = ({
470
475
  const { width } = reactNative.useWindowDimensions();
471
476
  const isSide = isSplitSideBySide(layout, width, breakpoint);
472
477
  const container = React16.useMemo(() => [isSide ? styles6.row : styles6.column, { gap }], [isSide, gap]);
473
- const startStyle = isSide ? [styles6.sidePane, { flexGrow: startWeight }] : styles6.stackPane;
474
- const sideEnd = endWidth === void 0 ? [styles6.sidePane, { flexGrow: endWeight }] : [styles6.fixedPane, { width: endWidth }];
475
- const endStyle = isSide ? sideEnd : styles6.stackPane;
478
+ const startStyle = isSide ? sidePaneStyle(startWeight, startWidth) : styles6.stackPane;
479
+ const endStyle = isSide ? sidePaneStyle(endWeight, endWidth) : styles6.stackPane;
476
480
  return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: container, testID, children: [
477
481
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: startStyle, testID: `${testID}-start`, children: start }),
478
482
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: endStyle, testID: `${testID}-end`, children: end })
@@ -2800,6 +2804,11 @@ var CopyStatus = /* @__PURE__ */ ((CopyStatus2) => {
2800
2804
  CopyStatus2["Failed"] = "failed";
2801
2805
  return CopyStatus2;
2802
2806
  })(CopyStatus || {});
2807
+ function readableTone(tone, backgrounds, fallback) {
2808
+ if (!designTokens.isHexColor(tone) || !backgrounds.every(designTokens.isHexColor)) return tone;
2809
+ const readable = backgrounds.every((background) => designTokens.contrastRatio(tone, background) >= designTokens.AA_NORMAL_TEXT_RATIO);
2810
+ return readable ? tone : fallback;
2811
+ }
2803
2812
 
2804
2813
  // src/CopyableId/copyText.ts
2805
2814
  var OFFSCREEN_POSITION = "-9999px";
@@ -2970,7 +2979,7 @@ var CopyableId = ({
2970
2979
  accessibilityLabel: t(action.key),
2971
2980
  accessibilityHint: t(LAYOUT_I18N.copyHint),
2972
2981
  testID: `${testID}-copy`,
2973
- style: [styles24.action, { color: action.color }],
2982
+ style: [styles24.action, { color: readableTone(action.color, [colors.background, colors.surfaceElevated], colors.text) }],
2974
2983
  children: t(action.key)
2975
2984
  }
2976
2985
  )
@@ -3298,6 +3307,12 @@ var ListRow = ({
3298
3307
  ] });
3299
3308
  };
3300
3309
 
3310
+ // src/ListRow/utils/rowSelection.ts
3311
+ function rowSelection(isDesktop, rowKey, keys) {
3312
+ if (isDesktop) return { selected: keys.shownKey === rowKey, style: "accent-bar" /* AccentBar */ };
3313
+ return { selected: keys.selectedKey === rowKey, style: "outline" /* Outline */ };
3314
+ }
3315
+
3301
3316
  // src/SectionIndexLayout/ChipOverflow.ts
3302
3317
  var ChipOverflow = /* @__PURE__ */ ((ChipOverflow2) => {
3303
3318
  ChipOverflow2["Wrap"] = "wrap";
@@ -3648,6 +3663,30 @@ var IdChip = ({ label, value, testID, accessibilityLabel, accessibilityHint, dis
3648
3663
  }
3649
3664
  );
3650
3665
  };
3666
+ var STEP_WIDTH = 8;
3667
+ var STEP_OPACITIES = [0.35, 0.65, 0.9];
3668
+ var styles39 = reactNative.StyleSheet.create({
3669
+ fade: { bottom: 0, flexDirection: "row", position: "absolute", right: 0, top: 0 },
3670
+ step: { width: STEP_WIDTH }
3671
+ });
3672
+ var EdgeFadeStrip = ({ color }) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { "aria-hidden": true, pointerEvents: "none", style: styles39.fade, children: STEP_OPACITIES.map((opacity) => /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles39.step, { backgroundColor: color, opacity }] }, opacity)) });
3673
+ var SLACK_PX = 1;
3674
+ function showsEdgeFade({ contentWidth, viewportWidth, offset }) {
3675
+ return contentWidth - viewportWidth - offset > SLACK_PX;
3676
+ }
3677
+ function useEdgeFade() {
3678
+ const [metrics, setMetrics] = React16.useState({ contentWidth: 0, viewportWidth: 0, offset: 0 });
3679
+ const onLayout = React16.useCallback((event) => {
3680
+ const viewportWidth = event.nativeEvent.layout.width;
3681
+ setMetrics((prev) => ({ ...prev, viewportWidth }));
3682
+ }, []);
3683
+ const onContentSizeChange = React16.useCallback((contentWidth) => setMetrics((prev) => ({ ...prev, contentWidth })), []);
3684
+ const onScroll = React16.useCallback((event) => {
3685
+ const offset = event.nativeEvent.contentOffset.x;
3686
+ setMetrics((prev) => ({ ...prev, offset }));
3687
+ }, []);
3688
+ return { visible: showsEdgeFade(metrics), onLayout, onContentSizeChange, onScroll };
3689
+ }
3651
3690
  var UNDERLINE = 3;
3652
3691
  var PAD_H4 = 12;
3653
3692
  var GAP6 = 6;
@@ -3657,57 +3696,62 @@ var COUNT_MIN = 22;
3657
3696
  var COUNT_PAD = 6;
3658
3697
  var PILL = 999;
3659
3698
  var DEFAULT_UNDERLINE_STEP = "700";
3660
- var styles39 = reactNative.StyleSheet.create({
3699
+ var SCROLL_THROTTLE_MS = 16;
3700
+ var styles40 = reactNative.StyleSheet.create({
3661
3701
  count: { borderRadius: PILL, fontSize: COUNT_FONT, fontWeight: "700", minWidth: COUNT_MIN, paddingHorizontal: COUNT_PAD, textAlign: "center" },
3662
3702
  label: { fontSize: FONT_SIZE4, fontWeight: "600" },
3663
- strip: { borderBottomWidth: 1, width: "100%" },
3703
+ strip: { borderBottomWidth: 1, position: "relative", width: "100%" },
3664
3704
  tab: { alignItems: "center", borderBottomWidth: UNDERLINE, flexDirection: "row", gap: GAP6, justifyContent: "center", minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, paddingHorizontal: PAD_H4 }
3665
3705
  });
3666
- var UnderlineTabs = ({ tabs, activeKey, onChange, accessibilityLabel, accessibilityHint, underlineColor, testID }) => {
3706
+ var UnderlineTabs = ({ tabs, activeKey, onChange, accessibilityLabel, accessibilityHint, underlineColor, fadeColor, testID }) => {
3667
3707
  const { theme } = uiFeedback.useUi();
3668
3708
  const underline = underlineColor ?? theme.palette.primary[DEFAULT_UNDERLINE_STEP];
3669
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles39.strip, { borderBottomColor: theme.colors.border }], testID, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { horizontal: true, accessibilityHint, accessibilityRole: "tablist", "aria-label": accessibilityLabel, showsHorizontalScrollIndicator: false, children: tabs.map((tab) => {
3670
- const selected = tab.key === activeKey;
3671
- return /* @__PURE__ */ jsxRuntime.jsxs(
3672
- reactNative.Pressable,
3673
- {
3674
- accessibilityHint: tab.accessibilityHint,
3675
- accessibilityLabel: tab.label,
3676
- accessibilityRole: "tab",
3677
- accessibilityState: { selected },
3678
- "aria-selected": selected,
3679
- style: [styles39.tab, { borderBottomColor: selected ? underline : "transparent" }],
3680
- testID: tab.testID,
3681
- onPress: () => onChange(tab.key),
3682
- children: [
3683
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles39.label, { color: selected ? theme.colors.text : theme.colors.textSecondary }], children: tab.label }),
3684
- tab.count === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles39.count, { backgroundColor: theme.colors.border, color: theme.colors.text }], children: String(tab.count) })
3685
- ]
3686
- },
3687
- tab.key
3688
- );
3689
- }) }) });
3709
+ const fade = useEdgeFade();
3710
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles40.strip, { borderBottomColor: theme.colors.border }], testID, children: [
3711
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { horizontal: true, accessibilityHint, accessibilityRole: "tablist", "aria-label": accessibilityLabel, scrollEventThrottle: SCROLL_THROTTLE_MS, showsHorizontalScrollIndicator: false, onContentSizeChange: fade.onContentSizeChange, onLayout: fade.onLayout, onScroll: fade.onScroll, children: tabs.map((tab) => {
3712
+ const selected = tab.key === activeKey;
3713
+ return /* @__PURE__ */ jsxRuntime.jsxs(
3714
+ reactNative.Pressable,
3715
+ {
3716
+ accessibilityHint: tab.accessibilityHint,
3717
+ accessibilityLabel: tab.label,
3718
+ accessibilityRole: "tab",
3719
+ accessibilityState: { selected },
3720
+ "aria-selected": selected,
3721
+ style: [styles40.tab, { borderBottomColor: selected ? underline : "transparent" }],
3722
+ testID: tab.testID,
3723
+ onPress: () => onChange(tab.key),
3724
+ children: [
3725
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles40.label, { color: selected ? theme.colors.text : theme.colors.textSecondary }], children: tab.label }),
3726
+ tab.count === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles40.count, { backgroundColor: theme.colors.border, color: theme.colors.text }], children: String(tab.count) })
3727
+ ]
3728
+ },
3729
+ tab.key
3730
+ );
3731
+ }) }),
3732
+ fade.visible ? /* @__PURE__ */ jsxRuntime.jsx(EdgeFadeStrip, { color: fadeColor ?? theme.colors.background }) : null
3733
+ ] });
3690
3734
  };
3691
3735
  var RADIUS3 = 12;
3692
3736
  var PAD = 16;
3693
3737
  var GAP7 = 8;
3694
3738
  var TITLE_FONT = 15;
3695
- var styles40 = reactNative.StyleSheet.create({
3739
+ var styles41 = reactNative.StyleSheet.create({
3696
3740
  card: { borderRadius: RADIUS3, borderWidth: 1, gap: GAP7, minWidth: 0, padding: PAD },
3697
- footer: { borderRadius: GAP7, borderWidth: 1, gap: GAP7, padding: PAD / 2 + GAP7 / 2 },
3741
+ footer: { alignItems: "flex-start", flexDirection: "row", flexWrap: "wrap", gap: GAP7 },
3698
3742
  head: { alignItems: "center", flexDirection: "row", gap: GAP7 },
3699
3743
  title: { flex: 1, fontSize: TITLE_FONT, fontWeight: "700" }
3700
3744
  });
3701
3745
  var WidgetCard = ({ title, children, icon, headerRight, footer, testID }) => {
3702
3746
  const { theme } = uiFeedback.useUi();
3703
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles40.card, { backgroundColor: theme.colors.surfaceElevated, borderColor: theme.colors.border }], testID, children: [
3704
- /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles40.head, children: [
3747
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles41.card, { backgroundColor: theme.colors.surfaceElevated, borderColor: theme.colors.border }], testID, children: [
3748
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles41.head, children: [
3705
3749
  icon === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { "aria-hidden": true, children: icon }),
3706
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [styles40.title, { color: theme.colors.text }], children: title }),
3750
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { accessibilityRole: "header", style: [styles41.title, { color: theme.colors.text }], children: title }),
3707
3751
  headerRight
3708
3752
  ] }),
3709
3753
  children,
3710
- footer === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles40.footer, { backgroundColor: theme.colors.background, borderColor: theme.colors.border }], children: footer })
3754
+ footer === void 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles41.footer, children: footer })
3711
3755
  ] });
3712
3756
  };
3713
3757
 
@@ -3789,6 +3833,7 @@ exports.pageScale = pageScale;
3789
3833
  exports.resolveActiveKey = resolveActiveKey;
3790
3834
  exports.resolveRowLook = resolveRowLook;
3791
3835
  exports.resolveToneColors = resolveToneColors;
3836
+ exports.rowSelection = rowSelection;
3792
3837
  exports.scaledFrame = scaledFrame;
3793
3838
  exports.shortenCommit = shortenCommit;
3794
3839
  exports.trimTrailingSlash = trimTrailingSlash;