@fangxinyan/lumina 0.6.18 → 0.7.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 (462) hide show
  1. package/dist/{Alert-HVPI6L4V.css → Alert-DJ3K7N7L.css} +9 -9
  2. package/dist/Alert.cjs +5 -3
  3. package/dist/Alert.d.cts +2 -2
  4. package/dist/Alert.d.ts +2 -2
  5. package/dist/Alert.js +4 -2
  6. package/dist/{AppShell-FZCD4C56.css → AppShell-OWJRJ4ZD.css} +57 -22
  7. package/dist/AppShell.cjs +8 -5
  8. package/dist/AppShell.d.cts +19 -16
  9. package/dist/AppShell.d.ts +19 -16
  10. package/dist/AppShell.js +4 -1
  11. package/dist/{AutoComplete-4YZBMW4E.css → AutoComplete-PNCYHU2T.css} +8 -8
  12. package/dist/AutoComplete.cjs +9 -6
  13. package/dist/AutoComplete.d.cts +2 -1
  14. package/dist/AutoComplete.d.ts +2 -1
  15. package/dist/AutoComplete.js +8 -5
  16. package/dist/Avatar-YBU2YZTW.css +48 -0
  17. package/dist/Avatar.cjs +4 -2
  18. package/dist/Avatar.d.cts +6 -2
  19. package/dist/Avatar.d.ts +6 -2
  20. package/dist/Avatar.js +3 -1
  21. package/dist/Badge-DBWJEV4C.css +22 -0
  22. package/dist/Badge.cjs +4 -2
  23. package/dist/Badge.d.cts +6 -2
  24. package/dist/Badge.d.ts +6 -2
  25. package/dist/Badge.js +3 -1
  26. package/dist/{Button-TUMZUQLI.css → Button-ILNZUX2N.css} +28 -21
  27. package/dist/Button.cjs +6 -4
  28. package/dist/Button.d.cts +2 -14
  29. package/dist/Button.d.ts +2 -14
  30. package/dist/Button.js +4 -2
  31. package/dist/{Calendar-I6NHCXIB.css → Calendar-QJ5HWEJQ.css} +26 -26
  32. package/dist/Calendar.cjs +5 -3
  33. package/dist/Calendar.d.cts +8 -4
  34. package/dist/Calendar.d.ts +8 -4
  35. package/dist/Calendar.js +4 -2
  36. package/dist/Card-VPMTWAWZ.css +98 -0
  37. package/dist/Card.cjs +7 -3
  38. package/dist/Card.d.cts +8 -4
  39. package/dist/Card.d.ts +8 -4
  40. package/dist/Card.js +6 -2
  41. package/dist/Cascader-YBVDK6DC.css +168 -0
  42. package/dist/Cascader.cjs +9 -6
  43. package/dist/Cascader.d.cts +21 -3
  44. package/dist/Cascader.d.ts +21 -3
  45. package/dist/Cascader.js +8 -5
  46. package/dist/Checkbox-IHFML4FV.css +50 -0
  47. package/dist/Checkbox.cjs +5 -3
  48. package/dist/Checkbox.d.cts +10 -2
  49. package/dist/Checkbox.d.ts +10 -2
  50. package/dist/Checkbox.js +4 -2
  51. package/dist/{Collapse-UNBHEPYP.css → Collapse-BTSBHBSY.css} +12 -7
  52. package/dist/Collapse.cjs +5 -3
  53. package/dist/Collapse.d.cts +2 -2
  54. package/dist/Collapse.d.ts +2 -2
  55. package/dist/Collapse.js +4 -2
  56. package/dist/{ColorPicker-LPG6QPYF.css → ColorPicker-GRZOKR5O.css} +17 -32
  57. package/dist/ColorPicker.cjs +9 -3
  58. package/dist/ColorPicker.d.cts +7 -11
  59. package/dist/ColorPicker.d.ts +7 -11
  60. package/dist/ColorPicker.js +8 -2
  61. package/dist/{CommandPalette-RTKWNH2D.css → CommandPalette-GHTX7AAA.css} +22 -23
  62. package/dist/CommandPalette.cjs +8 -5
  63. package/dist/CommandPalette.d.cts +5 -28
  64. package/dist/CommandPalette.d.ts +5 -28
  65. package/dist/CommandPalette.js +7 -4
  66. package/dist/{ContextMenu-WRR2SSWL.css → ContextMenu-NG524Y2P.css} +17 -17
  67. package/dist/ContextMenu.cjs +5 -2
  68. package/dist/ContextMenu.d.cts +2 -19
  69. package/dist/ContextMenu.d.ts +2 -19
  70. package/dist/ContextMenu.js +4 -1
  71. package/dist/{DatePicker-VDVSIARF.css → DatePicker-ZSFDXAYD.css} +4 -4
  72. package/dist/DatePicker.cjs +11 -8
  73. package/dist/DatePicker.d.cts +4 -7
  74. package/dist/DatePicker.d.ts +4 -7
  75. package/dist/DatePicker.js +10 -7
  76. package/dist/{DateTimePicker-DRX7XA74.css → DateTimePicker-EWSISVIF.css} +17 -17
  77. package/dist/DateTimePicker.cjs +11 -8
  78. package/dist/DateTimePicker.d.cts +4 -8
  79. package/dist/DateTimePicker.d.ts +4 -8
  80. package/dist/DateTimePicker.js +10 -7
  81. package/dist/{Divider-RPQCVH3J.css → Divider-OI2BXPBU.css} +10 -10
  82. package/dist/Divider.cjs +4 -2
  83. package/dist/Divider.d.cts +2 -2
  84. package/dist/Divider.d.ts +2 -2
  85. package/dist/Divider.js +3 -1
  86. package/dist/{Drawer-7KICRM4L.css → Drawer-VCXAXWV6.css} +30 -17
  87. package/dist/Drawer.cjs +6 -3
  88. package/dist/Drawer.d.cts +25 -3
  89. package/dist/Drawer.d.ts +25 -3
  90. package/dist/Drawer.js +5 -2
  91. package/dist/{Empty-CZTRZMZQ.css → Empty-U5CBLCAL.css} +5 -5
  92. package/dist/Empty.cjs +4 -2
  93. package/dist/Empty.d.cts +2 -2
  94. package/dist/Empty.d.ts +2 -2
  95. package/dist/Empty.js +3 -1
  96. package/dist/{Form-NGCQWTMZ.css → Form-DNEDZRJA.css} +7 -7
  97. package/dist/Form.cjs +7 -4
  98. package/dist/Form.d.cts +4 -3
  99. package/dist/Form.d.ts +4 -3
  100. package/dist/Form.js +4 -1
  101. package/dist/Icon-HJSUVW4O.css +12 -0
  102. package/dist/Icon.cjs +51 -49
  103. package/dist/Icon.d.cts +8 -8
  104. package/dist/Icon.d.ts +8 -8
  105. package/dist/Icon.js +3 -1
  106. package/dist/{Image-NISJRUWX.css → Image-CZJPPURT.css} +25 -23
  107. package/dist/Image.cjs +10 -7
  108. package/dist/Image.d.cts +5 -24
  109. package/dist/Image.d.ts +5 -24
  110. package/dist/Image.js +6 -3
  111. package/dist/{Input-7GDPGP3E.css → Input-ZUASNDXM.css} +15 -15
  112. package/dist/Input.cjs +7 -5
  113. package/dist/Input.d.cts +2 -1
  114. package/dist/Input.d.ts +2 -1
  115. package/dist/Input.js +5 -3
  116. package/dist/{InputNumber-VXQIWLQC.css → InputNumber-6NHBMRT4.css} +7 -7
  117. package/dist/InputNumber.cjs +7 -5
  118. package/dist/InputNumber.d.cts +2 -1
  119. package/dist/InputNumber.d.ts +2 -1
  120. package/dist/InputNumber.js +6 -4
  121. package/dist/List-6BQIFAIT.css +42 -0
  122. package/dist/List.cjs +4 -2
  123. package/dist/List.d.cts +2 -2
  124. package/dist/List.d.ts +2 -2
  125. package/dist/List.js +3 -1
  126. package/dist/{Message-H222YGR6.css → Message-OTZWQTQ5.css} +13 -13
  127. package/dist/Message.cjs +9 -6
  128. package/dist/Message.d.cts +18 -2
  129. package/dist/Message.d.ts +18 -2
  130. package/dist/Message.js +5 -2
  131. package/dist/{Modal-ZFWNFEA5.css → Modal-UI2FXNDR.css} +29 -18
  132. package/dist/Modal.cjs +7 -4
  133. package/dist/Modal.d.cts +13 -2
  134. package/dist/Modal.d.ts +13 -2
  135. package/dist/Modal.js +6 -3
  136. package/dist/Pagination-POJTWMYR.css +70 -0
  137. package/dist/Pagination.cjs +11 -8
  138. package/dist/Pagination.d.cts +2 -2
  139. package/dist/Pagination.d.ts +2 -2
  140. package/dist/Pagination.js +10 -7
  141. package/dist/{Popover-Y3LDCJPW.css → Popover-LCXLR3EU.css} +13 -14
  142. package/dist/Popover.cjs +6 -3
  143. package/dist/Popover.d.cts +3 -10
  144. package/dist/Popover.d.ts +3 -10
  145. package/dist/Popover.js +5 -2
  146. package/dist/Progress-33WE2NI7.css +90 -0
  147. package/dist/Progress.cjs +4 -2
  148. package/dist/Progress.d.cts +4 -2
  149. package/dist/Progress.d.ts +4 -2
  150. package/dist/Progress.js +3 -1
  151. package/dist/{Radio-IQKASYDF.css → Radio-RL7232MZ.css} +21 -13
  152. package/dist/Radio.cjs +5 -3
  153. package/dist/Radio.d.cts +18 -5
  154. package/dist/Radio.d.ts +18 -5
  155. package/dist/Radio.js +3 -1
  156. package/dist/{Select-YZ2NUJSX.css → Select-TU37MAHZ.css} +64 -40
  157. package/dist/Select.cjs +10 -7
  158. package/dist/Select.d.cts +24 -3
  159. package/dist/Select.d.ts +24 -3
  160. package/dist/Select.js +9 -6
  161. package/dist/{Skeleton-CVWH2VWN.css → Skeleton-FMFE3BRI.css} +9 -4
  162. package/dist/Skeleton.cjs +4 -2
  163. package/dist/Skeleton.d.cts +2 -4
  164. package/dist/Skeleton.d.ts +2 -4
  165. package/dist/Skeleton.js +3 -1
  166. package/dist/Slider-FZ5MI4X2.css +145 -0
  167. package/dist/Slider.cjs +4 -2
  168. package/dist/Slider.d.cts +6 -5
  169. package/dist/Slider.d.ts +6 -5
  170. package/dist/Slider.js +3 -1
  171. package/dist/{Spin-GONGPV4Q.css → Spin-F5YIEENO.css} +15 -9
  172. package/dist/Spin.cjs +4 -2
  173. package/dist/Spin.d.cts +2 -2
  174. package/dist/Spin.d.ts +2 -2
  175. package/dist/Spin.js +3 -1
  176. package/dist/{Splitter-DHNOY4NC.css → Splitter-IQ3PFIKK.css} +4 -4
  177. package/dist/Splitter.cjs +4 -2
  178. package/dist/Splitter.d.cts +8 -12
  179. package/dist/Splitter.d.ts +8 -12
  180. package/dist/Splitter.js +3 -1
  181. package/dist/{StatusBar-FJKEEPXU.css → StatusBar-TCGR3LXP.css} +23 -9
  182. package/dist/StatusBar.cjs +5 -3
  183. package/dist/StatusBar.d.cts +5 -17
  184. package/dist/StatusBar.d.ts +5 -17
  185. package/dist/StatusBar.js +3 -1
  186. package/dist/{Surface-UDDN3DGL.css → Surface-CTN775GD.css} +10 -10
  187. package/dist/Surface.cjs +6 -5
  188. package/dist/Surface.d.cts +10 -1
  189. package/dist/Surface.d.ts +10 -1
  190. package/dist/Surface.js +4 -3
  191. package/dist/{Switch-COAQIOMH.css → Switch-TATU3LPB.css} +16 -8
  192. package/dist/Switch.cjs +4 -2
  193. package/dist/Switch.d.cts +10 -4
  194. package/dist/Switch.d.ts +10 -4
  195. package/dist/Switch.js +3 -1
  196. package/dist/{Table-IWHIIGRJ.css → Table-W4HPZ7MZ.css} +78 -53
  197. package/dist/Table.cjs +14 -10
  198. package/dist/Table.d.cts +32 -3
  199. package/dist/Table.d.ts +32 -3
  200. package/dist/Table.js +13 -9
  201. package/dist/{TablePro-3NGWERWT.css → TablePro-WYE6TXWJ.css} +5 -5
  202. package/dist/TablePro.cjs +15 -11
  203. package/dist/TablePro.d.cts +1 -0
  204. package/dist/TablePro.d.ts +1 -0
  205. package/dist/TablePro.js +14 -10
  206. package/dist/{Tabs-X5U5PCPV.css → Tabs-A3IG6UZ6.css} +10 -10
  207. package/dist/Tabs.cjs +4 -2
  208. package/dist/Tabs.d.cts +2 -2
  209. package/dist/Tabs.d.ts +2 -2
  210. package/dist/Tabs.js +3 -1
  211. package/dist/Tag-5GIZLRAH.css +42 -0
  212. package/dist/Tag.cjs +5 -3
  213. package/dist/Tag.d.cts +2 -2
  214. package/dist/Tag.d.ts +2 -2
  215. package/dist/Tag.js +4 -2
  216. package/dist/{Textarea-YHWKHIFE.css → Textarea-ZGHBZNLX.css} +10 -10
  217. package/dist/Textarea.cjs +6 -4
  218. package/dist/Textarea.d.cts +2 -4
  219. package/dist/Textarea.d.ts +2 -4
  220. package/dist/Textarea.js +4 -2
  221. package/dist/Theme-CLedeJ_C.d.ts +193 -0
  222. package/dist/Theme-uQq2B0Yk.d.cts +193 -0
  223. package/dist/Theme.cjs +57 -11
  224. package/dist/Theme.d.cts +26 -145
  225. package/dist/Theme.d.ts +26 -145
  226. package/dist/Theme.js +3 -1
  227. package/dist/{ThemePanel-TEHB2JCQ.css → ThemePanel-EHNAS4RN.css} +52 -52
  228. package/dist/ThemePanel.cjs +17 -15
  229. package/dist/ThemePanel.d.cts +3 -13
  230. package/dist/ThemePanel.d.ts +3 -13
  231. package/dist/ThemePanel.js +14 -12
  232. package/dist/{TimePicker-ZBJOXH3U.css → TimePicker-WJ3FSK6A.css} +17 -17
  233. package/dist/TimePicker.cjs +10 -7
  234. package/dist/TimePicker.d.cts +2 -8
  235. package/dist/TimePicker.d.ts +2 -8
  236. package/dist/TimePicker.js +9 -6
  237. package/dist/{Timeline-CRFZ3I2W.css → Timeline-FUFO2UGY.css} +28 -13
  238. package/dist/Timeline.cjs +5 -3
  239. package/dist/Timeline.d.cts +2 -7
  240. package/dist/Timeline.d.ts +2 -7
  241. package/dist/Timeline.js +4 -2
  242. package/dist/{Tooltip-5FSPJWLX.css → Tooltip-2EUNTOTW.css} +3 -3
  243. package/dist/Tooltip.cjs +6 -3
  244. package/dist/Tooltip.d.cts +2 -2
  245. package/dist/Tooltip.d.ts +2 -2
  246. package/dist/Tooltip.js +5 -2
  247. package/dist/{Typography-32QQLD4F.css → Typography-CQ2OZXQH.css} +105 -42
  248. package/dist/Typography.cjs +11 -8
  249. package/dist/Typography.d.cts +12 -36
  250. package/dist/Typography.d.ts +12 -36
  251. package/dist/Typography.js +6 -3
  252. package/dist/chunk-2A4GYSN4.js +294 -0
  253. package/dist/{chunk-QMX67CVT.cjs → chunk-2AUXUZ3Z.cjs} +56 -31
  254. package/dist/chunk-2BIOTRQC.js +40 -0
  255. package/dist/{chunk-A6O25EP2.js → chunk-2HIN5NFM.js} +14 -6
  256. package/dist/{chunk-I7TOBKJO.js → chunk-3DKFS44V.js} +84 -23
  257. package/dist/{chunk-E22OIVYP.js → chunk-3EHJ5QI3.js} +202 -69
  258. package/dist/{chunk-X5MYHDEQ.cjs → chunk-3EMWDDWK.cjs} +372 -117
  259. package/dist/chunk-3F424R5P.js +143 -0
  260. package/dist/chunk-3IZZBM56.js +269 -0
  261. package/dist/{chunk-DUFRASGO.js → chunk-3QXP2ZNP.js} +18 -23
  262. package/dist/{chunk-5QEI7GGA.cjs → chunk-434Y2JVW.cjs} +60 -27
  263. package/dist/{chunk-SOCYOUGM.js → chunk-4SKHRPDH.js} +168 -64
  264. package/dist/{chunk-L6GIV5DQ.cjs → chunk-56I6ZKGU.cjs} +40 -22
  265. package/dist/{chunk-R3DTXVP2.js → chunk-5AXNUX3J.js} +8 -5
  266. package/dist/chunk-5CZA33BK.cjs +229 -0
  267. package/dist/{chunk-6K5YI4ZE.js → chunk-62VV5COT.js} +16 -6
  268. package/dist/chunk-6DKPJ5LV.cjs +294 -0
  269. package/dist/{chunk-OTSDPQPV.js → chunk-6RQJXSWN.js} +50 -30
  270. package/dist/{chunk-V5KUC5VH.cjs → chunk-77HU7JWK.cjs} +40 -13
  271. package/dist/chunk-7QAVPVMW.js +180 -0
  272. package/dist/chunk-7VLAHOA7.cjs +191 -0
  273. package/dist/chunk-ALAG4ZUH.js +72 -0
  274. package/dist/chunk-ARUN2DMD.js +39 -0
  275. package/dist/chunk-AUO2YYHB.js +248 -0
  276. package/dist/{chunk-6MEOLYNQ.js → chunk-AURYNA6G.js} +6 -5
  277. package/dist/chunk-BIPOXOHP.cjs +287 -0
  278. package/dist/{chunk-V5SQOZPF.js → chunk-BJDQVVCG.js} +38 -20
  279. package/dist/{chunk-BVQOJKRX.js → chunk-BKW5PXEO.js} +115 -72
  280. package/dist/{chunk-UW57F3UO.cjs → chunk-D7YSY5RZ.cjs} +208 -75
  281. package/dist/chunk-DRDDQCDD.js +322 -0
  282. package/dist/chunk-DU2DSERH.js +190 -0
  283. package/dist/{chunk-PSQ3HNZP.cjs → chunk-E66PSVBU.cjs} +106 -19
  284. package/dist/{chunk-UGAN4BBW.js → chunk-EA3NZBCZ.js} +251 -125
  285. package/dist/chunk-EAUB6FEN.js +262 -0
  286. package/dist/chunk-EE5KXDRK.cjs +1223 -0
  287. package/dist/chunk-EE7IJ3MB.js +1 -0
  288. package/dist/{chunk-NXBFEIUX.cjs → chunk-ENFLP7SN.cjs} +255 -129
  289. package/dist/chunk-EUTK2ZRJ.cjs +61 -0
  290. package/dist/{chunk-HSAJUEO7.cjs → chunk-F7WUCOBP.cjs} +150 -86
  291. package/dist/{chunk-YB3IWIOJ.cjs → chunk-FJB3243S.cjs} +18 -23
  292. package/dist/chunk-FKCPSVC4.cjs +188 -0
  293. package/dist/chunk-FMUHLIHB.cjs +94 -0
  294. package/dist/chunk-FY73C7JK.js +520 -0
  295. package/dist/{chunk-6EOSMK34.cjs → chunk-G5LCOBOT.cjs} +20 -1
  296. package/dist/{chunk-5ERD3W24.cjs → chunk-GFKWSDD6.cjs} +18 -8
  297. package/dist/{chunk-T2O4DTDE.cjs → chunk-GTFP7HA3.cjs} +58 -32
  298. package/dist/chunk-HQFKXTX6.js +60 -0
  299. package/dist/chunk-HSDMJUB6.cjs +319 -0
  300. package/dist/chunk-HVPUGYBY.js +166 -0
  301. package/dist/chunk-HYHBCHFM.cjs +167 -0
  302. package/dist/chunk-HYJSMFZA.cjs +2 -0
  303. package/dist/chunk-I4YPBAQ5.js +163 -0
  304. package/dist/{chunk-IPSNC5VZ.js → chunk-JHM7MN3G.js} +15 -7
  305. package/dist/{chunk-4ACCOYBY.cjs → chunk-JINKQT6H.cjs} +20 -8
  306. package/dist/{chunk-6Q76VLCE.cjs → chunk-JKUXA3U6.cjs} +50 -30
  307. package/dist/{chunk-D7GK6H6V.js → chunk-K5HGHOG7.js} +50 -21
  308. package/dist/chunk-KATJAJUU.js +78 -0
  309. package/dist/chunk-KCDOC3HS.cjs +100 -0
  310. package/dist/{chunk-M4NJTJKV.cjs → chunk-LDX6Q6RK.cjs} +8 -5
  311. package/dist/chunk-LEDESWNL.js +83 -0
  312. package/dist/chunk-LG62MPMU.cjs +213 -0
  313. package/dist/{chunk-7NTTRKNT.js → chunk-LJVQQEME.js} +54 -28
  314. package/dist/chunk-LOWTSOWT.js +199 -0
  315. package/dist/{chunk-FDZG27IG.js → chunk-LQMOYVQF.js} +57 -32
  316. package/dist/{chunk-P2OQTJZP.cjs → chunk-MCDW3VKZ.cjs} +17 -6
  317. package/dist/{chunk-BT2RXFT4.cjs → chunk-MUZQWIMR.cjs} +121 -78
  318. package/dist/chunk-NRJXZPZR.cjs +351 -0
  319. package/dist/chunk-O6G3F5L4.js +311 -0
  320. package/dist/{chunk-3VSHGM54.js → chunk-OLYSSZHP.js} +126 -68
  321. package/dist/{chunk-A4Z7PLHV.cjs → chunk-PIJV2FHO.cjs} +135 -77
  322. package/dist/{chunk-FYSXJXNW.js → chunk-PQOBBASY.js} +10 -9
  323. package/dist/chunk-Q565GDVK.cjs +205 -0
  324. package/dist/{chunk-FDUQPAQE.cjs → chunk-Q5HLC56A.cjs} +122 -28
  325. package/dist/chunk-QDCPVI3S.cjs +333 -0
  326. package/dist/{chunk-ZR4IMROK.js → chunk-QDMFXRPI.js} +122 -28
  327. package/dist/chunk-QDY56GGO.js +234 -0
  328. package/dist/{chunk-4KDABJSY.cjs → chunk-QNQSNVCU.cjs} +86 -25
  329. package/dist/chunk-QYPA77OI.cjs +55 -0
  330. package/dist/chunk-RAK6CENJ.js +83 -0
  331. package/dist/{chunk-BW76ENTW.cjs → chunk-RERMZNF3.cjs} +10 -9
  332. package/dist/chunk-RMGFRAZ2.cjs +270 -0
  333. package/dist/chunk-RPO7657K.js +228 -0
  334. package/dist/chunk-STQDKMS5.cjs +288 -0
  335. package/dist/{chunk-HG6YS4I7.js → chunk-SXLRWYQQ.js} +71 -24
  336. package/dist/{chunk-SW2HMNCA.cjs → chunk-T4RR6NVU.cjs} +17 -9
  337. package/dist/{chunk-6SPMHY54.js → chunk-TSL3F2K3.js} +20 -2
  338. package/dist/{chunk-BNY2NVTL.cjs → chunk-TYZ6L7E6.cjs} +48 -28
  339. package/dist/{chunk-MOZ52KN6.js → chunk-U3SG2YT2.js} +39 -12
  340. package/dist/{chunk-POU3W5J3.cjs → chunk-U5YYOOLC.cjs} +13 -6
  341. package/dist/chunk-U7VEPMCX.cjs +221 -0
  342. package/dist/chunk-UE4HFGJ6.js +264 -0
  343. package/dist/chunk-ULTDRMGN.js +1175 -0
  344. package/dist/{chunk-6HF6UF73.js → chunk-UQI4R32R.js} +368 -113
  345. package/dist/{chunk-MWEHU7YO.cjs → chunk-VA3JWOAB.cjs} +172 -68
  346. package/dist/chunk-VQEMMJHC.js +33 -0
  347. package/dist/{chunk-S2ZGXBUH.cjs → chunk-VVRXNGYL.cjs} +218 -42
  348. package/dist/{chunk-JMFHL7GN.cjs → chunk-VX6MZO4K.cjs} +100 -22
  349. package/dist/{chunk-2FOC3D6X.js → chunk-WMZV7PNO.js} +19 -7
  350. package/dist/{chunk-MYW7LNB2.cjs → chunk-WROF2PVG.cjs} +40 -21
  351. package/dist/chunk-XZXY3XCL.cjs +105 -0
  352. package/dist/{chunk-5VOUUQF5.js → chunk-Y22PTPA7.js} +145 -81
  353. package/dist/chunk-Y2MT6PI6.js +207 -0
  354. package/dist/chunk-YAYSXZZZ.cjs +82 -0
  355. package/dist/{chunk-6LN4VVX7.js → chunk-YBGMTQ2V.js} +48 -28
  356. package/dist/{chunk-TYLDISRK.js → chunk-YKHIIC7M.js} +13 -6
  357. package/dist/{chunk-3VXGZ3SJ.js → chunk-YPMQC5HX.js} +57 -24
  358. package/dist/{chunk-UWL6DRZW.cjs → chunk-YUJ7Z6N2.cjs} +74 -27
  359. package/dist/{chunk-LEMMFFEY.cjs → chunk-ZEYK37VW.cjs} +15 -7
  360. package/dist/{chunk-ES7AWMNH.cjs → chunk-ZHVR4YPB.cjs} +6 -5
  361. package/dist/{chunk-MPOO5VPW.cjs → chunk-ZYIE3BH7.cjs} +50 -21
  362. package/dist/componentThemeTypes-Jt4B5aU8.d.cts +77 -0
  363. package/dist/componentThemeTypes-Jt4B5aU8.d.ts +77 -0
  364. package/dist/index.cjs +253 -206
  365. package/dist/index.d.cts +11 -9
  366. package/dist/index.d.ts +11 -9
  367. package/dist/index.js +56 -53
  368. package/dist/styles.css +1628 -701
  369. package/dist/{tokens-RYJ3DFTU.css → tokens-CEJVVA3G.css} +10 -0
  370. package/dist/tokens.css +10 -0
  371. package/docs/llms/appshell.md +9 -6
  372. package/docs/llms/autocomplete.md +8 -2
  373. package/docs/llms/avatar.md +2 -0
  374. package/docs/llms/badge.md +2 -0
  375. package/docs/llms/calendar.md +7 -2
  376. package/docs/llms/card.md +20 -1
  377. package/docs/llms/cascader.md +27 -5
  378. package/docs/llms/checkbox.md +13 -0
  379. package/docs/llms/collapse.md +13 -5
  380. package/docs/llms/colorpicker.md +4 -3
  381. package/docs/llms/commandpalette.md +10 -2
  382. package/docs/llms/contextmenu.md +14 -2
  383. package/docs/llms/datepicker.md +7 -0
  384. package/docs/llms/datetimepicker.md +7 -0
  385. package/docs/llms/drawer.md +20 -4
  386. package/docs/llms/form.md +5 -2
  387. package/docs/llms/icon.md +25 -1
  388. package/docs/llms/image.md +3 -3
  389. package/docs/llms/list.md +11 -0
  390. package/docs/llms/message.md +31 -8
  391. package/docs/llms/modal.md +20 -8
  392. package/docs/llms/pagination.md +12 -4
  393. package/docs/llms/popover.md +11 -1
  394. package/docs/llms/progress.md +1 -0
  395. package/docs/llms/radio.md +13 -0
  396. package/docs/llms/select.md +29 -2
  397. package/docs/llms/sidebar.md +24 -0
  398. package/docs/llms/slider.md +5 -2
  399. package/docs/llms/splitter.md +5 -2
  400. package/docs/llms/switch.md +13 -0
  401. package/docs/llms/table.md +7 -8
  402. package/docs/llms/theme.md +83 -28
  403. package/docs/llms/themepanel.md +1 -0
  404. package/docs/llms/titlebar.md +1 -0
  405. package/docs/llms/tooltip.md +7 -2
  406. package/docs/llms/typography.md +27 -3
  407. package/docs/llms/windowcontrols.md +11 -3
  408. package/docs/llms.md +2 -2
  409. package/package.json +212 -2
  410. package/dist/Avatar-TNPOHVY5.css +0 -40
  411. package/dist/Badge-DPGLV3D3.css +0 -22
  412. package/dist/Card-W3ATFUJW.css +0 -77
  413. package/dist/Cascader-ANEQUPMI.css +0 -150
  414. package/dist/Checkbox-EDNPZRIP.css +0 -42
  415. package/dist/List-LSMU5QAC.css +0 -26
  416. package/dist/Pagination-YSZSNFHG.css +0 -68
  417. package/dist/Progress-CZNXCYGW.css +0 -80
  418. package/dist/Slider-UM2IZZBH.css +0 -127
  419. package/dist/Tag-G2XWAL7A.css +0 -42
  420. package/dist/chunk-262ED6WQ.cjs +0 -88
  421. package/dist/chunk-4HJBF4GY.js +0 -218
  422. package/dist/chunk-4TTRHEGM.cjs +0 -217
  423. package/dist/chunk-5A6KSYWA.cjs +0 -67
  424. package/dist/chunk-5MOYKVB7.js +0 -192
  425. package/dist/chunk-7IO3EOHN.cjs +0 -200
  426. package/dist/chunk-7QXP6DXC.cjs +0 -129
  427. package/dist/chunk-AAPZLBHQ.js +0 -165
  428. package/dist/chunk-ARUPS7JH.js +0 -66
  429. package/dist/chunk-ATUPFAPZ.cjs +0 -76
  430. package/dist/chunk-CFZVWY5N.js +0 -178
  431. package/dist/chunk-DSLYWX4O.js +0 -25
  432. package/dist/chunk-FQJY4D3T.cjs +0 -47
  433. package/dist/chunk-GNV6W4BN.js +0 -495
  434. package/dist/chunk-HBO7ZDEQ.js +0 -29
  435. package/dist/chunk-I777JTTG.js +0 -150
  436. package/dist/chunk-IOAOG5L7.js +0 -191
  437. package/dist/chunk-IOUAZYK2.cjs +0 -116
  438. package/dist/chunk-IZHH6CVY.js +0 -123
  439. package/dist/chunk-JFL2WMJZ.js +0 -106
  440. package/dist/chunk-KMPFESEV.js +0 -41
  441. package/dist/chunk-KYV75JPQ.js +0 -147
  442. package/dist/chunk-N7OQNSII.cjs +0 -145
  443. package/dist/chunk-P64NPZBG.js +0 -113
  444. package/dist/chunk-PKNRTFNE.cjs +0 -526
  445. package/dist/chunk-PU7VXDAS.js +0 -64
  446. package/dist/chunk-RFI5R42I.cjs +0 -138
  447. package/dist/chunk-RR2BKV65.js +0 -39
  448. package/dist/chunk-RSSOX4RQ.cjs +0 -240
  449. package/dist/chunk-RZEFKXL3.cjs +0 -104
  450. package/dist/chunk-S7IHWY24.js +0 -81
  451. package/dist/chunk-SOQ56ZI2.cjs +0 -49
  452. package/dist/chunk-TBNPJPYG.cjs +0 -61
  453. package/dist/chunk-TJECLLN4.js +0 -344
  454. package/dist/chunk-ULUD3FED.cjs +0 -138
  455. package/dist/chunk-VA2I7ZAL.cjs +0 -190
  456. package/dist/chunk-VS3I5OKA.cjs +0 -214
  457. package/dist/chunk-WMGMIE2D.js +0 -113
  458. package/dist/chunk-X7XP6GEI.cjs +0 -63
  459. package/dist/chunk-XCXUGHDF.js +0 -91
  460. package/dist/chunk-YAFDVNXT.js +0 -27
  461. package/dist/chunk-ZD3L4V3H.js +0 -54
  462. package/dist/chunk-ZTCRD2FL.js +0 -45
