@activecollab/components 2.0.368 → 2.0.370

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 (100) hide show
  1. package/dist/cjs/components/StackedCard/Glyphs.js +86 -0
  2. package/dist/cjs/components/StackedCard/Glyphs.js.map +1 -0
  3. package/dist/cjs/components/StackedCard/Primitives.js +129 -0
  4. package/dist/cjs/components/StackedCard/Primitives.js.map +1 -0
  5. package/dist/cjs/components/StackedCard/StackedCard.js +103 -0
  6. package/dist/cjs/components/StackedCard/StackedCard.js.map +1 -0
  7. package/dist/cjs/components/StackedCard/Styles.js +192 -0
  8. package/dist/cjs/components/StackedCard/Styles.js.map +1 -0
  9. package/dist/cjs/components/StackedCard/constants.js +54 -0
  10. package/dist/cjs/components/StackedCard/constants.js.map +1 -0
  11. package/dist/cjs/components/StackedCard/index.js +50 -0
  12. package/dist/cjs/components/StackedCard/index.js.map +1 -0
  13. package/dist/cjs/components/index.js +11 -0
  14. package/dist/cjs/components/index.js.map +1 -1
  15. package/dist/cjs/presentation/shared/SourceCodeSection.js +183 -117
  16. package/dist/cjs/presentation/shared/SourceCodeSection.js.map +1 -1
  17. package/dist/cjs/presentation/stackedCard/content/ImageCard.js +5 -6
  18. package/dist/cjs/presentation/stackedCard/content/ImageCard.js.map +1 -1
  19. package/dist/cjs/presentation/stackedCard/content/LinkCard.js +28 -23
  20. package/dist/cjs/presentation/stackedCard/content/LinkCard.js.map +1 -1
  21. package/dist/cjs/presentation/stackedCard/content/NoteCard.js +5 -5
  22. package/dist/cjs/presentation/stackedCard/content/NoteCard.js.map +1 -1
  23. package/dist/cjs/presentation/stackedCard/content/SwatchCard.js +7 -8
  24. package/dist/cjs/presentation/stackedCard/content/SwatchCard.js.map +1 -1
  25. package/dist/cjs/presentation/stackedCard/content/TaskCard.js +9 -10
  26. package/dist/cjs/presentation/stackedCard/content/TaskCard.js.map +1 -1
  27. package/dist/cjs/presentation/stackedCard/content/shared.js +27 -7
  28. package/dist/cjs/presentation/stackedCard/content/shared.js.map +1 -1
  29. package/dist/cjs/presentation/stackedCard/storyScaffold.js +8 -6
  30. package/dist/cjs/presentation/stackedCard/storyScaffold.js.map +1 -1
  31. package/dist/esm/components/StackedCard/Glyphs.d.ts +19 -0
  32. package/dist/esm/components/StackedCard/Glyphs.d.ts.map +1 -0
  33. package/dist/esm/components/StackedCard/Glyphs.js +72 -0
  34. package/dist/esm/components/StackedCard/Glyphs.js.map +1 -0
  35. package/dist/esm/components/StackedCard/Primitives.d.ts +91 -0
  36. package/dist/esm/components/StackedCard/Primitives.d.ts.map +1 -0
  37. package/dist/esm/components/StackedCard/Primitives.js +122 -0
  38. package/dist/esm/components/StackedCard/Primitives.js.map +1 -0
  39. package/dist/esm/components/StackedCard/StackedCard.d.ts +74 -0
  40. package/dist/esm/components/StackedCard/StackedCard.d.ts.map +1 -0
  41. package/dist/esm/components/StackedCard/StackedCard.js +95 -0
  42. package/dist/esm/components/StackedCard/StackedCard.js.map +1 -0
  43. package/dist/esm/components/StackedCard/Styles.d.ts +46 -0
  44. package/dist/esm/components/StackedCard/Styles.d.ts.map +1 -0
  45. package/dist/esm/components/StackedCard/Styles.js +186 -0
  46. package/dist/esm/components/StackedCard/Styles.js.map +1 -0
  47. package/dist/esm/components/StackedCard/constants.d.ts +37 -0
  48. package/dist/esm/components/StackedCard/constants.d.ts.map +1 -0
  49. package/dist/esm/components/StackedCard/constants.js +48 -0
  50. package/dist/esm/components/StackedCard/constants.js.map +1 -0
  51. package/dist/esm/components/StackedCard/index.d.ts +5 -0
  52. package/dist/esm/components/StackedCard/index.d.ts.map +1 -0
  53. package/dist/esm/components/StackedCard/index.js +5 -0
  54. package/dist/esm/components/StackedCard/index.js.map +1 -0
  55. package/dist/esm/components/index.d.ts +1 -0
  56. package/dist/esm/components/index.d.ts.map +1 -1
  57. package/dist/esm/components/index.js +1 -0
  58. package/dist/esm/components/index.js.map +1 -1
  59. package/dist/esm/presentation/shared/SourceCodeSection.d.ts.map +1 -1
  60. package/dist/esm/presentation/shared/SourceCodeSection.js +183 -116
  61. package/dist/esm/presentation/shared/SourceCodeSection.js.map +1 -1
  62. package/dist/esm/presentation/stackedCard/content/ImageCard.d.ts.map +1 -1
  63. package/dist/esm/presentation/stackedCard/content/ImageCard.js +2 -3
  64. package/dist/esm/presentation/stackedCard/content/ImageCard.js.map +1 -1
  65. package/dist/esm/presentation/stackedCard/content/LinkCard.d.ts.map +1 -1
  66. package/dist/esm/presentation/stackedCard/content/LinkCard.js +14 -9
  67. package/dist/esm/presentation/stackedCard/content/LinkCard.js.map +1 -1
  68. package/dist/esm/presentation/stackedCard/content/NoteCard.js +1 -1
  69. package/dist/esm/presentation/stackedCard/content/NoteCard.js.map +1 -1
  70. package/dist/esm/presentation/stackedCard/content/SwatchCard.d.ts.map +1 -1
  71. package/dist/esm/presentation/stackedCard/content/SwatchCard.js +2 -3
  72. package/dist/esm/presentation/stackedCard/content/SwatchCard.js.map +1 -1
  73. package/dist/esm/presentation/stackedCard/content/TaskCard.d.ts.map +1 -1
  74. package/dist/esm/presentation/stackedCard/content/TaskCard.js +1 -2
  75. package/dist/esm/presentation/stackedCard/content/TaskCard.js.map +1 -1
  76. package/dist/esm/presentation/stackedCard/content/shared.d.ts +15 -0
  77. package/dist/esm/presentation/stackedCard/content/shared.d.ts.map +1 -1
  78. package/dist/esm/presentation/stackedCard/content/shared.js +22 -2
  79. package/dist/esm/presentation/stackedCard/content/shared.js.map +1 -1
  80. package/dist/esm/presentation/stackedCard/storyScaffold.d.ts +8 -6
  81. package/dist/esm/presentation/stackedCard/storyScaffold.d.ts.map +1 -1
  82. package/dist/esm/presentation/stackedCard/storyScaffold.js +8 -6
  83. package/dist/esm/presentation/stackedCard/storyScaffold.js.map +1 -1
  84. package/dist/index.js +1213 -686
  85. package/dist/index.js.map +1 -1
  86. package/dist/index.min.js +1 -1
  87. package/dist/index.min.js.map +1 -1
  88. package/package.json +1 -1
  89. package/dist/cjs/presentation/stackedCard/primitives.js +0 -254
  90. package/dist/cjs/presentation/stackedCard/primitives.js.map +0 -1
  91. package/dist/cjs/presentation/stackedCard/shell.js +0 -165
  92. package/dist/cjs/presentation/stackedCard/shell.js.map +0 -1
  93. package/dist/esm/presentation/stackedCard/primitives.d.ts +0 -84
  94. package/dist/esm/presentation/stackedCard/primitives.d.ts.map +0 -1
  95. package/dist/esm/presentation/stackedCard/primitives.js +0 -241
  96. package/dist/esm/presentation/stackedCard/primitives.js.map +0 -1
  97. package/dist/esm/presentation/stackedCard/shell.d.ts +0 -46
  98. package/dist/esm/presentation/stackedCard/shell.d.ts.map +0 -1
  99. package/dist/esm/presentation/stackedCard/shell.js +0 -156
  100. package/dist/esm/presentation/stackedCard/shell.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activecollab/components",
