@hjmds/react 1.13.1 → 1.15.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 (127) hide show
  1. package/dist/agreement.d.ts.map +1 -1
  2. package/dist/agreement.js +5 -3
  3. package/dist/agreement.js.map +1 -1
  4. package/dist/asset.d.ts.map +1 -1
  5. package/dist/asset.js +4 -1
  6. package/dist/asset.js.map +1 -1
  7. package/dist/clipboard.d.ts.map +1 -1
  8. package/dist/clipboard.js +39 -5
  9. package/dist/clipboard.js.map +1 -1
  10. package/dist/code-block.d.ts.map +1 -1
  11. package/dist/code-block.js +3 -1
  12. package/dist/code-block.js.map +1 -1
  13. package/dist/collapsible.d.ts +4 -0
  14. package/dist/collapsible.d.ts.map +1 -1
  15. package/dist/collapsible.js +4 -4
  16. package/dist/collapsible.js.map +1 -1
  17. package/dist/command-palette.d.ts.map +1 -1
  18. package/dist/command-palette.js +3 -1
  19. package/dist/command-palette.js.map +1 -1
  20. package/dist/content-transition.d.ts +7 -3
  21. package/dist/content-transition.d.ts.map +1 -1
  22. package/dist/content-transition.js +47 -3
  23. package/dist/content-transition.js.map +1 -1
  24. package/dist/context-menu.d.ts.map +1 -1
  25. package/dist/context-menu.js +3 -1
  26. package/dist/context-menu.js.map +1 -1
  27. package/dist/date-entry.d.ts +9 -0
  28. package/dist/date-entry.d.ts.map +1 -0
  29. package/dist/date-entry.js +13 -0
  30. package/dist/date-entry.js.map +1 -0
  31. package/dist/design-profile.d.ts +18 -0
  32. package/dist/design-profile.d.ts.map +1 -0
  33. package/dist/design-profile.js +27 -0
  34. package/dist/design-profile.js.map +1 -0
  35. package/dist/document-resource.d.ts +3 -0
  36. package/dist/document-resource.d.ts.map +1 -0
  37. package/dist/document-resource.js +2 -0
  38. package/dist/document-resource.js.map +1 -0
  39. package/dist/effect-surface.d.ts.map +1 -1
  40. package/dist/effect-surface.js +2 -2
  41. package/dist/effect-surface.js.map +1 -1
  42. package/dist/evidence.d.ts +1 -1
  43. package/dist/evidence.js +1 -1
  44. package/dist/evidence.js.map +1 -1
  45. package/dist/field-group.d.ts +22 -0
  46. package/dist/field-group.d.ts.map +1 -0
  47. package/dist/field-group.js +20 -0
  48. package/dist/field-group.js.map +1 -0
  49. package/dist/floating-action-button.d.ts +1 -1
  50. package/dist/forms.d.ts +1 -0
  51. package/dist/forms.d.ts.map +1 -1
  52. package/dist/forms.js +5 -3
  53. package/dist/forms.js.map +1 -1
  54. package/dist/heading.d.ts.map +1 -1
  55. package/dist/heading.js +3 -1
  56. package/dist/heading.js.map +1 -1
  57. package/dist/image-comparison.d.ts +12 -0
  58. package/dist/image-comparison.d.ts.map +1 -0
  59. package/dist/image-comparison.js +14 -0
  60. package/dist/image-comparison.js.map +1 -0
  61. package/dist/internal/document-resource.d.ts +9 -0
  62. package/dist/internal/document-resource.d.ts.map +1 -0
  63. package/dist/internal/document-resource.js +37 -0
  64. package/dist/internal/document-resource.js.map +1 -0
  65. package/dist/internal/overlay-origin-motion.d.ts +13 -0
  66. package/dist/internal/overlay-origin-motion.d.ts.map +1 -0
  67. package/dist/internal/overlay-origin-motion.js +76 -0
  68. package/dist/internal/overlay-origin-motion.js.map +1 -0
  69. package/dist/internal.d.ts +54 -0
  70. package/dist/internal.d.ts.map +1 -1
  71. package/dist/internal.js +7 -1
  72. package/dist/internal.js.map +1 -1
  73. package/dist/layout.d.ts.map +1 -1
  74. package/dist/layout.js +6 -3
  75. package/dist/layout.js.map +1 -1
  76. package/dist/menubar.d.ts.map +1 -1
  77. package/dist/menubar.js +3 -1
  78. package/dist/menubar.js.map +1 -1
  79. package/dist/navigation.d.ts.map +1 -1
  80. package/dist/navigation.js +30 -9
  81. package/dist/navigation.js.map +1 -1
  82. package/dist/overlays.d.ts +3 -0
  83. package/dist/overlays.d.ts.map +1 -1
  84. package/dist/overlays.js +16 -12
  85. package/dist/overlays.js.map +1 -1
  86. package/dist/popover.d.ts +3 -0
  87. package/dist/popover.d.ts.map +1 -1
  88. package/dist/popover.js +11 -5
  89. package/dist/popover.js.map +1 -1
  90. package/dist/portal.d.ts +3 -1
  91. package/dist/portal.d.ts.map +1 -1
  92. package/dist/portal.js +5 -2
  93. package/dist/portal.js.map +1 -1
  94. package/dist/progressive-blur.d.ts +7 -0
  95. package/dist/progressive-blur.d.ts.map +1 -0
  96. package/dist/progressive-blur.js +20 -0
  97. package/dist/progressive-blur.js.map +1 -0
  98. package/dist/provider.d.ts +4 -0
  99. package/dist/provider.d.ts.map +1 -1
  100. package/dist/provider.js +5 -2
  101. package/dist/provider.js.map +1 -1
  102. package/dist/rating.d.ts +19 -0
  103. package/dist/rating.d.ts.map +1 -0
  104. package/dist/rating.js +34 -0
  105. package/dist/rating.js.map +1 -0
  106. package/dist/screens.d.ts +7 -2
  107. package/dist/screens.d.ts.map +1 -1
  108. package/dist/screens.js +20 -7
  109. package/dist/screens.js.map +1 -1
  110. package/dist/selection.d.ts +4 -0
  111. package/dist/selection.d.ts.map +1 -1
  112. package/dist/selection.js +48 -3
  113. package/dist/selection.js.map +1 -1
  114. package/dist/styles.css +69 -9
  115. package/dist/styles.layered.css +69 -9
  116. package/dist/task-list.d.ts +6 -1
  117. package/dist/task-list.d.ts.map +1 -1
  118. package/dist/task-list.js +8 -3
  119. package/dist/task-list.js.map +1 -1
  120. package/dist/text-annotation.d.ts +10 -0
  121. package/dist/text-annotation.d.ts.map +1 -0
  122. package/dist/text-annotation.js +107 -0
  123. package/dist/text-annotation.js.map +1 -0
  124. package/dist/theme.d.ts.map +1 -1
  125. package/dist/theme.js +28 -7
  126. package/dist/theme.js.map +1 -1
  127. package/package.json +38 -3
