@ulu/frontend 0.1.0-beta.8 → 0.1.0-beta.80

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 (287) hide show
  1. package/CHANGELOG.md +529 -0
  2. package/README.dev.md +3 -3
  3. package/README.md +14 -4
  4. package/dist/ulu-frontend.min.css +1 -1
  5. package/dist/ulu-frontend.min.js +35 -28
  6. package/docs-dev/assets/main.js +8290 -635
  7. package/docs-dev/assets/placeholder/icon-calendar.svg +1 -0
  8. package/docs-dev/assets/placeholder/icon-check.svg +1 -0
  9. package/docs-dev/assets/style.css +789 -338
  10. package/docs-dev/changelog/index.html +6553 -0
  11. package/docs-dev/demos/accordion/index.html +850 -328
  12. package/docs-dev/demos/badge/index.html +5265 -0
  13. package/docs-dev/demos/basic-hero/index.html +111 -0
  14. package/docs-dev/demos/breakpoints-manager/index.html +5276 -0
  15. package/docs-dev/demos/button/index.html +892 -328
  16. package/docs-dev/demos/button-verbose/index.html +5268 -0
  17. package/docs-dev/demos/callout/index.html +895 -332
  18. package/docs-dev/demos/captioned-figure/index.html +850 -327
  19. package/docs-dev/demos/card/index.html +930 -768
  20. package/docs-dev/demos/card-grid/index.html +5387 -0
  21. package/docs-dev/demos/counter-list/index.html +5270 -0
  22. package/docs-dev/demos/css-icons/index.html +850 -327
  23. package/docs-dev/demos/data-grid/index.html +870 -347
  24. package/docs-dev/demos/data-table/index.html +1024 -368
  25. package/docs-dev/demos/details-group/index.html +5297 -0
  26. package/docs-dev/demos/file-save/index.html +850 -327
  27. package/docs-dev/demos/flipcard/index.html +850 -327
  28. package/docs-dev/demos/form-theme/index.html +868 -358
  29. package/docs-dev/demos/hero/index.html +12 -4
  30. package/docs-dev/demos/image-grid/index.html +12 -4
  31. package/docs-dev/demos/index.html +851 -328
  32. package/docs-dev/demos/list-inline/index.html +850 -327
  33. package/docs-dev/demos/list-lines/index.html +850 -327
  34. package/docs-dev/demos/menu-stack/index.html +884 -346
  35. package/docs-dev/demos/modals/index.html +968 -330
  36. package/docs-dev/demos/nav-strip/index.html +850 -327
  37. package/docs-dev/demos/overlay-section/index.html +939 -346
  38. package/docs-dev/demos/popovers/index.html +1112 -347
  39. package/docs-dev/demos/print/index.html +850 -327
  40. package/docs-dev/demos/pull-quote/index.html +850 -327
  41. package/docs-dev/demos/rule/index.html +863 -328
  42. package/docs-dev/demos/scroll-slider/index.html +72 -106
  43. package/docs-dev/demos/scrollpoints/index.html +851 -328
  44. package/docs-dev/demos/slider/index.html +12 -4
  45. package/docs-dev/demos/spoke-spinner/index.html +850 -327
  46. package/docs-dev/demos/{list-inline.1 → sticky-list}/index.html +883 -357
  47. package/docs-dev/demos/tabs/index.html +886 -327
  48. package/docs-dev/demos/tag/index.html +850 -327
  49. package/docs-dev/demos/theme-toggle/index.html +5309 -0
  50. package/docs-dev/demos/tile-grid-overlay/index.html +12 -4
  51. package/docs-dev/demos/tiles/index.html +850 -327
  52. package/docs-dev/demos/tooltip/index.html +850 -327
  53. package/docs-dev/guide/building-stylesheet/index.html +850 -327
  54. package/docs-dev/guide/developing-ulu-scss-module/index.html +850 -327
  55. package/docs-dev/guide/index.html +850 -327
  56. package/docs-dev/index.html +850 -327
  57. package/docs-dev/javascript/events/index.html +847 -326
  58. package/docs-dev/javascript/index.html +850 -327
  59. package/docs-dev/javascript/settings/index.html +5430 -0
  60. package/docs-dev/javascript/ui-breakpoints/index.html +862 -341
  61. package/docs-dev/javascript/ui-collapsible/index.html +847 -326
  62. package/docs-dev/javascript/ui-details-group/index.html +5352 -0
  63. package/docs-dev/javascript/ui-dialog/index.html +879 -343
  64. package/docs-dev/javascript/ui-flipcard/index.html +908 -331
  65. package/docs-dev/javascript/ui-grid/index.html +857 -362
  66. package/docs-dev/javascript/ui-modal-builder/index.html +1047 -386
  67. package/docs-dev/javascript/ui-overflow-scroller/index.html +847 -326
  68. package/docs-dev/javascript/ui-overflow-scroller-pager/index.html +847 -326
  69. package/docs-dev/javascript/ui-page/index.html +847 -326
  70. package/docs-dev/javascript/ui-popover/index.html +855 -338
  71. package/docs-dev/javascript/ui-print/index.html +847 -334
  72. package/docs-dev/javascript/ui-print-details/index.html +847 -326
  73. package/docs-dev/javascript/ui-programmatic-modal/index.html +847 -326
  74. package/docs-dev/javascript/ui-proxy-click/index.html +934 -328
  75. package/docs-dev/javascript/ui-resizer/index.html +847 -326
  76. package/docs-dev/javascript/ui-scroll-slider/index.html +885 -332
  77. package/docs-dev/javascript/ui-scrollpoint/index.html +853 -339
  78. package/docs-dev/javascript/ui-slider/index.html +1043 -331
  79. package/docs-dev/javascript/ui-tabs/index.html +858 -374
  80. package/docs-dev/javascript/ui-theme-toggle/index.html +5440 -0
  81. package/docs-dev/javascript/ui-tooltip/index.html +854 -337
  82. package/docs-dev/javascript/utils-class-logger/index.html +847 -326
  83. package/docs-dev/javascript/utils-css/index.html +5254 -0
  84. package/docs-dev/javascript/utils-dom/index.html +887 -446
  85. package/docs-dev/javascript/utils-file-save/index.html +847 -326
  86. package/docs-dev/javascript/utils-floating-ui/index.html +847 -326
  87. package/docs-dev/javascript/utils-id/index.html +847 -326
  88. package/docs-dev/javascript/utils-pause-youtube-video/index.html +847 -326
  89. package/docs-dev/javascript/utils-system/index.html +5557 -0
  90. package/docs-dev/sass/base/color/index.html +847 -326
  91. package/docs-dev/sass/base/elements/index.html +847 -326
  92. package/docs-dev/sass/base/index/index.html +847 -326
  93. package/docs-dev/sass/base/index.html +850 -327
  94. package/docs-dev/sass/base/keyframes/index.html +847 -326
  95. package/docs-dev/sass/base/layout/index.html +847 -326
  96. package/docs-dev/sass/base/normalize/index.html +847 -326
  97. package/docs-dev/sass/base/print/index.html +847 -326
  98. package/docs-dev/sass/base/root/index.html +847 -326
  99. package/docs-dev/sass/base/typography/index.html +847 -326
  100. package/docs-dev/sass/components/accordion/index.html +866 -338
  101. package/docs-dev/sass/components/adaptive-spacing/index.html +847 -326
  102. package/docs-dev/sass/components/badge/index.html +869 -337
  103. package/docs-dev/sass/components/basic-hero/index.html +5415 -0
  104. package/docs-dev/sass/components/button/index.html +847 -326
  105. package/docs-dev/sass/components/button-verbose/index.html +933 -337
  106. package/docs-dev/sass/components/callout/index.html +958 -418
  107. package/docs-dev/sass/components/captioned-figure/index.html +970 -334
  108. package/docs-dev/sass/components/card/index.html +939 -346
  109. package/docs-dev/sass/components/card-grid/index.html +847 -326
  110. package/docs-dev/sass/components/counter-list/index.html +5497 -0
  111. package/docs-dev/sass/components/css-icon/index.html +864 -336
  112. package/docs-dev/sass/components/data-grid/index.html +868 -340
  113. package/docs-dev/sass/components/data-table/index.html +1063 -352
  114. package/docs-dev/sass/components/fill-context/index.html +847 -326
  115. package/docs-dev/sass/components/flipcard/index.html +888 -336
  116. package/docs-dev/sass/components/flipcard-grid/index.html +847 -326
  117. package/docs-dev/sass/components/form-theme/index.html +1063 -446
  118. package/docs-dev/sass/components/hero/index.html +903 -334
  119. package/docs-dev/sass/components/horizontal-rule/index.html +847 -326
  120. package/docs-dev/sass/components/image-grid/index.html +847 -326
  121. package/docs-dev/sass/components/index/index.html +860 -336
  122. package/docs-dev/sass/components/index.html +850 -327
  123. package/docs-dev/sass/components/links/index.html +847 -326
  124. package/docs-dev/sass/components/list-inline/index.html +847 -326
  125. package/docs-dev/sass/components/list-lines/index.html +847 -326
  126. package/docs-dev/sass/components/list-ordered/index.html +847 -326
  127. package/docs-dev/sass/components/list-unordered/index.html +847 -326
  128. package/docs-dev/sass/components/menu-stack/index.html +881 -347
  129. package/docs-dev/sass/components/modal/index.html +891 -342
  130. package/docs-dev/sass/components/nav-strip/index.html +855 -334
  131. package/docs-dev/sass/components/overlay-section/index.html +855 -334
  132. package/docs-dev/sass/components/pager/index.html +847 -326
  133. package/docs-dev/sass/components/placeholder-block/index.html +847 -326
  134. package/docs-dev/sass/components/popover/index.html +904 -347
  135. package/docs-dev/sass/components/pull-quote/index.html +859 -338
  136. package/docs-dev/sass/components/ratio-box/index.html +855 -334
  137. package/docs-dev/sass/components/rule/index.html +848 -327
  138. package/docs-dev/sass/components/scroll-slider/index.html +855 -346
  139. package/docs-dev/sass/components/skip-link/index.html +847 -326
  140. package/docs-dev/sass/components/slider/index.html +897 -388
  141. package/docs-dev/sass/components/spoke-spinner/index.html +849 -328
  142. package/docs-dev/sass/components/sticky-list/index.html +5633 -0
  143. package/docs-dev/sass/components/tabs/index.html +872 -336
  144. package/docs-dev/sass/components/tag/index.html +849 -328
  145. package/docs-dev/sass/components/tile-button/index.html +847 -326
  146. package/docs-dev/sass/components/tile-grid/index.html +847 -326
  147. package/docs-dev/sass/components/tile-grid-overlay/index.html +847 -326
  148. package/docs-dev/sass/components/vignette/index.html +861 -334
  149. package/docs-dev/sass/components/wysiwyg/index.html +847 -326
  150. package/docs-dev/sass/core/breakpoint/index.html +931 -358
  151. package/docs-dev/sass/core/button/index.html +847 -326
  152. package/docs-dev/sass/core/color/index.html +1019 -366
  153. package/docs-dev/sass/core/cssvar/index.html +847 -326
  154. package/docs-dev/sass/core/element/index.html +1108 -381
  155. package/docs-dev/sass/core/index.html +847 -326
  156. package/docs-dev/sass/core/layout/index.html +903 -363
  157. package/docs-dev/sass/core/path/index.html +847 -326
  158. package/docs-dev/sass/core/selector/index.html +847 -326
  159. package/docs-dev/sass/core/typography/index.html +847 -326
  160. package/docs-dev/sass/core/units/index.html +857 -330
  161. package/docs-dev/sass/core/utils/index.html +2104 -476
  162. package/docs-dev/sass/helpers/color/index.html +847 -326
  163. package/docs-dev/sass/helpers/display/index.html +848 -327
  164. package/docs-dev/sass/helpers/index/index.html +847 -326
  165. package/docs-dev/sass/helpers/index.html +850 -327
  166. package/docs-dev/sass/helpers/print/index.html +759 -298
  167. package/docs-dev/sass/helpers/typography/index.html +847 -326
  168. package/docs-dev/sass/helpers/units/index.html +847 -326
  169. package/docs-dev/sass/helpers/utilities/index.html +849 -328
  170. package/docs-dev/sass/index.html +850 -327
  171. package/js/index.js +1 -0
  172. package/js/settings.js +95 -0
  173. package/js/ui/breakpoints.js +19 -16
  174. package/js/ui/collapsible.js +8 -1
  175. package/js/ui/details-group.js +112 -0
  176. package/js/ui/dialog.js +85 -42
  177. package/js/ui/dialog.todo +2 -36
  178. package/js/ui/flipcard.js +37 -57
  179. package/js/ui/grid.js +15 -13
  180. package/js/ui/index.js +1 -0
  181. package/js/ui/modal-builder.js +105 -59
  182. package/js/ui/overflow-scroller.js +6 -4
  183. package/js/ui/page.js +2 -2
  184. package/js/ui/popover.js +38 -38
  185. package/js/ui/print.js +16 -25
  186. package/js/ui/programmatic-modal.js +9 -3
  187. package/js/ui/proxy-click.js +50 -36
  188. package/js/ui/scroll-slider.js +24 -30
  189. package/js/ui/scrollpoint.js +29 -64
  190. package/js/ui/slider.js +108 -63
  191. package/js/ui/tabs.js +23 -36
  192. package/js/ui/theme-toggle.js +332 -94
  193. package/js/ui/tooltip.js +27 -32
  194. package/js/utils/css.js +13 -0
  195. package/js/utils/dom.js +23 -64
  196. package/js/utils/font-awesome.js +18 -0
  197. package/js/utils/index.js +2 -1
  198. package/js/utils/system.js +155 -0
  199. package/package.json +23 -8
  200. package/scss/README.md +4 -0
  201. package/scss/_breakpoint.scss +38 -4
  202. package/scss/_color.scss +40 -9
  203. package/scss/_element.scss +108 -2
  204. package/scss/_layout.scss +7 -8
  205. package/scss/_units.scss +3 -2
  206. package/scss/_utils.scss +380 -16
  207. package/scss/components/README.todos +14 -0
  208. package/scss/components/_accordion.scss +33 -19
  209. package/scss/components/_badge.scss +23 -4
  210. package/scss/components/_basic-hero.scss +112 -0
  211. package/scss/components/_button-verbose.scss +100 -18
  212. package/scss/components/_callout.scss +125 -78
  213. package/scss/components/_captioned-figure.scss +17 -0
  214. package/scss/components/_card-grid.scss +1 -1
  215. package/scss/components/_card.scss +246 -74
  216. package/scss/components/_counter-list.scss +151 -0
  217. package/scss/components/_css-icon.scss +25 -21
  218. package/scss/components/_data-grid.scss +55 -9
  219. package/scss/components/_data-table.scss +39 -3
  220. package/scss/components/_flipcard.scss +8 -3
  221. package/scss/components/_form-theme.scss +119 -108
  222. package/scss/components/_hero.scss +12 -10
  223. package/scss/components/_index.scss +18 -0
  224. package/scss/components/_menu-stack.scss +42 -26
  225. package/scss/components/_modal.scss +42 -26
  226. package/scss/components/_nav-strip.scss +2 -0
  227. package/scss/components/_overlay-section.scss +2 -5
  228. package/scss/components/_popover.scss +165 -64
  229. package/scss/components/_pull-quote.scss +13 -13
  230. package/scss/components/_ratio-box.scss +2 -5
  231. package/scss/components/_rule.scss +1 -0
  232. package/scss/components/_scroll-slider.scss +1 -5
  233. package/scss/components/_slider.scss +49 -72
  234. package/scss/components/_spoke-spinner.scss +2 -2
  235. package/scss/components/_sticky-list.scss +206 -0
  236. package/scss/components/_tabs.scss +22 -4
  237. package/scss/components/_vignette.scss +3 -5
  238. package/scss/helpers/_display.scss +15 -18
  239. package/scss/helpers/_print.scss +12 -7
  240. package/scss/helpers/_utilities.scss +42 -32
  241. package/types/index.d.ts +1 -0
  242. package/types/settings.d.ts +66 -0
  243. package/types/settings.d.ts.map +1 -0
  244. package/types/ui/breakpoints.d.ts +14 -14
  245. package/types/ui/breakpoints.d.ts.map +1 -1
  246. package/types/ui/collapsible.d.ts.map +1 -1
  247. package/types/ui/details-group.d.ts +38 -0
  248. package/types/ui/details-group.d.ts.map +1 -0
  249. package/types/ui/dialog.d.ts +20 -14
  250. package/types/ui/dialog.d.ts.map +1 -1
  251. package/types/ui/flipcard.d.ts +16 -10
  252. package/types/ui/flipcard.d.ts.map +1 -1
  253. package/types/ui/grid.d.ts +4 -6
  254. package/types/ui/grid.d.ts.map +1 -1
  255. package/types/ui/index.d.ts +2 -1
  256. package/types/ui/modal-builder.d.ts +113 -11
  257. package/types/ui/modal-builder.d.ts.map +1 -1
  258. package/types/ui/overflow-scroller.d.ts +2 -2
  259. package/types/ui/overflow-scroller.d.ts.map +1 -1
  260. package/types/ui/popover.d.ts +6 -7
  261. package/types/ui/popover.d.ts.map +1 -1
  262. package/types/ui/print.d.ts +0 -4
  263. package/types/ui/print.d.ts.map +1 -1
  264. package/types/ui/programmatic-modal.d.ts.map +1 -1
  265. package/types/ui/proxy-click.d.ts +19 -3
  266. package/types/ui/proxy-click.d.ts.map +1 -1
  267. package/types/ui/scroll-slider.d.ts +5 -7
  268. package/types/ui/scroll-slider.d.ts.map +1 -1
  269. package/types/ui/scrollpoint.d.ts +3 -8
  270. package/types/ui/scrollpoint.d.ts.map +1 -1
  271. package/types/ui/slider.d.ts +33 -14
  272. package/types/ui/slider.d.ts.map +1 -1
  273. package/types/ui/tabs.d.ts +6 -8
  274. package/types/ui/tabs.d.ts.map +1 -1
  275. package/types/ui/theme-toggle.d.ts +51 -7
  276. package/types/ui/theme-toggle.d.ts.map +1 -1
  277. package/types/ui/tooltip.d.ts +3 -5
  278. package/types/ui/tooltip.d.ts.map +1 -1
  279. package/types/utils/css.d.ts +11 -0
  280. package/types/utils/css.d.ts.map +1 -0
  281. package/types/utils/dom.d.ts +12 -32
  282. package/types/utils/dom.d.ts.map +1 -1
  283. package/types/utils/font-awesome.d.ts +5 -0
  284. package/types/utils/font-awesome.d.ts.map +1 -0
  285. package/types/utils/index.d.ts +2 -1
  286. package/types/utils/system.d.ts +113 -0
  287. package/types/utils/system.d.ts.map +1 -0
