@nextrap/ntl-2col 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ ## 0.1.1 (2025-05-27)
2
+
3
+ This was a version bump only for ntl-2col to align it with other projects, there were no code changes.
4
+
5
+ ## 0.1.0 (2025-05-27)
6
+
7
+ This was a version bump only for ntl-2col to align it with other projects, there were no code changes.
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # ntl-2col
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build ntl-2col` to build the library.
8
+
9
+ ## Running unit tests
10
+
11
+ Run `nx test ntl-2col` to execute the unit tests via [Vitest](https://vitest.dev/).
package/index.css ADDED
@@ -0,0 +1 @@
1
+ :root{--nt-primary: #007bff;--nt-accent: #6610f2;--nt-success: #28a745;--nt-info: #17a2b8;--nt-warning: #ffc107;--nt-danger: #dc3545;--nt-light: #f8f9fa;--nt-dark: #343a40;--nt-white: #fff;--nt-black: #000;--nt-soft-primary: rgb(204, 228.6, 255);--nt-soft-accent: rgb(225.8571428571, 209.4761904762, 252.5238095238);--nt-soft-success: rgb(175.1304347826, 235.8695652174, 189);--nt-soft-info: rgb(167, 233.4782608696, 244);--nt-soft-warning: #fff4d3;--nt-soft-danger: rgb(250.1265822785, 226.8734177215, 229.1012658228);--nt-soft-light: white;--nt-soft-dark: rgb(150.1724137931, 160, 169.8275862069);--nt-text-color: #000;--nt-text-on-primary-color: #fff;--nt-text-on-accent-color: #fff;--nt-text-on-success-color: #000;--nt-text-on-info-color: #000;--nt-text-on-warning-color: #000;--nt-text-on-danger-color: #000;--nt-text-on-light-color: #000;--nt-text-on-dark-color: #fff;--nt-text-on-white-color: #000;--nt-text-on-black-color: #fff;--nt-background-color: #fff;--nt-base-gap: 1rem;--nt-base-space: 1rem;--nt-border-radius: .25rem;--nt-border-width: 1px}@media (min-width: 576px){:root{--nt-container-width: 540px}}@media (min-width: 768px){:root{--nt-container-width: 720px}}@media (min-width: 992px){:root{--nt-container-width: 960px}}@media (min-width: 1200px){:root{--nt-container-width: 1140px}}@media (min-width: 1400px){:root{--nt-container-width: 1320px}}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{height:100%;width:100%;font-family:sans-serif;line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}img,picture,video,canvas,svg{display:block;max-width:100%}input,button,textarea,select{font:inherit;color:inherit;background:none;border:none;outline:none}a{color:inherit;text-decoration:none}ul,ol{list-style:none}table{border-collapse:collapse;border-spacing:0}
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './lib/ntl-2col';
package/index.js ADDED
@@ -0,0 +1,731 @@
1
+ class _t {
2
+ constructor(t) {
3
+ this.delay = t, this.timeout = null;
4
+ }
5
+ async wait() {
6
+ return this.timeout && clearTimeout(this.timeout), new Promise((t) => {
7
+ this.timeout = setTimeout(() => {
8
+ t(!0);
9
+ }, this.delay);
10
+ });
11
+ }
12
+ debounce(t) {
13
+ this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(() => {
14
+ t();
15
+ }, this.delay);
16
+ }
17
+ }
18
+ const w = {
19
+ xs: { name: "xs", minWidth: 0 },
20
+ sm: { name: "sm", minWidth: 576 },
21
+ md: { name: "md", minWidth: 768 },
22
+ lg: { name: "lg", minWidth: 992 },
23
+ xl: { name: "xl", minWidth: 1200 },
24
+ xxl: { name: "xxl", minWidth: 1400 }
25
+ };
26
+ let S = w.xs;
27
+ function j() {
28
+ const r = window.innerWidth;
29
+ let t = w.xs;
30
+ for (const e in w) {
31
+ const s = w[e];
32
+ r >= s.minWidth && (t = s);
33
+ }
34
+ return t;
35
+ }
36
+ function mt(r) {
37
+ if (typeof r == "string" && r.endsWith("px") && (r = parseInt(r.replace("px", ""))), typeof r == "string") {
38
+ if (r = w[r], !r)
39
+ throw new Error(`Breakpoint ${r} not found. Defined breakpoints are: ${Object.keys(w).join(", ")}`);
40
+ } else typeof r == "number" && (r = { name: "c", minWidth: r });
41
+ return window.innerWidth >= r.minWidth;
42
+ }
43
+ if (!window.__nextrap_current_breakpoint) {
44
+ window.__nextrap_current_breakpoint = j();
45
+ const r = new _t(500);
46
+ window.addEventListener("resize", async () => {
47
+ if (await r.wait(), S !== j()) {
48
+ S = j(), window.__nextrap_current_breakpoint = S;
49
+ const t = new CustomEvent("breakpoint-changed", {
50
+ detail: { breakpoint: S }
51
+ });
52
+ console.log("Breakpoint changed", S), window.dispatchEvent(t);
53
+ }
54
+ });
55
+ }
56
+ /**
57
+ * @license
58
+ * Copyright 2019 Google LLC
59
+ * SPDX-License-Identifier: BSD-3-Clause
60
+ */
61
+ const k = globalThis, V = k.ShadowRoot && (k.ShadyCSS === void 0 || k.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, lt = Symbol(), Q = /* @__PURE__ */ new WeakMap();
62
+ let ct = class {
63
+ constructor(t, e, s) {
64
+ if (this._$cssResult$ = !0, s !== lt) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
65
+ this.cssText = t, this.t = e;
66
+ }
67
+ get styleSheet() {
68
+ let t = this.o;
69
+ const e = this.t;
70
+ if (V && t === void 0) {
71
+ const s = e !== void 0 && e.length === 1;
72
+ s && (t = Q.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Q.set(e, t));
73
+ }
74
+ return t;
75
+ }
76
+ toString() {
77
+ return this.cssText;
78
+ }
79
+ };
80
+ const F = (r) => new ct(typeof r == "string" ? r : r + "", void 0, lt), yt = (r, t) => {
81
+ if (V) r.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
82
+ else for (const e of t) {
83
+ const s = document.createElement("style"), i = k.litNonce;
84
+ i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
85
+ }
86
+ }, X = V ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
87
+ let e = "";
88
+ for (const s of t.cssRules) e += s.cssText;
89
+ return F(e);
90
+ })(r) : r;
91
+ /**
92
+ * @license
93
+ * Copyright 2017 Google LLC
94
+ * SPDX-License-Identifier: BSD-3-Clause
95
+ */
96
+ const { is: gt, defineProperty: vt, getOwnPropertyDescriptor: At, getOwnPropertyNames: wt, getOwnPropertySymbols: Et, getPrototypeOf: bt } = Object, _ = globalThis, Y = _.trustedTypes, St = Y ? Y.emptyScript : "", W = _.reactiveElementPolyfillSupport, C = (r, t) => r, B = { toAttribute(r, t) {
97
+ switch (t) {
98
+ case Boolean:
99
+ r = r ? St : null;
100
+ break;
101
+ case Object:
102
+ case Array:
103
+ r = r == null ? r : JSON.stringify(r);
104
+ }
105
+ return r;
106
+ }, fromAttribute(r, t) {
107
+ let e = r;
108
+ switch (t) {
109
+ case Boolean:
110
+ e = r !== null;
111
+ break;
112
+ case Number:
113
+ e = r === null ? null : Number(r);
114
+ break;
115
+ case Object:
116
+ case Array:
117
+ try {
118
+ e = JSON.parse(r);
119
+ } catch {
120
+ e = null;
121
+ }
122
+ }
123
+ return e;
124
+ } }, J = (r, t) => !gt(r, t), tt = { attribute: !0, type: String, converter: B, reflect: !1, useDefault: !1, hasChanged: J };
125
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), _.litPropertyMetadata ?? (_.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
126
+ let y = class extends HTMLElement {
127
+ static addInitializer(t) {
128
+ this._$Ei(), (this.l ?? (this.l = [])).push(t);
129
+ }
130
+ static get observedAttributes() {
131
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
132
+ }
133
+ static createProperty(t, e = tt) {
134
+ if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
135
+ const s = Symbol(), i = this.getPropertyDescriptor(t, s, e);
136
+ i !== void 0 && vt(this.prototype, t, i);
137
+ }
138
+ }
139
+ static getPropertyDescriptor(t, e, s) {
140
+ const { get: i, set: n } = At(this.prototype, t) ?? { get() {
141
+ return this[e];
142
+ }, set(o) {
143
+ this[e] = o;
144
+ } };
145
+ return { get: i, set(o) {
146
+ const a = i == null ? void 0 : i.call(this);
147
+ n == null || n.call(this, o), this.requestUpdate(t, a, s);
148
+ }, configurable: !0, enumerable: !0 };
149
+ }
150
+ static getPropertyOptions(t) {
151
+ return this.elementProperties.get(t) ?? tt;
152
+ }
153
+ static _$Ei() {
154
+ if (this.hasOwnProperty(C("elementProperties"))) return;
155
+ const t = bt(this);
156
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
157
+ }
158
+ static finalize() {
159
+ if (this.hasOwnProperty(C("finalized"))) return;
160
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(C("properties"))) {
161
+ const e = this.properties, s = [...wt(e), ...Et(e)];
162
+ for (const i of s) this.createProperty(i, e[i]);
163
+ }
164
+ const t = this[Symbol.metadata];
165
+ if (t !== null) {
166
+ const e = litPropertyMetadata.get(t);
167
+ if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
168
+ }
169
+ this._$Eh = /* @__PURE__ */ new Map();
170
+ for (const [e, s] of this.elementProperties) {
171
+ const i = this._$Eu(e, s);
172
+ i !== void 0 && this._$Eh.set(i, e);
173
+ }
174
+ this.elementStyles = this.finalizeStyles(this.styles);
175
+ }
176
+ static finalizeStyles(t) {
177
+ const e = [];
178
+ if (Array.isArray(t)) {
179
+ const s = new Set(t.flat(1 / 0).reverse());
180
+ for (const i of s) e.unshift(X(i));
181
+ } else t !== void 0 && e.push(X(t));
182
+ return e;
183
+ }
184
+ static _$Eu(t, e) {
185
+ const s = e.attribute;
186
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
187
+ }
188
+ constructor() {
189
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
190
+ }
191
+ _$Ev() {
192
+ var t;
193
+ this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
194
+ }
195
+ addController(t) {
196
+ var e;
197
+ (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
198
+ }
199
+ removeController(t) {
200
+ var e;
201
+ (e = this._$EO) == null || e.delete(t);
202
+ }
203
+ _$E_() {
204
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
205
+ for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
206
+ t.size > 0 && (this._$Ep = t);
207
+ }
208
+ createRenderRoot() {
209
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
210
+ return yt(t, this.constructor.elementStyles), t;
211
+ }
212
+ connectedCallback() {
213
+ var t;
214
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
215
+ var s;
216
+ return (s = e.hostConnected) == null ? void 0 : s.call(e);
217
+ });
218
+ }
219
+ enableUpdating(t) {
220
+ }
221
+ disconnectedCallback() {
222
+ var t;
223
+ (t = this._$EO) == null || t.forEach((e) => {
224
+ var s;
225
+ return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
226
+ });
227
+ }
228
+ attributeChangedCallback(t, e, s) {
229
+ this._$AK(t, s);
230
+ }
231
+ _$ET(t, e) {
232
+ var n;
233
+ const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
234
+ if (i !== void 0 && s.reflect === !0) {
235
+ const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : B).toAttribute(e, s.type);
236
+ this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
237
+ }
238
+ }
239
+ _$AK(t, e) {
240
+ var n, o;
241
+ const s = this.constructor, i = s._$Eh.get(t);
242
+ if (i !== void 0 && this._$Em !== i) {
243
+ const a = s.getPropertyOptions(i), h = typeof a.converter == "function" ? { fromAttribute: a.converter } : ((n = a.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? a.converter : B;
244
+ this._$Em = i, this[i] = h.fromAttribute(e, a.type) ?? ((o = this._$Ej) == null ? void 0 : o.get(i)) ?? null, this._$Em = null;
245
+ }
246
+ }
247
+ requestUpdate(t, e, s) {
248
+ var i;
249
+ if (t !== void 0) {
250
+ const n = this.constructor, o = this[t];
251
+ if (s ?? (s = n.getPropertyOptions(t)), !((s.hasChanged ?? J)(o, e) || s.useDefault && s.reflect && o === ((i = this._$Ej) == null ? void 0 : i.get(t)) && !this.hasAttribute(n._$Eu(t, s)))) return;
252
+ this.C(t, e, s);
253
+ }
254
+ this.isUpdatePending === !1 && (this._$ES = this._$EP());
255
+ }
256
+ C(t, e, { useDefault: s, reflect: i, wrapped: n }, o) {
257
+ s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
258
+ }
259
+ async _$EP() {
260
+ this.isUpdatePending = !0;
261
+ try {
262
+ await this._$ES;
263
+ } catch (e) {
264
+ Promise.reject(e);
265
+ }
266
+ const t = this.scheduleUpdate();
267
+ return t != null && await t, !this.isUpdatePending;
268
+ }
269
+ scheduleUpdate() {
270
+ return this.performUpdate();
271
+ }
272
+ performUpdate() {
273
+ var s;
274
+ if (!this.isUpdatePending) return;
275
+ if (!this.hasUpdated) {
276
+ if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
277
+ for (const [n, o] of this._$Ep) this[n] = o;
278
+ this._$Ep = void 0;
279
+ }
280
+ const i = this.constructor.elementProperties;
281
+ if (i.size > 0) for (const [n, o] of i) {
282
+ const { wrapped: a } = o, h = this[n];
283
+ a !== !0 || this._$AL.has(n) || h === void 0 || this.C(n, void 0, o, h);
284
+ }
285
+ }
286
+ let t = !1;
287
+ const e = this._$AL;
288
+ try {
289
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((i) => {
290
+ var n;
291
+ return (n = i.hostUpdate) == null ? void 0 : n.call(i);
292
+ }), this.update(e)) : this._$EM();
293
+ } catch (i) {
294
+ throw t = !1, this._$EM(), i;
295
+ }
296
+ t && this._$AE(e);
297
+ }
298
+ willUpdate(t) {
299
+ }
300
+ _$AE(t) {
301
+ var e;
302
+ (e = this._$EO) == null || e.forEach((s) => {
303
+ var i;
304
+ return (i = s.hostUpdated) == null ? void 0 : i.call(s);
305
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
306
+ }
307
+ _$EM() {
308
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
309
+ }
310
+ get updateComplete() {
311
+ return this.getUpdateComplete();
312
+ }
313
+ getUpdateComplete() {
314
+ return this._$ES;
315
+ }
316
+ shouldUpdate(t) {
317
+ return !0;
318
+ }
319
+ update(t) {
320
+ this._$Eq && (this._$Eq = this._$Eq.forEach((e) => this._$ET(e, this[e]))), this._$EM();
321
+ }
322
+ updated(t) {
323
+ }
324
+ firstUpdated(t) {
325
+ }
326
+ };
327
+ y.elementStyles = [], y.shadowRootOptions = { mode: "open" }, y[C("elementProperties")] = /* @__PURE__ */ new Map(), y[C("finalized")] = /* @__PURE__ */ new Map(), W == null || W({ ReactiveElement: y }), (_.reactiveElementVersions ?? (_.reactiveElementVersions = [])).push("2.1.0");
328
+ /**
329
+ * @license
330
+ * Copyright 2017 Google LLC
331
+ * SPDX-License-Identifier: BSD-3-Clause
332
+ */
333
+ const P = globalThis, D = P.trustedTypes, et = D ? D.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, dt = "$lit$", f = `lit$${Math.random().toFixed(9).slice(2)}$`, pt = "?" + f, xt = `<${pt}>`, A = document, O = () => A.createComment(""), T = (r) => r === null || typeof r != "object" && typeof r != "function", K = Array.isArray, Ct = (r) => K(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", I = `[
334
+ \f\r]`, x = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, st = /-->/g, it = />/g, m = RegExp(`>|${I}(?:([^\\s"'>=/]+)(${I}*=${I}*(?:[^
335
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), rt = /'/g, nt = /"/g, ut = /^(?:script|style|textarea|title)$/i, Pt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), Ut = Pt(1), E = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), ot = /* @__PURE__ */ new WeakMap(), g = A.createTreeWalker(A, 129);
336
+ function $t(r, t) {
337
+ if (!K(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
338
+ return et !== void 0 ? et.createHTML(t) : t;
339
+ }
340
+ const Ot = (r, t) => {
341
+ const e = r.length - 1, s = [];
342
+ let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = x;
343
+ for (let a = 0; a < e; a++) {
344
+ const h = r[a];
345
+ let c, p, l = -1, u = 0;
346
+ for (; u < h.length && (o.lastIndex = u, p = o.exec(h), p !== null); ) u = o.lastIndex, o === x ? p[1] === "!--" ? o = st : p[1] !== void 0 ? o = it : p[2] !== void 0 ? (ut.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = m) : p[3] !== void 0 && (o = m) : o === m ? p[0] === ">" ? (o = i ?? x, l = -1) : p[1] === void 0 ? l = -2 : (l = o.lastIndex - p[2].length, c = p[1], o = p[3] === void 0 ? m : p[3] === '"' ? nt : rt) : o === nt || o === rt ? o = m : o === st || o === it ? o = x : (o = m, i = void 0);
347
+ const $ = o === m && r[a + 1].startsWith("/>") ? " " : "";
348
+ n += o === x ? h + xt : l >= 0 ? (s.push(c), h.slice(0, l) + dt + h.slice(l) + f + $) : h + f + (l === -2 ? a : $);
349
+ }
350
+ return [$t(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
351
+ };
352
+ class M {
353
+ constructor({ strings: t, _$litType$: e }, s) {
354
+ let i;
355
+ this.parts = [];
356
+ let n = 0, o = 0;
357
+ const a = t.length - 1, h = this.parts, [c, p] = Ot(t, e);
358
+ if (this.el = M.createElement(c, s), g.currentNode = this.el.content, e === 2 || e === 3) {
359
+ const l = this.el.content.firstChild;
360
+ l.replaceWith(...l.childNodes);
361
+ }
362
+ for (; (i = g.nextNode()) !== null && h.length < a; ) {
363
+ if (i.nodeType === 1) {
364
+ if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(dt)) {
365
+ const u = p[o++], $ = i.getAttribute(l).split(f), R = /([.?@])?(.*)/.exec(u);
366
+ h.push({ type: 1, index: n, name: R[2], strings: $, ctor: R[1] === "." ? Mt : R[1] === "?" ? Ht : R[1] === "@" ? Nt : L }), i.removeAttribute(l);
367
+ } else l.startsWith(f) && (h.push({ type: 6, index: n }), i.removeAttribute(l));
368
+ if (ut.test(i.tagName)) {
369
+ const l = i.textContent.split(f), u = l.length - 1;
370
+ if (u > 0) {
371
+ i.textContent = D ? D.emptyScript : "";
372
+ for (let $ = 0; $ < u; $++) i.append(l[$], O()), g.nextNode(), h.push({ type: 2, index: ++n });
373
+ i.append(l[u], O());
374
+ }
375
+ }
376
+ } else if (i.nodeType === 8) if (i.data === pt) h.push({ type: 2, index: n });
377
+ else {
378
+ let l = -1;
379
+ for (; (l = i.data.indexOf(f, l + 1)) !== -1; ) h.push({ type: 7, index: n }), l += f.length - 1;
380
+ }
381
+ n++;
382
+ }
383
+ }
384
+ static createElement(t, e) {
385
+ const s = A.createElement("template");
386
+ return s.innerHTML = t, s;
387
+ }
388
+ }
389
+ function b(r, t, e = r, s) {
390
+ var o, a;
391
+ if (t === E) return t;
392
+ let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
393
+ const n = T(t) ? void 0 : t._$litDirective$;
394
+ return (i == null ? void 0 : i.constructor) !== n && ((a = i == null ? void 0 : i._$AO) == null || a.call(i, !1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = b(r, i._$AS(r, t.values), i, s)), t;
395
+ }
396
+ class Tt {
397
+ constructor(t, e) {
398
+ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
399
+ }
400
+ get parentNode() {
401
+ return this._$AM.parentNode;
402
+ }
403
+ get _$AU() {
404
+ return this._$AM._$AU;
405
+ }
406
+ u(t) {
407
+ const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? A).importNode(e, !0);
408
+ g.currentNode = i;
409
+ let n = g.nextNode(), o = 0, a = 0, h = s[0];
410
+ for (; h !== void 0; ) {
411
+ if (o === h.index) {
412
+ let c;
413
+ h.type === 2 ? c = new N(n, n.nextSibling, this, t) : h.type === 1 ? c = new h.ctor(n, h.name, h.strings, this, t) : h.type === 6 && (c = new Rt(n, this, t)), this._$AV.push(c), h = s[++a];
414
+ }
415
+ o !== (h == null ? void 0 : h.index) && (n = g.nextNode(), o++);
416
+ }
417
+ return g.currentNode = A, i;
418
+ }
419
+ p(t) {
420
+ let e = 0;
421
+ for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
422
+ }
423
+ }
424
+ class N {
425
+ get _$AU() {
426
+ var t;
427
+ return ((t = this._$AM) == null ? void 0 : t._$AU) ?? this._$Cv;
428
+ }
429
+ constructor(t, e, s, i) {
430
+ this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
431
+ }
432
+ get parentNode() {
433
+ let t = this._$AA.parentNode;
434
+ const e = this._$AM;
435
+ return e !== void 0 && (t == null ? void 0 : t.nodeType) === 11 && (t = e.parentNode), t;
436
+ }
437
+ get startNode() {
438
+ return this._$AA;
439
+ }
440
+ get endNode() {
441
+ return this._$AB;
442
+ }
443
+ _$AI(t, e = this) {
444
+ t = b(this, t, e), T(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ct(t) ? this.k(t) : this._(t);
445
+ }
446
+ O(t) {
447
+ return this._$AA.parentNode.insertBefore(t, this._$AB);
448
+ }
449
+ T(t) {
450
+ this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
451
+ }
452
+ _(t) {
453
+ this._$AH !== d && T(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
454
+ }
455
+ $(t) {
456
+ var n;
457
+ const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = M.createElement($t(s.h, s.h[0]), this.options)), s);
458
+ if (((n = this._$AH) == null ? void 0 : n._$AD) === i) this._$AH.p(e);
459
+ else {
460
+ const o = new Tt(i, this), a = o.u(this.options);
461
+ o.p(e), this.T(a), this._$AH = o;
462
+ }
463
+ }
464
+ _$AC(t) {
465
+ let e = ot.get(t.strings);
466
+ return e === void 0 && ot.set(t.strings, e = new M(t)), e;
467
+ }
468
+ k(t) {
469
+ K(this._$AH) || (this._$AH = [], this._$AR());
470
+ const e = this._$AH;
471
+ let s, i = 0;
472
+ for (const n of t) i === e.length ? e.push(s = new N(this.O(O()), this.O(O()), this, this.options)) : s = e[i], s._$AI(n), i++;
473
+ i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
474
+ }
475
+ _$AR(t = this._$AA.nextSibling, e) {
476
+ var s;
477
+ for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t && t !== this._$AB; ) {
478
+ const i = t.nextSibling;
479
+ t.remove(), t = i;
480
+ }
481
+ }
482
+ setConnected(t) {
483
+ var e;
484
+ this._$AM === void 0 && (this._$Cv = t, (e = this._$AP) == null || e.call(this, t));
485
+ }
486
+ }
487
+ class L {
488
+ get tagName() {
489
+ return this.element.tagName;
490
+ }
491
+ get _$AU() {
492
+ return this._$AM._$AU;
493
+ }
494
+ constructor(t, e, s, i, n) {
495
+ this.type = 1, this._$AH = d, this._$AN = void 0, this.element = t, this.name = e, this._$AM = i, this.options = n, s.length > 2 || s[0] !== "" || s[1] !== "" ? (this._$AH = Array(s.length - 1).fill(new String()), this.strings = s) : this._$AH = d;
496
+ }
497
+ _$AI(t, e = this, s, i) {
498
+ const n = this.strings;
499
+ let o = !1;
500
+ if (n === void 0) t = b(this, t, e, 0), o = !T(t) || t !== this._$AH && t !== E, o && (this._$AH = t);
501
+ else {
502
+ const a = t;
503
+ let h, c;
504
+ for (t = n[0], h = 0; h < n.length - 1; h++) c = b(this, a[s + h], e, h), c === E && (c = this._$AH[h]), o || (o = !T(c) || c !== this._$AH[h]), c === d ? t = d : t !== d && (t += (c ?? "") + n[h + 1]), this._$AH[h] = c;
505
+ }
506
+ o && !i && this.j(t);
507
+ }
508
+ j(t) {
509
+ t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
510
+ }
511
+ }
512
+ class Mt extends L {
513
+ constructor() {
514
+ super(...arguments), this.type = 3;
515
+ }
516
+ j(t) {
517
+ this.element[this.name] = t === d ? void 0 : t;
518
+ }
519
+ }
520
+ class Ht extends L {
521
+ constructor() {
522
+ super(...arguments), this.type = 4;
523
+ }
524
+ j(t) {
525
+ this.element.toggleAttribute(this.name, !!t && t !== d);
526
+ }
527
+ }
528
+ class Nt extends L {
529
+ constructor(t, e, s, i, n) {
530
+ super(t, e, s, i, n), this.type = 5;
531
+ }
532
+ _$AI(t, e = this) {
533
+ if ((t = b(this, t, e, 0) ?? d) === E) return;
534
+ const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== d && (s === d || i);
535
+ i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
536
+ }
537
+ handleEvent(t) {
538
+ var e;
539
+ typeof this._$AH == "function" ? this._$AH.call(((e = this.options) == null ? void 0 : e.host) ?? this.element, t) : this._$AH.handleEvent(t);
540
+ }
541
+ }
542
+ class Rt {
543
+ constructor(t, e, s) {
544
+ this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
545
+ }
546
+ get _$AU() {
547
+ return this._$AM._$AU;
548
+ }
549
+ _$AI(t) {
550
+ b(this, t);
551
+ }
552
+ }
553
+ const z = P.litHtmlPolyfillSupport;
554
+ z == null || z(M, N), (P.litHtmlVersions ?? (P.litHtmlVersions = [])).push("3.3.0");
555
+ const kt = (r, t, e) => {
556
+ const s = (e == null ? void 0 : e.renderBefore) ?? t;
557
+ let i = s._$litPart$;
558
+ if (i === void 0) {
559
+ const n = (e == null ? void 0 : e.renderBefore) ?? null;
560
+ s._$litPart$ = i = new N(t.insertBefore(O(), n), n, void 0, e ?? {});
561
+ }
562
+ return i._$AI(r), i;
563
+ };
564
+ /**
565
+ * @license
566
+ * Copyright 2017 Google LLC
567
+ * SPDX-License-Identifier: BSD-3-Clause
568
+ */
569
+ const v = globalThis;
570
+ class U extends y {
571
+ constructor() {
572
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
573
+ }
574
+ createRenderRoot() {
575
+ var e;
576
+ const t = super.createRenderRoot();
577
+ return (e = this.renderOptions).renderBefore ?? (e.renderBefore = t.firstChild), t;
578
+ }
579
+ update(t) {
580
+ const e = this.render();
581
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = kt(e, this.renderRoot, this.renderOptions);
582
+ }
583
+ connectedCallback() {
584
+ var t;
585
+ super.connectedCallback(), (t = this._$Do) == null || t.setConnected(!0);
586
+ }
587
+ disconnectedCallback() {
588
+ var t;
589
+ super.disconnectedCallback(), (t = this._$Do) == null || t.setConnected(!1);
590
+ }
591
+ render() {
592
+ return E;
593
+ }
594
+ }
595
+ var at;
596
+ U._$litElement$ = !0, U.finalized = !0, (at = v.litElementHydrateSupport) == null || at.call(v, { LitElement: U });
597
+ const q = v.litElementPolyfillSupport;
598
+ q == null || q({ LitElement: U });
599
+ (v.litElementVersions ?? (v.litElementVersions = [])).push("4.2.0");
600
+ function Bt(r, t) {
601
+ const e = document.createElement("template");
602
+ return e.innerHTML = r.trim(), t.append(e.content.cloneNode(!0)), new Proxy({}, {
603
+ get(s, i) {
604
+ if (i === "fragment")
605
+ return t;
606
+ if (typeof i == "string") {
607
+ const n = t.getElementById(i);
608
+ if (!n)
609
+ throw new Error(
610
+ `❌ Unknown id '${i}'.`
611
+ );
612
+ return n;
613
+ }
614
+ }
615
+ });
616
+ }
617
+ const G = class G extends y {
618
+ constructor(t) {
619
+ super();
620
+ const e = this.createRenderRoot();
621
+ this.$ = Bt(t, e);
622
+ }
623
+ connectedCallback() {
624
+ super.connectedCallback();
625
+ let t = this.css;
626
+ Array.isArray(t) || (t = [t]);
627
+ const e = t.map((s) => s instanceof ct ? s.styleSheet : F(s).styleSheet);
628
+ this.shadowRoot.adoptedStyleSheets = e;
629
+ }
630
+ };
631
+ G.DEFINITION = {
632
+ classes: [],
633
+ attributes: {}
634
+ };
635
+ let ht = G;
636
+ /**
637
+ * @license
638
+ * Copyright 2017 Google LLC
639
+ * SPDX-License-Identifier: BSD-3-Clause
640
+ */
641
+ const Dt = (r) => (t, e) => {
642
+ e !== void 0 ? e.addInitializer(() => {
643
+ customElements.define(r, t);
644
+ }) : customElements.define(r, t);
645
+ };
646
+ /**
647
+ * @license
648
+ * Copyright 2017 Google LLC
649
+ * SPDX-License-Identifier: BSD-3-Clause
650
+ */
651
+ const Lt = { attribute: !0, type: String, converter: B, reflect: !1, hasChanged: J }, jt = (r = Lt, t, e) => {
652
+ const { kind: s, metadata: i } = e;
653
+ let n = globalThis.litPropertyMetadata.get(i);
654
+ if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), n.set(e.name, r), s === "accessor") {
655
+ const { name: o } = e;
656
+ return { set(a) {
657
+ const h = t.get.call(this);
658
+ t.set.call(this, a), this.requestUpdate(o, h, r);
659
+ }, init(a) {
660
+ return a !== void 0 && this.C(o, void 0, r, a), a;
661
+ } };
662
+ }
663
+ if (s === "setter") {
664
+ const { name: o } = e;
665
+ return function(a) {
666
+ const h = this[o];
667
+ t.call(this, a), this.requestUpdate(o, h, r);
668
+ };
669
+ }
670
+ throw Error("Unsupported decorator location: " + s);
671
+ };
672
+ function ft(r) {
673
+ return (t, e) => typeof e == "object" ? jt(r, t, e) : ((s, i, n) => {
674
+ const o = i.hasOwnProperty(n);
675
+ return i.constructor.createProperty(n, s), o ? Object.getOwnPropertyDescriptor(i, n) : void 0;
676
+ })(r, t, e);
677
+ }
678
+ const Wt = ":host{--container-width: var(--nt-container-width, 100%);--gap: var(--nt-base-gap);--x-direction: row;--y-direction: column}:host(.desktop-reverse){--x-direction: row-reverse}:host(.mobile-reverse){--y-direction: column-reverse}:host(.alternate:nth-child(odd)) .row div[part=main]{order:2}:host(.alternate:nth-child(odd)) .row div[part=aside]{order:1}#row{width:var(--container-width);display:flex;gap:var(--gap)}#row.row{flex-direction:var(--x-direction)}#row.row div[part=main]{width:calc(100% * var(--cols, 1) / 12)}#row.row div[part=aside]{width:calc(100% * (12 - var(--cols, 1)) / 12)}#row.col{flex-direction:var(--y-direction)}#row.col slot{width:100%}div[part]{display:flex;flex-grow:1}div[part]:has(slot.is-empty){display:none}section{width:var(--container-width);margin:0 auto}";
679
+ var It = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, Z = (r, t, e, s) => {
680
+ for (var i = s > 1 ? void 0 : s ? zt(t, e) : t, n = r.length - 1, o; n >= 0; n--)
681
+ (o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
682
+ return s && i && It(t, e, i), i;
683
+ };
684
+ let H = class extends U {
685
+ constructor() {
686
+ super(...arguments), this.breakAt = "md", this.cols = 6;
687
+ }
688
+ connectedCallback() {
689
+ super.connectedCallback(), window.addEventListener("breakpoint-changed", () => this.requestUpdate());
690
+ }
691
+ firstUpdated(r) {
692
+ var t;
693
+ super.firstUpdated(r), (t = this.shadowRoot) == null || t.querySelectorAll("slot").forEach((e) => {
694
+ e.assignedElements().length === 0 ? e.classList.add("is-empty") : e.classList.remove("is-empty");
695
+ });
696
+ }
697
+ render() {
698
+ const r = mt(this.breakAt);
699
+ return Ut`
700
+ <section part="section" style="--cols: ${this.cols};">
701
+ <div part="top">
702
+ <slot name="top"></slot>
703
+ </div>
704
+ <div id="row" class="${r ? "row" : "col"}">
705
+ <div part="main">
706
+ <slot></slot>
707
+ </div>
708
+ <div part="aside">
709
+ <slot name="aside"></slot>
710
+ </div>
711
+ </div>
712
+ <div part="bottom">
713
+ <slot name="bottom"></slot>
714
+ </div>
715
+ </section>
716
+ `;
717
+ }
718
+ };
719
+ H.styles = [F(Wt)];
720
+ Z([
721
+ ft({ type: String, reflect: !0 })
722
+ ], H.prototype, "breakAt", 2);
723
+ Z([
724
+ ft({ type: Number, reflect: !0 })
725
+ ], H.prototype, "cols", 2);
726
+ H = Z([
727
+ Dt("ntl-2col")
728
+ ], H);
729
+ export {
730
+ H as Ntl2Col
731
+ };
@@ -0,0 +1,9 @@
1
+ import { LitElement, PropertyValues } from 'lit';
2
+ export declare class Ntl2Col extends LitElement {
3
+ static styles: import('lit').CSSResult[];
4
+ breakAt: string;
5
+ cols: number;
6
+ connectedCallback(): void;
7
+ protected firstUpdated(_changedProperties: PropertyValues): void;
8
+ protected render(): unknown;
9
+ }
package/package.json ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "@nextrap/ntl-2col",
3
+ "version": "0.1.1",
4
+ "main": "./index.js",
5
+ "dependencies": {},
6
+ "type": "module",
7
+ "types": "./index.d.ts"
8
+ }