package/dist/rating.js ADDED
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useRef } from "react";
3
+ import { resolveRating } from "@hjmds/design-contracts/reference-controls";
4
+ import { Button } from "./actions.js";
5
+ function Star({ fraction }) {
6
+ return _jsxs("span", { "aria-hidden": "true", style: { pointerEvents: "none", position: "relative", display: "inline-block", fontSize: "1.75em", lineHeight: 1, color: "var(--hjm-color-content-brand, currentColor)" }, children: [_jsx("span", { children: "\u2606" }), _jsx("span", { style: { position: "absolute", inset: 0, width: `${fraction * 100}%`, overflow: "hidden" }, children: "\u2605" })] });
7
+ }
8
+ /** Controlled score input, with a distinct non-interactive average representation. */
9
+ export function Rating(props) {
10
+ const { label, value, readOnly = false, disabled = false, getValueLabel, clearLabel, name, layoutStyle } = props;
11
+ const { max, fractions } = resolveRating(props);
12
+ const id = useId();
13
+ const firstOption = useRef(null);
14
+ const valueLabel = getValueLabel(value);
15
+ if (!valueLabel.trim() || (clearLabel !== undefined && !clearLabel.trim()))
16
+ throw new TypeError("Rating text must not be empty");
17
+ const row = { display: "flex", flexWrap: "wrap", gap: "var(--hjm-space-xs)" };
18
+ if (readOnly)
19
+ return _jsxs("div", { role: "img", "aria-label": `${label}: ${valueLabel}`, style: { ...row, ...layoutStyle }, children: [fractions.map((fraction, index) => _jsx(Star, { fraction: fraction }, index)), _jsx("span", { "aria-hidden": "true", children: valueLabel })] });
20
+ return _jsxs("fieldset", { className: "hjm-rating-control", disabled: disabled, style: { border: 0, margin: 0, padding: 0, minWidth: 0, ...layoutStyle }, children: [_jsx("legend", { children: label }), _jsx("div", { style: row, children: Array.from({ length: max }, (_, index) => {
21
+ const score = index + 1;
22
+ const optionLabel = getValueLabel(score);
23
+ if (!optionLabel.trim())
24
+ throw new TypeError("Rating option text must not be empty");
25
+ return _jsxs("label", { className: "hjm-rating__option", children: [_jsx("input", { ref: index === 0 ? firstOption : undefined, type: "radio", name: name ?? id, value: score, checked: value === score, "aria-label": optionLabel, onChange: () => { if (!disabled)
26
+ props.onValueChange?.(score); } }), _jsx(Star, { fraction: fractions[index] })] }, score);
27
+ }) }), _jsx("div", { role: "status", children: valueLabel }), clearLabel ? _jsx(Button, { tone: "ghost", disabled: disabled || value === null, onClick: () => {
28
+ // Clearing disables this button. Move focus before the controlled update so
29
+ // keyboard users can choose again instead of losing their place to body.
30
+ firstOption.current?.focus();
31
+ props.onValueChange?.(null);
32
+ }, children: clearLabel }) : null] });
33
+ }
34
+ //# sourceMappingURL=rating.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rating.js","sourceRoot":"","sources":["../src/rating.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAsB,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAyB,MAAM,4CAA4C,CAAC;AAClG,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAUtC,SAAS,IAAI,CAAC,EAAE,QAAQ,EAAwB;IAC9C,OAAO,+BAAkB,MAAM,EAAC,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,8CAA8C,EAAE,aACvM,oCAAc,EAAA,eAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,QAAQ,GAAG,GAAG,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,uBAAU,IACnH,CAAC;AACV,CAAC;AACD,sFAAsF;AACtF,MAAM,UAAU,MAAM,CAAC,KAAkB;IACvC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,GAAG,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IACjH,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IACnB,MAAM,WAAW,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,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oBAAoB,aACtD,gBAAO,GAAG,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,EAAE,IAAI,EAAC,OAAO,EAAC,IAAI,EAAE,IAAI,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,KAAK,KAAK,gBAAc,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ;oCAAE,KAAK,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAI,EACvN,KAAC,IAAI,IAAC,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAE,GAAI,KAFpB,KAAK,CAGhB,CAAC;gBACX,CAAC,CAAC,GAAO,EACT,cAAK,IAAI,EAAC,QAAQ,YAAE,UAAU,GAAO,EACpC,UAAU,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,EAAC,QAAQ,EAAE,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE;oBACrF,4EAA4E;oBAC5E,yEAAyE;oBACzE,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;oBAC7B,KAAK,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC;gBAC9B,CAAC,YAAG,UAAU,GAAU,CAAC,CAAC,CAAC,IAAI,IACtB,CAAC;AACd,CAAC","sourcesContent":["import type { HjmCompositionStyleProp } from \"./composition-style.js\";\nimport { useId, useRef, type CSSProperties } from \"react\";\nimport { resolveRating, type RatingDescriptor } from \"@hjmds/design-contracts/reference-controls\";\nimport { Button } from \"./actions.js\";\n\nexport type RatingProps = RatingDescriptor & Readonly<{\n /** Product-localized score and unrated text, also used as the radio name. */\n getValueLabel: (value: number | null) => string;\n disabled?: boolean;\n layoutStyle?: HjmCompositionStyleProp;\n clearLabel?: string;\n name?: string;\n}> & (Readonly<{ readOnly: true; onValueChange?: never }> | Readonly<{ readOnly?: false; onValueChange: (value: number | null) => void }>);\nfunction Star({ fraction }: { fraction: number }) {\n return <span aria-hidden=\"true\" style={{ pointerEvents: \"none\", position: \"relative\", display: \"inline-block\", fontSize: \"1.75em\", lineHeight: 1, color: \"var(--hjm-color-content-brand, currentColor)\" }}>\n <span>☆</span><span style={{ position: \"absolute\", inset: 0, width: `${fraction * 100}%`, overflow: \"hidden\" }}>★</span>\n </span>;\n}\n/** Controlled score input, with a distinct non-interactive average representation. */\nexport function Rating(props: RatingProps) {\n const { label, value, readOnly = false, disabled = false, getValueLabel, clearLabel, name, layoutStyle } = props;\n const { max, fractions } = resolveRating(props);\n const id = useId();\n const firstOption = useRef<HTMLInputElement>(null);\n const valueLabel = getValueLabel(value);\n if (!valueLabel.trim() || (clearLabel !== undefined && !clearLabel.trim())) throw new TypeError(\"Rating text must not be empty\");\n const row: CSSProperties = { display: \"flex\", flexWrap: \"wrap\", gap: \"var(--hjm-space-xs)\" };\n if (readOnly) return <div role=\"img\" aria-label={`${label}: ${valueLabel}`} style={{ ...row, ...layoutStyle }}>{fractions.map((fraction, index) => <Star key={index} fraction={fraction} />)}<span aria-hidden=\"true\">{valueLabel}</span></div>;\n return <fieldset className=\"hjm-rating-control\" disabled={disabled} style={{ border: 0, margin: 0, padding: 0, minWidth: 0, ...layoutStyle }}>\n <legend>{label}</legend>\n <div style={row}>{Array.from({ length: max }, (_, index) => {\n const score = index + 1;\n const optionLabel = getValueLabel(score);\n if (!optionLabel.trim()) throw new TypeError(\"Rating option text must not be empty\");\n return <label key={score} className=\"hjm-rating__option\">\n <input ref={index === 0 ? firstOption : undefined} type=\"radio\" name={name ?? id} value={score} checked={value === score} aria-label={optionLabel} onChange={() => { if (!disabled) props.onValueChange?.(score); }} />\n <Star fraction={fractions[index]!} />\n </label>;\n })}</div>\n <div role=\"status\">{valueLabel}</div>\n {clearLabel ? <Button tone=\"ghost\" disabled={disabled || value === null} onClick={() => {\n // Clearing disables this button. Move focus before the controlled update so\n // keyboard users can choose again instead of losing their place to body.\n firstOption.current?.focus();\n props.onValueChange?.(null);\n }}>{clearLabel}</Button> : null}\n </fieldset>;\n}\n"]}
package/dist/screens.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { type DesignProfileScreenPresentation } from "@hjmds/design-contracts/design-profile-layout";
1
2
  import type { ReactionPickerProps } from "./reaction-picker.js";
2
3
  import { type Ref, type ReactNode } from "react";
3
4
  import { type MessageAttachmentDescriptor, type ChatMessageDescriptor, type MessageComposerDescriptor, type ScreenContentState } from "@hjmds/design-contracts/screen-patterns";
