@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
|
@@ -52,6 +52,7 @@ var tokens = {
|
|
|
52
52
|
transitionFast: "120ms ease-out",
|
|
53
53
|
fontSizeBody: "13px",
|
|
54
54
|
fontSizeSmall: "11px",
|
|
55
|
+
fontWeightRegular: 400,
|
|
55
56
|
fontWeightMedium: 500,
|
|
56
57
|
fontWeightBold: 600
|
|
57
58
|
};
|
|
@@ -70,6 +71,8 @@ css`
|
|
|
70
71
|
white-space: nowrap;
|
|
71
72
|
`;
|
|
72
73
|
var Root = styled.div`
|
|
74
|
+
width: 100%;
|
|
75
|
+
min-width: 0;
|
|
73
76
|
color: ${tokens.fg};
|
|
74
77
|
font-size: ${tokens.fontSizeBody};
|
|
75
78
|
|
|
@@ -192,6 +195,11 @@ var PrimaryText = styled.span`
|
|
|
192
195
|
line-height: 1.3;
|
|
193
196
|
transition: color ${tokens.transitionFast};
|
|
194
197
|
`;
|
|
198
|
+
var SelectedTitle = styled(PrimaryText)`
|
|
199
|
+
font-weight: ${tokens.fontWeightRegular};
|
|
200
|
+
white-space: normal;
|
|
201
|
+
overflow-wrap: anywhere;
|
|
202
|
+
`;
|
|
195
203
|
var Option = styled.li`
|
|
196
204
|
display: flex;
|
|
197
205
|
align-items: center;
|
|
@@ -301,6 +309,10 @@ var ActionColumn = styled.div`
|
|
|
301
309
|
gap: ${tokens.spaceXs};
|
|
302
310
|
margin-left: auto;
|
|
303
311
|
`;
|
|
312
|
+
var ReorderStack = styled.span`
|
|
313
|
+
display: flex;
|
|
314
|
+
flex-direction: column;
|
|
315
|
+
`;
|
|
304
316
|
var SelectedListEl = styled.ul`
|
|
305
317
|
list-style: none;
|
|
306
318
|
margin: ${tokens.spaceSm} 0 0;
|
|
@@ -312,8 +324,8 @@ var SelectedListEl = styled.ul`
|
|
|
312
324
|
var SelectedRow = styled.li`
|
|
313
325
|
display: flex;
|
|
314
326
|
align-items: center;
|
|
315
|
-
gap: ${tokens.
|
|
316
|
-
padding:
|
|
327
|
+
gap: ${tokens.spaceXs};
|
|
328
|
+
padding: 6px ${tokens.spaceXs};
|
|
317
329
|
background: ${({ missing }) => missing ? tokens.dangerSoft : tokens.bg};
|
|
318
330
|
border: 1px solid ${({ missing }) => missing ? tokens.dangerLine : tokens.gray300};
|
|
319
331
|
border-radius: ${tokens.radiusMd};
|
|
@@ -1671,11 +1683,11 @@ var SelectedItem = ({
|
|
|
1671
1683
|
children: isMissing || isTrash ? /* @__PURE__ */ jsx(Icon, { icon: caution, size: 22 }) : hasThumbImage ? /* @__PURE__ */ jsx("img", { src: item.thumbnailUrl, alt: "", loading: "lazy" }) : resolvedIcon ? /* @__PURE__ */ jsx(Icon, { icon: resolvedIcon, size: 22 }) : null
|
|
1672
1684
|
}
|
|
1673
1685
|
) : null,
|
|
1674
|
-
render ? render(item) : /* @__PURE__ */ jsx(ItemBody, { children: /* @__PURE__ */ jsx(
|
|
1686
|
+
render ? render(item) : /* @__PURE__ */ jsx(ItemBody, { children: /* @__PURE__ */ jsx(SelectedTitle, { muted: isMissing || isTrash, title: item.title, children: isMissing ? missingLabel : isTrash ? trashLabel : item.title }) }),
|
|
1675
1687
|
!isMissing && showTypeBadge ? /* @__PURE__ */ jsx(TypeBadge, { type: item.type, kind: item.kind }) : null,
|
|
1676
1688
|
!isMissing && hasAbnormalStatus ? /* @__PURE__ */ jsx(StatusBadge, { status: item.status }) : null,
|
|
1677
1689
|
/* @__PURE__ */ jsxs(ActionColumn, { children: [
|
|
1678
|
-
orderable ? /* @__PURE__ */ jsxs(
|
|
1690
|
+
orderable ? /* @__PURE__ */ jsxs(ReorderStack, { children: [
|
|
1679
1691
|
/* @__PURE__ */ jsx(
|
|
1680
1692
|
Button,
|
|
1681
1693
|
{
|
|
@@ -1752,10 +1764,7 @@ var useResolvedItems = (value) => {
|
|
|
1752
1764
|
nameKey,
|
|
1753
1765
|
item.id
|
|
1754
1766
|
]);
|
|
1755
|
-
out[`${item.kind}:${item.type}:${item.id}`] =
|
|
1756
|
-
record: record ?? null,
|
|
1757
|
-
resolved
|
|
1758
|
-
};
|
|
1767
|
+
out[`${item.kind}:${item.type}:${item.id}`] = resolved ? record ?? null : void 0;
|
|
1759
1768
|
}
|
|
1760
1769
|
return out;
|
|
1761
1770
|
},
|
|
@@ -1763,10 +1772,8 @@ var useResolvedItems = (value) => {
|
|
|
1763
1772
|
);
|
|
1764
1773
|
return useMemo(
|
|
1765
1774
|
() => value.map((item) => {
|
|
1766
|
-
const
|
|
1767
|
-
if (
|
|
1768
|
-
const { record, resolved } = resolvedEntry;
|
|
1769
|
-
if (!resolved) {
|
|
1775
|
+
const record = records[`${item.kind}:${item.type}:${item.id}`];
|
|
1776
|
+
if (record === void 0) {
|
|
1770
1777
|
return item;
|
|
1771
1778
|
}
|
|
1772
1779
|
if (!record) {
|