@nanoporetech-digital/components 4.10.0 → 5.1.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 (174) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/dist/cjs/{form-control-2e900f54.js → form-control-443e90bf.js} +2 -3
  3. package/dist/cjs/form-control-443e90bf.js.map +1 -0
  4. package/dist/cjs/index-71f899a7.js +6 -2
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/nano-components.cjs.js +1 -1
  7. package/dist/cjs/nano-dropdown.cjs.entry.js +1 -1
  8. package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -1
  9. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +2 -2
  10. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
  11. package/dist/cjs/nano-grid-item.cjs.entry.js +29 -0
  12. package/dist/cjs/nano-grid-item.cjs.entry.js.map +1 -0
  13. package/dist/cjs/nano-grid_2.cjs.entry.js +443 -0
  14. package/dist/cjs/nano-grid_2.cjs.entry.js.map +1 -0
  15. package/dist/cjs/nano-hero.cjs.entry.js +4 -10
  16. package/dist/cjs/nano-hero.cjs.entry.js.map +1 -1
  17. package/dist/cjs/nano-icon-button_2.cjs.entry.js +2 -2
  18. package/dist/cjs/nano-icon-button_2.cjs.entry.js.map +1 -1
  19. package/dist/cjs/nano-input.cjs.entry.js +2 -2
  20. package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
  21. package/dist/cjs/nano-range.cjs.entry.js +1 -1
  22. package/dist/cjs/nano-range.cjs.entry.js.map +1 -1
  23. package/dist/cjs/nano-sortable.cjs.entry.js +1 -0
  24. package/dist/cjs/nano-sortable.cjs.entry.js.map +1 -1
  25. package/dist/cjs/{nano-table-ff33dc43.js → nano-table-5587101f.js} +37 -30
  26. package/dist/cjs/nano-table-5587101f.js.map +1 -0
  27. package/dist/cjs/nano-table.cjs.entry.js +1 -1
  28. package/dist/cjs/{table.worker-0a6bc962.js → table.worker-abba820e.js} +2 -2
  29. package/dist/cjs/table.worker-abba820e.js.map +1 -0
  30. package/dist/collection/components/dropdown/dropdown.css +2 -1
  31. package/dist/collection/components/form-control/form-control.js +1 -2
  32. package/dist/collection/components/form-control/form-control.js.map +1 -1
  33. package/dist/collection/components/grid/grid-item.js +11 -136
  34. package/dist/collection/components/grid/grid-item.js.map +1 -1
  35. package/dist/collection/components/grid/grid.css +9 -242
  36. package/dist/collection/components/grid/grid.js +255 -240
  37. package/dist/collection/components/grid/grid.js.map +1 -1
  38. package/dist/collection/components/hero/hero.css +42 -89
  39. package/dist/collection/components/hero/hero.js +4 -11
  40. package/dist/collection/components/hero/hero.js.map +1 -1
  41. package/dist/collection/components/icon-button/icon-button.css +12 -0
  42. package/dist/collection/components/icon-button/icon-button.js +1 -1
  43. package/dist/collection/components/icon-button/icon-button.js.map +1 -1
  44. package/dist/collection/components/input/input.css +8 -9
  45. package/dist/collection/components/range/range.css +0 -3
  46. package/dist/collection/components/select/select.css +8 -9
  47. package/dist/collection/components/sortable/sortable.js +2 -1
  48. package/dist/collection/components/sortable/sortable.js.map +1 -1
  49. package/dist/collection/components/table/table.css +6 -0
  50. package/dist/collection/components/table/table.js +25 -18
  51. package/dist/collection/components/table/table.js.map +1 -1
  52. package/dist/collection/components/table/table.row.js +7 -7
  53. package/dist/collection/components/table/table.row.js.map +1 -1
  54. package/dist/collection/utils/constructible-style.js +129 -0
  55. package/dist/collection/utils/constructible-style.js.map +1 -0
  56. package/dist/components/dropdown.js +1 -1
  57. package/dist/components/dropdown.js.map +1 -1
  58. package/dist/components/form-control.js +1 -2
  59. package/dist/components/form-control.js.map +1 -1
  60. package/dist/components/grid.js +275 -183
  61. package/dist/components/grid.js.map +1 -1
  62. package/dist/components/icon-button.js +2 -2
  63. package/dist/components/icon-button.js.map +1 -1
  64. package/dist/components/input.js +1 -1
  65. package/dist/components/input.js.map +1 -1
  66. package/dist/components/nano-grid-item.js +33 -1
  67. package/dist/components/nano-grid-item.js.map +1 -1
  68. package/dist/components/nano-hero.js +6 -19
  69. package/dist/components/nano-hero.js.map +1 -1
  70. package/dist/components/nano-range.js +1 -1
  71. package/dist/components/nano-range.js.map +1 -1
  72. package/dist/components/nano-sortable.js +1 -0
  73. package/dist/components/nano-sortable.js.map +1 -1
  74. package/dist/components/select.js +1 -1
  75. package/dist/components/select.js.map +1 -1
  76. package/dist/components/table.js +36 -29
  77. package/dist/components/table.js.map +1 -1
  78. package/dist/esm/{form-control-269ba84f.js → form-control-e8739b2e.js} +2 -3
  79. package/dist/esm/form-control-e8739b2e.js.map +1 -0
  80. package/dist/esm/index-dad5627b.js +6 -2
  81. package/dist/esm/loader.js +1 -1
  82. package/dist/esm/nano-components.js +1 -1
  83. package/dist/esm/nano-dropdown.entry.js +1 -1
  84. package/dist/esm/nano-dropdown.entry.js.map +1 -1
  85. package/dist/esm/nano-global-nav-user-profile_3.entry.js +2 -2
  86. package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
  87. package/dist/esm/nano-grid-item.entry.js +25 -0
  88. package/dist/esm/nano-grid-item.entry.js.map +1 -0
  89. package/dist/esm/nano-grid_2.entry.js +438 -0
  90. package/dist/esm/nano-grid_2.entry.js.map +1 -0
  91. package/dist/esm/nano-hero.entry.js +4 -10
  92. package/dist/esm/nano-hero.entry.js.map +1 -1
  93. package/dist/esm/nano-icon-button_2.entry.js +2 -2
  94. package/dist/esm/nano-icon-button_2.entry.js.map +1 -1
  95. package/dist/esm/nano-input.entry.js +2 -2
  96. package/dist/esm/nano-input.entry.js.map +1 -1
  97. package/dist/esm/nano-range.entry.js +1 -1
  98. package/dist/esm/nano-range.entry.js.map +1 -1
  99. package/dist/esm/nano-sortable.entry.js +1 -0
  100. package/dist/esm/nano-sortable.entry.js.map +1 -1
  101. package/dist/esm/{nano-table-ec980076.js → nano-table-fb6b3bcb.js} +37 -30
  102. package/dist/esm/nano-table-fb6b3bcb.js.map +1 -0
  103. package/dist/esm/nano-table.entry.js +1 -1
  104. package/dist/esm/{table.worker-b53db58e.js → table.worker-43365547.js} +2 -2
  105. package/dist/esm/table.worker-43365547.js.map +1 -0
  106. package/dist/nano-components/nano-components.css +1 -1
  107. package/dist/nano-components/nano-components.esm.js +1 -1
  108. package/dist/nano-components/nano-components.esm.js.map +1 -1
  109. package/dist/nano-components/p-17b099cc.entry.js +5 -0
  110. package/dist/nano-components/p-17b099cc.entry.js.map +1 -0
  111. package/dist/nano-components/p-553acf24.entry.js +5 -0
  112. package/dist/nano-components/{p-58b53239.entry.js.map → p-553acf24.entry.js.map} +1 -1
  113. package/dist/nano-components/p-6975f110.entry.js +5 -0
  114. package/dist/nano-components/p-6975f110.entry.js.map +1 -0
  115. package/dist/nano-components/p-71057181.js +5 -0
  116. package/dist/nano-components/p-71057181.js.map +1 -0
  117. package/dist/nano-components/{p-f591400b.entry.js → p-913cf45f.entry.js} +2 -2
  118. package/dist/nano-components/p-99914796.js +5 -0
  119. package/dist/nano-components/p-99914796.js.map +1 -0
  120. package/dist/nano-components/p-9b5429e1.entry.js +5 -0
  121. package/dist/nano-components/p-9b5429e1.entry.js.map +1 -0
  122. package/dist/nano-components/p-ad6209ec.entry.js +5 -0
  123. package/dist/nano-components/p-ad6209ec.entry.js.map +1 -0
  124. package/dist/nano-components/p-bdef618c.entry.js +5 -0
  125. package/dist/nano-components/p-bdef618c.entry.js.map +1 -0
  126. package/dist/nano-components/{p-241baff8.entry.js → p-d79c6862.entry.js} +2 -2
  127. package/dist/nano-components/p-d79c6862.entry.js.map +1 -0
  128. package/dist/nano-components/{p-806bcd46.js → p-daa6f834.js} +2 -2
  129. package/dist/nano-components/p-deb0799c.entry.js +5 -0
  130. package/dist/nano-components/{p-6a3a29c6.entry.js.map → p-deb0799c.entry.js.map} +1 -1
  131. package/dist/nano-components/p-ebb98a9e.entry.js +5 -0
  132. package/dist/nano-components/p-ebb98a9e.entry.js.map +1 -0
  133. package/dist/types/components/grid/grid-item.d.ts +3 -11
  134. package/dist/types/components/grid/grid.d.ts +44 -68
  135. package/dist/types/components/hero/hero.d.ts +1 -3
  136. package/dist/types/components/table/table.d.ts +5 -0
  137. package/dist/types/components.d.ts +85 -61
  138. package/dist/types/utils/constructible-style.d.ts +31 -0
  139. package/docs-json.json +152 -88
  140. package/docs-vscode.json +28 -21
  141. package/hydrate/index.js +348 -307
  142. package/package.json +2 -2
  143. package/dist/cjs/form-control-2e900f54.js.map +0 -1
  144. package/dist/cjs/nano-grid_3.cjs.entry.js +0 -431
  145. package/dist/cjs/nano-grid_3.cjs.entry.js.map +0 -1
  146. package/dist/cjs/nano-table-ff33dc43.js.map +0 -1
  147. package/dist/cjs/table.worker-0a6bc962.js.map +0 -1
  148. package/dist/collection/components/grid/grid-item.css +0 -15
  149. package/dist/components/grid-item.js +0 -107
  150. package/dist/components/grid-item.js.map +0 -1
  151. package/dist/esm/form-control-269ba84f.js.map +0 -1
  152. package/dist/esm/nano-grid_3.entry.js +0 -425
  153. package/dist/esm/nano-grid_3.entry.js.map +0 -1
  154. package/dist/esm/nano-table-ec980076.js.map +0 -1
  155. package/dist/esm/table.worker-b53db58e.js.map +0 -1
  156. package/dist/nano-components/p-064af7d0.js +0 -5
  157. package/dist/nano-components/p-064af7d0.js.map +0 -1
  158. package/dist/nano-components/p-107d4549.entry.js +0 -5
  159. package/dist/nano-components/p-107d4549.entry.js.map +0 -1
  160. package/dist/nano-components/p-239d343a.entry.js +0 -5
  161. package/dist/nano-components/p-239d343a.entry.js.map +0 -1
  162. package/dist/nano-components/p-241baff8.entry.js.map +0 -1
  163. package/dist/nano-components/p-58b53239.entry.js +0 -5
  164. package/dist/nano-components/p-5ac74848.js +0 -5
  165. package/dist/nano-components/p-5ac74848.js.map +0 -1
  166. package/dist/nano-components/p-6a3a29c6.entry.js +0 -5
  167. package/dist/nano-components/p-87bc66b5.entry.js +0 -5
  168. package/dist/nano-components/p-87bc66b5.entry.js.map +0 -1
  169. package/dist/nano-components/p-d3de231c.entry.js +0 -5
  170. package/dist/nano-components/p-d3de231c.entry.js.map +0 -1
  171. package/dist/nano-components/p-d792f692.entry.js +0 -5
  172. package/dist/nano-components/p-d792f692.entry.js.map +0 -1
  173. /package/dist/nano-components/{p-806bcd46.js.map → p-913cf45f.entry.js.map} +0 -0
  174. /package/dist/nano-components/{p-f591400b.entry.js.map → p-daa6f834.js.map} +0 -0