3
- "version": "2.0.368",
3
+ "version": "2.0.370",
4
4
  "description": "ActiveCollab Components",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,254 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.StackRow = exports.Stack = exports.RemoveCoverGlyph = exports.ROLE_PADDING = exports.PlayBadge = exports.ExpandGlyph = exports.CoverButton = exports.Cover = exports.CollapseGlyph = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- /**
12
- * StackedCard layout primitives (story-local, presentation-only).
13
- *
14
- * These are the documented foundation of the StackedCard subsystem — the
15
- * building blocks that every StackedCard concept story in this task set
16
- * imports from. They are NOT exported from the design-system barrel; they
17
- * live here so the concept stories share one source of truth instead of
18
- * re-declaring one-off styled blocks.
19
- *
20
- * Three primitives:
21
- * - Stack — the vertical column. A card is a Stack of StackRows.
22
- * - StackRow — the one layout primitive. Everything (cover, title, meta,
23
- * footer) is a row; a `role` sets the default padding and the
24
- * allowed direction so the anatomy stays predictable.
25
- * - Cover — sugar for a bleed row that holds media, reserves its height
26
- * with `aspect-ratio` (so a late image never reflows), and
27
- * carries two control slots (center + top-right).
28
- *
29
- * Colours here come exclusively from CSS variables — the dark scrim behind
30
- * cover controls is `--sc-scrim` / `--sc-scrim-strong` / `--sc-scrim-fg`, all
31
- * declared story-side as DS token candidates. No rgba/hex is hardcoded in a
32
- * primitive; only data colours (a swatch value, a label dot) are ever literal,
33
- * and those are passed in by the content, never baked in here.
34
- */
35
-
36
- /* ------------------------------------------------------------------ */
37
- /* Stack — vertical flex column. No own padding. */
38
- /* ------------------------------------------------------------------ */
39
-
40
- var Stack = exports.Stack = _styledComponents.default.div.withConfig({
41
- displayName: "primitives__Stack",
42
- componentId: "sc-1ax68l9-0"
43
- })(["position:relative;display:flex;flex-direction:column;"]);
44
-
45
- /* ------------------------------------------------------------------ */
46
- /* StackRow — the only layout primitive, differentiated by `role`. */
47
- /* ------------------------------------------------------------------ */
48
-
49
- /**
50
- * Role → default padding. The row is the increment: title/footer carry the
51
- * system padding, meta is a tighter properties line, cover bleeds to the edge.
52
- * `custom` starts from the system padding and expects the caller to adjust.
53
- */
54
- var ROLE_PADDING = exports.ROLE_PADDING = {
55
- cover: "0",
56
- title: "8px 12px",
57
- meta: "2px 12px 4px",
58
- footer: "8px 12px",
59
- custom: "8px 12px"
60
- };
61
- var StyledRow = _styledComponents.default.div.withConfig({
62
- displayName: "primitives__StyledRow",
63
- componentId: "sc-1ax68l9-1"
64
- })(["position:relative;display:flex;flex-direction:", ";align-items:", ";gap:", ";padding:", ";", " ", ""], function (_ref) {
65
- var $direction = _ref.$direction;
66
- return $direction;
67
- }, function (_ref2) {
68
- var $direction = _ref2.$direction;
69
- return $direction === "column" ? "stretch" : "center";
70
- }, function (_ref3) {
71
- var $direction = _ref3.$direction;
72
- return $direction === "column" ? "4px" : "8px";
73
- }, function (_ref4) {
74
- var $role = _ref4.$role,
75
- $bleed = _ref4.$bleed;
76
- return $bleed ? "0" : ROLE_PADDING[$role];
77
- }, function (_ref5) {
78
- var $background = _ref5.$background;
79
- return $background && (0, _styledComponents.css)(["background:", ";"], $background);
80
- }, function (_ref6) {
81
- var $direction = _ref6.$direction;
82
- return $direction === "row" && (0, _styledComponents.css)(["> *{flex:1 1 0;min-width:0;}> [data-fixed]{flex:0 0 auto;}"]);
83
- });
84
- var StackRow = exports.StackRow = function StackRow(_ref7) {
85
- var _ref7$role = _ref7.role,
86
- role = _ref7$role === void 0 ? "custom" : _ref7$role,
87
- bleed = _ref7.bleed,
88
- _ref7$direction = _ref7.direction,
89
- direction = _ref7$direction === void 0 ? "row" : _ref7$direction,
90
- background = _ref7.background,
91
- className = _ref7.className,
92
- children = _ref7.children;
93
- return /*#__PURE__*/_react.default.createElement(StyledRow, {
94
- $role: role,
95
- $bleed: bleed,
96
- $direction: direction,
97
- $background: background,
98
- className: className
99
- }, children);
100
- };
101
-
102
- /* ------------------------------------------------------------------ */
103
- /* Cover — sugar for a bleed row that holds media. */
104
- /* ------------------------------------------------------------------ */
105
-
106
- /**
107
- * The media box reserves its height with `aspect-ratio` so the image (or the
108
- * skeleton that stands in for it) never reflows the card when it arrives.
109
- * Controls carry the `sc-control` class and are hidden until the cover is
110
- * hovered OR holds focus (`:focus-within`) — the focus path keeps the cover
111
- * controls reachable by keyboard, not mouse-only.
112
- */
113
- var StyledCoverMedia = _styledComponents.default.div.withConfig({
114
- displayName: "primitives__StyledCoverMedia",
115
- componentId: "sc-1ax68l9-2"
116
- })(["position:relative;width:100%;aspect-ratio:", ";overflow:hidden;.sc-control{opacity:0;transition:opacity 120ms ease;}&:hover .sc-control,&:focus-within .sc-control{opacity:1;}"], function (_ref8) {
117
- var $aspectRatio = _ref8.$aspectRatio;
118
- return $aspectRatio;
119
- });
120
-
121
- /* The fill (an <img>, an inline <svg> wrapper, or a solid-colour box) is laid
122
- over the reserved box and made to cover it. */
123
- var StyledCoverFill = _styledComponents.default.div.withConfig({
124
- displayName: "primitives__StyledCoverFill",
125
- componentId: "sc-1ax68l9-3"
126
- })(["position:absolute;inset:0;> *{width:100%;height:100%;}> img{display:block;object-fit:cover;}"]);
127
- var StyledCoverCenter = _styledComponents.default.div.withConfig({
128
- displayName: "primitives__StyledCoverCenter",
129
- componentId: "sc-1ax68l9-4"
130
- })(["position:absolute;inset:0;display:flex;align-items:center;justify-content:center;"]);
131
- var StyledCoverTopRight = _styledComponents.default.div.withConfig({
132
- displayName: "primitives__StyledCoverTopRight",
133
- componentId: "sc-1ax68l9-5"
134
- })(["position:absolute;top:8px;right:8px;display:flex;gap:6px;"]);
135
-
136
- /**
137
- * Collapsed cover — the media box gives way to a thin strip. The strip is the
138
- * expand affordance itself: the whole bar is a button, and a chevron hint is
139
- * revealed on hover OR focus (`.sc-control`, same reveal rule as every other
140
- * cover control) so it is reachable by keyboard, not mouse-only. The strip
141
- * holds no reserved height of its own — the caller's `collapsedStrip` (an ~8px
142
- * colour bar, or a favicon + domain row for links) sets how tall it reads.
143
- */
144
- var StyledCollapsedStrip = _styledComponents.default.button.withConfig({
145
- displayName: "primitives__StyledCollapsedStrip",
146
- componentId: "sc-1ax68l9-6"
147
- })(["position:relative;display:flex;align-items:center;width:100%;min-height:16px;padding:0;border:0;background:transparent;cursor:pointer;text-align:left;.sc-control{opacity:0;transition:opacity 120ms ease;}&:hover .sc-control,&:focus-visible .sc-control{opacity:1;}&:focus-visible{outline:2px solid var(--sc-selection-ring);outline-offset:-2px;}"]);
148
-
149
- /* The expand chevron sits at the right, vertically centred over the strip, so
150
- it reads the same whether the strip is a hairline colour bar or a taller
151
- favicon row. Small + theme-coloured so it fits a thin strip without a scrim
152
- button (the whole strip is the button). */
153
- var StyledStripExpand = _styledComponents.default.span.withConfig({
154
- displayName: "primitives__StyledStripExpand",
155
- componentId: "sc-1ax68l9-7"
156
- })(["position:absolute;top:50%;right:8px;transform:translateY(-50%);display:inline-flex;width:16px;height:16px;color:var(--color-theme-600);svg{width:14px;height:14px;}"]);
157
- var Cover = exports.Cover = function Cover(_ref9) {
158
- var _ref9$aspectRatio = _ref9.aspectRatio,
159
- aspectRatio = _ref9$aspectRatio === void 0 ? "260 / 132" : _ref9$aspectRatio,
160
- centerSlot = _ref9.centerSlot,
161
- topRightSlot = _ref9.topRightSlot,
162
- collapsed = _ref9.collapsed,
163
- collapsedStrip = _ref9.collapsedStrip,
164
- onExpand = _ref9.onExpand,
165
- _ref9$expandLabel = _ref9.expandLabel,
166
- expandLabel = _ref9$expandLabel === void 0 ? "Expand cover" : _ref9$expandLabel,
167
- className = _ref9.className,
168
- children = _ref9.children;
169
- return /*#__PURE__*/_react.default.createElement(StackRow, {
170
- role: "cover",
171
- bleed: true,
172
- className: className
173
- }, collapsed ? /*#__PURE__*/_react.default.createElement(StyledCollapsedStrip, {
174
- type: "button",
175
- "aria-label": expandLabel,
176
- onClick: onExpand
177
- }, collapsedStrip, /*#__PURE__*/_react.default.createElement(StyledStripExpand, {
178
- className: "sc-control",
179
- "aria-hidden": "true"
180
- }, /*#__PURE__*/_react.default.createElement(ExpandGlyph, null))) : /*#__PURE__*/_react.default.createElement(StyledCoverMedia, {
181
- $aspectRatio: aspectRatio
182
- }, /*#__PURE__*/_react.default.createElement(StyledCoverFill, null, children), centerSlot ? /*#__PURE__*/_react.default.createElement(StyledCoverCenter, {
183
- className: "sc-control"
184
- }, centerSlot) : null, topRightSlot ? /*#__PURE__*/_react.default.createElement(StyledCoverTopRight, {
185
- className: "sc-control"
186
- }, topRightSlot) : null));
187
- };
188
-
189
- /* ------------------------------------------------------------------ */
190
- /* Cover controls — dark, scrim-backed chrome shared by every story. */
191
- /* ------------------------------------------------------------------ */
192
-
193
- /* Centered media control (a play button). The caller drops the glyph inside. */
194
- var PlayBadge = exports.PlayBadge = _styledComponents.default.span.withConfig({
195
- displayName: "primitives__PlayBadge",
196
- componentId: "sc-1ax68l9-8"
197
- })(["display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:12px;background:var(--sc-scrim);color:var(--sc-scrim-fg);svg{fill:currentColor;width:20px;height:20px;margin-left:2px;}"]);
198
-
199
- /* Top-right cover-management button (collapse, remove …). */
200
- var CoverButton = exports.CoverButton = _styledComponents.default.button.withConfig({
201
- displayName: "primitives__CoverButton",
202
- componentId: "sc-1ax68l9-9"
203
- })(["display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:8px;cursor:pointer;color:var(--sc-scrim-fg);background:var(--sc-scrim);svg{width:16px;height:16px;display:block;}&:hover{background:var(--sc-scrim-strong);}"]);
204
-
205
- /* Cover-management glyphs (act on the cover itself, not the entity). */
206
- var CollapseGlyph = exports.CollapseGlyph = function CollapseGlyph() {
207
- return /*#__PURE__*/_react.default.createElement("svg", {
208
- viewBox: "0 0 16 16",
209
- fill: "none",
210
- "aria-hidden": "true"
211
- }, /*#__PURE__*/_react.default.createElement("path", {
212
- d: "M6.5 2.5v4h-4M9.5 13.5v-4h4",
213
- stroke: "currentColor",
214
- strokeWidth: "1.5",
215
- strokeLinecap: "round",
216
- strokeLinejoin: "round"
217
- }));
218
- };
219
-
220
- /* Expand glyph — the inverse of collapse; shown on the collapsed strip. */
221
- var ExpandGlyph = exports.ExpandGlyph = function ExpandGlyph() {
222
- return /*#__PURE__*/_react.default.createElement("svg", {
223
- viewBox: "0 0 16 16",
224
- fill: "none",
225
- "aria-hidden": "true"
226
- }, /*#__PURE__*/_react.default.createElement("path", {
227
- d: "M2.5 6.5v-4h4M13.5 9.5v4h-4",
228
- stroke: "currentColor",
229
- strokeWidth: "1.5",
230
- strokeLinecap: "round",
231
- strokeLinejoin: "round"
232
- }));
233
- };
234
- var RemoveCoverGlyph = exports.RemoveCoverGlyph = function RemoveCoverGlyph() {
235
- return /*#__PURE__*/_react.default.createElement("svg", {
236
- viewBox: "0 0 16 16",
237
- fill: "none",
238
- "aria-hidden": "true"
239
- }, /*#__PURE__*/_react.default.createElement("rect", {
240
- x: "2.25",
241
- y: "3.75",
242
- width: "11.5",
243
- height: "8.5",
244
- rx: "1.5",
245
- stroke: "currentColor",
246
- strokeWidth: "1.5"
247
- }), /*#__PURE__*/_react.default.createElement("path", {
248
- d: "M6 9.5L10 6M10 9.5L6 6",
249
- stroke: "currentColor",
250
- strokeWidth: "1.5",
251
- strokeLinecap: "round"
252
- }));
253
- };
254
- //# sourceMappingURL=primitives.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"primitives.js","names":["_react","_interopRequireDefault","require","_styledComponents","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","Stack","exports","styled","div","withConfig","displayName","componentId","ROLE_PADDING","cover","title","meta","footer","custom","StyledRow","_ref","$direction","_ref2","_ref3","_ref4","$role","$bleed","_ref5","$background","css","_ref6","StackRow","_ref7","_ref7$role","role","bleed","_ref7$direction","direction","background","className","children","createElement","StyledCoverMedia","_ref8","$aspectRatio","StyledCoverFill","StyledCoverCenter","StyledCoverTopRight","StyledCollapsedStrip","button","StyledStripExpand","span","Cover","_ref9","_ref9$aspectRatio","aspectRatio","centerSlot","topRightSlot","collapsed","collapsedStrip","onExpand","_ref9$expandLabel","expandLabel","type","onClick","ExpandGlyph","PlayBadge","CoverButton","CollapseGlyph","viewBox","fill","d","stroke","strokeWidth","strokeLinecap","strokeLinejoin","RemoveCoverGlyph","x","y","width","height","rx"],"sources":["../../../../src/presentation/stackedCard/primitives.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode } from \"react\";\n\nimport styled, { css } from \"styled-components\";\n\n/**\n * StackedCard layout primitives (story-local, presentation-only).\n *\n * These are the documented foundation of the StackedCard subsystem — the\n * building blocks that every StackedCard concept story in this task set\n * imports from. They are NOT exported from the design-system barrel; they\n * live here so the concept stories share one source of truth instead of\n * re-declaring one-off styled blocks.\n *\n * Three primitives:\n * - Stack — the vertical column. A card is a Stack of StackRows.\n * - StackRow — the one layout primitive. Everything (cover, title, meta,\n * footer) is a row; a `role` sets the default padding and the\n * allowed direction so the anatomy stays predictable.\n * - Cover — sugar for a bleed row that holds media, reserves its height\n * with `aspect-ratio` (so a late image never reflows), and\n * carries two control slots (center + top-right).\n *\n * Colours here come exclusively from CSS variables — the dark scrim behind\n * cover controls is `--sc-scrim` / `--sc-scrim-strong` / `--sc-scrim-fg`, all\n * declared story-side as DS token candidates. No rgba/hex is hardcoded in a\n * primitive; only data colours (a swatch value, a label dot) are ever literal,\n * and those are passed in by the content, never baked in here.\n */\n\n/* ------------------------------------------------------------------ */\n/* Stack — vertical flex column. No own padding. */\n/* ------------------------------------------------------------------ */\n\nexport const Stack = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n`;\n\n/* ------------------------------------------------------------------ */\n/* StackRow — the only layout primitive, differentiated by `role`. */\n/* ------------------------------------------------------------------ */\n\nexport type StackRowRole = \"cover\" | \"title\" | \"meta\" | \"footer\" | \"custom\";\n\nexport type StackRowDirection = \"row\" | \"column\";\n\n/**\n * Role → default padding. The row is the increment: title/footer carry the\n * system padding, meta is a tighter properties line, cover bleeds to the edge.\n * `custom` starts from the system padding and expects the caller to adjust.\n */\nexport const ROLE_PADDING: Record<StackRowRole, string> = {\n cover: \"0\",\n title: \"8px 12px\",\n meta: \"2px 12px 4px\",\n footer: \"8px 12px\",\n custom: \"8px 12px\",\n};\n\ninterface StyledRowProps {\n $role: StackRowRole;\n $bleed?: boolean;\n $direction: StackRowDirection;\n $background?: string;\n}\n\nconst StyledRow = styled.div<StyledRowProps>`\n position: relative;\n display: flex;\n flex-direction: ${({ $direction }) => $direction};\n align-items: ${({ $direction }) =>\n $direction === \"column\" ? \"stretch\" : \"center\"};\n gap: ${({ $direction }) => ($direction === \"column\" ? \"4px\" : \"8px\")};\n\n /* bleed overrides any role and runs the row edge to edge. */\n padding: ${({ $role, $bleed }) => ($bleed ? \"0\" : ROLE_PADDING[$role])};\n\n ${({ $background }) =>\n $background &&\n css`\n background: ${$background};\n `}\n\n /* Distribution (row direction only): fixed-width children keep their width,\n the rest share what remains evenly; drop an empty spacer to push items. */\n ${({ $direction }) =>\n $direction === \"row\" &&\n css`\n > * {\n flex: 1 1 0;\n min-width: 0;\n }\n\n > [data-fixed] {\n flex: 0 0 auto;\n }\n `}\n`;\n\nexport interface StackRowProps {\n /** Named role → default padding + allowed direction. Defaults to `custom`. */\n role?: StackRowRole;\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?: StackRowDirection;\n /** A row can carry its own background (the tinted link-footer band). */\n background?: string;\n className?: string;\n children: ReactNode;\n}\n\nexport const StackRow = ({\n role = \"custom\",\n bleed,\n direction = \"row\",\n background,\n className,\n children,\n}: StackRowProps): ReactElement => (\n <StyledRow\n $role={role}\n $bleed={bleed}\n $direction={direction}\n $background={background}\n className={className}\n >\n {children}\n </StyledRow>\n);\n\n/* ------------------------------------------------------------------ */\n/* Cover — sugar for a bleed row that holds media. */\n/* ------------------------------------------------------------------ */\n\n/**\n * The media box reserves its height with `aspect-ratio` so the image (or the\n * skeleton that stands in for it) never reflows the card when it arrives.\n * Controls carry the `sc-control` class and are hidden until the cover is\n * hovered OR holds focus (`:focus-within`) — the focus path keeps the cover\n * controls reachable by keyboard, not mouse-only.\n */\nconst StyledCoverMedia = styled.div<{ $aspectRatio: string }>`\n position: relative;\n width: 100%;\n aspect-ratio: ${({ $aspectRatio }) => $aspectRatio};\n overflow: hidden;\n\n .sc-control {\n opacity: 0;\n transition: opacity 120ms ease;\n }\n\n &:hover .sc-control,\n &:focus-within .sc-control {\n opacity: 1;\n }\n`;\n\n/* The fill (an <img>, an inline <svg> wrapper, or a solid-colour box) is laid\n over the reserved box and made to cover it. */\nconst StyledCoverFill = styled.div`\n position: absolute;\n inset: 0;\n\n > * {\n width: 100%;\n height: 100%;\n }\n\n > img {\n display: block;\n object-fit: cover;\n }\n`;\n\nconst StyledCoverCenter = styled.div`\n position: absolute;\n inset: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\nconst StyledCoverTopRight = styled.div`\n position: absolute;\n top: 8px;\n right: 8px;\n display: flex;\n gap: 6px;\n`;\n\n/**\n * Collapsed cover — the media box gives way to a thin strip. The strip is the\n * expand affordance itself: the whole bar is a button, and a chevron hint is\n * revealed on hover OR focus (`.sc-control`, same reveal rule as every other\n * cover control) so it is reachable by keyboard, not mouse-only. The strip\n * holds no reserved height of its own — the caller's `collapsedStrip` (an ~8px\n * colour bar, or a favicon + domain row for links) sets how tall it reads.\n */\nconst StyledCollapsedStrip = styled.button`\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: 16px;\n padding: 0;\n border: 0;\n background: transparent;\n cursor: pointer;\n text-align: left;\n\n .sc-control {\n opacity: 0;\n transition: opacity 120ms ease;\n }\n\n &:hover .sc-control,\n &:focus-visible .sc-control {\n opacity: 1;\n }\n\n &:focus-visible {\n outline: 2px solid var(--sc-selection-ring);\n outline-offset: -2px;\n }\n`;\n\n/* The expand chevron sits at the right, vertically centred over the strip, so\n it reads the same whether the strip is a hairline colour bar or a taller\n favicon row. Small + theme-coloured so it fits a thin strip without a scrim\n button (the whole strip is the button). */\nconst StyledStripExpand = styled.span`\n position: absolute;\n top: 50%;\n right: 8px;\n transform: translateY(-50%);\n display: inline-flex;\n width: 16px;\n height: 16px;\n color: var(--color-theme-600);\n\n svg {\n width: 14px;\n height: 14px;\n }\n`;\n\nexport interface CoverProps {\n /**\n * CSS `aspect-ratio` value that reserves the cover's height, e.g.\n * `\"260 / 132\"`. Kept as a ratio (not a pixel height) so the cover scales\n * with the card and holds its space before 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 * Collapsed cover: render the thin strip instead of the media box. The\n * collapse *control* lives in the caller's `topRightSlot`; this flag is the\n * resulting visual state. See the \"Collapsed cover\" story section.\n */\n collapsed?: boolean;\n /**\n * What the collapsed strip shows — an ~8px colour bar, or a favicon + domain\n * row for links. 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\nexport const Cover = ({\n aspectRatio = \"260 / 132\",\n centerSlot,\n topRightSlot,\n collapsed,\n collapsedStrip,\n onExpand,\n expandLabel = \"Expand cover\",\n className,\n children,\n}: CoverProps): ReactElement => (\n <StackRow role=\"cover\" bleed className={className}>\n {collapsed ? (\n <StyledCollapsedStrip\n type=\"button\"\n aria-label={expandLabel}\n onClick={onExpand}\n >\n {collapsedStrip}\n <StyledStripExpand className=\"sc-control\" aria-hidden=\"true\">\n <ExpandGlyph />\n </StyledStripExpand>\n </StyledCollapsedStrip>\n ) : (\n <StyledCoverMedia $aspectRatio={aspectRatio}>\n <StyledCoverFill>{children}</StyledCoverFill>\n {centerSlot ? (\n <StyledCoverCenter className=\"sc-control\">\n {centerSlot}\n </StyledCoverCenter>\n ) : null}\n {topRightSlot ? (\n <StyledCoverTopRight className=\"sc-control\">\n {topRightSlot}\n </StyledCoverTopRight>\n ) : null}\n </StyledCoverMedia>\n )}\n </StackRow>\n);\n\n/* ------------------------------------------------------------------ */\n/* Cover controls — dark, scrim-backed chrome shared by every story. */\n/* ------------------------------------------------------------------ */\n\n/* Centered media control (a play button). The caller drops the glyph inside. */\nexport const PlayBadge = styled.span`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 44px;\n height: 44px;\n border-radius: 12px;\n background: var(--sc-scrim);\n color: var(--sc-scrim-fg);\n\n svg {\n fill: currentColor;\n width: 20px;\n height: 20px;\n margin-left: 2px;\n }\n`;\n\n/* Top-right cover-management button (collapse, remove …). */\nexport const CoverButton = styled.button`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 30px;\n height: 30px;\n padding: 0;\n border: 0;\n border-radius: 8px;\n cursor: pointer;\n color: var(--sc-scrim-fg);\n background: var(--sc-scrim);\n\n svg {\n width: 16px;\n height: 16px;\n display: block;\n }\n\n &:hover {\n background: var(--sc-scrim-strong);\n }\n`;\n\n/* Cover-management glyphs (act on the cover itself, not the entity). */\nexport const CollapseGlyph = (): ReactElement => (\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M6.5 2.5v4h-4M9.5 13.5v-4h4\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\n/* Expand glyph — the inverse of collapse; shown on the collapsed strip. */\nexport const ExpandGlyph = (): ReactElement => (\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M2.5 6.5v-4h4M13.5 9.5v4h-4\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport const RemoveCoverGlyph = (): ReactElement => (\n <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\">\n <rect\n x=\"2.25\"\n y=\"3.75\"\n width=\"11.5\"\n height=\"8.5\"\n rx=\"1.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n />\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,cAAc;IACrBC,WAAW,EAAC,KAAK;IACjBC,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC;EAAO,CACvB,CACE,CAAC;AAAA,CACP;;AAED;AACO,IAAMV,WAAW,GAAA1D,OAAA,CAAA0D,WAAA,GAAG,SAAdA,WAAWA,CAAA;EAAA,oBACtBpF,MAAA,CAAAe,OAAA,CAAA6C,aAAA;IAAK4B,OAAO,EAAC,WAAW;IAACC,IAAI,EAAC,MAAM;IAAC,eAAY;EAAM,gBACrDzF,MAAA,CAAAe,OAAA,CAAA6C,aAAA;IACE8B,CAAC,EAAC,6BAA6B;IAC/BC,MAAM,EAAC,cAAc;IACrBC,WAAW,EAAC,KAAK;IACjBC,aAAa,EAAC,OAAO;IACrBC,cAAc,EAAC;EAAO,CACvB,CACE,CAAC;AAAA,CACP;AAEM,IAAMC,gBAAgB,GAAArE,OAAA,CAAAqE,gBAAA,GAAG,SAAnBA,gBAAgBA,CAAA;EAAA,oBAC3B/F,MAAA,CAAAe,OAAA,CAAA6C,aAAA;IAAK4B,OAAO,EAAC,WAAW;IAACC,IAAI,EAAC,MAAM;IAAC,eAAY;EAAM,gBACrDzF,MAAA,CAAAe,OAAA,CAAA6C,aAAA;IACEoC,CAAC,EAAC,MAAM;IACRC,CAAC,EAAC,MAAM;IACRC,KAAK,EAAC,MAAM;IACZC,MAAM,EAAC,KAAK;IACZC,EAAE,EAAC,KAAK;IACRT,MAAM,EAAC,cAAc;IACrBC,WAAW,EAAC;EAAK,CAClB,CAAC,eACF5F,MAAA,CAAAe,OAAA,CAAA6C,aAAA;IACE8B,CAAC,EAAC,wBAAwB;IAC1BC,MAAM,EAAC,cAAc;IACrBC,WAAW,EAAC,KAAK;IACjBC,aAAa,EAAC;EAAO,CACtB,CACE,CAAC;AAAA,CACP","ignoreList":[]}
@@ -1,165 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.StackedCard = exports.ResizeHandleGlyph = exports.COVER_RATIO_SWATCH = exports.COVER_RATIO_IMAGE = exports.COVER_RATIO_HERO = exports.COVER_RATIO = exports.CARD_WIDTH = exports.CARD_RADIUS = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
- var _excluded = ["selected", "disabled", "pending", "isDragSource", "isDragPreview", "entered", "forceHover", "resizable", "priorityColor", "onResizeDelta", "children"];
10
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
11
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
12
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
13
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
14
- /**
15
- * StackedCard shell (story-local, presentation-only).
16
- *
17
- * The hollow frame every typed content component composes. Extracted from the
18
- * concept spec story (task 2/8) so the StackedCard concept stories share one
19
- * shell instead of re-declaring it. The rule the whole subsystem hangs on:
20
- *
21
- * THE SHELL STAYS HOLLOW.
22
- *
23
- * There is no `contentType` enum here, no per-type prop soup, no `if task …`.
24
- * The shell owns only VISUAL STATES (selected, disabled, pending, priority,
25
- * drag source/preview, entered) and the intent surface (`onResizeDelta`, the
26
- * DOM props it forwards). Content — a task, a link, an image, a swatch, a note
27
- * — is passed in as `children` and composes the layout primitives. A new
28
- * content type later is a new wrapper, with ZERO changes in this file.
29
- *
30
- * Not exported from the design-system barrel; it lives here so the concept
31
- * stories share one source of truth.
32
- */
33
-
34
- /* ------------------------------------------------------------------ */
35
- /* Reference dimensions (from the concept) */
36
- /* ------------------------------------------------------------------ */
37
-
38
- var CARD_WIDTH = exports.CARD_WIDTH = 260;
39
- var CARD_RADIUS = exports.CARD_RADIUS = 8;
40
-
41
- /* Cover heights are reserved with aspect-ratio (width / height) so a late image
42
- never reflows the card. Per-type ratios live with the shell so every content
43
- component reserves the same space its skeleton does. */
44
- var COVER_RATIO = exports.COVER_RATIO = "260 / 132";
45
- var COVER_RATIO_HERO = exports.COVER_RATIO_HERO = "320 / 190";
46
- var COVER_RATIO_IMAGE = exports.COVER_RATIO_IMAGE = "260 / 168";
47
- var COVER_RATIO_SWATCH = exports.COVER_RATIO_SWATCH = "260 / 104";
48
-
49
- /* ------------------------------------------------------------------ */
50
- /* Shell chrome */
51
- /* ------------------------------------------------------------------ */
52
-
53
- var hoverStyle = (0, _styledComponents.css)(["box-shadow:0 4px 12px rgba(0,0,0,0.12);border-color:var(--color-theme-500);"]);
54
-
55
- /* Controls (cover + entity) share one reveal rule: hidden until the card is
56
- hovered OR holds focus, so they are reachable by keyboard, not mouse-only.
57
- The cover also reveals its own controls; `&&` gives the forced-on state the
58
- specificity to win over that resting rule. */
59
- var revealControls = (0, _styledComponents.css)([".sc-control{opacity:0;transition:opacity 120ms ease;}&:hover .sc-control,&:focus-within .sc-control{opacity:1;}"]);
60
- var StyledCard = _styledComponents.default.div.withConfig({
61
- displayName: "shell__StyledCard",
62
- componentId: "sc-nmi1iu-0"
63
- })(["position:relative;display:flex;flex-direction:column;width:", "px;border-radius:", "px;background-color:var(--page-paper-main);border:1px solid var(--border-primary);box-shadow:0 1px 3px rgba(0,0,0,0.08);overflow:hidden;transition:box-shadow 150ms ease,border-color 150ms ease;", " &:hover{", "}&:focus-visible{outline:none;", " box-shadow:0 0 0 2px var(--sc-selection-ring);}", " ", " ", " ", " ", " ", " ", " ", ""], CARD_WIDTH, CARD_RADIUS, revealControls, hoverStyle, hoverStyle, function (_ref) {
64
- var $forceHover = _ref.$forceHover;
65
- return $forceHover && (0, _styledComponents.css)(["", " && .sc-control{opacity:1;}"], hoverStyle);
66
- }, function (_ref2) {
67
- var $priorityColor = _ref2.$priorityColor;
68
- return $priorityColor && (0, _styledComponents.css)(["&::before{content:\"\";position:absolute;top:0;bottom:0;left:0;width:4px;background:", ";z-index:2;}"], $priorityColor);
69
- }, function (_ref3) {
70
- var $selected = _ref3.$selected;
71
- return $selected && (0, _styledComponents.css)(["border-color:var(--sc-selection-ring);box-shadow:0 0 0 2px var(--sc-selection-ring);"]);
72
- }, function (_ref4) {
73
- var $disabled = _ref4.$disabled;
74
- return $disabled && (0, _styledComponents.css)(["opacity:0.5;pointer-events:none;"]);
75
- }, function (_ref5) {
76
- var $pending = _ref5.$pending;
77
- return $pending && (0, _styledComponents.css)(["opacity:0.6;pointer-events:none;cursor:progress;"]);
78
- }, function (_ref6) {
79
- var $isDragSource = _ref6.$isDragSource;
80
- return $isDragSource && (0, _styledComponents.css)(["background:transparent;border:1px dashed var(--color-theme-500);box-shadow:none;&:hover{box-shadow:none;border-color:var(--color-theme-500);}> *{visibility:hidden;}"]);
81
- }, function (_ref7) {
82
- var $isDragPreview = _ref7.$isDragPreview;
83
- return $isDragPreview && (0, _styledComponents.css)(["box-shadow:0 12px 28px rgba(0,0,0,0.24);cursor:grabbing;"]);
84
- }, function (_ref8) {
85
- var $entered = _ref8.$entered;
86
- return $entered && (0, _styledComponents.css)(["&&{border-color:var(--sc-selection-ring);box-shadow:inset 0 0 0 2px var(--sc-selection-ring),0 0 0 2px var(--sc-selection-ring);}"]);
87
- });
88
-
89
- /* ------------------------------------------------------------------ */
90
- /* Resize (opt-in): handle on hover, card reports deltas */
91
- /* ------------------------------------------------------------------ */
92
-
93
- var StyledResizeHandle = _styledComponents.default.span.withConfig({
94
- displayName: "shell__StyledResizeHandle",
95
- componentId: "sc-nmi1iu-1"
96
- })(["position:absolute;right:2px;bottom:2px;width:14px;height:14px;cursor:nwse-resize;color:var(--color-theme-600);z-index:2;svg{display:block;}"]);
97
- var ResizeHandleGlyph = exports.ResizeHandleGlyph = function ResizeHandleGlyph() {
98
- return /*#__PURE__*/_react.default.createElement("svg", {
99
- width: "14",
100
- height: "14",
101
- viewBox: "0 0 14 14",
102
- fill: "none",
103
- "aria-hidden": "true"
104
- }, /*#__PURE__*/_react.default.createElement("path", {
105
- d: "M12 6v6H6M12 9.5L9.5 12",
106
- stroke: "currentColor",
107
- strokeWidth: "1.5",
108
- strokeLinecap: "round"
109
- }));
110
- };
111
- /* The shell forwards its ref and spreads DOM props (tabIndex, role, aria-*, the
112
- keyboard/click handlers) so the focus-model and open-vs-select demos can
113
- drive it — but it owns NO drag, selection, or content logic itself. */
114
- var StackedCard = exports.StackedCard = /*#__PURE__*/_react.default.forwardRef(function (_ref9, ref) {
115
- var selected = _ref9.selected,
116
- disabled = _ref9.disabled,
117
- pending = _ref9.pending,
118
- isDragSource = _ref9.isDragSource,
119
- isDragPreview = _ref9.isDragPreview,
120
- entered = _ref9.entered,
121
- forceHover = _ref9.forceHover,
122
- resizable = _ref9.resizable,
123
- priorityColor = _ref9.priorityColor,
124
- onResizeDelta = _ref9.onResizeDelta,
125
- children = _ref9.children,
126
- rest = _objectWithoutProperties(_ref9, _excluded);
127
- var dragOrigin = (0, _react.useRef)(null);
128
- var handlePointerDown = (0, _react.useCallback)(function (e) {
129
- dragOrigin.current = {
130
- x: e.clientX,
131
- y: e.clientY
132
- };
133
- e.target.setPointerCapture(e.pointerId);
134
- e.preventDefault();
135
- }, []);
136
- var handlePointerMove = (0, _react.useCallback)(function (e) {
137
- if (!dragOrigin.current || !onResizeDelta) return;
138
- onResizeDelta(e.clientX - dragOrigin.current.x, e.clientY - dragOrigin.current.y);
139
- dragOrigin.current = {
140
- x: e.clientX,
141
- y: e.clientY
142
- };
143
- }, [onResizeDelta]);
144
- var handlePointerUp = (0, _react.useCallback)(function () {
145
- dragOrigin.current = null;
146
- }, []);
147
- return /*#__PURE__*/_react.default.createElement(StyledCard, _extends({
148
- ref: ref,
149
- $selected: selected,
150
- $disabled: disabled,
151
- $pending: pending,
152
- $isDragSource: isDragSource,
153
- $isDragPreview: isDragPreview,
154
- $entered: entered,
155
- $forceHover: forceHover,
156
- $priorityColor: priorityColor
157
- }, rest), children, resizable ? /*#__PURE__*/_react.default.createElement(StyledResizeHandle, {
158
- className: "sc-control",
159
- onPointerDown: handlePointerDown,
160
- onPointerMove: handlePointerMove,
161
- onPointerUp: handlePointerUp
162
- }, /*#__PURE__*/_react.default.createElement(ResizeHandleGlyph, null)) : null);
163
- });
164
- StackedCard.displayName = "StackedCard";
165
- //# sourceMappingURL=shell.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shell.js","names":["_react","_interopRequireWildcard","require","_styledComponents","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","_extends","assign","bind","arguments","length","apply","_objectWithoutProperties","_objectWithoutPropertiesLoose","getOwnPropertySymbols","indexOf","propertyIsEnumerable","CARD_WIDTH","exports","CARD_RADIUS","COVER_RATIO","COVER_RATIO_HERO","COVER_RATIO_IMAGE","COVER_RATIO_SWATCH","hoverStyle","css","revealControls","StyledCard","styled","div","withConfig","displayName","componentId","_ref","$forceHover","_ref2","$priorityColor","_ref3","$selected","_ref4","$disabled","_ref5","$pending","_ref6","$isDragSource","_ref7","$isDragPreview","_ref8","$entered","StyledResizeHandle","span","ResizeHandleGlyph","createElement","width","height","viewBox","fill","d","stroke","strokeWidth","strokeLinecap","StackedCard","React","forwardRef","_ref9","ref","selected","disabled","pending","isDragSource","isDragPreview","entered","forceHover","resizable","priorityColor","onResizeDelta","children","rest","dragOrigin","useRef","handlePointerDown","useCallback","current","x","clientX","y","clientY","target","setPointerCapture","pointerId","preventDefault","handlePointerMove","handlePointerUp","className","onPointerDown","onPointerMove","onPointerUp"],"sources":["../../../../src/presentation/stackedCard/shell.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode, useCallback, useRef } from \"react\";\n\nimport styled, { css } from \"styled-components\";\n\n/**\n * StackedCard shell (story-local, presentation-only).\n *\n * The hollow frame every typed content component composes. Extracted from the\n * concept spec story (task 2/8) so the StackedCard concept stories share one\n * shell instead of re-declaring it. The rule the whole subsystem hangs on:\n *\n * THE SHELL STAYS HOLLOW.\n *\n * There is no `contentType` enum here, no per-type prop soup, no `if task …`.\n * The shell owns only VISUAL STATES (selected, disabled, pending, priority,\n * drag source/preview, entered) and the intent surface (`onResizeDelta`, the\n * DOM props it forwards). Content — a task, a link, an image, a swatch, a note\n * — is passed in as `children` and composes the layout primitives. A new\n * content type later is a new wrapper, with ZERO changes in this file.\n *\n * Not exported from the design-system barrel; it lives here so the concept\n * stories share one source of truth.\n */\n\n/* ------------------------------------------------------------------ */\n/* Reference dimensions (from the concept) */\n/* ------------------------------------------------------------------ */\n\nexport const CARD_WIDTH = 260;\nexport const CARD_RADIUS = 8;\n\n/* Cover heights are reserved with aspect-ratio (width / height) so a late image\n never reflows the card. Per-type ratios live with the shell so every content\n component reserves the same space its skeleton does. */\nexport const COVER_RATIO = \"260 / 132\";\nexport const COVER_RATIO_HERO = \"320 / 190\";\nexport const COVER_RATIO_IMAGE = \"260 / 168\";\nexport const COVER_RATIO_SWATCH = \"260 / 104\";\n\n/* ------------------------------------------------------------------ */\n/* Shell chrome */\n/* ------------------------------------------------------------------ */\n\ninterface StyledCardProps {\n $selected?: boolean;\n $disabled?: boolean;\n $pending?: boolean;\n $isDragSource?: boolean;\n $isDragPreview?: boolean;\n $entered?: boolean;\n $forceHover?: boolean;\n $priorityColor?: string;\n}\n\nconst hoverStyle = css`\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);\n border-color: var(--color-theme-500);\n`;\n\n/* Controls (cover + entity) share one reveal rule: hidden until the card is\n hovered OR holds focus, so they are reachable by keyboard, not mouse-only.\n The cover also reveals its own controls; `&&` gives the forced-on state the\n specificity to win over that resting rule. */\nconst revealControls = css`\n .sc-control {\n opacity: 0;\n transition: opacity 120ms ease;\n }\n\n &:hover .sc-control,\n &:focus-within .sc-control {\n opacity: 1;\n }\n`;\n\nconst StyledCard = styled.div<StyledCardProps>`\n position: relative;\n display: flex;\n flex-direction: column;\n width: ${CARD_WIDTH}px;\n border-radius: ${CARD_RADIUS}px;\n background-color: var(--page-paper-main);\n border: 1px solid var(--border-primary);\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n overflow: hidden;\n transition: box-shadow 150ms ease, border-color 150ms ease;\n\n ${revealControls}\n\n &:hover {\n ${hoverStyle}\n }\n\n &:focus-visible {\n outline: none;\n ${hoverStyle}\n box-shadow: 0 0 0 2px var(--sc-selection-ring);\n }\n\n ${({ $forceHover }) =>\n $forceHover &&\n css`\n ${hoverStyle}\n && .sc-control {\n opacity: 1;\n }\n `}\n\n ${({ $priorityColor }) =>\n $priorityColor &&\n css`\n &::before {\n content: \"\";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 4px;\n background: ${$priorityColor};\n z-index: 2;\n }\n `}\n\n ${({ $selected }) =>\n $selected &&\n css`\n border-color: var(--sc-selection-ring);\n box-shadow: 0 0 0 2px var(--sc-selection-ring);\n `}\n\n ${({ $disabled }) =>\n $disabled &&\n css`\n opacity: 0.5;\n pointer-events: none;\n `}\n\n /* Pending / optimistic — the card was just created or moved and the server\n has not confirmed it yet. Dimmed, non-interactive and NOT draggable, but\n distinct from disabled (it is a transient in-flight state, not a policy). */\n ${({ $pending }) =>\n $pending &&\n css`\n opacity: 0.6;\n pointer-events: none;\n cursor: progress;\n `}\n\n /* Drag SOURCE — full-size outline placeholder. Content is hidden but keeps\n its box (visibility, not display) so the card holds identical dimensions\n and the surrounding cards never move. */\n ${({ $isDragSource }) =>\n $isDragSource &&\n css`\n background: transparent;\n border: 1px dashed var(--color-theme-500);\n box-shadow: none;\n\n &:hover {\n box-shadow: none;\n border-color: var(--color-theme-500);\n }\n\n > * {\n visibility: hidden;\n }\n `}\n\n /* Drag PREVIEW — the 1:1 copy the host floats in the drag layer. Elevated\n shadow ONLY: no rotate, no scale, no translate. */\n ${({ $isDragPreview }) =>\n $isDragPreview &&\n css`\n box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);\n cursor: grabbing;\n `}\n\n /* Entered (focus model) — focus is on one of the card's inner controls. */\n ${({ $entered }) =>\n $entered &&\n css`\n && {\n border-color: var(--sc-selection-ring);\n box-shadow: inset 0 0 0 2px var(--sc-selection-ring),\n 0 0 0 2px var(--sc-selection-ring);\n }\n `}\n`;\n\n/* ------------------------------------------------------------------ */\n/* Resize (opt-in): handle on hover, card reports deltas */\n/* ------------------------------------------------------------------ */\n\nconst StyledResizeHandle = styled.span`\n position: absolute;\n right: 2px;\n bottom: 2px;\n width: 14px;\n height: 14px;\n cursor: nwse-resize;\n color: var(--color-theme-600);\n z-index: 2;\n\n svg {\n display: block;\n }\n`;\n\nexport const ResizeHandleGlyph = (): ReactElement => (\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <path\n d=\"M12 6v6H6M12 9.5L9.5 12\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n />\n </svg>\n);\n\nexport interface StackedCardProps\n extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onResize\"> {\n selected?: boolean;\n disabled?: boolean;\n /** Optimistic in-flight state — dimmed, non-interactive, not draggable. */\n pending?: boolean;\n /** Full-size outline placeholder left in the source position while dragging. */\n isDragSource?: boolean;\n /** The 1:1 elevated copy the host floats in the drag layer. */\n isDragPreview?: boolean;\n /** Focus model: the card has been entered and focus is on an inner control. */\n entered?: boolean;\n forceHover?: boolean;\n resizable?: boolean;\n priorityColor?: string;\n onResizeDelta?: (dx: number, dy: number) => void;\n children: ReactNode;\n}\n\n/* The shell forwards its ref and spreads DOM props (tabIndex, role, aria-*, the\n keyboard/click handlers) so the focus-model and open-vs-select demos can\n drive it — but it owns NO drag, selection, or content logic itself. */\nexport const StackedCard = React.forwardRef<HTMLDivElement, StackedCardProps>(\n (\n {\n selected,\n disabled,\n pending,\n isDragSource,\n isDragPreview,\n entered,\n forceHover,\n resizable,\n priorityColor,\n onResizeDelta,\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 <StyledCard\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 {...rest}\n >\n {children}\n {resizable ? (\n <StyledResizeHandle\n className=\"sc-control\"\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n >\n <ResizeHandleGlyph />\n </StyledRes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Ae,OAAA,CAAAwD,aAAA,CAACzB,UAAU,EAAArB,QAAA;IACT2D,GAAG,EAAEA,GAAI;IACT3B,SAAS,EAAE4B,QAAS;IACpB1B,SAAS,EAAE2B,QAAS;IACpBzB,QAAQ,EAAE0B,OAAQ;IAClBxB,aAAa,EAAEyB,YAAa;IAC5BvB,cAAc,EAAEwB,aAAc;IAC9BtB,QAAQ,EAAEuB,OAAQ;IAClBrC,WAAW,EAAEsC,UAAW;IACxBpC,cAAc,EAAEsC;EAAc,GAC1BG,IAAI,GAEPD,QAAQ,EACRH,SAAS,gBACR5F,MAAA,CAAAe,OAAA,CAAAwD,aAAA,CAACH,kBAAkB;IACjB4C,SAAS,EAAC,YAAY;IACtBC,aAAa,EAAEd,iBAAkB;IACjCe,aAAa,EAAEJ,iBAAkB;IACjCK,WAAW,EAAEJ;EAAgB,gBAE7B/G,MAAA,CAAAe,OAAA,CAAAwD,aAAA,CAACD,iBAAiB,MAAE,CACF,CAAC,GACnB,IACM,CAAC;AAEjB,CACF,CAAC;AAEDU,WAAW,CAAC9B,WAAW,GAAG,aAAa","ignoreList":[]}
@@ -1,84 +0,0 @@
1
- import { ReactElement, ReactNode } from "react";
2
- /**
3
- * StackedCard layout primitives (story-local, presentation-only).
4
- *
5
- * These are the documented foundation of the StackedCard subsystem — the
6
- * building blocks that every StackedCard concept story in this task set
7
- * imports from. They are NOT exported from the design-system barrel; they
8
- * live here so the concept stories share one source of truth instead of
9
- * re-declaring one-off styled blocks.
10
- *
11
- * Three primitives:
12
- * - Stack — the vertical column. A card is a Stack of StackRows.
13
- * - StackRow — the one layout primitive. Everything (cover, title, meta,
14
- * footer) is a row; a `role` sets the default padding and the
15
- * allowed direction so the anatomy stays predictable.
16
- * - Cover — sugar for a bleed row that holds media, reserves its height
17
- * with `aspect-ratio` (so a late image never reflows), and
18
- * carries two control slots (center + top-right).
19
- *
20
- * Colours here come exclusively from CSS variables — the dark scrim behind
21
- * cover controls is `--sc-scrim` / `--sc-scrim-strong` / `--sc-scrim-fg`, all
22
- * declared story-side as DS token candidates. No rgba/hex is hardcoded in a
23
- * primitive; only data colours (a swatch value, a label dot) are ever literal,
24
- * and those are passed in by the content, never baked in here.
25
- */
26
- export declare const Stack: import("styled-components").StyledComponent<"div", any, {}, never>;
27
- export type StackRowRole = "cover" | "title" | "meta" | "footer" | "custom";
28
- export type StackRowDirection = "row" | "column";
29
- /**
30
- * Role → default padding. The row is the increment: title/footer carry the
31
- * system padding, meta is a tighter properties line, cover bleeds to the edge.
32
- * `custom` starts from the system padding and expects the caller to adjust.
33
- */
34
- export declare const ROLE_PADDING: Record<StackRowRole, string>;
35
- export interface StackRowProps {
36
- /** Named role → default padding + allowed direction. Defaults to `custom`. */
37
- role?: StackRowRole;
38
- /** Zero the padding, overriding the role (media rows, edge-to-edge bands). */
39
- bleed?: boolean;
40
- /** Footer bands lay their children out vertically. Defaults to `row`. */
41
- direction?: StackRowDirection;
42
- /** A row can carry its own background (the tinted link-footer band). */
43
- background?: string;
44
- className?: string;
45
- children: ReactNode;
46
- }
47
- export declare const StackRow: ({ role, bleed, direction, background, className, children, }: StackRowProps) => ReactElement;
48
- export interface CoverProps {
49
- /**
50
- * CSS `aspect-ratio` value that reserves the cover's height, e.g.
51
- * `"260 / 132"`. Kept as a ratio (not a pixel height) so the cover scales
52
- * with the card and holds its space before media loads.
53
- */
54
- aspectRatio?: string;
55
- /** Center slot — the media control (a play button over audio/video). */
56
- centerSlot?: ReactNode;
57
- /** Top-right slot — cover management (collapse, remove). */
58
- topRightSlot?: ReactNode;
59
- /**
60
- * Collapsed cover: render the thin strip instead of the media box. The
61
- * collapse *control* lives in the caller's `topRightSlot`; this flag is the
62
- * resulting visual state. See the "Collapsed cover" story section.
63
- */
64
- collapsed?: boolean;
65
- /**
66
- * What the collapsed strip shows — an ~8px colour bar, or a favicon + domain
67
- * row for links. Content-specific, so the caller supplies it.
68
- */
69
- collapsedStrip?: ReactNode;
70
- /** Fired when the collapsed strip's expand affordance is activated. */
71
- onExpand?: () => void;
72
- /** Accessible label for the expand affordance. */
73
- expandLabel?: string;
74
- className?: string;
75
- /** The fill: an `<img>`, an inline `<svg>`, or a solid-colour box. */
76
- children: ReactNode;
77
- }
78
- export declare const Cover: ({ aspectRatio, centerSlot, topRightSlot, collapsed, collapsedStrip, onExpand, expandLabel, className, children, }: CoverProps) => ReactElement;
79
- export declare const PlayBadge: import("styled-components").StyledComponent<"span", any, {}, never>;
80
- export declare const CoverButton: import("styled-components").StyledComponent<"button", any, {}, never>;
81
- export declare const CollapseGlyph: () => ReactElement;
82
- export declare const ExpandGlyph: () => ReactElement;
83
- export declare const RemoveCoverGlyph: () => ReactElement;
84
- //# sourceMappingURL=primitives.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../src/presentation/stackedCard/primitives.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAMH,eAAO,MAAM,KAAK,oEAIjB,CAAC;AAMF,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE5E,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,QAAQ,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAMrD,CAAC;AA0CF,MAAM,WAAW,aAAa;IAC5B,8EAA8E;IAC9E,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,yEAAyE;IACzE,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,wEAAwE;IACxE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;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