@hjmds/react 1.20.0 → 1.22.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 (81) hide show
  1. package/dist/actions.d.ts +10 -0
  2. package/dist/actions.d.ts.map +1 -1
  3. package/dist/actions.js +9 -3
  4. package/dist/actions.js.map +1 -1
  5. package/dist/authoring-tools.d.ts +38 -0
  6. package/dist/authoring-tools.d.ts.map +1 -0
  7. package/dist/authoring-tools.js +65 -0
  8. package/dist/authoring-tools.js.map +1 -0
  9. package/dist/calendar.d.ts.map +1 -1
  10. package/dist/calendar.js +1 -0
  11. package/dist/calendar.js.map +1 -1
  12. package/dist/chart.d.ts +157 -0
  13. package/dist/chart.d.ts.map +1 -0
  14. package/dist/chart.js +467 -0
  15. package/dist/chart.js.map +1 -0
  16. package/dist/collection-editing.d.ts +66 -0
  17. package/dist/collection-editing.d.ts.map +1 -0
  18. package/dist/collection-editing.js +126 -0
  19. package/dist/collection-editing.js.map +1 -0
  20. package/dist/communication.d.ts +51 -0
  21. package/dist/communication.d.ts.map +1 -0
  22. package/dist/communication.js +71 -0
  23. package/dist/communication.js.map +1 -0
  24. package/dist/data-table.d.ts +21 -1
  25. package/dist/data-table.d.ts.map +1 -1
  26. package/dist/data-table.js +105 -10
  27. package/dist/data-table.js.map +1 -1
  28. package/dist/data-workflows.d.ts +67 -0
  29. package/dist/data-workflows.d.ts.map +1 -0
  30. package/dist/data-workflows.js +60 -0
  31. package/dist/data-workflows.js.map +1 -0
  32. package/dist/evidence.d.ts +1 -1
  33. package/dist/evidence.js +1 -1
  34. package/dist/evidence.js.map +1 -1
  35. package/dist/internal/use-composition-action.d.ts +17 -0
  36. package/dist/internal/use-composition-action.d.ts.map +1 -0
  37. package/dist/internal/use-composition-action.js +18 -0
  38. package/dist/internal/use-composition-action.js.map +1 -0
  39. package/dist/media-transport.d.ts +22 -0
  40. package/dist/media-transport.d.ts.map +1 -0
  41. package/dist/media-transport.js +50 -0
  42. package/dist/media-transport.js.map +1 -0
  43. package/dist/navigation.d.ts +3 -1
  44. package/dist/navigation.d.ts.map +1 -1
  45. package/dist/navigation.js +29 -5
  46. package/dist/navigation.js.map +1 -1
  47. package/dist/screen-flows.d.ts +3 -1
  48. package/dist/screen-flows.d.ts.map +1 -1
  49. package/dist/screen-flows.js +6 -4
  50. package/dist/screen-flows.js.map +1 -1
  51. package/dist/screens.d.ts +8 -2
  52. package/dist/screens.d.ts.map +1 -1
  53. package/dist/screens.js +11 -5
  54. package/dist/screens.js.map +1 -1
  55. package/dist/social-compositions.d.ts +52 -0
  56. package/dist/social-compositions.d.ts.map +1 -0
  57. package/dist/social-compositions.js +41 -0
  58. package/dist/social-compositions.js.map +1 -0
  59. package/dist/streaming-answer.d.ts +24 -0
  60. package/dist/streaming-answer.d.ts.map +1 -0
  61. package/dist/streaming-answer.js +57 -0
  62. package/dist/streaming-answer.js.map +1 -0
  63. package/dist/styles.css +145 -1
  64. package/dist/styles.layered.css +145 -1
  65. package/dist/table-family.d.ts +68 -0
  66. package/dist/table-family.d.ts.map +1 -0
  67. package/dist/table-family.js +75 -0
  68. package/dist/table-family.js.map +1 -0
  69. package/dist/task-controls.d.ts +47 -0
  70. package/dist/task-controls.d.ts.map +1 -0
  71. package/dist/task-controls.js +46 -0
  72. package/dist/task-controls.js.map +1 -0
  73. package/dist/toggle-feedback.d.ts +26 -0
  74. package/dist/toggle-feedback.d.ts.map +1 -0
  75. package/dist/toggle-feedback.js +47 -0
  76. package/dist/toggle-feedback.js.map +1 -0
  77. package/dist/transfer-task.d.ts +18 -0
  78. package/dist/transfer-task.d.ts.map +1 -0
  79. package/dist/transfer-task.js +56 -0
  80. package/dist/transfer-task.js.map +1 -0
  81. package/package.json +58 -3
