@mixd-id/web-scaffold 0.1.230406076 → 0.1.230406077

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.
Files changed (54) hide show
  1. package/package.json +1 -1
  2. package/src/components/Button.vue +99 -88
  3. package/src/components/Carousel.vue +169 -92
  4. package/src/components/ColorPicker.vue +1 -1
  5. package/src/components/Flex.vue +47 -1
  6. package/src/components/Grid.vue +54 -1
  7. package/src/components/Image.vue +126 -22
  8. package/src/components/PaddingBox.vue +2 -2
  9. package/src/index.js +39 -2
  10. package/src/mixin/component.js +0 -1
  11. package/src/stores/WebPageBuilder.js +37 -0
  12. package/src/utils/helpers.mjs +5 -1
  13. package/src/widgets/Banner.vue +71 -0
  14. package/src/widgets/BannerItem.vue +25 -0
  15. package/src/widgets/BannerSetting.vue +145 -0
  16. package/src/widgets/BoxItem.vue +25 -0
  17. package/src/widgets/BoxSetting.vue +45 -0
  18. package/src/widgets/ButtonGroup.vue +86 -0
  19. package/src/widgets/ButtonGroupItem.vue +25 -0
  20. package/src/widgets/ButtonGroupSetting.vue +126 -0
  21. package/src/widgets/ButtonItem.vue +25 -0
  22. package/src/widgets/ButtonSetting.vue +76 -0
  23. package/src/widgets/CarouselItem.vue +25 -0
  24. package/src/widgets/CarouselSetting.vue +169 -0
  25. package/src/widgets/ComponentSetting.vue +248 -0
  26. package/src/widgets/ContactForm.vue +114 -0
  27. package/src/widgets/ContactFormItem.vue +25 -0
  28. package/src/widgets/ContactFormSetting.vue +176 -0
  29. package/src/widgets/EmbeddedVideo.vue +100 -0
  30. package/src/widgets/EmbeddedVideoItem.vue +25 -0
  31. package/src/widgets/EmbeddedVideoSetting.vue +87 -0
  32. package/src/widgets/FAQ.vue +80 -0
  33. package/src/widgets/FAQItem.vue +25 -0
  34. package/src/widgets/FAQSetting.vue +82 -0
  35. package/src/widgets/FeatureList.vue +151 -0
  36. package/src/widgets/FeatureListItem.vue +25 -0
  37. package/src/widgets/FeatureListSetting.vue +142 -0
  38. package/src/widgets/FlexItem.vue +25 -0
  39. package/src/widgets/FlexSetting.vue +92 -0
  40. package/src/widgets/GridItem.vue +31 -0
  41. package/src/widgets/GridSetting.vue +57 -0
  42. package/src/widgets/Header.vue +57 -0
  43. package/src/widgets/HeaderItem.vue +25 -0
  44. package/src/widgets/HeaderSetting.vue +78 -0
  45. package/src/widgets/IconList.vue +110 -0
  46. package/src/widgets/IconListItem.vue +25 -0
  47. package/src/widgets/IconListSetting.vue +162 -0
  48. package/src/widgets/ImageItem.vue +35 -0
  49. package/src/widgets/ImageSetting.vue +71 -0
  50. package/src/widgets/Share.vue +99 -0
  51. package/src/widgets/ShareItem.vue +25 -0
  52. package/src/widgets/ShareSetting.vue +86 -0
  53. package/src/widgets/StyleSetting.vue +294 -0
  54. package/src/widgets/WebPageBuilder.vue +907 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mixd-id/web-scaffold",
3
3
  "private": false,
