@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,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,GAA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,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,6XAoB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AM;IAACL,KAAK,EAAC,UAAU;IAACM,SAAS,EAAC;EAAiB,GACjEH,OACO,CAAC,EACVC,IAAI,gBACH/B,MAAA,CAAAO,OAAA,CAAAkB,aAAA,CAACrB,WAAA,CAAAsB,QAAQ;IAACC,KAAK,EAAC,UAAU;IAACM,SAAS,EAAC;EAAc,GAChDF,IACO,CAAC,GACT,IAAI,eACR/B,MAAA,CAAAO,OAAA,CAAAkB,aAAA,CAACR,UAAU,QAAEO,QAAqB,CACrB,CAAC;AAAA,CACjB;AAEM,IAAMU,YAAY,GAAAzB,OAAA,CAAAyB,YAAA,GAAG,SAAfA,YAAYA,CAAAC,KAAA;EAAA,IACvBC,KAAK,GAAAD,KAAA,CAALC,KAAK;IACLZ,QAAQ,GAAAW,KAAA,CAARX,QAAQ;EAAA,oBAKRxB,MAAA,CAAAO,OAAA,CAAAkB,aAAA,CAAAzB,MAAA,CAAAO,OAAA,CAAA8B,QAAA,qBACErC,MAAA,CAAAO,OAAA,CAAAkB,aAAA,CAACrB,WAAA,CAAAkC,MAAM;IAACL,SAAS,EAAC;EAAa,GAAEG,KAAc,CAAC,eAChDpC,MAAA,CAAAO,OAAA,CAAAkB,aAAA,CAACrB,WAAA,CAAAsB,QAAQ;IAACC,KAAK,EAAC,UAAU;IAACM,SAAS,EAAC;EAAY,GAC9CT,QACO,CACV,CAAC;AAAA,CACJ","ignoreList":[]}
@@ -0,0 +1,208 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useInlineEdit = void 0;
7
+ var _react = require("react");
8
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
9
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
11
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
12
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
13
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
14
+ /**
15
+ * useInlineEdit — story-local click-to-edit state machine for StackedCard
16
+ * (task 4/8). Presentation-only; not exported from the design-system barrel.
17
+ *
18
+ * A card in preview/placeholder mode enters an EDITING state on click: a
19
+ * card-centered text field with confirm/cancel keyboard rules, an optional
20
+ * validator, and a single-line ↔ multi-line mode switch. The hook owns only the
21
+ * editing lifecycle (mode, working value, error, keyboard + outside-click); the
22
+ * card chrome and the async handoff after commit (e.g. the link unfurl ladder
23
+ * from task 3/8) live in the story that consumes it.
24
+ *
25
+ * ── The decided rules (AC task #454744) ──
26
+ * Single-line Enter confirms · click-outside confirms · Esc cancels + reverts
27
+ * Multi-line Enter = newline · Cmd/Ctrl+Enter saves · click-outside saves ·
28
+ * Esc cancels + reverts
29
+ * Validator validate(value) => true | errorMessage, run before every accept
30
+ * pass → commit + exit editing
31
+ * fail via a key → STAY editing, surface the message (retry)
32
+ * fail via outside → REVERT (acts as cancel) — user never trapped
33
+ *
34
+ * Keyboard is handled on the field's own keydown (never a global listener) and
35
+ * every keydown stops propagation, so the card focus model (task 2/8) can't
36
+ * swallow the Enter/Esc that belong to the editor.
37
+ */
38
+
39
+ /** Props to spread onto the `<input>` or `<textarea>` while editing. */
40
+
41
+ var useInlineEdit = exports.useInlineEdit = function useInlineEdit() {
42
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
43
+ _ref$initialValue = _ref.initialValue,
44
+ initialValue = _ref$initialValue === void 0 ? "" : _ref$initialValue,
45
+ _ref$multiline = _ref.multiline,
46
+ multiline = _ref$multiline === void 0 ? false : _ref$multiline,
47
+ validate = _ref.validate,
48
+ onCommit = _ref.onCommit;
49
+ var _useState = (0, _react.useState)(false),
50
+ _useState2 = _slicedToArray(_useState, 2),
51
+ editing = _useState2[0],
52
+ setEditingState = _useState2[1];
53
+ var _useState3 = (0, _react.useState)(initialValue),
54
+ _useState4 = _slicedToArray(_useState3, 2),
55
+ value = _useState4[0],
56
+ setValueState = _useState4[1];
57
+ var _useState5 = (0, _react.useState)(initialValue),
58
+ _useState6 = _slicedToArray(_useState5, 2),
59
+ committed = _useState6[0],
60
+ setCommittedState = _useState6[1];
61
+ var _useState7 = (0, _react.useState)(null),
62
+ _useState8 = _slicedToArray(_useState7, 2),
63
+ error = _useState8[0],
64
+ setError = _useState8[1];
65
+
66
+ // Refs mirror the state that the (stable) event handlers read, so the handlers
67
+ // never go stale and never need to be re-created as the value changes.
68
+ var elRef = (0, _react.useRef)(null);
69
+ var valueRef = (0, _react.useRef)(value);
70
+ var committedRef = (0, _react.useRef)(committed);
71
+ var editingRef = (0, _react.useRef)(editing);
72
+ // Set right before a programmatic exit so the blur that follows the field
73
+ // unmounting is ignored (it isn't a real click-outside).
74
+ var skipBlurRef = (0, _react.useRef)(false);
75
+ var validateRef = (0, _react.useRef)(validate);
76
+ var onCommitRef = (0, _react.useRef)(onCommit);
77
+ (0, _react.useEffect)(function () {
78
+ validateRef.current = validate;
79
+ onCommitRef.current = onCommit;
80
+ });
81
+ var setValue = (0, _react.useCallback)(function (v) {
82
+ valueRef.current = v;
83
+ setValueState(v);
84
+ }, []);
85
+ var setCommitted = (0, _react.useCallback)(function (v) {
86
+ committedRef.current = v;
87
+ setCommittedState(v);
88
+ }, []);
89
+ var setEditing = (0, _react.useCallback)(function (v) {
90
+ editingRef.current = v;
91
+ setEditingState(v);
92
+ }, []);
93
+ var begin = (0, _react.useCallback)(function () {
94
+ skipBlurRef.current = false;
95
+ setValue(committedRef.current);
96
+ setError(null);
97
+ setEditing(true);
98
+ }, [setValue, setEditing]);
99
+ var cancel = (0, _react.useCallback)(function () {
100
+ skipBlurRef.current = true;
101
+ setValue(committedRef.current);
102
+ setError(null);
103
+ setEditing(false);
104
+ }, [setValue, setEditing]);
105
+ var reset = (0, _react.useCallback)(function () {
106
+ var next = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialValue;
107
+ skipBlurRef.current = true;
108
+ setCommitted(next);
109
+ setValue(next);
110
+ setError(null);
111
+ setEditing(false);
112
+ }, [initialValue, setCommitted, setValue, setEditing]);
113
+ var commit = (0, _react.useCallback)(function (v) {
114
+ var _onCommitRef$current;
115
+ skipBlurRef.current = true;
116
+ setCommitted(v);
117
+ setValue(v);
118
+ setError(null);
119
+ setEditing(false);
120
+ (_onCommitRef$current = onCommitRef.current) === null || _onCommitRef$current === void 0 || _onCommitRef$current.call(onCommitRef, v);
121
+ }, [setCommitted, setValue, setEditing]);
122
+
123
+ // Run the validator (if any) and accept, or handle the failure per source:
124
+ // a key retry keeps the user in the field with a message; an outside click
125
+ // reverts so the user is never trapped in an invalid editor.
126
+ var attempt = (0, _react.useCallback)(function (source) {
127
+ var v = valueRef.current;
128
+ var result = validateRef.current ? validateRef.current(v) : true;
129
+ if (result === true) {
130
+ commit(v);
131
+ return true;
132
+ }
133
+ if (source === "outside") {
134
+ cancel();
135
+ return false;
136
+ }
137
+ setError(result);
138
+ return false;
139
+ }, [commit, cancel]);
140
+ var onChange = (0, _react.useCallback)(function (e) {
141
+ setValue(e.target.value);
142
+ // Clear a stale error as the user edits; the next accept re-validates.
143
+ setError(function (prev) {
144
+ return prev == null ? prev : null;
145
+ });
146
+ }, [setValue]);
147
+ var onKeyDown = (0, _react.useCallback)(function (e) {
148
+ // Keep Enter/Esc from reaching the card's own keyboard model (task 2/8).
149
+ e.stopPropagation();
150
+ if (e.key === "Escape") {
151
+ e.preventDefault();
152
+ cancel();
153
+ return;
154
+ }
155
+ if (e.key === "Enter") {
156
+ var withMeta = e.metaKey || e.ctrlKey;
157
+ // Multi-line: a bare Enter is a newline; only Cmd/Ctrl+Enter saves.
158
+ if (multiline && !withMeta) return;
159
+ e.preventDefault();
160
+ attempt("key");
161
+ }
162
+ }, [attempt, cancel, multiline]);
163
+ var onBlur = (0, _react.useCallback)(function () {
164
+ if (skipBlurRef.current) {
165
+ skipBlurRef.current = false;
166
+ return;
167
+ }
168
+ if (!editingRef.current) return;
169
+ attempt("outside");
170
+ }, [attempt]);
171
+ var setRef = (0, _react.useCallback)(function (el) {
172
+ elRef.current = el;
173
+ }, []);
174
+
175
+ // On entering editing, focus the field and drop the caret at the end so the
176
+ // cursor is visible and existing text is ready to extend.
177
+ (0, _react.useEffect)(function () {
178
+ if (!editing) return;
179
+ var el = elRef.current;
180
+ if (!el) return;
181
+ el.focus();
182
+ var len = el.value.length;
183
+ try {
184
+ el.setSelectionRange(len, len);
185
+ } catch (_unused) {
186
+ /* some input types disallow setSelectionRange — harmless here. */
187
+ }
188
+ }, [editing]);
189
+ return {
190
+ editing,
191
+ value,
192
+ committed,
193
+ error,
194
+ multiline,
195
+ begin,
196
+ cancel,
197
+ reset,
198
+ bind: {
199
+ ref: setRef,
200
+ value,
201
+ onChange,
202
+ onKeyDown,
203
+ onBlur,
204
+ "aria-invalid": error != null
205
+ }
206
+ };
207
+ };
208
+ //# sourceMappingURL=useInlineEdit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInlineEdit.js","names":["_react","require","_slicedToArray","r","e","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","a","_arrayLikeToArray","t","toString","call","slice","constructor","name","Array","from","test","length","n","l","Symbol","iterator","i","u","f","o","next","Object","done","push","value","return","isArray","useInlineEdit","exports","_ref","arguments","undefined","_ref$initialValue","initialValue","_ref$multiline","multiline","validate","onCommit","_useState","useState","_useState2","editing","setEditingState","_useState3","_useState4","setValueState","_useState5","_useState6","committed","setCommittedState","_useState7","_useState8","error","setError","elRef","useRef","valueRef","committedRef","editingRef","skipBlurRef","validateRef","onCommitRef","useEffect","current","setValue","useCallback","v","setCommitted","setEditing","begin","cancel","reset","commit","_onCommitRef$current","attempt","source","result","onChange","target","prev","onKeyDown","stopPropagation","key","preventDefault","withMeta","metaKey","ctrlKey","onBlur","setRef","el","focus","len","setSelectionRange","_unused","bind","ref"],"sources":["../../../../src/presentation/stackedCard/useInlineEdit.ts"],"sourcesContent":["import {\n ChangeEvent,\n FocusEvent,\n KeyboardEvent,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from \"react\";\n\n/**\n * useInlineEdit — story-local click-to-edit state machine for StackedCard\n * (task 4/8). Presentation-only; not exported from the design-system barrel.\n *\n * A card in preview/placeholder mode enters an EDITING state on click: a\n * card-centered text field with confirm/cancel keyboard rules, an optional\n * validator, and a single-line ↔ multi-line mode switch. The hook owns only the\n * editing lifecycle (mode, working value, error, keyboard + outside-click); the\n * card chrome and the async handoff after commit (e.g. the link unfurl ladder\n * from task 3/8) live in the story that consumes it.\n *\n * ── The decided rules (AC task #454744) ──\n * Single-line Enter confirms · click-outside confirms · Esc cancels + reverts\n * Multi-line Enter = newline · Cmd/Ctrl+Enter saves · click-outside saves ·\n * Esc cancels + reverts\n * Validator validate(value) => true | errorMessage, run before every accept\n * pass → commit + exit editing\n * fail via a key → STAY editing, surface the message (retry)\n * fail via outside → REVERT (acts as cancel) — user never trapped\n *\n * Keyboard is handled on the field's own keydown (never a global listener) and\n * every keydown stops propagation, so the card focus model (task 2/8) can't\n * swallow the Enter/Esc that belong to the editor.\n */\n\nexport type InlineEditValidator = (value: string) => true | string;\n\nexport interface UseInlineEditConfig {\n /** Seed value for the first edit; also the revert target until first commit. */\n initialValue?: string;\n /** Multi-line mode: Enter inserts a newline, Cmd/Ctrl+Enter saves. */\n multiline?: boolean;\n /** Optional validator, run before every accept. `true` passes; a string fails. */\n validate?: InlineEditValidator;\n /** Called with the committed value when an accept passes validation. */\n onCommit?: (value: string) => void;\n}\n\n/** Props to spread onto the `<input>` or `<textarea>` while editing. */\nexport interface InlineEditBind {\n /** Callback ref — assignable to both an input and a textarea. */\n ref: (el: HTMLInputElement | HTMLTextAreaElement | null) => void;\n value: string;\n onChange: (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\n onKeyDown: (e: KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\n onBlur: (e: FocusEvent<HTMLInputElement | HTMLTextAreaElement>) => void;\n \"aria-invalid\": boolean;\n}\n\nexport interface InlineEditController {\n /** Whether the field is currently shown. */\n editing: boolean;\n /** The working value (the draft being typed). */\n value: string;\n /** The last committed value — what a revert restores. */\n committed: string;\n /** The current validation message, or null when valid / untouched. */\n error: string | null;\n /** Whether this editor is in multi-line mode. */\n multiline: boolean;\n /** Enter editing, loading the last committed value. */\n begin: () => void;\n /** Cancel + revert to the committed value (the Esc / invalid-outside path). */\n cancel: () => void;\n /** Force a committed value without going through the field (repeat demos). */\n reset: (next?: string) => void;\n /** Spread onto the field element while `editing`. */\n bind: InlineEditBind;\n}\n\nexport const useInlineEdit = ({\n initialValue = \"\",\n multiline = false,\n validate,\n onCommit,\n}: UseInlineEditConfig = {}): InlineEditController => {\n const [editing, setEditingState] = useState(false);\n const [value, setValueState] = useState(initialValue);\n const [committed, setCommittedState] = useState(initialValue);\n const [error, setError] = useState<string | null>(null);\n\n // Refs mirror the state that the (stable) event handlers read, so the handlers\n // never go stale and never need to be re-created as the value changes.\n const elRef = useRef<HTMLInputElement | HTMLTextAreaElement | null>(null);\n const valueRef = useRef(value);\n const committedRef = useRef(committed);\n const editingRef = useRef(editing);\n // Set right before a programmatic exit so the blur that follows the field\n // unmounting is ignored (it isn't a real click-outside).\n const skipBlurRef = useRef(false);\n const validateRef = useRef(validate);\n const onCommitRef = useRef(onCommit);\n\n useEffect(() => {\n validateRef.current = validate;\n onCommitRef.current = onCommit;\n });\n\n const setValue = useCallback((v: string) => {\n valueRef.current = v;\n setValueState(v);\n }, []);\n\n const setCommitted = useCallback((v: string) => {\n committedRef.current = v;\n setCommittedState(v);\n }, []);\n\n const setEditing = useCallback((v: boolean) => {\n editingRef.current = v;\n setEditingState(v);\n }, []);\n\n const begin = useCallback(() => {\n skipBlurRef.current = false;\n setValue(committedRef.current);\n setError(null);\n setEditing(true);\n }, [setValue, setEditing]);\n\n const cancel = useCallback(() => {\n skipBlurRef.current = true;\n setValue(committedRef.current);\n setError(null);\n setEditing(false);\n }, [setValue, setEditing]);\n\n const reset = useCallback(\n (next: string = initialValue) => {\n skipBlurRef.current = true;\n setCommitted(next);\n setValue(next);\n setError(null);\n setEditing(false);\n },\n [initialValue, setCommitted, setValue, setEditing]\n );\n\n const commit = useCallback(\n (v: string) => {\n skipBlurRef.current = true;\n setCommitted(v);\n setValue(v);\n setError(null);\n setEditing(false);\n onCommitRef.current?.(v);\n },\n [setCommitted, setValue, setEditing]\n );\n\n // Run the validator (if any) and accept, or handle the failure per source:\n // a key retry keeps the user in the field with a message; an outside click\n // reverts so the user is never trapped in an invalid editor.\n const attempt = useCallback(\n (source: \"key\" | \"outside\"): boolean => {\n const v = valueRef.current;\n const result = validateRef.current ? validateRef.current(v) : true;\n if (result === true) {\n commit(v);\n return true;\n }\n if (source === \"outside\") {\n cancel();\n return false;\n }\n setError(result);\n return false;\n },\n [commit, cancel]\n );\n\n const onChange = useCallback(\n (e: ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n setValue(e.target.value);\n // Clear a stale error as the user edits; the next accept re-validates.\n setError((prev) => (prev == null ? prev : null));\n },\n [setValue]\n );\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {\n // Keep Enter/Esc from reaching the card's own keyboard model (task 2/8).\n e.stopPropagation();\n\n if (e.key === \"Escape\") {\n e.preventDefault();\n cancel();\n return;\n }\n\n if (e.key === \"Enter\") {\n const withMeta = e.metaKey || e.ctrlKey;\n // Multi-line: a bare Enter is a newline; only Cmd/Ctrl+Enter saves.\n if (multiline && !withMeta) return;\n e.preventDefault();\n attempt(\"key\");\n }\n },\n [attempt, cancel, multiline]\n );\n\n const onBlur = useCallback(() => {\n if (skipBlurRef.current) {\n skipBlurRef.current = false;\n return;\n }\n if (!editingRef.current) return;\n attempt(\"outside\");\n }, [attempt]);\n\n const setRef = useCallback(\n (el: HTMLInputElement | HTMLTextAreaElement | null) => {\n elRef.current = el;\n },\n []\n );\n\n // On entering editing, focus the field and drop the caret at the end so the\n // cursor is visible and existing text is ready to extend.\n useEffect(() => {\n if (!editing) return;\n const el = elRef.current;\n if (!el) return;\n el.focus();\n const len = el.value.length;\n try {\n el.setSelectionRange(len, len);\n } catch {\n /* some input types disallow setSelectionRange — harmless here. */\n }\n }, [editing]);\n\n return {\n editing,\n value,\n committed,\n error,\n multiline,\n begin,\n cancel,\n reset,\n bind: {\n ref: setRef,\n value,\n onChange,\n onKeyDown,\n onBlur,\n \"aria-invalid\": error != null,\n },\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAQe,SAAAC,eAAAC,CAAA,EAAAC,CAAA,WAAAC,eAAA,CAAAF,CAAA,KAAAG,qBAAA,CAAAH,CAAA,EAAAC,CAAA,KAAAG,2BAAA,CAAAJ,CAAA,EAAAC,CAAA,KAAAI,gBAAA;AAAA,SAAAA,iBAAA,cAAAC,SAAA;AAAA,SAAAF,4BAAAJ,CAAA,EAAAO,CAAA,QAAAP,CAAA,2BAAAA,CAAA,SAAAQ,iBAAA,CAAAR,CAAA,EAAAO,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,SAAS;IACTI,KAAK;IACLjB,SAAS;IACTkC,KAAK;IACLC,MAAM;IACNC,KAAK;IACLuB,IAAI,EAAE;MACJC,GAAG,EAAEP,MAAM;MACXhE,KAAK;MACLqD,QAAQ;MACRG,SAAS;MACTO,MAAM;MACN,cAAc,EAAEnC,KAAK,IAAI;IAC3B;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -32,4 +32,6 @@ export { TwoFactorShield } from "./TwoFactorShield";
32
32
  export type { TwoFactorShieldProps } from "./TwoFactorShield";
