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