@ngneers/controls-themes 0.0.1-pre2

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 (483) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/api/index.d.ts +17 -0
  4. package/api/index.d.ts.map +1 -0
  5. package/api/index.js +16 -0
  6. package/api/style/apply-theme.d.ts +33 -0
  7. package/api/style/apply-theme.d.ts.map +1 -0
  8. package/api/style/apply-theme.js +260 -0
  9. package/api/style/get-class-name.d.ts +2 -0
  10. package/api/style/get-class-name.d.ts.map +1 -0
  11. package/api/style/get-class-name.js +8 -0
  12. package/api/style/style-scope.d.ts +15 -0
  13. package/api/style/style-scope.d.ts.map +1 -0
  14. package/api/style/style-scope.js +0 -0
  15. package/api/style/upsert-theme-style-element.d.ts +2 -0
  16. package/api/style/upsert-theme-style-element.d.ts.map +1 -0
  17. package/api/style/upsert-theme-style-element.js +23 -0
  18. package/api/theme/classes.d.ts +10 -0
  19. package/api/theme/classes.d.ts.map +1 -0
  20. package/api/theme/classes.js +0 -0
  21. package/api/theme/combine-variable-variations.d.ts +10 -0
  22. package/api/theme/combine-variable-variations.d.ts.map +1 -0
  23. package/api/theme/combine-variable-variations.js +10 -0
  24. package/api/theme/combine-variations.d.ts +9 -0
  25. package/api/theme/combine-variations.d.ts.map +1 -0
  26. package/api/theme/combine-variations.js +9 -0
  27. package/api/theme/control-template.d.ts +14 -0
  28. package/api/theme/control-template.d.ts.map +1 -0
  29. package/api/theme/control-template.js +4 -0
  30. package/api/theme/css.d.ts +4 -0
  31. package/api/theme/css.d.ts.map +1 -0
  32. package/api/theme/css.js +1 -0
  33. package/api/theme/repeat-variables.d.ts +10 -0
  34. package/api/theme/repeat-variables.d.ts.map +1 -0
  35. package/api/theme/repeat-variables.js +9 -0
  36. package/api/theme/scoped.d.ts +4 -0
  37. package/api/theme/scoped.d.ts.map +1 -0
  38. package/api/theme/scoped.js +0 -0
  39. package/api/theme/template-variable.d.ts +4 -0
  40. package/api/theme/template-variable.d.ts.map +1 -0
  41. package/api/theme/template-variable.js +0 -0
  42. package/api/theme/theme-part.d.ts +31 -0
  43. package/api/theme/theme-part.d.ts.map +1 -0
  44. package/api/theme/theme-part.js +17 -0
  45. package/api/theme/theme.d.ts +14 -0
  46. package/api/theme/theme.d.ts.map +1 -0
  47. package/api/theme/theme.js +12 -0
  48. package/api/theme/variable-template.d.ts +14 -0
  49. package/api/theme/variable-template.d.ts.map +1 -0
  50. package/api/theme/variable-template.js +10 -0
  51. package/api/theme/variable.d.ts +9 -0
  52. package/api/theme/variable.d.ts.map +1 -0
  53. package/api/theme/variable.js +2 -0
  54. package/api/utils/deep-keys.d.ts +6 -0
  55. package/api/utils/deep-keys.d.ts.map +1 -0
  56. package/api/utils/deep-keys.js +0 -0
  57. package/api/utils/deep-merge.d.ts +7 -0
  58. package/api/utils/deep-merge.d.ts.map +1 -0
  59. package/api/utils/deep-merge.js +20 -0
  60. package/api/utils/deep-set.d.ts +2 -0
  61. package/api/utils/deep-set.d.ts.map +1 -0
  62. package/api/utils/deep-set.js +15 -0
  63. package/api/utils/group-array-using.d.ts +2 -0
  64. package/api/utils/group-array-using.d.ts.map +1 -0
  65. package/api/utils/group-array-using.js +11 -0
  66. package/api/utils/sub-key.d.ts +3 -0
  67. package/api/utils/sub-key.d.ts.map +1 -0
  68. package/api/utils/sub-key.js +5 -0
  69. package/api/utils/union-to-intersection.d.ts +2 -0
  70. package/api/utils/union-to-intersection.d.ts.map +1 -0
  71. package/api/utils/union-to-intersection.js +0 -0
  72. package/base/accordion/index.d.ts +2 -0
  73. package/base/accordion/index.d.ts.map +1 -0
  74. package/base/accordion/index.js +9 -0
  75. package/base/accordion-panel/index.d.ts +2 -0
  76. package/base/accordion-panel/index.d.ts.map +1 -0
  77. package/base/accordion-panel/index.js +43 -0
  78. package/base/api/index.d.ts +3 -0
  79. package/base/api/index.d.ts.map +1 -0
  80. package/base/api/index.js +2 -0
  81. package/base/api/movable.d.ts +2 -0
  82. package/base/api/movable.d.ts.map +1 -0
  83. package/base/api/movable.js +13 -0
  84. package/base/api/resizable.d.ts +2 -0
  85. package/base/api/resizable.d.ts.map +1 -0
  86. package/base/api/resizable.js +13 -0
  87. package/base/avatar/index.d.ts +151 -0
  88. package/base/avatar/index.d.ts.map +1 -0
  89. package/base/avatar/index.js +41 -0
  90. package/base/breadcrumb/index.d.ts +2 -0
  91. package/base/breadcrumb/index.d.ts.map +1 -0
  92. package/base/breadcrumb/index.js +26 -0
  93. package/base/button/index.d.ts +2 -0
  94. package/base/button/index.d.ts.map +1 -0
  95. package/base/button/index.js +13 -0
  96. package/base/button-group/index.d.ts +2 -0
  97. package/base/button-group/index.d.ts.map +1 -0
  98. package/base/button-group/index.js +30 -0
  99. package/base/calendar/index.d.ts +2 -0
  100. package/base/calendar/index.d.ts.map +1 -0
  101. package/base/calendar/index.js +69 -0
  102. package/base/checkbox/index.d.ts +2 -0
  103. package/base/checkbox/index.d.ts.map +1 -0
  104. package/base/checkbox/index.js +35 -0
  105. package/base/chip/index.d.ts +2 -0
  106. package/base/chip/index.d.ts.map +1 -0
  107. package/base/chip/index.js +19 -0
  108. package/base/colors/index.d.ts +24 -0
  109. package/base/colors/index.d.ts.map +1 -0
  110. package/base/colors/index.js +112 -0
  111. package/base/dialog/index.d.ts +2 -0
  112. package/base/dialog/index.d.ts.map +1 -0
  113. package/base/dialog/index.js +36 -0
  114. package/base/drawer/index.d.ts +2 -0
  115. package/base/drawer/index.d.ts.map +1 -0
  116. package/base/drawer/index.js +35 -0
  117. package/base/edit-inplace/index.d.ts +2 -0
  118. package/base/edit-inplace/index.d.ts.map +1 -0
  119. package/base/edit-inplace/index.js +7 -0
  120. package/base/filter/index.d.ts +2 -0
  121. package/base/filter/index.d.ts.map +1 -0
  122. package/base/filter/index.js +52 -0
  123. package/base/global/index.d.ts +2 -0
  124. package/base/global/index.d.ts.map +1 -0
  125. package/base/global/index.js +25 -0
  126. package/base/icon/index.d.ts +2 -0
  127. package/base/icon/index.d.ts.map +1 -0
  128. package/base/icon/index.js +32 -0
  129. package/base/index.d.ts +368 -0
  130. package/base/index.d.ts.map +1 -0
  131. package/base/index.js +86 -0
  132. package/base/inplace/index.d.ts +2 -0
  133. package/base/inplace/index.d.ts.map +1 -0
  134. package/base/inplace/index.js +7 -0
  135. package/base/input/index.d.ts +2 -0
  136. package/base/input/index.d.ts.map +1 -0
  137. package/base/input/index.js +20 -0
  138. package/base/input-field/index.d.ts +2 -0
  139. package/base/input-field/index.d.ts.map +1 -0
  140. package/base/input-field/index.js +45 -0
  141. package/base/input-mask/index.d.ts +2 -0
  142. package/base/input-mask/index.d.ts.map +1 -0
  143. package/base/input-mask/index.js +24 -0
  144. package/base/item-view/index.d.ts +2 -0
  145. package/base/item-view/index.d.ts.map +1 -0
  146. package/base/item-view/index.js +44 -0
  147. package/base/list-box/index.d.ts +2 -0
  148. package/base/list-box/index.d.ts.map +1 -0
  149. package/base/list-box/index.js +29 -0
  150. package/base/menu/index.d.ts +2 -0
  151. package/base/menu/index.d.ts.map +1 -0
  152. package/base/menu/index.js +19 -0
  153. package/base/message/index.d.ts +2 -0
  154. package/base/message/index.d.ts.map +1 -0
  155. package/base/message/index.js +23 -0
  156. package/base/paginator/index.d.ts +2 -0
  157. package/base/paginator/index.d.ts.map +1 -0
  158. package/base/paginator/index.js +16 -0
  159. package/base/popover/index.d.ts +2 -0
  160. package/base/popover/index.d.ts.map +1 -0
  161. package/base/popover/index.js +43 -0
  162. package/base/progress/index.d.ts +2 -0
  163. package/base/progress/index.d.ts.map +1 -0
  164. package/base/progress/index.js +41 -0
  165. package/base/scroller/index.d.ts +2 -0
  166. package/base/scroller/index.d.ts.map +1 -0
  167. package/base/scroller/index.js +39 -0
  168. package/base/select/index.d.ts +2 -0
  169. package/base/select/index.d.ts.map +1 -0
  170. package/base/select/index.js +34 -0
  171. package/base/select-button/index.d.ts +2 -0
  172. package/base/select-button/index.d.ts.map +1 -0
  173. package/base/select-button/index.js +13 -0
  174. package/base/slider/index.d.ts +2 -0
  175. package/base/slider/index.d.ts.map +1 -0
  176. package/base/slider/index.js +65 -0
  177. package/base/spinner/index.d.ts +2 -0
  178. package/base/spinner/index.d.ts.map +1 -0
  179. package/base/spinner/index.js +29 -0
  180. package/base/splitter/index.d.ts +2 -0
  181. package/base/splitter/index.d.ts.map +1 -0
  182. package/base/splitter/index.js +58 -0
  183. package/base/switch/index.d.ts +2 -0
  184. package/base/switch/index.d.ts.map +1 -0
  185. package/base/switch/index.js +30 -0
  186. package/base/table/index.d.ts +15 -0
  187. package/base/table/index.d.ts.map +1 -0
  188. package/base/table/index.js +75 -0
  189. package/base/tabs/index.d.ts +2 -0
  190. package/base/tabs/index.d.ts.map +1 -0
  191. package/base/tabs/index.js +68 -0
  192. package/base/tag/index.d.ts +2 -0
  193. package/base/tag/index.d.ts.map +1 -0
  194. package/base/tag/index.js +23 -0
  195. package/base/toast/index.d.ts +2 -0
  196. package/base/toast/index.d.ts.map +1 -0
  197. package/base/toast/index.js +25 -0
  198. package/base/toggle-button/index.d.ts +2 -0
  199. package/base/toggle-button/index.d.ts.map +1 -0
  200. package/base/toggle-button/index.js +33 -0
  201. package/base/tooltip/index.d.ts +2 -0
  202. package/base/tooltip/index.d.ts.map +1 -0
  203. package/base/tooltip/index.js +85 -0
  204. package/index.d.ts +3 -0
  205. package/index.d.ts.map +1 -0
  206. package/index.js +2 -0
  207. package/nova/accordion/index.d.ts +150 -0
  208. package/nova/accordion/index.d.ts.map +1 -0
  209. package/nova/accordion/index.js +19 -0
  210. package/nova/accordion-panel/index.d.ts +150 -0
  211. package/nova/accordion-panel/index.d.ts.map +1 -0
  212. package/nova/accordion-panel/index.js +74 -0
  213. package/nova/api/index.d.ts +3 -0
  214. package/nova/api/index.d.ts.map +1 -0
  215. package/nova/api/index.js +2 -0
  216. package/nova/api/movable.d.ts +2 -0
  217. package/nova/api/movable.d.ts.map +1 -0
  218. package/nova/api/movable.js +18 -0
  219. package/nova/api/resizable.d.ts +2 -0
  220. package/nova/api/resizable.d.ts.map +1 -0
  221. package/nova/api/resizable.js +13 -0
  222. package/nova/avatar/index.d.ts +299 -0
  223. package/nova/avatar/index.d.ts.map +1 -0
  224. package/nova/avatar/index.js +48 -0
  225. package/nova/base/animation.d.ts +21 -0
  226. package/nova/base/animation.d.ts.map +1 -0
  227. package/nova/base/animation.js +30 -0
  228. package/nova/base/colors.d.ts +244 -0
  229. package/nova/base/colors.d.ts.map +1 -0
  230. package/nova/base/colors.js +100 -0
  231. package/nova/base/font.d.ts +37 -0
  232. package/nova/base/font.d.ts.map +1 -0
  233. package/nova/base/font.js +46 -0
  234. package/nova/base/index.d.ts +6 -0
  235. package/nova/base/index.d.ts.map +1 -0
  236. package/nova/base/index.js +5 -0
  237. package/nova/base/shadow.d.ts +13 -0
  238. package/nova/base/shadow.d.ts.map +1 -0
  239. package/nova/base/shadow.js +22 -0
  240. package/nova/base/sizes.d.ts +29 -0
  241. package/nova/base/sizes.d.ts.map +1 -0
  242. package/nova/base/sizes.js +38 -0
  243. package/nova/breadcrumb/index.d.ts +150 -0
  244. package/nova/breadcrumb/index.d.ts.map +1 -0
  245. package/nova/breadcrumb/index.js +45 -0
  246. package/nova/button/index.d.ts +150 -0
  247. package/nova/button/index.d.ts.map +1 -0
  248. package/nova/button/index.js +105 -0
  249. package/nova/button-group/index.d.ts +150 -0
  250. package/nova/button-group/index.d.ts.map +1 -0
  251. package/nova/button-group/index.js +59 -0
  252. package/nova/calendar/index.d.ts +150 -0
  253. package/nova/calendar/index.d.ts.map +1 -0
  254. package/nova/calendar/index.js +98 -0
  255. package/nova/checkbox/index.d.ts +142 -0
  256. package/nova/checkbox/index.d.ts.map +1 -0
  257. package/nova/checkbox/index.js +65 -0
  258. package/nova/chip/index.d.ts +150 -0
  259. package/nova/chip/index.d.ts.map +1 -0
  260. package/nova/chip/index.js +78 -0
  261. package/nova/colors/index.d.ts +27 -0
  262. package/nova/colors/index.d.ts.map +1 -0
  263. package/nova/colors/index.js +18 -0
  264. package/nova/dialog/index.d.ts +155 -0
  265. package/nova/dialog/index.d.ts.map +1 -0
  266. package/nova/dialog/index.js +40 -0
  267. package/nova/drawer/index.d.ts +164 -0
  268. package/nova/drawer/index.d.ts.map +1 -0
  269. package/nova/drawer/index.js +77 -0
  270. package/nova/edit-inplace/index.d.ts +133 -0
  271. package/nova/edit-inplace/index.d.ts.map +1 -0
  272. package/nova/edit-inplace/index.js +48 -0
  273. package/nova/filter/index.d.ts +133 -0
  274. package/nova/filter/index.d.ts.map +1 -0
  275. package/nova/filter/index.js +52 -0
  276. package/nova/icon/index.d.ts +120 -0
  277. package/nova/icon/index.d.ts.map +1 -0
  278. package/nova/icon/index.js +12 -0
  279. package/nova/index.d.ts +5678 -0
  280. package/nova/index.d.ts.map +1 -0
  281. package/nova/index.js +108 -0
  282. package/nova/inplace/index.d.ts +133 -0
  283. package/nova/inplace/index.d.ts.map +1 -0
  284. package/nova/inplace/index.js +29 -0
  285. package/nova/input/index.d.ts +133 -0
  286. package/nova/input/index.d.ts.map +1 -0
  287. package/nova/input/index.js +12 -0
  288. package/nova/input-field/index.d.ts +159 -0
  289. package/nova/input-field/index.d.ts.map +1 -0
  290. package/nova/input-field/index.js +247 -0
  291. package/nova/input-mask/index.d.ts +133 -0
  292. package/nova/input-mask/index.d.ts.map +1 -0
  293. package/nova/input-mask/index.js +23 -0
  294. package/nova/item-view/index.d.ts +133 -0
  295. package/nova/item-view/index.d.ts.map +1 -0
  296. package/nova/item-view/index.js +16 -0
  297. package/nova/list-box/index.d.ts +150 -0
  298. package/nova/list-box/index.d.ts.map +1 -0
  299. package/nova/list-box/index.js +71 -0
  300. package/nova/menu/index.d.ts +133 -0
  301. package/nova/menu/index.d.ts.map +1 -0
  302. package/nova/menu/index.js +62 -0
  303. package/nova/message/index.d.ts +150 -0
  304. package/nova/message/index.d.ts.map +1 -0
  305. package/nova/message/index.js +46 -0
  306. package/nova/paginator/index.d.ts +133 -0
  307. package/nova/paginator/index.d.ts.map +1 -0
  308. package/nova/paginator/index.js +19 -0
  309. package/nova/popover/index.d.ts +147 -0
  310. package/nova/popover/index.d.ts.map +1 -0
  311. package/nova/popover/index.js +65 -0
  312. package/nova/progress/index.d.ts +142 -0
  313. package/nova/progress/index.d.ts.map +1 -0
  314. package/nova/progress/index.js +84 -0
  315. package/nova/scroller/index.d.ts +133 -0
  316. package/nova/scroller/index.d.ts.map +1 -0
  317. package/nova/scroller/index.js +12 -0
  318. package/nova/select/index.d.ts +133 -0
  319. package/nova/select/index.d.ts.map +1 -0
  320. package/nova/select/index.js +39 -0
  321. package/nova/select-button/index.d.ts +133 -0
  322. package/nova/select-button/index.d.ts.map +1 -0
  323. package/nova/select-button/index.js +17 -0
  324. package/nova/slider/index.d.ts +133 -0
  325. package/nova/slider/index.d.ts.map +1 -0
  326. package/nova/slider/index.js +98 -0
  327. package/nova/spinner/index.d.ts +133 -0
  328. package/nova/spinner/index.d.ts.map +1 -0
  329. package/nova/spinner/index.js +57 -0
  330. package/nova/splitter/index.d.ts +120 -0
  331. package/nova/splitter/index.d.ts.map +1 -0
  332. package/nova/splitter/index.js +37 -0
  333. package/nova/switch/index.d.ts +142 -0
  334. package/nova/switch/index.d.ts.map +1 -0
  335. package/nova/switch/index.js +61 -0
  336. package/nova/table/index.d.ts +150 -0
  337. package/nova/table/index.d.ts.map +1 -0
  338. package/nova/table/index.js +63 -0
  339. package/nova/tabs/index.d.ts +150 -0
  340. package/nova/tabs/index.d.ts.map +1 -0
  341. package/nova/tabs/index.js +80 -0
  342. package/nova/tag/index.d.ts +150 -0
  343. package/nova/tag/index.d.ts.map +1 -0
  344. package/nova/tag/index.js +34 -0
  345. package/nova/toast/index.d.ts +159 -0
  346. package/nova/toast/index.d.ts.map +1 -0
  347. package/nova/toast/index.js +92 -0
  348. package/nova/toggle-button/index.d.ts +159 -0
  349. package/nova/toggle-button/index.d.ts.map +1 -0
  350. package/nova/toggle-button/index.js +65 -0
  351. package/nova/tooltip/index.d.ts +142 -0
  352. package/nova/tooltip/index.d.ts.map +1 -0
  353. package/nova/tooltip/index.js +53 -0
  354. package/package.json +519 -0
  355. package/templates/accordion/index.d.ts +2 -0
  356. package/templates/accordion/index.d.ts.map +1 -0
  357. package/templates/accordion/index.js +5 -0
  358. package/templates/accordion-panel/index.d.ts +2 -0
  359. package/templates/accordion-panel/index.d.ts.map +1 -0
  360. package/templates/accordion-panel/index.js +13 -0
  361. package/templates/api/index.d.ts +3 -0
  362. package/templates/api/index.d.ts.map +1 -0
  363. package/templates/api/index.js +2 -0
  364. package/templates/api/movable.d.ts +2 -0
  365. package/templates/api/movable.d.ts.map +1 -0
  366. package/templates/api/movable.js +5 -0
  367. package/templates/api/resizable.d.ts +2 -0
  368. package/templates/api/resizable.d.ts.map +1 -0
  369. package/templates/api/resizable.js +5 -0
  370. package/templates/avatar/index.d.ts +3 -0
  371. package/templates/avatar/index.d.ts.map +1 -0
  372. package/templates/avatar/index.js +10 -0
  373. package/templates/breadcrumb/index.d.ts +2 -0
  374. package/templates/breadcrumb/index.d.ts.map +1 -0
  375. package/templates/breadcrumb/index.js +8 -0
  376. package/templates/button/index.d.ts +2 -0
  377. package/templates/button/index.d.ts.map +1 -0
  378. package/templates/button/index.js +5 -0
  379. package/templates/button-group/index.d.ts +2 -0
  380. package/templates/button-group/index.d.ts.map +1 -0
  381. package/templates/button-group/index.js +8 -0
  382. package/templates/calendar/index.d.ts +2 -0
  383. package/templates/calendar/index.d.ts.map +1 -0
  384. package/templates/calendar/index.js +36 -0
  385. package/templates/checkbox/index.d.ts +2 -0
  386. package/templates/checkbox/index.d.ts.map +1 -0
  387. package/templates/checkbox/index.js +15 -0
  388. package/templates/chip/index.d.ts +2 -0
  389. package/templates/chip/index.d.ts.map +1 -0
  390. package/templates/chip/index.js +13 -0
  391. package/templates/dialog/index.d.ts +2 -0
  392. package/templates/dialog/index.d.ts.map +1 -0
  393. package/templates/dialog/index.js +16 -0
  394. package/templates/drawer/index.d.ts +2 -0
  395. package/templates/drawer/index.d.ts.map +1 -0
  396. package/templates/drawer/index.js +15 -0
  397. package/templates/edit-inplace/index.d.ts +2 -0
  398. package/templates/edit-inplace/index.d.ts.map +1 -0
  399. package/templates/edit-inplace/index.js +17 -0
  400. package/templates/filter/index.d.ts +2 -0
  401. package/templates/filter/index.d.ts.map +1 -0
  402. package/templates/filter/index.js +31 -0
  403. package/templates/global/index.d.ts +2 -0
  404. package/templates/global/index.d.ts.map +1 -0
  405. package/templates/global/index.js +5 -0
  406. package/templates/icon/index.d.ts +2 -0
  407. package/templates/icon/index.d.ts.map +1 -0
  408. package/templates/icon/index.js +5 -0
  409. package/templates/index.d.ts +46 -0
  410. package/templates/index.d.ts.map +1 -0
  411. package/templates/index.js +0 -0
  412. package/templates/inplace/index.d.ts +2 -0
  413. package/templates/inplace/index.d.ts.map +1 -0
  414. package/templates/inplace/index.js +5 -0
  415. package/templates/input/index.d.ts +3 -0
  416. package/templates/input/index.d.ts.map +1 -0
  417. package/templates/input/index.js +6 -0
  418. package/templates/input-field/index.d.ts +2 -0
  419. package/templates/input-field/index.d.ts.map +1 -0
  420. package/templates/input-field/index.js +16 -0
  421. package/templates/input-mask/index.d.ts +3 -0
  422. package/templates/input-mask/index.d.ts.map +1 -0
  423. package/templates/input-mask/index.js +9 -0
  424. package/templates/item-view/index.d.ts +2 -0
  425. package/templates/item-view/index.d.ts.map +1 -0
  426. package/templates/item-view/index.js +13 -0
  427. package/templates/list-box/index.d.ts +2 -0
  428. package/templates/list-box/index.d.ts.map +1 -0
  429. package/templates/list-box/index.js +19 -0
  430. package/templates/menu/index.d.ts +2 -0
  431. package/templates/menu/index.d.ts.map +1 -0
  432. package/templates/menu/index.js +7 -0
  433. package/templates/message/index.d.ts +2 -0
  434. package/templates/message/index.d.ts.map +1 -0
  435. package/templates/message/index.js +5 -0
  436. package/templates/paginator/index.d.ts +2 -0
  437. package/templates/paginator/index.d.ts.map +1 -0
  438. package/templates/paginator/index.js +8 -0
  439. package/templates/popover/index.d.ts +2 -0
  440. package/templates/popover/index.d.ts.map +1 -0
  441. package/templates/popover/index.js +5 -0
  442. package/templates/progress/index.d.ts +2 -0
  443. package/templates/progress/index.d.ts.map +1 -0
  444. package/templates/progress/index.js +5 -0
  445. package/templates/scroller/index.d.ts +2 -0
  446. package/templates/scroller/index.d.ts.map +1 -0
  447. package/templates/scroller/index.js +5 -0
  448. package/templates/select/index.d.ts +2 -0
  449. package/templates/select/index.d.ts.map +1 -0
  450. package/templates/select/index.js +20 -0
  451. package/templates/select-button/index.d.ts +2 -0
  452. package/templates/select-button/index.d.ts.map +1 -0
  453. package/templates/select-button/index.js +5 -0
  454. package/templates/slider/index.d.ts +2 -0
  455. package/templates/slider/index.d.ts.map +1 -0
  456. package/templates/slider/index.js +5 -0
  457. package/templates/spinner/index.d.ts +2 -0
  458. package/templates/spinner/index.d.ts.map +1 -0
  459. package/templates/spinner/index.js +5 -0
  460. package/templates/splitter/index.d.ts +2 -0
  461. package/templates/splitter/index.d.ts.map +1 -0
  462. package/templates/splitter/index.js +14 -0
  463. package/templates/switch/index.d.ts +2 -0
  464. package/templates/switch/index.d.ts.map +1 -0
  465. package/templates/switch/index.js +5 -0
  466. package/templates/table/index.d.ts +2 -0
  467. package/templates/table/index.d.ts.map +1 -0
  468. package/templates/table/index.js +35 -0
  469. package/templates/tabs/index.d.ts +2 -0
  470. package/templates/tabs/index.d.ts.map +1 -0
  471. package/templates/tabs/index.js +15 -0
  472. package/templates/tag/index.d.ts +2 -0
  473. package/templates/tag/index.d.ts.map +1 -0
  474. package/templates/tag/index.js +5 -0
  475. package/templates/toast/index.d.ts +2 -0
  476. package/templates/toast/index.d.ts.map +1 -0
  477. package/templates/toast/index.js +14 -0
  478. package/templates/toggle-button/index.d.ts +2 -0
  479. package/templates/toggle-button/index.d.ts.map +1 -0
  480. package/templates/toggle-button/index.js +6 -0
  481. package/templates/tooltip/index.d.ts +2 -0
  482. package/templates/tooltip/index.d.ts.map +1 -0
  483. package/templates/tooltip/index.js +20 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 NGneers
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # @ngneers/controls-themes
package/api/index.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ export * from './style/apply-theme';
2
+ export * from './style/get-class-name';
3
+ export * from './style/style-scope';
4
+ export * from './style/upsert-theme-style-element';
5
+ export * from './theme/classes';
6
+ export * from './theme/combine-variable-variations';
7
+ export * from './theme/combine-variations';
8
+ export * from './theme/control-template';
9
+ export * from './theme/css';
10
+ export * from './theme/repeat-variables';
11
+ export * from './theme/scoped';
12
+ export * from './theme/template-variable';
13
+ export * from './theme/theme';
14
+ export * from './theme/theme-part';
15
+ export * from './theme/variable';
16
+ export * from './theme/variable-template';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,qCAAqC,CAAC;AACpD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,0BAA0B,CAAC;AACzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC"}
package/api/index.js ADDED
@@ -0,0 +1,16 @@
1
+ export * from './style/apply-theme';
2
+ export * from './style/get-class-name';
3
+ export * from './style/style-scope';
4
+ export * from './style/upsert-theme-style-element';
5
+ export * from './theme/classes';
6
+ export * from './theme/combine-variable-variations';
7
+ export * from './theme/combine-variations';
8
+ export * from './theme/control-template';
9
+ export * from './theme/css';
10
+ export * from './theme/repeat-variables';
11
+ export * from './theme/scoped';
12
+ export * from './theme/template-variable';
13
+ export * from './theme/theme';
14
+ export * from './theme/theme-part';
15
+ export * from './theme/variable';
16
+ export * from './theme/variable-template';
@@ -0,0 +1,33 @@
1
+ import { type StyleScope } from './style-scope';
2
+ import { type Theme } from '../theme/theme';
3
+ import { type ThemePart } from '../theme/theme-part';
4
+ export type ApplyThemeOptions = {
5
+ /**
6
+ * The document to apply the theme to. Defaults to `window.document`.
7
+ * This is useful for server-side rendering or when you want to apply the theme to a
8
+ * specific document instance.
9
+ * @default `window.document`
10
+ */
11
+ document: Document;
12
+ /**
13
+ * The CSS layer to apply the theme to.
14
+ * If not provided, the theme will be applied to the default layer.
15
+ * @default `undefined`
16
+ */
17
+ layer?: string;
18
+ /**
19
+ * Defines whether the theme should be applied globally or scoped to a specific element.
20
+ * If not provided, the theme will be applied globally.
21
+ * @default `undefined`
22
+ */
23
+ styleScope?: StyleScope;
24
+ /**
25
+ * A prefix to add to the class names and CSS variables of the theme parts.
26
+ * This is useful for avoiding name collisions in the global scope.
27
+ * @default `'ngn-'`
28
+ */
29
+ namePrefix: string;
30
+ };
31
+ export declare function applyTheme<T extends Theme>(theme: T, scopes: T['parts'][number]['scope'][], options: ApplyThemeOptions): void;
32
+ export declare function applyGlobalStyles(globalStyles: ThemePart, options: ApplyThemeOptions): void;
33
+ //# sourceMappingURL=apply-theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apply-theme.d.ts","sourceRoot":"","sources":["../../../../src/api/style/apply-theme.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGrD,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;OAKG;IACH,QAAQ,EAAE,QAAQ,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,wBAAgB,UAAU,CAAC,CAAC,SAAS,KAAK,EACxC,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,EACrC,OAAO,EAAE,iBAAiB,QA0C3B;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,iBAAiB,QA2BpF"}
@@ -0,0 +1,260 @@
1
+ import { getClassName } from './get-class-name';
2
+ import {} from './style-scope';
3
+ import { upsertThemeStyleElement } from './upsert-theme-style-element';
4
+ import {} from '../theme/theme';
5
+ import {} from '../theme/theme-part';
6
+ import { groupArrayUsing } from '../utils/group-array-using';
7
+ export function applyTheme(theme, scopes, options) {
8
+ const opt = {
9
+ document: options.document ?? window.document,
10
+ layer: options.layer,
11
+ scope: options.styleScope,
12
+ namePrefix: options.namePrefix ?? 'ngn-',
13
+ };
14
+ const parts = groupArrayUsing(getThemePartsByScopes(theme, scopes), x => x.scope);
15
+ // variable style elements
16
+ for (const [scope, scopeParts] of parts) {
17
+ const css = buildVariablesCss(scopeParts, opt);
18
+ upsertThemeStyleElement(opt.document, {
19
+ kind: 'variables',
20
+ 'theme-scope': scope,
21
+ 'style-scope': styleScopeToIdentifier(opt.scope),
22
+ }, css);
23
+ }
24
+ // style element
25
+ const allParts = scopes.map(scope => parts.get(scope) ?? scope);
26
+ for (const part of allParts) {
27
+ if (typeof part === 'string') {
28
+ console.warn(`No theme parts found for scope '${part}'. Skipping style generation.`);
29
+ continue;
30
+ }
31
+ const css = buildStyleCss(part, opt);
32
+ upsertThemeStyleElement(opt.document, {
33
+ kind: 'styles',
34
+ 'theme-scope': part[0]?.scope,
35
+ 'style-scope': styleScopeToIdentifier(opt.scope),
36
+ }, css);
37
+ }
38
+ }
39
+ export function applyGlobalStyles(globalStyles, options) {
40
+ const opt = {
41
+ document: options.document ?? window.document,
42
+ layer: options.layer,
43
+ scope: options.styleScope,
44
+ namePrefix: options.namePrefix ?? 'ngn-',
45
+ };
46
+ const cssVariables = buildVariablesCss([globalStyles], opt);
47
+ upsertThemeStyleElement(opt.document, {
48
+ kind: 'variables',
49
+ 'theme-scope': globalStyles.scope,
50
+ 'style-scope': styleScopeToIdentifier(opt.scope),
51
+ }, cssVariables);
52
+ const cssStyles = buildStyleCss([globalStyles], opt);
53
+ upsertThemeStyleElement(opt.document, {
54
+ kind: 'styles',
55
+ 'theme-scope': globalStyles.scope,
56
+ 'style-scope': styleScopeToIdentifier(opt.scope),
57
+ }, cssStyles);
58
+ }
59
+ function styleScopeToIdentifier(scope) {
60
+ if (!scope)
61
+ return undefined;
62
+ switch (scope.kind) {
63
+ case 'attribute':
64
+ return `attr:${scope.name}${scope.value ? `:${scope.value}` : ''}`;
65
+ case 'class':
66
+ return `class:${scope.name}`;
67
+ case 'id':
68
+ return `id:${scope.name}`;
69
+ case 'tag':
70
+ return `tag:${scope.name}`;
71
+ }
72
+ }
73
+ function getThemePartsByScopes(theme, scopes) {
74
+ const result = new Set();
75
+ for (const scope of scopes) {
76
+ collectThemeParts(theme, scope, result);
77
+ }
78
+ return Array.from(result);
79
+ }
80
+ function collectThemeParts(theme, scope, result = new Set()) {
81
+ for (const part of theme.parts) {
82
+ if (part.scope !== scope || result.has(part)) {
83
+ continue;
84
+ }
85
+ result.add(part);
86
+ for (const dep of part.dependencies ?? []) {
87
+ collectThemeParts(theme, dep.scope, result);
88
+ }
89
+ if (part.base) {
90
+ for (const dep of part.base.dependencies ?? []) {
91
+ collectThemeParts(theme, dep.scope, result);
92
+ }
93
+ }
94
+ }
95
+ return result;
96
+ }
97
+ function buildVariablesCss(parts, options) {
98
+ const cssParts = parts.map(part => ({
99
+ root: variableCssFromVariableDefinition(part.root?.values, options, part.scope),
100
+ light: variableCssFromVariableDefinition(part.light?.values, options, part.scope),
101
+ dark: variableCssFromVariableDefinition(part.dark?.values, options, part.scope),
102
+ highContrast: variableCssFromVariableDefinition(part.highContrast?.values, options, part.scope),
103
+ }));
104
+ let css = options.layer ? `@layer ${options.layer} { ` : '';
105
+ css += `${getScopeSelector(options.styleScope)} { `;
106
+ for (const { root, dark } of cssParts) {
107
+ if (root) {
108
+ css += root;
109
+ }
110
+ if (dark) {
111
+ // check for special 'dark' class on body
112
+ css += `&.dark { ${dark} }`;
113
+ }
114
+ }
115
+ // TODO: light, dark and highContrast themes
116
+ // TODO: Special handling for @media, @container, ... for scoping
117
+ css += ' }';
118
+ if (options.layer)
119
+ css += ' }';
120
+ return css;
121
+ }
122
+ function variableCssFromVariableDefinition(content, options, scope) {
123
+ if (typeof content !== 'object')
124
+ return '';
125
+ let result = '';
126
+ for (const key in content) {
127
+ const value = content[key];
128
+ if (!value)
129
+ continue;
130
+ if (typeof value === 'object') {
131
+ result += variableCssFromVariableDefinition(value, options, `${scope}-${key}`);
132
+ }
133
+ else if (typeof value === 'string') {
134
+ const varName = getCssVar(options.namePrefix, `${scope}.${key}`);
135
+ if (value.startsWith('{') && value.endsWith('}')) {
136
+ result += `${varName}: var(${getCssVar(options.namePrefix, value.slice(1, -1))});`;
137
+ }
138
+ else {
139
+ result += `${varName}: ${value};`;
140
+ }
141
+ }
142
+ }
143
+ return result;
144
+ }
145
+ function buildStyleCss(parts, options, isBase = false) {
146
+ const varKeySelector = (key) => `var(${getCssVar(options.namePrefix, key)})`;
147
+ const cssParts = parts.map(part => {
148
+ if (!part.root?.css && !part.light?.css && !part.dark?.css && !part.highContrast?.css) {
149
+ return {};
150
+ }
151
+ // Create a selector for unstyled mode. To avoid specificity issues, we use a always-true selector
152
+ // for when unstyled mode is active.
153
+ const unstyledSelector = `:not(${isBase ? '.ngn-css-specificity' : '.ngn-unstyled'})`;
154
+ const args = {
155
+ v: (key) => varKeySelector(key),
156
+ c: (className, kind = 'class') => {
157
+ const prefix = kind === 'animation' ? '' : '.';
158
+ const unstyledSuffix = kind === 'animation' ? '' : unstyledSelector;
159
+ return `${prefix}${getClassName(options.namePrefix, part.scope, className)}${unstyledSuffix}`;
160
+ },
161
+ d: (scope, className) => {
162
+ return `.${getClassName(options.namePrefix, scope, className)}${unstyledSelector}`;
163
+ },
164
+ };
165
+ return {
166
+ root: part.root?.css?.(args),
167
+ light: part.light?.css?.(args),
168
+ dark: part.dark?.css?.(args),
169
+ highContrast: part.highContrast?.css?.(args),
170
+ };
171
+ });
172
+ let css = options.layer ? `@layer ${options.layer} { ` : '';
173
+ const baseCss = parts
174
+ .filter(p => p.base)
175
+ .map(part => {
176
+ const base = part.base;
177
+ return buildStyleCss([base], { ...options, layer: undefined }, true);
178
+ });
179
+ if (baseCss.length > 0) {
180
+ css += baseCss.join('\n');
181
+ }
182
+ css += `${getScopeSelector(options.styleScope)} { `;
183
+ let unscopableCss = '';
184
+ for (const { root, dark } of cssParts) {
185
+ if (root) {
186
+ const { unscopable, scopable } = splitScopableCss(root);
187
+ css += scopable;
188
+ unscopableCss += unscopable;
189
+ }
190
+ if (dark) {
191
+ const { unscopable, scopable } = splitScopableCss(dark);
192
+ // check for special 'dark' class on body
193
+ css += `&.dark { ${scopable} }`;
194
+ if (unscopable) {
195
+ console.warn('Unscopable CSS inside dark theme is not supported and will be ignored:', unscopable);
196
+ }
197
+ }
198
+ }
199
+ // TODO: light, dark and highContrast themes
200
+ // TODO: Special handling for @media, @container, ... for scoping
201
+ css += ' }';
202
+ css += unscopableCss;
203
+ if (options.layer)
204
+ css += ' }';
205
+ return css;
206
+ }
207
+ function getScopeSelector(scope) {
208
+ if (!scope) {
209
+ return ':root';
210
+ }
211
+ switch (scope.kind) {
212
+ case 'attribute':
213
+ return `[${scope.name}${scope.value ? `="${scope.value}"` : ''}]`;
214
+ case 'class':
215
+ return `.${scope.name}`;
216
+ case 'id':
217
+ return `#${scope.name}`;
218
+ case 'tag':
219
+ return scope.name;
220
+ }
221
+ }
222
+ function getCssVar(prefix, key) {
223
+ // Replace dots with dashes and convert camelCase to kebab-case
224
+ const varName = key
225
+ .replace(/\./g, '-')
226
+ .replace(/([a-z])([A-Z])/g, '$1-$2')
227
+ .toLowerCase();
228
+ return `--${prefix}${varName}`;
229
+ }
230
+ function splitScopableCss(css) {
231
+ let depth = 0;
232
+ let result = {
233
+ scopable: '',
234
+ unscopable: '',
235
+ };
236
+ let start = 0;
237
+ let kind = 'scopable';
238
+ for (let i = 0; i < css.length; i++) {
239
+ const char = css[i];
240
+ // @MaSch0212 review the `!depth` condition here, some queries are allowed inside scopable css
241
+ if (!depth && char === '@' && (!css[i - 1] || css[i - 1] === ' ') && kind === 'scopable') {
242
+ result.scopable += css.slice(start, i - 1);
243
+ start = i;
244
+ kind = 'unscopable';
245
+ }
246
+ else if (char === '{') {
247
+ depth++;
248
+ }
249
+ else if (char === '}') {
250
+ depth--;
251
+ if (depth === 0 && kind === 'unscopable') {
252
+ result.unscopable += css.slice(start, i + 1);
253
+ start = i + 1;
254
+ kind = 'scopable';
255
+ }
256
+ }
257
+ }
258
+ result[kind] += css.slice(start);
259
+ return result;
260
+ }
@@ -0,0 +1,2 @@
1
+ export declare function getClassName(prefix: string, scope: string, className?: string, unstyled?: boolean): string;
2
+ //# sourceMappingURL=get-class-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-class-name.d.ts","sourceRoot":"","sources":["../../../../src/api/style/get-class-name.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,SAAS,CAAC,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,OAAO,GACjB,MAAM,CAKR"}
@@ -0,0 +1,8 @@
1
+ export function getClassName(prefix, scope, className, unstyled) {
2
+ let result = `${prefix}${scope}`;
3
+ if (className)
4
+ result += `-${className}`;
5
+ if (unstyled)
6
+ result += ` ngn-unstyled`;
7
+ return result;
8
+ }
@@ -0,0 +1,15 @@
1
+ export type StyleScope = {
2
+ kind: 'attribute';
3
+ name: string;
4
+ value?: string;
5
+ } | {
6
+ kind: 'class';
7
+ name: string;
8
+ } | {
9
+ kind: 'id';
10
+ name: string;
11
+ } | {
12
+ kind: 'tag';
13
+ name: string;
14
+ };
15
+ //# sourceMappingURL=style-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style-scope.d.ts","sourceRoot":"","sources":["../../../../src/api/style/style-scope.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAClB;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC"}
File without changes
@@ -0,0 +1,2 @@
1
+ export declare function upsertThemeStyleElement(document: Document, identifiers: Record<string, string | undefined>, css: string): HTMLStyleElement;
2
+ //# sourceMappingURL=upsert-theme-style-element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upsert-theme-style-element.d.ts","sourceRoot":"","sources":["../../../../src/api/style/upsert-theme-style-element.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAC/C,GAAG,EAAE,MAAM,GACV,gBAAgB,CAqBlB"}
@@ -0,0 +1,23 @@
1
+ export function upsertThemeStyleElement(document, identifiers, css) {
2
+ let selector = '';
3
+ for (const key in identifiers) {
4
+ if (identifiers[key] === undefined)
5
+ continue;
6
+ selector += `[data-${key}="${identifiers[key]}"]`;
7
+ }
8
+ if (!selector)
9
+ throw new Error('No identifiers provided for the style element');
10
+ let styleElement = document.head.querySelector(`style[ngn-style]${selector}`);
11
+ if (!styleElement) {
12
+ styleElement = document.createElement('style');
13
+ styleElement.setAttribute('ngn-style', '');
14
+ for (const key in identifiers) {
15
+ if (identifiers[key] === undefined)
16
+ continue;
17
+ styleElement.setAttribute(`data-${key}`, identifiers[key]);
18
+ }
19
+ document.head.appendChild(styleElement);
20
+ }
21
+ styleElement.innerHTML = css;
22
+ return styleElement;
23
+ }
@@ -0,0 +1,10 @@
1
+ import type { ControlTemplate } from '@ngneers/controls-themes';
2
+ type Prettify<T> = {
3
+ [K in keyof T]: T[K];
4
+ } & {};
5
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
6
+ export type ThemeClasses<CT extends ControlTemplate> = Record<CT['classNames'][number], string> & {
7
+ $deps: UnionToIntersection<Prettify<CT['dependencies'][number] extends infer Dep ? Dep extends ControlTemplate<infer I> ? Record<I, ThemeClasses<Dep>> : never : never>>;
8
+ };
9
+ export {};
10
+ //# sourceMappingURL=classes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classes.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/classes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,KAAK,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG,EAAE,CAAC;AACjD,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,IAAI,GAC/F,CAAC,GACD,KAAK,CAAC;AAEV,MAAM,MAAM,YAAY,CAAC,EAAE,SAAS,eAAe,IAAI,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG;IAChG,KAAK,EAAE,mBAAmB,CACxB,QAAQ,CACN,EAAE,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,SAAS,MAAM,GAAG,GACxC,GAAG,SAAS,eAAe,CAAC,MAAM,CAAC,CAAC,GAClC,MAAM,CAAC,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,GAC5B,KAAK,GACP,KAAK,CACV,CACF,CAAC;CACH,CAAC"}
File without changes
@@ -0,0 +1,10 @@
1
+ import { type SubKey } from '../utils/sub-key';
2
+ type CombineVariableVariations<A extends readonly string[], B extends readonly string[], Result extends string[] = []> = A extends readonly [infer AH, ...infer AT] ? AH extends string ? AT extends readonly string[] ? [
3
+ ...CombineVariableVariations<AT, B, Result>,
4
+ ...{
5
+ [K in keyof B]: SubKey<[AH, B[K]]>;
6
+ }
7
+ ] : Result : Result : Result;
8
+ export declare function combineVariableVariations<const A extends readonly string[], const B extends readonly string[]>(a: A, b: B): CombineVariableVariations<A, B>;
9
+ export {};
10
+ //# sourceMappingURL=combine-variable-variations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combine-variable-variations.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/combine-variable-variations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,KAAK,yBAAyB,CAC5B,CAAC,SAAS,SAAS,MAAM,EAAE,EAC3B,CAAC,SAAS,SAAS,MAAM,EAAE,EAC3B,MAAM,SAAS,MAAM,EAAE,GAAG,EAAE,IAC1B,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,GAC1C,EAAE,SAAS,MAAM,GACf,EAAE,SAAS,SAAS,MAAM,EAAE,GAC1B;IACE,GAAG,yBAAyB,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAC3C,GAAG;SACA,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KACnC;CACF,GACD,MAAM,GACR,MAAM,GACR,MAAM,CAAC;AAEX,wBAAgB,yBAAyB,CACvC,KAAK,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EACjC,KAAK,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EACjC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAQ7C"}
@@ -0,0 +1,10 @@
1
+ import {} from '../utils/sub-key';
2
+ export function combineVariableVariations(a, b) {
3
+ const result = [];
4
+ for (const itemA of a) {
5
+ for (const itemB of b) {
6
+ result.push(itemA === '' ? itemB : itemB === '' ? itemA : `${itemA}.${itemB}`);
7
+ }
8
+ }
9
+ return result;
10
+ }
@@ -0,0 +1,9 @@
1
+ type CombineVariations<A extends readonly string[], B extends readonly string[], Result extends string[] = []> = A extends readonly [infer AH, ...infer AT] ? AH extends string ? AT extends readonly string[] ? [
2
+ ...CombineVariations<AT, B, Result>,
3
+ ...{
4
+ [K in keyof B]: [AH, B[K]];
5
+ }
6
+ ] : Result : Result : Result;
7
+ export declare function combineVariations<const A extends readonly string[], const B extends readonly string[]>(a: A, b: B): CombineVariations<A, B>;
8
+ export {};
9
+ //# sourceMappingURL=combine-variations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combine-variations.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/combine-variations.ts"],"names":[],"mappings":"AAAA,KAAK,iBAAiB,CACpB,CAAC,SAAS,SAAS,MAAM,EAAE,EAC3B,CAAC,SAAS,SAAS,MAAM,EAAE,EAC3B,MAAM,SAAS,MAAM,EAAE,GAAG,EAAE,IAC1B,CAAC,SAAS,SAAS,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC,GAC1C,EAAE,SAAS,MAAM,GACf,EAAE,SAAS,SAAS,MAAM,EAAE,GAC1B;IACE,GAAG,iBAAiB,CAAC,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IACnC,GAAG;SACA,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;KAC3B;CACF,GACD,MAAM,GACR,MAAM,GACR,MAAM,CAAC;AAEX,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EACjC,KAAK,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,EACjC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAQrC"}
@@ -0,0 +1,9 @@
1
+ export function combineVariations(a, b) {
2
+ const result = [];
3
+ for (const itemA of a) {
4
+ for (const itemB of b) {
5
+ result.push([itemA, itemB]);
6
+ }
7
+ }
8
+ return result;
9
+ }
@@ -0,0 +1,14 @@
1
+ import { type Scoped } from './scoped';
2
+ export type ControlTemplate<S extends string = string, C extends string[] = string[], Deps extends readonly ControlTemplate[] = readonly any[]> = Scoped<S> & {
3
+ readonly classNames: C;
4
+ readonly dependencies: Deps;
5
+ };
6
+ type _ResolveWildcards<C extends string> = C extends `${infer Prefix}*${infer Suffix}` ? `${Prefix}${string}${Suffix}` : C;
7
+ type ResolveWildcards<C extends readonly string[]> = C extends readonly [infer Head, ...infer Tail] ? Head extends string ? Tail extends readonly string[] ? [_ResolveWildcards<Head>, ...ResolveWildcards<Tail>] : never : never : C;
8
+ export declare function createControlTemplate<S extends string, const C extends string[], const Deps extends readonly ControlTemplate[]>(init: {
9
+ scope: S;
10
+ classNames: C;
11
+ readonly dependencies?: Deps;
12
+ }): ControlTemplate<S, ResolveWildcards<C>, Deps>;
13
+ export {};
14
+ //# sourceMappingURL=control-template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"control-template.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/control-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,eAAe,CACzB,CAAC,SAAS,MAAM,GAAG,MAAM,EACzB,CAAC,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,EAC7B,IAAI,SAAS,SAAS,eAAe,EAAE,GAAG,SAAS,GAAG,EAAE,IACtD,MAAM,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAA;CAAE,CAAC;AAExE,KAAK,iBAAiB,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,GAAG,MAAM,MAAM,IAAI,MAAM,MAAM,EAAE,GAClF,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAC7B,CAAC,CAAC;AACN,KAAK,gBAAgB,CAAC,CAAC,SAAS,SAAS,MAAM,EAAE,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,GAC/F,IAAI,SAAS,MAAM,GACjB,IAAI,SAAS,SAAS,MAAM,EAAE,GAC5B,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,GACpD,KAAK,GACP,KAAK,GACP,CAAC,CAAC;AACN,wBAAgB,qBAAqB,CACnC,CAAC,SAAS,MAAM,EAChB,KAAK,CAAC,CAAC,SAAS,MAAM,EAAE,EACxB,KAAK,CAAC,IAAI,SAAS,SAAS,eAAe,EAAE,EAC7C,IAAI,EAAE;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,UAAU,EAAE,CAAC,CAAC;IAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,IAAI,CAAA;CAAE,iDAEhE"}
@@ -0,0 +1,4 @@
1
+ import {} from './scoped';
2
+ export function createControlTemplate(init) {
3
+ return init;
4
+ }
@@ -0,0 +1,4 @@
1
+ export declare const css: (template: {
2
+ raw: ArrayLike<string> | readonly string[];
3
+ }, ...substitutions: any[]) => string;
4
+ //# sourceMappingURL=css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/css.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,GAAG;;qCAAa,CAAC"}
@@ -0,0 +1 @@
1
+ export const css = String.raw;
@@ -0,0 +1,10 @@
1
+ import { type TemplateVariable } from './template-variable';
2
+ import { type UnionToIntersection } from '../utils/union-to-intersection';
3
+ type RepeatVariables<K extends string, T> = UnionToIntersection<K extends `${infer P}.${infer R}` ? {
4
+ [Q in P]: RepeatVariables<R, T>;
5
+ } : K extends '' ? T : {
6
+ [P in K]: T;
7
+ }>;
8
+ export declare function repeatVariables<const TVariations extends readonly string[], TVariables extends Record<string, TemplateVariable<null>>>(variations: TVariations, variables: TVariables): RepeatVariables<TVariations[number], TVariables>;
9
+ export {};
10
+ //# sourceMappingURL=repeat-variables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repeat-variables.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/repeat-variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAE1E,KAAK,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,IAAI,mBAAmB,CAC7D,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,MAAM,CAAC,EAAE,GAC7B;KAAG,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC;CAAE,GACnC,CAAC,SAAS,EAAE,GACV,CAAC,GACD;KAAG,CAAC,IAAI,CAAC,GAAG,CAAC;CAAE,CACtB,CAAC;AAEF,wBAAgB,eAAe,CAC7B,KAAK,CAAC,WAAW,SAAS,SAAS,MAAM,EAAE,EAC3C,UAAU,SAAS,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC,EAEzD,UAAU,EAAE,WAAW,EACvB,SAAS,EAAE,UAAU,GACpB,eAAe,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAQlD"}
@@ -0,0 +1,9 @@
1
+ import {} from './template-variable';
2
+ import { deepSet } from '../utils/deep-set';
3
+ import {} from '../utils/union-to-intersection';
4
+ export function repeatVariables(variations, variables) {
5
+ return variations.reduce((acc, variation) => {
6
+ deepSet(acc, variation, variables);
7
+ return acc;
8
+ }, {});
9
+ }
@@ -0,0 +1,4 @@
1
+ export type Scoped<T extends string = string> = {
2
+ readonly scope: T;
3
+ };
4
+ //# sourceMappingURL=scoped.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoped.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/scoped.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC"}
File without changes
@@ -0,0 +1,4 @@
1
+ export type TemplateVariable<T> = T | {
2
+ readonly [subKey: string]: TemplateVariable<T>;
3
+ };
4
+ //# sourceMappingURL=template-variable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-variable.d.ts","sourceRoot":"","sources":["../../../../src/api/theme/template-variable.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC"}
File without changes
@@ -0,0 +1,31 @@
1
+ import { type ControlTemplate } from './control-template';
2
+ import { type Scoped } from './scoped';
3
+ import { type VariableValues } from './variable';
4
+ import { type VariableTemplate } from './variable-template';
5
+ type ChildrenScopes<Deps> = Deps extends readonly (infer Child)[] ? Child extends ControlTemplate ? Child['scope'] : never : never;
6
+ type ClassnameForChildScope<Deps, Scope> = Scope extends ChildrenScopes<Deps> ? Deps extends readonly (infer Child)[] ? Child extends ControlTemplate<Scope> ? Child['classNames'][number] : never : never : never;
7
+ type ThemePartContent<V, K, C, Deps> = {
8
+ readonly values?: V;
9
+ readonly css?: (args: {
10
+ v: (key: K) => string;
11
+ c: (className: C, kind?: 'class' | 'animation') => string;
12
+ d: <const Scope extends ChildrenScopes<Deps>>(scope: Scope, className: ClassnameForChildScope<Deps, Scope>) => string;
13
+ }) => string;
14
+ };
15
+ type _ThemePartContent<S extends string = string, C extends ControlTemplate = ControlTemplate<S>, V extends VariableTemplate<S>[] = VariableTemplate<S>[], D extends VariableTemplate[] = VariableTemplate[]> = ThemePartContent<VariableValues<V[number]['variables'], V[number]['__varkeys'] | D[number]['__varkeys']>, V[number]['__varkeys'] | D[number]['__varkeys'], C['classNames'][number], C['dependencies']>;
16
+ export type ThemePart<S extends string = string, C extends ControlTemplate<S> = ControlTemplate<S>, V extends VariableTemplate<S>[] = VariableTemplate<S>[], D extends VariableTemplate[] = VariableTemplate[]> = Scoped<S> & {
17
+ readonly controlTemplate?: C;
18
+ readonly variables?: V;
19
+ readonly base?: ThemePart<S, C, V, VariableTemplate[]>;
20
+ readonly dependencies?: D;
21
+ readonly root?: _ThemePartContent<S, C, V, D>;
22
+ readonly light?: _ThemePartContent<S, C, V, D>;
23
+ readonly dark?: _ThemePartContent<S, C, V, D>;
24
+ readonly highContrast?: _ThemePartContent<S, C, V, D>;
25
+ };
26
+ export declare function createThemePart<C extends ControlTemplate = ControlTemplate, const V extends VariableTemplate<C['scope']>[] = VariableTemplate<C['scope']>[], const D extends VariableTemplate[] = VariableTemplate[]>(init: Omit<ThemePart<C['scope'], C, V, D>, 'scope' | 'controlTemplate'> & {
27
+ controlTemplate: C;
28
+ }): ThemePart<C['scope'], C, V, D>;
29
+ export declare function createThemePart<S extends string = string, const V extends VariableTemplate<S>[] = VariableTemplate<S>[], const D extends VariableTemplate[] = VariableTemplate[]>(init: ThemePart<S, never, V, D>): ThemePart<S, never, V, D>;
30
+ export {};
31
+ //# sourceMappingURL=theme-part.d.ts.map