@adea-ai/ui 0.152.2 → 0.152.3

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 (237) hide show
  1. package/dist/components/composites/about-dialog/about-dialog.js.map +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.map +1 -1
  4. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  5. package/dist/components/composites/action-button/action-button.js.map +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.js.map +1 -1
  8. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  9. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  10. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  11. package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
  12. package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
  13. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  14. package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
  15. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  16. package/dist/components/composites/chat/chat.js.map +1 -1
  17. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  18. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  19. package/dist/components/composites/context/context.js.map +1 -1
  20. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  21. package/dist/components/composites/help-center/help-center.js.map +1 -1
  22. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  23. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  24. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  25. package/dist/components/composites/list-row/list-row.js.map +1 -1
  26. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  27. package/dist/components/composites/model-selector/model-selector.js +3 -0
  28. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  29. package/dist/components/composites/plan/plan.js.map +1 -1
  30. package/dist/components/composites/queue/queue.js.map +1 -1
  31. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  32. package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
  33. package/dist/components/composites/settings/settings-layout.js.map +1 -1
  34. package/dist/components/composites/settings/settings-navigation.js.map +1 -1
  35. package/dist/components/composites/settings/settings.js.map +1 -1
  36. package/dist/components/composites/sources/sources.js.map +1 -1
  37. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  38. package/dist/components/composites/stat/stat.js.map +1 -1
  39. package/dist/components/composites/subagent/subagent.js.map +1 -1
  40. package/dist/components/composites/suggestion/suggestion.js.map +1 -1
  41. package/dist/components/composites/task/task.js.map +1 -1
  42. package/dist/components/composites/terminal/terminal.js.map +1 -1
  43. package/dist/components/composites/test-results/test-results.js.map +1 -1
  44. package/dist/components/composites/tool/tool.js.map +1 -1
  45. package/dist/components/composites/tree/tree.js.map +1 -1
  46. package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
  47. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  48. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  49. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  50. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  51. package/dist/components/conversation/atomic/chat-composer.js.map +1 -1
  52. package/dist/components/conversation/busy-send-button.js.map +1 -1
  53. package/dist/components/conversation/chat-composer.js.map +1 -1
  54. package/dist/components/conversation/composer-menu.js.map +1 -1
  55. package/dist/components/conversation/conversation-avatar.js.map +1 -1
  56. package/dist/components/conversation/conversation-pane.js.map +1 -1
  57. package/dist/components/conversation/conversation-surface.js.map +1 -1
  58. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  59. package/dist/components/conversation/message-composer.js.map +1 -1
  60. package/dist/components/conversation/message-row.js.map +1 -1
  61. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  62. package/dist/components/conversation/thread-panel.js.map +1 -1
  63. package/dist/components/conversation/transcript-composition.js.map +1 -1
  64. package/dist/components/layout/app-shell/app-shell.js.map +1 -1
  65. package/dist/components/layout/app-shell/skip-link.js.map +1 -1
  66. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
  67. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js.map +1 -1
  68. package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
  69. package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
  70. package/dist/components/layout/page/page.js.map +1 -1
  71. package/dist/components/layout/panel/panel.js.map +1 -1
  72. package/dist/components/layout/pixel-pane/pixel-pane.js.map +1 -1
  73. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  74. package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
  75. package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
  76. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  77. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js.map +1 -1
  78. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  79. package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
  80. package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
  81. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  82. package/dist/components/layout/status-bar/status-bar.js.map +1 -1
  83. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  84. package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
  85. package/dist/components/motion/presence.js.map +1 -1
  86. package/dist/components/theme/appearance-panel.js.map +1 -1
  87. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  88. package/dist/components/theme/theme-picker.js.map +1 -1
  89. package/dist/components/theme/theme-provider.js.map +1 -1
  90. package/dist/components/theme/theme-toggle.js.map +1 -1
  91. package/dist/components/ui/accordion/accordion.js.map +1 -1
  92. package/dist/components/ui/alert/alert.js.map +1 -1
  93. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  94. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  95. package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
  96. package/dist/components/ui/attachment/attachment.js.map +1 -1
  97. package/dist/components/ui/avatar/avatar.js.map +1 -1
  98. package/dist/components/ui/badge/badge.js.map +1 -1
  99. package/dist/components/ui/board/board.js.map +1 -1
  100. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  101. package/dist/components/ui/bubble/bubble.js.map +1 -1
  102. package/dist/components/ui/button/button.js.map +1 -1
  103. package/dist/components/ui/button-group/button-group.js.map +1 -1
  104. package/dist/components/ui/calendar/calendar.js.map +1 -1
  105. package/dist/components/ui/callout/callout.js.map +1 -1
  106. package/dist/components/ui/card/card.js.map +1 -1
  107. package/dist/components/ui/carousel/carousel.js.map +1 -1
  108. package/dist/components/ui/chart/chart.js.map +1 -1
  109. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  110. package/dist/components/ui/code-block/code-block.js.map +1 -1
  111. package/dist/components/ui/collapsible/collapsible.js.map +1 -1
  112. package/dist/components/ui/combobox/combobox.js.map +1 -1
  113. package/dist/components/ui/combobox/value-combobox.js.map +1 -1
  114. package/dist/components/ui/command/command.js.map +1 -1
  115. package/dist/components/ui/context-menu/context-menu.js.map +1 -1
  116. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
  117. package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
  118. package/dist/components/ui/dialog/dialog.js.map +1 -1
  119. package/dist/components/ui/diff-block/diff-block.js.map +1 -1
  120. package/dist/components/ui/drawer/drawer.js.map +1 -1
  121. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  122. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
  123. package/dist/components/ui/empty/empty-state.js.map +1 -1
  124. package/dist/components/ui/empty/empty.js.map +1 -1
  125. package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
  126. package/dist/components/ui/field/field.js.map +1 -1
  127. package/dist/components/ui/field/number-field.js.map +1 -1
  128. package/dist/components/ui/hover-card/hover-card.js.map +1 -1
  129. package/dist/components/ui/input/input-control.js.map +1 -1
  130. package/dist/components/ui/input/input.js.map +1 -1
  131. package/dist/components/ui/input-group/input-group.js.map +1 -1
  132. package/dist/components/ui/input-group/secret-input-group.js.map +1 -1
  133. package/dist/components/ui/input-otp/input-otp.js.map +1 -1
  134. package/dist/components/ui/item/item.js.map +1 -1
  135. package/dist/components/ui/kbd/kbd.js.map +1 -1
  136. package/dist/components/ui/label/label.js.map +1 -1
  137. package/dist/components/ui/marker/marker.js.map +1 -1
  138. package/dist/components/ui/menubar/menubar.js.map +1 -1
  139. package/dist/components/ui/message/message.js.map +1 -1
  140. package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
  141. package/dist/components/ui/native-select/native-select.js.map +1 -1
  142. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  143. package/dist/components/ui/pagination/pagination.js.map +1 -1
  144. package/dist/components/ui/popover/popover.js.map +1 -1
  145. package/dist/components/ui/progress/progress.js.map +1 -1
  146. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  147. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  148. package/dist/components/ui/resizable/resizable.js.map +1 -1
  149. package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
  150. package/dist/components/ui/select/select.js.map +1 -1
  151. package/dist/components/ui/separator/separator.js.map +1 -1
  152. package/dist/components/ui/sheet/sheet.js.map +1 -1
  153. package/dist/components/ui/skeleton/skeleton.js.map +1 -1
  154. package/dist/components/ui/slider/slider.js.map +1 -1
  155. package/dist/components/ui/spinner/spinner.js.map +1 -1
  156. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  157. package/dist/components/ui/switch/switch.js.map +1 -1
  158. package/dist/components/ui/table/table.js.map +1 -1
  159. package/dist/components/ui/tabs/tabs.js.map +1 -1
  160. package/dist/components/ui/text-link/text-link.js.map +1 -1
  161. package/dist/components/ui/textarea/textarea.js.map +1 -1
  162. package/dist/components/ui/toast/toast.js.map +1 -1
  163. package/dist/components/ui/toggle/toggle.js.map +1 -1
  164. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
  165. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  166. package/dist/components/ui/trace/trace.js.map +1 -1
  167. package/dist/components/ui/typography/typography.js.map +1 -1
  168. package/dist/r/about-dialog.json +1 -1
  169. package/dist/r/accordion.json +1 -1
  170. package/dist/r/account-menu.json +1 -1
  171. package/dist/r/alert.json +1 -1
  172. package/dist/r/appearance-editor.json +1 -1
  173. package/dist/r/attachment.json +1 -1
  174. package/dist/r/breadcrumb.json +1 -1
  175. package/dist/r/calendar.json +1 -1
  176. package/dist/r/carousel.json +1 -1
  177. package/dist/r/catalog-browser.json +1 -1
  178. package/dist/r/chain-of-thought.json +1 -1
  179. package/dist/r/chat.json +1 -1
  180. package/dist/r/checkbox.json +1 -1
  181. package/dist/r/checkpoint.json +1 -1
  182. package/dist/r/code-block.json +1 -1
  183. package/dist/r/combobox.json +1 -1
  184. package/dist/r/command.json +1 -1
  185. package/dist/r/confirmation.json +1 -1
  186. package/dist/r/context.json +1 -1
  187. package/dist/r/conversation.json +1 -1
  188. package/dist/r/detail-panel.json +1 -1
  189. package/dist/r/dialog.json +1 -1
  190. package/dist/r/dropdown-menu.json +1 -1
  191. package/dist/r/empty.json +1 -1
  192. package/dist/r/file-tree.json +1 -1
  193. package/dist/r/floating-preview.json +1 -1
  194. package/dist/r/help-center.json +1 -1
  195. package/dist/r/icon-picker.json +1 -1
  196. package/dist/r/inline-citation.json +1 -1
  197. package/dist/r/lib.json +1 -1
  198. package/dist/r/message-scroller.json +1 -1
  199. package/dist/r/model-selector.json +1 -1
  200. package/dist/r/native-select.json +1 -1
  201. package/dist/r/navigation-menu.json +1 -1
  202. package/dist/r/pagination.json +1 -1
  203. package/dist/r/pixel-resize-handle.json +1 -1
  204. package/dist/r/plan.json +1 -1
  205. package/dist/r/questionnaire.json +1 -1
  206. package/dist/r/queue.json +1 -1
  207. package/dist/r/radio-group.json +1 -1
  208. package/dist/r/reasoning.json +1 -1
  209. package/dist/r/registry.json +65 -65
  210. package/dist/r/resizable.json +1 -1
  211. package/dist/r/scene-controls.json +1 -1
  212. package/dist/r/select.json +1 -1
  213. package/dist/r/settings.json +1 -1
  214. package/dist/r/sheet.json +1 -1
  215. package/dist/r/shell-rail.json +1 -1
  216. package/dist/r/sidebar-nav.json +1 -1
  217. package/dist/r/sources.json +1 -1
  218. package/dist/r/spinner.json +1 -1
  219. package/dist/r/split-layout.json +1 -1
  220. package/dist/r/src/components/composites/model-selector/model-selector.tsx +4 -1
  221. package/dist/r/stack-trace.json +1 -1
  222. package/dist/r/stat.json +1 -1
  223. package/dist/r/subagent.json +1 -1
  224. package/dist/r/task.json +1 -1
  225. package/dist/r/terminal.json +1 -1
  226. package/dist/r/test-results.json +1 -1
  227. package/dist/r/theming.json +1 -1
  228. package/dist/r/toast.json +1 -1
  229. package/dist/r/tool.json +1 -1
  230. package/dist/r/top-bar.json +1 -1
  231. package/dist/r/trace.json +1 -1
  232. package/dist/r/tree.json +1 -1
  233. package/dist/r/update-dialog.json +1 -1
  234. package/dist/r/workspace-switcher.json +1 -1
  235. package/package.json +11 -11
  236. package/registry.json +65 -65
  237. package/src/components/composites/model-selector/model-selector.tsx +4 -1
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","names":["Switch","KobalteSwitch","ComponentProps","JSX","splitProps","useFormFieldControl","cn","SwitchProps","Omit","inputId","controlClass","thumbClass","labelClass","descriptionClass","label","Element","description","children","props","local","rest","field","id","_$createComponent","_$mergeProps","undefined","title","class","Input","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","aria-busy","Control","Thumb","_$memo","_el$","_tmpl$","_$insert","_c$","Label","_c$2","Description","SwitchLabel","SwitchDescription","Switch","_$createComponent","KobalteSwitch","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/switch/switch.tsx"],"sourcesContent":["import { Switch as KobalteSwitch } from '@kobalte/core/switch'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Switch.\n *\n * For a setting that takes effect the moment it is flipped. The distinction\n * from Checkbox is behaviour, not looks: a switch applies immediately and\n * belongs in a settings row, while a checkbox is a value the user is still\n * composing and is applied when a form is submitted. A switch inside an unsaved\n * form is the mistake this split exists to prevent.\n *\n * `Switch.Input` renders a real hidden checkbox, so the control is\n * form-native, keyboard-operable, and its `aria-checked` follows the state the\n * user sees.\n */\nexport type SwitchProps = Omit<ComponentProps<typeof KobalteSwitch>, 'children'> & {\n /** ID for the hidden native switch input; useful with an external label. */\n inputId?: string\n controlClass?: string\n thumbClass?: string\n labelClass?: string\n descriptionClass?: string\n label?: JSX.Element\n description?: JSX.Element\n /**\n * Replaces the control and label. Omit it to get the default control beside\n * `label` and `description`; supply it to compose the parts yourself.\n */\n children?: JSX.Element\n}\n\nexport function Switch(props: SwitchProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'controlClass',\n 'thumbClass',\n 'labelClass',\n 'descriptionClass',\n 'children',\n 'label',\n 'description',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n 'aria-busy',\n 'id',\n 'inputId',\n 'title',\n ])\n const field = useFormFieldControl('control', {\n id: local.inputId ?? local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <KobalteSwitch\n data-slot=\"switch\"\n id={field ? undefined : local.id}\n title={local.title}\n class={cn('group/switch flex items-center gap-2.5', local.class)}\n {...rest}\n >\n {/* The name belongs on the input; see Checkbox for why. */}\n <KobalteSwitch.Input\n id={field?.id ?? local.inputId}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n aria-busy={local['aria-busy']}\n title={local.title}\n />\n <KobalteSwitch.Control\n class={cn(\n 'bg-input inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent',\n 'transition-colors ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:bg-primary',\n 'data-[invalid]:border-destructive',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.controlClass\n )}\n >\n <KobalteSwitch.Thumb\n class={cn(\n 'bg-background pointer-events-none block size-4 rounded-full shadow-xs',\n 'transition-transform ease-out',\n 'data-[checked]:translate-x-4',\n local.thumbClass\n )}\n />\n </KobalteSwitch.Control>\n {local.children ??\n (local.label || local.description ? (\n <div class=\"grid gap-0.5\">\n {local.label ? (\n <KobalteSwitch.Label class={cn('text-sm leading-none font-medium', local.labelClass)}>\n {local.label}\n </KobalteSwitch.Label>\n ) : null}\n {local.description ? (\n <KobalteSwitch.Description\n class={cn('text-muted-foreground text-sm', local.descriptionClass)}\n >\n {local.description}\n </KobalteSwitch.Description>\n ) : null}\n </div>\n ) : null)}\n </KobalteSwitch>\n )\n}\n\n/**\n * The switch's own label. Valid only inside a `<Switch>`: it is Kobalte's label\n * for that root's control, and outside one there is nothing to associate with.\n * A label drawn *beside* a switch — a settings row with the control trailing —\n * is plain text, and the switch takes an `aria-label` instead.\n */\nexport function SwitchLabel(props: ComponentProps<typeof KobalteSwitch.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteSwitch.Label class={cn('text-sm leading-none font-medium', local.class)} {...rest} />\n )\n}\n\nexport function SwitchDescription(props: ComponentProps<typeof KobalteSwitch.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteSwitch.Description class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n )\n}\n"],"mappings":";;;;;;;AAmCA,SAAgBA,SAAOkB,OAAoB;CACzC,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CACD,MAAMG,QAAQhB,oBAAoB,WAAW;EAC3CiB,IAAIH,MAAMV,WAAWU,MAAMG;EAC3B,cAAcH,MAAM;EACpB,mBAAmBA,MAAM;EACzB,oBAAoBA,MAAM;EAC1B,gBAAgBA,MAAM;EACtB,qBAAqBA,MAAM;CAC7B,CAAC;CAED,OAAAI,gBACGtB,UAAauB,WAAA;EAAA,aAAA;EAAA,IAEZF,KAAE;GAAA,OAAED,QAAQI,KAAAA,IAAYN,MAAMG;EAAE;EAAA,IAChCI,QAAK;GAAA,OAAEP,MAAMO;EAAK;EAAA,KAAA,WAAA;GAAA,OACXpB,GAAG,0CAA0Ca,MAAMQ,KAAK;EAAC;CAAA,GAC5DP,MAAI,EAAA,IAAAH,WAAA;EAAA,OAAA;GAAAM,gBAGPtB,SAAc2B,OAAK;IAAA,IAClBN,KAAE;KAAA,OAAED,OAAOC,MAAMH,MAAMV;IAAO;IAAA,KAAA,gBAAA;KAAA,OAClBU,MAAM;IAAa;IAAA,KAAA,qBAAA;KAAA,OACdE,QAAQ,sBAAsBF,MAAM;IAAkB;IAAA,KAAA,sBAAA;KAAA,OACrDE,QAAQ,uBAAuBF,MAAM;IAAmB;IAAA,KAAA,kBAAA;KAAA,OAC5DE,QAAQ,mBAAmBF,MAAM;IAAe;IAAA,KAAA,uBAAA;KAAA,OAC3CE,QAAQ,wBAAwBF,MAAM;IAAoB;IAAA,KAAA,eAAA;KAAA,OAClEA,MAAM;IAAY;IAAA,IAC7BO,Q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AAA;EAAA,OAAQlB,GAAG,oCAAoCa,MAAMQ,KAAK;CAAC,EAAA,GAAMP,IAAI,CAAA;AAE7F;AAEA,SAAgB0B,kBAAkB5B,OAAyD;CACzF,MAAM,CAACC,OAAOC,QAAQhB,WAAWc,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAK,gBACGtB,SAAc2C,aAAWpB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQlB,GAAG,iCAAiCa,MAAMQ,KAAK;CAAC,EAAA,GAAMP,IAAI,CAAA;AAEhG"}
1
+ {"version":3,"file":"switch.js","names":["Switch","KobalteSwitch","splitProps","useFormFieldControl","cn","inputId","controlClass","thumbClass","labelClass","descriptionClass","label","description","children","props","local","rest","field","id","_$createComponent","_$mergeProps","undefined","title","class","Input","Control","Thumb","_$memo","_el$","_tmpl$","_$insert","_c$","Label","_c$2","Description","SwitchLabel","SwitchDescription"],"sources":["../../../../src/components/ui/switch/switch.tsx"],"sourcesContent":["import { Switch as KobalteSwitch } from '@kobalte/core/switch'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\n/**\n * Switch.\n *\n * For a setting that takes effect the moment it is flipped. The distinction\n * from Checkbox is behaviour, not looks: a switch applies immediately and\n * belongs in a settings row, while a checkbox is a value the user is still\n * composing and is applied when a form is submitted. A switch inside an unsaved\n * form is the mistake this split exists to prevent.\n *\n * `Switch.Input` renders a real hidden checkbox, so the control is\n * form-native, keyboard-operable, and its `aria-checked` follows the state the\n * user sees.\n */\nexport type SwitchProps = Omit<ComponentProps<typeof KobalteSwitch>, 'children'> & {\n /** ID for the hidden native switch input; useful with an external label. */\n inputId?: string\n controlClass?: string\n thumbClass?: string\n labelClass?: string\n descriptionClass?: string\n label?: JSX.Element\n description?: JSX.Element\n /**\n * Replaces the control and label. Omit it to get the default control beside\n * `label` and `description`; supply it to compose the parts yourself.\n */\n children?: JSX.Element\n}\n\nexport function Switch(props: SwitchProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'controlClass',\n 'thumbClass',\n 'labelClass',\n 'descriptionClass',\n 'children',\n 'label',\n 'description',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n 'aria-busy',\n 'id',\n 'inputId',\n 'title',\n ])\n const field = useFormFieldControl('control', {\n id: local.inputId ?? local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <KobalteSwitch\n data-slot=\"switch\"\n id={field ? undefined : local.id}\n title={local.title}\n class={cn('group/switch flex items-center gap-2.5', local.class)}\n {...rest}\n >\n {/* The name belongs on the input; see Checkbox for why. */}\n <KobalteSwitch.Input\n id={field?.id ?? local.inputId}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n aria-busy={local['aria-busy']}\n title={local.title}\n />\n <KobalteSwitch.Control\n class={cn(\n 'bg-input inline-flex h-5 w-9 shrink-0 items-center rounded-full border border-transparent',\n 'transition-colors ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'data-[checked]:bg-primary',\n 'data-[invalid]:border-destructive',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50',\n local.controlClass\n )}\n >\n <KobalteSwitch.Thumb\n class={cn(\n 'bg-background pointer-events-none block size-4 rounded-full shadow-xs',\n 'transition-transform ease-out',\n 'data-[checked]:translate-x-4',\n local.thumbClass\n )}\n />\n </KobalteSwitch.Control>\n {local.children ??\n (local.label || local.description ? (\n <div class=\"grid gap-0.5\">\n {local.label ? (\n <KobalteSwitch.Label class={cn('text-sm leading-none font-medium', local.labelClass)}>\n {local.label}\n </KobalteSwitch.Label>\n ) : null}\n {local.description ? (\n <KobalteSwitch.Description\n class={cn('text-muted-foreground text-sm', local.descriptionClass)}\n >\n {local.description}\n </KobalteSwitch.Description>\n ) : null}\n </div>\n ) : null)}\n </KobalteSwitch>\n )\n}\n\n/**\n * The switch's own label. Valid only inside a `<Switch>`: it is Kobalte's label\n * for that root's control, and outside one there is nothing to associate with.\n * A label drawn *beside* a switch — a settings row with the control trailing —\n * is plain text, and the switch takes an `aria-label` instead.\n */\nexport function SwitchLabel(props: ComponentProps<typeof KobalteSwitch.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteSwitch.Label class={cn('text-sm leading-none font-medium', local.class)} {...rest} />\n )\n}\n\nexport function SwitchDescription(props: ComponentProps<typeof KobalteSwitch.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteSwitch.Description class={cn('text-muted-foreground text-sm', local.class)} {...rest} />\n )\n}\n"],"mappings":";;;;;;;AAmCA,SAAgBA,SAAOa,OAAoB;CACzC,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAO,CACR;CACD,MAAMG,QAAQb,oBAAoB,WAAW;EAC3Cc,IAAIH,MAAMT,WAAWS,MAAMG;EAC3B,cAAcH,MAAM;EACpB,mBAAmBA,MAAM;EACzB,oBAAoBA,MAAM;EAC1B,gBAAgBA,MAAM;EACtB,qBAAqBA,MAAM;CAC7B,CAAC;CAED,OAAAI,gBACGjB,UAAakB,WAAA;EAAA,aAAA;EAAA,IAEZF,KAAE;GAAA,OAAED,QAAQI,KAAAA,IAAYN,MAAMG;EAAE;EAAA,IAChCI,QAAK;GAAA,OAAEP,MAAMO;EAAK;EAAA,KAAA,WAAA;GAAA,OACXjB,GAAG,0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;IAAAmB,OAAAF,aAAA;KAAA,IAAAK,OAAAN,WAAA,CAAA,CACPZ,MAAMH,WAAW;KAAA,aAAjBqB,KAAA,IAAAd,gBACEjB,SAAcgC,aAAW;MAAA,KAAA,WAAA;OAAA,OACjB7B,GAAG,iCAAiCU,MAAML,gBAAgB;MAAC;MAAA,IAAAG,WAAA;OAAA,OAEjEE,MAAMH;MAAW;KAAA,CAAA,IAElB;IAAI,EAAA,CAAA,GAAA,IAAA;IAAA,OAAAgB;GAAA,EAAA,CAAA,IAER,KAAK;EAAA;CAAA,EAAA,CAAA,CAAA;AAGjB;;;;;;;AAQA,SAAgBO,YAAYrB,OAAmD;CAC7E,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAK,gBACGjB,SAAc8B,OAAKZ,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQf,GAAG,oCAAoCU,MAAMQ,KAAK;CAAC,EAAA,GAAMP,IAAI,CAAA;AAE7F;AAEA,SAAgBoB,kBAAkBtB,OAAyD;CACzF,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAK,gBACGjB,SAAcgC,aAAWd,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQf,GAAG,iCAAiCU,MAAMQ,KAAK;CAAC,EAAA,GAAMP,IAAI,CAAA;AAEhG"}
@@ -1 +1 @@
1
- {"version":3,"file":"table.js","names":["ComponentProps","splitProps","cn","Table","props","local","rest","_el$","_tmpl$","_el$2","firstChild","_$spread","_$mergeProps","class","TableHeader","_el$3","_tmpl$2","TableBody","_el$4","_tmpl$3","TableFooter","_el$5","_tmpl$4","TableRow","_el$6","_tmpl$5","TableHead","_el$7","_tmpl$6","scope","TableCell","_el$8","_tmpl$7","TableNumericCell","_el$9","TableCaption","_el$0","_tmpl$8","_$mergeProps"],"sources":["../../../../src/components/ui/table/table.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Table.\n *\n * Semantic markup, not a grid of divs. A `<table>` with a caption, a header\n * scope and cells is navigable by a screen reader in ways a flex layout cannot\n * be reproduced into, and it is what makes \"row 3 of 12, Name column\" work.\n *\n * Two decisions worth keeping:\n *\n * - The header is sticky by default. A scrollable table whose header leaves\n * the viewport makes every row below it anonymous.\n * - Numbers are right-aligned and tabular. `text-end` plus `tabular-nums` is\n * what lets a column of figures be compared by eye; a proportional font\n * with ragged digits is unreadable at a glance.\n *\n * `TableNumericCell` exists so callers do not have to remember the second\n * half of that rule.\n */\nexport function Table(props: ComponentProps<'table'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <div data-slot=\"table-container\" class=\"relative w-full overflow-x-auto\">\n <table data-slot=\"table\" class={cn('w-full caption-bottom text-sm', local.class)} {...rest} />\n </div>\n )\n}\n\nexport function TableHeader(props: ComponentProps<'thead'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <thead\n data-slot=\"table-header\"\n class={cn(\n '[&_tr]:border-b [&_tr]:border-border sticky top-0 z-(--z-docked) bg-background',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function TableBody(props: ComponentProps<'tbody'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <tbody data-slot=\"table-body\" class={cn('[&_tr:last-child]:border-0', local.class)} {...rest} />\n )\n}\n\nexport function TableFooter(props: ComponentProps<'tfoot'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <tfoot\n data-slot=\"table-footer\"\n class={cn(\n 'bg-surface-hover border-t border-border font-medium [&>tr]:last:border-b-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function TableRow(props: ComponentProps<'tr'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <tr\n data-slot=\"table-row\"\n class={cn(\n 'border-b border-border transition-colors ease-out',\n 'hover:bg-surface-hover data-[state=selected]:bg-primary-subtle',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function TableHead(props: ComponentProps<'th'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <th\n data-slot=\"table-head\"\n scope={props.scope ?? 'col'}\n class={cn(\n 'text-muted-foreground h-9 px-3 text-start align-middle text-xs font-medium whitespace-nowrap',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function TableCell(props: ComponentProps<'td'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <td data-slot=\"table-cell\" class={cn('px-3 py-2 align-middle', local.class)} {...rest} />\n}\n\nexport function TableNumericCell(props: ComponentProps<'td'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <td\n data-slot=\"table-cell\"\n class={cn('px-3 py-2 text-end align-middle tabular-nums', local.class)}\n {...rest}\n />\n )\n}\n\nexport function TableCaption(props: ComponentProps<'caption'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <caption\n data-slot=\"table-caption\"\n class={cn('text-muted-foreground mt-3 text-sm', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgBG,MAAMC,OAAgC;CACpD,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAAG,OAAAC,OAAA,GAAAC,QAAAF,KAAAG;EAAAC,OAAAF,OAAAG,WAAA,EAAA,KAAA,WAAA;GAAA,OAEoCV,GAAG,iCAAiCG,MAAMQ,KAAK;EAAC,EAAA,GAAMP,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAGhG;AAEA,SAAgBO,YAAYV,OAAgC;CAC1D,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAW,QAAAC,QAAA;EAAAL,OAAAI,OAAAH,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWV,GACL,kFACAG,MAAMQ,KACR;EAAC,EAAA,GACGP,IAAI,G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,KACR;GAAC;EAAA,GACGP,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAqB;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBG,UAAU1B,OAA6B;CACrD,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAA2B,QAAAC,QAAA;EAAArB,OAAAoB,OAAAnB,WAAA,EAAA,KAAA,WAAA;GAAA,OAAyCV,GAAG,0BAA0BG,MAAMQ,KAAK;EAAC,EAAA,GAAMP,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAyB;CAAA,EAAA,CAAA;AAC9F;AAEA,SAAgBE,iBAAiB7B,OAA6B;CAC5D,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAA8B,QAAAF,QAAA;EAAArB,OAAAuB,OAAAtB,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWV,GAAG,gDAAgDG,MAAMQ,KAAK;EAAC,EAAA,GAClEP,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA4B;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBC,aAAa/B,OAAkC;CAC7D,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAAgC,QAAAC,QAAA;EAAA1B,OAAAyB,OAAAxB,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWV,GAAG,sCAAsCG,MAAMQ,KAAK;EAAC,EAAA,GACxDP,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA8B;CAAA,EAAA,CAAA;AAGd"}
1
+ {"version":3,"file":"table.js","names":["splitProps","cn","Table","props","local","rest","_el$","_tmpl$","_el$2","firstChild","_$spread","_$mergeProps","class","TableHeader","_el$3","_tmpl$2","TableBody","_el$4","_tmpl$3","TableFooter","_el$5","_tmpl$4","TableRow","_el$6","_tmpl$5","TableHead","_el$7","_tmpl$6","scope","TableCell","_el$8","_tmpl$7","TableNumericCell","_el$9","TableCaption","_el$0","_tmpl$8"],"sources":["../../../../src/components/ui/table/table.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Table.\n *\n * Semantic markup, not a grid of divs. A `<table>` with a caption, a header\n * scope and cells is navigable by a screen reader in ways a flex layout cannot\n * be reproduced into, and it is what makes \"row 3 of 12, Name column\" work.\n *\n * Two decisions worth keeping:\n *\n * - The header is sticky by default. A scrollable table whose header leaves\n * the viewport makes every row below it anonymous.\n * - Numbers are right-aligned and tabular. `text-end` plus `tabular-nums` is\n * what lets a column of figures be compared by eye; a proportional font\n * with ragged digits is unreadable at a glance.\n *\n * `TableNumericCell` exists so callers do not have to remember the second\n * half of that rule.\n */\nexport function Table(props: ComponentProps<'table'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <div data-slot=\"table-container\" class=\"relative w-full overflow-x-auto\">\n <table data-slot=\"table\" class={cn('w-full caption-bottom text-sm', local.class)} {...rest} />\n </div>\n )\n}\n\nexport function TableHeader(props: ComponentProps<'thead'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <thead\n data-slot=\"table-header\"\n class={cn(\n '[&_tr]:border-b [&_tr]:border-border sticky top-0 z-(--z-docked) bg-background',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function TableBody(props: ComponentProps<'tbody'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <tbody data-slot=\"table-body\" class={cn('[&_tr:last-child]:border-0', local.class)} {...rest} />\n )\n}\n\nexport function TableFooter(props: ComponentProps<'tfoot'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <tfoot\n data-slot=\"table-footer\"\n class={cn(\n 'bg-surface-hover border-t border-border font-medium [&>tr]:last:border-b-0',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function TableRow(props: ComponentProps<'tr'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <tr\n data-slot=\"table-row\"\n class={cn(\n 'border-b border-border transition-colors ease-out',\n 'hover:bg-surface-hover data-[state=selected]:bg-primary-subtle',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function TableHead(props: ComponentProps<'th'>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <th\n data-slot=\"table-head\"\n scope={props.scope ?? 'col'}\n class={cn(\n 'text-muted-foreground h-9 px-3 text-start align-middle text-xs font-medium whitespace-nowrap',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function TableCell(props: ComponentProps<'td'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <td data-slot=\"table-cell\" class={cn('px-3 py-2 align-middle', local.class)} {...rest} />\n}\n\nexport function TableNumericCell(props: ComponentProps<'td'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <td\n data-slot=\"table-cell\"\n class={cn('px-3 py-2 text-end align-middle tabular-nums', local.class)}\n {...rest}\n />\n )\n}\n\nexport function TableCaption(props: ComponentProps<'caption'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <caption\n data-slot=\"table-caption\"\n class={cn('text-muted-foreground mt-3 text-sm', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,SAAgBE,MAAMC,OAAgC;CACpD,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CAEjD,cAAA;EAAA,IAAAG,OAAAC,OAAA,GAAAC,QAAAF,KAAAG;EAAAC,OAAAF,OAAAG,WAAA,EAAA,KAAA,WAAA;GAAA,OAEoCV,GAAG,iCAAiCG,MAAMQ,KAAK;EAAC,EAAA,GAAMP,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAGhG;AAEA,SAAgBO,YAAYV,OAAgC;CAC1D,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,OAAO,CAAC;CACjD,cAAA;EAAA,IAAA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al","createUniqueId","onCleanup","splitProps","useContext","cn","TabsIdContextValue","id","orientation","triggerIds","ReadonlyMap","registerTriggerId","value","unregisterTriggerId","TabsIdContext","useTabsId","tabs","Error","props","local","rest","generatedId","setTriggerIds","Map","triggerId","current","set","get","next","delete","_$createComponent","Provider","children","_$mergeProps","class","TabsListProps","List","appearance","fill","scrollable","TabsList","underline","TabsTriggerProps","Trigger","TabsTrigger","TabsContent","Content","aria-labelledby","Tabs","_$createComponent","KobalteTabs","_$mergeProps"],"sources":["../../../../src/components/ui/tabs/tabs.tsx"],"sourcesContent":["import { Tabs as KobalteTabs } from '@kobalte/core/tabs'\nimport type { Accessor, ComponentProps } from 'solid-js'\nimport {\n createContext,\n createRenderEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n splitProps,\n useContext,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\n\ntype TabsIdContextValue = {\n id: Accessor<string>\n orientation: Accessor<'horizontal' | 'vertical'>\n triggerIds: Accessor<ReadonlyMap<string, string>>\n registerTriggerId: (value: string, id: string) => void\n unregisterTriggerId: (value: string, id: string) => void\n}\n\nconst TabsIdContext = createContext<TabsIdContextValue>()\n\nfunction useTabsId() {\n const tabs = useContext(TabsIdContext)\n if (!tabs) throw new Error('[adea-ui]: Tabs parts must be used within Tabs.')\n return tabs\n}\n\n/**\n * Tabs.\n *\n * For switching between sibling views of the *same* subject — a file's code,\n * diff and history. Not for moving between pages: a tab is expected to keep\n * its panel and its scroll position, which a route does not.\n *\n * `appearance=\"segmented\"` gives the joined bar KiroCrew uses inside a pane\n * where a full-width underline would collide with the panel's own header rule.\n */\nexport function Tabs(props: ComponentProps<typeof KobalteTabs>) {\n const [local, rest] = splitProps(props, ['class', 'id'])\n const generatedId = `tabs-${createUniqueId()}`\n const id = () => local.id ?? generatedId\n const [triggerIds, setTriggerIds] = createSignal<ReadonlyMap<string, string>>(new Map())\n const tabs: TabsIdContextValue = {\n id,\n orientation: () => rest.orientation ?? 'horizontal',\n triggerIds,\n registerTriggerId: (value, triggerId) => {\n setTriggerIds((current) => new Map(current).set(value, triggerId))\n },\n unregisterTriggerId: (value, triggerId) => {\n setTriggerIds((current) => {\n if (current.get(value) !== triggerId) return current\n const next = new Map(current)\n next.delete(value)\n return next\n })\n },\n }\n\n return (\n <TabsIdContext.Provider value={tabs}>\n <KobalteTabs\n data-slot=\"tabs\"\n id={id()}\n class={cn(\n 'flex min-h-0 min-w-0 flex-col gap-2 data-[orientation=vertical]:flex-row',\n local.class\n )}\n {...rest}\n />\n </TabsIdContext.Provider>\n )\n}\n\nexport type TabsListProps = ComponentProps<typeof KobalteTabs.List> & {\n appearance?: 'underline' | 'segmented'\n /**\n * Span the container, with the triggers at the start. For a row of tabs that\n * heads a pane: the underline's rule then runs the pane's full width, the\n * way the pane's other header rules do, instead of stopping at the last tab.\n */\n fill?: boolean\n /**\n * Scroll sideways when the triggers outgrow the row, with no visible\n * scrollbar, instead of overflowing it. Implies `fill`. The underline's rule\n * is drawn inside the scroller so the selected mark still sits on it.\n */\n scrollable?: boolean\n}\n\n/**\n * The underline appearance's rule is the baseline a horizontal row of tabs sits\n * on. A vertical list has no baseline — its triggers stack — so the rule is\n * dropped there; otherwise it draws as a stray line under the last trigger,\n * spanning only the list's width (the SettingsLayout rail showed exactly that).\n *\n * A scrolling list cannot draw that rule as its border: a scroller clips at its\n * padding edge, and the selected trigger's mark overlaps the border by a pixel\n * (`-mb-px`), so the mark would be cut off and the list would scroll vertically\n * by that pixel. It reserves the pixel as padding instead and paints the rule\n * there with an inset shadow, which lands exactly where the border was.\n */\nexport function TabsList(props: TabsListProps) {\n const [local, rest] = splitProps(props, ['class', 'appearance', 'fill', 'scrollable'])\n const underline = () => local.appearance !== 'segmented'\n\n return (\n <KobalteTabs.List\n data-slot=\"tabs-list\"\n class={cn(\n 'shrink-0 items-center',\n local.fill || local.scrollable\n ? 'flex w-full justify-start'\n : 'inline-flex w-fit justify-center',\n local.scrollable && 'no-scrollbar overflow-x-auto overflow-y-hidden',\n !underline()\n ? 'gap-0.5 rounded-lg bg-surface-hover p-0.5'\n : local.scrollable\n ? 'gap-1 rounded-none pb-px shadow-[inset_0_-1px_0_var(--border)] data-[orientation=vertical]:pb-0 data-[orientation=vertical]:shadow-none'\n : 'gap-1 rounded-none border-b border-border data-[orientation=vertical]:border-b-0',\n 'data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type TabsTriggerProps = ComponentProps<typeof KobalteTabs.Trigger> & {\n appearance?: 'underline' | 'segmented'\n}\n\n/**\n * The underline appearance marks the selected trigger on the edge it shares\n * with the list's axis. A horizontal row reads left to right along a baseline,\n * so the mark is a bottom bar sitting on the list's rule. A vertical list stacks\n * its triggers, and a bottom bar there underlines one row of a column — it reads\n * as a divider, not a selection — so the mark moves to the inline-start edge,\n * the leading bar a side navigation uses, and the label aligns to that edge.\n *\n * The orientation is read from the root rather than from a `data-orientation`\n * selector so the vertical classes are unprefixed: a composite that replaces the\n * mark (SettingsNavigation's filled row passes `border-0`) then overrides it\n * through the ordinary class merge instead of fighting a variant-scoped border.\n */\nexport function TabsTrigger(props: TabsTriggerProps) {\n const [local, rest] = splitProps(props, ['class', 'appearance', 'id'])\n const tabs = useTabsId()\n const triggerId = () => local.id ?? `${tabs.id()}-trigger-${rest.value}`\n\n // Register before panels render, including SSR where createEffect is skipped.\n createRenderEffect(() => {\n const value = rest.value\n const id = triggerId()\n tabs.registerTriggerId(value, id)\n onCleanup(() => tabs.unregisterTriggerId(value, id))\n })\n\n return (\n <KobalteTabs.Trigger\n data-slot=\"tabs-trigger\"\n id={triggerId()}\n class={cn(\n 'inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap text-sm font-medium',\n 'transition-colors ease-out outline-none select-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'text-foreground',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n local.appearance === 'segmented'\n ? 'h-control-sm rounded-md px-control-sm data-[selected]:bg-primary-subtle data-[selected]:text-foreground'\n : tabs.orientation() === 'vertical'\n ? 'h-control-md justify-start rounded-none border-s-2 border-transparent ps-3 pe-2 data-[selected]:border-primary'\n : 'h-control-md -mb-px rounded-none border-b-2 border-transparent px-2 pb-2 data-[selected]:border-primary',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function TabsContent(props: ComponentProps<typeof KobalteTabs.Content>) {\n const [local, rest] = splitProps(props, ['class', 'aria-labelledby'])\n const tabs = useTabsId()\n return (\n <KobalteTabs.Content\n data-slot=\"tabs-content\"\n aria-labelledby={\n local['aria-labelledby'] ??\n tabs.triggerIds().get(rest.value) ??\n `${tabs.id()}-trigger-${rest.value}`\n }\n class={cn('min-h-0 min-w-0 flex-1 outline-none', local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;AAqBA,IAAMoB,gBAAgBhB,cAAkC;AAExD,SAASiB,YAAY;CACnB,MAAMC,OAAOZ,WAAWU,aAAa;CACrC,IAAI,CAACE,MAAM,MAAM,IAAIC,MAAM,iDAAiD;CAC5E,OAAOD;AACT;;;;;;;;;;;AAYA,SAAgBtB,OAAKwB,OAA2C;CAC9D,MAAM,CAACC,OAAOC,QAAQjB,WAAWe,OAAO,CAAC,SAAS,IAAI,CAAC;CACvD,MAAMG,cAAc,QAAQpB,eAAe;CAC3C,MAAMM,WAAWY,MAAMZ,MAAMc;CAC7B,MAAM,CAACZ,YAAYa,iBAAiBtB,6BAA0C,IAAIuB,IAAI,CAAC;CACvF,MAAMP,OAA2B;EAC/BT;EACAC,mBAAmBY,KAAKZ,eAAe;EACvCC;EACAE,oBAAoBC,OAAOY,cAAc;GACvCF,eAAeG,YAAY,IAAIF,IAAIE,OAAO,CAAC,CAACC,IAAId,OAAOY,SAAS,CAAC;EACnE;EACAX,sBAAsBD,OAAOY,cAAc;GACzCF,eAAeG,YAAY;IACzB,IAAIA,QAAQE,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,OAAOL,EAAE,CAAC;CACrD,CAAC;CAED,OAAAuB,gBACGnC,KAAYgD,SAAOV,WAAA;EAAA,aAAA;EAAA,IAElB1B,KAAE;GAAA,OAAEiB,UAAU;EAAC;EAAA,KAAA,WAAA;GAAA,OACRnB,GACL,kGACA,uDACA,oFACA,oDACA,mBACA,+DACAc,MAAMkB,eAAe,cACjB,4GACArB,KAAKR,YAAY,MAAM,aACrB,mHACA,2GACNW,MAAMe,KACR;EAAC;CAAA,GACGd,IAAI,CAAA;AAGd;AAEA,SAAgByB,YAAY3B,OAAmD;CAC7E,MAAM,CAACC,OAAOC,QAAQjB,WAAWe,OAAO,CAAC,SAAS,iBAAiB,CAAC;CACpE,MAAMF,OAAOD,UAAU;CACvB,OAAAe,gBACGnC,KAAYmD,SAAOb,WAAA;EAAA,aAAA;EAAA,KAAA,qBAAA;GAAA,OAGhBd,MAAM,sBACNH,KAAKP,WAAW,CAAC,CAACkB,IAAIP,KAAKR,KAAK,KAChC,GAAGI,KAAKT,GAAG,EAAC,WAAYa,KAAKR;EAAO;EAAA,KAAA,WAAA;GAAA,OAE/BP,GAAG,uCAAuCc,MAAMe,KAAK;EAAC;CAAA,GACzDd,IAAI,CAAA;AAGd"}
1
+ {"version":3,"file":"tabs.js","names":["Tabs","KobalteTabs","createContext","createRenderEffect","createSignal","createUniqueId","onCleanup","splitProps","useContext","cn","id","orientation","triggerIds","registerTriggerId","value","unregisterTriggerId","TabsIdContext","useTabsId","tabs","Error","props","local","rest","generatedId","setTriggerIds","Map","triggerId","current","set","get","next","delete","_$createComponent","Provider","children","_$mergeProps","class","List","appearance","fill","scrollable","TabsList","underline","Trigger","TabsTrigger","TabsContent","Content"],"sources":["../../../../src/components/ui/tabs/tabs.tsx"],"sourcesContent":["import { Tabs as KobalteTabs } from '@kobalte/core/tabs'\nimport type { Accessor, ComponentProps } from 'solid-js'\nimport {\n createContext,\n createRenderEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n splitProps,\n useContext,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\n\ntype TabsIdContextValue = {\n id: Accessor<string>\n orientation: Accessor<'horizontal' | 'vertical'>\n triggerIds: Accessor<ReadonlyMap<string, string>>\n registerTriggerId: (value: string, id: string) => void\n unregisterTriggerId: (value: string, id: string) => void\n}\n\nconst TabsIdContext = createContext<TabsIdContextValue>()\n\nfunction useTabsId() {\n const tabs = useContext(TabsIdContext)\n if (!tabs) throw new Error('[adea-ui]: Tabs parts must be used within Tabs.')\n return tabs\n}\n\n/**\n * Tabs.\n *\n * For switching between sibling views of the *same* subject — a file's code,\n * diff and history. Not for moving between pages: a tab is expected to keep\n * its panel and its scroll position, which a route does not.\n *\n * `appearance=\"segmented\"` gives the joined bar KiroCrew uses inside a pane\n * where a full-width underline would collide with the panel's own header rule.\n */\nexport function Tabs(props: ComponentProps<typeof KobalteTabs>) {\n const [local, rest] = splitProps(props, ['class', 'id'])\n const generatedId = `tabs-${createUniqueId()}`\n const id = () => local.id ?? generatedId\n const [triggerIds, setTriggerIds] = createSignal<ReadonlyMap<string, string>>(new Map())\n const tabs: TabsIdContextValue = {\n id,\n orientation: () => rest.orientation ?? 'horizontal',\n triggerIds,\n registerTriggerId: (value, triggerId) => {\n setTriggerIds((current) => new Map(current).set(value, triggerId))\n },\n unregisterTriggerId: (value, triggerId) => {\n setTriggerIds((current) => {\n if (current.get(value) !== triggerId) return current\n const next = new Map(current)\n next.delete(value)\n return next\n })\n },\n }\n\n return (\n <TabsIdContext.Provider value={tabs}>\n <KobalteTabs\n data-slot=\"tabs\"\n id={id()}\n class={cn(\n 'flex min-h-0 min-w-0 flex-col gap-2 data-[orientation=vertical]:flex-row',\n local.class\n )}\n {...rest}\n />\n </TabsIdContext.Provider>\n )\n}\n\nexport type TabsListProps = ComponentProps<typeof KobalteTabs.List> & {\n appearance?: 'underline' | 'segmented'\n /**\n * Span the container, with the triggers at the start. For a row of tabs that\n * heads a pane: the underline's rule then runs the pane's full width, the\n * way the pane's other header rules do, instead of stopping at the last tab.\n */\n fill?: boolean\n /**\n * Scroll sideways when the triggers outgrow the row, with no visible\n * scrollbar, instead of overflowing it. Implies `fill`. The underline's rule\n * is drawn inside the scroller so the selected mark still sits on it.\n */\n scrollable?: boolean\n}\n\n/**\n * The underline appearance's rule is the baseline a horizontal row of tabs sits\n * on. A vertical list has no baseline — its triggers stack — so the rule is\n * dropped there; otherwise it draws as a stray line under the last trigger,\n * spanning only the list's width (the SettingsLayout rail showed exactly that).\n *\n * A scrolling list cannot draw that rule as its border: a scroller clips at its\n * padding edge, and the selected trigger's mark overlaps the border by a pixel\n * (`-mb-px`), so the mark would be cut off and the list would scroll vertically\n * by that pixel. It reserves the pixel as padding instead and paints the rule\n * there with an inset shadow, which lands exactly where the border was.\n */\nexport function TabsList(props: TabsListProps) {\n const [local, rest] = splitProps(props, ['class', 'appearance', 'fill', 'scrollable'])\n const underline = () => local.appearance !== 'segmented'\n\n return (\n <KobalteTabs.List\n data-slot=\"tabs-list\"\n class={cn(\n 'shrink-0 items-center',\n local.fill || local.scrollable\n ? 'flex w-full justify-start'\n : 'inline-flex w-fit justify-center',\n local.scrollable && 'no-scrollbar overflow-x-auto overflow-y-hidden',\n !underline()\n ? 'gap-0.5 rounded-lg bg-surface-hover p-0.5'\n : local.scrollable\n ? 'gap-1 rounded-none pb-px shadow-[inset_0_-1px_0_var(--border)] data-[orientation=vertical]:pb-0 data-[orientation=vertical]:shadow-none'\n : 'gap-1 rounded-none border-b border-border data-[orientation=vertical]:border-b-0',\n 'data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type TabsTriggerProps = ComponentProps<typeof KobalteTabs.Trigger> & {\n appearance?: 'underline' | 'segmented'\n}\n\n/**\n * The underline appearance marks the selected trigger on the edge it shares\n * with the list's axis. A horizontal row reads left to right along a baseline,\n * so the mark is a bottom bar sitting on the list's rule. A vertical list stacks\n * its triggers, and a bottom bar there underlines one row of a column — it reads\n * as a divider, not a selection — so the mark moves to the inline-start edge,\n * the leading bar a side navigation uses, and the label aligns to that edge.\n *\n * The orientation is read from the root rather than from a `data-orientation`\n * selector so the vertical classes are unprefixed: a composite that replaces the\n * mark (SettingsNavigation's filled row passes `border-0`) then overrides it\n * through the ordinary class merge instead of fighting a variant-scoped border.\n */\nexport function TabsTrigger(props: TabsTriggerProps) {\n const [local, rest] = splitProps(props, ['class', 'appearance', 'id'])\n const tabs = useTabsId()\n const triggerId = () => local.id ?? `${tabs.id()}-trigger-${rest.value}`\n\n // Register before panels render, including SSR where createEffect is skipped.\n createRenderEffect(() => {\n const value = rest.value\n const id = triggerId()\n tabs.registerTriggerId(value, id)\n onCleanup(() => tabs.unregisterTriggerId(value, id))\n })\n\n return (\n <KobalteTabs.Trigger\n data-slot=\"tabs-trigger\"\n id={triggerId()}\n class={cn(\n 'inline-flex shrink-0 items-center justify-center gap-1.5 whitespace-nowrap text-sm font-medium',\n 'transition-colors ease-out outline-none select-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'text-foreground',\n '[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-4',\n local.appearance === 'segmented'\n ? 'h-control-sm rounded-md px-control-sm data-[selected]:bg-primary-subtle data-[selected]:text-foreground'\n : tabs.orientation() === 'vertical'\n ? 'h-control-md justify-start rounded-none border-s-2 border-transparent ps-3 pe-2 data-[selected]:border-primary'\n : 'h-control-md -mb-px rounded-none border-b-2 border-transparent px-2 pb-2 data-[selected]:border-primary',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function TabsContent(props: ComponentProps<typeof KobalteTabs.Content>) {\n const [local, rest] = splitProps(props, ['class', 'aria-labelledby'])\n const tabs = useTabsId()\n return (\n <KobalteTabs.Content\n data-slot=\"tabs-content\"\n aria-labelledby={\n local['aria-labelledby'] ??\n tabs.triggerIds().get(rest.value) ??\n `${tabs.id()}-trigger-${rest.value}`\n }\n class={cn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AAA;EAAA,KAAA,qBAAA;GAAA,OAGhBd,MAAM,sBACNH,KAAKN,WAAW,CAAC,CAACiB,IAAIP,KAAKR,KAAK,KAChC,GAAGI,KAAKR,GAAG,EAAC,WAAYY,KAAKR;EAAO;EAAA,KAAA,WAAA;GAAA,OAE/BL,GAAG,uCAAuCY,MAAMe,KAAK;EAAC;CAAA,GACzDd,IAAI,CAAA;AAGd"}
@@ -1 +1 @@
1
- {"version":3,"file":"text-link.js","names":["ComponentProps","splitProps","cn","TextLink","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","tabIndex","_$mergeProps"],"sources":["../../../../src/components/ui/text-link/text-link.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * TextLink.\n *\n * An inline, underlined link for prose and content navigation. Use ActionButton\n * or ListRow when the link is a compact action or a row-sized target.\n */\nexport function TextLink(props: ComponentProps<'a'>) {\n const [local, rest] = splitProps(props, ['class', 'tabIndex'])\n\n return (\n <a\n data-slot=\"textlink\"\n class={cn(\n 'rounded-sm text-foreground underline decoration-primary underline-offset-4',\n 'transition-colors ease-out hover:decoration-foreground outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'motion-reduce:transition-none',\n local.class\n )}\n tabIndex={local.tabIndex ?? 0}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAAgBG,SAASC,OAA4B;CACnD,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA;GAAA,KAAA,WAAA;IAAA,OAGWR,GACL,8EACA,uEACA,oFACA,iCACAG,MAAMM,KACR;GAAC;GAAA,IACDC,WAAQ;IAAA,OAAEP,MAAMO,YAAY;GAAC;EAAA,GACzBN,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAGd"}
1
+ {"version":3,"file":"text-link.js","names":["splitProps","cn","TextLink","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","tabIndex"],"sources":["../../../../src/components/ui/text-link/text-link.tsx"],"sourcesContent":["import type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * TextLink.\n *\n * An inline, underlined link for prose and content navigation. Use ActionButton\n * or ListRow when the link is a compact action or a row-sized target.\n */\nexport function TextLink(props: ComponentProps<'a'>) {\n const [local, rest] = splitProps(props, ['class', 'tabIndex'])\n\n return (\n <a\n data-slot=\"textlink\"\n class={cn(\n 'rounded-sm text-foreground underline decoration-primary underline-offset-4',\n 'transition-colors ease-out hover:decoration-foreground outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'motion-reduce:transition-none',\n local.class\n )}\n tabIndex={local.tabIndex ?? 0}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAAgBE,SAASC,OAA4B;CACnD,MAAM,CAACC,OAAOC,QAAQL,WAAWG,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA;GAAA,KAAA,WAAA;IAAA,OAGWR,GACL,8EACA,uEACA,oFACA,iCACAG,MAAMM,KACR;GAAC;GAAA,IACDC,WAAQ;IAAA,OAAEP,MAAMO,YAAY;GAAC;EAAA,GACzBN,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAC;CAAA,EAAA,CAAA;AAGd"}
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.js","names":["ComponentProps","Ref","splitProps","cva","VariantProps","useFormFieldControl","cn","textareaVariants","variants","variant","default","composer","code","size","comfortable","resize","vertical","none","both","defaultVariants","TextareaProps","Omit","ref","HTMLTextAreaElement","Textarea","props","local","rest","field","id","_el$","_tmpl$","_ref$","_$use","_$spread","_$mergeProps","aria-label","aria-labelledby","aria-describedby","aria-invalid","aria-errormessage","class","_$use","_$mergeProps"],"sources":["../../../../src/components/ui/textarea/textarea.tsx"],"sourcesContent":["import type { ComponentProps, Ref } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\nexport const textareaVariants = cva(\n [\n 'flex field-sizing-content w-full rounded-md border border-input bg-transparent px-control-md py-2 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'placeholder:text-muted-foreground',\n 'selection:bg-primary selection:text-primary-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n ],\n {\n variants: {\n variant: {\n default: '',\n composer: 'border-0 bg-transparent p-0 shadow-none focus-visible:ring-0',\n code: 'font-mono',\n },\n size: {\n default: 'min-h-16',\n comfortable: 'min-h-16 max-h-48',\n },\n resize: {\n vertical: 'resize-y',\n none: 'resize-none',\n both: 'resize',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n resize: 'vertical',\n },\n }\n)\n\nexport type TextareaProps = Omit<ComponentProps<'textarea'>, 'size'> &\n VariantProps<typeof textareaVariants> & {\n /** Solid's actual textarea element, rather than its containing component or form. */\n ref?: Ref<HTMLTextAreaElement>\n }\n\n/**\n * Textarea.\n *\n * Shares the Input's border, focus and invalid treatment exactly — the two are\n * the same control at different aspect ratios, and a form that mixes them must\n * not show a seam between them.\n *\n * `field-sizing: content` lets the element grow with its content where the\n * engine supports it, which is the behaviour a chat composer wants; `rows`\n * remains the fallback so an unsupported engine still gets a usable height.\n * `variant=\"composer\"` removes the standalone field surface when nested in a\n * composer shell. `variant=\"code\"` keeps the field surface and sets the\n * monospace face, for commands, snippets and other literal text. `size=\"comfortable\"` caps growth at the shared 12rem rung, and\n * the finite `resize` variants keep browser resize behavior explicit.\n */\nexport function Textarea(props: TextareaProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'size',\n 'resize',\n 'ref',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', {\n id: local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <textarea\n data-slot=\"textarea\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n ref={local.ref}\n class={cn(\n textareaVariants({ variant: local.variant, size: local.size, resize: local.resize }),\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;AAMA,IAAaO,mBAAmBJ,IAC9B;CACE;CACA;CACA;CACA;CACA;CACA;CACA;AAA8E,GAEhF;CACEK,UAAU;EACRC,SAAS;GACPC,SAAS;GACTC,UAAU;GACVC,MAAM;EACR;EACAC,MAAM;GACJH,SAAS;GACTI,aAAa;EACf;EACAC,QAAQ;GACNC,UAAU;GACVC,MAAM;GACNC,MAAM;EACR;CACF;CACAC,iBAAiB;EACfV,SAAS;EACTI,MAAM;EACNE,QAAQ;CACV;AACF,CACF;;;;;;;;;;;;;;;;AAuBA,SAAgBS,SAASC,OAAsB;CAC7C,MAAM,CAACC,OAAOC,QAAQzB,WAAWuB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAmB,CACpB;CACD,MAAMG,QAAQvB,oBAAoB,WAAW;EAC3CwB,IAAIH,MAAMG;EACV,cAAcH,MAAM;EACpB,mBAAmBA,MAAM;EACzB,oBAAoBA,MAAM;EAC1B,gBAAgBA,MAAM;EACtB,qBAAqBA,MAAM;CAC7B,CAAC;CAED,cAAA;EAAA,IAAAI,OAAAC,OAAA;EAAA,IAAAC,QASSN,MAAMJ;EAAG,OAAAU,UAAA,aAAAC,IAAAD,OAAAF,IAAA,IAATJ,MAAMJ,MAAGQ;EAAAI,OAAAJ,MAAAK,WAAA;GAAA,IANdN,KAAE;IAAA,OAAED,OAAOC,MAAMH,MAAMG;GAAE;GAAA,KAAA,gBAAA;IAAA,OACbH,MAAM;GAAa;GAAA,KAAA,qBAAA;IAAA,OACdE,QAAQ,sBAAsBF,MAAM;GAAkB;GAAA,KAAA,sBAAA;IAAA,OACrDE,QAAQ,uBAAuBF,MAAM;GAAmB;GAAA,KAAA,kBAAA;IAAA,OAC5DE,QAAQ,mBAAmBF,MAAM;GAAe;GAAA,KAAA,uBAAA;IAAA,OAC3CE,QAAQ,wBAAwBF,MAAM;GAAoB;GAAA,KAAA,WAAA;IAAA,OAEtEpB,GACLC,iBAAiB;KAAEE,SAASiB,MAAMjB;KAASI,MAAMa,MAAMb;KAAME,QAAQW,MAAMX;IAAO,CAAC,GACnFW,MAAMe,KACR;GAAC;EAAA,GACGd,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAG;CAAA,EAAA,CAAA;AAGd"}
1
+ {"version":3,"file":"textarea.js","names":["splitProps","cva","useFormFieldControl","cn","textareaVariants","variants","variant","default","composer","code","size","comfortable","resize","vertical","none","both","defaultVariants","ref","Textarea","props","local","rest","field","id","_el$","_tmpl$","_ref$","_$use","_$spread","_$mergeProps","class"],"sources":["../../../../src/components/ui/textarea/textarea.tsx"],"sourcesContent":["import type { ComponentProps, Ref } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\n\nexport const textareaVariants = cva(\n [\n 'flex field-sizing-content w-full rounded-md border border-input bg-transparent px-control-md py-2 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'placeholder:text-muted-foreground',\n 'selection:bg-primary selection:text-primary-foreground',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',\n ],\n {\n variants: {\n variant: {\n default: '',\n composer: 'border-0 bg-transparent p-0 shadow-none focus-visible:ring-0',\n code: 'font-mono',\n },\n size: {\n default: 'min-h-16',\n comfortable: 'min-h-16 max-h-48',\n },\n resize: {\n vertical: 'resize-y',\n none: 'resize-none',\n both: 'resize',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n resize: 'vertical',\n },\n }\n)\n\nexport type TextareaProps = Omit<ComponentProps<'textarea'>, 'size'> &\n VariantProps<typeof textareaVariants> & {\n /** Solid's actual textarea element, rather than its containing component or form. */\n ref?: Ref<HTMLTextAreaElement>\n }\n\n/**\n * Textarea.\n *\n * Shares the Input's border, focus and invalid treatment exactly — the two are\n * the same control at different aspect ratios, and a form that mixes them must\n * not show a seam between them.\n *\n * `field-sizing: content` lets the element grow with its content where the\n * engine supports it, which is the behaviour a chat composer wants; `rows`\n * remains the fallback so an unsupported engine still gets a usable height.\n * `variant=\"composer\"` removes the standalone field surface when nested in a\n * composer shell. `variant=\"code\"` keeps the field surface and sets the\n * monospace face, for commands, snippets and other literal text. `size=\"comfortable\"` caps growth at the shared 12rem rung, and\n * the finite `resize` variants keep browser resize behavior explicit.\n */\nexport function Textarea(props: TextareaProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'size',\n 'resize',\n 'ref',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage',\n ])\n const field = useFormFieldControl('control', {\n id: local.id,\n 'aria-label': local['aria-label'],\n 'aria-labelledby': local['aria-labelledby'],\n 'aria-describedby': local['aria-describedby'],\n 'aria-invalid': local['aria-invalid'],\n 'aria-errormessage': local['aria-errormessage'],\n })\n\n return (\n <textarea\n data-slot=\"textarea\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n ref={local.ref}\n class={cn(\n textareaVariants({ variant: local.variant, size: local.size, resize: local.resize }),\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;AAMA,IAAaI,mBAAmBH,IAC9B;CACE;CACA;CACA;CACA;CACA;CACA;CACA;AAA8E,GAEhF;CACEI,UAAU;EACRC,SAAS;GACPC,SAAS;GACTC,UAAU;GACVC,MAAM;EACR;EACAC,MAAM;GACJH,SAAS;GACTI,aAAa;EACf;EACAC,QAAQ;GACNC,UAAU;GACVC,MAAM;GACNC,MAAM;EACR;CACF;CACAC,iBAAiB;EACfV,SAAS;EACTI,MAAM;EACNE,QAAQ;CACV;AACF,CACF;;;;;;;;;;;;;;;;AAuBA,SAAgBM,SAASC,OAAsB;CAC7C,MAAM,CAACC,OAAOC,QAAQrB,WAAWmB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAmB,CACpB;CACD,MAAMG,QAAQpB,oBAAoB,WAAW;EAC3CqB,IAAIH,MAAMG;EACV,cAAcH,MAAM;EACpB,mBAAmBA,MAAM;EACzB,oBAAoBA,MAAM;EAC1B,gBAAgBA,MAAM;EACtB,qBAAqBA,MAAM;CAC7B,CAAC;CAED,cAAA;EAAA,IAAAI,OAAAC,OAAA;EAAA,IAAAC,QASSN,MAAMH;EAAG,OAAAS,UAAA,aAAAC,IAAAD,OAAAF,IAAA,IAATJ,MAAMH,MAAGO;EAAAI,OAAAJ,MAAAK,WAAA;GAAA,IANdN,KAAE;IAAA,OAAED,OAAOC,MAAMH,MAAMG;GAAE;GAAA,KAAA,gBAAA;IAAA,OACbH,MAAM;GAAa;GAAA,KAAA,qBAAA;IAAA,OACdE,QAAQ,sBAAsBF,MAAM;GAAkB;GAAA,KAAA,sBAAA;IAAA,OACrDE,QAAQ,uBAAuBF,MAAM;GAAmB;GAAA,KAAA,kBAAA;IAAA,OAC5DE,QAAQ,mBAAmBF,MAAM;GAAe;GAAA,KAAA,uBAAA;IAAA,OAC3CE,QAAQ,wBAAwBF,MAAM;GAAoB;GAAA,KAAA,WAAA;IAAA,OAEtEjB,GACLC,iBAAiB;KAAEE,SAASc,MAAMd;KAASI,MAAMU,MAAMV;KAAME,QAAQQ,MAAMR;IAAO,CAAC,GACnFQ,MAAMU,KACR;GAAC;EAAA,GACGT,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAG;CAAA,EAAA,CAAA;AAGd"}
@@ -1 +1 @@
1
- {"version":3,"file":"toast.js","names":["Toast","KobalteToast","ToastComponentProps","toaster","X","ComponentProps","JSX","Show","splitProps","cn","ToastTone","toastTones","Record","default","success","warning","destructive","info","ToastOptions","title","description","tone","action","Element","persistent","duration","region","ToastCard","props","_$createComponent","toastId","priority","class","style","children","_tmpl$","_el$2","_tmpl$3","_$insert","Title","when","Description","_el$3","_tmpl$2","CloseButton","errorToastOptions","options","Omit","toast","show","_$mergeProps","error","promise","Promise","T","messages","pending","data","resolved","state","dismiss","clear","ToasterProps","Region","position","toasterPosition","toasterAlignment","Toaster","local","rest","regionId","limit","swipeDirection","pauseOnInteraction","pauseOnPageIdle","List","_$createComponent","KobalteToast","_$mergeProps"],"sources":["../../../../src/components/ui/toast/toast.tsx"],"sourcesContent":["import { Toast as KobalteToast, type ToastComponentProps, toaster } from '@kobalte/core/toast'\nimport { X } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Toast.\n *\n * A short, self-dismissing message about something that already happened.\n *\n * The rules that make toasts helpful rather than hostile are built into this\n * API rather than left to callers:\n *\n * - A toast never carries the only route to an action. Anything important\n * enough to need doing belongs in the interface, not in a message that\n * disappears. `action` exists, but it is a convenience, not a flow.\n * - Errors from user-initiated work get `priority=\"high\"` so a screen reader\n * interrupts to announce them; background progress uses the default low\n * priority so it is not read over whatever the user is doing.\n * - A toast with a way to undo is preferred to a confirmation dialog for a\n * reversible action. Undo after the fact costs the user nothing; a modal\n * before it costs everyone a click.\n *\n * `Toaster` is mounted once, near the root of the app.\n */\n\ntype ToastTone = 'default' | 'success' | 'warning' | 'destructive' | 'info'\n\n/**\n * The tone dot's colour. A custom property rather than five colour utilities\n * because the value is applied inline (the tone is data, not markup) and a\n * Tailwind colour class cannot be built from a runtime value without becoming\n * invisible to the linter.\n */\nconst toastTones: Record<ToastTone, string> = {\n default: 'var(--foreground)',\n success: 'var(--success)',\n warning: 'var(--warning)',\n destructive: 'var(--destructive)',\n info: 'var(--info)',\n}\n\nexport type ToastOptions = {\n title: string\n description?: string\n tone?: ToastTone\n /** A control rendered inside the toast, usually an Undo. */\n action?: JSX.Element\n /** Keep the toast until it is dismissed. Use for a failure the user must see. */\n persistent?: boolean\n /** Milliseconds before auto-dismiss. Overrides the region's setting. */\n duration?: number\n /** Which Toaster region to render into. */\n region?: string\n}\n\nfunction ToastCard(props: ToastComponentProps & ToastOptions) {\n const tone = () => props.tone ?? 'default'\n\n return (\n <KobalteToast\n toastId={props.toastId}\n /**\n * A user-initiated outcome is announced; a background one waits its turn.\n * A failure the user caused is worth interrupting for; a sync finishing\n * quietly is not.\n */\n priority={tone() === 'destructive' ? 'high' : 'low'}\n duration={props.duration}\n persistent={props.persistent}\n class={cn(\n 'pointer-events-auto flex w-full items-start gap-3 rounded-xl border border-border bg-popover p-3 shadow-lg',\n 'data-[opened]:animate-in data-[opened]:slide-in-from-right-full data-[opened]:fade-in-0',\n 'data-[closed]:animate-out data-[closed]:slide-out-to-right-full data-[closed]:fade-out-0',\n 'data-[swipe=move]:translate-x-(--kb-toast-swipe-move-x) data-[swipe=move]:transition-none',\n 'data-[swipe=cancel]:translate-x-0 data-[swipe=cancel]:transition-transform',\n 'data-[swipe=end]:animate-out data-[swipe=end]:slide-out-to-right-full'\n )}\n style={{ '--toast-tone': toastTones[tone()] }}\n >\n <span\n aria-hidden=\"true\"\n class=\"mt-1.5 size-1.5 shrink-0 rounded-full\"\n style={{ 'background-color': 'var(--toast-tone)' }}\n />\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <KobalteToast.Title class=\"text-sm font-medium\">{props.title}</KobalteToast.Title>\n <Show when={props.description}>\n <KobalteToast.Description class=\"text-sm text-muted-foreground\">\n {props.description}\n </KobalteToast.Description>\n </Show>\n <Show when={props.action}>\n <div class=\"mt-1.5 flex items-center gap-2\">{props.action}</div>\n </Show>\n </div>\n <KobalteToast.CloseButton\n aria-label=\"Dismiss notification\"\n class=\"text-muted-foreground shrink-0 rounded-sm p-0.5 transition-colors ease-out outline-none hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n >\n <X class=\"size-3.5\" />\n </KobalteToast.CloseButton>\n </KobalteToast>\n )\n}\n\n/**\n * The error contract, resolved: destructive tone, persistent unless the caller\n * says otherwise. Exported because this decision is the part a caller depends\n * on and the part testable without a browser — the card render itself needs one.\n */\nexport function errorToastOptions(\n title: string,\n options?: Omit<ToastOptions, 'title' | 'tone'>\n): ToastOptions {\n return { ...options, title, tone: 'destructive', persistent: options?.persistent ?? true }\n}\n\n/**\n * The toast API. `show` is the general form; the tone helpers are shorthand for\n * the four cases that come up constantly.\n */\nexport const toast = {\n show(options: ToastOptions): number {\n return toaster.show((props) => <ToastCard {...props} {...options} />, {\n region: options.region,\n })\n },\n success(title: string, options?: Omit<ToastOptions, 'title' | 'tone'>): number {\n return toast.show({ ...options, title, tone: 'success' })\n },\n /**\n * A failure the user caused. Persistent by default — an error that times out\n * while its reader is mid-sentence has not been reported — but `persistent`\n * stays caller-owned: a failure inside a retry loop (a failed \"check again\",\n * a background poll) passes `persistent: false` and a `duration`, because a\n * dismiss-only toast there is one more thing to close by hand.\n */\n error(title: string, options?: Omit<ToastOptions, 'title' | 'tone'>): number {\n return toast.show(errorToastOptions(title, options))\n },\n warning(title: string, options?: Omit<ToastOptions, 'title' | 'tone'>): number {\n return toast.show({ ...options, title, tone: 'warning' })\n },\n info(title: string, options?: Omit<ToastOptions, 'title' | 'tone'>): number {\n return toast.show({ ...options, title, tone: 'info' })\n },\n /**\n * A toast that resolves with a promise: pending, then success or failure.\n * The right shape for an operation with a visible duration, because the user\n * gets one message instead of three.\n */\n promise<T>(\n promise: Promise<T> | (() => Promise<T>),\n messages: {\n pending: string\n success: string | ((data: T) => string)\n error: string | ((error: unknown) => string)\n }\n ): Promise<T> {\n const resolved = typeof promise === 'function' ? promise() : promise\n toaster.promise(resolved, (props) => {\n const tone: ToastTone =\n props.state === 'fulfilled'\n ? 'success'\n : props.state === 'rejected'\n ? 'destructive'\n : 'default'\n const title =\n props.state === 'pending'\n ? messages.pending\n : props.state === 'fulfilled'\n ? typeof messages.success === 'function'\n ? messages.success(props.data as T)\n : messages.success\n : typeof messages.error === 'function'\n ? messages.error(props.error)\n : messages.error\n return (\n <ToastCard\n toastId={props.toastId}\n title={title}\n tone={tone}\n persistent={props.state === 'rejected'}\n />\n )\n })\n return resolved\n },\n dismiss: toaster.dismiss,\n clear: toaster.clear,\n}\n\nexport type ToasterProps = ComponentProps<typeof KobalteToast.Region> & {\n /** Where the stack sits. Defaults to the bottom-right, clear of the shell. */\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n region?: string\n}\n\n/**\n * `class` lands on the region too: the props describe the region, and the\n * region is the element a caller lays out (an inset clear of a status bar, a\n * narrower stack). The list inside it is an implementation detail.\n *\n * The corner is set on the region, not the list. The region is the `fixed`\n * element: an inset on the list inside it positions nothing, and the region falls\n * back to wherever it happens to sit in the document flow.\n */\nconst toasterPosition = {\n 'top-left': 'top-0 left-0',\n 'top-right': 'top-0 right-0',\n 'bottom-left': 'bottom-0 left-0',\n 'bottom-right': 'bottom-0 right-0',\n}\n\nconst toasterAlignment = {\n 'top-left': 'items-start',\n 'top-right': 'items-end',\n 'bottom-left': 'items-start',\n 'bottom-right': 'items-end',\n}\n\n/** Mount once, near the root. Renders the stack and owns its timing defaults. */\nexport function Toaster(props: ToasterProps) {\n const [local, rest] = splitProps(props, ['position', 'region', 'class'])\n\n return (\n <KobalteToast.Region\n regionId={local.region}\n duration={5000}\n limit={3}\n swipeDirection=\"right\"\n pauseOnInteraction\n pauseOnPageIdle\n /**\n * The toast region is a top layer: opening a dialog must not hide an\n * in-flight notification, and clicking a toast must not dismiss the\n * dialog behind it.\n */\n class={cn(\n 'pointer-events-none fixed z-(--z-toast) flex max-h-screen w-full flex-col gap-2 p-4 sm:max-w-sm',\n toasterPosition[local.position ?? 'bottom-right'],\n local.class\n )}\n {...rest}\n >\n <KobalteToast.List\n class={cn('flex flex-col gap-2', toasterAlignment[local.position ?? 'bottom-right'])}\n />\n </KobalteToast.Region>\n )\n}\n\nexport { toaster }\n"],"mappings":";;;;;;;;;;;;;;;AAmCA,IAAMW,aAAwC;CAC5CE,SAAS;CACTC,SAAS;CACTC,SAAS;CACTC,aAAa;CACbC,MAAM;AACR;AAgBA,SAASU,UAAUC,OAA2C;CAC5D,MAAMP,aAAaO,MAAMP,QAAQ;CAEjC,OAAAQ,gBACG5B,OAAY;EAAA,IACX6B,UAAO;GAAA,OAAEF,MAAME;EAAO;EAAA,IAMtBC,WAAQ;GAAA,OAAEV,KAAK,MAAM,gBAAgB,SAAS;EAAK;EAAA,IACnDI,WAAQ;GAAA,OAAEG,MAAMH;EAAQ;EAAA,IACxBD,aAAU;GAAA,OAAEI,MAAMJ;EAAU;EAAA,KAAA,WAAA;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Aa;CACb,eAAe;CACf,gBAAgB;AAClB;AAEA,IAAMC,mBAAmB;CACvB,YAAY;CACZ,aAAa;CACb,eAAe;CACf,gBAAgB;AAClB;;AAGA,SAAgBC,QAAQvC,OAAqB;CAC3C,MAAM,CAACwC,OAAOC,QAAQ7D,WAAWoB,OAAO;EAAC;EAAY;EAAU;CAAO,CAAC;CAEvE,OAAAC,gBACG5B,MAAa8D,QAAMb,WAAA;EAAA,IAClBoB,WAAQ;GAAA,OAAEF,MAAM1C;EAAM;EACtBD,UAAU;EACV8C,OAAO;EACPC,gBAAc;EACdC,oBAAkB;EAClBC,iBAAe;EAAA,KAAA,WAAA;GAAA,OAMRjE,GACL,mGACAwD,gBAAgBG,MAAMJ,YAAY,iBAClCI,MAAMpC,KACR;EAAC;CAAA,GACGqC,MAAI,EAAA,IAAAnC,WAAA;EAAA,OAAAL,gBAEP5B,MAAa0E,MAAI,EAAA,KAAA,WAAA;GAAA,OACTlE,GAAG,uBAAuByD,iBAAiBE,MAAMJ,YAAY,eAAe;EAAC,EAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAI5F"}
1
+ {"version":3,"file":"toast.js","names":["KobalteToast","toaster","X","Show","splitProps","cn","toastTones","default","success","warning","destructive","info","title","description","tone","action","persistent","duration","region","ToastCard","props","_$createComponent","toastId","priority","class","style","children","_tmpl$","_el$2","_tmpl$3","_$insert","Title","when","Description","_el$3","_tmpl$2","CloseButton","errorToastOptions","options","toast","show","_$mergeProps","error","promise","messages","pending","data","resolved","state","dismiss","clear","Region","position","toasterPosition","toasterAlignment","Toaster","local","rest","regionId","limit","swipeDirection","pauseOnInteraction","pauseOnPageIdle","List"],"sources":["../../../../src/components/ui/toast/toast.tsx"],"sourcesContent":["import { Toast as KobalteToast, type ToastComponentProps, toaster } from '@kobalte/core/toast'\nimport { X } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Toast.\n *\n * A short, self-dismissing message about something that already happened.\n *\n * The rules that make toasts helpful rather than hostile are built into this\n * API rather than left to callers:\n *\n * - A toast never carries the only route to an action. Anything important\n * enough to need doing belongs in the interface, not in a message that\n * disappears. `action` exists, but it is a convenience, not a flow.\n * - Errors from user-initiated work get `priority=\"high\"` so a screen reader\n * interrupts to announce them; background progress uses the default low\n * priority so it is not read over whatever the user is doing.\n * - A toast with a way to undo is preferred to a confirmation dialog for a\n * reversible action. Undo after the fact costs the user nothing; a modal\n * before it costs everyone a click.\n *\n * `Toaster` is mounted once, near the root of the app.\n */\n\ntype ToastTone = 'default' | 'success' | 'warning' | 'destructive' | 'info'\n\n/**\n * The tone dot's colour. A custom property rather than five colour utilities\n * because the value is applied inline (the tone is data, not markup) and a\n * Tailwind colour class cannot be built from a runtime value without becoming\n * invisible to the linter.\n */\nconst toastTones: Record<ToastTone, string> = {\n default: 'var(--foreground)',\n success: 'var(--success)',\n warning: 'var(--warning)',\n destructive: 'var(--destructive)',\n info: 'var(--info)',\n}\n\nexport type ToastOptions = {\n title: string\n description?: string\n tone?: ToastTone\n /** A control rendered inside the toast, usually an Undo. */\n action?: JSX.Element\n /** Keep the toast until it is dismissed. Use for a failure the user must see. */\n persistent?: boolean\n /** Milliseconds before auto-dismiss. Overrides the region's setting. */\n duration?: number\n /** Which Toaster region to render into. */\n region?: string\n}\n\nfunction ToastCard(props: ToastComponentProps & ToastOptions) {\n const tone = () => props.tone ?? 'default'\n\n return (\n <KobalteToast\n toastId={props.toastId}\n /**\n * A user-initiated outcome is announced; a background one waits its turn.\n * A failure the user caused is worth interrupting for; a sync finishing\n * quietly is not.\n */\n priority={tone() === 'destructive' ? 'high' : 'low'}\n duration={props.duration}\n persistent={props.persistent}\n class={cn(\n 'pointer-events-auto flex w-full items-start gap-3 rounded-xl border border-border bg-popover p-3 shadow-lg',\n 'data-[opened]:animate-in data-[opened]:slide-in-from-right-full data-[opened]:fade-in-0',\n 'data-[closed]:animate-out data-[closed]:slide-out-to-right-full data-[closed]:fade-out-0',\n 'data-[swipe=move]:translate-x-(--kb-toast-swipe-move-x) data-[swipe=move]:transition-none',\n 'data-[swipe=cancel]:translate-x-0 data-[swipe=cancel]:transition-transform',\n 'data-[swipe=end]:animate-out data-[swipe=end]:slide-out-to-right-full'\n )}\n style={{ '--toast-tone': toastTones[tone()] }}\n >\n <span\n aria-hidden=\"true\"\n class=\"mt-1.5 size-1.5 shrink-0 rounded-full\"\n style={{ 'background-color': 'var(--toast-tone)' }}\n />\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <KobalteToast.Title class=\"text-sm font-medium\">{props.title}</KobalteToast.Title>\n <Show when={props.description}>\n <KobalteToast.Description class=\"text-sm text-muted-foreground\">\n {props.description}\n </KobalteToast.Description>\n </Show>\n <Show when={props.action}>\n <div class=\"mt-1.5 flex items-center gap-2\">{props.action}</div>\n </Show>\n </div>\n <KobalteToast.CloseButton\n aria-label=\"Dismiss notification\"\n class=\"text-muted-foreground shrink-0 rounded-sm p-0.5 transition-colors ease-out outline-none hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n >\n <X class=\"size-3.5\" />\n </KobalteToast.CloseButton>\n </KobalteToast>\n )\n}\n\n/**\n * The error contract, resolved: destructive tone, persistent unless the caller\n * says otherwise. Exported because this decision is the part a caller depends\n * on and the part testable without a browser — the card render itself needs one.\n */\nexport function errorToastOptions(\n title: string,\n options?: Omit<ToastOptions, 'title' | 'tone'>\n): ToastOptions {\n return { ...options, title, tone: 'destructive', persistent: options?.persistent ?? true }\n}\n\n/**\n * The toast API. `show` is the general form; the tone helpers are shorthand for\n * the four cases that come up constantly.\n */\nexport const toast = {\n show(options: ToastOptions): number {\n return toaster.show((props) => <ToastCard {...props} {...options} />, {\n region: options.region,\n })\n },\n success(title: string, options?: Omit<ToastOptions, 'title' | 'tone'>): number {\n return toast.show({ ...options, title, tone: 'success' })\n },\n /**\n * A failure the user caused. Persistent by default — an error that times out\n * while its reader is mid-sentence has not been reported — but `persistent`\n * stays caller-owned: a failure inside a retry loop (a failed \"check again\",\n * a background poll) passes `persistent: false` and a `duration`, because a\n * dismiss-only toast there is one more thing to close by hand.\n */\n error(title: string, options?: Omit<ToastOptions, 'title' | 'tone'>): number {\n return toast.show(errorToastOptions(title, options))\n },\n warning(title: string, options?: Omit<ToastOptions, 'title' | 'tone'>): number {\n return toast.show({ ...options, title, tone: 'warning' })\n },\n info(title: string, options?: Omit<ToastOptions, 'title' | 'tone'>): number {\n return toast.show({ ...options, title, tone: 'info' })\n },\n /**\n * A toast that resolves with a promise: pending, then success or failure.\n * The right shape for an operation with a visible duration, because the user\n * gets one message instead of three.\n */\n promise<T>(\n promise: Promise<T> | (() => Promise<T>),\n messages: {\n pending: string\n success: string | ((data: T) => string)\n error: string | ((error: unknown) => string)\n }\n ): Promise<T> {\n const resolved = typeof promise === 'function' ? promise() : promise\n toaster.promise(resolved, (props) => {\n const tone: ToastTone =\n props.state === 'fulfilled'\n ? 'success'\n : props.state === 'rejected'\n ? 'destructive'\n : 'default'\n const title =\n props.state === 'pending'\n ? messages.pending\n : props.state === 'fulfilled'\n ? typeof messages.success === 'function'\n ? messages.success(props.data as T)\n : messages.success\n : typeof messages.error === 'function'\n ? messages.error(props.error)\n : messages.error\n return (\n <ToastCard\n toastId={props.toastId}\n title={title}\n tone={tone}\n persistent={props.state === 'rejected'}\n />\n )\n })\n return resolved\n },\n dismiss: toaster.dismiss,\n clear: toaster.clear,\n}\n\nexport type ToasterProps = ComponentProps<typeof KobalteToast.Region> & {\n /** Where the stack sits. Defaults to the bottom-right, clear of the shell. */\n position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'\n region?: string\n}\n\n/**\n * `class` lands on the region too: the props describe the region, and the\n * region is the element a caller lays out (an inset clear of a status bar, a\n * narrower stack). The list inside it is an implementation detail.\n *\n * The corner is set on the region, not the list. The region is the `fixed`\n * element: an inset on the list inside it positions nothing, and the region falls\n * back to wherever it happens to sit in the document flow.\n */\nconst toasterPosition = {\n 'top-left': 'top-0 left-0',\n 'top-right': 'top-0 right-0',\n 'bottom-left': 'bottom-0 left-0',\n 'bottom-right': 'bottom-0 right-0',\n}\n\nconst toasterAlignment = {\n 'top-left': 'items-start',\n 'top-right': 'items-end',\n 'bottom-left': 'items-start',\n 'bottom-right': 'items-end',\n}\n\n/** Mount once, near the root. Renders the stack and owns its timing defaults. */\nexport function Toaster(props: ToasterProps) {\n const [local, rest] = splitProps(props, ['position', 'region', 'class'])\n\n return (\n <KobalteToast.Region\n regionId={local.region}\n duration={5000}\n limit={3}\n swipeDirection=\"right\"\n pauseOnInteraction\n pauseOnPageIdle\n /**\n * The toast region is a top layer: opening a dialog must not hide an\n * in-flight notification, and clicking a toast must not dismiss the\n * dialog behind it.\n */\n class={cn(\n 'pointer-events-none fixed z-(--z-toast) flex max-h-screen w-full flex-col gap-2 p-4 sm:max-w-sm',\n toasterPosition[local.position ?? 'bottom-right'],\n local.class\n )}\n {...rest}\n >\n <KobalteToast.List\n class={cn('flex flex-col gap-2', toasterAlignment[local.position ?? 'bottom-right'])}\n />\n </KobalteToast.Region>\n )\n}\n\nexport { toaster }\n"],"mappings":";;;;;;;;;;;;;;;AAmCA,IAAMM,aAAwC;CAC5CC,SAAS;CACTC,SAAS;CACTC,SAAS;CACTC,aAAa;CACbC,MAAM;AACR;AAgBA,SAASQ,UAAUC,OAA2C;CAC5D,MAAMN,aAAaM,MAAMN,QAAQ;CAEjC,OAAAO,gBACGrB,OAAY;EAAA,IACXsB,UAAO;GAAA,OAAEF,MAAME;EAAO;EAAA,IAMtBC,WAAQ;GAAA,OAAET,KAAK,MAAM,gBAAgB,SAAS;EAAK;EAAA,IACnDG,WAAQ;GAAA,OAAEG,MAAMH;EAAQ;EAAA,IACxBD,aAAU;GAAA,OAAEI,MAAMJ;EAAU;EAAA,KAAA,WAAA;GAAA,OACrBX,GACL,8GACA,2FACA,4FACA,6FACA,8EACA,uEACF;EAAC;EAAA,IACDoB,QAAK;GA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,eAAe;CACf,gBAAgB;AAClB;;AAGA,SAAgBC,QAAQnC,OAAqB;CAC3C,MAAM,CAACoC,OAAOC,QAAQrD,WAAWgB,OAAO;EAAC;EAAY;EAAU;CAAO,CAAC;CAEvE,OAAAC,gBACGrB,MAAamD,QAAMV,WAAA;EAAA,IAClBiB,WAAQ;GAAA,OAAEF,MAAMtC;EAAM;EACtBD,UAAU;EACV0C,OAAO;EACPC,gBAAc;EACdC,oBAAkB;EAClBC,iBAAe;EAAA,KAAA,WAAA;GAAA,OAMRzD,GACL,mGACAgD,gBAAgBG,MAAMJ,YAAY,iBAClCI,MAAMhC,KACR;EAAC;CAAA,GACGiC,MAAI,EAAA,IAAA/B,WAAA;EAAA,OAAAL,gBAEPrB,MAAa+D,MAAI,EAAA,KAAA,WAAA;GAAA,OACT1D,GAAG,uBAAuBiD,iBAAiBE,MAAMJ,YAAY,eAAe;EAAC,EAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAI5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"toggle.js","names":["ToggleButton","ComponentProps","splitProps","cva","controlInteractive","controlSize","VariantProps","cn","toggleVariants","variants","variant","default","outline","subtle","size","xs","sm","md","lg","xl","defaultVariants","ToggleProps","Toggle","props","local","rest","_$createComponent","_$mergeProps","class","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/ui/toggle/toggle.tsx"],"sourcesContent":["import { ToggleButton } from '@kobalte/core/toggle-button'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cva, controlInteractive, controlSize, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Toggle.\n *\n * A button that stays pressed. The difference from Button is state, not looks:\n * a Toggle reports `aria-pressed` and holds its pressed appearance until\n * released, which is what makes it right for a formatting control and wrong\n * for a command.\n *\n * Kobalte supplies the pressed state and the keyboard behaviour; the styling\n * adds the one thing a headless primitive cannot know — that a pressed toggle\n * in a toolbar should read as *filled*, not merely outlined. Pressed reads on\n * the accent rung (`primary-subtle`, foreground text, accent glyph): pressed is the\n * control's on state, the same family the checked checkbox and switch own, so\n * it keeps a touch of the user's accent instead of a neutral fill.\n */\nexport const toggleVariants = cva(\n `${controlInteractive} inline-flex items-center justify-center rounded-md font-medium whitespace-nowrap select-none hover:bg-surface-hover hover:text-foreground data-[pressed]:bg-primary-subtle data-[pressed]:text-foreground data-[pressed]:[&_svg]:text-primary disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,\n {\n variants: {\n variant: {\n default: 'bg-transparent',\n /** Sits inside a field or toolbar that already has a fill. */\n outline: 'border border-border bg-transparent',\n /** Filled even when unpressed, for a segmented control's idle item. */\n subtle: 'bg-surface-hover',\n },\n size: {\n '2xs': `${controlSize['2xs']} [&_svg]:size-3`,\n xs: `${controlSize.xs} [&_svg]:size-3.5`,\n sm: `${controlSize.sm} [&_svg]:size-3.5`,\n md: `${controlSize.md} [&_svg]:size-4`,\n lg: `${controlSize.lg} [&_svg]:size-4`,\n xl: `${controlSize.xl} [&_svg]:size-5`,\n '2xl': `${controlSize['2xl']} [&_svg]:size-6`,\n 'icon-2xs': 'size-control-2xs p-0 [&_svg]:size-3',\n 'icon-xs': 'size-control-xs p-0 [&_svg]:size-3.5',\n 'icon-sm': 'size-control-sm p-0 [&_svg]:size-3.5',\n 'icon-md': 'size-control-md p-0 [&_svg]:size-4',\n 'icon-lg': 'size-control-lg p-0 [&_svg]:size-4',\n 'icon-xl': 'size-control-xl p-0 [&_svg]:size-5',\n 'icon-2xl': 'size-control-2xl p-0 [&_svg]:size-6',\n },\n },\n defaultVariants: { variant: 'default', size: 'md' },\n }\n)\n\nexport type ToggleProps = ComponentProps<typeof ToggleButton> & VariantProps<typeof toggleVariants>\n\nexport function Toggle(props: ToggleProps) {\n const [local, rest] = splitProps(props, ['variant', 'size', 'class'])\n\n return (\n <ToggleButton\n data-slot=\"toggle\"\n class={cn(toggleVariants({ variant: local.variant, size: local.size }), local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,IAAaQ,iBAAiBL,IAC5B,GAAGC,mBAAkB,+UACrB;CACEK,UAAU;EACRC,SAAS;GACPC,SAAS;;GAETC,SAAS;;GAETC,QAAQ;EACV;EACAC,MAAM;GACJ,OAAO,GAAGT,YAAY,OAAM;GAC5BU,IAAI,GAAGV,YAAYU,GAAE;GACrBC,IAAI,GAAGX,YAAYW,GAAE;GACrBC,IAAI,GAAGZ,YAAYY,GAAE;GACrBC,IAAI,GAAGb,YAAYa,GAAE;GACrBC,IAAI,GAAGd,YAAYc,GAAE;GACrB,OAAO,GAAGd,YAAY,OAAM;GAC5B,YAAY;GACZ,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,YAAY;EACd;CACF;CACAe,iBAAiB;EAAEV,SAAS;EAAWI,MAAM;CAAK;AACpD,CACF;AAIA,SAAgBQ,OAAOC,OAAoB;CACzC,MAAM,CAACC,OAAOC,QAAQvB,WAAWqB,OAAO;EAAC;EAAW;EAAQ;CAAO,CAAC;CAEpE,OAAAG,gBACG1B,cAAY2B,WAAA;EAAA,aAAA;EAAA,KAAA,WAAA;GAAA,OAEJpB,GAAGC,eAAe;IAAEE,SAASc,MAAMd;IAASI,MAAMU,MAAMV;GAAK,CAAC,GAAGU,MAAMI,KAAK;EAAC;CAAA,GAChFH,IAAI,CAAA;AAGd"}
1
+ {"version":3,"file":"toggle.js","names":["ToggleButton","splitProps","cva","controlInteractive","controlSize","cn","toggleVariants","variants","variant","default","outline","subtle","size","xs","sm","md","lg","xl","defaultVariants","Toggle","props","local","rest","_$createComponent","_$mergeProps","class"],"sources":["../../../../src/components/ui/toggle/toggle.tsx"],"sourcesContent":["import { ToggleButton } from '@kobalte/core/toggle-button'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cva, controlInteractive, controlSize, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Toggle.\n *\n * A button that stays pressed. The difference from Button is state, not looks:\n * a Toggle reports `aria-pressed` and holds its pressed appearance until\n * released, which is what makes it right for a formatting control and wrong\n * for a command.\n *\n * Kobalte supplies the pressed state and the keyboard behaviour; the styling\n * adds the one thing a headless primitive cannot know — that a pressed toggle\n * in a toolbar should read as *filled*, not merely outlined. Pressed reads on\n * the accent rung (`primary-subtle`, foreground text, accent glyph): pressed is the\n * control's on state, the same family the checked checkbox and switch own, so\n * it keeps a touch of the user's accent instead of a neutral fill.\n */\nexport const toggleVariants = cva(\n `${controlInteractive} inline-flex items-center justify-center rounded-md font-medium whitespace-nowrap select-none hover:bg-surface-hover hover:text-foreground data-[pressed]:bg-primary-subtle data-[pressed]:text-foreground data-[pressed]:[&_svg]:text-primary disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,\n {\n variants: {\n variant: {\n default: 'bg-transparent',\n /** Sits inside a field or toolbar that already has a fill. */\n outline: 'border border-border bg-transparent',\n /** Filled even when unpressed, for a segmented control's idle item. */\n subtle: 'bg-surface-hover',\n },\n size: {\n '2xs': `${controlSize['2xs']} [&_svg]:size-3`,\n xs: `${controlSize.xs} [&_svg]:size-3.5`,\n sm: `${controlSize.sm} [&_svg]:size-3.5`,\n md: `${controlSize.md} [&_svg]:size-4`,\n lg: `${controlSize.lg} [&_svg]:size-4`,\n xl: `${controlSize.xl} [&_svg]:size-5`,\n '2xl': `${controlSize['2xl']} [&_svg]:size-6`,\n 'icon-2xs': 'size-control-2xs p-0 [&_svg]:size-3',\n 'icon-xs': 'size-control-xs p-0 [&_svg]:size-3.5',\n 'icon-sm': 'size-control-sm p-0 [&_svg]:size-3.5',\n 'icon-md': 'size-control-md p-0 [&_svg]:size-4',\n 'icon-lg': 'size-control-lg p-0 [&_svg]:size-4',\n 'icon-xl': 'size-control-xl p-0 [&_svg]:size-5',\n 'icon-2xl': 'size-control-2xl p-0 [&_svg]:size-6',\n },\n },\n defaultVariants: { variant: 'default', size: 'md' },\n }\n)\n\nexport type ToggleProps = ComponentProps<typeof ToggleButton> & VariantProps<typeof toggleVariants>\n\nexport function Toggle(props: ToggleProps) {\n const [local, rest] = splitProps(props, ['variant', 'size', 'class'])\n\n return (\n <ToggleButton\n data-slot=\"toggle\"\n class={cn(toggleVariants({ variant: local.variant, size: local.size }), local.class)}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,IAAaM,iBAAiBJ,IAC5B,GAAGC,mBAAkB,+UACrB;CACEI,UAAU;EACRC,SAAS;GACPC,SAAS;;GAETC,SAAS;;GAETC,QAAQ;EACV;EACAC,MAAM;GACJ,OAAO,GAAGR,YAAY,OAAM;GAC5BS,IAAI,GAAGT,YAAYS,GAAE;GACrBC,IAAI,GAAGV,YAAYU,GAAE;GACrBC,IAAI,GAAGX,YAAYW,GAAE;GACrBC,IAAI,GAAGZ,YAAYY,GAAE;GACrBC,IAAI,GAAGb,YAAYa,GAAE;GACrB,OAAO,GAAGb,YAAY,OAAM;GAC5B,YAAY;GACZ,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,YAAY;EACd;CACF;CACAc,iBAAiB;EAAEV,SAAS;EAAWI,MAAM;CAAK;AACpD,CACF;AAIA,SAAgBO,OAAOC,OAAoB;CACzC,MAAM,CAACC,OAAOC,QAAQrB,WAAWmB,OAAO;EAAC;EAAW;EAAQ;CAAO,CAAC;CAEpE,OAAAG,gBACGvB,cAAYwB,WAAA;EAAA,aAAA;EAAA,KAAA,WAAA;GAAA,OAEJnB,GAAGC,eAAe;IAAEE,SAASa,MAAMb;IAASI,MAAMS,MAAMT;GAAK,CAAC,GAAGS,MAAMI,KAAK;EAAC;CAAA,GAChFH,IAAI,CAAA;AAGd"}
@@ -1 +1 @@
1
- {"version":3,"file":"toggle-group.js","names":["ToggleGroup","KobalteToggleGroup","ComponentProps","splitProps","callHandler","VariantProps","cn","toggleVariants","ToggleGroupProps","Omit","multiple","variant","size","attached","props","local","rest","_$createComponent","_$mergeProps","class","ToggleGroupItemProps","Item","ToggleGroupItem","onKeyDown","event","key","stopPropagation","ToggleGroup","_$createComponent","KobalteToggleGroup","_$mergeProps"],"sources":["../../../../src/components/ui/toggle-group/toggle-group.tsx"],"sourcesContent":["import { ToggleGroup as KobalteToggleGroup } from '@kobalte/core/toggle-group'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport type { VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { toggleVariants } from '../toggle'\n\n/**\n * ToggleGroup.\n *\n * A set of related toggles that behave as one control: at most one pressed\n * (`multiple={false}`, the default) or any number (`multiple={true}`). The\n * group owns the selection and the roving focus, which is what makes arrow keys\n * move between items and a screen reader announce the position within the set.\n * A row of independent Toggles looks identical and does neither.\n *\n * `attached` joins the items into one rounded run for a segmented control. The\n * joining lives on the *group*, via child selectors, so an item never has to\n * know whether it sits at an end — which is also where the border collapse\n * (`-ms-px`) belongs.\n */\n/**\n * `multiple` is optional here although Kobalte requires it: the primitive models\n * single and multiple selection as two shapes, which forces every caller to state\n * the obvious. Defaulting to single selection keeps the common case a one-word\n * component, and a caller that wants many passes `multiple`.\n */\nexport type ToggleGroupProps = Omit<ComponentProps<typeof KobalteToggleGroup>, 'multiple'> & {\n multiple?: boolean\n variant?: VariantProps<typeof toggleVariants>['variant']\n size?: VariantProps<typeof toggleVariants>['size']\n /** Join the items into one rounded run instead of a spaced row. */\n attached?: boolean\n}\n\nexport function ToggleGroup(props: ToggleGroupProps) {\n const [local, rest] = splitProps(props, ['class', 'attached', 'multiple'])\n\n return (\n <KobalteToggleGroup\n data-slot=\"toggle-group\"\n multiple={local.multiple ?? false}\n class={cn(\n 'flex w-fit flex-row items-center',\n local.attached\n ? '[&>*:first-child]:rounded-e-none [&>*:last-child]:rounded-s-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ms-px'\n : 'gap-1',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type ToggleGroupItemProps = ComponentProps<typeof KobalteToggleGroup.Item> &\n VariantProps<typeof toggleVariants>\n\nexport function ToggleGroupItem(props: ToggleGroupItemProps) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'size', 'onKeyDown'])\n\n return (\n <KobalteToggleGroup.Item\n data-slot=\"toggle-group-item\"\n class={cn(toggleVariants({ variant: local.variant, size: local.size }), local.class)}\n onKeyDown={(event) => {\n callHandler(local.onKeyDown, event)\n // The group root's selection collection clears the selection and marks\n // Escape handled, which starves an enclosing dialog or drawer of the\n // Escape it needs to dismiss. Stopping at the focused item is the only\n // point before that handler, so pass Escape through from here.\n if (event.key === 'Escape') event.stopPropagation()\n }}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;AAoCA,SAAgBA,cAAYc,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO;EAAC;EAAS;EAAY;CAAU,CAAC;CAEzE,OAAAG,gBACGhB,aAAkBiB,WAAA;EAAA,aAAA;EAAA,IAEjBR,WAAQ;GAAA,OAAEK,MAAML,YAAY;EAAK;EAAA,KAAA,WAAA;GAAA,OAC1BJ,GACL,oCACAS,MAAMF,WACF,0JACA,SACJE,MAAMI,KACR;EAAC;CAAA,GACGH,IAAI,CAAA;AAGd;AAKA,SAAgBM,gBAAgBR,OAA6B;CAC3D,MAAM,CAACC,OAAOC,QAAQb,WAAWW,OAAO;EAAC;EAAS;EAAW;EAAQ;CAAW,CAAC;CAEjF,OAAAG,gBACGhB,YAAmBoB,MAAIH,WAAA;EAAA,aAAA;EAAA,KAAA,WAAA;GAAA,OAEfZ,GAAGC,eAAe;IAAEI,SAASI,MAAMJ;IAASC,MAAMG,MAAMH;GAAK,CAAC,GAAGG,MAAMI,KAAK;EAAC;EACpFI,YAAYC,UAAU;GACpBpB,YAAYW,MAAMQ,WAAWC,KAAK;GAKlC,IAAIA,MAAMC,QAAQ,UAAUD,MAAME,gBAAgB;EACpD;CAAC,GACGV,IAAI,CAAA;AAGd"}
1
+ {"version":3,"file":"toggle-group.js","names":["ToggleGroup","KobalteToggleGroup","splitProps","callHandler","cn","toggleVariants","multiple","variant","size","attached","props","local","rest","_$createComponent","_$mergeProps","class","Item","ToggleGroupItem","onKeyDown","event","key","stopPropagation"],"sources":["../../../../src/components/ui/toggle-group/toggle-group.tsx"],"sourcesContent":["import { ToggleGroup as KobalteToggleGroup } from '@kobalte/core/toggle-group'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport type { VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\nimport { toggleVariants } from '../toggle'\n\n/**\n * ToggleGroup.\n *\n * A set of related toggles that behave as one control: at most one pressed\n * (`multiple={false}`, the default) or any number (`multiple={true}`). The\n * group owns the selection and the roving focus, which is what makes arrow keys\n * move between items and a screen reader announce the position within the set.\n * A row of independent Toggles looks identical and does neither.\n *\n * `attached` joins the items into one rounded run for a segmented control. The\n * joining lives on the *group*, via child selectors, so an item never has to\n * know whether it sits at an end — which is also where the border collapse\n * (`-ms-px`) belongs.\n */\n/**\n * `multiple` is optional here although Kobalte requires it: the primitive models\n * single and multiple selection as two shapes, which forces every caller to state\n * the obvious. Defaulting to single selection keeps the common case a one-word\n * component, and a caller that wants many passes `multiple`.\n */\nexport type ToggleGroupProps = Omit<ComponentProps<typeof KobalteToggleGroup>, 'multiple'> & {\n multiple?: boolean\n variant?: VariantProps<typeof toggleVariants>['variant']\n size?: VariantProps<typeof toggleVariants>['size']\n /** Join the items into one rounded run instead of a spaced row. */\n attached?: boolean\n}\n\nexport function ToggleGroup(props: ToggleGroupProps) {\n const [local, rest] = splitProps(props, ['class', 'attached', 'multiple'])\n\n return (\n <KobalteToggleGroup\n data-slot=\"toggle-group\"\n multiple={local.multiple ?? false}\n class={cn(\n 'flex w-fit flex-row items-center',\n local.attached\n ? '[&>*:first-child]:rounded-e-none [&>*:last-child]:rounded-s-none [&>*:not(:first-child):not(:last-child)]:rounded-none [&>*:not(:first-child)]:-ms-px'\n : 'gap-1',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type ToggleGroupItemProps = ComponentProps<typeof KobalteToggleGroup.Item> &\n VariantProps<typeof toggleVariants>\n\nexport function ToggleGroupItem(props: ToggleGroupItemProps) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'size', 'onKeyDown'])\n\n return (\n <KobalteToggleGroup.Item\n data-slot=\"toggle-group-item\"\n class={cn(toggleVariants({ variant: local.variant, size: local.size }), local.class)}\n onKeyDown={(event) => {\n callHandler(local.onKeyDown, event)\n // The group root's selection collection clears the selection and marks\n // Escape handled, which starves an enclosing dialog or drawer of the\n // Escape it needs to dismiss. Stopping at the focused item is the only\n // point before that handler, so pass Escape through from here.\n if (event.key === 'Escape') event.stopPropagation()\n }}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;AAoCA,SAAgBA,cAAYU,OAAyB;CACnD,MAAM,CAACC,OAAOC,QAAQV,WAAWQ,OAAO;EAAC;EAAS;EAAY;CAAU,CAAC;CAEzE,OAAAG,gBACGZ,aAAkBa,WAAA;EAAA,aAAA;EAAA,IAEjBR,WAAQ;GAAA,OAAEK,MAAML,YAAY;EAAK;EAAA,KAAA,WAAA;GAAA,OAC1BF,GACL,oCACAO,MAAMF,WACF,0JACA,SACJE,MAAMI,KACR;EAAC;CAAA,GACGH,IAAI,CAAA;AAGd;AAKA,SAAgBK,gBAAgBP,OAA6B;CAC3D,MAAM,CAACC,OAAOC,QAAQV,WAAWQ,OAAO;EAAC;EAAS;EAAW;EAAQ;CAAW,CAAC;CAEjF,OAAAG,gBACGZ,YAAmBe,MAAIF,WAAA;EAAA,aAAA;EAAA,KAAA,WAAA;GAAA,OAEfV,GAAGC,eAAe;IAAEE,SAASI,MAAMJ;IAASC,MAAMG,MAAMH;GAAK,CAAC,GAAGG,MAAMI,KAAK;EAAC;EACpFG,YAAYC,UAAU;GACpBhB,YAAYQ,MAAMO,WAAWC,KAAK;GAKlC,IAAIA,MAAMC,QAAQ,UAAUD,MAAME,gBAAgB;EACpD;CAAC,GACGT,IAAI,CAAA;AAGd"}
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","names":["Tooltip","KobalteTooltip","useTooltipContext","Accessor","ComponentProps","JSX","createContext","createEffect","createSignal","createUniqueId","onCleanup","Show","splitProps","useContext","isServer","callHandler","tooltipMotion","tooltipTip","topLayerProps","acquireTooltipFocusGate","releaseTooltipFocusGate","cn","TooltipTiming","openDelay","closeDelay","skipDelayDuration","tooltipDefaults","TooltipTimingContext","POINTER_CLOSE_INTENT_SLACK_MS","TooltipEscapeTargetContext","element","HTMLElement","dismiss","event","KeyboardEvent","ESCAPE_LAYER_SELECTOR","TooltipInteraction","id","trigger","setTrigger","isOpen","isDisabled","isTriggerFocused","markOpenIntent","clearOpenIntent","requestCloseFromAnotherTooltip","markPointerCloseIntent","clearPointerCloseIntent","markCloseIntent","TooltipInteractionContext","openTooltipInteractions","Set","pendingTooltipOpenId","tooltipScrollListenerAttached","clearPendingTooltipOpen","undefined","tooltipScrollContainsTrigger","Event","target","window","Node","contains","handleTooltipScroll","interaction","handleTooltipPointerMove","PointerEvent","setTooltipInteractionOpen","open","has","add","addEventListener","document","delete","size","removeEventListener","registerTooltipInteraction","TooltipProviderProps","children","TooltipProvider","props","_$createComponent","Provider","value","TooltipRootProps","timing","local","rest","controlled","uncontrolledOpen","setUncontrolledOpen","defaultOpen","closeIntent","ignoreDuplicateClose","onOpenChange","next","source","pointerCloseIntentUntil","pointerCloseIntentTimeout","ReturnType","setTimeout","clearTimeout","intentWindow","Date","now","queueMicrotask","disabled","Boolean","activeElement","openInteraction","focusedTrigger","anotherTooltipOpening","pointerClosePending","handleKeyDown","key","_$mergeProps","TooltipTrigger","Trigger","ref","onFocus","defaultPrevented","onBlur","onPointerEnter","onPointerLeave","onClick","TooltipContentProps","Content","icon","Element","TooltipContent","context","escapeTarget","Portal","class","style","aria-hidden","_$memo","onEscapeKeyDown","layer","closest","onPointerDownOutside","when","_el$","_tmpl$","_$insert","_$createComponent","Tooltip","KobalteTooltip","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/tooltip/tooltip.tsx"],"sourcesContent":["import { Tooltip as KobalteTooltip, useTooltipContext } from '@kobalte/core/tooltip'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport {\n createContext,\n createEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n Show,\n splitProps,\n useContext,\n} from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport { callHandler } from '#lib/events'\nimport { tooltipMotion, tooltipTip, topLayerProps } from '#lib/overlay'\nimport { acquireTooltipFocusGate, releaseTooltipFocusGate } from '#lib/tooltip-focus-gate'\nimport { cn } from '#lib/utils'\n\n/**\n * The provider sets the *timing* defaults for every tooltip below it.\n *\n * Timing is the part of a tooltip that has to agree across an app: one that\n * opens in 200ms in a toolbar and 700ms in a sidebar reads as a bug. The\n * provider is where that agreement lives. It is optional — a tooltip outside a\n * provider falls back to the same defaults — so a consumer can drop it in\n * without restructuring anything.\n */\ntype TooltipTiming = {\n openDelay: number\n closeDelay: number\n skipDelayDuration: number\n}\n\nconst tooltipDefaults: TooltipTiming = {\n /** Long enough that a pointer crossing a toolbar does not strobe tooltips. */\n openDelay: 400,\n /** Short, because the pointer has already left the control. */\n closeDelay: 80,\n /**\n * After a tooltip has been seen, the next one opens immediately for this\n * long. This is what makes moving along a row of icons feel like one\n * gesture instead of four separate waits.\n */\n skipDelayDuration: 500,\n}\n\nconst TooltipTimingContext = createContext<TooltipTiming>(tooltipDefaults)\n\n/**\n * How long after a pointer leaves a keyboard-focused trigger its close request\n * still counts as the pointer's: Kobalte reports that close one `closeDelay`\n * later, plus a frame of slack for the timer to fire.\n */\nconst POINTER_CLOSE_INTENT_SLACK_MS = 50\n\n/**\n * The layer a tooltip sits in, when that layer closes on Escape.\n *\n * Kobalte stacks a tooltip's content as the top-most dismissable layer, and\n * only the top-most layer receives Escape — so a tip shown on a focused\n * control inside a dialog took the key the dialog needed, and stayed the top\n * layer for its exit animation. A tip is never a stop for Escape: when it\n * receives the key it closes and passes it on to this layer, provided focus is\n * still inside that layer and in no menu, listbox or popover stacked between\n * them. The layer's own Escape handler runs first and can still keep it open.\n * Dialog-shaped overlays provide it; nothing else needs to.\n */\nexport const TooltipEscapeTargetContext = createContext<{\n element: Accessor<HTMLElement | undefined>\n dismiss: (event: KeyboardEvent) => void\n}>()\n\n/** The layers that take Escape before the dialog-shaped one around them. */\nconst ESCAPE_LAYER_SELECTOR = '[role$=dialog],[role=menu],[role=listbox]'\n\ntype TooltipInteraction = {\n id: string\n trigger: () => HTMLElement | undefined\n setTrigger: (element: HTMLElement) => void\n isOpen: () => boolean\n isDisabled: () => boolean\n isTriggerFocused: () => boolean\n markOpenIntent: () => void\n clearOpenIntent: () => void\n requestCloseFromAnotherTooltip: () => void\n markPointerCloseIntent: () => void\n clearPointerCloseIntent: () => void\n markCloseIntent: () => void\n}\n\nconst TooltipInteractionContext = createContext<TooltipInteraction>()\nconst openTooltipInteractions = new Set<TooltipInteraction>()\nlet pendingTooltipOpenId: string | undefined\nlet tooltipScrollListenerAttached = false\n\nfunction clearPendingTooltipOpen(id: string) {\n if (pendingTooltipOpenId === id) pendingTooltipOpenId = undefined\n}\n\nfunction tooltipScrollContainsTrigger(event: Event, trigger: HTMLElement) {\n const target = event.target\n return target === window || (target instanceof Node && target.contains(trigger))\n}\n\nfunction handleTooltipScroll(event: Event) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n if (interaction.isOpen() && trigger && tooltipScrollContainsTrigger(event, trigger)) {\n interaction.markCloseIntent()\n }\n }\n}\n\nfunction handleTooltipPointerMove(event: PointerEvent) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n const target = event.target\n if (\n interaction.isOpen() &&\n interaction.isTriggerFocused() &&\n trigger &&\n !(target instanceof Node && trigger.contains(target))\n ) {\n interaction.markPointerCloseIntent()\n }\n }\n}\n\nfunction setTooltipInteractionOpen(interaction: TooltipInteraction, open: boolean) {\n if (isServer) return\n\n if (open) {\n if (openTooltipInteractions.has(interaction)) return\n openTooltipInteractions.add(interaction)\n if (!tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = true\n // Register before Kobalte's global listeners so intentional scroll\n // dismissal can be distinguished from its delayed pointer dismissal.\n window.addEventListener('scroll', handleTooltipScroll, true)\n document.addEventListener('pointermove', handleTooltipPointerMove, true)\n }\n } else {\n openTooltipInteractions.delete(interaction)\n if (openTooltipInteractions.size === 0 && tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = false\n window.removeEventListener('scroll', handleTooltipScroll, true)\n document.removeEventListener('pointermove', handleTooltipPointerMove, true)\n }\n }\n}\n\nfunction registerTooltipInteraction(interaction: TooltipInteraction) {\n onCleanup(() => {\n setTooltipInteractionOpen(interaction, false)\n clearPendingTooltipOpen(interaction.id)\n })\n}\n\nexport type TooltipProviderProps = {\n children?: ComponentProps<'div'>['children']\n openDelay?: number\n closeDelay?: number\n skipDelayDuration?: number\n}\n\nexport function TooltipProvider(props: TooltipProviderProps) {\n return (\n <TooltipTimingContext.Provider\n value={{\n openDelay: props.openDelay ?? tooltipDefaults.openDelay,\n closeDelay: props.closeDelay ?? tooltipDefaults.closeDelay,\n skipDelayDuration: props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration,\n }}\n >\n {props.children}\n </TooltipTimingContext.Provider>\n )\n}\n\nexport type TooltipRootProps = ComponentProps<typeof KobalteTooltip>\n\nexport function Tooltip(props: TooltipRootProps) {\n // One document-level focus gate for every tooltip in the document: the first\n // tooltip acquires it, the last to unmount releases it. This is what keeps a\n // dialog's autofocus and an overlay's focus restoration from opening a tip —\n // see #lib/tooltip-focus-gate for the contract and the two over-reach traps\n // (pointer gestures and separator resize grips) it must not swallow.\n if (!isServer) {\n acquireTooltipFocusGate()\n onCleanup(releaseTooltipFocusGate)\n }\n const timing = useContext(TooltipTimingContext)\n const [local, rest] = splitProps(props, ['open', 'defaultOpen', 'onOpenChange', 'disabled'])\n const id = createUniqueId()\n const controlled = () => local.open !== undefined\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? false)\n const isOpen = () => (controlled() ? (local.open ?? false) : uncontrolledOpen())\n const [trigger, setTrigger] = createSignal<HTMLElement>()\n let closeIntent = false\n let ignoreDuplicateClose = false\n let onOpenChange: (next: boolean, source?: 'handoff') => void\n let pointerCloseIntentUntil = 0\n let pointerCloseIntentTimeout: ReturnType<typeof setTimeout> | undefined\n const clearPointerCloseIntent = () => {\n pointerCloseIntentUntil = 0\n if (pointerCloseIntentTimeout) clearTimeout(pointerCloseIntentTimeout)\n pointerCloseIntentTimeout = undefined\n }\n const markPointerCloseIntent = () => {\n if (!isOpen()) return\n clearPointerCloseIntent()\n const intentWindow = (props.closeDelay ?? timing.closeDelay) + POINTER_CLOSE_INTENT_SLACK_MS\n pointerCloseIntentUntil = Date.now() + intentWindow\n pointerCloseIntentTimeout = setTimeout(clearPointerCloseIntent, intentWindow)\n }\n const markCloseIntent = () => {\n closeIntent = true\n clearPointerCloseIntent()\n queueMicrotask(() => {\n closeIntent = false\n })\n }\n const requestCloseFromAnotherTooltip = () => {\n if (!isOpen()) return\n\n // Another trigger is an explicit handoff, even when a focused tooltip has\n // a pending pointer-close intent that would otherwise suppress Kobalte's\n // close callback. Route the request through the same controlled/uncontrolled\n // state contract as Kobalte and ignore its duplicate callback for this turn.\n ignoreDuplicateClose = true\n queueMicrotask(() => {\n ignoreDuplicateClose = false\n })\n onOpenChange(false, 'handoff')\n }\n const interaction: TooltipInteraction = {\n id,\n trigger,\n setTrigger,\n isOpen,\n isDisabled: () => local.disabled ?? false,\n isTriggerFocused: () =>\n Boolean(trigger() && typeof document !== 'undefined' && trigger() === document.activeElement),\n markOpenIntent: () => {\n clearPointerCloseIntent()\n pendingTooltipOpenId = id\n // A focused tooltip ignores ordinary pointer movement, but entering or\n // focusing another tooltip is an explicit transfer.\n for (const openInteraction of openTooltipInteractions) {\n if (openInteraction.id !== id) openInteraction.requestCloseFromAnotherTooltip()\n }\n },\n clearOpenIntent: () => clearPendingTooltipOpen(id),\n requestCloseFromAnotherTooltip,\n markPointerCloseIntent,\n clearPointerCloseIntent,\n markCloseIntent,\n }\n registerTooltipInteraction(interaction)\n onCleanup(() => {\n clearPointerCloseIntent()\n ignoreDuplicateClose = false\n })\n if (isOpen()) setTooltipInteractionOpen(interaction, true)\n createEffect(() => setTooltipInteractionOpen(interaction, isOpen()))\n onOpenChange = (next: boolean, source) => {\n if (!next && source !== 'handoff' && ignoreDuplicateClose) return\n\n if (next) {\n clearPendingTooltipOpen(id)\n clearPointerCloseIntent()\n // Install this capture listener before Kobalte's open-state effect adds\n // its scroll listener later in the same update.\n setTooltipInteractionOpen(interaction, true)\n } else {\n const focusedTrigger = interaction.isTriggerFocused()\n const anotherTooltipOpening =\n pendingTooltipOpenId !== undefined && pendingTooltipOpenId !== id\n const pointerClosePending = Date.now() <= pointerCloseIntentUntil\n if (\n source !== 'handoff' &&\n focusedTrigger &&\n pointerClosePending &&\n !closeIntent &&\n !anotherTooltipOpening\n ) {\n clearPointerCloseIntent()\n return\n }\n closeIntent = false\n clearPointerCloseIntent()\n clearPendingTooltipOpen(id)\n }\n\n if (!controlled()) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n if (next) {\n // A controlled parent can reject the open request without changing its\n // signal, so the effect above would not rerun to release this listener.\n queueMicrotask(() => {\n if (!isOpen()) setTooltipInteractionOpen(interaction, false)\n })\n }\n }\n\n // Kobalte dismisses on Escape only when its content owns the top-most\n // layer, and a handoff keeps the previous tooltip's content mounted while\n // it exits — swallowing the key for the tooltip that just took over.\n // Listening on document (capture) closes this tooltip first; the layer's\n // own handler still runs for anything stacked above it.\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return\n markCloseIntent()\n onOpenChange(false)\n }\n createEffect(() => {\n if (isServer || !isOpen()) return\n document.addEventListener('keydown', handleKeyDown, true)\n onCleanup(() => document.removeEventListener('keydown', handleKeyDown, true))\n })\n\n return (\n <TooltipInteractionContext.Provider value={interaction}>\n <KobalteTooltip\n open={isOpen()}\n onOpenChange={onOpenChange}\n disabled={local.disabled}\n openDelay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n skipDelayDuration={props.skipDelayDuration ?? timing.skipDelayDuration}\n {...rest}\n />\n </TooltipInteractionContext.Provider>\n )\n}\n\nexport function TooltipTrigger(props: ComponentProps<typeof KobalteTooltip.Trigger>) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'ref',\n 'onFocus',\n 'onBlur',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onClick',\n ])\n\n return (\n <KobalteTooltip.Trigger\n {...rest}\n ref={(element) => {\n interaction?.setTrigger(element)\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onFocus={(event) => {\n callHandler(local.onFocus, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onBlur={(event) => {\n callHandler(local.onBlur, event)\n interaction?.clearOpenIntent()\n interaction?.markCloseIntent()\n }}\n onPointerEnter={(event) => {\n callHandler(local.onPointerEnter, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onPointerLeave={(event) => {\n callHandler(local.onPointerLeave, event)\n interaction?.clearOpenIntent()\n interaction?.markPointerCloseIntent()\n }}\n onClick={(event) => {\n callHandler(local.onClick, event)\n interaction?.markCloseIntent()\n }}\n />\n )\n}\n\nexport type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content> & {\n /**\n * A leading icon, repeating the trigger's glyph inside the tip — the side\n * rail's icon+label treatment, offered so a toolbar or rail tooltip does not\n * have to hand-roll it. Decorative by contract: the tip is `aria-hidden`\n * while closed and never the accessible name, so the icon must not be the\n * only carrier of meaning. Size it by leaving the svg bare; the slot fixes\n * it to the system's control size.\n */\n icon?: JSX.Element\n}\n\nexport function TooltipContent(props: TooltipContentProps) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'icon',\n 'aria-hidden',\n 'onEscapeKeyDown',\n 'onPointerDownOutside',\n ])\n const context = useTooltipContext()\n const escapeTarget = useContext(TooltipEscapeTargetContext)\n\n // Kobalte keeps force-mounted and exiting content present after close. Hide\n // that retained tooltip from assistive technology until it opens again.\n return (\n <KobalteTooltip.Portal>\n <KobalteTooltip.Content\n /* The slot is what base.css's pointer-transparency rule keys on; every\n tip carries it, so no consumer has to remember to pass it. */\n data-slot=\"tooltip-content\"\n class={cn(\n tooltipTip,\n // The max width is a token, not a fixed measure: it has to fall\n // behind the viewport at large root font sizes or the tip — which\n // Kobalte can shift but never shrink — forces a horizontal scroll.\n 'z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-2 py-1',\n 'origin-(--kb-tooltip-content-transform-origin) text-balance',\n tooltipMotion,\n // An icon+label tip is one row that reads as a unit, so the label\n // never wraps under the glyph.\n { 'flex items-center gap-2 whitespace-nowrap': !!local.icon },\n local.class\n )}\n // A tooltip is never interactive: the content is plain text, and the\n // placement draws the tip below its action — where a hit-testing tip\n // would hold the next control hostage, open or departing. Kobalte\n // inlines pointer-events auto, so this is forced after its merge; the\n // pointer belongs to the control underneath.\n style={{ 'pointer-events': 'none' }}\n aria-hidden={context.isOpen() ? local['aria-hidden'] : true}\n onEscapeKeyDown={(event) => {\n local.onEscapeKeyDown?.(event)\n if (event.defaultPrevented) return\n interaction?.markCloseIntent()\n const layer = escapeTarget?.element()\n if (layer && document.activeElement?.closest(ESCAPE_LAYER_SELECTOR) === layer)\n escapeTarget?.dismiss(event)\n }}\n onPointerDownOutside={(event) => {\n local.onPointerDownOutside?.(event)\n if (!event.defaultPrevented) interaction?.markCloseIntent()\n }}\n // A tooltip opened from inside a modal dialog is part of that dialog's\n // surface, so it carries the same top-layer exemption as a menu or a\n // popover — without it the dialog's hide-outside observer aria-hides\n // the tip while it is on screen.\n {...topLayerProps}\n {...rest}\n >\n <Show when={local.icon}>\n {(icon) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\"\n >\n {icon()}\n </span>\n )}\n </Show>\n {local.children}\n </KobalteTooltip.Content>\n </KobalteTooltip.Portal>\n )\n}\n"],"mappings":";;;;;;;;;AAiCA,IAAM0B,kBAAiC;;CAErCH,WAAW;;CAEXC,YAAY;;;;;;CAMZC,mBAAmB;AACrB;AAEA,IAAME,uBAAuBrB,cAA6BoB,eAAe;;;;;;AAOzE,IAAME,gCAAgC;;;;;;;;;;;;;AActC,IAAaC,6BAA6BvB,cAGvC;;AAGH,IAAM6B,wBAAwB;AAiB9B,IAAMc,4BAA4B3C,cAAkC;AACpE,IAAM4C,0CAA0B,IAAIC,IAAwB;AAC5D,IAAIC;AACJ,IAAIC,gCAAgC;AAEpC,SAASC,wBAAwBjB,IAAY;CAC3C,IAAIe,yBAAyBf,IAAIe,uBAAuBG,KAAAA;AAC1D;AAEA,SAASC,6BAA6BvB,OAAcK,SAAsB;CACxE,MAAMoB,SAASzB,MAAMyB;CACrB,OAAOA,WAAWC,UAAWD,kBAAkBE,QAAQF,OAAOG,SAASvB,OAAO;AAChF;AAEA,SAASwB,oBAAoB7B,OAAc;CACzC,KAAK,MAAM8B,eAAeb,yBAAyB;EACjD,MAAMZ,UAAUyB,YAAYzB,QAAQ;EACpC,IAAIyB,YAAYvB,OAAO,KAAKF,WAAWkB,6BAA6BvB,OAAOK,OAAO,GAChFyB,YAAYf,gBAAgB;CAEhC;AACF;AAEA,SAASgB,yBAAyB/B,OAAqB;CACrD,KAAK,MAAM8B,eAAeb,yBAAyB;EACjD,MAAMZ,UAAUyB,YAAYzB,QAAQ;EACpC,MAAMoB,SAASzB,MAAMyB;EACrB,IACEK,YAAYvB,OAAO,KACnBuB,YAAYrB,iBAAiB,KAC7BJ,WAC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AAAT,WAAA;GAAA,OAAA,CAAAG,gBAEPrE,MAAI;IAAA,IAACiI,OAAI;KAAA,OAAEvD,MAAMyC;IAAI;IAAAjD,WAClBiD,gBAAI;KAAA,IAAAe,OAAAC,OAAA;KAAAC,OAAAF,MAMDf,IAAI;KAAA,OAAAe;IAAA,EAAA,CAAA;GAER,CAAA,GAAAN,WAEFlD,MAAMR,QAAQ,CAAA;EAAA,EAAA,CAAA,CAAA;CAAA,EAAA,CAAA;AAIvB"}
1
+ {"version":3,"file":"tooltip.js","names":["Tooltip","KobalteTooltip","useTooltipContext","createContext","createEffect","createSignal","createUniqueId","onCleanup","Show","splitProps","useContext","isServer","callHandler","tooltipMotion","tooltipTip","topLayerProps","acquireTooltipFocusGate","releaseTooltipFocusGate","cn","openDelay","closeDelay","skipDelayDuration","tooltipDefaults","TooltipTimingContext","POINTER_CLOSE_INTENT_SLACK_MS","TooltipEscapeTargetContext","element","dismiss","event","ESCAPE_LAYER_SELECTOR","id","trigger","setTrigger","isOpen","isDisabled","isTriggerFocused","markOpenIntent","clearOpenIntent","requestCloseFromAnotherTooltip","markPointerCloseIntent","clearPointerCloseIntent","markCloseIntent","TooltipInteractionContext","openTooltipInteractions","Set","pendingTooltipOpenId","tooltipScrollListenerAttached","clearPendingTooltipOpen","undefined","tooltipScrollContainsTrigger","target","window","Node","contains","handleTooltipScroll","interaction","handleTooltipPointerMove","setTooltipInteractionOpen","open","has","add","addEventListener","document","delete","size","removeEventListener","registerTooltipInteraction","children","TooltipProvider","props","_$createComponent","Provider","value","timing","local","rest","controlled","uncontrolledOpen","setUncontrolledOpen","defaultOpen","closeIntent","ignoreDuplicateClose","onOpenChange","next","source","pointerCloseIntentUntil","pointerCloseIntentTimeout","setTimeout","clearTimeout","intentWindow","Date","now","queueMicrotask","disabled","Boolean","activeElement","openInteraction","focusedTrigger","anotherTooltipOpening","handleKeyDown","key","_$mergeProps","TooltipTrigger","Trigger","ref","onFocus","defaultPrevented","onBlur","onPointerEnter","onPointerLeave","onClick","Content","icon","TooltipContent","context","escapeTarget","Portal","class","style","_$memo","onEscapeKeyDown","layer","closest","onPointerDownOutside","when","_el$","_tmpl$","_$insert"],"sources":["../../../../src/components/ui/tooltip/tooltip.tsx"],"sourcesContent":["import { Tooltip as KobalteTooltip, useTooltipContext } from '@kobalte/core/tooltip'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport {\n createContext,\n createEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n Show,\n splitProps,\n useContext,\n} from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport { callHandler } from '#lib/events'\nimport { tooltipMotion, tooltipTip, topLayerProps } from '#lib/overlay'\nimport { acquireTooltipFocusGate, releaseTooltipFocusGate } from '#lib/tooltip-focus-gate'\nimport { cn } from '#lib/utils'\n\n/**\n * The provider sets the *timing* defaults for every tooltip below it.\n *\n * Timing is the part of a tooltip that has to agree across an app: one that\n * opens in 200ms in a toolbar and 700ms in a sidebar reads as a bug. The\n * provider is where that agreement lives. It is optional — a tooltip outside a\n * provider falls back to the same defaults — so a consumer can drop it in\n * without restructuring anything.\n */\ntype TooltipTiming = {\n openDelay: number\n closeDelay: number\n skipDelayDuration: number\n}\n\nconst tooltipDefaults: TooltipTiming = {\n /** Long enough that a pointer crossing a toolbar does not strobe tooltips. */\n openDelay: 400,\n /** Short, because the pointer has already left the control. */\n closeDelay: 80,\n /**\n * After a tooltip has been seen, the next one opens immediately for this\n * long. This is what makes moving along a row of icons feel like one\n * gesture instead of four separate waits.\n */\n skipDelayDuration: 500,\n}\n\nconst TooltipTimingContext = createContext<TooltipTiming>(tooltipDefaults)\n\n/**\n * How long after a pointer leaves a keyboard-focused trigger its close request\n * still counts as the pointer's: Kobalte reports that close one `closeDelay`\n * later, plus a frame of slack for the timer to fire.\n */\nconst POINTER_CLOSE_INTENT_SLACK_MS = 50\n\n/**\n * The layer a tooltip sits in, when that layer closes on Escape.\n *\n * Kobalte stacks a tooltip's content as the top-most dismissable layer, and\n * only the top-most layer receives Escape — so a tip shown on a focused\n * control inside a dialog took the key the dialog needed, and stayed the top\n * layer for its exit animation. A tip is never a stop for Escape: when it\n * receives the key it closes and passes it on to this layer, provided focus is\n * still inside that layer and in no menu, listbox or popover stacked between\n * them. The layer's own Escape handler runs first and can still keep it open.\n * Dialog-shaped overlays provide it; nothing else needs to.\n */\nexport const TooltipEscapeTargetContext = createContext<{\n element: Accessor<HTMLElement | undefined>\n dismiss: (event: KeyboardEvent) => void\n}>()\n\n/** The layers that take Escape before the dialog-shaped one around them. */\nconst ESCAPE_LAYER_SELECTOR = '[role$=dialog],[role=menu],[role=listbox]'\n\ntype TooltipInteraction = {\n id: string\n trigger: () => HTMLElement | undefined\n setTrigger: (element: HTMLElement) => void\n isOpen: () => boolean\n isDisabled: () => boolean\n isTriggerFocused: () => boolean\n markOpenIntent: () => void\n clearOpenIntent: () => void\n requestCloseFromAnotherTooltip: () => void\n markPointerCloseIntent: () => void\n clearPointerCloseIntent: () => void\n markCloseIntent: () => void\n}\n\nconst TooltipInteractionContext = createContext<TooltipInteraction>()\nconst openTooltipInteractions = new Set<TooltipInteraction>()\nlet pendingTooltipOpenId: string | undefined\nlet tooltipScrollListenerAttached = false\n\nfunction clearPendingTooltipOpen(id: string) {\n if (pendingTooltipOpenId === id) pendingTooltipOpenId = undefined\n}\n\nfunction tooltipScrollContainsTrigger(event: Event, trigger: HTMLElement) {\n const target = event.target\n return target === window || (target instanceof Node && target.contains(trigger))\n}\n\nfunction handleTooltipScroll(event: Event) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n if (interaction.isOpen() && trigger && tooltipScrollContainsTrigger(event, trigger)) {\n interaction.markCloseIntent()\n }\n }\n}\n\nfunction handleTooltipPointerMove(event: PointerEvent) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n const target = event.target\n if (\n interaction.isOpen() &&\n interaction.isTriggerFocused() &&\n trigger &&\n !(target instanceof Node && trigger.contains(target))\n ) {\n interaction.markPointerCloseIntent()\n }\n }\n}\n\nfunction setTooltipInteractionOpen(interaction: TooltipInteraction, open: boolean) {\n if (isServer) return\n\n if (open) {\n if (openTooltipInteractions.has(interaction)) return\n openTooltipInteractions.add(interaction)\n if (!tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = true\n // Register before Kobalte's global listeners so intentional scroll\n // dismissal can be distinguished from its delayed pointer dismissal.\n window.addEventListener('scroll', handleTooltipScroll, true)\n document.addEventListener('pointermove', handleTooltipPointerMove, true)\n }\n } else {\n openTooltipInteractions.delete(interaction)\n if (openTooltipInteractions.size === 0 && tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = false\n window.removeEventListener('scroll', handleTooltipScroll, true)\n document.removeEventListener('pointermove', handleTooltipPointerMove, true)\n }\n }\n}\n\nfunction registerTooltipInteraction(interaction: TooltipInteraction) {\n onCleanup(() => {\n setTooltipInteractionOpen(interaction, false)\n clearPendingTooltipOpen(interaction.id)\n })\n}\n\nexport type TooltipProviderProps = {\n children?: ComponentProps<'div'>['children']\n openDelay?: number\n closeDelay?: number\n skipDelayDuration?: number\n}\n\nexport function TooltipProvider(props: TooltipProviderProps) {\n return (\n <TooltipTimingContext.Provider\n value={{\n openDelay: props.openDelay ?? tooltipDefaults.openDelay,\n closeDelay: props.closeDelay ?? tooltipDefaults.closeDelay,\n skipDelayDuration: props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration,\n }}\n >\n {props.children}\n </TooltipTimingContext.Provider>\n )\n}\n\nexport type TooltipRootProps = ComponentProps<typeof KobalteTooltip>\n\nexport function Tooltip(props: TooltipRootProps) {\n // One document-level focus gate for every tooltip in the document: the first\n // tooltip acquires it, the last to unmount releases it. This is what keeps a\n // dialog's autofocus and an overlay's focus restoration from opening a tip —\n // see #lib/tooltip-focus-gate for the contract and the two over-reach traps\n // (pointer gestures and separator resize grips) it must not swallow.\n if (!isServer) {\n acquireTooltipFocusGate()\n onCleanup(releaseTooltipFocusGate)\n }\n const timing = useContext(TooltipTimingContext)\n const [local, rest] = splitProps(props, ['open', 'defaultOpen', 'onOpenChange', 'disabled'])\n const id = createUniqueId()\n const controlled = () => local.open !== undefined\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? false)\n const isOpen = () => (controlled() ? (local.open ?? false) : uncontrolledOpen())\n const [trigger, setTrigger] = createSignal<HTMLElement>()\n let closeIntent = false\n let ignoreDuplicateClose = false\n let onOpenChange: (next: boolean, source?: 'handoff') => void\n let pointerCloseIntentUntil = 0\n let pointerCloseIntentTimeout: ReturnType<typeof setTimeout> | undefined\n const clearPointerCloseIntent = () => {\n pointerCloseIntentUntil = 0\n if (pointerCloseIntentTimeout) clearTimeout(pointerCloseIntentTimeout)\n pointerCloseIntentTimeout = undefined\n }\n const markPointerCloseIntent = () => {\n if (!isOpen()) return\n clearPointerCloseIntent()\n const intentWindow = (props.closeDelay ?? timing.closeDelay) + POINTER_CLOSE_INTENT_SLACK_MS\n pointerCloseIntentUntil = Date.now() + intentWindow\n pointerCloseIntentTimeout = setTimeout(clearPointerCloseIntent, intentWindow)\n }\n const markCloseIntent = () => {\n closeIntent = true\n clearPointerCloseIntent()\n queueMicrotask(() => {\n closeIntent = false\n })\n }\n const requestCloseFromAnotherTooltip = () => {\n if (!isOpen()) return\n\n // Another trigger is an explicit handoff, even when a focused tooltip has\n // a pending pointer-close intent that would otherwise suppress Kobalte's\n // close callback. Route the request through the same controlled/uncontrolled\n // state contract as Kobalte and ignore its duplicate callback for this turn.\n ignoreDuplicateClose = true\n queueMicrotask(() => {\n ignoreDuplicateClose = false\n })\n onOpenChange(false, 'handoff')\n }\n const interaction: TooltipInteraction = {\n id,\n trigger,\n setTrigger,\n isOpen,\n isDisabled: () => local.disabled ?? false,\n isTriggerFocused: () =>\n Boolean(trigger() && typeof document !== 'undefined' && trigger() === document.activeElement),\n markOpenIntent: () => {\n clearPointerCloseIntent()\n pendingTooltipOpenId = id\n // A focused tooltip ignores ordinary pointer movement, but entering or\n // focusing another tooltip is an explicit transfer.\n for (const openInteraction of openTooltipInteractions) {\n if (openInteraction.id !== id) openInteraction.requestCloseFromAnotherTooltip()\n }\n },\n clearOpenIntent: () => clearPendingTooltipOpen(id),\n requestCloseFromAnotherTooltip,\n markPointerCloseIntent,\n clearPointerCloseIntent,\n markCloseIntent,\n }\n registerTooltipInteraction(interaction)\n onCleanup(() => {\n clearPointerCloseIntent()\n ignoreDuplicateClose = false\n })\n if (isOpen()) setTooltipInteractionOpen(interaction, true)\n createEffect(() => setTooltipInteractionOpen(interaction, isOpen()))\n onOpenChange = (next: boolean, source) => {\n if (!next && source !== 'handoff' && ignoreDuplicateClose) return\n\n if (next) {\n clearPendingTooltipOpen(id)\n clearPointerCloseIntent()\n // Install this capture listener before Kobalte's open-state effect adds\n // its scroll listener later in the same update.\n setTooltipInteractionOpen(interaction, true)\n } else {\n const focusedTrigger = interaction.isTriggerFocused()\n const anotherTooltipOpening =\n pendingTooltipOpenId !== undefined && pendingTooltipOpenId !== id\n const pointerClosePending = Date.now() <= pointerCloseIntentUntil\n if (\n source !== 'handoff' &&\n focusedTrigger &&\n pointerClosePending &&\n !closeIntent &&\n !anotherTooltipOpening\n ) {\n clearPointerCloseIntent()\n return\n }\n closeIntent = false\n clearPointerCloseIntent()\n clearPendingTooltipOpen(id)\n }\n\n if (!controlled()) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n if (next) {\n // A controlled parent can reject the open request without changing its\n // signal, so the effect above would not rerun to release this listener.\n queueMicrotask(() => {\n if (!isOpen()) setTooltipInteractionOpen(interaction, false)\n })\n }\n }\n\n // Kobalte dismisses on Escape only when its content owns the top-most\n // layer, and a handoff keeps the previous tooltip's content mounted while\n // it exits — swallowing the key for the tooltip that just took over.\n // Listening on document (capture) closes this tooltip first; the layer's\n // own handler still runs for anything stacked above it.\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return\n markCloseIntent()\n onOpenChange(false)\n }\n createEffect(() => {\n if (isServer || !isOpen()) return\n document.addEventListener('keydown', handleKeyDown, true)\n onCleanup(() => document.removeEventListener('keydown', handleKeyDown, true))\n })\n\n return (\n <TooltipInteractionContext.Provider value={interaction}>\n <KobalteTooltip\n open={isOpen()}\n onOpenChange={onOpenChange}\n disabled={local.disabled}\n openDelay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n skipDelayDuration={props.skipDelayDuration ?? timing.skipDelayDuration}\n {...rest}\n />\n </TooltipInteractionContext.Provider>\n )\n}\n\nexport function TooltipTrigger(props: ComponentProps<typeof KobalteTooltip.Trigger>) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'ref',\n 'onFocus',\n 'onBlur',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onClick',\n ])\n\n return (\n <KobalteTooltip.Trigger\n {...rest}\n ref={(element) => {\n interaction?.setTrigger(element)\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onFocus={(event) => {\n callHandler(local.onFocus, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onBlur={(event) => {\n callHandler(local.onBlur, event)\n interaction?.clearOpenIntent()\n interaction?.markCloseIntent()\n }}\n onPointerEnter={(event) => {\n callHandler(local.onPointerEnter, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onPointerLeave={(event) => {\n callHandler(local.onPointerLeave, event)\n interaction?.clearOpenIntent()\n interaction?.markPointerCloseIntent()\n }}\n onClick={(event) => {\n callHandler(local.onClick, event)\n interaction?.markCloseIntent()\n }}\n />\n )\n}\n\nexport type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content> & {\n /**\n * A leading icon, repeating the trigger's glyph inside the tip — the side\n * rail's icon+label treatment, offered so a toolbar or rail tooltip does not\n * have to hand-roll it. Decorative by contract: the tip is `aria-hidden`\n * while closed and never the accessible name, so the icon must not be the\n * only carrier of meaning. Size it by leaving the svg bare; the slot fixes\n * it to the system's control size.\n */\n icon?: JSX.Element\n}\n\nexport function TooltipContent(props: TooltipContentProps) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'icon',\n 'aria-hidden',\n 'onEscapeKeyDown',\n 'onPointerDownOutside',\n ])\n const context = useTooltipContext()\n const escapeTarget = useContext(TooltipEscapeTargetContext)\n\n // Kobalte keeps force-mounted and exiting content present after close. Hide\n // that retained tooltip from assistive technology until it opens again.\n return (\n <KobalteTooltip.Portal>\n <KobalteTooltip.Content\n /* The slot is what base.css's pointer-transparency rule keys on; every\n tip carries it, so no consumer has to remember to pass it. */\n data-slot=\"tooltip-content\"\n class={cn(\n tooltipTip,\n // The max width is a token, not a fixed measure: it has to fall\n // behind the viewport at large root font sizes or the tip — which\n // Kobalte can shift but never shrink — forces a horizontal scroll.\n 'z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-2 py-1',\n 'origin-(--kb-tooltip-content-transform-origin) text-balance',\n tooltipMotion,\n // An icon+label tip is one row that reads as a unit, so the label\n // never wraps under the glyph.\n { 'flex items-center gap-2 whitespace-nowrap': !!local.icon },\n local.class\n )}\n // A tooltip is never interactive: the content is plain text, and the\n // placement draws the tip below its action — where a hit-testing tip\n // would hold the next control hostage, open or departing. Kobalte\n // inlines pointer-events auto, so this is forced after its merge; the\n // pointer belongs to the control underneath.\n style={{ 'pointer-events': 'none' }}\n aria-hidden={context.isOpen() ? local['aria-hidden'] : true}\n onEscapeKeyDown={(event) => {\n local.onEscapeKeyDown?.(event)\n if (event.defaultPrevented) return\n interaction?.markCloseIntent()\n const layer = escapeTarget?.element()\n if (layer && document.activeElement?.closest(ESCAPE_LAYER_SELECTOR) === layer)\n escapeTarget?.dismiss(event)\n }}\n onPointerDownOutside={(event) => {\n local.onPointerDownOutside?.(event)\n if (!event.defaultPrevented) interaction?.markCloseIntent()\n }}\n // A tooltip opened from inside a modal dialog is part of that dialog's\n // surface, so it carries the same top-layer exemption as a menu or a\n // popover — without it the dialog's hide-outside observer aria-hides\n // the tip while it is on screen.\n {...topLayerProps}\n {...rest}\n >\n <Show when={local.icon}>\n {(icon) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\"\n >\n {icon()}\n </span>\n )}\n </Show>\n {local.children}\n </KobalteTooltip.Content>\n </KobalteTooltip.Portal>\n )\n}\n"],"mappings":";;;;;;;;;AAiCA,IAAMsB,kBAAiC;;CAErCH,WAAW;;CAEXC,YAAY;;;;;;CAMZC,mBAAmB;AACrB;AAEA,IAAME,uBAAuBpB,cAA6BmB,eAAe;;;;;;AAOzE,IAAME,gCAAgC;;;;;;;;;;;;;AActC,IAAaC,6BAA6BtB,cAGvC;;AAGH,IAAM0B,wBAAwB;AAiB9B,IAAMa,4BAA4BvC,cAAkC;AACpE,IAAMwC,0CAA0B,IAAIC,IAAwB;AAC5D,IAAIC;AACJ,IAAIC,gCAAgC;AAEpC,SAASC,wBAAwBjB,IAAY;CAC3C,IAAIe,yBAAyBf,IAAIe,uBAAuBG,KAAAA;AAC1D;AAEA,SAASC,6BAA6BrB,OAAcG,SAAsB;CACxE,MAAMmB,SAAStB,MAAMsB;CACrB,OAAOA,WAAWC,UAAWD,kBAAkBE,QAAQF,OAAOG,SAAStB,OAAO;AAChF;AAEA,SAASuB,oBAAoB1B,OAAc;CACzC,KAAK,MAAM2B,eAAeZ,yBAAyB;EACjD,MAAMZ,UAAUwB,YAAYxB,QAAQ;EACpC,IAAIwB,YAAYtB,OAAO,KAAKF,WAAWkB,6BAA6BrB,OAAOG,OAAO,GAChFwB,YAAYd,gBAAgB;CAEhC;AACF;AAEA,SAASe,yBAAyB5B,OAAqB;CACrD,KAAK,MAAM2B,eAAeZ,yBAAyB;EACjD,MAAMZ,UAAUwB,YAAYxB,QAAQ;EACpC,MAAMmB,SAAStB,MAAMsB;EACrB,IACEK,YAAYtB,OAAO,KACnBsB,YAAYpB,iBAAiB,KAC7BJ,WACA,E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