@lukso/web-components 1.85.1 → 1.87.0
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/components/index.cjs +18 -3
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +6 -3
- package/dist/components/lukso-button/index.cjs +13 -4
- package/dist/components/lukso-button/index.d.ts +1 -1
- package/dist/components/lukso-button/index.d.ts.map +1 -1
- package/dist/components/lukso-button/index.js +13 -4
- package/dist/components/lukso-button/lukso-button.stories.d.ts +6 -0
- package/dist/components/lukso-button/lukso-button.stories.d.ts.map +1 -1
- package/dist/components/lukso-card/index.cjs +3 -3
- package/dist/components/lukso-card/index.js +3 -3
- package/dist/components/lukso-checkbox/index.cjs +1 -1
- package/dist/components/lukso-checkbox/index.js +1 -1
- package/dist/components/lukso-dropdown/index.cjs +26 -0
- package/dist/components/lukso-dropdown/index.d.ts +28 -0
- package/dist/components/lukso-dropdown/index.d.ts.map +1 -0
- package/dist/components/lukso-dropdown/index.js +15 -0
- package/dist/components/lukso-dropdown/lukso-dropdown.stories.d.ts +9 -0
- package/dist/components/lukso-dropdown/lukso-dropdown.stories.d.ts.map +1 -0
- package/dist/components/lukso-dropdown-option/index.cjs +110 -0
- package/dist/components/lukso-dropdown-option/index.d.ts +19 -0
- package/dist/components/lukso-dropdown-option/index.d.ts.map +1 -0
- package/dist/components/lukso-dropdown-option/index.js +108 -0
- package/dist/components/lukso-dropdown-option/lukso-dropdown-option.stories.d.ts +7 -0
- package/dist/components/lukso-dropdown-option/lukso-dropdown-option.stories.d.ts.map +1 -0
- package/dist/components/lukso-footer/index.cjs +1 -1
- package/dist/components/lukso-footer/index.js +1 -1
- package/dist/components/lukso-icon/index.cjs +2 -2
- package/dist/components/lukso-icon/index.js +2 -2
- package/dist/components/lukso-image/index.cjs +2 -2
- package/dist/components/lukso-image/index.js +2 -2
- package/dist/components/lukso-input/index.cjs +2 -2
- package/dist/components/lukso-input/index.js +2 -2
- package/dist/components/lukso-modal/index.cjs +1 -1
- package/dist/components/lukso-modal/index.js +1 -1
- package/dist/components/lukso-navbar/index.cjs +3 -3
- package/dist/components/lukso-navbar/index.js +3 -3
- package/dist/components/lukso-pagination/index.cjs +2 -2
- package/dist/components/lukso-pagination/index.js +2 -2
- package/dist/components/lukso-profile/index.cjs +2 -2
- package/dist/components/lukso-profile/index.js +2 -2
- package/dist/components/lukso-progress/index.cjs +2 -2
- package/dist/components/lukso-progress/index.js +2 -2
- package/dist/components/lukso-sanitize/index.cjs +1 -1
- package/dist/components/lukso-sanitize/index.js +1 -1
- package/dist/components/lukso-search/index.cjs +62 -71
- package/dist/components/lukso-search/index.d.ts +1 -3
- package/dist/components/lukso-search/index.d.ts.map +1 -1
- package/dist/components/lukso-search/index.js +62 -71
- package/dist/components/lukso-select/index.cjs +29 -98
- package/dist/components/lukso-select/index.d.ts +0 -3
- package/dist/components/lukso-select/index.d.ts.map +1 -1
- package/dist/components/lukso-select/index.js +28 -97
- package/dist/components/lukso-share/index.cjs +1 -1
- package/dist/components/lukso-share/index.js +1 -1
- package/dist/components/lukso-switch/index.cjs +2 -2
- package/dist/components/lukso-switch/index.js +2 -2
- package/dist/components/lukso-tag/index.cjs +2 -2
- package/dist/components/lukso-tag/index.js +2 -2
- package/dist/components/lukso-terms/index.cjs +2 -2
- package/dist/components/lukso-terms/index.js +2 -2
- package/dist/components/lukso-test/index.cjs +1 -1
- package/dist/components/lukso-test/index.js +1 -1
- package/dist/components/lukso-textarea/index.cjs +361 -0
- package/dist/components/lukso-textarea/index.d.ts +46 -0
- package/dist/components/lukso-textarea/index.d.ts.map +1 -0
- package/dist/components/lukso-textarea/index.js +359 -0
- package/dist/components/lukso-textarea/lukso-textarea.stories.d.ts +23 -0
- package/dist/components/lukso-textarea/lukso-textarea.stories.d.ts.map +1 -0
- package/dist/components/lukso-tooltip/index.cjs +2 -2
- package/dist/components/lukso-tooltip/index.js +2 -2
- package/dist/components/lukso-username/index.cjs +2 -2
- package/dist/components/lukso-username/index.js +2 -2
- package/dist/components/lukso-wizard/index.cjs +1 -1
- package/dist/components/lukso-wizard/index.js +1 -1
- package/dist/{index-3b498928.cjs → index-0bb73cde.cjs} +1 -1
- package/dist/index-0e089618.js +141 -0
- package/dist/index-5c4bade5.cjs +143 -0
- package/dist/index-6e3f406c.cjs +46 -0
- package/dist/index-9d81031f.js +39 -0
- package/dist/{index-8043be8a.js → index-c395d033.js} +1 -1
- package/dist/index.cjs +18 -3
- package/dist/index.js +6 -3
- package/dist/shared/tailwind-element/index.cjs +1 -1
- package/dist/shared/tailwind-element/index.js +1 -1
- package/dist/{style-map-a6d61d04.cjs → style-map-320a365c.cjs} +1 -1
- package/dist/{style-map-ad97bcc3.js → style-map-d014149d.js} +1 -1
- package/dist/styles/main.css +1 -0
- package/dist/styles/main.css.map +1 -1
- package/dist/tailwind-config.cjs +1 -1
- package/dist/tailwind-config.js +1 -1
- package/package.json +16 -1
- package/tools/cn.cjs +1 -1
- package/tools/cn.js +1 -1
- package/tools/index.cjs +1 -1
- package/tools/index.js +1 -1
- package/tools/sass/colors.scss +1 -0
- package/tools/styles/main.css +1 -0
- package/tools/{tailwind-config-cece8e4d.cjs → tailwind-config-783c9054.cjs} +1 -1
- package/tools/{tailwind-config-effbdecc.js → tailwind-config-e386df1d.js} +1 -1
- package/tools/tailwind-config.cjs +1 -1
- package/tools/tailwind-config.js +1 -1
- package/dist/index-e653a9ff.cjs +0 -46
- package/dist/index-f72579d6.js +0 -39
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { T as TailwindStyledElement, x, A } from '../../index-9d81031f.js';
|
|
2
|
+
import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
|
|
3
|
+
import { t } from '../../state-b9ca4e74.js';
|
|
4
|
+
import { c as ce } from '../../index-ca8e900d.js';
|
|
5
|
+
import '../../tailwind-config.js';
|
|
6
|
+
import { c as cn } from '../../cn-b54dcc61.js';
|
|
7
|
+
import '../lukso-icon/index.js';
|
|
8
|
+
import '../../bundle-mjs-fbc6e2a8.js';
|
|
9
|
+
import '../../style-map-d014149d.js';
|
|
10
|
+
import '../../directive-2bb7789e.js';
|
|
11
|
+
|
|
12
|
+
const style = ":host {\n\n display: inline-flex\n}\n\n:host([is-full-width]) {\n\n display: flex;\n\n width: 100%\n}";
|
|
13
|
+
|
|
14
|
+
var __defProp = Object.defineProperty;
|
|
15
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
16
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
17
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
18
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
19
|
+
if (decorator = decorators[i])
|
|
20
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
21
|
+
if (kind && result)
|
|
22
|
+
__defProp(target, key, result);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
let LuksoTextarea = class extends TailwindStyledElement(style) {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
this.value = "";
|
|
29
|
+
this.name = "";
|
|
30
|
+
this.placeholder = "";
|
|
31
|
+
this.label = "";
|
|
32
|
+
this.id = "";
|
|
33
|
+
this.ref = void 0;
|
|
34
|
+
this.description = "";
|
|
35
|
+
this.error = "";
|
|
36
|
+
this.customClass = "";
|
|
37
|
+
this.isFullWidth = false;
|
|
38
|
+
this.isReadonly = false;
|
|
39
|
+
this.isDisabled = false;
|
|
40
|
+
this.autofocus = false;
|
|
41
|
+
this.borderless = false;
|
|
42
|
+
this.isNonResizable = false;
|
|
43
|
+
this.size = "medium";
|
|
44
|
+
this.rows = 4;
|
|
45
|
+
this.hasHocus = false;
|
|
46
|
+
this.hasHighlight = false;
|
|
47
|
+
this.styles = ce({
|
|
48
|
+
slots: {
|
|
49
|
+
wrapper: "group flex",
|
|
50
|
+
input: `bg-neutral-100 border-solid placeholder:text-neutral-70 w-full
|
|
51
|
+
outline-none transition transition-all duration-150 appearance-none`
|
|
52
|
+
},
|
|
53
|
+
variants: {
|
|
54
|
+
hasError: {
|
|
55
|
+
true: {
|
|
56
|
+
input: "border-red-85"
|
|
57
|
+
},
|
|
58
|
+
false: {
|
|
59
|
+
input: "border-neutral-90"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
hasHighlight: {
|
|
63
|
+
true: {
|
|
64
|
+
input: "border-neutral-35"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
borderless: {
|
|
68
|
+
true: { input: "border-0" },
|
|
69
|
+
false: { input: "border" }
|
|
70
|
+
},
|
|
71
|
+
isReadonly: {
|
|
72
|
+
true: { input: "cursor-not-allowed" }
|
|
73
|
+
},
|
|
74
|
+
isDisabled: {
|
|
75
|
+
true: {
|
|
76
|
+
input: "text-neutral-60 cursor-not-allowed"
|
|
77
|
+
},
|
|
78
|
+
false: { input: "text-neutral-20" }
|
|
79
|
+
},
|
|
80
|
+
isFullWidth: {
|
|
81
|
+
true: { wrapper: "w-full" },
|
|
82
|
+
false: { wrapper: "w-[350px]" }
|
|
83
|
+
},
|
|
84
|
+
size: {
|
|
85
|
+
small: {
|
|
86
|
+
input: "min-h-[28px] px-2 py-1 paragraph-inter-12-regular rounded-8"
|
|
87
|
+
},
|
|
88
|
+
medium: {
|
|
89
|
+
input: "min-h-[48px] px-4 py-3 paragraph-inter-14-regular rounded-12"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
isNonResizable: {
|
|
93
|
+
true: {
|
|
94
|
+
input: "resize-none"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
compoundVariants: [
|
|
99
|
+
{
|
|
100
|
+
isFullWidth: false,
|
|
101
|
+
size: "small",
|
|
102
|
+
class: { wrapper: "w-[210px]" }
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
hasHighlight: true,
|
|
106
|
+
hasError: true,
|
|
107
|
+
class: {
|
|
108
|
+
input: "border-red-65"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
inputTemplate(styles) {
|
|
115
|
+
return x`
|
|
116
|
+
<textarea
|
|
117
|
+
name=${this.name ? this.name : A}
|
|
118
|
+
placeholder=${this.placeholder ? this.placeholder : A}
|
|
119
|
+
ref=${this.ref ? this.ref : A}
|
|
120
|
+
id=${this.id ? this.id : A}
|
|
121
|
+
rows=${this.rows}
|
|
122
|
+
data-testid=${this.name ? `textarea-${this.name}` : "textarea"}
|
|
123
|
+
?autofocus=${this.autofocus}
|
|
124
|
+
?readonly=${this.isReadonly ? true : void 0}
|
|
125
|
+
?disabled=${this.isDisabled ? true : void 0}
|
|
126
|
+
class=${cn(styles, this.customClass)}
|
|
127
|
+
@focus=${this.handleFocus}
|
|
128
|
+
@input=${this.handleInput}
|
|
129
|
+
@change=${this.handleChange}
|
|
130
|
+
@blur=${this.handleBlur}
|
|
131
|
+
@keyup=${this.handleKeyUp}
|
|
132
|
+
@keydown=${this.handleKeyDown}
|
|
133
|
+
@keypress=${this.handleKeyPress}
|
|
134
|
+
@mouseenter=${this.handleMouseOver}
|
|
135
|
+
@mouseleave=${this.handleMouseOut}
|
|
136
|
+
@click=${this.handleInputClick}
|
|
137
|
+
>
|
|
138
|
+
${this.value}</textarea
|
|
139
|
+
>
|
|
140
|
+
`;
|
|
141
|
+
}
|
|
142
|
+
labelTemplate() {
|
|
143
|
+
return x`
|
|
144
|
+
<label
|
|
145
|
+
for=${this.name}
|
|
146
|
+
class="heading-inter-14-bold text-neutral-20 pb-2 block"
|
|
147
|
+
>${this.label}</label
|
|
148
|
+
>
|
|
149
|
+
`;
|
|
150
|
+
}
|
|
151
|
+
descriptionTemplate() {
|
|
152
|
+
return x`
|
|
153
|
+
<div class="paragraph-inter-12-regular text-neutral-20 pb-2">
|
|
154
|
+
${this.description ?? A}
|
|
155
|
+
</div>
|
|
156
|
+
`;
|
|
157
|
+
}
|
|
158
|
+
errorTemplate() {
|
|
159
|
+
return x`<div class="paragraph-inter-12-regular text-red-65 pt-2">
|
|
160
|
+
${this.error}
|
|
161
|
+
</div>`;
|
|
162
|
+
}
|
|
163
|
+
handleFocus() {
|
|
164
|
+
if (!this.isReadonly && !this.isDisabled) {
|
|
165
|
+
this.hasHocus = true;
|
|
166
|
+
this.hasHighlight = true;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
async handleBlur(event) {
|
|
170
|
+
this.hasHocus = false;
|
|
171
|
+
this.hasHighlight = false;
|
|
172
|
+
await this.updateComplete;
|
|
173
|
+
const target = event.target;
|
|
174
|
+
const blurEvent = new CustomEvent("on-blur", {
|
|
175
|
+
detail: {
|
|
176
|
+
value: target?.value,
|
|
177
|
+
event
|
|
178
|
+
},
|
|
179
|
+
bubbles: false,
|
|
180
|
+
composed: true
|
|
181
|
+
});
|
|
182
|
+
this.dispatchEvent(blurEvent);
|
|
183
|
+
}
|
|
184
|
+
async handleChange(event) {
|
|
185
|
+
await this.updateComplete;
|
|
186
|
+
const target = event.target;
|
|
187
|
+
const changeEvent = new CustomEvent("on-change", {
|
|
188
|
+
detail: {
|
|
189
|
+
value: target?.value,
|
|
190
|
+
event
|
|
191
|
+
},
|
|
192
|
+
bubbles: false,
|
|
193
|
+
composed: true
|
|
194
|
+
});
|
|
195
|
+
this.dispatchEvent(changeEvent);
|
|
196
|
+
}
|
|
197
|
+
async handleInput(event) {
|
|
198
|
+
const target = event.target;
|
|
199
|
+
this.value = target?.value;
|
|
200
|
+
await this.updateComplete;
|
|
201
|
+
const changeEvent = new CustomEvent("on-input", {
|
|
202
|
+
detail: {
|
|
203
|
+
value: target?.value,
|
|
204
|
+
event
|
|
205
|
+
},
|
|
206
|
+
bubbles: false,
|
|
207
|
+
composed: true
|
|
208
|
+
});
|
|
209
|
+
this.dispatchEvent(changeEvent);
|
|
210
|
+
}
|
|
211
|
+
async handleKeyUp(event) {
|
|
212
|
+
await this.updateComplete;
|
|
213
|
+
const target = event.target;
|
|
214
|
+
const keyEvent = new CustomEvent("on-key-up", {
|
|
215
|
+
detail: {
|
|
216
|
+
value: target?.value,
|
|
217
|
+
event
|
|
218
|
+
},
|
|
219
|
+
bubbles: true,
|
|
220
|
+
composed: true
|
|
221
|
+
});
|
|
222
|
+
this.dispatchEvent(keyEvent);
|
|
223
|
+
}
|
|
224
|
+
async handleKeyDown(event) {
|
|
225
|
+
await this.updateComplete;
|
|
226
|
+
const target = event.target;
|
|
227
|
+
const keyEvent = new CustomEvent("on-key-down", {
|
|
228
|
+
detail: {
|
|
229
|
+
value: target.value,
|
|
230
|
+
event
|
|
231
|
+
},
|
|
232
|
+
bubbles: true,
|
|
233
|
+
composed: true
|
|
234
|
+
});
|
|
235
|
+
this.dispatchEvent(keyEvent);
|
|
236
|
+
}
|
|
237
|
+
async handleKeyPress(event) {
|
|
238
|
+
await this.updateComplete;
|
|
239
|
+
const target = event.target;
|
|
240
|
+
const keyEvent = new CustomEvent("on-key-press", {
|
|
241
|
+
detail: {
|
|
242
|
+
value: target?.value,
|
|
243
|
+
event
|
|
244
|
+
},
|
|
245
|
+
bubbles: true,
|
|
246
|
+
composed: true
|
|
247
|
+
});
|
|
248
|
+
this.dispatchEvent(keyEvent);
|
|
249
|
+
}
|
|
250
|
+
handleMouseOver() {
|
|
251
|
+
if (!this.isReadonly && !this.isDisabled) {
|
|
252
|
+
this.hasHighlight = true;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
handleMouseOut() {
|
|
256
|
+
if (!this.hasHocus) {
|
|
257
|
+
this.hasHighlight = false;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
async handleInputClick(event) {
|
|
261
|
+
await this.updateComplete;
|
|
262
|
+
const target = event.target;
|
|
263
|
+
const clickEvent = new CustomEvent("on-input-click", {
|
|
264
|
+
detail: {
|
|
265
|
+
value: target.value,
|
|
266
|
+
event
|
|
267
|
+
},
|
|
268
|
+
bubbles: false,
|
|
269
|
+
composed: true
|
|
270
|
+
});
|
|
271
|
+
this.dispatchEvent(clickEvent);
|
|
272
|
+
}
|
|
273
|
+
render() {
|
|
274
|
+
const { wrapper, input } = this.styles({
|
|
275
|
+
hasError: this.error !== "",
|
|
276
|
+
hasHighlight: this.hasHighlight,
|
|
277
|
+
borderless: this.borderless,
|
|
278
|
+
isReadonly: this.isReadonly,
|
|
279
|
+
isDisabled: this.isDisabled,
|
|
280
|
+
isFullWidth: this.isFullWidth,
|
|
281
|
+
size: this.size,
|
|
282
|
+
isNonResizable: this.isNonResizable
|
|
283
|
+
});
|
|
284
|
+
return x`
|
|
285
|
+
<div class="w-[inherit]">
|
|
286
|
+
${this.label ? this.labelTemplate() : A}
|
|
287
|
+
${this.description ? this.descriptionTemplate() : A}
|
|
288
|
+
<div class=${wrapper()}>
|
|
289
|
+
<div class="relative w-[inherit] flex">
|
|
290
|
+
${this.inputTemplate(input())}
|
|
291
|
+
</div>
|
|
292
|
+
</div>
|
|
293
|
+
${this.error ? this.errorTemplate() : A}
|
|
294
|
+
</div>
|
|
295
|
+
`;
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
__decorateClass([
|
|
299
|
+
n({ type: String })
|
|
300
|
+
], LuksoTextarea.prototype, "value", 2);
|
|
301
|
+
__decorateClass([
|
|
302
|
+
n({ type: String })
|
|
303
|
+
], LuksoTextarea.prototype, "name", 2);
|
|
304
|
+
__decorateClass([
|
|
305
|
+
n({ type: String })
|
|
306
|
+
], LuksoTextarea.prototype, "placeholder", 2);
|
|
307
|
+
__decorateClass([
|
|
308
|
+
n({ type: String })
|
|
309
|
+
], LuksoTextarea.prototype, "label", 2);
|
|
310
|
+
__decorateClass([
|
|
311
|
+
n({ type: String })
|
|
312
|
+
], LuksoTextarea.prototype, "id", 2);
|
|
313
|
+
__decorateClass([
|
|
314
|
+
n({ type: String })
|
|
315
|
+
], LuksoTextarea.prototype, "ref", 2);
|
|
316
|
+
__decorateClass([
|
|
317
|
+
n({ type: String })
|
|
318
|
+
], LuksoTextarea.prototype, "description", 2);
|
|
319
|
+
__decorateClass([
|
|
320
|
+
n({ type: String })
|
|
321
|
+
], LuksoTextarea.prototype, "error", 2);
|
|
322
|
+
__decorateClass([
|
|
323
|
+
n({ type: String, attribute: "custom-class" })
|
|
324
|
+
], LuksoTextarea.prototype, "customClass", 2);
|
|
325
|
+
__decorateClass([
|
|
326
|
+
n({ type: Boolean, attribute: "is-full-width" })
|
|
327
|
+
], LuksoTextarea.prototype, "isFullWidth", 2);
|
|
328
|
+
__decorateClass([
|
|
329
|
+
n({ type: Boolean, attribute: "is-readonly" })
|
|
330
|
+
], LuksoTextarea.prototype, "isReadonly", 2);
|
|
331
|
+
__decorateClass([
|
|
332
|
+
n({ type: Boolean, attribute: "is-disabled" })
|
|
333
|
+
], LuksoTextarea.prototype, "isDisabled", 2);
|
|
334
|
+
__decorateClass([
|
|
335
|
+
n({ type: Boolean })
|
|
336
|
+
], LuksoTextarea.prototype, "autofocus", 2);
|
|
337
|
+
__decorateClass([
|
|
338
|
+
n({ type: Boolean })
|
|
339
|
+
], LuksoTextarea.prototype, "borderless", 2);
|
|
340
|
+
__decorateClass([
|
|
341
|
+
n({ type: Boolean, attribute: "is-non-resizable" })
|
|
342
|
+
], LuksoTextarea.prototype, "isNonResizable", 2);
|
|
343
|
+
__decorateClass([
|
|
344
|
+
n({ type: String })
|
|
345
|
+
], LuksoTextarea.prototype, "size", 2);
|
|
346
|
+
__decorateClass([
|
|
347
|
+
n({ type: Number })
|
|
348
|
+
], LuksoTextarea.prototype, "rows", 2);
|
|
349
|
+
__decorateClass([
|
|
350
|
+
t()
|
|
351
|
+
], LuksoTextarea.prototype, "hasHocus", 2);
|
|
352
|
+
__decorateClass([
|
|
353
|
+
t()
|
|
354
|
+
], LuksoTextarea.prototype, "hasHighlight", 2);
|
|
355
|
+
LuksoTextarea = __decorateClass([
|
|
356
|
+
e("lukso-textarea")
|
|
357
|
+
], LuksoTextarea);
|
|
358
|
+
|
|
359
|
+
export { LuksoTextarea };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Meta } from '@storybook/web-components';
|
|
2
|
+
/** Documentation and examples of `lukso-textarea` component. */
|
|
3
|
+
declare const meta: Meta;
|
|
4
|
+
export default meta;
|
|
5
|
+
/** Example of default textarea with `value`. */
|
|
6
|
+
export declare const DefaultInput: any;
|
|
7
|
+
/** Example of textarea with `placeholder` text. */
|
|
8
|
+
export declare const PlaceholderText: any;
|
|
9
|
+
/** Example of textarea with `label`. */
|
|
10
|
+
export declare const Label: any;
|
|
11
|
+
/** Example of textarea with `label` and `description`. */
|
|
12
|
+
export declare const LabelAndDescription: any;
|
|
13
|
+
/** Example of textarea with `error`. */
|
|
14
|
+
export declare const ErrorInput: any;
|
|
15
|
+
/** If you need textarea to take full width of the parent element add `is-full-width` property. */
|
|
16
|
+
export declare const FullWidth: any;
|
|
17
|
+
/** If you need textarea to be focused add `autofocus` property. */
|
|
18
|
+
export declare const Autofocus: any;
|
|
19
|
+
/** With `borderless` property you can render textarea without border. */
|
|
20
|
+
export declare const Borderless: any;
|
|
21
|
+
/** Example of `small` size textarea. */
|
|
22
|
+
export declare const Small: any;
|
|
23
|
+
//# sourceMappingURL=lukso-textarea.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lukso-textarea.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/lukso-textarea/lukso-textarea.stories.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,SAAS,CAAA;AAEhB,kEAAkE;AAClE,QAAA,MAAM,IAAI,EAAE,IAoNX,CAAA;AAED,eAAe,IAAI,CAAA;AAiDnB,iDAAiD;AACjD,eAAO,MAAM,YAAY,KAAoB,CAAA;AAK7C,mDAAmD;AACnD,eAAO,MAAM,eAAe,KAAoB,CAAA;AAKhD,wCAAwC;AACxC,eAAO,MAAM,KAAK,KAAoB,CAAA;AAKtC,0DAA0D;AAC1D,eAAO,MAAM,mBAAmB,KAAoB,CAAA;AAMpD,wCAAwC;AACxC,eAAO,MAAM,UAAU,KAAoB,CAAA;AAO3C,kGAAkG;AAClG,eAAO,MAAM,SAAS,KAAoB,CAAA;AAK1C,mEAAmE;AACnE,eAAO,MAAM,SAAS,KAAoB,CAAA;AAK1C,yEAAyE;AACzE,eAAO,MAAM,UAAU,KAAoB,CAAA;AAM3C,wCAAwC;AACxC,eAAO,MAAM,KAAK,KAAoB,CAAA"}
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-6e3f406c.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
|
|
7
7
|
const state = require('../../state-d9fb972b.cjs');
|
|
8
8
|
const index = require('../../index-1d3f4a5a.cjs');
|
|
9
|
-
const styleMap = require('../../style-map-
|
|
9
|
+
const styleMap = require('../../style-map-320a365c.cjs');
|
|
10
10
|
require('../../bundle-mjs-d58a83c6.cjs');
|
|
11
11
|
require('../../directive-8278ab14.cjs');
|
|
12
12
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, x } from '../../index-
|
|
1
|
+
import { T as TailwindStyledElement, x } from '../../index-9d81031f.js';
|
|
2
2
|
import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
|
|
3
3
|
import { t } from '../../state-b9ca4e74.js';
|
|
4
4
|
import { c as ce } from '../../index-ca8e900d.js';
|
|
5
|
-
import { o } from '../../style-map-
|
|
5
|
+
import { o } from '../../style-map-d014149d.js';
|
|
6
6
|
import '../../bundle-mjs-fbc6e2a8.js';
|
|
7
7
|
import '../../directive-2bb7789e.js';
|
|
8
8
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-6e3f406c.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
|
|
7
7
|
const index = require('../../index-1d3f4a5a.cjs');
|
|
8
|
-
const index$1 = require('../../index-
|
|
8
|
+
const index$1 = require('../../index-0bb73cde.cjs');
|
|
9
9
|
require('../../tailwind-config.cjs');
|
|
10
10
|
const cn = require('../../cn-5ceac001.cjs');
|
|
11
11
|
require('../../bundle-mjs-d58a83c6.cjs');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, x, A } from '../../index-
|
|
1
|
+
import { T as TailwindStyledElement, x, A } from '../../index-9d81031f.js';
|
|
2
2
|
import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
|
|
3
3
|
import { c as ce } from '../../index-ca8e900d.js';
|
|
4
|
-
import { c as customStyleMap } from '../../index-
|
|
4
|
+
import { c as customStyleMap } from '../../index-c395d033.js';
|
|
5
5
|
import '../../tailwind-config.js';
|
|
6
6
|
import { c as cn } from '../../cn-b54dcc61.js';
|
|
7
7
|
import '../../bundle-mjs-fbc6e2a8.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-6e3f406c.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
|
|
7
7
|
const directive = require('../../directive-8278ab14.cjs');
|
|
8
8
|
const index = require('../../index-1d3f4a5a.cjs');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j, b as T, T as TailwindStyledElement, x } from '../../index-
|
|
1
|
+
import { j, b as T, T as TailwindStyledElement, x } from '../../index-9d81031f.js';
|
|
2
2
|
import { n, e as e$1 } from '../../query-assigned-elements-1c8c9e90.js';
|
|
3
3
|
import { e, i, t } from '../../directive-2bb7789e.js';
|
|
4
4
|
import { c as ce } from '../../index-ca8e900d.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const shared_tailwindElement_index = require('./index-
|
|
3
|
+
const shared_tailwindElement_index = require('./index-6e3f406c.cjs');
|
|
4
4
|
const directive = require('./directive-8278ab14.cjs');
|
|
5
5
|
|
|
6
6
|
class CustomStyleMapDirective extends directive.i {
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { T as TailwindStyledElement, A, x } from './index-9d81031f.js';
|
|
2
|
+
import { n, e } from './query-assigned-elements-1c8c9e90.js';
|
|
3
|
+
import { t } from './state-b9ca4e74.js';
|
|
4
|
+
import { c as ce } from './index-ca8e900d.js';
|
|
5
|
+
import './components/lukso-icon/index.js';
|
|
6
|
+
import './components/lukso-profile/index.js';
|
|
7
|
+
import './components/lukso-username/index.js';
|
|
8
|
+
|
|
9
|
+
const style = ":host {\n display: flex;\n width: 100%\n}";
|
|
10
|
+
|
|
11
|
+
const uniqId = () => {
|
|
12
|
+
const s4 = () => ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
13
|
+
return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var __defProp = Object.defineProperty;
|
|
17
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
18
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
19
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
20
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
21
|
+
if (decorator = decorators[i])
|
|
22
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
23
|
+
if (kind && result)
|
|
24
|
+
__defProp(target, key, result);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
let LuksoDropdown = class extends TailwindStyledElement(style) {
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
this.id = "";
|
|
31
|
+
this.triggerId = "";
|
|
32
|
+
this.isOpen = false;
|
|
33
|
+
this.isOpenOnOutsideClick = false;
|
|
34
|
+
this.openTop = false;
|
|
35
|
+
this.isRight = false;
|
|
36
|
+
this.isFullWidth = false;
|
|
37
|
+
this.size = "medium";
|
|
38
|
+
this._isOpen = false;
|
|
39
|
+
this.styles = ce({
|
|
40
|
+
base: `bg-neutral-100 border w-full border-neutral-90 shadow-1xl z-50
|
|
41
|
+
flex absolute flex-col gap-1 overflow-y-auto max-h-64 `,
|
|
42
|
+
variants: {
|
|
43
|
+
openTop: {
|
|
44
|
+
true: "bottom-[48px] mb-2 mt-0"
|
|
45
|
+
},
|
|
46
|
+
size: {
|
|
47
|
+
small: "rounded-8 p-2 mt-1 min-w-[120px] paragraph-inter-12-regular",
|
|
48
|
+
medium: "rounded-12 p-3 mt-2 min-w-[200px] paragraph-inter-14-regular"
|
|
49
|
+
},
|
|
50
|
+
isRight: {
|
|
51
|
+
true: "right-0"
|
|
52
|
+
},
|
|
53
|
+
isFullWidth: {
|
|
54
|
+
true: "w-full"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
compoundVariants: [
|
|
58
|
+
{
|
|
59
|
+
isFullWidth: false,
|
|
60
|
+
size: "small",
|
|
61
|
+
class: "max-w-[200px]"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
isFullWidth: false,
|
|
65
|
+
size: "medium",
|
|
66
|
+
class: "max-w-[300px]"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
if (!this.id) {
|
|
71
|
+
this.id = uniqId();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
connectedCallback() {
|
|
75
|
+
super.connectedCallback();
|
|
76
|
+
window.addEventListener("click", this.handleClick.bind(this));
|
|
77
|
+
}
|
|
78
|
+
disconnectedCallback() {
|
|
79
|
+
super.disconnectedCallback();
|
|
80
|
+
window.removeEventListener("click", this.handleClick);
|
|
81
|
+
}
|
|
82
|
+
willUpdate(changedProperties) {
|
|
83
|
+
if (changedProperties.has("isOpen")) {
|
|
84
|
+
this._isOpen = this.isOpen;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
handleClick(event) {
|
|
88
|
+
const element = event.target;
|
|
89
|
+
if (element.id === this.triggerId || this.id === element.id) {
|
|
90
|
+
this._isOpen = !this._isOpen;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (!this.isOpenOnOutsideClick) {
|
|
94
|
+
this._isOpen = false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
render() {
|
|
98
|
+
const styles = this.styles({
|
|
99
|
+
openTop: this.openTop,
|
|
100
|
+
size: this.size,
|
|
101
|
+
isRight: this.isRight,
|
|
102
|
+
isFullWidth: this.isFullWidth
|
|
103
|
+
});
|
|
104
|
+
if (!this._isOpen) {
|
|
105
|
+
return A;
|
|
106
|
+
}
|
|
107
|
+
return x`<div class="${styles}"><slot></slot></div>`;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
__decorateClass([
|
|
111
|
+
n({ type: String })
|
|
112
|
+
], LuksoDropdown.prototype, "id", 2);
|
|
113
|
+
__decorateClass([
|
|
114
|
+
n({ type: String, attribute: "trigger-id" })
|
|
115
|
+
], LuksoDropdown.prototype, "triggerId", 2);
|
|
116
|
+
__decorateClass([
|
|
117
|
+
n({ type: Boolean, attribute: "is-open" })
|
|
118
|
+
], LuksoDropdown.prototype, "isOpen", 2);
|
|
119
|
+
__decorateClass([
|
|
120
|
+
n({ type: Boolean, attribute: "is-open-on-outside-click" })
|
|
121
|
+
], LuksoDropdown.prototype, "isOpenOnOutsideClick", 2);
|
|
122
|
+
__decorateClass([
|
|
123
|
+
n({ type: Boolean, attribute: "open-top" })
|
|
124
|
+
], LuksoDropdown.prototype, "openTop", 2);
|
|
125
|
+
__decorateClass([
|
|
126
|
+
n({ type: Boolean, attribute: "is-right" })
|
|
127
|
+
], LuksoDropdown.prototype, "isRight", 2);
|
|
128
|
+
__decorateClass([
|
|
129
|
+
n({ type: Boolean, attribute: "is-full-width" })
|
|
130
|
+
], LuksoDropdown.prototype, "isFullWidth", 2);
|
|
131
|
+
__decorateClass([
|
|
132
|
+
n({ type: String })
|
|
133
|
+
], LuksoDropdown.prototype, "size", 2);
|
|
134
|
+
__decorateClass([
|
|
135
|
+
t()
|
|
136
|
+
], LuksoDropdown.prototype, "_isOpen", 2);
|
|
137
|
+
LuksoDropdown = __decorateClass([
|
|
138
|
+
e("lukso-dropdown")
|
|
139
|
+
], LuksoDropdown);
|
|
140
|
+
|
|
141
|
+
export { LuksoDropdown as L, uniqId as u };
|