@activecollab/components 2.0.363 → 2.0.365

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 (91) hide show
  1. package/dist/cjs/presentation/shared/index.js +37 -1
  2. package/dist/cjs/presentation/shared/index.js.map +1 -1
  3. package/dist/cjs/presentation/shared/settings.js +91 -0
  4. package/dist/cjs/presentation/shared/settings.js.map +1 -0
  5. package/dist/cjs/presentation/stackedCard/content/ImageCard.js +60 -0
  6. package/dist/cjs/presentation/stackedCard/content/ImageCard.js.map +1 -0
  7. package/dist/cjs/presentation/stackedCard/content/LinkCard.js +348 -0
  8. package/dist/cjs/presentation/stackedCard/content/LinkCard.js.map +1 -0
  9. package/dist/cjs/presentation/stackedCard/content/NoteCard.js +92 -0
  10. package/dist/cjs/presentation/stackedCard/content/NoteCard.js.map +1 -0
  11. package/dist/cjs/presentation/stackedCard/content/SwatchCard.js +74 -0
  12. package/dist/cjs/presentation/stackedCard/content/SwatchCard.js.map +1 -0
  13. package/dist/cjs/presentation/stackedCard/content/TaskCard.js +231 -0
  14. package/dist/cjs/presentation/stackedCard/content/TaskCard.js.map +1 -0
  15. package/dist/cjs/presentation/stackedCard/content/index.js +83 -0
  16. package/dist/cjs/presentation/stackedCard/content/index.js.map +1 -0
  17. package/dist/cjs/presentation/stackedCard/content/shared.js +144 -0
  18. package/dist/cjs/presentation/stackedCard/content/shared.js.map +1 -0
  19. package/dist/cjs/presentation/stackedCard/content/unfurl.js +172 -0
  20. package/dist/cjs/presentation/stackedCard/content/unfurl.js.map +1 -0
  21. package/dist/cjs/presentation/stackedCard/primitives.js +254 -0
  22. package/dist/cjs/presentation/stackedCard/primitives.js.map +1 -0
  23. package/dist/cjs/presentation/stackedCard/resizePolicy.js +183 -0
  24. package/dist/cjs/presentation/stackedCard/resizePolicy.js.map +1 -0
  25. package/dist/cjs/presentation/stackedCard/shell.js +165 -0
  26. package/dist/cjs/presentation/stackedCard/shell.js.map +1 -0
  27. package/dist/cjs/presentation/stackedCard/storyScaffold.js +72 -0
  28. package/dist/cjs/presentation/stackedCard/storyScaffold.js.map +1 -0
  29. package/dist/cjs/presentation/stackedCard/useInlineEdit.js +208 -0
  30. package/dist/cjs/presentation/stackedCard/useInlineEdit.js.map +1 -0
  31. package/dist/esm/presentation/shared/index.d.ts +2 -0
  32. package/dist/esm/presentation/shared/index.d.ts.map +1 -1
  33. package/dist/esm/presentation/shared/index.js +1 -0
  34. package/dist/esm/presentation/shared/index.js.map +1 -1
  35. package/dist/esm/presentation/shared/settings.d.ts +33 -0
  36. package/dist/esm/presentation/shared/settings.d.ts.map +1 -0
  37. package/dist/esm/presentation/shared/settings.js +84 -0
  38. package/dist/esm/presentation/shared/settings.js.map +1 -0
  39. package/dist/esm/presentation/stackedCard/content/ImageCard.d.ts +15 -0
  40. package/dist/esm/presentation/stackedCard/content/ImageCard.d.ts.map +1 -0
  41. package/dist/esm/presentation/stackedCard/content/ImageCard.js +50 -0
  42. package/dist/esm/presentation/stackedCard/content/ImageCard.js.map +1 -0
  43. package/dist/esm/presentation/stackedCard/content/LinkCard.d.ts +28 -0
  44. package/dist/esm/presentation/stackedCard/content/LinkCard.d.ts.map +1 -0
  45. package/dist/esm/presentation/stackedCard/content/LinkCard.js +336 -0
  46. package/dist/esm/presentation/stackedCard/content/LinkCard.js.map +1 -0
  47. package/dist/esm/presentation/stackedCard/content/NoteCard.d.ts +10 -0
  48. package/dist/esm/presentation/stackedCard/content/NoteCard.d.ts.map +1 -0
  49. package/dist/esm/presentation/stackedCard/content/NoteCard.js +82 -0
  50. package/dist/esm/presentation/stackedCard/content/NoteCard.js.map +1 -0
  51. package/dist/esm/presentation/stackedCard/content/SwatchCard.d.ts +14 -0
  52. package/dist/esm/presentation/stackedCard/content/SwatchCard.d.ts.map +1 -0
  53. package/dist/esm/presentation/stackedCard/content/SwatchCard.js +64 -0
  54. package/dist/esm/presentation/stackedCard/content/SwatchCard.js.map +1 -0
  55. package/dist/esm/presentation/stackedCard/content/TaskCard.d.ts +29 -0
  56. package/dist/esm/presentation/stackedCard/content/TaskCard.d.ts.map +1 -0
  57. package/dist/esm/presentation/stackedCard/content/TaskCard.js +218 -0
  58. package/dist/esm/presentation/stackedCard/content/TaskCard.js.map +1 -0
  59. package/dist/esm/presentation/stackedCard/content/index.d.ts +8 -0
  60. package/dist/esm/presentation/stackedCard/content/index.d.ts.map +1 -0
  61. package/dist/esm/presentation/stackedCard/content/index.js +8 -0
  62. package/dist/esm/presentation/stackedCard/content/index.js.map +1 -0
  63. package/dist/esm/presentation/stackedCard/content/shared.d.ts +46 -0
  64. package/dist/esm/presentation/stackedCard/content/shared.d.ts.map +1 -0
  65. package/dist/esm/presentation/stackedCard/content/shared.js +134 -0
  66. package/dist/esm/presentation/stackedCard/content/shared.js.map +1 -0
  67. package/dist/esm/presentation/stackedCard/content/unfurl.d.ts +89 -0
  68. package/dist/esm/presentation/stackedCard/content/unfurl.d.ts.map +1 -0
  69. package/dist/esm/presentation/stackedCard/content/unfurl.js +147 -0
  70. package/dist/esm/presentation/stackedCard/content/unfurl.js.map +1 -0
  71. package/dist/esm/presentation/stackedCard/primitives.d.ts +84 -0
  72. package/dist/esm/presentation/stackedCard/primitives.d.ts.map +1 -0
  73. package/dist/esm/presentation/stackedCard/primitives.js +241 -0
  74. package/dist/esm/presentation/stackedCard/primitives.js.map +1 -0
  75. package/dist/esm/presentation/stackedCard/resizePolicy.d.ts +97 -0
  76. package/dist/esm/presentation/stackedCard/resizePolicy.d.ts.map +1 -0
  77. package/dist/esm/presentation/stackedCard/resizePolicy.js +173 -0
  78. package/dist/esm/presentation/stackedCard/resizePolicy.js.map +1 -0
  79. package/dist/esm/presentation/stackedCard/shell.d.ts +46 -0
  80. package/dist/esm/presentation/stackedCard/shell.d.ts.map +1 -0
  81. package/dist/esm/presentation/stackedCard/shell.js +156 -0
  82. package/dist/esm/presentation/stackedCard/shell.js.map +1 -0
  83. package/dist/esm/presentation/stackedCard/storyScaffold.d.ts +28 -0
  84. package/dist/esm/presentation/stackedCard/storyScaffold.d.ts.map +1 -0
  85. package/dist/esm/presentation/stackedCard/storyScaffold.js +66 -0
  86. package/dist/esm/presentation/stackedCard/storyScaffold.js.map +1 -0
  87. package/dist/esm/presentation/stackedCard/useInlineEdit.d.ts +68 -0
  88. package/dist/esm/presentation/stackedCard/useInlineEdit.d.ts.map +1 -0
  89. package/dist/esm/presentation/stackedCard/useInlineEdit.js +192 -0
  90. package/dist/esm/presentation/stackedCard/useInlineEdit.js.map +1 -0
  91. package/package.json +1 -1
