@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/dist/index.mjs
CHANGED
|
@@ -3580,7 +3580,8 @@ var styles38 = StyleSheet.create({
|
|
|
3580
3580
|
});
|
|
3581
3581
|
var IdChip = ({ label, value, testID, accessibilityLabel, accessibilityHint, display, valueTestID, writer }) => {
|
|
3582
3582
|
const { theme } = useUi();
|
|
3583
|
-
const
|
|
3583
|
+
const copyable = value !== null && value !== "";
|
|
3584
|
+
const { status, copy } = useCopyToClipboard(value ?? "", writer);
|
|
3584
3585
|
const ink = { color: theme.colors.text };
|
|
3585
3586
|
return /* @__PURE__ */ jsxs(
|
|
3586
3587
|
Pressable,
|
|
@@ -3588,13 +3589,15 @@ var IdChip = ({ label, value, testID, accessibilityLabel, accessibilityHint, dis
|
|
|
3588
3589
|
accessibilityHint,
|
|
3589
3590
|
accessibilityLabel,
|
|
3590
3591
|
accessibilityRole: "button",
|
|
3592
|
+
accessibilityState: { disabled: !copyable },
|
|
3593
|
+
disabled: !copyable,
|
|
3591
3594
|
style: [styles38.chip, { backgroundColor: theme.colors.surfaceElevated, borderColor: theme.colors.border }],
|
|
3592
3595
|
testID,
|
|
3593
|
-
onPress: copy,
|
|
3596
|
+
onPress: copyable ? copy : void 0,
|
|
3594
3597
|
children: [
|
|
3595
3598
|
/* @__PURE__ */ jsx(Text, { style: [styles38.text, { color: theme.colors.textSecondary }], children: label }),
|
|
3596
3599
|
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles38.text, ink], testID: valueTestID, children: display ?? value }),
|
|
3597
|
-
/* @__PURE__ */ jsx(Text, { "aria-hidden": true, style: [styles38.text, ink], testID: `${testID}-glyph`, children: status === "copied" /* Copied */ ? COPIED_GLYPH : COPY_GLYPH })
|
|
3600
|
+
copyable ? /* @__PURE__ */ jsx(Text, { "aria-hidden": true, style: [styles38.text, ink], testID: `${testID}-glyph`, children: status === "copied" /* Copied */ ? COPIED_GLYPH : COPY_GLYPH }) : null
|
|
3598
3601
|
]
|
|
3599
3602
|
}
|
|
3600
3603
|
);
|