@hjmds/react 1.37.2 → 1.38.0

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 (61) hide show
  1. package/dist/actions.d.ts +8 -0
  2. package/dist/actions.d.ts.map +1 -1
  3. package/dist/actions.js +4 -4
  4. package/dist/actions.js.map +1 -1
  5. package/dist/authoring-tools.js +1 -1
  6. package/dist/authoring-tools.js.map +1 -1
  7. package/dist/bottom-cta.d.ts.map +1 -1
  8. package/dist/bottom-cta.js +2 -1
  9. package/dist/bottom-cta.js.map +1 -1
  10. package/dist/carousel-motion.js +1 -1
  11. package/dist/carousel-motion.js.map +1 -1
  12. package/dist/collection-editing.js +4 -4
  13. package/dist/collection-editing.js.map +1 -1
  14. package/dist/collection-rail.d.ts +3 -1
  15. package/dist/collection-rail.d.ts.map +1 -1
  16. package/dist/collection-rail.js +2 -2
  17. package/dist/collection-rail.js.map +1 -1
  18. package/dist/display.d.ts +4 -0
  19. package/dist/display.d.ts.map +1 -1
  20. package/dist/display.js +2 -2
  21. package/dist/display.js.map +1 -1
  22. package/dist/evidence.d.ts +1 -1
  23. package/dist/evidence.js +1 -1
  24. package/dist/evidence.js.map +1 -1
  25. package/dist/inline-confirm.js +1 -1
  26. package/dist/inline-confirm.js.map +1 -1
  27. package/dist/internal/document-resource.js +1 -1
  28. package/dist/internal/document-resource.js.map +1 -1
  29. package/dist/internal/screen-exit.js +2 -2
  30. package/dist/internal/screen-exit.js.map +1 -1
  31. package/dist/notification-bell.js +1 -1
  32. package/dist/notification-bell.js.map +1 -1
  33. package/dist/screen-flows.d.ts +1 -0
  34. package/dist/screen-flows.d.ts.map +1 -1
  35. package/dist/screen-flows.js +3 -3
  36. package/dist/screen-flows.js.map +1 -1
  37. package/dist/screens.d.ts +5 -1
  38. package/dist/screens.d.ts.map +1 -1
  39. package/dist/screens.js +7 -3
  40. package/dist/screens.js.map +1 -1
  41. package/dist/selection.d.ts +4 -0
  42. package/dist/selection.d.ts.map +1 -1
  43. package/dist/selection.js +2 -2
  44. package/dist/selection.js.map +1 -1
  45. package/dist/sortable.js +1 -1
  46. package/dist/sortable.js.map +1 -1
  47. package/dist/step-player.js +1 -1
  48. package/dist/step-player.js.map +1 -1
  49. package/dist/steps.js +1 -1
  50. package/dist/steps.js.map +1 -1
  51. package/dist/streaming-answer.js +1 -1
  52. package/dist/streaming-answer.js.map +1 -1
  53. package/dist/styles.css +34 -22
  54. package/dist/styles.layered.css +34 -22
  55. package/dist/task-controls.js +2 -2
  56. package/dist/task-controls.js.map +1 -1
  57. package/dist/transfer-task.js +1 -1
  58. package/dist/transfer-task.js.map +1 -1
  59. package/dist/voice-note.js +1 -1
  60. package/dist/voice-note.js.map +1 -1
  61. package/package.json +3 -3
