@hjmds/react 1.7.0 → 1.8.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.
- package/README.md +17 -0
- package/THIRD_PARTY_NOTICES.md +28 -0
- package/dist/advanced-display.d.ts +3 -1
- package/dist/advanced-display.d.ts.map +1 -1
- package/dist/advanced-display.js +2 -2
- package/dist/advanced-display.js.map +1 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +36 -9
- package/dist/context-menu.js.map +1 -1
- package/dist/evidence.d.ts +61 -2
- package/dist/evidence.d.ts.map +1 -1
- package/dist/evidence.js +133 -64
- package/dist/evidence.js.map +1 -1
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +3 -2
- package/dist/layout.js.map +1 -1
- package/dist/masonry.d.ts +14 -0
- package/dist/masonry.d.ts.map +1 -0
- package/dist/masonry.js +13 -0
- package/dist/masonry.js.map +1 -0
- package/dist/menu-morph.d.ts +12 -0
- package/dist/menu-morph.d.ts.map +1 -0
- package/dist/menu-morph.js +79 -0
- package/dist/menu-morph.js.map +1 -0
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +13 -1
- package/dist/navigation.js.map +1 -1
- package/dist/qr-code.d.ts +11 -0
- package/dist/qr-code.d.ts.map +1 -0
- package/dist/qr-code.js +14 -0
- package/dist/qr-code.js.map +1 -0
- package/dist/statistic-motion.d.ts +12 -0
- package/dist/statistic-motion.d.ts.map +1 -0
- package/dist/statistic-motion.js +23 -0
- package/dist/statistic-motion.js.map +1 -0
- package/dist/styles.css +136 -133
- package/dist/styles.layered.css +136 -133
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +2 -1
- package/dist/theme.js.map +1 -1
- package/dist/thinking-orb.d.ts +9 -0
- package/dist/thinking-orb.d.ts.map +1 -0
- package/dist/thinking-orb.js +86 -0
- package/dist/thinking-orb.js.map +1 -0
- package/dist/virtual-list.d.ts +14 -0
- package/dist/virtual-list.d.ts.map +1 -0
- package/dist/virtual-list.js +48 -0
- package/dist/virtual-list.js.map +1 -0
- package/package.json +61 -5
package/README.md
CHANGED
|
@@ -144,3 +144,20 @@ uses caller-owned strings.
|
|
|
144
144
|
`Grid` observes window and element widths in the browser and starts from a
|
|
145
145
|
deterministic compact layout during SSR. Tests may pass `windowWidth` and
|
|
146
146
|
`availableWidth` explicitly; product code normally leaves both unset.
|
|
147
|
+
|
|
148
|
+
## ThinkingOrb
|
|
149
|
+
|
|
150
|
+
Beta web AI operation indicator: `@hjmds/react/thinking-orb`.
|
|
151
|
+
Requires a localized `label`; `state`, `size` (20/64), `paused`, and `active` control its presentation.
|
|
152
|
+
See [the shared contract and compatibility](../design-contracts/docs/thinking-orb.md).
|
|
153
|
+
|
|
154
|
+
## Optional presentation adapters
|
|
155
|
+
|
|
156
|
+
See [installation and behavior contracts](../design-contracts/docs/optional-adapters.md) for opt-in entries, pinned peers and verification limits. Native adapters remain experimental until device verification.
|
|
157
|
+
|
|
158
|
+
## Data layouts and QRCode
|
|
159
|
+
|
|
160
|
+
Masonry and VirtualList use the granular `masonry` and `virtual-list` entries.
|
|
161
|
+
Supply measured item heights for Masonry and a fixed row height for VirtualList.
|
|
162
|
+
The optional `qr-code` entry requires `qrcode-generator@2.0.4` and a visible alternative
|
|
163
|
+
action alongside the accessible code.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
## Thinking Orbs
|
|
3
|
+
|
|
4
|
+
Source: https://github.com/Jakubantalik/thinking-orbs/tree/de85557ca220332586d070d8788c0e1d6e877a0d
|
|
5
|
+
|
|
6
|
+
Geometry and presets adapted; DOM painters removed from the shared engine, lifecycle and semantic color integration rewritten for HJM.
|
|
7
|
+
|
|
8
|
+
MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2026 Jakub Antalik
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
@@ -111,8 +111,10 @@ export type StatisticProps<Id extends string = string> = Omit<HTMLAttributes<HTM
|
|
|
111
111
|
accessibilityLabel?: string;
|
|
112
112
|
composeAccessibilityLabel?: ComposeStatisticAccessibilityLabel<Id>;
|
|
113
113
|
renderTrendMark?: (props: StatisticTrendMarkRenderProps) => ReactNode;
|
|
114
|
+
/** Optional visual adapter; the descriptor remains the accessible value source. */
|
|
115
|
+
renderValue?: (value: string) => ReactNode;
|
|
114
116
|
}>;
|
|
115
|
-
export declare function Statistic<Id extends string = string>({ descriptor, density, presentation, contextLabel, accessibilityLabel, composeAccessibilityLabel, renderTrendMark, className, ...props }: StatisticProps<Id>): import("react").JSX.Element;
|
|
117
|
+
export declare function Statistic<Id extends string = string>({ descriptor, density, presentation, contextLabel, accessibilityLabel, composeAccessibilityLabel, renderTrendMark, renderValue, className, ...props }: StatisticProps<Id>): import("react").JSX.Element;
|
|
116
118
|
export type StatisticGroupProps<Id extends string = string> = Omit<HTMLAttributes<HTMLDivElement>, "children"> & Readonly<{
|
|
117
119
|
label: string;
|
|
118
120
|
descriptor: StatisticGroupDescriptor<Id>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advanced-display.d.ts","sourceRoot":"","sources":["../src/advanced-display.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC5B,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC5B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAGL,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC9B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAGL,aAAa,EACb,UAAU,EAEV,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAWL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EAEtB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAItE,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAC3E,QAAQ,CAAC;IACP,KAAK,EAAE,SAAS,aAAa,EAAE,CAAC;IA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AQ,CAAC;IACP,OAAO,EAAE,SAAS,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;IACrC,IAAI,EAAE,SAAS,GAAG,EAAE,CAAC;IACrB,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAClD,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,qDAAqD;IACrD,UAAU,EAAE,SAAS,CAAC;IACtB,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,KAAK,IAAI,CAAC;IACzE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC,CAAC;AAkGL,eAAO,MAAM,KAAK,EAA6B,CAAC,GAAG,EACjD,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,gBAAgB,CAAC,KACrD,YAAY,CAAC;AAElB,MAAM,MAAM,aAAa,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,CAC1D,cAAc,CAAC,gBAAgB,CAAC,EAChC,UAAU,CACX,GACC,QAAQ,CAAC;IACP,KAAK,EAAE,SAAS,sBAAsB,CAAC,EAAE,CAAC,EAAE,CAAC;IAC7C,qBAAqB,EAAE,6BAA6B,CAAC;CACtD,CAAC,CAAC;AAmDL,eAAO,MAAM,QAAQ,EAAgC,CAAC,EAAE,SAAS,MAAM,GAAG,MAAM,EAC9E,KAAK,EAAE,aAAa,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,gBAAgB,CAAC,KACvD,YAAY,CAAC"}
|
package/dist/advanced-display.js
CHANGED
|
@@ -136,7 +136,7 @@ export const List = forwardRef(function List({ label, children, separator = list
|
|
|
136
136
|
const items = Children.toArray(children);
|
|
137
137
|
return (_jsx("div", { ...props, ref: ref, "aria-label": label, className: classNames("hjm-list", className), "data-appearance": appearance, "data-separator": separator, role: "list", children: items.map((item, index) => (_jsx("div", { className: "hjm-list__item", role: "listitem", children: item }, isValidElement(item) && item.key !== null ? item.key : `hjm-list-${index}`))) }));
|
|
138
138
|
});
|
|
139
|
-
export function Statistic({ descriptor, density = "comfortable", presentation = "plain", contextLabel, accessibilityLabel, composeAccessibilityLabel, renderTrendMark, className, ...props }) {
|
|
139
|
+
export function Statistic({ descriptor, density = "comfortable", presentation = "plain", contextLabel, accessibilityLabel, composeAccessibilityLabel, renderTrendMark, renderValue, className, ...props }) {
|
|
140
140
|
const resolved = resolveStatisticDescriptor(descriptor);
|
|
141
141
|
const valueText = `${resolved.prefix ?? ""}${resolved.value}${resolved.suffix ?? ""}`;
|
|
142
142
|
const announcement = accessibilityLabel ?? composeAccessibilityLabel?.({
|
|
@@ -151,7 +151,7 @@ export function Statistic({ descriptor, density = "comfortable", presentation =
|
|
|
151
151
|
const trendName = resolved.trend
|
|
152
152
|
? statisticRecipe.trend.marks[resolved.trend.direction]
|
|
153
153
|
: undefined;
|
|
154
|
-
return (_jsxs("article", { ...props, "aria-label": announcement, className: classNames("hjm-statistic", className), "data-density": density, "data-presentation": presentation, children: [_jsx("span", { "aria-hidden": "true", className: "hjm-statistic__label", children: resolved.label }), _jsxs("span", { "aria-hidden": "true", className: "hjm-statistic__value-row", children: [resolved.prefix ? _jsx("span", { className: "hjm-statistic__affix", children: resolved.prefix }) : null, _jsx("strong", { className: "hjm-statistic__value", children: resolved.value }), resolved.suffix ? _jsx("span", { className: "hjm-statistic__affix", children: resolved.suffix }) : null] }), resolved.trend ? (_jsxs("span", { "aria-hidden": "true", className: "hjm-statistic__trend", "data-tone": resolved.trend.tone, children: [_jsx("span", { className: "hjm-statistic__trend-mark", children: renderTrendMark?.({ name: trendName, color: "currentColor", size: 16 }) ?? (resolved.trend.direction === "up" ? "↑" : resolved.trend.direction === "down" ? "↓" : "—") }), resolved.trend.label] })) : null, resolved.hint ? _jsx("span", { "aria-hidden": "true", className: "hjm-statistic__hint", children: resolved.hint }) : null] }));
|
|
154
|
+
return (_jsxs("article", { ...props, "aria-label": announcement, className: classNames("hjm-statistic", className), "data-density": density, "data-presentation": presentation, children: [_jsx("span", { "aria-hidden": "true", className: "hjm-statistic__label", children: resolved.label }), _jsxs("span", { "aria-hidden": "true", className: "hjm-statistic__value-row", children: [resolved.prefix ? _jsx("span", { className: "hjm-statistic__affix", children: resolved.prefix }) : null, _jsx("strong", { className: "hjm-statistic__value", children: renderValue?.(resolved.value) ?? resolved.value }), resolved.suffix ? _jsx("span", { className: "hjm-statistic__affix", children: resolved.suffix }) : null] }), resolved.trend ? (_jsxs("span", { "aria-hidden": "true", className: "hjm-statistic__trend", "data-tone": resolved.trend.tone, children: [_jsx("span", { className: "hjm-statistic__trend-mark", children: renderTrendMark?.({ name: trendName, color: "currentColor", size: 16 }) ?? (resolved.trend.direction === "up" ? "↑" : resolved.trend.direction === "down" ? "↓" : "—") }), resolved.trend.label] })) : null, resolved.hint ? _jsx("span", { "aria-hidden": "true", className: "hjm-statistic__hint", children: resolved.hint }) : null] }));
|
|
155
155
|
}
|
|
156
156
|
export function StatisticGroup({ label, descriptor, density, presentation, composeAccessibilityLabel, renderTrendMark, className, style, ...props }) {
|
|
157
157
|
validateStatisticGroup(descriptor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advanced-display.js","sourceRoot":"","sources":["../src/advanced-display.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,iCAAiC,EACjC,gCAAgC,GAGjC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,yBAAyB,GAG1B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,GAIvB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,UAAU,EACV,eAAe,GAMhB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,cAAc,EACd,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,GAUT,MAAM,OAAO,CAA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AC,CAAC,CAAC,IAAI,IACH,EACP,gBAAM,SAAS,EAAC,uBAAuB,aACrC,gBAAM,SAAS,EAAC,uBAAuB,aACrC,iBAAQ,SAAS,EAAC,qBAAqB,YAAE,IAAI,CAAC,KAAK,GAAU,EAC5D,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAChB,eAAM,SAAS,EAAC,yBAAyB,YAAE,IAAI,CAAC,SAAS,GAAQ,CAClE,CAAC,CAAC,CAAC,IAAI,IACH,EACN,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAClB,eAAM,SAAS,EAAC,2BAA2B,YAAE,IAAI,CAAC,WAAW,GAAQ,CACtE,CAAC,CAAC,CAAC,IAAI,IACH,KAlBF,IAAI,CAAC,EAAE,CAmBT,CACN,CAAC,GACC,CACN,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC,aAAa,CAE/B,CAAC","sourcesContent":["import {\n resolveDescriptionListColumnCount,\n resolveDescriptionListDescriptor,\n type DescriptionItemDescriptor,\n type DescriptionListColumns,\n} from \"@hjmds/design-contracts/components/description-list\";\nimport {\n resolveTimelineDescriptor,\n type ComposeTimelineAccessibleName,\n type TimelineItemDescriptor,\n} from \"@hjmds/design-contracts/components/timeline\";\nimport {\n resolveStatisticDescriptor,\n validateStatisticGroup,\n type ResolvedStatisticDescriptor,\n type StatisticDescriptor,\n type StatisticGroupDescriptor,\n} from \"@hjmds/design-contracts/components/statistic\";\nimport {\n accordionRecipe,\n avatarRecipe,\n dividerRecipe,\n listRecipe,\n statisticRecipe,\n type AccordionDensity,\n type AvatarShape,\n type AvatarSize,\n type StatisticDensity,\n type StatisticPresentation,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n Children,\n createElement,\n forwardRef,\n isValidElement,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type ForwardedRef,\n type HTMLAttributes,\n type ImgHTMLAttributes,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type RefAttributes,\n type TableHTMLAttributes,\n} from \"react\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\nimport { classNames, useControllableState, useElementWidth } from \"./internal.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\n\nexport type AccordionItem = Readonly<{\n id: string;\n title: ReactNode;\n panel: ReactNode;\n disabled?: boolean;\n}>;\n\nexport type AccordionProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> &\n Readonly<{\n items: readonly AccordionItem[];\n value?: readonly string[];\n defaultValue?: readonly string[];\n onValueChange?: (value: readonly string[]) => void;\n allowsMultipleExpanded?: boolean;\n density?: AccordionDensity;\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n }>;\n\nfunction validateAccordionItems(items: readonly AccordionItem[]): void {\n if (items.length === 0) throw new TypeError(\"Accordion requires at least one item\");\n const ids = new Set<string>();\n for (const item of items) {\n if (item.id.trim().length === 0) throw new TypeError(\"Accordion item id must not be empty\");\n if (ids.has(item.id)) throw new TypeError(`Duplicate Accordion item id: ${item.id}`);\n ids.add(item.id);\n }\n}\n\nfunction accordionFocusTarget(\n items: readonly AccordionItem[],\n currentIndex: number,\n key: string,\n): number | undefined {\n if (key === \"Home\") return items.findIndex((item) => !item.disabled);\n if (key === \"End\") {\n for (let index = items.length - 1; index >= 0; index -= 1) {\n if (!items[index]?.disabled) return index;\n }\n return -1;\n }\n const direction = key === \"ArrowDown\" ? 1 : key === \"ArrowUp\" ? -1 : 0;\n if (direction === 0) return undefined;\n for (let offset = 1; offset <= items.length; offset += 1) {\n const index = (currentIndex + direction * offset + items.length) % items.length;\n if (!items[index]?.disabled) return index;\n }\n return currentIndex;\n}\n\nexport const Accordion = forwardRef<HTMLDivElement, AccordionProps>(\n function Accordion(\n {\n items,\n value: valueProp,\n defaultValue = [],\n onValueChange,\n allowsMultipleExpanded = accordionRecipe.defaults.allowsMultipleExpanded,\n density = accordionRecipe.defaults.density,\n headingLevel = 3,\n className,\n ...props\n },\n ref,\n ) {\n validateAccordionItems(items);\n const [value, setValue] = useControllableState<readonly string[]>({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue,\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const validIds = new Set(items.map((item) => item.id));\n const valueIds = new Set<string>();\n for (const id of value) {\n if (!validIds.has(id)) throw new RangeError(`Unknown Accordion value: ${id}`);\n if (valueIds.has(id)) throw new TypeError(`Duplicate Accordion value: ${id}`);\n valueIds.add(id);\n }\n if (!allowsMultipleExpanded && value.length > 1) {\n throw new RangeError(\"Accordion only allows one expanded item\");\n }\n const baseId = useId().replaceAll(\":\", \"\");\n const triggerRefs = useRef(new Map<string, HTMLButtonElement>());\n const toggle = (id: string) => {\n const expanded = value.includes(id);\n setValue(\n expanded\n ? value.filter((candidate) => candidate !== id)\n : allowsMultipleExpanded\n ? [...value, id]\n : [id],\n );\n };\n\n return (\n <div\n {...props}\n ref={ref}\n className={classNames(\"hjm-accordion\", className)}\n data-density={density}\n data-multiple={allowsMultipleExpanded || undefined}\n >\n {items.map((item, index) => {\n const expanded = value.includes(item.id);\n const triggerId = `${baseId}-accordion-trigger-${index}`;\n const panelId = `${baseId}-accordion-panel-${index}`;\n const trigger = (\n <button\n ref={(node) => {\n if (node) triggerRefs.current.set(item.id, node);\n else triggerRefs.current.delete(item.id);\n }}\n id={triggerId}\n type=\"button\"\n className=\"hjm-accordion__trigger\"\n aria-expanded={expanded}\n aria-controls={panelId}\n disabled={item.disabled}\n onClick={() => toggle(item.id)}\n onKeyDown={(event: KeyboardEvent<HTMLButtonElement>) => {\n const target = accordionFocusTarget(items, index, event.key);\n if (target === undefined || target < 0) return;\n event.preventDefault();\n triggerRefs.current.get(items[target]!.id)?.focus();\n }}\n >\n <span className=\"hjm-accordion__title\">{item.title}</span>\n <span className=\"hjm-accordion__indicator\" aria-hidden=\"true\">\n {expanded ? \"−\" : \"+\"}\n </span>\n </button>\n );\n return (\n <div\n key={item.id}\n className=\"hjm-accordion__item\"\n data-state={item.disabled ? \"disabled\" : expanded ? \"expanded\" : \"collapsed\"}\n >\n {createElement(`h${headingLevel}`, { className: \"hjm-accordion__header\" }, trigger)}\n <div\n id={panelId}\n role=\"region\"\n className=\"hjm-accordion__panel\"\n aria-labelledby={triggerId}\n hidden={!expanded}\n >\n {item.panel}\n </div>\n </div>\n );\n })}\n </div>\n );\n },\n);\n\nfunction initials(name: string): string {\n return name\n .trim()\n .split(/\\s+/u)\n .slice(0, 2)\n .map((part) => Array.from(part)[0] ?? \"\")\n .join(\"\")\n .toLocaleUpperCase();\n}\n\nexport type AvatarProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n name: string;\n src?: string;\n alt?: string;\n fallback?: ReactNode;\n size?: AvatarSize;\n shape?: AvatarShape;\n imageProps?: Omit<ImgHTMLAttributes<HTMLImageElement>, \"alt\" | \"src\">;\n }>;\n\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n {\n name,\n src,\n alt = name,\n fallback,\n size = avatarRecipe.defaults.size,\n shape = avatarRecipe.defaults.shape,\n imageProps,\n className,\n ...props\n },\n ref,\n) {\n if (name.trim().length === 0) throw new TypeError(\"Avatar name must not be empty\");\n const [imageAvailable, setImageAvailable] = useState(Boolean(src));\n useEffect(() => setImageAvailable(Boolean(src)), [src]);\n const { onError, className: imageClassName, ...restImageProps } = imageProps ?? {};\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-avatar\", className)}\n data-size={size}\n data-shape={shape}\n data-state={imageAvailable ? \"image\" : \"fallback\"}\n >\n {src && imageAvailable ? (\n <img\n {...restImageProps}\n src={src}\n alt={alt}\n className={classNames(\"hjm-avatar__image\", imageClassName)}\n onError={(event) => {\n setImageAvailable(false);\n onError?.(event);\n }}\n />\n ) : (\n <span\n className=\"hjm-avatar__fallback\"\n role={alt.length > 0 ? \"img\" : undefined}\n aria-label={alt.length > 0 ? alt : undefined}\n aria-hidden={alt.length === 0 || undefined}\n >\n {fallback ?? initials(name)}\n </span>\n )}\n </span>\n );\n});\n\nexport type AvatarGroupProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n /** Required: a pile of faces is meaningless to a screen reader otherwise. */\n label: string;\n children: ReactNode;\n size?: AvatarSize;\n /** Product-composed overflow copy such as \"+3\"; the count is the product's. */\n overflow?: ReactNode;\n }>;\n\n/**\n * Overlapping avatars. The overlap comes from the recipe ratio rather than a\n * pixel value so it holds across all four sizes, and the group carries one\n * accessible name instead of letting a reader walk five unlabelled images.\n */\nexport const AvatarGroup = forwardRef<HTMLSpanElement, AvatarGroupProps>(function AvatarGroup(\n { label, children, size = avatarRecipe.defaults.size, overflow, className, ...props },\n ref,\n) {\n if (label.trim().length === 0) throw new TypeError(\"AvatarGroup label must not be empty\");\n const offset = Math.round(avatarRecipe.sizes[size] * avatarRecipe.overlapRatio);\n return (\n <span\n {...props}\n ref={ref}\n role=\"group\"\n aria-label={label}\n className={classNames(\"hjm-avatar-group\", className)}\n data-size={size}\n style={{ \"--hjm-avatar-overlap\": `${offset}px` } as CSSProperties}\n >\n {children}\n {overflow ? <span className=\"hjm-avatar-group__overflow\" aria-hidden=\"true\">{overflow}</span> : null}\n </span>\n );\n});\n\nexport type DividerOrientation = \"horizontal\" | \"vertical\";\nexport type DividerInset = keyof typeof dividerRecipe.insets;\n\nexport type DividerProps = HTMLAttributes<HTMLElement> &\n Readonly<{\n orientation?: DividerOrientation;\n inset?: DividerInset;\n decorative?: boolean;\n }>;\n\nexport const Divider = forwardRef<HTMLElement, DividerProps>(function Divider(\n {\n orientation = dividerRecipe.defaults.orientation,\n inset = dividerRecipe.defaults.inset,\n decorative = false,\n className,\n ...props\n },\n ref,\n) {\n return createElement(orientation === \"horizontal\" ? \"hr\" : \"div\", {\n ...props,\n ref,\n className: classNames(\"hjm-divider\", className),\n \"data-orientation\": orientation,\n \"data-inset\": inset,\n role: decorative ? \"presentation\" : \"separator\",\n \"aria-hidden\": decorative || undefined,\n \"aria-orientation\": decorative ? undefined : orientation,\n });\n});\n\nexport type ListAppearance = \"grouped\" | \"plain\";\n\nexport type ListProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n Readonly<{\n label: string;\n children: ReactNode;\n separator?: keyof typeof listRecipe.separators;\n appearance?: ListAppearance;\n }>;\n\n/** Semantic list container that owns separators around composed rows. */\nexport const List = forwardRef<HTMLDivElement, ListProps>(function List(\n {\n label,\n children,\n separator = listRecipe.defaults.separator,\n appearance = \"plain\",\n className,\n ...props\n },\n ref,\n) {\n if (!label.trim()) throw new TypeError(\"List label must not be empty\");\n const items = Children.toArray(children);\n return (\n <div\n {...props}\n ref={ref}\n aria-label={label}\n className={classNames(\"hjm-list\", className)}\n data-appearance={appearance}\n data-separator={separator}\n role=\"list\"\n >\n {items.map((item, index) => (\n <div\n className=\"hjm-list__item\"\n key={isValidElement(item) && item.key !== null ? item.key : `hjm-list-${index}`}\n role=\"listitem\"\n >\n {item}\n </div>\n ))}\n </div>\n );\n});\n\nexport type StatisticTrendMarkRenderProps = Readonly<{\n name: \"trendUp\" | \"trendDown\" | \"trendFlat\";\n color: \"currentColor\";\n size: number;\n}>;\n\nexport type ComposeStatisticAccessibilityLabel<Id extends string = string> = (\n input: Readonly<{\n contextLabel?: string;\n descriptor: ResolvedStatisticDescriptor<Id>;\n valueText: string;\n }>,\n) => string;\n\nexport type StatisticProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLElement>,\n \"children\"\n> & Readonly<{\n descriptor: StatisticDescriptor<Id>;\n density?: StatisticDensity;\n presentation?: StatisticPresentation;\n contextLabel?: string;\n accessibilityLabel?: string;\n composeAccessibilityLabel?: ComposeStatisticAccessibilityLabel<Id>;\n renderTrendMark?: (props: StatisticTrendMarkRenderProps) => ReactNode;\n}>;\n\nexport function Statistic<Id extends string = string>({\n descriptor,\n density = \"comfortable\",\n presentation = \"plain\",\n contextLabel,\n accessibilityLabel,\n composeAccessibilityLabel,\n renderTrendMark,\n className,\n ...props\n}: StatisticProps<Id>) {\n const resolved = resolveStatisticDescriptor(descriptor);\n const valueText = `${resolved.prefix ?? \"\"}${resolved.value}${resolved.suffix ?? \"\"}`;\n const announcement = accessibilityLabel ?? composeAccessibilityLabel?.({\n ...(contextLabel === undefined ? {} : { contextLabel }),\n descriptor: resolved,\n valueText,\n }) ?? [contextLabel, resolved.label, valueText, resolved.trend?.label, resolved.hint]\n .filter(Boolean)\n .join(\", \");\n if (!announcement.trim()) throw new TypeError(\"Statistic accessibility label must not be empty\");\n const trendName = resolved.trend\n ? statisticRecipe.trend.marks[resolved.trend.direction]\n : undefined;\n return (\n <article\n {...props}\n aria-label={announcement}\n className={classNames(\"hjm-statistic\", className)}\n data-density={density}\n data-presentation={presentation}\n >\n <span aria-hidden=\"true\" className=\"hjm-statistic__label\">{resolved.label}</span>\n <span aria-hidden=\"true\" className=\"hjm-statistic__value-row\">\n {resolved.prefix ? <span className=\"hjm-statistic__affix\">{resolved.prefix}</span> : null}\n <strong className=\"hjm-statistic__value\">{resolved.value}</strong>\n {resolved.suffix ? <span className=\"hjm-statistic__affix\">{resolved.suffix}</span> : null}\n </span>\n {resolved.trend ? (\n <span aria-hidden=\"true\" className=\"hjm-statistic__trend\" data-tone={resolved.trend.tone}>\n <span className=\"hjm-statistic__trend-mark\">\n {renderTrendMark?.({ name: trendName!, color: \"currentColor\", size: 16 }) ?? (\n resolved.trend.direction === \"up\" ? \"↑\" : resolved.trend.direction === \"down\" ? \"↓\" : \"—\"\n )}\n </span>\n {resolved.trend.label}\n </span>\n ) : null}\n {resolved.hint ? <span aria-hidden=\"true\" className=\"hjm-statistic__hint\">{resolved.hint}</span> : null}\n </article>\n );\n}\n\nexport type StatisticGroupProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLDivElement>,\n \"children\"\n> & Readonly<{\n label: string;\n descriptor: StatisticGroupDescriptor<Id>;\n density?: StatisticDensity;\n presentation?: StatisticPresentation;\n composeAccessibilityLabel?: ComposeStatisticAccessibilityLabel<Id>;\n renderTrendMark?: (props: StatisticTrendMarkRenderProps) => ReactNode;\n}>;\n\nexport function StatisticGroup<Id extends string = string>({\n label,\n descriptor,\n density,\n presentation,\n composeAccessibilityLabel,\n renderTrendMark,\n className,\n style,\n ...props\n}: StatisticGroupProps<Id>) {\n validateStatisticGroup(descriptor);\n if (!label.trim()) throw new TypeError(\"StatisticGroup label must not be empty\");\n return (\n <div\n {...props}\n aria-label={label}\n className={classNames(\"hjm-statistic-group\", className)}\n role=\"list\"\n style={{ ...style, \"--hjm-statistic-columns\": descriptor.columns ?? statisticRecipe.defaults.columns } as CSSProperties}\n >\n {descriptor.items.map((item) => (\n <div key={item.id} role=\"listitem\">\n <Statistic\n contextLabel={label}\n descriptor={item}\n {...(composeAccessibilityLabel === undefined ? {} : { composeAccessibilityLabel })}\n {...(density === undefined ? {} : { density })}\n {...(presentation === undefined ? {} : { presentation })}\n {...(renderTrendMark === undefined ? {} : { renderTrendMark })}\n />\n </div>\n ))}\n </div>\n );\n}\n\nexport type DescriptionListProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLDListElement>,\n \"children\"\n> &\n Readonly<{\n items: readonly DescriptionItemDescriptor<Id>[];\n columns?: DescriptionListColumns;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nfunction DescriptionListInner<Id extends string>(\n { items, columns, className, layoutStyle, style, ...props }: DescriptionListProps<Id>,\n forwardedRef: ForwardedRef<HTMLDListElement>,\n) {\n const descriptor = resolveDescriptionListDescriptor({\n items,\n ...(columns === undefined ? {} : { columns }),\n });\n const [width, ref] = useElementWidth(forwardedRef);\n const theme = useOptionalHjmTheme();\n const resolvedColumns = resolveDescriptionListColumnCount(\n width ?? 0,\n descriptor.columns,\n theme?.environment.textScale ?? 1,\n );\n const responsiveStyle = {\n ...style,\n ...layoutStyle,\n \"--hjm-description-columns\": resolvedColumns,\n } as CSSProperties;\n return (\n <dl\n {...props}\n ref={ref}\n className={classNames(\"hjm-description-list\", className)}\n data-columns={resolvedColumns}\n data-state={resolvedColumns < descriptor.columns ? \"collapsed\" : \"ready\"}\n style={responsiveStyle}\n >\n {descriptor.items.map((item) => (\n <div key={item.id} className=\"hjm-description-list__item\">\n <dt className=\"hjm-description-list__label\">{item.label}</dt>\n <dd className=\"hjm-description-list__value\">{item.value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n\nexport const DescriptionList = forwardRef(DescriptionListInner) as <Id extends string = string>(\n props: DescriptionListProps<Id> & RefAttributes<HTMLDListElement>,\n) => ReactElement;\n\nexport type TableSortDirection = \"ascending\" | \"descending\";\n\nexport type TableColumn<Row> = Readonly<{\n id: string;\n header: ReactNode;\n cell: (row: Row, rowIndex: number) => ReactNode;\n align?: \"start\" | \"center\" | \"end\";\n sortable?: boolean;\n sortDirection?: TableSortDirection;\n}>;\n\nexport type TableProps<Row> = Omit<TableHTMLAttributes<HTMLTableElement>, \"children\"> &\n Readonly<{\n columns: readonly TableColumn<Row>[];\n rows: readonly Row[];\n getRowKey: (row: Row, rowIndex: number) => string;\n caption?: ReactNode;\n /** Localized content rendered when rows is empty. */\n emptyState: ReactNode;\n onSortChange?: (columnId: string, direction: TableSortDirection) => void;\n wrapperClassName?: string;\n }>;\n\nfunction TableInner<Row>(\n {\n columns,\n rows,\n getRowKey,\n caption,\n emptyState,\n onSortChange,\n wrapperClassName,\n className,\n ...props\n }: TableProps<Row>,\n ref: ForwardedRef<HTMLTableElement>,\n) {\n if (columns.length === 0) throw new TypeError(\"Table requires at least one column\");\n const ids = new Set<string>();\n for (const column of columns) {\n if (column.id.trim().length === 0) throw new TypeError(\"Table column id must not be empty\");\n if (ids.has(column.id)) throw new TypeError(`Duplicate Table column id: ${column.id}`);\n ids.add(column.id);\n if (column.sortDirection && !column.sortable) {\n throw new TypeError(`Table column ${column.id} has sortDirection but is not sortable`);\n }\n }\n const rowKeys = rows.map((row, rowIndex) => getRowKey(row, rowIndex));\n const seenRowKeys = new Set<string>();\n for (const rowKey of rowKeys) {\n if (rowKey.trim().length === 0) throw new TypeError(\"Table row key must not be empty\");\n if (seenRowKeys.has(rowKey)) throw new TypeError(`Duplicate Table row key: ${rowKey}`);\n seenRowKeys.add(rowKey);\n }\n return (\n <div className={classNames(\"hjm-table-scroll\", wrapperClassName)} tabIndex={0}>\n <table {...props} ref={ref} className={classNames(\"hjm-table\", className)}>\n {caption ? <caption className=\"hjm-table__caption\">{caption}</caption> : null}\n <thead>\n <tr>\n {columns.map((column) => (\n <th\n key={column.id}\n scope=\"col\"\n className=\"hjm-table__header\"\n data-align={column.align ?? \"start\"}\n aria-sort={column.sortDirection ?? (column.sortable ? \"none\" : undefined)}\n >\n {column.sortable ? (\n <button\n type=\"button\"\n className=\"hjm-table__sort\"\n onClick={() =>\n onSortChange?.(\n column.id,\n column.sortDirection === \"ascending\" ? \"descending\" : \"ascending\",\n )\n }\n >\n {column.header}\n <span aria-hidden=\"true\">\n {column.sortDirection === \"ascending\"\n ? \" ↑\"\n : column.sortDirection === \"descending\"\n ? \" ↓\"\n : \" ↕\"}\n </span>\n </button>\n ) : column.header}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.length === 0 ? (\n <tr>\n <td className=\"hjm-table__empty\" colSpan={columns.length}>{emptyState}</td>\n </tr>\n ) : (\n rows.map((row, rowIndex) => (\n <tr key={rowKeys[rowIndex]} className=\"hjm-table__row\">\n {columns.map((column) => (\n <td\n key={column.id}\n className=\"hjm-table__cell\"\n data-align={column.align ?? \"start\"}\n >\n {column.cell(row, rowIndex)}\n </td>\n ))}\n </tr>\n ))\n )}\n </tbody>\n </table>\n </div>\n );\n}\n\nexport const Table = forwardRef(TableInner) as <Row>(\n props: TableProps<Row> & RefAttributes<HTMLTableElement>,\n) => ReactElement;\n\nexport type TimelineProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLOListElement>,\n \"children\"\n> &\n Readonly<{\n items: readonly TimelineItemDescriptor<Id>[];\n composeAccessibleName: ComposeTimelineAccessibleName;\n }>;\n\nfunction TimelineInner<Id extends string = string>(\n {\n items,\n composeAccessibleName,\n className,\n ...props\n }: TimelineProps<Id>,\n ref: ForwardedRef<HTMLOListElement>,\n) {\n const resolved = resolveTimelineDescriptor(\n { items },\n { composeAccessibleName },\n );\n return (\n <ol\n {...props}\n ref={ref}\n className={classNames(\"hjm-timeline\", className)}\n >\n {resolved.map((item, index) => (\n <li\n aria-label={item.accessibleName}\n className=\"hjm-timeline__item\"\n data-tone={item.tone}\n key={item.id}\n >\n <span className=\"hjm-timeline__rail\" aria-hidden=\"true\">\n <span className=\"hjm-timeline__dot\" />\n {index < resolved.length - 1 ? (\n <span className=\"hjm-timeline__connector\" />\n ) : null}\n </span>\n <span className=\"hjm-timeline__content\">\n <span className=\"hjm-timeline__heading\">\n <strong className=\"hjm-timeline__label\">{item.label}</strong>\n {item.timestamp ? (\n <time className=\"hjm-timeline__timestamp\">{item.timestamp}</time>\n ) : null}\n </span>\n {item.description ? (\n <span className=\"hjm-timeline__description\">{item.description}</span>\n ) : null}\n </span>\n </li>\n ))}\n </ol>\n );\n}\n\nexport const Timeline = forwardRef(TimelineInner) as <Id extends string = string>(\n props: TimelineProps<Id> & RefAttributes<HTMLOListElement>,\n) => ReactElement;\n"]}
|
|
1
|
+
{"version":3,"file":"advanced-display.js","sourceRoot":"","sources":["../src/advanced-display.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,iCAAiC,EACjC,gCAAgC,GAGjC,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EACL,yBAAyB,GAG1B,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,GAIvB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,eAAe,EACf,YAAY,EACZ,aAAa,EACb,UAAU,EACV,eAAe,GAMhB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,QAAQ,EACR,aAAa,EACb,UAAU,EACV,cAAc,EACd,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,GAUT,M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,CAAC,CAAC,CAAC,CAAC,CAC7B,eAAM,SAAS,EAAC,yBAAyB,GAAG,CAC7C,CAAC,CAAC,CAAC,IAAI,IACH,EACP,gBAAM,SAAS,EAAC,uBAAuB,aACrC,gBAAM,SAAS,EAAC,uBAAuB,aACrC,iBAAQ,SAAS,EAAC,qBAAqB,YAAE,IAAI,CAAC,KAAK,GAAU,EAC5D,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAChB,eAAM,SAAS,EAAC,yBAAyB,YAAE,IAAI,CAAC,SAAS,GAAQ,CAClE,CAAC,CAAC,CAAC,IAAI,IACH,EACN,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAClB,eAAM,SAAS,EAAC,2BAA2B,YAAE,IAAI,CAAC,WAAW,GAAQ,CACtE,CAAC,CAAC,CAAC,IAAI,IACH,KAlBF,IAAI,CAAC,EAAE,CAmBT,CACN,CAAC,GACC,CACN,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAC,aAAa,CAE/B,CAAC","sourcesContent":["import {\n resolveDescriptionListColumnCount,\n resolveDescriptionListDescriptor,\n type DescriptionItemDescriptor,\n type DescriptionListColumns,\n} from \"@hjmds/design-contracts/components/description-list\";\nimport {\n resolveTimelineDescriptor,\n type ComposeTimelineAccessibleName,\n type TimelineItemDescriptor,\n} from \"@hjmds/design-contracts/components/timeline\";\nimport {\n resolveStatisticDescriptor,\n validateStatisticGroup,\n type ResolvedStatisticDescriptor,\n type StatisticDescriptor,\n type StatisticGroupDescriptor,\n} from \"@hjmds/design-contracts/components/statistic\";\nimport {\n accordionRecipe,\n avatarRecipe,\n dividerRecipe,\n listRecipe,\n statisticRecipe,\n type AccordionDensity,\n type AvatarShape,\n type AvatarSize,\n type StatisticDensity,\n type StatisticPresentation,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n Children,\n createElement,\n forwardRef,\n isValidElement,\n useEffect,\n useId,\n useRef,\n useState,\n type CSSProperties,\n type ForwardedRef,\n type HTMLAttributes,\n type ImgHTMLAttributes,\n type KeyboardEvent,\n type ReactElement,\n type ReactNode,\n type RefAttributes,\n type TableHTMLAttributes,\n} from \"react\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\nimport { classNames, useControllableState, useElementWidth } from \"./internal.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\n\nexport type AccordionItem = Readonly<{\n id: string;\n title: ReactNode;\n panel: ReactNode;\n disabled?: boolean;\n}>;\n\nexport type AccordionProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> &\n Readonly<{\n items: readonly AccordionItem[];\n value?: readonly string[];\n defaultValue?: readonly string[];\n onValueChange?: (value: readonly string[]) => void;\n allowsMultipleExpanded?: boolean;\n density?: AccordionDensity;\n headingLevel?: 2 | 3 | 4 | 5 | 6;\n }>;\n\nfunction validateAccordionItems(items: readonly AccordionItem[]): void {\n if (items.length === 0) throw new TypeError(\"Accordion requires at least one item\");\n const ids = new Set<string>();\n for (const item of items) {\n if (item.id.trim().length === 0) throw new TypeError(\"Accordion item id must not be empty\");\n if (ids.has(item.id)) throw new TypeError(`Duplicate Accordion item id: ${item.id}`);\n ids.add(item.id);\n }\n}\n\nfunction accordionFocusTarget(\n items: readonly AccordionItem[],\n currentIndex: number,\n key: string,\n): number | undefined {\n if (key === \"Home\") return items.findIndex((item) => !item.disabled);\n if (key === \"End\") {\n for (let index = items.length - 1; index >= 0; index -= 1) {\n if (!items[index]?.disabled) return index;\n }\n return -1;\n }\n const direction = key === \"ArrowDown\" ? 1 : key === \"ArrowUp\" ? -1 : 0;\n if (direction === 0) return undefined;\n for (let offset = 1; offset <= items.length; offset += 1) {\n const index = (currentIndex + direction * offset + items.length) % items.length;\n if (!items[index]?.disabled) return index;\n }\n return currentIndex;\n}\n\nexport const Accordion = forwardRef<HTMLDivElement, AccordionProps>(\n function Accordion(\n {\n items,\n value: valueProp,\n defaultValue = [],\n onValueChange,\n allowsMultipleExpanded = accordionRecipe.defaults.allowsMultipleExpanded,\n density = accordionRecipe.defaults.density,\n headingLevel = 3,\n className,\n ...props\n },\n ref,\n ) {\n validateAccordionItems(items);\n const [value, setValue] = useControllableState<readonly string[]>({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue,\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const validIds = new Set(items.map((item) => item.id));\n const valueIds = new Set<string>();\n for (const id of value) {\n if (!validIds.has(id)) throw new RangeError(`Unknown Accordion value: ${id}`);\n if (valueIds.has(id)) throw new TypeError(`Duplicate Accordion value: ${id}`);\n valueIds.add(id);\n }\n if (!allowsMultipleExpanded && value.length > 1) {\n throw new RangeError(\"Accordion only allows one expanded item\");\n }\n const baseId = useId().replaceAll(\":\", \"\");\n const triggerRefs = useRef(new Map<string, HTMLButtonElement>());\n const toggle = (id: string) => {\n const expanded = value.includes(id);\n setValue(\n expanded\n ? value.filter((candidate) => candidate !== id)\n : allowsMultipleExpanded\n ? [...value, id]\n : [id],\n );\n };\n\n return (\n <div\n {...props}\n ref={ref}\n className={classNames(\"hjm-accordion\", className)}\n data-density={density}\n data-multiple={allowsMultipleExpanded || undefined}\n >\n {items.map((item, index) => {\n const expanded = value.includes(item.id);\n const triggerId = `${baseId}-accordion-trigger-${index}`;\n const panelId = `${baseId}-accordion-panel-${index}`;\n const trigger = (\n <button\n ref={(node) => {\n if (node) triggerRefs.current.set(item.id, node);\n else triggerRefs.current.delete(item.id);\n }}\n id={triggerId}\n type=\"button\"\n className=\"hjm-accordion__trigger\"\n aria-expanded={expanded}\n aria-controls={panelId}\n disabled={item.disabled}\n onClick={() => toggle(item.id)}\n onKeyDown={(event: KeyboardEvent<HTMLButtonElement>) => {\n const target = accordionFocusTarget(items, index, event.key);\n if (target === undefined || target < 0) return;\n event.preventDefault();\n triggerRefs.current.get(items[target]!.id)?.focus();\n }}\n >\n <span className=\"hjm-accordion__title\">{item.title}</span>\n <span className=\"hjm-accordion__indicator\" aria-hidden=\"true\">\n {expanded ? \"−\" : \"+\"}\n </span>\n </button>\n );\n return (\n <div\n key={item.id}\n className=\"hjm-accordion__item\"\n data-state={item.disabled ? \"disabled\" : expanded ? \"expanded\" : \"collapsed\"}\n >\n {createElement(`h${headingLevel}`, { className: \"hjm-accordion__header\" }, trigger)}\n <div\n id={panelId}\n role=\"region\"\n className=\"hjm-accordion__panel\"\n aria-labelledby={triggerId}\n hidden={!expanded}\n >\n {item.panel}\n </div>\n </div>\n );\n })}\n </div>\n );\n },\n);\n\nfunction initials(name: string): string {\n return name\n .trim()\n .split(/\\s+/u)\n .slice(0, 2)\n .map((part) => Array.from(part)[0] ?? \"\")\n .join(\"\")\n .toLocaleUpperCase();\n}\n\nexport type AvatarProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n name: string;\n src?: string;\n alt?: string;\n fallback?: ReactNode;\n size?: AvatarSize;\n shape?: AvatarShape;\n imageProps?: Omit<ImgHTMLAttributes<HTMLImageElement>, \"alt\" | \"src\">;\n }>;\n\nexport const Avatar = forwardRef<HTMLSpanElement, AvatarProps>(function Avatar(\n {\n name,\n src,\n alt = name,\n fallback,\n size = avatarRecipe.defaults.size,\n shape = avatarRecipe.defaults.shape,\n imageProps,\n className,\n ...props\n },\n ref,\n) {\n if (name.trim().length === 0) throw new TypeError(\"Avatar name must not be empty\");\n const [imageAvailable, setImageAvailable] = useState(Boolean(src));\n useEffect(() => setImageAvailable(Boolean(src)), [src]);\n const { onError, className: imageClassName, ...restImageProps } = imageProps ?? {};\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-avatar\", className)}\n data-size={size}\n data-shape={shape}\n data-state={imageAvailable ? \"image\" : \"fallback\"}\n >\n {src && imageAvailable ? (\n <img\n {...restImageProps}\n src={src}\n alt={alt}\n className={classNames(\"hjm-avatar__image\", imageClassName)}\n onError={(event) => {\n setImageAvailable(false);\n onError?.(event);\n }}\n />\n ) : (\n <span\n className=\"hjm-avatar__fallback\"\n role={alt.length > 0 ? \"img\" : undefined}\n aria-label={alt.length > 0 ? alt : undefined}\n aria-hidden={alt.length === 0 || undefined}\n >\n {fallback ?? initials(name)}\n </span>\n )}\n </span>\n );\n});\n\nexport type AvatarGroupProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n /** Required: a pile of faces is meaningless to a screen reader otherwise. */\n label: string;\n children: ReactNode;\n size?: AvatarSize;\n /** Product-composed overflow copy such as \"+3\"; the count is the product's. */\n overflow?: ReactNode;\n }>;\n\n/**\n * Overlapping avatars. The overlap comes from the recipe ratio rather than a\n * pixel value so it holds across all four sizes, and the group carries one\n * accessible name instead of letting a reader walk five unlabelled images.\n */\nexport const AvatarGroup = forwardRef<HTMLSpanElement, AvatarGroupProps>(function AvatarGroup(\n { label, children, size = avatarRecipe.defaults.size, overflow, className, ...props },\n ref,\n) {\n if (label.trim().length === 0) throw new TypeError(\"AvatarGroup label must not be empty\");\n const offset = Math.round(avatarRecipe.sizes[size] * avatarRecipe.overlapRatio);\n return (\n <span\n {...props}\n ref={ref}\n role=\"group\"\n aria-label={label}\n className={classNames(\"hjm-avatar-group\", className)}\n data-size={size}\n style={{ \"--hjm-avatar-overlap\": `${offset}px` } as CSSProperties}\n >\n {children}\n {overflow ? <span className=\"hjm-avatar-group__overflow\" aria-hidden=\"true\">{overflow}</span> : null}\n </span>\n );\n});\n\nexport type DividerOrientation = \"horizontal\" | \"vertical\";\nexport type DividerInset = keyof typeof dividerRecipe.insets;\n\nexport type DividerProps = HTMLAttributes<HTMLElement> &\n Readonly<{\n orientation?: DividerOrientation;\n inset?: DividerInset;\n decorative?: boolean;\n }>;\n\nexport const Divider = forwardRef<HTMLElement, DividerProps>(function Divider(\n {\n orientation = dividerRecipe.defaults.orientation,\n inset = dividerRecipe.defaults.inset,\n decorative = false,\n className,\n ...props\n },\n ref,\n) {\n return createElement(orientation === \"horizontal\" ? \"hr\" : \"div\", {\n ...props,\n ref,\n className: classNames(\"hjm-divider\", className),\n \"data-orientation\": orientation,\n \"data-inset\": inset,\n role: decorative ? \"presentation\" : \"separator\",\n \"aria-hidden\": decorative || undefined,\n \"aria-orientation\": decorative ? undefined : orientation,\n });\n});\n\nexport type ListAppearance = \"grouped\" | \"plain\";\n\nexport type ListProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> &\n Readonly<{\n label: string;\n children: ReactNode;\n separator?: keyof typeof listRecipe.separators;\n appearance?: ListAppearance;\n }>;\n\n/** Semantic list container that owns separators around composed rows. */\nexport const List = forwardRef<HTMLDivElement, ListProps>(function List(\n {\n label,\n children,\n separator = listRecipe.defaults.separator,\n appearance = \"plain\",\n className,\n ...props\n },\n ref,\n) {\n if (!label.trim()) throw new TypeError(\"List label must not be empty\");\n const items = Children.toArray(children);\n return (\n <div\n {...props}\n ref={ref}\n aria-label={label}\n className={classNames(\"hjm-list\", className)}\n data-appearance={appearance}\n data-separator={separator}\n role=\"list\"\n >\n {items.map((item, index) => (\n <div\n className=\"hjm-list__item\"\n key={isValidElement(item) && item.key !== null ? item.key : `hjm-list-${index}`}\n role=\"listitem\"\n >\n {item}\n </div>\n ))}\n </div>\n );\n});\n\nexport type StatisticTrendMarkRenderProps = Readonly<{\n name: \"trendUp\" | \"trendDown\" | \"trendFlat\";\n color: \"currentColor\";\n size: number;\n}>;\n\nexport type ComposeStatisticAccessibilityLabel<Id extends string = string> = (\n input: Readonly<{\n contextLabel?: string;\n descriptor: ResolvedStatisticDescriptor<Id>;\n valueText: string;\n }>,\n) => string;\n\nexport type StatisticProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLElement>,\n \"children\"\n> & Readonly<{\n descriptor: StatisticDescriptor<Id>;\n density?: StatisticDensity;\n presentation?: StatisticPresentation;\n contextLabel?: string;\n accessibilityLabel?: string;\n composeAccessibilityLabel?: ComposeStatisticAccessibilityLabel<Id>;\n renderTrendMark?: (props: StatisticTrendMarkRenderProps) => ReactNode;\n /** Optional visual adapter; the descriptor remains the accessible value source. */\n renderValue?: (value: string) => ReactNode;\n}>;\n\nexport function Statistic<Id extends string = string>({\n descriptor,\n density = \"comfortable\",\n presentation = \"plain\",\n contextLabel,\n accessibilityLabel,\n composeAccessibilityLabel,\n renderTrendMark,\n renderValue,\n className,\n ...props\n}: StatisticProps<Id>) {\n const resolved = resolveStatisticDescriptor(descriptor);\n const valueText = `${resolved.prefix ?? \"\"}${resolved.value}${resolved.suffix ?? \"\"}`;\n const announcement = accessibilityLabel ?? composeAccessibilityLabel?.({\n ...(contextLabel === undefined ? {} : { contextLabel }),\n descriptor: resolved,\n valueText,\n }) ?? [contextLabel, resolved.label, valueText, resolved.trend?.label, resolved.hint]\n .filter(Boolean)\n .join(\", \");\n if (!announcement.trim()) throw new TypeError(\"Statistic accessibility label must not be empty\");\n const trendName = resolved.trend\n ? statisticRecipe.trend.marks[resolved.trend.direction]\n : undefined;\n return (\n <article\n {...props}\n aria-label={announcement}\n className={classNames(\"hjm-statistic\", className)}\n data-density={density}\n data-presentation={presentation}\n >\n <span aria-hidden=\"true\" className=\"hjm-statistic__label\">{resolved.label}</span>\n <span aria-hidden=\"true\" className=\"hjm-statistic__value-row\">\n {resolved.prefix ? <span className=\"hjm-statistic__affix\">{resolved.prefix}</span> : null}\n <strong className=\"hjm-statistic__value\">{renderValue?.(resolved.value) ?? resolved.value}</strong>\n {resolved.suffix ? <span className=\"hjm-statistic__affix\">{resolved.suffix}</span> : null}\n </span>\n {resolved.trend ? (\n <span aria-hidden=\"true\" className=\"hjm-statistic__trend\" data-tone={resolved.trend.tone}>\n <span className=\"hjm-statistic__trend-mark\">\n {renderTrendMark?.({ name: trendName!, color: \"currentColor\", size: 16 }) ?? (\n resolved.trend.direction === \"up\" ? \"↑\" : resolved.trend.direction === \"down\" ? \"↓\" : \"—\"\n )}\n </span>\n {resolved.trend.label}\n </span>\n ) : null}\n {resolved.hint ? <span aria-hidden=\"true\" className=\"hjm-statistic__hint\">{resolved.hint}</span> : null}\n </article>\n );\n}\n\nexport type StatisticGroupProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLDivElement>,\n \"children\"\n> & Readonly<{\n label: string;\n descriptor: StatisticGroupDescriptor<Id>;\n density?: StatisticDensity;\n presentation?: StatisticPresentation;\n composeAccessibilityLabel?: ComposeStatisticAccessibilityLabel<Id>;\n renderTrendMark?: (props: StatisticTrendMarkRenderProps) => ReactNode;\n}>;\n\nexport function StatisticGroup<Id extends string = string>({\n label,\n descriptor,\n density,\n presentation,\n composeAccessibilityLabel,\n renderTrendMark,\n className,\n style,\n ...props\n}: StatisticGroupProps<Id>) {\n validateStatisticGroup(descriptor);\n if (!label.trim()) throw new TypeError(\"StatisticGroup label must not be empty\");\n return (\n <div\n {...props}\n aria-label={label}\n className={classNames(\"hjm-statistic-group\", className)}\n role=\"list\"\n style={{ ...style, \"--hjm-statistic-columns\": descriptor.columns ?? statisticRecipe.defaults.columns } as CSSProperties}\n >\n {descriptor.items.map((item) => (\n <div key={item.id} role=\"listitem\">\n <Statistic\n contextLabel={label}\n descriptor={item}\n {...(composeAccessibilityLabel === undefined ? {} : { composeAccessibilityLabel })}\n {...(density === undefined ? {} : { density })}\n {...(presentation === undefined ? {} : { presentation })}\n {...(renderTrendMark === undefined ? {} : { renderTrendMark })}\n />\n </div>\n ))}\n </div>\n );\n}\n\nexport type DescriptionListProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLDListElement>,\n \"children\"\n> &\n Readonly<{\n items: readonly DescriptionItemDescriptor<Id>[];\n columns?: DescriptionListColumns;\n /** Canonical layout-only placement. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nfunction DescriptionListInner<Id extends string>(\n { items, columns, className, layoutStyle, style, ...props }: DescriptionListProps<Id>,\n forwardedRef: ForwardedRef<HTMLDListElement>,\n) {\n const descriptor = resolveDescriptionListDescriptor({\n items,\n ...(columns === undefined ? {} : { columns }),\n });\n const [width, ref] = useElementWidth(forwardedRef);\n const theme = useOptionalHjmTheme();\n const resolvedColumns = resolveDescriptionListColumnCount(\n width ?? 0,\n descriptor.columns,\n theme?.environment.textScale ?? 1,\n );\n const responsiveStyle = {\n ...style,\n ...layoutStyle,\n \"--hjm-description-columns\": resolvedColumns,\n } as CSSProperties;\n return (\n <dl\n {...props}\n ref={ref}\n className={classNames(\"hjm-description-list\", className)}\n data-columns={resolvedColumns}\n data-state={resolvedColumns < descriptor.columns ? \"collapsed\" : \"ready\"}\n style={responsiveStyle}\n >\n {descriptor.items.map((item) => (\n <div key={item.id} className=\"hjm-description-list__item\">\n <dt className=\"hjm-description-list__label\">{item.label}</dt>\n <dd className=\"hjm-description-list__value\">{item.value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n\nexport const DescriptionList = forwardRef(DescriptionListInner) as <Id extends string = string>(\n props: DescriptionListProps<Id> & RefAttributes<HTMLDListElement>,\n) => ReactElement;\n\nexport type TableSortDirection = \"ascending\" | \"descending\";\n\nexport type TableColumn<Row> = Readonly<{\n id: string;\n header: ReactNode;\n cell: (row: Row, rowIndex: number) => ReactNode;\n align?: \"start\" | \"center\" | \"end\";\n sortable?: boolean;\n sortDirection?: TableSortDirection;\n}>;\n\nexport type TableProps<Row> = Omit<TableHTMLAttributes<HTMLTableElement>, \"children\"> &\n Readonly<{\n columns: readonly TableColumn<Row>[];\n rows: readonly Row[];\n getRowKey: (row: Row, rowIndex: number) => string;\n caption?: ReactNode;\n /** Localized content rendered when rows is empty. */\n emptyState: ReactNode;\n onSortChange?: (columnId: string, direction: TableSortDirection) => void;\n wrapperClassName?: string;\n }>;\n\nfunction TableInner<Row>(\n {\n columns,\n rows,\n getRowKey,\n caption,\n emptyState,\n onSortChange,\n wrapperClassName,\n className,\n ...props\n }: TableProps<Row>,\n ref: ForwardedRef<HTMLTableElement>,\n) {\n if (columns.length === 0) throw new TypeError(\"Table requires at least one column\");\n const ids = new Set<string>();\n for (const column of columns) {\n if (column.id.trim().length === 0) throw new TypeError(\"Table column id must not be empty\");\n if (ids.has(column.id)) throw new TypeError(`Duplicate Table column id: ${column.id}`);\n ids.add(column.id);\n if (column.sortDirection && !column.sortable) {\n throw new TypeError(`Table column ${column.id} has sortDirection but is not sortable`);\n }\n }\n const rowKeys = rows.map((row, rowIndex) => getRowKey(row, rowIndex));\n const seenRowKeys = new Set<string>();\n for (const rowKey of rowKeys) {\n if (rowKey.trim().length === 0) throw new TypeError(\"Table row key must not be empty\");\n if (seenRowKeys.has(rowKey)) throw new TypeError(`Duplicate Table row key: ${rowKey}`);\n seenRowKeys.add(rowKey);\n }\n return (\n <div className={classNames(\"hjm-table-scroll\", wrapperClassName)} tabIndex={0}>\n <table {...props} ref={ref} className={classNames(\"hjm-table\", className)}>\n {caption ? <caption className=\"hjm-table__caption\">{caption}</caption> : null}\n <thead>\n <tr>\n {columns.map((column) => (\n <th\n key={column.id}\n scope=\"col\"\n className=\"hjm-table__header\"\n data-align={column.align ?? \"start\"}\n aria-sort={column.sortDirection ?? (column.sortable ? \"none\" : undefined)}\n >\n {column.sortable ? (\n <button\n type=\"button\"\n className=\"hjm-table__sort\"\n onClick={() =>\n onSortChange?.(\n column.id,\n column.sortDirection === \"ascending\" ? \"descending\" : \"ascending\",\n )\n }\n >\n {column.header}\n <span aria-hidden=\"true\">\n {column.sortDirection === \"ascending\"\n ? \" ↑\"\n : column.sortDirection === \"descending\"\n ? \" ↓\"\n : \" ↕\"}\n </span>\n </button>\n ) : column.header}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.length === 0 ? (\n <tr>\n <td className=\"hjm-table__empty\" colSpan={columns.length}>{emptyState}</td>\n </tr>\n ) : (\n rows.map((row, rowIndex) => (\n <tr key={rowKeys[rowIndex]} className=\"hjm-table__row\">\n {columns.map((column) => (\n <td\n key={column.id}\n className=\"hjm-table__cell\"\n data-align={column.align ?? \"start\"}\n >\n {column.cell(row, rowIndex)}\n </td>\n ))}\n </tr>\n ))\n )}\n </tbody>\n </table>\n </div>\n );\n}\n\nexport const Table = forwardRef(TableInner) as <Row>(\n props: TableProps<Row> & RefAttributes<HTMLTableElement>,\n) => ReactElement;\n\nexport type TimelineProps<Id extends string = string> = Omit<\n HTMLAttributes<HTMLOListElement>,\n \"children\"\n> &\n Readonly<{\n items: readonly TimelineItemDescriptor<Id>[];\n composeAccessibleName: ComposeTimelineAccessibleName;\n }>;\n\nfunction TimelineInner<Id extends string = string>(\n {\n items,\n composeAccessibleName,\n className,\n ...props\n }: TimelineProps<Id>,\n ref: ForwardedRef<HTMLOListElement>,\n) {\n const resolved = resolveTimelineDescriptor(\n { items },\n { composeAccessibleName },\n );\n return (\n <ol\n {...props}\n ref={ref}\n className={classNames(\"hjm-timeline\", className)}\n >\n {resolved.map((item, index) => (\n <li\n aria-label={item.accessibleName}\n className=\"hjm-timeline__item\"\n data-tone={item.tone}\n key={item.id}\n >\n <span className=\"hjm-timeline__rail\" aria-hidden=\"true\">\n <span className=\"hjm-timeline__dot\" />\n {index < resolved.length - 1 ? (\n <span className=\"hjm-timeline__connector\" />\n ) : null}\n </span>\n <span className=\"hjm-timeline__content\">\n <span className=\"hjm-timeline__heading\">\n <strong className=\"hjm-timeline__label\">{item.label}</strong>\n {item.timestamp ? (\n <time className=\"hjm-timeline__timestamp\">{item.timestamp}</time>\n ) : null}\n </span>\n {item.description ? (\n <span className=\"hjm-timeline__description\">{item.description}</span>\n ) : null}\n </span>\n </li>\n ))}\n </ol>\n );\n}\n\nexport const Timeline = forwardRef(TimelineInner) as <Id extends string = string>(\n props: TimelineProps<Id> & RefAttributes<HTMLOListElement>,\n) => ReactElement;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../src/context-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,yBAAyB,EAE/B,MAAM,iDAAiD,CAAC;AAEzD,OAAO,
|
|
1
|
+
{"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../src/context-menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,yBAAyB,EAE/B,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EAQL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,gBAAgB,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAAC;IACnE,iFAAiF;IACjF,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,SAAS,yBAAyB,CAAC,GAAG,CAAC,EAAE,CAAC;IACjD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAIH,wBAAgB,WAAW,CAAC,GAAG,SAAS,MAAM,GAAG,MAAM,EAAE,EACvD,QAAQ,EACR,KAAK,EACL,kBAAkB,EAClB,QAAQ,EACR,SAAS,GACV,EAAE,gBAAgB,CAAC,GAAG,CAAC,+BAyKvB"}
|
package/dist/context-menu.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { resolveContextMenuAnchor, } from "@hjmds/design-contracts/components/context-menu";
|
|
3
3
|
import { menuRecipe } from "@hjmds/design-contracts/recipes";
|
|
4
|
-
import { useCallback, useEffect, useRef, useState, } from "react";
|
|
4
|
+
import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState, } from "react";
|
|
5
5
|
import { classNames } from "./internal.js";
|
|
6
6
|
import { HjmPortal, getModalLayer } from "./modal.js";
|
|
7
7
|
const longPressDelay = 500;
|
|
8
8
|
export function ContextMenu({ children, items, accessibilityLabel, onAction, className, }) {
|
|
9
9
|
const hostRef = useRef(null);
|
|
10
|
+
const menuRef = useRef(null);
|
|
11
|
+
const [menuMounted, setMenuMounted] = useState(false);
|
|
12
|
+
const returnFocusRef = useRef(null);
|
|
13
|
+
const menuId = useId();
|
|
10
14
|
const [anchor, setAnchor] = useState(null);
|
|
11
15
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
12
16
|
const longPress = useRef(undefined);
|
|
@@ -14,10 +18,29 @@ export function ContextMenu({ children, items, accessibilityLabel, onAction, cla
|
|
|
14
18
|
const typeaheadTimer = useRef(undefined);
|
|
15
19
|
const enabled = items.filter((item) => !item.disabled);
|
|
16
20
|
const open = useCallback((reason, pointer) => {
|
|
21
|
+
const activeElement = document.activeElement;
|
|
22
|
+
returnFocusRef.current = activeElement instanceof HTMLElement && hostRef.current?.contains(activeElement)
|
|
23
|
+
? activeElement
|
|
24
|
+
: hostRef.current;
|
|
17
25
|
const rect = hostRef.current?.getBoundingClientRect() ?? null;
|
|
18
26
|
setAnchor(resolveContextMenuAnchor(reason, pointer, rect === null ? null : { left: rect.left, bottom: rect.bottom }));
|
|
19
27
|
setActiveIndex(0);
|
|
20
28
|
}, []);
|
|
29
|
+
const setMenuRef = useCallback((node) => {
|
|
30
|
+
menuRef.current = node;
|
|
31
|
+
setMenuMounted(node !== null);
|
|
32
|
+
}, []);
|
|
33
|
+
useLayoutEffect(() => {
|
|
34
|
+
if (anchor === null || !menuMounted || menuRef.current === null)
|
|
35
|
+
return;
|
|
36
|
+
menuRef.current.focus();
|
|
37
|
+
const rect = menuRef.current.getBoundingClientRect();
|
|
38
|
+
const x = Math.min(Math.max(anchor.x, 0), Math.max(window.innerWidth - rect.width, 0));
|
|
39
|
+
const y = Math.min(Math.max(anchor.y, 0), Math.max(window.innerHeight - rect.height, 0));
|
|
40
|
+
// The contract promises viewport coordinates; post-render measurement keeps long labels onscreen, where guessed dimensions could not account for wrapping.
|
|
41
|
+
if (x !== anchor.x || y !== anchor.y)
|
|
42
|
+
setAnchor({ x, y });
|
|
43
|
+
}, [anchor, menuMounted]);
|
|
21
44
|
useEffect(() => {
|
|
22
45
|
if (anchor === null)
|
|
23
46
|
return;
|
|
@@ -26,7 +49,7 @@ export function ContextMenu({ children, items, accessibilityLabel, onAction, cla
|
|
|
26
49
|
event.preventDefault();
|
|
27
50
|
setAnchor(null);
|
|
28
51
|
// Focus goes back where the menu was opened from, not to the body.
|
|
29
|
-
|
|
52
|
+
returnFocusRef.current?.focus();
|
|
30
53
|
return;
|
|
31
54
|
}
|
|
32
55
|
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
@@ -59,12 +82,16 @@ export function ContextMenu({ children, items, accessibilityLabel, onAction, cla
|
|
|
59
82
|
if (item) {
|
|
60
83
|
onAction(item.id);
|
|
61
84
|
setAnchor(null);
|
|
62
|
-
|
|
85
|
+
returnFocusRef.current?.focus();
|
|
63
86
|
}
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (event.key === "Tab") {
|
|
90
|
+
setAnchor(null);
|
|
64
91
|
}
|
|
65
92
|
};
|
|
66
93
|
const onPointerDown = (event) => {
|
|
67
|
-
if (!(event.target instanceof Node) || !
|
|
94
|
+
if (!(event.target instanceof Node) || !menuRef.current?.contains(event.target)) {
|
|
68
95
|
setAnchor(null);
|
|
69
96
|
}
|
|
70
97
|
};
|
|
@@ -91,20 +118,20 @@ export function ContextMenu({ children, items, accessibilityLabel, onAction, cla
|
|
|
91
118
|
longPress.current = setTimeout(() => open("longPress", { x: event.clientX, y: event.clientY }), longPressDelay);
|
|
92
119
|
}, onPointerUp: () => { if (longPress.current !== undefined)
|
|
93
120
|
clearTimeout(longPress.current); }, onPointerCancel: () => { if (longPress.current !== undefined)
|
|
94
|
-
clearTimeout(longPress.current); }, children: [children, anchor !== null ? (_jsx(HjmPortal, { children: _jsx("div", { role: "menu", "aria-label": accessibilityLabel, className: "hjm-context-menu", style: {
|
|
95
|
-
|
|
96
|
-
|
|
121
|
+
clearTimeout(longPress.current); }, children: [children, anchor !== null ? (_jsx(HjmPortal, { children: _jsx("div", { role: "menu", id: menuId, ref: setMenuRef, tabIndex: -1, "aria-activedescendant": enabled[activeIndex] ? `${menuId}-item-${activeIndex}` : undefined, "aria-label": accessibilityLabel, className: "hjm-context-menu", style: {
|
|
122
|
+
top: anchor.y,
|
|
123
|
+
left: anchor.x,
|
|
97
124
|
zIndex: getModalLayer(0),
|
|
98
125
|
minInlineSize: menuRecipe.minWidth,
|
|
99
126
|
}, children: items.map((item) => {
|
|
100
127
|
const index = enabled.findIndex((candidate) => candidate.id === item.id);
|
|
101
|
-
return (_jsxs("div", { role: "menuitem", "aria-disabled": item.disabled || undefined, "data-active": index === activeIndex && !item.disabled ? "" : undefined, "data-tone": item.tone, className: "hjm-context-menu__item", onMouseEnter: () => { if (index >= 0)
|
|
128
|
+
return (_jsxs("div", { id: index >= 0 ? `${menuId}-item-${index}` : undefined, role: "menuitem", "aria-disabled": item.disabled || undefined, "data-active": index === activeIndex && !item.disabled ? "" : undefined, "data-tone": item.tone, className: "hjm-context-menu__item", onMouseEnter: () => { if (index >= 0)
|
|
102
129
|
setActiveIndex(index); }, onClick: () => {
|
|
103
130
|
if (item.disabled)
|
|
104
131
|
return;
|
|
105
132
|
onAction(item.id);
|
|
106
133
|
setAnchor(null);
|
|
107
|
-
|
|
134
|
+
returnFocusRef.current?.focus();
|
|
108
135
|
}, children: [_jsx("span", { children: item.label }), item.shortcut ? _jsx("kbd", { className: "hjm-context-menu__shortcut", children: item.shortcut }) : null] }, item.id));
|
|
109
136
|
}) }) })) : null] }));
|
|
110
137
|
}
|
package/dist/context-menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../src/context-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,wBAAwB,GAIzB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAWtD,MAAM,cAAc,GAAG,GAAG,CAA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CAAC;gCAChB,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;4BAC3B,CAAC,aAED,yBAAO,IAAI,CAAC,KAAK,GAAQ,EACxB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAK,SAAS,EAAC,4BAA4B,YAAE,IAAI,CAAC,QAAQ,GAAO,CAAC,CAAC,CAAC,IAAI,KAfpF,IAAI,CAAC,EAAE,CAgBR,CACP,CAAC;oBACJ,CAAC,CAAC,GACE,GACI,CACb,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["import {\n resolveContextMenuAnchor,\n type ContextMenuAnchor,\n type ContextMenuItemDescriptor,\n type ContextMenuOpenReason,\n} from \"@hjmds/design-contracts/components/context-menu\";\nimport { menuRecipe } from \"@hjmds/design-contracts/recipes\";\nimport {\n useCallback,\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\nimport { classNames } from \"./internal.js\";\nimport { HjmPortal, getModalLayer } from \"./modal.js\";\n\nexport type ContextMenuProps<Key extends string = string> = Readonly<{\n /** The region the menu belongs to; right-click and long-press are bound here. */\n children: ReactNode;\n items: readonly ContextMenuItemDescriptor<Key>[];\n accessibilityLabel: string;\n onAction: (id: Key) => void;\n className?: string;\n}>;\n\nconst longPressDelay = 500;\n\nexport function ContextMenu<Key extends string = string>({\n children,\n items,\n accessibilityLabel,\n onAction,\n className,\n}: ContextMenuProps<Key>) {\n const hostRef = useRef<HTMLDivElement>(null);\n const [anchor, setAnchor] = useState<ContextMenuAnchor | null>(null);\n const [activeIndex, setActiveIndex] = useState(0);\n const longPress = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const typeahead = useRef(\"\");\n const typeaheadTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const enabled = items.filter((item) => !item.disabled);\n\n const open = useCallback((reason: ContextMenuOpenReason, pointer: ContextMenuAnchor | null) => {\n const rect = hostRef.current?.getBoundingClientRect() ?? null;\n setAnchor(resolveContextMenuAnchor(\n reason,\n pointer,\n rect === null ? null : { left: rect.left, bottom: rect.bottom },\n ));\n setActiveIndex(0);\n }, []);\n\n useEffect(() => {\n if (anchor === null) return;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n setAnchor(null);\n // Focus goes back where the menu was opened from, not to the body.\n hostRef.current?.focus();\n return;\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n setActiveIndex((previous) => {\n const next = event.key === \"ArrowDown\" ? previous + 1 : previous - 1;\n return (next + enabled.length) % Math.max(enabled.length, 1);\n });\n return;\n }\n if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n setActiveIndex(event.key === \"Home\" ? 0 : Math.max(enabled.length - 1, 0));\n return;\n }\n if (event.key.length === 1 && event.key !== \" \") {\n // Typeahead matches `textValue`, not the rendered label: a label may hold\n // markup or a formatted number that nobody would type.\n const query = (typeahead.current += event.key.toLowerCase());\n clearTimeout(typeaheadTimer.current);\n typeaheadTimer.current = setTimeout(() => { typeahead.current = \"\"; }, 700);\n const match = enabled.findIndex((item) => item.textValue.toLowerCase().startsWith(query));\n if (match >= 0) setActiveIndex(match);\n return;\n }\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n const item = enabled[activeIndex];\n if (item) { onAction(item.id as Key); setAnchor(null); hostRef.current?.focus(); }\n }\n };\n const onPointerDown = (event: PointerEvent) => {\n if (!(event.target instanceof Node) || !document.querySelector(\".hjm-context-menu\")?.contains(event.target)) {\n setAnchor(null);\n }\n };\n document.addEventListener(\"keydown\", onKeyDown);\n document.addEventListener(\"pointerdown\", onPointerDown);\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown);\n document.removeEventListener(\"pointerdown\", onPointerDown);\n };\n }, [anchor, activeIndex, enabled, onAction]);\n\n return (\n <div\n ref={hostRef}\n tabIndex={0}\n className={classNames(\"hjm-context-menu-host\", className)}\n onContextMenu={(event) => {\n event.preventDefault();\n open(\"pointer\", { x: event.clientX, y: event.clientY });\n }}\n onKeyDown={(event) => {\n // Shift+F10 and the Menu key are how a keyboard opens a context menu;\n // without them the feature does not exist without a pointer.\n if ((event.shiftKey && event.key === \"F10\") || event.key === \"ContextMenu\") {\n event.preventDefault();\n open(\"keyboard\", null);\n }\n }}\n onPointerDown={(event) => {\n if (event.pointerType !== \"touch\") return;\n longPress.current = setTimeout(() => open(\"longPress\", { x: event.clientX, y: event.clientY }), longPressDelay);\n }}\n onPointerUp={() => { if (longPress.current !== undefined) clearTimeout(longPress.current); }}\n onPointerCancel={() => { if (longPress.current !== undefined) clearTimeout(longPress.current); }}\n >\n {children}\n {anchor !== null ? (\n <HjmPortal>\n <div\n role=\"menu\"\n aria-label={accessibilityLabel}\n className=\"hjm-context-menu\"\n style={{\n insetBlockStart: anchor.y,\n insetInlineStart: anchor.x,\n zIndex: getModalLayer(0),\n minInlineSize: menuRecipe.minWidth,\n } as CSSProperties}\n >\n {items.map((item) => {\n const index = enabled.findIndex((candidate) => candidate.id === item.id);\n return (\n <div\n key={item.id}\n role=\"menuitem\"\n aria-disabled={item.disabled || undefined}\n data-active={index === activeIndex && !item.disabled ? \"\" : undefined}\n data-tone={item.tone}\n className=\"hjm-context-menu__item\"\n onMouseEnter={() => { if (index >= 0) setActiveIndex(index); }}\n onClick={() => {\n if (item.disabled) return;\n onAction(item.id as Key);\n setAnchor(null);\n hostRef.current?.focus();\n }}\n >\n <span>{item.label}</span>\n {item.shortcut ? <kbd className=\"hjm-context-menu__shortcut\">{item.shortcut}</kbd> : null}\n </div>\n );\n })}\n </div>\n </HjmPortal>\n ) : null}\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../src/context-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,wBAAwB,GAIzB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;A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AAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["import {\n resolveContextMenuAnchor,\n type ContextMenuAnchor,\n type ContextMenuItemDescriptor,\n type ContextMenuOpenReason,\n} from \"@hjmds/design-contracts/components/context-menu\";\nimport { menuRecipe } from \"@hjmds/design-contracts/recipes\";\nimport {\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\nimport { classNames } from \"./internal.js\";\nimport { HjmPortal, getModalLayer } from \"./modal.js\";\n\nexport type ContextMenuProps<Key extends string = string> = Readonly<{\n /** The region the menu belongs to; right-click and long-press are bound here. */\n children: ReactNode;\n items: readonly ContextMenuItemDescriptor<Key>[];\n accessibilityLabel: string;\n onAction: (id: Key) => void;\n className?: string;\n}>;\n\nconst longPressDelay = 500;\n\nexport function ContextMenu<Key extends string = string>({\n children,\n items,\n accessibilityLabel,\n onAction,\n className,\n}: ContextMenuProps<Key>) {\n const hostRef = useRef<HTMLDivElement>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const [menuMounted, setMenuMounted] = useState(false);\n const returnFocusRef = useRef<HTMLElement | null>(null);\n const menuId = useId();\n const [anchor, setAnchor] = useState<ContextMenuAnchor | null>(null);\n const [activeIndex, setActiveIndex] = useState(0);\n const longPress = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const typeahead = useRef(\"\");\n const typeaheadTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n const enabled = items.filter((item) => !item.disabled);\n\n const open = useCallback((reason: ContextMenuOpenReason, pointer: ContextMenuAnchor | null) => {\n const activeElement = document.activeElement;\n returnFocusRef.current = activeElement instanceof HTMLElement && hostRef.current?.contains(activeElement)\n ? activeElement\n : hostRef.current;\n const rect = hostRef.current?.getBoundingClientRect() ?? null;\n setAnchor(resolveContextMenuAnchor(\n reason,\n pointer,\n rect === null ? null : { left: rect.left, bottom: rect.bottom },\n ));\n setActiveIndex(0);\n }, []);\n\n const setMenuRef = useCallback((node: HTMLDivElement | null) => {\n menuRef.current = node;\n setMenuMounted(node !== null);\n }, []);\n\n useLayoutEffect(() => {\n if (anchor === null || !menuMounted || menuRef.current === null) return;\n menuRef.current.focus();\n const rect = menuRef.current.getBoundingClientRect();\n const x = Math.min(Math.max(anchor.x, 0), Math.max(window.innerWidth - rect.width, 0));\n const y = Math.min(Math.max(anchor.y, 0), Math.max(window.innerHeight - rect.height, 0));\n // The contract promises viewport coordinates; post-render measurement keeps long labels onscreen, where guessed dimensions could not account for wrapping.\n if (x !== anchor.x || y !== anchor.y) setAnchor({ x, y });\n }, [anchor, menuMounted]);\n\n useEffect(() => {\n if (anchor === null) return;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n event.preventDefault();\n setAnchor(null);\n // Focus goes back where the menu was opened from, not to the body.\n returnFocusRef.current?.focus();\n return;\n }\n if (event.key === \"ArrowDown\" || event.key === \"ArrowUp\") {\n event.preventDefault();\n setActiveIndex((previous) => {\n const next = event.key === \"ArrowDown\" ? previous + 1 : previous - 1;\n return (next + enabled.length) % Math.max(enabled.length, 1);\n });\n return;\n }\n if (event.key === \"Home\" || event.key === \"End\") {\n event.preventDefault();\n setActiveIndex(event.key === \"Home\" ? 0 : Math.max(enabled.length - 1, 0));\n return;\n }\n if (event.key.length === 1 && event.key !== \" \") {\n // Typeahead matches `textValue`, not the rendered label: a label may hold\n // markup or a formatted number that nobody would type.\n const query = (typeahead.current += event.key.toLowerCase());\n clearTimeout(typeaheadTimer.current);\n typeaheadTimer.current = setTimeout(() => { typeahead.current = \"\"; }, 700);\n const match = enabled.findIndex((item) => item.textValue.toLowerCase().startsWith(query));\n if (match >= 0) setActiveIndex(match);\n return;\n }\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n const item = enabled[activeIndex];\n if (item) { onAction(item.id as Key); setAnchor(null); returnFocusRef.current?.focus(); }\n return;\n }\n if (event.key === \"Tab\") {\n setAnchor(null);\n }\n };\n const onPointerDown = (event: PointerEvent) => {\n if (!(event.target instanceof Node) || !menuRef.current?.contains(event.target)) {\n setAnchor(null);\n }\n };\n document.addEventListener(\"keydown\", onKeyDown);\n document.addEventListener(\"pointerdown\", onPointerDown);\n return () => {\n document.removeEventListener(\"keydown\", onKeyDown);\n document.removeEventListener(\"pointerdown\", onPointerDown);\n };\n }, [anchor, activeIndex, enabled, onAction]);\n\n return (\n <div\n ref={hostRef}\n tabIndex={0}\n className={classNames(\"hjm-context-menu-host\", className)}\n onContextMenu={(event) => {\n event.preventDefault();\n open(\"pointer\", { x: event.clientX, y: event.clientY });\n }}\n onKeyDown={(event) => {\n // Shift+F10 and the Menu key are how a keyboard opens a context menu;\n // without them the feature does not exist without a pointer.\n if ((event.shiftKey && event.key === \"F10\") || event.key === \"ContextMenu\") {\n event.preventDefault();\n open(\"keyboard\", null);\n }\n }}\n onPointerDown={(event) => {\n if (event.pointerType !== \"touch\") return;\n longPress.current = setTimeout(() => open(\"longPress\", { x: event.clientX, y: event.clientY }), longPressDelay);\n }}\n onPointerUp={() => { if (longPress.current !== undefined) clearTimeout(longPress.current); }}\n onPointerCancel={() => { if (longPress.current !== undefined) clearTimeout(longPress.current); }}\n >\n {children}\n {anchor !== null ? (\n <HjmPortal>\n <div\n role=\"menu\"\n id={menuId}\n ref={setMenuRef}\n tabIndex={-1}\n aria-activedescendant={enabled[activeIndex] ? `${menuId}-item-${activeIndex}` : undefined}\n aria-label={accessibilityLabel}\n className=\"hjm-context-menu\"\n style={{\n top: anchor.y,\n left: anchor.x,\n zIndex: getModalLayer(0),\n minInlineSize: menuRecipe.minWidth,\n } as CSSProperties}\n >\n {items.map((item) => {\n const index = enabled.findIndex((candidate) => candidate.id === item.id);\n return (\n <div\n key={item.id}\n id={index >= 0 ? `${menuId}-item-${index}` : undefined}\n role=\"menuitem\"\n aria-disabled={item.disabled || undefined}\n data-active={index === activeIndex && !item.disabled ? \"\" : undefined}\n data-tone={item.tone}\n className=\"hjm-context-menu__item\"\n onMouseEnter={() => { if (index >= 0) setActiveIndex(index); }}\n onClick={() => {\n if (item.disabled) return;\n onAction(item.id as Key);\n setAnchor(null);\n returnFocusRef.current?.focus();\n }}\n >\n <span>{item.label}</span>\n {item.shortcut ? <kbd className=\"hjm-context-menu__shortcut\">{item.shortcut}</kbd> : null}\n </div>\n );\n })}\n </div>\n </HjmPortal>\n ) : null}\n </div>\n );\n}\n"]}
|
package/dist/evidence.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ShowcaseScenarioId } from "@hjmds/design-contracts/showcase";
|
|
2
2
|
export declare const reactRendererEvidenceSchemaVersion: 2;
|
|
3
|
-
export type ReactRendererEvidenceScenario = Exclude<ShowcaseScenarioId, "contract">;
|
|
3
|
+
export type ReactRendererEvidenceScenario = Exclude<ShowcaseScenarioId, "contract" | "native-actions">;
|
|
4
4
|
export type ReactRendererEvidenceComponent = Readonly<{
|
|
5
5
|
/** Canonical component id from the design-contracts catalog. */
|
|
6
6
|
componentId: string;
|
|
@@ -34,7 +34,7 @@ export type ReactRendererEvidenceManifest = Readonly<{
|
|
|
34
34
|
export declare const reactRendererEvidence: {
|
|
35
35
|
readonly schemaVersion: 2;
|
|
36
36
|
readonly packageName: "@hjmds/react";
|
|
37
|
-
readonly packageVersion: "1.
|
|
37
|
+
readonly packageVersion: "1.8.0";
|
|
38
38
|
readonly surface: "web";
|
|
39
39
|
readonly components: readonly [Readonly<{
|
|
40
40
|
/** Canonical component id from the design-contracts catalog. */
|
|
@@ -1296,6 +1296,65 @@ export declare const reactRendererEvidence: {
|
|
|
1296
1296
|
file: `test/${string}.test.tsx`;
|
|
1297
1297
|
caseId: string;
|
|
1298
1298
|
}>[];
|
|
1299
|
+
}>, {
|
|
1300
|
+
readonly componentId: "thinking-orb";
|
|
1301
|
+
readonly exportNames: readonly ["ThinkingOrb"];
|
|
1302
|
+
readonly subpath: "./thinking-orb";
|
|
1303
|
+
readonly scenarios: readonly ["default", "dark", "large-text", "rtl", "reduced-motion", "accessibility"];
|
|
1304
|
+
readonly proofs: readonly [{
|
|
1305
|
+
readonly scenarios: readonly ["default"];
|
|
1306
|
+
readonly file: "test/default-render.ssr.test.tsx";
|
|
1307
|
+
readonly caseId: "thinking-orb";
|
|
1308
|
+
}, {
|
|
1309
|
+
readonly scenarios: readonly ["dark", "large-text", "rtl", "reduced-motion", "accessibility"];
|
|
1310
|
+
readonly file: "test/thinking-orb.browser.test.tsx";
|
|
1311
|
+
readonly caseId: "thinking-orb";
|
|
1312
|
+
}];
|
|
1313
|
+
}, Readonly<{
|
|
1314
|
+
/** Canonical component id from the design-contracts catalog. */
|
|
1315
|
+
componentId: string;
|
|
1316
|
+
/** Public symbols that implement this contract on the declared subpath. */
|
|
1317
|
+
exportNames: readonly string[];
|
|
1318
|
+
/** Granular @hjmds/react export used by consumers. */
|
|
1319
|
+
subpath: `./${string}`;
|
|
1320
|
+
/** Scenarios supported by automated first-party renderer evidence. */
|
|
1321
|
+
scenarios: readonly ReactRendererEvidenceScenario[];
|
|
1322
|
+
/** Repository-local executable proof for every claimed scenario. */
|
|
1323
|
+
proofs: readonly Readonly<{
|
|
1324
|
+
scenarios: readonly ReactRendererEvidenceScenario[];
|
|
1325
|
+
file: `test/${string}.test.tsx`;
|
|
1326
|
+
caseId: string;
|
|
1327
|
+
}>[];
|
|
1328
|
+
}>, Readonly<{
|
|
1329
|
+
/** Canonical component id from the design-contracts catalog. */
|
|
1330
|
+
componentId: string;
|
|
1331
|
+
/** Public symbols that implement this contract on the declared subpath. */
|
|
1332
|
+
exportNames: readonly string[];
|
|
1333
|
+
/** Granular @hjmds/react export used by consumers. */
|
|
1334
|
+
subpath: `./${string}`;
|
|
1335
|
+
/** Scenarios supported by automated first-party renderer evidence. */
|
|
1336
|
+
scenarios: readonly ReactRendererEvidenceScenario[];
|
|
1337
|
+
/** Repository-local executable proof for every claimed scenario. */
|
|
1338
|
+
proofs: readonly Readonly<{
|
|
1339
|
+
scenarios: readonly ReactRendererEvidenceScenario[];
|
|
1340
|
+
file: `test/${string}.test.tsx`;
|
|
1341
|
+
caseId: string;
|
|
1342
|
+
}>[];
|
|
1343
|
+
}>, Readonly<{
|
|
1344
|
+
/** Canonical component id from the design-contracts catalog. */
|
|
1345
|
+
componentId: string;
|
|
1346
|
+
/** Public symbols that implement this contract on the declared subpath. */
|
|
1347
|
+
exportNames: readonly string[];
|
|
1348
|
+
/** Granular @hjmds/react export used by consumers. */
|
|
1349
|
+
subpath: `./${string}`;
|
|
1350
|
+
/** Scenarios supported by automated first-party renderer evidence. */
|
|
1351
|
+
scenarios: readonly ReactRendererEvidenceScenario[];
|
|
1352
|
+
/** Repository-local executable proof for every claimed scenario. */
|
|
1353
|
+
proofs: readonly Readonly<{
|
|
1354
|
+
scenarios: readonly ReactRendererEvidenceScenario[];
|
|
1355
|
+
file: `test/${string}.test.tsx`;
|
|
1356
|
+
caseId: string;
|
|
1357
|
+
}>[];
|
|
1299
1358
|
}>, Readonly<{
|
|
1300
1359
|
/** Canonical component id from the design-contracts catalog. */
|
|
1301
1360
|
componentId: string;
|