@lazhus/kg-ui 0.5.0 → 0.5.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.
@@ -856,7 +856,7 @@
856
856
  "kind": "field",
857
857
  "name": "styles",
858
858
  "static": true,
859
- "default": "css` :host { display: block; box-sizing: border-box; flex: 0 0 auto; /* Gutter padding */ padding-left: calc(var(--kg-gap, 0px) * 0.5); padding-right: calc(var(--kg-gap, 0px) * 0.5); } `"
859
+ "default": "css` :host { display: block; box-sizing: border-box; flex: 0 0 auto; } `"
860
860
  },
861
861
  {
862
862
  "kind": "method",
@@ -1947,7 +1947,7 @@
1947
1947
  "kind": "field",
1948
1948
  "name": "styles",
1949
1949
  "static": true,
1950
- "default": "css` :host { display: flex; flex-direction: column; width: 100%; box-sizing: border-box; /* Default gap */ --kg-gap: var(--kg-space-md, 1rem); } `"
1950
+ "default": "css` :host { display: flex; flex-direction: column; width: 100%; box-sizing: border-box; gap: var(--kg-space-md, 1rem); } `"
1951
1951
  },
1952
1952
  {
1953
1953
  "kind": "method",
@@ -3023,13 +3023,13 @@
3023
3023
  "text": "object"
3024
3024
  },
3025
3025
  "static": true,
3026
- "default": "{ justify: { type: String, reflect: true }, align: { type: String, reflect: true }, color: { type: String, reflect: true } }"
3026
+ "default": "{ justify: { type: String, reflect: true }, align: { type: String, reflect: true }, color: { type: String, reflect: true }, gap: { type: String, reflect: true }, }"
3027
3027
  },
3028
3028
  {
3029
3029
  "kind": "field",
3030
3030
  "name": "styles",
3031
3031
  "static": true,
3032
- "default": "css` :host { display: flex; flex-wrap: wrap; box-sizing: border-box; width: calc(100% + var(--kg-gap, 0px)); margin-left: calc(var(--kg-gap, 0px) * -0.5); margin-right: calc(var(--kg-gap, 0px) * -0.5); row-gap: var(--kg-gap, 0px); } /* Justify (Horizontal) */ :host([justify=\"start\"]) { justify-content: flex-start; } :host([justify=\"center\"]) { justify-content: center; } :host([justify=\"end\"]) { justify-content: flex-end; } :host([justify=\"space-between\"]) { justify-content: space-between; } :host([justify=\"space-around\"]) { justify-content: space-around; } :host([justify=\"space-evenly\"]) { justify-content: space-evenly; } /* Align (Vertical) */ :host([align=\"start\"]) { align-items: flex-start; } :host([align=\"center\"]) { align-items: center; } :host([align=\"end\"]) { align-items: flex-end; } :host([align=\"stretch\"]) { align-items: stretch; } :host([align=\"baseline\"]) { align-items: baseline; } `"
3032
+ "default": "css` :host { display: flex; flex-wrap: wrap; box-sizing: border-box; width: 100%; --kg-gap: var(--kg-space-md, 1rem); /* Default gap variable */ gap: var(--kg-gap); } /* Justify (Horizontal) */ :host([justify=\"start\"]) { justify-content: flex-start; } :host([justify=\"center\"]) { justify-content: center; } :host([justify=\"end\"]) { justify-content: flex-end; } :host([justify=\"space-between\"]) { justify-content: space-between; } :host([justify=\"space-around\"]) { justify-content: space-around; } :host([justify=\"space-evenly\"]) { justify-content: space-evenly; } /* Align (Vertical) */ :host([align=\"start\"]) { align-items: flex-start; } :host([align=\"center\"]) { align-items: center; } :host([align=\"end\"]) { align-items: flex-end; } :host([align=\"stretch\"]) { align-items: stretch; } :host([align=\"baseline\"]) { align-items: baseline; } `"
3033
3033
  },
