@ulu/frontend 0.1.0-beta.2 → 0.1.0-beta.21

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 (225) hide show
  1. package/CHANGELOG.md +139 -0
  2. package/dist/ulu-frontend.min.css +1 -1
  3. package/dist/ulu-frontend.min.js +18 -18
  4. package/docs-dev/changelog/index.html +5399 -0
  5. package/docs-dev/changelog/updates-and-changes/index.html +5109 -0
  6. package/docs-dev/demos/accordion/index.html +636 -293
  7. package/docs-dev/demos/basic-hero/index.html +111 -0
  8. package/docs-dev/demos/button/index.html +636 -293
  9. package/docs-dev/demos/callout/index.html +661 -305
  10. package/docs-dev/demos/captioned-figure/index.html +636 -293
  11. package/docs-dev/demos/card/index.html +636 -293
  12. package/docs-dev/demos/css-icons/index.html +636 -293
  13. package/docs-dev/demos/data-grid/index.html +744 -481
  14. package/docs-dev/demos/data-table/index.html +661 -318
  15. package/docs-dev/demos/details-group/index.html +4994 -0
  16. package/docs-dev/demos/file-save/index.html +636 -293
  17. package/docs-dev/demos/flipcard/index.html +636 -293
  18. package/docs-dev/demos/form-theme/index.html +654 -324
  19. package/docs-dev/demos/hero/index.html +12 -4
  20. package/docs-dev/demos/image-grid/index.html +12 -4
  21. package/docs-dev/demos/index.html +636 -293
  22. package/docs-dev/demos/list-inline/index.html +4980 -0
  23. package/docs-dev/demos/list-inline.1/index.html +4727 -0
  24. package/docs-dev/demos/list-lines/index.html +4970 -0
  25. package/docs-dev/demos/menu-stack/index.html +655 -312
  26. package/docs-dev/demos/modals/index.html +636 -293
  27. package/docs-dev/demos/nav-strip/index.html +656 -349
  28. package/docs-dev/demos/overlay-section/index.html +636 -293
  29. package/docs-dev/demos/popovers/index.html +636 -293
  30. package/docs-dev/demos/print/index.html +636 -293
  31. package/docs-dev/demos/pull-quote/index.html +636 -293
  32. package/docs-dev/demos/rule/index.html +636 -293
  33. package/docs-dev/demos/scroll-slider/index.html +12 -4
  34. package/docs-dev/demos/scrollpoints/index.html +636 -293
  35. package/docs-dev/demos/slider/index.html +12 -4
  36. package/docs-dev/demos/spoke-spinner/index.html +636 -293
  37. package/docs-dev/demos/tabs/index.html +648 -293
  38. package/docs-dev/demos/tag/index.html +636 -293
  39. package/docs-dev/demos/theme-toggle/index.html +5039 -0
  40. package/docs-dev/demos/tile-grid-overlay/index.html +12 -4
  41. package/docs-dev/demos/tiles/index.html +636 -293
  42. package/docs-dev/demos/tooltip/index.html +636 -293
  43. package/docs-dev/guide/building-stylesheet/index.html +636 -293
  44. package/docs-dev/guide/developing-ulu-scss-module/index.html +636 -293
  45. package/docs-dev/guide/index.html +637 -294
  46. package/docs-dev/guide/updates-and-changes/index.html +5033 -0
  47. package/docs-dev/index.html +641 -293
  48. package/docs-dev/javascript/events/index.html +633 -292
  49. package/docs-dev/javascript/index.html +636 -293
  50. package/docs-dev/javascript/settings/index.html +5094 -0
  51. package/docs-dev/javascript/ui-breakpoints/index.html +633 -292
  52. package/docs-dev/javascript/ui-collapsible/index.html +633 -292
  53. package/docs-dev/javascript/ui-details-group/index.html +5094 -0
  54. package/docs-dev/javascript/ui-dialog/index.html +633 -292
  55. package/docs-dev/javascript/ui-flipcard/index.html +633 -292
  56. package/docs-dev/javascript/ui-grid/index.html +633 -292
  57. package/docs-dev/javascript/ui-modal-builder/index.html +633 -292
  58. package/docs-dev/javascript/ui-overflow-scroller/index.html +633 -292
  59. package/docs-dev/javascript/ui-overflow-scroller-pager/index.html +633 -292
  60. package/docs-dev/javascript/ui-page/index.html +633 -292
  61. package/docs-dev/javascript/ui-popover/index.html +633 -292
  62. package/docs-dev/javascript/ui-print/index.html +633 -292
  63. package/docs-dev/javascript/ui-print-details/index.html +633 -292
  64. package/docs-dev/javascript/ui-programmatic-modal/index.html +633 -292
  65. package/docs-dev/javascript/ui-proxy-click/index.html +633 -292
  66. package/docs-dev/javascript/ui-resizer/index.html +633 -292
  67. package/docs-dev/javascript/ui-scroll-slider/index.html +633 -292
  68. package/docs-dev/javascript/ui-scrollpoint/index.html +633 -292
  69. package/docs-dev/javascript/ui-slider/index.html +633 -292
  70. package/docs-dev/javascript/ui-tabs/index.html +633 -292
  71. package/docs-dev/javascript/ui-theme-toggle/index.html +5178 -0
  72. package/docs-dev/javascript/ui-tooltip/index.html +633 -292
  73. package/docs-dev/javascript/utils-class-logger/index.html +633 -292
  74. package/docs-dev/javascript/utils-dom/index.html +697 -296
  75. package/docs-dev/javascript/utils-file-save/index.html +633 -292
  76. package/docs-dev/javascript/utils-floating-ui/index.html +633 -292
  77. package/docs-dev/javascript/utils-id/index.html +633 -292
  78. package/docs-dev/javascript/utils-pause-youtube-video/index.html +633 -292
  79. package/docs-dev/sass/base/color/index.html +633 -292
  80. package/docs-dev/sass/base/elements/index.html +633 -292
  81. package/docs-dev/sass/base/index/index.html +633 -292
  82. package/docs-dev/sass/base/index.html +636 -293
  83. package/docs-dev/sass/base/keyframes/index.html +633 -292
  84. package/docs-dev/sass/base/layout/index.html +633 -292
  85. package/docs-dev/sass/base/normalize/index.html +633 -292
  86. package/docs-dev/sass/base/print/index.html +633 -292
  87. package/docs-dev/sass/base/root/index.html +633 -292
  88. package/docs-dev/sass/base/typography/index.html +633 -292
  89. package/docs-dev/sass/components/accordion/index.html +638 -297
  90. package/docs-dev/sass/components/adaptive-spacing/index.html +633 -292
  91. package/docs-dev/sass/components/badge/index.html +641 -300
  92. package/docs-dev/sass/components/basic-hero/index.html +5145 -0
  93. package/docs-dev/sass/components/button/index.html +633 -292
  94. package/docs-dev/sass/components/button-verbose/index.html +634 -293
  95. package/docs-dev/sass/components/callout/index.html +658 -353
  96. package/docs-dev/sass/components/captioned-figure/index.html +756 -300
  97. package/docs-dev/sass/components/card/index.html +665 -309
  98. package/docs-dev/sass/components/card-grid/index.html +633 -292
  99. package/docs-dev/sass/components/css-icon/index.html +650 -302
  100. package/docs-dev/sass/components/data-grid/index.html +633 -292
  101. package/docs-dev/sass/components/data-table/index.html +829 -303
  102. package/docs-dev/sass/components/fill-context/index.html +633 -292
  103. package/docs-dev/sass/components/flipcard/index.html +641 -300
  104. package/docs-dev/sass/components/flipcard-grid/index.html +633 -292
  105. package/docs-dev/sass/components/form-theme/index.html +761 -319
  106. package/docs-dev/sass/components/hero/index.html +689 -300
  107. package/docs-dev/sass/components/horizontal-rule/index.html +633 -292
  108. package/docs-dev/sass/components/image-grid/index.html +633 -292
  109. package/docs-dev/sass/components/index/index.html +645 -302
  110. package/docs-dev/sass/components/index.html +636 -293
  111. package/docs-dev/sass/components/links/index.html +633 -292
  112. package/docs-dev/sass/components/list-inline/index.html +5159 -0
  113. package/docs-dev/sass/components/list-lines/index.html +665 -328
  114. package/docs-dev/sass/components/list-ordered/index.html +635 -294
  115. package/docs-dev/sass/components/list-unordered/index.html +633 -292
  116. package/docs-dev/sass/components/menu-stack/index.html +667 -313
  117. package/docs-dev/sass/components/modal/index.html +654 -306
  118. package/docs-dev/sass/components/nav-strip/index.html +645 -304
  119. package/docs-dev/sass/components/overlay-section/index.html +641 -300
  120. package/docs-dev/sass/components/pager/index.html +633 -292
  121. package/docs-dev/sass/components/placeholder-block/index.html +633 -292
  122. package/docs-dev/sass/components/popover/index.html +663 -292
  123. package/docs-dev/sass/components/pull-quote/index.html +645 -304
  124. package/docs-dev/sass/components/ratio-box/index.html +633 -292
  125. package/docs-dev/sass/components/rule/index.html +641 -300
  126. package/docs-dev/sass/components/scroll-slider/index.html +633 -292
  127. package/docs-dev/sass/components/skip-link/index.html +641 -300
  128. package/docs-dev/sass/components/slider/index.html +640 -299
  129. package/docs-dev/sass/components/spoke-spinner/index.html +633 -292
  130. package/docs-dev/sass/components/tabs/index.html +649 -301
  131. package/docs-dev/sass/components/tag/index.html +633 -292
  132. package/docs-dev/sass/components/tile-button/index.html +633 -292
  133. package/docs-dev/sass/components/tile-grid/index.html +633 -292
  134. package/docs-dev/sass/components/tile-grid-overlay/index.html +633 -292
  135. package/docs-dev/sass/components/vignette/index.html +647 -300
  136. package/docs-dev/sass/components/wysiwyg/index.html +633 -292
  137. package/docs-dev/sass/core/breakpoint/index.html +633 -292
  138. package/docs-dev/sass/core/button/index.html +633 -292
  139. package/docs-dev/sass/core/color/index.html +671 -323
  140. package/docs-dev/sass/core/cssvar/index.html +633 -292
  141. package/docs-dev/sass/core/element/index.html +633 -292
  142. package/docs-dev/sass/core/index.html +633 -292
  143. package/docs-dev/sass/core/layout/index.html +633 -292
  144. package/docs-dev/sass/core/path/index.html +633 -292
  145. package/docs-dev/sass/core/selector/index.html +633 -292
  146. package/docs-dev/sass/core/typography/index.html +633 -292
  147. package/docs-dev/sass/core/units/index.html +633 -292
  148. package/docs-dev/sass/core/utils/index.html +633 -292
  149. package/docs-dev/sass/helpers/color/index.html +633 -292
  150. package/docs-dev/sass/helpers/display/index.html +633 -292
  151. package/docs-dev/sass/helpers/index/index.html +633 -292
  152. package/docs-dev/sass/helpers/index.html +636 -293
  153. package/docs-dev/sass/helpers/print/index.html +633 -292
  154. package/docs-dev/sass/helpers/typography/index.html +633 -292
  155. package/docs-dev/sass/helpers/units/index.html +633 -292
  156. package/docs-dev/sass/helpers/utilities/index.html +633 -292
  157. package/docs-dev/sass/index.html +636 -293
  158. package/js/index.js +1 -0
  159. package/js/settings.js +78 -0
  160. package/js/ui/details-group.js +121 -0
  161. package/js/ui/index.js +1 -0
  162. package/js/ui/modal-builder.js +3 -2
  163. package/js/ui/overflow-scroller.js +5 -4
  164. package/js/ui/programmatic-modal.js +9 -3
  165. package/js/ui/slider.js +7 -6
  166. package/js/ui/theme-toggle.js +330 -89
  167. package/js/utils/dom.js +43 -1
  168. package/js/utils/font-awesome.js +18 -0
  169. package/js/utils/index.js +2 -1
  170. package/package.json +3 -2
  171. package/scss/_color.scss +9 -2
  172. package/scss/components/README.todos +14 -0
  173. package/scss/components/_accordion.scss +13 -13
  174. package/scss/components/_badge.scss +3 -2
  175. package/scss/components/_basic-hero.scss +112 -0
  176. package/scss/components/_button-verbose.scss +3 -2
  177. package/scss/components/_callout.scss +43 -54
  178. package/scss/components/_captioned-figure.scss +23 -5
  179. package/scss/components/_card-grid.scss +1 -1
  180. package/scss/components/_card.scss +52 -37
  181. package/scss/components/_css-icon.scss +16 -11
  182. package/scss/components/_data-table.scss +41 -4
  183. package/scss/components/_flipcard.scss +13 -12
  184. package/scss/components/_form-theme.scss +47 -47
  185. package/scss/components/_hero.scss +9 -0
  186. package/scss/components/_index.scss +12 -0
  187. package/scss/components/_list-inline.scss +80 -0
  188. package/scss/components/_list-lines.scss +44 -33
  189. package/scss/components/_list-ordered.scss +0 -1
  190. package/scss/components/_menu-stack.scss +42 -26
  191. package/scss/components/_modal.scss +23 -19
  192. package/scss/components/_nav-strip.scss +25 -16
  193. package/scss/components/_overlay-section.scss +2 -1
  194. package/scss/components/_pager.scss +6 -6
  195. package/scss/components/_placeholder-block.scss +4 -4
  196. package/scss/components/_popover.scss +38 -38
  197. package/scss/components/_pull-quote.scss +12 -12
  198. package/scss/components/_rule.scss +0 -1
  199. package/scss/components/_scroll-slider.scss +1 -1
  200. package/scss/components/_skip-link.scss +2 -1
  201. package/scss/components/_slider.scss +17 -38
  202. package/scss/components/_tabs.scss +45 -53
  203. package/scss/components/_tag.scss +1 -1
  204. package/scss/components/_vignette.scss +1 -0
  205. package/types/index.d.ts +1 -0
  206. package/types/settings.d.ts +38 -0
  207. package/types/settings.d.ts.map +1 -0
  208. package/types/ui/details-group.d.ts +43 -0
  209. package/types/ui/details-group.d.ts.map +1 -0
  210. package/types/ui/index.d.ts +1 -0
  211. package/types/ui/modal-builder.d.ts +2 -2
  212. package/types/ui/modal-builder.d.ts.map +1 -1
  213. package/types/ui/overflow-scroller.d.ts +2 -2
  214. package/types/ui/overflow-scroller.d.ts.map +1 -1
  215. package/types/ui/programmatic-modal.d.ts.map +1 -1
  216. package/types/ui/slider.d.ts +2 -2
  217. package/types/ui/slider.d.ts.map +1 -1
  218. package/types/ui/tabs.d.ts.map +1 -1
  219. package/types/ui/theme-toggle.d.ts +58 -7
  220. package/types/ui/theme-toggle.d.ts.map +1 -1
  221. package/types/utils/dom.d.ts +19 -1
  222. package/types/utils/dom.d.ts.map +1 -1
  223. package/types/utils/font-awesome.d.ts +5 -0
  224. package/types/utils/font-awesome.d.ts.map +1 -0
  225. package/types/utils/index.d.ts +1 -0
