@activecollab/components 2.0.363 → 2.0.364

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 (79) hide show
  1. package/dist/cjs/presentation/stackedCard/content/ImageCard.js +60 -0
  2. package/dist/cjs/presentation/stackedCard/content/ImageCard.js.map +1 -0
  3. package/dist/cjs/presentation/stackedCard/content/LinkCard.js +348 -0
  4. package/dist/cjs/presentation/stackedCard/content/LinkCard.js.map +1 -0
  5. package/dist/cjs/presentation/stackedCard/content/NoteCard.js +92 -0
  6. package/dist/cjs/presentation/stackedCard/content/NoteCard.js.map +1 -0
  7. package/dist/cjs/presentation/stackedCard/content/SwatchCard.js +74 -0
  8. package/dist/cjs/presentation/stackedCard/content/SwatchCard.js.map +1 -0
  9. package/dist/cjs/presentation/stackedCard/content/TaskCard.js +231 -0
  10. package/dist/cjs/presentation/stackedCard/content/TaskCard.js.map +1 -0
  11. package/dist/cjs/presentation/stackedCard/content/index.js +83 -0
  12. package/dist/cjs/presentation/stackedCard/content/index.js.map +1 -0
  13. package/dist/cjs/presentation/stackedCard/content/shared.js +144 -0
  14. package/dist/cjs/presentation/stackedCard/content/shared.js.map +1 -0
  15. package/dist/cjs/presentation/stackedCard/content/unfurl.js +172 -0
  16. package/dist/cjs/presentation/stackedCard/content/unfurl.js.map +1 -0
  17. package/dist/cjs/presentation/stackedCard/primitives.js +254 -0
  18. package/dist/cjs/presentation/stackedCard/primitives.js.map +1 -0
  19. package/dist/cjs/presentation/stackedCard/resizePolicy.js +183 -0
  20. package/dist/cjs/presentation/stackedCard/resizePolicy.js.map +1 -0
  21. package/dist/cjs/presentation/stackedCard/shell.js +165 -0
  22. package/dist/cjs/presentation/stackedCard/shell.js.map +1 -0
  23. package/dist/cjs/presentation/stackedCard/storyScaffold.js +72 -0
  24. package/dist/cjs/presentation/stackedCard/storyScaffold.js.map +1 -0
  25. package/dist/cjs/presentation/stackedCard/useInlineEdit.js +208 -0
  26. package/dist/cjs/presentation/stackedCard/useInlineEdit.js.map +1 -0
  27. package/dist/esm/presentation/stackedCard/content/ImageCard.d.ts +15 -0
  28. package/dist/esm/presentation/stackedCard/content/ImageCard.d.ts.map +1 -0
  29. package/dist/esm/presentation/stackedCard/content/ImageCard.js +50 -0
  30. package/dist/esm/presentation/stackedCard/content/ImageCard.js.map +1 -0
  31. package/dist/esm/presentation/stackedCard/content/LinkCard.d.ts +28 -0
  32. package/dist/esm/presentation/stackedCard/content/LinkCard.d.ts.map +1 -0
  33. package/dist/esm/presentation/stackedCard/content/LinkCard.js +336 -0
  34. package/dist/esm/presentation/stackedCard/content/LinkCard.js.map +1 -0
  35. package/dist/esm/presentation/stackedCard/content/NoteCard.d.ts +10 -0
  36. package/dist/esm/presentation/stackedCard/content/NoteCard.d.ts.map +1 -0
  37. package/dist/esm/presentation/stackedCard/content/NoteCard.js +82 -0
  38. package/dist/esm/presentation/stackedCard/content/NoteCard.js.map +1 -0
  39. package/dist/esm/presentation/stackedCard/content/SwatchCard.d.ts +14 -0
  40. package/dist/esm/presentation/stackedCard/content/SwatchCard.d.ts.map +1 -0
  41. package/dist/esm/presentation/stackedCard/content/SwatchCard.js +64 -0
  42. package/dist/esm/presentation/stackedCard/content/SwatchCard.js.map +1 -0
  43. package/dist/esm/presentation/stackedCard/content/TaskCard.d.ts +29 -0
  44. package/dist/esm/presentation/stackedCard/content/TaskCard.d.ts.map +1 -0
  45. package/dist/esm/presentation/stackedCard/content/TaskCard.js +218 -0
  46. package/dist/esm/presentation/stackedCard/content/TaskCard.js.map +1 -0
  47. package/dist/esm/presentation/stackedCard/content/index.d.ts +8 -0
  48. package/dist/esm/presentation/stackedCard/content/index.d.ts.map +1 -0
  49. package/dist/esm/presentation/stackedCard/content/index.js +8 -0
  50. package/dist/esm/presentation/stackedCard/content/index.js.map +1 -0
  51. package/dist/esm/presentation/stackedCard/content/shared.d.ts +46 -0
  52. package/dist/esm/presentation/stackedCard/content/shared.d.ts.map +1 -0
  53. package/dist/esm/presentation/stackedCard/content/shared.js +134 -0
  54. package/dist/esm/presentation/stackedCard/content/shared.js.map +1 -0
  55. package/dist/esm/presentation/stackedCard/content/unfurl.d.ts +89 -0
  56. package/dist/esm/presentation/stackedCard/content/unfurl.d.ts.map +1 -0
  57. package/dist/esm/presentation/stackedCard/content/unfurl.js +147 -0
  58. package/dist/esm/presentation/stackedCard/content/unfurl.js.map +1 -0
  59. package/dist/esm/presentation/stackedCard/primitives.d.ts +84 -0
  60. package/dist/esm/presentation/stackedCard/primitives.d.ts.map +1 -0
  61. package/dist/esm/presentation/stackedCard/primitives.js +241 -0
  62. package/dist/esm/presentation/stackedCard/primitives.js.map +1 -0
  63. package/dist/esm/presentation/stackedCard/resizePolicy.d.ts +97 -0
  64. package/dist/esm/presentation/stackedCard/resizePolicy.d.ts.map +1 -0
  65. package/dist/esm/presentation/stackedCard/resizePolicy.js +173 -0
  66. package/dist/esm/presentation/stackedCard/resizePolicy.js.map +1 -0
  67. package/dist/esm/presentation/stackedCard/shell.d.ts +46 -0
  68. package/dist/esm/presentation/stackedCard/shell.d.ts.map +1 -0
  69. package/dist/esm/presentation/stackedCard/shell.js +156 -0
  70. package/dist/esm/presentation/stackedCard/shell.js.map +1 -0
  71. package/dist/esm/presentation/stackedCard/storyScaffold.d.ts +28 -0
  72. package/dist/esm/presentation/stackedCard/storyScaffold.d.ts.map +1 -0
  73. package/dist/esm/presentation/stackedCard/storyScaffold.js +66 -0
  74. package/dist/esm/presentation/stackedCard/storyScaffold.js.map +1 -0
  75. package/dist/esm/presentation/stackedCard/useInlineEdit.d.ts +68 -0
  76. package/dist/esm/presentation/stackedCard/useInlineEdit.d.ts.map +1 -0
  77. package/dist/esm/presentation/stackedCard/useInlineEdit.js +192 -0
  78. package/dist/esm/presentation/stackedCard/useInlineEdit.js.map +1 -0
  79. package/package.json +1 -1
