@ulu/frontend 0.1.0-beta.4 → 0.1.0-beta.40
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.
- package/CHANGELOG.md +332 -1
- package/dist/ulu-frontend.min.css +1 -1
- package/dist/ulu-frontend.min.js +28 -27
- package/docs-dev/assets/main.js +832 -421
- package/docs-dev/assets/placeholder/icon-calendar.svg +1 -0
- package/docs-dev/assets/placeholder/icon-check.svg +1 -0
- package/docs-dev/assets/style.css +629 -233
- package/docs-dev/changelog/index.html +6079 -0
- package/docs-dev/changelog/updates-and-changes/index.html +5109 -0
- package/docs-dev/demos/accordion/index.html +904 -321
- package/docs-dev/demos/basic-hero/index.html +111 -0
- package/docs-dev/demos/breakpoints-manager/index.html +5246 -0
- package/docs-dev/demos/button/index.html +916 -323
- package/docs-dev/demos/button-verbose/index.html +5238 -0
- package/docs-dev/demos/callout/index.html +951 -328
- package/docs-dev/demos/captioned-figure/index.html +904 -321
- package/docs-dev/demos/card/index.html +970 -748
- package/docs-dev/demos/card-grid/index.html +5357 -0
- package/docs-dev/demos/card-new/index.html +5088 -0
- package/docs-dev/demos/card-old/index.html +5223 -0
- package/docs-dev/demos/card.1/index.html +5223 -0
- package/docs-dev/demos/card.TRASH/index.html +5541 -0
- package/docs-dev/demos/counter-list/index.html +5224 -0
- package/docs-dev/demos/css-icons/index.html +904 -321
- package/docs-dev/demos/data-grid/index.html +1014 -511
- package/docs-dev/demos/data-table/index.html +1064 -348
- package/docs-dev/demos/details-group/index.html +5267 -0
- package/docs-dev/demos/file-save/index.html +904 -321
- package/docs-dev/demos/flipcard/index.html +904 -321
- package/docs-dev/demos/form-theme/index.html +922 -352
- package/docs-dev/demos/hero/index.html +12 -4
- package/docs-dev/demos/image-grid/index.html +12 -4
- package/docs-dev/demos/index.html +904 -321
- package/docs-dev/demos/list-inline/index.html +5220 -0
- package/docs-dev/demos/list-inline.1/index.html +4727 -0
- package/docs-dev/demos/list-lines/index.html +5210 -0
- package/docs-dev/demos/menu-stack/index.html +975 -377
- package/docs-dev/demos/modals/index.html +1010 -357
- package/docs-dev/demos/nav-strip/index.html +924 -377
- package/docs-dev/demos/overlay-section/index.html +979 -326
- package/docs-dev/demos/popovers/index.html +1152 -327
- package/docs-dev/demos/print/index.html +904 -321
- package/docs-dev/demos/pull-quote/index.html +904 -321
- package/docs-dev/demos/rule/index.html +952 -357
- package/docs-dev/demos/scroll-slider/index.html +72 -106
- package/docs-dev/demos/scrollpoints/index.html +905 -322
- package/docs-dev/demos/slider/index.html +12 -4
- package/docs-dev/demos/spoke-spinner/index.html +904 -321
- package/docs-dev/demos/sticky-list/index.html +5223 -0
- package/docs-dev/demos/tabs/index.html +944 -325
- package/docs-dev/demos/tag/index.html +904 -321
- package/docs-dev/demos/theme-toggle/index.html +5279 -0
- package/docs-dev/demos/tile-grid-overlay/index.html +12 -4
- package/docs-dev/demos/tiles/index.html +904 -321
- package/docs-dev/demos/tooltip/index.html +904 -321
- package/docs-dev/guide/building-stylesheet/index.html +904 -321
- package/docs-dev/guide/developing-ulu-scss-module/index.html +904 -321
- package/docs-dev/guide/index.html +904 -321
- package/docs-dev/guide/updates-and-changes/index.html +5033 -0
- package/docs-dev/index.html +904 -321
- package/docs-dev/javascript/events/index.html +901 -320
- package/docs-dev/javascript/index.html +904 -321
- package/docs-dev/javascript/settings/index.html +5400 -0
- package/docs-dev/javascript/ui-breakpoints/index.html +916 -335
- package/docs-dev/javascript/ui-collapsible/index.html +901 -320
- package/docs-dev/javascript/ui-details-group/index.html +5322 -0
- package/docs-dev/javascript/ui-dialog/index.html +967 -371
- package/docs-dev/javascript/ui-flipcard/index.html +964 -327
- package/docs-dev/javascript/ui-grid/index.html +913 -358
- package/docs-dev/javascript/ui-modal-builder/index.html +914 -354
- package/docs-dev/javascript/ui-overflow-scroller/index.html +901 -320
- package/docs-dev/javascript/ui-overflow-scroller-pager/index.html +901 -320
- package/docs-dev/javascript/ui-page/index.html +901 -320
- package/docs-dev/javascript/ui-popover/index.html +911 -334
- package/docs-dev/javascript/ui-print/index.html +901 -328
- package/docs-dev/javascript/ui-print-details/index.html +901 -320
- package/docs-dev/javascript/ui-programmatic-modal/index.html +901 -320
- package/docs-dev/javascript/ui-proxy-click/index.html +990 -324
- package/docs-dev/javascript/ui-resizer/index.html +901 -320
- package/docs-dev/javascript/ui-scroll-slider/index.html +941 -328
- package/docs-dev/javascript/ui-scrollpoint/index.html +907 -333
- package/docs-dev/javascript/ui-slider/index.html +1099 -327
- package/docs-dev/javascript/ui-tabs/index.html +914 -370
- package/docs-dev/javascript/ui-theme-toggle/index.html +5410 -0
- package/docs-dev/javascript/ui-tooltip/index.html +940 -363
- package/docs-dev/javascript/utils-class-logger/index.html +901 -320
- package/docs-dev/javascript/utils-css/index.html +5224 -0
- package/docs-dev/javascript/utils-dom/index.html +1037 -334
- package/docs-dev/javascript/utils-file-save/index.html +901 -320
- package/docs-dev/javascript/utils-floating-ui/index.html +901 -320
- package/docs-dev/javascript/utils-id/index.html +901 -320
- package/docs-dev/javascript/utils-pause-youtube-video/index.html +901 -320
- package/docs-dev/javascript/utils-system/index.html +5527 -0
- package/docs-dev/sass/base/color/index.html +901 -320
- package/docs-dev/sass/base/elements/index.html +973 -392
- package/docs-dev/sass/base/index/index.html +959 -378
- package/docs-dev/sass/base/index.html +904 -321
- package/docs-dev/sass/base/keyframes/index.html +901 -320
- package/docs-dev/sass/base/layout/index.html +966 -385
- package/docs-dev/sass/base/normalize/index.html +901 -320
- package/docs-dev/sass/base/print/index.html +901 -320
- package/docs-dev/sass/base/root/index.html +901 -320
- package/docs-dev/sass/base/typography/index.html +901 -320
- package/docs-dev/sass/components/accordion/index.html +1026 -445
- package/docs-dev/sass/components/adaptive-spacing/index.html +1027 -446
- package/docs-dev/sass/components/badge/index.html +1005 -424
- package/docs-dev/sass/components/basic-hero/index.html +5385 -0
- package/docs-dev/sass/components/button/index.html +952 -371
- package/docs-dev/sass/components/button-verbose/index.html +1089 -433
- package/docs-dev/sass/components/callout/index.html +1086 -482
- package/docs-dev/sass/components/captioned-figure/index.html +1070 -374
- package/docs-dev/sass/components/card/index.html +1121 -491
- package/docs-dev/sass/components/card-grid/index.html +973 -392
- package/docs-dev/sass/components/counter-list/index.html +5458 -0
- package/docs-dev/sass/components/css-icon/index.html +1052 -464
- package/docs-dev/sass/components/data-grid/index.html +1087 -499
- package/docs-dev/sass/components/data-table/index.html +1154 -381
- package/docs-dev/sass/components/fill-context/index.html +901 -320
- package/docs-dev/sass/components/flipcard/index.html +1071 -459
- package/docs-dev/sass/components/flipcard-grid/index.html +960 -379
- package/docs-dev/sass/components/form-theme/index.html +1349 -672
- package/docs-dev/sass/components/hero/index.html +1016 -387
- package/docs-dev/sass/components/horizontal-rule/index.html +959 -378
- package/docs-dev/sass/components/image-grid/index.html +966 -385
- package/docs-dev/sass/components/index/index.html +1004 -419
- package/docs-dev/sass/components/index.html +904 -321
- package/docs-dev/sass/components/links/index.html +901 -320
- package/docs-dev/sass/components/list-inline/index.html +5399 -0
- package/docs-dev/sass/components/list-lines/index.html +1009 -432
- package/docs-dev/sass/components/list-ordered/index.html +903 -322
- package/docs-dev/sass/components/list-unordered/index.html +901 -320
- package/docs-dev/sass/components/menu-stack/index.html +1050 -456
- package/docs-dev/sass/components/modal/index.html +1032 -444
- package/docs-dev/sass/components/nav-strip/index.html +1023 -442
- package/docs-dev/sass/components/overlay-section/index.html +1010 -429
- package/docs-dev/sass/components/pager/index.html +1017 -436
- package/docs-dev/sass/components/placeholder-block/index.html +1017 -436
- package/docs-dev/sass/components/popover/index.html +1068 -451
- package/docs-dev/sass/components/pull-quote/index.html +1017 -436
- package/docs-dev/sass/components/ratio-box/index.html +969 -388
- package/docs-dev/sass/components/rule/index.html +972 -391
- package/docs-dev/sass/components/scroll-slider/index.html +1019 -450
- package/docs-dev/sass/components/skip-link/index.html +961 -380
- package/docs-dev/sass/components/slider/index.html +1023 -442
- package/docs-dev/sass/components/spoke-spinner/index.html +961 -380
- package/docs-dev/sass/components/sticky-list/index.html +5603 -0
- package/docs-dev/sass/components/tabs/index.html +1020 -439
- package/docs-dev/sass/components/tag/index.html +1064 -483
- package/docs-dev/sass/components/tile-button/index.html +1004 -423
- package/docs-dev/sass/components/tile-grid/index.html +1045 -464
- package/docs-dev/sass/components/tile-grid-overlay/index.html +940 -359
- package/docs-dev/sass/components/vignette/index.html +965 -378
- package/docs-dev/sass/components/wysiwyg/index.html +968 -387
- package/docs-dev/sass/core/breakpoint/index.html +1045 -450
- package/docs-dev/sass/core/button/index.html +1438 -857
- package/docs-dev/sass/core/color/index.html +1084 -496
- package/docs-dev/sass/core/cssvar/index.html +950 -369
- package/docs-dev/sass/core/element/index.html +1504 -782
- package/docs-dev/sass/core/index.html +901 -320
- package/docs-dev/sass/core/layout/index.html +1062 -462
- package/docs-dev/sass/core/path/index.html +953 -372
- package/docs-dev/sass/core/selector/index.html +952 -371
- package/docs-dev/sass/core/typography/index.html +1171 -590
- package/docs-dev/sass/core/units/index.html +984 -403
- package/docs-dev/sass/core/utils/index.html +1941 -500
- package/docs-dev/sass/helpers/color/index.html +901 -320
- package/docs-dev/sass/helpers/display/index.html +902 -321
- package/docs-dev/sass/helpers/index/index.html +956 -375
- package/docs-dev/sass/helpers/index.html +904 -321
- package/docs-dev/sass/helpers/print/index.html +843 -292
- package/docs-dev/sass/helpers/typography/index.html +901 -320
- package/docs-dev/sass/helpers/units/index.html +950 -369
- package/docs-dev/sass/helpers/utilities/index.html +903 -322
- package/docs-dev/sass/index.html +904 -321
- package/js/index.js +1 -0
- package/js/settings.js +95 -0
- package/js/ui/breakpoints.js +19 -16
- package/js/ui/collapsible.js +8 -1
- package/js/ui/details-group.js +112 -0
- package/js/ui/dialog.js +90 -42
- package/js/ui/dialog.todo +2 -36
- package/js/ui/flipcard.js +37 -57
- package/js/ui/grid.js +15 -13
- package/js/ui/index.js +1 -0
- package/js/ui/modal-builder.js +45 -54
- package/js/ui/overflow-scroller.js +6 -4
- package/js/ui/popover.js +38 -38
- package/js/ui/print.js +16 -25
- package/js/ui/programmatic-modal.js +9 -3
- package/js/ui/proxy-click.js +50 -36
- package/js/ui/scroll-slider.js +24 -30
- package/js/ui/scrollpoint.js +28 -64
- package/js/ui/slider.js +61 -62
- package/js/ui/tabs.js +23 -36
- package/js/ui/theme-toggle.js +331 -94
- package/js/ui/tooltip.js +27 -32
- package/js/utils/css.js +13 -0
- package/js/utils/dom.js +69 -4
- package/js/utils/font-awesome.js +18 -0
- package/js/utils/index.js +2 -1
- package/js/utils/system.js +154 -0
- package/package.json +10 -7
- package/scss/_breakpoint.scss +16 -3
- package/scss/_color.scss +9 -2
- package/scss/_element.scss +91 -0
- package/scss/_layout.scss +7 -8
- package/scss/_utils.scss +248 -13
- package/scss/components/README.todos +14 -0
- package/scss/components/_accordion.scss +18 -20
- package/scss/components/_badge.scss +3 -2
- package/scss/components/_basic-hero.scss +112 -0
- package/scss/components/_button-verbose.scss +102 -20
- package/scss/components/_callout.scss +127 -79
- package/scss/components/_captioned-figure.scss +23 -5
- package/scss/components/_card-grid.scss +1 -1
- package/scss/components/_card.scss +242 -88
- package/scss/components/_counter-list.scss +133 -0
- package/scss/components/_css-icon.scss +33 -28
- package/scss/components/_data-grid.scss +38 -9
- package/scss/components/_data-table.scss +44 -4
- package/scss/components/_flipcard.scss +21 -15
- package/scss/components/_form-theme.scss +146 -135
- package/scss/components/_hero.scss +12 -10
- package/scss/components/_index.scss +24 -0
- package/scss/components/_list-inline.scss +80 -0
- package/scss/components/_list-lines.scss +44 -33
- package/scss/components/_list-ordered.scss +0 -1
- package/scss/components/_menu-stack.scss +42 -26
- package/scss/components/_modal.scss +29 -19
- package/scss/components/_nav-strip.scss +25 -16
- package/scss/components/_overlay-section.scss +4 -6
- package/scss/components/_pager.scss +6 -6
- package/scss/components/_placeholder-block.scss +4 -4
- package/scss/components/_popover.scss +174 -73
- package/scss/components/_pull-quote.scss +13 -13
- package/scss/components/_ratio-box.scss +2 -5
- package/scss/components/_rule.scss +1 -1
- package/scss/components/_scroll-slider.scss +2 -6
- package/scss/components/_skip-link.scss +2 -1
- package/scss/components/_slider.scss +17 -38
- package/scss/components/_spoke-spinner.scss +2 -2
- package/scss/components/_sticky-list.scss +206 -0
- package/scss/components/_tabs.scss +4 -2
- package/scss/components/_tag.scss +1 -1
- package/scss/components/_vignette.scss +3 -5
- package/scss/helpers/_display.scss +15 -18
- package/scss/helpers/_print.scss +12 -7
- package/scss/helpers/_utilities.scss +42 -32
- package/types/index.d.ts +1 -0
- package/types/settings.d.ts +66 -0
- package/types/settings.d.ts.map +1 -0
- package/types/ui/breakpoints.d.ts +14 -14
- package/types/ui/breakpoints.d.ts.map +1 -1
- package/types/ui/collapsible.d.ts.map +1 -1
- package/types/ui/details-group.d.ts +38 -0
- package/types/ui/details-group.d.ts.map +1 -0
- package/types/ui/dialog.d.ts +20 -14
- package/types/ui/dialog.d.ts.map +1 -1
- package/types/ui/flipcard.d.ts +16 -10
- package/types/ui/flipcard.d.ts.map +1 -1
- package/types/ui/grid.d.ts +4 -6
- package/types/ui/grid.d.ts.map +1 -1
- package/types/ui/index.d.ts +1 -0
- package/types/ui/modal-builder.d.ts +8 -11
- package/types/ui/modal-builder.d.ts.map +1 -1
- package/types/ui/overflow-scroller.d.ts +2 -2
- package/types/ui/overflow-scroller.d.ts.map +1 -1
- package/types/ui/popover.d.ts +6 -7
- package/types/ui/popover.d.ts.map +1 -1
- package/types/ui/print.d.ts +0 -4
- package/types/ui/print.d.ts.map +1 -1
- package/types/ui/programmatic-modal.d.ts.map +1 -1
- package/types/ui/proxy-click.d.ts +19 -3
- package/types/ui/proxy-click.d.ts.map +1 -1
- package/types/ui/scroll-slider.d.ts +5 -7
- package/types/ui/scroll-slider.d.ts.map +1 -1
- package/types/ui/scrollpoint.d.ts +3 -8
- package/types/ui/scrollpoint.d.ts.map +1 -1
- package/types/ui/slider.d.ts +24 -14
- package/types/ui/slider.d.ts.map +1 -1
- package/types/ui/tabs.d.ts +6 -8
- package/types/ui/tabs.d.ts.map +1 -1
- package/types/ui/theme-toggle.d.ts +51 -7
- package/types/ui/theme-toggle.d.ts.map +1 -1
- package/types/ui/tooltip.d.ts +3 -5
- package/types/ui/tooltip.d.ts.map +1 -1
- package/types/utils/css.d.ts +11 -0
- package/types/utils/css.d.ts.map +1 -0
- package/types/utils/dom.d.ts +36 -4
- package/types/utils/dom.d.ts.map +1 -1
- package/types/utils/font-awesome.d.ts +5 -0
- package/types/utils/font-awesome.d.ts.map +1 -0
- package/types/utils/index.d.ts +1 -0
- package/types/utils/system.d.ts +113 -0
- 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,154 @@
|
|
|
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, dataAttributeToDatasetKey } from "./dom.js";
|
|
8
|
+
import { getName } from "../events/index.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 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
|
|
12
|
+
*/
|
|
13
|
+
export class ComponentInitializer {
|
|
14
|
+
static defaults = {
|
|
15
|
+
type: null,
|
|
16
|
+
baseAttribute: null
|
|
17
|
+
};
|
|
18
|
+
static requiredOptions = [
|
|
19
|
+
"type",
|
|
20
|
+
"baseAttribute"
|
|
21
|
+
];
|
|
22
|
+
static hasRequiredOptions = hasRequiredProps(
|
|
23
|
+
ComponentInitializer.requiredOptions
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Create a new instance of ComponentInitializer
|
|
28
|
+
* @param {Object} options Options for configuring the component initializer.
|
|
29
|
+
* @param {String} options.type Type of component (used for logs).
|
|
30
|
+
* @param {String} options.baseAttribute Prefix and base attribute name (used for base attribute and further element attribute names).
|
|
31
|
+
*/
|
|
32
|
+
constructor(options) {
|
|
33
|
+
if (!ComponentInitializer.hasRequiredOptions(options)) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`Missing a required options: ${ ComponentInitializer.requiredOptions.join(", ") }`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
this.options = Object.assign({}, ComponentInitializer.defaults, options);
|
|
39
|
+
this.logTitle = `ULU: ${ this.options.type }:\n`;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Initializes the component based on the provided configuration.
|
|
43
|
+
* @param {Object} config The initialization configuration.
|
|
44
|
+
* @param {Function} config.setup The setup function to call for each element.
|
|
45
|
+
* @param {String} config.key [null] The optional key to use with attribute selector.
|
|
46
|
+
* @param {Boolean} config.withData [null] Whether to retrieve element data.
|
|
47
|
+
* @param {Array} config.events [null] Ulu events that should call setup when dispatched (ie. pageModified, pageResized)
|
|
48
|
+
* @param {Boolean} config.onPageResized [null] Whether to bind event listener for page resize end
|
|
49
|
+
* @param {HTMLElement} config.context [document] The context to query within.
|
|
50
|
+
*/
|
|
51
|
+
init(config) {
|
|
52
|
+
this.setupElements(config);
|
|
53
|
+
// Attach Handler to reinitialize if page is updated
|
|
54
|
+
// Specifically checking entire document incase element that dispatched
|
|
55
|
+
// event made alterations outside of itself
|
|
56
|
+
if (config.events?.length) {
|
|
57
|
+
config.events.forEach(name => {
|
|
58
|
+
document.addEventListener(getName(name), () => this.setupElements(config));
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Processes the elements based on the provided configuration.
|
|
64
|
+
* @param {object} config The initialization configuration.
|
|
65
|
+
* @param {function} config.setup The setup function to call for each element.
|
|
66
|
+
* @param {string} config.key The optional key to use with attribute selector.
|
|
67
|
+
* @param {boolean} config.withData [false] Whether to retrieve element data.
|
|
68
|
+
* @param {boolean} config.onPageModified [true] Whether to bind event listener for page modifications.
|
|
69
|
+
* @param {HTMLElement} config.context [document] The context to query within.
|
|
70
|
+
*/
|
|
71
|
+
setupElements(config) {
|
|
72
|
+
const { setup, key, withData, context } = config;
|
|
73
|
+
const elementsWithData = this.queryAllInitial(key, withData, context);
|
|
74
|
+
elementsWithData.forEach(elementWithData => setup(elementWithData, this));
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Get an attribute name
|
|
78
|
+
* @param {String} key Optional key, if no key will return baseAttribute if key will return key added to base
|
|
79
|
+
* @returns {String} String like data-ulu-dialog or data-ulu-dialog-element
|
|
80
|
+
*/
|
|
81
|
+
getAttribute(key) {
|
|
82
|
+
const { baseAttribute } = this.options;
|
|
83
|
+
return key ? `${ baseAttribute }-${ key }` : `${ baseAttribute }`;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Create an attribute selector
|
|
87
|
+
* @param {String} key Optional key (see getAttribute)
|
|
88
|
+
*/
|
|
89
|
+
attributeSelector(key) {
|
|
90
|
+
return `[${ this.getAttribute(key) }]`;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Create an attribute selector for initial
|
|
94
|
+
* @return {String}
|
|
95
|
+
*/
|
|
96
|
+
attributeSelectorInitial(key) {
|
|
97
|
+
return `${ this.attributeSelector(key) }:not([${ this.getAttribute("init") }])`
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Queries all main elements of a component that have not been initialized and extracts their data attributes.
|
|
101
|
+
* @param {HTMLElement} context The context to query within.
|
|
102
|
+
* @param {Boolean} withData Include dataset from element (as optional JSON)
|
|
103
|
+
* @param {Node} context Element to query elements from
|
|
104
|
+
* @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
|
|
105
|
+
*/
|
|
106
|
+
queryAllInitial(key, withData, context = document) {
|
|
107
|
+
const elements = [ ...context.querySelectorAll(this.attributeSelectorInitial(key)) ];
|
|
108
|
+
return elements.map((element) => ({
|
|
109
|
+
element,
|
|
110
|
+
data: withData ? this.getData(element, key) : null,
|
|
111
|
+
initialize: () => this.initializeElement(element)
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Sets the init attribute on an element, marking it as initialized.
|
|
116
|
+
* @param {HTMLElement} element The element to initialize.
|
|
117
|
+
*/
|
|
118
|
+
initializeElement(element) {
|
|
119
|
+
element.setAttribute(this.getAttribute("init"), "");
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get an elements dataset value as JSON or other value
|
|
123
|
+
* @return {*} The value of the dataset, if JSON will return object else will return string value or undefined
|
|
124
|
+
*/
|
|
125
|
+
getData(element, key) {
|
|
126
|
+
const datasetKey = dataAttributeToDatasetKey(this.getAttribute(key));
|
|
127
|
+
return getDatasetOptionalJson(element, datasetKey);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Will output namespaced console logs for the given initializer
|
|
131
|
+
*/
|
|
132
|
+
log(...msgs) {
|
|
133
|
+
console.log(this.logTitle, ...msgs);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Will output namespaced console warnings for the given initializer
|
|
137
|
+
*/
|
|
138
|
+
warn(...msgs) {
|
|
139
|
+
console.warn(this.logTitle, ...msgs);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Will output namespaced console error for the given initializer
|
|
143
|
+
*/
|
|
144
|
+
logError(...msgs) {
|
|
145
|
+
console.error(this.logTitle, ...msgs);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Class serves as a base for representing individual occurrences of a UI component, providing a consistent structure for each
|
|
151
|
+
*/
|
|
152
|
+
export class ComponentInstance {
|
|
153
|
+
|
|
154
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulu/frontend",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.40",
|
|
4
4
|
"description": "Modular Sass Theming Library",
|
|
5
5
|
"browser": "js/index.js",
|
|
6
6
|
"main": "index.js",
|
|
@@ -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",
|
|
@@ -61,11 +63,12 @@
|
|
|
61
63
|
"@11ty/eleventy-plugin-syntaxhighlight": "^5.0.0",
|
|
62
64
|
"@fortawesome/fontawesome-free": "^6.5.2",
|
|
63
65
|
"@ulu/markdown-output-utils": "^0.0.6",
|
|
64
|
-
"@ulu/sassdoc-to-markdown": "^0.0.
|
|
66
|
+
"@ulu/sassdoc-to-markdown": "^0.0.16",
|
|
65
67
|
"@ulu/vite-config-cms-theme": "^0.0.10",
|
|
66
68
|
"@ulu/vitepress-auto-menus": "^0.0.3",
|
|
67
69
|
"@ulu/vitepress-sassdoc": "^0.0.9",
|
|
68
70
|
"algoliasearch": "^4.23.3",
|
|
71
|
+
"autoprefixer": "^10.4.16",
|
|
69
72
|
"chokidar": "^3.6.0",
|
|
70
73
|
"eleventy-plugin-nesting-toc": "^1.3.0",
|
|
71
74
|
"fs-extra": "^11.2.0",
|
|
@@ -78,14 +81,14 @@
|
|
|
78
81
|
"sass-embedded": "^1.81.0",
|
|
79
82
|
"sharp": "^0.33.4",
|
|
80
83
|
"svgo": "^3.3.2",
|
|
84
|
+
"twig": "^1.17.1",
|
|
81
85
|
"typescript": "^5.3.3",
|
|
82
|
-
"autoprefixer": "^10.4.16",
|
|
83
86
|
"vite": "^5.4.11"
|
|
84
87
|
},
|
|
85
88
|
"dependencies": {
|
|
86
|
-
"@
|
|
89
|
+
"@floating-ui/dom": "^1.6.5",
|
|
90
|
+
"@ulu/utils": "^0.0.20",
|
|
87
91
|
"ally.js": "^1.4.1",
|
|
88
|
-
"aria-tablist": "^1.2.2"
|
|
89
|
-
"@floating-ui/dom": "^1.6.5"
|
|
92
|
+
"aria-tablist": "^1.2.2"
|
|
90
93
|
}
|
|
91
94
|
}
|
package/scss/_breakpoint.scss
CHANGED
|
@@ -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,12 @@ $config: (
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
/// Get a config option
|
|
33
|
-
/// @
|
|
34
|
-
///
|
|
34
|
+
/// @compiler
|
|
35
|
+
/// @use "index" as ulu;
|
|
36
|
+
/// @example scss {compile} Example usage
|
|
37
|
+
/// .test-get {
|
|
38
|
+
/// font-size: ulu.breakpoint-get("base");
|
|
39
|
+
/// }
|
|
35
40
|
/// @param {Map} $name Name of property
|
|
36
41
|
/// @return {*} Property Value
|
|
37
42
|
|
|
@@ -66,6 +71,14 @@ $sizes: (
|
|
|
66
71
|
|
|
67
72
|
/// Get all breakpoint sizes
|
|
68
73
|
/// @return {Map} Map of breakpoints (equivalent to $sizes)
|
|
74
|
+
/// @compiler
|
|
75
|
+
/// @use "index" as ulu;
|
|
76
|
+
/// @use "sass:map";
|
|
77
|
+
/// @example scss {compile} Example usage
|
|
78
|
+
/// .test-get {
|
|
79
|
+
/// $sizes: ulu.breakpoint-get-sizes();
|
|
80
|
+
/// height: map.get($sizes, "medium");
|
|
81
|
+
/// }
|
|
69
82
|
|
|
70
83
|
@function get-sizes() {
|
|
71
84
|
@return $sizes;
|
|
@@ -220,7 +233,7 @@ $sizes: (
|
|
|
220
233
|
/// - Breakpoints always min-width (upwards) for javascript setup
|
|
221
234
|
|
|
222
235
|
@mixin embed-for-scripts() {
|
|
223
|
-
|
|
236
|
+
&::before {
|
|
224
237
|
display: none;
|
|
225
238
|
content: get("null-name");
|
|
226
239
|
@each $size, $breakpoint in $sizes {
|
package/scss/_color.scss
CHANGED
|
@@ -23,10 +23,17 @@ $palette: (
|
|
|
23
23
|
"type-tertiary" : rgb(157, 157, 157),
|
|
24
24
|
"headline" : inherit,
|
|
25
25
|
"background" : white,
|
|
26
|
+
"background-gray" : #F7F8F7,
|
|
26
27
|
"focus" : blue,
|
|
27
|
-
"error" : red,
|
|
28
|
-
"warning" : orange,
|
|
29
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,
|
|
30
37
|
"selected" : green,
|
|
31
38
|
"box-shadow" : rgba(0, 0, 0, 0.349),
|
|
32
39
|
"box-shadow-hover" : rgba(0, 0, 0, 0.5),
|
package/scss/_element.scss
CHANGED
|
@@ -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
|
|
@@ -290,4 +292,93 @@ $rule-margins: (
|
|
|
290
292
|
white-space: normal;
|
|
291
293
|
width: auto;
|
|
292
294
|
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
/// Layout utility to add a colored bar (cap) to an element's edge, positioned over the element and its border
|
|
299
|
+
/// - You need to set position (relative, fixed) on parent
|
|
300
|
+
/// @param {String} $side The side to place the cap (top, bottom, left, right)
|
|
301
|
+
/// @param {Map} $options Options for the appearance of the cap
|
|
302
|
+
/// @param {Color} $options.color [$config.cap-color] The color for the end cap
|
|
303
|
+
/// @param {Number} $options.size [$config.cap-size] The width/height of the cap
|
|
304
|
+
/// @param {Number} $options.offset [0] A positive number of the amount the cap should extend outside the box (to account for border-width)
|
|
305
|
+
/// @param {Number} $options.border-radius [null] An optional border-radius to apply to the outward-facing edges of the cap (used to match parent)
|
|
306
|
+
/// @param {Boolean} $before [true] Whether or not to use the ::before element (if not uses :after)
|
|
307
|
+
|
|
308
|
+
@mixin cap(
|
|
309
|
+
$side,
|
|
310
|
+
$options: (),
|
|
311
|
+
$before: true,
|
|
312
|
+
) {
|
|
313
|
+
$defaults: (
|
|
314
|
+
"color" : get("cap-color"),
|
|
315
|
+
"size" : get("cap-size"),
|
|
316
|
+
"offset" : 0,
|
|
317
|
+
"color-hover" : null,
|
|
318
|
+
"border-radius" : null,
|
|
319
|
+
"padding-adjust" : null,
|
|
320
|
+
);
|
|
321
|
+
$config: map.merge($defaults, $options);
|
|
322
|
+
$element: if($before, "::before", "::after");
|
|
323
|
+
|
|
324
|
+
&#{ $element } {
|
|
325
|
+
content: "";
|
|
326
|
+
position: absolute;
|
|
327
|
+
display: block;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
@include cap-appearance($side, $config, $before);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
/// Provides the appearance styles for a given cap
|
|
336
|
+
/// - If an option is not provided it won't be output
|
|
337
|
+
/// - This is used to update the caps styling (states, modifiers, etc)
|
|
338
|
+
/// @param {String} $side The side to place the cap (top, bottom, left, right)
|
|
339
|
+
/// @param {Map} $options Options for the appearance of the cap (see options from element.cap)
|
|
340
|
+
/// @param {Boolean} $before Whether or not to use the ::before element (if not uses :after)
|
|
341
|
+
|
|
342
|
+
@mixin cap-appearance(
|
|
343
|
+
$side,
|
|
344
|
+
$options: (),
|
|
345
|
+
$before: true
|
|
346
|
+
) {
|
|
347
|
+
$element: if($before, "::before", "::after");
|
|
348
|
+
$size: map.get($options, "size");
|
|
349
|
+
$offset: map.get($options, "offset");
|
|
350
|
+
$border-radius: map.get($options, "border-radius");
|
|
351
|
+
$padding-adjust: map.get($options, "padding-adjust");
|
|
352
|
+
|
|
353
|
+
$end: $side == "top" or $side == "bottom";
|
|
354
|
+
$position: if($offset, 0 - $offset, null);
|
|
355
|
+
|
|
356
|
+
@if ($padding-adjust and $size) {
|
|
357
|
+
padding-#{ $side }: calc($padding-adjust + $size);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
&#{ $element } {
|
|
361
|
+
background-color: color.get(map.get($options, "color"));
|
|
362
|
+
#{ $side }: $position;
|
|
363
|
+
|
|
364
|
+
@if $end {
|
|
365
|
+
left: $position;
|
|
366
|
+
right: $position;
|
|
367
|
+
height: $size;
|
|
368
|
+
} @else {
|
|
369
|
+
top: $position;
|
|
370
|
+
bottom: $position;
|
|
371
|
+
width: $size;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
@if $border-radius {
|
|
375
|
+
@if $end {
|
|
376
|
+
border-#{ $side }-left-radius: $border-radius;
|
|
377
|
+
border-#{ $side }-right-radius: $border-radius;
|
|
378
|
+
} @else {
|
|
379
|
+
border-top-#{ $side }-radius: $border-radius;
|
|
380
|
+
border-bottom-#{ $side }-radius: $border-radius;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
293
384
|
}
|
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
|
-
|
|
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
|
-
|
|
247
|
-
|
|
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
|
-
|
|
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
|
+
}
|