@@ -0,0 +1,254 @@
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
@@ -0,0 +1 @@
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 />\n <path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Ac;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":[]}
@@ -0,0 +1,183 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.snap = exports.measurePercent = exports.makeStart = exports.keyboardResize = exports.isResizeKey = exports.effectiveBounds = exports.clamp = exports.applyResize = exports.SHIFT_STEP_MULTIPLIER = exports.RESIZE_KEYS = exports.DEFAULT_KEYBOARD_STEP = void 0;
7
+ /**
8
+ * StackedCard resize policy — pure math (story-local, presentation-only).
9
+ *
10
+ * The card only reports deltas; the HOST applies a resize policy (note 52097
11
+ * §7). This module is that policy, packaged as pure functions so the SAME code
12
+ * path serves both the pointer drag and the keyboard resize (task 5/8). Nothing
13
+ * here touches the DOM, React, or the content — it takes a start size, a delta,
14
+ * and a policy, and returns a clamped size. The story wires events to it; the
15
+ * card's intrinsic content minimum is measured story-side and passed in as
16
+ * `contentMin`, so this module knows nothing about heroes or footers.
17
+ *
18
+ * The policy has four parts, all preserved from the concept:
19
+ * - bounds — optional min/max per axis; unset means unbounded.
20
+ * - proportional — lock the aspect ratio captured at the start of the gesture;
21
+ * the scale is clamped by the BINDING axis so the ratio never
22
+ * distorts at a bound.
23
+ * - step — optional grid snap; proportion wins over the grid.
24
+ * - content min — the effective min is max(policyMin, contentMin) per axis,
25
+ * so the card can never be crushed below what its content needs.
26
+ */
27
+
28
+ /** The card's intrinsic minimum, measured from its real content. */
29
+
30
+ /** The size captured at the start of a gesture (pointer down or a key press). */
31
+
32
+ /** Keyboard resize nudges by the policy step, or this when no step is set. */
33
+ var DEFAULT_KEYBOARD_STEP = exports.DEFAULT_KEYBOARD_STEP = 8;
34
+
35
+ /** Shift + arrow resizes by a larger increment (the familiar coarse nudge). */
36
+ var SHIFT_STEP_MULTIPLIER = exports.SHIFT_STEP_MULTIPLIER = 4;
37
+
38
+ /** Keys the separator handles; everything else falls through to the browser. */
39
+ var RESIZE_KEYS = exports.RESIZE_KEYS = ["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"];
40
+ var isResizeKey = exports.isResizeKey = function isResizeKey(key) {
41
+ return RESIZE_KEYS.includes(key);
42
+ };
43
+ var clamp = exports.clamp = function clamp(v, lo, hi) {
44
+ return Math.min(hi !== null && hi !== void 0 ? hi : Number.POSITIVE_INFINITY, Math.max(lo, v));
45
+ };
46
+ var snap = exports.snap = function snap(v, step) {
47
+ return step && step > 0 ? Math.round(v / step) * step : v;
48
+ };
49
+ var makeStart = exports.makeStart = function makeStart(size, contentMin) {
50
+ return {
51
+ w: size.w,
52
+ h: size.h,
53
+ contentMin
54
+ };
55
+ };
56
+
57
+ /**
58
+ * The effective bounds a size is clamped to: the policy min floored by the
59
+ * content min, and the policy max (unbounded when unset). Independent of any
60
+ * live gesture, so the story can also use it for the aria value and Home/End.
61
+ */
62
+ var effectiveBounds = exports.effectiveBounds = function effectiveBounds(policy, contentMin) {
63
+ var _policy$minW, _policy$minH, _policy$maxW, _policy$maxH;
64
+ return {
65
+ wMin: Math.max((_policy$minW = policy.minW) !== null && _policy$minW !== void 0 ? _policy$minW : 0, contentMin.w),
66
+ hMin: Math.max((_policy$minH = policy.minH) !== null && _policy$minH !== void 0 ? _policy$minH : 0, contentMin.h),
67
+ wMax: (_policy$maxW = policy.maxW) !== null && _policy$maxW !== void 0 ? _policy$maxW : Number.POSITIVE_INFINITY,
68
+ hMax: (_policy$maxH = policy.maxH) !== null && _policy$maxH !== void 0 ? _policy$maxH : Number.POSITIVE_INFINITY
69
+ };
70
+ };
71
+
72
+ /**
73
+ * Apply a delta to the start size under the policy — the single path for both
74
+ * inputs. `constrain` is the transient Shift-to-constrain lock: a free-form
75
+ * policy behaves proportionally for that one gesture; a proportional policy is
76
+ * already locked and ignores it.
77
+ */
78
+ var applyResize = exports.applyResize = function applyResize(start, delta, policy) {
79
+ var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
80
+ var _effectiveBounds = effectiveBounds(policy, start.contentMin),
81
+ wMin = _effectiveBounds.wMin,
82
+ hMin = _effectiveBounds.hMin,
83
+ wMax = _effectiveBounds.wMax,
84
+ hMax = _effectiveBounds.hMax;
85
+ var proportional = policy.proportional || opts.constrain === true;
86
+ var w;
87
+ var h;
88
+ if (proportional) {
89
+ // one scale drives both axes; the corner's dominant direction wins, so a
90
+ // vertical drag is as effective as a horizontal one
91
+ var sW = (start.w + delta.dx) / start.w;
92
+ var sH = (start.h + delta.dy) / start.h;
93
+ var scale = Math.abs(sW - 1) >= Math.abs(sH - 1) ? sW : sH;
94
+
95
+ // clamp the SCALE so both axes stay in bounds (binding constraint): the
96
+ // ratio can never break at a bound — whichever edge is limiting stops both
97
+ var scaleMin = Math.max(wMin / start.w, hMin / start.h);
98
+ var scaleMax = Math.min(wMax / start.w, hMax / start.h);
99
+ scale = clamp(scale, scaleMin, Math.max(scaleMin, scaleMax));
100
+
101
+ // step: proportion wins. Snap via the scale (driven off the width edge) and
102
+ // re-clamp, so ratio and bounds always hold; the grid yields when honoring
103
+ // it would cost the ratio
104
+ if (policy.step) {
105
+ var snappedScale = snap(start.w * scale, policy.step) / start.w;
106
+ scale = clamp(snappedScale, scaleMin, Math.max(scaleMin, scaleMax));
107
+ }
108
+ w = start.w * scale;
109
+ h = start.h * scale;
110
+ } else {
111
+ w = clamp(snap(start.w + delta.dx, policy.step), wMin, wMax);
112
+ h = clamp(snap(start.h + delta.dy, policy.step), hMin, hMax);
113
+ }
114
+ return {
115
+ w: Math.round(w),
116
+ h: Math.round(h)
117
+ };
118
+ };
119
+
120
+ /**
121
+ * Translate a resize key into the next size, reusing `applyResize` so the
122
+ * keyboard clamps exactly like the pointer. Arrows nudge by the step (Shift ×4);
123
+ * Home/End jump to the min/max of the allowed range. Returns null for any key
124
+ * the handle does not own.
125
+ */
126
+ var keyboardResize = exports.keyboardResize = function keyboardResize(key, size, policy, contentMin) {
127
+ var opts = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
128
+ var base = policy.step && policy.step > 0 ? policy.step : DEFAULT_KEYBOARD_STEP;
129
+ var step = base * (opts.shiftKey ? SHIFT_STEP_MULTIPLIER : 1);
130
+ var start = makeStart(size, contentMin);
131
+ var b = effectiveBounds(policy, contentMin);
132
+ switch (key) {
133
+ case "ArrowRight":
134
+ return applyResize(start, {
135
+ dx: step,
136
+ dy: 0
137
+ }, policy);
138
+ case "ArrowLeft":
139
+ return applyResize(start, {
140
+ dx: -step,
141
+ dy: 0
142
+ }, policy);
143
+ case "ArrowDown":
144
+ return applyResize(start, {
145
+ dx: 0,
146
+ dy: step
147
+ }, policy);
148
+ case "ArrowUp":
149
+ return applyResize(start, {
150
+ dx: 0,
151
+ dy: -step
152
+ }, policy);
153
+ case "Home":
154
+ // jump to the min corner (a huge negative delta clamps to the floor)
155
+ return applyResize(start, {
156
+ dx: b.wMin - size.w,
157
+ dy: b.hMin - size.h
158
+ }, policy);
159
+ case "End":
160
+ // jump to the max corner; an unbounded axis simply doesn't move
161
+ return applyResize(start, {
162
+ dx: Number.isFinite(b.wMax) ? b.wMax - size.w : 0,
163
+ dy: Number.isFinite(b.hMax) ? b.hMax - size.h : 0
164
+ }, policy);
165
+ default:
166
+ return null;
167
+ }
168
+ };
169
+
170
+ /**
171
+ * The handle's `aria-valuenow`: the current size as a percent (0–100) of its
172
+ * allowed range. The corner resizes both axes, but the value must be a single
173
+ * number, so it reports the WIDTH axis — the one axis both the fixed-box and the
174
+ * width-only cards share. Returns 0 when the range isn't finite (no max bound).
175
+ */
176
+ var measurePercent = exports.measurePercent = function measurePercent(size, policy, contentMin) {
177
+ var _effectiveBounds2 = effectiveBounds(policy, contentMin),
178
+ wMin = _effectiveBounds2.wMin,
179
+ wMax = _effectiveBounds2.wMax;
180
+ if (!Number.isFinite(wMax) || wMax <= wMin) return 0;
181
+ return Math.round(clamp((size.w - wMin) / (wMax - wMin) * 100, 0, 100));
182
+ };
183
+ //# sourceMappingURL=resizePolicy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resizePolicy.js","names":["DEFAULT_KEYBOARD_STEP","exports","SHIFT_STEP_MULTIPLIER","RESIZE_KEYS","isResizeKey","key","includes","clamp","v","lo","hi","Math","min","Number","POSITIVE_INFINITY","max","snap","step","round","makeStart","size","contentMin","w","h","effectiveBounds","policy","_policy$minW","_policy$minH","_policy$maxW","_policy$maxH","wMin","minW","hMin","minH","wMax","maxW","hMax","maxH","applyResize","start","delta","opts","arguments","length","undefined","_effectiveBounds","proportional","constrain","sW","dx","sH","dy","scale","abs","scaleMin","scaleMax","snappedScale","keyboardResize","base","shiftKey","b","isFinite","measurePercent","_effectiveBounds2"],"sources":["../../../../src/presentation/stackedCard/resizePolicy.ts"],"sourcesContent":["/**\n * StackedCard resize policy — pure math (story-local, presentation-only).\n *\n * The card only reports deltas; the HOST applies a resize policy (note 52097\n * §7). This module is that policy, packaged as pure functions so the SAME code\n * path serves both the pointer drag and the keyboard resize (task 5/8). Nothing\n * here touches the DOM, React, or the content — it takes a start size, a delta,\n * and a policy, and returns a clamped size. The story wires events to it; the\n * card's intrinsic content minimum is measured story-side and passed in as\n * `contentMin`, so this module knows nothing about heroes or footers.\n *\n * The policy has four parts, all preserved from the concept:\n * - bounds — optional min/max per axis; unset means unbounded.\n * - proportional — lock the aspect ratio captured at the start of the gesture;\n * the scale is clamped by the BINDING axis so the ratio never\n * distorts at a bound.\n * - step — optional grid snap; proportion wins over the grid.\n * - content min — the effective min is max(policyMin, contentMin) per axis,\n * so the card can never be crushed below what its content needs.\n */\n\nexport interface Size {\n w: number;\n h: number;\n}\n\n/** The card's intrinsic minimum, measured from its real content. */\nexport interface ContentMin {\n w: number;\n h: number;\n}\n\nexport interface Policy {\n minW?: number;\n maxW?: number;\n minH?: number;\n maxH?: number;\n /** Lock the aspect ratio for the whole gesture. */\n proportional: boolean;\n /** Grid snap increment in px; omitted / 0 means continuous. */\n step?: number;\n}\n\n/** The size captured at the start of a gesture (pointer down or a key press). */\nexport interface ResizeStart {\n w: number;\n h: number;\n contentMin: ContentMin;\n}\n\nexport interface ResizeDelta {\n dx: number;\n dy: number;\n}\n\nexport interface EffectiveBounds {\n wMin: number;\n wMax: number;\n hMin: number;\n hMax: number;\n}\n\n/** Keyboard resize nudges by the policy step, or this when no step is set. */\nexport const DEFAULT_KEYBOARD_STEP = 8;\n\n/** Shift + arrow resizes by a larger increment (the familiar coarse nudge). */\nexport const SHIFT_STEP_MULTIPLIER = 4;\n\n/** Keys the separator handles; everything else falls through to the browser. */\nexport const RESIZE_KEYS: ReadonlyArray<string> = [\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n];\n\nexport const isResizeKey = (key: string): boolean => RESIZE_KEYS.includes(key);\n\nexport const clamp = (v: number, lo: number, hi?: number): number =>\n Math.min(hi ?? Number.POSITIVE_INFINITY, Math.max(lo, v));\n\nexport const snap = (v: number, step?: number): number =>\n step && step > 0 ? Math.round(v / step) * step : v;\n\nexport const makeStart = (size: Size, contentMin: ContentMin): ResizeStart => ({\n w: size.w,\n h: size.h,\n contentMin,\n});\n\n/**\n * The effective bounds a size is clamped to: the policy min floored by the\n * content min, and the policy max (unbounded when unset). Independent of any\n * live gesture, so the story can also use it for the aria value and Home/End.\n */\nexport const effectiveBounds = (\n policy: Policy,\n contentMin: ContentMin\n): EffectiveBounds => ({\n wMin: Math.max(policy.minW ?? 0, contentMin.w),\n hMin: Math.max(policy.minH ?? 0, contentMin.h),\n wMax: policy.maxW ?? Number.POSITIVE_INFINITY,\n hMax: policy.maxH ?? Number.POSITIVE_INFINITY,\n});\n\n/**\n * Apply a delta to the start size under the policy — the single path for both\n * inputs. `constrain` is the transient Shift-to-constrain lock: a free-form\n * policy behaves proportionally for that one gesture; a proportional policy is\n * already locked and ignores it.\n */\nexport const applyResize = (\n start: ResizeStart,\n delta: ResizeDelta,\n policy: Policy,\n opts: { constrain?: boolean } = {}\n): Size => {\n const { wMin, hMin, wMax, hMax } = effectiveBounds(policy, start.contentMin);\n const proportional = policy.proportional || opts.constrain === true;\n\n let w: number;\n let h: number;\n\n if (proportional) {\n // one scale drives both axes; the corner's dominant direction wins, so a\n // vertical drag is as effective as a horizontal one\n const sW = (start.w + delta.dx) / start.w;\n const sH = (start.h + delta.dy) / start.h;\n let scale = Math.abs(sW - 1) >= Math.abs(sH - 1) ? sW : sH;\n\n // clamp the SCALE so both axes stay in bounds (binding constraint): the\n // ratio can never break at a bound — whichever edge is limiting stops both\n const scaleMin = Math.max(wMin / start.w, hMin / start.h);\n const scaleMax = Math.min(wMax / start.w, hMax / start.h);\n scale = clamp(scale, scaleMin, Math.max(scaleMin, scaleMax));\n\n // step: proportion wins. Snap via the scale (driven off the width edge) and\n // re-clamp, so ratio and bounds always hold; the grid yields when honoring\n // it would cost the ratio\n if (policy.step) {\n const snappedScale = snap(start.w * scale, policy.step) / start.w;\n scale = clamp(snappedScale, scaleMin, Math.max(scaleMin, scaleMax));\n }\n\n w = start.w * scale;\n h = start.h * scale;\n } else {\n w = clamp(snap(start.w + delta.dx, policy.step), wMin, wMax);\n h = clamp(snap(start.h + delta.dy, policy.step), hMin, hMax);\n }\n\n return { w: Math.round(w), h: Math.round(h) };\n};\n\n/**\n * Translate a resize key into the next size, reusing `applyResize` so the\n * keyboard clamps exactly like the pointer. Arrows nudge by the step (Shift ×4);\n * Home/End jump to the min/max of the allowed range. Returns null for any key\n * the handle does not own.\n */\nexport const keyboardResize = (\n key: string,\n size: Size,\n policy: Policy,\n contentMin: ContentMin,\n opts: { shiftKey?: boolean } = {}\n): Size | null => {\n const base =\n policy.step && policy.step > 0 ? policy.step : DEFAULT_KEYBOARD_STEP;\n const step = base * (opts.shiftKey ? SHIFT_STEP_MULTIPLIER : 1);\n const start = makeStart(size, contentMin);\n const b = effectiveBounds(policy, contentMin);\n\n switch (key) {\n case \"ArrowRight\":\n return applyResize(start, { dx: step, dy: 0 }, policy);\n case \"ArrowLeft\":\n return applyResize(start, { dx: -step, dy: 0 }, policy);\n case \"ArrowDown\":\n return applyResize(start, { dx: 0, dy: step }, policy);\n case \"ArrowUp\":\n return applyResize(start, { dx: 0, dy: -step }, policy);\n case \"Home\":\n // jump to the min corner (a huge negative delta clamps to the floor)\n return applyResize(\n start,\n { dx: b.wMin - size.w, dy: b.hMin - size.h },\n policy\n );\n case \"End\":\n // jump to the max corner; an unbounded axis simply doesn't move\n return applyResize(\n start,\n {\n dx: Number.isFinite(b.wMax) ? b.wMax - size.w : 0,\n dy: Number.isFinite(b.hMax) ? b.hMax - size.h : 0,\n },\n policy\n );\n default:\n return null;\n }\n};\n\n/**\n * The handle's `aria-valuenow`: the current size as a percent (0–100) of its\n * allowed range. The corner resizes both axes, but the value must be a single\n * number, so it reports the WIDTH axis — the one axis both the fixed-box and the\n * width-only cards share. Returns 0 when the range isn't finite (no max bound).\n */\nexport const measurePercent = (\n size: Size,\n policy: Policy,\n contentMin: ContentMin\n): number => {\n const { wMin, wMax } = effectiveBounds(policy, contentMin);\n if (!Number.isFinite(wMax) || wMax <= wMin) return 0;\n return Math.round(clamp(((size.w - wMin) / (wMax - wMin)) * 100, 0, 100));\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAOA;;AAiBA;;AAmBA;AACO,IAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,CAAC;;AAEtC;AACO,IAAME,qBAAqB,GAAAD,OAAA,CAAAC,qBAAA,GAAG,CAAC;;AAEtC;AACO,IAAMC,WAAkC,GAAAF,OAAA,CAAAE,WAAA,GAAG,CAChD,WAAW,EACX,YAAY,EACZ,SAAS,EACT,WAAW,EACX,MAAM,EACN,KAAK,CACN;AAEM,IAAMC,WAAW,GAAAH,OAAA,CAAAG,WAAA,GAAG,SAAdA,WAAWA,CAAIC,GAAW;EAAA,OAAcF,WAAW,CAACG,QAAQ,CAACD,GAAG,CAAC;AAAA;AAEvE,IAAME,KAAK,GAAAN,OAAA,CAAAM,KAAA,GAAG,SAARA,KAAKA,CAAIC,CAAS,EAAEC,EAAU,EAAEC,EAAW;EAAA,OACtDC,IAAI,CAACC,GAAG,CAACF,EAAE,aAAFA,EAAE,cAAFA,EAAE,GAAI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