@mixd-id/web-scaffold 0.1.240411031 → 0.1.240411032
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/package.json +1 -1
- package/src/components/ArrayList.vue +49 -0
- package/src/components/Button.vue +60 -170
- package/src/components/List.vue +1 -1
- package/src/components/Textbox.vue +6 -12
- package/src/index.js +1 -0
- package/src/themes/default/index.js +1 -1
- package/tailwind.config.js +1 -35
package/package.json
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :class="$style.comp">
|
|
3
|
+
<div class="flex-1 flex flex-row flex-wrap gap-1">
|
|
4
|
+
<div v-for="item in items">
|
|
5
|
+
<slot name="default" :item="item">
|
|
6
|
+
<div :class="$style.item">
|
|
7
|
+
{{ item.name }}
|
|
8
|
+
|
|
9
|
+
<button type="button" @click="$emit('remove', item)">
|
|
10
|
+
<svg width="11" height="11" class="fill-text-300 hover:fill-red-500" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M310.6 361.4c12.5 12.5 12.5 32.75 0 45.25C304.4 412.9 296.2 416 288 416s-16.38-3.125-22.62-9.375L160 301.3L54.63 406.6C48.38 412.9 40.19 416 32 416S15.63 412.9 9.375 406.6c-12.5-12.5-12.5-32.75 0-45.25l105.4-105.4L9.375 150.6c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0L160 210.8l105.4-105.4c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25l-105.4 105.4L310.6 361.4z"/></svg>
|
|
11
|
+
</button>
|
|
12
|
+
</div>
|
|
13
|
+
</slot>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
<button type="button" class="p-2" @click="$emit('add')">
|
|
17
|
+
<svg width="14" height="14" class="fill-text-300 hover:fill-text" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.0.0-alpha3 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) --><path d="M64 192C28.61 192 0 220.6 0 256s28.61 64 64 64s64-28.62 64-64S99.39 192 64 192zM256 192C220.6 192 192 220.6 192 256s28.61 64 64 64s64-28.62 64-64S291.4 192 256 192zM448 192c-35.39 0-64 28.62-64 64s28.61 64 64 64s64-28.62 64-64S483.4 192 448 192z"/></svg>
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
|
|
24
|
+
export default{
|
|
25
|
+
|
|
26
|
+
emits: [ 'add', 'remove' ],
|
|
27
|
+
|
|
28
|
+
props: {
|
|
29
|
+
items: Array
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style module>
|
|
37
|
+
|
|
38
|
+
.comp{
|
|
39
|
+
@apply min-w-[200px] p-1;
|
|
40
|
+
@apply border-[1px] border-text-200 bg-base-300 hover:border-text-300 rounded-lg;
|
|
41
|
+
@apply flex flex-row items-start flex-nowrap;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.item{
|
|
45
|
+
@apply border-[1px] border-text-200 hover:border-text-300 rounded-lg p-1 px-2;
|
|
46
|
+
@apply flex flex-row items-center gap-2;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
</style>
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
<button :class="compClass" @click="onClick" :style="computedStyle"
|
|
3
3
|
v-tooltip="disabledText" :disabled="isDisabled">
|
|
4
4
|
<slot>{{ text }}</slot>
|
|
5
|
-
<
|
|
6
|
-
<svg
|
|
5
|
+
<span v-if="isLoading" :class="$style.spinner">
|
|
6
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
7
7
|
<circle :class="$style.svgBg" cx="12" cy="12" r="10" stroke-width="4"></circle>
|
|
8
8
|
<path :class="$style.svgHg" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
|
|
9
9
|
</svg>
|
|
10
|
-
</
|
|
10
|
+
</span>
|
|
11
11
|
</button>
|
|
12
12
|
</template>
|
|
13
13
|
|
|
@@ -39,8 +39,6 @@ export default{
|
|
|
39
39
|
|
|
40
40
|
targetType: String,
|
|
41
41
|
|
|
42
|
-
width: Array,
|
|
43
|
-
|
|
44
42
|
disabledText: String
|
|
45
43
|
|
|
46
44
|
},
|
|
@@ -52,9 +50,8 @@ export default{
|
|
|
52
50
|
return [
|
|
53
51
|
this.$style.button,
|
|
54
52
|
this.$style['button-' + this.variant],
|
|
55
|
-
this.isDisabled ? this.$style['button-disabled'] : '',
|
|
56
|
-
this.
|
|
57
|
-
parseInt(this.computedState) === 2 ? this.$style.loading : ''
|
|
53
|
+
this.isDisabled ? `${this.$style['button-disabled'] ?? ''}` + ' ' + `${this.$style['button-' + this.variant + '-disabled'] ?? ''}` : '',
|
|
54
|
+
this.isLoading ? `${this.$style['button-loading'] ?? ''}` + ' ' + `${this.$style['button-' + this.variant + '-loading'] ?? ''}` : ''
|
|
58
55
|
]
|
|
59
56
|
.filter(_ => _)
|
|
60
57
|
.join(' ')
|
|
@@ -70,15 +67,6 @@ export default{
|
|
|
70
67
|
|
|
71
68
|
computedState() {
|
|
72
69
|
return this._state ?? this.state
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
widths() {
|
|
76
|
-
if (!Array.isArray(this.width)) return ['', '']
|
|
77
|
-
|
|
78
|
-
return [
|
|
79
|
-
this.width[0] ?? '',
|
|
80
|
-
this.width[1] ? this.width[1] : (this.width[0] ?? ''),
|
|
81
|
-
]
|
|
82
70
|
}
|
|
83
71
|
|
|
84
72
|
},
|
|
@@ -95,7 +83,7 @@ export default{
|
|
|
95
83
|
this.$el.focus()
|
|
96
84
|
},
|
|
97
85
|
|
|
98
|
-
setState(state
|
|
86
|
+
setState(state) {
|
|
99
87
|
this._state = state
|
|
100
88
|
},
|
|
101
89
|
|
|
@@ -148,197 +136,99 @@ export default{
|
|
|
148
136
|
|
|
149
137
|
<style module>
|
|
150
138
|
|
|
151
|
-
.button
|
|
152
|
-
@apply p-2;
|
|
153
|
-
@apply
|
|
154
|
-
@apply
|
|
155
|
-
@apply
|
|
139
|
+
.button{
|
|
140
|
+
@apply p-2 rounded-lg relative whitespace-nowrap text-ellipsis overflow-hidden min-h-7;
|
|
141
|
+
@apply border-[1px];
|
|
142
|
+
@apply active:top-[1px] active:left-[1px] disabled:top-0 disabled:left-0;
|
|
143
|
+
@apply cursor-pointer disabled:cursor-not-allowed disabled:text-opacity-60;
|
|
156
144
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
@apply flex items-center justify-center
|
|
145
|
+
.button:disabled svg{
|
|
146
|
+
@apply opacity-50;
|
|
160
147
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
@apply text-opacity-50;
|
|
148
|
+
.button-loading{
|
|
149
|
+
@apply !text-opacity-0;
|
|
164
150
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
@apply top-[1px] left-[1px] relative;
|
|
151
|
+
.button-loading>label{
|
|
152
|
+
@apply hidden;
|
|
168
153
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
@apply bg-primary-500 text-white rounded-lg;
|
|
172
|
-
@apply hover:bg-primary-600 focus:border-primary-300;
|
|
173
|
-
box-shadow: 0 2px 1px rgba(0, 0, 0, .05);
|
|
174
|
-
border: solid 1px rgb(var(--primary-500));
|
|
154
|
+
.button>label{
|
|
155
|
+
@apply pointer-events-none;
|
|
175
156
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
.button-primary-disabled:hover {
|
|
179
|
-
@apply bg-primary-300 border-primary-300 top-0 left-0 cursor-not-allowed text-opacity-50;
|
|
180
|
-
@apply top-0 left-0;
|
|
157
|
+
.spinner{
|
|
158
|
+
@apply absolute top-0 left-0 right-0 bottom-0 flex items-center justify-center;
|
|
181
159
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
@apply text-white fill-white;
|
|
160
|
+
.spinner svg{
|
|
161
|
+
@apply fill-text animate-spin w-5 h-5;
|
|
185
162
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
@apply fill-transparent
|
|
163
|
+
.svgBg{
|
|
164
|
+
@apply stroke-text-50 fill-transparent;
|
|
189
165
|
}
|
|
190
166
|
|
|
191
|
-
.button-primary
|
|
167
|
+
.button-primary{
|
|
168
|
+
@apply bg-primary border-primary text-white;
|
|
169
|
+
@apply hover:bg-primary-600 hover:border-primary-600 disabled:bg-primary;
|
|
170
|
+
}
|
|
171
|
+
.button-primary .svgBg{
|
|
192
172
|
stroke: #fff;
|
|
193
173
|
stroke-opacity: 25%;
|
|
194
174
|
}
|
|
195
|
-
|
|
196
175
|
.button-primary .svgHg {
|
|
197
176
|
fill: #fff;
|
|
198
177
|
fill-opacity: 75%;
|
|
199
178
|
}
|
|
200
179
|
|
|
201
|
-
.button-
|
|
202
|
-
@apply bg-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
.button-outline:hover {
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.button-outline-disabled,
|
|
209
|
-
.button-outline-disabled:hover {
|
|
210
|
-
@apply top-0 left-0 cursor-not-allowed;
|
|
211
|
-
@apply text-text border-primary-500 text-opacity-50;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.button-outline * {
|
|
215
|
-
@apply text-primary-500 fill-primary-500;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.button-outline.loading * {
|
|
219
|
-
@apply fill-transparent
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.button-outline .svgBg {
|
|
223
|
-
stroke: rgb(var(--primary-600));
|
|
224
|
-
stroke-opacity: 50%;
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
.button-outline .svgHg {
|
|
228
|
-
fill: rgb(var(--primary-500));
|
|
229
|
-
fill-opacity: 100%;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
.button-secondary {
|
|
233
|
-
@apply bg-secondary-500 border-secondary-500 text-primary-700 rounded-lg text-white;
|
|
234
|
-
border: solid 1px rgb(var(--secondary-500));
|
|
180
|
+
.button-secondary{
|
|
181
|
+
@apply bg-secondary border-secondary text-white;
|
|
182
|
+
@apply hover:bg-secondary-600 hover:border-secondary-600;
|
|
235
183
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
@apply bg-secondary-600 border-secondary-600;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
.button-secondary-disabled,
|
|
242
|
-
.button-secondary-disabled:hover {
|
|
243
|
-
@apply bg-secondary-400 border-secondary-400 cursor-not-allowed text-opacity-50;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.button-secondary * {
|
|
247
|
-
@apply text-text-500 fill-white;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.button-secondary.loading * {
|
|
251
|
-
@apply fill-transparent
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.button-secondary .svgBg {
|
|
255
|
-
stroke: rgb(var(--text-400));
|
|
184
|
+
.button-secondary .svgBg{
|
|
185
|
+
stroke: #fff;
|
|
256
186
|
stroke-opacity: 25%;
|
|
257
187
|
}
|
|
258
|
-
|
|
259
188
|
.button-secondary .svgHg {
|
|
260
|
-
fill:
|
|
189
|
+
fill: #fff;
|
|
261
190
|
fill-opacity: 75%;
|
|
262
191
|
}
|
|
263
192
|
|
|
264
|
-
.button-
|
|
265
|
-
@apply bg-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
.button-red:hover {
|
|
269
|
-
@apply bg-red-600 border-red-600;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
.button-red-disabled,
|
|
273
|
-
.button-red-disabled:hover {
|
|
274
|
-
@apply bg-red-500 border-red-500 top-0 left-0 cursor-not-allowed text-opacity-50;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
.button-red * {
|
|
278
|
-
@apply text-white fill-white;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.button-red.loading * {
|
|
282
|
-
@apply fill-transparent
|
|
193
|
+
.button-outline{
|
|
194
|
+
@apply border-primary bg-transparent text-white;
|
|
195
|
+
@apply hover:bg-transparent hover:border-primary-600;
|
|
283
196
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
stroke-opacity: 50%;
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
.button-red .svgHg {
|
|
291
|
-
@apply fill-text-500;
|
|
292
|
-
fill-opacity: 100%;
|
|
197
|
+
.button-outline .svgBg{
|
|
198
|
+
stroke: #fff;
|
|
199
|
+
stroke-opacity: 25%;
|
|
293
200
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
201
|
+
.button-outline .svgHg {
|
|
202
|
+
fill: #fff;
|
|
203
|
+
fill-opacity: 75%;
|
|
297
204
|
}
|
|
298
205
|
|
|
299
|
-
.button-minimal
|
|
206
|
+
.button-minimal{
|
|
207
|
+
@apply border-transparent bg-transparent text-white;
|
|
208
|
+
@apply hover:bg-transparent hover:border-transparent;
|
|
300
209
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
stroke: rgb(var(--text-500));
|
|
210
|
+
.button-minimal .svgBg{
|
|
211
|
+
stroke: #fff;
|
|
304
212
|
stroke-opacity: 25%;
|
|
305
213
|
}
|
|
306
|
-
|
|
307
214
|
.button-minimal .svgHg {
|
|
308
|
-
fill:
|
|
215
|
+
fill: #fff;
|
|
309
216
|
fill-opacity: 75%;
|
|
310
217
|
}
|
|
311
218
|
|
|
312
|
-
.
|
|
313
|
-
@apply
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
.loading {
|
|
317
|
-
color: transparent;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.loading > *:first-child {
|
|
321
|
-
@apply opacity-0
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
.loading:hover {
|
|
219
|
+
.button-red{
|
|
220
|
+
@apply bg-red-500 border-red-500 text-white;
|
|
221
|
+
@apply hover:bg-red-600 hover:border-red-600 disabled:bg-red-600;
|
|
325
222
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
.loading > * {
|
|
332
|
-
opacity: 0;
|
|
223
|
+
.button-red .svgBg{
|
|
224
|
+
stroke: #fff;
|
|
225
|
+
stroke-opacity: 25%;
|
|
333
226
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
opacity:
|
|
227
|
+
.button-red .svgHg {
|
|
228
|
+
fill: #fff;
|
|
229
|
+
fill-opacity: 75%;
|
|
337
230
|
}
|
|
338
231
|
|
|
339
|
-
.spinner {
|
|
340
|
-
@apply animate-spin h-5 w-5;
|
|
341
|
-
}
|
|
342
232
|
|
|
343
233
|
</style>
|
|
344
234
|
|
package/src/components/List.vue
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
:preset="preset"
|
|
36
36
|
:presetSelector="$refs.presetSelector"
|
|
37
37
|
:compPrefix="compPrefix">
|
|
38
|
-
<div class="flex flex-col md:flex-row gap-3 md:items-start overflow-hidden
|
|
38
|
+
<div class="flex flex-col md:flex-row gap-3 md:items-start overflow-hidden p-3 md:p-0 panel-400 md:panel-none border-b-[1px] border-text-50 md:border-none"
|
|
39
39
|
:class="headerClass">
|
|
40
40
|
|
|
41
41
|
<div class="flex md:flex-1 flex-row items-start gap-3">
|
|
@@ -182,24 +182,18 @@ export default{
|
|
|
182
182
|
|
|
183
183
|
.textbox{
|
|
184
184
|
@apply flex items-center;
|
|
185
|
-
@apply border-[1px] border-text-200 bg-base-300 rounded-lg;
|
|
185
|
+
@apply border-[1px] border-text-200 bg-base-300 hover:border-text-300 rounded-lg;
|
|
186
186
|
@apply overflow-hidden;
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
|
|
188
|
+
.textbox.active{
|
|
189
|
+
@apply !border-primary-600
|
|
190
190
|
}
|
|
191
|
-
|
|
192
|
-
.size-sm input{ @apply text-sm; }
|
|
193
|
-
|
|
194
|
-
|
|
195
191
|
.textbox>input{
|
|
196
|
-
|
|
197
|
-
|
|
192
|
+
@apply flex-1 outline-none p-2 bg-transparent;
|
|
193
|
+
font-size: inherit;
|
|
198
194
|
}
|
|
199
195
|
|
|
200
|
-
.
|
|
201
|
-
@apply border-primary
|
|
202
|
-
}
|
|
196
|
+
.size-sm input{ @apply text-sm; }
|
|
203
197
|
|
|
204
198
|
.state--2{
|
|
205
199
|
@apply border-red-500
|
package/src/index.js
CHANGED
|
@@ -442,6 +442,7 @@ export default{
|
|
|
442
442
|
app.component('Ahref', defineAsyncComponent(() => import("./components/Ahref.vue")))
|
|
443
443
|
app.component('Paragraph', defineAsyncComponent(() => import("./components/Paragraph.vue")))
|
|
444
444
|
app.component('Alert', defineAsyncComponent(() => import("./components/Alert.vue")))
|
|
445
|
+
app.component('ArrayList', defineAsyncComponent(() => import("./components/ArrayList.vue")))
|
|
445
446
|
app.component('Article', defineAsyncComponent(() => import("./components/Article.vue")))
|
|
446
447
|
app.component('Block', defineAsyncComponent(() => import("./components/Block.vue")))
|
|
447
448
|
app.component('Button', defineAsyncComponent(() => import("./components/Button.vue")))
|
|
@@ -109,7 +109,7 @@ const plugin = Plugin(function({ addBase, addUtilities, config, theme }) {
|
|
|
109
109
|
'text-rendering': 'optimizeLegibility',
|
|
110
110
|
'fontSize': '15px',
|
|
111
111
|
'touchAction': "pan-x pan-y",
|
|
112
|
-
'backgroundColor': 'rgb(var(--base-500))'
|
|
112
|
+
'backgroundColor': 'rgb(var(--base-500))'
|
|
113
113
|
},
|
|
114
114
|
|
|
115
115
|
'@media screen and (orientation: portrait)': {
|
package/tailwind.config.js
CHANGED
|
@@ -9,7 +9,7 @@ module.exports = {
|
|
|
9
9
|
plugins: [
|
|
10
10
|
/*require('@tailwindcss/line-clamp'),*/
|
|
11
11
|
/*require('@mixd-id/web-scaffold/themes/default'),*/
|
|
12
|
-
require('./src/views/themes')
|
|
12
|
+
require('./src/views/themes/default')
|
|
13
13
|
],
|
|
14
14
|
|
|
15
15
|
safelist: [
|
|
@@ -476,40 +476,6 @@ module.exports = {
|
|
|
476
476
|
|
|
477
477
|
theme: {
|
|
478
478
|
extend: {
|
|
479
|
-
height: {
|
|
480
|
-
'10vh': '10vh',
|
|
481
|
-
'20vh': '20vh',
|
|
482
|
-
'30vh': '30vh',
|
|
483
|
-
'40vh': '40vh',
|
|
484
|
-
'50vh': '50vh',
|
|
485
|
-
'60vh': '60vh',
|
|
486
|
-
'70vh': '70vh',
|
|
487
|
-
'80vh': '80vh',
|
|
488
|
-
'90vh': '90vh',
|
|
489
|
-
'100vh': '100vh',
|
|
490
|
-
},
|
|
491
|
-
backgroundSize: {
|
|
492
|
-
'50%': '50%',
|
|
493
|
-
'40%': '40%',
|
|
494
|
-
'30%': '30%',
|
|
495
|
-
'20%': '20%',
|
|
496
|
-
'10%': '10%',
|
|
497
|
-
},
|
|
498
|
-
minWidth: {
|
|
499
|
-
'0': '0',
|
|
500
|
-
'1/12': '8%',
|
|
501
|
-
'2/12': '16%',
|
|
502
|
-
'3/12': '25%',
|
|
503
|
-
'4/12': '33%',
|
|
504
|
-
'5/12': '41%',
|
|
505
|
-
'6/12': '50%',
|
|
506
|
-
'7/12': '58%',
|
|
507
|
-
'8/12': '66%',
|
|
508
|
-
'9/12': '75%',
|
|
509
|
-
'10/12': '83%',
|
|
510
|
-
'11/12': '91%',
|
|
511
|
-
'full': '100%',
|
|
512
|
-
}
|
|
513
479
|
}
|
|
514
480
|
}
|
|
515
481
|
}
|