@@ -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,aAAF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AAGV,IAAI,CAACE,CAAC;QAAE6B,EAAE,EAAES,CAAC,CAAC5B,IAAI,GAAGZ,IAAI,CAACG;MAAE,CAAC,EAC5CE,MACF,CAAC;IACH,KAAK,KAAK;MACR;MACA,OAAOa,WAAW,CAChBC,KAAK,EACL;QACEU,EAAE,EAAEpC,MAAM,CAACgD,QAAQ,CAACD,CAAC,CAAC1B,IAAI,CAAC,GAAG0B,CAAC,CAAC1B,IAAI,GAAGd,IAAI,CAACE,CAAC,GAAG,CAAC;QACjD6B,EAAE,EAAEtC,MAAM,CAACgD,QAAQ,CAACD,CAAC,CAACxB,IAAI,CAAC,GAAGwB,CAAC,CAACxB,IAAI,GAAGhB,IAAI,CAACG,CAAC,GAAG;MAClD,CAAC,EACDE,MACF,CAAC;IACH;MACE,OAAO,IAAI;EACf;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACO,IAAMqC,cAAc,GAAA7D,OAAA,CAAA6D,cAAA,GAAG,SAAjBA,cAAcA,CACzB1C,IAAU,EACVK,MAAc,EACdJ,UAAsB,EACX;EACX,IAAA0C,iBAAA,GAAuBvC,eAAe,CAACC,MAAM,EAAEJ,UAAU,CAAC;IAAlDS,IAAI,GAAAiC,iBAAA,CAAJjC,IAAI;IAAEI,IAAI,GAAA6B,iBAAA,CAAJ7B,IAAI;EAClB,IAAI,CAACrB,MAAM,CAACgD,QAAQ,CAAC3B,IAAI,CAAC,IAAIA,IAAI,IAAIJ,IAAI,EAAE,OAAO,CAAC;EACpD,OAAOnB,IAAI,CAACO,KAAK,CAACX,KAAK,CAAE,CAACa,IAAI,CAACE,CAAC,GAAGQ,IAAI,KAAKI,IAAI,GAAGJ,IAAI,CAAC,GAAI,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AAC3E,CAAC","ignoreList":[]}
@@ -0,0 +1,165 @@
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
@@ -0,0 +1 @@
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 </StyledResizeHandle>\n ) : null}\n </StyledCard>\n );\n }\n);\n\nStackedCard.displayName = \"StackedCard\";\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAF,uBAAA,CAAAC,OAAA;AAAgD,IAAAE,SAAA;AAAA,SAAAH,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,wBAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAM,EAAA,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AAC;EACrD,CAAC,EACD,CAACX,aAAa,CAChB,CAAC;EAED,IAAMiB,eAAe,GAAG,IAAAX,kBAAW,EAAC,YAAM;IACxCH,UAAU,CAACI,OAAO,GAAG,IAAI;EAC3B,CAAC,EAAE,EAAE,CAAC;EAEN,oBACErG,MAAA,CAAAe,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":[]}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.StyledSheet = exports.StyledGrid = exports.StyledColumn = exports.SheetHeading = exports.Section = exports.Labeled = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+ var _Typography = require("../../components/Typography");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ /**
12
+ * Shared spec-sheet scaffolding for the StackedCard concept stories (Sheet,
13
+ * Section, Labeled, Grid, Column) plus the DS token candidates the subsystem
14
+ * needs. Presentation-only; keeps the three StackedCard stories laying out the
15
+ * same way instead of each re-declaring the sheet chrome.
16
+ *
17
+ * The `--sc-*` variables are declared here as design-system PROPOSALS (a
18
+ * selection ring + a dark scrim family). The shell and primitives reference
19
+ * these only, so no rgba/hex is baked into a reusable style.
20
+ */
21
+
22
+ var StyledSheet = exports.StyledSheet = _styledComponents.default.div.withConfig({
23
+ displayName: "storyScaffold__StyledSheet",
24
+ componentId: "sc-7oxew-0"
25
+ })(["--sc-selection-ring:var(--color-primary-500,#2f6bff);--sc-scrim:rgba(0,0,0,0.55);--sc-scrim-strong:rgba(0,0,0,0.72);--sc-scrim-fg:#ffffff;--sc-completed-tint:rgba(72,201,176,0.16);min-height:100vh;padding:32px 40px 64px;background:var(--page-paper-dimmed,var(--color-theme-200));.sheet-title{margin-bottom:8px;}.sheet-lede{display:block;margin-bottom:24px;max-width:760px;}"]);
26
+ var StyledSection = _styledComponents.default.section.withConfig({
27
+ displayName: "storyScaffold__StyledSection",
28
+ componentId: "sc-7oxew-1"
29
+ })(["margin-top:40px;> .section-caption{display:block;margin-bottom:4px;text-transform:uppercase;letter-spacing:0.06em;}> .section-note{display:block;margin-bottom:16px;max-width:720px;}"]);
30
+ var StyledGrid = exports.StyledGrid = _styledComponents.default.div.withConfig({
31
+ displayName: "storyScaffold__StyledGrid",
32
+ componentId: "sc-7oxew-2"
33
+ })(["display:flex;flex-wrap:wrap;gap:24px;align-items:flex-start;"]);
34
+ var StyledColumn = exports.StyledColumn = _styledComponents.default.div.withConfig({
35
+ displayName: "storyScaffold__StyledColumn",
36
+ componentId: "sc-7oxew-3"
37
+ })(["display:flex;flex-direction:column;gap:12px;"]);
38
+ var StyledLabeled = _styledComponents.default.figure.withConfig({
39
+ displayName: "storyScaffold__StyledLabeled",
40
+ componentId: "sc-7oxew-4"
41
+ })(["margin:0;display:flex;flex-direction:column;gap:8px;> figcaption{order:-1;max-width:320px;}"]);
42
+ var Labeled = exports.Labeled = function Labeled(_ref) {
43
+ var label = _ref.label,
44
+ children = _ref.children;
45
+ return /*#__PURE__*/_react.default.createElement(StyledLabeled, null, /*#__PURE__*/_react.default.createElement("figcaption", null, /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
46
+ color: "secondary"
47
+ }, label)), children);
48
+ };
49
+ var Section = exports.Section = function Section(_ref2) {
50
+ var caption = _ref2.caption,
51
+ note = _ref2.note,
52
+ children = _ref2.children;
53
+ return /*#__PURE__*/_react.default.createElement(StyledSection, null, /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
54
+ weight: "bold",
55
+ color: "tertiary",
56
+ className: "section-caption"
57
+ }, caption), note ? /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
58
+ color: "tertiary",
59
+ className: "section-note"
60
+ }, note) : null, /*#__PURE__*/_react.default.createElement(StyledGrid, null, children));
61
+ };
62
+ var SheetHeading = exports.SheetHeading = function SheetHeading(_ref3) {
63
+ var title = _ref3.title,
64
+ children = _ref3.children;
65
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Typography.Title2, {
66
+ className: "sheet-title"
67
+ }, title), /*#__PURE__*/_react.default.createElement(_Typography.Caption1, {
68
+ color: "tertiary",
69
+ className: "sheet-lede"
70
+ }, children));
71
+ };
72
+ //# sourceMappingURL=storyScaffold.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storyScaffold.js","names":["_react","_interopRequireDefault","require","_styledComponents","_Typography","e","__esModule","default","StyledSheet","exports","styled","div","withConfig","displayName","componentId","StyledSection","section","StyledGrid","StyledColumn","StyledLabeled","figure","Labeled","_ref","label","children","createElement","Caption1","color","Section","_ref2","caption","note","weight","className","SheetHeading","_ref3","title","Fragment","Title2"],"sources":["../../../../src/presentation/stackedCard/storyScaffold.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode } from \"react\";\n\nimport styled from \"styled-components\";\n\nimport { Caption1, Title2 } from \"../../components/Typography\";\n\n/**\n * Shared spec-sheet scaffolding for the StackedCard concept stories (Sheet,\n * Section, Labeled, Grid, Column) plus the DS token candidates the subsystem\n * needs. Presentation-only; keeps the three StackedCard stories laying out the\n * same way instead of each re-declaring the sheet chrome.\n *\n * The `--sc-*` variables are declared here as design-system PROPOSALS (a\n * selection ring + a dark scrim family). The shell and primitives reference\n * these only, so no rgba/hex is baked into a reusable style.\n */\n\nexport const StyledSheet = styled.div`\n --sc-selection-ring: var(--color-primary-500, #2f6bff);\n --sc-scrim: rgba(0, 0, 0, 0.55);\n --sc-scrim-strong: rgba(0, 0, 0, 0.72);\n --sc-scrim-fg: #ffffff;\n --sc-completed-tint: rgba(72, 201, 176, 0.16);\n\n min-height: 100vh;\n padding: 32px 40px 64px;\n background: var(--page-paper-dimmed, var(--color-theme-200));\n\n .sheet-title {\n margin-bottom: 8px;\n }\n\n .sheet-lede {\n display: block;\n margin-bottom: 24px;\n max-width: 760px;\n }\n`;\n\nconst StyledSection = styled.section`\n margin-top: 40px;\n\n > .section-caption {\n display: block;\n margin-bottom: 4px;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n }\n\n > .section-note {\n display: block;\n margin-bottom: 16px;\n max-width: 720px;\n }\n`;\n\nexport const StyledGrid = styled.div`\n display: flex;\n flex-wrap: wrap;\n gap: 24px;\n align-items: flex-start;\n`;\n\nexport const StyledColumn = styled.div`\n display: flex;\n flex-direction: column;\n gap: 12px;\n`;\n\nconst StyledLabeled = styled.figure`\n margin: 0;\n display: flex;\n flex-direction: column;\n gap: 8px;\n\n > figcaption {\n order: -1;\n max-width: 320px;\n }\n`;\n\nexport const Labeled = ({\n label,\n children,\n}: {\n label: ReactNode;\n children: ReactNode;\n}): ReactElement => (\n <StyledLabeled>\n <figcaption>\n <Caption1 color=\"secondary\">{label}</Caption1>\n </figcaption>\n {children}\n </StyledLabeled>\n);\n\nexport const Section = ({\n caption,\n note,\n children,\n}: {\n caption: string;\n note?: ReactNode;\n children: ReactNode;\n}): ReactElement => (\n <StyledSection>\n <Caption1 weight=\"bold\" color=\"tertiary\" className=\"section-caption\">\n {caption}\n </Caption1>\n {note ? (\n <Caption1 color=\"tertiary\" className=\"section-note\">\n {note}\n </Caption1>\n ) : null}\n <StyledGrid>{children}</StyledGrid>\n </StyledSection>\n);\n\nexport const SheetHeading = ({\n title,\n children,\n}: {\n title: string;\n children: ReactNode;\n}): ReactElement => (\n <>\n <Title2 className=\"sheet-title\">{title}</Title2>\n <Caption1 color=\"tertiary\" className=\"sheet-lede\">\n {children}\n </Caption1>\n </>\n);\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,WAAA,GAAAF,OAAA;AAA+D,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,IAAMG,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAGE,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6XAoBpC;AAED,IAAMC,aAAa,GAAGL,yBAAM,CAACM,OAAO,CAAAJ,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6LAenC;AAEM,IAAMG,UAAU,GAAAR,OAAA,CAAAQ,UAAA,GAAGP,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oEAKnC;AAEM,IAAMI,YAAY,GAAAT,OAAA,CAAAS,YAAA,GAAGR,yBAAM,CAACC,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,oDAIrC;AAED,IAAMK,aAAa,GAAGT,yBAAM,CAACU,MAAM,CAAAR,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,mGAUlC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