@just-web/toolkits 1.0.0 → 2.1.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 (421) hide show
  1. package/dist/attributes/get-attribute.cjs +1 -1
  2. package/dist/attributes/get-attribute.cjs.map +1 -1
  3. package/dist/attributes/get-attribute.d.cts +2 -2
  4. package/dist/attributes/get-attribute.d.cts.map +1 -1
  5. package/dist/attributes/get-attribute.d.mts +2 -2
  6. package/dist/attributes/get-attribute.d.mts.map +1 -1
  7. package/dist/attributes/get-attribute.mjs +1 -1
  8. package/dist/attributes/get-attribute.mjs.map +1 -1
  9. package/dist/attributes/get-data-attribute.cjs +1 -1
  10. package/dist/attributes/get-data-attribute.cjs.map +1 -1
  11. package/dist/attributes/get-data-attribute.d.cts +2 -2
  12. package/dist/attributes/get-data-attribute.d.cts.map +1 -1
  13. package/dist/attributes/get-data-attribute.d.mts +2 -2
  14. package/dist/attributes/get-data-attribute.d.mts.map +1 -1
  15. package/dist/attributes/get-data-attribute.mjs +1 -1
  16. package/dist/attributes/get-data-attribute.mjs.map +1 -1
  17. package/dist/attributes/observe-attribute.cjs +1 -1
  18. package/dist/attributes/observe-attribute.cjs.map +1 -1
  19. package/dist/attributes/observe-attribute.d.cts +2 -2
  20. package/dist/attributes/observe-attribute.d.cts.map +1 -1
  21. package/dist/attributes/observe-attribute.d.mts +2 -2
  22. package/dist/attributes/observe-attribute.d.mts.map +1 -1
  23. package/dist/attributes/observe-attribute.mjs +1 -1
  24. package/dist/attributes/observe-attribute.mjs.map +1 -1
  25. package/dist/attributes/observe-data-attribute.cjs +1 -1
  26. package/dist/attributes/observe-data-attribute.cjs.map +1 -1
  27. package/dist/attributes/observe-data-attribute.d.cts +2 -2
  28. package/dist/attributes/observe-data-attribute.d.cts.map +1 -1
  29. package/dist/attributes/observe-data-attribute.d.mts +2 -2
  30. package/dist/attributes/observe-data-attribute.d.mts.map +1 -1
  31. package/dist/attributes/observe-data-attribute.mjs +1 -1
  32. package/dist/attributes/observe-data-attribute.mjs.map +1 -1
  33. package/dist/color-scheme/color-scheme.types.d.cts +11 -0
  34. package/dist/color-scheme/color-scheme.types.d.cts.map +1 -0
  35. package/dist/color-scheme/color-scheme.types.d.mts +11 -0
  36. package/dist/color-scheme/color-scheme.types.d.mts.map +1 -0
  37. package/dist/color-scheme/get-prefers-color-scheme.cjs +3 -1
  38. package/dist/color-scheme/get-prefers-color-scheme.cjs.map +1 -1
  39. package/dist/color-scheme/get-prefers-color-scheme.d.cts +7 -2
  40. package/dist/color-scheme/get-prefers-color-scheme.d.cts.map +1 -1
  41. package/dist/color-scheme/get-prefers-color-scheme.d.mts +7 -2
  42. package/dist/color-scheme/get-prefers-color-scheme.d.mts.map +1 -1
  43. package/dist/color-scheme/get-prefers-color-scheme.mjs +3 -1
  44. package/dist/color-scheme/get-prefers-color-scheme.mjs.map +1 -1
  45. package/dist/color-scheme/observe-prefers-color-scheme.cjs.map +1 -1
  46. package/dist/color-scheme/observe-prefers-color-scheme.d.cts +4 -1
  47. package/dist/color-scheme/observe-prefers-color-scheme.d.cts.map +1 -1
  48. package/dist/color-scheme/observe-prefers-color-scheme.d.mts +4 -1
  49. package/dist/color-scheme/observe-prefers-color-scheme.d.mts.map +1 -1
  50. package/dist/color-scheme/observe-prefers-color-scheme.mjs.map +1 -1
  51. package/dist/index.d.cts +2 -1
  52. package/dist/index.d.mts +2 -1
  53. package/dist/react/hooks/use-attribute.cjs +7 -7
  54. package/dist/react/hooks/use-attribute.cjs.map +1 -1
  55. package/dist/react/hooks/use-attribute.d.cts +4 -4
  56. package/dist/react/hooks/use-attribute.d.mts +4 -4
  57. package/dist/react/hooks/use-attribute.mjs +7 -7
  58. package/dist/react/hooks/use-attribute.mjs.map +1 -1
  59. package/dist/react/hooks/use-theme-by-class-name.cjs +2 -6
  60. package/dist/react/hooks/use-theme-by-class-name.cjs.map +1 -1
  61. package/dist/react/hooks/use-theme-by-class-name.d.cts +2 -2
  62. package/dist/react/hooks/use-theme-by-class-name.d.cts.map +1 -1
  63. package/dist/react/hooks/use-theme-by-class-name.d.mts +2 -2
  64. package/dist/react/hooks/use-theme-by-class-name.d.mts.map +1 -1
  65. package/dist/react/hooks/use-theme-by-class-name.mjs +2 -6
  66. package/dist/react/hooks/use-theme-by-class-name.mjs.map +1 -1
  67. package/dist/react/hooks/use-theme-by-data-attribute.cjs +2 -7
  68. package/dist/react/hooks/use-theme-by-data-attribute.cjs.map +1 -1
  69. package/dist/react/hooks/use-theme-by-data-attribute.d.cts +2 -2
  70. package/dist/react/hooks/use-theme-by-data-attribute.d.cts.map +1 -1
  71. package/dist/react/hooks/use-theme-by-data-attribute.d.mts +2 -2
  72. package/dist/react/hooks/use-theme-by-data-attribute.d.mts.map +1 -1
  73. package/dist/react/hooks/use-theme-by-data-attribute.mjs +2 -7
  74. package/dist/react/hooks/use-theme-by-data-attribute.mjs.map +1 -1
  75. package/dist/react/hooks/use-theme-by-local-storage.cjs +1 -5
  76. package/dist/react/hooks/use-theme-by-local-storage.cjs.map +1 -1
  77. package/dist/react/hooks/use-theme-by-local-storage.d.cts.map +1 -1
  78. package/dist/react/hooks/use-theme-by-local-storage.d.mts.map +1 -1
  79. package/dist/react/hooks/use-theme-by-local-storage.mjs +1 -5
  80. package/dist/react/hooks/use-theme-by-local-storage.mjs.map +1 -1
  81. package/dist/react/theme/create-theme-hook.cjs.map +1 -1
  82. package/dist/react/theme/create-theme-hook.mjs.map +1 -1
  83. package/dist/theme/_utils/match-attribute-value-to-theme.cjs +29 -0
  84. package/dist/theme/_utils/match-attribute-value-to-theme.cjs.map +1 -0
  85. package/dist/theme/_utils/match-attribute-value-to-theme.mjs +28 -0
  86. package/dist/theme/_utils/match-attribute-value-to-theme.mjs.map +1 -0
  87. package/dist/theme/_utils/parse-stored-theme.cjs +61 -7
  88. package/dist/theme/_utils/parse-stored-theme.cjs.map +1 -1
  89. package/dist/theme/_utils/parse-stored-theme.mjs +61 -7
  90. package/dist/theme/_utils/parse-stored-theme.mjs.map +1 -1
  91. package/dist/theme/_utils/resolve-theme-map-value.cjs +19 -0
  92. package/dist/theme/_utils/resolve-theme-map-value.cjs.map +1 -0
  93. package/dist/theme/_utils/resolve-theme-map-value.mjs +17 -0
  94. package/dist/theme/_utils/resolve-theme-map-value.mjs.map +1 -0
  95. package/dist/theme/_utils/set-theme-to-stores.cjs +1 -1
  96. package/dist/theme/_utils/set-theme-to-stores.cjs.map +1 -1
  97. package/dist/theme/_utils/set-theme-to-stores.mjs +1 -1
  98. package/dist/theme/_utils/set-theme-to-stores.mjs.map +1 -1
  99. package/dist/theme/class-name/parse-class-name.cjs +32 -0
  100. package/dist/theme/class-name/parse-class-name.cjs.map +1 -0
  101. package/dist/theme/class-name/parse-class-name.d.cts +20 -0
  102. package/dist/theme/class-name/parse-class-name.d.cts.map +1 -0
  103. package/dist/theme/class-name/parse-class-name.d.mts +20 -0
  104. package/dist/theme/class-name/parse-class-name.d.mts.map +1 -0
  105. package/dist/theme/class-name/parse-class-name.mjs +31 -0
  106. package/dist/theme/class-name/parse-class-name.mjs.map +1 -0
  107. package/dist/theme/class-name/read-class-name.cjs +20 -0
  108. package/dist/theme/class-name/read-class-name.cjs.map +1 -0
  109. package/dist/theme/class-name/read-class-name.d.cts +20 -0
  110. package/dist/theme/class-name/read-class-name.d.cts.map +1 -0
  111. package/dist/theme/class-name/read-class-name.d.mts +20 -0
  112. package/dist/theme/class-name/read-class-name.d.mts.map +1 -0
  113. package/dist/theme/class-name/read-class-name.mjs +20 -0
  114. package/dist/theme/class-name/read-class-name.mjs.map +1 -0
  115. package/dist/theme/class-name/stringify-class-name.cjs +31 -0
  116. package/dist/theme/class-name/stringify-class-name.cjs.map +1 -0
  117. package/dist/theme/class-name/stringify-class-name.d.cts +21 -0
  118. package/dist/theme/class-name/stringify-class-name.d.cts.map +1 -0
  119. package/dist/theme/class-name/stringify-class-name.d.mts +21 -0
  120. package/dist/theme/class-name/stringify-class-name.d.mts.map +1 -0
  121. package/dist/theme/class-name/stringify-class-name.mjs +31 -0
  122. package/dist/theme/class-name/stringify-class-name.mjs.map +1 -0
  123. package/dist/theme/class-name/subscribe-class-name.cjs +31 -0
  124. package/dist/theme/class-name/subscribe-class-name.cjs.map +1 -0
  125. package/dist/theme/class-name/subscribe-class-name.d.cts +21 -0
  126. package/dist/theme/class-name/subscribe-class-name.d.cts.map +1 -0
  127. package/dist/theme/class-name/subscribe-class-name.d.mts +21 -0
  128. package/dist/theme/class-name/subscribe-class-name.d.mts.map +1 -0
  129. package/dist/theme/class-name/subscribe-class-name.mjs +31 -0
  130. package/dist/theme/class-name/subscribe-class-name.mjs.map +1 -0
  131. package/dist/theme/class-name/write-class-name.cjs +20 -0
  132. package/dist/theme/class-name/write-class-name.cjs.map +1 -0
  133. package/dist/theme/class-name/write-class-name.d.cts +20 -0
  134. package/dist/theme/class-name/write-class-name.d.cts.map +1 -0
  135. package/dist/theme/class-name/write-class-name.d.mts +20 -0
  136. package/dist/theme/class-name/write-class-name.d.mts.map +1 -0
  137. package/dist/theme/class-name/write-class-name.mjs +20 -0
  138. package/dist/theme/class-name/write-class-name.mjs.map +1 -0
  139. package/dist/theme/compose-theme-stores.cjs.map +1 -1
  140. package/dist/theme/compose-theme-stores.mjs.map +1 -1
  141. package/dist/theme/cookie/_cookie-utils.cjs +37 -0
  142. package/dist/theme/cookie/_cookie-utils.cjs.map +1 -0
  143. package/dist/theme/cookie/_cookie-utils.mjs +33 -0
  144. package/dist/theme/cookie/_cookie-utils.mjs.map +1 -0
  145. package/dist/theme/cookie/read-cookie-theme.cjs +22 -0
  146. package/dist/theme/cookie/read-cookie-theme.cjs.map +1 -0
  147. package/dist/theme/cookie/read-cookie-theme.d.cts +22 -0
  148. package/dist/theme/cookie/read-cookie-theme.d.cts.map +1 -0
  149. package/dist/theme/cookie/read-cookie-theme.d.mts +22 -0
  150. package/dist/theme/cookie/read-cookie-theme.d.mts.map +1 -0
  151. package/dist/theme/cookie/read-cookie-theme.mjs +22 -0
  152. package/dist/theme/cookie/read-cookie-theme.mjs.map +1 -0
  153. package/dist/theme/cookie/write-cookie-theme.cjs +29 -0
  154. package/dist/theme/cookie/write-cookie-theme.cjs.map +1 -0
  155. package/dist/theme/cookie/write-cookie-theme.d.cts +24 -0
  156. package/dist/theme/cookie/write-cookie-theme.d.cts.map +1 -0
  157. package/dist/theme/cookie/write-cookie-theme.d.mts +24 -0
  158. package/dist/theme/cookie/write-cookie-theme.d.mts.map +1 -0
  159. package/dist/theme/cookie/write-cookie-theme.mjs +29 -0
  160. package/dist/theme/cookie/write-cookie-theme.mjs.map +1 -0
  161. package/dist/theme/data-attribute/_constant.cjs +7 -0
  162. package/dist/theme/data-attribute/_constant.cjs.map +1 -0
  163. package/dist/theme/data-attribute/_constant.mjs +6 -0
  164. package/dist/theme/data-attribute/_constant.mjs.map +1 -0
  165. package/dist/theme/data-attribute/parse-data-attribute.cjs +24 -0
  166. package/dist/theme/data-attribute/parse-data-attribute.cjs.map +1 -0
  167. package/dist/theme/data-attribute/parse-data-attribute.d.cts +21 -0
  168. package/dist/theme/data-attribute/parse-data-attribute.d.cts.map +1 -0
  169. package/dist/theme/data-attribute/parse-data-attribute.d.mts +21 -0
  170. package/dist/theme/data-attribute/parse-data-attribute.d.mts.map +1 -0
  171. package/dist/theme/data-attribute/parse-data-attribute.mjs +24 -0
  172. package/dist/theme/data-attribute/parse-data-attribute.mjs.map +1 -0
  173. package/dist/theme/data-attribute/read-data-attribute.cjs +23 -0
  174. package/dist/theme/data-attribute/read-data-attribute.cjs.map +1 -0
  175. package/dist/theme/data-attribute/read-data-attribute.d.cts +21 -0
  176. package/dist/theme/data-attribute/read-data-attribute.d.cts.map +1 -0
  177. package/dist/theme/data-attribute/read-data-attribute.d.mts +21 -0
  178. package/dist/theme/data-attribute/read-data-attribute.d.mts.map +1 -0
  179. package/dist/theme/data-attribute/read-data-attribute.mjs +23 -0
  180. package/dist/theme/data-attribute/read-data-attribute.mjs.map +1 -0
  181. package/dist/theme/data-attribute/stringify-data-attribute.cjs +33 -0
  182. package/dist/theme/data-attribute/stringify-data-attribute.cjs.map +1 -0
  183. package/dist/theme/data-attribute/stringify-data-attribute.d.cts +23 -0
  184. package/dist/theme/data-attribute/stringify-data-attribute.d.cts.map +1 -0
  185. package/dist/theme/data-attribute/stringify-data-attribute.d.mts +23 -0
  186. package/dist/theme/data-attribute/stringify-data-attribute.d.mts.map +1 -0
  187. package/dist/theme/data-attribute/stringify-data-attribute.mjs +33 -0
  188. package/dist/theme/data-attribute/stringify-data-attribute.mjs.map +1 -0
  189. package/dist/theme/data-attribute/subscribe-data-attribute.cjs +28 -0
  190. package/dist/theme/data-attribute/subscribe-data-attribute.cjs.map +1 -0
  191. package/dist/theme/data-attribute/subscribe-data-attribute.d.cts +22 -0
  192. package/dist/theme/data-attribute/subscribe-data-attribute.d.cts.map +1 -0
  193. package/dist/theme/data-attribute/subscribe-data-attribute.d.mts +22 -0
  194. package/dist/theme/data-attribute/subscribe-data-attribute.d.mts.map +1 -0
  195. package/dist/theme/data-attribute/subscribe-data-attribute.mjs +28 -0
  196. package/dist/theme/data-attribute/subscribe-data-attribute.mjs.map +1 -0
  197. package/dist/theme/data-attribute/write-data-attribute.cjs +30 -0
  198. package/dist/theme/data-attribute/write-data-attribute.cjs.map +1 -0
  199. package/dist/theme/data-attribute/write-data-attribute.d.cts +21 -0
  200. package/dist/theme/data-attribute/write-data-attribute.d.cts.map +1 -0
  201. package/dist/theme/data-attribute/write-data-attribute.d.mts +21 -0
  202. package/dist/theme/data-attribute/write-data-attribute.d.mts.map +1 -0
  203. package/dist/theme/data-attribute/write-data-attribute.mjs +30 -0
  204. package/dist/theme/data-attribute/write-data-attribute.mjs.map +1 -0
  205. package/dist/theme/local-storage/read-local-storage.cjs +22 -0
  206. package/dist/theme/local-storage/read-local-storage.cjs.map +1 -0
  207. package/dist/theme/local-storage/read-local-storage.d.cts +19 -0
  208. package/dist/theme/local-storage/read-local-storage.d.cts.map +1 -0
  209. package/dist/theme/local-storage/read-local-storage.d.mts +19 -0
  210. package/dist/theme/local-storage/read-local-storage.d.mts.map +1 -0
  211. package/dist/theme/local-storage/read-local-storage.mjs +22 -0
  212. package/dist/theme/local-storage/read-local-storage.mjs.map +1 -0
  213. package/dist/theme/local-storage/write-local-storage.cjs +26 -0
  214. package/dist/theme/local-storage/write-local-storage.cjs.map +1 -0
  215. package/dist/theme/local-storage/write-local-storage.d.cts +23 -0
  216. package/dist/theme/local-storage/write-local-storage.d.cts.map +1 -0
  217. package/dist/theme/local-storage/write-local-storage.d.mts +23 -0
  218. package/dist/theme/local-storage/write-local-storage.d.mts.map +1 -0
  219. package/dist/theme/local-storage/write-local-storage.mjs +26 -0
  220. package/dist/theme/local-storage/write-local-storage.mjs.map +1 -0
  221. package/dist/theme/prefers-color-scheme-theme/read-prefers-color-scheme-theme.cjs +20 -0
  222. package/dist/theme/prefers-color-scheme-theme/read-prefers-color-scheme-theme.cjs.map +1 -0
  223. package/dist/theme/prefers-color-scheme-theme/read-prefers-color-scheme-theme.d.cts +23 -0
  224. package/dist/theme/prefers-color-scheme-theme/read-prefers-color-scheme-theme.d.cts.map +1 -0
  225. package/dist/theme/prefers-color-scheme-theme/read-prefers-color-scheme-theme.d.mts +23 -0
  226. package/dist/theme/prefers-color-scheme-theme/read-prefers-color-scheme-theme.d.mts.map +1 -0
  227. package/dist/theme/prefers-color-scheme-theme/read-prefers-color-scheme-theme.mjs +20 -0
  228. package/dist/theme/prefers-color-scheme-theme/read-prefers-color-scheme-theme.mjs.map +1 -0
  229. package/dist/theme/prefers-color-scheme-theme/subscribe-prefers-color-scheme-theme.cjs +20 -0
  230. package/dist/theme/prefers-color-scheme-theme/subscribe-prefers-color-scheme-theme.cjs.map +1 -0
  231. package/dist/theme/prefers-color-scheme-theme/subscribe-prefers-color-scheme-theme.d.cts +20 -0
  232. package/dist/theme/prefers-color-scheme-theme/subscribe-prefers-color-scheme-theme.d.cts.map +1 -0
  233. package/dist/theme/prefers-color-scheme-theme/subscribe-prefers-color-scheme-theme.d.mts +20 -0
  234. package/dist/theme/prefers-color-scheme-theme/subscribe-prefers-color-scheme-theme.d.mts.map +1 -0
  235. package/dist/theme/prefers-color-scheme-theme/subscribe-prefers-color-scheme-theme.mjs +20 -0
  236. package/dist/theme/prefers-color-scheme-theme/subscribe-prefers-color-scheme-theme.mjs.map +1 -0
  237. package/dist/theme/session-storage/read-session-storage.cjs +22 -0
  238. package/dist/theme/session-storage/read-session-storage.cjs.map +1 -0
  239. package/dist/theme/session-storage/read-session-storage.d.cts +19 -0
  240. package/dist/theme/session-storage/read-session-storage.d.cts.map +1 -0
  241. package/dist/theme/session-storage/read-session-storage.d.mts +19 -0
  242. package/dist/theme/session-storage/read-session-storage.d.mts.map +1 -0
  243. package/dist/theme/session-storage/read-session-storage.mjs +22 -0
  244. package/dist/theme/session-storage/read-session-storage.mjs.map +1 -0
  245. package/dist/theme/session-storage/write-session-storage.cjs +26 -0
  246. package/dist/theme/session-storage/write-session-storage.cjs.map +1 -0
  247. package/dist/theme/session-storage/write-session-storage.d.cts +23 -0
  248. package/dist/theme/session-storage/write-session-storage.d.cts.map +1 -0
  249. package/dist/theme/session-storage/write-session-storage.d.mts +23 -0
  250. package/dist/theme/session-storage/write-session-storage.d.mts.map +1 -0
  251. package/dist/theme/session-storage/write-session-storage.mjs +26 -0
  252. package/dist/theme/session-storage/write-session-storage.mjs.map +1 -0
  253. package/dist/theme/theme-entry.types.d.cts +13 -1
  254. package/dist/theme/theme-entry.types.d.cts.map +1 -1
  255. package/dist/theme/theme-entry.types.d.mts +13 -1
  256. package/dist/theme/theme-entry.types.d.mts.map +1 -1
  257. package/dist/theme/theme-map.types.d.cts +11 -3
  258. package/dist/theme/theme-map.types.d.cts.map +1 -1
  259. package/dist/theme/theme-map.types.d.mts +11 -3
  260. package/dist/theme/theme-map.types.d.mts.map +1 -1
  261. package/dist/theme/theme-store/async-theme-store.types.d.cts +1 -1
  262. package/dist/theme/theme-store/async-theme-store.types.d.cts.map +1 -1
  263. package/dist/theme/theme-store/async-theme-store.types.d.mts +1 -1
  264. package/dist/theme/theme-store/async-theme-store.types.d.mts.map +1 -1
  265. package/dist/theme/theme-store/class-name-theme-store/class-name-theme-store.cjs +22 -19
  266. package/dist/theme/theme-store/class-name-theme-store/class-name-theme-store.cjs.map +1 -1
  267. package/dist/theme/theme-store/class-name-theme-store/class-name-theme-store.d.cts +7 -2
  268. package/dist/theme/theme-store/class-name-theme-store/class-name-theme-store.d.cts.map +1 -1
  269. package/dist/theme/theme-store/class-name-theme-store/class-name-theme-store.d.mts +7 -2
  270. package/dist/theme/theme-store/class-name-theme-store/class-name-theme-store.d.mts.map +1 -1
  271. package/dist/theme/theme-store/class-name-theme-store/class-name-theme-store.mjs +22 -19
  272. package/dist/theme/theme-store/class-name-theme-store/class-name-theme-store.mjs.map +1 -1
  273. package/dist/theme/theme-store/cookie-theme-store/cookie-theme-store.cjs +18 -36
  274. package/dist/theme/theme-store/cookie-theme-store/cookie-theme-store.cjs.map +1 -1
  275. package/dist/theme/theme-store/cookie-theme-store/cookie-theme-store.d.cts +5 -3
  276. package/dist/theme/theme-store/cookie-theme-store/cookie-theme-store.d.cts.map +1 -1
  277. package/dist/theme/theme-store/cookie-theme-store/cookie-theme-store.d.mts +5 -3
  278. package/dist/theme/theme-store/cookie-theme-store/cookie-theme-store.d.mts.map +1 -1
  279. package/dist/theme/theme-store/cookie-theme-store/cookie-theme-store.mjs +18 -36
  280. package/dist/theme/theme-store/cookie-theme-store/cookie-theme-store.mjs.map +1 -1
  281. package/dist/theme/theme-store/data-attribute-theme-store/data-attribute-theme-store.cjs +40 -20
  282. package/dist/theme/theme-store/data-attribute-theme-store/data-attribute-theme-store.cjs.map +1 -1
  283. package/dist/theme/theme-store/data-attribute-theme-store/data-attribute-theme-store.d.cts +30 -7
  284. package/dist/theme/theme-store/data-attribute-theme-store/data-attribute-theme-store.d.cts.map +1 -1
  285. package/dist/theme/theme-store/data-attribute-theme-store/data-attribute-theme-store.d.mts +30 -7
  286. package/dist/theme/theme-store/data-attribute-theme-store/data-attribute-theme-store.d.mts.map +1 -1
  287. package/dist/theme/theme-store/data-attribute-theme-store/data-attribute-theme-store.mjs +40 -20
  288. package/dist/theme/theme-store/data-attribute-theme-store/data-attribute-theme-store.mjs.map +1 -1
  289. package/dist/theme/theme-store/in-memory-theme-store/in-memory-theme-store.cjs +1 -1
  290. package/dist/theme/theme-store/in-memory-theme-store/in-memory-theme-store.cjs.map +1 -1
  291. package/dist/theme/theme-store/in-memory-theme-store/in-memory-theme-store.d.cts +1 -1
  292. package/dist/theme/theme-store/in-memory-theme-store/in-memory-theme-store.d.mts +1 -1
  293. package/dist/theme/theme-store/in-memory-theme-store/in-memory-theme-store.mjs +1 -1
  294. package/dist/theme/theme-store/in-memory-theme-store/in-memory-theme-store.mjs.map +1 -1
  295. package/dist/theme/theme-store/local-storage-theme-store/local-storage-theme-store.cjs +13 -12
  296. package/dist/theme/theme-store/local-storage-theme-store/local-storage-theme-store.cjs.map +1 -1
  297. package/dist/theme/theme-store/local-storage-theme-store/local-storage-theme-store.d.cts +8 -2
  298. package/dist/theme/theme-store/local-storage-theme-store/local-storage-theme-store.d.cts.map +1 -1
  299. package/dist/theme/theme-store/local-storage-theme-store/local-storage-theme-store.d.mts +8 -2
  300. package/dist/theme/theme-store/local-storage-theme-store/local-storage-theme-store.d.mts.map +1 -1
  301. package/dist/theme/theme-store/local-storage-theme-store/local-storage-theme-store.mjs +13 -12
  302. package/dist/theme/theme-store/local-storage-theme-store/local-storage-theme-store.mjs.map +1 -1
  303. package/dist/theme/theme-store/prefers-color-scheme-theme-store/prefers-color-scheme-theme-store.cjs +4 -5
  304. package/dist/theme/theme-store/prefers-color-scheme-theme-store/prefers-color-scheme-theme-store.cjs.map +1 -1
  305. package/dist/theme/theme-store/prefers-color-scheme-theme-store/prefers-color-scheme-theme-store.d.cts.map +1 -1
  306. package/dist/theme/theme-store/prefers-color-scheme-theme-store/prefers-color-scheme-theme-store.d.mts.map +1 -1
  307. package/dist/theme/theme-store/prefers-color-scheme-theme-store/prefers-color-scheme-theme-store.mjs +4 -5
  308. package/dist/theme/theme-store/prefers-color-scheme-theme-store/prefers-color-scheme-theme-store.mjs.map +1 -1
  309. package/dist/theme/theme-store/session-storage-theme-store/session-storage-theme-store.cjs +13 -12
  310. package/dist/theme/theme-store/session-storage-theme-store/session-storage-theme-store.cjs.map +1 -1
  311. package/dist/theme/theme-store/session-storage-theme-store/session-storage-theme-store.d.cts +8 -2
  312. package/dist/theme/theme-store/session-storage-theme-store/session-storage-theme-store.d.cts.map +1 -1
  313. package/dist/theme/theme-store/session-storage-theme-store/session-storage-theme-store.d.mts +8 -2
  314. package/dist/theme/theme-store/session-storage-theme-store/session-storage-theme-store.d.mts.map +1 -1
  315. package/dist/theme/theme-store/session-storage-theme-store/session-storage-theme-store.mjs +13 -12
  316. package/dist/theme/theme-store/session-storage-theme-store/session-storage-theme-store.mjs.map +1 -1
  317. package/dist/theme/theme-store/theme-store.types.d.cts +1 -1
  318. package/dist/theme/theme-store/theme-store.types.d.cts.map +1 -1
  319. package/dist/theme/theme-store/theme-store.types.d.mts +1 -1
  320. package/dist/theme/theme-store/theme-store.types.d.mts.map +1 -1
  321. package/dist/theme/web-storage/read-web-storage.cjs +20 -0
  322. package/dist/theme/web-storage/read-web-storage.cjs.map +1 -0
  323. package/dist/theme/web-storage/read-web-storage.d.cts +21 -0
  324. package/dist/theme/web-storage/read-web-storage.d.cts.map +1 -0
  325. package/dist/theme/web-storage/read-web-storage.d.mts +21 -0
  326. package/dist/theme/web-storage/read-web-storage.d.mts.map +1 -0
  327. package/dist/theme/web-storage/read-web-storage.mjs +20 -0
  328. package/dist/theme/web-storage/read-web-storage.mjs.map +1 -0
  329. package/dist/theme/web-storage/write-web-storage.cjs +33 -0
  330. package/dist/theme/web-storage/write-web-storage.cjs.map +1 -0
  331. package/dist/theme/web-storage/write-web-storage.d.cts +25 -0
  332. package/dist/theme/web-storage/write-web-storage.d.cts.map +1 -0
  333. package/dist/theme/web-storage/write-web-storage.d.mts +25 -0
  334. package/dist/theme/web-storage/write-web-storage.d.mts.map +1 -0
  335. package/dist/theme/web-storage/write-web-storage.mjs +32 -0
  336. package/dist/theme/web-storage/write-web-storage.mjs.map +1 -0
  337. package/dist/theme.cjs +41 -1
  338. package/dist/theme.d.cts +23 -3
  339. package/dist/theme.d.mts +23 -3
  340. package/dist/theme.mjs +21 -1
  341. package/dist/utils/append-id.cjs +2 -2
  342. package/dist/utils/append-id.cjs.map +1 -1
  343. package/dist/utils/append-id.d.cts +3 -3
  344. package/dist/utils/append-id.d.mts +3 -3
  345. package/dist/utils/append-id.mjs +2 -2
  346. package/dist/utils/append-id.mjs.map +1 -1
  347. package/package.json +1 -1
  348. package/src/attributes/get-attribute.ts +5 -2
  349. package/src/attributes/get-data-attribute.ts +5 -2
  350. package/src/attributes/observe-attribute.ts +2 -2
  351. package/src/attributes/observe-data-attribute.ts +2 -2
  352. package/src/color-scheme/color-scheme.types.ts +7 -0
  353. package/src/color-scheme/get-prefers-color-scheme.ts +6 -4
  354. package/src/color-scheme/observe-prefers-color-scheme.ts +3 -1
  355. package/src/index.ts +1 -0
  356. package/src/react/hooks/use-attribute.ts +11 -11
  357. package/src/react/hooks/use-theme-by-class-name.ts +5 -10
  358. package/src/react/hooks/use-theme-by-data-attribute.ts +5 -12
  359. package/src/react/hooks/use-theme-by-local-storage.ts +3 -9
  360. package/src/react/theme/create-theme-hook.ts +4 -6
  361. package/src/testing/theme/theme-result-card.tsx +1 -0
  362. package/src/theme/_utils/match-attribute-value-to-theme.ts +36 -0
  363. package/src/theme/_utils/parse-stored-theme.ts +51 -11
  364. package/src/theme/_utils/resolve-theme-map-value.ts +15 -0
  365. package/src/theme/_utils/set-theme-to-stores.ts +3 -3
  366. package/src/theme/class-name/parse-class-name.ts +31 -0
  367. package/src/theme/class-name/read-class-name.ts +24 -0
  368. package/src/theme/class-name/stringify-class-name.ts +36 -0
  369. package/src/theme/class-name/subscribe-class-name.ts +39 -0
  370. package/src/theme/class-name/write-class-name.ts +24 -0
  371. package/src/theme/compose-theme-stores.ts +1 -1
  372. package/src/theme/cookie/_cookie-utils.ts +45 -0
  373. package/src/theme/cookie/read-cookie-theme.ts +33 -0
  374. package/src/theme/cookie/write-cookie-theme.ts +48 -0
  375. package/src/theme/data-attribute/_constant.ts +1 -0
  376. package/src/theme/data-attribute/parse-data-attribute.ts +25 -0
  377. package/src/theme/data-attribute/read-data-attribute.ts +29 -0
  378. package/src/theme/data-attribute/stringify-data-attribute.ts +39 -0
  379. package/src/theme/data-attribute/subscribe-data-attribute.ts +39 -0
  380. package/src/theme/data-attribute/write-data-attribute.ts +40 -0
  381. package/src/theme/local-storage/read-local-storage.ts +23 -0
  382. package/src/theme/local-storage/write-local-storage.ts +31 -0
  383. package/src/theme/prefers-color-scheme-theme/read-prefers-color-scheme-theme.ts +30 -0
  384. package/src/theme/prefers-color-scheme-theme/subscribe-prefers-color-scheme-theme.ts +24 -0
  385. package/src/theme/session-storage/read-session-storage.ts +23 -0
  386. package/src/theme/session-storage/write-session-storage.ts +31 -0
  387. package/src/theme/theme-entry.types.ts +21 -0
  388. package/src/theme/theme-map.types.ts +9 -2
  389. package/src/theme/theme-store/async-theme-store.types.ts +1 -3
  390. package/src/theme/theme-store/class-name-theme-store/class-name-theme-store.ts +20 -26
  391. package/src/theme/theme-store/cookie-theme-store/cookie-theme-store.ts +18 -63
  392. package/src/theme/theme-store/data-attribute-theme-store/data-attribute-theme-store.ts +42 -29
  393. package/src/theme/theme-store/in-memory-theme-store/in-memory-theme-store.ts +1 -1
  394. package/src/theme/theme-store/local-storage-theme-store/local-storage-theme-store.ts +17 -20
  395. package/src/theme/theme-store/prefers-color-scheme-theme-store/prefers-color-scheme-theme-store.ts +4 -5
  396. package/src/theme/theme-store/session-storage-theme-store/session-storage-theme-store.ts +17 -20
  397. package/src/theme/theme-store/theme-store.types.ts +1 -3
  398. package/src/theme/web-storage/read-web-storage.ts +22 -0
  399. package/src/theme/web-storage/write-web-storage.ts +46 -0
  400. package/src/theme.ts +20 -0
  401. package/src/utils/append-id.ts +3 -3
  402. package/dist/theme/class-name/apply-theme-to-class-name.cjs +0 -23
  403. package/dist/theme/class-name/apply-theme-to-class-name.cjs.map +0 -1
  404. package/dist/theme/class-name/apply-theme-to-class-name.mjs +0 -22
  405. package/dist/theme/class-name/apply-theme-to-class-name.mjs.map +0 -1
  406. package/dist/theme/class-name/resolve-theme-from-class-name.cjs +0 -23
  407. package/dist/theme/class-name/resolve-theme-from-class-name.cjs.map +0 -1
  408. package/dist/theme/class-name/resolve-theme-from-class-name.mjs +0 -22
  409. package/dist/theme/class-name/resolve-theme-from-class-name.mjs.map +0 -1
  410. package/dist/theme/data-attribute/apply-theme-to-data-attribute.cjs +0 -23
  411. package/dist/theme/data-attribute/apply-theme-to-data-attribute.cjs.map +0 -1
  412. package/dist/theme/data-attribute/apply-theme-to-data-attribute.mjs +0 -22
  413. package/dist/theme/data-attribute/apply-theme-to-data-attribute.mjs.map +0 -1
  414. package/dist/theme/data-attribute/resolve-theme-from-data-attribute.cjs +0 -23
  415. package/dist/theme/data-attribute/resolve-theme-from-data-attribute.cjs.map +0 -1
  416. package/dist/theme/data-attribute/resolve-theme-from-data-attribute.mjs +0 -22
  417. package/dist/theme/data-attribute/resolve-theme-from-data-attribute.mjs.map +0 -1
  418. package/src/theme/class-name/apply-theme-to-class-name.ts +0 -26
  419. package/src/theme/class-name/resolve-theme-from-class-name.ts +0 -22
  420. package/src/theme/data-attribute/apply-theme-to-data-attribute.ts +0 -27
  421. package/src/theme/data-attribute/resolve-theme-from-data-attribute.ts +0 -23
