@activecollab/components 2.0.369 → 2.0.371

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.
Files changed (104) hide show
  1. package/dist/cjs/components/GlobalStyle.js +1 -1
  2. package/dist/cjs/components/GlobalStyle.js.map +1 -1
  3. package/dist/cjs/components/StackedCard/Glyphs.js +86 -0
  4. package/dist/cjs/components/StackedCard/Glyphs.js.map +1 -0
  5. package/dist/cjs/components/StackedCard/Primitives.js +129 -0
  6. package/dist/cjs/components/StackedCard/Primitives.js.map +1 -0
  7. package/dist/cjs/components/StackedCard/StackedCard.js +103 -0
  8. package/dist/cjs/components/StackedCard/StackedCard.js.map +1 -0
  9. package/dist/cjs/components/StackedCard/Styles.js +192 -0
  10. package/dist/cjs/components/StackedCard/Styles.js.map +1 -0
  11. package/dist/cjs/components/StackedCard/constants.js +54 -0
  12. package/dist/cjs/components/StackedCard/constants.js.map +1 -0
  13. package/dist/cjs/components/StackedCard/index.js +50 -0
  14. package/dist/cjs/components/StackedCard/index.js.map +1 -0
  15. package/dist/cjs/components/StepSequence/Styles.js +1 -1
  16. package/dist/cjs/components/StepSequence/Styles.js.map +1 -1
  17. package/dist/cjs/components/index.js +11 -0
  18. package/dist/cjs/components/index.js.map +1 -1
  19. package/dist/cjs/presentation/stackedCard/content/ImageCard.js +5 -6
  20. package/dist/cjs/presentation/stackedCard/content/ImageCard.js.map +1 -1
  21. package/dist/cjs/presentation/stackedCard/content/LinkCard.js +28 -23
  22. package/dist/cjs/presentation/stackedCard/content/LinkCard.js.map +1 -1
  23. package/dist/cjs/presentation/stackedCard/content/NoteCard.js +5 -5
  24. package/dist/cjs/presentation/stackedCard/content/NoteCard.js.map +1 -1
  25. package/dist/cjs/presentation/stackedCard/content/SwatchCard.js +7 -8
  26. package/dist/cjs/presentation/stackedCard/content/SwatchCard.js.map +1 -1
  27. package/dist/cjs/presentation/stackedCard/content/TaskCard.js +9 -10
  28. package/dist/cjs/presentation/stackedCard/content/TaskCard.js.map +1 -1
  29. package/dist/cjs/presentation/stackedCard/content/shared.js +27 -7
  30. package/dist/cjs/presentation/stackedCard/content/shared.js.map +1 -1
  31. package/dist/cjs/presentation/stackedCard/storyScaffold.js +8 -6
  32. package/dist/cjs/presentation/stackedCard/storyScaffold.js.map +1 -1
  33. package/dist/esm/components/GlobalStyle.d.ts.map +1 -1
  34. package/dist/esm/components/GlobalStyle.js +1 -1
  35. package/dist/esm/components/GlobalStyle.js.map +1 -1
  36. package/dist/esm/components/StackedCard/Glyphs.d.ts +19 -0
  37. package/dist/esm/components/StackedCard/Glyphs.d.ts.map +1 -0
  38. package/dist/esm/components/StackedCard/Glyphs.js +72 -0
  39. package/dist/esm/components/StackedCard/Glyphs.js.map +1 -0
  40. package/dist/esm/components/StackedCard/Primitives.d.ts +91 -0
  41. package/dist/esm/components/StackedCard/Primitives.d.ts.map +1 -0
  42. package/dist/esm/components/StackedCard/Primitives.js +122 -0
  43. package/dist/esm/components/StackedCard/Primitives.js.map +1 -0
  44. package/dist/esm/components/StackedCard/StackedCard.d.ts +74 -0
  45. package/dist/esm/components/StackedCard/StackedCard.d.ts.map +1 -0
  46. package/dist/esm/components/StackedCard/StackedCard.js +95 -0
  47. package/dist/esm/components/StackedCard/StackedCard.js.map +1 -0
  48. package/dist/esm/components/StackedCard/Styles.d.ts +46 -0
  49. package/dist/esm/components/StackedCard/Styles.d.ts.map +1 -0
  50. package/dist/esm/components/StackedCard/Styles.js +186 -0
  51. package/dist/esm/components/StackedCard/Styles.js.map +1 -0
  52. package/dist/esm/components/StackedCard/constants.d.ts +37 -0
  53. package/dist/esm/components/StackedCard/constants.d.ts.map +1 -0
  54. package/dist/esm/components/StackedCard/constants.js +48 -0
  55. package/dist/esm/components/StackedCard/constants.js.map +1 -0
  56. package/dist/esm/components/StackedCard/index.d.ts +5 -0
  57. package/dist/esm/components/StackedCard/index.d.ts.map +1 -0
  58. package/dist/esm/components/StackedCard/index.js +5 -0
  59. package/dist/esm/components/StackedCard/index.js.map +1 -0
  60. package/dist/esm/components/StepSequence/Styles.js +1 -1
  61. package/dist/esm/components/StepSequence/Styles.js.map +1 -1
  62. package/dist/esm/components/index.d.ts +1 -0
  63. package/dist/esm/components/index.d.ts.map +1 -1
  64. package/dist/esm/components/index.js +1 -0
  65. package/dist/esm/components/index.js.map +1 -1
  66. package/dist/esm/presentation/stackedCard/content/ImageCard.d.ts.map +1 -1
  67. package/dist/esm/presentation/stackedCard/content/ImageCard.js +2 -3
  68. package/dist/esm/presentation/stackedCard/content/ImageCard.js.map +1 -1
  69. package/dist/esm/presentation/stackedCard/content/LinkCard.d.ts.map +1 -1
  70. package/dist/esm/presentation/stackedCard/content/LinkCard.js +14 -9
  71. package/dist/esm/presentation/stackedCard/content/LinkCard.js.map +1 -1
  72. package/dist/esm/presentation/stackedCard/content/NoteCard.js +1 -1
  73. package/dist/esm/presentation/stackedCard/content/NoteCard.js.map +1 -1
  74. package/dist/esm/presentation/stackedCard/content/SwatchCard.d.ts.map +1 -1
  75. package/dist/esm/presentation/stackedCard/content/SwatchCard.js +2 -3
  76. package/dist/esm/presentation/stackedCard/content/SwatchCard.js.map +1 -1
  77. package/dist/esm/presentation/stackedCard/content/TaskCard.d.ts.map +1 -1
  78. package/dist/esm/presentation/stackedCard/content/TaskCard.js +1 -2
  79. package/dist/esm/presentation/stackedCard/content/TaskCard.js.map +1 -1
  80. package/dist/esm/presentation/stackedCard/content/shared.d.ts +15 -0
  81. package/dist/esm/presentation/stackedCard/content/shared.d.ts.map +1 -1
  82. package/dist/esm/presentation/stackedCard/content/shared.js +22 -2
  83. package/dist/esm/presentation/stackedCard/content/shared.js.map +1 -1
  84. package/dist/esm/presentation/stackedCard/storyScaffold.d.ts +8 -6
  85. package/dist/esm/presentation/stackedCard/storyScaffold.d.ts.map +1 -1
  86. package/dist/esm/presentation/stackedCard/storyScaffold.js +8 -6
  87. package/dist/esm/presentation/stackedCard/storyScaffold.js.map +1 -1
  88. package/dist/index.js +1215 -688
  89. package/dist/index.js.map +1 -1
  90. package/dist/index.min.js +1 -1
  91. package/dist/index.min.js.map +1 -1
  92. package/package.json +1 -1
  93. package/dist/cjs/presentation/stackedCard/primitives.js +0 -254
  94. package/dist/cjs/presentation/stackedCard/primitives.js.map +0 -1
  95. package/dist/cjs/presentation/stackedCard/shell.js +0 -165
  96. package/dist/cjs/presentation/stackedCard/shell.js.map +0 -1
  97. package/dist/esm/presentation/stackedCard/primitives.d.ts +0 -84
  98. package/dist/esm/presentation/stackedCard/primitives.d.ts.map +0 -1
  99. package/dist/esm/presentation/stackedCard/primitives.js +0 -241
  100. package/dist/esm/presentation/stackedCard/primitives.js.map +0 -1
  101. package/dist/esm/presentation/stackedCard/shell.d.ts +0 -46
  102. package/dist/esm/presentation/stackedCard/shell.d.ts.map +0 -1
  103. package/dist/esm/presentation/stackedCard/shell.js +0 -156
  104. package/dist/esm/presentation/stackedCard/shell.js.map +0 -1