3034
3034
  {
3035
3035
  "kind": "method",
@@ -1,29 +1,25 @@
1
- var e=Object.defineProperty,t=(t,o,r)=>((t,o,r)=>o in t?e(t,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[o]=r)(t,"symbol"!=typeof o?o+"":o,r);import{LitElement as o,css as r,html as l}from"lit";class i extends o{render(){const e=[];this.color&&e.push(`background-color: ${this.color};`);const t=this.sm||12,o=this.md||t,r=this.lg||o;return l`
1
+ var e=Object.defineProperty,t=(t,o,l)=>((t,o,l)=>o in t?e(t,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[o]=l)(t,"symbol"!=typeof o?o+"":o,l);import{LitElement as o,css as l,html as r}from"lit";class s extends o{render(){const e=[];this.color&&e.push(`background-color: ${this.color};`);const t=this.sm||12,o=this.md||t,l=this.lg||o;return r`
2
2
  <style>
3
3
  :host { ${e.join(" ")} }
4
4
 
5
5
  /* Mobile / Default (< 768px) */
6
- :host { width: ${t/12*100}%; }
6
+ :host { width: calc(${t/12*100}% - ((1 - ${t/12}) * var(--kg-gap, 0px))); }
7
7
 
8
8
  /* Tablet (768px - 1024px) */
9
9
  @media (min-width: 768px) {
10
- :host { width: ${o/12*100}%; }
10
+ :host { width: calc(${o/12*100}% - ((1 - ${o/12}) * var(--kg-gap, 0px))); }
11
11
  }
12
12
 
13
13
  /* Desktop (> 1024px) */
14
14
  @media (min-width: 1024px) {
15
- :host { width: ${r/12*100}%; }
15
+ :host { width: calc(${l/12*100}% - ((1 - ${l/12}) * var(--kg-gap, 0px))); }
16
16
  }
17
17
  </style>
18
18
  <slot></slot>
19
- `}}t(i,"properties",{lg:{type:Number,reflect:!0},md:{type:Number,reflect:!0},sm:{type:Number,reflect:!0},color:{type:String,reflect:!0}}),t(i,"styles",r`
19
+ `}}t(s,"properties",{lg:{type:Number,reflect:!0},md:{type:Number,reflect:!0},sm:{type:Number,reflect:!0},color:{type:String,reflect:!0}}),t(s,"styles",l`
20
20
  :host {
21
21
  display: block;
22
22
  box-sizing: border-box;
23
23
  flex: 0 0 auto;
24
-
25
- /* Gutter padding */
26
- padding-left: calc(var(--kg-gap, 0px) * 0.5);
27
- padding-right: calc(var(--kg-gap, 0px) * 0.5);
28
24
  }
29
- `),customElements.define("kg-column",i);export{i as kgcolumn};
25
+ `),customElements.define("kg-column",s);export{s as kgcolumn};
@@ -1,4 +1,4 @@
1
- var e=Object.defineProperty,t=(t,r,o)=>((t,r,o)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o)(t,"symbol"!=typeof r?r+"":r,o);import{LitElement as r,css as o,html as s}from"lit";class l extends r{render(){const e=[];return this.gap&&(e.push(`--kg-gap: ${this.gap};`),e.push(`gap: ${this.gap};`)),this.color&&e.push(`background-color: ${this.color};`),s`
1
+ var e=Object.defineProperty,t=(t,r,o)=>((t,r,o)=>r in t?e(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o)(t,"symbol"!=typeof r?r+"":r,o);import{LitElement as r,css as o,html as s}from"lit";class l extends r{render(){const e=[];return this.gap&&e.push(`gap: ${this.gap};`),this.color&&e.push(`background-color: ${this.color};`),s`
2
2
  <style>
3
3
  :host { ${e.join(" ")} }
4
4
  </style>
@@ -9,7 +9,6 @@ var e=Object.defineProperty,t=(t,r,o)=>((t,r,o)=>r in t?e(t,r,{enumerable:!0,con
9
9
  flex-direction: column;
10
10
  width: 100%;
11
11
  box-sizing: border-box;
12
- /* Default gap */
13
- --kg-gap: var(--kg-space-md, 1rem);
12
+ gap: var(--kg-space-md, 1rem);
14
13
  }
15
14
  `),customElements.define("kg-grid",l);export{l as kggrid};
@@ -1,17 +1,16 @@
1
- var t=Object.defineProperty,e=(e,s,n)=>((e,s,n)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[s]=n)(e,"symbol"!=typeof s?s+"":s,n);import{LitElement as s,css as n,html as i}from"lit";class r extends s{render(){const t=[];return this.color&&t.push(`background-color: ${this.color};`),i`
1
+ var t=Object.defineProperty,e=(e,s,i)=>((e,s,i)=>s in e?t(e,s,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[s]=i)(e,"symbol"!=typeof s?s+"":s,i);import{LitElement as s,css as i,html as n}from"lit";class a extends s{render(){const t=[];return this.color&&t.push(`background-color: ${this.color};`),this.gap&&(t.push(`gap: ${this.gap};`),t.push(`--kg-gap: ${this.gap};`)),n`
2
2
  <style>
3
3
  :host { ${t.join(" ")} }
4
4
  </style>
5
5
  <slot></slot>
6
- `}}e(r,"properties",{justify:{type:String,reflect:!0},align:{type:String,reflect:!0},color:{type:String,reflect:!0}}),e(r,"styles",n`
6
+ `}}e(a,"properties",{justify:{type:String,reflect:!0},align:{type:String,reflect:!0},color:{type:String,reflect:!0},gap:{type:String,reflect:!0}}),e(a,"styles",i`
7
7
  :host {
8
8
  display: flex;
9
9
  flex-wrap: wrap;
10
10
  box-sizing: border-box;
11
- width: calc(100% + var(--kg-gap, 0px));
12
- margin-left: calc(var(--kg-gap, 0px) * -0.5);
13
- margin-right: calc(var(--kg-gap, 0px) * -0.5);
14
- row-gap: var(--kg-gap, 0px);
11
+ width: 100%;
12
+ --kg-gap: var(--kg-space-md, 1rem); /* Default gap variable */
13
+ gap: var(--kg-gap);
15
14
  }
16
15
 
17
16
  /* Justify (Horizontal) */
@@ -28,4 +27,4 @@ var t=Object.defineProperty,e=(e,s,n)=>((e,s,n)=>s in e?t(e,s,{enumerable:!0,con
28
27
  :host([align="end"]) { align-items: flex-end; }
29
28
  :host([align="stretch"]) { align-items: stretch; }
30
29
  :host([align="baseline"]) { align-items: baseline; }
31
- `),customElements.define("kg-row",r);export{r as kgrow};
30
+ `),customElements.define("kg-row",a);export{a as kgrow};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lazhus/kg-ui",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",