daisyui 5.0.0-alpha.9 → 5.0.0-beta.2

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 (449) hide show
  1. package/README.md +4 -35
  2. package/base/properties/index.js +7 -1
  3. package/base/properties/object.js +1 -0
  4. package/base/properties.css +1 -1
  5. package/base/reset/index.js +7 -0
  6. package/base/reset/object.js +1 -0
  7. package/base/reset.css +1 -0
  8. package/base/rootcolor/index.js +7 -0
  9. package/base/rootcolor/object.js +1 -0
  10. package/base/rootcolor.css +1 -0
  11. package/base/rootscrollgutter/index.js +7 -0
  12. package/base/rootscrollgutter/object.js +1 -0
  13. package/base/rootscrollgutter.css +1 -0
  14. package/base/rootscrolllock/index.js +7 -0
  15. package/base/rootscrolllock/object.js +1 -0
  16. package/base/rootscrolllock.css +1 -0
  17. package/base/scrollbar/index.js +7 -1
  18. package/base/scrollbar/object.js +1 -0
  19. package/base/scrollbar.css +1 -1
  20. package/chunks.css +69 -47
  21. package/colors/properties.css +1 -1
  22. package/colors/responsive.css +1 -1
  23. package/colors/states.css +1 -1
  24. package/components/alert/index.js +7 -1
  25. package/components/alert/object.js +1 -0
  26. package/components/alert.css +1 -1
  27. package/components/avatar/index.js +7 -1
  28. package/components/avatar/object.js +1 -0
  29. package/components/avatar.css +1 -1
  30. package/components/badge/class.json +2 -1
  31. package/components/badge/index.js +7 -1
  32. package/components/badge/object.js +1 -0
  33. package/components/badge.css +1 -1
  34. package/components/breadcrumbs/class.json +3 -0
  35. package/components/breadcrumbs/index.js +7 -0
  36. package/components/breadcrumbs/object.js +1 -0
  37. package/components/breadcrumbs.css +1 -0
  38. package/components/button/class.json +3 -4
  39. package/components/button/index.js +7 -1
  40. package/components/button/object.js +1 -0
  41. package/components/button.css +1 -1
  42. package/components/calendar/class.json +51 -0
  43. package/components/calendar/index.js +7 -0
  44. package/components/calendar/object.js +1 -0
  45. package/components/calendar.css +1 -0
  46. package/components/card/class.json +2 -0
  47. package/components/card/index.js +7 -1
  48. package/components/card/object.js +1 -0
  49. package/components/card.css +1 -1
  50. package/components/carousel/class.json +9 -0
  51. package/components/carousel/index.js +7 -0
  52. package/components/carousel/object.js +1 -0
  53. package/components/carousel.css +1 -0
  54. package/components/chat/class.json +9 -9
  55. package/components/chat/index.js +7 -1
  56. package/components/chat/object.js +1 -0
  57. package/components/chat.css +1 -1
  58. package/components/checkbox/class.json +4 -5
  59. package/components/checkbox/index.js +7 -1
  60. package/components/checkbox/object.js +1 -0
  61. package/components/checkbox.css +1 -1
  62. package/components/collapse/class.json +2 -3
  63. package/components/collapse/index.js +7 -1
  64. package/components/collapse/object.js +1 -0
  65. package/components/collapse.css +1 -1
  66. package/components/countdown/index.js +7 -1
  67. package/components/countdown/object.js +1 -0
  68. package/components/countdown.css +1 -1
  69. package/components/diff/class.json +6 -0
  70. package/components/diff/index.js +7 -0
  71. package/components/diff/object.js +1 -0
  72. package/components/diff.css +1 -0
  73. package/components/divider/index.js +7 -1
  74. package/components/divider/object.js +1 -0
  75. package/components/divider.css +1 -1
  76. package/components/dock/class.json +10 -0
  77. package/components/dock/index.js +7 -0
  78. package/components/dock/object.js +1 -0
  79. package/components/dock.css +1 -0
  80. package/components/drawer/class.json +10 -0
  81. package/components/drawer/index.js +7 -0
  82. package/components/drawer/object.js +1 -0
  83. package/components/drawer.css +1 -0
  84. package/components/dropdown/class.json +0 -2
  85. package/components/dropdown/index.js +7 -1
  86. package/components/dropdown/object.js +1 -0
  87. package/components/dropdown.css +1 -1
  88. package/components/fieldset/class.json +5 -0
  89. package/components/fieldset/index.js +7 -0
  90. package/components/fieldset/object.js +1 -0
  91. package/components/fieldset.css +1 -0
  92. package/components/fileinput/class.json +17 -0
  93. package/components/fileinput/index.js +7 -0
  94. package/components/fileinput/object.js +1 -0
  95. package/components/fileinput.css +1 -0
  96. package/components/filter/class.json +4 -0
  97. package/components/filter/index.js +7 -0
  98. package/components/filter/object.js +1 -0
  99. package/components/filter.css +1 -0
  100. package/components/footer/index.js +7 -1
  101. package/components/footer/object.js +1 -0
  102. package/components/footer.css +1 -1
  103. package/components/hero/index.js +7 -1
  104. package/components/hero/object.js +1 -0
  105. package/components/hero.css +1 -1
  106. package/components/indicator/class.json +10 -0
  107. package/components/indicator/index.js +7 -0
  108. package/components/indicator/object.js +1 -0
  109. package/components/indicator.css +1 -0
  110. package/components/input/class.json +3 -2
  111. package/components/input/index.js +7 -1
  112. package/components/input/object.js +1 -0
  113. package/components/input.css +1 -1
  114. package/components/kbd/class.json +2 -1
  115. package/components/kbd/index.js +7 -1
  116. package/components/kbd/object.js +1 -0
  117. package/components/kbd.css +1 -1
  118. package/components/label/class.json +6 -0
  119. package/components/label/index.js +7 -0
  120. package/components/label/object.js +1 -0
  121. package/components/label.css +1 -0
  122. package/components/link/index.js +7 -1
  123. package/components/link/object.js +1 -0
  124. package/components/link.css +1 -1
  125. package/components/list/class.json +6 -0
  126. package/components/list/index.js +7 -0
  127. package/components/list/object.js +1 -0
  128. package/components/list.css +1 -0
  129. package/components/loading/class.json +2 -9
  130. package/components/loading/index.js +7 -1
  131. package/components/loading/object.js +1 -0
  132. package/components/loading.css +1 -1
  133. package/components/mask/class.json +0 -5
  134. package/components/mask/index.js +7 -1
  135. package/components/mask/object.js +1 -0
  136. package/components/mask.css +1 -1
  137. package/components/menu/class.json +2 -2
  138. package/components/menu/index.js +7 -1
  139. package/components/menu/object.js +1 -0
  140. package/components/menu.css +1 -1
  141. package/components/mockup/class.json +10 -0
  142. package/components/mockup/index.js +7 -0
  143. package/components/mockup/object.js +1 -0
  144. package/components/mockup.css +1 -0
  145. package/components/modal/class.json +13 -0
  146. package/components/modal/index.js +7 -0
  147. package/components/modal/object.js +1 -0
  148. package/components/modal.css +1 -0
  149. package/components/navbar/index.js +7 -1
  150. package/components/navbar/object.js +1 -0
  151. package/components/navbar.css +1 -1
  152. package/components/progress/class.json +1 -0
  153. package/components/progress/index.js +7 -1
  154. package/components/progress/object.js +1 -0
  155. package/components/progress.css +1 -1
  156. package/components/radialprogress/index.js +7 -0
  157. package/components/radialprogress/object.js +1 -0
  158. package/components/radialprogress.css +1 -0
  159. package/components/radio/class.json +4 -2
  160. package/components/radio/index.js +7 -1
  161. package/components/radio/object.js +1 -0
  162. package/components/radio.css +1 -1
  163. package/components/range/class.json +3 -1
  164. package/components/range/index.js +7 -1
  165. package/components/range/object.js +1 -0
  166. package/components/range.css +1 -1
  167. package/components/rating/class.json +5 -1
  168. package/components/rating/index.js +7 -1
  169. package/components/rating/object.js +1 -0
  170. package/components/rating.css +1 -1
  171. package/components/select/class.json +3 -2
  172. package/components/select/index.js +7 -1
  173. package/components/select/object.js +1 -0
  174. package/components/select.css +1 -1
  175. package/components/skeleton/index.js +7 -1
  176. package/components/skeleton/object.js +1 -0
  177. package/components/skeleton.css +1 -1
  178. package/components/stack/class.json +5 -1
  179. package/components/stack/index.js +7 -1
  180. package/components/stack/object.js +1 -0
  181. package/components/stack.css +1 -1
  182. package/components/stat/class.json +11 -0
  183. package/components/stat/index.js +7 -0
  184. package/components/stat/object.js +1 -0
  185. package/components/stat.css +1 -0
  186. package/components/status/class.json +2 -1
  187. package/components/status/index.js +7 -1
  188. package/components/status/object.js +1 -0
  189. package/components/status.css +1 -1
  190. package/components/steps/class.json +1 -0
  191. package/components/steps/index.js +7 -1
  192. package/components/steps/object.js +1 -0
  193. package/components/steps.css +1 -1
  194. package/components/swap/class.json +0 -1
  195. package/components/swap/index.js +7 -1
  196. package/components/swap/object.js +1 -0
  197. package/components/swap.css +1 -1
  198. package/components/tab/class.json +10 -5
  199. package/components/tab/index.js +7 -1
  200. package/components/tab/object.js +1 -0
  201. package/components/tab.css +1 -1
  202. package/components/table/class.json +2 -1
  203. package/components/table/index.js +7 -1
  204. package/components/table/object.js +1 -0
  205. package/components/table.css +1 -1
  206. package/components/textarea/class.json +17 -0
  207. package/components/textarea/index.js +7 -0
  208. package/components/textarea/object.js +1 -0
  209. package/components/textarea.css +1 -0
  210. package/components/timeline/index.js +7 -1
  211. package/components/timeline/object.js +1 -0
  212. package/components/timeline.css +1 -1
  213. package/components/toast/class.json +9 -0
  214. package/components/toast/index.js +7 -0
  215. package/components/toast/object.js +1 -0
  216. package/components/toast.css +1 -0
  217. package/components/toggle/class.json +3 -3
  218. package/components/toggle/index.js +7 -1
  219. package/components/toggle/object.js +1 -0
  220. package/components/toggle.css +1 -1
  221. package/components/tooltip/class.json +1 -2
  222. package/components/tooltip/index.js +7 -1
  223. package/components/tooltip/object.js +1 -0
  224. package/components/tooltip.css +1 -1
  225. package/components/validator/class.json +4 -0
  226. package/components/validator/index.js +7 -0
  227. package/components/validator/object.js +1 -0
  228. package/components/validator.css +1 -0
  229. package/daisyui.css +1 -0
  230. package/functions/addPrefix.js +138 -0
  231. package/functions/plugin.js +11 -0
  232. package/functions/pluginOptionsHandler.js +79 -0
  233. package/functions/themeOrder.js +37 -0
  234. package/functions/variables.js +29 -0
  235. package/imports.js +68 -0
  236. package/index.js +50 -86
  237. package/package.json +68 -80
  238. package/theme/abyss/index.js +7 -0
  239. package/theme/abyss/object.js +1 -0
  240. package/theme/abyss.css +31 -0
  241. package/theme/acid/index.js +7 -0
  242. package/theme/acid/object.js +1 -0
  243. package/theme/acid.css +31 -0
  244. package/theme/aqua/index.js +7 -0
  245. package/theme/aqua/object.js +1 -0
  246. package/theme/aqua.css +31 -0
  247. package/theme/autumn/index.js +7 -0
  248. package/theme/autumn/object.js +1 -0
  249. package/theme/autumn.css +31 -0
  250. package/theme/black/index.js +7 -0
  251. package/theme/black/object.js +1 -0
  252. package/theme/black.css +31 -0
  253. package/theme/bumblebee/index.js +7 -0
  254. package/theme/bumblebee/object.js +1 -0
  255. package/theme/bumblebee.css +31 -0
  256. package/theme/business/index.js +7 -0
  257. package/theme/business/object.js +1 -0
  258. package/theme/business.css +31 -0
  259. package/theme/caramellatte/index.js +7 -0
  260. package/theme/caramellatte/object.js +1 -0
  261. package/theme/caramellatte.css +31 -0
  262. package/theme/cmyk/index.js +7 -0
  263. package/theme/cmyk/object.js +1 -0
  264. package/theme/cmyk.css +31 -0
  265. package/theme/coffee/index.js +7 -0
  266. package/theme/coffee/object.js +1 -0
  267. package/theme/coffee.css +31 -0
  268. package/theme/corporate/index.js +7 -0
  269. package/theme/corporate/object.js +1 -0
  270. package/theme/corporate.css +31 -0
  271. package/theme/cupcake/index.js +7 -0
  272. package/theme/cupcake/object.js +1 -0
  273. package/theme/cupcake.css +31 -0
  274. package/theme/cyberpunk/index.js +7 -0
  275. package/theme/cyberpunk/object.js +1 -0
  276. package/theme/cyberpunk.css +31 -0
  277. package/theme/dark/index.js +7 -0
  278. package/theme/dark/object.js +1 -0
  279. package/theme/dark.css +31 -0
  280. package/theme/dim/index.js +7 -0
  281. package/theme/dim/object.js +1 -0
  282. package/theme/dim.css +31 -0
  283. package/theme/dracula/index.js +7 -0
  284. package/theme/dracula/object.js +1 -0
  285. package/theme/dracula.css +31 -0
  286. package/theme/emerald/index.js +7 -0
  287. package/theme/emerald/object.js +1 -0
  288. package/theme/emerald.css +31 -0
  289. package/theme/fantasy/index.js +7 -0
  290. package/theme/fantasy/object.js +1 -0
  291. package/theme/fantasy.css +31 -0
  292. package/theme/forest/index.js +7 -0
  293. package/theme/forest/object.js +1 -0
  294. package/theme/forest.css +31 -0
  295. package/theme/garden/index.js +7 -0
  296. package/theme/garden/object.js +1 -0
  297. package/theme/garden.css +31 -0
  298. package/theme/halloween/index.js +7 -0
  299. package/theme/halloween/object.js +1 -0
  300. package/theme/halloween.css +31 -0
  301. package/theme/index.js +48 -0
  302. package/theme/lemonade/index.js +7 -0
  303. package/theme/lemonade/object.js +1 -0
  304. package/theme/lemonade.css +31 -0
  305. package/theme/light/index.js +7 -0
  306. package/theme/light/object.js +1 -0
  307. package/theme/light.css +31 -0
  308. package/theme/lofi/index.js +7 -0
  309. package/theme/lofi/object.js +1 -0
  310. package/theme/lofi.css +31 -0
  311. package/theme/luxury/index.js +7 -0
  312. package/theme/luxury/object.js +1 -0
  313. package/theme/luxury.css +31 -0
  314. package/theme/night/index.js +7 -0
  315. package/theme/night/object.js +1 -0
  316. package/theme/night.css +31 -0
  317. package/theme/nord/index.js +7 -0
  318. package/theme/nord/object.js +1 -0
  319. package/theme/nord.css +31 -0
  320. package/theme/object.d.ts +74 -0
  321. package/theme/object.js +1 -0
  322. package/theme/pastel/index.js +7 -0
  323. package/theme/pastel/object.js +1 -0
  324. package/theme/pastel.css +31 -0
  325. package/theme/retro/index.js +7 -0
  326. package/theme/retro/object.js +1 -0
  327. package/theme/retro.css +31 -0
  328. package/theme/silk/index.js +7 -0
  329. package/theme/silk/object.js +1 -0
  330. package/theme/silk.css +31 -0
  331. package/theme/sunset/index.js +7 -0
  332. package/theme/sunset/object.js +1 -0
  333. package/theme/sunset.css +31 -0
  334. package/theme/synthwave/index.js +7 -0
  335. package/theme/synthwave/object.js +1 -0
  336. package/theme/synthwave.css +31 -0
  337. package/theme/valentine/index.js +7 -0
  338. package/theme/valentine/object.js +1 -0
  339. package/theme/valentine.css +31 -0
  340. package/theme/winter/index.js +7 -0
  341. package/theme/winter/object.js +1 -0
  342. package/theme/winter.css +31 -0
  343. package/theme/wireframe/index.js +7 -0
  344. package/theme/wireframe/object.js +1 -0
  345. package/theme/wireframe.css +31 -0
  346. package/themes.css +1 -0
  347. package/utilities/glass/index.js +7 -0
  348. package/utilities/glass/object.js +1 -0
  349. package/utilities/glass.css +1 -0
  350. package/utilities/join/index.js +7 -1
  351. package/utilities/join/object.js +1 -0
  352. package/utilities/join.css +1 -1
  353. package/utilities/radius/index.js +7 -0
  354. package/utilities/radius/object.js +1 -0
  355. package/utilities/radius.css +1 -0
  356. package/utilities/typography/index.js +7 -0
  357. package/utilities/typography/object.js +1 -0
  358. package/utilities/typography.css +1 -0
  359. package/base/properties/config.js +0 -4
  360. package/base/properties/index.css +0 -1
  361. package/base/root-color/config.js +0 -4
  362. package/base/root-color/index.css +0 -1
  363. package/base/root-color/index.js +0 -1
  364. package/base/root-color.css +0 -1
  365. package/base/scrollbar/config.js +0 -4
  366. package/base/scrollbar/index.css +0 -1
  367. package/components/alert/config.js +0 -4
  368. package/components/alert/index.css +0 -1
  369. package/components/avatar/config.js +0 -4
  370. package/components/avatar/index.css +0 -1
  371. package/components/badge/config.js +0 -4
  372. package/components/badge/index.css +0 -1
  373. package/components/button/config.js +0 -4
  374. package/components/button/index.css +0 -1
  375. package/components/card/config.js +0 -4
  376. package/components/card/index.css +0 -1
  377. package/components/chat/config.js +0 -4
  378. package/components/chat/index.css +0 -1
  379. package/components/checkbox/config.js +0 -4
  380. package/components/checkbox/index.css +0 -1
  381. package/components/collapse/config.js +0 -4
  382. package/components/collapse/index.css +0 -1
  383. package/components/countdown/config.js +0 -4
  384. package/components/countdown/index.css +0 -1
  385. package/components/divider/config.js +0 -4
  386. package/components/divider/index.css +0 -1
  387. package/components/dropdown/config.js +0 -4
  388. package/components/dropdown/index.css +0 -1
  389. package/components/footer/config.js +0 -4
  390. package/components/footer/index.css +0 -1
  391. package/components/hero/config.js +0 -4
  392. package/components/hero/index.css +0 -1
  393. package/components/input/config.js +0 -4
  394. package/components/input/index.css +0 -1
  395. package/components/kbd/config.js +0 -4
  396. package/components/kbd/index.css +0 -1
  397. package/components/link/config.js +0 -4
  398. package/components/link/index.css +0 -1
  399. package/components/loading/config.js +0 -4
  400. package/components/loading/index.css +0 -1
  401. package/components/mask/config.js +0 -4
  402. package/components/mask/index.css +0 -1
  403. package/components/menu/config.js +0 -4
  404. package/components/menu/index.css +0 -1
  405. package/components/navbar/config.js +0 -4
  406. package/components/navbar/index.css +0 -1
  407. package/components/progress/config.js +0 -4
  408. package/components/progress/index.css +0 -1
  409. package/components/radial-progress/config.js +0 -4
  410. package/components/radial-progress/index.css +0 -1
  411. package/components/radial-progress/index.js +0 -1
  412. package/components/radial-progress.css +0 -1
  413. package/components/radio/config.js +0 -4
  414. package/components/radio/index.css +0 -1
  415. package/components/range/config.js +0 -4
  416. package/components/range/index.css +0 -1
  417. package/components/rating/config.js +0 -4
  418. package/components/rating/index.css +0 -1
  419. package/components/select/config.js +0 -4
  420. package/components/select/index.css +0 -1
  421. package/components/skeleton/config.js +0 -4
  422. package/components/skeleton/index.css +0 -1
  423. package/components/stack/config.js +0 -4
  424. package/components/stack/index.css +0 -1
  425. package/components/status/config.js +0 -4
  426. package/components/status/index.css +0 -1
  427. package/components/steps/config.js +0 -4
  428. package/components/steps/index.css +0 -1
  429. package/components/swap/config.js +0 -4
  430. package/components/swap/index.css +0 -1
  431. package/components/tab/config.js +0 -4
  432. package/components/tab/index.css +0 -1
  433. package/components/table/config.js +0 -4
  434. package/components/table/index.css +0 -1
  435. package/components/timeline/config.js +0 -4
  436. package/components/timeline/index.css +0 -1
  437. package/components/toggle/config.js +0 -4
  438. package/components/toggle/index.css +0 -1
  439. package/components/tooltip/config.js +0 -4
  440. package/components/tooltip/index.css +0 -1
  441. package/full.css +0 -1
  442. package/index.css +0 -43
  443. package/themes/dark/index.css +0 -28
  444. package/themes/default/index.css +0 -27
  445. package/themes/index.css +0 -27
  446. package/themes/light/index.css +0 -28
  447. package/utilities/join/config.js +0 -4
  448. package/utilities/join/index.css +0 -1
  449. /package/components/{radial-progress → radialprogress}/class.json +0 -0