@@ -0,0 +1,443 @@
1
+ /*!
2
+ * Web Components for Nanopore digital Web Apps
3
+ */
4
+ 'use strict';
5
+
6
+ Object.defineProperty(exports, '__esModule', { value: true });
7
+
8
+ const index = require('./index-71f899a7.js');
9
+
10
+ // import type { VNode, HTMLStencilElement } from "@stencil/core";
11
+ const supportsConstructibleStylesheets = (() => {
12
+ try {
13
+ return !!new CSSStyleSheet();
14
+ }
15
+ catch (e) {
16
+ return false;
17
+ }
18
+ })();
19
+ const cacheKeys = new WeakMap();
20
+ /**
21
+ * Dynamically create a constructible stylesheet which is applied to the component.
22
+ * The stylesheet is then cached for future instances of the component.
23
+ * @usage
24
+ As a string:
25
+ ```
26
+ @ConstructableStyle() style = `.bg { background: url('assets/${ this.mode }/bg.png'); }`;
27
+ ```
28
+ As a function:
29
+ ```
30
+ @ConstructableStyle() style = () => `.bg { background: url('assets/${ this.mode }/bg.png'); }`;
31
+ ```
32
+ * @param opts - optional `cacheKeyProperty` - in case an instance of a component could produce different styles based on variables.
33
+ * @returns `@ConstructableStyle` decorator
34
+ */
35
+ function ConstructibleStyle(opts = {}) {
36
+ return (target, propertyKey) => {
37
+ if (!opts.cacheKeyProperty) {
38
+ opts.cacheKeyProperty = propertyKey;
39
+ }
40
+ const { componentWillLoad, render, componentWillRender } = target;
41
+ if (!componentWillLoad)
42
+ console.warn(`ConstructibleStyle requires you to have a \`componentWillLoad\` lifecycle method in \`${target.constructor.name}\`. Failure to add this function may cause ConstructibleStyle to fail due to StencilJS build optimizations.`);
43
+ if (supportsConstructibleStylesheets) {
44
+ const addStylesheet = (instance) => {
45
+ if (!instance[opts.cacheKeyProperty] ||
46
+ (cacheKeys.get(instance) &&
47
+ cacheKeys.get(instance) === instance[opts.cacheKeyProperty]))
48
+ return;
49
+ cacheKeys.set(instance, instance[opts.cacheKeyProperty]);
50
+ const host = index.getElement(instance);
51
+ const cssText = typeof instance[propertyKey] === 'function'
52
+ ? instance[propertyKey]()
53
+ : instance[propertyKey];
54
+ const root = (host.shadowRoot || document);
55
+ root.adoptedStyleSheets = [
56
+ ...(root.adoptedStyleSheets || []),
57
+ getOrCreateStylesheet(instance, target, cssText, opts),
58
+ ];
59
+ };
60
+ target.componentWillLoad = function () {
61
+ const willLoadResult = componentWillLoad && componentWillLoad.call(this);
62
+ addStylesheet(this);
63
+ return willLoadResult;
64
+ };
65
+ target.componentWillRender = function () {
66
+ const willRenderResult = componentWillRender && componentWillRender.call(this);
67
+ addStylesheet(this);
68
+ return willRenderResult;
69
+ };
70
+ }
71
+ else {
72
+ target.render = function () {
73
+ const cssText = typeof this[propertyKey] === 'function'
74
+ ? this[propertyKey]()
75
+ : this[propertyKey];
76
+ let renderedNode = render.call(this);
77
+ if (isHost(renderedNode)) {
78
+ appendStyleToHost(renderedNode, target.constructor.name, cssText);
79
+ }
80
+ else {
81
+ renderedNode = index.h(index.Host, null, renderedNode);
82
+ if (!('attachShadow' in HTMLElement.prototype)) {
83
+ appendStyleToHost(renderedNode, target.constructor.name, cssText);
84
+ }
85
+ else {
86
+ if (!target.__constructableStyle) {
87
+ const style = document.createElement('style');
88
+ style.setAttribute('type', 'text/css');
89
+ style.setAttribute('constructible-style', target.constructor.name);
90
+ style.innerHTML = cssText;
91
+ target.__constructableStyle = style;
92
+ document.head.appendChild(style);
93
+ }
94
+ }
95
+ }
96
+ return renderedNode;
97
+ };
98
+ }
99
+ };
100
+ }
101
+ function appendStyleToHost(node, targetName, cssText) {
102
+ (getHostChildren(node) || []).push(index.h("style", { type: "text/css", "constructible-style": targetName }, cssText));
103
+ }
104
+ function getOrCreateStylesheet(instance, target, cssText, opts) {
105
+ if (!target.__constructableStyle) {
106
+ target.__constructableStyle = {};
107
+ }
108
+ const key = instance[opts.cacheKeyProperty];
109
+ if (!target.__constructableStyle[key]) {
110
+ target.__constructableStyle[key] = new CSSStyleSheet();
111
+ target.__constructableStyle[key].replace(cssText);
112
+ }
113
+ return target.__constructableStyle[key];
114
+ }
115
+ function isHost(node) {
116
+ for (const prop in node) {
117
+ if (node.hasOwnProperty(prop)) {
118
+ if (node[prop] === index.Host) {
119
+ return true;
120
+ }
121
+ }
122
+ }
123
+ return false;
124
+ }
125
+ function getHostChildren(node) {
126
+ for (const prop in node) {
127
+ if (node.hasOwnProperty(prop)) {
128
+ if (Array.isArray(node[prop])) {
129
+ return node[prop];
130
+ }
131
+ }
132
+ }
133
+ }
134
+
135
+ const gridCss = ":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--grid-col-gap:var(--nano-spacing-medium, 16px);--grid-row-gap:var(--nano-spacing-medium, 16px);--current-grid-size:\"grid size: s\";container-type:inline-size;display:block}:host .grid{display:grid;gap:var(--grid-row-gap) var(--grid-col-gap);block-size:inherit;min-block-size:inherit}:host([show-helper]:not([show-helper=false])){position:relative}:host([show-helper]:not([show-helper=false])) .grid--helper{position:absolute;inset:0;pointer-events:none}:host([show-helper]:not([show-helper=false])) .grid--helper::before{content:var(--current-grid-size);font-size:30px;position:absolute;inline-size:100%;inset-inline-start:0;text-align:center;inset-block-start:50%;transform:translateY(-50%);color:rgba(0, 0, 0, 0.2);text-transform:uppercase;z-index:99;pointer-events:none}:host([show-helper]:not([show-helper=false])) .grid__helper-item{display:none;background:rgba(126, 195, 241, 0.25)}";
136
+
137
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
138
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
139
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
140
+ r = Reflect.decorate(decorators, target, key, desc);
141
+ else
142
+ for (var i = decorators.length - 1; i >= 0; i--)
143
+ if (d = decorators[i])
144
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
145
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
146
+ };
147
+ var __metadata = (undefined && undefined.__metadata) || function (k, v) {
148
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
149
+ return Reflect.metadata(k, v);
150
+ };
151
+ const Grid = class {
152
+ constructor(hostRef) {
153
+ index.registerInstance(this, hostRef);
154
+ this.grids = [];
155
+ this.styles = () => {
156
+ const css = /* css */ `
157
+ ${this.grids
158
+ .map((bp) => /* css */ `
159
+ @container (min-width: ${typeof bp.breakpoint === 'number'
160
+ ? bp.breakpoint + 1 + 'px'
161
+ : bp.breakpoint}) {
162
+ .grid {
163
+ --current-grid-size: "grid size: ${bp.name}";
164
+ ${bp.template
165
+ ? `grid-template: ${bp.template};`
166
+ : `grid-template-columns: repeat(${bp.cols}, minmax(calc((100% / ${bp.cols}) - var(--grid-col-gap)), 1fr));`}
167
+ }
168
+ ${[...Array(bp.cols)]
169
+ .map((_, i) => {
170
+ const gItm = i + 1;
171
+ return /* css */ `
172
+ .grid > [grid-states~="${bp.name}-col-start-${gItm}"],
173
+ ::slotted([grid-states~="${bp.name}-col-start-${gItm}"]) {
174
+ grid-column-start: ${gItm} !important;
175
+ }
176
+ .grid > [grid-states~="${bp.name}-col-span-${gItm}"],
177
+ ::slotted([grid-states~="${bp.name}-col-span-${gItm}"]) {
178
+ grid-column-end: span ${gItm} !important;
179
+ }
180
+ `;
181
+ })
182
+ .join('')}
183
+ ${[...Array(24)]
184
+ .map((_, i) => {
185
+ const gItm = i + 1;
186
+ return /* css */ `
187
+ .grid > [grid-states~="${bp.name}-row-start-${gItm}"],
188
+ ::slotted([grid-states~="${bp.name}-row-start-${gItm}"]) {
189
+ grid-row-start: ${gItm} !important;
190
+ }
191
+ .grid > [grid-states~="${bp.name}-row-span-${gItm}"],
192
+ ::slotted([grid-states~="${bp.name}-row-span-${gItm}"]) {
193
+ grid-row-end: span ${gItm} !important;
194
+ }
195
+ `;
196
+ })
197
+ .join('')}
198
+ ${this.showHelper &&
199
+ /* css */ `
200
+ .grid--helper :nth-child(-n+${bp.cols}) {
201
+ display: block !important;
202
+ }
203
+ `}
204
+ }
205
+ `)
206
+ .join('')}
207
+ `;
208
+ return css;
209
+ };
210
+ this.cacheKey = undefined;
211
+ this.sSize = 300;
212
+ this.mSize = 550;
213
+ this.lSize = 800;
214
+ this.xlSize = 1000;
215
+ this.sCols = undefined;
216
+ this.mCols = undefined;
217
+ this.lCols = undefined;
218
+ this.xlCols = undefined;
219
+ this.xxlCols = undefined;
220
+ this.sTpl = undefined;
221
+ this.mTpl = undefined;
222
+ this.lTpl = undefined;
223
+ this.xlTpl = undefined;
224
+ this.xxlTpl = undefined;
225
+ this.showHelper = false;
226
+ }
227
+ constructSizeArray() {
228
+ this.grids = [];
229
+ if (this.sCols)
230
+ this.grids.push({
231
+ cols: this.sCols,
232
+ breakpoint: 0,
233
+ name: 's',
234
+ template: this.sTpl,
235
+ });
236
+ if (this.mCols)
237
+ this.grids.push({
238
+ cols: this.mCols,
239
+ breakpoint: this.sSize,
240
+ name: 'm',
241
+ template: this.mTpl,
242
+ });
243
+ if (this.lSize)
244
+ this.grids.push({
245
+ cols: this.lCols,
246
+ breakpoint: this.mSize,
247
+ name: 'l',
248
+ template: this.lTpl,
249
+ });
250
+ if (this.xlCols)
251
+ this.grids.push({
252
+ cols: this.xlCols,
253
+ breakpoint: this.lSize,
254
+ name: 'xl',
255
+ template: this.xlTpl,
256
+ });
257
+ if (this.xxlCols)
258
+ this.grids.push({
259
+ cols: this.xxlCols,
260
+ breakpoint: this.xlSize,
261
+ name: 'xxl',
262
+ template: this.xxlTpl,
263
+ });
264
+ this.cacheKey =
265
+ this.grids
266
+ .map((bp) => `${bp.cols}-${bp.breakpoint}-${bp.template || ''}`)
267
+ .join('') +
268
+ '-helper-' +
269
+ this.showHelper;
270
+ }
271
+ componentWillLoad() {
272
+ this.constructSizeArray();
273
+ }
274
+ render() {
275
+ return (index.h(index.Host, null, index.h("div", { part: "grid", class: "grid" }, index.h("slot", null)), this.showHelper && (index.h("div", { class: "grid grid--helper", part: "helper" }, [...Array(24)].map(() => (index.h("div", { class: "grid__helper-item" })))))));
276
+ }
277
+ static get watchers() { return {
278
+ "sTpl": ["constructSizeArray"],
279
+ "mTpl": ["constructSizeArray"],
280
+ "lTpl": ["constructSizeArray"],
281
+ "xlTpl": ["constructSizeArray"],
282
+ "xxlTpl": ["constructSizeArray"],
283
+ "sSize": ["constructSizeArray"],
284
+ "mSize": ["constructSizeArray"],
285
+ "lSize": ["constructSizeArray"],
286
+ "xlSize": ["constructSizeArray"],
287
+ "sCols": ["constructSizeArray"],
288
+ "mCols": ["constructSizeArray"],
289
+ "lCols": ["constructSizeArray"],
290
+ "xlCols": ["constructSizeArray"],
291
+ "xxlCols": ["constructSizeArray"],
292
+ "showHelper": ["constructSizeArray"]
293
+ }; }
294
+ };
295
+ __decorate([
296
+ ConstructibleStyle({ cacheKeyProperty: 'cacheKey' }),
297
+ __metadata("design:type", Object)
298
+ ], Grid.prototype, "styles", void 0);
299
+ Grid.style = gridCss;
300
+
301
+ const imgCss = ":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--padding:0;display:inline-block;object-fit:cover;object-position:center;background-size:cover;background-position:center}:host *{border-radius:inherit}:host([background]:not([background=false])){display:block}.img{position:relative;object-fit:inherit;object-position:inherit;background-color:inherit;background-position:inherit;background-size:inherit;background-origin:inherit;background-attachment:inherit;background-repeat:inherit;flex:1 1 100%;display:flex;flex-direction:column;min-block-size:inherit;max-block-size:inherit;max-inline-size:inherit;min-height:inherit;min-width:inherit;block-size:inherit;inline-size:inherit;height:inherit;width:inherit;max-height:inherit;max-width:inherit;aspect-ratio:inherit}.img__loader,.img__observer{position:absolute;inset:0;block-size:100%;inline-size:100%;z-index:-1}.img__image,.img__bg{border-radius:inherit;display:block;opacity:0;transition:0.5s ease opacity, 0.3s ease filter 0.4s;filter:blur(5px);flex:1}.img__image.loaded,.img__bg.loaded{opacity:1;filter:blur(0)}@media not all and (min-resolution: 0.001dpcm){@supports (-webkit-appearance: none){.img__image.loaded,.img__bg.loaded{filter:blur(0)}}}.img__image{object-fit:inherit;object-position:inherit;max-inline-size:100%;min-block-size:inherit;max-block-size:inherit;min-height:inherit;min-width:inherit;block-size:auto;inline-size:inherit;height:inherit;width:inherit;max-height:inherit;max-width:inherit;aspect-ratio:inherit}.img__image.hide{visibility:hidden}.img__image.hide.no-height{block-size:1px;position:absolute;z-index:-1}.img__bg{background-color:inherit;background-position:inherit;background-size:inherit;background-origin:inherit;background-attachment:inherit;background-repeat:inherit;overflow:auto;padding:var(--padding)}.img__bg.no-height{position:absolute;inset:0}";
302
+
303
+ const Img = class {
304
+ constructor(hostRef) {
305
+ index.registerInstance(this, hostRef);
306
+ this.nanoImgWillLoad = index.createEvent(this, "nanoImgWillLoad", 7);
307
+ this.nanoImgDidLoad = index.createEvent(this, "nanoImgDidLoad", 7);
308
+ this.nanoImgError = index.createEvent(this, "nanoImgError", 7);
309
+ this._srcSet = {};
310
+ this.onLoad = () => {
311
+ this.nanoImgDidLoad.emit();
312
+ setTimeout(() => (this.hasLoaded = true), 50);
313
+ };
314
+ this.onError = () => {
315
+ this.nanoImgError.emit();
316
+ };
317
+ this.onResize = (e) => {
318
+ Object.entries(e.detail).forEach(([bp, active]) => {
319
+ this._srcSet[bp].active = active;
320
+ });
321
+ // sort and find the highest sized matching image.
322
+ const srcOpts = [];
323
+ Object.keys(this._srcSet)
324
+ .sort()
325
+ .forEach((bp) => {
326
+ if (this._srcSet[bp].active)
327
+ srcOpts.push(this._srcSet[bp].src);
328
+ });
329
+ if (srcOpts.length)
330
+ this._src = srcOpts.slice(-1)[0];
331
+ // no matching image? Set back to default
332
+ else
333
+ this._src = this.src;
334
+ };
335
+ this.loadSrc = undefined;
336
+ this.loadError = undefined;
337
+ this.hasLoaded = false;
338
+ this.imgStates = null;
339
+ this._src = undefined;
340
+ this.alt = undefined;
341
+ this.src = undefined;
342
+ this.srcSet = undefined;
343
+ this.lazy = true;
344
+ this.background = undefined;
345
+ this.autoHeight = 'content';
346
+ }
347
+ _srcChanged() {
348
+ this.hasLoaded = false;
349
+ this.addIO();
350
+ }
351
+ srcChanged() {
352
+ this._src = this.src;
353
+ }
354
+ srcSetChanged() {
355
+ if (!this.srcSet)
356
+ return;
357
+ delete this._srcSet;
358
+ this._srcSet = {};
359
+ this.imgStates = this.srcSet
360
+ .split(',')
361
+ .map((bpSrc) => {
362
+ const [bp, src] = bpSrc.split(' ').filter((bp) => bp.length);
363
+ this._srcSet[bp] = { src: src, active: false };
364
+ return bp;
365
+ })
366
+ .join(', ');
367
+ }
368
+ lazyChanged() {
369
+ if (!this.lazy)
370
+ this.load();
371
+ }
372
+ addIO() {
373
+ if (!this._src || this.hasLoaded)
374
+ return;
375
+ if (!this.lazy) {
376
+ this.load();
377
+ return;
378
+ }
379
+ if (typeof window !== 'undefined' &&
380
+ 'IntersectionObserver' in window) {
381
+ this.removeIO();
382
+ this.io = new IntersectionObserver((data) => {
383
+ if (data[0].isIntersecting) {
384
+ this.load();
385
+ this.removeIO();
386
+ }
387
+ });
388
+ this.io.observe(this.host);
389
+ }
390
+ else
391
+ setTimeout(() => this.load(), 200);
392
+ }
393
+ load() {
394
+ this.loadError = this.onError;
395
+ this.loadSrc = this._src;
396
+ this.nanoImgWillLoad.emit();
397
+ }
398
+ removeIO() {
399
+ if (this.io) {
400
+ this.io.disconnect();
401
+ this.io = undefined;
402
+ }
403
+ }
404
+ connectedCallback() {
405
+ this.srcChanged();
406
+ this.srcSetChanged();
407
+ this.lazyChanged();
408
+ }
409
+ componentDidLoad() {
410
+ this.addIO();
411
+ }
412
+ disconnectedCallback() {
413
+ this.removeIO();
414
+ }
415
+ render() {
416
+ const bgStyle = !!this.loadSrc
417
+ ? { 'background-image': `url(${this.loadSrc})` }
418
+ : {};
419
+ return (index.h("div", { class: "img" }, index.h("nano-skeleton", { class: "img__loader" }), !!this.background && (index.h("div", { class: {
420
+ loaded: this.hasLoaded,
421
+ img__bg: true,
422
+ 'no-height': this.autoHeight === 'image',
423
+ }, style: bgStyle }, index.h("slot", null))), index.h("img", { class: {
424
+ img__image: true,
425
+ loaded: this.hasLoaded,
426
+ hide: this.background,
427
+ 'no-height': this.autoHeight === 'content',
428
+ }, decoding: "async", src: this.loadSrc, loading: undefined, alt: this.alt, onLoad: this.onLoad, onError: this.loadError }), index.h("nano-resize-observe", { class: "img__observer", onNanoResizeStateChange: this.onResize, states: this.imgStates })));
429
+ }
430
+ get host() { return index.getElement(this); }
431
+ static get watchers() { return {
432
+ "_src": ["_srcChanged"],
433
+ "src": ["srcChanged"],
434
+ "srcSet": ["srcSetChanged"],
435
+ "lazy": ["lazyChanged"]
436
+ }; }
437
+ };
438
+ Img.style = imgCss;
439
+
440
+ exports.nano_grid = Grid;
441
+ exports.nano_img = Img;
442
+
443
+ //# sourceMappingURL=nano-grid_2.cjs.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"nano-grid.nano-img.entry.cjs.js","mappings":";;;;;;;;;AACA;AAEA,MAAM,gCAAgC,GAAG,CAAC;EACxC,IAAI;IACF,OAAO,CAAC,CAAC,IAAI,aAAa,EAAE,CAAC;GAC9B;EAAC,OAAO,CAAC,EAAE;IACV,OAAO,KAAK,CAAC;GACd;AACH,CAAC,GAAG,CAAC;AAEL,MAAM,SAAS,GAAwC,IAAI,OAAO,EAAE,CAAC;AAOrE;;;;;;;;;;;;;;;SAegB,kBAAkB,CAChC,OAAkC,EAAE;EAEpC,OAAO,CAAC,MAA0B,EAAE,WAAmB;IACrD,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;MAC1B,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC;KACrC;IAED,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,MAAM,CAAC;I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BAAuB,EAAE,IAAI,CAAC,QAAQ,EACtC,MAAM,EAAE,IAAI,CAAC,SAAS,GACtB,CACE,EACN;GACH;;;;;;;;;;;;;;","names":["getElement","h","Host"],"sources":["./src/utils/constructible-style.tsx","./src/components/grid/grid.scss?tag=nano-grid&encapsulation=shadow","./src/components/grid/grid.tsx","./src/components/img/img.scss?tag=nano-img&encapsulation=shadow","./src/components/img/img.tsx"],"sourcesContent":["import { h, Host, getElement, VNode, ComponentInterface } from '@stencil/core';\n// import type { VNode, HTMLStencilElement } from \"@stencil/core\";\n\nconst supportsConstructibleStylesheets = (() => {\n try {\n return !!new CSSStyleSheet();\n } catch (e) {\n return false;\n }\n})();\n\nconst cacheKeys: WeakMap<ComponentInterface, string> = new WeakMap();\n\ndeclare type ConstructibleStyleDecorator = (\n target: ComponentInterface,\n propertyKey: string\n) => void;\n\n/**\n * Dynamically create a constructible stylesheet which is applied to the component.\n * The stylesheet is then cached for future instances of the component.\n * @usage\nAs a string:\n```\n@ConstructableStyle() style = `.bg { background: url('assets/${ this.mode }/bg.png'); }`;\n```\nAs a function:\n```\n@ConstructableStyle() style = () => `.bg { background: url('assets/${ this.mode }/bg.png'); }`;\n```\n * @param opts - optional `cacheKeyProperty` - in case an instance of a component could produce different styles based on variables.\n * @returns `@ConstructableStyle` decorator\n */\nexport function ConstructibleStyle(\n opts: ConstructibleStyleOptions = {}\n): ConstructibleStyleDecorator {\n return (target: ComponentInterface, propertyKey: string) => {\n if (!opts.cacheKeyProperty) {\n opts.cacheKeyProperty = propertyKey;\n }\n\n const { componentWillLoad, render, componentWillRender } = target;\n if (!componentWillLoad)\n console.warn(\n `ConstructibleStyle requires you to have a \\`componentWillLoad\\` lifecycle method in \\`${target.constructor.name}\\`. Failure to add this function may cause ConstructibleStyle to fail due to StencilJS build optimizations.`\n );\n\n if (supportsConstructibleStylesheets) {\n const addStylesheet = (instance: ComponentInterface) => {\n if (\n !instance[opts.cacheKeyProperty] ||\n (cacheKeys.get(instance) &&\n cacheKeys.get(instance) === instance[opts.cacheKeyProperty])\n )\n return;\n\n cacheKeys.set(instance, instance[opts.cacheKeyProperty]);\n const host = getElement(instance);\n const cssText =\n typeof instance[propertyKey] === 'function'\n ? instance[propertyKey]()\n : instance[propertyKey];\n const root = (host.shadowRoot || document) as any;\n root.adoptedStyleSheets = [\n ...(root.adoptedStyleSheets || []),\n getOrCreateStylesheet(instance, target, cssText, opts),\n ];\n };\n\n target.componentWillLoad = function () {\n const willLoadResult =\n componentWillLoad && componentWillLoad.call(this);\n addStylesheet(this);\n return willLoadResult;\n };\n\n target.componentWillRender = function () {\n const willRenderResult =\n componentWillRender && componentWillRender.call(this);\n addStylesheet(this);\n return willRenderResult;\n };\n } else {\n target.render = function () {\n const cssText =\n typeof this[propertyKey] === 'function'\n ? this[propertyKey]()\n : this[propertyKey];\n let renderedNode: VNode = render.call(this);\n\n if (isHost(renderedNode)) {\n appendStyleToHost(renderedNode, target.constructor.name, cssText);\n } else {\n renderedNode = <Host>{renderedNode}</Host>;\n\n if (!('attachShadow' in HTMLElement.prototype)) {\n appendStyleToHost(renderedNode, target.constructor.name, cssText);\n } else {\n if (!target.__constructableStyle) {\n const style = document.createElement('style');\n style.setAttribute('type', 'text/css');\n style.setAttribute(\n 'constructible-style',\n target.constructor.name\n );\n style.innerHTML = cssText;\n target.__constructableStyle = style;\n document.head.appendChild(style);\n }\n }\n }\n\n return renderedNode;\n };\n }\n };\n}\n\nfunction appendStyleToHost(node, targetName, cssText) {\n (getHostChildren(node) || []).push(\n <style type=\"text/css\" constructible-style={targetName}>\n {cssText}\n </style>\n );\n}\n\nfunction getOrCreateStylesheet(\n instance: ComponentInterface,\n target: ComponentInterface,\n cssText: string,\n opts: ConstructibleStyleOptions\n): CSSStyleSheet {\n if (!target.__constructableStyle) {\n target.__constructableStyle = {};\n }\n\n const key = instance[opts.cacheKeyProperty];\n\n if (!target.__constructableStyle[key]) {\n target.__constructableStyle[key] = new CSSStyleSheet();\n target.__constructableStyle[key].replace(cssText);\n }\n\n return target.__constructableStyle[key];\n}\n\nfunction isHost(node): boolean {\n for (const prop in node) {\n if (node.hasOwnProperty(prop)) {\n if (node[prop] === Host) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction getHostChildren(node): Array<VNode> {\n for (const prop in node) {\n if (node.hasOwnProperty(prop)) {\n if (Array.isArray(node[prop])) {\n return node[prop];\n }\n }\n }\n}\n\nexport interface ConstructibleStyleOptions {\n /**\n * Set this in case an instance of a component could produce different styles based on variables.\n * This will ensure that you get new styles for each mode.\n * @example\n```\n@Prop() mode: string;\n@ConstructableStyle({ cacheKeyProperty: \"mode\" }) style = `.bg { background: url('assets/${ this.mode }/bg.png'); }`;\n```\n */\n cacheKeyProperty?: string;\n}\n","@use 'sass:math';\n\n@import '../../global/style/nano-theme/base';\n\n:host {\n /**\n * @prop --grid-col-gap: gap between all columns. Defaults to theme's global padding\n * @prop --grid-row-gap: gap between all rows. Defaults to theme's global padding\n */\n\n --grid-col-gap: #{$spacing-medium};\n --grid-row-gap: #{$spacing-medium};\n --current-grid-size: \"grid size: s\";\n\n container-type: inline-size;\n display: block;\n\n .grid {\n display: grid;\n gap: var(--grid-row-gap) var(--grid-col-gap);\n block-size: inherit;\n min-block-size: inherit;\n }\n}\n\n:host([show-helper]:not([show-helper='false'])) {\n position: relative;\n\n .grid--helper {\n position: absolute;\n inset: 0;\n pointer-events: none;\n\n &::before {\n content: var(--current-grid-size);\n font-size: 30px;\n position: absolute;\n inline-size: 100%;\n inset-inline-start: 0;\n text-align: center;\n inset-block-start: 50%;\n transform: translateY(-50%);\n color: rgb(0 0 0 / 20%);\n text-transform: uppercase;\n z-index: 99;\n pointer-events: none;\n }\n }\n\n .grid__helper-item {\n display: none;\n background: hsl(204deg 80% 72% / 25%);\n }\n}\n","import { Component, h, Prop, Host, State, Watch } from '@stencil/core';\nimport { ConstructibleStyle } from '../../utils/constructible-style';\n\n/**\n * A lightweight, context-aware CSS grid implementation.\n *\n * - Define multiple grids templates at different breakpoints\n * - Uses `@container` queries to select the correct grid depending on the current dimensions\n * - Use `grid-states=\"...\"` on direct descendants for `column` / `row` - `start` / `end`\n * - SSR optimised\n\n * @part grid - the main grid element.\n * Use this to set css such as `justify-items|content` / `align-items|content` / `place-content`\n * @part helper - a replica grid showed when `show-helper` is true\n *\n * @slot - default slot. Use this to place grid items. Use `grid-states=\"...\"` attribute to opt-out of auto / sequential placement.\n */\n@Component({\n tag: 'nano-grid',\n styleUrl: 'grid.scss',\n shadow: true,\n})\nexport class Grid {\n private grids: {\n cols: number;\n breakpoint: number | string;\n name: string;\n template?: string;\n }[] = [];\n @State() cacheKey: string;\n\n /** the component's small breakpoint. Note - all breakpoints are based on component width, not screen width.\n * Will default to `px` if no unit supplied e.g. `20rem` */\n @Prop() sSize: number | string = 300;\n\n /** the component's medium breakpoint. Note - all breakpoints are based on component width, not screen width.\n * Will default to `px` if no unit supplied e.g. `20rem` */\n @Prop() mSize: number | string = 550;\n\n /** the component's large breakpoint. Note - all breakpoints are based on component width, not screen width.\n * Will default to `px` if no unit supplied e.g. `20rem` */\n @Prop() lSize: number | string = 800;\n\n /** the component's xl breakpoint. Note - all breakpoints are based on component width, not screen width.\n * Will default to `px` if no unit supplied e.g. `20rem` */\n @Prop() xlSize: number | string = 1000;\n\n /** the number of columns the grid has at the small breakpoint. */\n @Prop() sCols: number;\n\n /** the number of columns the grid has at the medium breakpoint. */\n @Prop() mCols: number;\n\n /** the number of columns the grid has at the large breakpoint. */\n @Prop() lCols: number;\n\n /** the number of columns the grid has at the xl breakpoint. */\n @Prop() xlCols: number;\n\n /** the number of columns the grid has at the xxl breakpoint (anything greater than the xl breakpoint) */\n @Prop() xxlCols: number;\n\n /** Optional small `grid-template`. *Note* - you must set `sCols` for this to take affect */\n @Prop() sTpl?: string;\n\n /** Optional medium `grid-template`. *Note* - you must set `mCols` for this to take affect */\n @Prop() mTpl?: string;\n\n /** Optional large `grid-template`. *Note* - you must set `lCols` for this to take affect */\n @Prop() lTpl?: string;\n\n /** Optional xl `grid-template`. *Note* - you must set `xlCols` for this to take affect */\n @Prop() xlTpl?: string;\n\n /** Optional xxl `grid-template`. *Note* - you must set `xxlCols` for this to take affect */\n @Prop() xxlTpl?: string;\n\n /** shows a grid helper to visualise where columns are */\n @Prop({ reflect: true }) showHelper: boolean = false;\n\n @Watch('sTpl')\n @Watch('mTpl')\n @Watch('lTpl')\n @Watch('xlTpl')\n @Watch('xxlTpl')\n @Watch('sSize')\n @Watch('mSize')\n @Watch('lSize')\n @Watch('xlSize')\n @Watch('sCols')\n @Watch('mCols')\n @Watch('lCols')\n @Watch('xlCols')\n @Watch('xxlCols')\n @Watch('showHelper')\n constructSizeArray() {\n this.grids = [];\n\n if (this.sCols)\n this.grids.push({\n cols: this.sCols,\n breakpoint: 0,\n name: 's',\n template: this.sTpl,\n });\n if (this.mCols)\n this.grids.push({\n cols: this.mCols,\n breakpoint: this.sSize,\n name: 'm',\n template: this.mTpl,\n });\n if (this.lSize)\n this.grids.push({\n cols: this.lCols,\n breakpoint: this.mSize,\n name: 'l',\n template: this.lTpl,\n });\n if (this.xlCols)\n this.grids.push({\n cols: this.xlCols,\n breakpoint: this.lSize,\n name: 'xl',\n template: this.xlTpl,\n });\n if (this.xxlCols)\n this.grids.push({\n cols: this.xxlCols,\n breakpoint: this.xlSize,\n name: 'xxl',\n template: this.xxlTpl,\n });\n\n this.cacheKey =\n this.grids\n .map((bp) => `${bp.cols}-${bp.breakpoint}-${bp.template || ''}`)\n .join('') +\n '-helper-' +\n this.showHelper;\n }\n\n @ConstructibleStyle({ cacheKeyProperty: 'cacheKey' }) protected styles =\n () => {\n const css = /* css */ `\n ${this.grids\n .map(\n (bp) => /* css */ `\n @container (min-width: ${\n typeof bp.breakpoint === 'number'\n ? bp.breakpoint + 1 + 'px'\n : bp.breakpoint\n }) {\n .grid {\n --current-grid-size: \"grid size: ${bp.name}\";\n ${\n bp.template\n ? `grid-template: ${bp.template};`\n : `grid-template-columns: repeat(${bp.cols}, minmax(calc((100% / ${bp.cols}) - var(--grid-col-gap)), 1fr));`\n }\n }\n ${[...Array(bp.cols)]\n .map((_, i) => {\n const gItm = i + 1;\n return /* css */ `\n .grid > [grid-states~=\"${bp.name}-col-start-${gItm}\"],\n ::slotted([grid-states~=\"${bp.name}-col-start-${gItm}\"]) {\n grid-column-start: ${gItm} !important;\n }\n .grid > [grid-states~=\"${bp.name}-col-span-${gItm}\"],\n ::slotted([grid-states~=\"${bp.name}-col-span-${gItm}\"]) {\n grid-column-end: span ${gItm} !important;\n }\n `;\n })\n .join('')}\n ${[...Array(24)]\n .map((_, i) => {\n const gItm = i + 1;\n return /* css */ `\n .grid > [grid-states~=\"${bp.name}-row-start-${gItm}\"],\n ::slotted([grid-states~=\"${bp.name}-row-start-${gItm}\"]) {\n grid-row-start: ${gItm} !important;\n }\n .grid > [grid-states~=\"${bp.name}-row-span-${gItm}\"],\n ::slotted([grid-states~=\"${bp.name}-row-span-${gItm}\"]) {\n grid-row-end: span ${gItm} !important;\n }\n `;\n })\n .join('')}\n ${\n this.showHelper &&\n /* css */ `\n .grid--helper :nth-child(-n+${bp.cols}) {\n display: block !important;\n }\n `\n }\n }\n `\n )\n .join('')}\n `;\n return css;\n };\n\n componentWillLoad() {\n this.constructSizeArray();\n }\n\n render() {\n return (\n <Host>\n <div part=\"grid\" class=\"grid\">\n <slot />\n </div>\n {this.showHelper && (\n <div class=\"grid grid--helper\" part=\"helper\">\n {[...Array(24)].map(() => (\n <div class=\"grid__helper-item\" />\n ))}\n </div>\n )}\n </Host>\n );\n }\n}\n",":host {\n /**\n * @prop --padding: padding around any content. Only relevent on `<nano-img background>`\n */\n --padding: 0;\n\n display: inline-block;\n object-fit: cover;\n object-position: center;\n background-size: cover;\n background-position: center;\n\n * {\n border-radius: inherit;\n }\n}\n\n:host([background]:not([background='false'])) {\n display: block;\n}\n\n.img {\n position: relative;\n object-fit: inherit;\n object-position: inherit;\n background-color: inherit;\n background-position: inherit;\n background-size: inherit;\n background-origin: inherit;\n background-attachment: inherit;\n background-repeat: inherit;\n flex: 1 1 100%;\n display: flex;\n flex-direction: column;\n min-block-size: inherit;\n max-block-size: inherit;\n max-inline-size: inherit;\n min-height: inherit;\n min-width: inherit;\n block-size: inherit;\n inline-size: inherit;\n height: inherit;\n width: inherit;\n max-height: inherit;\n max-width: inherit;\n aspect-ratio: inherit;\n}\n\n.img__loader,\n.img__observer {\n position: absolute;\n inset: 0;\n block-size: 100%;\n inline-size: 100%;\n z-index: -1;\n}\n\n.img__image,\n.img__bg {\n border-radius: inherit;\n display: block;\n opacity: 0;\n transition: 0.5s ease opacity, 0.3s ease filter 0.4s;\n filter: blur(5px);\n flex: 1;\n\n &.loaded {\n opacity: 1;\n filter: blur(0);\n\n @media not all and (min-resolution: 0.001dpcm) {\n @supports (-webkit-appearance: none) {\n filter: blur(0);\n }\n }\n }\n}\n\n.img__image {\n object-fit: inherit;\n object-position: inherit;\n max-inline-size: 100%;\n min-block-size: inherit;\n max-block-size: inherit;\n min-height: inherit;\n min-width: inherit;\n block-size: auto;\n inline-size: inherit;\n height: inherit;\n width: inherit;\n max-height: inherit;\n max-width: inherit;\n aspect-ratio: inherit;\n\n &.hide {\n visibility: hidden;\n\n &.no-height {\n block-size: 1px;\n position: absolute;\n z-index: -1;\n }\n }\n}\n\n.img__bg {\n background-color: inherit;\n background-position: inherit;\n background-size: inherit;\n background-origin: inherit;\n background-attachment: inherit;\n background-repeat: inherit;\n overflow: auto;\n padding: var(--padding);\n\n &.no-height {\n position: absolute;\n inset: 0;\n }\n}\n","import {\n Component,\n Element,\n Event,\n EventEmitter,\n State,\n Prop,\n Watch,\n h,\n ComponentInterface,\n Build,\n} from '@stencil/core';\nimport type { ResizeStateChangeEventDetail } from '../../interface';\n\n/**\n * Img with benefits. Lazy loading. Simple `srcSet` solution for both `<img>` and `background-image` varieties.\n * @slot - Main slot. Only relevant with `<nano-img background>`\n */\n@Component({\n tag: 'nano-img',\n styleUrl: 'img.scss',\n shadow: true,\n})\nexport class Img implements ComponentInterface {\n private io?: IntersectionObserver;\n private _srcSet: { [key: string]: { src: string; active: boolean } } = {};\n\n @Element() host!: HTMLNanoImgElement;\n\n @State() loadSrc?: string;\n @State() loadError?: () => void;\n @State() hasLoaded: boolean = false;\n @State() imgStates: string = null;\n @State() _src: string;\n @Watch('_src')\n _srcChanged() {\n this.hasLoaded = false;\n this.addIO();\n }\n\n /** This attribute defines the alternative text describing the image.\n * Users will see this text displayed if the image URL is wrong, or if the image is not yet downloaded. */\n @Prop() alt?: string;\n\n /** The image URL. This attribute is mandatory for the `<img>` element. */\n @Prop() src!: string;\n @Watch('src')\n srcChanged() {\n this._src = this.src;\n }\n\n /** Optional list string providing media sizes with corresponding image srcs.\n * i.e. show img-x at 300px wide. Format `srcSet=\"200w src/imgSmall.jpg, 500h src/imgMed.png\"` */\n @Prop() srcSet?: string;\n @Watch('srcSet')\n srcSetChanged() {\n if (!this.srcSet) return;\n\n delete this._srcSet;\n this._srcSet = {};\n\n this.imgStates = this.srcSet\n .split(',')\n .map((bpSrc) => {\n const [bp, src] = bpSrc.split(' ').filter((bp) => bp.length);\n this._srcSet[bp] = { src: src, active: false };\n return bp;\n })\n .join(', ');\n }\n\n /** Render image lazily, when it comes into the browser viewport **/\n @Prop() lazy: boolean = true;\n @Watch('lazy')\n lazyChanged() {\n if (!this.lazy) this.load();\n }\n\n /** Render the image as a background image **/\n @Prop() background?: boolean;\n\n /** When the image is rendered as a background, and there is no preset dimensions of the component,\n * you can set how the component height will be set. Via image size or via the content **/\n @Prop() autoHeight: 'content' | 'image' = 'content';\n\n /** Emitted when the img src has been set */\n @Event() nanoImgWillLoad!: EventEmitter<void>;\n\n /** Emitted when the image has finished loading */\n @Event() nanoImgDidLoad!: EventEmitter<void>;\n\n /** Emitted when the img fails to load */\n @Event() nanoImgError!: EventEmitter<void>;\n\n private addIO() {\n if (!this._src || this.hasLoaded) return;\n if (!this.lazy) {\n this.load();\n return;\n }\n if (\n typeof (window as any) !== 'undefined' &&\n 'IntersectionObserver' in window\n ) {\n this.removeIO();\n this.io = new IntersectionObserver((data) => {\n if (data[0].isIntersecting) {\n this.load();\n this.removeIO();\n }\n });\n\n this.io.observe(this.host);\n } else setTimeout(() => this.load(), 200);\n }\n\n private load() {\n this.loadError = this.onError;\n this.loadSrc = this._src;\n this.nanoImgWillLoad.emit();\n }\n\n private onLoad = () => {\n this.nanoImgDidLoad.emit();\n setTimeout(() => (this.hasLoaded = true), 50);\n };\n\n private onError = () => {\n this.nanoImgError.emit();\n };\n\n private onResize = (e: { detail: ResizeStateChangeEventDetail }) => {\n Object.entries(e.detail).forEach(([bp, active]) => {\n this._srcSet[bp].active = active;\n });\n\n // sort and find the highest sized matching image.\n const srcOpts = [];\n Object.keys(this._srcSet)\n .sort()\n .forEach((bp) => {\n if (this._srcSet[bp].active) srcOpts.push(this._srcSet[bp].src);\n });\n\n if (srcOpts.length) this._src = srcOpts.slice(-1)[0];\n // no matching image? Set back to default\n else this._src = this.src;\n };\n\n private removeIO() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n\n connectedCallback() {\n this.srcChanged();\n this.srcSetChanged();\n this.lazyChanged();\n }\n\n componentDidLoad() {\n this.addIO();\n }\n\n disconnectedCallback() {\n this.removeIO();\n }\n\n render() {\n const bgStyle = !!this.loadSrc\n ? { 'background-image': `url(${this.loadSrc})` }\n : {};\n\n return (\n <div class=\"img\">\n <nano-skeleton class=\"img__loader\"></nano-skeleton>\n {!!this.background && (\n <div\n class={{\n loaded: this.hasLoaded,\n img__bg: true,\n 'no-height': this.autoHeight === 'image',\n }}\n style={bgStyle}\n >\n <slot />\n </div>\n )}\n <img\n class={{\n img__image: true,\n loaded: this.hasLoaded,\n hide: this.background,\n 'no-height': this.autoHeight === 'content',\n }}\n decoding=\"async\"\n src={Build.isServer ? this.src : this.loadSrc}\n loading={Build.isServer && this.lazy ? 'lazy' : undefined}\n alt={this.alt}\n onLoad={this.onLoad}\n onError={this.loadError}\n />\n <nano-resize-observe\n class=\"img__observer\"\n onNanoResizeStateChange={this.onResize}\n states={this.imgStates}\n />\n </div>\n );\n }\n}\n"],"version":3}
@@ -7,24 +7,20 @@ Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-71f899a7.js');
9
9
 
