@hjmds/react 1.10.0 → 1.11.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 (144) hide show
  1. package/README.md +14 -0
  2. package/THIRD_PARTY_NOTICES.md +78 -0
  3. package/dist/activity-heatmap.d.ts +10 -0
  4. package/dist/activity-heatmap.d.ts.map +1 -0
  5. package/dist/activity-heatmap.js +6 -0
  6. package/dist/activity-heatmap.js.map +1 -0
  7. package/dist/advanced-display.d.ts +3 -0
  8. package/dist/advanced-display.d.ts.map +1 -1
  9. package/dist/advanced-display.js +9 -7
  10. package/dist/advanced-display.js.map +1 -1
  11. package/dist/auth-screen.d.ts +8 -0
  12. package/dist/auth-screen.d.ts.map +1 -1
  13. package/dist/auth-screen.js +5 -2
  14. package/dist/auth-screen.js.map +1 -1
  15. package/dist/avatar-blobatar-motion.d.ts +6 -0
  16. package/dist/avatar-blobatar-motion.d.ts.map +1 -0
  17. package/dist/avatar-blobatar-motion.js +22 -0
  18. package/dist/avatar-blobatar-motion.js.map +1 -0
  19. package/dist/avatar-blobatar.d.ts +6 -0
  20. package/dist/avatar-blobatar.d.ts.map +1 -0
  21. package/dist/avatar-blobatar.js +10 -0
  22. package/dist/avatar-blobatar.js.map +1 -0
  23. package/dist/bottom-navigation.d.ts.map +1 -1
  24. package/dist/bottom-navigation.js +3 -3
  25. package/dist/bottom-navigation.js.map +1 -1
  26. package/dist/carousel-motion.d.ts +4 -1
  27. package/dist/carousel-motion.d.ts.map +1 -1
  28. package/dist/carousel-motion.js +12 -3
  29. package/dist/carousel-motion.js.map +1 -1
  30. package/dist/code-block.d.ts +8 -0
  31. package/dist/code-block.d.ts.map +1 -0
  32. package/dist/code-block.js +6 -0
  33. package/dist/code-block.js.map +1 -0
  34. package/dist/content-transition.d.ts +5 -2
  35. package/dist/content-transition.d.ts.map +1 -1
  36. package/dist/content-transition.js +6 -4
  37. package/dist/content-transition.js.map +1 -1
  38. package/dist/context-menu.d.ts.map +1 -1
  39. package/dist/context-menu.js +10 -11
  40. package/dist/context-menu.js.map +1 -1
  41. package/dist/data-table.d.ts.map +1 -1
  42. package/dist/data-table.js +2 -1
  43. package/dist/data-table.js.map +1 -1
  44. package/dist/duration-field.d.ts +11 -0
  45. package/dist/duration-field.d.ts.map +1 -0
  46. package/dist/duration-field.js +9 -0
  47. package/dist/duration-field.js.map +1 -0
  48. package/dist/effect-surface.d.ts +10 -0
  49. package/dist/effect-surface.d.ts.map +1 -0
  50. package/dist/effect-surface.js +57 -0
  51. package/dist/effect-surface.js.map +1 -0
  52. package/dist/evidence.d.ts +1 -1
  53. package/dist/evidence.js +1 -1
  54. package/dist/evidence.js.map +1 -1
  55. package/dist/folder-preview.d.ts +12 -0
  56. package/dist/folder-preview.d.ts.map +1 -0
  57. package/dist/folder-preview.js +7 -0
  58. package/dist/folder-preview.js.map +1 -0
  59. package/dist/forms.d.ts +3 -1
  60. package/dist/forms.d.ts.map +1 -1
  61. package/dist/forms.js +2 -2
  62. package/dist/forms.js.map +1 -1
  63. package/dist/gravity-letters.d.ts +8 -0
  64. package/dist/gravity-letters.d.ts.map +1 -0
  65. package/dist/gravity-letters.js +24 -0
  66. package/dist/gravity-letters.js.map +1 -0
  67. package/dist/grid-reveal.d.ts +9 -0
  68. package/dist/grid-reveal.d.ts.map +1 -0
  69. package/dist/grid-reveal.js +21 -0
  70. package/dist/grid-reveal.js.map +1 -0
  71. package/dist/icon-lucide.d.ts +11 -0
  72. package/dist/icon-lucide.d.ts.map +1 -0
  73. package/dist/icon-lucide.js +11 -0
  74. package/dist/icon-lucide.js.map +1 -0
  75. package/dist/inline-confirm.d.ts +14 -0
  76. package/dist/inline-confirm.d.ts.map +1 -0
  77. package/dist/inline-confirm.js +37 -0
  78. package/dist/inline-confirm.js.map +1 -0
  79. package/dist/menu-morph.d.ts.map +1 -1
  80. package/dist/menu-morph.js +9 -6
  81. package/dist/menu-morph.js.map +1 -1
  82. package/dist/menu-typeahead.d.ts +13 -0
  83. package/dist/menu-typeahead.d.ts.map +1 -0
  84. package/dist/menu-typeahead.js +17 -0
  85. package/dist/menu-typeahead.js.map +1 -0
  86. package/dist/navigation-bar.d.ts +10 -0
  87. package/dist/navigation-bar.d.ts.map +1 -0
  88. package/dist/navigation-bar.js +10 -0
  89. package/dist/navigation-bar.js.map +1 -0
  90. package/dist/navigation.d.ts +3 -3
  91. package/dist/navigation.d.ts.map +1 -1
  92. package/dist/navigation.js +63 -22
  93. package/dist/navigation.js.map +1 -1
  94. package/dist/notification-bell.d.ts +11 -0
  95. package/dist/notification-bell.d.ts.map +1 -0
  96. package/dist/notification-bell.js +27 -0
  97. package/dist/notification-bell.js.map +1 -0
  98. package/dist/overlays.d.ts +0 -2
  99. package/dist/overlays.d.ts.map +1 -1
  100. package/dist/overlays.js +5 -18
  101. package/dist/overlays.js.map +1 -1
  102. package/dist/reaction-picker.d.ts +11 -0
  103. package/dist/reaction-picker.d.ts.map +1 -0
  104. package/dist/reaction-picker.js +9 -0
  105. package/dist/reaction-picker.js.map +1 -0
  106. package/dist/scroll-progress.d.ts +10 -0
  107. package/dist/scroll-progress.d.ts.map +1 -0
  108. package/dist/scroll-progress.js +34 -0
  109. package/dist/scroll-progress.js.map +1 -0
  110. package/dist/select.d.ts +0 -1
  111. package/dist/select.d.ts.map +1 -1
  112. package/dist/select.js +0 -2
  113. package/dist/select.js.map +1 -1
  114. package/dist/sidebar.d.ts +3 -0
  115. package/dist/sidebar.d.ts.map +1 -1
  116. package/dist/sidebar.js +23 -4
  117. package/dist/sidebar.js.map +1 -1
  118. package/dist/step-player.d.ts +24 -0
  119. package/dist/step-player.d.ts.map +1 -0
  120. package/dist/step-player.js +16 -0
  121. package/dist/step-player.js.map +1 -0
  122. package/dist/styles.css +84 -1
  123. package/dist/styles.layered.css +84 -1
  124. package/dist/supplemental-display.d.ts +10 -2
  125. package/dist/supplemental-display.d.ts.map +1 -1
  126. package/dist/supplemental-display.js +2 -2
  127. package/dist/supplemental-display.js.map +1 -1
  128. package/dist/table-sort-button.d.ts +15 -0
  129. package/dist/table-sort-button.d.ts.map +1 -0
  130. package/dist/table-sort-button.js +7 -0
  131. package/dist/table-sort-button.js.map +1 -0
  132. package/dist/task-list.d.ts +16 -0
  133. package/dist/task-list.d.ts.map +1 -0
  134. package/dist/task-list.js +17 -0
  135. package/dist/task-list.js.map +1 -0
  136. package/dist/thinking-orb.d.ts +1 -1
  137. package/dist/thinking-orb.d.ts.map +1 -1
  138. package/dist/thinking-orb.js +4 -4
  139. package/dist/thinking-orb.js.map +1 -1
  140. package/dist/voice-note.d.ts +24 -0
  141. package/dist/voice-note.d.ts.map +1 -0
  142. package/dist/voice-note.js +13 -0
  143. package/dist/voice-note.js.map +1 -0
  144. package/package.json +110 -5
@@ -447,6 +447,10 @@
447
447
  .hjm-otp-field__slot[data-state="focused"] { border-color: var(--hjm-color-content-brand); box-shadow: 0 0 0 2px var(--hjm-color-content-brand); }
448
448
  .hjm-otp-field__slot[data-state="invalid"] { border-color: var(--hjm-color-danger); }
449
449
 
450
+ /* Underline slots keep the same single editable input and focus contract. */
451
+ .hjm-otp-field__control[data-presentation="underline"] .hjm-otp-field__slot { border-width: 0 0 2px; border-radius: 0; }
452
+ .hjm-otp-field__control[data-presentation="underline"] .hjm-otp-field__slot[data-state="focused"] { box-shadow: 0 2px 0 var(--hjm-color-content-brand); }
453
+
450
454
  .hjm-bottom-navigation {
451
455
  position: fixed;
452
456
  z-index: 700;
@@ -1409,7 +1413,20 @@ button.hjm-list-row, a.hjm-list-row { cursor: pointer; }
1409
1413
  inline-size: 100%;
1410
1414
  text-align: center;
1411
1415
  }