@@ -0,0 +1,138 @@
1
+ const defaultExcludedPrefixes = ["color-", "size-", "radius-", "border", "depth", "noise"]
2
+
3
+ const shouldExcludeVariable = (variableName, excludedPrefixes) => {
4
+ return excludedPrefixes.some((excludedPrefix) => variableName.startsWith(excludedPrefix))
5
+ }
6
+
7
+ const prefixVariable = (variableName, prefix, excludedPrefixes) => {
8
+ if (shouldExcludeVariable(variableName, excludedPrefixes)) {
9
+ return variableName
10
+ }
11
+ return `${prefix}${variableName}`
12
+ }
13
+
14
+ const getPrefixedSelector = (selector, prefix) => {
15
+ if (!selector.startsWith(".")) return selector
16
+ return `.${prefix}${selector.slice(1)}`
17
+ }
18
+
19
+ const getPrefixedKey = (key, prefix, excludedPrefixes) => {
20
+ const prefixDot = prefix ? `.${prefix}` : ""
21
+ const prefixAmpDot = prefix ? `&.${prefix}` : ""
22
+
23
+ if (!prefix) return key
24
+
25
+ if (key.startsWith("--")) {
26
+ const variableName = key.slice(2)
27
+ return `--${prefixVariable(variableName, prefix, excludedPrefixes)}`
28
+ }
29
+
30
+ if (key.startsWith("@") || key.startsWith("[")) {
31
+ return key
32
+ }
33
+
34
+ if (key.startsWith("&.")) {
35
+ return `${prefixAmpDot}${key.slice(2)}`
36
+ }
37
+
38
+ if (key.startsWith(":")) {
39
+ return key.replace(/\.([\w-]+)/g, `.${prefix}$1`)
40
+ }
41
+
42
+ if (
43
+ key.includes(".") &&
44
+ !key.includes(" ") &&
45
+ !key.includes(">") &&
46
+ !key.includes("+") &&
47
+ !key.includes("~")
48
+ ) {
49
+ return key
50
+ .split(".")
51
+ .filter(Boolean)
52
+ .map((part) => prefix + part)
53
+ .join(".")
54
+ .replace(/^/, ".")
55
+ }
56
+
57
+ if (key.includes(">") || key.includes("+") || key.includes("~")) {
58
+ return key
59
+ .split(/\s*([>+~])\s*/)
60
+ .map((part) => {
61
+ part = part.trim()
62
+ // Check if part contains any CSS function (like :not(), :is(), :where(), etc)
63
+ if (part.includes(":(") || part.match(/:[a-z-]+\(/)) {
64
+ return part.replace(/\.[\w-]+(?=[\s)])/g, (match) => `.${prefix}${match.slice(1)}`)
65
+ }
66
+ if (part === ">" || part === "+" || part === "~") return ` ${part} `
67
+ return part.startsWith(".") ? getPrefixedSelector(part, prefix) : part
68
+ })
69
+ .join("")
70
+ }
71
+
72
+ if (key.includes(" ")) {
73
+ return key
74
+ .split(/\s+/)
75
+ .map((part) => {
76
+ if (part.startsWith(".")) {
77
+ return getPrefixedSelector(part, prefix)
78
+ }
79
+ return part
80
+ })
81
+ .join(" ")
82
+ }
83
+
84
+ if (key.includes(":")) {
85
+ const [selector, ...pseudo] = key.split(":")
86
+ if (selector.startsWith(".")) {
87
+ return `${getPrefixedSelector(selector, prefix)}:${pseudo.join(":")}`
88
+ }
89
+ return key.replace(/\.([\w-]+)/g, `.${prefix}$1`)
90
+ }
91
+
92
+ if (key.startsWith(".")) {
93
+ return getPrefixedSelector(key, prefix)
94
+ }
95
+
96
+ return key
97
+ }
98
+
99
+ const processArrayValue = (value, prefix, excludedPrefixes) => {
100
+ return value.map((item) => {
101
+ if (typeof item === "string") {
102
+ if (item.startsWith(".")) {
103
+ return prefix ? `.${prefix}${item.slice(1)}` : item
104
+ }
105
+ return processStringValue(item, prefix, excludedPrefixes)
106
+ }
107
+ return item
108
+ })
109
+ }
110
+
111
+ const processStringValue = (value, prefix, excludedPrefixes) => {
112
+ return value.replace(/var\(--([^)]+)\)/g, (match, variableName) => {
113
+ if (shouldExcludeVariable(variableName, excludedPrefixes)) {
114
+ return match
115
+ }
116
+ return `var(--${prefix}${variableName})`
117
+ })
118
+ }
119
+
120
+ const processValue = (value, prefix, excludedPrefixes) => {
121
+ if (Array.isArray(value)) {
122
+ return processArrayValue(value, prefix, excludedPrefixes)
123
+ } else if (typeof value === "object" && value !== null) {
124
+ return addPrefix(value, prefix, excludedPrefixes)
125
+ } else if (typeof value === "string") {
126
+ return processStringValue(value, prefix, excludedPrefixes)
127
+ } else {
128
+ return value
129
+ }
130
+ }
131
+
132
+ export const addPrefix = (obj, prefix, excludedPrefixes = defaultExcludedPrefixes) => {
133
+ return Object.entries(obj).reduce((result, [key, value]) => {
134
+ const newKey = getPrefixedKey(key, prefix, excludedPrefixes)
135
+ result[newKey] = processValue(value, prefix, excludedPrefixes)
136
+ return result
137
+ }, {})
138
+ }
@@ -0,0 +1,11 @@
1
+ export const plugin = {
2
+ withOptions: (pluginFunction, configFunction = () => ({})) => {
3
+ const optionsFunction = (options) => {
4
+ const handler = pluginFunction(options)
5
+ const config = configFunction(options)
6
+ return { handler, config }
7
+ }
8
+ optionsFunction.__isOptionsFunction = true
9
+ return optionsFunction
10
+ },
11
+ }
@@ -0,0 +1,79 @@
1
+ import themeOrder from "./themeOrder.js"
2
+
3
+ export const pluginOptionsHandler = (() => {
4
+ let firstRun = true
5
+ return (options, addBase, themesObject, packageVersion) => {
6
+ const {
7
+ logs = true,
8
+ root = ":root",
9
+ themes = ["light --default", "dark --prefersdark"],
10
+ include,
11
+ exclude,
12
+ prefix = "",
13
+ } = options || {}
14
+
15
+ if (logs !== false && firstRun) {
16
+ console.log(
17
+ `${atob("Lyoh")} ${decodeURIComponent("%F0%9F%8C%BC")} ${atob("ZGFpc3lVSQ==")} ${packageVersion} ${atob("Ki8=")}`,
18
+ )
19
+ firstRun = false
20
+ }
21
+
22
+ const applyTheme = (themeName, flags) => {
23
+ const theme = themesObject[themeName]
24
+ if (theme) {
25
+ let selector = `${root}:has(input.theme-controller[value=${themeName}]:checked),[data-theme=${themeName}]`
26
+ if (flags.includes("--default")) {
27
+ selector = `:where(${root}),${selector}`
28
+ }
29
+ addBase({ [selector]: theme })
30
+
31
+ if (flags.includes("--prefersdark")) {
32
+ addBase({ "@media (prefers-color-scheme: dark)": { [root]: theme } })
33
+ }
34
+ }
35
+ }
36
+
37
+ if (themes === "all") {
38
+ if (themesObject["light"]) {
39
+ applyTheme("light", ["--default"])
40
+ }
41
+
42
+ if (themesObject["dark"]) {
43
+ addBase({ "@media (prefers-color-scheme: dark)": { [root]: themesObject["dark"] } })
44
+ }
45
+
46
+ themeOrder.forEach((themeName) => {
47
+ if (themesObject[themeName]) {
48
+ applyTheme(themeName, [])
49
+ }
50
+ })
51
+ } else if (themes) {
52
+ const themeArray = Array.isArray(themes) ? themes : [themes]
53
+
54
+ // default theme
55
+ themeArray.forEach((themeOption) => {
56
+ const [themeName, ...flags] = themeOption.split(" ")
57
+ if (flags.includes("--default")) {
58
+ applyTheme(themeName, ["--default"])
59
+ }
60
+ })
61
+
62
+ // prefers dark theme
63
+ themeArray.forEach((themeOption) => {
64
+ const [themeName, ...flags] = themeOption.split(" ")
65
+ if (flags.includes("--prefersdark")) {
66
+ addBase({ "@media (prefers-color-scheme: dark)": { [root]: themesObject[themeName] } })
67
+ }
68
+ })
69
+
70
+ // other themes
71
+ themeArray.forEach((themeOption) => {
72
+ const [themeName] = themeOption.split(" ")
73
+ applyTheme(themeName, [])
74
+ })
75
+ }
76
+
77
+ return { include, exclude, prefix }
78
+ }
79
+ })()
@@ -0,0 +1,37 @@
1
+ export default [
2
+ "light",
3
+ "dark",
4
+ "cupcake",
5
+ "bumblebee",
6
+ "emerald",
7
+ "corporate",
8
+ "synthwave",
9
+ "retro",
10
+ "cyberpunk",
11
+ "valentine",
12
+ "halloween",
13
+ "garden",
14
+ "forest",
15
+ "aqua",
16
+ "lofi",
17
+ "pastel",
18
+ "fantasy",
19
+ "wireframe",
20
+ "black",
21
+ "luxury",
22
+ "dracula",
23
+ "cmyk",
24
+ "autumn",
25
+ "business",
26
+ "acid",
27
+ "lemonade",
28
+ "night",
29
+ "coffee",
30
+ "winter",
31
+ "dim",
32
+ "nord",
33
+ "sunset",
34
+ "caramellatte",
35
+ "abyss",
36
+ "silk",
37
+ ]
@@ -0,0 +1,29 @@
1
+ export default {
2
+ colors: {
3
+ "base-100": "var(--color-base-100)",
4
+ "base-200": "var(--color-base-200)",
5
+ "base-300": "var(--color-base-300)",
6
+ "base-content": "var(--color-base-content)",
7
+ primary: "var(--color-primary)",
8
+ "primary-content": "var(--color-primary-content)",
9
+ secondary: "var(--color-secondary)",
10
+ "secondary-content": "var(--color-secondary-content)",
11
+ accent: "var(--color-accent)",
12
+ "accent-content": "var(--color-accent-content)",
13
+ neutral: "var(--color-neutral)",
14
+ "neutral-content": "var(--color-neutral-content)",
15
+ info: "var(--color-info)",
16
+ "info-content": "var(--color-info-content)",
17
+ success: "var(--color-success)",
18
+ "success-content": "var(--color-success-content)",
19
+ warning: "var(--color-warning)",
20
+ "warning-content": "var(--color-warning-content)",
21
+ error: "var(--color-error)",
22
+ "error-content": "var(--color-error-content)",
23
+ },
24
+ borderRadius: {
25
+ selector: "var(--radius-selector)",
26
+ field: "var(--radius-field)",
27
+ box: "var(--radius-box)",
28
+ },
29
+ }
package/imports.js ADDED
@@ -0,0 +1,68 @@
1
+ import rootcolor from './base/rootcolor/index.js';
2
+ import reset from './base/reset/index.js';
3
+ import rootscrollgutter from './base/rootscrollgutter/index.js';
4
+ import properties from './base/properties/index.js';
5
+ import rootscrolllock from './base/rootscrolllock/index.js';
6
+ import scrollbar from './base/scrollbar/index.js';
7
+ import kbd from './components/kbd/index.js';
8
+ import dropdown from './components/dropdown/index.js';
9
+ import navbar from './components/navbar/index.js';
10
+ import drawer from './components/drawer/index.js';
11
+ import footer from './components/footer/index.js';
12
+ import tooltip from './components/tooltip/index.js';
13
+ import rating from './components/rating/index.js';
14
+ import calendar from './components/calendar/index.js';
15
+ import radio from './components/radio/index.js';
16
+ import card from './components/card/index.js';
17
+ import validator from './components/validator/index.js';
18
+ import loading from './components/loading/index.js';
19
+ import indicator from './components/indicator/index.js';
20
+ import radialprogress from './components/radialprogress/index.js';
21
+ import progress from './components/progress/index.js';
22
+ import chat from './components/chat/index.js';
23
+ import countdown from './components/countdown/index.js';
24
+ import input from './components/input/index.js';
25
+ import alert from './components/alert/index.js';
26
+ import skeleton from './components/skeleton/index.js';
27
+ import toast from './components/toast/index.js';
28
+ import swap from './components/swap/index.js';
29
+ import checkbox from './components/checkbox/index.js';
30
+ import label from './components/label/index.js';
31
+ import diff from './components/diff/index.js';
32
+ import collapse from './components/collapse/index.js';
33
+ import status from './components/status/index.js';
34
+ import tab from './components/tab/index.js';
35
+ import carousel from './components/carousel/index.js';
36
+ import toggle from './components/toggle/index.js';
37
+ import mask from './components/mask/index.js';
38
+ import textarea from './components/textarea/index.js';
39
+ import button from './components/button/index.js';
40
+ import steps from './components/steps/index.js';
41
+ import stat from './components/stat/index.js';
42
+ import link from './components/link/index.js';
43
+ import table from './components/table/index.js';
44
+ import list from './components/list/index.js';
45
+ import divider from './components/divider/index.js';
46
+ import menu from './components/menu/index.js';
47
+ import avatar from './components/avatar/index.js';
48
+ import fieldset from './components/fieldset/index.js';
49
+ import select from './components/select/index.js';
50
+ import stack from './components/stack/index.js';
51
+ import filter from './components/filter/index.js';
52
+ import hero from './components/hero/index.js';
53
+ import mockup from './components/mockup/index.js';
54
+ import range from './components/range/index.js';
55
+ import modal from './components/modal/index.js';
56
+ import timeline from './components/timeline/index.js';
57
+ import breadcrumbs from './components/breadcrumbs/index.js';
58
+ import fileinput from './components/fileinput/index.js';
59
+ import dock from './components/dock/index.js';
60
+ import badge from './components/badge/index.js';
61
+ import join from './utilities/join/index.js';
62
+ import radius from './utilities/radius/index.js';
63
+ import glass from './utilities/glass/index.js';
64
+ import typography from './utilities/typography/index.js';
65
+
66
+ export const base = {rootcolor,reset,rootscrollgutter,properties,rootscrolllock,scrollbar};
67
+ export const components = {kbd,dropdown,navbar,drawer,footer,tooltip,rating,calendar,radio,card,validator,loading,indicator,radialprogress,progress,chat,countdown,input,alert,skeleton,toast,swap,checkbox,label,diff,collapse,status,tab,carousel,toggle,mask,textarea,button,steps,stat,link,table,list,divider,menu,avatar,fieldset,select,stack,filter,hero,mockup,range,modal,timeline,breadcrumbs,fileinput,dock,badge};
68
+ export const utilities = {join,radius,glass,typography};
package/index.js CHANGED
@@ -1,87 +1,51 @@
1
- import rootColor from './base/root-color/index.js';
2
- import properties from './base/properties/index.js';
3
- import scrollbar from './base/scrollbar/index.js';
4
- import kbd from './components/kbd/index.js';
5
- import dropdown from './components/dropdown/index.js';
6
- import navbar from './components/navbar/index.js';
7
- import footer from './components/footer/index.js';
8
- import tooltip from './components/tooltip/index.js';
9
- import rating from './components/rating/index.js';
10
- import radio from './components/radio/index.js';
11
- import card from './components/card/index.js';
12
- import loading from './components/loading/index.js';
13
- import progress from './components/progress/index.js';
14
- import chat from './components/chat/index.js';
15
- import countdown from './components/countdown/index.js';
16
- import input from './components/input/index.js';
17
- import alert from './components/alert/index.js';
18
- import skeleton from './components/skeleton/index.js';
19
- import swap from './components/swap/index.js';
20
- import checkbox from './components/checkbox/index.js';
21
- import collapse from './components/collapse/index.js';
22
- import status from './components/status/index.js';
23
- import tab from './components/tab/index.js';
24
- import toggle from './components/toggle/index.js';
25
- import mask from './components/mask/index.js';
26
- import button from './components/button/index.js';
27
- import steps from './components/steps/index.js';
28
- import link from './components/link/index.js';
29
- import table from './components/table/index.js';
30
- import radialProgress from './components/radial-progress/index.js';
31
- import divider from './components/divider/index.js';
32
- import menu from './components/menu/index.js';
33
- import avatar from './components/avatar/index.js';
34
- import select from './components/select/index.js';
35
- import stack from './components/stack/index.js';
36
- import hero from './components/hero/index.js';
37
- import range from './components/range/index.js';
38
- import timeline from './components/timeline/index.js';
39
- import badge from './components/badge/index.js';
40
- import join from './utilities/join/index.js';
1
+ import { version } from "./package.json"
2
+ import { pluginOptionsHandler } from "./functions/pluginOptionsHandler.js"
3
+ import { plugin } from "./functions/plugin.js"
4
+ import variables from "./functions/variables.js"
5
+ import themesObject from "./theme/object.js"
6
+ import { base, components, utilities } from "./imports.js"
41
7
 
