@adea-ai/ui 0.162.13 → 0.162.15

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 (196) hide show
  1. package/dist/components/composites/accent-picker/accent-picker.js +1 -1
  2. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
  3. package/dist/components/composites/accent-picker/custom-color-popover.js +1 -1
  4. package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
  5. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +1 -1
  6. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  7. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  8. package/dist/components/composites/appearance-editor/appearance-choices.js +2 -2
  9. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  10. package/dist/components/composites/confirmation/confirmation.js +1 -1
  11. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  12. package/dist/components/composites/icon-picker/icon-picker.js +1 -1
  13. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  14. package/dist/components/composites/list-row/list-row-control.js +1 -1
  15. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  16. package/dist/components/composites/settings/settings.js +1 -1
  17. package/dist/components/composites/settings/settings.js.map +1 -1
  18. package/dist/components/composites/stack-trace/stack-trace.js +1 -1
  19. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  20. package/dist/components/composites/tree/tree.js +1 -1
  21. package/dist/components/composites/tree/tree.js.map +1 -1
  22. package/dist/components/composites/workspace-mark/workspace-mark.js +1 -1
  23. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  24. package/dist/components/conversation/thread-panel.js +1 -1
  25. package/dist/components/conversation/thread-panel.js.map +1 -1
  26. package/dist/components/layout/app-shell/skip-link.js +1 -1
  27. package/dist/components/layout/app-shell/skip-link.js.map +1 -1
  28. package/dist/components/layout/side-rail/side-rail.js +1 -1
  29. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  30. package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js +1 -1
  31. package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js.map +1 -1
  32. package/dist/components/layout/sidebar-nav/sidebar-nav.js +1 -1
  33. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  34. package/dist/components/layout/top-bar/top-bar.js +2 -2
  35. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  36. package/dist/components/ui/accordion/accordion.js +1 -1
  37. package/dist/components/ui/accordion/accordion.js.map +1 -1
  38. package/dist/components/ui/annotation-surface/annotation-surface.js +1 -1
  39. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  40. package/dist/components/ui/attachment/attachment.js +2 -2
  41. package/dist/components/ui/attachment/attachment.js.map +1 -1
  42. package/dist/components/ui/board/board.js +2 -2
  43. package/dist/components/ui/board/board.js.map +1 -1
  44. package/dist/components/ui/breadcrumb/breadcrumb.js +1 -1
  45. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  46. package/dist/components/ui/button/button.js +1 -1
  47. package/dist/components/ui/button/button.js.map +1 -1
  48. package/dist/components/ui/checkbox/checkbox.js +1 -1
  49. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  50. package/dist/components/ui/collapsible/collapsible.js +1 -1
  51. package/dist/components/ui/collapsible/collapsible.js.map +1 -1
  52. package/dist/components/ui/combobox/combobox.js +3 -3
  53. package/dist/components/ui/combobox/combobox.js.map +1 -1
  54. package/dist/components/ui/field/field.js +2 -2
  55. package/dist/components/ui/field/field.js.map +1 -1
  56. package/dist/components/ui/input/input-control.js +1 -1
  57. package/dist/components/ui/input/input-control.js.map +1 -1
  58. package/dist/components/ui/input-group/input-group.js +1 -1
  59. package/dist/components/ui/input-group/input-group.js.map +1 -1
  60. package/dist/components/ui/input-otp/input-otp.js +1 -1
  61. package/dist/components/ui/input-otp/input-otp.js.map +1 -1
  62. package/dist/components/ui/menubar/menubar.js +1 -1
  63. package/dist/components/ui/menubar/menubar.js.map +1 -1
  64. package/dist/components/ui/native-select/native-select.js +1 -1
  65. package/dist/components/ui/native-select/native-select.js.map +1 -1
  66. package/dist/components/ui/pagination/pagination.js +1 -1
  67. package/dist/components/ui/pagination/pagination.js.map +1 -1
  68. package/dist/components/ui/questionnaire/questionnaire.js +1 -1
  69. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  70. package/dist/components/ui/radio-group/radio-group.js +2 -2
  71. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  72. package/dist/components/ui/scroll-area/scroll-area.js +1 -1
  73. package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
  74. package/dist/components/ui/select/select.js +1 -1
  75. package/dist/components/ui/select/select.js.map +1 -1
  76. package/dist/components/ui/slider/slider.js +1 -1
  77. package/dist/components/ui/slider/slider.js.map +1 -1
  78. package/dist/components/ui/switch/switch.js +1 -1
  79. package/dist/components/ui/switch/switch.js.map +1 -1
  80. package/dist/components/ui/tabs/tabs.js +1 -1
  81. package/dist/components/ui/tabs/tabs.js.map +1 -1
  82. package/dist/components/ui/text-link/text-link.js +1 -1
  83. package/dist/components/ui/text-link/text-link.js.map +1 -1
  84. package/dist/components/ui/textarea/textarea.js +1 -1
  85. package/dist/components/ui/textarea/textarea.js.map +1 -1
  86. package/dist/components/ui/toast/toast.js +1 -1
  87. package/dist/components/ui/toast/toast.js.map +1 -1
  88. package/dist/components/ui/trace/trace.js +1 -1
  89. package/dist/components/ui/trace/trace.js.map +1 -1
  90. package/dist/lib/overlay.d.ts.map +1 -1
  91. package/dist/lib/overlay.js +1 -1
  92. package/dist/lib/overlay.js.map +1 -1
  93. package/dist/lib/tokens.d.ts.map +1 -1
  94. package/dist/lib/tokens.js +2 -2
  95. package/dist/lib/tokens.js.map +1 -1
  96. package/dist/lib/variants.d.ts +1 -1
  97. package/dist/lib/variants.d.ts.map +1 -1
  98. package/dist/lib/variants.js +1 -1
  99. package/dist/lib/variants.js.map +1 -1
  100. package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +1 -1
  101. package/dist/r/src/components/composites/accent-picker/custom-color-popover.tsx +1 -1
  102. package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +1 -1
  103. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +2 -5
  104. package/dist/r/src/components/composites/confirmation/confirmation.tsx +1 -1
  105. package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +1 -1
  106. package/dist/r/src/components/composites/list-row/list-row-control.tsx +1 -1
  107. package/dist/r/src/components/composites/settings/settings.tsx +1 -1
  108. package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +1 -1
  109. package/dist/r/src/components/composites/tree/tree.tsx +1 -1
  110. package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
  111. package/dist/r/src/components/conversation/thread-panel.tsx +1 -1
  112. package/dist/r/src/components/layout/app-shell/skip-link.tsx +1 -1
  113. package/dist/r/src/components/layout/side-rail/side-rail.tsx +1 -1
  114. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +1 -1
  115. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +1 -1
  116. package/dist/r/src/components/layout/top-bar/top-bar.tsx +2 -2
  117. package/dist/r/src/components/ui/accordion/accordion.tsx +1 -1
  118. package/dist/r/src/components/ui/annotation-surface/annotation-surface.tsx +1 -1
  119. package/dist/r/src/components/ui/attachment/attachment.tsx +2 -2
  120. package/dist/r/src/components/ui/board/board.tsx +2 -2
  121. package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +1 -1
  122. package/dist/r/src/components/ui/button/button.tsx +1 -1
  123. package/dist/r/src/components/ui/checkbox/checkbox.tsx +1 -1
  124. package/dist/r/src/components/ui/collapsible/collapsible.tsx +1 -1
  125. package/dist/r/src/components/ui/combobox/combobox.tsx +3 -3
  126. package/dist/r/src/components/ui/field/field.tsx +2 -2
  127. package/dist/r/src/components/ui/input/input-control.tsx +1 -1
  128. package/dist/r/src/components/ui/input-group/input-group.tsx +1 -1
  129. package/dist/r/src/components/ui/input-otp/input-otp.tsx +1 -1
  130. package/dist/r/src/components/ui/menubar/menubar.tsx +1 -1
  131. package/dist/r/src/components/ui/native-select/native-select.tsx +1 -1
  132. package/dist/r/src/components/ui/pagination/pagination.tsx +1 -1
  133. package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +1 -1
  134. package/dist/r/src/components/ui/radio-group/radio-group.tsx +2 -2
  135. package/dist/r/src/components/ui/scroll-area/scroll-area.tsx +1 -1
  136. package/dist/r/src/components/ui/select/select.tsx +1 -1
  137. package/dist/r/src/components/ui/slider/slider.tsx +1 -1
  138. package/dist/r/src/components/ui/switch/switch.tsx +1 -1
  139. package/dist/r/src/components/ui/tabs/tabs.tsx +1 -1
  140. package/dist/r/src/components/ui/text-link/text-link.tsx +1 -1
  141. package/dist/r/src/components/ui/textarea/textarea.tsx +1 -1
  142. package/dist/r/src/components/ui/toast/toast.tsx +1 -1
  143. package/dist/r/src/components/ui/trace/trace.tsx +1 -1
  144. package/dist/r/src/lib/overlay.ts +1 -1
  145. package/dist/r/src/lib/tokens.ts +4 -2
  146. package/dist/r/src/lib/variants.ts +1 -1
  147. package/dist/r/src/styles/base.css +35 -7
  148. package/package.json +7 -7
  149. package/src/components/composites/accent-picker/accent-picker.tsx +1 -1
  150. package/src/components/composites/accent-picker/custom-color-popover.tsx +1 -1
  151. package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +1 -1
  152. package/src/components/composites/appearance-editor/appearance-choices.tsx +2 -5
  153. package/src/components/composites/confirmation/confirmation.tsx +1 -1
  154. package/src/components/composites/icon-picker/icon-picker.tsx +1 -1
  155. package/src/components/composites/list-row/list-row-control.tsx +1 -1
  156. package/src/components/composites/settings/settings.tsx +1 -1
  157. package/src/components/composites/stack-trace/stack-trace.tsx +1 -1
  158. package/src/components/composites/tree/tree.tsx +1 -1
  159. package/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
  160. package/src/components/conversation/thread-panel.tsx +1 -1
  161. package/src/components/layout/app-shell/skip-link.tsx +1 -1
  162. package/src/components/layout/side-rail/side-rail.tsx +1 -1
  163. package/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +1 -1
  164. package/src/components/layout/sidebar-nav/sidebar-nav.tsx +1 -1
  165. package/src/components/layout/top-bar/top-bar.tsx +2 -2
  166. package/src/components/ui/accordion/accordion.tsx +1 -1
  167. package/src/components/ui/annotation-surface/annotation-surface.tsx +1 -1
  168. package/src/components/ui/attachment/attachment.tsx +2 -2
  169. package/src/components/ui/board/board.tsx +2 -2
  170. package/src/components/ui/breadcrumb/breadcrumb.tsx +1 -1
  171. package/src/components/ui/button/button.tsx +1 -1
  172. package/src/components/ui/checkbox/checkbox.tsx +1 -1
  173. package/src/components/ui/collapsible/collapsible.tsx +1 -1
  174. package/src/components/ui/combobox/combobox.tsx +3 -3
  175. package/src/components/ui/field/field.tsx +2 -2
  176. package/src/components/ui/input/input-control.tsx +1 -1
  177. package/src/components/ui/input-group/input-group.tsx +1 -1
  178. package/src/components/ui/input-otp/input-otp.tsx +1 -1
  179. package/src/components/ui/menubar/menubar.tsx +1 -1
  180. package/src/components/ui/native-select/native-select.tsx +1 -1
  181. package/src/components/ui/pagination/pagination.tsx +1 -1
  182. package/src/components/ui/questionnaire/questionnaire.tsx +1 -1
  183. package/src/components/ui/radio-group/radio-group.tsx +2 -2
  184. package/src/components/ui/scroll-area/scroll-area.tsx +1 -1
  185. package/src/components/ui/select/select.tsx +1 -1
  186. package/src/components/ui/slider/slider.tsx +1 -1
  187. package/src/components/ui/switch/switch.tsx +1 -1
  188. package/src/components/ui/tabs/tabs.tsx +1 -1
  189. package/src/components/ui/text-link/text-link.tsx +1 -1
  190. package/src/components/ui/textarea/textarea.tsx +1 -1
  191. package/src/components/ui/toast/toast.tsx +1 -1
  192. package/src/components/ui/trace/trace.tsx +1 -1
  193. package/src/lib/overlay.ts +1 -1
  194. package/src/lib/tokens.ts +4 -2
  195. package/src/lib/variants.ts +1 -1
  196. package/src/styles/base.css +35 -7
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.js","names":["<SdkPagination\n aria-label=\"Pagination\"\n pageCount={props.count}\n siblings={props.siblingCount ?? 1}\n // ui-sdk shows the same number of pages at both ends; hiding only one\n // end is not something it draws, so either flag keeps a boundary page.\n boundaries={props.showFirst === false && props.showLast === false ? 0 : 1}\n onPageChange={(page) => props.onPageChange?.(page)}\n // The root is a `<nav>` wrapping a `<ul>`, and every control — previous,\n // the page run, next — is an `<li>` inside that list. The row has to be\n // declared on the list: on the `<nav>` alone it lays out one child and\n // the controls stack vertically.\n class={cn(\n 'flex w-full items-center justify-center [&>ul]:m-0 [&>ul]:flex [&>ul]:list-none [&>ul]:items-center [&>ul]:gap-1 [&>ul]:p-0',\n props.class\n )}\n {...rest}\n >\n <SdkPaginationList>\n {(state) => (\n <Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n )}\n </SdkPaginationList>\n </SdkPagination>","onPageChange={(page) => props.onPageChange?.(page)}","<SdkPaginationList>\n {(state) => (\n <Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n )}\n </SdkPaginationList>","<Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>","<DefaultPaginationControls items={state.items} />","{childrenSlot()}","<PaginationPrevious />","<For each={state.items}>\n {(item) =>\n typeof item === 'number'\n ? (props.itemComponent ?? defaultItem)({ page: item })\n : (props.ellipsisComponent ?? defaultEllipsis)()\n }\n </For>","<PaginationNext />","<PaginationItem page={itemProps.page}>{itemProps.page}</PaginationItem>","<PaginationEllipsis />","<SdkPaginationItem>\n <SdkPaginationPrevious\n class={cn(paginationControl, 'ps-1.5', props.class as string)}\n {...rest}\n >\n {props.children ?? (\n <>\n <ChevronLeft class=\"size-4\" />\n <span class=\"hidden sm:inline\">Previous</span>\n </>\n )}\n </SdkPaginationPrevious>\n </SdkPaginationItem>","<SdkPaginationPrevious\n class={cn(paginationControl, 'ps-1.5', props.class as string)}\n {...rest}\n >\n {props.children ?? (\n <>\n <ChevronLeft class=\"size-4\" />\n <span class=\"hidden sm:inline\">Previous</span>\n </>\n )}\n </SdkPaginationPrevious>","<ChevronLeft class=\"size-4\" />","class=\"size-4\"","<span class=\"hidden sm:inline\">Previous</span>","<SdkPaginationItem>\n <SdkPaginationNext class={cn(paginationControl, 'pe-1.5', props.class as string)} {...rest}>\n {props.children ?? (\n <>\n <span class=\"hidden sm:inline\">Next</span>\n <ChevronRight class=\"size-4\" />\n </>\n )}\n </SdkPaginationNext>\n </SdkPaginationItem>","<SdkPaginationNext class={cn(paginationControl, 'pe-1.5', props.class as string)} {...rest}>\n {props.children ?? (\n <>\n <span class=\"hidden sm:inline\">Next</span>\n <ChevronRight class=\"size-4\" />\n </>\n )}\n </SdkPaginationNext>","<span class=\"hidden sm:inline\">Next</span>","<ChevronRight class=\"size-4\" />","<SdkPaginationItem>\n <SdkPaginationLink\n class={cn(\n paginationControl,\n 'data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n </SdkPaginationLink>\n </SdkPaginationItem>","<SdkPaginationLink\n class={cn(\n paginationControl,\n 'data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n </SdkPaginationLink>","<SdkPaginationItem>\n <SdkPaginationEllipsis\n class={cn('flex size-control-md items-center justify-center', props.class as string)}\n {...rest}\n >\n {props.children ?? <MoreHorizontal class=\"size-4\" />}\n </SdkPaginationEllipsis>\n </SdkPaginationItem>","<SdkPaginationEllipsis\n class={cn('flex size-control-md items-center justify-center', props.class as string)}\n {...rest}\n >\n {props.children ?? <MoreHorizontal class=\"size-4\" />}\n </SdkPaginationEllipsis>","<MoreHorizontal class=\"size-4\" />","LucideChevronLeft","LucideChevronRight","LucideMoreHorizontal"],"sources":["../../../../src/components/ui/pagination/pagination.tsx"],"sourcesContent":["import {\n Pagination as SdkPagination,\n PaginationEllipsis as SdkPaginationEllipsis,\n PaginationItem as SdkPaginationItem,\n PaginationLink as SdkPaginationLink,\n PaginationList as SdkPaginationList,\n PaginationNext as SdkPaginationNext,\n PaginationPrevious as SdkPaginationPrevious,\n} from '@ui-sdk/solid/pagination'\nimport {\n ChevronLeft as LucideChevronLeft,\n ChevronRight as LucideChevronRight,\n MoreHorizontal as LucideMoreHorizontal,\n} from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { For, Show, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronLeft = fastIcon(LucideChevronLeft)\nconst ChevronRight = fastIcon(LucideChevronRight)\nconst MoreHorizontal = fastIcon(LucideMoreHorizontal)\n\n/**\n * Pagination.\n *\n * Page navigation for a list the server pages, not for a list the client already\n * holds — slicing an array you have is a filter, and it should not spend a round\n * trip.\n *\n * ui-sdk's Pagination computes the visible page window and the ellipsis\n * positions and emits `aria-current=\"page\"`, so the control announces which\n * page is active instead of leaving it to colour alone. At either end the\n * Previous or Next step stays focusable and says it is unavailable with\n * `aria-disabled`, rather than dropping out of the tab order.\n *\n * The item and ellipsis renderers are *supplied here*, not required of the caller.\n * A headless primitive has no opinion about how a page number should look; a\n * design system does, so the only thing a caller has to pass is `count` — while\n * still being able to override either renderer when a view needs to.\n */\nexport type PaginationProps = Omit<\n ComponentProps<typeof SdkPagination>,\n | 'pageCount'\n | 'siblings'\n | 'boundaries'\n | 'onPageChange'\n | 'onChange'\n | 'children'\n | 'total'\n | 'pageSize'\n> & {\n /** How many pages there are. */\n count: number\n /** Called with the new page, from 1. */\n onPageChange?: (page: number) => void\n /** How many pages show on each side of the current one; 1 by default. */\n siblingCount?: number\n /** Whether the first page always shows; with `showLast`, both default to true. */\n showFirst?: boolean\n /** Whether the last page always shows. */\n showLast?: boolean\n /** Draws one page of the run; `PaginationItem` by default. */\n itemComponent?: (props: { page: number }) => JSX.Element\n /** Draws one gap in the run; `PaginationEllipsis` by default. */\n ellipsisComponent?: () => JSX.Element\n class?: string\n /** Replaces Previous, the page run and Next, inside the list. */\n children?: JSX.Element\n}\n\nconst paginationControl = cn(\n 'inline-flex h-control-md min-w-(--control-height-md) items-center justify-center gap-1 rounded-md border border-transparent px-2 text-sm tabular-nums',\n 'transition-colors ease-out outline-none select-none',\n 'hover:bg-surface-hover',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n // A step at its end is `aria-disabled` and stays focusable, so it never\n // matches `:disabled`; it takes the same look from `data-disabled`.\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:size-4'\n)\n\nexport function Pagination(props: PaginationProps) {\n const rest = omit(\n props,\n 'class',\n 'itemComponent',\n 'ellipsisComponent',\n 'children',\n 'count',\n 'onPageChange',\n 'siblingCount',\n 'showFirst',\n 'showLast'\n )\n\n return (\n <SdkPagination\n aria-label=\"Pagination\"\n pageCount={props.count}\n siblings={props.siblingCount ?? 1}\n // ui-sdk shows the same number of pages at both ends; hiding only one\n // end is not something it draws, so either flag keeps a boundary page.\n boundaries={props.showFirst === false && props.showLast === false ? 0 : 1}\n onPageChange={(page) => props.onPageChange?.(page)}\n // The root is a `<nav>` wrapping a `<ul>`, and every control — previous,\n // the page run, next — is an `<li>` inside that list. The row has to be\n // declared on the list: on the `<nav>` alone it lays out one child and\n // the controls stack vertically.\n class={cn(\n 'flex w-full items-center justify-center [&>ul]:m-0 [&>ul]:flex [&>ul]:list-none [&>ul]:items-center [&>ul]:gap-1 [&>ul]:p-0',\n props.class\n )}\n {...rest}\n >\n <SdkPaginationList>\n {(state) => (\n <Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n )}\n </SdkPaginationList>\n </SdkPagination>\n )\n\n /** Previous, the numbered run, next: the arrangement every list view wants. */\n function DefaultPaginationControls(state: { items: readonly (number | string)[] }) {\n return (\n <>\n <PaginationPrevious />\n <For each={state.items}>\n {(item) =>\n typeof item === 'number'\n ? (props.itemComponent ?? defaultItem)({ page: item })\n : (props.ellipsisComponent ?? defaultEllipsis)()\n }\n </For>\n <PaginationNext />\n </>\n )\n }\n}\n\nconst defaultItem = (itemProps: { page: number }) => (\n <PaginationItem page={itemProps.page}>{itemProps.page}</PaginationItem>\n)\nconst defaultEllipsis = () => <PaginationEllipsis />\n\ntype StepProps = ComponentProps<typeof SdkPaginationPrevious>\n\nexport function PaginationPrevious(props: StepProps) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationPrevious\n class={cn(paginationControl, 'ps-1.5', props.class as string)}\n {...rest}\n >\n {props.children ?? (\n <>\n <ChevronLeft class=\"size-4\" />\n <span class=\"hidden sm:inline\">Previous</span>\n </>\n )}\n </SdkPaginationPrevious>\n </SdkPaginationItem>\n )\n}\n\nexport function PaginationNext(props: StepProps) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationNext class={cn(paginationControl, 'pe-1.5', props.class as string)} {...rest}>\n {props.children ?? (\n <>\n <span class=\"hidden sm:inline\">Next</span>\n <ChevronRight class=\"size-4\" />\n </>\n )}\n </SdkPaginationNext>\n </SdkPaginationItem>\n )\n}\n\n/** One page of the run: a list item holding the page's button (or link, with `getHref`). */\nexport function PaginationItem(props: ComponentProps<typeof SdkPaginationLink>) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationLink\n class={cn(\n paginationControl,\n 'data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n </SdkPaginationLink>\n </SdkPaginationItem>\n )\n}\n\n/** A gap in the run. Hidden from screen readers, which hear the page numbers around it. */\nexport function PaginationEllipsis(\n props: ComponentProps<typeof SdkPaginationEllipsis> & { children?: JSX.Element }\n) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationEllipsis\n class={cn('flex size-control-md items-center justify-center', props.class as string)}\n {...rest}\n >\n {props.children ?? <MoreHorizontal class=\"size-4\" />}\n </SdkPaginationEllipsis>\n </SdkPaginationItem>\n )\n}\n"],"mappings":";;;;;;;;;AAoBA,IAAM,cAAc,SAASyB,aAAiB;AAC9C,IAAM,eAAe,SAASC,cAAkB;AAChD,IAAM,iBAAiB,SAASC,gBAAoB;AAkDpD,IAAM,oBAAoB,GACxB,yJACA,uDACA,0BACA,oFACA,oDAGA,kEACA,4CACF;AAEA,SAAgB,WAAW,OAAwB;CACjD,MAAM,OAAO,KACX,OACA,SACA,iBACA,qBACA,YACA,SACA,gBACA,gBACA,aACA,UACF;CAEA,OACE3B,gBAAAA,cAAAA,WAAAA;EACE,cAAW;EACX,IAAA,YAAA;GAAW,OAAA,MAAM;EAAK;EACtB,IAAA,WAAA;GAAU,OAAA,MAAM,gBAAgB;EAAC;EAGjC,IAAA,aAAA;GAAY,OAAA,MAAM,cAAc,SAAS,MAAM,aAAa,QAAQ,IAAI;EAAC;EACzEC,eAAe,SAAS,MAAM,eAAe,IAAI;EAKjD,IAAA,UAAA;GAAO,OAAA,GACL,+HACA,MAAM,KACR;EAAC;CAUY,GATT,MAhBN,EAAA,IAAA,WAAA;EAkBEC,OAAAA,gBAAAA,gBAAAA,EAAAA,WACI,UACAC,gBAAAA,MAAAA;GAAM,IAAA,OAAA;IAAM,OAAA,MAAM;GAAQ;GAAE,IAAA,WAAA;IAAUC,OAAAA,gBAAAA,2BAAAA,EAA2B,IAAA,QAAA;KAAO,OAAA,MAAM;IAAK,EAAG,CAAA;GAAC;GAAvFD,WACI,iBAAmBE,KAAC,YAAc;EAChC,CAAA,EAES,CAAA;CACN,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AAyC,GACzCC,gBAAAA,cAAAA,EAAcL,OAAM,SAAU,CAAA,CAD/B;EAIc,EAAA,CAAA,CAAA;CACF,EAAA,CAAA;AAEvB;;AAGA,SAAgB,eAAe,OAAiD;CAC9E,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAE5C,OACEM,gBAAAA,kBAAAA,EAAAA,IAAAA,WAAAA;EACEC,OAAAA,gBAAAA,gBAAAA,WAAAA,EACE,IAAA,UAAA;GAAO,OAAA,GACL,mBACA,4FACA,MAAM,KACR;EAAC,EAIgB,GAHb,MANN,EAAA,IAAA,WAAA;GAQG,OAAA,MAAM;EACU,EAAA,CAAA,CAAA;CACF,EAAA,CAAA;AAEvB;;AAGA,SAAgB,mBACd,OACA;CACA,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAE5C,OACEC,gBAAAA,kBAAAA,EAAAA,IAAAA,WAAAA;EACEC,OAAAA,gBAAAA,sBAAAA,WAAAA,EACE,IAAA,UAAA;GAAO,OAAA,GAAG,oDAAoD,MAAM,KAAe;EAAC,EAI/D,GAHjB,MAFN,EAAA,IAAA,WAAA;GAIG,OAAA,MAAM,YAAYC,gBAAAA,gBAAAA,EAAgBV,OAAM,SAAU,CAAA;EAC9B,EAAA,CAAA,CAAA;CACN,EAAA,CAAA;AAEvB"}
1
+ {"version":3,"file":"pagination.js","names":["<SdkPagination\n aria-label=\"Pagination\"\n pageCount={props.count}\n siblings={props.siblingCount ?? 1}\n // ui-sdk shows the same number of pages at both ends; hiding only one\n // end is not something it draws, so either flag keeps a boundary page.\n boundaries={props.showFirst === false && props.showLast === false ? 0 : 1}\n onPageChange={(page) => props.onPageChange?.(page)}\n // The root is a `<nav>` wrapping a `<ul>`, and every control — previous,\n // the page run, next — is an `<li>` inside that list. The row has to be\n // declared on the list: on the `<nav>` alone it lays out one child and\n // the controls stack vertically.\n class={cn(\n 'flex w-full items-center justify-center [&>ul]:m-0 [&>ul]:flex [&>ul]:list-none [&>ul]:items-center [&>ul]:gap-1 [&>ul]:p-0',\n props.class\n )}\n {...rest}\n >\n <SdkPaginationList>\n {(state) => (\n <Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n )}\n </SdkPaginationList>\n </SdkPagination>","onPageChange={(page) => props.onPageChange?.(page)}","<SdkPaginationList>\n {(state) => (\n <Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n )}\n </SdkPaginationList>","<Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>","<DefaultPaginationControls items={state.items} />","{childrenSlot()}","<PaginationPrevious />","<For each={state.items}>\n {(item) =>\n typeof item === 'number'\n ? (props.itemComponent ?? defaultItem)({ page: item })\n : (props.ellipsisComponent ?? defaultEllipsis)()\n }\n </For>","<PaginationNext />","<PaginationItem page={itemProps.page}>{itemProps.page}</PaginationItem>","<PaginationEllipsis />","<SdkPaginationItem>\n <SdkPaginationPrevious\n class={cn(paginationControl, 'ps-1.5', props.class as string)}\n {...rest}\n >\n {props.children ?? (\n <>\n <ChevronLeft class=\"size-4\" />\n <span class=\"hidden sm:inline\">Previous</span>\n </>\n )}\n </SdkPaginationPrevious>\n </SdkPaginationItem>","<SdkPaginationPrevious\n class={cn(paginationControl, 'ps-1.5', props.class as string)}\n {...rest}\n >\n {props.children ?? (\n <>\n <ChevronLeft class=\"size-4\" />\n <span class=\"hidden sm:inline\">Previous</span>\n </>\n )}\n </SdkPaginationPrevious>","<ChevronLeft class=\"size-4\" />","class=\"size-4\"","<span class=\"hidden sm:inline\">Previous</span>","<SdkPaginationItem>\n <SdkPaginationNext class={cn(paginationControl, 'pe-1.5', props.class as string)} {...rest}>\n {props.children ?? (\n <>\n <span class=\"hidden sm:inline\">Next</span>\n <ChevronRight class=\"size-4\" />\n </>\n )}\n </SdkPaginationNext>\n </SdkPaginationItem>","<SdkPaginationNext class={cn(paginationControl, 'pe-1.5', props.class as string)} {...rest}>\n {props.children ?? (\n <>\n <span class=\"hidden sm:inline\">Next</span>\n <ChevronRight class=\"size-4\" />\n </>\n )}\n </SdkPaginationNext>","<span class=\"hidden sm:inline\">Next</span>","<ChevronRight class=\"size-4\" />","<SdkPaginationItem>\n <SdkPaginationLink\n class={cn(\n paginationControl,\n 'data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n </SdkPaginationLink>\n </SdkPaginationItem>","<SdkPaginationLink\n class={cn(\n paginationControl,\n 'data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n </SdkPaginationLink>","<SdkPaginationItem>\n <SdkPaginationEllipsis\n class={cn('flex size-control-md items-center justify-center', props.class as string)}\n {...rest}\n >\n {props.children ?? <MoreHorizontal class=\"size-4\" />}\n </SdkPaginationEllipsis>\n </SdkPaginationItem>","<SdkPaginationEllipsis\n class={cn('flex size-control-md items-center justify-center', props.class as string)}\n {...rest}\n >\n {props.children ?? <MoreHorizontal class=\"size-4\" />}\n </SdkPaginationEllipsis>","<MoreHorizontal class=\"size-4\" />","LucideChevronLeft","LucideChevronRight","LucideMoreHorizontal"],"sources":["../../../../src/components/ui/pagination/pagination.tsx"],"sourcesContent":["import {\n Pagination as SdkPagination,\n PaginationEllipsis as SdkPaginationEllipsis,\n PaginationItem as SdkPaginationItem,\n PaginationLink as SdkPaginationLink,\n PaginationList as SdkPaginationList,\n PaginationNext as SdkPaginationNext,\n PaginationPrevious as SdkPaginationPrevious,\n} from '@ui-sdk/solid/pagination'\nimport {\n ChevronLeft as LucideChevronLeft,\n ChevronRight as LucideChevronRight,\n MoreHorizontal as LucideMoreHorizontal,\n} from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport { For, Show, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronLeft = fastIcon(LucideChevronLeft)\nconst ChevronRight = fastIcon(LucideChevronRight)\nconst MoreHorizontal = fastIcon(LucideMoreHorizontal)\n\n/**\n * Pagination.\n *\n * Page navigation for a list the server pages, not for a list the client already\n * holds — slicing an array you have is a filter, and it should not spend a round\n * trip.\n *\n * ui-sdk's Pagination computes the visible page window and the ellipsis\n * positions and emits `aria-current=\"page\"`, so the control announces which\n * page is active instead of leaving it to colour alone. At either end the\n * Previous or Next step stays focusable and says it is unavailable with\n * `aria-disabled`, rather than dropping out of the tab order.\n *\n * The item and ellipsis renderers are *supplied here*, not required of the caller.\n * A headless primitive has no opinion about how a page number should look; a\n * design system does, so the only thing a caller has to pass is `count` — while\n * still being able to override either renderer when a view needs to.\n */\nexport type PaginationProps = Omit<\n ComponentProps<typeof SdkPagination>,\n | 'pageCount'\n | 'siblings'\n | 'boundaries'\n | 'onPageChange'\n | 'onChange'\n | 'children'\n | 'total'\n | 'pageSize'\n> & {\n /** How many pages there are. */\n count: number\n /** Called with the new page, from 1. */\n onPageChange?: (page: number) => void\n /** How many pages show on each side of the current one; 1 by default. */\n siblingCount?: number\n /** Whether the first page always shows; with `showLast`, both default to true. */\n showFirst?: boolean\n /** Whether the last page always shows. */\n showLast?: boolean\n /** Draws one page of the run; `PaginationItem` by default. */\n itemComponent?: (props: { page: number }) => JSX.Element\n /** Draws one gap in the run; `PaginationEllipsis` by default. */\n ellipsisComponent?: () => JSX.Element\n class?: string\n /** Replaces Previous, the page run and Next, inside the list. */\n children?: JSX.Element\n}\n\nconst paginationControl = cn(\n 'inline-flex h-control-md min-w-(--control-height-md) items-center justify-center gap-1 rounded-md border border-transparent px-2 text-sm tabular-nums',\n 'transition-colors ease-out outline-none select-none',\n 'hover:bg-surface-hover',\n 'focus-visible:border-ring focus-visible:focus-outline',\n 'disabled:pointer-events-none disabled:opacity-50',\n // A step at its end is `aria-disabled` and stays focusable, so it never\n // matches `:disabled`; it takes the same look from `data-disabled`.\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n '[&_svg]:pointer-events-none [&_svg]:size-4'\n)\n\nexport function Pagination(props: PaginationProps) {\n const rest = omit(\n props,\n 'class',\n 'itemComponent',\n 'ellipsisComponent',\n 'children',\n 'count',\n 'onPageChange',\n 'siblingCount',\n 'showFirst',\n 'showLast'\n )\n\n return (\n <SdkPagination\n aria-label=\"Pagination\"\n pageCount={props.count}\n siblings={props.siblingCount ?? 1}\n // ui-sdk shows the same number of pages at both ends; hiding only one\n // end is not something it draws, so either flag keeps a boundary page.\n boundaries={props.showFirst === false && props.showLast === false ? 0 : 1}\n onPageChange={(page) => props.onPageChange?.(page)}\n // The root is a `<nav>` wrapping a `<ul>`, and every control — previous,\n // the page run, next — is an `<li>` inside that list. The row has to be\n // declared on the list: on the `<nav>` alone it lays out one child and\n // the controls stack vertically.\n class={cn(\n 'flex w-full items-center justify-center [&>ul]:m-0 [&>ul]:flex [&>ul]:list-none [&>ul]:items-center [&>ul]:gap-1 [&>ul]:p-0',\n props.class\n )}\n {...rest}\n >\n <SdkPaginationList>\n {(state) => (\n <Show when={props.children} fallback={<DefaultPaginationControls items={state.items} />}>\n {(childrenSlot) => <>{childrenSlot()}</>}\n </Show>\n )}\n </SdkPaginationList>\n </SdkPagination>\n )\n\n /** Previous, the numbered run, next: the arrangement every list view wants. */\n function DefaultPaginationControls(state: { items: readonly (number | string)[] }) {\n return (\n <>\n <PaginationPrevious />\n <For each={state.items}>\n {(item) =>\n typeof item === 'number'\n ? (props.itemComponent ?? defaultItem)({ page: item })\n : (props.ellipsisComponent ?? defaultEllipsis)()\n }\n </For>\n <PaginationNext />\n </>\n )\n }\n}\n\nconst defaultItem = (itemProps: { page: number }) => (\n <PaginationItem page={itemProps.page}>{itemProps.page}</PaginationItem>\n)\nconst defaultEllipsis = () => <PaginationEllipsis />\n\ntype StepProps = ComponentProps<typeof SdkPaginationPrevious>\n\nexport function PaginationPrevious(props: StepProps) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationPrevious\n class={cn(paginationControl, 'ps-1.5', props.class as string)}\n {...rest}\n >\n {props.children ?? (\n <>\n <ChevronLeft class=\"size-4\" />\n <span class=\"hidden sm:inline\">Previous</span>\n </>\n )}\n </SdkPaginationPrevious>\n </SdkPaginationItem>\n )\n}\n\nexport function PaginationNext(props: StepProps) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationNext class={cn(paginationControl, 'pe-1.5', props.class as string)} {...rest}>\n {props.children ?? (\n <>\n <span class=\"hidden sm:inline\">Next</span>\n <ChevronRight class=\"size-4\" />\n </>\n )}\n </SdkPaginationNext>\n </SdkPaginationItem>\n )\n}\n\n/** One page of the run: a list item holding the page's button (or link, with `getHref`). */\nexport function PaginationItem(props: ComponentProps<typeof SdkPaginationLink>) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationLink\n class={cn(\n paginationControl,\n 'data-[current]:border-border data-[current]:bg-surface-active data-[current]:font-medium',\n props.class as string\n )}\n {...rest}\n >\n {props.children}\n </SdkPaginationLink>\n </SdkPaginationItem>\n )\n}\n\n/** A gap in the run. Hidden from screen readers, which hear the page numbers around it. */\nexport function PaginationEllipsis(\n props: ComponentProps<typeof SdkPaginationEllipsis> & { children?: JSX.Element }\n) {\n const rest = omit(props, 'class', 'children')\n\n return (\n <SdkPaginationItem>\n <SdkPaginationEllipsis\n class={cn('flex size-control-md items-center justify-center', props.class as string)}\n {...rest}\n >\n {props.children ?? <MoreHorizontal class=\"size-4\" />}\n </SdkPaginationEllipsis>\n </SdkPaginationItem>\n )\n}\n"],"mappings":";;;;;;;;;AAoBA,IAAM,cAAc,SAASyB,aAAiB;AAC9C,IAAM,eAAe,SAASC,cAAkB;AAChD,IAAM,iBAAiB,SAASC,gBAAoB;AAkDpD,IAAM,oBAAoB,GACxB,yJACA,uDACA,0BACA,yDACA,oDAGA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AAO,SAAS,UAAU;CAE5C,OACEC,gBAAAA,kBAAAA,EAAAA,IAAAA,WAAAA;EACEC,OAAAA,gBAAAA,sBAAAA,WAAAA,EACE,IAAA,UAAA;GAAO,OAAA,GAAG,oDAAoD,MAAM,KAAe;EAAC,EAI/D,GAHjB,MAFN,EAAA,IAAA,WAAA;GAIG,OAAA,MAAM,YAAYC,gBAAAA,gBAAAA,EAAgBV,OAAM,SAAU,CAAA;EAC9B,EAAA,CAAA,CAAA;CACN,EAAA,CAAA;AAEvB"}
@@ -126,7 +126,7 @@ function Questionnaire(props) {
126
126
  },
