@dloizides/ui-layout 1.15.0 → 1.15.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 +23 -0
- package/dist/index.d.mts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1380,11 +1380,19 @@ var styles13 = StyleSheet.create({
|
|
|
1380
1380
|
row: { flexDirection: "row", alignItems: "center", gap: ROW_GAP },
|
|
1381
1381
|
/**
|
|
1382
1382
|
* The truncation width comes from this wrapper, not from the row: `TruncatedText` measures its
|
|
1383
|
-
* PARENT (see `useAvailableWidth`), and the row also holds the button.
|
|
1384
|
-
*
|
|
1385
|
-
*
|
|
1383
|
+
* PARENT (see `useAvailableWidth`), and the row also holds the copy button.
|
|
1384
|
+
*
|
|
1385
|
+
* `flex: 1` IS LOAD-BEARING — do not weaken it to `flexShrink: 1`. A shrink-only wrapper
|
|
1386
|
+
* SHRINK-WRAPS its content, which makes the measured parent width depend on the very string we
|
|
1387
|
+
* are computing: truncate -> wrapper narrows -> re-measure smaller -> truncate harder. Verified
|
|
1388
|
+
* in Chrome: with `flexShrink: 1` a 506px-wide container and a 306px one both rendered the SAME
|
|
1389
|
+
* 196px string, i.e. the id was cut short with 300px of room going spare. `flex: 1` makes the
|
|
1390
|
+
* wrapper fill the row's leftover width instead, so its size is independent of what we put in
|
|
1391
|
+
* it — the same reason `useAvailableWidth` measures the parent and not the element.
|
|
1392
|
+
*
|
|
1393
|
+
* `minWidth: 0` is what actually permits a flex child to go below its content width.
|
|
1386
1394
|
*/
|
|
1387
|
-
valueWrap: {
|
|
1395
|
+
valueWrap: { flex: 1, minWidth: 0 },
|
|
1388
1396
|
value: { fontSize: VALUE_FONT_SIZE, fontWeight: "600" },
|
|
1389
1397
|
action: {
|
|
1390
1398
|
fontSize: ACTION_FONT_SIZE,
|
|
@@ -1411,6 +1419,7 @@ function useActionState(status) {
|
|
|
1411
1419
|
var CopyableId = ({
|
|
1412
1420
|
value,
|
|
1413
1421
|
label,
|
|
1422
|
+
style,
|
|
1414
1423
|
testID,
|
|
1415
1424
|
accessibilityLabel,
|
|
1416
1425
|
writer
|
|
@@ -1419,7 +1428,7 @@ var CopyableId = ({
|
|
|
1419
1428
|
const { colors } = theme;
|
|
1420
1429
|
const { status, copy } = useCopyToClipboard(value, writer);
|
|
1421
1430
|
const action = useActionState(status);
|
|
1422
|
-
return /* @__PURE__ */ jsxs(View, { style: styles13.cell, testID, children: [
|
|
1431
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles13.cell, style], testID, children: [
|
|
1423
1432
|
label !== void 0 && /* @__PURE__ */ jsx(Text, { style: [styles13.label, { color: colors.textSecondary }], children: label }),
|
|
1424
1433
|
/* @__PURE__ */ jsxs(View, { style: styles13.row, children: [
|
|
1425
1434
|
/* @__PURE__ */ jsx(View, { style: styles13.valueWrap, children: /* @__PURE__ */ jsx(
|