@valu/block-components 0.4.0 → 0.5.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/README.md +17 -3
- package/dist/components/content-picker/index.cjs +19 -12
- package/dist/components/content-picker/index.cjs.map +1 -1
- package/dist/components/content-picker/index.js +19 -12
- package/dist/components/content-picker/index.js.map +1 -1
- package/dist/components/document-picker/index.cjs +22 -10
- package/dist/components/document-picker/index.cjs.map +1 -1
- package/dist/components/document-picker/index.js +22 -10
- package/dist/components/document-picker/index.js.map +1 -1
- package/dist/index.cjs +27 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -20
- package/dist/index.js.map +1 -1
- package/package.json +2 -14
|
@@ -51,6 +51,7 @@ var tokens = {
|
|
|
51
51
|
transitionFast: "120ms ease-out",
|
|
52
52
|
fontSizeBody: "13px",
|
|
53
53
|
fontSizeSmall: "11px",
|
|
54
|
+
fontWeightRegular: 400,
|
|
54
55
|
fontWeightMedium: 500,
|
|
55
56
|
fontWeightBold: 600
|
|
56
57
|
};
|
|
@@ -67,6 +68,8 @@ css`
|
|
|
67
68
|
white-space: nowrap;
|
|
68
69
|
`;
|
|
69
70
|
styled.div`
|
|
71
|
+
width: 100%;
|
|
72
|
+
min-width: 0;
|
|
70
73
|
color: ${tokens.fg};
|
|
71
74
|
font-size: ${tokens.fontSizeBody};
|
|
72
75
|
|
|
@@ -189,6 +192,11 @@ var PrimaryText = styled.span`
|
|
|
189
192
|
line-height: 1.3;
|
|
190
193
|
transition: color ${tokens.transitionFast};
|
|
191
194
|
`;
|
|
195
|
+
var SelectedTitle = styled(PrimaryText)`
|
|
196
|
+
font-weight: ${tokens.fontWeightRegular};
|
|
197
|
+
white-space: normal;
|
|
198
|
+
overflow-wrap: anywhere;
|
|
199
|
+
`;
|
|
192
200
|
styled.li`
|
|
193
201
|
display: flex;
|
|
194
202
|
align-items: center;
|
|
@@ -298,6 +306,10 @@ var ActionColumn = styled.div`
|
|
|
298
306
|
gap: ${tokens.spaceXs};
|
|
299
307
|
margin-left: auto;
|
|
300
308
|
`;
|
|
309
|
+
styled.span`
|
|
310
|
+
display: flex;
|
|
311
|
+
flex-direction: column;
|
|
312
|
+
`;
|
|
301
313
|
var SelectedListEl = styled.ul`
|
|
302
314
|
list-style: none;
|
|
303
315
|
margin: ${tokens.spaceSm} 0 0;
|
|
@@ -309,8 +321,8 @@ var SelectedListEl = styled.ul`
|
|
|
309
321
|
styled.li`
|
|
310
322
|
display: flex;
|
|
311
323
|
align-items: center;
|
|
312
|
-
gap: ${tokens.
|
|
313
|
-
padding:
|
|
324
|
+
gap: ${tokens.spaceXs};
|
|
325
|
+
padding: 6px ${tokens.spaceXs};
|
|
314
326
|
background: ${({ missing }) => missing ? tokens.dangerSoft : tokens.bg};
|
|
315
327
|
border: 1px solid ${({ missing }) => missing ? tokens.dangerLine : tokens.gray300};
|
|
316
328
|
border-radius: ${tokens.radiusMd};
|
|
@@ -458,8 +470,8 @@ var SelectedRow2 = styled.li`
|
|
|
458
470
|
container-name: valu-dp-row;
|
|
459
471
|
display: flex;
|
|
460
472
|
align-items: center;
|
|
461
|
-
gap: ${tokens.
|
|
462
|
-
padding:
|
|
473
|
+
gap: ${tokens.spaceXs};
|
|
474
|
+
padding: 6px ${tokens.spaceXs};
|
|
463
475
|
background: ${({ missing }) => missing ? tokens.dangerSoft : tokens.bg};
|
|
464
476
|
border: 1px solid ${({ missing }) => missing ? tokens.dangerLine : tokens.gray300};
|
|
465
477
|
border-radius: ${tokens.radiusMd};
|
|
@@ -599,6 +611,8 @@ var LabelEditBody = styled.div`
|
|
|
599
611
|
}
|
|
600
612
|
`;
|
|
601
613
|
var Root2 = styled.div`
|
|
614
|
+
width: 100%;
|
|
615
|
+
min-width: 0;
|
|
602
616
|
color: ${tokens.fg};
|
|
603
617
|
font-size: ${tokens.fontSizeBody};
|
|
604
618
|
|
|
@@ -1877,7 +1891,7 @@ var SelectedItem = ({
|
|
|
1877
1891
|
/* @__PURE__ */ jsx(FilenameText, { title: item.filename, children: metaParts.join(" \xB7 ") })
|
|
1878
1892
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1879
1893
|
/* @__PURE__ */ jsxs(DocRowBody, { children: [
|
|
1880
|
-
/* @__PURE__ */ jsx(
|
|
1894
|
+
/* @__PURE__ */ jsx(SelectedTitle, { muted: isMissing, title: displayName, children: isMissing ? missingLabel : displayName }),
|
|
1881
1895
|
!isMissing ? /* @__PURE__ */ jsx(FilenameText, { title: item.filename, children: item.filename }) : null
|
|
1882
1896
|
] }),
|
|
1883
1897
|
!isMissing && (showFileSize || modified) ? /* @__PURE__ */ jsxs(DocMetaInline, { children: [
|
|
@@ -1942,7 +1956,7 @@ var useResolvedDocuments = (value) => {
|
|
|
1942
1956
|
"attachment",
|
|
1943
1957
|
item.id
|
|
1944
1958
|
]);
|
|
1945
|
-
out[item.id] =
|
|
1959
|
+
out[item.id] = resolved ? record ?? null : void 0;
|
|
1946
1960
|
}
|
|
1947
1961
|
return out;
|
|
1948
1962
|
},
|
|
@@ -1950,10 +1964,8 @@ var useResolvedDocuments = (value) => {
|
|
|
1950
1964
|
);
|
|
1951
1965
|
return useMemo(
|
|
1952
1966
|
() => value.map((item) => {
|
|
1953
|
-
const
|
|
1954
|
-
if (
|
|
1955
|
-
const { record, resolved } = entry;
|
|
1956
|
-
if (!resolved) return item;
|
|
1967
|
+
const record = records[item.id];
|
|
1968
|
+
if (record === void 0) return item;
|
|
1957
1969
|
if (!record) return { ...item, missing: "deleted" };
|
|
1958
1970
|
const fresh = mapMediaToDocumentItem(
|
|
1959
1971
|
record
|