@dloizides/ui-layout 1.59.0 → 1.60.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.60.1
4
+
5
+ - Ships the 1.60.0 `SectionIndexLayout` `collapsedKey` change; 1.60.0 never reached npm (its test used a wrong index testID).
6
+
7
+ ## 1.60.0
8
+
9
+ - MODC-1 D-MC-743 "S-7 owner sighting findings" F1. `SectionIndexLayout` takes `collapsedKey`: the section the collapsed (chips) layout opens on, so a screen whose primary section differs from its first index entry keeps it on screen below the index breakpoint. `initialKey` still marks the wide index. The picked key stays unset until the user picks, so resizing across the breakpoint follows the layout. Optional, default unchanged.
10
+
3
11
  ## 1.58.0
4
12
 
5
13
  - MODC-1 D-MC-728 "Layout gaps in the package". All new props optional, defaults unchanged.
package/dist/index.d.mts CHANGED
@@ -1240,6 +1240,7 @@ interface SectionIndexLayoutProps {
1240
1240
  indexHeading: string;
1241
1241
  itemHint: string;
1242
1242
  initialKey?: string;
1243
+ collapsedKey?: string;
1243
1244
  breakpoint?: number;
1244
1245
  density?: SectionDensity;
1245
1246
  stickyIndex?: boolean;
@@ -1248,7 +1249,7 @@ interface SectionIndexLayoutProps {
1248
1249
  activeColor?: string;
1249
1250
  testID?: string;
1250
1251
  }
1251
- declare const SectionIndexLayout: ({ sections, indexHeading, itemHint, initialKey, breakpoint, density, stickyIndex, chipOverflow, indexWidth, activeColor, testID, }: SectionIndexLayoutProps) => React.ReactElement;
1252
+ declare const SectionIndexLayout: ({ sections, indexHeading, itemHint, initialKey, collapsedKey, breakpoint, density, stickyIndex, chipOverflow, indexWidth, activeColor, testID, }: SectionIndexLayoutProps) => React.ReactElement;
1252
1253
 
1253
1254
  declare const SECTION_INDEX_WIDTH = 200;
1254
1255
  interface SectionIndexProps {
package/dist/index.d.ts CHANGED
@@ -1240,6 +1240,7 @@ interface SectionIndexLayoutProps {
1240
1240
  indexHeading: string;
1241
1241
  itemHint: string;
1242
1242
  initialKey?: string;
1243
+ collapsedKey?: string;
1243
1244
  breakpoint?: number;
1244
1245
  density?: SectionDensity;
1245
1246
  stickyIndex?: boolean;
@@ -1248,7 +1249,7 @@ interface SectionIndexLayoutProps {
1248
1249
  activeColor?: string;
1249
1250
  testID?: string;
1250
1251
  }
1251
- declare const SectionIndexLayout: ({ sections, indexHeading, itemHint, initialKey, breakpoint, density, stickyIndex, chipOverflow, indexWidth, activeColor, testID, }: SectionIndexLayoutProps) => React.ReactElement;
1252
+ declare const SectionIndexLayout: ({ sections, indexHeading, itemHint, initialKey, collapsedKey, breakpoint, density, stickyIndex, chipOverflow, indexWidth, activeColor, testID, }: SectionIndexLayoutProps) => React.ReactElement;
1252
1253
 
1253
1254
  declare const SECTION_INDEX_WIDTH = 200;
1254
1255
  interface SectionIndexProps {
package/dist/index.js CHANGED
@@ -3488,6 +3488,7 @@ var SectionIndexLayout = ({
3488
3488
  indexHeading,
3489
3489
  itemHint,
3490
3490
  initialKey,
3491
+ collapsedKey,
3491
3492
  breakpoint = SECTION_INDEX_BREAKPOINT,
3492
3493
  density = "comfortable" /* Comfortable */,
3493
3494
  stickyIndex = false,
@@ -3497,8 +3498,8 @@ var SectionIndexLayout = ({
3497
3498
  testID = "section-index"
3498
3499
  }) => {
3499
3500
  const wide = useIsWideViewport(breakpoint);
3500
- const [picked, setPicked] = React16.useState(initialKey);
3501
- const activeKey = resolveActiveKey(sections, picked);
3501
+ const [picked, setPicked] = React16.useState(void 0);
3502
+ const activeKey = resolveActiveKey(sections, picked ?? (wide ? initialKey : collapsedKey ?? initialKey));
3502
3503
  const gap = { gap: density === "dense" /* Dense */ ? DENSE_GAP : COMFORTABLE_GAP };
3503
3504
  if (sections.length < 2) return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { testID, children: sections[0]?.content });
3504
3505
  if (!wide) {