package/js/index.js CHANGED
@@ -5,6 +5,7 @@
5
5
  // - Will not include things that aren't used in every site (those would need to
6
6
  // imported manually
7
7
 
8
+ export * as settings from "./settings.js";
8
9
  export * as events from "./events/index.js";
9
10
  export * as ui from "./ui/index.js";
10
11
  export * as utils from "./utils/index.js";
package/js/settings.js ADDED
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @module settings
3
+ * @description Manages shared configuration for the library.
4
+ */
5
+
6
+ // Default configuration settings
7
+ const defaults = {
8
+ iconClassClose: "css-icon css-icon--close",
9
+ iconClassDragX: "css-icon css-icon--drag-x",
10
+ iconClassPrevious: "css-icon css-icon--angle-left",
11
+ iconClassNext: "css-icon css-icon--angle-right"
12
+ };
13
+
14
+ // Current configuration, initialized with defaults
15
+ let currentSettings = { ...defaults };
16
+
17
+ /**
18
+ * Retrieves a copy of the default settings.
19
+ * @returns {object} A copy of the default settings object.
20
+ */
21
+ export function getDefaultSettings() {
22
+ return { ...defaults };
23
+ }
24
+
25
+ /**
26
+ * Updates multiple configuration settings.
27
+ * @param {object} changes An object containing the settings to update.
28
+ */
29
+ export function updateSettings(changes) {
30
+ Object.assign(currentSettings, changes);
31
+ }
32
+
33
+ /**
34
+ * Retrieves a copy of the current configuration settings.
35
+ * @returns {object} A copy of the current settings object.
36
+ */
37
+ export function getSettings() {
38
+ return { ...currentSettings };
39
+ }
40
+
41
+ /**
42
+ * Retrieves a specific configuration setting by key.
43
+ * @param {string} key The key of the setting to retrieve.
44
+ * @returns {*} The value of the setting, or undefined if not found.
45
+ */
46
+ export function getSetting(key) {
47
+ if (!currentSettings.hasOwnProperty(key)) {
48
+ console.warn(`Attempted to access non-existent setting: ${key}`);
49
+ return undefined;
50
+ }
51
+ return currentSettings[key];
52
+ }
53
+
54
+ /**
55
+ * Updates a specific configuration setting.
56
+ * @param {string} key The key of the setting to update.
57
+ * @param {*} value The new value for the setting.
58
+ */
59
+ export function updateSetting(key, value) {
60
+ currentSettings[key] = value;
61
+ }
62
+
63
+ /**
64
+ * Creates a wrapped string representation of a configuration setting.
65
+ * This function returns an object with a `toString()` method that, when called,
66
+ * retrieves the current value of the specified setting. This allows the setting
67
+ * to be used as a string literal, dynamically retrieving its value.
68
+ *
69
+ * @param {string} key The key of the setting to wrap.
70
+ * @returns {object} An object with a `toString()` method that returns the setting value.
71
+ */
72
+ export function wrapSettingString(key) {
73
+ return {
74
+ toString() {
75
+ return getSetting(key);
76
+ }
77
+ };
78
+ }
@@ -0,0 +1,121 @@
1
+ /**
2
+ * @module ui/details-group
3
+ * @description Manages groups of details (ie. onlyOneOpen at a time)
4
+ */
5
+
6
+ import { getName } from "../events/index.js";
7
+ import { getDatasetOptionalJson } from "../utils/dom.js";
8
+
9
+ export const attrs = {
10
+ init: "data-ulu-details-group-init",
11
+ childInit: "data-ulu-details-group-child-init",
12
+ group: "data-ulu-details-group",
13
+ };
14
+
15
+ // Utils for selecting things based on attributes
16
+ const attrSelector = key => `[${ attrs[key] }]`;
17
+ const attrSelectorInitial = key => `${ attrSelector(key) }:not([${ attrs.init }])`;
18
+
19
+ const defaults = {
20
+ onlyOneOpen: true,
21
+ childSelector: ":scope > details"
22
+ };
23
+
24
+ /**
25
+ * Initialize everything in document
26
+ * - This will only initialize elements once, it is safe to call on page changes
27
+ */
28
+ export function init() {
29
+ document.addEventListener(getName("pageModified"), () => setup());
30
+ setup();
31
+ }
32
+
33
+ /**
34
+ * Setup all dialog groups within context
35
+ * @param {HTMLElement} context [document] Element to query within
36
+ * @returns {Array} Array matching the groups queried with their return objects from setupGroup() [used for destroy/etc]
37
+ */
38
+ export function setup(context = document) {
39
+ // Added try because we are using querySelectorAll with :scope by default
40
+ // which will not work in Internet Explorer or early edge (some alt. browsers too)
41
+ try {
42
+ const elements = context.querySelectorAll(attrSelectorInitial("group"));
43
+ return [...elements].map(setupGroup);
44
+ } catch(error) {
45
+ console.error(error);
46
+ }
47
+ }
48
+
49
+ /**
50
+ * @typedef {Object} DetailsGroupInstance
51
+ * @property {Function} destroy A function to remove event listeners and attributes.
52
+ * @property {HTMLElement} element The parent element.
53
+ * @property {Function} setupChildren A function to initialize the child details elements.
54
+ */
55
+
56
+ /**
57
+ * Sets up a single group of details elements to manage their behavior.
58
+ * @param {HTMLElement} element - The parent element containing the details elements.
59
+ * @returns {DetailsGroupInstance}
60
+ */
61
+ export function setupGroup(element) {
62
+ const elementOptions = getDatasetOptionalJson(element, "uluDetailsGroup");
63
+ const options = Object.assign({}, defaults, elementOptions);
64
+
65
+ element.setAttribute(attrs.t, "");
66
+ setupChildren();
67
+
68
+ /**
69
+ * Queries all current children in element
70
+ * @ignore
71
+ */
72
+ function queryChildren() {
73
+ return element.querySelectorAll(options.childSelector);
74
+ }
75
+
76
+ /**
77
+ * Sets up any children not already setup in group
78
+ */
79
+ function setupChildren() {
80
+ queryChildren().forEach(child => {
81
+ if (child.hasAttribute(attrs.childInit)) {
82
+ return;
83
+ } else {
84
+ child.setAttribute(attrs.childInit, "");
85
+ }
86
+ console.log(child);
87
+
88
+ child.addEventListener("toggle", toggleHandler);
89
+ });
90
+ }
91
+
92
+ /**
93
+ * Toggle handler for child details element
94
+ * - For things like one open at a time
95
+ * @ignore
96
+ */
97
+ function toggleHandler({ target }) {
98
+ if (options.onlyOneOpen) {
99
+ if (target.open) {
100
+ queryChildren().forEach(child => {
101
+ if (child !== target && child.open) {
102
+ child.open = false;
103
+ }
104
+ });
105
+ }
106
+ }
107
+ }
108
+
109
+ /**
110
+ * Function removes all handlers and init attributes
111
+ */
112
+ function destroy() {
113
+ queryChildren().forEach(child => {
114
+ child.removeEventListener("toggle", toggleHandler);
115
+ child.removeAttribute(attrs.childInit);
116
+ });
117
+ element.removeAttribute(attrs.init);
118
+ }
119
+
120
+ return { destroy, element, setupChildren };
121
+ }
package/js/ui/index.js CHANGED
@@ -19,3 +19,4 @@ export * as print from "./print.js";
19
19
  export * as printDetails from "./print-details.js";
