@avakhula/ui 0.0.11 → 0.0.12
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 +14 -12
- package/src/App.vue +21 -18
- package/src/assets/scss/variables/colors.json +418 -0
- package/src/assets/scss/variables/shadows.json +58 -0
- package/src/components/Alert/Alert.stories.js +29 -21
- package/src/components/Alert/readme.mdx +0 -1
- package/src/components/Badge/readme.mdx +3 -6
- package/src/components/Button/Button.stories.js +18 -2
- package/src/components/Button/readme.mdx +11 -33
- package/src/components/ButtonGroup/readme.mdx +2 -4
- package/src/components/Dropdown/readme.mdx +2 -3
- package/src/components/Modal/Modal.vue +14 -11
- package/src/components/Modal/readme.mdx +2 -1
- package/src/components/TreeSelect/Select.vue +14 -1
- package/src/components/TreeSelect/scss/select.scss +6 -1
- package/src/main.js +1 -2
- package/src/scripts/parseScssVariables.js +80 -0
- package/src/stories/variables/colors.stories.js +25 -0
- package/src/stories/variables/shadows.stories.js +25 -0
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avakhula/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"main": "dist/index.umd.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"source": "src/index.js",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"private": false,
|
|
7
9
|
"publishConfig": {
|
|
8
10
|
"access": "public",
|
|
9
11
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -27,16 +29,16 @@
|
|
|
27
29
|
"@babel/core": "^7.20.7",
|
|
28
30
|
"@babel/preset-env": "^7.21.4",
|
|
29
31
|
"@rushstack/eslint-patch": "^1.1.4",
|
|
30
|
-
"@storybook/addon-a11y": "^7.0.
|
|
31
|
-
"@storybook/addon-actions": "^7.0.
|
|
32
|
-
"@storybook/addon-docs": "^7.0.
|
|
33
|
-
"@storybook/addon-essentials": "^7.0.
|
|
34
|
-
"@storybook/addon-interactions": "^7.0.
|
|
35
|
-
"@storybook/addon-links": "^7.0.
|
|
36
|
-
"@storybook/addon-mdx-gfm": "^7.0.
|
|
37
|
-
"@storybook/testing-library": "^0.0
|
|
38
|
-
"@storybook/vue3": "^7.0.
|
|
39
|
-
"@storybook/vue3-vite": "^7.0.
|
|
32
|
+
"@storybook/addon-a11y": "^7.0.9",
|
|
33
|
+
"@storybook/addon-actions": "^7.0.9",
|
|
34
|
+
"@storybook/addon-docs": "^7.0.9",
|
|
35
|
+
"@storybook/addon-essentials": "^7.0.9",
|
|
36
|
+
"@storybook/addon-interactions": "^7.0.9",
|
|
37
|
+
"@storybook/addon-links": "^7.0.9",
|
|
38
|
+
"@storybook/addon-mdx-gfm": "^7.0.9",
|
|
39
|
+
"@storybook/testing-library": "^0.1.0",
|
|
40
|
+
"@storybook/vue3": "^7.0.9",
|
|
41
|
+
"@storybook/vue3-vite": "^7.0.9",
|
|
40
42
|
"@vitejs/plugin-vue": "^4.0.0",
|
|
41
43
|
"@vitest/coverage-c8": "^0.28.4",
|
|
42
44
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
@@ -54,7 +56,7 @@
|
|
|
54
56
|
"react-dom": "^18.2.0",
|
|
55
57
|
"sass": "^1.57.1",
|
|
56
58
|
"sass-loader": "^13.2.0",
|
|
57
|
-
"storybook": "^7.0.
|
|
59
|
+
"storybook": "^7.0.9",
|
|
58
60
|
"vite": "^4.0.0",
|
|
59
61
|
"vitest": "^0.28.4",
|
|
60
62
|
"vue-loader": "^16.8.3",
|
package/src/App.vue
CHANGED
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<button @click="onClick">
|
|
3
|
-
test
|
|
4
|
-
</button>
|
|
5
2
|
|
|
6
|
-
<
|
|
3
|
+
<button @click="active = !active">test</button>
|
|
4
|
+
<ib-modal :active="active" @close="onClose">
|
|
7
5
|
<template #body>
|
|
8
6
|
test
|
|
9
7
|
</template>
|
|
10
8
|
</ib-modal>
|
|
11
|
-
|
|
12
9
|
</template>
|
|
13
10
|
|
|
14
11
|
<script>
|
|
15
|
-
import IbModal from "./components/Modal/Modal.vue"
|
|
12
|
+
import IbModal from "./components/Modal/Modal.vue";
|
|
16
13
|
|
|
17
14
|
export default {
|
|
18
|
-
components: {
|
|
19
|
-
IbModal,
|
|
20
|
-
},
|
|
15
|
+
components: { IbModal },
|
|
21
16
|
data() {
|
|
22
17
|
return {
|
|
23
|
-
active:
|
|
18
|
+
active: false
|
|
24
19
|
};
|
|
25
20
|
},
|
|
26
21
|
methods: {
|
|
27
|
-
onClick() {
|
|
28
|
-
this.active = true;
|
|
29
|
-
},
|
|
30
|
-
|
|
31
22
|
onClose() {
|
|
32
|
-
console.log(
|
|
33
|
-
this.active =
|
|
23
|
+
console.log('called OnClose')
|
|
24
|
+
this.active = !this.active
|
|
34
25
|
}
|
|
35
26
|
},
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
watch: {
|
|
28
|
+
active(val, oldVal) {
|
|
29
|
+
console.log("active has ben changet")
|
|
30
|
+
|
|
31
|
+
if(val) {
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
this.active = false
|
|
34
|
+
}, 5000)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
</script>
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "$blue-900",
|
|
4
|
+
"value": "#0057C2"
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"name": "$blue-800",
|
|
8
|
+
"value": "#0060D6"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "$blue-700",
|
|
12
|
+
"value": "#0369E8"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "$blue-600",
|
|
16
|
+
"value": "#0085FC"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "$blue-500",
|
|
20
|
+
"value": "#0093FF"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "$blue-400",
|
|
24
|
+
"value": "#23A3FF"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "$blue-300",
|
|
28
|
+
"value": "#A6CEFF"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "$blue-200",
|
|
32
|
+
"value": "#D9EAFF"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "$blue-100",
|
|
36
|
+
"value": "#ECF4FF"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "$blue-50",
|
|
40
|
+
"value": "#F2F5FE"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "$gray-900",
|
|
44
|
+
"value": "#3B424B"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "$gray-800",
|
|
48
|
+
"value": "#4A5561"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "$gray-700",
|
|
52
|
+
"value": "#5A6877"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "$gray-600",
|
|
56
|
+
"value": "#677788"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "$gray-500",
|
|
60
|
+
"value": "#8296AB"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "$gray-400",
|
|
64
|
+
"value": "#B3C2D3"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "$gray-300",
|
|
68
|
+
"value": "#CFD5E7"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "$gray-200",
|
|
72
|
+
"value": "#E7EAF3"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "$gray-100",
|
|
76
|
+
"value": "#F2F3F5"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"name": "$gray-50",
|
|
80
|
+
"value": "#F8F9FC"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "$white",
|
|
84
|
+
"value": "#FFFFFF"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "$white-t20",
|
|
88
|
+
"value": "rgba(255, 255, 255, 0.20)"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "$black",
|
|
92
|
+
"value": "#000000"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "$black-t20",
|
|
96
|
+
"value": "rgba(0, 0, 0, 0.20)"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"name": "$neutral-900",
|
|
100
|
+
"value": "#1A1A1A"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"name": "$neutral-800",
|
|
104
|
+
"value": "#3A3A3A"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "$neutral-700",
|
|
108
|
+
"value": "#595959"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "$neutral-600",
|
|
112
|
+
"value": "#606060"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"name": "$neutral-500",
|
|
116
|
+
"value": "#B2B2B2"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"name": "$neutral-400",
|
|
120
|
+
"value": "#B4B4B4"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"name": "$neutral-300",
|
|
124
|
+
"value": "#D8D8D8"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"name": "$neutral-200",
|
|
128
|
+
"value": "#E8E8E8"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"name": "$neutral-100",
|
|
132
|
+
"value": "#F2F2F2"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "$neutral-50",
|
|
136
|
+
"value": "#F9F9F9"
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"name": "$red-900",
|
|
140
|
+
"value": "#B9091F"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"name": "$red-800",
|
|
144
|
+
"value": "#C8182E"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "$red-700",
|
|
148
|
+
"value": "#D91A33"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"name": "$red-600",
|
|
152
|
+
"value": "#E72C3A"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "$red-500",
|
|
156
|
+
"value": "#F6363B"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "$red-400",
|
|
160
|
+
"value": "#F04B55"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "$red-300",
|
|
164
|
+
"value": "#E66F76"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "$red-200",
|
|
168
|
+
"value": "#EF989C"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "$red-100",
|
|
172
|
+
"value": "#FFE9E9"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"name": "$red-50",
|
|
176
|
+
"value": "#FFF5F2"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"name": "$purple-900",
|
|
180
|
+
"value": "#2D00B9"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
"name": "$purple-800",
|
|
184
|
+
"value": "#4A00C2"
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"name": "$purple-700",
|
|
188
|
+
"value": "#5A0CC8"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"name": "$purple-600",
|
|
192
|
+
"value": "#6919D0"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"name": "$purple-500",
|
|
196
|
+
"value": "#7800D6"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "$purple-400",
|
|
200
|
+
"value": "#990BF0"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"name": "$purple-300",
|
|
204
|
+
"value": "#A06CE4"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"name": "$purple-200",
|
|
208
|
+
"value": "#BB98EB"
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "$purple-100",
|
|
212
|
+
"value": "#D6C1F3"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "$purple-50",
|
|
216
|
+
"value": "#F0E6FA"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"name": "$yellow-900",
|
|
220
|
+
"value": "#ED7A00"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "$yellow-800",
|
|
224
|
+
"value": "#F0A30C"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"name": "$yellow-700",
|
|
228
|
+
"value": "#F1BC19"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
"name": "$yellow-600",
|
|
232
|
+
"value": "#F2D323"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "$yellow-500",
|
|
236
|
+
"value": "#F0E327"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"name": "$yellow-400",
|
|
240
|
+
"value": "#F3E84C"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"name": "$yellow-300",
|
|
244
|
+
"value": "#F6ED6E"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"name": "$yellow-200",
|
|
248
|
+
"value": "#F8F298"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"name": "$yellow-100",
|
|
252
|
+
"value": "#FBF7C1"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"name": "$yellow-50",
|
|
256
|
+
"value": "#FFFEEB"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "$brown-900",
|
|
260
|
+
"value": "#582422"
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
"name": "$brown-800",
|
|
264
|
+
"value": "#69322C"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"name": "$brown-700",
|
|
268
|
+
"value": "#783F33"
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
"name": "$brown-600",
|
|
272
|
+
"value": "#894B3D"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"name": "$brown-500",
|
|
276
|
+
"value": "#965544"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"name": "$brown-400",
|
|
280
|
+
"value": "#C27C69"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
"name": "$brown-300",
|
|
284
|
+
"value": "#BF8778"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"name": "$brown-200",
|
|
288
|
+
"value": "#DBA79A"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"name": "$brown-100",
|
|
292
|
+
"value": "#F5C7BB"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"name": "$brown-50",
|
|
296
|
+
"value": "#FFE5D6"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
"name": "$green-900",
|
|
300
|
+
"value": "#006025"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
"name": "$green-800",
|
|
304
|
+
"value": "#0D7F39"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "$green-700",
|
|
308
|
+
"value": "#199044"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"name": "$green-600",
|
|
312
|
+
"value": "#25A24F"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
"name": "$green-500",
|
|
316
|
+
"value": "#2EB159"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"name": "$green-400",
|
|
320
|
+
"value": "#53BD72"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"name": "$green-300",
|
|
324
|
+
"value": "#73C98A"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"name": "$green-200",
|
|
328
|
+
"value": "#9DD8AC"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"name": "$green-100",
|
|
332
|
+
"value": "#DCF9D2"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
"name": "$green-50",
|
|
336
|
+
"value": "#F5FFF2"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"name": "$indigo-900",
|
|
340
|
+
"value": "#362D5E"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
"name": "$indigo-800",
|
|
344
|
+
"value": "#443E71"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
"name": "$indigo-700",
|
|
348
|
+
"value": "#4C477E"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"name": "$indigo-600",
|
|
352
|
+
"value": "#54518A"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"name": "$indigo-500",
|
|
356
|
+
"value": "#5B5993"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "$indigo-400",
|
|
360
|
+
"value": "#7172A2"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
"name": "$indigo-300",
|
|
364
|
+
"value": "#898CB2"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
"name": "$indigo-200",
|
|
368
|
+
"value": "#A9ACC9"
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
"name": "$indigo-100",
|
|
372
|
+
"value": "#CACCDF"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
"name": "$indigo-50",
|
|
376
|
+
"value": "#EAEBF2"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"name": "$navy-900",
|
|
380
|
+
"value": "#36497C"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"name": "$navy-800",
|
|
384
|
+
"value": "#45659C"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
"name": "$navy-700",
|
|
388
|
+
"value": "#4D75AF"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
"name": "$navy-600",
|
|
392
|
+
"value": "#4E79AD"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"name": "$navy-500",
|
|
396
|
+
"value": "#5786C1"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"name": "$navy-400",
|
|
400
|
+
"value": "#6EA3D5"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
"name": "$navy-300",
|
|
404
|
+
"value": "#81B3DC"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"name": "$navy-200",
|
|
408
|
+
"value": "#A0C8E7"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"name": "$navy-100",
|
|
412
|
+
"value": "#C3DDF1"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"name": "$navy-50",
|
|
416
|
+
"value": "#E6F1F9"
|
|
417
|
+
}
|
|
418
|
+
]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "$ib-shadow-m1",
|
|
4
|
+
"value": "0px 0px 1px rgba(0, 0, 0, 0.2)"
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
"name": "$ib-shadow-m2",
|
|
8
|
+
"value": "0px 0px 1px rgba(0, 0, 0, 0.25)"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"name": "$ib-shadow-m3",
|
|
12
|
+
"value": "0px 0px 1px rgba(0, 0, 0, 0.15), 0px 1px 5px rgba(0, 0, 0, 0.1)"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "$ib-shadow-1",
|
|
16
|
+
"value": "0px 0px 10px rgba(49, 63, 80, 0.05)"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "$ib-shadow-2",
|
|
20
|
+
"value": "0px 4px 4px rgba(49, 63, 80, 0.1)"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "$ib-shadow-3",
|
|
24
|
+
"value": "0px 3px 10px rgba(49, 63, 80, 0.14)"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "$ib-shadow-4",
|
|
28
|
+
"value": "0px 1px 10px rgba(49, 63, 80, 0.25)"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "$ib-shadow-5",
|
|
32
|
+
"value": "0px 5px 15px rgba(80, 80, 80, 0.15)"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "$ib-shadow-6",
|
|
36
|
+
"value": "0px 7px 20px rgba(49, 63, 80, 0.15)"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "$ib-shadow-7",
|
|
40
|
+
"value": "0px 15px 25px rgba(49, 63, 80, 0.05)"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"name": "$ib-shadow-r",
|
|
44
|
+
"value": "-2px 0px 7px rgba(80, 80, 80, 0.1)"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "$ib-shadow-r1",
|
|
48
|
+
"value": "-4px 0px 14px rgba(80, 80, 80, 0.1)"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "$ib-shadow-l",
|
|
52
|
+
"value": "2px 0px 7px rgba(80, 80, 80, 0.1)"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "$ib-shadow-l1",
|
|
56
|
+
"value": "4px 0px 14px rgba(80, 80, 80, 0.1)"
|
|
57
|
+
}
|
|
58
|
+
]
|
|
@@ -25,45 +25,53 @@ const Template = (args) => ({
|
|
|
25
25
|
},
|
|
26
26
|
template: `
|
|
27
27
|
<ib-alert v-bind="args">
|
|
28
|
-
|
|
28
|
+
{{args.default}}
|
|
29
|
+
|
|
30
|
+
<template #link v-if="args.link">
|
|
31
|
+
<span v-html="args.link"></span>
|
|
32
|
+
</template>
|
|
29
33
|
</ib-alert>`,
|
|
30
34
|
});
|
|
31
35
|
|
|
32
36
|
export const Default = Template.bind({});
|
|
33
|
-
|
|
37
|
+
Default.args = {
|
|
38
|
+
default: "Default message",
|
|
39
|
+
};
|
|
34
40
|
const Type = (args) => ({
|
|
35
41
|
components: { IbAlert },
|
|
36
42
|
setup() {
|
|
37
43
|
return { args };
|
|
38
44
|
},
|
|
39
45
|
template: `
|
|
40
|
-
<ib-alert style="margin-bottom: 5px;">
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
46
|
+
<ib-alert style="margin-bottom: 5px;">
|
|
47
|
+
{{args.default}}
|
|
48
|
+
</ib-alert>
|
|
49
|
+
|
|
50
|
+
<ib-alert style="margin-bottom: 5px;" type="warning">
|
|
51
|
+
{{args.default}}
|
|
52
|
+
</ib-alert>
|
|
53
|
+
|
|
54
|
+
<ib-alert style="margin-bottom: 5px;" type="success">
|
|
55
|
+
{{args.default}}
|
|
56
|
+
</ib-alert>
|
|
57
|
+
|
|
58
|
+
<ib-alert type="info">
|
|
59
|
+
{{args.default}}
|
|
60
|
+
</ib-alert>
|
|
44
61
|
`,
|
|
45
62
|
});
|
|
46
63
|
|
|
47
64
|
export const Types = Type.bind({});
|
|
65
|
+
Types.args = {
|
|
66
|
+
default: "Default message",
|
|
67
|
+
};
|
|
48
68
|
Type.parameters = { controls: { disable: true } };
|
|
49
69
|
|
|
50
|
-
const
|
|
51
|
-
components: { IbAlert },
|
|
52
|
-
setup() {
|
|
53
|
-
return { args };
|
|
54
|
-
},
|
|
55
|
-
template: `
|
|
56
|
-
<ib-alert v-bind="args">
|
|
57
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
58
|
-
<template #link>
|
|
59
|
-
<a href="#" class="ib-standalone-link">View Server</a>
|
|
60
|
-
</template>
|
|
61
|
-
</ib-alert>`,
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
export const LargeAlert = LargeTemplate.bind({});
|
|
70
|
+
export const LargeAlert = Template.bind({});
|
|
65
71
|
LargeAlert.args = {
|
|
66
72
|
showCloseButton: true,
|
|
67
73
|
showIcon: true,
|
|
68
74
|
title: "It is Title",
|
|
75
|
+
default: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
|
|
76
|
+
link: `<a class='ib-standalone-link'>View Server</a>`,
|
|
69
77
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbBadge
|
|
2
2
|
|
|
3
3
|
import { Story, Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as BadgeStories from "./Badge.stories";
|
|
4
5
|
|
|
5
6
|
The `IbBadge` component is a small component used to display a notification badge with a count or indicator on a parent component.
|
|
6
7
|
### Usage
|
|
@@ -28,11 +29,7 @@ The IbBadge component does not have any slots.
|
|
|
28
29
|
The IbBadge component does not emit any events.
|
|
29
30
|
|
|
30
31
|
### Default
|
|
31
|
-
<Canvas
|
|
32
|
-
<Story id="badge--default"/>
|
|
33
|
-
</Canvas>
|
|
32
|
+
<Canvas of={BadgeStories.Default} />
|
|
34
33
|
|
|
35
34
|
### Large
|
|
36
|
-
<Canvas
|
|
37
|
-
<Story id="badge--large"/>
|
|
38
|
-
</Canvas>
|
|
35
|
+
<Canvas of={BadgeStories.Large} />
|
|
@@ -24,7 +24,12 @@ const Template = (args) => ({
|
|
|
24
24
|
setup() {
|
|
25
25
|
return { args };
|
|
26
26
|
},
|
|
27
|
-
template:
|
|
27
|
+
template: `<ib-button v-bind="args">
|
|
28
|
+
{{args.default}}
|
|
29
|
+
<template #icon v-if="args.icon">
|
|
30
|
+
<span style="display: contents" v-html="args.icon"></span>
|
|
31
|
+
</template>
|
|
32
|
+
</ib-button>`,
|
|
28
33
|
});
|
|
29
34
|
|
|
30
35
|
const IconTemplate = (args) => ({
|
|
@@ -74,40 +79,51 @@ const KindsTemplate = (args) => ({
|
|
|
74
79
|
});
|
|
75
80
|
|
|
76
81
|
export const Default = Template.bind({});
|
|
77
|
-
Default.args = {
|
|
82
|
+
Default.args = {
|
|
83
|
+
default: "Default",
|
|
84
|
+
// icon: `<ion-icon name="add"></ion-icon>`,
|
|
85
|
+
icon: ``,
|
|
86
|
+
};
|
|
78
87
|
|
|
79
88
|
export const Secondary = Template.bind({});
|
|
80
89
|
Secondary.args = {
|
|
90
|
+
default: "Secondary",
|
|
81
91
|
kind: "secondary",
|
|
82
92
|
};
|
|
83
93
|
|
|
84
94
|
export const Tertiary = Template.bind({});
|
|
85
95
|
Tertiary.args = {
|
|
96
|
+
default: "Tertiary",
|
|
86
97
|
kind: "tertiary",
|
|
87
98
|
};
|
|
88
99
|
|
|
89
100
|
export const Ghost = Template.bind({});
|
|
90
101
|
Ghost.args = {
|
|
102
|
+
default: "Ghost",
|
|
91
103
|
kind: "ghost",
|
|
92
104
|
};
|
|
93
105
|
|
|
94
106
|
export const Danger = Template.bind({});
|
|
95
107
|
Danger.args = {
|
|
108
|
+
default: "Danger",
|
|
96
109
|
kind: "danger",
|
|
97
110
|
};
|
|
98
111
|
|
|
99
112
|
export const DangerGhost = Template.bind({});
|
|
100
113
|
DangerGhost.args = {
|
|
114
|
+
default: "Danger-ghost",
|
|
101
115
|
kind: "ghostDanger",
|
|
102
116
|
};
|
|
103
117
|
|
|
104
118
|
export const Block = Template.bind({});
|
|
105
119
|
Block.args = {
|
|
120
|
+
default: "Block",
|
|
106
121
|
block: true,
|
|
107
122
|
};
|
|
108
123
|
|
|
109
124
|
export const Disabled = Template.bind({});
|
|
110
125
|
Disabled.args = {
|
|
126
|
+
default: "Disabled",
|
|
111
127
|
disabled: true,
|
|
112
128
|
};
|
|
113
129
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# IbButton
|
|
2
2
|
|
|
3
3
|
import { Story, Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as ButtonStories from "./Button.stories";
|
|
4
5
|
|
|
5
6
|
Buttons are used to initialize an action. Button labels express what action will occur when the user interacts with it.
|
|
6
7
|
|
|
@@ -43,76 +44,53 @@ Do not use buttons as navigational elements. Instead, use [links](?path=/story/l
|
|
|
43
44
|
| click | event | Emitted when the button is clicked. |
|
|
44
45
|
|
|
45
46
|
### Default
|
|
46
|
-
|
|
47
|
-
<Canvas>
|
|
48
|
-
<Story id="button--default" />
|
|
49
|
-
</Canvas>
|
|
47
|
+
<Canvas of={ButtonStories.Default} />
|
|
50
48
|
|
|
51
49
|
### With icon
|
|
52
50
|
|
|
53
51
|
Example when we added the icon
|
|
54
|
-
|
|
55
|
-
<Canvas>
|
|
56
|
-
<Story id="button--button-with-icon" />
|
|
57
|
-
</Canvas>
|
|
52
|
+
<Canvas of={ButtonStories.ButtonWithIcon} />
|
|
58
53
|
|
|
59
54
|
### Kind
|
|
60
55
|
|
|
61
56
|
Each button variant has a particular function and its design signals that function to the user. It is therefore very important that the different variants are implemented consistently across products, so that they message the correct actions.
|
|
62
57
|
|
|
63
|
-
<Canvas
|
|
64
|
-
<Story id="button--kinds" />
|
|
65
|
-
</Canvas>
|
|
58
|
+
<Canvas of={ButtonStories.Kinds} />
|
|
66
59
|
|
|
67
60
|
### Description for all types
|
|
68
61
|
|
|
69
62
|
#### Primary
|
|
70
63
|
|
|
71
64
|
For the principal call to action on the page. Primary buttons should only appear once per screen (not including the application header, modal dialog, or side panel).
|
|
65
|
+
<Canvas of={ButtonStories.Default} />
|
|
72
66
|
|
|
73
|
-
|
|
74
|
-
<Story id="button--default" />
|
|
75
|
-
</Canvas>
|
|
76
|
-
|
|
77
|
-
#### Seconsary
|
|
67
|
+
#### Secondary
|
|
78
68
|
|
|
79
69
|
For secondary actions on each page. Secondary buttons can only be used in conjunction with a primary button. As part of a pair, the secondary button’s function is to perform the negative action of the set, such as “Cancel” or “Back”. Do not use a secondary button in isolation and do not use a secondary button for a positive action.
|
|
80
70
|
|
|
81
|
-
<Canvas
|
|
82
|
-
<Story id="button--secondary" />
|
|
83
|
-
</Canvas>
|
|
71
|
+
<Canvas of={ButtonStories.Secondary} />
|
|
84
72
|
|
|
85
73
|
#### Tertiary
|
|
86
74
|
|
|
87
75
|
For less prominent, and sometimes independent, actions. Tertiary buttons can be used in isolation or paired with a primary button when there are multiple calls to action. Tertiary buttons can also be used for sub-tasks on a page where a primary button for the main and final action is present.
|
|
88
76
|
|
|
89
|
-
<Canvas
|
|
90
|
-
<Story id="button--tertiary" />
|
|
91
|
-
</Canvas>
|
|
77
|
+
<Canvas of={ButtonStories.Tertiary} />
|
|
92
78
|
|
|
93
79
|
#### Ghost
|
|
94
80
|
|
|
95
81
|
For the least pronounced actions; often used in conjunction with a primary button. In a situation such as a progress flow, a ghost button may be paired with a primary and secondary button set, where the primary button is for forward action, the secondary button is for “Back”, and the ghost button is for “Cancel”.
|
|
96
82
|
|
|
97
|
-
<Canvas
|
|
98
|
-
<Story id="button--ghost" />
|
|
99
|
-
</Canvas>
|
|
83
|
+
<Canvas of={ButtonStories.Ghost} />
|
|
100
84
|
|
|
101
85
|
#### Danger
|
|
102
86
|
|
|
103
87
|
For actions that could have destructive effects on the user’s data (for example, delete or remove). Danger button has two styles: primary and ghost.
|
|
104
|
-
|
|
105
|
-
<Canvas>
|
|
106
|
-
<Story id="button--danger" />
|
|
107
|
-
</Canvas>
|
|
88
|
+
<Canvas of={ButtonStories.Danger} />
|
|
108
89
|
|
|
109
90
|
#### Danger ghost
|
|
110
91
|
|
|
111
92
|
For actions that could have destructive effects on the user’s data (for example, delete or remove). Danger button has two styles: primary and ghost.
|
|
112
93
|
|
|
113
|
-
<Canvas
|
|
114
|
-
<Story id="button--danger-ghost" />
|
|
115
|
-
</Canvas>
|
|
116
|
-
|
|
94
|
+
<Canvas of={ButtonStories.DangerGhost} />
|
|
117
95
|
|
|
118
96
|
## <a href="./docks/button.pdf" target="_blank">Read more</a>
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
# IbButtonGroup
|
|
2
2
|
import { Story, Canvas } from "@storybook/addon-docs";
|
|
3
|
+
import * as ButtonGroupStories from "./ButtonGroup.stories";
|
|
3
4
|
|
|
4
5
|
Button Groups are an easy way to group a series of buttons together.
|
|
5
6
|
|
|
6
7
|
### Default
|
|
7
|
-
|
|
8
|
-
<Canvas>
|
|
9
|
-
<Story id="button-group--default" />
|
|
10
|
-
</Canvas>
|
|
8
|
+
<Canvas of={ButtonGroupStories.Default} />
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
# IbDropdown
|
|
2
2
|
|
|
3
3
|
import { Story, Canvas } from "@storybook/addon-docs";
|
|
4
|
+
import * as DropdownStories from "./Dropdown.stories"
|
|
4
5
|
|
|
5
6
|
### Default
|
|
6
7
|
|
|
7
|
-
<Canvas
|
|
8
|
-
<Story id="dropdown--default" />
|
|
9
|
-
</Canvas>
|
|
8
|
+
<Canvas of={DropdownStories.Default} />
|
|
10
9
|
|
|
11
10
|
### Props
|
|
12
11
|
|
|
@@ -12,7 +12,12 @@
|
|
|
12
12
|
<Teleport to="body">
|
|
13
13
|
<div class="modal" :class="classList" v-show="isActive" ref="modal">
|
|
14
14
|
<div class="modal-body" v-outside="clickOutside">
|
|
15
|
-
<ib-icon-button
|
|
15
|
+
<ib-icon-button
|
|
16
|
+
v-if="showCloseButton"
|
|
17
|
+
class="modal-close-icon"
|
|
18
|
+
kind="ghost"
|
|
19
|
+
@click="close"
|
|
20
|
+
>
|
|
16
21
|
<ib-icon name="close-outline" />
|
|
17
22
|
</ib-icon-button>
|
|
18
23
|
|
|
@@ -41,6 +46,10 @@ import { ESC_KEY_CODE, TAB_KEY_CODE } from "../../constants/keyCodes";
|
|
|
41
46
|
export default {
|
|
42
47
|
name: "IbModal",
|
|
43
48
|
directives: { Outside },
|
|
49
|
+
emits: {
|
|
50
|
+
open: null,
|
|
51
|
+
close: null,
|
|
52
|
+
},
|
|
44
53
|
props: {
|
|
45
54
|
active: {
|
|
46
55
|
type: Boolean,
|
|
@@ -54,23 +63,17 @@ export default {
|
|
|
54
63
|
type: Boolean,
|
|
55
64
|
default: false,
|
|
56
65
|
},
|
|
66
|
+
showCloseButton: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: true,
|
|
69
|
+
},
|
|
57
70
|
},
|
|
58
71
|
watch: {
|
|
59
72
|
active(val) {
|
|
60
73
|
this.isActive = val;
|
|
61
74
|
},
|
|
62
|
-
isActive(val) {
|
|
63
|
-
if (val) {
|
|
64
|
-
this.open();
|
|
65
|
-
} else {
|
|
66
|
-
this.close();
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
75
|
},
|
|
70
76
|
mounted() {
|
|
71
|
-
|
|
72
|
-
console.log(this.classList, 'test')
|
|
73
|
-
|
|
74
77
|
const focusableItems = this.$refs?.modal?.querySelectorAll(
|
|
75
78
|
"[tabindex], a, button, input, select, textarea"
|
|
76
79
|
);
|
|
@@ -36,9 +36,10 @@ Modal container is a flexible component and its sizing depends on specific useca
|
|
|
36
36
|
|
|
37
37
|
| Name | type | Default Value | Description |
|
|
38
38
|
| --------------- | ------- | ------------- | -------------------------------------------------- |
|
|
39
|
-
|
|
|
39
|
+
| active | Boolean | false | Controls the visibility of the modal. |
|
|
40
40
|
| classList | String | "" | Classes for modal. |
|
|
41
41
|
| stopPropagation | Boolean | false | Disable modal close on click outside and press ESC |
|
|
42
|
+
| showCloseButton | Boolean | True | Whether is show close button |
|
|
42
43
|
|
|
43
44
|
### Events
|
|
44
45
|
|
|
@@ -112,8 +112,18 @@
|
|
|
112
112
|
:class="{ 'tree-select-list': true, 'has-hierarchy': hasHierarchy }"
|
|
113
113
|
>
|
|
114
114
|
<div
|
|
115
|
-
v-if="
|
|
115
|
+
v-if="
|
|
116
|
+
!requiredDependencyNotFilled &&
|
|
117
|
+
!countVisibleChildren &&
|
|
118
|
+
hasEmptyMessage
|
|
119
|
+
"
|
|
116
120
|
class="tree-select-empty"
|
|
121
|
+
>
|
|
122
|
+
<slot name="emptyMessage"></slot>
|
|
123
|
+
</div>
|
|
124
|
+
<div
|
|
125
|
+
v-else-if="!requiredDependencyNotFilled && !countVisibleChildren"
|
|
126
|
+
class="tree-select-default-empty tree-select-empty"
|
|
117
127
|
>
|
|
118
128
|
{{ actualStrings.emptyTitle }}
|
|
119
129
|
</div>
|
|
@@ -809,6 +819,9 @@ export default {
|
|
|
809
819
|
hasTrigger() {
|
|
810
820
|
return !!this.$slots.trigger;
|
|
811
821
|
},
|
|
822
|
+
hasEmptyMessage() {
|
|
823
|
+
return !!this.$slots.emptyMessage;
|
|
824
|
+
},
|
|
812
825
|
hasHierarchy() {
|
|
813
826
|
return this.actualOptions.some((option) => {
|
|
814
827
|
return option.children;
|
package/src/main.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { createApp } from "vue";
|
|
2
2
|
import App from "./App.vue";
|
|
3
3
|
import EventEmitter from "./EventEmmiter";
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
const app = createApp(App);
|
|
6
6
|
app.config.globalProperties.$globalEvents = new EventEmitter();
|
|
7
7
|
app.config.globalProperties.$emitEvent = function (event, ...args) {
|
|
8
8
|
this.$emit.apply(this, arguments);
|
|
9
9
|
this.$emit("all", { event, args });
|
|
10
10
|
};
|
|
11
|
-
|
|
12
11
|
app.mount("#app");
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
const shadowFilePath = path.join("../assets/scss/variables/shadows.scss");
|
|
5
|
+
const shadowOutputFile = path.join("../assets/scss/variables/shadows.json");
|
|
6
|
+
const colorFilePath = path.join("../assets/scss/variables/colors.scss");
|
|
7
|
+
const colorOutputFile = path.join("../assets/scss/variables/colors.json");
|
|
8
|
+
|
|
9
|
+
parseFile(colorFilePath, colorOutputFile);
|
|
10
|
+
parseFile(shadowFilePath, shadowOutputFile);
|
|
11
|
+
|
|
12
|
+
function parseFile(filePath, outputFile) {
|
|
13
|
+
const variables = [];
|
|
14
|
+
const data = fs.readFileSync(filePath, { encoding: "utf-8" });
|
|
15
|
+
|
|
16
|
+
data.split("\n").forEach((line) => {
|
|
17
|
+
if (line.length) {
|
|
18
|
+
const a = line.split(": ");
|
|
19
|
+
|
|
20
|
+
variables.push({
|
|
21
|
+
name: a[0],
|
|
22
|
+
value: parseValue(a[1]),
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
fs.writeFileSync(outputFile, JSON.stringify(variables, null, 2));
|
|
28
|
+
|
|
29
|
+
function parseValue(value) {
|
|
30
|
+
const val = value.replace(";", "");
|
|
31
|
+
const match = value.match(/\$(\w+(-\w+)*)/);
|
|
32
|
+
|
|
33
|
+
if (match) {
|
|
34
|
+
const index = variables.findIndex((v) => v.name === `$${match[1]}`);
|
|
35
|
+
const value = val.replace(`$${match[1]}`, variables[index].value);
|
|
36
|
+
|
|
37
|
+
if (value.includes("rgba")) {
|
|
38
|
+
return convertRgbaToBrowserFormat(value);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return val;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function convertRgbaToBrowserFormat(rgbaValue) {
|
|
49
|
+
const components = rgbaValue.match(/rgba\(\s*([^,]+),\s*([^)]+)\)/);
|
|
50
|
+
if (!components) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const color = components[1].trim();
|
|
55
|
+
const alpha = parseFloat(components[2].trim());
|
|
56
|
+
const normalizedAlpha = alpha.toFixed(2);
|
|
57
|
+
|
|
58
|
+
return `rgba(${parseColor(color)}, ${normalizedAlpha})`;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function parseColor(color) {
|
|
62
|
+
if (color.startsWith("#")) {
|
|
63
|
+
color = color.slice(1);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (color.length === 3) {
|
|
67
|
+
return color
|
|
68
|
+
.split("")
|
|
69
|
+
.map((char) => char + char)
|
|
70
|
+
.join(",");
|
|
71
|
+
} else if (color.length === 6) {
|
|
72
|
+
const red = parseInt(color.slice(0, 2), 16);
|
|
73
|
+
const green = parseInt(color.slice(2, 4), 16);
|
|
74
|
+
const blue = parseInt(color.slice(4, 6), 16);
|
|
75
|
+
|
|
76
|
+
return `${red}, ${green}, ${blue}`;
|
|
77
|
+
} else {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import shadows from "../../assets/scss/variables/colors.json";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Variables/Colors",
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const ColorsTemplate = (args) => ({
|
|
8
|
+
setup() {
|
|
9
|
+
return { args };
|
|
10
|
+
},
|
|
11
|
+
template: `
|
|
12
|
+
<div v-for="(color, index) in args.colors" :key="index" style="display: flex; padding: 10px">
|
|
13
|
+
<div style="width: 150px; height: 150px" :style="{ 'background-color': color.value }"></div>
|
|
14
|
+
<div style="padding: 10px">
|
|
15
|
+
<p>Token: {{color.name}}</p>
|
|
16
|
+
<p>Value: {{color.value}}</p>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
`,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const Colors = ColorsTemplate.bind({});
|
|
23
|
+
Colors.args = {
|
|
24
|
+
colors: shadows,
|
|
25
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import shadows from "../../assets/scss/variables/shadows.json";
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Variables/Shadows",
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const ShadowsTemplate = (args) => ({
|
|
8
|
+
setup() {
|
|
9
|
+
return { args };
|
|
10
|
+
},
|
|
11
|
+
template: `
|
|
12
|
+
<div v-for="(shadow, index) in args.shadows" :key="index" style="display: flex; padding: 10px">
|
|
13
|
+
<div style="width: 150px; height: 150px" :style="{ 'box-shadow': shadow.value }"></div>
|
|
14
|
+
<div style="padding: 10px">
|
|
15
|
+
<p>Token: {{shadow.name}}</p>
|
|
16
|
+
<p>Value: {{shadow.value}}</p>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
`,
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export const Shadows = ShadowsTemplate.bind({});
|
|
23
|
+
Shadows.args = {
|
|
24
|
+
shadows: shadows,
|
|
25
|
+
};
|