@hjmds/react 1.34.0 → 1.35.1
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/actions.d.ts +23 -2
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +61 -6
- package/dist/actions.js.map +1 -1
- package/dist/advanced-display.d.ts +35 -2
- package/dist/advanced-display.d.ts.map +1 -1
- package/dist/advanced-display.js +28 -9
- package/dist/advanced-display.js.map +1 -1
- package/dist/anchor.d.ts +3 -1
- package/dist/anchor.d.ts.map +1 -1
- package/dist/anchor.js +5 -5
- package/dist/anchor.js.map +1 -1
- package/dist/auth-screen.d.ts.map +1 -1
- package/dist/auth-screen.js +5 -2
- package/dist/auth-screen.js.map +1 -1
- package/dist/avatar-blobatar-motion.d.ts.map +1 -1
- package/dist/avatar-blobatar-motion.js +2 -1
- package/dist/avatar-blobatar-motion.js.map +1 -1
- package/dist/avatar-blobatar.d.ts.map +1 -1
- package/dist/avatar-blobatar.js +2 -1
- package/dist/avatar-blobatar.js.map +1 -1
- package/dist/bottom-cta.d.ts +8 -1
- package/dist/bottom-cta.d.ts.map +1 -1
- package/dist/bottom-cta.js +6 -2
- package/dist/bottom-cta.js.map +1 -1
- package/dist/carousel-motion.d.ts.map +1 -1
- package/dist/carousel-motion.js +11 -2
- package/dist/carousel-motion.js.map +1 -1
- package/dist/carousel.d.ts +10 -0
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +23 -7
- package/dist/carousel.js.map +1 -1
- package/dist/collapsible.d.ts +6 -0
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +22 -20
- package/dist/collapsible.js.map +1 -1
- package/dist/collection-editing.d.ts +3 -1
- package/dist/collection-editing.d.ts.map +1 -1
- package/dist/collection-editing.js +5 -5
- package/dist/collection-editing.js.map +1 -1
- package/dist/collection-rail.d.ts +4 -4
- package/dist/collection-rail.d.ts.map +1 -1
- package/dist/collection-rail.js.map +1 -1
- package/dist/conversation-row.d.ts.map +1 -1
- package/dist/conversation-row.js +4 -1
- package/dist/conversation-row.js.map +1 -1
- package/dist/data-table.d.ts +2 -0
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +2 -2
- package/dist/data-table.js.map +1 -1
- package/dist/display.d.ts +60 -5
- package/dist/display.d.ts.map +1 -1
- package/dist/display.js +32 -9
- package/dist/display.js.map +1 -1
- package/dist/evidence.d.ts +1 -1
- package/dist/evidence.d.ts.map +1 -1
- package/dist/evidence.js +2 -1
- package/dist/evidence.js.map +1 -1
- package/dist/feedback.d.ts +5 -0
- package/dist/feedback.d.ts.map +1 -1
- package/dist/feedback.js +7 -5
- package/dist/feedback.js.map +1 -1
- package/dist/floating-action-button.js +1 -1
- package/dist/floating-action-button.js.map +1 -1
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js +4 -4
- package/dist/forms.js.map +1 -1
- package/dist/image-choice.js +3 -3
- package/dist/image-choice.js.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/initial-focus.d.ts +6 -0
- package/dist/internal/initial-focus.d.ts.map +1 -1
- package/dist/internal/initial-focus.js +6 -0
- package/dist/internal/initial-focus.js.map +1 -1
- package/dist/internal/pending-content.d.ts +19 -0
- package/dist/internal/pending-content.d.ts.map +1 -0
- package/dist/internal/pending-content.js +34 -0
- package/dist/internal/pending-content.js.map +1 -0
- package/dist/internal/screen-footer.d.ts +4 -2
- package/dist/internal/screen-footer.d.ts.map +1 -1
- package/dist/internal/screen-footer.js +2 -2
- package/dist/internal/screen-footer.js.map +1 -1
- package/dist/internal.d.ts +9 -1
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +4 -0
- package/dist/internal.js.map +1 -1
- package/dist/navigation.d.ts.map +1 -1
- package/dist/navigation.js +58 -4
- package/dist/navigation.js.map +1 -1
- package/dist/number-field.d.ts.map +1 -1
- package/dist/number-field.js +4 -3
- package/dist/number-field.js.map +1 -1
- package/dist/overlays.d.ts +4 -0
- package/dist/overlays.d.ts.map +1 -1
- package/dist/overlays.js +46 -18
- package/dist/overlays.js.map +1 -1
- package/dist/public-exports.generated.d.ts +6 -0
- package/dist/public-exports.generated.d.ts.map +1 -1
- package/dist/public-exports.generated.js +18 -0
- package/dist/public-exports.generated.js.map +1 -1
- package/dist/screen-flows.d.ts +13 -5
- package/dist/screen-flows.d.ts.map +1 -1
- package/dist/screen-flows.js +25 -14
- package/dist/screen-flows.js.map +1 -1
- package/dist/screens.d.ts +18 -5
- package/dist/screens.d.ts.map +1 -1
- package/dist/screens.js +22 -11
- package/dist/screens.js.map +1 -1
- package/dist/selection.d.ts +22 -0
- package/dist/selection.d.ts.map +1 -1
- package/dist/selection.js +32 -9
- package/dist/selection.js.map +1 -1
- package/dist/shortcut-rail.d.ts +27 -0
- package/dist/shortcut-rail.d.ts.map +1 -0
- package/dist/shortcut-rail.js +37 -0
- package/dist/shortcut-rail.js.map +1 -0
- package/dist/steps.d.ts +5 -2
- package/dist/steps.d.ts.map +1 -1
- package/dist/steps.js +3 -3
- package/dist/steps.js.map +1 -1
- package/dist/styles.css +223 -48
- package/dist/styles.layered.css +223 -48
- package/dist/task-list.d.ts +3 -1
- package/dist/task-list.d.ts.map +1 -1
- package/dist/task-list.js +2 -2
- package/dist/task-list.js.map +1 -1
- package/dist/theme.d.ts.map +1 -1
- package/dist/theme.js +1 -0
- package/dist/theme.js.map +1 -1
- package/dist/time-picker.d.ts +9 -0
- package/dist/time-picker.d.ts.map +1 -0
- package/dist/time-picker.js +74 -0
- package/dist/time-picker.js.map +1 -0
- package/dist/top-bar.d.ts +4 -0
- package/dist/top-bar.d.ts.map +1 -1
- package/dist/top-bar.js +2 -2
- package/dist/top-bar.js.map +1 -1
- package/package.json +26 -15
package/dist/evidence.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evidence.js","sourceRoot":"","sources":["../src/evidence.ts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AC,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,aAAa,EAAE,kCAAkC;IACjD,WAAW,EAAE,cAAc;IAC3B,cAAc,EAAE,QAAQ;IACxB,OAAO,EAAE,KAAK;IACd,UAAU,EAAE,gBAAgB,CAAC,GAAG,CAAC,YAAY,CAAC;CACE,CAAC","sourcesContent":["import type { ShowcaseScenarioId } from \"@hjmds/design-contracts/showcase\";\nimport { getRequiredShowcaseEvidence } from \"@hjmds/design-contracts/showcase\";\nimport { componentCatalog, componentIdOf, getComponentSurfaceStatus, type ComponentCatalogEntry } from \"@hjmds/design-contracts/catalog\";\nimport { publicExportEntries } from \"./public-exports.generated.js\";\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;\nconst stableCoreProofFile = \"test/stable-core.browser.test.tsx\" as const;\n\ntype ProofFile = `test/${string}.test.tsx`;\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. Stable surfaces cannot carry a gap\n * (scripts/check-workspace-sync.mjs).\n */\nconst webScenarioGaps: Readonly<Record<string, readonly ReactRendererEvidenceScenario[]>> = {};\n\n/**\n * Proofs that live outside the shared default/matrix files: keyboard behavior in a dedicated browser test,\n * long copy proven inside a portal by the component's own test, or a whole matrix run in a component file.\n * Everything else about a claim derives from the catalog row (2026-10-18 registration input).\n */\ntype ClaimExtras = Readonly<{\n /** Extra proofs; their scenarios are removed from the shared matrix proof. */\n proofs?: readonly Readonly<{ scenarios: readonly ReactRendererEvidenceScenario[]; file: ProofFile }>[];\n /** Hooks or helpers published beside the component symbols on the same subpath. */\n exportNames?: readonly string[];\n}>;\n\nconst keyboard = (file: ProofFile = stableCoreProofFile): ClaimExtras => ({ proofs: [{ scenarios: [\"keyboard\"], file }] });\nconst keyboardAndLongCopy = (file: ProofFile): ClaimExtras => ({ proofs: [{ scenarios: [\"keyboard\", \"long-copy\"], file }] });\n\nconst claimExtras: Readonly<Record<string, ClaimExtras>> = {\n \"design-system-provider\": { exportNames: [\"useHjmTheme\"] },\n layout: keyboard(),\n link: keyboard(),\n field: keyboard(),\n \"search-field\": keyboard(),\n \"password-field\": keyboard(),\n \"otp-field\": keyboard(),\n \"number-field\": keyboard(),\n slider: keyboard(),\n form: keyboard(\"test/form.keyboard.browser.test.tsx\"),\n \"date-picker\": keyboard(),\n calendar: keyboard(\"test/calendar.browser.test.tsx\"),\n \"file-picker\": keyboard(\"test/file-picker.keyboard.browser.test.tsx\"),\n checkbox: keyboard(),\n \"checkbox-group\": keyboard(),\n \"radio-group\": keyboard(),\n switch: keyboard(),\n \"segmented-control\": keyboard(),\n chip: keyboard(),\n tabs: keyboard(\"test/tabs.keyboard.browser.test.tsx\"),\n breadcrumb: keyboard(\"test/page-navigation.browser.test.tsx\"),\n pagination: keyboard(\"test/pagination.keyboard.browser.test.tsx\"),\n popover: keyboardAndLongCopy(\"test/popover.browser.test.tsx\"),\n \"side-panel\": keyboardAndLongCopy(\"test/side-panel.browser.test.tsx\"),\n splitter: keyboard(\"test/splitter.browser.test.tsx\"),\n tour: keyboardAndLongCopy(\"test/tour.browser.test.tsx\"),\n tree: keyboard(\"test/tree.browser.test.tsx\"),\n \"transfer-list\": keyboard(\"test/transfer-list.browser.test.tsx\"),\n mentions: keyboard(\"test/mentions.browser.test.tsx\"),\n \"command-palette\": keyboardAndLongCopy(\"test/command-palette.browser.test.tsx\"),\n agreement: keyboard(\"test/agreement.keyboard.browser.test.tsx\"),\n \"toggle-group\": keyboard(),\n \"tags-input\": keyboard(),\n \"skip-nav\": keyboardAndLongCopy(\"test/skip-nav.browser.test.tsx\"),\n sidebar: keyboard(\"test/sidebar.browser.test.tsx\"),\n \"date-range-picker\": keyboard(\"test/date-range.keyboard.browser.test.tsx\"),\n \"auth-provider-button\": keyboard(),\n \"data-table\": keyboard(\"test/data-table.keyboard.browser.test.tsx\"),\n collapsible: keyboard(\"test/collapsible.keyboard.browser.test.tsx\"),\n \"context-menu\": keyboardAndLongCopy(\"test/context-menu.interactions.browser.test.tsx\"),\n menubar: keyboard(\"test/menubar.keyboard.browser.test.tsx\"),\n anchor: keyboard(\"test/anchor.browser.test.tsx\"),\n \"bottom-navigation\": keyboard(\"test/bottom-navigation.keyboard.browser.test.tsx\"),\n \"load-more\": keyboard(\"test/load-more.interactions.browser.test.tsx\"),\n carousel: keyboard(\"test/carousel.browser.test.tsx\"),\n \"floating-action-button\": keyboard(),\n accordion: keyboard(\"test/accordion.keyboard.browser.test.tsx\"),\n \"upload-item\": keyboard(\"test/upload-item.browser.test.tsx\"),\n // ThinkingOrb runs its whole environment matrix in its own file (canvas timing), not in scenario-matrix.\n \"thinking-orb\": { proofs: [{ scenarios: [\"dark\", \"large-text\", \"rtl\", \"reduced-motion\", \"accessibility\"], file: \"test/thinking-orb.browser.test.tsx\" }] },\n \"color-picker\": keyboard(\"test/web-additions.browser.test.tsx\"),\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 toast: {\n exportNames: [\"useToast\"],\n proofs: [\n { scenarios: [\"keyboard\"], file: stableCoreProofFile },\n { scenarios: [\"dark\", \"long-copy\", \"large-text\", \"rtl\"], file: \"test/toast-layout.browser.test.tsx\" },\n ],\n },\n select: keyboard(),\n combobox: keyboard(),\n dialog: keyboard(\"test/advanced.browser.test.tsx\"),\n \"alert-dialog\": keyboardAndLongCopy(\"test/alert-dialog.keyboard.browser.test.tsx\"),\n sheet: keyboardAndLongCopy(\"test/sheet-layout.browser.test.tsx\"),\n tooltip: keyboard(\"test/tooltip.browser.test.tsx\"),\n menu: keyboardAndLongCopy(\"test/menu.keyboard.browser.test.tsx\"),\n};\n\nconst exportEntries: Readonly<Record<string, readonly `./${string}`[] | undefined>> = publicExportEntries;\n\n/**\n * One claim per active Web row of the catalog. The subpath is the symbol's canonical granular entry, the export\n * names are the row's own symbol plus the companions published on that entry, and the scenarios are the row's\n * required Web evidence minus recorded gaps. Keyboard is never implied: it comes only from a dedicated proof.\n */\nfunction derivedClaim(entry: ComponentCatalogEntry): ReactRendererEvidenceComponent {\n const componentId = componentIdOf(entry);\n const extras = claimExtras[componentId] ?? {};\n const symbols = entry.name === \"DesignSystemProvider\" ? [\"HjmProvider\"] : [entry.name, ...(entry.companions ?? [])];\n // A row whose own name is not a symbol (Chart) claims through its first published companion.\n const subpath = symbols.map((symbol) => exportEntries[symbol]?.[0]).find((entry) => entry !== undefined);\n if (!subpath) throw new Error(`${entry.name} has no granular @hjmds/react export to claim evidence on`);\n const exportNames = [\n ...symbols.filter((symbol) => exportEntries[symbol]?.includes(subpath)),\n ...(extras.exportNames ?? []),\n ];\n const required = getRequiredShowcaseEvidence(entry).find((evidence) => evidence.surface === \"web\")?.scenarios ?? [];\n const gaps = webScenarioGaps[componentId] ?? [];\n const extraProofs = extras.proofs ?? [];\n const proven = new Set(extraProofs.flatMap((proof) => proof.scenarios));\n const matrix = required.filter((scenario): scenario is ReactRendererEvidenceScenario =>\n scenario !== \"default\" && scenario !== \"keyboard\" && scenario !== \"native-actions\" && scenario !== \"contract\"\n && !gaps.includes(scenario as ReactRendererEvidenceScenario) && !proven.has(scenario as ReactRendererEvidenceScenario));\n const proofs = [\n { scenarios: [\"default\" as const], file: defaultProofFile, caseId: componentId },\n ...(matrix.length === 0 ? [] : [{ scenarios: matrix, file: matrixProofFile, caseId: componentId }]),\n ...extraProofs.map((proof) => ({ ...proof, caseId: componentId })),\n ];\n return {\n componentId,\n exportNames,\n subpath,\n scenarios: proofs.flatMap((proof) => proof.scenarios),\n proofs,\n };\n}\n\nconst activeWebEntries: readonly ComponentCatalogEntry[] = componentCatalog.filter((entry) => {\n const status = getComponentSurfaceStatus(entry, \"web\");\n return status === \"stable\" || status === \"beta\";\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.34.0\",\n surface: \"web\",\n components: activeWebEntries.map(derivedClaim),\n} as const satisfies ReactRendererEvidenceManifest;\n"]}
|
|
1
|
+
{"version":3,"file":"evidence.js","sourceRoot":"","sources":["../src/evidence.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,yBAAyB,EAA8B,MAAM,iCAAiC,CAAC;AACzI,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAU,CAAC;AA6B7D,MAAM,gBAAgB,GAAG,kCAA2C,CAAC;AACrE,MAAM,eAAe,GAAG,uCAAg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ase\";\nimport { getRequiredShowcaseEvidence } from \"@hjmds/design-contracts/showcase\";\nimport { componentCatalog, componentIdOf, getComponentSurfaceStatus, type ComponentCatalogEntry } from \"@hjmds/design-contracts/catalog\";\nimport { publicExportEntries } from \"./public-exports.generated.js\";\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;\nconst stableCoreProofFile = \"test/stable-core.browser.test.tsx\" as const;\n\ntype ProofFile = `test/${string}.test.tsx`;\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. Stable surfaces cannot carry a gap\n * (scripts/check-workspace-sync.mjs).\n */\nconst webScenarioGaps: Readonly<Record<string, readonly ReactRendererEvidenceScenario[]>> = {};\n\n/**\n * Proofs that live outside the shared default/matrix files: keyboard behavior in a dedicated browser test,\n * long copy proven inside a portal by the component's own test, or a whole matrix run in a component file.\n * Everything else about a claim derives from the catalog row (2026-10-18 registration input).\n */\ntype ClaimExtras = Readonly<{\n /** Extra proofs; their scenarios are removed from the shared matrix proof. */\n proofs?: readonly Readonly<{ scenarios: readonly ReactRendererEvidenceScenario[]; file: ProofFile }>[];\n /** Hooks or helpers published beside the component symbols on the same subpath. */\n exportNames?: readonly string[];\n}>;\n\nconst keyboard = (file: ProofFile = stableCoreProofFile): ClaimExtras => ({ proofs: [{ scenarios: [\"keyboard\"], file }] });\nconst keyboardAndLongCopy = (file: ProofFile): ClaimExtras => ({ proofs: [{ scenarios: [\"keyboard\", \"long-copy\"], file }] });\n\nconst claimExtras: Readonly<Record<string, ClaimExtras>> = {\n \"time-picker\": keyboard(\"test/time-picker.browser.test.tsx\"),\n \"design-system-provider\": { exportNames: [\"useHjmTheme\"] },\n layout: keyboard(),\n link: keyboard(),\n field: keyboard(),\n \"search-field\": keyboard(),\n \"password-field\": keyboard(),\n \"otp-field\": keyboard(),\n \"number-field\": keyboard(),\n slider: keyboard(),\n form: keyboard(\"test/form.keyboard.browser.test.tsx\"),\n \"date-picker\": keyboard(),\n calendar: keyboard(\"test/calendar.browser.test.tsx\"),\n \"file-picker\": keyboard(\"test/file-picker.keyboard.browser.test.tsx\"),\n checkbox: keyboard(),\n \"checkbox-group\": keyboard(),\n \"radio-group\": keyboard(),\n switch: keyboard(),\n \"segmented-control\": keyboard(),\n chip: keyboard(),\n tabs: keyboard(\"test/tabs.keyboard.browser.test.tsx\"),\n breadcrumb: keyboard(\"test/page-navigation.browser.test.tsx\"),\n pagination: keyboard(\"test/pagination.keyboard.browser.test.tsx\"),\n popover: keyboardAndLongCopy(\"test/popover.browser.test.tsx\"),\n \"side-panel\": keyboardAndLongCopy(\"test/side-panel.browser.test.tsx\"),\n splitter: keyboard(\"test/splitter.browser.test.tsx\"),\n tour: keyboardAndLongCopy(\"test/tour.browser.test.tsx\"),\n tree: keyboard(\"test/tree.browser.test.tsx\"),\n \"transfer-list\": keyboard(\"test/transfer-list.browser.test.tsx\"),\n mentions: keyboard(\"test/mentions.browser.test.tsx\"),\n \"command-palette\": keyboardAndLongCopy(\"test/command-palette.browser.test.tsx\"),\n agreement: keyboard(\"test/agreement.keyboard.browser.test.tsx\"),\n \"toggle-group\": keyboard(),\n \"tags-input\": keyboard(),\n \"skip-nav\": keyboardAndLongCopy(\"test/skip-nav.browser.test.tsx\"),\n sidebar: keyboard(\"test/sidebar.browser.test.tsx\"),\n \"date-range-picker\": keyboard(\"test/date-range.keyboard.browser.test.tsx\"),\n \"auth-provider-button\": keyboard(),\n \"data-table\": keyboard(\"test/data-table.keyboard.browser.test.tsx\"),\n collapsible: keyboard(\"test/collapsible.keyboard.browser.test.tsx\"),\n \"context-menu\": keyboardAndLongCopy(\"test/context-menu.interactions.browser.test.tsx\"),\n menubar: keyboard(\"test/menubar.keyboard.browser.test.tsx\"),\n anchor: keyboard(\"test/anchor.browser.test.tsx\"),\n \"bottom-navigation\": keyboard(\"test/bottom-navigation.keyboard.browser.test.tsx\"),\n \"load-more\": keyboard(\"test/load-more.interactions.browser.test.tsx\"),\n carousel: keyboard(\"test/carousel.browser.test.tsx\"),\n \"floating-action-button\": keyboard(),\n accordion: keyboard(\"test/accordion.keyboard.browser.test.tsx\"),\n \"upload-item\": keyboard(\"test/upload-item.browser.test.tsx\"),\n // ThinkingOrb runs its whole environment matrix in its own file (canvas timing), not in scenario-matrix.\n \"thinking-orb\": { proofs: [{ scenarios: [\"dark\", \"large-text\", \"rtl\", \"reduced-motion\", \"accessibility\"], file: \"test/thinking-orb.browser.test.tsx\" }] },\n \"color-picker\": keyboard(\"test/web-additions.browser.test.tsx\"),\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 toast: {\n exportNames: [\"useToast\"],\n proofs: [\n { scenarios: [\"keyboard\"], file: stableCoreProofFile },\n { scenarios: [\"dark\", \"long-copy\", \"large-text\", \"rtl\"], file: \"test/toast-layout.browser.test.tsx\" },\n ],\n },\n select: keyboard(),\n combobox: keyboard(),\n dialog: keyboard(\"test/advanced.browser.test.tsx\"),\n \"alert-dialog\": keyboardAndLongCopy(\"test/alert-dialog.keyboard.browser.test.tsx\"),\n sheet: keyboardAndLongCopy(\"test/sheet-layout.browser.test.tsx\"),\n tooltip: keyboard(\"test/tooltip.browser.test.tsx\"),\n menu: keyboardAndLongCopy(\"test/menu.keyboard.browser.test.tsx\"),\n};\n\nconst exportEntries: Readonly<Record<string, readonly `./${string}`[] | undefined>> = publicExportEntries;\n\n/**\n * One claim per active Web row of the catalog. The subpath is the symbol's canonical granular entry, the export\n * names are the row's own symbol plus the companions published on that entry, and the scenarios are the row's\n * required Web evidence minus recorded gaps. Keyboard is never implied: it comes only from a dedicated proof.\n */\nfunction derivedClaim(entry: ComponentCatalogEntry): ReactRendererEvidenceComponent {\n const componentId = componentIdOf(entry);\n const extras = claimExtras[componentId] ?? {};\n const symbols = entry.name === \"DesignSystemProvider\" ? [\"HjmProvider\"] : [entry.name, ...(entry.companions ?? [])];\n // A row whose own name is not a symbol (Chart) claims through its first published companion.\n const subpath = symbols.map((symbol) => exportEntries[symbol]?.[0]).find((entry) => entry !== undefined);\n if (!subpath) throw new Error(`${entry.name} has no granular @hjmds/react export to claim evidence on`);\n const exportNames = [\n ...symbols.filter((symbol) => exportEntries[symbol]?.includes(subpath)),\n ...(extras.exportNames ?? []),\n ];\n const required = getRequiredShowcaseEvidence(entry).find((evidence) => evidence.surface === \"web\")?.scenarios ?? [];\n const gaps = webScenarioGaps[componentId] ?? [];\n const extraProofs = extras.proofs ?? [];\n const proven = new Set(extraProofs.flatMap((proof) => proof.scenarios));\n const matrix = required.filter((scenario): scenario is ReactRendererEvidenceScenario =>\n scenario !== \"default\" && scenario !== \"keyboard\" && scenario !== \"native-actions\" && scenario !== \"contract\"\n && !gaps.includes(scenario as ReactRendererEvidenceScenario) && !proven.has(scenario as ReactRendererEvidenceScenario));\n const proofs = [\n { scenarios: [\"default\" as const], file: defaultProofFile, caseId: componentId },\n ...(matrix.length === 0 ? [] : [{ scenarios: matrix, file: matrixProofFile, caseId: componentId }]),\n ...extraProofs.map((proof) => ({ ...proof, caseId: componentId })),\n ];\n return {\n componentId,\n exportNames,\n subpath,\n scenarios: proofs.flatMap((proof) => proof.scenarios),\n proofs,\n };\n}\n\nconst activeWebEntries: readonly ComponentCatalogEntry[] = componentCatalog.filter((entry) => {\n const status = getComponentSurfaceStatus(entry, \"web\");\n return status === \"stable\" || status === \"beta\";\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.35.1\",\n surface: \"web\",\n components: activeWebEntries.map(derivedClaim),\n} as const satisfies ReactRendererEvidenceManifest;\n"]}
|
package/dist/feedback.d.ts
CHANGED
|
@@ -70,7 +70,11 @@ type ProgressName = Readonly<{
|
|
|
70
70
|
export type ProgressProps = Omit<ProgressHTMLAttributes<HTMLProgressElement>, "children" | "max" | "size" | "value" | "aria-label"> & ProgressName & Readonly<{
|
|
71
71
|
value?: number;
|
|
72
72
|
max?: number;
|
|
73
|
+
/** Equal visual units for determinate linear progress; fractions fill a partial unit. */
|
|
74
|
+
segments?: number;
|
|
73
75
|
valueText?: string;
|
|
76
|
+
/** Hide only the visible auxiliary value when the label already contains a count; accessibility keeps its value. */
|
|
77
|
+
showValue?: boolean;
|
|
74
78
|
size?: ProgressSize;
|
|
75
79
|
tone?: ProgressTone;
|
|
76
80
|
/**
|
|
@@ -124,4 +128,5 @@ export declare const Skeleton: import("react").ForwardRefExoticComponent<Omit<HT
|
|
|
124
128
|
layoutStyle?: HjmCompositionStyleProp;
|
|
125
129
|
}> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
126
130
|
export { ActivityChip, type ActivityChipProps } from "./activity-chip.js";
|
|
131
|
+
export { PendingContent, type PendingContentProps } from "./internal/pending-content.js";
|
|
127
132
|
//# sourceMappingURL=feedback.d.ts.map
|
package/dist/feedback.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../src/feedback.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,
|
|
1
|
+
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../src/feedback.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAIhB,cAAc,EACd,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AACf,OAAO,EAAgB,KAAK,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAItF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAMtE,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,GAClE,QAAQ,CAAC;IACP,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,gGAAgG;IAChG,WAAW,CAAC,EAAE,uBAAuB,CAAC;CACvC,CAAC,CAAC;AAEL,eAAO,MAAM,MAAM;WATR,SAAS;kBACF,SAAS;aACd,SAAS;WACX,SAAS;WACT,UAAU;IACjB,gGAAgG;kBAClF,uBAAuB;gDAqCvC,CAAC;AAEH,KAAK,iBA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a;eACV,OAAO;IAClB;;;OAGG;YACK,MAAM;IACd;;;OAGG;kBACW,WAAW;YACjB,MAAM,GAAG,MAAM;aACd,MAAM,GAAG,MAAM;IACxB,gGAAgG;kBAClF,uBAAuB;oDAkDxC,CAAC;AAKF,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/dist/feedback.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { emptyStateRecipe, noticeRecipe, progressRecipe, skeletonRecipe, } from "@hjmds/design-contracts/recipes";
|
|
2
|
+
import { emptyStateRecipe, noticeRecipe, progressRecipe, resolveProgressSegments, skeletonRecipe, } from "@hjmds/design-contracts/recipes";
|
|
3
3
|
import { resolveResultDescriptor, resultRecipe, } from "@hjmds/design-contracts/components/result";
|
|
4
4
|
import { forwardRef, useId, } from "react";
|
|
5
5
|
import { buttonRecipe } from "@hjmds/design-contracts/recipes/base";
|
|
@@ -8,7 +8,7 @@ import { Button } from "./actions.js";
|
|
|
8
8
|
import { Text } from "./layout.js";
|
|
9
9
|
export const Notice = forwardRef(function Notice({ title, description, action, icon, tone = noticeRecipe.defaults.tone, className, layoutStyle, ...props }, ref) {
|
|
10
10
|
const urgent = tone === "danger";
|
|
11
|
-
return (_jsxs("section", { ...props, style: { ...props.style, ...layoutStyle }, ref: ref, className: classNames("hjm-notice", className), "data-tone": tone, role: urgent ? "alert" : "status", "aria-live": urgent ? "assertive" : "polite", children: [icon ? _jsx("div", { className: "hjm-notice__icon", "aria-hidden": "true", children: icon }) : null, _jsxs("div", { className: "hjm-notice__content", children: [_jsx("strong", { className: "hjm-notice__title", children: title }), description ? _jsx("div", { className: "hjm-notice__description", children: description }) : null] }), action ? _jsx("div", { className: "hjm-notice__action", children: action }) : null] }));
|
|
11
|
+
return (_jsxs("section", { ...props, style: { ...props.style, ...layoutStyle }, ref: ref, className: classNames("hjm-notice", className), "data-tone": tone, role: urgent ? "alert" : "status", "aria-live": props["aria-live"] ?? (urgent ? "assertive" : "polite"), children: [icon ? _jsx("div", { className: "hjm-notice__icon", "aria-hidden": "true", children: icon }) : null, _jsxs("div", { className: "hjm-notice__content", children: [_jsx("strong", { className: "hjm-notice__title", children: title }), description ? _jsx("div", { className: "hjm-notice__description", children: description }) : null] }), action ? _jsx("div", { className: "hjm-notice__action", children: action }) : null] }));
|
|
12
12
|
});
|
|
13
13
|
export const EmptyState = forwardRef(function EmptyState({ title, description, action, icon, density = emptyStateRecipe.defaults.density, className, layoutStyle, ...props }, ref) {
|
|
14
14
|
return (_jsxs("div", { ...props, style: { ...props.style, ...layoutStyle }, ref: ref, className: classNames("hjm-empty-state", className), "data-density": density, role: "status", children: [icon ? _jsx("div", { className: "hjm-empty-state__icon", "aria-hidden": "true", children: icon }) : null, _jsx("strong", { className: "hjm-empty-state__title", children: title }), description ? _jsx("div", { className: "hjm-empty-state__description", children: description }) : null, action ? _jsx("div", { className: "hjm-empty-state__action", children: action }) : null] }));
|
|
@@ -24,7 +24,7 @@ export const Result = forwardRef(function Result({ status, title, description, a
|
|
|
24
24
|
const Heading = headingLevel === 1 ? "h1" : "h2";
|
|
25
25
|
return (_jsxs("div", { ...props, style: { ...props.style, ...layoutStyle }, ref: ref, className: classNames("hjm-result", className), "data-status": result.status, role: role ?? (result.status === "failure" ? "alert" : "status"), children: [_jsx("span", { className: "hjm-result__icon", "aria-hidden": "true", children: icon ?? resultRecipe.glyphs[result.status] }), _jsx(Heading, { className: "hjm-result__title", children: result.title }), result.description ? (_jsx("p", { className: "hjm-result__description", children: result.description })) : null, result.primaryAction || result.secondaryAction ? (_jsxs("div", { className: "hjm-result__actions", children: [result.secondaryAction ? (_jsx(Button, { "aria-label": result.secondaryAction.accessibilityLabel, onClick: result.secondaryAction.onAction, tone: "secondary", children: result.secondaryAction.label })) : null, result.primaryAction ? (_jsx(Button, { "aria-label": result.primaryAction.accessibilityLabel, onClick: result.primaryAction.onAction, children: result.primaryAction.label })) : null] })) : null] }));
|
|
26
26
|
});
|
|
27
|
-
export const Progress = forwardRef(function Progress({ label, value, valueText, max = progressRecipe.defaults.max, size = progressRecipe.defaults.size, tone = progressRecipe.defaults.tone, shape = progressRecipe.defaults.shape, children, className, layoutStyle, ...props }, ref) {
|
|
27
|
+
export const Progress = forwardRef(function Progress({ label, value, valueText, segments, showValue = progressRecipe.defaults.showValue, max = progressRecipe.defaults.max, size = progressRecipe.defaults.size, tone = progressRecipe.defaults.tone, shape = progressRecipe.defaults.shape, children, className, layoutStyle, ...props }, ref) {
|
|
28
28
|
if (typeof max !== "number" || !Number.isFinite(max) || max <= 0) {
|
|
29
29
|
throw new RangeError("Progress max must be a positive finite number");
|
|
30
30
|
}
|
|
@@ -32,13 +32,14 @@ export const Progress = forwardRef(function Progress({ label, value, valueText,
|
|
|
32
32
|
(!Number.isFinite(value) || value < 0 || value > max)) {
|
|
33
33
|
throw new RangeError("Progress value must be between zero and max");
|
|
34
34
|
}
|
|
35
|
+
const segmentFills = resolveProgressSegments(value, max, segments, shape);
|
|
35
36
|
const labelId = useId();
|
|
36
37
|
// usage/components/progress.md: valueText defaults to the percentage. Only Native applied it, so the same
|
|
37
38
|
// StepPlayer/ScrollProgress inputs showed "0%" on Native and nothing on Web (2026-10-17 review F N4).
|
|
38
39
|
const resolvedValueText = valueText ?? (value === undefined ? undefined : `${Math.round((value / max) * 100)}%`);
|
|
39
40
|
const diameter = progressRecipe.circular.sizes[size];
|
|
40
41
|
const strokeWidth = progressRecipe.circular.strokeWidth[size];
|
|
41
|
-
return (_jsxs("div", { className: classNames("hjm-progress", className), "data-size": size, "data-tone": tone, "data-shape": shape, "data-state": value === undefined ? "indeterminate" : "determinate",
|
|
42
|
+
return (_jsxs("div", { className: classNames("hjm-progress", className), "data-size": size, "data-tone": tone, "data-shape": shape, "data-segmented": segmentFills ? "true" : undefined, "data-state": value === undefined ? "indeterminate" : "determinate",
|
|
42
43
|
// `layoutStyle` lands on this frame, not on the native <progress> that
|
|
43
44
|
// receives the rest props, so placement moves the label and bar together.
|
|
44
45
|
style: shape === "circular" ? {
|
|
@@ -48,7 +49,7 @@ export const Progress = forwardRef(function Progress({ label, value, valueText,
|
|
|
48
49
|
// Conic sweep instead of an SVG arc: the same token drives both
|
|
49
50
|
// shapes and no second color pipeline appears.
|
|
50
51
|
"--hjm-progress-sweep": value === undefined ? "25%" : `${(value / max) * 100}%`,
|
|
51
|
-
} : layoutStyle, children: [label === undefined ? null : (_jsxs("span", { className: "hjm-progress__copy", children: [_jsx(Text, { id: labelId, variant: "label", children: label }), resolvedValueText ? _jsx(Text, { variant: "caption", tone: "muted", children: resolvedValueText }) : null] })), shape === "circular" ? (_jsx("span", { className: "hjm-progress__ring", "aria-hidden": "true", children: children ? _jsx("span", { className: "hjm-progress__ring-content", children: children }) : null })) : null, _jsx("progress", { ...props, ref: ref, className: "hjm-progress__native", max: max, ...(value === undefined ? {} : { value }), "aria-labelledby": props["aria-labelledby"] ?? (props["aria-label"] === undefined ? labelId : undefined), "aria-valuetext": resolvedValueText })] }));
|
|
52
|
+
} : layoutStyle, children: [label === undefined ? null : (_jsxs("span", { className: "hjm-progress__copy", children: [_jsx(Text, { id: labelId, variant: "label", children: label }), showValue && resolvedValueText ? _jsx(Text, { variant: "caption", tone: "muted", children: resolvedValueText }) : null] })), shape === "circular" ? (_jsx("span", { className: "hjm-progress__ring", "aria-hidden": "true", children: children ? _jsx("span", { className: "hjm-progress__ring-content", children: children }) : null })) : null, segmentFills ? _jsx("span", { className: "hjm-progress__segments", "aria-hidden": "true", style: { gap: progressRecipe.segmented.gap, height: progressRecipe.sizes[size] }, children: segmentFills.map((fill, index) => _jsx("span", { children: _jsx("i", { style: { width: `${fill * 100}%` } }) }, index)) }) : null, _jsx("progress", { ...props, ref: ref, className: "hjm-progress__native", max: max, ...(value === undefined ? {} : { value }), "aria-labelledby": props["aria-labelledby"] ?? (props["aria-label"] === undefined ? labelId : undefined), "aria-valuetext": resolvedValueText })] }));
|
|
52
53
|
});
|
|
53
54
|
export { Spinner } from "./internal/spinner.js";
|
|
54
55
|
export const Skeleton = forwardRef(function Skeleton({ shape = skeletonRecipe.defaults.shape, animated = skeletonRecipe.defaults.animated, lines = skeletonRecipe.defaults.lines, buttonShape = buttonRecipe.defaults.shape, width, height, className, style, layoutStyle, ...props }, ref) {
|
|
@@ -63,4 +64,5 @@ export const Skeleton = forwardRef(function Skeleton({ shape = skeletonRecipe.de
|
|
|
63
64
|
// apps can import it from an existing subpath: Next dev with HJM_LOCAL_SOURCE rejected the new ./activity-chip
|
|
64
65
|
// subpath before aliasing because the installed release lacks it (BurnTok 2026-10-10).
|
|
65
66
|
export { ActivityChip } from "./activity-chip.js";
|
|
67
|
+
export { PendingContent } from "./internal/pending-content.js";
|
|
66
68
|
//# sourceMappingURL=feedback.js.map
|
package/dist/feedback.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback.js","sourceRoot":"","sources":["../src/feedback.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,GAKf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,uBAAuB,EACvB,YAAY,GAEb,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,UAAU,EACV,KAAK,GAKN,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAoB,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAkBnC,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAA2B,SAAS,MAAM,CACxE,EACE,KAAK,EACL,WAAW,EACX,MAAM,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,IAAI,SAAS,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,IAApH,KAAK,CAAmH,CACpI,CAAC,GACG,CACR,CAAC;IACJ,CAAC;IACD,OAAO,CACL,kBACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,SAAS,CAAC,gBACpC,KAAK,uBACE,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,mBAChD,QAAQ,iBACX,MAAM,EAClB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,WAAW,EAAE,GAClD,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,oHAAoH;AACpH,+GAA+G;AAC/G,uFAAuF;AACvF,OAAO,EAAE,YAAY,EAA0B,MAAM,oBAAoB,CAAC","sourcesContent":["import {\n emptyStateRecipe,\n noticeRecipe,\n progressRecipe,\n skeletonRecipe,\n type NoticeTone,\n type ProgressShape,\n type ProgressSize,\n type ProgressTone,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n resolveResultDescriptor,\n resultRecipe,\n type ResultDescriptor,\n} from \"@hjmds/design-contracts/components/result\";\nimport {\n forwardRef,\n useId,\n type HTMLAttributes,\n type ProgressHTMLAttributes,\n type ReactNode,\n type CSSProperties,\n} from \"react\";\nimport { buttonRecipe, type ButtonShape } from \"@hjmds/design-contracts/recipes/base\";\nimport { classNames } from \"./internal.js\";\nimport { Button } from \"./actions.js\";\nimport { Text } from \"./layout.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\n// The HTML `title` attribute (tooltip string) shares its name with the heading slot.\n// Left in the intersection, `string & ReactNode` collapses the slot to `string`, so\n// consumers had to cast heading elements (BurnTok, 2026-09-27 audit). Omit it like\n// Result/Card/Section already do.\nexport type NoticeProps = Omit<HTMLAttributes<HTMLElement>, \"title\"> &\n Readonly<{\n title: ReactNode;\n description?: ReactNode;\n action?: ReactNode;\n icon?: ReactNode;\n tone?: NoticeTone;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const Notice = forwardRef<HTMLElement, NoticeProps>(function Notice(\n {\n title,\n description,\n action,\n icon,\n tone = noticeRecipe.defaults.tone,\n className,\n layoutStyle,\n ...props\n },\n ref,\n) {\n const urgent = tone === \"danger\";\n return (\n <section\n {...props}\n style={{ ...props.style, ...layoutStyle }}\n ref={ref}\n className={classNames(\"hjm-notice\", className)}\n data-tone={tone}\n role={urgent ? \"alert\" : \"status\"}\n aria-live={urgent ? \"assertive\" : \"polite\"}\n >\n {icon ? <div className=\"hjm-notice__icon\" aria-hidden=\"true\">{icon}</div> : null}\n <div className=\"hjm-notice__content\">\n <strong className=\"hjm-notice__title\">{title}</strong>\n {description ? <div className=\"hjm-notice__description\">{description}</div> : null}\n </div>\n {action ? <div className=\"hjm-notice__action\">{action}</div> : null}\n </section>\n );\n});\n\ntype EmptyStateDensity = keyof typeof emptyStateRecipe.density;\n\nexport type EmptyStateProps = Omit<HTMLAttributes<HTMLDivElement>, \"title\"> &\n Readonly<{\n title: ReactNode;\n description?: ReactNode;\n action?: ReactNode;\n icon?: ReactNode;\n density?: EmptyStateDensity;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const EmptyState = forwardRef<HTMLDivElement, EmptyStateProps>(\n function EmptyState(\n {\n title,\n description,\n action,\n icon,\n density = emptyStateRecipe.defaults.density,\n className,\n layoutStyle,\n ...props\n },\n ref,\n ) {\n return (\n <div\n {...props}\n style={{ ...props.style, ...layoutStyle }}\n ref={ref}\n className={classNames(\"hjm-empty-state\", className)}\n data-density={density}\n role=\"status\"\n >\n {icon ? <div className=\"hjm-empty-state__icon\" aria-hidden=\"true\">{icon}</div> : null}\n <strong className=\"hjm-empty-state__title\">{title}</strong>\n {description ? <div className=\"hjm-empty-state__description\">{description}</div> : null}\n {action ? <div className=\"hjm-empty-state__action\">{action}</div> : null}\n </div>\n );\n },\n);\n\nexport type ResultProps = Omit<\n HTMLAttributes<HTMLDivElement>,\n \"children\" | \"title\"\n> &\n ResultDescriptor &\n Readonly<{\n headingLevel?: 1 | 2;\n /** Optional product glyph; its meaning is already carried by title/status. */\n icon?: ReactNode;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\n/** A terminal flow outcome. EmptyState remains reserved for fillable content. */\nexport const Result = forwardRef<HTMLDivElement, ResultProps>(function Result(\n {\n status,\n title,\n description,\n actions,\n headingLevel = 2,\n icon,\n className,\n role,\n layoutStyle,\n ...props\n },\n ref,\n) {\n const result = resolveResultDescriptor({\n status,\n title,\n ...(description === undefined ? {} : { description }),\n ...(actions === undefined ? {} : { actions }),\n });\n const Heading = headingLevel === 1 ? \"h1\" : \"h2\";\n\n return (\n <div\n {...props}\n style={{ ...props.style, ...layoutStyle }}\n ref={ref}\n className={classNames(\"hjm-result\", className)}\n data-status={result.status}\n role={role ?? (result.status === \"failure\" ? \"alert\" : \"status\")}\n >\n <span className=\"hjm-result__icon\" aria-hidden=\"true\">\n {icon ?? resultRecipe.glyphs[result.status]}\n </span>\n <Heading className=\"hjm-result__title\">{result.title}</Heading>\n {result.description ? (\n <p className=\"hjm-result__description\">{result.description}</p>\n ) : null}\n {result.primaryAction || result.secondaryAction ? (\n <div className=\"hjm-result__actions\">\n {/* Button row rule (usage/components/button.md): secondary → primary, so the main action ends the row\n like Dialog footers. Until 2026-10-06 Result drew primary first, the reverse of every other action row. */}\n {result.secondaryAction ? (\n <Button\n aria-label={result.secondaryAction.accessibilityLabel}\n onClick={result.secondaryAction.onAction}\n tone=\"secondary\"\n >\n {result.secondaryAction.label}\n </Button>\n ) : null}\n {result.primaryAction ? (\n <Button\n aria-label={result.primaryAction.accessibilityLabel}\n onClick={result.primaryAction.onAction}\n >\n {result.primaryAction.label}\n </Button>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n});\n\n// Same naming contract as Native: a composition that already shows the label and value elsewhere (TargetSummary's\n// Statistic) names the bar with `aria-label` alone instead of printing the copy twice (2026-10-17 composition review).\ntype ProgressName =\n | Readonly<{ label: ReactNode; \"aria-label\"?: string }>\n | Readonly<{ label?: never; \"aria-label\": string }>;\n\nexport type ProgressProps = Omit<\n ProgressHTMLAttributes<HTMLProgressElement>,\n \"children\" | \"max\" | \"size\" | \"value\" | \"aria-label\"\n> &\n ProgressName &\n Readonly<{\n value?: number;\n max?: number;\n valueText?: string;\n size?: ProgressSize;\n tone?: ProgressTone;\n /**\n * `circular` draws the same value as a ring. It is a shape, not a second\n * component: min/max/now, the indeterminate case and the announcement are\n * identical, so the accessibility contract stays in one place.\n */\n shape?: ProgressShape;\n /** Content inside the ring — a percentage, a count, an icon. Ignored when linear. */\n children?: ReactNode;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const Progress = forwardRef<HTMLProgressElement, ProgressProps>(\n function Progress(\n {\n label,\n value,\n valueText,\n max = progressRecipe.defaults.max,\n size = progressRecipe.defaults.size,\n tone = progressRecipe.defaults.tone,\n shape = progressRecipe.defaults.shape,\n children,\n className,\n layoutStyle,\n ...props\n },\n ref,\n ) {\n if (typeof max !== \"number\" || !Number.isFinite(max) || max <= 0) {\n throw new RangeError(\"Progress max must be a positive finite number\");\n }\n if (\n value !== undefined &&\n (!Number.isFinite(value) || value < 0 || value > max)\n ) {\n throw new RangeError(\"Progress value must be between zero and max\");\n }\n const labelId = useId();\n // usage/components/progress.md: valueText defaults to the percentage. Only Native applied it, so the same\n // StepPlayer/ScrollProgress inputs showed \"0%\" on Native and nothing on Web (2026-10-17 review F N4).\n const resolvedValueText = valueText ?? (value === undefined ? undefined : `${Math.round((value / max) * 100)}%`);\n const diameter = progressRecipe.circular.sizes[size];\n const strokeWidth = progressRecipe.circular.strokeWidth[size];\n return (\n <div\n className={classNames(\"hjm-progress\", className)}\n data-size={size}\n data-tone={tone}\n data-shape={shape}\n data-state={value === undefined ? \"indeterminate\" : \"determinate\"}\n // `layoutStyle` lands on this frame, not on the native <progress> that\n // receives the rest props, so placement moves the label and bar together.\n style={shape === \"circular\" ? ({\n ...layoutStyle,\n \"--hjm-progress-diameter\": `${diameter}px`,\n \"--hjm-progress-stroke\": `${strokeWidth}px`,\n // Conic sweep instead of an SVG arc: the same token drives both\n // shapes and no second color pipeline appears.\n \"--hjm-progress-sweep\": value === undefined ? \"25%\" : `${(value / max) * 100}%`,\n } as CSSProperties) : layoutStyle}\n >\n {label === undefined ? null : (\n <span className=\"hjm-progress__copy\">\n {/* Label and value use the label/caption roles, as Native Progress does; both inherited body 16 before (2026-10-17 review). */}\n <Text id={labelId} variant=\"label\">{label}</Text>\n {resolvedValueText ? <Text variant=\"caption\" tone=\"muted\">{resolvedValueText}</Text> : null}\n </span>\n )}\n {shape === \"circular\" ? (\n <span className=\"hjm-progress__ring\" aria-hidden=\"true\">\n {children ? <span className=\"hjm-progress__ring-content\">{children}</span> : null}\n </span>\n ) : null}\n <progress\n {...props}\n ref={ref}\n className=\"hjm-progress__native\"\n max={max}\n {...(value === undefined ? {} : { value })}\n aria-labelledby={props[\"aria-labelledby\"] ?? (props[\"aria-label\"] === undefined ? labelId : undefined)}\n aria-valuetext={resolvedValueText}\n />\n </div>\n );\n },\n);\n\nexport { Spinner, type SpinnerProps } from \"./internal/spinner.js\";\n\ntype SkeletonShape = keyof typeof skeletonRecipe.shapes;\n\nexport type SkeletonProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n shape?: SkeletonShape;\n animated?: boolean;\n /**\n * `text` only: draw this many lines with the last one shorter (`skeletonRecipe.lines`), so a paragraph\n * placeholder is not rebuilt from loose bars in every product. `width` sizes the whole group.\n */\n lines?: number;\n /**\n * `button` only: the Button `shape` this placeholder stands in for (default: Button's default). Products that use\n * `shape=\"pill\"` buttons pass the same value so the placeholder matches (BurnTok, 2026-10-17).\n */\n buttonShape?: ButtonShape;\n width?: string | number;\n height?: string | number;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const Skeleton = forwardRef<HTMLSpanElement, SkeletonProps>(\n function Skeleton(\n {\n shape = skeletonRecipe.defaults.shape,\n animated = skeletonRecipe.defaults.animated,\n lines = skeletonRecipe.defaults.lines,\n buttonShape = buttonRecipe.defaults.shape,\n width,\n height,\n className,\n style,\n layoutStyle,\n ...props\n },\n ref,\n ) {\n const lineCount = shape === \"text\" ? Math.max(1, Math.floor(lines)) : 1;\n if (lineCount > 1) {\n // One pulse on the group keeps the lines in phase; the bars themselves do not animate.\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-skeleton-lines\", className)}\n data-animated={animated}\n aria-hidden=\"true\"\n style={{ width, ...style, ...layoutStyle }}\n >\n {Array.from({ length: lineCount }, (_, index) => (\n <span key={index} className=\"hjm-skeleton\" data-shape=\"text\" data-last={index === lineCount - 1 || undefined} style={{ height }} />\n ))}\n </span>\n );\n }\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-skeleton\", className)}\n data-shape={shape}\n data-button-shape={shape === \"button\" ? buttonShape : undefined}\n data-animated={animated}\n aria-hidden=\"true\"\n style={{ width, height, ...style, ...layoutStyle }}\n />\n );\n },\n);\n\n// ActivityChip is a feedback-category status trigger (its panel is the Toast in this module). Also exported here so\n// apps can import it from an existing subpath: Next dev with HJM_LOCAL_SOURCE rejected the new ./activity-chip\n// subpath before aliasing because the installed release lacks it (BurnTok 2026-10-10).\nexport { ActivityChip, type ActivityChipProps } from \"./activity-chip.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"feedback.js","sourceRoot":"","sources":["../src/feedback.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,cAAc,GAKf,MAAM,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,OAAO,CACL,kBACM,KAAK,EACT,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,SAAS,CAAC,gBACpC,KAAK,uBACE,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,mBAChD,QAAQ,iBACX,MAAM,EAClB,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,WAAW,EAAE,GAClD,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,oHAAoH;AACpH,+GAA+G;AAC/G,uFAAuF;AACvF,OAAO,EAAE,YAAY,EAA0B,MAAM,oBAAoB,CAAC;AAE1E,OAAO,EAAE,cAAc,EAA4B,MAAM,+BAA+B,CAAC","sourcesContent":["import {\n emptyStateRecipe,\n noticeRecipe,\n progressRecipe,\n resolveProgressSegments,\n skeletonRecipe,\n type NoticeTone,\n type ProgressShape,\n type ProgressSize,\n type ProgressTone,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n resolveResultDescriptor,\n resultRecipe,\n type ResultDescriptor,\n} from \"@hjmds/design-contracts/components/result\";\nimport {\n forwardRef,\n useId,\n type HTMLAttributes,\n type ProgressHTMLAttributes,\n type ReactNode,\n type CSSProperties,\n} from \"react\";\nimport { buttonRecipe, type ButtonShape } from \"@hjmds/design-contracts/recipes/base\";\nimport { classNames } from \"./internal.js\";\nimport { Button } from \"./actions.js\";\nimport { Text } from \"./layout.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\n\n// The HTML `title` attribute (tooltip string) shares its name with the heading slot.\n// Left in the intersection, `string & ReactNode` collapses the slot to `string`, so\n// consumers had to cast heading elements (BurnTok, 2026-09-27 audit). Omit it like\n// Result/Card/Section already do.\nexport type NoticeProps = Omit<HTMLAttributes<HTMLElement>, \"title\"> &\n Readonly<{\n title: ReactNode;\n description?: ReactNode;\n action?: ReactNode;\n icon?: ReactNode;\n tone?: NoticeTone;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const Notice = forwardRef<HTMLElement, NoticeProps>(function Notice(\n {\n title,\n description,\n action,\n icon,\n tone = noticeRecipe.defaults.tone,\n className,\n layoutStyle,\n ...props\n },\n ref,\n) {\n const urgent = tone === \"danger\";\n return (\n <section\n {...props}\n style={{ ...props.style, ...layoutStyle }}\n ref={ref}\n className={classNames(\"hjm-notice\", className)}\n data-tone={tone}\n role={urgent ? \"alert\" : \"status\"}\n // A background refresh can retain content while reporting danger. Honor the\n // public HTML live-region override instead of forcing every danger to interrupt.\n aria-live={props[\"aria-live\"] ?? (urgent ? \"assertive\" : \"polite\")}\n >\n {icon ? <div className=\"hjm-notice__icon\" aria-hidden=\"true\">{icon}</div> : null}\n <div className=\"hjm-notice__content\">\n <strong className=\"hjm-notice__title\">{title}</strong>\n {description ? <div className=\"hjm-notice__description\">{description}</div> : null}\n </div>\n {action ? <div className=\"hjm-notice__action\">{action}</div> : null}\n </section>\n );\n});\n\ntype EmptyStateDensity = keyof typeof emptyStateRecipe.density;\n\nexport type EmptyStateProps = Omit<HTMLAttributes<HTMLDivElement>, \"title\"> &\n Readonly<{\n title: ReactNode;\n description?: ReactNode;\n action?: ReactNode;\n icon?: ReactNode;\n density?: EmptyStateDensity;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const EmptyState = forwardRef<HTMLDivElement, EmptyStateProps>(\n function EmptyState(\n {\n title,\n description,\n action,\n icon,\n density = emptyStateRecipe.defaults.density,\n className,\n layoutStyle,\n ...props\n },\n ref,\n ) {\n return (\n <div\n {...props}\n style={{ ...props.style, ...layoutStyle }}\n ref={ref}\n className={classNames(\"hjm-empty-state\", className)}\n data-density={density}\n role=\"status\"\n >\n {icon ? <div className=\"hjm-empty-state__icon\" aria-hidden=\"true\">{icon}</div> : null}\n <strong className=\"hjm-empty-state__title\">{title}</strong>\n {description ? <div className=\"hjm-empty-state__description\">{description}</div> : null}\n {action ? <div className=\"hjm-empty-state__action\">{action}</div> : null}\n </div>\n );\n },\n);\n\nexport type ResultProps = Omit<\n HTMLAttributes<HTMLDivElement>,\n \"children\" | \"title\"\n> &\n ResultDescriptor &\n Readonly<{\n headingLevel?: 1 | 2;\n /** Optional product glyph; its meaning is already carried by title/status. */\n icon?: ReactNode;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\n/** A terminal flow outcome. EmptyState remains reserved for fillable content. */\nexport const Result = forwardRef<HTMLDivElement, ResultProps>(function Result(\n {\n status,\n title,\n description,\n actions,\n headingLevel = 2,\n icon,\n className,\n role,\n layoutStyle,\n ...props\n },\n ref,\n) {\n const result = resolveResultDescriptor({\n status,\n title,\n ...(description === undefined ? {} : { description }),\n ...(actions === undefined ? {} : { actions }),\n });\n const Heading = headingLevel === 1 ? \"h1\" : \"h2\";\n\n return (\n <div\n {...props}\n style={{ ...props.style, ...layoutStyle }}\n ref={ref}\n className={classNames(\"hjm-result\", className)}\n data-status={result.status}\n role={role ?? (result.status === \"failure\" ? \"alert\" : \"status\")}\n >\n <span className=\"hjm-result__icon\" aria-hidden=\"true\">\n {icon ?? resultRecipe.glyphs[result.status]}\n </span>\n <Heading className=\"hjm-result__title\">{result.title}</Heading>\n {result.description ? (\n <p className=\"hjm-result__description\">{result.description}</p>\n ) : null}\n {result.primaryAction || result.secondaryAction ? (\n <div className=\"hjm-result__actions\">\n {/* Button row rule (usage/components/button.md): secondary → primary, so the main action ends the row\n like Dialog footers. Until 2026-10-06 Result drew primary first, the reverse of every other action row. */}\n {result.secondaryAction ? (\n <Button\n aria-label={result.secondaryAction.accessibilityLabel}\n onClick={result.secondaryAction.onAction}\n tone=\"secondary\"\n >\n {result.secondaryAction.label}\n </Button>\n ) : null}\n {result.primaryAction ? (\n <Button\n aria-label={result.primaryAction.accessibilityLabel}\n onClick={result.primaryAction.onAction}\n >\n {result.primaryAction.label}\n </Button>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n});\n\n// Same naming contract as Native: a composition that already shows the label and value elsewhere (TargetSummary's\n// Statistic) names the bar with `aria-label` alone instead of printing the copy twice (2026-10-17 composition review).\ntype ProgressName =\n | Readonly<{ label: ReactNode; \"aria-label\"?: string }>\n | Readonly<{ label?: never; \"aria-label\": string }>;\n\nexport type ProgressProps = Omit<\n ProgressHTMLAttributes<HTMLProgressElement>,\n \"children\" | \"max\" | \"size\" | \"value\" | \"aria-label\"\n> &\n ProgressName &\n Readonly<{\n value?: number;\n max?: number;\n /** Equal visual units for determinate linear progress; fractions fill a partial unit. */\n segments?: number;\n valueText?: string;\n /** Hide only the visible auxiliary value when the label already contains a count; accessibility keeps its value. */\n showValue?: boolean;\n size?: ProgressSize;\n tone?: ProgressTone;\n /**\n * `circular` draws the same value as a ring. It is a shape, not a second\n * component: min/max/now, the indeterminate case and the announcement are\n * identical, so the accessibility contract stays in one place.\n */\n shape?: ProgressShape;\n /** Content inside the ring — a percentage, a count, an icon. Ignored when linear. */\n children?: ReactNode;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const Progress = forwardRef<HTMLProgressElement, ProgressProps>(\n function Progress(\n {\n label,\n value,\n valueText,\n segments,\n showValue = progressRecipe.defaults.showValue,\n max = progressRecipe.defaults.max,\n size = progressRecipe.defaults.size,\n tone = progressRecipe.defaults.tone,\n shape = progressRecipe.defaults.shape,\n children,\n className,\n layoutStyle,\n ...props\n },\n ref,\n ) {\n if (typeof max !== \"number\" || !Number.isFinite(max) || max <= 0) {\n throw new RangeError(\"Progress max must be a positive finite number\");\n }\n if (\n value !== undefined &&\n (!Number.isFinite(value) || value < 0 || value > max)\n ) {\n throw new RangeError(\"Progress value must be between zero and max\");\n }\n const segmentFills = resolveProgressSegments(value, max, segments, shape);\n const labelId = useId();\n // usage/components/progress.md: valueText defaults to the percentage. Only Native applied it, so the same\n // StepPlayer/ScrollProgress inputs showed \"0%\" on Native and nothing on Web (2026-10-17 review F N4).\n const resolvedValueText = valueText ?? (value === undefined ? undefined : `${Math.round((value / max) * 100)}%`);\n const diameter = progressRecipe.circular.sizes[size];\n const strokeWidth = progressRecipe.circular.strokeWidth[size];\n return (\n <div\n className={classNames(\"hjm-progress\", className)}\n data-size={size}\n data-tone={tone}\n data-shape={shape}\n data-segmented={segmentFills ? \"true\" : undefined}\n data-state={value === undefined ? \"indeterminate\" : \"determinate\"}\n // `layoutStyle` lands on this frame, not on the native <progress> that\n // receives the rest props, so placement moves the label and bar together.\n style={shape === \"circular\" ? ({\n ...layoutStyle,\n \"--hjm-progress-diameter\": `${diameter}px`,\n \"--hjm-progress-stroke\": `${strokeWidth}px`,\n // Conic sweep instead of an SVG arc: the same token drives both\n // shapes and no second color pipeline appears.\n \"--hjm-progress-sweep\": value === undefined ? \"25%\" : `${(value / max) * 100}%`,\n } as CSSProperties) : layoutStyle}\n >\n {label === undefined ? null : (\n <span className=\"hjm-progress__copy\">\n {/* Label and value use the label/caption roles, as Native Progress does; both inherited body 16 before (2026-10-17 review). */}\n <Text id={labelId} variant=\"label\">{label}</Text>\n {showValue && resolvedValueText ? <Text variant=\"caption\" tone=\"muted\">{resolvedValueText}</Text> : null}\n </span>\n )}\n {shape === \"circular\" ? (\n <span className=\"hjm-progress__ring\" aria-hidden=\"true\">\n {children ? <span className=\"hjm-progress__ring-content\">{children}</span> : null}\n </span>\n ) : null}\n {segmentFills ? <span className=\"hjm-progress__segments\" aria-hidden=\"true\" style={{ gap: progressRecipe.segmented.gap, height: progressRecipe.sizes[size] }}>\n {segmentFills.map((fill, index) => <span key={index}><i style={{ width: `${fill * 100}%` }} /></span>)}\n </span> : null}\n <progress\n {...props}\n ref={ref}\n className=\"hjm-progress__native\"\n max={max}\n {...(value === undefined ? {} : { value })}\n aria-labelledby={props[\"aria-labelledby\"] ?? (props[\"aria-label\"] === undefined ? labelId : undefined)}\n aria-valuetext={resolvedValueText}\n />\n </div>\n );\n },\n);\n\nexport { Spinner, type SpinnerProps } from \"./internal/spinner.js\";\n\ntype SkeletonShape = keyof typeof skeletonRecipe.shapes;\n\nexport type SkeletonProps = Omit<HTMLAttributes<HTMLSpanElement>, \"children\"> &\n Readonly<{\n shape?: SkeletonShape;\n animated?: boolean;\n /**\n * `text` only: draw this many lines with the last one shorter (`skeletonRecipe.lines`), so a paragraph\n * placeholder is not rebuilt from loose bars in every product. `width` sizes the whole group.\n */\n lines?: number;\n /**\n * `button` only: the Button `shape` this placeholder stands in for (default: Button's default). Products that use\n * `shape=\"pill\"` buttons pass the same value so the placeholder matches (BurnTok, 2026-10-17).\n */\n buttonShape?: ButtonShape;\n width?: string | number;\n height?: string | number;\n /** Canonical layout-only placement on the root element. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\nexport const Skeleton = forwardRef<HTMLSpanElement, SkeletonProps>(\n function Skeleton(\n {\n shape = skeletonRecipe.defaults.shape,\n animated = skeletonRecipe.defaults.animated,\n lines = skeletonRecipe.defaults.lines,\n buttonShape = buttonRecipe.defaults.shape,\n width,\n height,\n className,\n style,\n layoutStyle,\n ...props\n },\n ref,\n ) {\n const lineCount = shape === \"text\" ? Math.max(1, Math.floor(lines)) : 1;\n if (lineCount > 1) {\n // One pulse on the group keeps the lines in phase; the bars themselves do not animate.\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-skeleton-lines\", className)}\n data-animated={animated}\n aria-hidden=\"true\"\n style={{ width, ...style, ...layoutStyle }}\n >\n {Array.from({ length: lineCount }, (_, index) => (\n <span key={index} className=\"hjm-skeleton\" data-shape=\"text\" data-last={index === lineCount - 1 || undefined} style={{ height }} />\n ))}\n </span>\n );\n }\n return (\n <span\n {...props}\n ref={ref}\n className={classNames(\"hjm-skeleton\", className)}\n data-shape={shape}\n data-button-shape={shape === \"button\" ? buttonShape : undefined}\n data-animated={animated}\n aria-hidden=\"true\"\n style={{ width, height, ...style, ...layoutStyle }}\n />\n );\n },\n);\n\n// ActivityChip is a feedback-category status trigger (its panel is the Toast in this module). Also exported here so\n// apps can import it from an existing subpath: Next dev with HJM_LOCAL_SOURCE rejected the new ./activity-chip\n// subpath before aliasing because the installed release lacks it (BurnTok 2026-10-10).\nexport { ActivityChip, type ActivityChipProps } from \"./activity-chip.js\";\n\nexport { PendingContent, type PendingContentProps } from \"./internal/pending-content.js\";\n"]}
|
|
@@ -27,7 +27,7 @@ export const FloatingActionButton = forwardRef(function FloatingActionButton({ d
|
|
|
27
27
|
window.addEventListener("resize", measure);
|
|
28
28
|
return () => { observer.disconnect(); window.removeEventListener("resize", measure); };
|
|
29
29
|
}, [minimumClearance, safeAreaBottomInset, onContentClearanceChange]);
|
|
30
|
-
return _jsx(Button, { ...props, ref: (node) => { buttonRef.current = node; assignRef(forwardedRef, node); }, className: classNames("hjm-fab", className), size: "large", tone: "primary", shape: "pill", "data-mode": resolved.layoutMode, "data-direction": theme?.environment.direction ?? "ltr", "data-reduced-motion": theme?.environment.reducedMotion ?? false, "aria-label": resolved.resolvedAccessibilityLabel, style: { "--hjm-fab-diameter": `${recipe.circle.diameter}px`, "--hjm-fab-margin": `${recipe.margin}px`,
|
|
30
|
+
return _jsx(Button, { ...props, appearance: "flat", ref: (node) => { buttonRef.current = node; assignRef(forwardedRef, node); }, className: classNames("hjm-fab", className), size: "large", tone: "primary", shape: "pill", "data-mode": resolved.layoutMode, "data-direction": theme?.environment.direction ?? "ltr", "data-reduced-motion": theme?.environment.reducedMotion ?? false, "aria-label": resolved.resolvedAccessibilityLabel, style: { "--hjm-fab-diameter": `${recipe.circle.diameter}px`, "--hjm-fab-margin": `${recipe.margin}px`,
|
|
31
31
|
"--hjm-fab-safe-area": `${safeAreaBottomInset}px`, "--hjm-fab-duration": `${recipe.transition.duration}ms`,
|
|
32
32
|
"--hjm-fab-easing": `cubic-bezier(${easing[recipe.transition.easing].join(",")})`,
|
|
33
33
|
// Match other floating chrome under a profile; keep the stylesheet-only
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floating-action-button.js","sourceRoot":"","sources":["../src/floating-action-button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAC;AACpG,OAAO,EACL,0BAA0B,IAAI,MAAM,EAAE,qCAAqC,EAC3E,qCAAqC,EAAE,2CAA2C,GAEnF,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,MAAM,EAAoB,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,EAAE,2CAA2C,EAAE,CAAC;AAUvD,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAA+C,SAAS,oBAAoB,CAAC,EACzH,UAAU,EAAE,UAAU,EAAE,mBAAmB,GAAG,CAAC,EAAE,wBAAwB,EAAE,SAAS,EAAE,GAAG,KAAK,EAC/F,EAAE,YAAY;IACb,MAAM,QAAQ,GAAG,qCAAqC,CAAC,UAAU,CAAC,CAAC;IACnE,MAAM,KAAK,GAAG,mBAAmB,EAAE,CAAC;IACpC,MAAM,gBAAgB,GAAG,2CAA2C,CAAC,mBAAmB,CAAC,CAAC;IAC1F,MAAM,SAAS,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAC;IACzD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC;QACjC,IAAI,CAAC,MAAM;YAAE,OAAO;QACpB,MAAM,OAAO,GAAG,GAAG,EAAE;YACnB,MAAM,MAAM,GAAG,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC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O;YAC9D,MAAM,GAAG,MAAM,CAAC;YAChB,aAAa,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,qCAAqC,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,CAAC;QACvI,CAAC,CAAC;QACF,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/D,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC9D,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IACb,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import { forwardRef, useEffect, useRef, useState, type CSSProperties, type ReactNode } from \"react\";\nimport {\n floatingActionButtonRecipe as recipe, resolveFloatingActionButtonDescriptor,\n resolveFloatingActionButtonLayoutMode, resolveFloatingActionButtonContentClearance,\n type FloatingActionButtonDescriptor, type FloatingActionButtonLayoutMode,\n} from \"@hjmds/design-contracts/components/floating-action-button\";\nimport { glyph, easing } from \"@hjmds/design-contracts/foundations\";\nimport { Button, type ButtonProps } from \"./actions.js\";\nimport { assignRef, classNames } from \"./internal.js\";\nimport { useOptionalHjmTheme } from \"./provider.js\";\n\nexport { resolveFloatingActionButtonContentClearance };\n// No `layoutStyle`: fixed to the viewport corner with safe-area and content-clearance math the recipe owns; margins would desync `onContentClearanceChange`.\nexport type FloatingActionButtonProps = Pick<ButtonProps, \"onClick\" | \"onFocus\" | \"onBlur\" | \"id\" | \"className\"> & Readonly<{\n descriptor: FloatingActionButtonDescriptor;\n renderIcon: (icon: Readonly<{ name: string; size: number; color: string; decorative: true }>) => ReactNode;\n safeAreaBottomInset?: number;\n /** Apply this to the scroll content's bottom padding, including multiline labels. */\n onContentClearanceChange: (clearance: number) => void;\n}>;\n\n/** One persistent button preserves focus while its label collapses. */\nexport const FloatingActionButton = forwardRef<HTMLButtonElement, FloatingActionButtonProps>(function FloatingActionButton({\n descriptor, renderIcon, safeAreaBottomInset = 0, onContentClearanceChange, className, ...props\n}, forwardedRef) {\n const resolved = resolveFloatingActionButtonDescriptor(descriptor);\n const theme = useOptionalHjmTheme();\n const minimumClearance = resolveFloatingActionButtonContentClearance(safeAreaBottomInset);\n const buttonRef = useRef<HTMLButtonElement | null>(null);\n useEffect(() => {\n const button = buttonRef.current;\n if (!button) return;\n const measure = () => {\n const bottom = parseFloat(getComputedStyle(button).bottom);\n onContentClearanceChange(Math.max(minimumClearance, button.getBoundingClientRect().height\n + (Number.isFinite(bottom) ? bottom : recipe.margin + safeAreaBottomInset) + recipe.margin));\n };\n measure(); const observer = new ResizeObserver(measure); observer.observe(button);\n window.addEventListener(\"resize\", measure);\n return () => { observer.disconnect(); window.removeEventListener(\"resize\", measure); };\n }, [minimumClearance, safeAreaBottomInset, onContentClearanceChange]);\n return <Button {...props} appearance=\"flat\" ref={(node) => { buttonRef.current = node; assignRef(forwardedRef, node); }}\n className={classNames(\"hjm-fab\", className)} size=\"large\" tone=\"primary\" shape=\"pill\"\n data-mode={resolved.layoutMode} data-direction={theme?.environment.direction ?? \"ltr\"} data-reduced-motion={theme?.environment.reducedMotion ?? false} aria-label={resolved.resolvedAccessibilityLabel}\n style={{ \"--hjm-fab-diameter\": `${recipe.circle.diameter}px`, \"--hjm-fab-margin\": `${recipe.margin}px`,\n \"--hjm-fab-safe-area\": `${safeAreaBottomInset}px`, \"--hjm-fab-duration\": `${recipe.transition.duration}ms`,\n \"--hjm-fab-easing\": `cubic-bezier(${easing[recipe.transition.easing].join(\",\")})`,\n // Match other floating chrome under a profile; keep the stylesheet-only\n // legacy path rather than requiring a Provider for existing consumers.\n boxShadow: theme?.designProfile ? \"var(--hjm-shadow-floating)\"\n : `0 ${recipe.shadow.offsetY}px ${recipe.shadow.radius}px color-mix(in srgb, ${recipe.shadow.color} ${recipe.shadow.opacity * 100}%, transparent)` } as CSSProperties}\n leading={<span aria-hidden=\"true\" className=\"hjm-fab__icon\">{renderIcon({ name: resolved.icon.name, size: glyph[recipe.circle.glyph], color: \"currentColor\", decorative: true })}</span>}>\n {resolved.label}\n </Button>;\n});\n\n/** Omit target for window scrolling; null waits for a custom scroll element to mount. */\nexport function useFloatingActionButtonScroll(target?: HTMLElement | null): FloatingActionButtonLayoutMode {\n const [layoutMode, setLayoutMode] = useState<FloatingActionButtonLayoutMode>(\"expanded\");\n useEffect(() => {\n if (target === null) return;\n const source = target ?? window;\n let anchor = target?.scrollTop ?? window.scrollY;\n const onScroll = () => {\n const offset = Math.max(0, target?.scrollTop ?? window.scrollY);\n const delta = offset - anchor;\n // Half the edge margin ignores tiny trackpad tremors, but accumulates small\n // deltas until direction is clear instead of resetting on every frame.\n if (offset > 0 && Math.abs(delta) < recipe.margin / 2) return;\n anchor = offset;\n setLayoutMode((mode) => resolveFloatingActionButtonLayoutMode(offset === 0 || delta < 0 ? \"toward-start\" : \"away-from-start\", mode));\n };\n source.addEventListener(\"scroll\", onScroll, { passive: true });\n return () => source.removeEventListener(\"scroll\", onScroll);\n }, [target]);\n return layoutMode;\n}\n"]}
|
package/dist/forms.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../src/forms.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,YAAY,EAClB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAGL,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,oBAAoB,EAC1B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAWL,KAAK,cAAc,EACnB,KA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MAAM;oBACL,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;iBAC1B,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;WAC7B,YAAY;mBACJ,oBAAoB;WAC5B,OAAO;qDAqIjB,CAAC"}
|
package/dist/forms.js
CHANGED
|
@@ -4,7 +4,7 @@ import { iconRecipe, searchFieldRecipe, } from "@hjmds/design-contracts/recipes"
|
|
|
4
4
|
import { passwordFieldRecipe, resolvePasswordFieldDescriptor, } from "@hjmds/design-contracts/components/password-field";
|
|
5
5
|
import { getOtpFieldSlotValues, otpFieldRecipe, resolveOtpFieldValue, } from "@hjmds/design-contracts/components/otp-field";
|
|
6
6
|
import { createContext, forwardRef, useContext, useEffect, useId, useLayoutEffect, useRef, useState, } from "react";
|
|
7
|
-
import { composeRefs, classNames, useControllableState } from "./internal.js";
|
|
7
|
+
import { composeRefs, classNames, isAriaInvalid, useControllableState } from "./internal.js";
|
|
8
8
|
import { useInitialFocusTarget } from "./internal/initial-focus.js";
|
|
9
9
|
import { Icon } from "./supplemental-display.js";
|
|
10
10
|
import { FieldError } from "./internal/field-error.js";
|
|
@@ -31,7 +31,7 @@ function FieldFrame({ controlId, label, description, error, descriptionId, error
|
|
|
31
31
|
...(disabled && recipeOpacity !== undefined
|
|
32
32
|
? { "--hjm-field-disabled-opacity": recipeOpacity }
|
|
33
33
|
: {}),
|
|
34
|
-
}, className: classNames("hjm-field", className), "data-state": state, "data-variant": variant, "data-shape": shape, "data-align": align, children: [label !== undefined && label !== null ? (_jsxs("label", { className: "hjm-field__label", htmlFor: controlId, children: [label, required ? _jsx("span", { "aria-hidden": "true", children: " *" }) : null] })) : null, children, description ? (_jsx("div", { id: descriptionId, className: "hjm-field__description", children: description })) : null, _jsx(FieldError, { id: errorId, error: error })] }));
|
|
34
|
+
}, className: classNames("hjm-field", className), "data-state": state, "data-invalid": Boolean(error || invalid) || undefined, "data-variant": variant, "data-shape": shape, "data-align": align, children: [label !== undefined && label !== null ? (_jsxs("label", { className: "hjm-field__label", htmlFor: controlId, children: [label, required ? _jsx("span", { "aria-hidden": "true", children: " *" }) : null] })) : null, children, description ? (_jsx("div", { id: descriptionId, className: "hjm-field__description", children: description })) : null, _jsx(FieldError, { id: errorId, error: error })] }));
|
|
35
35
|
}
|
|
36
36
|
/** Generic frame for custom native controls; `controlId` keeps the label explicit. */
|
|
37
37
|
export function Field({ controlId, description, error, required = false, disabled = false, children, ...props }) {
|
|
@@ -94,7 +94,7 @@ export const TextField = forwardRef(function TextField({ id, label, description,
|
|
|
94
94
|
setFocused(false);
|
|
95
95
|
onBlur?.(event);
|
|
96
96
|
};
|
|
97
|
-
return (_jsx(FieldFrame, { controlId: ids.controlId, label: label, description: description, error: error, required: required ?? false, disabled: disabled ?? false, focused: focused, invalid: ariaInvalid
|
|
97
|
+
return (_jsx(FieldFrame, { controlId: ids.controlId, label: label, description: description, error: error, required: required ?? false, disabled: disabled ?? false, focused: focused, invalid: isAriaInvalid(ariaInvalid), variant: variant ?? fieldRecipe.defaults.variant, shape: shape ?? fieldRecipe.defaults.shape, align: align ?? fieldRecipe.defaults.align, className: fieldClassName, ...(layoutStyle === undefined ? {} : { layoutStyle }), ...(description ? { descriptionId: ids.descriptionId } : {}), ...(error ? { errorId: ids.errorId } : {}), children: _jsxs("div", { className: "hjm-field__control", children: [leading ? _jsx("span", { className: "hjm-field__affix", children: leading }) : null, _jsx("input", { ...props, ref: composeRefs(control, ref), id: ids.controlId, className: classNames("hjm-field__input", className), required: required, disabled: disabled, "aria-invalid": error ? true : ariaInvalid, "aria-label": ariaLabel, "aria-describedby": describedBy(ariaDescribedBy, description, error, ids.descriptionId, ids.errorId), onFocus: handleFocus, onBlur: handleBlur, onChange: (event) => {
|
|
98
98
|
onChange?.(event);
|
|
99
99
|
onValueChange?.(event.currentTarget.value);
|
|
100
100
|
} }), trailing ? _jsx("span", { className: "hjm-field__affix", children: trailing }) : null] }) }));
|
|
@@ -114,7 +114,7 @@ export const TextArea = forwardRef(function TextArea({ id, label, description, e
|
|
|
114
114
|
? {}
|
|
115
115
|
: { "--hjm-field-max-visible-lines": maxVisibleLines }),
|
|
116
116
|
};
|
|
117
|
-
return (_jsx(FieldFrame, { controlId: ids.controlId, label: label, description: description, error: error, required: required ?? false, disabled: disabled ?? false, focused: focused, variant: variant ?? fieldRecipe.defaults.variant, shape: shape ?? fieldRecipe.defaults.shape, align: align ?? fieldRecipe.defaults.align, className: fieldClassName, ...(layoutStyle === undefined ? {} : { layoutStyle }), ...(description ? { descriptionId: ids.descriptionId } : {}), ...(error ? { errorId: ids.errorId } : {}), children: _jsxs("div", { className: "hjm-field__control hjm-field__control--multiline", children: [leadingAction ? _jsx("span", { className: "hjm-field__leading", children: leadingAction }) : null, _jsx("textarea", { ...props, ref: composeRefs(control, ref), id: ids.controlId, className: classNames("hjm-field__input", className), style: { ...style, ...lineBounds }, required: required, disabled: disabled, "aria-invalid": error ? true : ariaInvalid, "aria-label": ariaLabel, "aria-describedby": describedBy(ariaDescribedBy, description, error, ids.descriptionId, ids.errorId), onFocus: (event) => {
|
|
117
|
+
return (_jsx(FieldFrame, { controlId: ids.controlId, label: label, description: description, error: error, required: required ?? false, disabled: disabled ?? false, focused: focused, invalid: isAriaInvalid(ariaInvalid), variant: variant ?? fieldRecipe.defaults.variant, shape: shape ?? fieldRecipe.defaults.shape, align: align ?? fieldRecipe.defaults.align, className: fieldClassName, ...(layoutStyle === undefined ? {} : { layoutStyle }), ...(description ? { descriptionId: ids.descriptionId } : {}), ...(error ? { errorId: ids.errorId } : {}), children: _jsxs("div", { className: "hjm-field__control hjm-field__control--multiline", children: [leadingAction ? _jsx("span", { className: "hjm-field__leading", children: leadingAction }) : null, _jsx("textarea", { ...props, ref: composeRefs(control, ref), id: ids.controlId, className: classNames("hjm-field__input", className), style: { ...style, ...lineBounds }, required: required, disabled: disabled, "aria-invalid": error ? true : ariaInvalid, "aria-label": ariaLabel, "aria-describedby": describedBy(ariaDescribedBy, description, error, ids.descriptionId, ids.errorId), onFocus: (event) => {
|
|
118
118
|
setFocused(true);
|
|
119
119
|
onFocus?.(event);
|
|
120
120
|
}, onBlur: (event) => {
|