33
33
  export { BackupCodesDialogs, CreateLoginCodeDialogs } from "./TwoFactorDialogs";
34
34
  export type { BackupCodesDialogsProps, CreateLoginCodeDialogsProps, } from "./TwoFactorDialogs";
35
+ export { SettingsHeader, SettingsContent, StyledSettingRow, RowText, SettingRow, } from "./settings";
36
+ export type { SettingsHeaderProps, SettingRowProps } from "./settings";
35
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/presentation/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzE,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACrE,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,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AAoB,CAAC;AAChF,YAAY,EACV,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/presentation/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzE,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACrE,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,cAAc,GACf,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,YAAY,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EACL,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,YAAY,EACV,4BAA4B,EAC5B,qBAAqB,EACrB,UAAU,EACV,iBAAiB,EACjB,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,GACX,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,OAAO,EACP,KAAK,EACL,aAAa,EACb,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,UAAU,EACV,SAAS,EACT,KAAK,EACL,YAAY,EACZ,UAAU,EACV,UAAU,EACV,cAAc,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACzE,YAAY,EACV,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAChF,YAAY,EACV,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
@@ -21,4 +21,5 @@ export { TaskOptionsMenu, TaskListOptionsMenu } from "./TaskOptionsMenu";
21
21
  export { UserMenu } from "./UserMenu";
