@lundal/zed-solid 0.0.3 → 0.0.4

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.
@@ -1,9 +1,9 @@
1
1
  import { JSX } from "solid-js";
2
- export type AppProps = {
2
+ export type PageProps = {
3
3
  class?: string;
4
4
  style?: JSX.CSSProperties;
5
5
  layout: "3";
6
6
  theme: "light" | "dark";
7
7
  children: JSX.Element;
8
8
  };
9
- export declare function App(props: AppProps): JSX.Element;
9
+ export declare function Page(props: PageProps): JSX.Element;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- export * from "./App.tsx";
2
1
  export * from "./Button.tsx";
3
2
  export * from "./Card.tsx";
4
3
  export * from "./CheckBox.tsx";
@@ -15,6 +14,7 @@ export * from "./Link.tsx";
15
14
  export * from "./Nav.tsx";
16
15
  export * from "./NavHeader.tsx";
17
16
  export * from "./NavLink.tsx";
17
+ export * from "./Page.tsx";
18
18
  export * from "./RadioButtons.tsx";
19
19
  export * from "./Row.tsx";
20
20
  export * from "./Select.tsx";
package/dist/index.js CHANGED
@@ -312,27 +312,10 @@ function mergeClasses(a, b) {
312
312
  return b;
313
313
  return void 0;
314
314
  }
315
- const _tmpl$$k = /* @__PURE__ */ template(`<div>`);
316
- function App(props) {
317
- return (() => {
318
- const _el$ = _tmpl$$k();
319
- insert(_el$, () => props.children);
320
- createRenderEffect((_p$) => {
321
- const _v$ = mergeClasses(`z-app z-app--layout-${props.layout} z-theme--${props.theme}`, props.class), _v$2 = props.style;
322
- _v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
323
- _p$._v$2 = style(_el$, _v$2, _p$._v$2);
324
- return _p$;
325
- }, {
326
- _v$: void 0,
327
- _v$2: void 0
328
- });
329
- return _el$;
330
- })();
331
- }
332
- const _tmpl$$j = /* @__PURE__ */ template(`<button>`);
315
+ const _tmpl$$k = /* @__PURE__ */ template(`<button>`);
333
316
  function Button(props) {
334
317
  return (() => {
335
- const _el$ = _tmpl$$j();
318
+ const _el$ = _tmpl$$k();
336
319
  _el$.$$click = () => !props.busy && props.onClick();
337
320
  insert(_el$, () => props.label);
338
321
  createRenderEffect((_p$) => {
@@ -350,10 +333,10 @@ function Button(props) {
350
333
  })();
351
334
  }
352
335
  delegateEvents(["click"]);
353
- const _tmpl$$i = /* @__PURE__ */ template(`<div>`);
336
+ const _tmpl$$j = /* @__PURE__ */ template(`<div>`);
354
337
  function Card(props) {
355
338
  return (() => {
356
- const _el$ = _tmpl$$i();
339
+ const _el$ = _tmpl$$j();
357
340
  insert(_el$, () => props.children);
358
341
  createRenderEffect((_p$) => {
359
342
  const _v$ = mergeClasses("z-card", props.class), _v$2 = props.style;
@@ -367,10 +350,10 @@ function Card(props) {
367
350
  return _el$;
368
351
  })();
369
352
  }
370
- const _tmpl$$h = /* @__PURE__ */ template(`<div><input type="checkbox"><label>`);
353
+ const _tmpl$$i = /* @__PURE__ */ template(`<div><input type="checkbox"><label>`);
371
354
  function CheckBox(props) {
372
355
  return (() => {
373
- const _el$ = _tmpl$$h(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
356
+ const _el$ = _tmpl$$i(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
374
357
  _el$2.addEventListener("change", () => props.onChange(!props.value));
375
358
  insert(_el$3, () => props.label);
376
359
  createRenderEffect((_p$) => {
@@ -394,10 +377,10 @@ function CheckBox(props) {
394
377
  return _el$;
395
378
  })();
396
379
  }
397
- const _tmpl$$g = /* @__PURE__ */ template(`<fieldset><legend>`), _tmpl$2$5 = /* @__PURE__ */ template(`<div class="z-checkbox"><input type="checkbox"><label>`), _tmpl$3$3 = /* @__PURE__ */ template(`<div class="z-error">`), _tmpl$4$2 = /* @__PURE__ */ template(`<div class="z-error-placeholder">`);
380
+ const _tmpl$$h = /* @__PURE__ */ template(`<fieldset><legend>`), _tmpl$2$5 = /* @__PURE__ */ template(`<div class="z-checkbox"><input type="checkbox"><label>`), _tmpl$3$3 = /* @__PURE__ */ template(`<div class="z-error">`), _tmpl$4$2 = /* @__PURE__ */ template(`<div class="z-error-placeholder">`);
398
381
  function CheckBoxes(props) {
399
382
  return (() => {
400
- const _el$ = _tmpl$$g(), _el$2 = _el$.firstChild;
383
+ const _el$ = _tmpl$$h(), _el$2 = _el$.firstChild;
401
384
  insert(_el$2, () => props.label);
402
385
  insert(_el$, createComponent(For, {
403
386
  get each() {
@@ -449,10 +432,10 @@ function CheckBoxes(props) {
449
432
  return _el$;
450
433
  })();
451
434
  }
452
- const _tmpl$$f = /* @__PURE__ */ template(`<div>`);
435
+ const _tmpl$$g = /* @__PURE__ */ template(`<div>`);
453
436
  function Column(props) {
454
437
  return (() => {
455
- const _el$ = _tmpl$$f();
438
+ const _el$ = _tmpl$$g();
456
439
  insert(_el$, () => props.children);
457
440
  createRenderEffect((_p$) => {
458
441
  const _v$ = mergeClasses("z-column", props.class), _v$2 = props.style;
@@ -466,7 +449,7 @@ function Column(props) {
466
449
  return _el$;
467
450
  })();
468
451
  }
469
- const _tmpl$$e = /* @__PURE__ */ template(`<dialog>`);
452
+ const _tmpl$$f = /* @__PURE__ */ template(`<dialog>`);
470
453
  function Dialog(props) {
471
454
  const [wasOutside, setWasOutside] = createSignal(false);
472
455
  function isOutside(e) {
@@ -486,7 +469,7 @@ function Dialog(props) {
486
469
  }, 100);
487
470
  }
488
471
  return (() => {
489
- const _el$ = _tmpl$$e();
472
+ const _el$ = _tmpl$$f();
490
473
  _el$.$$click = (e) => {
491
474
  if (wasOutside() && isOutside(e)) {
492
475
  e.preventDefault();
@@ -516,10 +499,10 @@ function Dialog(props) {
516
499
  })();
517
500
  }
518
501
  delegateEvents(["mousedown", "click"]);
519
- const _tmpl$$d = /* @__PURE__ */ template(`<div>`), _tmpl$2$4 = /* @__PURE__ */ template(`<label>`), _tmpl$3$2 = /* @__PURE__ */ template(`<div class="z-error">`), _tmpl$4$1 = /* @__PURE__ */ template(`<div class="z-error-placeholder">`);
502
+ const _tmpl$$e = /* @__PURE__ */ template(`<div>`), _tmpl$2$4 = /* @__PURE__ */ template(`<label>`), _tmpl$3$2 = /* @__PURE__ */ template(`<div class="z-error">`), _tmpl$4$1 = /* @__PURE__ */ template(`<div class="z-error-placeholder">`);
520
503
  function Field(props) {
521
504
  return (() => {
522
- const _el$ = _tmpl$$d();
505
+ const _el$ = _tmpl$$e();
523
506
  insert(_el$, (() => {
524
507
  const _c$ = createMemo(() => !!props.label);
525
508
  return () => _c$() && (() => {
@@ -559,10 +542,10 @@ function Field(props) {
559
542
  return _el$;
560
543
  })();
561
544
  }
562
- const _tmpl$$c = /* @__PURE__ */ template(`<div>`);
545
+ const _tmpl$$d = /* @__PURE__ */ template(`<div>`);
563
546
  function Form(props) {
564
547
  return (() => {
565
- const _el$ = _tmpl$$c();
548
+ const _el$ = _tmpl$$d();
566
549
  _el$.addEventListener("submit", (event) => {
567
550
  event.preventDefault();
568
551
  props.onSubmit();
@@ -580,10 +563,10 @@ function Form(props) {
580
563
  return _el$;
581
564
  })();
582
565
  }
583
- const _tmpl$$b = /* @__PURE__ */ template(`<header><a class="z-header--app" href="/"><span></span></a><div class="z-header--buttons">`);
566
+ const _tmpl$$c = /* @__PURE__ */ template(`<header><a class="z-header--app" href="/"><span></span></a><div class="z-header--buttons">`);
584
567
  function Header(props) {
585
568
  return (() => {
586
- const _el$ = _tmpl$$b(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
569
+ const _el$ = _tmpl$$c(), _el$2 = _el$.firstChild, _el$3 = _el$2.firstChild, _el$4 = _el$2.nextSibling;
587
570
  insert(_el$2, () => props.appIcon, _el$3);
588
571
  insert(_el$3, () => props.appName);
589
572
  insert(_el$4, () => props.children);
@@ -599,10 +582,10 @@ function Header(props) {
599
582
  return _el$;
600
583
  })();
601
584
  }
602
- const _tmpl$$a = /* @__PURE__ */ template(`<h1>`), _tmpl$2$3 = /* @__PURE__ */ template(`<h2>`), _tmpl$3$1 = /* @__PURE__ */ template(`<h3>`);
585
+ const _tmpl$$b = /* @__PURE__ */ template(`<h1>`), _tmpl$2$3 = /* @__PURE__ */ template(`<h2>`), _tmpl$3$1 = /* @__PURE__ */ template(`<h3>`);
603
586
  function H1(props) {
604
587
  return (() => {
605
- const _el$ = _tmpl$$a();
588
+ const _el$ = _tmpl$$b();
606
589
  insert(_el$, () => props.children);
607
590
  createRenderEffect((_p$) => {
608
591
  const _v$ = mergeClasses("z-" + (props.lookLike ?? "h1"), props.class), _v$2 = props.style;
@@ -648,7 +631,7 @@ function H3(props) {
648
631
  return _el$3;
649
632
  })();
650
633
  }
651
- const _tmpl$$9 = /* @__PURE__ */ template(`<svg>`), _tmpl$2$2 = /* @__PURE__ */ template(`<svg><path fill="currentColor"></svg>`, false, true);
634
+ const _tmpl$$a = /* @__PURE__ */ template(`<svg>`), _tmpl$2$2 = /* @__PURE__ */ template(`<svg><path fill="currentColor"></svg>`, false, true);
652
635
  function Icon(props) {
653
636
  const data = createMemo(() => {
654
637
  const [width, height, , , paths] = props.definition.icon;
@@ -659,7 +642,7 @@ function Icon(props) {
659
642
  };
660
643
  });
661
644
  return (() => {
662
- const _el$ = _tmpl$$9();
645
+ const _el$ = _tmpl$$a();
663
646
  insert(_el$, createComponent(For, {
664
647
  get each() {
665
648
  return data().paths;
@@ -684,10 +667,10 @@ function Icon(props) {
684
667
  return _el$;
685
668
  })();
686
669
  }
687
- const _tmpl$$8 = /* @__PURE__ */ template(`<button>`);
670
+ const _tmpl$$9 = /* @__PURE__ */ template(`<button>`);
688
671
  function IconButton(props) {
689
672
  return (() => {
690
- const _el$ = _tmpl$$8();
673
+ const _el$ = _tmpl$$9();
691
674
  _el$.$$click = () => !props.busy && props.onClick();
692
675
  insert(_el$, () => props.icon);
693
676
  createRenderEffect((_p$) => {
@@ -728,10 +711,10 @@ function Link(props) {
728
711
  }
729
712
  });
730
713
  }
731
- const _tmpl$$7 = /* @__PURE__ */ template(`<nav>`);
714
+ const _tmpl$$8 = /* @__PURE__ */ template(`<nav>`);
732
715
  function Nav(props) {
733
716
  return (() => {
734
- const _el$ = _tmpl$$7();
717
+ const _el$ = _tmpl$$8();
735
718
  insert(_el$, () => props.children);
736
719
  createRenderEffect((_p$) => {
737
720
  const _v$ = mergeClasses("z-nav", props.class), _v$2 = props.style;
@@ -745,10 +728,10 @@ function Nav(props) {
745
728
  return _el$;
746
729
  })();
747
730
  }
748
- const _tmpl$$6 = /* @__PURE__ */ template(`<div>`);
731
+ const _tmpl$$7 = /* @__PURE__ */ template(`<div>`);
749
732
  function NavHeader(props) {
750
733
  return (() => {
751
- const _el$ = _tmpl$$6();
734
+ const _el$ = _tmpl$$7();
752
735
  insert(_el$, () => props.children);
753
736
  createRenderEffect((_p$) => {
754
737
  const _v$ = mergeClasses("z-nav--header", props.class), _v$2 = props.style;
@@ -762,7 +745,7 @@ function NavHeader(props) {
762
745
  return _el$;
763
746
  })();
764
747
  }
765
- const _tmpl$$5 = /* @__PURE__ */ template(`<span>`);
748
+ const _tmpl$$6 = /* @__PURE__ */ template(`<span>`);
766
749
  function NavLink(props) {
767
750
  return createComponent(A, {
768
751
  get ["class"]() {
@@ -779,13 +762,30 @@ function NavLink(props) {
779
762
  end: true,
780
763
  get children() {
781
764
  return [createMemo(() => props.icon), (() => {
782
- const _el$ = _tmpl$$5();
765
+ const _el$ = _tmpl$$6();
783
766
  insert(_el$, () => props.text);
784
767
  return _el$;
785
768
  })()];
786
769
  }
787
770
  });
788
771
  }
772
+ const _tmpl$$5 = /* @__PURE__ */ template(`<div>`);
773
+ function Page(props) {
774
+ return (() => {
775
+ const _el$ = _tmpl$$5();
776
+ insert(_el$, () => props.children);
777
+ createRenderEffect((_p$) => {
778
+ const _v$ = mergeClasses(`z-page z-page--layout-${props.layout} z-theme--${props.theme}`, props.class), _v$2 = props.style;
779
+ _v$ !== _p$._v$ && className(_el$, _p$._v$ = _v$);
780
+ _p$._v$2 = style(_el$, _v$2, _p$._v$2);
781
+ return _p$;
782
+ }, {
783
+ _v$: void 0,
784
+ _v$2: void 0
785
+ });
786
+ return _el$;
787
+ })();
788
+ }
789
789
  const _tmpl$$4 = /* @__PURE__ */ template(`<fieldset><legend>`), _tmpl$2$1 = /* @__PURE__ */ template(`<div class="z-radiobutton"><input type="radio"><label>`), _tmpl$3 = /* @__PURE__ */ template(`<div class="z-error">`), _tmpl$4 = /* @__PURE__ */ template(`<div class="z-error-placeholder">`);
790
790
  function RadioButtons(props) {
791
791
  return (() => {
@@ -942,7 +942,6 @@ function TextBox(props) {
942
942
  }
943
943
  delegateEvents(["input"]);
944
944
  export {
945
- App,
946
945
  Button,
947
946
  Card,
948
947
  CheckBox,
@@ -961,6 +960,7 @@ export {
961
960
  Nav,
962
961
  NavHeader,
963
962
  NavLink,
963
+ Page,
964
964
  RadioButtons,
965
965
  Row,
966
966
  Select,
package/dist/style.css CHANGED
@@ -19,42 +19,6 @@
19
19
  *::-moz-focus-inner {
20
20
  border: none;
21
21
  }
22
- .z-app {
23
- width: 100vw;
24
- height: 100vh;
25
-
26
- background: var(--z-background);
27
- color: var(--z-text-body);
28
-
29
- font-family: "Inter", sans-serif;
30
- font-size: 16px;
31
- font-weight: 400;
32
- }
33
-
34
- .z-app > * {
35
- overflow: auto;
36
- }
37
-
38
- .z-app--layout-3 {
39
- display: grid;
40
- grid-template-rows: auto 1fr;
41
- grid-template-columns: auto 1fr;
42
- grid-template-areas: "header header" "nav main";
43
- }
44
-
45
- .z-app--layout-3 > header {
46
- grid-area: header;
47
- border-bottom: 1px solid var(--z-border);
48
- }
49
-
50
- .z-app--layout-3 > nav {
51
- grid-area: nav;
52
- border-right: 1px solid var(--z-border);
53
- }
54
-
55
- .z-app--layout-3 > main {
56
- grid-area: main;
57
- }
58
22
  .z-button {
59
23
  height: 36px;
60
24
  padding: 6px 24px;
@@ -381,6 +345,47 @@ dialog:focus-visible {
381
345
  .z-nav--link:focus-visible {
382
346
  outline-color: var(--z-focus);
383
347
  }
348
+ .z-page {
349
+ width: 100vw;
350
+ height: 100vh;
351
+
352
+ background: var(--z-background);
353
+ color: var(--z-text-body);
354
+
355
+ font-family: "Inter", sans-serif;
356
+ font-size: 16px;
357
+ font-weight: 400;
358
+ }
359
+
360
+ .z-page > * {
361
+ overflow: auto;
362
+ }
363
+
364
+ .z-page--layout-3 {
365
+ display: grid;
366
+ grid-template-rows: auto 1fr;
367
+ grid-template-columns: auto 1fr auto;
368
+ grid-template-areas: "header header header" "nav main aside";
369
+ }
370
+
371
+ .z-page--layout-3 > header {
372
+ grid-area: header;
373
+ border-bottom: 1px solid var(--z-border);
374
+ }
375
+
376
+ .z-page--layout-3 > nav {
377
+ grid-area: nav;
378
+ border-right: 1px solid var(--z-border);
379
+ }
380
+
381
+ .z-page--layout-3 > main {
382
+ grid-area: main;
383
+ }
384
+
385
+ .z-page--layout-3 > aside {
386
+ grid-area: aside;
387
+ border-left: 1px solid var(--z-border);
388
+ }
384
389
  .z-radiobutton {
385
390
  display: flex;
386
391
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lundal/zed-solid",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "license": "LGPL-3.0-or-later",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",