@@ -0,0 +1,91 @@
1
+ import React, { ReactElement, ReactNode } from "react";
2
+ import { StackedCardRowDirection, StackedCardRowRole } from "./constants";
3
+ /**
4
+ * StackedCard layout primitives.
5
+ *
6
+ * A stacked card is a portrait presentation of data: content stacks top to
7
+ * bottom in rows. There are three primitives and nothing else —
8
+ *
9
+ * - StackedCardStack — the vertical column. A card IS a stack of rows; the
10
+ * primitive is exported for nested stacks (a row that stacks internally).
11
+ * - StackedCardRow — the one layout primitive. Cover, title, meta, footer
12
+ * are all rows; a `role` sets the default padding so the anatomy stays
13
+ * predictable across every card type.
14
+ * - StackedCardCover — sugar for a bleed row that holds media, reserves its
15
+ * height with `aspect-ratio` so a late image never reflows the card, and
16
+ * carries two control slots (center + top-right).
17
+ */
18
+ /** A vertical flex column with no padding of its own. */
19
+ export declare const StackedCardStack: import("styled-components").StyledComponent<"div", any, {}, never>;
20
+ export interface IStackedCardRowProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "role"> {
21
+ /**
22
+ * Named layout role → default padding. Defaults to `custom`.
23
+ *
24
+ * This shadows the DOM `role` attribute on purpose: a row is a layout
25
+ * increment, and the concept's vocabulary for it is the role. Rows that need
26
+ * an ARIA role should carry it on their own content.
27
+ */
28
+ role?: StackedCardRowRole;
29
+ /** Zero the padding, overriding the role (media rows, edge-to-edge bands). */
30
+ bleed?: boolean;
31
+ /** Footer bands lay their children out vertically. Defaults to `row`. */
32
+ direction?: StackedCardRowDirection;
33
+ /** A row can carry its own background (a tinted footer band, a state tint). */
34
+ background?: string;
35
+ className?: string;
36
+ children: ReactNode;
37
+ }
38
+ /**
39
+ * One row of a card's stack.
40
+ *
41
+ * In `row` direction the first level of children is distributed evenly along
42
+ * the X axis; a child carrying the `data-fixed` attribute keeps its own width
43
+ * and the rest share what remains.
44
+ */
45
+ export declare const StackedCardRow: React.ForwardRefExoticComponent<IStackedCardRowProps & React.RefAttributes<HTMLDivElement>>;
46
+ export interface IStackedCardCoverProps {
47
+ /**
48
+ * CSS `aspect-ratio` value that reserves the cover's height, e.g.
49
+ * `"260 / 132"`. A ratio, not a pixel height, so the cover scales with the
50
+ * card and holds its space before the media loads.
51
+ */
52
+ aspectRatio?: string;
53
+ /** Center slot — the media control (a play button over audio/video). */
54
+ centerSlot?: ReactNode;
55
+ /** Top-right slot — cover management (collapse, remove). */
56
+ topRightSlot?: ReactNode;
57
+ /**
58
+ * Render the thin collapsed strip instead of the media box. The collapse
59
+ * CONTROL lives in the caller's `topRightSlot`; this flag is the resulting
60
+ * visual state.
61
+ */
62
+ collapsed?: boolean;
63
+ /**
64
+ * What the collapsed strip shows — an ~8px colour bar, a favicon + domain
65
+ * row. Content-specific, so the caller supplies it.
66
+ */
67
+ collapsedStrip?: ReactNode;
68
+ /** Fired when the collapsed strip's expand affordance is activated. */
69
+ onExpand?: () => void;
70
+ /** Accessible label for the expand affordance. */
71
+ expandLabel?: string;
72
+ className?: string;
73
+ /** The fill: an `<img>`, an inline `<svg>`, or a solid-colour box. */
74
+ children: ReactNode;
75
+ }
76
+ /**
77
+ * A bleed row that holds media.
78
+ *
79
+ * Controls in either slot are revealed on hover OR focus-within, so they stay
80
+ * reachable by keyboard. Collapsed, the media box gives way to a strip that is
81
+ * itself the expand button.
82
+ */
83
+ export declare const StackedCardCover: {
84
+ ({ aspectRatio, centerSlot, topRightSlot, collapsed, collapsedStrip, onExpand, expandLabel, className, children, }: IStackedCardCoverProps): ReactElement;
85
+ displayName: string;
86
+ };
87
+ /** Centered media control (a play button). Drop the glyph inside. */
88
+ export declare const StackedCardPlayBadge: import("styled-components").StyledComponent<"span", any, {}, never>;
89
+ /** Top-right cover-management button (collapse, remove …). */
90
+ export declare const StackedCardCoverButton: import("styled-components").StyledComponent<"button", any, {}, never>;
91
+ //# sourceMappingURL=Primitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Primitives.d.ts","sourceRoot":"","sources":["../../../../src/components/StackedCard/Primitives.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD,OAAO,EAGL,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAerB;;;;;;;;;;;;;;GAcG;AAMH,yDAAyD;AACzD,eAAO,MAAM,gBAAgB,oEAAyB,CAAC;AAMvD,MAAM,WAAW,oBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAC1D;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC;IAC1B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yEAAyE;IACzE,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,+EAA+E;IAC/E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,6FAiC1B,CAAC;AAQF,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,4DAA4D;IAC5D,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB;wHAU1B,sBAAsB,GAAG,YAAY;;CA0CvC,CAAC;AAQF,qEAAqE;AACrE,eAAO,MAAM,oBAAoB,qEAA6B,CAAC;AAE/D,8DAA8D;AAC9D,eAAO,MAAM,sBAAsB,uEAA+B,CAAC"}
@@ -0,0 +1,122 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["role", "bleed", "direction", "background", "className", "children"];
4
+ import React from "react";
5
+ import classnames from "classnames";
6
+ import { STACKED_CARD_CONTROL_CLASS, STACKED_CARD_COVER_RATIO } from "./constants";
7
+ import { StackedCardExpandGlyph } from "./Glyphs";
8
+ import { StyledStackedCardCollapsedStrip, StyledStackedCardCoverButton, StyledStackedCardCoverCenter, StyledStackedCardCoverFill, StyledStackedCardCoverMedia, StyledStackedCardCoverTopRight, StyledStackedCardPlayBadge, StyledStackedCardRow, StyledStackedCardStack, StyledStackedCardStripExpand } from "./Styles";
9
+
10
+ /**
11
+ * StackedCard layout primitives.
12
+ *
13
+ * A stacked card is a portrait presentation of data: content stacks top to
14
+ * bottom in rows. There are three primitives and nothing else —
15
+ *
16
+ * - StackedCardStack — the vertical column. A card IS a stack of rows; the
17
+ * primitive is exported for nested stacks (a row that stacks internally).
18
+ * - StackedCardRow — the one layout primitive. Cover, title, meta, footer
19
+ * are all rows; a `role` sets the default padding so the anatomy stays
20
+ * predictable across every card type.
21
+ * - StackedCardCover — sugar for a bleed row that holds media, reserves its
22
+ * height with `aspect-ratio` so a late image never reflows the card, and
23
+ * carries two control slots (center + top-right).
24
+ */
25
+
26
+ /* ------------------------------------------------------------------ */
27
+ /* Stack */
28
+ /* ------------------------------------------------------------------ */
29
+
30
+ /** A vertical flex column with no padding of its own. */
31
+ export const StackedCardStack = StyledStackedCardStack;
32
+
33
+ /* ------------------------------------------------------------------ */
34
+ /* Row */
35
+ /* ------------------------------------------------------------------ */
36
+
37
+ /**
38
+ * One row of a card's stack.
39
+ *
40
+ * In `row` direction the first level of children is distributed evenly along
41
+ * the X axis; a child carrying the `data-fixed` attribute keeps its own width
42
+ * and the rest share what remains.
43
+ */
44
+ export const StackedCardRow = /*#__PURE__*/React.forwardRef((_ref, ref) => {
45
+ let _ref$role = _ref.role,
46
+ role = _ref$role === void 0 ? "custom" : _ref$role,
47
+ bleed = _ref.bleed,
48
+ _ref$direction = _ref.direction,
49
+ direction = _ref$direction === void 0 ? "row" : _ref$direction,
50
+ background = _ref.background,
51
+ className = _ref.className,
52
+ children = _ref.children,
53
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
54
+ return /*#__PURE__*/React.createElement(StyledStackedCardRow, _extends({
55
+ ref: ref,
56
+ $role: role,
57
+ $bleed: bleed,
58
+ $direction: direction,
59
+ $background: background,
60
+ className: classnames("c-stacked-card__row", "c-stacked-card__row--" + role, {
61
+ "c-stacked-card__row--bleed": bleed
62
+ }, className)
63
+ }, rest), children);
64
+ });
65
+ StackedCardRow.displayName = "StackedCardRow";
66
+
67
+ /* ------------------------------------------------------------------ */
68
+ /* Cover */
69
+ /* ------------------------------------------------------------------ */
70
+
71
+ /**
72
+ * A bleed row that holds media.
73
+ *
74
+ * Controls in either slot are revealed on hover OR focus-within, so they stay
75
+ * reachable by keyboard. Collapsed, the media box gives way to a strip that is
76
+ * itself the expand button.
77
+ */
78
+ export const StackedCardCover = _ref2 => {
79
+ let _ref2$aspectRatio = _ref2.aspectRatio,
80
+ aspectRatio = _ref2$aspectRatio === void 0 ? STACKED_CARD_COVER_RATIO : _ref2$aspectRatio,
81
+ centerSlot = _ref2.centerSlot,
82
+ topRightSlot = _ref2.topRightSlot,
83
+ collapsed = _ref2.collapsed,
84
+ collapsedStrip = _ref2.collapsedStrip,
85
+ onExpand = _ref2.onExpand,
86
+ _ref2$expandLabel = _ref2.expandLabel,
87
+ expandLabel = _ref2$expandLabel === void 0 ? "Expand cover" : _ref2$expandLabel,
88
+ className = _ref2.className,
89
+ children = _ref2.children;
90
+ return /*#__PURE__*/React.createElement(StackedCardRow, {
91
+ role: "cover",
92
+ bleed: true,
93
+ className: classnames("c-stacked-card__cover", className)
94
+ }, collapsed ? /*#__PURE__*/React.createElement(StyledStackedCardCollapsedStrip, {
95
+ type: "button",
96
+ "aria-label": expandLabel,
97
+ onClick: onExpand,
98
+ className: "c-stacked-card__cover-strip"
99
+ }, collapsedStrip, /*#__PURE__*/React.createElement(StyledStackedCardStripExpand, {
100
+ className: STACKED_CARD_CONTROL_CLASS,
101
+ "aria-hidden": "true"
102
+ }, /*#__PURE__*/React.createElement(StackedCardExpandGlyph, null))) : /*#__PURE__*/React.createElement(StyledStackedCardCoverMedia, {
103
+ $aspectRatio: aspectRatio,
104
+ className: "c-stacked-card__cover-media"
105
+ }, /*#__PURE__*/React.createElement(StyledStackedCardCoverFill, null, children), centerSlot ? /*#__PURE__*/React.createElement(StyledStackedCardCoverCenter, {
106
+ className: STACKED_CARD_CONTROL_CLASS
107
+ }, centerSlot) : null, topRightSlot ? /*#__PURE__*/React.createElement(StyledStackedCardCoverTopRight, {
108
+ className: STACKED_CARD_CONTROL_CLASS
109
+ }, topRightSlot) : null));
110
+ };
111
+ StackedCardCover.displayName = "StackedCardCover";
112
+
113
+ /* ------------------------------------------------------------------ */
114
+ /* Cover chrome */
115
+ /* ------------------------------------------------------------------ */
116
+
117
+ /** Centered media control (a play button). Drop the glyph inside. */
118
+ export const StackedCardPlayBadge = StyledStackedCardPlayBadge;
119
+
120
+ /** Top-right cover-management button (collapse, remove …). */
121
+ export const StackedCardCoverButton = StyledStackedCardCoverButton;
122
+ //# sourceMappingURL=Primitives.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Primitives.js","names":["React","classnames","STACKED_CARD_CONTROL_CLASS","STACKED_CARD_COVER_RATIO","StackedCardExpandGlyph","StyledStackedCardCollapsedStrip","StyledStackedCardCoverButton","StyledStackedCardCoverCenter","StyledStackedCardCoverFill","StyledStackedCardCoverMedia","StyledStackedCardCoverTopRight","StyledStackedCardPlayBadge","StyledStackedCardRow","StyledStackedCardStack","StyledStackedCardStripExpand","StackedCardStack","StackedCardRow","forwardRef","_ref","ref","_ref$role","role","bleed","_ref$direction","direction","background","className","children","rest","_objectWithoutPropertiesLoose","_excluded","createElement","_extends","$role","$bleed","$direction","$background","displayName","StackedCardCover","_ref2","_ref2$aspectRatio","aspectRatio","centerSlot","topRightSlot","collapsed","collapsedStrip","onExpand","_ref2$expandLabel","expandLabel","type","onClick","$aspectRatio","StackedCardPlayBadge","StackedCardCoverButton"],"sources":["../../../../src/components/StackedCard/Primitives.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport {\n STACKED_CARD_CONTROL_CLASS,\n STACKED_CARD_COVER_RATIO,\n StackedCardRowDirection,\n StackedCardRowRole,\n} from \"./constants\";\nimport { StackedCardExpandGlyph } from \"./Glyphs\";\nimport {\n StyledStackedCardCollapsedStrip,\n StyledStackedCardCoverButton,\n StyledStackedCardCoverCenter,\n StyledStackedCardCoverFill,\n StyledStackedCardCoverMedia,\n StyledStackedCardCoverTopRight,\n StyledStackedCardPlayBadge,\n StyledStackedCardRow,\n StyledStackedCardStack,\n StyledStackedCardStripExpand,\n} from \"./Styles\";\n\n/**\n * StackedCard layout primitives.\n *\n * A stacked card is a portrait presentation of data: content stacks top to\n * bottom in rows. There are three primitives and nothing else —\n *\n * - StackedCardStack — the vertical column. A card IS a stack of rows; the\n * primitive is exported for nested stacks (a row that stacks internally).\n * - StackedCardRow — the one layout primitive. Cover, title, meta, footer\n * are all rows; a `role` sets the default padding so the anatomy stays\n * predictable across every card type.\n * - StackedCardCover — sugar for a bleed row that holds media, reserves its\n * height with `aspect-ratio` so a late image never reflows the card, and\n * carries two control slots (center + top-right).\n */\n\n/* ------------------------------------------------------------------ */\n/* Stack */\n/* ------------------------------------------------------------------ */\n\n/** A vertical flex column with no padding of its own. */\nexport const StackedCardStack = StyledStackedCardStack;\n\n/* ------------------------------------------------------------------ */\n/* Row */\n/* ------------------------------------------------------------------ */\n\nexport interface IStackedCardRowProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"role\"> {\n /**\n * Named layout role → default padding. Defaults to `custom`.\n *\n * This shadows the DOM `role` attribute on purpose: a row is a layout\n * increment, and the concept's vocabulary for it is the role. Rows that need\n * an ARIA role should carry it on their own content.\n */\n role?: StackedCardRowRole;\n /** Zero the padding, overriding the role (media rows, edge-to-edge bands). */\n bleed?: boolean;\n /** Footer bands lay their children out vertically. Defaults to `row`. */\n direction?: StackedCardRowDirection;\n /** A row can carry its own background (a tinted footer band, a state tint). */\n background?: string;\n className?: string;\n children: ReactNode;\n}\n\n/**\n * One row of a card's stack.\n *\n * In `row` direction the first level of children is distributed evenly along\n * the X axis; a child carrying the `data-fixed` attribute keeps its own width\n * and the rest share what remains.\n */\nexport const StackedCardRow = React.forwardRef<\n HTMLDivElement,\n IStackedCardRowProps\n>(\n (\n {\n role = \"custom\",\n bleed,\n direction = \"row\",\n background,\n className,\n children,\n ...rest\n },\n ref\n ): ReactElement => (\n <StyledStackedCardRow\n ref={ref}\n $role={role}\n $bleed={bleed}\n $direction={direction}\n $background={background}\n className={classnames(\n \"c-stacked-card__row\",\n `c-stacked-card__row--${role}`,\n { \"c-stacked-card__row--bleed\": bleed },\n className\n )}\n {...rest}\n >\n {children}\n </StyledStackedCardRow>\n )\n);\n\nStackedCardRow.displayName = \"StackedCardRow\";\n\n/* ------------------------------------------------------------------ */\n/* Cover */\n/* ------------------------------------------------------------------ */\n\nexport interface IStackedCardCoverProps {\n /**\n * CSS `aspect-ratio` value that reserves the cover's height, e.g.\n * `\"260 / 132\"`. A ratio, not a pixel height, so the cover scales with the\n * card and holds its space before the media loads.\n */\n aspectRatio?: string;\n /** Center slot — the media control (a play button over audio/video). */\n centerSlot?: ReactNode;\n /** Top-right slot — cover management (collapse, remove). */\n topRightSlot?: ReactNode;\n /**\n * Render the thin collapsed strip instead of the media box. The collapse\n * CONTROL lives in the caller's `topRightSlot`; this flag is the resulting\n * visual state.\n */\n collapsed?: boolean;\n /**\n * What the collapsed strip shows — an ~8px colour bar, a favicon + domain\n * row. Content-specific, so the caller supplies it.\n */\n collapsedStrip?: ReactNode;\n /** Fired when the collapsed strip's expand affordance is activated. */\n onExpand?: () => void;\n /** Accessible label for the expand affordance. */\n expandLabel?: string;\n className?: string;\n /** The fill: an `<img>`, an inline `<svg>`, or a solid-colour box. */\n children: ReactNode;\n}\n\n/**\n * A bleed row that holds media.\n *\n * Controls in either slot are revealed on hover OR focus-within, so they stay\n * reachable by keyboard. Collapsed, the media box gives way to a strip that is\n * itself the expand button.\n */\nexport const StackedCardCover = ({\n aspectRatio = STACKED_CARD_COVER_RATIO,\n centerSlot,\n topRightSlot,\n collapsed,\n collapsedStrip,\n onExpand,\n expandLabel = \"Expand cover\",\n className,\n children,\n}: IStackedCardCoverProps): ReactElement => (\n <StackedCardRow\n role=\"cover\"\n bleed\n className={classnames(\"c-stacked-card__cover\", className)}\n >\n {collapsed ? (\n <StyledStackedCardCollapsedStrip\n type=\"button\"\n aria-label={expandLabel}\n onClick={onExpand}\n className=\"c-stacked-card__cover-strip\"\n >\n {collapsedStrip}\n <StyledStackedCardStripExpand\n className={STACKED_CARD_CONTROL_CLASS}\n aria-hidden=\"true\"\n >\n <StackedCardExpandGlyph />\n </StyledStackedCardStripExpand>\n </StyledStackedCardCollapsedStrip>\n ) : (\n <StyledStackedCardCoverMedia\n $aspectRatio={aspectRatio}\n className=\"c-stacked-card__cover-media\"\n >\n <StyledStackedCardCoverFill>{children}</StyledStackedCardCoverFill>\n {centerSlot ? (\n <StyledStackedCardCoverCenter className={STACKED_CARD_CONTROL_CLASS}>\n {centerSlot}\n </StyledStackedCardCoverCenter>\n ) : null}\n {topRightSlot ? (\n <StyledStackedCardCoverTopRight\n className={STACKED_CARD_CONTROL_CLASS}\n >\n {topRightSlot}\n </StyledStackedCardCoverTopRight>\n ) : null}\n </StyledStackedCardCoverMedia>\n )}\n </StackedCardRow>\n);\n\nStackedCardCover.displayName = \"StackedCardCover\";\n\n/* ------------------------------------------------------------------ */\n/* Cover chrome */\n/* ------------------------------------------------------------------ */\n\n/** Centered media control (a play button). Drop the glyph inside. */\nexport const StackedCardPlayBadge = StyledStackedCardPlayBadge;\n\n/** Top-right cover-management button (collapse, remove …). */\nexport const StackedCardCoverButton = StyledStackedCardCoverButton;\n"],"mappings":";;;AAAA,OAAOA,KAAK,MAAmC,OAAO;AAEtD,OAAOC,UAAU,MAAM,YAAY;AAEnC,SACEC,0BAA0B,EAC1BC,wBAAwB,QAGnB,aAAa;AACpB,SAASC,sBAAsB,QAAQ,UAAU;AACjD,SACEC,+BAA+B,EAC/BC,4BAA4B,EAC5BC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,0BAA0B,EAC1BC,oBAAoB,EACpBC,sBAAsB,EACtBC,4BAA4B,QACvB,UAAU;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,OAAO,MAAMC,gBAAg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AAgB,CAACD,WAAW,GAAG,kBAAkB;;AAEjD;AACA;AACA;;AAEA;AACA,OAAO,MAAMe,oBAAoB,GAAGzC,0BAA0B;;AAE9D;AACA,OAAO,MAAM0C,sBAAsB,GAAG/C,4BAA4B","ignoreList":[]}
@@ -0,0 +1,74 @@
1
+ import React, { ReactNode } from "react";
2
+ /**
3
+ * StackedCard — the hollow shell for cards on drag-and-drop surfaces.
4
+ *
5
+ * This is NOT the base for cards in lists. It is the card for surfaces where
6
+ * dragging is a primary interaction: column boards and canvases. Content is
7
+ * laid out top to bottom in `StackedCardRow`s, which makes every card a
8
+ * portrait presentation of its data.
9
+ *
10
+ * ── The rule the whole subsystem hangs on ──────────────────────────────────
11
+ * THE SHELL STAYS HOLLOW. There is no `contentType` enum here, no per-type
12
+ * prop soup, no `if task …`. The shell owns only VISUAL STATES (selected,
13
+ * disabled, pending, priority, drag source/preview, entered) and one intent
14
+ * callback (`onResizeDelta`). Content is passed as `children` and composes the
15
+ * layout primitives. Typed cards — an ImageCard, a LinkCard, a TaskCard — are
16
+ * facades built on top of it in the consuming app, and adding one requires
17
+ * ZERO changes in this file.
18
+ *
19
+ * ── What the shell does NOT do ────────────────────────────────────────────
20
+ * It implements no drag-and-drop, no selection bookkeeping, no resize policy
21
+ * and no keyboard navigation. The card reports; the host decides. Drag
22
+ * choreography (the drag layer, the landing indicator, the drop) belongs to
23
+ * the host surface, which then feeds the result back as `isDragSource` /
24
+ * `isDragPreview`. The shell forwards its ref and spreads DOM props, so a host
25
+ * can attach `tabIndex`, ARIA, pointer and keyboard handlers to it.
26
+ *
27
+ * ── Theming ───────────────────────────────────────────────────────────────
28
+ * Colours resolve through `--sc-*` custom properties with built-in fallbacks:
29
+ * `--sc-selection-ring` (selection / focus / entered) and the cover scrim
30
+ * family `--sc-scrim`, `--sc-scrim-strong`, `--sc-scrim-fg`. Declare any of
31
+ * them on an ancestor to retint a whole surface.
32
+ */
33
+ export interface IStackedCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onResize"> {
34
+ /** Host-owned selection state — a ring around the card. */
35
+ selected?: boolean;
36
+ /** Policy state: the card cannot be acted on. Dimmed, inert. */
37
+ disabled?: boolean;
38
+ /**
39
+ * Optimistic in-flight state — created or moved, not yet confirmed. Dimmed,
40
+ * non-interactive and not draggable, but distinct from `disabled`: it is
41
+ * transient, not a policy.
42
+ */
43
+ pending?: boolean;
44
+ /**
45
+ * The full-size outline placeholder left behind in the source position while
46
+ * a drag is in flight. Content is hidden but keeps its box, so neighbouring
47
+ * cards never move.
48
+ */
49
+ isDragSource?: boolean;
50
+ /**
51
+ * The 1:1 copy the host floats in its drag layer. Elevated shadow only — no
52
+ * tilt, no scale, no translate.
53
+ */
54
+ isDragPreview?: boolean;
55
+ /** Focus model: the card has been entered and focus is on an inner control. */
56
+ entered?: boolean;
57
+ /** Pin the hover treatment on, including revealed controls. For docs and specs. */
58
+ forceHover?: boolean;
59
+ /** Show the bottom-right resize grip. Opt-in, off by default. */
60
+ resizable?: boolean;
61
+ /**
62
+ * Draws the emphasis border down the left edge. A data colour, passed in by
63
+ * the caller (high priority, a label colour) — never baked into the shell.
64
+ */
65
+ priorityColor?: string;
66
+ /**
67
+ * Fired while the resize grip is dragged, with the pointer delta since the
68
+ * last event. The card reports the deltas; the host decides what they mean.
69
+ */
70
+ onResizeDelta?: (dx: number, dy: number) => void;
71
+ children: ReactNode;
72
+ }
73
+ export declare const StackedCard: React.ForwardRefExoticComponent<IStackedCardProps & React.RefAttributes<HTMLDivElement>>;
74
+ //# sourceMappingURL=StackedCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackedCard.d.ts","sourceRoot":"","sources":["../../../../src/components/StackedCard/StackedCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,SAAS,EAAuB,MAAM,OAAO,CAAC;AAQ5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC9D,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mFAAmF;IACnF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,eAAO,MAAM,WAAW,0FA0EvB,CAAC"}
@@ -0,0 +1,95 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["selected", "disabled", "pending", "isDragSource", "isDragPreview", "entered", "forceHover", "resizable", "priorityColor", "onResizeDelta", "className", "children"];
4
+ import React, { useCallback, useRef } from "react";
5
+ import classnames from "classnames";
6
+ import { STACKED_CARD_CONTROL_CLASS } from "./constants";
7
+ import { StackedCardResizeHandleGlyph } from "./Glyphs";
8
+ import { StyledStackedCard, StyledStackedCardResizeHandle } from "./Styles";
9
+
10
+ /**
11
+ * StackedCard — the hollow shell for cards on drag-and-drop surfaces.
12
+ *
13
+ * This is NOT the base for cards in lists. It is the card for surfaces where
14
+ * dragging is a primary interaction: column boards and canvases. Content is
15
+ * laid out top to bottom in `StackedCardRow`s, which makes every card a
16
+ * portrait presentation of its data.
17
+ *
18
+ * ── The rule the whole subsystem hangs on ──────────────────────────────────
19
+ * THE SHELL STAYS HOLLOW. There is no `contentType` enum here, no per-type
20
+ * prop soup, no `if task …`. The shell owns only VISUAL STATES (selected,
21
+ * disabled, pending, priority, drag source/preview, entered) and one intent
22
+ * callback (`onResizeDelta`). Content is passed as `children` and composes the
23
+ * layout primitives. Typed cards — an ImageCard, a LinkCard, a TaskCard — are
24
+ * facades built on top of it in the consuming app, and adding one requires
25
+ * ZERO changes in this file.
26
+ *
27
+ * ── What the shell does NOT do ────────────────────────────────────────────
28
+ * It implements no drag-and-drop, no selection bookkeeping, no resize policy
29
+ * and no keyboard navigation. The card reports; the host decides. Drag
30
+ * choreography (the drag layer, the landing indicator, the drop) belongs to
31
+ * the host surface, which then feeds the result back as `isDragSource` /
32
+ * `isDragPreview`. The shell forwards its ref and spreads DOM props, so a host
33
+ * can attach `tabIndex`, ARIA, pointer and keyboard handlers to it.
34
+ *
35
+ * ── Theming ───────────────────────────────────────────────────────────────
36
+ * Colours resolve through `--sc-*` custom properties with built-in fallbacks:
37
+ * `--sc-selection-ring` (selection / focus / entered) and the cover scrim
38
+ * family `--sc-scrim`, `--sc-scrim-strong`, `--sc-scrim-fg`. Declare any of
39
+ * them on an ancestor to retint a whole surface.
40
+ */
41
+
42
+ export const StackedCard = /*#__PURE__*/React.forwardRef((_ref, ref) => {
43
+ let selected = _ref.selected,
44
+ disabled = _ref.disabled,
45
+ pending = _ref.pending,
46
+ isDragSource = _ref.isDragSource,
47
+ isDragPreview = _ref.isDragPreview,
48
+ entered = _ref.entered,
49
+ forceHover = _ref.forceHover,
50
+ resizable = _ref.resizable,
51
+ priorityColor = _ref.priorityColor,
52
+ onResizeDelta = _ref.onResizeDelta,
53
+ className = _ref.className,
54
+ children = _ref.children,
55
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded);
56
+ const dragOrigin = useRef(null);
57
+ const handlePointerDown = useCallback(e => {
58
+ dragOrigin.current = {
59
+ x: e.clientX,
60
+ y: e.clientY
61
+ };
62
+ e.target.setPointerCapture(e.pointerId);
63
+ e.preventDefault();
64
+ }, []);
65
+ const handlePointerMove = useCallback(e => {
66
+ if (!dragOrigin.current || !onResizeDelta) return;
67
+ onResizeDelta(e.clientX - dragOrigin.current.x, e.clientY - dragOrigin.current.y);
68
+ dragOrigin.current = {
69
+ x: e.clientX,
70
+ y: e.clientY
71
+ };
72
+ }, [onResizeDelta]);
73
+ const handlePointerUp = useCallback(() => {
74
+ dragOrigin.current = null;
75
+ }, []);
76
+ return /*#__PURE__*/React.createElement(StyledStackedCard, _extends({
77
+ ref: ref,
78
+ $selected: selected,
79
+ $disabled: disabled,
80
+ $pending: pending,
81
+ $isDragSource: isDragSource,
82
+ $isDragPreview: isDragPreview,
83
+ $entered: entered,
84
+ $forceHover: forceHover,
85
+ $priorityColor: priorityColor,
86
+ className: classnames("c-stacked-card", className)
87
+ }, rest), children, resizable ? /*#__PURE__*/React.createElement(StyledStackedCardResizeHandle, {
88
+ className: classnames("c-stacked-card__resize-handle", STACKED_CARD_CONTROL_CLASS),
89
+ onPointerDown: handlePointerDown,
90
+ onPointerMove: handlePointerMove,
91
+ onPointerUp: handlePointerUp
92
+ }, /*#__PURE__*/React.createElement(StackedCardResizeHandleGlyph, null)) : null);
93
+ });
94
+ StackedCard.displayName = "StackedCard";
95
+ //# sourceMappingURL=StackedCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackedCard.js","names":["React","useCallback","useRef","classnames","STACKED_CARD_CONTROL_CLASS","StackedCardResizeHandleGlyph","StyledStackedCard","StyledStackedCardResizeHandle","StackedCard","forwardRef","_ref","ref","selected","disabled","pending","isDragSource","isDragPreview","entered","forceHover","resizable","priorityColor","onResizeDelta","className","children","rest","_objectWithoutPropertiesLoose","_excluded","dragOrigin","handlePointerDown","e","current","x","clientX","y","clientY","target","setPointerCapture","pointerId","preventDefault","handlePointerMove","handlePointerUp","createElement","_extends","$selected","$disabled","$pending","$isDragSource","$isDragPreview","$entered","$forceHover","$priorityColor","onPointerDown","onPointerMove","onPointerUp","displayName"],"sources":["../../../../src/components/StackedCard/StackedCard.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode, useCallback, useRef } from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { STACKED_CARD_CONTROL_CLASS } from \"./constants\";\nimport { StackedCardResizeHandleGlyph } from \"./Glyphs\";\nimport { StyledStackedCard, StyledStackedCardResizeHandle } from \"./Styles\";\n\n/**\n * StackedCard — the hollow shell for cards on drag-and-drop surfaces.\n *\n * This is NOT the base for cards in lists. It is the card for surfaces where\n * dragging is a primary interaction: column boards and canvases. Content is\n * laid out top to bottom in `StackedCardRow`s, which makes every card a\n * portrait presentation of its data.\n *\n * ── The rule the whole subsystem hangs on ──────────────────────────────────\n * THE SHELL STAYS HOLLOW. There is no `contentType` enum here, no per-type\n * prop soup, no `if task …`. The shell owns only VISUAL STATES (selected,\n * disabled, pending, priority, drag source/preview, entered) and one intent\n * callback (`onResizeDelta`). Content is passed as `children` and composes the\n * layout primitives. Typed cards — an ImageCard, a LinkCard, a TaskCard — are\n * facades built on top of it in the consuming app, and adding one requires\n * ZERO changes in this file.\n *\n * ── What the shell does NOT do ────────────────────────────────────────────\n * It implements no drag-and-drop, no selection bookkeeping, no resize policy\n * and no keyboard navigation. The card reports; the host decides. Drag\n * choreography (the drag layer, the landing indicator, the drop) belongs to\n * the host surface, which then feeds the result back as `isDragSource` /\n * `isDragPreview`. The shell forwards its ref and spreads DOM props, so a host\n * can attach `tabIndex`, ARIA, pointer and keyboard handlers to it.\n *\n * ── Theming ───────────────────────────────────────────────────────────────\n * Colours resolve through `--sc-*` custom properties with built-in fallbacks:\n * `--sc-selection-ring` (selection / focus / entered) and the cover scrim\n * family `--sc-scrim`, `--sc-scrim-strong`, `--sc-scrim-fg`. Declare any of\n * them on an ancestor to retint a whole surface.\n */\n\nexport interface IStackedCardProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onResize\"> {\n /** Host-owned selection state — a ring around the card. */\n selected?: boolean;\n /** Policy state: the card cannot be acted on. Dimmed, inert. */\n disabled?: boolean;\n /**\n * Optimistic in-flight state — created or moved, not yet confirmed. Dimmed,\n * non-interactive and not draggable, but distinct from `disabled`: it is\n * transient, not a policy.\n */\n pending?: boolean;\n /**\n * The full-size outline placeholder left behind in the source position while\n * a drag is in flight. Content is hidden but keeps its box, so neighbouring\n * cards never move.\n */\n isDragSource?: boolean;\n /**\n * The 1:1 copy the host floats in its drag layer. Elevated shadow only — no\n * tilt, no scale, no translate.\n */\n isDragPreview?: boolean;\n /** Focus model: the card has been entered and focus is on an inner control. */\n entered?: boolean;\n /** Pin the hover treatment on, including revealed controls. For docs and specs. */\n forceHover?: boolean;\n /** Show the bottom-right resize grip. Opt-in, off by default. */\n resizable?: boolean;\n /**\n * Draws the emphasis border down the left edge. A data colour, passed in by\n * the caller (high priority, a label colour) — never baked into the shell.\n */\n priorityColor?: string;\n /**\n * Fired while the resize grip is dragged, with the pointer delta since the\n * last event. The card reports the deltas; the host decides what they mean.\n */\n onResizeDelta?: (dx: number, dy: number) => void;\n children: ReactNode;\n}\n\nexport const StackedCard = React.forwardRef<HTMLDivElement, IStackedCardProps>(\n (\n {\n selected,\n disabled,\n pending,\n isDragSource,\n isDragPreview,\n entered,\n forceHover,\n resizable,\n priorityColor,\n onResizeDelta,\n className,\n children,\n ...rest\n },\n ref\n ): ReactElement => {\n const dragOrigin = useRef<{ x: number; y: number } | null>(null);\n\n const handlePointerDown = useCallback((e: React.PointerEvent) => {\n dragOrigin.current = { x: e.clientX, y: e.clientY };\n (e.target as HTMLElement).setPointerCapture(e.pointerId);\n e.preventDefault();\n }, []);\n\n const handlePointerMove = useCallback(\n (e: React.PointerEvent) => {\n if (!dragOrigin.current || !onResizeDelta) return;\n onResizeDelta(\n e.clientX - dragOrigin.current.x,\n e.clientY - dragOrigin.current.y\n );\n dragOrigin.current = { x: e.clientX, y: e.clientY };\n },\n [onResizeDelta]\n );\n\n const handlePointerUp = useCallback(() => {\n dragOrigin.current = null;\n }, []);\n\n return (\n <StyledStackedCard\n ref={ref}\n $selected={selected}\n $disabled={disabled}\n $pending={pending}\n $isDragSource={isDragSource}\n $isDragPreview={isDragPreview}\n $entered={entered}\n $forceHover={forceHover}\n $priorityColor={priorityColor}\n className={classnames(\"c-stacked-card\", className)}\n {...rest}\n >\n {children}\n {resizable ? (\n <StyledStackedCardResizeHandle\n className={classnames(\n \"c-stacked-card__resize-handle\",\n STACKED_CARD_CONTROL_CLASS\n )}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n >\n <StackedCardResizeHandleGlyph />\n </StyledStackedCardResizeHandle>\n ) : null}\n </StyledStackedCard>\n );\n }\n);\n\nStackedCard.displayName = \"StackedCard\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAA6BC,WAAW,EAAEC,MAAM,QAAQ,OAAO;AAE3E,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,0BAA0B,QAAQ,aAAa;AACxD,SAASC,4BAA4B,QAAQ,UAAU;AACvD,SAASC,iBAAiB,EAAEC,6BAA6B,QAAQ,UAAU;;AAE3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AA4CA,OAAO,MAAMC,WAAW,gBAAGR,KAAK,CAACS,UAAU,CACzC,CAAAC,IAAA,EAgBEC,GAAG,KACc;EAAA,IAffC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IACRC,OAAO,GAAAJ,IAAA,CAAPI,OAAO;IACPC,YAAY,GAAAL,IAAA,CAAZK,YAAY;IACZC,aAAa,GAAAN,IAAA,CAAbM,aAAa;IACbC,OAAO,GAAAP,IAAA,CAAPO,O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,CAACnC,iBAAiB,EAAAoC,QAAA;IAChB/B,GAAG,EAAEA,GAAI;IACTgC,SAAS,EAAE/B,QAAS;IACpBgC,SAAS,EAAE/B,QAAS;IACpBgC,QAAQ,EAAE/B,OAAQ;IAClBgC,aAAa,EAAE/B,YAAa;IAC5BgC,cAAc,EAAE/B,aAAc;IAC9BgC,QAAQ,EAAE/B,OAAQ;IAClBgC,WAAW,EAAE/B,UAAW;IACxBgC,cAAc,EAAE9B,aAAc;IAC9BE,SAAS,EAAEnB,UAAU,CAAC,gBAAgB,EAAEmB,SAAS;EAAE,GAC/CE,IAAI,GAEPD,QAAQ,EACRJ,SAAS,gBACRnB,KAAA,CAAAyC,aAAA,CAAClC,6BAA6B;IAC5Be,SAAS,EAAEnB,UAAU,CACnB,+BAA+B,EAC/BC,0BACF,CAAE;IACF+C,aAAa,EAAEvB,iBAAkB;IACjCwB,aAAa,EAAEb,iBAAkB;IACjCc,WAAW,EAAEb;EAAgB,gBAE7BxC,KAAA,CAAAyC,aAAA,CAACpC,4BAA4B,MAAE,CACF,CAAC,GAC9B,IACa,CAAC;AAExB,CACF,CAAC;AAEDG,WAAW,CAAC8C,WAAW,GAAG,aAAa","ignoreList":[]}
@@ -0,0 +1,46 @@
1
+ import { StackedCardRowDirection, StackedCardRowRole } from "./constants";
2
+ export declare const StyledStackedCardStack: import("styled-components").StyledComponent<"div", any, {}, never>;
3
+ interface IStyledRowProps {
4
+ $role: StackedCardRowRole;
5
+ $bleed?: boolean;
6
+ $direction: StackedCardRowDirection;
7
+ $background?: string;
8
+ }
9
+ export declare const StyledStackedCardRow: import("styled-components").StyledComponent<"div", any, IStyledRowProps, never>;
10
+ /**
11
+ * The media box reserves its height with `aspect-ratio` so the image (or the
12
+ * skeleton standing in for it) never reflows the card when it arrives.
13
+ */
14
+ export declare const StyledStackedCardCoverMedia: import("styled-components").StyledComponent<"div", any, {
15
+ $aspectRatio: string;
16
+ }, never>;
17
+ export declare const StyledStackedCardCoverFill: import("styled-components").StyledComponent<"div", any, {}, never>;
18
+ export declare const StyledStackedCardCoverCenter: import("styled-components").StyledComponent<"div", any, {}, never>;
19
+ export declare const StyledStackedCardCoverTopRight: import("styled-components").StyledComponent<"div", any, {}, never>;
20
+ /**
21
+ * Collapsed cover — the media box gives way to a thin strip. The strip IS the
22
+ * expand affordance: the whole bar is a button and a chevron hint is revealed
23
+ * on hover or focus. It reserves no height of its own; the caller's
24
+ * `collapsedStrip` (an ~8px colour bar, a favicon + domain row) sets how tall
25
+ * it reads.
26
+ */
27
+ export declare const StyledStackedCardCollapsedStrip: import("styled-components").StyledComponent<"button", any, {}, never>;
28
+ export declare const StyledStackedCardStripExpand: import("styled-components").StyledComponent<"span", any, {}, never>;
29
+ /** Centered media control (a play button). The caller drops the glyph inside. */
30
+ export declare const StyledStackedCardPlayBadge: import("styled-components").StyledComponent<"span", any, {}, never>;
31
+ /** Top-right cover-management button (collapse, remove …). */
32
+ export declare const StyledStackedCardCoverButton: import("styled-components").StyledComponent<"button", any, {}, never>;
33
+ export declare const StyledStackedCardResizeHandle: import("styled-components").StyledComponent<"span", any, {}, never>;
34
+ export interface IStyledStackedCardProps {
35
+ $selected?: boolean;
36
+ $disabled?: boolean;
37
+ $pending?: boolean;
38
+ $isDragSource?: boolean;
39
+ $isDragPreview?: boolean;
40
+ $entered?: boolean;
41
+ $forceHover?: boolean;
42
+ $priorityColor?: string;
43
+ }
44
+ export declare const StyledStackedCard: import("styled-components").StyledComponent<"div", any, IStyledStackedCardProps, never>;
45
+ export {};
46
+ //# sourceMappingURL=Styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/StackedCard/Styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,uBAAuB,EACvB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAwCrB,eAAO,MAAM,sBAAsB,oEAMlC,CAAC;AAOF,UAAU,eAAe;IACvB,KAAK,EAAE,kBAAkB,CAAC;IAC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