@dloizides/ui-layout 1.49.0 → 1.49.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 +3 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 1.49.1
|
|
6
|
+
- IdChip: `value` may be null or empty; the chip then copies nothing, is disabled and hides the copy glyph (was: copied the placeholder).
|
|
7
|
+
|
|
5
8
|
MODC-1 D-MC-641 "One page layout for all pages", UI-ATOMIC-1.
|
|
6
9
|
|
|
7
10
|
- 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
|
@@ -1331,7 +1331,7 @@ declare function isRecordHeaderCompact(width: number, breakpoint?: number): bool
|
|
|
1331
1331
|
|
|
1332
1332
|
interface IdChipProps {
|
|
1333
1333
|
label: string;
|
|
1334
|
-
value: string;
|
|
1334
|
+
value: string | null;
|
|
1335
1335
|
testID: string;
|
|
1336
1336
|
accessibilityLabel: string;
|
|
1337
1337
|
accessibilityHint: string;
|
|
@@ -1339,7 +1339,7 @@ interface IdChipProps {
|
|
|
1339
1339
|
valueTestID?: string;
|
|
1340
1340
|
writer?: (text: string) => void | Promise<void>;
|
|
1341
1341
|
}
|
|
1342
|
-
/** An id chip: label and monospace value inside one box with a copy glyph; pressing it copies the full value
|
|
1342
|
+
/** An id chip: label and monospace value inside one box with a copy glyph; pressing it copies the full value */
|
|
1343
1343
|
declare const IdChip: ({ label, value, testID, accessibilityLabel, accessibilityHint, display, valueTestID, writer }: IdChipProps) => React.ReactElement;
|
|
1344
1344
|
|
|
1345
1345
|
interface UnderlineTab {
|
package/dist/index.d.ts
CHANGED
|
@@ -1331,7 +1331,7 @@ declare function isRecordHeaderCompact(width: number, breakpoint?: number): bool
|
|
|
1331
1331
|
|
|
1332
1332
|
interface IdChipProps {
|
|
1333
1333
|
label: string;
|
|
1334
|
-
value: string;
|
|
1334
|
+
value: string | null;
|
|
1335
1335
|
testID: string;
|
|
1336
1336
|
accessibilityLabel: string;
|
|
1337
1337
|
accessibilityHint: string;
|
|
@@ -1339,7 +1339,7 @@ interface IdChipProps {
|
|
|
1339
1339
|
valueTestID?: string;
|
|
1340
1340
|
writer?: (text: string) => void | Promise<void>;
|
|
1341
1341
|
}
|
|
1342
|
-
/** An id chip: label and monospace value inside one box with a copy glyph; pressing it copies the full value
|
|
1342
|
+
/** An id chip: label and monospace value inside one box with a copy glyph; pressing it copies the full value */
|
|
1343
1343
|
declare const IdChip: ({ label, value, testID, accessibilityLabel, accessibilityHint, display, valueTestID, writer }: IdChipProps) => React.ReactElement;
|
|
1344
1344
|
|
|
1345
1345
|
interface UnderlineTab {
|
package/dist/index.js
CHANGED
|
@@ -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
|
|
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
|
);
|