tempest-react-sdk 0.24.0 → 0.26.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 (403) hide show
  1. package/README.md +25 -4
  2. package/bin/lib/alias/collect.mjs +94 -0
  3. package/bin/lib/alias/collect.test.mjs +95 -0
  4. package/bin/lib/alias/discover.mjs +77 -0
  5. package/bin/lib/alias/discover.test.mjs +189 -0
  6. package/bin/lib/alias/index.mjs +88 -0
  7. package/bin/lib/alias/index.test.mjs +138 -0
  8. package/bin/lib/alias/rewrite-css.mjs +76 -0
  9. package/bin/lib/alias/rewrite-css.test.mjs +85 -0
  10. package/bin/lib/alias/rewrite.mjs +141 -0
  11. package/bin/lib/alias/rewrite.test.mjs +148 -0
  12. package/bin/lib/alias/specifier.mjs +49 -0
  13. package/bin/lib/alias/specifier.test.mjs +85 -0
  14. package/bin/lib/alias/tsconfig.mjs +116 -0
  15. package/bin/lib/alias/typescript.mjs +23 -0
  16. package/bin/lib/icons/generate.mjs +156 -0
  17. package/bin/lib/icons/generate.test.mjs +125 -0
  18. package/bin/tempest.mjs +158 -13
  19. package/dist/audio/use-audio.cjs +1 -1
  20. package/dist/audio/use-audio.cjs.map +1 -1
  21. package/dist/audio/use-audio.js +12 -12
  22. package/dist/audio/use-audio.js.map +1 -1
  23. package/dist/charts/AreaChart.cjs +1 -1
  24. package/dist/charts/AreaChart.cjs.map +1 -1
  25. package/dist/charts/AreaChart.js +7 -7
  26. package/dist/charts/AreaChart.js.map +1 -1
  27. package/dist/charts/BarChart.cjs +1 -1
  28. package/dist/charts/BarChart.cjs.map +1 -1
  29. package/dist/charts/BarChart.js +7 -7
  30. package/dist/charts/BarChart.js.map +1 -1
  31. package/dist/charts/LineChart.cjs +1 -1
  32. package/dist/charts/LineChart.cjs.map +1 -1
  33. package/dist/charts/LineChart.js +6 -6
  34. package/dist/charts/LineChart.js.map +1 -1
  35. package/dist/charts/PieChart.cjs +1 -1
  36. package/dist/charts/PieChart.cjs.map +1 -1
  37. package/dist/charts/PieChart.js +6 -6
  38. package/dist/charts/PieChart.js.map +1 -1
  39. package/dist/charts/RadarChart.cjs +1 -1
  40. package/dist/charts/RadarChart.cjs.map +1 -1
  41. package/dist/charts/RadarChart.js +6 -6
  42. package/dist/charts/RadarChart.js.map +1 -1
  43. package/dist/charts/palette.cjs +1 -1
  44. package/dist/charts/palette.cjs.map +1 -1
  45. package/dist/charts/palette.js +19 -2
  46. package/dist/charts/palette.js.map +1 -1
  47. package/dist/charts/use-chart-colors.cjs +2 -0
  48. package/dist/charts/use-chart-colors.cjs.map +1 -0
  49. package/dist/charts/use-chart-colors.js +29 -0
  50. package/dist/charts/use-chart-colors.js.map +1 -0
  51. package/dist/charts.cjs +1 -1
  52. package/dist/charts.d.ts +61 -10
  53. package/dist/charts.js +8 -7
  54. package/dist/components/AvatarGroup/AvatarGroup.cjs +2 -0
  55. package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -0
  56. package/dist/components/AvatarGroup/AvatarGroup.js +39 -0
  57. package/dist/components/AvatarGroup/AvatarGroup.js.map +1 -0
  58. package/dist/components/AvatarGroup/AvatarGroup.module.cjs +2 -0
  59. package/dist/components/AvatarGroup/AvatarGroup.module.cjs.map +1 -0
  60. package/dist/components/AvatarGroup/AvatarGroup.module.js +16 -0
  61. package/dist/components/AvatarGroup/AvatarGroup.module.js.map +1 -0
  62. package/dist/components/ClickOutside/ClickOutside.cjs +1 -1
  63. package/dist/components/ClickOutside/ClickOutside.cjs.map +1 -1
  64. package/dist/components/ClickOutside/ClickOutside.js +3 -1
  65. package/dist/components/ClickOutside/ClickOutside.js.map +1 -1
  66. package/dist/components/DataTable/DataTable.cjs +1 -1
  67. package/dist/components/DataTable/DataTable.cjs.map +1 -1
  68. package/dist/components/DataTable/DataTable.js +21 -23
  69. package/dist/components/DataTable/DataTable.js.map +1 -1
  70. package/dist/components/Kanban/Kanban.cjs +2 -0
  71. package/dist/components/Kanban/Kanban.cjs.map +1 -0
  72. package/dist/components/Kanban/Kanban.js +102 -0
  73. package/dist/components/Kanban/Kanban.js.map +1 -0
  74. package/dist/components/Kanban/Kanban.module.cjs +2 -0
  75. package/dist/components/Kanban/Kanban.module.cjs.map +1 -0
  76. package/dist/components/Kanban/Kanban.module.js +19 -0
  77. package/dist/components/Kanban/Kanban.module.js.map +1 -0
  78. package/dist/components/Lightbox/Lightbox.cjs +2 -0
  79. package/dist/components/Lightbox/Lightbox.cjs.map +1 -0
  80. package/dist/components/Lightbox/Lightbox.js +148 -0
  81. package/dist/components/Lightbox/Lightbox.js.map +1 -0
  82. package/dist/components/Lightbox/Lightbox.module.cjs +2 -0
  83. package/dist/components/Lightbox/Lightbox.module.cjs.map +1 -0
  84. package/dist/components/Lightbox/Lightbox.module.js +21 -0
  85. package/dist/components/Lightbox/Lightbox.module.js.map +1 -0
  86. package/dist/components/NotificationCenter/NotificationCenter.cjs +2 -0
  87. package/dist/components/NotificationCenter/NotificationCenter.cjs.map +1 -0
  88. package/dist/components/NotificationCenter/NotificationCenter.js +83 -0
  89. package/dist/components/NotificationCenter/NotificationCenter.js.map +1 -0
  90. package/dist/components/NotificationCenter/NotificationCenter.module.cjs +2 -0
  91. package/dist/components/NotificationCenter/NotificationCenter.module.cjs.map +1 -0
  92. package/dist/components/NotificationCenter/NotificationCenter.module.js +21 -0
  93. package/dist/components/NotificationCenter/NotificationCenter.module.js.map +1 -0
  94. package/dist/components/NotificationCenter/use-notification-inbox.cjs +2 -0
  95. package/dist/components/NotificationCenter/use-notification-inbox.cjs.map +1 -0
  96. package/dist/components/NotificationCenter/use-notification-inbox.js +63 -0
  97. package/dist/components/NotificationCenter/use-notification-inbox.js.map +1 -0
  98. package/dist/components/RefreshIndicator/RefreshIndicator.cjs +1 -1
  99. package/dist/components/RefreshIndicator/RefreshIndicator.cjs.map +1 -1
  100. package/dist/components/RefreshIndicator/RefreshIndicator.js +17 -17
  101. package/dist/components/RefreshIndicator/RefreshIndicator.js.map +1 -1
  102. package/dist/components/SignaturePad/SignaturePad.cjs +2 -0
  103. package/dist/components/SignaturePad/SignaturePad.cjs.map +1 -0
  104. package/dist/components/SignaturePad/SignaturePad.js +115 -0
  105. package/dist/components/SignaturePad/SignaturePad.js.map +1 -0
  106. package/dist/components/SignaturePad/SignaturePad.module.cjs +2 -0
  107. package/dist/components/SignaturePad/SignaturePad.module.cjs.map +1 -0
  108. package/dist/components/SignaturePad/SignaturePad.module.js +11 -0
  109. package/dist/components/SignaturePad/SignaturePad.module.js.map +1 -0
  110. package/dist/components/Stepper/Stepper.cjs +1 -1
  111. package/dist/components/Stepper/Stepper.cjs.map +1 -1
  112. package/dist/components/Stepper/Stepper.js +43 -19
  113. package/dist/components/Stepper/Stepper.js.map +1 -1
  114. package/dist/components/Stepper/Stepper.module.cjs +1 -1
  115. package/dist/components/Stepper/Stepper.module.cjs.map +1 -1
  116. package/dist/components/Stepper/Stepper.module.js +6 -3
  117. package/dist/components/Stepper/Stepper.module.js.map +1 -1
  118. package/dist/components/Tooltip/Tooltip.cjs +1 -1
  119. package/dist/components/Tooltip/Tooltip.cjs.map +1 -1
  120. package/dist/components/Tooltip/Tooltip.js +26 -20
  121. package/dist/components/Tooltip/Tooltip.js.map +1 -1
  122. package/dist/components/TreeView/TreeView.cjs +2 -0
  123. package/dist/components/TreeView/TreeView.cjs.map +1 -0
  124. package/dist/components/TreeView/TreeView.js +124 -0
  125. package/dist/components/TreeView/TreeView.js.map +1 -0
  126. package/dist/components/TreeView/TreeView.module.cjs +2 -0
  127. package/dist/components/TreeView/TreeView.module.cjs.map +1 -0
  128. package/dist/components/TreeView/TreeView.module.js +17 -0
  129. package/dist/components/TreeView/TreeView.module.js.map +1 -0
  130. package/dist/components/VirtualTable/VirtualTable.cjs +2 -0
  131. package/dist/components/VirtualTable/VirtualTable.cjs.map +1 -0
  132. package/dist/components/VirtualTable/VirtualTable.js +116 -0
  133. package/dist/components/VirtualTable/VirtualTable.js.map +1 -0
  134. package/dist/components/VirtualTable/VirtualTable.module.cjs +2 -0
  135. package/dist/components/VirtualTable/VirtualTable.module.cjs.map +1 -0
  136. package/dist/components/VirtualTable/VirtualTable.module.js +20 -0
  137. package/dist/components/VirtualTable/VirtualTable.module.js.map +1 -0
  138. package/dist/components/Wizard/Wizard.cjs +2 -0
  139. package/dist/components/Wizard/Wizard.cjs.map +1 -0
  140. package/dist/components/Wizard/Wizard.js +111 -0
  141. package/dist/components/Wizard/Wizard.js.map +1 -0
  142. package/dist/components/Wizard/Wizard.module.cjs +2 -0
  143. package/dist/components/Wizard/Wizard.module.cjs.map +1 -0
  144. package/dist/components/Wizard/Wizard.module.js +10 -0
  145. package/dist/components/Wizard/Wizard.module.js.map +1 -0
  146. package/dist/geo/use-position-tracker.cjs +1 -1
  147. package/dist/geo/use-position-tracker.cjs.map +1 -1
  148. package/dist/geo/use-position-tracker.js +3 -1
  149. package/dist/geo/use-position-tracker.js.map +1 -1
  150. package/dist/hooks/use-async.cjs +1 -1
  151. package/dist/hooks/use-async.cjs.map +1 -1
  152. package/dist/hooks/use-async.js +3 -1
  153. package/dist/hooks/use-async.js.map +1 -1
  154. package/dist/hooks/use-click-outside.cjs +1 -1
  155. package/dist/hooks/use-click-outside.cjs.map +1 -1
  156. package/dist/hooks/use-click-outside.js +3 -1
  157. package/dist/hooks/use-click-outside.js.map +1 -1
  158. package/dist/hooks/use-deep-memo.cjs.map +1 -1
  159. package/dist/hooks/use-deep-memo.js.map +1 -1
  160. package/dist/hooks/use-event-listener.cjs +1 -1
  161. package/dist/hooks/use-event-listener.cjs.map +1 -1
  162. package/dist/hooks/use-event-listener.js +3 -1
  163. package/dist/hooks/use-event-listener.js.map +1 -1
  164. package/dist/hooks/use-interval.cjs +1 -1
  165. package/dist/hooks/use-interval.cjs.map +1 -1
  166. package/dist/hooks/use-interval.js +3 -1
  167. package/dist/hooks/use-interval.js.map +1 -1
  168. package/dist/hooks/use-is-first-render.cjs.map +1 -1
  169. package/dist/hooks/use-is-first-render.js.map +1 -1
  170. package/dist/hooks/use-long-press-handlers.cjs +1 -1
  171. package/dist/hooks/use-long-press-handlers.cjs.map +1 -1
  172. package/dist/hooks/use-long-press-handlers.js +25 -23
  173. package/dist/hooks/use-long-press-handlers.js.map +1 -1
  174. package/dist/hooks/use-long-press.cjs +1 -1
  175. package/dist/hooks/use-long-press.cjs.map +1 -1
  176. package/dist/hooks/use-long-press.js +3 -1
  177. package/dist/hooks/use-long-press.js.map +1 -1
  178. package/dist/hooks/use-online.cjs +1 -1
  179. package/dist/hooks/use-online.cjs.map +1 -1
  180. package/dist/hooks/use-online.js +6 -4
  181. package/dist/hooks/use-online.js.map +1 -1
  182. package/dist/hooks/use-previous.cjs.map +1 -1
  183. package/dist/hooks/use-previous.js.map +1 -1
  184. package/dist/hooks/use-service-worker-update.cjs +1 -1
  185. package/dist/hooks/use-service-worker-update.cjs.map +1 -1
  186. package/dist/hooks/use-service-worker-update.js +3 -1
  187. package/dist/hooks/use-service-worker-update.js.map +1 -1
  188. package/dist/hooks/use-sortable.cjs +2 -0
  189. package/dist/hooks/use-sortable.cjs.map +1 -0
  190. package/dist/hooks/use-sortable.js +169 -0
  191. package/dist/hooks/use-sortable.js.map +1 -0
  192. package/dist/hooks/use-stable-callback.cjs.map +1 -1
  193. package/dist/hooks/use-stable-callback.js.map +1 -1
  194. package/dist/hooks/use-timeout.cjs +1 -1
  195. package/dist/hooks/use-timeout.cjs.map +1 -1
  196. package/dist/hooks/use-timeout.js +3 -1
  197. package/dist/hooks/use-timeout.js.map +1 -1
  198. package/dist/icons/Icon.cjs +2 -0
  199. package/dist/icons/Icon.cjs.map +1 -0
  200. package/dist/icons/Icon.js +24 -0
  201. package/dist/icons/Icon.js.map +1 -0
  202. package/dist/icons/IconProvider.cjs +2 -0
  203. package/dist/icons/IconProvider.cjs.map +1 -0
  204. package/dist/icons/IconProvider.js +24 -0
  205. package/dist/icons/IconProvider.js.map +1 -0
  206. package/dist/icons/generated/aliases.cjs +2 -0
  207. package/dist/icons/generated/aliases.cjs.map +1 -0
  208. package/dist/icons/generated/aliases.js +255 -0
  209. package/dist/icons/generated/aliases.js.map +1 -0
  210. package/dist/icons/generated/icon-names.cjs +2 -0
  211. package/dist/icons/generated/icon-names.cjs.map +1 -0
  212. package/dist/icons/generated/icon-names.js +6 -0
  213. package/dist/icons/generated/icon-names.js.map +1 -0
  214. package/dist/icons/generated/loaders.cjs +2 -0
  215. package/dist/icons/generated/loaders.cjs.map +1 -0
  216. package/dist/icons/generated/loaders.js +32 -0
  217. package/dist/icons/generated/loaders.js.map +1 -0
  218. package/dist/icons/generated/shard-a.cjs +2 -0
  219. package/dist/icons/generated/shard-a.cjs.map +1 -0
  220. package/dist/icons/generated/shard-a.js +114 -0
  221. package/dist/icons/generated/shard-a.js.map +1 -0
  222. package/dist/icons/generated/shard-b.cjs +2 -0
  223. package/dist/icons/generated/shard-b.cjs.map +1 -0
  224. package/dist/icons/generated/shard-b.js +156 -0
  225. package/dist/icons/generated/shard-b.js.map +1 -0
  226. package/dist/icons/generated/shard-c.cjs +2 -0
  227. package/dist/icons/generated/shard-c.cjs.map +1 -0
  228. package/dist/icons/generated/shard-c.js +269 -0
  229. package/dist/icons/generated/shard-c.js.map +1 -0
  230. package/dist/icons/generated/shard-d.cjs +2 -0
  231. package/dist/icons/generated/shard-d.cjs.map +1 -0
  232. package/dist/icons/generated/shard-d.js +62 -0
  233. package/dist/icons/generated/shard-d.js.map +1 -0
  234. package/dist/icons/generated/shard-e.cjs +2 -0
  235. package/dist/icons/generated/shard-e.cjs.map +1 -0
  236. package/dist/icons/generated/shard-e.js +32 -0
  237. package/dist/icons/generated/shard-e.js.map +1 -0
  238. package/dist/icons/generated/shard-f.cjs +2 -0
  239. package/dist/icons/generated/shard-f.cjs.map +1 -0
  240. package/dist/icons/generated/shard-f.js +139 -0
  241. package/dist/icons/generated/shard-f.js.map +1 -0
  242. package/dist/icons/generated/shard-g.cjs +2 -0
  243. package/dist/icons/generated/shard-g.cjs.map +1 -0
  244. package/dist/icons/generated/shard-g.js +61 -0
  245. package/dist/icons/generated/shard-g.js.map +1 -0
  246. package/dist/icons/generated/shard-h.cjs +2 -0
  247. package/dist/icons/generated/shard-h.cjs.map +1 -0
  248. package/dist/icons/generated/shard-h.js +63 -0
  249. package/dist/icons/generated/shard-h.js.map +1 -0
  250. package/dist/icons/generated/shard-i.cjs +2 -0
  251. package/dist/icons/generated/shard-i.cjs.map +1 -0
  252. package/dist/icons/generated/shard-i.js +30 -0
  253. package/dist/icons/generated/shard-i.js.map +1 -0
  254. package/dist/icons/generated/shard-j.cjs +2 -0
  255. package/dist/icons/generated/shard-j.cjs.map +1 -0
  256. package/dist/icons/generated/shard-j.js +10 -0
  257. package/dist/icons/generated/shard-j.js.map +1 -0
  258. package/dist/icons/generated/shard-k.cjs +2 -0
  259. package/dist/icons/generated/shard-k.cjs.map +1 -0
  260. package/dist/icons/generated/shard-k.js +16 -0
  261. package/dist/icons/generated/shard-k.js.map +1 -0
  262. package/dist/icons/generated/shard-l.cjs +2 -0
  263. package/dist/icons/generated/shard-l.cjs.map +1 -0
  264. package/dist/icons/generated/shard-l.js +88 -0
  265. package/dist/icons/generated/shard-l.js.map +1 -0
  266. package/dist/icons/generated/shard-m.cjs +2 -0
  267. package/dist/icons/generated/shard-m.cjs.map +1 -0
  268. package/dist/icons/generated/shard-m.js +140 -0
  269. package/dist/icons/generated/shard-m.js.map +1 -0
  270. package/dist/icons/generated/shard-n.cjs +2 -0
  271. package/dist/icons/generated/shard-n.cjs.map +1 -0
  272. package/dist/icons/generated/shard-n.js +24 -0
  273. package/dist/icons/generated/shard-n.js.map +1 -0
  274. package/dist/icons/generated/shard-o.cjs +2 -0
  275. package/dist/icons/generated/shard-o.cjs.map +1 -0
  276. package/dist/icons/generated/shard-o.js +17 -0
  277. package/dist/icons/generated/shard-o.js.map +1 -0
  278. package/dist/icons/generated/shard-p.cjs +2 -0
  279. package/dist/icons/generated/shard-p.cjs.map +1 -0
  280. package/dist/icons/generated/shard-p.js +115 -0
  281. package/dist/icons/generated/shard-p.js.map +1 -0
  282. package/dist/icons/generated/shard-q.cjs +2 -0
  283. package/dist/icons/generated/shard-q.cjs.map +1 -0
  284. package/dist/icons/generated/shard-q.js +10 -0
  285. package/dist/icons/generated/shard-q.js.map +1 -0
  286. package/dist/icons/generated/shard-r.cjs +2 -0
  287. package/dist/icons/generated/shard-r.cjs.map +1 -0
  288. package/dist/icons/generated/shard-r.js +77 -0
  289. package/dist/icons/generated/shard-r.js.map +1 -0
  290. package/dist/icons/generated/shard-s.cjs +2 -0
  291. package/dist/icons/generated/shard-s.cjs.map +1 -0
  292. package/dist/icons/generated/shard-s.js +255 -0
  293. package/dist/icons/generated/shard-s.js.map +1 -0
  294. package/dist/icons/generated/shard-t.cjs +2 -0
  295. package/dist/icons/generated/shard-t.cjs.map +1 -0
  296. package/dist/icons/generated/shard-t.js +109 -0
  297. package/dist/icons/generated/shard-t.js.map +1 -0
  298. package/dist/icons/generated/shard-u.cjs +2 -0
  299. package/dist/icons/generated/shard-u.cjs.map +1 -0
  300. package/dist/icons/generated/shard-u.js +49 -0
  301. package/dist/icons/generated/shard-u.js.map +1 -0
  302. package/dist/icons/generated/shard-v.cjs +2 -0
  303. package/dist/icons/generated/shard-v.cjs.map +1 -0
  304. package/dist/icons/generated/shard-v.js +30 -0
  305. package/dist/icons/generated/shard-v.js.map +1 -0
  306. package/dist/icons/generated/shard-w.cjs +2 -0
  307. package/dist/icons/generated/shard-w.cjs.map +1 -0
  308. package/dist/icons/generated/shard-w.js +48 -0
  309. package/dist/icons/generated/shard-w.js.map +1 -0
  310. package/dist/icons/generated/shard-x.cjs +2 -0
  311. package/dist/icons/generated/shard-x.cjs.map +1 -0
  312. package/dist/icons/generated/shard-x.js +10 -0
  313. package/dist/icons/generated/shard-x.js.map +1 -0
  314. package/dist/icons/generated/shard-z.cjs +2 -0
  315. package/dist/icons/generated/shard-z.cjs.map +1 -0
  316. package/dist/icons/generated/shard-z.js +25 -0
  317. package/dist/icons/generated/shard-z.js.map +1 -0
  318. package/dist/icons/icon-context.cjs +2 -0
  319. package/dist/icons/icon-context.cjs.map +1 -0
  320. package/dist/icons/icon-context.js +13 -0
  321. package/dist/icons/icon-context.js.map +1 -0
  322. package/dist/icons/is-icon-name.cjs +2 -0
  323. package/dist/icons/is-icon-name.cjs.map +1 -0
  324. package/dist/icons/is-icon-name.js +10 -0
  325. package/dist/icons/is-icon-name.js.map +1 -0
  326. package/dist/icons/shard-cache.cjs +2 -0
  327. package/dist/icons/shard-cache.cjs.map +1 -0
  328. package/dist/icons/shard-cache.js +41 -0
  329. package/dist/icons/shard-cache.js.map +1 -0
  330. package/dist/icons/use-icon.cjs +2 -0
  331. package/dist/icons/use-icon.cjs.map +1 -0
  332. package/dist/icons/use-icon.js +20 -0
  333. package/dist/icons/use-icon.js.map +1 -0
  334. package/dist/icons-virtual.d.ts +22 -0
  335. package/dist/icons.cjs +1 -0
  336. package/dist/icons.d.ts +220 -0
  337. package/dist/icons.js +9 -0
  338. package/dist/offline/create-offline-sync.cjs +1 -1
  339. package/dist/offline/create-offline-sync.cjs.map +1 -1
  340. package/dist/offline/create-offline-sync.js +8 -2
  341. package/dist/offline/create-offline-sync.js.map +1 -1
  342. package/dist/offline/use-offline-sync.cjs +1 -1
  343. package/dist/offline/use-offline-sync.cjs.map +1 -1
  344. package/dist/offline/use-offline-sync.js +3 -1
  345. package/dist/offline/use-offline-sync.js.map +1 -1
  346. package/dist/push/use-push-subscription.cjs +1 -1
  347. package/dist/push/use-push-subscription.cjs.map +1 -1
  348. package/dist/push/use-push-subscription.js +3 -1
  349. package/dist/push/use-push-subscription.js.map +1 -1
  350. package/dist/sse/use-event-stream.cjs +1 -1
  351. package/dist/sse/use-event-stream.cjs.map +1 -1
  352. package/dist/sse/use-event-stream.js +3 -1
  353. package/dist/sse/use-event-stream.js.map +1 -1
  354. package/dist/styles.css +1 -1
  355. package/dist/tempest-react-sdk.cjs +1 -1
  356. package/dist/tempest-react-sdk.d.ts +1187 -2
  357. package/dist/tempest-react-sdk.js +261 -246
  358. package/dist/theme/ThemeProvider.cjs +1 -1
  359. package/dist/theme/ThemeProvider.cjs.map +1 -1
  360. package/dist/theme/ThemeProvider.js +6 -2
  361. package/dist/theme/ThemeProvider.js.map +1 -1
  362. package/dist/theme/apply-theme.cjs +2 -0
  363. package/dist/theme/apply-theme.cjs.map +1 -0
  364. package/dist/theme/apply-theme.js +24 -0
  365. package/dist/theme/apply-theme.js.map +1 -0
  366. package/dist/theme/color.cjs +2 -0
  367. package/dist/theme/color.cjs.map +1 -0
  368. package/dist/theme/color.js +161 -0
  369. package/dist/theme/color.js.map +1 -0
  370. package/dist/theme/create-theme.cjs +5 -0
  371. package/dist/theme/create-theme.cjs.map +1 -0
  372. package/dist/theme/create-theme.js +141 -0
  373. package/dist/theme/create-theme.js.map +1 -0
  374. package/dist/theme/theme-presets.cjs +2 -0
  375. package/dist/theme/theme-presets.cjs.map +1 -0
  376. package/dist/theme/theme-presets.js +82 -0
  377. package/dist/theme/theme-presets.js.map +1 -0
  378. package/dist/utilities.css +432 -0
  379. package/dist/utils/compare-values.cjs +2 -0
  380. package/dist/utils/compare-values.cjs.map +1 -0
  381. package/dist/utils/compare-values.js +8 -0
  382. package/dist/utils/compare-values.js.map +1 -0
  383. package/dist/vision/use-camera-stream.cjs +1 -1
  384. package/dist/vision/use-camera-stream.cjs.map +1 -1
  385. package/dist/vision/use-camera-stream.js +3 -1
  386. package/dist/vision/use-camera-stream.js.map +1 -1
  387. package/dist/vite/create-vite-config.cjs +1 -1
  388. package/dist/vite/create-vite-config.cjs.map +1 -1
  389. package/dist/vite/create-vite-config.js +30 -22
  390. package/dist/vite/create-vite-config.js.map +1 -1
  391. package/dist/vite/tempest-icons.cjs +9 -0
  392. package/dist/vite/tempest-icons.cjs.map +1 -0
  393. package/dist/vite/tempest-icons.js +99 -0
  394. package/dist/vite/tempest-icons.js.map +1 -0
  395. package/dist/vite.cjs +1 -1
  396. package/dist/vite.d.ts +79 -0
  397. package/dist/vite.js +6 -5
  398. package/dist/ws/use-web-socket.cjs +1 -1
  399. package/dist/ws/use-web-socket.cjs.map +1 -1
  400. package/dist/ws/use-web-socket.js +3 -1
  401. package/dist/ws/use-web-socket.js.map +1 -1
  402. package/package.json +14 -4
  403. package/template/package.json +1 -1
