@jegdev/sema-ui 0.0.4 → 0.0.5
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/sema-ui.es.js +187 -0
- package/dist/sema-ui.umd.js +149 -0
- package/package.json +1 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { css as a, LitElement as b, html as s } from "lit";
|
|
2
|
+
const c = a`
|
|
3
|
+
/* ---------------- GENERAL STYLES ------------------- */
|
|
4
|
+
|
|
5
|
+
a {
|
|
6
|
+
text-decoration: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.btn {
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
border-radius: 8px;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
outline: none;
|
|
17
|
+
padding: 0.6rem 1.2rem;
|
|
18
|
+
font-size: var(--btn-font-size);
|
|
19
|
+
border: 1px solid transparent;
|
|
20
|
+
width: var(--btn-width);
|
|
21
|
+
font-family:
|
|
22
|
+
"Inter",
|
|
23
|
+
system-ui,
|
|
24
|
+
-apple-system,
|
|
25
|
+
sans-serif;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.btn:hover {
|
|
29
|
+
border: 1px solid #b3b3b3;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* ---------------- PRIMARY BUTTON STYLES ------------------- */
|
|
33
|
+
|
|
34
|
+
.btn-primary {
|
|
35
|
+
background: #ef4444;
|
|
36
|
+
color: #f9fafb;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.btn-primary:hover {
|
|
40
|
+
background: #f9fafb;
|
|
41
|
+
color: #ef4444;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.btn-custom {
|
|
45
|
+
background: var(--btn-primary-color);
|
|
46
|
+
color: var(--btn-secondary-color);
|
|
47
|
+
}
|
|
48
|
+
.btn-custom:hover {
|
|
49
|
+
background: var(--btn-secondary-color);
|
|
50
|
+
color: var(--btn-primary-color);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* ---------------- OUTLINE BUTTON STYLES ------------------- */
|
|
54
|
+
|
|
55
|
+
.btn-outline {
|
|
56
|
+
background: #f9fafb;
|
|
57
|
+
color: #ef4444;
|
|
58
|
+
border: 1.5px solid #ef4444;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.btn-outline:hover {
|
|
62
|
+
background: #ef4444;
|
|
63
|
+
color: #f9fafb;
|
|
64
|
+
border: 1.5px solid #ef4444;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.btn-outline-custom {
|
|
68
|
+
background: var(--btn-secondary-color);
|
|
69
|
+
color: var(--btn-primary-color);
|
|
70
|
+
border: 1.5px solid var(--btn-primary-color, currentColor);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.btn-outline-custom:hover {
|
|
74
|
+
background: var(--btn-primary-color);
|
|
75
|
+
color: var(--btn-secondary-color);
|
|
76
|
+
border: 1.5px solid var(--btn-primary-color, currentColor);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* ---------------- GHOST BUTTON STYLES ------------------- */
|
|
80
|
+
|
|
81
|
+
.btn-ghost {
|
|
82
|
+
color: #999999;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.btn-ghost:hover {
|
|
86
|
+
color: #ef4444;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.btn-ghost-custom {
|
|
90
|
+
color: var(--btn-primary-color);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.btn-ghost-custom:hover {
|
|
94
|
+
color: var(--btn-secondary-color);
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
97
|
+
class l extends b {
|
|
98
|
+
static get is() {
|
|
99
|
+
return "sema-button";
|
|
100
|
+
}
|
|
101
|
+
static styles = [c];
|
|
102
|
+
static properties = {
|
|
103
|
+
mode: { type: String },
|
|
104
|
+
kind: { type: String },
|
|
105
|
+
custom: { type: String },
|
|
106
|
+
firstColor: { type: String },
|
|
107
|
+
secondaryColor: { type: String },
|
|
108
|
+
size: { type: String },
|
|
109
|
+
fontSize: { type: String },
|
|
110
|
+
textLabel: { type: String },
|
|
111
|
+
url: { type: String },
|
|
112
|
+
target: { type: String },
|
|
113
|
+
altText: { type: String }
|
|
114
|
+
};
|
|
115
|
+
constructor() {
|
|
116
|
+
super(), this.mode = "", this.kind = "", this.custom = "off", this.firstColor = "", this.secondaryColor = "", this.size = "", this.fontSize = "", this.textLabel, this.url, this.altText, this.target;
|
|
117
|
+
}
|
|
118
|
+
render() {
|
|
119
|
+
const n = this.custom === "on", t = n ? `--btn-primary-color: ${this.firstColor}; --btn-secondary-color: ${this.secondaryColor};` : "";
|
|
120
|
+
let r = "120px";
|
|
121
|
+
this.size === "sm" ? r = "80px" : this.size === "md" ? r = "120px" : this.size === "lg" ? r = "160px" : this.size === "full" && (r = "100%");
|
|
122
|
+
const o = `--btn-width: ${r};`;
|
|
123
|
+
let i = "1rem";
|
|
124
|
+
this.fontSize === "sm" ? i = "0.8rem" : this.fontSize === "md" ? i = "1rem" : this.fontSize === "lg" ? i = "1.5rem" : this.fontSize === "xl" && (i = "2rem");
|
|
125
|
+
const e = `--btn-font-size: ${i}`;
|
|
126
|
+
return this.mode === "outline" ? this.kind === "link" ? s`
|
|
127
|
+
<a
|
|
128
|
+
style="${t}${o}${e}"
|
|
129
|
+
href="${this.url}"
|
|
130
|
+
alt="${this.altText}"
|
|
131
|
+
title="${this.altText}"
|
|
132
|
+
target="${this.target}"
|
|
133
|
+
class="btn ${n ? "btn-outline-custom" : "btn-outline"}"
|
|
134
|
+
>${this.textLabel}
|
|
135
|
+
</a>
|
|
136
|
+
` : s`
|
|
137
|
+
<button
|
|
138
|
+
style="${t}${o}${e}"
|
|
139
|
+
class="btn ${n ? "btn-outline-custom" : "btn-outline"}"
|
|
140
|
+
title="${this.textLabel}"
|
|
141
|
+
>
|
|
142
|
+
${this.textLabel}
|
|
143
|
+
</button>
|
|
144
|
+
` : this.mode === "ghost" ? this.kind === "link" ? s`
|
|
145
|
+
<a
|
|
146
|
+
style="${t}${o}${e}"
|
|
147
|
+
href="${this.url}"
|
|
148
|
+
alt="${this.altText}"
|
|
149
|
+
title="${this.altText}"
|
|
150
|
+
target="${this.target}"
|
|
151
|
+
class="btn ${this.custom === "on" ? "btn-ghost-custom" : "btn-ghost"}"
|
|
152
|
+
>${this.textLabel}
|
|
153
|
+
</a>
|
|
154
|
+
` : s`
|
|
155
|
+
<button
|
|
156
|
+
style="${t}${o}${e}"
|
|
157
|
+
class="btn ${this.custom === "on" ? "btn-ghost-custom" : "btn-ghost"}"
|
|
158
|
+
title="${this.textLabel}"
|
|
159
|
+
>
|
|
160
|
+
${this.textLabel}
|
|
161
|
+
</button>
|
|
162
|
+
` : this.kind === "link" ? s`
|
|
163
|
+
<a
|
|
164
|
+
style="${t}${o}${e}"
|
|
165
|
+
href="${this.url}"
|
|
166
|
+
alt="${this.altText}"
|
|
167
|
+
title="${this.altText}"
|
|
168
|
+
target="${this.target}"
|
|
169
|
+
class="btn ${this.custom === "on" ? "btn-custom" : "btn-primary"}"
|
|
170
|
+
>${this.textLabel}
|
|
171
|
+
</a>
|
|
172
|
+
` : s`
|
|
173
|
+
<button
|
|
174
|
+
style="${t}${o}${e}"
|
|
175
|
+
class="btn ${this.custom === "on" ? "btn-custom" : "btn-primary"}"
|
|
176
|
+
title="${this.textLabel}"
|
|
177
|
+
>
|
|
178
|
+
${this.textLabel}
|
|
179
|
+
</button>
|
|
180
|
+
`;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
customElements.define(l.is, l);
|
|
184
|
+
const m = "0.0.1";
|
|
185
|
+
export {
|
|
186
|
+
m as version
|
|
187
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("lit")):typeof define=="function"&&define.amd?define(["exports","lit"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.SemaUI={},e.lit))})(this,(function(e,t){"use strict";const c=t.css`
|
|
2
|
+
/* ---------------- GENERAL STYLES ------------------- */
|
|
3
|
+
|
|
4
|
+
a {
|
|
5
|
+
text-decoration: none;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.btn {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
border-radius: 8px;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
font-weight: 600;
|
|
15
|
+
outline: none;
|
|
16
|
+
padding: 0.6rem 1.2rem;
|
|
17
|
+
font-size: var(--btn-font-size);
|
|
18
|
+
border: 1px solid transparent;
|
|
19
|
+
width: var(--btn-width);
|
|
20
|
+
font-family:
|
|
21
|
+
"Inter",
|
|
22
|
+
system-ui,
|
|
23
|
+
-apple-system,
|
|
24
|
+
sans-serif;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.btn:hover {
|
|
28
|
+
border: 1px solid #b3b3b3;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* ---------------- PRIMARY BUTTON STYLES ------------------- */
|
|
32
|
+
|
|
33
|
+
.btn-primary {
|
|
34
|
+
background: #ef4444;
|
|
35
|
+
color: #f9fafb;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.btn-primary:hover {
|
|
39
|
+
background: #f9fafb;
|
|
40
|
+
color: #ef4444;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.btn-custom {
|
|
44
|
+
background: var(--btn-primary-color);
|
|
45
|
+
color: var(--btn-secondary-color);
|
|
46
|
+
}
|
|
47
|
+
.btn-custom:hover {
|
|
48
|
+
background: var(--btn-secondary-color);
|
|
49
|
+
color: var(--btn-primary-color);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* ---------------- OUTLINE BUTTON STYLES ------------------- */
|
|
53
|
+
|
|
54
|
+
.btn-outline {
|
|
55
|
+
background: #f9fafb;
|
|
56
|
+
color: #ef4444;
|
|
57
|
+
border: 1.5px solid #ef4444;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.btn-outline:hover {
|
|
61
|
+
background: #ef4444;
|
|
62
|
+
color: #f9fafb;
|
|
63
|
+
border: 1.5px solid #ef4444;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.btn-outline-custom {
|
|
67
|
+
background: var(--btn-secondary-color);
|
|
68
|
+
color: var(--btn-primary-color);
|
|
69
|
+
border: 1.5px solid var(--btn-primary-color, currentColor);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.btn-outline-custom:hover {
|
|
73
|
+
background: var(--btn-primary-color);
|
|
74
|
+
color: var(--btn-secondary-color);
|
|
75
|
+
border: 1.5px solid var(--btn-primary-color, currentColor);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* ---------------- GHOST BUTTON STYLES ------------------- */
|
|
79
|
+
|
|
80
|
+
.btn-ghost {
|
|
81
|
+
color: #999999;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.btn-ghost:hover {
|
|
85
|
+
color: #ef4444;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.btn-ghost-custom {
|
|
89
|
+
color: var(--btn-primary-color);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.btn-ghost-custom:hover {
|
|
93
|
+
color: var(--btn-secondary-color);
|
|
94
|
+
}
|
|
95
|
+
`;class a extends t.LitElement{static get is(){return"sema-button"}static styles=[c];static properties={mode:{type:String},kind:{type:String},custom:{type:String},firstColor:{type:String},secondaryColor:{type:String},size:{type:String},fontSize:{type:String},textLabel:{type:String},url:{type:String},target:{type:String},altText:{type:String}};constructor(){super(),this.mode="",this.kind="",this.custom="off",this.firstColor="",this.secondaryColor="",this.size="",this.fontSize="",this.textLabel,this.url,this.altText,this.target}render(){const l=this.custom==="on",o=l?`--btn-primary-color: ${this.firstColor}; --btn-secondary-color: ${this.secondaryColor};`:"";let i="120px";this.size==="sm"?i="80px":this.size==="md"?i="120px":this.size==="lg"?i="160px":this.size==="full"&&(i="100%");const s=`--btn-width: ${i};`;let n="1rem";this.fontSize==="sm"?n="0.8rem":this.fontSize==="md"?n="1rem":this.fontSize==="lg"?n="1.5rem":this.fontSize==="xl"&&(n="2rem");const r=`--btn-font-size: ${n}`;return this.mode==="outline"?this.kind==="link"?t.html`
|
|
96
|
+
<a
|
|
97
|
+
style="${o}${s}${r}"
|
|
98
|
+
href="${this.url}"
|
|
99
|
+
alt="${this.altText}"
|
|
100
|
+
title="${this.altText}"
|
|
101
|
+
target="${this.target}"
|
|
102
|
+
class="btn ${l?"btn-outline-custom":"btn-outline"}"
|
|
103
|
+
>${this.textLabel}
|
|
104
|
+
</a>
|
|
105
|
+
`:t.html`
|
|
106
|
+
<button
|
|
107
|
+
style="${o}${s}${r}"
|
|
108
|
+
class="btn ${l?"btn-outline-custom":"btn-outline"}"
|
|
109
|
+
title="${this.textLabel}"
|
|
110
|
+
>
|
|
111
|
+
${this.textLabel}
|
|
112
|
+
</button>
|
|
113
|
+
`:this.mode==="ghost"?this.kind==="link"?t.html`
|
|
114
|
+
<a
|
|
115
|
+
style="${o}${s}${r}"
|
|
116
|
+
href="${this.url}"
|
|
117
|
+
alt="${this.altText}"
|
|
118
|
+
title="${this.altText}"
|
|
119
|
+
target="${this.target}"
|
|
120
|
+
class="btn ${this.custom==="on"?"btn-ghost-custom":"btn-ghost"}"
|
|
121
|
+
>${this.textLabel}
|
|
122
|
+
</a>
|
|
123
|
+
`:t.html`
|
|
124
|
+
<button
|
|
125
|
+
style="${o}${s}${r}"
|
|
126
|
+
class="btn ${this.custom==="on"?"btn-ghost-custom":"btn-ghost"}"
|
|
127
|
+
title="${this.textLabel}"
|
|
128
|
+
>
|
|
129
|
+
${this.textLabel}
|
|
130
|
+
</button>
|
|
131
|
+
`:this.kind==="link"?t.html`
|
|
132
|
+
<a
|
|
133
|
+
style="${o}${s}${r}"
|
|
134
|
+
href="${this.url}"
|
|
135
|
+
alt="${this.altText}"
|
|
136
|
+
title="${this.altText}"
|
|
137
|
+
target="${this.target}"
|
|
138
|
+
class="btn ${this.custom==="on"?"btn-custom":"btn-primary"}"
|
|
139
|
+
>${this.textLabel}
|
|
140
|
+
</a>
|
|
141
|
+
`:t.html`
|
|
142
|
+
<button
|
|
143
|
+
style="${o}${s}${r}"
|
|
144
|
+
class="btn ${this.custom==="on"?"btn-custom":"btn-primary"}"
|
|
145
|
+
title="${this.textLabel}"
|
|
146
|
+
>
|
|
147
|
+
${this.textLabel}
|
|
148
|
+
</button>
|
|
149
|
+
`}}customElements.define(a.is,a);const b="0.0.1";e.version=b,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jegdev/sema-ui",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.5",
|
|
5
5
|
"description": "Una colección de componentes Lit minimalistas estilo Swiss Design",
|
|
6
6
|
"keywords": ["Next", "React", "Angular", "Vue", "Astro", "Lit"],
|
|
7
7
|
"type": "module",
|