@ulu/frontend 0.2.0-beta.9 → 0.3.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.
Files changed (78) hide show
  1. package/README.dev.md +52 -13
  2. package/README.md +3 -1
  3. package/dist/es/core/events.js +36 -25
  4. package/dist/es/core/settings.js +33 -22
  5. package/dist/es/index.js +47 -45
  6. package/dist/es/ui/dialog.d.ts +3 -1
  7. package/dist/es/ui/dialog.d.ts.map +1 -1
  8. package/dist/es/ui/dialog.js +70 -53
  9. package/dist/es/ui/index.d.ts +1 -0
  10. package/dist/es/ui/modal-builder.d.ts +6 -0
  11. package/dist/es/ui/modal-builder.d.ts.map +1 -1
  12. package/dist/es/ui/modal-builder.js +66 -47
  13. package/dist/es/ui/overflow-scroller.js +30 -24
  14. package/dist/es/ui/proxy-click.js +37 -26
  15. package/dist/es/ui/resizer.js +57 -49
  16. package/dist/es/ui/slider.d.ts.map +1 -1
  17. package/dist/es/ui/slider.js +90 -67
  18. package/dist/es/ui/tab-manager.d.ts +145 -0
  19. package/dist/es/ui/tab-manager.d.ts.map +1 -0
  20. package/dist/es/ui/tab-manager.js +155 -0
  21. package/dist/es/ui/tabs.d.ts +5 -5
  22. package/dist/es/ui/tabs.d.ts.map +1 -1
  23. package/dist/es/ui/tabs.js +34 -51
  24. package/dist/es/ui/theme-toggle.js +80 -69
  25. package/dist/es/ui/tooltip.js +53 -44
  26. package/dist/es/utils/dialog.d.ts +14 -0
  27. package/dist/es/utils/dialog.d.ts.map +1 -0
  28. package/dist/es/utils/dialog.js +16 -0
  29. package/dist/es/utils/floating-ui.js +35 -24
  30. package/dist/es/utils/iframe.d.ts +15 -0
  31. package/dist/es/utils/iframe.d.ts.map +1 -0
  32. package/dist/es/utils/iframe.js +33 -0
  33. package/dist/umd/frontend.css +1 -0
  34. package/dist/umd/ulu-frontend.umd.js +40 -47
  35. package/lib/js/exports.md +1 -0
  36. package/lib/js/ui/dialog.js +23 -3
  37. package/lib/js/ui/index.js +4 -0
  38. package/lib/js/ui/modal-builder.js +21 -0
  39. package/lib/js/ui/slider.js +3 -3
  40. package/lib/js/ui/tab-manager.js +324 -0
  41. package/lib/js/ui/tabs.js +33 -92
  42. package/lib/js/utils/dialog.js +29 -0
  43. package/lib/js/utils/iframe.js +59 -0
  44. package/lib/scss/_breakpoint.scss +3 -3
  45. package/lib/scss/_button.scss +3 -3
  46. package/lib/scss/_color.scss +4 -3
  47. package/lib/scss/_element.scss +25 -4
  48. package/lib/scss/_layout.scss +11 -4
  49. package/lib/scss/_selector.scss +2 -1
  50. package/lib/scss/_typography.scss +9 -10
  51. package/lib/scss/_utils.scss +74 -19
  52. package/lib/scss/base/_elements.scss +4 -1
  53. package/lib/scss/components/_accordion.scss +7 -2
  54. package/lib/scss/components/_badge.scss +1 -1
  55. package/lib/scss/components/_basic-hero.scss +1 -1
  56. package/lib/scss/components/_button-group.scss +8 -3
  57. package/lib/scss/components/_button-verbose.scss +2 -2
  58. package/lib/scss/components/_callout.scss +3 -4
  59. package/lib/scss/components/_card-grid.scss +8 -14
  60. package/lib/scss/components/_card.scss +15 -13
  61. package/lib/scss/components/_css-icon.scss +2 -2
  62. package/lib/scss/components/_data-grid.scss +5 -5
  63. package/lib/scss/components/_data-list.scss +270 -0
  64. package/lib/scss/components/_data-table.scss +3 -1
  65. package/lib/scss/components/_flipcard.scss +3 -2
  66. package/lib/scss/components/_index.scss +18 -0
  67. package/lib/scss/components/_menu-stack.scss +1 -1
  68. package/lib/scss/components/_modal.scss +97 -19
  69. package/lib/scss/components/_panel.scss +1 -1
  70. package/lib/scss/components/_popover.scss +9 -6
  71. package/lib/scss/components/_ratio-box.scss +11 -10
  72. package/lib/scss/components/_table-scroller.scss +63 -0
  73. package/lib/scss/components/_tabs.scss +20 -5
  74. package/lib/scss/components/_tagged.scss +59 -0
  75. package/lib/scss/helpers/_utilities.scss +23 -1
  76. package/package.json +28 -35
  77. package/dist/umd/style.css +0 -1
  78. package/lib/js/ui/dialog.todo +0 -3
package/README.dev.md CHANGED
@@ -1,22 +1,61 @@
1
- # Development
1
+ # Development Overview
2
2
 
3
- ## Dist
3
+ ## System Architecture
4
4
 