10
- const heroCss = ":host {\n box-sizing: border-box;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n[hidden] {\n display: none !important;\n}\n/**\nTODO - as soon as container queries hits everywhere, strip out reliance on nano-grid breakpoints\n**/\n:host {\n /**\n * @prop --nano-loader-base: Base colour of nano-skeleton. Default depends on theme;\n * @prop --nano-loader-tint: Tint colour of nano-skeleton. Default depends on theme;\n * @prop --theme-color: Text color. Default depends on theme;\n * @prop --theme-tint-color: Color used for bread crumbs and icons. Defaults to #90c6e7;\n * @prop --scrim-color: Color of the gradient covering the background. Default depends on theme;\n * @prop --scrim-direction: Direction of the gradient covering the background. Default what content slots are present;\n * @prop --scrim-opacity-from: Starting opactiy of the gradient covering the background. Default .25;\n * @prop --scrim-opacity-to: Final opactiy of the gradient covering the background. Default depends on `theme`;\n * @prop --quote-size: Font size of the quote. Defaults to 1.3em and grows to 3rem on the xl breakpoint;\n */\n display: block;\n --nano-loader-base: #4a4a4a;\n --nano-loader-tint: #7d7d7d;\n --theme-color: #fff;\n --theme-tint-color: #90c6e7;\n --scrim-color: 0 0 0;\n --scrim-direction: 90deg;\n --scrim-opacity-from: 0.25;\n --scrim-opacity-to: 0.7;\n --padding: 0;\n --quote-size: 1.3rem;\n color: var(--theme-color);\n}\n\n:host(.is-xl) {\n --quote-size: 3rem;\n}\n\n:host([theme=light]) {\n --nano-loader-base: #fff;\n --nano-loader-tint: white;\n --theme-color: #4a4a4a;\n --scrim-color: 255 255 255;\n --scrim-opacity-from: 0.25;\n --scrim-opacity-to: 1;\n --scrim-direction: 270deg;\n color: var(--theme-color);\n}\n:host([theme=light]) .hero__primary-content {\n --color: #4a4a4a;\n}\n\n.hero {\n position: relative;\n}\n.hero--rtl {\n --scrim-direction: 270deg;\n}\n.hero--secondary:not(.hero--iconbox) {\n --scrim-direction: 0deg;\n}\n.hero__bg-wrap {\n overflow: hidden;\n}\n.hero__bg-slot {\n position: absolute;\n inset: 0;\n}\n.hero__ctas {\n display: flex;\n justify-content: flex-end;\n padding-block: 32px 0;\n padding-inline: 32px;\n -webkit-margin-after: -64px;\n margin-block-end: -64px;\n position: relative;\n z-index: 1;\n}\n@media (max-width: 52em) {\n .hero__ctas {\n display: none;\n }\n}\n@media (max-width: 58em) {\n .hero__ctas {\n -webkit-margin-after: -48px;\n margin-block-end: -48px;\n }\n}\n.hero__ctas ::slotted(a.button[slot=secondary-ctas]) {\n padding-block: 0.25rem !important;\n padding-inline: 0.5rem !important;\n font-size: 0.875rem !important;\n margin-block: 0 !important;\n margin-inline: 0.25rem !important;\n}\n.hero__img {\n display: block;\n container-type: inline-size;\n --padding: inherit;\n}\n.hero__breadcrumbs {\n display: none;\n margin-block: 20px 0;\n margin-inline: 14px;\n line-height: 14px;\n}\n.hero--breadcrumb .hero__breadcrumbs {\n display: block;\n}\n.is-xl .hero__breadcrumbs {\n margin-block: 0;\n margin-inline: 50px;\n max-inline-size: 50%;\n}\n@container (min-width: 800px) {\n .hero__breadcrumbs {\n margin-block: 0;\n margin-inline: 50px;\n max-inline-size: 50%;\n }\n}\n.is-xxl .hero__breadcrumbs {\n margin-block: 0;\n margin-inline: 83px;\n}\n@container (min-width: 900px) {\n .hero__breadcrumbs {\n margin-block: 0;\n margin-inline: 83px;\n }\n}\n.hero__breadcrumbs ::slotted(*[slot=breadcrumb]) {\n font-size: 0.85rem;\n text-transform: uppercase;\n letter-spacing: 1.5px;\n font-weight: 600;\n font-stretch: 125%;\n display: inline-block;\n -webkit-margin-after: 16px;\n margin-block-end: 16px;\n position: relative;\n z-index: 2;\n}\n.hero--hasbg .hero__breadcrumbs ::slotted(*[slot=breadcrumb]) {\n text-shadow: 1px 1px rgba(0, 0, 0, 0.15);\n}\n.hero__breadcrumbs ::slotted(a[slot=breadcrumb]) {\n color: var(--theme-tint-color) !important;\n cursor: pointer;\n}\n.hero__breadcrumbs ::slotted(.slash[slot=breadcrumb]) {\n color: var(--theme-color);\n position: relative;\n margin-block: 0;\n margin-inline: 0.5rem;\n display: inline-block;\n}\n.hero__scrim {\n position: absolute;\n inset: 0;\n z-index: 0;\n background: linear-gradient(var(--scrim-direction), rgb(var(--scrim-color)/var(--scrim-opacity-from)) 0%, rgb(var(--scrim-color)/var(--scrim-opacity-to)) 100%);\n}\n.hero--scrim .hero__scrim {\n background: none;\n}\n.hero__content {\n max-inline-size: 1440px;\n display: block;\n --grid-row-gap: 0;\n margin-block: 0;\n margin-inline: auto;\n position: relative;\n}\n.hero__content.is-xl {\n -webkit-margin-before: 50px;\n margin-block-start: 50px;\n max-inline-size: 1540px;\n}\n@container (min-width: 800px) {\n .hero__content {\n margin-block: 50px 0 !important;\n max-inline-size: 1540px !important;\n }\n}\n.hero__content.is-xxl {\n -webkit-margin-before: 83px;\n margin-block-start: 83px;\n max-inline-size: 1606px;\n}\n@container (min-width: 900px) {\n .hero__content {\n margin-block: 83px 0 !important;\n max-inline-size: 1606px !important;\n }\n}\n.hero__primary {\n margin: 16px;\n}\n.hero--breadcrumb .hero__primary {\n margin-block: 0;\n margin-inline: 16px;\n}\n.hero--backbtn .hero__primary {\n -webkit-margin-start: 0;\n margin-inline-start: 0;\n}\n.hero__primary ::slotted(nano-icon-button[slot=back-btn]) {\n font-size: 2rem;\n}\n.is-xl .hero__primary {\n margin-block: 0 50px;\n margin-inline: 50px 0;\n}\n.is-xl .hero__primary ::slotted(nano-icon-button[slot=back-btn]) {\n margin-block: 0;\n margin-inline: -3rem 0;\n}\n@container (min-width: 800px) {\n .hero__primary {\n margin-block: 0 50px !important;\n margin-inline: 50px 0 !important;\n }\n .hero__primary ::slotted(nano-icon-button[slot=back-btn]) {\n margin-block: 0 !important;\n margin-inline: -3rem 0 !important;\n }\n}\n.is-xxl .hero__primary {\n margin-block: 0 83px !important;\n margin-inline: 83px 0 !important;\n}\n@container (min-width: 900px) {\n .hero__primary {\n margin-block: 0 83px !important;\n margin-inline: 83px 0 !important;\n }\n}\n.hero__primary-content {\n max-inline-size: 45rem;\n --color: #fff;\n display: flex;\n}\n.hero--backbtn .hero__primary-content > div {\n padding-block: 10px 0;\n padding-inline: 0;\n}\n.hero__primary-content ::slotted(h1[slot=primary-content]) {\n line-height: 26px !important;\n margin-block: 0 18px !important;\n font-size: 2rem !important;\n}\n.is-xl .hero__primary-content ::slotted(h1[slot=primary-content]) {\n line-height: 31px !important;\n -webkit-margin-after: 30px !important;\n margin-block-end: 30px !important;\n}\n.is-xl .hero__primary-content ::slotted(.button[slot=primary-content]) {\n -webkit-margin-before: 20px !important;\n margin-block-start: 20px !important;\n}\n@container (min-width: 800px) {\n .hero__primary-content ::slotted(h1[slot=primary-content]) {\n line-height: 31px !important;\n -webkit-margin-after: 30px !important;\n margin-block-end: 30px !important;\n }\n .hero__primary-content ::slotted(.button[slot=primary-content]) {\n -webkit-margin-before: 20px !important;\n margin-block-start: 20px !important;\n }\n}\n.hero__secondary {\n display: none;\n block-size: 100%;\n padding-block: 0 20px;\n padding-inline: 14px;\n}\n.hero--secondary .hero__secondary {\n display: flex;\n align-items: center;\n}\n.is-xl .hero__secondary {\n padding-block: 0 50px;\n padding-inline: 50px;\n justify-content: flex-end;\n}\n@container (min-width: 800px) {\n .hero__secondary {\n padding-block: 0 50px;\n padding-inline: 50px;\n justify-content: flex-end;\n }\n}\n.is-xxl .hero__secondary {\n padding-block: 0 83px;\n padding-inline: 83px;\n}\n@container (min-width: 900px) {\n .hero__secondary {\n padding-block: 0 83px;\n padding-inline: 83px;\n }\n}\n.hero__icon-box {\n background: rgba(0, 0, 0, 0.7);\n padding: 24px;\n inline-size: 100%;\n -webkit-margin-after: auto;\n margin-block-end: auto;\n display: flex;\n flex-direction: column;\n color: white;\n}\n.is-xl .hero__icon-box {\n max-inline-size: 410px;\n flex: 0 1 410px;\n}\n.hero__icon-box ::slotted([slot=icon-box-item]) {\n --nano-color-base: var(--theme-tint-color);\n --nano-icon-size: 32px;\n --nano-icon-margin-end: 20px;\n display: flex;\n align-items: center;\n font-size: 0.8125rem;\n -webkit-margin-after: 20px;\n margin-block-end: 20px;\n}\n.hero__icon-box ::slotted(.last[slot=icon-box-item]) {\n -webkit-margin-after: 0;\n margin-block-end: 0;\n}\n.hero__quote-content {\n -webkit-margin-before: auto;\n margin-block-start: auto;\n text-align: center;\n inline-size: 100%;\n}\n.is-xl .hero__quote-content {\n max-inline-size: 500px;\n flex: 0 1 500px;\n text-align: initial;\n}\n@container (min-width: 800px) {\n .hero__quote-content {\n max-inline-size: 500px;\n flex: 0 1 500px;\n text-align: initial;\n }\n}\n.hero__quote::before, .hero__quote::after {\n content: '\"';\n font-size: var(--quote-size);\n font-weight: 700;\n font-style: italic;\n line-height: 0;\n color: #abb6b8;\n display: inline;\n position: relative;\n}\n.hero__quote ::slotted([slot=quote]) {\n font-size: var(--quote-size);\n font-weight: 300;\n font-style: italic;\n display: inline;\n}\n.hero__quote-author {\n text-align: end;\n font-size: 1rem;\n opacity: 0.8;\n}\n.hero--sub .hero__content.is-xl {\n -webkit-margin-before: 40px;\n margin-block-start: 40px;\n}\n.hero--sub .hero__content.is-xl .hero__primary {\n margin-block: 0 40px;\n margin-inline: 50px 0;\n}\n.hero--sub .hero__content.is-xl .hero__secondary {\n padding-block: 0 50px;\n padding-inline: 40px 50px;\n}\n.hero--sub .hero__content.is-xl ::slotted(.button[slot=primary-content]) {\n -webkit-margin-before: 8px !important;\n margin-block-start: 8px !important;\n}\n.hero--sub .hero__content.is-xl ::slotted(h1[slot=primary-content]) {\n -webkit-margin-after: 18px !important;\n margin-block-end: 18px !important;\n}\n.hero--sub .hero__content.is-xxl .hero__primary {\n margin-block: 0 40px;\n margin-inline: 83px 0;\n}\n.hero--sub .hero__content.is-xxl .hero__secondary {\n padding-block: 0 83px;\n padding-inline: 40px 83px;\n}";
10
+ const heroCss = ":host {\n box-sizing: border-box;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n[hidden] {\n display: none !important;\n}\n/**\nTODO - as soon as container queries hits everywhere, strip out reliance on nano-grid breakpoints\n**/\n:host {\n /**\n * @prop --nano-loader-base: Base colour of nano-skeleton. Default depends on theme;\n * @prop --nano-loader-tint: Tint colour of nano-skeleton. Default depends on theme;\n * @prop --theme-color: Text color. Default depends on theme;\n * @prop --theme-tint-color: Color used for bread crumbs and icons. Defaults to #90c6e7;\n * @prop --scrim-color: Color of the gradient covering the background. Default depends on theme;\n * @prop --scrim-direction: Direction of the gradient covering the background. Default what content slots are present;\n * @prop --scrim-opacity-from: Starting opactiy of the gradient covering the background. Default .25;\n * @prop --scrim-opacity-to: Final opactiy of the gradient covering the background. Default depends on `theme`;\n * @prop --quote-size: Font size of the quote. Defaults to 1.3em and grows to 3rem on the xl breakpoint;\n */\n --nano-loader-base: #4a4a4a;\n --nano-loader-tint: #7d7d7d;\n --theme-color: #fff;\n --theme-tint-color: #90c6e7;\n --scrim-color: 0 0 0;\n --scrim-direction: 90deg;\n --scrim-opacity-from: 0.25;\n --scrim-opacity-to: 0.7;\n --padding: 0;\n --quote-size: 1.3rem;\n color: var(--theme-color);\n display: block;\n container-type: inline-size;\n}\n\n:host([theme=light]) {\n --nano-loader-base: #fff;\n --nano-loader-tint: white;\n --theme-color: #4a4a4a;\n --scrim-color: 255 255 255;\n --scrim-opacity-from: 0.25;\n --scrim-opacity-to: 1;\n --scrim-direction: 270deg;\n color: var(--theme-color);\n}\n:host([theme=light]) .hero__primary-content {\n --color: #4a4a4a;\n}\n\n.hero {\n position: relative;\n}\n@container (min-width: 800px) {\n .hero {\n --quote-size: 3rem;\n }\n}\n.hero--rtl {\n --scrim-direction: 270deg;\n}\n.hero--secondary:not(.hero--iconbox) {\n --scrim-direction: 0deg;\n}\n.hero__bg-wrap {\n overflow: hidden;\n}\n.hero__bg-slot {\n position: absolute;\n inset: 0;\n}\n.hero__ctas {\n display: flex;\n justify-content: flex-end;\n padding-block: 32px 0;\n padding-inline: 32px;\n -webkit-margin-after: -64px;\n margin-block-end: -64px;\n position: relative;\n z-index: 1;\n}\n@media (max-width: 52em) {\n .hero__ctas {\n display: none;\n }\n}\n@media (max-width: 58em) {\n .hero__ctas {\n -webkit-margin-after: -48px;\n margin-block-end: -48px;\n }\n}\n.hero__ctas ::slotted(a.button[slot=secondary-ctas]) {\n padding-block: 0.25rem !important;\n padding-inline: 0.5rem !important;\n font-size: 0.875rem !important;\n margin-block: 0 !important;\n margin-inline: 0.25rem !important;\n}\n.hero__img {\n display: block;\n --padding: inherit;\n}\n.hero__breadcrumbs {\n display: none;\n margin-block: 20px 0;\n margin-inline: 14px;\n line-height: 14px;\n}\n.hero--breadcrumb .hero__breadcrumbs {\n display: block;\n}\n@container (min-width: 800px) {\n .hero__breadcrumbs {\n margin-block: 0;\n margin-inline: 50px;\n max-inline-size: 50%;\n }\n}\n@container (min-width: 900px) {\n .hero__breadcrumbs {\n margin-block: 0;\n margin-inline: 83px;\n }\n}\n.hero__breadcrumbs ::slotted(*[slot=breadcrumb]) {\n font-size: 0.85rem;\n text-transform: uppercase;\n letter-spacing: 1.5px;\n font-weight: 600;\n font-stretch: 125%;\n display: inline-block;\n -webkit-margin-after: 16px;\n margin-block-end: 16px;\n position: relative;\n z-index: 2;\n}\n.hero--hasbg .hero__breadcrumbs ::slotted(*[slot=breadcrumb]) {\n text-shadow: 1px 1px rgba(0, 0, 0, 0.15);\n}\n.hero__breadcrumbs ::slotted(a[slot=breadcrumb]) {\n color: var(--theme-tint-color) !important;\n cursor: pointer;\n}\n.hero__breadcrumbs ::slotted(.slash[slot=breadcrumb]) {\n color: var(--theme-color);\n position: relative;\n margin-block: 0;\n margin-inline: 0.5rem;\n display: inline-block;\n}\n.hero__scrim {\n position: absolute;\n inset: 0;\n z-index: 0;\n background: linear-gradient(var(--scrim-direction), rgb(var(--scrim-color)/var(--scrim-opacity-from)) 0%, rgb(var(--scrim-color)/var(--scrim-opacity-to)) 100%);\n}\n.hero--scrim .hero__scrim {\n background: none;\n}\n.hero__content {\n max-inline-size: 1440px;\n display: block;\n --grid-row-gap: 0;\n margin-block: 0;\n margin-inline: auto;\n position: relative;\n}\n@container (min-width: 800px) {\n .hero__content {\n margin-block: 50px 0 !important;\n max-inline-size: 1540px !important;\n }\n}\n@container (min-width: 900px) {\n .hero__content {\n margin-block: 83px 0 !important;\n max-inline-size: 1606px !important;\n }\n}\n.hero__primary {\n margin: 16px;\n}\n.hero--breadcrumb .hero__primary {\n margin-block: 0;\n margin-inline: 16px;\n}\n.hero--backbtn .hero__primary {\n -webkit-margin-start: 0;\n margin-inline-start: 0;\n}\n.hero__primary ::slotted(nano-icon-button[slot=back-btn]) {\n font-size: 2rem;\n}\n@container (min-width: 800px) {\n .hero__primary {\n margin-block: 0 50px !important;\n margin-inline: 50px 0 !important;\n }\n .hero__primary ::slotted(nano-icon-button[slot=back-btn]) {\n margin-block: 0 !important;\n margin-inline: -3rem 0 !important;\n }\n}\n@container (min-width: 900px) {\n .hero__primary {\n margin-block: 0 83px !important;\n margin-inline: 83px 0 !important;\n }\n}\n.hero__primary-content {\n max-inline-size: 45rem;\n --color: #fff;\n display: flex;\n}\n.hero--backbtn .hero__primary-content > div {\n padding-block: 10px 0;\n padding-inline: 0;\n}\n.hero__primary-content ::slotted(h1[slot=primary-content]) {\n line-height: 26px !important;\n margin-block: 0 18px !important;\n font-size: 2rem !important;\n}\n@container (min-width: 800px) {\n .hero__primary-content ::slotted(h1[slot=primary-content]) {\n line-height: 31px !important;\n -webkit-margin-after: 30px !important;\n margin-block-end: 30px !important;\n }\n .hero__primary-content ::slotted(.button[slot=primary-content]) {\n -webkit-margin-before: 20px !important;\n margin-block-start: 20px !important;\n }\n}\n.hero__secondary {\n display: none;\n block-size: 100%;\n padding-block: 0 20px;\n padding-inline: 14px;\n}\n.hero--secondary .hero__secondary {\n display: flex;\n align-items: center;\n}\n@container (min-width: 800px) {\n .hero__secondary {\n padding-block: 0 50px;\n padding-inline: 50px;\n justify-content: flex-end;\n }\n}\n@container (min-width: 900px) {\n .hero__secondary {\n padding-block: 0 83px;\n padding-inline: 83px;\n }\n}\n.hero__icon-box {\n background: rgba(0, 0, 0, 0.7);\n padding: 24px;\n inline-size: 100%;\n -webkit-margin-after: auto;\n margin-block-end: auto;\n display: flex;\n flex-direction: column;\n color: white;\n}\n@container (min-width: 800px) {\n .hero__icon-box {\n max-inline-size: 410px;\n flex: 0 1 410px;\n }\n}\n.hero__icon-box ::slotted([slot=icon-box-item]) {\n --nano-color-base: var(--theme-tint-color);\n --nano-icon-size: 32px;\n --nano-icon-margin-end: 20px;\n display: flex;\n align-items: center;\n font-size: 0.8125rem;\n -webkit-margin-after: 20px;\n margin-block-end: 20px;\n}\n.hero__icon-box ::slotted(.last[slot=icon-box-item]) {\n -webkit-margin-after: 0;\n margin-block-end: 0;\n}\n.hero__quote-content {\n -webkit-margin-before: auto;\n margin-block-start: auto;\n text-align: center;\n inline-size: 100%;\n}\n@container (min-width: 800px) {\n .hero__quote-content {\n max-inline-size: 500px;\n flex: 0 1 500px;\n text-align: initial;\n }\n}\n.hero__quote::before, .hero__quote::after {\n content: '\"';\n font-size: var(--quote-size);\n font-weight: 700;\n font-style: italic;\n line-height: 0;\n color: #abb6b8;\n display: inline;\n position: relative;\n}\n.hero__quote ::slotted([slot=quote]) {\n font-size: var(--quote-size);\n font-weight: 300;\n font-style: italic;\n display: inline;\n}\n.hero__quote-author {\n text-align: end;\n font-size: 1rem;\n opacity: 0.8;\n}\n@container (min-width: 800px) {\n .hero--sub .hero__content {\n -webkit-margin-before: 40px;\n margin-block-start: 40px;\n }\n .hero--sub .hero__content .hero__primary {\n margin-block: 0 40px;\n margin-inline: 50px 0;\n }\n .hero--sub .hero__content .hero__secondary {\n padding-block: 0 50px;\n padding-inline: 40px 50px;\n }\n .hero--sub .hero__content ::slotted(.button[slot=primary-content]) {\n -webkit-margin-before: 8px !important;\n margin-block-start: 8px !important;\n }\n .hero--sub .hero__content ::slotted(h1[slot=primary-content]) {\n -webkit-margin-after: 18px !important;\n margin-block-end: 18px !important;\n }\n}\n@container (min-width: 900px) {\n .hero--sub .hero__content .hero__primary {\n margin-block: 0 40px;\n margin-inline: 83px 0;\n }\n .hero--sub .hero__content .hero__secondary {\n padding-block: 0 83px;\n padding-inline: 40px 83px;\n }\n}";
11
11
 