127
127
  tabindex: "-1",
128
128
  get "class"() {
129
- return cn("flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle", {
129
+ return cn("flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4 outline-none focus-visible:focus-outline", {
130
130
  "border-border": settled(),
131
131
  "border-ring": !settled()
132
132
  }, local.class);
@@ -1 +1 @@
1
- {"version":3,"file":"questionnaire.js","names":["tabindex=\"-1\"","onFocusIn={() => (focusWithin = true)}","onFocusOut={(event) => {\n // Moving to another element ends it; a control disappearing does not.\n const next = event.relatedTarget\n if (next instanceof Node && !event.currentTarget.contains(next)) focusWithin = false\n }}","ref={(element) => (root = element)}","<Clock />","<CircleHelp />","<Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>","<Check aria-hidden=\"true\" class=\"size-3.5\" />","class=\"size-3.5\"","<span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>","<header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={status() === 'expired'} fallback={<CircleHelp />}>\n <Clock />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"m-0 text-sm font-semibold\">{local.title ?? 'The agent has a question'}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={status() === 'answered'}>\n <span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>\n </Show>\n <Show when={status() === 'expired'}>\n <span class=\"text-xs text-muted-foreground\">No longer waiting</span>\n </Show>\n </header>","<span class=\"text-xs text-muted-foreground\">No longer waiting</span>","<Show when={current()} keyed>\n {(question) => (\n <fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>\n )}\n </Show>","<span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>","<legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>","ref={(element) => (questionHeading = element)}","<Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>","<For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>","<Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />","onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}","<RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>","onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }","<For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>","<RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />","variant=\"card\"","<fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>","<Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />","rows={2}","onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }","<Show when={submitReason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>\n </Show>","<p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>","<Show when={local.error}>\n {(errorSlot) => (\n <p role=\"alert\" class=\"m-0 text-xs text-destructive\">\n {errorSlot()}\n </p>\n )}\n </Show>","<Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>","type=\"button\"","variant=\"ghost\"","size=\"sm\"","onClick={() => setStep((value) => Math.max(0, value - 1))}","<span />","<footer class=\"flex items-center justify-between gap-2\">\n <Show when={count() > 1} fallback={<span />}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>\n </Show>\n <Show\n when={last()}\n fallback={\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>\n </Show>\n </footer>","<Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>","onClick={() => void submit()}","<Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>","<LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />","class=\"motion-safe:animate-spin\"","local.submitLabel ?? 'Send answer'","<Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>","onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}","<For each={summary()}>\n {(entry) => (\n <div class=\"flex flex-col gap-0.5\">\n <dt class=\"text-xs text-muted-foreground\">{entry.question.prompt}</dt>\n <dd class=\"m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap\">\n {entry.parts.length > 0 ? entry.parts.join(', ') : 'Skipped'}\n </dd>\n </div>\n )}\n </For>","<section\n ref={(element) => (root = element)}\n data-slot=\"questionnaire\"\n data-status={status()}\n aria-label={local.title ?? 'Question from the agent'}\n // Not a tab stop: only the landing place for focus when a control goes away.\n tabindex=\"-1\"\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n 'border-border': settled(),\n 'border-ring': !settled(),\n },\n local.class\n )}\n onKeyDown={onKeyDown}\n onFocusIn={() => (focusWithin = true)}\n onFocusOut={(event) => {\n // Moving to another element ends it; a control disappearing does not.\n const next = event.relatedTarget\n if (next instanceof Node && !event.currentTarget.contains(next)) focusWithin = false\n }}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={status() === 'expired'} fallback={<CircleHelp />}>\n <Clock />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"m-0 text-sm font-semibold\">{local.title ?? 'The agent has a question'}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={status() === 'answered'}>\n <span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>\n </Show>\n <Show when={status() === 'expired'}>\n <span class=\"text-xs text-muted-foreground\">No longer waiting</span>\n </Show>\n </header>\n\n <Show\n when={!settled()}\n fallback={\n <dl class=\"m-0 flex flex-col gap-2\">\n <For each={summary()}>\n {(entry) => (\n <div class=\"flex flex-col gap-0.5\">\n <dt class=\"text-xs text-muted-foreground\">{entry.question.prompt}</dt>\n <dd class=\"m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap\">\n {entry.parts.length > 0 ? entry.parts.join(', ') : 'Skipped'}\n </dd>\n </div>\n )}\n </For>\n </dl>\n }\n >\n <Show when={current()} keyed>\n {(question) => (\n <fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>\n )}\n </Show>\n\n <Show when={submitReason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>\n </Show>\n <Show when={local.error}>\n {(errorSlot) => (\n <p role=\"alert\" class=\"m-0 text-xs text-destructive\">\n {errorSlot()}\n </p>\n )}\n </Show>\n\n <footer class=\"flex items-center justify-between gap-2\">\n <Show when={count() > 1} fallback={<span />}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>\n </Show>\n <Show\n when={last()}\n fallback={\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>\n </Show>\n </footer>\n </Show>\n </section>","LucideCheck","LucideCircleHelp","LucideClock","LucideLoaderCircle","_$spread","_$ref","_$insert","_$effect","_$setAttribute"],"sources":["../../../../src/components/ui/questionnaire/questionnaire.tsx"],"sourcesContent":["import {\n Check as LucideCheck,\n CircleHelp as LucideCircleHelp,\n Clock as LucideClock,\n LoaderCircle as LucideLoaderCircle,\n} from '@lucide/solid'\nimport { createEffect, createMemo, createSignal, createUniqueId, For, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\nimport { Checkbox } from '../checkbox'\nimport { RadioGroup, RadioGroupItem } from '../radio-group'\nimport { Textarea } from '../textarea'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst CircleHelp = fastIcon(LucideCircleHelp)\nconst Clock = fastIcon(LucideClock)\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\n\n/**\n * Questionnaire.\n *\n * The agent has stopped and is asking the person something before it continues.\n * This is the one place in a transcript where the reader *must* act, so it is\n * the one element allowed to look like a card — and it only ever asks what the\n * runtime actually asked.\n *\n * ## What it models\n *\n * One question or several. Each has a prompt and, optionally, a closed set of\n * options (single choice, or `multiple`) and/or a free-text answer. A question\n * with only a prompt is a text box; the runtime contract that exists today is\n * exactly that. Options are shown only when the producer supplied them, which is\n * why they are data here and not something this component can invent.\n *\n * Several questions are asked one at a time, with \"Question 2 of 3\" and Back /\n * Next, because a wall of unrelated fields is how a person answers none of them\n * well. Moving between them returns focus to the question, so a screen-reader\n * user hears what they are now answering.\n *\n * ## It does not decide whether you may answer\n *\n * `status` and `disabledReason` come from the host, which owns authority (is\n * this session connected, is the generation current, does this client have the\n * input). A disabled questionnaire says *why* in words next to the button.\n * `answered` and `expired` render the exchange read-only, so a settled question\n * stays in the record as what was asked and what was answered.\n *\n * Submit is `Cmd/Ctrl+Enter` from any text field; plain Enter stays a newline.\n */\nexport type QuestionnaireOption = Readonly<{\n id: string\n label: string\n description?: string\n}>\n\nexport type QuestionnaireQuestion = Readonly<{\n id: string\n prompt: string\n description?: string\n options?: readonly QuestionnaireOption[]\n /** Allow more than one option. */\n multiple?: boolean\n /** Offer a free-text answer (always present when there are no options). */\n allowText?: boolean\n textLabel?: string\n textPlaceholder?: string\n /** The question may be skipped. */\n optional?: boolean\n}>\n\nexport type QuestionnaireAnswer = Readonly<{ optionIds: readonly string[]; text: string }>\nexport type QuestionnaireAnswers = Readonly<Record<string, QuestionnaireAnswer>>\nexport type QuestionnaireStatus = 'open' | 'submitting' | 'answered' | 'expired'\n\nconst EMPTY: QuestionnaireAnswer = { optionIds: [], text: '' }\n\n/**\n * The answer a record holds for a question. Question ids are host strings, and\n * the record is an ordinary object, so `constructor`, `toString` and `__proto__`\n * are valid ids that a plain index would resolve to inherited values and a\n * summary or a validity check would then read `optionIds` from.\n */\nexport function answerFor(\n record: QuestionnaireAnswers,\n question: Pick<QuestionnaireQuestion, 'id'>\n): QuestionnaireAnswer | undefined {\n return Object.hasOwn(record, question.id) ? record[question.id] : undefined\n}\n\n/** Whether a question has what it needs. */\nexport function isQuestionAnswered(\n question: QuestionnaireQuestion,\n answer: QuestionnaireAnswer | undefined\n): boolean {\n if (question.optional) return true\n return (answer?.optionIds.length ?? 0) > 0 || (answer?.text.trim().length ?? 0) > 0\n}\n\nexport type QuestionnaireProps = Omit<ComponentProps<'section'>, 'onSubmit' | 'title'> & {\n questions: readonly QuestionnaireQuestion[]\n title?: string\n description?: string\n status?: QuestionnaireStatus\n answers?: QuestionnaireAnswers\n defaultAnswers?: QuestionnaireAnswers\n onAnswersChange?: (answers: QuestionnaireAnswers) => void\n onSubmit?: (answers: QuestionnaireAnswers) => void | Promise<void>\n /** Why answering is not possible right now; shown beside the button. */\n disabledReason?: string\n /** A failed submit, in words. */\n error?: string\n submitLabel?: string\n}\n\nexport function Questionnaire(props: QuestionnaireProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'questions',\n 'title',\n 'description',\n 'status',\n 'answers',\n 'defaultAnswers',\n 'onAnswersChange',\n 'onSubmit',\n 'disabledReason',\n 'error',\n 'submitLabel'\n )\n const uid = createUniqueId()\n const [internal, setInternal] = createSignal<QuestionnaireAnswers>(\n () => local.defaultAnswers ?? {}\n )\n const [step, setStep] = createSignal(0)\n const answers = () => local.answers ?? internal()\n const status = () => local.status ?? 'open'\n const settled = () => status() === 'answered' || status() === 'expired'\n const hostDisabledReason = () => (local.disabledReason?.trim() ? local.disabledReason : undefined)\n const locked = () => status() !== 'open' || hostDisabledReason() !== undefined\n const count = () => local.questions.length\n const current = () => local.questions[Math.min(step(), count() - 1)]\n const last = () => step() >= count() - 1\n const reasonId = `${uid}-reason`\n const submitReason = () =>\n hostDisabledReason() ??\n (status() === 'open' && last() && local.onSubmit === undefined\n ? 'Sending answers is not available here.'\n : undefined)\n let questionHeading: HTMLHeadingElement | undefined\n\n const answerOf = (question: QuestionnaireQuestion) => answerFor(answers(), question) ?? EMPTY\n const change = (question: QuestionnaireQuestion, next: QuestionnaireAnswer) => {\n const value = { ...answers(), [question.id]: next }\n if (local.answers === undefined) setInternal(value)\n local.onAnswersChange?.(value)\n }\n\n const canAdvance = () => {\n const question = current()\n return question !== undefined && isQuestionAnswered(question, answerFor(answers(), question))\n }\n const canSubmit = () =>\n local.questions.every((question) =>\n isQuestionAnswered(question, answerFor(answers(), question))\n )\n\n // A host that is slow to report `submitting` must not be handed the same answer\n // twice by a second Ctrl+Enter or a double click.\n let sending = false\n const submit = async () => {\n if (sending || locked() || !canSubmit() || local.onSubmit === undefined) return\n sending = true\n try {\n await local.onSubmit?.(answers())\n } finally {\n sending = false\n }\n }\n\n // The control that had focus is removed when the exchange settles into its\n // read-only record. Give focus to the record instead of dropping it on <body>,\n // but only if it was inside this questionnaire to begin with.\n let root: HTMLElement | undefined\n let focusWithin = false\n // Memoised, so open -> submitting (both unsettled) does not re-run the effect.\n const isSettled = createMemo(settled)\n createEffect(\n isSettled,\n (done) => {\n if (done && focusWithin && document.activeElement === document.body) {\n root?.focus({ preventScroll: true })\n }\n focusWithin = false\n },\n { defer: true }\n )\n\n // Land on the new question when the step changes, not on the Next button that\n // has just been replaced by one for a different question.\n createEffect(\n step,\n () => {\n questionHeading?.focus()\n },\n { defer: true }\n )\n\n const onKeyDown: JSX.EventHandler<HTMLElement, KeyboardEvent> = (event) => {\n if (event.key === 'Enter' && (event.metaKey || event.ctrlKey) && last()) {\n event.preventDefault()\n void submit()\n }\n }\n\n const summary = createMemo(() =>\n local.questions.map((question) => {\n const answer = answerFor(answers(), question) ?? EMPTY\n const chosen = (question.options ?? [])\n .filter((option) => answer.optionIds.includes(option.id))\n .map((option) => option.label)\n return {\n question,\n parts: [...chosen, ...(answer.text.trim() ? [answer.text.trim()] : [])],\n }\n })\n )\n\n return (\n <section\n ref={(element) => (root = element)}\n data-slot=\"questionnaire\"\n data-status={status()}\n aria-label={local.title ?? 'Question from the agent'}\n // Not a tab stop: only the landing place for focus when a control goes away.\n tabindex=\"-1\"\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n 'border-border': settled(),\n 'border-ring': !settled(),\n },\n local.class\n )}\n onKeyDown={onKeyDown}\n onFocusIn={() => (focusWithin = true)}\n onFocusOut={(event) => {\n // Moving to another element ends it; a control disappearing does not.\n const next = event.relatedTarget\n if (next instanceof Node && !event.currentTarget.contains(next)) focusWithin = false\n }}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={status() === 'expired'} fallback={<CircleHelp />}>\n <Clock />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"m-0 text-sm font-semibold\">{local.title ?? 'The agent has a question'}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={status() === 'answered'}>\n <span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>\n </Show>\n <Show when={status() === 'expired'}>\n <span class=\"text-xs text-muted-foreground\">No longer waiting</span>\n </Show>\n </header>\n\n <Show\n when={!settled()}\n fallback={\n <dl class=\"m-0 flex flex-col gap-2\">\n <For each={summary()}>\n {(entry) => (\n <div class=\"flex flex-col gap-0.5\">\n <dt class=\"text-xs text-muted-foreground\">{entry.question.prompt}</dt>\n <dd class=\"m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap\">\n {entry.parts.length > 0 ? entry.parts.join(', ') : 'Skipped'}\n </dd>\n </div>\n )}\n </For>\n </dl>\n }\n >\n <Show when={current()} keyed>\n {(question) => (\n <fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>\n )}\n </Show>\n\n <Show when={submitReason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>\n </Show>\n <Show when={local.error}>\n {(errorSlot) => (\n <p role=\"alert\" class=\"m-0 text-xs text-destructive\">\n {errorSlot()}\n </p>\n )}\n </Show>\n\n <footer class=\"flex items-center justify-between gap-2\">\n <Show when={count() > 1} fallback={<span />}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>\n </Show>\n <Show\n when={last()}\n fallback={\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>\n </Show>\n </footer>\n </Show>\n </section>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAM,QAAQ,SAASiD,OAAW;AAClC,IAAM,aAAa,SAASC,YAAgB;AAC5C,IAAM,QAAQ,SAASC,OAAW;AAClC,IAAM,eAAe,SAASC,cAAkB;AA0DhD,IAAM,QAA6B;CAAE,WAAW,CAAC;CAAG,MAAM;AAAG;;;;;;;AAQ7D,SAAgB,UACd,QACA,UACiC;CACjC,OAAO,OAAO,OAAO,QAAQ,SAAS,EAAE,IAA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A,CAAD,GAtNR,IAuNS;CAxNX,OACEP;AAyNJ"}
1
+ {"version":3,"file":"questionnaire.js","names":["tabindex=\"-1\"","onFocusIn={() => (focusWithin = true)}","onFocusOut={(event) => {\n // Moving to another element ends it; a control disappearing does not.\n const next = event.relatedTarget\n if (next instanceof Node && !event.currentTarget.contains(next)) focusWithin = false\n }}","ref={(element) => (root = element)}","<Clock />","<CircleHelp />","<Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>","<Check aria-hidden=\"true\" class=\"size-3.5\" />","class=\"size-3.5\"","<span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>","<header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={status() === 'expired'} fallback={<CircleHelp />}>\n <Clock />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"m-0 text-sm font-semibold\">{local.title ?? 'The agent has a question'}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={status() === 'answered'}>\n <span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>\n </Show>\n <Show when={status() === 'expired'}>\n <span class=\"text-xs text-muted-foreground\">No longer waiting</span>\n </Show>\n </header>","<span class=\"text-xs text-muted-foreground\">No longer waiting</span>","<Show when={current()} keyed>\n {(question) => (\n <fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>\n )}\n </Show>","<span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>","<legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>","ref={(element) => (questionHeading = element)}","<Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>","<For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>","<Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />","onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}","<RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>","onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }","<For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>","<RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />","variant=\"card\"","<fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>","<Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />","rows={2}","onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }","<Show when={submitReason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>\n </Show>","<p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>","<Show when={local.error}>\n {(errorSlot) => (\n <p role=\"alert\" class=\"m-0 text-xs text-destructive\">\n {errorSlot()}\n </p>\n )}\n </Show>","<Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>","type=\"button\"","variant=\"ghost\"","size=\"sm\"","onClick={() => setStep((value) => Math.max(0, value - 1))}","<span />","<footer class=\"flex items-center justify-between gap-2\">\n <Show when={count() > 1} fallback={<span />}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>\n </Show>\n <Show\n when={last()}\n fallback={\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>\n </Show>\n </footer>","<Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>","onClick={() => void submit()}","<Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>","<LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />","class=\"motion-safe:animate-spin\"","local.submitLabel ?? 'Send answer'","<Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>","onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}","<For each={summary()}>\n {(entry) => (\n <div class=\"flex flex-col gap-0.5\">\n <dt class=\"text-xs text-muted-foreground\">{entry.question.prompt}</dt>\n <dd class=\"m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap\">\n {entry.parts.length > 0 ? entry.parts.join(', ') : 'Skipped'}\n </dd>\n </div>\n )}\n </For>","<section\n ref={(element) => (root = element)}\n data-slot=\"questionnaire\"\n data-status={status()}\n aria-label={local.title ?? 'Question from the agent'}\n // Not a tab stop: only the landing place for focus when a control goes away.\n tabindex=\"-1\"\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4 outline-none focus-visible:focus-outline',\n {\n 'border-border': settled(),\n 'border-ring': !settled(),\n },\n local.class\n )}\n onKeyDown={onKeyDown}\n onFocusIn={() => (focusWithin = true)}\n onFocusOut={(event) => {\n // Moving to another element ends it; a control disappearing does not.\n const next = event.relatedTarget\n if (next instanceof Node && !event.currentTarget.contains(next)) focusWithin = false\n }}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={status() === 'expired'} fallback={<CircleHelp />}>\n <Clock />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"m-0 text-sm font-semibold\">{local.title ?? 'The agent has a question'}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={status() === 'answered'}>\n <span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>\n </Show>\n <Show when={status() === 'expired'}>\n <span class=\"text-xs text-muted-foreground\">No longer waiting</span>\n </Show>\n </header>\n\n <Show\n when={!settled()}\n fallback={\n <dl class=\"m-0 flex flex-col gap-2\">\n <For each={summary()}>\n {(entry) => (\n <div class=\"flex flex-col gap-0.5\">\n <dt class=\"text-xs text-muted-foreground\">{entry.question.prompt}</dt>\n <dd class=\"m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap\">\n {entry.parts.length > 0 ? entry.parts.join(', ') : 'Skipped'}\n </dd>\n </div>\n )}\n </For>\n </dl>\n }\n >\n <Show when={current()} keyed>\n {(question) => (\n <fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>\n )}\n </Show>\n\n <Show when={submitReason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>\n </Show>\n <Show when={local.error}>\n {(errorSlot) => (\n <p role=\"alert\" class=\"m-0 text-xs text-destructive\">\n {errorSlot()}\n </p>\n )}\n </Show>\n\n <footer class=\"flex items-center justify-between gap-2\">\n <Show when={count() > 1} fallback={<span />}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>\n </Show>\n <Show\n when={last()}\n fallback={\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>\n </Show>\n </footer>\n </Show>\n </section>","LucideCheck","LucideCircleHelp","LucideClock","LucideLoaderCircle","_$spread","_$ref","_$insert","_$effect","_$setAttribute"],"sources":["../../../../src/components/ui/questionnaire/questionnaire.tsx"],"sourcesContent":["import {\n Check as LucideCheck,\n CircleHelp as LucideCircleHelp,\n Clock as LucideClock,\n LoaderCircle as LucideLoaderCircle,\n} from '@lucide/solid'\nimport { createEffect, createMemo, createSignal, createUniqueId, For, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\nimport { Checkbox } from '../checkbox'\nimport { RadioGroup, RadioGroupItem } from '../radio-group'\nimport { Textarea } from '../textarea'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst CircleHelp = fastIcon(LucideCircleHelp)\nconst Clock = fastIcon(LucideClock)\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\n\n/**\n * Questionnaire.\n *\n * The agent has stopped and is asking the person something before it continues.\n * This is the one place in a transcript where the reader *must* act, so it is\n * the one element allowed to look like a card — and it only ever asks what the\n * runtime actually asked.\n *\n * ## What it models\n *\n * One question or several. Each has a prompt and, optionally, a closed set of\n * options (single choice, or `multiple`) and/or a free-text answer. A question\n * with only a prompt is a text box; the runtime contract that exists today is\n * exactly that. Options are shown only when the producer supplied them, which is\n * why they are data here and not something this component can invent.\n *\n * Several questions are asked one at a time, with \"Question 2 of 3\" and Back /\n * Next, because a wall of unrelated fields is how a person answers none of them\n * well. Moving between them returns focus to the question, so a screen-reader\n * user hears what they are now answering.\n *\n * ## It does not decide whether you may answer\n *\n * `status` and `disabledReason` come from the host, which owns authority (is\n * this session connected, is the generation current, does this client have the\n * input). A disabled questionnaire says *why* in words next to the button.\n * `answered` and `expired` render the exchange read-only, so a settled question\n * stays in the record as what was asked and what was answered.\n *\n * Submit is `Cmd/Ctrl+Enter` from any text field; plain Enter stays a newline.\n */\nexport type QuestionnaireOption = Readonly<{\n id: string\n label: string\n description?: string\n}>\n\nexport type QuestionnaireQuestion = Readonly<{\n id: string\n prompt: string\n description?: string\n options?: readonly QuestionnaireOption[]\n /** Allow more than one option. */\n multiple?: boolean\n /** Offer a free-text answer (always present when there are no options). */\n allowText?: boolean\n textLabel?: string\n textPlaceholder?: string\n /** The question may be skipped. */\n optional?: boolean\n}>\n\nexport type QuestionnaireAnswer = Readonly<{ optionIds: readonly string[]; text: string }>\nexport type QuestionnaireAnswers = Readonly<Record<string, QuestionnaireAnswer>>\nexport type QuestionnaireStatus = 'open' | 'submitting' | 'answered' | 'expired'\n\nconst EMPTY: QuestionnaireAnswer = { optionIds: [], text: '' }\n\n/**\n * The answer a record holds for a question. Question ids are host strings, and\n * the record is an ordinary object, so `constructor`, `toString` and `__proto__`\n * are valid ids that a plain index would resolve to inherited values and a\n * summary or a validity check would then read `optionIds` from.\n */\nexport function answerFor(\n record: QuestionnaireAnswers,\n question: Pick<QuestionnaireQuestion, 'id'>\n): QuestionnaireAnswer | undefined {\n return Object.hasOwn(record, question.id) ? record[question.id] : undefined\n}\n\n/** Whether a question has what it needs. */\nexport function isQuestionAnswered(\n question: QuestionnaireQuestion,\n answer: QuestionnaireAnswer | undefined\n): boolean {\n if (question.optional) return true\n return (answer?.optionIds.length ?? 0) > 0 || (answer?.text.trim().length ?? 0) > 0\n}\n\nexport type QuestionnaireProps = Omit<ComponentProps<'section'>, 'onSubmit' | 'title'> & {\n questions: readonly QuestionnaireQuestion[]\n title?: string\n description?: string\n status?: QuestionnaireStatus\n answers?: QuestionnaireAnswers\n defaultAnswers?: QuestionnaireAnswers\n onAnswersChange?: (answers: QuestionnaireAnswers) => void\n onSubmit?: (answers: QuestionnaireAnswers) => void | Promise<void>\n /** Why answering is not possible right now; shown beside the button. */\n disabledReason?: string\n /** A failed submit, in words. */\n error?: string\n submitLabel?: string\n}\n\nexport function Questionnaire(props: QuestionnaireProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'questions',\n 'title',\n 'description',\n 'status',\n 'answers',\n 'defaultAnswers',\n 'onAnswersChange',\n 'onSubmit',\n 'disabledReason',\n 'error',\n 'submitLabel'\n )\n const uid = createUniqueId()\n const [internal, setInternal] = createSignal<QuestionnaireAnswers>(\n () => local.defaultAnswers ?? {}\n )\n const [step, setStep] = createSignal(0)\n const answers = () => local.answers ?? internal()\n const status = () => local.status ?? 'open'\n const settled = () => status() === 'answered' || status() === 'expired'\n const hostDisabledReason = () => (local.disabledReason?.trim() ? local.disabledReason : undefined)\n const locked = () => status() !== 'open' || hostDisabledReason() !== undefined\n const count = () => local.questions.length\n const current = () => local.questions[Math.min(step(), count() - 1)]\n const last = () => step() >= count() - 1\n const reasonId = `${uid}-reason`\n const submitReason = () =>\n hostDisabledReason() ??\n (status() === 'open' && last() && local.onSubmit === undefined\n ? 'Sending answers is not available here.'\n : undefined)\n let questionHeading: HTMLHeadingElement | undefined\n\n const answerOf = (question: QuestionnaireQuestion) => answerFor(answers(), question) ?? EMPTY\n const change = (question: QuestionnaireQuestion, next: QuestionnaireAnswer) => {\n const value = { ...answers(), [question.id]: next }\n if (local.answers === undefined) setInternal(value)\n local.onAnswersChange?.(value)\n }\n\n const canAdvance = () => {\n const question = current()\n return question !== undefined && isQuestionAnswered(question, answerFor(answers(), question))\n }\n const canSubmit = () =>\n local.questions.every((question) =>\n isQuestionAnswered(question, answerFor(answers(), question))\n )\n\n // A host that is slow to report `submitting` must not be handed the same answer\n // twice by a second Ctrl+Enter or a double click.\n let sending = false\n const submit = async () => {\n if (sending || locked() || !canSubmit() || local.onSubmit === undefined) return\n sending = true\n try {\n await local.onSubmit?.(answers())\n } finally {\n sending = false\n }\n }\n\n // The control that had focus is removed when the exchange settles into its\n // read-only record. Give focus to the record instead of dropping it on <body>,\n // but only if it was inside this questionnaire to begin with.\n let root: HTMLElement | undefined\n let focusWithin = false\n // Memoised, so open -> submitting (both unsettled) does not re-run the effect.\n const isSettled = createMemo(settled)\n createEffect(\n isSettled,\n (done) => {\n if (done && focusWithin && document.activeElement === document.body) {\n root?.focus({ preventScroll: true })\n }\n focusWithin = false\n },\n { defer: true }\n )\n\n // Land on the new question when the step changes, not on the Next button that\n // has just been replaced by one for a different question.\n createEffect(\n step,\n () => {\n questionHeading?.focus()\n },\n { defer: true }\n )\n\n const onKeyDown: JSX.EventHandler<HTMLElement, KeyboardEvent> = (event) => {\n if (event.key === 'Enter' && (event.metaKey || event.ctrlKey) && last()) {\n event.preventDefault()\n void submit()\n }\n }\n\n const summary = createMemo(() =>\n local.questions.map((question) => {\n const answer = answerFor(answers(), question) ?? EMPTY\n const chosen = (question.options ?? [])\n .filter((option) => answer.optionIds.includes(option.id))\n .map((option) => option.label)\n return {\n question,\n parts: [...chosen, ...(answer.text.trim() ? [answer.text.trim()] : [])],\n }\n })\n )\n\n return (\n <section\n ref={(element) => (root = element)}\n data-slot=\"questionnaire\"\n data-status={status()}\n aria-label={local.title ?? 'Question from the agent'}\n // Not a tab stop: only the landing place for focus when a control goes away.\n tabindex=\"-1\"\n class={cn(\n 'flex w-full max-w-xl min-w-0 flex-col gap-3 rounded-xl border bg-card p-4 outline-none focus-visible:focus-outline',\n {\n 'border-border': settled(),\n 'border-ring': !settled(),\n },\n local.class\n )}\n onKeyDown={onKeyDown}\n onFocusIn={() => (focusWithin = true)}\n onFocusOut={(event) => {\n // Moving to another element ends it; a control disappearing does not.\n const next = event.relatedTarget\n if (next instanceof Node && !event.currentTarget.contains(next)) focusWithin = false\n }}\n {...rest}\n >\n <header class=\"flex items-start gap-2.5\">\n <span aria-hidden=\"true\" class=\"mt-0.5 text-muted-foreground [&_svg]:size-4\">\n <Show when={status() === 'expired'} fallback={<CircleHelp />}>\n <Clock />\n </Show>\n </span>\n <div class=\"min-w-0 flex-1\">\n <h3 class=\"m-0 text-sm font-semibold\">{local.title ?? 'The agent has a question'}</h3>\n <Show when={local.description}>\n {(descriptionSlot) => (\n <p class=\"m-0 mt-0.5 text-xs text-muted-foreground\">{descriptionSlot()}</p>\n )}\n </Show>\n </div>\n <Show when={status() === 'answered'}>\n <span class=\"flex items-center gap-1 text-xs text-muted-foreground\">\n <Check aria-hidden=\"true\" class=\"size-3.5\" />\n Answered\n </span>\n </Show>\n <Show when={status() === 'expired'}>\n <span class=\"text-xs text-muted-foreground\">No longer waiting</span>\n </Show>\n </header>\n\n <Show\n when={!settled()}\n fallback={\n <dl class=\"m-0 flex flex-col gap-2\">\n <For each={summary()}>\n {(entry) => (\n <div class=\"flex flex-col gap-0.5\">\n <dt class=\"text-xs text-muted-foreground\">{entry.question.prompt}</dt>\n <dd class=\"m-0 text-sm [overflow-wrap:anywhere] whitespace-pre-wrap\">\n {entry.parts.length > 0 ? entry.parts.join(', ') : 'Skipped'}\n </dd>\n </div>\n )}\n </For>\n </dl>\n }\n >\n <Show when={current()} keyed>\n {(question) => (\n <fieldset class=\"m-0 flex min-w-0 flex-col gap-2.5 border-0 p-0\" disabled={locked()}>\n <legend class=\"mb-1 p-0\">\n <Show when={count() > 1}>\n <span class=\"block text-xs text-muted-foreground tabular-nums\">\n Question {step() + 1} of {count()}\n </span>\n </Show>\n <h4\n ref={(element) => (questionHeading = element)}\n tabindex=\"-1\"\n class=\"m-0 text-sm font-medium outline-none [overflow-wrap:anywhere]\"\n >\n {question.prompt}\n </h4>\n <Show when={question.description}>\n <span class=\"mt-0.5 block text-xs font-normal text-muted-foreground\">\n {question.description}\n </span>\n </Show>\n </legend>\n\n <Show when={(question.options?.length ?? 0) > 0}>\n <Show\n when={question.multiple}\n fallback={\n <RadioGroup\n aria-label={question.prompt}\n value={answerOf(question).optionIds[0] ?? ''}\n onChange={(value: string | null) =>\n change(question, { ...answerOf(question), optionIds: value ? [value] : [] })\n }\n disabled={locked()}\n >\n <For each={question.options}>\n {(option) => (\n <RadioGroupItem\n value={option.id}\n label={option.label}\n description={option.description}\n variant=\"card\"\n />\n )}\n </For>\n </RadioGroup>\n }\n >\n <div role=\"group\" aria-label={question.prompt} class=\"grid gap-2\">\n <For each={question.options}>\n {(option) => (\n <Checkbox\n label={option.label}\n description={option.description}\n checked={answerOf(question).optionIds.includes(option.id)}\n disabled={locked()}\n onChange={(checked: boolean) => {\n const ids = answerOf(question).optionIds\n change(question, {\n ...answerOf(question),\n optionIds: checked\n ? [...ids.filter((id) => id !== option.id), option.id]\n : ids.filter((id) => id !== option.id),\n })\n }}\n />\n )}\n </For>\n </div>\n </Show>\n </Show>\n\n <Show when={(question.options?.length ?? 0) === 0 || question.allowText}>\n <div class=\"flex flex-col gap-1\">\n <label class=\"text-xs text-muted-foreground\" for={`${uid}-${question.id}-text`}>\n {question.textLabel ??\n ((question.options?.length ?? 0) > 0 ? 'Something else' : 'Your answer')}\n </label>\n <Textarea\n id={`${uid}-${question.id}-text`}\n rows={2}\n placeholder={question.textPlaceholder}\n value={answerOf(question).text}\n disabled={locked()}\n aria-describedby={locked() && hostDisabledReason() ? reasonId : undefined}\n onInput={(event) =>\n change(question, { ...answerOf(question), text: event.currentTarget.value })\n }\n />\n </div>\n </Show>\n </fieldset>\n )}\n </Show>\n\n <Show when={submitReason()}>\n <p id={reasonId} role=\"status\" class=\"m-0 text-xs text-muted-foreground\">\n {submitReason()}\n </p>\n </Show>\n <Show when={local.error}>\n {(errorSlot) => (\n <p role=\"alert\" class=\"m-0 text-xs text-destructive\">\n {errorSlot()}\n </p>\n )}\n </Show>\n\n <footer class=\"flex items-center justify-between gap-2\">\n <Show when={count() > 1} fallback={<span />}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n disabled={step() === 0 || locked()}\n onClick={() => setStep((value) => Math.max(0, value - 1))}\n >\n Back\n </Button>\n </Show>\n <Show\n when={last()}\n fallback={\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canAdvance()}\n aria-describedby={hostDisabledReason() ? reasonId : undefined}\n onClick={() => setStep((value) => Math.min(count() - 1, value + 1))}\n >\n Next\n </Button>\n }\n >\n <Button\n type=\"button\"\n size=\"sm\"\n disabled={locked() || !canSubmit() || local.onSubmit === undefined}\n aria-describedby={submitReason() ? reasonId : undefined}\n onClick={() => void submit()}\n >\n <Show when={status() === 'submitting'}>\n <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n </Show>\n {local.submitLabel ?? 'Send answer'}\n </Button>\n </Show>\n </footer>\n </Show>\n </section>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,IAAM,QAAQ,SAASiD,OAAW;AAClC,IAAM,aAAa,SAASC,YAAgB;AAC5C,IAAM,QAAQ,SAASC,OAAW;AAClC,IAAM,eAAe,SAASC,cAAkB;AA0DhD,IAAM,QAA6B;CAAE,WAAW,CAAC;CAAG,MAAM;AAAG;;;;;;;AAQ7D,SAAgB,UACd,QACA,UACiC;CACjC,OAAO,OAAO,OAAO,QAAQ,SAAS,EAAE,IAAI,OAAO,SAAS,MAAM,KAAA;AACpE;;AAGA,SAAgB,mBACd,UACA,QACS;CACT,IAAI,SAAS,UAAU,OAAO;CAC9B,QAAQ,QAAQ,UAAU,UAAU,KAAK,MAAM,QAAQ,KAAK,KAAK,CAAC,CAAC,UAAU,KAAK;AACpF;AAkBA,SAAgB,cAAc,OAA2B;CACvD,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,SACA,aACA,SACA,eACA,UACA,WACA,kBACA,mBACA,YACA,kBACA,SACA,aACF;CACA,MAAM,MAAM,eAAe;CAC3B,MAAM,CAAC,UAAU,eAAe,mBACxB,MAAM,kBAAkB,CAAC,CACjC;CACA,MAAM,CAAC,MAAM,WAAW,aAAa,CAAC;CACtC,MAAM,gBAAgB,MAAM,WAAW,SAAS;CAChD,MAAM,eAAe,MAAM,UAAU;CACrC,MAAM,gBAAgB,OAAO,MAAM,cAAc,OAAO,MAAM;CAC9D,MAAM,2BAA4B,MAAM,gBAAgB,KAAK,IAAI,MAAM,iBAAiB,K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AA;MAeN;KAAC,EAAA,CAAD,GAtCRP,MAuCQ;KAvCR,OAAA;IAuCQ,EAAA,CAAA;GAnJT,WAdG;IAWI,IAAA,SAAA,QAAA;IAXJiB,OAAA,QACER,gBAAAA,KAAAA;KAAK,IAAA,OAAA;MAAM,OAAA,QAAQ;KAAC;KAApBA,WACI,iBACA;MAKK,IAAA,SAAA,SAAA;MAJH,IAAA,SAAA,OAAA;MACA,IAAA,SAAA,OAAA;MADAQ,OAAA,cAA0C;OAAC,OAAA,MAAM,SAAS;MAAM,CAAK;MACrEA,OAAA,eACE;;QAAC,OAAA,MAAM,MAAM,SAAS;OAAsC,CAAA;OAA5D,aAAA;QAA4D,OAAA,MAAA,IAAlC,MAAM,MAAM,KAAK,IAAI,IAAI;OAAS;MAAC,EAAA,CAAD,CAC1D;MAJN,OAAA;KAKK,EAAA,CAAA;IAEJ,CAAA,CACH;IAXJ,OAAA;GAWI,EAAA,CAAA;EAuJF;CAAC,EAAA,CAAD,GAtNR,IAuNS;CAxNX,OACEP;AAyNJ"}
@@ -111,7 +111,7 @@ function RadioGroupItem(props) {
111
111
  "items-start": !card(),
112
112
  "items-center": card(),
113
113
  "relative rounded-lg border border-border bg-card px-3 py-2.5 transition-[color,box-shadow,border-color,background-color] ease-out hover:bg-surface-hover data-[checked]:border-primary data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-card": card(),
114
- "has-[[data-slot=radio]:focus-visible]:border-ring has-[[data-slot=radio]:focus-visible]:ring-3 has-[[data-slot=radio]:focus-visible]:ring-primary-subtle": card()
114
+ "has-[[data-slot=radio]:focus-visible]:border-ring has-[[data-slot=radio]:focus-visible]:focus-outline": card()
115
115
  }, props.class);
116
116
  }
117
117
  }, rest], true);
