@hjmds/react 1.10.0 → 1.12.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 (156) hide show
  1. package/README.md +14 -0
  2. package/THIRD_PARTY_NOTICES.md +78 -0
  3. package/dist/actions.d.ts.map +1 -1
  4. package/dist/actions.js +1 -1
  5. package/dist/actions.js.map +1 -1
  6. package/dist/activity-heatmap.d.ts +10 -0
  7. package/dist/activity-heatmap.d.ts.map +1 -0
  8. package/dist/activity-heatmap.js +6 -0
  9. package/dist/activity-heatmap.js.map +1 -0
  10. package/dist/advanced-display.d.ts +3 -0
  11. package/dist/advanced-display.d.ts.map +1 -1
  12. package/dist/advanced-display.js +9 -7
  13. package/dist/advanced-display.js.map +1 -1
  14. package/dist/advanced-forms.js +1 -1
  15. package/dist/advanced-forms.js.map +1 -1
  16. package/dist/auth-screen.d.ts +8 -0
  17. package/dist/auth-screen.d.ts.map +1 -1
  18. package/dist/auth-screen.js +5 -2
  19. package/dist/auth-screen.js.map +1 -1
  20. package/dist/avatar-blobatar-motion.d.ts +6 -0
  21. package/dist/avatar-blobatar-motion.d.ts.map +1 -0
  22. package/dist/avatar-blobatar-motion.js +22 -0
  23. package/dist/avatar-blobatar-motion.js.map +1 -0
  24. package/dist/avatar-blobatar.d.ts +6 -0
  25. package/dist/avatar-blobatar.d.ts.map +1 -0
  26. package/dist/avatar-blobatar.js +10 -0
  27. package/dist/avatar-blobatar.js.map +1 -0
  28. package/dist/bottom-navigation.d.ts.map +1 -1
  29. package/dist/bottom-navigation.js +3 -3
  30. package/dist/bottom-navigation.js.map +1 -1
  31. package/dist/carousel-motion.d.ts +4 -1
  32. package/dist/carousel-motion.d.ts.map +1 -1
  33. package/dist/carousel-motion.js +12 -3
  34. package/dist/carousel-motion.js.map +1 -1
  35. package/dist/code-block.d.ts +8 -0
  36. package/dist/code-block.d.ts.map +1 -0
  37. package/dist/code-block.js +6 -0
  38. package/dist/code-block.js.map +1 -0
  39. package/dist/content-transition.d.ts +5 -2
  40. package/dist/content-transition.d.ts.map +1 -1
  41. package/dist/content-transition.js +6 -4
  42. package/dist/content-transition.js.map +1 -1
  43. package/dist/context-menu.d.ts.map +1 -1
  44. package/dist/context-menu.js +10 -11
  45. package/dist/context-menu.js.map +1 -1
  46. package/dist/data-table.d.ts.map +1 -1
  47. package/dist/data-table.js +2 -1
  48. package/dist/data-table.js.map +1 -1
  49. package/dist/duration-field.d.ts +11 -0
  50. package/dist/duration-field.d.ts.map +1 -0
  51. package/dist/duration-field.js +9 -0
  52. package/dist/duration-field.js.map +1 -0
  53. package/dist/effect-surface.d.ts +10 -0
  54. package/dist/effect-surface.d.ts.map +1 -0
  55. package/dist/effect-surface.js +57 -0
  56. package/dist/effect-surface.js.map +1 -0
  57. package/dist/evidence.d.ts +1 -1
  58. package/dist/evidence.js +1 -1
  59. package/dist/evidence.js.map +1 -1
  60. package/dist/feedback.js +1 -1
  61. package/dist/feedback.js.map +1 -1
  62. package/dist/folder-preview.d.ts +12 -0
  63. package/dist/folder-preview.d.ts.map +1 -0
  64. package/dist/folder-preview.js +7 -0
  65. package/dist/folder-preview.js.map +1 -0
  66. package/dist/forms.d.ts +3 -1
  67. package/dist/forms.d.ts.map +1 -1
  68. package/dist/forms.js +5 -3
  69. package/dist/forms.js.map +1 -1
  70. package/dist/gravity-letters.d.ts +8 -0
  71. package/dist/gravity-letters.d.ts.map +1 -0
  72. package/dist/gravity-letters.js +24 -0
  73. package/dist/gravity-letters.js.map +1 -0
  74. package/dist/grid-reveal.d.ts +9 -0
  75. package/dist/grid-reveal.d.ts.map +1 -0
  76. package/dist/grid-reveal.js +21 -0
  77. package/dist/grid-reveal.js.map +1 -0
  78. package/dist/icon-lucide.d.ts +11 -0
  79. package/dist/icon-lucide.d.ts.map +1 -0
  80. package/dist/icon-lucide.js +11 -0
  81. package/dist/icon-lucide.js.map +1 -0
  82. package/dist/inline-confirm.d.ts +14 -0
  83. package/dist/inline-confirm.d.ts.map +1 -0
  84. package/dist/inline-confirm.js +37 -0
  85. package/dist/inline-confirm.js.map +1 -0
  86. package/dist/menu-morph.d.ts.map +1 -1
  87. package/dist/menu-morph.js +9 -6
  88. package/dist/menu-morph.js.map +1 -1
  89. package/dist/menu-typeahead.d.ts +13 -0
  90. package/dist/menu-typeahead.d.ts.map +1 -0
  91. package/dist/menu-typeahead.js +17 -0
  92. package/dist/menu-typeahead.js.map +1 -0
  93. package/dist/navigation-bar.d.ts +10 -0
  94. package/dist/navigation-bar.d.ts.map +1 -0
  95. package/dist/navigation-bar.js +10 -0
  96. package/dist/navigation-bar.js.map +1 -0
  97. package/dist/navigation.d.ts +3 -3
  98. package/dist/navigation.d.ts.map +1 -1
  99. package/dist/navigation.js +63 -22
  100. package/dist/navigation.js.map +1 -1
  101. package/dist/notification-bell.d.ts +11 -0
  102. package/dist/notification-bell.d.ts.map +1 -0
  103. package/dist/notification-bell.js +27 -0
  104. package/dist/notification-bell.js.map +1 -0
  105. package/dist/overlays.d.ts +0 -2
  106. package/dist/overlays.d.ts.map +1 -1
  107. package/dist/overlays.js +5 -18
  108. package/dist/overlays.js.map +1 -1
  109. package/dist/provider-button.d.ts.map +1 -1
  110. package/dist/provider-button.js +2 -2
  111. package/dist/provider-button.js.map +1 -1
  112. package/dist/reaction-picker.d.ts +11 -0
  113. package/dist/reaction-picker.d.ts.map +1 -0
  114. package/dist/reaction-picker.js +9 -0
  115. package/dist/reaction-picker.js.map +1 -0
  116. package/dist/scroll-progress.d.ts +10 -0
  117. package/dist/scroll-progress.d.ts.map +1 -0
  118. package/dist/scroll-progress.js +34 -0
  119. package/dist/scroll-progress.js.map +1 -0
  120. package/dist/select.d.ts +0 -1
  121. package/dist/select.d.ts.map +1 -1
  122. package/dist/select.js +2 -4
  123. package/dist/select.js.map +1 -1
  124. package/dist/sidebar.d.ts +3 -0
  125. package/dist/sidebar.d.ts.map +1 -1
  126. package/dist/sidebar.js +23 -4
  127. package/dist/sidebar.js.map +1 -1
  128. package/dist/step-player.d.ts +24 -0
  129. package/dist/step-player.d.ts.map +1 -0
  130. package/dist/step-player.js +16 -0
  131. package/dist/step-player.js.map +1 -0
  132. package/dist/styles.css +94 -1
  133. package/dist/styles.layered.css +94 -1
  134. package/dist/supplemental-display.d.ts +10 -2
  135. package/dist/supplemental-display.d.ts.map +1 -1
  136. package/dist/supplemental-display.js +2 -2
  137. package/dist/supplemental-display.js.map +1 -1
  138. package/dist/supplemental-navigation.js +1 -1
  139. package/dist/supplemental-navigation.js.map +1 -1
  140. package/dist/table-sort-button.d.ts +15 -0
  141. package/dist/table-sort-button.d.ts.map +1 -0
  142. package/dist/table-sort-button.js +7 -0
  143. package/dist/table-sort-button.js.map +1 -0
  144. package/dist/task-list.d.ts +16 -0
  145. package/dist/task-list.d.ts.map +1 -0
  146. package/dist/task-list.js +17 -0
  147. package/dist/task-list.js.map +1 -0
  148. package/dist/thinking-orb.d.ts +1 -1
  149. package/dist/thinking-orb.d.ts.map +1 -1
  150. package/dist/thinking-orb.js +4 -4
  151. package/dist/thinking-orb.js.map +1 -1
  152. package/dist/voice-note.d.ts +24 -0
  153. package/dist/voice-note.d.ts.map +1 -0
  154. package/dist/voice-note.js +13 -0
  155. package/dist/voice-note.js.map +1 -0
  156. package/package.json +110 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-progress.js","sourceRoot":"","sources":["../src/scroll-progress.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAsB,MAAM,yCAAyC,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAsB,MAAM,eAAe,CAAC;AAE7D,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAAC,EAAC,OAAO,EAAC,GAAG,KAAK,EAAqB,IAAE,OAAO,KAAC,QAAQ,OAAK,KAAK,EAAE,KAAK,EAAE,qBAAqB,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAA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,CAAA,KAAI,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;YAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA,QAAQ,EAAE,CAAC,CAAA,CAAC,CAAC;QAChI,MAAM,QAAQ,GAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAAA,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAC,EAAC,SAAS,EAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,aAAa,EAAC,IAAI,EAAC,CAAC,CAAC;QACrH,OAAO,EAAE,CAAC;QAAA,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAAA,OAAO,EAAE,CAAC;QAAA,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAC,QAAQ,EAAC,EAAC,OAAO,EAAC,IAAI,EAAC,CAAC,CAAC;QACxG,OAAM,GAAE,EAAE,GAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAA,MAAM,CAAC,UAAU,EAAE,CAAC,CAAA,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAA,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAC,QAAQ,CAAC,CAAC,CAAA,CAAC,CAAC;IAChI,CAAC,EAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACV,OAAO,OAAO,CAAC;AAChB,CAAC","sourcesContent":["import { useEffect, useState } from 'react';\nimport { resolveScrollProgress, type ScrollMetrics } from '@hjmds/design-contracts/scroll-progress';\nimport { Progress, type ProgressProps } from './feedback.js';\nexport type ScrollProgressProps = Omit<ProgressProps,'value'|'max'> & Readonly<{metrics:ScrollMetrics}>;\n/** Existing Progress owns its accessible name, range and visual presentation. */\nexport function ScrollProgress({metrics,...props}:ScrollProgressProps){return <Progress {...props} value={resolveScrollProgress(metrics)} max={1}/>;}\nconst empty:ScrollMetrics={offset:0,contentSize:0,viewportSize:0};\n/** Pass an actual vertical scroll host; never implicitly attach to window. */\nexport function useScrollMetrics(host:HTMLElement|null):ScrollMetrics{\n const [metrics,setMetrics]=useState<ScrollMetrics>(empty);\n useEffect(()=>{\n if(!host){setMetrics(empty);return;}\n let frame=0;\n const measure=()=>{frame=0;const next={offset:host.scrollTop,contentSize:host.scrollHeight,viewportSize:host.clientHeight};setMetrics(old=>old.offset===next.offset&&old.contentSize===next.contentSize&&old.viewportSize===next.viewportSize?old:next);};\n const schedule=()=>{if(!frame)frame=requestAnimationFrame(measure);};\n // Observe children too: an image/font can change scroll extent without resizing the host.\n const resize=new ResizeObserver(schedule);\n const observe=()=>{resize.disconnect();resize.observe(host);for(const child of host.children)resize.observe(child);schedule();};\n const mutation=new MutationObserver(observe);mutation.observe(host,{childList:true,subtree:true,characterData:true});\n observe();cancelAnimationFrame(frame);measure();host.addEventListener('scroll',schedule,{passive:true});\n return()=>{cancelAnimationFrame(frame);resize.disconnect();mutation.disconnect();host.removeEventListener('scroll',schedule);};\n },[host]);\n return metrics;\n}\n"]}
package/dist/select.d.ts CHANGED
@@ -8,7 +8,6 @@ export type SelectSection<Key extends string = string, SectionKey extends string
8
8
  export type SelectLeadingRenderProps = Readonly<{
9
9
  color: "currentColor";
10
10
  size: number;
11
- glyphSize: number;
12
11
  }>;
13
12
  export type SelectOptionLeadingRenderProps = SelectLeadingRenderProps & Readonly<{
14
13
  selected: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../src/select.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,iCAAiC,EACtC,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC5B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAE1B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,UAAU,EAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAOL,KAAK,oBAAoB,EAGzB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,E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AC;IACf,2EAA2E;IAC3E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,mFAAmF;IACnF,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,WAAW,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACpC,aAAa,CAAC,EAAE,CACd,IAAI,EAAE,oBAAoB,CAAC,GAAG,CAAC,GAAG,IAAI,EACtC,UAAU,EAAE,wBAAwB,KACjC,SAAS,CAAC;IACf,mBAAmB,CAAC,EAAE,CACpB,IAAI,EAAE,oBAAoB,CAAC,GAAG,CAAC,EAC/B,UAAU,EAAE,8BAA8B,KACvC,SAAS,CAAC;CAChB,CAAC,CAAC;AAEL,MAAM,MAAM,WAAW,CACrB,GAAG,SAAS,MAAM,GAAG,MAAM,EAC3B,UAAU,SAAS,MAAM,GAAG,MAAM,IAChC,eAAe,CAAC,GAAG,CAAC,GACtB,iBAAiB,CAAC,GAAG,EAAE,UAAU,CAAC,GAClC,oBAAoB,CAAC,GAAG,CAAC,GACzB,eAAe,GACf,gBAAgB,CAAC;AA2jBnB,eAAO,MAAM,MAAM,EAA8B,CAC/C,GAAG,SAAS,MAAM,GAAG,MAAM,EAC3B,UAAU,SAAS,MAAM,GAAG,MAAM,EAElC,KAAK,EAAE,WAAW,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,aAAa,CAAC,iBAAiB,CAAC,KACnE,YAAY,GAAG,IAAI,CAAC"}
package/dist/select.js CHANGED
@@ -323,7 +323,6 @@ function SelectInner(props, forwardedRef) {
323
323
  disabled: item.disabled ?? false,
324
324
  color: "currentColor",
325
325
  size: leadingSize,
326
- glyphSize: leadingSize,
327
326
  });
328
327
  return (_jsxs("div", { ref: (node) => {
329
328
  if (node)
@@ -339,7 +338,6 @@ function SelectInner(props, forwardedRef) {
339
338
  const triggerLeading = renderLeading?.(resolvedSelectedItem, {
340
339
  color: "currentColor",
341
340
  size: triggerLeadingSize,
342
- glyphSize: triggerLeadingSize,
343
341
  });
344
342
  return (_jsxs("div", { ref: rootRef, className: classNames("hjm-field hjm-select", fieldClassName), "data-state": disabled ? "disabled" : error ? "invalid" : open ? "focused" : "idle", "data-size": size, "data-density": density, "data-async-state": asyncState.status, "data-busy": busy || undefined, children: [label !== undefined ? (_jsxs("label", { className: "hjm-field__label", htmlFor: controlId, children: [label, required ? _jsx("span", { "aria-hidden": "true", children: " *" }) : null] })) : null, _jsxs("div", { className: "hjm-select__anchor", children: [_jsxs("button", { ...buttonProps, ref: (node) => {
345
343
  triggerRef.current = node;
@@ -347,7 +345,7 @@ function SelectInner(props, forwardedRef) {
347
345
  forwardedRef(node);
348
346
  else if (forwardedRef)
349
347
  forwardedRef.current = node;
350
- }, id: controlId, type: "button", role: "combobox", className: classNames("hjm-field__control hjm-select__trigger", className), disabled: disabled, "aria-disabled": busy || undefined, "aria-label": accessibilityLabel ?? (label === undefined ? accessibleName : undefined), "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? listboxId : undefined, "aria-activedescendant": open ? activeOptionId : undefined, "aria-busy": busy || asyncState.status === "loading" || asyncState.status === "loadingMore" || undefined, "aria-invalid": error ? true : undefined, "aria-describedby": describedBy, "aria-readonly": readOnly || undefined, "aria-required": required || undefined, onFocus: onFocus, onBlur: handleBlur, onKeyDown: handleKeyDown, onClick: (event) => {
348
+ }, id: controlId, type: "button", role: "combobox", className: classNames("hjm-field__control hjm-select__trigger", className), disabled: disabled, "aria-disabled": busy || undefined, "aria-label": accessibilityLabel ?? (label === undefined ? accessibleName : undefined), "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? listboxId : undefined, "aria-activedescendant": open ? activeOptionId : undefined, "aria-busy": busy || asyncState.status === "loading" || asyncState.status === "loadingMore" || undefined, "data-busy": busy || undefined, "aria-invalid": error ? true : undefined, "aria-describedby": describedBy, "aria-readonly": readOnly || undefined, "aria-required": required || undefined, onFocus: onFocus, onBlur: handleBlur, onKeyDown: handleKeyDown, onClick: (event) => {
351
349
  onClick?.(event);
352
350
  if (event.defaultPrevented || disabled || busy || readOnly)
353
351
  return;
@@ -355,7 +353,7 @@ function SelectInner(props, forwardedRef) {
355
353
  changeOpen(false, "trigger");
356
354
  else
357
355
  openWithIntent();
358
- }, children: [triggerLeading ? (_jsx("span", { className: "hjm-select__leading", "aria-hidden": "true", children: triggerLeading })) : null, _jsx("span", { className: "hjm-select__value", "data-state": resolvedSelectedItem ? "selected" : "placeholder", children: resolvedSelectedItem?.label ?? placeholder }), busy ? (_jsx("span", { className: "hjm-select__busy-indicator", "aria-hidden": "true" })) : (_jsx("span", { className: "hjm-select__indicator", "aria-hidden": "true", children: "\u2304" }))] }), open ? (_jsx(AnchoredPortal, { anchorRef: triggerRef, ssrFallback: "inline", ...(portalContainer === undefined ? {} : { container: portalContainer }), children: _jsxs("div", { ref: setListboxRef, id: listboxId, role: "listbox", "aria-label": accessibleName, className: "hjm-select__listbox", "data-density": density, "data-placement": popupPosition.placement, "data-align": popupPosition.align, style: popupPosition.style, children: [asyncState.status !== "idle" ? (_jsx("div", { className: "hjm-select__message", role: asyncState.status === "error" ? "alert" : "status", children: asyncState.message })) : null, !disallowEmptySelection && showOptions ? (_jsx("div", { ref: (node) => {
356
+ }, children: [triggerLeading ? (_jsx("span", { className: "hjm-select__leading", "aria-hidden": "true", children: triggerLeading })) : null, _jsx("span", { className: "hjm-select__value", "data-state": resolvedSelectedItem ? "selected" : "placeholder", children: resolvedSelectedItem?.label ?? placeholder }), busy ? (_jsx("span", { className: "hjm-select__busy-overlay", "aria-hidden": "true", children: _jsx("span", { className: "hjm-select__busy-indicator" }) })) : (_jsx("span", { className: "hjm-select__indicator", "aria-hidden": "true", children: "\u2304" }))] }), open ? (_jsx(AnchoredPortal, { anchorRef: triggerRef, ssrFallback: "inline", ...(portalContainer === undefined ? {} : { container: portalContainer }), children: _jsxs("div", { ref: setListboxRef, id: listboxId, role: "listbox", "aria-label": accessibleName, className: "hjm-select__listbox", "data-density": density, "data-placement": popupPosition.placement, "data-align": popupPosition.align, style: popupPosition.style, children: [asyncState.status !== "idle" ? (_jsx("div", { className: "hjm-select__message", role: asyncState.status === "error" ? "alert" : "status", children: asyncState.status === "loading" || asyncState.status === "loadingMore" ? _jsx("span", { className: "hjm-visually-hidden", children: asyncState.message }) : asyncState.message })) : null, !disallowEmptySelection && showOptions ? (_jsx("div", { ref: (node) => {
359
357
  if (node)
360
358
  optionRefs.current.set(emptySelectionKey, node);
361
359
  else
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../src/select.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,GAInB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,GAIvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,UAAU,EACV,YAAY,GAGb,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,UAAU,EACV,WAAW,EACX,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,GAOT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EACL,cAAc,EACd,gBAAgB,GAEjB,MAAM,aAAa,CAAC;AAoBrB,MAAM,iBAAiB,GAAG,MAAM,CAAC,4BAA4B,CAAC,CAAC;AAoF/D,SAAS,WAAW,CAClB,KAAmC,EACnC,YAAmD;IAEnD,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EACL,kBAAkB,EA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,YAAE,KAAK,GAAO,CAAC,CAAC,CAAC,IAAI,EAC3E,IAAI,CAAC,CAAC,CAAC,gBAAO,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,qBAAqB,IAAI,EAAE,GAAI,CAAC,CAAC,CAAC,IAAI,IAClF,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC,WAAW,CAKpB,CAAC","sourcesContent":["import {\n getCollectionNavigationIntent,\n getCollectionNavigationTarget,\n getCollectionTypeaheadMatch,\n reconcileSelectSelection,\n resolveCollectionItem,\n resolveSelectSelectedItem,\n validateCollection,\n type SelectCollectionSectionDescriptor,\n type SelectCollectionSource,\n type SelectOpenChangeReason,\n} from \"@hjmds/design-contracts/components/collection\";\nimport {\n resolveControlAccessibleName,\n selectBehaviorDefaults,\n type AsyncCollectionState,\n type SelectItemDescriptor,\n type WebKeyboardKey,\n} from \"@hjmds/design-contracts/behaviors\";\nimport {\n iconRecipe,\n selectRecipe,\n type SelectDensity,\n type SelectSize,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n type FocusEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type RefAttributes,\n} from \"react\";\nimport { classNames, useControllableState } from \"./internal.js\";\nimport {\n AnchoredPortal,\n useAnchoredPopup,\n type AnchoredPopupAlign,\n} from \"./portal.js\";\n\nexport type SelectItem<Key extends string = string> = SelectItemDescriptor<Key>;\nexport type SelectSection<\n Key extends string = string,\n SectionKey extends string = string,\n> = SelectCollectionSectionDescriptor<Key, SectionKey>;\n\nexport type SelectLeadingRenderProps = Readonly<{\n color: \"currentColor\";\n size: number;\n glyphSize: number;\n}>;\n\nexport type SelectOptionLeadingRenderProps = SelectLeadingRenderProps & Readonly<{\n selected: boolean;\n highlighted: boolean;\n disabled: boolean;\n}>;\n\nconst emptySelectionKey = Symbol(\"hjm-select-empty-selection\");\ntype SelectHighlightKey<Key extends string> = Key | typeof emptySelectionKey;\n\ntype SelectSourceProps<Key extends string, SectionKey extends string> =\n SelectCollectionSource<Key, SectionKey>;\n\ntype SelectSelectionProps<Key extends string> =\n | Readonly<{\n selectedKey: Key | null;\n defaultSelectedKey?: never;\n onSelectionChange(key: Key | null): void;\n }>\n | Readonly<{\n selectedKey?: never;\n defaultSelectedKey?: Key | null;\n onSelectionChange?: (key: Key | null) => void;\n }>;\n\ntype SelectOpenProps =\n | Readonly<{\n open: boolean;\n defaultOpen?: never;\n onOpenChange(open: boolean, reason: SelectOpenChangeReason): void;\n }>\n | Readonly<{\n open?: never;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean, reason: SelectOpenChangeReason) => void;\n }>;\n\ntype SelectLabelProps =\n | Readonly<{ label: string; accessibilityLabel?: string }>\n | Readonly<{ label?: never; accessibilityLabel: string }>;\n\ntype SelectBaseProps<Key extends string> = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n | \"aria-label\"\n | \"children\"\n | \"defaultValue\"\n | \"onChange\"\n | \"role\"\n | \"value\"\n> &\n Readonly<{\n description?: ReactNode;\n error?: ReactNode;\n /** Localized text shown when no item is selected. */\n placeholder: string;\n /** Localized label for the nullable empty-selection option. */\n emptySelectionLabel: string;\n asyncState?: AsyncCollectionState;\n selectedItem?: SelectItemDescriptor<Key>;\n disallowEmptySelection?: boolean;\n loop?: boolean;\n /** Locks interaction without removing the trigger from the focus order. */\n busy?: boolean;\n readOnly?: boolean;\n required?: boolean;\n size?: SelectSize;\n density?: SelectDensity;\n /** Logical listbox alignment against the trigger; automatically mirrors in RTL. */\n align?: AnchoredPopupAlign;\n fieldClassName?: string;\n portalContainer?: HTMLElement;\n locale?: string | readonly string[];\n renderLeading?: (\n item: SelectItemDescriptor<Key> | null,\n appearance: SelectLeadingRenderProps,\n ) => ReactNode;\n renderOptionLeading?: (\n item: SelectItemDescriptor<Key>,\n appearance: SelectOptionLeadingRenderProps,\n ) => ReactNode;\n }>;\n\nexport type SelectProps<\n Key extends string = string,\n SectionKey extends string = string,\n> = SelectBaseProps<Key> &\n SelectSourceProps<Key, SectionKey> &\n SelectSelectionProps<Key> &\n SelectOpenProps &\n SelectLabelProps;\n\nfunction SelectInner<Key extends string, SectionKey extends string>(\n props: SelectProps<Key, SectionKey>,\n forwardedRef: React.ForwardedRef<HTMLButtonElement>,\n) {\n const {\n items,\n sections,\n label,\n accessibilityLabel,\n description,\n error,\n placeholder,\n emptySelectionLabel,\n asyncState = { status: \"idle\" },\n selectedItem,\n disallowEmptySelection = selectBehaviorDefaults.disallowEmptySelection,\n loop = selectBehaviorDefaults.loop,\n busy = false,\n readOnly = false,\n size = selectRecipe.defaults.size,\n density = selectRecipe.defaults.density,\n align = \"start\",\n fieldClassName,\n portalContainer,\n locale,\n renderLeading,\n renderOptionLeading,\n className,\n id: idProp,\n name,\n disabled = false,\n required = false,\n selectedKey: selectedKeyProp,\n defaultSelectedKey,\n onSelectionChange,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onClick,\n onFocus,\n onBlur,\n onKeyDown,\n ...buttonProps\n } = props;\n const source: SelectCollectionSource<Key, SectionKey> = sections === undefined\n ? { items: items ?? [] }\n : { sections };\n validateCollection(source);\n const accessibleName = resolveControlAccessibleName(\n label,\n accessibilityLabel,\n \"Select\",\n );\n if (placeholder.trim().length === 0) throw new TypeError(\"Select placeholder must not be empty\");\n if (emptySelectionLabel.trim().length === 0) {\n throw new TypeError(\"Select emptySelectionLabel must not be empty\");\n }\n const flatItems = source.sections\n ? source.sections.flatMap((section) => section.items)\n : source.items;\n if (\n flatItems.length === 0 &&\n (asyncState.status === \"idle\" || asyncState.status === \"loadingMore\")\n ) {\n throw new TypeError(\"Select requires options unless its async state is transient or empty\");\n }\n const initialSelectionRef = useRef<Readonly<{ value: Key | null }> | null>(null);\n if (initialSelectionRef.current === null) {\n initialSelectionRef.current = {\n value: reconcileSelectSelection(\n source,\n selectedKeyProp ?? defaultSelectedKey ?? null,\n {\n disallowEmptySelection,\n asyncState,\n ...(selectedItem === undefined ? {} : { selectedItem }),\n },\n ),\n };\n }\n const [storedSelectedKey, setSelectedKey] = useControllableState<Key | null>({\n ...(selectedKeyProp === undefined ? {} : { value: selectedKeyProp }),\n defaultValue: initialSelectionRef.current.value,\n ...(onSelectionChange === undefined ? {} : { onChange: onSelectionChange }),\n });\n const reconciledSelectedKey = reconcileSelectSelection(source, storedSelectedKey, {\n disallowEmptySelection,\n asyncState,\n ...(selectedItem === undefined ? {} : { selectedItem }),\n });\n const reconciliationRequestRef = useRef<string | undefined>(undefined);\n useEffect(() => {\n if (storedSelectedKey === reconciledSelectedKey) {\n reconciliationRequestRef.current = undefined;\n return;\n }\n const token = `${storedSelectedKey ?? \"<empty>\"}->${reconciledSelectedKey ?? \"<empty>\"}`;\n if (reconciliationRequestRef.current === token) return;\n reconciliationRequestRef.current = token;\n setSelectedKey(reconciledSelectedKey);\n }, [reconciledSelectedKey, setSelectedKey, storedSelectedKey]);\n const resolvedSelectedItem = resolveSelectSelectedItem(\n source,\n reconciledSelectedKey,\n selectedItem !== undefined && selectedItem.id === reconciledSelectedKey\n ? selectedItem\n : undefined,\n );\n\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const openControlled = openProp !== undefined;\n const open = openControlled ? openProp : internalOpen;\n const pendingOpenRequestRef = useRef<boolean | undefined>(undefined);\n useEffect(() => {\n if (pendingOpenRequestRef.current === open) pendingOpenRequestRef.current = undefined;\n }, [open]);\n const changeOpen = useCallback(\n (nextOpen: boolean, reason: SelectOpenChangeReason) => {\n if (nextOpen === open || pendingOpenRequestRef.current === nextOpen) return;\n pendingOpenRequestRef.current = nextOpen;\n if (!openControlled) setInternalOpen(nextOpen);\n onOpenChange?.(nextOpen, reason);\n if (openControlled && nextOpen) {\n queueMicrotask(() => {\n if (pendingOpenRequestRef.current === true) {\n pendingOpenRequestRef.current = undefined;\n }\n });\n }\n },\n [onOpenChange, open, openControlled],\n );\n\n const generatedId = useId().replaceAll(\":\", \"\");\n const controlId = idProp ?? `hjm-select-${generatedId}`;\n const listboxId = `${controlId}-listbox`;\n const descriptionId = `${controlId}-description`;\n const errorId = `${controlId}-error`;\n const optionId = (key: Key) =>\n `${controlId}-option-${flatItems.findIndex((item) => item.id === key)}`;\n const rootRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const listboxRef = useRef<HTMLDivElement | null>(null);\n const [listboxNode, setListboxNode] = useState<HTMLDivElement | null>(null);\n const optionRefs = useRef(new Map<SelectHighlightKey<Key>, HTMLDivElement>());\n const typeaheadRef = useRef({ value: \"\", time: 0 });\n const restoreFocusRef = useRef(false);\n const showOptions = asyncState.status === \"idle\" || asyncState.status === \"loadingMore\";\n const emptySelectionAvailable = !disallowEmptySelection && showOptions;\n const selectionItemInSource = resolveCollectionItem(source, reconciledSelectedKey);\n const initialHighlight = selectionItemInSource && !selectionItemInSource.disabled\n ? selectionItemInSource.id\n : reconciledSelectedKey === null && emptySelectionAvailable\n ? emptySelectionKey\n : getCollectionNavigationTarget(source, null, \"first\", loop) ?? null;\n const [highlightedKey, setHighlightedKey] = useState<SelectHighlightKey<Key> | null>(\n initialHighlight,\n );\n const highlightedItem = showOptions && highlightedKey !== emptySelectionKey\n ? resolveCollectionItem(source, highlightedKey)\n : null;\n const activeKey: SelectHighlightKey<Key> | null = highlightedItem && !highlightedItem.disabled\n ? highlightedItem.id\n : highlightedKey === emptySelectionKey && emptySelectionAvailable\n ? emptySelectionKey\n : null;\n const activeOptionId = activeKey === emptySelectionKey\n ? `${controlId}-option-empty`\n : activeKey === null\n ? undefined\n : optionId(activeKey);\n const popupPosition = useAnchoredPopup(triggerRef, listboxNode, {\n align,\n matchAnchorWidth: true,\n zIndex: 800,\n });\n const setListboxRef = useCallback((node: HTMLDivElement | null) => {\n listboxRef.current = node;\n setListboxNode(node);\n }, []);\n\n useEffect(() => {\n if (!open) {\n if (restoreFocusRef.current) {\n restoreFocusRef.current = false;\n queueMicrotask(() => triggerRef.current?.focus());\n }\n return;\n }\n if (activeKey === null && showOptions) setHighlightedKey(initialHighlight);\n }, [activeKey, initialHighlight, open, showOptions]);\n useEffect(() => {\n if (open && activeKey !== null) {\n optionRefs.current.get(activeKey)?.scrollIntoView({ block: \"nearest\" });\n }\n }, [activeKey, open]);\n useEffect(() => {\n if (!open) return;\n const handlePointerDown = (event: PointerEvent) => {\n if (\n event.target instanceof Node &&\n !rootRef.current?.contains(event.target) &&\n !listboxRef.current?.contains(event.target)\n ) {\n changeOpen(false, \"outside\");\n }\n };\n document.addEventListener(\"pointerdown\", handlePointerDown);\n return () => document.removeEventListener(\"pointerdown\", handlePointerDown);\n }, [changeOpen, open]);\n\n const openWithIntent = (intent: \"first\" | \"last\" = \"first\") => {\n if (disabled || busy || readOnly) return;\n const selectedInSource = resolveCollectionItem(source, reconciledSelectedKey);\n const target = selectedInSource && !selectedInSource.disabled\n ? selectedInSource.id\n : reconciledSelectedKey === null && emptySelectionAvailable\n ? emptySelectionKey\n // The empty-selection entry renders first in the listbox, so only the\n // \"first\" intent (Home/ArrowDown on a closed trigger) lands on it; \"last\"\n // (End/ArrowUp) must reach the last real option. The previous mapping sent\n // \"last\" to the empty entry, which contradicted DOM order. See issue #18.\n : intent === \"first\" && emptySelectionAvailable\n ? emptySelectionKey\n : getCollectionNavigationTarget(source, null, intent, loop) ?? null;\n setHighlightedKey(target);\n changeOpen(true, \"keyboard\");\n };\n const moveHighlight = (intent: \"next\" | \"previous\" | \"first\" | \"last\") => {\n const enabledKeys = flatItems\n .filter((item) => !item.disabled)\n .map((item) => item.id);\n const firstKey = enabledKeys[0];\n const lastKey = enabledKeys.at(-1);\n // Treat the empty-selection entry as the first row, matching DOM order. `loop`\n // only joins the two ends of the list: moving between the empty entry and the\n // first option is adjacency, not a wrap, so it stays loop-independent. The\n // previous code gated that \"next\" on `loop`, which trapped the arrow keys on the\n // empty entry for every Select using the defaults (disallowEmptySelection: false,\n // loop: false). See issue #18.\n if (emptySelectionAvailable) {\n if (intent === \"first\") {\n setHighlightedKey(emptySelectionKey);\n return;\n }\n if (activeKey === emptySelectionKey) {\n if (intent === \"next\") {\n if (firstKey !== undefined) setHighlightedKey(firstKey);\n return;\n }\n if (intent === \"previous\") {\n if (loop && lastKey !== undefined) setHighlightedKey(lastKey);\n return;\n }\n // intent === \"last\" falls through: the shared path picks the last option.\n } else {\n if (intent === \"previous\" && activeKey === firstKey) {\n setHighlightedKey(emptySelectionKey);\n return;\n }\n if (intent === \"next\" && activeKey === lastKey && loop) {\n setHighlightedKey(emptySelectionKey);\n return;\n }\n }\n }\n const target = getCollectionNavigationTarget(\n source,\n activeKey === emptySelectionKey ? null : activeKey,\n intent,\n loop,\n );\n if (target !== undefined) setHighlightedKey(target);\n };\n const commit = (key: SelectHighlightKey<Key>) => {\n if (key === emptySelectionKey) {\n if (disabled || readOnly || !emptySelectionAvailable) return;\n setSelectedKey(null);\n restoreFocusRef.current = true;\n changeOpen(false, \"selection\");\n return;\n }\n const item = resolveCollectionItem(source, key);\n if (\n !item ||\n item.disabled ||\n disabled ||\n busy ||\n readOnly ||\n asyncState.status === \"loading\"\n ) return;\n setSelectedKey(key);\n restoreFocusRef.current = true;\n changeOpen(false, \"selection\");\n };\n const runTypeahead = (key: string) => {\n const now = Date.now();\n const previous = now - typeaheadRef.current.time < 500\n ? typeaheadRef.current.value\n : \"\";\n const combined = `${previous}${key}`;\n const query = new Set(combined.toLocaleLowerCase()).size === 1 ? key : combined;\n typeaheadRef.current = { value: combined, time: now };\n const match = getCollectionTypeaheadMatch(source, query, {\n startsAfterKey: activeKey === emptySelectionKey\n ? reconciledSelectedKey\n : activeKey ?? reconciledSelectedKey,\n ...(locale === undefined ? {} : { locale }),\n });\n if (match !== undefined) {\n setHighlightedKey(match);\n if (!open) changeOpen(true, \"keyboard\");\n }\n };\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || disabled || busy || readOnly) return;\n const navigationIntent = getCollectionNavigationIntent(\n event.key as WebKeyboardKey,\n );\n if (navigationIntent !== undefined) {\n event.preventDefault();\n if (!open) {\n openWithIntent(\n navigationIntent === \"previous\" || navigationIntent === \"last\"\n ? \"last\"\n : \"first\",\n );\n }\n else moveHighlight(navigationIntent);\n return;\n }\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n if (!open) openWithIntent();\n else if (activeKey !== null) commit(activeKey);\n } else if (event.key === \"Escape\" && open) {\n event.preventDefault();\n restoreFocusRef.current = true;\n changeOpen(false, \"escape\");\n } else if (event.key === \"Tab\" && open) {\n changeOpen(false, \"blur\");\n } else if (\n event.key.length === 1 &&\n event.key !== \" \" &&\n !event.altKey &&\n !event.ctrlKey &&\n !event.metaKey\n ) {\n event.preventDefault();\n runTypeahead(event.key);\n }\n };\n const handleBlur = (event: FocusEvent<HTMLButtonElement>) => {\n onBlur?.(event);\n if (event.defaultPrevented) return;\n queueMicrotask(() => {\n if (\n open &&\n document.activeElement instanceof Node &&\n !rootRef.current?.contains(document.activeElement) &&\n !listboxRef.current?.contains(document.activeElement)\n ) changeOpen(false, \"blur\");\n });\n };\n const describedBy = error ? errorId : description ? descriptionId : undefined;\n\n const renderOption = (item: SelectItemDescriptor<Key>) => {\n const selected = item.id === reconciledSelectedKey;\n const active = item.id === activeKey;\n const leadingSize = iconRecipe.sizes[selectRecipe.optionLeading.glyph];\n const leading = renderOptionLeading?.(item, {\n selected,\n highlighted: active,\n disabled: item.disabled ?? false,\n color: \"currentColor\",\n size: leadingSize,\n glyphSize: leadingSize,\n });\n return (\n <div\n key={item.id}\n ref={(node) => {\n if (node) optionRefs.current.set(item.id, node);\n else optionRefs.current.delete(item.id);\n }}\n id={optionId(item.id)}\n role=\"option\"\n className=\"hjm-select__option\"\n aria-selected={selected}\n aria-disabled={item.disabled || undefined}\n data-state={item.disabled ? \"disabled\" : selected ? \"selected\" : \"idle\"}\n data-active={active || undefined}\n onMouseDown={(event) => event.preventDefault()}\n onMouseMove={() => {\n if (!item.disabled) setHighlightedKey(item.id);\n }}\n onClick={() => commit(item.id)}\n >\n {leading ? (\n <span className=\"hjm-select__option-leading\" aria-hidden=\"true\">\n {leading}\n </span>\n ) : null}\n <span className=\"hjm-select__option-copy\">\n <span>{item.label}</span>\n {item.description ? (\n <span className=\"hjm-select__option-description\">{item.description}</span>\n ) : null}\n </span>\n {selected ? <span className=\"hjm-select__check\" aria-hidden=\"true\">✓</span> : null}\n </div>\n );\n };\n\n const triggerLeadingSize = iconRecipe.sizes[selectRecipe.sizes[size].glyph];\n const triggerLeading = renderLeading?.(resolvedSelectedItem, {\n color: \"currentColor\",\n size: triggerLeadingSize,\n glyphSize: triggerLeadingSize,\n });\n\n return (\n <div\n ref={rootRef}\n className={classNames(\"hjm-field hjm-select\", fieldClassName)}\n data-state={disabled ? \"disabled\" : error ? \"invalid\" : open ? \"focused\" : \"idle\"}\n data-size={size}\n data-density={density}\n data-async-state={asyncState.status}\n data-busy={busy || undefined}\n >\n {label !== undefined ? (\n <label className=\"hjm-field__label\" htmlFor={controlId}>\n {label}{required ? <span aria-hidden=\"true\"> *</span> : null}\n </label>\n ) : null}\n <div className=\"hjm-select__anchor\">\n <button\n {...buttonProps}\n ref={(node) => {\n triggerRef.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n }}\n id={controlId}\n type=\"button\"\n role=\"combobox\"\n className={classNames(\"hjm-field__control hjm-select__trigger\", className)}\n disabled={disabled}\n aria-disabled={busy || undefined}\n aria-label={accessibilityLabel ?? (label === undefined ? accessibleName : undefined)}\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-controls={open ? listboxId : undefined}\n aria-activedescendant={open ? activeOptionId : undefined}\n aria-busy={busy || asyncState.status === \"loading\" || asyncState.status === \"loadingMore\" || undefined}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy}\n aria-readonly={readOnly || undefined}\n aria-required={required || undefined}\n onFocus={onFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented || disabled || busy || readOnly) return;\n if (open) changeOpen(false, \"trigger\");\n else openWithIntent();\n }}\n >\n {triggerLeading ? (\n <span className=\"hjm-select__leading\" aria-hidden=\"true\">\n {triggerLeading}\n </span>\n ) : null}\n <span\n className=\"hjm-select__value\"\n data-state={resolvedSelectedItem ? \"selected\" : \"placeholder\"}\n >\n {resolvedSelectedItem?.label ?? placeholder}\n </span>\n {busy ? (\n <span className=\"hjm-select__busy-indicator\" aria-hidden=\"true\" />\n ) : (\n <span className=\"hjm-select__indicator\" aria-hidden=\"true\">⌄</span>\n )}\n </button>\n {open ? (\n <AnchoredPortal\n anchorRef={triggerRef}\n ssrFallback=\"inline\"\n {...(portalContainer === undefined ? {} : { container: portalContainer })}\n >\n <div\n ref={setListboxRef}\n id={listboxId}\n role=\"listbox\"\n aria-label={accessibleName}\n className=\"hjm-select__listbox\"\n data-density={density}\n data-placement={popupPosition.placement}\n data-align={popupPosition.align}\n style={popupPosition.style}\n >\n {asyncState.status !== \"idle\" ? (\n <div\n className=\"hjm-select__message\"\n role={asyncState.status === \"error\" ? \"alert\" : \"status\"}\n >\n {asyncState.message}\n </div>\n ) : null}\n {/* Rendered before the options: with no selection the active descendant\n starts on this entry, and a trailing position made that starting point\n the bottom of the list, where ArrowDown has nowhere to go (issue #18).\n moveHighlight follows this DOM order. */}\n {!disallowEmptySelection && showOptions ? (\n <div\n ref={(node) => {\n if (node) optionRefs.current.set(emptySelectionKey, node);\n else optionRefs.current.delete(emptySelectionKey);\n }}\n id={`${controlId}-option-empty`}\n role=\"option\"\n className=\"hjm-select__option hjm-select__option--empty\"\n aria-selected={reconciledSelectedKey === null}\n data-state={reconciledSelectedKey === null ? \"selected\" : \"idle\"}\n data-active={activeKey === emptySelectionKey || undefined}\n onMouseDown={(event) => event.preventDefault()}\n onMouseMove={() => setHighlightedKey(emptySelectionKey)}\n onClick={() => commit(emptySelectionKey)}\n >\n {emptySelectionLabel}\n </div>\n ) : null}\n {showOptions ? (\n source.sections ? source.sections.map((section) => {\n const sectionLabelId = `${controlId}-section-${section.id}`;\n return (\n <div\n key={section.id}\n role=\"group\"\n aria-labelledby={section.label ? sectionLabelId : undefined}\n aria-label={section.label ? undefined : section.accessibilityLabel}\n className=\"hjm-select__section\"\n >\n {section.label ? (\n <div id={sectionLabelId} className=\"hjm-select__section-label\">\n {section.label}\n </div>\n ) : null}\n {section.items.map(renderOption)}\n </div>\n );\n }) : source.items.map(renderOption)\n ) : null}\n </div>\n </AnchoredPortal>\n ) : null}\n </div>\n {description && !error ? (\n <div id={descriptionId} className=\"hjm-field__description\">{description}</div>\n ) : null}\n {error ? <div id={errorId} className=\"hjm-field__error\">{error}</div> : null}\n {name ? <input type=\"hidden\" name={name} value={reconciledSelectedKey ?? \"\"} /> : null}\n </div>\n );\n}\n\nexport const Select = forwardRef(SelectInner) as <\n Key extends string = string,\n SectionKey extends string = string,\n>(\n props: SelectProps<Key, SectionKey> & RefAttributes<HTMLButtonElement>,\n) => ReactElement | null;\n"]}
1
+ {"version":3,"file":"select.js","sourceRoot":"","sources":["../src/select.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,2BAA2B,EAC3B,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,GAInB,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,GAIvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,UAAU,EACV,YAAY,GAGb,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,UAAU,EACV,WAAW,EACX,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,GAOT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EACL,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ACJ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CACpC,CAAC,CAAC,CAAC,IAAI,IACF,GACS,CAClB,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,WAAW,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACvB,cAAK,EAAE,EAAE,aAAa,EAAE,SAAS,EAAC,wBAAwB,YAAE,WAAW,GAAO,CAC/E,CAAC,CAAC,CAAC,IAAI,EACP,KAAK,CAAC,CAAC,CAAC,cAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,kBAAkB,YAAE,KAAK,GAAO,CAAC,CAAC,CAAC,IAAI,EAC3E,IAAI,CAAC,CAAC,CAAC,gBAAO,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,qBAAqB,IAAI,EAAE,GAAI,CAAC,CAAC,CAAC,IAAI,IAClF,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAAC,WAAW,CAKpB,CAAC","sourcesContent":["import {\n getCollectionNavigationIntent,\n getCollectionNavigationTarget,\n getCollectionTypeaheadMatch,\n reconcileSelectSelection,\n resolveCollectionItem,\n resolveSelectSelectedItem,\n validateCollection,\n type SelectCollectionSectionDescriptor,\n type SelectCollectionSource,\n type SelectOpenChangeReason,\n} from \"@hjmds/design-contracts/components/collection\";\nimport {\n resolveControlAccessibleName,\n selectBehaviorDefaults,\n type AsyncCollectionState,\n type SelectItemDescriptor,\n type WebKeyboardKey,\n} from \"@hjmds/design-contracts/behaviors\";\nimport {\n iconRecipe,\n selectRecipe,\n type SelectDensity,\n type SelectSize,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useRef,\n useState,\n type ButtonHTMLAttributes,\n type FocusEvent,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type RefAttributes,\n} from \"react\";\nimport { classNames, useControllableState } from \"./internal.js\";\nimport {\n AnchoredPortal,\n useAnchoredPopup,\n type AnchoredPopupAlign,\n} from \"./portal.js\";\n\nexport type SelectItem<Key extends string = string> = SelectItemDescriptor<Key>;\nexport type SelectSection<\n Key extends string = string,\n SectionKey extends string = string,\n> = SelectCollectionSectionDescriptor<Key, SectionKey>;\n\nexport type SelectLeadingRenderProps = Readonly<{\n color: \"currentColor\";\n size: number;\n}>;\n\nexport type SelectOptionLeadingRenderProps = SelectLeadingRenderProps & Readonly<{\n selected: boolean;\n highlighted: boolean;\n disabled: boolean;\n}>;\n\nconst emptySelectionKey = Symbol(\"hjm-select-empty-selection\");\ntype SelectHighlightKey<Key extends string> = Key | typeof emptySelectionKey;\n\ntype SelectSourceProps<Key extends string, SectionKey extends string> =\n SelectCollectionSource<Key, SectionKey>;\n\ntype SelectSelectionProps<Key extends string> =\n | Readonly<{\n selectedKey: Key | null;\n defaultSelectedKey?: never;\n onSelectionChange(key: Key | null): void;\n }>\n | Readonly<{\n selectedKey?: never;\n defaultSelectedKey?: Key | null;\n onSelectionChange?: (key: Key | null) => void;\n }>;\n\ntype SelectOpenProps =\n | Readonly<{\n open: boolean;\n defaultOpen?: never;\n onOpenChange(open: boolean, reason: SelectOpenChangeReason): void;\n }>\n | Readonly<{\n open?: never;\n defaultOpen?: boolean;\n onOpenChange?: (open: boolean, reason: SelectOpenChangeReason) => void;\n }>;\n\ntype SelectLabelProps =\n | Readonly<{ label: string; accessibilityLabel?: string }>\n | Readonly<{ label?: never; accessibilityLabel: string }>;\n\ntype SelectBaseProps<Key extends string> = Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n | \"aria-label\"\n | \"children\"\n | \"defaultValue\"\n | \"onChange\"\n | \"role\"\n | \"value\"\n> &\n Readonly<{\n description?: ReactNode;\n error?: ReactNode;\n /** Localized text shown when no item is selected. */\n placeholder: string;\n /** Localized label for the nullable empty-selection option. */\n emptySelectionLabel: string;\n asyncState?: AsyncCollectionState;\n selectedItem?: SelectItemDescriptor<Key>;\n disallowEmptySelection?: boolean;\n loop?: boolean;\n /** Locks interaction without removing the trigger from the focus order. */\n busy?: boolean;\n readOnly?: boolean;\n required?: boolean;\n size?: SelectSize;\n density?: SelectDensity;\n /** Logical listbox alignment against the trigger; automatically mirrors in RTL. */\n align?: AnchoredPopupAlign;\n fieldClassName?: string;\n portalContainer?: HTMLElement;\n locale?: string | readonly string[];\n renderLeading?: (\n item: SelectItemDescriptor<Key> | null,\n appearance: SelectLeadingRenderProps,\n ) => ReactNode;\n renderOptionLeading?: (\n item: SelectItemDescriptor<Key>,\n appearance: SelectOptionLeadingRenderProps,\n ) => ReactNode;\n }>;\n\nexport type SelectProps<\n Key extends string = string,\n SectionKey extends string = string,\n> = SelectBaseProps<Key> &\n SelectSourceProps<Key, SectionKey> &\n SelectSelectionProps<Key> &\n SelectOpenProps &\n SelectLabelProps;\n\nfunction SelectInner<Key extends string, SectionKey extends string>(\n props: SelectProps<Key, SectionKey>,\n forwardedRef: React.ForwardedRef<HTMLButtonElement>,\n) {\n const {\n items,\n sections,\n label,\n accessibilityLabel,\n description,\n error,\n placeholder,\n emptySelectionLabel,\n asyncState = { status: \"idle\" },\n selectedItem,\n disallowEmptySelection = selectBehaviorDefaults.disallowEmptySelection,\n loop = selectBehaviorDefaults.loop,\n busy = false,\n readOnly = false,\n size = selectRecipe.defaults.size,\n density = selectRecipe.defaults.density,\n align = \"start\",\n fieldClassName,\n portalContainer,\n locale,\n renderLeading,\n renderOptionLeading,\n className,\n id: idProp,\n name,\n disabled = false,\n required = false,\n selectedKey: selectedKeyProp,\n defaultSelectedKey,\n onSelectionChange,\n open: openProp,\n defaultOpen = false,\n onOpenChange,\n onClick,\n onFocus,\n onBlur,\n onKeyDown,\n ...buttonProps\n } = props;\n const source: SelectCollectionSource<Key, SectionKey> = sections === undefined\n ? { items: items ?? [] }\n : { sections };\n validateCollection(source);\n const accessibleName = resolveControlAccessibleName(\n label,\n accessibilityLabel,\n \"Select\",\n );\n if (placeholder.trim().length === 0) throw new TypeError(\"Select placeholder must not be empty\");\n if (emptySelectionLabel.trim().length === 0) {\n throw new TypeError(\"Select emptySelectionLabel must not be empty\");\n }\n const flatItems = source.sections\n ? source.sections.flatMap((section) => section.items)\n : source.items;\n if (\n flatItems.length === 0 &&\n (asyncState.status === \"idle\" || asyncState.status === \"loadingMore\")\n ) {\n throw new TypeError(\"Select requires options unless its async state is transient or empty\");\n }\n const initialSelectionRef = useRef<Readonly<{ value: Key | null }> | null>(null);\n if (initialSelectionRef.current === null) {\n initialSelectionRef.current = {\n value: reconcileSelectSelection(\n source,\n selectedKeyProp ?? defaultSelectedKey ?? null,\n {\n disallowEmptySelection,\n asyncState,\n ...(selectedItem === undefined ? {} : { selectedItem }),\n },\n ),\n };\n }\n const [storedSelectedKey, setSelectedKey] = useControllableState<Key | null>({\n ...(selectedKeyProp === undefined ? {} : { value: selectedKeyProp }),\n defaultValue: initialSelectionRef.current.value,\n ...(onSelectionChange === undefined ? {} : { onChange: onSelectionChange }),\n });\n const reconciledSelectedKey = reconcileSelectSelection(source, storedSelectedKey, {\n disallowEmptySelection,\n asyncState,\n ...(selectedItem === undefined ? {} : { selectedItem }),\n });\n const reconciliationRequestRef = useRef<string | undefined>(undefined);\n useEffect(() => {\n if (storedSelectedKey === reconciledSelectedKey) {\n reconciliationRequestRef.current = undefined;\n return;\n }\n const token = `${storedSelectedKey ?? \"<empty>\"}->${reconciledSelectedKey ?? \"<empty>\"}`;\n if (reconciliationRequestRef.current === token) return;\n reconciliationRequestRef.current = token;\n setSelectedKey(reconciledSelectedKey);\n }, [reconciledSelectedKey, setSelectedKey, storedSelectedKey]);\n const resolvedSelectedItem = resolveSelectSelectedItem(\n source,\n reconciledSelectedKey,\n selectedItem !== undefined && selectedItem.id === reconciledSelectedKey\n ? selectedItem\n : undefined,\n );\n\n const [internalOpen, setInternalOpen] = useState(defaultOpen);\n const openControlled = openProp !== undefined;\n const open = openControlled ? openProp : internalOpen;\n const pendingOpenRequestRef = useRef<boolean | undefined>(undefined);\n useEffect(() => {\n if (pendingOpenRequestRef.current === open) pendingOpenRequestRef.current = undefined;\n }, [open]);\n const changeOpen = useCallback(\n (nextOpen: boolean, reason: SelectOpenChangeReason) => {\n if (nextOpen === open || pendingOpenRequestRef.current === nextOpen) return;\n pendingOpenRequestRef.current = nextOpen;\n if (!openControlled) setInternalOpen(nextOpen);\n onOpenChange?.(nextOpen, reason);\n if (openControlled && nextOpen) {\n queueMicrotask(() => {\n if (pendingOpenRequestRef.current === true) {\n pendingOpenRequestRef.current = undefined;\n }\n });\n }\n },\n [onOpenChange, open, openControlled],\n );\n\n const generatedId = useId().replaceAll(\":\", \"\");\n const controlId = idProp ?? `hjm-select-${generatedId}`;\n const listboxId = `${controlId}-listbox`;\n const descriptionId = `${controlId}-description`;\n const errorId = `${controlId}-error`;\n const optionId = (key: Key) =>\n `${controlId}-option-${flatItems.findIndex((item) => item.id === key)}`;\n const rootRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLButtonElement | null>(null);\n const listboxRef = useRef<HTMLDivElement | null>(null);\n const [listboxNode, setListboxNode] = useState<HTMLDivElement | null>(null);\n const optionRefs = useRef(new Map<SelectHighlightKey<Key>, HTMLDivElement>());\n const typeaheadRef = useRef({ value: \"\", time: 0 });\n const restoreFocusRef = useRef(false);\n const showOptions = asyncState.status === \"idle\" || asyncState.status === \"loadingMore\";\n const emptySelectionAvailable = !disallowEmptySelection && showOptions;\n const selectionItemInSource = resolveCollectionItem(source, reconciledSelectedKey);\n const initialHighlight = selectionItemInSource && !selectionItemInSource.disabled\n ? selectionItemInSource.id\n : reconciledSelectedKey === null && emptySelectionAvailable\n ? emptySelectionKey\n : getCollectionNavigationTarget(source, null, \"first\", loop) ?? null;\n const [highlightedKey, setHighlightedKey] = useState<SelectHighlightKey<Key> | null>(\n initialHighlight,\n );\n const highlightedItem = showOptions && highlightedKey !== emptySelectionKey\n ? resolveCollectionItem(source, highlightedKey)\n : null;\n const activeKey: SelectHighlightKey<Key> | null = highlightedItem && !highlightedItem.disabled\n ? highlightedItem.id\n : highlightedKey === emptySelectionKey && emptySelectionAvailable\n ? emptySelectionKey\n : null;\n const activeOptionId = activeKey === emptySelectionKey\n ? `${controlId}-option-empty`\n : activeKey === null\n ? undefined\n : optionId(activeKey);\n const popupPosition = useAnchoredPopup(triggerRef, listboxNode, {\n align,\n matchAnchorWidth: true,\n zIndex: 800,\n });\n const setListboxRef = useCallback((node: HTMLDivElement | null) => {\n listboxRef.current = node;\n setListboxNode(node);\n }, []);\n\n useEffect(() => {\n if (!open) {\n if (restoreFocusRef.current) {\n restoreFocusRef.current = false;\n queueMicrotask(() => triggerRef.current?.focus());\n }\n return;\n }\n if (activeKey === null && showOptions) setHighlightedKey(initialHighlight);\n }, [activeKey, initialHighlight, open, showOptions]);\n useEffect(() => {\n if (open && activeKey !== null) {\n optionRefs.current.get(activeKey)?.scrollIntoView({ block: \"nearest\" });\n }\n }, [activeKey, open]);\n useEffect(() => {\n if (!open) return;\n const handlePointerDown = (event: PointerEvent) => {\n if (\n event.target instanceof Node &&\n !rootRef.current?.contains(event.target) &&\n !listboxRef.current?.contains(event.target)\n ) {\n changeOpen(false, \"outside\");\n }\n };\n document.addEventListener(\"pointerdown\", handlePointerDown);\n return () => document.removeEventListener(\"pointerdown\", handlePointerDown);\n }, [changeOpen, open]);\n\n const openWithIntent = (intent: \"first\" | \"last\" = \"first\") => {\n if (disabled || busy || readOnly) return;\n const selectedInSource = resolveCollectionItem(source, reconciledSelectedKey);\n const target = selectedInSource && !selectedInSource.disabled\n ? selectedInSource.id\n : reconciledSelectedKey === null && emptySelectionAvailable\n ? emptySelectionKey\n // The empty-selection entry renders first in the listbox, so only the\n // \"first\" intent (Home/ArrowDown on a closed trigger) lands on it; \"last\"\n // (End/ArrowUp) must reach the last real option. The previous mapping sent\n // \"last\" to the empty entry, which contradicted DOM order. See issue #18.\n : intent === \"first\" && emptySelectionAvailable\n ? emptySelectionKey\n : getCollectionNavigationTarget(source, null, intent, loop) ?? null;\n setHighlightedKey(target);\n changeOpen(true, \"keyboard\");\n };\n const moveHighlight = (intent: \"next\" | \"previous\" | \"first\" | \"last\") => {\n const enabledKeys = flatItems\n .filter((item) => !item.disabled)\n .map((item) => item.id);\n const firstKey = enabledKeys[0];\n const lastKey = enabledKeys.at(-1);\n // Treat the empty-selection entry as the first row, matching DOM order. `loop`\n // only joins the two ends of the list: moving between the empty entry and the\n // first option is adjacency, not a wrap, so it stays loop-independent. The\n // previous code gated that \"next\" on `loop`, which trapped the arrow keys on the\n // empty entry for every Select using the defaults (disallowEmptySelection: false,\n // loop: false). See issue #18.\n if (emptySelectionAvailable) {\n if (intent === \"first\") {\n setHighlightedKey(emptySelectionKey);\n return;\n }\n if (activeKey === emptySelectionKey) {\n if (intent === \"next\") {\n if (firstKey !== undefined) setHighlightedKey(firstKey);\n return;\n }\n if (intent === \"previous\") {\n if (loop && lastKey !== undefined) setHighlightedKey(lastKey);\n return;\n }\n // intent === \"last\" falls through: the shared path picks the last option.\n } else {\n if (intent === \"previous\" && activeKey === firstKey) {\n setHighlightedKey(emptySelectionKey);\n return;\n }\n if (intent === \"next\" && activeKey === lastKey && loop) {\n setHighlightedKey(emptySelectionKey);\n return;\n }\n }\n }\n const target = getCollectionNavigationTarget(\n source,\n activeKey === emptySelectionKey ? null : activeKey,\n intent,\n loop,\n );\n if (target !== undefined) setHighlightedKey(target);\n };\n const commit = (key: SelectHighlightKey<Key>) => {\n if (key === emptySelectionKey) {\n if (disabled || readOnly || !emptySelectionAvailable) return;\n setSelectedKey(null);\n restoreFocusRef.current = true;\n changeOpen(false, \"selection\");\n return;\n }\n const item = resolveCollectionItem(source, key);\n if (\n !item ||\n item.disabled ||\n disabled ||\n busy ||\n readOnly ||\n asyncState.status === \"loading\"\n ) return;\n setSelectedKey(key);\n restoreFocusRef.current = true;\n changeOpen(false, \"selection\");\n };\n const runTypeahead = (key: string) => {\n const now = Date.now();\n const previous = now - typeaheadRef.current.time < 500\n ? typeaheadRef.current.value\n : \"\";\n const combined = `${previous}${key}`;\n const query = new Set(combined.toLocaleLowerCase()).size === 1 ? key : combined;\n typeaheadRef.current = { value: combined, time: now };\n const match = getCollectionTypeaheadMatch(source, query, {\n startsAfterKey: activeKey === emptySelectionKey\n ? reconciledSelectedKey\n : activeKey ?? reconciledSelectedKey,\n ...(locale === undefined ? {} : { locale }),\n });\n if (match !== undefined) {\n setHighlightedKey(match);\n if (!open) changeOpen(true, \"keyboard\");\n }\n };\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n onKeyDown?.(event);\n if (event.defaultPrevented || disabled || busy || readOnly) return;\n const navigationIntent = getCollectionNavigationIntent(\n event.key as WebKeyboardKey,\n );\n if (navigationIntent !== undefined) {\n event.preventDefault();\n if (!open) {\n openWithIntent(\n navigationIntent === \"previous\" || navigationIntent === \"last\"\n ? \"last\"\n : \"first\",\n );\n }\n else moveHighlight(navigationIntent);\n return;\n }\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n if (!open) openWithIntent();\n else if (activeKey !== null) commit(activeKey);\n } else if (event.key === \"Escape\" && open) {\n event.preventDefault();\n restoreFocusRef.current = true;\n changeOpen(false, \"escape\");\n } else if (event.key === \"Tab\" && open) {\n changeOpen(false, \"blur\");\n } else if (\n event.key.length === 1 &&\n event.key !== \" \" &&\n !event.altKey &&\n !event.ctrlKey &&\n !event.metaKey\n ) {\n event.preventDefault();\n runTypeahead(event.key);\n }\n };\n const handleBlur = (event: FocusEvent<HTMLButtonElement>) => {\n onBlur?.(event);\n if (event.defaultPrevented) return;\n queueMicrotask(() => {\n if (\n open &&\n document.activeElement instanceof Node &&\n !rootRef.current?.contains(document.activeElement) &&\n !listboxRef.current?.contains(document.activeElement)\n ) changeOpen(false, \"blur\");\n });\n };\n const describedBy = error ? errorId : description ? descriptionId : undefined;\n\n const renderOption = (item: SelectItemDescriptor<Key>) => {\n const selected = item.id === reconciledSelectedKey;\n const active = item.id === activeKey;\n const leadingSize = iconRecipe.sizes[selectRecipe.optionLeading.glyph];\n const leading = renderOptionLeading?.(item, {\n selected,\n highlighted: active,\n disabled: item.disabled ?? false,\n color: \"currentColor\",\n size: leadingSize,\n });\n return (\n <div\n key={item.id}\n ref={(node) => {\n if (node) optionRefs.current.set(item.id, node);\n else optionRefs.current.delete(item.id);\n }}\n id={optionId(item.id)}\n role=\"option\"\n className=\"hjm-select__option\"\n aria-selected={selected}\n aria-disabled={item.disabled || undefined}\n data-state={item.disabled ? \"disabled\" : selected ? \"selected\" : \"idle\"}\n data-active={active || undefined}\n onMouseDown={(event) => event.preventDefault()}\n onMouseMove={() => {\n if (!item.disabled) setHighlightedKey(item.id);\n }}\n onClick={() => commit(item.id)}\n >\n {leading ? (\n <span className=\"hjm-select__option-leading\" aria-hidden=\"true\">\n {leading}\n </span>\n ) : null}\n <span className=\"hjm-select__option-copy\">\n <span>{item.label}</span>\n {item.description ? (\n <span className=\"hjm-select__option-description\">{item.description}</span>\n ) : null}\n </span>\n {selected ? <span className=\"hjm-select__check\" aria-hidden=\"true\">✓</span> : null}\n </div>\n );\n };\n\n const triggerLeadingSize = iconRecipe.sizes[selectRecipe.sizes[size].glyph];\n const triggerLeading = renderLeading?.(resolvedSelectedItem, {\n color: \"currentColor\",\n size: triggerLeadingSize,\n });\n\n return (\n <div\n ref={rootRef}\n className={classNames(\"hjm-field hjm-select\", fieldClassName)}\n data-state={disabled ? \"disabled\" : error ? \"invalid\" : open ? \"focused\" : \"idle\"}\n data-size={size}\n data-density={density}\n data-async-state={asyncState.status}\n data-busy={busy || undefined}\n >\n {label !== undefined ? (\n <label className=\"hjm-field__label\" htmlFor={controlId}>\n {label}{required ? <span aria-hidden=\"true\"> *</span> : null}\n </label>\n ) : null}\n <div className=\"hjm-select__anchor\">\n <button\n {...buttonProps}\n ref={(node) => {\n triggerRef.current = node;\n if (typeof forwardedRef === \"function\") forwardedRef(node);\n else if (forwardedRef) forwardedRef.current = node;\n }}\n id={controlId}\n type=\"button\"\n role=\"combobox\"\n className={classNames(\"hjm-field__control hjm-select__trigger\", className)}\n disabled={disabled}\n aria-disabled={busy || undefined}\n aria-label={accessibilityLabel ?? (label === undefined ? accessibleName : undefined)}\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-controls={open ? listboxId : undefined}\n aria-activedescendant={open ? activeOptionId : undefined}\n aria-busy={busy || asyncState.status === \"loading\" || asyncState.status === \"loadingMore\" || undefined}\n data-busy={busy || undefined}\n aria-invalid={error ? true : undefined}\n aria-describedby={describedBy}\n aria-readonly={readOnly || undefined}\n aria-required={required || undefined}\n onFocus={onFocus}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onClick={(event) => {\n onClick?.(event);\n if (event.defaultPrevented || disabled || busy || readOnly) return;\n if (open) changeOpen(false, \"trigger\");\n else openWithIntent();\n }}\n >\n {triggerLeading ? (\n <span className=\"hjm-select__leading\" aria-hidden=\"true\">\n {triggerLeading}\n </span>\n ) : null}\n <span\n className=\"hjm-select__value\"\n data-state={resolvedSelectedItem ? \"selected\" : \"placeholder\"}\n >\n {resolvedSelectedItem?.label ?? placeholder}\n </span>\n {busy ? (\n <span className=\"hjm-select__busy-overlay\" aria-hidden=\"true\"><span className=\"hjm-select__busy-indicator\" /></span>\n ) : (\n <span className=\"hjm-select__indicator\" aria-hidden=\"true\">⌄</span>\n )}\n </button>\n {open ? (\n <AnchoredPortal\n anchorRef={triggerRef}\n ssrFallback=\"inline\"\n {...(portalContainer === undefined ? {} : { container: portalContainer })}\n >\n <div\n ref={setListboxRef}\n id={listboxId}\n role=\"listbox\"\n aria-label={accessibleName}\n className=\"hjm-select__listbox\"\n data-density={density}\n data-placement={popupPosition.placement}\n data-align={popupPosition.align}\n style={popupPosition.style}\n >\n {asyncState.status !== \"idle\" ? (\n <div\n className=\"hjm-select__message\"\n role={asyncState.status === \"error\" ? \"alert\" : \"status\"}\n >\n {asyncState.status === \"loading\" || asyncState.status === \"loadingMore\" ? <span className=\"hjm-visually-hidden\">{asyncState.message}</span> : asyncState.message}\n </div>\n ) : null}\n {/* Rendered before the options: with no selection the active descendant\n starts on this entry, and a trailing position made that starting point\n the bottom of the list, where ArrowDown has nowhere to go (issue #18).\n moveHighlight follows this DOM order. */}\n {!disallowEmptySelection && showOptions ? (\n <div\n ref={(node) => {\n if (node) optionRefs.current.set(emptySelectionKey, node);\n else optionRefs.current.delete(emptySelectionKey);\n }}\n id={`${controlId}-option-empty`}\n role=\"option\"\n className=\"hjm-select__option hjm-select__option--empty\"\n aria-selected={reconciledSelectedKey === null}\n data-state={reconciledSelectedKey === null ? \"selected\" : \"idle\"}\n data-active={activeKey === emptySelectionKey || undefined}\n onMouseDown={(event) => event.preventDefault()}\n onMouseMove={() => setHighlightedKey(emptySelectionKey)}\n onClick={() => commit(emptySelectionKey)}\n >\n {emptySelectionLabel}\n </div>\n ) : null}\n {showOptions ? (\n source.sections ? source.sections.map((section) => {\n const sectionLabelId = `${controlId}-section-${section.id}`;\n return (\n <div\n key={section.id}\n role=\"group\"\n aria-labelledby={section.label ? sectionLabelId : undefined}\n aria-label={section.label ? undefined : section.accessibilityLabel}\n className=\"hjm-select__section\"\n >\n {section.label ? (\n <div id={sectionLabelId} className=\"hjm-select__section-label\">\n {section.label}\n </div>\n ) : null}\n {section.items.map(renderOption)}\n </div>\n );\n }) : source.items.map(renderOption)\n ) : null}\n </div>\n </AnchoredPortal>\n ) : null}\n </div>\n {description && !error ? (\n <div id={descriptionId} className=\"hjm-field__description\">{description}</div>\n ) : null}\n {error ? <div id={errorId} className=\"hjm-field__error\">{error}</div> : null}\n {name ? <input type=\"hidden\" name={name} value={reconciledSelectedKey ?? \"\"} /> : null}\n </div>\n );\n}\n\nexport const Select = forwardRef(SelectInner) as <\n Key extends string = string,\n SectionKey extends string = string,\n>(\n props: SelectProps<Key, SectionKey> & RefAttributes<HTMLButtonElement>,\n) => ReactElement | null;\n"]}
package/dist/sidebar.d.ts CHANGED
@@ -1,7 +1,10 @@
1
1
  import { type SidebarDescriptor, type SidebarItemDescriptor } from "@hjmds/design-contracts/components/sidebar";
2
2
  import { type ReactNode } from "react";
3
+ export type SidebarAppearance = "standard" | "bounce" | "hook" | "proximity";
3
4
  export type SidebarProps<Id extends string = string, GroupId extends string = string> = Readonly<{
4
5
  descriptor: SidebarDescriptor<Id, GroupId>;
6
+ /** Decoration only; link hit areas and document-order keyboard navigation stay fixed. */
7
+ appearance?: SidebarAppearance;
5
8
  collapsed?: boolean;
6
9
  defaultCollapsed?: boolean;
7
10
  onCollapsedChange?: (collapsed: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../src/sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC3B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAGL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,YAAY,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,EAAE,OAAO,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IAC/F,UAAU,EAAE,iBAAiB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,+DAA+D;IAC/D,cAAc,CAAC,EAAE,QAAQ,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAChE,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC;IAC9B,mFAAmF;IACnF,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC;IAC5D,WAAW,CAAC,EAAE,CAAC,KAAK,EA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,CAAC,EAAE,EAAE,EAAE,KAAK,IAAI,CAAC;IAC9B,mFAAmF;IACnF,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,qBAAqB,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC;IAC5D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,CAAC,EAAE,CAAC,KAAK,SAAS,CAAC;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,eAAO,MAAM,OAAO,EA0Gd,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,EAAE,OAAO,SAAS,MAAM,GAAG,MAAM,EAChE,KAAK,EAAE,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;CAAE,KAChE,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC"}
package/dist/sidebar.js CHANGED
@@ -1,15 +1,32 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { sidebarDefaults, sidebarRecipe, validateSidebarDescriptor, } from "@hjmds/design-contracts/components/sidebar";
3
- import { forwardRef, } from "react";
3
+ import { forwardRef, useState, } from "react";
4
+ import { useOptionalHjmTheme } from "./provider.js";
4
5
  import { classNames, useControllableState } from "./internal.js";
5
- export const Sidebar = forwardRef(function Sidebar({ descriptor, collapsed: controlledCollapsed, defaultCollapsed, onCollapsedChange, collapseLabels, onNavigate, renderIcon, renderBadge, className, }, forwardedRef) {
6
+ export const Sidebar = forwardRef(function Sidebar({ descriptor, appearance = "standard", collapsed: controlledCollapsed, defaultCollapsed, onCollapsedChange, collapseLabels, onNavigate, renderIcon, renderBadge, className, }, forwardedRef) {
6
7
  validateSidebarDescriptor(descriptor);
8
+ const theme = useOptionalHjmTheme();
9
+ const animate = theme !== null && !theme.environment.reducedMotion;
10
+ const [activatedId, setActivatedId] = useState(null);
7
11
  const [collapsed, setCollapsed] = useControllableState({
8
12
  ...(controlledCollapsed === undefined ? {} : { value: controlledCollapsed }),
9
13
  defaultValue: defaultCollapsed ?? sidebarDefaults.collapsed,
10
14
  ...(onCollapsedChange === undefined ? {} : { onChange: onCollapsedChange }),
11
15
  });
12
- return (_jsxs("nav", { ref: forwardedRef, "aria-label": descriptor.accessibilityLabel, className: classNames("hjm-sidebar", className), "data-collapsed": collapsed || undefined, style: {
16
+ return (_jsxs("nav", { ref: forwardedRef, "aria-label": descriptor.accessibilityLabel, className: classNames("hjm-sidebar", className), "data-collapsed": collapsed || undefined, "data-appearance": appearance, "data-animate": animate || undefined, onPointerMove: event => {
17
+ if (appearance !== "proximity" || !animate || event.pointerType === "touch")
18
+ return;
19
+ // Only icon decoration responds to distance; moving links would shift click/focus targets.
20
+ for (const item of event.currentTarget.querySelectorAll(".hjm-sidebar__item")) {
21
+ const bounds = item.getBoundingClientRect();
22
+ const distance = Math.abs(event.clientY - (bounds.top + bounds.height / 2));
23
+ const proximity = item.getAttribute("aria-disabled") === "true" ? 0 : Math.max(0, 1 - distance / (bounds.height * 2));
24
+ item.style.setProperty("--hjm-sidebar-proximity", String(proximity));
25
+ }
26
+ }, onPointerLeave: event => {
27
+ for (const item of event.currentTarget.querySelectorAll(".hjm-sidebar__item"))
28
+ item.style.removeProperty("--hjm-sidebar-proximity");
29
+ }, style: {
13
30
  "--hjm-sidebar-width": `${collapsed ? sidebarRecipe.widths.collapsed : sidebarRecipe.widths.expanded}px`,
14
31
  "--hjm-sidebar-item-height": `${sidebarRecipe.itemMinHeight}px`,
15
32
  "--hjm-sidebar-item-radius": `${sidebarRecipe.itemRadius}px`,
@@ -17,11 +34,13 @@ export const Sidebar = forwardRef(function Sidebar({ descriptor, collapsed: cont
17
34
  "--hjm-sidebar-group-gap": `${sidebarRecipe.groupGap}px`,
18
35
  }, children: [collapseLabels ? (_jsx("button", { type: "button", className: "hjm-sidebar__toggle", "aria-expanded": !collapsed, "aria-label": collapsed ? collapseLabels.expand : collapseLabels.collapse, onClick: () => setCollapsed(!collapsed), children: _jsx("span", { "aria-hidden": "true", children: collapsed ? "»" : "«" }) })) : null, descriptor.groups.map((group) => (_jsxs("div", { className: "hjm-sidebar__group", role: "group", "aria-label": group.label, children: [group.label ? _jsx("p", { className: "hjm-sidebar__group-label", "aria-hidden": "true", children: group.label }) : null, _jsx("ul", { className: "hjm-sidebar__list", children: group.items.map((item) => {
19
36
  const current = descriptor.currentId === item.id;
20
- return (_jsx("li", { children: _jsxs("a", { className: "hjm-sidebar__item", href: item.destination?.kind === "internal" ? item.destination.href : item.destination?.href, "aria-current": current ? "page" : undefined, "aria-disabled": item.disabled || undefined, "aria-label": collapsed ? item.label : undefined, tabIndex: item.disabled ? -1 : undefined, onClick: (event) => {
37
+ return (_jsx("li", { children: _jsxs("a", { className: "hjm-sidebar__item", href: item.destination?.kind === "internal" ? item.destination.href : item.destination?.href, "aria-current": current ? "page" : undefined, "data-bounce": current && activatedId === item.id || undefined, "aria-disabled": item.disabled || undefined, "aria-label": collapsed ? item.label : undefined, tabIndex: item.disabled ? -1 : undefined, onClick: (event) => {
21
38
  if (item.disabled) {
22
39
  event.preventDefault();
23
40
  return;
24
41
  }
42
+ if (appearance === "bounce" && animate)
43
+ setActivatedId(item.id);
25
44
  onNavigate?.(item.id);
26
45
  }, children: [renderIcon ? _jsx("span", { "aria-hidden": "true", className: "hjm-sidebar__icon", children: renderIcon(item) }) : null, _jsx("span", { className: "hjm-sidebar__label", children: item.label }), item.badgeCount !== undefined ? (_jsx("span", { className: "hjm-sidebar__badge", children: renderBadge?.(item.badgeCount, item) ?? item.badgeCount })) : null] }) }, item.id));
27
46
  }) })] }, group.id)))] }));
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../src/sidebar.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,aAAa,EACb,yBAAyB,GAG1B,MAAM,4CAA4C,CAAC;AACpD,OAAO,E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AC9C,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EACxC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;wCACjB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;4CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;4CAAC,OAAO;wCAAC,CAAC;wCACtD,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oCACxB,CAAC,aAEA,UAAU,CAAC,CAAC,CAAC,8BAAkB,MAAM,EAAC,SAAS,EAAC,mBAAmB,YAAE,UAAU,CAAC,IAAI,CAAC,GAAQ,CAAC,CAAC,CAAC,IAAI,EACrG,eAAM,SAAS,EAAC,oBAAoB,YAAE,IAAI,CAAC,KAAK,GAAQ,EACvD,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAC/B,eAAM,SAAS,EAAC,oBAAoB,YAAE,WAAW,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,GAAQ,CACtG,CAAC,CAAC,CAAC,IAAI,IACN,IApBG,IAAI,CAAC,EAAE,CAqBX,CACN,CAAC;wBACJ,CAAC,CAAC,GACC,KAlCG,KAAK,CAAC,EAAE,CAmCZ,CACP,CAAC,IACE,CACP,CAAC;AACJ,CAAC,CAE6B,CAAC","sourcesContent":["import {\n sidebarDefaults,\n sidebarRecipe,\n validateSidebarDescriptor,\n type SidebarDescriptor,\n type SidebarItemDescriptor,\n} from \"@hjmds/design-contracts/components/sidebar\";\nimport {\n forwardRef,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\nimport { classNames, useControllableState } from \"./internal.js\";\n\nexport type SidebarProps<Id extends string = string, GroupId extends string = string> = Readonly<{\n descriptor: SidebarDescriptor<Id, GroupId>;\n collapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n /** Localized names for the collapse control in both states. */\n collapseLabels?: Readonly<{ collapse: string; expand: string }>;\n onNavigate?: (id: Id) => void;\n /** Product-owned icon per item; required for the collapsed rail to stay usable. */\n renderIcon?: (item: SidebarItemDescriptor<Id>) => ReactNode;\n renderBadge?: (count: number, item: SidebarItemDescriptor<Id>) => ReactNode;\n className?: string;\n}>;\n\nexport const Sidebar = forwardRef(function Sidebar<Id extends string = string, GroupId extends string = string>(\n {\n descriptor,\n collapsed: controlledCollapsed,\n defaultCollapsed,\n onCollapsedChange,\n collapseLabels,\n onNavigate,\n renderIcon,\n renderBadge,\n className,\n }: SidebarProps<Id, GroupId>,\n forwardedRef: React.Ref<HTMLElement>,\n) {\n validateSidebarDescriptor(descriptor);\n const [collapsed, setCollapsed] = useControllableState<boolean>({\n ...(controlledCollapsed === undefined ? {} : { value: controlledCollapsed }),\n defaultValue: defaultCollapsed ?? sidebarDefaults.collapsed,\n ...(onCollapsedChange === undefined ? {} : { onChange: onCollapsedChange }),\n });\n return (\n <nav\n ref={forwardedRef}\n aria-label={descriptor.accessibilityLabel}\n className={classNames(\"hjm-sidebar\", className)}\n data-collapsed={collapsed || undefined}\n style={{\n \"--hjm-sidebar-width\": `${collapsed ? sidebarRecipe.widths.collapsed : sidebarRecipe.widths.expanded}px`,\n \"--hjm-sidebar-item-height\": `${sidebarRecipe.itemMinHeight}px`,\n \"--hjm-sidebar-item-radius\": `${sidebarRecipe.itemRadius}px`,\n \"--hjm-sidebar-gap\": `${sidebarRecipe.gap}px`,\n \"--hjm-sidebar-group-gap\": `${sidebarRecipe.groupGap}px`,\n } as CSSProperties}\n >\n {collapseLabels ? (\n <button\n type=\"button\"\n className=\"hjm-sidebar__toggle\"\n aria-expanded={!collapsed}\n aria-label={collapsed ? collapseLabels.expand : collapseLabels.collapse}\n onClick={() => setCollapsed(!collapsed)}\n >\n <span aria-hidden=\"true\">{collapsed ? \"»\" : \"«\"}</span>\n </button>\n ) : null}\n {descriptor.groups.map((group) => (\n <div key={group.id} className=\"hjm-sidebar__group\" role=\"group\" aria-label={group.label}>\n {/*\n Collapsing is density, not content: the group label is hidden\n visually but the group keeps its accessible name.\n */}\n {group.label ? <p className=\"hjm-sidebar__group-label\" aria-hidden=\"true\">{group.label}</p> : null}\n <ul className=\"hjm-sidebar__list\">\n {group.items.map((item) => {\n const current = descriptor.currentId === item.id;\n return (\n <li key={item.id}>\n <a\n className=\"hjm-sidebar__item\"\n href={item.destination?.kind === \"internal\" ? item.destination.href : item.destination?.href}\n aria-current={current ? \"page\" : undefined}\n aria-disabled={item.disabled || undefined}\n // Collapsed labels are hidden visually, so the name comes\n // from the attribute instead of disappearing with the text.\n aria-label={collapsed ? item.label : undefined}\n tabIndex={item.disabled ? -1 : undefined}\n onClick={(event) => {\n if (item.disabled) { event.preventDefault(); return; }\n onNavigate?.(item.id);\n }}\n >\n {renderIcon ? <span aria-hidden=\"true\" className=\"hjm-sidebar__icon\">{renderIcon(item)}</span> : null}\n <span className=\"hjm-sidebar__label\">{item.label}</span>\n {item.badgeCount !== undefined ? (\n <span className=\"hjm-sidebar__badge\">{renderBadge?.(item.badgeCount, item) ?? item.badgeCount}</span>\n ) : null}\n </a>\n </li>\n );\n })}\n </ul>\n </div>\n ))}\n </nav>\n );\n}) as <Id extends string = string, GroupId extends string = string>(\n props: SidebarProps<Id, GroupId> & { ref?: React.Ref<HTMLElement> },\n) => React.ReactElement | null;\n"]}
1
+ {"version":3,"file":"sidebar.js","sourceRoot":"","sources":["../src/sidebar.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,aAAa,EACb,yBAAyB,GAG1B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,UAAU,EACV,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAoBjE,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,O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AAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EACxC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;wCACjB,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;4CAAC,KAAK,CAAC,cAAc,EAAE,CAAC;4CAAC,OAAO;wCAAC,CAAC;wCACtD,IAAI,UAAU,KAAK,QAAQ,IAAI,OAAO;4CAAE,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wCAChE,UAAU,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oCACxB,CAAC,aAEA,UAAU,CAAC,CAAC,CAAC,8BAAkB,MAAM,EAAC,SAAS,EAAC,mBAAmB,YAAE,UAAU,CAAC,IAAI,CAAC,GAAQ,CAAC,CAAC,CAAC,IAAI,EACrG,eAAM,SAAS,EAAC,oBAAoB,YAAE,IAAI,CAAC,KAAK,GAAQ,EACvD,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,CAC/B,eAAM,SAAS,EAAC,oBAAoB,YAAE,WAAW,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,GAAQ,CACtG,CAAC,CAAC,CAAC,IAAI,IACN,IAtBG,IAAI,CAAC,EAAE,CAuBX,CACN,CAAC;wBACJ,CAAC,CAAC,GACC,KApCG,KAAK,CAAC,EAAE,CAqCZ,CACP,CAAC,IACE,CACP,CAAC;AACJ,CAAC,CAE6B,CAAC","sourcesContent":["import {\n sidebarDefaults,\n sidebarRecipe,\n validateSidebarDescriptor,\n type SidebarDescriptor,\n type SidebarItemDescriptor,\n} from \"@hjmds/design-contracts/components/sidebar\";\nimport {\n forwardRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\nimport { classNames, useControllableState } from \"./internal.js\";\n\nexport type SidebarAppearance = \"standard\" | \"bounce\" | \"hook\" | \"proximity\";\n\nexport type SidebarProps<Id extends string = string, GroupId extends string = string> = Readonly<{\n descriptor: SidebarDescriptor<Id, GroupId>;\n /** Decoration only; link hit areas and document-order keyboard navigation stay fixed. */\n appearance?: SidebarAppearance;\n collapsed?: boolean;\n defaultCollapsed?: boolean;\n onCollapsedChange?: (collapsed: boolean) => void;\n /** Localized names for the collapse control in both states. */\n collapseLabels?: Readonly<{ collapse: string; expand: string }>;\n onNavigate?: (id: Id) => void;\n /** Product-owned icon per item; required for the collapsed rail to stay usable. */\n renderIcon?: (item: SidebarItemDescriptor<Id>) => ReactNode;\n renderBadge?: (count: number, item: SidebarItemDescriptor<Id>) => ReactNode;\n className?: string;\n}>;\n\nexport const Sidebar = forwardRef(function Sidebar<Id extends string = string, GroupId extends string = string>(\n {\n descriptor,\n appearance = \"standard\",\n collapsed: controlledCollapsed,\n defaultCollapsed,\n onCollapsedChange,\n collapseLabels,\n onNavigate,\n renderIcon,\n renderBadge,\n className,\n }: SidebarProps<Id, GroupId>,\n forwardedRef: React.Ref<HTMLElement>,\n) {\n validateSidebarDescriptor(descriptor);\n const theme = useOptionalHjmTheme();\n const animate = theme !== null && !theme.environment.reducedMotion;\n const [activatedId, setActivatedId] = useState<string | null>(null);\n const [collapsed, setCollapsed] = useControllableState<boolean>({\n ...(controlledCollapsed === undefined ? {} : { value: controlledCollapsed }),\n defaultValue: defaultCollapsed ?? sidebarDefaults.collapsed,\n ...(onCollapsedChange === undefined ? {} : { onChange: onCollapsedChange }),\n });\n return (\n <nav\n ref={forwardedRef}\n aria-label={descriptor.accessibilityLabel}\n className={classNames(\"hjm-sidebar\", className)}\n data-collapsed={collapsed || undefined}\n data-appearance={appearance}\n data-animate={animate || undefined}\n onPointerMove={event => {\n if (appearance !== \"proximity\" || !animate || event.pointerType === \"touch\") return;\n // Only icon decoration responds to distance; moving links would shift click/focus targets.\n for (const item of event.currentTarget.querySelectorAll<HTMLElement>(\".hjm-sidebar__item\")) {\n const bounds = item.getBoundingClientRect();\n const distance = Math.abs(event.clientY - (bounds.top + bounds.height / 2));\n const proximity = item.getAttribute(\"aria-disabled\") === \"true\" ? 0 : Math.max(0, 1 - distance / (bounds.height * 2));\n item.style.setProperty(\"--hjm-sidebar-proximity\", String(proximity));\n }\n }}\n onPointerLeave={event => {\n for (const item of event.currentTarget.querySelectorAll<HTMLElement>(\".hjm-sidebar__item\")) item.style.removeProperty(\"--hjm-sidebar-proximity\");\n }}\n style={{\n \"--hjm-sidebar-width\": `${collapsed ? sidebarRecipe.widths.collapsed : sidebarRecipe.widths.expanded}px`,\n \"--hjm-sidebar-item-height\": `${sidebarRecipe.itemMinHeight}px`,\n \"--hjm-sidebar-item-radius\": `${sidebarRecipe.itemRadius}px`,\n \"--hjm-sidebar-gap\": `${sidebarRecipe.gap}px`,\n \"--hjm-sidebar-group-gap\": `${sidebarRecipe.groupGap}px`,\n } as CSSProperties}\n >\n {collapseLabels ? (\n <button\n type=\"button\"\n className=\"hjm-sidebar__toggle\"\n aria-expanded={!collapsed}\n aria-label={collapsed ? collapseLabels.expand : collapseLabels.collapse}\n onClick={() => setCollapsed(!collapsed)}\n >\n <span aria-hidden=\"true\">{collapsed ? \"»\" : \"«\"}</span>\n </button>\n ) : null}\n {descriptor.groups.map((group) => (\n <div key={group.id} className=\"hjm-sidebar__group\" role=\"group\" aria-label={group.label}>\n {/*\n Collapsing is density, not content: the group label is hidden\n visually but the group keeps its accessible name.\n */}\n {group.label ? <p className=\"hjm-sidebar__group-label\" aria-hidden=\"true\">{group.label}</p> : null}\n <ul className=\"hjm-sidebar__list\">\n {group.items.map((item) => {\n const current = descriptor.currentId === item.id;\n return (\n <li key={item.id}>\n <a\n className=\"hjm-sidebar__item\"\n href={item.destination?.kind === \"internal\" ? item.destination.href : item.destination?.href}\n aria-current={current ? \"page\" : undefined}\n data-bounce={current && activatedId === item.id || undefined}\n aria-disabled={item.disabled || undefined}\n // Collapsed labels are hidden visually, so the name comes\n // from the attribute instead of disappearing with the text.\n aria-label={collapsed ? item.label : undefined}\n tabIndex={item.disabled ? -1 : undefined}\n onClick={(event) => {\n if (item.disabled) { event.preventDefault(); return; }\n if (appearance === \"bounce\" && animate) setActivatedId(item.id);\n onNavigate?.(item.id);\n }}\n >\n {renderIcon ? <span aria-hidden=\"true\" className=\"hjm-sidebar__icon\">{renderIcon(item)}</span> : null}\n <span className=\"hjm-sidebar__label\">{item.label}</span>\n {item.badgeCount !== undefined ? (\n <span className=\"hjm-sidebar__badge\">{renderBadge?.(item.badgeCount, item) ?? item.badgeCount}</span>\n ) : null}\n </a>\n </li>\n );\n })}\n </ul>\n </div>\n ))}\n </nav>\n );\n}) as <Id extends string = string, GroupId extends string = string>(\n props: SidebarProps<Id, GroupId> & { ref?: React.Ref<HTMLElement> },\n) => React.ReactElement | null;\n"]}
@@ -0,0 +1,24 @@
1
+ import type { ReactNode } from "react";
2
+ import { type StepsProps } from "./steps.js";
3
+ export type StepPlayerProps = Readonly<{
4
+ descriptor: StepsProps["descriptor"];
5
+ statusLabels: StepsProps["statusLabels"];
6
+ composeAccessibleName: StepsProps["composeAccessibleName"];
7
+ /** Playback position is supplied by the host, never estimated from elapsed time. */
8
+ progress: number;
9
+ playing: boolean;
10
+ disabled?: boolean;
11
+ labels: Readonly<{
12
+ play: string;
13
+ pause: string;
14
+ replay: string;
15
+ progress: string;
16
+ }>;
17
+ onPlayingChange: (playing: boolean) => void;
18
+ /** Host resets its cursor/progress and chooses whether replay starts immediately. */
19
+ onReplay: () => void;
20
+ children?: ReactNode;
21
+ }>;
22
+ /** Controlled playback chrome: Steps owns the cursor and Progress owns range semantics. */
23
+ export declare function StepPlayer({ descriptor, statusLabels, composeAccessibleName, progress, playing, disabled, labels, onPlayingChange, onReplay, children }: StepPlayerProps): import("react").JSX.Element;
24
+ //# sourceMappingURL=step-player.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-player.d.ts","sourceRoot":"","sources":["../src/step-player.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAKpD,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC;IACrC,UAAU,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;IACrC,YAAY,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;IACzC,qBAAqB,EAAE,UAAU,CAAC,uBAAuB,CAAC,CAAC;IAC3D,oFAAoF;IACpF,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,QAAQ,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpF,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,qFAAqF;IACrF,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC,CAAC;AAEH,2FAA2F;AAC3F,wBAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,qBAAqB,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAgB,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,eAAe,+BAahL"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Steps } from "./steps.js";
3
+ import { Progress } from "./feedback.js";
4
+ import { Button } from "./actions.js";
5
+ import { Stack } from "./layout.js";
6
+ /** Controlled playback chrome: Steps owns the cursor and Progress owns range semantics. */
7
+ export function StepPlayer({ descriptor, statusLabels, composeAccessibleName, progress, playing, disabled = false, labels, onPlayingChange, onReplay, children }) {
8
+ // No internal timer: walkthroughs, recordings and host processes have different clocks.
9
+ if (!Number.isFinite(progress) || progress < 0 || progress > 1)
10
+ throw new RangeError("StepPlayer progress must be between 0 and 1");
11
+ for (const label of Object.values(labels))
12
+ if (!label.trim())
13
+ throw new TypeError("StepPlayer requires localized control labels");
14
+ return _jsxs(Stack, { gap: "lg", children: [_jsx(Steps, { descriptor: descriptor, statusLabels: statusLabels, composeAccessibleName: composeAccessibleName }), children, _jsx(Progress, { label: labels.progress, value: progress, max: 1 }), _jsxs(Stack, { axis: "inline", gap: "sm", children: [_jsx(Button, { disabled: disabled, onClick: () => onPlayingChange(!playing), children: playing ? labels.pause : labels.play }), _jsx(Button, { disabled: disabled, tone: "ghost", onClick: onReplay, children: labels.replay })] })] });
15
+ }
16
+ //# sourceMappingURL=step-player.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"step-player.js","sourceRoot":"","sources":["../src/step-player.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,KAAK,EAAmB,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAiBpC,2FAA2F;AAC3F,MAAM,UAAU,UAAU,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,qBAAqB,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAAG,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,EAAmB;IAC/K,wFAAwF;IACxF,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,CAAC,IAAI,QAAQ,GAAG,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,6CAA6C,CAAC,CAAC;IACpI,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;QAAE,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;YAAE,MAAM,IAAI,SAAS,CAAC,8CAA8C,CAAC,CAAC;IAClI,OAAO,MAAC,KAAK,IAAC,GAAG,EAAC,IAAI,aACpB,KAAC,KAAK,IAAC,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,GAAI,EAC1G,QAAQ,EACT,KAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAI,EAC7D,MAAC,KAAK,IAAC,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAC,IAAI,aAC3B,KAAC,MAAM,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,YAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,GAAU,EACrH,KAAC,MAAM,IAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,QAAQ,YAAG,MAAM,CAAC,MAAM,GAAU,IAC9E,IACF,CAAC;AACX,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\nimport { Steps, type StepsProps } from \"./steps.js\";\nimport { Progress } from \"./feedback.js\";\nimport { Button } from \"./actions.js\";\nimport { Stack } from \"./layout.js\";\n\nexport type StepPlayerProps = Readonly<{\n descriptor: StepsProps[\"descriptor\"];\n statusLabels: StepsProps[\"statusLabels\"];\n composeAccessibleName: StepsProps[\"composeAccessibleName\"];\n /** Playback position is supplied by the host, never estimated from elapsed time. */\n progress: number;\n playing: boolean;\n disabled?: boolean;\n labels: Readonly<{ play: string; pause: string; replay: string; progress: string }>;\n onPlayingChange: (playing: boolean) => void;\n /** Host resets its cursor/progress and chooses whether replay starts immediately. */\n onReplay: () => void;\n children?: ReactNode;\n}>;\n\n/** Controlled playback chrome: Steps owns the cursor and Progress owns range semantics. */\nexport function StepPlayer({ descriptor, statusLabels, composeAccessibleName, progress, playing, disabled = false, labels, onPlayingChange, onReplay, children }: StepPlayerProps) {\n // No internal timer: walkthroughs, recordings and host processes have different clocks.\n if (!Number.isFinite(progress) || progress < 0 || progress > 1) throw new RangeError(\"StepPlayer progress must be between 0 and 1\");\n for (const label of Object.values(labels)) if (!label.trim()) throw new TypeError(\"StepPlayer requires localized control labels\");\n return <Stack gap=\"lg\">\n <Steps descriptor={descriptor} statusLabels={statusLabels} composeAccessibleName={composeAccessibleName} />\n {children}\n <Progress label={labels.progress} value={progress} max={1} />\n <Stack axis=\"inline\" gap=\"sm\">\n <Button disabled={disabled} onClick={() => onPlayingChange(!playing)}>{playing ? labels.pause : labels.play}</Button>\n <Button disabled={disabled} tone=\"ghost\" onClick={onReplay}>{labels.replay}</Button>\n </Stack>\n </Stack>;\n}\n"]}