@hjmds/react 1.32.1 → 1.33.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/evidence.d.ts +1 -1
- package/dist/evidence.js +1 -1
- package/dist/evidence.js.map +1 -1
- package/dist/forms.d.ts +6 -12
- package/dist/forms.d.ts.map +1 -1
- package/dist/forms.js.map +1 -1
- package/dist/internal/initial-focus.d.ts +3 -1
- package/dist/internal/initial-focus.d.ts.map +1 -1
- package/dist/internal/initial-focus.js +13 -4
- package/dist/internal/initial-focus.js.map +1 -1
- package/dist/overlays.d.ts +3 -3
- package/dist/overlays.d.ts.map +1 -1
- package/dist/overlays.js +4 -3
- package/dist/overlays.js.map +1 -1
- package/dist/screens.d.ts +3 -5
- package/dist/screens.d.ts.map +1 -1
- package/dist/screens.js.map +1 -1
- package/package.json +3 -3
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.33.0";
|
|
38
38
|
readonly surface: "web";
|
|
39
39
|
readonly components: Readonly<{
|
|
40
40
|
/** Canonical component id from the design-contracts catalog. */
|
package/dist/evidence.js
CHANGED
|
@@ -134,7 +134,7 @@ const activeWebEntries = componentCatalog.filter((entry) => {
|
|
|
134
134
|
export const reactRendererEvidence = {
|
|
135
135
|
schemaVersion: reactRendererEvidenceSchemaVersion,
|
|
136
136
|
packageName: "@hjmds/react",
|
|
137
|
-
packageVersion: "1.
|
|
137
|
+
packageVersion: "1.33.0",
|
|
138
138
|
surface: "web",
|
|
139
139
|
components: activeWebEntries.map(derivedClaim),
|
|
140
140
|
};
|
package/dist/evidence.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ev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KAAK,MAAM,CAAC;AAClD,CAAC,CAAC,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.32.1\",\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,CAA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redShowcaseEvidence } 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.33.0\",\n surface: \"web\",\n components: activeWebEntries.map(derivedClaim),\n} as const satisfies ReactRendererEvidenceManifest;\n"]}
|
package/dist/forms.d.ts
CHANGED
|
@@ -57,10 +57,8 @@ type SharedInputProps = FieldCopyProps & Readonly<{
|
|
|
57
57
|
*/
|
|
58
58
|
layoutStyle?: HjmCompositionStyleProp;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
* mounts after entry — revealed by a user action or a step change — is focused when it appears, whatever the
|
|
63
|
-
* mode, unless another text field has focus or a modal is above (screen-patterns `resolveEntryFocus`).
|
|
60
|
+
* Page-entry target: true prefers this field, false excludes it, omission uses tree order. Only chooses during
|
|
61
|
+
* entry; revealing a field after interaction does not focus it. Bottom sheets disable automatic input focus.
|
|
64
62
|
*/
|
|
65
63
|
initialFocusTarget?: boolean;
|
|
66
64
|
}>;
|
|
@@ -96,10 +94,8 @@ export declare const TextField: import("react").ForwardRefExoticComponent<Omit<I
|
|
|
96
94
|
*/
|
|
97
95
|
layoutStyle?: HjmCompositionStyleProp;
|
|
98
96
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
* mounts after entry — revealed by a user action or a step change — is focused when it appears, whatever the
|
|
102
|
-
* mode, unless another text field has focus or a modal is above (screen-patterns `resolveEntryFocus`).
|
|
97
|
+
* Page-entry target: true prefers this field, false excludes it, omission uses tree order. Only chooses during
|
|
98
|
+
* entry; revealing a field after interaction does not focus it. Bottom sheets disable automatic input focus.
|
|
103
99
|
*/
|
|
104
100
|
initialFocusTarget?: boolean;
|
|
105
101
|
}> & Readonly<{
|
|
@@ -185,10 +181,8 @@ export declare const SearchField: import("react").ForwardRefExoticComponent<Omit
|
|
|
185
181
|
*/
|
|
186
182
|
layoutStyle?: HjmCompositionStyleProp;
|
|
187
183
|
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
* mounts after entry — revealed by a user action or a step change — is focused when it appears, whatever the
|
|
191
|
-
* mode, unless another text field has focus or a modal is above (screen-patterns `resolveEntryFocus`).
|
|
184
|
+
* Page-entry target: true prefers this field, false excludes it, omission uses tree order. Only chooses during
|
|
185
|
+
* entry; revealing a field after interaction does not focus it. Bottom sheets disable automatic input focus.
|
|
192
186
|
*/
|
|
193
187
|
initialFocusTarget?: boolean;
|
|
194
188
|
}> & Readonly<{
|
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,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC5B,MAAM,OAAO,CAAC;AAI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C,KAAK,CAAC,CAAC;wBAClB,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;oBAClB,CAAC,EACD,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;wBAClB,QAAQ,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;wBAClE,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;oBACpB,CAAC,EACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;wBACjB,UAAU,CAAC,IAAI,CAAC,CAAC;wBACjB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;oBACnB,CAAC,EACD,OAAO,EAAC,QAAQ,EAChB,QAAQ,EAAE,QAAQ,IAAI,IAAI,EAC1B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,GACZ,EACF,6BAAiB,MAAM,EAAC,SAAS,EAAC,sBAAsB,YACrD,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC3B,eACE,SAAS,EAAC,qBAAqB,gBACnB,KAAK;4BACf,CAAC,CAAC,SAAS;4BACX,CAAC,CAAC,OAAO,IAAI,KAAK,KAAK,WAAW;gCAChC,CAAC,CAAC,SAAS;gCACX,CAAC,CAAC,KAAK;oCACL,CAAC,CAAC,QAAQ;oCACV,CAAC,CAAC,MAAM,YAGb,KAAK,IAFD,KAAK,CAGL,CACR,CAAC,GACE,IACF,GACK,CACd,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import {\n fieldRecipe,\n type FieldAlign,\n type FieldShape,\n type FieldVariant,\n} from \"@hjmds/design-contracts/recipes/base\";\nimport {\n iconRecipe,\n searchFieldRecipe,\n type SearchFieldSize,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n passwordFieldRecipe,\n resolvePasswordFieldDescriptor,\n type PasswordFieldAutofillHint,\n type PasswordFieldSize,\n} from \"@hjmds/design-contracts/components/password-field\";\nimport {\n getOtpFieldSlotValues,\n otpFieldRecipe,\n resolveOtpFieldValue,\n type OtpFieldSize,\n type OtpFieldPresentation,\n} from \"@hjmds/design-contracts/components/otp-field\";\nimport {\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type ReactNode,\n type TextareaHTMLAttributes,\n} from \"react\";\nimport { composeRefs, classNames, useControllableState } from \"./internal.js\";\nimport { useInitialFocusTarget } from \"./internal/initial-focus.js\";\nimport { Icon } from \"./supplemental-display.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\nimport { FieldError } from \"./internal/field-error.js\";\n\ntype FieldCopyProps = Readonly<{\n label?: ReactNode;\n description?: ReactNode;\n error?: ReactNode;\n required?: boolean;\n}>;\n\ntype FieldFrameProps = HTMLAttributes<HTMLDivElement> &\n FieldCopyProps &\n Readonly<{\n controlId: string;\n descriptionId?: string;\n errorId?: string;\n disabled?: boolean;\n focused?: boolean;\n invalid?: boolean;\n variant?: FieldVariant;\n shape?: FieldShape;\n align?: FieldAlign;\n /** Component recipe override of fieldRecipe.disabledOpacity (OtpField). */\n disabledOpacity?: number;\n children: ReactNode;\n /** Canonical layout-only placement on the field frame (`.hjm-field`), not the input. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\n/*\n How far a disabled field fades its label and control (fieldRecipe.disabledScope). The\n frame defaults to fieldRecipe.disabledOpacity; SearchField and PasswordField render\n through the public TextField, so they hand their own recipe value down this\n module-private context instead of widening TextField's public props.\n*/\nconst FieldDisabledOpacityContext = createContext<number | undefined>(undefined);\n\nfunction FieldFrame({\n controlId,\n label,\n description,\n error,\n descriptionId,\n errorId,\n required = false,\n disabled = false,\n focused = false,\n invalid = false,\n variant = fieldRecipe.defaults.variant,\n shape = fieldRecipe.defaults.shape,\n align = fieldRecipe.defaults.align,\n disabledOpacity,\n className,\n children,\n layoutStyle,\n style,\n ...props\n}: FieldFrameProps) {\n // A grouped field may reference one external error; aria-invalid must still\n // use the invalid recipe even when no inline error copy is repeated.\n const state = disabled ? \"disabled\" : error || invalid ? \"invalid\" : focused ? \"focused\" : \"idle\";\n const inheritedOpacity = useContext(FieldDisabledOpacityContext);\n const recipeOpacity = disabledOpacity ?? inheritedOpacity;\n return (\n <div\n {...props}\n // The stylesheet fades the label and control with --hjm-field-disabled-opacity\n // (theme value: fieldRecipe.disabledOpacity); a component recipe value is set\n // here, only while disabled, so enabled roots keep their old inline style.\n style={{\n ...style,\n ...layoutStyle,\n ...(disabled && recipeOpacity !== undefined\n ? ({ \"--hjm-field-disabled-opacity\": recipeOpacity } as CSSProperties)\n : {}),\n }}\n className={classNames(\"hjm-field\", className)}\n data-state={state}\n data-variant={variant}\n data-shape={shape}\n data-align={align}\n >\n {label !== undefined && label !== null ? (\n <label className=\"hjm-field__label\" htmlFor={controlId}>\n {label}\n {required ? <span aria-hidden=\"true\"> *</span> : null}\n </label>\n ) : null}\n {children}\n {/*\n Support text stays visible under an error instead of being replaced by\n it: the guidance (a length or format hint) is what tells the user how to clear the\n error, and hiding it is why a product copied that sentence into its own\n error string. Both are also referenced by aria-describedby.\n */}\n {description ? (\n <div id={descriptionId} className=\"hjm-field__description\">\n {description}\n </div>\n ) : null}\n <FieldError id={errorId} error={error} />\n </div>\n );\n}\n\nexport type FieldControlProps = Readonly<{\n id: string;\n required: boolean;\n disabled: boolean;\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n}>;\n\nexport type FieldProps = Omit<\n FieldFrameProps,\n \"children\" | \"descriptionId\" | \"errorId\" | \"disabledOpacity\"\n> &\n Readonly<{\n label: ReactNode;\n children: ReactNode | ((props: FieldControlProps) => ReactNode);\n }>;\n\n/** Generic frame for custom native controls; `controlId` keeps the label explicit. */\nexport function Field({\n controlId,\n description,\n error,\n required = false,\n disabled = false,\n children,\n ...props\n}: FieldProps) {\n const descriptionId = `${controlId}-description`;\n const errorId = `${controlId}-error`;\n const controlProps: FieldControlProps = {\n id: controlId,\n required,\n disabled,\n ...(error ? { \"aria-invalid\": true as const } : {}),\n // Same merge as the built-in fields: support text stays referenced once an\n // error appears, so a custom control does not have to re-derive the ids.\n ...(description || error\n ? {\n \"aria-describedby\": [description ? descriptionId : undefined, error ? errorId : undefined]\n .filter(Boolean)\n .join(\" \"),\n }\n : {}),\n };\n return (\n <FieldFrame\n {...props}\n controlId={controlId}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n {...(description ? { descriptionId } : {})}\n {...(error ? { errorId } : {})}\n >\n {typeof children === \"function\" ? children(controlProps) : children}\n </FieldFrame>\n );\n}\n\nfunction useFieldIds(id: string | undefined) {\n const generatedId = useId();\n const controlId = id ?? `hjm-${generatedId.replaceAll(\":\", \"\")}`;\n return {\n controlId,\n descriptionId: `${controlId}-description`,\n errorId: `${controlId}-error`,\n } as const;\n}\n\n/*\n Support text and the error are both referenced when both exist, in DOM reading\n order, and the consumer's own `aria-describedby` is kept in front of them.\n Announcing only the error (the earlier behaviour) dropped the guidance that\n explains how to fix it — exactly the text a product then duplicated into the\n error string by hand.\n*/\nfunction describedBy(\n own: string | undefined,\n description: ReactNode | undefined,\n error: ReactNode | undefined,\n descriptionId: string,\n errorId: string,\n): string | undefined {\n return [own, description ? descriptionId : undefined, error ? errorId : undefined]\n .filter(Boolean)\n .join(\" \") || undefined;\n}\n\nfunction requireFieldAccessibleName(label: ReactNode | undefined, ariaLabel: string | undefined) {\n if ((label === undefined || label === null) && !ariaLabel?.trim()) {\n throw new TypeError(\"Field controls require either label or aria-label\");\n }\n}\n\ntype SharedInputProps = FieldCopyProps &\n Readonly<{\n variant?: FieldVariant;\n shape?: FieldShape;\n /**\n * Text placement inside the control. `start` follows the resolved\n * direction; `center` suits a short, ceremonial single value such as a\n * nickname or a code. Replaces a `text-align` override.\n */\n align?: FieldAlign;\n leading?: ReactNode;\n trailing?: ReactNode;\n fieldClassName?: string;\n /**\n * Canonical layout-only placement on the field frame. `style` keeps going to\n * the input element, where it always went, so existing callers do not move.\n */\n layoutStyle?: HjmCompositionStyleProp;\n /**\n * Screen entry focus: true makes this the field the enclosing screen or sheet focuses on entry, false keeps it\n * from ever being chosen; omitted fields are eligible in tree order (same as Native, 2026-10-18). A true field that\n * mounts after entry — revealed by a user action or a step change — is focused when it appears, whatever the\n * mode, unless another text field has focus or a modal is above (screen-patterns `resolveEntryFocus`).\n */\n initialFocusTarget?: boolean;\n }>;\n\nexport type TextFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"size\"> &\n SharedInputProps &\n Readonly<{\n /**\n * Receives the next string value, the same callback name and shape as the\n * Native TextField. Web TextArea retains the DOM `onChange` callback. Before 1.5.0 Web TextField only had\n * the DOM `onChange`, so shared form code needed a platform branch. Both\n * fire; `onChange` stays for event access.\n */\n onValueChange?: (value: string) => void;\n }>;\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(\n {\n id,\n label,\n description,\n error,\n required,\n disabled,\n variant,\n shape,\n align,\n leading,\n trailing,\n fieldClassName,\n className,\n onFocus,\n onBlur,\n onChange,\n onValueChange,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n \"aria-label\": ariaLabel,\n layoutStyle,\n initialFocusTarget,\n ...props\n },\n ref,\n ) {\n const ids = useFieldIds(id);\n const [focused, setFocused] = useState(false);\n requireFieldAccessibleName(label, ariaLabel);\n const control = useRef<HTMLInputElement>(null);\n useInitialFocusTarget(control, initialFocusTarget);\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n setFocused(true);\n onFocus?.(event);\n };\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n setFocused(false);\n onBlur?.(event);\n };\n return (\n <FieldFrame\n controlId={ids.controlId}\n label={label}\n description={description}\n error={error}\n required={required ?? false}\n disabled={disabled ?? false}\n focused={focused}\n invalid={ariaInvalid === true || ariaInvalid === \"true\"}\n variant={variant ?? fieldRecipe.defaults.variant}\n shape={shape ?? fieldRecipe.defaults.shape}\n align={align ?? fieldRecipe.defaults.align}\n className={fieldClassName}\n {...(layoutStyle === undefined ? {} : { layoutStyle })}\n {...(description ? { descriptionId: ids.descriptionId } : {})}\n {...(error ? { errorId: ids.errorId } : {})}\n >\n <div className=\"hjm-field__control\">\n {leading ? <span className=\"hjm-field__affix\">{leading}</span> : null}\n <input\n {...props}\n ref={composeRefs(control, ref)}\n id={ids.controlId}\n className={classNames(\"hjm-field__input\", className)}\n required={required}\n disabled={disabled}\n aria-invalid={error ? true : ariaInvalid}\n aria-label={ariaLabel}\n aria-describedby={describedBy(\n ariaDescribedBy,\n description,\n error,\n ids.descriptionId,\n ids.errorId,\n )}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChange={(event) => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n }}\n />\n {trailing ? <span className=\"hjm-field__affix\">{trailing}</span> : null}\n </div>\n </FieldFrame>\n );\n },\n);\n\nexport type TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement> &\n Omit<SharedInputProps, \"leading\"> &\n Readonly<{\n /**\n * Action before the text inside the field frame (for example a composer's camera button),\n * vertically centred while the text grows. Mirrors `trailing`; `leading` stays omitted because\n * TextField's `leading` is a decorative affix with muted color, not an action slot.\n */\n leadingAction?: ReactNode;\n /**\n * Lower bound for a growing multiline field, in visible lines. Height is\n * recipe-owned, so this semantic axis replaces a `min-height` override.\n */\n minVisibleLines?: number;\n /** Upper bound for a growing multiline field, in visible lines. */\n maxVisibleLines?: number;\n }>;\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n {\n id,\n label,\n description,\n error,\n required,\n disabled,\n variant,\n shape,\n trailing,\n leadingAction,\n align,\n fieldClassName,\n className,\n onFocus,\n onBlur,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n \"aria-label\": ariaLabel,\n minVisibleLines,\n maxVisibleLines,\n style,\n layoutStyle,\n initialFocusTarget,\n ...props\n },\n ref,\n ) {\n const ids = useFieldIds(id);\n const [focused, setFocused] = useState(false);\n requireFieldAccessibleName(label, ariaLabel);\n const control = useRef<HTMLTextAreaElement>(null);\n useInitialFocusTarget(control, initialFocusTarget);\n // Bounds are expressed in lines so the recipe keeps line height and padding.\n const lineBounds = {\n ...(minVisibleLines === undefined\n ? {}\n : { \"--hjm-field-min-visible-lines\": minVisibleLines }),\n ...(maxVisibleLines === undefined\n ? {}\n : { \"--hjm-field-max-visible-lines\": maxVisibleLines }),\n } as CSSProperties;\n return (\n <FieldFrame\n controlId={ids.controlId}\n label={label}\n description={description}\n error={error}\n required={required ?? false}\n disabled={disabled ?? false}\n focused={focused}\n variant={variant ?? fieldRecipe.defaults.variant}\n shape={shape ?? fieldRecipe.defaults.shape}\n align={align ?? fieldRecipe.defaults.align}\n className={fieldClassName}\n {...(layoutStyle === undefined ? {} : { layoutStyle })}\n {...(description ? { descriptionId: ids.descriptionId } : {})}\n {...(error ? { errorId: ids.errorId } : {})}\n >\n <div className=\"hjm-field__control hjm-field__control--multiline\">\n {leadingAction ? <span className=\"hjm-field__leading\">{leadingAction}</span> : null}\n <textarea\n {...props}\n ref={composeRefs(control, ref)}\n id={ids.controlId}\n className={classNames(\"hjm-field__input\", className)}\n style={{ ...style, ...lineBounds }}\n required={required}\n disabled={disabled}\n aria-invalid={error ? true : ariaInvalid}\n aria-label={ariaLabel}\n aria-describedby={describedBy(\n ariaDescribedBy,\n description,\n error,\n ids.descriptionId,\n ids.errorId,\n )}\n onFocus={(event) => {\n setFocused(true);\n onFocus?.(event);\n }}\n onBlur={(event) => {\n setFocused(false);\n onBlur?.(event);\n }}\n />\n {trailing ? <span className=\"hjm-field__trailing\">{trailing}</span> : null}\n </div>\n </FieldFrame>\n );\n },\n);\n\nexport type SearchFieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"value\" | \"defaultValue\"\n> &\n SharedInputProps &\n Readonly<{\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n size?: SearchFieldSize;\n /** Localized accessible name for the clear action. */\n clearLabel: string;\n onClear?: () => void;\n /** Keeps the input mounted and named while replacing trailing actions with progress. */\n loading?: boolean;\n /** Product icon adapter; the renderer owns size and inherited color. */\n renderSearchIcon?: (props: SearchFieldIconRenderProps) => ReactNode;\n /** Product icon adapter for the clear action. */\n renderClearIcon?: (props: SearchFieldIconRenderProps) => ReactNode;\n /** Optional progress adapter. The default is the canonical CSS spinner. */\n renderLoadingIndicator?: (props: SearchFieldIconRenderProps) => ReactNode;\n }>;\n\nexport type SearchFieldIconRenderProps = Readonly<{\n color: \"currentColor\";\n size: number;\n}>;\n\nexport const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(\n function SearchField(\n {\n value: valueProp,\n defaultValue = \"\",\n onValueChange,\n onChange,\n size = searchFieldRecipe.defaults.size,\n clearLabel,\n onClear,\n loading = false,\n renderSearchIcon,\n renderClearIcon,\n renderLoadingIndicator,\n leading,\n trailing,\n fieldClassName,\n disabled,\n \"aria-busy\": ariaBusy,\n ...props\n },\n forwardedRef,\n ) {\n const [value, setValue] = useControllableState({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue,\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const inputRef = useRef<HTMLInputElement>(null);\n const iconAppearance: SearchFieldIconRenderProps = {\n color: \"currentColor\",\n size: iconRecipe.sizes[searchFieldRecipe.sizes[size].glyph],\n };\n const canClear = value.length > 0 && !disabled && !props.readOnly;\n return (\n <FieldDisabledOpacityContext.Provider value={searchFieldRecipe.states.disabledOpacity}>\n <TextField\n {...props}\n ref={composeRefs(inputRef, forwardedRef)}\n type=\"search\"\n value={value}\n data-size={size}\n data-loading={loading || undefined}\n disabled={disabled}\n aria-busy={loading || ariaBusy || undefined}\n fieldClassName={classNames(\"hjm-search-field\", fieldClassName)!}\n leading={\n leading ?? (renderSearchIcon ? renderSearchIcon(iconAppearance) : undefined)\n }\n onChange={(event) => {\n setValue(event.currentTarget.value);\n onChange?.(event);\n }}\n trailing={\n loading ? (\n <span className=\"hjm-search-field__spinner\" aria-hidden=\"true\">\n {renderLoadingIndicator?.(iconAppearance)}\n </span>\n ) : canClear ? (\n <button\n type=\"button\"\n className=\"hjm-search-field__clear\"\n aria-label={clearLabel}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n setValue(\"\");\n onClear?.();\n inputRef.current?.focus();\n }}\n >\n {renderClearIcon?.(iconAppearance) ?? \"×\"}\n </button>\n ) : trailing\n }\n />\n </FieldDisabledOpacityContext.Provider>\n );\n },\n);\n\nexport type PasswordFieldToggleRenderProps = Readonly<{\n name: \"visibility\" | \"visibilityOff\";\n color: \"currentColor\";\n size: number;\n revealed: boolean;\n disabled: boolean;\n}>;\n\nexport type PasswordFieldProps = Omit<\n TextFieldProps,\n \"autoComplete\" | \"defaultValue\" | \"size\" | \"trailing\" | \"type\" | \"value\"\n> &\n Readonly<{\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n revealed?: boolean;\n defaultRevealed?: boolean;\n onRevealedChange?: (revealed: boolean) => void;\n autofillHint: PasswordFieldAutofillHint;\n revealLabel: string;\n concealLabel: string;\n size?: PasswordFieldSize;\n renderToggleIcon?: (props: PasswordFieldToggleRenderProps) => ReactNode;\n }>;\n\n/** Password input with an independently controlled, selection-safe reveal action. */\nexport const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(\n function PasswordField(\n {\n value: valueProp,\n defaultValue = \"\",\n onValueChange,\n onChange,\n revealed: revealedProp,\n defaultRevealed = false,\n onRevealedChange,\n autofillHint,\n revealLabel,\n concealLabel,\n size = passwordFieldRecipe.defaults.size,\n renderToggleIcon,\n fieldClassName,\n className,\n disabled,\n readOnly,\n ...props\n },\n forwardedRef,\n ) {\n const [value, setValue] = useControllableState({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue,\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const [revealed, setRevealed] = useControllableState({\n ...(revealedProp === undefined ? {} : { value: revealedProp }),\n defaultValue: defaultRevealed,\n ...(onRevealedChange === undefined ? {} : { onChange: onRevealedChange }),\n });\n const resolved = resolvePasswordFieldDescriptor(\n { revealed, autofillHint },\n {\n composeToggleAccessibleName: ({ willReveal }) =>\n willReveal ? revealLabel : concealLabel,\n },\n );\n const inputRef = useRef<HTMLInputElement>(null);\n const selectionRef = useRef<Readonly<{ start: number; end: number }> | null>(null);\n\n useLayoutEffect(() => {\n const selection = selectionRef.current;\n if (!selection || !inputRef.current) return;\n inputRef.current.setSelectionRange(selection.start, selection.end);\n selectionRef.current = null;\n }, [revealed]);\n\n const toggleAppearance: PasswordFieldToggleRenderProps = {\n name: revealed\n ? passwordFieldRecipe.toggle.icons.revealed\n : passwordFieldRecipe.toggle.icons.concealed,\n color: \"currentColor\",\n size: iconRecipe.sizes.sm,\n revealed,\n disabled: disabled ?? false,\n };\n\n return (\n <FieldDisabledOpacityContext.Provider value={passwordFieldRecipe.states.disabledOpacity}>\n <TextField\n {...props}\n ref={composeRefs(inputRef, forwardedRef)}\n autoComplete={autofillHint === \"current\" ? \"current-password\" : \"new-password\"}\n className={classNames(\"hjm-password-field__input\", className)}\n disabled={disabled}\n fieldClassName={classNames(\n \"hjm-password-field\",\n `hjm-password-field--${size}`,\n fieldClassName,\n )!}\n onChange={(event) => {\n setValue(event.currentTarget.value);\n onChange?.(event);\n }}\n readOnly={readOnly}\n trailing={(\n <button\n // No `aria-pressed`: the name already says the next action (\"Show/Hide\n // password\"), and a pressed state on top would read as \"Hide password,\n // pressed\" — two answers to one question (password-field.md, rationale 1).\n aria-label={resolved.toggleAccessibleName}\n className=\"hjm-password-field__toggle\"\n data-revealed={revealed || undefined}\n disabled={disabled}\n onClick={() => {\n const input = inputRef.current;\n if (input && input.selectionStart !== null && input.selectionEnd !== null) {\n selectionRef.current = {\n start: input.selectionStart,\n end: input.selectionEnd,\n };\n }\n setRevealed(!revealed);\n }}\n type=\"button\"\n >\n {renderToggleIcon?.(toggleAppearance) ?? <Icon name={toggleAppearance.name} size=\"sm\" />}\n </button>\n )}\n type={resolved.webInputType}\n value={value}\n />\n </FieldDisabledOpacityContext.Provider>\n );\n },\n);\n\nexport type OtpFieldProps = Omit<\n TextFieldProps,\n | \"autoComplete\"\n | \"defaultValue\"\n | \"leading\"\n | \"maxLength\"\n | \"shape\"\n | \"size\"\n | \"trailing\"\n | \"type\"\n | \"value\"\n | \"variant\"\n> &\n Readonly<{\n length: number;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n onComplete?: (value: string) => void;\n size?: OtpFieldSize;\n presentation?: OtpFieldPresentation;\n busy?: boolean;\n }>;\n\n/** One accessible numeric input rendered as decorative OTP slots. */\nexport const OtpField = forwardRef<HTMLInputElement, OtpFieldProps>(\n function OtpField(\n {\n id,\n label,\n description,\n error,\n required,\n disabled,\n readOnly,\n busy = false,\n length,\n value: valueProp,\n defaultValue = \"\",\n onValueChange,\n onComplete,\n onChange,\n size = otpFieldRecipe.defaults.size,\n presentation = \"boxes\",\n fieldClassName,\n className,\n onFocus,\n onBlur,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n \"aria-label\": ariaLabel,\n layoutStyle,\n ...props\n },\n ref,\n ) {\n const ids = useFieldIds(id);\n const [focused, setFocused] = useState(false);\n requireFieldAccessibleName(label, ariaLabel);\n const [value, setValue] = useControllableState({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue: resolveOtpFieldValue(length, defaultValue),\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const slots = getOtpFieldSlotValues({ length, value });\n const complete = value.length === length;\n const wasCompleteRef = useRef(complete);\n useEffect(() => {\n if (complete && !wasCompleteRef.current) onComplete?.(value);\n wasCompleteRef.current = complete;\n }, [complete, onComplete, value]);\n const activeIndex = Math.min(value.length, length - 1);\n\n return (\n <FieldFrame\n className={classNames(\"hjm-otp-field\", fieldClassName)}\n disabledOpacity={otpFieldRecipe.states.disabledOpacity}\n {...(layoutStyle === undefined ? {} : { layoutStyle })}\n controlId={ids.controlId}\n description={description}\n disabled={(disabled ?? false) || busy}\n error={error}\n focused={focused}\n label={label}\n required={required ?? false}\n {...(description ? { descriptionId: ids.descriptionId } : {})}\n {...(error ? { errorId: ids.errorId } : {})}\n >\n <div\n className=\"hjm-otp-field__control\"\n data-presentation={presentation}\n data-complete={complete || undefined}\n data-size={size}\n style={{ \"--hjm-otp-length\": length } as CSSProperties}\n >\n <input\n {...props}\n ref={ref}\n aria-busy={busy || undefined}\n aria-describedby={describedBy(\n ariaDescribedBy,\n description,\n error,\n ids.descriptionId,\n ids.errorId,\n )}\n aria-invalid={error ? true : ariaInvalid}\n aria-label={ariaLabel}\n autoComplete=\"one-time-code\"\n className={classNames(\"hjm-otp-field__input\", className)}\n // busy stays focusable (read-only); see otp-field.md.\n disabled={disabled}\n id={ids.controlId}\n inputMode=\"numeric\"\n maxLength={length}\n onBlur={(event) => {\n setFocused(false);\n onBlur?.(event);\n }}\n onChange={(event) => {\n setValue(resolveOtpFieldValue(length, event.currentTarget.value));\n onChange?.(event);\n }}\n onFocus={(event) => {\n setFocused(true);\n onFocus?.(event);\n }}\n pattern=\"[0-9]*\"\n readOnly={readOnly || busy}\n required={required}\n type=\"text\"\n value={value}\n />\n <div aria-hidden=\"true\" className=\"hjm-otp-field__slots\">\n {slots.map((digit, index) => (\n <span\n className=\"hjm-otp-field__slot\"\n data-state={error\n ? \"invalid\"\n : focused && index === activeIndex\n ? \"focused\"\n : digit\n ? \"filled\"\n : \"idle\"}\n key={index}\n >\n {digit}\n </span>\n ))}\n </div>\n </div>\n </FieldFrame>\n );\n },\n);\n"]}
|
|
1
|
+
{"version":3,"file":"forms.js","sourceRoot":"","sources":["../src/forms.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,WAAW,GAIZ,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,UAAU,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wBAClB,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;oBAClB,CAAC,EACD,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;wBAClB,QAAQ,CAAC,oBAAoB,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;wBAClE,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;oBACpB,CAAC,EACD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;wBACjB,UAAU,CAAC,IAAI,CAAC,CAAC;wBACjB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;oBACnB,CAAC,EACD,OAAO,EAAC,QAAQ,EAChB,QAAQ,EAAE,QAAQ,IAAI,IAAI,EAC1B,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,GACZ,EACF,6BAAiB,MAAM,EAAC,SAAS,EAAC,sBAAsB,YACrD,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,CAC3B,eACE,SAAS,EAAC,qBAAqB,gBACnB,KAAK;4BACf,CAAC,CAAC,SAAS;4BACX,CAAC,CAAC,OAAO,IAAI,KAAK,KAAK,WAAW;gCAChC,CAAC,CAAC,SAAS;gCACX,CAAC,CAAC,KAAK;oCACL,CAAC,CAAC,QAAQ;oCACV,CAAC,CAAC,MAAM,YAGb,KAAK,IAFD,KAAK,CAGL,CACR,CAAC,GACE,IACF,GACK,CACd,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import {\n fieldRecipe,\n type FieldAlign,\n type FieldShape,\n type FieldVariant,\n} from \"@hjmds/design-contracts/recipes/base\";\nimport {\n iconRecipe,\n searchFieldRecipe,\n type SearchFieldSize,\n} from \"@hjmds/design-contracts/recipes\";\nimport {\n passwordFieldRecipe,\n resolvePasswordFieldDescriptor,\n type PasswordFieldAutofillHint,\n type PasswordFieldSize,\n} from \"@hjmds/design-contracts/components/password-field\";\nimport {\n getOtpFieldSlotValues,\n otpFieldRecipe,\n resolveOtpFieldValue,\n type OtpFieldSize,\n type OtpFieldPresentation,\n} from \"@hjmds/design-contracts/components/otp-field\";\nimport {\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type FocusEvent,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type ReactNode,\n type TextareaHTMLAttributes,\n} from \"react\";\nimport { composeRefs, classNames, useControllableState } from \"./internal.js\";\nimport { useInitialFocusTarget } from \"./internal/initial-focus.js\";\nimport { Icon } from \"./supplemental-display.js\";\nimport type { HjmCompositionStyleProp } from \"./composition-style.js\";\nimport { FieldError } from \"./internal/field-error.js\";\n\ntype FieldCopyProps = Readonly<{\n label?: ReactNode;\n description?: ReactNode;\n error?: ReactNode;\n required?: boolean;\n}>;\n\ntype FieldFrameProps = HTMLAttributes<HTMLDivElement> &\n FieldCopyProps &\n Readonly<{\n controlId: string;\n descriptionId?: string;\n errorId?: string;\n disabled?: boolean;\n focused?: boolean;\n invalid?: boolean;\n variant?: FieldVariant;\n shape?: FieldShape;\n align?: FieldAlign;\n /** Component recipe override of fieldRecipe.disabledOpacity (OtpField). */\n disabledOpacity?: number;\n children: ReactNode;\n /** Canonical layout-only placement on the field frame (`.hjm-field`), not the input. Controlled visual keys are excluded. */\n layoutStyle?: HjmCompositionStyleProp;\n }>;\n\n/*\n How far a disabled field fades its label and control (fieldRecipe.disabledScope). The\n frame defaults to fieldRecipe.disabledOpacity; SearchField and PasswordField render\n through the public TextField, so they hand their own recipe value down this\n module-private context instead of widening TextField's public props.\n*/\nconst FieldDisabledOpacityContext = createContext<number | undefined>(undefined);\n\nfunction FieldFrame({\n controlId,\n label,\n description,\n error,\n descriptionId,\n errorId,\n required = false,\n disabled = false,\n focused = false,\n invalid = false,\n variant = fieldRecipe.defaults.variant,\n shape = fieldRecipe.defaults.shape,\n align = fieldRecipe.defaults.align,\n disabledOpacity,\n className,\n children,\n layoutStyle,\n style,\n ...props\n}: FieldFrameProps) {\n // A grouped field may reference one external error; aria-invalid must still\n // use the invalid recipe even when no inline error copy is repeated.\n const state = disabled ? \"disabled\" : error || invalid ? \"invalid\" : focused ? \"focused\" : \"idle\";\n const inheritedOpacity = useContext(FieldDisabledOpacityContext);\n const recipeOpacity = disabledOpacity ?? inheritedOpacity;\n return (\n <div\n {...props}\n // The stylesheet fades the label and control with --hjm-field-disabled-opacity\n // (theme value: fieldRecipe.disabledOpacity); a component recipe value is set\n // here, only while disabled, so enabled roots keep their old inline style.\n style={{\n ...style,\n ...layoutStyle,\n ...(disabled && recipeOpacity !== undefined\n ? ({ \"--hjm-field-disabled-opacity\": recipeOpacity } as CSSProperties)\n : {}),\n }}\n className={classNames(\"hjm-field\", className)}\n data-state={state}\n data-variant={variant}\n data-shape={shape}\n data-align={align}\n >\n {label !== undefined && label !== null ? (\n <label className=\"hjm-field__label\" htmlFor={controlId}>\n {label}\n {required ? <span aria-hidden=\"true\"> *</span> : null}\n </label>\n ) : null}\n {children}\n {/*\n Support text stays visible under an error instead of being replaced by\n it: the guidance (a length or format hint) is what tells the user how to clear the\n error, and hiding it is why a product copied that sentence into its own\n error string. Both are also referenced by aria-describedby.\n */}\n {description ? (\n <div id={descriptionId} className=\"hjm-field__description\">\n {description}\n </div>\n ) : null}\n <FieldError id={errorId} error={error} />\n </div>\n );\n}\n\nexport type FieldControlProps = Readonly<{\n id: string;\n required: boolean;\n disabled: boolean;\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n}>;\n\nexport type FieldProps = Omit<\n FieldFrameProps,\n \"children\" | \"descriptionId\" | \"errorId\" | \"disabledOpacity\"\n> &\n Readonly<{\n label: ReactNode;\n children: ReactNode | ((props: FieldControlProps) => ReactNode);\n }>;\n\n/** Generic frame for custom native controls; `controlId` keeps the label explicit. */\nexport function Field({\n controlId,\n description,\n error,\n required = false,\n disabled = false,\n children,\n ...props\n}: FieldProps) {\n const descriptionId = `${controlId}-description`;\n const errorId = `${controlId}-error`;\n const controlProps: FieldControlProps = {\n id: controlId,\n required,\n disabled,\n ...(error ? { \"aria-invalid\": true as const } : {}),\n // Same merge as the built-in fields: support text stays referenced once an\n // error appears, so a custom control does not have to re-derive the ids.\n ...(description || error\n ? {\n \"aria-describedby\": [description ? descriptionId : undefined, error ? errorId : undefined]\n .filter(Boolean)\n .join(\" \"),\n }\n : {}),\n };\n return (\n <FieldFrame\n {...props}\n controlId={controlId}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n {...(description ? { descriptionId } : {})}\n {...(error ? { errorId } : {})}\n >\n {typeof children === \"function\" ? children(controlProps) : children}\n </FieldFrame>\n );\n}\n\nfunction useFieldIds(id: string | undefined) {\n const generatedId = useId();\n const controlId = id ?? `hjm-${generatedId.replaceAll(\":\", \"\")}`;\n return {\n controlId,\n descriptionId: `${controlId}-description`,\n errorId: `${controlId}-error`,\n } as const;\n}\n\n/*\n Support text and the error are both referenced when both exist, in DOM reading\n order, and the consumer's own `aria-describedby` is kept in front of them.\n Announcing only the error (the earlier behaviour) dropped the guidance that\n explains how to fix it — exactly the text a product then duplicated into the\n error string by hand.\n*/\nfunction describedBy(\n own: string | undefined,\n description: ReactNode | undefined,\n error: ReactNode | undefined,\n descriptionId: string,\n errorId: string,\n): string | undefined {\n return [own, description ? descriptionId : undefined, error ? errorId : undefined]\n .filter(Boolean)\n .join(\" \") || undefined;\n}\n\nfunction requireFieldAccessibleName(label: ReactNode | undefined, ariaLabel: string | undefined) {\n if ((label === undefined || label === null) && !ariaLabel?.trim()) {\n throw new TypeError(\"Field controls require either label or aria-label\");\n }\n}\n\ntype SharedInputProps = FieldCopyProps &\n Readonly<{\n variant?: FieldVariant;\n shape?: FieldShape;\n /**\n * Text placement inside the control. `start` follows the resolved\n * direction; `center` suits a short, ceremonial single value such as a\n * nickname or a code. Replaces a `text-align` override.\n */\n align?: FieldAlign;\n leading?: ReactNode;\n trailing?: ReactNode;\n fieldClassName?: string;\n /**\n * Canonical layout-only placement on the field frame. `style` keeps going to\n * the input element, where it always went, so existing callers do not move.\n */\n layoutStyle?: HjmCompositionStyleProp;\n /**\n * Page-entry target: true prefers this field, false excludes it, omission uses tree order. Only chooses during\n * entry; revealing a field after interaction does not focus it. Bottom sheets disable automatic input focus.\n */\n initialFocusTarget?: boolean;\n }>;\n\nexport type TextFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, \"size\"> &\n SharedInputProps &\n Readonly<{\n /**\n * Receives the next string value, the same callback name and shape as the\n * Native TextField. Web TextArea retains the DOM `onChange` callback. Before 1.5.0 Web TextField only had\n * the DOM `onChange`, so shared form code needed a platform branch. Both\n * fire; `onChange` stays for event access.\n */\n onValueChange?: (value: string) => void;\n }>;\n\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(\n {\n id,\n label,\n description,\n error,\n required,\n disabled,\n variant,\n shape,\n align,\n leading,\n trailing,\n fieldClassName,\n className,\n onFocus,\n onBlur,\n onChange,\n onValueChange,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n \"aria-label\": ariaLabel,\n layoutStyle,\n initialFocusTarget,\n ...props\n },\n ref,\n ) {\n const ids = useFieldIds(id);\n const [focused, setFocused] = useState(false);\n requireFieldAccessibleName(label, ariaLabel);\n const control = useRef<HTMLInputElement>(null);\n useInitialFocusTarget(control, initialFocusTarget);\n const handleFocus = (event: FocusEvent<HTMLInputElement>) => {\n setFocused(true);\n onFocus?.(event);\n };\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n setFocused(false);\n onBlur?.(event);\n };\n return (\n <FieldFrame\n controlId={ids.controlId}\n label={label}\n description={description}\n error={error}\n required={required ?? false}\n disabled={disabled ?? false}\n focused={focused}\n invalid={ariaInvalid === true || ariaInvalid === \"true\"}\n variant={variant ?? fieldRecipe.defaults.variant}\n shape={shape ?? fieldRecipe.defaults.shape}\n align={align ?? fieldRecipe.defaults.align}\n className={fieldClassName}\n {...(layoutStyle === undefined ? {} : { layoutStyle })}\n {...(description ? { descriptionId: ids.descriptionId } : {})}\n {...(error ? { errorId: ids.errorId } : {})}\n >\n <div className=\"hjm-field__control\">\n {leading ? <span className=\"hjm-field__affix\">{leading}</span> : null}\n <input\n {...props}\n ref={composeRefs(control, ref)}\n id={ids.controlId}\n className={classNames(\"hjm-field__input\", className)}\n required={required}\n disabled={disabled}\n aria-invalid={error ? true : ariaInvalid}\n aria-label={ariaLabel}\n aria-describedby={describedBy(\n ariaDescribedBy,\n description,\n error,\n ids.descriptionId,\n ids.errorId,\n )}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChange={(event) => {\n onChange?.(event);\n onValueChange?.(event.currentTarget.value);\n }}\n />\n {trailing ? <span className=\"hjm-field__affix\">{trailing}</span> : null}\n </div>\n </FieldFrame>\n );\n },\n);\n\nexport type TextAreaProps = TextareaHTMLAttributes<HTMLTextAreaElement> &\n Omit<SharedInputProps, \"leading\"> &\n Readonly<{\n /**\n * Action before the text inside the field frame (for example a composer's camera button),\n * vertically centred while the text grows. Mirrors `trailing`; `leading` stays omitted because\n * TextField's `leading` is a decorative affix with muted color, not an action slot.\n */\n leadingAction?: ReactNode;\n /**\n * Lower bound for a growing multiline field, in visible lines. Height is\n * recipe-owned, so this semantic axis replaces a `min-height` override.\n */\n minVisibleLines?: number;\n /** Upper bound for a growing multiline field, in visible lines. */\n maxVisibleLines?: number;\n }>;\n\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(\n {\n id,\n label,\n description,\n error,\n required,\n disabled,\n variant,\n shape,\n trailing,\n leadingAction,\n align,\n fieldClassName,\n className,\n onFocus,\n onBlur,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n \"aria-label\": ariaLabel,\n minVisibleLines,\n maxVisibleLines,\n style,\n layoutStyle,\n initialFocusTarget,\n ...props\n },\n ref,\n ) {\n const ids = useFieldIds(id);\n const [focused, setFocused] = useState(false);\n requireFieldAccessibleName(label, ariaLabel);\n const control = useRef<HTMLTextAreaElement>(null);\n useInitialFocusTarget(control, initialFocusTarget);\n // Bounds are expressed in lines so the recipe keeps line height and padding.\n const lineBounds = {\n ...(minVisibleLines === undefined\n ? {}\n : { \"--hjm-field-min-visible-lines\": minVisibleLines }),\n ...(maxVisibleLines === undefined\n ? {}\n : { \"--hjm-field-max-visible-lines\": maxVisibleLines }),\n } as CSSProperties;\n return (\n <FieldFrame\n controlId={ids.controlId}\n label={label}\n description={description}\n error={error}\n required={required ?? false}\n disabled={disabled ?? false}\n focused={focused}\n variant={variant ?? fieldRecipe.defaults.variant}\n shape={shape ?? fieldRecipe.defaults.shape}\n align={align ?? fieldRecipe.defaults.align}\n className={fieldClassName}\n {...(layoutStyle === undefined ? {} : { layoutStyle })}\n {...(description ? { descriptionId: ids.descriptionId } : {})}\n {...(error ? { errorId: ids.errorId } : {})}\n >\n <div className=\"hjm-field__control hjm-field__control--multiline\">\n {leadingAction ? <span className=\"hjm-field__leading\">{leadingAction}</span> : null}\n <textarea\n {...props}\n ref={composeRefs(control, ref)}\n id={ids.controlId}\n className={classNames(\"hjm-field__input\", className)}\n style={{ ...style, ...lineBounds }}\n required={required}\n disabled={disabled}\n aria-invalid={error ? true : ariaInvalid}\n aria-label={ariaLabel}\n aria-describedby={describedBy(\n ariaDescribedBy,\n description,\n error,\n ids.descriptionId,\n ids.errorId,\n )}\n onFocus={(event) => {\n setFocused(true);\n onFocus?.(event);\n }}\n onBlur={(event) => {\n setFocused(false);\n onBlur?.(event);\n }}\n />\n {trailing ? <span className=\"hjm-field__trailing\">{trailing}</span> : null}\n </div>\n </FieldFrame>\n );\n },\n);\n\nexport type SearchFieldProps = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\" | \"size\" | \"value\" | \"defaultValue\"\n> &\n SharedInputProps &\n Readonly<{\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n size?: SearchFieldSize;\n /** Localized accessible name for the clear action. */\n clearLabel: string;\n onClear?: () => void;\n /** Keeps the input mounted and named while replacing trailing actions with progress. */\n loading?: boolean;\n /** Product icon adapter; the renderer owns size and inherited color. */\n renderSearchIcon?: (props: SearchFieldIconRenderProps) => ReactNode;\n /** Product icon adapter for the clear action. */\n renderClearIcon?: (props: SearchFieldIconRenderProps) => ReactNode;\n /** Optional progress adapter. The default is the canonical CSS spinner. */\n renderLoadingIndicator?: (props: SearchFieldIconRenderProps) => ReactNode;\n }>;\n\nexport type SearchFieldIconRenderProps = Readonly<{\n color: \"currentColor\";\n size: number;\n}>;\n\nexport const SearchField = forwardRef<HTMLInputElement, SearchFieldProps>(\n function SearchField(\n {\n value: valueProp,\n defaultValue = \"\",\n onValueChange,\n onChange,\n size = searchFieldRecipe.defaults.size,\n clearLabel,\n onClear,\n loading = false,\n renderSearchIcon,\n renderClearIcon,\n renderLoadingIndicator,\n leading,\n trailing,\n fieldClassName,\n disabled,\n \"aria-busy\": ariaBusy,\n ...props\n },\n forwardedRef,\n ) {\n const [value, setValue] = useControllableState({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue,\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const inputRef = useRef<HTMLInputElement>(null);\n const iconAppearance: SearchFieldIconRenderProps = {\n color: \"currentColor\",\n size: iconRecipe.sizes[searchFieldRecipe.sizes[size].glyph],\n };\n const canClear = value.length > 0 && !disabled && !props.readOnly;\n return (\n <FieldDisabledOpacityContext.Provider value={searchFieldRecipe.states.disabledOpacity}>\n <TextField\n {...props}\n ref={composeRefs(inputRef, forwardedRef)}\n type=\"search\"\n value={value}\n data-size={size}\n data-loading={loading || undefined}\n disabled={disabled}\n aria-busy={loading || ariaBusy || undefined}\n fieldClassName={classNames(\"hjm-search-field\", fieldClassName)!}\n leading={\n leading ?? (renderSearchIcon ? renderSearchIcon(iconAppearance) : undefined)\n }\n onChange={(event) => {\n setValue(event.currentTarget.value);\n onChange?.(event);\n }}\n trailing={\n loading ? (\n <span className=\"hjm-search-field__spinner\" aria-hidden=\"true\">\n {renderLoadingIndicator?.(iconAppearance)}\n </span>\n ) : canClear ? (\n <button\n type=\"button\"\n className=\"hjm-search-field__clear\"\n aria-label={clearLabel}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => {\n setValue(\"\");\n onClear?.();\n inputRef.current?.focus();\n }}\n >\n {renderClearIcon?.(iconAppearance) ?? \"×\"}\n </button>\n ) : trailing\n }\n />\n </FieldDisabledOpacityContext.Provider>\n );\n },\n);\n\nexport type PasswordFieldToggleRenderProps = Readonly<{\n name: \"visibility\" | \"visibilityOff\";\n color: \"currentColor\";\n size: number;\n revealed: boolean;\n disabled: boolean;\n}>;\n\nexport type PasswordFieldProps = Omit<\n TextFieldProps,\n \"autoComplete\" | \"defaultValue\" | \"size\" | \"trailing\" | \"type\" | \"value\"\n> &\n Readonly<{\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n revealed?: boolean;\n defaultRevealed?: boolean;\n onRevealedChange?: (revealed: boolean) => void;\n autofillHint: PasswordFieldAutofillHint;\n revealLabel: string;\n concealLabel: string;\n size?: PasswordFieldSize;\n renderToggleIcon?: (props: PasswordFieldToggleRenderProps) => ReactNode;\n }>;\n\n/** Password input with an independently controlled, selection-safe reveal action. */\nexport const PasswordField = forwardRef<HTMLInputElement, PasswordFieldProps>(\n function PasswordField(\n {\n value: valueProp,\n defaultValue = \"\",\n onValueChange,\n onChange,\n revealed: revealedProp,\n defaultRevealed = false,\n onRevealedChange,\n autofillHint,\n revealLabel,\n concealLabel,\n size = passwordFieldRecipe.defaults.size,\n renderToggleIcon,\n fieldClassName,\n className,\n disabled,\n readOnly,\n ...props\n },\n forwardedRef,\n ) {\n const [value, setValue] = useControllableState({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue,\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const [revealed, setRevealed] = useControllableState({\n ...(revealedProp === undefined ? {} : { value: revealedProp }),\n defaultValue: defaultRevealed,\n ...(onRevealedChange === undefined ? {} : { onChange: onRevealedChange }),\n });\n const resolved = resolvePasswordFieldDescriptor(\n { revealed, autofillHint },\n {\n composeToggleAccessibleName: ({ willReveal }) =>\n willReveal ? revealLabel : concealLabel,\n },\n );\n const inputRef = useRef<HTMLInputElement>(null);\n const selectionRef = useRef<Readonly<{ start: number; end: number }> | null>(null);\n\n useLayoutEffect(() => {\n const selection = selectionRef.current;\n if (!selection || !inputRef.current) return;\n inputRef.current.setSelectionRange(selection.start, selection.end);\n selectionRef.current = null;\n }, [revealed]);\n\n const toggleAppearance: PasswordFieldToggleRenderProps = {\n name: revealed\n ? passwordFieldRecipe.toggle.icons.revealed\n : passwordFieldRecipe.toggle.icons.concealed,\n color: \"currentColor\",\n size: iconRecipe.sizes.sm,\n revealed,\n disabled: disabled ?? false,\n };\n\n return (\n <FieldDisabledOpacityContext.Provider value={passwordFieldRecipe.states.disabledOpacity}>\n <TextField\n {...props}\n ref={composeRefs(inputRef, forwardedRef)}\n autoComplete={autofillHint === \"current\" ? \"current-password\" : \"new-password\"}\n className={classNames(\"hjm-password-field__input\", className)}\n disabled={disabled}\n fieldClassName={classNames(\n \"hjm-password-field\",\n `hjm-password-field--${size}`,\n fieldClassName,\n )!}\n onChange={(event) => {\n setValue(event.currentTarget.value);\n onChange?.(event);\n }}\n readOnly={readOnly}\n trailing={(\n <button\n // No `aria-pressed`: the name already says the next action (\"Show/Hide\n // password\"), and a pressed state on top would read as \"Hide password,\n // pressed\" — two answers to one question (password-field.md, rationale 1).\n aria-label={resolved.toggleAccessibleName}\n className=\"hjm-password-field__toggle\"\n data-revealed={revealed || undefined}\n disabled={disabled}\n onClick={() => {\n const input = inputRef.current;\n if (input && input.selectionStart !== null && input.selectionEnd !== null) {\n selectionRef.current = {\n start: input.selectionStart,\n end: input.selectionEnd,\n };\n }\n setRevealed(!revealed);\n }}\n type=\"button\"\n >\n {renderToggleIcon?.(toggleAppearance) ?? <Icon name={toggleAppearance.name} size=\"sm\" />}\n </button>\n )}\n type={resolved.webInputType}\n value={value}\n />\n </FieldDisabledOpacityContext.Provider>\n );\n },\n);\n\nexport type OtpFieldProps = Omit<\n TextFieldProps,\n | \"autoComplete\"\n | \"defaultValue\"\n | \"leading\"\n | \"maxLength\"\n | \"shape\"\n | \"size\"\n | \"trailing\"\n | \"type\"\n | \"value\"\n | \"variant\"\n> &\n Readonly<{\n length: number;\n value?: string;\n defaultValue?: string;\n onValueChange?: (value: string) => void;\n onComplete?: (value: string) => void;\n size?: OtpFieldSize;\n presentation?: OtpFieldPresentation;\n busy?: boolean;\n }>;\n\n/** One accessible numeric input rendered as decorative OTP slots. */\nexport const OtpField = forwardRef<HTMLInputElement, OtpFieldProps>(\n function OtpField(\n {\n id,\n label,\n description,\n error,\n required,\n disabled,\n readOnly,\n busy = false,\n length,\n value: valueProp,\n defaultValue = \"\",\n onValueChange,\n onComplete,\n onChange,\n size = otpFieldRecipe.defaults.size,\n presentation = \"boxes\",\n fieldClassName,\n className,\n onFocus,\n onBlur,\n \"aria-describedby\": ariaDescribedBy,\n \"aria-invalid\": ariaInvalid,\n \"aria-label\": ariaLabel,\n layoutStyle,\n ...props\n },\n ref,\n ) {\n const ids = useFieldIds(id);\n const [focused, setFocused] = useState(false);\n requireFieldAccessibleName(label, ariaLabel);\n const [value, setValue] = useControllableState({\n ...(valueProp === undefined ? {} : { value: valueProp }),\n defaultValue: resolveOtpFieldValue(length, defaultValue),\n ...(onValueChange === undefined ? {} : { onChange: onValueChange }),\n });\n const slots = getOtpFieldSlotValues({ length, value });\n const complete = value.length === length;\n const wasCompleteRef = useRef(complete);\n useEffect(() => {\n if (complete && !wasCompleteRef.current) onComplete?.(value);\n wasCompleteRef.current = complete;\n }, [complete, onComplete, value]);\n const activeIndex = Math.min(value.length, length - 1);\n\n return (\n <FieldFrame\n className={classNames(\"hjm-otp-field\", fieldClassName)}\n disabledOpacity={otpFieldRecipe.states.disabledOpacity}\n {...(layoutStyle === undefined ? {} : { layoutStyle })}\n controlId={ids.controlId}\n description={description}\n disabled={(disabled ?? false) || busy}\n error={error}\n focused={focused}\n label={label}\n required={required ?? false}\n {...(description ? { descriptionId: ids.descriptionId } : {})}\n {...(error ? { errorId: ids.errorId } : {})}\n >\n <div\n className=\"hjm-otp-field__control\"\n data-presentation={presentation}\n data-complete={complete || undefined}\n data-size={size}\n style={{ \"--hjm-otp-length\": length } as CSSProperties}\n >\n <input\n {...props}\n ref={ref}\n aria-busy={busy || undefined}\n aria-describedby={describedBy(\n ariaDescribedBy,\n description,\n error,\n ids.descriptionId,\n ids.errorId,\n )}\n aria-invalid={error ? true : ariaInvalid}\n aria-label={ariaLabel}\n autoComplete=\"one-time-code\"\n className={classNames(\"hjm-otp-field__input\", className)}\n // busy stays focusable (read-only); see otp-field.md.\n disabled={disabled}\n id={ids.controlId}\n inputMode=\"numeric\"\n maxLength={length}\n onBlur={(event) => {\n setFocused(false);\n onBlur?.(event);\n }}\n onChange={(event) => {\n setValue(resolveOtpFieldValue(length, event.currentTarget.value));\n onChange?.(event);\n }}\n onFocus={(event) => {\n setFocused(true);\n onFocus?.(event);\n }}\n pattern=\"[0-9]*\"\n readOnly={readOnly || busy}\n required={required}\n type=\"text\"\n value={value}\n />\n <div aria-hidden=\"true\" className=\"hjm-otp-field__slots\">\n {slots.map((digit, index) => (\n <span\n className=\"hjm-otp-field__slot\"\n data-state={error\n ? \"invalid\"\n : focused && index === activeIndex\n ? \"focused\"\n : digit\n ? \"filled\"\n : \"idle\"}\n key={index}\n >\n {digit}\n </span>\n ))}\n </div>\n </div>\n </FieldFrame>\n );\n },\n);\n"]}
|
|
@@ -18,6 +18,7 @@ export type ModalLayerRef = {
|
|
|
18
18
|
export type InitialFocusScopeHandle = Readonly<{
|
|
19
19
|
registry: Registry;
|
|
20
20
|
layer: ModalLayerRef | null;
|
|
21
|
+
enabled: boolean;
|
|
21
22
|
/**
|
|
22
23
|
* Overlays only: runs entry when the modal activates and returns the field for `useModalFocus` to focus. `explicit`
|
|
23
24
|
* means the overlay already has an `initialFocusRef`, so entry settles without choosing a field.
|
|
@@ -28,10 +29,11 @@ export type InitialFocusScopeHandle = Readonly<{
|
|
|
28
29
|
* Screen scopes enter on mount (Web has no enter transition to wait for); overlays pass `layer` and enter through
|
|
29
30
|
* `useModalFocus`. User pointer, key, wheel or touch input while no modal is above the scope ends the entry window.
|
|
30
31
|
*/
|
|
31
|
-
export declare function useInitialFocusScope({ mode, active, layer: ownLayer }: {
|
|
32
|
+
export declare function useInitialFocusScope({ mode, active, layer: ownLayer, enabled }: {
|
|
32
33
|
mode: InitialFocusMode;
|
|
33
34
|
active?: boolean;
|
|
34
35
|
layer?: ModalLayerRef;
|
|
36
|
+
enabled?: boolean;
|
|
35
37
|
}): InitialFocusScopeHandle;
|
|
36
38
|
export declare function InitialFocusProvider({ scope, children }: {
|
|
37
39
|
scope: InitialFocusScopeHandle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initial-focus.d.ts","sourceRoot":"","sources":["../../src/internal/initial-focus.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6F,KAAK,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3K,OAAO,EAA0E,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/H,OAAO,EAAoC,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAEjF,KAAK,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,OAAO,GAAG,SAAS,CAAC;IAAC,OAAO,IAAI,WAAW,GAAG,IAAI,CAAC;IAAC,SAAS,IAAI,OAAO,CAAA;CAAE,CAAC;AACrH,KAAK,QAAQ,GAAG;IAAE,SAAS,IAAI,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,IAAI,CAAA;CAAE,CAAC;AAC9F,qGAAqG;AACrG,MAAM,MAAM,aAAa,GAAG;IAAE,OAAO,EAAE,WAAW,GAAG,I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AAE,OAAO,CAAA;CAAE,GAAG,uBAAuB,CA8F9M;AAED,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,KAAK,EAAE,uBAAuB,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAEhH;AAED,iHAAiH;AACjH,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAGpG;AAED,8GAA8G;AAC9G,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,UAAU,EAAE,OAAO,GAAG,SAAS,QAe5G"}
|
|
@@ -8,6 +8,8 @@ import { getTopModal, subscribeModalClose } from "../modal.js";
|
|
|
8
8
|
* scope with mode "none" still owns its fields so they never reach an outer scope.
|
|
9
9
|
*/
|
|
10
10
|
const InitialFocusContext = createContext(null);
|
|
11
|
+
// A bottom sheet owns this boundary, including ScreenLayout/marked fields nested inside its body.
|
|
12
|
+
const EntryFocusEnabledContext = createContext(true);
|
|
11
13
|
/** Layer of the enclosing HJM overlay; null on the page itself. A ScreenLayout inside a sheet uses the sheet's. */
|
|
12
14
|
const ModalLayerContext = createContext(null);
|
|
13
15
|
/**
|
|
@@ -32,8 +34,13 @@ function isEditable(element) {
|
|
|
32
34
|
* Screen scopes enter on mount (Web has no enter transition to wait for); overlays pass `layer` and enter through
|
|
33
35
|
* `useModalFocus`. User pointer, key, wheel or touch input while no modal is above the scope ends the entry window.
|
|
34
36
|
*/
|
|
35
|
-
export function useInitialFocusScope({ mode, active = true, layer: ownLayer }) {
|
|
37
|
+
export function useInitialFocusScope({ mode, active = true, layer: ownLayer, enabled = true }) {
|
|
36
38
|
const inherited = useContext(ModalLayerContext);
|
|
39
|
+
const inheritedEnabled = useContext(EntryFocusEnabledContext);
|
|
40
|
+
// A separate overlay owns its policy; ordinary nested screens inherit their enclosing sheet's policy.
|
|
41
|
+
const entryFocusEnabled = enabled && (ownLayer !== undefined || inheritedEnabled);
|
|
42
|
+
const enabledRef = useRef(entryFocusEnabled);
|
|
43
|
+
enabledRef.current = entryFocusEnabled;
|
|
37
44
|
const layer = ownLayer ?? inherited;
|
|
38
45
|
const overlay = ownLayer !== undefined;
|
|
39
46
|
const modeRef = useRef(mode);
|
|
@@ -56,6 +63,8 @@ export function useInitialFocusScope({ mode, active = true, layer: ownLayer }) {
|
|
|
56
63
|
return productModalAbove(fields);
|
|
57
64
|
};
|
|
58
65
|
const dispatch = (event) => {
|
|
66
|
+
if (!enabledRef.current)
|
|
67
|
+
return null;
|
|
59
68
|
const candidates = [...s.entries].map(entry => ({ entry, order: entry.order, preference: entry.preference, focusable: entry.focusable() }));
|
|
60
69
|
const resolved = event.kind === "register" && "entry" in event
|
|
61
70
|
? { kind: "register", field: candidates.find(candidate => candidate.entry === event.entry) }
|
|
@@ -144,11 +153,11 @@ export function useInitialFocusScope({ mode, active = true, layer: ownLayer }) {
|
|
|
144
153
|
unsubscribe();
|
|
145
154
|
scope.dispatch({ kind: "deactivate" });
|
|
146
155
|
};
|
|
147
|
-
}, [active, overlay, scope]);
|
|
148
|
-
return useMemo(() => ({ registry: scope.registry, layer: scope.layer, enter: scope.enter }), [scope]);
|
|
156
|
+
}, [active, overlay, scope, entryFocusEnabled]);
|
|
157
|
+
return useMemo(() => ({ registry: scope.registry, layer: scope.layer, enter: scope.enter, enabled: entryFocusEnabled }), [scope, entryFocusEnabled]);
|
|
149
158
|
}
|
|
150
159
|
export function InitialFocusProvider({ scope, children }) {
|
|
151
|
-
return _jsx(ModalLayerContext.Provider, { value: scope.layer, children: _jsx(InitialFocusContext.Provider, { value: scope.registry, children: children }) });
|
|
160
|
+
return _jsx(EntryFocusEnabledContext.Provider, { value: scope.enabled, children: _jsx(ModalLayerContext.Provider, { value: scope.layer, children: _jsx(InitialFocusContext.Provider, { value: scope.registry, children: children }) }) });
|
|
152
161
|
}
|
|
153
162
|
/** Screen scope: focuses the chosen field on mount, never over a field the user is in or under an open modal. */
|
|
154
163
|
export function InitialFocusScope({ mode, children }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initial-focus.js","sourceRoot":"","sources":["../../src/internal/initial-focus.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAiG,MAAM,yCAAyC,CAAC;AAC3K,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAkC,MAAM,OAAO,CAAC;AAC/H,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAoB,MAAM,aAAa,CAAC;AAOjF;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,aAAa,CAAkB,IAAI,CAAC,CAAC;AACjE,mHAAmH;AACnH,MAAM,iBAAiB,GAAG,aAAa,CAAuB,IAAI,CAAC,CAAC;AAGpE;;;;GAIG;AACH,MAAM,YAAY,GAAG,IAAI,OAAO,EAAmC,CAAC;AAEpE;;;GAGG;AACH,SAAS,iBAAiB,CAAC,MAA8B;IACvD,OAAO,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,mCAAmC,CAAC,CAAC;SACvE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACjE,CAAC;AAED,SAAS,UAAU,CAAC,OAAuB;IACzC,OAAO,OAAO,YAAY,gBAAgB,IAAI,OAAO,YAAY,mBAAmB,IAAI,OAAO,YAAY,iBAAiB;WACvH,CAAC,OAAO,YAAY,WAAW,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACrE,CAAC;AAaD;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,K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M,CAAgB,IAAI,CAAC,CAAC;IAC1C,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,QAAQ;YAAE,OAAO,SAAS,CAAC;QAChC,iHAAiH;QACjH,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,KAAK,IAAI,CAAC;QACvC,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC,SAAS,EAAE,CAAC;QACvC,OAAO,QAAQ,CAAC,QAAQ,CAAC;YACvB,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO;YAChE,4DAA4D;YAC5D,SAAS,EAAE,GAAG,EAAE,GAAG,MAAM,IAAI,GAAG,OAAO,CAAC,OAA0D,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;SACzJ,EAAE,OAAO,CAAC,CAAC;IACd,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { resolveEntryFocus, type EntryFocusEvent, type EntryFocusPhase, type InitialFocusCandidate, type InitialFocusMode } from \"@hjmds/design-contracts/screen-patterns\";\nimport { createContext, useContext, useEffect, useLayoutEffect, useMemo, useRef, type ReactNode, type RefObject } from \"react\";\nimport { getTopModal, subscribeModalClose, type ActiveModal } from \"../modal.js\";\n\ntype Entry = { order: number; preference: boolean | undefined; element(): HTMLElement | null; focusable(): boolean };\ntype Registry = { nextOrder(): number; register(entry: Entry, mounted: boolean): () => void };\n/** The overlay's own entry on the shared modal stack while it is active (set by `useModalFocus`). */\nexport type ModalLayerRef = { current: ActiveModal | null };\n\n/**\n * Nearest screen/overlay scope that chooses the field focused on entry (rules: screen-patterns `resolveEntryFocus`,\n * shared with Native). Fields register by context, the same model as Native, instead of the scope querying the DOM; a\n * scope with mode \"none\" still owns its fields so they never reach an outer scope.\n */\nconst InitialFocusContext = createContext<Registry | null>(null);\n/** Layer of the enclosing HJM overlay; null on the page itself. A ScreenLayout inside a sheet uses the sheet's. */\nconst ModalLayerContext = createContext<ModalLayerRef | null>(null);\n\ntype NestedScope = { enter(): HTMLElement | null; settle(): void };\n/**\n * Screen scopes rendered inside an HJM overlay, keyed by that overlay's layer. Their fields register with the screen,\n * not the overlay, so the overlay's activation asks them for the entry field instead of focusing its first control\n * over them (BurnTok search: a ScreenLayout in a Sheet left focus on the close button, 2026-10-18).\n */\nconst nestedScopes = new WeakMap<ModalLayerRef, Set<NestedScope>>();\n\n/**\n * Product modals (not on the HJM stack) layered above the scope. A product modal that contains the scope's own fields\n * wraps the screen rather than covering it, so it does not block (BurnTok search overlay, 2026-10-18).\n */\nfunction productModalAbove(fields: readonly HTMLElement[]): boolean {\n return [...document.querySelectorAll('[aria-modal=\"true\"], dialog[open]')]\n .some(modal => !fields.some(field => modal.contains(field)));\n}\n\nfunction isEditable(element: Element | null): boolean {\n return element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement || element instanceof HTMLSelectElement\n || (element instanceof HTMLElement && element.isContentEditable);\n}\n\ntype Candidate = InitialFocusCandidate & { entry: Entry };\nexport type InitialFocusScopeHandle = Readonly<{\n registry: Registry;\n layer: ModalLayerRef | null;\n /**\n * Overlays only: runs entry when the modal activates and returns the field for `useModalFocus` to focus. `explicit`\n * means the overlay already has an `initialFocusRef`, so entry settles without choosing a field.\n */\n enter(explicit: boolean): HTMLElement | null;\n}>;\n\n/**\n * Screen scopes enter on mount (Web has no enter transition to wait for); overlays pass `layer` and enter through\n * `useModalFocus`. User pointer, key, wheel or touch input while no modal is above the scope ends the entry window.\n */\nexport function useInitialFocusScope({ mode, active = true, layer: ownLayer }: { mode: InitialFocusMode; active?: boolean; layer?: ModalLayerRef }): InitialFocusScopeHandle {\n const inherited = useContext(ModalLayerContext);\n const layer = ownLayer ?? inherited;\n const overlay = ownLayer !== undefined;\n const modeRef = useRef(mode); modeRef.current = mode;\n const state = useRef({ phase: \"inactive\" as EntryFocusPhase, entries: new Set<Entry>(), fresh: new Set<Entry>(), counter: 0, flushQueued: false });\n\n const scope = useMemo(() => {\n const s = state.current;\n const blocked = () => {\n const own = layer?.current ?? null;\n // Inside an HJM overlay that is not on the stack yet: its activation runs this scope's entry (`nestedScopes`).\n if (layer !== null && own === null) return true;\n const top = getTopModal();\n if (top) return top !== own;\n // A product's own modal above the page still covers it; overlay content is portaled outside product markup.\n if (layer !== null) return false;\n const fields = [...s.entries].map(entry => entry.element()).filter((element): element is HTMLElement => element !== null);\n return productModalAbove(fields);\n };\n const dispatch = (event: EntryFocusEvent<Candidate> | { kind: \"register\"; entry: Entry }): HTMLElement | null => {\n const candidates: Candidate[] = [...s.entries].map(entry => ({ entry, order: entry.order, preference: entry.preference, focusable: entry.focusable() }));\n const resolved = event.kind === \"register\" && \"entry\" in event\n ? { kind: \"register\" as const, field: candidates.find(candidate => candidate.entry === event.entry)! }\n : event as EntryFocusEvent<Candidate>;\n const result = resolveEntryFocus(s.phase, resolved, { mode: modeRef.current, candidates, blocked: blocked(), textEntryFocused: isEditable(document.activeElement) });\n s.phase = result.phase;\n return result.target?.entry.element() ?? null;\n };\n const focus = (target: HTMLElement | null) => target?.focus({ preventScroll: true });\n // Fields mounting in one commit are judged together.\n const flush = () => {\n s.flushQueued = false;\n const fresh = [...s.fresh].filter(entry => s.entries.has(entry)).sort((a, b) => a.order - b.order);\n s.fresh.clear();\n const field = fresh.find(entry => entry.preference === true) ?? fresh[0];\n if (field) focus(dispatch({ kind: \"register\", entry: field }));\n };\n const registry: Registry = {\n nextOrder: () => s.counter++,\n register(entry, mounted) {\n s.entries.add(entry);\n if (mounted) { s.fresh.add(entry); if (!s.flushQueued) { s.flushQueued = true; queueMicrotask(flush); } }\n return () => { s.entries.delete(entry); s.fresh.delete(entry); };\n },\n };\n const settle = () => { s.phase = \"settled\"; };\n const enter = (explicit: boolean) => {\n s.fresh.clear();\n dispatch({ kind: \"activate\" });\n const nested = overlay && layer ? [...(nestedScopes.get(layer) ?? [])] : [];\n if (explicit) { settle(); for (const scope of nested) scope.settle(); return null; }\n const own = dispatch({ kind: \"enter\" });\n if (own) return own;\n for (const scope of nested) { const target = scope.enter(); if (target) return target; }\n return null;\n };\n return { registry, layer, dispatch, focus, enter, settle };\n }, [layer, overlay]);\n\n useEffect(() => {\n if (!active) { scope.dispatch({ kind: \"deactivate\" }); return undefined; }\n // After every effect of this commit, so a modal opening in the same commit (an app-root consent dialog) is\n // already on the stack and blocks entry instead of taking focus away and handing it back later.\n let cancelled = false;\n if (!overlay) queueMicrotask(() => { if (!cancelled) scope.focus(scope.enter(false)); });\n // A screen inside an overlay that activates later enters when the overlay does (see `enter`).\n let nested: Set<NestedScope> | undefined;\n const nestedEntry: NestedScope = { enter: () => scope.enter(false), settle: scope.settle };\n if (!overlay && scope.layer) {\n nested = nestedScopes.get(scope.layer) ?? new Set();\n nestedScopes.set(scope.layer, nested);\n nested.add(nestedEntry);\n }\n const interact = () => { scope.dispatch({ kind: \"interact\" }); };\n const events = [\"pointerdown\", \"keydown\", \"wheel\", \"touchstart\"] as const;\n for (const type of events) document.addEventListener(type, interact, true);\n // A modal above closed (after its return focus ran): retry a pending entry.\n const unsubscribe = subscribeModalClose(() => scope.focus(scope.dispatch({ kind: \"unblock\" })));\n return () => {\n cancelled = true;\n nested?.delete(nestedEntry);\n for (const type of events) document.removeEventListener(type, interact, true);\n unsubscribe();\n scope.dispatch({ kind: \"deactivate\" });\n };\n }, [active, overlay, scope]);\n\n return useMemo(() => ({ registry: scope.registry, layer: scope.layer, enter: scope.enter }), [scope]);\n}\n\nexport function InitialFocusProvider({ scope, children }: { scope: InitialFocusScopeHandle; children: ReactNode }) {\n return <ModalLayerContext.Provider value={scope.layer}><InitialFocusContext.Provider value={scope.registry}>{children}</InitialFocusContext.Provider></ModalLayerContext.Provider>;\n}\n\n/** Screen scope: focuses the chosen field on mount, never over a field the user is in or under an open modal. */\nexport function InitialFocusScope({ mode, children }: { mode: InitialFocusMode; children: ReactNode }) {\n const scope = useInitialFocusScope({ mode });\n return <InitialFocusProvider scope={scope}>{children}</InitialFocusProvider>;\n}\n\n/** Registers a text field with the nearest scope. `preference` is the field's public `initialFocusTarget`. */\nexport function useInitialFocusTarget(element: RefObject<HTMLElement | null>, preference: boolean | undefined) {\n const registry = useContext(InitialFocusContext);\n // Tree order is fixed at first registration, so changing `preference` later does not move the field to the end.\n const order = useRef<number | null>(null);\n useLayoutEffect(() => {\n if (!registry) return undefined;\n // Only the first registration of this field instance counts as \"appeared\"; a later `preference` change does not.\n const mounted = order.current === null;\n order.current ??= registry.nextOrder();\n return registry.register({\n order: order.current, preference, element: () => element.current,\n // Disabled and read-only fields are never focused on entry.\n focusable: () => { const node = element.current as (HTMLInputElement | HTMLTextAreaElement | null); return !!node && !node.disabled && !node.readOnly; },\n }, mounted);\n }, [registry, preference, element]);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"initial-focus.js","sourceRoot":"","sources":["../../src/internal/initial-focus.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAiG,MAAM,yCAAyC,CAAC;AAC3K,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAkC,MAAM,OAAO,CAAC;AAC/H,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAoB,MAAM,aAAa,CAAC;AAOjF;;;;GAIG;AACH,MAAM,mBAAmB,GAAG,aAAa,CAAkB,IAAI,CAAC,CAAC;AACjE,kGAAkG;AAClG,MAAM,wBAAwB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;AACrD,mHAAmH;AACnH,MAAM,iBAAiB,GAAG,aAAa,CAAuB,IAAI,CAAC,CAAC;AAGpE;;;;GAIG;AACH,MAAM,YAAY,GAAG,IAAI,OAAO,EAAmC,CAAC;AAEpE;;;GAGG;AACH,SAAS,iBAAiB,CAAC,MAA8B;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AAS,EAAE,CAAC;QACvC,OAAO,QAAQ,CAAC,QAAQ,CAAC;YACvB,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO;YAChE,4DAA4D;YAC5D,SAAS,EAAE,GAAG,EAAE,GAAG,MAAM,IAAI,GAAG,OAAO,CAAC,OAA0D,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;SACzJ,EAAE,OAAO,CAAC,CAAC;IACd,CAAC,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;AACtC,CAAC","sourcesContent":["import { resolveEntryFocus, type EntryFocusEvent, type EntryFocusPhase, type InitialFocusCandidate, type InitialFocusMode } from \"@hjmds/design-contracts/screen-patterns\";\nimport { createContext, useContext, useEffect, useLayoutEffect, useMemo, useRef, type ReactNode, type RefObject } from \"react\";\nimport { getTopModal, subscribeModalClose, type ActiveModal } from \"../modal.js\";\n\ntype Entry = { order: number; preference: boolean | undefined; element(): HTMLElement | null; focusable(): boolean };\ntype Registry = { nextOrder(): number; register(entry: Entry, mounted: boolean): () => void };\n/** The overlay's own entry on the shared modal stack while it is active (set by `useModalFocus`). */\nexport type ModalLayerRef = { current: ActiveModal | null };\n\n/**\n * Nearest screen/overlay scope that chooses the field focused on entry (rules: screen-patterns `resolveEntryFocus`,\n * shared with Native). Fields register by context, the same model as Native, instead of the scope querying the DOM; a\n * scope with mode \"none\" still owns its fields so they never reach an outer scope.\n */\nconst InitialFocusContext = createContext<Registry | null>(null);\n// A bottom sheet owns this boundary, including ScreenLayout/marked fields nested inside its body.\nconst EntryFocusEnabledContext = createContext(true);\n/** Layer of the enclosing HJM overlay; null on the page itself. A ScreenLayout inside a sheet uses the sheet's. */\nconst ModalLayerContext = createContext<ModalLayerRef | null>(null);\n\ntype NestedScope = { enter(): HTMLElement | null; settle(): void };\n/**\n * Screen scopes rendered inside an HJM overlay, keyed by that overlay's layer. Their fields register with the screen,\n * not the overlay, so the overlay's activation asks them for the entry field instead of focusing its first control\n * over them (BurnTok search: a ScreenLayout in a Sheet left focus on the close button, 2026-10-18).\n */\nconst nestedScopes = new WeakMap<ModalLayerRef, Set<NestedScope>>();\n\n/**\n * Product modals (not on the HJM stack) layered above the scope. A product modal that contains the scope's own fields\n * wraps the screen rather than covering it, so it does not block (BurnTok search overlay, 2026-10-18).\n */\nfunction productModalAbove(fields: readonly HTMLElement[]): boolean {\n return [...document.querySelectorAll('[aria-modal=\"true\"], dialog[open]')]\n .some(modal => !fields.some(field => modal.contains(field)));\n}\n\nfunction isEditable(element: Element | null): boolean {\n return element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement || element instanceof HTMLSelectElement\n || (element instanceof HTMLElement && element.isContentEditable);\n}\n\ntype Candidate = InitialFocusCandidate & { entry: Entry };\nexport type InitialFocusScopeHandle = Readonly<{\n registry: Registry;\n layer: ModalLayerRef | null;\n enabled: boolean;\n /**\n * Overlays only: runs entry when the modal activates and returns the field for `useModalFocus` to focus. `explicit`\n * means the overlay already has an `initialFocusRef`, so entry settles without choosing a field.\n */\n enter(explicit: boolean): HTMLElement | null;\n}>;\n\n/**\n * Screen scopes enter on mount (Web has no enter transition to wait for); overlays pass `layer` and enter through\n * `useModalFocus`. User pointer, key, wheel or touch input while no modal is above the scope ends the entry window.\n */\nexport function useInitialFocusScope({ mode, active = true, layer: ownLayer, enabled = true }: { mode: InitialFocusMode; active?: boolean; layer?: ModalLayerRef; enabled?: boolean }): InitialFocusScopeHandle {\n const inherited = useContext(ModalLayerContext);\n const inheritedEnabled = useContext(EntryFocusEnabledContext);\n // A separate overlay owns its policy; ordinary nested screens inherit their enclosing sheet's policy.\n const entryFocusEnabled = enabled && (ownLayer !== undefined || inheritedEnabled);\n const enabledRef = useRef(entryFocusEnabled); enabledRef.current = entryFocusEnabled;\n const layer = ownLayer ?? inherited;\n const overlay = ownLayer !== undefined;\n const modeRef = useRef(mode); modeRef.current = mode;\n const state = useRef({ phase: \"inactive\" as EntryFocusPhase, entries: new Set<Entry>(), fresh: new Set<Entry>(), counter: 0, flushQueued: false });\n\n const scope = useMemo(() => {\n const s = state.current;\n const blocked = () => {\n const own = layer?.current ?? null;\n // Inside an HJM overlay that is not on the stack yet: its activation runs this scope's entry (`nestedScopes`).\n if (layer !== null && own === null) return true;\n const top = getTopModal();\n if (top) return top !== own;\n // A product's own modal above the page still covers it; overlay content is portaled outside product markup.\n if (layer !== null) return false;\n const fields = [...s.entries].map(entry => entry.element()).filter((element): element is HTMLElement => element !== null);\n return productModalAbove(fields);\n };\n const dispatch = (event: EntryFocusEvent<Candidate> | { kind: \"register\"; entry: Entry }): HTMLElement | null => {\n if (!enabledRef.current) return null;\n const candidates: Candidate[] = [...s.entries].map(entry => ({ entry, order: entry.order, preference: entry.preference, focusable: entry.focusable() }));\n const resolved = event.kind === \"register\" && \"entry\" in event\n ? { kind: \"register\" as const, field: candidates.find(candidate => candidate.entry === event.entry)! }\n : event as EntryFocusEvent<Candidate>;\n const result = resolveEntryFocus(s.phase, resolved, { mode: modeRef.current, candidates, blocked: blocked(), textEntryFocused: isEditable(document.activeElement) });\n s.phase = result.phase;\n return result.target?.entry.element() ?? null;\n };\n const focus = (target: HTMLElement | null) => target?.focus({ preventScroll: true });\n // Fields mounting in one commit are judged together.\n const flush = () => {\n s.flushQueued = false;\n const fresh = [...s.fresh].filter(entry => s.entries.has(entry)).sort((a, b) => a.order - b.order);\n s.fresh.clear();\n const field = fresh.find(entry => entry.preference === true) ?? fresh[0];\n if (field) focus(dispatch({ kind: \"register\", entry: field }));\n };\n const registry: Registry = {\n nextOrder: () => s.counter++,\n register(entry, mounted) {\n s.entries.add(entry);\n if (mounted) { s.fresh.add(entry); if (!s.flushQueued) { s.flushQueued = true; queueMicrotask(flush); } }\n return () => { s.entries.delete(entry); s.fresh.delete(entry); };\n },\n };\n const settle = () => { s.phase = \"settled\"; };\n const enter = (explicit: boolean) => {\n s.fresh.clear();\n dispatch({ kind: \"activate\" });\n const nested = overlay && layer ? [...(nestedScopes.get(layer) ?? [])] : [];\n if (explicit) { settle(); for (const scope of nested) scope.settle(); return null; }\n const own = dispatch({ kind: \"enter\" });\n if (own) return own;\n for (const scope of nested) { const target = scope.enter(); if (target) return target; }\n return null;\n };\n return { registry, layer, dispatch, focus, enter, settle };\n }, [layer, overlay]);\n\n useEffect(() => {\n if (!active) { scope.dispatch({ kind: \"deactivate\" }); return undefined; }\n // After every effect of this commit, so a modal opening in the same commit (an app-root consent dialog) is\n // already on the stack and blocks entry instead of taking focus away and handing it back later.\n let cancelled = false;\n if (!overlay) queueMicrotask(() => { if (!cancelled) scope.focus(scope.enter(false)); });\n // A screen inside an overlay that activates later enters when the overlay does (see `enter`).\n let nested: Set<NestedScope> | undefined;\n const nestedEntry: NestedScope = { enter: () => scope.enter(false), settle: scope.settle };\n if (!overlay && scope.layer) {\n nested = nestedScopes.get(scope.layer) ?? new Set();\n nestedScopes.set(scope.layer, nested);\n nested.add(nestedEntry);\n }\n const interact = () => { scope.dispatch({ kind: \"interact\" }); };\n const events = [\"pointerdown\", \"keydown\", \"wheel\", \"touchstart\"] as const;\n for (const type of events) document.addEventListener(type, interact, true);\n // A modal above closed (after its return focus ran): retry a pending entry.\n const unsubscribe = subscribeModalClose(() => scope.focus(scope.dispatch({ kind: \"unblock\" })));\n return () => {\n cancelled = true;\n nested?.delete(nestedEntry);\n for (const type of events) document.removeEventListener(type, interact, true);\n unsubscribe();\n scope.dispatch({ kind: \"deactivate\" });\n };\n }, [active, overlay, scope, entryFocusEnabled]);\n\n return useMemo(() => ({ registry: scope.registry, layer: scope.layer, enter: scope.enter, enabled: entryFocusEnabled }), [scope, entryFocusEnabled]);\n}\n\nexport function InitialFocusProvider({ scope, children }: { scope: InitialFocusScopeHandle; children: ReactNode }) {\n return <EntryFocusEnabledContext.Provider value={scope.enabled}><ModalLayerContext.Provider value={scope.layer}><InitialFocusContext.Provider value={scope.registry}>{children}</InitialFocusContext.Provider></ModalLayerContext.Provider></EntryFocusEnabledContext.Provider>;\n}\n\n/** Screen scope: focuses the chosen field on mount, never over a field the user is in or under an open modal. */\nexport function InitialFocusScope({ mode, children }: { mode: InitialFocusMode; children: ReactNode }) {\n const scope = useInitialFocusScope({ mode });\n return <InitialFocusProvider scope={scope}>{children}</InitialFocusProvider>;\n}\n\n/** Registers a text field with the nearest scope. `preference` is the field's public `initialFocusTarget`. */\nexport function useInitialFocusTarget(element: RefObject<HTMLElement | null>, preference: boolean | undefined) {\n const registry = useContext(InitialFocusContext);\n // Tree order is fixed at first registration, so changing `preference` later does not move the field to the end.\n const order = useRef<number | null>(null);\n useLayoutEffect(() => {\n if (!registry) return undefined;\n // Only the first registration of this field instance counts as \"appeared\"; a later `preference` change does not.\n const mounted = order.current === null;\n order.current ??= registry.nextOrder();\n return registry.register({\n order: order.current, preference, element: () => element.current,\n // Disabled and read-only fields are never focused on entry.\n focusable: () => { const node = element.current as (HTMLInputElement | HTMLTextAreaElement | null); return !!node && !node.disabled && !node.readOnly; },\n }, mounted);\n }, [registry, preference, element]);\n}\n"]}
|
package/dist/overlays.d.ts
CHANGED
|
@@ -104,11 +104,11 @@ export type SheetProps = ModalOpenState<SheetOpenChangeDetails> & Readonly<{
|
|
|
104
104
|
dismissPolicy?: Partial<SheetDismissPolicy>;
|
|
105
105
|
/** Localized accessible name for the close action. */
|
|
106
106
|
closeLabel: string;
|
|
107
|
+
/** Side sheets only. Bottom sheets focus their modal container, never an input on opening. */
|
|
107
108
|
initialFocusRef?: React.RefObject<HTMLElement | null>;
|
|
108
109
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* element (2026-10-18, screen-patterns rules shared with Native).
|
|
110
|
+
* Side sheets only: same text-entry selection as Dialog. Bottom sheets disable automatic input focus,
|
|
111
|
+
* including nested screens and marked fields (2026-10-18 page-entry policy).
|
|
112
112
|
*/
|
|
113
113
|
initialFocus?: InitialFocusMode;
|
|
114
114
|
returnFocusRef?: React.RefObject<HTMLElement | null>;
|