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