@dloizides/ui-layout 1.49.0 → 1.49.2

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
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.49.2
6
+ - Breadcrumb and UnderlineTabs take an optional `accessibilityHint`, passed to the strip element.
7
+
8
+ ## 1.49.1
9
+ - IdChip: `value` may be null or empty; the chip then copies nothing, is disabled and hides the copy glyph (was: copied the placeholder).
10
+
5
11
  MODC-1 D-MC-641 "One page layout for all pages", UI-ATOMIC-1.
6
12
 
7
13
  - New organism `SectionIndexLayout`: from `SECTION_INDEX_BREAKPOINT` (1024) an "On this page" index (molecule `SectionIndex`) beside every section stacked, a press scrolls to its section; below it a wrapping row of chips (molecule `SectionChips`) shows one section at a time, the first by default, so nothing is removed. Hit boxes >= 44 px; labels are pre-localized props. Options, defaults keep the plain behaviour: `density` (`SectionDensity` comfortable or dense gaps), `stickyIndex` (web, default false), `chipOverflow` (`ChipOverflow` wrap or scroll).
package/dist/index.d.mts CHANGED
@@ -1309,10 +1309,11 @@ interface BreadcrumbItem {
1309
1309
  interface BreadcrumbProps {
1310
1310
  items: ReadonlyArray<BreadcrumbItem>;
1311
1311
  accessibilityLabel: string;
1312
+ accessibilityHint?: string;
1312
1313
  testID?: string;
1313
1314
  }
1314
1315
  /** A compact text trail back to the parent list; a step without onPress is the current place. */
1315
- declare const Breadcrumb: ({ items, accessibilityLabel, testID }: BreadcrumbProps) => React.ReactElement;
1316
+ declare const Breadcrumb: ({ items, accessibilityLabel, accessibilityHint, testID }: BreadcrumbProps) => React.ReactElement;
1316
1317
 
1317
1318
  interface RecordActionButtonProps {
1318
1319
  label: string;
@@ -1331,7 +1332,7 @@ declare function isRecordHeaderCompact(width: number, breakpoint?: number): bool
1331
1332
 
1332
1333
  interface IdChipProps {
1333
1334
  label: string;
1334
- value: string;
1335
+ value: string | null;
1335
1336
  testID: string;
1336
1337
  accessibilityLabel: string;
1337
1338
  accessibilityHint: string;
@@ -1339,7 +1340,7 @@ interface IdChipProps {
1339
1340
  valueTestID?: string;
1340
1341
  writer?: (text: string) => void | Promise<void>;
1341
1342
  }
1342
- /** An id chip: label and monospace value inside one box with a copy glyph; pressing it copies the full value. */
1343
+ /** An id chip: label and monospace value inside one box with a copy glyph; pressing it copies the full value */
1343
1344
  declare const IdChip: ({ label, value, testID, accessibilityLabel, accessibilityHint, display, valueTestID, writer }: IdChipProps) => React.ReactElement;
1344
1345
 
1345
1346
  interface UnderlineTab {
@@ -1354,11 +1355,12 @@ interface UnderlineTabsProps {
1354
1355
  activeKey: string;
1355
1356
  onChange: (key: string) => void;
1356
1357
  accessibilityLabel: string;
1358
+ accessibilityHint?: string;
1357
1359
  underlineColor?: string;
1358
1360
  testID?: string;
1359
1361
  }
1360
1362
  /** A full-width tab strip with an underline on the selected tab and an optional count per tab. */
1361
- declare const UnderlineTabs: ({ tabs, activeKey, onChange, accessibilityLabel, underlineColor, testID }: UnderlineTabsProps) => React.ReactElement;
1363
+ declare const UnderlineTabs: ({ tabs, activeKey, onChange, accessibilityLabel, accessibilityHint, underlineColor, testID }: UnderlineTabsProps) => React.ReactElement;
1362
1364
 
1363
1365
  interface WidgetCardProps {
1364
1366
  title: string;
package/dist/index.d.ts CHANGED
@@ -1309,10 +1309,11 @@ interface BreadcrumbItem {
1309
1309
  interface BreadcrumbProps {
1310
1310
  items: ReadonlyArray<BreadcrumbItem>;
1311
1311
  accessibilityLabel: string;
1312
+ accessibilityHint?: string;
1312
1313
  testID?: string;
1313
1314
  }
1314
1315
  /** A compact text trail back to the parent list; a step without onPress is the current place. */
1315
- declare const Breadcrumb: ({ items, accessibilityLabel, testID }: BreadcrumbProps) => React.ReactElement;
1316
+ declare const Breadcrumb: ({ items, accessibilityLabel, accessibilityHint, testID }: BreadcrumbProps) => React.ReactElement;
1316
1317
 
1317
1318
  interface RecordActionButtonProps {
1318
1319
  label: string;
@@ -1331,7 +1332,7 @@ declare function isRecordHeaderCompact(width: number, breakpoint?: number): bool
1331
1332
 
1332
1333
  interface IdChipProps {
1333
1334
  label: string;
1334
- value: string;
1335
+ value: string | null;
1335
1336
  testID: string;
1336
1337
  accessibilityLabel: string;
1337
1338
  accessibilityHint: string;
@@ -1339,7 +1340,7 @@ interface IdChipProps {
1339
1340
  valueTestID?: string;
1340
1341
  writer?: (text: string) => void | Promise<void>;
1341
1342
  }
1342
- /** An id chip: label and monospace value inside one box with a copy glyph; pressing it copies the full value. */
1343
+ /** An id chip: label and monospace value inside one box with a copy glyph; pressing it copies the full value */
1343
1344
  declare const IdChip: ({ label, value, testID, accessibilityLabel, accessibilityHint, display, valueTestID, writer }: IdChipProps) => React.ReactElement;
1344
1345
 
1345
1346
  interface UnderlineTab {
@@ -1354,11 +1355,12 @@ interface UnderlineTabsProps {
1354
1355
  activeKey: string;
1355
1356
  onChange: (key: string) => void;
1356
1357
  accessibilityLabel: string;
1358
+ accessibilityHint?: string;
1357
1359
  underlineColor?: string;
1358
1360
  testID?: string;
1359
1361
  }
1360
1362
  /** A full-width tab strip with an underline on the selected tab and an optional count per tab. */
1361
- declare const UnderlineTabs: ({ tabs, activeKey, onChange, accessibilityLabel, underlineColor, testID }: UnderlineTabsProps) => React.ReactElement;
1363
+ declare const UnderlineTabs: ({ tabs, activeKey, onChange, accessibilityLabel, accessibilityHint, underlineColor, testID }: UnderlineTabsProps) => React.ReactElement;
1362
1364
 
1363
1365
  interface WidgetCardProps {
1364
1366
  title: string;
package/dist/index.js CHANGED
@@ -3520,10 +3520,10 @@ var styles36 = reactNative.StyleSheet.create({
3520
3520
  row: { alignItems: "center", flexDirection: "row", flexWrap: "wrap", gap: GAP3 },
3521
3521
  text: { fontSize: FONT_SIZE, fontWeight: "500" }
3522
3522
  });
3523
- var Breadcrumb = ({ items, accessibilityLabel, testID }) => {
3523
+ var Breadcrumb = ({ items, accessibilityLabel, accessibilityHint, testID }) => {
3524
3524
  const { theme } = uiFeedback.useUi();
3525
3525
  const muted = { color: theme.colors.textSecondary };
3526
- return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { "aria-label": accessibilityLabel, style: styles36.row, testID, children: [
3526
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { accessibilityHint, "aria-label": accessibilityLabel, style: styles36.row, testID, children: [
3527
3527
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { "aria-hidden": true, style: [styles36.text, muted], children: BACK }),
3528
3528
  items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs(React16__default.default.Fragment, { children: [
3529
3529
  index > 0 ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { "aria-hidden": true, style: [styles36.text, muted], children: SEPARATOR }) : null,
@@ -3586,7 +3586,8 @@ var styles38 = reactNative.StyleSheet.create({
3586
3586
  });
3587
3587
  var IdChip = ({ label, value, testID, accessibilityLabel, accessibilityHint, display, valueTestID, writer }) => {
3588
3588
  const { theme } = uiFeedback.useUi();
3589
- const { status, copy } = useCopyToClipboard(value, writer);
3589
+ const copyable = value !== null && value !== "";
3590
+ const { status, copy } = useCopyToClipboard(value ?? "", writer);
3590
3591
  const ink = { color: theme.colors.text };
3591
3592
  return /* @__PURE__ */ jsxRuntime.jsxs(
3592
3593
  reactNative.Pressable,
@@ -3594,13 +3595,15 @@ var IdChip = ({ label, value, testID, accessibilityLabel, accessibilityHint, dis
3594
3595
  accessibilityHint,
3595
3596
  accessibilityLabel,
3596
3597
  accessibilityRole: "button",
3598
+ accessibilityState: { disabled: !copyable },
3599
+ disabled: !copyable,
3597
3600
  style: [styles38.chip, { backgroundColor: theme.colors.surfaceElevated, borderColor: theme.colors.border }],
3598
3601
  testID,
3599
- onPress: copy,
3602
+ onPress: copyable ? copy : void 0,
3600
3603
  children: [
3601
3604
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles38.text, { color: theme.colors.textSecondary }], children: label }),
3602
3605
  /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [styles38.text, ink], testID: valueTestID, children: display ?? value }),
3603
- /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { "aria-hidden": true, style: [styles38.text, ink], testID: `${testID}-glyph`, children: status === "copied" /* Copied */ ? COPIED_GLYPH : COPY_GLYPH })
3606
+ copyable ? /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { "aria-hidden": true, style: [styles38.text, ink], testID: `${testID}-glyph`, children: status === "copied" /* Copied */ ? COPIED_GLYPH : COPY_GLYPH }) : null
3604
3607
  ]
3605
3608
  }
3606
3609
  );
@@ -3620,10 +3623,10 @@ var styles39 = reactNative.StyleSheet.create({
3620
3623
  strip: { borderBottomWidth: 1, width: "100%" },
3621
3624
  tab: { alignItems: "center", borderBottomWidth: UNDERLINE, flexDirection: "row", gap: GAP6, justifyContent: "center", minHeight: MIN_TARGET_PX, minWidth: MIN_TARGET_PX, paddingHorizontal: PAD_H4 }
3622
3625
  });
3623
- var UnderlineTabs = ({ tabs, activeKey, onChange, accessibilityLabel, underlineColor, testID }) => {
3626
+ var UnderlineTabs = ({ tabs, activeKey, onChange, accessibilityLabel, accessibilityHint, underlineColor, testID }) => {
3624
3627
  const { theme } = uiFeedback.useUi();
3625
3628
  const underline = underlineColor ?? theme.palette.primary[DEFAULT_UNDERLINE_STEP];
3626
- return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles39.strip, { borderBottomColor: theme.colors.border }], testID, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.ScrollView, { horizontal: true, accessibilityRole: "tablist", "aria-label": accessibilityLabel, showsHorizontalScrollIndicator: false, children: tabs.map((tab) => {
3629
+ 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) => {
3627
3630
  const selected = tab.key === activeKey;
3628
3631
  return /* @__PURE__ */ jsxRuntime.jsxs(
3629
3632
  reactNative.Pressable,