4
- "version": "0.1.230406076",
4
+ "version": "0.1.230406077",
5
5
  "scripts": {
6
6
  "dev": "vite serve",
7
7
  "build": "vite build",
@@ -1,7 +1,7 @@
1
1
  <template>
2
- <button :class="computedClass" :disabled="isDisabled">
2
+ <button :class="compClass" :disabled="isDisabled" @click="onClick">
3
3
  <div>
4
- <slot></slot>
4
+ <slot>{{ text }}</slot>
5
5
  </div>
6
6
  <div v-if="isLoading" :class="$style.loadingPane">
7
7
  <svg :class="$style.spinner" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
@@ -14,8 +14,12 @@
14
14
 
15
15
  <script>
16
16
 
17
+ import {componentMixin} from "../mixin/component";
18
+
17
19
  export default{
18
20
 
21
+ mixins: [ componentMixin ],
22
+
19
23
  props: {
20
24
 
21
25
  variant: {
@@ -23,32 +27,26 @@ export default{
23
27
  default: "primary" // primary|secondary|outline, default:primary
24
28
  },
25
29
 
26
- size: {
27
- type: [ String ],
28
- default: '' // sm|md|lg, default: md
29
- },
30
-
31
- spacing: {
32
- type: [ String, Number ],
33
- default: '' // 0|1|2|3, default: 2
34
- },
35
-
36
30
  state: {
37
31
  type: [ String, Number ], // -1:disabled, 1:normal, 2:loading, default: normal,
38
32
  default: 1
39
- }
33
+ },
34
+
35
+ text: String,
36
+
37
+ target: String,
38
+
39
+ width: Array,
40
40
 
41
41
  },
42
42
 
43
43
  computed:{
44
44
 
45
- computedClass(){
45
+ compClass(){
46
46
 
47
47
  return [
48
48
  this.$style.button,
49
- this.$style['variant-' + this.variant],
50
- this.$style['size-' + this.size],
51
- this.$style['spacing-' + this.spacing],
49
+ 'button-' + this.variant,
52
50
  parseInt(this.computedState) === 2 ? this.$style.loading : '',
53
51
  ]
54
52
  .join(' ')
@@ -64,6 +62,15 @@ export default{
64
62
 
65
63
  computedState(){
66
64
  return this._state ?? this.state
65
+ },
66
+
67
+ widths(){
68
+ if(!Array.isArray(this.width)) return []
69
+
70
+ return [
71
+ this.width[0] ?? '',
72
+ this.width[1] ? this.width[1] : (this.width[0] ?? ''),
73
+ ]
67
74
  }
68
75
 
69
76
  },
@@ -86,6 +93,12 @@ export default{
86
93
 
87
94
  resetState(){
88
95
  this._state = null
96
+ },
97
+
98
+ onClick(){
99
+ if(this.target){
100
+ this.$router.push(this.target)
101
+ }
89
102
  }
90
103
 
91
104
  }
@@ -94,161 +107,162 @@ export default{
94
107
 
95
108
  </script>
96
109
 
97
- <style module>
110
+ <style>
98
111
 
99
112
  .button{
100
- @apply h-[var(--h-cp)];
101
- @apply relative flex items-center justify-center;
102
- @apply whitespace-nowrap text-ellipsis overflow-hidden;
103
- @apply rounded-lg;
104
- }
105
- .button>*:first-child{
106
- @apply flex items-center justify-center
107
- }
108
- .button:disabled{
109
- @apply opacity-60;
110
- }
111
- .button:active{
112
- @apply top-[1px] left-[1px] relative;
113
- }
114
-
115
- .size-sm{
116
- @apply h-[var(--h-cp-sm)];
117
- }
118
- .size-lg{
119
- @apply h-[var(--h-cp-lg)];
113
+ width: v-bind(widths[0])
120
114
  }
121
115
 
122
- .variant-,
123
- .variant-primary{
116
+ .button-primary{
124
117
  @apply bg-primary-500 text-white rounded-lg;
125
118
  box-shadow: 0 2px 1px rgba(0, 0, 0, .05);
126
119
  outline: solid 1px rgb(var(--primary-700));
127
120
  border: solid 1px rgb(var(--primary-400));
128
121
  }
129
- .variant-:hover,
130
- .variant-primary:hover{
122
+ .button-primary:hover{
131
123
  @apply bg-primary-600;
132
124
  outline-color: rgb(var(--primary-800))
133
125
  }
134
- .variant-:disabled,
135
- .variant-primary:disabled{
126
+ .button-primary:disabled{
136
127
  @apply bg-primary-500 opacity-50 top-0 left-0 cursor-not-allowed;
137
128
  @apply top-0 left-0;
138
129
  outline: solid 1px rgb(var(--primary-700));
139
130
  }
140
- .variant- *,
141
- .variant-primary *{
131
+ .button-primary *{
142
132
  @apply text-white fill-white;
143
133
  }
144
- .variant-.loading *,
145
- .variant-primary.loading *{
134
+ .button-primary.loading *{
146
135
  @apply fill-transparent
147
136
  }
148
- .variant- .svgBg,
149
- .variant-primary .svgBg{
137
+ .button-primary .svgBg{
150
138
  stroke: #fff;
151
139
  stroke-opacity: 25%;
152
140
  }
153
- .variant- .svgHg,
154
- .variant-primary .svgHg{
141
+ .button-primary .svgHg{
155
142
  fill: #fff;
156
143
  fill-opacity: 75%;
157
144
  }
158
145
 
159
- .variant-outline{
146
+ .button-outline{
160
147
  @apply bg-transparent text-primary-500;
161
148
  outline: solid 1px rgb(var(--primary-700));
162
149
  }
163
- .variant-outline:hover{
150
+ .button-outline:hover{
164
151
  outline-color: rgb(var(--primary-800))
165
152
  }
166
- .variant-outline:disabled{
153
+ .button-outline:disabled{
167
154
  @apply opacity-50 top-0 left-0 cursor-not-allowed;
168
155
  @apply text-text border-primary-500;
169
156
  }
170
- .variant-outline *{
157
+ .button-outline *{
171
158
  @apply text-primary-500 fill-primary-500;
172
159
  }
173
- .variant-outline.loading *{
160
+ .button-outline.loading *{
174
161
  @apply fill-transparent
175
162
  }
176
- .variant-outline .svgBg{
163
+ .button-outline .svgBg{
177
164
  stroke: rgb(var(--primary-600));
178
165
  stroke-opacity: 50%;
179
166
  }
180
- .variant-outline .svgHg{
167
+ .button-outline .svgHg{
181
168
  fill: rgb(var(--primary));
182
169
  fill-opacity: 100%;
183
170
  }
184
171
 
185
- .variant-secondary{
172
+ .button-secondary{
186
173
  @apply bg-secondary text-text-500 rounded-lg;
187
174
  box-shadow: 0 2px 1px rgba(0, 0, 0, .05);
188
175
  outline: solid 1px rgb(var(--secondary-700));
189
176
  border: solid 1px rgb(var(--secondary-400));
190
177
  }
191
- .variant-secondary:hover{
178
+ .button-secondary:hover{
192
179
  @apply bg-secondary-600;
193
180
  outline-color: rgb(var(--secondary-800))
194
181
  }
195
- .variant-secondary:disabled{
182
+ .button-secondary:disabled{
196
183
  @apply bg-secondary-500 opacity-50 top-0 left-0 cursor-not-allowed;
197
184
  outline: solid 1px rgb(var(--secondary-700));
198
185
  }
199
- .variant-secondary *{
186
+ .button-secondary *{
200
187
  @apply text-text-500 fill-white;
201
188
  }
202
- .variant-secondary.loading *{
189
+ .button-secondary.loading *{
203
190
  @apply fill-transparent
204
191
  }
205
- .variant-secondary .svgBg{
192
+ .button-secondary .svgBg{
206
193
  stroke: rgb(var(--text-400));
207
194
  stroke-opacity: 25%;
208
195
  }
209
- .variant-secondary .svgHg{
196
+ .button-secondary .svgHg{
210
197
  fill: rgb(var(--text-500));
211
198
  fill-opacity: 75%;
212
199
  }
213
200
 
214
- .variant-red{
201
+ .button-red{
215
202
  @apply bg-red-500 text-white rounded-md border-[2px] border-red-500;
216
203
  }
217
- .variant-red:hover{
204
+ .button-red:hover{
218
205
  @apply bg-red-600 border-red-600;
219
206
  }
220
- .variant-red:disabled{
207
+ .button-red:disabled{
221
208
  @apply bg-red-500 border-red-500 opacity-50 top-0 left-0 cursor-not-allowed;
222
209
  }
223
- .variant-red *{
210
+ .button-red *{
224
211
  @apply text-white fill-white;
225
212
  }
226
- .variant-red.loading *{
213
+ .button-red.loading *{
227
214
  @apply fill-transparent
228
215
  }
229
- .variant-red .svgBg{
216
+ .button-red .svgBg{
230
217
  @apply stroke-red-400;
231
218
  stroke-opacity: 50%;
232
219
  }
233
- .variant-red .svgHg{
220
+ .button-red .svgHg{
234
221
  @apply fill-text-500;
235
222
  fill-opacity: 100%;
236
223
  }
237
224
 
238
- .variant-minimal{
225
+ .button-minimal{
239
226
  @apply border-[2px] border-transparent;
240
227
  }
241
- .variant-minimal:hover{
228
+ .button-minimal:hover{
242
229
  }
243
- .variant-minimal .svgBg{
230
+ .button-minimal .svgBg{
244
231
  stroke: rgb(var(--text-500));
245
232
  stroke-opacity: 25%;
246
233
  }
247
- .variant-minimal .svgHg{
234
+ .button-minimal .svgHg{
248
235
  fill: rgb(var(--text));
249
236
  fill-opacity: 75%;
250
237
  }
251
238
 
239
+ </style>
240
+
241
+ <style module>
242
+
243
+ .button{
244
+ @apply h-[var(--h-cp)];
245
+ @apply relative flex items-center justify-center;
246
+ @apply whitespace-nowrap text-ellipsis overflow-hidden;
247
+ @apply rounded-lg;
248
+ }
249
+ .button>*:first-child{
250
+ @apply flex items-center justify-center
251
+ }
252
+ .button:disabled{
253
+ @apply opacity-60;
254
+ }
255
+ .button:active{
256
+ @apply top-[1px] left-[1px] relative;
257
+ }
258
+
259
+ .size-sm{
260
+ @apply h-[var(--h-cp-sm)];
261
+ }
262
+ .size-lg{
263
+ @apply h-[var(--h-cp-lg)];
264
+ }
265
+
252
266
  .loadingPane{
253
267
  @apply absolute left-0 top-0 right-0 bottom-0 flex items-center justify-center pl-1;
254
268
  }
@@ -267,19 +281,16 @@ export default{
267
281
  opacity: 1;
268
282
  }
269
283
 
270
- .spacing-,
271
- .spacing-2{
272
- @apply p-2
273
- }
274
- .spacing-1{
275
- @apply p-1
276
- }
277
- .spacing-3{
278
- @apply p-3
279
- }
280
-
281
284
  .spinner{
282
285
  @apply animate-spin h-5 w-5;
283
286
  }
284
287
 
288
+ @media screen and (min-width: 768px){
289
+
290
+ .button{
291
+ width: v-bind(widths[1])
292
+ }
293
+
294
+ }
295
+
285
296
  </style>