42
- export default ({ addBase, addComponents, addUtilities }) => {
43
- addBase({
44
- ...rootColor,
45
- ...properties,
46
- ...scrollbar,
47
- })
48
- addComponents({
49
- ...kbd,
50
- ...dropdown,
51
- ...navbar,
52
- ...footer,
53
- ...tooltip,
54
- ...rating,
55
- ...radio,
56
- ...card,
57
- ...loading,
58
- ...progress,
59
- ...chat,
60
- ...countdown,
61
- ...input,
62
- ...alert,
63
- ...skeleton,
64
- ...swap,
65
- ...checkbox,
66
- ...collapse,
67
- ...status,
68
- ...tab,
69
- ...toggle,
70
- ...mask,
71
- ...button,
72
- ...steps,
73
- ...link,
74
- ...table,
75
- ...radialProgress,
76
- ...divider,
77
- ...menu,
78
- ...avatar,
79
- ...select,
80
- ...stack,
81
- ...hero,
82
- ...range,
83
- ...timeline,
84
- ...badge,
85
- })
86
- addUtilities({ ...join, })
87
- }
8
+ export default plugin.withOptions(
9
+ (options) => {
10
+ return ({ addBase, addComponents, addUtilities }) => {
11
+ const {
12
+ include,
13
+ exclude,
14
+ prefix = "",
15
+ } = pluginOptionsHandler(options, addBase, themesObject, version)
16
+
17
+ const shouldIncludeItem = (name) => {
18
+ if (include && exclude) {
19
+ return include.includes(name) && !exclude.includes(name)
20
+ }
21
+ if (include) {
22
+ return include.includes(name)
23
+ }
24
+ if (exclude) {
25
+ return !exclude.includes(name)
26
+ }
27
+ return true
28
+ }
29
+
30
+ Object.entries(base).forEach(([name, item]) => {
31
+ if (!shouldIncludeItem(name)) return
32
+ item({ addBase, prefix })
33
+ })
34
+
35
+ Object.entries(components).forEach(([name, item]) => {
36
+ if (!shouldIncludeItem(name)) return
37
+ item({ addComponents, prefix })
38
+ })
39
+
40
+ Object.entries(utilities).forEach(([name, item]) => {
41
+ if (!shouldIncludeItem(name)) return
42
+ item({ addUtilities, prefix })
43
+ })
44
+ }
45
+ },
46
+ () => ({
47
+ theme: {
48
+ extend: variables,
49
+ },
50
+ }),
51
+ )
package/package.json CHANGED
@@ -1,82 +1,70 @@
1
1
  {
2
- "type": "module",
3
- "name": "daisyui",
4
- "version": "5.0.0-alpha.9",
5
- "description": "daisyUI - Tailwind CSS Components",
6
- "author": "Pouya Saadeghi",
7
- "license": "MIT",
8
- "homepage": "https://daisyui.com",
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://github.com/saadeghi/daisyui.git"
12
- },
13
- "funding": {
14
- "type": "opencollective",
15
- "url": "https://opencollective.com/daisyui"
16
- },
17
- "bugs": {
18
- "url": "https://github.com/saadeghi/daisyui/issues"
19
- },
20
- "keywords": [
21
- "design-system",
22
- "tailwindcss",
23
- "css-library",
24
- "components",
25
- "ui-library",
26
- "component",
27
- "framework",
28
- "tailwind",
29
- "daisyui",
30
- "themes",
31
- "design",
32
- "css",
33
- "ui"
34
- ],
35
- "main": "index.js",
36
- "files": [
37
- "themes",
38
- "colors",
39
- "base",
40
- "components",
41
- "utilities",
42
- "index.css",
43
- "index.js",
44
- "chunks.css",
45
- "full.css"
46
- ],
47
- "engines": {
48
- "node": ">=16.9.0"
49
- },
50
- "browserslist": [
51
- "> 7%"
52
- ],
53
- "publishConfig": {
54
- "access": "public",
55
- "branches": [
56
- "master"
57
- ]
58
- },
59
- "scripts": {
60
- "init": "npm install && npm run build && cd src/docs && npm install && npm run get-json --silent && cd src/experiments/playground && npm install",
61
- "format": "npx prettier 'css/**/*' 'functions/**/*' '*.js' 'themes/**/*' '*.css' '.prettierrc' --write",
62
- "lint": "biome lint . --write",
63
- "build": "bun build.js",
64
- "dev": "cd src/docs && npm run dev",
65
- "playground": "cd src/experiments/playground && npm run dev",
66
- "release": "node src/release",
67
- "publish:alpha": "npm publish --tag=alpha",
68
- "alpha": "npm run release -- --alpha && npm publish --tag=alpha"
69
- },
70
- "devDependencies": {
71
- "@biomejs/biome": "^1.9.2",
72
- "@tailwindcss/cli": "^4.0.0-alpha.27",
73
- "commit-and-tag-version": "12.4.1",
74
- "lightningcss": "^1.27.0",
75
- "postcss": "^8.4.45",
76
- "postcss-js": "^4.0.1",
77
- "postcss-prefixer": "^3.0.0",
78
- "prettier": "^3.3.3",
79
- "prettier-plugin-tailwindcss": "^0.6.6",
80
- "zlib": "^1.0.5"
81
- }
2
+ "type": "module",
3
+ "name": "daisyui",
4
+ "version": "5.0.0-beta.2",
5
+ "description": "daisyUI 5 - Tailwind CSS Component Library",
6
+ "author": "Pouya Saadeghi",
7
+ "license": "MIT",
8
+ "homepage": "https://daisyui.com",
9
+ "repository": "github:saadeghi/daisyui",
10
+ "funding": "https://github.com/saadeghi/daisyui?sponsor=1",
11
+ "bugs": {
12
+ "url": "https://github.com/saadeghi/daisyui/issues"
13
+ },
14
+ "keywords": [
15
+ "daisyui",
16
+ "tailwind",
17
+ "tailwindcss",
18
+ "tailwind css",
19
+ "tailwind react",
20
+ "tailwind vue",
21
+ "tailwind plugin",
22
+ "tailwind component",
23
+ "tailwind next",
24
+ "tailwind nuxt",
25
+ "tailwind svelte",
26
+ "tailwind css plugin",
27
+ "tailwind astro",
28
+ "tailwind laravel",
29
+ "tailwind rails",
30
+ "react",
31
+ "css",
32
+ "ui",
33
+ "vue",
34
+ "component",
35
+ "framework",
36
+ "nextjs",
37
+ "front-end",
38
+ "laravel",
39
+ "theme",
40
+ "nuxt",
41
+ "svelte",
42
+ "astro",
43
+ "component library",
44
+ "css library"
45
+ ],
46
+ "main": "./index.js",
47
+ "module": "./index.js",
48
+ "browser": "./daisyui.css",
49
+ "files": [
50
+ "base",
51
+ "colors",
52
+ "components",
53
+ "!components/*/class.json",
54
+ "functions/addPrefix.js",
55
+ "functions/plugin.js",
56
+ "functions/pluginOptionsHandler.js",
57
+ "functions/themeOrder.js",
58
+ "functions/variables.js",
59
+ "theme",
60
+ "utilities",
61
+ "imports.js",
62
+ "index.js",
63
+ "chunks.css",
64
+ "daisyui.css",
65
+ "themes.css"
66
+ ],
67
+ "scripts": {
68
+ "build": "bun build.js"
69
+ }
82
70
  }
@@ -0,0 +1,7 @@
1
+ import abyss from './object.js';
2
+ import { addPrefix } from '../../functions/addPrefix.js';
3
+
4
+ export default ({ addBase, prefix = '' }) => {
5
+ const prefixedabyss = addPrefix(abyss, prefix);
6
+ addBase({ ...prefixedabyss });
7
+ };