@adea-ai/ui 0.116.0 → 0.118.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
  2. package/dist/components/composites/action-button/action-button.js +1 -0
  3. package/dist/components/composites/action-button/action-button.js.map +1 -1
  4. package/dist/components/composites/list-row/list-row-control.d.ts.map +1 -1
  5. package/dist/components/composites/list-row/list-row-control.js +1 -0
  6. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  7. package/dist/components/composites/list-row/list-row.d.ts.map +1 -1
  8. package/dist/components/composites/list-row/list-row.js +16 -9
  9. package/dist/components/composites/list-row/list-row.js.map +1 -1
  10. package/dist/components/composites/settings/settings-navigation.d.ts.map +1 -1
  11. package/dist/components/composites/settings/settings-navigation.js +15 -6
  12. package/dist/components/composites/settings/settings-navigation.js.map +1 -1
  13. package/dist/components/composites/settings/settings.d.ts +3 -2
  14. package/dist/components/composites/settings/settings.d.ts.map +1 -1
  15. package/dist/components/composites/settings/settings.js +3 -2
  16. package/dist/components/composites/settings/settings.js.map +1 -1
  17. package/dist/components/conversation/transcript-composition.d.ts +6 -0
  18. package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
  19. package/dist/components/conversation/transcript-composition.js +9 -4
  20. package/dist/components/conversation/transcript-composition.js.map +1 -1
  21. package/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts +2 -0
  22. package/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts.map +1 -1
  23. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +3 -0
  24. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
  25. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.d.ts.map +1 -1
  26. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
  27. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js.map +1 -1
  28. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts +2 -0
  29. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
  30. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +3 -1
  31. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  32. package/dist/components/ui/alert/alert.d.ts +7 -0
  33. package/dist/components/ui/alert/alert.d.ts.map +1 -1
  34. package/dist/components/ui/alert/alert.js +18 -1
  35. package/dist/components/ui/alert/alert.js.map +1 -1
  36. package/dist/components/ui/alert/index.d.ts +1 -1
  37. package/dist/components/ui/alert/index.d.ts.map +1 -1
  38. package/dist/components/ui/alert/index.js +2 -2
  39. package/dist/components/ui/badge/badge.d.ts.map +1 -1
  40. package/dist/components/ui/badge/badge.js +1 -0
  41. package/dist/components/ui/badge/badge.js.map +1 -1
  42. package/dist/components/ui/breadcrumb/breadcrumb.d.ts +6 -0
  43. package/dist/components/ui/breadcrumb/breadcrumb.d.ts.map +1 -1
  44. package/dist/components/ui/breadcrumb/breadcrumb.js +19 -8
  45. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  46. package/dist/components/ui/breadcrumb/index.d.ts +1 -1
  47. package/dist/components/ui/breadcrumb/index.d.ts.map +1 -1
  48. package/dist/components/ui/breadcrumb/index.js +2 -2
  49. package/dist/components/ui/button/button.d.ts.map +1 -1
  50. package/dist/components/ui/button/button.js +1 -0
  51. package/dist/components/ui/button/button.js.map +1 -1
  52. package/dist/components/ui/card/card.d.ts +19 -9
  53. package/dist/components/ui/card/card.d.ts.map +1 -1
  54. package/dist/components/ui/card/card.js +21 -3
  55. package/dist/components/ui/card/card.js.map +1 -1
  56. package/dist/components/ui/card/index.d.ts +1 -1
  57. package/dist/components/ui/card/index.d.ts.map +1 -1
  58. package/dist/components/ui/card/index.js +2 -2
  59. package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
  60. package/dist/components/ui/checkbox/checkbox.js +1 -0
  61. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  62. package/dist/components/ui/dialog/dialog.d.ts +15 -0
  63. package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
  64. package/dist/components/ui/dialog/dialog.js +11 -3
  65. package/dist/components/ui/dialog/dialog.js.map +1 -1
  66. package/dist/components/ui/dialog/index.d.ts +1 -1
  67. package/dist/components/ui/dialog/index.d.ts.map +1 -1
  68. package/dist/components/ui/entity-icon/entity-icon.d.ts +10 -0
  69. package/dist/components/ui/entity-icon/entity-icon.d.ts.map +1 -1
  70. package/dist/components/ui/entity-icon/entity-icon.js +11 -2
  71. package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
  72. package/dist/components/ui/field/field.d.ts +11 -1
  73. package/dist/components/ui/field/field.d.ts.map +1 -1
  74. package/dist/components/ui/field/field.js +2 -2
  75. package/dist/components/ui/field/field.js.map +1 -1
  76. package/dist/components/ui/field/index.d.ts +1 -1
  77. package/dist/components/ui/field/index.d.ts.map +1 -1
  78. package/dist/components/ui/input-group/index.d.ts +1 -1
  79. package/dist/components/ui/input-group/index.d.ts.map +1 -1
  80. package/dist/components/ui/input-group/input-group.d.ts +8 -1
  81. package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
  82. package/dist/components/ui/input-group/input-group.js +16 -20
  83. package/dist/components/ui/input-group/input-group.js.map +1 -1
  84. package/dist/components/ui/native-select/native-select.d.ts +8 -1
  85. package/dist/components/ui/native-select/native-select.d.ts.map +1 -1
  86. package/dist/components/ui/native-select/native-select.js +9 -2
  87. package/dist/components/ui/native-select/native-select.js.map +1 -1
  88. package/dist/components/ui/progress/progress.d.ts.map +1 -1
  89. package/dist/components/ui/progress/progress.js +6 -3
  90. package/dist/components/ui/progress/progress.js.map +1 -1
  91. package/dist/components/ui/radio-group/radio-group.d.ts +18 -3
  92. package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
  93. package/dist/components/ui/radio-group/radio-group.js +32 -7
  94. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  95. package/dist/components/ui/resizable/resizable.d.ts +7 -2
  96. package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
  97. package/dist/components/ui/resizable/resizable.js +7 -6
  98. package/dist/components/ui/resizable/resizable.js.map +1 -1
  99. package/dist/components/ui/select/select.d.ts.map +1 -1
  100. package/dist/components/ui/select/select.js +10 -7
  101. package/dist/components/ui/select/select.js.map +1 -1
  102. package/dist/components/ui/sheet/sheet.d.ts +1 -0
  103. package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
  104. package/dist/components/ui/sheet/sheet.js +27 -2
  105. package/dist/components/ui/sheet/sheet.js.map +1 -1
  106. package/dist/components/ui/slider/slider.d.ts.map +1 -1
  107. package/dist/components/ui/slider/slider.js +6 -3
  108. package/dist/components/ui/slider/slider.js.map +1 -1
  109. package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
  110. package/dist/components/ui/status-chip/status-chip.js +1 -1
  111. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  112. package/dist/components/ui/switch/switch.d.ts.map +1 -1
  113. package/dist/components/ui/switch/switch.js +1 -0
  114. package/dist/components/ui/switch/switch.js.map +1 -1
  115. package/dist/components/ui/tabs/tabs.d.ts +18 -0
  116. package/dist/components/ui/tabs/tabs.d.ts.map +1 -1
  117. package/dist/components/ui/tabs/tabs.js +22 -4
  118. package/dist/components/ui/tabs/tabs.js.map +1 -1
  119. package/dist/components/ui/toggle/toggle.d.ts.map +1 -1
  120. package/dist/components/ui/toggle/toggle.js +9 -6
  121. package/dist/components/ui/toggle/toggle.js.map +1 -1
  122. package/dist/components/ui/toggle-group/toggle-group.d.ts.map +1 -1
  123. package/dist/components/ui/toggle-group/toggle-group.js +2 -0
  124. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
  125. package/dist/components/ui/typography/typography.d.ts +12 -1
  126. package/dist/components/ui/typography/typography.d.ts.map +1 -1
  127. package/dist/components/ui/typography/typography.js +16 -2
  128. package/dist/components/ui/typography/typography.js.map +1 -1
  129. package/dist/index.js +4 -4
  130. package/dist/lib/cn-tables.generated.js +5 -5
  131. package/dist/lib/cn-tables.generated.js.map +1 -1
  132. package/dist/lib/tokens.d.ts.map +1 -1
  133. package/dist/lib/tokens.js +7 -2
  134. package/dist/lib/tokens.js.map +1 -1
  135. package/dist/r/list-row.json +1 -0
  136. package/dist/r/registry.json +1 -0
  137. package/dist/r/src/components/composites/action-button/action-button.tsx +3 -0
  138. package/dist/r/src/components/composites/list-row/list-row-control.tsx +1 -0
  139. package/dist/r/src/components/composites/list-row/list-row.tsx +3 -2
  140. package/dist/r/src/components/composites/settings/settings-navigation.tsx +7 -3
  141. package/dist/r/src/components/composites/settings/settings.tsx +3 -2
  142. package/dist/r/src/components/conversation/transcript-composition.tsx +14 -2
  143. package/dist/r/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +3 -0
  144. package/dist/r/src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx +6 -1
  145. package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +3 -1
  146. package/dist/r/src/components/ui/alert/alert.tsx +17 -0
  147. package/dist/r/src/components/ui/alert/index.ts +8 -1
  148. package/dist/r/src/components/ui/badge/badge.tsx +1 -0
  149. package/dist/r/src/components/ui/breadcrumb/breadcrumb.tsx +18 -8
  150. package/dist/r/src/components/ui/breadcrumb/index.ts +1 -0
  151. package/dist/r/src/components/ui/button/button.tsx +1 -0
  152. package/dist/r/src/components/ui/card/card.tsx +30 -13
  153. package/dist/r/src/components/ui/card/index.ts +1 -0
  154. package/dist/r/src/components/ui/checkbox/checkbox.tsx +1 -0
  155. package/dist/r/src/components/ui/dialog/dialog.tsx +26 -2
  156. package/dist/r/src/components/ui/dialog/index.ts +1 -0
  157. package/dist/r/src/components/ui/entity-icon/entity-icon.tsx +15 -0
  158. package/dist/r/src/components/ui/field/field.tsx +23 -3
  159. package/dist/r/src/components/ui/field/index.ts +1 -0
  160. package/dist/r/src/components/ui/input-group/index.ts +1 -0
  161. package/dist/r/src/components/ui/input-group/input-group.tsx +28 -5
  162. package/dist/r/src/components/ui/native-select/native-select.tsx +20 -3
  163. package/dist/r/src/components/ui/progress/progress.tsx +5 -1
  164. package/dist/r/src/components/ui/radio-group/radio-group.tsx +40 -3
  165. package/dist/r/src/components/ui/resizable/resizable.tsx +15 -4
  166. package/dist/r/src/components/ui/select/select.tsx +1 -0
  167. package/dist/r/src/components/ui/sheet/sheet.tsx +20 -2
  168. package/dist/r/src/components/ui/slider/slider.tsx +1 -0
  169. package/dist/r/src/components/ui/status-chip/status-chip.tsx +1 -0
  170. package/dist/r/src/components/ui/switch/switch.tsx +1 -0
  171. package/dist/r/src/components/ui/tabs/tabs.tsx +33 -4
  172. package/dist/r/src/components/ui/toggle/toggle.tsx +1 -0
  173. package/dist/r/src/components/ui/toggle-group/toggle-group.tsx +2 -0
  174. package/dist/r/src/components/ui/typography/typography.tsx +20 -1
  175. package/dist/r/src/lib/cn-tables.generated.ts +5 -5
  176. package/dist/r/src/lib/tokens.ts +7 -2
  177. package/dist/r/src/styles/base.css +4 -1
  178. package/dist/r/src/styles/theme.css +4 -0
  179. package/package.json +1 -1
  180. package/registry.json +1 -0
  181. package/src/components/composites/action-button/action-button.tsx +3 -0
  182. package/src/components/composites/list-row/list-row-control.tsx +1 -0
  183. package/src/components/composites/list-row/list-row.tsx +3 -2
  184. package/src/components/composites/settings/settings-navigation.tsx +7 -3
  185. package/src/components/composites/settings/settings.tsx +3 -2
  186. package/src/components/conversation/transcript-composition.tsx +14 -2
  187. package/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +3 -0
  188. package/src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx +6 -1
  189. package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +3 -1
  190. package/src/components/ui/alert/alert.tsx +17 -0
  191. package/src/components/ui/alert/index.ts +8 -1
  192. package/src/components/ui/badge/badge.tsx +1 -0
  193. package/src/components/ui/breadcrumb/breadcrumb.tsx +18 -8
  194. package/src/components/ui/breadcrumb/index.ts +1 -0
  195. package/src/components/ui/button/button.tsx +1 -0
  196. package/src/components/ui/card/card.tsx +30 -13
  197. package/src/components/ui/card/index.ts +1 -0
  198. package/src/components/ui/checkbox/checkbox.tsx +1 -0
  199. package/src/components/ui/dialog/dialog.tsx +26 -2
  200. package/src/components/ui/dialog/index.ts +1 -0
  201. package/src/components/ui/entity-icon/entity-icon.tsx +15 -0
  202. package/src/components/ui/field/field.tsx +23 -3
  203. package/src/components/ui/field/index.ts +1 -0
  204. package/src/components/ui/input-group/index.ts +1 -0
  205. package/src/components/ui/input-group/input-group.tsx +28 -5
  206. package/src/components/ui/native-select/native-select.tsx +20 -3
  207. package/src/components/ui/progress/progress.tsx +5 -1
  208. package/src/components/ui/radio-group/radio-group.tsx +40 -3
  209. package/src/components/ui/resizable/resizable.tsx +15 -4
  210. package/src/components/ui/select/select.tsx +1 -0
  211. package/src/components/ui/sheet/sheet.tsx +20 -2
  212. package/src/components/ui/slider/slider.tsx +1 -0
  213. package/src/components/ui/status-chip/status-chip.tsx +1 -0
  214. package/src/components/ui/switch/switch.tsx +1 -0
  215. package/src/components/ui/tabs/tabs.tsx +33 -4
  216. package/src/components/ui/toggle/toggle.tsx +1 -0
  217. package/src/components/ui/toggle-group/toggle-group.tsx +2 -0
  218. package/src/components/ui/typography/typography.tsx +20 -1
  219. package/src/lib/cn-tables.generated.ts +5 -5
  220. package/src/lib/tokens.ts +7 -2
  221. package/src/styles/base.css +4 -1
  222. package/src/styles/theme.css +4 -0