1412
- .hjm-auth-screen__main { inline-size: 100%; }
1416
+ .hjm-auth-screen__main { inline-size: 100%; position: relative; }
1417
+ .hjm-auth-screen__main[data-card] {
1418
+ background: var(--hjm-color-bg);
1419
+ border-radius: var(--hjm-radius-lg);
1420
+ padding: var(--hjm-space-md);
1421
+ box-sizing: border-box;
1422
+ }
1423
+ .hjm-auth-screen__pending {
1424
+ position: absolute;
1425
+ inset: 0;
1426
+ display: flex;
1427
+ align-items: center;
1428
+ justify-content: center;
1429
+ }
1413
1430
  .hjm-auth-screen__footer {
1414
1431
  display: flex;
1415
1432
  flex-direction: column;
@@ -2631,4 +2648,70 @@ button.hjm-list-row, a.hjm-list-row { cursor: pointer; }
2631
2648
  .hjm-affix { color: var(--hjm-color-text); background: var(--hjm-color-bg); overflow-wrap: anywhere; }
2632
2649
  .hjm-affix__marker { display: block; block-size: 0; pointer-events: none; }
2633
2650
 
2651
+ /* Sidebar presentation decorates fixed link boxes; no pointer/focus target is transformed. */
2652
+ .hjm-sidebar[data-appearance="proximity"][data-animate] .hjm-sidebar__icon {
2653
+ transform: scale(calc(1 + var(--hjm-sidebar-proximity, 0) * .18));
2654
+ transition: transform var(--hjm-motion-fast);
2655
+ }
2656
+ .hjm-sidebar[data-appearance="hook"] .hjm-sidebar__item[aria-current="page"] {
2657
+ border-inline-start: 3px solid var(--hjm-color-content-brand);
2658
+ border-start-start-radius: var(--hjm-radius-lg);
2659
+ border-end-start-radius: var(--hjm-radius-lg);
2660
+ }
2661
+ @keyframes hjm-sidebar-bounce {
2662
+ 0%, 100% { transform: translateY(0); }
2663
+ 45% { transform: translateY(calc(var(--hjm-space-xxs) * -1)); }
2664
+ 75% { transform: translateY(calc(var(--hjm-space-xxs) * .5)); }
2665
+ }
2666
+ .hjm-sidebar[data-appearance="bounce"][data-animate] .hjm-sidebar__item[data-bounce] .hjm-sidebar__icon {
2667
+ animation: hjm-sidebar-bounce var(--hjm-motion-normal) ease-out;
2668
+ }
2669
+
2670
+ /* Measured elastic indicator stays beneath labels; no filter touches text or hit targets. */
2671
+ .hjm-tabs[data-appearance="gooey"] .hjm-tabs__list { position: relative; }
2672
+ .hjm-tabs[data-appearance="gooey"] .hjm-tabs__tab[data-state="selected"]::after { display: none; }
2673
+ .hjm-tabs__gooey { position: absolute; bottom: 0; height: 6px; border-radius: var(--hjm-radius-full); background: var(--hjm-color-content-brand); pointer-events: none; }
2674
+
2675
+ /* Capsule destinations retain route/link semantics. At larger text sizes we show
2676
+ every label vertically instead of shrinking type to mimic the reference. */
2677
+ .hjm-bottom-navigation[data-presentation="capsule"] .hjm-bottom-navigation__surface {
2678
+ display: flex; align-items: center; gap: var(--hjm-space-xs); background: transparent;
2679
+ }
2680
+ .hjm-bottom-navigation[data-presentation="capsule"] .hjm-bottom-navigation__list {
2681
+ display: flex; flex: 1; min-inline-size: 0; padding: var(--hjm-space-xxs);
2682
+ background: var(--hjm-color-surface); border: 1px solid var(--hjm-color-border);
2683
+ border-radius: var(--hjm-radius-full); box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
2684
+ }
2685
+ .hjm-bottom-navigation[data-presentation="capsule"] li { flex: 1; min-inline-size: 44px; }
2686
+ .hjm-bottom-navigation[data-presentation="capsule"][data-expanded-labels="false"] li[data-selected="true"] { flex: 2; }
2687
+ .hjm-bottom-navigation[data-presentation="capsule"] .hjm-bottom-navigation__item {
2688
+ min-inline-size: 44px; min-block-size: 52px; justify-content: center; border-radius: var(--hjm-radius-full);
2689
+ transition: background-color 160ms ease, color 160ms ease;
2690
+ }
2691
+ .hjm-bottom-navigation[data-presentation="capsule"][data-expanded-labels="false"] .hjm-bottom-navigation__item { flex-direction: row; }
2692
+ .hjm-bottom-navigation[data-presentation="capsule"][data-expanded-labels="false"] .hjm-bottom-navigation__item:not([data-state="selected"]) .hjm-bottom-navigation__label { display: none; }
2693
+ .hjm-bottom-navigation[data-presentation="capsule"] .hjm-bottom-navigation__item[data-state="selected"] { background: var(--hjm-color-surface-accent); }
2694
+ .hjm-bottom-navigation[data-presentation="capsule"] .hjm-bottom-navigation__primary-action { position: static; translate: none; flex-shrink: 0; }
2695
+ @media (prefers-reduced-motion: reduce) { .hjm-bottom-navigation[data-presentation="capsule"] .hjm-bottom-navigation__item { transition: none; } }
2696
+
2697
+ /* An opaque baseline remains readable when backdrop filtering is unsupported.
2698
+ Menus render through their existing portals rather than clipping in this shell. */
2699
+ .hjm-navigation-bar {
2700
+ display: flex; flex-wrap: wrap; align-items: center; gap: var(--hjm-space-md);
2701
+ padding: var(--hjm-space-sm); border: 1px solid var(--hjm-color-border);
2702
+ border-radius: var(--hjm-radius-xl); background: var(--hjm-color-surface);
2703
+ color: var(--hjm-color-text); box-shadow: 0 8px 24px rgb(0 0 0 / 12%);
2704
+ }
2705
+ @supports (backdrop-filter: blur(20px)) {
2706
+ .hjm-navigation-bar { background: color-mix(in srgb, var(--hjm-color-surface) 92%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
2707
+ }
2708
+ .hjm-navigation-bar__brand { flex-shrink: 0; padding-inline: var(--hjm-space-xs); }
2709
+ .hjm-navigation-bar__destinations, .hjm-navigation-bar__actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--hjm-space-xs); min-inline-size: 0; }
2710
+ .hjm-navigation-bar__destinations { flex: 1; }
2711
+ .hjm-navigation-bar__actions > * { max-inline-size: 100%; }
2712
+ @media (max-width: 600px) { .hjm-navigation-bar__actions { flex-basis: 100%; } }
2713
+ @media (prefers-reduced-transparency: reduce), (forced-colors: active) { .hjm-navigation-bar { background: var(--hjm-color-surface); backdrop-filter: none; } }
2714
+
2715
+ [data-motion="reduced"] .hjm-bottom-navigation[data-presentation="capsule"] .hjm-bottom-navigation__item { transition: none; }
2716
+
2634
2717
  }
@@ -1,9 +1,17 @@
1
- import { type IconDescriptor } from "@hjmds/design-contracts/components/icon";
1
+ import { type IconDescriptor, type SemanticIconName } from "@hjmds/design-contracts/components/icon";
2
2
  import { type ImageDescriptor, type ImageLoadStatus } from "@hjmds/design-contracts/components/image";
3
3
  import { type CounterBadgeSize, type CounterBadgeTone, type CounterBadgeVariant } from "@hjmds/design-contracts/recipes";
4
4
  import { type CSSProperties, type HTMLAttributes, type ImgHTMLAttributes, type ReactElement, type ReactEventHandler, type ReactNode, type Ref, type SVGAttributes } from "react";
5
5
  import type { HjmCompositionStyleProp } from "./composition-style.js";
6
- export type IconProps = Omit<SVGAttributes<SVGSVGElement>, "children" | "color"> & IconDescriptor;
6
+ export type IconProps = Omit<SVGAttributes<SVGSVGElement>, "children" | "color"> & IconDescriptor & Readonly<{
7
+ /** Optional glyph inside the existing 24-unit SVG frame; HJM owns semantics. */
8
+ renderGlyph?: (props: Readonly<{
9
+ name: SemanticIconName;
10
+ size: number;
11
+ color: string;
12
+ strokeWidth: number;
13
+ }>) => ReactNode;
14
+ }>;
7
15
  export declare const Icon: import("react").ForwardRefExoticComponent<IconProps & import("react").RefAttributes<SVGSVGElement>>;
8
16
  type ImageElementProps = Omit<ImgHTMLAttributes<HTMLImageElement>, "alt" | "aria-hidden" | "aria-label" | "children" | "className" | "height" | "onError" | "onLoad" | "role" | "src" | "style" | "width">;
9
17
  /** Canonical props handed to a framework adapter such as `next/image`. */