5
- - Dist can be used standalone (browser, etc) (stylesheet with everything currently)
6
- - Used for examples in docs
7
- - Rebuild by running `npm run build`
5
+ The library is designed with a clear separation between styles (SCSS) and behavior (JavaScript). They are loosely coupled, interacting through CSS classes and data attributes in the HTML.
8
6
 
9
- ## Docs
7
+ * **SCSS:** Provides the styling layer. It is highly modular, with global settings (color, typography), base element styles, and individual component styles. The file `lib/scss/stylesheets/full.scss` compiles everything into a single, comprehensive stylesheet for easy consumption.
10
8
 
11
- ## Updating SCSS
9
+ * **JavaScript:** Provides interactivity. It is also modular, with `core` logic, `utility` functions, and `ui` components. The JavaScript is designed to be "tree-shakable," so a project using this library will only bundle the code for the components it actually uses.
12
10
 
13
- - Update sassdocs markdown by `npm run docs:update:scss`
11
+ ### How They Interact
14
12
 
15
- ## Updating JS Docs
13
+ 1. **Component Structure:** Components are composed of SCSS and JavaScript files. A component might be SCSS-only (providing styles for a static element), JavaScript-only (providing some background logic), or a pair of both that work together (e.g., `_tabs.scss` and `tabs.js`).
16
14
 
17
- - Run `npm run docs:build:js` to update jsdoc markdown
18
- - Run `npm run types` to update Typescript declarations (extracted from JS docs)
15
+ 2. **Initialization:** For components with JavaScript, an `init` function (e.g., `tabsInit`) is typically provided. This function scans the DOM for specific elements, usually identified by a `data-ulu-component` attribute.
19
16
 
20
- ## Building/Deploying
17
+ 3. **Styling Agnosticism:** A key design principle is that the JavaScript is styling-agnostic. It identifies and interacts with elements exclusively through `data-ulu-*` attributes, not CSS classes. This intentional separation means you can use the provided JavaScript functionality with completely custom component styling, simply by structuring your HTML with the correct data attributes.
21
18
 
22
- - Use `npm run docs:build`
19
+ 4. **Activation:** When an `init` function finds its corresponding component in the HTML, it instantiates a JavaScript class to manage its state and handle user interactions (like clicks or keyboard events).
20
+
21
+ 5. **State & Styling:** While the JavaScript itself is not tied to the SCSS styling, it does manage state by adding or removing state-based CSS classes (e.g., `.is-active`). The library's SCSS uses these classes to apply styles, and you can use them in your own stylesheets as well.
22
+
23
+ In short, the SCSS defines what components and their different states *look like*, while the JavaScript is responsible for activating components and changing their states based on user interaction. This creates a flexible and efficient system.
24
+
25
+ ## SCSS Development Conventions
26
+
27
+ When developing new SCSS components or maintaining existing ones, adhere to the following architectural patterns:
28
+
29
+ 1. **Configuration Property Naming:**
30
+ * Modifier-specific properties must begin with the modifier name.
31
+ * *Correct:* `clickable-background-color-hover`
32
+ * *Incorrect:* `background-color-clickable-hover`
33
+ * Responsive state variables should describe the *behavior*, not a hardcoded viewport/breakpoint name if possible. Example a component that stacks when on smaller screens might refer to that breakpoint as `stacked-breakpoint`
34
+
35
+ TODO: This section should be added to... (sassdoc type naming, etc). Formatting...
36
+
37
+ ## Documentation
38
+
39
+ - `site/`: Contains the source code for the documentation website (Eleventy). **Edit files here.**
40
+ - `docs/`: The build output for GitHub Pages. **Do not edit files here directly.**
41
+
42
+ ## Benchmark Notes
43
+
44
+ ### Javascript
45
+
46
+ - Old Vite 4
47
+ - No build.target
48
+ - /dist/es 183kb (js, types, etc)
49
+ - Included aria-tablist dep
50
+ - Wasn't minified
51
+ - Current Build (Vite 7)
52
+ - Javascript Bundle
53
+ - Uncompressed: ~74.7 kB
54
+ - Gzip: ~30 kB (less when actually bundled with tree-shaking)
55
+ - About the size of jquery or a small image
56
+ - CSS Bundle
57
+ - Uncompressed: ~139 kB
58
+ - Gzip: ~21 kB (compresses well)
59
+ - In a real project not using every scss module
60
+ - Uncompressed: ~80-100 kB
61
+ - Gzip: ~13-16 kB
package/README.md CHANGED
@@ -6,11 +6,13 @@ Versatile frontend toolkit designed for a variety of web development scenarios.
6
6
 
7
7
  ## key Features
8
8
 
9
+ - **Lightweight Footprint:** The core library is very small, with the full UMD JavaScript bundle at ~20kb (gzipped) and the complete CSS bundle at ~19kb (gzipped). With tree-shaking and modular SCSS, the final footprint in a project is often even smaller.
9
10
  - **Target Environment:** The JavaScript "UI" modules are specifically tailored for traditional sites, such as static websites and CMS-driven platforms. However, the comprehensive SCSS modules are fully compatible and can be utilized in modern JavaScript applications built with frameworks like React or Vue.
10
11
  - **Configuration & Consistency:** The system's main goal is to allow for highly flexible, per-site configuration while maintaining a consistent set of accessible and high-quality components.