@@ -8,6 +9,8 @@ export type ScreenLayoutProps = Readonly<{
8
9
  /** Preserve host navigation while the shared shell owns content and state. */
9
10
  header?: ReactNode;
10
11
  contentInset?: "default" | "none";
12
+ /** Explicit layout wins over the nearest design profile. */
13
+ presentation?: DesignProfileScreenPresentation;
11
14
  description?: string;
12
15
  leading?: ReactNode;
13
16
  actions?: ReactNode;
@@ -27,7 +30,7 @@ export type ScreenLayoutProps = Readonly<{
27
30
  layoutStyle?: HjmCompositionStyleProp;
28
31
  }>;
29
32
  /** Shared screen shell. Routing, data, permission checks and mutation state remain product-owned. */
30
- export declare function ScreenLayout({ title, header, contentInset, description, leading, actions, notice, footer, state, stateAction, children, scroll, as: Element, className, layoutStyle }: ScreenLayoutProps): import("react").JSX.Element;
33
+ export declare function ScreenLayout({ title, header, contentInset, presentation: suppliedPresentation, description, leading, actions, notice, footer, state, stateAction, children, scroll, as: Element, className, layoutStyle }: ScreenLayoutProps): import("react").JSX.Element;
31
34
  export type SettingsScreenSection = Readonly<{
32
35
  id: string;
33
36
  title: string;
@@ -63,6 +66,8 @@ export type MessageComposerProps = Omit<MessageComposerDescriptor, "attachmentCo
63
66
  additionalContent?: boolean;
64
67
  leadingAction?: ReactNode;
65
68
  inputRef?: Ref<HTMLTextAreaElement>;
69
+ /** Release typing presence when the host input loses focus. */
70
+ onBlur?: () => void;
66
71
  onValueChange(value: string): void;
67
72
  onSend(value: string): void;
68
73
  context?: ReactNode;
@@ -89,7 +94,7 @@ export type MessageComposerProps = Omit<MessageComposerDescriptor, "attachmentCo
89
94
  /** Canonical layout-only placement on the composer root. Controlled visual keys are excluded. */
90
95
  layoutStyle?: HjmCompositionStyleProp;
91
96
  }>;
92
- export declare function MessageComposer({ value, label, sendLabel, disabled, pending, onValueChange, onSend, maxLength, sendDisabled, additionalContent, leadingAction, inputRef, context, replyTo, sendIcon, sendPresentation, attachmentAction, attachments, onRemoveAttachment, layoutStyle }: MessageComposerProps): import("react").JSX.Element;
97
+ export declare function MessageComposer({ value, label, sendLabel, placeholder, description, error, invalid, submitMode, onBlur, disabled, pending, onValueChange, onSend, maxLength, sendDisabled, additionalContent, leadingAction, inputRef, context, replyTo, sendIcon, sendPresentation, attachmentAction, attachments, onRemoveAttachment, layoutStyle }: MessageComposerProps): import("react").JSX.Element;
93
98
  export type ChatMessageProps = ChatMessageDescriptor & Readonly<{
94
99
  children: ReactNode;
95
100
  interactiveContent?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"screens.d.ts","sourceRoot":"","sources":["../src/screens.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,OAAO,EAA2B,KAAK,GAAG,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1E,OAAO,EAA8D,KAAK,2BAA2B,EAAkD,KAAK,qBAAqB,EAAE,KAAK,yBAAyB,EAAE,KAAK,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAI5R,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAE1D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,YAAY,CAAC,EAAE,SAAS,GAAG,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AAC,OAAO,IAAG,IAAI,CAAA;KAAC,CAAC,CAAC;IAAC,SAAS,CAAC,EAAE,mBAAmB,GAAG,QAAQ,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,QAAQ,CAAC;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,OAAO,IAAI,IAAI,CAAC;YAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,CAAC;IAClc,mGAAmG;IACnG,WAAW,CAAC,EAAE,uBAAuB,CAAA;CAAE,CAAC,CAAC;AAC3C,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,kBAAwB,EAAE,WAAW,EAAE,EAAE,gBAAgB,+BAkBxM"}
package/dist/screens.js CHANGED
@@ -1,23 +1,29 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { resolveDesignProfileScreen } from "@hjmds/design-contracts/design-profile-layout";
2
3
  import { MessageReactions } from "./internal/message-reactions.js";
3
4
  import { Button, IconButton } from "./actions.js";
4
5
  import { TextArea } from "./forms.js";
5
6
  import { useId, useRef, useState } from "react";
6
- import { isReplySwipe, canSubmitMessage, validateMessageAttachments, resolveScreenContentState, screenPatternRecipe } from "@hjmds/design-contracts/screen-patterns";
7
+ import { isReplySwipe, shouldSubmitMessageKey, canSubmitMessage, validateMessageAttachments, resolveScreenContentState, screenPatternRecipe } from "@hjmds/design-contracts/screen-patterns";
7
8
  import { Heading } from "./heading.js";
8
9
  import { Spinner } from "./internal/spinner.js";
9
10
  import { Section, Stack, Text } from "./layout.js";
10
11
  import { ListRow } from "./display.js";
11
- import { classNames } from "./internal.js";
12
+ import { classNames, useDesignProfileDefaults } from "./internal.js";
12
13
  /** Shared screen shell. Routing, data, permission checks and mutation state remain product-owned. */
13
- export function ScreenLayout({ title, header, contentInset = "default", description, leading, actions, notice, footer, state = { kind: "ready" }, stateAction, children, scroll = "screen", as: Element = "main", className, layoutStyle }) {
14
+ export function ScreenLayout({ title, header, contentInset = "default", presentation: suppliedPresentation, description, leading, actions, notice, footer, state = { kind: "ready" }, stateAction, children, scroll = "screen", as: Element = "main", className, layoutStyle }) {
14
15
  const id = useId();
16
+ // Screens historically work with the stylesheet alone. Optional context keeps
17
+ // that path while inheriting profiles from an enclosing Provider when present.
18
+ const designProfile = useDesignProfileDefaults();
19
+ const presentation = suppliedPresentation ?? designProfile?.screens.overview;
20
+ const profileLayout = presentation === undefined ? undefined : resolveDesignProfileScreen(presentation);
15
21
  const resolved = resolveScreenContentState(state);
16
22
  // Replacement text owns scrolling even when the ready state delegates it to
17
23
  // a virtual list. Use the rendered mode for keyboard access as well as CSS.
18
24
  const bodyScroll = resolved.replacesContent ? "screen" : scroll;
19
25
  const recipe = screenPatternRecipe;
20
- return _jsxs(Element, { "aria-labelledby": header ? undefined : id, "aria-label": header ? title : undefined, "data-content-inset": contentInset, className: classNames("hjm-screen", className), style: { "--hjm-screen-width": `${recipe.maxWidth}px`, "--hjm-screen-padding": `${contentInset === "none" ? 0 : recipe.padding}px`, "--hjm-screen-gap": `${recipe.sectionGap}px`, "--hjm-screen-item-gap": `${recipe.itemGap}px`, "--hjm-screen-state-gap": `${recipe.stateGap}px`, "--hjm-screen-header-min": `${recipe.headerMinWidth}px`, ...layoutStyle }, children: [header ?? _jsxs("header", { className: "hjm-screen__header", children: [leading, _jsxs("div", { className: "hjm-screen__heading", children: [_jsx(Heading, { level: "level3", semanticLevel: 1, id: id, children: title }), description ? _jsx(Text, { as: "p", tone: "muted", children: description }) : null] }), actions] }), notice ? _jsx("div", { className: "hjm-screen__notice", children: notice }) : null, _jsx("div", { tabIndex: bodyScroll === "content" ? undefined : 0, className: "hjm-screen__body", "data-scroll": bodyScroll, "data-replacement": resolved.replacesContent || undefined, "aria-busy": resolved.busy || undefined, children: state.kind === "ready" ? children : _jsxs("div", { className: "hjm-screen__state", children: [resolved.busy ? _jsx(Spinner, { label: [state.title, state.description].filter(Boolean).join(". ") }) : _jsx("div", { role: state.kind === "error" ? "alert" : "status", children: _jsxs(Stack, { gap: "sm", align: "center", children: [_jsx(Text, { variant: "title", children: state.title }), state.description ? _jsx(Text, { tone: "muted", children: state.description }) : null] }) }), stateAction] }) }), footer ? _jsx("footer", { className: "hjm-screen__footer", children: footer }) : null] });
26
+ return _jsxs(Element, { "aria-labelledby": header ? undefined : id, "aria-label": header ? title : undefined, "data-content-inset": contentInset, "data-presentation": presentation, className: classNames("hjm-screen", className), style: { backgroundColor: designProfile?.material.canvas ? "transparent" : undefined, "--hjm-screen-width": `${profileLayout?.maxWidth ?? recipe.maxWidth}px`, "--hjm-screen-padding": `${contentInset === "none" ? 0 : recipe.padding}px`, "--hjm-screen-gap": `${profileLayout?.gap ?? recipe.sectionGap}px`, "--hjm-screen-item-gap": `${recipe.itemGap}px`, "--hjm-screen-state-gap": `${recipe.stateGap}px`, "--hjm-screen-header-min": `${recipe.headerMinWidth}px`, ...layoutStyle }, children: [header ?? _jsxs("header", { className: "hjm-screen__header", style: profileLayout ? { flexDirection: profileLayout.headerAxis, alignItems: profileLayout.centered ? "center" : undefined, textAlign: profileLayout.centered ? "center" : undefined } : undefined, children: [leading, _jsxs("div", { className: "hjm-screen__heading", children: [_jsx(Heading, { level: "level3", semanticLevel: 1, id: id, children: title }), description ? _jsx(Text, { as: "p", tone: "muted", children: description }) : null] }), actions] }), notice ? _jsx("div", { className: "hjm-screen__notice", children: notice }) : null, _jsx("div", { tabIndex: bodyScroll === "content" ? undefined : 0, className: "hjm-screen__body", "data-scroll": bodyScroll, "data-replacement": resolved.replacesContent || undefined, "aria-busy": resolved.busy || undefined, children: state.kind === "ready" ? children : _jsxs("div", { className: "hjm-screen__state", children: [resolved.busy ? _jsx(Spinner, { label: [state.title, state.description].filter(Boolean).join(". ") }) : _jsx("div", { role: state.kind === "error" ? "alert" : "status", children: _jsxs(Stack, { gap: "sm", align: "center", children: [_jsx(Text, { variant: "title", children: state.title }), state.description ? _jsx(Text, { tone: "muted", children: state.description }) : null] }) }), stateAction] }) }), footer ? _jsx("footer", { className: "hjm-screen__footer", children: footer }) : null] });
21
27
  }
22
28
  export function SettingsScreen({ profile, sections, ...props }) {
23
29
  return _jsx(ScreenLayout, { ...props, children: _jsxs(Stack, { gap: "xl", children: [profile, sections.map(section => _jsx(Section, { className: "hjm-settings-section", title: section.title, description: section.description, children: section.children }, section.id))] }) });
@@ -32,7 +38,7 @@ export function NotificationItem({ read, statusLabel, timestamp, description, ti
32
38
  export function ChatScreen({ composer, scroll = "content", ...props }) {
33
39
  return _jsx(ScreenLayout, { ...props, scroll: scroll, footer: !props.state || props.state.kind === "ready" ? composer : null });
34
40
  }
35
- export function MessageComposer({ value, label, sendLabel, disabled = false, pending = false, onValueChange, onSend, maxLength, sendDisabled = false, additionalContent = false, leadingAction, inputRef, context, replyTo, sendIcon, sendPresentation = "inline", attachmentAction, attachments = [], onRemoveAttachment, layoutStyle }) {
41
+ export function MessageComposer({ value, label, sendLabel, placeholder = label, description, error, invalid = false, submitMode = "newline", onBlur, disabled = false, pending = false, onValueChange, onSend, maxLength, sendDisabled = false, additionalContent = false, leadingAction, inputRef, context, replyTo, sendIcon, sendPresentation = "inline", attachmentAction, attachments = [], onRemoveAttachment, layoutStyle }) {
36
42
  validateMessageAttachments(attachments);
37
43
  if (attachments.length && !onRemoveAttachment)
38
44
  throw new TypeError("Attachments require a removal callback");
@@ -44,8 +50,15 @@ export function MessageComposer({ value, label, sendLabel, disabled = false, pen
44
50
  const send = sendIcon ? _jsx(IconButton, { label: sendLabel, size: sendPresentation === "circle" ? "small" : "medium", shape: "circle", tone: sendPresentation === "circle" ? "primary" : "ghost", disabled: !canSend, loading: pending, onClick: () => { if (canSend)
45
51
  onSend(value); }, children: sendIcon }) : _jsx(Button, { disabled: !canSend, loading: pending, onClick: () => { if (canSend)
46
52
  onSend(value); }, children: sendLabel });
47
- // Enter stays a newline for IME; receipt-driven clearing and failed-send recovery belong to the host.
48
- return _jsxs("div", { className: "hjm-message-composer", "data-send-presentation": sendPresentation, style: { "--hjm-message-composer-gap": `${screenPatternRecipe.itemGap}px`, "--hjm-attachment-size": `${screenPatternRecipe.attachmentSize}px`, "--hjm-attachment-remove-size": `${screenPatternRecipe.attachmentRemoveSize}px`, ...layoutStyle }, children: [context, replyTo ? _jsxs(Stack, { axis: "inline", gap: "sm", align: "center", children: [_jsxs(Stack, { gap: "xxs", children: [_jsx(Text, { variant: "caption", emphasis: "strong", children: replyTo.author }), _jsx(Text, { variant: "caption", tone: "muted", children: replyTo.excerpt })] }), _jsx(IconButton, { label: replyTo.cancelLabel, tone: "ghost", disabled: locked, onClick: replyTo.onCancel, children: _jsx(Text, { children: "\u00D7" }) })] }) : null, attachments.length ? _jsxs("div", { className: "hjm-message-composer__attachments", children: [attachments.map(item => _jsxs("div", { className: "hjm-message-composer__attachment", children: [_jsx("div", { className: "hjm-message-composer__preview", children: item.preview }), _jsx("span", { className: "hjm-message-composer__remove", children: _jsx(IconButton, { label: item.removeLabel, tone: "ghost", size: "small", disabled: locked, onClick: () => onRemoveAttachment?.(item.id), children: _jsx("span", { className: "hjm-message-composer__remove-glyph", "aria-hidden": "true", children: "\u00D7" }) }) })] }, item.id)), attach] }) : null, _jsxs("div", { className: "hjm-message-composer__row", children: [_jsx(TextArea, { ref: inputRef, maxLength: maxLength, leadingAction: leadingAction, shape: "large", rows: screenPatternRecipe.composerMinLines, "aria-label": label, placeholder: label, value: value, disabled: locked, onChange: event => onValueChange(event.currentTarget.value), minVisibleLines: screenPatternRecipe.composerMinLines, maxVisibleLines: screenPatternRecipe.composerMaxLines, ...(sendIcon ? { trailing: hasContent || pending ? send : attach } : {}) }), sendIcon ? null : send] })] });
53
+ // Readonly pending input preserves the keyboard/focus for receipt failure recovery; disabling it would blur desktop chat.
54
+ // Enter is opt-in and IME-safe; receipt-driven clearing and failed-send recovery belong to the host.
55
+ return _jsxs("div", { className: "hjm-message-composer", "data-send-presentation": sendPresentation, style: { "--hjm-message-composer-gap": `${screenPatternRecipe.itemGap}px`, "--hjm-attachment-size": `${screenPatternRecipe.attachmentSize}px`, "--hjm-attachment-remove-size": `${screenPatternRecipe.attachmentRemoveSize}px`, ...layoutStyle }, children: [context, replyTo ? _jsxs(Stack, { axis: "inline", gap: "sm", align: "center", children: [_jsxs(Stack, { gap: "xxs", children: [_jsx(Text, { variant: "caption", emphasis: "strong", children: replyTo.author }), _jsx(Text, { variant: "caption", tone: "muted", children: replyTo.excerpt })] }), _jsx(IconButton, { label: replyTo.cancelLabel, tone: "ghost", disabled: locked, onClick: replyTo.onCancel, children: _jsx(Text, { children: "\u00D7" }) })] }) : null, attachments.length ? _jsxs("div", { className: "hjm-message-composer__attachments", children: [attachments.map(item => _jsxs("div", { className: "hjm-message-composer__attachment", children: [_jsx("div", { className: "hjm-message-composer__preview", children: item.preview }), _jsx("span", { className: "hjm-message-composer__remove", children: _jsx(IconButton, { label: item.removeLabel, tone: "ghost", size: "small", disabled: locked || item.disabled, onClick: () => { if (!locked && !item.disabled)
56
+ onRemoveAttachment?.(item.id); }, children: _jsx("span", { className: "hjm-message-composer__remove-glyph", "aria-hidden": "true", children: "\u00D7" }) }) })] }, item.id)), attach] }) : null, _jsxs("div", { className: "hjm-message-composer__row", children: [_jsx(TextArea, { ref: inputRef, maxLength: maxLength, leadingAction: leadingAction, shape: "large", rows: screenPatternRecipe.composerMinLines, "aria-label": label, placeholder: placeholder, description: description, error: error, "aria-invalid": invalid || undefined, onBlur: onBlur, value: value, disabled: disabled, readOnly: pending, "aria-busy": pending || undefined, onKeyDown: event => { if (shouldSubmitMessageKey({ key: event.key, shiftKey: event.shiftKey, isComposing: event.nativeEvent.isComposing, keyCode: event.nativeEvent.keyCode }, submitMode)) {
57
+ event.preventDefault();
58
+ if (canSend)
59
+ onSend(value);
60
+ } }, onChange: event => { if (!locked)
61
+ onValueChange(event.currentTarget.value); }, minVisibleLines: screenPatternRecipe.composerMinLines, maxVisibleLines: screenPatternRecipe.composerMaxLines, ...(sendIcon ? { trailing: hasContent || pending ? send : attach } : {}) }), sendIcon ? null : send] })] });
49
62
  }
50
63
  export function ChatMessage({ direction, author, timestamp, deliveryLabel, avatar, reply, actions, replyAction, replyLink, reactions, children, interactiveContent = false, layoutStyle }) {
51
64
  const start = useRef(null);
@@ -1 +1 @@
1
- {"version":3,"file":"screens.js","sourceRoot":"","sources":["../src/screens.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAA4B,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,0BAA0B,EAAoC,yBAAyB,EAAE,mBAAmB,EAAuF,MAAM,yCAAyC,CAAC;AAC5R,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,EAAqB,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AA2B3C,qGAAqG;AACrG,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,GAAG,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,QAAQ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,MAAM,IAAC,IAAI,EAAC,OAAO,gBAAa,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,YAAG,KAAK,GAAU,CAAC,CAAC,CAAC,IAAI,EAC1H,SAAS,CAAC,CAAC,CAAC,MAAC,gBAAgB,OAAK,SAAS,EAAE,kBAAkB,EAAE,kBAAkB,aAAG,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,yBAAyB,YAAE,KAAK,GAAO,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,IAAoB,CAAC,CAAC,CAAC,eAAK,SAAS,EAAC,0BAA0B,aAAE,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,yBAAyB,YAAE,KAAK,GAAO,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,IAAO,EACzV,SAAS,IAAE,aAAa,IAAE,OAAO,CAAA,CAAC,CAAA,eAAK,SAAS,EAAC,wBAAwB,aAAE,SAAS,IAAE,aAAa,CAAA,CAAC,CAAA,MAAC,IAAI,IAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,aAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,IAAQ,CAAA,CAAC,CAAA,IAAI,EAAE,OAAO,IAAO,CAAA,CAAC,CAAA,IAAI,IAC9N,IACE,CAAC;AACb,CAAC","sourcesContent":["import { MessageReactions } from \"./internal/message-reactions.js\";\nimport type { ReactionPickerProps } from \"./reaction-picker.js\";\nimport { Button, IconButton } from \"./actions.js\";\nimport { TextArea } from \"./forms.js\";\nimport { useId, useRef, useState, type Ref, type ReactNode } from \"react\";\nimport { isReplySwipe, canSubmitMessage, validateMessageAttachments, type MessageAttachmentDescriptor, resolveScreenContentState, screenPatternRecipe, type ChatMessageDescriptor, type MessageComposerDescriptor, type ScreenContentState } from \"@hjmds/design-contracts/screen-patterns\";\nimport { Heading } from \"./heading.js\";\nimport { Spinner } from \"./internal/spinner.js\";\nimport { Section, Stack, Text } from \"./layout.js\";\nimport { ListRow, type ListRowProps } from \"./display.js\";\nimport { classNames } from \"./internal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type ScreenLayoutProps = Readonly<{\n title: string;\n /** Preserve host navigation while the shared shell owns content and state. */\n header?: ReactNode;\n contentInset?: \"default\" | \"none\";\n description?: string;\n leading?: ReactNode;\n actions?: ReactNode;\n notice?: ReactNode;\n footer?: ReactNode;\n state?: ScreenContentState;\n stateAction?: ReactNode;\n children?: ReactNode;\n /** A virtualized list must own scrolling; never nest it inside a second scroll container. */\n scroll?: \"screen\" | \"content\";\n as?: \"main\" | \"section\";\n className?: string;\n /**\n * Canonical layout-only placement on the screen root (for example `flex` or `width` in a split\n * view), matching Native ScreenLayout. Every screen built on ScreenLayout forwards it.\n */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\n/** Shared screen shell. Routing, data, permission checks and mutation state remain product-owned. */\nexport function ScreenLayout({ title, header, contentInset = \"default\", description, leading, actions, notice, footer, state = { kind: \"ready\" }, stateAction, children, scroll = \"screen\", as: Element = \"main\", className, layoutStyle }: ScreenLayoutProps) {\n const id = useId();\n const resolved = resolveScreenContentState(state);\n // Replacement text owns scrolling even when the ready state delegates it to\n // a virtual list. Use the rendered mode for keyboard access as well as CSS.\n const bodyScroll = resolved.replacesContent ? \"screen\" : scroll;\n const recipe = screenPatternRecipe;\n return <Element aria-labelledby={header ? undefined : id} aria-label={header ? title : undefined} data-content-inset={contentInset} className={classNames(\"hjm-screen\", className)}\n style={{ \"--hjm-screen-width\": `${recipe.maxWidth}px`, \"--hjm-screen-padding\": `${contentInset === \"none\" ? 0 : recipe.padding}px`, \"--hjm-screen-gap\": `${recipe.sectionGap}px`, \"--hjm-screen-item-gap\": `${recipe.itemGap}px`, \"--hjm-screen-state-gap\": `${recipe.stateGap}px`, \"--hjm-screen-header-min\": `${recipe.headerMinWidth}px`, ...layoutStyle } as React.CSSProperties}>\n {header ?? <header className=\"hjm-screen__header\">\n {leading}<div className=\"hjm-screen__heading\"><Heading level=\"level3\" semanticLevel={1} id={id}>{title}</Heading>\n {description ? <Text as=\"p\" tone=\"muted\">{description}</Text> : null}</div>{actions}\n </header>}\n {notice ? <div className=\"hjm-screen__notice\">{notice}</div> : null}\n {/* Scrollable read-only screens still need a keyboard entry point. */}\n <div tabIndex={bodyScroll === \"content\" ? undefined : 0} className=\"hjm-screen__body\" data-scroll={bodyScroll} data-replacement={resolved.replacesContent || undefined} aria-busy={resolved.busy || undefined}>\n {state.kind === \"ready\" ? children : <div className=\"hjm-screen__state\">\n {/* Loading copy is an accessible name; visible copy beside the spinner\n contradicts the shared spinner-only loading contract. */}\n {resolved.busy ? <Spinner label={[state.title, state.description].filter(Boolean).join(\". \")} /> : <div role={state.kind === \"error\" ? \"alert\" : \"status\"}>\n <Stack gap=\"sm\" align=\"center\"><Text variant=\"title\">{state.title}</Text>\n {state.description ? <Text tone=\"muted\">{state.description}</Text> : null}</Stack>\n </div>}\n {stateAction}\n </div>}\n </div>\n {footer ? <footer className=\"hjm-screen__footer\">{footer}</footer> : null}\n </Element>;\n}\n\nexport type SettingsScreenSection = Readonly<{ id: string; title: string; description?: string; children: ReactNode }>;\nexport type SettingsScreenProps = Omit<ScreenLayoutProps, \"children\" | \"scroll\"> & Readonly<{ profile?: ReactNode; sections: readonly SettingsScreenSection[] }>;\nexport function SettingsScreen({ profile, sections, ...props }: SettingsScreenProps) {\n return <ScreenLayout {...props}><Stack gap=\"xl\">{profile}{sections.map(section =>\n <Section className=\"hjm-settings-section\" key={section.id} title={section.title} description={section.description}>{section.children}</Section>)}</Stack></ScreenLayout>;\n}\n\nexport type NotificationInboxScreenProps = Omit<ScreenLayoutProps, \"children\"> & Readonly<{\n filters?: ReactNode;\n children: ReactNode;\n}>;\nexport function NotificationInboxScreen({ filters, children, notice, ...props }: NotificationInboxScreenProps) {\n return <ScreenLayout {...props} notice={<Stack gap=\"sm\">{notice}{filters}</Stack>}>{children}</ScreenLayout>;\n}\n\n/** Read/unread is announced in localized copy as well as emphasis; rendering never marks an item read. */\nexport type NotificationItemProps = Omit<ListRowProps, \"description\" | \"selected\"> & Readonly<{\n read: boolean;\n statusLabel: string;\n timestamp: string;\n description?: ReactNode;\n}>;\nexport function NotificationItem({ read, statusLabel, timestamp, description, title, className, ...props }: NotificationItemProps) {\n return <ListRow {...props} className={classNames(\"hjm-notification-item\", className)} data-unread={!read || undefined} title={<Text emphasis={read ? \"regular\" : \"strong\"}>{title}</Text>}\n description={<Stack gap=\"xxs\">{description}<Text variant=\"caption\" tone=\"muted\">{statusLabel} · {timestamp}</Text></Stack>} />;\n}\n\nexport type ChatScreenProps = Omit<ScreenLayoutProps, \"footer\"> & Readonly<{ composer: ReactNode }>;\n/** Caller supplies a virtualized timeline and keyboard-aware composer; no implicit auto-scroll or send. */\nexport function ChatScreen({ composer, scroll = \"content\", ...props }: ChatScreenProps) {\n return <ScreenLayout {...props} scroll={scroll} footer={!props.state || props.state.kind === \"ready\" ? composer : null} />;\n}\n\nexport type MessageComposerProps = Omit<MessageComposerDescriptor, \"attachmentCount\"> & Readonly<{\n maxLength?: number;\n sendDisabled?: boolean;\n additionalContent?: boolean;\n leadingAction?: ReactNode;\n inputRef?: Ref<HTMLTextAreaElement>;\n onValueChange(value: string): void;\n onSend(value: string): void;\n context?: ReactNode;\n replyTo?: Readonly<{ author: string; excerpt: string; cancelLabel: string; onCancel(): void }>;\n /** Icon mode puts the send/attachment action inside the growing field. */\n sendIcon?: ReactNode;\n /** Reference comment layout: a filled circular send action inside the field. */\n sendPresentation?: \"inline\" | \"circle\";\n attachmentAction?: Readonly<{ label: string; icon: ReactNode; onPress(): void; disabled?: boolean }>;\n attachments?: readonly (MessageAttachmentDescriptor & Readonly<{ preview: ReactNode }>)[];\n onRemoveAttachment?: (id: string) => void;\n /** Canonical layout-only placement on the composer root. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\nexport function MessageComposer({ value, label, sendLabel, disabled = false, pending = false, onValueChange, onSend, maxLength, sendDisabled = false, additionalContent = false, leadingAction, inputRef, context, replyTo, sendIcon, sendPresentation = \"inline\", attachmentAction, attachments = [], onRemoveAttachment, layoutStyle }: MessageComposerProps) {\n validateMessageAttachments(attachments);\n if (attachments.length && !onRemoveAttachment) throw new TypeError(\"Attachments require a removal callback\");\n const canSend = !sendDisabled && canSubmitMessage({ value, label, sendLabel, disabled, pending, attachmentCount: attachments.length + (additionalContent ? 1 : 0) });\n const locked = disabled || pending;\n // A bounded corner radius keeps multiline/large-text content inside the field instead of a tall pill.\n const hasContent = !!value.trim() || attachments.length > 0 || additionalContent;\n const attach = attachmentAction ? <IconButton label={attachmentAction.label} tone=\"ghost\" disabled={locked || attachmentAction.disabled} onClick={attachmentAction.onPress}>{attachmentAction.icon}</IconButton> : null;\n const send = sendIcon ? <IconButton label={sendLabel} size={sendPresentation === \"circle\" ? \"small\" : \"medium\"} shape=\"circle\" tone={sendPresentation === \"circle\" ? \"primary\" : \"ghost\"} disabled={!canSend} loading={pending} onClick={() => { if (canSend) onSend(value); }}>{sendIcon}</IconButton> : <Button disabled={!canSend} loading={pending} onClick={() => { if (canSend) onSend(value); }}>{sendLabel}</Button>;\n // Enter stays a newline for IME; receipt-driven clearing and failed-send recovery belong to the host.\n return <div className=\"hjm-message-composer\" data-send-presentation={sendPresentation} style={{\"--hjm-message-composer-gap\": `${screenPatternRecipe.itemGap}px`, \"--hjm-attachment-size\": `${screenPatternRecipe.attachmentSize}px`, \"--hjm-attachment-remove-size\": `${screenPatternRecipe.attachmentRemoveSize}px`, ...layoutStyle} as React.CSSProperties}>{context}{replyTo ? <Stack axis=\"inline\" gap=\"sm\" align=\"center\"><Stack gap=\"xxs\"><Text variant=\"caption\" emphasis=\"strong\">{replyTo.author}</Text><Text variant=\"caption\" tone=\"muted\">{replyTo.excerpt}</Text></Stack><IconButton label={replyTo.cancelLabel} tone=\"ghost\" disabled={locked} onClick={replyTo.onCancel}><Text>×</Text></IconButton></Stack> : null}\n {attachments.length ? <div className=\"hjm-message-composer__attachments\">{attachments.map(item => <div key={item.id} className=\"hjm-message-composer__attachment\"><div className=\"hjm-message-composer__preview\">{item.preview}</div><span className=\"hjm-message-composer__remove\"><IconButton label={item.removeLabel} tone=\"ghost\" size=\"small\" disabled={locked} onClick={() => onRemoveAttachment?.(item.id)}><span className=\"hjm-message-composer__remove-glyph\" aria-hidden=\"true\">×</span></IconButton></span></div>)}{attach}</div> : null}\n <div className=\"hjm-message-composer__row\"><TextArea ref={inputRef} maxLength={maxLength} leadingAction={leadingAction} shape=\"large\" rows={screenPatternRecipe.composerMinLines} aria-label={label} placeholder={label} value={value} disabled={locked}\n onChange={event => onValueChange(event.currentTarget.value)} minVisibleLines={screenPatternRecipe.composerMinLines} maxVisibleLines={screenPatternRecipe.composerMaxLines}\n {...(sendIcon ? { trailing: hasContent || pending ? send : attach } : {})} />\n {sendIcon ? null : send}\n </div></div>;\n}\n\nexport type ChatMessageProps = ChatMessageDescriptor & Readonly<{ children: ReactNode; interactiveContent?: boolean; avatar?: ReactNode; reply?: ReactNode; actions?: ReactNode; replyAction?: Readonly<{label:string; onPress():void; disabled?:boolean}>; replyLink?: Readonly<{label:string; onPress():void}>; reactions?: ReactionPickerProps & Readonly<{ closeLabel: string; menuAction?: Readonly<{ label: string; onPress(): void; disabled?: boolean }> }>;\n /** Canonical layout-only placement on the message row. The swipe offset still owns `transform`. */\n layoutStyle?: HjmCompositionStyleProp }>;\nexport function ChatMessage({ direction, author, timestamp, deliveryLabel, avatar, reply, actions, replyAction, replyLink, reactions, children, interactiveContent=false, layoutStyle }: ChatMessageProps) {\n const start = useRef<{x:number;y:number} | null>(null);\n const [offset, setOffset] = useState(0);\n const finish = () => { start.current = null; setOffset(0); };\n return <article tabIndex={replyAction && !replyAction.disabled ? 0 : undefined}\n aria-keyshortcuts={replyAction ? \"Alt+ArrowLeft Alt+ArrowRight\" : undefined} aria-description={replyAction?.label}\n onKeyDown={event => { if (event.target === event.currentTarget && event.altKey && (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\") && replyAction && !replyAction.disabled) { event.preventDefault(); replyAction.onPress(); } }}\n onPointerDown={event => { if (!replyAction || replyAction.disabled || event.button !== 0 || (event.target as HTMLElement).closest(\"button,a,input,textarea\")) return; start.current = {x:event.clientX,y:event.clientY}; }}\n onPointerMove={event => { if (!start.current) return; const dx=event.clientX-start.current.x,dy=event.clientY-start.current.y; if (Math.abs(dy)>10 && Math.abs(dy)>Math.abs(dx)) {finish();return;} if (Math.abs(dx)>Math.abs(dy)*2) setOffset(Math.max(-72,Math.min(72,dx))); }}\n onPointerUp={event => { if (start.current && replyAction && !replyAction.disabled && isReplySwipe(event.clientX-start.current.x,event.clientY-start.current.y)) replyAction.onPress(); finish(); }} onPointerCancel={finish} onPointerLeave={finish}\n className=\"hjm-chat-message\" style={{ ...layoutStyle, transform: `translateX(${offset}px)`, touchAction: replyAction ? \"pan-y\" : undefined, \"--hjm-message-max-width\": screenPatternRecipe.messageMaxWidth } as React.CSSProperties} data-direction={direction} aria-label={author}>\n {avatar ? <div className=\"hjm-chat-message__avatar\">{avatar}</div> : null}\n <div className=\"hjm-chat-message__content\">{author?<Text variant=\"caption\" tone=\"muted\">{author}</Text>:null}\n {reply && replyLink ? <Button tone=\"ghost\" aria-label={replyLink.label} onClick={replyLink.onPress}>{reply}</Button> : null}\n {reactions ? <MessageReactions {...reactions} interactiveContent={interactiveContent}>{reply && !replyLink ? <div className=\"hjm-chat-message__reply\">{reply}</div> : null}{children}</MessageReactions> : <div className=\"hjm-chat-message__bubble\">{reply && !replyLink ? <div className=\"hjm-chat-message__reply\">{reply}</div> : null}{children}</div>}\n {timestamp||deliveryLabel||actions?<div className=\"hjm-chat-message__meta\">{timestamp||deliveryLabel?<Text variant=\"caption\" tone=\"muted\">{timestamp}{deliveryLabel ? ` · ${deliveryLabel}` : \"\"}</Text>:null}{actions}</div>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EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,YAAE,MAAM,GAAQ,CAAA,CAAC,CAAA,IAAI,EACzG,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,IAAI,EAAC,OAAO,gBAAa,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,YAAG,KAAK,GAAU,CAAC,CAAC,CAAC,IAAI,EAC1H,SAAS,CAAC,CAAC,CAAC,MAAC,gBAAgB,OAAK,SAAS,EAAE,kBAAkB,EAAE,kBAAkB,aAAG,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,yBAAyB,YAAE,KAAK,GAAO,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,IAAoB,CAAC,CAAC,CAAC,eAAK,SAAS,EAAC,0BAA0B,aAAE,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,yBAAyB,YAAE,KAAK,GAAO,CAAC,CAAC,CAAC,IAAI,EAAE,QAAQ,IAAO,EACzV,SAAS,IAAE,aAAa,IAAE,OAAO,CAAA,CAAC,CAAA,eAAK,SAAS,EAAC,wBAAwB,aAAE,SAAS,IAAE,aAAa,CAAA,CAAC,CAAA,MAAC,IAAI,IAAC,OAAO,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,aAAE,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,IAAQ,CAAA,CAAC,CAAA,IAAI,EAAE,OAAO,IAAO,CAAA,CAAC,CAAA,IAAI,IAC9N,IACE,CAAC;AACb,CAAC","sourcesContent":["import { resolveDesignProfileScreen, type DesignProfileScreenPresentation } from \"@hjmds/design-contracts/design-profile-layout\";\nimport { MessageReactions } from \"./internal/message-reactions.js\";\nimport type { ReactionPickerProps } from \"./reaction-picker.js\";\nimport { Button, IconButton } from \"./actions.js\";\nimport { TextArea } from \"./forms.js\";\nimport { useId, useRef, useState, type Ref, type ReactNode } from \"react\";\nimport { isReplySwipe, shouldSubmitMessageKey, canSubmitMessage, validateMessageAttachments, type MessageAttachmentDescriptor, resolveScreenContentState, screenPatternRecipe, type ChatMessageDescriptor, type MessageComposerDescriptor, type ScreenContentState } from \"@hjmds/design-contracts/screen-patterns\";\nimport { Heading } from \"./heading.js\";\nimport { Spinner } from \"./internal/spinner.js\";\nimport { Section, Stack, Text } from \"./layout.js\";\nimport { ListRow, type ListRowProps } from \"./display.js\";\nimport { classNames, useDesignProfileDefaults } from \"./internal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type ScreenLayoutProps = Readonly<{\n title: string;\n /** Preserve host navigation while the shared shell owns content and state. */\n header?: ReactNode;\n contentInset?: \"default\" | \"none\";\n /** Explicit layout wins over the nearest design profile. */\n presentation?: DesignProfileScreenPresentation;\n description?: string;\n leading?: ReactNode;\n actions?: ReactNode;\n notice?: ReactNode;\n footer?: ReactNode;\n state?: ScreenContentState;\n stateAction?: ReactNode;\n children?: ReactNode;\n /** A virtualized list must own scrolling; never nest it inside a second scroll container. */\n scroll?: \"screen\" | \"content\";\n as?: \"main\" | \"section\";\n className?: string;\n /**\n * Canonical layout-only placement on the screen root (for example `flex` or `width` in a split\n * view), matching Native ScreenLayout. Every screen built on ScreenLayout forwards it.\n */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\n/** Shared screen shell. Routing, data, permission checks and mutation state remain product-owned. */\nexport function ScreenLayout({ title, header, contentInset = \"default\", presentation: suppliedPresentation, description, leading, actions, notice, footer, state = { kind: \"ready\" }, stateAction, children, scroll = \"screen\", as: Element = \"main\", className, layoutStyle }: ScreenLayoutProps) {\n const id = useId();\n // Screens historically work with the stylesheet alone. Optional context keeps\n // that path while inheriting profiles from an enclosing Provider when present.\n const designProfile = useDesignProfileDefaults();\n const presentation = suppliedPresentation ?? designProfile?.screens.overview;\n const profileLayout = presentation === undefined ? undefined : resolveDesignProfileScreen(presentation);\n const resolved = resolveScreenContentState(state);\n // Replacement text owns scrolling even when the ready state delegates it to\n // a virtual list. Use the rendered mode for keyboard access as well as CSS.\n const bodyScroll = resolved.replacesContent ? \"screen\" : scroll;\n const recipe = screenPatternRecipe;\n return <Element aria-labelledby={header ? undefined : id} aria-label={header ? title : undefined} data-content-inset={contentInset} data-presentation={presentation} className={classNames(\"hjm-screen\", className)}\n style={{ backgroundColor: designProfile?.material.canvas ? \"transparent\" : undefined, \"--hjm-screen-width\": `${profileLayout?.maxWidth ?? recipe.maxWidth}px`, \"--hjm-screen-padding\": `${contentInset === \"none\" ? 0 : recipe.padding}px`, \"--hjm-screen-gap\": `${profileLayout?.gap ?? recipe.sectionGap}px`, \"--hjm-screen-item-gap\": `${recipe.itemGap}px`, \"--hjm-screen-state-gap\": `${recipe.stateGap}px`, \"--hjm-screen-header-min\": `${recipe.headerMinWidth}px`, ...layoutStyle } as React.CSSProperties}>\n {header ?? <header className=\"hjm-screen__header\" style={profileLayout ? { flexDirection: profileLayout.headerAxis, alignItems: profileLayout.centered ? \"center\" : undefined, textAlign: profileLayout.centered ? \"center\" : undefined } : undefined}>\n {leading}<div className=\"hjm-screen__heading\"><Heading level=\"level3\" semanticLevel={1} id={id}>{title}</Heading>\n {description ? <Text as=\"p\" tone=\"muted\">{description}</Text> : null}</div>{actions}\n </header>}\n {notice ? <div className=\"hjm-screen__notice\">{notice}</div> : null}\n {/* Scrollable read-only screens still need a keyboard entry point. */}\n <div tabIndex={bodyScroll === \"content\" ? undefined : 0} className=\"hjm-screen__body\" data-scroll={bodyScroll} data-replacement={resolved.replacesContent || undefined} aria-busy={resolved.busy || undefined}>\n {state.kind === \"ready\" ? children : <div className=\"hjm-screen__state\">\n {/* Loading copy is an accessible name; visible copy beside the spinner\n contradicts the shared spinner-only loading contract. */}\n {resolved.busy ? <Spinner label={[state.title, state.description].filter(Boolean).join(\". \")} /> : <div role={state.kind === \"error\" ? \"alert\" : \"status\"}>\n <Stack gap=\"sm\" align=\"center\"><Text variant=\"title\">{state.title}</Text>\n {state.description ? <Text tone=\"muted\">{state.description}</Text> : null}</Stack>\n </div>}\n {stateAction}\n </div>}\n </div>\n {footer ? <footer className=\"hjm-screen__footer\">{footer}</footer> : null}\n </Element>;\n}\n\nexport type SettingsScreenSection = Readonly<{ id: string; title: string; description?: string; children: ReactNode }>;\nexport type SettingsScreenProps = Omit<ScreenLayoutProps, \"children\" | \"scroll\"> & Readonly<{ profile?: ReactNode; sections: readonly SettingsScreenSection[] }>;\nexport function SettingsScreen({ profile, sections, ...props }: SettingsScreenProps) {\n return <ScreenLayout {...props}><Stack gap=\"xl\">{profile}{sections.map(section =>\n <Section className=\"hjm-settings-section\" key={section.id} title={section.title} description={section.description}>{section.children}</Section>)}</Stack></ScreenLayout>;\n}\n\nexport type NotificationInboxScreenProps = Omit<ScreenLayoutProps, \"children\"> & Readonly<{\n filters?: ReactNode;\n children: ReactNode;\n}>;\nexport function NotificationInboxScreen({ filters, children, notice, ...props }: NotificationInboxScreenProps) {\n return <ScreenLayout {...props} notice={<Stack gap=\"sm\">{notice}{filters}</Stack>}>{children}</ScreenLayout>;\n}\n\n/** Read/unread is announced in localized copy as well as emphasis; rendering never marks an item read. */\nexport type NotificationItemProps = Omit<ListRowProps, \"description\" | \"selected\"> & Readonly<{\n read: boolean;\n statusLabel: string;\n timestamp: string;\n description?: ReactNode;\n}>;\nexport function NotificationItem({ read, statusLabel, timestamp, description, title, className, ...props }: NotificationItemProps) {\n return <ListRow {...props} className={classNames(\"hjm-notification-item\", className)} data-unread={!read || undefined} title={<Text emphasis={read ? \"regular\" : \"strong\"}>{title}</Text>}\n description={<Stack gap=\"xxs\">{description}<Text variant=\"caption\" tone=\"muted\">{statusLabel} · {timestamp}</Text></Stack>} />;\n}\n\nexport type ChatScreenProps = Omit<ScreenLayoutProps, \"footer\"> & Readonly<{ composer: ReactNode }>;\n/** Caller supplies a virtualized timeline and keyboard-aware composer; no implicit auto-scroll or send. */\nexport function ChatScreen({ composer, scroll = \"content\", ...props }: ChatScreenProps) {\n return <ScreenLayout {...props} scroll={scroll} footer={!props.state || props.state.kind === \"ready\" ? composer : null} />;\n}\n\nexport type MessageComposerProps = Omit<MessageComposerDescriptor, \"attachmentCount\"> & Readonly<{\n maxLength?: number;\n sendDisabled?: boolean;\n additionalContent?: boolean;\n leadingAction?: ReactNode;\n inputRef?: Ref<HTMLTextAreaElement>;\n /** Release typing presence when the host input loses focus. */\n onBlur?: () => void;\n onValueChange(value: string): void;\n onSend(value: string): void;\n context?: ReactNode;\n replyTo?: Readonly<{ author: string; excerpt: string; cancelLabel: string; onCancel(): void }>;\n /** Icon mode puts the send/attachment action inside the growing field. */\n sendIcon?: ReactNode;\n /** Reference comment layout: a filled circular send action inside the field. */\n sendPresentation?: \"inline\" | \"circle\";\n attachmentAction?: Readonly<{ label: string; icon: ReactNode; onPress(): void; disabled?: boolean }>;\n attachments?: readonly (MessageAttachmentDescriptor & Readonly<{ preview: ReactNode }>)[];\n onRemoveAttachment?: (id: string) => void;\n /** Canonical layout-only placement on the composer root. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\nexport function MessageComposer({ value, label, sendLabel, placeholder = label, description, error, invalid = false, submitMode = \"newline\", onBlur, disabled = false, pending = false, onValueChange, onSend, maxLength, sendDisabled = false, additionalContent = false, leadingAction, inputRef, context, replyTo, sendIcon, sendPresentation = \"inline\", attachmentAction, attachments = [], onRemoveAttachment, layoutStyle }: MessageComposerProps) {\n validateMessageAttachments(attachments);\n if (attachments.length && !onRemoveAttachment) throw new TypeError(\"Attachments require a removal callback\");\n const canSend = !sendDisabled && canSubmitMessage({ value, label, sendLabel, disabled, pending, attachmentCount: attachments.length + (additionalContent ? 1 : 0) });\n const locked = disabled || pending;\n // A bounded corner radius keeps multiline/large-text content inside the field instead of a tall pill.\n const hasContent = !!value.trim() || attachments.length > 0 || additionalContent;\n const attach = attachmentAction ? <IconButton label={attachmentAction.label} tone=\"ghost\" disabled={locked || attachmentAction.disabled} onClick={attachmentAction.onPress}>{attachmentAction.icon}</IconButton> : null;\n const send = sendIcon ? <IconButton label={sendLabel} size={sendPresentation === \"circle\" ? \"small\" : \"medium\"} shape=\"circle\" tone={sendPresentation === \"circle\" ? \"primary\" : \"ghost\"} disabled={!canSend} loading={pending} onClick={() => { if (canSend) onSend(value); }}>{sendIcon}</IconButton> : <Button disabled={!canSend} loading={pending} onClick={() => { if (canSend) onSend(value); }}>{sendLabel}</Button>;\n // Readonly pending input preserves the keyboard/focus for receipt failure recovery; disabling it would blur desktop chat.\n // Enter is opt-in and IME-safe; receipt-driven clearing and failed-send recovery belong to the host.\n return <div className=\"hjm-message-composer\" data-send-presentation={sendPresentation} style={{\"--hjm-message-composer-gap\": `${screenPatternRecipe.itemGap}px`, \"--hjm-attachment-size\": `${screenPatternRecipe.attachmentSize}px`, \"--hjm-attachment-remove-size\": `${screenPatternRecipe.attachmentRemoveSize}px`, ...layoutStyle} as React.CSSProperties}>{context}{replyTo ? <Stack axis=\"inline\" gap=\"sm\" align=\"center\"><Stack gap=\"xxs\"><Text variant=\"caption\" emphasis=\"strong\">{replyTo.author}</Text><Text variant=\"caption\" tone=\"muted\">{replyTo.excerpt}</Text></Stack><IconButton label={replyTo.cancelLabel} tone=\"ghost\" disabled={locked} onClick={replyTo.onCancel}><Text>×</Text></IconButton></Stack> : null}\n {attachments.length ? <div className=\"hjm-message-composer__attachments\">{attachments.map(item => <div key={item.id} className=\"hjm-message-composer__attachment\"><div className=\"hjm-message-composer__preview\">{item.preview}</div><span className=\"hjm-message-composer__remove\"><IconButton label={item.removeLabel} tone=\"ghost\" size=\"small\" disabled={locked || item.disabled} onClick={() => { if (!locked && !item.disabled) onRemoveAttachment?.(item.id); }}><span className=\"hjm-message-composer__remove-glyph\" aria-hidden=\"true\">×</span></IconButton></span></div>)}{attach}</div> : null}\n <div className=\"hjm-message-composer__row\"><TextArea ref={inputRef} maxLength={maxLength} leadingAction={leadingAction} shape=\"large\" rows={screenPatternRecipe.composerMinLines} aria-label={label} placeholder={placeholder} description={description} error={error} aria-invalid={invalid || undefined} onBlur={onBlur} value={value} disabled={disabled} readOnly={pending} aria-busy={pending || undefined}\n onKeyDown={event => { if (shouldSubmitMessageKey({key:event.key, shiftKey:event.shiftKey, isComposing:event.nativeEvent.isComposing, keyCode:event.nativeEvent.keyCode}, submitMode)) { event.preventDefault(); if (canSend) onSend(value); } }}\n onChange={event => { if (!locked) onValueChange(event.currentTarget.value); }} minVisibleLines={screenPatternRecipe.composerMinLines} maxVisibleLines={screenPatternRecipe.composerMaxLines}\n {...(sendIcon ? { trailing: hasContent || pending ? send : attach } : {})} />\n {sendIcon ? null : send}\n </div></div>;\n}\n\nexport type ChatMessageProps = ChatMessageDescriptor & Readonly<{ children: ReactNode; interactiveContent?: boolean; avatar?: ReactNode; reply?: ReactNode; actions?: ReactNode; replyAction?: Readonly<{label:string; onPress():void; disabled?:boolean}>; replyLink?: Readonly<{label:string; onPress():void}>; reactions?: ReactionPickerProps & Readonly<{ closeLabel: string; menuAction?: Readonly<{ label: string; onPress(): void; disabled?: boolean }> }>;\n /** Canonical layout-only placement on the message row. The swipe offset still owns `transform`. */\n layoutStyle?: HjmCompositionStyleProp }>;\nexport function ChatMessage({ direction, author, timestamp, deliveryLabel, avatar, reply, actions, replyAction, replyLink, reactions, children, interactiveContent=false, layoutStyle }: ChatMessageProps) {\n const start = useRef<{x:number;y:number} | null>(null);\n const [offset, setOffset] = useState(0);\n const finish = () => { start.current = null; setOffset(0); };\n return <article tabIndex={replyAction && !replyAction.disabled ? 0 : undefined}\n aria-keyshortcuts={replyAction ? \"Alt+ArrowLeft Alt+ArrowRight\" : undefined} aria-description={replyAction?.label}\n onKeyDown={event => { if (event.target === event.currentTarget && event.altKey && (event.key === \"ArrowLeft\" || event.key === \"ArrowRight\") && replyAction && !replyAction.disabled) { event.preventDefault(); replyAction.onPress(); } }}\n onPointerDown={event => { if (!replyAction || replyAction.disabled || event.button !== 0 || (event.target as HTMLElement).closest(\"button,a,input,textarea\")) return; start.current = {x:event.clientX,y:event.clientY}; }}\n onPointerMove={event => { if (!start.current) return; const dx=event.clientX-start.current.x,dy=event.clientY-start.current.y; if (Math.abs(dy)>10 && Math.abs(dy)>Math.abs(dx)) {finish();return;} if (Math.abs(dx)>Math.abs(dy)*2) setOffset(Math.max(-72,Math.min(72,dx))); }}\n onPointerUp={event => { if (start.current && replyAction && !replyAction.disabled && isReplySwipe(event.clientX-start.current.x,event.clientY-start.current.y)) replyAction.onPress(); finish(); }} onPointerCancel={finish} onPointerLeave={finish}\n className=\"hjm-chat-message\" style={{ ...layoutStyle, transform: `translateX(${offset}px)`, touchAction: replyAction ? \"pan-y\" : undefined, \"--hjm-message-max-width\": screenPatternRecipe.messageMaxWidth } as React.CSSProperties} data-direction={direction} aria-label={author}>\n {avatar ? <div className=\"hjm-chat-message__avatar\">{avatar}</div> : null}\n <div className=\"hjm-chat-message__content\">{author?<Text variant=\"caption\" tone=\"muted\">{author}</Text>:null}\n {reply && replyLink ? <Button tone=\"ghost\" aria-label={replyLink.label} onClick={replyLink.onPress}>{reply}</Button> : null}\n {reactions ? <MessageReactions {...reactions} interactiveContent={interactiveContent}>{reply && !replyLink ? <div className=\"hjm-chat-message__reply\">{reply}</div> : null}{children}</MessageReactions> : <div className=\"hjm-chat-message__bubble\">{reply && !replyLink ? <div className=\"hjm-chat-message__reply\">{reply}</div> : null}{children}</div>}\n {timestamp||deliveryLabel||actions?<div className=\"hjm-chat-message__meta\">{timestamp||deliveryLabel?<Text variant=\"caption\" tone=\"muted\">{timestamp}{deliveryLabel ? ` · ${deliveryLabel}` : \"\"}</Text>:null}{actions}</div>:null}\n </div>\n </article>;\n}\n"]}
@@ -187,6 +187,8 @@ export type SegmentedControlProps = Omit<FieldsetHTMLAttributes<HTMLFieldSetElem
187
187
  onValueChange?: (value: string) => void;
188
188
  size?: SegmentedControlSize;
189
189
  presentation?: "connected" | "pills";
190
+ /** Move only the selection artwork; radio semantics and hit targets stay fixed. */
191
+ selectionMotion?: "none" | "slide";
190
192
  name?: string;
191
193
  /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */
192
194
  layoutStyle?: HjmCompositionStyleProp;
@@ -199,6 +201,8 @@ export declare const SegmentedControl: import("react").ForwardRefExoticComponent
199
201
  onValueChange?: (value: string) => void;
200
202
  size?: SegmentedControlSize;
201
203
  presentation?: "connected" | "pills";
204
+ /** Move only the selection artwork; radio semantics and hit targets stay fixed. */
205
+ selectionMotion?: "none" | "slide";
202
206
  name?: string;
203
207
  /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */
204
208
  layoutStyle?: HjmCompositionStyleProp;
@@ -1 +1 @@
1
- {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../src/selection.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAMV,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,0BAA0B,EAC/B,KAAK,UAAU,EACf,KAAK,kBAAkB,EACxB,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,CAAC;AAC/C,OAAO,EAQL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,wBAAwB,GAAG,QAAQ,CAAC;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,KAAK,aAAa,G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AE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,IAAI,CACtC,sBAAsB,CAAC,mBAAmB,CAAC,EAC3C,cAAc,GAAG,UAAU,GAAG,OAAO,CACtC,GACC,QAAQ,CAAC;IACP,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,IAAI,CAAC,EAAE,oBAAoB,CAAC;IAC5B,YAAY,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;IACrC,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gGAAgG;IAChG,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAEL,eAAO,MAAM,gBAAgB;WAdlB,MAAM;WACN,SAAS,oBAAoB,EAAE;YAC9B,MAAM;mBACC,MAAM;oBACL,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;WAChC,oBAAoB;mBACZ,WAAW,GAAG,OAAO;IACpC,mFAAmF;sBACjE,MAAM,GAAG,OAAO;WAC3B,MAAM;IACb,gGAAgG;kBAClF,uBAAuB;wCA0HvC,CAAC"}
package/dist/selection.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useDesignProfileDefaults } from "./internal.js";
2
3
  import { chipRecipe, iconRecipe, segmentedControlRecipe, selectionControlRecipe, selectionGroupRecipe, switchRecipe, } from "@hjmds/design-contracts/recipes";
3
4
  import { resolveControlAccessibleName, reconcileCheckboxSelection, reconcileRadioSelection, resolveInitialRadioValue, toggleCheckboxSelection, validateCheckboxSelection, validateRadioSelection, } from "@hjmds/design-contracts/behaviors";
4
- import { forwardRef, useEffect, useId, useRef, } from "react";
5
+ import { forwardRef, useEffect, useLayoutEffect, useId, useRef, } from "react";
5
6
  import { classNames, composeRefs, useControllableState } from "./internal.js";
6
7
  /** Action/filter chip with explicit selection semantics and no hidden state. */
7
8
  export const Chip = forwardRef(function Chip({ label, size = chipRecipe.defaults.size, leading, trailing, renderSelectionIndicator, selectionMode = "action", selected, onSelectedChange, onPress, disabled, className, layoutStyle, style, ...props }, ref) {
@@ -189,7 +190,9 @@ export const Switch = forwardRef(function Switch({ label, labelVisibility = "vis
189
190
  onClick?.(event);
190
191
  }, children: [_jsx("span", { className: "hjm-switch__track", "aria-hidden": "true", children: _jsx("span", { className: "hjm-switch__thumb" }) }), _jsxs("span", { className: classNames("hjm-switch__copy", labelVisibility === "hidden" && "hjm-visually-hidden"), children: [_jsx("span", { id: labelId, className: "hjm-switch__label", children: label }), hasDescription ? _jsx("span", { id: descriptionId, className: "hjm-switch__description", children: description }) : null] })] }));
191
192
  });
192
- export const SegmentedControl = forwardRef(function SegmentedControl({ label, items, value: valueProp, defaultValue, onValueChange, size = segmentedControlRecipe.defaults.size, presentation = "connected", name, className, layoutStyle, style, ...props }, ref) {
193
+ export const SegmentedControl = forwardRef(function SegmentedControl({ label, items, value: valueProp, defaultValue, onValueChange, size = segmentedControlRecipe.defaults.size, presentation = "connected", selectionMotion: suppliedSelectionMotion, name, className, layoutStyle, style, ...props }, ref) {
194
+ const designProfile = useDesignProfileDefaults();
195
+ const selectionMotion = suppliedSelectionMotion ?? designProfile?.interactions.selectionMotion ?? "none";
193
196
  validateItems("SegmentedControl", items);
194
197
  const descriptors = items.map((item) => ({
195
198
  id: item.value,
@@ -223,6 +226,48 @@ export const SegmentedControl = forwardRef(function SegmentedControl({ label, it
223
226
  if (!controlled && value !== storedValue)
224
227
  setValue(value);
225
228
  }, [controlled, setValue, storedValue, value]);
226
- return (_jsxs("fieldset", { ...props, ref: ref, style: { ...style, ...layoutStyle }, className: classNames("hjm-segmented", className), "data-size": size, "data-presentation": presentation, children: [_jsx("legend", { className: "hjm-visually-hidden", children: label }), _jsx("div", { className: "hjm-segmented__items", children: items.map((item) => (_jsxs("label", { className: "hjm-segmented__item", "data-state": item.value === value ? "checked" : "unchecked", "data-disabled": item.disabled || undefined, children: [_jsx("input", { type: "radio", name: name ?? generatedName, value: item.value, checked: item.value === value, disabled: item.disabled, required: true, onChange: () => setValue(item.value) }), _jsx("span", { children: item.label })] }, item.value))) })] }));
229
+ const trackRef = useRef(null);
230
+ const highlightRef = useRef(null);
231
+ const previousSelection = useRef(null);
232
+ useLayoutEffect(() => {
233
+ const track = trackRef.current;
234
+ const highlight = highlightRef.current;
235
+ if (selectionMotion !== "slide" || !track || !highlight) {
236
+ previousSelection.current = null;
237
+ if (track)
238
+ delete track.dataset.highlightReady;
239
+ return;
240
+ }
241
+ const selected = Array.from(track.querySelectorAll(".hjm-segmented__item")).find(item => item.dataset.state === "checked");
242
+ if (!selected)
243
+ return;
244
+ const place = (animate) => {
245
+ // CSS owns reduced motion (both provider and OS); no provider import is
246
+ // added to this small selection entry just for decorative artwork.
247
+ highlight.dataset.moving = animate && !document.hidden ? "true" : "false";
248
+ const inset = presentation === "pills" ? Number.parseFloat(getComputedStyle(selected, "::before").top) || 0 : 0;
249
+ Object.assign(highlight.style, { left: `${selected.offsetLeft}px`, top: `${selected.offsetTop + inset}px`, width: `${selected.offsetWidth}px`, height: `${selected.offsetHeight - inset * 2}px`, opacity: selected.dataset.disabled === "true" ? "0.5" : "1" });
250
+ track.dataset.highlightReady = "true";
251
+ };
252
+ place(previousSelection.current !== null && previousSelection.current !== value);
253
+ previousSelection.current = value;
254
+ let bounds = `${selected.offsetLeft}:${selected.offsetTop}:${selected.offsetWidth}:${selected.offsetHeight}`;
255
+ const observer = typeof ResizeObserver === "undefined" ? undefined : new ResizeObserver(() => {
256
+ const next = `${selected.offsetLeft}:${selected.offsetTop}:${selected.offsetWidth}:${selected.offsetHeight}`;
257
+ if (next !== bounds) {
258
+ bounds = next;
259
+ place(false);
260
+ }
261
+ });
262
+ for (const item of track.querySelectorAll(".hjm-segmented__item"))
263
+ observer?.observe(item);
264
+ // Fixed-width RTL pills move when the track resizes without changing their
265
+ // own size. Observing only items leaves the selected artwork at its old x.
266
+ observer?.observe(track);
267
+ const visibility = () => place(false);
268
+ document.addEventListener("visibilitychange", visibility);
269
+ return () => { observer?.disconnect(); document.removeEventListener("visibilitychange", visibility); };
270
+ }, [value, items, presentation, selectionMotion]);
271
+ return (_jsxs("fieldset", { ...props, ref: ref, style: { ...style, ...layoutStyle }, className: classNames("hjm-segmented", className), "data-size": size, "data-presentation": presentation, children: [_jsx("legend", { className: "hjm-visually-hidden", children: label }), _jsxs("div", { className: "hjm-segmented__items", ref: trackRef, children: [selectionMotion === "slide" ? _jsx("span", { ref: highlightRef, className: "hjm-segmented__highlight", "aria-hidden": "true" }) : null, items.map((item) => (_jsxs("label", { className: "hjm-segmented__item", "data-state": item.value === value ? "checked" : "unchecked", "data-disabled": item.disabled || undefined, children: [_jsx("input", { type: "radio", name: name ?? generatedName, value: item.value, checked: item.value === value, disabled: item.disabled, required: true, onChange: () => setValue(item.value) }), _jsx("span", { children: item.label })] }, item.value)))] })] }));
227
272
  });
228
273
  //# sourceMappingURL=selection.js.map