@@ -0,0 +1,18 @@
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
+ iconClassPrevious: "fas fa-solid fa-chevron-left",
16
+ iconClassNext: "fas fa-solid fa-chevron-right"
17
+ });
18
+ }
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.8",
4
- "description": "Modular Sass Theming Library",
3
+ "version": "0.1.0-beta.80",
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
@@ -41,6 +41,10 @@
41
41
  - Should be written from the user's point of view
42
42
  - 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
43
 
44
+ #### Workaround for syntax highlighting bug
45
+
46
+ If the syntax highlighting isn't working properly after an example, add an empty line with `///` to workaround that bug
47
+
44
48
  ### Ideas
45
49
 
46
50
  - 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
+ /// height: 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
+ /// height: 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
+ /// height: ulu.breakpoint-get-size-value("medium", true);
102
+ /// max-height: 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);
@@ -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/_color.scss CHANGED
@@ -23,11 +23,17 @@ $palette: (
23
23
  "type-tertiary" : rgb(157, 157, 157),
24
24
  "headline" : inherit,
25
25
  "background" : white,
26
- "background-gray" : #F7F8F7,
26
+ "background-gray" : #fafafa,
27
27
  "focus" : blue,
28
- "error" : red,
29
- "warning" : orange,
30
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,
31
37
  "selected" : green,
32
38
  "box-shadow" : rgba(0, 0, 0, 0.349),
33
39
  "box-shadow-hover" : rgba(0, 0, 0, 0.5),
@@ -40,10 +46,10 @@ $palette: (
40
46
  "bullet" : inherit,
41
47
  "control" : white,
42
48
  "control-hover" : white,
43
- "control-active" : white,
49
+ "control-active" : white,
44
50
  "control-border" : purple,
45
- "control-border-hover" : blue,
46
- "control-border-active" : orange,
51
+ "control-border-hover" : blue,
52
+ "control-border-active" : orange,
47
53
  "control-background" : purple,
48
54
  "control-background-hover": blue,
49
55
  "control-background-active": orange,
@@ -95,8 +101,11 @@ $color-classes: (
95
101
  @function get($name) {
96
102
  // Allow non lookup if the value is already a color (helps with code flow)
97
103
  @if (meta.type-of($name) == "string") {
104
+ $is-keyword: $name == "inherit" or $name == "transparent" or $name == "currentColor";
105
+ $is-cssvar: string.index($name, "var(") == 1;
106
+ $is-color-mix: string.index($name, "color-mix(") == 1;
98
107
  // Allow custom-properties and keyword inherit/transparent to pass through
99
- @if ($name == "inherit" or $name == "transparent" or $name == "currentColor" or string.index($name, "var(") == 1) {
108
+ @if ($is-keyword or $is-cssvar or $is-color-mix) {
100
109
  @return $name;
101
110
  // Else look up the color from the palette
102
111
  } @else {
@@ -172,7 +181,7 @@ $color-classes: (
172
181
  color: get-context-value($name, "color");
173
182
  }
174
183
 
175
- /// Lighten a color using the default white by a percentage
184
+ /// Tint (add white) a color using the default white by a percentage
176
185
  /// @param {Color, String} $color Color/palette color name to apply to tint
177
186
  /// @param {Number} $percentage Percentage
178
187
  /// @return {Color}
@@ -183,7 +192,18 @@ $color-classes: (
183
192
  @return color.mix(get("white"), get($color), $percentage);
184
193
  }
185
194
 
186
- /// Darken a color with the default black by a percentage
195
+ /// Tint (add white) a color using the default white by a percentage (Using color-mix)
196
+ /// - This only works in modern browsers (as of June 2025)
197
+ /// - These match ulu.color-tint() and are designed to accept the same arguments with the same results
198
+ /// @param {Color, String} $color Color or custom property to apply mix to
199
+ /// @param {Number} $percentage Percentage
200
+ /// @return {Color}
201
+
202
+ @function css-tint($color, $percentage) {
203
+ @return color-mix(in srgb, get("white") $percentage, get($color) calc(100% - $percentage));
204
+ }
205
+
206
+ /// Shade (add black) a color with the default black by a percentage
187
207
  /// @param {Color, String} $color Color/palette color name to shade
188
208
  /// @param {Number} $percentage Percentage to shade
189
209
  /// @return {Color}
@@ -194,6 +214,17 @@ $color-classes: (
194
214
  @return color.mix(get("black"), get($color), $percentage);
195
215
  }
196
216
 
217
+ /// Shade (add black) a color using the default white by a percentage (Using color-mix)
218
+ /// - This only works in modern browsers (as of June 2025)
219
+ /// - These match ulu.color-shade() and are designed to accept the same arguments with the same results
220
+ /// @param {Color, String} $color Color or custom property to apply mix to
221
+ /// @param {Number} $percentage Percentage
222
+ /// @return {Color}
223
+
224
+ @function css-shade($color, $percentage) {
225
+ @return color-mix(in srgb, get("black") $percentage, get($color) calc(100% - $percentage));
226
+ }
227
+
197
228
  /// Prints all context styles
198
229
  /// @param {String} $with-prop Checks the specific context for a certain prop (has to be truthy)(used for output in helper/base color modules)
199
230
  /// @example scss
@@ -69,6 +69,8 @@ $config: (
69
69
  "ul-list-style-type": disc,
70
70
  "ul-list-style-type-2": circle,
71
71
  "ul-list-style-type-3": square,
72
+ "cap-color" : "accent",
73
+ "cap-size" : 5px
72
74
  ) !default;
73
75
 
74
76
  /// Rule style map, redefine defaults or add to
@@ -114,9 +116,10 @@ $rule-margins: (
114
116
 
115
117
  /// Sets rule margins
116
118
  /// @param {Map} $changes Map of changes
119
+ /// @param {String} $merge-mode Merge mode see utils.map-merge() [null|"deep"|"overwrite"]
117
120
 
118
- @mixin set-rule-margins($changes) {
119
- $rule-margins: map.merge($rule-margins, $changes) !global;
121
+ @mixin set-rule-margins($changes, $merge-mode: null) {
122
+ $rule-margins: utils.map-merge($rule-margins, $changes, $merge-mode) !global;
120
123
  }
121
124
 
122
125
  /// Get a rule style
@@ -290,4 +293,107 @@ $rule-margins: (
290
293
  white-space: normal;
291
294
  width: auto;
292
295
  }
296
+ }
297
+
298
+
299
+ /// Layout utility to add a colored bar (cap) to an element's edge, positioned over the element and its border
300
+ /// - You need to set position (relative, fixed) on parent
301
+ /// @param {String} $side The side to place the cap (top, bottom, left, right)
302
+ /// @param {Map} $options Options for the appearance of the cap
303
+ /// @param {Color} $options.color [$config.cap-color] The color for the end cap
304
+ /// @param {Number} $options.size [$config.cap-size] The width/height of the cap
305
+ /// @param {Number} $options.offset [0] A positive number of the amount the cap should extend outside the box (to account for border-width)
306
+ /// @param {Number} $options.border-radius [null] An optional border-radius to apply to the outward-facing edges of the cap (used to match parent)
307
+ /// @param {Boolean} $before [true] Whether or not to use the ::before element (if not uses :after)
308
+
309
+ @mixin cap(
310
+ $side,
311
+ $options: (),
312
+ $before: true,
313
+ ) {
314
+ $defaults: (
315
+ "color" : get("cap-color"),
316
+ "size" : get("cap-size"),
317
+ "offset" : 0,
318
+ "color-hover" : null,
319
+ "border-radius" : null,
320
+ "padding-adjust" : null,
321
+ );
322
+ $config: map.merge($defaults, $options);
323
+ $element: if($before, "::before", "::after");
324
+
325
+ &#{ $element } {
326
+ content: "";
327
+ position: absolute;
328
+ display: block;
329
+ }
330
+
331
+ @include cap-appearance($side, $config, $before);
332
+ }
333
+
334
+
335
+
336
+ /// Provides the appearance styles for a given cap
337
+ /// - If an option is not provided it won't be output
338
+ /// - This is used to update the caps styling (states, modifiers, etc)
339
+ /// @param {String} $side The side to place the cap (top, bottom, left, right)
340
+ /// @param {Map} $options Options for the appearance of the cap (see options from element.cap)
341
+ /// @param {Boolean} $before Whether or not to use the ::before element (if not uses :after)
342
+
343
+ @mixin cap-appearance(
344
+ $side,
345
+ $options: (),
346
+ $before: true
347
+ ) {
348
+ $element: if($before, "::before", "::after");
349
+ $size: map.get($options, "size");
350
+ $offset: map.get($options, "offset");
351
+ $border-radius: map.get($options, "border-radius");
352
+ $padding-adjust: map.get($options, "padding-adjust");
353
+
354
+ $end: $side == "top" or $side == "bottom";
355
+ $position: if($offset, 0 - $offset, null);
356
+
357
+ @if ($padding-adjust and $size) {
358
+ padding-#{ $side }: calc($padding-adjust + $size);
359
+ }
360
+
361
+ &#{ $element } {
362
+ background-color: color.get(map.get($options, "color"));
363
+ #{ $side }: $position;
364
+
365
+ @if $end {
366
+ left: $position;
367
+ right: $position;
368
+ height: $size;
369
+ } @else {
370
+ top: $position;
371
+ bottom: $position;
372
+ width: $size;
373
+ }
374
+
375
+ @if $border-radius {
376
+ @if $end {
377
+ border-#{ $side }-left-radius: $border-radius;
378
+ border-#{ $side }-right-radius: $border-radius;
379
+ } @else {
380
+ border-top-#{ $side }-radius: $border-radius;
381
+ border-bottom-#{ $side }-radius: $border-radius;
382
+ }
383
+ }
384
+ }
385
+ }
386
+
387
+ /// Add backdrop-filter blur
388
+ /// @param {CssUnit} $amount [get("backdrop-blur")] Amount to blur
389
+ ///
390
+ @mixin backdrop-filter-blur($amount: get("backdrop-blur")) {
391
+ backdrop-filter: blur($amount);
392
+ }
393
+
394
+ /// Accessibly hide focus ring while keeping it when it's required
395
+ @mixin focus-ring-required-only() {
396
+ &:focus:not(:focus-visible) {
397
+ outline: none;
398
+ }
293
399
  }
package/scss/_layout.scss CHANGED
@@ -7,6 +7,7 @@
7
7
  @use "sass:meta";
8
8
  @use "utils";
9
9
  @use "breakpoint";
10
+ @use "color";
10
11
 
11
12
  /// Module Settings
12
13
  /// @type Map
@@ -215,10 +216,7 @@ $containers: (
215
216
  $breakpoints: map.get($container, "breakpoints");
216
217
 
217
218
  $width: map.get($container, "width");
218
- // @debug $specific-breakpoint;
219
- // @if $specific-breakpoint {
220
- // @debug $container;
221
- // }
219
+
222
220
  @if ($width == null) {
223
221
  $width: 100%;
224
222
  }
@@ -243,14 +241,14 @@ $containers: (
243
241
  /// Prints clearfix styles
244
242
 
245
243
  @mixin clearfix() {
246
- &:before,
247
- &:after {
244
+ &::before,
245
+ &::after {
248
246
  content: "";
249
247
  display: table;
250
248
  flex-basis: 0; // Flexbox, clear fix for pseudo elements in Safari
251
249
  order: 1;
252
250
  }
253
- &:after {
251
+ &::after {
254
252
  clear: both;
255
253
  }
256
254
  }
@@ -267,6 +265,7 @@ $containers: (
267
265
  /// Layout utility for absolute (zero on all sides)
268
266
  /// - Probably helpful for gzip if we use this when these exact styles are needed
269
267
  /// so they are identical for compression
268
+ /// @param {Boolean} $set-size [false] Whether or not to use sizes to fill the space (height/width 100%) versus setting bottom and right to 0)
270
269
  @mixin absolute-fill($set-size: false) {
271
270
  position: absolute;
272
271
  top: 0;
@@ -278,4 +277,4 @@ $containers: (
278
277
  width: 100%;
279
278
  height: 100%;
280
279
  }
281
- }
280
+ }
package/scss/_units.scss CHANGED
@@ -27,13 +27,14 @@ $config: (
27
27
 
28
28
  /// Update the units config
29
29
  /// @param {Map} $changes A map to merge into the color palette
30
+ /// @param {String} $merge-mode Merge mode see utils.map-merge() [null|"deep"|"overwrite"]
30
31
  /// @example scss Setting the error and type color
31
32
  /// @include ulu.units-set((
32
33
  /// "default" : 1.5em
33
34
  /// ));
34
35
 
35
- @mixin set($changes) {
36
- $config: map.merge($config, $changes) !global;
36
+ @mixin set($changes, $merge-mode: null) {
37
+ $config: utils.map-merge($config, $changes, $merge-mode) !global;
37
38
  }
38
39
 
39
40
  /// Get a unit by name (preset) or number (multiplier of base)