@sproutsocial/seeds-react-content-block 0.5.3 → 0.5.14
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/dist/content-block.css +48 -0
- package/dist/esm/index.js +221 -32
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +218 -32
- package/dist/index.js.map +1 -1
- package/package.json +21 -9
- package/.eslintignore +0 -6
- package/.eslintrc.js +0 -4
- package/.turbo/turbo-build.log +0 -21
- package/CHANGELOG.md +0 -324
- package/jest.config.js +0 -9
- package/src/ContentBlock.stories.tsx +0 -189
- package/src/ContentBlock.tsx +0 -198
- package/src/__tests__/content-block.test.tsx +0 -280
- package/src/index.ts +0 -6
- package/src/styled.d.ts +0 -7
- package/src/styles.ts +0 -19
- package/tsconfig.json +0 -9
- package/tsup.config.ts +0 -12
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Seeds ContentBlock component classes
|
|
3
|
+
* Use these instead of writing out individual Tailwind utility classes.
|
|
4
|
+
*
|
|
5
|
+
* Requires @sproutsocial/seeds-react-theme/dist/theme-all.css imported for
|
|
6
|
+
* CSS variable definitions and dark mode support.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* <div class="seeds-content-block-footer">...</div>
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
@layer components {
|
|
13
|
+
.seeds-content-block {
|
|
14
|
+
background: var(--color-container-bg-base);
|
|
15
|
+
border: 1px solid var(--color-container-border-base);
|
|
16
|
+
border-radius: var(--radius-outer);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.seeds-content-block-content {
|
|
20
|
+
padding: var(--space-400);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.seeds-content-block-content.flush {
|
|
24
|
+
padding: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* When there is no footer, the content node rounds the card's bottom corners. */
|
|
28
|
+
.seeds-content-block-content.no-footer {
|
|
29
|
+
border-bottom-left-radius: var(--radius-outer);
|
|
30
|
+
border-bottom-right-radius: var(--radius-outer);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.seeds-content-block-loader {
|
|
34
|
+
margin: var(--space-400) 0;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.seeds-content-block-footer {
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: space-between;
|
|
41
|
+
align-items: center;
|
|
42
|
+
width: 100%;
|
|
43
|
+
padding: var(--space-400);
|
|
44
|
+
border-top: 1px solid var(--color-container-border-base);
|
|
45
|
+
border-bottom-left-radius: var(--radius-outer);
|
|
46
|
+
border-bottom-right-radius: var(--radius-outer);
|
|
47
|
+
}
|
|
48
|
+
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,20 +1,192 @@
|
|
|
1
1
|
// src/ContentBlock.tsx
|
|
2
|
+
import "react";
|
|
3
|
+
import "@sproutsocial/seeds-react-box";
|
|
4
|
+
|
|
5
|
+
// src/ContentBlockHybrid.tsx
|
|
6
|
+
import "react";
|
|
7
|
+
import { hasStyledProps } from "@sproutsocial/seeds-react-system-props";
|
|
8
|
+
|
|
9
|
+
// src/ContentBlockTailwind.tsx
|
|
2
10
|
import { useState } from "react";
|
|
3
|
-
import { Box as Box2 } from "@sproutsocial/seeds-react-box";
|
|
4
11
|
import { Loader } from "@sproutsocial/seeds-react-loader";
|
|
5
12
|
import { Collapsible } from "@sproutsocial/seeds-react-collapsible";
|
|
6
13
|
import {
|
|
7
14
|
ContentHeader,
|
|
8
15
|
CollapsibleContentHeader
|
|
9
16
|
} from "@sproutsocial/seeds-react-content-header";
|
|
17
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
+
function cn(...inputs) {
|
|
19
|
+
const classes = [];
|
|
20
|
+
for (const input of inputs) {
|
|
21
|
+
if (!input) continue;
|
|
22
|
+
if (typeof input === "string") {
|
|
23
|
+
classes.push(input);
|
|
24
|
+
} else if (typeof input === "object") {
|
|
25
|
+
for (const [key, value] of Object.entries(input)) {
|
|
26
|
+
if (value) {
|
|
27
|
+
classes.push(key);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return classes.join(" ");
|
|
33
|
+
}
|
|
34
|
+
var ContentFooterTailwind = ({
|
|
35
|
+
footerContent,
|
|
36
|
+
footerActions,
|
|
37
|
+
className
|
|
38
|
+
}) => /* @__PURE__ */ jsxs("div", { className: cn("seeds-content-block-footer", className), children: [
|
|
39
|
+
footerContent && /* @__PURE__ */ jsx("span", { children: footerContent }),
|
|
40
|
+
footerActions && /* @__PURE__ */ jsx("span", { children: footerActions })
|
|
41
|
+
] });
|
|
42
|
+
var ContentArea = ({
|
|
43
|
+
isLoading,
|
|
44
|
+
children,
|
|
45
|
+
flushLayout,
|
|
46
|
+
hasFooter,
|
|
47
|
+
contentProps
|
|
48
|
+
}) => {
|
|
49
|
+
const { className, ...domProps } = contentProps ?? {};
|
|
50
|
+
return /* @__PURE__ */ jsx(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
...domProps,
|
|
54
|
+
className: cn(
|
|
55
|
+
"seeds-content-block-content",
|
|
56
|
+
{
|
|
57
|
+
flush: !!flushLayout,
|
|
58
|
+
"no-footer": !hasFooter
|
|
59
|
+
},
|
|
60
|
+
className
|
|
61
|
+
),
|
|
62
|
+
children: isLoading ? /* @__PURE__ */ jsx("div", { className: "seeds-content-block-loader", children: /* @__PURE__ */ jsx(Loader, { delay: false }) }) : children
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
var CollapsibleContentBlock = ({
|
|
67
|
+
title,
|
|
68
|
+
subtitle,
|
|
69
|
+
titleAs = "h2",
|
|
70
|
+
subtitleAs = "h3",
|
|
71
|
+
children,
|
|
72
|
+
isLoading,
|
|
73
|
+
headerActions,
|
|
74
|
+
flushLayout,
|
|
75
|
+
footerContent,
|
|
76
|
+
footerActions,
|
|
77
|
+
contentProps,
|
|
78
|
+
isOpen: controlledIsOpen,
|
|
79
|
+
defaultOpen = true,
|
|
80
|
+
onOpenChange
|
|
81
|
+
}) => {
|
|
82
|
+
const [internalOpen, setInternalOpen] = useState(defaultOpen);
|
|
83
|
+
const open = controlledIsOpen !== void 0 ? controlledIsOpen : internalOpen;
|
|
84
|
+
const hasFooter = !!(footerContent || footerActions);
|
|
85
|
+
const handleOpenChange = (newOpen) => {
|
|
86
|
+
if (controlledIsOpen === void 0) {
|
|
87
|
+
setInternalOpen(newOpen);
|
|
88
|
+
}
|
|
89
|
+
onOpenChange?.(newOpen);
|
|
90
|
+
};
|
|
91
|
+
return /* @__PURE__ */ jsx(Collapsible, { isOpen: open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs("section", { className: "seeds-content-block", children: [
|
|
92
|
+
/* @__PURE__ */ jsx(
|
|
93
|
+
CollapsibleContentHeader,
|
|
94
|
+
{
|
|
95
|
+
title,
|
|
96
|
+
subtitle,
|
|
97
|
+
headingLevel: titleAs,
|
|
98
|
+
subtitleAs,
|
|
99
|
+
headerActions,
|
|
100
|
+
trigger: Collapsible.Trigger,
|
|
101
|
+
triggerPosition: "left"
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
/* @__PURE__ */ jsxs(Collapsible.Panel, { children: [
|
|
105
|
+
/* @__PURE__ */ jsx(
|
|
106
|
+
ContentArea,
|
|
107
|
+
{
|
|
108
|
+
isLoading,
|
|
109
|
+
flushLayout,
|
|
110
|
+
hasFooter,
|
|
111
|
+
contentProps,
|
|
112
|
+
children
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
hasFooter && /* @__PURE__ */ jsx(
|
|
116
|
+
ContentFooterTailwind,
|
|
117
|
+
{
|
|
118
|
+
footerContent,
|
|
119
|
+
footerActions
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
] })
|
|
123
|
+
] }) });
|
|
124
|
+
};
|
|
125
|
+
var ContentBlockTailwind = ({
|
|
126
|
+
isCollapsible,
|
|
127
|
+
...props
|
|
128
|
+
}) => {
|
|
129
|
+
if (isCollapsible) {
|
|
130
|
+
return /* @__PURE__ */ jsx(CollapsibleContentBlock, { ...props });
|
|
131
|
+
}
|
|
132
|
+
const {
|
|
133
|
+
title,
|
|
134
|
+
subtitle,
|
|
135
|
+
titleAs = "h2",
|
|
136
|
+
subtitleAs = "h3",
|
|
137
|
+
children,
|
|
138
|
+
isLoading,
|
|
139
|
+
headerActions,
|
|
140
|
+
flushLayout,
|
|
141
|
+
footerContent,
|
|
142
|
+
footerActions,
|
|
143
|
+
contentProps
|
|
144
|
+
} = props;
|
|
145
|
+
const hasFooter = !!(footerContent || footerActions);
|
|
146
|
+
return /* @__PURE__ */ jsxs("section", { className: "seeds-content-block", children: [
|
|
147
|
+
/* @__PURE__ */ jsx(
|
|
148
|
+
ContentHeader,
|
|
149
|
+
{
|
|
150
|
+
title,
|
|
151
|
+
subtitle,
|
|
152
|
+
headingLevel: titleAs,
|
|
153
|
+
subtitleAs,
|
|
154
|
+
headerActions
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
/* @__PURE__ */ jsx(
|
|
158
|
+
ContentArea,
|
|
159
|
+
{
|
|
160
|
+
isLoading,
|
|
161
|
+
flushLayout,
|
|
162
|
+
hasFooter,
|
|
163
|
+
contentProps,
|
|
164
|
+
children
|
|
165
|
+
}
|
|
166
|
+
),
|
|
167
|
+
hasFooter && /* @__PURE__ */ jsx(
|
|
168
|
+
ContentFooterTailwind,
|
|
169
|
+
{
|
|
170
|
+
footerContent,
|
|
171
|
+
footerActions
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
] });
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
// src/ContentBlockStyled.tsx
|
|
178
|
+
import { useState as useState2 } from "react";
|
|
179
|
+
import { Box } from "@sproutsocial/seeds-react-box";
|
|
180
|
+
import { Loader as Loader2 } from "@sproutsocial/seeds-react-loader";
|
|
181
|
+
import { Collapsible as Collapsible2 } from "@sproutsocial/seeds-react-collapsible";
|
|
182
|
+
import {
|
|
183
|
+
ContentHeader as ContentHeader2,
|
|
184
|
+
CollapsibleContentHeader as CollapsibleContentHeader2
|
|
185
|
+
} from "@sproutsocial/seeds-react-content-header";
|
|
10
186
|
import { Container } from "@sproutsocial/seeds-react-container";
|
|
11
187
|
|
|
12
188
|
// src/styles.ts
|
|
13
189
|
import styled from "styled-components";
|
|
14
|
-
import { Box } from "@sproutsocial/seeds-react-box";
|
|
15
|
-
var ContentBlockContent = styled(Box)`
|
|
16
|
-
padding: ${({ theme }) => theme.space[400]};
|
|
17
|
-
`;
|
|
18
190
|
var FooterContainer = styled.div`
|
|
19
191
|
box-sizing: border-box;
|
|
20
192
|
display: flex;
|
|
@@ -28,32 +200,32 @@ var FooterContainer = styled.div`
|
|
|
28
200
|
border-bottom-right-radius: ${({ theme }) => theme.radii.outer};
|
|
29
201
|
`;
|
|
30
202
|
|
|
31
|
-
// src/
|
|
32
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
33
|
-
var
|
|
203
|
+
// src/ContentBlockStyled.tsx
|
|
204
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
205
|
+
var ContentArea2 = ({
|
|
34
206
|
isLoading,
|
|
35
207
|
children,
|
|
36
208
|
contentProps,
|
|
37
209
|
flushLayout,
|
|
38
210
|
hasFooter
|
|
39
|
-
}) => /* @__PURE__ */
|
|
40
|
-
|
|
211
|
+
}) => /* @__PURE__ */ jsx2(
|
|
212
|
+
Box,
|
|
41
213
|
{
|
|
42
214
|
p: flushLayout ? 0 : 400,
|
|
43
215
|
...contentProps,
|
|
44
216
|
borderBottomLeftRadius: hasFooter ? void 0 : "outer",
|
|
45
217
|
borderBottomRightRadius: hasFooter ? void 0 : "outer",
|
|
46
|
-
children: isLoading ? /* @__PURE__ */
|
|
218
|
+
children: isLoading ? /* @__PURE__ */ jsx2(Box, { my: 400, children: /* @__PURE__ */ jsx2(Loader2, { delay: false }) }) : children
|
|
47
219
|
}
|
|
48
220
|
);
|
|
49
221
|
var ContentFooter = ({
|
|
50
222
|
footerContent,
|
|
51
223
|
footerActions
|
|
52
|
-
}) => /* @__PURE__ */
|
|
53
|
-
footerContent && /* @__PURE__ */
|
|
54
|
-
footerActions && /* @__PURE__ */
|
|
224
|
+
}) => /* @__PURE__ */ jsxs2(FooterContainer, { children: [
|
|
225
|
+
footerContent && /* @__PURE__ */ jsx2("span", { children: footerContent }),
|
|
226
|
+
footerActions && /* @__PURE__ */ jsx2("span", { children: footerActions })
|
|
55
227
|
] });
|
|
56
|
-
var
|
|
228
|
+
var CollapsibleContentBlock2 = ({
|
|
57
229
|
title,
|
|
58
230
|
subtitle,
|
|
59
231
|
titleAs = "h2",
|
|
@@ -69,7 +241,7 @@ var CollapsibleContentBlock = ({
|
|
|
69
241
|
defaultOpen = true,
|
|
70
242
|
onOpenChange
|
|
71
243
|
}) => {
|
|
72
|
-
const [internalOpen, setInternalOpen] =
|
|
244
|
+
const [internalOpen, setInternalOpen] = useState2(defaultOpen);
|
|
73
245
|
const open = controlledIsOpen !== void 0 ? controlledIsOpen : internalOpen;
|
|
74
246
|
const hasFooter = !!(footerContent || footerActions);
|
|
75
247
|
const handleOpenChange = (newOpen) => {
|
|
@@ -78,22 +250,22 @@ var CollapsibleContentBlock = ({
|
|
|
78
250
|
}
|
|
79
251
|
onOpenChange?.(newOpen);
|
|
80
252
|
};
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
|
|
253
|
+
return /* @__PURE__ */ jsx2(Collapsible2, { isOpen: open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxs2(Container, { as: "section", children: [
|
|
254
|
+
/* @__PURE__ */ jsx2(
|
|
255
|
+
CollapsibleContentHeader2,
|
|
84
256
|
{
|
|
85
257
|
title,
|
|
86
258
|
subtitle,
|
|
87
259
|
headingLevel: titleAs,
|
|
88
260
|
subtitleAs,
|
|
89
261
|
headerActions,
|
|
90
|
-
trigger:
|
|
262
|
+
trigger: Collapsible2.Trigger,
|
|
91
263
|
triggerPosition: "left"
|
|
92
264
|
}
|
|
93
265
|
),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
|
|
266
|
+
/* @__PURE__ */ jsxs2(Collapsible2.Panel, { children: [
|
|
267
|
+
/* @__PURE__ */ jsx2(
|
|
268
|
+
ContentArea2,
|
|
97
269
|
{
|
|
98
270
|
isLoading,
|
|
99
271
|
contentProps,
|
|
@@ -102,7 +274,7 @@ var CollapsibleContentBlock = ({
|
|
|
102
274
|
children
|
|
103
275
|
}
|
|
104
276
|
),
|
|
105
|
-
hasFooter && /* @__PURE__ */
|
|
277
|
+
hasFooter && /* @__PURE__ */ jsx2(
|
|
106
278
|
ContentFooter,
|
|
107
279
|
{
|
|
108
280
|
footerContent,
|
|
@@ -112,9 +284,12 @@ var CollapsibleContentBlock = ({
|
|
|
112
284
|
] })
|
|
113
285
|
] }) });
|
|
114
286
|
};
|
|
115
|
-
var
|
|
287
|
+
var ContentBlockStyled = ({
|
|
288
|
+
isCollapsible,
|
|
289
|
+
...props
|
|
290
|
+
}) => {
|
|
116
291
|
if (isCollapsible) {
|
|
117
|
-
return /* @__PURE__ */
|
|
292
|
+
return /* @__PURE__ */ jsx2(CollapsibleContentBlock2, { ...props });
|
|
118
293
|
}
|
|
119
294
|
const {
|
|
120
295
|
title,
|
|
@@ -130,9 +305,9 @@ var ContentBlock = ({ isCollapsible, ...props }) => {
|
|
|
130
305
|
footerActions
|
|
131
306
|
} = props;
|
|
132
307
|
const hasFooter = !!(footerContent || footerActions);
|
|
133
|
-
return /* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
|
|
308
|
+
return /* @__PURE__ */ jsxs2(Container, { as: "section", children: [
|
|
309
|
+
/* @__PURE__ */ jsx2(
|
|
310
|
+
ContentHeader2,
|
|
136
311
|
{
|
|
137
312
|
title,
|
|
138
313
|
subtitle,
|
|
@@ -141,8 +316,8 @@ var ContentBlock = ({ isCollapsible, ...props }) => {
|
|
|
141
316
|
headerActions
|
|
142
317
|
}
|
|
143
318
|
),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
-
|
|
319
|
+
/* @__PURE__ */ jsx2(
|
|
320
|
+
ContentArea2,
|
|
146
321
|
{
|
|
147
322
|
isLoading,
|
|
148
323
|
contentProps,
|
|
@@ -151,7 +326,7 @@ var ContentBlock = ({ isCollapsible, ...props }) => {
|
|
|
151
326
|
children
|
|
152
327
|
}
|
|
153
328
|
),
|
|
154
|
-
hasFooter && /* @__PURE__ */
|
|
329
|
+
hasFooter && /* @__PURE__ */ jsx2(
|
|
155
330
|
ContentFooter,
|
|
156
331
|
{
|
|
157
332
|
footerContent,
|
|
@@ -160,6 +335,20 @@ var ContentBlock = ({ isCollapsible, ...props }) => {
|
|
|
160
335
|
)
|
|
161
336
|
] });
|
|
162
337
|
};
|
|
338
|
+
|
|
339
|
+
// src/ContentBlockHybrid.tsx
|
|
340
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
341
|
+
var ContentBlockHybrid = (props) => {
|
|
342
|
+
if (props.contentProps && hasStyledProps(props.contentProps)) {
|
|
343
|
+
return /* @__PURE__ */ jsx3(ContentBlockStyled, { ...props });
|
|
344
|
+
}
|
|
345
|
+
return /* @__PURE__ */ jsx3(ContentBlockTailwind, { ...props });
|
|
346
|
+
};
|
|
347
|
+
var ContentBlockHybrid_default = ContentBlockHybrid;
|
|
348
|
+
|
|
349
|
+
// src/ContentBlock.tsx
|
|
350
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
351
|
+
var ContentBlock = (props) => /* @__PURE__ */ jsx4(ContentBlockHybrid_default, { ...props });
|
|
163
352
|
var ContentBlock_default = ContentBlock;
|
|
164
353
|
|
|
165
354
|
// src/index.ts
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ContentBlock.tsx","../../src/styles.ts","../../src/index.ts"],"sourcesContent":["import React, { useState } from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport { Loader } from \"@sproutsocial/seeds-react-loader\";\nimport { Collapsible } from \"@sproutsocial/seeds-react-collapsible\";\nimport {\n ContentHeader,\n CollapsibleContentHeader,\n} from \"@sproutsocial/seeds-react-content-header\";\nimport { Container } from \"@sproutsocial/seeds-react-container\";\nimport { FooterContainer } from \"./styles\";\n\ninterface ContentBlockBaseProps {\n title: string;\n subtitle?: string;\n titleAs?: \"h1\" | \"h2\" | \"h3\" | \"h4\";\n subtitleAs?: \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"p\";\n isLoading?: boolean;\n children: React.ReactNode;\n headerActions?: React.ReactNode;\n contentProps?: React.ComponentProps<typeof Box>;\n /** Sets content area padding to 0 */\n flushLayout?: boolean;\n /** Left slot of the footer area */\n footerContent?: React.ReactNode;\n /** Right slot of the footer area */\n footerActions?: React.ReactNode;\n}\n\ntype StaticContentBlockProps = ContentBlockBaseProps & {\n isCollapsible?: false;\n isOpen?: never;\n defaultOpen?: never;\n onOpenChange?: never;\n};\n\ntype CollapsibleContentBlockProps = ContentBlockBaseProps & {\n /** Enables collapse/expand behavior on the content area */\n isCollapsible: true;\n /** Controlled open state. When provided, the component is in controlled mode. */\n isOpen?: boolean;\n /** Initial open state for uncontrolled mode. Defaults to true. */\n defaultOpen?: boolean;\n /** Called when the open state changes */\n onOpenChange?: (open: boolean) => void;\n};\n\nexport type ContentBlockProps =\n | StaticContentBlockProps\n | CollapsibleContentBlockProps;\n\nconst ContentArea = ({\n isLoading,\n children,\n contentProps,\n flushLayout,\n hasFooter,\n}: Pick<\n ContentBlockBaseProps,\n \"isLoading\" | \"children\" | \"contentProps\" | \"flushLayout\"\n> & { hasFooter?: boolean }) => (\n <Box\n p={flushLayout ? 0 : 400}\n {...contentProps}\n borderBottomLeftRadius={hasFooter ? undefined : \"outer\"}\n borderBottomRightRadius={hasFooter ? undefined : \"outer\"}\n >\n {isLoading ? (\n <Box my={400}>\n <Loader delay={false} />\n </Box>\n ) : (\n children\n )}\n </Box>\n);\n\nconst ContentFooter = ({\n footerContent,\n footerActions,\n}: {\n footerContent?: React.ReactNode;\n footerActions?: React.ReactNode;\n}) => (\n <FooterContainer>\n {footerContent && <span>{footerContent}</span>}\n {footerActions && <span>{footerActions}</span>}\n </FooterContainer>\n);\n\nconst CollapsibleContentBlock = ({\n title,\n subtitle,\n titleAs = \"h2\",\n subtitleAs = \"h3\",\n children,\n isLoading,\n headerActions,\n contentProps,\n flushLayout,\n footerContent,\n footerActions,\n isOpen: controlledIsOpen,\n defaultOpen = true,\n onOpenChange,\n}: Omit<CollapsibleContentBlockProps, \"isCollapsible\">) => {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const open = controlledIsOpen !== undefined ? controlledIsOpen : internalOpen;\n const hasFooter = !!(footerContent || footerActions);\n\n const handleOpenChange = (newOpen: boolean) => {\n if (controlledIsOpen === undefined) {\n setInternalOpen(newOpen);\n }\n onOpenChange?.(newOpen);\n };\n\n return (\n <Collapsible isOpen={open} onOpenChange={handleOpenChange}>\n <Container as=\"section\">\n <CollapsibleContentHeader\n title={title}\n subtitle={subtitle}\n headingLevel={titleAs}\n subtitleAs={subtitleAs}\n headerActions={headerActions}\n trigger={Collapsible.Trigger}\n triggerPosition=\"left\"\n />\n <Collapsible.Panel>\n <ContentArea\n isLoading={isLoading}\n contentProps={contentProps}\n flushLayout={flushLayout}\n hasFooter={hasFooter}\n >\n {children}\n </ContentArea>\n {hasFooter && (\n <ContentFooter\n footerContent={footerContent}\n footerActions={footerActions}\n />\n )}\n </Collapsible.Panel>\n </Container>\n </Collapsible>\n );\n};\n\nconst ContentBlock = ({ isCollapsible, ...props }: ContentBlockProps) => {\n if (isCollapsible) {\n return <CollapsibleContentBlock {...props} />;\n }\n\n const {\n title,\n subtitle,\n titleAs = \"h2\",\n subtitleAs = \"h3\",\n children,\n isLoading,\n headerActions,\n contentProps,\n flushLayout,\n footerContent,\n footerActions,\n } = props;\n\n const hasFooter = !!(footerContent || footerActions);\n\n return (\n <Container as=\"section\">\n <ContentHeader\n title={title}\n subtitle={subtitle}\n headingLevel={titleAs}\n subtitleAs={subtitleAs}\n headerActions={headerActions}\n />\n <ContentArea\n isLoading={isLoading}\n contentProps={contentProps}\n flushLayout={flushLayout}\n hasFooter={hasFooter}\n >\n {children}\n </ContentArea>\n {hasFooter && (\n <ContentFooter\n footerContent={footerContent}\n footerActions={footerActions}\n />\n )}\n </Container>\n );\n};\n\nexport default ContentBlock;\n","import styled from \"styled-components\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\nexport const ContentBlockContent = styled(Box)`\n padding: ${({ theme }) => theme.space[400]};\n`;\n\nexport const FooterContainer = styled.div`\n box-sizing: border-box;\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n padding: ${({ theme }) => theme.space[400]};\n border-top: ${({ theme }) => theme.borderWidths[500]} solid\n ${({ theme }) => theme.colors.container.border.base};\n border-bottom-left-radius: ${({ theme }) => theme.radii.outer};\n border-bottom-right-radius: ${({ theme }) => theme.radii.outer};\n`;\n","import ContentBlock from \"./ContentBlock\";\n\nexport type { ContentBlockProps } from \"./ContentBlock\";\n\nexport default ContentBlock;\nexport { ContentBlock };\n"],"mappings":";AAAA,SAAgB,gBAAgB;AAChC,SAAS,OAAAA,YAAW;AACpB,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,iBAAiB;;;ACR1B,OAAO,YAAY;AACnB,SAAS,WAAW;AAEb,IAAM,sBAAsB,OAAO,GAAG;AAAA,aAChC,CAAC,EAAE,MAAM,MAAM,MAAM,MAAM,GAAG,CAAC;AAAA;AAGrC,IAAM,kBAAkB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;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","Box"]}
|
|
1
|
+
{"version":3,"sources":["../../src/ContentBlock.tsx","../../src/ContentBlockHybrid.tsx","../../src/ContentBlockTailwind.tsx","../../src/ContentBlockStyled.tsx","../../src/styles.ts","../../src/index.ts"],"sourcesContent":["import React from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport ContentBlockHybrid from \"./ContentBlockHybrid\";\n\nexport interface ContentBlockBaseProps {\n title: string;\n subtitle?: string;\n titleAs?: \"h1\" | \"h2\" | \"h3\" | \"h4\";\n subtitleAs?: \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"p\";\n isLoading?: boolean;\n children: React.ReactNode;\n headerActions?: React.ReactNode;\n contentProps?: React.ComponentProps<typeof Box>;\n /** Sets content area padding to 0 */\n flushLayout?: boolean;\n /** Left slot of the footer area */\n footerContent?: React.ReactNode;\n /** Right slot of the footer area */\n footerActions?: React.ReactNode;\n}\n\ntype StaticContentBlockProps = ContentBlockBaseProps & {\n isCollapsible?: false;\n isOpen?: never;\n defaultOpen?: never;\n onOpenChange?: never;\n};\n\nexport type CollapsibleContentBlockProps = ContentBlockBaseProps & {\n /** Enables collapse/expand behavior on the content area */\n isCollapsible: true;\n /** Controlled open state. When provided, the component is in controlled mode. */\n isOpen?: boolean;\n /** Initial open state for uncontrolled mode. Defaults to true. */\n defaultOpen?: boolean;\n /** Called when the open state changes */\n onOpenChange?: (open: boolean) => void;\n};\n\nexport type ContentBlockProps =\n | StaticContentBlockProps\n | CollapsibleContentBlockProps;\n\n/**\n * ContentBlock component. Automatically routes between the Tailwind\n * implementation (preferred) and the styled-components implementation (used when\n * `contentProps` carries styled-system props), mirroring the Button hybrid.\n */\nconst ContentBlock = (props: ContentBlockProps) => (\n <ContentBlockHybrid {...props} />\n);\n\nexport default ContentBlock;\n","/**\n * Hybrid ContentBlock\n *\n * Routes the whole component between the Tailwind implementation (preferred)\n * and the styled-components implementation (legacy fallback), mirroring\n * ButtonHybrid's single `hasStyledProps` gate.\n *\n * `contentProps` is ContentBlock's only styled-system passthrough surface: it\n * is spread onto the content `<Box>` and may carry props (`bg`, `py`, …) that a\n * plain Tailwind element cannot honor. When it does, render the styled-components\n * tree so those props still apply; otherwise use the lighter Tailwind path.\n */\n\nimport React from \"react\";\nimport { hasStyledProps } from \"@sproutsocial/seeds-react-system-props\";\nimport {\n ContentBlockTailwind,\n ContentFooterTailwind,\n type ContentFooterProps,\n} from \"./ContentBlockTailwind\";\nimport { ContentBlockStyled } from \"./ContentBlockStyled\";\nimport type { ContentBlockProps } from \"./ContentBlock\";\n\nconst ContentBlockHybrid = (props: ContentBlockProps) => {\n if (props.contentProps && hasStyledProps(props.contentProps)) {\n return <ContentBlockStyled {...props} />;\n }\n\n return <ContentBlockTailwind {...props} />;\n};\n\nexport default ContentBlockHybrid;\n\n/**\n * Hybrid ContentBlock footer.\n *\n * The footer exposes no styled-system props and no styled()-extendable surface\n * (FooterContainer is internal and never re-exported from index.ts), so the\n * Tailwind/CSS-class footer is always used — no routing predicate is needed here.\n * Kept as a separate export so the footer-override story/tests can render it\n * directly.\n */\nexport const ContentFooterHybrid = (props: ContentFooterProps) => (\n <ContentFooterTailwind {...props} />\n);\n","/**\n * Tailwind CSS implementation of the ContentBlock component.\n * Renders the whole component (card, content area, loader, footer) with plain\n * elements and the Seeds content-block CSS classes from content-block.css.\n * Child components (ContentHeader, Collapsible, Loader) are composed unchanged.\n */\n\nimport React, { useState } from \"react\";\nimport { Loader } from \"@sproutsocial/seeds-react-loader\";\nimport { Collapsible } from \"@sproutsocial/seeds-react-collapsible\";\nimport {\n ContentHeader,\n CollapsibleContentHeader,\n} from \"@sproutsocial/seeds-react-content-header\";\nimport type {\n ContentBlockBaseProps,\n ContentBlockProps,\n CollapsibleContentBlockProps,\n} from \"./ContentBlock\";\n\n// Utility for merging class names properly.\n// cn is NOT exported from @sproutsocial/seeds-react-utilities, so it is\n// reproduced locally here (mirrors ButtonTailwind.tsx).\nfunction cn(\n ...inputs: (string | undefined | null | false | Record<string, boolean>)[]\n): string {\n const classes: string[] = [];\n\n for (const input of inputs) {\n if (!input) continue;\n\n if (typeof input === \"string\") {\n classes.push(input);\n } else if (typeof input === \"object\") {\n for (const [key, value] of Object.entries(input)) {\n if (value) {\n classes.push(key);\n }\n }\n }\n }\n\n return classes.join(\" \");\n}\n\nexport type ContentFooterProps = {\n footerContent?: React.ReactNode;\n footerActions?: React.ReactNode;\n className?: string;\n};\n\nexport const ContentFooterTailwind = ({\n footerContent,\n footerActions,\n className,\n}: ContentFooterProps) => (\n <div className={cn(\"seeds-content-block-footer\", className)}>\n {footerContent && <span>{footerContent}</span>}\n {footerActions && <span>{footerActions}</span>}\n </div>\n);\n\nconst ContentArea = ({\n isLoading,\n children,\n flushLayout,\n hasFooter,\n contentProps,\n}: Pick<\n ContentBlockBaseProps,\n \"isLoading\" | \"children\" | \"flushLayout\" | \"contentProps\"\n> & {\n hasFooter?: boolean;\n}) => {\n // By construction, any contentProps reaching the Tailwind path carries no\n // styled-system props (those route to ContentBlockStyled via hasStyledProps),\n // so the rest is pure DOM attributes safe to spread onto a div. Pull className\n // out and merge it via cn so the seeds-content-block-content class is\n // preserved, rendering className after the spread so the merged value wins\n // (mirrors ButtonTailwind).\n const { className, ...domProps } = contentProps ?? {};\n return (\n <div\n {...(domProps as React.HTMLAttributes<HTMLDivElement>)}\n className={cn(\n \"seeds-content-block-content\",\n {\n flush: !!flushLayout,\n \"no-footer\": !hasFooter,\n },\n className\n )}\n >\n {isLoading ? (\n <div className=\"seeds-content-block-loader\">\n <Loader delay={false} />\n </div>\n ) : (\n children\n )}\n </div>\n );\n};\n\nconst CollapsibleContentBlock = ({\n title,\n subtitle,\n titleAs = \"h2\",\n subtitleAs = \"h3\",\n children,\n isLoading,\n headerActions,\n flushLayout,\n footerContent,\n footerActions,\n contentProps,\n isOpen: controlledIsOpen,\n defaultOpen = true,\n onOpenChange,\n}: Omit<CollapsibleContentBlockProps, \"isCollapsible\">) => {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const open = controlledIsOpen !== undefined ? controlledIsOpen : internalOpen;\n const hasFooter = !!(footerContent || footerActions);\n\n const handleOpenChange = (newOpen: boolean) => {\n if (controlledIsOpen === undefined) {\n setInternalOpen(newOpen);\n }\n onOpenChange?.(newOpen);\n };\n\n return (\n <Collapsible isOpen={open} onOpenChange={handleOpenChange}>\n <section className=\"seeds-content-block\">\n <CollapsibleContentHeader\n title={title}\n subtitle={subtitle}\n headingLevel={titleAs}\n subtitleAs={subtitleAs}\n headerActions={headerActions}\n trigger={Collapsible.Trigger}\n triggerPosition=\"left\"\n />\n <Collapsible.Panel>\n <ContentArea\n isLoading={isLoading}\n flushLayout={flushLayout}\n hasFooter={hasFooter}\n contentProps={contentProps}\n >\n {children}\n </ContentArea>\n {hasFooter && (\n <ContentFooterTailwind\n footerContent={footerContent}\n footerActions={footerActions}\n />\n )}\n </Collapsible.Panel>\n </section>\n </Collapsible>\n );\n};\n\n/**\n * Tailwind/CSS-class implementation of the full ContentBlock. Preferred path;\n * the Hybrid routes here unless `contentProps` carries styled-system props.\n */\nexport const ContentBlockTailwind = ({\n isCollapsible,\n ...props\n}: ContentBlockProps) => {\n if (isCollapsible) {\n return <CollapsibleContentBlock {...props} />;\n }\n\n const {\n title,\n subtitle,\n titleAs = \"h2\",\n subtitleAs = \"h3\",\n children,\n isLoading,\n headerActions,\n flushLayout,\n footerContent,\n footerActions,\n contentProps,\n } = props;\n\n const hasFooter = !!(footerContent || footerActions);\n\n return (\n <section className=\"seeds-content-block\">\n <ContentHeader\n title={title}\n subtitle={subtitle}\n headingLevel={titleAs}\n subtitleAs={subtitleAs}\n headerActions={headerActions}\n />\n <ContentArea\n isLoading={isLoading}\n flushLayout={flushLayout}\n hasFooter={hasFooter}\n contentProps={contentProps}\n >\n {children}\n </ContentArea>\n {hasFooter && (\n <ContentFooterTailwind\n footerContent={footerContent}\n footerActions={footerActions}\n />\n )}\n </section>\n );\n};\n","/**\n * Styled-components implementation of the full ContentBlock.\n *\n * This is the legacy fallback the Hybrid delegates to whenever `contentProps`\n * carries styled-system props (e.g. `bg`, `py`) that a plain Tailwind element\n * cannot honor. It reproduces the original Box/Container/FooterContainer tree\n * verbatim so styled-system passthrough and visual parity are preserved.\n */\n\nimport React, { useState } from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport { Loader } from \"@sproutsocial/seeds-react-loader\";\nimport { Collapsible } from \"@sproutsocial/seeds-react-collapsible\";\nimport {\n ContentHeader,\n CollapsibleContentHeader,\n} from \"@sproutsocial/seeds-react-content-header\";\nimport { Container } from \"@sproutsocial/seeds-react-container\";\nimport { FooterContainer } from \"./styles\";\nimport type {\n ContentBlockBaseProps,\n ContentBlockProps,\n CollapsibleContentBlockProps,\n} from \"./ContentBlock\";\n\nconst ContentArea = ({\n isLoading,\n children,\n contentProps,\n flushLayout,\n hasFooter,\n}: Pick<\n ContentBlockBaseProps,\n \"isLoading\" | \"children\" | \"contentProps\" | \"flushLayout\"\n> & { hasFooter?: boolean }) => (\n <Box\n p={flushLayout ? 0 : 400}\n {...contentProps}\n borderBottomLeftRadius={hasFooter ? undefined : \"outer\"}\n borderBottomRightRadius={hasFooter ? undefined : \"outer\"}\n >\n {isLoading ? (\n <Box my={400}>\n <Loader delay={false} />\n </Box>\n ) : (\n children\n )}\n </Box>\n);\n\nconst ContentFooter = ({\n footerContent,\n footerActions,\n}: {\n footerContent?: React.ReactNode;\n footerActions?: React.ReactNode;\n}) => (\n <FooterContainer>\n {footerContent && <span>{footerContent}</span>}\n {footerActions && <span>{footerActions}</span>}\n </FooterContainer>\n);\n\nconst CollapsibleContentBlock = ({\n title,\n subtitle,\n titleAs = \"h2\",\n subtitleAs = \"h3\",\n children,\n isLoading,\n headerActions,\n contentProps,\n flushLayout,\n footerContent,\n footerActions,\n isOpen: controlledIsOpen,\n defaultOpen = true,\n onOpenChange,\n}: Omit<CollapsibleContentBlockProps, \"isCollapsible\">) => {\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const open = controlledIsOpen !== undefined ? controlledIsOpen : internalOpen;\n const hasFooter = !!(footerContent || footerActions);\n\n const handleOpenChange = (newOpen: boolean) => {\n if (controlledIsOpen === undefined) {\n setInternalOpen(newOpen);\n }\n onOpenChange?.(newOpen);\n };\n\n return (\n <Collapsible isOpen={open} onOpenChange={handleOpenChange}>\n <Container as=\"section\">\n <CollapsibleContentHeader\n title={title}\n subtitle={subtitle}\n headingLevel={titleAs}\n subtitleAs={subtitleAs}\n headerActions={headerActions}\n trigger={Collapsible.Trigger}\n triggerPosition=\"left\"\n />\n <Collapsible.Panel>\n <ContentArea\n isLoading={isLoading}\n contentProps={contentProps}\n flushLayout={flushLayout}\n hasFooter={hasFooter}\n >\n {children}\n </ContentArea>\n {hasFooter && (\n <ContentFooter\n footerContent={footerContent}\n footerActions={footerActions}\n />\n )}\n </Collapsible.Panel>\n </Container>\n </Collapsible>\n );\n};\n\nexport const ContentBlockStyled = ({\n isCollapsible,\n ...props\n}: ContentBlockProps) => {\n if (isCollapsible) {\n return <CollapsibleContentBlock {...props} />;\n }\n\n const {\n title,\n subtitle,\n titleAs = \"h2\",\n subtitleAs = \"h3\",\n children,\n isLoading,\n headerActions,\n contentProps,\n flushLayout,\n footerContent,\n footerActions,\n } = props;\n\n const hasFooter = !!(footerContent || footerActions);\n\n return (\n <Container as=\"section\">\n <ContentHeader\n title={title}\n subtitle={subtitle}\n headingLevel={titleAs}\n subtitleAs={subtitleAs}\n headerActions={headerActions}\n />\n <ContentArea\n isLoading={isLoading}\n contentProps={contentProps}\n flushLayout={flushLayout}\n hasFooter={hasFooter}\n >\n {children}\n </ContentArea>\n {hasFooter && (\n <ContentFooter\n footerContent={footerContent}\n footerActions={footerActions}\n />\n )}\n </Container>\n );\n};\n","import styled from \"styled-components\";\n\nexport const FooterContainer = styled.div`\n box-sizing: border-box;\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n padding: ${({ theme }) => theme.space[400]};\n border-top: ${({ theme }) => theme.borderWidths[500]} solid\n ${({ theme }) => theme.colors.container.border.base};\n border-bottom-left-radius: ${({ theme }) => theme.radii.outer};\n border-bottom-right-radius: ${({ theme }) => theme.radii.outer};\n`;\n","import ContentBlock from \"./ContentBlock\";\n\nexport type { ContentBlockProps } from \"./ContentBlock\";\n\nexport default ContentBlock;\nexport { ContentBlock };\n"],"mappings":";AAAA,OAAkB;AAClB,OAAoB;;;ACYpB,OAAkB;AAClB,SAAS,sBAAsB;;;ACP/B,SAAgB,gBAAgB;AAChC,SAAS,cAAc;AACvB,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,OACK;AA2CL,SACoB,KADpB;AAjCF,SAAS,MACJ,QACK;AACR,QAAM,UAAoB,CAAC;AAE3B,aAAW,SAAS,QAAQ;AAC1B,QAAI,CAAC,MAAO;AAEZ,QAAI,OAAO,UAAU,UAAU;AAC7B,cAAQ,KAAK,KAAK;AAAA,IACpB,WAAW,OAAO,UAAU,UAAU;AACpC,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAG;AAChD,YAAI,OAAO;AACT,kBAAQ,KAAK,GAAG;AAAA,QAClB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,QAAQ,KAAK,GAAG;AACzB;AAQO,IAAM,wBAAwB,CAAC;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AACF,MACE,qBAAC,SAAI,WAAW,GAAG,8BAA8B,SAAS,GACvD;AAAA,mBAAiB,oBAAC,UAAM,yBAAc;AAAA,EACtC,iBAAiB,oBAAC,UAAM,yBAAc;AAAA,GACzC;AAGF,IAAM,cAAc,CAAC;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAKM;AAOJ,QAAM,EAAE,WAAW,GAAG,SAAS,IAAI,gBAAgB,CAAC;AACpD,SACE;AAAA,IAAC;AAAA;AAAA,MACE,GAAI;AAAA,MACL,WAAW;AAAA,QACT;AAAA,QACA;AAAA,UACE,OAAO,CAA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e,CAAC,UACpB,gBAAAA,KAAC,8BAAoB,GAAG,OAAO;AAGjC,IAAO,uBAAQ;;;AKhDf,IAAO,gBAAQ;","names":["useState","Loader","Collapsible","ContentHeader","CollapsibleContentHeader","jsx","jsxs","ContentArea","Loader","CollapsibleContentBlock","useState","Collapsible","CollapsibleContentHeader","ContentHeader","jsx","jsx"]}
|
package/dist/index.d.mts
CHANGED
|
@@ -35,6 +35,11 @@ type CollapsibleContentBlockProps = ContentBlockBaseProps & {
|
|
|
35
35
|
onOpenChange?: (open: boolean) => void;
|
|
36
36
|
};
|
|
37
37
|
type ContentBlockProps = StaticContentBlockProps | CollapsibleContentBlockProps;
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* ContentBlock component. Automatically routes between the Tailwind
|
|
40
|
+
* implementation (preferred) and the styled-components implementation (used when
|
|
41
|
+
* `contentProps` carries styled-system props), mirroring the Button hybrid.
|
|
42
|
+
*/
|
|
43
|
+
declare const ContentBlock: (props: ContentBlockProps) => react_jsx_runtime.JSX.Element;
|
|
39
44
|
|
|
40
45
|
export { ContentBlock, type ContentBlockProps, ContentBlock as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,11 @@ type CollapsibleContentBlockProps = ContentBlockBaseProps & {
|
|
|
35
35
|
onOpenChange?: (open: boolean) => void;
|
|
36
36
|
};
|
|
37
37
|
type ContentBlockProps = StaticContentBlockProps | CollapsibleContentBlockProps;
|
|
38
|
-
|
|
38
|
+
/**
|
|
39
|
+
* ContentBlock component. Automatically routes between the Tailwind
|
|
40
|
+
* implementation (preferred) and the styled-components implementation (used when
|
|
41
|
+
* `contentProps` carries styled-system props), mirroring the Button hybrid.
|
|
42
|
+
*/
|
|
43
|
+
declare const ContentBlock: (props: ContentBlockProps) => react_jsx_runtime.JSX.Element;
|
|
39
44
|
|
|
40
45
|
export { ContentBlock, type ContentBlockProps, ContentBlock as default };
|