@@ -0,0 +1,1175 @@
1
+ import './tokens-CEJVVA3G.css';
2
+ import * as React3 from 'react';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ // src/components/Theme/Theme.tsx
6
+ var PortalContainerContext = React3.createContext(null);
7
+ function PortalScopeProvider({ container, children }) {
8
+ return /* @__PURE__ */ jsx(PortalContainerContext.Provider, { value: container, children });
9
+ }
10
+ function usePortalContainer() {
11
+ const scopedContainer = React3.useContext(PortalContainerContext);
12
+ if (scopedContainer) return scopedContainer;
13
+ if (typeof document === "undefined") return null;
14
+ return document.body;
15
+ }
16
+ var EMPTY_COMPONENT_OVERRIDES = Object.freeze({});
17
+ var VisualThemeContext = React3.createContext(null);
18
+ var ComponentOverridesContext = React3.createContext(
19
+ EMPTY_COMPONENT_OVERRIDES
20
+ );
21
+ var OwnerPortalThemeContext = React3.createContext(null);
22
+ var imperativeThemeChangeListeners = /* @__PURE__ */ new Set();
23
+ function subscribeImperativeThemeChange(listener) {
24
+ imperativeThemeChangeListeners.add(listener);
25
+ return () => imperativeThemeChangeListeners.delete(listener);
26
+ }
27
+ function notifyImperativeThemeChange(target) {
28
+ imperativeThemeChangeListeners.forEach((listener) => listener(target));
29
+ }
30
+ function mergeComponentOverride(parent, next) {
31
+ const styles = { ...parent?.styles ?? {} };
32
+ for (const [slot, style] of Object.entries(next.styles ?? {})) {
33
+ styles[slot] = { ...styles[slot] ?? {}, ...style };
34
+ }
35
+ return {
36
+ ...parent,
37
+ ...next,
38
+ colors: { ...parent?.colors ?? {}, ...next.colors ?? {} },
39
+ tokens: { ...parent?.tokens ?? {}, ...next.tokens ?? {} },
40
+ styles
41
+ };
42
+ }
43
+ function mergeComponentThemeOverrides(...sources) {
44
+ const result = {};
45
+ for (const source of sources) {
46
+ if (!source) continue;
47
+ for (const [name, override] of Object.entries(source)) {
48
+ if (!override) continue;
49
+ result[name] = mergeComponentOverride(result[name], override);
50
+ }
51
+ }
52
+ return result;
53
+ }
54
+ function VisualThemeProvider({
55
+ value,
56
+ children
57
+ }) {
58
+ return /* @__PURE__ */ jsx(VisualThemeContext.Provider, { value, children });
59
+ }
60
+ function ComponentOverridesProvider({
61
+ value,
62
+ children
63
+ }) {
64
+ const inherited = React3.useContext(ComponentOverridesContext);
65
+ const merged = React3.useMemo(() => {
66
+ if (!value || Object.keys(value).length === 0) return inherited;
67
+ return mergeComponentThemeOverrides(inherited, value);
68
+ }, [inherited, value]);
69
+ return /* @__PURE__ */ jsx(ComponentOverridesContext.Provider, { value: merged, children });
70
+ }
71
+ function OwnerPortalThemeProvider({
72
+ value,
73
+ children
74
+ }) {
75
+ return /* @__PURE__ */ jsx(OwnerPortalThemeContext.Provider, { value, children });
76
+ }
77
+ function useVisualThemeSnapshot() {
78
+ return React3.useContext(VisualThemeContext);
79
+ }
80
+ function useComponentOverrides() {
81
+ return React3.useContext(ComponentOverridesContext);
82
+ }
83
+ function useOwnerPortalTheme() {
84
+ return React3.useContext(OwnerPortalThemeContext);
85
+ }
86
+ var ACCENT_PRESETS = {
87
+ sky: { accent: "oklch(68% 0.14 235)", ink: "oklch(42% 0.12 235)", soft: "oklch(92% 0.04 235)", glow: "oklch(68% 0.14 235 / 0.35)" },
88
+ coral: { accent: "oklch(72% 0.16 35)", ink: "oklch(48% 0.14 35)", soft: "oklch(94% 0.04 35)", glow: "oklch(72% 0.16 35 / 0.35)" },
89
+ mint: { accent: "oklch(72% 0.13 165)", ink: "oklch(46% 0.11 165)", soft: "oklch(93% 0.04 165)", glow: "oklch(72% 0.13 165 / 0.35)" },
90
+ violet: { accent: "oklch(66% 0.16 290)", ink: "oklch(44% 0.14 290)", soft: "oklch(93% 0.04 290)", glow: "oklch(66% 0.16 290 / 0.35)" },
91
+ amber: { accent: "oklch(76% 0.14 75)", ink: "oklch(50% 0.12 75)", soft: "oklch(94% 0.05 75)", glow: "oklch(76% 0.14 75 / 0.35)" },
92
+ rose: { accent: "oklch(68% 0.17 10)", ink: "oklch(46% 0.15 10)", soft: "oklch(93% 0.04 10)", glow: "oklch(68% 0.17 10 / 0.35)" }
93
+ };
94
+ var ACCENT_PRESETS_DARK = {
95
+ sky: { soft: "oklch(35% 0.08 235)", ink: "oklch(82% 0.10 235)", glow: "oklch(68% 0.14 235 / 0.18)" },
96
+ coral: { soft: "oklch(38% 0.09 35)", ink: "oklch(84% 0.10 35)", glow: "oklch(72% 0.16 35 / 0.18)" },
97
+ mint: { soft: "oklch(36% 0.08 165)", ink: "oklch(83% 0.10 165)", glow: "oklch(72% 0.13 165 / 0.18)" },
98
+ violet: { soft: "oklch(36% 0.09 290)", ink: "oklch(82% 0.11 290)", glow: "oklch(66% 0.16 290 / 0.18)" },
99
+ amber: { soft: "oklch(38% 0.08 75)", ink: "oklch(85% 0.10 75)", glow: "oklch(76% 0.14 75 / 0.18)" },
100
+ rose: { soft: "oklch(38% 0.09 10)", ink: "oklch(84% 0.11 10)", glow: "oklch(68% 0.17 10 / 0.18)" }
101
+ };
102
+ var FONT_STACKS = {
103
+ system: '-apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif',
104
+ sf: '"SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif',
105
+ serif: 'Cambria, Georgia, "Songti SC", "STSong", serif',
106
+ mono: 'ui-monospace, "SF Mono", "JetBrains Mono", Consolas, monospace'
107
+ };
108
+ var DEFAULT_CONFIG = {
109
+ mode: "light",
110
+ colorScheme: "light",
111
+ baseColor: void 0,
112
+ accent: "sky",
113
+ density: "comfortable",
114
+ intensity: 5,
115
+ radius: 20,
116
+ font: "sf",
117
+ colors: {},
118
+ tokens: {},
119
+ components: {},
120
+ themes: {},
121
+ accentExplicit: false
122
+ };
123
+ var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
124
+ var useIsomorphicLayoutEffect = isBrowser ? React3.useLayoutEffect : React3.useEffect;
125
+ function isThemeBaseMode(mode) {
126
+ return mode === "light" || mode === "dark";
127
+ }
128
+ function isBuiltInThemeMode(mode) {
129
+ return mode === "light" || mode === "dark" || mode === "system";
130
+ }
131
+ var TRANSIENT_THEME_MODES = /* @__PURE__ */ new Set(["__theme_panel_draft__"]);
132
+ function isTransientThemeMode(mode) {
133
+ return mode != null && TRANSIENT_THEME_MODES.has(mode);
134
+ }
135
+ function getThemePreset(themes, mode) {
136
+ if (!mode || isBuiltInThemeMode(mode)) return void 0;
137
+ return themes?.[mode];
138
+ }
139
+ function isThemePresetValueEqual(current, preset) {
140
+ if (current === preset) return true;
141
+ if (current == null || preset == null || typeof current !== "object" || typeof preset !== "object") {
142
+ return false;
143
+ }
144
+ return JSON.stringify(current) === JSON.stringify(preset);
145
+ }
146
+ function clearActiveThemePreset(config) {
147
+ const preset = getThemePreset(config.themes, config.mode);
148
+ if (!preset) return config;
149
+ const next = { ...config };
150
+ const presetFields = [
151
+ ["colorScheme", preset.base],
152
+ ["baseColor", preset.baseColor],
153
+ ["accent", preset.accent],
154
+ ["density", preset.density],
155
+ ["intensity", preset.intensity],
156
+ ["radius", preset.radius],
157
+ ["font", preset.font],
158
+ ["colors", preset.colors],
159
+ ["tokens", preset.tokens],
160
+ [
161
+ "components",
162
+ preset.components ? mergeComponentThemeOverrides(void 0, preset.components) : void 0
163
+ ]
164
+ ];
165
+ for (const [key, presetValue] of presetFields) {
166
+ if (presetValue !== void 0 && isThemePresetValueEqual(next[key], presetValue)) {
167
+ delete next[key];
168
+ }
169
+ }
170
+ return next;
171
+ }
172
+ function applyThemePreset(config, mode) {
173
+ const base = clearActiveThemePreset(config);
174
+ const preset = getThemePreset(base.themes, mode);
175
+ if (!preset) {
176
+ return {
177
+ ...base,
178
+ mode,
179
+ colorScheme: isThemeBaseMode(mode) ? mode : base.colorScheme
180
+ };
181
+ }
182
+ return {
183
+ ...base,
184
+ mode,
185
+ colorScheme: preset.base ?? base.colorScheme ?? DEFAULT_CONFIG.colorScheme,
186
+ baseColor: preset.baseColor ?? base.baseColor,
187
+ accent: preset.accent ?? base.accent,
188
+ density: preset.density ?? base.density,
189
+ intensity: preset.intensity ?? base.intensity,
190
+ radius: preset.radius ?? base.radius,
191
+ font: preset.font ?? base.font,
192
+ colors: preset.colors ? { ...preset.colors } : base.colors,
193
+ tokens: preset.tokens ? { ...preset.tokens } : base.tokens,
194
+ components: preset.components ? mergeComponentThemeOverrides(void 0, preset.components) : base.components
195
+ };
196
+ }
197
+ function patchThemeConfig(current, patch) {
198
+ const themesChanged = Object.prototype.hasOwnProperty.call(patch, "themes");
199
+ const modeChanged = Object.prototype.hasOwnProperty.call(patch, "mode");
200
+ let base = themesChanged ? clearActiveThemePreset(current) : current;
201
+ if (themesChanged) {
202
+ base = { ...base, themes: patch.themes };
203
+ }
204
+ const mode = modeChanged ? patch.mode : base.mode;
205
+ const withMode = (modeChanged || themesChanged) && mode !== void 0 ? applyThemePreset(base, mode) : base;
206
+ return { ...withMode, ...patch };
207
+ }
208
+ function resolveThemeConfig(config) {
209
+ const mode = config.mode ?? DEFAULT_CONFIG.mode;
210
+ const themes = config.themes ?? DEFAULT_CONFIG.themes;
211
+ const preset = getThemePreset(themes, mode);
212
+ const accentExplicit = config.accent !== void 0 || preset?.accent !== void 0;
213
+ const presetConfig = preset ? {
214
+ ...preset.base ? { colorScheme: preset.base } : null,
215
+ ...preset.baseColor ? { baseColor: preset.baseColor } : null,
216
+ ...preset.accent ? { accent: preset.accent } : null,
217
+ ...preset.density ? { density: preset.density } : null,
218
+ ...preset.intensity != null ? { intensity: preset.intensity } : null,
219
+ ...preset.radius != null ? { radius: preset.radius } : null,
220
+ ...preset.font ? { font: preset.font } : null
221
+ } : {};
222
+ const merged = {
223
+ ...DEFAULT_CONFIG,
224
+ ...presetConfig,
225
+ ...config,
226
+ mode,
227
+ themes,
228
+ colors: {
229
+ ...preset?.colors ?? {},
230
+ ...config.colors ?? {}
231
+ },
232
+ components: mergeComponentThemeOverrides(preset?.components, config.components),
233
+ tokens: {
234
+ ...preset?.tokens ?? {},
235
+ ...config.tokens ?? {}
236
+ }
237
+ };
238
+ return {
239
+ ...merged,
240
+ colorScheme: merged.colorScheme ?? preset?.base ?? DEFAULT_CONFIG.colorScheme,
241
+ baseColor: merged.baseColor ?? preset?.baseColor,
242
+ accent: merged.accent ?? preset?.accent ?? DEFAULT_CONFIG.accent,
243
+ density: merged.density ?? preset?.density ?? DEFAULT_CONFIG.density,
244
+ intensity: merged.intensity ?? preset?.intensity ?? DEFAULT_CONFIG.intensity,
245
+ radius: merged.radius ?? preset?.radius ?? DEFAULT_CONFIG.radius,
246
+ font: merged.font ?? preset?.font ?? DEFAULT_CONFIG.font,
247
+ accentExplicit
248
+ };
249
+ }
250
+ function resolveThemeMode(mode) {
251
+ if (mode !== "system") return mode;
252
+ if (!isBrowser) return "light";
253
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
254
+ }
255
+ function resolveThemeColorScheme(mode, themes, fallback) {
256
+ if (mode === "system") return fallback ?? resolveThemeMode(mode);
257
+ if (isThemeBaseMode(mode)) return mode;
258
+ return getThemePreset(themes, mode)?.base ?? fallback ?? DEFAULT_CONFIG.colorScheme;
259
+ }
260
+ function normalizeAccentInput(input, colorScheme) {
261
+ if (typeof input === "string" && input in ACCENT_PRESETS) {
262
+ const key = input;
263
+ const base = ACCENT_PRESETS[key];
264
+ if (colorScheme === "dark") {
265
+ return { key, palette: { ...base, ...ACCENT_PRESETS_DARK[key] } };
266
+ }
267
+ return { key, palette: base };
268
+ }
269
+ const raw = typeof input === "string" ? { accent: input } : input;
270
+ const { accent } = raw;
271
+ const ink = raw.ink ?? `color-mix(in oklch, ${accent} 65%, black)`;
272
+ const soft = raw.soft ?? (colorScheme === "dark" ? `color-mix(in oklch, ${accent} 30%, black)` : `color-mix(in oklch, ${accent} 15%, white)`);
273
+ const glow = raw.glow ?? (colorScheme === "dark" ? `color-mix(in oklch, ${accent} 18%, transparent)` : `color-mix(in oklch, ${accent} 35%, transparent)`);
274
+ return { key: "custom", palette: { accent, ink, soft, glow } };
275
+ }
276
+ var DEFAULT_THEME_COLORS = {
277
+ light: {
278
+ bg: "#e8eef5",
279
+ bgRaised: "#edf2f8",
280
+ bgSunken: "#dde4ed",
281
+ fg: "#3a4558",
282
+ fgMuted: "#7b8599",
283
+ fgSubtle: "#9ca7ba",
284
+ border: "rgba(130, 148, 175, 0.14)",
285
+ divider: "rgba(130, 148, 175, 0.18)",
286
+ shadowDark: "rgba(163, 177, 198, 0.55)",
287
+ shadowLight: "rgba(255, 255, 255, 0.95)",
288
+ accent: ACCENT_PRESETS.sky.accent,
289
+ accentInk: ACCENT_PRESETS.sky.ink,
290
+ accentSoft: ACCENT_PRESETS.sky.soft,
291
+ accentGlow: ACCENT_PRESETS.sky.glow,
292
+ info: "oklch(68% 0.14 235)",
293
+ success: "oklch(68% 0.14 150)",
294
+ warning: "oklch(75% 0.14 75)",
295
+ danger: "oklch(64% 0.18 25)"
296
+ },
297
+ dark: {
298
+ bg: "#1b2030",
299
+ bgRaised: "#242a3c",
300
+ bgSunken: "#151a27",
301
+ fg: "#d8deeb",
302
+ fgMuted: "#8b94ab",
303
+ fgSubtle: "#5f6a82",
304
+ border: "rgba(0, 0, 0, 0.35)",
305
+ divider: "rgba(255, 255, 255, 0.06)",
306
+ shadowDark: "rgba(0, 0, 0, 0.55)",
307
+ shadowLight: "rgba(130, 145, 180, 0.06)",
308
+ accent: ACCENT_PRESETS.sky.accent,
309
+ accentInk: ACCENT_PRESETS_DARK.sky.ink,
310
+ accentSoft: ACCENT_PRESETS_DARK.sky.soft,
311
+ accentGlow: ACCENT_PRESETS_DARK.sky.glow,
312
+ info: "oklch(78% 0.12 235)",
313
+ success: "oklch(78% 0.14 150)",
314
+ warning: "oklch(82% 0.14 75)",
315
+ danger: "oklch(76% 0.16 25)"
316
+ }
317
+ };
318
+ function mixColor(value, percent, other) {
319
+ return `color-mix(in srgb, ${value} ${percent}%, ${other})`;
320
+ }
321
+ function fadeColor(value, percent) {
322
+ return `color-mix(in srgb, ${value} ${percent}%, transparent)`;
323
+ }
324
+ function deriveThemeColors(baseColor, options = {}) {
325
+ const colorScheme = options.colorScheme ?? "light";
326
+ const dark = colorScheme === "dark";
327
+ const derivedAccent = dark ? mixColor(baseColor, 68, "white") : mixColor(baseColor, 62, "black");
328
+ const explicitAccent = options.accent ? normalizeAccentInput(options.accent, colorScheme).palette : null;
329
+ const accent = explicitAccent?.accent ?? derivedAccent;
330
+ return {
331
+ bg: baseColor,
332
+ bgRaised: mixColor(baseColor, dark ? 86 : 82, "white"),
333
+ bgSunken: mixColor(baseColor, dark ? 80 : 86, "black"),
334
+ fg: mixColor(baseColor, 18, dark ? "white" : "black"),
335
+ fgMuted: mixColor(baseColor, 38, dark ? "white" : "black"),
336
+ fgSubtle: mixColor(baseColor, 55, dark ? "white" : "black"),
337
+ border: mixColor(baseColor, 82, dark ? "white" : "black"),
338
+ divider: mixColor(baseColor, 88, dark ? "white" : "black"),
339
+ shadowDark: fadeColor(
340
+ mixColor(baseColor, dark ? 40 : 58, "black"),
341
+ dark ? 65 : 55
342
+ ),
343
+ shadowLight: fadeColor(
344
+ mixColor(baseColor, dark ? 82 : 28, "white"),
345
+ dark ? 22 : 88
346
+ ),
347
+ accent,
348
+ accentInk: explicitAccent?.ink ?? mixColor(accent, 65, dark ? "white" : "black"),
349
+ accentSoft: explicitAccent?.soft ?? mixColor(accent, dark ? 30 : 15, dark ? "black" : "white"),
350
+ accentGlow: explicitAccent?.glow ?? fadeColor(accent, dark ? 25 : 40)
351
+ };
352
+ }
353
+ var COLOR_TOKEN_KEYS = {
354
+ bg: "bg",
355
+ bgRaised: "bg-raised",
356
+ bgSunken: "bg-sunken",
357
+ fg: "fg",
358
+ fgMuted: "fg-muted",
359
+ fgSubtle: "fg-subtle",
360
+ border: "border",
361
+ divider: "divider",
362
+ shadowDark: "shadow-dark",
363
+ shadowLight: "shadow-light",
364
+ accent: "accent",
365
+ accentInk: "accent-ink",
366
+ accentSoft: "accent-soft",
367
+ accentGlow: "accent-glow",
368
+ info: "info",
369
+ success: "success",
370
+ warning: "warning",
371
+ danger: "danger"
372
+ };
373
+ function hasAccentColorOverride(config) {
374
+ return ["accent", "accentInk", "accentSoft", "accentGlow"].some((key) => {
375
+ const tokenKey = COLOR_TOKEN_KEYS[key];
376
+ return config.colors?.[key] !== void 0 || config.tokens?.[tokenKey] !== void 0 || config.tokens?.[`--${tokenKey}`] !== void 0;
377
+ });
378
+ }
379
+ function resolveThemeColors(config, colorScheme, inherited) {
380
+ const fallback = inherited ?? DEFAULT_THEME_COLORS[colorScheme];
381
+ const surface = config.baseColor ? deriveThemeColors(config.baseColor, { colorScheme, accent: config.accent }) : { ...fallback };
382
+ if (!config.baseColor && config.accent) {
383
+ const palette = normalizeAccentInput(config.accent, colorScheme).palette;
384
+ surface.accent = palette.accent;
385
+ surface.accentInk = palette.ink;
386
+ surface.accentSoft = palette.soft;
387
+ surface.accentGlow = palette.glow;
388
+ }
389
+ const resolved = {
390
+ ...fallback,
391
+ ...surface,
392
+ ...config.colors ?? {}
393
+ };
394
+ for (const [colorKey, tokenKey] of Object.entries(COLOR_TOKEN_KEYS)) {
395
+ const value = config.tokens?.[tokenKey] ?? config.tokens?.[`--${tokenKey}`];
396
+ if (value !== void 0) resolved[colorKey] = value;
397
+ }
398
+ return resolved;
399
+ }
400
+ function themeColorsToStyle(colors, prefix = "") {
401
+ const style = {};
402
+ for (const [colorKey, tokenKey] of Object.entries(COLOR_TOKEN_KEYS)) {
403
+ style[`--${prefix}${tokenKey}`] = colors[colorKey];
404
+ }
405
+ return style;
406
+ }
407
+ function themeTokenToKebabCase(value) {
408
+ return value.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/_/g, "-").toLowerCase();
409
+ }
410
+ function visualThemeToStyle(snapshot, prefix = "") {
411
+ const style = themeColorsToStyle(snapshot.colors, prefix);
412
+ const variable = (name) => `--${prefix}${name}`;
413
+ const reference = (name) => `var(${variable(name)})`;
414
+ const inheritedReference = (name) => prefix ? `var(${variable(name)}, var(--${name}))` : `var(--${name})`;
415
+ const d = 0.4 + snapshot.intensity * 0.12;
416
+ const dark = snapshot.colorScheme === "dark";
417
+ style[variable("d")] = String(d);
418
+ style[variable("shadow-offset")] = `calc(${dark ? 4 : 6}px * ${reference("d")} * ${inheritedReference("shadow-scale")})`;
419
+ style[variable("shadow-blur")] = `calc(${dark ? 10 : 16}px * ${reference("d")} * ${inheritedReference("shadow-scale")})`;
420
+ style[variable("shadow-inset-offset")] = `calc(${dark ? 3 : 4}px * ${reference("d")} * ${inheritedReference("shadow-scale")})`;
421
+ style[variable("shadow-inset-blur")] = `calc(${dark ? 7 : 10}px * ${reference("d")} * ${inheritedReference("shadow-scale")})`;
422
+ style[variable("neu-shadow-panel")] = `${reference("shadow-offset")} ${reference("shadow-offset")} ${reference("shadow-blur")} ${reference("shadow-dark")}, calc(${reference("shadow-offset")} * -1) calc(${reference("shadow-offset")} * -1) ${reference("shadow-blur")} ${reference("shadow-light")}`;
423
+ style[variable("neu-shadow-control")] = `calc(${reference("shadow-offset")} * .5) calc(${reference("shadow-offset")} * .5) calc(${reference("shadow-blur")} * .6) ${reference("shadow-dark")}, calc(${reference("shadow-offset")} * -.5) calc(${reference("shadow-offset")} * -.5) calc(${reference("shadow-blur")} * .6) ${reference("shadow-light")}`;
424
+ style[variable("neu-shadow-lift")] = `calc(${reference("shadow-offset")} * 1.6) calc(${reference("shadow-offset")} * 1.6) calc(${reference("shadow-blur")} * 1.4) ${reference("shadow-dark")}, calc(${reference("shadow-offset")} * -1.6) calc(${reference("shadow-offset")} * -1.6) calc(${reference("shadow-blur")} * 1.4) ${reference("shadow-light")}`;
425
+ style[variable("neu-shadow-inset-strong")] = `inset ${reference("shadow-inset-offset")} ${reference("shadow-inset-offset")} ${reference("shadow-inset-blur")} ${reference("shadow-dark")}, inset calc(${reference("shadow-inset-offset")} * -1) calc(${reference("shadow-inset-offset")} * -1) ${reference("shadow-inset-blur")} ${reference("shadow-light")}`;
426
+ style[variable("neu-shadow-inset")] = `inset calc(${reference("shadow-inset-offset")} * .6) calc(${reference("shadow-inset-offset")} * .6) calc(${reference("shadow-inset-blur")} * .6) ${reference("shadow-dark")}, inset calc(${reference("shadow-inset-offset")} * -.6) calc(${reference("shadow-inset-offset")} * -.6) calc(${reference("shadow-inset-blur")} * .6) ${reference("shadow-light")}`;
427
+ style[variable("neu-shadow-subtle")] = `1px 1px 2px ${reference("shadow-dark")}, -1px -1px 2px ${reference("shadow-light")}`;
428
+ style[variable("neu-shadow-float")] = `0 calc(${reference("shadow-offset")} * 1.8 * ${inheritedReference("shadow-float-scale")}) calc(${reference("shadow-blur")} * 2.2 * ${inheritedReference("shadow-float-scale")}) ${reference("shadow-dark")}, 0 calc(${reference("shadow-offset")} * .4 * ${inheritedReference("shadow-float-scale")}) calc(${reference("shadow-blur")} * .7 * ${inheritedReference("shadow-float-scale")}) ${reference("shadow-dark")}`;
429
+ style[variable("neu-out")] = reference("neu-shadow-panel");
430
+ style[variable("neu-out-sm")] = reference("neu-shadow-control");
431
+ style[variable("neu-out-lg")] = reference("neu-shadow-lift");
432
+ style[variable("neu-in")] = reference("neu-shadow-inset-strong");
433
+ style[variable("neu-in-sm")] = reference("neu-shadow-inset");
434
+ style[variable("neu-flat")] = reference("neu-shadow-subtle");
435
+ style[variable("neu-float")] = reference("neu-shadow-float");
436
+ return style;
437
+ }
438
+ function componentTokensToStyle(tokens, prefix) {
439
+ if (!tokens) return {};
440
+ const style = {};
441
+ for (const [key, value] of Object.entries(tokens)) {
442
+ const property = key.startsWith("--") ? key : `--${prefix}${themeTokenToKebabCase(key)}`;
443
+ style[property] = value;
444
+ }
445
+ return style;
446
+ }
447
+ function resolveVisualThemeSnapshot(config, inherited) {
448
+ const colorScheme = config.colorScheme ?? inherited?.colorScheme ?? "light";
449
+ const inheritedColors = inherited?.colorScheme === colorScheme ? inherited.colors : DEFAULT_THEME_COLORS[colorScheme];
450
+ return {
451
+ colorScheme,
452
+ intensity: config.intensity ?? inherited?.intensity ?? DEFAULT_CONFIG.intensity,
453
+ colors: resolveThemeColors(config, colorScheme, inheritedColors)
454
+ };
455
+ }
456
+ function toVar(key) {
457
+ return key.startsWith("--") ? key : `--${key}`;
458
+ }
459
+ var LEGACY_SHADOW_TOKEN_ALIASES = {
460
+ "--neu-flat": "--neu-shadow-subtle",
461
+ "--neu-out-sm": "--neu-shadow-control",
462
+ "--neu-out": "--neu-shadow-panel",
463
+ "--neu-out-lg": "--neu-shadow-lift",
464
+ "--neu-in-sm": "--neu-shadow-inset",
465
+ "--neu-in": "--neu-shadow-inset-strong",
466
+ "--neu-float": "--neu-shadow-float"
467
+ };
468
+ function resolvedThemeConfigToStyle(config, snapshot) {
469
+ const style = { ...visualThemeToStyle(snapshot) };
470
+ const radius = config.radius ?? DEFAULT_CONFIG.radius;
471
+ style["--r-xs"] = `${Math.max(4, radius - 16)}px`;
472
+ style["--r-sm"] = `${Math.max(6, radius - 12)}px`;
473
+ style["--r-md"] = `${Math.max(8, radius - 6)}px`;
474
+ style["--r-lg"] = `${radius}px`;
475
+ style["--r-xl"] = `${radius + 10}px`;
476
+ const font = config.font ?? DEFAULT_CONFIG.font;
477
+ if (typeof font === "string") {
478
+ style["--font-sans"] = FONT_STACKS[font] ?? font;
479
+ if (font === "mono") style["--font-display"] = FONT_STACKS.mono;
480
+ } else {
481
+ if (font.sans) style["--font-sans"] = font.sans;
482
+ if (font.display) style["--font-display"] = font.display;
483
+ if (font.mono) style["--font-mono"] = font.mono;
484
+ }
485
+ const tokenVars = new Set(Object.keys(config.tokens).map(toVar));
486
+ for (const [key, value] of Object.entries(config.tokens)) {
487
+ const variable = toVar(key);
488
+ const semanticAlias = LEGACY_SHADOW_TOKEN_ALIASES[variable];
489
+ if (semanticAlias && !tokenVars.has(semanticAlias)) {
490
+ style[semanticAlias] = value;
491
+ }
492
+ style[variable] = value;
493
+ }
494
+ return style;
495
+ }
496
+ function resolvedThemeConfigToDataAttributes(config, colorScheme) {
497
+ const accentResult = normalizeAccentInput(config.accent, colorScheme);
498
+ const hidesAccent = config.baseColor && !config.accentExplicit || accentResult.key === "custom" || hasAccentColorOverride(config);
499
+ return {
500
+ "data-theme": colorScheme,
501
+ "data-theme-mode": config.mode,
502
+ "data-density": config.density,
503
+ "data-accent": hidesAccent ? void 0 : accentResult.key
504
+ };
505
+ }
506
+ var imperativeThemeStyleKeys = /* @__PURE__ */ new WeakMap();
507
+ var ROOT_THEME_ATTRIBUTES = [
508
+ "data-theme",
509
+ "data-theme-mode",
510
+ "data-density",
511
+ "data-accent"
512
+ ];
513
+ function createRootThemeMutationState(target) {
514
+ const previousImperativeStyleKeys = imperativeThemeStyleKeys.get(target);
515
+ const styles = /* @__PURE__ */ new Map();
516
+ previousImperativeStyleKeys?.forEach((property) => {
517
+ styles.set(property, {
518
+ value: target.style.getPropertyValue(property),
519
+ priority: target.style.getPropertyPriority(property)
520
+ });
521
+ });
522
+ return {
523
+ target,
524
+ attributes: new Map(
525
+ ROOT_THEME_ATTRIBUTES.map((attribute) => [attribute, target.getAttribute(attribute)])
526
+ ),
527
+ styles,
528
+ activeStyleKeys: /* @__PURE__ */ new Set(),
529
+ previousImperativeStyleKeys: previousImperativeStyleKeys ? new Set(previousImperativeStyleKeys) : void 0
530
+ };
531
+ }
532
+ function restoreRootThemeStyleProperty(state, property) {
533
+ const snapshot = state.styles.get(property);
534
+ if (!snapshot || snapshot.value === "") {
535
+ state.target.style.removeProperty(property);
536
+ return;
537
+ }
538
+ state.target.style.setProperty(property, snapshot.value, snapshot.priority);
539
+ }
540
+ function applyProviderThemeToRoot(state, config, style) {
541
+ const nextStyleKeys = new Set(Object.keys(style));
542
+ for (const property of nextStyleKeys) {
543
+ if (state.styles.has(property)) continue;
544
+ state.styles.set(property, {
545
+ value: state.target.style.getPropertyValue(property),
546
+ priority: state.target.style.getPropertyPriority(property)
547
+ });
548
+ }
549
+ const removedStyleKeys = [...state.activeStyleKeys].filter(
550
+ (property) => !nextStyleKeys.has(property)
551
+ );
552
+ applyTheme(state.target, config);
553
+ removedStyleKeys.forEach((property) => restoreRootThemeStyleProperty(state, property));
554
+ state.activeStyleKeys = nextStyleKeys;
555
+ }
556
+ function restoreRootThemeMutationState(state) {
557
+ state.styles.forEach((_snapshot, property) => {
558
+ restoreRootThemeStyleProperty(state, property);
559
+ });
560
+ state.attributes.forEach((value, attribute) => {
561
+ if (value === null) state.target.removeAttribute(attribute);
562
+ else state.target.setAttribute(attribute, value);
563
+ });
564
+ if (state.previousImperativeStyleKeys) {
565
+ imperativeThemeStyleKeys.set(state.target, state.previousImperativeStyleKeys);
566
+ } else {
567
+ imperativeThemeStyleKeys.delete(state.target);
568
+ }
569
+ notifyImperativeThemeChange(state.target);
570
+ }
571
+ function applyTheme(target, config) {
572
+ const cfg = resolveThemeConfig(config);
573
+ const colorScheme = resolveThemeColorScheme(cfg.mode, cfg.themes, cfg.colorScheme);
574
+ const snapshot = resolveVisualThemeSnapshot({
575
+ baseColor: cfg.baseColor,
576
+ colorScheme,
577
+ accent: cfg.accentExplicit ? cfg.accent : void 0,
578
+ intensity: cfg.intensity,
579
+ colors: cfg.colors,
580
+ tokens: cfg.tokens
581
+ });
582
+ const dataAttributes = resolvedThemeConfigToDataAttributes(cfg, colorScheme);
583
+ for (const [attribute, value] of Object.entries(dataAttributes)) {
584
+ if (value === void 0) target.removeAttribute(attribute);
585
+ else target.setAttribute(attribute, value);
586
+ }
587
+ const style = resolvedThemeConfigToStyle(cfg, snapshot);
588
+ const nextStyleKeys = new Set(Object.keys(style));
589
+ for (const property of imperativeThemeStyleKeys.get(target) ?? []) {
590
+ if (!nextStyleKeys.has(property)) target.style.removeProperty(property);
591
+ }
592
+ for (const [property, value] of Object.entries(style)) {
593
+ target.style.setProperty(property, value);
594
+ }
595
+ imperativeThemeStyleKeys.set(target, nextStyleKeys);
596
+ notifyImperativeThemeChange(target);
597
+ }
598
+ var ThemeCtx = React3.createContext(null);
599
+ var ThemeInheritanceCtx = React3.createContext(void 0);
600
+ function useTheme() {
601
+ const ctx = React3.useContext(ThemeCtx);
602
+ if (!ctx) {
603
+ throw new Error(
604
+ "useTheme() must be used inside <ThemeProvider>. Wrap your app (or a subtree) with <ThemeProvider>."
605
+ );
606
+ }
607
+ return ctx;
608
+ }
609
+ function useThemeOptional() {
610
+ return React3.useContext(ThemeCtx);
611
+ }
612
+ function mergeThemeConfigs(inherited, local) {
613
+ const merged = { ...inherited ?? {} };
614
+ const themes = { ...inherited?.themes ?? {}, ...local.themes ?? {} };
615
+ const mode = local.mode ?? inherited?.mode;
616
+ const localDefinesActivePreset = mode !== void 0 && local.themes !== void 0 && Object.prototype.hasOwnProperty.call(local.themes, mode);
617
+ const preset = mode !== void 0 && (local.mode !== void 0 || localDefinesActivePreset) ? getThemePreset(themes, mode) : void 0;
618
+ if (mode !== void 0) merged.mode = mode;
619
+ if (local.mode !== void 0 && isThemeBaseMode(mode)) {
620
+ merged.colorScheme = mode;
621
+ }
622
+ if (preset) {
623
+ if (preset.base !== void 0) merged.colorScheme = preset.base;
624
+ if (preset.baseColor !== void 0) merged.baseColor = preset.baseColor;
625
+ if (preset.accent !== void 0) merged.accent = preset.accent;
626
+ if (preset.density !== void 0) merged.density = preset.density;
627
+ if (preset.intensity !== void 0) merged.intensity = preset.intensity;
628
+ if (preset.radius !== void 0) merged.radius = preset.radius;
629
+ if (preset.font !== void 0) merged.font = preset.font;
630
+ }
631
+ const scalarKeys = [
632
+ "mode",
633
+ "colorScheme",
634
+ "baseColor",
635
+ "accent",
636
+ "density",
637
+ "intensity",
638
+ "radius",
639
+ "font"
640
+ ];
641
+ for (const key of scalarKeys) {
642
+ const value = local[key];
643
+ if (value !== void 0) {
644
+ merged[key] = value;
645
+ }
646
+ }
647
+ if ((local.baseColor !== void 0 || preset?.baseColor !== void 0) && local.accent === void 0 && preset?.accent === void 0) {
648
+ delete merged.accent;
649
+ }
650
+ const inheritedColors = { ...inherited?.colors ?? {} };
651
+ const inheritedTokens = { ...inherited?.tokens ?? {} };
652
+ const resetColorKeys = /* @__PURE__ */ new Set();
653
+ if (local.baseColor !== void 0 || preset?.baseColor !== void 0) {
654
+ for (const key of Object.keys(COLOR_TOKEN_KEYS)) {
655
+ resetColorKeys.add(key);
656
+ }
657
+ } else {
658
+ for (const key of [
659
+ ...Object.keys(preset?.colors ?? {}),
660
+ ...Object.keys(local.colors ?? {})
661
+ ]) {
662
+ resetColorKeys.add(key);
663
+ }
664
+ if (local.accent !== void 0 || preset?.accent !== void 0) {
665
+ resetColorKeys.add("accent");
666
+ resetColorKeys.add("accentInk");
667
+ resetColorKeys.add("accentSoft");
668
+ resetColorKeys.add("accentGlow");
669
+ }
670
+ }
671
+ for (const key of resetColorKeys) {
672
+ delete inheritedColors[key];
673
+ const tokenKey = COLOR_TOKEN_KEYS[key];
674
+ delete inheritedTokens[tokenKey];
675
+ delete inheritedTokens[`--${tokenKey}`];
676
+ }
677
+ merged.colors = {
678
+ ...inheritedColors,
679
+ ...preset?.colors ?? {},
680
+ ...local.colors ?? {}
681
+ };
682
+ merged.tokens = {
683
+ ...inheritedTokens,
684
+ ...preset?.tokens ?? {},
685
+ ...local.tokens ?? {}
686
+ };
687
+ merged.components = mergeComponentThemeOverrides(
688
+ inherited?.components,
689
+ preset?.components,
690
+ local.components
691
+ );
692
+ merged.themes = themes;
693
+ return merged;
694
+ }
695
+ var THEME_STORAGE_VERSION = 1;
696
+ function isPersistedThemeEnvelope(value) {
697
+ if (!value || typeof value !== "object") return false;
698
+ const candidate = value;
699
+ return typeof candidate.version === "number" && !!candidate.config && typeof candidate.config === "object";
700
+ }
701
+ function loadPersisted(key) {
702
+ if (!key || !isBrowser) return null;
703
+ try {
704
+ const raw = localStorage.getItem(key);
705
+ if (!raw) return null;
706
+ const parsed = JSON.parse(raw);
707
+ const persisted = isPersistedThemeEnvelope(parsed) ? parsed.config : parsed;
708
+ if (isTransientThemeMode(persisted.mode)) {
709
+ localStorage.removeItem(key);
710
+ return null;
711
+ }
712
+ return persisted;
713
+ } catch {
714
+ return null;
715
+ }
716
+ }
717
+ function persist(key, cfg) {
718
+ if (!key || !isBrowser) return;
719
+ if (isTransientThemeMode(cfg.mode)) return;
720
+ try {
721
+ const payload = {
722
+ version: THEME_STORAGE_VERSION,
723
+ config: cfg
724
+ };
725
+ localStorage.setItem(key, JSON.stringify(payload));
726
+ } catch {
727
+ }
728
+ }
729
+ function applyExplicitThemeProps(base, props) {
730
+ return {
731
+ ...base,
732
+ ...props.mode !== void 0 ? { mode: props.mode } : null,
733
+ ...props.colorScheme !== void 0 ? { colorScheme: props.colorScheme } : null,
734
+ ...props.baseColor !== void 0 ? { baseColor: props.baseColor } : null,
735
+ ...props.accent !== void 0 ? { accent: props.accent } : null,
736
+ ...props.density !== void 0 ? { density: props.density } : null,
737
+ ...props.intensity !== void 0 ? { intensity: props.intensity } : null,
738
+ ...props.radius !== void 0 ? { radius: props.radius } : null,
739
+ ...props.font !== void 0 ? { font: props.font } : null,
740
+ ...props.colors !== void 0 ? { colors: props.colors } : null,
741
+ ...props.tokens !== void 0 ? { tokens: props.tokens } : null,
742
+ ...props.components !== void 0 ? { components: props.components } : null,
743
+ ...props.themes !== void 0 ? { themes: props.themes } : null
744
+ };
745
+ }
746
+ function createThemeConfigFromProps(props, includeDefaults = true) {
747
+ if (!includeDefaults) {
748
+ return applyExplicitThemeProps({}, props);
749
+ }
750
+ const mode = props.mode ?? DEFAULT_CONFIG.mode;
751
+ const fromProps = {
752
+ mode,
753
+ colorScheme: props.colorScheme,
754
+ baseColor: props.baseColor,
755
+ accent: props.accent,
756
+ density: props.density ?? DEFAULT_CONFIG.density,
757
+ intensity: props.intensity ?? DEFAULT_CONFIG.intensity,
758
+ radius: props.radius ?? DEFAULT_CONFIG.radius,
759
+ font: props.font ?? DEFAULT_CONFIG.font,
760
+ colors: props.colors ?? {},
761
+ tokens: props.tokens ?? {},
762
+ components: props.components ?? {},
763
+ themes: props.themes ?? DEFAULT_CONFIG.themes
764
+ };
765
+ return applyExplicitThemeProps(applyThemePreset(fromProps, mode), props);
766
+ }
767
+ function mergeThemeScopeRefs(internalRef, childRef) {
768
+ return (node) => {
769
+ internalRef.current = node;
770
+ if (typeof childRef === "function") childRef(node);
771
+ else if (childRef) {
772
+ childRef.current = node;
773
+ }
774
+ };
775
+ }
776
+ var ThemeProvider = (props) => {
777
+ const {
778
+ children,
779
+ enabled = true,
780
+ target = "root",
781
+ as: Tag = "div",
782
+ asChild = false,
783
+ className,
784
+ style,
785
+ storageKey,
786
+ onChange,
787
+ ...configProps
788
+ } = props;
789
+ const inheritedConfig = React3.useContext(ThemeInheritanceCtx);
790
+ const inheritedThemeValue = React3.useContext(ThemeCtx);
791
+ const inheritedVisualSnapshot = useVisualThemeSnapshot();
792
+ const inheritedPortalContainer = usePortalContainer();
793
+ const hasInheritedTheme = inheritedConfig !== void 0;
794
+ const initialConfig = React3.useMemo(() => {
795
+ const fromProps = createThemeConfigFromProps(configProps, !hasInheritedTheme);
796
+ const persisted = loadPersisted(storageKey);
797
+ const withExplicitProps = fromProps;
798
+ if (!persisted) return withExplicitProps;
799
+ let persistedForMerge = persisted;
800
+ if (configProps.themes !== void 0) {
801
+ const { themes: _persistedThemes, ...rest } = persisted;
802
+ persistedForMerge = rest;
803
+ }
804
+ const persistedMode = persistedForMerge.mode ?? withExplicitProps.mode;
805
+ const presetBase = persistedMode === void 0 ? withExplicitProps : applyThemePreset(
806
+ { ...withExplicitProps, mode: persistedMode },
807
+ persistedMode
808
+ );
809
+ const withPersisted = {
810
+ ...presetBase,
811
+ ...persistedForMerge,
812
+ ...configProps.themes !== void 0 ? { themes: configProps.themes } : null
813
+ };
814
+ const withControlledThemePreset = configProps.themes !== void 0 && persistedMode !== void 0 && !isBuiltInThemeMode(persistedMode) ? applyThemePreset(withPersisted, persistedMode) : withPersisted;
815
+ return applyExplicitThemeProps(withControlledThemePreset, configProps);
816
+ }, []);
817
+ const [config, setConfig] = React3.useState(initialConfig);
818
+ const previousPropsRef = React3.useRef({
819
+ mode: configProps.mode,
820
+ colorScheme: configProps.colorScheme,
821
+ baseColor: configProps.baseColor,
822
+ accent: configProps.accent,
823
+ density: configProps.density,
824
+ intensity: configProps.intensity,
825
+ radius: configProps.radius,
826
+ font: configProps.font,
827
+ colors: configProps.colors,
828
+ tokens: configProps.tokens,
829
+ components: configProps.components,
830
+ themes: configProps.themes
831
+ });
832
+ React3.useEffect(() => {
833
+ const previous = previousPropsRef.current;
834
+ const changedProps = {};
835
+ const assignIfChanged = (key, value2) => {
836
+ if (value2 !== previous[key]) changedProps[key] = value2;
837
+ };
838
+ assignIfChanged("mode", configProps.mode);
839
+ assignIfChanged("colorScheme", configProps.colorScheme);
840
+ assignIfChanged("baseColor", configProps.baseColor);
841
+ assignIfChanged("accent", configProps.accent);
842
+ assignIfChanged("density", configProps.density);
843
+ assignIfChanged("intensity", configProps.intensity);
844
+ assignIfChanged("radius", configProps.radius);
845
+ assignIfChanged("font", configProps.font);
846
+ assignIfChanged("colors", configProps.colors);
847
+ assignIfChanged("tokens", configProps.tokens);
848
+ assignIfChanged("components", configProps.components);
849
+ assignIfChanged("themes", configProps.themes);
850
+ previousPropsRef.current = {
851
+ mode: configProps.mode,
852
+ colorScheme: configProps.colorScheme,
853
+ baseColor: configProps.baseColor,
854
+ accent: configProps.accent,
855
+ density: configProps.density,
856
+ intensity: configProps.intensity,
857
+ radius: configProps.radius,
858
+ font: configProps.font,
859
+ colors: configProps.colors,
860
+ tokens: configProps.tokens,
861
+ components: configProps.components,
862
+ themes: configProps.themes
863
+ };
864
+ if (Object.keys(changedProps).length === 0) return;
865
+ setConfig((c) => {
866
+ const currentBase = Object.prototype.hasOwnProperty.call(changedProps, "themes") ? clearActiveThemePreset(c) : c;
867
+ const base = {
868
+ ...currentBase,
869
+ ...Object.prototype.hasOwnProperty.call(changedProps, "themes") ? { themes: configProps.themes ?? DEFAULT_CONFIG.themes } : null
870
+ };
871
+ const fallbackMode = hasInheritedTheme ? void 0 : DEFAULT_CONFIG.mode;
872
+ const mode = Object.prototype.hasOwnProperty.call(changedProps, "mode") ? configProps.mode ?? fallbackMode : c.mode ?? fallbackMode;
873
+ const shouldApplyPreset = mode !== void 0 && (Object.prototype.hasOwnProperty.call(changedProps, "mode") || Object.prototype.hasOwnProperty.call(changedProps, "themes") && !isBuiltInThemeMode(mode));
874
+ const shouldUseProp = (key) => Object.prototype.hasOwnProperty.call(changedProps, key) || configProps[key] !== void 0;
875
+ const nextFromMode = shouldApplyPreset ? applyThemePreset(base, mode) : base;
876
+ const next = {
877
+ ...nextFromMode,
878
+ mode,
879
+ ...shouldUseProp("colorScheme") ? { colorScheme: configProps.colorScheme } : null,
880
+ ...shouldUseProp("baseColor") ? { baseColor: configProps.baseColor } : null,
881
+ ...shouldUseProp("accent") ? { accent: configProps.accent } : null,
882
+ ...shouldUseProp("density") ? { density: configProps.density } : null,
883
+ ...shouldUseProp("intensity") ? { intensity: configProps.intensity } : null,
884
+ ...shouldUseProp("radius") ? { radius: configProps.radius } : null,
885
+ ...shouldUseProp("font") ? { font: configProps.font } : null,
886
+ ...shouldUseProp("colors") ? { colors: configProps.colors } : null,
887
+ ...shouldUseProp("tokens") ? { tokens: configProps.tokens } : null,
888
+ ...shouldUseProp("components") ? { components: configProps.components } : null
889
+ };
890
+ if (next.mode === c.mode && next.colorScheme === c.colorScheme && next.baseColor === c.baseColor && next.accent === c.accent && next.density === c.density && next.intensity === c.intensity && next.radius === c.radius && next.font === c.font && next.colors === c.colors && next.tokens === c.tokens && next.components === c.components && next.themes === c.themes) {
891
+ return c;
892
+ }
893
+ return next;
894
+ });
895
+ }, [
896
+ configProps.mode,
897
+ configProps.colorScheme,
898
+ configProps.baseColor,
899
+ configProps.accent,
900
+ configProps.density,
901
+ configProps.intensity,
902
+ configProps.radius,
903
+ configProps.font,
904
+ configProps.colors,
905
+ configProps.tokens,
906
+ configProps.components,
907
+ configProps.themes,
908
+ hasInheritedTheme
909
+ ]);
910
+ React3.useEffect(() => {
911
+ if (!storageKey || !isBrowser) return;
912
+ const handleStorage = (event) => {
913
+ if (event.key !== storageKey && event.key !== null) return;
914
+ if (event.newValue === null) {
915
+ setConfig(createThemeConfigFromProps(configProps, !hasInheritedTheme));
916
+ return;
917
+ }
918
+ const persisted = loadPersisted(storageKey);
919
+ if (!persisted) return;
920
+ setConfig((current) => {
921
+ const persistedForMerge = { ...persisted };
922
+ if (configProps.themes !== void 0) delete persistedForMerge.themes;
923
+ const mode = configProps.mode ?? persistedForMerge.mode ?? current.mode ?? (hasInheritedTheme ? void 0 : DEFAULT_CONFIG.mode);
924
+ const persistedConfig = {
925
+ ...current,
926
+ ...persistedForMerge,
927
+ ...configProps.themes !== void 0 ? { themes: configProps.themes } : null
928
+ };
929
+ const merged = mode === void 0 ? persistedConfig : applyThemePreset(persistedConfig, mode);
930
+ return applyExplicitThemeProps({
931
+ ...merged,
932
+ ...mode !== void 0 ? { mode } : null
933
+ }, configProps);
934
+ });
935
+ };
936
+ window.addEventListener("storage", handleStorage);
937
+ return () => window.removeEventListener("storage", handleStorage);
938
+ }, [
939
+ configProps.mode,
940
+ configProps.colorScheme,
941
+ configProps.baseColor,
942
+ configProps.accent,
943
+ configProps.density,
944
+ configProps.intensity,
945
+ configProps.radius,
946
+ configProps.font,
947
+ configProps.colors,
948
+ configProps.tokens,
949
+ configProps.components,
950
+ configProps.themes,
951
+ hasInheritedTheme,
952
+ storageKey
953
+ ]);
954
+ const [systemDark, setSystemDark] = React3.useState(
955
+ () => isBrowser && window.matchMedia("(prefers-color-scheme: dark)").matches
956
+ );
957
+ React3.useEffect(() => {
958
+ if (!isBrowser) return;
959
+ const mql = window.matchMedia("(prefers-color-scheme: dark)");
960
+ const handler = (e) => setSystemDark(e.matches);
961
+ mql.addEventListener?.("change", handler);
962
+ return () => mql.removeEventListener?.("change", handler);
963
+ }, []);
964
+ const effectiveConfig = React3.useMemo(
965
+ () => resolveThemeConfig(mergeThemeConfigs(inheritedConfig, config)),
966
+ [config, inheritedConfig]
967
+ );
968
+ const activeTheme = React3.useMemo(
969
+ () => getThemePreset(effectiveConfig.themes, effectiveConfig.mode) ?? null,
970
+ [effectiveConfig.mode, effectiveConfig.themes]
971
+ );
972
+ const colorScheme = effectiveConfig.mode === "system" ? systemDark ? "dark" : "light" : isThemeBaseMode(effectiveConfig.mode) ? effectiveConfig.mode : effectiveConfig.colorScheme ?? activeTheme?.base ?? DEFAULT_CONFIG.colorScheme;
973
+ const resolvedMode = effectiveConfig.mode === "system" ? colorScheme : effectiveConfig.mode;
974
+ const visualSnapshot = React3.useMemo(
975
+ () => resolveVisualThemeSnapshot({
976
+ baseColor: effectiveConfig.baseColor,
977
+ colorScheme,
978
+ accent: effectiveConfig.accentExplicit ? effectiveConfig.accent : void 0,
979
+ intensity: effectiveConfig.intensity,
980
+ colors: effectiveConfig.colors,
981
+ tokens: effectiveConfig.tokens
982
+ }),
983
+ [
984
+ effectiveConfig.baseColor,
985
+ effectiveConfig.accent,
986
+ effectiveConfig.accentExplicit,
987
+ effectiveConfig.intensity,
988
+ effectiveConfig.colors,
989
+ effectiveConfig.tokens,
990
+ colorScheme
991
+ ]
992
+ );
993
+ const { key: accentKey, palette: accentPalette } = React3.useMemo(() => {
994
+ if (effectiveConfig.baseColor && !effectiveConfig.accentExplicit || hasAccentColorOverride(effectiveConfig)) {
995
+ return {
996
+ key: "custom",
997
+ palette: {
998
+ accent: visualSnapshot.colors.accent,
999
+ ink: visualSnapshot.colors.accentInk,
1000
+ soft: visualSnapshot.colors.accentSoft,
1001
+ glow: visualSnapshot.colors.accentGlow
1002
+ }
1003
+ };
1004
+ }
1005
+ return normalizeAccentInput(effectiveConfig.accent, colorScheme);
1006
+ }, [
1007
+ effectiveConfig.baseColor,
1008
+ effectiveConfig.accent,
1009
+ effectiveConfig.accentExplicit,
1010
+ colorScheme,
1011
+ visualSnapshot.colors
1012
+ ]);
1013
+ const scopeRef = React3.useRef(null);
1014
+ const scopeChild = target === "scope" && asChild ? React3.Children.only(children) : null;
1015
+ const scopeChildRef = scopeChild?.ref;
1016
+ const mergedScopeRef = React3.useMemo(
1017
+ () => mergeThemeScopeRefs(scopeRef, scopeChildRef),
1018
+ [scopeChildRef]
1019
+ );
1020
+ const [portalContainer, setPortalContainer] = React3.useState(null);
1021
+ const rootThemeMutationRef = React3.useRef(null);
1022
+ useIsomorphicLayoutEffect(() => {
1023
+ if (!isBrowser || !enabled || target !== "scope") {
1024
+ setPortalContainer(null);
1025
+ return;
1026
+ }
1027
+ const container = document.createElement("div");
1028
+ container.dataset.luminaPortalScope = "";
1029
+ container.style.display = "contents";
1030
+ document.body.appendChild(container);
1031
+ setPortalContainer(container);
1032
+ return () => {
1033
+ container.remove();
1034
+ };
1035
+ }, [enabled, target]);
1036
+ useIsomorphicLayoutEffect(() => {
1037
+ if (!isBrowser || !enabled || target !== "root") return;
1038
+ const state = createRootThemeMutationState(document.documentElement);
1039
+ rootThemeMutationRef.current = state;
1040
+ return () => {
1041
+ if (rootThemeMutationRef.current !== state) return;
1042
+ restoreRootThemeMutationState(state);
1043
+ rootThemeMutationRef.current = null;
1044
+ };
1045
+ }, [enabled, target]);
1046
+ useIsomorphicLayoutEffect(() => {
1047
+ if (!isBrowser || !enabled) return;
1048
+ const targets = (target === "root" ? [document.documentElement] : [portalContainer]).filter((element) => element != null);
1049
+ if (targets.length === 0) return;
1050
+ for (const el of targets) {
1051
+ const resolvedConfig = {
1052
+ ...effectiveConfig,
1053
+ accent: effectiveConfig.accentExplicit ? effectiveConfig.accent : void 0,
1054
+ colorScheme
1055
+ };
1056
+ if (target === "root" && rootThemeMutationRef.current?.target === el) {
1057
+ applyProviderThemeToRoot(
1058
+ rootThemeMutationRef.current,
1059
+ resolvedConfig,
1060
+ resolvedThemeConfigToStyle(effectiveConfig, visualSnapshot)
1061
+ );
1062
+ } else {
1063
+ applyTheme(el, resolvedConfig);
1064
+ }
1065
+ }
1066
+ persist(storageKey, config);
1067
+ }, [
1068
+ colorScheme,
1069
+ config,
1070
+ effectiveConfig,
1071
+ enabled,
1072
+ portalContainer,
1073
+ storageKey,
1074
+ target
1075
+ ]);
1076
+ const value = React3.useMemo(() => {
1077
+ const patch = (p) => setConfig((c) => patchThemeConfig(c, p));
1078
+ return {
1079
+ mode: effectiveConfig.mode,
1080
+ resolvedMode,
1081
+ colorScheme,
1082
+ baseColor: effectiveConfig.baseColor,
1083
+ accent: accentKey,
1084
+ accentPalette,
1085
+ density: effectiveConfig.density,
1086
+ intensity: effectiveConfig.intensity,
1087
+ radius: effectiveConfig.radius,
1088
+ font: effectiveConfig.font,
1089
+ colors: effectiveConfig.colors,
1090
+ tokens: effectiveConfig.tokens,
1091
+ themes: effectiveConfig.themes,
1092
+ components: effectiveConfig.components,
1093
+ activeTheme,
1094
+ setMode: (m) => patch({ mode: m }),
1095
+ toggleMode: () => setConfig((currentConfig) => {
1096
+ const currentMode = currentConfig.mode ?? effectiveConfig.mode;
1097
+ return patchThemeConfig(currentConfig, {
1098
+ mode: currentMode === "dark" ? "light" : "dark"
1099
+ });
1100
+ }),
1101
+ setBaseColor: (baseColor) => patch({ baseColor }),
1102
+ setAccent: (a) => patch({ accent: a }),
1103
+ setDensity: (d) => patch({ density: d }),
1104
+ setIntensity: (n) => patch({ intensity: n }),
1105
+ setRadius: (n) => patch({ radius: n }),
1106
+ setFont: (f) => patch({ font: f }),
1107
+ setColors: (colors) => patch({ colors }),
1108
+ setTokens: (t) => patch({ tokens: t }),
1109
+ setThemes: (t) => patch({ themes: t }),
1110
+ setComponents: (components) => patch({ components }),
1111
+ update: patch,
1112
+ reset: () => setConfig(initialConfig)
1113
+ };
1114
+ }, [effectiveConfig, resolvedMode, colorScheme, accentKey, accentPalette, activeTheme, initialConfig]);
1115
+ const inheritanceConfig = React3.useMemo(() => ({
1116
+ mode: effectiveConfig.mode,
1117
+ colorScheme,
1118
+ baseColor: effectiveConfig.baseColor,
1119
+ ...effectiveConfig.accentExplicit ? { accent: effectiveConfig.accent } : null,
1120
+ density: effectiveConfig.density,
1121
+ intensity: effectiveConfig.intensity,
1122
+ radius: effectiveConfig.radius,
1123
+ font: effectiveConfig.font,
1124
+ colors: effectiveConfig.colors,
1125
+ tokens: effectiveConfig.tokens,
1126
+ components: effectiveConfig.components,
1127
+ themes: effectiveConfig.themes
1128
+ }), [effectiveConfig, colorScheme]);
1129
+ const onChangeRef = React3.useRef(onChange);
1130
+ onChangeRef.current = onChange;
1131
+ React3.useEffect(() => {
1132
+ if (!enabled) return;
1133
+ onChangeRef.current?.(value);
1134
+ }, [enabled, value]);
1135
+ const activePortalContainer = enabled ? target === "scope" ? portalContainer : null : inheritedPortalContainer;
1136
+ const activeVisualSnapshot = enabled ? visualSnapshot : inheritedVisualSnapshot;
1137
+ const activeComponentOverrides = enabled ? effectiveConfig.components : void 0;
1138
+ const activeInheritanceConfig = enabled ? inheritanceConfig : inheritedConfig;
1139
+ const activeThemeValue = enabled ? value : inheritedThemeValue;
1140
+ if (target === "scope") {
1141
+ const Component = Tag;
1142
+ const scopeThemeStyle = enabled ? {
1143
+ color: "var(--fg)",
1144
+ fontFamily: "var(--font-sans)",
1145
+ ...resolvedThemeConfigToStyle(effectiveConfig, visualSnapshot)
1146
+ } : {};
1147
+ const scopeDataAttributes = enabled ? resolvedThemeConfigToDataAttributes(effectiveConfig, colorScheme) : {};
1148
+ const scopeNode = asChild && scopeChild ? React3.cloneElement(scopeChild, {
1149
+ ...scopeDataAttributes,
1150
+ ref: mergedScopeRef,
1151
+ className: [className, scopeChild.props.className].filter(Boolean).join(" ") || void 0,
1152
+ style: {
1153
+ ...scopeThemeStyle,
1154
+ ...style,
1155
+ ...scopeChild.props.style
1156
+ }
1157
+ }) : /* @__PURE__ */ jsx(
1158
+ Component,
1159
+ {
1160
+ ref: scopeRef,
1161
+ className,
1162
+ ...scopeDataAttributes,
1163
+ style: {
1164
+ ...scopeThemeStyle,
1165
+ ...style
1166
+ },
1167
+ children
1168
+ }
1169
+ );
1170
+ return /* @__PURE__ */ jsx(PortalScopeProvider, { container: activePortalContainer, children: /* @__PURE__ */ jsx(VisualThemeProvider, { value: activeVisualSnapshot, children: /* @__PURE__ */ jsx(ComponentOverridesProvider, { value: activeComponentOverrides, children: /* @__PURE__ */ jsx(ThemeInheritanceCtx.Provider, { value: activeInheritanceConfig, children: /* @__PURE__ */ jsx(ThemeCtx.Provider, { value: activeThemeValue, children: scopeNode }) }) }) }) });
1171
+ }
1172
+ return /* @__PURE__ */ jsx(PortalScopeProvider, { container: activePortalContainer, children: /* @__PURE__ */ jsx(VisualThemeProvider, { value: activeVisualSnapshot, children: /* @__PURE__ */ jsx(ComponentOverridesProvider, { value: activeComponentOverrides, children: /* @__PURE__ */ jsx(ThemeInheritanceCtx.Provider, { value: activeInheritanceConfig, children: /* @__PURE__ */ jsx(ThemeCtx.Provider, { value: activeThemeValue, children }) }) }) }) });
1173
+ };
1174
+
1175
+ export { ACCENT_PRESETS, ACCENT_PRESETS_DARK, ComponentOverridesProvider, DEFAULT_THEME_COLORS, FONT_STACKS, OwnerPortalThemeProvider, ThemeProvider, VisualThemeProvider, applyTheme, componentTokensToStyle, deriveThemeColors, mergeComponentThemeOverrides, normalizeAccentInput, resolveThemeColorScheme, resolveThemeColors, resolveThemeMode, resolveVisualThemeSnapshot, subscribeImperativeThemeChange, themeColorsToStyle, themeTokenToKebabCase, useComponentOverrides, useOwnerPortalTheme, usePortalContainer, useTheme, useThemeOptional, useVisualThemeSnapshot, visualThemeToStyle };