11
12
  - **Flexible Usage:** This library is designed as a toolkit, offering the flexibility to be used as a complete stylesheet solution or to pick and choose individual SCSS modules and components as needed.
13
+ - **Styling Agnostic JavaScript:** The JavaScript components use `data-*` attributes for behavior, not CSS classes. This means you can use the powerful JavaScript-driven interactions with your own custom-styled components.
12
14
  - **Integration Adaptability:** All SCSS base selectors (for components, utilities, etc.) can be easily adjusted, making it highly adaptable for seamless integration into pre-existing systems and diverse development environments.
13
- - API Documentation for both SCSS and JS with examples
15
+ - **API Documentation:** API Documentation for both SCSS and JS with demos
14
16
 
15
17
  ## Related Links
16
18
 
@@ -1,45 +1,56 @@
1
- import { debounce as s } from "@ulu/utils/performance.js";
2
- import { isBrowser as a } from "@ulu/utils/browser/dom.js";
3
- a() && (u(), f());
4
- const i = {
1
+ var u = Object.defineProperty;
2
+ var d = Object.getOwnPropertySymbols;
3
+ var f = Object.prototype.hasOwnProperty, v = Object.prototype.propertyIsEnumerable;
4
+ var s = (e, n, t) => n in e ? u(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t, a = (e, n) => {
5
+ for (var t in n || (n = {}))
6
+ f.call(n, t) && s(e, t, n[t]);
7
+ if (d)
8
+ for (var t of d(n))
9
+ v.call(n, t) && s(e, t, n[t]);
10
+ return e;
11
+ };
12
+ import { debounce as l } from "@ulu/utils/performance.js";
13
+ import { isBrowser as p } from "@ulu/utils/browser/dom.js";
14
+ p() && (b(), m());
15
+ const r = {
5
16
  pageModified(e) {
6
- e.dispatchEvent(n("pageModified"));
17
+ e.dispatchEvent(i("pageModified"));
7
18
  },
8
19
  pageResized(e) {
9
- e.dispatchEvent(n("pageResized"));
20
+ e.dispatchEvent(i("pageResized"));
10
21
  },
11
22
  beforePrint(e) {
12
- e.dispatchEvent(n("beforePrint"));
23
+ e.dispatchEvent(i("beforePrint"));
13
24
  },
14
25
  afterPrint(e) {
15
- e.dispatchEvent(n("afterPrint"));
26
+ e.dispatchEvent(i("afterPrint"));
16
27
  }
17
- }, c = Object.keys(i);
18
- function r(e, t) {
19
- i[e] ? i[e](t) : console.warn(`Unable to dispatch non-core event: ${e}`);
28
+ }, E = Object.keys(r);
29
+ function o(e, n) {
30
+ r[e] ? r[e](n) : console.warn(`Unable to dispatch non-core event: ${e}`);
20
31
  }
21
- function o(e) {
32
+ function c(e) {
22
33
  return "ulu:" + e;
23
34
  }
24
- function p(e) {
25
- return c.includes(e) ? o(e) : (console.warn(`'${e}' is not a valid core event type.`), null);
35
+ function h(e) {
36
+ return E.includes(e) ? c(e) : (console.warn(`'${e}' is not a valid core event type.`), null);
26
37
  }
27
- function n(e, t = null, d = { bubbles: !0 }) {
28
- return new CustomEvent(o(e), { detail: t, ...d });
38
+ function i(e, n = null, t = { bubbles: !0 }) {
39
+ return new CustomEvent(c(e), a({ detail: n }, t));
29
40
  }
30
- function u() {
31
- window.addEventListener("resize", s(() => r("pageResized", document), 250));
41
+ function b() {
42
+ window.addEventListener("resize", l(() => o("pageResized", document), 250));
32
43
  }
33
- function f() {
44
+ function m() {
34
45
  window.addEventListener("beforeprint", () => {
35
- r("beforePrint", document);
46
+ o("beforePrint", document);
36
47
  }), window.addEventListener("afterprint", () => {
37
- r("afterPrint", document);
48
+ o("afterPrint", document);
38
49
  });
39
50
  }
40
51
  export {
41
- n as createUluEvent,
42
- r as dispatchCoreEvent,
43
- p as getCoreEventName,
44
- o as getUluEventName
52
+ i as createUluEvent,
53
+ o as dispatchCoreEvent,
54
+ h as getCoreEventName,
55
+ c as getUluEventName
45
56
  };
@@ -1,4 +1,15 @@
1
- const c = {
1
+ var a = Object.defineProperty;
2
+ var i = Object.getOwnPropertySymbols;
3
+ var g = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
4
+ var o = (n, t, s) => t in n ? a(n, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : n[t] = s, c = (n, t) => {
5
+ for (var s in t || (t = {}))
6
+ g.call(t, s) && o(n, s, t[s]);
7
+ if (i)
8
+ for (var s of i(t))
9
+ u.call(t, s) && o(n, s, t[s]);
10
+ return n;
11
+ };
12
+ const r = {
2
13
  iconClassClose: "css-icon css-icon--close",
3
14
  iconClassDragX: "css-icon css-icon--drag-x",
4
15
  iconClassDragBoth: "css-icon css-icon--drag-both",
@@ -6,39 +17,39 @@ const c = {
6
17
  iconClassNext: "css-icon css-icon--angle-right",
7
18
  cssvarPrefix: ""
8
19
  };
9
- let t = { ...c };
10
- function o() {
11
- return { ...c };
20
+ let e = c({}, r);
21
+ function S() {
22
+ return c({}, r);
12
23
  }
13
- function r(n) {
14
- Object.assign(t, n);
24
+ function d(n) {
25
+ Object.assign(e, n);
15
26
  }
16
- function a() {
17
- return { ...t };
27
+ function p() {
28
+ return c({}, e);
18
29
  }
19
- function i(n) {
20
- if (!t.hasOwnProperty(n)) {
30
+ function l(n) {
31
+ if (!e.hasOwnProperty(n)) {
21
32
  console.warn(`Attempted to access non-existent setting: ${n}`);
22
33
  return;
23
34
  }
24
- return t[n];
35
+ return e[n];
25
36
  }
26
- function g(n, s) {
27
- t[n] = s;
37
+ function C(n, t) {
38
+ e[n] = t;
28
39
  }
29
- function u(n, s) {
40
+ function x(n, t) {
30
41
  return {
31
42
  toString() {
32
- const e = i(n);
33
- return s ? s(e) : e;
43
+ const s = l(n);
44
+ return t ? t(s) : s;
34
45
  }
35
46
  };
36
47
  }
37
48
  export {
38
- o as getDefaultSettings,
39
- i as getSetting,
40
- a as getSettings,
41
- g as updateSetting,
42
- r as updateSettings,
43
- u as wrapSettingString
49
+ S as getDefaultSettings,
50
+ l as getSetting,
51
+ p as getSettings,
52
+ C as updateSetting,
53
+ d as updateSettings,
54
+ x as wrapSettingString
44
55
  };
package/dist/es/index.js CHANGED
@@ -4,8 +4,8 @@ import { ComponentInitializer as m } from "./core/component.js";
4
4
  import { BreakpointManager as I } from "./ui/breakpoints.js";
5
5
  import { Collapsible as z } from "./ui/collapsible.js";
6
6
  import { init as D, initializer as C, setupGroup as v } from "./ui/details-group.js";
7
- import { baseAttribute as y, closeAttribute as T, defaults as B, getDialogOptions as P, init as h, initializer as A, setDefaults as k, setupDialog as G, setupTrigger as L } from "./ui/dialog.js";
8
- import { Flipcard as w, init as M, initializer as U } from "./ui/flipcard.js";
7
+ import { baseAttribute as T, closeAttribute as y, defaults as B, getDialogOptions as P, init as h, initializer as A, setDefaults as k, setupDialog as G, setupTrigger as L } from "./ui/dialog.js";
8
+ import { Flipcard as M, init as w, initializer as U } from "./ui/flipcard.js";
9
9
  import { init as F, initializer as O } from "./ui/grid.js";
10
10
  import { buildModal as N, defaults as R, init as W, initializer as K, setDefaults as j } from "./ui/modal-builder.js";
11
11
  import { ProgrammaticModalManager as J } from "./ui/programmatic-modal.js";
@@ -18,43 +18,45 @@ import { init as ue } from "./ui/print.js";
18
18
  import { attachHandlers as de, defaults as me, init as xe, initializer as Ie, setDefaults as ce, setupProxy as ze } from "./ui/proxy-click.js";
19
19
  import { Resizer as De } from "./ui/resizer.js";
20
20
  import { init as ve, initializer as be } from "./ui/scroll-slider.js";
21
- import { Scrollpoint as Te, init as Be, initializer as Pe } from "./ui/scrollpoint.js";
21
+ import { Scrollpoint as ye, init as Be, initializer as Pe } from "./ui/scrollpoint.js";
22
22
  import { Slider as Ae, init as ke, initializer as Ge, setupSlider as Le } from "./ui/slider.js";
23
- import { init as we, initializer as Me, instances as Ue, setup as Ve } from "./ui/tabs.js";
24
- import { defaults as Oe, init as He, initializer as Ne, setDefaults as Re, setupToggle as We } from "./ui/theme-toggle.js";
25
- import { Tooltip as je, init as qe, initializer as Je } from "./ui/tooltip.js";
26
- import { log as Xe, logError as Ye, logWarning as Ze, set as _e } from "./utils/class-logger.js";
27
- import { dataAttributeToDatasetKey as et, resolveClasses as tt, setPositionClasses as it } from "./utils/dom.js";
28
- import { FileSave as at } from "./utils/file-save.js";
29
- import { createFloatingUi as st, defaults as lt } from "./utils/floating-ui.js";
30
- import { configureIcons as pt } from "./utils/font-awesome.js";
31
- import { ensureId as ut, newId as ft } from "./utils/id.js";
32
- import { pauseVideos as mt, prepVideos as xt } from "./utils/pause-youtube-video.js";
23
+ import { TabManager as Me } from "./ui/tab-manager.js";
24
+ import { init as Ue, initializer as Ve, instances as Fe, setup as Oe } from "./ui/tabs.js";
25
+ import { defaults as Ne, init as Re, initializer as We, setDefaults as Ke, setupToggle as je } from "./ui/theme-toggle.js";
26
+ import { Tooltip as Je, init as Qe, initializer as Xe } from "./ui/tooltip.js";
27
+ import { log as Ze, logError as _e, logWarning as $e, set as et } from "./utils/class-logger.js";
28
+ import { dataAttributeToDatasetKey as it, resolveClasses as rt, setPositionClasses as at } from "./utils/dom.js";
29
+ import { FileSave as st } from "./utils/file-save.js";
30
+ import { createFloatingUi as nt, defaults as pt } from "./utils/floating-ui.js";
31
+ import { configureIcons as ut } from "./utils/font-awesome.js";
32
+ import { ensureId as dt, newId as mt } from "./utils/id.js";
33
+ import { pauseVideos as It, prepVideos as ct } from "./utils/pause-youtube-video.js";
33
34
  export {
34
35
  I as BreakpointManager,
35
36
  z as Collapsible,
36
37
  m as ComponentInitializer,
37
- at as FileSave,
38
- w as Flipcard,
38
+ st as FileSave,
39
+ M as Flipcard,
39
40
  X as OverflowScroller,
40
41
  te as Popover,
41
42
  J as ProgrammaticModalManager,
42
43
  De as Resizer,
43
- Te as Scrollpoint,
44
+ ye as Scrollpoint,
44
45
  Ae as Slider,
45
- je as Tooltip,
46
- Xe as classLoggerLog,
47
- Ye as classLoggerLogError,
48
- Ze as classLoggerLogWarning,
49
- _e as classLoggerSet,
50
- st as createFloatingUi,
46
+ Me as TabManager,
47
+ Je as Tooltip,
48
+ Ze as classLoggerLog,
49
+ _e as classLoggerLogError,
50
+ $e as classLoggerLogWarning,
51
+ et as classLoggerSet,
52
+ nt as createFloatingUi,
51
53
  i as createUluEvent,
52
- et as dataAttributeToDatasetKey,
54
+ it as dataAttributeToDatasetKey,
53
55
  D as detailsGroupInit,
54
56
  C as detailsGroupInitializer,
55
57
  v as detailsGroupSetupGroup,
56
- y as dialogBaseAttribute,
57
- T as dialogCloseAttribute,
58
+ T as dialogBaseAttribute,
59
+ y as dialogCloseAttribute,
58
60
  B as dialogDefaults,
59
61
  P as dialogGetDialogOptions,
60
62
  h as dialogInit,
@@ -63,11 +65,11 @@ export {
63
65
  G as dialogSetupDialog,
64
66
  L as dialogSetupTrigger,
65
67
  r as dispatchCoreEvent,
66
- ut as ensureId,
67
- M as flipcardInit,
68
+ dt as ensureId,
69
+ w as flipcardInit,
68
70
  U as flipcardInitializer,
69
- lt as floatingUiDefaults,
70
- pt as fontAwesomeConfigureIcons,
71
+ pt as floatingUiDefaults,
72
+ ut as fontAwesomeConfigureIcons,
71
73
  a as getCoreEventName,
72
74
  l as getDefaultSettings,
73
75
  n as getSetting,
@@ -80,7 +82,7 @@ export {
80
82
  W as modalBuilderInit,
81
83
  K as modalBuilderInitializer,
82
84
  j as modalBuilderSetDefaults,
83
- ft as newId,
85
+ mt as newId,
84
86
  Z as overflowScrollerCreatePager,
85
87
  $ as pageInit,
86
88
  ie as popoverGetContentByTrigger,
@@ -97,29 +99,29 @@ export {
97
99
  Ie as proxyClickInitializer,
98
100
  ce as proxyClickSetDefaults,
99
101
  ze as proxyClickSetupProxy,
100
- tt as resolveClasses,
102
+ rt as resolveClasses,
101
103
  ve as scrollSliderInit,
102
104
  be as scrollSliderInitializer,
103
105
  Be as scrollpointInit,
104
106
  Pe as scrollpointInitializer,
105
- it as setPositionClasses,
107
+ at as setPositionClasses,
106
108
  ke as sliderInit,
107
109
  Ge as sliderInitializer,
108
110
  Le as sliderSetupSlider,
109
- we as tabsInit,
110
- Me as tabsInitializer,
111
- Ue as tabsInstances,
112
- Ve as tabsSetup,
113
- Oe as themeToggleDefaults,
114
- He as themeToggleInit,
115
- Ne as themeToggleInitializer,
116
- Re as themeToggleSetDefaults,
117
- We as themeToggleSetupToggle,
118
- qe as tooltipInit,
119
- Je as tooltipInitializer,
111
+ Ue as tabsInit,
112
+ Ve as tabsInitializer,
113
+ Fe as tabsInstances,
114
+ Oe as tabsSetup,
115
+ Ne as themeToggleDefaults,
116
+ Re as themeToggleInit,
117
+ We as themeToggleInitializer,
118
+ Ke as themeToggleSetDefaults,
119
+ je as themeToggleSetupToggle,
120
+ Qe as tooltipInit,
121
+ Xe as tooltipInitializer,
120
122
  g as updateSetting,
121
123
  u as updateSettings,
122
124
  f as wrapSettingString,
123
- mt as youtubePauseVideos,
124
- xt as youtubePrepVideos
125
+ It as youtubePauseVideos,
126
+ ct as youtubePrepVideos
125
127
  };
@@ -18,7 +18,9 @@ export function setupTrigger(trigger: Node, dialogId: string): void;
18
18
  * Setup click handlers for a dialog
19
19
  * @param {Node} dialog
20
20
  */
21
- export function setupDialog(dialog: Node, userOptions: any): void;
21
+ export function setupDialog(dialog: Node, userOptions: any): {
22
+ destroy: () => void;
23
+ };
22
24
  /**
23
25
  * For a given dialog, get it's options (from data attribute)
24
26
  * @param {Node} dialog
@@ -1 +1 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../lib/js/ui/dialog.js"],"names":[],"mappings":"AA6DA;;GAEG;AACH,qCAFW,MAAM,QAIhB;AAED;;;GAGG;AACH,6BAqBC;AAED;;;;GAIG;AACH,sCAHW,IAAI,0BA2Bd;AAED;;;GAGG;AACH,oCAFW,IAAI,0BA6Dd;AAED;;;;GAIG;AACH,yCAHW,IAAI,GACF,MAAM,CAIlB;AA7LD;;GAEG;AACH,4BAA6B,iBAAiB,CAAC;AAE/C;;GAEG;AACH,+CAAuF;AAEvF;;GAEG;AACH,oCAAgE;;;;;;;;;qCAjB3B,sBAAsB"}
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../lib/js/ui/dialog.js"],"names":[],"mappings":"AA8DA;;GAEG;AACH,qCAFW,MAAM,QAIhB;AAED;;;GAGG;AACH,6BAqBC;AAED;;;;GAIG;AACH,sCAHW,IAAI,0BA2Bd;AAED;;;GAGG;AACH,oCAFW,IAAI;;EAgFd;AAED;;;;GAIG;AACH,yCAHW,IAAI,GACF,MAAM,CAIlB;AAhND;;GAEG;AACH,4BAA6B,iBAAiB,CAAC;AAE/C;;GAEG;AACH,+CAAuF;AAEvF;;GAEG;AACH,oCAAgE;;;;;;;;;qCAlB3B,sBAAsB"}
@@ -1,8 +1,20 @@
1
- import { getUluEventName as f } from "../core/events.js";
2
- import { ComponentInitializer as v } from "../core/component.js";
3
- import { preventScroll as h, wasClickOutside as E } from "@ulu/utils/browser/dom.js";
4
- import { prepVideos as O, pauseVideos as S } from "../utils/pause-youtube-video.js";
5
- const b = "data-ulu-dialog", i = new v({ type: "dialog", baseAttribute: b }), F = i.getAttribute("close"), V = {
1
+ var S = Object.defineProperty;
2
+ var p = Object.getOwnPropertySymbols;
3
+ var D = Object.prototype.hasOwnProperty, O = Object.prototype.propertyIsEnumerable;
4
+ var f = (e, o, t) => o in e ? S(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, m = (e, o) => {
5
+ for (var t in o || (o = {}))
6
+ D.call(o, t) && f(e, t, o[t]);
7
+ if (p)
8
+ for (var t of p(o))
9
+ O.call(o, t) && f(e, t, o[t]);
10
+ return e;
11
+ };
12
+ import { getUluEventName as g } from "../core/events.js";
13
+ import { ComponentInitializer as V } from "../core/component.js";
14
+ import { wasClickOutside as C, preventScroll as k } from "@ulu/utils/browser/dom.js";
15
+ import { prepVideos as w, pauseVideos as y } from "../utils/pause-youtube-video.js";
16
+ import { observeDialogToggle as z } from "../utils/dialog.js";
17
+ const L = "data-ulu-dialog", r = new V({ type: "dialog", baseAttribute: L }), G = r.getAttribute("close"), M = {
6
18
  /**
7
19
  * Use non-modal interface for dialog
8
20
  */
@@ -30,83 +42,88 @@ const b = "data-ulu-dialog", i = new v({ type: "dialog", baseAttribute: b }), F
30
42
  */
31
43
  preventScrollShift: !0
32
44
  };
33
- let a = { ...V };
34
- function R(e) {
45
+ let a = m({}, M);
46
+ function H(e) {
35
47
  a = Object.assign({}, a, e);
36
48
  }
37
- function T() {
38
- i.init({
49
+ function J() {
50
+ r.init({
39
51
  coreEvents: ["pageModified"],
40
52
  withData: !0,
41
- setup({ element: e, initialize: s, data: t }) {
42
- C(e, t), s();
53
+ setup({ element: e, initialize: o, data: t }) {
54
+ I(e, t), o();
43
55
  }
44
- }), i.init({
56
+ }), r.init({
45
57
  key: "trigger",
46
58
  coreEvents: ["pageModified"],
47
59
  withData: !0,
48
- setup({ element: e, initialize: s, data: t }) {
49
- w(e, t), s();
60
+ setup({ element: e, initialize: o, data: t }) {
61
+ A(e, t), o();
50
62
  }
51
63
  });
52
64
  }
53
- function w(e, s) {
65
+ function A(e, o) {
54
66
  e.addEventListener("click", t);
55
- function t(r) {
67
+ function t(l) {
56
68
  var c;
57
- r.target.closest("a") && r.preventDefault();
58
- const o = document.getElementById(s);
59
- if (!o) {
60
- console.error("Could not locate dialog (id)", s);
69
+ l.target.closest("a") && l.preventDefault();
70
+ const n = document.getElementById(o);
71
+ if (!n) {
72
+ console.error("Could not locate dialog (id)", o);
61
73
  return;
62
74
  }
63
- if (((c = o == null ? void 0 : o.tagName) == null ? void 0 : c.toLowerCase()) !== "dialog") {
75
+ if (((c = n == null ? void 0 : n.tagName) == null ? void 0 : c.toLowerCase()) !== "dialog") {
64
76
  console.error("Attempted to trigger non <dialog> element. Did you mean to use modal builder?");
65
77
  return;
66
78
  }
67
- const u = D(o);
68
- o[u.nonModal ? "show" : "showModal"]();
79
+ const i = R(n);
80
+ n[i.nonModal ? "show" : "showModal"]();
69
81
  }
70
82
  }
71
- function C(e, s) {
72
- const t = Object.assign({}, a, s), r = document.body, { preventScrollShift: d } = t;
73
- let o;
74
- if (e.addEventListener(f("resizer:start"), c), e.addEventListener(f("resizer:end"), m), e.addEventListener("click", u), t.documentEnd && r.appendChild(e), t.pauseVideos && k(e), !t.nonModal && t.preventScroll) {
75
- let n;
76
- e.addEventListener("toggle", (l) => {
77
- l.newState === "open" ? n = h({ preventShift: d }) : n && n();
83
+ function I(e, o) {
84
+ const t = Object.assign({}, a, o), l = document.body, { preventScrollShift: d } = t;
85
+ let n = null, i;
86
+ if (e.addEventListener(g("resizer:start"), v), e.addEventListener(g("resizer:end"), b), e.addEventListener("click", c), t.documentEnd && l.appendChild(e), t.pauseVideos && T(e), !t.nonModal && t.preventScroll) {
87
+ let s;
88
+ n = z(e, (u) => {
89
+ u ? s = k({ preventShift: d }) : s && (s(), s = null);
78
90
  });
79
91
  }
80
- function u(n) {
81
- const { target: l } = n, p = l === e, g = l.closest(i.attributeSelector("close"));
82
- (!o && t.clickOutsideCloses && p && E(e, n) || g) && (t.pauseVideos && L(e), e.close());
92
+ function c(s) {
93
+ const { target: u } = s, h = u === e, E = u.closest(r.attributeSelector("close"));
94
+ (!i && t.clickOutsideCloses && h && C(e, s) || E) && (t.pauseVideos && j(e), e.close());
83
95
  }
84
- function c(n) {
85
- o = n.pointerId;
96
+ function v(s) {
97
+ i = s.pointerId;
86
98
  }
87
- function m(n) {
88
- o === n.pointerId && setTimeout(() => {
89
- o = null;
99
+ function b(s) {
100
+ i === s.pointerId && setTimeout(() => {
101
+ i = null;
90
102
  }, 0);
91
103
  }
104
+ return {
105
+ destroy: () => {
106
+ n && n.destroy();
107
+ }
108
+ };
92
109
  }
93
- function D(e) {
94
- return Object.assign({}, a, i.getData(e));
110
+ function R(e) {
111
+ return Object.assign({}, a, r.getData(e));
95
112
  }
96
- function k(e) {
97
- O(e);
113
+ function T(e) {
114
+ w(e);
98
115
  }
99
- function L(e) {
100
- S(e), e.querySelectorAll("video").forEach((t) => t.pause());
116
+ function j(e) {
117
+ y(e), e.querySelectorAll("video").forEach((t) => t.pause());
101
118
  }
102
119
  export {
103
- b as baseAttribute,
104
- F as closeAttribute,
105
- V as defaults,
106
- D as getDialogOptions,
107
- T as init,
108
- i as initializer,
109
- R as setDefaults,
110
- C as setupDialog,
111
- w as setupTrigger
120
+ L as baseAttribute,
121
+ G as closeAttribute,
122
+ M as defaults,
123
+ R as getDialogOptions,
124
+ J as init,
125
+ r as initializer,
126
+ H as setDefaults,
127
+ I as setupDialog,
128
+ A as setupTrigger
112
129
  };
@@ -6,6 +6,7 @@ export { createPager as overflowScrollerCreatePager } from './overflow-scroller-
6
6
  export { init as pageInit } from './page.js';
7
7
  export { init as printInit } from './print.js';
8
8
  export { Resizer } from './resizer.js';
9
+ export { TabManager } from './tab-manager.js';
9
10
  export { init as detailsGroupInit, initializer as detailsGroupInitializer, setupGroup as detailsGroupSetupGroup } from './details-group.js';
10
11
  export { baseAttribute as dialogBaseAttribute, closeAttribute as dialogCloseAttribute, defaults as dialogDefaults, getDialogOptions as dialogGetDialogOptions, init as dialogInit, initializer as dialogInitializer, setDefaults as dialogSetDefaults, setupDialog as dialogSetupDialog, setupTrigger as dialogSetupTrigger } from './dialog.js';
11
12
  export { Flipcard, init as flipcardInit, initializer as flipcardInitializer } from './flipcard.js';
@@ -37,6 +37,7 @@ export namespace defaults {
37
37
  export let size: string;
38
38
  export let print: boolean;
39
39
  export let noMinHeight: boolean;
40
+ export let fullscreenMobile: boolean;
40
41
  let _class: string;
41
42
  export { _class as class };
42
43
  export let baseClass: string;
@@ -47,6 +48,7 @@ export namespace defaults {
47
48
  export let classResizerIcon: Object;
48
49
  export let classResizerIconBoth: Object;
49
50
  export let debug: boolean;
51
+ export let autoIframe: boolean;
50
52
  export function templateCloseIcon(config: any): string;
51
53
  export function templateResizerIcon(config: any): string;
52
54
  /**
@@ -152,6 +154,10 @@ export type DefaultModalOptions = {
152
154
  * - Enables debug logging. Defaults to `false`.
153
155
  */
154
156
  debug: boolean;
157
+ /**
158
+ * - Opt-in convenience behavior. If the modal body's sole content is an iframe, it automatically applies layout fixes. If the iframe has static width/height attributes (like YouTube), it retains that aspect ratio responsively. Otherwise, it forces the iframe to fill the modal. Defaults to `false`.
159
+ */
160
+ autoIframe: boolean;
155
161
  /**
156
162
  * - A function that returns the HTML for the close icon.
157
163
  */
@@ -1 +1 @@
1
- {"version":3,"file":"modal-builder.d.ts","sourceRoot":"","sources":["../../../lib/js/ui/modal-builder.js"],"names":[],"mappings":"AAoJA;;GAEG;AACH,qCAFW,MAAM,QAIhB;AAED;;;GAGG;AACH,6BAQC;AAED;;;;GAIG;AACH,oCAHW,IAAI,WACJ,MAAM;;;EAqEhB;AApOD;;GAEG;AACH,+CAGG;;;;;;;;;;;;;;;;;;;;;;;;;;IAiED,uDAGC;IACD,yDAIC;IACD;;;;;OAKG;IACH,6CAHW,MAAM,UA8ChB;;;;;;;;;;;;WAnHW,MAAM,GAAC,IAAI;;;;eACX,MAAM,GAAC,IAAI;;;;gBACX,MAAM;;;;gBACN,MAAM;;;;iBACN,MAAM;;;;cACN,OAAO;;;;iBACP,OAAO;;;;iBACP,OAAO;;;;cACP,QAAQ,GAAC,UAAU,GAAC,YAAY,GAAC,WAAW,GAAC,aAAa,GAAC,eAAe,GAAC,cAAc;;;;eACzF,OAAO;;;;gBACP,OAAO;;;;UACP,SAAS,GAAC,OAAO,GAAC,OAAO,GAAC,YAAY;;;;WACtC,OAAO;;;;iBACP,OAAO;;;;WACP,MAAM;;;;eACN,MAAM;;;;gBACN,MAAM;;;;oBACN,MAAM;;;;sBACN,MAAM;;;;mBACN,MAAM,GAAC,IAAI;;;;gBACX,MAAM,GAAC,IAAI;;;;WACX,OAAO;;;;uBACP,CAAS,IAAM,EAAN,MAAM,KAAG,MAAM;;;;YACxB,CAAS,IAAM,EAAN,MAAM,KAAG,MAAM;;wBA1Cd,cAAc;qCAHD,sBAAsB"}
1
+ {"version":3,"file":"modal-builder.d.ts","sourceRoot":"","sources":["../../../lib/js/ui/modal-builder.js"],"names":[],"mappings":"AAyJA;;GAEG;AACH,qCAFW,MAAM,QAIhB;AAED;;;GAGG;AACH,6BAQC;AAED;;;;GAIG;AACH,oCAHW,IAAI,WACJ,MAAM;;;EAqFhB;AAxPD;;GAEG;AACH,+CAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoED,uDAGC;IACD,yDAIC;IACD;;;;;OAKG;IACH,6CAHW,MAAM,UA+ChB;;;;;;;;;;;;WAvHW,MAAM,GAAC,IAAI;;;;eACX,MAAM,GAAC,IAAI;;;;gBACX,MAAM;;;;gBACN,MAAM;;;;iBACN,MAAM;;;;cACN,OAAO;;;;iBACP,OAAO;;;;iBACP,OAAO;;;;cACP,QAAQ,GAAC,UAAU,GAAC,YAAY,GAAC,WAAW,GAAC,aAAa,GAAC,eAAe,GAAC,cAAc;;;;eACzF,OAAO;;;;gBACP,OAAO;;;;UACP,SAAS,GAAC,OAAO,GAAC,OAAO,GAAC,YAAY;;;;WACtC,OAAO;;;;iBACP,OAAO;;;;WACP,MAAM;;;;eACN,MAAM;;;;gBACN,MAAM;;;;oBACN,MAAM;;;;sBACN,MAAM;;;;mBACN,MAAM,GAAC,IAAI;;;;gBACX,MAAM,GAAC,IAAI;;;;WACX,OAAO;;;;gBACP,OAAO;;;;uBACP,CAAS,IAAM,EAAN,MAAM,KAAG,MAAM;;;;YACxB,CAAS,IAAM,EAAN,MAAM,KAAG,MAAM;;wBA5Cd,cAAc;qCAHD,sBAAsB"}