@@ -1 +1 @@
1
- {"version":3,"file":"supplemental-display.d.ts","sourceRoot":"","sources":["../src/supplemental-display.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAEpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAKL,KAAK,eAAe,EACpB,KAAK,eAAe,EACrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,GAAG,EACR,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAiDtE,MAAM,MAAM,SAAS,GAAG,IAAI,CAC1B,aAAa,CAAC,aAAa,CAAC,EAC5B,UAAU,GAAG,OAAO,CACrB,GAAG,cAAc,CAAC;AAEnB,eAAO,MAAM,IAAI,qGA0Df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ACb,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B;;;;OAIG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC1B,4EAA4E;IAC9E,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC,CAAC;AAEH,eAAO,MAAM,YAAY;WAhBd,MAAM;UACP,MAAM;WACL,gBAAgB;WAChB,gBAAgB;cACb,mBAAmB;IAC7B;;;;OAIG;UACG,OAAO;yBACQ,MAAM;IACzB,4EAA4E;kBAChE,uBAAuB;oDA8CxC,CAAC"}
@@ -51,7 +51,7 @@ const iconPaths = {
51
51
  visibilityOff: "m3 3 18 18M10.6 5.2A9 9 0 0 1 12 5c6 0 10 7 10 7a17 17 0 0 1-2.1 3M6.6 6.6C3.8 8.5 2 12 2 12s4 7 10 7a9 9 0 0 0 3.4-.7M9.9 9.9a3 3 0 0 0 4.2 4.2",
52
52
  warning: "M12 3 2.7 20h18.6L12 3Zm0 6v4m0 3h.01",
53
53
  };
54
- export const Icon = forwardRef(function Icon({ name, size, tone, weight, directionality, decorative, accessibilityLabel, className, style, ...props }, ref) {
54
+ export const Icon = forwardRef(function Icon({ name, size, tone, weight, directionality, decorative, accessibilityLabel, renderGlyph, className, style, ...props }, ref) {
55
55
  const descriptor = resolveIconDescriptor({
56
56
  name,
57
57
  ...(size === undefined ? {} : { size }),
@@ -64,7 +64,7 @@ export const Icon = forwardRef(function Icon({ name, size, tone, weight, directi
64
64
  const theme = useOptionalHjmTheme();
65
65
  const transform = getIconTransform(descriptor.directionality, theme?.environment.direction ?? "ltr");
66
66
  const dimension = iconRecipe.sizes[descriptor.size];
67
- return (_jsx("svg", { ...props, ref: ref, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: classNames("hjm-icon", className), "data-name": descriptor.name, "data-size": descriptor.size, "data-tone": descriptor.tone, "data-weight": descriptor.weight, "data-transform": transform, width: dimension, height: dimension, stroke: "currentColor", strokeWidth: iconRecipe.weights[descriptor.weight], strokeLinecap: "round", strokeLinejoin: "round", role: descriptor.decorative ? undefined : "img", "aria-hidden": descriptor.decorative || undefined, "aria-label": descriptor.decorative ? undefined : descriptor.accessibilityLabel, focusable: "false", style: style, children: _jsx("path", { d: iconPaths[descriptor.name] }) }));
67
+ return (_jsx("svg", { ...props, ref: ref, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: classNames("hjm-icon", className), "data-name": descriptor.name, "data-size": descriptor.size, "data-tone": descriptor.tone, "data-weight": descriptor.weight, "data-transform": transform, width: dimension, height: dimension, stroke: "currentColor", strokeWidth: iconRecipe.weights[descriptor.weight], strokeLinecap: "round", strokeLinejoin: "round", role: descriptor.decorative ? undefined : "img", "aria-hidden": descriptor.decorative || undefined, "aria-label": descriptor.decorative ? undefined : descriptor.accessibilityLabel, focusable: "false", style: style, children: renderGlyph?.({ name: descriptor.name, size: 24, color: "currentColor", strokeWidth: iconRecipe.weights[descriptor.weight] }) ?? _jsx("path", { d: iconPaths[descriptor.name] }) }));
68
68
  });
69
69
  /** Intrinsic-size image with canonical alt semantics and an accessible fallback. */
70
70
  export const Image = forwardRef(function Image({ src, width, height, fit, decorative, accessibilityLabel, imageProps, renderImage, fallback, imageRef, onLoad, onError, onLoadStatusChange, className, style, ...props }, ref) {
@@ -1 +1 @@
1
- {"version":3,"file":"supplemental-display.js","sourceRoot":"","sources":["../src/supplemental-display.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GAGtB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,sBAAsB,EACtB,sCAAsC,GAGvC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,UAAU,GAIX,MAAM,iCAAiC,CA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AAC,mDAAmD,CAAC,CAAC;IAC3E,CAAC;IACD,IAAI,GAAG,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;QAC5C,2DAA2D;QAC3D,MAAM,IAAI,SAAS,CAAC,iDAAiD,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,CACL,kBACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,mBAAmB,EAAE,SAAS,CAAC,eAC1C,IAAI,eACJ,IAAI,kBACD,OAAO,cACX,GAAG,IAAI,SAAS,EAC1B,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,WAAW,EAAE,wBAAwB,EAAE,GAAG,kBAAkB,CAAC,OAAO,IAAI,EAAkB,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,WAAW,EAAE,iBACxI,kBAAkB,KAAK,SAAS,IAAI,SAAS,gBAC9C,kBAAkB,YAE7B,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GACd,CACR,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import {\n getIconTransform,\n resolveIconDescriptor,\n type IconDescriptor,\n type SemanticIconName,\n} from \"@hjmds/design-contracts/components/icon\";\nimport {\n imageRecipe,\n resolveImageAspectRatio,\n resolveImageDescriptor,\n resolveImageFallbackAccessibilityLabel,\n type ImageDescriptor,\n type ImageLoadStatus,\n} from \"@hjmds/design-contracts/components/image\";\nimport {\n counterBadgeRecipe,\n formatCounterBadgeCount,\n iconRecipe,\n type CounterBadgeSize,\n type CounterBadgeTone,\n type CounterBadgeVariant,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ImgHTMLAttributes,\n type ReactElement,\n type ReactEventHandler,\n type ReactNode,\n type Ref,\n type SVGAttributes,\n} from \"react\";\nimport { classNames } from \"./internal.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\n/** Internal, dependency-free semantic glyph registry. All marks share one 24px stroke grid. */\nconst iconPaths = {\n add: \"M12 5v14M5 12h14\",\n ai: \"M12 2l1.2 4.1L17 8l-3.8 1.9L12 14l-1.2-4.1L7 8l3.8-1.9L12 2ZM19 14l.7 2.3L22 17.5l-2.3 1.2L19 21l-.7-2.3-2.3-1.2 2.3-1.2L19 14Z\",\n alert: \"M12 3 2.7 20h18.6L12 3Zm0 6v4m0 3h.01\",\n back: \"M15 18 9 12l6-6M9 12h10\",\n calendar: \"M5 4h14a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm2-2v4m10-4v4M3 9h18\",\n check: \"m5 12 4 4L19 6\",\n chevronDown: \"m6 9 6 6 6-6\",\n chevronEnd: \"m9 6 6 6-6 6\",\n chevronStart: \"m15 6-6 6 6 6\",\n chevronUp: \"m6 15 6-6 6 6\",\n close: \"M6 6l12 12M18 6 6 18\",\n compare: \"M8 7h11m0 0-3-3m3 3-3 3M16 17H5m0 0 3-3m-3 3 3 3\",\n copy: \"M8 8h11a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2V8Zm8 0V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3\",\n delete: \"M4 7h16M9 7V4h6v3m3 0-1 14H7L6 7m4 4v6m4-6v6\",\n download: \"M12 3v12m0 0 5-5m-5 5-5-5M4 19v2h16v-2\",\n edit: \"m4 16-1 5 5-1L19 9l-4-4L4 16Zm9-9 4 4\",\n error: \"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm0-14v5m0 3h.01\",\n favorite: \"M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8L12 21l8.8-8.6a5.5 5.5 0 0 0 0-7.8Z\",\n filter: \"M3 5h18l-7 8v6l-4 2v-8L3 5Z\",\n forward: \"m9 6 6 6-6 6m6-6H5\",\n help: \"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm-3-13a3 3 0 1 1 4.7 2.5c-1 .7-1.7 1.2-1.7 2.5m0 3h.01\",\n home: \"m3 11 9-8 9 8v10h-6v-6H9v6H3V11Z\",\n info: \"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm0-11v6m0-10h.01\",\n lock: \"M6 10h12v11H6V10Zm3 0V7a3 3 0 0 1 6 0v3\",\n menu: \"M4 6h16M4 12h16M4 18h16\",\n more: \"M5 12h.01M12 12h.01M19 12h.01\",\n notifications: \"M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9Zm-8 12h4\",\n pause: \"M8 5v14m8-14v14\",\n play: \"m8 5 11 7-11 7V5Z\",\n refresh: \"M20 7v5h-5M4 17v-5h5m10.5-3A8 8 0 0 0 6 6l-2 2m.5 7A8 8 0 0 0 18 18l2-2\",\n search: \"m21 21-4.4-4.4M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z\",\n settings: \"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm7.4-3.5 2-1.5-2-3.5-2.4 1a8 8 0 0 0-2-1.2L14.7 4h-4l-.4 2.8A8 8 0 0 0 8 8L5.6 7l-2 3.5 2 1.5a8 8 0 0 0 0 2l-2 1.5 2 3.5L8 18a8 8 0 0 0 2.3 1.2l.4 2.8h4l.3-2.8A8 8 0 0 0 17 18l2.4 1 2-3.5-2-1.5a8 8 0 0 0 0-2Z\",\n share: \"M18 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm12 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM8.6 16.5l6.8 4M15.4 6.5l-6.8 4\",\n success: \"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm-5-10 3 3 7-7\",\n trendDown: \"M3 7l7 7 4-4 7 7m0 0v-6m0 6h-6\",\n trendFlat: \"M4 12h16m0 0-4-4m4 4-4 4\",\n trendUp: \"M3 17l7-7 4 4 7-7m0 0v6m0-6h-6\",\n upload: \"M12 21V9m0 0-5 5m5-5 5 5M4 5V3h16v2\",\n user: \"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-8 9a8 8 0 0 1 16 0\",\n users: \"M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 10a7 7 0 0 1 14 0m1-16a4 4 0 0 1 0 7m0 3a6 6 0 0 1 5 6\",\n visibility: \"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12Zm10 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z\",\n visibilityOff: \"m3 3 18 18M10.6 5.2A9 9 0 0 1 12 5c6 0 10 7 10 7a17 17 0 0 1-2.1 3M6.6 6.6C3.8 8.5 2 12 2 12s4 7 10 7a9 9 0 0 0 3.4-.7M9.9 9.9a3 3 0 0 0 4.2 4.2\",\n warning: \"M12 3 2.7 20h18.6L12 3Zm0 6v4m0 3h.01\",\n} as const satisfies Record<SemanticIconName, string>;\n\nexport type IconProps = Omit<\n SVGAttributes<SVGSVGElement>,\n \"children\" | \"color\"\n> & IconDescriptor;\n\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(function Icon(\n {\n name,\n size,\n tone,\n weight,\n directionality,\n decorative,\n accessibilityLabel,\n className,\n style,\n ...props\n },\n ref,\n) {\n const descriptor = resolveIconDescriptor({\n name,\n ...(size === undefined ? {} : { size }),\n ...(tone === undefined ? {} : { tone }),\n ...(weight === undefined ? {} : { weight }),\n ...(directionality === undefined ? {} : { directionality }),\n ...(decorative === undefined ? {} : { decorative }),\n ...(accessibilityLabel === undefined ? {} : { accessibilityLabel }),\n } as IconDescriptor);\n const theme = useOptionalHjmTheme();\n const transform = getIconTransform(\n descriptor.directionality,\n theme?.environment.direction ?? \"ltr\",\n );\n const dimension = iconRecipe.sizes[descriptor.size];\n return (\n <svg\n {...props}\n ref={ref}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={classNames(\"hjm-icon\", className)}\n data-name={descriptor.name}\n data-size={descriptor.size}\n data-tone={descriptor.tone}\n data-weight={descriptor.weight}\n data-transform={transform}\n width={dimension}\n height={dimension}\n stroke=\"currentColor\"\n strokeWidth={iconRecipe.weights[descriptor.weight]}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={descriptor.decorative ? undefined : \"img\"}\n aria-hidden={descriptor.decorative || undefined}\n aria-label={descriptor.decorative ? undefined : descriptor.accessibilityLabel}\n focusable=\"false\"\n style={style}\n >\n <path d={iconPaths[descriptor.name]} />\n </svg>\n );\n});\n\ntype ImageElementProps = Omit<\n ImgHTMLAttributes<HTMLImageElement>,\n | \"alt\"\n | \"aria-hidden\"\n | \"aria-label\"\n | \"children\"\n | \"className\"\n | \"height\"\n | \"onError\"\n | \"onLoad\"\n | \"role\"\n | \"src\"\n | \"style\"\n | \"width\"\n>;\n\n/** Canonical props handed to a framework adapter such as `next/image`. */\nexport type ImageAdapterProps = ImageElementProps &\n Readonly<{\n src: string;\n alt: string;\n width: number;\n height: number;\n className?: string;\n style: CSSProperties;\n \"aria-hidden\"?: true;\n onLoad: ReactEventHandler<HTMLImageElement>;\n onError: ReactEventHandler<HTMLImageElement>;\n ref?: Ref<HTMLImageElement>;\n }>;\n\ntype ImageRootProps = Omit<\n HTMLAttributes<HTMLSpanElement>,\n | \"aria-hidden\"\n | \"aria-label\"\n | \"aria-labelledby\"\n | \"children\"\n | \"onError\"\n | \"onLoad\"\n | \"role\"\n>;\n\nexport type ImageProps = ImageRootProps &\n ImageDescriptor &\n Readonly<{\n /** Additional native `<img>` props shared with the framework adapter. */\n imageProps?: ImageElementProps &\n Readonly<{ className?: string; style?: CSSProperties }>;\n /**\n * Receives the complete accessible image contract. The adapter must pass\n * these props to its underlying image element so HJM can observe failure.\n */\n renderImage?: (props: ImageAdapterProps) => ReactElement;\n /** Visual content only; HJM keeps the fallback's accessible name. */\n fallback?: ReactNode;\n imageRef?: Ref<HTMLImageElement>;\n onLoad?: ReactEventHandler<HTMLImageElement>;\n onError?: ReactEventHandler<HTMLImageElement>;\n onLoadStatusChange?: (status: Extract<ImageLoadStatus, \"loaded\" | \"error\">) => void;\n }>;\n\ntype ImageState = Readonly<{\n src: string;\n status: Extract<ImageLoadStatus, \"loading\" | \"loaded\" | \"error\">;\n}>;\n\n/** Intrinsic-size image with canonical alt semantics and an accessible fallback. */\nexport const Image = forwardRef<HTMLSpanElement, ImageProps>(function Image(\n {\n src,\n width,\n height,\n fit,\n decorative,\n accessibilityLabel,\n imageProps,\n renderImage,\n fallback,\n imageRef,\n onLoad,\n onError,\n onLoadStatusChange,\n className,\n style,\n ...props\n },\n ref,\n) {\n const descriptor = resolveImageDescriptor({\n src,\n width,\n height,\n ...(fit === undefined ? {} : { fit }),\n ...(decorative === undefined ? {} : { decorative }),\n ...(accessibilityLabel === undefined ? {} : { accessibilityLabel }),\n } as ImageDescriptor);\n const [state, setState] = useState<ImageState>({\n src: descriptor.src,\n status: \"loading\",\n });\n const status = state.src === descriptor.src ? state.status : \"loading\";\n const {\n className: imageClassName,\n style: imageStyle,\n ...restImageProps\n } = imageProps ?? {};\n\n const handleLoad: ReactEventHandler<HTMLImageElement> = (event) => {\n setState({ src: descriptor.src, status: \"loaded\" });\n onLoadStatusChange?.(\"loaded\");\n onLoad?.(event);\n };\n const handleError: ReactEventHandler<HTMLImageElement> = (event) => {\n setState({ src: descriptor.src, status: \"error\" });\n onLoadStatusChange?.(\"error\");\n onError?.(event);\n };\n const adapterProps: ImageAdapterProps = {\n ...restImageProps,\n src: descriptor.src,\n alt: descriptor.decorative ? \"\" : descriptor.accessibilityLabel,\n width: descriptor.width,\n height: descriptor.height,\n className: classNames(\"hjm-image__asset\", imageClassName) ??\n \"hjm-image__asset\",\n style: { ...imageStyle, objectFit: descriptor.fit },\n ...(descriptor.decorative ? { \"aria-hidden\": true } : {}),\n onLoad: handleLoad,\n onError: handleError,\n ...(imageRef === undefined ? {} : { ref: imageRef }),\n };\n\n let visual: ReactNode;\n if (status === \"error\") {\n const fallbackLabel = resolveImageFallbackAccessibilityLabel(descriptor);\n visual = (\n <span\n className=\"hjm-image__fallback\"\n role={descriptor.decorative ? undefined : \"img\"}\n aria-label={fallbackLabel}\n aria-hidden={descriptor.decorative || undefined}\n >\n <span className=\"hjm-image__fallback-icon\" aria-hidden=\"true\">\n {fallback ?? (\n <Icon\n name={imageRecipe.fallback.icon.name}\n tone={imageRecipe.fallback.icon.tone}\n decorative\n />\n )}\n </span>\n </span>\n );\n } else if (renderImage === undefined) {\n const { ref: assetRef, ...nativeImageProps } = adapterProps;\n visual = <img {...nativeImageProps} ref={assetRef} />;\n } else {\n visual = renderImage(adapterProps);\n }\n\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-image\", className)}\n data-fit={descriptor.fit}\n data-status={status}\n style={{\n inlineSize: descriptor.width,\n ...style,\n aspectRatio: resolveImageAspectRatio(\n descriptor.width,\n descriptor.height,\n ),\n }}\n >\n {visual}\n </span>\n );\n});\n\nexport type CounterBadgeProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n count: number;\n max?: number;\n tone?: CounterBadgeTone;\n size?: CounterBadgeSize;\n variant?: CounterBadgeVariant;\n /**\n * Says \"there is something new\" without a number. Use it where the count is\n * unknown or not worth reading; inventing a number would be worse than\n * saying none. The accessible name then carries the whole meaning.\n */\n dot?: boolean;\n accessibilityLabel?: string;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const CounterBadge = forwardRef<HTMLSpanElement, CounterBadgeProps>(\n function CounterBadge(\n {\n count,\n max = counterBadgeRecipe.defaults.max,\n tone = counterBadgeRecipe.defaults.tone,\n size = counterBadgeRecipe.defaults.size,\n variant = counterBadgeRecipe.defaults.variant,\n dot = false,\n accessibilityLabel,\n className,\n layoutStyle,\n style,\n ...props\n },\n ref,\n ) {\n const label = formatCounterBadgeCount(count, max);\n if (accessibilityLabel !== undefined && accessibilityLabel.trim().length === 0) {\n throw new TypeError(\"CounterBadge accessibilityLabel must not be empty\");\n }\n if (dot && accessibilityLabel === undefined) {\n // A dot with no name is a decoration that nobody can read.\n throw new TypeError(\"CounterBadge dot requires an accessibilityLabel\");\n }\n if (label === null) return null;\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-counter-badge\", className)}\n data-tone={tone}\n data-size={size}\n data-variant={variant}\n data-dot={dot || undefined}\n style={dot ? { ...style, ...layoutStyle, \"--hjm-counter-dot-size\": `${counterBadgeRecipe.dotSize}px` } as typeof style : { ...style, ...layoutStyle }}\n aria-hidden={accessibilityLabel === undefined || undefined}\n aria-label={accessibilityLabel}\n >\n {dot ? null : label}\n </span>\n );\n },\n);\n"]}
1
+ {"version":3,"file":"supplemental-display.js","sourceRoot":"","sources":["../src/supplemental-display.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,qBAAqB,GAGtB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,sBAAsB,EACtB,sCAAsC,GAGvC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,UAAU,GAIX,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,UAAU,EACV,QAAQ,GAST,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGpD,+FAA+F;AAC/F,MAAM,SAAS,GAAG;IAChB,GAAG,EAAE,kBAAkB;IACvB,EAAE,EAAE,iIAAiI;IACrI,KAAK,EAAE,uC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AS,EAAE,CAAC;QAC5C,2DAA2D;QAC3D,MAAM,IAAI,SAAS,CAAC,iDAAiD,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,OAAO,CACL,kBACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,mBAAmB,EAAE,SAAS,CAAC,eAC1C,IAAI,eACJ,IAAI,kBACD,OAAO,cACX,GAAG,IAAI,SAAS,EAC1B,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,WAAW,EAAE,wBAAwB,EAAE,GAAG,kBAAkB,CAAC,OAAO,IAAI,EAAkB,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,WAAW,EAAE,iBACxI,kBAAkB,KAAK,SAAS,IAAI,SAAS,gBAC9C,kBAAkB,YAE7B,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GACd,CACR,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import {\n getIconTransform,\n resolveIconDescriptor,\n type IconDescriptor,\n type SemanticIconName,\n} from \"@hjmds/design-contracts/components/icon\";\nimport {\n imageRecipe,\n resolveImageAspectRatio,\n resolveImageDescriptor,\n resolveImageFallbackAccessibilityLabel,\n type ImageDescriptor,\n type ImageLoadStatus,\n} from \"@hjmds/design-contracts/components/image\";\nimport {\n counterBadgeRecipe,\n formatCounterBadgeCount,\n iconRecipe,\n type CounterBadgeSize,\n type CounterBadgeTone,\n type CounterBadgeVariant,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n forwardRef,\n useState,\n type CSSProperties,\n type HTMLAttributes,\n type ImgHTMLAttributes,\n type ReactElement,\n type ReactEventHandler,\n type ReactNode,\n type Ref,\n type SVGAttributes,\n} from \"react\";\nimport { classNames } from \"./internal.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\n/** Internal, dependency-free semantic glyph registry. All marks share one 24px stroke grid. */\nconst iconPaths = {\n add: \"M12 5v14M5 12h14\",\n ai: \"M12 2l1.2 4.1L17 8l-3.8 1.9L12 14l-1.2-4.1L7 8l3.8-1.9L12 2ZM19 14l.7 2.3L22 17.5l-2.3 1.2L19 21l-.7-2.3-2.3-1.2 2.3-1.2L19 14Z\",\n alert: \"M12 3 2.7 20h18.6L12 3Zm0 6v4m0 3h.01\",\n back: \"M15 18 9 12l6-6M9 12h10\",\n calendar: \"M5 4h14a2 2 0 0 1 2 2v13a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm2-2v4m10-4v4M3 9h18\",\n check: \"m5 12 4 4L19 6\",\n chevronDown: \"m6 9 6 6 6-6\",\n chevronEnd: \"m9 6 6 6-6 6\",\n chevronStart: \"m15 6-6 6 6 6\",\n chevronUp: \"m6 15 6-6 6 6\",\n close: \"M6 6l12 12M18 6 6 18\",\n compare: \"M8 7h11m0 0-3-3m3 3-3 3M16 17H5m0 0 3-3m-3 3 3 3\",\n copy: \"M8 8h11a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2V8Zm8 0V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3\",\n delete: \"M4 7h16M9 7V4h6v3m3 0-1 14H7L6 7m4 4v6m4-6v6\",\n download: \"M12 3v12m0 0 5-5m-5 5-5-5M4 19v2h16v-2\",\n edit: \"m4 16-1 5 5-1L19 9l-4-4L4 16Zm9-9 4 4\",\n error: \"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm0-14v5m0 3h.01\",\n favorite: \"M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.7l-1.1-1.1a5.5 5.5 0 0 0-7.8 7.8L12 21l8.8-8.6a5.5 5.5 0 0 0 0-7.8Z\",\n filter: \"M3 5h18l-7 8v6l-4 2v-8L3 5Z\",\n forward: \"m9 6 6 6-6 6m6-6H5\",\n help: \"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm-3-13a3 3 0 1 1 4.7 2.5c-1 .7-1.7 1.2-1.7 2.5m0 3h.01\",\n home: \"m3 11 9-8 9 8v10h-6v-6H9v6H3V11Z\",\n info: \"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm0-11v6m0-10h.01\",\n lock: \"M6 10h12v11H6V10Zm3 0V7a3 3 0 0 1 6 0v3\",\n menu: \"M4 6h16M4 12h16M4 18h16\",\n more: \"M5 12h.01M12 12h.01M19 12h.01\",\n notifications: \"M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9Zm-8 12h4\",\n pause: \"M8 5v14m8-14v14\",\n play: \"m8 5 11 7-11 7V5Z\",\n refresh: \"M20 7v5h-5M4 17v-5h5m10.5-3A8 8 0 0 0 6 6l-2 2m.5 7A8 8 0 0 0 18 18l2-2\",\n search: \"m21 21-4.4-4.4M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0Z\",\n settings: \"M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm7.4-3.5 2-1.5-2-3.5-2.4 1a8 8 0 0 0-2-1.2L14.7 4h-4l-.4 2.8A8 8 0 0 0 8 8L5.6 7l-2 3.5 2 1.5a8 8 0 0 0 0 2l-2 1.5 2 3.5L8 18a8 8 0 0 0 2.3 1.2l.4 2.8h4l.3-2.8A8 8 0 0 0 17 18l2.4 1 2-3.5-2-1.5a8 8 0 0 0 0-2Z\",\n share: \"M18 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM6 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm12 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6ZM8.6 16.5l6.8 4M15.4 6.5l-6.8 4\",\n success: \"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Zm-5-10 3 3 7-7\",\n trendDown: \"M3 7l7 7 4-4 7 7m0 0v-6m0 6h-6\",\n trendFlat: \"M4 12h16m0 0-4-4m4 4-4 4\",\n trendUp: \"M3 17l7-7 4 4 7-7m0 0v6m0-6h-6\",\n upload: \"M12 21V9m0 0-5 5m5-5 5 5M4 5V3h16v2\",\n user: \"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-8 9a8 8 0 0 1 16 0\",\n users: \"M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8Zm-7 10a7 7 0 0 1 14 0m1-16a4 4 0 0 1 0 7m0 3a6 6 0 0 1 5 6\",\n visibility: \"M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12Zm10 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z\",\n visibilityOff: \"m3 3 18 18M10.6 5.2A9 9 0 0 1 12 5c6 0 10 7 10 7a17 17 0 0 1-2.1 3M6.6 6.6C3.8 8.5 2 12 2 12s4 7 10 7a9 9 0 0 0 3.4-.7M9.9 9.9a3 3 0 0 0 4.2 4.2\",\n warning: \"M12 3 2.7 20h18.6L12 3Zm0 6v4m0 3h.01\",\n} as const satisfies Record<SemanticIconName, string>;\n\nexport type IconProps = Omit<\n SVGAttributes<SVGSVGElement>,\n \"children\" | \"color\"\n> & IconDescriptor & Readonly<{\n /** Optional glyph inside the existing 24-unit SVG frame; HJM owns semantics. */\n renderGlyph?: (props: Readonly<{ name: SemanticIconName; size: number; color: string; strokeWidth: number }>) => ReactNode;\n}>;\n\nexport const Icon = forwardRef<SVGSVGElement, IconProps>(function Icon(\n {\n name,\n size,\n tone,\n weight,\n directionality,\n decorative,\n accessibilityLabel,\n renderGlyph,\n className,\n style,\n ...props\n },\n ref,\n) {\n const descriptor = resolveIconDescriptor({\n name,\n ...(size === undefined ? {} : { size }),\n ...(tone === undefined ? {} : { tone }),\n ...(weight === undefined ? {} : { weight }),\n ...(directionality === undefined ? {} : { directionality }),\n ...(decorative === undefined ? {} : { decorative }),\n ...(accessibilityLabel === undefined ? {} : { accessibilityLabel }),\n } as IconDescriptor);\n const theme = useOptionalHjmTheme();\n const transform = getIconTransform(\n descriptor.directionality,\n theme?.environment.direction ?? \"ltr\",\n );\n const dimension = iconRecipe.sizes[descriptor.size];\n return (\n <svg\n {...props}\n ref={ref}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={classNames(\"hjm-icon\", className)}\n data-name={descriptor.name}\n data-size={descriptor.size}\n data-tone={descriptor.tone}\n data-weight={descriptor.weight}\n data-transform={transform}\n width={dimension}\n height={dimension}\n stroke=\"currentColor\"\n strokeWidth={iconRecipe.weights[descriptor.weight]}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n role={descriptor.decorative ? undefined : \"img\"}\n aria-hidden={descriptor.decorative || undefined}\n aria-label={descriptor.decorative ? undefined : descriptor.accessibilityLabel}\n focusable=\"false\"\n style={style}\n >\n {renderGlyph?.({ name: descriptor.name, size: 24, color: \"currentColor\", strokeWidth: iconRecipe.weights[descriptor.weight] }) ?? <path d={iconPaths[descriptor.name]} />}\n </svg>\n );\n});\n\ntype ImageElementProps = Omit<\n ImgHTMLAttributes<HTMLImageElement>,\n | \"alt\"\n | \"aria-hidden\"\n | \"aria-label\"\n | \"children\"\n | \"className\"\n | \"height\"\n | \"onError\"\n | \"onLoad\"\n | \"role\"\n | \"src\"\n | \"style\"\n | \"width\"\n>;\n\n/** Canonical props handed to a framework adapter such as `next/image`. */\nexport type ImageAdapterProps = ImageElementProps &\n Readonly<{\n src: string;\n alt: string;\n width: number;\n height: number;\n className?: string;\n style: CSSProperties;\n \"aria-hidden\"?: true;\n onLoad: ReactEventHandler<HTMLImageElement>;\n onError: ReactEventHandler<HTMLImageElement>;\n ref?: Ref<HTMLImageElement>;\n }>;\n\ntype ImageRootProps = Omit<\n HTMLAttributes<HTMLSpanElement>,\n | \"aria-hidden\"\n | \"aria-label\"\n | \"aria-labelledby\"\n | \"children\"\n | \"onError\"\n | \"onLoad\"\n | \"role\"\n>;\n\nexport type ImageProps = ImageRootProps &\n ImageDescriptor &\n Readonly<{\n /** Additional native `<img>` props shared with the framework adapter. */\n imageProps?: ImageElementProps &\n Readonly<{ className?: string; style?: CSSProperties }>;\n /**\n * Receives the complete accessible image contract. The adapter must pass\n * these props to its underlying image element so HJM can observe failure.\n */\n renderImage?: (props: ImageAdapterProps) => ReactElement;\n /** Visual content only; HJM keeps the fallback's accessible name. */\n fallback?: ReactNode;\n imageRef?: Ref<HTMLImageElement>;\n onLoad?: ReactEventHandler<HTMLImageElement>;\n onError?: ReactEventHandler<HTMLImageElement>;\n onLoadStatusChange?: (status: Extract<ImageLoadStatus, \"loaded\" | \"error\">) => void;\n }>;\n\ntype ImageState = Readonly<{\n src: string;\n status: Extract<ImageLoadStatus, \"loading\" | \"loaded\" | \"error\">;\n}>;\n\n/** Intrinsic-size image with canonical alt semantics and an accessible fallback. */\nexport const Image = forwardRef<HTMLSpanElement, ImageProps>(function Image(\n {\n src,\n width,\n height,\n fit,\n decorative,\n accessibilityLabel,\n imageProps,\n renderImage,\n fallback,\n imageRef,\n onLoad,\n onError,\n onLoadStatusChange,\n className,\n style,\n ...props\n },\n ref,\n) {\n const descriptor = resolveImageDescriptor({\n src,\n width,\n height,\n ...(fit === undefined ? {} : { fit }),\n ...(decorative === undefined ? {} : { decorative }),\n ...(accessibilityLabel === undefined ? {} : { accessibilityLabel }),\n } as ImageDescriptor);\n const [state, setState] = useState<ImageState>({\n src: descriptor.src,\n status: \"loading\",\n });\n const status = state.src === descriptor.src ? state.status : \"loading\";\n const {\n className: imageClassName,\n style: imageStyle,\n ...restImageProps\n } = imageProps ?? {};\n\n const handleLoad: ReactEventHandler<HTMLImageElement> = (event) => {\n setState({ src: descriptor.src, status: \"loaded\" });\n onLoadStatusChange?.(\"loaded\");\n onLoad?.(event);\n };\n const handleError: ReactEventHandler<HTMLImageElement> = (event) => {\n setState({ src: descriptor.src, status: \"error\" });\n onLoadStatusChange?.(\"error\");\n onError?.(event);\n };\n const adapterProps: ImageAdapterProps = {\n ...restImageProps,\n src: descriptor.src,\n alt: descriptor.decorative ? \"\" : descriptor.accessibilityLabel,\n width: descriptor.width,\n height: descriptor.height,\n className: classNames(\"hjm-image__asset\", imageClassName) ??\n \"hjm-image__asset\",\n style: { ...imageStyle, objectFit: descriptor.fit },\n ...(descriptor.decorative ? { \"aria-hidden\": true } : {}),\n onLoad: handleLoad,\n onError: handleError,\n ...(imageRef === undefined ? {} : { ref: imageRef }),\n };\n\n let visual: ReactNode;\n if (status === \"error\") {\n const fallbackLabel = resolveImageFallbackAccessibilityLabel(descriptor);\n visual = (\n <span\n className=\"hjm-image__fallback\"\n role={descriptor.decorative ? undefined : \"img\"}\n aria-label={fallbackLabel}\n aria-hidden={descriptor.decorative || undefined}\n >\n <span className=\"hjm-image__fallback-icon\" aria-hidden=\"true\">\n {fallback ?? (\n <Icon\n name={imageRecipe.fallback.icon.name}\n tone={imageRecipe.fallback.icon.tone}\n decorative\n />\n )}\n </span>\n </span>\n );\n } else if (renderImage === undefined) {\n const { ref: assetRef, ...nativeImageProps } = adapterProps;\n visual = <img {...nativeImageProps} ref={assetRef} />;\n } else {\n visual = renderImage(adapterProps);\n }\n\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-image\", className)}\n data-fit={descriptor.fit}\n data-status={status}\n style={{\n inlineSize: descriptor.width,\n ...style,\n aspectRatio: resolveImageAspectRatio(\n descriptor.width,\n descriptor.height,\n ),\n }}\n >\n {visual}\n </span>\n );\n});\n\nexport type CounterBadgeProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n count: number;\n max?: number;\n tone?: CounterBadgeTone;\n size?: CounterBadgeSize;\n variant?: CounterBadgeVariant;\n /**\n * Says \"there is something new\" without a number. Use it where the count is\n * unknown or not worth reading; inventing a number would be worse than\n * saying none. The accessible name then carries the whole meaning.\n */\n dot?: boolean;\n accessibilityLabel?: string;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nexport const CounterBadge = forwardRef<HTMLSpanElement, CounterBadgeProps>(\n function CounterBadge(\n {\n count,\n max = counterBadgeRecipe.defaults.max,\n tone = counterBadgeRecipe.defaults.tone,\n size = counterBadgeRecipe.defaults.size,\n variant = counterBadgeRecipe.defaults.variant,\n dot = false,\n accessibilityLabel,\n className,\n layoutStyle,\n style,\n ...props\n },\n ref,\n ) {\n const label = formatCounterBadgeCount(count, max);\n if (accessibilityLabel !== undefined && accessibilityLabel.trim().length === 0) {\n throw new TypeError(\"CounterBadge accessibilityLabel must not be empty\");\n }\n if (dot && accessibilityLabel === undefined) {\n // A dot with no name is a decoration that nobody can read.\n throw new TypeError(\"CounterBadge dot requires an accessibilityLabel\");\n }\n if (label === null) return null;\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-counter-badge\", className)}\n data-tone={tone}\n data-size={size}\n data-variant={variant}\n data-dot={dot || undefined}\n style={dot ? { ...style, ...layoutStyle, \"--hjm-counter-dot-size\": `${counterBadgeRecipe.dotSize}px` } as typeof style : { ...style, ...layoutStyle }}\n aria-hidden={accessibilityLabel === undefined || undefined}\n aria-label={accessibilityLabel}\n >\n {dot ? null : label}\n </span>\n );\n },\n);\n"]}
@@ -0,0 +1,15 @@
1
+ import type { ReactNode } from "react";
2
+ import type { DataTableSortDirection } from "@hjmds/design-contracts/components/data-table";
3
+ export declare function TableSortButton({ header, direction, glyphs, className, accessibleName, onSort }: Readonly<{
4
+ header: ReactNode;
5
+ direction?: DataTableSortDirection | null;
6
+ glyphs: Readonly<{
7
+ ascending: string;
8
+ descending: string;
9
+ none: string;
10
+ }>;
11
+ className: string;
12
+ accessibleName?: string;
13
+ onSort: () => void;
14
+ }>): import("react").JSX.Element;
15
+ //# sourceMappingURL=table-sort-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-sort-button.d.ts","sourceRoot":"","sources":["../src/table-sort-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAI5F,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,QAAQ,CAAC;IACzG,MAAM,EAAE,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC7D,MAAM,EAAE,QAAQ,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC1E,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,IAAI,CAAC;CAChE,CAAC,+BAKD"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Both public tables need the same native button/hidden glyph semantics. Keep
3
+ // their two-state/three-state policies and CSS separate rather than merging APIs.
4
+ export function TableSortButton({ header, direction, glyphs, className, accessibleName, onSort }) {
5
+ return _jsxs("button", { type: "button", className: className, "aria-label": accessibleName, onClick: onSort, children: [_jsx("span", { children: header }), _jsx("span", { "aria-hidden": "true", children: direction ? glyphs[direction] : glyphs.none })] });
6
+ }
7
+ //# sourceMappingURL=table-sort-button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-sort-button.js","sourceRoot":"","sources":["../src/table-sort-button.tsx"],"names":[],"mappings":";AAGA,8EAA8E;AAC9E,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,EAI5F;IACA,OAAO,kBAAQ,IAAI,EAAC,QAAQ,EAAC,SAAS,EAAE,SAAS,gBAAc,cAAc,EAAE,OAAO,EAAE,MAAM,aAC5F,yBAAO,MAAM,GAAQ,EACrB,8BAAkB,MAAM,YAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,GAAQ,IACtE,CAAC;AACZ,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\nimport type { DataTableSortDirection } from \"@hjmds/design-contracts/components/data-table\";\n\n// Both public tables need the same native button/hidden glyph semantics. Keep\n// their two-state/three-state policies and CSS separate rather than merging APIs.\nexport function TableSortButton({ header, direction, glyphs, className, accessibleName, onSort }: Readonly<{\n header: ReactNode; direction?: DataTableSortDirection | null;\n glyphs: Readonly<{ ascending: string; descending: string; none: string }>;\n className: string; accessibleName?: string; onSort: () => void;\n}>) {\n return <button type=\"button\" className={className} aria-label={accessibleName} onClick={onSort}>\n <span>{header}</span>\n <span aria-hidden=\"true\">{direction ? glyphs[direction] : glyphs.none}</span>\n </button>;\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type TaskItem } from '@hjmds/design-contracts/task-list';
3
+ export type TaskListProps = Readonly<{
4
+ label: string;
5
+ items: readonly TaskItem[];
6
+ onCompletedChange: (id: string, completed: boolean) => void;
7
+ disabled?: boolean;
8
+ emptyContent?: ReactNode;
9
+ renderCollection?: (context: Readonly<{
10
+ items: readonly TaskItem[];
11
+ renderItem: (item: TaskItem) => ReactNode;
12
+ }>) => ReactNode;
13
+ }>;
14
+ /** Canonical Checkbox/List own semantics; optional collection composition keeps drag peers out of this entry. */
15
+ export declare function TaskList({ label, items, onCompletedChange, disabled, emptyContent, renderCollection }: TaskListProps): import("react").JSX.Element;
16
+ //# sourceMappingURL=task-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-list.d.ts","sourceRoot":"","sources":["../src/task-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAI,EAAC,SAAS,EAAC,MAAI,OAAO,CAAC;AAClC,OAAM,EAAe,KAAK,QAAQ,EAAC,MAAI,mCAAmC,CAAC;AAE3E,MAAM,MAAM,aAAa,GAAC,QAAQ,CAAC;IAAC,KAAK,EAAC,MAAM,CAAC;IAAA,KAAK,EAAC,SAAS,QAAQ,EAAE,CAAC;IAAA,iBAAiB,EAAC,CAAC,EAAE,EAAC,MAAM,EAAC,SAAS,EAAC,OAAO,KAAG,IAAI,CAAC;IAAA,QAAQ,CAAC,EAAC,OAAO,CAAC;IAAA,YAAY,CAAC,EAAC,SAAS,CAAC;IAAA,gBAAgB,CAAC,EAAC,CAAC,OAAO,EAAC,QAAQ,CAAC;QAAC,KAAK,EAAC,SAAS,QAAQ,EAAE,CAAC;QAAA,UAAU,EAAC,CAAC,IAAI,EAAC,QAAQ,KAAG,SAAS,CAAA;KAAC,CAAC,KAAG,SAAS,CAAA;CAAC,CAAC,CAAC;AAChS,iHAAiH;AACjH,wBAAgB,QAAQ,CAAC,EAAC,KAAK,EAAC,KAAK,EAAC,iBAAiB,EAAC,QAAc,EAAC,YAAY,EAAC,gBAAgB,EAAC,EAAC,aAAa,+BAKlH"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { validateTasks } from '@hjmds/design-contracts/task-list';
3
+ import { Checkbox } from './selection.js';
4
+ import { List } from './advanced-display.js';
5
+ /** Canonical Checkbox/List own semantics; optional collection composition keeps drag peers out of this entry. */
6
+ export function TaskList({ label, items, onCompletedChange, disabled = false, emptyContent, renderCollection }) {
7
+ validateTasks(items);
8
+ if (!label.trim())
9
+ throw new TypeError('TaskList needs a localized label');
10
+ const renderItem = (item) => { const control = _jsx(Checkbox, { label: item.label, checked: item.completed, disabled: disabled || item.disabled === true, onCheckedChange: completed => onCompletedChange(item.id, completed), ...(item.description === undefined ? {} : { description: item.description }) }); return _jsx("div", { style: { padding: "var(--hjm-space-md)" }, children: control }); };
11
+ if (items.length === 0)
12
+ return _jsx(List, { label: label, children: emptyContent });
13
+ if (renderCollection)
14
+ return _jsx(_Fragment, { children: renderCollection({ items, renderItem }) });
15
+ return _jsx(List, { label: label, appearance: "grouped", children: items.map(item => _jsx("div", { children: renderItem(item) }, item.id)) });
16
+ }
17
+ //# sourceMappingURL=task-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"task-list.js","sourceRoot":"","sources":["../src/task-list.tsx"],"names":[],"mappings":";AACA,OAAM,EAAC,aAAa,EAAe,MAAI,mCAAmC,CAAC;AAC3E,OAAM,EAAC,QAAQ,EAAC,MAAI,gBAAgB,CAAC;AAAA,OAAM,EAAC,IAAI,EAAC,MAAI,uBAAuB,CAAC;AAE7E,iHAAiH;AACjH,MAAM,UAAU,QAAQ,CAAC,EAAC,KAAK,EAAC,KAAK,EAAC,iBAAiB,EAAC,QAAQ,GAAC,KAAK,EAAC,YAAY,EAAC,gBAAgB,EAAe;IAAE,aAAa,CAAC,KAAK,CAAC,CAAC;IAAA,IAAG,CAAC,KAAK,CAAC,IAAI,EAAE;QAAC,MAAM,IAAI,SAAS,CAAC,kCAAkC,CAAC,CAAC;IAClN,MAAM,UAAU,GAAC,CAAC,IAAa,EAAC,EAAE,GAAC,MAAM,OAAO,GAAC,KAAC,QAAQ,IAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,IAAE,IAAI,CAAC,QAAQ,KAAG,IAAI,EAAE,eAAe,EAAE,SAAS,CAAA,EAAE,CAAA,iBAAiB,CAAC,IAAI,CAAC,EAAE,EAAC,SAAS,CAAC,KAAM,CAAC,IAAI,CAAC,WAAW,KAAG,SAAS,CAAA,CAAC,CAAA,EAAE,CAAA,CAAC,CAAA,EAAC,WAAW,EAAC,IAAI,CAAC,WAAW,EAAC,CAAC,GAAG,CAAC,CAAA,OAAO,cAAK,KAAK,EAAE,EAAC,OAAO,EAAC,qBAAqB,EAAC,YAAG,OAAO,GAAO,CAAC,CAAA,CAAC,CAAC;IACjW,IAAG,KAAK,CAAC,MAAM,KAAG,CAAC;QAAC,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,YAAG,YAAY,GAAQ,CAAC;IACrE,IAAG,gBAAgB;QAAC,OAAO,4BAAG,gBAAgB,CAAC,EAAC,KAAK,EAAC,UAAU,EAAC,CAAC,GAAI,CAAC;IACvE,OAAO,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAC,SAAS,YAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAA,EAAE,CAAA,wBAAoB,UAAU,CAAC,IAAI,CAAC,IAA1B,IAAI,CAAC,EAAE,CAA0B,CAAC,GAAQ,CAAC;AACvH,CAAC","sourcesContent":["import type{ReactNode}from'react';\nimport{validateTasks,type TaskItem}from'@hjmds/design-contracts/task-list';\nimport{Checkbox}from'./selection.js';import{List}from'./advanced-display.js';\nexport type TaskListProps=Readonly<{label:string;items:readonly TaskItem[];onCompletedChange:(id:string,completed:boolean)=>void;disabled?:boolean;emptyContent?:ReactNode;renderCollection?:(context:Readonly<{items:readonly TaskItem[];renderItem:(item:TaskItem)=>ReactNode}>)=>ReactNode}>;\n/** Canonical Checkbox/List own semantics; optional collection composition keeps drag peers out of this entry. */\nexport function TaskList({label,items,onCompletedChange,disabled=false,emptyContent,renderCollection}:TaskListProps){validateTasks(items);if(!label.trim())throw new TypeError('TaskList needs a localized label');\n const renderItem=(item:TaskItem)=>{const control=<Checkbox label={item.label} checked={item.completed} disabled={disabled||item.disabled===true} onCheckedChange={completed=>onCompletedChange(item.id,completed)} {...(item.description===undefined?{}:{description:item.description})}/>;return <div style={{padding:\"var(--hjm-space-md)\"}}>{control}</div>;};\n if(items.length===0)return <List label={label}>{emptyContent}</List>;\n if(renderCollection)return <>{renderCollection({items,renderItem})}</>;\n return <List label={label} appearance=\"grouped\">{items.map(item=><div key={item.id}>{renderItem(item)}</div>)}</List>;\n}\n"]}
@@ -5,5 +5,5 @@ export type ThinkingOrbProps = ThinkingOrbOptions & Readonly<{
5
5
  style?: CSSProperties;
6
6
  }>;
7
7
  /** Optional AI status presentation; ordinary loading retains Spinner. */
8
- export declare function ThinkingOrb({ state, size, label, speed, paused, active, className, style }: ThinkingOrbProps): import("react").JSX.Element;
8
+ export declare function ThinkingOrb({ state, appearance, size, label, speed, paused, active, className, style }: ThinkingOrbProps): import("react").JSX.Element;
9
9
  //# sourceMappingURL=thinking-orb.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"thinking-orb.d.ts","sourceRoot":"","sources":["../src/thinking-orb.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAyF,KAAK,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAGjL,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,QAAQ,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC;AAC5G,yEAAyE;AACzE,wBAAgB,WAAW,CAAC,EAAE,KAAiB,EAAE,IAAS,EAAE,KAAK,EAAE,KAAS,EAAE,MAAc,EAAE,MAAa,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,gBAAgB,+BAgEhJ"}
1
+ {"version":3,"file":"thinking-orb.d.ts","sourceRoot":"","sources":["../src/thinking-orb.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAyF,KAAK,kBAAkB,EAAE,MAAM,iDAAiD,CAAC;AAGjL,MAAM,MAAM,gBAAgB,GAAG,kBAAkB,GAAG,QAAQ,CAAC;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC,CAAC;AAC5G,yEAAyE;AACzE,wBAAgB,WAAW,CAAC,EAAE,KAAiB,EAAE,UAAoB,EAAE,IAAS,EAAE,KAAK,EAAE,KAAS,EAAE,MAAc,EAAE,MAAa,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,gBAAgB,+BAgEtK"}
@@ -3,8 +3,8 @@ import { useEffect, useRef } from "react";
3
3
  import { buildThinkingOrbFrame, createThinkingOrbClock, thinkingOrbRecipe, validateThinkingOrb } from "@hjmds/design-contracts/components/thinking-orb";
4
4
  import { useHjmTheme } from "./provider.js";
5
5
  /** Optional AI status presentation; ordinary loading retains Spinner. */
6
- export function ThinkingOrb({ state = "working", size = 64, label, speed = 1, paused = false, active = true, className, style }) {
7
- validateThinkingOrb({ state, size, speed, label });
6
+ export function ThinkingOrb({ state = "working", appearance = "state", size = 64, label, speed = 1, paused = false, active = true, className, style }) {
7
+ validateThinkingOrb({ state, appearance, size, speed, label });
8
8
  const theme = useHjmTheme();
9
9
  const ink = theme.palette.theme.text;
10
10
  const reduced = theme.environment.reducedMotion;
@@ -20,7 +20,7 @@ export function ThinkingOrb({ state = "working", size = 64, label, speed = 1, pa
20
20
  let visible = typeof IntersectionObserver === "undefined";
21
21
  let disposed = false;
22
22
  const draw = () => {
23
- const frame = buildThinkingOrbFrame(state, size, reduced ? thinkingOrbRecipe.motion.staticTime : clock.current.time);
23
+ const frame = buildThinkingOrbFrame(state, size, reduced ? thinkingOrbRecipe.motion.staticTime : clock.current.time, appearance);
24
24
  ctx.setTransform(ratio, 0, 0, ratio, 0, 0);
25
25
  ctx.clearRect(0, 0, size, size);
26
26
  ctx.fillStyle = ctx.strokeStyle = ink;
@@ -80,7 +80,7 @@ export function ThinkingOrb({ state = "working", size = 64, label, speed = 1, pa
80
80
  document.removeEventListener("visibilitychange", sync);
81
81
  window.removeEventListener("resize", resize);
82
82
  };
83
- }, [state, size, speed, active, paused, reduced, ink]);
83
+ }, [state, appearance, size, speed, active, paused, reduced, ink]);
84
84
  return _jsxs("span", { className: className, "data-hjm-thinking-orb": state, role: "status", "aria-live": "polite", "aria-atomic": "true", style: { display: "inline-flex", ...style }, children: [_jsx("canvas", { ref: canvasRef, "aria-hidden": "true", style: { width: size, height: size, display: "block" } }), _jsx("span", { style: { position: "absolute", width: 1, height: 1, padding: 0, margin: -1, overflow: "hidden", clipPath: "inset(50%)", whiteSpace: "nowrap", border: 0 }, children: label })] });
85
85
  }
86
86
  //# sourceMappingURL=thinking-orb.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"thinking-orb.js","sourceRoot":"","sources":["../src/thinking-orb.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAsB,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,mBAAmB,EAA2B,MAAM,iDAAiD,CAAC;AACjL,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,yEAAyE;AACzE,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,GAAG,SAAS,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,EAAoB;IAC/I,mBAAmB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAC5B,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;IACrC,MAAM,OAAO,GAAG,KAAK,CAAC,WAAW,CAAC,aAAa,CAAC;IAChD,MAAM,SAAS,GAAG,MAAM,CAAoB,IAAI,CAAC,CAAC;IAClD,MAAM,KAAK,GAAG,MAAM,CAAC,sBAAsB,EAAE,CAAC,CAAC;IAC/C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC;QACjC,MAAM,GAAG,GAAG,MAAM,EAAE,UAAU,CAAC,I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B,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACvG,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACvD,OAAO,gBAAM,SAAS,EAAE,SAAS,2BAAyB,KAAK,EAAE,IAAI,EAAC,QAAQ,eAAW,QAAQ,iBAAa,MAAM,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,KAAK,EAAE,aAC9J,iBAAQ,GAAG,EAAE,SAAS,iBAAc,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAI,EAErG,eAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,YAAG,KAAK,GAAQ,IAC1K,CAAC;AACV,CAAC","sourcesContent":["import { useEffect, useRef, type CSSProperties } from \"react\";\nimport { buildThinkingOrbFrame, createThinkingOrbClock, thinkingOrbRecipe, validateThinkingOrb, type ThinkingOrbOptions } from \"@hjmds/design-contracts/components/thinking-orb\";\nimport { useHjmTheme } from \"./provider.js\";\n\nexport type ThinkingOrbProps = ThinkingOrbOptions & Readonly<{ className?: string; style?: CSSProperties }>;\n/** Optional AI status presentation; ordinary loading retains Spinner. */\nexport function ThinkingOrb({ state = \"working\", size = 64, label, speed = 1, paused = false, active = true, className, style }: ThinkingOrbProps) {\n validateThinkingOrb({ state, size, speed, label });\n const theme = useHjmTheme();\n const ink = theme.palette.theme.text;\n const reduced = theme.environment.reducedMotion;\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const clock = useRef(createThinkingOrbClock());\n useEffect(() => {\n const canvas = canvasRef.current;\n const ctx = canvas?.getContext(\"2d\");\n if (!canvas || !ctx) return;\n let ratio = 1;\n let raf = 0;\n let visible = typeof IntersectionObserver === \"undefined\";\n let disposed = false;\n const draw = () => {\n const frame = buildThinkingOrbFrame(state, size, reduced ? thinkingOrbRecipe.motion.staticTime : clock.current.time);\n ctx.setTransform(ratio, 0, 0, ratio, 0, 0);\n ctx.clearRect(0, 0, size, size);\n ctx.fillStyle = ctx.strokeStyle = ink;\n // Depth becomes semantic-ink opacity, so brand palettes work on any HJM surface.\n for (const line of frame.lines) {\n ctx.globalAlpha = (1 - Math.min(1, Math.max(0, line.white))) * (line.a ?? 1);\n ctx.lineWidth = line.w;\n ctx.beginPath(); ctx.moveTo(line.x1, line.y1); ctx.lineTo(line.x2, line.y2); ctx.stroke();\n }\n for (const dot of frame.dots) {\n ctx.globalAlpha = (1 - Math.min(1, Math.max(0, dot.white))) * (dot.a ?? 1);\n ctx.beginPath(); ctx.arc(dot.x, dot.y, dot.r, 0, Math.PI * 2); ctx.fill();\n }\n ctx.globalAlpha = 1;\n };\n const resize = () => {\n ratio = Math.min(thinkingOrbRecipe.maxPixelRatio, window.devicePixelRatio || 1);\n canvas.width = Math.round(size * ratio); canvas.height = Math.round(size * ratio);\n draw();\n };\n const eligible = () => !disposed && active && !paused && !reduced && visible && document.visibilityState !== \"hidden\";\n const loop = (now: number) => {\n raf = 0;\n if (!eligible()) return;\n clock.current.sample(now, speed); draw();\n raf = requestAnimationFrame(loop);\n };\n const sync = () => {\n cancelAnimationFrame(raf); raf = 0; clock.current.resetDelta();\n if (eligible()) raf = requestAnimationFrame(loop);\n };\n const observer = typeof IntersectionObserver === \"undefined\" ? null : new IntersectionObserver(entries => {\n visible = entries[0]?.isIntersecting ?? false; sync();\n });\n resize(); observer?.observe(canvas); sync();\n document.addEventListener(\"visibilitychange\", sync);\n window.addEventListener(\"resize\", resize);\n return () => {\n disposed = true; cancelAnimationFrame(raf); observer?.disconnect(); clock.current.resetDelta();\n document.removeEventListener(\"visibilitychange\", sync); window.removeEventListener(\"resize\", resize);\n };\n }, [state, size, speed, active, paused, reduced, ink]);\n return <span className={className} data-hjm-thinking-orb={state} role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" style={{ display: \"inline-flex\", ...style }}>\n <canvas ref={canvasRef} aria-hidden=\"true\" style={{ width: size, height: size, display: \"block\" }} />\n {/* Inline hiding works for granular consumers who do not import the stylesheet. */}\n <span style={{ position: \"absolute\", width: 1, height: 1, padding: 0, margin: -1, overflow: \"hidden\", clipPath: \"inset(50%)\", whiteSpace: \"nowrap\", border: 0 }}>{label}</span>\n </span>;\n}\n"]}
1
+ {"version":3,"file":"thinking-orb.js","sourceRoot":"","sources":["../src/thinking-orb.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAsB,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,mBAAmB,EAA2B,MAAM,iDAAiD,CAAC;AACjL,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,yEAAyE;AACzE,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,GAAG,SAAS,EAAE,UAAU,GAAG,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,KAAK,EAAoB;IACrK,mBAAmB,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAC5B,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC;IACrC,MAAM,OAAO,GAAG,K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AE,MAAM,CAAC,CAAC;QAC1C,OAAO,GAAG,EAAE;YACV,QAAQ,GAAG,IAAI,CAAC;YAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;YAAC,QAAQ,EAAE,UAAU,EAAE,CAAC;YAAC,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YAC/F,QAAQ,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC;YAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACvG,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC;IACnE,OAAO,gBAAM,SAAS,EAAE,SAAS,2BAAyB,KAAK,EAAE,IAAI,EAAC,QAAQ,eAAW,QAAQ,iBAAa,MAAM,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,KAAK,EAAE,aAC9J,iBAAQ,GAAG,EAAE,SAAS,iBAAc,MAAM,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,GAAI,EAErG,eAAM,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,EAAE,YAAG,KAAK,GAAQ,IAC1K,CAAC;AACV,CAAC","sourcesContent":["import { useEffect, useRef, type CSSProperties } from \"react\";\nimport { buildThinkingOrbFrame, createThinkingOrbClock, thinkingOrbRecipe, validateThinkingOrb, type ThinkingOrbOptions } from \"@hjmds/design-contracts/components/thinking-orb\";\nimport { useHjmTheme } from \"./provider.js\";\n\nexport type ThinkingOrbProps = ThinkingOrbOptions & Readonly<{ className?: string; style?: CSSProperties }>;\n/** Optional AI status presentation; ordinary loading retains Spinner. */\nexport function ThinkingOrb({ state = \"working\", appearance = \"state\", size = 64, label, speed = 1, paused = false, active = true, className, style }: ThinkingOrbProps) {\n validateThinkingOrb({ state, appearance, size, speed, label });\n const theme = useHjmTheme();\n const ink = theme.palette.theme.text;\n const reduced = theme.environment.reducedMotion;\n const canvasRef = useRef<HTMLCanvasElement>(null);\n const clock = useRef(createThinkingOrbClock());\n useEffect(() => {\n const canvas = canvasRef.current;\n const ctx = canvas?.getContext(\"2d\");\n if (!canvas || !ctx) return;\n let ratio = 1;\n let raf = 0;\n let visible = typeof IntersectionObserver === \"undefined\";\n let disposed = false;\n const draw = () => {\n const frame = buildThinkingOrbFrame(state, size, reduced ? thinkingOrbRecipe.motion.staticTime : clock.current.time, appearance);\n ctx.setTransform(ratio, 0, 0, ratio, 0, 0);\n ctx.clearRect(0, 0, size, size);\n ctx.fillStyle = ctx.strokeStyle = ink;\n // Depth becomes semantic-ink opacity, so brand palettes work on any HJM surface.\n for (const line of frame.lines) {\n ctx.globalAlpha = (1 - Math.min(1, Math.max(0, line.white))) * (line.a ?? 1);\n ctx.lineWidth = line.w;\n ctx.beginPath(); ctx.moveTo(line.x1, line.y1); ctx.lineTo(line.x2, line.y2); ctx.stroke();\n }\n for (const dot of frame.dots) {\n ctx.globalAlpha = (1 - Math.min(1, Math.max(0, dot.white))) * (dot.a ?? 1);\n ctx.beginPath(); ctx.arc(dot.x, dot.y, dot.r, 0, Math.PI * 2); ctx.fill();\n }\n ctx.globalAlpha = 1;\n };\n const resize = () => {\n ratio = Math.min(thinkingOrbRecipe.maxPixelRatio, window.devicePixelRatio || 1);\n canvas.width = Math.round(size * ratio); canvas.height = Math.round(size * ratio);\n draw();\n };\n const eligible = () => !disposed && active && !paused && !reduced && visible && document.visibilityState !== \"hidden\";\n const loop = (now: number) => {\n raf = 0;\n if (!eligible()) return;\n clock.current.sample(now, speed); draw();\n raf = requestAnimationFrame(loop);\n };\n const sync = () => {\n cancelAnimationFrame(raf); raf = 0; clock.current.resetDelta();\n if (eligible()) raf = requestAnimationFrame(loop);\n };\n const observer = typeof IntersectionObserver === \"undefined\" ? null : new IntersectionObserver(entries => {\n visible = entries[0]?.isIntersecting ?? false; sync();\n });\n resize(); observer?.observe(canvas); sync();\n document.addEventListener(\"visibilitychange\", sync);\n window.addEventListener(\"resize\", resize);\n return () => {\n disposed = true; cancelAnimationFrame(raf); observer?.disconnect(); clock.current.resetDelta();\n document.removeEventListener(\"visibilitychange\", sync); window.removeEventListener(\"resize\", resize);\n };\n }, [state, appearance, size, speed, active, paused, reduced, ink]);\n return <span className={className} data-hjm-thinking-orb={state} role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" style={{ display: \"inline-flex\", ...style }}>\n <canvas ref={canvasRef} aria-hidden=\"true\" style={{ width: size, height: size, display: \"block\" }} />\n {/* Inline hiding works for granular consumers who do not import the stylesheet. */}\n <span style={{ position: \"absolute\", width: 1, height: 1, padding: 0, margin: -1, overflow: \"hidden\", clipPath: \"inset(50%)\", whiteSpace: \"nowrap\", border: 0 }}>{label}</span>\n </span>;\n}\n"]}
@@ -0,0 +1,24 @@
1
+ import type { ReactNode } from "react";
2
+ import { type VoiceNoteDescriptor } from "@hjmds/design-contracts/voice-note";
3
+ export type VoiceNoteProps = Readonly<{
4
+ descriptor: VoiceNoteDescriptor;
5
+ labels: Readonly<{
6
+ play: string;
7
+ pause: string;
8
+ seek: string;
9
+ loading: string;
10
+ error: string;
11
+ retry: string;
12
+ backward: string;
13
+ forward: string;
14
+ }>;
15
+ /** Localized elapsed/duration text and slider accessible value. */
16
+ formatTime: (seconds: number) => string;
17
+ artwork?: ReactNode;
18
+ onPlayingChange: (playing: boolean) => void;
19
+ onSeek: (seconds: number) => void;
20
+ onRetry?: () => void;
21
+ }>;
22
+ /** Audio engine, network, file permission and playback lifecycle remain host-owned. */
23
+ export declare function VoiceNote({ descriptor, labels, formatTime, artwork, onPlayingChange, onSeek, onRetry }: VoiceNoteProps): import("react").JSX.Element;
24
+ //# sourceMappingURL=voice-note.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voice-note.d.ts","sourceRoot":"","sources":["../src/voice-note.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAoB,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAMhG,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;IACpC,UAAU,EAAE,mBAAmB,CAAC;IAChC,MAAM,EAAE,QAAQ,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClJ,mEAAmE;IACnE,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC,CAAC;AAEH,uFAAuF;AACvF,wBAAgB,SAAS,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,cAAc,+BAgBtH"}
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { resolveVoiceNote } from "@hjmds/design-contracts/voice-note";
3
+ import { Asset } from "./asset.js";
4
+ import { Button } from "./actions.js";
5
+ import { Slider } from "./slider.js";
6
+ import { Stack, Surface, Text } from "./layout.js";
7
+ /** Audio engine, network, file permission and playback lifecycle remain host-owned. */
8
+ export function VoiceNote({ descriptor, labels, formatTime, artwork, onPlayingChange, onSeek, onRetry }) {
9
+ const media = resolveVoiceNote(descriptor);
10
+ const error = media.state === "error";
11
+ return _jsx(Surface, { padding: "lg", children: _jsxs(Stack, { gap: "md", children: [_jsxs(Stack, { axis: "inline", gap: "md", children: [artwork ? _jsx(Asset, { descriptor: { kind: "image", decorative: true, shape: "circle" }, children: artwork }) : null, _jsx(Text, { emphasis: "strong", children: media.title })] }), _jsx(Slider, { label: labels.seek, min: 0, max: media.duration || 1, step: 0.1, value: media.position, disabled: !media.canSeek, onValueChange: onSeek, getValueText: formatTime }), _jsxs(Text, { tone: "muted", children: [formatTime(media.position), media.duration === null ? "" : ` / ${formatTime(media.duration)}`] }), error ? _jsx(Text, { role: "alert", children: labels.error }) : null, _jsxs(Stack, { axis: "inline", gap: "sm", children: [_jsx(Button, { disabled: !media.canPlay, loading: media.state === "loading", onClick: () => onPlayingChange(media.state !== "playing"), children: media.state === "loading" ? labels.loading : media.state === "playing" ? labels.pause : labels.play }), error && onRetry ? _jsx(Button, { disabled: media.disabled ?? false, onClick: onRetry, children: labels.retry }) : null] })] }) });
12
+ }
13
+ //# sourceMappingURL=voice-note.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"voice-note.js","sourceRoot":"","sources":["../src/voice-note.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,gBAAgB,EAA4B,MAAM,oCAAoC,CAAC;AAChG,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,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CAAC,EAAE,IAAQ,EACxH,KAAK,CAAC,CAAC,CAAC,KAAC,IAAI,IAAC,IAAI,EAAC,OAAO,YAAE,MAAM,CAAC,KAAK,GAAQ,CAAC,CAAC,CAAC,IAAI,EACxD,MAAC,KAAK,IAAC,IAAI,EAAC,QAAQ,EAAC,GAAG,EAAC,IAAI,aAC3B,KAAC,MAAM,IAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,YAAG,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,GAAU,EAC9O,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,IAAI,KAAK,EAAE,OAAO,EAAE,OAAO,YAAG,MAAM,CAAC,KAAK,GAAU,CAAC,CAAC,CAAC,IAAI,IACzG,IACF,GAAU,CAAC;AACrB,CAAC","sourcesContent":["import type { ReactNode } from \"react\";\nimport { resolveVoiceNote, type VoiceNoteDescriptor } from \"@hjmds/design-contracts/voice-note\";\nimport { Asset } from \"./asset.js\";\nimport { Button } from \"./actions.js\";\nimport { Slider } from \"./slider.js\";\nimport { Stack, Surface, Text } from \"./layout.js\";\n\nexport type VoiceNoteProps = Readonly<{\n descriptor: VoiceNoteDescriptor;\n labels: Readonly<{ play: string; pause: string; seek: string; loading: string; error: string; retry: string; backward: string; forward: string }>;\n /** Localized elapsed/duration text and slider accessible value. */\n formatTime: (seconds: number) => string;\n artwork?: ReactNode;\n onPlayingChange: (playing: boolean) => void;\n onSeek: (seconds: number) => void;\n onRetry?: () => void;\n}>;\n\n/** Audio engine, network, file permission and playback lifecycle remain host-owned. */\nexport function VoiceNote({ descriptor, labels, formatTime, artwork, onPlayingChange, onSeek, onRetry }: VoiceNoteProps) {\n const media = resolveVoiceNote(descriptor);\n const error = media.state === \"error\";\n return <Surface padding=\"lg\"><Stack gap=\"md\">\n <Stack axis=\"inline\" gap=\"md\">\n {artwork ? <Asset descriptor={{kind:\"image\",decorative:true,shape:\"circle\"}}>{artwork}</Asset> : null}\n <Text emphasis=\"strong\">{media.title}</Text>\n </Stack>\n <Slider label={labels.seek} min={0} max={media.duration || 1} step={0.1} value={media.position} disabled={!media.canSeek} onValueChange={onSeek} getValueText={formatTime} />\n <Text tone=\"muted\">{formatTime(media.position)}{media.duration === null ? \"\" : ` / ${formatTime(media.duration)}`}</Text>\n {error ? <Text role=\"alert\">{labels.error}</Text> : null}\n <Stack axis=\"inline\" gap=\"sm\">\n <Button disabled={!media.canPlay} loading={media.state === \"loading\"} onClick={() => onPlayingChange(media.state !== \"playing\")}>{media.state === \"loading\" ? labels.loading : media.state === \"playing\" ? labels.pause : labels.play}</Button>\n {error && onRetry ? <Button disabled={media.disabled ?? false} onClick={onRetry}>{labels.retry}</Button> : null}\n </Stack>\n </Stack></Surface>;\n}\n"]}