@ulu/frontend 0.0.22 → 0.1.0-beta.0
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 +4 -0
- package/deprecated/js/drupal-programmatic-modal.js +91 -0
- package/{js/ui/modals.js → deprecated/js/micromodal-modals.js} +41 -67
- package/dist/ulu-frontend.min.css +1 -1
- package/dist/ulu-frontend.min.js +70 -1
- package/index.js +6 -1
- package/js/events/index.js +58 -7
- package/js/index.js +3 -7
- package/js/{helpers/css-breakpoint.js → ui/breakpoints.js} +9 -11
- package/js/ui/collapsible.js +195 -0
- package/js/ui/dialog.js +157 -0
- package/js/ui/dialog.todo +37 -0
- package/js/ui/flipcard.js +55 -11
- package/js/ui/grid.js +2 -47
- package/js/ui/index.js +21 -0
- package/js/ui/modal-builder.js +197 -0
- package/js/ui/overflow-scroller-pager.js +1 -1
- package/js/ui/overflow-scroller.js +8 -5
- package/js/ui/page.js +14 -0
- package/js/ui/popover.js +135 -0
- package/js/ui/print-details.js +44 -0
- package/js/ui/print.js +67 -0
- package/js/ui/programmatic-modal.js +79 -81
- package/js/ui/proxy-click.js +80 -0
- package/js/ui/resizer.js +3 -3
- package/js/ui/scroll-slider.js +56 -0
- package/js/ui/scrollpoint.js +300 -0
- package/js/ui/slider.js +72 -10
- package/js/ui/tabs.js +85 -58
- package/js/ui/theme-toggle.js +129 -0
- package/js/ui/tooltip.js +268 -67
- package/js/utils/{logger.js → class-logger.js} +6 -5
- package/js/utils/dom.js +122 -0
- package/js/utils/file-save.js +67 -0
- package/js/utils/floating-ui.js +83 -0
- package/js/utils/id.js +22 -0
- package/js/utils/index.js +7 -0
- package/js/{helpers → utils}/pause-youtube-video.js +1 -1
- package/package.json +32 -11
- package/resources/drupal/twig-macros/accordion.twig +99 -0
- package/resources/drupal/twig-macros/dropdown.twig +44 -0
- package/resources/drupal/twig-macros/flipcard.twig +69 -0
- package/resources/drupal/twig-macros/image.twig +30 -0
- package/resources/drupal/twig-macros/layout.twig +338 -0
- package/resources/drupal/twig-macros/slider.twig +214 -0
- package/resources/drupal/twig-macros/tabs.twig +84 -0
- package/scss/README.md +13 -1
- package/scss/_breakpoint.scss +69 -26
- package/scss/_button.scss +148 -57
- package/scss/_color.scss +46 -28
- package/scss/_cssvar.scss +103 -12
- package/scss/_element.scss +84 -67
- package/scss/_index.scss +0 -3
- package/scss/_layout.scss +71 -37
- package/scss/_path.scss +2 -2
- package/scss/_selector.scss +20 -11
- package/scss/_typography.scss +115 -82
- package/scss/_units.scss +14 -13
- package/scss/_utils.scss +280 -18
- package/scss/base/_color.scss +2 -1
- package/scss/base/_elements.scss +61 -35
- package/scss/base/_index.scss +60 -23
- package/scss/base/_keyframes.scss +115 -16
- package/scss/base/_layout.scss +10 -6
- package/scss/base/_normalize.scss +6 -122
- package/scss/base/_print.scss +49 -0
- package/scss/base/_root.scss +28 -0
- package/scss/base/_typography.scss +4 -1
- package/scss/components/_accordion.scss +217 -0
- package/scss/components/_adaptive-spacing.scss +148 -0
- package/scss/components/_badge.scss +17 -14
- package/scss/components/_button-verbose.scss +138 -0
- package/scss/components/_button.scss +9 -4
- package/scss/components/_callout.scss +175 -0
- package/scss/components/_captioned-figure.scss +173 -0
- package/scss/components/_card-grid.scss +75 -0
- package/scss/components/_card.scss +420 -0
- package/scss/components/_css-icon.scss +433 -0
- package/scss/{_grid.scss → components/_data-grid.scss} +100 -68
- package/scss/components/_data-table.scss +180 -0
- package/scss/components/_fill-context.scss +20 -22
- package/scss/components/_flipcard-grid.scss +66 -0
- package/scss/components/_flipcard.scss +304 -0
- package/scss/components/_form-theme.scss +633 -0
- package/scss/components/_hero.scss +183 -0
- package/scss/components/_horizontal-rule.scss +51 -0
- package/scss/components/_image-grid.scss +71 -0
- package/scss/components/_index.scss +276 -38
- package/scss/components/_links.scss +1 -1
- package/scss/components/_list-lines.scss +14 -3
- package/scss/components/_list-ordered.scss +3 -1
- package/scss/components/_list-unordered.scss +3 -1
- package/scss/components/_menu-stack.scss +245 -0
- package/scss/components/_modal.scss +495 -0
- package/scss/components/_nav-strip.scss +148 -0
- package/scss/components/_overlay-section.scss +122 -0
- package/scss/components/_pager.scss +168 -0
- package/scss/components/_placeholder-block.scss +121 -0
- package/scss/components/_popover.scss +263 -0
- package/scss/components/_pull-quote.scss +111 -0
- package/scss/components/_ratio-box.scss +64 -0
- package/scss/components/_rule.scss +12 -9
- package/scss/components/_scroll-slider.scss +204 -0
- package/scss/components/_skip-link.scss +92 -0
- package/scss/components/_slider.scss +241 -0
- package/scss/components/_spoke-spinner.scss +193 -0
- package/scss/components/_tabs.scss +179 -0
- package/scss/components/_tag.scss +142 -0
- package/scss/components/_tile-button.scss +131 -0
- package/scss/components/_tile-grid-overlay.scss +132 -0
- package/scss/components/_tile-grid.scss +172 -0
- package/scss/components/_vignette.scss +65 -0
- package/scss/components/_wysiwyg.scss +94 -0
- package/scss/helpers/_color.scss +1 -0
- package/scss/helpers/_display.scss +2 -1
- package/scss/helpers/_index.scss +45 -22
- package/scss/helpers/_print.scss +20 -43
- package/scss/helpers/_typography.scss +3 -0
- package/scss/helpers/_units.scss +10 -13
- package/scss/helpers/_utilities.scss +5 -1
- package/scss/stylesheets/base-styles.scss +7 -0
- package/scss/stylesheets/component-styles.scss +7 -0
- package/scss/stylesheets/helper-styles.scss +7 -0
- package/types/events/index.d.ts +1 -1
- package/types/events/index.d.ts.map +1 -1
- package/types/index.d.ts +2 -2
- package/types/{helpers/css-breakpoint.d.ts → ui/breakpoints.d.ts} +3 -3
- package/types/ui/breakpoints.d.ts.map +1 -0
- package/types/ui/collapsible.d.ts +67 -0
- package/types/ui/collapsible.d.ts.map +1 -0
- package/types/ui/dialog.d.ts +42 -0
- package/types/ui/dialog.d.ts.map +1 -0
- package/types/ui/flipcard.d.ts +8 -1
- package/types/ui/flipcard.d.ts.map +1 -1
- package/types/ui/grid.d.ts +0 -11
- package/types/ui/grid.d.ts.map +1 -1
- package/types/ui/index.d.ts +23 -0
- package/types/ui/index.d.ts.map +1 -0
- package/types/ui/modal-builder.d.ts +54 -0
- package/types/ui/modal-builder.d.ts.map +1 -0
- package/types/ui/overflow-scroller-pager.d.ts +1 -1
- package/types/ui/overflow-scroller-pager.d.ts.map +1 -1
- package/types/ui/overflow-scroller.d.ts +3 -1
- package/types/ui/overflow-scroller.d.ts.map +1 -1
- package/types/ui/page.d.ts +5 -0
- package/types/ui/page.d.ts.map +1 -0
- package/types/ui/popover.d.ts +40 -0
- package/types/ui/popover.d.ts.map +1 -0
- package/types/ui/print-details.d.ts +10 -0
- package/types/ui/print-details.d.ts.map +1 -0
- package/types/ui/print.d.ts +10 -0
- package/types/ui/print.d.ts.map +1 -0
- package/types/ui/programmatic-modal.d.ts +19 -1
- package/types/ui/programmatic-modal.d.ts.map +1 -1
- package/types/ui/proxy-click.d.ts +18 -0
- package/types/ui/proxy-click.d.ts.map +1 -0
- package/types/ui/resizer.d.ts +1 -1
- package/types/ui/resizer.d.ts.map +1 -1
- package/types/ui/scroll-slider.d.ts +13 -0
- package/types/ui/scroll-slider.d.ts.map +1 -0
- package/types/ui/scrollpoint.d.ts +133 -0
- package/types/ui/scrollpoint.d.ts.map +1 -0
- package/types/ui/slider.d.ts +14 -2
- package/types/ui/slider.d.ts.map +1 -1
- package/types/ui/tabs.d.ts +22 -0
- package/types/ui/tabs.d.ts.map +1 -1
- package/types/ui/theme-toggle.d.ts +14 -0
- package/types/ui/theme-toggle.d.ts.map +1 -0
- package/types/ui/tooltip.d.ts +92 -10
- package/types/ui/tooltip.d.ts.map +1 -1
- package/types/utils/{logger.d.ts → class-logger.d.ts} +1 -1
- package/types/utils/class-logger.d.ts.map +1 -0
- package/types/utils/dom.d.ts +48 -0
- package/types/utils/dom.d.ts.map +1 -0
- package/types/utils/file-save.d.ts +64 -0
- package/types/utils/file-save.d.ts.map +1 -0
- package/types/utils/floating-ui.d.ts +19 -0
- package/types/utils/floating-ui.d.ts.map +1 -0
- package/types/utils/id.d.ts +10 -0
- package/types/utils/id.d.ts.map +1 -0
- package/types/utils/index.d.ts +9 -0
- package/types/utils/index.d.ts.map +1 -0
- package/types/utils/pause-youtube-video.d.ts.map +1 -0
- package/js/helpers/file-save.js +0 -52
- package/js/helpers/scrollbar-width-property.js +0 -14
- package/project.todo +0 -22
- package/scss/_calculate.scss +0 -64
- package/scss/_utility.scss +0 -12
- package/types/helpers/css-breakpoint.d.ts.map +0 -1
- package/types/helpers/file-save.d.ts +0 -17
- package/types/helpers/file-save.d.ts.map +0 -1
- package/types/helpers/node-data-manager.d.ts +0 -45
- package/types/helpers/node-data-manager.d.ts.map +0 -1
- package/types/helpers/pause-youtube-video.d.ts.map +0 -1
- package/types/helpers/scrollbar-width-property.d.ts +0 -11
- package/types/helpers/scrollbar-width-property.d.ts.map +0 -1
- package/types/ui/modals.d.ts +0 -27
- package/types/ui/modals.d.ts.map +0 -1
- package/types/utils/logger.d.ts.map +0 -1
- package/vite.config.js +0 -36
- /package/{js/deprecated → deprecated/js}/doc-ready.js +0 -0
- /package/{js/deprecated → deprecated/js}/jquery-prototypes.js +0 -0
- /package/{js/deprecated → deprecated/js}/mini-collapsible-popper-positioning.js +0 -0
- /package/{js/deprecated → deprecated/js}/mini-collapsible.js +0 -0
- /package/{js/helpers → deprecated/js}/node-data-manager.js +0 -0
- /package/{js/deprecated → deprecated/js}/script-loader.js +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/README.md +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/anchor-menu.js +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/element-waypoint.js +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/examples/page-link-menu.md +0 -0
- /package/{js/deprecated → deprecated/js}/waypoints/state-in-attribute.js +0 -0
- /package/types/{helpers → utils}/pause-youtube-video.d.ts +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get an elements JSON dataset value
|
|
3
|
+
* @param {Node} element
|
|
4
|
+
* @param {String} key key in dataset object for element
|
|
5
|
+
* @returns {Object} Empty object or JSON object from dataset
|
|
6
|
+
*/
|
|
7
|
+
export function getDatasetJson(element: Node, key: string): any;
|
|
8
|
+
/**
|
|
9
|
+
* Get an elements JSON dataset value that could potentially just be a single string
|
|
10
|
+
* - If JSON it will return the object else it will return the value directly
|
|
11
|
+
* @param {Node} element
|
|
12
|
+
* @param {String} key key in dataset object for element
|
|
13
|
+
* @returns {Object|String} JSON object or current dataset value (string or empty string if no value)
|
|
14
|
+
*/
|
|
15
|
+
export function getDatasetOptionalJson(element: Node, key: string): any | string;
|
|
16
|
+
/**
|
|
17
|
+
* Check if a pointer event x/y was outside an elements bounding box
|
|
18
|
+
*/
|
|
19
|
+
export function wasClickOutside(element: any, event: any): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Sets up the positional classes that would come from the equal
|
|
22
|
+
* height module. Needs to be rerun by user when layout changes
|
|
23
|
+
* or new instances are added to the screen
|
|
24
|
+
* - Used for gutter crops
|
|
25
|
+
* - Used for rule placement
|
|
26
|
+
* - **Devs** Remember that default classes should match sass defaults
|
|
27
|
+
* @param {Node} parent The grid parent <data-grid="">
|
|
28
|
+
* @param {Object} classes Override the default equal heights classes
|
|
29
|
+
*/
|
|
30
|
+
export function setPositionClasses(parent: Node, classes?: any): void;
|
|
31
|
+
/**
|
|
32
|
+
* Resolve a target to Element
|
|
33
|
+
* @param {String|Node} target The selector or node/element
|
|
34
|
+
* @param {Object} context [document] The context to query possible selectors from
|
|
35
|
+
*/
|
|
36
|
+
export function getElement(target: string | Node, context?: any): any;
|
|
37
|
+
/**
|
|
38
|
+
* Sets a CSS custom property equal to the scrollbar width
|
|
39
|
+
* @param {Node} element The element that is the child of a scrollabel container
|
|
40
|
+
* @param {Node} container The container that can be scrolled
|
|
41
|
+
* @param {Stirng} propName Custom property to set
|
|
42
|
+
*/
|
|
43
|
+
export function addScrollbarProperty(element?: Node, container?: Node, propName?: Stirng): void;
|
|
44
|
+
/**
|
|
45
|
+
* @module utils/dom
|
|
46
|
+
*/
|
|
47
|
+
export const regexJsonString: RegExp;
|
|
48
|
+
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../js/utils/dom.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,wCAJW,IAAI,oBAYd;AAED;;;;;;GAMG;AACH,gDAJW,IAAI,gBAEF,YAAa,CASzB;AAED;;GAEG;AACH,mEAMC;AAGD;;;;;;;;;GASG;AACH,2CAHa,IAAI,uBAoChB;AAED;;;;GAIG;AACH,mCAHW,SAAO,IAAI,sBAYrB;AAED;;;;;GAKG;AACH,+CAJW,IAAI,cACJ,IAAI,2BAMd;AAzHD;;GAEG;AAGH,qCAAqD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module utils/file-save
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Options
|
|
6
|
+
* @typedef {Object} FileSaveOptions
|
|
7
|
+
* @property {String} filename Filename for blob when creating a link (ie createLink) [default "filesave-file.txt"]
|
|
8
|
+
* @property {String} type Filename for blob when creating a link (ie createLink) [default "text/plain;charset=utf-8"]
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Simple script that is useful for testing
|
|
12
|
+
* - Make a file
|
|
13
|
+
* - Create a URL to it
|
|
14
|
+
* - Gives utility function to create a link to the file (for front end)
|
|
15
|
+
* - Gives method to destroy the file when no longer needed
|
|
16
|
+
* - User can redefine the program by passing options object matching props.
|
|
17
|
+
* Limited to new browsers that support Blob(), also user preferences or type of browser may limit access to Blob functionality
|
|
18
|
+
*/
|
|
19
|
+
export class FileSave {
|
|
20
|
+
static defaults: {
|
|
21
|
+
filename: string;
|
|
22
|
+
type: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Check for Compatibility (optional, implement on user side)
|
|
26
|
+
*/
|
|
27
|
+
static isBrowserSupported(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @param {*} data Data to put in blob file
|
|
30
|
+
* @param {FileSaveOptions} options Options for file, see defaults (ie. type, filename)
|
|
31
|
+
*/
|
|
32
|
+
constructor(data: any, options: FileSaveOptions);
|
|
33
|
+
options: any;
|
|
34
|
+
data: any;
|
|
35
|
+
blob: Blob;
|
|
36
|
+
url: string;
|
|
37
|
+
/**
|
|
38
|
+
* Remove the blob url
|
|
39
|
+
*/
|
|
40
|
+
destroy(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Get the blob url
|
|
43
|
+
*/
|
|
44
|
+
getUrl(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Create link element with blob as href
|
|
47
|
+
* @param {String} text The text to put in the link
|
|
48
|
+
*/
|
|
49
|
+
createLink(text: string): HTMLAnchorElement;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Options
|
|
53
|
+
*/
|
|
54
|
+
export type FileSaveOptions = {
|
|
55
|
+
/**
|
|
56
|
+
* Filename for blob when creating a link (ie createLink) [default "filesave-file.txt"]
|
|
57
|
+
*/
|
|
58
|
+
filename: string;
|
|
59
|
+
/**
|
|
60
|
+
* Filename for blob when creating a link (ie createLink) [default "text/plain;charset=utf-8"]
|
|
61
|
+
*/
|
|
62
|
+
type: string;
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=file-save.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-save.d.ts","sourceRoot":"","sources":["../../js/utils/file-save.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AAGH;;;;;;;;GAQG;AACH;IACE;;;MAGC;IAmCD;;OAEG;IACH,qCAEC;IAvCD;;;OAGG;IACH,gCAFW,eAAe,EAOzB;IAJC,aAA4D;IAC5D,UAAgB;IAChB,WAAyD;IACzD,YAAyC;IAE3C;;OAEG;IACH,gBAEC;IACD;;OAEG;IACH,iBAEC;IACD;;;OAGG;IACH,4CAOC;CAOF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {Object} elements Elements (trigger, content, and optionally contentArrow)
|
|
4
|
+
* @param {*} options Configuration options for floatingUi
|
|
5
|
+
* @returns {Function} floating cleanup function call when no longer needed
|
|
6
|
+
*/
|
|
7
|
+
export function createFloatingUi(elements: any, config: any): Function;
|
|
8
|
+
export namespace defaults {
|
|
9
|
+
let strategy: string;
|
|
10
|
+
let placement: string;
|
|
11
|
+
let inline: boolean;
|
|
12
|
+
namespace offset {
|
|
13
|
+
let mainAxis: number;
|
|
14
|
+
}
|
|
15
|
+
let shift: boolean;
|
|
16
|
+
let flip: boolean;
|
|
17
|
+
let arrow: boolean;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=floating-ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floating-ui.d.ts","sourceRoot":"","sources":["../../js/utils/floating-ui.js"],"names":[],"mappings":"AA0BA;;;;;GAKG;AACH,uEAuCC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create new uid
|
|
3
|
+
*/
|
|
4
|
+
export function newId(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Sets an ID if element doesn't have one vie newUid
|
|
7
|
+
* @param {Node} element Element to make sure has an id
|
|
8
|
+
*/
|
|
9
|
+
export function ensureId(element: Node): void;
|
|
10
|
+
//# sourceMappingURL=id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../js/utils/id.js"],"names":[],"mappings":"AAMA;;GAEG;AACH,gCAEC;AAED;;;GAGG;AACH,kCAFW,IAAI,QAMd"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * as classLogger from "./class-logger.js";
|
|
2
|
+
export * as dom from "./dom.js";
|
|
3
|
+
export * as floatingUi from "./floating-ui.js";
|
|
4
|
+
export * as id from "./id.js";
|
|
5
|
+
export * as index from "./index.js";
|
|
6
|
+
export * as pauseYoutubeVideo from "./pause-youtube-video.js";
|
|
7
|
+
export * as fileSave from "./file-save.js";
|
|
8
|
+
declare namespace ___Users_joescherben_Personal_Projects_ULU_frontend_js_utils_index_ { }
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../js/utils/index.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pause-youtube-video.d.ts","sourceRoot":"","sources":["../../js/utils/pause-youtube-video.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,sCAFW,OAAO,GAAC,IAAI,QAWtB;AACD;;;;GAIG;AACH,qDAQC"}
|
package/js/helpers/file-save.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module helpers/file-save
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
// Description: Simple script that is useful for testing. It will:
|
|
6
|
-
// - Make a file
|
|
7
|
-
// - Create a URL to it
|
|
8
|
-
// - Gives utility function to create a link to the file (for front end)
|
|
9
|
-
// - Gives method to destroy the file when no longer needed
|
|
10
|
-
// - User can redefine the program by passing options object matching props.
|
|
11
|
-
|
|
12
|
-
// Dependencies: No
|
|
13
|
-
|
|
14
|
-
// Support: Limited to knew browsers that support Blob(), also user preferences or
|
|
15
|
-
// type of browser may limit access to Blob functionality
|
|
16
|
-
|
|
17
|
-
// Related Docs:
|
|
18
|
-
// - https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob
|
|
19
|
-
// - https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
|
|
20
|
-
// - https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class FileSave {
|
|
24
|
-
constructor(data, options) {
|
|
25
|
-
this.filename = "filesave-file.txt";
|
|
26
|
-
this.type = "text/plain;charset=utf-8";
|
|
27
|
-
// Allow user to override above
|
|
28
|
-
if (options) Object.assign(this, options);
|
|
29
|
-
this.data = data;
|
|
30
|
-
this.blob = new Blob([data], { type: this.type });
|
|
31
|
-
this.url = URL.createObjectURL(this.blob);
|
|
32
|
-
}
|
|
33
|
-
destroy() {
|
|
34
|
-
return URL.revokeObjectURL(this.url);
|
|
35
|
-
}
|
|
36
|
-
getUrl() {
|
|
37
|
-
return this.url;
|
|
38
|
-
}
|
|
39
|
-
createLink(text) {
|
|
40
|
-
var link = d.createElement('a');
|
|
41
|
-
text = d.createTextNode(text);
|
|
42
|
-
link.setAttribute('download', this.filename);
|
|
43
|
-
link.setAttribute('href', this.url);
|
|
44
|
-
link.appendChild(text);
|
|
45
|
-
return link;
|
|
46
|
-
}
|
|
47
|
-
static isBrowserSupported() {
|
|
48
|
-
return "FileReader" in window;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export default FileSave;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module helpers/scrollbar-width-property
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Sets a CSS custom property equal to the scrollbar width
|
|
7
|
-
* @param {Node} element The element that is the child of a scrollabel container
|
|
8
|
-
* @param {Node} container The container that can be scrolled
|
|
9
|
-
* @param {Stirng} propName Custom property to set
|
|
10
|
-
*/
|
|
11
|
-
export default function addScrollbarProperty(element = document.body, container = window, propName = "--scrollbar-width") {
|
|
12
|
-
const scrollbarWidth = container.innerWidth - element.clientWidth;
|
|
13
|
-
element.style.setProperty(propName, `${ scrollbarWidth }px`);
|
|
14
|
-
}
|
package/project.todo
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Bring in Vue components as a separate package:
|
|
2
|
-
☐ Decided that vue stuff should stay seperate as we wouldn't want to udpate this library to make changes to vue components (as vue changes over time)
|
|
3
|
-
☐ This other module may use peer deps or something to limit which version of ulu it works with
|
|
4
|
-
Todos:
|
|
5
|
-
☐ Do we need some way to go back to older docs?
|
|
6
|
-
- Think this is overkill until there is a major revision
|
|
7
|
-
☐ SCSS
|
|
8
|
-
☐ Add line-height-densest typography utility class
|
|
9
|
-
☐ Remove clearfix, or at least in any outputted styles
|
|
10
|
-
☐ Need to add guide about how you can use the modules (ie by chaining or individually)
|
|
11
|
-
☐ Need to add guide about configuration
|
|
12
|
-
☐ Bring in common components
|
|
13
|
-
* Only what we would want to support in the core library!
|
|
14
|
-
* More specific modules should probably be handled like the vue components
|
|
15
|
-
* Any module added should likely stay in the library indefinetly, so modules that are more opionated or used as infrequently should probably be made into their own package. Or if they don't seem like they have a future omitted
|
|
16
|
-
☐ badge
|
|
17
|
-
☐ tag
|
|
18
|
-
☐ card
|
|
19
|
-
☐ card grid
|
|
20
|
-
☐ spinner
|
|
21
|
-
Ideas:
|
|
22
|
-
☐ Add scaffolding @idea
|
package/scss/_calculate.scss
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
/// @group calculate
|
|
3
|
-
////
|
|
4
|
-
|
|
5
|
-
@use "sass:math";
|
|
6
|
-
@use "sass:map";
|
|
7
|
-
@use "utils";
|
|
8
|
-
|
|
9
|
-
/// Module Settings
|
|
10
|
-
/// @type Map
|
|
11
|
-
/// @prop {Number} $config.responsive-change Default responsive amount to modify items using responsive-property mixin
|
|
12
|
-
|
|
13
|
-
$config: (
|
|
14
|
-
"responsive-change": 0.5vw
|
|
15
|
-
) !default;
|
|
16
|
-
|
|
17
|
-
/// Change modules $config
|
|
18
|
-
/// @param {Map} $changes Map of changes
|
|
19
|
-
/// @include module-name.set(( "property" : value ));
|
|
20
|
-
@mixin set($changes) {
|
|
21
|
-
$config: map.merge($config, $changes) !global;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/// Get a config option
|
|
25
|
-
/// @param {Map} $name Name of property
|
|
26
|
-
/// @include module-name.get("property");
|
|
27
|
-
|
|
28
|
-
@function get($name) {
|
|
29
|
-
@return utils.require-map-get($config, $name, "calculate [config]");
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/// Calculate the size of something at a given scale (percentage/exponential)
|
|
33
|
-
/// @param {Number} $base The number the scale starts at
|
|
34
|
-
/// @param {Number} $ratio The amount the scale changes over one set
|
|
35
|
-
/// @param {Number} $sizes The number of steps in the scale
|
|
36
|
-
/// @param {Number} $size The step you are trying to calculate
|
|
37
|
-
/// @return {Number}
|
|
38
|
-
|
|
39
|
-
@function ratio-scale-size($base, $ratio, $sizes, $size) {
|
|
40
|
-
@return $base * math.pow($ratio, math.div($size, $sizes));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/// Convert from pixel to em
|
|
44
|
-
/// @param {Number} $pixels The number the scale starts at
|
|
45
|
-
/// @param {Number} $base How many pixels equal 1em
|
|
46
|
-
/// @return {Number} Em Conversion
|
|
47
|
-
|
|
48
|
-
@function pixel-to-em($pixels, $base: 16px) {
|
|
49
|
-
@return math.div($pixels, $base) + 1em;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/// Provides user with a fallback for a calc that's just an enhancement
|
|
53
|
-
/// @param {String} $property The CSS property to set
|
|
54
|
-
/// @param {*} $value The value to set on the property
|
|
55
|
-
/// @param {Css} $responsive-change The amount to change (vw or vh units) (combined with unit past)
|
|
56
|
-
|
|
57
|
-
@mixin responsive-property(
|
|
58
|
-
$property,
|
|
59
|
-
$value,
|
|
60
|
-
$responsive-change: get("responsive-change")
|
|
61
|
-
) {
|
|
62
|
-
#{ $property } : $value;
|
|
63
|
-
#{ $property } : calc(#{ $value } + #{ $responsive-change });
|
|
64
|
-
}
|
package/scss/_utility.scss
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
////
|
|
2
|
-
/// @group utility
|
|
3
|
-
////
|
|
4
|
-
|
|
5
|
-
@use "sass:math";
|
|
6
|
-
|
|
7
|
-
/// Strips the unit from the number
|
|
8
|
-
/// @link https://stackoverflow.com/questions/12328259/how-do-you-strip-the-unit-from-any-number-in-sass/12335841#12335841 Orginal source (Miriam Suzanne)
|
|
9
|
-
|
|
10
|
-
@function strip-unit($value) {
|
|
11
|
-
@return math.div($value, ($value * 0 + 1));
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"css-breakpoint.d.ts","sourceRoot":"","sources":["../../js/helpers/css-breakpoint.js"],"names":[],"mappings":"AAeA;;;;GAIG;AACH;IACE,wBAAsB;IACtB;;;;;;;MAOC;IACD;;;;;;;OAOG;IACH;QANyB,KAAK;QACL,cAAc;QACd,eAAe;QAChB,OAAO,EAApB,IAAI;QACW,cAAc;OAevC;IAXC,YAAkB;IAClB,cAAoB;IACpB,iBAAuB;IACvB,wBAA2B;IAC3B,mBAAyB;IACzB,gBAAqB;IACrB,yBAA2B;IAM7B;;;;;OAKG;IACH,mCAEC;IACD;;;OAGG;IACH,yCAEC;IACD;;OAEG;IACH,gCAEC;IACD;;OAEG;IACH,kCAEC;IACD;;OAEG;IACH,wBAMC;IACD;;OAEG;IACH,eA6CC;IACD;;;;OAIG;IACH,kBAFY,UAAU,CAQrB;CACF;;AAsED;;;GAGG;AACH;IACE,qCAQC;IAPC;;;;MAIC;IACD,cAAuB;IACvB,UAAgB;IAElB;;;;;OAKG;IACH,wDAEC;IACD;;;;;OAKG;IACH,6BAEC;IACD;;;;;OAKG;IACH,6BAEC;IACD;;;OAGG;IACH,8BAEC;IACD;;;;OAIG;IACH,mDAGC;IAED,yBAGC;CACF;AAnID;;;GAGG;AACH;IACE,6CAMC;IALC,eAA0B;IAC1B,gBAAmB;IACnB,UAAY;IACZ,WAAa;IACb,gBAA4B;IAE9B;;OAEG;IACH,sBAMC;IACD;;OAEG;IACH,4BAIC;IACD;;OAEG;IACH,+BAEC;IACD;;;;;OAKG;IACH,aAJW,cAAe,QAiBzB;IACD;;OAEG;IACH,2BAQC;CACF"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export default FileSave;
|
|
2
|
-
/**
|
|
3
|
-
* @module helpers/file-save
|
|
4
|
-
*/
|
|
5
|
-
declare class FileSave {
|
|
6
|
-
static isBrowserSupported(): boolean;
|
|
7
|
-
constructor(data: any, options: any);
|
|
8
|
-
filename: string;
|
|
9
|
-
type: string;
|
|
10
|
-
data: any;
|
|
11
|
-
blob: Blob;
|
|
12
|
-
url: string;
|
|
13
|
-
destroy(): void;
|
|
14
|
-
getUrl(): string;
|
|
15
|
-
createLink(text: any): any;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=file-save.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-save.d.ts","sourceRoot":"","sources":["../../js/helpers/file-save.js"],"names":[],"mappings":";AAAA;;GAEG;AAoBH;IAwBE,qCAEC;IAzBD,qCAQC;IAPC,iBAAmC;IACnC,aAAsC;IAGtC,UAAgB;IAChB,WAAiD;IACjD,YAAyC;IAE3C,gBAEC;IACD,iBAEC;IACD,2BAOC;CAIF"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module helpers/node-data-manager
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Class that provides a method to store data based on node/element
|
|
6
|
-
*/
|
|
7
|
-
export default class NodeDataManager {
|
|
8
|
-
store: any[];
|
|
9
|
-
/**
|
|
10
|
-
* Get data for an element/node
|
|
11
|
-
* @param {Node} node Html Node/Element to get data for
|
|
12
|
-
* @param {String|Boolean} key If key is passed, return that key's data for the element, if falsey return elements complete dataset
|
|
13
|
-
*/
|
|
14
|
-
get(node: Node, key?: string | boolean): any;
|
|
15
|
-
/**
|
|
16
|
-
* Bind data to a specific Node/Element
|
|
17
|
-
* @param {Node} node Html Node/Element to get data for
|
|
18
|
-
* @param {String} key Key to save the data under
|
|
19
|
-
* @param {*} value Value to save
|
|
20
|
-
*/
|
|
21
|
-
set(node: Node, key: string, value: any): void;
|
|
22
|
-
/**
|
|
23
|
-
* Return an elements store object
|
|
24
|
-
*/
|
|
25
|
-
find(node: any): any;
|
|
26
|
-
/**
|
|
27
|
-
* Destroy all references to data and nodes/elements
|
|
28
|
-
*/
|
|
29
|
-
destroy(): void;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Child class that provides a store for one specific node/element
|
|
33
|
-
*/
|
|
34
|
-
export class NodeDataStore {
|
|
35
|
-
constructor(node: any, data: any);
|
|
36
|
-
node: any;
|
|
37
|
-
data: any;
|
|
38
|
-
set(key: any, value: any): void;
|
|
39
|
-
get(key?: boolean): any;
|
|
40
|
-
remove(key: any): void;
|
|
41
|
-
isNode(node: any): any;
|
|
42
|
-
clearData(): void;
|
|
43
|
-
destroy(): void;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=node-data-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-data-manager.d.ts","sourceRoot":"","sources":["../../js/helpers/node-data-manager.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH;IAEI,aAAe;IAEjB;;;;OAIG;IACH,UAHW,IAAI,QACJ,gBAAc,OAOxB;IACD;;;;;OAKG;IACH,UAJW,IAAI,iCAWd;IACD;;OAEG;IACH,qBAEC;IACD;;OAEG;IACH,gBAGC;CACF;AACD;;GAEG;AACH;IACE,kCAGC;IAFC,UAAgB;IAChB,UAAsB;IAExB,gCAEC;IACD,wBAEC;IACD,uBAEC;IACD,uBAEC;IACD,kBAEC;IACD,gBAGC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pause-youtube-video.d.ts","sourceRoot":"","sources":["../../js/helpers/pause-youtube-video.js"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,sCAFW,OAAO,GAAC,IAAI,QAWtB;AACD;;;;GAIG;AACH,qDAQC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module helpers/scrollbar-width-property
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Sets a CSS custom property equal to the scrollbar width
|
|
6
|
-
* @param {Node} element The element that is the child of a scrollabel container
|
|
7
|
-
* @param {Node} container The container that can be scrolled
|
|
8
|
-
* @param {Stirng} propName Custom property to set
|
|
9
|
-
*/
|
|
10
|
-
export default function addScrollbarProperty(element?: Node, container?: Node, propName?: Stirng): void;
|
|
11
|
-
//# sourceMappingURL=scrollbar-width-property.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scrollbar-width-property.d.ts","sourceRoot":"","sources":["../../js/helpers/scrollbar-width-property.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AACH,uDAJW,IAAI,cACJ,IAAI,2BAMd"}
|
package/types/ui/modals.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export function attachTriggers(context?: Document): void;
|
|
2
|
-
/**
|
|
3
|
-
* Function to setup each modal
|
|
4
|
-
* - Creates structure
|
|
5
|
-
* - Gets settings from elements data attrite
|
|
6
|
-
* - Moves it to the end of the document
|
|
7
|
-
* - Adds resizer if position (left || right)
|
|
8
|
-
* @param {Node} modal Modal element ie. `[data-site-modal]`
|
|
9
|
-
* @param {Object} settings Custom settings object to merge, same interface as `[data-site-modal]` settings
|
|
10
|
-
*/
|
|
11
|
-
export function setupModal(modal: Node, settings: any): void;
|
|
12
|
-
/**
|
|
13
|
-
* Intialize all modals on the page
|
|
14
|
-
* - can be used after AJAX adds content
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* Open a modal
|
|
18
|
-
* @param {String} id The id of the modal to open
|
|
19
|
-
*/
|
|
20
|
-
export function show(id: string, config: any): void;
|
|
21
|
-
/**
|
|
22
|
-
* Close a modal
|
|
23
|
-
* @param {String} id The id of the modal to open
|
|
24
|
-
*/
|
|
25
|
-
export function close(id: string): void;
|
|
26
|
-
export const triggerAttr: "data-site-modal-trigger";
|
|
27
|
-
//# sourceMappingURL=modals.d.ts.map
|
package/types/ui/modals.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modals.d.ts","sourceRoot":"","sources":["../../js/ui/modals.js"],"names":[],"mappings":"AA6DA,yDAeC;AAED;;;;;;;;GAQG;AACH,kCAHW,IAAI,uBAmFd;AACD;;;GAGG;AAIH;;;GAGG;AACH,oDAGC;AACD;;;GAGG;AACH,wCAEC;AAlKD,oDAA8C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../js/utils/logger.js"],"names":[],"mappings":"AAgCA;;;GAGG;AACH,wCAEC;AAED;;;;GAIG;AACH,+CAFe,GAAG,UAMjB;AAED;;;;GAIG;AACH,sDAFe,GAAG,UAMjB;AAED;;;;GAIG;AACH,oDAFe,GAAG,UAMjB"}
|
package/vite.config.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { dirname, resolve } from "path";
|
|
2
|
-
import { fileURLToPath } from "url";
|
|
3
|
-
import { defineConfig } from "vite";
|
|
4
|
-
import autoprefixer from "autoprefixer";
|
|
5
|
-
|
|
6
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
build: {
|
|
10
|
-
// target: "es2015",
|
|
11
|
-
// manifest: true,
|
|
12
|
-
minify: true,
|
|
13
|
-
cssMinify: true,
|
|
14
|
-
cssCodeSplit: false,
|
|
15
|
-
outDir: "dist",
|
|
16
|
-
rollupOptions: {
|
|
17
|
-
input: "dist-src/main.js",
|
|
18
|
-
output: {
|
|
19
|
-
entryFileNames: `ulu-frontend.min.js`,
|
|
20
|
-
assetFileNames: `ulu-frontend.min.[ext]`,
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
css: {
|
|
25
|
-
postcss: {
|
|
26
|
-
plugins: [
|
|
27
|
-
autoprefixer()
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
preprocessorOptions: {
|
|
31
|
-
scss: {
|
|
32
|
-
includePaths: [resolve(__dirname, `./scss`)],
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|