package/dist/actions.d.ts CHANGED
@@ -15,6 +15,11 @@ export type ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & Readonly<{
15
15
  /** Toggle state. Paints the selected treatment and sets `aria-pressed`. */
16
16
  selected?: boolean;
17
17
  loading?: boolean;
18
+ /** Explicit confirmed mutation result. Both text labels remain measured in every state. */
19
+ completion?: Readonly<{
20
+ confirmed: boolean;
21
+ label: string;
22
+ }>;
18
23
  leading?: ReactNode;
19
24
  trailing?: ReactNode;
20
25
  /** Canonical layout-only placement. Controlled visual keys are excluded. */
@@ -30,6 +35,11 @@ export declare const Button: import("react").ForwardRefExoticComponent<ButtonHTM
30
35
  /** Toggle state. Paints the selected treatment and sets `aria-pressed`. */
31
36
  selected?: boolean;
32
37
  loading?: boolean;
38
+ /** Explicit confirmed mutation result. Both text labels remain measured in every state. */
39
+ completion?: Readonly<{
40
+ confirmed: boolean;
41
+ label: string;
42
+ }>;
33
43
  leading?: ReactNode;
34
44
  trailing?: ReactNode;
35
45
  /** Canonical layout-only placement. Controlled visual keys are excluded. */
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,sCAAsC,CAAC;AAE9C,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;AACzC,OAAO,EAGL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEL,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,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,WAAW,GAAG,oBA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AC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,YAAY,CAAC;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
@@ -1,9 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { buttonRecipe, } from "@hjmds/design-contracts/recipes/base";
3
3
  import { iconButtonRecipe, linkRecipe, } from "@hjmds/design-contracts/recipes";
4
- import { forwardRef, } from "react";
4
+ import { Children, forwardRef, } from "react";
5
5
  import { classNames } from "./internal.js";
6
- export const Button = forwardRef(function Button({ tone = buttonRecipe.defaults.tone, size = buttonRecipe.defaults.size, shape = buttonRecipe.defaults.shape, align = buttonRecipe.defaults.align, selected, loading = false, leading, trailing, disabled, onClick, type = "button", className, children, layoutStyle, style, ...props }, ref) {
6
+ export const Button = forwardRef(function Button({ tone = buttonRecipe.defaults.tone, size = buttonRecipe.defaults.size, shape = buttonRecipe.defaults.shape, align = buttonRecipe.defaults.align, selected, loading = false, completion, leading, trailing, disabled, onClick, type = "button", className, children, layoutStyle, style, ...props }, ref) {
7
+ const textParts = completion ? Children.toArray(children) : [];
8
+ if (completion && (!completion.label.trim() || typeof completion.confirmed !== "boolean" || textParts.length === 0 || !textParts.every(part => typeof part === "string" || typeof part === "number"))) {
9
+ throw new TypeError("Button completion requires a nonempty label, a boolean confirmed value and text-only children");
10
+ }
11
+ const idleLabel = completion ? textParts.join("") : children;
12
+ const currentLabel = completion?.confirmed && !loading ? completion.label : idleLabel;
7
13
  // Preserve a focusable disabled action (e.g. a Carousel boundary).
8
14
  const ariaDisabled = props["aria-disabled"] === true || props["aria-disabled"] === "true";
9
15
  const unavailable = disabled === true || loading || ariaDisabled;
@@ -17,7 +23,7 @@ export const Button = forwardRef(function Button({ tone = buttonRecipe.defaults.
17
23
  };
18
24
  return (_jsxs("button", { ...props,
19
25
  // The cap lives in the recipe, not in the stylesheet: one number, one place.
20
- style: { "--hjm-button-label-lines": buttonRecipe.label.maxLines, ...style, ...layoutStyle }, ref: ref, type: type, className: classNames("hjm-button", className), "data-tone": tone, "data-size": size, "data-shape": shape, "data-align": align, ...(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, onClick: handleClick, children: [leading, _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] }));
26
+ style: { "--hjm-button-label-lines": buttonRecipe.label.maxLines, ...style, ...layoutStyle }, ref: ref, type: type, className: classNames("hjm-button", className), "data-tone": tone, "data-size": size, "data-shape": shape, "data-align": align, ...(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, onClick: handleClick, 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] }));
21
27
  });
22
28
  export const IconButton = forwardRef(function IconButton({ label, tone = iconButtonRecipe.defaults.tone, size = iconButtonRecipe.defaults.size, shape = iconButtonRecipe.defaults.shape, selected, loading = false, disabled, onClick, type = "button", className, children, layoutStyle, style, ...props }, ref) {
23
29
  // Preserve a focusable disabled action (e.g. a Carousel boundary).
@@ -1 +1 @@
1
- {"version":3,"file":"actions.js","sourceRoot":"","sources":["../src/actions.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,YAAY,GAKb,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,gBAAgB,EAChB,UAAU,GAMX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,UAAU,GAQX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA2B3C,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAiC,SAAS,MAAM,CAC9E,EACE,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,EACjC,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,IAAI,EACjC,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,KAAK,EACnC,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,KAAK,EACnC,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,IAAI,GAAG,QAAQ,EACf,SAAS,EACT,QAAQ,EACR,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG;IAEH,mEAAmE;IACnE,MAAM,YAAY,GAAG,KAAK,CAAC,eAAe,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,eAAe,CAAC,KAAK,MAAM,CAAC;IAC1F,MAAM,WAAW,GAAG,QAAQ,KAAK,IAAI,IAAI,OAAO,IAAI,YAAY,CAAC;IACjE,MAAM,WAAW,GAAG,CAAC,KAAoC,EAAE,EAAE;QAC3D,IAAI,WAAW,EAAE,CAAC;Y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AAC,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 type ButtonAlign,\n type ButtonShape,\n type ButtonSize,\n type ButtonTone,\n} from \"@hjmds/design-contracts/recipes/base\";\n\nexport type { ButtonAlign, ButtonShape };\nimport {\n iconButtonRecipe,\n linkRecipe,\n type IconButtonShape,\n type IconButtonSize,\n type IconButtonTone,\n type LinkTone,\n type LinkVariant,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\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 { classNames } from \"./internal.js\";\n\nexport type { ButtonSize, ButtonTone } from \"@hjmds/design-contracts/recipes/base\";\nexport type {\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 /** 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 leading?: ReactNode;\n trailing?: ReactNode;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n tone = buttonRecipe.defaults.tone,\n size = buttonRecipe.defaults.size,\n shape = buttonRecipe.defaults.shape,\n align = buttonRecipe.defaults.align,\n selected,\n loading = false,\n leading,\n trailing,\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 // The cap lives in the recipe, not in the stylesheet: one number, one place.\n style={{ \"--hjm-button-label-lines\": buttonRecipe.label.maxLines, ...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-align={align}\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}\n onClick={handleClick}\n >\n {leading}\n <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 </button>\n );\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 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 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 {...(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,GAKb,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EACL,gBAAgB,EAChB,UAAU,GAMX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,QAAQ,EACR,UAAU,GAQX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA6B3C,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAiC,SAAS,MAAM,CAC9E,EACE,IAAI,GAAG,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,EAAE,CAAC;YACb,KAAK,CAAC,cAAc,EAAE,CAAC;YACvB,OAAO;QACT,CAAC;QACD,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC;IACF,MAAM,WAAW,GAAoB;QACnC,GAAG,KAAK;QACR,4EAA4E;QAC5E,2CAA2C;QAC3C,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,IAAI,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,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 type ButtonAlign,\n type ButtonShape,\n type ButtonSize,\n type ButtonTone,\n} from \"@hjmds/design-contracts/recipes/base\";\n\nexport type { ButtonAlign, ButtonShape };\nimport {\n iconButtonRecipe,\n linkRecipe,\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 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 { classNames } from \"./internal.js\";\n\nexport type { ButtonSize, ButtonTone } from \"@hjmds/design-contracts/recipes/base\";\nexport type {\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 /** 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 /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n tone = buttonRecipe.defaults.tone,\n size = buttonRecipe.defaults.size,\n shape = buttonRecipe.defaults.shape,\n align = buttonRecipe.defaults.align,\n selected,\n loading = false,\n completion,\n leading,\n trailing,\n disabled,\n onClick,\n type = \"button\",\n className,\n children,\n layoutStyle,\n style,\n ...props\n },\n ref,\n) {\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 return (\n <button\n {...props}\n // The cap lives in the recipe, not in the stylesheet: one number, one place.\n style={{ \"--hjm-button-label-lines\": buttonRecipe.label.maxLines, ...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-align={align}\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}\n onClick={handleClick}\n >\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 </button>\n );\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 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 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 {...(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"]}
@@ -0,0 +1,38 @@
1
+ import { type BezierCoordinates, type Shortcut, type ShortcutCapture } from "@hjmds/design-contracts/authoring-tools";
2
+ export type BezierEditorProps = Readonly<{
3
+ value: BezierCoordinates;
4
+ onValueChange: (value: BezierCoordinates) => void;
5
+ disabled?: boolean;
6
+ active?: boolean;
7
+ duration?: number;
8
+ yRange?: readonly [number, number];
9
+ labels: Readonly<{
10
+ coordinates: readonly [string, string, string, string];
11
+ preview: string;
12
+ curve: string;
13
+ decrement: string;
14
+ increment: string;
15
+ }>;
16
+ formatCoordinate: (value: number) => string;
17
+ }>;
18
+ export declare function BezierEditor(props: BezierEditorProps): import("react").JSX.Element;
19
+ export type ShortcutRecorderProps = Readonly<{
20
+ value: Shortcut | null;
21
+ onRegister: (shortcut: Shortcut) => void | Promise<void>;
22
+ platform: "mac" | "windows" | "linux";
23
+ conflicts?: readonly string[];
24
+ reserved?: readonly string[];
25
+ disabled?: boolean;
26
+ formatShortcut: (shortcut: Shortcut) => string;
27
+ labels: Readonly<{
28
+ record: string;
29
+ recording: string;
30
+ empty: string;
31
+ register: string;
32
+ cancel: string;
33
+ error: string;
34
+ status: (status: ShortcutCapture["status"]) => string;
35
+ }>;
36
+ }>;
37
+ export declare function ShortcutRecorder(props: ShortcutRecorderProps): import("react").JSX.Element;
38
+ //# sourceMappingURL=authoring-tools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authoring-tools.d.ts","sourceRoot":"","sources":["../src/authoring-tools.tsx"],"names":[],"mappings":"AAEA,OAAO,EAA0C,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAM9J,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACxC,KAAK,EAAE,iBAAiB,CAAC;IAAC,aAAa,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAClH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtD,MAAM,EAAE,QAAQ,CAAC;QAAE,WAAW,EAAE,SAAS,CAAC,MAAM,EAAC,MAAM,EAAC,MAAM,EAAC,MAAM,CAAC,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChJ,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC5C,CAAC,CAAC;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAgBpD;AACD,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;IAC5C,KAAK,EAAE,QAAQ,GAAC,IAAI,CAAC;IAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAAC,QAAQ,EAAE,KAAK,GAAC,SAAS,GAAC,OAAO,CAAC;IAChH,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAChF,cAAc,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,MAAM,CAAC;IAC/C,MAAM,EAAE,QAAQ,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,CAAC,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,KAAK,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/K,CAAC,CAAC;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,+BAiB5D"}
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { validateBezier, resolveShortcutCapture } from "@hjmds/design-contracts/authoring-tools";
5
+ import { Button } from "./actions.js";
6
+ import { Slider } from "./slider.js";
7
+ import { Stack, Text } from "./layout.js";
8
+ import { useHjmTheme } from "./provider.js";
9
+ import { useCompositionAction } from "./internal/use-composition-action.js";
10
+ export function BezierEditor(props) {
11
+ validateBezier(props.value);
12
+ const range = props.yRange ?? [-2, 2], duration = props.duration ?? 1000;
13
+ 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])
14
+ throw new RangeError("Invalid Bezier preview duration or y range");
15
+ const theme = useHjmTheme(), ball = useRef(null), animation = useRef(null);
16
+ const cancel = () => { animation.current?.cancel(); animation.current = null; };
17
+ useEffect(() => { cancel(); return cancel; }, [...props.value, duration, props.active, props.disabled, theme.environment.reducedMotion]);
18
+ useEffect(() => { const stop = () => { if (document.hidden)
19
+ cancel(); }; document.addEventListener("visibilitychange", stop); return () => document.removeEventListener("visibilitychange", stop); }, []);
20
+ const preview = () => { cancel(); if (props.disabled || theme.environment.reducedMotion || props.active === false || document.hidden)
21
+ return; animation.current = ball.current?.animate([{ transform: "translateX(0)" }, { transform: "translateX(120px)" }], { duration, easing: `cubic-bezier(${props.value.join(",")})`, fill: "forwards" }) ?? null; };
22
+ const [x1, y1, x2, y2] = props.value;
23
+ // Fit the selected controls and both endpoints; the allowed edit range would shrink the default curve.
24
+ const curveMin = Math.min(0, 1, y1, y2), curveMax = Math.max(0, 1, y1, y2);
25
+ return _jsxs(Stack, { gap: "md", children: [_jsxs("svg", { role: "img", "aria-label": props.labels.curve, width: "100%", height: 180, viewBox: `-10 ${100 - curveMax * 100 - 10} 120 ${(curveMax - curveMin) * 100 + 20}`, children: [_jsx("path", { d: "M0 100 L100 0", fill: "none", stroke: "currentColor", opacity: .2 }), _jsx("path", { d: `M0 100 L${x1 * 100} ${100 - y1 * 100} M100 0 L${x2 * 100} ${100 - y2 * 100}`, fill: "none", stroke: "currentColor", opacity: .5 }), _jsx("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 }), _jsx("circle", { cx: x1 * 100, cy: 100 - y1 * 100, r: 3, fill: "currentColor" }), _jsx("circle", { cx: x2 * 100, cy: 100 - y2 * 100, r: 3, fill: "currentColor" })] }), props.value.map((value, index) => _jsx(Slider, { 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]; values[index] = next; props.onValueChange(values); } }, index)), _jsx("div", { "aria-hidden": "true", style: { height: 24, paddingInline: 4, overflow: "hidden" }, children: _jsx("div", { ref: ball, style: { width: 20, height: 20, borderRadius: "50%", background: "currentColor" } }) }), _jsx(Button, { disabled: props.disabled || props.active === false, onClick: preview, children: props.labels.preview })] });
26
+ }
27
+ export function ShortcutRecorder(props) {
28
+ const [recording, setRecording] = useState(false), [draft, setDraft] = useState(null), [status, setStatus] = useState("ignored");
29
+ const action = useCompositionAction(props.disabled), area = useRef(null);
30
+ useEffect(() => { if (recording)
31
+ area.current?.focus(); }, [recording]);
32
+ useEffect(() => { if (props.disabled) {
33
+ setRecording(false);
34
+ setDraft(null);
35
+ } }, [props.disabled]);
36
+ const capture = (event) => {
37
+ if (!recording || props.disabled || action.pending)
38
+ return;
39
+ // Tab keeps standard focus movement; the recorder stops when focus leaves.
40
+ if (event.code === "Tab")
41
+ return;
42
+ event.preventDefault();
43
+ event.stopPropagation();
44
+ 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 } : {}) });
45
+ setStatus(result.status);
46
+ if (result.status === "ready") {
47
+ setDraft(result.shortcut);
48
+ setRecording(false);
49
+ }
50
+ else if (result.status === "cancelled") {
51
+ setRecording(false);
52
+ setDraft(null);
53
+ }
54
+ else if (result.status !== "ignored")
55
+ setDraft(null);
56
+ };
57
+ const register = () => { if (!draft)
58
+ 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")
59
+ return; void action.run("register", () => props.onRegister(current.shortcut)).then(result => { if (result.status === "success") {
60
+ setDraft(null);
61
+ setStatus(null);
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] });
64
+ }
65
+ //# sourceMappingURL=authoring-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autho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AQ,GAAU,CAAA,CAAC,CAAA,IAAI,EAAE,SAAS,IAAE,KAAK,CAAA,CAAC,CAAA,KAAC,MAAM,IAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,GAAE,EAAE,GAAC,YAAY,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 +1 @@
1
- {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../src/calendar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+E,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,MAA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EAAE,6BAA6B,CAAC,OAAO,CAAC,CAAC;IAC9D,aAAa,CAAC,EAAE,mBAAmB,CAAC;IACpC,SAAS,CAAC,EAAE,mBAAmB,CAAC;IAChC,iGAAiG;IACjG,oBAAoB,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,EAAE,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAClG,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,KAAK,SAAS,CAAC;IAC3E,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,gGAAgG;IAChG,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAEH,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,EAAE,UAAU,EAAE,qBAAqB,EAAE,aAAa,EAAE,SAAS,EAC7F,oBAAoB,EAAE,iBAAiB,EAAE,IAAe,EAAE,SAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,aAAa,CAAC,OAAO,CAAC,+BAoFnI"}
package/dist/calendar.js CHANGED
@@ -48,6 +48,7 @@ export function Calendar({ descriptor, composeAccessibleName, previousMonth, nex
48
48
  }, [gridKey, request, autoFocus, active]);
49
49
  const titleId = `hjm-calendar-${useId()}`;
50
50
  return _jsxs("div", { ref: root, className: classNames("hjm-calendar", className), "data-size": size, style: { ...layoutStyle, "--hjm-calendar-cell-size": `${recipe.sizes[size].cellDiameter}px`,
51
+ "--hjm-calendar-indicator-size": `${recipe.sizes[size].indicatorDiameter}px`,
51
52
  "--hjm-calendar-disabled-opacity": recipe.day.disabledOpacity,
52
53
  "--hjm-calendar-outside-opacity": recipe.day.outsideFocusedMonthOpacity }, children: [_jsxs("div", { className: "hjm-calendar__header", children: [previousMonth ? _jsx("button", { type: "button", "aria-label": previousMonth.label, disabled: !descriptor.onFocusedMonthChange, onClick: () => descriptor.onFocusedMonthChange?.(previousMonth.month, "previous"), children: _jsx("span", { "aria-hidden": "true", children: theme?.environment.direction === "rtl" ? "›" : "‹" }) }) : _jsx("span", {}), _jsx("strong", { id: titleId, "aria-live": "polite", "aria-atomic": "true", children: descriptor.monthLabel }), nextMonth ? _jsx("button", { type: "button", "aria-label": nextMonth.label, disabled: !descriptor.onFocusedMonthChange, onClick: () => descriptor.onFocusedMonthChange?.(nextMonth.month, "next"), children: _jsx("span", { "aria-hidden": "true", children: theme?.environment.direction === "rtl" ? "‹" : "›" }) }) : _jsx("span", {})] }), _jsx("div", { className: "hjm-calendar__viewport", children: _jsxs("div", { role: "grid", "aria-labelledby": titleId, className: "hjm-calendar__grid", children: [_jsx("div", { role: "row", className: "hjm-calendar__week", children: descriptor.grid.weekdayLabels.map((label, index) => _jsx("span", { role: "columnheader", className: "hjm-calendar__weekday", children: label }, index)) }), Array.from({ length: cells.length / 7 }, (_, row) => _jsx("div", { role: "row", className: "hjm-calendar__week", children: cells.slice(row * 7, row * 7 + 7).map((cell, column) => "filler" in cell
53
54
  ? _jsx("span", { role: "gridcell", "aria-hidden": "true" }, `filler-${column}`)
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../src/calendar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAgD,MAAM,OAAO,CAAC;AAC9H,OAAO,EACL,cAAc,IAAI,MAAM,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,6BAA6B,EAC3G,2BAA2B,EAAE,2BAA2B,GAGzD,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAA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"react\";\nimport {\n calendarRecipe as recipe, assertIsoCalendarMonth, validateCalendarDescriptor, resolveCalendarGridDescriptor,\n getCalendarNavigationIntent, getCalendarNavigationTarget,\n type CalendarDescriptor, type CalendarSize, type CalendarNavigationIntent,\n type ComposeCalendarAccessibleName, type ResolvedCalendarDateCell,\n} from \"@hjmds/design-contracts/components/calendar\";\nimport { classNames, useControllableState } from \"./internal.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type CalendarMonthAction = Readonly<{ month: string; label: string }>;\nexport type CalendarHandle = Readonly<{ focusDate(date: string): void }>;\nexport type CalendarOverflow = Readonly<{ date: string; intent: CalendarNavigationIntent; overflow: \"before\" | \"after\" }>;\nexport type CalendarProps<Content = unknown> = Readonly<{\n descriptor: CalendarDescriptor<Content>;\n composeAccessibleName: ComposeCalendarAccessibleName<Content>;\n previousMonth?: CalendarMonthAction;\n nextMonth?: CalendarMonthAction;\n /** The product owns adjacent month/date arithmetic. Call focusDate after requesting its page. */\n onNavigateBeyondGrid?: (detail: CalendarOverflow, focusDate: CalendarHandle[\"focusDate\"]) => void;\n renderCellContent?: (cell: ResolvedCalendarDateCell<Content>) => ReactNode;\n size?: CalendarSize;\n autoFocus?: boolean;\n className?: string;\n ref?: Ref<CalendarHandle>;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\n/** Inline single-date grid shared with DatePicker; month data remains product-owned. */\nexport function Calendar<Content>({ descriptor, composeAccessibleName, previousMonth, nextMonth,\n onNavigateBeyondGrid, renderCellContent, size = \"medium\", autoFocus = false, className, layoutStyle, ref }: CalendarProps<Content>) {\n validateCalendarDescriptor(descriptor);\n for (const action of [previousMonth, nextMonth]) {\n if (!action) continue;\n assertIsoCalendarMonth(action.month, \"month action\");\n if (!action.label.trim()) throw new TypeError(\"Calendar month action label must not be empty\");\n }\n const theme = useOptionalHjmTheme();\n const [selected, setSelected] = useControllableState<string | null>({\n ...(descriptor.selectedDate === undefined ? {} : { value: descriptor.selectedDate }),\n defaultValue: descriptor.defaultSelectedDate ?? null,\n ...(descriptor.onSelectionChange ? { onChange: descriptor.onSelectionChange } : {}),\n });\n const cells = resolveCalendarGridDescriptor(descriptor.grid, selected, { composeAccessibleName });\n const dates = cells.filter((cell): cell is ResolvedCalendarDateCell<Content> => !(\"filler\" in cell));\n const initial = dates.find((cell) => cell.isSelected) ?? dates.find((cell) => cell.isToday) ?? dates[0];\n const [focused, setFocused] = useState(initial?.date);\n const active = dates.some((cell) => cell.date === focused) ? focused : initial?.date;\n const root = useRef<HTMLDivElement>(null);\n const pending = useRef<string | undefined>(undefined);\n const [request, setRequest] = useState(0);\n const focusDate = (date: string) => { pending.current = date; setFocused(date); setRequest((value) => value + 1); };\n useImperativeHandle(ref, () => ({ focusDate }), []);\n const gridKey = dates.map((cell) => cell.date).join(\",\");\n const mountedFocus = useRef(false);\n useEffect(() => {\n if (autoFocus && !mountedFocus.current && active) pending.current = active;\n mountedFocus.current = true;\n const date = pending.current;\n if (!date) return;\n // A requested adjacent date may arrive in a later render; retain it until that page exists.\n const button = Array.from(root.current?.querySelectorAll<HTMLButtonElement>(\"[data-date]\") ?? []).find((node) => node.dataset.date === date);\n if (button) { button.focus(); setFocused(date); pending.current = undefined; }\n }, [gridKey, request, autoFocus, active]);\n const titleId = `hjm-calendar-${useId()}`;\n return <div ref={root} className={classNames(\"hjm-calendar\", className)} data-size={size}\n style={{ ...layoutStyle, \"--hjm-calendar-cell-size\": `${recipe.sizes[size].cellDiameter}px`,\n \"--hjm-calendar-disabled-opacity\": recipe.day.disabledOpacity,\n \"--hjm-calendar-outside-opacity\": recipe.day.outsideFocusedMonthOpacity } as CSSProperties}>\n <div className=\"hjm-calendar__header\">\n {previousMonth ? <button type=\"button\" aria-label={previousMonth.label} disabled={!descriptor.onFocusedMonthChange}\n onClick={() => descriptor.onFocusedMonthChange?.(previousMonth.month, \"previous\")}><span aria-hidden=\"true\">{theme?.environment.direction === \"rtl\" ? \"›\" : \"‹\"}</span></button> : <span />}\n <strong id={titleId} aria-live=\"polite\" aria-atomic=\"true\">{descriptor.monthLabel}</strong>\n {nextMonth ? <button type=\"button\" aria-label={nextMonth.label} disabled={!descriptor.onFocusedMonthChange}\n onClick={() => descriptor.onFocusedMonthChange?.(nextMonth.month, \"next\")}><span aria-hidden=\"true\">{theme?.environment.direction === \"rtl\" ? \"‹\" : \"›\"}</span></button> : <span />}\n </div>\n <div className=\"hjm-calendar__viewport\">\n <div role=\"grid\" aria-labelledby={titleId} className=\"hjm-calendar__grid\">\n <div role=\"row\" className=\"hjm-calendar__week\">\n {descriptor.grid.weekdayLabels.map((label, index) => <span role=\"columnheader\" className=\"hjm-calendar__weekday\" key={index}>{label}</span>)}\n </div>\n {Array.from({ length: cells.length / 7 }, (_, row) => <div role=\"row\" className=\"hjm-calendar__week\" key={row}>\n {cells.slice(row * 7, row * 7 + 7).map((cell, column) => \"filler\" in cell\n ? <span role=\"gridcell\" aria-hidden=\"true\" key={`filler-${column}`} />\n : <button type=\"button\" role=\"gridcell\" key={cell.date} className=\"hjm-calendar__day\"\n data-date={cell.date} data-focus-date={cell.date === active || undefined}\n data-today={cell.isToday || undefined} data-selected={cell.isSelected || undefined}\n data-disabled={!cell.selectable || undefined} data-outside={cell.outsideFocusedMonth || undefined}\n aria-label={cell.accessibleName} aria-selected={cell.isSelected} aria-disabled={!cell.selectable || undefined}\n aria-current={cell.isToday ? \"date\" : undefined} tabIndex={cell.date === active ? 0 : -1}\n onFocus={() => setFocused(cell.date)} onClick={() => {\n if (!cell.selectable) return;\n // Range completion and DatePicker confirmation still need activation\n // when the date already equals Calendar's single selected value.\n if (cell.date === selected) descriptor.onSelectionChange?.(cell.date);\n else setSelected(cell.date);\n }}\n onKeyDown={(event) => {\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n const intent = getCalendarNavigationIntent(event.key as Parameters<typeof getCalendarNavigationIntent>[0], theme?.environment.direction ?? \"ltr\");\n if (!intent) return;\n event.preventDefault();\n const target = getCalendarNavigationTarget(descriptor.grid, cell.date, intent);\n if (target.date) focusDate(target.date);\n else if (target.overflow) onNavigateBeyondGrid?.({ date: cell.date, intent, overflow: target.overflow }, focusDate);\n }}>\n <span aria-hidden=\"true\" className=\"hjm-calendar__day-label\">{Number(cell.date.slice(-2))}</span>\n {renderCellContent ? <span aria-hidden=\"true\" className=\"hjm-calendar__content\">{renderCellContent(cell)}</span> : null}\n </button>)}\n </div>)}\n </div>\n </div>\n </div>;\n}\n"]}
1
+ {"version":3,"file":"calendar.js","sourceRoot":"","sources":["../src/calendar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAgD,MAAM,OAAO,CAAC;AAC9H,OAAO,EACL,cAAc,IAAI,MAAM,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,6BAA6B,EAC3G,2BAA2B,EAAE,2BAA2B,GAGzD,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAsBpD,wFAAwF;AACxF,MAAM,UAAU,QAAQ,CAAU,EAAE,UAAU,EAAE,qBAAqB,EAAE,aAAa,EAAE,SAAS,EAC7F,oBAAoB,EAAE,iBAAiB,EAAE,IAAI,GAAG,QAAQ,EAAE,SAAS,GAAG,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,EAA0B;IAClI,0BAA0B,CAAC,UAAU,CAAC,CAAC;IACvC,KAAK,MAAM,MAAM,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,EAAE,CAAC;QAChD,IAAI,CAAC,MAAM;YAAE,SAAS;QACtB,sBAAsB,CAAC,MAAM,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QACrD,IAAI,CAAC,MAAM,CAAC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pB,KAAK,CAAC,cAAc,EAAE,CAAC;wCACvB,MAAM,MAAM,GAAG,2BAA2B,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;wCAC/E,IAAI,MAAM,CAAC,IAAI;4CAAE,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;6CACnC,IAAI,MAAM,CAAC,QAAQ;4CAAE,oBAAoB,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,CAAC,CAAC;oCACtH,CAAC,aACD,8BAAkB,MAAM,EAAC,SAAS,EAAC,yBAAyB,YAAE,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAQ,EAChG,iBAAiB,CAAC,CAAC,CAAC,8BAAkB,MAAM,EAAC,SAAS,EAAC,uBAAuB,YAAE,iBAAiB,CAAC,IAAI,CAAC,GAAQ,CAAC,CAAC,CAAC,IAAI,KAvB5E,IAAI,CAAC,IAAI,CAwB7C,CAAC,IA3B4F,GAAG,CA4BvG,CAAC,IACH,GACF,IACF,CAAC;AACT,CAAC","sourcesContent":["import { useEffect, useId, useImperativeHandle, useRef, useState, type CSSProperties, type ReactNode, type Ref } from \"react\";\nimport {\n calendarRecipe as recipe, assertIsoCalendarMonth, validateCalendarDescriptor, resolveCalendarGridDescriptor,\n getCalendarNavigationIntent, getCalendarNavigationTarget,\n type CalendarDescriptor, type CalendarSize, type CalendarNavigationIntent,\n type ComposeCalendarAccessibleName, type ResolvedCalendarDateCell,\n} from \"@hjmds/design-contracts/components/calendar\";\nimport { classNames, useControllableState } from \"./internal.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type CalendarMonthAction = Readonly<{ month: string; label: string }>;\nexport type CalendarHandle = Readonly<{ focusDate(date: string): void }>;\nexport type CalendarOverflow = Readonly<{ date: string; intent: CalendarNavigationIntent; overflow: \"before\" | \"after\" }>;\nexport type CalendarProps<Content = unknown> = Readonly<{\n descriptor: CalendarDescriptor<Content>;\n composeAccessibleName: ComposeCalendarAccessibleName<Content>;\n previousMonth?: CalendarMonthAction;\n nextMonth?: CalendarMonthAction;\n /** The product owns adjacent month/date arithmetic. Call focusDate after requesting its page. */\n onNavigateBeyondGrid?: (detail: CalendarOverflow, focusDate: CalendarHandle[\"focusDate\"]) => void;\n renderCellContent?: (cell: ResolvedCalendarDateCell<Content>) => ReactNode;\n size?: CalendarSize;\n autoFocus?: boolean;\n className?: string;\n ref?: Ref<CalendarHandle>;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\n/** Inline single-date grid shared with DatePicker; month data remains product-owned. */\nexport function Calendar<Content>({ descriptor, composeAccessibleName, previousMonth, nextMonth,\n onNavigateBeyondGrid, renderCellContent, size = \"medium\", autoFocus = false, className, layoutStyle, ref }: CalendarProps<Content>) {\n validateCalendarDescriptor(descriptor);\n for (const action of [previousMonth, nextMonth]) {\n if (!action) continue;\n assertIsoCalendarMonth(action.month, \"month action\");\n if (!action.label.trim()) throw new TypeError(\"Calendar month action label must not be empty\");\n }\n const theme = useOptionalHjmTheme();\n const [selected, setSelected] = useControllableState<string | null>({\n ...(descriptor.selectedDate === undefined ? {} : { value: descriptor.selectedDate }),\n defaultValue: descriptor.defaultSelectedDate ?? null,\n ...(descriptor.onSelectionChange ? { onChange: descriptor.onSelectionChange } : {}),\n });\n const cells = resolveCalendarGridDescriptor(descriptor.grid, selected, { composeAccessibleName });\n const dates = cells.filter((cell): cell is ResolvedCalendarDateCell<Content> => !(\"filler\" in cell));\n const initial = dates.find((cell) => cell.isSelected) ?? dates.find((cell) => cell.isToday) ?? dates[0];\n const [focused, setFocused] = useState(initial?.date);\n const active = dates.some((cell) => cell.date === focused) ? focused : initial?.date;\n const root = useRef<HTMLDivElement>(null);\n const pending = useRef<string | undefined>(undefined);\n const [request, setRequest] = useState(0);\n const focusDate = (date: string) => { pending.current = date; setFocused(date); setRequest((value) => value + 1); };\n useImperativeHandle(ref, () => ({ focusDate }), []);\n const gridKey = dates.map((cell) => cell.date).join(\",\");\n const mountedFocus = useRef(false);\n useEffect(() => {\n if (autoFocus && !mountedFocus.current && active) pending.current = active;\n mountedFocus.current = true;\n const date = pending.current;\n if (!date) return;\n // A requested adjacent date may arrive in a later render; retain it until that page exists.\n const button = Array.from(root.current?.querySelectorAll<HTMLButtonElement>(\"[data-date]\") ?? []).find((node) => node.dataset.date === date);\n if (button) { button.focus(); setFocused(date); pending.current = undefined; }\n }, [gridKey, request, autoFocus, active]);\n const titleId = `hjm-calendar-${useId()}`;\n return <div ref={root} className={classNames(\"hjm-calendar\", className)} data-size={size}\n style={{ ...layoutStyle, \"--hjm-calendar-cell-size\": `${recipe.sizes[size].cellDiameter}px`,\n \"--hjm-calendar-indicator-size\": `${recipe.sizes[size].indicatorDiameter}px`,\n \"--hjm-calendar-disabled-opacity\": recipe.day.disabledOpacity,\n \"--hjm-calendar-outside-opacity\": recipe.day.outsideFocusedMonthOpacity } as CSSProperties}>\n <div className=\"hjm-calendar__header\">\n {previousMonth ? <button type=\"button\" aria-label={previousMonth.label} disabled={!descriptor.onFocusedMonthChange}\n onClick={() => descriptor.onFocusedMonthChange?.(previousMonth.month, \"previous\")}><span aria-hidden=\"true\">{theme?.environment.direction === \"rtl\" ? \"›\" : \"‹\"}</span></button> : <span />}\n <strong id={titleId} aria-live=\"polite\" aria-atomic=\"true\">{descriptor.monthLabel}</strong>\n {nextMonth ? <button type=\"button\" aria-label={nextMonth.label} disabled={!descriptor.onFocusedMonthChange}\n onClick={() => descriptor.onFocusedMonthChange?.(nextMonth.month, \"next\")}><span aria-hidden=\"true\">{theme?.environment.direction === \"rtl\" ? \"‹\" : \"›\"}</span></button> : <span />}\n </div>\n <div className=\"hjm-calendar__viewport\">\n <div role=\"grid\" aria-labelledby={titleId} className=\"hjm-calendar__grid\">\n <div role=\"row\" className=\"hjm-calendar__week\">\n {descriptor.grid.weekdayLabels.map((label, index) => <span role=\"columnheader\" className=\"hjm-calendar__weekday\" key={index}>{label}</span>)}\n </div>\n {Array.from({ length: cells.length / 7 }, (_, row) => <div role=\"row\" className=\"hjm-calendar__week\" key={row}>\n {cells.slice(row * 7, row * 7 + 7).map((cell, column) => \"filler\" in cell\n ? <span role=\"gridcell\" aria-hidden=\"true\" key={`filler-${column}`} />\n : <button type=\"button\" role=\"gridcell\" key={cell.date} className=\"hjm-calendar__day\"\n data-date={cell.date} data-focus-date={cell.date === active || undefined}\n data-today={cell.isToday || undefined} data-selected={cell.isSelected || undefined}\n data-disabled={!cell.selectable || undefined} data-outside={cell.outsideFocusedMonth || undefined}\n aria-label={cell.accessibleName} aria-selected={cell.isSelected} aria-disabled={!cell.selectable || undefined}\n aria-current={cell.isToday ? \"date\" : undefined} tabIndex={cell.date === active ? 0 : -1}\n onFocus={() => setFocused(cell.date)} onClick={() => {\n if (!cell.selectable) return;\n // Range completion and DatePicker confirmation still need activation\n // when the date already equals Calendar's single selected value.\n if (cell.date === selected) descriptor.onSelectionChange?.(cell.date);\n else setSelected(cell.date);\n }}\n onKeyDown={(event) => {\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n const intent = getCalendarNavigationIntent(event.key as Parameters<typeof getCalendarNavigationIntent>[0], theme?.environment.direction ?? \"ltr\");\n if (!intent) return;\n event.preventDefault();\n const target = getCalendarNavigationTarget(descriptor.grid, cell.date, intent);\n if (target.date) focusDate(target.date);\n else if (target.overflow) onNavigateBeyondGrid?.({ date: cell.date, intent, overflow: target.overflow }, focusDate);\n }}>\n <span aria-hidden=\"true\" className=\"hjm-calendar__day-label\">{Number(cell.date.slice(-2))}</span>\n {renderCellContent ? <span aria-hidden=\"true\" className=\"hjm-calendar__content\">{renderCellContent(cell)}</span> : null}\n </button>)}\n </div>)}\n </div>\n </div>\n </div>;\n}\n"]}
@@ -0,0 +1,157 @@
1
+ import { type ReactNode } from "react";
2
+ import { type PieVisibilitySummary, type ChartBarLayout, type ChartCurve, type ChartOrientation, type ChartSeries, type ScatterDatum } from "@hjmds/design-contracts/components/chart";
3
+ import type { HjmCompositionStyleProp } from "./composition-style.js";
4
+ type FocusDetail = Readonly<{
5
+ scrubbing: boolean;
6
+ }>;
7
+ type FocusProps = Readonly<{
8
+ /** Controlled focused category; `null` shows no focus. */
9
+ focusIndex?: number | null;
10
+ defaultFocusIndex?: number | null;
11
+ onFocusChange?: (index: number | null, detail: FocusDetail) => void;
12
+ /** Keep the scrubbed point after release instead of returning to the default (Native parity, 2026-10-14). */
13
+ holdOnRelease?: boolean;
14
+ }>;
15
+ type ChartRootProps = Readonly<{
16
+ className?: string;
17
+ /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */
18
+ layoutStyle?: HjmCompositionStyleProp;
19
+ }>;
20
+ type CartesianCommon = ChartRootProps & Readonly<{
21
+ categories: readonly string[];
22
+ series: readonly ChartSeries[];
23
+ /** Accessible name (Web `aria-label`). Product-localized. */
24
+ accessibilityLabel: string;
25
+ formatValue: (value: number) => string;
26
+ /** Spoken/written for a missing observation in the text alternative. */
27
+ missingLabel: string;
28
+ height?: number;
29
+ /** Width used on the server and before the first ResizeObserver measurement. */
30
+ width?: number;
31
+ domain?: readonly [number, number];
32
+ showAxis?: boolean;
33
+ }>;
34
+ export type LineChartProps = CartesianCommon & FocusProps & Readonly<{
35
+ curve?: ChartCurve;
36
+ /** Gradient area under each line. Defaults to on for a single series. */
37
+ area?: boolean;
38
+ stacked?: boolean;
39
+ /** Smallest value on top (ranks, ERA). */
40
+ invert?: boolean;
41
+ includeZero?: boolean;
42
+ /** Dashed horizontal reference line; `"first"` uses the first observation (previous close). */
43
+ referenceValue?: number | "first";
44
+ /** Labels for the first series' high/low markers, shown while not scrubbing. */
45
+ extremes?: Readonly<{
46
+ high: string;
47
+ low: string;
48
+ }>;
49
+ /** Bubble text above the cursor while scrubbing; defaults to the category. */
50
+ cursorLabel?: (index: number) => string;
51
+ /** Morph actual data changes; reduced motion snaps immediately. */
52
+ animateChanges?: boolean;
53
+ /** Keep the chosen side in series color; mute the other side. */
54
+ scrubEmphasis?: "before" | "after";
55
+ /** Value labels only (rank charts: "1위" at the top). */
56
+ valueAxis?: boolean;
57
+ /** Overrides grid/label ticks. */
58
+ ticks?: readonly number[];
59
+ }>;
60
+ export declare function LineChart({ categories, series, accessibilityLabel, formatValue, missingLabel, height, width: fallbackWidth, curve, area, stacked, invert, domain, includeZero, referenceValue, extremes, showAxis, valueAxis, ticks: tickOverride, cursorLabel, animateChanges, scrubEmphasis, className, layoutStyle, ...focusProps }: LineChartProps): import("react").JSX.Element;
61
+ export type BarChartProps = CartesianCommon & FocusProps & Readonly<{
62
+ orientation?: ChartOrientation;
63
+ layout?: ChartBarLayout;
64
+ /** Value label at each bar end (the stack total for stacked bars). */
65
+ showValues?: boolean;
66
+ animateChanges?: boolean;
67
+ }>;
68
+ export declare function BarChart({ categories, series, accessibilityLabel, formatValue, missingLabel, height, width: fallbackWidth, orientation, layout, domain, showAxis, showValues, animateChanges, className, layoutStyle, ...focusProps }: BarChartProps): import("react").JSX.Element;
69
+ export type ChartLegendItem = Readonly<{
70
+ id: string;
71
+ label: string;
72
+ color: string;
73
+ value?: string;
74
+ }>;
75
+ export type ChartLegendProps = ChartRootProps & Readonly<{
76
+ items: readonly ChartLegendItem[];
77
+ exclusion?: Readonly<{
78
+ excludedIds: readonly string[];
79
+ onToggle: (id: string) => void;
80
+ label: (item: ChartLegendItem, included: boolean) => string;
81
+ }>;
82
+ selectedId?: string | null;
83
+ /** When given, rows are toggle buttons; pressing the selected row clears the selection. */
84
+ onSelect?: (id: string | null) => void;
85
+ }>;
86
+ /** Swatch + label (+ value). Color is never the only encoding: every row carries its label. */
87
+ export declare function ChartLegend({ items, selectedId, onSelect, exclusion, className, layoutStyle }: ChartLegendProps): import("react").JSX.Element;
88
+ export type PieDatum = Readonly<{
89
+ id: string;
90
+ label: string;
91
+ value: number | null;
92
+ color?: string;
93
+ }>;
94
+ export type PieChartProps = ChartRootProps & Readonly<{
95
+ data: readonly PieDatum[];
96
+ accessibilityLabel: string;
97
+ formatValue: (value: number) => string;
98
+ donut?: boolean;
99
+ size?: number;
100
+ /** Rendered in the donut hole (ignored for a full pie). */
101
+ centerContent?: ReactNode | ((summary: PieVisibilitySummary) => ReactNode);
102
+ /** Controlled denominator filtering, independent of selectedId emphasis. */
103
+ exclusion?: Readonly<{
104
+ excludedIds: readonly string[];
105
+ onExcludedIdsChange: (ids: readonly string[]) => void;
106
+ label: (datum: PieDatum, included: boolean) => string;
107
+ }>;
108
+ selectedId?: string | null;
109
+ defaultSelectedId?: string | null;
110
+ onSelect?: (id: string | null) => void;
111
+ showLegend?: boolean;
112
+ }>;
113
+ export declare function PieChart({ data, accessibilityLabel, formatValue, donut, size, centerContent, selectedId, defaultSelectedId, onSelect, showLegend, exclusion, className, layoutStyle, }: PieChartProps): import("react").JSX.Element;
114
+ export type RadarChartProps = ChartRootProps & Readonly<{
115
+ /** At least three axes. */
116
+ categories: readonly string[];
117
+ series: readonly ChartSeries[];
118
+ accessibilityLabel: string;
119
+ formatValue: (value: number) => string;
120
+ missingLabel: string;
121
+ /** One shared domain for every axis; defaults to 0..max. */
122
+ domain?: readonly [number, number];
123
+ levels?: number;
124
+ size?: number;
125
+ /** Defaults to on for more than one series. */
126
+ showLegend?: boolean;
127
+ }>;
128
+ export declare function RadarChart({ categories, series, accessibilityLabel, formatValue, missingLabel, domain, levels, size, showLegend, className, layoutStyle, }: RadarChartProps): import("react").JSX.Element;
129
+ export type ScatterChartProps = ChartRootProps & Readonly<{
130
+ points: readonly ScatterDatum[];
131
+ accessibilityLabel: string;
132
+ xLabel: string;
133
+ yLabel: string;
134
+ formatX: (value: number) => string;
135
+ formatY: (value: number) => string;
136
+ height?: number;
137
+ /** Width used on the server and before the first ResizeObserver measurement. */
138
+ width?: number;
139
+ /** Legend labels by `seriesIndex`; the legend shows for two or more. */
140
+ seriesLabels?: readonly string[];
141
+ focusId?: string | null;
142
+ onFocusChange?: (id: string | null) => void;
143
+ }>;
144
+ export declare function ScatterChart({ points, accessibilityLabel, xLabel, yLabel, formatX, formatY, height, width: fallbackWidth, seriesLabels, focusId, onFocusChange, className, layoutStyle, }: ScatterChartProps): import("react").JSX.Element;
145
+ export type SparklineProps = ChartRootProps & Readonly<{
146
+ values: readonly (number | null)[];
147
+ color?: string;
148
+ invert?: boolean;
149
+ domain?: readonly [number, number];
150
+ width?: number;
151
+ height?: number;
152
+ /** Omit when the adjacent text already states the value; the sparkline is then decorative. */
153
+ accessibilityLabel?: string;
154
+ }>;
155
+ export declare function Sparkline({ values, color, invert, domain, width, height, accessibilityLabel, className, layoutStyle, }: SparklineProps): import("react").JSX.Element;
156
+ export {};
157
+ //# sourceMappingURL=chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../src/chart.tsx"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,OAAO,EAYqC,KAAK,oBAAoB,EAUnE,KAAK,cAAc,EACnB,KAAK,UAAU,EAEf,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,0CAA0C,CAAC;AAIlD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAsEtE,KAAK,WAAW,GAAG,QAAQ,CAAC;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AACpD,KAAK,UAAU,GAAG,QAAQ,CAAC;IACzB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM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