@azx-pbc/axiom-web 0.0.0-stage → 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +161 -2
  3. package/dist/address.d.ts +32 -0
  4. package/dist/address.d.ts.map +1 -0
  5. package/dist/address.js +146 -0
  6. package/dist/address.js.map +1 -0
  7. package/dist/capture/MediaCapture.d.ts +45 -0
  8. package/dist/capture/MediaCapture.d.ts.map +1 -0
  9. package/dist/capture/MediaCapture.js +669 -0
  10. package/dist/capture/MediaCapture.js.map +1 -0
  11. package/dist/capture/SignatureCapture.d.ts +31 -0
  12. package/dist/capture/SignatureCapture.d.ts.map +1 -0
  13. package/dist/capture/SignatureCapture.js +329 -0
  14. package/dist/capture/SignatureCapture.js.map +1 -0
  15. package/dist/capture/copy.d.ts +101 -0
  16. package/dist/capture/copy.d.ts.map +1 -0
  17. package/dist/capture/copy.js +1369 -0
  18. package/dist/capture/copy.js.map +1 -0
  19. package/dist/capture/index.d.ts +19 -0
  20. package/dist/capture/index.d.ts.map +1 -0
  21. package/dist/capture/index.js +14 -0
  22. package/dist/capture/index.js.map +1 -0
  23. package/dist/capture/media-kind.d.ts +16 -0
  24. package/dist/capture/media-kind.d.ts.map +1 -0
  25. package/dist/capture/media-kind.js +64 -0
  26. package/dist/capture/media-kind.js.map +1 -0
  27. package/dist/capture/permissions.d.ts +109 -0
  28. package/dist/capture/permissions.d.ts.map +1 -0
  29. package/dist/capture/permissions.js +172 -0
  30. package/dist/capture/permissions.js.map +1 -0
  31. package/dist/capture/refusal.d.ts +13 -0
  32. package/dist/capture/refusal.d.ts.map +1 -0
  33. package/dist/capture/refusal.js +16 -0
  34. package/dist/capture/refusal.js.map +1 -0
  35. package/dist/controls.d.ts +64 -0
  36. package/dist/controls.d.ts.map +1 -0
  37. package/dist/controls.js +2524 -0
  38. package/dist/controls.js.map +1 -0
  39. package/dist/coordinate.d.ts +38 -0
  40. package/dist/coordinate.d.ts.map +1 -0
  41. package/dist/coordinate.js +220 -0
  42. package/dist/coordinate.js.map +1 -0
  43. package/dist/copy.d.ts +313 -0
  44. package/dist/copy.d.ts.map +1 -0
  45. package/dist/copy.js +2602 -0
  46. package/dist/copy.js.map +1 -0
  47. package/dist/countries.d.ts +14 -0
  48. package/dist/countries.d.ts.map +1 -0
  49. package/dist/countries.js +264 -0
  50. package/dist/countries.js.map +1 -0
  51. package/dist/format/calendar-locale.d.ts +19 -0
  52. package/dist/format/calendar-locale.d.ts.map +1 -0
  53. package/dist/format/calendar-locale.js +38 -0
  54. package/dist/format/calendar-locale.js.map +1 -0
  55. package/dist/format/country-names.d.ts +21 -0
  56. package/dist/format/country-names.d.ts.map +1 -0
  57. package/dist/format/country-names.js +2277 -0
  58. package/dist/format/country-names.js.map +1 -0
  59. package/dist/format/date.d.ts +58 -0
  60. package/dist/format/date.d.ts.map +1 -0
  61. package/dist/format/date.js +155 -0
  62. package/dist/format/date.js.map +1 -0
  63. package/dist/format/digits.d.ts +23 -0
  64. package/dist/format/digits.d.ts.map +1 -0
  65. package/dist/format/digits.js +46 -0
  66. package/dist/format/digits.js.map +1 -0
  67. package/dist/format/index.d.ts +28 -0
  68. package/dist/format/index.d.ts.map +1 -0
  69. package/dist/format/index.js +24 -0
  70. package/dist/format/index.js.map +1 -0
  71. package/dist/format/invariant.d.ts +8 -0
  72. package/dist/format/invariant.d.ts.map +1 -0
  73. package/dist/format/invariant.js +10 -0
  74. package/dist/format/invariant.js.map +1 -0
  75. package/dist/format/locale.d.ts +33 -0
  76. package/dist/format/locale.d.ts.map +1 -0
  77. package/dist/format/locale.js +39 -0
  78. package/dist/format/locale.js.map +1 -0
  79. package/dist/format/media-type.d.ts +8 -0
  80. package/dist/format/media-type.d.ts.map +1 -0
  81. package/dist/format/media-type.js +302 -0
  82. package/dist/format/media-type.js.map +1 -0
  83. package/dist/format/money.d.ts +52 -0
  84. package/dist/format/money.d.ts.map +1 -0
  85. package/dist/format/money.js +36 -0
  86. package/dist/format/money.js.map +1 -0
  87. package/dist/format/number.d.ts +28 -0
  88. package/dist/format/number.d.ts.map +1 -0
  89. package/dist/format/number.js +91 -0
  90. package/dist/format/number.js.map +1 -0
  91. package/dist/host.d.ts +122 -0
  92. package/dist/host.d.ts.map +1 -0
  93. package/dist/host.js +20 -0
  94. package/dist/host.js.map +1 -0
  95. package/dist/index.d.ts +57 -0
  96. package/dist/index.d.ts.map +1 -0
  97. package/dist/index.js +49 -0
  98. package/dist/index.js.map +1 -0
  99. package/dist/media.d.ts +42 -0
  100. package/dist/media.d.ts.map +1 -0
  101. package/dist/media.js +151 -0
  102. package/dist/media.js.map +1 -0
  103. package/dist/pickers/DatePicker.d.ts +35 -0
  104. package/dist/pickers/DatePicker.d.ts.map +1 -0
  105. package/dist/pickers/DatePicker.js +212 -0
  106. package/dist/pickers/DatePicker.js.map +1 -0
  107. package/dist/pickers/TimeSegments.d.ts +27 -0
  108. package/dist/pickers/TimeSegments.d.ts.map +1 -0
  109. package/dist/pickers/TimeSegments.js +82 -0
  110. package/dist/pickers/TimeSegments.js.map +1 -0
  111. package/dist/pickers/day-picker-locale.d.ts +15 -0
  112. package/dist/pickers/day-picker-locale.d.ts.map +1 -0
  113. package/dist/pickers/day-picker-locale.js +46 -0
  114. package/dist/pickers/day-picker-locale.js.map +1 -0
  115. package/dist/render/dom.d.ts +100 -0
  116. package/dist/render/dom.d.ts.map +1 -0
  117. package/dist/render/dom.js +882 -0
  118. package/dist/render/dom.js.map +1 -0
  119. package/dist/render/layout.d.ts +45 -0
  120. package/dist/render/layout.d.ts.map +1 -0
  121. package/dist/render/layout.js +8 -0
  122. package/dist/render/layout.js.map +1 -0
  123. package/dist/schedule/SchedulePicker.d.ts +46 -0
  124. package/dist/schedule/SchedulePicker.d.ts.map +1 -0
  125. package/dist/schedule/SchedulePicker.js +160 -0
  126. package/dist/schedule/SchedulePicker.js.map +1 -0
  127. package/dist/schedule/timeslot.d.ts +52 -0
  128. package/dist/schedule/timeslot.d.ts.map +1 -0
  129. package/dist/schedule/timeslot.js +265 -0
  130. package/dist/schedule/timeslot.js.map +1 -0
  131. package/dist/styles.css +2151 -0
  132. package/dist/theme/index.d.ts +12 -0
  133. package/dist/theme/index.d.ts.map +1 -0
  134. package/dist/theme/index.js +11 -0
  135. package/dist/theme/index.js.map +1 -0
  136. package/dist/theme/presets.d.ts +93 -0
  137. package/dist/theme/presets.d.ts.map +1 -0
  138. package/dist/theme/presets.js +200 -0
  139. package/dist/theme/presets.js.map +1 -0
  140. package/dist/tokens.css +234 -0
  141. package/dist/wizard-checkpoints.d.ts +18 -0
  142. package/dist/wizard-checkpoints.d.ts.map +1 -0
  143. package/dist/wizard-checkpoints.js +56 -0
  144. package/dist/wizard-checkpoints.js.map +1 -0
  145. package/package.json +76 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom.js","sourceRoot":"","sources":["../../src/render/dom.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,eAAe,EACf,QAAQ,EACR,WAAW,EACX,aAAa,EACb,YAAY,EACZ,SAAS,EACT,aAAa,EACb,SAAS,GACV,MAAM,sBAAsB,CAAC;AAW9B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGzE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAA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AQ,KAAK,SAAS;gBAAE,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;YAC5E,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;gBAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CAAC;IACF,KAAK,CAAC,MAAM,CAAC,CAAC;IACd,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,0FAA0F;AAC1F,SAAS,SAAS,CAAC,MAAc,EAAE,UAAkB;IACnD,OAAO,GAAG,MAAM,SAAS,UAAU,EAAE,CAAC;AACxC,CAAC;AAED,uFAAuF;AACvF,SAAS,SAAS,CAAC,MAAc,EAAE,MAAc;IAC/C,OAAO,GAAG,MAAM,SAAS,MAAM,EAAE,CAAC;AACpC,CAAC;AAED,mDAAmD;AACnD,SAAS,oBAAoB,CAAC,KAAY;IACxC,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import {\n fieldDomId,\n freeNaturalKey,\n renderDisplayText,\n renderLayout,\n renderRowName,\n renderValueText,\n useField,\n useIdPrefix,\n useFieldArray,\n useFormState,\n useLayout,\n useLayoutNode,\n useWizard,\n} from '@azx-pbc/axiom-react';\nimport type {\n FieldError,\n RenderErrorInput,\n RenderHeadingLevel,\n RenderNode,\n RenderRecordNode,\n RenderRecordsNode,\n RenderTranslate,\n ValueDisplay,\n} from '@azx-pbc/axiom-react';\nimport { directionOf, fieldKey, isRecord } from '@azx-pbc/axiom-runtime';\nimport type { CompiledField, FormBlocker, WireValue } from '@azx-pbc/axiom-runtime';\nimport type { FocusEvent, ReactElement, ReactNode, Ref } from 'react';\nimport { createElement, useEffect, useMemo, useRef, useState } from 'react';\nimport { Control, ControlComponentsContext } from '../controls.js';\nimport type { ControlComponents } from '../controls.js';\nimport { useHostCopy } from '../copy.js';\nimport type { HostCopy } from '../copy.js';\nimport { isDecimalString } from '../format/number.js';\nimport { LocaleContext } from '../host.js';\nimport { LayoutComponentsContext, useLayoutComponents } from './layout.js';\nimport type { LayoutComponents } from './layout.js';\nimport { WizardCheckpoints } from '../wizard-checkpoints.js';\n\n/**\n * The DOM adapter: one node kind, one piece of semantic markup.\n *\n * A section and a group are landmark containers with a heading at the depth the tree states, a\n * control is a label bound to its input, a failure is text the input is described by, and the\n * summary of every blocking reason is an alert that takes focus after a refused submit. What is\n * painted is exactly the tree `renderLayout` produced; nothing here asks which document it is in.\n *\n * Every element carries an `.ax-*` hook, and every element id is prefixed with the session's own\n * prefix, so two forms over one artifact on one page cannot collide on a heading, a section body\n * or a records container. The hooks are documented in `theme/README.md`; the sheet that styles\n * them is `theme/base.css`.\n */\n\n/** The suffix the summary's element id carries, after the session's own prefix. */\nexport const ERROR_SUMMARY_SUFFIX = 'error-summary';\n\n/** The heading level a container slot receives: the node's own when stated, else the enclosing level. */\nfunction slotLevelOf(\n node: Exclude<RenderNode, { readonly kind: 'field' }>,\n enclosingLevel: RenderHeadingLevel,\n): RenderHeadingLevel {\n switch (node.kind) {\n case 'section':\n case 'group':\n case 'step':\n case 'heading':\n case 'sop_block':\n case 'summary_card':\n return node.level;\n case 'wizard':\n return node.children[0]?.level ?? enclosingLevel;\n case 'record':\n case 'records':\n case 'callout':\n case 'divider':\n case 'error_summary':\n return enclosingLevel;\n default:\n return assertNeverNode(node);\n }\n}\n\n/** One structural element id, namespaced by the form session and the layout node that owns it. */\nfunction structuralId(idPrefix: string, nodeId: string, suffix: string): string {\n return `${idPrefix}-${nodeId}${suffix}`;\n}\n\n/** The title a container announces, or `undefined` when it has nothing to announce. */\nfunction titledOf(title: string | undefined): string | undefined {\n return title === undefined || title.trim() === '' ? undefined : title;\n}\n\nfunction heading(\n level: RenderHeadingLevel,\n id: string,\n children: ReactNode,\n focusRef?: Ref<HTMLHeadingElement>,\n): ReactElement {\n // A step heading is focusable (`tabIndex -1`) so arriving at a step can move focus to its\n // title without putting every heading in the tab order.\n return createElement(\n `h${String(level)}`,\n focusRef === undefined ? { id } : { id, ref: focusRef, tabIndex: -1 },\n children,\n );\n}\n\n/** One render tree, painted. */\n/** The width a form asks its container for. A number is rem; the three names are the scale. */\nexport type FormWidth = 'measure' | 'fill' | 'narrow' | number;\n\n/** The `data-width` value and the one inline size a numeric width needs. */\nfunction formWidthOf(width: FormWidth | undefined): {\n readonly dataWidth: string;\n readonly style: { readonly maxInlineSize: string } | undefined;\n} {\n if (width === undefined) return { dataWidth: 'measure', style: undefined };\n if (typeof width === 'number') {\n return { dataWidth: 'custom', style: { maxInlineSize: `${String(width)}rem` } };\n }\n return { dataWidth: width, style: undefined };\n}\n\nexport function LayoutTree({\n nodes,\n translate,\n width,\n components,\n layout,\n lang,\n direction,\n}: {\n readonly nodes: readonly RenderNode[];\n readonly translate: RenderTranslate;\n /** The language the form's words are written in. */\n readonly lang?: string;\n /** The direction the form paints; a host outside `FormProvider` states it itself. */\n readonly direction?: 'ltr' | 'rtl';\n /** The container width contract; `measure` when the host states none. */\n readonly width?: FormWidth;\n /** Host controls that replace a default entry; absent means every default. */\n readonly components?: ControlComponents;\n /** Host containers that replace a rendered container; absent means every default. */\n readonly layout?: LayoutComponents;\n}): ReactElement {\n const sizing = formWidthOf(width);\n return (\n <ControlComponentsContext.Provider value={components}>\n <LayoutComponentsContext.Provider value={layout}>\n <div\n data-render-tree=\"\"\n className=\"ax-form\"\n data-width={sizing.dataWidth}\n // The form states the language and direction its words are written in; a nested\n // value's own run is isolated separately, so a Latin identifier inside an Arabic\n // sentence cannot reorder the sentence around it.\n {...(lang === undefined ? {} : { lang })}\n {...(direction === undefined ? {} : { dir: direction })}\n {...(sizing.style === undefined ? {} : { style: sizing.style })}\n >\n {nodes.map((node) => (\n <NodeView key={node.nodeId} node={node} translate={translate} enclosingLevel={2} />\n ))}\n </div>\n </LayoutComponentsContext.Provider>\n </ControlComponentsContext.Provider>\n );\n}\n\nfunction NodeView({\n node,\n translate,\n enclosingLevel,\n}: {\n readonly node: RenderNode;\n readonly translate: RenderTranslate;\n /** The nearest enclosing heading level, used only by container slots whose node states none. */\n readonly enclosingLevel: RenderHeadingLevel;\n}): ReactElement {\n const layoutComponents = useLayoutComponents();\n const idPrefix = useIdPrefix();\n if (node.kind !== 'field') {\n const Custom = layoutComponents?.[node.kind];\n if (Custom !== undefined) {\n // The default tree is the slot's `children`: a host returns it to keep the adapter's\n // markup, wraps it to add its own chrome, or ignores it to paint the node itself.\n return (\n <Custom node={node} translate={translate} level={slotLevelOf(node, enclosingLevel)}>\n {defaultNodeView(node, translate, idPrefix)}\n </Custom>\n );\n }\n }\n return defaultNodeView(node, translate, idPrefix);\n}\n\n/** The adapter's own markup for one node, before a host container slot gets a say. */\nfunction defaultNodeView(\n node: RenderNode,\n translate: RenderTranslate,\n idPrefix: string,\n): ReactElement {\n switch (node.kind) {\n case 'error_summary':\n return (\n <ErrorSummaryView\n items={node.items}\n failed={node.items.length > 0}\n summaryId={structuralId(idPrefix, ERROR_SUMMARY_SUFFIX, '')}\n />\n );\n case 'section':\n case 'group':\n return <SectionView node={node} translate={translate} />;\n case 'wizard':\n return <WizardView node={node} translate={translate} />;\n case 'step':\n return <StepView node={node} translate={translate} />;\n case 'field':\n return <Control node={node} translate={translate} />;\n case 'record':\n return <RecordView node={node} translate={translate} />;\n case 'records':\n return <RecordsView node={node} translate={translate} />;\n case 'heading':\n return (\n <header>\n {heading(node.level, structuralId(idPrefix, node.nodeId, '.title'), node.title)}\n {node.body === undefined ? null : <p>{node.body}</p>}\n </header>\n );\n case 'callout':\n return (\n <aside className=\"ax-callout\" role=\"note\" data-tone={node.tone}>\n {node.title === undefined ? null : <p>{node.title}</p>}\n <p>{node.body}</p>\n </aside>\n );\n case 'divider':\n return <hr />;\n case 'sop_block':\n return (\n <section className=\"ax-sop\" aria-labelledby={structuralId(idPrefix, node.nodeId, '.title')}>\n {heading(node.level, structuralId(idPrefix, node.nodeId, '.title'), node.title)}\n {node.body === undefined ? null : <p>{node.body}</p>}\n </section>\n );\n case 'summary_card':\n return <SummaryView node={node} />;\n default:\n return assertNeverNode(node);\n }\n}\n\n/** A union arm the compiler proves unreachable. */\nfunction assertNeverNode(value: never): never {\n throw new Error(`unreachable render node: ${JSON.stringify(value)}`);\n}\n\nfunction Children({\n nodes,\n translate,\n enclosingLevel,\n}: {\n readonly nodes: readonly RenderNode[];\n readonly translate: RenderTranslate;\n /** The enclosing container's heading level, forwarded to non-heading container slots. */\n readonly enclosingLevel: RenderHeadingLevel;\n}): ReactElement {\n return (\n <>\n {nodes.map((child) => (\n <div key={child.nodeId} className=\"axiom-grid-item\" style={{ gridColumn: spanOf(child) }}>\n <NodeView node={child} translate={translate} enclosingLevel={enclosingLevel} />\n </div>\n ))}\n </>\n );\n}\n\n/**\n * How many of its parent's columns one node occupies.\n *\n * A control, a record group and a record list state their own `colSpan`; every other node is\n * chrome that spans the row, because a callout or a divider squeezed into one column of a\n * two-column section would read as part of the field beside it.\n */\nfunction spanOf(node: RenderNode): string {\n switch (node.kind) {\n case 'field':\n case 'record':\n case 'records':\n return `span ${String(node.colSpan)}`;\n default:\n return '1 / -1';\n }\n}\n\n/**\n * A section or a group: a heading, an optional collapsed state with the failure count it hides,\n * and its children. The count is read by the toggle itself, so a failure appearing inside the\n * container repaints the toggle and not the controls it holds.\n *\n * A group may state no title at all, and a translated title may be empty. Neither is announced:\n * a heading with no name reads as a heading and says nothing, and a region labelled by one is an\n * unnamed landmark. The container is then a plain box, and the toggle names only its action.\n */\nfunction SectionView({\n node,\n translate,\n}: {\n readonly node: Extract<RenderNode, { kind: 'section' | 'group' }>;\n readonly translate: RenderTranslate;\n}): ReactElement {\n const idPrefix = useIdPrefix();\n const [expanded, setExpanded] = useState(node.defaultExpanded ?? true);\n const bodyId = structuralId(idPrefix, node.nodeId, '.children');\n const titleId = structuralId(idPrefix, node.nodeId, '.title');\n const title = titledOf(node.title);\n const className = node.kind === 'section' ? 'ax-section' : 'ax-group';\n // `hidden` alone does not collapse this: the UA rule `[hidden] { display: none }` is a\n // presentational hint, and the inline `display` below outranks it. The two have to agree, or a\n // toggle that reports `aria-expanded=\"false\"` leaves its section on screen.\n const collapsed = node.collapsible && !expanded;\n const body = (\n <div\n id={bodyId}\n className=\"ax-grid\"\n hidden={collapsed}\n style={{\n display: collapsed ? 'none' : 'grid',\n gridTemplateColumns: `repeat(${String(node.columns)}, minmax(0, 1fr))`,\n }}\n >\n <Children nodes={node.children} translate={translate} enclosingLevel={node.level} />\n </div>\n );\n const toggle = node.collapsible ? (\n <SectionToggle\n nodeId={node.nodeId}\n bodyId={bodyId}\n title={title}\n expanded={expanded}\n onToggle={() => setExpanded((open) => !open)}\n />\n ) : null;\n const contents = (\n <>\n {title === undefined ? null : heading(node.level, titleId, title)}\n {node.description === undefined ? null : <p className=\"ax-hint\">{node.description}</p>}\n {toggle}\n {body}\n </>\n );\n return title === undefined ? (\n <div className={className} data-node={node.nodeId}>\n {contents}\n </div>\n ) : (\n <section className={className} aria-labelledby={titleId} data-node={node.nodeId}>\n {contents}\n </section>\n );\n}\n\n/**\n * The collapse toggle and the failure count it hides.\n *\n * It is the subscription, and it is a leaf: a failure appearing in the section repaints the\n * count and leaves the controls inside the section alone.\n */\nfunction SectionToggle({\n nodeId,\n bodyId,\n title,\n expanded,\n onToggle,\n}: {\n readonly nodeId: string;\n readonly bodyId: string;\n readonly title: string | undefined;\n readonly expanded: boolean;\n readonly onToggle: () => void;\n}): ReactElement {\n const slice = useLayoutNode(nodeId);\n const copy = useHostCopy();\n return (\n <button type=\"button\" aria-expanded={expanded} aria-controls={bodyId} onClick={onToggle}>\n {copy.sectionToggle(title, expanded)}\n {slice.errorCount === 0 ? '' : ` (${String(slice.errorCount)})`}\n </button>\n );\n}\n\n/**\n * One wizard page at a time.\n *\n * The cursor is the session's, read through `useWizard`, so the renderer, the checkpoint bar\n * and any host footer share one step without a prop carrying it through the tree. A host that\n * gates its own navigation calls the same hook and reads the same cursor.\n */\nfunction WizardView({\n node,\n translate,\n}: {\n readonly node: Extract<RenderNode, { kind: 'wizard' }>;\n readonly translate: RenderTranslate;\n}): ReactElement {\n const wizard = useWizard();\n const copy = useHostCopy();\n const current = node.children.find((step) => step.stepId === wizard.stepId) ?? node.children[0];\n const position =\n current === undefined ? -1 : node.children.findIndex((step) => step.stepId === current.stepId);\n const titles = new Map(node.children.map((step) => [step.stepId, step.title] as const));\n // The page announces a step change itself: the library moves a host-owned cursor and states\n // nothing in the live region, so without this a screen reader never learns the page moved.\n const announcement =\n current === undefined || position < 0\n ? ''\n : copy.stepAnnouncement(position + 1, node.children.length, current.title);\n return (\n <div className=\"ax-wizard\" data-wizard=\"\">\n <WizardCheckpoints wizard={wizard} titles={titles} />\n <p role=\"status\" data-step-status=\"\">\n {announcement}\n </p>\n {current === undefined ? null : <StepView node={current} translate={translate} />}\n </div>\n );\n}\n\nfunction StepView({\n node,\n translate,\n}: {\n readonly node: Extract<RenderNode, { kind: 'step' }>;\n readonly translate: RenderTranslate;\n}): ReactElement {\n const idPrefix = useIdPrefix();\n const titleId = structuralId(idPrefix, node.nodeId, '.title');\n const title = useRef<HTMLHeadingElement | null>(null);\n // The step this instance last showed. Arriving at another step moves focus to its heading, so\n // the next Tab starts inside the page the reader just moved to; the first paint keeps the\n // focus the host (or the fixture button) already set.\n const shown = useRef(node.stepId);\n useEffect(() => {\n if (shown.current === node.stepId) return;\n shown.current = node.stepId;\n title.current?.focus();\n }, [node.stepId]);\n return (\n <section className=\"ax-step\" aria-labelledby={titleId} data-step={node.stepId}>\n {heading(node.level, titleId, node.title, title)}\n {node.description === undefined ? null : <p className=\"ax-hint\">{node.description}</p>}\n <div\n className=\"ax-grid\"\n style={{\n display: 'grid',\n gridTemplateColumns: `repeat(${String(node.columns)}, minmax(0, 1fr))`,\n }}\n >\n <Children nodes={node.children} translate={translate} enclosingLevel={node.level} />\n </div>\n </section>\n );\n}\n\n/** The direction a readout's own value runs in: a number, decimal, or money amount is a left-to-right run. */\nfunction readoutDirection(value: unknown): 'ltr' | undefined {\n if (typeof value === 'number' || isDecimalString(value)) return 'ltr';\n if (isRecord(value) && typeof value['minor'] === 'string') return 'ltr';\n return undefined;\n}\n\n/** A decided readout's text; a value the engine left undecided is a dash, never a blank cell. */\nfunction readoutTextOf(value: WireValue | undefined, display: ValueDisplay): string {\n return renderDisplayText(renderValueText(value, display));\n}\n\n/** A summary card: decided readouts, then the declared fields it lists, read live. */\nfunction SummaryView({\n node,\n}: {\n readonly node: Extract<RenderNode, { kind: 'summary_card' }>;\n}): ReactElement {\n const copy = useHostCopy();\n const idPrefix = useIdPrefix();\n const titleId = structuralId(idPrefix, node.nodeId, '.title');\n return (\n <section className=\"ax-readout\" aria-labelledby={titleId} data-summary=\"\">\n {heading(node.level, titleId, node.title)}\n {node.body === undefined ? null : <p>{node.body}</p>}\n <dl>\n {node.readouts.map((readout, index) => (\n <div key={`${String(index)}:${readout.label}`}>\n <dt>{readout.label}</dt>\n <dd>\n <bdi {...(readoutDirection(readout.value) === undefined ? {} : { dir: 'ltr' })}>\n {readoutTextOf(readout.value, copy.display)}\n </bdi>\n </dd>\n </div>\n ))}\n {node.fields.map((field) => (\n <SummaryField key={field.fieldId} fieldId={field.fieldId} label={field.label} />\n ))}\n </dl>\n </section>\n );\n}\n\nfunction SummaryField({\n fieldId,\n label,\n}: {\n readonly fieldId: string;\n readonly label: string;\n}): ReactElement {\n const field = useField(fieldId);\n // A computed total the engine cannot decide (a row was just added with no quantity) has no\n // text. A blank readout reads as \"this total does not exist\"; the dash says the same thing\n // without the empty cell, and the label above it still names the total.\n const text = renderDisplayText(field.text);\n return (\n <div>\n <dt>{label}</dt>\n <dd>\n <bdi\n {...(field.descriptor.primitive === 'integer' ||\n field.descriptor.primitive === 'decimal' ||\n field.descriptor.primitive === 'money' ||\n field.descriptor.primitive === 'instant'\n ? { dir: 'ltr' }\n : {})}\n >\n {text}\n </bdi>\n </dd>\n </div>\n );\n}\n\n/** Where focus goes once the row list has committed a structural change. */\ntype RowFocusTarget =\n | { readonly kind: 'remove'; readonly rowKey: string | number }\n | { readonly kind: 'add' }\n | { readonly kind: 'appended' }\n | {\n /**\n * The control the reader was using in a row that survives the removal.\n *\n * Deleting a different row must not take the reader out of the row they are editing. The\n * binding is the member's stable id; the row key addresses which row still holds it.\n */\n readonly kind: 'control';\n readonly rowKey: string | number;\n readonly binding: string;\n };\n\n/** A structural refusal as text; an engine refusal is expected, and the control paints it. */\nfunction rowRefusalText(error: unknown, copy: HostCopy): string {\n return error instanceof Error ? error.message : copy.rowRefused();\n}\n\n/**\n * The name a row's group announces.\n *\n * The position is part of the name so two rows of one record can never share it, and the row's\n * own name follows when it holds one: a reader hears \"Row 2: kitchen\" and knows both where they\n * are and which row they are in.\n */\nfunction rowLabelOf(rowName: string | undefined, index: number, copy: HostCopy): string {\n return copy.rowHeading(index + 1, rowName ?? '');\n}\n\n/**\n * A single, non-repeating record: one group whose members are controls.\n *\n * A record has exactly one value, so there is no row list, no add button and no row key: each\n * member binds by its own identifier and reads or writes its cell inside the container's value.\n * The `<fieldset>`/`<legend>` pair is the group the record is, and the `<legend>` is the place\n * its heading comes from — the declaration's own label, beneath the section or group heading\n * the layout already placed it in.\n */\nfunction RecordView({\n node,\n translate,\n rowKey,\n}: {\n readonly node: RenderRecordNode;\n readonly translate: RenderTranslate;\n /** The row this record sits inside, when it is a member of a repeating record. */\n readonly rowKey?: string | number;\n}): ReactElement {\n const idPrefix = useIdPrefix();\n const binding = rowKey === undefined ? node.fieldId : fieldKey({ fieldId: node.fieldId, rowKey });\n return (\n <fieldset\n id={fieldDomId(idPrefix, binding)}\n data-record={node.fieldId}\n // A summary item about the record as a whole links at this element, so it has to be a\n // focus destination: `-1` is programmatic focus without a new tab stop.\n tabIndex={-1}\n >\n <legend>{node.label}</legend>\n {node.description === undefined ? null : <p className=\"ax-hint\">{node.description}</p>}\n {node.members.map((member) => (\n <MemberView\n key={member.nodeId}\n member={member}\n translate={translate}\n {...(rowKey === undefined ? {} : { rowKey })}\n />\n ))}\n </fieldset>\n );\n}\n\n/** A member node: a control, a nested record, or a nested repeating record. */\ntype MemberNode = RenderRecordNode['members'][number];\n\n/** One record member: a control, a nested record, or a nested repeating record. */\nfunction MemberView({\n member,\n translate,\n rowKey,\n}: {\n readonly member: MemberNode;\n readonly translate: RenderTranslate;\n readonly rowKey?: string | number;\n}): ReactElement {\n const copy = useHostCopy();\n switch (member.kind) {\n case 'field':\n return (\n <Control\n node={member}\n translate={translate}\n {...(rowKey === undefined ? {} : { rowKey })}\n />\n );\n case 'record':\n return (\n <RecordView\n node={member}\n translate={translate}\n {...(rowKey === undefined ? {} : { rowKey })}\n />\n );\n case 'records':\n // v1 addresses no row for an array nested inside another array's row: the engine refuses\n // the binding (`IDENTITY_UNSUPPORTED`), so there is no list a host could paint here. Say\n // so in a sentence instead of throwing the form away.\n return rowKey === undefined ? (\n <RecordsView node={member} translate={translate} />\n ) : (\n <p className=\"ax-hint\" data-nested-records={member.fieldId}>\n {copy.nestedListRefused()}\n </p>\n );\n }\n}\n\n/**\n * A repeating record: one row per committed identity, each member bound by its row key.\n *\n * The rows are the session's own identities, so an edit in one row re-renders that row and the\n * list does not move. A row the container permits removing gets a button that names the row's\n * own key, because a position is not an identity once a row has been removed. A structural\n * refusal is painted rather than thrown out of the handler, and a successful removal moves focus\n * to the next row's control and announces how many remain, so focus never falls to the body.\n */\nfunction RecordsView({\n node,\n translate,\n}: {\n readonly node: RenderRecordsNode;\n readonly translate: RenderTranslate;\n}): ReactElement {\n const array = useFieldArray(node.fieldId);\n const idPrefix = useIdPrefix();\n const copy = useHostCopy();\n const [refusal, setRefusal] = useState<\n { readonly sentence: string; readonly detail?: string } | undefined\n >(undefined);\n const [status, setStatus] = useState<string | undefined>(undefined);\n const [focusTarget, setFocusTarget] = useState<RowFocusTarget | undefined>(undefined);\n const removeButtons = useRef(new Map<string, HTMLButtonElement>());\n const addButton = useRef<HTMLButtonElement | null>(null);\n const rowsList = useRef<HTMLUListElement | null>(null);\n // The row and control the reader was editing. A Remove button is a control the pointer uses,\n // not the row being edited, so focus entering one does not move this place.\n const lastEdited = useRef<{ readonly rowKey: string; readonly binding: string } | undefined>(\n undefined,\n );\n useEffect(() => {\n if (focusTarget === undefined) return;\n if (focusTarget.kind === 'add') {\n addButton.current?.focus();\n return;\n }\n if (focusTarget.kind === 'control') {\n const rows = rowsList.current?.querySelectorAll<HTMLElement>('[data-row]');\n const row = [...(rows ?? [])].find(\n (entry) => entry.getAttribute('data-row') === String(focusTarget.rowKey),\n );\n const binding = row?.querySelector<HTMLElement>(`[data-binding=\"${focusTarget.binding}\"]`);\n const control = binding?.querySelector<HTMLElement>(\n 'input:not([disabled]), textarea:not([disabled]), select:not([disabled])',\n );\n if (control !== undefined && control !== null) {\n control.focus({ preventScroll: true });\n return;\n }\n // The row survived but its control cannot take focus; leave the reader on a control that\n // is still in this list rather than on the body.\n const fallback = rowsList.current?.querySelector<HTMLButtonElement>('.ax-actions button');\n (fallback ?? addButton.current)?.focus();\n return;\n }\n if (focusTarget.kind === 'appended') {\n // The appended row is the last one painted. Reading the DOM instead of the captured\n // `array.rows` is what makes this the row the append produced, not the list before it.\n const rows = rowsList.current?.querySelectorAll<HTMLElement>('[data-row]');\n const last = rows === undefined ? undefined : rows[rows.length - 1];\n // The announcement is a fact about the list after the commit, so the count is read from\n // the same place the reader's eye is: the rows on screen.\n if (last !== undefined && rows !== undefined) {\n setStatus(copy.rowAdded(rows.length, rows.length));\n // `scrollIntoView` is a browser behaviour; a DOM without layout (jsdom) has none.\n last.scrollIntoView?.({ block: 'nearest' });\n }\n const control = last?.querySelector<HTMLElement>(\n 'input:not([disabled]), textarea:not([disabled]), select:not([disabled]), button',\n );\n control?.focus({ preventScroll: true });\n return;\n }\n const target = removeButtons.current.get(String(focusTarget.rowKey));\n if (target !== undefined) target.focus();\n }, [focusTarget, copy]);\n const removeRow = (rowKey: string | number, index: number): void => {\n const next = array.rows[index + 1] ?? array.rows[index - 1];\n const editing = lastEdited.current;\n setRefusal(undefined);\n try {\n array.remove(rowKey);\n } catch (error) {\n setRefusal({\n sentence: copy.rowRemoveFailed(),\n detail: rowRefusalText(error, copy),\n });\n return;\n }\n setStatus(copy.rowRemoved(array.rows.length - 1));\n if (editing !== undefined && String(editing.rowKey) !== String(rowKey)) {\n // A different row was removed: the reader keeps their place in the row they were using.\n setFocusTarget({ kind: 'control', rowKey: editing.rowKey, binding: editing.binding });\n return;\n }\n // The removed row is the one they were editing, so its own control is gone; the next row's\n // control (or Add row) is the sensible place.\n if (editing !== undefined) lastEdited.current = undefined;\n setFocusTarget(next === undefined ? { kind: 'add' } : { kind: 'remove', rowKey: next.rowKey });\n };\n /** Remember the editable control the reader is using, so a removal elsewhere can restore it. */\n const rememberRowFocus = (event: FocusEvent<HTMLUListElement>): void => {\n const target = event.target;\n if (!(target instanceof HTMLElement)) return;\n if (!target.matches('input, textarea, select')) return;\n const row = target.closest<HTMLElement>('[data-row]');\n const binding = target.closest<HTMLElement>('[data-binding]')?.getAttribute('data-binding');\n if (row === null || binding === null || binding === undefined) return;\n const rowKey = row.getAttribute('data-row');\n if (rowKey === null) return;\n lastEdited.current = { rowKey, binding };\n };\n const appendRow = (): void => {\n setRefusal(undefined);\n // The conditional is hoisted out of the `try`: React Compiler refuses a value block inside\n // a `try`/`catch`, and this payload is an ordinary value the engine may refuse.\n const payload =\n node.naturalKey === undefined ? {} : { [node.naturalKey]: freeNaturalKey(array.rows) };\n try {\n array.append(payload);\n } catch (error) {\n setRefusal({\n sentence: copy.rowAddFailed(),\n detail: rowRefusalText(error, copy),\n });\n return;\n }\n // Moving into the row, scrolling it into view and announcing the new count are one act:\n // a row that appears below the fold with focus left on the add button is a row the reader\n // will not find.\n setFocusTarget({ kind: 'appended' });\n };\n return (\n <fieldset\n id={fieldDomId(idPrefix, node.fieldId)}\n data-records={node.fieldId}\n // The cardinality/screen/media items target the container itself; without `-1` the link\n // scrolls and leaves focus on the anchor, i.e. the item points at a ghost.\n tabIndex={-1}\n >\n <legend>{node.label}</legend>\n {node.description === undefined ? null : <p className=\"ax-hint\">{node.description}</p>}\n {array.rows.length === 0 ? <p>{copy.rowsEmpty()}</p> : null}\n {/* The rows are a list so the count is announced, and each row is a named group: without\n the group a reader hears the same control label once per row and cannot tell them apart. */}\n {array.rows.length === 0 ? null : (\n <ul className=\"ax-rows\" data-rows=\"\" ref={rowsList} onFocus={rememberRowFocus}>\n {array.rows.map((row, index) => {\n const labelId = structuralId(idPrefix, node.nodeId, `.row.${String(index)}`);\n const rowName = renderRowName(node.label, row.rowName, index);\n // Only an authored row name joins the group heading; assigned rows and rows carrying\n // a `freeNaturalKey` placeholder announce their position without leaking the key.\n const headingKey = row.rowName !== undefined && row.rowName === rowName ? rowName : '';\n return (\n <li key={row.bindingKey} className=\"ax-row\" data-row={String(row.rowKey)}>\n <div role=\"group\" aria-labelledby={labelId}>\n <span id={labelId} className=\"ax-visually-hidden axiom-visually-hidden\">\n {rowLabelOf(headingKey, index, copy)}\n </span>\n {/* The identity a reader compares across rows is visible here; the group's\n accessible name above states the same thing in a complete sentence. */}\n <span className=\"ax-row-key\" aria-hidden=\"true\">\n <bdi>{rowName}</bdi>\n </span>\n {node.members.map((member) => (\n <MemberView\n key={member.nodeId}\n member={member}\n rowKey={row.rowKey}\n translate={translate}\n />\n ))}\n {array.mutations.remove ? (\n <div className=\"ax-actions\">\n <button\n type=\"button\"\n ref={(element) => {\n const key = String(row.rowKey);\n if (element === null) removeButtons.current.delete(key);\n else removeButtons.current.set(key, element);\n }}\n onClick={() => removeRow(row.rowKey, index)}\n >\n {copy.removeRow(rowName)}\n </button>\n </div>\n ) : null}\n </div>\n </li>\n );\n })}\n </ul>\n )}\n {array.mutations.append ? (\n <div className=\"ax-actions\">\n <button\n type=\"button\"\n ref={(element) => {\n addButton.current = element;\n }}\n onClick={appendRow}\n >\n {copy.addRow()}\n </button>\n </div>\n ) : null}\n {refusal === undefined ? null : (\n <div className=\"ax-error\" role=\"alert\">\n <p>{refusal.sentence}</p>\n {refusal.detail === undefined ? null : <p className=\"ax-hint\">{refusal.detail}</p>}\n </div>\n )}\n <p aria-live=\"polite\" data-rows-status=\"\">\n {status}\n </p>\n </fieldset>\n );\n}\n\n/**\n * Stable keys for one derived list.\n *\n * The item's own identity is the key, so a reorder moves the existing node rather than painting a\n * different reason into it. Two items that are identical in identity are interchangeable, so the\n * second gets an occurrence suffix instead of the position: a reorder among distinct items does\n * not renumber anything.\n */\nfunction withKeys<T>(\n items: readonly T[],\n identity: (item: T) => string,\n): readonly { readonly item: T; readonly key: string }[] {\n const seen = new Map<string, number>();\n return items.map((item) => {\n const base = identity(item);\n const occurrence = seen.get(base) ?? 0;\n seen.set(base, occurrence + 1);\n return { item, key: occurrence === 0 ? base : `${base}\\u0000${String(occurrence)}` };\n });\n}\n\n/** Every blocking reason, announced, and the element a refused submit moves focus to. */\nfunction ErrorSummaryView({\n items,\n failed,\n summaryId,\n}: {\n readonly items: readonly RenderErrorInput[];\n /** Whether any of them is a decided failure, so the region is an alert rather than a status. */\n readonly failed: boolean;\n /** The id this element carries; an item that would point at it is painted as text instead. */\n readonly summaryId: string;\n}): ReactElement {\n const copy = useHostCopy();\n return (\n <div\n id={summaryId}\n className=\"ax-summary\"\n // A painted failure is an alert; a list of questions still waiting is a polite status.\n // Both are focusable so a refused submit always has somewhere to move the user.\n role={failed ? 'alert' : 'status'}\n tabIndex={-1}\n data-error-summary=\"\"\n aria-live={failed ? 'assertive' : 'polite'}\n >\n {failed ? <p className=\"ax-summary-title\">{copy.summaryHeading()}</p> : null}\n <ul>\n {withKeys(items, (item) => `${item.targetId ?? ''}\\u0000${item.message}`).map(\n ({ item, key }) => {\n // A reason about the record has no control to reach; linking it at this element\n // would be a link to itself, so it is painted as plain text and the reader stays\n // where they are.\n const href =\n item.targetId === undefined || item.targetId === summaryId\n ? undefined\n : `#${item.targetId}`;\n const text = item.message;\n return (\n <li key={key} className=\"ax-summary-item\">\n {/* The item is a link to the control it names, so a reader reaches the field\n from the announcement instead of searching the page for it. */}\n {href === undefined ? text : <a href={href}>{text}</a>}\n </li>\n );\n },\n )}\n </ul>\n </div>\n );\n}\n\n/**\n * The one issue list: every painted failure, then every question still waiting for an answer.\n *\n * The chip, the floating action, the summary and its count are all this list, so they cannot\n * disagree about how many things stand in the way. A field named here carries `aria-invalid`,\n * whether its reason is a decided failure or a requirement nobody has answered yet: a control\n * the summary points at is a control the reader must act on.\n */\nexport interface IssueList {\n /** The element id the summary paints, so a chip can find it after the fact. */\n readonly summaryId: string;\n /** The failures first, then the waiting questions; every entry names its control when it has one. */\n readonly items: readonly RenderErrorInput[];\n /** Whether any entry is a decided failure (the region is an alert) rather than a question. */\n readonly failed: boolean;\n /** How many entries there are. This is the only issue count the host states. */\n readonly count: number;\n}\n\nexport function useIssueList(\n fields: readonly CompiledField[],\n translate: RenderTranslate,\n): IssueList {\n const summary = useFormState();\n const copy = useHostCopy();\n const idPrefix = useIdPrefix();\n const summaryId = structuralId(idPrefix, ERROR_SUMMARY_SUFFIX, '');\n const failures = useMemo(\n () =>\n blockingOf(\n // The painted failures, not every fact the record carries: the session's reveal policy\n // has already decided which of them a control is announcing now.\n summary.visibleBlockers,\n summary.visibleBlockingErrors,\n fields,\n translate,\n copy,\n idPrefix,\n ),\n [summary, fields, translate, copy, idPrefix],\n );\n const waiting = useMemo(\n () =>\n summary.hasUnansweredBlockers\n ? unansweredOf(summary.unansweredBlockers, fields, translate, copy, idPrefix)\n : [],\n [summary, fields, translate, copy, idPrefix],\n );\n const items = useMemo<readonly RenderErrorInput[]>(\n () => [...failures, ...waiting],\n [failures, waiting],\n );\n useInvalidMarking(items);\n return { summaryId, items, failed: failures.length > 0, count: items.length };\n}\n\n/**\n * The controls the issue list names, marked `aria-invalid` for as long as they are named.\n *\n * The binding's own `aria-invalid` answers a decided field error; the list additionally names a\n * requirement that is merely unanswered, and a reader who is sent to that control must be told\n * it is what stands in the way. The marker is removed when the item leaves the list, so the\n * attribute is a state of the announcement and never a permanent accusation.\n */\nfunction useInvalidMarking(items: readonly RenderErrorInput[]): void {\n useEffect(() => {\n const marked: HTMLElement[] = [];\n for (const item of items) {\n if (item.targetId === undefined) continue;\n const element = document.getElementById(item.targetId);\n if (element === null) continue;\n const control = element.matches('input, textarea, select')\n ? element\n : element.querySelector<HTMLElement>('input, textarea, select');\n if (control === null || control.dataset['summaryInvalid'] === '') continue;\n if (control.getAttribute('aria-invalid') === 'true') continue;\n control.setAttribute('aria-invalid', 'true');\n control.dataset['summaryInvalid'] = '';\n marked.push(control);\n }\n return () => {\n for (const control of marked) {\n control.removeAttribute('aria-invalid');\n delete control.dataset['summaryInvalid'];\n }\n };\n }, [items]);\n}\n\n/**\n * The form itself: the chrome the layout states, and nothing that a value edit moves.\n *\n * The tree is built from the layout and memoised on its identity, so a keystroke that changes no\n * visibility, message or readout does not rebuild it — the control that owns the edited value\n * re-renders through its own binding and its siblings do not. The announced failures are a\n * separate component for the same reason.\n */\nexport function RenderedForm({\n fields,\n translate,\n locale,\n width,\n components,\n layout,\n}: {\n readonly fields: readonly CompiledField[];\n readonly translate: RenderTranslate;\n /** Host controls that replace a default entry; absent means every default. */\n readonly components?: ControlComponents;\n /** Host containers that replace a rendered container; absent means every default. */\n readonly layout?: LayoutComponents;\n /**\n * The locale whose decimal and grouping marks a buffered number reads.\n *\n * Messages already receive their locale through `translate`; a number entry needs the same\n * fact separately, because `125,50` and `125.50` are different amounts in different locales.\n * Omit it for the canonical pair.\n */\n readonly locale?: string;\n /**\n * How wide the form's content may be: a 390 px device column, the readable measure, the\n * container, or a number of rem. The host chooses once; the form root carries the answer as\n * `data-width`, so the theme sizes it without the host inventing a class.\n */\n readonly width?: FormWidth;\n}): ReactElement {\n // A pure function of the locale, not a subscribing hook: a direction that re-rendered the\n // form on every value change would defeat the per-binding isolation the render tree exists for.\n // Only a locale the host actually named becomes a `dir` on the tree: with no request there is\n // no language fact to state, and a host that owns direction on an ancestor (a page holding one\n // RTL form beside a Latin one) must not have it overridden with an invented `ltr`.\n const direction = locale === undefined ? undefined : directionOf(locale);\n const documentLayout = useLayout();\n const nodes = useMemo(\n () => renderLayout({ layout: documentLayout, fields, translate }),\n [documentLayout, fields, translate],\n );\n return (\n <LocaleContext.Provider value={locale}>\n <LayoutTree\n nodes={nodes}\n translate={translate}\n {...(width === undefined ? {} : { width })}\n {...(components === undefined ? {} : { components })}\n {...(layout === undefined ? {} : { layout })}\n {...(locale === undefined ? {} : { lang: locale })}\n {...(direction === undefined ? {} : { direction })}\n />\n </LocaleContext.Provider>\n );\n}\n\n/** The announced failures, above the form, and the element a refused submit moves focus to. */\nexport function ErrorSummary({\n fields,\n translate,\n extraItems,\n}: {\n readonly fields: readonly CompiledField[];\n readonly translate: RenderTranslate;\n /**\n * Host-owned issues the shared adapter cannot derive, appended after its own.\n *\n * The demo's signature-coverage check is one: the runtime states that the projection omits a\n * covered value, and the host turns it into a line that links at the signature control. The\n * summary, the chip and the floating action then count the same items.\n */\n readonly extraItems?: readonly RenderErrorInput[];\n}): ReactElement | null {\n const summary = useFormState();\n const issues = useIssueList(fields, translate);\n const extras = extraItems ?? [];\n // Appended on every render rather than memoised: `extras` is the caller's list and a fresh\n // array is cheaper than a memo whose dependency changes identity anyway.\n const items = extras.length === 0 ? issues.items : [...issues.items, ...extras];\n const failed = issues.failed || extras.length > 0;\n const hasStatement = items.length > 0;\n // The submit this effect has already answered. A refusal is handled once; a later keystroke\n // that changes `failed` or the verdict must not move focus out of the control being typed in.\n const handledSubmit = useRef(0);\n const idPrefix = useIdPrefix();\n useEffect(() => {\n if (summary.submitCount === 0 || summary.submitCount === handledSubmit.current) return;\n handledSubmit.current = summary.submitCount;\n // A submit that succeeded is not a refusal, even if a non-blocking failure remains. The\n // verdict is the summary's one answer to \"may this be sent\"; there is no second boolean.\n if (summary.verdict === 'SUBMIT') return;\n // A refused submit moves the user to the announcement once the pass that produced it has\n // committed; the element is this component's own, so the id is the only handle needed.\n // A refused submit moves the reader to the first control that needs them, and the summary\n // states the rest through its live region. A refusal with no control to move to (a record\n // blocker, a gate) still lands on the announcement rather than on the submit button.\n const firstInvalid = firstInvalidControl(idPrefix);\n if (firstInvalid !== undefined) {\n firstInvalid.focus();\n return;\n }\n document.getElementById(issues.summaryId)?.focus();\n }, [summary.submitCount, summary.verdict, issues.summaryId, idPrefix]);\n return hasStatement ? (\n <ErrorSummaryView items={items} failed={failed} summaryId={issues.summaryId} />\n ) : null;\n}\n\n/** The first control of one session the browser reports as invalid, in document order. */\nfunction firstInvalidControl(idPrefix: string): HTMLElement | undefined {\n for (const element of document.querySelectorAll<HTMLElement>('[aria-invalid=\"true\"]')) {\n if (element.id.startsWith(`${idPrefix}-`)) return element;\n }\n return undefined;\n}\n\n/**\n * Every blocking reason as the summary states it, resolved to text.\n *\n * Three sources make one list, because readiness is the union of them: a rule or gate blocker\n * carries a message key and no field name, so the tree is told which field it belongs to and\n * prepends that field's label; a missing required value is a `required` blocker whose field and\n * resolved row name are named (the host writes the whole sentence in the selected locale, and\n * naming the field again in the tree would announce \"Full name: Full name is required\"); and the\n * binding errors state the two reasons no blocker shape carries — a refusal by the field's option\n * domain, and a blocking screen.\n *\n * A reason that appears in more than one list is stated once. A `required` blocker is collected\n * after the rule and gate reasons so the announcement keeps its order; a `validate` error is the\n * same failure a `rule` blocker already carries under its `(ruleId, messageKey)`; and\n * `access`/`row-key` never block.\n */\nfunction blockingOf(\n blockers: readonly FormBlocker[],\n errors: readonly FieldError[],\n fields: readonly CompiledField[],\n translate: RenderTranslate,\n copy: HostCopy,\n idPrefix: string,\n): readonly RenderErrorInput[] {\n const labels = labelKeysOf(fields);\n const items: RenderErrorInput[] = [];\n const required: RenderErrorInput[] = [];\n const ruleKeys = new Set<string>();\n const gateKeys = new Set<string>();\n for (const blocker of blockers) {\n // A required blocker states the host's own sentence, and its row name was resolved where the\n // declaration's addressing is known. It is collected here and appended after the rule and\n // gate reasons so the announcement keeps the order it had before the two lists were merged.\n if (blocker.kind === 'required') {\n const labelKey = labels.get(blocker.fieldId);\n required.push({\n targetId:\n blocker.rowKey === undefined\n ? fieldDomId(idPrefix, blocker.fieldId)\n : fieldDomId(idPrefix, fieldKey({ fieldId: blocker.fieldId, rowKey: blocker.rowKey })),\n message: copy.required(\n labelKey === undefined ? blocker.fieldId : translate(labelKey),\n blocker.rowName,\n ),\n });\n continue;\n }\n // A cardinality failure carries no artifact message either, so the host states the count and\n // the limit in its own words, naming the record they belong to.\n if (blocker.kind === 'cardinality') {\n const labelKey = labels.get(blocker.fieldId);\n const message = copy.cardinality(\n labelKey === undefined ? blocker.fieldId : translate(labelKey),\n blocker.bound,\n blocker.count,\n blocker.limit,\n );\n if (message === undefined) continue;\n // The sentence already names the field (the host's copy takes the label), so the item does\n // not state `fieldId`: a `renderErrorSummary` given both would prepend the label a second\n // time. The target is the records container, whose `fieldset` carries this same id.\n items.push({ targetId: fieldDomId(idPrefix, blocker.fieldId), message });\n continue;\n }\n if (blocker.kind === 'scale') {\n // The declaration requires `maxScaleMessageKey`, so the artifact states the sentence; a\n // hand-built artifact that omitted it names the field rather than inventing host copy.\n items.push({\n targetId:\n blocker.rowKey === undefined\n ? fieldDomId(idPrefix, blocker.fieldId)\n : fieldDomId(idPrefix, fieldKey({ fieldId: blocker.fieldId, rowKey: blocker.rowKey })),\n message: blocker.messageKey === undefined ? blocker.fieldId : translate(blocker.messageKey),\n });\n continue;\n }\n if (blocker.kind === 'media') {\n const labelKey = labels.get(blocker.fieldId);\n const label = labelKey === undefined ? blocker.fieldId : translate(labelKey);\n items.push({\n targetId: fieldDomId(idPrefix, blocker.fieldId),\n message: copy.mediaConstraint(label, blocker.member, blocker.limit, blocker.value),\n });\n continue;\n }\n if (blocker.kind === 'rowCount') {\n const labelKey = labels.get(blocker.fieldId);\n const label = labelKey === undefined ? blocker.fieldId : translate(labelKey);\n items.push({\n targetId: fieldDomId(idPrefix, blocker.fieldId),\n message: copy.rowCount(\n label,\n blocker.expected,\n blocker.actual,\n blocker.source,\n blocker.reason,\n blocker.ceiling,\n ),\n });\n continue;\n }\n if (blocker.kind === 'invalidOption') {\n const labelKey = labels.get(blocker.fieldId);\n const label = labelKey === undefined ? blocker.fieldId : translate(labelKey);\n items.push({\n targetId: fieldDomId(idPrefix, blocker.fieldId),\n message: copy.invalidValue(label),\n });\n continue;\n }\n if (blocker.kind === 'unavailableOption') {\n const targetId = fieldDomId(\n idPrefix,\n blocker.rowKey === undefined\n ? blocker.fieldId\n : fieldKey({ fieldId: blocker.fieldId, rowKey: blocker.rowKey }),\n );\n if (blocker.messageKey !== undefined) {\n items.push({\n targetId,\n message: translate(blocker.messageKey, blocker.params),\n });\n continue;\n }\n const labelKey = labels.get(blocker.fieldId);\n items.push({\n targetId,\n message: copy.unavailableOption(\n labelKey === undefined ? blocker.fieldId : translate(labelKey),\n ),\n });\n continue;\n }\n if (blocker.kind === 'screen') {\n items.push({ message: translate(blocker.messageKey ?? blocker.screenId) });\n for (const reason of blocker.reasons) {\n items.push({ message: translate(reason.messageKey, reason.params) });\n }\n continue;\n }\n if (blocker.kind === 'rule') ruleKeys.add(ruleKeyOf(blocker.ruleId, blocker.messageKey));\n else gateKeys.add(gateKeyOf(blocker.gateId, blocker.itemId));\n const fieldId = 'fieldId' in blocker ? blocker.fieldId : undefined;\n // A row-scoped rule names its row, and the row's control is the element the item is about.\n const rowKey = 'rowKey' in blocker ? blocker.rowKey : undefined;\n // The element id, not the binding key: a natural row key is user text and an IDREF is not.\n const targetId =\n fieldId === undefined || rowKey === undefined\n ? undefined\n : fieldDomId(idPrefix, fieldKey({ fieldId, rowKey }));\n items.push({\n ...(fieldId === undefined ? {} : { fieldId }),\n ...(targetId === undefined ? {} : { targetId }),\n message: translate(blocker.messageKey, blocker.params),\n });\n }\n for (const error of errors) {\n switch (error.kind) {\n case 'required':\n // Already stated by the host's own sentence in `missingRequired`.\n break;\n case 'cardinality':\n // Already stated from the blocker list, where the field it belongs to is named.\n break;\n case 'validate':\n case 'deferred':\n if (ruleKeys.has(ruleKeyOf(error.ruleId, error.messageKey))) break;\n items.push({ message: translate(error.messageKey, error.params) });\n break;\n case 'invalid-value':\n // The summary has no binding for this error, so it uses the host's form-level sentence.\n items.push({ message: copy.invalidSelection() });\n break;\n case 'screen':\n // The artifact states the sentence and, for each reason its screen declared, the words\n // to show. The screen id is identity, not text: a reader sees the authored copy, and a\n // screen with no message falls back to its id in the projection rather than to a blank.\n items.push({ message: translate(error.messageKey) });\n for (const reason of error.reasons) {\n items.push({ message: translate(reason.messageKey, reason.params) });\n }\n break;\n case 'gate':\n if (gateKeys.has(gateKeyOf(error.gateId, error.itemId))) break;\n items.push({ message: translate(error.messageKey, error.params) });\n break;\n case 'access':\n case 'row-key':\n // UI consistency, never a refusal: neither stops a submission.\n break;\n default:\n assertNeverErrorKind(error);\n }\n }\n items.push(...required);\n return items;\n}\n\n/**\n * The questions still waiting for an answer, one line each.\n *\n * A requirement nobody has answered is a question, not a failure, so each line states that in\n * the host's own words and links to the control that would answer it. A blocker that names no\n * control (a gate item, a screen) is stated as its own sentence with no link.\n */\nfunction unansweredOf(\n blockers: readonly FormBlocker[],\n fields: readonly CompiledField[],\n translate: RenderTranslate,\n copy: HostCopy,\n idPrefix: string,\n): readonly RenderErrorInput[] {\n const labels = labelKeysOf(fields);\n const labelOf = (fieldId: string): string => {\n const key = labels.get(fieldId);\n return key === undefined ? fieldId : translate(key);\n };\n const targetOf = (fieldId: string, rowKey: string | number | undefined): string =>\n fieldDomId(\n idPrefix,\n rowKey === undefined ? fieldKey({ fieldId }) : fieldKey({ fieldId, rowKey }),\n );\n return blockers.flatMap((blocker): readonly RenderErrorInput[] => {\n switch (blocker.kind) {\n case 'required':\n return [\n {\n targetId: targetOf(blocker.fieldId, blocker.rowKey),\n // The artifact's own sentence wins when the requirement declared one; the host's\n // generic sentence exists for a requirement the artifact states no message for.\n message:\n blocker.messageKey === undefined\n ? copy.notAnswered(labelOf(blocker.fieldId), blocker.rowName)\n : translate(blocker.messageKey, blocker.params),\n },\n ];\n case 'invalidOption':\n return [\n {\n targetId: targetOf(blocker.fieldId, blocker.rowKey),\n message: copy.invalidValue(labelOf(blocker.fieldId)),\n },\n ];\n case 'unavailableOption':\n return [\n {\n targetId: targetOf(blocker.fieldId, blocker.rowKey),\n message:\n blocker.messageKey === undefined\n ? copy.unavailableOption(labelOf(blocker.fieldId))\n : translate(blocker.messageKey, blocker.params),\n },\n ];\n case 'cardinality': {\n const message = copy.cardinality(\n labelOf(blocker.fieldId),\n blocker.bound,\n blocker.count,\n blocker.limit,\n );\n return message === undefined\n ? []\n : [{ targetId: targetOf(blocker.fieldId, undefined), message }];\n }\n case 'scale':\n return [\n {\n targetId: targetOf(blocker.fieldId, blocker.rowKey),\n message:\n blocker.messageKey === undefined ? blocker.fieldId : translate(blocker.messageKey),\n },\n ];\n case 'media':\n return [\n {\n targetId: targetOf(blocker.fieldId, undefined),\n message: copy.mediaConstraint(\n labelOf(blocker.fieldId),\n blocker.member,\n blocker.limit,\n blocker.value,\n ),\n },\n ];\n case 'rowCount':\n return [\n {\n targetId: targetOf(blocker.fieldId, undefined),\n message: copy.rowCount(\n labelOf(blocker.fieldId),\n blocker.expected,\n blocker.actual,\n blocker.source,\n blocker.reason,\n blocker.ceiling,\n ),\n },\n ];\n case 'rule':\n return [\n {\n ...(blocker.fieldId === undefined\n ? {}\n : { targetId: targetOf(blocker.fieldId, blocker.rowKey) }),\n message: translate(blocker.messageKey, blocker.params),\n },\n ];\n case 'gate':\n return [{ message: translate(blocker.messageKey, blocker.params) }];\n case 'screen':\n return [\n {\n message:\n blocker.messageKey === undefined ? blocker.screenId : translate(blocker.messageKey),\n },\n ];\n }\n });\n}\n\n/** Every declared field's label key, a repeating record's members included. */\nfunction labelKeysOf(fields: readonly CompiledField[]): ReadonlyMap<string, string> {\n const labels = new Map<string, string>();\n const visit = (declarations: readonly CompiledField[]): void => {\n for (const field of declarations) {\n if (field.labelKey !== undefined) labels.set(field.fieldId, field.labelKey);\n if (field.fields !== undefined) visit(field.fields);\n }\n };\n visit(fields);\n return labels;\n}\n\n/** The identity a rule failure shares between the blocker list and the binding errors. */\nfunction ruleKeyOf(ruleId: string, messageKey: string): string {\n return `${ruleId}\\u0000${messageKey}`;\n}\n\n/** The identity a gate item shares between the blocker list and the binding errors. */\nfunction gateKeyOf(gateId: string, itemId: string): string {\n return `${gateId}\\u0000${itemId}`;\n}\n\n/** A union arm the compiler proves unreachable. */\nfunction assertNeverErrorKind(value: never): never {\n throw new Error(`unreachable field error: ${JSON.stringify(value)}`);\n}\n"]}
@@ -0,0 +1,45 @@
1
+ import type { Context } from 'react';
2
+ import type { ReactElement, ReactNode } from 'react';
3
+ import type { RenderHeadingLevel, RenderNode, RenderTranslate } from '@azx-pbc/axiom-react';
4
+ /**
5
+ * The container slots a host may replace without leaving the adapter.
6
+ *
7
+ * `ControlComponents` replaces one control; this map replaces one container. A section, a step, a
8
+ * records list and a summary card are all chrome around content the adapter already rendered: a
9
+ * host that wants its own card, its own step header or its own `<dl>` supplies the component and
10
+ * receives the rendered descendants, so replacing the chrome never means re-walking the tree.
11
+ *
12
+ * `field` is not a member. A field's affordance is a control, and `ControlComponents` is the map
13
+ * that answers for it; a field container slot would let a host paint a second label around the
14
+ * binding's own. The two maps are therefore disjoint and exhaustive over `RenderNode['kind']`.
15
+ */
16
+ export type ContainerKind = Exclude<RenderNode['kind'], 'field'>;
17
+ /** The rendered descendants, when the container has any, and the node that describes them. */
18
+ export interface LayoutSlotProps {
19
+ /** The node being painted; the slot reads its titles, tone, columns or record rows. */
20
+ readonly node: Exclude<RenderNode, {
21
+ readonly kind: 'field';
22
+ }>;
23
+ /** The document's message formatter, for every label the slot paints itself. */
24
+ readonly translate: RenderTranslate;
25
+ /** The heading depth this node sits at, one below its container. */
26
+ readonly level: RenderHeadingLevel;
27
+ /**
28
+ * The adapter's own rendering of this node, before the slot was consulted.
29
+ *
30
+ * Return it to keep the default, wrap it to add chrome around the adapter's markup, or ignore
31
+ * it and paint the node from `node` alone. Passing the finished element rather than re-walking
32
+ * the tree is what lets a container slot replace a records list or a wizard without owning
33
+ * their row bindings and cursor.
34
+ */
35
+ readonly children: ReactNode;
36
+ }
37
+ /** One replacement for one container kind. */
38
+ export type LayoutComponent = (props: LayoutSlotProps) => ReactElement | null;
39
+ /** The slot map a host supplies to `RenderedForm` / `LayoutTree`. */
40
+ export type LayoutComponents = Partial<Record<ContainerKind, LayoutComponent>>;
41
+ /** The map in force for the tree; absent means every container uses the adapter's default. */
42
+ export declare const LayoutComponentsContext: Context<LayoutComponents | undefined>;
43
+ /** The slot map currently in force, or `undefined` when the host supplies none. */
44
+ export declare function useLayoutComponents(): LayoutComponents | undefined;
45
+ //# sourceMappingURL=layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/render/layout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5F;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;AAEjE,8FAA8F;AAC9F,MAAM,WAAW,eAAe;IAC9B,uFAAuF;IACvF,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC/D,gFAAgF;IAChF,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,oEAAoE;IACpE,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC;;;;;;;OAOG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAED,8CAA8C;AAC9C,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,eAAe,KAAK,YAAY,GAAG,IAAI,CAAC;AAE9E,qEAAqE;AACrE,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC;AAE/E,8FAA8F;AAC9F,eAAO,MAAM,uBAAuB,EAAE,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAE9D,CAAC;AAEb,mFAAmF;AACnF,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,SAAS,CAElE"}
@@ -0,0 +1,8 @@
1
+ import { createContext, useContext } from 'react';
2
+ /** The map in force for the tree; absent means every container uses the adapter's default. */
3
+ export const LayoutComponentsContext = createContext(undefined);
4
+ /** The slot map currently in force, or `undefined` when the host supplies none. */
5
+ export function useLayoutComponents() {
6
+ return useContext(LayoutComponentsContext);
7
+ }
8
+ //# sourceMappingURL=layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/render/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AA4ClD,8FAA8F;AAC9F,MAAM,CAAC,MAAM,uBAAuB,GAA0C,aAAa,CAEzF,SAAS,CAAC,CAAC;AAEb,mFAAmF;AACnF,MAAM,UAAU,mBAAmB;IACjC,OAAO,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["import { createContext, useContext } from 'react';\nimport type { Context } from 'react';\nimport type { ReactElement, ReactNode } from 'react';\nimport type { RenderHeadingLevel, RenderNode, RenderTranslate } from '@azx-pbc/axiom-react';\n\n/**\n * The container slots a host may replace without leaving the adapter.\n *\n * `ControlComponents` replaces one control; this map replaces one container. A section, a step, a\n * records list and a summary card are all chrome around content the adapter already rendered: a\n * host that wants its own card, its own step header or its own `<dl>` supplies the component and\n * receives the rendered descendants, so replacing the chrome never means re-walking the tree.\n *\n * `field` is not a member. A field's affordance is a control, and `ControlComponents` is the map\n * that answers for it; a field container slot would let a host paint a second label around the\n * binding's own. The two maps are therefore disjoint and exhaustive over `RenderNode['kind']`.\n */\nexport type ContainerKind = Exclude<RenderNode['kind'], 'field'>;\n\n/** The rendered descendants, when the container has any, and the node that describes them. */\nexport interface LayoutSlotProps {\n /** The node being painted; the slot reads its titles, tone, columns or record rows. */\n readonly node: Exclude<RenderNode, { readonly kind: 'field' }>;\n /** The document's message formatter, for every label the slot paints itself. */\n readonly translate: RenderTranslate;\n /** The heading depth this node sits at, one below its container. */\n readonly level: RenderHeadingLevel;\n /**\n * The adapter's own rendering of this node, before the slot was consulted.\n *\n * Return it to keep the default, wrap it to add chrome around the adapter's markup, or ignore\n * it and paint the node from `node` alone. Passing the finished element rather than re-walking\n * the tree is what lets a container slot replace a records list or a wizard without owning\n * their row bindings and cursor.\n */\n readonly children: ReactNode;\n}\n\n/** One replacement for one container kind. */\nexport type LayoutComponent = (props: LayoutSlotProps) => ReactElement | null;\n\n/** The slot map a host supplies to `RenderedForm` / `LayoutTree`. */\nexport type LayoutComponents = Partial<Record<ContainerKind, LayoutComponent>>;\n\n/** The map in force for the tree; absent means every container uses the adapter's default. */\nexport const LayoutComponentsContext: Context<LayoutComponents | undefined> = createContext<\n LayoutComponents | undefined\n>(undefined);\n\n/** The slot map currently in force, or `undefined` when the host supplies none. */\nexport function useLayoutComponents(): LayoutComponents | undefined {\n return useContext(LayoutComponentsContext);\n}\n"]}
@@ -0,0 +1,46 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { DayPickerLocale } from 'react-day-picker/locale';
3
+ import type { WireValue } from '@azx-pbc/axiom-runtime';
4
+ /** The controlled facts a default control hands a schedule picker. */
5
+ export interface SchedulePickerProps {
6
+ readonly fieldId: string;
7
+ readonly label: string;
8
+ readonly value: WireValue | undefined;
9
+ readonly hasHostSource: boolean;
10
+ readonly controlId: string;
11
+ readonly describedBy: string | undefined;
12
+ readonly required: boolean;
13
+ readonly invalid: boolean;
14
+ readonly busy: boolean;
15
+ readonly disabled: boolean;
16
+ readonly readOnly: boolean;
17
+ readonly rowKey?: string | number;
18
+ readonly onBlur: () => void;
19
+ readonly onChange: (value: WireValue) => void;
20
+ }
21
+ /**
22
+ * The DayPicker table the calendar paints, from the same picker-only table as `DatePicker`.
23
+ *
24
+ * `zh` maps to `zhCN`: Hans is the only Chinese the shipped table promises.
25
+ */
26
+ export declare function schedulePickerLocale(locale: string | undefined): DayPickerLocale;
27
+ /**
28
+ * A real scheduler for a `timeslot` field.
29
+ *
30
+ * The value is still the artifact's `{ slotId, localDate, start, end }`; this is presentation.
31
+ * A host that prefers the native select asks for `HostActions.nativeTimeslot` and this component
32
+ * is never painted.
33
+ */
34
+ export declare function SchedulePicker(props: SchedulePickerControlProps & {
35
+ readonly chosenDate: string | undefined;
36
+ readonly onChooseDate: (date: string) => void;
37
+ }): ReactElement;
38
+ /** The props a caller passes before this component owns the selected-day state. */
39
+ export interface SchedulePickerControlProps extends SchedulePickerProps {
40
+ readonly declaredOptions?: readonly {
41
+ readonly code: string | number;
42
+ }[];
43
+ }
44
+ /** A stateful wrapper, so the chosen day survives a parent repaint. */
45
+ export declare function ScheduleField(props: SchedulePickerControlProps): ReactElement;
46
+ //# sourceMappingURL=SchedulePicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchedulePicker.d.ts","sourceRoot":"","sources":["../../src/schedule/SchedulePicker.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,YAAY,EAAE,MAAM,OAAO,CAAC;AAGzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAgBxD,sEAAsE;AACtE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,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
+ import { format } from 'date-fns';
4
+ import { DayPicker } from 'react-day-picker';
5
+ import { useAsyncOptions } from '@azx-pbc/axiom-react';
6
+ import { resolveLocale } from '../format/locale.js';
7
+ import { useLocale } from '../host.js';
8
+ import { pickerLocale, pickerMonthYear } from '../pickers/day-picker-locale.js';
9
+ import { civilDate, civilKey, durationLabel, rangeLabel, scheduleText, slotOf, timeLabel, } from './timeslot.js';
10
+ /**
11
+ * The DayPicker table the calendar paints, from the same picker-only table as `DatePicker`.
12
+ *
13
+ * `zh` maps to `zhCN`: Hans is the only Chinese the shipped table promises.
14
+ */
15
+ export function schedulePickerLocale(locale) {
16
+ return pickerLocale(resolveLocale(locale).language);
17
+ }
18
+ /** One offered window as a slot, when a declared option carries a complete timeslot value. */
19
+ function declaredSlots(options) {
20
+ const slots = [];
21
+ for (const option of options) {
22
+ if (typeof option.code !== 'string')
23
+ continue;
24
+ try {
25
+ const parsed = JSON.parse(option.code);
26
+ const slot = slotOf(parsed);
27
+ if (slot !== undefined)
28
+ slots.push(slot);
29
+ }
30
+ catch {
31
+ // A declared option code that is not a serialised timeslot offers no window; the calendar
32
+ // states the day as unavailable rather than inventing a time the artifact never named.
33
+ }
34
+ }
35
+ return slots;
36
+ }
37
+ /** A calendar plus a proportional day column of offered windows. */
38
+ function ScheduleView({ slots, label, value, controlId, describedBy, required, invalid, loading, error, onRetry, onChange, onBlur, disabled, readOnly, chosenDate, onChooseDate, }) {
39
+ const locale = useLocale();
40
+ const language = resolveLocale(locale).language;
41
+ const text = scheduleText(locale);
42
+ const selectedValue = slotOf(value ?? null);
43
+ const offeredDates = new Set(slots.map((slot) => slot.localDate));
44
+ const firstDate = slots[0]?.localDate;
45
+ const selectedDate = chosenDate !== undefined && offeredDates.has(chosenDate)
46
+ ? chosenDate
47
+ : selectedValue !== undefined && offeredDates.has(selectedValue.localDate)
48
+ ? selectedValue.localDate
49
+ : firstDate;
50
+ const daySlots = selectedDate === undefined ? [] : slots.filter((slot) => slot.localDate === selectedDate);
51
+ const axisStart = daySlots.reduce((low, slot) => Math.min(low, slot.startMinutes), 24 * 60);
52
+ const axisEnd = daySlots.reduce((high, slot) => Math.max(high, slot.endMinutes), 0);
53
+ const span = Math.max(axisEnd - axisStart, 60);
54
+ const [activeIndex, setActiveIndex] = useState(0);
55
+ const active = daySlots.length === 0 ? -1 : Math.min(activeIndex, daySlots.length - 1);
56
+ const selectedSlotId = selectedValue === undefined ? '' : selectedValue.value.slotId;
57
+ const choose = (slot) => {
58
+ if (disabled || readOnly)
59
+ return;
60
+ onChange(slot.value);
61
+ onBlur();
62
+ };
63
+ const key = (event) => {
64
+ if (daySlots.length === 0 || disabled || readOnly)
65
+ return;
66
+ if (event.key === 'ArrowDown' || event.key === 'ArrowRight') {
67
+ event.preventDefault();
68
+ setActiveIndex((index) => Math.min(index + 1, daySlots.length - 1));
69
+ }
70
+ else if (event.key === 'ArrowUp' || event.key === 'ArrowLeft') {
71
+ event.preventDefault();
72
+ setActiveIndex((index) => Math.max(index - 1, 0));
73
+ }
74
+ else if (event.key === 'Home') {
75
+ event.preventDefault();
76
+ setActiveIndex(0);
77
+ }
78
+ else if (event.key === 'End') {
79
+ event.preventDefault();
80
+ setActiveIndex(daySlots.length - 1);
81
+ }
82
+ else if (event.key === 'Enter' || event.key === ' ') {
83
+ const slot = daySlots[active];
84
+ if (slot !== undefined) {
85
+ event.preventDefault();
86
+ choose(slot);
87
+ }
88
+ }
89
+ };
90
+ const isDisabled = (date) => !offeredDates.has(civilKey(date));
91
+ const month = selectedDate === undefined ? undefined : civilDate(selectedDate);
92
+ const calendar = schedulePickerLocale(locale);
93
+ // As in `DatePicker`: the Chinese caption and grid label must not reach
94
+ // `DateLib.formatMonthYear`, which formats the year-first locales with `Intl.DateTimeFormat`.
95
+ const intlFreeCaption = language === 'zh';
96
+ return (_jsxs("div", { className: "ax-schedule", "data-slot-picker": "", children: [_jsx("div", { className: "ax-schedule-calendar", children: _jsx(DayPicker, { mode: "single", selected: month, ...(month === undefined ? {} : { defaultMonth: month }), onSelect: (date) => {
97
+ if (date !== undefined) {
98
+ onChooseDate(civilKey(date));
99
+ onBlur();
100
+ }
101
+ }, disabled: isDisabled, locale: calendar, ...(intlFreeCaption
102
+ ? { formatters: { formatCaption: (date) => pickerMonthYear(date, language) } }
103
+ : {}), labels: {
104
+ labelPrevious: () => text.previousMonth,
105
+ labelNext: () => text.nextMonth,
106
+ labelDayButton: (date, modifiers) => {
107
+ // The visible text of a day button is its number, and `label-content-name-mismatch`
108
+ // (WCAG 2.5.3) compares whole tokens: a name of "September 2nd, 2026" tokenises
109
+ // `2nd`, so the painted `2` is not in it. Naming the number first makes the visible
110
+ // text a token of the name a voice user reads.
111
+ const base = format(date, 'PPP', { locale: calendar });
112
+ const named = `${String(date.getDate())}, ${base}`;
113
+ return modifiers['disabled'] === true ? `${named}, ${text.unavailable}` : named;
114
+ },
115
+ ...(intlFreeCaption
116
+ ? { labelGrid: (date) => pickerMonthYear(date, language) }
117
+ : {}),
118
+ } }, selectedDate ?? 'none') }), _jsxs("div", { className: "ax-schedule-day", "data-schedule-day": "", children: [_jsx("p", { className: "ax-schedule-day-title", role: "status", children: selectedDate === undefined
119
+ ? text.noAvailability
120
+ : month === undefined
121
+ ? selectedDate
122
+ : format(month, 'PPPP', { locale: calendar }) }), error === undefined ? null : (_jsxs("div", { className: "ax-schedule-error", role: "alert", children: [_jsx("p", { children: text.failed(error.message) }), _jsx("button", { type: "button", className: "ax-button ax-button--secondary", onClick: onRetry, children: text.retry })] })), loading ? (_jsx("div", { className: "ax-schedule-skeleton", "aria-busy": "true", "data-skeleton": "", children: _jsx("span", { className: "ax-visually-hidden axiom-visually-hidden", children: text.loading }) })) : daySlots.length === 0 ? (_jsx("p", { className: "ax-hint", "data-slot-empty": "", children: text.noTimes })) : (_jsxs("div", { id: controlId, className: "ax-schedule-slots", role: "listbox", tabIndex: 0, "aria-label": label, "aria-describedby": describedBy, "aria-required": required, "aria-invalid": invalid, "aria-activedescendant": active < 0 ? undefined : `${controlId}-slot-${String(active)}`, onKeyDown: key, onBlur: onBlur, children: [axisStart < 24 * 60 ? (_jsx("span", { className: "ax-schedule-axis ax-schedule-axis--start", "aria-hidden": "true", children: timeLabel(axisStart, locale) })) : null, axisEnd > 0 ? (_jsx("span", { className: "ax-schedule-axis ax-schedule-axis--end", "aria-hidden": "true", children: timeLabel(axisEnd, locale) })) : null, daySlots.map((slot, index) => {
123
+ const top = ((slot.startMinutes - axisStart) / span) * 100;
124
+ const height = ((slot.endMinutes - slot.startMinutes) / span) * 100;
125
+ const id = `${controlId}-slot-${String(index)}`;
126
+ const chosen = selectedSlotId !== '' && slot.value.slotId === selectedSlotId;
127
+ return (_jsxs("div", { id: id, role: "option", "aria-selected": chosen, className: "ax-schedule-slot", "data-active": index === active ? '' : undefined, "data-selected": chosen ? '' : undefined, style: { top: `${String(top)}%`, height: `${String(height)}%` }, onMouseDown: (event) => {
128
+ event.preventDefault();
129
+ setActiveIndex(index);
130
+ choose(slot);
131
+ }, children: [_jsx("span", { className: "ax-schedule-slot-time", children: rangeLabel(slot, locale) }), _jsx("span", { className: "ax-schedule-slot-duration", children: durationLabel(slot.endMinutes - slot.startMinutes) })] }, id));
132
+ })] }))] })] }));
133
+ }
134
+ /** The host-loaded schedule: pages, loading, error and retry around the same view. */
135
+ function HostSchedule(props) {
136
+ const pages = useAsyncOptions(props.fieldId, props.rowKey);
137
+ const slots = pages.items.flatMap((item) => {
138
+ const slot = slotOf(item.value);
139
+ return slot === undefined ? [] : [slot];
140
+ });
141
+ return (_jsx(ScheduleView, { slots: slots, label: props.label, value: props.value, controlId: props.controlId, describedBy: props.describedBy, required: props.required, invalid: props.invalid, loading: pages.loading, error: pages.error, onRetry: pages.reload, onChange: props.onChange, onBlur: props.onBlur, disabled: props.disabled, readOnly: props.readOnly, chosenDate: props.chosenDate, onChooseDate: props.onChooseDate }));
142
+ }
143
+ /**
144
+ * A real scheduler for a `timeslot` field.
145
+ *
146
+ * The value is still the artifact's `{ slotId, localDate, start, end }`; this is presentation.
147
+ * A host that prefers the native select asks for `HostActions.nativeTimeslot` and this component
148
+ * is never painted.
149
+ */
150
+ export function SchedulePicker(props) {
151
+ if (props.hasHostSource)
152
+ return _jsx(HostSchedule, { ...props });
153
+ return (_jsx(ScheduleView, { slots: declaredSlots(props.declaredOptions ?? []), label: props.label, value: props.value, controlId: props.controlId, describedBy: props.describedBy, required: props.required, invalid: props.invalid, loading: false, error: undefined, onRetry: () => undefined, onChange: props.onChange, onBlur: props.onBlur, disabled: props.disabled, readOnly: props.readOnly, chosenDate: props.chosenDate, onChooseDate: props.onChooseDate }));
154
+ }
155
+ /** A stateful wrapper, so the chosen day survives a parent repaint. */
156
+ export function ScheduleField(props) {
157
+ const [chosenDate, setChosenDate] = useState(undefined);
158
+ return _jsx(SchedulePicker, { ...props, chosenDate: chosenDate, onChooseDate: setChosenDate });
159
+ }
160
+ //# sourceMappingURL=SchedulePicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchedulePicker.js","sourceRoot":"","sources":["../../src/schedule/SchedulePicker.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EACL,SAAS,EACT,QAAQ,EACR,aAAa,EACb,UAAU,EACV,YAAY,EACZ,MAAM,EACN,SAAS,GACV,MAAM,eAAe,CAAC;AAqBvB;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA0B;IAC7D,OAAO,YAAY,CAAC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;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,KAGC;IAED,IAAI,KAAK,CAAC,aAAa;QAAE,OAAO,KAAC,YAAY,OAAK,KAAK,GAAI,CAAC;IAC5D,OAAO,CACL,KAAC,YAAY,IACX,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC,EACjD,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,OAAO,EAAE,KAAK,EACd,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,EACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,UAAU,EAAE,KAAK,CAAC,UAAU,EAC5B,YAAY,EAAE,KAAK,CAAC,YAAY,GAChC,CACH,CAAC;AACJ,CAAC;AAOD,uEAAuE;AACvE,MAAM,UAAU,aAAa,CAAC,KAAiC;IAC7D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAqB,SAAS,CAAC,CAAC;IAC5E,OAAO,KAAC,cAAc,OAAK,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,GAAI,CAAC;AAC5F,CAAC","sourcesContent":["import { useState } from 'react';\nimport type { KeyboardEvent, ReactElement } from 'react';\nimport { format } from 'date-fns';\nimport { DayPicker } from 'react-day-picker';\nimport type { DayPickerLocale } from 'react-day-picker/locale';\nimport type { WireValue } from '@azx-pbc/axiom-runtime';\nimport { useAsyncOptions } from '@azx-pbc/axiom-react';\nimport { resolveLocale } from '../format/locale.js';\nimport { useLocale } from '../host.js';\nimport { pickerLocale, pickerMonthYear } from '../pickers/day-picker-locale.js';\nimport {\n civilDate,\n civilKey,\n durationLabel,\n rangeLabel,\n scheduleText,\n slotOf,\n timeLabel,\n} from './timeslot.js';\nimport type { TimeslotSlot } from './timeslot.js';\n\n/** The controlled facts a default control hands a schedule picker. */\nexport interface SchedulePickerProps {\n readonly fieldId: string;\n readonly label: string;\n readonly value: WireValue | undefined;\n readonly hasHostSource: boolean;\n readonly controlId: string;\n readonly describedBy: string | undefined;\n readonly required: boolean;\n readonly invalid: boolean;\n readonly busy: boolean;\n readonly disabled: boolean;\n readonly readOnly: boolean;\n readonly rowKey?: string | number;\n readonly onBlur: () => void;\n readonly onChange: (value: WireValue) => void;\n}\n\n/**\n * The DayPicker table the calendar paints, from the same picker-only table as `DatePicker`.\n *\n * `zh` maps to `zhCN`: Hans is the only Chinese the shipped table promises.\n */\nexport function schedulePickerLocale(locale: string | undefined): DayPickerLocale {\n return pickerLocale(resolveLocale(locale).language);\n}\n\n/** One offered window as a slot, when a declared option carries a complete timeslot value. */\nfunction declaredSlots(\n options: readonly { readonly code: string | number }[],\n): readonly TimeslotSlot[] {\n const slots: TimeslotSlot[] = [];\n for (const option of options) {\n if (typeof option.code !== 'string') continue;\n try {\n const parsed: unknown = JSON.parse(option.code);\n const slot = slotOf(parsed);\n if (slot !== undefined) slots.push(slot);\n } catch {\n // A declared option code that is not a serialised timeslot offers no window; the calendar\n // states the day as unavailable rather than inventing a time the artifact never named.\n }\n }\n return slots;\n}\n\n/** A calendar plus a proportional day column of offered windows. */\nfunction ScheduleView({\n slots,\n label,\n value,\n controlId,\n describedBy,\n required,\n invalid,\n loading,\n error,\n onRetry,\n onChange,\n onBlur,\n disabled,\n readOnly,\n chosenDate,\n onChooseDate,\n}: {\n readonly slots: readonly TimeslotSlot[];\n readonly label: string;\n readonly value: WireValue | undefined;\n readonly controlId: string;\n readonly describedBy: string | undefined;\n readonly required: boolean;\n readonly invalid: boolean;\n readonly loading: boolean;\n readonly error: Error | undefined;\n readonly onRetry: () => void;\n readonly onChange: (value: WireValue) => void;\n readonly onBlur: () => void;\n readonly disabled: boolean;\n readonly readOnly: boolean;\n readonly chosenDate: string | undefined;\n readonly onChooseDate: (date: string) => void;\n}): ReactElement {\n const locale = useLocale();\n const language = resolveLocale(locale).language;\n const text = scheduleText(locale);\n const selectedValue = slotOf(value ?? null);\n const offeredDates = new Set(slots.map((slot) => slot.localDate));\n const firstDate = slots[0]?.localDate;\n const selectedDate =\n chosenDate !== undefined && offeredDates.has(chosenDate)\n ? chosenDate\n : selectedValue !== undefined && offeredDates.has(selectedValue.localDate)\n ? selectedValue.localDate\n : firstDate;\n const daySlots =\n selectedDate === undefined ? [] : slots.filter((slot) => slot.localDate === selectedDate);\n const axisStart = daySlots.reduce((low, slot) => Math.min(low, slot.startMinutes), 24 * 60);\n const axisEnd = daySlots.reduce((high, slot) => Math.max(high, slot.endMinutes), 0);\n const span = Math.max(axisEnd - axisStart, 60);\n const [activeIndex, setActiveIndex] = useState(0);\n const active = daySlots.length === 0 ? -1 : Math.min(activeIndex, daySlots.length - 1);\n const selectedSlotId = selectedValue === undefined ? '' : selectedValue.value.slotId;\n\n const choose = (slot: TimeslotSlot): void => {\n if (disabled || readOnly) return;\n onChange(slot.value);\n onBlur();\n };\n const key = (event: KeyboardEvent<HTMLDivElement>): void => {\n if (daySlots.length === 0 || disabled || readOnly) return;\n if (event.key === 'ArrowDown' || event.key === 'ArrowRight') {\n event.preventDefault();\n setActiveIndex((index) => Math.min(index + 1, daySlots.length - 1));\n } else if (event.key === 'ArrowUp' || event.key === 'ArrowLeft') {\n event.preventDefault();\n setActiveIndex((index) => Math.max(index - 1, 0));\n } else if (event.key === 'Home') {\n event.preventDefault();\n setActiveIndex(0);\n } else if (event.key === 'End') {\n event.preventDefault();\n setActiveIndex(daySlots.length - 1);\n } else if (event.key === 'Enter' || event.key === ' ') {\n const slot = daySlots[active];\n if (slot !== undefined) {\n event.preventDefault();\n choose(slot);\n }\n }\n };\n\n const isDisabled = (date: Date): boolean => !offeredDates.has(civilKey(date));\n const month = selectedDate === undefined ? undefined : civilDate(selectedDate);\n const calendar = schedulePickerLocale(locale);\n // As in `DatePicker`: the Chinese caption and grid label must not reach\n // `DateLib.formatMonthYear`, which formats the year-first locales with `Intl.DateTimeFormat`.\n const intlFreeCaption = language === 'zh';\n return (\n <div className=\"ax-schedule\" data-slot-picker=\"\">\n <div className=\"ax-schedule-calendar\">\n <DayPicker\n key={selectedDate ?? 'none'}\n mode=\"single\"\n selected={month}\n {...(month === undefined ? {} : { defaultMonth: month })}\n onSelect={(date) => {\n if (date !== undefined) {\n onChooseDate(civilKey(date));\n onBlur();\n }\n }}\n disabled={isDisabled}\n locale={calendar}\n {...(intlFreeCaption\n ? { formatters: { formatCaption: (date: Date) => pickerMonthYear(date, language) } }\n : {})}\n labels={{\n labelPrevious: () => text.previousMonth,\n labelNext: () => text.nextMonth,\n labelDayButton: (date, modifiers) => {\n // The visible text of a day button is its number, and `label-content-name-mismatch`\n // (WCAG 2.5.3) compares whole tokens: a name of \"September 2nd, 2026\" tokenises\n // `2nd`, so the painted `2` is not in it. Naming the number first makes the visible\n // text a token of the name a voice user reads.\n const base = format(date, 'PPP', { locale: calendar });\n const named = `${String(date.getDate())}, ${base}`;\n return modifiers['disabled'] === true ? `${named}, ${text.unavailable}` : named;\n },\n ...(intlFreeCaption\n ? { labelGrid: (date: Date) => pickerMonthYear(date, language) }\n : {}),\n }}\n />\n </div>\n <div className=\"ax-schedule-day\" data-schedule-day=\"\">\n <p className=\"ax-schedule-day-title\" role=\"status\">\n {selectedDate === undefined\n ? text.noAvailability\n : month === undefined\n ? selectedDate\n : format(month, 'PPPP', { locale: calendar })}\n </p>\n {error === undefined ? null : (\n <div className=\"ax-schedule-error\" role=\"alert\">\n <p>{text.failed(error.message)}</p>\n <button type=\"button\" className=\"ax-button ax-button--secondary\" onClick={onRetry}>\n {text.retry}\n </button>\n </div>\n )}\n {loading ? (\n <div className=\"ax-schedule-skeleton\" aria-busy=\"true\" data-skeleton=\"\">\n <span className=\"ax-visually-hidden axiom-visually-hidden\">{text.loading}</span>\n </div>\n ) : daySlots.length === 0 ? (\n <p className=\"ax-hint\" data-slot-empty=\"\">\n {text.noTimes}\n </p>\n ) : (\n <div\n id={controlId}\n className=\"ax-schedule-slots\"\n role=\"listbox\"\n tabIndex={0}\n aria-label={label}\n aria-describedby={describedBy}\n aria-required={required}\n aria-invalid={invalid}\n aria-activedescendant={active < 0 ? undefined : `${controlId}-slot-${String(active)}`}\n onKeyDown={key}\n onBlur={onBlur}\n >\n {axisStart < 24 * 60 ? (\n <span className=\"ax-schedule-axis ax-schedule-axis--start\" aria-hidden=\"true\">\n {timeLabel(axisStart, locale)}\n </span>\n ) : null}\n {axisEnd > 0 ? (\n <span className=\"ax-schedule-axis ax-schedule-axis--end\" aria-hidden=\"true\">\n {timeLabel(axisEnd, locale)}\n </span>\n ) : null}\n {daySlots.map((slot, index) => {\n const top = ((slot.startMinutes - axisStart) / span) * 100;\n const height = ((slot.endMinutes - slot.startMinutes) / span) * 100;\n const id = `${controlId}-slot-${String(index)}`;\n const chosen = selectedSlotId !== '' && slot.value.slotId === selectedSlotId;\n return (\n <div\n key={id}\n id={id}\n role=\"option\"\n aria-selected={chosen}\n className=\"ax-schedule-slot\"\n data-active={index === active ? '' : undefined}\n data-selected={chosen ? '' : undefined}\n style={{ top: `${String(top)}%`, height: `${String(height)}%` }}\n onMouseDown={(event) => {\n event.preventDefault();\n setActiveIndex(index);\n choose(slot);\n }}\n >\n <span className=\"ax-schedule-slot-time\">{rangeLabel(slot, locale)}</span>\n <span className=\"ax-schedule-slot-duration\">\n {durationLabel(slot.endMinutes - slot.startMinutes)}\n </span>\n </div>\n );\n })}\n </div>\n )}\n </div>\n </div>\n );\n}\n\n/** The host-loaded schedule: pages, loading, error and retry around the same view. */\nfunction HostSchedule(\n props: SchedulePickerControlProps & {\n readonly chosenDate: string | undefined;\n readonly onChooseDate: (date: string) => void;\n },\n): ReactElement {\n const pages = useAsyncOptions(props.fieldId, props.rowKey);\n const slots = pages.items.flatMap((item) => {\n const slot = slotOf(item.value);\n return slot === undefined ? [] : [slot];\n });\n return (\n <ScheduleView\n slots={slots}\n label={props.label}\n value={props.value}\n controlId={props.controlId}\n describedBy={props.describedBy}\n required={props.required}\n invalid={props.invalid}\n loading={pages.loading}\n error={pages.error}\n onRetry={pages.reload}\n onChange={props.onChange}\n onBlur={props.onBlur}\n disabled={props.disabled}\n readOnly={props.readOnly}\n chosenDate={props.chosenDate}\n onChooseDate={props.onChooseDate}\n />\n );\n}\n\n/**\n * A real scheduler for a `timeslot` field.\n *\n * The value is still the artifact's `{ slotId, localDate, start, end }`; this is presentation.\n * A host that prefers the native select asks for `HostActions.nativeTimeslot` and this component\n * is never painted.\n */\nexport function SchedulePicker(\n props: SchedulePickerControlProps & {\n readonly chosenDate: string | undefined;\n readonly onChooseDate: (date: string) => void;\n },\n): ReactElement {\n if (props.hasHostSource) return <HostSchedule {...props} />;\n return (\n <ScheduleView\n slots={declaredSlots(props.declaredOptions ?? [])}\n label={props.label}\n value={props.value}\n controlId={props.controlId}\n describedBy={props.describedBy}\n required={props.required}\n invalid={props.invalid}\n loading={false}\n error={undefined}\n onRetry={() => undefined}\n onChange={props.onChange}\n onBlur={props.onBlur}\n disabled={props.disabled}\n readOnly={props.readOnly}\n chosenDate={props.chosenDate}\n onChooseDate={props.onChooseDate}\n />\n );\n}\n\n/** The props a caller passes before this component owns the selected-day state. */\nexport interface SchedulePickerControlProps extends SchedulePickerProps {\n readonly declaredOptions?: readonly { readonly code: string | number }[];\n}\n\n/** A stateful wrapper, so the chosen day survives a parent repaint. */\nexport function ScheduleField(props: SchedulePickerControlProps): ReactElement {\n const [chosenDate, setChosenDate] = useState<string | undefined>(undefined);\n return <SchedulePicker {...props} chosenDate={chosenDate} onChooseDate={setChosenDate} />;\n}\n"]}