package/dist/actions.d.ts CHANGED
@@ -8,6 +8,8 @@ import type { HjmCompositionStyleProp } from "./composition-style.js";
8
8
  export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & Readonly<{
9
9
  tone?: ButtonTone;
10
10
  size?: ButtonSize;
11
+ /** Extra pointer area in pixels; compact header tools use 0. Defaults to the size recipe. */
12
+ hitSlop?: number;
11
13
  /** Frame geometry. `pill` replaces product code that overrode `border-radius`. */
12
14
  shape?: ButtonShape;
13
15
  appearance?: ButtonAppearance;
@@ -35,6 +37,8 @@ export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & Readonly<{
35
37
  export declare const Button: import("react").ForwardRefExoticComponent<ButtonHTMLAttributes<HTMLButtonElement> & Readonly<{
36
38
  tone?: ButtonTone;
37
39
  size?: ButtonSize;
40
+ /** Extra pointer area in pixels; compact header tools use 0. Defaults to the size recipe. */
41
+ hitSlop?: number;
38
42
  /** Frame geometry. `pill` replaces product code that overrode `border-radius`. */
39
43
  shape?: ButtonShape;
40
44
  appearance?: ButtonAppearance;
@@ -80,6 +84,8 @@ export type IconButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "ari
80
84
  label: string;
81
85
  tone?: IconButtonTone;
82
86
  size?: IconButtonSize;
87
+ /** Extra pointer area in pixels; compact header tools use 0. Defaults to the size recipe. */
88
+ hitSlop?: number;
83
89
  shape?: IconButtonShape;
84
90
  /** Toggle state. Paints the selected treatment and sets `aria-pressed`. */
85
91
  selected?: boolean;
@@ -98,6 +104,8 @@ export declare const IconButton: import("react").ForwardRefExoticComponent<Omit<
98
104
  label: string;
99
105
  tone?: IconButtonTone;
100
106
  size?: IconButtonSize;
107
+ /** Extra pointer area in pixels; compact header tools use 0. Defaults to the size recipe. */
108
+ hitSlop?: number;
101
109
  shape?: IconButtonShape;
102
110
  /** Toggle state. Paints the selected treatment and sets `aria-pressed`. */
103
111
  selected?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,sCAAsC,CAAC;AAE9C,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;AACvE,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAIL,KAAK,oBAAoB,EAEzB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACnF,YAAY,EACV,cAAc,EACd,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,WAAW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IACxD,gGAAgG;IAChG,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAEL,eAAO,MAAM,IAAI;WAXN,QAAQ;cACL,WAAW;eACV,OAAO;cACR,SAAS;eACR,SAAS;IACpB,6FAA6F;mBAC9E,CAAC,KAAK,EAAE,eAAe,KAAK,YAAY;IACvD,gGAAgG;kBAClF,uBAAuB;sDAqDvC,CAAC"}
package/dist/actions.js CHANGED
@@ -19,7 +19,7 @@ function useButtonPaint(tone, size, suppliedShape, suppliedAppearance) {
19
19
  "--hjm-button-settle": `${buttonRecipe.raised.settleDuration}ms`,
20
20
  } };
21
21
  }
22
- export const Button = forwardRef(function Button({ tone = buttonRecipe.defaults.tone, size = buttonRecipe.defaults.size, shape: suppliedShape, appearance: suppliedAppearance, fullWidth = false, align = buttonRecipe.defaults.align, selected, loading = false, completion, leading, trailing, edge, disabled, onClick, type = "button", className, children, layoutStyle, style, ...props }, ref) {
22
+ export const Button = forwardRef(function Button({ tone = buttonRecipe.defaults.tone, size = buttonRecipe.defaults.size, hitSlop, shape: suppliedShape, appearance: suppliedAppearance, fullWidth = false, align = buttonRecipe.defaults.align, selected, loading = false, completion, leading, trailing, edge, disabled, onClick, type = "button", className, children, layoutStyle, style, ...props }, ref) {
23
23
  const { shape, appearance, depth, style: paintStyle } = useButtonPaint(tone, size, suppliedShape, suppliedAppearance);
24
24
  const textParts = completion ? Children.toArray(children) : [];
25
25
  if (completion && (!completion.label.trim() || typeof completion.confirmed !== "boolean" || textParts.length === 0 || !textParts.every(part => typeof part === "string" || typeof part === "number"))) {
@@ -41,7 +41,7 @@ export const Button = forwardRef(function Button({ tone = buttonRecipe.defaults.
41
41
  const content = _jsxs(_Fragment, { children: [leading, completion ? _jsxs("span", { style: { display: "inline-grid", minWidth: 0 }, children: [_jsx("span", { "aria-hidden": "true", className: "hjm-button__label", style: { gridArea: "1 / 1", visibility: "hidden" }, children: idleLabel }), _jsx("span", { "aria-hidden": "true", className: "hjm-button__label", style: { gridArea: "1 / 1", visibility: "hidden" }, children: completion.label }), _jsx("span", { className: "hjm-button__label", style: { gridArea: "1 / 1", alignSelf: "center" }, children: currentLabel })] }) : _jsx("span", { className: "hjm-button__label", children: children }), trailing, loading ? _jsx("span", { className: "hjm-button__loading-indicator", "aria-hidden": "true", children: _jsx("span", { className: "hjm-button__spinner" }) }) : null] });
42
42
  return (_jsx("button", { ...props,
43
43
  // The cap lives in the recipe, not in the stylesheet: one number, one place.
44
- style: { ...paintStyle, ...style, ...layoutStyle }, ref: ref, type: type, className: classNames("hjm-button", className), "data-tone": tone, "data-size": size, "data-shape": shape, "data-appearance": appearance, "data-raised": depth > 0 || undefined, "data-full-width": fullWidth || undefined, "data-align": align, "data-edge": edge, ...(selected === undefined ? {} : { "data-selected": selected, "aria-pressed": selected }), "data-state": loading ? "loading" : unavailable ? "disabled" : "idle", "aria-busy": loading || undefined, "aria-disabled": unavailable || undefined, disabled: disabled && !loading, onClick: handleClick, children: depth > 0 ? _jsx("span", { className: "hjm-button__face", children: content }) : content }));
44
+ style: { ...paintStyle, ...(hitSlop === undefined ? {} : { "--hjm-button-hit-slop": `${hitSlop}px` }), ...style, ...layoutStyle }, ref: ref, type: type, className: classNames("hjm-button", className), "data-tone": tone, "data-size": size, "data-shape": shape, "data-appearance": appearance, "data-raised": depth > 0 || undefined, "data-full-width": fullWidth || undefined, "data-align": align, "data-edge": edge, ...(selected === undefined ? {} : { "data-selected": selected, "aria-pressed": selected }), "data-state": loading ? "loading" : unavailable ? "disabled" : "idle", "aria-busy": loading || undefined, "aria-disabled": unavailable || undefined, disabled: disabled && !loading, onClick: handleClick, children: depth > 0 ? _jsx("span", { className: "hjm-button__face", children: content }) : content }));
45
45
  });
46
46
  export const ButtonLink = forwardRef(function ButtonLink({ href, disabled = false, tone = buttonRecipe.defaults.tone, size = buttonRecipe.defaults.size, shape: suppliedShape, appearance: suppliedAppearance, fullWidth = false, align = buttonRecipe.defaults.align, leading, trailing, edge, layoutStyle, children, className, style, onClick, onAuxClick, tabIndex, renderAnchor, ...props }, ref) {
47
47
  const { shape, appearance, depth, style: paintStyle } = useButtonPaint(tone, size, suppliedShape, suppliedAppearance);
@@ -80,7 +80,7 @@ export const ButtonLink = forwardRef(function ButtonLink({ href, disabled = fals
80
80
  };
81
81
  return renderAnchor ? renderAnchor(anchorProps) : _jsx("a", { ...anchorProps });
82
82
  });
83
- export const IconButton = forwardRef(function IconButton({ label, tone = iconButtonRecipe.defaults.tone, size = iconButtonRecipe.defaults.size, shape = iconButtonRecipe.defaults.shape, selected, loading = false, edge, disabled, onClick, type = "button", className, children, layoutStyle, style, ...props }, ref) {
83
+ export const IconButton = forwardRef(function IconButton({ label, tone = iconButtonRecipe.defaults.tone, size = iconButtonRecipe.defaults.size, hitSlop, shape = iconButtonRecipe.defaults.shape, selected, loading = false, edge, disabled, onClick, type = "button", className, children, layoutStyle, style, ...props }, ref) {
84
84
  // Preserve a focusable disabled action (e.g. a Carousel boundary).
85
85
  const ariaDisabled = props["aria-disabled"] === true || props["aria-disabled"] === "true";
86
86
  const unavailable = disabled === true || loading || ariaDisabled;
@@ -92,7 +92,7 @@ export const IconButton = forwardRef(function IconButton({ label, tone = iconBut
92
92
  }
93
93
  onClick?.(event);
94
94
  };
95
- return (_jsx("button", { ...props, style: { ...style, ...layoutStyle }, ref: ref, type: type, className: classNames("hjm-icon-button", className), "data-tone": tone, "data-size": size, "data-shape": shape, "data-edge": edge, ...(selected === undefined ? {} : { "data-selected": selected, "aria-pressed": selected }), "data-state": loading ? "loading" : unavailable ? "disabled" : "idle", "aria-label": label, "aria-busy": loading || undefined, "aria-disabled": unavailable || undefined, disabled: disabled, onClick: handleClick, children: loading ? _jsx("span", { className: "hjm-button__spinner", "aria-hidden": "true" }) : children }));
95
+ return (_jsx("button", { ...props, style: { ...(hitSlop === undefined ? {} : { "--hjm-button-hit-slop": `${hitSlop}px` }), ...style, ...layoutStyle }, ref: ref, type: type, className: classNames("hjm-icon-button", className), "data-tone": tone, "data-size": size, "data-shape": shape, "data-edge": edge, ...(selected === undefined ? {} : { "data-selected": selected, "aria-pressed": selected }), "data-state": loading ? "loading" : unavailable ? "disabled" : "idle", "aria-label": label, "aria-busy": loading || undefined, "aria-disabled": unavailable || undefined, disabled: disabled, onClick: handleClick, children: loading ? _jsx("span", { className: "hjm-button__spinner", "aria-hidden": "true" }) : children }));
96
96
  });
97
97
  export const Link = forwardRef(function Link({ tone = linkRecipe.defaults.tone, variant = linkRecipe.defaults.variant, disabled = false, leading, trailing, renderAnchor, target, rel, tabIndex, onClick, className, children, layoutStyle, ...props }, ref) {
98
98
  const handleClick = (event) => {
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EACZ,kBAAkB,GAOnB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,gBAAgB,EAChB,UAAU,GAOX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,QAAQ,EACR,UAAU,EACV,UAAU,GAQX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAqCjE,mFAAmF;AACnF,6EAA6E;AAC7E,SAAS,cAAc,CAAC,IAAgB,EAAE,IAAgB,EAAE,aAA2B,EAAE,kBAAqC;IAC5H,MAAM,OAAO,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACjD,MAAM,KAAK,GAAG,aAAa,IAAI,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC;IAC/F,MAAM,UAAU,GAAG,kBAAkB,IAAI,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,IAAI,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC;IACnH,MAAM,KAAK,GAAG,kBAAkB,CAAC,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACzD,MAA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AAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,GAAG,WAAW,EAAE,EAAE,CAAC;QAChH,GAAG;QACH,SAAS,EAAE,UAAU,CAAC,UAAU,EAAE,SAAS,CAAC;QAC5C,WAAW,EAAE,IAAI;QACjB,cAAc,EAAE,OAAO;QACvB,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM;QAC5C,eAAe,EAAE,QAAQ,IAAI,SAAS;QACtC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ;QAClC,MAAM;QACN,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC;QACrE,OAAO,EAAE,WAAW;QACpB,QAAQ,EAAE,CACR,8BACC,OAAO,EACR,yBAAO,QAAQ,GAAQ,EACtB,QAAQ,IACN,CACJ;KACF,CAAC;IACF,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,eAAO,WAAW,GAAI,CAAC;AAC3E,CAAC,CAAC,CAAC","sourcesContent":["import {\n buttonRecipe,\n resolveButtonDepth,\n type ButtonAppearance,\n type ButtonAlign,\n type ButtonEdge,\n type ButtonShape,\n type ButtonSize,\n type ButtonTone,\n} from \"@hjmds/design-contracts/recipes/base\";\n\nexport type { ButtonAlign, ButtonEdge, ButtonShape, ButtonAppearance };\nimport {\n iconButtonRecipe,\n linkRecipe,\n type IconButtonEdge,\n type IconButtonShape,\n type IconButtonSize,\n type IconButtonTone,\n type LinkTone,\n type LinkVariant,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n Children,\n useContext,\n forwardRef,\n type AnchorHTMLAttributes,\n type CSSProperties,\n type ButtonHTMLAttributes,\n type ForwardedRef,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { DesignProfileContext, classNames } from \"./internal.js\";\n\nexport type { ButtonSize, ButtonTone } from \"@hjmds/design-contracts/recipes/base\";\nexport type {\n IconButtonEdge,\n IconButtonShape,\n IconButtonSize,\n IconButtonTone,\n} from \"@hjmds/design-contracts/recipes\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n Readonly<{\n tone?: ButtonTone;\n size?: ButtonSize;\n /** Frame geometry. `pill` replaces product code that overrode `border-radius`. */\n shape?: ButtonShape;\n appearance?: ButtonAppearance;\n fullWidth?: boolean;\n /** Label placement inside the frame; `leading` suits a full-width row action. */\n align?: ButtonAlign;\n /** Toggle state. Paints the selected treatment and sets `aria-pressed`. */\n selected?: boolean;\n loading?: boolean;\n /** Explicit confirmed mutation result. Both text labels remain measured in every state. */\n completion?: Readonly<{ confirmed: boolean; label: string }>;\n leading?: ReactNode;\n trailing?: ReactNode;\n /**\n * Container edge(s) this button sits on. A ghost button overhangs that edge by its inline padding so the label\n * or trailing glyph lines up with the container inset (`resolveButtonEdgeOverhang`); framed tones keep their frame.\n */\n edge?: ButtonEdge;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\n// Both semantic hosts use the same recipe and product profile; navigation must not\n// recreate button paint in a product or turn an anchor into a nested button.\nfunction useButtonPaint(tone: ButtonTone, size: ButtonSize, suppliedShape?: ButtonShape, suppliedAppearance?: ButtonAppearance) {\n const profile = useContext(DesignProfileContext);\n const shape = suppliedShape ?? profile?.controls?.button?.shape ?? buttonRecipe.defaults.shape;\n const appearance = suppliedAppearance ?? profile?.controls?.button?.appearance ?? buttonRecipe.defaults.appearance;\n const depth = resolveButtonDepth(appearance, tone, size);\n const side = tone === \"secondary\" ? \"var(--hjm-color-border-control)\" : tone === \"danger\" ? \"var(--hjm-color-danger-fill)\" : \"var(--hjm-color-primary)\";\n return { shape, appearance, depth, style: {\n \"--hjm-button-label-lines\": buttonRecipe.label.maxLines,\n \"--hjm-button-depth\": `${depth}px`, \"--hjm-button-side\": side,\n \"--hjm-button-side-shade\": `${buttonRecipe.raised.sideShade * 100}%`,\n \"--hjm-button-face-padding\": `${buttonRecipe.sizes[size].paddingHorizontal}px`,\n \"--hjm-button-settle\": `${buttonRecipe.raised.settleDuration}ms`,\n } as CSSProperties };\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n tone = buttonRecipe.defaults.tone,\n size = buttonRecipe.defaults.size,\n shape: suppliedShape,\n appearance: suppliedAppearance,\n fullWidth = false,\n align = buttonRecipe.defaults.align,\n selected,\n loading = false,\n completion,\n leading,\n trailing,\n edge,\n disabled,\n onClick,\n type = \"button\",\n className,\n children,\n layoutStyle,\n style,\n ...props\n },\n ref,\n) {\n const { shape, appearance, depth, style: paintStyle } = useButtonPaint(tone, size, suppliedShape, suppliedAppearance);\n const textParts = completion ? Children.toArray(children) : [];\n if (completion && (!completion.label.trim() || typeof completion.confirmed !== \"boolean\" || textParts.length === 0 || !textParts.every(part => typeof part === \"string\" || typeof part === \"number\"))) {\n throw new TypeError(\"Button completion requires a nonempty label, a boolean confirmed value and text-only children\");\n }\n const idleLabel = completion ? textParts.join(\"\") : children;\n const currentLabel = completion?.confirmed && !loading ? completion.label : idleLabel;\n // Preserve a focusable disabled action (e.g. a Carousel boundary).\n const ariaDisabled = props[\"aria-disabled\"] === true || props[\"aria-disabled\"] === \"true\";\n const unavailable = disabled === true || loading || ariaDisabled;\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (unavailable) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n onClick?.(event);\n };\n const content = <>\n {leading}\n {completion ? <span style={{ display: \"inline-grid\", minWidth: 0 }}>\n {/* Both labels contribute intrinsic dimensions, including wrapping/font changes. */}\n <span aria-hidden=\"true\" className=\"hjm-button__label\" style={{ gridArea: \"1 / 1\", visibility: \"hidden\" }}>{idleLabel}</span>\n <span aria-hidden=\"true\" className=\"hjm-button__label\" style={{ gridArea: \"1 / 1\", visibility: \"hidden\" }}>{completion.label}</span>\n <span className=\"hjm-button__label\" style={{ gridArea: \"1 / 1\", alignSelf: \"center\" }}>{currentLabel}</span>\n </span> : <span className=\"hjm-button__label\">{children}</span>}\n {trailing}\n {loading ? <span className=\"hjm-button__loading-indicator\" aria-hidden=\"true\"><span className=\"hjm-button__spinner\" /></span> : null}\n </>;\n return (\n <button\n {...props}\n // The cap lives in the recipe, not in the stylesheet: one number, one place.\n style={{ ...paintStyle, ...style, ...layoutStyle }}\n ref={ref}\n type={type}\n className={classNames(\"hjm-button\", className)}\n data-tone={tone}\n data-size={size}\n data-shape={shape}\n data-appearance={appearance}\n data-raised={depth > 0 || undefined}\n data-full-width={fullWidth || undefined}\n data-align={align}\n data-edge={edge}\n {...(selected === undefined ? {} : { \"data-selected\": selected, \"aria-pressed\": selected })}\n data-state={loading ? \"loading\" : unavailable ? \"disabled\" : \"idle\"}\n aria-busy={loading || undefined}\n aria-disabled={unavailable || undefined}\n disabled={disabled && !loading}\n onClick={handleClick}\n >\n {depth > 0 ? <span className=\"hjm-button__face\">{content}</span> : content}\n </button>\n );\n});\n\n/** Web navigation with Button paint. Mutation/loading/toggle semantics belong to Button. */\nexport type ButtonLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> &\n Pick<ButtonProps, \"tone\" | \"size\" | \"shape\" | \"appearance\" | \"fullWidth\" | \"align\" | \"leading\" | \"trailing\" | \"edge\" | \"layoutStyle\"> &\n Readonly<{\n href: string;\n disabled?: boolean;\n /** Framework routing adapter; HJM still owns the anchor destination, ref and disabled guards. */\n renderAnchor?: (props: AnchorHTMLAttributes<HTMLAnchorElement> & { ref: ForwardedRef<HTMLAnchorElement> }) => ReactElement;\n }>;\n\nexport const ButtonLink = forwardRef<HTMLAnchorElement, ButtonLinkProps>(function ButtonLink({\n href, disabled = false, tone = buttonRecipe.defaults.tone, size = buttonRecipe.defaults.size,\n shape: suppliedShape, appearance: suppliedAppearance, fullWidth = false,\n align = buttonRecipe.defaults.align, leading, trailing, edge, layoutStyle,\n children, className, style, onClick, onAuxClick, tabIndex, renderAnchor, ...props\n}, ref) {\n const { shape, appearance, depth, style: paintStyle } = useButtonPaint(tone, size, suppliedShape, suppliedAppearance);\n const unavailable = disabled || props[\"aria-disabled\"] === true || props[\"aria-disabled\"] === \"true\";\n const activate = (callback: typeof onClick) => (event: MouseEvent<HTMLAnchorElement>) => {\n if (unavailable) { event.preventDefault(); event.stopPropagation(); return; }\n callback?.(event);\n };\n const content = <>{leading}<span className=\"hjm-button__label\">{children}</span>{trailing}</>;\n const anchorProps = {\n ...props,\n ref,\n // Adapters must also receive no href while unavailable, including their framework's navigation path.\n href: unavailable ? undefined : href,\n role: unavailable ? \"link\" : props.role,\n \"aria-disabled\": unavailable || undefined,\n tabIndex: unavailable ? -1 : tabIndex,\n onClick: activate(onClick),\n onAuxClick: activate(onAuxClick),\n className: classNames(\"hjm-button\", className),\n style: { ...paintStyle, ...style, ...layoutStyle },\n \"data-tone\": tone,\n \"data-size\": size,\n \"data-shape\": shape,\n \"data-appearance\": appearance,\n \"data-raised\": depth > 0 || undefined,\n \"data-full-width\": fullWidth || undefined,\n \"data-align\": align,\n \"data-edge\": edge,\n \"data-state\": unavailable ? \"disabled\" : \"idle\",\n children: depth > 0 ? <span className=\"hjm-button__face\">{content}</span> : content,\n };\n return renderAnchor ? renderAnchor(anchorProps) : <a {...anchorProps} />;\n});\n\nexport type IconButtonProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"aria-label\"\n> &\n Readonly<{\n label: string;\n tone?: IconButtonTone;\n size?: IconButtonSize;\n shape?: IconButtonShape;\n /** Toggle state. Paints the selected treatment and sets `aria-pressed`. */\n selected?: boolean;\n loading?: boolean;\n /**\n * Container edge(s) this button sits on (logical, RTL-aware). A ghost button keeps its touch target but overhangs\n * the edge by (diameter − glyph slot) / 2 so the glyph slot lines up with the container inset\n * (`resolveIconButtonEdgeOverhang`, 2026-10-17 measured audit). Framed tones align their frame and do not move.\n */\n edge?: IconButtonEdge;\n children: ReactNode;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n function IconButton(\n {\n label,\n tone = iconButtonRecipe.defaults.tone,\n size = iconButtonRecipe.defaults.size,\n shape = iconButtonRecipe.defaults.shape,\n selected,\n loading = false,\n edge,\n disabled,\n onClick,\n type = \"button\",\n className,\n children,\n layoutStyle,\n style,\n ...props\n },\n ref,\n ) {\n // Preserve a focusable disabled action (e.g. a Carousel boundary).\n const ariaDisabled = props[\"aria-disabled\"] === true || props[\"aria-disabled\"] === \"true\";\n const unavailable = disabled === true || loading || ariaDisabled;\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (unavailable) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n onClick?.(event);\n };\n return (\n <button\n {...props}\n style={{ ...style, ...layoutStyle }}\n ref={ref}\n type={type}\n className={classNames(\"hjm-icon-button\", className)}\n data-tone={tone}\n data-size={size}\n data-shape={shape}\n data-edge={edge}\n {...(selected === undefined ? {} : { \"data-selected\": selected, \"aria-pressed\": selected })}\n data-state={loading ? \"loading\" : unavailable ? \"disabled\" : \"idle\"}\n aria-label={label}\n aria-busy={loading || undefined}\n aria-disabled={unavailable || undefined}\n disabled={disabled}\n onClick={handleClick}\n >\n {loading ? <span className=\"hjm-button__spinner\" aria-hidden=\"true\" /> : children}\n </button>\n );\n },\n);\n\nexport type LinkRenderProps = AnchorHTMLAttributes<HTMLAnchorElement> &\n Readonly<{\n children: ReactNode;\n ref: ForwardedRef<HTMLAnchorElement>;\n \"data-tone\": LinkTone;\n \"data-variant\": LinkVariant;\n \"data-state\": \"disabled\" | \"idle\";\n }>;\n\nexport type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> &\n Readonly<{\n tone?: LinkTone;\n variant?: LinkVariant;\n disabled?: boolean;\n leading?: ReactNode;\n trailing?: ReactNode;\n /** Framework adapter, for example Next.js Link, while HJM keeps link semantics and state. */\n renderAnchor?: (props: LinkRenderProps) => ReactElement;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n {\n tone = linkRecipe.defaults.tone,\n variant = linkRecipe.defaults.variant,\n disabled = false,\n leading,\n trailing,\n renderAnchor,\n target,\n rel,\n tabIndex,\n onClick,\n className,\n children,\n layoutStyle,\n ...props\n },\n ref,\n) {\n const handleClick = (event: MouseEvent<HTMLAnchorElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n };\n const anchorProps: LinkRenderProps = {\n ...props,\n // `renderAnchor` adapters receive the merged placement, so a framework Link\n // gets the same position as the plain <a>.\n ...(props.style === undefined && layoutStyle === undefined ? {} : { style: { ...props.style, ...layoutStyle } }),\n ref,\n className: classNames(\"hjm-link\", className),\n \"data-tone\": tone,\n \"data-variant\": variant,\n \"data-state\": disabled ? \"disabled\" : \"idle\",\n \"aria-disabled\": disabled || undefined,\n tabIndex: disabled ? -1 : tabIndex,\n target,\n rel: rel ?? (target === \"_blank\" ? \"noreferrer noopener\" : undefined),\n onClick: handleClick,\n children: (\n <>\n {leading}\n <span>{children}</span>\n {trailing}\n </>\n ),\n };\n return renderAnchor ? renderAnchor(anchorProps) : <a {...anchorProps} />;\n});\n"]}
1
+ {"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,EACZ,kBAAkB,GAOnB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,gBAAgB,EAChB,UAAU,GAOX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,QAAQ,EACR,UAAU,EACV,UAAU,GAQX,MAAM,OAAO,CAAC;AACf,OAAO,E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AC,CAAC,QAAQ;QAClC,MAAM;QACN,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC;QACrE,OAAO,EAAE,WAAW;QACpB,QAAQ,EAAE,CACR,8BACC,OAAO,EACR,yBAAO,QAAQ,GAAQ,EACtB,QAAQ,IACN,CACJ;KACF,CAAC;IACF,OAAO,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,eAAO,WAAW,GAAI,CAAC;AAC3E,CAAC,CAAC,CAAC","sourcesContent":["import {\n buttonRecipe,\n resolveButtonDepth,\n type ButtonAppearance,\n type ButtonAlign,\n type ButtonEdge,\n type ButtonShape,\n type ButtonSize,\n type ButtonTone,\n} from \"@hjmds/design-contracts/recipes/base\";\n\nexport type { ButtonAlign, ButtonEdge, ButtonShape, ButtonAppearance };\nimport {\n iconButtonRecipe,\n linkRecipe,\n type IconButtonEdge,\n type IconButtonShape,\n type IconButtonSize,\n type IconButtonTone,\n type LinkTone,\n type LinkVariant,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n Children,\n useContext,\n forwardRef,\n type AnchorHTMLAttributes,\n type CSSProperties,\n type ButtonHTMLAttributes,\n type ForwardedRef,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport { DesignProfileContext, classNames } from \"./internal.js\";\n\nexport type { ButtonSize, ButtonTone } from \"@hjmds/design-contracts/recipes/base\";\nexport type {\n IconButtonEdge,\n IconButtonShape,\n IconButtonSize,\n IconButtonTone,\n} from \"@hjmds/design-contracts/recipes\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> &\n Readonly<{\n tone?: ButtonTone;\n size?: ButtonSize;\n /** Extra pointer area in pixels; compact header tools use 0. Defaults to the size recipe. */\n hitSlop?: number;\n /** Frame geometry. `pill` replaces product code that overrode `border-radius`. */\n shape?: ButtonShape;\n appearance?: ButtonAppearance;\n fullWidth?: boolean;\n /** Label placement inside the frame; `leading` suits a full-width row action. */\n align?: ButtonAlign;\n /** Toggle state. Paints the selected treatment and sets `aria-pressed`. */\n selected?: boolean;\n loading?: boolean;\n /** Explicit confirmed mutation result. Both text labels remain measured in every state. */\n completion?: Readonly<{ confirmed: boolean; label: string }>;\n leading?: ReactNode;\n trailing?: ReactNode;\n /**\n * Container edge(s) this button sits on. A ghost button overhangs that edge by its inline padding so the label\n * or trailing glyph lines up with the container inset (`resolveButtonEdgeOverhang`); framed tones keep their frame.\n */\n edge?: ButtonEdge;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\n// Both semantic hosts use the same recipe and product profile; navigation must not\n// recreate button paint in a product or turn an anchor into a nested button.\nfunction useButtonPaint(tone: ButtonTone, size: ButtonSize, suppliedShape?: ButtonShape, suppliedAppearance?: ButtonAppearance) {\n const profile = useContext(DesignProfileContext);\n const shape = suppliedShape ?? profile?.controls?.button?.shape ?? buttonRecipe.defaults.shape;\n const appearance = suppliedAppearance ?? profile?.controls?.button?.appearance ?? buttonRecipe.defaults.appearance;\n const depth = resolveButtonDepth(appearance, tone, size);\n const side = tone === \"secondary\" ? \"var(--hjm-color-border-control)\" : tone === \"danger\" ? \"var(--hjm-color-danger-fill)\" : \"var(--hjm-color-primary)\";\n return { shape, appearance, depth, style: {\n \"--hjm-button-label-lines\": buttonRecipe.label.maxLines,\n \"--hjm-button-depth\": `${depth}px`, \"--hjm-button-side\": side,\n \"--hjm-button-side-shade\": `${buttonRecipe.raised.sideShade * 100}%`,\n \"--hjm-button-face-padding\": `${buttonRecipe.sizes[size].paddingHorizontal}px`,\n \"--hjm-button-settle\": `${buttonRecipe.raised.settleDuration}ms`,\n } as CSSProperties };\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n tone = buttonRecipe.defaults.tone,\n size = buttonRecipe.defaults.size,\n hitSlop,\n shape: suppliedShape,\n appearance: suppliedAppearance,\n fullWidth = false,\n align = buttonRecipe.defaults.align,\n selected,\n loading = false,\n completion,\n leading,\n trailing,\n edge,\n disabled,\n onClick,\n type = \"button\",\n className,\n children,\n layoutStyle,\n style,\n ...props\n },\n ref,\n) {\n const { shape, appearance, depth, style: paintStyle } = useButtonPaint(tone, size, suppliedShape, suppliedAppearance);\n const textParts = completion ? Children.toArray(children) : [];\n if (completion && (!completion.label.trim() || typeof completion.confirmed !== \"boolean\" || textParts.length === 0 || !textParts.every(part => typeof part === \"string\" || typeof part === \"number\"))) {\n throw new TypeError(\"Button completion requires a nonempty label, a boolean confirmed value and text-only children\");\n }\n const idleLabel = completion ? textParts.join(\"\") : children;\n const currentLabel = completion?.confirmed && !loading ? completion.label : idleLabel;\n // Preserve a focusable disabled action (e.g. a Carousel boundary).\n const ariaDisabled = props[\"aria-disabled\"] === true || props[\"aria-disabled\"] === \"true\";\n const unavailable = disabled === true || loading || ariaDisabled;\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (unavailable) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n onClick?.(event);\n };\n const content = <>\n {leading}\n {completion ? <span style={{ display: \"inline-grid\", minWidth: 0 }}>\n {/* Both labels contribute intrinsic dimensions, including wrapping/font changes. */}\n <span aria-hidden=\"true\" className=\"hjm-button__label\" style={{ gridArea: \"1 / 1\", visibility: \"hidden\" }}>{idleLabel}</span>\n <span aria-hidden=\"true\" className=\"hjm-button__label\" style={{ gridArea: \"1 / 1\", visibility: \"hidden\" }}>{completion.label}</span>\n <span className=\"hjm-button__label\" style={{ gridArea: \"1 / 1\", alignSelf: \"center\" }}>{currentLabel}</span>\n </span> : <span className=\"hjm-button__label\">{children}</span>}\n {trailing}\n {loading ? <span className=\"hjm-button__loading-indicator\" aria-hidden=\"true\"><span className=\"hjm-button__spinner\" /></span> : null}\n </>;\n return (\n <button\n {...props}\n // The cap lives in the recipe, not in the stylesheet: one number, one place.\n style={{ ...paintStyle, ...(hitSlop === undefined ? {} : { \"--hjm-button-hit-slop\": `${hitSlop}px` }), ...style, ...layoutStyle } as CSSProperties}\n ref={ref}\n type={type}\n className={classNames(\"hjm-button\", className)}\n data-tone={tone}\n data-size={size}\n data-shape={shape}\n data-appearance={appearance}\n data-raised={depth > 0 || undefined}\n data-full-width={fullWidth || undefined}\n data-align={align}\n data-edge={edge}\n {...(selected === undefined ? {} : { \"data-selected\": selected, \"aria-pressed\": selected })}\n data-state={loading ? \"loading\" : unavailable ? \"disabled\" : \"idle\"}\n aria-busy={loading || undefined}\n aria-disabled={unavailable || undefined}\n disabled={disabled && !loading}\n onClick={handleClick}\n >\n {depth > 0 ? <span className=\"hjm-button__face\">{content}</span> : content}\n </button>\n );\n});\n\n/** Web navigation with Button paint. Mutation/loading/toggle semantics belong to Button. */\nexport type ButtonLinkProps = AnchorHTMLAttributes<HTMLAnchorElement> &\n Pick<ButtonProps, \"tone\" | \"size\" | \"shape\" | \"appearance\" | \"fullWidth\" | \"align\" | \"leading\" | \"trailing\" | \"edge\" | \"layoutStyle\"> &\n Readonly<{\n href: string;\n disabled?: boolean;\n /** Framework routing adapter; HJM still owns the anchor destination, ref and disabled guards. */\n renderAnchor?: (props: AnchorHTMLAttributes<HTMLAnchorElement> & { ref: ForwardedRef<HTMLAnchorElement> }) => ReactElement;\n }>;\n\nexport const ButtonLink = forwardRef<HTMLAnchorElement, ButtonLinkProps>(function ButtonLink({\n href, disabled = false, tone = buttonRecipe.defaults.tone, size = buttonRecipe.defaults.size,\n shape: suppliedShape, appearance: suppliedAppearance, fullWidth = false,\n align = buttonRecipe.defaults.align, leading, trailing, edge, layoutStyle,\n children, className, style, onClick, onAuxClick, tabIndex, renderAnchor, ...props\n}, ref) {\n const { shape, appearance, depth, style: paintStyle } = useButtonPaint(tone, size, suppliedShape, suppliedAppearance);\n const unavailable = disabled || props[\"aria-disabled\"] === true || props[\"aria-disabled\"] === \"true\";\n const activate = (callback: typeof onClick) => (event: MouseEvent<HTMLAnchorElement>) => {\n if (unavailable) { event.preventDefault(); event.stopPropagation(); return; }\n callback?.(event);\n };\n const content = <>{leading}<span className=\"hjm-button__label\">{children}</span>{trailing}</>;\n const anchorProps = {\n ...props,\n ref,\n // Adapters must also receive no href while unavailable, including their framework's navigation path.\n href: unavailable ? undefined : href,\n role: unavailable ? \"link\" : props.role,\n \"aria-disabled\": unavailable || undefined,\n tabIndex: unavailable ? -1 : tabIndex,\n onClick: activate(onClick),\n onAuxClick: activate(onAuxClick),\n className: classNames(\"hjm-button\", className),\n style: { ...paintStyle, ...style, ...layoutStyle },\n \"data-tone\": tone,\n \"data-size\": size,\n \"data-shape\": shape,\n \"data-appearance\": appearance,\n \"data-raised\": depth > 0 || undefined,\n \"data-full-width\": fullWidth || undefined,\n \"data-align\": align,\n \"data-edge\": edge,\n \"data-state\": unavailable ? \"disabled\" : \"idle\",\n children: depth > 0 ? <span className=\"hjm-button__face\">{content}</span> : content,\n };\n return renderAnchor ? renderAnchor(anchorProps) : <a {...anchorProps} />;\n});\n\nexport type IconButtonProps = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n \"aria-label\"\n> &\n Readonly<{\n label: string;\n tone?: IconButtonTone;\n size?: IconButtonSize;\n /** Extra pointer area in pixels; compact header tools use 0. Defaults to the size recipe. */\n hitSlop?: number;\n shape?: IconButtonShape;\n /** Toggle state. Paints the selected treatment and sets `aria-pressed`. */\n selected?: boolean;\n loading?: boolean;\n /**\n * Container edge(s) this button sits on (logical, RTL-aware). A ghost button keeps its touch target but overhangs\n * the edge by (diameter − glyph slot) / 2 so the glyph slot lines up with the container inset\n * (`resolveIconButtonEdgeOverhang`, 2026-10-17 measured audit). Framed tones align their frame and do not move.\n */\n edge?: IconButtonEdge;\n children: ReactNode;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const IconButton = forwardRef<HTMLButtonElement, IconButtonProps>(\n function IconButton(\n {\n label,\n tone = iconButtonRecipe.defaults.tone,\n size = iconButtonRecipe.defaults.size,\n hitSlop,\n shape = iconButtonRecipe.defaults.shape,\n selected,\n loading = false,\n edge,\n disabled,\n onClick,\n type = \"button\",\n className,\n children,\n layoutStyle,\n style,\n ...props\n },\n ref,\n ) {\n // Preserve a focusable disabled action (e.g. a Carousel boundary).\n const ariaDisabled = props[\"aria-disabled\"] === true || props[\"aria-disabled\"] === \"true\";\n const unavailable = disabled === true || loading || ariaDisabled;\n const handleClick = (event: MouseEvent<HTMLButtonElement>) => {\n if (unavailable) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n onClick?.(event);\n };\n return (\n <button\n {...props}\n style={{ ...(hitSlop === undefined ? {} : { \"--hjm-button-hit-slop\": `${hitSlop}px` }), ...style, ...layoutStyle } as CSSProperties}\n ref={ref}\n type={type}\n className={classNames(\"hjm-icon-button\", className)}\n data-tone={tone}\n data-size={size}\n data-shape={shape}\n data-edge={edge}\n {...(selected === undefined ? {} : { \"data-selected\": selected, \"aria-pressed\": selected })}\n data-state={loading ? \"loading\" : unavailable ? \"disabled\" : \"idle\"}\n aria-label={label}\n aria-busy={loading || undefined}\n aria-disabled={unavailable || undefined}\n disabled={disabled}\n onClick={handleClick}\n >\n {loading ? <span className=\"hjm-button__spinner\" aria-hidden=\"true\" /> : children}\n </button>\n );\n },\n);\n\nexport type LinkRenderProps = AnchorHTMLAttributes<HTMLAnchorElement> &\n Readonly<{\n children: ReactNode;\n ref: ForwardedRef<HTMLAnchorElement>;\n \"data-tone\": LinkTone;\n \"data-variant\": LinkVariant;\n \"data-state\": \"disabled\" | \"idle\";\n }>;\n\nexport type LinkProps = AnchorHTMLAttributes<HTMLAnchorElement> &\n Readonly<{\n tone?: LinkTone;\n variant?: LinkVariant;\n disabled?: boolean;\n leading?: ReactNode;\n trailing?: ReactNode;\n /** Framework adapter, for example Next.js Link, while HJM keeps link semantics and state. */\n renderAnchor?: (props: LinkRenderProps) => ReactElement;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const Link = forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n {\n tone = linkRecipe.defaults.tone,\n variant = linkRecipe.defaults.variant,\n disabled = false,\n leading,\n trailing,\n renderAnchor,\n target,\n rel,\n tabIndex,\n onClick,\n className,\n children,\n layoutStyle,\n ...props\n },\n ref,\n) {\n const handleClick = (event: MouseEvent<HTMLAnchorElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n };\n const anchorProps: LinkRenderProps = {\n ...props,\n // `renderAnchor` adapters receive the merged placement, so a framework Link\n // gets the same position as the plain <a>.\n ...(props.style === undefined && layoutStyle === undefined ? {} : { style: { ...props.style, ...layoutStyle } }),\n ref,\n className: classNames(\"hjm-link\", className),\n \"data-tone\": tone,\n \"data-variant\": variant,\n \"data-state\": disabled ? \"disabled\" : \"idle\",\n \"aria-disabled\": disabled || undefined,\n tabIndex: disabled ? -1 : tabIndex,\n target,\n rel: rel ?? (target === \"_blank\" ? \"noreferrer noopener\" : undefined),\n onClick: handleClick,\n children: (\n <>\n {leading}\n <span>{children}</span>\n {trailing}\n </>\n ),\n };\n return renderAnchor ? renderAnchor(anchorProps) : <a {...anchorProps} />;\n});\n"]}
@@ -60,6 +60,6 @@ export function ShortcutRecorder(props) {
60
60
  setDraft(null);
61
61
  setStatus(null);
62
62
  } }); };
63
- return _jsxs(Stack, { gap: "md", children: [_jsx("div", { ref: area, tabIndex: recording ? 0 : -1, role: "group", "aria-label": props.labels.recording, onKeyDown: capture, onBlur: () => setRecording(false), style: { minHeight: 44, display: "grid", placeItems: "center", outline: recording ? "2px solid currentColor" : undefined }, children: _jsx(Text, { children: recording ? props.labels.recording : draft ? props.formatShortcut(draft) : props.value ? props.formatShortcut(props.value) : props.labels.empty }) }), _jsxs(Stack, { axis: "inline", gap: "sm", children: [_jsx(Button, { disabled: props.disabled || action.pending, onClick: () => { setDraft(null); setStatus("ignored"); setRecording(true); }, children: props.labels.record }), draft ? _jsx(Button, { loading: action.pending, disabled: props.disabled === true, onClick: register, children: props.labels.register }) : null, recording || draft ? _jsx(Button, { disabled: action.pending, tone: "ghost", onClick: () => { setRecording(false); setDraft(null); setStatus("cancelled"); }, children: props.labels.cancel }) : null] }), status !== null ? _jsx(Text, { role: "status", children: props.labels.status(status) }) : null, action.failed ? _jsx(Text, { role: "alert", tone: "danger", style: { textAlign: "center" }, children: props.labels.error }) : null] });
63
+ return _jsxs(Stack, { gap: "md", children: [_jsx("div", { ref: area, tabIndex: recording ? 0 : -1, role: "group", "aria-label": props.labels.recording, onKeyDown: capture, onBlur: () => setRecording(false), style: { minHeight: 44, display: "grid", placeItems: "center", outline: recording ? "2px solid currentColor" : undefined }, children: _jsx(Text, { children: recording ? props.labels.recording : draft ? props.formatShortcut(draft) : props.value ? props.formatShortcut(props.value) : props.labels.empty }) }), _jsxs(Stack, { axis: "inline", gap: "xs", children: [_jsx(Button, { disabled: props.disabled || action.pending, onClick: () => { setDraft(null); setStatus("ignored"); setRecording(true); }, children: props.labels.record }), draft ? _jsx(Button, { loading: action.pending, disabled: props.disabled === true, onClick: register, children: props.labels.register }) : null, recording || draft ? _jsx(Button, { disabled: action.pending, tone: "ghost", onClick: () => { setRecording(false); setDraft(null); setStatus("cancelled"); }, children: props.labels.cancel }) : null] }), status !== null ? _jsx(Text, { role: "status", children: props.labels.status(status) }) : null, action.failed ? _jsx(Text, { role: "alert", tone: "danger", style: { textAlign: "center" }, children: props.labels.error }) : null] });
64
64
  }
65
65
  //# sourceMappingURL=authoring-tools.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"authoring-tools.js","sourceRoot":"","sources":["../src/authoring-tools.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,sBAAsB,EA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AY,CAAC,KAAK,CAAC,CAAC,CAAA,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAA,SAAS,CAAC,WAAW,CAAC,CAAC,CAAA,CAAC,YAAG,KAAK,CAAC,MAAM,CAAC,MAAM,GAAU,CAAA,CAAC,CAAA,IAAI,IAAS,EAC/e,MAAM,KAAG,IAAI,CAAA,CAAC,CAAA,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,YAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAQ,CAAA,CAAC,CAAA,IAAI,EAAE,MAAM,CAAC,MAAM,CAAA,CAAC,CAAA,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAC,SAAS,EAAC,QAAQ,EAAC,YAAG,KAAK,CAAC,MAAM,CAAC,KAAK,GAAQ,CAAA,CAAC,CAAA,IAAI,IAAS,CAAC;AACrM,CAAC","sourcesContent":["\"use client\";\nimport { useEffect, useRef, useState, type KeyboardEvent } from \"react\";\nimport { validateBezier, resolveShortcutCapture, type BezierCoordinates, type Shortcut, type ShortcutCapture } from \"@hjmds/design-contracts/authoring-tools\";\nimport { Button } from \"./actions.js\";\nimport { Slider } from \"./slider.js\";\nimport { Stack, Text } from \"./layout.js\";\nimport { useHjmTheme } from \"./provider.js\";\nimport { useCompositionAction } from \"./internal/use-composition-action.js\";\nexport type BezierEditorProps = Readonly<{\n value: BezierCoordinates; onValueChange: (value: BezierCoordinates) => void; disabled?: boolean; active?: boolean;\n duration?: number; yRange?: readonly [number, number];\n labels: Readonly<{ coordinates: readonly [string,string,string,string]; preview: string; curve: string; decrement: string; increment: string }>;\n formatCoordinate: (value: number) => string;\n}>;\nexport function BezierEditor(props: BezierEditorProps) {\n validateBezier(props.value);\n const range=props.yRange??[-2,2],duration=props.duration??1000;\n if (!Number.isFinite(duration)||duration<=0||!range.every(Number.isFinite)||range[0]>=range[1]||props.value[1]<range[0]||props.value[1]>range[1]||props.value[3]<range[0]||props.value[3]>range[1]) throw new RangeError(\"Invalid Bezier preview duration or y range\");\n const theme=useHjmTheme(),ball=useRef<HTMLDivElement>(null),animation=useRef<Animation|null>(null);\n const cancel=()=>{animation.current?.cancel();animation.current=null;};\n useEffect(()=>{cancel();return cancel;},[...props.value,duration,props.active,props.disabled,theme.environment.reducedMotion]);\n useEffect(()=>{const stop=()=>{if(document.hidden)cancel();};document.addEventListener(\"visibilitychange\",stop);return()=>document.removeEventListener(\"visibilitychange\",stop);},[]);\n const preview=()=>{cancel();if(props.disabled||theme.environment.reducedMotion||props.active===false||document.hidden)return;animation.current=ball.current?.animate([{transform:\"translateX(0)\"},{transform:\"translateX(120px)\"}],{duration,easing:`cubic-bezier(${props.value.join(\",\")})`,fill:\"forwards\"})??null;};\n const [x1,y1,x2,y2]=props.value;\n // Fit the selected controls and both endpoints; the allowed edit range would shrink the default curve.\n const curveMin=Math.min(0,1,y1,y2),curveMax=Math.max(0,1,y1,y2);\n return <Stack gap=\"md\"><svg role=\"img\" aria-label={props.labels.curve} width=\"100%\" height={180} viewBox={`-10 ${100-curveMax*100-10} 120 ${(curveMax-curveMin)*100+20}`}><path d=\"M0 100 L100 0\" fill=\"none\" stroke=\"currentColor\" opacity={.2}/><path d={`M0 100 L${x1*100} ${100-y1*100} M100 0 L${x2*100} ${100-y2*100}`} fill=\"none\" stroke=\"currentColor\" opacity={.5}/><path d={`M0 100 C${x1*100} ${100-y1*100} ${x2*100} ${100-y2*100} 100 0`} fill=\"none\" stroke=\"var(--hjm-color-content-brand, currentColor)\" strokeWidth={2}/><circle cx={x1*100} cy={100-y1*100} r={3} fill=\"currentColor\"/><circle cx={x2*100} cy={100-y2*100} r={3} fill=\"currentColor\"/></svg>\n {props.value.map((value,index)=><Slider key={index} label={props.labels.coordinates[index]!} min={index%2===0?0:range[0]} max={index%2===0?1:range[1]} step={.01} value={value} disabled={props.disabled===true} getValueText={props.formatCoordinate} onValueChange={next=>{const values=[...props.value] as [number,number,number,number];values[index]=next;props.onValueChange(values);}}/>)}\n <div aria-hidden=\"true\" style={{height:24,paddingInline:4,overflow:\"hidden\"}}><div ref={ball} style={{width:20,height:20,borderRadius:\"50%\",background:\"currentColor\"}}/></div>\n <Button disabled={props.disabled||props.active===false} onClick={preview}>{props.labels.preview}</Button></Stack>;\n}\nexport type ShortcutRecorderProps = Readonly<{\n value: Shortcut|null; onRegister: (shortcut: Shortcut) => void|Promise<void>; platform: \"mac\"|\"windows\"|\"linux\";\n conflicts?: readonly string[]; reserved?: readonly string[]; disabled?: boolean;\n formatShortcut: (shortcut: Shortcut) => string;\n labels: Readonly<{ record: string; recording: string; empty: string; register: string; cancel: string; error: string; status: (status: ShortcutCapture[\"status\"]) => string }>;\n}>;\nexport function ShortcutRecorder(props: ShortcutRecorderProps) {\n const [recording,setRecording]=useState(false),[draft,setDraft]=useState<Shortcut|null>(null),[status,setStatus]=useState<ShortcutCapture[\"status\"]|null>(\"ignored\");\n const action=useCompositionAction(props.disabled),area=useRef<HTMLDivElement>(null);\n useEffect(()=>{if(recording)area.current?.focus();},[recording]);\n useEffect(()=>{if(props.disabled){setRecording(false);setDraft(null);}},[props.disabled]);\n const capture=(event:KeyboardEvent<HTMLDivElement>)=>{\n if(!recording||props.disabled||action.pending)return;\n // Tab keeps standard focus movement; the recorder stops when focus leaves.\n if(event.code===\"Tab\")return;\n event.preventDefault();event.stopPropagation();\n const result=resolveShortcutCapture({code:event.code,ctrlKey:event.ctrlKey,altKey:event.altKey,shiftKey:event.shiftKey,metaKey:event.metaKey,repeat:event.repeat,isComposing:event.nativeEvent.isComposing,altGraph:event.getModifierState(\"AltGraph\")}, {platform:props.platform,...(props.conflicts?{conflicts:props.conflicts}:{}),...(props.reserved?{reserved:props.reserved}:{})});\n setStatus(result.status);if(result.status===\"ready\"){setDraft(result.shortcut);setRecording(false);}else if(result.status===\"cancelled\"){setRecording(false);setDraft(null);}else if(result.status!==\"ignored\")setDraft(null);\n };\n const register=()=>{if(!draft)return;const current=resolveShortcutCapture({code:draft.code,ctrlKey:draft.ctrl,altKey:draft.alt,shiftKey:draft.shift,metaKey:draft.meta},{platform:props.platform,...(props.conflicts?{conflicts:props.conflicts}:{}),...(props.reserved?{reserved:props.reserved}:{})});setStatus(current.status);if(current.status!==\"ready\")return;void action.run(\"register\",()=>props.onRegister(current.shortcut)).then(result=>{if(result.status===\"success\"){setDraft(null);setStatus(null);}});};\n return <Stack gap=\"md\"><div ref={area} tabIndex={recording?0:-1} role=\"group\" aria-label={props.labels.recording} onKeyDown={capture} onBlur={()=>setRecording(false)} style={{minHeight:44,display:\"grid\",placeItems:\"center\",outline:recording?\"2px solid currentColor\":undefined}}><Text>{recording?props.labels.recording: draft?props.formatShortcut(draft):props.value?props.formatShortcut(props.value):props.labels.empty}</Text></div>\n <Stack axis=\"inline\" gap=\"sm\"><Button disabled={props.disabled||action.pending} onClick={()=>{setDraft(null);setStatus(\"ignored\");setRecording(true);}}>{props.labels.record}</Button>{draft?<Button loading={action.pending} disabled={props.disabled===true} onClick={register}>{props.labels.register}</Button>:null}{recording||draft?<Button disabled={action.pending} tone=\"ghost\" onClick={()=>{setRecording(false);setDraft(null);setStatus(\"cancelled\");}}>{props.labels.cancel}</Button>:null}</Stack>\n {status!==null?<Text role=\"status\">{props.labels.status(status)}</Text>:null}{action.failed?<Text role=\"alert\" tone=\"danger\" style={{textAlign:\"center\"}}>{props.labels.error}</Text>:null}</Stack>;\n}\n"]}
1
+ {"version":3,"file":"authoring-tools.js","sourceRoot":"","sources":["../src/authoring-tools.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AACb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAsB,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAA+D,MAAM,yCAAyC,CAAC;AAC9J,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;A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,CAAC,MAAM,CAAC,MAAM,GAAU,CAAA,CAAC,CAAA,IAAI,IAAS,EAC/e,MAAM,KAAG,IAAI,CAAA,CAAC,CAAA,KAAC,IAAI,IAAC,IAAI,EAAC,QAAQ,YAAE,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAQ,CAAA,CAAC,CAAA,IAAI,EAAE,MAAM,CAAC,MAAM,CAAA,CAAC,CAAA,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAE,EAAC,SAAS,EAAC,QAAQ,EAAC,YAAG,KAAK,CAAC,MAAM,CAAC,KAAK,GAAQ,CAAA,CAAC,CAAA,IAAI,IAAS,CAAC;AACrM,CAAC","sourcesContent":["\"use client\";\nimport { useEffect, useRef, useState, type KeyboardEvent } from \"react\";\nimport { validateBezier, resolveShortcutCapture, type BezierCoordinates, type Shortcut, type ShortcutCapture } from \"@hjmds/design-contracts/authoring-tools\";\nimport { Button } from \"./actions.js\";\nimport { Slider } from \"./slider.js\";\nimport { Stack, Text } from \"./layout.js\";\nimport { useHjmTheme } from \"./provider.js\";\nimport { useCompositionAction } from \"./internal/use-composition-action.js\";\nexport type BezierEditorProps = Readonly<{\n value: BezierCoordinates; onValueChange: (value: BezierCoordinates) => void; disabled?: boolean; active?: boolean;\n duration?: number; yRange?: readonly [number, number];\n labels: Readonly<{ coordinates: readonly [string,string,string,string]; preview: string; curve: string; decrement: string; increment: string }>;\n formatCoordinate: (value: number) => string;\n}>;\nexport function BezierEditor(props: BezierEditorProps) {\n validateBezier(props.value);\n const range=props.yRange??[-2,2],duration=props.duration??1000;\n if (!Number.isFinite(duration)||duration<=0||!range.every(Number.isFinite)||range[0]>=range[1]||props.value[1]<range[0]||props.value[1]>range[1]||props.value[3]<range[0]||props.value[3]>range[1]) throw new RangeError(\"Invalid Bezier preview duration or y range\");\n const theme=useHjmTheme(),ball=useRef<HTMLDivElement>(null),animation=useRef<Animation|null>(null);\n const cancel=()=>{animation.current?.cancel();animation.current=null;};\n useEffect(()=>{cancel();return cancel;},[...props.value,duration,props.active,props.disabled,theme.environment.reducedMotion]);\n useEffect(()=>{const stop=()=>{if(document.hidden)cancel();};document.addEventListener(\"visibilitychange\",stop);return()=>document.removeEventListener(\"visibilitychange\",stop);},[]);\n const preview=()=>{cancel();if(props.disabled||theme.environment.reducedMotion||props.active===false||document.hidden)return;animation.current=ball.current?.animate([{transform:\"translateX(0)\"},{transform:\"translateX(120px)\"}],{duration,easing:`cubic-bezier(${props.value.join(\",\")})`,fill:\"forwards\"})??null;};\n const [x1,y1,x2,y2]=props.value;\n // Fit the selected controls and both endpoints; the allowed edit range would shrink the default curve.\n const curveMin=Math.min(0,1,y1,y2),curveMax=Math.max(0,1,y1,y2);\n return <Stack gap=\"md\"><svg role=\"img\" aria-label={props.labels.curve} width=\"100%\" height={180} viewBox={`-10 ${100-curveMax*100-10} 120 ${(curveMax-curveMin)*100+20}`}><path d=\"M0 100 L100 0\" fill=\"none\" stroke=\"currentColor\" opacity={.2}/><path d={`M0 100 L${x1*100} ${100-y1*100} M100 0 L${x2*100} ${100-y2*100}`} fill=\"none\" stroke=\"currentColor\" opacity={.5}/><path d={`M0 100 C${x1*100} ${100-y1*100} ${x2*100} ${100-y2*100} 100 0`} fill=\"none\" stroke=\"var(--hjm-color-content-brand, currentColor)\" strokeWidth={2}/><circle cx={x1*100} cy={100-y1*100} r={3} fill=\"currentColor\"/><circle cx={x2*100} cy={100-y2*100} r={3} fill=\"currentColor\"/></svg>\n {props.value.map((value,index)=><Slider key={index} label={props.labels.coordinates[index]!} min={index%2===0?0:range[0]} max={index%2===0?1:range[1]} step={.01} value={value} disabled={props.disabled===true} getValueText={props.formatCoordinate} onValueChange={next=>{const values=[...props.value] as [number,number,number,number];values[index]=next;props.onValueChange(values);}}/>)}\n <div aria-hidden=\"true\" style={{height:24,paddingInline:4,overflow:\"hidden\"}}><div ref={ball} style={{width:20,height:20,borderRadius:\"50%\",background:\"currentColor\"}}/></div>\n <Button disabled={props.disabled||props.active===false} onClick={preview}>{props.labels.preview}</Button></Stack>;\n}\nexport type ShortcutRecorderProps = Readonly<{\n value: Shortcut|null; onRegister: (shortcut: Shortcut) => void|Promise<void>; platform: \"mac\"|\"windows\"|\"linux\";\n conflicts?: readonly string[]; reserved?: readonly string[]; disabled?: boolean;\n formatShortcut: (shortcut: Shortcut) => string;\n labels: Readonly<{ record: string; recording: string; empty: string; register: string; cancel: string; error: string; status: (status: ShortcutCapture[\"status\"]) => string }>;\n}>;\nexport function ShortcutRecorder(props: ShortcutRecorderProps) {\n const [recording,setRecording]=useState(false),[draft,setDraft]=useState<Shortcut|null>(null),[status,setStatus]=useState<ShortcutCapture[\"status\"]|null>(\"ignored\");\n const action=useCompositionAction(props.disabled),area=useRef<HTMLDivElement>(null);\n useEffect(()=>{if(recording)area.current?.focus();},[recording]);\n useEffect(()=>{if(props.disabled){setRecording(false);setDraft(null);}},[props.disabled]);\n const capture=(event:KeyboardEvent<HTMLDivElement>)=>{\n if(!recording||props.disabled||action.pending)return;\n // Tab keeps standard focus movement; the recorder stops when focus leaves.\n if(event.code===\"Tab\")return;\n event.preventDefault();event.stopPropagation();\n const result=resolveShortcutCapture({code:event.code,ctrlKey:event.ctrlKey,altKey:event.altKey,shiftKey:event.shiftKey,metaKey:event.metaKey,repeat:event.repeat,isComposing:event.nativeEvent.isComposing,altGraph:event.getModifierState(\"AltGraph\")}, {platform:props.platform,...(props.conflicts?{conflicts:props.conflicts}:{}),...(props.reserved?{reserved:props.reserved}:{})});\n setStatus(result.status);if(result.status===\"ready\"){setDraft(result.shortcut);setRecording(false);}else if(result.status===\"cancelled\"){setRecording(false);setDraft(null);}else if(result.status!==\"ignored\")setDraft(null);\n };\n const register=()=>{if(!draft)return;const current=resolveShortcutCapture({code:draft.code,ctrlKey:draft.ctrl,altKey:draft.alt,shiftKey:draft.shift,metaKey:draft.meta},{platform:props.platform,...(props.conflicts?{conflicts:props.conflicts}:{}),...(props.reserved?{reserved:props.reserved}:{})});setStatus(current.status);if(current.status!==\"ready\")return;void action.run(\"register\",()=>props.onRegister(current.shortcut)).then(result=>{if(result.status===\"success\"){setDraft(null);setStatus(null);}});};\n return <Stack gap=\"md\"><div ref={area} tabIndex={recording?0:-1} role=\"group\" aria-label={props.labels.recording} onKeyDown={capture} onBlur={()=>setRecording(false)} style={{minHeight:44,display:\"grid\",placeItems:\"center\",outline:recording?\"2px solid currentColor\":undefined}}><Text>{recording?props.labels.recording: draft?props.formatShortcut(draft):props.value?props.formatShortcut(props.value):props.labels.empty}</Text></div>\n <Stack axis=\"inline\" gap=\"xs\"><Button disabled={props.disabled||action.pending} onClick={()=>{setDraft(null);setStatus(\"ignored\");setRecording(true);}}>{props.labels.record}</Button>{draft?<Button loading={action.pending} disabled={props.disabled===true} onClick={register}>{props.labels.register}</Button>:null}{recording||draft?<Button disabled={action.pending} tone=\"ghost\" onClick={()=>{setRecording(false);setDraft(null);setStatus(\"cancelled\");}}>{props.labels.cancel}</Button>:null}</Stack>\n {status!==null?<Text role=\"status\">{props.labels.status(status)}</Text>:null}{action.failed?<Text role=\"alert\" tone=\"danger\" style={{textAlign:\"center\"}}>{props.labels.error}</Text>:null}</Stack>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-cta.d.ts","sourceRoot":"","sources":["../src/bottom-cta.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA8C,KAAK,cAAc,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAC1I,OAAO,EAAU,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAIxE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,OAAO,CAAC,EAAE,iBAAiB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4FAA4F;IAC5F,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC7B,gGAAgG;IAChG,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAiBH,wGAAwG;AACxG,eAAO,MAAM,SAAS;mBA3BL,eAAe;sBACZ,eAAe,GAAG,SAAS;kBAC/B,MAAM;yBACC,MAAM;qBACV,MAAM;IACvB,4FAA4F;eACjF,MAAM,GAAG,QAAQ;IAC5B,gGAAgG;kBAClF,uBAAuB;mDA+CrC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { bottomCtaRecipe } from "@hjmds/design-contracts/recipes";
2
+ import { bottomCtaRecipe, actionGroupRecipe } from "@hjmds/design-contracts/recipes";
3
3
  import { isLargeTextScale } from "@hjmds/design-contracts/components/design-system-provider";
4
4
  import { forwardRef, useContext } from "react";
5
5
  import { Button } from "./actions.js";
@@ -29,6 +29,7 @@ export const BottomCTA = forwardRef(function BottomCTA({ primaryAction, secondar
29
29
  "--hjm-bottom-cta-padding-top": `${bottomCtaRecipe.paddingTop}px`,
30
30
  "--hjm-bottom-cta-padding-bottom": `${bottomCtaRecipe.paddingBottom}px`,
31
31
  "--hjm-bottom-cta-gap": `${bottomCtaRecipe.gap}px`,
32
+ "--hjm-bottom-cta-actions-gap": `${actionGroupRecipe.inlineGap}px`,
32
33
  "--hjm-bottom-cta-content-max-width": `${bottomCtaRecipe.contentMaxWidth}px`,
33
34
  "--hjm-bottom-cta-safe-area": `${safeAreaBottom}px`, ...style, ...layoutStyle,
34
35
  "--hjm-bottom-cta-parent-padding": inScreenFooter?.bottomPadding ?? "0px",
@@ -1 +1 @@
1
- {"version":3,"file":"bottom-cta.js","sourceRoot":"","sources":["../src/bottom-cta.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAA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AAI;YAClD,oCAAoC,EAAE,GAAG,eAAe,CAAC,eAAe,IAAI;YAC5E,4BAA4B,EAAE,GAAG,cAAc,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,WAAW;YAC7E,iCAAiC,EAAE,cAAc,EAAE,aAAa,IAAI,KAAK;SACzD,aACjB,WAAW,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,6BAA6B,YAAE,WAAW,GAAK,CAAC,CAAC,CAAC,IAAI,EAClF,eAAK,SAAS,EAAC,yBAAyB,aACrC,eAAe,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,2BAA2B,YAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAC,WAAW,GAAG,CAAC,CAAC,CAAC,eAAe,GAAO,EACvL,cAAK,SAAS,EAAC,yBAAyB,YAAC,KAAC,MAAM,IAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAC,SAAS,GAAG,GAAM,IAC3F,IACF,CAAC;AACT,CAAC,CAAC,CAAC","sourcesContent":["import { bottomCtaRecipe } from \"@hjmds/design-contracts/recipes\";\nimport { isLargeTextScale } from \"@hjmds/design-contracts/components/design-system-provider\";\nimport { forwardRef, useContext, type CSSProperties, type HTMLAttributes, type MouseEventHandler, type ReactNode, type Ref } from \"react\";\nimport { Button, type ButtonSize, type ButtonTone } from \"./actions.js\";\nimport { classNames } from \"./internal.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\nimport { ScreenFooterContext } from \"./internal/screen-footer.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type BottomCTAAction = Readonly<{\n label: string;\n /** A regular button requires a handler; submit/reset may use the browser's native form action. */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n type?: \"button\" | \"submit\" | \"reset\";\n /** HTML form owner, including a form in a Sheet body while this action is in its footer. */\n form?: string;\n accessibilityLabel?: string;\n disabled?: boolean;\n loading?: boolean;\n loadingLabel?: string;\n size?: ButtonSize;\n tone?: ButtonTone;\n /** Decorative Button adornments; label remains the action name. */\n leading?: ReactNode;\n trailing?: ReactNode;\n /**\n * Ref to this action's button. The component `ref` names the bar; a dialog or overlay opened from the primary\n * action needs the button itself to return focus to on close (2026-10-18 Utilverse display board).\n */\n buttonRef?: Ref<HTMLButtonElement>;\n}>;\n\nexport type BottomCTAProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> & Readonly<{\n primaryAction: BottomCTAAction;\n secondaryAction?: BottomCTAAction | ReactNode;\n description?: string;\n accessibilityLabel?: string;\n safeAreaBottom?: number;\n /** Sticky remains in document flow; fixed overlays would need a measured content spacer. */\n position?: \"flow\" | \"sticky\";\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nfunction Action({ action, tone }: { action: BottomCTAAction; tone: ButtonTone }) {\n if (!action.label.trim()) throw new TypeError(\"BottomCTA action label must not be empty\");\n const type = action.type ?? \"button\";\n if (type === \"button\" && !action.onClick) throw new TypeError(\"BottomCTA button action requires onClick\");\n return <Button ref={action.buttonRef} type={type} form={action.form} onClick={action.onClick} tone={action.tone ?? tone} size={action.size ?? \"medium\"}\n disabled={action.disabled} loading={action.loading ?? false} leading={action.leading} trailing={action.trailing}\n aria-label={action.loading ? action.loadingLabel ?? action.accessibilityLabel ?? action.label : action.accessibilityLabel}>\n {action.label}\n </Button>;\n}\n\nfunction isAction(value: BottomCTAAction | ReactNode): value is BottomCTAAction {\n return typeof value === \"object\" && value !== null && \"label\" in value && typeof value.label === \"string\";\n}\n\n/** One primary action with optional supporting copy and a secondary action, matching Native's slots. */\nexport const BottomCTA = forwardRef<HTMLDivElement, BottomCTAProps>(function BottomCTA({\n primaryAction, secondaryAction, description, accessibilityLabel, safeAreaBottom = 0,\n position = \"flow\", className, style, layoutStyle, ...props\n}, ref) {\n const theme = useOptionalHjmTheme();\n const inScreenFooter = useContext(ScreenFooterContext);\n if (!Number.isFinite(safeAreaBottom) || safeAreaBottom < 0) throw new RangeError(\"BottomCTA safeAreaBottom must be non-negative\");\n return <div {...props} ref={ref} role=\"group\" aria-label={accessibilityLabel}\n className={classNames(\"hjm-bottom-cta\", className)} data-position={position}\n data-placement={inScreenFooter ? \"screen-footer\" : undefined}\n data-large-text={isLargeTextScale(theme?.environment.textScale ?? 1)}\n style={{\n \"--hjm-bottom-cta-min-height\": `${bottomCtaRecipe.minHeight}px`,\n \"--hjm-bottom-cta-padding-inline\": `${bottomCtaRecipe.paddingHorizontal}px`,\n \"--hjm-bottom-cta-padding-top\": `${bottomCtaRecipe.paddingTop}px`,\n \"--hjm-bottom-cta-padding-bottom\": `${bottomCtaRecipe.paddingBottom}px`,\n \"--hjm-bottom-cta-gap\": `${bottomCtaRecipe.gap}px`,\n \"--hjm-bottom-cta-content-max-width\": `${bottomCtaRecipe.contentMaxWidth}px`,\n \"--hjm-bottom-cta-safe-area\": `${safeAreaBottom}px`, ...style, ...layoutStyle,\n \"--hjm-bottom-cta-parent-padding\": inScreenFooter?.bottomPadding ?? \"0px\",\n } as CSSProperties}>\n {description ? <p className=\"hjm-bottom-cta__description\">{description}</p> : null}\n <div className=\"hjm-bottom-cta__actions\">\n {secondaryAction == null ? null : <div className=\"hjm-bottom-cta__secondary\">{isAction(secondaryAction) ? <Action action={secondaryAction} tone=\"secondary\" /> : secondaryAction}</div>}\n <div className=\"hjm-bottom-cta__primary\"><Action action={primaryAction} tone=\"primary\" /></div>\n </div>\n </div>;\n});\n"]}
1
+ {"version":3,"file":"bottom-cta.js","sourceRoot":"","sources":["../src/bottom-cta.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,UAAU,EAA6F,MAAM,OAAO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EAAE,GAAG,eAAe,CAAC,eAAe,IAAI;YAC5E,4BAA4B,EAAE,GAAG,cAAc,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,WAAW;YAC7E,iCAAiC,EAAE,cAAc,EAAE,aAAa,IAAI,KAAK;SACzD,aACjB,WAAW,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,6BAA6B,YAAE,WAAW,GAAK,CAAC,CAAC,CAAC,IAAI,EAClF,eAAK,SAAS,EAAC,yBAAyB,aACrC,eAAe,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,2BAA2B,YAAE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAC,WAAW,GAAG,CAAC,CAAC,CAAC,eAAe,GAAO,EACvL,cAAK,SAAS,EAAC,yBAAyB,YAAC,KAAC,MAAM,IAAC,MAAM,EAAE,aAAa,EAAE,IAAI,EAAC,SAAS,GAAG,GAAM,IAC3F,IACF,CAAC;AACT,CAAC,CAAC,CAAC","sourcesContent":["import { bottomCtaRecipe, actionGroupRecipe } from \"@hjmds/design-contracts/recipes\";\nimport { isLargeTextScale } from \"@hjmds/design-contracts/components/design-system-provider\";\nimport { forwardRef, useContext, type CSSProperties, type HTMLAttributes, type MouseEventHandler, type ReactNode, type Ref } from \"react\";\nimport { Button, type ButtonSize, type ButtonTone } from \"./actions.js\";\nimport { classNames } from \"./internal.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\nimport { ScreenFooterContext } from \"./internal/screen-footer.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type BottomCTAAction = Readonly<{\n label: string;\n /** A regular button requires a handler; submit/reset may use the browser's native form action. */\n onClick?: MouseEventHandler<HTMLButtonElement>;\n type?: \"button\" | \"submit\" | \"reset\";\n /** HTML form owner, including a form in a Sheet body while this action is in its footer. */\n form?: string;\n accessibilityLabel?: string;\n disabled?: boolean;\n loading?: boolean;\n loadingLabel?: string;\n size?: ButtonSize;\n tone?: ButtonTone;\n /** Decorative Button adornments; label remains the action name. */\n leading?: ReactNode;\n trailing?: ReactNode;\n /**\n * Ref to this action's button. The component `ref` names the bar; a dialog or overlay opened from the primary\n * action needs the button itself to return focus to on close (2026-10-18 Utilverse display board).\n */\n buttonRef?: Ref<HTMLButtonElement>;\n}>;\n\nexport type BottomCTAProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> & Readonly<{\n primaryAction: BottomCTAAction;\n secondaryAction?: BottomCTAAction | ReactNode;\n description?: string;\n accessibilityLabel?: string;\n safeAreaBottom?: number;\n /** Sticky remains in document flow; fixed overlays would need a measured content spacer. */\n position?: \"flow\" | \"sticky\";\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nfunction Action({ action, tone }: { action: BottomCTAAction; tone: ButtonTone }) {\n if (!action.label.trim()) throw new TypeError(\"BottomCTA action label must not be empty\");\n const type = action.type ?? \"button\";\n if (type === \"button\" && !action.onClick) throw new TypeError(\"BottomCTA button action requires onClick\");\n return <Button ref={action.buttonRef} type={type} form={action.form} onClick={action.onClick} tone={action.tone ?? tone} size={action.size ?? \"medium\"}\n disabled={action.disabled} loading={action.loading ?? false} leading={action.leading} trailing={action.trailing}\n aria-label={action.loading ? action.loadingLabel ?? action.accessibilityLabel ?? action.label : action.accessibilityLabel}>\n {action.label}\n </Button>;\n}\n\nfunction isAction(value: BottomCTAAction | ReactNode): value is BottomCTAAction {\n return typeof value === \"object\" && value !== null && \"label\" in value && typeof value.label === \"string\";\n}\n\n/** One primary action with optional supporting copy and a secondary action, matching Native's slots. */\nexport const BottomCTA = forwardRef<HTMLDivElement, BottomCTAProps>(function BottomCTA({\n primaryAction, secondaryAction, description, accessibilityLabel, safeAreaBottom = 0,\n position = \"flow\", className, style, layoutStyle, ...props\n}, ref) {\n const theme = useOptionalHjmTheme();\n const inScreenFooter = useContext(ScreenFooterContext);\n if (!Number.isFinite(safeAreaBottom) || safeAreaBottom < 0) throw new RangeError(\"BottomCTA safeAreaBottom must be non-negative\");\n return <div {...props} ref={ref} role=\"group\" aria-label={accessibilityLabel}\n className={classNames(\"hjm-bottom-cta\", className)} data-position={position}\n data-placement={inScreenFooter ? \"screen-footer\" : undefined}\n data-large-text={isLargeTextScale(theme?.environment.textScale ?? 1)}\n style={{\n \"--hjm-bottom-cta-min-height\": `${bottomCtaRecipe.minHeight}px`,\n \"--hjm-bottom-cta-padding-inline\": `${bottomCtaRecipe.paddingHorizontal}px`,\n \"--hjm-bottom-cta-padding-top\": `${bottomCtaRecipe.paddingTop}px`,\n \"--hjm-bottom-cta-padding-bottom\": `${bottomCtaRecipe.paddingBottom}px`,\n \"--hjm-bottom-cta-gap\": `${bottomCtaRecipe.gap}px`,\n \"--hjm-bottom-cta-actions-gap\": `${actionGroupRecipe.inlineGap}px`,\n \"--hjm-bottom-cta-content-max-width\": `${bottomCtaRecipe.contentMaxWidth}px`,\n \"--hjm-bottom-cta-safe-area\": `${safeAreaBottom}px`, ...style, ...layoutStyle,\n \"--hjm-bottom-cta-parent-padding\": inScreenFooter?.bottomPadding ?? \"0px\",\n } as CSSProperties}>\n {description ? <p className=\"hjm-bottom-cta__description\">{description}</p> : null}\n <div className=\"hjm-bottom-cta__actions\">\n {secondaryAction == null ? null : <div className=\"hjm-bottom-cta__secondary\">{isAction(secondaryAction) ? <Action action={secondaryAction} tone=\"secondary\" /> : secondaryAction}</div>}\n <div className=\"hjm-bottom-cta__primary\"><Action action={primaryAction} tone=\"primary\" /></div>\n </div>\n </div>;\n});\n"]}
@@ -50,6 +50,6 @@ export function CarouselMotion(props) {
50
50
  return () => { api.off("select", select).off("reInit", reInit); };
51
51
  }, [api]);
52
52
  useEffect(() => { syncing.current = true; api?.scrollTo(index, environment.reducedMotion); syncing.current = false; }, [api, index, environment.reducedMotion]);
53
- return _jsxs("section", { "aria-label": props.label, "aria-roledescription": "carousel", style: props.layoutStyle, children: [_jsx("div", { ref: viewport, style: { overflow: "hidden" }, children: _jsx("div", { style: { display: "flex", touchAction: "pan-y pinch-zoom" }, children: props.slides.map((slide, i) => _jsx("div", { role: "group", "aria-roledescription": "slide", "aria-label": resolved[i].accessibleName, "aria-hidden": resolved[i].inert, inert: resolved[i].inert, style: { flex: "0 0 100%", minWidth: 0 }, children: props.renderSlide(slide) }, slide.id)) }) }), props.navigation === "counter" ? _jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [_jsx(IconButton, { label: props.previousLabel, tone: "ghost", disabled: index === 0, onClick: () => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, "previous")), children: _jsx(Icon, { name: "chevronStart" }) }), _jsxs(Text, { variant: "caption", "aria-live": "polite", children: [index + 1, "/", props.slides.length] }), _jsx(IconButton, { label: props.nextLabel, tone: "ghost", disabled: index === props.slides.length - 1, onClick: () => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, "next")), children: _jsx(Icon, { name: "chevronEnd" }) })] }) : _jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "var(--hjm-space-sm)", marginBlockStart: "var(--hjm-space-sm)" }, children: [_jsx(IconButton, { label: props.previousLabel, tone: "ghost", disabled: index === 0, onClick: () => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, "previous")), children: _jsx(Icon, { name: "chevronStart" }) }), _jsx(IconButton, { label: props.nextLabel, tone: "ghost", disabled: index === props.slides.length - 1, onClick: () => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, "next")), children: _jsx(Icon, { name: "chevronEnd" }) })] })] });
53
+ return _jsxs("section", { "aria-label": props.label, "aria-roledescription": "carousel", style: props.layoutStyle, children: [_jsx("div", { ref: viewport, style: { overflow: "hidden" }, children: _jsx("div", { style: { display: "flex", touchAction: "pan-y pinch-zoom" }, children: props.slides.map((slide, i) => _jsx("div", { role: "group", "aria-roledescription": "slide", "aria-label": resolved[i].accessibleName, "aria-hidden": resolved[i].inert, inert: resolved[i].inert, style: { flex: "0 0 100%", minWidth: 0 }, children: props.renderSlide(slide) }, slide.id)) }) }), props.navigation === "counter" ? _jsxs("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [_jsx(IconButton, { label: props.previousLabel, tone: "ghost", disabled: index === 0, onClick: () => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, "previous")), children: _jsx(Icon, { name: "chevronStart" }) }), _jsxs(Text, { variant: "caption", "aria-live": "polite", children: [index + 1, "/", props.slides.length] }), _jsx(IconButton, { label: props.nextLabel, tone: "ghost", disabled: index === props.slides.length - 1, onClick: () => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, "next")), children: _jsx(Icon, { name: "chevronEnd" }) })] }) : _jsxs("div", { style: { display: "flex", justifyContent: "flex-end", gap: "var(--hjm-space-xs)", marginBlockStart: "var(--hjm-space-sm)" }, children: [_jsx(IconButton, { label: props.previousLabel, tone: "ghost", disabled: index === 0, onClick: () => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, "previous")), children: _jsx(Icon, { name: "chevronStart" }) }), _jsx(IconButton, { label: props.nextLabel, tone: "ghost", disabled: index === props.slides.length - 1, onClick: () => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, "next")), children: _jsx(Icon, { name: "chevronEnd" }) })] })] });
54
54
  }
55
55
  //# sourceMappingURL=carousel-motion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel-motion.js","sourceRoot":"","sources":["../src/carousel-motion.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACpE,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAsC,MAAM,6CAA6C,CAAC;AACzJ,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAA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AC,2BAA2B,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,YAAE,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,GAAa,IAC3N,IACE,CAAC;AACb,CAAC","sourcesContent":["import { useEffect, useRef, useState, type ReactNode } from \"react\";\nimport useEmblaCarousel from \"embla-carousel-react\";\nimport type { SortableItem } from \"@hjmds/design-contracts/components/interaction-adapters\";\nimport { resolveCarouselDescriptor, getCarouselNavigationTarget, type ComposeCarouselAccessibleName } from \"@hjmds/design-contracts/components/carousel\";\nimport { IconButton } from \"./actions.js\";\nimport { Icon } from \"./supplemental-display.js\";\nimport { Text } from \"./layout.js\";\nimport { useHjmTheme } from \"./provider.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type CarouselMotionProps = {\n navigation?: \"buttons\" | \"counter\";\n slides: readonly SortableItem[]; currentKey: string; onCurrentKeyChange(key: string): void;\n /** Optional localized position/name composer shared with the base Carousel. */\n composeAccessibleName?: ComposeCarouselAccessibleName;\n renderSlide(item: SortableItem): ReactNode; label: string; previousLabel: string; nextLabel: string;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n};\nexport function CarouselMotion(props: CarouselMotionProps) {\n const descriptor = { slides: props.slides, currentKey: props.currentKey };\n // Share finite keyed selection and names with Carousel; the optional peer owns\n // only swipe/motion. No autoplay is implied by this controlled presentation.\n const resolved = resolveCarouselDescriptor(descriptor, {\n composeAccessibleName: props.composeAccessibleName ?? ((info) => info.label),\n });\n const index = resolved.findIndex(slide => slide.current);\n if (![props.label, props.previousLabel, props.nextLabel].every(label => label.trim())) {\n throw new TypeError(\"CarouselMotion labels must not be empty\");\n }\n const { environment } = useHjmTheme();\n // Embla deep-compares options and reInits on change; a live startIndex restarted the engine at the target on\n // every selection, so navigation snapped instead of animating (2026-09-30 review). Only the first index seeds it.\n const [startIndex] = useState(index);\n const [viewport, api] = useEmblaCarousel({ loop: false, direction: environment.direction, startIndex,\n // HJM owns selection; upstream focus scrolling must not independently change slides.\n // Embla's default 25 is a physics duration factor, not an HJM millisecond token.\n watchFocus: false, duration: environment.reducedMotion ? 0 : 25 });\n const latest = useRef(props); latest.current = props;\n const latestIndex = useRef(index); latestIndex.current = index;\n const syncing = useRef(false);\n useEffect(() => {\n if (!api) return;\n const select = () => {\n const current = latest.current;\n const item = current.slides[api.selectedScrollSnap()];\n if (!syncing.current && item && item.id !== current.currentKey) current.onCurrentKeyChange(item.id);\n };\n // A zero-width/modal viewport can collapse snaps before its first measurement.\n // Re-measurement must restore the controlled key, not retain that collapsed engine index.\n const reInit = () => {\n syncing.current = true;\n api.scrollTo(latestIndex.current, true);\n syncing.current = false;\n };\n api.on(\"select\", select).on(\"reInit\", reInit);\n return () => { api.off(\"select\", select).off(\"reInit\", reInit); };\n }, [api]);\n useEffect(() => { syncing.current = true; api?.scrollTo(index, environment.reducedMotion); syncing.current = false; }, [api, index, environment.reducedMotion]);\n return <section aria-label={props.label} aria-roledescription=\"carousel\" style={props.layoutStyle}>\n <div ref={viewport} style={{ overflow: \"hidden\" }}><div style={{ display: \"flex\", touchAction: \"pan-y pinch-zoom\" }}>\n {props.slides.map((slide, i) => <div key={slide.id} role=\"group\" aria-roledescription=\"slide\" aria-label={resolved[i]!.accessibleName} aria-hidden={resolved[i]!.inert} inert={resolved[i]!.inert}\n style={{ flex: \"0 0 100%\", minWidth: 0 }}>{props.renderSlide(slide)}</div>)}\n </div></div>\n {/* Tool actions: icon buttons named by the localized labels, matching Carousel and CollectionRail. Logical\n chevrons mirror with the reading direction (2026-10-17 composition review). */}\n {props.navigation === \"counter\" ? <div style={{ display: \"flex\", alignItems: \"center\", justifyContent: \"space-between\" }}>\n <IconButton label={props.previousLabel} tone=\"ghost\" disabled={index === 0} onClick={() => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, \"previous\"))}><Icon name=\"chevronStart\" /></IconButton>\n <Text variant=\"caption\" aria-live=\"polite\">{index + 1}/{props.slides.length}</Text>\n <IconButton label={props.nextLabel} tone=\"ghost\" disabled={index === props.slides.length - 1} onClick={() => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, \"next\"))}><Icon name=\"chevronEnd\" /></IconButton>\n </div> : <div style={{ display: \"flex\", justifyContent: \"flex-end\", gap: \"var(--hjm-space-sm)\", marginBlockStart: \"var(--hjm-space-sm)\" }}>\n <IconButton label={props.previousLabel} tone=\"ghost\" disabled={index === 0} onClick={() => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, \"previous\"))}><Icon name=\"chevronStart\" /></IconButton>\n <IconButton label={props.nextLabel} tone=\"ghost\" disabled={index === props.slides.length - 1} onClick={() => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, \"next\"))}><Icon name=\"chevronEnd\" /></IconButton>\n </div>}\n </section>;\n}\n"]}
1
+ {"version":3,"file":"carousel-motion.js","sourceRoot":"","sources":["../src/carousel-motion.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACpE,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAsC,MAAM,6CAA6C,CAAC;AACzJ,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAY5C,MAAM,UAAU,cAAc,CAAC,KAA0B;IACvD,MAAM,UAAU,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC;IAC1E,+EAA+E;IAC/E,6EAA6E;IAC7E,MAAM,QAAQ,GAAG,yBAAyB,CAAC,UAAU,EAAE;QACrD,qBAAqB,EAAE,KA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Q,EAAE,KAAK,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,2BAA2B,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,YAAE,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,GAAa,IAC3N,CAAC,CAAC,CAAC,eAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,aACvI,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,CAAC,aAAa,EAAE,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,KAAK,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,2BAA2B,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,YAAE,KAAC,IAAI,IAAC,IAAI,EAAC,cAAc,GAAG,GAAa,EACnN,KAAC,UAAU,IAAC,KAAK,EAAE,KAAK,CAAC,SAAS,EAAE,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,KAAK,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,kBAAkB,CAAC,2BAA2B,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,YAAE,KAAC,IAAI,IAAC,IAAI,EAAC,YAAY,GAAG,GAAa,IAC3N,IACE,CAAC;AACb,CAAC","sourcesContent":["import { useEffect, useRef, useState, type ReactNode } from \"react\";\nimport useEmblaCarousel from \"embla-carousel-react\";\nimport type { SortableItem } from \"@hjmds/design-contracts/components/interaction-adapters\";\nimport { resolveCarouselDescriptor, getCarouselNavigationTarget, type ComposeCarouselAccessibleName } from \"@hjmds/design-contracts/components/carousel\";\nimport { IconButton } from \"./actions.js\";\nimport { Icon } from \"./supplemental-display.js\";\nimport { Text } from \"./layout.js\";\nimport { useHjmTheme } from \"./provider.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type CarouselMotionProps = {\n navigation?: \"buttons\" | \"counter\";\n slides: readonly SortableItem[]; currentKey: string; onCurrentKeyChange(key: string): void;\n /** Optional localized position/name composer shared with the base Carousel. */\n composeAccessibleName?: ComposeCarouselAccessibleName;\n renderSlide(item: SortableItem): ReactNode; label: string; previousLabel: string; nextLabel: string;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n};\nexport function CarouselMotion(props: CarouselMotionProps) {\n const descriptor = { slides: props.slides, currentKey: props.currentKey };\n // Share finite keyed selection and names with Carousel; the optional peer owns\n // only swipe/motion. No autoplay is implied by this controlled presentation.\n const resolved = resolveCarouselDescriptor(descriptor, {\n composeAccessibleName: props.composeAccessibleName ?? ((info) => info.label),\n });\n const index = resolved.findIndex(slide => slide.current);\n if (![props.label, props.previousLabel, props.nextLabel].every(label => label.trim())) {\n throw new TypeError(\"CarouselMotion labels must not be empty\");\n }\n const { environment } = useHjmTheme();\n // Embla deep-compares options and reInits on change; a live startIndex restarted the engine at the target on\n // every selection, so navigation snapped instead of animating (2026-09-30 review). Only the first index seeds it.\n const [startIndex] = useState(index);\n const [viewport, api] = useEmblaCarousel({ loop: false, direction: environment.direction, startIndex,\n // HJM owns selection; upstream focus scrolling must not independently change slides.\n // Embla's default 25 is a physics duration factor, not an HJM millisecond token.\n watchFocus: false, duration: environment.reducedMotion ? 0 : 25 });\n const latest = useRef(props); latest.current = props;\n const latestIndex = useRef(index); latestIndex.current = index;\n const syncing = useRef(false);\n useEffect(() => {\n if (!api) return;\n const select = () => {\n const current = latest.current;\n const item = current.slides[api.selectedScrollSnap()];\n if (!syncing.current && item && item.id !== current.currentKey) current.onCurrentKeyChange(item.id);\n };\n // A zero-width/modal viewport can collapse snaps before its first measurement.\n // Re-measurement must restore the controlled key, not retain that collapsed engine index.\n const reInit = () => {\n syncing.current = true;\n api.scrollTo(latestIndex.current, true);\n syncing.current = false;\n };\n api.on(\"select\", select).on(\"reInit\", reInit);\n return () => { api.off(\"select\", select).off(\"reInit\", reInit); };\n }, [api]);\n useEffect(() => { syncing.current = true; api?.scrollTo(index, environment.reducedMotion); syncing.current = false; }, [api, index, environment.reducedMotion]);\n return <section aria-label={props.label} aria-roledescription=\"carousel\" style={props.layoutStyle}>\n <div ref={viewport} style={{ overflow: \"hidden\" }}><div style={{ display: \"flex\", touchAction: \"pan-y pinch-zoom\" }}>\n {props.slides.map((slide, i) => <div key={slide.id} role=\"group\" aria-roledescription=\"slide\" aria-label={resolved[i]!.accessibleName} aria-hidden={resolved[i]!.inert} inert={resolved[i]!.inert}\n style={{ flex: \"0 0 100%\", minWidth: 0 }}>{props.renderSlide(slide)}</div>)}\n </div></div>\n {/* Tool actions: icon buttons named by the localized labels, matching Carousel and CollectionRail. Logical\n chevrons mirror with the reading direction (2026-10-17 composition review). */}\n {props.navigation === \"counter\" ? <div style={{ display: \"flex\", alignItems: \"center\", justifyContent: \"space-between\" }}>\n <IconButton label={props.previousLabel} tone=\"ghost\" disabled={index === 0} onClick={() => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, \"previous\"))}><Icon name=\"chevronStart\" /></IconButton>\n <Text variant=\"caption\" aria-live=\"polite\">{index + 1}/{props.slides.length}</Text>\n <IconButton label={props.nextLabel} tone=\"ghost\" disabled={index === props.slides.length - 1} onClick={() => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, \"next\"))}><Icon name=\"chevronEnd\" /></IconButton>\n </div> : <div style={{ display: \"flex\", justifyContent: \"flex-end\", gap: \"var(--hjm-space-xs)\", marginBlockStart: \"var(--hjm-space-sm)\" }}>\n <IconButton label={props.previousLabel} tone=\"ghost\" disabled={index === 0} onClick={() => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, \"previous\"))}><Icon name=\"chevronStart\" /></IconButton>\n <IconButton label={props.nextLabel} tone=\"ghost\" disabled={index === props.slides.length - 1} onClick={() => props.onCurrentKeyChange(getCarouselNavigationTarget(descriptor, \"next\"))}><Icon name=\"chevronEnd\" /></IconButton>\n </div>}\n </section>;\n}\n"]}
@@ -52,7 +52,7 @@ function InlineEditBody(props) {
52
52
  event.stopPropagation();
53
53
  close();
54
54
  }
55
- } }), _jsxs(Stack, { axis: "inline", gap: "sm", wrap: true, children: [_jsx(Button, { tone: "ghost", disabled: action.pending, onClick: close, children: props.cancelLabel }), _jsx(Button, { loading: action.pending, disabled: props.disabled === true || !!error, onClick: () => void save(), children: props.saveLabel })] }), action.failed ? _jsx(ErrorMessage, { children: props.errorLabel }) : null] }) });
55
+ } }), _jsxs(Stack, { axis: "inline", gap: "xs", wrap: true, children: [_jsx(Button, { tone: "ghost", disabled: action.pending, onClick: close, children: props.cancelLabel }), _jsx(Button, { loading: action.pending, disabled: props.disabled === true || !!error, onClick: () => void save(), children: props.saveLabel })] }), action.failed ? _jsx(ErrorMessage, { children: props.errorLabel }) : null] }) });
56
56
  }
