@lundal/zed-solid 0.0.16 → 0.0.18
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/Header.d.ts +1 -0
- package/dist/{NavHeader.d.ts → NavHeading.d.ts} +2 -2
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +42 -47
- package/package.json +13 -17
package/dist/Header.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSX } from 'solid-js';
|
|
2
|
-
export type
|
|
2
|
+
export type NavHeadingProps = {
|
|
3
3
|
class?: string;
|
|
4
4
|
style?: JSX.CSSProperties;
|
|
5
5
|
children: JSX.Element;
|
|
6
6
|
};
|
|
7
|
-
export declare function
|
|
7
|
+
export declare function NavHeading(props: NavHeadingProps): JSX.Element;
|
package/dist/index.css
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export * from './IconButton.tsx';
|
|
|
13
13
|
export * from './Link.tsx';
|
|
14
14
|
export * from './Message.tsx';
|
|
15
15
|
export * from './Nav.tsx';
|
|
16
|
-
export * from './
|
|
16
|
+
export * from './NavHeading.tsx';
|
|
17
17
|
export * from './NavLink.tsx';
|
|
18
18
|
export * from './Page.tsx';
|
|
19
19
|
export * from './RadioButtons.tsx';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
import "@fontsource/inter/400.css";
|
|
3
3
|
import "@fontsource/inter/500.css";
|
|
4
|
-
import { sharedConfig,
|
|
4
|
+
import { sharedConfig, createMemo, untrack, createRenderEffect, createComponent, For, createSignal, onMount, onCleanup } from "solid-js";
|
|
5
5
|
import { A } from "@solidjs/router";
|
|
6
|
+
const memo = (fn) => createMemo(() => fn());
|
|
6
7
|
function reconcileArrays(parentNode, a, b) {
|
|
7
8
|
let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map = null;
|
|
8
9
|
while (aStart < aEnd || bStart < bEnd) {
|
|
@@ -52,12 +53,12 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
const $$EVENTS = "_$DX_DELEGATE";
|
|
55
|
-
function template(html, isImportNode, isSVG) {
|
|
56
|
+
function template(html, isImportNode, isSVG, isMathML) {
|
|
56
57
|
let node;
|
|
57
58
|
const create = () => {
|
|
58
|
-
const t = document.createElement("template");
|
|
59
|
+
const t = isMathML ? document.createElementNS("http://www.w3.org/1998/Math/MathML", "template") : document.createElement("template");
|
|
59
60
|
t.innerHTML = html;
|
|
60
|
-
return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;
|
|
61
|
+
return isSVG ? t.content.firstChild.firstChild : isMathML ? t.firstChild : t.content.firstChild;
|
|
61
62
|
};
|
|
62
63
|
const fn = isImportNode ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
|
|
63
64
|
fn.cloneNode = fn;
|
|
@@ -260,11 +261,7 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
260
261
|
} else if (t === "function") {
|
|
261
262
|
if (unwrap) {
|
|
262
263
|
while (typeof item === "function") item = item();
|
|
263
|
-
dynamic = normalizeIncomingArray(
|
|
264
|
-
normalized,
|
|
265
|
-
Array.isArray(item) ? item : [item],
|
|
266
|
-
Array.isArray(prev) ? prev : [prev]
|
|
267
|
-
) || dynamic;
|
|
264
|
+
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
|
|
268
265
|
} else {
|
|
269
266
|
normalized.push(item);
|
|
270
267
|
dynamic = true;
|
|
@@ -289,8 +286,7 @@ function cleanChildren(parent, current, marker, replacement) {
|
|
|
289
286
|
const el = current[i];
|
|
290
287
|
if (node !== el) {
|
|
291
288
|
const isParent = el.parentNode === parent;
|
|
292
|
-
if (!inserted && !i)
|
|
293
|
-
isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
|
|
289
|
+
if (!inserted && !i) isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
|
|
294
290
|
else isParent && el.remove();
|
|
295
291
|
} else inserted = true;
|
|
296
292
|
}
|
|
@@ -401,7 +397,7 @@ function CheckBoxes(props) {
|
|
|
401
397
|
})()
|
|
402
398
|
}), null);
|
|
403
399
|
insert(_el$, (() => {
|
|
404
|
-
var _c$ =
|
|
400
|
+
var _c$ = memo(() => !!props.error);
|
|
405
401
|
return () => _c$() && (() => {
|
|
406
402
|
var _el$6 = _tmpl$3$3();
|
|
407
403
|
insert(_el$6, () => props.error);
|
|
@@ -410,7 +406,7 @@ function CheckBoxes(props) {
|
|
|
410
406
|
})();
|
|
411
407
|
})(), null);
|
|
412
408
|
insert(_el$, (() => {
|
|
413
|
-
var _c$2 =
|
|
409
|
+
var _c$2 = memo(() => !!(!props.error && props.errorPlaceholder !== false));
|
|
414
410
|
return () => _c$2() && _tmpl$4$2();
|
|
415
411
|
})(), null);
|
|
416
412
|
createRenderEffect((_p$) => {
|
|
@@ -451,13 +447,13 @@ function Dialog(props) {
|
|
|
451
447
|
}
|
|
452
448
|
let dialog;
|
|
453
449
|
onMount(() => {
|
|
454
|
-
dialog
|
|
455
|
-
dialog
|
|
450
|
+
dialog?.showModal();
|
|
451
|
+
dialog?.classList.add("z-dialog--open");
|
|
456
452
|
});
|
|
457
453
|
function close() {
|
|
458
|
-
dialog
|
|
454
|
+
dialog?.classList.remove("z-dialog--open");
|
|
459
455
|
setTimeout(() => {
|
|
460
|
-
dialog
|
|
456
|
+
dialog?.close();
|
|
461
457
|
props.onClose();
|
|
462
458
|
}, 100);
|
|
463
459
|
}
|
|
@@ -497,7 +493,7 @@ function Field(props) {
|
|
|
497
493
|
return (() => {
|
|
498
494
|
var _el$ = _tmpl$$f();
|
|
499
495
|
insert(_el$, (() => {
|
|
500
|
-
var _c$ =
|
|
496
|
+
var _c$ = memo(() => !!props.label);
|
|
501
497
|
return () => _c$() && (() => {
|
|
502
498
|
var _el$2 = _tmpl$2$4();
|
|
503
499
|
insert(_el$2, () => props.label);
|
|
@@ -511,7 +507,7 @@ function Field(props) {
|
|
|
511
507
|
errorId: props.error ? `${props.id}-error` : void 0
|
|
512
508
|
})), null);
|
|
513
509
|
insert(_el$, (() => {
|
|
514
|
-
var _c$2 =
|
|
510
|
+
var _c$2 = memo(() => !!props.error);
|
|
515
511
|
return () => _c$2() && (() => {
|
|
516
512
|
var _el$3 = _tmpl$3$2();
|
|
517
513
|
insert(_el$3, () => props.error);
|
|
@@ -520,7 +516,7 @@ function Field(props) {
|
|
|
520
516
|
})();
|
|
521
517
|
})(), null);
|
|
522
518
|
insert(_el$, (() => {
|
|
523
|
-
var _c$3 =
|
|
519
|
+
var _c$3 = memo(() => !!(!props.error && props.errorPlaceholder !== false));
|
|
524
520
|
return () => _c$3() && _tmpl$4$1();
|
|
525
521
|
})(), null);
|
|
526
522
|
createRenderEffect((_p$) => {
|
|
@@ -556,13 +552,14 @@ function Form(props) {
|
|
|
556
552
|
return _el$;
|
|
557
553
|
})();
|
|
558
554
|
}
|
|
559
|
-
var _tmpl$$d = /* @__PURE__ */ template(`<header><a class=z-header--app href=/><span></span></a><div class=z-header--buttons>`);
|
|
555
|
+
var _tmpl$$d = /* @__PURE__ */ template(`<header><a class=z-header--app href=/><span></span></a><div class=z-header--children></div><div class=z-header--buttons>`);
|
|
560
556
|
function Header(props) {
|
|
561
557
|
return (() => {
|
|
562
|
-
var _el$ = _tmpl$$d(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
|
|
558
|
+
var _el$ = _tmpl$$d(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling, _el$5 = _el$4.nextSibling;
|
|
563
559
|
insert(_el$2, () => props.appIcon, _el$3);
|
|
564
560
|
insert(_el$3, () => props.appName);
|
|
565
561
|
insert(_el$4, () => props.children);
|
|
562
|
+
insert(_el$5, () => props.buttons);
|
|
566
563
|
createRenderEffect((_p$) => {
|
|
567
564
|
var _v$ = mergeClasses("z-header", props.class), _v$2 = props.style;
|
|
568
565
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
@@ -624,7 +621,7 @@ function H3(props) {
|
|
|
624
621
|
return _el$3;
|
|
625
622
|
})();
|
|
626
623
|
}
|
|
627
|
-
var _tmpl$$b = /* @__PURE__ */ template(`<svg>`), _tmpl$2$2 = /* @__PURE__ */ template(`<svg><path fill=currentColor></svg>`, false, true);
|
|
624
|
+
var _tmpl$$b = /* @__PURE__ */ template(`<svg>`), _tmpl$2$2 = /* @__PURE__ */ template(`<svg><path fill=currentColor></svg>`, false, true, false);
|
|
628
625
|
function Icon(props) {
|
|
629
626
|
const data = createMemo(() => {
|
|
630
627
|
const [width, height, , , paths] = props.definition.icon;
|
|
@@ -707,29 +704,29 @@ function Link(props) {
|
|
|
707
704
|
});
|
|
708
705
|
}
|
|
709
706
|
/*!
|
|
710
|
-
* Font Awesome Free
|
|
707
|
+
* Font Awesome Free 7.1.0 by @fontawesome - https://fontawesome.com
|
|
711
708
|
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
|
712
|
-
* Copyright
|
|
709
|
+
* Copyright 2025 Fonticons, Inc.
|
|
713
710
|
*/
|
|
714
|
-
|
|
711
|
+
var faCircleXmark = {
|
|
715
712
|
prefix: "fas",
|
|
716
|
-
iconName: "circle-
|
|
717
|
-
icon: [512, 512, [
|
|
713
|
+
iconName: "circle-xmark",
|
|
714
|
+
icon: [512, 512, [61532, "times-circle", "xmark-circle"], "f057", "M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM167 167c9.4-9.4 24.6-9.4 33.9 0l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9z"]
|
|
718
715
|
};
|
|
719
|
-
|
|
716
|
+
var faCircleCheck = {
|
|
720
717
|
prefix: "fas",
|
|
721
|
-
iconName: "circle-
|
|
722
|
-
icon: [512, 512, ["
|
|
718
|
+
iconName: "circle-check",
|
|
719
|
+
icon: [512, 512, [61533, "check-circle"], "f058", "M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zM374 145.7c-10.7-7.8-25.7-5.4-33.5 5.3L221.1 315.2 169 263.1c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c5 5 11.8 7.5 18.8 7s13.4-4.1 17.5-9.8L379.3 179.2c7.8-10.7 5.4-25.7-5.3-33.5z"]
|
|
723
720
|
};
|
|
724
|
-
|
|
721
|
+
var faTriangleExclamation = {
|
|
725
722
|
prefix: "fas",
|
|
726
723
|
iconName: "triangle-exclamation",
|
|
727
|
-
icon: [512, 512, [9888, "exclamation-triangle", "warning"], "f071", "M256
|
|
724
|
+
icon: [512, 512, [9888, "exclamation-triangle", "warning"], "f071", "M256 0c14.7 0 28.2 8.1 35.2 21l216 400c6.7 12.4 6.4 27.4-.8 39.5S486.1 480 472 480L40 480c-14.1 0-27.2-7.4-34.4-19.5s-7.5-27.1-.8-39.5l216-400c7-12.9 20.5-21 35.2-21zm0 352a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.5 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]
|
|
728
725
|
};
|
|
729
|
-
|
|
726
|
+
var faCircleInfo = {
|
|
730
727
|
prefix: "fas",
|
|
731
|
-
iconName: "circle-
|
|
732
|
-
icon: [512, 512, [
|
|
728
|
+
iconName: "circle-info",
|
|
729
|
+
icon: [512, 512, ["info-circle"], "f05a", "M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM224 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-8 64l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]
|
|
733
730
|
};
|
|
734
731
|
var _tmpl$$9 = /* @__PURE__ */ template(`<div><div class=z-message--icon></div><div class=z-message--text>`);
|
|
735
732
|
function Message(props) {
|
|
@@ -787,12 +784,12 @@ function Nav(props) {
|
|
|
787
784
|
})();
|
|
788
785
|
}
|
|
789
786
|
var _tmpl$$7 = /* @__PURE__ */ template(`<div>`);
|
|
790
|
-
function
|
|
787
|
+
function NavHeading(props) {
|
|
791
788
|
return (() => {
|
|
792
789
|
var _el$ = _tmpl$$7();
|
|
793
790
|
insert(_el$, () => props.children);
|
|
794
791
|
createRenderEffect((_p$) => {
|
|
795
|
-
var _v$ = mergeClasses("z-nav--
|
|
792
|
+
var _v$ = mergeClasses("z-nav--heading", props.class), _v$2 = props.style;
|
|
796
793
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
797
794
|
_p$.t = style(_el$, _v$2, _p$.t);
|
|
798
795
|
return _p$;
|
|
@@ -819,7 +816,7 @@ function NavLink(props) {
|
|
|
819
816
|
},
|
|
820
817
|
end: true,
|
|
821
818
|
get children() {
|
|
822
|
-
return [
|
|
819
|
+
return [memo(() => props.icon), (() => {
|
|
823
820
|
var _el$ = _tmpl$$6();
|
|
824
821
|
insert(_el$, () => props.text);
|
|
825
822
|
return _el$;
|
|
@@ -877,7 +874,7 @@ function RadioButtons(props) {
|
|
|
877
874
|
})()
|
|
878
875
|
}), null);
|
|
879
876
|
insert(_el$, (() => {
|
|
880
|
-
var _c$ =
|
|
877
|
+
var _c$ = memo(() => !!props.error);
|
|
881
878
|
return () => _c$() && (() => {
|
|
882
879
|
var _el$6 = _tmpl$3();
|
|
883
880
|
insert(_el$6, () => props.error);
|
|
@@ -886,7 +883,7 @@ function RadioButtons(props) {
|
|
|
886
883
|
})();
|
|
887
884
|
})(), null);
|
|
888
885
|
insert(_el$, (() => {
|
|
889
|
-
var _c$2 =
|
|
886
|
+
var _c$2 = memo(() => !!(!props.error && props.errorPlaceholder !== false));
|
|
890
887
|
return () => _c$2() && _tmpl$4();
|
|
891
888
|
})(), null);
|
|
892
889
|
createRenderEffect((_p$) => {
|
|
@@ -1031,13 +1028,11 @@ function createForm(options) {
|
|
|
1031
1028
|
}
|
|
1032
1029
|
setState({ type: "Submitting" });
|
|
1033
1030
|
options.submitter(fields()).then((value) => {
|
|
1034
|
-
var _a;
|
|
1035
1031
|
setState({ type: "Success", value });
|
|
1036
|
-
|
|
1032
|
+
options.onSuccess?.(value);
|
|
1037
1033
|
}).catch((error) => {
|
|
1038
|
-
var _a;
|
|
1039
1034
|
setState({ type: "Failure", error });
|
|
1040
|
-
|
|
1035
|
+
options.onFailure?.(error);
|
|
1041
1036
|
});
|
|
1042
1037
|
}
|
|
1043
1038
|
};
|
|
@@ -1072,7 +1067,7 @@ function createSize(element) {
|
|
|
1072
1067
|
observer.observe(_element);
|
|
1073
1068
|
});
|
|
1074
1069
|
onCleanup(() => {
|
|
1075
|
-
observer
|
|
1070
|
+
observer?.disconnect();
|
|
1076
1071
|
observer = void 0;
|
|
1077
1072
|
});
|
|
1078
1073
|
return size;
|
|
@@ -1095,7 +1090,7 @@ export {
|
|
|
1095
1090
|
Link,
|
|
1096
1091
|
Message,
|
|
1097
1092
|
Nav,
|
|
1098
|
-
|
|
1093
|
+
NavHeading,
|
|
1099
1094
|
NavLink,
|
|
1100
1095
|
Page,
|
|
1101
1096
|
RadioButtons,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lundal/zed-solid",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"license": "LGPL-3.0-or-later",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -15,26 +15,22 @@
|
|
|
15
15
|
"format": "prettier --write src"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@
|
|
19
|
-
"@fortawesome/free-
|
|
18
|
+
"@fontsource/inter": "5.2.8",
|
|
19
|
+
"@fortawesome/free-regular-svg-icons": "7.1.0",
|
|
20
|
+
"@fortawesome/free-solid-svg-icons": "7.1.0",
|
|
20
21
|
"@lundal/zed-css": "file:../css",
|
|
21
|
-
"@solidjs/router": "0.15",
|
|
22
|
-
"solid-js": "1",
|
|
23
|
-
"prettier": "3",
|
|
24
|
-
"typescript": "5",
|
|
25
|
-
"vite": "
|
|
26
|
-
"vite-plugin-dts": "4",
|
|
27
|
-
"vite-plugin-libcss": "1",
|
|
28
|
-
"vite-plugin-solid": "2"
|
|
22
|
+
"@solidjs/router": "0.15.3",
|
|
23
|
+
"solid-js": "1.9.9",
|
|
24
|
+
"prettier": "3.6.2",
|
|
25
|
+
"typescript": "5.9.3",
|
|
26
|
+
"vite": "7.1.10",
|
|
27
|
+
"vite-plugin-dts": "4.5.4",
|
|
28
|
+
"vite-plugin-libcss": "1.1.2",
|
|
29
|
+
"vite-plugin-solid": "2.11.9"
|
|
29
30
|
},
|
|
30
31
|
"peerDependencies": {
|
|
32
|
+
"@fontsource/inter": "*",
|
|
31
33
|
"@solidjs/router": "*",
|
|
32
34
|
"solid-js": "*"
|
|
33
|
-
},
|
|
34
|
-
"optionalDependencies": {
|
|
35
|
-
"@fortawesome/free-solid-svg-icons": "6"
|
|
36
|
-
},
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"@fontsource/inter": "5"
|
|
39
35
|
}
|
|
40
36
|
}
|