12
12
  const Hero = class {
13
13
  constructor(hostRef) {
14
14
  index.registerInstance(this, hostRef);
15
- this.handleGridChange = (e) => {
16
- this.gridSizes = e.detail;
17
- };
18
15
  this.HeroContent = () => {
19
16
  return [
20
17
  !this.hasIconBox && this.hasCtas ? (index.h("div", { class: "hero__ctas" }, index.h("slot", { name: "secondary-ctas" }))) : (''),
21
18
  index.h("div", { class: "hero__scrim" }, index.h("slot", { name: "scrim" })),
22
- index.h("nano-grid", { onNanoBpChange: this.handleGridChange, class: "hero__content", xlCols: 2, xlSize: this.largeScreenBP }, index.h("nano-grid-item", { gridStates: "xl-col-span-2" }, index.h("div", { class: "hero__breadcrumbs" }, index.h("slot", { name: "breadcrumb" }))), index.h("nano-grid-item", { gridStates: this.hasSecondaryContent
19
+ index.h("nano-grid", { class: "hero__content", xlCols: 2, xlSize: this.largeScreenBP }, index.h("div", { "grid-states": "xl-col-span-2" }, index.h("div", { class: "hero__breadcrumbs" }, index.h("slot", { name: "breadcrumb" }))), index.h("div", { "grid-states": this.hasSecondaryContent
23
20
  ? 'xl-col-span-1 xl-col-start-1 xl-row-start-2'
24
- : 'xl-col-span-2 xl-col-start-1 xl-row-start-2' }, index.h("div", { class: "hero__primary" }, index.h("div", { class: "hero__primary-content" }, index.h("slot", { name: "back-btn" }), index.h("div", null, index.h("slot", { name: "primary-content" }))))), this.hasSecondaryContent && (index.h("nano-grid-item", { gridStates: "xl-col-span-1 xl-col-start-2 xl-row-start-2" }, index.h("div", { class: "hero__secondary" }, index.h("slot", { name: "secondary-content" }), this.hasIconBox && (index.h("div", { class: "hero__icon-box" }, index.h("slot", { name: "icon-box" }), index.h("slot", { name: "icon-box-item" }))), this.hasQuote && (index.h("div", { class: "hero__quote-content" }, index.h("span", { class: "hero__quote" }, index.h("slot", { name: "quote" })), index.h("div", { class: "hero__quote-author" }, index.h("slot", { name: "quote-author" })))))))),
21
+ : 'xl-col-span-2 xl-col-start-1 xl-row-start-2' }, index.h("div", { class: "hero__primary" }, index.h("div", { class: "hero__primary-content" }, index.h("slot", { name: "back-btn" }), index.h("div", null, index.h("slot", { name: "primary-content" }))))), this.hasSecondaryContent && (index.h("div", { "grid-states": "xl-col-span-1 xl-col-start-2 xl-row-start-2" }, index.h("div", { class: "hero__secondary" }, index.h("slot", { name: "secondary-content" }), this.hasIconBox && (index.h("div", { class: "hero__icon-box" }, index.h("slot", { name: "icon-box" }), index.h("slot", { name: "icon-box-item" }))), this.hasQuote && (index.h("div", { class: "hero__quote-content" }, index.h("span", { class: "hero__quote" }, index.h("slot", { name: "quote" })), index.h("div", { class: "hero__quote-author" }, index.h("slot", { name: "quote-author" })))))))),
25
22
  ];
26
23
  };
27
- this.gridSizes = [];
28
24
  this.hasIconBox = undefined;
29
25
  this.hasScrim = undefined;
30
26
  this.hasSecondaryContent = undefined;
@@ -96,9 +92,7 @@ const Hero = class {
96
92
  render() {
97
93
  const rtl = this.host.dir === 'rtl' ||
98
94
  this.host.ownerDocument.dir === 'rtl';
99
- return (index.h(index.Host, { class: {
100
- [this.gridSizes.join(' ')]: true,
101
- } }, index.h("div", { class: {
95
+ return (index.h(index.Host, null, index.h("div", { class: {
102
96
  hero: true,
103
97
  'hero--light': this.theme === 'light',
104
98
  'hero--secondary': this.hasSecondaryContent,