@muibook/components 1.0.12 → 1.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.
@@ -1,18 +1,25 @@
1
- import { getPartMap as i } from "../../utils/part-map/index.js";
2
- class r extends HTMLElement {
1
+ import { getPartMap as r } from "../../utils/part-map/index.js";
2
+ class o extends HTMLElement {
3
3
  static get observedAttributes() {
4
4
  return ["size", "weight", "variant"];
5
5
  }
6
6
  constructor() {
7
7
  super(), this.attachShadow({ mode: "open" });
8
- const e = this.getAttribute("size") || "medium", t = this.getAttribute("weight") || "regular", o = this.getAttribute("variant") || "default";
9
- this.setAttribute("size", e), this.setAttribute("variant", o), this.setAttribute("weight", t);
8
+ const t = this.getAttribute("size") || "medium", e = this.getAttribute("weight") || "regular", i = this.getAttribute("variant") || "default";
9
+ this.setAttribute("size", t), this.setAttribute("variant", i), this.setAttribute("weight", e);
10
10
  }
11
11
  async connectedCallback() {
12
- await this.waitForPartMap();
13
- let t = (
14
- /*html*/
15
- `
12
+ await this.waitForPartMap(), this.render();
13
+ }
14
+ attributeChangedCallback(t, e, i) {
15
+ e !== i && this.shadowRoot && this.render();
16
+ }
17
+ render() {
18
+ const t = this.shadowRoot;
19
+ if (!t || t.children.length > 0) return;
20
+ const e = r("spacing", "layout", "visual");
21
+ t.innerHTML = /*html*/
22
+ `
16
23
  <style>
17
24
  :host { display: block; }
18
25
 
@@ -63,20 +70,17 @@ class r extends HTMLElement {
63
70
 
64
71
  </style>
65
72
 
66
- <p part="${i("spacing", "layout", "visual")}"><slot></slot></p>
67
-
68
- `
69
- );
70
- this.shadowRoot && (this.shadowRoot.innerHTML = t);
73
+ <p part="${e}"><slot></slot></p>
74
+ `;
71
75
  }
72
76
  waitForPartMap() {
73
- return new Promise((e) => {
74
- if (typeof i == "function") return e();
75
- const t = () => {
76
- typeof i == "function" ? e() : requestAnimationFrame(t);
77
+ return new Promise((t) => {
78
+ if (typeof r == "function") return t();
79
+ const e = () => {
80
+ typeof r == "function" ? t() : requestAnimationFrame(e);
77
81
  };
78
- t();
82
+ e();
79
83
  });
80
84
  }
81
85
  }
82
- customElements.define("mui-body", r);
86
+ customElements.define("mui-body", o);
@@ -14,12 +14,13 @@ class s extends HTMLElement {
14
14
  justify-content: space-between;
15
15
  align-self: ${this.getAttribute("align-y") || "initial"};
16
16
  text-align: left;
17
+
17
18
  }
18
19
  :host(*:first-of-type) {
19
- padding-left: var(--space-600);
20
+ padding-left: var(--space-400);
20
21
  }
21
22
  :host(*:last-of-type) {
22
- padding-right: var(--space-600);
23
+ padding-right: var(--space-400);
23
24
  }
24
25
 
25
26
  /* Card Slot (Supports: Table Cell, Accordion Block) */
@@ -30,6 +31,12 @@ class s extends HTMLElement {
30
31
  padding-right: var(--space-500);
31
32
  }
32
33
  @media (min-width: 768px) {
34
+ :host(*:first-of-type) {
35
+ padding-left: var(--space-600);
36
+ }
37
+ :host(*:last-of-type) {
38
+ padding-right: var(--space-600);
39
+ }
33
40
  :host(.card-slot:first-of-type) {
34
41
  padding-left: var(--space-600);
35
42
  }
@@ -40,17 +47,11 @@ class s extends HTMLElement {
40
47
 
41
48
  :host([checkbox]) {
42
49
  width: auto;
43
- padding: 0;
44
50
  text-align: center;
45
51
  }
46
52
  :host([action]) {
47
53
  width: 4.4rem;
48
54
  height: 4.4rem;
49
- padding: 0;
50
- padding-right: var(--space-300);
51
- }
52
- :host([heading]) {
53
- font-weight: bold;
54
55
  }
55
56
  `
56
57
  );
@@ -17,6 +17,7 @@ class t extends HTMLElement {
17
17
  padding: var(--space-300) var(--space-000);
18
18
  border-top: var(--border-thin);
19
19
  align-items: center;
20
+ min-height: 4.4rem;
20
21
  }
21
22
  </style>
22
23
  <slot></slot>
@@ -11,8 +11,8 @@ class o extends HTMLElement {
11
11
  }
12
12
  :host([heading]) {
13
13
  display: block;
14
+ font-weight: var(--font-weight-bold);
14
15
  }
15
-
16
16
  :host([heading]) ::slotted(mui-row) {
17
17
  border: none;
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muibook/components",
3
- "version": "1.0.12",
3
+ "version": "1.1.1",
4
4
  "description": "A library of MUI-based design system components.",
5
5
  "author": "Michael Trilford",
6
6
  "homepage": "https://muibook.com",