@@ -4,7 +4,7 @@
4
4
  * Gets the value of an attribute from an element.
5
5
  *
6
6
  * @param qualifiedName - The name of the attribute to get
7
- * @param element - The element to get the attribute from. Defaults to `document.documentElement`
7
+ * @param element - The element to get the attribute from (accepts null e.g. from refs). Defaults to `document.documentElement`
8
8
  * @returns The attribute value cast to type T, or null if the attribute doesn't exist
9
9
  *
10
10
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"get-attribute.cjs","names":[],"sources":["../../src/attributes/get-attribute.ts"],"sourcesContent":["/**\n * Gets the value of an attribute from an element.\n *\n * @param qualifiedName - The name of the attribute to get\n * @param element - The element to get the attribute from. Defaults to `document.documentElement`\n * @returns The attribute value cast to type T, or null if the attribute doesn't exist\n *\n * @example\n * ```ts\n * // Get theme from document root\n * const theme = getAttribute('data-theme')\n *\n * // Get data-testid from a specific element\n * const testId = getAttribute('data-testid', element)\n * ```\n */\nexport function getAttribute<T extends string>(qualifiedName: T, element?: Element | undefined) {\n\telement = element ?? globalThis.document.documentElement\n\treturn element.getAttribute(qualifiedName)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,SAAgB,aAA+B,eAAkB,SAA+B;AAC/F,WAAU,WAAW,WAAW,SAAS;AACzC,QAAO,QAAQ,aAAa,cAAc"}
1
+ {"version":3,"file":"get-attribute.cjs","names":[],"sources":["../../src/attributes/get-attribute.ts"],"sourcesContent":["/**\n * Gets the value of an attribute from an element.\n *\n * @param qualifiedName - The name of the attribute to get\n * @param element - The element to get the attribute from (accepts null e.g. from refs). Defaults to `document.documentElement`\n * @returns The attribute value cast to type T, or null if the attribute doesn't exist\n *\n * @example\n * ```ts\n * // Get theme from document root\n * const theme = getAttribute('data-theme')\n *\n * // Get data-testid from a specific element\n * const testId = getAttribute('data-testid', element)\n * ```\n */\nexport function getAttribute<T extends string>(\n\tqualifiedName: T,\n\telement?: Element | null | undefined\n) {\n\telement = element ?? globalThis.document.documentElement\n\treturn element.getAttribute(qualifiedName)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBA,SAAgB,aACf,eACA,SACC;AACD,WAAU,WAAW,WAAW,SAAS;AACzC,QAAO,QAAQ,aAAa,cAAc"}
@@ -3,7 +3,7 @@
3
3
  * Gets the value of an attribute from an element.
4
4
  *
5
5
  * @param qualifiedName - The name of the attribute to get
6
- * @param element - The element to get the attribute from. Defaults to `document.documentElement`
6
+ * @param element - The element to get the attribute from (accepts null e.g. from refs). Defaults to `document.documentElement`
7
7
  * @returns The attribute value cast to type T, or null if the attribute doesn't exist
8
8
  *
9
9
  * @example
@@ -15,7 +15,7 @@
15
15
  * const testId = getAttribute('data-testid', element)
16
16
  * ```
17
17
  */
18
- declare function getAttribute<T extends string>(qualifiedName: T, element?: Element | undefined): string | null;
18
+ declare function getAttribute<T extends string>(qualifiedName: T, element?: Element | null | undefined): string | null;
19
19
  //#endregion
20
20
  export { getAttribute };
21
21
  //# sourceMappingURL=get-attribute.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-attribute.d.cts","names":[],"sources":["../../src/attributes/get-attribute.ts"],"sourcesContent":[],"mappings":";;AAgBA;;;;;;;;;;;;;;;iBAAgB,8CAA8C,aAAa"}
1
+ {"version":3,"file":"get-attribute.d.cts","names":[],"sources":["../../src/attributes/get-attribute.ts"],"sourcesContent":[],"mappings":";;AAgBA;;;;;;;;;;;;;;;iBAAgB,8CACA,aACL"}
@@ -3,7 +3,7 @@
3
3
  * Gets the value of an attribute from an element.
4
4
  *
5
5
  * @param qualifiedName - The name of the attribute to get
6
- * @param element - The element to get the attribute from. Defaults to `document.documentElement`
6
+ * @param element - The element to get the attribute from (accepts null e.g. from refs). Defaults to `document.documentElement`
7
7
  * @returns The attribute value cast to type T, or null if the attribute doesn't exist
8
8
  *
9
9
  * @example
@@ -15,7 +15,7 @@
15
15
  * const testId = getAttribute('data-testid', element)
16
16
  * ```
17
17
  */
18
- declare function getAttribute<T extends string>(qualifiedName: T, element?: Element | undefined): string | null;
18
+ declare function getAttribute<T extends string>(qualifiedName: T, element?: Element | null | undefined): string | null;
19
19
  //#endregion
20
20
  export { getAttribute };
21
21
  //# sourceMappingURL=get-attribute.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-attribute.d.mts","names":[],"sources":["../../src/attributes/get-attribute.ts"],"sourcesContent":[],"mappings":";;AAgBA;;;;;;;;;;;;;;;iBAAgB,8CAA8C,aAAa"}
1
+ {"version":3,"file":"get-attribute.d.mts","names":[],"sources":["../../src/attributes/get-attribute.ts"],"sourcesContent":[],"mappings":";;AAgBA;;;;;;;;;;;;;;;iBAAgB,8CACA,aACL"}
@@ -3,7 +3,7 @@
3
3
  * Gets the value of an attribute from an element.
4
4
  *
5
5
  * @param qualifiedName - The name of the attribute to get
6
- * @param element - The element to get the attribute from. Defaults to `document.documentElement`
6
+ * @param element - The element to get the attribute from (accepts null e.g. from refs). Defaults to `document.documentElement`
7
7
  * @returns The attribute value cast to type T, or null if the attribute doesn't exist
8
8
  *
9
9
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"get-attribute.mjs","names":[],"sources":["../../src/attributes/get-attribute.ts"],"sourcesContent":["/**\n * Gets the value of an attribute from an element.\n *\n * @param qualifiedName - The name of the attribute to get\n * @param element - The element to get the attribute from. Defaults to `document.documentElement`\n * @returns The attribute value cast to type T, or null if the attribute doesn't exist\n *\n * @example\n * ```ts\n * // Get theme from document root\n * const theme = getAttribute('data-theme')\n *\n * // Get data-testid from a specific element\n * const testId = getAttribute('data-testid', element)\n * ```\n */\nexport function getAttribute<T extends string>(qualifiedName: T, element?: Element | undefined) {\n\telement = element ?? globalThis.document.documentElement\n\treturn element.getAttribute(qualifiedName)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAgB,aAA+B,eAAkB,SAA+B;AAC/F,WAAU,WAAW,WAAW,SAAS;AACzC,QAAO,QAAQ,aAAa,cAAc"}
1
+ {"version":3,"file":"get-attribute.mjs","names":[],"sources":["../../src/attributes/get-attribute.ts"],"sourcesContent":["/**\n * Gets the value of an attribute from an element.\n *\n * @param qualifiedName - The name of the attribute to get\n * @param element - The element to get the attribute from (accepts null e.g. from refs). Defaults to `document.documentElement`\n * @returns The attribute value cast to type T, or null if the attribute doesn't exist\n *\n * @example\n * ```ts\n * // Get theme from document root\n * const theme = getAttribute('data-theme')\n *\n * // Get data-testid from a specific element\n * const testId = getAttribute('data-testid', element)\n * ```\n */\nexport function getAttribute<T extends string>(\n\tqualifiedName: T,\n\telement?: Element | null | undefined\n) {\n\telement = element ?? globalThis.document.documentElement\n\treturn element.getAttribute(qualifiedName)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAgB,aACf,eACA,SACC;AACD,WAAU,WAAW,WAAW,SAAS;AACzC,QAAO,QAAQ,aAAa,cAAc"}
@@ -5,7 +5,7 @@ const require_get_attribute = require('./get-attribute.cjs');
5
5
  * Gets the value of a data attribute from an element.
6
6
  *
7
7
  * @param qualifiedName - The name of the data attribute to get
8
- * @param element - The element to get the data attribute from. Defaults to `document.documentElement`
8
+ * @param element - The element to get the data attribute from (accepts null e.g. from refs). Defaults to `document.documentElement`
9
9
  * @returns The data attribute value, or null if the attribute doesn't exist
10
10
  *
11
11
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"get-data-attribute.cjs","names":["getAttribute"],"sources":["../../src/attributes/get-data-attribute.ts"],"sourcesContent":["import type { DataAttribute } from './data-attribute.ts'\nimport { getAttribute } from './get-attribute.ts'\n\n/**\n * Gets the value of a data attribute from an element.\n *\n * @param qualifiedName - The name of the data attribute to get\n * @param element - The element to get the data attribute from. Defaults to `document.documentElement`\n * @returns The data attribute value, or null if the attribute doesn't exist\n *\n * @example\n */\nexport function getDataAttribute(qualifiedName: DataAttribute, element?: Element | undefined) {\n\treturn getAttribute(qualifiedName, element)\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgB,iBAAiB,eAA8B,SAA+B;AAC7F,QAAOA,mCAAa,eAAe,QAAQ"}
1
+ {"version":3,"file":"get-data-attribute.cjs","names":["getAttribute"],"sources":["../../src/attributes/get-data-attribute.ts"],"sourcesContent":["import type { DataAttribute } from './data-attribute.ts'\nimport { getAttribute } from './get-attribute.ts'\n\n/**\n * Gets the value of a data attribute from an element.\n *\n * @param qualifiedName - The name of the data attribute to get\n * @param element - The element to get the data attribute from (accepts null e.g. from refs). Defaults to `document.documentElement`\n * @returns The data attribute value, or null if the attribute doesn't exist\n *\n * @example\n */\nexport function getDataAttribute(\n\tqualifiedName: DataAttribute,\n\telement?: Element | null | undefined\n) {\n\treturn getAttribute(qualifiedName, element)\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgB,iBACf,eACA,SACC;AACD,QAAOA,mCAAa,eAAe,QAAQ"}
@@ -6,12 +6,12 @@ import { DataAttribute } from "./data-attribute.cjs";
6
6
  * Gets the value of a data attribute from an element.
7
7
  *
8
8
  * @param qualifiedName - The name of the data attribute to get
9
- * @param element - The element to get the data attribute from. Defaults to `document.documentElement`
9
+ * @param element - The element to get the data attribute from (accepts null e.g. from refs). Defaults to `document.documentElement`
10
10
  * @returns The data attribute value, or null if the attribute doesn't exist
11
11
  *
12
12
  * @example
13
13
  */
14
- declare function getDataAttribute(qualifiedName: DataAttribute, element?: Element | undefined): string | null;
14
+ declare function getDataAttribute(qualifiedName: DataAttribute, element?: Element | null | undefined): string | null;
15
15
  //#endregion
16
16
  export { getDataAttribute };
17
17
  //# sourceMappingURL=get-data-attribute.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-data-attribute.d.cts","names":[],"sources":["../../src/attributes/get-data-attribute.ts"],"sourcesContent":[],"mappings":";;;;;;AAYA;;;;;;;iBAAgB,gBAAA,gBAAgC,yBAAyB"}
1
+ {"version":3,"file":"get-data-attribute.d.cts","names":[],"sources":["../../src/attributes/get-data-attribute.ts"],"sourcesContent":[],"mappings":";;;;;;AAYA;;;;;;;iBAAgB,gBAAA,gBACA,yBACL"}
@@ -6,12 +6,12 @@ import { DataAttribute } from "./data-attribute.mjs";
6
6
  * Gets the value of a data attribute from an element.
7
7
  *
8
8
  * @param qualifiedName - The name of the data attribute to get
9
- * @param element - The element to get the data attribute from. Defaults to `document.documentElement`
9
+ * @param element - The element to get the data attribute from (accepts null e.g. from refs). Defaults to `document.documentElement`
10
10
  * @returns The data attribute value, or null if the attribute doesn't exist
11
11
  *
12
12
  * @example
13
13
  */
14
- declare function getDataAttribute(qualifiedName: DataAttribute, element?: Element | undefined): string | null;
14
+ declare function getDataAttribute(qualifiedName: DataAttribute, element?: Element | null | undefined): string | null;
15
15
  //#endregion
16
16
  export { getDataAttribute };
17
17
  //# sourceMappingURL=get-data-attribute.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-data-attribute.d.mts","names":[],"sources":["../../src/attributes/get-data-attribute.ts"],"sourcesContent":[],"mappings":";;;;;;AAYA;;;;;;;iBAAgB,gBAAA,gBAAgC,yBAAyB"}
1
+ {"version":3,"file":"get-data-attribute.d.mts","names":[],"sources":["../../src/attributes/get-data-attribute.ts"],"sourcesContent":[],"mappings":";;;;;;AAYA;;;;;;;iBAAgB,gBAAA,gBACA,yBACL"}
@@ -5,7 +5,7 @@ import { getAttribute } from "./get-attribute.mjs";
5
5
  * Gets the value of a data attribute from an element.
6
6
  *
7
7
  * @param qualifiedName - The name of the data attribute to get
8
- * @param element - The element to get the data attribute from. Defaults to `document.documentElement`
8
+ * @param element - The element to get the data attribute from (accepts null e.g. from refs). Defaults to `document.documentElement`
9
9
  * @returns The data attribute value, or null if the attribute doesn't exist
10
10
  *
11
11
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"get-data-attribute.mjs","names":[],"sources":["../../src/attributes/get-data-attribute.ts"],"sourcesContent":["import type { DataAttribute } from './data-attribute.ts'\nimport { getAttribute } from './get-attribute.ts'\n\n/**\n * Gets the value of a data attribute from an element.\n *\n * @param qualifiedName - The name of the data attribute to get\n * @param element - The element to get the data attribute from. Defaults to `document.documentElement`\n * @returns The data attribute value, or null if the attribute doesn't exist\n *\n * @example\n */\nexport function getDataAttribute(qualifiedName: DataAttribute, element?: Element | undefined) {\n\treturn getAttribute(qualifiedName, element)\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgB,iBAAiB,eAA8B,SAA+B;AAC7F,QAAO,aAAa,eAAe,QAAQ"}
1
+ {"version":3,"file":"get-data-attribute.mjs","names":[],"sources":["../../src/attributes/get-data-attribute.ts"],"sourcesContent":["import type { DataAttribute } from './data-attribute.ts'\nimport { getAttribute } from './get-attribute.ts'\n\n/**\n * Gets the value of a data attribute from an element.\n *\n * @param qualifiedName - The name of the data attribute to get\n * @param element - The element to get the data attribute from (accepts null e.g. from refs). Defaults to `document.documentElement`\n * @returns The data attribute value, or null if the attribute doesn't exist\n *\n * @example\n */\nexport function getDataAttribute(\n\tqualifiedName: DataAttribute,\n\telement?: Element | null | undefined\n) {\n\treturn getAttribute(qualifiedName, element)\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgB,iBACf,eACA,SACC;AACD,QAAO,aAAa,eAAe,QAAQ"}
@@ -4,7 +4,7 @@
4
4
  * Observes attributes changes on an element and calls corresponding handlers.
5
5
  *
6
6
  * @param handlers - An object mapping attribute names to handler functions.
7
- * @param element - The element to observe. Defaults to `document.documentElement`.
7
+ * @param element - The element to observe (accepts null e.g. from refs). Defaults to `document.documentElement`.
8
8
  * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer.
9
9
  *
10
10
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"observe-attribute.cjs","names":[],"sources":["../../src/attributes/observe-attribute.ts"],"sourcesContent":["/**\n * Observes attributes changes on an element and calls corresponding handlers.\n *\n * @param handlers - An object mapping attribute names to handler functions.\n * @param element - The element to observe. Defaults to `document.documentElement`.\n * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer.\n *\n * @example\n * ```ts\n * const observer = observeAttributes({\n * 'data-theme': (attr, value) => console.log(`Theme changed to: ${value}`),\n * 'class': (attr, value) => console.log(`class changed to: ${value}`)\n * });\n *\n * // Later, to stop observing:\n * observer.disconnect();\n * ```\n */\nexport function observeAttributes<T extends string>(\n\thandlers: Record<string, (value: T | null) => void>,\n\telement?: Element | undefined\n) {\n\telement = element ?? globalThis.document.documentElement\n\tconst observer = new MutationObserver((mutations) => {\n\t\tfor (const mutation of mutations) {\n\t\t\tconst attribute = mutation.attributeName\n\t\t\tif (!attribute) continue\n\t\t\tconst value = element.getAttribute(attribute) as T | null\n\t\t\thandlers[attribute]?.(value)\n\t\t}\n\t})\n\tobserver.observe(element, {\n\t\tattributes: true,\n\t\tattributeFilter: Object.keys(handlers)\n\t})\n\treturn observer\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,kBACf,UACA,SACC;AACD,WAAU,WAAW,WAAW,SAAS;CACzC,MAAM,WAAW,IAAI,kBAAkB,cAAc;AACpD,OAAK,MAAM,YAAY,WAAW;GACjC,MAAM,YAAY,SAAS;AAC3B,OAAI,CAAC,UAAW;GAChB,MAAM,QAAQ,QAAQ,aAAa,UAAU;AAC7C,YAAS,aAAa,MAAM;;GAE5B;AACF,UAAS,QAAQ,SAAS;EACzB,YAAY;EACZ,iBAAiB,OAAO,KAAK,SAAS;EACtC,CAAC;AACF,QAAO"}
1
+ {"version":3,"file":"observe-attribute.cjs","names":[],"sources":["../../src/attributes/observe-attribute.ts"],"sourcesContent":["/**\n * Observes attributes changes on an element and calls corresponding handlers.\n *\n * @param handlers - An object mapping attribute names to handler functions.\n * @param element - The element to observe (accepts null e.g. from refs). Defaults to `document.documentElement`.\n * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer.\n *\n * @example\n * ```ts\n * const observer = observeAttributes({\n * 'data-theme': (attr, value) => console.log(`Theme changed to: ${value}`),\n * 'class': (attr, value) => console.log(`class changed to: ${value}`)\n * });\n *\n * // Later, to stop observing:\n * observer.disconnect();\n * ```\n */\nexport function observeAttributes<T extends string>(\n\thandlers: Record<string, (value: T | null) => void>,\n\telement?: Element | null | undefined\n) {\n\telement = element ?? globalThis.document.documentElement\n\tconst observer = new MutationObserver((mutations) => {\n\t\tfor (const mutation of mutations) {\n\t\t\tconst attribute = mutation.attributeName\n\t\t\tif (!attribute) continue\n\t\t\tconst value = element.getAttribute(attribute) as T | null\n\t\t\thandlers[attribute]?.(value)\n\t\t}\n\t})\n\tobserver.observe(element, {\n\t\tattributes: true,\n\t\tattributeFilter: Object.keys(handlers)\n\t})\n\treturn observer\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,kBACf,UACA,SACC;AACD,WAAU,WAAW,WAAW,SAAS;CACzC,MAAM,WAAW,IAAI,kBAAkB,cAAc;AACpD,OAAK,MAAM,YAAY,WAAW;GACjC,MAAM,YAAY,SAAS;AAC3B,OAAI,CAAC,UAAW;GAChB,MAAM,QAAQ,QAAQ,aAAa,UAAU;AAC7C,YAAS,aAAa,MAAM;;GAE5B;AACF,UAAS,QAAQ,SAAS;EACzB,YAAY;EACZ,iBAAiB,OAAO,KAAK,SAAS;EACtC,CAAC;AACF,QAAO"}
@@ -3,7 +3,7 @@
3
3
  * Observes attributes changes on an element and calls corresponding handlers.
4
4
  *
5
5
  * @param handlers - An object mapping attribute names to handler functions.
6
- * @param element - The element to observe. Defaults to `document.documentElement`.
6
+ * @param element - The element to observe (accepts null e.g. from refs). Defaults to `document.documentElement`.
7
7
  * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer.
8
8
  *
9
9
  * @example
@@ -17,7 +17,7 @@
17
17
  * observer.disconnect();
18
18
  * ```
19
19
  */
20
- declare function observeAttributes<T extends string>(handlers: Record<string, (value: T | null) => void>, element?: Element | undefined): MutationObserver;
20
+ declare function observeAttributes<T extends string>(handlers: Record<string, (value: T | null) => void>, element?: Element | null | undefined): MutationObserver;
21
21
  //#endregion
22
22
  export { observeAttributes };
23
23
  //# sourceMappingURL=observe-attribute.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"observe-attribute.d.cts","names":[],"sources":["../../src/attributes/observe-attribute.ts"],"sourcesContent":[],"mappings":";;AAkBA;;;;;;;;;;;;;;;;;iBAAgB,8CACL,uBAAuB,8BACvB,sBAAmB"}
1
+ {"version":3,"file":"observe-attribute.d.cts","names":[],"sources":["../../src/attributes/observe-attribute.ts"],"sourcesContent":[],"mappings":";;AAkBA;;;;;;;;;;;;;;;;;iBAAgB,8CACL,uBAAuB,8BACvB,6BAA0B"}
@@ -3,7 +3,7 @@
3
3
  * Observes attributes changes on an element and calls corresponding handlers.
4
4
  *
5
5
  * @param handlers - An object mapping attribute names to handler functions.
6
- * @param element - The element to observe. Defaults to `document.documentElement`.
6
+ * @param element - The element to observe (accepts null e.g. from refs). Defaults to `document.documentElement`.
7
7
  * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer.
8
8
  *
9
9
  * @example
@@ -17,7 +17,7 @@
17
17
  * observer.disconnect();
18
18
  * ```
19
19
  */
20
- declare function observeAttributes<T extends string>(handlers: Record<string, (value: T | null) => void>, element?: Element | undefined): MutationObserver;
20
+ declare function observeAttributes<T extends string>(handlers: Record<string, (value: T | null) => void>, element?: Element | null | undefined): MutationObserver;
21
21
  //#endregion
22
22
  export { observeAttributes };
23
23
  //# sourceMappingURL=observe-attribute.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"observe-attribute.d.mts","names":[],"sources":["../../src/attributes/observe-attribute.ts"],"sourcesContent":[],"mappings":";;AAkBA;;;;;;;;;;;;;;;;;iBAAgB,8CACL,uBAAuB,8BACvB,sBAAmB"}
1
+ {"version":3,"file":"observe-attribute.d.mts","names":[],"sources":["../../src/attributes/observe-attribute.ts"],"sourcesContent":[],"mappings":";;AAkBA;;;;;;;;;;;;;;;;;iBAAgB,8CACL,uBAAuB,8BACvB,6BAA0B"}
@@ -3,7 +3,7 @@
3
3
  * Observes attributes changes on an element and calls corresponding handlers.
4
4
  *
5
5
  * @param handlers - An object mapping attribute names to handler functions.
6
- * @param element - The element to observe. Defaults to `document.documentElement`.
6
+ * @param element - The element to observe (accepts null e.g. from refs). Defaults to `document.documentElement`.
7
7
  * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer.
8
8
  *
9
9
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"observe-attribute.mjs","names":[],"sources":["../../src/attributes/observe-attribute.ts"],"sourcesContent":["/**\n * Observes attributes changes on an element and calls corresponding handlers.\n *\n * @param handlers - An object mapping attribute names to handler functions.\n * @param element - The element to observe. Defaults to `document.documentElement`.\n * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer.\n *\n * @example\n * ```ts\n * const observer = observeAttributes({\n * 'data-theme': (attr, value) => console.log(`Theme changed to: ${value}`),\n * 'class': (attr, value) => console.log(`class changed to: ${value}`)\n * });\n *\n * // Later, to stop observing:\n * observer.disconnect();\n * ```\n */\nexport function observeAttributes<T extends string>(\n\thandlers: Record<string, (value: T | null) => void>,\n\telement?: Element | undefined\n) {\n\telement = element ?? globalThis.document.documentElement\n\tconst observer = new MutationObserver((mutations) => {\n\t\tfor (const mutation of mutations) {\n\t\t\tconst attribute = mutation.attributeName\n\t\t\tif (!attribute) continue\n\t\t\tconst value = element.getAttribute(attribute) as T | null\n\t\t\thandlers[attribute]?.(value)\n\t\t}\n\t})\n\tobserver.observe(element, {\n\t\tattributes: true,\n\t\tattributeFilter: Object.keys(handlers)\n\t})\n\treturn observer\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,kBACf,UACA,SACC;AACD,WAAU,WAAW,WAAW,SAAS;CACzC,MAAM,WAAW,IAAI,kBAAkB,cAAc;AACpD,OAAK,MAAM,YAAY,WAAW;GACjC,MAAM,YAAY,SAAS;AAC3B,OAAI,CAAC,UAAW;GAChB,MAAM,QAAQ,QAAQ,aAAa,UAAU;AAC7C,YAAS,aAAa,MAAM;;GAE5B;AACF,UAAS,QAAQ,SAAS;EACzB,YAAY;EACZ,iBAAiB,OAAO,KAAK,SAAS;EACtC,CAAC;AACF,QAAO"}
1
+ {"version":3,"file":"observe-attribute.mjs","names":[],"sources":["../../src/attributes/observe-attribute.ts"],"sourcesContent":["/**\n * Observes attributes changes on an element and calls corresponding handlers.\n *\n * @param handlers - An object mapping attribute names to handler functions.\n * @param element - The element to observe (accepts null e.g. from refs). Defaults to `document.documentElement`.\n * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer.\n *\n * @example\n * ```ts\n * const observer = observeAttributes({\n * 'data-theme': (attr, value) => console.log(`Theme changed to: ${value}`),\n * 'class': (attr, value) => console.log(`class changed to: ${value}`)\n * });\n *\n * // Later, to stop observing:\n * observer.disconnect();\n * ```\n */\nexport function observeAttributes<T extends string>(\n\thandlers: Record<string, (value: T | null) => void>,\n\telement?: Element | null | undefined\n) {\n\telement = element ?? globalThis.document.documentElement\n\tconst observer = new MutationObserver((mutations) => {\n\t\tfor (const mutation of mutations) {\n\t\t\tconst attribute = mutation.attributeName\n\t\t\tif (!attribute) continue\n\t\t\tconst value = element.getAttribute(attribute) as T | null\n\t\t\thandlers[attribute]?.(value)\n\t\t}\n\t})\n\tobserver.observe(element, {\n\t\tattributes: true,\n\t\tattributeFilter: Object.keys(handlers)\n\t})\n\treturn observer\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,kBACf,UACA,SACC;AACD,WAAU,WAAW,WAAW,SAAS;CACzC,MAAM,WAAW,IAAI,kBAAkB,cAAc;AACpD,OAAK,MAAM,YAAY,WAAW;GACjC,MAAM,YAAY,SAAS;AAC3B,OAAI,CAAC,UAAW;GAChB,MAAM,QAAQ,QAAQ,aAAa,UAAU;AAC7C,YAAS,aAAa,MAAM;;GAE5B;AACF,UAAS,QAAQ,SAAS;EACzB,YAAY;EACZ,iBAAiB,OAAO,KAAK,SAAS;EACtC,CAAC;AACF,QAAO"}
@@ -6,7 +6,7 @@ const require_observe_attribute = require('./observe-attribute.cjs');
6
6
  *
7
7
  * @param options - Configuration options
8
8
  * @param options.handlers - An object mapping `data-*` attribute names to handler functions.
9
- * @param options.element - The element to observe. Defaults to `document.documentElement`
9
+ * @param options.element - The element to observe (accepts null e.g. from refs). Defaults to `document.documentElement`
10
10
  * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer
11
11
  *
12
12
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"observe-data-attribute.cjs","names":["observeAttributes"],"sources":["../../src/attributes/observe-data-attribute.ts"],"sourcesContent":["import { observeAttributes } from './observe-attribute.ts'\n\n/**\n * Observes changes to `data-*` attributes on an element and calls corresponding handlers.\n *\n * @param options - Configuration options\n * @param options.handlers - An object mapping `data-*` attribute names to handler functions.\n * @param options.element - The element to observe. Defaults to `document.documentElement`\n * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer\n *\n * @example\n * ```ts\n * const observer = observeDataAttributes({\n * handlers: {\n * 'data-theme': (value) => console.log(`Theme changed to: ${value}`),\n * 'data-mode': (value) => console.log(`Mode changed to: ${value}`)\n * }\n * });\n *\n * // Later, to stop observing:\n * observer.disconnect();\n * ```\n */\nexport function observeDataAttributes<T extends string, K extends `data-${string}`>(\n\thandlers: Record<K, (value: T | null) => void>,\n\telement?: Element | undefined\n) {\n\treturn observeAttributes(handlers, element)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,sBACf,UACA,SACC;AACD,QAAOA,4CAAkB,UAAU,QAAQ"}
1
+ {"version":3,"file":"observe-data-attribute.cjs","names":["observeAttributes"],"sources":["../../src/attributes/observe-data-attribute.ts"],"sourcesContent":["import { observeAttributes } from './observe-attribute.ts'\n\n/**\n * Observes changes to `data-*` attributes on an element and calls corresponding handlers.\n *\n * @param options - Configuration options\n * @param options.handlers - An object mapping `data-*` attribute names to handler functions.\n * @param options.element - The element to observe (accepts null e.g. from refs). Defaults to `document.documentElement`\n * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer\n *\n * @example\n * ```ts\n * const observer = observeDataAttributes({\n * handlers: {\n * 'data-theme': (value) => console.log(`Theme changed to: ${value}`),\n * 'data-mode': (value) => console.log(`Mode changed to: ${value}`)\n * }\n * });\n *\n * // Later, to stop observing:\n * observer.disconnect();\n * ```\n */\nexport function observeDataAttributes<T extends string, K extends `data-${string}`>(\n\thandlers: Record<K, (value: T | null) => void>,\n\telement?: Element | null | undefined\n) {\n\treturn observeAttributes(handlers, element)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,sBACf,UACA,SACC;AACD,QAAOA,4CAAkB,UAAU,QAAQ"}
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * @param options - Configuration options
6
6
  * @param options.handlers - An object mapping `data-*` attribute names to handler functions.
7
- * @param options.element - The element to observe. Defaults to `document.documentElement`
7
+ * @param options.element - The element to observe (accepts null e.g. from refs). Defaults to `document.documentElement`
8
8
  * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer
9
9
  *
10
10
  * @example
@@ -20,7 +20,7 @@
20
20
  * observer.disconnect();
21
21
  * ```
22
22
  */
23
- declare function observeDataAttributes<T extends string, K extends `data-${string}`>(handlers: Record<K, (value: T | null) => void>, element?: Element | undefined): MutationObserver;
23
+ declare function observeDataAttributes<T extends string, K extends `data-${string}`>(handlers: Record<K, (value: T | null) => void>, element?: Element | null | undefined): MutationObserver;
24
24
  //#endregion
25
25
  export { observeDataAttributes };
26
26
  //# sourceMappingURL=observe-data-attribute.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"observe-data-attribute.d.cts","names":[],"sources":["../../src/attributes/observe-data-attribute.ts"],"sourcesContent":[],"mappings":";;AAuBA;;;;;;;;;;;;;;;;;;;;iBAAgB,8EACL,OAAO,WAAW,8BAClB,sBAAmB"}
1
+ {"version":3,"file":"observe-data-attribute.d.cts","names":[],"sources":["../../src/attributes/observe-data-attribute.ts"],"sourcesContent":[],"mappings":";;AAuBA;;;;;;;;;;;;;;;;;;;;iBAAgB,8EACL,OAAO,WAAW,8BAClB,6BAA0B"}
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * @param options - Configuration options
6
6
  * @param options.handlers - An object mapping `data-*` attribute names to handler functions.
7
- * @param options.element - The element to observe. Defaults to `document.documentElement`
7
+ * @param options.element - The element to observe (accepts null e.g. from refs). Defaults to `document.documentElement`
8
8
  * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer
9
9
  *
10
10
  * @example
@@ -20,7 +20,7 @@
20
20
  * observer.disconnect();
21
21
  * ```
22
22
  */
23
- declare function observeDataAttributes<T extends string, K extends `data-${string}`>(handlers: Record<K, (value: T | null) => void>, element?: Element | undefined): MutationObserver;
23
+ declare function observeDataAttributes<T extends string, K extends `data-${string}`>(handlers: Record<K, (value: T | null) => void>, element?: Element | null | undefined): MutationObserver;
24
24
  //#endregion
25
25
  export { observeDataAttributes };
26
26
  //# sourceMappingURL=observe-data-attribute.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"observe-data-attribute.d.mts","names":[],"sources":["../../src/attributes/observe-data-attribute.ts"],"sourcesContent":[],"mappings":";;AAuBA;;;;;;;;;;;;;;;;;;;;iBAAgB,8EACL,OAAO,WAAW,8BAClB,sBAAmB"}
1
+ {"version":3,"file":"observe-data-attribute.d.mts","names":[],"sources":["../../src/attributes/observe-data-attribute.ts"],"sourcesContent":[],"mappings":";;AAuBA;;;;;;;;;;;;;;;;;;;;iBAAgB,8EACL,OAAO,WAAW,8BAClB,6BAA0B"}
@@ -6,7 +6,7 @@ import { observeAttributes } from "./observe-attribute.mjs";
6
6
  *
7
7
  * @param options - Configuration options
8
8
  * @param options.handlers - An object mapping `data-*` attribute names to handler functions.
9
- * @param options.element - The element to observe. Defaults to `document.documentElement`
9
+ * @param options.element - The element to observe (accepts null e.g. from refs). Defaults to `document.documentElement`
10
10
  * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer
11
11
  *
12
12
  * @example
@@ -1 +1 @@
1
- {"version":3,"file":"observe-data-attribute.mjs","names":[],"sources":["../../src/attributes/observe-data-attribute.ts"],"sourcesContent":["import { observeAttributes } from './observe-attribute.ts'\n\n/**\n * Observes changes to `data-*` attributes on an element and calls corresponding handlers.\n *\n * @param options - Configuration options\n * @param options.handlers - An object mapping `data-*` attribute names to handler functions.\n * @param options.element - The element to observe. Defaults to `document.documentElement`\n * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer\n *\n * @example\n * ```ts\n * const observer = observeDataAttributes({\n * handlers: {\n * 'data-theme': (value) => console.log(`Theme changed to: ${value}`),\n * 'data-mode': (value) => console.log(`Mode changed to: ${value}`)\n * }\n * });\n *\n * // Later, to stop observing:\n * observer.disconnect();\n * ```\n */\nexport function observeDataAttributes<T extends string, K extends `data-${string}`>(\n\thandlers: Record<K, (value: T | null) => void>,\n\telement?: Element | undefined\n) {\n\treturn observeAttributes(handlers, element)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,sBACf,UACA,SACC;AACD,QAAO,kBAAkB,UAAU,QAAQ"}
1
+ {"version":3,"file":"observe-data-attribute.mjs","names":[],"sources":["../../src/attributes/observe-data-attribute.ts"],"sourcesContent":["import { observeAttributes } from './observe-attribute.ts'\n\n/**\n * Observes changes to `data-*` attributes on an element and calls corresponding handlers.\n *\n * @param options - Configuration options\n * @param options.handlers - An object mapping `data-*` attribute names to handler functions.\n * @param options.element - The element to observe (accepts null e.g. from refs). Defaults to `document.documentElement`\n * @returns {MutationObserver} The observer instance, which can be used to disconnect the observer\n *\n * @example\n * ```ts\n * const observer = observeDataAttributes({\n * handlers: {\n * 'data-theme': (value) => console.log(`Theme changed to: ${value}`),\n * 'data-mode': (value) => console.log(`Mode changed to: ${value}`)\n * }\n * });\n *\n * // Later, to stop observing:\n * observer.disconnect();\n * ```\n */\nexport function observeDataAttributes<T extends string, K extends `data-${string}`>(\n\thandlers: Record<K, (value: T | null) => void>,\n\telement?: Element | null | undefined\n) {\n\treturn observeAttributes(handlers, element)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,sBACf,UACA,SACC;AACD,QAAO,kBAAkB,UAAU,QAAQ"}
@@ -0,0 +1,11 @@
1
+ //#region src/color-scheme/color-scheme.types.d.ts
2
+ /**
3
+ * The color scheme of the system.
4
+ *
5
+ * Per {@link https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme Media Queries Level 5 § prefers-color-scheme},
6
+ * these are the only valid values exposed by the `prefers-color-scheme` media feature.
7
+ */
8
+ type ColorScheme = 'light' | 'dark';
9
+ //#endregion
10
+ export { ColorScheme };
11
+ //# sourceMappingURL=color-scheme.types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-scheme.types.d.cts","names":[],"sources":["../../src/color-scheme/color-scheme.types.ts"],"sourcesContent":[],"mappings":";;AAMA;;;;;KAAY,WAAA"}
@@ -0,0 +1,11 @@
1
+ //#region src/color-scheme/color-scheme.types.d.ts
2
+ /**
3
+ * The color scheme of the system.
4
+ *
5
+ * Per {@link https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme Media Queries Level 5 § prefers-color-scheme},
6
+ * these are the only valid values exposed by the `prefers-color-scheme` media feature.
7
+ */
8
+ type ColorScheme = 'light' | 'dark';
9
+ //#endregion
10
+ export { ColorScheme };
11
+ //# sourceMappingURL=color-scheme.types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color-scheme.types.d.mts","names":[],"sources":["../../src/color-scheme/color-scheme.types.ts"],"sourcesContent":[],"mappings":";;AAMA;;;;;KAAY,WAAA"}
@@ -4,7 +4,9 @@
4
4
  * Gets the current preferred color scheme.
5
5
  * It can only be 'light' or 'dark'.
6
6
  *
7
- * Even if the browser preference is 'auto'/'device', it will return 'light' or 'dark'.
7
+ * Per {@link https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme Media Queries Level 5},
8
+ * the `prefers-color-scheme` media feature has only two valid values. Even if the browser
9
+ * preference is 'auto'/'device', it will return 'light' or 'dark'.
8
10
  *
9
11
  * When `matchMedia` is unavailable (e.g. SSR), returns `defaultColorScheme`.
10
12
  *
@@ -1 +1 @@
1
- {"version":3,"file":"get-prefers-color-scheme.cjs","names":[],"sources":["../../src/color-scheme/get-prefers-color-scheme.ts"],"sourcesContent":["/**\n * Gets the current preferred color scheme.\n * It can only be 'light' or 'dark'.\n *\n * Even if the browser preference is 'auto'/'device', it will return 'light' or 'dark'.\n *\n * When `matchMedia` is unavailable (e.g. SSR), returns `defaultColorScheme`.\n *\n * @param defaultColorScheme - Fallback when `matchMedia` is unavailable (default: `'light'`)\n * @returns 'light' or 'dark'\n */\nexport function getPrefersColorScheme(\n\tdefaultColorScheme: 'light' | 'dark' = 'light'\n): 'light' | 'dark' {\n\tif (typeof matchMedia === 'undefined') return defaultColorScheme\n\treturn matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark'\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,sBACf,qBAAuC,SACpB;AACnB,KAAI,OAAO,eAAe,YAAa,QAAO;AAC9C,QAAO,WAAW,gCAAgC,CAAC,UAAU,UAAU"}
1
+ {"version":3,"file":"get-prefers-color-scheme.cjs","names":[],"sources":["../../src/color-scheme/get-prefers-color-scheme.ts"],"sourcesContent":["import type { ColorScheme } from './color-scheme.types.ts'\n\n/**\n * Gets the current preferred color scheme.\n * It can only be 'light' or 'dark'.\n *\n * Per {@link https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme Media Queries Level 5},\n * the `prefers-color-scheme` media feature has only two valid values. Even if the browser\n * preference is 'auto'/'device', it will return 'light' or 'dark'.\n *\n * When `matchMedia` is unavailable (e.g. SSR), returns `defaultColorScheme`.\n *\n * @param defaultColorScheme - Fallback when `matchMedia` is unavailable (default: `'light'`)\n * @returns 'light' or 'dark'\n */\nexport function getPrefersColorScheme(defaultColorScheme: ColorScheme = 'light'): ColorScheme {\n\tif (typeof matchMedia === 'undefined') return defaultColorScheme\n\treturn matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark'\n}\n"],"mappings":";;;;;;;;;;;;;;;AAeA,SAAgB,sBAAsB,qBAAkC,SAAsB;AAC7F,KAAI,OAAO,eAAe,YAAa,QAAO;AAC9C,QAAO,WAAW,gCAAgC,CAAC,UAAU,UAAU"}
@@ -1,16 +1,21 @@
1
+ import { ColorScheme } from "./color-scheme.types.cjs";
2
+
1
3
  //#region src/color-scheme/get-prefers-color-scheme.d.ts
4
+
2
5
  /**
3
6
  * Gets the current preferred color scheme.
4
7
  * It can only be 'light' or 'dark'.
5
8
  *
6
- * Even if the browser preference is 'auto'/'device', it will return 'light' or 'dark'.
9
+ * Per {@link https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme Media Queries Level 5},
10
+ * the `prefers-color-scheme` media feature has only two valid values. Even if the browser
11
+ * preference is 'auto'/'device', it will return 'light' or 'dark'.
7
12
  *
8
13
  * When `matchMedia` is unavailable (e.g. SSR), returns `defaultColorScheme`.
9
14
  *
10
15
  * @param defaultColorScheme - Fallback when `matchMedia` is unavailable (default: `'light'`)
11
16
  * @returns 'light' or 'dark'
12
17
  */
13
- declare function getPrefersColorScheme(defaultColorScheme?: 'light' | 'dark'): 'light' | 'dark';
18
+ declare function getPrefersColorScheme(defaultColorScheme?: ColorScheme): ColorScheme;
14
19
  //#endregion
15
20
  export { getPrefersColorScheme };
16
21
  //# sourceMappingURL=get-prefers-color-scheme.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-prefers-color-scheme.d.cts","names":[],"sources":["../../src/color-scheme/get-prefers-color-scheme.ts"],"sourcesContent":[],"mappings":";;AAWA;;;;;;;;;;iBAAgB,qBAAA"}
1
+ {"version":3,"file":"get-prefers-color-scheme.d.cts","names":[],"sources":["../../src/color-scheme/get-prefers-color-scheme.ts"],"sourcesContent":[],"mappings":";;;;;;AAeA;;;;;;;;;;;iBAAgB,qBAAA,sBAA0C,cAAwB"}
@@ -1,16 +1,21 @@
1
+ import { ColorScheme } from "./color-scheme.types.mjs";
2
+
1
3
  //#region src/color-scheme/get-prefers-color-scheme.d.ts
4
+
2
5
  /**
3
6
  * Gets the current preferred color scheme.
4
7
  * It can only be 'light' or 'dark'.
5
8
  *
6
- * Even if the browser preference is 'auto'/'device', it will return 'light' or 'dark'.
9
+ * Per {@link https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme Media Queries Level 5},
10
+ * the `prefers-color-scheme` media feature has only two valid values. Even if the browser
11
+ * preference is 'auto'/'device', it will return 'light' or 'dark'.
7
12
  *
8
13
  * When `matchMedia` is unavailable (e.g. SSR), returns `defaultColorScheme`.
9
14
  *
10
15
  * @param defaultColorScheme - Fallback when `matchMedia` is unavailable (default: `'light'`)
11
16
  * @returns 'light' or 'dark'
12
17
  */
13
- declare function getPrefersColorScheme(defaultColorScheme?: 'light' | 'dark'): 'light' | 'dark';
18
+ declare function getPrefersColorScheme(defaultColorScheme?: ColorScheme): ColorScheme;
14
19
  //#endregion
15
20
  export { getPrefersColorScheme };
16
21
  //# sourceMappingURL=get-prefers-color-scheme.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-prefers-color-scheme.d.mts","names":[],"sources":["../../src/color-scheme/get-prefers-color-scheme.ts"],"sourcesContent":[],"mappings":";;AAWA;;;;;;;;;;iBAAgB,qBAAA"}
1
+ {"version":3,"file":"get-prefers-color-scheme.d.mts","names":[],"sources":["../../src/color-scheme/get-prefers-color-scheme.ts"],"sourcesContent":[],"mappings":";;;;;;AAeA;;;;;;;;;;;iBAAgB,qBAAA,sBAA0C,cAAwB"}
@@ -3,7 +3,9 @@
3
3
  * Gets the current preferred color scheme.
4
4
  * It can only be 'light' or 'dark'.
5
5
  *
6
- * Even if the browser preference is 'auto'/'device', it will return 'light' or 'dark'.
6
+ * Per {@link https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme Media Queries Level 5},
7
+ * the `prefers-color-scheme` media feature has only two valid values. Even if the browser
8
+ * preference is 'auto'/'device', it will return 'light' or 'dark'.
7
9
  *
8
10
  * When `matchMedia` is unavailable (e.g. SSR), returns `defaultColorScheme`.
9
11
  *
@@ -1 +1 @@
1
- {"version":3,"file":"get-prefers-color-scheme.mjs","names":[],"sources":["../../src/color-scheme/get-prefers-color-scheme.ts"],"sourcesContent":["/**\n * Gets the current preferred color scheme.\n * It can only be 'light' or 'dark'.\n *\n * Even if the browser preference is 'auto'/'device', it will return 'light' or 'dark'.\n *\n * When `matchMedia` is unavailable (e.g. SSR), returns `defaultColorScheme`.\n *\n * @param defaultColorScheme - Fallback when `matchMedia` is unavailable (default: `'light'`)\n * @returns 'light' or 'dark'\n */\nexport function getPrefersColorScheme(\n\tdefaultColorScheme: 'light' | 'dark' = 'light'\n): 'light' | 'dark' {\n\tif (typeof matchMedia === 'undefined') return defaultColorScheme\n\treturn matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark'\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,sBACf,qBAAuC,SACpB;AACnB,KAAI,OAAO,eAAe,YAAa,QAAO;AAC9C,QAAO,WAAW,gCAAgC,CAAC,UAAU,UAAU"}
1
+ {"version":3,"file":"get-prefers-color-scheme.mjs","names":[],"sources":["../../src/color-scheme/get-prefers-color-scheme.ts"],"sourcesContent":["import type { ColorScheme } from './color-scheme.types.ts'\n\n/**\n * Gets the current preferred color scheme.\n * It can only be 'light' or 'dark'.\n *\n * Per {@link https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme Media Queries Level 5},\n * the `prefers-color-scheme` media feature has only two valid values. Even if the browser\n * preference is 'auto'/'device', it will return 'light' or 'dark'.\n *\n * When `matchMedia` is unavailable (e.g. SSR), returns `defaultColorScheme`.\n *\n * @param defaultColorScheme - Fallback when `matchMedia` is unavailable (default: `'light'`)\n * @returns 'light' or 'dark'\n */\nexport function getPrefersColorScheme(defaultColorScheme: ColorScheme = 'light'): ColorScheme {\n\tif (typeof matchMedia === 'undefined') return defaultColorScheme\n\treturn matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark'\n}\n"],"mappings":";;;;;;;;;;;;;;AAeA,SAAgB,sBAAsB,qBAAkC,SAAsB;AAC7F,KAAI,OAAO,eAAe,YAAa,QAAO;AAC9C,QAAO,WAAW,gCAAgC,CAAC,UAAU,UAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"observe-prefers-color-scheme.cjs","names":[],"sources":["../../src/color-scheme/observe-prefers-color-scheme.ts"],"sourcesContent":["/**\n * Observes system color scheme preference changes and calls handlers when they occur.\n *\n * @param handler - A function that is called when the color scheme preference changes\n * @returns A cleanup function that removes all event listeners\n *\n * @example\n * ```ts\n * // Observe light/dark mode changes\n * const cleanup = observePrefersColorScheme((value) => console.log('Color scheme changed to:', value))\n *\n * // Later, to stop observing:\n * cleanup()\n * ```\n */\nexport function observePrefersColorScheme(handler: (value: 'light' | 'dark') => void) {\n\tconst m = globalThis.matchMedia('(prefers-color-scheme: light)')\n\tconst listener = (event: MediaQueryListEvent) => {\n\t\thandler(event.matches ? 'light' : 'dark')\n\t}\n\n\tm.addEventListener('change', listener)\n\treturn () => m.removeEventListener('change', listener)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAeA,SAAgB,0BAA0B,SAA4C;CACrF,MAAM,IAAI,WAAW,WAAW,gCAAgC;CAChE,MAAM,YAAY,UAA+B;AAChD,UAAQ,MAAM,UAAU,UAAU,OAAO;;AAG1C,GAAE,iBAAiB,UAAU,SAAS;AACtC,cAAa,EAAE,oBAAoB,UAAU,SAAS"}
1
+ {"version":3,"file":"observe-prefers-color-scheme.cjs","names":[],"sources":["../../src/color-scheme/observe-prefers-color-scheme.ts"],"sourcesContent":["import type { ColorScheme } from './color-scheme.types.ts'\n\n/**\n * Observes system color scheme preference changes and calls handlers when they occur.\n *\n * @param handler - A function that is called when the color scheme preference changes\n * @returns A cleanup function that removes all event listeners\n *\n * @example\n * ```ts\n * // Observe light/dark mode changes\n * const cleanup = observePrefersColorScheme((value) => console.log('Color scheme changed to:', value))\n *\n * // Later, to stop observing:\n * cleanup()\n * ```\n */\nexport function observePrefersColorScheme(handler: (value: ColorScheme) => void) {\n\tconst m = globalThis.matchMedia('(prefers-color-scheme: light)')\n\tconst listener = (event: MediaQueryListEvent) => {\n\t\thandler(event.matches ? 'light' : 'dark')\n\t}\n\n\tm.addEventListener('change', listener)\n\treturn () => m.removeEventListener('change', listener)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAgB,0BAA0B,SAAuC;CAChF,MAAM,IAAI,WAAW,WAAW,gCAAgC;CAChE,MAAM,YAAY,UAA+B;AAChD,UAAQ,MAAM,UAAU,UAAU,OAAO;;AAG1C,GAAE,iBAAiB,UAAU,SAAS;AACtC,cAAa,EAAE,oBAAoB,UAAU,SAAS"}
@@ -1,4 +1,7 @@
1
+ import { ColorScheme } from "./color-scheme.types.cjs";
2
+
1
3
  //#region src/color-scheme/observe-prefers-color-scheme.d.ts
4
+
2
5
  /**
3
6
  * Observes system color scheme preference changes and calls handlers when they occur.
4
7
  *
@@ -14,7 +17,7 @@
14
17
  * cleanup()
15
18
  * ```
16
19
  */
17
- declare function observePrefersColorScheme(handler: (value: 'light' | 'dark') => void): () => void;
20
+ declare function observePrefersColorScheme(handler: (value: ColorScheme) => void): () => void;
18
21
  //#endregion
19
22
  export { observePrefersColorScheme };
20
23
  //# sourceMappingURL=observe-prefers-color-scheme.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"observe-prefers-color-scheme.d.cts","names":[],"sources":["../../src/color-scheme/observe-prefers-color-scheme.ts"],"sourcesContent":[],"mappings":";;AAeA;;;;;;;;;;;;;;iBAAgB,yBAAA"}
1
+ {"version":3,"file":"observe-prefers-color-scheme.d.cts","names":[],"sources":["../../src/color-scheme/observe-prefers-color-scheme.ts"],"sourcesContent":[],"mappings":";;;;;;AAiBA;;;;;;;;;;;;;iBAAgB,yBAAA,kBAA2C"}
@@ -1,4 +1,7 @@
1
+ import { ColorScheme } from "./color-scheme.types.mjs";
2
+
1
3
  //#region src/color-scheme/observe-prefers-color-scheme.d.ts
4
+
2
5
  /**
3
6
  * Observes system color scheme preference changes and calls handlers when they occur.
4
7
  *
@@ -14,7 +17,7 @@
14
17
  * cleanup()
15
18
  * ```
16
19
  */
17
- declare function observePrefersColorScheme(handler: (value: 'light' | 'dark') => void): () => void;
20
+ declare function observePrefersColorScheme(handler: (value: ColorScheme) => void): () => void;
18
21
  //#endregion
19
22
  export { observePrefersColorScheme };
20
23
  //# sourceMappingURL=observe-prefers-color-scheme.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"observe-prefers-color-scheme.d.mts","names":[],"sources":["../../src/color-scheme/observe-prefers-color-scheme.ts"],"sourcesContent":[],"mappings":";;AAeA;;;;;;;;;;;;;;iBAAgB,yBAAA"}
1
+ {"version":3,"file":"observe-prefers-color-scheme.d.mts","names":[],"sources":["../../src/color-scheme/observe-prefers-color-scheme.ts"],"sourcesContent":[],"mappings":";;;;;;AAiBA;;;;;;;;;;;;;iBAAgB,yBAAA,kBAA2C"}
@@ -1 +1 @@
1
- {"version":3,"file":"observe-prefers-color-scheme.mjs","names":[],"sources":["../../src/color-scheme/observe-prefers-color-scheme.ts"],"sourcesContent":["/**\n * Observes system color scheme preference changes and calls handlers when they occur.\n *\n * @param handler - A function that is called when the color scheme preference changes\n * @returns A cleanup function that removes all event listeners\n *\n * @example\n * ```ts\n * // Observe light/dark mode changes\n * const cleanup = observePrefersColorScheme((value) => console.log('Color scheme changed to:', value))\n *\n * // Later, to stop observing:\n * cleanup()\n * ```\n */\nexport function observePrefersColorScheme(handler: (value: 'light' | 'dark') => void) {\n\tconst m = globalThis.matchMedia('(prefers-color-scheme: light)')\n\tconst listener = (event: MediaQueryListEvent) => {\n\t\thandler(event.matches ? 'light' : 'dark')\n\t}\n\n\tm.addEventListener('change', listener)\n\treturn () => m.removeEventListener('change', listener)\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAeA,SAAgB,0BAA0B,SAA4C;CACrF,MAAM,IAAI,WAAW,WAAW,gCAAgC;CAChE,MAAM,YAAY,UAA+B;AAChD,UAAQ,MAAM,UAAU,UAAU,OAAO;;AAG1C,GAAE,iBAAiB,UAAU,SAAS;AACtC,cAAa,EAAE,oBAAoB,UAAU,SAAS"}
1
+ {"version":3,"file":"observe-prefers-color-scheme.mjs","names":[],"sources":["../../src/color-scheme/observe-prefers-color-scheme.ts"],"sourcesContent":["import type { ColorScheme } from './color-scheme.types.ts'\n\n/**\n * Observes system color scheme preference changes and calls handlers when they occur.\n *\n * @param handler - A function that is called when the color scheme preference changes\n * @returns A cleanup function that removes all event listeners\n *\n * @example\n * ```ts\n * // Observe light/dark mode changes\n * const cleanup = observePrefersColorScheme((value) => console.log('Color scheme changed to:', value))\n *\n * // Later, to stop observing:\n * cleanup()\n * ```\n */\nexport function observePrefersColorScheme(handler: (value: ColorScheme) => void) {\n\tconst m = globalThis.matchMedia('(prefers-color-scheme: light)')\n\tconst listener = (event: MediaQueryListEvent) => {\n\t\thandler(event.matches ? 'light' : 'dark')\n\t}\n\n\tm.addEventListener('change', listener)\n\treturn () => m.removeEventListener('change', listener)\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAiBA,SAAgB,0BAA0B,SAAuC;CAChF,MAAM,IAAI,WAAW,WAAW,gCAAgC;CAChE,MAAM,YAAY,UAA+B;AAChD,UAAQ,MAAM,UAAU,UAAU,OAAO;;AAG1C,GAAE,iBAAiB,UAAU,SAAS;AACtC,cAAa,EAAE,oBAAoB,UAAU,SAAS"}
package/dist/index.d.cts CHANGED
@@ -9,6 +9,7 @@ import { ClassNameProps } from "./class-name/class-name-props.cjs";
9
9
  import { clsx } from "./class-name/clsx.cjs";
10
10
  import { JustClassName, JustClassNameFnProps, JustClassNameProps } from "./class-name/just-class-name.cjs";
11
11
  import { resolveClassName } from "./class-name/resolve-class-name.cjs";
12
+ import { ColorScheme } from "./color-scheme/color-scheme.types.cjs";
12
13
  import { getPrefersColorScheme } from "./color-scheme/get-prefers-color-scheme.cjs";
13
14
  import { observePrefersColorScheme } from "./color-scheme/observe-prefers-color-scheme.cjs";
14
15
  import { CSSProperties } from "./style/css-properties.cjs";
@@ -23,4 +24,4 @@ import { px2num } from "./units/px-2-num.cjs";
23
24
  import { px2rem } from "./units/px-2-rem.cjs";
24
25
  import { rem2px } from "./units/rem-2-px.cjs";
25
26
  import { appendId } from "./utils/append-id.cjs";
26
- export { CSSProperties, ClassNameProps, DataAttribute, JustChildren, JustChildrenFnProps, JustChildrenProps, JustClassName, JustClassNameFnProps, JustClassNameProps, JustStyle, JustStyleFnProps, JustStyleProps, StyleProps, appendId, clsx, defineCSSProperties, getAttribute, getCSSVariableValue, getDataAttribute, getPrefersColorScheme, getRemToPxScale, observeAttributes, observeDataAttributes, observePrefersColorScheme, px2num, px2rem, rem2px, resolveChildren, resolveClassName, resolveStyle, toDomStyle };
27
+ export { CSSProperties, ClassNameProps, ColorScheme, DataAttribute, JustChildren, JustChildrenFnProps, JustChildrenProps, JustClassName, JustClassNameFnProps, JustClassNameProps, JustStyle, JustStyleFnProps, JustStyleProps, StyleProps, appendId, clsx, defineCSSProperties, getAttribute, getCSSVariableValue, getDataAttribute, getPrefersColorScheme, getRemToPxScale, observeAttributes, observeDataAttributes, observePrefersColorScheme, px2num, px2rem, rem2px, resolveChildren, resolveClassName, resolveStyle, toDomStyle };
package/dist/index.d.mts CHANGED
@@ -9,6 +9,7 @@ import { ClassNameProps } from "./class-name/class-name-props.mjs";
9
9
  import { clsx } from "./class-name/clsx.mjs";
10
10
  import { JustClassName, JustClassNameFnProps, JustClassNameProps } from "./class-name/just-class-name.mjs";
11
11
  import { resolveClassName } from "./class-name/resolve-class-name.mjs";
12
+ import { ColorScheme } from "./color-scheme/color-scheme.types.mjs";
12
13
  import { getPrefersColorScheme } from "./color-scheme/get-prefers-color-scheme.mjs";
13
14
  import { observePrefersColorScheme } from "./color-scheme/observe-prefers-color-scheme.mjs";
14
15
  import { CSSProperties } from "./style/css-properties.mjs";
@@ -23,4 +24,4 @@ import { px2num } from "./units/px-2-num.mjs";
23
24
  import { px2rem } from "./units/px-2-rem.mjs";
24
25
  import { rem2px } from "./units/rem-2-px.mjs";
25
26
  import { appendId } from "./utils/append-id.mjs";
26
- export { CSSProperties, ClassNameProps, DataAttribute, JustChildren, JustChildrenFnProps, JustChildrenProps, JustClassName, JustClassNameFnProps, JustClassNameProps, JustStyle, JustStyleFnProps, JustStyleProps, StyleProps, appendId, clsx, defineCSSProperties, getAttribute, getCSSVariableValue, getDataAttribute, getPrefersColorScheme, getRemToPxScale, observeAttributes, observeDataAttributes, observePrefersColorScheme, px2num, px2rem, rem2px, resolveChildren, resolveClassName, resolveStyle, toDomStyle };
27
+ export { CSSProperties, ClassNameProps, ColorScheme, DataAttribute, JustChildren, JustChildrenFnProps, JustChildrenProps, JustClassName, JustClassNameFnProps, JustClassNameProps, JustStyle, JustStyleFnProps, JustStyleProps, StyleProps, appendId, clsx, defineCSSProperties, getAttribute, getCSSVariableValue, getDataAttribute, getPrefersColorScheme, getRemToPxScale, observeAttributes, observeDataAttributes, observePrefersColorScheme, px2num, px2rem, rem2px, resolveChildren, resolveClassName, resolveStyle, toDomStyle };