@@ -145,7 +145,7 @@ function RadioGroupItem(props) {
145
145
  return flag(invalid());
146
146
  },
147
147
  get "class"() {
148
- return cn("border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border", "transition-[color,box-shadow,border-color,background-color] ease-out outline-none", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", "data-[checked]:border-primary data-[checked]:text-primary", "data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", props.controlClass);
148
+ return cn("border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border", "transition-[color,box-shadow,border-color,background-color] ease-out outline-none", "focus-visible:border-ring focus-visible:focus-outline", "data-[checked]:border-primary data-[checked]:text-primary", "data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", props.controlClass);
149
149
  },
150
150
  get children() {
151
151
  return createComponent(RadioIndicator, {
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","names":["<RadioGroupContext value={state}>\n <SdkRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? props.id}\n aria-label={props['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? props['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? props['aria-describedby']}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-orientation={props.orientation}\n data-orientation={props.orientation}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}\n class={cn('grid gap-2', props.class as string)}\n {...rest}\n />\n </RadioGroupContext>","value={state}","<SdkRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? props.id}\n aria-label={props['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? props['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? props['aria-describedby']}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-orientation={props.orientation}\n data-orientation={props.orientation}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}\n class={cn('grid gap-2', props.class as string)}\n {...rest}\n />","onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}","<SdkRadio\n id={radioId}\n value={props.value}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={\n [props.description ? descriptionId : '', props['aria-describedby'] ?? '']\n .filter(Boolean)\n .join(' ') || undefined\n }\n aria-invalid={props['aria-invalid']}\n aria-busy={props['aria-busy']}\n title={props.title}\n data-invalid={flag(invalid())}\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n props.controlClass\n )}\n >\n <SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>\n </SdkRadio>","id={radioId}","<SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>","class=\"flex items-center justify-center\"","<Circle class=\"size-2 fill-current\" />","class=\"size-2 fill-current\"","<div\n data-slot=\"radio-group-item\"\n data-variant={card() ? 'card' : undefined}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n data-invalid={flag(invalid())}\n title={props.title}\n class={cn(\n 'group/radio flex gap-2.5',\n {\n 'items-start': !card(),\n // A card centres its radio, media and text on one axis. Top alignment\n // is right for a bare row, where the radio sits on the label's first\n // line, but in a card the media is taller than that line, so a\n // top-aligned radio floats above the icon and the label beside it.\n 'items-center': card(),\n 'relative rounded-lg border border-border bg-card px-3 py-2.5 transition-[color,box-shadow,border-color,background-color] ease-out hover:bg-surface-hover data-[checked]:border-primary data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-card':\n card(),\n // The radio button is what takes focus; the card rings while it has it.\n 'has-[[data-slot=radio]:focus-visible]:border-ring has-[[data-slot=radio]:focus-visible]:ring-3 has-[[data-slot=radio]:focus-visible]:ring-primary-subtle':\n card(),\n },\n props.class\n )}\n {...rest}\n >\n <SdkRadio\n id={radioId}\n value={props.value}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={\n [props.description ? descriptionId : '', props['aria-describedby'] ?? '']\n .filter(Boolean)\n .join(' ') || undefined\n }\n aria-invalid={props['aria-invalid']}\n aria-busy={props['aria-busy']}\n title={props.title}\n data-invalid={flag(invalid())}\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n props.controlClass\n )}\n >\n <SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>\n </SdkRadio>\n <Show when={media()}>\n {(slot) => (\n <span data-slot=\"radio-group-item-media\" class=\"flex shrink-0 items-center\">\n {slot()}\n </span>\n )}\n </Show>\n {props.children ?? (\n <div class=\"grid gap-0.5 leading-none\">\n {props.label ? (\n <label\n for={radioId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {props.label}\n </label>\n ) : null}\n {props.description ? (\n <div\n id={descriptionId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class=\"text-muted-foreground text-sm\"\n >\n {props.description}\n </div>\n ) : null}\n </div>\n )}\n </div>","<Show when={media()}>\n {(slot) => (\n <span data-slot=\"radio-group-item-media\" class=\"flex shrink-0 items-center\">\n {slot()}\n </span>\n )}\n </Show>","data-disabled={flag(disabled())}","class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}","<div class=\"grid gap-0.5 leading-none\">\n {props.label ? (\n <label\n for={radioId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {props.label}\n </label>\n ) : null}\n {props.description ? (\n <div\n id={descriptionId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class=\"text-muted-foreground text-sm\"\n >\n {props.description}\n </div>\n ) : null}\n </div>","LucideCircle","resolveChildren","_$spread","_$insert","_$setAttribute","_$effect","_$className"],"sources":["../../../../src/components/ui/radio-group/radio-group.tsx"],"sourcesContent":["import {\n Radio as SdkRadio,\n RadioGroup as SdkRadioGroup,\n RadioIndicator as SdkRadioIndicator,\n} from '@ui-sdk/solid/radio'\nimport { Circle as LucideCircle } from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport {\n Show,\n children as resolveChildren,\n createContext,\n createSignal,\n createUniqueId,\n omit,\n useContext,\n} from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Circle = fastIcon(LucideCircle)\n\n/**\n * RadioGroup.\n *\n * A single choice from a small, visible set. The group owns the value and the\n * arrow-key navigation, so a caller sets `value` once instead of wiring a\n * `name` and a handler onto every item.\n *\n * Below about five options a Select hides the choices behind a click, which is\n * the wrong trade; above about seven, radios become a wall and the Select wins.\n * That call belongs to the caller, and both controls are drawn from the same\n * tokens so either choice sits correctly next to the other.\n *\n * Built on ui-sdk's RadioGroup: each radio is a `role=\"radio\"` button with one\n * tab stop for the group, arrow keys between items, and a hidden native radio\n * beside it that takes part in the form (required, reset, submission).\n */\nexport type RadioGroupProps = Omit<\n ComponentProps<typeof SdkRadioGroup>,\n 'value' | 'defaultValue' | 'onValueChange' | 'onChange'\n> & {\n /** The checked item's value. Pass it to control the group. */\n value?: string\n defaultValue?: string\n /** Called with the newly checked item's value. */\n onChange?: (value: string) => void\n /** Which arrow keys move between items; both pairs work either way. */\n orientation?: 'horizontal' | 'vertical'\n /** `'invalid'` marks the group `aria-invalid` and its items invalid. */\n validationState?: 'valid' | 'invalid'\n}\n\n/** What an item needs from its group to mark its own row. */\ntype RadioGroupState = {\n value: () => string | null | undefined\n disabled: () => boolean\n invalid: () => boolean\n}\n\nconst RadioGroupContext = createContext<RadioGroupState | null>(null)\n\nexport function RadioGroup(props: RadioGroupProps) {\n const rest = omit(\n props,\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n 'value',\n 'defaultValue',\n 'onChange',\n 'orientation',\n 'validationState'\n )\n const field = useFormFieldControl('group', props)\n // The item rows carry `data-checked` and `data-disabled` themselves (the\n // card variant draws its edge from them), so the group's value is kept here\n // as well as in the primitive: the controlled prop, else the last change.\n const [own, setOwn] = createSignal<string | null | undefined>(() => props.defaultValue)\n const state: RadioGroupState = {\n value: () => (props.value !== undefined ? props.value : own()),\n disabled: () => props.disabled ?? false,\n invalid: () => props.validationState === 'invalid',\n }\n return (\n <RadioGroupContext value={state}>\n <SdkRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? props.id}\n aria-label={props['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? props['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? props['aria-describedby']}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-orientation={props.orientation}\n data-orientation={props.orientation}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}\n class={cn('grid gap-2', props.class as string)}\n {...rest}\n />\n </RadioGroupContext>\n )\n}\n\nexport type RadioGroupItemProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** What the group's value becomes when this item is checked. */\n value: string\n /** Skips the item: arrow keys pass it and it can't be checked. */\n disabled?: boolean\n /** Replaces the label block, beside the radio. */\n children?: JSX.Element\n controlClass?: string\n /**\n * The option's visible label. A radio with no accessible name is unreachable\n * by a screen reader and by voice control, so supply this, a labelled child,\n * `aria-label`, or `aria-labelledby`.\n */\n label?: string\n description?: string\n /**\n * `card` draws the option as a bordered, selectable card — for a choice\n * whose options need a sentence each (a source type, a sync budget), where a\n * bare radio row reads as a form field rather than a decision. The whole card\n * is the hit target, and the selected card takes the primary edge. The radio,\n * `media` and text centre on one axis; the default variant keeps the radio on\n * the first line of its label.\n */\n variant?: 'default' | 'card'\n /** A leading icon or `EntityIcon` between the radio and the text, for `card`. */\n media?: JSX.Element\n}\n\nconst flag = (on: boolean) => (on ? '' : undefined)\n\n/**\n * A card option's label stretches an invisible layer over the whole card, so a\n * click anywhere on it — padding, media, description — selects the option\n * through the label's native association with the radio. Wrapping the card in\n * a `<label>` would nest the item's own label inside another.\n */\nexport function RadioGroupItem(props: RadioGroupItemProps) {\n const rest = omit(\n props,\n 'class',\n 'controlClass',\n 'label',\n 'description',\n 'variant',\n 'media',\n 'children',\n 'value',\n 'disabled',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-busy',\n 'title'\n )\n const group = useContext(RadioGroupContext)\n const card = () => props.variant === 'card'\n const uid = createUniqueId()\n const radioId = `radio-${uid}`\n const descriptionId = `radio-${uid}-description`\n const checked = () => group?.value() === props.value\n const disabled = () => Boolean(props.disabled || group?.disabled())\n const invalid = () => group?.invalid() ?? false\n\n const media = resolveChildren(() => props.media)\n return (\n <div\n data-slot=\"radio-group-item\"\n data-variant={card() ? 'card' : undefined}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n data-invalid={flag(invalid())}\n title={props.title}\n class={cn(\n 'group/radio flex gap-2.5',\n {\n 'items-start': !card(),\n // A card centres its radio, media and text on one axis. Top alignment\n // is right for a bare row, where the radio sits on the label's first\n // line, but in a card the media is taller than that line, so a\n // top-aligned radio floats above the icon and the label beside it.\n 'items-center': card(),\n 'relative rounded-lg border border-border bg-card px-3 py-2.5 transition-[color,box-shadow,border-color,background-color] ease-out hover:bg-surface-hover data-[checked]:border-primary data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-card':\n card(),\n // The radio button is what takes focus; the card rings while it has it.\n 'has-[[data-slot=radio]:focus-visible]:border-ring has-[[data-slot=radio]:focus-visible]:ring-3 has-[[data-slot=radio]:focus-visible]:ring-primary-subtle':\n card(),\n },\n props.class\n )}\n {...rest}\n >\n <SdkRadio\n id={radioId}\n value={props.value}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={\n [props.description ? descriptionId : '', props['aria-describedby'] ?? '']\n .filter(Boolean)\n .join(' ') || undefined\n }\n aria-invalid={props['aria-invalid']}\n aria-busy={props['aria-busy']}\n title={props.title}\n data-invalid={flag(invalid())}\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n props.controlClass\n )}\n >\n <SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>\n </SdkRadio>\n <Show when={media()}>\n {(slot) => (\n <span data-slot=\"radio-group-item-media\" class=\"flex shrink-0 items-center\">\n {slot()}\n </span>\n )}\n </Show>\n {props.children ?? (\n <div class=\"grid gap-0.5 leading-none\">\n {props.label ? (\n <label\n for={radioId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {props.label}\n </label>\n ) : null}\n {props.description ? (\n <div\n id={descriptionId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class=\"text-muted-foreground text-sm\"\n >\n {props.description}\n </div>\n ) : null}\n </div>\n )}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAqBA,IAAM,SAAS,SAASe,QAAY;AAwCpC,IAAM,oBAAoB,cAAsC,IAAI;AAEpE,SAAgB,WAAW,OAAwB;CACjD,MAAM,OAAO,KACX,OACA,SACA,MACA,cACA,mBACA,oBACA,gBACA,qBACA,SACA,gBACA,YACA,eACA,iBACF;CACA,MAAM,QAAQ,oBAAoB,SAAS,KAAK;CAIhD,MAAM,CAAC,KAAK,UAAU,mBAA8C,MAAM,YAAY;CAMtF,OACEf,gBAAAA,mBAAAA;EAAmBC,OAAO;GAL1B,aAAc,MAAM,UAAU,KAAA,IAAY,MAAM,QAAQ,IAAI;GAC5D,gBAAgB,MAAM,YAAY;GAClC,eAAe,MAAM,oBAAoB;EAGf;EAA1B,IAAA,WAAA;GACEC,OAAAA,gBAAAA,cAAAA,WAAAA;IACE,aAAU;IACV,IAAA,KAAA;KAAI,OAAA,OAAO,MAAM,MAAM;IAAE;IACzB,IAAA,eAAA;KAAY,OAAA,MAAM;IAAa;IAC/B,IAAA,oBAAA;KAAiB,OAAA,QAAQ,sBAAsB,MAAM;IAAkB;IACvE,IAAA,qBAAA;KAAkB,OAAA,QAAQ,uBAAuB,MAAM;IAAmB;IAC1E,IAAA,iBAAA;KACE,OAA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QAAA,iBAAA,CAA+B;MADF,CAAA;MAF/B,OAAA;KAOK,EAAA,CAAA,IACH;IAAI;GAAC,EAAA,CAAD,GApBVL,KAqBK;GArBL,OAAA;EAqBK,EAAA,CAAA;CACN,GArFHJ,KAsFK;CAvFP,OACEA;AAwFJ"}
1
+ {"version":3,"file":"radio-group.js","names":["<RadioGroupContext value={state}>\n <SdkRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? props.id}\n aria-label={props['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? props['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? props['aria-describedby']}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-orientation={props.orientation}\n data-orientation={props.orientation}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}\n class={cn('grid gap-2', props.class as string)}\n {...rest}\n />\n </RadioGroupContext>","value={state}","<SdkRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? props.id}\n aria-label={props['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? props['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? props['aria-describedby']}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-orientation={props.orientation}\n data-orientation={props.orientation}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}\n class={cn('grid gap-2', props.class as string)}\n {...rest}\n />","onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}","<SdkRadio\n id={radioId}\n value={props.value}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={\n [props.description ? descriptionId : '', props['aria-describedby'] ?? '']\n .filter(Boolean)\n .join(' ') || undefined\n }\n aria-invalid={props['aria-invalid']}\n aria-busy={props['aria-busy']}\n title={props.title}\n data-invalid={flag(invalid())}\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:focus-outline',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n props.controlClass\n )}\n >\n <SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>\n </SdkRadio>","id={radioId}","<SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>","class=\"flex items-center justify-center\"","<Circle class=\"size-2 fill-current\" />","class=\"size-2 fill-current\"","<div\n data-slot=\"radio-group-item\"\n data-variant={card() ? 'card' : undefined}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n data-invalid={flag(invalid())}\n title={props.title}\n class={cn(\n 'group/radio flex gap-2.5',\n {\n 'items-start': !card(),\n // A card centres its radio, media and text on one axis. Top alignment\n // is right for a bare row, where the radio sits on the label's first\n // line, but in a card the media is taller than that line, so a\n // top-aligned radio floats above the icon and the label beside it.\n 'items-center': card(),\n 'relative rounded-lg border border-border bg-card px-3 py-2.5 transition-[color,box-shadow,border-color,background-color] ease-out hover:bg-surface-hover data-[checked]:border-primary data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-card':\n card(),\n // The radio button is what takes focus; the card rings while it has it.\n 'has-[[data-slot=radio]:focus-visible]:border-ring has-[[data-slot=radio]:focus-visible]:focus-outline':\n card(),\n },\n props.class\n )}\n {...rest}\n >\n <SdkRadio\n id={radioId}\n value={props.value}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={\n [props.description ? descriptionId : '', props['aria-describedby'] ?? '']\n .filter(Boolean)\n .join(' ') || undefined\n }\n aria-invalid={props['aria-invalid']}\n aria-busy={props['aria-busy']}\n title={props.title}\n data-invalid={flag(invalid())}\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:focus-outline',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n props.controlClass\n )}\n >\n <SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>\n </SdkRadio>\n <Show when={media()}>\n {(slot) => (\n <span data-slot=\"radio-group-item-media\" class=\"flex shrink-0 items-center\">\n {slot()}\n </span>\n )}\n </Show>\n {props.children ?? (\n <div class=\"grid gap-0.5 leading-none\">\n {props.label ? (\n <label\n for={radioId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {props.label}\n </label>\n ) : null}\n {props.description ? (\n <div\n id={descriptionId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class=\"text-muted-foreground text-sm\"\n >\n {props.description}\n </div>\n ) : null}\n </div>\n )}\n </div>","<Show when={media()}>\n {(slot) => (\n <span data-slot=\"radio-group-item-media\" class=\"flex shrink-0 items-center\">\n {slot()}\n </span>\n )}\n </Show>","data-disabled={flag(disabled())}","class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}","<div class=\"grid gap-0.5 leading-none\">\n {props.label ? (\n <label\n for={radioId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {props.label}\n </label>\n ) : null}\n {props.description ? (\n <div\n id={descriptionId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class=\"text-muted-foreground text-sm\"\n >\n {props.description}\n </div>\n ) : null}\n </div>","LucideCircle","resolveChildren","_$spread","_$insert","_$setAttribute","_$effect","_$className"],"sources":["../../../../src/components/ui/radio-group/radio-group.tsx"],"sourcesContent":["import {\n Radio as SdkRadio,\n RadioGroup as SdkRadioGroup,\n RadioIndicator as SdkRadioIndicator,\n} from '@ui-sdk/solid/radio'\nimport { Circle as LucideCircle } from '@lucide/solid'\nimport type { ComponentProps, JSX } from '@solidjs/web'\nimport {\n Show,\n children as resolveChildren,\n createContext,\n createSignal,\n createUniqueId,\n omit,\n useContext,\n} from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Circle = fastIcon(LucideCircle)\n\n/**\n * RadioGroup.\n *\n * A single choice from a small, visible set. The group owns the value and the\n * arrow-key navigation, so a caller sets `value` once instead of wiring a\n * `name` and a handler onto every item.\n *\n * Below about five options a Select hides the choices behind a click, which is\n * the wrong trade; above about seven, radios become a wall and the Select wins.\n * That call belongs to the caller, and both controls are drawn from the same\n * tokens so either choice sits correctly next to the other.\n *\n * Built on ui-sdk's RadioGroup: each radio is a `role=\"radio\"` button with one\n * tab stop for the group, arrow keys between items, and a hidden native radio\n * beside it that takes part in the form (required, reset, submission).\n */\nexport type RadioGroupProps = Omit<\n ComponentProps<typeof SdkRadioGroup>,\n 'value' | 'defaultValue' | 'onValueChange' | 'onChange'\n> & {\n /** The checked item's value. Pass it to control the group. */\n value?: string\n defaultValue?: string\n /** Called with the newly checked item's value. */\n onChange?: (value: string) => void\n /** Which arrow keys move between items; both pairs work either way. */\n orientation?: 'horizontal' | 'vertical'\n /** `'invalid'` marks the group `aria-invalid` and its items invalid. */\n validationState?: 'valid' | 'invalid'\n}\n\n/** What an item needs from its group to mark its own row. */\ntype RadioGroupState = {\n value: () => string | null | undefined\n disabled: () => boolean\n invalid: () => boolean\n}\n\nconst RadioGroupContext = createContext<RadioGroupState | null>(null)\n\nexport function RadioGroup(props: RadioGroupProps) {\n const rest = omit(\n props,\n 'class',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n 'value',\n 'defaultValue',\n 'onChange',\n 'orientation',\n 'validationState'\n )\n const field = useFormFieldControl('group', props)\n // The item rows carry `data-checked` and `data-disabled` themselves (the\n // card variant draws its edge from them), so the group's value is kept here\n // as well as in the primitive: the controlled prop, else the last change.\n const [own, setOwn] = createSignal<string | null | undefined>(() => props.defaultValue)\n const state: RadioGroupState = {\n value: () => (props.value !== undefined ? props.value : own()),\n disabled: () => props.disabled ?? false,\n invalid: () => props.validationState === 'invalid',\n }\n return (\n <RadioGroupContext value={state}>\n <SdkRadioGroup\n data-slot=\"radio-group\"\n id={field?.id ?? props.id}\n aria-label={props['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? props['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? props['aria-describedby']}\n aria-invalid={\n field?.['aria-invalid'] ??\n props['aria-invalid'] ??\n (props.validationState === 'invalid' ? 'true' : undefined)\n }\n aria-errormessage={field?.['aria-errormessage'] ?? props['aria-errormessage']}\n aria-orientation={props.orientation}\n data-orientation={props.orientation}\n value={props.value}\n defaultValue={props.defaultValue}\n onValueChange={(value) => {\n setOwn(value)\n if (value !== null) props.onChange?.(value)\n }}\n class={cn('grid gap-2', props.class as string)}\n {...rest}\n />\n </RadioGroupContext>\n )\n}\n\nexport type RadioGroupItemProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** What the group's value becomes when this item is checked. */\n value: string\n /** Skips the item: arrow keys pass it and it can't be checked. */\n disabled?: boolean\n /** Replaces the label block, beside the radio. */\n children?: JSX.Element\n controlClass?: string\n /**\n * The option's visible label. A radio with no accessible name is unreachable\n * by a screen reader and by voice control, so supply this, a labelled child,\n * `aria-label`, or `aria-labelledby`.\n */\n label?: string\n description?: string\n /**\n * `card` draws the option as a bordered, selectable card — for a choice\n * whose options need a sentence each (a source type, a sync budget), where a\n * bare radio row reads as a form field rather than a decision. The whole card\n * is the hit target, and the selected card takes the primary edge. The radio,\n * `media` and text centre on one axis; the default variant keeps the radio on\n * the first line of its label.\n */\n variant?: 'default' | 'card'\n /** A leading icon or `EntityIcon` between the radio and the text, for `card`. */\n media?: JSX.Element\n}\n\nconst flag = (on: boolean) => (on ? '' : undefined)\n\n/**\n * A card option's label stretches an invisible layer over the whole card, so a\n * click anywhere on it — padding, media, description — selects the option\n * through the label's native association with the radio. Wrapping the card in\n * a `<label>` would nest the item's own label inside another.\n */\nexport function RadioGroupItem(props: RadioGroupItemProps) {\n const rest = omit(\n props,\n 'class',\n 'controlClass',\n 'label',\n 'description',\n 'variant',\n 'media',\n 'children',\n 'value',\n 'disabled',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-busy',\n 'title'\n )\n const group = useContext(RadioGroupContext)\n const card = () => props.variant === 'card'\n const uid = createUniqueId()\n const radioId = `radio-${uid}`\n const descriptionId = `radio-${uid}-description`\n const checked = () => group?.value() === props.value\n const disabled = () => Boolean(props.disabled || group?.disabled())\n const invalid = () => group?.invalid() ?? false\n\n const media = resolveChildren(() => props.media)\n return (\n <div\n data-slot=\"radio-group-item\"\n data-variant={card() ? 'card' : undefined}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n data-invalid={flag(invalid())}\n title={props.title}\n class={cn(\n 'group/radio flex gap-2.5',\n {\n 'items-start': !card(),\n // A card centres its radio, media and text on one axis. Top alignment\n // is right for a bare row, where the radio sits on the label's first\n // line, but in a card the media is taller than that line, so a\n // top-aligned radio floats above the icon and the label beside it.\n 'items-center': card(),\n 'relative rounded-lg border border-border bg-card px-3 py-2.5 transition-[color,box-shadow,border-color,background-color] ease-out hover:bg-surface-hover data-[checked]:border-primary data-[disabled]:cursor-not-allowed data-[disabled]:hover:bg-card':\n card(),\n // The radio button is what takes focus; the card rings while it has it.\n 'has-[[data-slot=radio]:focus-visible]:border-ring has-[[data-slot=radio]:focus-visible]:focus-outline':\n card(),\n },\n props.class\n )}\n {...rest}\n >\n <SdkRadio\n id={radioId}\n value={props.value}\n disabled={props.disabled}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={\n [props.description ? descriptionId : '', props['aria-describedby'] ?? '']\n .filter(Boolean)\n .join(' ') || undefined\n }\n aria-invalid={props['aria-invalid']}\n aria-busy={props['aria-busy']}\n title={props.title}\n data-invalid={flag(invalid())}\n class={cn(\n 'border-input bg-transparent flex size-4 shrink-0 items-center justify-center rounded-full border',\n 'transition-[color,box-shadow,border-color,background-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:focus-outline',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n 'data-[invalid]:border-destructive data-[invalid]:ring-3 data-[invalid]:ring-destructive-subtle',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n props.controlClass\n )}\n >\n <SdkRadioIndicator class=\"flex items-center justify-center\">\n <Circle class=\"size-2 fill-current\" />\n </SdkRadioIndicator>\n </SdkRadio>\n <Show when={media()}>\n {(slot) => (\n <span data-slot=\"radio-group-item-media\" class=\"flex shrink-0 items-center\">\n {slot()}\n </span>\n )}\n </Show>\n {props.children ?? (\n <div class=\"grid gap-0.5 leading-none\">\n {props.label ? (\n <label\n for={radioId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class={cn('text-sm font-medium', card() && 'after:absolute after:inset-0')}\n >\n {props.label}\n </label>\n ) : null}\n {props.description ? (\n <div\n id={descriptionId}\n data-checked={flag(checked())}\n data-disabled={flag(disabled())}\n class=\"text-muted-foreground text-sm\"\n >\n {props.description}\n </div>\n )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AAc,GAAA,KAAK,QAAQ,CAAC;QAC5BR,GAAe,KAAK,SAAS,CAAC;QAC9BC,GAAAA,YAAO,GAAG,uBAAuB,KAAK,KAAK,8BAA8B,CAAC;OAF7C;MAA7B,IAAA,EAAA,GAAA,GAAA,KAAA,QAAA;OAA6B,MAAA,KAAA,KAAAM,aAAA,OAAA,gBAAA,CAAA;OAC7B,MAAA,KAAA,KAAAA,aAAA,OAAA,iBAAA,CAA+B;OAC/BE,UAAA,OAAA,GAAA,KAAA,CAA0E;MAF7C,CAAA;MAF/B,OAAA;KAOO,EAAA,CAAA,IACL;IAAI;GAAC,EAAA,CAAD,GAVVP,KAqBK;GArBLI,OAAA,cAWE;;KAAC,OAAA,CAAA,CAAA,MAAM;IASC,CAAA;IATR,aAAA;KASQ,OAAA,KAAA,WARN;MAOK,IAAA,SAAA,QAAA;MANHC,aAAA,QAAA,MAAI,aAAa;MADnBD,OAAA,cAME;OAAC,OAAA,MAAM;MAAW,CACf;MALHE,aAAA;;QAAc,GAAA,KAAK,QAAQ,CAAC;QAC5BR,GAAe,KAAK,SAAS,CAAC;OADD;MAA7B,IAAA,EAAA,GAAA,KAAA,QAAA;OAA6B,MAAA,KAAA,KAAAO,aAAA,QAAA,gBAAA,CAAA;OAC7B,MAAA,KAAA,KAAAA,aAAA,QAAA,iBAAA,CAA+B;MADF,CAAA;MAF/B,OAAA;KAOK,EAAA,CAAA,IACH;IAAI;GAAC,EAAA,CAAD,GApBVL,KAqBK;GArBL,OAAA;EAqBK,EAAA,CAAA;CACN,GArFHJ,KAsFK;CAvFP,OACEA;AAwFJ"}
@@ -13,7 +13,7 @@ function ScrollArea(props) {
13
13
  return local.tabindex ?? 0;
14
14
  },
15
15
  get "class"() {
16
- return cn("relative min-h-0 min-w-0 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle", {
16
+ return cn("relative min-h-0 min-w-0 outline-none focus-visible:focus-outline-inset", {
17
17
  "overflow-y-auto overflow-x-hidden": local.orientation === "vertical" || local.orientation === void 0,
18
18
  "overflow-x-auto overflow-y-hidden": local.orientation === "horizontal",
19
19
  "overflow-auto": local.orientation === "both",
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-area.js","names":["<div\n data-slot=\"scroll-area\"\n /*\n * Focusable, because that is what makes a scroll region reachable from the\n * keyboard. A `div` with `overflow: auto` scrolls with a mouse or a\n * trackpad and not at all with the arrow keys until it can take focus, so\n * a long list inside one is unreachable without a pointer. The cost is a\n * focus ring around the region, which is correct: it *is* focusable, and\n * `outline-none` keeps the ring to the drawn one.\n */\n tabindex={local.tabindex ?? 0}\n class={cn(\n 'relative min-h-0 min-w-0 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n 'overflow-y-auto overflow-x-hidden':\n local.orientation === 'vertical' || local.orientation === undefined,\n 'overflow-x-auto overflow-y-hidden': local.orientation === 'horizontal',\n 'overflow-auto': local.orientation === 'both',\n 'no-scrollbar': local.hideScrollbar,\n 'scroll-shadow-y':\n local.fade && (local.orientation === 'vertical' || local.orientation === undefined),\n },\n local.class\n )}\n {...rest}\n />","_$spread"],"sources":["../../../../src/components/ui/scroll-area/scroll-area.tsx"],"sourcesContent":["import type { ComponentProps } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * ScrollArea.\n *\n * A scroll container with the design system's scrollbar treatment, plus an\n * optional fade at each edge so a long list reads as continuing rather than\n * ending at the fold.\n *\n * This is a styled native scroller, not a reimplementation of scrolling. The\n * platform scroller already handles momentum, rubber-banding, keyboard paging,\n * trackpad gestures, `scrollIntoView`, focus-into-view and find-in-page. A\n * custom scrollbar over a transformed div gives up every one of those to gain\n * nothing but the scrollbar's appearance, which CSS already controls.\n *\n * `orientation` only decides which edges the fade appears on; `overflow-auto`\n * stays on both axes in `both` mode so a wide table can still be reached.\n */\nexport type ScrollAreaProps = ComponentProps<'div'> & {\n orientation?: 'vertical' | 'horizontal' | 'both'\n /** Draw a fade at the leading and trailing edges of the scrolled axis. */\n fade?: boolean\n /** Replace the browser's scrollbar with the system's thin treatment. */\n hideScrollbar?: boolean\n}\n\nexport function ScrollArea(props: ScrollAreaProps) {\n const local = props\n const rest = omit(props, 'class', 'orientation', 'fade', 'hideScrollbar', 'tabindex')\n\n return (\n <div\n data-slot=\"scroll-area\"\n /*\n * Focusable, because that is what makes a scroll region reachable from the\n * keyboard. A `div` with `overflow: auto` scrolls with a mouse or a\n * trackpad and not at all with the arrow keys until it can take focus, so\n * a long list inside one is unreachable without a pointer. The cost is a\n * focus ring around the region, which is correct: it *is* focusable, and\n * `outline-none` keeps the ring to the drawn one.\n */\n tabindex={local.tabindex ?? 0}\n class={cn(\n 'relative min-h-0 min-w-0 outline-none focus-visible:ring-3 focus-visible:ring-primary-subtle',\n {\n 'overflow-y-auto overflow-x-hidden':\n local.orientation === 'vertical' || local.orientation === undefined,\n 'overflow-x-auto overflow-y-hidden': local.orientation === 'horizontal',\n 'overflow-auto': local.orientation === 'both',\n 'no-scrollbar': local.hideScrollbar,\n 'scroll-shadow-y':\n local.fade && (local.orientation === 'vertical' || local.orientation === undefined),\n },\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;AA4BA,SAAgB,WAAW,OAAwB;CACjD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,eAAe,QAAQ,iBAAiB,UAAU;CAGlF,IAAA,OAAA,OAyBC;CADCC,OAAA,MAAA,CAAA;EAvBA,aAAA;EASA,IAAA,WAAA;GAAU,OAAA,MAAM,YAAY;EAAC;EAC7B,IAAA,UAAA;GAAO,OAAA,GACL,gGACA;IACE,qCACE,MAAM,gBAAgB,cAAc,MAAM,gBAAgB,KAAA;IAC5D,qCAAqC,MAAM,gBAAgB;IAC3D,iBAAiB,MAAM,gBAAgB;IACvC,gBAAgB,MAAM;IACtB,mBACE,MAAM,SAAS,MAAM,gBAAgB,cAAc,MAAM,gBAAgB,KAAA;GAC7E,GACA,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,KAAA;CAzBR,OACED;AA2BJ"}
1
+ {"version":3,"file":"scroll-area.js","names":["<div\n data-slot=\"scroll-area\"\n /*\n * Focusable, because that is what makes a scroll region reachable from the\n * keyboard. A `div` with `overflow: auto` scrolls with a mouse or a\n * trackpad and not at all with the arrow keys until it can take focus, so\n * a long list inside one is unreachable without a pointer. The cost is a\n * focus ring around the region, which is correct: it *is* focusable, and\n * `outline-none` keeps the ring to the drawn one.\n */\n tabindex={local.tabindex ?? 0}\n class={cn(\n 'relative min-h-0 min-w-0 outline-none focus-visible:focus-outline-inset',\n {\n 'overflow-y-auto overflow-x-hidden':\n local.orientation === 'vertical' || local.orientation === undefined,\n 'overflow-x-auto overflow-y-hidden': local.orientation === 'horizontal',\n 'overflow-auto': local.orientation === 'both',\n 'no-scrollbar': local.hideScrollbar,\n 'scroll-shadow-y':\n local.fade && (local.orientation === 'vertical' || local.orientation === undefined),\n },\n local.class\n )}\n {...rest}\n />","_$spread"],"sources":["../../../../src/components/ui/scroll-area/scroll-area.tsx"],"sourcesContent":["import type { ComponentProps } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * ScrollArea.\n *\n * A scroll container with the design system's scrollbar treatment, plus an\n * optional fade at each edge so a long list reads as continuing rather than\n * ending at the fold.\n *\n * This is a styled native scroller, not a reimplementation of scrolling. The\n * platform scroller already handles momentum, rubber-banding, keyboard paging,\n * trackpad gestures, `scrollIntoView`, focus-into-view and find-in-page. A\n * custom scrollbar over a transformed div gives up every one of those to gain\n * nothing but the scrollbar's appearance, which CSS already controls.\n *\n * `orientation` only decides which edges the fade appears on; `overflow-auto`\n * stays on both axes in `both` mode so a wide table can still be reached.\n */\nexport type ScrollAreaProps = ComponentProps<'div'> & {\n orientation?: 'vertical' | 'horizontal' | 'both'\n /** Draw a fade at the leading and trailing edges of the scrolled axis. */\n fade?: boolean\n /** Replace the browser's scrollbar with the system's thin treatment. */\n hideScrollbar?: boolean\n}\n\nexport function ScrollArea(props: ScrollAreaProps) {\n const local = props\n const rest = omit(props, 'class', 'orientation', 'fade', 'hideScrollbar', 'tabindex')\n\n return (\n <div\n data-slot=\"scroll-area\"\n /*\n * Focusable, because that is what makes a scroll region reachable from the\n * keyboard. A `div` with `overflow: auto` scrolls with a mouse or a\n * trackpad and not at all with the arrow keys until it can take focus, so\n * a long list inside one is unreachable without a pointer. The cost is a\n * focus ring around the region, which is correct: it *is* focusable, and\n * `outline-none` keeps the ring to the drawn one.\n */\n tabindex={local.tabindex ?? 0}\n class={cn(\n 'relative min-h-0 min-w-0 outline-none focus-visible:focus-outline-inset',\n {\n 'overflow-y-auto overflow-x-hidden':\n local.orientation === 'vertical' || local.orientation === undefined,\n 'overflow-x-auto overflow-y-hidden': local.orientation === 'horizontal',\n 'overflow-auto': local.orientation === 'both',\n 'no-scrollbar': local.hideScrollbar,\n 'scroll-shadow-y':\n local.fade && (local.orientation === 'vertical' || local.orientation === undefined),\n },\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;AA4BA,SAAgB,WAAW,OAAwB;CACjD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,eAAe,QAAQ,iBAAiB,UAAU;CAGlF,IAAA,OAAA,OAyBC;CADCC,OAAA,MAAA,CAAA;EAvBA,aAAA;EASA,IAAA,WAAA;GAAU,OAAA,MAAM,YAAY;EAAC;EAC7B,IAAA,UAAA;GAAO,OAAA,GACL,2EACA;IACE,qCACE,MAAM,gBAAgB,cAAc,MAAM,gBAAgB,KAAA;IAC5D,qCAAqC,MAAM,gBAAgB;IAC3D,iBAAiB,MAAM,gBAAgB;IACvC,gBAAgB,MAAM;IACtB,mBACE,MAAM,SAAS,MAAM,gBAAgB,cAAc,MAAM,gBAAgB,KAAA;GAC7E,GACA,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,KAAA;CAzBR,OACED;AA2BJ"}
@@ -163,7 +163,7 @@ function SelectTrigger(props) {
163
163
  return _el$3;
164
164
  })(),
165
165
  get "class"() {
166
- return cn("border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md", "whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none", "data-[placeholder-shown]:text-muted-foreground", "hover:border-input", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle", "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", "*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4", {
166
+ return cn("border-input bg-transparent flex w-fit items-center justify-between gap-2 rounded-md border px-control-md", "whitespace-nowrap transition-[color,box-shadow,border-color] ease-out outline-none", "data-[placeholder-shown]:text-muted-foreground", "hover:border-input", "focus-visible:border-ring focus-visible:focus-outline", "aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle", "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", "*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2", "[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4", {
167
167
  "h-control-sm text-xs": props.size === "sm",
168
168
  "h-control-md text-sm": props.size === "md" || props.size === void 0,
169
169
  "h-control-lg text-sm": props.size === "lg"