tempest-react-sdk 0.61.0 β†’ 0.63.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 (793) hide show
  1. package/README.md +19 -14
  2. package/dist/br/BrazilMap.module.cjs +1 -0
  3. package/dist/br/BrazilMap.module.cjs.map +1 -1
  4. package/dist/br/BrazilMap.module.js +1 -0
  5. package/dist/br/BrazilMap.module.js.map +1 -1
  6. package/dist/br/MapLegend.module.cjs +1 -0
  7. package/dist/br/MapLegend.module.cjs.map +1 -1
  8. package/dist/br/MapLegend.module.js +1 -0
  9. package/dist/br/MapLegend.module.js.map +1 -1
  10. package/dist/br/MunicipalitySearch.module.cjs +1 -0
  11. package/dist/br/MunicipalitySearch.module.cjs.map +1 -1
  12. package/dist/br/MunicipalitySearch.module.js +1 -0
  13. package/dist/br/MunicipalitySearch.module.js.map +1 -1
  14. package/dist/br/PixQRCode.module.cjs +1 -0
  15. package/dist/br/PixQRCode.module.cjs.map +1 -1
  16. package/dist/br/PixQRCode.module.js +1 -0
  17. package/dist/br/PixQRCode.module.js.map +1 -1
  18. package/dist/components/AIChat/AIChat.module.cjs +1 -0
  19. package/dist/components/AIChat/AIChat.module.cjs.map +1 -1
  20. package/dist/components/AIChat/AIChat.module.js +1 -0
  21. package/dist/components/AIChat/AIChat.module.js.map +1 -1
  22. package/dist/components/Accordion/Accordion.module.cjs +1 -0
  23. package/dist/components/Accordion/Accordion.module.cjs.map +1 -1
  24. package/dist/components/Accordion/Accordion.module.js +1 -0
  25. package/dist/components/Accordion/Accordion.module.js.map +1 -1
  26. package/dist/components/Alert/Alert.module.cjs +1 -0
  27. package/dist/components/Alert/Alert.module.cjs.map +1 -1
  28. package/dist/components/Alert/Alert.module.js +1 -0
  29. package/dist/components/Alert/Alert.module.js.map +1 -1
  30. package/dist/components/AppBar/AppBar.module.cjs +1 -0
  31. package/dist/components/AppBar/AppBar.module.cjs.map +1 -1
  32. package/dist/components/AppBar/AppBar.module.js +1 -0
  33. package/dist/components/AppBar/AppBar.module.js.map +1 -1
  34. package/dist/components/AppShell/AppShell.module.cjs +1 -0
  35. package/dist/components/AppShell/AppShell.module.cjs.map +1 -1
  36. package/dist/components/AppShell/AppShell.module.js +1 -0
  37. package/dist/components/AppShell/AppShell.module.js.map +1 -1
  38. package/dist/components/AspectRatio/AspectRatio.module.cjs +1 -0
  39. package/dist/components/AspectRatio/AspectRatio.module.cjs.map +1 -1
  40. package/dist/components/AspectRatio/AspectRatio.module.js +1 -0
  41. package/dist/components/AspectRatio/AspectRatio.module.js.map +1 -1
  42. package/dist/components/AudioPlayer/AudioPlayer.module.cjs +1 -0
  43. package/dist/components/AudioPlayer/AudioPlayer.module.cjs.map +1 -1
  44. package/dist/components/AudioPlayer/AudioPlayer.module.js +1 -0
  45. package/dist/components/AudioPlayer/AudioPlayer.module.js.map +1 -1
  46. package/dist/components/AudioRecorder/AudioRecorder.module.cjs +1 -0
  47. package/dist/components/AudioRecorder/AudioRecorder.module.cjs.map +1 -1
  48. package/dist/components/AudioRecorder/AudioRecorder.module.js +1 -0
  49. package/dist/components/AudioRecorder/AudioRecorder.module.js.map +1 -1
  50. package/dist/components/Avatar/Avatar.module.cjs +1 -0
  51. package/dist/components/Avatar/Avatar.module.cjs.map +1 -1
  52. package/dist/components/Avatar/Avatar.module.js +1 -0
  53. package/dist/components/Avatar/Avatar.module.js.map +1 -1
  54. package/dist/components/AvatarGroup/AvatarGroup.module.cjs +1 -0
  55. package/dist/components/AvatarGroup/AvatarGroup.module.cjs.map +1 -1
  56. package/dist/components/AvatarGroup/AvatarGroup.module.js +1 -0
  57. package/dist/components/AvatarGroup/AvatarGroup.module.js.map +1 -1
  58. package/dist/components/Badge/Badge.module.cjs +1 -0
  59. package/dist/components/Badge/Badge.module.cjs.map +1 -1
  60. package/dist/components/Badge/Badge.module.js +1 -0
  61. package/dist/components/Badge/Badge.module.js.map +1 -1
  62. package/dist/components/Banner/Banner.module.cjs +1 -0
  63. package/dist/components/Banner/Banner.module.cjs.map +1 -1
  64. package/dist/components/Banner/Banner.module.js +1 -0
  65. package/dist/components/Banner/Banner.module.js.map +1 -1
  66. package/dist/components/BarList/BarList.module.cjs +1 -0
  67. package/dist/components/BarList/BarList.module.cjs.map +1 -1
  68. package/dist/components/BarList/BarList.module.js +1 -0
  69. package/dist/components/BarList/BarList.module.js.map +1 -1
  70. package/dist/components/BarcodeScanner/BarcodeScanner.module.cjs +1 -0
  71. package/dist/components/BarcodeScanner/BarcodeScanner.module.cjs.map +1 -1
  72. package/dist/components/BarcodeScanner/BarcodeScanner.module.js +1 -0
  73. package/dist/components/BarcodeScanner/BarcodeScanner.module.js.map +1 -1
  74. package/dist/components/BottomNavigation/BottomNavigation.module.cjs +1 -0
  75. package/dist/components/BottomNavigation/BottomNavigation.module.cjs.map +1 -1
  76. package/dist/components/BottomNavigation/BottomNavigation.module.js +1 -0
  77. package/dist/components/BottomNavigation/BottomNavigation.module.js.map +1 -1
  78. package/dist/components/BottomSheet/BottomSheet.module.cjs +1 -0
  79. package/dist/components/BottomSheet/BottomSheet.module.cjs.map +1 -1
  80. package/dist/components/BottomSheet/BottomSheet.module.js +1 -0
  81. package/dist/components/BottomSheet/BottomSheet.module.js.map +1 -1
  82. package/dist/components/Breadcrumbs/Breadcrumbs.module.cjs +1 -0
  83. package/dist/components/Breadcrumbs/Breadcrumbs.module.cjs.map +1 -1
  84. package/dist/components/Breadcrumbs/Breadcrumbs.module.js +1 -0
  85. package/dist/components/Breadcrumbs/Breadcrumbs.module.js.map +1 -1
  86. package/dist/components/Button/Button.module.cjs +1 -0
  87. package/dist/components/Button/Button.module.cjs.map +1 -1
  88. package/dist/components/Button/Button.module.js +1 -0
  89. package/dist/components/Button/Button.module.js.map +1 -1
  90. package/dist/components/Calendar/Calendar.module.cjs +1 -0
  91. package/dist/components/Calendar/Calendar.module.cjs.map +1 -1
  92. package/dist/components/Calendar/Calendar.module.js +1 -0
  93. package/dist/components/Calendar/Calendar.module.js.map +1 -1
  94. package/dist/components/Card/Card.module.cjs +1 -0
  95. package/dist/components/Card/Card.module.cjs.map +1 -1
  96. package/dist/components/Card/Card.module.js +1 -0
  97. package/dist/components/Card/Card.module.js.map +1 -1
  98. package/dist/components/Carousel/Carousel.module.cjs +1 -0
  99. package/dist/components/Carousel/Carousel.module.cjs.map +1 -1
  100. package/dist/components/Carousel/Carousel.module.js +1 -0
  101. package/dist/components/Carousel/Carousel.module.js.map +1 -1
  102. package/dist/components/Center/Center.module.cjs +1 -0
  103. package/dist/components/Center/Center.module.cjs.map +1 -1
  104. package/dist/components/Center/Center.module.js +1 -0
  105. package/dist/components/Center/Center.module.js.map +1 -1
  106. package/dist/components/Chat/Chat.module.cjs +1 -0
  107. package/dist/components/Chat/Chat.module.cjs.map +1 -1
  108. package/dist/components/Chat/Chat.module.js +1 -0
  109. package/dist/components/Chat/Chat.module.js.map +1 -1
  110. package/dist/components/Checkbox/Checkbox.module.cjs +1 -0
  111. package/dist/components/Checkbox/Checkbox.module.cjs.map +1 -1
  112. package/dist/components/Checkbox/Checkbox.module.js +1 -0
  113. package/dist/components/Checkbox/Checkbox.module.js.map +1 -1
  114. package/dist/components/ChipInput/ChipInput.module.cjs +1 -0
  115. package/dist/components/ChipInput/ChipInput.module.cjs.map +1 -1
  116. package/dist/components/ChipInput/ChipInput.module.js +1 -0
  117. package/dist/components/ChipInput/ChipInput.module.js.map +1 -1
  118. package/dist/components/CodeBlock/CodeBlock.module.cjs +1 -0
  119. package/dist/components/CodeBlock/CodeBlock.module.cjs.map +1 -1
  120. package/dist/components/CodeBlock/CodeBlock.module.js +1 -0
  121. package/dist/components/CodeBlock/CodeBlock.module.js.map +1 -1
  122. package/dist/components/Collapsible/Collapsible.module.cjs +1 -0
  123. package/dist/components/Collapsible/Collapsible.module.cjs.map +1 -1
  124. package/dist/components/Collapsible/Collapsible.module.js +1 -0
  125. package/dist/components/Collapsible/Collapsible.module.js.map +1 -1
  126. package/dist/components/Combobox/Combobox.module.cjs +1 -0
  127. package/dist/components/Combobox/Combobox.module.cjs.map +1 -1
  128. package/dist/components/Combobox/Combobox.module.js +1 -0
  129. package/dist/components/Combobox/Combobox.module.js.map +1 -1
  130. package/dist/components/Command/Command.module.cjs +1 -0
  131. package/dist/components/Command/Command.module.cjs.map +1 -1
  132. package/dist/components/Command/Command.module.js +1 -0
  133. package/dist/components/Command/Command.module.js.map +1 -1
  134. package/dist/components/ContextMenu/ContextMenu.module.cjs +1 -0
  135. package/dist/components/ContextMenu/ContextMenu.module.cjs.map +1 -1
  136. package/dist/components/ContextMenu/ContextMenu.module.js +1 -0
  137. package/dist/components/ContextMenu/ContextMenu.module.js.map +1 -1
  138. package/dist/components/CopyButton/CopyButton.module.cjs +1 -0
  139. package/dist/components/CopyButton/CopyButton.module.cjs.map +1 -1
  140. package/dist/components/CopyButton/CopyButton.module.js +1 -0
  141. package/dist/components/CopyButton/CopyButton.module.js.map +1 -1
  142. package/dist/components/DataList/DataList.module.cjs +1 -0
  143. package/dist/components/DataList/DataList.module.cjs.map +1 -1
  144. package/dist/components/DataList/DataList.module.js +1 -0
  145. package/dist/components/DataList/DataList.module.js.map +1 -1
  146. package/dist/components/DataTable/DataTable.module.cjs +1 -0
  147. package/dist/components/DataTable/DataTable.module.cjs.map +1 -1
  148. package/dist/components/DataTable/DataTable.module.js +1 -0
  149. package/dist/components/DataTable/DataTable.module.js.map +1 -1
  150. package/dist/components/DateRangePicker/DateRangePicker.module.cjs +1 -0
  151. package/dist/components/DateRangePicker/DateRangePicker.module.cjs.map +1 -1
  152. package/dist/components/DateRangePicker/DateRangePicker.module.js +1 -0
  153. package/dist/components/DateRangePicker/DateRangePicker.module.js.map +1 -1
  154. package/dist/components/DescriptionList/DescriptionList.module.cjs +1 -0
  155. package/dist/components/DescriptionList/DescriptionList.module.cjs.map +1 -1
  156. package/dist/components/DescriptionList/DescriptionList.module.js +1 -0
  157. package/dist/components/DescriptionList/DescriptionList.module.js.map +1 -1
  158. package/dist/components/Divider/Divider.module.cjs +1 -0
  159. package/dist/components/Divider/Divider.module.cjs.map +1 -1
  160. package/dist/components/Divider/Divider.module.js +1 -0
  161. package/dist/components/Divider/Divider.module.js.map +1 -1
  162. package/dist/components/Drawer/Drawer.module.cjs +1 -0
  163. package/dist/components/Drawer/Drawer.module.cjs.map +1 -1
  164. package/dist/components/Drawer/Drawer.module.js +1 -0
  165. package/dist/components/Drawer/Drawer.module.js.map +1 -1
  166. package/dist/components/DropdownMenu/DropdownMenu.module.cjs +1 -0
  167. package/dist/components/DropdownMenu/DropdownMenu.module.cjs.map +1 -1
  168. package/dist/components/DropdownMenu/DropdownMenu.module.js +1 -0
  169. package/dist/components/DropdownMenu/DropdownMenu.module.js.map +1 -1
  170. package/dist/components/Dropzone/Dropzone.module.cjs +1 -0
  171. package/dist/components/Dropzone/Dropzone.module.cjs.map +1 -1
  172. package/dist/components/Dropzone/Dropzone.module.js +1 -0
  173. package/dist/components/Dropzone/Dropzone.module.js.map +1 -1
  174. package/dist/components/EmptyState/EmptyState.module.cjs +1 -0
  175. package/dist/components/EmptyState/EmptyState.module.cjs.map +1 -1
  176. package/dist/components/EmptyState/EmptyState.module.js +1 -0
  177. package/dist/components/EmptyState/EmptyState.module.js.map +1 -1
  178. package/dist/components/ErrorState/ErrorState.module.cjs +1 -0
  179. package/dist/components/ErrorState/ErrorState.module.cjs.map +1 -1
  180. package/dist/components/ErrorState/ErrorState.module.js +1 -0
  181. package/dist/components/ErrorState/ErrorState.module.js.map +1 -1
  182. package/dist/components/ErrorText/ErrorText.module.cjs +1 -0
  183. package/dist/components/ErrorText/ErrorText.module.cjs.map +1 -1
  184. package/dist/components/ErrorText/ErrorText.module.js +1 -0
  185. package/dist/components/ErrorText/ErrorText.module.js.map +1 -1
  186. package/dist/components/FileUpload/FileUpload.module.cjs +1 -0
  187. package/dist/components/FileUpload/FileUpload.module.cjs.map +1 -1
  188. package/dist/components/FileUpload/FileUpload.module.js +1 -0
  189. package/dist/components/FileUpload/FileUpload.module.js.map +1 -1
  190. package/dist/components/FilterBar/FilterBar.module.cjs +1 -0
  191. package/dist/components/FilterBar/FilterBar.module.cjs.map +1 -1
  192. package/dist/components/FilterBar/FilterBar.module.js +1 -0
  193. package/dist/components/FilterBar/FilterBar.module.js.map +1 -1
  194. package/dist/components/FloatingActionButton/FloatingActionButton.module.cjs +1 -0
  195. package/dist/components/FloatingActionButton/FloatingActionButton.module.cjs.map +1 -1
  196. package/dist/components/FloatingActionButton/FloatingActionButton.module.js +1 -0
  197. package/dist/components/FloatingActionButton/FloatingActionButton.module.js.map +1 -1
  198. package/dist/components/Form/Form.module.cjs +1 -0
  199. package/dist/components/Form/Form.module.cjs.map +1 -1
  200. package/dist/components/Form/Form.module.js +1 -0
  201. package/dist/components/Form/Form.module.js.map +1 -1
  202. package/dist/components/HoverCard/HoverCard.module.cjs +1 -0
  203. package/dist/components/HoverCard/HoverCard.module.cjs.map +1 -1
  204. package/dist/components/HoverCard/HoverCard.module.js +1 -0
  205. package/dist/components/HoverCard/HoverCard.module.js.map +1 -1
  206. package/dist/components/Image/Image.module.cjs +1 -0
  207. package/dist/components/Image/Image.module.cjs.map +1 -1
  208. package/dist/components/Image/Image.module.js +1 -0
  209. package/dist/components/Image/Image.module.js.map +1 -1
  210. package/dist/components/ImageCropper/ImageCropper.module.cjs +1 -0
  211. package/dist/components/ImageCropper/ImageCropper.module.cjs.map +1 -1
  212. package/dist/components/ImageCropper/ImageCropper.module.js +1 -0
  213. package/dist/components/ImageCropper/ImageCropper.module.js.map +1 -1
  214. package/dist/components/Input/Input.module.cjs +1 -0
  215. package/dist/components/Input/Input.module.cjs.map +1 -1
  216. package/dist/components/Input/Input.module.js +1 -0
  217. package/dist/components/Input/Input.module.js.map +1 -1
  218. package/dist/components/InstallBanner/InstallBanner.module.cjs +1 -0
  219. package/dist/components/InstallBanner/InstallBanner.module.cjs.map +1 -1
  220. package/dist/components/InstallBanner/InstallBanner.module.js +1 -0
  221. package/dist/components/InstallBanner/InstallBanner.module.js.map +1 -1
  222. package/dist/components/Kanban/Kanban.module.cjs +1 -0
  223. package/dist/components/Kanban/Kanban.module.cjs.map +1 -1
  224. package/dist/components/Kanban/Kanban.module.js +1 -0
  225. package/dist/components/Kanban/Kanban.module.js.map +1 -1
  226. package/dist/components/Kbd/Kbd.module.cjs +1 -0
  227. package/dist/components/Kbd/Kbd.module.cjs.map +1 -1
  228. package/dist/components/Kbd/Kbd.module.js +1 -0
  229. package/dist/components/Kbd/Kbd.module.js.map +1 -1
  230. package/dist/components/Label/Label.module.cjs +1 -0
  231. package/dist/components/Label/Label.module.cjs.map +1 -1
  232. package/dist/components/Label/Label.module.js +1 -0
  233. package/dist/components/Label/Label.module.js.map +1 -1
  234. package/dist/components/Layout/Layout.module.cjs +1 -0
  235. package/dist/components/Layout/Layout.module.cjs.map +1 -1
  236. package/dist/components/Layout/Layout.module.js +1 -0
  237. package/dist/components/Layout/Layout.module.js.map +1 -1
  238. package/dist/components/Lightbox/Lightbox.module.cjs +1 -0
  239. package/dist/components/Lightbox/Lightbox.module.cjs.map +1 -1
  240. package/dist/components/Lightbox/Lightbox.module.js +1 -0
  241. package/dist/components/Lightbox/Lightbox.module.js.map +1 -1
  242. package/dist/components/ListTile/ListTile.module.cjs +1 -0
  243. package/dist/components/ListTile/ListTile.module.cjs.map +1 -1
  244. package/dist/components/ListTile/ListTile.module.js +1 -0
  245. package/dist/components/ListTile/ListTile.module.js.map +1 -1
  246. package/dist/components/Markdown/Markdown.module.cjs +1 -0
  247. package/dist/components/Markdown/Markdown.module.cjs.map +1 -1
  248. package/dist/components/Markdown/Markdown.module.js +1 -0
  249. package/dist/components/Markdown/Markdown.module.js.map +1 -1
  250. package/dist/components/Masonry/Masonry.module.cjs +1 -0
  251. package/dist/components/Masonry/Masonry.module.cjs.map +1 -1
  252. package/dist/components/Masonry/Masonry.module.js +1 -0
  253. package/dist/components/Masonry/Masonry.module.js.map +1 -1
  254. package/dist/components/Menubar/Menubar.module.cjs +1 -0
  255. package/dist/components/Menubar/Menubar.module.cjs.map +1 -1
  256. package/dist/components/Menubar/Menubar.module.js +1 -0
  257. package/dist/components/Menubar/Menubar.module.js.map +1 -1
  258. package/dist/components/Modal/Modal.module.cjs +1 -0
  259. package/dist/components/Modal/Modal.module.cjs.map +1 -1
  260. package/dist/components/Modal/Modal.module.js +1 -0
  261. package/dist/components/Modal/Modal.module.js.map +1 -1
  262. package/dist/components/ModalsManager/ModalsManager.module.cjs +1 -0
  263. package/dist/components/ModalsManager/ModalsManager.module.cjs.map +1 -1
  264. package/dist/components/ModalsManager/ModalsManager.module.js +1 -0
  265. package/dist/components/ModalsManager/ModalsManager.module.js.map +1 -1
  266. package/dist/components/MultiSelect/MultiSelect.module.cjs +1 -0
  267. package/dist/components/MultiSelect/MultiSelect.module.cjs.map +1 -1
  268. package/dist/components/MultiSelect/MultiSelect.module.js +1 -0
  269. package/dist/components/MultiSelect/MultiSelect.module.js.map +1 -1
  270. package/dist/components/NProgress/NProgress.module.cjs +1 -0
  271. package/dist/components/NProgress/NProgress.module.cjs.map +1 -1
  272. package/dist/components/NProgress/NProgress.module.js +1 -0
  273. package/dist/components/NProgress/NProgress.module.js.map +1 -1
  274. package/dist/components/Navbar/Navbar.module.cjs +1 -0
  275. package/dist/components/Navbar/Navbar.module.cjs.map +1 -1
  276. package/dist/components/Navbar/Navbar.module.js +1 -0
  277. package/dist/components/Navbar/Navbar.module.js.map +1 -1
  278. package/dist/components/NavigationMenu/NavigationMenu.module.cjs +1 -0
  279. package/dist/components/NavigationMenu/NavigationMenu.module.cjs.map +1 -1
  280. package/dist/components/NavigationMenu/NavigationMenu.module.js +1 -0
  281. package/dist/components/NavigationMenu/NavigationMenu.module.js.map +1 -1
  282. package/dist/components/NavigationRail/NavigationRail.module.cjs +1 -0
  283. package/dist/components/NavigationRail/NavigationRail.module.cjs.map +1 -1
  284. package/dist/components/NavigationRail/NavigationRail.module.js +1 -0
  285. package/dist/components/NavigationRail/NavigationRail.module.js.map +1 -1
  286. package/dist/components/NotificationCenter/NotificationCenter.module.cjs +1 -0
  287. package/dist/components/NotificationCenter/NotificationCenter.module.cjs.map +1 -1
  288. package/dist/components/NotificationCenter/NotificationCenter.module.js +1 -0
  289. package/dist/components/NotificationCenter/NotificationCenter.module.js.map +1 -1
  290. package/dist/components/OfflineIndicator/OfflineIndicator.module.cjs +1 -0
  291. package/dist/components/OfflineIndicator/OfflineIndicator.module.cjs.map +1 -1
  292. package/dist/components/OfflineIndicator/OfflineIndicator.module.js +1 -0
  293. package/dist/components/OfflineIndicator/OfflineIndicator.module.js.map +1 -1
  294. package/dist/components/Page/Page.module.cjs +1 -0
  295. package/dist/components/Page/Page.module.cjs.map +1 -1
  296. package/dist/components/Page/Page.module.js +1 -0
  297. package/dist/components/Page/Page.module.js.map +1 -1
  298. package/dist/components/Pagination/Pagination.module.cjs +1 -0
  299. package/dist/components/Pagination/Pagination.module.cjs.map +1 -1
  300. package/dist/components/Pagination/Pagination.module.js +1 -0
  301. package/dist/components/Pagination/Pagination.module.js.map +1 -1
  302. package/dist/components/PasswordInput/PasswordInput.module.cjs +1 -0
  303. package/dist/components/PasswordInput/PasswordInput.module.cjs.map +1 -1
  304. package/dist/components/PasswordInput/PasswordInput.module.js +1 -0
  305. package/dist/components/PasswordInput/PasswordInput.module.js.map +1 -1
  306. package/dist/components/PinInput/PinInput.module.cjs +1 -0
  307. package/dist/components/PinInput/PinInput.module.cjs.map +1 -1
  308. package/dist/components/PinInput/PinInput.module.js +1 -0
  309. package/dist/components/PinInput/PinInput.module.js.map +1 -1
  310. package/dist/components/Popover/Popover.module.cjs +1 -0
  311. package/dist/components/Popover/Popover.module.cjs.map +1 -1
  312. package/dist/components/Popover/Popover.module.js +1 -0
  313. package/dist/components/Popover/Popover.module.js.map +1 -1
  314. package/dist/components/Progress/Progress.module.cjs +1 -0
  315. package/dist/components/Progress/Progress.module.cjs.map +1 -1
  316. package/dist/components/Progress/Progress.module.js +1 -0
  317. package/dist/components/Progress/Progress.module.js.map +1 -1
  318. package/dist/components/QRCode/QRCode.module.cjs +1 -0
  319. package/dist/components/QRCode/QRCode.module.cjs.map +1 -1
  320. package/dist/components/QRCode/QRCode.module.js +1 -0
  321. package/dist/components/QRCode/QRCode.module.js.map +1 -1
  322. package/dist/components/Radio/Radio.module.cjs +1 -0
  323. package/dist/components/Radio/Radio.module.cjs.map +1 -1
  324. package/dist/components/Radio/Radio.module.js +1 -0
  325. package/dist/components/Radio/Radio.module.js.map +1 -1
  326. package/dist/components/RangeSlider/RangeSlider.module.cjs +1 -0
  327. package/dist/components/RangeSlider/RangeSlider.module.cjs.map +1 -1
  328. package/dist/components/RangeSlider/RangeSlider.module.js +1 -0
  329. package/dist/components/RangeSlider/RangeSlider.module.js.map +1 -1
  330. package/dist/components/RatingStars/RatingStars.module.cjs +1 -0
  331. package/dist/components/RatingStars/RatingStars.module.cjs.map +1 -1
  332. package/dist/components/RatingStars/RatingStars.module.js +1 -0
  333. package/dist/components/RatingStars/RatingStars.module.js.map +1 -1
  334. package/dist/components/RefreshIndicator/RefreshIndicator.module.cjs +1 -0
  335. package/dist/components/RefreshIndicator/RefreshIndicator.module.cjs.map +1 -1
  336. package/dist/components/RefreshIndicator/RefreshIndicator.module.js +1 -0
  337. package/dist/components/RefreshIndicator/RefreshIndicator.module.js.map +1 -1
  338. package/dist/components/Resizable/Resizable.module.cjs +1 -0
  339. package/dist/components/Resizable/Resizable.module.cjs.map +1 -1
  340. package/dist/components/Resizable/Resizable.module.js +1 -0
  341. package/dist/components/Resizable/Resizable.module.js.map +1 -1
  342. package/dist/components/SafeArea/SafeArea.module.cjs +1 -0
  343. package/dist/components/SafeArea/SafeArea.module.cjs.map +1 -1
  344. package/dist/components/SafeArea/SafeArea.module.js +1 -0
  345. package/dist/components/SafeArea/SafeArea.module.js.map +1 -1
  346. package/dist/components/Scheduler/Scheduler.module.cjs +1 -0
  347. package/dist/components/Scheduler/Scheduler.module.cjs.map +1 -1
  348. package/dist/components/Scheduler/Scheduler.module.js +1 -0
  349. package/dist/components/Scheduler/Scheduler.module.js.map +1 -1
  350. package/dist/components/ScrollArea/ScrollArea.module.cjs +1 -0
  351. package/dist/components/ScrollArea/ScrollArea.module.cjs.map +1 -1
  352. package/dist/components/ScrollArea/ScrollArea.module.js +1 -0
  353. package/dist/components/ScrollArea/ScrollArea.module.js.map +1 -1
  354. package/dist/components/SearchBar/SearchBar.module.cjs +1 -0
  355. package/dist/components/SearchBar/SearchBar.module.cjs.map +1 -1
  356. package/dist/components/SearchBar/SearchBar.module.js +1 -0
  357. package/dist/components/SearchBar/SearchBar.module.js.map +1 -1
  358. package/dist/components/SegmentedControl/SegmentedControl.module.cjs +1 -0
  359. package/dist/components/SegmentedControl/SegmentedControl.module.cjs.map +1 -1
  360. package/dist/components/SegmentedControl/SegmentedControl.module.js +1 -0
  361. package/dist/components/SegmentedControl/SegmentedControl.module.js.map +1 -1
  362. package/dist/components/Select/Select.module.cjs +1 -0
  363. package/dist/components/Select/Select.module.cjs.map +1 -1
  364. package/dist/components/Select/Select.module.js +1 -0
  365. package/dist/components/Select/Select.module.js.map +1 -1
  366. package/dist/components/Sidebar/Sidebar.module.cjs +1 -0
  367. package/dist/components/Sidebar/Sidebar.module.cjs.map +1 -1
  368. package/dist/components/Sidebar/Sidebar.module.js +1 -0
  369. package/dist/components/Sidebar/Sidebar.module.js.map +1 -1
  370. package/dist/components/SignaturePad/SignaturePad.module.cjs +1 -0
  371. package/dist/components/SignaturePad/SignaturePad.module.cjs.map +1 -1
  372. package/dist/components/SignaturePad/SignaturePad.module.js +1 -0
  373. package/dist/components/SignaturePad/SignaturePad.module.js.map +1 -1
  374. package/dist/components/Skeleton/Skeleton.module.cjs +1 -0
  375. package/dist/components/Skeleton/Skeleton.module.cjs.map +1 -1
  376. package/dist/components/Skeleton/Skeleton.module.js +1 -0
  377. package/dist/components/Skeleton/Skeleton.module.js.map +1 -1
  378. package/dist/components/Slider/Slider.module.cjs +1 -0
  379. package/dist/components/Slider/Slider.module.cjs.map +1 -1
  380. package/dist/components/Slider/Slider.module.js +1 -0
  381. package/dist/components/Slider/Slider.module.js.map +1 -1
  382. package/dist/components/Spacer/Spacer.module.cjs +1 -0
  383. package/dist/components/Spacer/Spacer.module.cjs.map +1 -1
  384. package/dist/components/Spacer/Spacer.module.js +1 -0
  385. package/dist/components/Spacer/Spacer.module.js.map +1 -1
  386. package/dist/components/Sparkline/Sparkline.module.cjs +1 -0
  387. package/dist/components/Sparkline/Sparkline.module.cjs.map +1 -1
  388. package/dist/components/Sparkline/Sparkline.module.js +1 -0
  389. package/dist/components/Sparkline/Sparkline.module.js.map +1 -1
  390. package/dist/components/Spinner/Spinner.module.cjs +1 -0
  391. package/dist/components/Spinner/Spinner.module.cjs.map +1 -1
  392. package/dist/components/Spinner/Spinner.module.js +1 -0
  393. package/dist/components/Spinner/Spinner.module.js.map +1 -1
  394. package/dist/components/Stat/Stat.module.cjs +1 -0
  395. package/dist/components/Stat/Stat.module.cjs.map +1 -1
  396. package/dist/components/Stat/Stat.module.js +1 -0
  397. package/dist/components/Stat/Stat.module.js.map +1 -1
  398. package/dist/components/Stepper/Stepper.module.cjs +1 -0
  399. package/dist/components/Stepper/Stepper.module.cjs.map +1 -1
  400. package/dist/components/Stepper/Stepper.module.js +1 -0
  401. package/dist/components/Stepper/Stepper.module.js.map +1 -1
  402. package/dist/components/StepperInput/StepperInput.module.cjs +1 -0
  403. package/dist/components/StepperInput/StepperInput.module.cjs.map +1 -1
  404. package/dist/components/StepperInput/StepperInput.module.js +1 -0
  405. package/dist/components/StepperInput/StepperInput.module.js.map +1 -1
  406. package/dist/components/Switch/Switch.module.cjs +1 -0
  407. package/dist/components/Switch/Switch.module.cjs.map +1 -1
  408. package/dist/components/Switch/Switch.module.js +1 -0
  409. package/dist/components/Switch/Switch.module.js.map +1 -1
  410. package/dist/components/SyncStatusBadge/SyncStatusBadge.module.cjs +1 -0
  411. package/dist/components/SyncStatusBadge/SyncStatusBadge.module.cjs.map +1 -1
  412. package/dist/components/SyncStatusBadge/SyncStatusBadge.module.js +1 -0
  413. package/dist/components/SyncStatusBadge/SyncStatusBadge.module.js.map +1 -1
  414. package/dist/components/Table/Table.module.cjs +1 -0
  415. package/dist/components/Table/Table.module.cjs.map +1 -1
  416. package/dist/components/Table/Table.module.js +1 -0
  417. package/dist/components/Table/Table.module.js.map +1 -1
  418. package/dist/components/Tabs/Tabs.module.cjs +1 -0
  419. package/dist/components/Tabs/Tabs.module.cjs.map +1 -1
  420. package/dist/components/Tabs/Tabs.module.js +1 -0
  421. package/dist/components/Tabs/Tabs.module.js.map +1 -1
  422. package/dist/components/Tag/Tag.module.cjs +1 -0
  423. package/dist/components/Tag/Tag.module.cjs.map +1 -1
  424. package/dist/components/Tag/Tag.module.js +1 -0
  425. package/dist/components/Tag/Tag.module.js.map +1 -1
  426. package/dist/components/Textarea/Textarea.module.cjs +1 -0
  427. package/dist/components/Textarea/Textarea.module.cjs.map +1 -1
  428. package/dist/components/Textarea/Textarea.module.js +1 -0
  429. package/dist/components/Textarea/Textarea.module.js.map +1 -1
  430. package/dist/components/TimePicker/TimePicker.module.cjs +1 -0
  431. package/dist/components/TimePicker/TimePicker.module.cjs.map +1 -1
  432. package/dist/components/TimePicker/TimePicker.module.js +1 -0
  433. package/dist/components/TimePicker/TimePicker.module.js.map +1 -1
  434. package/dist/components/Timeline/Timeline.module.cjs +1 -0
  435. package/dist/components/Timeline/Timeline.module.cjs.map +1 -1
  436. package/dist/components/Timeline/Timeline.module.js +1 -0
  437. package/dist/components/Timeline/Timeline.module.js.map +1 -1
  438. package/dist/components/Toast/Toast.module.cjs +1 -0
  439. package/dist/components/Toast/Toast.module.cjs.map +1 -1
  440. package/dist/components/Toast/Toast.module.js +1 -0
  441. package/dist/components/Toast/Toast.module.js.map +1 -1
  442. package/dist/components/Toggle/Toggle.module.cjs +1 -0
  443. package/dist/components/Toggle/Toggle.module.cjs.map +1 -1
  444. package/dist/components/Toggle/Toggle.module.js +1 -0
  445. package/dist/components/Toggle/Toggle.module.js.map +1 -1
  446. package/dist/components/ToggleGroup/ToggleGroup.module.cjs +1 -0
  447. package/dist/components/ToggleGroup/ToggleGroup.module.cjs.map +1 -1
  448. package/dist/components/ToggleGroup/ToggleGroup.module.js +1 -0
  449. package/dist/components/ToggleGroup/ToggleGroup.module.js.map +1 -1
  450. package/dist/components/Tooltip/Tooltip.module.cjs +1 -0
  451. package/dist/components/Tooltip/Tooltip.module.cjs.map +1 -1
  452. package/dist/components/Tooltip/Tooltip.module.js +1 -0
  453. package/dist/components/Tooltip/Tooltip.module.js.map +1 -1
  454. package/dist/components/Tour/Tour.module.cjs +1 -0
  455. package/dist/components/Tour/Tour.module.cjs.map +1 -1
  456. package/dist/components/Tour/Tour.module.js +1 -0
  457. package/dist/components/Tour/Tour.module.js.map +1 -1
  458. package/dist/components/Transfer/Transfer.module.cjs +1 -0
  459. package/dist/components/Transfer/Transfer.module.cjs.map +1 -1
  460. package/dist/components/Transfer/Transfer.module.js +1 -0
  461. package/dist/components/Transfer/Transfer.module.js.map +1 -1
  462. package/dist/components/TreeView/TreeView.module.cjs +1 -0
  463. package/dist/components/TreeView/TreeView.module.cjs.map +1 -1
  464. package/dist/components/TreeView/TreeView.module.js +1 -0
  465. package/dist/components/TreeView/TreeView.module.js.map +1 -1
  466. package/dist/components/TruncateText/TruncateText.module.cjs +1 -0
  467. package/dist/components/TruncateText/TruncateText.module.cjs.map +1 -1
  468. package/dist/components/TruncateText/TruncateText.module.js +1 -0
  469. package/dist/components/TruncateText/TruncateText.module.js.map +1 -1
  470. package/dist/components/UpdatePrompt/UpdatePrompt.module.cjs +1 -0
  471. package/dist/components/UpdatePrompt/UpdatePrompt.module.cjs.map +1 -1
  472. package/dist/components/UpdatePrompt/UpdatePrompt.module.js +1 -0
  473. package/dist/components/UpdatePrompt/UpdatePrompt.module.js.map +1 -1
  474. package/dist/components/VideoPlayer/VideoPlayer.module.cjs +1 -0
  475. package/dist/components/VideoPlayer/VideoPlayer.module.cjs.map +1 -1
  476. package/dist/components/VideoPlayer/VideoPlayer.module.js +1 -0
  477. package/dist/components/VideoPlayer/VideoPlayer.module.js.map +1 -1
  478. package/dist/components/VirtualList/VirtualList.module.cjs +1 -0
  479. package/dist/components/VirtualList/VirtualList.module.cjs.map +1 -1
  480. package/dist/components/VirtualList/VirtualList.module.js +1 -0
  481. package/dist/components/VirtualList/VirtualList.module.js.map +1 -1
  482. package/dist/components/VirtualTable/VirtualTable.module.cjs +1 -0
  483. package/dist/components/VirtualTable/VirtualTable.module.cjs.map +1 -1
  484. package/dist/components/VirtualTable/VirtualTable.module.js +1 -0
  485. package/dist/components/VirtualTable/VirtualTable.module.js.map +1 -1
  486. package/dist/components/VisuallyHidden/VisuallyHidden.module.cjs +1 -0
  487. package/dist/components/VisuallyHidden/VisuallyHidden.module.cjs.map +1 -1
  488. package/dist/components/VisuallyHidden/VisuallyHidden.module.js +1 -0
  489. package/dist/components/VisuallyHidden/VisuallyHidden.module.js.map +1 -1
  490. package/dist/components/Wizard/Wizard.module.cjs +1 -0
  491. package/dist/components/Wizard/Wizard.module.cjs.map +1 -1
  492. package/dist/components/Wizard/Wizard.module.js +1 -0
  493. package/dist/components/Wizard/Wizard.module.js.map +1 -1
  494. package/dist/editor/RichTextEditor.module.cjs +1 -0
  495. package/dist/editor/RichTextEditor.module.cjs.map +1 -1
  496. package/dist/editor/RichTextEditor.module.js +1 -0
  497. package/dist/editor/RichTextEditor.module.js.map +1 -1
  498. package/dist/geo/TrajectoryMap.module.cjs +1 -0
  499. package/dist/geo/TrajectoryMap.module.cjs.map +1 -1
  500. package/dist/geo/TrajectoryMap.module.js +1 -0
  501. package/dist/geo/TrajectoryMap.module.js.map +1 -1
  502. package/dist/icons/IconPicker.module.cjs +1 -0
  503. package/dist/icons/IconPicker.module.cjs.map +1 -1
  504. package/dist/icons/IconPicker.module.js +1 -0
  505. package/dist/icons/IconPicker.module.js.map +1 -1
  506. package/dist/sse/create-event-stream.cjs +1 -1
  507. package/dist/sse/create-event-stream.cjs.map +1 -1
  508. package/dist/sse/create-event-stream.js +32 -27
  509. package/dist/sse/create-event-stream.js.map +1 -1
  510. package/dist/sse/use-event-stream.cjs.map +1 -1
  511. package/dist/sse/use-event-stream.js.map +1 -1
  512. package/dist/styles/AIChat.css +1 -78
  513. package/dist/styles/Accordion.css +1 -11
  514. package/dist/styles/Alert.css +1 -31
  515. package/dist/styles/AppBar.css +1 -16
  516. package/dist/styles/AppShell.css +1 -7
  517. package/dist/styles/AspectRatio.css +1 -2
  518. package/dist/styles/AudioPlayer.css +1 -12
  519. package/dist/styles/AudioRecorder.css +1 -19
  520. package/dist/styles/Avatar.css +1 -12
  521. package/dist/styles/AvatarGroup.css +1 -17
  522. package/dist/styles/Badge.css +1 -24
  523. package/dist/styles/Banner.css +1 -12
  524. package/dist/styles/BarList.css +1 -9
  525. package/dist/styles/BarcodeScanner.css +1 -20
  526. package/dist/styles/BottomNavigation.css +1 -9
  527. package/dist/styles/BottomSheet.css +1 -10
  528. package/dist/styles/BrazilMap.css +1 -19
  529. package/dist/styles/Breadcrumbs.css +1 -7
  530. package/dist/styles/Button.css +1 -41
  531. package/dist/styles/Calendar.css +1 -15
  532. package/dist/styles/Card.css +1 -14
  533. package/dist/styles/Carousel.css +1 -16
  534. package/dist/styles/Center.css +1 -4
  535. package/dist/styles/Chat.css +1 -34
  536. package/dist/styles/Checkbox.css +1 -10
  537. package/dist/styles/ChipInput.css +1 -12
  538. package/dist/styles/CodeBlock.css +1 -24
  539. package/dist/styles/Collapsible.css +1 -5
  540. package/dist/styles/Combobox.css +1 -17
  541. package/dist/styles/Command.css +1 -19
  542. package/dist/styles/ContextMenu.css +1 -10
  543. package/dist/styles/CopyButton.css +1 -3
  544. package/dist/styles/DataList.css +1 -2
  545. package/dist/styles/DataTable.css +1 -18
  546. package/dist/styles/DateRangePicker.css +1 -21
  547. package/dist/styles/DescriptionList.css +1 -3
  548. package/dist/styles/Divider.css +1 -10
  549. package/dist/styles/Drawer.css +1 -21
  550. package/dist/styles/DropdownMenu.css +1 -15
  551. package/dist/styles/Dropzone.css +1 -6
  552. package/dist/styles/EmptyState.css +1 -5
  553. package/dist/styles/ErrorState.css +1 -5
  554. package/dist/styles/ErrorText.css +1 -1
  555. package/dist/styles/FileUpload.css +1 -16
  556. package/dist/styles/FilterBar.css +1 -18
  557. package/dist/styles/FloatingActionButton.css +1 -22
  558. package/dist/styles/Form.css +1 -20
  559. package/dist/styles/HoverCard.css +1 -10
  560. package/dist/styles/IconPicker.css +1 -5
  561. package/dist/styles/Image.css +1 -1
  562. package/dist/styles/ImageCropper.css +1 -15
  563. package/dist/styles/Input.css +1 -23
  564. package/dist/styles/InstallBanner.css +1 -7
  565. package/dist/styles/Kanban.css +1 -14
  566. package/dist/styles/Kbd.css +1 -4
  567. package/dist/styles/Label.css +1 -2
  568. package/dist/styles/Layout.css +1 -21
  569. package/dist/styles/Lightbox.css +1 -20
  570. package/dist/styles/ListTile.css +1 -13
  571. package/dist/styles/MapLegend.css +1 -8
  572. package/dist/styles/Markdown.css +1 -23
  573. package/dist/styles/Masonry.css +1 -3
  574. package/dist/styles/Menubar.css +1 -16
  575. package/dist/styles/Modal.css +1 -20
  576. package/dist/styles/ModalsManager.css +1 -1
  577. package/dist/styles/MultiSelect.css +1 -20
  578. package/dist/styles/MunicipalitySearch.css +1 -5
  579. package/dist/styles/NProgress.css +1 -1
  580. package/dist/styles/Navbar.css +1 -9
  581. package/dist/styles/NavigationMenu.css +1 -11
  582. package/dist/styles/NavigationRail.css +1 -13
  583. package/dist/styles/NotificationCenter.css +1 -20
  584. package/dist/styles/OfflineIndicator.css +1 -6
  585. package/dist/styles/Page.css +1 -12
  586. package/dist/styles/Pagination.css +1 -11
  587. package/dist/styles/PasswordInput.css +1 -20
  588. package/dist/styles/PinInput.css +1 -12
  589. package/dist/styles/PixQRCode.css +1 -8
  590. package/dist/styles/Popover.css +1 -9
  591. package/dist/styles/Progress.css +1 -10
  592. package/dist/styles/QRCode.css +1 -2
  593. package/dist/styles/Radio.css +1 -13
  594. package/dist/styles/RangeSlider.css +1 -14
  595. package/dist/styles/RatingStars.css +1 -10
  596. package/dist/styles/RefreshIndicator.css +1 -4
  597. package/dist/styles/Resizable.css +1 -12
  598. package/dist/styles/RichTextEditor.css +1 -18
  599. package/dist/styles/SafeArea.css +1 -6
  600. package/dist/styles/Scheduler.css +1 -23
  601. package/dist/styles/ScrollArea.css +1 -6
  602. package/dist/styles/SearchBar.css +1 -10
  603. package/dist/styles/SegmentedControl.css +1 -11
  604. package/dist/styles/Select.css +1 -13
  605. package/dist/styles/Sidebar.css +1 -18
  606. package/dist/styles/SignaturePad.css +1 -5
  607. package/dist/styles/Skeleton.css +1 -6
  608. package/dist/styles/Slider.css +1 -14
  609. package/dist/styles/Spacer.css +1 -3
  610. package/dist/styles/Sparkline.css +1 -3
  611. package/dist/styles/Spinner.css +1 -11
  612. package/dist/styles/Stat.css +1 -11
  613. package/dist/styles/Stepper.css +1 -16
  614. package/dist/styles/StepperInput.css +1 -14
  615. package/dist/styles/Switch.css +1 -10
  616. package/dist/styles/SyncStatusBadge.css +1 -12
  617. package/dist/styles/Table.css +1 -15
  618. package/dist/styles/Tabs.css +1 -13
  619. package/dist/styles/Tag.css +1 -13
  620. package/dist/styles/Textarea.css +1 -12
  621. package/dist/styles/TimePicker.css +1 -13
  622. package/dist/styles/Timeline.css +1 -16
  623. package/dist/styles/Toast.css +1 -20
  624. package/dist/styles/Toggle.css +1 -11
  625. package/dist/styles/ToggleGroup.css +1 -8
  626. package/dist/styles/Tooltip.css +1 -9
  627. package/dist/styles/Tour.css +1 -19
  628. package/dist/styles/TrajectoryMap.css +1 -15
  629. package/dist/styles/Transfer.css +1 -20
  630. package/dist/styles/TreeView.css +1 -16
  631. package/dist/styles/TruncateText.css +1 -1
  632. package/dist/styles/UpdatePrompt.css +1 -9
  633. package/dist/styles/VideoPlayer.css +1 -22
  634. package/dist/styles/VirtualList.css +1 -4
  635. package/dist/styles/VirtualTable.css +1 -16
  636. package/dist/styles/VisuallyHidden.css +1 -1
  637. package/dist/styles/Wizard.css +1 -3
  638. package/dist/styles/component/AIChat.css +79 -0
  639. package/dist/styles/component/Accordion.css +12 -0
  640. package/dist/styles/component/Alert.css +32 -0
  641. package/dist/styles/component/AppBar.css +17 -0
  642. package/dist/styles/component/AppShell.css +8 -0
  643. package/dist/styles/component/AspectRatio.css +3 -0
  644. package/dist/styles/component/AudioPlayer.css +13 -0
  645. package/dist/styles/component/AudioRecorder.css +20 -0
  646. package/dist/styles/component/Avatar.css +13 -0
  647. package/dist/styles/component/AvatarGroup.css +18 -0
  648. package/dist/styles/component/Badge.css +25 -0
  649. package/dist/styles/component/Banner.css +13 -0
  650. package/dist/styles/component/BarList.css +10 -0
  651. package/dist/styles/component/BarcodeScanner.css +21 -0
  652. package/dist/styles/component/BottomNavigation.css +10 -0
  653. package/dist/styles/component/BottomSheet.css +11 -0
  654. package/dist/styles/component/BrazilMap.css +20 -0
  655. package/dist/styles/component/Breadcrumbs.css +8 -0
  656. package/dist/styles/component/Button.css +42 -0
  657. package/dist/styles/component/Calendar.css +16 -0
  658. package/dist/styles/component/Card.css +15 -0
  659. package/dist/styles/component/Carousel.css +17 -0
  660. package/dist/styles/component/Center.css +5 -0
  661. package/dist/styles/component/Chat.css +35 -0
  662. package/dist/styles/component/Checkbox.css +11 -0
  663. package/dist/styles/component/ChipInput.css +13 -0
  664. package/dist/styles/component/CodeBlock.css +25 -0
  665. package/dist/styles/component/Collapsible.css +6 -0
  666. package/dist/styles/component/Combobox.css +18 -0
  667. package/dist/styles/component/Command.css +20 -0
  668. package/dist/styles/component/ContextMenu.css +11 -0
  669. package/dist/styles/component/CopyButton.css +4 -0
  670. package/dist/styles/component/DataList.css +3 -0
  671. package/dist/styles/component/DataTable.css +19 -0
  672. package/dist/styles/component/DateRangePicker.css +22 -0
  673. package/dist/styles/component/DescriptionList.css +4 -0
  674. package/dist/styles/component/Divider.css +11 -0
  675. package/dist/styles/component/Drawer.css +22 -0
  676. package/dist/styles/component/DropdownMenu.css +16 -0
  677. package/dist/styles/component/Dropzone.css +7 -0
  678. package/dist/styles/component/EmptyState.css +6 -0
  679. package/dist/styles/component/ErrorState.css +6 -0
  680. package/dist/styles/component/ErrorText.css +2 -0
  681. package/dist/styles/component/FileUpload.css +17 -0
  682. package/dist/styles/component/FilterBar.css +19 -0
  683. package/dist/styles/component/FloatingActionButton.css +23 -0
  684. package/dist/styles/component/Form.css +21 -0
  685. package/dist/styles/component/HoverCard.css +11 -0
  686. package/dist/styles/component/IconPicker.css +6 -0
  687. package/dist/styles/component/Image.css +2 -0
  688. package/dist/styles/component/ImageCropper.css +16 -0
  689. package/dist/styles/component/Input.css +24 -0
  690. package/dist/styles/component/InstallBanner.css +8 -0
  691. package/dist/styles/component/Kanban.css +15 -0
  692. package/dist/styles/component/Kbd.css +5 -0
  693. package/dist/styles/component/Label.css +3 -0
  694. package/dist/styles/component/Layout.css +22 -0
  695. package/dist/styles/component/Lightbox.css +21 -0
  696. package/dist/styles/component/ListTile.css +14 -0
  697. package/dist/styles/component/MapLegend.css +9 -0
  698. package/dist/styles/component/Markdown.css +24 -0
  699. package/dist/styles/component/Masonry.css +4 -0
  700. package/dist/styles/component/Menubar.css +17 -0
  701. package/dist/styles/component/Modal.css +21 -0
  702. package/dist/styles/component/ModalsManager.css +2 -0
  703. package/dist/styles/component/MultiSelect.css +21 -0
  704. package/dist/styles/component/MunicipalitySearch.css +6 -0
  705. package/dist/styles/component/NProgress.css +2 -0
  706. package/dist/styles/component/Navbar.css +10 -0
  707. package/dist/styles/component/NavigationMenu.css +12 -0
  708. package/dist/styles/component/NavigationRail.css +14 -0
  709. package/dist/styles/component/NotificationCenter.css +21 -0
  710. package/dist/styles/component/OfflineIndicator.css +7 -0
  711. package/dist/styles/component/Page.css +13 -0
  712. package/dist/styles/component/Pagination.css +12 -0
  713. package/dist/styles/component/PasswordInput.css +21 -0
  714. package/dist/styles/component/PinInput.css +13 -0
  715. package/dist/styles/component/PixQRCode.css +9 -0
  716. package/dist/styles/component/Popover.css +10 -0
  717. package/dist/styles/component/Progress.css +11 -0
  718. package/dist/styles/component/QRCode.css +3 -0
  719. package/dist/styles/component/Radio.css +14 -0
  720. package/dist/styles/component/RangeSlider.css +15 -0
  721. package/dist/styles/component/RatingStars.css +11 -0
  722. package/dist/styles/component/RefreshIndicator.css +5 -0
  723. package/dist/styles/component/Resizable.css +13 -0
  724. package/dist/styles/component/RichTextEditor.css +19 -0
  725. package/dist/styles/component/SafeArea.css +7 -0
  726. package/dist/styles/component/Scheduler.css +24 -0
  727. package/dist/styles/component/ScrollArea.css +7 -0
  728. package/dist/styles/component/SearchBar.css +11 -0
  729. package/dist/styles/component/SegmentedControl.css +12 -0
  730. package/dist/styles/component/Select.css +14 -0
  731. package/dist/styles/component/Sidebar.css +19 -0
  732. package/dist/styles/component/SignaturePad.css +6 -0
  733. package/dist/styles/component/Skeleton.css +7 -0
  734. package/dist/styles/component/Slider.css +15 -0
  735. package/dist/styles/component/Spacer.css +4 -0
  736. package/dist/styles/component/Sparkline.css +4 -0
  737. package/dist/styles/component/Spinner.css +12 -0
  738. package/dist/styles/component/Stat.css +12 -0
  739. package/dist/styles/component/Stepper.css +17 -0
  740. package/dist/styles/component/StepperInput.css +15 -0
  741. package/dist/styles/component/Switch.css +11 -0
  742. package/dist/styles/component/SyncStatusBadge.css +13 -0
  743. package/dist/styles/component/Table.css +16 -0
  744. package/dist/styles/component/Tabs.css +14 -0
  745. package/dist/styles/component/Tag.css +14 -0
  746. package/dist/styles/component/Textarea.css +13 -0
  747. package/dist/styles/component/TimePicker.css +14 -0
  748. package/dist/styles/component/Timeline.css +17 -0
  749. package/dist/styles/component/Toast.css +21 -0
  750. package/dist/styles/component/Toggle.css +12 -0
  751. package/dist/styles/component/ToggleGroup.css +9 -0
  752. package/dist/styles/component/Tooltip.css +10 -0
  753. package/dist/styles/component/Tour.css +20 -0
  754. package/dist/styles/component/TrajectoryMap.css +16 -0
  755. package/dist/styles/component/Transfer.css +21 -0
  756. package/dist/styles/component/TreeView.css +17 -0
  757. package/dist/styles/component/TruncateText.css +2 -0
  758. package/dist/styles/component/UpdatePrompt.css +10 -0
  759. package/dist/styles/component/VideoPlayer.css +23 -0
  760. package/dist/styles/component/VirtualList.css +5 -0
  761. package/dist/styles/component/VirtualTable.css +17 -0
  762. package/dist/styles/component/VisuallyHidden.css +2 -0
  763. package/dist/styles/component/Wizard.css +4 -0
  764. package/dist/styles/manifest.json +190 -190
  765. package/dist/tempest-react-sdk.d.ts +180 -21
  766. package/dist/utils/dev-mode.cjs.map +1 -1
  767. package/dist/utils/dev-mode.js.map +1 -1
  768. package/dist/utils/json-frame.cjs +1 -1
  769. package/dist/utils/json-frame.cjs.map +1 -1
  770. package/dist/utils/json-frame.js +33 -14
  771. package/dist/utils/json-frame.js.map +1 -1
  772. package/dist/utils/schema-like.cjs +2 -0
  773. package/dist/utils/schema-like.cjs.map +1 -0
  774. package/dist/utils/schema-like.js +43 -0
  775. package/dist/utils/schema-like.js.map +1 -0
  776. package/dist/vite/narrow-tokens.cjs +3 -0
  777. package/dist/vite/narrow-tokens.cjs.map +1 -0
  778. package/dist/vite/narrow-tokens.js +50 -0
  779. package/dist/vite/narrow-tokens.js.map +1 -0
  780. package/dist/vite/tempest-styles.cjs +6 -4
  781. package/dist/vite/tempest-styles.cjs.map +1 -1
  782. package/dist/vite/tempest-styles.js +73 -47
  783. package/dist/vite/tempest-styles.js.map +1 -1
  784. package/dist/vite.d.ts +19 -0
  785. package/dist/ws/create-web-socket.cjs +1 -1
  786. package/dist/ws/create-web-socket.cjs.map +1 -1
  787. package/dist/ws/create-web-socket.js +54 -38
  788. package/dist/ws/create-web-socket.js.map +1 -1
  789. package/dist/ws/use-web-socket.cjs +1 -1
  790. package/dist/ws/use-web-socket.cjs.map +1 -1
  791. package/dist/ws/use-web-socket.js +5 -3
  792. package/dist/ws/use-web-socket.js.map +1 -1
  793. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"narrow-tokens.cjs","names":[],"sources":["../../src/vite/narrow-tokens.ts"],"sourcesContent":["/**\n * Cut the token sheet down to the tokens a set of stylesheets can reach.\n *\n * Once every component loads its own stylesheet, `tokens.css` stops being a rounding\n * error and becomes the biggest single thing an app downloads: measured on a probe\n * app mounting `Button`, `Card` and `Badge`, the sheet is 2516 B brotli of a 4927 B\n * total. The components read 105 of its 223 tokens, so the other 118 are bytes\n * nothing on the page can consult.\n *\n * The cut is a reachability closure, not a filter: a token's value routinely names\n * another token (`--tempest-primary: var(--tempest-primary-500)`), so keeping only\n * the names a stylesheet mentions literally would keep aliases whose targets were\n * dropped β€” `var()` would resolve to nothing and the component would render with the\n * property unset, which is worse than shipping the whole sheet.\n */\n\n/** A token block: one selector and the custom properties it declares, in order. */\ninterface TokenBlock {\n /** The block's selector text, e.g. `:root` or `[data-tempest-theme=dark]`. */\n selector: string;\n /** Declaration name β†’ value, in source order. */\n declarations: Map<string, string>;\n}\n\n/**\n * Any custom property being read, not only the `--tempest-*` ones.\n *\n * Deliberately wider than the tokens this cut is about. `tokens.css` also carries\n * the `--lightningcss-light`/`--lightningcss-dark` pair the compiler emits, which\n * nothing reads today β€” measured: two declarations, zero reads β€” and which a\n * `--tempest-`-only scan would therefore always drop. That is the right answer right\n * up until one rule uses `light-dark()`, at which point the compiler emits the read\n * and a narrow scan would drop the pair it depends on. Matching every custom\n * property costs nothing (a name the sheet does not declare is discarded) and makes\n * the closure correct for names this file does not know about.\n */\nconst TOKEN_REFERENCE = /var\\(\\s*(--[A-Za-z0-9-]+)/g;\n\n/**\n * A token name being assembled at runtime rather than written out.\n *\n * `style={{ color: `var(--tempest-${tone})` }}` names a token no static scan can\n * know, so a cut made without it would drop the one the app is about to read. The\n * caller falls back to the whole sheet when this matches β€” the same shape as the\n * plugin's own namespace-import fallback, and for the same reason: serve more than\n * asked for rather than less than needed.\n */\nconst DYNAMIC_TOKEN = /--tempest-[A-Za-z0-9-]*(?:\\$\\{|[\"'`]\\s*\\+|\\s*\\+\\s*[\"'`])/;\n\n/**\n * Parse a token stylesheet into its blocks.\n *\n * Written against the compiler's own output, which is already valid and flat β€” every\n * block in `tokens.css` is either a bare selector or one nested inside a single\n * at-rule β€” so a brace-depth reader is enough and a full parser would not be more\n * correct here.\n *\n * @param css - Contents of `tokens.css`.\n * @returns One entry per block that declares anything.\n */\nexport function parseTokenBlocks(css: string): TokenBlock[] {\n const blocks: TokenBlock[] = [];\n for (const match of css.matchAll(/([^{}]+)\\{([^{}]*)\\}/g)) {\n const declarations = new Map<string, string>();\n for (const declaration of (match[2] ?? \"\").split(\";\")) {\n const colon = declaration.indexOf(\":\");\n if (colon < 0) continue;\n const name = declaration.slice(0, colon).trim();\n if (name) declarations.set(name, declaration.slice(colon + 1).trim());\n }\n if (declarations.size === 0) continue;\n blocks.push({ selector: (match[1] ?? \"\").trim(), declarations });\n }\n return blocks;\n}\n\n/**\n * Every token a body of CSS reaches, following token-to-token references.\n *\n * @param blocks - The parsed token sheet.\n * @param usage - CSS and source text to scan for `var(--tempest-*)`.\n * @returns The reachable token names.\n */\nexport function reachableTokens(blocks: readonly TokenBlock[], usage: string): Set<string> {\n const declared = new Set<string>();\n for (const block of blocks) for (const name of block.declarations.keys()) declared.add(name);\n\n const reached = new Set<string>();\n const queue = [...usage.matchAll(TOKEN_REFERENCE)].map((match) => match[1] ?? \"\");\n while (queue.length > 0) {\n const token = queue.pop() ?? \"\";\n if (reached.has(token) || !declared.has(token)) continue;\n reached.add(token);\n for (const block of blocks) {\n const value = block.declarations.get(token);\n if (value === undefined) continue;\n for (const match of value.matchAll(TOKEN_REFERENCE)) queue.push(match[1] ?? \"\");\n }\n }\n return reached;\n}\n\n/**\n * Rebuild the token sheet with only the tokens a set of stylesheets reaches.\n *\n * Companion declarations that are not custom properties travel with the block that\n * survives β€” `color-scheme` is the one, and dropping it would leave the browser\n * painting its own surfaces (scrollbar, `<select>` popup, autofill) in the wrong\n * theme while every `.tempest_*` rule was correct.\n *\n * @param tokensCss - Contents of `tokens.css`.\n * @param usage - The CSS the app will load, plus its own source, scanned for reads.\n * @returns The narrowed sheet, or `null` when a token name is built at runtime and\n * no static answer is safe.\n */\nexport function narrowTokens(tokensCss: string, usage: string): string | null {\n if (DYNAMIC_TOKEN.test(usage)) return null;\n\n const blocks = parseTokenBlocks(tokensCss);\n const reached = reachableTokens(blocks, usage);\n if (reached.size === 0) return null;\n\n const out: string[] = [];\n for (const block of blocks) {\n const kept = [...block.declarations].filter(\n ([name]) => name.startsWith(\"--\") === false || reached.has(name),\n );\n if (kept.every(([name]) => name.startsWith(\"--\") === false)) continue;\n out.push(`${block.selector}{${kept.map(([name, value]) => `${name}:${value}`).join(\";\")}}`);\n }\n return out.join(\"\\n\");\n}\n"],"mappings":"AAoCA,IAAM,EAAkB,6BAWlB,EAAgB,2DAatB,SAAgB,EAAiB,EAA2B,CACxD,IAAM,EAAuB,CAAC,EAC9B,IAAK,IAAM,KAAS,EAAI,SAAS,uBAAuB,EAAG,CACvD,IAAM,EAAe,IAAI,IACzB,IAAK,IAAM,KAAgB,EAAM,IAAM,GAAA,CAAI,MAAM,GAAG,EAAG,CACnD,IAAM,EAAQ,EAAY,QAAQ,GAAG,EACrC,GAAI,EAAQ,EAAG,SACf,IAAM,EAAO,EAAY,MAAM,EAAG,CAAK,CAAC,CAAC,KAAK,EAC1C,GAAM,EAAa,IAAI,EAAM,EAAY,MAAM,EAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CACxE,CACI,EAAa,OAAS,GAC1B,EAAO,KAAK,CAAE,UAAW,EAAM,IAAM,GAAA,CAAI,KAAK,EAAG,cAAa,CAAC,CACnE,CACA,OAAO,CACX,CASA,SAAgB,EAAgB,EAA+B,EAA4B,CACvF,IAAM,EAAW,IAAI,IACrB,IAAK,IAAM,KAAS,EAAQ,IAAK,IAAM,KAAQ,EAAM,aAAa,KAAK,EAAG,EAAS,IAAI,CAAI,EAE3F,IAAM,EAAU,IAAI,IACd,EAAQ,CAAC,GAAG,EAAM,SAAS,CAAe,CAAC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__PURE__ */ new Map();