57
57
  export function RepeatableFieldGroup({ renderField, addLabel, removeLabel, minFields = 0, maxFields = Infinity, isRemoveDisabled, onAdd, onRemove, ...props }) {
58
58
  const targets = useRef(new Map()), add = useRef(null);
@@ -97,7 +97,7 @@ export function SelectionActionBar(props) {
97
97
  snapshotSelection(props.selectedIds);
98
98
  if (!props.selectedIds.length && !props.recovery && !action.pending && !action.failed)
99
99
  return null;
100
- return _jsx("div", { role: "group", "aria-label": props.selectionLabel(props.selectedIds.length), children: _jsxs(Stack, { gap: "sm", children: [_jsx(Text, { role: "status", children: props.selectionLabel(props.selectedIds.length) }), _jsxs(Stack, { axis: "inline", gap: "sm", wrap: true, children: [props.actions.map(item => _jsx(Button, { tone: item.destructive ? "danger" : "secondary", loading: action.active === `action:${item.id}`, disabled: props.disabled === true || (action.pending && action.active !== `action:${item.id}`) || !props.selectedIds.length, onClick: () => {
100
+ return _jsx("div", { role: "group", "aria-label": props.selectionLabel(props.selectedIds.length), children: _jsxs(Stack, { gap: "sm", children: [_jsx(Text, { role: "status", children: props.selectionLabel(props.selectedIds.length) }), _jsxs(Stack, { axis: "inline", gap: "xs", wrap: true, children: [props.actions.map(item => _jsx(Button, { tone: item.destructive ? "danger" : "secondary", loading: action.active === `action:${item.id}`, disabled: props.disabled === true || (action.pending && action.active !== `action:${item.id}`) || !props.selectedIds.length, onClick: () => {
101
101
  if (props.disabled)
102
102
  return;
103
103
  const scope = snapshotSelection(props.selectedIds);
@@ -111,8 +111,8 @@ export function SelectionActionBar(props) {
111
111
  export function FilterRecovery(props) {
112
112
  const action = useCompositionAction(props.disabled), options = recoverableFilters(props.options);
113
113
  // Fills the result area its host gives it (flex parent) and centers there, like Native.
114
- return _jsx("div", { role: "group", "aria-label": props.title, style: { display: "grid", placeItems: "center", flexGrow: 1, textAlign: "center" }, children: _jsxs(Stack, { gap: "sm", align: "center", children: [_jsx(Text, { emphasis: "strong", children: props.title }), props.description ? _jsx(Text, { tone: "muted", children: props.description }) : null, options.map(option => _jsx(Button, { tone: "secondary", loading: action.active === option.id, disabled: props.disabled === true || (action.pending && action.active !== option.id), onClick: () => { if (!props.disabled)
115
- void action.run(option.id, () => props.onApply(option.id)); }, children: props.optionLabel(option) }, option.id)), action.failed ? _jsx(ErrorMessage, { children: props.errorLabel }) : null] }) });
114
+ return _jsx("div", { role: "group", "aria-label": props.title, style: { display: "grid", placeItems: "center", flexGrow: 1, textAlign: "center" }, children: _jsxs(Stack, { gap: "sm", align: "center", children: [_jsx(Text, { emphasis: "strong", children: props.title }), props.description ? _jsx(Text, { tone: "muted", children: props.description }) : null, _jsx(Stack, { gap: "xs", children: options.map(option => _jsx(Button, { tone: "secondary", loading: action.active === option.id, disabled: props.disabled === true || (action.pending && action.active !== option.id), onClick: () => { if (!props.disabled)
115
+ void action.run(option.id, () => props.onApply(option.id)); }, children: props.optionLabel(option) }, option.id)) }), action.failed ? _jsx(ErrorMessage, { children: props.errorLabel }) : null] }) });
116
116
  }
117
117
  export function TableColumnSettings(props) {
118
118
  assertDistinctIds(props.columns);