@@ -0,0 +1,141 @@
1
+ import { contrastRatio as e, createColorScale as t, hexToRgbaString as n, readableForeground as r } from "./color.js";
2
+ //#region src/theme/create-theme.ts
3
+ var i = {
4
+ none: {
5
+ xs: "0",
6
+ sm: "0",
7
+ md: "0",
8
+ lg: "0",
9
+ xl: "0",
10
+ "2xl": "0"
11
+ },
12
+ sm: {
13
+ xs: "1px",
14
+ sm: "2px",
15
+ md: "4px",
16
+ lg: "6px",
17
+ xl: "8px",
18
+ "2xl": "12px"
19
+ },
20
+ md: {
21
+ xs: "2px",
22
+ sm: "4px",
23
+ md: "8px",
24
+ lg: "12px",
25
+ xl: "16px",
26
+ "2xl": "24px"
27
+ },
28
+ lg: {
29
+ xs: "4px",
30
+ sm: "6px",
31
+ md: "12px",
32
+ lg: "16px",
33
+ xl: "22px",
34
+ "2xl": "32px"
35
+ },
36
+ xl: {
37
+ xs: "6px",
38
+ sm: "10px",
39
+ md: "16px",
40
+ lg: "24px",
41
+ xl: "32px",
42
+ "2xl": "44px"
43
+ },
44
+ full: {
45
+ xs: "4px",
46
+ sm: "8px",
47
+ md: "9999px",
48
+ lg: "9999px",
49
+ xl: "9999px",
50
+ "2xl": "9999px"
51
+ }
52
+ }, a = [
53
+ 50,
54
+ 100,
55
+ 200,
56
+ 300,
57
+ 400,
58
+ 500,
59
+ 600,
60
+ 700,
61
+ 800,
62
+ 900
63
+ ];
64
+ function o(e, t, n) {
65
+ for (let r of a) e[`--tempest-${t}-${r}`] = n[r];
66
+ }
67
+ var s = 4.5;
68
+ function c(t, n, r) {
69
+ for (let i of r) if (e(t[n], t[i]) >= s) return i;
70
+ return r[r.length - 1];
71
+ }
72
+ function l(e, t, i, a) {
73
+ e["--tempest-primary"] = "var(--tempest-primary-500)", i === "light" ? (e["--tempest-primary-hover"] = "var(--tempest-primary-600)", e["--tempest-primary-active"] = "var(--tempest-primary-700)", e["--tempest-primary-soft"] = "var(--tempest-primary-50)", e["--tempest-primary-soft-hover"] = "var(--tempest-primary-100)", e["--tempest-primary-on-soft"] = `var(--tempest-primary-${c(t, 50, [
74
+ 600,
75
+ 700,
76
+ 800,
77
+ 900
78
+ ])})`) : (e["--tempest-primary-hover"] = "var(--tempest-primary-400)", e["--tempest-primary-active"] = "var(--tempest-primary-300)", e["--tempest-primary-soft"] = "var(--tempest-primary-100)", e["--tempest-primary-soft-hover"] = "var(--tempest-primary-200)", e["--tempest-primary-on-soft"] = `var(--tempest-primary-${c(t, 100, [
79
+ 700,
80
+ 800,
81
+ 900
82
+ ])})`);
83
+ let o = r(t[500]);
84
+ e["--tempest-primary-foreground"] = o, e["--tempest-text-on-primary"] = o, e["--tempest-focus-ring-color"] = n(t[500], a);
85
+ }
86
+ function u(e, t, n) {
87
+ n === "light" ? (e["--tempest-bg"] = "#ffffff", e["--tempest-surface"] = "var(--tempest-gray-50)", e["--tempest-surface-2"] = "var(--tempest-gray-100)", e["--tempest-surface-3"] = "var(--tempest-gray-200)", e["--tempest-border"] = "var(--tempest-gray-200)", e["--tempest-border-strong"] = "var(--tempest-gray-300)", e["--tempest-text"] = "var(--tempest-gray-900)", e["--tempest-text-muted"] = "var(--tempest-gray-600)", e["--tempest-text-subtle"] = "var(--tempest-gray-500)") : (e["--tempest-bg"] = t[50], e["--tempest-surface"] = "var(--tempest-gray-100)", e["--tempest-surface-2"] = "var(--tempest-gray-200)", e["--tempest-surface-3"] = "var(--tempest-gray-300)", e["--tempest-border"] = "var(--tempest-gray-300)", e["--tempest-border-strong"] = "var(--tempest-gray-400)", e["--tempest-text"] = "var(--tempest-gray-900)", e["--tempest-text-muted"] = "var(--tempest-gray-700)", e["--tempest-text-subtle"] = "var(--tempest-gray-600)");
88
+ }
89
+ function d(e, t, n, r) {
90
+ r === "light" ? (e[`--tempest-${t}`] = n[700], e[`--tempest-${t}-fg`] = n[800], e[`--tempest-${t}-bg`] = n[50], e[`--tempest-${t}-border`] = n[200], e[`--tempest-${t}-solid`] = n[600]) : (e[`--tempest-${t}`] = n[700], e[`--tempest-${t}-fg`] = n[700], e[`--tempest-${t}-bg`] = n[50], e[`--tempest-${t}-border`] = n[200], e[`--tempest-${t}-solid`] = n[500]);
91
+ }
92
+ function f(e, t) {
93
+ let n = Object.entries(t);
94
+ return n.length === 0 ? "" : `${e} {\n${n.map(([e, t]) => ` ${e}: ${t};`).join("\n")}\n}`;
95
+ }
96
+ function p(e = {}) {
97
+ let { primary: n, gray: r, chart: a, radius: s, focusRingAlpha: c = .35, selector: p = ":root", darkSelector: m = "[data-tempest-theme=\"dark\"]" } = e, h = {}, g = {};
98
+ if (n) {
99
+ let e = t(n, "light"), r = t(n, "dark");
100
+ o(h, "primary", e), o(g, "primary", r), l(h, e, "light", c), l(g, r, "dark", c);
101
+ }
102
+ if (r) {
103
+ let e = t(r, "light", {
104
+ anchor: !1,
105
+ neutral: !0
106
+ }), n = t(r, "dark", {
107
+ anchor: !1,
108
+ neutral: !0
109
+ });
110
+ o(h, "gray", e), o(g, "gray", n), u(h, e, "light"), u(g, n, "dark");
111
+ }
112
+ for (let n of [
113
+ "success",
114
+ "warning",
115
+ "danger",
116
+ "info"
117
+ ]) {
118
+ let r = e[n];
119
+ r && (d(h, n, t(r, "light"), "light"), d(g, n, t(r, "dark"), "dark"));
120
+ }
121
+ if (a?.length && (a.forEach((e, t) => {
122
+ h[`--tempest-chart-${t + 1}`] = e;
123
+ }), h["--tempest-chart-count"] = String(a.length)), s) {
124
+ let e = typeof s == "string" ? i[s] : s;
125
+ for (let [t, n] of Object.entries(e)) h[`--tempest-radius-${t}`] = n;
126
+ }
127
+ return {
128
+ light: h,
129
+ dark: g,
130
+ css: [f(p, h), f(m, g)].filter(Boolean).join("\n\n")
131
+ };
132
+ }
133
+ function m(n) {
134
+ if (!n.primary) return null;
135
+ let i = t(n.primary, "light");
136
+ return e(i[500], r(i[500]));
137
+ }
138
+ //#endregion
139
+ export { p as createTheme, m as themeContrast };
140
+
141
+ //# sourceMappingURL=create-theme.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-theme.js","names":[],"sources":["../../src/theme/create-theme.ts"],"sourcesContent":["/**\n * Theme factory: turns a handful of brand colors into the full set of\n * `--tempest-*` token overrides, for both light and dark.\n *\n * Rebranding used to mean hand-writing ~167 custom properties (and getting the\n * dark ramp inversion right by hand). `createTheme({ primary: \"#7c3aed\" })`\n * emits the same thing, derived in OKLCH so the ramp stays perceptually even.\n */\nimport {\n contrastRatio,\n createColorScale,\n hexToRgbaString,\n readableForeground,\n type ColorScale,\n type ScaleStep,\n} from \"./color\";\n\n/** Radius presets, applied to the whole `--tempest-radius-*` family at once. */\nexport type ThemeRadius = \"none\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"full\";\n\n/** Status token families that {@link createTheme} can regenerate. */\nexport type ThemeStatus = \"success\" | \"warning\" | \"danger\" | \"info\";\n\n/** Input for {@link createTheme}. Every field is optional — omitted families keep the built-in tokens. */\nexport interface CreateThemeOptions {\n /** Brand color, used as the `500` step of the primary scale. */\n primary?: string;\n /** Neutral color, used as the `500` step of the gray scale (surfaces, borders, text). */\n gray?: string;\n /** Success color (`--tempest-success*`). */\n success?: string;\n /** Warning color (`--tempest-warning*`). */\n warning?: string;\n /** Danger color (`--tempest-danger*`). */\n danger?: string;\n /** Info color (`--tempest-info*`). */\n info?: string;\n /**\n * Categorical series colors for `tempest-react-sdk/charts`, in cycle order.\n * Written to `--tempest-chart-1` … `--tempest-chart-N`, so charts follow the\n * theme instead of a hardcoded palette.\n */\n chart?: string[];\n /** Corner radius scale. A preset name, or explicit per-step values. */\n radius?: ThemeRadius | Partial<Record<\"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\", string>>;\n /** Alpha of `--tempest-focus-ring-color`, derived from the brand color. Default `0.35`. */\n focusRingAlpha?: number;\n /** Selector the light tokens are written under. Default `\":root\"`. */\n selector?: string;\n /** Selector the dark tokens are written under. Default `'[data-tempest-theme=\"dark\"]'`. */\n darkSelector?: string;\n}\n\n/** A generated theme: token maps per color scheme, plus the CSS text that carries them. */\nexport interface GeneratedTheme {\n /** Light-scheme custom properties, without the leading `--`-less names (keys include `--`). */\n light: Record<string, string>;\n /** Dark-scheme custom properties. */\n dark: Record<string, string>;\n /** Both blocks rendered as CSS, ready for {@link applyTheme} or a stylesheet. */\n css: string;\n}\n\nconst RADIUS_PRESETS: Record<ThemeRadius, Record<string, string>> = {\n none: { xs: \"0\", sm: \"0\", md: \"0\", lg: \"0\", xl: \"0\", \"2xl\": \"0\" },\n sm: { xs: \"1px\", sm: \"2px\", md: \"4px\", lg: \"6px\", xl: \"8px\", \"2xl\": \"12px\" },\n md: { xs: \"2px\", sm: \"4px\", md: \"8px\", lg: \"12px\", xl: \"16px\", \"2xl\": \"24px\" },\n lg: { xs: \"4px\", sm: \"6px\", md: \"12px\", lg: \"16px\", xl: \"22px\", \"2xl\": \"32px\" },\n xl: { xs: \"6px\", sm: \"10px\", md: \"16px\", lg: \"24px\", xl: \"32px\", \"2xl\": \"44px\" },\n full: { xs: \"4px\", sm: \"8px\", md: \"9999px\", lg: \"9999px\", xl: \"9999px\", \"2xl\": \"9999px\" },\n};\n\nconst SCALE_STEPS: ScaleStep[] = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900];\n\nfunction writeScale(tokens: Record<string, string>, name: string, scale: ColorScale): void {\n for (const step of SCALE_STEPS) {\n tokens[`--tempest-${name}-${step}`] = scale[step];\n }\n}\n\n/** Minimum contrast for body text, WCAG 2.x AA. */\nconst AA_TEXT_CONTRAST = 4.5;\n\n/**\n * Choose the ramp step for text sitting on the soft tint.\n *\n * A fixed step does not survive an arbitrary brand color: the built-in blue only\n * reaches 4.37:1 at `500` over its own `50` tint, and a generated emerald lands\n * at 4.41:1 at `600` — both fail AA for body text by a hair. So the step is\n * picked by measuring, walking away from the tint until it clears AA, and\n * falling back to the most extreme candidate when even that cannot (a very light\n * or very desaturated brand).\n *\n * @param scale - The generated ramp.\n * @param softStep - Step used as `--tempest-primary-soft`.\n * @param candidates - Steps to try, in order of preference.\n * @returns The first candidate clearing {@link AA_TEXT_CONTRAST}, else the last.\n */\nfunction pickOnSoftStep(\n scale: ColorScale,\n softStep: ScaleStep,\n candidates: ScaleStep[],\n): ScaleStep {\n for (const step of candidates) {\n if (contrastRatio(scale[softStep], scale[step]) >= AA_TEXT_CONTRAST) return step;\n }\n return candidates[candidates.length - 1];\n}\n\n/**\n * Emit the primary aliases for one scheme.\n *\n * The dark scheme walks the ramp the other way (hover is *lighter*, the soft\n * tint is a dark shade, and readable text on that tint is a light shade) — the\n * same inversion the built-in `colors.css` dark block does by hand.\n */\nfunction writePrimaryAliases(\n tokens: Record<string, string>,\n scale: ColorScale,\n scheme: \"light\" | \"dark\",\n focusRingAlpha: number,\n): void {\n tokens[\"--tempest-primary\"] = \"var(--tempest-primary-500)\";\n if (scheme === \"light\") {\n tokens[\"--tempest-primary-hover\"] = \"var(--tempest-primary-600)\";\n tokens[\"--tempest-primary-active\"] = \"var(--tempest-primary-700)\";\n tokens[\"--tempest-primary-soft\"] = \"var(--tempest-primary-50)\";\n tokens[\"--tempest-primary-soft-hover\"] = \"var(--tempest-primary-100)\";\n tokens[\"--tempest-primary-on-soft\"] =\n `var(--tempest-primary-${pickOnSoftStep(scale, 50, [600, 700, 800, 900])})`;\n } else {\n tokens[\"--tempest-primary-hover\"] = \"var(--tempest-primary-400)\";\n tokens[\"--tempest-primary-active\"] = \"var(--tempest-primary-300)\";\n tokens[\"--tempest-primary-soft\"] = \"var(--tempest-primary-100)\";\n tokens[\"--tempest-primary-soft-hover\"] = \"var(--tempest-primary-200)\";\n tokens[\"--tempest-primary-on-soft\"] =\n `var(--tempest-primary-${pickOnSoftStep(scale, 100, [700, 800, 900])})`;\n }\n\n const foreground = readableForeground(scale[500]);\n tokens[\"--tempest-primary-foreground\"] = foreground;\n tokens[\"--tempest-text-on-primary\"] = foreground;\n tokens[\"--tempest-focus-ring-color\"] = hexToRgbaString(scale[500], focusRingAlpha);\n}\n\n/**\n * Emit the neutral surface/border/text aliases from a generated gray scale.\n *\n * `--tempest-bg` is pushed past the ramp on purpose: pure white in light mode and\n * a shade darker than `gray-50` in dark mode, so a raised surface still reads as\n * raised against the page.\n */\nfunction writeNeutralAliases(\n tokens: Record<string, string>,\n scale: ColorScale,\n scheme: \"light\" | \"dark\",\n): void {\n if (scheme === \"light\") {\n tokens[\"--tempest-bg\"] = \"#ffffff\";\n tokens[\"--tempest-surface\"] = \"var(--tempest-gray-50)\";\n tokens[\"--tempest-surface-2\"] = \"var(--tempest-gray-100)\";\n tokens[\"--tempest-surface-3\"] = \"var(--tempest-gray-200)\";\n tokens[\"--tempest-border\"] = \"var(--tempest-gray-200)\";\n tokens[\"--tempest-border-strong\"] = \"var(--tempest-gray-300)\";\n tokens[\"--tempest-text\"] = \"var(--tempest-gray-900)\";\n tokens[\"--tempest-text-muted\"] = \"var(--tempest-gray-600)\";\n tokens[\"--tempest-text-subtle\"] = \"var(--tempest-gray-500)\";\n } else {\n tokens[\"--tempest-bg\"] = scale[50];\n tokens[\"--tempest-surface\"] = \"var(--tempest-gray-100)\";\n tokens[\"--tempest-surface-2\"] = \"var(--tempest-gray-200)\";\n tokens[\"--tempest-surface-3\"] = \"var(--tempest-gray-300)\";\n tokens[\"--tempest-border\"] = \"var(--tempest-gray-300)\";\n tokens[\"--tempest-border-strong\"] = \"var(--tempest-gray-400)\";\n tokens[\"--tempest-text\"] = \"var(--tempest-gray-900)\";\n tokens[\"--tempest-text-muted\"] = \"var(--tempest-gray-700)\";\n tokens[\"--tempest-text-subtle\"] = \"var(--tempest-gray-600)\";\n }\n}\n\n/**\n * Emit one status family (`--tempest-danger`, `-fg`, `-bg`, `-border`, `-solid`).\n *\n * `-fg` is the text shade over `-bg`, so it has to cross the ramp in opposite\n * directions per scheme; `-solid` stays the saturated fill used by badges.\n */\nfunction writeStatus(\n tokens: Record<string, string>,\n name: ThemeStatus,\n scale: ColorScale,\n scheme: \"light\" | \"dark\",\n): void {\n if (scheme === \"light\") {\n tokens[`--tempest-${name}`] = scale[700];\n tokens[`--tempest-${name}-fg`] = scale[800];\n tokens[`--tempest-${name}-bg`] = scale[50];\n tokens[`--tempest-${name}-border`] = scale[200];\n tokens[`--tempest-${name}-solid`] = scale[600];\n } else {\n tokens[`--tempest-${name}`] = scale[700];\n tokens[`--tempest-${name}-fg`] = scale[700];\n tokens[`--tempest-${name}-bg`] = scale[50];\n tokens[`--tempest-${name}-border`] = scale[200];\n tokens[`--tempest-${name}-solid`] = scale[500];\n }\n}\n\nfunction renderBlock(selector: string, tokens: Record<string, string>): string {\n const entries = Object.entries(tokens);\n if (entries.length === 0) return \"\";\n const body = entries.map(([name, value]) => ` ${name}: ${value};`).join(\"\\n\");\n return `${selector} {\\n${body}\\n}`;\n}\n\n/**\n * Generate `--tempest-*` overrides from a small brand description.\n *\n * Only the families you pass are generated; everything else falls through to the\n * SDK's own tokens, so a theme stays a patch and not a fork of `colors.css`.\n *\n * @example\n * ```ts\n * import { applyTheme, createTheme } from \"tempest-react-sdk\";\n *\n * const theme = createTheme({\n * primary: \"#7c3aed\",\n * radius: \"lg\",\n * chart: [\"#7c3aed\", \"#0ea5e9\", \"#22c55e\", \"#f59e0b\"],\n * });\n *\n * applyTheme(theme);\n * ```\n *\n * @param options - Brand colors plus optional radius / chart / focus-ring tuning.\n * @returns The light and dark token maps and the CSS text that carries them.\n */\nexport function createTheme(options: CreateThemeOptions = {}): GeneratedTheme {\n const {\n primary,\n gray,\n chart,\n radius,\n focusRingAlpha = 0.35,\n selector = \":root\",\n darkSelector = '[data-tempest-theme=\"dark\"]',\n } = options;\n\n const light: Record<string, string> = {};\n const dark: Record<string, string> = {};\n\n if (primary) {\n const lightScale = createColorScale(primary, \"light\");\n const darkScale = createColorScale(primary, \"dark\");\n writeScale(light, \"primary\", lightScale);\n writeScale(dark, \"primary\", darkScale);\n writePrimaryAliases(light, lightScale, \"light\", focusRingAlpha);\n writePrimaryAliases(dark, darkScale, \"dark\", focusRingAlpha);\n }\n\n if (gray) {\n // `anchor: false`: a neutral ramp has to keep its tuned lightness curve.\n // Anchoring it at the input compressed both halves and dropped\n // text-muted-on-surface-3 to ~4.2:1 — below AA — which the browser axe\n // sweep caught on the generated themes.\n const lightScale = createColorScale(gray, \"light\", { anchor: false, neutral: true });\n const darkScale = createColorScale(gray, \"dark\", { anchor: false, neutral: true });\n writeScale(light, \"gray\", lightScale);\n writeScale(dark, \"gray\", darkScale);\n writeNeutralAliases(light, lightScale, \"light\");\n writeNeutralAliases(dark, darkScale, \"dark\");\n }\n\n for (const status of [\"success\", \"warning\", \"danger\", \"info\"] as const) {\n const value = options[status];\n if (!value) continue;\n writeStatus(light, status, createColorScale(value, \"light\"), \"light\");\n writeStatus(dark, status, createColorScale(value, \"dark\"), \"dark\");\n }\n\n if (chart?.length) {\n chart.forEach((color, index) => {\n light[`--tempest-chart-${index + 1}`] = color;\n });\n // Declares how many series colors this theme owns. Without it the reader\n // keeps walking into the SDK's built-in `--tempest-chart-7`/`-8`, so a\n // 6-color brand palette silently mixes with two leftover defaults — which\n // is exactly what a 7-series chart would show.\n light[\"--tempest-chart-count\"] = String(chart.length);\n }\n\n if (radius) {\n const steps = typeof radius === \"string\" ? RADIUS_PRESETS[radius] : radius;\n for (const [step, value] of Object.entries(steps)) {\n light[`--tempest-radius-${step}`] = value;\n }\n }\n\n const css = [renderBlock(selector, light), renderBlock(darkSelector, dark)]\n .filter(Boolean)\n .join(\"\\n\\n\");\n\n return { light, dark, css };\n}\n\n/**\n * Contrast ratio of `--tempest-primary-foreground` over the brand color.\n *\n * Exposed so an app (or a test) can assert its own brand clears WCAG AA (4.5) for\n * body text or AA-large (3.0) for button labels, instead of trusting the pick.\n *\n * @param options - The same input given to {@link createTheme}.\n * @returns The ratio, or `null` when no `primary` was provided.\n */\nexport function themeContrast(options: CreateThemeOptions): number | null {\n if (!options.primary) return null;\n const scale = createColorScale(options.primary, \"light\");\n return contrastRatio(scale[500], readableForeground(scale[500]));\n}\n"],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ var e={tempest:{primary:`#0066ff`,gray:`#667085`,chart:[`#2563eb`,`#16a34a`,`#f59e0b`,`#7c3aed`,`#ec4899`,`#06b6d4`]},violet:{primary:`#7c3aed`,gray:`#6b7280`,chart:[`#7c3aed`,`#0ea5e9`,`#22c55e`,`#f59e0b`,`#ec4899`,`#14b8a6`]},emerald:{primary:`#059669`,gray:`#64748b`,chart:[`#059669`,`#0ea5e9`,`#f59e0b`,`#8b5cf6`,`#ef4444`,`#14b8a6`]},rose:{primary:`#e11d48`,gray:`#71717a`,chart:[`#e11d48`,`#7c3aed`,`#0ea5e9`,`#16a34a`,`#f59e0b`,`#06b6d4`]},slate:{primary:`#475569`,gray:`#64748b`,chart:[`#475569`,`#0ea5e9`,`#16a34a`,`#f59e0b`,`#a855f7`,`#06b6d4`]},amber:{primary:`#d97706`,gray:`#78716c`,chart:[`#d97706`,`#0284c7`,`#16a34a`,`#7c3aed`,`#dc2626`,`#0891b2`]}};function t(t){return e[t]}exports.getThemePreset=t,exports.themePresets=e;
2
+ //# sourceMappingURL=theme-presets.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-presets.cjs","names":[],"sources":["../../src/theme/theme-presets.ts"],"sourcesContent":["/**\n * Ready-made brand descriptions for {@link createTheme}.\n *\n * Each preset is a plain {@link CreateThemeOptions} object — data, not CSS — so\n * an app can spread one and override a single field (`{ ...themePresets.violet,\n * radius: \"full\" }`) instead of forking a stylesheet. The chart arrays keep the\n * `/charts` module in the same family as the brand, which is the whole point of\n * `--tempest-chart-*`.\n */\nimport type { CreateThemeOptions } from \"./create-theme\";\n\n/** Name of a bundled preset. */\nexport type ThemePresetName = \"tempest\" | \"violet\" | \"emerald\" | \"rose\" | \"slate\" | \"amber\";\n\n/**\n * The bundled presets.\n *\n * `tempest` restates the SDK's own defaults — useful as a starting point to\n * tweak, and as the \"reset to default\" entry in a theme picker.\n */\nexport const themePresets: Record<ThemePresetName, CreateThemeOptions> = {\n tempest: {\n primary: \"#0066ff\",\n gray: \"#667085\",\n chart: [\"#2563eb\", \"#16a34a\", \"#f59e0b\", \"#7c3aed\", \"#ec4899\", \"#06b6d4\"],\n },\n violet: {\n primary: \"#7c3aed\",\n gray: \"#6b7280\",\n chart: [\"#7c3aed\", \"#0ea5e9\", \"#22c55e\", \"#f59e0b\", \"#ec4899\", \"#14b8a6\"],\n },\n emerald: {\n primary: \"#059669\",\n gray: \"#64748b\",\n chart: [\"#059669\", \"#0ea5e9\", \"#f59e0b\", \"#8b5cf6\", \"#ef4444\", \"#14b8a6\"],\n },\n rose: {\n primary: \"#e11d48\",\n gray: \"#71717a\",\n chart: [\"#e11d48\", \"#7c3aed\", \"#0ea5e9\", \"#16a34a\", \"#f59e0b\", \"#06b6d4\"],\n },\n slate: {\n primary: \"#475569\",\n gray: \"#64748b\",\n chart: [\"#475569\", \"#0ea5e9\", \"#16a34a\", \"#f59e0b\", \"#a855f7\", \"#06b6d4\"],\n },\n amber: {\n primary: \"#d97706\",\n gray: \"#78716c\",\n chart: [\"#d97706\", \"#0284c7\", \"#16a34a\", \"#7c3aed\", \"#dc2626\", \"#0891b2\"],\n },\n};\n\n/**\n * Look up a preset by name.\n *\n * @param name - Preset name.\n * @returns The preset options, or `undefined` when the name is unknown (so a\n * value coming from `localStorage` or a query string cannot crash boot).\n */\nexport function getThemePreset(name: string): CreateThemeOptions | undefined {\n return themePresets[name as ThemePresetName];\n}\n"],"mappings":"AAoBA,IAAa,EAA4D,CACrE,QAAS,CACL,QAAS,UACT,KAAM,UACN,MAAO,CAAC,UAAW,UAAW,UAAW,UAAW,UAAW,SAAS,CAC5E,EACA,OAAQ,CACJ,QAAS,UACT,KAAM,UACN,MAAO,CAAC,UAAW,UAAW,UAAW,UAAW,UAAW,SAAS,CAC5E,EACA,QAAS,CACL,QAAS,UACT,KAAM,UACN,MAAO,CAAC,UAAW,UAAW,UAAW,UAAW,UAAW,SAAS,CAC5E,EACA,KAAM,CACF,QAAS,UACT,KAAM,UACN,MAAO,CAAC,UAAW,UAAW,UAAW,UAAW,UAAW,SAAS,CAC5E,EACA,MAAO,CACH,QAAS,UACT,KAAM,UACN,MAAO,CAAC,UAAW,UAAW,UAAW,UAAW,UAAW,SAAS,CAC5E,EACA,MAAO,CACH,QAAS,UACT,KAAM,UACN,MAAO,CAAC,UAAW,UAAW,UAAW,UAAW,UAAW,SAAS,CAC5E,CACJ,EASA,SAAgB,EAAe,EAA8C,CACzE,OAAO,EAAa,EACxB"}
@@ -0,0 +1,82 @@
1
+ //#region src/theme/theme-presets.ts
2
+ var e = {
3
+ tempest: {
4
+ primary: "#0066ff",
5
+ gray: "#667085",
6
+ chart: [
7
+ "#2563eb",
8
+ "#16a34a",
9
+ "#f59e0b",
10
+ "#7c3aed",
11
+ "#ec4899",
12
+ "#06b6d4"
13
+ ]
14
+ },
15
+ violet: {
16
+ primary: "#7c3aed",
17
+ gray: "#6b7280",
18
+ chart: [
19
+ "#7c3aed",
20
+ "#0ea5e9",
21
+ "#22c55e",
22
+ "#f59e0b",
23
+ "#ec4899",
24
+ "#14b8a6"
25
+ ]
26
+ },
27
+ emerald: {
28
+ primary: "#059669",
29
+ gray: "#64748b",
30
+ chart: [
31
+ "#059669",
32
+ "#0ea5e9",
33
+ "#f59e0b",
34
+ "#8b5cf6",
35
+ "#ef4444",
36
+ "#14b8a6"
37
+ ]
38
+ },
39
+ rose: {
40
+ primary: "#e11d48",
41
+ gray: "#71717a",
42
+ chart: [
43
+ "#e11d48",
44
+ "#7c3aed",
45
+ "#0ea5e9",
46
+ "#16a34a",
47
+ "#f59e0b",
48
+ "#06b6d4"
49
+ ]
50
+ },
51
+ slate: {
52
+ primary: "#475569",
53
+ gray: "#64748b",
54
+ chart: [
55
+ "#475569",
56
+ "#0ea5e9",
57
+ "#16a34a",
58
+ "#f59e0b",
59
+ "#a855f7",
60
+ "#06b6d4"
61
+ ]
62
+ },
63
+ amber: {
64
+ primary: "#d97706",
65
+ gray: "#78716c",
66
+ chart: [
67
+ "#d97706",
68
+ "#0284c7",
69
+ "#16a34a",
70
+ "#7c3aed",
71
+ "#dc2626",
72
+ "#0891b2"
73
+ ]
74
+ }
75
+ };
76
+ function t(t) {
77
+ return e[t];
78
+ }
79
+ //#endregion
80
+ export { t as getThemePreset, e as themePresets };
81
+
82
+ //# sourceMappingURL=theme-presets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-presets.js","names":[],"sources":["../../src/theme/theme-presets.ts"],"sourcesContent":["/**\n * Ready-made brand descriptions for {@link createTheme}.\n *\n * Each preset is a plain {@link CreateThemeOptions} object — data, not CSS — so\n * an app can spread one and override a single field (`{ ...themePresets.violet,\n * radius: \"full\" }`) instead of forking a stylesheet. The chart arrays keep the\n * `/charts` module in the same family as the brand, which is the whole point of\n * `--tempest-chart-*`.\n */\nimport type { CreateThemeOptions } from \"./create-theme\";\n\n/** Name of a bundled preset. */\nexport type ThemePresetName = \"tempest\" | \"violet\" | \"emerald\" | \"rose\" | \"slate\" | \"amber\";\n\n/**\n * The bundled presets.\n *\n * `tempest` restates the SDK's own defaults — useful as a starting point to\n * tweak, and as the \"reset to default\" entry in a theme picker.\n */\nexport const themePresets: Record<ThemePresetName, CreateThemeOptions> = {\n tempest: {\n primary: \"#0066ff\",\n gray: \"#667085\",\n chart: [\"#2563eb\", \"#16a34a\", \"#f59e0b\", \"#7c3aed\", \"#ec4899\", \"#06b6d4\"],\n },\n violet: {\n primary: \"#7c3aed\",\n gray: \"#6b7280\",\n chart: [\"#7c3aed\", \"#0ea5e9\", \"#22c55e\", \"#f59e0b\", \"#ec4899\", \"#14b8a6\"],\n },\n emerald: {\n primary: \"#059669\",\n gray: \"#64748b\",\n chart: [\"#059669\", \"#0ea5e9\", \"#f59e0b\", \"#8b5cf6\", \"#ef4444\", \"#14b8a6\"],\n },\n rose: {\n primary: \"#e11d48\",\n gray: \"#71717a\",\n chart: [\"#e11d48\", \"#7c3aed\", \"#0ea5e9\", \"#16a34a\", \"#f59e0b\", \"#06b6d4\"],\n },\n slate: {\n primary: \"#475569\",\n gray: \"#64748b\",\n chart: [\"#475569\", \"#0ea5e9\", \"#16a34a\", \"#f59e0b\", \"#a855f7\", \"#06b6d4\"],\n },\n amber: {\n primary: \"#d97706\",\n gray: \"#78716c\",\n chart: [\"#d97706\", \"#0284c7\", \"#16a34a\", \"#7c3aed\", \"#dc2626\", \"#0891b2\"],\n },\n};\n\n/**\n * Look up a preset by name.\n *\n * @param name - Preset name.\n * @returns The preset options, or `undefined` when the name is unknown (so a\n * value coming from `localStorage` or a query string cannot crash boot).\n */\nexport function getThemePreset(name: string): CreateThemeOptions | undefined {\n return themePresets[name as ThemePresetName];\n}\n"],"mappings":";AAoBA,IAAa,IAA4D;CACrE,SAAS;EACL,SAAS;EACT,MAAM;EACN,OAAO;GAAC;GAAW;GAAW;GAAW;GAAW;GAAW;EAAS;CAC5E;CACA,QAAQ;EACJ,SAAS;EACT,MAAM;EACN,OAAO;GAAC;GAAW;GAAW;GAAW;GAAW;GAAW;EAAS;CAC5E;CACA,SAAS;EACL,SAAS;EACT,MAAM;EACN,OAAO;GAAC;GAAW;GAAW;GAAW;GAAW;GAAW;EAAS;CAC5E;CACA,MAAM;EACF,SAAS;EACT,MAAM;EACN,OAAO;GAAC;GAAW;GAAW;GAAW;GAAW;GAAW;EAAS;CAC5E;CACA,OAAO;EACH,SAAS;EACT,MAAM;EACN,OAAO;GAAC;GAAW;GAAW;GAAW;GAAW;GAAW;EAAS;CAC5E;CACA,OAAO;EACH,SAAS;EACT,MAAM;EACN,OAAO;GAAC;GAAW;GAAW;GAAW;GAAW;GAAW;EAAS;CAC5E;AACJ;AASA,SAAgB,EAAe,GAA8C;CACzE,OAAO,EAAa;AACxB"}