@@ -1 +1 @@
1
- {"version":3,"file":"transcript-composition.js","names":["Accessor","Component","ComponentProps","For","Show","createComponent","createMemo","createSignal","createUniqueId","splitProps","ChevronDown","cn","Button","applyTranscriptRunningState","createTranscriptGrouper","TranscriptDisplayItem","TranscriptRow","TranscriptTurnItem","planTranscriptFold","TranscriptFoldMode","TranscriptMounting","TranscriptFoldState","TranscriptDisplayKind","GroupedTranscript","TranscriptFoldPlan","TranscriptCompositionFold","Readonly","key","mode","mounting","callCount","TranscriptCompositionRowContext","index","displayKind","group","size","turn","id","complete","interim","fold","TranscriptCompositionRendererProps","row","T","context","TranscriptCompositionProps","Omit","rows","renderRow","running","resetKey","foldMode","foldState","onFoldStateChange","state","disclosure","ReadonlyMap","onDisclosureChange","expanded","TurnPresentation","NonNullable","GroupPresentation","FoldGroup","RowRecord","foldControl","TranscriptLayout","controls","RowHandle","get","set","next","last","DisclosureSignal","encodeId","value","encodeURIComponent","transcriptDisclosureKey","firstRowId","String","panelId","instanceId","rowId","buttonId","segmentKey","sameGroup","a","b","sameTurn","sameFold","sameFoldGroup","length","every","sameRecord","firstRow","item","kind","appendTurnItem","indices","into","push","forEach","startIndex","appendDisplayItem","undefined","turnId","items","map","find","child","buildDisclosures","records","defaultMode","scope","flushScope","record","hasInterimTurn","some","hasConclusion","conclusion","plan","settled","foldable","entries","flatMap","entry","anchorId","control","opensTurn","foldLabel","count","subject","TranscriptRowEntry","props","prefix","onToggle","current","disclosureKey","collapsed","disabled","groupIndex","groupSize","renderable","renderHostRow","controlLabel","controlRows","join","_el$","_tmpl$","_el$2","firstChild","_$insert","_$createComponent","when","children","type","variant","aria-label","aria-controls","aria-expanded","aria-disabled","onClick","_el$3","_tmpl$2","_$memo","_$effect","_p$","_v$","_v$2","_v$3","_v$4","_v$5","_v$6","e","_$setAttribute","t","o","i","hidden","n","TranscriptComposition","local","rest","grouper","internalFoldState","setInternalFoldState","rowHandles","Map","disclosureSignals","lastResetKey","localDisclosure","signal","disclosureExpanded","grouped","layout","identity","clear","indexByRow","display","handles","live","Set","result","add","handle","keys","has","delete","allControlIds","updateFoldState","updateDisclosure","_el$4","_tmpl$4","_el$6","_$spread","_$mergeProps","data-fold-state","class","_el$5","_tmpl$3","each","createComponent","_$createComponent","_$memo","_$setAttribute","_$mergeProps"],"sources":["../../../src/components/conversation/transcript-composition.tsx"],"sourcesContent":["import type { Accessor, Component, ComponentProps } from 'solid-js'\nimport {\n For,\n Show,\n createComponent,\n createMemo,\n createSignal,\n createUniqueId,\n splitProps,\n} from 'solid-js'\nimport { ChevronDown } from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button/button'\nimport {\n applyTranscriptRunningState,\n createTranscriptGrouper,\n type TranscriptDisplayItem,\n type TranscriptRow,\n type TranscriptTurnItem,\n} from './transcript-grouping'\nimport {\n planTranscriptFold,\n type TranscriptFoldMode,\n type TranscriptMounting,\n} from './transcript-folding'\n\nexport type TranscriptFoldState = 'default' | 'collapsed' | 'expanded'\nexport type TranscriptDisplayKind = 'single' | 'group' | 'turn'\n\nexport type {\n GroupedTranscript,\n TranscriptDisplayItem,\n TranscriptRow,\n TranscriptTurnItem,\n} from './transcript-grouping'\nexport type {\n TranscriptFoldMode,\n TranscriptFoldPlan,\n TranscriptMounting,\n} from './transcript-folding'\n\nexport type TranscriptCompositionFold = Readonly<{\n /** Stable host persistence key. Use with `transcriptDisclosureKey` to seed a store. */\n key: string\n mode: TranscriptFoldMode\n mounting: TranscriptMounting\n /** Distinct host-classified request IDs in this contiguous fold segment. */\n callCount: number\n}>\n\nexport type TranscriptCompositionRowContext = Readonly<{\n /** Original index in the caller's row array, including rows hidden by the host. */\n index: number\n /** The row's current position in the generic display composition. */\n displayKind: TranscriptDisplayKind\n group?: Readonly<{ index: number; size: number }>\n turn?: Readonly<{\n /** Derived from the first stable row ID; presentation bookkeeping only. */\n id: string\n /** A presentation state, never proof of successful runtime completion. */\n complete: boolean\n interim: boolean\n }>\n fold?: TranscriptCompositionFold\n}>\n\nexport type TranscriptCompositionRendererProps<T> = Readonly<{\n /** Reactive Solid prop; a row component keeps its DOM owner stable as values update. */\n row: TranscriptRow<T>\n context: TranscriptCompositionRowContext\n}>\n\nexport type TranscriptCompositionProps<T> = Omit<ComponentProps<'div'>, 'children'> & {\n /** Ordered, already redacted rows with host-supplied semantic classifications. */\n rows: readonly TranscriptRow<T>[]\n /** Render one host row. Permission, session, event and protocol authority stay outside this component. */\n renderRow: Component<TranscriptCompositionRendererProps<T>>\n /** The host's current run state. Live rows stay mounted and expanded until settled. */\n running?: boolean\n /** Reset scope for row identity and disclosure. It is not inferred from display content. */\n resetKey?: string | number | null\n /** Default settled fold policy. `tools` keeps prose visible; `prose` retains a proven conclusion. */\n foldMode?: TranscriptFoldMode\n /** Global command state. `collapsed` keeps hidden content mounted; prose folds only before a host-marked conclusion. */\n foldState?: TranscriptFoldState\n onFoldStateChange?: (state: TranscriptFoldState) => void\n /** Optional controlled disclosure map keyed by `transcriptDisclosureKey`. */\n disclosure?: ReadonlyMap<string, boolean>\n onDisclosureChange?: (key: string, expanded: boolean) => void\n}\n\ntype TurnPresentation = NonNullable<TranscriptCompositionRowContext['turn']>\ntype GroupPresentation = NonNullable<TranscriptCompositionRowContext['group']>\n\ntype FoldGroup<T> = Readonly<{\n key: string\n mode: TranscriptFoldMode\n callCount: number\n rows: readonly TranscriptRow<T>[]\n}>\n\ntype RowRecord<T> = {\n row: TranscriptRow<T>\n index: number\n displayKind: TranscriptDisplayKind\n group?: GroupPresentation\n turn?: TurnPresentation\n fold?: TranscriptCompositionFold\n foldControl?: FoldGroup<T>\n}\n\ntype TranscriptLayout<T> = Readonly<{\n rows: readonly RowRecord<T>[]\n controls: readonly FoldGroup<T>[]\n}>\n\ntype RowHandle<T> = {\n key: string\n get: Accessor<RowRecord<T>>\n set: (next: RowRecord<T>) => void\n last: RowRecord<T>\n}\n\ntype DisclosureSignal = Readonly<{\n get: Accessor<boolean | undefined>\n set: (next: boolean | undefined) => void\n}>\n\nconst encodeId = (value: string): string => encodeURIComponent(value)\n\n/** Stable, transcript-scoped key for host-owned disclosure restoration. */\nexport function transcriptDisclosureKey(\n resetKey: string | number | null | undefined,\n mode: TranscriptFoldMode,\n firstRowId: string\n): string {\n return `transcript:${encodeId(String(resetKey ?? ''))}:${mode}:${encodeId(firstRowId)}`\n}\n\nfunction panelId(instanceId: string, resetKey: string, rowId: string): string {\n return `${instanceId}-row-${encodeId(resetKey)}-${encodeId(rowId)}`\n}\n\nfunction buttonId(instanceId: string, resetKey: string, segmentKey: string): string {\n return `${instanceId}-fold-${encodeId(resetKey)}-${encodeId(segmentKey)}`\n}\n\nfunction sameGroup(a?: GroupPresentation, b?: GroupPresentation): boolean {\n return a === b || (!!a && !!b && a.index === b.index && a.size === b.size)\n}\n\nfunction sameTurn(a?: TurnPresentation, b?: TurnPresentation): boolean {\n return (\n a === b || (!!a && !!b && a.id === b.id && a.complete === b.complete && a.interim === b.interim)\n )\n}\n\nfunction sameFold(a?: TranscriptCompositionFold, b?: TranscriptCompositionFold): boolean {\n return (\n a === b ||\n (!!a &&\n !!b &&\n a.key === b.key &&\n a.mode === b.mode &&\n a.mounting === b.mounting &&\n a.callCount === b.callCount)\n )\n}\n\nfunction sameFoldGroup<T>(a?: FoldGroup<T>, b?: FoldGroup<T>): boolean {\n return (\n a === b ||\n (!!a &&\n !!b &&\n a.key === b.key &&\n a.callCount === b.callCount &&\n a.rows.length === b.rows.length &&\n a.rows.every((row, index) => row === b.rows[index]))\n )\n}\n\nfunction sameRecord<T>(a: RowRecord<T>, b: RowRecord<T>): boolean {\n return (\n a.row === b.row &&\n a.index === b.index &&\n a.displayKind === b.displayKind &&\n sameGroup(a.group, b.group) &&\n sameTurn(a.turn, b.turn) &&\n sameFold(a.fold, b.fold) &&\n sameFoldGroup(a.foldControl, b.foldControl)\n )\n}\n\nfunction firstRow<T>(item: TranscriptTurnItem<T>): TranscriptRow<T> | undefined {\n return item.kind === 'single' ? item.row : item.rows[0]\n}\n\nfunction appendTurnItem<T>(\n item: TranscriptTurnItem<T>,\n displayKind: 'single' | 'group' | 'turn',\n turn: TurnPresentation | undefined,\n indices: ReadonlyMap<TranscriptRow<T>, number>,\n into: RowRecord<T>[]\n): void {\n if (item.kind === 'single') {\n into.push({\n row: item.row,\n index: indices.get(item.row) ?? item.index,\n displayKind,\n turn,\n })\n return\n }\n item.rows.forEach((row, index) => {\n into.push({\n row,\n index: indices.get(row) ?? item.startIndex + index,\n displayKind,\n group: { index, size: item.rows.length },\n turn,\n })\n })\n}\n\nfunction appendDisplayItem<T>(\n item: TranscriptDisplayItem<T>,\n indices: ReadonlyMap<TranscriptRow<T>, number>,\n into: RowRecord<T>[]\n): void {\n if (item.kind !== 'turn') {\n appendTurnItem(item, item.kind, undefined, indices, into)\n return\n }\n const turnId = item.items.map(firstRow).find((row) => row)?.id ?? 'empty-turn'\n const turn: TurnPresentation = {\n id: turnId,\n complete: item.complete,\n interim: !!item.interim,\n }\n for (const child of item.items) appendTurnItem(child, 'turn', turn, indices, into)\n}\n\nfunction buildDisclosures<T>(\n records: readonly RowRecord<T>[],\n defaultMode: TranscriptFoldMode,\n foldState: TranscriptFoldState,\n resetKey: string\n): FoldGroup<T>[] {\n const controls: FoldGroup<T>[] = []\n let scope: RowRecord<T>[] = []\n const flushScope = () => {\n if (!scope.length) return\n const rows = scope.map((record) => record.row)\n const hasInterimTurn = scope.some((record) => record.turn?.interim)\n const hasConclusion = scope.some((record) => record.row.conclusion)\n const mode: TranscriptFoldMode = hasInterimTurn\n ? 'interim'\n : foldState === 'default'\n ? defaultMode\n : foldState === 'collapsed'\n ? hasConclusion\n ? 'prose'\n : 'tools'\n : 'interim'\n const plan = planTranscriptFold(rows, { mode, settled: true })\n const foldable = plan.entries.flatMap((entry, index) =>\n entry.mounting === 'always' ? [] : [{ record: scope[index]!, mounting: entry.mounting }]\n )\n if (foldable.length) {\n const anchorId = scope[0]?.row.id ?? foldable[0]!.record.row.id\n const control: FoldGroup<T> = {\n key: transcriptDisclosureKey(resetKey, mode, anchorId),\n mode,\n callCount: plan.callCount,\n rows: foldable.map(({ record }) => record.row),\n }\n controls.push(control)\n foldable.forEach(({ record, mounting }, index) => {\n record.fold = {\n key: control.key,\n mode: control.mode,\n mounting: foldState === 'collapsed' ? 'hide-when-collapsed' : mounting,\n callCount: control.callCount,\n }\n if (index === 0) record.foldControl = control\n })\n }\n scope = []\n }\n\n for (const record of records) {\n if (record.row.opensTurn && scope.length) flushScope()\n scope.push(record)\n }\n flushScope()\n return controls\n}\n\nfunction foldLabel(mode: TranscriptFoldMode, count: number, expanded: boolean): string {\n const subject =\n mode === 'tools'\n ? count === 1\n ? '1 tool call'\n : count > 1\n ? `${count} tool calls`\n : 'tool details'\n : mode === 'prose'\n ? 'earlier activity'\n : 'interim activity'\n return `${expanded ? 'Hide' : 'Show'} ${subject}`\n}\n\nfunction TranscriptRowEntry<T>(props: {\n record: Accessor<RowRecord<T>>\n renderRow: Component<TranscriptCompositionRendererProps<T>>\n prefix: string\n resetKey: Accessor<string>\n expanded: (key: string) => Accessor<boolean>\n running: Accessor<boolean>\n foldState: Accessor<TranscriptFoldState>\n onToggle: (key: string, expanded: boolean) => void\n}) {\n const current = props.record\n const id = () => panelId(props.prefix, props.resetKey(), current().row.id)\n const foldControl = () => current().foldControl\n const disclosureKey = () => current().fold?.key\n const expanded = () => {\n const key = disclosureKey()\n return key ? props.expanded(key)() : true\n }\n const collapsed = () => !!current().fold && !expanded()\n const disabled = () => props.running() || props.foldState() !== 'default'\n const context = (): TranscriptCompositionRowContext => ({\n index: current().index,\n displayKind: current().displayKind,\n group: current().group,\n turn: current().turn,\n fold: current().fold,\n })\n const groupIndex = () => current().group?.index\n const groupSize = () => current().group?.size\n const renderable = () => current().fold?.mounting !== 'unmount-when-collapsed' || !collapsed()\n const renderHostRow = () =>\n createComponent(props.renderRow, {\n get row() {\n return current().row\n },\n get context() {\n return context()\n },\n })\n const controlLabel = () => {\n const control = foldControl()\n return control ? foldLabel(control.mode, control.callCount, expanded()) : ''\n }\n const controlRows = () =>\n foldControl()\n ?.rows.map((row) => panelId(props.prefix, props.resetKey(), row.id))\n .join(' ')\n\n return (\n <div\n data-slot=\"transcript-row\"\n data-display-kind={current().displayKind}\n data-group-index={groupIndex()}\n data-group-size={groupSize()}\n class=\"flex min-w-0 flex-col gap-1\"\n >\n <Show when={foldControl()}>\n {(control) => (\n <Button\n id={buttonId(props.prefix, props.resetKey(), control().key)}\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n class=\"w-full justify-start\"\n aria-label={controlLabel()}\n aria-controls={controlRows()}\n aria-expanded={expanded()}\n aria-disabled={disabled() || undefined}\n onClick={() => props.onToggle(control().key, !expanded())}\n >\n <ChevronDown aria-hidden=\"true\" class=\"size-4 shrink-0\" />\n <span>{controlLabel()}</span>\n </Button>\n )}\n </Show>\n <div\n id={id()}\n data-slot=\"transcript-row-content\"\n hidden={collapsed()}\n aria-hidden={collapsed() || undefined}\n >\n <Show when={renderable() ? current() : undefined}>\n {(record) => {\n record()\n return renderHostRow()\n }}\n </Show>\n </div>\n </div>\n )\n}\n\n/**\n * Compose host-classified rows into stable turns, contiguous groups and disclosures.\n * Row render owners are keyed by `id` in a single list, so loose rows keep their DOM\n * owners when the grouping threshold promotes them into a turn. The caller owns row\n * identity, protocol meaning, redaction, permissions and durable conversation state.\n */\nexport function TranscriptComposition<T>(props: TranscriptCompositionProps<T>) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'rows',\n 'renderRow',\n 'running',\n 'resetKey',\n 'foldMode',\n 'foldState',\n 'onFoldStateChange',\n 'disclosure',\n 'onDisclosureChange',\n ])\n const instanceId = createUniqueId()\n const grouper = createTranscriptGrouper<T>()\n const [internalFoldState, setInternalFoldState] = createSignal<TranscriptFoldState>('default')\n const rowHandles = new Map<string, RowHandle<T>>()\n const disclosureSignals = new Map<string, DisclosureSignal>()\n let lastResetKey = String(local.resetKey ?? '')\n\n const resetKey = () => String(local.resetKey ?? '')\n const foldState = () => local.foldState ?? internalFoldState()\n const running = () => !!local.running\n const localDisclosure = (key: string): DisclosureSignal => {\n let signal = disclosureSignals.get(key)\n if (!signal) {\n const [get, set] = createSignal<boolean | undefined>(undefined)\n signal = { get, set }\n disclosureSignals.set(key, signal)\n }\n return signal\n }\n const disclosureExpanded = (key: string): Accessor<boolean> => {\n const signal = localDisclosure(key)\n return () => {\n if (running()) return true\n if (foldState() === 'collapsed') return false\n if (foldState() === 'expanded') return true\n return local.disclosure?.get(key) ?? signal.get() ?? false\n }\n }\n const grouped = createMemo(() => grouper(local.rows))\n const layout = createMemo<TranscriptLayout<T>>(() => {\n const identity = resetKey()\n if (identity !== lastResetKey) {\n rowHandles.clear()\n disclosureSignals.clear()\n lastResetKey = identity\n }\n const indexByRow = new Map(local.rows.map((row, index) => [row, index]))\n const display = applyTranscriptRunningState(grouped(), running())\n const records: RowRecord<T>[] = []\n display.forEach((item) => appendDisplayItem(item, indexByRow, records))\n const controls = buildDisclosures(records, local.foldMode ?? 'tools', foldState(), identity)\n return { rows: records, controls }\n })\n const handles = createMemo(() => {\n const live = new Set<string>()\n const identity = resetKey()\n const result = layout().rows.map((record) => {\n const key = `${identity}\\u001f${record.row.id}`\n live.add(key)\n let handle = rowHandles.get(key)\n if (!handle) {\n const [get, set] = createSignal(record)\n handle = { key, get, set, last: record }\n rowHandles.set(key, handle)\n } else if (!sameRecord(handle.last, record)) {\n handle.last = record\n handle.set(record)\n }\n return handle\n })\n for (const key of rowHandles.keys()) if (!live.has(key)) rowHandles.delete(key)\n return result\n })\n const allControlIds = () =>\n layout()\n .controls.flatMap((control) =>\n control.rows.map((row) => panelId(instanceId, resetKey(), row.id))\n )\n .join(' ')\n const updateFoldState = () => {\n if (running()) return\n const current = foldState()\n const next: TranscriptFoldState =\n current === 'default' ? 'collapsed' : current === 'collapsed' ? 'expanded' : 'default'\n if (local.foldState === undefined) setInternalFoldState(next)\n local.onFoldStateChange?.(next)\n }\n const updateDisclosure = (key: string, expanded: boolean) => {\n if (running() || foldState() !== 'default') return\n if (local.disclosure) {\n local.onDisclosureChange?.(key, expanded)\n return\n }\n localDisclosure(key).set(expanded)\n local.onDisclosureChange?.(key, expanded)\n }\n\n return (\n <div\n data-slot=\"transcript-composition\"\n data-fold-state={foldState()}\n class={cn('flex w-full min-w-0 flex-col gap-1', local.class)}\n {...rest}\n >\n <Show when={local.onFoldStateChange}>\n <div class=\"flex justify-end\">\n <Button\n id={`${instanceId}-fold-all`}\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n aria-controls={allControlIds() || undefined}\n aria-disabled={running() || undefined}\n onClick={updateFoldState}\n >\n {foldState() === 'default'\n ? 'Collapse all activity'\n : foldState() === 'collapsed'\n ? 'Expand all activity'\n : 'Restore default folding'}\n </Button>\n </div>\n </Show>\n <div data-slot=\"transcript-rows\" class=\"flex min-w-0 flex-col gap-1\">\n <For each={handles()}>\n {(handle) => (\n <TranscriptRowEntry\n record={handle.get}\n renderRow={local.renderRow}\n prefix={instanceId}\n resetKey={resetKey}\n expanded={disclosureExpanded}\n running={running}\n foldState={foldState}\n onToggle={updateDisclosure}\n />\n )}\n </For>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAgIA,IAAMyE,YAAYC,UAA0BC,mBAAmBD,KAAK;;AAGpE,SAAgBE,wBACd1B,UACAtB,MACAiD,YACQ;CACR,OAAO,cAAcJ,SAASK,OAAO5B,YAAY,EAAE,CAAC,EAAC,GAAItB,KAAI,GAAI6C,SAASI,UAAU;AACtF;AAEA,SAASE,QAAQC,YAAoB9B,UAAkB+B,OAAuB;CAC5E,OAAO,GAAGD,WAAU,OAAQP,SAASvB,QAAQ,EAAC,GAAIuB,SAASQ,KAAK;AAClE;AAEA,SAASC,SAASF,YAAoB9B,UAAkBiC,YAA4B;CAClF,OAAO,GAAGH,WAAU,QAASP,SAASvB,QAAQ,EAAC,GAAIuB,SAASU,UAAU;AACxE;AAEA,SAASC,UAAUC,GAAuBC,GAAgC;CACxE,OAAOD,MAAMC,KAAM,CAAC,CAACD,KAAK,CAAC,CAACC,KAAKD,EAAErD,UAAUsD,EAAEtD,SAASqD,EAAElD,SAASmD,EAAEnD;AACvE;AAEA,SAASoD,SAASF,GAAsBC,GAA+B;CACrE,OACED,MAAMC,KAAM,CAAC,CAACD,KAAK,CAAC,CAACC,KAAKD,EAAEhD,OAAOiD,EAAEjD,MAAMgD,EAAE/C,aAAagD,EAAEhD,YAAY+C,EAAE9C,YAAY+C,EAAE/C;AAE5F;AAEA,SA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"file":"transcript-composition.js","names":["Accessor","Component","ComponentProps","For","Show","createComponent","createMemo","createSignal","createUniqueId","splitProps","ChevronDown","cn","Button","applyTranscriptRunningState","createTranscriptGrouper","TranscriptDisplayItem","TranscriptRow","TranscriptTurnItem","planTranscriptFold","TranscriptFoldMode","TranscriptMounting","TranscriptFoldState","TranscriptDisplayKind","GroupedTranscript","TranscriptFoldPlan","TranscriptCompositionFold","Readonly","key","mode","mounting","callCount","TranscriptCompositionRowContext","index","displayKind","group","size","turn","id","complete","interim","fold","TranscriptCompositionRendererProps","row","T","context","TranscriptCompositionProps","Omit","rows","renderRow","running","resetKey","foldMode","foldState","onFoldStateChange","state","disclosure","ReadonlyMap","onDisclosureChange","expanded","density","TurnPresentation","NonNullable","GroupPresentation","FoldGroup","RowRecord","foldControl","TranscriptLayout","controls","RowHandle","get","set","next","last","DisclosureSignal","encodeId","value","encodeURIComponent","transcriptDisclosureKey","firstRowId","String","panelId","instanceId","rowId","buttonId","segmentKey","sameGroup","a","b","sameTurn","sameFold","sameFoldGroup","length","every","sameRecord","firstRow","item","kind","appendTurnItem","indices","into","push","forEach","startIndex","appendDisplayItem","undefined","turnId","items","map","find","child","buildDisclosures","records","defaultMode","scope","flushScope","record","hasInterimTurn","some","hasConclusion","conclusion","plan","settled","foldable","entries","flatMap","entry","anchorId","control","opensTurn","foldLabel","count","subject","TranscriptRowEntry","props","prefix","onToggle","current","disclosureKey","collapsed","disabled","groupIndex","groupSize","renderable","renderHostRow","controlLabel","controlRows","join","_el$","_tmpl$","_el$2","firstChild","_$insert","_$createComponent","when","children","type","variant","aria-label","aria-controls","aria-expanded","aria-disabled","onClick","_el$3","_tmpl$2","_$memo","_$effect","_p$","_v$","_v$2","_v$3","_v$4","_v$5","_v$6","e","_$setAttribute","t","o","i","hidden","n","TranscriptComposition","local","rest","grouper","internalFoldState","setInternalFoldState","rowHandles","Map","disclosureSignals","lastResetKey","localDisclosure","signal","disclosureExpanded","grouped","layout","identity","clear","indexByRow","display","handles","live","Set","result","add","handle","keys","has","delete","allControlIds","updateFoldState","updateDisclosure","_el$4","_tmpl$4","_el$6","_$spread","_$mergeProps","data-fold-state","data-density","class","_el$5","_tmpl$3","each","_$className","createComponent","_$createComponent","_$memo","_$setAttribute","_$mergeProps","_$className"],"sources":["../../../src/components/conversation/transcript-composition.tsx"],"sourcesContent":["import type { Accessor, Component, ComponentProps } from 'solid-js'\nimport {\n For,\n Show,\n createComponent,\n createMemo,\n createSignal,\n createUniqueId,\n splitProps,\n} from 'solid-js'\nimport { ChevronDown } from 'lucide-solid'\nimport { cn } from '#lib/utils'\nimport { Button } from '../ui/button/button'\nimport {\n applyTranscriptRunningState,\n createTranscriptGrouper,\n type TranscriptDisplayItem,\n type TranscriptRow,\n type TranscriptTurnItem,\n} from './transcript-grouping'\nimport {\n planTranscriptFold,\n type TranscriptFoldMode,\n type TranscriptMounting,\n} from './transcript-folding'\n\nexport type TranscriptFoldState = 'default' | 'collapsed' | 'expanded'\nexport type TranscriptDisplayKind = 'single' | 'group' | 'turn'\n\nexport type {\n GroupedTranscript,\n TranscriptDisplayItem,\n TranscriptRow,\n TranscriptTurnItem,\n} from './transcript-grouping'\nexport type {\n TranscriptFoldMode,\n TranscriptFoldPlan,\n TranscriptMounting,\n} from './transcript-folding'\n\nexport type TranscriptCompositionFold = Readonly<{\n /** Stable host persistence key. Use with `transcriptDisclosureKey` to seed a store. */\n key: string\n mode: TranscriptFoldMode\n mounting: TranscriptMounting\n /** Distinct host-classified request IDs in this contiguous fold segment. */\n callCount: number\n}>\n\nexport type TranscriptCompositionRowContext = Readonly<{\n /** Original index in the caller's row array, including rows hidden by the host. */\n index: number\n /** The row's current position in the generic display composition. */\n displayKind: TranscriptDisplayKind\n group?: Readonly<{ index: number; size: number }>\n turn?: Readonly<{\n /** Derived from the first stable row ID; presentation bookkeeping only. */\n id: string\n /** A presentation state, never proof of successful runtime completion. */\n complete: boolean\n interim: boolean\n }>\n fold?: TranscriptCompositionFold\n}>\n\nexport type TranscriptCompositionRendererProps<T> = Readonly<{\n /** Reactive Solid prop; a row component keeps its DOM owner stable as values update. */\n row: TranscriptRow<T>\n context: TranscriptCompositionRowContext\n}>\n\nexport type TranscriptCompositionProps<T> = Omit<ComponentProps<'div'>, 'children'> & {\n /** Ordered, already redacted rows with host-supplied semantic classifications. */\n rows: readonly TranscriptRow<T>[]\n /** Render one host row. Permission, session, event and protocol authority stay outside this component. */\n renderRow: Component<TranscriptCompositionRendererProps<T>>\n /** The host's current run state. Live rows stay mounted and expanded until settled. */\n running?: boolean\n /** Reset scope for row identity and disclosure. It is not inferred from display content. */\n resetKey?: string | number | null\n /** Default settled fold policy. `tools` keeps prose visible; `prose` retains a proven conclusion. */\n foldMode?: TranscriptFoldMode\n /** Global command state. `collapsed` keeps hidden content mounted; prose folds only before a host-marked conclusion. */\n foldState?: TranscriptFoldState\n onFoldStateChange?: (state: TranscriptFoldState) => void\n /** Optional controlled disclosure map keyed by `transcriptDisclosureKey`. */\n disclosure?: ReadonlyMap<string, boolean>\n onDisclosureChange?: (key: string, expanded: boolean) => void\n /**\n * Row rhythm. `compact` (default) packs rows 4px apart; `comfortable` spaces\n * them 12px apart and stacks each row's rendered parts, for a chat stream\n * whose rows are separate messages rather than one running log.\n */\n density?: 'compact' | 'comfortable'\n}\n\ntype TurnPresentation = NonNullable<TranscriptCompositionRowContext['turn']>\ntype GroupPresentation = NonNullable<TranscriptCompositionRowContext['group']>\n\ntype FoldGroup<T> = Readonly<{\n key: string\n mode: TranscriptFoldMode\n callCount: number\n rows: readonly TranscriptRow<T>[]\n}>\n\ntype RowRecord<T> = {\n row: TranscriptRow<T>\n index: number\n displayKind: TranscriptDisplayKind\n group?: GroupPresentation\n turn?: TurnPresentation\n fold?: TranscriptCompositionFold\n foldControl?: FoldGroup<T>\n}\n\ntype TranscriptLayout<T> = Readonly<{\n rows: readonly RowRecord<T>[]\n controls: readonly FoldGroup<T>[]\n}>\n\ntype RowHandle<T> = {\n key: string\n get: Accessor<RowRecord<T>>\n set: (next: RowRecord<T>) => void\n last: RowRecord<T>\n}\n\ntype DisclosureSignal = Readonly<{\n get: Accessor<boolean | undefined>\n set: (next: boolean | undefined) => void\n}>\n\nconst encodeId = (value: string): string => encodeURIComponent(value)\n\n/** Stable, transcript-scoped key for host-owned disclosure restoration. */\nexport function transcriptDisclosureKey(\n resetKey: string | number | null | undefined,\n mode: TranscriptFoldMode,\n firstRowId: string\n): string {\n return `transcript:${encodeId(String(resetKey ?? ''))}:${mode}:${encodeId(firstRowId)}`\n}\n\nfunction panelId(instanceId: string, resetKey: string, rowId: string): string {\n return `${instanceId}-row-${encodeId(resetKey)}-${encodeId(rowId)}`\n}\n\nfunction buttonId(instanceId: string, resetKey: string, segmentKey: string): string {\n return `${instanceId}-fold-${encodeId(resetKey)}-${encodeId(segmentKey)}`\n}\n\nfunction sameGroup(a?: GroupPresentation, b?: GroupPresentation): boolean {\n return a === b || (!!a && !!b && a.index === b.index && a.size === b.size)\n}\n\nfunction sameTurn(a?: TurnPresentation, b?: TurnPresentation): boolean {\n return (\n a === b || (!!a && !!b && a.id === b.id && a.complete === b.complete && a.interim === b.interim)\n )\n}\n\nfunction sameFold(a?: TranscriptCompositionFold, b?: TranscriptCompositionFold): boolean {\n return (\n a === b ||\n (!!a &&\n !!b &&\n a.key === b.key &&\n a.mode === b.mode &&\n a.mounting === b.mounting &&\n a.callCount === b.callCount)\n )\n}\n\nfunction sameFoldGroup<T>(a?: FoldGroup<T>, b?: FoldGroup<T>): boolean {\n return (\n a === b ||\n (!!a &&\n !!b &&\n a.key === b.key &&\n a.callCount === b.callCount &&\n a.rows.length === b.rows.length &&\n a.rows.every((row, index) => row === b.rows[index]))\n )\n}\n\nfunction sameRecord<T>(a: RowRecord<T>, b: RowRecord<T>): boolean {\n return (\n a.row === b.row &&\n a.index === b.index &&\n a.displayKind === b.displayKind &&\n sameGroup(a.group, b.group) &&\n sameTurn(a.turn, b.turn) &&\n sameFold(a.fold, b.fold) &&\n sameFoldGroup(a.foldControl, b.foldControl)\n )\n}\n\nfunction firstRow<T>(item: TranscriptTurnItem<T>): TranscriptRow<T> | undefined {\n return item.kind === 'single' ? item.row : item.rows[0]\n}\n\nfunction appendTurnItem<T>(\n item: TranscriptTurnItem<T>,\n displayKind: 'single' | 'group' | 'turn',\n turn: TurnPresentation | undefined,\n indices: ReadonlyMap<TranscriptRow<T>, number>,\n into: RowRecord<T>[]\n): void {\n if (item.kind === 'single') {\n into.push({\n row: item.row,\n index: indices.get(item.row) ?? item.index,\n displayKind,\n turn,\n })\n return\n }\n item.rows.forEach((row, index) => {\n into.push({\n row,\n index: indices.get(row) ?? item.startIndex + index,\n displayKind,\n group: { index, size: item.rows.length },\n turn,\n })\n })\n}\n\nfunction appendDisplayItem<T>(\n item: TranscriptDisplayItem<T>,\n indices: ReadonlyMap<TranscriptRow<T>, number>,\n into: RowRecord<T>[]\n): void {\n if (item.kind !== 'turn') {\n appendTurnItem(item, item.kind, undefined, indices, into)\n return\n }\n const turnId = item.items.map(firstRow).find((row) => row)?.id ?? 'empty-turn'\n const turn: TurnPresentation = {\n id: turnId,\n complete: item.complete,\n interim: !!item.interim,\n }\n for (const child of item.items) appendTurnItem(child, 'turn', turn, indices, into)\n}\n\nfunction buildDisclosures<T>(\n records: readonly RowRecord<T>[],\n defaultMode: TranscriptFoldMode,\n foldState: TranscriptFoldState,\n resetKey: string\n): FoldGroup<T>[] {\n const controls: FoldGroup<T>[] = []\n let scope: RowRecord<T>[] = []\n const flushScope = () => {\n if (!scope.length) return\n const rows = scope.map((record) => record.row)\n const hasInterimTurn = scope.some((record) => record.turn?.interim)\n const hasConclusion = scope.some((record) => record.row.conclusion)\n const mode: TranscriptFoldMode = hasInterimTurn\n ? 'interim'\n : foldState === 'default'\n ? defaultMode\n : foldState === 'collapsed'\n ? hasConclusion\n ? 'prose'\n : 'tools'\n : 'interim'\n const plan = planTranscriptFold(rows, { mode, settled: true })\n const foldable = plan.entries.flatMap((entry, index) =>\n entry.mounting === 'always' ? [] : [{ record: scope[index]!, mounting: entry.mounting }]\n )\n if (foldable.length) {\n const anchorId = scope[0]?.row.id ?? foldable[0]!.record.row.id\n const control: FoldGroup<T> = {\n key: transcriptDisclosureKey(resetKey, mode, anchorId),\n mode,\n callCount: plan.callCount,\n rows: foldable.map(({ record }) => record.row),\n }\n controls.push(control)\n foldable.forEach(({ record, mounting }, index) => {\n record.fold = {\n key: control.key,\n mode: control.mode,\n mounting: foldState === 'collapsed' ? 'hide-when-collapsed' : mounting,\n callCount: control.callCount,\n }\n if (index === 0) record.foldControl = control\n })\n }\n scope = []\n }\n\n for (const record of records) {\n if (record.row.opensTurn && scope.length) flushScope()\n scope.push(record)\n }\n flushScope()\n return controls\n}\n\nfunction foldLabel(mode: TranscriptFoldMode, count: number, expanded: boolean): string {\n const subject =\n mode === 'tools'\n ? count === 1\n ? '1 tool call'\n : count > 1\n ? `${count} tool calls`\n : 'tool details'\n : mode === 'prose'\n ? 'earlier activity'\n : 'interim activity'\n return `${expanded ? 'Hide' : 'Show'} ${subject}`\n}\n\nfunction TranscriptRowEntry<T>(props: {\n record: Accessor<RowRecord<T>>\n renderRow: Component<TranscriptCompositionRendererProps<T>>\n prefix: string\n resetKey: Accessor<string>\n expanded: (key: string) => Accessor<boolean>\n running: Accessor<boolean>\n foldState: Accessor<TranscriptFoldState>\n onToggle: (key: string, expanded: boolean) => void\n}) {\n const current = props.record\n const id = () => panelId(props.prefix, props.resetKey(), current().row.id)\n const foldControl = () => current().foldControl\n const disclosureKey = () => current().fold?.key\n const expanded = () => {\n const key = disclosureKey()\n return key ? props.expanded(key)() : true\n }\n const collapsed = () => !!current().fold && !expanded()\n const disabled = () => props.running() || props.foldState() !== 'default'\n const context = (): TranscriptCompositionRowContext => ({\n index: current().index,\n displayKind: current().displayKind,\n group: current().group,\n turn: current().turn,\n fold: current().fold,\n })\n const groupIndex = () => current().group?.index\n const groupSize = () => current().group?.size\n const renderable = () => current().fold?.mounting !== 'unmount-when-collapsed' || !collapsed()\n const renderHostRow = () =>\n createComponent(props.renderRow, {\n get row() {\n return current().row\n },\n get context() {\n return context()\n },\n })\n const controlLabel = () => {\n const control = foldControl()\n return control ? foldLabel(control.mode, control.callCount, expanded()) : ''\n }\n const controlRows = () =>\n foldControl()\n ?.rows.map((row) => panelId(props.prefix, props.resetKey(), row.id))\n .join(' ')\n\n return (\n <div\n data-slot=\"transcript-row\"\n data-display-kind={current().displayKind}\n data-group-index={groupIndex()}\n data-group-size={groupSize()}\n class=\"flex min-w-0 flex-col gap-1\"\n >\n <Show when={foldControl()}>\n {(control) => (\n <Button\n id={buttonId(props.prefix, props.resetKey(), control().key)}\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n class=\"w-full justify-start\"\n aria-label={controlLabel()}\n aria-controls={controlRows()}\n aria-expanded={expanded()}\n aria-disabled={disabled() || undefined}\n onClick={() => props.onToggle(control().key, !expanded())}\n >\n <ChevronDown aria-hidden=\"true\" class=\"size-4 shrink-0\" />\n <span>{controlLabel()}</span>\n </Button>\n )}\n </Show>\n <div\n id={id()}\n data-slot=\"transcript-row-content\"\n class=\"group-data-[density=comfortable]/transcript:flex group-data-[density=comfortable]/transcript:flex-col\"\n hidden={collapsed()}\n aria-hidden={collapsed() || undefined}\n >\n <Show when={renderable() ? current() : undefined}>\n {(record) => {\n record()\n return renderHostRow()\n }}\n </Show>\n </div>\n </div>\n )\n}\n\n/**\n * Compose host-classified rows into stable turns, contiguous groups and disclosures.\n * Row render owners are keyed by `id` in a single list, so loose rows keep their DOM\n * owners when the grouping threshold promotes them into a turn. The caller owns row\n * identity, protocol meaning, redaction, permissions and durable conversation state.\n */\nexport function TranscriptComposition<T>(props: TranscriptCompositionProps<T>) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'rows',\n 'renderRow',\n 'running',\n 'resetKey',\n 'foldMode',\n 'foldState',\n 'onFoldStateChange',\n 'density',\n 'disclosure',\n 'onDisclosureChange',\n ])\n const instanceId = createUniqueId()\n const grouper = createTranscriptGrouper<T>()\n const [internalFoldState, setInternalFoldState] = createSignal<TranscriptFoldState>('default')\n const rowHandles = new Map<string, RowHandle<T>>()\n const disclosureSignals = new Map<string, DisclosureSignal>()\n let lastResetKey = String(local.resetKey ?? '')\n\n const resetKey = () => String(local.resetKey ?? '')\n const foldState = () => local.foldState ?? internalFoldState()\n const running = () => !!local.running\n const localDisclosure = (key: string): DisclosureSignal => {\n let signal = disclosureSignals.get(key)\n if (!signal) {\n const [get, set] = createSignal<boolean | undefined>(undefined)\n signal = { get, set }\n disclosureSignals.set(key, signal)\n }\n return signal\n }\n const disclosureExpanded = (key: string): Accessor<boolean> => {\n const signal = localDisclosure(key)\n return () => {\n if (running()) return true\n if (foldState() === 'collapsed') return false\n if (foldState() === 'expanded') return true\n return local.disclosure?.get(key) ?? signal.get() ?? false\n }\n }\n const grouped = createMemo(() => grouper(local.rows))\n const layout = createMemo<TranscriptLayout<T>>(() => {\n const identity = resetKey()\n if (identity !== lastResetKey) {\n rowHandles.clear()\n disclosureSignals.clear()\n lastResetKey = identity\n }\n const indexByRow = new Map(local.rows.map((row, index) => [row, index]))\n const display = applyTranscriptRunningState(grouped(), running())\n const records: RowRecord<T>[] = []\n display.forEach((item) => appendDisplayItem(item, indexByRow, records))\n const controls = buildDisclosures(records, local.foldMode ?? 'tools', foldState(), identity)\n return { rows: records, controls }\n })\n const handles = createMemo(() => {\n const live = new Set<string>()\n const identity = resetKey()\n const result = layout().rows.map((record) => {\n const key = `${identity}\\u001f${record.row.id}`\n live.add(key)\n let handle = rowHandles.get(key)\n if (!handle) {\n const [get, set] = createSignal(record)\n handle = { key, get, set, last: record }\n rowHandles.set(key, handle)\n } else if (!sameRecord(handle.last, record)) {\n handle.last = record\n handle.set(record)\n }\n return handle\n })\n for (const key of rowHandles.keys()) if (!live.has(key)) rowHandles.delete(key)\n return result\n })\n const allControlIds = () =>\n layout()\n .controls.flatMap((control) =>\n control.rows.map((row) => panelId(instanceId, resetKey(), row.id))\n )\n .join(' ')\n const updateFoldState = () => {\n if (running()) return\n const current = foldState()\n const next: TranscriptFoldState =\n current === 'default' ? 'collapsed' : current === 'collapsed' ? 'expanded' : 'default'\n if (local.foldState === undefined) setInternalFoldState(next)\n local.onFoldStateChange?.(next)\n }\n const updateDisclosure = (key: string, expanded: boolean) => {\n if (running() || foldState() !== 'default') return\n if (local.disclosure) {\n local.onDisclosureChange?.(key, expanded)\n return\n }\n localDisclosure(key).set(expanded)\n local.onDisclosureChange?.(key, expanded)\n }\n\n return (\n <div\n data-slot=\"transcript-composition\"\n data-fold-state={foldState()}\n data-density={local.density ?? 'compact'}\n class={cn('group/transcript flex w-full min-w-0 flex-col gap-1', local.class)}\n {...rest}\n >\n <Show when={local.onFoldStateChange}>\n <div class=\"flex justify-end\">\n <Button\n id={`${instanceId}-fold-all`}\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n aria-controls={allControlIds() || undefined}\n aria-disabled={running() || undefined}\n onClick={updateFoldState}\n >\n {foldState() === 'default'\n ? 'Collapse all activity'\n : foldState() === 'collapsed'\n ? 'Expand all activity'\n : 'Restore default folding'}\n </Button>\n </div>\n </Show>\n <div\n data-slot=\"transcript-rows\"\n class={cn('flex min-w-0 flex-col', local.density === 'comfortable' ? 'gap-3' : 'gap-1')}\n >\n <For each={handles()}>\n {(handle) => (\n <TranscriptRowEntry\n record={handle.get}\n renderRow={local.renderRow}\n prefix={instanceId}\n resetKey={resetKey}\n expanded={disclosureExpanded}\n running={running}\n foldState={foldState}\n onToggle={updateDisclosure}\n />\n )}\n </For>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;AAsIA,IAAM0E,YAAYC,UAA0BC,mBAAmBD,KAAK;;AAGpE,SAAgBE,wBACd3B,UACAtB,MACAkD,YACQ;CACR,OAAO,cAAcJ,SAASK,OAAO7B,YAAY,EAAE,CAAC,EAAC,GAAItB,KAAI,GAAI8C,SAASI,UAAU;AACtF;AAEA,SAASE,QAAQC,YAAoB/B,UAAkBgC,OAAuB;CAC5E,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BvD,QAAQ,KAAKuD,KAAAA;KAAS;KACrCyD,SAASgD;KAAe,IAAAvD,WAAA;MAAA,OAEvBU,WAAAhH,UAAU,MAAM,SAAS,CAAA,CAAA,IACtB,0BACAA,UAAU,MAAM,cACd,wBACA;KAAyB;IAAA,CAAA,CAAA;IAAA,OAAAuK;GAAA;EAAA,CAAA,GAAAN,KAAA;EAAA9D,OAAA8D,OAAA7D,gBAQlCrJ,KAAG;GAAA,IAAC0N,OAAI;IAAA,OAAEtB,QAAQ;GAAC;GAAA7C,WAChBkD,WAAMpD,gBACLpB,oBAAkB;IAAA,IACjBjB,SAAM;KAAA,OAAEyF,OAAOvI;IAAG;IAAA,IAClBrB,YAAS;KAAA,OAAEqI,MAAMrI;IAAS;IAC1BsF,QAAQrD;IACE/B;IACVQ,UAAUsI;IACD/I;IACEG;IACXmF,UAAU2E;GAAgB,CAAA;EAE7B,CAAA,CAAA;EAAA7C,aAAAyD,UAAAT,OAdI1M,GAAG,yBAAyB0K,MAAM1H,YAAY,gBAAgB,UAAU,OAAO,CAAC,CAAA;EAAA,OAAAwJ;CAAA,EAAA,CAAA;AAmB/F"}
@@ -30,6 +30,8 @@ export type ContextualSidebarProps = {
30
30
  /** Pass the host's initial viewport seed to distinguish stale desktop state. */
31
31
  wideViewportAtLoad?: boolean;
32
32
  resizeLabel?: string;
33
+ /** The resize edge's grip: the default bordered chip, or the quieter rung. */
34
+ resizeGrip?: 'chip' | 'rung';
33
35
  /** Stable external opener used when the modal mobile sheet closes. */
34
36
  restoreFocusRef?: Accessor<HTMLElement | undefined>;
35
37
  /** Called with the nav node so a host can project width onto its layout root. */
@@ -1 +1 @@
1
- {"version":3,"file":"contextual-sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/contextual-sidebar/contextual-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAe7C,MAAM,MAAM,8BAA8B,GAAG;IAC3C,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,GAAG,GAAG,CAAC,OAAO,CAAA;IAC7D,0EAA0E;IAC1E,OAAO,CAAC,OAAO,EAAE,8BAA8B,GAAG,GAAG,CAAC,OAAO,CAAA;IAC7D,oEAAoE;IACpE,MAAM,CAAC,CAAC,OAAO,EAAE,8BAA8B,GAAG,GAAG,CAAC,OAAO,CAAA;IAC7D,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACpC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAmJ9D"}
1
+ {"version":3,"file":"contextual-sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/contextual-sidebar/contextual-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAe7C,MAAM,MAAM,8BAA8B,GAAG;IAC3C,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAA;IACf,qFAAqF;IACrF,WAAW,IAAI,WAAW,GAAG,SAAS,CAAA;CACvC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,qDAAqD;IACrD,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAA;IACb,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAA;IACb;;;;;OAKG;IACH,eAAe,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IACrC,8EAA8E;IAC9E,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IACjC,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC5B,sEAAsE;IACtE,eAAe,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IACnD,iFAAiF;IACjF,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9E,+DAA+D;IAC/D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IACnD,iEAAiE;IACjE,MAAM,CAAC,CAAC,OAAO,EAAE,8BAA8B,GAAG,GAAG,CAAC,OAAO,CAAA;IAC7D,0EAA0E;IAC1E,OAAO,CAAC,OAAO,EAAE,8BAA8B,GAAG,GAAG,CAAC,OAAO,CAAA;IAC7D,oEAAoE;IACpE,MAAM,CAAC,CAAC,OAAO,EAAE,8BAA8B,GAAG,GAAG,CAAC,OAAO,CAAA;IAC7D,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAClC,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACpC,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAoJ9D"}
@@ -119,6 +119,9 @@ function ContextualSidebar(props) {
119
119
  get label() {
120
120
  return resizeLabel();
121
121
  },
122
+ get grip() {
123
+ return props.resizeGrip;
124
+ },
122
125
  controls: navigationId,
123
126
  get onChange() {
124
127
  return props.onWidthChange;
@@ -1 +1 @@
1
- {"version":3,"file":"contextual-sidebar.js","names":["Accessor","JSX","Show","createSignal","createUniqueId","onCleanup","onMount","cn","SidebarNav","SidebarNavContent","SidebarNavFooter","SidebarNavHeader","SidebarNavTitle","PixelResizeHandle","MobileModule","MobileLoad","error","ContextualSidebarRenderContext","mobile","portalMount","HTMLElement","ContextualSidebarProps","id","label","title","titleVisibility","open","onOpenChange","width","minimum","maximum","step","wideViewportAtLoad","resizeLabel","restoreFocusRef","onSidebarElement","element","sidebarClass","sheetClass","headerClass","contentClass","footerClass","headingAs","header","context","Element","content","footer","onWidthChange","onWidthCommit","ContextualSidebar","props","isNarrowViewport","setIsNarrowViewport","mobileLoad","setMobileLoad","mobileRequested","loadMobile","then","module","mobileMount","setMobileMount","connected","mount","isConnected","undefined","media","window","matchMedia","updateViewport","wasNarrow","matches","addEventListener","removeEventListener","renderSidebar","navigationId","_$createComponent","as","aria-label","aria-hidden","inert","data-open","String","ref","node","queueMicrotask","class","children","when","side","value","controls","onChange","onCommit","fallback","_$memo","_wide","keyed","loaded","MobileSidebar","_$createComponent","_$memo"],"sources":["../../../../src/components/layout/contextual-sidebar/contextual-sidebar.tsx"],"sourcesContent":["import type { Accessor, JSX } from 'solid-js'\nimport { Show, createSignal, createUniqueId, onCleanup, onMount } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n SidebarNav,\n SidebarNavContent,\n SidebarNavFooter,\n SidebarNavHeader,\n SidebarNavTitle,\n} from '../sidebar-nav/sidebar-nav'\nimport { PixelResizeHandle } from '../pixel-resize-handle/pixel-resize-handle'\n\ntype MobileModule = typeof import('./mobile-contextual-sidebar')\ntype MobileLoad = MobileModule | { error: unknown }\n\nexport type ContextualSidebarRenderContext = {\n /** Whether the slot is being rendered inside the modal mobile sheet. */\n mobile: boolean\n /** Mount nested popovers and menus inside the mobile dialog's accessibility tree. */\n portalMount(): HTMLElement | undefined\n}\n\nexport type ContextualSidebarProps = {\n /** Stable host id prefix; generated when omitted. */\n id?: string\n /** Landmark name shared by the desktop and mobile navigation. */\n label: string\n /** Visible navigation title and mobile dialog title. */\n title: string\n /**\n * Where the title row shows. `always` (default) draws it on desktop and in\n * the mobile sheet; `mobile` keeps the desktop title for assistive\n * technology only and drops the desktop row, for hosts whose top bar\n * already names the context. A `header` slot keeps the row visible.\n */\n titleVisibility?: 'always' | 'mobile'\n /** Host-controlled expanded state for the desktop panel and mobile dialog. */\n open: boolean\n onOpenChange(open: boolean): void\n /** Current host-owned pixel width, reflected by the resize handle. */\n width: number\n minimum: number\n maximum: number\n step?: number\n /** Pass the host's initial viewport seed to distinguish stale desktop state. */\n wideViewportAtLoad?: boolean\n resizeLabel?: string\n /** Stable external opener used when the modal mobile sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n /** Called with the nav node so a host can project width onto its layout root. */\n onSidebarElement?: (element: HTMLElement | undefined, mobile: boolean) => void\n /** Host-owned layout classes applied to both nav instances. */\n sidebarClass?: string\n /** Host-owned responsive constraints for the modal sheet. */\n sheetClass?: string\n headerClass?: string\n contentClass?: string\n footerClass?: string\n headingAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n /** Optional action/content slot alongside the shared heading. */\n header?(context: ContextualSidebarRenderContext): JSX.Element\n /** View-specific navigation rows, projects, rooms, files, or sessions. */\n content(context: ContextualSidebarRenderContext): JSX.Element\n /** Optional view-specific footer, such as an archive affordance. */\n footer?(context: ContextualSidebarRenderContext): JSX.Element\n onWidthChange(width: number): void\n onWidthCommit?(width: number): void\n}\n\n/**\n * ContextualSidebar.\n *\n * Shared navigation geometry and interaction policy for an application's\n * contextual sidebar. The host keeps ownership of the actual grid width,\n * persisted preference, open state, and view-specific navigation content.\n */\nexport function ContextualSidebar(props: ContextualSidebarProps) {\n const [isNarrowViewport, setIsNarrowViewport] = createSignal(false)\n const [mobileLoad, setMobileLoad] = createSignal<MobileLoad>()\n let mobileRequested = false\n // Keep the resolved component mounted across viewport changes for Sheet cleanup.\n const loadMobile = () => {\n if (mobileRequested) return\n mobileRequested = true\n // Native module caching shares successful loads without keeping a rejected promise.\n void import('./mobile-contextual-sidebar').then(\n (module) => {\n if (mobileRequested) setMobileLoad(module)\n },\n (error: unknown) => {\n if (mobileRequested) setMobileLoad({ error })\n }\n )\n }\n const [mobileMount, setMobileMount] = createSignal<\n { element: HTMLElement; connected: boolean } | undefined\n >()\n const id = props.id ?? `contextual-sidebar-${createUniqueId()}`\n const resizeLabel = () => props.resizeLabel ?? `Resize ${props.label}`\n const portalMount = () => {\n const mount = mobileMount()\n return mount?.connected && mount.element.isConnected ? mount.element : undefined\n }\n\n onMount(() => {\n const media = window.matchMedia('(max-width: 48rem)')\n const updateViewport = () => {\n const wasNarrow = isNarrowViewport()\n if (media.matches) loadMobile()\n // Close before mounting a modal. A desktop-expanded host state is not\n // mobile intent, and opening the Sheet for one frame can steal focus.\n if (media.matches && !wasNarrow) props.onOpenChange(false)\n setIsNarrowViewport(media.matches)\n }\n\n // A route can mount after a wide-loaded host crosses into mobile. Clear\n // that stale seed, but preserve a sidebar intentionally opened at a\n // narrow boot viewport.\n if (media.matches) loadMobile()\n if (media.matches && props.wideViewportAtLoad && props.open) props.onOpenChange(false)\n setIsNarrowViewport(media.matches)\n media.addEventListener('change', updateViewport)\n onCleanup(() => {\n mobileRequested = false\n media.removeEventListener('change', updateViewport)\n })\n })\n\n const renderSidebar = (mobile: boolean) => {\n let element: HTMLElement | undefined\n const context: ContextualSidebarRenderContext = {\n mobile,\n portalMount: () => (mobile ? portalMount() : undefined),\n }\n const navigationId = `${id}-${mobile ? 'mobile' : 'desktop'}`\n\n onCleanup(() => {\n if (mobile && mobileMount()?.element === element) setMobileMount(undefined)\n element = undefined\n props.onSidebarElement?.(undefined, mobile)\n })\n\n return (\n <SidebarNav\n as=\"aside\"\n id={navigationId}\n aria-label={props.label}\n aria-hidden={!mobile && !props.open ? 'true' : undefined}\n inert={!mobile && !props.open}\n data-contextual-sidebar={mobile ? 'mobile' : 'desktop'}\n data-open={mobile ? undefined : String(props.open)}\n ref={(node) => {\n element = node\n if (mobile) {\n setMobileMount({ element: node, connected: node.isConnected })\n queueMicrotask(() => {\n if (node.isConnected && mobileMount()?.element === node)\n setMobileMount({ element: node, connected: true })\n })\n }\n props.onSidebarElement?.(node, mobile)\n }}\n class={cn('relative h-full w-full max-w-full', props.sidebarClass)}\n >\n <Show when={!mobile && props.open}>\n <PixelResizeHandle\n // The ruler spans the sidebar as a pointer-events-none overlay; lift\n // it above the neighbouring pane so the edge stays grabbable.\n class=\"z-(--z-docked)\"\n side=\"left\"\n value={props.width}\n minimum={props.minimum}\n maximum={props.maximum}\n step={props.step}\n label={resizeLabel()}\n controls={navigationId}\n onChange={props.onWidthChange}\n onCommit={props.onWidthCommit}\n />\n </Show>\n <Show when={!mobile || mobileMount()?.connected}>\n <Show\n when={mobile || props.titleVisibility !== 'mobile' || props.header}\n fallback={\n <SidebarNavTitle as={props.headingAs ?? 'h2'} class=\"sr-only\">\n {props.title}\n </SidebarNavTitle>\n }\n >\n <SidebarNavHeader class={cn(mobile && 'pe-12', props.headerClass)}>\n <SidebarNavTitle as={props.headingAs ?? 'h2'}>{props.title}</SidebarNavTitle>\n {props.header?.(context)}\n </SidebarNavHeader>\n </Show>\n <SidebarNavContent class={props.contentClass}>{props.content(context)}</SidebarNavContent>\n {props.footer ? (\n <SidebarNavFooter class={props.footerClass}>{props.footer(context)}</SidebarNavFooter>\n ) : null}\n </Show>\n </SidebarNav>\n )\n }\n\n return (\n <>\n <Show when={!isNarrowViewport()}>{(_wide) => renderSidebar(false)}</Show>\n <Show when={mobileLoad()} keyed>\n {(loaded) => {\n if ('error' in loaded) throw loaded.error\n return (\n <loaded.MobileSidebar\n open={isNarrowViewport() && props.open}\n onOpenChange={props.onOpenChange}\n label={props.label}\n sheetClass={props.sheetClass}\n restoreFocusRef={props.restoreFocusRef}\n renderSidebar={() => renderSidebar(true)}\n />\n )\n }}\n </Show>\n </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A;OAAA,CAAA;OAAAgC,gBAG3BnE,mBAAiB;QAAA,KAAA,WAAA;SAAA,OAAQ0C,MAAMX;QAAY;QAAA,IAAA+C,WAAA;SAAA,OAAGpC,MAAML,QAAQF,OAAO;QAAC;OAAA,CAAA;OAAAmD,WACpEA,WAAA,CAAA,CAAA5C,MAAMJ,MAAM,CAAA,CAAA,IAAA6B,gBACVlE,kBAAgB;QAAA,KAAA,WAAA;SAAA,OAAQyC,MAAMV;QAAW;QAAA,IAAA8C,WAAA;SAAA,OAAGpC,MAAMJ,OAAOH,OAAO;QAAC;OAAA,CAAA,IAChE,IAAI;MAAA;KAAA;IAAA,CAAA,CAAA;GAAA;EAAA,CAAA;CAIhB;CAEA,OAAA,CAAAgC,gBAEK1E,MAAI;EAAA,IAACsF,OAAI;GAAA,OAAE,CAACpC,iBAAiB;EAAC;EAAAmC,WAAIS,UAAUtB,cAAc,KAAK;CAAC,CAAA,GAAAE,gBAChE1E,MAAI;EAAA,IAACsF,OAAI;GAAA,OAAElC,WAAW;EAAC;EAAE2C,OAAK;EAAAV,WAC3BW,WAAW;GACX,IAAI,WAAWA,QAAQ,MAAMA,OAAOlF;GACpC,OAAA4D,gBACGsB,OAAOC,eAAa;IAAA,IACnBzE,OAAI;KAAA,OAAEqE,WAAA,CAAA,CAAA3C,iBAAiB,CAAC,CAAA,CAAA,KAAID,MAAMzB;IAAI;IAAA,IACtCC,eAAY;KAAA,OAAEwB,MAAMxB;IAAY;IAAA,IAChCJ,QAAK;KAAA,OAAE4B,MAAM5B;IAAK;IAAA,IAClBe,aAAU;KAAA,OAAEa,MAAMb;IAAU;IAAA,IAC5BJ,kBAAe;KAAA,OAAEiB,MAAMjB;IAAe;IACtCwC,qBAAqBA,cAAc,IAAI;GAAC,CAAA;EAG9C;CAAC,CAAA,CAAA;AAIT"}
1
+ {"version":3,"file":"contextual-sidebar.js","names":["Accessor","JSX","Show","createSignal","createUniqueId","onCleanup","onMount","cn","SidebarNav","SidebarNavContent","SidebarNavFooter","SidebarNavHeader","SidebarNavTitle","PixelResizeHandle","MobileModule","MobileLoad","error","ContextualSidebarRenderContext","mobile","portalMount","HTMLElement","ContextualSidebarProps","id","label","title","titleVisibility","open","onOpenChange","width","minimum","maximum","step","wideViewportAtLoad","resizeLabel","resizeGrip","restoreFocusRef","onSidebarElement","element","sidebarClass","sheetClass","headerClass","contentClass","footerClass","headingAs","header","context","Element","content","footer","onWidthChange","onWidthCommit","ContextualSidebar","props","isNarrowViewport","setIsNarrowViewport","mobileLoad","setMobileLoad","mobileRequested","loadMobile","then","module","mobileMount","setMobileMount","connected","mount","isConnected","undefined","media","window","matchMedia","updateViewport","wasNarrow","matches","addEventListener","removeEventListener","renderSidebar","navigationId","_$createComponent","as","aria-label","aria-hidden","inert","data-open","String","ref","node","queueMicrotask","class","children","when","side","value","grip","controls","onChange","onCommit","fallback","_$memo","_wide","keyed","loaded","MobileSidebar","_$createComponent","_$memo"],"sources":["../../../../src/components/layout/contextual-sidebar/contextual-sidebar.tsx"],"sourcesContent":["import type { Accessor, JSX } from 'solid-js'\nimport { Show, createSignal, createUniqueId, onCleanup, onMount } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n SidebarNav,\n SidebarNavContent,\n SidebarNavFooter,\n SidebarNavHeader,\n SidebarNavTitle,\n} from '../sidebar-nav/sidebar-nav'\nimport { PixelResizeHandle } from '../pixel-resize-handle/pixel-resize-handle'\n\ntype MobileModule = typeof import('./mobile-contextual-sidebar')\ntype MobileLoad = MobileModule | { error: unknown }\n\nexport type ContextualSidebarRenderContext = {\n /** Whether the slot is being rendered inside the modal mobile sheet. */\n mobile: boolean\n /** Mount nested popovers and menus inside the mobile dialog's accessibility tree. */\n portalMount(): HTMLElement | undefined\n}\n\nexport type ContextualSidebarProps = {\n /** Stable host id prefix; generated when omitted. */\n id?: string\n /** Landmark name shared by the desktop and mobile navigation. */\n label: string\n /** Visible navigation title and mobile dialog title. */\n title: string\n /**\n * Where the title row shows. `always` (default) draws it on desktop and in\n * the mobile sheet; `mobile` keeps the desktop title for assistive\n * technology only and drops the desktop row, for hosts whose top bar\n * already names the context. A `header` slot keeps the row visible.\n */\n titleVisibility?: 'always' | 'mobile'\n /** Host-controlled expanded state for the desktop panel and mobile dialog. */\n open: boolean\n onOpenChange(open: boolean): void\n /** Current host-owned pixel width, reflected by the resize handle. */\n width: number\n minimum: number\n maximum: number\n step?: number\n /** Pass the host's initial viewport seed to distinguish stale desktop state. */\n wideViewportAtLoad?: boolean\n resizeLabel?: string\n /** The resize edge's grip: the default bordered chip, or the quieter rung. */\n resizeGrip?: 'chip' | 'rung'\n /** Stable external opener used when the modal mobile sheet closes. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n /** Called with the nav node so a host can project width onto its layout root. */\n onSidebarElement?: (element: HTMLElement | undefined, mobile: boolean) => void\n /** Host-owned layout classes applied to both nav instances. */\n sidebarClass?: string\n /** Host-owned responsive constraints for the modal sheet. */\n sheetClass?: string\n headerClass?: string\n contentClass?: string\n footerClass?: string\n headingAs?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n /** Optional action/content slot alongside the shared heading. */\n header?(context: ContextualSidebarRenderContext): JSX.Element\n /** View-specific navigation rows, projects, rooms, files, or sessions. */\n content(context: ContextualSidebarRenderContext): JSX.Element\n /** Optional view-specific footer, such as an archive affordance. */\n footer?(context: ContextualSidebarRenderContext): JSX.Element\n onWidthChange(width: number): void\n onWidthCommit?(width: number): void\n}\n\n/**\n * ContextualSidebar.\n *\n * Shared navigation geometry and interaction policy for an application's\n * contextual sidebar. The host keeps ownership of the actual grid width,\n * persisted preference, open state, and view-specific navigation content.\n */\nexport function ContextualSidebar(props: ContextualSidebarProps) {\n const [isNarrowViewport, setIsNarrowViewport] = createSignal(false)\n const [mobileLoad, setMobileLoad] = createSignal<MobileLoad>()\n let mobileRequested = false\n // Keep the resolved component mounted across viewport changes for Sheet cleanup.\n const loadMobile = () => {\n if (mobileRequested) return\n mobileRequested = true\n // Native module caching shares successful loads without keeping a rejected promise.\n void import('./mobile-contextual-sidebar').then(\n (module) => {\n if (mobileRequested) setMobileLoad(module)\n },\n (error: unknown) => {\n if (mobileRequested) setMobileLoad({ error })\n }\n )\n }\n const [mobileMount, setMobileMount] = createSignal<\n { element: HTMLElement; connected: boolean } | undefined\n >()\n const id = props.id ?? `contextual-sidebar-${createUniqueId()}`\n const resizeLabel = () => props.resizeLabel ?? `Resize ${props.label}`\n const portalMount = () => {\n const mount = mobileMount()\n return mount?.connected && mount.element.isConnected ? mount.element : undefined\n }\n\n onMount(() => {\n const media = window.matchMedia('(max-width: 48rem)')\n const updateViewport = () => {\n const wasNarrow = isNarrowViewport()\n if (media.matches) loadMobile()\n // Close before mounting a modal. A desktop-expanded host state is not\n // mobile intent, and opening the Sheet for one frame can steal focus.\n if (media.matches && !wasNarrow) props.onOpenChange(false)\n setIsNarrowViewport(media.matches)\n }\n\n // A route can mount after a wide-loaded host crosses into mobile. Clear\n // that stale seed, but preserve a sidebar intentionally opened at a\n // narrow boot viewport.\n if (media.matches) loadMobile()\n if (media.matches && props.wideViewportAtLoad && props.open) props.onOpenChange(false)\n setIsNarrowViewport(media.matches)\n media.addEventListener('change', updateViewport)\n onCleanup(() => {\n mobileRequested = false\n media.removeEventListener('change', updateViewport)\n })\n })\n\n const renderSidebar = (mobile: boolean) => {\n let element: HTMLElement | undefined\n const context: ContextualSidebarRenderContext = {\n mobile,\n portalMount: () => (mobile ? portalMount() : undefined),\n }\n const navigationId = `${id}-${mobile ? 'mobile' : 'desktop'}`\n\n onCleanup(() => {\n if (mobile && mobileMount()?.element === element) setMobileMount(undefined)\n element = undefined\n props.onSidebarElement?.(undefined, mobile)\n })\n\n return (\n <SidebarNav\n as=\"aside\"\n id={navigationId}\n aria-label={props.label}\n aria-hidden={!mobile && !props.open ? 'true' : undefined}\n inert={!mobile && !props.open}\n data-contextual-sidebar={mobile ? 'mobile' : 'desktop'}\n data-open={mobile ? undefined : String(props.open)}\n ref={(node) => {\n element = node\n if (mobile) {\n setMobileMount({ element: node, connected: node.isConnected })\n queueMicrotask(() => {\n if (node.isConnected && mobileMount()?.element === node)\n setMobileMount({ element: node, connected: true })\n })\n }\n props.onSidebarElement?.(node, mobile)\n }}\n class={cn('relative h-full w-full max-w-full', props.sidebarClass)}\n >\n <Show when={!mobile && props.open}>\n <PixelResizeHandle\n // The ruler spans the sidebar as a pointer-events-none overlay; lift\n // it above the neighbouring pane so the edge stays grabbable.\n class=\"z-(--z-docked)\"\n side=\"left\"\n value={props.width}\n minimum={props.minimum}\n maximum={props.maximum}\n step={props.step}\n label={resizeLabel()}\n grip={props.resizeGrip}\n controls={navigationId}\n onChange={props.onWidthChange}\n onCommit={props.onWidthCommit}\n />\n </Show>\n <Show when={!mobile || mobileMount()?.connected}>\n <Show\n when={mobile || props.titleVisibility !== 'mobile' || props.header}\n fallback={\n <SidebarNavTitle as={props.headingAs ?? 'h2'} class=\"sr-only\">\n {props.title}\n </SidebarNavTitle>\n }\n >\n <SidebarNavHeader class={cn(mobile && 'pe-12', props.headerClass)}>\n <SidebarNavTitle as={props.headingAs ?? 'h2'}>{props.title}</SidebarNavTitle>\n {props.header?.(context)}\n </SidebarNavHeader>\n </Show>\n <SidebarNavContent class={props.contentClass}>{props.content(context)}</SidebarNavContent>\n {props.footer ? (\n <SidebarNavFooter class={props.footerClass}>{props.footer(context)}</SidebarNavFooter>\n ) : null}\n </Show>\n </SidebarNav>\n )\n }\n\n return (\n <>\n <Show when={!isNarrowViewport()}>{(_wide) => renderSidebar(false)}</Show>\n <Show when={mobileLoad()} keyed>\n {(loaded) => {\n if ('error' in loaded) throw loaded.error\n return (\n <loaded.MobileSidebar\n open={isNarrowViewport() && props.open}\n onOpenChange={props.onOpenChange}\n label={props.label}\n sheetClass={props.sheetClass}\n restoreFocusRef={props.restoreFocusRef}\n renderSidebar={() => renderSidebar(true)}\n />\n )\n }}\n </Show>\n </>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AA8EA,SAAgBmD,kBAA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OAAAgC,gBAG3BpE,mBAAiB;QAAA,KAAA,WAAA;SAAA,OAAQ2C,MAAMX;QAAY;QAAA,IAAA+C,WAAA;SAAA,OAAGpC,MAAML,QAAQF,OAAO;QAAC;OAAA,CAAA;OAAAoD,WACpEA,WAAA,CAAA,CAAA7C,MAAMJ,MAAM,CAAA,CAAA,IAAA6B,gBACVnE,kBAAgB;QAAA,KAAA,WAAA;SAAA,OAAQ0C,MAAMV;QAAW;QAAA,IAAA8C,WAAA;SAAA,OAAGpC,MAAMJ,OAAOH,OAAO;QAAC;OAAA,CAAA,IAChE,IAAI;MAAA;KAAA;IAAA,CAAA,CAAA;GAAA;EAAA,CAAA;CAIhB;CAEA,OAAA,CAAAgC,gBAEK3E,MAAI;EAAA,IAACuF,OAAI;GAAA,OAAE,CAACpC,iBAAiB;EAAC;EAAAmC,WAAIU,UAAUvB,cAAc,KAAK;CAAC,CAAA,GAAAE,gBAChE3E,MAAI;EAAA,IAACuF,OAAI;GAAA,OAAElC,WAAW;EAAC;EAAE4C,OAAK;EAAAX,WAC3BY,WAAW;GACX,IAAI,WAAWA,QAAQ,MAAMA,OAAOpF;GACpC,OAAA6D,gBACGuB,OAAOC,eAAa;IAAA,IACnB3E,OAAI;KAAA,OAAEuE,WAAA,CAAA,CAAA5C,iBAAiB,CAAC,CAAA,CAAA,KAAID,MAAM1B;IAAI;IAAA,IACtCC,eAAY;KAAA,OAAEyB,MAAMzB;IAAY;IAAA,IAChCJ,QAAK;KAAA,OAAE6B,MAAM7B;IAAK;IAAA,IAClBgB,aAAU;KAAA,OAAEa,MAAMb;IAAU;IAAA,IAC5BJ,kBAAe;KAAA,OAAEiB,MAAMjB;IAAe;IACtCwC,qBAAqBA,cAAc,IAAI;GAAC,CAAA;EAG9C;CAAC,CAAA,CAAA;AAIT"}
@@ -1 +1 @@
1
- {"version":3,"file":"mobile-contextual-sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI7C,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IACnD,aAAa,IAAI,GAAG,CAAC,OAAO,CAAA;CAC7B,CAAA;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,KAAK,EAAE,4BAA4B,eAahE"}
1
+ {"version":3,"file":"mobile-contextual-sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI7C,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,OAAO,CAAA;IACb,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAA;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,eAAe,CAAC,EAAE,QAAQ,CAAC,WAAW,GAAG,SAAS,CAAC,CAAA;IACnD,aAAa,IAAI,GAAG,CAAC,OAAO,CAAA;CAC7B,CAAA;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,KAAK,EAAE,4BAA4B,eAkBhE"}
@@ -18,7 +18,7 @@ function MobileSidebar(props) {
18
18
  return props.label;
19
19
  },
20
20
  get ["class"]() {
21
- return cn("gap-0 p-0", props.sheetClass);
21
+ return cn("w-[min(19rem,max(9rem,calc(100vw-var(--rail-width,3.5rem))))] max-w-[min(19rem,max(9rem,calc(100vw-var(--rail-width,3.5rem))))] gap-0 p-0", props.sheetClass);
22
22
  },
23
23
  get restoreFocusRef() {
24
24
  return props.restoreFocusRef;
@@ -1 +1 @@
1
- {"version":3,"file":"mobile-contextual-sidebar.js","names":["Accessor","JSX","cn","Sheet","SheetContent","MobileContextualSidebarProps","open","onOpenChange","label","sheetClass","restoreFocusRef","HTMLElement","renderSidebar","Element","MobileSidebar","props","_$createComponent","children","side","aria-label","class","_$createComponent"],"sources":["../../../../src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx"],"sourcesContent":["import type { Accessor, JSX } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Sheet, SheetContent } from '../../ui/sheet'\n\nexport type MobileContextualSidebarProps = {\n open: boolean\n onOpenChange(open: boolean): void\n label: string\n sheetClass?: string\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n renderSidebar(): JSX.Element\n}\n\n/** Sheet wrappers are loaded only when a contextual sidebar enters mobile mode. */\nexport function MobileSidebar(props: MobileContextualSidebarProps) {\n return (\n <Sheet open={props.open} onOpenChange={props.onOpenChange}>\n <SheetContent\n side=\"start\"\n aria-label={props.label}\n class={cn('gap-0 p-0', props.sheetClass)}\n restoreFocusRef={props.restoreFocusRef}\n >\n {props.renderSidebar()}\n </SheetContent>\n </Sheet>\n )\n}\n"],"mappings":";;;;;AAcA,SAAgBc,cAAcC,OAAqC;CACjE,OAAAC,gBACGb,OAAK;EAAA,IAACG,OAAI;GAAA,OAAES,MAAMT;EAAI;EAAA,IAAEC,eAAY;GAAA,OAAEQ,MAAMR;EAAY;EAAA,IAAAU,WAAA;GAAA,OAAAD,gBACtDZ,cAAY;IACXc,MAAI;IAAA,KAAA,gBAAA;KAAA,OACQH,MAAMP;IAAK;IAAA,KAAA,WAAA;KAAA,OAChBN,GAAG,aAAaa,MAAMN,UAAU;IAAC;IAAA,IACxCC,kBAAe;KAAA,OAAEK,MAAML;IAAe;IAAA,IAAAO,WAAA;KAAA,OAErCF,MAAMH,cAAc;IAAC;GAAA,CAAA;EAAA;CAAA,CAAA;AAI9B"}
1
+ {"version":3,"file":"mobile-contextual-sidebar.js","names":["Accessor","JSX","cn","Sheet","SheetContent","MobileContextualSidebarProps","open","onOpenChange","label","sheetClass","restoreFocusRef","HTMLElement","renderSidebar","Element","MobileSidebar","props","_$createComponent","children","side","aria-label","class","_$createComponent"],"sources":["../../../../src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx"],"sourcesContent":["import type { Accessor, JSX } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Sheet, SheetContent } from '../../ui/sheet'\n\nexport type MobileContextualSidebarProps = {\n open: boolean\n onOpenChange(open: boolean): void\n label: string\n sheetClass?: string\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n renderSidebar(): JSX.Element\n}\n\n/** Sheet wrappers are loaded only when a contextual sidebar enters mobile mode. */\nexport function MobileSidebar(props: MobileContextualSidebarProps) {\n return (\n <Sheet open={props.open} onOpenChange={props.onOpenChange}>\n <SheetContent\n side=\"start\"\n aria-label={props.label}\n // The sheet leaves the app rail visible beside it: at most 19rem, never\n // under 9rem, and otherwise the viewport less the rail's width.\n class={cn(\n 'w-[min(19rem,max(9rem,calc(100vw-var(--rail-width,3.5rem))))] max-w-[min(19rem,max(9rem,calc(100vw-var(--rail-width,3.5rem))))] gap-0 p-0',\n props.sheetClass\n )}\n restoreFocusRef={props.restoreFocusRef}\n >\n {props.renderSidebar()}\n </SheetContent>\n </Sheet>\n )\n}\n"],"mappings":";;;;;AAcA,SAAgBc,cAAcC,OAAqC;CACjE,OAAAC,gBACGb,OAAK;EAAA,IAACG,OAAI;GAAA,OAAES,MAAMT;EAAI;EAAA,IAAEC,eAAY;GAAA,OAAEQ,MAAMR;EAAY;EAAA,IAAAU,WAAA;GAAA,OAAAD,gBACtDZ,cAAY;IACXc,MAAI;IAAA,KAAA,gBAAA;KAAA,OACQH,MAAMP;IAAK;IAAA,KAAA,WAAA;KAAA,OAGhBN,GACL,6IACAa,MAAMN,UACR;IAAC;IAAA,IACDC,kBAAe;KAAA,OAAEK,MAAML;IAAe;IAAA,IAAAO,WAAA;KAAA,OAErCF,MAAMH,cAAc;IAAC;GAAA,CAAA;EAAA;CAAA,CAAA;AAI9B"}
@@ -9,6 +9,8 @@ export type PixelResizeHandleProps = {
9
9
  label?: string;
10
10
  controls?: string;
11
11
  class?: string;
12
+ /** The grip drawn on the edge: the default bordered chip, or the quieter rung. */
13
+ grip?: 'chip' | 'rung';
12
14
  onChange(value: number): void;
13
15
  onCommit?(value: number): void;
14
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"pixel-resize-handle.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,sBAAsB,GAAG;IACnC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,kCAgJ9D"}
1
+ {"version":3,"file":"pixel-resize-handle.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,sBAAsB,GAAG;IACnC,6EAA6E;IAC7E,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,kCAgJ9D"}
@@ -76,7 +76,9 @@ function PixelResizeHandle(props) {
76
76
  "aria-hidden": "true"
77
77
  }),
78
78
  createComponent(ResizableHandle, {
79
- withHandle: true,
79
+ get withHandle() {
80
+ return props.grip === "rung" ? "rung" : true;
81
+ },
80
82
  get label() {
81
83
  return props.label ?? `Resize ${props.side} pane`;
82
84
  },
@@ -1 +1 @@
1
- {"version":3,"file":"pixel-resize-handle.js","names":["ResizableHandle","ResizablePanel","ResizablePanelGroup","createSignal","onCleanup","cn","PixelResizeHandleProps","side","value","minimum","maximum","step","label","controls","class","onChange","onCommit","PixelResizeHandle","props","Math","max","min","round","ratio","isRight","rulerSizes","commit","interacting","drag","setDrag","pointerId","startX","startValue","handle","HTMLElement","endPointer","shouldCommit","current","undefined","hasPointerCapture","releasePointerCapture","endKeyboard","wasInteracting","_$createComponent","orientation","dir","sizes","keyboardDelta","style","width","onSizesChange","length","next","bounded","children","minSize","_$memo","maxSize","withHandle","aria-controls","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","data-dragging","onHandleDragStart","event","preventDefault","button","isPrimary","currentTarget","focus","setPointerCapture","clientX","onPointerMove","PointerEvent","delta","onPointerUp","onPointerCancel","onLostPointerCapture","onBlur","onKeyDown","includes","key","onKeyUp","_$createComponent","_$memo"],"sources":["../../../../src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx"],"sourcesContent":["import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '../../ui/resizable'\nimport { createSignal, onCleanup } from 'solid-js'\nimport { cn } from '#lib/utils'\n\nexport type PixelResizeHandleProps = {\n /** Which physical edge of the ruler the resizable surface is attached to. */\n side: 'left' | 'right'\n /** Current width in CSS pixels. */\n value: number\n minimum: number\n maximum: number\n step?: number\n label?: string\n controls?: string\n class?: string\n onChange(value: number): void\n onCommit?(value: number): void\n}\n\n/**\n * PixelResizeHandle.\n *\n * A keyboard- and pointer-operable edge ruler for a host-owned pane. Keep the\n * pane's actual width and any persistence in its layout owner; this component\n * reports a bounded pixel value and places the shared resizable grip at the\n * matching left or right edge.\n *\n * Corvu 0.2.5 supplies geometry, keyboard resizing, ARIA and the shared grip,\n * but its global drag handler does not end on pointer cancellation. Prevent\n * that handler through its public start hook and use local pointer capture\n * for bounded pixel gestures, including cancellation and lost capture.\n */\nexport function PixelResizeHandle(props: PixelResizeHandleProps) {\n const maximum = () => Math.max(1, props.maximum)\n const minimum = () => Math.min(maximum(), Math.max(0, props.minimum))\n const value = () => Math.min(maximum(), Math.max(minimum(), Math.round(props.value)))\n const ratio = () => value() / maximum()\n const isRight = () => props.side === 'right'\n const rulerSizes = () => (isRight() ? [1 - ratio(), ratio()] : [ratio(), 1 - ratio()])\n const commit = () => props.onCommit?.(value())\n let interacting = false\n const [drag, setDrag] = createSignal<{\n pointerId: number\n startX: number\n startValue: number\n handle: HTMLElement\n }>()\n const endPointer = (shouldCommit: boolean) => {\n const current = drag()\n if (!current) return\n setDrag(undefined)\n if (current.handle.hasPointerCapture(current.pointerId))\n current.handle.releasePointerCapture(current.pointerId)\n if (shouldCommit) commit()\n }\n const endKeyboard = () => {\n const wasInteracting = interacting\n interacting = false\n if (wasInteracting) commit()\n }\n onCleanup(() => {\n endKeyboard()\n endPointer(false)\n })\n\n return (\n <ResizablePanelGroup\n orientation=\"horizontal\"\n dir=\"ltr\"\n sizes={rulerSizes()}\n keyboardDelta={`${props.step ?? 16}px`}\n style={{ width: `${maximum()}px` }}\n class={cn(\n 'pointer-events-none absolute inset-y-0 flex',\n {\n 'left-0': props.side === 'left',\n 'right-0': props.side === 'right',\n },\n props.class\n )}\n onSizesChange={(sizes) => {\n // Panel registration and teardown also emit sizes. Only user resizing\n // may update the host preference; collapsing must preserve its width.\n if (!interacting || sizes.length !== 2) return\n const next = Math.round((sizes[isRight() ? 1 : 0] ?? ratio()) * maximum())\n const bounded = Math.min(maximum(), Math.max(minimum(), next))\n if (bounded !== value()) props.onChange(bounded)\n }}\n >\n <ResizablePanel\n minSize={isRight() ? 0 : minimum() / maximum()}\n maxSize={1}\n aria-hidden=\"true\"\n />\n <ResizableHandle\n withHandle\n label={props.label ?? `Resize ${props.side} pane`}\n aria-controls={props.controls}\n aria-valuemin={minimum()}\n aria-valuemax={maximum()}\n aria-valuenow={value()}\n aria-valuetext={`${value()} pixels`}\n data-dragging={drag() ? '' : undefined}\n onHandleDragStart={(event) => {\n // Corvu checks defaultPrevented before starting its global handler.\n event.preventDefault()\n if (event.button !== 0 || !event.isPrimary) return\n const handle = event.currentTarget\n if (!(handle instanceof HTMLElement)) return\n endPointer(false)\n interacting = false\n handle.focus()\n handle.setPointerCapture(event.pointerId)\n setDrag({\n pointerId: event.pointerId,\n startX: event.clientX,\n startValue: value(),\n handle,\n })\n }}\n onPointerMove={(event: PointerEvent) => {\n const current = drag()\n if (!current || event.pointerId !== current.pointerId) return\n if (!current.handle.hasPointerCapture(current.pointerId)) {\n endPointer(false)\n return\n }\n const delta = (event.clientX - current.startX) * (isRight() ? -1 : 1)\n const next = Math.min(\n maximum(),\n Math.max(minimum(), Math.round(current.startValue + delta))\n )\n if (next !== value()) props.onChange(next)\n }}\n onPointerUp={(event: PointerEvent) => {\n if (event.pointerId === drag()?.pointerId) endPointer(true)\n }}\n onPointerCancel={(event: PointerEvent) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onLostPointerCapture={(event: PointerEvent) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onBlur={() => {\n endKeyboard()\n endPointer(false)\n }}\n onKeyDown={(event) => {\n const current = drag()\n if (current && !current.handle.hasPointerCapture(current.pointerId)) endPointer(false)\n if (drag()) {\n event.preventDefault()\n return\n }\n if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) interacting = true\n // Corvu operates on physical panel order. Home/End here describe\n // the controlled pane width, including a pane after the separator.\n if (event.key === 'Home' || event.key === 'End') {\n event.preventDefault()\n props.onChange(event.key === 'Home' ? minimum() : maximum())\n }\n }}\n onKeyUp={(event) => {\n if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) {\n endKeyboard()\n }\n }}\n class=\"pointer-events-auto\"\n />\n <ResizablePanel\n minSize={isRight() ? minimum() / maximum() : 0}\n maxSize={1}\n aria-hidden=\"true\"\n />\n </ResizablePanelGroup>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgCA,SAAgBiB,kBAAkBC,OAA+B;CAC/D,MAAMR,gBAAgBS,KAAKC,IAAI,GAAGF,MAAMR,OAAO;CAC/C,MAAMD,gBAAgBU,KAAKE,IAAIX,QAAQ,GAAGS,KAAKC,IAAI,GAAGF,MAAMT,OAAO,CAAC;CACpE,MAAMD,cAAcW,KAAKE,IAAIX,QAAQ,GAAGS,KAAKC,IAAIX,QAAQ,GAAGU,KAAKG,MAAMJ,MAAMV,KAAK,CAAC,CAAC;CACpF,MAAMe,cAAcf,MAAM,IAAIE,QAAQ;CACtC,MAAMc,gBAAgBN,MAAMX,SAAS;CACrC,MAAMkB,mBAAoBD,QAAQ,IAAI,CAAC,IAAID,MAAM,GAAGA,MAAM,CAAC,IAAI,CAACA,MAAM,GAAG,IAAIA,MAAM,CAAC;CACpF,MAAMG,eAAeR,MAAMF,WAAWR,MAAM,CAAC;CAC7C,IAAImB,cAAc;CAClB,MAAM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A;CAAA,CAAA;AAKlB"}
1
+ {"version":3,"file":"pixel-resize-handle.js","names":["ResizableHandle","ResizablePanel","ResizablePanelGroup","createSignal","onCleanup","cn","PixelResizeHandleProps","side","value","minimum","maximum","step","label","controls","class","grip","onChange","onCommit","PixelResizeHandle","props","Math","max","min","round","ratio","isRight","rulerSizes","commit","interacting","drag","setDrag","pointerId","startX","startValue","handle","HTMLElement","endPointer","shouldCommit","current","undefined","hasPointerCapture","releasePointerCapture","endKeyboard","wasInteracting","_$createComponent","orientation","dir","sizes","keyboardDelta","style","width","onSizesChange","length","next","bounded","children","minSize","_$memo","maxSize","withHandle","aria-controls","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","data-dragging","onHandleDragStart","event","preventDefault","button","isPrimary","currentTarget","focus","setPointerCapture","clientX","onPointerMove","PointerEvent","delta","onPointerUp","onPointerCancel","onLostPointerCapture","onBlur","onKeyDown","includes","key","onKeyUp","_$createComponent","_$memo"],"sources":["../../../../src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx"],"sourcesContent":["import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '../../ui/resizable'\nimport { createSignal, onCleanup } from 'solid-js'\nimport { cn } from '#lib/utils'\n\nexport type PixelResizeHandleProps = {\n /** Which physical edge of the ruler the resizable surface is attached to. */\n side: 'left' | 'right'\n /** Current width in CSS pixels. */\n value: number\n minimum: number\n maximum: number\n step?: number\n label?: string\n controls?: string\n class?: string\n /** The grip drawn on the edge: the default bordered chip, or the quieter rung. */\n grip?: 'chip' | 'rung'\n onChange(value: number): void\n onCommit?(value: number): void\n}\n\n/**\n * PixelResizeHandle.\n *\n * A keyboard- and pointer-operable edge ruler for a host-owned pane. Keep the\n * pane's actual width and any persistence in its layout owner; this component\n * reports a bounded pixel value and places the shared resizable grip at the\n * matching left or right edge.\n *\n * Corvu 0.2.5 supplies geometry, keyboard resizing, ARIA and the shared grip,\n * but its global drag handler does not end on pointer cancellation. Prevent\n * that handler through its public start hook and use local pointer capture\n * for bounded pixel gestures, including cancellation and lost capture.\n */\nexport function PixelResizeHandle(props: PixelResizeHandleProps) {\n const maximum = () => Math.max(1, props.maximum)\n const minimum = () => Math.min(maximum(), Math.max(0, props.minimum))\n const value = () => Math.min(maximum(), Math.max(minimum(), Math.round(props.value)))\n const ratio = () => value() / maximum()\n const isRight = () => props.side === 'right'\n const rulerSizes = () => (isRight() ? [1 - ratio(), ratio()] : [ratio(), 1 - ratio()])\n const commit = () => props.onCommit?.(value())\n let interacting = false\n const [drag, setDrag] = createSignal<{\n pointerId: number\n startX: number\n startValue: number\n handle: HTMLElement\n }>()\n const endPointer = (shouldCommit: boolean) => {\n const current = drag()\n if (!current) return\n setDrag(undefined)\n if (current.handle.hasPointerCapture(current.pointerId))\n current.handle.releasePointerCapture(current.pointerId)\n if (shouldCommit) commit()\n }\n const endKeyboard = () => {\n const wasInteracting = interacting\n interacting = false\n if (wasInteracting) commit()\n }\n onCleanup(() => {\n endKeyboard()\n endPointer(false)\n })\n\n return (\n <ResizablePanelGroup\n orientation=\"horizontal\"\n dir=\"ltr\"\n sizes={rulerSizes()}\n keyboardDelta={`${props.step ?? 16}px`}\n style={{ width: `${maximum()}px` }}\n class={cn(\n 'pointer-events-none absolute inset-y-0 flex',\n {\n 'left-0': props.side === 'left',\n 'right-0': props.side === 'right',\n },\n props.class\n )}\n onSizesChange={(sizes) => {\n // Panel registration and teardown also emit sizes. Only user resizing\n // may update the host preference; collapsing must preserve its width.\n if (!interacting || sizes.length !== 2) return\n const next = Math.round((sizes[isRight() ? 1 : 0] ?? ratio()) * maximum())\n const bounded = Math.min(maximum(), Math.max(minimum(), next))\n if (bounded !== value()) props.onChange(bounded)\n }}\n >\n <ResizablePanel\n minSize={isRight() ? 0 : minimum() / maximum()}\n maxSize={1}\n aria-hidden=\"true\"\n />\n <ResizableHandle\n withHandle={props.grip === 'rung' ? 'rung' : true}\n label={props.label ?? `Resize ${props.side} pane`}\n aria-controls={props.controls}\n aria-valuemin={minimum()}\n aria-valuemax={maximum()}\n aria-valuenow={value()}\n aria-valuetext={`${value()} pixels`}\n data-dragging={drag() ? '' : undefined}\n onHandleDragStart={(event) => {\n // Corvu checks defaultPrevented before starting its global handler.\n event.preventDefault()\n if (event.button !== 0 || !event.isPrimary) return\n const handle = event.currentTarget\n if (!(handle instanceof HTMLElement)) return\n endPointer(false)\n interacting = false\n handle.focus()\n handle.setPointerCapture(event.pointerId)\n setDrag({\n pointerId: event.pointerId,\n startX: event.clientX,\n startValue: value(),\n handle,\n })\n }}\n onPointerMove={(event: PointerEvent) => {\n const current = drag()\n if (!current || event.pointerId !== current.pointerId) return\n if (!current.handle.hasPointerCapture(current.pointerId)) {\n endPointer(false)\n return\n }\n const delta = (event.clientX - current.startX) * (isRight() ? -1 : 1)\n const next = Math.min(\n maximum(),\n Math.max(minimum(), Math.round(current.startValue + delta))\n )\n if (next !== value()) props.onChange(next)\n }}\n onPointerUp={(event: PointerEvent) => {\n if (event.pointerId === drag()?.pointerId) endPointer(true)\n }}\n onPointerCancel={(event: PointerEvent) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onLostPointerCapture={(event: PointerEvent) => {\n if (event.pointerId === drag()?.pointerId) endPointer(false)\n }}\n onBlur={() => {\n endKeyboard()\n endPointer(false)\n }}\n onKeyDown={(event) => {\n const current = drag()\n if (current && !current.handle.hasPointerCapture(current.pointerId)) endPointer(false)\n if (drag()) {\n event.preventDefault()\n return\n }\n if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) interacting = true\n // Corvu operates on physical panel order. Home/End here describe\n // the controlled pane width, including a pane after the separator.\n if (event.key === 'Home' || event.key === 'End') {\n event.preventDefault()\n props.onChange(event.key === 'Home' ? minimum() : maximum())\n }\n }}\n onKeyUp={(event) => {\n if (['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) {\n endKeyboard()\n }\n }}\n class=\"pointer-events-auto\"\n />\n <ResizablePanel\n minSize={isRight() ? minimum() / maximum() : 0}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AAIS,WAAW,CAACA,QAAQJ,OAAOM,kBAAkBF,QAAQP,SAAS,GAAGK,WAAW,KAAK;MACrF,IAAIP,KAAK,GAAG;OACVsC,MAAMC,eAAe;OACrB;MACF;MACA,IAAI;OAAC;OAAa;OAAc;OAAQ;MAAK,CAAC,CAACe,SAAShB,MAAMiB,GAAG,GAAGxD,cAAc;MAGlF,IAAIuC,MAAMiB,QAAQ,UAAUjB,MAAMiB,QAAQ,OAAO;OAC/CjB,MAAMC,eAAe;OACrBjD,MAAMH,SAASmD,MAAMiB,QAAQ,SAAS3E,QAAQ,IAAIC,QAAQ,CAAC;MAC7D;KACF;KACA2E,UAAUlB,UAAU;MAClB,IAAI;OAAC;OAAa;OAAc;OAAQ;MAAK,CAAC,CAACgB,SAAShB,MAAMiB,GAAG,GAC/D1C,YAAY;KAEhB;KAAC,SAAA;IAAA,CAAA;IAAAE,gBAGF3C,gBAAc;KAAA,IACbuD,UAAO;MAAA,OAAEC,WAAA,CAAA,CAAAhC,QAAQ,CAAC,CAAA,CAAA,IAAGhB,QAAQ,IAAIC,QAAQ,IAAI;KAAC;KAC9CgD,SAAS;KAAC,eAAA;IAAA,CAAA;GAAA;EAAA;CAAA,CAAA;AAKlB"}
@@ -24,5 +24,12 @@ export type AlertProps = ComponentProps<'div'> & AlertVariantProps & {
24
24
  export declare function Alert(props: AlertProps): JSX.Element;
25
25
  export declare function AlertTitle(props: ComponentProps<'div'>): JSX.Element;
26
26
  export declare function AlertDescription(props: ComponentProps<'div'>): JSX.Element;
27
+ /**
28
+ * The alert's own actions — a Retry, an Open settings, a Cancel — on a row
29
+ * under the text, aligned with the title rather than the glyph. Buttons here
30
+ * are `size="xs" variant="outline"` by convention, so an alert's action reads
31
+ * as part of the message rather than as the page's primary action.
32
+ */
33
+ export declare function AlertAction(props: ComponentProps<'div'>): JSX.Element;
27
34
  export { alertVariants };
28
35
  //# sourceMappingURL=alert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert/alert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGnD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,aAAa;;8EAclB,CAAA;AAkBD,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAE3D,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,GAC5C,iBAAiB,GAAG;IAClB,yEAAyE;IACzE,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAA;CAC1B,CAAA;AAEH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,eAuBtC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAStD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAS5D;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert/alert.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGnD,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,aAAa;;8EAclB,CAAA;AAkBD,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAE3D,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,GAC5C,iBAAiB,GAAG;IAClB,yEAAyE;IACzE,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,IAAI,CAAA;CAC1B,CAAA;AAEH,wBAAgB,KAAK,CAAC,KAAK,EAAE,UAAU,eAuBtC;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAStD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eAS5D;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,eASvD;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -8,6 +8,7 @@ var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=alert role=alert>`);
8
8
  var _tmpl$2 = /*#__PURE__*/ template(`<span data-slot=alert-icon>`);
9
9
  var _tmpl$3 = /*#__PURE__*/ template(`<div data-slot=alert-title>`);
10
10
  var _tmpl$4 = /*#__PURE__*/ template(`<div data-slot=alert-description>`);
11
+ var _tmpl$5 = /*#__PURE__*/ template(`<div data-slot=alert-action>`);
11
12
  /**
12
13
  * Alert.
13
14
  *
@@ -93,7 +94,23 @@ function AlertDescription(props) {
93
94
  return _el$4;
94
95
  })();
95
96
  }
97
+ /**
98
+ * The alert's own actions — a Retry, an Open settings, a Cancel — on a row
99
+ * under the text, aligned with the title rather than the glyph. Buttons here
100
+ * are `size="xs" variant="outline"` by convention, so an alert's action reads
101
+ * as part of the message rather than as the page's primary action.
102
+ */
103
+ function AlertAction(props) {
104
+ const [local, rest] = splitProps(props, ["class"]);
105
+ return (() => {
106
+ var _el$5 = _tmpl$5();
107
+ spread(_el$5, mergeProps({ get ["class"]() {
108
+ return cn("col-start-2 mt-1 flex flex-wrap items-center gap-2", local.class);
109
+ } }, rest), false, false);
110
+ return _el$5;
111
+ })();
112
+ }
96
113
  //#endregion
97
- export { Alert, AlertDescription, AlertTitle, alertVariants };
114
+ export { Alert, AlertAction, AlertDescription, AlertTitle, alertVariants };
98
115
 
99
116
  //# sourceMappingURL=alert.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.js","names":["AlertCircle","CheckCircle2","Info","TriangleAlert","ComponentProps","JSX","splitProps","Dynamic","cva","VariantProps","cn","alertVariants","variants","variant","default","destructive","success","warning","info","defaultVariants","alertIcons","const","alertIconTones","AlertVariantProps","AlertProps","icon","Element","Alert","props","local","rest","tone","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","_c$","_$memo","_el$2","_tmpl$2","_$createComponent","component","_$effect","_$className","children","AlertTitle","_el$3","_tmpl$3","AlertDescription","_el$4","_tmpl$4","_$mergeProps","_$memo","_$createComponent","_$className"],"sources":["../../../../src/components/ui/alert/alert.tsx"],"sourcesContent":["import { AlertCircle, CheckCircle2, Info, TriangleAlert } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Alert.\n *\n * A message about the whole surface it sits in — a form's validation summary,\n * a failed sync banner, a permission notice. It is deliberately not a dialog:\n * an alert that must be dismissed before the user can continue is a Dialog.\n *\n * The glyph follows the tone rather than being passed in, so an alert cannot\n * be given a green checkmark on a destructive fill. A caller that genuinely\n * needs a different icon passes `icon`; `icon={null}` removes it. Text stays on\n * the body foreground over the tinted status surface, while the glyph and edge\n * carry the status hue.\n */\nconst alertVariants = cva(\n 'relative grid w-full grid-cols-[auto_1fr] items-start gap-x-3 gap-y-1 rounded-lg border px-3 py-2.5 text-sm',\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground border-border',\n destructive: 'bg-destructive-subtle text-foreground border-destructive/30',\n success: 'bg-success-subtle text-foreground border-success/30',\n warning: 'bg-warning-subtle text-foreground border-warning/30',\n info: 'bg-info-subtle text-foreground border-info/30',\n },\n },\n defaultVariants: { variant: 'default' },\n }\n)\n\nconst alertIcons = {\n default: Info,\n destructive: AlertCircle,\n success: CheckCircle2,\n warning: TriangleAlert,\n info: Info,\n} as const\n\nconst alertIconTones = {\n default: 'text-muted-foreground',\n destructive: 'text-destructive',\n success: 'text-success',\n warning: 'text-warning',\n info: 'text-info',\n} as const\n\ntype AlertVariantProps = VariantProps<typeof alertVariants>\n\nexport type AlertProps = ComponentProps<'div'> &\n AlertVariantProps & {\n /** Replace the tone's glyph with your own element. `null` removes it. */\n icon?: JSX.Element | null\n }\n\nexport function Alert(props: AlertProps) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'icon', 'children'])\n\n const tone = () => local.variant ?? 'default'\n\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(alertVariants({ variant: local.variant }), local.class)}\n {...rest}\n >\n {local.icon === null ? null : (\n <span\n data-slot=\"alert-icon\"\n class={cn('row-span-2 pt-0.5 [&_svg]:size-4', alertIconTones[tone()])}\n >\n {local.icon ?? <Dynamic component={alertIcons[tone()]} />}\n </span>\n )}\n {local.children}\n </div>\n )\n}\n\nexport function AlertTitle(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-title\"\n class={cn('col-start-2 font-medium tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function AlertDescription(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-description\"\n class={cn('col-start-2 text-sm [&_p]:leading-relaxed', local.class)}\n {...rest}\n />\n )\n}\n\nexport { alertVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAMW,gBAAgBH,IACpB,+GACA;CACEI,UAAU,EACRC,SAAS;EACPC,SAAS;EACTC,aAAa;EACbC,SAAS;EACTC,SAAS;EACTC,MAAM;CACR,EACF;CACAC,iBAAiB,EAAEN,SAAS,UAAU;AACxC,CACF;AAEA,IAAMO,aAAa;CACjBN,SAASZ;CACTa,aAAaf;CACbgB,SAASf;CACTgB,SAASd;CACTe,MAAMhB;AACR;AAEA,IAAMoB,iBAAiB;CACrBR,SAAS;CACTC,aAAa;CACbC,SAAS;CACTC,SAAS;CACTC,MAAM;AACR;AAUA,SAAgBS,MAAMC,OAAmB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cAAA;EAAA,IAAAuB,QAAAC,QAAA;EAAAlB,OAAAiB,OAAAhB,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWzB,GAAG,6CAA6CmB,MAAMO,KAAK;EAAC,EAAA,GAC/DN,IAAI,GAAA,OAAA,KAAA;EAAA,OAAAqB;CAAA,EAAA,CAAA;AAGd"}
1
+ {"version":3,"file":"alert.js","names":["AlertCircle","CheckCircle2","Info","TriangleAlert","ComponentProps","JSX","splitProps","Dynamic","cva","VariantProps","cn","alertVariants","variants","variant","default","destructive","success","warning","info","defaultVariants","alertIcons","const","alertIconTones","AlertVariantProps","AlertProps","icon","Element","Alert","props","local","rest","tone","_el$","_tmpl$","_$spread","_$mergeProps","class","_$insert","_c$","_$memo","_el$2","_tmpl$2","_$createComponent","component","_$effect","_$className","children","AlertTitle","_el$3","_tmpl$3","AlertDescription","_el$4","_tmpl$4","AlertAction","_el$5","_tmpl$5","_$mergeProps","_$memo","_$createComponent","_$className"],"sources":["../../../../src/components/ui/alert/alert.tsx"],"sourcesContent":["import { AlertCircle, CheckCircle2, Info, TriangleAlert } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { Dynamic } from 'solid-js/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Alert.\n *\n * A message about the whole surface it sits in — a form's validation summary,\n * a failed sync banner, a permission notice. It is deliberately not a dialog:\n * an alert that must be dismissed before the user can continue is a Dialog.\n *\n * The glyph follows the tone rather than being passed in, so an alert cannot\n * be given a green checkmark on a destructive fill. A caller that genuinely\n * needs a different icon passes `icon`; `icon={null}` removes it. Text stays on\n * the body foreground over the tinted status surface, while the glyph and edge\n * carry the status hue.\n */\nconst alertVariants = cva(\n 'relative grid w-full grid-cols-[auto_1fr] items-start gap-x-3 gap-y-1 rounded-lg border px-3 py-2.5 text-sm',\n {\n variants: {\n variant: {\n default: 'bg-card text-card-foreground border-border',\n destructive: 'bg-destructive-subtle text-foreground border-destructive/30',\n success: 'bg-success-subtle text-foreground border-success/30',\n warning: 'bg-warning-subtle text-foreground border-warning/30',\n info: 'bg-info-subtle text-foreground border-info/30',\n },\n },\n defaultVariants: { variant: 'default' },\n }\n)\n\nconst alertIcons = {\n default: Info,\n destructive: AlertCircle,\n success: CheckCircle2,\n warning: TriangleAlert,\n info: Info,\n} as const\n\nconst alertIconTones = {\n default: 'text-muted-foreground',\n destructive: 'text-destructive',\n success: 'text-success',\n warning: 'text-warning',\n info: 'text-info',\n} as const\n\ntype AlertVariantProps = VariantProps<typeof alertVariants>\n\nexport type AlertProps = ComponentProps<'div'> &\n AlertVariantProps & {\n /** Replace the tone's glyph with your own element. `null` removes it. */\n icon?: JSX.Element | null\n }\n\nexport function Alert(props: AlertProps) {\n const [local, rest] = splitProps(props, ['class', 'variant', 'icon', 'children'])\n\n const tone = () => local.variant ?? 'default'\n\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n class={cn(alertVariants({ variant: local.variant }), local.class)}\n {...rest}\n >\n {local.icon === null ? null : (\n <span\n data-slot=\"alert-icon\"\n class={cn('row-span-2 pt-0.5 [&_svg]:size-4', alertIconTones[tone()])}\n >\n {local.icon ?? <Dynamic component={alertIcons[tone()]} />}\n </span>\n )}\n {local.children}\n </div>\n )\n}\n\nexport function AlertTitle(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-title\"\n class={cn('col-start-2 font-medium tracking-tight', local.class)}\n {...rest}\n />\n )\n}\n\nexport function AlertDescription(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-description\"\n class={cn('col-start-2 text-sm [&_p]:leading-relaxed', local.class)}\n {...rest}\n />\n )\n}\n\n/**\n * The alert's own actions — a Retry, an Open settings, a Cancel — on a row\n * under the text, aligned with the title rather than the glyph. Buttons here\n * are `size=\"xs\" variant=\"outline\"` by convention, so an alert's action reads\n * as part of the message rather than as the page's primary action.\n */\nexport function AlertAction(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <div\n data-slot=\"alert-action\"\n class={cn('col-start-2 mt-1 flex flex-wrap items-center gap-2', local.class)}\n {...rest}\n />\n )\n}\n\nexport { alertVariants }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAMW,gBAAgBH,IACpB,+GACA;CACEI,UAAU,EACRC,SAAS;EACPC,SAAS;EACTC,aAAa;EACbC,SAAS;EACTC,SAAS;EACTC,MAAM;CACR,EACF;CACAC,iBAAiB,EAAEN,SAAS,UAAU;AACxC,CACF;AAEA,IAAMO,aAAa;CACjBN,SAASZ;CACTa,aAAaf;CACbgB,SAASf;CACTgB,SAASd;CACTe,MAAMhB;AACR;AAEA,IAAMoB,iBAAiB;CACrBR,SAAS;CACTC,aAAa;CACbC,SAAS;CACTC,SAAS;CACTC,MAAM;AACR;AAUA,SAAgBS,MAAMC,OAAmB;CACvC,MAAM,CAACC,OAAOC,QAAQxB,WAAWsB,OAAO;EAAC;EAAS;EAAW;EAAQ;CAAU,CAAC;CAEhF,MAAMG,aAAaF,MAAMhB,WAAW;CAEpC,cAAA;EAAA,IAAAmB,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA,EAAA,KAAA,WAAA;GAAA,OAIWzB,GAAGC,cAAc,EAAEE,SAASgB,MAAMhB,QAAQ,CAAC,GAAGgB,MAAMO,KAAK;EAAC,EAAA,GAC7DN,IAAI,GAAA,OAAA,IAAA;EAAAO,OAAAL,aAAA;GAAA,IAAAM,MAAAC,WAEPV,MAAMJ,SAAS,IAAI;GAAA,aAAnBa,IAAA,IAAsB,cAAI;IAAA,IAAAE,QAAAC,QAAA;IAAAJ,OAAAG,aAKtBX,MAAMJ,QAAIiB,gBAAKnC,SAAO,EAAA,IAACoC,YAAS;KAAA,OAAEvB,WAAWW,KAAK;IAAE,EAAA,CAAA,CAAI;IAAAa,aAAAC,UAAAL,OAFlD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Description, AlertTitle, alertVariants, type AlertProps, } from './alert';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/alert/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,WAAW,EACX,gBAAgB,EAChB,UAAU,EACV,aAAa,EACb,KAAK,UAAU,GAChB,MAAM,SAAS,CAAA"}
@@ -1,2 +1,2 @@
1
- import { Alert, AlertDescription, AlertTitle, alertVariants } from "./alert.js";
2
- export { Alert, AlertDescription, AlertTitle, alertVariants };
1
+ import { Alert, AlertAction, AlertDescription, AlertTitle, alertVariants } from "./alert.js";
2
+ export { Alert, AlertAction, AlertDescription, AlertTitle, alertVariants };
@@ -1 +1 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAmC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;8EAqCzB,CAAA;AAED,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAE3D,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,cAAc,GAAG,MAAM,IAAI,gBAAgB,CAC1E,CAAC,EACD,iBAAiB,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CACvC,CAAA;AAED,wBAAgB,KAAK,CAAC,CAAC,SAAS,cAAc,GAAG,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,kCAU5E"}
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/badge/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAmC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAGtD;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;8EAqCzB,CAAA;AAED,KAAK,iBAAiB,GAAG,YAAY,CAAC,OAAO,aAAa,CAAC,CAAA;AAE3D,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,cAAc,GAAG,MAAM,IAAI,gBAAgB,CAC1E,CAAC,EACD,iBAAiB,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CACvC,CAAA;AAED,wBAAgB,KAAK,CAAC,CAAC,SAAS,cAAc,GAAG,MAAM,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,kCAW5E"}
@@ -55,6 +55,7 @@ function Badge(props) {
55
55
  ]);
56
56
  return createComponent(Polymorphic, mergeProps({
57
57
  as: "span",
58
+ "data-slot": "badge",
58
59
  get ["class"]() {
59
60
  return cn(badgeVariants({
60
61
  variant: local.variant,
@@ -1 +1 @@
1
- {"version":3,"file":"badge.js","names":["Polymorphic","PolymorphicProps","ComponentProps","splitProps","ValidComponent","cva","VariantProps","cn","badgeVariants","variants","variant","default","secondary","outline","success","warning","destructive","info","subtle","notification","size","sm","md","lg","defaultVariants","BadgeVariantProps","BadgeProps","T","class","Badge","props","local","rest","_$createComponent","_$mergeProps","as","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/ui/badge/badge.tsx"],"sourcesContent":["import { Polymorphic, type PolymorphicProps } from '@kobalte/core/polymorphic'\nimport { type ComponentProps, splitProps, type ValidComponent } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Badge.\n *\n * A short, non-interactive status label. If it can be clicked it is a Button\n * with `size=\"2xs\"`, not a Badge — the difference matters because a Badge\n * carries no focus or pressed state and must never be the only way to reach an\n * action.\n */\nexport const badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-md border border-transparent font-medium transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n outline: 'border-border text-foreground',\n /**\n * Tinted status fills, for counts and states rather than actions. The\n * word stays in `foreground` for contrast; the glyph takes the status\n * hue, so tags of different tones read apart at a glance.\n */\n success: 'bg-success-subtle text-foreground [&_svg]:text-success',\n warning: 'bg-warning-subtle text-foreground [&_svg]:text-warning',\n destructive: 'bg-destructive-subtle text-foreground [&_svg]:text-destructive',\n info: 'bg-info-subtle text-foreground [&_svg]:text-info',\n subtle: 'bg-primary-subtle text-primary',\n /**\n * A count that asks for attention, pinned to a corner of another control\n * (a workspace mark, a rail icon). At `sm` it is a 2xs label on whatever\n * surface sits behind the corner, where the destructive tint all but\n * disappears — so it takes the solid, contrast-measured action fill.\n */\n notification: 'bg-destructive-action text-destructive-action-foreground',\n },\n size: {\n sm: 'h-4 px-1.5 text-2xs',\n md: 'h-5 px-2 text-xs',\n lg: 'h-6 px-2.5 text-xs',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n)\n\ntype BadgeVariantProps = VariantProps<typeof badgeVariants>\n\nexport type BadgeProps<T extends ValidComponent = 'span'> = PolymorphicProps<\n T,\n BadgeVariantProps & { class?: string }\n>\n\nexport function Badge<T extends ValidComponent = 'span'>(props: BadgeProps<T>) {\n const [local, rest] = splitProps(props as BadgeProps, ['variant', 'size', 'class'])\n\n return (\n <Polymorphic\n as=\"span\"\n class={cn(badgeVariants({ variant: local.variant, size: local.size }), local.class)}\n {...(rest as ComponentProps<'span'>)}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAaQ,gBAAgBH,IAC3B,iNACA;CACEI,UAAU;EACRC,SAAS;GACPC,SAAS;GACTC,WAAW;GACXC,SAAS;;;;;;GAMTC,SAAS;GACTC,SAAS;GACTC,aAAa;GACbC,MAAM;GACNC,QAAQ;;;;;;;GAORC,cAAc;EAChB;EACAC,MAAM;GACJC,IAAI;GACJC,IAAI;GACJC,IAAI;EACN;CACF;CACAC,iBAAiB;EACfd,SAAS;EACTU,MAAM;CACR;AACF,CACF;AASA,SAAgBS,MAAyCC,OAAsB;CAC7E,MAAM,CAACC,OAAOC,QAAQ7B,WAAW2B,OAAqB;EAAC;EAAW;EAAQ;CAAO,CAAC;CAElF,OAAAG,gBACGjC,aAAWkC,WAAA;EACVC,IAAE;EAAA,KAAA,WAAA;GAAA,OACK5B,GAAGC,cAAc;IAAEE,SAASqB,MAAMrB;IAASU,MAAMW,MAAMX;GAAK,CAAC,GAAGW,MAAMH,KAAK;EAAC;CAAA,GAC9EI,IAA8B,CAAA;AAGzC"}
1
+ {"version":3,"file":"badge.js","names":["Polymorphic","PolymorphicProps","ComponentProps","splitProps","ValidComponent","cva","VariantProps","cn","badgeVariants","variants","variant","default","secondary","outline","success","warning","destructive","info","subtle","notification","size","sm","md","lg","defaultVariants","BadgeVariantProps","BadgeProps","T","class","Badge","props","local","rest","_$createComponent","_$mergeProps","as","_$createComponent","_$mergeProps"],"sources":["../../../../src/components/ui/badge/badge.tsx"],"sourcesContent":["import { Polymorphic, type PolymorphicProps } from '@kobalte/core/polymorphic'\nimport { type ComponentProps, splitProps, type ValidComponent } from 'solid-js'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Badge.\n *\n * A short, non-interactive status label. If it can be clicked it is a Button\n * with `size=\"2xs\"`, not a Badge — the difference matters because a Badge\n * carries no focus or pressed state and must never be the only way to reach an\n * action.\n */\nexport const badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-md border border-transparent font-medium transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n outline: 'border-border text-foreground',\n /**\n * Tinted status fills, for counts and states rather than actions. The\n * word stays in `foreground` for contrast; the glyph takes the status\n * hue, so tags of different tones read apart at a glance.\n */\n success: 'bg-success-subtle text-foreground [&_svg]:text-success',\n warning: 'bg-warning-subtle text-foreground [&_svg]:text-warning',\n destructive: 'bg-destructive-subtle text-foreground [&_svg]:text-destructive',\n info: 'bg-info-subtle text-foreground [&_svg]:text-info',\n subtle: 'bg-primary-subtle text-primary',\n /**\n * A count that asks for attention, pinned to a corner of another control\n * (a workspace mark, a rail icon). At `sm` it is a 2xs label on whatever\n * surface sits behind the corner, where the destructive tint all but\n * disappears — so it takes the solid, contrast-measured action fill.\n */\n notification: 'bg-destructive-action text-destructive-action-foreground',\n },\n size: {\n sm: 'h-4 px-1.5 text-2xs',\n md: 'h-5 px-2 text-xs',\n lg: 'h-6 px-2.5 text-xs',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n)\n\ntype BadgeVariantProps = VariantProps<typeof badgeVariants>\n\nexport type BadgeProps<T extends ValidComponent = 'span'> = PolymorphicProps<\n T,\n BadgeVariantProps & { class?: string }\n>\n\nexport function Badge<T extends ValidComponent = 'span'>(props: BadgeProps<T>) {\n const [local, rest] = splitProps(props as BadgeProps, ['variant', 'size', 'class'])\n\n return (\n <Polymorphic\n as=\"span\"\n data-slot=\"badge\"\n class={cn(badgeVariants({ variant: local.variant, size: local.size }), local.class)}\n {...(rest as ComponentProps<'span'>)}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAaQ,gBAAgBH,IAC3B,iNACA;CACEI,UAAU;EACRC,SAAS;GACPC,SAAS;GACTC,WAAW;GACXC,SAAS;;;;;;GAMTC,SAAS;GACTC,SAAS;GACTC,aAAa;GACbC,MAAM;GACNC,QAAQ;;;;;;;GAORC,cAAc;EAChB;EACAC,MAAM;GACJC,IAAI;GACJC,IAAI;GACJC,IAAI;EACN;CACF;CACAC,iBAAiB;EACfd,SAAS;EACTU,MAAM;CACR;AACF,CACF;AASA,SAAgBS,MAAyCC,OAAsB;CAC7E,MAAM,CAACC,OAAOC,QAAQ7B,WAAW2B,OAAqB;EAAC;EAAW;EAAQ;CAAO,CAAC;CAElF,OAAAG,gBACGjC,aAAWkC,WAAA;EACVC,IAAE;EAAA,aAAA;EAAA,KAAA,WAAA;GAAA,OAEK5B,GAAGC,cAAc;IAAEE,SAASqB,MAAMrB;IAASU,MAAMW,MAAMX;GAAK,CAAC,GAAGW,MAAMH,KAAK;EAAC;CAAA,GAC9EI,IAA8B,CAAA;AAGzC"}
@@ -19,6 +19,12 @@ export type BreadcrumbLinkProps = ComponentProps<'a'> & {
19
19
  current?: boolean;
20
20
  };
21
21
  export declare function BreadcrumbLink(props: BreadcrumbLinkProps): import("solid-js").JSX.Element;
22
+ /**
23
+ * The current page: the last crumb, as text rather than a link to itself, and
24
+ * marked `aria-current="page"`. The same element `BreadcrumbLink current`
25
+ * renders, for a trail whose last crumb is never a link.
26
+ */
27
+ export declare function BreadcrumbPage(props: ComponentProps<'span'>): import("solid-js").JSX.Element;
22
28
  export declare function BreadcrumbSeparator(props: ComponentProps<'li'>): import("solid-js").JSX.Element;
23
29
  export declare function BreadcrumbEllipsis(props: ComponentProps<'span'>): import("solid-js").JSX.Element;
24
30
  //# sourceMappingURL=breadcrumb.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/breadcrumb/breadcrumb.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAA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