@ulu/frontend 0.1.0-beta.11 → 0.1.0-beta.110

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 (342) hide show
  1. package/CHANGELOG.md +669 -0
  2. package/GEMINI.md +9 -0
  3. package/README.dev.md +3 -3
  4. package/README.md +14 -4
  5. package/dist/ulu-frontend.min.css +1 -1
  6. package/dist/ulu-frontend.min.js +36 -29
  7. package/docs-dev/.nojekyll +1 -0
  8. package/docs-dev/assets/main.js +832 -421
  9. package/docs-dev/assets/placeholder/icon-calendar.svg +1 -0
  10. package/docs-dev/assets/placeholder/icon-check.svg +1 -0
  11. package/docs-dev/assets/style.css +629 -233
  12. package/docs-dev/changelog/index.html +7445 -0
  13. package/docs-dev/changelog/updates-and-changes/index.html +5109 -0
  14. package/docs-dev/demos/accordion/index.html +1442 -364
  15. package/docs-dev/demos/badge/index.html +5835 -0
  16. package/docs-dev/demos/badge-stack/index.html +5816 -0
  17. package/docs-dev/demos/basic-hero/index.html +111 -0
  18. package/docs-dev/demos/breadcrumb/index.html +5870 -0
  19. package/docs-dev/demos/breakpoints-manager/index.html +5846 -0
  20. package/docs-dev/demos/button/index.html +1490 -356
  21. package/docs-dev/demos/button-group/index.html +5832 -0
  22. package/docs-dev/demos/button-verbose/index.html +5838 -0
  23. package/docs-dev/demos/callout/index.html +1469 -349
  24. package/docs-dev/demos/captioned-figure/index.html +1446 -353
  25. package/docs-dev/demos/card/index.html +1518 -786
  26. package/docs-dev/demos/card-grid/index.html +5957 -0
  27. package/docs-dev/demos/card-new/index.html +5088 -0
  28. package/docs-dev/demos/card-old/index.html +5223 -0
  29. package/docs-dev/demos/card.1/index.html +5223 -0
  30. package/docs-dev/demos/card.TRASH/index.html +5541 -0
  31. package/docs-dev/demos/counter-list/index.html +5840 -0
  32. package/docs-dev/demos/css-icons/index.html +1466 -350
  33. package/docs-dev/demos/data-grid/index.html +1446 -353
  34. package/docs-dev/demos/data-table/index.html +1621 -395
  35. package/docs-dev/demos/details-group/index.html +5867 -0
  36. package/docs-dev/demos/donut-chart/index.html +5874 -0
  37. package/docs-dev/demos/file-save/index.html +1446 -353
  38. package/docs-dev/demos/flipcard/index.html +1446 -353
  39. package/docs-dev/demos/form-theme/index.html +1453 -360
  40. package/docs-dev/demos/headline-label/index.html +5802 -0
  41. package/docs-dev/demos/hero/index.html +12 -4
  42. package/docs-dev/demos/image-grid/index.html +12 -4
  43. package/docs-dev/demos/index.html +1447 -354
  44. package/docs-dev/demos/list-inline/index.html +1446 -353
  45. package/docs-dev/demos/list-lines/index.html +1446 -353
  46. package/docs-dev/demos/menu-stack/index.html +1550 -389
  47. package/docs-dev/demos/modals/index.html +1616 -400
  48. package/docs-dev/demos/nav-strip/index.html +1446 -353
  49. package/docs-dev/demos/overlay-section/index.html +1532 -369
  50. package/docs-dev/demos/panel/index.html +5862 -0
  51. package/docs-dev/demos/popovers/index.html +1710 -375
  52. package/docs-dev/demos/print/index.html +1446 -353
  53. package/docs-dev/demos/progress-bar/index.html +5964 -0
  54. package/docs-dev/demos/progress-circle/index.html +6137 -0
  55. package/docs-dev/demos/progress-donut/index.html +6107 -0
  56. package/docs-dev/demos/pull-quote/index.html +1446 -353
  57. package/docs-dev/demos/rail/index.html +5910 -0
  58. package/docs-dev/demos/rule/index.html +1455 -350
  59. package/docs-dev/demos/scroll-slider/index.html +72 -106
  60. package/docs-dev/demos/scrollpoints/index.html +1447 -354
  61. package/docs-dev/demos/skeleton/index.html +5858 -0
  62. package/docs-dev/demos/slider/index.html +12 -4
  63. package/docs-dev/demos/spoke-spinner/index.html +1446 -353
  64. package/docs-dev/demos/sticky-list/index.html +5823 -0
  65. package/docs-dev/demos/tabs/index.html +1474 -345
  66. package/docs-dev/demos/tag/index.html +1463 -358
  67. package/docs-dev/demos/theme-toggle/index.html +5879 -0
  68. package/docs-dev/demos/tile-grid-overlay/index.html +12 -4
  69. package/docs-dev/demos/tiles/index.html +1446 -353
  70. package/docs-dev/demos/tooltip/index.html +1446 -353
  71. package/docs-dev/demos/wysiwyg/index.html +5852 -0
  72. package/docs-dev/guide/building-stylesheet/index.html +1446 -353
  73. package/docs-dev/guide/developing-ulu-scss-module/index.html +1446 -353
  74. package/docs-dev/guide/index.html +1446 -353
  75. package/docs-dev/guide/updates-and-changes/index.html +5033 -0
  76. package/docs-dev/index.html +1446 -353
  77. package/docs-dev/javascript/events/index.html +1141 -940
  78. package/docs-dev/javascript/index.html +1446 -353
  79. package/docs-dev/javascript/settings/index.html +5629 -0
  80. package/docs-dev/javascript/ui-breakpoints/index.html +1270 -719
  81. package/docs-dev/javascript/ui-collapsible/index.html +1135 -824
  82. package/docs-dev/javascript/ui-details-group/index.html +5382 -0
  83. package/docs-dev/javascript/ui-dialog/index.html +1167 -841
  84. package/docs-dev/javascript/ui-flipcard/index.html +833 -2058
  85. package/docs-dev/javascript/ui-grid/index.html +835 -1962
  86. package/docs-dev/javascript/ui-modal-builder/index.html +988 -1919
  87. package/docs-dev/javascript/ui-overflow-scroller/index.html +811 -1912
  88. package/docs-dev/javascript/ui-overflow-scroller-pager/index.html +1643 -928
  89. package/docs-dev/javascript/ui-page/index.html +1643 -928
  90. package/docs-dev/javascript/ui-popover/index.html +1484 -773
  91. package/docs-dev/javascript/ui-print/index.html +1637 -930
  92. package/docs-dev/javascript/ui-print-details/index.html +1643 -928
  93. package/docs-dev/javascript/ui-programmatic-modal/index.html +1643 -928
  94. package/docs-dev/javascript/ui-proxy-click/index.html +1395 -595
  95. package/docs-dev/javascript/ui-resizer/index.html +1986 -1006
  96. package/docs-dev/javascript/ui-scroll-slider/index.html +1514 -767
  97. package/docs-dev/javascript/ui-scrollpoint/index.html +1649 -941
  98. package/docs-dev/javascript/ui-slider/index.html +1723 -817
  99. package/docs-dev/javascript/ui-tabs/index.html +1537 -859
  100. package/docs-dev/javascript/ui-theme-toggle/index.html +5634 -0
  101. package/docs-dev/javascript/ui-tooltip/index.html +1649 -938
  102. package/docs-dev/javascript/utils-class-logger/index.html +1644 -929
  103. package/docs-dev/javascript/utils-css/index.html +5448 -0
  104. package/docs-dev/javascript/utils-dom/index.html +1320 -685
  105. package/docs-dev/javascript/utils-file-save/index.html +1643 -928
  106. package/docs-dev/javascript/utils-floating-ui/index.html +1643 -928
  107. package/docs-dev/javascript/utils-id/index.html +1643 -928
  108. package/docs-dev/javascript/utils-pause-youtube-video/index.html +1643 -928
  109. package/docs-dev/javascript/utils-system/index.html +5751 -0
  110. package/docs-dev/sass/base/color/index.html +1451 -360
  111. package/docs-dev/sass/base/elements/index.html +1645 -930
  112. package/docs-dev/sass/base/index/index.html +1452 -361
  113. package/docs-dev/sass/base/index.html +1446 -353
  114. package/docs-dev/sass/base/keyframes/index.html +1452 -361
  115. package/docs-dev/sass/base/layout/index.html +1452 -361
  116. package/docs-dev/sass/base/normalize/index.html +1644 -929
  117. package/docs-dev/sass/base/print/index.html +1452 -361
  118. package/docs-dev/sass/base/root/index.html +1455 -364
  119. package/docs-dev/sass/base/typography/index.html +1451 -360
  120. package/docs-dev/sass/components/accordion/index.html +1538 -406
  121. package/docs-dev/sass/components/adaptive-spacing/index.html +1451 -360
  122. package/docs-dev/sass/components/badge/index.html +1468 -359
  123. package/docs-dev/sass/components/badge-stack/index.html +5991 -0
  124. package/docs-dev/sass/components/basic-hero/index.html +5985 -0
  125. package/docs-dev/sass/components/breadcrumb/index.html +6032 -0
  126. package/docs-dev/sass/components/button/index.html +1451 -360
  127. package/docs-dev/sass/components/button-group/index.html +5983 -0
  128. package/docs-dev/sass/components/button-verbose/index.html +1523 -357
  129. package/docs-dev/sass/components/callout/index.html +1572 -422
  130. package/docs-dev/sass/components/captioned-figure/index.html +1591 -385
  131. package/docs-dev/sass/components/card/index.html +1511 -363
  132. package/docs-dev/sass/components/card-grid/index.html +1451 -360
  133. package/docs-dev/sass/components/counter-list/index.html +6067 -0
  134. package/docs-dev/sass/components/css-icon/index.html +1452 -361
  135. package/docs-dev/sass/components/data-grid/index.html +1465 -367
  136. package/docs-dev/sass/components/data-table/index.html +1648 -369
  137. package/docs-dev/sass/components/fill-context/index.html +1451 -360
  138. package/docs-dev/sass/components/flipcard/index.html +1479 -357
  139. package/docs-dev/sass/components/flipcard-grid/index.html +1451 -360
  140. package/docs-dev/sass/components/form-theme/index.html +1652 -566
  141. package/docs-dev/sass/components/headline-label/index.html +6013 -0
  142. package/docs-dev/sass/components/hero/index.html +1497 -358
  143. package/docs-dev/sass/components/horizontal-rule/index.html +1451 -360
  144. package/docs-dev/sass/components/image-grid/index.html +1451 -360
  145. package/docs-dev/sass/components/index/index.html +1466 -362
  146. package/docs-dev/sass/components/index.html +1446 -353
  147. package/docs-dev/sass/components/links/index.html +1451 -360
  148. package/docs-dev/sass/components/list-inline/index.html +1451 -360
  149. package/docs-dev/sass/components/list-lines/index.html +1451 -360
  150. package/docs-dev/sass/components/list-ordered/index.html +1451 -360
  151. package/docs-dev/sass/components/list-unordered/index.html +1451 -360
  152. package/docs-dev/sass/components/menu-stack/index.html +1476 -371
  153. package/docs-dev/sass/components/modal/index.html +1486 -360
  154. package/docs-dev/sass/components/nav-strip/index.html +1459 -368
  155. package/docs-dev/sass/components/overlay-section/index.html +1459 -368
  156. package/docs-dev/sass/components/pager/index.html +1451 -360
  157. package/docs-dev/sass/components/panel/index.html +6213 -0
  158. package/docs-dev/sass/components/placeholder-block/index.html +1451 -360
  159. package/docs-dev/sass/components/popover/index.html +1497 -370
  160. package/docs-dev/sass/components/progress-bar/index.html +6192 -0
  161. package/docs-dev/sass/components/progress-circle/index.html +6084 -0
  162. package/docs-dev/sass/components/pull-quote/index.html +1463 -372
  163. package/docs-dev/sass/components/rail/index.html +6003 -0
  164. package/docs-dev/sass/components/ratio-box/index.html +1459 -368
  165. package/docs-dev/sass/components/rule/index.html +1452 -361
  166. package/docs-dev/sass/components/scroll-slider/index.html +1447 -368
  167. package/docs-dev/sass/components/skeleton/index.html +6041 -0
  168. package/docs-dev/sass/components/skip-link/index.html +1451 -360
  169. package/docs-dev/sass/components/slider/index.html +1491 -412
  170. package/docs-dev/sass/components/spoke-spinner/index.html +1453 -362
  171. package/docs-dev/sass/components/sticky-list/index.html +6203 -0
  172. package/docs-dev/sass/components/table-sticky/index.html +5707 -0
  173. package/docs-dev/sass/components/tabs/index.html +1472 -366
  174. package/docs-dev/sass/components/tag/index.html +1563 -378
  175. package/docs-dev/sass/components/tile-button/index.html +1451 -360
  176. package/docs-dev/sass/components/tile-grid/index.html +1451 -360
  177. package/docs-dev/sass/components/tile-grid-overlay/index.html +1451 -360
  178. package/docs-dev/sass/components/vignette/index.html +1457 -360
  179. package/docs-dev/sass/components/wysiwyg/index.html +1477 -368
  180. package/docs-dev/sass/core/breakpoint/index.html +1530 -387
  181. package/docs-dev/sass/core/button/index.html +1483 -390
  182. package/docs-dev/sass/core/color/index.html +1666 -443
  183. package/docs-dev/sass/core/cssvar/index.html +1451 -360
  184. package/docs-dev/sass/core/element/index.html +1790 -417
  185. package/docs-dev/sass/core/index.html +1451 -360
  186. package/docs-dev/sass/core/layout/index.html +1491 -381
  187. package/docs-dev/sass/core/path/index.html +1451 -360
  188. package/docs-dev/sass/core/selector/index.html +1451 -360
  189. package/docs-dev/sass/core/typography/index.html +1591 -442
  190. package/docs-dev/sass/core/units/index.html +1453 -356
  191. package/docs-dev/sass/core/utils/index.html +2744 -504
  192. package/docs-dev/sass/helpers/color/index.html +1643 -928
  193. package/docs-dev/sass/helpers/display/index.html +1644 -929
  194. package/docs-dev/sass/helpers/index/index.html +1643 -928
  195. package/docs-dev/sass/helpers/index.html +1446 -353
  196. package/docs-dev/sass/helpers/print/index.html +759 -298
  197. package/docs-dev/sass/helpers/typography/index.html +1643 -928
  198. package/docs-dev/sass/helpers/units/index.html +1643 -928
  199. package/docs-dev/sass/helpers/utilities/index.html +1643 -924
  200. package/docs-dev/sass/index.html +1446 -353
  201. package/js/events/index.js +17 -5
  202. package/js/index.js +1 -0
  203. package/js/settings.js +97 -0
  204. package/js/ui/breakpoints.js +19 -16
  205. package/js/ui/collapsible.js +8 -1
  206. package/js/ui/details-group.js +112 -0
  207. package/js/ui/dialog.js +103 -44
  208. package/js/ui/dialog.todo +2 -36
  209. package/js/ui/flipcard.js +37 -57
  210. package/js/ui/grid.js +15 -13
  211. package/js/ui/index.js +1 -0
  212. package/js/ui/modal-builder.js +127 -70
  213. package/js/ui/overflow-scroller.js +6 -4
  214. package/js/ui/page.js +2 -2
  215. package/js/ui/popover.js +38 -38
  216. package/js/ui/print.js +16 -25
  217. package/js/ui/programmatic-modal.js +9 -3
  218. package/js/ui/proxy-click.js +50 -36
  219. package/js/ui/resizer.js +408 -39
  220. package/js/ui/scroll-slider.js +24 -30
  221. package/js/ui/scrollpoint.js +29 -64
  222. package/js/ui/slider.js +108 -63
  223. package/js/ui/tabs.js +23 -36
  224. package/js/ui/theme-toggle.js +332 -94
  225. package/js/ui/tooltip.js +27 -32
  226. package/js/utils/class-logger.js +3 -3
  227. package/js/utils/css.js +13 -0
  228. package/js/utils/dom.js +23 -64
  229. package/js/utils/font-awesome.js +19 -0
  230. package/js/utils/index.js +2 -1
  231. package/js/utils/system.js +155 -0
  232. package/package.json +23 -8
  233. package/scss/README.md +9 -0
  234. package/scss/_breakpoint.scss +39 -5
  235. package/scss/_button.scss +7 -5
  236. package/scss/_color.scss +71 -40
  237. package/scss/_element.scss +124 -2
  238. package/scss/_layout.scss +7 -8
  239. package/scss/_typography.scss +15 -0
  240. package/scss/_units.scss +3 -2
  241. package/scss/_utils.scss +387 -16
  242. package/scss/base/_elements.scss +0 -1
  243. package/scss/base/_index.scss +1 -1
  244. package/scss/base/_keyframes.scss +15 -0
  245. package/scss/base/_layout.scss +1 -0
  246. package/scss/base/_print.scss +2 -0
  247. package/scss/base/_root.scss +2 -0
  248. package/scss/components/README.todos +1 -0
  249. package/scss/components/_accordion.scss +154 -109
  250. package/scss/components/_badge-stack.scss +84 -0
  251. package/scss/components/_badge.scss +30 -7
  252. package/scss/components/_basic-hero.scss +112 -0
  253. package/scss/components/_breadcrumb.scss +110 -0
  254. package/scss/components/_button-group.scss +90 -0
  255. package/scss/components/_button-verbose.scss +100 -18
  256. package/scss/components/_callout.scss +112 -53
  257. package/scss/components/_captioned-figure.scss +17 -0
  258. package/scss/components/_card.scss +224 -66
  259. package/scss/components/_counter-list.scss +151 -0
  260. package/scss/components/_css-icon.scss +27 -17
  261. package/scss/components/_data-grid.scss +55 -12
  262. package/scss/components/_data-table.scss +31 -0
  263. package/scss/components/_flipcard.scss +8 -3
  264. package/scss/components/_form-theme.scss +106 -95
  265. package/scss/components/_headline-label.scss +83 -0
  266. package/scss/components/_hero.scss +12 -10
  267. package/scss/components/_index.scss +73 -0
  268. package/scss/components/_menu-stack.scss +69 -32
  269. package/scss/components/_modal.scss +51 -23
  270. package/scss/components/_nav-strip.scss +2 -0
  271. package/scss/components/_overlay-section.scss +2 -5
  272. package/scss/components/_panel.scss +246 -0
  273. package/scss/components/_popover.scss +165 -64
  274. package/scss/components/_progress-bar.scss +254 -0
  275. package/scss/components/_progress-circle.scss +175 -0
  276. package/scss/components/_pull-quote.scss +13 -13
  277. package/scss/components/_rail.scss +127 -0
  278. package/scss/components/_ratio-box.scss +2 -5
  279. package/scss/components/_rule.scss +1 -0
  280. package/scss/components/_scroll-slider.scss +1 -5
  281. package/scss/components/_skeleton.scss +126 -0
  282. package/scss/components/_slider.scss +49 -72
  283. package/scss/components/_spoke-spinner.scss +2 -2
  284. package/scss/components/_sticky-list.scss +206 -0
  285. package/scss/components/_tabs.scss +22 -4
  286. package/scss/components/_tag.scss +49 -7
  287. package/scss/components/_vignette.scss +3 -5
  288. package/scss/components/_wysiwyg.scss +21 -13
  289. package/scss/helpers/_display.scss +15 -18
  290. package/scss/helpers/_print.scss +12 -7
  291. package/scss/helpers/_utilities.scss +56 -34
  292. package/types/events/index.d.ts +10 -1
  293. package/types/events/index.d.ts.map +1 -1
  294. package/types/index.d.ts +1 -0
  295. package/types/settings.d.ts +70 -0
  296. package/types/settings.d.ts.map +1 -0
  297. package/types/ui/breakpoints.d.ts +14 -14
  298. package/types/ui/breakpoints.d.ts.map +1 -1
  299. package/types/ui/collapsible.d.ts.map +1 -1
  300. package/types/ui/details-group.d.ts +38 -0
  301. package/types/ui/details-group.d.ts.map +1 -0
  302. package/types/ui/dialog.d.ts +20 -14
  303. package/types/ui/dialog.d.ts.map +1 -1
  304. package/types/ui/flipcard.d.ts +16 -10
  305. package/types/ui/flipcard.d.ts.map +1 -1
  306. package/types/ui/grid.d.ts +4 -6
  307. package/types/ui/grid.d.ts.map +1 -1
  308. package/types/ui/index.d.ts +1 -0
  309. package/types/ui/modal-builder.d.ts +116 -11
  310. package/types/ui/modal-builder.d.ts.map +1 -1
  311. package/types/ui/overflow-scroller.d.ts +2 -2
  312. package/types/ui/overflow-scroller.d.ts.map +1 -1
  313. package/types/ui/popover.d.ts +6 -7
  314. package/types/ui/popover.d.ts.map +1 -1
  315. package/types/ui/print.d.ts +0 -4
  316. package/types/ui/print.d.ts.map +1 -1
  317. package/types/ui/programmatic-modal.d.ts.map +1 -1
  318. package/types/ui/proxy-click.d.ts +19 -3
  319. package/types/ui/proxy-click.d.ts.map +1 -1
  320. package/types/ui/resizer.d.ts +116 -16
  321. package/types/ui/resizer.d.ts.map +1 -1
  322. package/types/ui/scroll-slider.d.ts +5 -7
  323. package/types/ui/scroll-slider.d.ts.map +1 -1
  324. package/types/ui/scrollpoint.d.ts +3 -8
  325. package/types/ui/scrollpoint.d.ts.map +1 -1
  326. package/types/ui/slider.d.ts +33 -14
  327. package/types/ui/slider.d.ts.map +1 -1
  328. package/types/ui/tabs.d.ts +6 -8
  329. package/types/ui/tabs.d.ts.map +1 -1
  330. package/types/ui/theme-toggle.d.ts +51 -7
  331. package/types/ui/theme-toggle.d.ts.map +1 -1
  332. package/types/ui/tooltip.d.ts +3 -5
  333. package/types/ui/tooltip.d.ts.map +1 -1
  334. package/types/utils/css.d.ts +11 -0
  335. package/types/utils/css.d.ts.map +1 -0
  336. package/types/utils/dom.d.ts +12 -32
  337. package/types/utils/dom.d.ts.map +1 -1
  338. package/types/utils/font-awesome.d.ts +5 -0
  339. package/types/utils/font-awesome.d.ts.map +1 -0
  340. package/types/utils/index.d.ts +1 -0
  341. package/types/utils/system.d.ts +113 -0
  342. package/types/utils/system.d.ts.map +1 -0