7
+ for (let t of (n[2] ?? "").split(";")) {
8
+ let n = t.indexOf(":");
9
+ if (n < 0) continue;
10
+ let r = t.slice(0, n).trim();
11
+ r && e.set(r, t.slice(n + 1).trim());
12
+ }
13
+ e.size !== 0 && t.push({
14
+ selector: (n[1] ?? "").trim(),
15
+ declarations: e
16
+ });
17
+ }
18
+ return t;
19
+ }
20
+ function r(t, n) {
21
+ let r = /* @__PURE__ */ new Set();
22
+ for (let e of t) for (let t of e.declarations.keys()) r.add(t);
23
+ let i = /* @__PURE__ */ new Set(), a = [...n.matchAll(e)].map((e) => e[1] ?? "");
24
+ for (; a.length > 0;) {
25
+ let n = a.pop() ?? "";
26
+ if (!i.has(n) && r.has(n)) {
27
+ i.add(n);
28
+ for (let r of t) {
29
+ let t = r.declarations.get(n);
30
+ if (t !== void 0) for (let n of t.matchAll(e)) a.push(n[1] ?? "");
31
+ }
32
+ }
33
+ }
34
+ return i;
35
+ }
36
+ function i(e, i) {
37
+ if (t.test(i)) return null;
38
+ let a = n(e), o = r(a, i);
39
+ if (o.size === 0) return null;
40
+ let s = [];
41
+ for (let e of a) {
42
+ let t = [...e.declarations].filter(([e]) => e.startsWith("--") === !1 || o.has(e));
43
+ t.every(([e]) => e.startsWith("--") === !1) || s.push(`${e.selector}{${t.map(([e, t]) => `${e}:${t}`).join(";")}}`);
44
+ }
45
+ return s.join("\n");
46
+ }
47
+ //#endregion
48
+ export { i as narrowTokens, n as parseTokenBlocks, r as reachableTokens };
49
+
50
+ //# sourceMappingURL=narrow-tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"narrow-tokens.js","names":[],"sources":["../../src/vite/narrow-tokens.ts"],"sourcesContent":["/**\n * Cut the token sheet down to the tokens a set of stylesheets can reach.\n *\n * Once every component loads its own stylesheet, `tokens.css` stops being a rounding\n * error and becomes the biggest single thing an app downloads: measured on a probe\n * app mounting `Button`, `Card` and `Badge`, the sheet is 2516 B brotli of a 4927 B\n * total. The components read 105 of its 223 tokens, so the other 118 are bytes\n * nothing on the page can consult.\n *\n * The cut is a reachability closure, not a filter: a token's value routinely names\n * another token (`--tempest-primary: var(--tempest-primary-500)`), so keeping only\n * the names a stylesheet mentions literally would keep aliases whose targets were\n * dropped β€” `var()` would resolve to nothing and the component would render with the\n * property unset, which is worse than shipping the whole sheet.\n */\n\n/** A token block: one selector and the custom properties it declares, in order. */\ninterface TokenBlock {\n /** The block's selector text, e.g. `:root` or `[data-tempest-theme=dark]`. */\n selector: string;\n /** Declaration name β†’ value, in source order. */\n declarations: Map<string, string>;\n}\n\n/**\n * Any custom property being read, not only the `--tempest-*` ones.\n *\n * Deliberately wider than the tokens this cut is about. `tokens.css` also carries\n * the `--lightningcss-light`/`--lightningcss-dark` pair the compiler emits, which\n * nothing reads today β€” measured: two declarations, zero reads β€” and which a\n * `--tempest-`-only scan would therefore always drop. That is the right answer right\n * up until one rule uses `light-dark()`, at which point the compiler emits the read\n * and a narrow scan would drop the pair it depends on. Matching every custom\n * property costs nothing (a name the sheet does not declare is discarded) and makes\n * the closure correct for names this file does not know about.\n */\nconst TOKEN_REFERENCE = /var\\(\\s*(--[A-Za-z0-9-]+)/g;\n\n/**\n * A token name being assembled at runtime rather than written out.\n *\n * `style={{ color: `var(--tempest-${tone})` }}` names a token no static scan can\n * know, so a cut made without it would drop the one the app is about to read. The\n * caller falls back to the whole sheet when this matches β€” the same shape as the\n * plugin's own namespace-import fallback, and for the same reason: serve more than\n * asked for rather than less than needed.\n */\nconst DYNAMIC_TOKEN = /--tempest-[A-Za-z0-9-]*(?:\\$\\{|[\"'`]\\s*\\+|\\s*\\+\\s*[\"'`])/;\n\n/**\n * Parse a token stylesheet into its blocks.\n *\n * Written against the compiler's own output, which is already valid and flat β€” every\n * block in `tokens.css` is either a bare selector or one nested inside a single\n * at-rule β€” so a brace-depth reader is enough and a full parser would not be more\n * correct here.\n *\n * @param css - Contents of `tokens.css`.\n * @returns One entry per block that declares anything.\n */\nexport function parseTokenBlocks(css: string): TokenBlock[] {\n const blocks: TokenBlock[] = [];\n for (const match of css.matchAll(/([^{}]+)\\{([^{}]*)\\}/g)) {\n const declarations = new Map<string, string>();\n for (const declaration of (match[2] ?? \"\").split(\";\")) {\n const colon = declaration.indexOf(\":\");\n if (colon < 0) continue;\n const name = declaration.slice(0, colon).trim();\n if (name) declarations.set(name, declaration.slice(colon + 1).trim());\n }\n if (declarations.size === 0) continue;\n blocks.push({ selector: (match[1] ?? \"\").trim(), declarations });\n }\n return blocks;\n}\n\n/**\n * Every token a body of CSS reaches, following token-to-token references.\n *\n * @param blocks - The parsed token sheet.\n * @param usage - CSS and source text to scan for `var(--tempest-*)`.\n * @returns The reachable token names.\n */\nexport function reachableTokens(blocks: readonly TokenBlock[], usage: string): Set<string> {\n const declared = new Set<string>();\n for (const block of blocks) for (const name of block.declarations.keys()) declared.add(name);\n\n const reached = new Set<string>();\n const queue = [...usage.matchAll(TOKEN_REFERENCE)].map((match) => match[1] ?? \"\");\n while (queue.length > 0) {\n const token = queue.pop() ?? \"\";\n if (reached.has(token) || !declared.has(token)) continue;\n reached.add(token);\n for (const block of blocks) {\n const value = block.declarations.get(token);\n if (value === undefined) continue;\n for (const match of value.matchAll(TOKEN_REFERENCE)) queue.push(match[1] ?? \"\");\n }\n }\n return reached;\n}\n\n/**\n * Rebuild the token sheet with only the tokens a set of stylesheets reaches.\n *\n * Companion declarations that are not custom properties travel with the block that\n * survives β€” `color-scheme` is the one, and dropping it would leave the browser\n * painting its own surfaces (scrollbar, `<select>` popup, autofill) in the wrong\n * theme while every `.tempest_*` rule was correct.\n *\n * @param tokensCss - Contents of `tokens.css`.\n * @param usage - The CSS the app will load, plus its own source, scanned for reads.\n * @returns The narrowed sheet, or `null` when a token name is built at runtime and\n * no static answer is safe.\n */\nexport function narrowTokens(tokensCss: string, usage: string): string | null {\n if (DYNAMIC_TOKEN.test(usage)) return null;\n\n const blocks = parseTokenBlocks(tokensCss);\n const reached = reachableTokens(blocks, usage);\n if (reached.size === 0) return null;\n\n const out: string[] = [];\n for (const block of blocks) {\n const kept = [...block.declarations].filter(\n ([name]) => name.startsWith(\"--\") === false || reached.has(name),\n );\n if (kept.every(([name]) => name.startsWith(\"--\") === false)) continue;\n out.push(`${block.selector}{${kept.map(([name, value]) => `${name}:${value}`).join(\";\")}}`);\n }\n return out.join(\"\\n\");\n}\n"],"mappings":";AAoCA,IAAM,IAAkB,8BAWlB,IAAgB;AAatB,SAAgB,EAAiB,GAA2B;CACxD,IAAM,IAAuB,CAAC;CAC9B,KAAK,IAAM,KAAS,EAAI,SAAS,uBAAuB,GAAG;EACvD,IAAM,oBAAe,IAAI,IAAoB;EAC7C,KAAK,IAAM,MAAgB,EAAM,MAAM,GAAA,CAAI,MAAM,GAAG,GAAG;GACnD,IAAM,IAAQ,EAAY,QAAQ,GAAG;GACrC,IAAI,IAAQ,GAAG;GACf,IAAM,IAAO,EAAY,MAAM,GAAG,CAAK,CAAC,CAAC,KAAK;GAC9C,AAAI,KAAM,EAAa,IAAI,GAAM,EAAY,MAAM,IAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;EACxE;EACI,EAAa,SAAS,KAC1B,EAAO,KAAK;GAAE,WAAW,EAAM,MAAM,GAAA,CAAI,KAAK;GAAG;EAAa,CAAC;CACnE;CACA,OAAO;AACX;AASA,SAAgB,EAAgB,GAA+B,GAA4B;CACvF,IAAM,oBAAW,IAAI,IAAY;CACjC,KAAK,IAAM,KAAS,GAAQ,KAAK,IAAM,KAAQ,EAAM,aAAa,KAAK,GAAG,EAAS,IAAI,CAAI;CAE3F,IAAM,oBAAU,IAAI,IAAY,GAC1B,IAAQ,CAAC,GAAG,EAAM,SAAS,CAAe,CAAC,CAAC,CAAC,KAAK,MAAU,EAAM,MAAM,EAAE;CAChF,OAAO,EAAM,SAAS,IAAG;EACrB,IAAM,IAAQ,EAAM,IAAI,KAAK;EACzB,OAAQ,IAAI,CAAK,KAAM,EAAS,IAAI,CAAK,GAC7C;KAAQ,IAAI,CAAK;GACjB,KAAK,IAAM,KAAS,GAAQ;IACxB,IAAM,IAAQ,EAAM,aAAa,IAAI,CAAK;IACtC,UAAU,KAAA,GACd,KAAK,IAAM,KAAS,EAAM,SAAS,CAAe,GAAG,EAAM,KAAK,EAAM,MAAM,EAAE;GAClF;EALiB;CAMrB;CACA,OAAO;AACX;AAeA,SAAgB,EAAa,GAAmB,GAA8B;CAC1E,IAAI,EAAc,KAAK,CAAK,GAAG,OAAO;CAEtC,IAAM,IAAS,EAAiB,CAAS,GACnC,IAAU,EAAgB,GAAQ,CAAK;CAC7C,IAAI,EAAQ,SAAS,GAAG,OAAO;CAE/B,IAAM,IAAgB,CAAC;CACvB,KAAK,IAAM,KAAS,GAAQ;EACxB,IAAM,IAAO,CAAC,GAAG,EAAM,YAAY,CAAC,CAAC,QAChC,CAAC,OAAU,EAAK,WAAW,IAAI,MAAM,MAAS,EAAQ,IAAI,CAAI,CACnE;EACI,EAAK,OAAO,CAAC,OAAU,EAAK,WAAW,IAAI,MAAM,EAAK,KAC1D,EAAI,KAAK,GAAG,EAAM,SAAS,GAAG,EAAK,KAAK,CAAC,GAAM,OAAW,GAAG,EAAK,GAAG,GAAO,CAAC,CAAC,KAAK,GAAG,EAAE,EAAE;CAC9F;CACA,OAAO,EAAI,KAAK,IAAI;AACxB"}
@@ -1,5 +1,7 @@
1
- let e=require("node:path"),t=require("node:fs/promises"),n=require("node:fs"),r=require("node:url");var i=`tempest-react-sdk/styles/auto.css`,a=`\0tempest-styles/auto.css`,o=/^tempest-react-sdk(\/(charts|editor|br|icons))?$/,s=/\.[cm]?[jt]sx?$/,c=new Set([`node_modules`,`dist`,`build`,`coverage`]);function l(e){let t=new Set;for(let n of e.matchAll(/\bimport\s+(type\s+)?([^;'"]*?)\s+from\s*["']([^"']+)["']/g)){let[,e,r,i]=n;if(!o.test(i??``)||e)continue;if(/^\s*\*\s+as\s/.test(r??``))return null;let a=/\{([^}]*)\}/.exec(r??``);if(a)for(let e of(a[1]??``).split(`,`)){let n=e.trim();if(!n||n.startsWith(`type `))continue;let r=n.split(/\s+as\s+/)[0]?.trim();r&&t.add(r)}}return[...t]}function u(e,t,n=`scoped`){let r=`/* Generated by tempestStyles() β€” the CSS this app actually uses. */
2
- `,i=n===`global`?[t.core]:n===`scoped`?[`tokens.css`,`scoped.css`]:[`tokens.css`];if(e===null)return`${r}${(n===`global`?[`../styles.css`]:[...i,`../styles.css`]).map(e=>`@import "tempest-react-sdk/styles/${e}";`).join(`
3
- `)}\n`;let a=new Set;for(let n of e)for(let e of t.components[n]??[])a.add(e);return`${r}${[...i,...[...a].sort()].map(e=>`@import "tempest-react-sdk/styles/${e}";`).join(`
4
- `)}\n`}async function d(n,r){let i=[],a;try{a=await(0,t.readdir)(n,{withFileTypes:!0})}catch{return i}for(let t of a)if(t.isDirectory()){if(r.has(t.name)||t.name.startsWith(`.`))continue;i.push(...await d((0,e.join)(n,t.name),r))}else t.isFile()&&s.test(t.name)&&i.push((0,e.join)(n,t.name));return i}function f(t){let i=(0,e.join)(`tempest-react-sdk`,`dist`,`styles`,`manifest.json`),a=[],o=(0,e.resolve)(t);for(;;){a.push((0,e.join)(o,`node_modules`,i));let t=(0,e.dirname)(o);if(t===o)break;o=t}a.push((0,e.join)((0,e.dirname)((0,r.fileURLToPath)({}.url)),`..`,`styles`,`manifest.json`));for(let e of a)try{return JSON.parse((0,n.readFileSync)(e,`utf8`))}catch{continue}throw Error(`tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found β€” the installed SDK predates it. Upgrade, or drop the plugin and import tempest-react-sdk/styles.css.`)}function p(n={}){let{dir:r=`src`,include:i=[],skipDirs:o,reset:s=`scoped`}=n,p=new Set(o??c),m=process.cwd(),h=[...i],g=async()=>{let n=new Set(i);for(let i of await d((0,e.resolve)(m,r),p)){let e;try{e=await(0,t.readFile)(i,`utf8`)}catch{continue}let r=l(e);if(r===null){h=null;return}for(let e of r)n.add(e)}h=[...n]};return{name:`tempest-styles`,enforce:`pre`,configResolved(e){m=e.root??m},async buildStart(){await g()},resolveId(e){return e===`tempest-react-sdk/styles/auto.css`?a:null},load(e){return e===a?u(h,f(m),s):null}}}exports.TEMPEST_STYLES_ID=i,exports.buildStyleEntry=u,exports.scanStyleImports=l,exports.tempestStyles=p;
1
+ const e=require("./narrow-tokens.cjs");let t=require("node:path"),n=require("node:fs/promises"),r=require("node:fs"),i=require("node:url");var a=`tempest-react-sdk/styles/auto.css`,o=`\0tempest-styles/auto.css`,s=/^tempest-react-sdk(\/(charts|editor|br|icons))?$/,c=/\.[cm]?[jt]sx?$/,l=/\.(css|scss|sass|less)$/,u=new Set([`node_modules`,`dist`,`build`,`coverage`]);function d(e){let t=new Set;for(let n of e.matchAll(/\bimport\s+(type\s+)?([^;'"]*?)\s+from\s*["']([^"']+)["']/g)){let[,e,r,i]=n;if(!s.test(i??``)||e)continue;if(/^\s*\*\s+as\s/.test(r??``))return null;let a=/\{([^}]*)\}/.exec(r??``);if(a)for(let e of(a[1]??``).split(`,`)){let n=e.trim();if(!n||n.startsWith(`type `))continue;let r=n.split(/\s+as\s+/)[0]?.trim();r&&t.add(r)}}return[...t]}function f(e,t,n=`scoped`,r=null){let i=`/* Generated by tempestStyles() β€” the CSS this app actually uses. */
2
+ `,a=r===null?[`tokens.css`]:[],o=n===`global`?r===null?[t.core]:[...a,`base.css`]:n===`scoped`?[...a,`scoped.css`]:a,s=r===null?``:`${r}\n`;if(e===null)return`${i}${(n===`global`?[t.core,`../styles.css`]:[...o,`../styles.css`]).map(e=>`@import "tempest-react-sdk/styles/${e}";`).join(`
3
+ `)}\n${s}`;let c=new Set;for(let n of e)for(let e of t.components[n]??[])c.add(e);return`${i}${[...o,...[...c].sort()].map(e=>`@import "tempest-react-sdk/styles/${e}";`).join(`
4
+ `)}\n${s}`}function p(e,t,n){if(e===null)return[`../styles.css`];let r=new Set;n===`scoped`&&r.add(`scoped.css`),n===`global`&&r.add(`base.css`);for(let n of e)for(let e of t.components[n]??[])r.add(e);return[...r].sort()}async function m(e,r){let i=[],a;try{a=await(0,n.readdir)(e,{withFileTypes:!0})}catch{return i}for(let n of a)if(n.isDirectory()){if(r.has(n.name)||n.name.startsWith(`.`))continue;i.push(...await m((0,t.join)(e,n.name),r))}else n.isFile()&&(c.test(n.name)||l.test(n.name))&&i.push((0,t.join)(e,n.name));return i}function h(e){let n=(0,t.join)(`tempest-react-sdk`,`dist`,`styles`,`manifest.json`),a=[],o=(0,t.resolve)(e);for(;;){a.push((0,t.join)(o,`node_modules`,n));let e=(0,t.dirname)(o);if(e===o)break;o=e}a.push((0,t.join)((0,t.dirname)((0,i.fileURLToPath)({}.url)),`..`,`styles`,`manifest.json`));for(let e of a)try{return{manifest:JSON.parse((0,r.readFileSync)(e,`utf8`)),dir:(0,t.dirname)(e)}}catch{continue}throw Error(`tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found β€” the installed SDK predates it. Upgrade, or drop the plugin and import tempest-react-sdk/styles.css.`)}function g(i={}){let{dir:a=`src`,include:s=[],skipDirs:c,reset:g=`scoped`,tokens:_=`used`}=i,v=new Set(c??u),y=process.cwd(),b=[...s],x=``,S=async()=>{let e=new Set(s),r=[],i=!1;for(let o of await m((0,t.resolve)(y,a),v)){let t;try{t=await(0,n.readFile)(o,`utf8`)}catch{continue}if(t.includes(`--tempest-`)&&r.push(t),l.test(o))continue;let a=d(t);if(a===null)i=!0;else for(let t of a)e.add(t)}x=r.join(`
5
+ `),b=i?null:[...e]},C=(n,i)=>{if(_===`all`||b===null)return null;let a;try{a=(0,r.readFileSync)((0,t.join)(i,`tokens.css`),`utf8`)}catch{return null}let o=[x];for(let e of p(b,n,g))try{o.push((0,r.readFileSync)((0,t.join)(i,e),`utf8`))}catch{return null}return e.narrowTokens(a,o.join(`
6
+ `))};return{name:`tempest-styles`,enforce:`pre`,configResolved(e){y=e.root??y},async buildStart(){await S()},resolveId(e){return e===`tempest-react-sdk/styles/auto.css`?o:null},load(e){if(e!==o)return null;let{manifest:t,dir:n}=h(y);return f(b,t,g,C(t,n))}}}exports.TEMPEST_STYLES_ID=a,exports.buildStyleEntry=f,exports.scanStyleImports=d,exports.selectedSheets=p,exports.tempestStyles=g;
5
7
  //# sourceMappingURL=tempest-styles.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tempest-styles.cjs","names":[],"sources":["../../src/vite/tempest-styles.ts"],"sourcesContent":["import { readdir, readFile } from \"node:fs/promises\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport type { TempestVitePlugin } from \"./tempest-pwa-manifest\";\n\n/** The stylesheet id an app imports to get exactly the CSS it uses. */\nexport const TEMPEST_STYLES_ID = \"tempest-react-sdk/styles/auto.css\";\n\nconst RESOLVED_ID = \"\\0tempest-styles/auto.css\";\n\n/** Package subpaths whose exports are components with stylesheets. */\nconst SDK_SPECIFIER = /^tempest-react-sdk(\\/(charts|editor|br|icons))?$/;\n\nconst SOURCE_FILE = /\\.[cm]?[jt]sx?$/;\nconst SKIP_DIRS = new Set([\"node_modules\", \"dist\", \"build\", \"coverage\"]);\n\n/**\n * How much of the reset an app takes.\n *\n * The components are written against the reset β€” `.tempest_button` assumes\n * `button { background: none; border: 0; padding: 0 }`, every width assumes\n * `box-sizing: border-box` β€” so `\"none\"` is not \"unstyled document, styled\n * components\": it is components missing their box model. It exists for the app\n * that already ships an equivalent reset of its own.\n */\nexport type ResetMode = \"scoped\" | \"global\" | \"none\";\n\n/** Shape of `dist/styles/manifest.json`. */\nexport interface StyleManifest {\n /** The foundation sheet β€” tokens and reset together, the pre-split default. */\n core: string;\n /** Public export name β†’ the stylesheets it needs, transitive closure included. */\n components: Record<string, readonly string[]>;\n}\n\nexport interface TempestStylesOptions {\n /** Directory to scan, relative to the Vite root. Default: `\"src\"`. */\n dir?: string;\n /**\n * Which reset to emit alongside the tokens. Default: `\"scoped\"`.\n *\n * `\"scoped\"` confines the reset to `:where([class*=\"tempest_\"])`, so components\n * keep the normalisation they are written against and the app keeps `html`,\n * `body` and `#root`. `\"global\"` is the pre-split behaviour, correct when the\n * SDK owns the whole page. `\"none\"` emits tokens only.\n */\n reset?: ResetMode;\n /**\n * Extra export names to style even when the scan cannot see them β€” a component\n * reached only through a namespace import, or rendered by a sibling package.\n */\n include?: readonly string[];\n /** Directory names to skip. Default: `node_modules`, `dist`, `build`, `coverage`. */\n skipDirs?: readonly string[];\n}\n\n/**\n * Collect the SDK export names a source file imports.\n *\n * Reads the import specifier rather than the JSX, because a bare `<Button>` in the\n * markup says nothing about where it came from β€” the app may well define its own.\n * Type-only bindings are dropped: they are erased before any component renders, so\n * paying for their CSS would be paying for nothing.\n *\n * @param code - File contents.\n * @returns The imported names, or `null` when the file namespace-imports the SDK\n * and the set therefore cannot be known.\n */\nexport function scanStyleImports(code: string): string[] | null {\n const names = new Set<string>();\n\n for (const match of code.matchAll(\n /\\bimport\\s+(type\\s+)?([^;'\"]*?)\\s+from\\s*[\"']([^\"']+)[\"']/g,\n )) {\n const [, typeOnly, clause, specifier] = match;\n if (!SDK_SPECIFIER.test(specifier ?? \"\")) continue;\n if (typeOnly) continue;\n if (/^\\s*\\*\\s+as\\s/.test(clause ?? \"\")) return null;\n\n const braces = /\\{([^}]*)\\}/.exec(clause ?? \"\");\n if (!braces) continue;\n for (const part of (braces[1] ?? \"\").split(\",\")) {\n const binding = part.trim();\n if (!binding || binding.startsWith(\"type \")) continue;\n const name = binding.split(/\\s+as\\s+/)[0]?.trim();\n if (name) names.add(name);\n }\n }\n return [...names];\n}\n\n/**\n * Build the stylesheet for a set of export names.\n *\n * Emits `@import` statements rather than inlined rules so Vite's own CSS pipeline\n * resolves, deduplicates and minifies them β€” the same treatment a hand-written\n * list of imports gets, which is what this replaces.\n *\n * @param names - Export names the app imports, or `null` to take everything.\n * @param manifest - The published style manifest.\n * @returns CSS source.\n */\nexport function buildStyleEntry(\n names: readonly string[] | null,\n manifest: StyleManifest,\n reset: ResetMode = \"scoped\",\n): string {\n const banner = \"/* Generated by tempestStyles() β€” the CSS this app actually uses. */\\n\";\n const foundation =\n reset === \"global\"\n ? [manifest.core]\n : reset === \"scoped\"\n ? [\"tokens.css\", \"scoped.css\"]\n : [\"tokens.css\"];\n\n if (names === null) {\n const whole = reset === \"global\" ? [\"../styles.css\"] : [...foundation, \"../styles.css\"];\n return `${banner}${whole.map((sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`).join(\"\\n\")}\\n`;\n }\n\n const sheets = new Set<string>();\n for (const name of names) {\n for (const sheet of manifest.components[name] ?? []) sheets.add(sheet);\n }\n const lines = [...foundation, ...[...sheets].sort()].map(\n (sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`,\n );\n return `${banner}${lines.join(\"\\n\")}\\n`;\n}\n\n/**\n * Walk a directory and collect every source file path.\n *\n * @param dir - Absolute directory to walk.\n * @param skip - Directory names to skip.\n * @returns Absolute file paths.\n */\nasync function collectSourceFiles(dir: string, skip: ReadonlySet<string>): Promise<string[]> {\n const out: string[] = [];\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return out;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (skip.has(entry.name) || entry.name.startsWith(\".\")) continue;\n out.push(...(await collectSourceFiles(join(dir, entry.name), skip)));\n } else if (entry.isFile() && SOURCE_FILE.test(entry.name)) {\n out.push(join(dir, entry.name));\n }\n }\n return out;\n}\n\n/**\n * Read the style manifest the installed package ships.\n *\n * Resolved by walking the filesystem rather than through `createRequire`, which\n * does not survive the trip: Vite bundles `vite.config.ts` into a temporary module\n * before running it, and in that bundle the `node:module` namespace import comes\n * back without the function β€” `(0, a.createRequire) is not a function`, at load\n * time, inside the build. The same rewrite is why `import.meta.url` is only the\n * fallback here and the app's `node_modules` is tried first.\n *\n * @param root - The Vite root, where the walk for `node_modules` starts.\n * @returns The manifest.\n * @throws If no installed copy carries one β€” an SDK older than the manifest.\n */\nfunction readManifest(root: string): StyleManifest {\n const relative = join(\"tempest-react-sdk\", \"dist\", \"styles\", \"manifest.json\");\n const candidates: string[] = [];\n\n let dir = resolve(root);\n for (;;) {\n candidates.push(join(dir, \"node_modules\", relative));\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n candidates.push(join(dirname(fileURLToPath(import.meta.url)), \"..\", \"styles\", \"manifest.json\"));\n\n for (const candidate of candidates) {\n try {\n return JSON.parse(readFileSync(candidate, \"utf8\")) as StyleManifest;\n } catch {\n continue;\n }\n }\n throw new Error(\n \"tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found β€” \" +\n \"the installed SDK predates it. Upgrade, or drop the plugin and import \" +\n \"tempest-react-sdk/styles.css.\",\n );\n}\n\n/**\n * Import only the SDK stylesheets your app can actually reach.\n *\n * `styles.css` carries every component the SDK ships β€” measured at 236.71 kB raw\n * against the 38.94 kB an app mounting twelve of them can reach. The per-component\n * sheets under `styles/` have always closed that gap, but by hand: the app lists\n * them and keeps the list honest as it grows. This plugin makes the list the build's\n * problem, resolving it from the imports the source already writes.\n *\n * The closure matters more than the scan. A component pays for the CSS of every SDK\n * component it renders internally, so `<DataTable>` alone needs six sheets and\n * `<AIChat>` seven β€” a hand-kept list of one sheet per component the app names is\n * wrong in a way that only shows up as an unstyled child.\n *\n * The reset is the other half, and the half that breaks apps. `styles.css` claims\n * `html`, `body` and `#root`; an app with its own layout that imports it loses its\n * document surface, and an app that drops the import loses the box model its\n * components are written against β€” components render unstyled, which is what the\n * \"just remove the import\" fix actually costs. The default `reset: \"scoped\"` is the\n * third option: the same normalisation, confined to\n * `:where([class*=\"tempest_\"])`, so it reaches inside a Tempest component and\n * nowhere else.\n *\n * `tempest-react-sdk/styles/auto.css` is a real file, so it resolves without the\n * plugin too β€” to the complete sheet. Dropping the plugin costs bytes, never\n * correctness.\n *\n * @param options - Scan configuration.\n * @returns The Vite plugin.\n *\n * @example\n * // vite.config.ts\n * import { createViteConfig, tempestStyles } from \"tempest-react-sdk/vite\";\n *\n * export default createViteConfig({ plugins: [tempestStyles()] });\n *\n * @example\n * // src/main.tsx β€” the one import, instead of a maintained list\n * import \"tempest-react-sdk/styles/auto.css\";\n */\nexport function tempestStyles(options: TempestStylesOptions = {}): TempestVitePlugin {\n const { dir = \"src\", include = [], skipDirs, reset = \"scoped\" } = options;\n const skip = new Set<string>(skipDirs ?? SKIP_DIRS);\n let root = process.cwd();\n let names: string[] | null = [...include];\n\n /**\n * Rescan the source tree, keeping the explicitly included names.\n *\n * @tempest-limits empty-catch β€” the scan races the editor and the file system:\n * a file listed a moment ago can be renamed, deleted, or held by another process\n * by the time it is read. An unreadable file contributes no names and the build\n * continues; failing the whole scan would break `vite dev` over a temp file that\n * no longer exists.\n */\n const rescan = async (): Promise<void> => {\n const found = new Set<string>(include);\n for (const file of await collectSourceFiles(resolve(root, dir), skip)) {\n let code: string;\n try {\n code = await readFile(file, \"utf8\");\n } catch {\n continue;\n }\n const scanned = scanStyleImports(code);\n if (scanned === null) {\n names = null;\n return;\n }\n for (const name of scanned) found.add(name);\n }\n names = [...found];\n };\n\n return {\n name: \"tempest-styles\",\n enforce: \"pre\",\n\n configResolved(config: { root?: string }) {\n root = config.root ?? root;\n },\n\n async buildStart() {\n await rescan();\n },\n\n resolveId(id: string) {\n return id === TEMPEST_STYLES_ID ? RESOLVED_ID : null;\n },\n\n load(id: string) {\n return id === RESOLVED_ID ? buildStyleEntry(names, readManifest(root), reset) : null;\n },\n };\n}\n"],"mappings":"oGAQA,IAAa,EAAoB,oCAE3B,EAAc,4BAGd,EAAgB,mDAEhB,EAAc,kBACd,EAAY,IAAI,IAAI,CAAC,eAAgB,OAAQ,QAAS,UAAU,CAAC,EAsDvE,SAAgB,EAAiB,EAA+B,CAC5D,IAAM,EAAQ,IAAI,IAElB,IAAK,IAAM,KAAS,EAAK,SACrB,4DACJ,EAAG,CACC,GAAM,EAAG,EAAU,EAAQ,GAAa,EAExC,GADI,CAAC,EAAc,KAAK,GAAa,EAAE,GACnC,EAAU,SACd,GAAI,gBAAgB,KAAK,GAAU,EAAE,EAAG,OAAO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AAM,CAAG,EAAG,CAAI,EAAG,CACnE,IAAI,EACJ,GAAI,CACA,EAAO,MAAA,EAAM,EAAA,SAAA,CAAS,EAAM,MAAM,CACtC,MAAQ,CACJ,QACJ,CACA,IAAM,EAAU,EAAiB,CAAI,EACrC,GAAI,IAAY,KAAM,CAClB,EAAQ,KACR,MACJ,CACA,IAAK,IAAM,KAAQ,EAAS,EAAM,IAAI,CAAI,CAC9C,CACA,EAAQ,CAAC,GAAG,CAAK,CACrB,EAEA,MAAO,CACH,KAAM,iBACN,QAAS,MAET,eAAe,EAA2B,CACtC,EAAO,EAAO,MAAQ,CAC1B,EAEA,MAAM,YAAa,CACf,MAAM,EAAO,CACjB,EAEA,UAAU,EAAY,CAClB,OAAO,IAAA,oCAA2B,EAAc,IACpD,EAEA,KAAK,EAAY,CACb,OAAO,IAAO,EAAc,EAAgB,EAAO,EAAa,CAAI,EAAG,CAAK,EAAI,IACpF,CACJ,CACJ"}
1
+ {"version":3,"file":"tempest-styles.cjs","names":[],"sources":["../../src/vite/tempest-styles.ts"],"sourcesContent":["import { readdir, readFile } from \"node:fs/promises\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { narrowTokens } from \"./narrow-tokens\";\nimport type { TempestVitePlugin } from \"./tempest-pwa-manifest\";\n\n/** The stylesheet id an app imports to get exactly the CSS it uses. */\nexport const TEMPEST_STYLES_ID = \"tempest-react-sdk/styles/auto.css\";\n\nconst RESOLVED_ID = \"\\0tempest-styles/auto.css\";\n\n/** Package subpaths whose exports are components with stylesheets. */\nconst SDK_SPECIFIER = /^tempest-react-sdk(\\/(charts|editor|br|icons))?$/;\n\nconst SOURCE_FILE = /\\.[cm]?[jt]sx?$/;\n\n/**\n * The app's own stylesheets, scanned for token reads rather than for imports.\n *\n * An app is documented as free to read `--tempest-*` in CSS of its own, so cutting\n * the token sheet to what the SDK's components reach would drop tokens the app is\n * still reading β€” and a dropped token is not a smaller sheet, it is an unset\n * property. These files contribute reads to the closure and nothing else.\n */\nconst STYLE_FILE = /\\.(css|scss|sass|less)$/;\nconst SKIP_DIRS = new Set([\"node_modules\", \"dist\", \"build\", \"coverage\"]);\n\n/**\n * How much of the reset an app takes.\n *\n * The components are written against the reset β€” `.tempest_button` assumes\n * `button { background: none; border: 0; padding: 0 }`, every width assumes\n * `box-sizing: border-box` β€” so `\"none\"` is not \"unstyled document, styled\n * components\": it is components missing their box model. It exists for the app\n * that already ships an equivalent reset of its own.\n */\nexport type ResetMode = \"scoped\" | \"global\" | \"none\";\n\n/**\n * How much of the token sheet an app takes.\n *\n * `\"used\"` emits only the tokens the selected stylesheets β€” and the app's own CSS β€”\n * can reach, following token-to-token references. `\"all\"` emits `tokens.css` whole,\n * which is what to reach for when the app names tokens somewhere the scan cannot\n * see: a token read from a CSS-in-JS library, a sibling package's stylesheet, a\n * `<style>` block in `index.html`.\n */\nexport type TokenMode = \"used\" | \"all\";\n\n/** Shape of `dist/styles/manifest.json`. */\nexport interface StyleManifest {\n /** The foundation sheet β€” tokens and reset together, the pre-split default. */\n core: string;\n /** Public export name β†’ the stylesheets it needs, transitive closure included. */\n components: Record<string, readonly string[]>;\n}\n\nexport interface TempestStylesOptions {\n /** Directory to scan, relative to the Vite root. Default: `\"src\"`. */\n dir?: string;\n /**\n * Which reset to emit alongside the tokens. Default: `\"scoped\"`.\n *\n * `\"scoped\"` confines the reset to `:where([class*=\"tempest_\"])`, so components\n * keep the normalisation they are written against and the app keeps `html`,\n * `body` and `#root`. `\"global\"` is the pre-split behaviour, correct when the\n * SDK owns the whole page. `\"none\"` emits tokens only.\n */\n reset?: ResetMode;\n /**\n * Extra export names to style even when the scan cannot see them β€” a component\n * reached only through a namespace import, or rendered by a sibling package.\n */\n include?: readonly string[];\n /** Directory names to skip. Default: `node_modules`, `dist`, `build`, `coverage`. */\n skipDirs?: readonly string[];\n /**\n * How much of the token sheet to emit. Default: `\"used\"`.\n *\n * The default falls back to the whole sheet on its own whenever a token name is\n * assembled at runtime (`` `var(--tempest-${tone})` ``), so `\"all\"` is for the\n * case the scan cannot see at all β€” a token read from outside `dir`.\n */\n tokens?: TokenMode;\n}\n\n/**\n * Collect the SDK export names a source file imports.\n *\n * Reads the import specifier rather than the JSX, because a bare `<Button>` in the\n * markup says nothing about where it came from β€” the app may well define its own.\n * Type-only bindings are dropped: they are erased before any component renders, so\n * paying for their CSS would be paying for nothing.\n *\n * @param code - File contents.\n * @returns The imported names, or `null` when the file namespace-imports the SDK\n * and the set therefore cannot be known.\n */\nexport function scanStyleImports(code: string): string[] | null {\n const names = new Set<string>();\n\n for (const match of code.matchAll(\n /\\bimport\\s+(type\\s+)?([^;'\"]*?)\\s+from\\s*[\"']([^\"']+)[\"']/g,\n )) {\n const [, typeOnly, clause, specifier] = match;\n if (!SDK_SPECIFIER.test(specifier ?? \"\")) continue;\n if (typeOnly) continue;\n if (/^\\s*\\*\\s+as\\s/.test(clause ?? \"\")) return null;\n\n const braces = /\\{([^}]*)\\}/.exec(clause ?? \"\");\n if (!braces) continue;\n for (const part of (braces[1] ?? \"\").split(\",\")) {\n const binding = part.trim();\n if (!binding || binding.startsWith(\"type \")) continue;\n const name = binding.split(/\\s+as\\s+/)[0]?.trim();\n if (name) names.add(name);\n }\n }\n return [...names];\n}\n\n/**\n * Build the stylesheet for a set of export names.\n *\n * Emits `@import` statements rather than inlined rules so Vite's own CSS pipeline\n * resolves, deduplicates and minifies them β€” the same treatment a hand-written\n * list of imports gets, which is what this replaces.\n *\n * The narrowed token block is the exception, and it goes last for a reason the\n * cascade does not explain: `@import` is only valid before any rule, so a token\n * block written above the imports would make every one of them invalid and the\n * components would arrive with no CSS at all. Putting it last is safe because the\n * block declares custom properties and nothing else β€” resolving `var()` does not\n * depend on where in the document the declaration sits, only on which selector\n * wins, and no component sheet declares a token to compete with.\n *\n * @param names - Export names the app imports, or `null` to take everything.\n * @param manifest - The published style manifest.\n * @param reset - How much of the reset to emit.\n * @param tokenBlock - The narrowed token sheet, or `null` to `@import` it whole.\n * @returns CSS source.\n */\nexport function buildStyleEntry(\n names: readonly string[] | null,\n manifest: StyleManifest,\n reset: ResetMode = \"scoped\",\n tokenBlock: string | null = null,\n): string {\n const banner = \"/* Generated by tempestStyles() β€” the CSS this app actually uses. */\\n\";\n const tokenSheets = tokenBlock === null ? [\"tokens.css\"] : [];\n const foundation =\n reset === \"global\"\n ? tokenBlock === null\n ? [manifest.core]\n : [...tokenSheets, \"base.css\"]\n : reset === \"scoped\"\n ? [...tokenSheets, \"scoped.css\"]\n : tokenSheets;\n\n const trailer = tokenBlock === null ? \"\" : `${tokenBlock}\\n`;\n\n if (names === null) {\n const whole =\n reset === \"global\"\n ? [manifest.core, \"../styles.css\"]\n : [...foundation, \"../styles.css\"];\n return `${banner}${whole.map((sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`).join(\"\\n\")}\\n${trailer}`;\n }\n\n const sheets = new Set<string>();\n for (const name of names) {\n for (const sheet of manifest.components[name] ?? []) sheets.add(sheet);\n }\n const lines = [...foundation, ...[...sheets].sort()].map(\n (sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`,\n );\n return `${banner}${lines.join(\"\\n\")}\\n${trailer}`;\n}\n\n/**\n * The stylesheets an entry will load, by name, for the token closure to read.\n *\n * @param names - Export names the app imports, or `null` when unknowable.\n * @param manifest - The published style manifest.\n * @param reset - How much of the reset to emit.\n * @returns Stylesheet file names under `dist/styles/`.\n */\nexport function selectedSheets(\n names: readonly string[] | null,\n manifest: StyleManifest,\n reset: ResetMode,\n): string[] {\n if (names === null) return [\"../styles.css\"];\n const sheets = new Set<string>();\n if (reset === \"scoped\") sheets.add(\"scoped.css\");\n if (reset === \"global\") sheets.add(\"base.css\");\n for (const name of names) {\n for (const sheet of manifest.components[name] ?? []) sheets.add(sheet);\n }\n return [...sheets].sort();\n}\n\n/**\n * Walk a directory and collect every source and stylesheet path.\n *\n * @param dir - Absolute directory to walk.\n * @param skip - Directory names to skip.\n * @returns Absolute file paths.\n */\nasync function collectSourceFiles(dir: string, skip: ReadonlySet<string>): Promise<string[]> {\n const out: string[] = [];\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return out;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (skip.has(entry.name) || entry.name.startsWith(\".\")) continue;\n out.push(...(await collectSourceFiles(join(dir, entry.name), skip)));\n } else if (\n entry.isFile() &&\n (SOURCE_FILE.test(entry.name) || STYLE_FILE.test(entry.name))\n ) {\n out.push(join(dir, entry.name));\n }\n }\n return out;\n}\n\n/**\n * Read the style manifest the installed package ships.\n *\n * Resolved by walking the filesystem rather than through `createRequire`, which\n * does not survive the trip: Vite bundles `vite.config.ts` into a temporary module\n * before running it, and in that bundle the `node:module` namespace import comes\n * back without the function β€” `(0, a.createRequire) is not a function`, at load\n * time, inside the build. The same rewrite is why `import.meta.url` is only the\n * fallback here and the app's `node_modules` is tried first.\n *\n * @param root - The Vite root, where the walk for `node_modules` starts.\n * @returns The manifest and the directory it was read from, which is also where the\n * stylesheets it names live.\n * @throws If no installed copy carries one β€” an SDK older than the manifest.\n */\nfunction readManifest(root: string): { manifest: StyleManifest; dir: string } {\n const relative = join(\"tempest-react-sdk\", \"dist\", \"styles\", \"manifest.json\");\n const candidates: string[] = [];\n\n let dir = resolve(root);\n for (;;) {\n candidates.push(join(dir, \"node_modules\", relative));\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n candidates.push(join(dirname(fileURLToPath(import.meta.url)), \"..\", \"styles\", \"manifest.json\"));\n\n for (const candidate of candidates) {\n try {\n const manifest = JSON.parse(readFileSync(candidate, \"utf8\")) as StyleManifest;\n return { manifest, dir: dirname(candidate) };\n } catch {\n continue;\n }\n }\n throw new Error(\n \"tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found β€” \" +\n \"the installed SDK predates it. Upgrade, or drop the plugin and import \" +\n \"tempest-react-sdk/styles.css.\",\n );\n}\n\n/**\n * Import only the SDK stylesheets your app can actually reach.\n *\n * `styles.css` carries every component the SDK ships β€” measured at 236.71 kB raw\n * against the 38.94 kB an app mounting twelve of them can reach. The per-component\n * sheets under `styles/` have always closed that gap, but by hand: the app lists\n * them and keeps the list honest as it grows. This plugin makes the list the build's\n * problem, resolving it from the imports the source already writes.\n *\n * The closure matters more than the scan. A component pays for the CSS of every SDK\n * component it renders internally, so `<DataTable>` alone needs six sheets and\n * `<AIChat>` seven β€” a hand-kept list of one sheet per component the app names is\n * wrong in a way that only shows up as an unstyled child.\n *\n * The reset is the other half, and the half that breaks apps. `styles.css` claims\n * `html`, `body` and `#root`; an app with its own layout that imports it loses its\n * document surface, and an app that drops the import loses the box model its\n * components are written against β€” components render unstyled, which is what the\n * \"just remove the import\" fix actually costs. The default `reset: \"scoped\"` is the\n * third option: the same normalisation, confined to\n * `:where([class*=\"tempest_\"])`, so it reaches inside a Tempest component and\n * nowhere else.\n *\n * `tempest-react-sdk/styles/auto.css` is a real file, so it resolves without the\n * plugin too β€” to the complete sheet. Dropping the plugin costs bytes, never\n * correctness.\n *\n * @param options - Scan configuration.\n * @returns The Vite plugin.\n *\n * @example\n * // vite.config.ts\n * import { createViteConfig, tempestStyles } from \"tempest-react-sdk/vite\";\n *\n * export default createViteConfig({ plugins: [tempestStyles()] });\n *\n * @example\n * // src/main.tsx β€” the one import, instead of a maintained list\n * import \"tempest-react-sdk/styles/auto.css\";\n */\nexport function tempestStyles(options: TempestStylesOptions = {}): TempestVitePlugin {\n const { dir = \"src\", include = [], skipDirs, reset = \"scoped\", tokens = \"used\" } = options;\n const skip = new Set<string>(skipDirs ?? SKIP_DIRS);\n let root = process.cwd();\n let names: string[] | null = [...include];\n let appStyleUsage = \"\";\n\n /**\n * Rescan the source tree, keeping the explicitly included names.\n *\n * @tempest-limits empty-catch β€” the scan races the editor and the file system:\n * a file listed a moment ago can be renamed, deleted, or held by another process\n * by the time it is read. An unreadable file contributes no names and the build\n * continues; failing the whole scan would break `vite dev` over a temp file that\n * no longer exists.\n */\n const rescan = async (): Promise<void> => {\n const found = new Set<string>(include);\n const usage: string[] = [];\n let namespaced = false;\n for (const file of await collectSourceFiles(resolve(root, dir), skip)) {\n let code: string;\n try {\n code = await readFile(file, \"utf8\");\n } catch {\n continue;\n }\n if (code.includes(\"--tempest-\")) usage.push(code);\n if (STYLE_FILE.test(file)) continue;\n const scanned = scanStyleImports(code);\n if (scanned === null) namespaced = true;\n else for (const name of scanned) found.add(name);\n }\n appStyleUsage = usage.join(\"\\n\");\n names = namespaced ? null : [...found];\n };\n\n /**\n * The token block for this build, or `null` to `@import` the whole sheet.\n *\n * Reads the stylesheets the entry is about to load and closes over the tokens\n * they consult, plus the ones the app's own CSS consults. Any read it cannot\n * resolve statically β€” a name assembled at runtime, an unreadable sheet, a\n * package too old to ship `tokens.css` β€” returns `null`, which costs bytes and\n * never correctness. Serving a token sheet with a hole in it would do the\n * opposite.\n *\n * @param manifest - The published style manifest.\n * @param styleDir - Directory the manifest and its stylesheets live in.\n * @returns The narrowed sheet, or `null`.\n */\n const narrowedTokens = (manifest: StyleManifest, styleDir: string): string | null => {\n if (tokens === \"all\" || names === null) return null;\n let tokensCss: string;\n try {\n tokensCss = readFileSync(join(styleDir, \"tokens.css\"), \"utf8\");\n } catch {\n return null;\n }\n const parts: string[] = [appStyleUsage];\n for (const sheet of selectedSheets(names, manifest, reset)) {\n try {\n parts.push(readFileSync(join(styleDir, sheet), \"utf8\"));\n } catch {\n return null;\n }\n }\n return narrowTokens(tokensCss, parts.join(\"\\n\"));\n };\n\n return {\n name: \"tempest-styles\",\n enforce: \"pre\",\n\n configResolved(config: { root?: string }) {\n root = config.root ?? root;\n },\n\n async buildStart() {\n await rescan();\n },\n\n resolveId(id: string) {\n return id === TEMPEST_STYLES_ID ? RESOLVED_ID : null;\n },\n\n load(id: string) {\n if (id !== RESOLVED_ID) return null;\n const { manifest, dir: styleDir } = readManifest(root);\n return buildStyleEntry(names, manifest, reset, narrowedTokens(manifest, styleDir));\n },\n };\n}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AAW,KAAK,CAAI,EAAG,SAC3B,IAAM,EAAU,EAAiB,CAAI,EACrC,GAAI,IAAY,KAAM,EAAa,QAC9B,IAAK,IAAM,KAAQ,EAAS,EAAM,IAAI,CAAI,CACnD,CACA,EAAgB,EAAM,KAAK;CAAI,EAC/B,EAAQ,EAAa,KAAO,CAAC,GAAG,CAAK,CACzC,EAgBM,GAAkB,EAAyB,IAAoC,CACjF,GAAI,IAAW,OAAS,IAAU,KAAM,OAAO,KAC/C,IAAI,EACJ,GAAI,CACA,GAAA,EAAY,EAAA,aAAA,EAAA,EAAa,EAAA,KAAA,CAAK,EAAU,YAAY,EAAG,MAAM,CACjE,MAAQ,CACJ,OAAO,IACX,CACA,IAAM,EAAkB,CAAC,CAAa,EACtC,IAAK,IAAM,KAAS,EAAe,EAAO,EAAU,CAAK,EACrD,GAAI,CACA,EAAM,MAAA,EAAK,EAAA,aAAA,EAAA,EAAa,EAAA,KAAA,CAAK,EAAU,CAAK,EAAG,MAAM,CAAC,CAC1D,MAAQ,CACJ,OAAO,IACX,CAEJ,OAAO,EAAA,aAAa,EAAW,EAAM,KAAK;CAAI,CAAC,CACnD,EAEA,MAAO,CACH,KAAM,iBACN,QAAS,MAET,eAAe,EAA2B,CACtC,EAAO,EAAO,MAAQ,CAC1B,EAEA,MAAM,YAAa,CACf,MAAM,EAAO,CACjB,EAEA,UAAU,EAAY,CAClB,OAAO,IAAA,oCAA2B,EAAc,IACpD,EAEA,KAAK,EAAY,CACb,GAAI,IAAO,EAAa,OAAO,KAC/B,GAAM,CAAE,WAAU,IAAK,GAAa,EAAa,CAAI,EACrD,OAAO,EAAgB,EAAO,EAAU,EAAO,EAAe,EAAU,CAAQ,CAAC,CACrF,CACJ,CACJ"}
@@ -1,19 +1,20 @@
1
- import { dirname as e, join as t, resolve as n } from "node:path";
2
- import { readFile as r, readdir as i } from "node:fs/promises";
3
- import { readFileSync as a } from "node:fs";
4
- import { fileURLToPath as o } from "node:url";
1
+ import { narrowTokens as e } from "./narrow-tokens.js";
2
+ import { dirname as t, join as n, resolve as r } from "node:path";
3
+ import { readFile as i, readdir as a } from "node:fs/promises";
4
+ import { readFileSync as o } from "node:fs";
5
+ import { fileURLToPath as s } from "node:url";
5
6
  //#region src/vite/tempest-styles.ts
6
- var s = "tempest-react-sdk/styles/auto.css", c = "\0tempest-styles/auto.css", l = /^tempest-react-sdk(\/(charts|editor|br|icons))?$/, u = /\.[cm]?[jt]sx?$/, d = /* @__PURE__ */ new Set([
7
+ var c = "tempest-react-sdk/styles/auto.css", l = "\0tempest-styles/auto.css", u = /^tempest-react-sdk(\/(charts|editor|br|icons))?$/, d = /\.[cm]?[jt]sx?$/, f = /\.(css|scss|sass|less)$/, p = /* @__PURE__ */ new Set([
7
8
  "node_modules",
8
9
  "dist",
9
10
  "build",
10
11
  "coverage"
11
12
  ]);
12
- function f(e) {
13
+ function m(e) {
13
14
  let t = /* @__PURE__ */ new Set();
14
15
  for (let n of e.matchAll(/\bimport\s+(type\s+)?([^;'"]*?)\s+from\s*["']([^"']+)["']/g)) {
15
16
  let [, e, r, i] = n;
16
- if (!l.test(i ?? "") || e) continue;
17
+ if (!u.test(i ?? "") || e) continue;
17
18
  if (/^\s*\*\s+as\s/.test(r ?? "")) return null;
18
19
  let a = /\{([^}]*)\}/.exec(r ?? "");
19
20
  if (a) for (let e of (a[1] ?? "").split(",")) {
@@ -25,79 +26,104 @@ function f(e) {
25
26
  }
26
27
  return [...t];
27
28
  }
28
- function p(e, t, n = "scoped") {
29
- let r = "/* Generated by tempestStyles() β€” the CSS this app actually uses. */\n", i = n === "global" ? [t.core] : n === "scoped" ? ["tokens.css", "scoped.css"] : ["tokens.css"];
30
- if (e === null) return `${r}${(n === "global" ? ["../styles.css"] : [...i, "../styles.css"]).map((e) => `@import "tempest-react-sdk/styles/${e}";`).join("\n")}\n`;
31
- let a = /* @__PURE__ */ new Set();
32
- for (let n of e) for (let e of t.components[n] ?? []) a.add(e);
33
- return `${r}${[...i, ...[...a].sort()].map((e) => `@import "tempest-react-sdk/styles/${e}";`).join("\n")}\n`;
29
+ function h(e, t, n = "scoped", r = null) {
30
+ let i = "/* Generated by tempestStyles() β€” the CSS this app actually uses. */\n", a = r === null ? ["tokens.css"] : [], o = n === "global" ? r === null ? [t.core] : [...a, "base.css"] : n === "scoped" ? [...a, "scoped.css"] : a, s = r === null ? "" : `${r}\n`;
31
+ if (e === null) return `${i}${(n === "global" ? [t.core, "../styles.css"] : [...o, "../styles.css"]).map((e) => `@import "tempest-react-sdk/styles/${e}";`).join("\n")}\n${s}`;
32
+ let c = /* @__PURE__ */ new Set();
33
+ for (let n of e) for (let e of t.components[n] ?? []) c.add(e);
34
+ return `${i}${[...o, ...[...c].sort()].map((e) => `@import "tempest-react-sdk/styles/${e}";`).join("\n")}\n${s}`;
34
35
  }
35
- async function m(e, n) {
36
- let r = [], a;
36
+ function g(e, t, n) {
37
+ if (e === null) return ["../styles.css"];
38
+ let r = /* @__PURE__ */ new Set();
39
+ n === "scoped" && r.add("scoped.css"), n === "global" && r.add("base.css");
40
+ for (let n of e) for (let e of t.components[n] ?? []) r.add(e);
41
+ return [...r].sort();
42
+ }
43
+ async function _(e, t) {
44
+ let r = [], i;
37
45
  try {
38
- a = await i(e, { withFileTypes: !0 });
46
+ i = await a(e, { withFileTypes: !0 });
39
47
  } catch {
40
48
  return r;
41
49
  }
42
- for (let i of a) if (i.isDirectory()) {
43
- if (n.has(i.name) || i.name.startsWith(".")) continue;
44
- r.push(...await m(t(e, i.name), n));
45
- } else i.isFile() && u.test(i.name) && r.push(t(e, i.name));
50
+ for (let a of i) if (a.isDirectory()) {
51
+ if (t.has(a.name) || a.name.startsWith(".")) continue;
52
+ r.push(...await _(n(e, a.name), t));
53
+ } else a.isFile() && (d.test(a.name) || f.test(a.name)) && r.push(n(e, a.name));
46
54
  return r;
47
55
  }
48
- function h(r) {
49
- let i = t("tempest-react-sdk", "dist", "styles", "manifest.json"), s = [], c = n(r);
56
+ function v(e) {
57
+ let i = n("tempest-react-sdk", "dist", "styles", "manifest.json"), a = [], c = r(e);
50
58
  for (;;) {
51
- s.push(t(c, "node_modules", i));
52
- let n = e(c);
53
- if (n === c) break;
54
- c = n;
59
+ a.push(n(c, "node_modules", i));
60
+ let e = t(c);
61
+ if (e === c) break;
62
+ c = e;
55
63
  }
56
- s.push(t(e(o(import.meta.url)), "..", "styles", "manifest.json"));
57
- for (let e of s) try {
58
- return JSON.parse(a(e, "utf8"));
64
+ a.push(n(t(s(import.meta.url)), "..", "styles", "manifest.json"));
65
+ for (let e of a) try {
66
+ return {
67
+ manifest: JSON.parse(o(e, "utf8")),
68
+ dir: t(e)
69
+ };
59
70
  } catch {
60
71
  continue;
61
72
  }
62
73
  throw Error("tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found β€” the installed SDK predates it. Upgrade, or drop the plugin and import tempest-react-sdk/styles.css.");
63
74
  }
64
- function g(e = {}) {
65
- let { dir: t = "src", include: i = [], skipDirs: a, reset: o = "scoped" } = e, s = new Set(a ?? d), l = process.cwd(), u = [...i], g = async () => {
66
- let e = new Set(i);
67
- for (let i of await m(n(l, t), s)) {
68
- let t;
75
+ function y(t = {}) {
76
+ let { dir: a = "src", include: s = [], skipDirs: c, reset: u = "scoped", tokens: d = "used" } = t, y = new Set(c ?? p), b = process.cwd(), x = [...s], S = "", C = async () => {
77
+ let e = new Set(s), t = [], n = !1;
78
+ for (let o of await _(r(b, a), y)) {
79
+ let r;
69
80
  try {
70
- t = await r(i, "utf8");
81
+ r = await i(o, "utf8");
71
82
  } catch {
72
83
  continue;
73
84
  }
74
- let n = f(t);
75
- if (n === null) {
76
- u = null;
77
- return;
78
- }
79
- for (let t of n) e.add(t);
85
+ if (r.includes("--tempest-") && t.push(r), f.test(o)) continue;
86
+ let a = m(r);
87
+ if (a === null) n = !0;
88
+ else for (let t of a) e.add(t);
89
+ }
90
+ S = t.join("\n"), x = n ? null : [...e];
91
+ }, w = (t, r) => {
92
+ if (d === "all" || x === null) return null;
93
+ let i;
94
+ try {
95
+ i = o(n(r, "tokens.css"), "utf8");
96
+ } catch {
97
+ return null;
98
+ }
99
+ let a = [S];
100
+ for (let e of g(x, t, u)) try {
101
+ a.push(o(n(r, e), "utf8"));
102
+ } catch {
103
+ return null;
80
104
  }
81
- u = [...e];
105
+ return e(i, a.join("\n"));
82
106
  };
83
107
  return {
84
108
  name: "tempest-styles",
85
109
  enforce: "pre",
86
110
  configResolved(e) {
87
- l = e.root ?? l;
111
+ b = e.root ?? b;
88
112
  },
89
113
  async buildStart() {
90
- await g();
114
+ await C();
91
115
  },
92
116
  resolveId(e) {
93
- return e === "tempest-react-sdk/styles/auto.css" ? c : null;
117
+ return e === "tempest-react-sdk/styles/auto.css" ? l : null;
94
118
  },
95
119
  load(e) {
96
- return e === c ? p(u, h(l), o) : null;
120
+ if (e !== l) return null;
121
+ let { manifest: t, dir: n } = v(b);
122
+ return h(x, t, u, w(t, n));
97
123
  }
98
124
  };
99
125
  }
100
126
  //#endregion
101
- export { s as TEMPEST_STYLES_ID, p as buildStyleEntry, f as scanStyleImports, g as tempestStyles };
127
+ export { c as TEMPEST_STYLES_ID, h as buildStyleEntry, m as scanStyleImports, g as selectedSheets, y as tempestStyles };
102
128
 
103
129
  //# sourceMappingURL=tempest-styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tempest-styles.js","names":[],"sources":["../../src/vite/tempest-styles.ts"],"sourcesContent":["import { readdir, readFile } from \"node:fs/promises\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport type { TempestVitePlugin } from \"./tempest-pwa-manifest\";\n\n/** The stylesheet id an app imports to get exactly the CSS it uses. */\nexport const TEMPEST_STYLES_ID = \"tempest-react-sdk/styles/auto.css\";\n\nconst RESOLVED_ID = \"\\0tempest-styles/auto.css\";\n\n/** Package subpaths whose exports are components with stylesheets. */\nconst SDK_SPECIFIER = /^tempest-react-sdk(\\/(charts|editor|br|icons))?$/;\n\nconst SOURCE_FILE = /\\.[cm]?[jt]sx?$/;\nconst SKIP_DIRS = new Set([\"node_modules\", \"dist\", \"build\", \"coverage\"]);\n\n/**\n * How much of the reset an app takes.\n *\n * The components are written against the reset β€” `.tempest_button` assumes\n * `button { background: none; border: 0; padding: 0 }`, every width assumes\n * `box-sizing: border-box` β€” so `\"none\"` is not \"unstyled document, styled\n * components\": it is components missing their box model. It exists for the app\n * that already ships an equivalent reset of its own.\n */\nexport type ResetMode = \"scoped\" | \"global\" | \"none\";\n\n/** Shape of `dist/styles/manifest.json`. */\nexport interface StyleManifest {\n /** The foundation sheet β€” tokens and reset together, the pre-split default. */\n core: string;\n /** Public export name β†’ the stylesheets it needs, transitive closure included. */\n components: Record<string, readonly string[]>;\n}\n\nexport interface TempestStylesOptions {\n /** Directory to scan, relative to the Vite root. Default: `\"src\"`. */\n dir?: string;\n /**\n * Which reset to emit alongside the tokens. Default: `\"scoped\"`.\n *\n * `\"scoped\"` confines the reset to `:where([class*=\"tempest_\"])`, so components\n * keep the normalisation they are written against and the app keeps `html`,\n * `body` and `#root`. `\"global\"` is the pre-split behaviour, correct when the\n * SDK owns the whole page. `\"none\"` emits tokens only.\n */\n reset?: ResetMode;\n /**\n * Extra export names to style even when the scan cannot see them β€” a component\n * reached only through a namespace import, or rendered by a sibling package.\n */\n include?: readonly string[];\n /** Directory names to skip. Default: `node_modules`, `dist`, `build`, `coverage`. */\n skipDirs?: readonly string[];\n}\n\n/**\n * Collect the SDK export names a source file imports.\n *\n * Reads the import specifier rather than the JSX, because a bare `<Button>` in the\n * markup says nothing about where it came from β€” the app may well define its own.\n * Type-only bindings are dropped: they are erased before any component renders, so\n * paying for their CSS would be paying for nothing.\n *\n * @param code - File contents.\n * @returns The imported names, or `null` when the file namespace-imports the SDK\n * and the set therefore cannot be known.\n */\nexport function scanStyleImports(code: string): string[] | null {\n const names = new Set<string>();\n\n for (const match of code.matchAll(\n /\\bimport\\s+(type\\s+)?([^;'\"]*?)\\s+from\\s*[\"']([^\"']+)[\"']/g,\n )) {\n const [, typeOnly, clause, specifier] = match;\n if (!SDK_SPECIFIER.test(specifier ?? \"\")) continue;\n if (typeOnly) continue;\n if (/^\\s*\\*\\s+as\\s/.test(clause ?? \"\")) return null;\n\n const braces = /\\{([^}]*)\\}/.exec(clause ?? \"\");\n if (!braces) continue;\n for (const part of (braces[1] ?? \"\").split(\",\")) {\n const binding = part.trim();\n if (!binding || binding.startsWith(\"type \")) continue;\n const name = binding.split(/\\s+as\\s+/)[0]?.trim();\n if (name) names.add(name);\n }\n }\n return [...names];\n}\n\n/**\n * Build the stylesheet for a set of export names.\n *\n * Emits `@import` statements rather than inlined rules so Vite's own CSS pipeline\n * resolves, deduplicates and minifies them β€” the same treatment a hand-written\n * list of imports gets, which is what this replaces.\n *\n * @param names - Export names the app imports, or `null` to take everything.\n * @param manifest - The published style manifest.\n * @returns CSS source.\n */\nexport function buildStyleEntry(\n names: readonly string[] | null,\n manifest: StyleManifest,\n reset: ResetMode = \"scoped\",\n): string {\n const banner = \"/* Generated by tempestStyles() β€” the CSS this app actually uses. */\\n\";\n const foundation =\n reset === \"global\"\n ? [manifest.core]\n : reset === \"scoped\"\n ? [\"tokens.css\", \"scoped.css\"]\n : [\"tokens.css\"];\n\n if (names === null) {\n const whole = reset === \"global\" ? [\"../styles.css\"] : [...foundation, \"../styles.css\"];\n return `${banner}${whole.map((sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`).join(\"\\n\")}\\n`;\n }\n\n const sheets = new Set<string>();\n for (const name of names) {\n for (const sheet of manifest.components[name] ?? []) sheets.add(sheet);\n }\n const lines = [...foundation, ...[...sheets].sort()].map(\n (sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`,\n );\n return `${banner}${lines.join(\"\\n\")}\\n`;\n}\n\n/**\n * Walk a directory and collect every source file path.\n *\n * @param dir - Absolute directory to walk.\n * @param skip - Directory names to skip.\n * @returns Absolute file paths.\n */\nasync function collectSourceFiles(dir: string, skip: ReadonlySet<string>): Promise<string[]> {\n const out: string[] = [];\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return out;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (skip.has(entry.name) || entry.name.startsWith(\".\")) continue;\n out.push(...(await collectSourceFiles(join(dir, entry.name), skip)));\n } else if (entry.isFile() && SOURCE_FILE.test(entry.name)) {\n out.push(join(dir, entry.name));\n }\n }\n return out;\n}\n\n/**\n * Read the style manifest the installed package ships.\n *\n * Resolved by walking the filesystem rather than through `createRequire`, which\n * does not survive the trip: Vite bundles `vite.config.ts` into a temporary module\n * before running it, and in that bundle the `node:module` namespace import comes\n * back without the function β€” `(0, a.createRequire) is not a function`, at load\n * time, inside the build. The same rewrite is why `import.meta.url` is only the\n * fallback here and the app's `node_modules` is tried first.\n *\n * @param root - The Vite root, where the walk for `node_modules` starts.\n * @returns The manifest.\n * @throws If no installed copy carries one β€” an SDK older than the manifest.\n */\nfunction readManifest(root: string): StyleManifest {\n const relative = join(\"tempest-react-sdk\", \"dist\", \"styles\", \"manifest.json\");\n const candidates: string[] = [];\n\n let dir = resolve(root);\n for (;;) {\n candidates.push(join(dir, \"node_modules\", relative));\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n candidates.push(join(dirname(fileURLToPath(import.meta.url)), \"..\", \"styles\", \"manifest.json\"));\n\n for (const candidate of candidates) {\n try {\n return JSON.parse(readFileSync(candidate, \"utf8\")) as StyleManifest;\n } catch {\n continue;\n }\n }\n throw new Error(\n \"tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found β€” \" +\n \"the installed SDK predates it. Upgrade, or drop the plugin and import \" +\n \"tempest-react-sdk/styles.css.\",\n );\n}\n\n/**\n * Import only the SDK stylesheets your app can actually reach.\n *\n * `styles.css` carries every component the SDK ships β€” measured at 236.71 kB raw\n * against the 38.94 kB an app mounting twelve of them can reach. The per-component\n * sheets under `styles/` have always closed that gap, but by hand: the app lists\n * them and keeps the list honest as it grows. This plugin makes the list the build's\n * problem, resolving it from the imports the source already writes.\n *\n * The closure matters more than the scan. A component pays for the CSS of every SDK\n * component it renders internally, so `<DataTable>` alone needs six sheets and\n * `<AIChat>` seven β€” a hand-kept list of one sheet per component the app names is\n * wrong in a way that only shows up as an unstyled child.\n *\n * The reset is the other half, and the half that breaks apps. `styles.css` claims\n * `html`, `body` and `#root`; an app with its own layout that imports it loses its\n * document surface, and an app that drops the import loses the box model its\n * components are written against β€” components render unstyled, which is what the\n * \"just remove the import\" fix actually costs. The default `reset: \"scoped\"` is the\n * third option: the same normalisation, confined to\n * `:where([class*=\"tempest_\"])`, so it reaches inside a Tempest component and\n * nowhere else.\n *\n * `tempest-react-sdk/styles/auto.css` is a real file, so it resolves without the\n * plugin too β€” to the complete sheet. Dropping the plugin costs bytes, never\n * correctness.\n *\n * @param options - Scan configuration.\n * @returns The Vite plugin.\n *\n * @example\n * // vite.config.ts\n * import { createViteConfig, tempestStyles } from \"tempest-react-sdk/vite\";\n *\n * export default createViteConfig({ plugins: [tempestStyles()] });\n *\n * @example\n * // src/main.tsx β€” the one import, instead of a maintained list\n * import \"tempest-react-sdk/styles/auto.css\";\n */\nexport function tempestStyles(options: TempestStylesOptions = {}): TempestVitePlugin {\n const { dir = \"src\", include = [], skipDirs, reset = \"scoped\" } = options;\n const skip = new Set<string>(skipDirs ?? SKIP_DIRS);\n let root = process.cwd();\n let names: string[] | null = [...include];\n\n /**\n * Rescan the source tree, keeping the explicitly included names.\n *\n * @tempest-limits empty-catch β€” the scan races the editor and the file system:\n * a file listed a moment ago can be renamed, deleted, or held by another process\n * by the time it is read. An unreadable file contributes no names and the build\n * continues; failing the whole scan would break `vite dev` over a temp file that\n * no longer exists.\n */\n const rescan = async (): Promise<void> => {\n const found = new Set<string>(include);\n for (const file of await collectSourceFiles(resolve(root, dir), skip)) {\n let code: string;\n try {\n code = await readFile(file, \"utf8\");\n } catch {\n continue;\n }\n const scanned = scanStyleImports(code);\n if (scanned === null) {\n names = null;\n return;\n }\n for (const name of scanned) found.add(name);\n }\n names = [...found];\n };\n\n return {\n name: \"tempest-styles\",\n enforce: \"pre\",\n\n configResolved(config: { root?: string }) {\n root = config.root ?? root;\n },\n\n async buildStart() {\n await rescan();\n },\n\n resolveId(id: string) {\n return id === TEMPEST_STYLES_ID ? RESOLVED_ID : null;\n },\n\n load(id: string) {\n return id === RESOLVED_ID ? buildStyleEntry(names, readManifest(root), reset) : null;\n },\n };\n}\n"],"mappings":";;;;;AAQA,IAAa,IAAoB,qCAE3B,IAAc,6BAGd,IAAgB,oDAEhB,IAAc,mBACd,oBAAY,IAAI,IAAI;CAAC;CAAgB;CAAQ;CAAS;AAAU,CAAC;AAsDvE,SAAgB,EAAiB,GAA+B;CAC5D,IAAM,oBAAQ,IAAI,IAAY;CAE9B,KAAK,IAAM,KAAS,EAAK,SACrB,4DACJ,GAAG;EACC,IAAM,GAAG,GAAU,GAAQ,KAAa;EAExC,IADI,CAAC,EAAc,KAAK,KAAa,EAAE,KACnC,GAAU;EACd,IAAI,gBAAgB,KAAK,KAAU,EAAE,GAAG,OAAO;EAE/C,IAAM,IAAS,cAAc,KAAK,KAAU,EAAE;EACzC,OACL,KAAK,IAAM,MAAS,EAAO,MAAM,GAAA,CAAI,MAAM,GAAG,GAAG;GAC7C,IAAM,IAAU,EAAK,KAAK;GAC1B,IAAI,CAAC,KAAW,EAAQ,WAAW,OAAO,GAAG;GAC7C,IAAM,IAAO,EAAQ,MAAM,UAAU,CAAC,CAAC,EAAE,EAAE,KAAK;GAChD,AAAI,KAAM,EAAM,IAAI,CAAI;EAC5B;CACJ;CACA,OAAO,CAAC,GAAG,CAAK;AACpB;AAaA,SAAgB,EACZ,GACA,GACA,IAAmB,UACb;CACN,IAAM,IAAS,0EACT,IACF,MAAU,WACJ,CAAC,EAAS,IAAI,IACd,MAAU,WACR,CAAC,cAAc,YAAY,IAC3B,CAAC,YAAY;CAEzB,IAAI,MAAU,MAEV,OAAO,GAAG,KADI,MAAU,WAAW,CAAC,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UAAU,eAAe,CAAC;CAE9F,KAAK,IAAM,KAAa,GACpB,IAAI;EACA,OAAO,KAAK,MAAM,EAAa,GAAW,MAAM,CAAC;CACrD,QAAQ;EACJ;CACJ;CAEJ,MAAU,MACN,8KAGJ;AACJ;AA0CA,SAAgB,EAAc,IAAgC,CAAC,GAAsB;CACjF,IAAM,EAAE,SAAM,OAAO,aAAU,CAAC,GAAG,aAAU,WAAQ,aAAa,GAC5D,IAAO,IAAI,IAAY,KAAY,CAAS,GAC9C,IAAO,QAAQ,IAAI,GACnB,IAAyB,CAAC,GAAG,CAAO,GAWlC,IAAS,YAA2B;EACtC,IAAM,IAAQ,IAAI,IAAY,CAAO;EACrC,KAAK,IAAM,KAAQ,MAAM,EAAmB,EAAQ,GAAM,CAAG,GAAG,CAAI,GAAG;GACnE,IAAI;GACJ,IAAI;IACA,IAAO,MAAM,EAAS,GAAM,MAAM;GACtC,QAAQ;IACJ;GACJ;GACA,IAAM,IAAU,EAAiB,CAAI;GACrC,IAAI,MAAY,MAAM;IAClB,IAAQ;IACR;GACJ;GACA,KAAK,IAAM,KAAQ,GAAS,EAAM,IAAI,CAAI;EAC9C;EACA,IAAQ,CAAC,GAAG,CAAK;CACrB;CAEA,OAAO;EACH,MAAM;EACN,SAAS;EAET,eAAe,GAA2B;GACtC,IAAO,EAAO,QAAQ;EAC1B;EAEA,MAAM,aAAa;GACf,MAAM,EAAO;EACjB;EAEA,UAAU,GAAY;GAClB,OAAO,MAAA,sCAA2B,IAAc;EACpD;EAEA,KAAK,GAAY;GACb,OAAO,MAAO,IAAc,EAAgB,GAAO,EAAa,CAAI,GAAG,CAAK,IAAI;EACpF;CACJ;AACJ"}
1
+ {"version":3,"file":"tempest-styles.js","names":[],"sources":["../../src/vite/tempest-styles.ts"],"sourcesContent":["import { readdir, readFile } from \"node:fs/promises\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { narrowTokens } from \"./narrow-tokens\";\nimport type { TempestVitePlugin } from \"./tempest-pwa-manifest\";\n\n/** The stylesheet id an app imports to get exactly the CSS it uses. */\nexport const TEMPEST_STYLES_ID = \"tempest-react-sdk/styles/auto.css\";\n\nconst RESOLVED_ID = \"\\0tempest-styles/auto.css\";\n\n/** Package subpaths whose exports are components with stylesheets. */\nconst SDK_SPECIFIER = /^tempest-react-sdk(\\/(charts|editor|br|icons))?$/;\n\nconst SOURCE_FILE = /\\.[cm]?[jt]sx?$/;\n\n/**\n * The app's own stylesheets, scanned for token reads rather than for imports.\n *\n * An app is documented as free to read `--tempest-*` in CSS of its own, so cutting\n * the token sheet to what the SDK's components reach would drop tokens the app is\n * still reading β€” and a dropped token is not a smaller sheet, it is an unset\n * property. These files contribute reads to the closure and nothing else.\n */\nconst STYLE_FILE = /\\.(css|scss|sass|less)$/;\nconst SKIP_DIRS = new Set([\"node_modules\", \"dist\", \"build\", \"coverage\"]);\n\n/**\n * How much of the reset an app takes.\n *\n * The components are written against the reset β€” `.tempest_button` assumes\n * `button { background: none; border: 0; padding: 0 }`, every width assumes\n * `box-sizing: border-box` β€” so `\"none\"` is not \"unstyled document, styled\n * components\": it is components missing their box model. It exists for the app\n * that already ships an equivalent reset of its own.\n */\nexport type ResetMode = \"scoped\" | \"global\" | \"none\";\n\n/**\n * How much of the token sheet an app takes.\n *\n * `\"used\"` emits only the tokens the selected stylesheets β€” and the app's own CSS β€”\n * can reach, following token-to-token references. `\"all\"` emits `tokens.css` whole,\n * which is what to reach for when the app names tokens somewhere the scan cannot\n * see: a token read from a CSS-in-JS library, a sibling package's stylesheet, a\n * `<style>` block in `index.html`.\n */\nexport type TokenMode = \"used\" | \"all\";\n\n/** Shape of `dist/styles/manifest.json`. */\nexport interface StyleManifest {\n /** The foundation sheet β€” tokens and reset together, the pre-split default. */\n core: string;\n /** Public export name β†’ the stylesheets it needs, transitive closure included. */\n components: Record<string, readonly string[]>;\n}\n\nexport interface TempestStylesOptions {\n /** Directory to scan, relative to the Vite root. Default: `\"src\"`. */\n dir?: string;\n /**\n * Which reset to emit alongside the tokens. Default: `\"scoped\"`.\n *\n * `\"scoped\"` confines the reset to `:where([class*=\"tempest_\"])`, so components\n * keep the normalisation they are written against and the app keeps `html`,\n * `body` and `#root`. `\"global\"` is the pre-split behaviour, correct when the\n * SDK owns the whole page. `\"none\"` emits tokens only.\n */\n reset?: ResetMode;\n /**\n * Extra export names to style even when the scan cannot see them β€” a component\n * reached only through a namespace import, or rendered by a sibling package.\n */\n include?: readonly string[];\n /** Directory names to skip. Default: `node_modules`, `dist`, `build`, `coverage`. */\n skipDirs?: readonly string[];\n /**\n * How much of the token sheet to emit. Default: `\"used\"`.\n *\n * The default falls back to the whole sheet on its own whenever a token name is\n * assembled at runtime (`` `var(--tempest-${tone})` ``), so `\"all\"` is for the\n * case the scan cannot see at all β€” a token read from outside `dir`.\n */\n tokens?: TokenMode;\n}\n\n/**\n * Collect the SDK export names a source file imports.\n *\n * Reads the import specifier rather than the JSX, because a bare `<Button>` in the\n * markup says nothing about where it came from β€” the app may well define its own.\n * Type-only bindings are dropped: they are erased before any component renders, so\n * paying for their CSS would be paying for nothing.\n *\n * @param code - File contents.\n * @returns The imported names, or `null` when the file namespace-imports the SDK\n * and the set therefore cannot be known.\n */\nexport function scanStyleImports(code: string): string[] | null {\n const names = new Set<string>();\n\n for (const match of code.matchAll(\n /\\bimport\\s+(type\\s+)?([^;'\"]*?)\\s+from\\s*[\"']([^\"']+)[\"']/g,\n )) {\n const [, typeOnly, clause, specifier] = match;\n if (!SDK_SPECIFIER.test(specifier ?? \"\")) continue;\n if (typeOnly) continue;\n if (/^\\s*\\*\\s+as\\s/.test(clause ?? \"\")) return null;\n\n const braces = /\\{([^}]*)\\}/.exec(clause ?? \"\");\n if (!braces) continue;\n for (const part of (braces[1] ?? \"\").split(\",\")) {\n const binding = part.trim();\n if (!binding || binding.startsWith(\"type \")) continue;\n const name = binding.split(/\\s+as\\s+/)[0]?.trim();\n if (name) names.add(name);\n }\n }\n return [...names];\n}\n\n/**\n * Build the stylesheet for a set of export names.\n *\n * Emits `@import` statements rather than inlined rules so Vite's own CSS pipeline\n * resolves, deduplicates and minifies them β€” the same treatment a hand-written\n * list of imports gets, which is what this replaces.\n *\n * The narrowed token block is the exception, and it goes last for a reason the\n * cascade does not explain: `@import` is only valid before any rule, so a token\n * block written above the imports would make every one of them invalid and the\n * components would arrive with no CSS at all. Putting it last is safe because the\n * block declares custom properties and nothing else β€” resolving `var()` does not\n * depend on where in the document the declaration sits, only on which selector\n * wins, and no component sheet declares a token to compete with.\n *\n * @param names - Export names the app imports, or `null` to take everything.\n * @param manifest - The published style manifest.\n * @param reset - How much of the reset to emit.\n * @param tokenBlock - The narrowed token sheet, or `null` to `@import` it whole.\n * @returns CSS source.\n */\nexport function buildStyleEntry(\n names: readonly string[] | null,\n manifest: StyleManifest,\n reset: ResetMode = \"scoped\",\n tokenBlock: string | null = null,\n): string {\n const banner = \"/* Generated by tempestStyles() β€” the CSS this app actually uses. */\\n\";\n const tokenSheets = tokenBlock === null ? [\"tokens.css\"] : [];\n const foundation =\n reset === \"global\"\n ? tokenBlock === null\n ? [manifest.core]\n : [...tokenSheets, \"base.css\"]\n : reset === \"scoped\"\n ? [...tokenSheets, \"scoped.css\"]\n : tokenSheets;\n\n const trailer = tokenBlock === null ? \"\" : `${tokenBlock}\\n`;\n\n if (names === null) {\n const whole =\n reset === \"global\"\n ? [manifest.core, \"../styles.css\"]\n : [...foundation, \"../styles.css\"];\n return `${banner}${whole.map((sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`).join(\"\\n\")}\\n${trailer}`;\n }\n\n const sheets = new Set<string>();\n for (const name of names) {\n for (const sheet of manifest.components[name] ?? []) sheets.add(sheet);\n }\n const lines = [...foundation, ...[...sheets].sort()].map(\n (sheet) => `@import \"tempest-react-sdk/styles/${sheet}\";`,\n );\n return `${banner}${lines.join(\"\\n\")}\\n${trailer}`;\n}\n\n/**\n * The stylesheets an entry will load, by name, for the token closure to read.\n *\n * @param names - Export names the app imports, or `null` when unknowable.\n * @param manifest - The published style manifest.\n * @param reset - How much of the reset to emit.\n * @returns Stylesheet file names under `dist/styles/`.\n */\nexport function selectedSheets(\n names: readonly string[] | null,\n manifest: StyleManifest,\n reset: ResetMode,\n): string[] {\n if (names === null) return [\"../styles.css\"];\n const sheets = new Set<string>();\n if (reset === \"scoped\") sheets.add(\"scoped.css\");\n if (reset === \"global\") sheets.add(\"base.css\");\n for (const name of names) {\n for (const sheet of manifest.components[name] ?? []) sheets.add(sheet);\n }\n return [...sheets].sort();\n}\n\n/**\n * Walk a directory and collect every source and stylesheet path.\n *\n * @param dir - Absolute directory to walk.\n * @param skip - Directory names to skip.\n * @returns Absolute file paths.\n */\nasync function collectSourceFiles(dir: string, skip: ReadonlySet<string>): Promise<string[]> {\n const out: string[] = [];\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return out;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (skip.has(entry.name) || entry.name.startsWith(\".\")) continue;\n out.push(...(await collectSourceFiles(join(dir, entry.name), skip)));\n } else if (\n entry.isFile() &&\n (SOURCE_FILE.test(entry.name) || STYLE_FILE.test(entry.name))\n ) {\n out.push(join(dir, entry.name));\n }\n }\n return out;\n}\n\n/**\n * Read the style manifest the installed package ships.\n *\n * Resolved by walking the filesystem rather than through `createRequire`, which\n * does not survive the trip: Vite bundles `vite.config.ts` into a temporary module\n * before running it, and in that bundle the `node:module` namespace import comes\n * back without the function β€” `(0, a.createRequire) is not a function`, at load\n * time, inside the build. The same rewrite is why `import.meta.url` is only the\n * fallback here and the app's `node_modules` is tried first.\n *\n * @param root - The Vite root, where the walk for `node_modules` starts.\n * @returns The manifest and the directory it was read from, which is also where the\n * stylesheets it names live.\n * @throws If no installed copy carries one β€” an SDK older than the manifest.\n */\nfunction readManifest(root: string): { manifest: StyleManifest; dir: string } {\n const relative = join(\"tempest-react-sdk\", \"dist\", \"styles\", \"manifest.json\");\n const candidates: string[] = [];\n\n let dir = resolve(root);\n for (;;) {\n candidates.push(join(dir, \"node_modules\", relative));\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n candidates.push(join(dirname(fileURLToPath(import.meta.url)), \"..\", \"styles\", \"manifest.json\"));\n\n for (const candidate of candidates) {\n try {\n const manifest = JSON.parse(readFileSync(candidate, \"utf8\")) as StyleManifest;\n return { manifest, dir: dirname(candidate) };\n } catch {\n continue;\n }\n }\n throw new Error(\n \"tempestStyles(): tempest-react-sdk/dist/styles/manifest.json not found β€” \" +\n \"the installed SDK predates it. Upgrade, or drop the plugin and import \" +\n \"tempest-react-sdk/styles.css.\",\n );\n}\n\n/**\n * Import only the SDK stylesheets your app can actually reach.\n *\n * `styles.css` carries every component the SDK ships β€” measured at 236.71 kB raw\n * against the 38.94 kB an app mounting twelve of them can reach. The per-component\n * sheets under `styles/` have always closed that gap, but by hand: the app lists\n * them and keeps the list honest as it grows. This plugin makes the list the build's\n * problem, resolving it from the imports the source already writes.\n *\n * The closure matters more than the scan. A component pays for the CSS of every SDK\n * component it renders internally, so `<DataTable>` alone needs six sheets and\n * `<AIChat>` seven β€” a hand-kept list of one sheet per component the app names is\n * wrong in a way that only shows up as an unstyled child.\n *\n * The reset is the other half, and the half that breaks apps. `styles.css` claims\n * `html`, `body` and `#root`; an app with its own layout that imports it loses its\n * document surface, and an app that drops the import loses the box model its\n * components are written against β€” components render unstyled, which is what the\n * \"just remove the import\" fix actually costs. The default `reset: \"scoped\"` is the\n * third option: the same normalisation, confined to\n * `:where([class*=\"tempest_\"])`, so it reaches inside a Tempest component and\n * nowhere else.\n *\n * `tempest-react-sdk/styles/auto.css` is a real file, so it resolves without the\n * plugin too β€” to the complete sheet. Dropping the plugin costs bytes, never\n * correctness.\n *\n * @param options - Scan configuration.\n * @returns The Vite plugin.\n *\n * @example\n * // vite.config.ts\n * import { createViteConfig, tempestStyles } from \"tempest-react-sdk/vite\";\n *\n * export default createViteConfig({ plugins: [tempestStyles()] });\n *\n * @example\n * // src/main.tsx β€” the one import, instead of a maintained list\n * import \"tempest-react-sdk/styles/auto.css\";\n */\nexport function tempestStyles(options: TempestStylesOptions = {}): TempestVitePlugin {\n const { dir = \"src\", include = [], skipDirs, reset = \"scoped\", tokens = \"used\" } = options;\n const skip = new Set<string>(skipDirs ?? SKIP_DIRS);\n let root = process.cwd();\n let names: string[] | null = [...include];\n let appStyleUsage = \"\";\n\n /**\n * Rescan the source tree, keeping the explicitly included names.\n *\n * @tempest-limits empty-catch β€” the scan races the editor and the file system:\n * a file listed a moment ago can be renamed, deleted, or held by another process\n * by the time it is read. An unreadable file contributes no names and the build\n * continues; failing the whole scan would break `vite dev` over a temp file that\n * no longer exists.\n */\n const rescan = async (): Promise<void> => {\n const found = new Set<string>(include);\n const usage: string[] = [];\n let namespaced = false;\n for (const file of await collectSourceFiles(resolve(root, dir), skip)) {\n let code: string;\n try {\n code = await readFile(file, \"utf8\");\n } catch {\n continue;\n }\n if (code.includes(\"--tempest-\")) usage.push(code);\n if (STYLE_FILE.test(file)) continue;\n const scanned = scanStyleImports(code);\n if (scanned === null) namespaced = true;\n else for (const name of scanned) found.add(name);\n }\n appStyleUsage = usage.join(\"\\n\");\n names = namespaced ? null : [...found];\n };\n\n /**\n * The token block for this build, or `null` to `@import` the whole sheet.\n *\n * Reads the stylesheets the entry is about to load and closes over the tokens\n * they consult, plus the ones the app's own CSS consults. Any read it cannot\n * resolve statically β€” a name assembled at runtime, an unreadable sheet, a\n * package too old to ship `tokens.css` β€” returns `null`, which costs bytes and\n * never correctness. Serving a token sheet with a hole in it would do the\n * opposite.\n *\n * @param manifest - The published style manifest.\n * @param styleDir - Directory the manifest and its stylesheets live in.\n * @returns The narrowed sheet, or `null`.\n */\n const narrowedTokens = (manifest: StyleManifest, styleDir: string): string | null => {\n if (tokens === \"all\" || names === null) return null;\n let tokensCss: string;\n try {\n tokensCss = readFileSync(join(styleDir, \"tokens.css\"), \"utf8\");\n } catch {\n return null;\n }\n const parts: string[] = [appStyleUsage];\n for (const sheet of selectedSheets(names, manifest, reset)) {\n try {\n parts.push(readFileSync(join(styleDir, sheet), \"utf8\"));\n } catch {\n return null;\n }\n }\n return narrowTokens(tokensCss, parts.join(\"\\n\"));\n };\n\n return {\n name: \"tempest-styles\",\n enforce: \"pre\",\n\n configResolved(config: { root?: string }) {\n root = config.root ?? root;\n },\n\n async buildStart() {\n await rescan();\n },\n\n resolveId(id: string) {\n return id === TEMPEST_STYLES_ID ? RESOLVED_ID : null;\n },\n\n load(id: string) {\n if (id !== RESOLVED_ID) return null;\n const { manifest, dir: styleDir } = readManifest(root);\n return buildStyleEntry(names, manifest, reset, narrowedTokens(manifest, styleDir));\n },\n };\n}\n"],"mappings":";;;;;;AASA,IAAa,IAAoB,qCAE3B,IAAc,6BAGd,IAAgB,oDAEhB,IAAc,mBAUd,IAAa,2BACb,oBAAY,IAAI,IAAI;CAAC;CAAgB;CAAQ;CAAS;AAAU,CAAC;AAyEvE,SAAgB,EAAiB,GAA+B;CAC5D,IAAM,oBAAQ,IAAI,IAAY;CAE9B,KAAK,IAAM,KAAS,EAAK,SACrB,4DACJ,GAAG;EACC,IAAM,GAAG,GAAU,GAAQ,KAAa;EAExC,IADI,CAAC,EAAc,KAAK,KAAa,EAAE,KACnC,GAAU;EACd,IAAI,gBAAgB,KAAK,KAAU,EAAE,GAAG,OAAO;EAE/C,IAAM,IAAS,cAAc,KAAK,KAAU,EAAE;EACzC,OACL,KAAK,IAAM,MAAS,EAAO,MAAM,GAAA,CAAI,MAAM,GAAG,GAAG;GAC7C,IAAM,IAAU,EAAK,KAAK;GAC1B,IAAI,CAAC,KAAW,EAAQ,WAAW,OAAO,GAAG;GAC7C,IAAM,IAAO,EAAQ,MAAM,UAAU,CAAC,CAAC,EAAE,EAAE,KAAK;GAChD,AAAI,KAAM,EAAM,IAAI,CAAI;EAC5B;CACJ;CACA,OAAO,CAAC,GAAG,CAAK;AACpB;AAuBA,SAAgB,EACZ,GACA,GAC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"}
package/dist/vite.d.ts CHANGED
@@ -330,6 +330,14 @@ export declare interface TempestStylesOptions {
330
330
  include?: readonly string[];
331
331
  /** Directory names to skip. Default: `node_modules`, `dist`, `build`, `coverage`. */
332
332
  skipDirs?: readonly string[];
333
+ /**
334
+ * How much of the token sheet to emit. Default: `"used"`.
335
+ *
336
+ * The default falls back to the whole sheet on its own whenever a token name is
337
+ * assembled at runtime (`` `var(--tempest-${tone})` ``), so `"all"` is for the
338
+ * case the scan cannot see at all β€” a token read from outside `dir`.
339
+ */
340
+ tokens?: TokenMode;
333
341
  }
334
342
 
335
343
  /**
@@ -348,4 +356,15 @@ export declare type TempestVitePlugin = {
348
356
  name: string;
349
357
  } & Record<string, unknown>;
350
358
 
359
+ /**
360
+ * How much of the token sheet an app takes.
361
+ *
362
+ * `"used"` emits only the tokens the selected stylesheets β€” and the app's own CSS β€”
363
+ * can reach, following token-to-token references. `"all"` emits `tokens.css` whole,
364
+ * which is what to reach for when the app names tokens somewhere the scan cannot
365
+ * see: a token read from a CSS-in-JS library, a sibling package's stylesheet, a
366
+ * `<style>` block in `index.html`.
367
+ */
368
+ export declare type TokenMode = "used" | "all";
369
+
351
370
  export { }
@@ -1,2 +1,2 @@
1
- const e=require("../utils/json-frame.cjs"),t=require("./resilience.cjs");function n(n,r={}){let{protocols:i,maxRetries:a=10,initialBackoff:o=1e3,maxBackoff:s=3e4,jitter:ee=.3,handshakeTimeout:c=8e3,silenceTimeout:l=0,waitForOnline:u=!0,pingInterval:d=0,pingPayload:f=JSON.stringify({type:`ping`}),respondToPing:p=!0,pongPayload:m=JSON.stringify({type:`pong`}),queueWhileClosed:h=!1,maxQueuedMessages:te=100,parser:ne,onOpen:g,onMessage:_,onClose:v,onError:y,onParseError:b,onStatusChange:re,onReconnecting:ie,onReconnected:x,onLost:S}=r,C=null,w=null,T=null,E=null,D=null,O=null,k=l,A=0,j=`idle`,M=!1,N=!1,P=[],F=null,I=null,L=new Promise((e,t)=>{F=e,I=t});L.catch(()=>void 0);function R(e){return typeof e==`object`&&!!e&&e.type===`ping`}function z(e){for(;P.length>0&&e.readyState===WebSocket.OPEN;)e.send(P.shift())}function B(e){j!==e&&(j=e,re?.(e))}function V(){T&&=(clearInterval(T),null)}function H(){E&&=(clearTimeout(E),null)}function U(){D&&=(clearTimeout(D),null)}function W(){!d||d<=0||(V(),T=setInterval(()=>{C?.readyState===WebSocket.OPEN&&C.send(f)},d))}function G(){U(),!(M||k<=0)&&(D=setTimeout(K,k))}function K(){U(),!M&&C&&(J(C),C=null,B(`closed`),X())}function q(e){H(),!(M||e.readyState!==WebSocket.CONNECTING)&&(J(e),C===e&&(C=null),B(`closed`),X())}function J(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null;try{e.close()}catch{}}function Y(e){if(U(),H(),Z(),e===`rejected`&&(M=!0),B(`error`),!N&&I){let t=I;I=null,F=null,t(Error(`websocket_${e}`))}S?.(e)}function X(){if(M)return;if(A>=a){Y(`exhausted`);return}let e=t.backoffDelay(A,{initialBackoff:o,maxBackoff:s,jitter:ee});if(A+=1,ie?.(A,a),u&&typeof navigator<`u`&&navigator.onLine===!1){ae();return}w=setTimeout(Q,e)}function ae(){if(O||typeof window>`u`)return;let e=()=>{Z(),M||Q()};O=e,window.addEventListener(`online`,e)}function Z(){!O||typeof window>`u`||(window.removeEventListener(`online`,O),O=null)}function Q(){if(M)return;if(w=null,H(),C){let e=C;e.onmessage=null,e.onclose=null,e.onerror=null,e.readyState!==WebSocket.CONNECTING&&(e.onopen=null),$(e)}B(`connecting`);let r=new WebSocket(n,i);C=r,c>0&&(E=setTimeout(()=>q(r),c)),r.onopen=e=>{H();let t=A>0;if(A=0,N=!0,B(`open`),W(),G(),z(r),F){let e=F;F=null,I=null,e()}g?.(e),t&&x?.()},r.onmessage=t=>{G();let n=typeof t.data==`string`?t.data:``,i=e.decodeFrame(n,ne,b,`createWebSocket`);if(!i.delivered)return;let a=i.data;p&&R(a)&&r.readyState===WebSocket.OPEN&&r.send(m),_?.({data:a,raw:t})},r.onerror=e=>{y?.(e)},r.onclose=e=>{if(H(),V(),U(),v?.(e),C=null,B(`closed`),!M){if(t.isRejectionCloseCode(e.code)){Y(`rejected`);return}if(t.shouldRetryClose(e.code,e.wasClean)){X();return}N||Y(`rejected`)}}}function oe(e){return C?.readyState===WebSocket.OPEN?(C.send(e),!0):!h||M?!1:(P.length>=te&&P.shift(),P.push(e),!0)}function se(e,t){if(M=!0,w&&=(clearTimeout(w),null),V(),H(),U(),Z(),A=0,P.length=0,I){let e=I;I=null,F=null,e(Error(`websocket_closed`))}C&&=(B(`closing`),$(C,e,t),null),B(`closed`)}function $(e,t,n){if(e.readyState===WebSocket.CONNECTING){e.onopen=()=>e.close(t,n),e.onmessage=null,e.onerror=null,e.onclose=null;return}e.close(t,n)}function ce(){w&&=(clearTimeout(w),null),Z(),A=0,M=!1,Q()}function le(e){k=Number.isFinite(e)&&e>0?e:0,C?.readyState===WebSocket.OPEN?G():U()}return Q(),{send:oe,close:se,reconnect:ce,setSilenceTimeout:le,opened:L,get status(){return j}}}exports.createWebSocket=n;
1
+ const e=require("../utils/json-frame.cjs"),t=require("./resilience.cjs");function n(n,r={}){let{protocols:i,maxRetries:a=10,initialBackoff:o=1e3,maxBackoff:s=3e4,jitter:ee=.3,handshakeTimeout:c=8e3,silenceTimeout:l=0,waitForOnline:u=!0,pingInterval:d=0,pingPayload:f=JSON.stringify({type:`ping`}),respondToPing:p=!0,pongPayload:m=JSON.stringify({type:`pong`}),queueWhileClosed:h=!1,maxQueuedMessages:te=100,parser:ne,onOpen:g,onMessage:_,onClose:v,onError:y,onParseError:b,schema:re,onValidationError:ie,onStatusChange:ae,onReconnecting:x,onReconnected:S,onLost:C}=r,w=null,T=null,E=null,D=null,O=null,k=null,A=l,j=0,M=`idle`,N=!1,P=!1,F=[],I=null,L=null,R=new Promise((e,t)=>{I=e,L=t});R.catch(()=>void 0);function z(e){return typeof e==`object`&&!!e&&e.type===`ping`}function B(e){if(!e.includes(`"ping"`))return!1;try{return z(JSON.parse(e))}catch{return!1}}function V(e){for(;F.length>0&&e.readyState===WebSocket.OPEN;)e.send(F.shift())}function H(e){M!==e&&(M=e,ae?.(e))}function U(){E&&=(clearInterval(E),null)}function W(){D&&=(clearTimeout(D),null)}function G(){O&&=(clearTimeout(O),null)}function K(){!d||d<=0||(U(),E=setInterval(()=>{w?.readyState===WebSocket.OPEN&&w.send(f)},d))}function q(){G(),!(N||A<=0)&&(O=setTimeout(oe,A))}function oe(){G(),!N&&w&&(J(w),w=null,H(`closed`),X())}function se(e){W(),!(N||e.readyState!==WebSocket.CONNECTING)&&(J(e),w===e&&(w=null),H(`closed`),X())}function J(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null;try{e.close()}catch{}}function Y(e){if(G(),W(),Z(),e===`rejected`&&(N=!0),H(`error`),!P&&L){let t=L;L=null,I=null,t(Error(`websocket_${e}`))}C?.(e)}function X(){if(N)return;if(j>=a){Y(`exhausted`);return}let e=t.backoffDelay(j,{initialBackoff:o,maxBackoff:s,jitter:ee});if(j+=1,x?.(j,a),u&&typeof navigator<`u`&&navigator.onLine===!1){ce();return}T=setTimeout(Q,e)}function ce(){if(k||typeof window>`u`)return;let e=()=>{Z(),N||Q()};k=e,window.addEventListener(`online`,e)}function Z(){!k||typeof window>`u`||(window.removeEventListener(`online`,k),k=null)}function Q(){if(N)return;if(T=null,W(),w){let e=w;e.onmessage=null,e.onclose=null,e.onerror=null,e.readyState!==WebSocket.CONNECTING&&(e.onopen=null),$(e)}H(`connecting`);let r=new WebSocket(n,i);w=r,c>0&&(D=setTimeout(()=>se(r),c)),r.onopen=e=>{W();let t=j>0;if(j=0,P=!0,H(`open`),K(),q(),V(r),I){let e=I;I=null,L=null,e()}g?.(e),t&&S?.()},r.onmessage=t=>{q();let n=typeof t.data==`string`?t.data:``,i=e.decodeFrame(n,`createWebSocket`,{parser:ne,onParseError:b,schema:re,onValidationError:ie});if(!i.delivered){p&&r.readyState===WebSocket.OPEN&&B(n)&&r.send(m);return}let a=i.data;p&&z(a)&&r.readyState===WebSocket.OPEN&&r.send(m),_?.({data:a,raw:t})},r.onerror=e=>{y?.(e)},r.onclose=e=>{if(W(),U(),G(),v?.(e),w=null,H(`closed`),!N){if(t.isRejectionCloseCode(e.code)){Y(`rejected`);return}if(t.shouldRetryClose(e.code,e.wasClean)){X();return}P||Y(`rejected`)}}}function le(e){return w?.readyState===WebSocket.OPEN?(w.send(e),!0):!h||N?!1:(F.length>=te&&F.shift(),F.push(e),!0)}function ue(e,t){if(N=!0,T&&=(clearTimeout(T),null),U(),W(),G(),Z(),j=0,F.length=0,L){let e=L;L=null,I=null,e(Error(`websocket_closed`))}w&&=(H(`closing`),$(w,e,t),null),H(`closed`)}function $(e,t,n){if(e.readyState===WebSocket.CONNECTING){e.onopen=()=>e.close(t,n),e.onmessage=null,e.onerror=null,e.onclose=null;return}e.close(t,n)}function de(){T&&=(clearTimeout(T),null),Z(),j=0,N=!1,Q()}function fe(e){A=Number.isFinite(e)&&e>0?e:0,w?.readyState===WebSocket.OPEN?q():G()}return Q(),{send:le,close:ue,reconnect:de,setSilenceTimeout:fe,opened:R,get status(){return M}}}exports.createWebSocket=n;
2
2
  //# sourceMappingURL=create-web-socket.cjs.map