@mixd-id/web-scaffold 0.1.230406076 → 0.1.230406078

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