@ttoss/layouts 0.5.9 → 0.5.11
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/dist/esm/index.js +309 -254
- package/package.json +6 -6
package/dist/esm/index.js
CHANGED
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
4
|
+
value,
|
|
5
|
+
configurable: true
|
|
6
|
+
});
|
|
2
7
|
|
|
3
8
|
// src/components/Layout.tsx
|
|
4
9
|
import { Box as Box7, Container } from "@ttoss/ui";
|
|
5
10
|
|
|
6
11
|
// src/components/Footer.tsx
|
|
7
12
|
import { Box } from "@ttoss/ui";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return /* @__PURE__ */jsx(Box, {
|
|
13
|
+
var Footer = /* @__PURE__ */__name(props => {
|
|
14
|
+
return /* @__PURE__ */React.createElement(Box, {
|
|
11
15
|
variant: "layout.footer",
|
|
12
16
|
...props,
|
|
13
|
-
as: "footer"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
17
|
+
as: "footer"
|
|
18
|
+
}, props.children);
|
|
19
|
+
}, "Footer");
|
|
17
20
|
Footer.displayName = "Footer";
|
|
18
21
|
|
|
19
22
|
// ../../node_modules/.pnpm/@iconify-icon+react@2.3.0_react@19.1.1/node_modules/@iconify-icon/react/dist/iconify.mjs
|
|
20
|
-
import
|
|
23
|
+
import React2 from "react";
|
|
21
24
|
|
|
22
25
|
// ../../node_modules/.pnpm/iconify-icon@2.3.0/node_modules/iconify-icon/dist/iconify-icon.mjs
|
|
23
26
|
var defaultIconDimensions = Object.freeze({
|
|
@@ -58,6 +61,7 @@ function rotateFromString(value, defaultValue = 0) {
|
|
|
58
61
|
}
|
|
59
62
|
return value2 % 4;
|
|
60
63
|
}
|
|
64
|
+
__name(cleanup, "cleanup");
|
|
61
65
|
if (units === "") {
|
|
62
66
|
const num = parseInt(value);
|
|
63
67
|
return isNaN(num) ? 0 : cleanup(num);
|
|
@@ -81,6 +85,7 @@ function rotateFromString(value, defaultValue = 0) {
|
|
|
81
85
|
}
|
|
82
86
|
return defaultValue;
|
|
83
87
|
}
|
|
88
|
+
__name(rotateFromString, "rotateFromString");
|
|
84
89
|
var separator = /[\s,]+/;
|
|
85
90
|
function flipFromString(custom, flip) {
|
|
86
91
|
flip.split(separator).forEach(str => {
|
|
@@ -95,6 +100,7 @@ function flipFromString(custom, flip) {
|
|
|
95
100
|
}
|
|
96
101
|
});
|
|
97
102
|
}
|
|
103
|
+
__name(flipFromString, "flipFromString");
|
|
98
104
|
var defaultCustomisations = {
|
|
99
105
|
...defaultIconCustomisations,
|
|
100
106
|
preserveAspectRatio: ""
|
|
@@ -103,7 +109,7 @@ function getCustomisations(node) {
|
|
|
103
109
|
const customisations = {
|
|
104
110
|
...defaultCustomisations
|
|
105
111
|
};
|
|
106
|
-
const attr = (key, def) => node.getAttribute(key) || def;
|
|
112
|
+
const attr = /* @__PURE__ */__name((key, def) => node.getAttribute(key) || def, "attr");
|
|
107
113
|
customisations.width = attr("width", null);
|
|
108
114
|
customisations.height = attr("height", null);
|
|
109
115
|
customisations.rotate = rotateFromString(attr("rotate", ""));
|
|
@@ -111,6 +117,7 @@ function getCustomisations(node) {
|
|
|
111
117
|
customisations.preserveAspectRatio = attr("preserveAspectRatio", attr("preserveaspectratio", ""));
|
|
112
118
|
return customisations;
|
|
113
119
|
}
|
|
120
|
+
__name(getCustomisations, "getCustomisations");
|
|
114
121
|
function haveCustomisationsChanged(value1, value2) {
|
|
115
122
|
for (const key in defaultCustomisations) {
|
|
116
123
|
if (value1[key] !== value2[key]) {
|
|
@@ -119,8 +126,9 @@ function haveCustomisationsChanged(value1, value2) {
|
|
|
119
126
|
}
|
|
120
127
|
return false;
|
|
121
128
|
}
|
|
129
|
+
__name(haveCustomisationsChanged, "haveCustomisationsChanged");
|
|
122
130
|
var matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
|
|
123
|
-
var stringToIcon = (value, validate, allowSimpleName, provider = "") => {
|
|
131
|
+
var stringToIcon = /* @__PURE__ */__name((value, validate, allowSimpleName, provider = "") => {
|
|
124
132
|
const colonSeparated = value.split(":");
|
|
125
133
|
if (value.slice(0, 1) === "@") {
|
|
126
134
|
if (colonSeparated.length < 2 || colonSeparated.length > 3) {
|
|
@@ -161,8 +169,8 @@ var stringToIcon = (value, validate, allowSimpleName, provider = "") => {
|
|
|
161
169
|
return validate && !validateIconName(result, allowSimpleName) ? null : result;
|
|
162
170
|
}
|
|
163
171
|
return null;
|
|
164
|
-
};
|
|
165
|
-
var validateIconName = (icon, allowSimpleName) => {
|
|
172
|
+
}, "stringToIcon");
|
|
173
|
+
var validateIconName = /* @__PURE__ */__name((icon, allowSimpleName) => {
|
|
166
174
|
if (!icon) {
|
|
167
175
|
return false;
|
|
168
176
|
}
|
|
@@ -170,7 +178,7 @@ var validateIconName = (icon, allowSimpleName) => {
|
|
|
170
178
|
// Check prefix: cannot be empty, unless allowSimpleName is enabled
|
|
171
179
|
// Check name: cannot be empty
|
|
172
180
|
(allowSimpleName && icon.prefix === "" || !!icon.prefix) && !!icon.name);
|
|
173
|
-
};
|
|
181
|
+
}, "validateIconName");
|
|
174
182
|
function mergeIconTransformations(obj1, obj2) {
|
|
175
183
|
const result = {};
|
|
176
184
|
if (!obj1.hFlip !== !obj2.hFlip) {
|
|
@@ -185,6 +193,7 @@ function mergeIconTransformations(obj1, obj2) {
|
|
|
185
193
|
}
|
|
186
194
|
return result;
|
|
187
195
|
}
|
|
196
|
+
__name(mergeIconTransformations, "mergeIconTransformations");
|
|
188
197
|
function mergeIconData(parent, child) {
|
|
189
198
|
const result = mergeIconTransformations(parent, child);
|
|
190
199
|
for (const key in defaultExtendedIconProps) {
|
|
@@ -200,6 +209,7 @@ function mergeIconData(parent, child) {
|
|
|
200
209
|
}
|
|
201
210
|
return result;
|
|
202
211
|
}
|
|
212
|
+
__name(mergeIconData, "mergeIconData");
|
|
203
213
|
function getIconsTree(data, names) {
|
|
204
214
|
const icons = data.icons;
|
|
205
215
|
const aliases = data.aliases || /* @__PURE__ */Object.create(null);
|
|
@@ -218,9 +228,11 @@ function getIconsTree(data, names) {
|
|
|
218
228
|
}
|
|
219
229
|
return resolved[name];
|
|
220
230
|
}
|
|
231
|
+
__name(resolve, "resolve");
|
|
221
232
|
Object.keys(icons).concat(Object.keys(aliases)).forEach(resolve);
|
|
222
233
|
return resolved;
|
|
223
234
|
}
|
|
235
|
+
__name(getIconsTree, "getIconsTree");
|
|
224
236
|
function internalGetIconData(data, name, tree) {
|
|
225
237
|
const icons = data.icons;
|
|
226
238
|
const aliases = data.aliases || /* @__PURE__ */Object.create(null);
|
|
@@ -228,10 +240,12 @@ function internalGetIconData(data, name, tree) {
|
|
|
228
240
|
function parse(name2) {
|
|
229
241
|
currentProps = mergeIconData(icons[name2] || aliases[name2], currentProps);
|
|
230
242
|
}
|
|
243
|
+
__name(parse, "parse");
|
|
231
244
|
parse(name);
|
|
232
245
|
tree.forEach(parse);
|
|
233
246
|
return mergeIconData(data, currentProps);
|
|
234
247
|
}
|
|
248
|
+
__name(internalGetIconData, "internalGetIconData");
|
|
235
249
|
function parseIconSet(data, callback) {
|
|
236
250
|
const names = [];
|
|
237
251
|
if (typeof data !== "object" || typeof data.icons !== "object") {
|
|
@@ -253,6 +267,7 @@ function parseIconSet(data, callback) {
|
|
|
253
267
|
}
|
|
254
268
|
return names;
|
|
255
269
|
}
|
|
270
|
+
__name(parseIconSet, "parseIconSet");
|
|
256
271
|
var optionalPropertyDefaults = {
|
|
257
272
|
provider: "",
|
|
258
273
|
aliases: {},
|
|
@@ -267,6 +282,7 @@ function checkOptionalProps(item, defaults) {
|
|
|
267
282
|
}
|
|
268
283
|
return true;
|
|
269
284
|
}
|
|
285
|
+
__name(checkOptionalProps, "checkOptionalProps");
|
|
270
286
|
function quicklyValidateIconSet(obj) {
|
|
271
287
|
if (typeof obj !== "object" || obj === null) {
|
|
272
288
|
return null;
|
|
@@ -307,6 +323,7 @@ function quicklyValidateIconSet(obj) {
|
|
|
307
323
|
}
|
|
308
324
|
return data;
|
|
309
325
|
}
|
|
326
|
+
__name(quicklyValidateIconSet, "quicklyValidateIconSet");
|
|
310
327
|
var dataStorage = /* @__PURE__ */Object.create(null);
|
|
311
328
|
function newStorage(provider, prefix) {
|
|
312
329
|
return {
|
|
@@ -316,10 +333,12 @@ function newStorage(provider, prefix) {
|
|
|
316
333
|
missing: /* @__PURE__ */new Set()
|
|
317
334
|
};
|
|
318
335
|
}
|
|
336
|
+
__name(newStorage, "newStorage");
|
|
319
337
|
function getStorage(provider, prefix) {
|
|
320
338
|
const providerStorage = dataStorage[provider] || (dataStorage[provider] = /* @__PURE__ */Object.create(null));
|
|
321
339
|
return providerStorage[prefix] || (providerStorage[prefix] = newStorage(provider, prefix));
|
|
322
340
|
}
|
|
341
|
+
__name(getStorage, "getStorage");
|
|
323
342
|
function addIconSet(storage2, data) {
|
|
324
343
|
if (!quicklyValidateIconSet(data)) {
|
|
325
344
|
return [];
|
|
@@ -332,6 +351,7 @@ function addIconSet(storage2, data) {
|
|
|
332
351
|
}
|
|
333
352
|
});
|
|
334
353
|
}
|
|
354
|
+
__name(addIconSet, "addIconSet");
|
|
335
355
|
function addIconToStorage(storage2, name, icon) {
|
|
336
356
|
try {
|
|
337
357
|
if (typeof icon.body === "string") {
|
|
@@ -343,6 +363,7 @@ function addIconToStorage(storage2, name, icon) {
|
|
|
343
363
|
} catch (err) {}
|
|
344
364
|
return false;
|
|
345
365
|
}
|
|
366
|
+
__name(addIconToStorage, "addIconToStorage");
|
|
346
367
|
function listIcons$1(provider, prefix) {
|
|
347
368
|
let allIcons = [];
|
|
348
369
|
const providers = typeof provider === "string" ? [provider] : Object.keys(dataStorage);
|
|
@@ -355,6 +376,7 @@ function listIcons$1(provider, prefix) {
|
|
|
355
376
|
});
|
|
356
377
|
return allIcons;
|
|
357
378
|
}
|
|
379
|
+
__name(listIcons$1, "listIcons$1");
|
|
358
380
|
var simpleNames = false;
|
|
359
381
|
function allowSimpleNames(allow) {
|
|
360
382
|
if (typeof allow === "boolean") {
|
|
@@ -362,6 +384,7 @@ function allowSimpleNames(allow) {
|
|
|
362
384
|
}
|
|
363
385
|
return simpleNames;
|
|
364
386
|
}
|
|
387
|
+
__name(allowSimpleNames, "allowSimpleNames");
|
|
365
388
|
function getIconData(name) {
|
|
366
389
|
const icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
|
|
367
390
|
if (icon) {
|
|
@@ -370,6 +393,7 @@ function getIconData(name) {
|
|
|
370
393
|
return storage2.icons[iconName] || (storage2.missing.has(iconName) ? null : void 0);
|
|
371
394
|
}
|
|
372
395
|
}
|
|
396
|
+
__name(getIconData, "getIconData");
|
|
373
397
|
function addIcon$1(name, data) {
|
|
374
398
|
const icon = stringToIcon(name, true, simpleNames);
|
|
375
399
|
if (!icon) {
|
|
@@ -383,6 +407,7 @@ function addIcon$1(name, data) {
|
|
|
383
407
|
return true;
|
|
384
408
|
}
|
|
385
409
|
}
|
|
410
|
+
__name(addIcon$1, "addIcon$1");
|
|
386
411
|
function addCollection$1(data, provider) {
|
|
387
412
|
if (typeof data !== "object") {
|
|
388
413
|
return false;
|
|
@@ -413,9 +438,11 @@ function addCollection$1(data, provider) {
|
|
|
413
438
|
const storage2 = getStorage(provider, prefix);
|
|
414
439
|
return !!addIconSet(storage2, data);
|
|
415
440
|
}
|
|
441
|
+
__name(addCollection$1, "addCollection$1");
|
|
416
442
|
function iconLoaded$1(name) {
|
|
417
443
|
return !!getIconData(name);
|
|
418
444
|
}
|
|
445
|
+
__name(iconLoaded$1, "iconLoaded$1");
|
|
419
446
|
function getIcon$1(name) {
|
|
420
447
|
const result = getIconData(name);
|
|
421
448
|
return result ? {
|
|
@@ -423,6 +450,7 @@ function getIcon$1(name) {
|
|
|
423
450
|
...result
|
|
424
451
|
} : result;
|
|
425
452
|
}
|
|
453
|
+
__name(getIcon$1, "getIcon$1");
|
|
426
454
|
function sortIcons(icons) {
|
|
427
455
|
const result = {
|
|
428
456
|
loaded: [],
|
|
@@ -471,6 +499,7 @@ function sortIcons(icons) {
|
|
|
471
499
|
});
|
|
472
500
|
return result;
|
|
473
501
|
}
|
|
502
|
+
__name(sortIcons, "sortIcons");
|
|
474
503
|
function removeCallback(storages, id) {
|
|
475
504
|
storages.forEach(storage2 => {
|
|
476
505
|
const items = storage2.loaderCallbacks;
|
|
@@ -479,6 +508,7 @@ function removeCallback(storages, id) {
|
|
|
479
508
|
}
|
|
480
509
|
});
|
|
481
510
|
}
|
|
511
|
+
__name(removeCallback, "removeCallback");
|
|
482
512
|
function updateCallbacks(storage2) {
|
|
483
513
|
if (!storage2.pendingCallbacksFlag) {
|
|
484
514
|
storage2.pendingCallbacksFlag = true;
|
|
@@ -527,6 +557,7 @@ function updateCallbacks(storage2) {
|
|
|
527
557
|
});
|
|
528
558
|
}
|
|
529
559
|
}
|
|
560
|
+
__name(updateCallbacks, "updateCallbacks");
|
|
530
561
|
var idCounter = 0;
|
|
531
562
|
function storeCallback(callback, icons, pendingSources) {
|
|
532
563
|
const id = idCounter++;
|
|
@@ -545,13 +576,16 @@ function storeCallback(callback, icons, pendingSources) {
|
|
|
545
576
|
});
|
|
546
577
|
return abort;
|
|
547
578
|
}
|
|
579
|
+
__name(storeCallback, "storeCallback");
|
|
548
580
|
var storage = /* @__PURE__ */Object.create(null);
|
|
549
581
|
function setAPIModule(provider, item) {
|
|
550
582
|
storage[provider] = item;
|
|
551
583
|
}
|
|
584
|
+
__name(setAPIModule, "setAPIModule");
|
|
552
585
|
function getAPIModule(provider) {
|
|
553
586
|
return storage[provider] || storage[""];
|
|
554
587
|
}
|
|
588
|
+
__name(getAPIModule, "getAPIModule");
|
|
555
589
|
function listToIcons(list, validate = true, simpleNames2 = false) {
|
|
556
590
|
const result = [];
|
|
557
591
|
list.forEach(item => {
|
|
@@ -562,6 +596,7 @@ function listToIcons(list, validate = true, simpleNames2 = false) {
|
|
|
562
596
|
});
|
|
563
597
|
return result;
|
|
564
598
|
}
|
|
599
|
+
__name(listToIcons, "listToIcons");
|
|
565
600
|
var defaultConfig = {
|
|
566
601
|
resources: [],
|
|
567
602
|
index: 0,
|
|
@@ -602,6 +637,7 @@ function sendQuery(config, payload, query, done) {
|
|
|
602
637
|
timer = null;
|
|
603
638
|
}
|
|
604
639
|
}
|
|
640
|
+
__name(resetTimer, "resetTimer");
|
|
605
641
|
function abort() {
|
|
606
642
|
if (status === "pending") {
|
|
607
643
|
status = "aborted";
|
|
@@ -614,6 +650,7 @@ function sendQuery(config, payload, query, done) {
|
|
|
614
650
|
});
|
|
615
651
|
queue = [];
|
|
616
652
|
}
|
|
653
|
+
__name(abort, "abort");
|
|
617
654
|
function subscribe(callback, overwrite) {
|
|
618
655
|
if (overwrite) {
|
|
619
656
|
doneCallbacks = [];
|
|
@@ -622,6 +659,7 @@ function sendQuery(config, payload, query, done) {
|
|
|
622
659
|
doneCallbacks.push(callback);
|
|
623
660
|
}
|
|
624
661
|
}
|
|
662
|
+
__name(subscribe, "subscribe");
|
|
625
663
|
function getQueryStatus() {
|
|
626
664
|
return {
|
|
627
665
|
startTime,
|
|
@@ -633,12 +671,14 @@ function sendQuery(config, payload, query, done) {
|
|
|
633
671
|
abort
|
|
634
672
|
};
|
|
635
673
|
}
|
|
674
|
+
__name(getQueryStatus, "getQueryStatus");
|
|
636
675
|
function failQuery() {
|
|
637
676
|
status = "failed";
|
|
638
677
|
doneCallbacks.forEach(callback => {
|
|
639
678
|
callback(void 0, lastError);
|
|
640
679
|
});
|
|
641
680
|
}
|
|
681
|
+
__name(failQuery, "failQuery");
|
|
642
682
|
function clearQueue() {
|
|
643
683
|
queue.forEach(item => {
|
|
644
684
|
if (item.status === "pending") {
|
|
@@ -647,6 +687,7 @@ function sendQuery(config, payload, query, done) {
|
|
|
647
687
|
});
|
|
648
688
|
queue = [];
|
|
649
689
|
}
|
|
690
|
+
__name(clearQueue, "clearQueue");
|
|
650
691
|
function moduleResponse(item, response, data) {
|
|
651
692
|
const isError = response !== "success";
|
|
652
693
|
queue = queue.filter(queued => queued !== item);
|
|
@@ -690,6 +731,7 @@ function sendQuery(config, payload, query, done) {
|
|
|
690
731
|
callback(data);
|
|
691
732
|
});
|
|
692
733
|
}
|
|
734
|
+
__name(moduleResponse, "moduleResponse");
|
|
693
735
|
function execNext() {
|
|
694
736
|
if (status !== "pending") {
|
|
695
737
|
return;
|
|
@@ -713,18 +755,20 @@ function sendQuery(config, payload, query, done) {
|
|
|
713
755
|
const item = {
|
|
714
756
|
status: "pending",
|
|
715
757
|
resource,
|
|
716
|
-
callback: (status2, data) => {
|
|
758
|
+
callback: /* @__PURE__ */__name((status2, data) => {
|
|
717
759
|
moduleResponse(item, status2, data);
|
|
718
|
-
}
|
|
760
|
+
}, "callback")
|
|
719
761
|
};
|
|
720
762
|
queue.push(item);
|
|
721
763
|
queriesSent++;
|
|
722
764
|
timer = setTimeout(execNext, config.rotate);
|
|
723
765
|
query(resource, payload, item.callback);
|
|
724
766
|
}
|
|
767
|
+
__name(execNext, "execNext");
|
|
725
768
|
setTimeout(execNext);
|
|
726
769
|
return getQueryStatus;
|
|
727
770
|
}
|
|
771
|
+
__name(sendQuery, "sendQuery");
|
|
728
772
|
function initRedundancy(cfg) {
|
|
729
773
|
const config = {
|
|
730
774
|
...defaultConfig,
|
|
@@ -734,6 +778,7 @@ function initRedundancy(cfg) {
|
|
|
734
778
|
function cleanup() {
|
|
735
779
|
queries = queries.filter(item => item().status === "pending");
|
|
736
780
|
}
|
|
781
|
+
__name(cleanup, "cleanup");
|
|
737
782
|
function query(payload, queryCallback, doneCallback) {
|
|
738
783
|
const query2 = sendQuery(config, payload, queryCallback, (data, error) => {
|
|
739
784
|
cleanup();
|
|
@@ -744,22 +789,25 @@ function initRedundancy(cfg) {
|
|
|
744
789
|
queries.push(query2);
|
|
745
790
|
return query2;
|
|
746
791
|
}
|
|
792
|
+
__name(query, "query");
|
|
747
793
|
function find(callback) {
|
|
748
794
|
return queries.find(value => {
|
|
749
795
|
return callback(value);
|
|
750
796
|
}) || null;
|
|
751
797
|
}
|
|
798
|
+
__name(find, "find");
|
|
752
799
|
const instance = {
|
|
753
800
|
query,
|
|
754
801
|
find,
|
|
755
|
-
setIndex: index => {
|
|
802
|
+
setIndex: /* @__PURE__ */__name(index => {
|
|
756
803
|
config.index = index;
|
|
757
|
-
},
|
|
758
|
-
getIndex: () => config.index,
|
|
804
|
+
}, "setIndex"),
|
|
805
|
+
getIndex: /* @__PURE__ */__name(() => config.index, "getIndex"),
|
|
759
806
|
cleanup
|
|
760
807
|
};
|
|
761
808
|
return instance;
|
|
762
809
|
}
|
|
810
|
+
__name(initRedundancy, "initRedundancy");
|
|
763
811
|
function createAPIConfig(source) {
|
|
764
812
|
let resources;
|
|
765
813
|
if (typeof source.resources === "string") {
|
|
@@ -790,6 +838,7 @@ function createAPIConfig(source) {
|
|
|
790
838
|
};
|
|
791
839
|
return result;
|
|
792
840
|
}
|
|
841
|
+
__name(createAPIConfig, "createAPIConfig");
|
|
793
842
|
var configStorage = /* @__PURE__ */Object.create(null);
|
|
794
843
|
var fallBackAPISources = ["https://api.simplesvg.com", "https://api.unisvg.com"];
|
|
795
844
|
var fallBackAPI = [];
|
|
@@ -815,13 +864,17 @@ function addAPIProvider$1(provider, customConfig) {
|
|
|
815
864
|
configStorage[provider] = config;
|
|
816
865
|
return true;
|
|
817
866
|
}
|
|
867
|
+
__name(addAPIProvider$1, "addAPIProvider$1");
|
|
818
868
|
function getAPIConfig(provider) {
|
|
819
869
|
return configStorage[provider];
|
|
820
870
|
}
|
|
871
|
+
__name(getAPIConfig, "getAPIConfig");
|
|
821
872
|
function listAPIProviders() {
|
|
822
873
|
return Object.keys(configStorage);
|
|
823
874
|
}
|
|
875
|
+
__name(listAPIProviders, "listAPIProviders");
|
|
824
876
|
function emptyCallback$1() {}
|
|
877
|
+
__name(emptyCallback$1, "emptyCallback$1");
|
|
825
878
|
var redundancyCache = /* @__PURE__ */Object.create(null);
|
|
826
879
|
function getRedundancyCache(provider) {
|
|
827
880
|
if (!redundancyCache[provider]) {
|
|
@@ -838,6 +891,7 @@ function getRedundancyCache(provider) {
|
|
|
838
891
|
}
|
|
839
892
|
return redundancyCache[provider];
|
|
840
893
|
}
|
|
894
|
+
__name(getRedundancyCache, "getRedundancyCache");
|
|
841
895
|
function sendAPIQuery(target, query, callback) {
|
|
842
896
|
let redundancy;
|
|
843
897
|
let send2;
|
|
@@ -869,7 +923,9 @@ function sendAPIQuery(target, query, callback) {
|
|
|
869
923
|
}
|
|
870
924
|
return redundancy.query(query, send2, callback)().abort;
|
|
871
925
|
}
|
|
926
|
+
__name(sendAPIQuery, "sendAPIQuery");
|
|
872
927
|
function emptyCallback() {}
|
|
928
|
+
__name(emptyCallback, "emptyCallback");
|
|
873
929
|
function loadedNewIcons(storage2) {
|
|
874
930
|
if (!storage2.iconsLoaderFlag) {
|
|
875
931
|
storage2.iconsLoaderFlag = true;
|
|
@@ -879,6 +935,7 @@ function loadedNewIcons(storage2) {
|
|
|
879
935
|
});
|
|
880
936
|
}
|
|
881
937
|
}
|
|
938
|
+
__name(loadedNewIcons, "loadedNewIcons");
|
|
882
939
|
function checkIconNamesForAPI(icons) {
|
|
883
940
|
const valid = [];
|
|
884
941
|
const invalid = [];
|
|
@@ -890,6 +947,7 @@ function checkIconNamesForAPI(icons) {
|
|
|
890
947
|
invalid
|
|
891
948
|
};
|
|
892
949
|
}
|
|
950
|
+
__name(checkIconNamesForAPI, "checkIconNamesForAPI");
|
|
893
951
|
function parseLoaderResponse(storage2, icons, data) {
|
|
894
952
|
function checkMissing() {
|
|
895
953
|
const pending = storage2.pendingIcons;
|
|
@@ -902,6 +960,7 @@ function parseLoaderResponse(storage2, icons, data) {
|
|
|
902
960
|
}
|
|
903
961
|
});
|
|
904
962
|
}
|
|
963
|
+
__name(checkMissing, "checkMissing");
|
|
905
964
|
if (data && typeof data === "object") {
|
|
906
965
|
try {
|
|
907
966
|
const parsed = addIconSet(storage2, data);
|
|
@@ -916,6 +975,7 @@ function parseLoaderResponse(storage2, icons, data) {
|
|
|
916
975
|
checkMissing();
|
|
917
976
|
loadedNewIcons(storage2);
|
|
918
977
|
}
|
|
978
|
+
__name(parseLoaderResponse, "parseLoaderResponse");
|
|
919
979
|
function parsePossiblyAsyncResponse(response, callback) {
|
|
920
980
|
if (response instanceof Promise) {
|
|
921
981
|
response.then(data => {
|
|
@@ -927,6 +987,7 @@ function parsePossiblyAsyncResponse(response, callback) {
|
|
|
927
987
|
callback(response);
|
|
928
988
|
}
|
|
929
989
|
}
|
|
990
|
+
__name(parsePossiblyAsyncResponse, "parsePossiblyAsyncResponse");
|
|
930
991
|
function loadNewIcons(storage2, icons) {
|
|
931
992
|
if (!storage2.iconsToLoad) {
|
|
932
993
|
storage2.iconsToLoad = icons;
|
|
@@ -992,7 +1053,8 @@ function loadNewIcons(storage2, icons) {
|
|
|
992
1053
|
});
|
|
993
1054
|
}
|
|
994
1055
|
}
|
|
995
|
-
|
|
1056
|
+
__name(loadNewIcons, "loadNewIcons");
|
|
1057
|
+
var loadIcons$1 = /* @__PURE__ */__name((icons, callback) => {
|
|
996
1058
|
const cleanedIcons = listToIcons(icons, true, allowSimpleNames());
|
|
997
1059
|
const sortedIcons = sortIcons(cleanedIcons);
|
|
998
1060
|
if (!sortedIcons.pending.length) {
|
|
@@ -1047,8 +1109,8 @@ var loadIcons$1 = (icons, callback) => {
|
|
|
1047
1109
|
}
|
|
1048
1110
|
});
|
|
1049
1111
|
return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
|
|
1050
|
-
};
|
|
1051
|
-
var loadIcon$1 = icon => {
|
|
1112
|
+
}, "loadIcons$1");
|
|
1113
|
+
var loadIcon$1 = /* @__PURE__ */__name(icon => {
|
|
1052
1114
|
return new Promise((fulfill, reject) => {
|
|
1053
1115
|
const iconObj = typeof icon === "string" ? stringToIcon(icon, true) : icon;
|
|
1054
1116
|
if (!iconObj) {
|
|
@@ -1069,7 +1131,7 @@ var loadIcon$1 = icon => {
|
|
|
1069
1131
|
reject(icon);
|
|
1070
1132
|
});
|
|
1071
1133
|
});
|
|
1072
|
-
};
|
|
1134
|
+
}, "loadIcon$1");
|
|
1073
1135
|
function testIconObject(value) {
|
|
1074
1136
|
try {
|
|
1075
1137
|
const obj = typeof value === "string" ? JSON.parse(value) : value;
|
|
@@ -1080,6 +1142,7 @@ function testIconObject(value) {
|
|
|
1080
1142
|
}
|
|
1081
1143
|
} catch (err) {}
|
|
1082
1144
|
}
|
|
1145
|
+
__name(testIconObject, "testIconObject");
|
|
1083
1146
|
function parseIconValue(value, onload) {
|
|
1084
1147
|
if (typeof value === "object") {
|
|
1085
1148
|
const data2 = testIconObject(value);
|
|
@@ -1124,6 +1187,7 @@ function parseIconValue(value, onload) {
|
|
|
1124
1187
|
loading
|
|
1125
1188
|
};
|
|
1126
1189
|
}
|
|
1190
|
+
__name(parseIconValue, "parseIconValue");
|
|
1127
1191
|
var isBuggedSafari = false;
|
|
1128
1192
|
try {
|
|
1129
1193
|
isBuggedSafari = navigator.vendor.indexOf("Apple") === 0;
|
|
@@ -1141,6 +1205,7 @@ function getRenderMode(body, mode) {
|
|
|
1141
1205
|
}
|
|
1142
1206
|
return body.indexOf("currentColor") === -1 ? "bg" : "mask";
|
|
1143
1207
|
}
|
|
1208
|
+
__name(getRenderMode, "getRenderMode");
|
|
1144
1209
|
var unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
|
|
1145
1210
|
var unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
1146
1211
|
function calculateSize$1(size, ratio, precision) {
|
|
@@ -1179,6 +1244,7 @@ function calculateSize$1(size, ratio, precision) {
|
|
|
1179
1244
|
isNumber = !isNumber;
|
|
1180
1245
|
}
|
|
1181
1246
|
}
|
|
1247
|
+
__name(calculateSize$1, "calculateSize$1");
|
|
1182
1248
|
function splitSVGDefs(content, tag = "defs") {
|
|
1183
1249
|
let defs = "";
|
|
1184
1250
|
const index = content.indexOf("<" + tag);
|
|
@@ -1200,14 +1266,17 @@ function splitSVGDefs(content, tag = "defs") {
|
|
|
1200
1266
|
content
|
|
1201
1267
|
};
|
|
1202
1268
|
}
|
|
1269
|
+
__name(splitSVGDefs, "splitSVGDefs");
|
|
1203
1270
|
function mergeDefsAndContent(defs, content) {
|
|
1204
1271
|
return defs ? "<defs>" + defs + "</defs>" + content : content;
|
|
1205
1272
|
}
|
|
1273
|
+
__name(mergeDefsAndContent, "mergeDefsAndContent");
|
|
1206
1274
|
function wrapSVGContent(body, start, end) {
|
|
1207
1275
|
const split = splitSVGDefs(body);
|
|
1208
1276
|
return mergeDefsAndContent(split.defs, start + split.content + end);
|
|
1209
1277
|
}
|
|
1210
|
-
|
|
1278
|
+
__name(wrapSVGContent, "wrapSVGContent");
|
|
1279
|
+
var isUnsetKeyword = /* @__PURE__ */__name(value => value === "unset" || value === "undefined" || value === "none", "isUnsetKeyword");
|
|
1211
1280
|
function iconToSVG(icon, customisations) {
|
|
1212
1281
|
const fullIcon = {
|
|
1213
1282
|
...defaultIconProps,
|
|
@@ -1290,11 +1359,11 @@ function iconToSVG(icon, customisations) {
|
|
|
1290
1359
|
height = customisationsHeight === null ? calculateSize$1(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
|
1291
1360
|
}
|
|
1292
1361
|
const attributes = {};
|
|
1293
|
-
const setAttr = (prop, value) => {
|
|
1362
|
+
const setAttr = /* @__PURE__ */__name((prop, value) => {
|
|
1294
1363
|
if (!isUnsetKeyword(value)) {
|
|
1295
1364
|
attributes[prop] = value.toString();
|
|
1296
1365
|
}
|
|
1297
|
-
};
|
|
1366
|
+
}, "setAttr");
|
|
1298
1367
|
setAttr("width", width);
|
|
1299
1368
|
setAttr("height", height);
|
|
1300
1369
|
const viewBox = [box.left, box.top, boxWidth, boxHeight];
|
|
@@ -1305,6 +1374,7 @@ function iconToSVG(icon, customisations) {
|
|
|
1305
1374
|
body
|
|
1306
1375
|
};
|
|
1307
1376
|
}
|
|
1377
|
+
__name(iconToSVG, "iconToSVG");
|
|
1308
1378
|
function iconToHTML$1(body, attributes) {
|
|
1309
1379
|
let renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
1310
1380
|
for (const attr in attributes) {
|
|
@@ -1312,16 +1382,20 @@ function iconToHTML$1(body, attributes) {
|
|
|
1312
1382
|
}
|
|
1313
1383
|
return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
|
|
1314
1384
|
}
|
|
1385
|
+
__name(iconToHTML$1, "iconToHTML$1");
|
|
1315
1386
|
function encodeSVGforURL(svg) {
|
|
1316
1387
|
return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
1317
1388
|
}
|
|
1389
|
+
__name(encodeSVGforURL, "encodeSVGforURL");
|
|
1318
1390
|
function svgToData(svg) {
|
|
1319
1391
|
return "data:image/svg+xml," + encodeSVGforURL(svg);
|
|
1320
1392
|
}
|
|
1393
|
+
__name(svgToData, "svgToData");
|
|
1321
1394
|
function svgToURL$1(svg) {
|
|
1322
1395
|
return 'url("' + svgToData(svg) + '")';
|
|
1323
1396
|
}
|
|
1324
|
-
|
|
1397
|
+
__name(svgToURL$1, "svgToURL$1");
|
|
1398
|
+
var detectFetch = /* @__PURE__ */__name(() => {
|
|
1325
1399
|
let callback;
|
|
1326
1400
|
try {
|
|
1327
1401
|
callback = fetch;
|
|
@@ -1329,14 +1403,16 @@ var detectFetch = () => {
|
|
|
1329
1403
|
return callback;
|
|
1330
1404
|
}
|
|
1331
1405
|
} catch (err) {}
|
|
1332
|
-
};
|
|
1406
|
+
}, "detectFetch");
|
|
1333
1407
|
var fetchModule = detectFetch();
|
|
1334
1408
|
function setFetch(fetch2) {
|
|
1335
1409
|
fetchModule = fetch2;
|
|
1336
1410
|
}
|
|
1411
|
+
__name(setFetch, "setFetch");
|
|
1337
1412
|
function getFetch() {
|
|
1338
1413
|
return fetchModule;
|
|
1339
1414
|
}
|
|
1415
|
+
__name(getFetch, "getFetch");
|
|
1340
1416
|
function calculateMaxLength(provider, prefix) {
|
|
1341
1417
|
const config = getAPIConfig(provider);
|
|
1342
1418
|
if (!config) {
|
|
@@ -1356,10 +1432,12 @@ function calculateMaxLength(provider, prefix) {
|
|
|
1356
1432
|
}
|
|
1357
1433
|
return result;
|
|
1358
1434
|
}
|
|
1435
|
+
__name(calculateMaxLength, "calculateMaxLength");
|
|
1359
1436
|
function shouldAbort(status) {
|
|
1360
1437
|
return status === 404;
|
|
1361
1438
|
}
|
|
1362
|
-
|
|
1439
|
+
__name(shouldAbort, "shouldAbort");
|
|
1440
|
+
var prepare = /* @__PURE__ */__name((provider, prefix, icons) => {
|
|
1363
1441
|
const results = [];
|
|
1364
1442
|
const maxLength = calculateMaxLength(provider, prefix);
|
|
1365
1443
|
const type = "icons";
|
|
@@ -1386,7 +1464,7 @@ var prepare = (provider, prefix, icons) => {
|
|
|
1386
1464
|
});
|
|
1387
1465
|
results.push(item);
|
|
1388
1466
|
return results;
|
|
1389
|
-
};
|
|
1467
|
+
}, "prepare");
|
|
1390
1468
|
function getPath(provider) {
|
|
1391
1469
|
if (typeof provider === "string") {
|
|
1392
1470
|
const config = getAPIConfig(provider);
|
|
@@ -1396,7 +1474,8 @@ function getPath(provider) {
|
|
|
1396
1474
|
}
|
|
1397
1475
|
return "/";
|
|
1398
1476
|
}
|
|
1399
|
-
|
|
1477
|
+
__name(getPath, "getPath");
|
|
1478
|
+
var send = /* @__PURE__ */__name((host, params, callback) => {
|
|
1400
1479
|
if (!fetchModule) {
|
|
1401
1480
|
callback("abort", 424);
|
|
1402
1481
|
return;
|
|
@@ -1452,7 +1531,7 @@ var send = (host, params, callback) => {
|
|
|
1452
1531
|
}).catch(() => {
|
|
1453
1532
|
callback("next", defaultError);
|
|
1454
1533
|
});
|
|
1455
|
-
};
|
|
1534
|
+
}, "send");
|
|
1456
1535
|
var fetchAPIModule = {
|
|
1457
1536
|
prepare,
|
|
1458
1537
|
send
|
|
@@ -1460,14 +1539,17 @@ var fetchAPIModule = {
|
|
|
1460
1539
|
function setCustomIconsLoader$1(loader, prefix, provider) {
|
|
1461
1540
|
getStorage(provider || "", prefix).loadIcons = loader;
|
|
1462
1541
|
}
|
|
1542
|
+
__name(setCustomIconsLoader$1, "setCustomIconsLoader$1");
|
|
1463
1543
|
function setCustomIconLoader$1(loader, prefix, provider) {
|
|
1464
1544
|
getStorage(provider || "", prefix).loadIcon = loader;
|
|
1465
1545
|
}
|
|
1546
|
+
__name(setCustomIconLoader$1, "setCustomIconLoader$1");
|
|
1466
1547
|
var nodeAttr = "data-style";
|
|
1467
1548
|
var customStyle = "";
|
|
1468
1549
|
function appendCustomStyle(style) {
|
|
1469
1550
|
customStyle = style;
|
|
1470
1551
|
}
|
|
1552
|
+
__name(appendCustomStyle, "appendCustomStyle");
|
|
1471
1553
|
function updateStyle(parent, inline) {
|
|
1472
1554
|
let styleNode = Array.from(parent.childNodes).find(node => node.hasAttribute && node.hasAttribute(nodeAttr));
|
|
1473
1555
|
if (!styleNode) {
|
|
@@ -1477,6 +1559,7 @@ function updateStyle(parent, inline) {
|
|
|
1477
1559
|
}
|
|
1478
1560
|
styleNode.textContent = ":host{display:inline-block;vertical-align:" + (inline ? "-0.125em" : "0") + "}span,svg{display:block;margin:auto}" + customStyle;
|
|
1479
1561
|
}
|
|
1562
|
+
__name(updateStyle, "updateStyle");
|
|
1480
1563
|
function exportFunctions() {
|
|
1481
1564
|
setAPIModule("", fetchAPIModule);
|
|
1482
1565
|
allowSimpleNames(true);
|
|
@@ -1536,9 +1619,9 @@ function exportFunctions() {
|
|
|
1536
1619
|
};
|
|
1537
1620
|
return {
|
|
1538
1621
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1539
|
-
enableCache: storage2 => {},
|
|
1622
|
+
enableCache: /* @__PURE__ */__name(storage2 => {}, "enableCache"),
|
|
1540
1623
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1541
|
-
disableCache: storage2 => {},
|
|
1624
|
+
disableCache: /* @__PURE__ */__name(storage2 => {}, "disableCache"),
|
|
1542
1625
|
iconLoaded: iconLoaded$1,
|
|
1543
1626
|
iconExists: iconLoaded$1,
|
|
1544
1627
|
// deprecated, kept to avoid breaking changes
|
|
@@ -1559,6 +1642,7 @@ function exportFunctions() {
|
|
|
1559
1642
|
_api: _api2
|
|
1560
1643
|
};
|
|
1561
1644
|
}
|
|
1645
|
+
__name(exportFunctions, "exportFunctions");
|
|
1562
1646
|
var monotoneProps = {
|
|
1563
1647
|
"background-color": "currentColor"
|
|
1564
1648
|
};
|
|
@@ -1584,6 +1668,7 @@ for (const prefix in propsToAddTo) {
|
|
|
1584
1668
|
function fixSize(value) {
|
|
1585
1669
|
return value ? value + (value.match(/^[-0-9.]+$/) ? "px" : "") : "inherit";
|
|
1586
1670
|
}
|
|
1671
|
+
__name(fixSize, "fixSize");
|
|
1587
1672
|
function renderSPAN(data, icon, useMask) {
|
|
1588
1673
|
const node = document.createElement("span");
|
|
1589
1674
|
let body = data.body;
|
|
@@ -1609,23 +1694,26 @@ function renderSPAN(data, icon, useMask) {
|
|
|
1609
1694
|
}
|
|
1610
1695
|
return node;
|
|
1611
1696
|
}
|
|
1697
|
+
__name(renderSPAN, "renderSPAN");
|
|
1612
1698
|
var policy;
|
|
1613
1699
|
function createPolicy() {
|
|
1614
1700
|
try {
|
|
1615
1701
|
policy = window.trustedTypes.createPolicy("iconify", {
|
|
1616
1702
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
1617
|
-
createHTML: s => s
|
|
1703
|
+
createHTML: /* @__PURE__ */__name(s => s, "createHTML")
|
|
1618
1704
|
});
|
|
1619
1705
|
} catch (err) {
|
|
1620
1706
|
policy = null;
|
|
1621
1707
|
}
|
|
1622
1708
|
}
|
|
1709
|
+
__name(createPolicy, "createPolicy");
|
|
1623
1710
|
function cleanUpInnerHTML(html) {
|
|
1624
1711
|
if (policy === void 0) {
|
|
1625
1712
|
createPolicy();
|
|
1626
1713
|
}
|
|
1627
1714
|
return policy ? policy.createHTML(html) : html;
|
|
1628
1715
|
}
|
|
1716
|
+
__name(cleanUpInnerHTML, "cleanUpInnerHTML");
|
|
1629
1717
|
function renderSVG(data) {
|
|
1630
1718
|
const node = document.createElement("span");
|
|
1631
1719
|
const attr = data.attributes;
|
|
@@ -1643,12 +1731,14 @@ function renderSVG(data) {
|
|
|
1643
1731
|
node.innerHTML = cleanUpInnerHTML(html);
|
|
1644
1732
|
return node.firstChild;
|
|
1645
1733
|
}
|
|
1734
|
+
__name(renderSVG, "renderSVG");
|
|
1646
1735
|
function findIconElement(parent) {
|
|
1647
1736
|
return Array.from(parent.childNodes).find(node => {
|
|
1648
1737
|
const tag = node.tagName && node.tagName.toUpperCase();
|
|
1649
1738
|
return tag === "SPAN" || tag === "SVG";
|
|
1650
1739
|
});
|
|
1651
1740
|
}
|
|
1741
|
+
__name(findIconElement, "findIconElement");
|
|
1652
1742
|
function renderIcon(parent, state) {
|
|
1653
1743
|
const iconData = state.icon.data;
|
|
1654
1744
|
const customisations = state.customisations;
|
|
@@ -1679,6 +1769,7 @@ function renderIcon(parent, state) {
|
|
|
1679
1769
|
parent.appendChild(node);
|
|
1680
1770
|
}
|
|
1681
1771
|
}
|
|
1772
|
+
__name(renderIcon, "renderIcon");
|
|
1682
1773
|
function setPendingState(icon, inline, lastState) {
|
|
1683
1774
|
const lastRender = lastState && (lastState.rendered ? lastState : lastState.lastRender);
|
|
1684
1775
|
return {
|
|
@@ -1688,6 +1779,7 @@ function setPendingState(icon, inline, lastState) {
|
|
|
1688
1779
|
lastRender
|
|
1689
1780
|
};
|
|
1690
1781
|
}
|
|
1782
|
+
__name(setPendingState, "setPendingState");
|
|
1691
1783
|
function defineIconifyIcon(name = "iconify-icon") {
|
|
1692
1784
|
let customElements;
|
|
1693
1785
|
let ParentClass;
|
|
@@ -1711,7 +1803,10 @@ function defineIconifyIcon(name = "iconify-icon") {
|
|
|
1711
1803
|
"mode", "inline", "noobserver",
|
|
1712
1804
|
// Customisations
|
|
1713
1805
|
"width", "height", "rotate", "flip"];
|
|
1714
|
-
const
|
|
1806
|
+
const IconifyIcon = class extends ParentClass {
|
|
1807
|
+
static {
|
|
1808
|
+
__name(this, "IconifyIcon");
|
|
1809
|
+
}
|
|
1715
1810
|
// Root
|
|
1716
1811
|
_shadowRoot;
|
|
1717
1812
|
// Initialised
|
|
@@ -2007,28 +2102,29 @@ function defineIconifyIcon(name = "iconify-icon") {
|
|
|
2007
2102
|
}
|
|
2008
2103
|
};
|
|
2009
2104
|
attributes.forEach(attr => {
|
|
2010
|
-
if (!(attr in
|
|
2011
|
-
Object.defineProperty(
|
|
2012
|
-
get: function () {
|
|
2105
|
+
if (!(attr in IconifyIcon.prototype)) {
|
|
2106
|
+
Object.defineProperty(IconifyIcon.prototype, attr, {
|
|
2107
|
+
get: /* @__PURE__ */__name(function () {
|
|
2013
2108
|
return this.getAttribute(attr);
|
|
2014
|
-
},
|
|
2015
|
-
set: function (value) {
|
|
2109
|
+
}, "get"),
|
|
2110
|
+
set: /* @__PURE__ */__name(function (value) {
|
|
2016
2111
|
if (value !== null) {
|
|
2017
2112
|
this.setAttribute(attr, value);
|
|
2018
2113
|
} else {
|
|
2019
2114
|
this.removeAttribute(attr);
|
|
2020
2115
|
}
|
|
2021
|
-
}
|
|
2116
|
+
}, "set")
|
|
2022
2117
|
});
|
|
2023
2118
|
}
|
|
2024
2119
|
});
|
|
2025
2120
|
const functions = exportFunctions();
|
|
2026
2121
|
for (const key in functions) {
|
|
2027
|
-
|
|
2122
|
+
IconifyIcon[key] = IconifyIcon.prototype[key] = functions[key];
|
|
2028
2123
|
}
|
|
2029
|
-
customElements.define(name,
|
|
2030
|
-
return
|
|
2124
|
+
customElements.define(name, IconifyIcon);
|
|
2125
|
+
return IconifyIcon;
|
|
2031
2126
|
}
|
|
2127
|
+
__name(defineIconifyIcon, "defineIconifyIcon");
|
|
2032
2128
|
var IconifyIconComponent = defineIconifyIcon() || exportFunctions();
|
|
2033
2129
|
var {
|
|
2034
2130
|
enableCache,
|
|
@@ -2053,7 +2149,7 @@ var {
|
|
|
2053
2149
|
} = IconifyIconComponent;
|
|
2054
2150
|
|
|
2055
2151
|
// ../../node_modules/.pnpm/@iconify-icon+react@2.3.0_react@19.1.1/node_modules/@iconify-icon/react/dist/iconify.mjs
|
|
2056
|
-
var Icon =
|
|
2152
|
+
var Icon = React2.forwardRef((props, ref) => {
|
|
2057
2153
|
const newProps = {
|
|
2058
2154
|
...props,
|
|
2059
2155
|
ref
|
|
@@ -2067,14 +2163,13 @@ var Icon = React.forwardRef((props, ref) => {
|
|
|
2067
2163
|
if (props.className) {
|
|
2068
2164
|
newProps["class"] = props.className;
|
|
2069
2165
|
}
|
|
2070
|
-
return
|
|
2166
|
+
return React2.createElement("iconify-icon", newProps);
|
|
2071
2167
|
});
|
|
2072
2168
|
|
|
2073
2169
|
// ../react-icons/src/Icon.tsx
|
|
2074
|
-
import * as
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
return /* @__PURE__ */jsx2(Icon, {
|
|
2170
|
+
import * as React3 from "react";
|
|
2171
|
+
var Icon2 = /* @__PURE__ */React3.forwardRef((props, ref) => {
|
|
2172
|
+
return /* @__PURE__ */React3.createElement(Icon, {
|
|
2078
2173
|
ref,
|
|
2079
2174
|
"data-testid": "iconify-icon",
|
|
2080
2175
|
...props
|
|
@@ -2084,33 +2179,32 @@ Icon2.displayName = "Icon";
|
|
|
2084
2179
|
|
|
2085
2180
|
// src/components/Header.tsx
|
|
2086
2181
|
import { Box as Box3, Flex as Flex2, IconButton as IconButton2 } from "@ttoss/ui";
|
|
2087
|
-
import * as
|
|
2182
|
+
import * as React6 from "react";
|
|
2088
2183
|
|
|
2089
2184
|
// src/useIsDesktop.ts
|
|
2090
2185
|
import { useBreakpointIndex } from "@ttoss/ui";
|
|
2091
|
-
var useIsDesktop = () => {
|
|
2186
|
+
var useIsDesktop = /* @__PURE__ */__name(() => {
|
|
2092
2187
|
const breakpointIndex = useBreakpointIndex();
|
|
2093
2188
|
const isDesktop = breakpointIndex >= 2;
|
|
2094
2189
|
return {
|
|
2095
2190
|
isDesktop
|
|
2096
2191
|
};
|
|
2097
|
-
};
|
|
2192
|
+
}, "useIsDesktop");
|
|
2098
2193
|
|
|
2099
2194
|
// src/components/LayoutProvider.tsx
|
|
2100
|
-
import * as
|
|
2101
|
-
|
|
2102
|
-
var LayoutContext = React3.createContext({
|
|
2195
|
+
import * as React4 from "react";
|
|
2196
|
+
var LayoutContext = /* @__PURE__ */React4.createContext({
|
|
2103
2197
|
isSidebarOpen: true,
|
|
2104
|
-
toggleSidebar: () => {}
|
|
2198
|
+
toggleSidebar: /* @__PURE__ */__name(() => {}, "toggleSidebar")
|
|
2105
2199
|
});
|
|
2106
|
-
var LayoutProvider = ({
|
|
2200
|
+
var LayoutProvider = /* @__PURE__ */__name(({
|
|
2107
2201
|
children
|
|
2108
2202
|
}) => {
|
|
2109
|
-
const [isSidebarOpen, setIsSidebarOpen] =
|
|
2203
|
+
const [isSidebarOpen, setIsSidebarOpen] = React4.useState(true);
|
|
2110
2204
|
const {
|
|
2111
2205
|
isDesktop
|
|
2112
2206
|
} = useIsDesktop();
|
|
2113
|
-
|
|
2207
|
+
React4.useEffect(() => {
|
|
2114
2208
|
if (!isDesktop) {
|
|
2115
2209
|
setIsSidebarOpen(false);
|
|
2116
2210
|
}
|
|
@@ -2118,34 +2212,32 @@ var LayoutProvider = ({
|
|
|
2118
2212
|
setIsSidebarOpen(true);
|
|
2119
2213
|
}
|
|
2120
2214
|
}, [isDesktop]);
|
|
2121
|
-
const toggleSidebar = () => {
|
|
2215
|
+
const toggleSidebar = /* @__PURE__ */__name(() => {
|
|
2122
2216
|
setIsSidebarOpen(prev => {
|
|
2123
2217
|
return !prev;
|
|
2124
2218
|
});
|
|
2125
|
-
};
|
|
2126
|
-
return /* @__PURE__ */
|
|
2219
|
+
}, "toggleSidebar");
|
|
2220
|
+
return /* @__PURE__ */React4.createElement(LayoutContext.Provider, {
|
|
2127
2221
|
value: {
|
|
2128
2222
|
isSidebarOpen,
|
|
2129
2223
|
toggleSidebar
|
|
2130
|
-
}
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
const context = React3.useContext(LayoutContext);
|
|
2224
|
+
}
|
|
2225
|
+
}, children);
|
|
2226
|
+
}, "LayoutProvider");
|
|
2227
|
+
var useLayout = /* @__PURE__ */__name(() => {
|
|
2228
|
+
const context = React4.useContext(LayoutContext);
|
|
2136
2229
|
if (!context) {
|
|
2137
2230
|
throw new Error("useLayout must be used within a LayoutProvider");
|
|
2138
2231
|
}
|
|
2139
2232
|
return context;
|
|
2140
|
-
};
|
|
2233
|
+
}, "useLayout");
|
|
2141
2234
|
|
|
2142
2235
|
// src/components/Sidebar.tsx
|
|
2143
2236
|
import { Drawer } from "@ttoss/components/Drawer";
|
|
2144
2237
|
import { Box as Box2, Flex, IconButton } from "@ttoss/ui";
|
|
2145
|
-
import * as
|
|
2146
|
-
import { Fragment, jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
2238
|
+
import * as React5 from "react";
|
|
2147
2239
|
var SIDEBAR_WIDTH = "2xs";
|
|
2148
|
-
var Sidebar = ({
|
|
2240
|
+
var Sidebar = /* @__PURE__ */__name(({
|
|
2149
2241
|
drawerSlot,
|
|
2150
2242
|
showSidebarButtonInDrawer,
|
|
2151
2243
|
children,
|
|
@@ -2158,11 +2250,11 @@ var Sidebar = ({
|
|
|
2158
2250
|
const {
|
|
2159
2251
|
isDesktop
|
|
2160
2252
|
} = useIsDesktop();
|
|
2161
|
-
const sidebarButtonInDrawer =
|
|
2253
|
+
const sidebarButtonInDrawer = React5.useMemo(() => {
|
|
2162
2254
|
if (!showSidebarButtonInDrawer) {
|
|
2163
2255
|
return null;
|
|
2164
2256
|
}
|
|
2165
|
-
return /* @__PURE__ */
|
|
2257
|
+
return /* @__PURE__ */React5.createElement(IconButton, {
|
|
2166
2258
|
"aria-label": isSidebarOpen ? "Close sidebar" : "Open sidebar",
|
|
2167
2259
|
"aria-expanded": isSidebarOpen,
|
|
2168
2260
|
"aria-controls": "sidebar",
|
|
@@ -2170,26 +2262,24 @@ var Sidebar = ({
|
|
|
2170
2262
|
cursor: "pointer",
|
|
2171
2263
|
fontSize: ["xl", "2xl"]
|
|
2172
2264
|
},
|
|
2173
|
-
"data-testid": "sidebar-button"
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
});
|
|
2265
|
+
"data-testid": "sidebar-button"
|
|
2266
|
+
}, /* @__PURE__ */React5.createElement(Icon2, {
|
|
2267
|
+
icon: isSidebarOpen ? "sidebar-close" : "sidebar-open"
|
|
2268
|
+
}));
|
|
2178
2269
|
}, [isSidebarOpen, showSidebarButtonInDrawer]);
|
|
2179
|
-
const memoizedDrawerSlot =
|
|
2270
|
+
const memoizedDrawerSlot = React5.useMemo(() => {
|
|
2180
2271
|
if (!drawerSlot) {
|
|
2181
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */React5.createElement(Flex, {
|
|
2182
2273
|
sx: {
|
|
2183
2274
|
width: "full",
|
|
2184
2275
|
paddingY: "3",
|
|
2185
2276
|
borderBottom: "sm",
|
|
2186
2277
|
borderColor: "display.border.muted.default",
|
|
2187
2278
|
alignItems: "center"
|
|
2188
|
-
}
|
|
2189
|
-
|
|
2190
|
-
});
|
|
2279
|
+
}
|
|
2280
|
+
}, sidebarButtonInDrawer);
|
|
2191
2281
|
}
|
|
2192
|
-
return /* @__PURE__ */
|
|
2282
|
+
return /* @__PURE__ */React5.createElement(Flex, {
|
|
2193
2283
|
sx: {
|
|
2194
2284
|
width: "full",
|
|
2195
2285
|
paddingY: "3",
|
|
@@ -2197,83 +2287,74 @@ var Sidebar = ({
|
|
|
2197
2287
|
borderColor: "display.border.muted.default",
|
|
2198
2288
|
alignItems: "center",
|
|
2199
2289
|
gap: "2"
|
|
2200
|
-
}
|
|
2201
|
-
|
|
2202
|
-
sx: {
|
|
2203
|
-
minWidth: SIDEBAR_WIDTH,
|
|
2204
|
-
width: SIDEBAR_WIDTH
|
|
2205
|
-
},
|
|
2206
|
-
children: drawerSlot
|
|
2207
|
-
})]
|
|
2208
|
-
});
|
|
2209
|
-
}, [drawerSlot, sidebarButtonInDrawer]);
|
|
2210
|
-
return /* @__PURE__ */jsx4(Fragment, {
|
|
2211
|
-
children: isDesktop ? /* @__PURE__ */jsx4(Box2, {
|
|
2212
|
-
role: "complementary",
|
|
2213
|
-
"aria-label": "Sidebar",
|
|
2214
|
-
"aria-hidden": !isSidebarOpen,
|
|
2215
|
-
sx: {
|
|
2216
|
-
position: "relative",
|
|
2217
|
-
zIndex: "overlay",
|
|
2218
|
-
height: "full",
|
|
2219
|
-
minHeight: isSidebarOpen ? "full" : "0",
|
|
2220
|
-
width: isSidebarOpen ? SIDEBAR_WIDTH : "0",
|
|
2221
|
-
minWidth: isSidebarOpen ? SIDEBAR_WIDTH : "0",
|
|
2222
|
-
opacity: isSidebarOpen ? 1 : 0,
|
|
2223
|
-
transition: "width 0.5s ease, opacity 0.5s ease",
|
|
2224
|
-
borderRight: isSidebarOpen ? "sm" : "none",
|
|
2225
|
-
borderColor: "display.border.muted.default",
|
|
2226
|
-
backgroundColor: "navigation.background.muted.default",
|
|
2227
|
-
paddingX: isSidebarOpen ? "6" : "0",
|
|
2228
|
-
paddingY: isSidebarOpen ? "6" : "0",
|
|
2229
|
-
overflowY: "auto",
|
|
2230
|
-
...boxProps.sx
|
|
2231
|
-
},
|
|
2232
|
-
children: isSidebarOpen ? children : null
|
|
2233
|
-
}) : /* @__PURE__ */jsx4(Box2, {
|
|
2234
|
-
role: "complementary",
|
|
2235
|
-
"aria-label": "Sidebar",
|
|
2236
|
-
"aria-hidden": !isSidebarOpen,
|
|
2290
|
+
}
|
|
2291
|
+
}, sidebarButtonInDrawer, /* @__PURE__ */React5.createElement(Flex, {
|
|
2237
2292
|
sx: {
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2293
|
+
minWidth: SIDEBAR_WIDTH,
|
|
2294
|
+
width: SIDEBAR_WIDTH
|
|
2295
|
+
}
|
|
2296
|
+
}, drawerSlot));
|
|
2297
|
+
}, [drawerSlot, sidebarButtonInDrawer]);
|
|
2298
|
+
return /* @__PURE__ */React5.createElement(React5.Fragment, null, isDesktop ? /* @__PURE__ */React5.createElement(Box2, {
|
|
2299
|
+
role: "complementary",
|
|
2300
|
+
"aria-label": "Sidebar",
|
|
2301
|
+
"aria-hidden": !isSidebarOpen,
|
|
2302
|
+
sx: {
|
|
2303
|
+
position: "relative",
|
|
2304
|
+
zIndex: "overlay",
|
|
2305
|
+
height: "full",
|
|
2306
|
+
minHeight: isSidebarOpen ? "full" : "0",
|
|
2307
|
+
width: isSidebarOpen ? SIDEBAR_WIDTH : "0",
|
|
2308
|
+
minWidth: isSidebarOpen ? SIDEBAR_WIDTH : "0",
|
|
2309
|
+
opacity: isSidebarOpen ? 1 : 0,
|
|
2310
|
+
transition: "width 0.5s ease, opacity 0.5s ease",
|
|
2311
|
+
borderRight: isSidebarOpen ? "sm" : "none",
|
|
2312
|
+
borderColor: "display.border.muted.default",
|
|
2313
|
+
backgroundColor: "navigation.background.muted.default",
|
|
2314
|
+
paddingX: isSidebarOpen ? "6" : "0",
|
|
2315
|
+
paddingY: isSidebarOpen ? "6" : "0",
|
|
2316
|
+
overflowY: "auto",
|
|
2317
|
+
...boxProps.sx
|
|
2318
|
+
}
|
|
2319
|
+
}, isSidebarOpen ? children : null) : /* @__PURE__ */React5.createElement(Box2, {
|
|
2320
|
+
role: "complementary",
|
|
2321
|
+
"aria-label": "Sidebar",
|
|
2322
|
+
"aria-hidden": !isSidebarOpen,
|
|
2323
|
+
sx: {
|
|
2324
|
+
position: "fixed",
|
|
2325
|
+
zIndex: "overlay",
|
|
2326
|
+
border: "none",
|
|
2327
|
+
width: isSidebarOpen ? "full" : "0",
|
|
2328
|
+
height: isSidebarOpen ? "full" : "0",
|
|
2329
|
+
...boxProps.sx
|
|
2330
|
+
},
|
|
2331
|
+
onClick: /* @__PURE__ */__name(() => {
|
|
2332
|
+
if (isSidebarOpen) {
|
|
2333
|
+
toggleSidebar();
|
|
2334
|
+
}
|
|
2335
|
+
}, "onClick")
|
|
2336
|
+
}, /* @__PURE__ */React5.createElement(Drawer, {
|
|
2337
|
+
open: isSidebarOpen,
|
|
2338
|
+
direction: "left",
|
|
2339
|
+
size: "100%",
|
|
2340
|
+
enableOverlay: false
|
|
2341
|
+
}, /* @__PURE__ */React5.createElement(Flex, {
|
|
2342
|
+
sx: {
|
|
2343
|
+
width: "full",
|
|
2344
|
+
height: "full",
|
|
2345
|
+
gap: "6",
|
|
2346
|
+
flexDirection: "column"
|
|
2347
|
+
}
|
|
2348
|
+
}, memoizedDrawerSlot, isSidebarOpen ? children : null))));
|
|
2349
|
+
}, "Sidebar");
|
|
2268
2350
|
Sidebar.displayName = "Sidebar";
|
|
2269
2351
|
|
|
2270
2352
|
// src/components/Header.tsx
|
|
2271
|
-
import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
2272
2353
|
var paddingSx = {
|
|
2273
2354
|
paddingX: "4",
|
|
2274
2355
|
paddingY: "3"
|
|
2275
2356
|
};
|
|
2276
|
-
var Header = ({
|
|
2357
|
+
var Header = /* @__PURE__ */__name(({
|
|
2277
2358
|
showSidebarButton,
|
|
2278
2359
|
sidebarSlot,
|
|
2279
2360
|
children,
|
|
@@ -2286,11 +2367,11 @@ var Header = ({
|
|
|
2286
2367
|
const {
|
|
2287
2368
|
isDesktop
|
|
2288
2369
|
} = useIsDesktop();
|
|
2289
|
-
const sidebarButton =
|
|
2370
|
+
const sidebarButton = React6.useMemo(() => {
|
|
2290
2371
|
if (!showSidebarButton) {
|
|
2291
2372
|
return null;
|
|
2292
2373
|
}
|
|
2293
|
-
return /* @__PURE__ */
|
|
2374
|
+
return /* @__PURE__ */React6.createElement(IconButton2, {
|
|
2294
2375
|
"aria-label": isSidebarOpen ? "Close sidebar" : "Open sidebar",
|
|
2295
2376
|
"aria-expanded": isSidebarOpen,
|
|
2296
2377
|
"aria-controls": "sidebar",
|
|
@@ -2299,19 +2380,16 @@ var Header = ({
|
|
|
2299
2380
|
fontSize: ["xl", "2xl"]
|
|
2300
2381
|
},
|
|
2301
2382
|
"data-testid": "sidebar-button",
|
|
2302
|
-
onClick: toggleSidebar
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
});
|
|
2383
|
+
onClick: toggleSidebar
|
|
2384
|
+
}, /* @__PURE__ */React6.createElement(Icon2, {
|
|
2385
|
+
icon: isSidebarOpen ? "sidebar-close" : "sidebar-open"
|
|
2386
|
+
}));
|
|
2307
2387
|
}, [isSidebarOpen, showSidebarButton, toggleSidebar]);
|
|
2308
|
-
const memoizedSidebarSlot =
|
|
2388
|
+
const memoizedSidebarSlot = React6.useMemo(() => {
|
|
2309
2389
|
if (!sidebarSlot) {
|
|
2310
|
-
return /* @__PURE__ */
|
|
2311
|
-
children: sidebarButton
|
|
2312
|
-
});
|
|
2390
|
+
return /* @__PURE__ */React6.createElement(React6.Fragment, null, sidebarButton);
|
|
2313
2391
|
}
|
|
2314
|
-
return /* @__PURE__ */
|
|
2392
|
+
return /* @__PURE__ */React6.createElement(Flex2, {
|
|
2315
2393
|
sx: {
|
|
2316
2394
|
minWidth: ["12rem", "3xs", SIDEBAR_WIDTH],
|
|
2317
2395
|
width: ["12rem", "3xs", SIDEBAR_WIDTH],
|
|
@@ -2320,11 +2398,10 @@ var Header = ({
|
|
|
2320
2398
|
alignItems: "center",
|
|
2321
2399
|
gap: "2",
|
|
2322
2400
|
...paddingSx
|
|
2323
|
-
}
|
|
2324
|
-
|
|
2325
|
-
});
|
|
2401
|
+
}
|
|
2402
|
+
}, sidebarButton, sidebarSlot);
|
|
2326
2403
|
}, [isDesktop, sidebarButton, sidebarSlot]);
|
|
2327
|
-
return /* @__PURE__ */
|
|
2404
|
+
return /* @__PURE__ */React6.createElement(Flex2, {
|
|
2328
2405
|
variant: "layout.header",
|
|
2329
2406
|
...boxProps,
|
|
2330
2407
|
as: "header",
|
|
@@ -2337,18 +2414,16 @@ var Header = ({
|
|
|
2337
2414
|
backgroundColor: "navigation.background.primary.default",
|
|
2338
2415
|
...(sidebarSlot ? {} : paddingSx),
|
|
2339
2416
|
...boxProps.sx
|
|
2340
|
-
}
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
});
|
|
2351
|
-
};
|
|
2417
|
+
}
|
|
2418
|
+
}, memoizedSidebarSlot, /* @__PURE__ */React6.createElement(Box3, {
|
|
2419
|
+
sx: {
|
|
2420
|
+
width: "full",
|
|
2421
|
+
display: ["flex", "unset", "unset"],
|
|
2422
|
+
justifyContent: ["center", "unset", "unset"],
|
|
2423
|
+
...(sidebarSlot ? paddingSx : {})
|
|
2424
|
+
}
|
|
2425
|
+
}, children));
|
|
2426
|
+
}, "Header");
|
|
2352
2427
|
Header.displayName = "Header";
|
|
2353
2428
|
|
|
2354
2429
|
// src/components/Main.tsx
|
|
@@ -2356,9 +2431,8 @@ import { Stack } from "@ttoss/ui";
|
|
|
2356
2431
|
|
|
2357
2432
|
// src/components/MainBody.tsx
|
|
2358
2433
|
import { Box as Box4 } from "@ttoss/ui";
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
return /* @__PURE__ */jsx6(Box4, {
|
|
2434
|
+
var MainBody = /* @__PURE__ */__name(props => {
|
|
2435
|
+
return /* @__PURE__ */React.createElement(Box4, {
|
|
2362
2436
|
variant: "layout.main.body",
|
|
2363
2437
|
...props,
|
|
2364
2438
|
as: "main",
|
|
@@ -2369,17 +2443,15 @@ var MainBody = props => {
|
|
|
2369
2443
|
width: "full",
|
|
2370
2444
|
height: "full",
|
|
2371
2445
|
...props.sx
|
|
2372
|
-
}
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
};
|
|
2446
|
+
}
|
|
2447
|
+
}, props.children);
|
|
2448
|
+
}, "MainBody");
|
|
2376
2449
|
MainBody.displayName = "MainBody";
|
|
2377
2450
|
|
|
2378
2451
|
// src/components/MainFooter.tsx
|
|
2379
2452
|
import { Box as Box5 } from "@ttoss/ui";
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
return /* @__PURE__ */jsx7(Box5, {
|
|
2453
|
+
var MainFooter = /* @__PURE__ */__name(props => {
|
|
2454
|
+
return /* @__PURE__ */React.createElement(Box5, {
|
|
2383
2455
|
variant: "layout.main.footer",
|
|
2384
2456
|
...props,
|
|
2385
2457
|
sx: {
|
|
@@ -2390,17 +2462,15 @@ var MainFooter = props => {
|
|
|
2390
2462
|
backgroundColor: "navigation.background.primary.default",
|
|
2391
2463
|
width: "full",
|
|
2392
2464
|
...props.sx
|
|
2393
|
-
}
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
};
|
|
2465
|
+
}
|
|
2466
|
+
}, props.children);
|
|
2467
|
+
}, "MainFooter");
|
|
2397
2468
|
MainFooter.displayName = "MainFooter";
|
|
2398
2469
|
|
|
2399
2470
|
// src/components/MainHeader.tsx
|
|
2400
2471
|
import { Box as Box6 } from "@ttoss/ui";
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
return /* @__PURE__ */jsx8(Box6, {
|
|
2472
|
+
var MainHeader = /* @__PURE__ */__name(props => {
|
|
2473
|
+
return /* @__PURE__ */React.createElement(Box6, {
|
|
2404
2474
|
variant: "layout.main.header",
|
|
2405
2475
|
...props,
|
|
2406
2476
|
as: "header",
|
|
@@ -2412,40 +2482,35 @@ var MainHeader = props => {
|
|
|
2412
2482
|
backgroundColor: "navigation.background.primary.default",
|
|
2413
2483
|
width: "full",
|
|
2414
2484
|
...props.sx
|
|
2415
|
-
}
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
};
|
|
2485
|
+
}
|
|
2486
|
+
}, props.children);
|
|
2487
|
+
}, "MainHeader");
|
|
2419
2488
|
MainHeader.displayName = "MainHeader";
|
|
2420
2489
|
|
|
2421
2490
|
// src/components/Main.tsx
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
return /* @__PURE__ */jsx9(Stack, {
|
|
2491
|
+
var Main = /* @__PURE__ */__name(props => {
|
|
2492
|
+
return /* @__PURE__ */React.createElement(Stack, {
|
|
2425
2493
|
variant: "layout.main",
|
|
2426
2494
|
sx: {
|
|
2427
2495
|
flex: 1,
|
|
2428
2496
|
height: "full",
|
|
2429
2497
|
overflow: "hidden"
|
|
2430
|
-
}
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
};
|
|
2498
|
+
}
|
|
2499
|
+
}, props.children);
|
|
2500
|
+
}, "Main");
|
|
2434
2501
|
Main.displayName = "Main";
|
|
2435
2502
|
Main.Header = MainHeader;
|
|
2436
2503
|
Main.Body = MainBody;
|
|
2437
2504
|
Main.Footer = MainFooter;
|
|
2438
2505
|
|
|
2439
2506
|
// src/components/Layout.tsx
|
|
2440
|
-
|
|
2441
|
-
var Layout = ({
|
|
2507
|
+
var Layout = /* @__PURE__ */__name(({
|
|
2442
2508
|
children
|
|
2443
2509
|
}) => {
|
|
2444
|
-
return /* @__PURE__ */
|
|
2445
|
-
variant: "layout.layout"
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
};
|
|
2510
|
+
return /* @__PURE__ */React.createElement(Box7, {
|
|
2511
|
+
variant: "layout.layout"
|
|
2512
|
+
}, children);
|
|
2513
|
+
}, "Layout");
|
|
2449
2514
|
Layout.Header = Header;
|
|
2450
2515
|
Layout.Sidebar = Sidebar;
|
|
2451
2516
|
Layout.Main = Main;
|
|
@@ -2456,7 +2521,7 @@ Layout.Container = Container;
|
|
|
2456
2521
|
import { Flex as Flex3, Stack as Stack2 } from "@ttoss/ui";
|
|
2457
2522
|
|
|
2458
2523
|
// src/getSemanticElements.ts
|
|
2459
|
-
import * as
|
|
2524
|
+
import * as React7 from "react";
|
|
2460
2525
|
var semanticComponents = {
|
|
2461
2526
|
Header: "header",
|
|
2462
2527
|
Sidebar: "sidebar",
|
|
@@ -2466,11 +2531,11 @@ var semanticComponents = {
|
|
|
2466
2531
|
MainBody: "mainBody",
|
|
2467
2532
|
MainFooter: "mainFooter"
|
|
2468
2533
|
};
|
|
2469
|
-
var getSematicElements = ({
|
|
2534
|
+
var getSematicElements = /* @__PURE__ */__name(({
|
|
2470
2535
|
children
|
|
2471
2536
|
}) => {
|
|
2472
2537
|
const semanticElements = {};
|
|
2473
|
-
|
|
2538
|
+
React7.Children.forEach(children, child => {
|
|
2474
2539
|
const displayName = child?.type?.displayName;
|
|
2475
2540
|
if (!displayName) {
|
|
2476
2541
|
return;
|
|
@@ -2480,11 +2545,10 @@ var getSematicElements = ({
|
|
|
2480
2545
|
}
|
|
2481
2546
|
});
|
|
2482
2547
|
return semanticElements;
|
|
2483
|
-
};
|
|
2548
|
+
}, "getSematicElements");
|
|
2484
2549
|
|
|
2485
2550
|
// src/components/SidebarCollapseLayout.tsx
|
|
2486
|
-
|
|
2487
|
-
var SidebarCollapseLayout = ({
|
|
2551
|
+
var SidebarCollapseLayout = /* @__PURE__ */__name(({
|
|
2488
2552
|
children,
|
|
2489
2553
|
...props
|
|
2490
2554
|
}) => {
|
|
@@ -2495,32 +2559,28 @@ var SidebarCollapseLayout = ({
|
|
|
2495
2559
|
} = getSematicElements({
|
|
2496
2560
|
children
|
|
2497
2561
|
});
|
|
2498
|
-
return /* @__PURE__ */
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
})]
|
|
2516
|
-
})
|
|
2517
|
-
});
|
|
2518
|
-
};
|
|
2562
|
+
return /* @__PURE__ */React.createElement(LayoutProvider, null, /* @__PURE__ */React.createElement(Stack2, {
|
|
2563
|
+
...props,
|
|
2564
|
+
sx: {
|
|
2565
|
+
height: ["100vh"],
|
|
2566
|
+
width: "full",
|
|
2567
|
+
overflow: "hidden",
|
|
2568
|
+
...props.sx
|
|
2569
|
+
}
|
|
2570
|
+
}, header, /* @__PURE__ */React.createElement(Flex3, {
|
|
2571
|
+
sx: {
|
|
2572
|
+
width: "full",
|
|
2573
|
+
flex: 1,
|
|
2574
|
+
overflow: "hidden",
|
|
2575
|
+
flexDirection: ["row"]
|
|
2576
|
+
}
|
|
2577
|
+
}, sidebar, main)));
|
|
2578
|
+
}, "SidebarCollapseLayout");
|
|
2519
2579
|
|
|
2520
2580
|
// src/components/StackedLayout.tsx
|
|
2521
2581
|
import { Stack as Stack3 } from "@ttoss/ui";
|
|
2522
|
-
import
|
|
2523
|
-
var StackedLayout = ({
|
|
2582
|
+
import * as React8 from "react";
|
|
2583
|
+
var StackedLayout = /* @__PURE__ */__name(({
|
|
2524
2584
|
children,
|
|
2525
2585
|
...props
|
|
2526
2586
|
}) => {
|
|
@@ -2531,13 +2591,8 @@ var StackedLayout = ({
|
|
|
2531
2591
|
} = getSematicElements({
|
|
2532
2592
|
children
|
|
2533
2593
|
});
|
|
2534
|
-
return /* @__PURE__ */
|
|
2535
|
-
|
|
2536
|
-
...props,
|
|
2537
|
-
children: [header, main, footer]
|
|
2538
|
-
})
|
|
2539
|
-
});
|
|
2540
|
-
};
|
|
2594
|
+
return /* @__PURE__ */React8.createElement(LayoutProvider, null, /* @__PURE__ */React8.createElement(Stack3, props, header, main, footer));
|
|
2595
|
+
}, "StackedLayout");
|
|
2541
2596
|
export { Layout, SidebarCollapseLayout, StackedLayout, useIsDesktop };
|
|
2542
2597
|
/*! Bundled license information:
|
|
2543
2598
|
|