package/js/utils/dom.js CHANGED
@@ -2,53 +2,17 @@
2
2
  * @module utils/dom
3
3
  */
4
4
 
5
-
6
- export const regexJsonString = /^[{\[][\s\S]*[}\]]$/;
5
+ import { kebabToCamel } from "@ulu/utils/string.js";
7
6
 
8
7
  /**
9
- * Get an elements JSON dataset value
10
- * @param {Node} element
11
- * @param {String} key key in dataset object for element
12
- * @returns {Object} Empty object or JSON object from dataset
8
+ * Converts a data attribute name to its corresponding dataset property name.
9
+ * @param {string} dataAttribute - The data attribute name (e.g., "data-ulu-dialog").
10
+ * @returns {string} - The dataset property name (e.g., "uluDialog").
13
11
  */
14
- export function getDatasetJson(element, key) {
15
- const passed = element.dataset[key];
16
- try {
17
- return JSON.parse(passed);
18
- } catch (error) {
19
- console.error(`Error getting JSON from dataset (${ key }) -- "${ passed }"\n`, element, error);
20
- return {};
21
- }
12
+ export function dataAttributeToDatasetKey(attribute) {
13
+ return kebabToCamel(attribute.replace(/^data-/, ""));
22
14
  }
23
15
 
24
- /**
25
- * Get an elements JSON dataset value that could potentially just be a single string
26
- * - If JSON it will return the object else it will return the value directly
27
- * @param {Node} element
28
- * @param {String} key key in dataset object for element
29
- * @returns {Object|String} JSON object or current dataset value (string or empty string if no value)
30
- */
31
- export function getDatasetOptionalJson(element, key) {
32
- const passed = element.dataset[key];
33
- if (passed && regexJsonString.test(passed.trim())) {
34
- return getDatasetJson(element, key);
35
- } else {
36
- return passed;
37
- }
38
- }
39
-
40
- /**
41
- * Check if a pointer event x/y was outside an elements bounding box
42
- */
43
- export function wasClickOutside(element, event) {
44
- const rect = element.getBoundingClientRect();
45
- return (event.clientY < rect.top || // above
46
- event.clientY > rect.top + rect.height || // below
47
- event.clientX < rect.left || // left side
48
- event.clientX > rect.left + rect.width); // right side
49
- }
50
-
51
-
52
16
  /**
53
17
  * Sets up the positional classes that would come from the equal
54
18
  * height module. Needs to be rerun by user when layout changes
@@ -95,28 +59,23 @@ export function setPositionClasses(parent, classes = {
95
59
  }
96
60
 
97
61
  /**
98
- * Resolve a target to Element
99
- * @param {String|Node} target The selector or node/element
100
- * @param {Object} context [document] The context to query possible selectors from
62
+ * Resolves a class input (string or array) into a consistent array of class names.
63
+ * @param {string|string[]} input - The class input, which can be a string, an array of strings, or any other value.
64
+ * @returns {string[]} An array of class names. Returns an empty array for invalid or falsy input.
65
+ * @example
66
+ * resolveClassArray("fas fa-check my-class"); // Returns ["fas", "fa-check", "my-class"]
67
+ * resolveClassArray(["another-class", "yet-another-class"]); // Returns ["another-class", "yet-another-class"]
68
+ * resolveClassArray("single-class"); // Returns ["single-class"]
101
69
  */
102
- export function getElement(target, context = document) {
103
- if (typeof target === "string") {
104
- return context.querySelector(target);
105
- } else if (target instanceof Element) {
106
- return target;
70
+ export function resolveClasses(classes) {
71
+ if (typeof classes === "string") {
72
+ return classes.split(" ").filter(c => c !== ""); // Split and remove empty strings
73
+ } else if (Array.isArray(classes)) {
74
+ return classes;
75
+ } else if (!classes) {
76
+ return [];
107
77
  } else {
108
- console.warn("Unable to getElement()", target);
109
- return null;
78
+ console.warn("resolveClassArray: Invalid class input type.", classes);
79
+ return [];
110
80
  }
111
- }
112
-
113
- /**
114
- * Sets a CSS custom property equal to the scrollbar width
115
- * @param {Node} element The element that is the child of a scrollabel container
116
- * @param {Node} container The container that can be scrolled
117
- * @param {Stirng} propName Custom property to set
118
- */
119
- export function addScrollbarProperty(element = document.body, container = window, propName = "--ulu-scrollbar-width") {
120
- const scrollbarWidth = container.innerWidth - element.clientWidth;
121
- element.style.setProperty(propName, `${ scrollbarWidth }px`);
122
- }
81
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @module settings
3
+ * @description Utility module for setting up Font Awesome
4
+ */
5
+
6
+ import { updateSettings } from "../settings.js";
7
+
8
+ /**
9
+ * Sets icon settings to Font Awesome icons
10
+ */
11
+ export function configureIcons() {
12
+ updateSettings({
13
+ iconClassClose: "fas fa-xmark",
14
+ iconClassDragX: "fas fa-solid fa-grip-lines-vertical",
15
+ // iconClassDragBoth: "fas fa-solid fa-grip", // Not really any good icons for this (no diagonal arrows, etc)
16
+ iconClassPrevious: "fas fa-solid fa-chevron-left",
17
+ iconClassNext: "fas fa-solid fa-chevron-right"
18
+ });
19
+ }
package/js/utils/index.js CHANGED
@@ -4,4 +4,5 @@ export * as floatingUi from "./floating-ui.js";
4
4
  export * as id from "./id.js";
5
5
  export * as index from "./index.js";
6
6
  export * as pauseYoutubeVideo from "./pause-youtube-video.js";
7
- export * as fileSave from "./file-save.js";
7
+ export * as fileSave from "./file-save.js";
8
+ export * as fontAwesome from "./font-awesome.js";
@@ -0,0 +1,155 @@
1
+ /**
2
+ * @module utils/system
3
+ * @description Core classes and mechanisms that define how UI components are created and managed within the library
4
+ */
5
+
6
+ import { hasRequiredProps } from "@ulu/utils/object.js";
7
+ import { getDatasetOptionalJson } from "@ulu/utils/browser/dom.js";
8
+ import { dataAttributeToDatasetKey } from "./dom.js";
9
+ import { getName } from "../events/index.js";
10
+
11
+ /**
12
+ * Class serves as a utility for UI modules, handling the selection of elements and the initialization of corresponding component instances, ensuring consistent setup within the module
13
+ */
14
+ export class ComponentInitializer {
15
+ static defaults = {
16
+ type: null,
17
+ baseAttribute: null
18
+ };
19
+ static requiredOptions = [
20
+ "type",
21
+ "baseAttribute"
22
+ ];
23
+ static hasRequiredOptions = hasRequiredProps(
24
+ ComponentInitializer.requiredOptions
25
+ );
26
+
27
+ /**
28
+ * Create a new instance of ComponentInitializer
29
+ * @param {Object} options Options for configuring the component initializer.
30
+ * @param {String} options.type Type of component (used for logs).
31
+ * @param {String} options.baseAttribute Prefix and base attribute name (used for base attribute and further element attribute names).
32
+ */
33
+ constructor(options) {
34
+ if (!ComponentInitializer.hasRequiredOptions(options)) {
35
+ throw new Error(
36
+ `Missing a required options: ${ ComponentInitializer.requiredOptions.join(", ") }`
37
+ );
38
+ }
39
+ this.options = Object.assign({}, ComponentInitializer.defaults, options);
40
+ this.logTitle = `ULU: ${ this.options.type }:\n`;
41
+ }
42
+ /**
43
+ * Initializes the component based on the provided configuration.
44
+ * @param {Object} config The initialization configuration.
45
+ * @param {Function} config.setup The setup function to call for each element.
46
+ * @param {String} config.key [null] The optional key to use with attribute selector.
47
+ * @param {Boolean} config.withData [null] Whether to retrieve element data.
48
+ * @param {Array} config.events [null] Ulu events that should call setup when dispatched (ie. pageModified, pageResized)
49
+ * @param {Boolean} config.onPageResized [null] Whether to bind event listener for page resize end
50
+ * @param {HTMLElement} config.context [document] The context to query within.
51
+ */
52
+ init(config) {
53
+ this.setupElements(config);
54
+ // Attach Handler to reinitialize if page is updated
55
+ // Specifically checking entire document incase element that dispatched
56
+ // event made alterations outside of itself
57
+ if (config.events?.length) {
58
+ config.events.forEach(name => {
59
+ document.addEventListener(getName(name), () => this.setupElements(config));
60
+ });
61
+ }
62
+ }
63
+ /**
64
+ * Processes the elements based on the provided configuration.
65
+ * @param {object} config The initialization configuration.
66
+ * @param {function} config.setup The setup function to call for each element.
67
+ * @param {string} config.key The optional key to use with attribute selector.
68
+ * @param {boolean} config.withData [false] Whether to retrieve element data.
69
+ * @param {boolean} config.onPageModified [true] Whether to bind event listener for page modifications.
70
+ * @param {HTMLElement} config.context [document] The context to query within.
71
+ */
72
+ setupElements(config) {
73
+ const { setup, key, withData, context } = config;
74
+ const elementsWithData = this.queryAllInitial(key, withData, context);
75
+ elementsWithData.forEach(elementWithData => setup(elementWithData, this));
76
+ }
77
+ /**
78
+ * Get an attribute name
79
+ * @param {String} key Optional key, if no key will return baseAttribute if key will return key added to base
80
+ * @returns {String} String like data-ulu-dialog or data-ulu-dialog-element
81
+ */
82
+ getAttribute(key) {
83
+ const { baseAttribute } = this.options;
84
+ return key ? `${ baseAttribute }-${ key }` : `${ baseAttribute }`;
85
+ }
86
+ /**
87
+ * Create an attribute selector
88
+ * @param {String} key Optional key (see getAttribute)
89
+ */
90
+ attributeSelector(key) {
91
+ return `[${ this.getAttribute(key) }]`;
92
+ }
93
+ /**
94
+ * Create an attribute selector for initial
95
+ * @return {String}
96
+ */
97
+ attributeSelectorInitial(key) {
98
+ return `${ this.attributeSelector(key) }:not([${ this.getAttribute("init") }])`
99
+ }
100
+ /**
101
+ * Queries all main elements of a component that have not been initialized and extracts their data attributes.
102
+ * @param {HTMLElement} context The context to query within.
103
+ * @param {Boolean} withData Include dataset from element (as optional JSON)
104
+ * @param {Node} context Element to query elements from
105
+ * @returns {Array<{element: HTMLElement, data: object, initialize: Function}>} An array of objects containing the elements, their data, and convenience function initialize() which when called will set the init attribute on the element
106
+ */
107
+ queryAllInitial(key, withData, context = document) {
108
+ const elements = [ ...context.querySelectorAll(this.attributeSelectorInitial(key)) ];
109
+ return elements.map((element) => ({
110
+ element,
111
+ data: withData ? this.getData(element, key) : null,
112
+ initialize: () => this.initializeElement(element)
113
+ }));
114
+ }
115
+ /**
116
+ * Sets the init attribute on an element, marking it as initialized.
117
+ * @param {HTMLElement} element The element to initialize.
118
+ */
119
+ initializeElement(element) {
120
+ element.setAttribute(this.getAttribute("init"), "");
121
+ }
122
+ /**
123
+ * Get an elements dataset value as JSON or other value
124
+ * @return {*} The value of the dataset, if JSON will return object else will return string value or undefined
125
+ */
126
+ getData(element, key) {
127
+ const datasetKey = dataAttributeToDatasetKey(this.getAttribute(key));
128
+ return getDatasetOptionalJson(element, datasetKey);
129
+ }
130
+ /**
131
+ * Will output namespaced console logs for the given initializer
132
+ */
133
+ log(...msgs) {
134
+ console.log(this.logTitle, ...msgs);
135
+ }
136
+ /**
137
+ * Will output namespaced console warnings for the given initializer
138
+ */
139
+ warn(...msgs) {
140
+ console.warn(this.logTitle, ...msgs);
141
+ }
142
+ /**
143
+ * Will output namespaced console error for the given initializer
144
+ */
145
+ logError(...msgs) {
146
+ console.error(this.logTitle, ...msgs);
147
+ }
148
+ }
149
+
150
+ /**
151
+ * Class serves as a base for representing individual occurrences of a UI component, providing a consistent structure for each
152
+ */
153
+ export class ComponentInstance {
154
+
155
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ulu/frontend",
3
- "version": "0.1.0-beta.11",
4
- "description": "Modular Sass Theming Library",
3
+ "version": "0.1.0-beta.110",
4
+ "description": "A versatile SCSS and JavaScript component library offering configurable, accessible components and flexible integration into any project, with SCSS modules suitable for modern JS frameworks.",
5
5
  "browser": "js/index.js",
6
6
  "main": "index.js",
7
7
  "exports": {
@@ -30,7 +30,9 @@
30
30
  "docs:build:prod": "IS_PRODUCTION=true npx @11ty/eleventy --config=docs.eleventy.js",
31
31
  "docs:assets": "vite --config docs.vite.config.js --force",
32
32
  "docs:assets:build": "vite build --config docs.vite.config.js",
33
- "docs:assets:build:prod": "IS_PRODUCTION=true vite build --config docs.vite.config.js"
33
+ "docs:assets:build:prod": "IS_PRODUCTION=true vite build --config docs.vite.config.js",
34
+ "deploy": "npm run build && npm run types && npm run docs:build:prod && npm run docs:assets:build:prod",
35
+ "deploy:docs": "npm run docs:build:prod && npm run docs:assets:build:prod"
34
36
  },
35
37
  "repository": {
36
38
  "type": "git",
@@ -44,7 +46,18 @@
44
46
  "modules",
45
47
  "javascript",
46
48
  "framework",
47
- "mixin"
49
+ "mixin",
50
+ "components",
51
+ "HTML",
52
+ "frontend framework",
53
+ "css",
54
+ "utilities",
55
+ "design system",
56
+ "toolkit",
57
+ "accessibility",
58
+ "ui",
59
+ "user interface",
60
+ "responsive design"
48
61
  ],
49
62
  "authors": {
50
63
  "name": "Joe Scherben, Informatics Studio",
@@ -61,11 +74,12 @@
61
74
  "@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
62
75
  "@fortawesome/fontawesome-free": "^6.5.2",
63
76
  "@ulu/markdown-output-utils": "^0.0.6",
64
- "@ulu/sassdoc-to-markdown": "^0.0.15",
77
+ "@ulu/sassdoc-to-markdown": "^0.0.16",
65
78
  "@ulu/vite-config-cms-theme": "^0.0.10",
66
79
  "@ulu/vitepress-auto-menus": "^0.0.3",
67
80
  "@ulu/vitepress-sassdoc": "^0.0.9",
68
81
  "algoliasearch": "^4.23.3",
82
+ "autoprefixer": "^10.4.16",
69
83
  "chokidar": "^3.6.0",
70
84
  "eleventy-plugin-nesting-toc": "^1.3.0",
71
85
  "fs-extra": "^11.2.0",
@@ -78,14 +92,15 @@
78
92
  "sass-embedded": "^1.81.0",
79
93
  "sharp": "^0.33.4",
80
94
  "svgo": "^3.3.2",
95
+ "twig": "^1.17.1",
81
96
  "typescript": "^5.3.3",
82
- "autoprefixer": "^10.4.16",
83
97
  "vite": "^5.4.11"
84
98
  },
85
99
  "dependencies": {
86
- "@ulu/utils": "^0.0.17",
100
+ "@floating-ui/dom": "^1.6.5",
101
+ "@ulu/utils": "^0.0.30",
87
102
  "ally.js": "^1.4.1",
88
103
  "aria-tablist": "^1.2.2",
89
- "@floating-ui/dom": "^1.6.5"
104
+ "swipe-listener" : "^1.3.0"
90
105
  }
91
106
  }
package/scss/README.md CHANGED
@@ -35,12 +35,21 @@
35
35
  - Modules use simple variable, mixins and function names relative to their module
36
36
  - Forwards will make namespacing in the overall ulu packaged module
37
37
  - **Module Prefixes:** Modules all get prefixed by parent module ie lib will transform color.set() to color-set(), adding the modules namespace for users that are importing the whole library. It also matches the core modules `map-get()` and when @used `map.get()`
38
+ - Try to avoid "&" selector when possible?
39
+ - For example with
40
+ - .user-scope-selector { .component-example + .component-example { // This can be wrapped externally } }
41
+ - .user-scope-selector { .component-example { & + & {} } } // This will incorrectly inherit the users outer selector.
42
+ - Not crucial (we won't specifically design this way) but we may want to refactor in the future (at least components) so that we write selectors in a more static way so that scoping doesn't interfere
38
43
 
39
44
  ### Writing Docs
40
45
 
41
46
  - Should be written from the user's point of view
42
47
  - Use prefixes @see "Module Prefixes" in member names. This will avoid confusion about normal use case. For advanced user importing specific parts would already be familiar with this pattern.
43
48
 
49
+ #### Workaround for syntax highlighting bug
50
+
51
+ If the syntax highlighting isn't working properly after an example, add an empty line with `///` to workaround that bug
52
+
44
53
  ### Ideas
45
54
 
46
55
  - How to solve the inability to use standard vars (avoid with)
@@ -4,6 +4,7 @@
4
4
  ////
5
5
 
6
6
  @use "sass:map";
7
+ @use "sass:list";
7
8
  @use "utils";
8
9
 
9
10
  /// Module Settings
@@ -30,8 +31,10 @@ $config: (
30
31
  }
31
32
 
32
33
  /// Get a config option
33
- /// @example scss Get default breakpoint name
34
- /// $default: ulu.breakpoint-get("default");
34
+ /// @example scss {compile} Example usage
35
+ /// .test-get {
36
+ /// font-size: ulu.breakpoint-get("base");
37
+ /// }
35
38
  /// @param {Map} $name Name of property
36
39
  /// @return {*} Property Value
37
40
 
@@ -65,6 +68,12 @@ $sizes: (
65
68
  }
66
69
 
67
70
  /// Get all breakpoint sizes
71
+ /// @compiler
72
+ /// @example scss {compile} Example usage
73
+ /// .test-get-sizes {
74
+ /// $sizes: ulu.breakpoint-get-sizes();
75
+ /// content: map.get($sizes, "medium");
76
+ /// }
68
77
  /// @return {Map} Map of breakpoints (equivalent to $sizes)
69
78
 
70
79
  @function get-sizes() {
@@ -73,14 +82,25 @@ $sizes: (
73
82
 
74
83
  /// Get a specific breakpoint's raw value/size
75
84
  /// @param {String} $size The name of the size to get
85
+ /// @compiler
86
+ /// @example scss {compile} Example usage
87
+ /// .test-get-size {
88
+ /// content: ulu.breakpoint-get-size("medium");
89
+ /// }
76
90
  /// @return {Number} The sizes value
77
-
91
+
78
92
  @function get-size($size) {
79
93
  @return utils.require-map-get($sizes, $size, "breakpoint size");
80
94
  }
81
95
 
82
96
  /// Get a specific breakpoint's size's value and optionally specify max to get the ending/max value for a breakpoint
83
97
  /// @param {Boolean} $max [false] Get the max value
98
+ /// @compiler
99
+ /// @example scss {compile} Example usage
100
+ /// .test-get-size-value {
101
+ /// content: ulu.breakpoint-get-size-value("medium", true);
102
+ /// content: ulu.breakpoint-get-size-value("medium");
103
+ /// }
84
104
  /// @return {Number} The value for the given size
85
105
 
86
106
  @function get-size-value($size, $max: false) {
@@ -94,6 +114,20 @@ $sizes: (
94
114
  /// Check if a specific size exist
95
115
  /// @param {String} $name The breakpoint size to check if exists
96
116
  /// @return {Boolean}
117
+ /// @example scss {compile} Example usage
118
+ /// .test-exists {
119
+ /// @if(ulu.breakpoint-exists("medium")) {
120
+ /// @include ulu.breakpoint-min("medium") {
121
+ /// padding: 2rem;
122
+ /// }
123
+ /// }
124
+ /// // The below content doesn't print because the size doesn't exist.
125
+ /// @if(ulu.breakpoint-exists("too-large")) {
126
+ /// @include ulu.breakpoint-min("too-large") {
127
+ /// padding: 20000rem;
128
+ /// }
129
+ /// }
130
+ /// }
97
131
 
98
132
  @function exists($name) {
99
133
  $size: map.get($sizes, $name);
@@ -190,7 +224,7 @@ $sizes: (
190
224
  /// @include breakpoints.fromEach($breakpoints) using ($props) {
191
225
  /// width: map.get($props, "width");
192
226
  /// }
193
- /// @param {String} $breakpoints A map with breakpoints direction will be pulled from each items "direction" property, if direction is missing and no breakpoint will wrap the code
227
+ /// @param {String} $breakpoints A map with breakpoints direction will be pulled from each items "direction" property, if direction is missing no breakpoint will wrap the code (as convention we call the default non-breakpoint direction "default")
194
228
  /// @param {String} $options A map with options to change the behavior
195
229
  /// @param {Boolean} $options.directionRequired Require direction throw error if missing direction
196
230
 
@@ -220,7 +254,7 @@ $sizes: (
220
254
  /// - Breakpoints always min-width (upwards) for javascript setup
221
255
 
222
256
  @mixin embed-for-scripts() {
223
- &:before {
257
+ &::before {
224
258
  display: none;
225
259
  content: get("null-name");
226
260
  @each $size, $breakpoint in $sizes {
package/scss/_button.scss CHANGED
@@ -94,7 +94,7 @@ $config: (
94
94
 
95
95
  $sizes: (
96
96
  "small" : (
97
- "padding": (0.35em 1.5em),
97
+ "padding": (0.35em 1em),
98
98
  "min-width": 0,
99
99
  "icon-size": 2rem,
100
100
  "icon-font-size": 1rem
@@ -118,9 +118,9 @@ $styles: (
118
118
  "border-color" : transparent,
119
119
  "box-shadow" : none,
120
120
  "hover" : (
121
- "background-color" : "white",
122
- "color" : inherit,
123
- "border-color" : transparent,
121
+ "background-color" : "control-background",
122
+ "color" : "control",
123
+ "border-color" : "control-border",
124
124
  )
125
125
  ),
126
126
  "outline" : (
@@ -129,7 +129,9 @@ $styles: (
129
129
  "border-color" : "rule-light",
130
130
  "box-shadow" : none,
131
131
  "hover" : (
132
- "background-color" : "white",
132
+ "background-color" : "control-background",
133
+ "color" : "control",
134
+ "border-color" : "control-border",
133
135
  )
134
136
  ),
135
137
  ) !default;
package/scss/_color.scss CHANGED
@@ -16,43 +16,49 @@
16
16
  /// @type map
17
17
 
18
18
  $palette: (
19
- "black" : black,
20
- "white" : white,
21
- "type" : black,
22
- "type-secondary" : rgb(82, 82, 82),
23
- "type-tertiary" : rgb(157, 157, 157),
24
- "headline" : inherit,
25
- "background" : white,
26
- "background-gray" : #F7F8F7,
27
- "focus" : blue,
28
- "accent" : orange,
29
- "info" : #00bde3,
30
- "success" : #00a91c,
31
- "warning" : #ffbe2e,
32
- "danger" : #d54309,
33
- "info-background" : #e7f6f8,
34
- "success-background" : #ecf3ec,
35
- "warning-background" : #faf3d1,
36
- "danger-background" : #f4e3db,
37
- "selected" : green,
38
- "box-shadow" : rgba(0, 0, 0, 0.349),
39
- "box-shadow-hover" : rgba(0, 0, 0, 0.5),
40
- "rule" : gray,
41
- "rule-light" : lightgray,
42
- "link" : blue,
43
- "link-hover" : darkblue,
44
- "link-active" : darkblue,
45
- "link-visited" : purple,
46
- "bullet" : inherit,
47
- "control" : white,
48
- "control-hover" : white,
49
- "control-active" : white,
50
- "control-border" : purple,
51
- "control-border-hover" : blue,
52
- "control-border-active" : orange,
53
- "control-background" : purple,
54
- "control-background-hover": blue,
55
- "control-background-active": orange,
19
+ "black": black,
20
+ "white": white,
21
+ "type": black,
22
+ "type-secondary": rgb(82, 82, 82),
23
+ "type-tertiary": rgb(125, 125, 125),
24
+ "type-disabled": rgb(160, 160, 160),
25
+ "headline": inherit,
26
+ "background": white,
27
+ "background-gray": #fafafa,
28
+ "focus": blue,
29
+ "accent": orange,
30
+ "info": #00bde3,
31
+ "success": #00a91c,
32
+ "warning": #ffbe2e,
33
+ "danger": #d54309,
34
+ "info-background": #e7f6f8,
35
+ "success-background": #ecf3ec,
36
+ "warning-background": #faf3d1,
37
+ "danger-background": #f4e3db,
38
+ // Used for background of elements that are placeholder or that have no value (think charts)
39
+ "placeholder-background": #e2e2e2,
40
+ "placeholder-background-alt": #bababa,
41
+ "selected": green,
42
+ "box-shadow": rgba(0, 0, 0, 0.349),
43
+ "box-shadow-hover": rgba(0, 0, 0, 0.5),
44
+ "rule": gray,
45
+ "rule-light": lightgray,
46
+ "link": blue,
47
+ "link-hover": darkblue,
48
+ "link-active": darkblue,
49
+ "link-visited": purple,
50
+ "bullet": inherit,
51
+ "control": white,
52
+ "control-hover": white,
53
+ "control-active": white,
54
+ "control-border": purple,
55
+ "control-border-hover": blue,
56
+ "control-border-active": orange,
57
+ "control-background": purple,
58
+ "control-background-hover": blue,
59
+ "control-background-active": orange,
60
+ // Like accent indicator like things in ui (progress, etc)
61
+ "indicator" : #5050ab,
56
62
  ) !default;
57
63
 
58
64
  /// Pairs of background-color and color definitions
@@ -101,8 +107,11 @@ $color-classes: (
101
107
  @function get($name) {
102
108
  // Allow non lookup if the value is already a color (helps with code flow)
103
109
  @if (meta.type-of($name) == "string") {
110
+ $is-keyword: $name == "inherit" or $name == "transparent" or $name == "currentColor";
111
+ $is-cssvar: string.index($name, "var(") == 1;
112
+ $is-color-mix: string.index($name, "color-mix(") == 1;
104
113
  // Allow custom-properties and keyword inherit/transparent to pass through
105
- @if ($name == "inherit" or $name == "transparent" or $name == "currentColor" or string.index($name, "var(") == 1) {
114
+ @if ($is-keyword or $is-cssvar or $is-color-mix) {
106
115
  @return $name;
107
116
  // Else look up the color from the palette
108
117
  } @else {
@@ -178,7 +187,7 @@ $color-classes: (
178
187
  color: get-context-value($name, "color");
179
188
  }
180
189
 
181
- /// Lighten a color using the default white by a percentage
190
+ /// Tint (add white) a color using the default white by a percentage
182
191
  /// @param {Color, String} $color Color/palette color name to apply to tint
183
192
  /// @param {Number} $percentage Percentage
184
193
  /// @return {Color}
@@ -189,7 +198,18 @@ $color-classes: (
189
198
  @return color.mix(get("white"), get($color), $percentage);
190
199
  }
191
200
 
192
- /// Darken a color with the default black by a percentage
201
+ /// Tint (add white) a color using the default white by a percentage (Using color-mix)
202
+ /// - This only works in modern browsers (as of June 2025)
203
+ /// - These match ulu.color-tint() and are designed to accept the same arguments with the same results
204
+ /// @param {Color, String} $color Color or custom property to apply mix to
205
+ /// @param {Number} $percentage Percentage
206
+ /// @return {Color}
207
+
208
+ @function css-tint($color, $percentage) {
209
+ @return color-mix(in srgb, get("white") $percentage, get($color) calc(100% - $percentage));
210
+ }
211
+
212
+ /// Shade (add black) a color with the default black by a percentage
193
213
  /// @param {Color, String} $color Color/palette color name to shade
194
214
  /// @param {Number} $percentage Percentage to shade
195
215
  /// @return {Color}
@@ -200,6 +220,17 @@ $color-classes: (
200
220
  @return color.mix(get("black"), get($color), $percentage);
201
221
  }
202
222
 
223
+ /// Shade (add black) a color using the default white by a percentage (Using color-mix)
224
+ /// - This only works in modern browsers (as of June 2025)
225
+ /// - These match ulu.color-shade() and are designed to accept the same arguments with the same results
226
+ /// @param {Color, String} $color Color or custom property to apply mix to
227
+ /// @param {Number} $percentage Percentage
228
+ /// @return {Color}
229
+
230
+ @function css-shade($color, $percentage) {
231
+ @return color-mix(in srgb, get("black") $percentage, get($color) calc(100% - $percentage));
232
+ }
233
+
203
234
  /// Prints all context styles
204
235
  /// @param {String} $with-prop Checks the specific context for a certain prop (has to be truthy)(used for output in helper/base color modules)
205
236
  /// @example scss