@dloizides/ui-layout 1.49.3 → 1.50.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 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"
@@ -1373,4 +1385,4 @@ interface WidgetCardProps {
1373
1385
  /** A titled card for one record or summary block, with an optional header slot and a record action footer. */
1374
1386
  declare const WidgetCard: ({ title, children, icon, headerRight, footer, testID }: WidgetCardProps) => React.ReactElement;
1375
1387
 
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 };
1388
+ 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"
@@ -1373,4 +1385,4 @@ interface WidgetCardProps {
1373
1385
  /** A titled card for one record or summary block, with an optional header slot and a record action footer. */
1374
1386
  declare const WidgetCard: ({ title, children, icon, headerRight, footer, testID }: WidgetCardProps) => React.ReactElement;
1375
1387
 
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 };
1388
+ 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
@@ -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 })
@@ -3298,6 +3302,12 @@ var ListRow = ({
3298
3302
  ] });
3299
3303
  };
3300
3304
 
3305
+ // src/ListRow/utils/rowSelection.ts
3306
+ function rowSelection(isDesktop, rowKey, keys) {
3307
+ if (isDesktop) return { selected: keys.shownKey === rowKey, style: "accent-bar" /* AccentBar */ };
3308
+ return { selected: keys.selectedKey === rowKey, style: "outline" /* Outline */ };
3309
+ }
3310
+
3301
3311
  // src/SectionIndexLayout/ChipOverflow.ts
3302
3312
  var ChipOverflow = /* @__PURE__ */ ((ChipOverflow2) => {
3303
3313
  ChipOverflow2["Wrap"] = "wrap";
@@ -3789,6 +3799,7 @@ exports.pageScale = pageScale;
3789
3799
  exports.resolveActiveKey = resolveActiveKey;
3790
3800
  exports.resolveRowLook = resolveRowLook;
3791
3801
  exports.resolveToneColors = resolveToneColors;
3802
+ exports.rowSelection = rowSelection;
3792
3803
  exports.scaledFrame = scaledFrame;
3793
3804
  exports.shortenCommit = shortenCommit;
3794
3805
  exports.trimTrailingSlash = trimTrailingSlash;