@jegdev/sema-ui 0.0.6 → 0.0.7

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.
@@ -0,0 +1,189 @@
1
+ import { css as a, LitElement as c, html as r } from "lit";
2
+ const b = 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 c {
98
+ static get is() {
99
+ return "sema-button";
100
+ }
101
+ static styles = [b];
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
+ url: { type: String },
111
+ target: { type: String },
112
+ altText: { type: String }
113
+ };
114
+ constructor() {
115
+ super(), this.mode = "", this.kind = "", this.custom = "off", this.firstColor = "", this.secondaryColor = "", this.size = "", this.fontSize = "", this.url, this.altText, this.target;
116
+ }
117
+ render() {
118
+ const n = this.custom === "on", t = n ? `--btn-primary-color: ${this.firstColor}; --btn-secondary-color: ${this.secondaryColor};` : "";
119
+ let e = "120px";
120
+ this.size === "sm" ? e = "80px" : this.size === "md" ? e = "120px" : this.size === "lg" ? e = "160px" : this.size === "full" && (e = "100%");
121
+ const o = `--btn-width: ${e};`;
122
+ let i = "1rem";
123
+ this.fontSize === "sm" ? i = "0.8rem" : this.fontSize === "md" ? i = "1rem" : this.fontSize === "lg" ? i = "1.5rem" : this.fontSize === "xl" && (i = "2rem");
124
+ const s = `--btn-font-size: ${i}`;
125
+ return this.mode === "outline" ? this.kind === "link" ? r`
126
+ <a
127
+ style="${t}${o}${s}"
128
+ href="${this.url}"
129
+ alt="${this.altText}"
130
+ title="${this.altText}"
131
+ target="${this.target}"
132
+ class="btn ${n ? "btn-outline-custom" : "btn-outline"}"
133
+ >
134
+ <slot></slot>
135
+ </a>
136
+ ` : r`
137
+ <button
138
+ style="${t}${o}${s}"
139
+ class="btn ${n ? "btn-outline-custom" : "btn-outline"}"
140
+ title="${this.altText}"
141
+ >
142
+ <slot></slot>
143
+ </button>
144
+ ` : this.mode === "ghost" ? this.kind === "link" ? r`
145
+ <a
146
+ style="${t}${o}${s}"
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
+ >
153
+ <slot></slot>
154
+ </a>
155
+ ` : r`
156
+ <button
157
+ style="${t}${o}${s}"
158
+ class="btn ${this.custom === "on" ? "btn-ghost-custom" : "btn-ghost"}"
159
+ title="${this.altText}"
160
+ >
161
+ <slot></slot>
162
+ </button>
163
+ ` : this.kind === "link" ? r`
164
+ <a
165
+ style="${t}${o}${s}"
166
+ href="${this.url}"
167
+ alt="${this.altText}"
168
+ title="${this.altText}"
169
+ target="${this.target}"
170
+ class="btn ${this.custom === "on" ? "btn-custom" : "btn-primary"}"
171
+ >
172
+ <slot></slot>
173
+ </a>
174
+ ` : r`
175
+ <button
176
+ style="${t}${o}${s}"
177
+ class="btn ${this.custom === "on" ? "btn-custom" : "btn-primary"}"
178
+ title="${this.altText}"
179
+ >
180
+ <slot></slot>
181
+ </button>
182
+ `;
183
+ }
184
+ }
185
+ customElements.define(l.is, l);
186
+ const m = "0.0.1";
187
+ export {
188
+ m as version
189
+ };
@@ -0,0 +1,152 @@
1
+ (function(o,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("lit")):typeof define=="function"&&define.amd?define(["exports","lit"],t):(o=typeof globalThis<"u"?globalThis:o||self,t(o.SemaUI={},o.lit))})(this,(function(o,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},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.url,this.altText,this.target}render(){const l=this.custom==="on",e=l?`--btn-primary-color: ${this.firstColor}; --btn-secondary-color: ${this.secondaryColor};`:"";let n="120px";this.size==="sm"?n="80px":this.size==="md"?n="120px":this.size==="lg"?n="160px":this.size==="full"&&(n="100%");const s=`--btn-width: ${n};`;let i="1rem";this.fontSize==="sm"?i="0.8rem":this.fontSize==="md"?i="1rem":this.fontSize==="lg"?i="1.5rem":this.fontSize==="xl"&&(i="2rem");const r=`--btn-font-size: ${i}`;return this.mode==="outline"?this.kind==="link"?t.html`
96
+ <a
97
+ style="${e}${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
+ >
104
+ <slot></slot>
105
+ </a>
106
+ `:t.html`
107
+ <button
108
+ style="${e}${s}${r}"
109
+ class="btn ${l?"btn-outline-custom":"btn-outline"}"
110
+ title="${this.altText}"
111
+ >
112
+ <slot></slot>
113
+ </button>
114
+ `:this.mode==="ghost"?this.kind==="link"?t.html`
115
+ <a
116
+ style="${e}${s}${r}"
117
+ href="${this.url}"
118
+ alt="${this.altText}"
119
+ title="${this.altText}"
120
+ target="${this.target}"
121
+ class="btn ${this.custom==="on"?"btn-ghost-custom":"btn-ghost"}"
122
+ >
123
+ <slot></slot>
124
+ </a>
125
+ `:t.html`
126
+ <button
127
+ style="${e}${s}${r}"
128
+ class="btn ${this.custom==="on"?"btn-ghost-custom":"btn-ghost"}"
129
+ title="${this.altText}"
130
+ >
131
+ <slot></slot>
132
+ </button>
133
+ `:this.kind==="link"?t.html`
134
+ <a
135
+ style="${e}${s}${r}"
136
+ href="${this.url}"
137
+ alt="${this.altText}"
138
+ title="${this.altText}"
139
+ target="${this.target}"
140
+ class="btn ${this.custom==="on"?"btn-custom":"btn-primary"}"
141
+ >
142
+ <slot></slot>
143
+ </a>
144
+ `:t.html`
145
+ <button
146
+ style="${e}${s}${r}"
147
+ class="btn ${this.custom==="on"?"btn-custom":"btn-primary"}"
148
+ title="${this.altText}"
149
+ >
150
+ <slot></slot>
151
+ </button>
152
+ `}}customElements.define(a.is,a);const b="0.0.1";o.version=b,Object.defineProperty(o,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.6",
4
+ "version": "0.0.7",
5
5
  "description": "Una colección de componentes Lit minimalistas estilo Swiss Design",
6
6
  "keywords": [
7
7
  "Next",