@lazhus/kg-ui 0.4.15 → 0.4.16
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/README.md +1 -1
- package/custom-elements.json +95 -3
- package/dist/components/kg-grid.js +4 -4
- package/dist/components/kg-row.js +13 -3
- package/package.json +1 -1
- package/types/components/kg-grid.d.ts +18 -1
- package/types/components/kg-row.d.ts +15 -1
- package/types/index.d.ts +11 -2
package/README.md
CHANGED
|
@@ -127,7 +127,7 @@ document.documentElement.setAttribute('data-theme', 'dark');
|
|
|
127
127
|
- `kg-file-upload`
|
|
128
128
|
|
|
129
129
|
### Layout & Structure
|
|
130
|
-
- `kg-grid` / `kg-row` / `kg-column` - Grid system
|
|
130
|
+
- `kg-grid` / `kg-row` / `kg-column` - Grid system (w/ Gap & Align)
|
|
131
131
|
- `kg-accordion` - Collapsible sections
|
|
132
132
|
- `kg-modal` - Modal dialog
|
|
133
133
|
- `kg-drawer` - Side panel
|
package/custom-elements.json
CHANGED
|
@@ -1909,7 +1909,7 @@
|
|
|
1909
1909
|
"text": "object"
|
|
1910
1910
|
},
|
|
1911
1911
|
"static": true,
|
|
1912
|
-
"default": "{ container: { type: Boolean, reflect: true }, padded: { type: Boolean, reflect: true }, relaxed: { type: Boolean, reflect: true }, doubling: { type: Boolean, reflect: true }, stackable: { type: Boolean, reflect: true } }"
|
|
1912
|
+
"default": "{ container: { type: Boolean, reflect: true }, padded: { type: Boolean, reflect: true }, relaxed: { type: Boolean, reflect: true }, doubling: { type: Boolean, reflect: true }, stackable: { type: Boolean, reflect: true }, gap: { type: String, reflect: true } }"
|
|
1913
1913
|
},
|
|
1914
1914
|
{
|
|
1915
1915
|
"kind": "field",
|
|
@@ -1917,9 +1917,61 @@
|
|
|
1917
1917
|
"static": true,
|
|
1918
1918
|
"default": "css` :host { display: block; width: 100%; box-sizing: border-box; } :host([container]) { max-width: 1200px; margin: 0 auto; padding-left: var(--kg-space-md); padding-right: var(--kg-space-md); } .ui-grid { display: flex; flex-direction: column; width: 100%; } :host([padded]) { padding: var(--kg-space-md) 0; } `"
|
|
1919
1919
|
},
|
|
1920
|
+
{
|
|
1921
|
+
"kind": "method",
|
|
1922
|
+
"name": "getGapValue"
|
|
1923
|
+
},
|
|
1920
1924
|
{
|
|
1921
1925
|
"kind": "method",
|
|
1922
1926
|
"name": "render"
|
|
1927
|
+
},
|
|
1928
|
+
{
|
|
1929
|
+
"type": {
|
|
1930
|
+
"text": "Boolean"
|
|
1931
|
+
},
|
|
1932
|
+
"description": "Container mode",
|
|
1933
|
+
"name": "container",
|
|
1934
|
+
"kind": "field"
|
|
1935
|
+
},
|
|
1936
|
+
{
|
|
1937
|
+
"type": {
|
|
1938
|
+
"text": "Boolean"
|
|
1939
|
+
},
|
|
1940
|
+
"description": "Adds padding",
|
|
1941
|
+
"name": "padded",
|
|
1942
|
+
"kind": "field"
|
|
1943
|
+
},
|
|
1944
|
+
{
|
|
1945
|
+
"type": {
|
|
1946
|
+
"text": "Boolean"
|
|
1947
|
+
},
|
|
1948
|
+
"description": "Relaxed spacing",
|
|
1949
|
+
"name": "relaxed",
|
|
1950
|
+
"kind": "field"
|
|
1951
|
+
},
|
|
1952
|
+
{
|
|
1953
|
+
"type": {
|
|
1954
|
+
"text": "Boolean"
|
|
1955
|
+
},
|
|
1956
|
+
"description": "Doubling behavior",
|
|
1957
|
+
"name": "doubling",
|
|
1958
|
+
"kind": "field"
|
|
1959
|
+
},
|
|
1960
|
+
{
|
|
1961
|
+
"type": {
|
|
1962
|
+
"text": "Boolean"
|
|
1963
|
+
},
|
|
1964
|
+
"description": "Stackable behavior",
|
|
1965
|
+
"name": "stackable",
|
|
1966
|
+
"kind": "field"
|
|
1967
|
+
},
|
|
1968
|
+
{
|
|
1969
|
+
"type": {
|
|
1970
|
+
"text": "String"
|
|
1971
|
+
},
|
|
1972
|
+
"description": "Gap size (xs, sm, md, lg, xl) or valid CSS value",
|
|
1973
|
+
"name": "gap",
|
|
1974
|
+
"kind": "field"
|
|
1923
1975
|
}
|
|
1924
1976
|
],
|
|
1925
1977
|
"superclass": {
|
|
@@ -2975,17 +3027,57 @@
|
|
|
2975
3027
|
"text": "object"
|
|
2976
3028
|
},
|
|
2977
3029
|
"static": true,
|
|
2978
|
-
"default": "{ columns: { type: Number, reflect: true }, stretched: { type: Boolean, reflect: true }, centered: { type: Boolean, reflect: true }, justify: { type: String, reflect: true } }"
|
|
3030
|
+
"default": "{ columns: { type: Number, reflect: true }, stretched: { type: Boolean, reflect: true }, centered: { type: Boolean, reflect: true }, justify: { type: String, reflect: true }, align: { type: String, reflect: true } }"
|
|
2979
3031
|
},
|
|
2980
3032
|
{
|
|
2981
3033
|
"kind": "field",
|
|
2982
3034
|
"name": "styles",
|
|
2983
3035
|
"static": true,
|
|
2984
|
-
"default": "css` :host { display: flex; flex-wrap: wrap; margin: 0 calc(var(--kg-space-md) * -1); box-sizing: border-box; } :host([centered]) { justify-content: center; } :host([justify=\"space-between\"]) { justify-content: space-between; } :host([justify=\"
|
|
3036
|
+
"default": "css` :host { display: flex; flex-wrap: wrap; margin: 0 calc(var(--kg-space-md) * -1); box-sizing: border-box; } :host([centered]) { justify-content: center; } :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; } :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; } :host([stretched]) { align-items: stretch; } /* Handle nesting if needed */ ::slotted(kg-column) { padding: var(--kg-space-md); } `"
|
|
2985
3037
|
},
|
|
2986
3038
|
{
|
|
2987
3039
|
"kind": "method",
|
|
2988
3040
|
"name": "render"
|
|
3041
|
+
},
|
|
3042
|
+
{
|
|
3043
|
+
"type": {
|
|
3044
|
+
"text": "Number"
|
|
3045
|
+
},
|
|
3046
|
+
"description": "Number of columns",
|
|
3047
|
+
"name": "columns",
|
|
3048
|
+
"kind": "field"
|
|
3049
|
+
},
|
|
3050
|
+
{
|
|
3051
|
+
"type": {
|
|
3052
|
+
"text": "Boolean"
|
|
3053
|
+
},
|
|
3054
|
+
"description": "Stretch content",
|
|
3055
|
+
"name": "stretched",
|
|
3056
|
+
"kind": "field"
|
|
3057
|
+
},
|
|
3058
|
+
{
|
|
3059
|
+
"type": {
|
|
3060
|
+
"text": "Boolean"
|
|
3061
|
+
},
|
|
3062
|
+
"description": "Center content horizontally",
|
|
3063
|
+
"name": "centered",
|
|
3064
|
+
"kind": "field"
|
|
3065
|
+
},
|
|
3066
|
+
{
|
|
3067
|
+
"type": {
|
|
3068
|
+
"text": "String"
|
|
3069
|
+
},
|
|
3070
|
+
"description": "Justify content (start, center, end, space-between, space-around, space-evenly)",
|
|
3071
|
+
"name": "justify",
|
|
3072
|
+
"kind": "field"
|
|
3073
|
+
},
|
|
3074
|
+
{
|
|
3075
|
+
"type": {
|
|
3076
|
+
"text": "String"
|
|
3077
|
+
},
|
|
3078
|
+
"description": "Align items vertically (start, center, end, stretch, baseline)",
|
|
3079
|
+
"name": "align",
|
|
3080
|
+
"kind": "field"
|
|
2989
3081
|
}
|
|
2990
3082
|
],
|
|
2991
3083
|
"superclass": {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var e=Object.defineProperty,
|
|
2
|
-
<div class="ui-grid">
|
|
1
|
+
var e=Object.defineProperty,a=(a,t,r)=>((a,t,r)=>t in a?e(a,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[t]=r)(a,"symbol"!=typeof t?t+"":t,r);import{LitElement as t,css as r,html as l}from"lit";class s extends t{getGapValue(){return this.gap?{xs:"var(--kg-space-xs)",sm:"var(--kg-space-sm)",md:"var(--kg-space-md)",lg:"var(--kg-space-lg)",xl:"var(--kg-space-xl)"}[this.gap]||this.gap:""}render(){const e=this.gap?`gap: ${this.getGapValue()};`:"";return l`
|
|
2
|
+
<div class="ui-grid" style="${e}">
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</div>
|
|
5
|
-
`}}
|
|
5
|
+
`}}a(s,"properties",{container:{type:Boolean,reflect:!0},padded:{type:Boolean,reflect:!0},relaxed:{type:Boolean,reflect:!0},doubling:{type:Boolean,reflect:!0},stackable:{type:Boolean,reflect:!0},gap:{type:String,reflect:!0}}),a(s,"styles",r`
|
|
6
6
|
:host {
|
|
7
7
|
display: block;
|
|
8
8
|
width: 100%;
|
|
@@ -25,4 +25,4 @@ var e=Object.defineProperty,t=(t,o,r)=>((t,o,r)=>o in t?e(t,o,{enumerable:!0,con
|
|
|
25
25
|
:host([padded]) {
|
|
26
26
|
padding: var(--kg-space-md) 0;
|
|
27
27
|
}
|
|
28
|
-
`),customElements.define("kg-grid",
|
|
28
|
+
`),customElements.define("kg-grid",s);export{s as kggrid};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var e=Object.defineProperty,t=(t,n
|
|
1
|
+
var e=Object.defineProperty,t=(t,s,n)=>((t,s,n)=>s in t?e(t,s,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[s]=n)(t,"symbol"!=typeof s?s+"":s,n);import{LitElement as s,css as n,html as i}from"lit";class r extends s{render(){return i`<slot></slot>`}}t(r,"properties",{columns:{type:Number,reflect:!0},stretched:{type:Boolean,reflect:!0},centered:{type:Boolean,reflect:!0},justify:{type:String,reflect:!0},align:{type:String,reflect:!0}}),t(r,"styles",n`
|
|
2
2
|
:host {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-wrap: wrap;
|
|
@@ -10,8 +10,18 @@ var e=Object.defineProperty,t=(t,n,r)=>((t,n,r)=>n in t?e(t,n,{enumerable:!0,con
|
|
|
10
10
|
justify-content: center;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
:host([justify="
|
|
13
|
+
:host([justify="start"]) { justify-content: flex-start; }
|
|
14
|
+
:host([justify="center"]) { justify-content: center; }
|
|
14
15
|
:host([justify="end"]) { justify-content: flex-end; }
|
|
16
|
+
:host([justify="space-between"]) { justify-content: space-between; }
|
|
17
|
+
:host([justify="space-around"]) { justify-content: space-around; }
|
|
18
|
+
:host([justify="space-evenly"]) { justify-content: space-evenly; }
|
|
19
|
+
|
|
20
|
+
:host([align="start"]) { align-items: flex-start; }
|
|
21
|
+
:host([align="center"]) { align-items: center; }
|
|
22
|
+
:host([align="end"]) { align-items: flex-end; }
|
|
23
|
+
:host([align="stretch"]) { align-items: stretch; }
|
|
24
|
+
:host([align="baseline"]) { align-items: baseline; }
|
|
15
25
|
|
|
16
26
|
:host([stretched]) {
|
|
17
27
|
align-items: stretch;
|
|
@@ -21,4 +31,4 @@ var e=Object.defineProperty,t=(t,n,r)=>((t,n,r)=>n in t?e(t,n,{enumerable:!0,con
|
|
|
21
31
|
::slotted(kg-column) {
|
|
22
32
|
padding: var(--kg-space-md);
|
|
23
33
|
}
|
|
24
|
-
`),customElements.define("kg-row",
|
|
34
|
+
`),customElements.define("kg-row",r);export{r as kgrow};
|
package/package.json
CHANGED
|
@@ -2,6 +2,18 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
|
|
3
3
|
/** @customElement kg-grid */
|
|
4
4
|
export class kggrid extends LitElement {
|
|
5
|
+
/** Container mode */
|
|
6
|
+
container: boolean;
|
|
7
|
+
/** Adds padding */
|
|
8
|
+
padded: boolean;
|
|
9
|
+
/** Relaxed spacing */
|
|
10
|
+
relaxed: boolean;
|
|
11
|
+
/** Doubling behavior */
|
|
12
|
+
doubling: boolean;
|
|
13
|
+
/** Stackable behavior */
|
|
14
|
+
stackable: boolean;
|
|
15
|
+
/** Gap size (xs, sm, md, lg, xl) or valid CSS value */
|
|
16
|
+
gap: string;
|
|
5
17
|
}
|
|
6
18
|
|
|
7
19
|
declare global {
|
|
@@ -12,7 +24,12 @@ declare global {
|
|
|
12
24
|
namespace JSX {
|
|
13
25
|
interface IntrinsicElements {
|
|
14
26
|
'kg-grid': {
|
|
15
|
-
|
|
27
|
+
container?: boolean;
|
|
28
|
+
padded?: boolean;
|
|
29
|
+
relaxed?: boolean;
|
|
30
|
+
doubling?: boolean;
|
|
31
|
+
stackable?: boolean;
|
|
32
|
+
gap?: string;
|
|
16
33
|
[key: string]: any;
|
|
17
34
|
};
|
|
18
35
|
}
|
|
@@ -2,6 +2,16 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
|
|
3
3
|
/** @customElement kg-row */
|
|
4
4
|
export class kgrow extends LitElement {
|
|
5
|
+
/** Number of columns */
|
|
6
|
+
columns: number;
|
|
7
|
+
/** Stretch content */
|
|
8
|
+
stretched: boolean;
|
|
9
|
+
/** Center content horizontally */
|
|
10
|
+
centered: boolean;
|
|
11
|
+
/** Justify content (start, center, end, space-between, space-around, space-evenly) */
|
|
12
|
+
justify: string;
|
|
13
|
+
/** Align items vertically (start, center, end, stretch, baseline) */
|
|
14
|
+
align: string;
|
|
5
15
|
}
|
|
6
16
|
|
|
7
17
|
declare global {
|
|
@@ -12,7 +22,11 @@ declare global {
|
|
|
12
22
|
namespace JSX {
|
|
13
23
|
interface IntrinsicElements {
|
|
14
24
|
'kg-row': {
|
|
15
|
-
|
|
25
|
+
columns?: number;
|
|
26
|
+
stretched?: boolean;
|
|
27
|
+
centered?: boolean;
|
|
28
|
+
justify?: string;
|
|
29
|
+
align?: string;
|
|
16
30
|
[key: string]: any;
|
|
17
31
|
};
|
|
18
32
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -198,7 +198,12 @@ declare global {
|
|
|
198
198
|
[key: string]: any;
|
|
199
199
|
};
|
|
200
200
|
'kg-grid': {
|
|
201
|
-
|
|
201
|
+
container?: boolean;
|
|
202
|
+
padded?: boolean;
|
|
203
|
+
relaxed?: boolean;
|
|
204
|
+
doubling?: boolean;
|
|
205
|
+
stackable?: boolean;
|
|
206
|
+
gap?: string;
|
|
202
207
|
[key: string]: any;
|
|
203
208
|
};
|
|
204
209
|
'kg-image': {
|
|
@@ -270,7 +275,11 @@ declare global {
|
|
|
270
275
|
[key: string]: any;
|
|
271
276
|
};
|
|
272
277
|
'kg-row': {
|
|
273
|
-
|
|
278
|
+
columns?: number;
|
|
279
|
+
stretched?: boolean;
|
|
280
|
+
centered?: boolean;
|
|
281
|
+
justify?: string;
|
|
282
|
+
align?: string;
|
|
274
283
|
[key: string]: any;
|
|
275
284
|
};
|
|
276
285
|
'kg-select': {
|