20
20
  export * as scrollSlider from "./scroll-slider.js";
21
21
  export * as themeToggle from "./theme-toggle.js";
22
+ export * as detailsGroup from "./details-group.js";
@@ -4,6 +4,7 @@
4
4
 
5
5
  // Note this needs to be run before dialogs are initialized!
6
6
 
7
+ import { wrapSettingString } from "../settings.js";
7
8
  import { getName } from "../events/index.js";
8
9
  import { createElementFromHtml } from "@ulu/utils/browser/dom.js";
9
10
  import { Resizer } from "./resizer.js";
@@ -37,8 +38,8 @@ export const defaults = {
37
38
  print: false,
38
39
  noMinHeight: false,
39
40
  class: "",
40
- classCloseIcon: "css-icon css-icon--close",
41
- classResizerIcon: "css-icon css-icon--drag",
41
+ classCloseIcon: wrapSettingString("iconClassClose"),
42
+ classResizerIcon: wrapSettingString("iconClassDragX"),
42
43
  debug: false,
43
44
  templateCloseIcon(config) {
44
45
  return `<span class="modal__close-icon ${ config.classCloseIcon }" aria-hidden="true"></span>`;
@@ -10,6 +10,7 @@
10
10
  * @todo - Document that user could use something like [https://github.com/LachlanArthur/scroll-snap-api/tree/master/src] to have it go between items
11
11
  *
12
12
  */
13
+ import { wrapSettingString } from "../settings.js";
13
14
  import { hasRequiredProps } from '@ulu/utils/object.js';
14
15
  import { logError } from "../utils/class-logger.js";
15
16
  const requiredElements = [
@@ -26,8 +27,8 @@ export class OverflowScroller {
26
27
  offsetEnd: 100,
27
28
  amount: "auto",
28
29
  buttonClasses: ["button", "button--icon"],
29
- iconClassesPrevious: ["css-icon", "css-icon--angle-left"],
30
- iconClassesNext: ["css-icon", "css-icon--angle-right"]
30
+ iconClassPrevious: wrapSettingString("iconClassPrevious"),
31
+ iconClassNext: wrapSettingString("iconClassNext"),
31
32
  }
32
33
  constructor(elements, config) {
33
34
  this.options = Object.assign({}, OverflowScroller.defaults, config);
@@ -87,10 +88,10 @@ export class OverflowScroller {
87
88
  return button;
88
89
  }
89
90
  getControlContent(action) {
90
- const classes = this.options[action === "next" ? "iconClassesNext" : "iconClassesPrevious"];
91
+ const classes = this.options[action === "next" ? "iconClassNext" : "iconClassPrevious"];
91
92
  return `
92
93
  <span class="hidden-visually">${ action }</span>
93
- <span class="${ classes.join(' ') }" aria-hidden="true"></span>
94
+ <span class="${ classes }" aria-hidden="true"></span>
94
95
  `;
95
96
  }
96
97
  onScroll(event) {
@@ -5,6 +5,7 @@
5
5
 
6
6
  import { getName, dispatch } from "../events/index.js";
7
7
  import { newId } from "../utils/id.js";
8
+ import { getElement } from "../utils/dom.js";
8
9
  import { buildModal } from "./modal-builder.js";
9
10
 
10
11
  export class ProgrammaticModalManager {
@@ -43,12 +44,17 @@ export class ProgrammaticModalManager {
43
44
  });
44
45
  }
45
46
  createAndOpen(config, afterCreate) {
46
- const { selector, noClickTrigger, removeOnClose } = config;
47
- const content = document.querySelector(selector);
47
+ const { noClickTrigger, removeOnClose, element, classes } = config;
48
+ const content = getElement(element);
48
49
  if (!content.id) {
49
50
  content.id = newId();
50
51
  }
51
52
 
53
+ // Added to match original jquery module api
54
+ if (classes) {
55
+ content.classList.add(...classes);
56
+ }
57
+
52
58
  let trigger;
53
59
  if (!noClickTrigger) {
54
60
  trigger = this.cachedTrigger;
@@ -57,7 +63,7 @@ export class ProgrammaticModalManager {
57
63
  }
58
64
 
59
65
  if (!content) {
60
- console.error("No element found from config.selector. ", config);
66
+ console.error("No element found from config.element. ", config);
61
67
  return;
62
68
  }
63
69
  const { modal } = buildModal(content, config.modal);
package/js/ui/slider.js CHANGED
@@ -27,6 +27,7 @@
27
27
  // https://dev.opera.com/articles/css-will-change-property/
28
28
  // * Will Change use
29
29
 
30
+ import { wrapSettingString } from "../settings.js";
30
31
  import maintain from 'ally.js/maintain/_maintain';
31
32
  import { hasRequiredProps } from '@ulu/utils/object.js';
32
33
  import { trimWhitespace } from "@ulu/utils/string.js";
@@ -120,9 +121,9 @@ export class Slider {
120
121
  transitionDuration: 700,
121
122
  transitionDurationExit: 400,
122
123
  transitionTimingFunction: "ease-in-out",
123
- buttonClasses: ["Slider__control-icon", "button", "button--icon"],
124
- iconClassesPrevious: ["css-icon", "css-icon--angle-left"],
125
- iconClassesNext: ["css-icon", "css-icon--angle-right"]
124
+ buttonClasses: ["button", "button--icon"],
125
+ iconClassPrevious: wrapSettingString("iconClassPrevious"),
126
+ iconClassNext: wrapSettingString("iconClassNext"),
126
127
  // transition: true
127
128
  }
128
129
  // constructor(container, title, trackContainer, track, slides, config, debug = false) {
@@ -454,6 +455,7 @@ export class Slider {
454
455
  const button = document.createElement("button");
455
456
  button.classList.add(this.getClass("control-button"));
456
457
  button.classList.add(this.getClass(`control-button--${ action }`));
458
+
457
459
  button.classList.add(...this.options.buttonClasses);
458
460
  button.setAttribute("data-slider-control", action);
459
461
  button.setAttribute("type", "button");
@@ -514,12 +516,11 @@ export class Slider {
514
516
  button.addEventListener("click", this.goto.bind(this, index));
515
517
  return button;
516
518
  }
517
- // change to css-icon
518
519
  getControlContent(action) {
519
- const classes = this.options[action === "next" ? "iconClassesNext" : "iconClassesPrevious"];
520
+ const classes = this.options[action === "next" ? "iconClassNext" : "iconClassPrevious"];
520
521
  return `
521
522
  <span class="hidden-visually">${ action }</span>
522
- <span class="${ classes.join(' ') }" aria-hidden="true"></span>
523
+ <span class="${ this.getClass("control-icon") } ${ classes }" aria-hidden="true"></span>
523
524
  `;
524
525
  }
525
526
  getNavContent(number) {