@contentful/f36-card 4.16.0 → 4.19.0

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/module.js DELETED
@@ -1,637 +0,0 @@
1
- import {cx as $5DxI1$cx, css as $5DxI1$css} from "emotion";
2
- import $5DxI1$react, {useState as $5DxI1$useState, useCallback as $5DxI1$useCallback, forwardRef as $5DxI1$forwardRef} from "react";
3
- import {Flex as $5DxI1$Flex, Box as $5DxI1$Box, getEntityStatusStyles as $5DxI1$getEntityStatusStyles} from "@contentful/f36-core";
4
- import {EntityStatusBadge as $5DxI1$EntityStatusBadge} from "@contentful/f36-badge";
5
- import {Asset as $5DxI1$Asset} from "@contentful/f36-asset";
6
- import {SkeletonContainer as $5DxI1$SkeletonContainer, SkeletonImage as $5DxI1$SkeletonImage, SkeletonDisplayText as $5DxI1$SkeletonDisplayText, SkeletonBodyText as $5DxI1$SkeletonBodyText} from "@contentful/f36-skeleton";
7
- import {DragHandle as $5DxI1$DragHandle} from "@contentful/f36-drag-handle";
8
- import $5DxI1$contentfulf36tokens from "@contentful/f36-tokens";
9
- import {Text as $5DxI1$Text, Heading as $5DxI1$Heading, Subheading as $5DxI1$Subheading, Paragraph as $5DxI1$Paragraph} from "@contentful/f36-typography";
10
- import {IconButton as $5DxI1$IconButton} from "@contentful/f36-button";
11
- import {MoreHorizontalIcon as $5DxI1$MoreHorizontalIcon} from "@contentful/f36-icons";
12
- import {Menu as $5DxI1$Menu} from "@contentful/f36-menu";
13
- import $5DxI1$truncate from "truncate";
14
- import {Tooltip as $5DxI1$Tooltip} from "@contentful/f36-tooltip";
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
- const $082b639acf692abe$export$e5c3362273de1eca = ()=>{
29
- return {
30
- contentBody: /*#__PURE__*/ (0, $5DxI1$css)({
31
- name: "161cbg",
32
- styles: "grid-column:content;grid-row:content;white-space:initial;"
33
- }),
34
- wrapper: /*#__PURE__*/ (0, $5DxI1$css)({
35
- name: "1cjnmwb",
36
- styles: "flex:1 1 0;display:grid;grid-template-rows:[header] auto [content] minmax(0, 1fr);grid-template-columns:auto [content] minmax(0, 1fr);"
37
- }),
38
- dragHandle: /*#__PURE__*/ (0, $5DxI1$css)({
39
- borderBottomLeftRadius: (0, $5DxI1$contentfulf36tokens).borderRadiusMedium,
40
- borderTopLeftRadius: (0, $5DxI1$contentfulf36tokens).borderRadiusMedium,
41
- cursor: "grab"
42
- }),
43
- root: ({ hasHeader: hasHeader , isHovered: isHovered , isSelected: isSelected })=>{
44
- const styles = {
45
- backgroundColor: (0, $5DxI1$contentfulf36tokens).colorWhite,
46
- borderColor: (0, $5DxI1$contentfulf36tokens).gray300,
47
- borderRadius: (0, $5DxI1$contentfulf36tokens).borderRadiusMedium,
48
- borderStyle: "solid",
49
- borderWidth: 1,
50
- color: (0, $5DxI1$contentfulf36tokens).gray900,
51
- display: "flex",
52
- textAlign: "left",
53
- width: "100%",
54
- fontSize: (0, $5DxI1$contentfulf36tokens).fontSizeM,
55
- fontWeight: (0, $5DxI1$contentfulf36tokens).fontWeightNormal,
56
- position: "relative",
57
- textDecoration: "none",
58
- transition: `border-color ${(0, $5DxI1$contentfulf36tokens).transitionDurationDefault} ${(0, $5DxI1$contentfulf36tokens).transitionEasingDefault},
59
- box-shadow ${(0, $5DxI1$contentfulf36tokens).transitionDurationShort} ${(0, $5DxI1$contentfulf36tokens).transitionEasingDefault}`,
60
- "&:focus": /*#__PURE__*/ (0, $5DxI1$css)({
61
- borderColor: isSelected ? (0, $5DxI1$contentfulf36tokens).blue100 : (0, $5DxI1$contentfulf36tokens).colorPrimary,
62
- boxShadow: (0, $5DxI1$contentfulf36tokens).glowPrimary,
63
- outline: "none"
64
- }),
65
- "&:focus:not(:focus-visible)": /*#__PURE__*/ (0, $5DxI1$css)({
66
- borderColor: isSelected ? (0, $5DxI1$contentfulf36tokens).colorPrimary : (0, $5DxI1$contentfulf36tokens).gray300,
67
- boxShadow: "unset"
68
- }),
69
- "&:focus-visible": /*#__PURE__*/ (0, $5DxI1$css)({
70
- borderColor: (0, $5DxI1$contentfulf36tokens).colorPrimary,
71
- boxShadow: (0, $5DxI1$contentfulf36tokens).glowPrimary
72
- })
73
- };
74
- if (!hasHeader) styles.paddingTop = (0, $5DxI1$contentfulf36tokens).spacingM;
75
- if (isHovered) {
76
- styles.borderColor = (0, $5DxI1$contentfulf36tokens).colorPrimary;
77
- styles.cursor = "pointer";
78
- }
79
- if (isSelected) {
80
- styles.backgroundColor = (0, $5DxI1$contentfulf36tokens).blue100;
81
- styles.borderColor = (0, $5DxI1$contentfulf36tokens).colorPrimary;
82
- }
83
- return /*#__PURE__*/ (0, $5DxI1$css)(styles);
84
- },
85
- skeleton: /*#__PURE__*/ (0, $5DxI1$css)({
86
- border: `1px solid ${(0, $5DxI1$contentfulf36tokens).gray300}`,
87
- borderRadius: (0, $5DxI1$contentfulf36tokens).borderRadiusMedium,
88
- padding: (0, $5DxI1$contentfulf36tokens).spacingM
89
- })
90
- };
91
- };
92
-
93
-
94
-
95
-
96
-
97
-
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
- const $6e2e1e7b43420737$export$6468e6b9c1bc1de = ()=>{
107
- return {
108
- root: /*#__PURE__*/ (0, $5DxI1$css)({
109
- minHeight: "auto",
110
- padding: (0, $5DxI1$contentfulf36tokens).spacing2Xs,
111
- marginLeft: (0, $5DxI1$contentfulf36tokens).spacingXs
112
- })
113
- };
114
- };
115
-
116
-
117
- const $c83d23d1a559d33c$export$9b6a647253f61c5f = ({ buttonProps: buttonProps , children: children })=>{
118
- const styles = (0, $6e2e1e7b43420737$export$6468e6b9c1bc1de)();
119
- return /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Menu), null, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Menu).Trigger, null, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$IconButton), {
120
- "aria-label": "Actions",
121
- icon: /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$MoreHorizontalIcon), null),
122
- ...buttonProps,
123
- className: (0, $5DxI1$cx)(styles.root, buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.className),
124
- size: "small",
125
- variant: "transparent",
126
- testId: "cf-ui-card-actions"
127
- })), /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Menu).List, null, children));
128
- };
129
-
130
-
131
-
132
- const $798bf03d82ac02ed$var$getHeaderStyles = ()=>{
133
- return {
134
- header: /*#__PURE__*/ (0, $5DxI1$css)({
135
- alignItems: "center",
136
- borderBottomColor: (0, $5DxI1$contentfulf36tokens).gray200,
137
- borderBottomStyle: "solid",
138
- borderBottomWidth: 1,
139
- borderTopLeftRadius: (0, $5DxI1$contentfulf36tokens).borderRadiusMedium,
140
- borderTopRightRadius: (0, $5DxI1$contentfulf36tokens).borderRadiusMedium,
141
- boxSizing: "border-box",
142
- color: (0, $5DxI1$contentfulf36tokens).gray600,
143
- fontSize: (0, $5DxI1$contentfulf36tokens).fontSizeM,
144
- fontWeight: (0, $5DxI1$contentfulf36tokens).fontWeightNormal,
145
- gridColumn: "content",
146
- gridRow: "header",
147
- lineHeight: (0, $5DxI1$contentfulf36tokens).lineHeightM,
148
- paddingBottom: (0, $5DxI1$contentfulf36tokens).spacingXs,
149
- paddingLeft: (0, $5DxI1$contentfulf36tokens).spacingM,
150
- paddingRight: (0, $5DxI1$contentfulf36tokens).spacingXs,
151
- paddingTop: (0, $5DxI1$contentfulf36tokens).spacingXs,
152
- minHeight: "37px"
153
- }),
154
- headerWithActions: /*#__PURE__*/ (0, $5DxI1$css)({
155
- paddingBottom: 0,
156
- paddingRight: (0, $5DxI1$contentfulf36tokens).spacingXs,
157
- paddingTop: 0
158
- })
159
- };
160
- };
161
- const $798bf03d82ac02ed$export$783e10c0b439f264 = (e)=>{
162
- e.preventDefault();
163
- e.stopPropagation();
164
- };
165
- const $798bf03d82ac02ed$export$606643aa598b5a97 = (props)=>{
166
- const { icon: icon , type: type , actions: actions , actionsButtonProps: actionsButtonProps , badge: badge } = props;
167
- const styles = $798bf03d82ac02ed$var$getHeaderStyles();
168
- return /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Flex), {
169
- className: (0, $5DxI1$cx)(styles.header, actions && styles.headerWithActions)
170
- }, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Flex), {
171
- flexGrow: 1
172
- }, type && /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Text), {
173
- fontColor: "gray600",
174
- isWordBreak: true
175
- }, type)), icon && /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Flex), {
176
- alignItems: "center",
177
- marginLeft: "spacingXs"
178
- }, icon), badge && /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Flex), {
179
- alignItems: "center",
180
- marginLeft: "spacingXs"
181
- }, badge), actions && actions.length > 0 && /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Flex // don't propagate click event, so onClick handler on the card is not triggered
182
- ), {
183
- onClick: $798bf03d82ac02ed$export$783e10c0b439f264,
184
- alignItems: "center"
185
- }, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $c83d23d1a559d33c$export$9b6a647253f61c5f), {
186
- buttonProps: actionsButtonProps
187
- }, actions)));
188
- };
189
- $798bf03d82ac02ed$export$606643aa598b5a97.displayName = "DefaultCardHeader";
190
-
191
-
192
- const $58aab48c7cf09ac0$export$eed7d00d62e881b8 = "article";
193
- function $58aab48c7cf09ac0$var$_BaseCard({ actions: actions , actionsButtonProps: actionsButtonProps , ariaLabel: ariaLabel , badge: badge , children: children , className: className , contentBodyProps: contentBodyProps , header: header , href: href , icon: icon , isDragging: isDragging = false , isHovered: isHoveredProp , isSelected: isSelected = false , onBlur: onBlur , onClick: onClick , onFocus: onFocus , onKeyDown: onKeyDown , onMouseEnter: onMouseEnter , onMouseLeave: onMouseLeave , target: target , rel: rel , testId: testId = "cf-ui-base-card" , title: title , type: type , withDragHandle: withDragHandle , dragHandleRender: dragHandleRender , isLoading: isLoading , ...otherProps }, forwardedRef) {
194
- const styles = (0, $082b639acf692abe$export$e5c3362273de1eca)();
195
- const [isHovered, setIsHovered] = (0, $5DxI1$useState)(isHoveredProp !== null && isHoveredProp !== void 0 ? isHoveredProp : false);
196
- const isInteractive = Boolean(onClick || href || withDragHandle);
197
- const hasHeader = Boolean(header);
198
- const defaultHeader = type || icon || badge || actions ? /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $798bf03d82ac02ed$export$606643aa598b5a97), {
199
- type: type,
200
- icon: icon,
201
- badge: badge,
202
- actions: actions,
203
- actionsButtonProps: actionsButtonProps
204
- }) : null;
205
- const handleFocus = (0, $5DxI1$useCallback)((event)=>{
206
- if (onFocus) onFocus(event);
207
- }, [
208
- onFocus
209
- ]);
210
- const handleBlur = (0, $5DxI1$useCallback)((event)=>{
211
- if (onBlur) onBlur(event);
212
- }, [
213
- onBlur
214
- ]);
215
- const handleMouseEnter = (0, $5DxI1$useCallback)((event)=>{
216
- setIsHovered(true);
217
- if (onMouseEnter) onMouseEnter(event);
218
- }, [
219
- onMouseEnter
220
- ]);
221
- const handleMouseLeave = (0, $5DxI1$useCallback)((event)=>{
222
- setIsHovered(false);
223
- if (onMouseLeave) onMouseLeave(event);
224
- }, [
225
- onMouseLeave
226
- ]);
227
- const handleClick = onClick ? (event)=>{
228
- onClick(event);
229
- } : undefined;
230
- const handleKeyDown = (0, $5DxI1$useCallback)((event)=>{
231
- if (onKeyDown) onKeyDown(event);
232
- }, [
233
- onKeyDown
234
- ]);
235
- if (isLoading) return /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$SkeletonContainer), {
236
- className: styles.skeleton,
237
- svgHeight: "5.6rem"
238
- }, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$SkeletonDisplayText), {
239
- numberOfLines: 1
240
- }), /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$SkeletonBodyText), {
241
- numberOfLines: 1,
242
- offsetTop: 35
243
- }));
244
- const drag = /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$DragHandle), {
245
- className: styles.dragHandle,
246
- isActive: isDragging,
247
- label: "Reorder entry",
248
- onClick: (0, $798bf03d82ac02ed$export$783e10c0b439f264)
249
- });
250
- return /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Box), {
251
- "aria-label": title || ariaLabel,
252
- "aria-pressed": otherProps.as === "button" ? isSelected ? "true" : "false" : undefined,
253
- as: $58aab48c7cf09ac0$export$eed7d00d62e881b8,
254
- className: (0, $5DxI1$cx)(styles.root({
255
- hasHeader: hasHeader,
256
- isHovered: isHovered,
257
- isSelected: isSelected
258
- }), className),
259
- href: href,
260
- onBlur: handleBlur,
261
- onClick: handleClick,
262
- onFocus: handleFocus,
263
- onMouseEnter: typeof isHoveredProp === "undefined" && isInteractive ? handleMouseEnter : undefined,
264
- onMouseLeave: typeof isHoveredProp === "undefined" && isInteractive ? handleMouseLeave : undefined,
265
- onKeyDown: handleKeyDown,
266
- rel: href && (rel || "noreferrer"),
267
- role: onClick && !href ? "button" : undefined,
268
- tabIndex: onClick ? 0 : undefined,
269
- target: target,
270
- ...otherProps,
271
- ref: forwardedRef,
272
- testId: testId,
273
- title: title
274
- }, withDragHandle ? dragHandleRender ? dragHandleRender({
275
- drag: drag,
276
- isDragging: isDragging
277
- }) : drag : null, /*#__PURE__*/ (0, $5DxI1$react).createElement("div", {
278
- className: styles.wrapper,
279
- "data-card-part": "wrapper"
280
- }, header !== null && header !== void 0 ? header : defaultHeader, /*#__PURE__*/ (0, $5DxI1$react).createElement("div", {
281
- className: styles.contentBody,
282
- "data-card-part": "content"
283
- }, children)));
284
- }
285
- $58aab48c7cf09ac0$var$_BaseCard.displayName = "BaseCard";
286
- const $58aab48c7cf09ac0$export$ffd8d1a491a618f2 = /*#__PURE__*/ (0, $5DxI1$forwardRef)($58aab48c7cf09ac0$var$_BaseCard);
287
-
288
-
289
-
290
-
291
- const $f5face715e2a2436$export$37a6ca57378bcb83 = ()=>{
292
- return {
293
- root: ({ size: size })=>/*#__PURE__*/ (0, $5DxI1$css)({
294
- display: "inline-flex",
295
- width: "auto",
296
- borderRadius: (0, $5DxI1$contentfulf36tokens).borderRadiusMedium,
297
- minWidth: `calc(1rem * (120 / ${(0, $5DxI1$contentfulf36tokens).fontBaseDefault}))`,
298
- height: size === "small" ? `calc(1rem * (188 / ${(0, $5DxI1$contentfulf36tokens).fontBaseDefault}))` : `calc(1rem * (300 / ${(0, $5DxI1$contentfulf36tokens).fontBaseDefault}))`,
299
- padding: 0,
300
- textAlign: "center"
301
- }),
302
- asset: /*#__PURE__*/ (0, $5DxI1$css)({
303
- name: "10klw3m",
304
- styles: "height:100%;"
305
- }),
306
- skeleton: /*#__PURE__*/ (0, $5DxI1$css)({
307
- border: `1px solid ${(0, $5DxI1$contentfulf36tokens).gray300}`,
308
- borderRadius: (0, $5DxI1$contentfulf36tokens).borderRadiusMedium,
309
- padding: (0, $5DxI1$contentfulf36tokens).spacingM
310
- })
311
- };
312
- };
313
-
314
-
315
-
316
-
317
- const $e5307476578213bc$export$eff93e4e59ccc3b8 = ({ actions: actions , className: className , icon: icon = null , isSelected: isSelected , size: size = "default" , src: src , status: status , title: title , type: type , withDragHandle: withDragHandle = false , isLoading: isLoading , testId: testId = "cf-ui-asset-card" , ...otherProps })=>{
318
- const styles = (0, $f5face715e2a2436$export$37a6ca57378bcb83)();
319
- const badge = status ? /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$EntityStatusBadge), {
320
- entityStatus: status
321
- }) : null;
322
- const header = icon || badge || actions ? /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $798bf03d82ac02ed$export$606643aa598b5a97), {
323
- icon: icon,
324
- badge: badge,
325
- actions: actions
326
- }) : null;
327
- if (isLoading) return /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$SkeletonContainer), {
328
- className: styles.skeleton,
329
- svgWidth: size === "default" ? "18rem" : "11rem",
330
- svgHeight: size === "default" ? "18.75rem" : "12rem"
331
- }, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$SkeletonImage), {
332
- width: "100%",
333
- height: "18.75rem"
334
- }));
335
- return /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $58aab48c7cf09ac0$export$ffd8d1a491a618f2), {
336
- ...otherProps,
337
- badge: badge,
338
- className: (0, $5DxI1$cx)(styles.root({
339
- size: size
340
- }), className),
341
- header: header,
342
- isSelected: isSelected,
343
- title: title,
344
- withDragHandle: withDragHandle,
345
- testId: testId
346
- }, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Flex), {
347
- alignItems: "center",
348
- fullHeight: true,
349
- justifyContent: "center"
350
- }, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Asset), {
351
- className: styles.asset,
352
- src: src,
353
- status: status,
354
- title: title,
355
- type: type
356
- })));
357
- };
358
-
359
-
360
-
361
-
362
-
363
-
364
-
365
-
366
-
367
-
368
-
369
- const $2fcc945398035016$var$getCardPaddingValue = (padding)=>{
370
- switch(padding){
371
- case "large":
372
- return (0, $5DxI1$contentfulf36tokens).spacingL;
373
- case "none":
374
- return 0;
375
- default:
376
- return (0, $5DxI1$contentfulf36tokens).spacingM;
377
- }
378
- };
379
- const $2fcc945398035016$export$164c3dc7db460fb7 = ({ padding: padding })=>({
380
- header: /*#__PURE__*/ (0, $5DxI1$css)({
381
- gridColumn: "content",
382
- gridRow: "header",
383
- marginBottom: (0, $5DxI1$contentfulf36tokens).spacingM
384
- }),
385
- root: /*#__PURE__*/ (0, $5DxI1$css)({
386
- padding: $2fcc945398035016$var$getCardPaddingValue(padding)
387
- })
388
- });
389
-
390
-
391
- function $cce5018d103477ad$var$_Card({ actions: actions , badge: badge , icon: icon , padding: padding = "default" , title: title , className: className , testId: testId = "cf-ui-card" , ...otherProps }, forwardedRef) {
392
- const styles = (0, $2fcc945398035016$export$164c3dc7db460fb7)({
393
- padding: padding
394
- });
395
- const hasHeader = Boolean(title || icon || badge || actions);
396
- return /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $58aab48c7cf09ac0$export$ffd8d1a491a618f2), {
397
- className: (0, $5DxI1$cx)(styles.root, className),
398
- ...otherProps,
399
- testId: testId,
400
- header: hasHeader && /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Flex), {
401
- alignItems: "center",
402
- className: (0, $5DxI1$cx)(styles.header)
403
- }, title && /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Flex), {
404
- as: "header",
405
- flexGrow: 1
406
- }, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Heading), {
407
- marginBottom: "none"
408
- }, title)), icon && /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Flex), {
409
- alignItems: "center",
410
- marginLeft: "spacingXs"
411
- }, icon), badge && /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Flex), {
412
- alignItems: "center",
413
- marginLeft: "spacingXs"
414
- }, badge), actions && /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $c83d23d1a559d33c$export$9b6a647253f61c5f), null, actions)),
415
- ref: forwardedRef
416
- });
417
- }
418
- $cce5018d103477ad$var$_Card.displayName = "Card";
419
- const $cce5018d103477ad$export$60332b2344f7fe41 = /*#__PURE__*/ (0, $5DxI1$forwardRef)($cce5018d103477ad$var$_Card);
420
-
421
-
422
-
423
-
424
-
425
-
426
-
427
-
428
-
429
-
430
-
431
-
432
- const $163f0b3a3660f6d4$export$25b6e8fb8b7b795b = ()=>{
433
- return {
434
- actionsButton: /*#__PURE__*/ (0, $5DxI1$css)({
435
- borderBottomLeftRadius: 0,
436
- borderBottomRightRadius: 0,
437
- borderTopLeftRadius: 0,
438
- borderTopRightRadius: (0, $5DxI1$contentfulf36tokens).borderRadiusMedium
439
- }),
440
- content: (size)=>/*#__PURE__*/ (0, $5DxI1$css)({
441
- gridColumn: "content",
442
- marginTop: size === "small" ? (0, $5DxI1$contentfulf36tokens).spacingXs : (0, $5DxI1$contentfulf36tokens).spacingS,
443
- marginBottom: size === "small" ? `calc(-1 * ${(0, $5DxI1$contentfulf36tokens).spacingXs})` : 0
444
- }),
445
- root: /*#__PURE__*/ (0, $5DxI1$css)({
446
- padding: 0,
447
- '[data-card-part="content"]': {
448
- paddingBottom: (0, $5DxI1$contentfulf36tokens).spacingM,
449
- paddingLeft: (0, $5DxI1$contentfulf36tokens).spacingM,
450
- paddingRight: (0, $5DxI1$contentfulf36tokens).spacingM
451
- }
452
- }),
453
- header: /*#__PURE__*/ (0, $5DxI1$css)({
454
- borderBottomWidth: 1,
455
- borderBottomColor: (0, $5DxI1$contentfulf36tokens).gray200,
456
- borderBottomStyle: "solid",
457
- minHeight: "auto",
458
- paddingBottom: (0, $5DxI1$contentfulf36tokens).spacingXs,
459
- paddingLeft: (0, $5DxI1$contentfulf36tokens).spacingM,
460
- paddingRight: (0, $5DxI1$contentfulf36tokens).spacingXs
461
- }),
462
- thumbnail: (size)=>/*#__PURE__*/ (0, $5DxI1$css)({
463
- margin: `0 0 0 ${(0, $5DxI1$contentfulf36tokens).spacingS}`,
464
- padding: 0,
465
- overflow: "hidden",
466
- position: "relative",
467
- img: {
468
- width: "100%",
469
- height: "100%",
470
- objectFit: "cover",
471
- position: "absolute",
472
- zIndex: 1
473
- },
474
- ...size === "small" ? {
475
- height: "40px",
476
- width: "40px"
477
- } : {
478
- height: "70px",
479
- width: "70px"
480
- }
481
- })
482
- };
483
- };
484
-
485
-
486
- const $b207f531c43dcc46$var$ENTRY_CARD_DEFAULT_TAG = "article";
487
- function $b207f531c43dcc46$var$EntryCardTitle({ title: title , titleTag: titleTag }) {
488
- if (!title) return null;
489
- const truncatedTitle = (0, $5DxI1$truncate)(title, 255, {});
490
- return /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Subheading), {
491
- title: title.length > 255 ? title : "",
492
- testId: "title",
493
- as: titleTag,
494
- marginBottom: "none",
495
- isWordBreak: true
496
- }, truncatedTitle);
497
- }
498
- $b207f531c43dcc46$var$EntryCardTitle.displayName = "EntryCardTitle";
499
- function $b207f531c43dcc46$var$EntryCardDescription({ description: description , size: size }) {
500
- if (!description || size === "small") return null;
501
- const truncatedDescription = (0, $5DxI1$truncate)(description, 95, {});
502
- return /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Paragraph), {
503
- marginBottom: "none",
504
- isWordBreak: true
505
- }, truncatedDescription);
506
- }
507
- $b207f531c43dcc46$var$EntryCardDescription.displayName = "EntryCardDescription";
508
- function $b207f531c43dcc46$var$_EntryCard({ actions: actions , children: children , className: className , src: src , status: status , thumbnailElement: thumbnailElement , description: description , withDragHandle: withDragHandle = false , title: title , titleTag: titleTag = "h2" , size: size , testId: testId = "cf-ui-entry-card" , contentType: contentType , ...otherProps }, forwardedRef) {
509
- const styles = (0, $163f0b3a3660f6d4$export$25b6e8fb8b7b795b)();
510
- const badge = status ? /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$EntityStatusBadge), {
511
- entityStatus: status
512
- }) : null;
513
- return /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $58aab48c7cf09ac0$export$ffd8d1a491a618f2), {
514
- as: $b207f531c43dcc46$var$ENTRY_CARD_DEFAULT_TAG,
515
- ...otherProps,
516
- actions: actions,
517
- badge: badge,
518
- className: (0, $5DxI1$cx)(styles.root, className),
519
- withDragHandle: withDragHandle,
520
- ref: forwardedRef,
521
- type: contentType,
522
- testId: testId
523
- }, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Flex), {
524
- alignItems: "center",
525
- className: styles.content(size),
526
- flexDirection: "row"
527
- }, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Flex), {
528
- flexDirection: "column",
529
- flexGrow: 1,
530
- gap: "spacingS"
531
- }, /*#__PURE__*/ (0, $5DxI1$react).createElement($b207f531c43dcc46$var$EntryCardTitle, {
532
- title: title,
533
- titleTag: titleTag
534
- }), /*#__PURE__*/ (0, $5DxI1$react).createElement($b207f531c43dcc46$var$EntryCardDescription, {
535
- size: size,
536
- description: description
537
- }), children), thumbnailElement && size !== "small" && /*#__PURE__*/ (0, $5DxI1$react).createElement("figure", {
538
- className: styles.thumbnail(size)
539
- }, thumbnailElement)));
540
- }
541
- $b207f531c43dcc46$var$_EntryCard.displayName = "EntryCard";
542
- const $b207f531c43dcc46$export$326973e3eb2dbf = /*#__PURE__*/ (0, $5DxI1$forwardRef)($b207f531c43dcc46$var$_EntryCard);
543
-
544
-
545
-
546
-
547
-
548
-
549
-
550
-
551
-
552
-
553
-
554
- const $7025bd74e0f685d1$export$ccfc6dbdba6183be = ()=>{
555
- return {
556
- actions: /*#__PURE__*/ (0, $5DxI1$css)({
557
- display: "flex",
558
- padding: 0,
559
- marginLeft: (0, $5DxI1$contentfulf36tokens).spacingXs,
560
- minHeight: "auto"
561
- }),
562
- root: ({ status: status })=>{
563
- const statusColors = (0, $5DxI1$getEntityStatusStyles)({
564
- status: status
565
- });
566
- return /*#__PURE__*/ (0, $5DxI1$css)({
567
- borderBottomLeftRadius: 0,
568
- borderTopLeftRadius: 0,
569
- display: "inline-flex",
570
- width: "auto",
571
- verticalAlign: "middle",
572
- paddingBottom: 0,
573
- paddingTop: 0,
574
- paddingLeft: (0, $5DxI1$contentfulf36tokens).spacingS,
575
- paddingRight: (0, $5DxI1$contentfulf36tokens).spacing2Xs,
576
- '[data-card-part="wrapper"]': {
577
- display: "inline-flex",
578
- flexDirection: "row-reverse"
579
- },
580
- "&::before": {
581
- backgroundColor: statusColors.color,
582
- bottom: 0,
583
- content: '""',
584
- display: "block",
585
- left: 0,
586
- position: "absolute",
587
- top: 0,
588
- width: (0, $5DxI1$contentfulf36tokens).spacing2Xs
589
- }
590
- });
591
- },
592
- skeleton: /*#__PURE__*/ (0, $5DxI1$css)({
593
- display: "inline-flex",
594
- border: `1px solid ${(0, $5DxI1$contentfulf36tokens).gray300}`,
595
- borderTopRightRadius: (0, $5DxI1$contentfulf36tokens).borderRadiusMedium,
596
- borderBottomRightRadius: (0, $5DxI1$contentfulf36tokens).borderRadiusMedium,
597
- padding: (0, $5DxI1$contentfulf36tokens).spacingXs
598
- })
599
- };
600
- };
601
-
602
-
603
-
604
-
605
- const $80460818031cae79$export$94c16395f9ec3265 = ({ actions: actions , className: className , children: children , status: status , title: title , isLoading: isLoading , testId: testId = "cf-ui-inline-entry-card" , ...otherProps })=>{
606
- const styles = (0, $7025bd74e0f685d1$export$ccfc6dbdba6183be)();
607
- const header = /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $c83d23d1a559d33c$export$9b6a647253f61c5f), {
608
- buttonProps: {
609
- className: styles.actions
610
- }
611
- }, actions);
612
- if (isLoading) return /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$SkeletonContainer), {
613
- className: styles.skeleton,
614
- svgHeight: "1.25rem",
615
- svgWidth: "6rem"
616
- }, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$SkeletonBodyText), {
617
- numberOfLines: 1
618
- }));
619
- return /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Tooltip), {
620
- placement: "bottom",
621
- content: title
622
- }, /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $58aab48c7cf09ac0$export$ffd8d1a491a618f2), {
623
- ...otherProps,
624
- className: (0, $5DxI1$cx)(styles.root({
625
- status: status
626
- }), className),
627
- header: header,
628
- testId: testId
629
- }, children || /*#__PURE__*/ (0, $5DxI1$react).createElement((0, $5DxI1$Text), null, title)));
630
- };
631
-
632
-
633
-
634
-
635
-
636
- export {$e5307476578213bc$export$eff93e4e59ccc3b8 as AssetCard, $cce5018d103477ad$export$60332b2344f7fe41 as Card, $b207f531c43dcc46$export$326973e3eb2dbf as EntryCard, $80460818031cae79$export$94c16395f9ec3265 as InlineEntryCard};
637
- //# sourceMappingURL=module.js.map