@hjmds/react 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asset.d.ts.map +1 -1
- package/dist/asset.js +4 -1
- package/dist/asset.js.map +1 -1
- package/dist/clipboard.d.ts.map +1 -1
- package/dist/clipboard.js +39 -5
- package/dist/clipboard.js.map +1 -1
- package/dist/code-block.d.ts.map +1 -1
- package/dist/code-block.js +3 -1
- package/dist/code-block.js.map +1 -1
- package/dist/collapsible.d.ts +4 -0
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +4 -4
- package/dist/collapsible.js.map +1 -1
- package/dist/command-palette.d.ts.map +1 -1
- package/dist/command-palette.js +3 -1
- package/dist/command-palette.js.map +1 -1
- package/dist/content-transition.d.ts +1 -1
- package/dist/content-transition.d.ts.map +1 -1
- package/dist/content-transition.js +3 -2
- package/dist/content-transition.js.map +1 -1
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +3 -1
- package/dist/context-menu.js.map +1 -1
- package/dist/design-profile.d.ts +18 -0
- package/dist/design-profile.d.ts.map +1 -0
- package/dist/design-profile.js +27 -0
- package/dist/design-profile.js.map +1 -0
- package/dist/evidence.d.ts +1 -1
- package/dist/evidence.js +1 -1
- package/dist/evidence.js.map +1 -1
- package/dist/floating-action-button.d.ts +1 -1
- package/dist/heading.d.ts.map +1 -1
- package/dist/heading.js +3 -1
- package/dist/heading.js.map +1 -1
- package/dist/internal.d.ts +54 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +7 -1
- package/dist/internal.js.map +1 -1
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js +6 -3
- package/dist/layout.js.map +1 -1
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +3 -1
- package/dist/menubar.js.map +1 -1
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +30 -9
- package/dist/navigation.js.map +1 -1
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +3 -1
- package/dist/popover.js.map +1 -1
- package/dist/provider.d.ts +4 -0
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +5 -2
- package/dist/provider.js.map +1 -1
- package/dist/screens.d.ts +7 -2
- package/dist/screens.d.ts.map +1 -1
- package/dist/screens.js +20 -7
- package/dist/screens.js.map +1 -1
- package/dist/selection.d.ts.map +1 -1
- package/dist/selection.js +4 -1
- package/dist/selection.js.map +1 -1
- package/dist/styles.css +28 -5
- package/dist/styles.layered.css +28 -5
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +28 -7
- package/dist/theme.js.map +1 -1
- package/package.json +8 -3
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,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,wBAAwB,GAIzB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,EACL,eAAe,EACf,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;AActD,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,MAAM,UAAU,WAAW,CAA8B,EACvD,QAAQ,EACR,KAAK,EACL,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,WAAW,GACW;IACtB,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC7C,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK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AC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,eAC1D,IAAI,CAAC,IAAI,EACpB,SAAS,EAAC,wBAAwB,EAClC,YAAY,EAAE,GAAG,EAAE,GAAG,IAAI,KAAK,IAAI,CAAC;gCAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC9D,OAAO,EAAE,GAAG,EAAE;gCACZ,IAAI,IAAI,CAAC,QAAQ;oCAAE,OAAO;gCAC1B,QAAQ,CAAC,IAAI,CAAC,EAAS,CAAC,CAAC;gCACzB,SAAS,CAAC,IAAI,CAAC,CAAC;gCAChB,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC;4BAClC,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,KAhBpF,IAAI,CAAC,EAAE,CAiBR,CACP,CAAC;oBACJ,CAAC,CAAC,GACE,GACI,CACb,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { resolveMenuTypeahead } from \"./menu-typeahead.js\";\nimport {\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\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.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 /** Canonical layout-only placement on the in-flow host; the menu popup itself is anchored, not placed. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nconst longPressDelay = 500;\n\nexport function ContextMenu<Key extends string = string>({\n children,\n items,\n accessibilityLabel,\n onAction,\n className,\n layoutStyle,\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({ value: \"\", time: 0 });\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 typeahead.current = { value: \"\", time: 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 !== \" \" && !event.ctrlKey && !event.metaKey && !event.altKey) {\n const result = resolveMenuTypeahead(enabled, activeIndex, event.key, typeahead.current, Date.now());\n typeahead.current = result.state;\n if (result.index !== undefined) {\n event.preventDefault();\n setActiveIndex(result.index);\n }\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 style={layoutStyle}\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"]}
|
|
1
|
+
{"version":3,"file":"context-menu.js","sourceRoot":"","sources":["../src/context-menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,wBAAwB,GAIzB,MAAM,iDAA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C,CAAC,CAAC,IAAI,KAhBpF,IAAI,CAAC,EAAE,CAiBR,CACP,CAAC;oBACJ,CAAC,CAAC,GACE,GACI,CACb,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { resolveMenuTypeahead } from \"./menu-typeahead.js\";\nimport {\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\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.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 /** Canonical layout-only placement on the in-flow host; the menu popup itself is anchored, not placed. */\n layoutStyle?: HjmCompositionStyleProp;\n}>;\n\nconst longPressDelay = 500;\n\nexport function ContextMenu<Key extends string = string>({\n children,\n items,\n accessibilityLabel,\n onAction,\n className,\n layoutStyle,\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({ value: \"\", time: 0 });\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 typeahead.current = { value: \"\", time: 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 !== \" \" && !event.ctrlKey && !event.metaKey && !event.altKey) {\n const result = resolveMenuTypeahead(enabled, activeIndex, event.key, typeahead.current, Date.now());\n typeahead.current = result.state;\n if (result.index !== undefined) {\n event.preventDefault();\n setActiveIndex(result.index);\n }\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 style={layoutStyle}\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 // A newly positioned menu can enter a stationary cursor; that\n // boundary event must not undo the user's keyboard selection.\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 onMouseMove={() => { 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"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type ScreenLayoutProps } from "./screens.js";
|
|
3
|
+
import type { HjmDesignProfile } from "@hjmds/design-contracts/design-profile";
|
|
4
|
+
export type OverviewScreenProps = Omit<ScreenLayoutProps, "children"> & Readonly<{
|
|
5
|
+
items: readonly Readonly<{
|
|
6
|
+
id: string;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}>[];
|
|
9
|
+
toolbar?: ReactNode;
|
|
10
|
+
toolbarLabel: string;
|
|
11
|
+
collection?: HjmDesignProfile["compositions"]["collection"];
|
|
12
|
+
toolbarPresentation?: HjmDesignProfile["compositions"]["toolbar"];
|
|
13
|
+
}>;
|
|
14
|
+
/** Optional collection screen; ScreenLayout still owns loading/error/scrolling.
|
|
15
|
+
* Unlike settings/inbox it owns a profile-selected collection and persistent tools.
|
|
16
|
+
* It never owns product mutations or chooses a different component for each theme. */
|
|
17
|
+
export declare function OverviewScreen({ items, toolbar, toolbarLabel, collection: suppliedCollection, toolbarPresentation: suppliedToolbarPresentation, ...screen }: OverviewScreenProps): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=design-profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-profile.d.ts","sourceRoot":"","sources":["../src/design-profile.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAMpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAE/E,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC;IAC/E,KAAK,EAAE,SAAS,QAAQ,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC,EAAE,CAAC;IAChE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC,YAAY,CAAC,CAAC;IAC5D,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC;CACnE,CAAC,CAAC;AAEH;;sFAEsF;AACtF,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,GAAG,MAAM,EAAE,EAAE,mBAAmB,+BAqBhL"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { ScreenLayout } from "./screens.js";
|
|
4
|
+
import { Collapsible } from "./collapsible.js";
|
|
5
|
+
import { EffectSurface } from "./effect-surface.js";
|
|
6
|
+
import { Grid, Stack, Surface } from "./layout.js";
|
|
7
|
+
import { useHjmTheme } from "./provider.js";
|
|
8
|
+
import { resolveDesignProfileCollection } from "@hjmds/design-contracts/design-profile-layout";
|
|
9
|
+
/** Optional collection screen; ScreenLayout still owns loading/error/scrolling.
|
|
10
|
+
* Unlike settings/inbox it owns a profile-selected collection and persistent tools.
|
|
11
|
+
* It never owns product mutations or chooses a different component for each theme. */
|
|
12
|
+
export function OverviewScreen({ items, toolbar, toolbarLabel, collection: suppliedCollection, toolbarPresentation: suppliedToolbarPresentation, ...screen }) {
|
|
13
|
+
const { designProfile } = useHjmTheme();
|
|
14
|
+
const collection = suppliedCollection ?? designProfile?.compositions.collection ?? "rows";
|
|
15
|
+
const toolbarPresentation = suppliedToolbarPresentation ?? designProfile?.compositions.toolbar ?? "inline";
|
|
16
|
+
const [toolsOpen, setToolsOpen] = useState(true);
|
|
17
|
+
if (!toolbarLabel.trim())
|
|
18
|
+
throw new TypeError("Overview tools need a localized label");
|
|
19
|
+
const ids = new Set(items.map(item => item.id));
|
|
20
|
+
if (ids.size !== items.length || items.some(item => !item.id.trim()))
|
|
21
|
+
throw new TypeError("Overview items need unique stable ids");
|
|
22
|
+
// Retain the same effect/grid/surface subtree when the profile changes: optional
|
|
23
|
+
// decoration can disappear without remounting fields, focus or local state.
|
|
24
|
+
const canvas = designProfile?.material.canvas ?? { layers: ["mesh"], intensity: 0, active: false };
|
|
25
|
+
return _jsx(EffectSurface, { descriptor: canvas, layoutStyle: { width: "100%" }, children: _jsx(ScreenLayout, { ...screen, children: _jsxs(Stack, { gap: "xl", children: [toolbar ? _jsx(Collapsible, { trigger: toolbarLabel, open: toolsOpen, onOpenChange: setToolsOpen, presentation: toolbarPresentation === "inline" ? "inline" : "disclosure", keepMounted: true, children: toolbar }) : null, _jsx(Grid, { ...resolveDesignProfileCollection(collection), children: items.map(item => _jsx(Surface, { padding: collection === "rows" ? "md" : "xl", tone: collection === "rows" ? "default" : "raised", bordered: true, radius: "lg", children: _jsx(EffectSurface, { descriptor: designProfile?.material.card ?? { layers: ["mesh"], intensity: 0, active: false }, className: "hjm-profile-card-effect", children: item.children }) }, item.id)) })] }) }) });
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=design-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"design-profile.js","sourceRoot":"","sources":["../src/design-profile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,YAAY,EAA0B,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,8BAA8B,EAAE,MAAM,+CAA+C,CAAC;AAW/F;;sFAEsF;AACtF,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,2BAA2B,EAAE,GAAG,MAAM,EAAuB;IAC/K,MAAM,EAAE,aAAa,EAAE,GAAG,WAAW,EAAE,CAAC;IACxC,MAAM,UAAU,GAAG,kBAAkB,IAAI,aAAa,EAAE,YAAY,CAAC,UAAU,IAAI,MAAM,CAAC;IAC1F,MAAM,mBAAmB,GAAG,2BAA2B,IAAI,aAAa,EAAE,YAAY,CAAC,OAAO,IAAI,QAAQ,CAAC;IAC3G,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjD,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;QAAE,MAAM,IAAI,SAAS,CAAC,uCAAuC,CAAC,CAAC;IACvF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI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,CAAC,IAAI,IAAI,EAAE,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,SAAS,EAAC,yBAAyB,YAAE,IAAI,CAAC,QAAQ,GAAiB,IAAjT,IAAI,CAAC,EAAE,CAAoT,CAAC,GACxV,IACD,GACK,GACD,CAAC;AACnB,CAAC","sourcesContent":["import { useState, type ReactNode } from \"react\";\nimport { ScreenLayout, type ScreenLayoutProps } from \"./screens.js\";\nimport { Collapsible } from \"./collapsible.js\";\nimport { EffectSurface } from \"./effect-surface.js\";\nimport { Grid, Stack, Surface } from \"./layout.js\";\nimport { useHjmTheme } from \"./provider.js\";\nimport { resolveDesignProfileCollection } from \"@hjmds/design-contracts/design-profile-layout\";\nimport type { HjmDesignProfile } from \"@hjmds/design-contracts/design-profile\";\n\nexport type OverviewScreenProps = Omit<ScreenLayoutProps, \"children\"> & Readonly<{\n items: readonly Readonly<{ id: string; children: ReactNode }>[];\n toolbar?: ReactNode;\n toolbarLabel: string;\n collection?: HjmDesignProfile[\"compositions\"][\"collection\"];\n toolbarPresentation?: HjmDesignProfile[\"compositions\"][\"toolbar\"];\n}>;\n\n/** Optional collection screen; ScreenLayout still owns loading/error/scrolling.\n * Unlike settings/inbox it owns a profile-selected collection and persistent tools.\n * It never owns product mutations or chooses a different component for each theme. */\nexport function OverviewScreen({ items, toolbar, toolbarLabel, collection: suppliedCollection, toolbarPresentation: suppliedToolbarPresentation, ...screen }: OverviewScreenProps) {\n const { designProfile } = useHjmTheme();\n const collection = suppliedCollection ?? designProfile?.compositions.collection ?? \"rows\";\n const toolbarPresentation = suppliedToolbarPresentation ?? designProfile?.compositions.toolbar ?? \"inline\";\n const [toolsOpen, setToolsOpen] = useState(true);\n if (!toolbarLabel.trim()) throw new TypeError(\"Overview tools need a localized label\");\n const ids = new Set(items.map(item => item.id));\n if (ids.size !== items.length || items.some(item => !item.id.trim())) throw new TypeError(\"Overview items need unique stable ids\");\n // Retain the same effect/grid/surface subtree when the profile changes: optional\n // decoration can disappear without remounting fields, focus or local state.\n const canvas = designProfile?.material.canvas ?? { layers: [\"mesh\"] as const, intensity: 0, active: false };\n return <EffectSurface descriptor={canvas} layoutStyle={{ width: \"100%\" }}>\n <ScreenLayout {...screen}>\n <Stack gap=\"xl\">\n {toolbar ? <Collapsible trigger={toolbarLabel} open={toolsOpen} onOpenChange={setToolsOpen} presentation={toolbarPresentation === \"inline\" ? \"inline\" : \"disclosure\"} keepMounted>{toolbar}</Collapsible> : null}\n <Grid {...resolveDesignProfileCollection(collection)}>\n {items.map(item => <Surface key={item.id} padding={collection === \"rows\" ? \"md\" : \"xl\"} tone={collection === \"rows\" ? \"default\" : \"raised\"} bordered radius=\"lg\"><EffectSurface descriptor={designProfile?.material.card ?? { layers: [\"mesh\"], intensity: 0, active: false }} className=\"hjm-profile-card-effect\">{item.children}</EffectSurface></Surface>)}\n </Grid>\n </Stack>\n </ScreenLayout>\n </EffectSurface>;\n}\n"]}
|
package/dist/evidence.d.ts
CHANGED
|
@@ -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.15.0";
|
|
38
38
|
readonly surface: "web";
|
|
39
39
|
readonly components: readonly [Readonly<{
|
|
40
40
|
/** Canonical component id from the design-contracts catalog. */
|
package/dist/evidence.js
CHANGED
|
@@ -155,7 +155,7 @@ function toastClaim() {
|
|
|
155
155
|
export const reactRendererEvidence = {
|
|
156
156
|
schemaVersion: reactRendererEvidenceSchemaVersion,
|
|
157
157
|
packageName: "@hjmds/react",
|
|
158
|
-
packageVersion: "1.
|
|
158
|
+
packageVersion: "1.15.0",
|
|
159
159
|
surface: "web",
|
|
160
160
|
components: [
|
|
161
161
|
defaultClaim("top-bar", ["TopBar"], "./top-bar"),
|
package/dist/evidence.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evidence.js","sourceRoot":"","sources":["../src/evidence.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAU,CAAC;AA6B7D,MAAM,gBAAgB,GAAG,kCAA2C,CAAC;AACrE,MAAM,eAAe,GAAG,uCAAgD,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,eAAe,GAAG,CAAC,eAAe,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,CAAU,CAAC;AAElG;;;;GAIG;AACH,MAAM,eAAe,GAAuE,EAAE,CAAC;AAE/F,4EAA4E;AAC5E,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAS;IAC/D,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO;IAC1E,wBAAwB;IACxB,aAAa;IACb,cAAc;IACd,MAAM;IACN,UAAU;IACV,QAAQ;IACR,OAAO;IACP,YAAY;IACZ,aAAa;IACb,OAAO;IACP,MAAM;IACN,UAAU;IACV,aAAa;IACb,OAAO;IACP,WAAW;IACX,MAAM;IACN,SAAS;IACT,QAAQ;IACR,OAAO;IACP,WAAW;IACX,MAAM;IACN,QAAQ;IACR,UAAU;IACV,KAAK;IACL,WAAW;IACX,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,WAAW;IACX,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,QAAQ;IACR,UAAU;IACV,SAAS;IACT,aAAa;IACb,KAAK;IACL,SAAS;IACT,mBAAmB;IACnB,SAAS;IACT,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,UAAU;IACV,kBAAkB;IAClB,OAAO;IACP,WAAW;IACX,aAAa;IACb,gBAAgB;IAChB,sBAAsB;IACtB,gBAAgB;IAChB,cAAc;IACd,cAAc;IACd,wBAAwB;IACxB,UAAU;IACV,QAAQ;IACR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AC,EAAE,YAAY,CAAC;QACpD,YAAY,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;QAChD,UAAU,EAAE;QACZ,aAAa,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;QAC9C,aAAa,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC;QAClD,aAAa,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,gCAAgC,CAAC;QACnF,wBAAwB,CAAC,cAAc,EAAE,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,6CAA6C,CAAC;QACtH,wBAAwB,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,oCAAoC,CAAC;QAChG,aAAa,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,YAAY,EAAE,+BAA+B,CAAC;QACpF,YAAY,CAAC,iBAAiB,EAAE,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC;QAC/D,wBAAwB,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,qCAAqC,CAAC;KAChG;CAC+C,CAAC","sourcesContent":["import type { ShowcaseScenarioId } from \"@hjmds/design-contracts/showcase\";\n\nexport const reactRendererEvidenceSchemaVersion = 2 as const;\n\nexport type ReactRendererEvidenceScenario = Exclude<ShowcaseScenarioId, \"contract\" | \"native-actions\">;\n\nexport type ReactRendererEvidenceComponent = Readonly<{\n /** Canonical component id from the design-contracts catalog. */\n componentId: string;\n /** Public symbols that implement this contract on the declared subpath. */\n exportNames: readonly string[];\n /** Granular @hjmds/react export used by consumers. */\n subpath: `./${string}`;\n /** Scenarios supported by automated first-party renderer evidence. */\n scenarios: readonly ReactRendererEvidenceScenario[];\n /** Repository-local executable proof for every claimed scenario. */\n proofs: readonly Readonly<{\n scenarios: readonly ReactRendererEvidenceScenario[];\n file: `test/${string}.test.tsx`;\n caseId: string;\n }>[];\n}>;\n\nexport type ReactRendererEvidenceManifest = Readonly<{\n schemaVersion: typeof reactRendererEvidenceSchemaVersion;\n packageName: \"@hjmds/react\";\n packageVersion: string;\n surface: \"web\";\n components: readonly ReactRendererEvidenceComponent[];\n}>;\n\nconst defaultProofFile = \"test/default-render.ssr.test.tsx\" as const;\nconst matrixProofFile = \"test/scenario-matrix.browser.test.tsx\" as const;\n\n/**\n * Environment scenarios proven in a real browser by scenario-matrix.browser.\n * Until 1.5.0 every component claimed all seven scenarios from one SSR test\n * that only checked the provider wrapper's attributes. A component now claims\n * a matrix scenario only if the matrix assertion for it passes.\n */\nconst matrixScenarios = [\"accessibility\", \"dark\", \"large-text\", \"rtl\", \"reduced-motion\"] as const;\n\n/**\n * Scenarios a component does not pass yet. Each entry is promotion debt that\n * the generated evidence projection reports; remove it when the component is\n * fixed and the matrix case passes.\n */\nconst webScenarioGaps: Readonly<Record<string, readonly ReactRendererEvidenceScenario[]>> = {};\n\n/** Fixtures that render long copy inside the component (renderLongCopy). */\nconst webLongCopyFixtures: ReadonlySet<string> = new Set<string>([\n \"masonry\", \"virtual-list\", \"qr-code\", \"color-picker\", \"watermark\", \"affix\",\n \"design-system-provider\",\n \"text-format\",\n \"aspect-ratio\",\n \"grid\",\n \"splitter\",\n \"layout\",\n \"steps\",\n \"breadcrumb\",\n \"auth-screen\",\n \"radio\",\n \"list\",\n \"timeline\",\n \"bottom-info\",\n \"stack\",\n \"container\",\n \"text\",\n \"surface\",\n \"button\",\n \"field\",\n \"text-area\",\n \"card\",\n \"notice\",\n \"list-row\",\n \"tag\",\n \"accordion\",\n \"file-picker\",\n \"agreement\",\n \"bottom-navigation\",\n \"load-more\",\n \"tabs\",\n \"badge\",\n \"chip\",\n \"link\",\n \"select\",\n \"combobox\",\n \"heading\",\n \"empty-state\",\n \"top\",\n \"section\",\n \"segmented-control\",\n \"top-bar\",\n \"mentions\",\n \"bottom-cta\",\n \"result\",\n \"progress\",\n \"description-list\",\n \"toast\",\n \"statistic\",\n \"radio-group\",\n \"checkbox-group\",\n \"auth-provider-button\",\n \"password-field\",\n \"search-field\",\n \"number-field\",\n \"floating-action-button\",\n \"checkbox\",\n \"switch\",\n \"toggle-group\",\n \"slider\",\n \"otp-field\",\n \"date-picker\",\n \"menubar\",\n \"sidebar\",\n \"transfer-list\",\n \"upload-item\",\n \"tags-input\",\n \"data-table\",\n \"collapsible\",\n \"anchor\",\n \"tree\",\n \"carousel\",\n \"calendar\",\n \"dialog\",\n \"tooltip\",\n]);\n\nfunction defaultClaim(\n componentId: string,\n exportNames: readonly string[],\n subpath: `./${string}`,\n): ReactRendererEvidenceComponent {\n const gaps = webScenarioGaps[componentId] ?? [];\n const matrix: ReactRendererEvidenceScenario[] = [\n ...matrixScenarios.filter((scenario) => !gaps.includes(scenario)),\n ...(webLongCopyFixtures.has(componentId) && !gaps.includes(\"long-copy\") ? [\"long-copy\" as const] : []),\n ];\n return {\n componentId,\n exportNames,\n subpath,\n scenarios: [\"default\", ...matrix],\n proofs: [\n { scenarios: [\"default\"], file: defaultProofFile, caseId: componentId },\n ...(matrix.length === 0 ? [] : [{ scenarios: matrix, file: matrixProofFile, caseId: componentId }]),\n ],\n };\n}\n\nfunction keyboardClaim(\n componentId: string,\n exportNames: readonly string[],\n subpath: `./${string}`,\n proofFile: `test/${string}.test.tsx` = \"test/stable-core.browser.test.tsx\",\n): ReactRendererEvidenceComponent {\n const base = defaultClaim(componentId, exportNames, subpath);\n return {\n ...base,\n scenarios: [...base.scenarios, \"keyboard\"],\n proofs: [\n ...base.proofs,\n {\n scenarios: [\"keyboard\"],\n file: proofFile,\n caseId: componentId,\n },\n ],\n };\n}\n\nfunction keyboardAndLongCopyClaim(\n componentId: string,\n exportNames: readonly string[],\n subpath: `./${string}`,\n proofFile: `test/${string}.test.tsx`,\n): ReactRendererEvidenceComponent {\n const base = defaultClaim(componentId, exportNames, subpath);\n return {\n ...base,\n scenarios: [...base.scenarios, \"keyboard\", \"long-copy\"],\n proofs: [...base.proofs, { scenarios: [\"keyboard\", \"long-copy\"], file: proofFile, caseId: componentId }],\n };\n}\n\nfunction toastClaim(): ReactRendererEvidenceComponent {\n const base = defaultClaim(\"toast\", [\"Toast\", \"ToastProvider\", \"useToast\"], \"./toast\");\n return {\n ...base,\n scenarios: [...base.scenarios, \"keyboard\"],\n // SSR proves semantics but cannot catch the close-only row seen in BurnTok.\n // Keep real geometry evidence attached without promoting catalog maturity.\n proofs: [...base.proofs,\n { scenarios: [\"keyboard\"], file: \"test/stable-core.browser.test.tsx\", caseId: \"toast\" },\n { scenarios: [\"dark\", \"long-copy\", \"large-text\", \"rtl\"], file: \"test/toast-layout.browser.test.tsx\", caseId: \"toast\" },\n ],\n };\n}\n\n/**\n * First-party Web renderer claims. Scenario axes remain fail-closed: the\n * default scenario is an SSR render, the environment and accessibility\n * scenarios are computed-style assertions in scenario-matrix.browser.\n * Keyboard and cross-platform parity remain fail-closed until dedicated\n * interaction or paired-renderer proofs are mapped one-to-one.\n */\nexport const reactRendererEvidence = {\n schemaVersion: reactRendererEvidenceSchemaVersion,\n packageName: \"@hjmds/react\",\n packageVersion: \"1.14.0\",\n surface: \"web\",\n components: [\n defaultClaim(\"top-bar\", [\"TopBar\"], \"./top-bar\"),\n defaultClaim(\"bottom-cta\", [\"BottomCTA\"], \"./bottom-cta\"),\n defaultClaim(\"design-system-provider\", [\"HjmProvider\", \"useHjmTheme\"], \"./provider\"),\n defaultClaim(\"text\", [\"Text\"], \"./layout\"),\n defaultClaim(\"surface\", [\"Surface\"], \"./layout\"),\n defaultClaim(\"icon\", [\"Icon\"], \"./display\"),\n defaultClaim(\"stack\", [\"Stack\"], \"./layout\"),\n defaultClaim(\"container\", [\"Container\"], \"./layout\"),\n defaultClaim(\"aspect-ratio\", [\"AspectRatio\"], \"./layout\"),\n defaultClaim(\"grid\", [\"Grid\"], \"./layout\"),\n keyboardClaim(\"layout\", [\"Layout\"], \"./layout\"),\n defaultClaim(\"button\", [\"Button\"], \"./actions\"),\n defaultClaim(\"icon-button\", [\"IconButton\"], \"./actions\"),\n keyboardClaim(\"link\", [\"Link\"], \"./actions\"),\n keyboardClaim(\"field\", [\"Field\", \"TextField\"], \"./forms\"),\n keyboardClaim(\"search-field\", [\"SearchField\"], \"./forms\"),\n defaultClaim(\"text-area\", [\"TextArea\"], \"./forms\"),\n keyboardClaim(\"password-field\", [\"PasswordField\"], \"./password-field\"),\n keyboardClaim(\"otp-field\", [\"OtpField\"], \"./otp-field\"),\n keyboardClaim(\"number-field\", [\"NumberField\"], \"./number-field\"),\n keyboardClaim(\"slider\", [\"Slider\"], \"./slider\"),\n keyboardClaim(\"form\", [\"Form\"], \"./forms\", \"test/form.keyboard.browser.test.tsx\"),\n keyboardClaim(\"date-picker\", [\"DatePicker\"], \"./date-picker\"),\n keyboardClaim(\"calendar\", [\"Calendar\"], \"./calendar\", \"test/calendar.browser.test.tsx\"),\n keyboardClaim(\"file-picker\", [\"FilePicker\"], \"./file-picker\", \"test/file-picker.keyboard.browser.test.tsx\"),\n keyboardClaim(\"checkbox\", [\"Checkbox\"], \"./selection\"),\n defaultClaim(\"radio\", [\"Radio\"], \"./selection\"),\n keyboardClaim(\"checkbox-group\", [\"CheckboxGroup\"], \"./selection\"),\n keyboardClaim(\"radio-group\", [\"RadioGroup\"], \"./selection\"),\n keyboardClaim(\"switch\", [\"Switch\"], \"./selection\"),\n keyboardClaim(\"segmented-control\", [\"SegmentedControl\"], \"./selection\"),\n keyboardClaim(\"chip\", [\"Chip\"], \"./selection\"),\n keyboardClaim(\"tabs\", [\"Tabs\"], \"./navigation\", \"test/tabs.keyboard.browser.test.tsx\"),\n keyboardClaim(\"breadcrumb\", [\"Breadcrumb\"], \"./breadcrumb\", \"test/page-navigation.browser.test.tsx\"),\n keyboardClaim(\"pagination\", [\"Pagination\"], \"./pagination\", \"test/pagination.keyboard.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"popover\", [\"Popover\"], \"./popover\", \"test/popover.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"side-panel\", [\"SidePanel\"], \"./side-panel\", \"test/side-panel.browser.test.tsx\"),\n keyboardClaim(\"splitter\", [\"Splitter\"], \"./splitter\", \"test/splitter.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"tour\", [\"Tour\"], \"./tour\", \"test/tour.browser.test.tsx\"),\n keyboardClaim(\"tree\", [\"Tree\"], \"./tree\", \"test/tree.browser.test.tsx\"),\n keyboardClaim(\"transfer-list\", [\"TransferList\"], \"./transfer-list\", \"test/transfer-list.browser.test.tsx\"),\n keyboardClaim(\"mentions\", [\"Mentions\"], \"./mentions\", \"test/mentions.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"command-palette\", [\"CommandPalette\"], \"./command-palette\", \"test/command-palette.browser.test.tsx\"),\n keyboardClaim(\"agreement\", [\"Agreement\"], \"./agreement\", \"test/agreement.keyboard.browser.test.tsx\"),\n defaultClaim(\"top\", [\"Top\"], \"./top\"),\n defaultClaim(\"heading\", [\"Heading\"], \"./heading\"),\n defaultClaim(\"text-format\", [\"TextFormat\"], \"./text-formats\"),\n keyboardClaim(\"toggle-group\", [\"ToggleGroup\"], \"./toggle-group\"),\n keyboardClaim(\"tags-input\", [\"TagsInput\"], \"./tags-input\"),\n keyboardAndLongCopyClaim(\"skip-nav\", [\"SkipNav\"], \"./skip-nav\", \"test/skip-nav.browser.test.tsx\"),\n defaultClaim(\"bottom-info\", [\"BottomInfo\"], \"./bottom-info\"),\n keyboardClaim(\"sidebar\", [\"Sidebar\"], \"./sidebar\", \"test/sidebar.browser.test.tsx\"),\n keyboardClaim(\"date-range-picker\", [\"DateRangePicker\"], \"./date-range\", \"test/date-range.keyboard.browser.test.tsx\"),\n keyboardClaim(\"auth-provider-button\", [\"AuthProviderButton\"], \"./provider-button\"),\n defaultClaim(\"auth-screen\", [\"AuthScreenLayout\"], \"./auth-screen\"),\n keyboardClaim(\"data-table\", [\"DataTable\"], \"./data-table\", \"test/data-table.keyboard.browser.test.tsx\"),\n keyboardClaim(\"collapsible\", [\"Collapsible\"], \"./collapsible\", \"test/collapsible.keyboard.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"context-menu\", [\"ContextMenu\"], \"./context-menu\", \"test/context-menu.interactions.browser.test.tsx\"),\n keyboardClaim(\"menubar\", [\"Menubar\"], \"./menubar\", \"test/menubar.keyboard.browser.test.tsx\"),\n defaultClaim(\"asset\", [\"Asset\", \"AssetGroup\"], \"./asset\"),\n keyboardClaim(\"anchor\", [\"Anchor\"], \"./anchor\", \"test/anchor.browser.test.tsx\"),\n keyboardClaim(\"bottom-navigation\", [\"BottomNavigation\"], \"./navigation\", \"test/bottom-navigation.keyboard.browser.test.tsx\"),\n keyboardClaim(\"load-more\", [\"LoadMore\"], \"./navigation\", \"test/load-more.interactions.browser.test.tsx\"),\n keyboardClaim(\"carousel\", [\"Carousel\"], \"./carousel\", \"test/carousel.browser.test.tsx\"),\n keyboardClaim(\"floating-action-button\", [\"FloatingActionButton\"], \"./floating-action-button\"),\n defaultClaim(\"steps\", [\"Steps\"], \"./steps\"),\n defaultClaim(\"badge\", [\"Badge\"], \"./display\"),\n defaultClaim(\"avatar\", [\"Avatar\"], \"./display\"),\n defaultClaim(\"counter-badge\", [\"CounterBadge\"], \"./display\"),\n defaultClaim(\"card\", [\"Card\"], \"./display\"),\n defaultClaim(\"list\", [\"List\"], \"./display\"),\n defaultClaim(\"list-row\", [\"ListRow\"], \"./display\"),\n defaultClaim(\"tag\", [\"Tag\"], \"./display\"),\n keyboardClaim(\"accordion\", [\"Accordion\"], \"./display\", \"test/accordion.keyboard.browser.test.tsx\"),\n defaultClaim(\"divider\", [\"Divider\"], \"./display\"),\n defaultClaim(\"statistic\", [\"Statistic\", \"StatisticGroup\"], \"./display\"),\n defaultClaim(\"section\", [\"Section\"], \"./layout\"),\n keyboardClaim(\"upload-item\", [\"UploadItem\"], \"./upload-item\", \"test/upload-item.browser.test.tsx\"),\n defaultClaim(\"timeline\", [\"Timeline\"], \"./display\"),\n defaultClaim(\"description-list\", [\"DescriptionList\"], \"./display\"),\n defaultClaim(\"image\", [\"Image\"], \"./display\"),\n defaultClaim(\"empty-state\", [\"EmptyState\"], \"./feedback\"),\n defaultClaim(\"notice\", [\"Notice\"], \"./feedback\"),\n defaultClaim(\"progress\", [\"Progress\"], \"./feedback\"),\n {\n componentId: \"thinking-orb\",\n exportNames: [\"ThinkingOrb\"],\n subpath: \"./thinking-orb\",\n scenarios: [\"default\", \"dark\", \"large-text\", \"rtl\", \"reduced-motion\", \"accessibility\"],\n proofs: [\n { scenarios: [\"default\"], file: defaultProofFile, caseId: \"thinking-orb\" },\n {\n scenarios: [\"dark\", \"large-text\", \"rtl\", \"reduced-motion\", \"accessibility\"],\n file: \"test/thinking-orb.browser.test.tsx\",\n caseId: \"thinking-orb\",\n },\n ],\n },\n keyboardClaim(\"color-picker\", [\"ColorPicker\"], \"./color-picker\", \"test/web-additions.browser.test.tsx\"),\n defaultClaim(\"watermark\", [\"Watermark\"], \"./watermark\"),\n defaultClaim(\"affix\", [\"Affix\"], \"./affix\"),\n defaultClaim(\"masonry\", [\"Masonry\"], \"./masonry\"),\n defaultClaim(\"virtual-list\", [\"VirtualList\"], \"./virtual-list\"),\n defaultClaim(\"qr-code\", [\"QRCode\"], \"./qr-code\"),\n defaultClaim(\"spinner\", [\"Spinner\"], \"./feedback\"),\n defaultClaim(\"skeleton\", [\"Skeleton\"], \"./feedback\"),\n defaultClaim(\"result\", [\"Result\"], \"./feedback\"),\n toastClaim(),\n keyboardClaim(\"select\", [\"Select\"], \"./forms\"),\n keyboardClaim(\"combobox\", [\"Combobox\"], \"./forms\"),\n keyboardClaim(\"dialog\", [\"Dialog\"], \"./overlays\", \"test/advanced.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"alert-dialog\", [\"AlertDialog\"], \"./overlays\", \"test/alert-dialog.keyboard.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"sheet\", [\"Sheet\"], \"./overlays\", \"test/sheet-layout.browser.test.tsx\"),\n keyboardClaim(\"tooltip\", [\"Tooltip\"], \"./overlays\", \"test/tooltip.browser.test.tsx\"),\n defaultClaim(\"visually-hidden\", [\"VisuallyHidden\"], \"./layout\"),\n keyboardAndLongCopyClaim(\"menu\", [\"Menu\"], \"./overlays\", \"test/menu.keyboard.browser.test.tsx\"),\n ],\n} as const satisfies ReactRendererEvidenceManifest;\n"]}
|
|
1
|
+
{"version":3,"file":"evidence.js","sourceRoot":"","sources":["../src/evidence.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAU,CAAC;AA6B7D,MAAM,gBAAgB,GAAG,kCAA2C,CAAC;AACrE,MAAM,eAAe,GAAG,uCAAgD,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,eAAe,GAAG,CAAC,eAAe,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,gBAAgB,CAAU,CAAC;AAElG;;;;GAIG;AACH,MAAM,eAAe,GAAuE,EAAE,CAAC;AAE/F,4EAA4E;AAC5E,MAAM,mBAAmB,GAAwB,IAAI,GAAG,CAAS;IAC/D,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO;IAC1E,wBAAwB;IACxB,aAAa;IACb,cAAc;IACd,MAAM;IACN,UAAU;IACV,QAAQ;IACR,OAAO;IACP,YAAY;IACZ,aAAa;IACb,OAAO;IACP,MAAM;IACN,UAAU;IACV,aAAa;IACb,OAAO;IACP,WAAW;IACX,MAAM;IACN,SAAS;IACT,QAAQ;IACR,OAAO;IACP,WAAW;IACX,MAAM;IACN,QAAQ;IACR,UAAU;IACV,KAAK;IACL,WAAW;IACX,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,WAAW;IACX,MAAM;IACN,OAAO;IACP,MAAM;IACN,MAAM;IACN,QAAQ;IACR,UAAU;IACV,SAAS;IACT,aAAa;IACb,KAAK;IACL,SAAS;IACT,mBAAmB;IACnB,SAAS;IACT,UAAU;IACV,YAAY;IAC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D,YAAY,CAAC,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;QAChD,YAAY,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,YAAY,CAAC;QAClD,YAAY,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE,YAAY,CAAC;QACpD,YAAY,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;QAChD,UAAU,EAAE;QACZ,aAAa,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;QAC9C,aAAa,CAAC,UAAU,EAAE,CAAC,UAAU,CAAC,EAAE,SAAS,CAAC;QAClD,aAAa,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,gCAAgC,CAAC;QACnF,wBAAwB,CAAC,cAAc,EAAE,CAAC,aAAa,CAAC,EAAE,YAAY,EAAE,6CAA6C,CAAC;QACtH,wBAAwB,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,oCAAoC,CAAC;QAChG,aAAa,CAAC,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,YAAY,EAAE,+BAA+B,CAAC;QACpF,YAAY,CAAC,iBAAiB,EAAE,CAAC,gBAAgB,CAAC,EAAE,UAAU,CAAC;QAC/D,wBAAwB,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,qCAAqC,CAAC;KAChG;CAC+C,CAAC","sourcesContent":["import type { ShowcaseScenarioId } from \"@hjmds/design-contracts/showcase\";\n\nexport const reactRendererEvidenceSchemaVersion = 2 as const;\n\nexport type ReactRendererEvidenceScenario = Exclude<ShowcaseScenarioId, \"contract\" | \"native-actions\">;\n\nexport type ReactRendererEvidenceComponent = Readonly<{\n /** Canonical component id from the design-contracts catalog. */\n componentId: string;\n /** Public symbols that implement this contract on the declared subpath. */\n exportNames: readonly string[];\n /** Granular @hjmds/react export used by consumers. */\n subpath: `./${string}`;\n /** Scenarios supported by automated first-party renderer evidence. */\n scenarios: readonly ReactRendererEvidenceScenario[];\n /** Repository-local executable proof for every claimed scenario. */\n proofs: readonly Readonly<{\n scenarios: readonly ReactRendererEvidenceScenario[];\n file: `test/${string}.test.tsx`;\n caseId: string;\n }>[];\n}>;\n\nexport type ReactRendererEvidenceManifest = Readonly<{\n schemaVersion: typeof reactRendererEvidenceSchemaVersion;\n packageName: \"@hjmds/react\";\n packageVersion: string;\n surface: \"web\";\n components: readonly ReactRendererEvidenceComponent[];\n}>;\n\nconst defaultProofFile = \"test/default-render.ssr.test.tsx\" as const;\nconst matrixProofFile = \"test/scenario-matrix.browser.test.tsx\" as const;\n\n/**\n * Environment scenarios proven in a real browser by scenario-matrix.browser.\n * Until 1.5.0 every component claimed all seven scenarios from one SSR test\n * that only checked the provider wrapper's attributes. A component now claims\n * a matrix scenario only if the matrix assertion for it passes.\n */\nconst matrixScenarios = [\"accessibility\", \"dark\", \"large-text\", \"rtl\", \"reduced-motion\"] as const;\n\n/**\n * Scenarios a component does not pass yet. Each entry is promotion debt that\n * the generated evidence projection reports; remove it when the component is\n * fixed and the matrix case passes.\n */\nconst webScenarioGaps: Readonly<Record<string, readonly ReactRendererEvidenceScenario[]>> = {};\n\n/** Fixtures that render long copy inside the component (renderLongCopy). */\nconst webLongCopyFixtures: ReadonlySet<string> = new Set<string>([\n \"masonry\", \"virtual-list\", \"qr-code\", \"color-picker\", \"watermark\", \"affix\",\n \"design-system-provider\",\n \"text-format\",\n \"aspect-ratio\",\n \"grid\",\n \"splitter\",\n \"layout\",\n \"steps\",\n \"breadcrumb\",\n \"auth-screen\",\n \"radio\",\n \"list\",\n \"timeline\",\n \"bottom-info\",\n \"stack\",\n \"container\",\n \"text\",\n \"surface\",\n \"button\",\n \"field\",\n \"text-area\",\n \"card\",\n \"notice\",\n \"list-row\",\n \"tag\",\n \"accordion\",\n \"file-picker\",\n \"agreement\",\n \"bottom-navigation\",\n \"load-more\",\n \"tabs\",\n \"badge\",\n \"chip\",\n \"link\",\n \"select\",\n \"combobox\",\n \"heading\",\n \"empty-state\",\n \"top\",\n \"section\",\n \"segmented-control\",\n \"top-bar\",\n \"mentions\",\n \"bottom-cta\",\n \"result\",\n \"progress\",\n \"description-list\",\n \"toast\",\n \"statistic\",\n \"radio-group\",\n \"checkbox-group\",\n \"auth-provider-button\",\n \"password-field\",\n \"search-field\",\n \"number-field\",\n \"floating-action-button\",\n \"checkbox\",\n \"switch\",\n \"toggle-group\",\n \"slider\",\n \"otp-field\",\n \"date-picker\",\n \"menubar\",\n \"sidebar\",\n \"transfer-list\",\n \"upload-item\",\n \"tags-input\",\n \"data-table\",\n \"collapsible\",\n \"anchor\",\n \"tree\",\n \"carousel\",\n \"calendar\",\n \"dialog\",\n \"tooltip\",\n]);\n\nfunction defaultClaim(\n componentId: string,\n exportNames: readonly string[],\n subpath: `./${string}`,\n): ReactRendererEvidenceComponent {\n const gaps = webScenarioGaps[componentId] ?? [];\n const matrix: ReactRendererEvidenceScenario[] = [\n ...matrixScenarios.filter((scenario) => !gaps.includes(scenario)),\n ...(webLongCopyFixtures.has(componentId) && !gaps.includes(\"long-copy\") ? [\"long-copy\" as const] : []),\n ];\n return {\n componentId,\n exportNames,\n subpath,\n scenarios: [\"default\", ...matrix],\n proofs: [\n { scenarios: [\"default\"], file: defaultProofFile, caseId: componentId },\n ...(matrix.length === 0 ? [] : [{ scenarios: matrix, file: matrixProofFile, caseId: componentId }]),\n ],\n };\n}\n\nfunction keyboardClaim(\n componentId: string,\n exportNames: readonly string[],\n subpath: `./${string}`,\n proofFile: `test/${string}.test.tsx` = \"test/stable-core.browser.test.tsx\",\n): ReactRendererEvidenceComponent {\n const base = defaultClaim(componentId, exportNames, subpath);\n return {\n ...base,\n scenarios: [...base.scenarios, \"keyboard\"],\n proofs: [\n ...base.proofs,\n {\n scenarios: [\"keyboard\"],\n file: proofFile,\n caseId: componentId,\n },\n ],\n };\n}\n\nfunction keyboardAndLongCopyClaim(\n componentId: string,\n exportNames: readonly string[],\n subpath: `./${string}`,\n proofFile: `test/${string}.test.tsx`,\n): ReactRendererEvidenceComponent {\n const base = defaultClaim(componentId, exportNames, subpath);\n return {\n ...base,\n scenarios: [...base.scenarios, \"keyboard\", \"long-copy\"],\n proofs: [...base.proofs, { scenarios: [\"keyboard\", \"long-copy\"], file: proofFile, caseId: componentId }],\n };\n}\n\nfunction toastClaim(): ReactRendererEvidenceComponent {\n const base = defaultClaim(\"toast\", [\"Toast\", \"ToastProvider\", \"useToast\"], \"./toast\");\n return {\n ...base,\n scenarios: [...base.scenarios, \"keyboard\"],\n // SSR proves semantics but cannot catch the close-only row seen in BurnTok.\n // Keep real geometry evidence attached without promoting catalog maturity.\n proofs: [...base.proofs,\n { scenarios: [\"keyboard\"], file: \"test/stable-core.browser.test.tsx\", caseId: \"toast\" },\n { scenarios: [\"dark\", \"long-copy\", \"large-text\", \"rtl\"], file: \"test/toast-layout.browser.test.tsx\", caseId: \"toast\" },\n ],\n };\n}\n\n/**\n * First-party Web renderer claims. Scenario axes remain fail-closed: the\n * default scenario is an SSR render, the environment and accessibility\n * scenarios are computed-style assertions in scenario-matrix.browser.\n * Keyboard and cross-platform parity remain fail-closed until dedicated\n * interaction or paired-renderer proofs are mapped one-to-one.\n */\nexport const reactRendererEvidence = {\n schemaVersion: reactRendererEvidenceSchemaVersion,\n packageName: \"@hjmds/react\",\n packageVersion: \"1.15.0\",\n surface: \"web\",\n components: [\n defaultClaim(\"top-bar\", [\"TopBar\"], \"./top-bar\"),\n defaultClaim(\"bottom-cta\", [\"BottomCTA\"], \"./bottom-cta\"),\n defaultClaim(\"design-system-provider\", [\"HjmProvider\", \"useHjmTheme\"], \"./provider\"),\n defaultClaim(\"text\", [\"Text\"], \"./layout\"),\n defaultClaim(\"surface\", [\"Surface\"], \"./layout\"),\n defaultClaim(\"icon\", [\"Icon\"], \"./display\"),\n defaultClaim(\"stack\", [\"Stack\"], \"./layout\"),\n defaultClaim(\"container\", [\"Container\"], \"./layout\"),\n defaultClaim(\"aspect-ratio\", [\"AspectRatio\"], \"./layout\"),\n defaultClaim(\"grid\", [\"Grid\"], \"./layout\"),\n keyboardClaim(\"layout\", [\"Layout\"], \"./layout\"),\n defaultClaim(\"button\", [\"Button\"], \"./actions\"),\n defaultClaim(\"icon-button\", [\"IconButton\"], \"./actions\"),\n keyboardClaim(\"link\", [\"Link\"], \"./actions\"),\n keyboardClaim(\"field\", [\"Field\", \"TextField\"], \"./forms\"),\n keyboardClaim(\"search-field\", [\"SearchField\"], \"./forms\"),\n defaultClaim(\"text-area\", [\"TextArea\"], \"./forms\"),\n keyboardClaim(\"password-field\", [\"PasswordField\"], \"./password-field\"),\n keyboardClaim(\"otp-field\", [\"OtpField\"], \"./otp-field\"),\n keyboardClaim(\"number-field\", [\"NumberField\"], \"./number-field\"),\n keyboardClaim(\"slider\", [\"Slider\"], \"./slider\"),\n keyboardClaim(\"form\", [\"Form\"], \"./forms\", \"test/form.keyboard.browser.test.tsx\"),\n keyboardClaim(\"date-picker\", [\"DatePicker\"], \"./date-picker\"),\n keyboardClaim(\"calendar\", [\"Calendar\"], \"./calendar\", \"test/calendar.browser.test.tsx\"),\n keyboardClaim(\"file-picker\", [\"FilePicker\"], \"./file-picker\", \"test/file-picker.keyboard.browser.test.tsx\"),\n keyboardClaim(\"checkbox\", [\"Checkbox\"], \"./selection\"),\n defaultClaim(\"radio\", [\"Radio\"], \"./selection\"),\n keyboardClaim(\"checkbox-group\", [\"CheckboxGroup\"], \"./selection\"),\n keyboardClaim(\"radio-group\", [\"RadioGroup\"], \"./selection\"),\n keyboardClaim(\"switch\", [\"Switch\"], \"./selection\"),\n keyboardClaim(\"segmented-control\", [\"SegmentedControl\"], \"./selection\"),\n keyboardClaim(\"chip\", [\"Chip\"], \"./selection\"),\n keyboardClaim(\"tabs\", [\"Tabs\"], \"./navigation\", \"test/tabs.keyboard.browser.test.tsx\"),\n keyboardClaim(\"breadcrumb\", [\"Breadcrumb\"], \"./breadcrumb\", \"test/page-navigation.browser.test.tsx\"),\n keyboardClaim(\"pagination\", [\"Pagination\"], \"./pagination\", \"test/pagination.keyboard.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"popover\", [\"Popover\"], \"./popover\", \"test/popover.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"side-panel\", [\"SidePanel\"], \"./side-panel\", \"test/side-panel.browser.test.tsx\"),\n keyboardClaim(\"splitter\", [\"Splitter\"], \"./splitter\", \"test/splitter.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"tour\", [\"Tour\"], \"./tour\", \"test/tour.browser.test.tsx\"),\n keyboardClaim(\"tree\", [\"Tree\"], \"./tree\", \"test/tree.browser.test.tsx\"),\n keyboardClaim(\"transfer-list\", [\"TransferList\"], \"./transfer-list\", \"test/transfer-list.browser.test.tsx\"),\n keyboardClaim(\"mentions\", [\"Mentions\"], \"./mentions\", \"test/mentions.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"command-palette\", [\"CommandPalette\"], \"./command-palette\", \"test/command-palette.browser.test.tsx\"),\n keyboardClaim(\"agreement\", [\"Agreement\"], \"./agreement\", \"test/agreement.keyboard.browser.test.tsx\"),\n defaultClaim(\"top\", [\"Top\"], \"./top\"),\n defaultClaim(\"heading\", [\"Heading\"], \"./heading\"),\n defaultClaim(\"text-format\", [\"TextFormat\"], \"./text-formats\"),\n keyboardClaim(\"toggle-group\", [\"ToggleGroup\"], \"./toggle-group\"),\n keyboardClaim(\"tags-input\", [\"TagsInput\"], \"./tags-input\"),\n keyboardAndLongCopyClaim(\"skip-nav\", [\"SkipNav\"], \"./skip-nav\", \"test/skip-nav.browser.test.tsx\"),\n defaultClaim(\"bottom-info\", [\"BottomInfo\"], \"./bottom-info\"),\n keyboardClaim(\"sidebar\", [\"Sidebar\"], \"./sidebar\", \"test/sidebar.browser.test.tsx\"),\n keyboardClaim(\"date-range-picker\", [\"DateRangePicker\"], \"./date-range\", \"test/date-range.keyboard.browser.test.tsx\"),\n keyboardClaim(\"auth-provider-button\", [\"AuthProviderButton\"], \"./provider-button\"),\n defaultClaim(\"auth-screen\", [\"AuthScreenLayout\"], \"./auth-screen\"),\n keyboardClaim(\"data-table\", [\"DataTable\"], \"./data-table\", \"test/data-table.keyboard.browser.test.tsx\"),\n keyboardClaim(\"collapsible\", [\"Collapsible\"], \"./collapsible\", \"test/collapsible.keyboard.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"context-menu\", [\"ContextMenu\"], \"./context-menu\", \"test/context-menu.interactions.browser.test.tsx\"),\n keyboardClaim(\"menubar\", [\"Menubar\"], \"./menubar\", \"test/menubar.keyboard.browser.test.tsx\"),\n defaultClaim(\"asset\", [\"Asset\", \"AssetGroup\"], \"./asset\"),\n keyboardClaim(\"anchor\", [\"Anchor\"], \"./anchor\", \"test/anchor.browser.test.tsx\"),\n keyboardClaim(\"bottom-navigation\", [\"BottomNavigation\"], \"./navigation\", \"test/bottom-navigation.keyboard.browser.test.tsx\"),\n keyboardClaim(\"load-more\", [\"LoadMore\"], \"./navigation\", \"test/load-more.interactions.browser.test.tsx\"),\n keyboardClaim(\"carousel\", [\"Carousel\"], \"./carousel\", \"test/carousel.browser.test.tsx\"),\n keyboardClaim(\"floating-action-button\", [\"FloatingActionButton\"], \"./floating-action-button\"),\n defaultClaim(\"steps\", [\"Steps\"], \"./steps\"),\n defaultClaim(\"badge\", [\"Badge\"], \"./display\"),\n defaultClaim(\"avatar\", [\"Avatar\"], \"./display\"),\n defaultClaim(\"counter-badge\", [\"CounterBadge\"], \"./display\"),\n defaultClaim(\"card\", [\"Card\"], \"./display\"),\n defaultClaim(\"list\", [\"List\"], \"./display\"),\n defaultClaim(\"list-row\", [\"ListRow\"], \"./display\"),\n defaultClaim(\"tag\", [\"Tag\"], \"./display\"),\n keyboardClaim(\"accordion\", [\"Accordion\"], \"./display\", \"test/accordion.keyboard.browser.test.tsx\"),\n defaultClaim(\"divider\", [\"Divider\"], \"./display\"),\n defaultClaim(\"statistic\", [\"Statistic\", \"StatisticGroup\"], \"./display\"),\n defaultClaim(\"section\", [\"Section\"], \"./layout\"),\n keyboardClaim(\"upload-item\", [\"UploadItem\"], \"./upload-item\", \"test/upload-item.browser.test.tsx\"),\n defaultClaim(\"timeline\", [\"Timeline\"], \"./display\"),\n defaultClaim(\"description-list\", [\"DescriptionList\"], \"./display\"),\n defaultClaim(\"image\", [\"Image\"], \"./display\"),\n defaultClaim(\"empty-state\", [\"EmptyState\"], \"./feedback\"),\n defaultClaim(\"notice\", [\"Notice\"], \"./feedback\"),\n defaultClaim(\"progress\", [\"Progress\"], \"./feedback\"),\n {\n componentId: \"thinking-orb\",\n exportNames: [\"ThinkingOrb\"],\n subpath: \"./thinking-orb\",\n scenarios: [\"default\", \"dark\", \"large-text\", \"rtl\", \"reduced-motion\", \"accessibility\"],\n proofs: [\n { scenarios: [\"default\"], file: defaultProofFile, caseId: \"thinking-orb\" },\n {\n scenarios: [\"dark\", \"large-text\", \"rtl\", \"reduced-motion\", \"accessibility\"],\n file: \"test/thinking-orb.browser.test.tsx\",\n caseId: \"thinking-orb\",\n },\n ],\n },\n keyboardClaim(\"color-picker\", [\"ColorPicker\"], \"./color-picker\", \"test/web-additions.browser.test.tsx\"),\n defaultClaim(\"watermark\", [\"Watermark\"], \"./watermark\"),\n defaultClaim(\"affix\", [\"Affix\"], \"./affix\"),\n defaultClaim(\"masonry\", [\"Masonry\"], \"./masonry\"),\n defaultClaim(\"virtual-list\", [\"VirtualList\"], \"./virtual-list\"),\n defaultClaim(\"qr-code\", [\"QRCode\"], \"./qr-code\"),\n defaultClaim(\"spinner\", [\"Spinner\"], \"./feedback\"),\n defaultClaim(\"skeleton\", [\"Skeleton\"], \"./feedback\"),\n defaultClaim(\"result\", [\"Result\"], \"./feedback\"),\n toastClaim(),\n keyboardClaim(\"select\", [\"Select\"], \"./forms\"),\n keyboardClaim(\"combobox\", [\"Combobox\"], \"./forms\"),\n keyboardClaim(\"dialog\", [\"Dialog\"], \"./overlays\", \"test/advanced.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"alert-dialog\", [\"AlertDialog\"], \"./overlays\", \"test/alert-dialog.keyboard.browser.test.tsx\"),\n keyboardAndLongCopyClaim(\"sheet\", [\"Sheet\"], \"./overlays\", \"test/sheet-layout.browser.test.tsx\"),\n keyboardClaim(\"tooltip\", [\"Tooltip\"], \"./overlays\", \"test/tooltip.browser.test.tsx\"),\n defaultClaim(\"visually-hidden\", [\"VisuallyHidden\"], \"./layout\"),\n keyboardAndLongCopyClaim(\"menu\", [\"Menu\"], \"./overlays\", \"test/menu.keyboard.browser.test.tsx\"),\n ],\n} as const satisfies ReactRendererEvidenceManifest;\n"]}
|
|
@@ -15,7 +15,7 @@ export type FloatingActionButtonProps = Pick<ButtonProps, "onClick" | "onFocus"
|
|
|
15
15
|
onContentClearanceChange: (clearance: number) => void;
|
|
16
16
|
}>;
|
|
17
17
|
/** One persistent button preserves focus while its label collapses. */
|
|
18
|
-
export declare const FloatingActionButton: import("react").ForwardRefExoticComponent<Pick<ButtonProps, "
|
|
18
|
+
export declare const FloatingActionButton: import("react").ForwardRefExoticComponent<Pick<ButtonProps, "id" | "className" | "onFocus" | "onBlur" | "onClick"> & Readonly<{
|
|
19
19
|
descriptor: FloatingActionButtonDescriptor;
|
|
20
20
|
renderIcon: (icon: Readonly<{
|
|
21
21
|
name: string;
|
package/dist/heading.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../src/heading.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../src/heading.tsx"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,UAAU,CAAC,GAC7E,iBAAiB,GACjB,QAAQ,CAAC;IACP,QAAQ,EAAE,SAAS,CAAC;IACpB,gGAAgG;IAChG,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAEL,eAAO,MAAM,OAAO;;;;cALN,SAAS;IACnB,gGAAgG;kBAClF,uBAAuB;uDAsCvC,CAAC"}
|
package/dist/heading.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useDesignProfileDefaults } from "./internal.js";
|
|
1
2
|
import { headingRecipe, resolveHeadingSemanticLevel, validateHeadingDescriptor, } from "@hjmds/design-contracts/components/heading";
|
|
2
3
|
import { createElement, forwardRef, } from "react";
|
|
3
4
|
import { classNames } from "./internal.js";
|
|
@@ -7,7 +8,8 @@ export const Heading = forwardRef(function Heading({ level, semanticLevel, child
|
|
|
7
8
|
...(semanticLevel === undefined ? {} : { semanticLevel }),
|
|
8
9
|
};
|
|
9
10
|
validateHeadingDescriptor(descriptor);
|
|
10
|
-
const
|
|
11
|
+
const profile = useDesignProfileDefaults();
|
|
12
|
+
const metrics = profile?.tokens.heading[level] ?? headingRecipe.levels[level];
|
|
11
13
|
// Visual size and document level are separate axes: the element comes from
|
|
12
14
|
// the semantic level, the type comes from the visual one.
|
|
13
15
|
return createElement(`h${resolveHeadingSemanticLevel(descriptor)}`, {
|
package/dist/heading.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.js","sourceRoot":"","sources":["../src/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,yBAAyB,GAE1B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,aAAa,EACb,UAAU,GAIX,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAW3C,MAAM,CAAC,MAAM,OAAO,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AK,CAAC,CAAC;IAC9E,2EAA2E;IAC3E,0DAA0D;IAC1D,OAAO,aAAa,CAClB,IAAI,2BAA2B,CAAC,UAAU,CAAC,EAAE,EAC7C;QACE,GAAG,KAAK;QACR,GAAG,EAAE,YAAY;QACjB,SAAS,EAAE,UAAU,CAAC,aAAa,EAAE,SAAS,CAAC;QAC/C,YAAY,EAAE,KAAK;QACnB,2EAA2E;QAC3E,6EAA6E;QAC7E,2EAA2E;QAC3E,yEAAyE;QACzE,4EAA4E;QAC5E,KAAK,EAAE;YACL,GAAG,KAAK;YACR,GAAG,WAAW;YACd,oBAAoB,EAAE,GAAG,OAAO,CAAC,QAAQ,IAAI;YAC7C,2BAA2B,EAAE,GAAG,OAAO,CAAC,UAAU,IAAI;YACtD,sBAAsB,EAAE,OAAO,CAAC,UAAU;SAC1B;KACnB,EACD,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["import { useDesignProfileDefaults } from \"./internal.js\";\nimport {\n headingRecipe,\n resolveHeadingSemanticLevel,\n validateHeadingDescriptor,\n type HeadingDescriptor,\n} from \"@hjmds/design-contracts/components/heading\";\nimport {\n createElement,\n forwardRef,\n type CSSProperties,\n type HTMLAttributes,\n type ReactNode,\n} from \"react\";\nimport { classNames } from \"./internal.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\nexport type HeadingProps = Omit<HTMLAttributes<HTMLHeadingElement>, \"children\"> &\n HeadingDescriptor &\n Readonly<{\n children: ReactNode;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const Heading = forwardRef<HTMLHeadingElement, HeadingProps>(function Heading(\n { level, semanticLevel, children, className, layoutStyle, style, ...props },\n forwardedRef,\n) {\n const descriptor: HeadingDescriptor = {\n level,\n ...(semanticLevel === undefined ? {} : { semanticLevel }),\n };\n validateHeadingDescriptor(descriptor);\n const profile = useDesignProfileDefaults();\n const metrics = profile?.tokens.heading[level] ?? headingRecipe.levels[level];\n // Visual size and document level are separate axes: the element comes from\n // the semantic level, the type comes from the visual one.\n return createElement(\n `h${resolveHeadingSemanticLevel(descriptor)}`,\n {\n ...props,\n ref: forwardedRef,\n className: classNames(\"hjm-heading\", className),\n \"data-level\": level,\n // The caller's `style` used to be replaced wholesale by the recipe object,\n // so a placement margin vanished without a type error. Merge it instead, and\n // spread the recipe variables last: the level still owns size, line height\n // and weight, which is why the variables are not caller-overridable here\n // (unlike Native's caller-last array; Web has `layoutStyle` for placement).\n style: {\n ...style,\n ...layoutStyle,\n \"--hjm-heading-size\": `${metrics.fontSize}px`,\n \"--hjm-heading-line-height\": `${metrics.lineHeight}px`,\n \"--hjm-heading-weight\": metrics.fontWeight,\n } as CSSProperties,\n },\n children,\n );\n});\n"]}
|
package/dist/internal.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HjmDesignProfile } from "@hjmds/design-contracts/design-profile";
|
|
1
2
|
import { type Dispatch, type Ref, type SetStateAction } from "react";
|
|
2
3
|
export declare function classNames(...values: readonly (string | false | null | undefined)[]): string | undefined;
|
|
3
4
|
export declare function assignRef<Element>(ref: Ref<Element> | undefined, value: Element | null): void;
|
|
@@ -13,5 +14,58 @@ export declare function useControllableState<Value>({ value, defaultValue, onCha
|
|
|
13
14
|
];
|
|
14
15
|
export declare function useWindowWidth(): number;
|
|
15
16
|
export declare function useElementWidth<Element extends HTMLElement>(externalRef?: Ref<Element>): readonly [number | undefined, (node: Element | null) => void];
|
|
17
|
+
export declare const DesignProfileContext: import("react").Context<Readonly<{
|
|
18
|
+
id: string;
|
|
19
|
+
palette: Readonly<Record<import("@hjmds/design-contracts/colors").ResolvedTheme, Readonly<import("@hjmds/design-contracts/colors").ThemeColors>>>;
|
|
20
|
+
tokens: Readonly<{
|
|
21
|
+
radius: Readonly<Record<"sm" | "md" | "lg" | "xl" | "full", number>>;
|
|
22
|
+
fontFamily: Readonly<{
|
|
23
|
+
ui: readonly string[];
|
|
24
|
+
code: readonly string[];
|
|
25
|
+
}>;
|
|
26
|
+
typography: Readonly<Record<"heading" | "caption" | "label" | "body" | "bodyLarge" | "title" | "titleLarge", Readonly<{
|
|
27
|
+
fontSize: number;
|
|
28
|
+
lineHeight: number;
|
|
29
|
+
fontWeight: import("@hjmds/design-contracts/foundations").FontWeightValue;
|
|
30
|
+
}>>>;
|
|
31
|
+
heading: Readonly<Record<"level1" | "level2" | "level3" | "level4" | "level5", Readonly<{
|
|
32
|
+
fontSize: number;
|
|
33
|
+
lineHeight: number;
|
|
34
|
+
fontWeight: import("@hjmds/design-contracts/foundations").FontWeightValue;
|
|
35
|
+
}>>>;
|
|
36
|
+
shadow: Readonly<Record<"overlay" | "raised" | "floating", Readonly<{
|
|
37
|
+
color: string;
|
|
38
|
+
opacity: number;
|
|
39
|
+
radius: number;
|
|
40
|
+
offsetY: number;
|
|
41
|
+
}>>>;
|
|
42
|
+
}>;
|
|
43
|
+
material: Readonly<Record<"canvas" | "card", import("@hjmds/design-contracts/effect-surface").EffectSurfaceDescriptor | null> & {
|
|
44
|
+
surface?: Readonly<{
|
|
45
|
+
blurStrength: number;
|
|
46
|
+
fillOpacity: number;
|
|
47
|
+
insetShadows: readonly Readonly<Readonly<{
|
|
48
|
+
color: string;
|
|
49
|
+
opacity: number;
|
|
50
|
+
radius: number;
|
|
51
|
+
offsetY: number;
|
|
52
|
+
}> & {
|
|
53
|
+
offsetX: number;
|
|
54
|
+
}>[];
|
|
55
|
+
}> | null;
|
|
56
|
+
}>;
|
|
57
|
+
interactions: Readonly<{
|
|
58
|
+
contentTransition: import("@hjmds/design-contracts/content-transition").ContentTransitionPreset;
|
|
59
|
+
selectionMotion: "none" | "slide";
|
|
60
|
+
}>;
|
|
61
|
+
compositions: Readonly<{
|
|
62
|
+
collection: "rows" | "cards" | "grid";
|
|
63
|
+
toolbar: "inline" | "collapsible";
|
|
64
|
+
}>;
|
|
65
|
+
screens: Readonly<{
|
|
66
|
+
overview: "dashboard" | "editorial" | "landscape";
|
|
67
|
+
}>;
|
|
68
|
+
}> | undefined>;
|
|
69
|
+
export declare function useDesignProfileDefaults(): HjmDesignProfile | undefined;
|
|
16
70
|
export {};
|
|
17
71
|
//# sourceMappingURL=internal.d.ts.map
|
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAOL,KAAK,QAAQ,EACb,KAAK,GAAG,EACR,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAEf,wBAAgB,UAAU,CACxB,GAAG,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GACxD,MAAM,GAAG,SAAS,CAGpB;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAG7F;AAED,wBAAgB,WAAW,CAAC,OAAO,EACjC,GAAG,IAAI,EAAE,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,EAAE,GAC7C,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAIjC;AAED,KAAK,wBAAwB,CAAC,KAAK,IAAI,QAAQ,CAAC;IAC9C,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,YAAY,EAAE,KAAK,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACnC,CAAC,CAAC;AAEH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,EAC1C,KAAK,EACL,YAAY,EACZ,QAAQ,GACT,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAG,SAAS;IAC5C,KAAK;IACL,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;CAChC,CAiBA;AAeD,wBAAgB,cAAc,IAAI,MAAM,CAMvC;AAED,wBAAgB,eAAe,CAAC,OAAO,SAAS,WAAW,EACzD,WAAW,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,GACzB,SAAS,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAC,CAyB/D;AAID,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;eAtCd,CAAC;;;;;;;;;;;;;;;;;;;;;;;;eAsCsE,CAAC;AAC3F,wBAAgB,wBAAwB,IAAI,gBAAgB,GAAG,SAAS,CAEvE"}
|
package/dist/internal.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState, useSyncExternalStore, } from "react";
|
|
1
|
+
import { createContext, useContext, useCallback, useEffect, useState, useSyncExternalStore, } from "react";
|
|
2
2
|
export function classNames(...values) {
|
|
3
3
|
const result = values.filter(Boolean).join(" ");
|
|
4
4
|
return result.length > 0 ? result : undefined;
|
|
@@ -65,4 +65,10 @@ export function useElementWidth(externalRef) {
|
|
|
65
65
|
}, [node]);
|
|
66
66
|
return [width, ref];
|
|
67
67
|
}
|
|
68
|
+
// This existing helper module is already used by provider and granular selection.
|
|
69
|
+
// Keeping resolved data here avoids importing provider recipes or all preset packs.
|
|
70
|
+
export const DesignProfileContext = createContext(undefined);
|
|
71
|
+
export function useDesignProfileDefaults() {
|
|
72
|
+
return useContext(DesignProfileContext);
|
|
73
|
+
}
|
|
68
74
|
//# sourceMappingURL=internal.js.map
|
package/dist/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.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ACb,IAAI,CAAC,IAAI;YAAE,OAAO;QAClB,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC,CAAC;QAClE,MAAM,EAAE,CAAC;QACT,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE,CAAC;YAC1C,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;YAC1C,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC5D,CAAC;QACD,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;QAC5C,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACvB,OAAO,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;IACrC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,CAAC,KAAK,EAAE,GAAG,CAAU,CAAC;AAC/B,CAAC;AAED,kFAAkF;AAClF,oFAAoF;AACpF,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAA+B,SAAS,CAAC,CAAC;AAC3F,MAAM,UAAU,wBAAwB;IACtC,OAAO,UAAU,CAAC,oBAAoB,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["import type { HjmDesignProfile } from \"@hjmds/design-contracts/design-profile\";\nimport {\n createContext,\n useContext,\n useCallback,\n useEffect,\n useState,\n useSyncExternalStore,\n type Dispatch,\n type Ref,\n type SetStateAction,\n} from \"react\";\n\nexport function classNames(\n ...values: readonly (string | false | null | undefined)[]\n): string | undefined {\n const result = values.filter(Boolean).join(\" \");\n return result.length > 0 ? result : undefined;\n}\n\nexport function assignRef<Element>(ref: Ref<Element> | undefined, value: Element | null): void {\n if (typeof ref === \"function\") ref(value);\n else if (ref) ref.current = value;\n}\n\nexport function composeRefs<Element>(\n ...refs: readonly (Ref<Element> | undefined)[]\n): (value: Element | null) => void {\n return (value) => {\n for (const ref of refs) assignRef(ref, value);\n };\n}\n\ntype ControllableStateOptions<Value> = Readonly<{\n value?: Value;\n defaultValue: Value;\n onChange?: (value: Value) => void;\n}>;\n\nexport function useControllableState<Value>({\n value,\n defaultValue,\n onChange,\n}: ControllableStateOptions<Value>): readonly [\n Value,\n Dispatch<SetStateAction<Value>>,\n] {\n const [internalValue, setInternalValue] = useState(defaultValue);\n const controlled = value !== undefined;\n const currentValue = controlled ? value : internalValue;\n\n const setValue: Dispatch<SetStateAction<Value>> = useCallback(\n (next) => {\n const resolved = typeof next === \"function\"\n ? (next as (previous: Value) => Value)(currentValue)\n : next;\n if (!controlled) setInternalValue(resolved);\n if (!Object.is(resolved, currentValue)) onChange?.(resolved);\n },\n [controlled, currentValue, onChange],\n );\n\n return [currentValue, setValue] as const;\n}\n\nfunction subscribeWindowResize(callback: () => void): () => void {\n window.addEventListener(\"resize\", callback);\n return () => window.removeEventListener(\"resize\", callback);\n}\n\nfunction getWindowWidth(): number {\n return window.innerWidth;\n}\n\nfunction getServerWindowWidth(): number {\n return 0;\n}\n\nexport function useWindowWidth(): number {\n return useSyncExternalStore(\n subscribeWindowResize,\n getWindowWidth,\n getServerWindowWidth,\n );\n}\n\nexport function useElementWidth<Element extends HTMLElement>(\n externalRef?: Ref<Element>,\n): readonly [number | undefined, (node: Element | null) => void] {\n const [node, setNode] = useState<Element | null>(null);\n const [width, setWidth] = useState<number>();\n const ref = useCallback(\n (nextNode: Element | null) => {\n setNode(nextNode);\n assignRef(externalRef, nextNode);\n },\n [externalRef],\n );\n\n useEffect(() => {\n if (!node) return;\n const update = () => setWidth(node.getBoundingClientRect().width);\n update();\n if (typeof ResizeObserver === \"undefined\") {\n window.addEventListener(\"resize\", update);\n return () => window.removeEventListener(\"resize\", update);\n }\n const observer = new ResizeObserver(update);\n observer.observe(node);\n return () => observer.disconnect();\n }, [node]);\n\n return [width, ref] as const;\n}\n\n// This existing helper module is already used by provider and granular selection.\n// Keeping resolved data here avoids importing provider recipes or all preset packs.\nexport const DesignProfileContext = createContext<HjmDesignProfile | undefined>(undefined);\nexport function useDesignProfileDefaults(): HjmDesignProfile | undefined {\n return useContext(DesignProfileContext);\n}\n"]}
|
package/dist/layout.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../src/layout.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,OAAO,EACb,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAIL,KAAK,iBAAiB,EACvB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,WAAW,EACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,cAAc,EAEnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,GAAG,EACT,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEtE,YAAY,EACV,cAAc,EACd,aAAa,EACb,WAAW,GACZ,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EACV,UAAU,EACV,SAAS,EACT,QAAQ,EACR,YAAY,EAC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Q,CAAC;IACP,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjC,gGAAgG;IAChG,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAEL,+EAA+E;AAC/E,eAAO,MAAM,OAAO;YAVR,SAAS;kBACH,SAAS;aACd,SAAS;cACR,SAAS;mBACJ,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;IAChC,gGAAgG;kBAClF,uBAAuB;gDAuCvC,CAAC;AAEH,YAAY,EAAE,OAAO,EAAE,CAAC;AACxB,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,aAAa,EAAE,CAAC"}
|
package/dist/layout.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useDesignProfileDefaults } from "./internal.js";
|
|
2
3
|
import { resolveGridLayout, } from "@hjmds/design-contracts/grid";
|
|
3
4
|
import { resolveAspectRatioDescriptor, } from "@hjmds/design-contracts/components/aspect-ratio";
|
|
4
5
|
import { resolveContainerDescriptor, } from "@hjmds/design-contracts/components/container";
|
|
@@ -89,7 +90,9 @@ export const Layout = forwardRef(function Layout({ children, header, footer, sid
|
|
|
89
90
|
...mainStyle,
|
|
90
91
|
}, children: children }), hasFooter ? (_jsx("footer", { ...restFooterProps, className: classNames("hjm-layout__footer", footerClassName), children: footer })) : null] }));
|
|
91
92
|
});
|
|
92
|
-
export const Text = forwardRef(function Text({ as = "span", variant = textRecipe.defaults.variant, tone = textRecipe.defaults.tone, emphasis
|
|
93
|
+
export const Text = forwardRef(function Text({ as = "span", variant = textRecipe.defaults.variant, tone = textRecipe.defaults.tone, emphasis: suppliedEmphasis, className, layoutStyle, style, ...props }, ref) {
|
|
94
|
+
const profile = useDesignProfileDefaults();
|
|
95
|
+
const emphasis = suppliedEmphasis ?? textRecipe.defaults.emphasis;
|
|
93
96
|
return createElement(as, {
|
|
94
97
|
...props,
|
|
95
98
|
ref,
|
|
@@ -98,7 +101,7 @@ export const Text = forwardRef(function Text({ as = "span", variant = textRecipe
|
|
|
98
101
|
"data-tone": tone,
|
|
99
102
|
"data-emphasis": emphasis,
|
|
100
103
|
// Placement wins over the legacy `style`, matching Surface's ordering.
|
|
101
|
-
style: { ...style, ...layoutStyle },
|
|
104
|
+
style: { ...style, ...layoutStyle, ...(profile && suppliedEmphasis === undefined ? { fontWeight: profile.tokens.typography[variant].fontWeight } : {}) },
|
|
102
105
|
});
|
|
103
106
|
});
|
|
104
107
|
export const Surface = forwardRef(function Surface({ as = "div", tone = surfaceDefaults.tone, bordered, padding = surfaceDefaults.padding, radius = surfaceDefaults.radius, className, layoutStyle, style, ...props }, ref) {
|
|
@@ -116,7 +119,7 @@ export const Surface = forwardRef(function Surface({ as = "div", tone = surfaceD
|
|
|
116
119
|
"data-radius": radius,
|
|
117
120
|
style: {
|
|
118
121
|
padding: surfaceGeometry.paddings[padding],
|
|
119
|
-
borderRadius:
|
|
122
|
+
borderRadius: `var(--hjm-radius-${radius})`,
|
|
120
123
|
...style,
|
|
121
124
|
...layoutStyle,
|
|
122
125
|
},
|