22
22
  export { TwoFactorShield } from "./TwoFactorShield";
23
23
  export { BackupCodesDialogs, CreateLoginCodeDialogs } from "./TwoFactorDialogs";
24
+ export { SettingsHeader, SettingsContent, StyledSettingRow, RowText, SettingRow } from "./settings";
24
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["MainLogo","RoundAvatar","PresentationShell","StyledPagePaper","PageHeader","ProjectPageHeader","TabHeader","FloatingControls","HelpAndSupportMenu","LinkingCommandsButton","LinkBranchOrPullRequestDialog","ConnectRepositoryDialog","RepositorySelect","buildRepoOptions","CONNECTIONS","PROJECT_REPOSITORIES","CONNECTABLE_REPOSITORIES","WebhookLogsDialog","WEBHOOK_CONNECTIONS","WEBHOOK_REPOSITORIES","SourceCodeSection","IssueRow","CodeRow","Spine","HistoryDialog","CompletedHeader","SuggestSubtasksButton","TaskOptionsMenu","TaskListOptionsMenu","UserMenu","TwoFactorShield","BackupCodesDialogs","CreateLoginCodeDialogs"],"sources":["../../../../src/presentation/shared/index.ts"],"sourcesContent":["/**\n * Shared building blocks for the Presentation mock-ups (`Presentation/*`\n * stories). The application shell, page headers, tab bar and small widgets are\n * defined once here and reused by the List view, Column view, Task sheet and\n * empty-page stories so the chrome stays identical and in one place.\n */\nexport * from \"./tokens\";\nexport { MainLogo } from \"./MainLogo\";\nexport { RoundAvatar } from \"./RoundAvatar\";\nexport { PresentationShell, StyledPagePaper } from \"./PresentationShell\";\nexport type { PresentationShellProps } from \"./PresentationShell\";\nexport { PageHeader, ProjectPageHeader, TabHeader } from \"./headers\";\nexport type {\n PageHeaderProps,\n ProjectPageHeaderProps,\n TabHeaderProps,\n} from \"./headers\";\nexport { FloatingControls } from \"./FloatingControls\";\nexport { HelpAndSupportMenu } from \"./HelpAndSupportMenu\";\nexport type { HelpAndSupportMenuProps } from \"./HelpAndSupportMenu\";\nexport { LinkingCommandsButton } from \"./LinkingCommandsButton\";\nexport { LinkBranchOrPullRequestDialog } from \"./LinkBranchOrPullRequestDialog\";\nexport type { LinkBranchOrPullRequestDialogProps } from \"./LinkBranchOrPullRequestDialog\";\nexport {\n ConnectRepositoryDialog,\n RepositorySelect,\n buildRepoOptions,\n CONNECTIONS,\n PROJECT_REPOSITORIES,\n CONNECTABLE_REPOSITORIES,\n} from \"./ConnectRepositoryDialog\";\nexport type {\n ConnectRepositoryDialogProps,\n RepositorySelectProps,\n Connection,\n ConnectionService,\n Repository,\n} from \"./ConnectRepositoryDialog\";\nexport {\n WebhookLogsDialog,\n WEBHOOK_CONNECTIONS,\n WEBHOOK_REPOSITORIES,\n} from \"./WebhookLogsDialog\";\nexport type {\n WebhookLogsDialogProps,\n WebhookConnection,\n WebhookRepository,\n WebhookLog,\n} from \"./WebhookLogsDialog\";\nexport {\n SourceCodeSection,\n IssueRow,\n CodeRow,\n Spine,\n HistoryDialog,\n CompletedHeader,\n} from \"./SourceCodeSection\";\nexport type {\n IssueEntry,\n CodeEntry,\n Stage,\n HistoryEvent,\n StageState,\n CodeStatus,\n SectionVariant,\n} from \"./SourceCodeSection\";\nexport { SuggestSubtasksButton } from \"./SuggestSubtasksButton\";\nexport { TaskOptionsMenu, TaskListOptionsMenu } from \"./TaskOptionsMenu\";\nexport type {\n TaskOptionsMenuProps,\n TaskListOptionsMenuProps,\n} from \"./TaskOptionsMenu\";\nexport { UserMenu } from \"./UserMenu\";\nexport type { UserMenuProps, UserMenuVariant } from \"./UserMenu\";\nexport { TwoFactorShield } from \"./TwoFactorShield\";\nexport type { TwoFactorShieldProps } from \"./TwoFactorShield\";\nexport { BackupCodesDialogs, CreateLoginCodeDialogs } from \"./TwoFactorDialogs\";\nexport type {\n BackupCodesDialogsProps,\n CreateLoginCodeDialogsProps,\n} from \"./TwoFactorDialogs\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,UAAU;AACxB,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,qBAAqB;AAExE,SAASC,UAAU,EAAEC,iBAAiB,EAAEC,SAAS,QAAQ,WAAW;AAMpE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,6BAA6B,QAAQ,iCAAiC;AAE/E,SACEC,uBAAuB,EACvBC,gBAAgB,EAChBC,gBAAgB,EAChBC,WAAW,EACXC,oBAAoB,EACpBC,wBAAwB,QACnB,2BAA2B;AAQlC,SACEC,iBAAiB,EACjBC,mBAAmB,EACnBC,oBAAoB,QACf,qBAAqB;AAO5B,SACEC,iBAAiB,EACjBC,QAAQ,EACRC,OAAO,EACPC,KAAK,EACLC,aAAa,EACbC,eAAe,QACV,qBAAqB;AAU5B,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,eAAe,EAAEC,mBAAmB,QAAQ,mBAAmB;AAKxE,SAASC,QAAQ,QAAQ,YAAY;AAErC,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,kBAAkB,EAAEC,sBAAsB,QAAQ,oBAAoB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["MainLogo","RoundAvatar","PresentationShell","StyledPagePaper","PageHeader","ProjectPageHeader","TabHeader","FloatingControls","HelpAndSupportMenu","LinkingCommandsButton","LinkBranchOrPullRequestDialog","ConnectRepositoryDialog","RepositorySelect","buildRepoOptions","CONNECTIONS","PROJECT_REPOSITORIES","CONNECTABLE_REPOSITORIES","WebhookLogsDialog","WEBHOOK_CONNECTIONS","WEBHOOK_REPOSITORIES","SourceCodeSection","IssueRow","CodeRow","Spine","HistoryDialog","CompletedHeader","SuggestSubtasksButton","TaskOptionsMenu","TaskListOptionsMenu","UserMenu","TwoFactorShield","BackupCodesDialogs","CreateLoginCodeDialogs","SettingsHeader","SettingsContent","StyledSettingRow","RowText","SettingRow"],"sources":["../../../../src/presentation/shared/index.ts"],"sourcesContent":["/**\n * Shared building blocks for the Presentation mock-ups (`Presentation/*`\n * stories). The application shell, page headers, tab bar and small widgets are\n * defined once here and reused by the List view, Column view, Task sheet and\n * empty-page stories so the chrome stays identical and in one place.\n */\nexport * from \"./tokens\";\nexport { MainLogo } from \"./MainLogo\";\nexport { RoundAvatar } from \"./RoundAvatar\";\nexport { PresentationShell, StyledPagePaper } from \"./PresentationShell\";\nexport type { PresentationShellProps } from \"./PresentationShell\";\nexport { PageHeader, ProjectPageHeader, TabHeader } from \"./headers\";\nexport type {\n PageHeaderProps,\n ProjectPageHeaderProps,\n TabHeaderProps,\n} from \"./headers\";\nexport { FloatingControls } from \"./FloatingControls\";\nexport { HelpAndSupportMenu } from \"./HelpAndSupportMenu\";\nexport type { HelpAndSupportMenuProps } from \"./HelpAndSupportMenu\";\nexport { LinkingCommandsButton } from \"./LinkingCommandsButton\";\nexport { LinkBranchOrPullRequestDialog } from \"./LinkBranchOrPullRequestDialog\";\nexport type { LinkBranchOrPullRequestDialogProps } from \"./LinkBranchOrPullRequestDialog\";\nexport {\n ConnectRepositoryDialog,\n RepositorySelect,\n buildRepoOptions,\n CONNECTIONS,\n PROJECT_REPOSITORIES,\n CONNECTABLE_REPOSITORIES,\n} from \"./ConnectRepositoryDialog\";\nexport type {\n ConnectRepositoryDialogProps,\n RepositorySelectProps,\n Connection,\n ConnectionService,\n Repository,\n} from \"./ConnectRepositoryDialog\";\nexport {\n WebhookLogsDialog,\n WEBHOOK_CONNECTIONS,\n WEBHOOK_REPOSITORIES,\n} from \"./WebhookLogsDialog\";\nexport type {\n WebhookLogsDialogProps,\n WebhookConnection,\n WebhookRepository,\n WebhookLog,\n} from \"./WebhookLogsDialog\";\nexport {\n SourceCodeSection,\n IssueRow,\n CodeRow,\n Spine,\n HistoryDialog,\n CompletedHeader,\n} from \"./SourceCodeSection\";\nexport type {\n IssueEntry,\n CodeEntry,\n Stage,\n HistoryEvent,\n StageState,\n CodeStatus,\n SectionVariant,\n} from \"./SourceCodeSection\";\nexport { SuggestSubtasksButton } from \"./SuggestSubtasksButton\";\nexport { TaskOptionsMenu, TaskListOptionsMenu } from \"./TaskOptionsMenu\";\nexport type {\n TaskOptionsMenuProps,\n TaskListOptionsMenuProps,\n} from \"./TaskOptionsMenu\";\nexport { UserMenu } from \"./UserMenu\";\nexport type { UserMenuProps, UserMenuVariant } from \"./UserMenu\";\nexport { TwoFactorShield } from \"./TwoFactorShield\";\nexport type { TwoFactorShieldProps } from \"./TwoFactorShield\";\nexport { BackupCodesDialogs, CreateLoginCodeDialogs } from \"./TwoFactorDialogs\";\nexport type {\n BackupCodesDialogsProps,\n CreateLoginCodeDialogsProps,\n} from \"./TwoFactorDialogs\";\nexport {\n SettingsHeader,\n SettingsContent,\n StyledSettingRow,\n RowText,\n SettingRow,\n} from \"./settings\";\nexport type { SettingsHeaderProps, SettingRowProps } from \"./settings\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,UAAU;AACxB,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,qBAAqB;AAExE,SAASC,UAAU,EAAEC,iBAAiB,EAAEC,SAAS,QAAQ,WAAW;AAMpE,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,6BAA6B,QAAQ,iCAAiC;AAE/E,SACEC,uBAAuB,EACvBC,gBAAgB,EAChBC,gBAAgB,EAChBC,WAAW,EACXC,oBAAoB,EACpBC,wBAAwB,QACnB,2BAA2B;AAQlC,SACEC,iBAAiB,EACjBC,mBAAmB,EACnBC,oBAAoB,QACf,qBAAqB;AAO5B,SACEC,iBAAiB,EACjBC,QAAQ,EACRC,OAAO,EACPC,KAAK,EACLC,aAAa,EACbC,eAAe,QACV,qBAAqB;AAU5B,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,eAAe,EAAEC,mBAAmB,QAAQ,mBAAmB;AAKxE,SAASC,QAAQ,QAAQ,YAAY;AAErC,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,kBAAkB,EAAEC,sBAAsB,QAAQ,oBAAoB;AAK/E,SACEC,cAAc,EACdC,eAAe,EACfC,gBAAgB,EAChBC,OAAO,EACPC,UAAU,QACL,YAAY","ignoreList":[]}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Shared building blocks for the System Settings presentation stories
3
+ * (`Presentation/System Settings/*`). The settings page header, the max-width
4
+ * body column and the "row" card (title + description on the left, a control on
5
+ * the right) are defined once here and reused by the Index, General and
6
+ * Security stories so the chrome stays identical and in one place.
7
+ *
8
+ * Mirrors the app: PageHeader.jsx + BackButton.js (header) and the repeated
9
+ * `Card variant="paper-2"` row pattern from the SystemSettings pages.
10
+ */
11
+ import React, { ReactElement, ReactNode } from "react";
12
+ export interface SettingsHeaderProps {
13
+ title: string;
14
+ backTitle?: string;
15
+ }
16
+ export declare const SettingsHeader: ({ title, backTitle, }: SettingsHeaderProps) => ReactElement;
17
+ /** The page body, max-width 850px and left-aligned (mirrors the app Page). */
18
+ export declare const SettingsContent: import("styled-components").StyledComponent<"div", any, {}, never>;
19
+ /** A settings row card: title + description on the left, control on the right. */
20
+ export declare const StyledSettingRow: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLDivElement> & import("../..").ICardProps, "ref"> & React.RefAttributes<HTMLDivElement>>, any, {
21
+ $clickable?: boolean;
22
+ }, never>;
23
+ export declare const RowText: import("styled-components").StyledComponent<"div", any, {}, never>;
24
+ export interface SettingRowProps {
25
+ title: string;
26
+ description?: ReactNode;
27
+ control?: ReactNode;
28
+ onClick?: () => void;
29
+ /** Let a long description wrap onto multiple lines instead of truncating. */
30
+ wrapDescription?: boolean;
31
+ }
32
+ export declare const SettingRow: ({ title, description, control, onClick, wrapDescription, }: SettingRowProps) => ReactElement;
33
+ //# sourceMappingURL=settings.d.ts.map