@sproutsocial/seeds-react-card 1.1.53 → 1.1.55
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/card.css +152 -0
- package/dist/esm/index.js +298 -74
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.mts +38 -6
- package/dist/index.d.ts +38 -6
- package/dist/index.js +293 -77
- package/dist/index.js.map +1 -1
- package/package.json +23 -12
- package/.eslintignore +0 -6
- package/.eslintrc.js +0 -4
- package/.turbo/turbo-build.log +0 -21
- package/CHANGELOG.md +0 -399
- package/jest.config.js +0 -9
- package/src/Card.feature +0 -122
- package/src/Card.stories.tsx +0 -389
- package/src/Card.tsx +0 -87
- package/src/CardTypes.ts +0 -133
- package/src/__tests__/Card.test.tsx +0 -313
- package/src/__tests__/CardTypes.typetest.tsx +0 -78
- package/src/index.ts +0 -6
- package/src/styles.tsx +0 -176
- package/src/subComponents.tsx +0 -110
- package/src/utils.ts +0 -61
- package/tsconfig.json +0 -15
- package/tsup.config.ts +0 -12
package/dist/index.js
CHANGED
|
@@ -40,7 +40,15 @@ __export(index_exports, {
|
|
|
40
40
|
module.exports = __toCommonJS(index_exports);
|
|
41
41
|
|
|
42
42
|
// src/Card.tsx
|
|
43
|
-
var
|
|
43
|
+
var import_react7 = __toESM(require("react"));
|
|
44
|
+
|
|
45
|
+
// src/CardHybrid.tsx
|
|
46
|
+
var import_react6 = __toESM(require("react"));
|
|
47
|
+
var import_seeds_react_system_props2 = require("@sproutsocial/seeds-react-system-props");
|
|
48
|
+
|
|
49
|
+
// src/CardStyled.tsx
|
|
50
|
+
var import_react4 = __toESM(require("react"));
|
|
51
|
+
var import_seeds_react_utilities2 = require("@sproutsocial/seeds-react-utilities");
|
|
44
52
|
|
|
45
53
|
// src/styles.tsx
|
|
46
54
|
var import_styled_components = __toESM(require("styled-components"));
|
|
@@ -182,6 +190,9 @@ var StyledCardAffordance = (0, import_styled_components.default)(import_seeds_re
|
|
|
182
190
|
transition: ${(p) => p.theme.duration.medium};
|
|
183
191
|
`;
|
|
184
192
|
|
|
193
|
+
// src/useCardBehavior.ts
|
|
194
|
+
var import_react2 = require("react");
|
|
195
|
+
|
|
185
196
|
// src/utils.ts
|
|
186
197
|
var import_react = require("react");
|
|
187
198
|
var import_seeds_react_utilities = require("@sproutsocial/seeds-react-utilities");
|
|
@@ -221,46 +232,147 @@ var onKeyDown = ({ e, href, onClick, ref, role }) => {
|
|
|
221
232
|
}
|
|
222
233
|
};
|
|
223
234
|
|
|
235
|
+
// src/useCardBehavior.ts
|
|
236
|
+
function useCardBehavior({
|
|
237
|
+
disabled: disabled2 = false,
|
|
238
|
+
href,
|
|
239
|
+
onClick,
|
|
240
|
+
role = "presentation",
|
|
241
|
+
selected
|
|
242
|
+
}) {
|
|
243
|
+
const [hasSubComponent, setHasSubComponent] = (0, import_react2.useState)(false);
|
|
244
|
+
const containerRef = (0, import_react2.useRef)(null);
|
|
245
|
+
const linkRef = (0, import_react2.useRef)(null);
|
|
246
|
+
const isRoleLink = role === "link";
|
|
247
|
+
const isRolePresentation = role === "presentation";
|
|
248
|
+
const checkedConditions = role === "checkbox" ? selected : void 0;
|
|
249
|
+
const cardContext = {
|
|
250
|
+
setHasSubComponent,
|
|
251
|
+
href,
|
|
252
|
+
linkRef
|
|
253
|
+
};
|
|
254
|
+
const handleClickConditions = (e) => isRoleLink ? linkRef.current?.click() : onClick?.(e);
|
|
255
|
+
const handleKeyDown = (e) => onKeyDown({ e, href, onClick, ref: containerRef, role });
|
|
256
|
+
const shouldBeInteractive = !isRolePresentation && !disabled2;
|
|
257
|
+
const containerProps = {
|
|
258
|
+
tabIndex: isRoleLink || isRolePresentation || disabled2 ? -1 : 0,
|
|
259
|
+
role: isRoleLink ? void 0 : role,
|
|
260
|
+
onClick: shouldBeInteractive ? handleClickConditions : void 0,
|
|
261
|
+
onKeyDown: shouldBeInteractive ? handleKeyDown : void 0,
|
|
262
|
+
"aria-checked": checkedConditions,
|
|
263
|
+
"aria-disabled": disabled2 && disabled2
|
|
264
|
+
};
|
|
265
|
+
return {
|
|
266
|
+
containerRef,
|
|
267
|
+
linkRef,
|
|
268
|
+
cardContext,
|
|
269
|
+
hasSubComponent,
|
|
270
|
+
isRoleLink,
|
|
271
|
+
SubComponentContext,
|
|
272
|
+
containerProps
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
|
|
224
276
|
// src/subComponents.tsx
|
|
225
|
-
var
|
|
277
|
+
var import_react3 = require("react");
|
|
278
|
+
var import_seeds_react_system_props = require("@sproutsocial/seeds-react-system-props");
|
|
279
|
+
var import_seeds_react_icon2 = __toESM(require("@sproutsocial/seeds-react-icon"));
|
|
226
280
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
281
|
+
function cn(...inputs) {
|
|
282
|
+
const classes = [];
|
|
283
|
+
for (const input of inputs) {
|
|
284
|
+
if (!input) continue;
|
|
285
|
+
if (typeof input === "string") {
|
|
286
|
+
classes.push(input);
|
|
287
|
+
} else if (typeof input === "object") {
|
|
288
|
+
for (const [key, value] of Object.entries(input)) {
|
|
289
|
+
if (value) {
|
|
290
|
+
classes.push(key);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return classes.join(" ");
|
|
296
|
+
}
|
|
297
|
+
function needsStyled(props) {
|
|
298
|
+
return (0, import_seeds_react_system_props.hasStyledProps)(props) || (0, import_seeds_react_system_props.hasBorderProps)(props) || (0, import_seeds_react_system_props.isStyledExtension)(props);
|
|
299
|
+
}
|
|
300
|
+
var CardContent = (props) => {
|
|
231
301
|
useChildContext();
|
|
232
|
-
|
|
302
|
+
const { children, className, ...rest } = props;
|
|
303
|
+
if (needsStyled(props)) {
|
|
304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledCardContent, { ...rest, className, children });
|
|
305
|
+
}
|
|
306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
307
|
+
"div",
|
|
308
|
+
{
|
|
309
|
+
...rest,
|
|
310
|
+
className: cn("seeds-card-content", className),
|
|
311
|
+
children
|
|
312
|
+
}
|
|
313
|
+
);
|
|
233
314
|
};
|
|
234
|
-
var CardHeader = ({
|
|
235
|
-
children,
|
|
236
|
-
...rest
|
|
237
|
-
}) => {
|
|
315
|
+
var CardHeader = (props) => {
|
|
238
316
|
useChildContext();
|
|
239
|
-
|
|
317
|
+
const { children, className, ...rest } = props;
|
|
318
|
+
if (needsStyled(props)) {
|
|
319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledCardHeader, { ...rest, className, children });
|
|
320
|
+
}
|
|
321
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
322
|
+
"div",
|
|
323
|
+
{
|
|
324
|
+
...rest,
|
|
325
|
+
className: cn("seeds-card-header", className),
|
|
326
|
+
children
|
|
327
|
+
}
|
|
328
|
+
);
|
|
240
329
|
};
|
|
241
|
-
var CardFooter = ({
|
|
242
|
-
children,
|
|
243
|
-
...rest
|
|
244
|
-
}) => {
|
|
330
|
+
var CardFooter = (props) => {
|
|
245
331
|
useChildContext();
|
|
246
|
-
|
|
332
|
+
const { children, className, ...rest } = props;
|
|
333
|
+
if (needsStyled(props)) {
|
|
334
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StyledCardFooter, { ...rest, className, children });
|
|
335
|
+
}
|
|
336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
337
|
+
"div",
|
|
338
|
+
{
|
|
339
|
+
...rest,
|
|
340
|
+
className: cn("seeds-card-footer", className),
|
|
341
|
+
children
|
|
342
|
+
}
|
|
343
|
+
);
|
|
247
344
|
};
|
|
248
345
|
var SelectedIcon = ({ $selected }) => {
|
|
249
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
250
|
-
|
|
346
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "seeds-card-selected-icon-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
347
|
+
import_seeds_react_icon2.default,
|
|
251
348
|
{
|
|
252
349
|
"aria-hidden": true,
|
|
253
350
|
color: "icon.base",
|
|
254
351
|
name: "circle-check-solid",
|
|
255
|
-
|
|
352
|
+
className: cn("seeds-card-selected-icon", {
|
|
353
|
+
"seeds-card-selected-icon-visible": !!$selected
|
|
354
|
+
})
|
|
256
355
|
}
|
|
257
356
|
) });
|
|
258
357
|
};
|
|
259
|
-
var CardAffordance = ({ ...rest }) => {
|
|
358
|
+
var CardAffordance = ({ className, ...rest }) => {
|
|
359
|
+
if (needsStyled(rest) || (0, import_seeds_react_system_props.isStyledExtension)({ className })) {
|
|
360
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
361
|
+
StyledCardAffordance,
|
|
362
|
+
{
|
|
363
|
+
...rest,
|
|
364
|
+
className,
|
|
365
|
+
size: "mini",
|
|
366
|
+
name: "arrow-right-solid",
|
|
367
|
+
"aria-hidden": true
|
|
368
|
+
}
|
|
369
|
+
);
|
|
370
|
+
}
|
|
260
371
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
261
|
-
|
|
372
|
+
import_seeds_react_icon2.default,
|
|
262
373
|
{
|
|
263
374
|
...rest,
|
|
375
|
+
className: cn("seeds-card-affordance", className),
|
|
264
376
|
size: "mini",
|
|
265
377
|
name: "arrow-right-solid",
|
|
266
378
|
"aria-hidden": true
|
|
@@ -272,83 +384,187 @@ var CardLink = ({
|
|
|
272
384
|
children,
|
|
273
385
|
external = false,
|
|
274
386
|
color: color2,
|
|
387
|
+
className,
|
|
275
388
|
...rest
|
|
276
389
|
}) => {
|
|
277
|
-
const { href, linkRef } = (0,
|
|
390
|
+
const { href, linkRef } = (0, import_react3.useContext)(SubComponentContext);
|
|
278
391
|
const handleClick = (e) => {
|
|
279
392
|
e.stopPropagation();
|
|
280
393
|
};
|
|
394
|
+
const sharedProps = {
|
|
395
|
+
target: external ? "_blank" : void 0,
|
|
396
|
+
rel: external ? "noreferrer" : void 0,
|
|
397
|
+
href,
|
|
398
|
+
onClick: handleClick
|
|
399
|
+
};
|
|
400
|
+
if (color2 !== void 0 || (0, import_seeds_react_system_props.hasStyledProps)(rest) || (0, import_seeds_react_system_props.hasBorderProps)(rest) || (0, import_seeds_react_system_props.isStyledExtension)({ ...rest, className })) {
|
|
401
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
402
|
+
StyledCardLink,
|
|
403
|
+
{
|
|
404
|
+
...rest,
|
|
405
|
+
...sharedProps,
|
|
406
|
+
ref: linkRef,
|
|
407
|
+
className,
|
|
408
|
+
color: color2,
|
|
409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
410
|
+
children,
|
|
411
|
+
affordance ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardAffordance, { ml: 300 }) : null
|
|
412
|
+
] })
|
|
413
|
+
}
|
|
414
|
+
);
|
|
415
|
+
}
|
|
281
416
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
282
|
-
|
|
417
|
+
"a",
|
|
283
418
|
{
|
|
284
419
|
...rest,
|
|
285
|
-
|
|
286
|
-
rel: external ? "noreferrer" : void 0,
|
|
287
|
-
href,
|
|
288
|
-
onClick: handleClick,
|
|
420
|
+
...sharedProps,
|
|
289
421
|
ref: linkRef,
|
|
290
|
-
|
|
422
|
+
className: cn("seeds-card-link", className),
|
|
291
423
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
292
424
|
children,
|
|
293
|
-
affordance ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardAffordance, {
|
|
425
|
+
affordance ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardAffordance, { className: "ml-300" }) : null
|
|
294
426
|
] })
|
|
295
427
|
}
|
|
296
428
|
);
|
|
297
429
|
};
|
|
298
430
|
|
|
299
|
-
// src/
|
|
431
|
+
// src/CardStyled.tsx
|
|
300
432
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
301
|
-
var
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
onClick,
|
|
307
|
-
role = "presentation",
|
|
308
|
-
selected,
|
|
309
|
-
...rest
|
|
310
|
-
}) => {
|
|
311
|
-
const [hasSubComponent, setHasSubComponent] = (0, import_react3.useState)(false);
|
|
312
|
-
const containerRef = (0, import_react3.useRef)(null);
|
|
313
|
-
const linkRef = (0, import_react3.useRef)(null);
|
|
314
|
-
const isRoleLink = role === "link";
|
|
315
|
-
const isRolePresentation = role === "presentation";
|
|
316
|
-
const checkedConditions = role === "checkbox" ? selected : void 0;
|
|
317
|
-
const cardContext = {
|
|
318
|
-
setHasSubComponent,
|
|
433
|
+
var CardStyled = import_react4.default.forwardRef(
|
|
434
|
+
({
|
|
435
|
+
children,
|
|
436
|
+
disabled: disabled2 = false,
|
|
437
|
+
elevation = "low",
|
|
319
438
|
href,
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
439
|
+
onClick,
|
|
440
|
+
role = "presentation",
|
|
441
|
+
selected,
|
|
442
|
+
...rest
|
|
443
|
+
}, ref) => {
|
|
444
|
+
const {
|
|
445
|
+
containerRef,
|
|
446
|
+
cardContext,
|
|
447
|
+
hasSubComponent,
|
|
448
|
+
isRoleLink,
|
|
449
|
+
SubComponentContext: SubComponentContext2,
|
|
450
|
+
containerProps
|
|
451
|
+
} = useCardBehavior({ disabled: disabled2, href, onClick, role, selected });
|
|
452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
453
|
+
StyledCard,
|
|
454
|
+
{
|
|
455
|
+
...containerProps,
|
|
456
|
+
$elevation: elevation,
|
|
457
|
+
ref: (0, import_seeds_react_utilities2.mergeRefs)(containerRef, ref),
|
|
458
|
+
$selected: selected,
|
|
459
|
+
$disabled: disabled2,
|
|
460
|
+
$compositionalComponents: hasSubComponent,
|
|
461
|
+
$isRoleLink: isRoleLink,
|
|
462
|
+
...rest,
|
|
463
|
+
children: [
|
|
464
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SelectedIcon, { $selected: selected }),
|
|
465
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SubComponentContext2.Provider, { value: cardContext, children })
|
|
466
|
+
]
|
|
467
|
+
}
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
);
|
|
471
|
+
CardStyled.displayName = "Card";
|
|
472
|
+
var CardStyled_default = CardStyled;
|
|
473
|
+
|
|
474
|
+
// src/CardTailwind.tsx
|
|
475
|
+
var import_react5 = __toESM(require("react"));
|
|
476
|
+
var import_seeds_react_utilities3 = require("@sproutsocial/seeds-react-utilities");
|
|
477
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
478
|
+
function cn2(...inputs) {
|
|
479
|
+
const classes = [];
|
|
480
|
+
for (const input of inputs) {
|
|
481
|
+
if (!input) continue;
|
|
482
|
+
if (typeof input === "string") {
|
|
483
|
+
classes.push(input);
|
|
484
|
+
} else if (typeof input === "object") {
|
|
485
|
+
for (const [key, value] of Object.entries(input)) {
|
|
486
|
+
if (value) {
|
|
487
|
+
classes.push(key);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
345
490
|
}
|
|
346
|
-
|
|
347
|
-
|
|
491
|
+
}
|
|
492
|
+
return classes.join(" ");
|
|
493
|
+
}
|
|
494
|
+
var CardTailwind = import_react5.default.forwardRef(
|
|
495
|
+
({
|
|
496
|
+
children,
|
|
497
|
+
className,
|
|
498
|
+
disabled: disabled2 = false,
|
|
499
|
+
elevation = "low",
|
|
500
|
+
href,
|
|
501
|
+
onClick,
|
|
502
|
+
role = "presentation",
|
|
503
|
+
selected,
|
|
504
|
+
...rest
|
|
505
|
+
}, ref) => {
|
|
506
|
+
const {
|
|
507
|
+
containerRef,
|
|
508
|
+
cardContext,
|
|
509
|
+
hasSubComponent,
|
|
510
|
+
isRoleLink,
|
|
511
|
+
SubComponentContext: SubComponentContext2,
|
|
512
|
+
containerProps
|
|
513
|
+
} = useCardBehavior({ disabled: disabled2, href, onClick, role, selected });
|
|
514
|
+
const classes = cn2(
|
|
515
|
+
"seeds-card",
|
|
516
|
+
{
|
|
517
|
+
"seeds-card-interactive": isRoleLink || role === "button" || role === "checkbox",
|
|
518
|
+
"seeds-card-link-role": isRoleLink
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
"seeds-card-selected": !!selected,
|
|
522
|
+
"seeds-card-disabled": disabled2,
|
|
523
|
+
"seeds-card-compositional": hasSubComponent
|
|
524
|
+
},
|
|
525
|
+
className
|
|
526
|
+
);
|
|
527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
528
|
+
"div",
|
|
529
|
+
{
|
|
530
|
+
...containerProps,
|
|
531
|
+
...rest,
|
|
532
|
+
ref: (0, import_seeds_react_utilities3.mergeRefs)(containerRef, ref),
|
|
533
|
+
className: classes,
|
|
534
|
+
style: {
|
|
535
|
+
"--seeds-card-hover-shadow": `var(--shadow-${elevation})`
|
|
536
|
+
},
|
|
537
|
+
children: [
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SelectedIcon, { $selected: selected }),
|
|
539
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SubComponentContext2.Provider, { value: cardContext, children })
|
|
540
|
+
]
|
|
541
|
+
}
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
);
|
|
545
|
+
CardTailwind.displayName = "CardTailwind";
|
|
546
|
+
|
|
547
|
+
// src/CardHybrid.tsx
|
|
548
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
549
|
+
var CardHybrid = import_react6.default.forwardRef(
|
|
550
|
+
(props, ref) => {
|
|
551
|
+
if ((0, import_seeds_react_system_props2.hasStyledProps)(props) || (0, import_seeds_react_system_props2.hasBorderProps)(props) || (0, import_seeds_react_system_props2.isStyledExtension)(props)) {
|
|
552
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CardStyled_default, { ...props, ref });
|
|
553
|
+
}
|
|
554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CardTailwind, { ...props, ref });
|
|
555
|
+
}
|
|
556
|
+
);
|
|
557
|
+
CardHybrid.displayName = "Card";
|
|
558
|
+
var CardHybrid_default = CardHybrid;
|
|
559
|
+
|
|
560
|
+
// src/Card.tsx
|
|
561
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
562
|
+
var Card = import_react7.default.forwardRef((props, ref) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CardHybrid_default, { ...props, ref }));
|
|
563
|
+
Card.displayName = "Card";
|
|
348
564
|
var Card_default = Card;
|
|
349
565
|
|
|
350
566
|
// src/CardTypes.ts
|
|
351
|
-
var
|
|
567
|
+
var React7 = require("react");
|
|
352
568
|
|
|
353
569
|
// src/index.ts
|
|
354
570
|
var index_default = Card_default;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/Card.tsx","../src/styles.tsx","../src/utils.ts","../src/subComponents.tsx","../src/CardTypes.ts"],"sourcesContent":["import Card from \"./Card\";\n\nexport default Card;\nexport { Card };\nexport { CardHeader, CardContent, CardFooter, CardLink } from \"./subComponents\";\nexport * from \"./CardTypes\";\n","import React, { useRef, useState } from \"react\";\nimport { StyledCard } from \"./styles\";\nimport type { TypeCardProps, TypeCardContext } from \"./CardTypes\";\nimport { SubComponentContext, onKeyDown } from \"./utils\";\nimport { SelectedIcon } from \"./subComponents\";\n\n/**\n * @link https://seeds.sproutsocial.com/components/card/\n *\n * Cards with role='presentation' are non-interactive for accessibility compliance.\n * Use role='button' for interactive Cards.\n *\n * Avoid nesting interactive content inside a Card with role='button'.\n *\n * Interactive content: \"a\", \"audio\", \"button\", \"embed\", \"iframe\", \"img\", \"input\", \"label\", \"select\", \"textarea\", \"video\"\n * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content\n *\n * @example\n * // Interactive Card\n * <Card role=\"button\" onClick={_onClick}>\n * <Text>Click this card</Text>\n * </Card>\n *\n * @example\n * // Presentation Card with interactive children\n * <Card role=\"presentation\">\n * <Text>This card is not interactive</Text>\n * <Link href=\"/details\">But this link is</Link>\n * </Card>\n */\n\nconst Card = ({\n children,\n disabled = false,\n elevation = \"low\",\n href,\n onClick,\n role = \"presentation\",\n selected,\n ...rest\n}: TypeCardProps) => {\n const [hasSubComponent, setHasSubComponent] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const linkRef = useRef<HTMLAnchorElement>(null);\n const isRoleLink = role === \"link\";\n const isRolePresentation = role === \"presentation\";\n const checkedConditions = role === \"checkbox\" ? selected : undefined;\n\n const cardContext: TypeCardContext = {\n setHasSubComponent: setHasSubComponent,\n href: href,\n linkRef: linkRef,\n };\n\n const handleClickConditions: React.MouseEventHandler = (e) =>\n isRoleLink ? linkRef.current?.click() : onClick?.(e);\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (e) =>\n onKeyDown({ e, href, onClick, ref: containerRef, role });\n\n const shouldBeInteractive = !isRolePresentation && !disabled;\n\n return (\n <StyledCard\n tabIndex={isRoleLink || isRolePresentation || disabled ? -1 : 0}\n role={isRoleLink ? undefined : role}\n onClick={shouldBeInteractive ? handleClickConditions : undefined}\n onKeyDown={shouldBeInteractive ? handleKeyDown : undefined}\n $elevation={elevation}\n ref={containerRef}\n $selected={selected}\n aria-checked={checkedConditions}\n $disabled={disabled}\n aria-disabled={disabled && disabled}\n $compositionalComponents={hasSubComponent}\n $isRoleLink={isRoleLink}\n {...rest}\n >\n <SelectedIcon $selected={selected} />\n <SubComponentContext.Provider value={cardContext}>\n {children}\n </SubComponentContext.Provider>\n </StyledCard>\n );\n};\n\nexport default Card;\n","import styled from \"styled-components\";\nimport {\n border,\n color,\n flexbox,\n grid,\n layout,\n position,\n space,\n typography,\n} from \"styled-system\";\nimport { focusRing, disabled } from \"@sproutsocial/seeds-react-mixins\";\nimport type {\n TypeStyledCard,\n TypeCardArea,\n TypeStyledSelectedIcon,\n TypeCardLink,\n} from \"./CardTypes\";\nimport Icon from \"@sproutsocial/seeds-react-icon\";\n\n// TODO: Would be really cool to cherry pick specific props from style functions. For example,\n// removing the css prop 'color' from the color function or importing just the specific\n// props the component needs. It appears to be possible with some and not others.\n// https://github.com/styled-system/styled-system/issues/1569\n\nexport const StyledCardContent = styled.div<TypeCardArea>`\n display: flex;\n flex-direction: column;\n padding: ${({ theme }) => theme.space[400]};\n box-sizing: border-box;\n\n ${border}\n ${color}\n ${flexbox}\n ${grid}\n ${layout}\n ${space}\n`;\n\nexport const StyledCardHeader = styled(StyledCardContent)`\n flex-direction: row;\n border-bottom: ${({ theme }) => `${theme.borderWidths[500]} solid\n ${theme.colors.container.border.base}`};\n border-top-left-radius: ${({ theme }) => theme.radii.inner};\n border-top-right-radius: ${({ theme }) => theme.radii.inner};\n\n ${border}\n ${color}\n ${flexbox}\n ${grid}\n ${layout}\n ${space}\n`;\n\nexport const StyledCardFooter = styled(StyledCardContent)`\n flex-direction: row;\n border-top: ${({ theme }) => `${theme.borderWidths[500]} solid\n ${theme.colors.container.border.base}`};\n border-bottom-left-radius: ${({ theme }) => theme.radii.inner};\n border-bottom-right-radius: ${({ theme }) => theme.radii.inner};\n\n ${border}\n ${color}\n ${flexbox}\n ${grid}\n ${layout}\n ${space}\n`;\n\nexport const SelectedIconWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: -8px;\n right: -8px;\n`;\n\nexport const StyledSelectedIcon = styled(Icon)<TypeStyledSelectedIcon>`\n border-radius: 50%;\n background: ${({ theme }) => theme.colors.container.background.base};\n opacity: 0;\n transition: opacity ${({ theme }) => theme.duration.medium};\n\n ${({ $selected }) =>\n $selected &&\n `\n opacity: 1;\n `}\n`;\n\nexport const StyledCardLink = styled.a<TypeCardLink>`\n font-family: ${(p) => p.theme.fontFamily};\n font-weight: ${(p) => p.theme.fontWeights.bold};\n color: ${(p) => p.theme.colors.text.headline};\n ${(p) => p.theme.typography[400]};\n\n ${color}\n ${typography}\n`;\n\nexport const StyledCard = styled.div<TypeStyledCard>`\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n margin: 0;\n background: ${({ theme }) => theme.colors.container.background.base};\n border: ${({ theme }) => theme.borderWidths[500]} solid\n ${({ theme }) => theme.colors.container.border.base};\n padding: ${({ theme, $compositionalComponents }) =>\n $compositionalComponents ? 0 : theme.space[400]};\n border-radius: ${({ theme }) => theme.radii.outer};\n transition: box-shadow ${({ theme }) => theme.duration.medium},\n border ${({ theme }) => theme.duration.medium};\n\n &[role=\"button\"],\n &[role=\"checkbox\"] {\n cursor: pointer;\n\n &:hover {\n box-shadow: ${({ theme, $elevation = \"low\" }) =>\n theme.shadows[$elevation]};\n }\n }\n\n ${({ $isRoleLink, theme, $elevation = \"low\" }) =>\n $isRoleLink &&\n `\n\t\tcursor: pointer;\n\n &:hover {\n box-shadow: ${theme.shadows[$elevation]};\n }\n\t`}\n\n &:focus-within {\n ${({ $isRoleLink }) => ($isRoleLink ? focusRing : null)}\n ${StyledCardLink}:focus {\n border: none;\n box-shadow: none;\n outline: none;\n }\n }\n\n &:focus {\n ${focusRing}\n }\n\n ${({ $disabled }) =>\n $disabled &&\n `\n ${disabled}\n `}\n\n ${({ $selected, theme }) =>\n $selected &&\n `\n border: ${theme.borderWidths[500]} solid ${theme.colors.container.border.selected}; \n `}\n\n ${border}\n ${color}\n ${flexbox}\n ${grid}\n ${layout}\n ${position}\n ${space}\n`;\n\nexport const StyledCardAffordance = styled(Icon)`\n ${StyledCard}:hover & {\n transform: translateX(${(p) => p.theme.space[200]});\n }\n transition: ${(p) => p.theme.duration.medium};\n`;\n","import { createContext, useContext, useEffect } from \"react\";\nimport { assertIsElement } from \"@sproutsocial/seeds-react-utilities\";\nimport type { TypeCardProps, TypeCardContext } from \"./CardTypes\";\n\nexport const SubComponentContext = createContext<TypeCardContext>({\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setHasSubComponent: () => {},\n href: \"\",\n linkRef: null,\n});\n\nexport function useChildContext() {\n const { setHasSubComponent } = useContext(SubComponentContext);\n useEffect(() => {\n setHasSubComponent && setHasSubComponent(true);\n }, [setHasSubComponent]);\n}\n\ninterface navigateToParams extends Pick<TypeCardProps, \"href\"> {\n e: React.MouseEvent | React.KeyboardEvent;\n ref: React.RefObject<HTMLDivElement>;\n}\n\nexport const navigateTo = ({ e, href, ref }: navigateToParams) => {\n const { target } = e;\n\n // asserts that target is an element so `contains` accepts it\n assertIsElement(target);\n\n if (ref.current?.contains(target)) {\n if (\n target.getAttribute(\"onclick\") !== null ||\n target.getAttribute(\"href\") !== null\n ) {\n e.stopPropagation();\n return;\n }\n }\n\n window.open(href, \"_blank\")?.focus();\n};\n\ninterface onKeyDownParams\n extends Pick<TypeCardProps, \"href\" | \"onClick\" | \"role\"> {\n e: React.KeyboardEvent;\n ref: React.RefObject<HTMLDivElement>;\n}\n\nexport const onKeyDown = ({ e, href, onClick, ref, role }: onKeyDownParams) => {\n if (e?.key === \"Enter\") {\n if (role === \"link\") {\n return navigateTo({ e, href, ref });\n }\n\n if (role === \"presentation\") {\n return;\n }\n\n return onClick?.(e);\n }\n};\n","import React, { useContext } from \"react\";\nimport { useChildContext, SubComponentContext } from \"./utils\";\nimport type {\n TypeCardLink,\n TypeSharedCardSystemProps,\n TypeStyledSelectedIcon,\n} from \"./CardTypes\";\nimport {\n StyledCardContent,\n StyledCardHeader,\n StyledCardFooter,\n StyledSelectedIcon,\n SelectedIconWrapper,\n StyledCardAffordance,\n StyledCardLink,\n} from \"./styles\";\n\ninterface TypeSharedSubComponentProps extends TypeSharedCardSystemProps {\n children?: React.ReactNode;\n}\n\nexport const CardContent = ({\n children,\n ...rest\n}: TypeSharedSubComponentProps) => {\n // TODO: It could be cool to possibly adjust the context to include an array of names of child components.\n // Then, if CardHeader or CardFooter aren't used with CardContent throw an error.\n useChildContext();\n return <StyledCardContent {...rest}>{children}</StyledCardContent>;\n};\n\nexport const CardHeader = ({\n children,\n ...rest\n}: TypeSharedSubComponentProps) => {\n useChildContext();\n return <StyledCardHeader {...rest}>{children}</StyledCardHeader>;\n};\n\nexport const CardFooter = ({\n children,\n ...rest\n}: TypeSharedSubComponentProps) => {\n useChildContext();\n return <StyledCardFooter {...rest}>{children}</StyledCardFooter>;\n};\n\ninterface TypeSelectedIconProps {\n $selected?: TypeStyledSelectedIcon[\"$selected\"];\n}\n\nexport const SelectedIcon = ({ $selected }: TypeSelectedIconProps) => {\n return (\n <SelectedIconWrapper>\n <StyledSelectedIcon\n aria-hidden\n color=\"icon.base\"\n name=\"circle-check-solid\"\n $selected={$selected}\n />\n </SelectedIconWrapper>\n );\n};\n\nexport const CardAffordance = ({ ...rest }) => {\n return (\n <StyledCardAffordance\n {...rest}\n size=\"mini\"\n name=\"arrow-right-solid\"\n // TODO: probably need to make this available to the top level for external links https://sprout.atlassian.net/browse/DS-2223\n aria-hidden\n />\n );\n};\n\nexport const CardLink = ({\n affordance,\n children,\n external = false,\n color,\n ...rest\n}: React.PropsWithChildren<TypeCardLink>) => {\n const { href, linkRef } = useContext(SubComponentContext);\n\n // Because we are hijacking Card click event to directly click this link, we need to stop propagation to avoid a double click event.\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n e.stopPropagation();\n };\n\n return (\n <StyledCardLink\n {...rest}\n target={external ? \"_blank\" : undefined}\n rel={external ? \"noreferrer\" : undefined}\n href={href}\n onClick={handleClick}\n ref={linkRef}\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n >\n <>\n {children}\n {affordance ? <CardAffordance ml={300} /> : null}\n </>\n </StyledCardLink>\n );\n};\n","import type { TypeIconProps } from \"@sproutsocial/seeds-react-icon\";\nimport * as React from \"react\";\nimport type { TypeStyledComponentsCommonProps } from \"@sproutsocial/seeds-react-system-props\";\nimport type {\n TypeBorderSystemProps,\n TypeColorSystemProps,\n TypeFlexboxSystemProps,\n TypeGridSystemProps,\n TypeLayoutSystemProps,\n TypePositionSystemProps,\n TypeSpaceSystemProps,\n TypeTypographySystemProps,\n} from \"@sproutsocial/seeds-react-system-props\";\n\nexport interface TypeSharedCardSystemProps\n extends Omit<React.ComponentPropsWithoutRef<\"div\">, \"color\">,\n TypeStyledComponentsCommonProps,\n TypeBorderSystemProps,\n TypeColorSystemProps,\n TypeFlexboxSystemProps,\n TypeGridSystemProps,\n TypeLayoutSystemProps,\n TypePositionSystemProps,\n TypeSpaceSystemProps {}\n\n// consumer facing props that affect the styles of the component. We need to define these first so the user doesn't see our transient naming conventions.\nexport interface TypeCardStyleProps {\n elevation?: \"low\" | \"medium\" | \"high\";\n disabled?: boolean;\n compositionalComponents?: boolean;\n selected?: boolean;\n isRoleLink?: boolean;\n}\n\n// Since we only want to manage the style props in one place(above), we'll use this generic to prepend the properties of TypeCardStyleProps with $.\nexport type TypeStyleTransientProps<T> = {\n [K in Extract<keyof T, string> as `$${K}`]: T[K];\n};\n\nexport type TypeCardStyleTransientProps =\n TypeStyleTransientProps<TypeCardStyleProps>;\n\nexport interface TypeStyledCard\n extends TypeSharedCardSystemProps,\n TypeCardStyleTransientProps {}\n\nexport interface TypeCardStyles\n extends TypeSharedCardSystemProps,\n Omit<TypeCardStyleProps, \"compositionalComponents\"> {}\n\ntype TypeOnClick = (event: React.MouseEvent | React.KeyboardEvent) => void;\n\ntype TypeGenericCard = {\n /** role is used for to set accessibility properties,\n * to determine styling and interaction behavior,\n * and to determine which props should be allowed.*/\n role: \"link\" | \"button\" | \"checkbox\" | \"presentation\";\n /** When role is link, use href to determine the link destination.\n * Required for role=\"link\", disallowed for all other roles */\n href?: string;\n /** Required for role=\"button\" and role=\"checkbox\",\n * discouraged for role=\"presentation\", and disallowed for role=\"link\" */\n onClick?: TypeOnClick;\n /** Indicates whether the card is selected.\n * Required for role=\"checkbox\", disallowed for all other roles */\n selected?: boolean;\n};\n\nexport type TypeLinkCardProps = {\n role: \"link\";\n href: string;\n onClick?: never;\n selected?: never;\n};\n\nexport type TypeButtonCardProps = {\n role: \"button\";\n href?: never;\n onClick: TypeOnClick;\n selected?: never;\n};\n\nexport type TypeCheckboxCardProps = {\n role: \"checkbox\";\n href?: never;\n onClick: TypeOnClick;\n selected: boolean;\n};\n\nexport type TypePresentationCardProps = {\n role: \"presentation\";\n href?: never;\n /**\n * **Not supported for accessibility:**\n * `role='presentation'` removes the element from the accessibility tree.\n * Presentation Cards do not support `onClick` handlers or keyboard interactions.\n * Use `role='button'` for interactive Cards instead.\n */\n onClick?: never;\n selected?: never;\n};\n\nexport type TypeCardConditions =\n | TypeLinkCardProps\n | TypeButtonCardProps\n | TypeCheckboxCardProps\n | TypePresentationCardProps;\n\nexport type TypeCardProps = React.PropsWithChildren<TypeCardStyles> &\n TypeGenericCard &\n TypeCardConditions;\n\nexport interface TypeCardArea extends TypeSharedCardSystemProps {\n $divider?: \"top\" | \"bottom\";\n}\n\nexport interface TypeStyledSelectedIcon extends TypeIconProps {\n $selected?: TypeCardStyleTransientProps[\"$selected\"];\n}\n\nexport interface TypeCardContext {\n setHasSubComponent?: React.Dispatch<React.SetStateAction<boolean>>;\n href?: string;\n linkRef: React.RefObject<HTMLAnchorElement> | null;\n}\n\nexport interface TypeCardLink\n extends Omit<React.ComponentPropsWithoutRef<\"a\">,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UAAU,EAAE,GAAG,MAAM,SAAS,KAAK,cAAc,KAAK,CAAC;AAEzD,QAAM,sBAAsB,CAAC,sBAAsB,CAACA;AAEpD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,cAAc,sBAAsBA,YAAW,KAAK;AAAA,MAC9D,MAAM,aAAa,SAAY;AAAA,MAC/B,SAAS,sBAAsB,wBAAwB;AAAA,MACvD,WAAW,sBAAsB,gBAAgB;AAAA,MACjD,YAAY;AAAA,MACZ,KAAK;AAAA,MACL,WAAW;AAAA,MACX,gBAAc;AAAA,MACd,WAAWA;AAAA,MACX,iBAAeA,aAAYA;AAAA,MAC3B,0BAA0B;AAAA,MAC1B,aAAa;AAAA,MACZ,GAAG;AAAA,MAEJ;AAAA,qDAAC,gBAAa,WAAW,UAAU;AAAA,QACnC,6CAAC,oBAAoB,UAApB,EAA6B,OAAO,aAClC,UACH;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,eAAQ;;;AIrFf,IAAAC,SAAuB;;;ALCvB,IAAO,gBAAQ;","names":["import_react","styled","Icon","import_react","color","import_jsx_runtime","disabled","React"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/Card.tsx","../src/CardHybrid.tsx","../src/CardStyled.tsx","../src/styles.tsx","../src/useCardBehavior.ts","../src/utils.ts","../src/subComponents.tsx","../src/CardTailwind.tsx","../src/CardTypes.ts"],"sourcesContent":["import Card from \"./Card\";\n\nexport default Card;\nexport { Card };\nexport { CardHeader, CardContent, CardFooter, CardLink } from \"./subComponents\";\nexport * from \"./CardTypes\";\n","import React from \"react\";\nimport type { TypeCardProps } from \"./CardTypes\";\nimport CardHybrid from \"./CardHybrid\";\n\n/**\n * @link https://seeds.sproutsocial.com/components/card/\n *\n * Card automatically routes between the Tailwind implementation (preferred)\n * and the styled-components implementation (for consumers using system props,\n * BORDER-mixin props, or a styled() extension).\n *\n * Cards with role='presentation' are non-interactive for accessibility compliance.\n * Use role='button' for interactive Cards.\n *\n * Avoid nesting interactive content inside a Card with role='button'.\n *\n * Interactive content: \"a\", \"audio\", \"button\", \"embed\", \"iframe\", \"img\", \"input\", \"label\", \"select\", \"textarea\", \"video\"\n * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content\n *\n * @example\n * // Interactive Card\n * <Card role=\"button\" onClick={_onClick}>\n * <Text>Click this card</Text>\n * </Card>\n *\n * @example\n * // Presentation Card with interactive children\n * <Card role=\"presentation\">\n * <Text>This card is not interactive</Text>\n * <Link href=\"/details\">But this link is</Link>\n * </Card>\n */\nconst Card = React.forwardRef<HTMLDivElement, TypeCardProps>((props, ref) => (\n <CardHybrid {...props} ref={ref} />\n));\n\nCard.displayName = \"Card\";\n\nexport default Card;\n","/**\n * Hybrid Card Component\n * Automatically chooses between Tailwind and styled-components based on props.\n *\n * Routes to the styled-components path when a styled-system prop is present\n * (hasStyledProps), a BORDER-mixin prop is present (hasBorderProps), or the\n * component was extended with styled() (isStyledExtension). Otherwise renders\n * the Tailwind path (preferred - no runtime CSS-in-JS).\n */\n\nimport React from \"react\";\nimport {\n hasStyledProps,\n hasBorderProps,\n isStyledExtension,\n} from \"@sproutsocial/seeds-react-system-props\";\n\nimport type { TypeCardProps } from \"./CardTypes\";\nimport CardStyled from \"./CardStyled\"; // Styled-components version\nimport { CardTailwind } from \"./CardTailwind\"; // Tailwind version\n\nconst CardHybrid = React.forwardRef<HTMLDivElement, TypeCardProps>(\n (props, ref) => {\n if (\n hasStyledProps(props) ||\n hasBorderProps(props) ||\n isStyledExtension(props)\n ) {\n return <CardStyled {...props} ref={ref} />;\n }\n\n // Use Tailwind version (preferred - better performance)\n return <CardTailwind {...props} ref={ref} />;\n }\n);\n\nCardHybrid.displayName = \"Card\";\nexport default CardHybrid;\n","import React from \"react\";\nimport { mergeRefs } from \"@sproutsocial/seeds-react-utilities\";\nimport { StyledCard } from \"./styles\";\nimport type { TypeCardProps } from \"./CardTypes\";\nimport { useCardBehavior } from \"./useCardBehavior\";\nimport { SelectedIcon } from \"./subComponents\";\n\n/**\n * Styled-components implementation of Card. Used by CardHybrid whenever a\n * consumer passes a styled-system prop, a BORDER-mixin prop, or a styled()\n * extension. Behaviour is shared with CardTailwind via useCardBehavior.\n */\nconst CardStyled = React.forwardRef<HTMLDivElement, TypeCardProps>(\n (\n {\n children,\n disabled = false,\n elevation = \"low\",\n href,\n onClick,\n role = \"presentation\",\n selected,\n ...rest\n }: TypeCardProps,\n ref\n ) => {\n const {\n containerRef,\n cardContext,\n hasSubComponent,\n isRoleLink,\n SubComponentContext,\n containerProps,\n } = useCardBehavior({ disabled, href, onClick, role, selected });\n\n return (\n <StyledCard\n {...containerProps}\n $elevation={elevation}\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore legacy ref type mismatch between the RefObject and callback ref\n ref={mergeRefs(containerRef, ref)}\n $selected={selected}\n $disabled={disabled}\n $compositionalComponents={hasSubComponent}\n $isRoleLink={isRoleLink}\n {...rest}\n >\n <SelectedIcon $selected={selected} />\n <SubComponentContext.Provider value={cardContext}>\n {children}\n </SubComponentContext.Provider>\n </StyledCard>\n );\n }\n);\n\nCardStyled.displayName = \"Card\";\nexport default CardStyled;\n","import styled from \"styled-components\";\nimport {\n border,\n color,\n flexbox,\n grid,\n layout,\n position,\n space,\n typography,\n} from \"styled-system\";\nimport { focusRing, disabled } from \"@sproutsocial/seeds-react-mixins\";\nimport type {\n TypeStyledCard,\n TypeCardArea,\n TypeStyledSelectedIcon,\n TypeCardLink,\n} from \"./CardTypes\";\nimport Icon from \"@sproutsocial/seeds-react-icon\";\n\n// TODO: Would be really cool to cherry pick specific props from style functions. For example,\n// removing the css prop 'color' from the color function or importing just the specific\n// props the component needs. It appears to be possible with some and not others.\n// https://github.com/styled-system/styled-system/issues/1569\n\nexport const StyledCardContent = styled.div<TypeCardArea>`\n display: flex;\n flex-direction: column;\n padding: ${({ theme }) => theme.space[400]};\n box-sizing: border-box;\n\n ${border}\n ${color}\n ${flexbox}\n ${grid}\n ${layout}\n ${space}\n`;\n\nexport const StyledCardHeader = styled(StyledCardContent)`\n flex-direction: row;\n border-bottom: ${({ theme }) => `${theme.borderWidths[500]} solid\n ${theme.colors.container.border.base}`};\n border-top-left-radius: ${({ theme }) => theme.radii.inner};\n border-top-right-radius: ${({ theme }) => theme.radii.inner};\n\n ${border}\n ${color}\n ${flexbox}\n ${grid}\n ${layout}\n ${space}\n`;\n\nexport const StyledCardFooter = styled(StyledCardContent)`\n flex-direction: row;\n border-top: ${({ theme }) => `${theme.borderWidths[500]} solid\n ${theme.colors.container.border.base}`};\n border-bottom-left-radius: ${({ theme }) => theme.radii.inner};\n border-bottom-right-radius: ${({ theme }) => theme.radii.inner};\n\n ${border}\n ${color}\n ${flexbox}\n ${grid}\n ${layout}\n ${space}\n`;\n\nexport const SelectedIconWrapper = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: -8px;\n right: -8px;\n`;\n\nexport const StyledSelectedIcon = styled(Icon)<TypeStyledSelectedIcon>`\n border-radius: 50%;\n background: ${({ theme }) => theme.colors.container.background.base};\n opacity: 0;\n transition: opacity ${({ theme }) => theme.duration.medium};\n\n ${({ $selected }) =>\n $selected &&\n `\n opacity: 1;\n `}\n`;\n\nexport const StyledCardLink = styled.a<TypeCardLink>`\n font-family: ${(p) => p.theme.fontFamily};\n font-weight: ${(p) => p.theme.fontWeights.bold};\n color: ${(p) => p.theme.colors.text.headline};\n ${(p) => p.theme.typography[400]};\n\n ${color}\n ${typography}\n`;\n\nexport const StyledCard = styled.div<TypeStyledCard>`\n position: relative;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n margin: 0;\n background: ${({ theme }) => theme.colors.container.background.base};\n border: ${({ theme }) => theme.borderWidths[500]} solid\n ${({ theme }) => theme.colors.container.border.base};\n padding: ${({ theme, $compositionalComponents }) =>\n $compositionalComponents ? 0 : theme.space[400]};\n border-radius: ${({ theme }) => theme.radii.outer};\n transition: box-shadow ${({ theme }) => theme.duration.medium},\n border ${({ theme }) => theme.duration.medium};\n\n &[role=\"button\"],\n &[role=\"checkbox\"] {\n cursor: pointer;\n\n &:hover {\n box-shadow: ${({ theme, $elevation = \"low\" }) =>\n theme.shadows[$elevation]};\n }\n }\n\n ${({ $isRoleLink, theme, $elevation = \"low\" }) =>\n $isRoleLink &&\n `\n\t\tcursor: pointer;\n\n &:hover {\n box-shadow: ${theme.shadows[$elevation]};\n }\n\t`}\n\n &:focus-within {\n ${({ $isRoleLink }) => ($isRoleLink ? focusRing : null)}\n ${StyledCardLink}:focus {\n border: none;\n box-shadow: none;\n outline: none;\n }\n }\n\n &:focus {\n ${focusRing}\n }\n\n ${({ $disabled }) =>\n $disabled &&\n `\n ${disabled}\n `}\n\n ${({ $selected, theme }) =>\n $selected &&\n `\n border: ${theme.borderWidths[500]} solid ${theme.colors.container.border.selected}; \n `}\n\n ${border}\n ${color}\n ${flexbox}\n ${grid}\n ${layout}\n ${position}\n ${space}\n`;\n\nexport const StyledCardAffordance = styled(Icon)`\n ${StyledCard}:hover & {\n transform: translateX(${(p) => p.theme.space[200]});\n }\n transition: ${(p) => p.theme.duration.medium};\n`;\n","import React, { useRef, useState } from \"react\";\nimport type { TypeCardProps, TypeCardContext } from \"./CardTypes\";\n// Import from ./utils exactly as Card.tsx did. This hook deliberately lives in\n// its own file (NOT utils.ts) so the test's `jest.mock(\"../utils\")` automock\n// does not neutralize it — only onKeyDown/SubComponentContext stay mocked.\nimport { SubComponentContext, onKeyDown } from \"./utils\";\n\ntype TypeUseCardBehaviorParams = Pick<\n TypeCardProps,\n \"disabled\" | \"href\" | \"onClick\" | \"role\" | \"selected\"\n>;\n\n/**\n * Shared interactive logic for Card, consumed by both CardStyled and\n * CardTailwind so the two rendering paths cannot drift. Owns the\n * hasSubComponent state, the container/link refs, the SubComponentContext\n * value, and the computed container props (tabIndex, role, handlers, aria-*).\n */\nexport function useCardBehavior({\n disabled = false,\n href,\n onClick,\n role = \"presentation\",\n selected,\n}: TypeUseCardBehaviorParams) {\n const [hasSubComponent, setHasSubComponent] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const linkRef = useRef<HTMLAnchorElement>(null);\n const isRoleLink = role === \"link\";\n const isRolePresentation = role === \"presentation\";\n const checkedConditions = role === \"checkbox\" ? selected : undefined;\n\n const cardContext: TypeCardContext = {\n setHasSubComponent: setHasSubComponent,\n href: href,\n linkRef: linkRef,\n };\n\n const handleClickConditions: React.MouseEventHandler = (e) =>\n isRoleLink ? linkRef.current?.click() : onClick?.(e);\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLDivElement> = (e) =>\n onKeyDown({ e, href, onClick, ref: containerRef, role });\n\n const shouldBeInteractive = !isRolePresentation && !disabled;\n\n const containerProps = {\n tabIndex: isRoleLink || isRolePresentation || disabled ? -1 : 0,\n role: isRoleLink ? undefined : role,\n onClick: shouldBeInteractive ? handleClickConditions : undefined,\n onKeyDown: shouldBeInteractive ? handleKeyDown : undefined,\n \"aria-checked\": checkedConditions,\n \"aria-disabled\": disabled && disabled,\n };\n\n return {\n containerRef,\n linkRef,\n cardContext,\n hasSubComponent,\n isRoleLink,\n SubComponentContext,\n containerProps,\n };\n}\n","import { createContext, useContext, useEffect } from \"react\";\nimport { assertIsElement } from \"@sproutsocial/seeds-react-utilities\";\nimport type { TypeCardProps, TypeCardContext } from \"./CardTypes\";\n\nexport const SubComponentContext = createContext<TypeCardContext>({\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setHasSubComponent: () => {},\n href: \"\",\n linkRef: null,\n});\n\nexport function useChildContext() {\n const { setHasSubComponent } = useContext(SubComponentContext);\n useEffect(() => {\n setHasSubComponent && setHasSubComponent(true);\n }, [setHasSubComponent]);\n}\n\ninterface navigateToParams extends Pick<TypeCardProps, \"href\"> {\n e: React.MouseEvent | React.KeyboardEvent;\n ref: React.RefObject<HTMLDivElement>;\n}\n\nexport const navigateTo = ({ e, href, ref }: navigateToParams) => {\n const { target } = e;\n\n // asserts that target is an element so `contains` accepts it\n assertIsElement(target);\n\n if (ref.current?.contains(target)) {\n if (\n target.getAttribute(\"onclick\") !== null ||\n target.getAttribute(\"href\") !== null\n ) {\n e.stopPropagation();\n return;\n }\n }\n\n window.open(href, \"_blank\")?.focus();\n};\n\ninterface onKeyDownParams\n extends Pick<TypeCardProps, \"href\" | \"onClick\" | \"role\"> {\n e: React.KeyboardEvent;\n ref: React.RefObject<HTMLDivElement>;\n}\n\nexport const onKeyDown = ({ e, href, onClick, ref, role }: onKeyDownParams) => {\n if (e?.key === \"Enter\") {\n if (role === \"link\") {\n return navigateTo({ e, href, ref });\n }\n\n if (role === \"presentation\") {\n return;\n }\n\n return onClick?.(e);\n }\n};\n","import React, { useContext } from \"react\";\nimport {\n hasStyledProps,\n hasBorderProps,\n isStyledExtension,\n} from \"@sproutsocial/seeds-react-system-props\";\nimport Icon from \"@sproutsocial/seeds-react-icon\";\nimport { useChildContext, SubComponentContext } from \"./utils\";\nimport type {\n TypeCardLink,\n TypeSharedCardSystemProps,\n TypeStyledSelectedIcon,\n} from \"./CardTypes\";\nimport {\n StyledCardContent,\n StyledCardHeader,\n StyledCardFooter,\n StyledCardAffordance,\n StyledCardLink,\n} from \"./styles\";\n\ninterface TypeSharedSubComponentProps extends TypeSharedCardSystemProps {\n children?: React.ReactNode;\n}\n\n// Utility for merging class names. Mirrored inline from Avatar —\n// @sproutsocial/seeds-react-utilities does NOT export a `cn` helper.\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\n// Route to the styled-components path when a styled-system prop, a BORDER-mixin\n// prop, or a styled() extension is present; otherwise render the Tailwind path.\nfunction needsStyled(props: Record<string, any>): boolean {\n return (\n hasStyledProps(props) || hasBorderProps(props) || isStyledExtension(props)\n );\n}\n\nexport const CardContent = (props: TypeSharedSubComponentProps) => {\n // TODO: It could be cool to possibly adjust the context to include an array of names of child components.\n // Then, if CardHeader or CardFooter aren't used with CardContent throw an error.\n useChildContext();\n const { children, className, ...rest } = props;\n\n if (needsStyled(props)) {\n return (\n <StyledCardContent {...rest} className={className}>\n {children}\n </StyledCardContent>\n );\n }\n\n return (\n <div\n {...(rest as React.HTMLAttributes<HTMLDivElement>)}\n className={cn(\"seeds-card-content\", className)}\n >\n {children}\n </div>\n );\n};\n\nexport const CardHeader = (props: TypeSharedSubComponentProps) => {\n useChildContext();\n const { children, className, ...rest } = props;\n\n if (needsStyled(props)) {\n return (\n <StyledCardHeader {...rest} className={className}>\n {children}\n </StyledCardHeader>\n );\n }\n\n return (\n <div\n {...(rest as React.HTMLAttributes<HTMLDivElement>)}\n className={cn(\"seeds-card-header\", className)}\n >\n {children}\n </div>\n );\n};\n\nexport const CardFooter = (props: TypeSharedSubComponentProps) => {\n useChildContext();\n const { children, className, ...rest } = props;\n\n if (needsStyled(props)) {\n return (\n <StyledCardFooter {...rest} className={className}>\n {children}\n </StyledCardFooter>\n );\n }\n\n return (\n <div\n {...(rest as React.HTMLAttributes<HTMLDivElement>)}\n className={cn(\"seeds-card-footer\", className)}\n >\n {children}\n </div>\n );\n};\n\ninterface TypeSelectedIconProps {\n $selected?: TypeStyledSelectedIcon[\"$selected\"];\n}\n\n// Internal, never receives consumer system props — rendered directly on the\n// Tailwind path. The overlay positioning, background, and opacity transition\n// live in card.css (.seeds-card-selected-icon-wrapper / .seeds-card-selected-icon).\nexport const SelectedIcon = ({ $selected }: TypeSelectedIconProps) => {\n return (\n <div className=\"seeds-card-selected-icon-wrapper\">\n <Icon\n aria-hidden\n color=\"icon.base\"\n name=\"circle-check-solid\"\n className={cn(\"seeds-card-selected-icon\", {\n \"seeds-card-selected-icon-visible\": !!$selected,\n })}\n />\n </div>\n );\n};\n\nexport const CardAffordance = ({ className, ...rest }: Record<string, any>) => {\n if (needsStyled(rest) || isStyledExtension({ className })) {\n return (\n <StyledCardAffordance\n {...rest}\n className={className}\n size=\"mini\"\n name=\"arrow-right-solid\"\n // TODO: probably need to make this available to the top level for external links https://sprout.atlassian.net/browse/DS-2223\n aria-hidden\n />\n );\n }\n\n return (\n <Icon\n {...rest}\n className={cn(\"seeds-card-affordance\", className)}\n size=\"mini\"\n name=\"arrow-right-solid\"\n aria-hidden\n />\n );\n};\n\nexport const CardLink = ({\n affordance,\n children,\n external = false,\n color,\n className,\n ...rest\n}: React.PropsWithChildren<TypeCardLink>) => {\n const { href, linkRef } = useContext(SubComponentContext);\n\n // Because we are hijacking Card click event to directly click this link, we need to stop propagation to avoid a double click event.\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n e.stopPropagation();\n };\n\n const sharedProps = {\n target: external ? \"_blank\" : undefined,\n rel: external ? \"noreferrer\" : undefined,\n href,\n onClick: handleClick,\n };\n\n // color/typography are styled-system props → route those to the styled path.\n if (\n color !== undefined ||\n hasStyledProps(rest) ||\n hasBorderProps(rest) ||\n isStyledExtension({ ...rest, className })\n ) {\n return (\n <StyledCardLink\n {...rest}\n {...sharedProps}\n ref={linkRef}\n className={className}\n // TODO: fix this type since `color` should be valid here. TS can't resolve the correct type.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n color={color}\n >\n <>\n {children}\n {affordance ? <CardAffordance ml={300} /> : null}\n </>\n </StyledCardLink>\n );\n }\n\n return (\n <a\n {...(rest as React.AnchorHTMLAttributes<HTMLAnchorElement>)}\n {...sharedProps}\n ref={linkRef}\n className={cn(\"seeds-card-link\", className)}\n >\n <>\n {children}\n {affordance ? <CardAffordance className=\"ml-300\" /> : null}\n </>\n </a>\n );\n};\n","/**\n * Tailwind CSS implementation of Card component.\n * Uses Seeds card CSS classes from card.css.\n */\n\nimport React from \"react\";\nimport { mergeRefs } from \"@sproutsocial/seeds-react-utilities\";\nimport type { TypeCardProps } from \"./CardTypes\";\nimport { useCardBehavior } from \"./useCardBehavior\";\nimport { SelectedIcon } from \"./subComponents\";\n\n// Utility for merging class names properly. Mirrored inline from Avatar —\n// @sproutsocial/seeds-react-utilities does NOT export a `cn` helper.\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 const CardTailwind = React.forwardRef<HTMLDivElement, TypeCardProps>(\n (\n {\n children,\n className,\n disabled = false,\n elevation = \"low\",\n href,\n onClick,\n role = \"presentation\",\n selected,\n ...rest\n }: TypeCardProps,\n ref\n ) => {\n const {\n containerRef,\n cardContext,\n hasSubComponent,\n isRoleLink,\n SubComponentContext,\n containerProps,\n } = useCardBehavior({ disabled, href, onClick, role, selected });\n\n const classes = cn(\n \"seeds-card\",\n {\n \"seeds-card-interactive\":\n isRoleLink || role === \"button\" || role === \"checkbox\",\n \"seeds-card-link-role\": isRoleLink,\n },\n {\n \"seeds-card-selected\": !!selected,\n \"seeds-card-disabled\": disabled,\n \"seeds-card-compositional\": hasSubComponent,\n },\n className\n );\n\n return (\n <div\n {...containerProps}\n {...(rest as React.HTMLAttributes<HTMLDivElement>)}\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore legacy ref type mismatch between the RefObject and callback ref\n ref={mergeRefs(containerRef, ref)}\n className={classes}\n // Per-elevation hover shadow is pushed through a CSS custom property\n // consumed by card.css. Placed after {...rest} so it can't be clobbered.\n style={\n {\n \"--seeds-card-hover-shadow\": `var(--shadow-${elevation})`,\n } as React.CSSProperties\n }\n >\n <SelectedIcon $selected={selected} />\n <SubComponentContext.Provider value={cardContext}>\n {children}\n </SubComponentContext.Provider>\n </div>\n );\n }\n);\n\nCardTailwind.displayName = \"CardTailwind\";\n","import type { TypeIconProps } from \"@sproutsocial/seeds-react-icon\";\nimport * as React from \"react\";\nimport type { TypeStyledComponentsCommonProps } from \"@sproutsocial/seeds-react-system-props\";\nimport type {\n TypeBorderSystemProps,\n TypeColorSystemProps,\n TypeFlexboxSystemProps,\n TypeGridSystemProps,\n TypeLayoutSystemProps,\n TypePositionSystemProps,\n TypeSpaceSystemProps,\n TypeTypographySystemProps,\n} from \"@sproutsocial/seeds-react-system-props\";\n\nexport interface TypeSharedCardSystemProps\n extends Omit<React.ComponentPropsWithoutRef<\"div\">, \"color\">,\n TypeStyledComponentsCommonProps,\n TypeBorderSystemProps,\n TypeColorSystemProps,\n TypeFlexboxSystemProps,\n TypeGridSystemProps,\n TypeLayoutSystemProps,\n TypePositionSystemProps,\n TypeSpaceSystemProps {}\n\n// consumer facing props that affect the styles of the component. We need to define these first so the user doesn't see our transient naming conventions.\nexport interface TypeCardStyleProps {\n elevation?: \"low\" | \"medium\" | \"high\";\n disabled?: boolean;\n compositionalComponents?: boolean;\n selected?: boolean;\n isRoleLink?: boolean;\n}\n\n// Since we only want to manage the style props in one place(above), we'll use this generic to prepend the properties of TypeCardStyleProps with $.\nexport type TypeStyleTransientProps<T> = {\n [K in Extract<keyof T, string> as `$${K}`]: T[K];\n};\n\nexport type TypeCardStyleTransientProps =\n TypeStyleTransientProps<TypeCardStyleProps>;\n\nexport interface TypeStyledCard\n extends TypeSharedCardSystemProps,\n TypeCardStyleTransientProps {}\n\nexport interface TypeCardStyles\n extends TypeSharedCardSystemProps,\n Omit<TypeCardStyleProps, \"compositionalComponents\"> {}\n\ntype TypeOnClick = (event: React.MouseEvent | React.KeyboardEvent) => void;\n\ntype TypeGenericCard = {\n /** role is used for to set accessibility properties,\n * to determine styling and interaction behavior,\n * and to determine which props should be allowed.*/\n role: \"link\" | \"button\" | \"checkbox\" | \"presentation\";\n /** When role is link, use href to determine the link destination.\n * Required for role=\"link\", disallowed for all other roles */\n href?: string;\n /** Required for role=\"button\" and role=\"checkbox\",\n * discouraged for role=\"presentation\", and disallowed for role=\"link\" */\n onClick?: TypeOnClick;\n /** Indicates whether the card is selected.\n * Required for role=\"checkbox\", disallowed for all other roles */\n selected?: boolean;\n};\n\nexport type TypeLinkCardProps = {\n role: \"link\";\n href: string;\n onClick?: never;\n selected?: never;\n};\n\nexport type TypeButtonCardProps = {\n role: \"button\";\n href?: never;\n onClick: TypeOnClick;\n selected?: never;\n};\n\nexport type TypeCheckboxCardProps = {\n role: \"checkbox\";\n href?: never;\n onClick: TypeOnClick;\n selected: boolean;\n};\n\nexport type TypePresentationCardProps = {\n role: \"presentation\";\n href?: never;\n /**\n * **Not supported for accessibility:**\n * `role='presentation'` removes the element from the accessibility tree.\n * Presentation Cards do not support `onClick` handlers or keyboard interactions.\n * Use `role='button'` for interactive Cards instead.\n */\n onClick?: never;\n selected?: never;\n};\n\nexport type TypeCardConditions =\n | TypeLinkCardProps\n | TypeButtonCardProps\n | TypeCheckboxCardProps\n | TypePresentationCardProps;\n\nexport type TypeCardProps = React.PropsWithChildren<TypeCardStyles> &\n TypeGenericCard &\n TypeCardConditions;\n\nexport interface TypeCardArea extends TypeSharedCardSystemProps {\n $divider?: \"top\" | \"bottom\";\n}\n\nexport interface TypeStyledSelectedIcon extends TypeIconProps {\n $selected?: TypeCardStyleTransientProps[\"$selected\"];\n}\n\nexport interface TypeCardContext {\n setHasSubComponent?: React.Dispatch<React.SetStateAction<boolean>>;\n href?: string;\n linkRef: React.RefObject<HTMLAnchorElement> | null;\n}\n\nexport interface TypeCardLink\n extends Omit<React.ComponentPropsWithoutRef<\"a\">, \"color\">,\n TypeColorSystemProps,\n TypeTypographySystemProps {\n affordance?: boolean;\n external?: boolean;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAkB;;;ACUlB,IAAAC,gBAAkB;AAClB,IAAAC,mCAIO;;;ACfP,IAAAC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,MAC1B;AAAA,MACA;AAAA,QACE,uBAAuB,CAAC,CAAC;AAAA,QACzB,uBAAuBE;AAAA,QACvB,4BAA4B;AAAA,MAC9B;AAAA,MACA;AAAA,IACF;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACH,GAAI;AAAA,QAGL,SAAK,yCAAU,cAAc,GAAG;AAAA,QAChC,WAAW;AAAA,QAGX,OACE;AAAA,UACE,6BAA6B,gBAAgB,SAAS;AAAA,QACxD;AAAA,QAGF;AAAA,uDAAC,gBAAa,WAAW,UAAU;AAAA,UACnC,6CAACC,qBAAoB,UAApB,EAA6B,OAAO,aAClC,UACH;AAAA;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AAEA,aAAa,cAAc;;;ANvEd,IAAAC,sBAAA;AAPb,IAAM,aAAa,cAAAC,QAAM;AAAA,EACvB,CAAC,OAAO,QAAQ;AACd,YACE,iDAAe,KAAK,SACpB,iDAAe,KAAK,SACpB,oDAAkB,KAAK,GACvB;AACA,aAAO,6CAAC,sBAAY,GAAG,OAAO,KAAU;AAAA,IAC1C;AAGA,WAAO,6CAAC,gBAAc,GAAG,OAAO,KAAU;AAAA,EAC5C;AACF;AAEA,WAAW,cAAc;AACzB,IAAO,qBAAQ;;;ADJb,IAAAC,sBAAA;AADF,IAAM,OAAO,cAAAC,QAAM,WAA0C,CAAC,OAAO,QACnE,6CAAC,sBAAY,GAAG,OAAO,KAAU,CAClC;AAED,KAAK,cAAc;AAEnB,IAAO,eAAQ;;;AQrCf,IAAAC,SAAuB;;;ATCvB,IAAO,gBAAQ;","names":["import_react","import_react","import_seeds_react_system_props","import_react","import_seeds_react_utilities","styled","Icon","import_react","disabled","import_react","import_seeds_react_icon","Icon","color","import_jsx_runtime","React","disabled","SubComponentContext","import_react","import_seeds_react_utilities","import_jsx_runtime","cn","React","disabled","SubComponentContext","import_jsx_runtime","React","import_jsx_runtime","React","React"]}
|
package/package.json
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sproutsocial/seeds-react-card",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.55",
|
|
4
4
|
"description": "Seeds React Card",
|
|
5
5
|
"author": "Sprout Social, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/esm/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/esm/index.js",
|
|
16
|
+
"require": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts"
|
|
18
|
+
},
|
|
19
|
+
"./dist/card.css": "./dist/card.css"
|
|
20
|
+
},
|
|
10
21
|
"scripts": {
|
|
11
|
-
"build": "tsup --dts",
|
|
12
|
-
"build:debug": "tsup --dts --metafile",
|
|
22
|
+
"build": "tsup --dts && cp src/card.css dist/card.css",
|
|
23
|
+
"build:debug": "tsup --dts --metafile && cp src/card.css dist/card.css",
|
|
13
24
|
"dev": "tsup --watch --dts",
|
|
14
25
|
"clean": "rm -rf .turbo dist",
|
|
15
26
|
"clean:modules": "rm -rf node_modules",
|
|
@@ -18,10 +29,11 @@
|
|
|
18
29
|
"test:watch": "jest --watch --coverage=false"
|
|
19
30
|
},
|
|
20
31
|
"dependencies": {
|
|
32
|
+
"@sproutsocial/seeds-react-theme": "^4.5.1",
|
|
21
33
|
"@sproutsocial/seeds-react-system-props": "^3.2.1",
|
|
22
|
-
"@sproutsocial/seeds-react-mixins": "^4.3.
|
|
34
|
+
"@sproutsocial/seeds-react-mixins": "^4.3.16",
|
|
23
35
|
"@sproutsocial/seeds-react-utilities": "^4.0.1",
|
|
24
|
-
"@sproutsocial/seeds-react-icon": "^2.5.
|
|
36
|
+
"@sproutsocial/seeds-react-icon": "^2.5.2",
|
|
25
37
|
"styled-system": "^5.1.5"
|
|
26
38
|
},
|
|
27
39
|
"devDependencies": {
|
|
@@ -34,14 +46,13 @@
|
|
|
34
46
|
"@sproutsocial/seeds-tsconfig": "*",
|
|
35
47
|
"@sproutsocial/seeds-testing": "*",
|
|
36
48
|
"@sproutsocial/seeds-react-testing-library": "*",
|
|
37
|
-
"@sproutsocial/seeds-react-banner": "^1.1.
|
|
38
|
-
"@sproutsocial/seeds-react-badge": "^2.0.
|
|
39
|
-
"@sproutsocial/seeds-react-box": "^1.1.
|
|
40
|
-
"@sproutsocial/seeds-react-link": "^1.1.
|
|
41
|
-
"@sproutsocial/seeds-react-partner-logo": "^1.7.
|
|
49
|
+
"@sproutsocial/seeds-react-banner": "^1.1.36",
|
|
50
|
+
"@sproutsocial/seeds-react-badge": "^2.0.46",
|
|
51
|
+
"@sproutsocial/seeds-react-box": "^1.1.32",
|
|
52
|
+
"@sproutsocial/seeds-react-link": "^1.1.24",
|
|
53
|
+
"@sproutsocial/seeds-react-partner-logo": "^1.7.24",
|
|
42
54
|
"@sproutsocial/seeds-react-spot-illustration": "^1.2.5",
|
|
43
|
-
"@sproutsocial/seeds-react-text": "^1.5.5"
|
|
44
|
-
"@sproutsocial/seeds-react-theme": "^4.5.0"
|
|
55
|
+
"@sproutsocial/seeds-react-text": "^1.5.5"
|
|
45
56
|
},
|
|
46
57
|
"peerDependencies": {
|
|
47
58
|
"styled-components": "^5.2.3"
|