@veeqo/ui 0.0.1
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/.nvmrc +1 -0
- package/.prettierrc +6 -0
- package/.storybook/main.ts +21 -0
- package/.storybook/preview.ts +9 -0
- package/.vscode/settings.json +11 -0
- package/lib/components/Loader/Grid.d.ts +10 -0
- package/lib/components/Loader/Loader.d.ts +3 -0
- package/lib/components/Loader/TailSpin.d.ts +10 -0
- package/lib/components/Loader/ThreeDots.d.ts +10 -0
- package/lib/components/Loader/index.d.ts +1 -0
- package/lib/components/Loader/loaderTypes.d.ts +8 -0
- package/lib/components/Stack/Alignments.d.ts +9 -0
- package/lib/components/Stack/Stack.d.ts +6 -0
- package/lib/components/Stack/index.d.ts +1 -0
- package/lib/components/Stack/types.d.ts +38 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/index.d.ts +520 -0
- package/lib/index.esm.js +2 -0
- package/lib/index.esm.js.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib/theme/index.d.ts +454 -0
- package/lib/theme/modules/breakpoints.d.ts +7 -0
- package/lib/theme/modules/colors.d.ts +116 -0
- package/lib/theme/modules/layers.d.ts +6 -0
- package/lib/theme/modules/radius.d.ts +7 -0
- package/lib/theme/modules/shadows.d.ts +6 -0
- package/lib/theme/modules/sizes.d.ts +20 -0
- package/lib/theme/modules/text.d.ts +315 -0
- package/lib/theme/storybook/components.d.ts +2 -0
- package/package.json +52 -0
- package/rollup.config.mjs +49 -0
- package/src/components/Loader/Docs.mdx +26 -0
- package/src/components/Loader/Grid.tsx +113 -0
- package/src/components/Loader/Loader.stories.tsx +62 -0
- package/src/components/Loader/Loader.tsx +28 -0
- package/src/components/Loader/TailSpin.tsx +54 -0
- package/src/components/Loader/ThreeDots.tsx +90 -0
- package/src/components/Loader/__snapshots__/Loader.test.tsx.snap +73 -0
- package/src/components/Loader/index.ts +1 -0
- package/src/components/Loader/loaderTypes.ts +9 -0
- package/src/components/Stack/Alignments.ts +10 -0
- package/src/components/Stack/Docs.mdx +28 -0
- package/src/components/Stack/Stack.stories.tsx +112 -0
- package/src/components/Stack/Stack.tsx +61 -0
- package/src/components/Stack/__snapshots__/Stack.test.tsx.snap +45 -0
- package/src/components/Stack/index.ts +1 -0
- package/src/components/Stack/types.ts +73 -0
- package/src/components/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/theme/index.ts +18 -0
- package/src/theme/modules/breakpoints.ts +7 -0
- package/src/theme/modules/colors.ts +116 -0
- package/src/theme/modules/layers.ts +6 -0
- package/src/theme/modules/radius.ts +7 -0
- package/src/theme/modules/shadows.ts +6 -0
- package/src/theme/modules/sizes.ts +52 -0
- package/src/theme/modules/text.ts +319 -0
- package/src/theme/storybook/ColorDocs.mdx +130 -0
- package/src/theme/storybook/RadiusDocs.mdx +39 -0
- package/src/theme/storybook/ShadowDocs.mdx +37 -0
- package/src/theme/storybook/SizesDocs.mdx +104 -0
- package/src/theme/storybook/components.tsx +19 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
export declare const common: {
|
|
2
|
+
fontFamily: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const text: {
|
|
5
|
+
headingXXL: {
|
|
6
|
+
fontFamily: string;
|
|
7
|
+
fontStyle: string;
|
|
8
|
+
fontWeight: number;
|
|
9
|
+
fontSize: string;
|
|
10
|
+
lineHeight: string;
|
|
11
|
+
color: string;
|
|
12
|
+
textDecoration: string;
|
|
13
|
+
letterSpacing: string;
|
|
14
|
+
};
|
|
15
|
+
headingXL: {
|
|
16
|
+
fontFamily: string;
|
|
17
|
+
fontStyle: string;
|
|
18
|
+
fontWeight: number;
|
|
19
|
+
fontSize: string;
|
|
20
|
+
lineHeight: string;
|
|
21
|
+
color: string;
|
|
22
|
+
textDecoration: string;
|
|
23
|
+
letterSpacing: string;
|
|
24
|
+
};
|
|
25
|
+
headingLarge: {
|
|
26
|
+
fontFamily: string;
|
|
27
|
+
fontStyle: string;
|
|
28
|
+
fontWeight: number;
|
|
29
|
+
fontSize: string;
|
|
30
|
+
lineHeight: string;
|
|
31
|
+
color: string;
|
|
32
|
+
textDecoration: string;
|
|
33
|
+
letterSpacing: string;
|
|
34
|
+
};
|
|
35
|
+
headingMedium: {
|
|
36
|
+
fontFamily: string;
|
|
37
|
+
fontStyle: string;
|
|
38
|
+
fontWeight: number;
|
|
39
|
+
fontSize: string;
|
|
40
|
+
lineHeight: string;
|
|
41
|
+
color: string;
|
|
42
|
+
textDecoration: string;
|
|
43
|
+
letterSpacing: string;
|
|
44
|
+
};
|
|
45
|
+
headingSmall: {
|
|
46
|
+
fontFamily: string;
|
|
47
|
+
fontStyle: string;
|
|
48
|
+
fontWeight: number;
|
|
49
|
+
fontSize: string;
|
|
50
|
+
lineHeight: string;
|
|
51
|
+
color: string;
|
|
52
|
+
textDecoration: string;
|
|
53
|
+
letterSpacing: string;
|
|
54
|
+
};
|
|
55
|
+
headingTable: {
|
|
56
|
+
fontFamily: string;
|
|
57
|
+
fontStyle: string;
|
|
58
|
+
fontWeight: number;
|
|
59
|
+
fontSize: string;
|
|
60
|
+
lineHeight: string;
|
|
61
|
+
color: string;
|
|
62
|
+
textDecoration: string;
|
|
63
|
+
letterSpacing: string;
|
|
64
|
+
};
|
|
65
|
+
subheadingLarge: {
|
|
66
|
+
fontFamily: string;
|
|
67
|
+
fontStyle: string;
|
|
68
|
+
fontWeight: string;
|
|
69
|
+
fontSize: string;
|
|
70
|
+
lineHeight: string;
|
|
71
|
+
color: string;
|
|
72
|
+
textDecoration: string;
|
|
73
|
+
letterSpacing: string;
|
|
74
|
+
};
|
|
75
|
+
subheadingMedium: {
|
|
76
|
+
fontFamily: string;
|
|
77
|
+
fontStyle: string;
|
|
78
|
+
fontWeight: string;
|
|
79
|
+
fontSize: string;
|
|
80
|
+
lineHeight: string;
|
|
81
|
+
color: string;
|
|
82
|
+
textDecoration: string;
|
|
83
|
+
letterSpacing: string;
|
|
84
|
+
};
|
|
85
|
+
subheadingSmall: {
|
|
86
|
+
fontFamily: string;
|
|
87
|
+
fontStyle: string;
|
|
88
|
+
fontWeight: string;
|
|
89
|
+
fontSize: string;
|
|
90
|
+
lineHeight: string;
|
|
91
|
+
color: string;
|
|
92
|
+
textDecoration: string;
|
|
93
|
+
letterSpacing: string;
|
|
94
|
+
};
|
|
95
|
+
subheadingSmallBold: {
|
|
96
|
+
fontFamily: string;
|
|
97
|
+
fontStyle: string;
|
|
98
|
+
fontWeight: number;
|
|
99
|
+
fontSize: string;
|
|
100
|
+
lineHeight: string;
|
|
101
|
+
color: string;
|
|
102
|
+
textDecoration: string;
|
|
103
|
+
letterSpacing: string;
|
|
104
|
+
};
|
|
105
|
+
body: {
|
|
106
|
+
fontFamily: string;
|
|
107
|
+
fontStyle: string;
|
|
108
|
+
fontWeight: string;
|
|
109
|
+
fontSize: string;
|
|
110
|
+
lineHeight: string;
|
|
111
|
+
color: string;
|
|
112
|
+
textDecoration: string;
|
|
113
|
+
letterSpacing: string;
|
|
114
|
+
};
|
|
115
|
+
bodySmall: {
|
|
116
|
+
fontFamily: string;
|
|
117
|
+
fontStyle: string;
|
|
118
|
+
fontWeight: string;
|
|
119
|
+
fontSize: string;
|
|
120
|
+
lineHeight: string;
|
|
121
|
+
color: string;
|
|
122
|
+
textDecoration: string;
|
|
123
|
+
letterSpacing: string;
|
|
124
|
+
};
|
|
125
|
+
bodyBold: {
|
|
126
|
+
fontFamily: string;
|
|
127
|
+
fontStyle: string;
|
|
128
|
+
fontWeight: number;
|
|
129
|
+
fontSize: string;
|
|
130
|
+
lineHeight: string;
|
|
131
|
+
color: string;
|
|
132
|
+
textDecoration: string;
|
|
133
|
+
letterSpacing: string;
|
|
134
|
+
};
|
|
135
|
+
bodyBoldDark: {
|
|
136
|
+
fontFamily: string;
|
|
137
|
+
fontStyle: string;
|
|
138
|
+
fontWeight: number;
|
|
139
|
+
fontSize: string;
|
|
140
|
+
lineHeight: string;
|
|
141
|
+
color: string;
|
|
142
|
+
textDecoration: string;
|
|
143
|
+
letterSpacing: string;
|
|
144
|
+
};
|
|
145
|
+
bodySmallBold: {
|
|
146
|
+
fontFamily: string;
|
|
147
|
+
fontStyle: string;
|
|
148
|
+
fontWeight: number;
|
|
149
|
+
fontSize: string;
|
|
150
|
+
lineHeight: string;
|
|
151
|
+
color: string;
|
|
152
|
+
textDecoration: string;
|
|
153
|
+
letterSpacing: string;
|
|
154
|
+
};
|
|
155
|
+
button: {
|
|
156
|
+
fontFamily: string;
|
|
157
|
+
fontStyle: string;
|
|
158
|
+
fontWeight: number;
|
|
159
|
+
fontSize: string;
|
|
160
|
+
lineHeight: string;
|
|
161
|
+
color: string;
|
|
162
|
+
textDecoration: string;
|
|
163
|
+
letterSpacing: string;
|
|
164
|
+
};
|
|
165
|
+
buttonSmall: {
|
|
166
|
+
fontFamily: string;
|
|
167
|
+
fontStyle: string;
|
|
168
|
+
fontWeight: number;
|
|
169
|
+
fontSize: string;
|
|
170
|
+
lineHeight: string;
|
|
171
|
+
color: string;
|
|
172
|
+
textDecoration: string;
|
|
173
|
+
letterSpacing: string;
|
|
174
|
+
};
|
|
175
|
+
linkLarge: {
|
|
176
|
+
fontFamily: string;
|
|
177
|
+
fontStyle: string;
|
|
178
|
+
fontWeight: string;
|
|
179
|
+
fontSize: string;
|
|
180
|
+
lineHeight: string;
|
|
181
|
+
color: string;
|
|
182
|
+
textDecoration: string;
|
|
183
|
+
letterSpacing: string;
|
|
184
|
+
};
|
|
185
|
+
linkMedium: {
|
|
186
|
+
fontFamily: string;
|
|
187
|
+
fontStyle: string;
|
|
188
|
+
fontWeight: string;
|
|
189
|
+
fontSize: string;
|
|
190
|
+
lineHeight: string;
|
|
191
|
+
color: string;
|
|
192
|
+
textDecoration: string;
|
|
193
|
+
letterSpacing: string;
|
|
194
|
+
};
|
|
195
|
+
link: {
|
|
196
|
+
fontFamily: string;
|
|
197
|
+
fontStyle: string;
|
|
198
|
+
fontWeight: string;
|
|
199
|
+
fontSize: string;
|
|
200
|
+
lineHeight: string;
|
|
201
|
+
color: string;
|
|
202
|
+
textDecoration: string;
|
|
203
|
+
letterSpacing: string;
|
|
204
|
+
};
|
|
205
|
+
linkSmall: {
|
|
206
|
+
fontFamily: string;
|
|
207
|
+
fontStyle: string;
|
|
208
|
+
fontWeight: string;
|
|
209
|
+
fontSize: string;
|
|
210
|
+
lineHeight: string;
|
|
211
|
+
color: string;
|
|
212
|
+
textDecoration: string;
|
|
213
|
+
letterSpacing: string;
|
|
214
|
+
};
|
|
215
|
+
inputLabel: {
|
|
216
|
+
fontFamily: string;
|
|
217
|
+
fontStyle: string;
|
|
218
|
+
fontWeight: number;
|
|
219
|
+
fontSize: string;
|
|
220
|
+
lineHeight: string;
|
|
221
|
+
color: string;
|
|
222
|
+
textDecoration: string;
|
|
223
|
+
letterSpacing: string;
|
|
224
|
+
};
|
|
225
|
+
inputLabelSmall: {
|
|
226
|
+
fontFamily: string;
|
|
227
|
+
fontStyle: string;
|
|
228
|
+
fontWeight: number;
|
|
229
|
+
fontSize: string;
|
|
230
|
+
lineHeight: string;
|
|
231
|
+
color: string;
|
|
232
|
+
textDecoration: string;
|
|
233
|
+
letterSpacing: string;
|
|
234
|
+
};
|
|
235
|
+
hintText: {
|
|
236
|
+
fontFamily: string;
|
|
237
|
+
fontStyle: string;
|
|
238
|
+
fontWeight: string;
|
|
239
|
+
fontSize: string;
|
|
240
|
+
lineHeight: string;
|
|
241
|
+
color: string;
|
|
242
|
+
textDecoration: string;
|
|
243
|
+
letterSpacing: string;
|
|
244
|
+
};
|
|
245
|
+
placeholder: {
|
|
246
|
+
fontFamily: string;
|
|
247
|
+
fontStyle: string;
|
|
248
|
+
fontWeight: string;
|
|
249
|
+
fontSize: string;
|
|
250
|
+
lineHeight: string;
|
|
251
|
+
color: string;
|
|
252
|
+
textDecoration: string;
|
|
253
|
+
letterSpacing: string;
|
|
254
|
+
};
|
|
255
|
+
placeholderSmall: {
|
|
256
|
+
fontFamily: string;
|
|
257
|
+
fontStyle: string;
|
|
258
|
+
fontWeight: string;
|
|
259
|
+
fontSize: string;
|
|
260
|
+
lineHeight: string;
|
|
261
|
+
color: string;
|
|
262
|
+
textDecoration: string;
|
|
263
|
+
letterSpacing: string;
|
|
264
|
+
};
|
|
265
|
+
placeholderCode: {
|
|
266
|
+
fontFamily: string;
|
|
267
|
+
fontStyle: string;
|
|
268
|
+
fontWeight: string;
|
|
269
|
+
fontSize: string;
|
|
270
|
+
lineHeight: string;
|
|
271
|
+
color: string;
|
|
272
|
+
textDecoration: string;
|
|
273
|
+
letterSpacing: string;
|
|
274
|
+
};
|
|
275
|
+
placeholderCodeSmall: {
|
|
276
|
+
fontFamily: string;
|
|
277
|
+
fontStyle: string;
|
|
278
|
+
fontWeight: string;
|
|
279
|
+
fontSize: string;
|
|
280
|
+
lineHeight: string;
|
|
281
|
+
color: string;
|
|
282
|
+
textDecoration: string;
|
|
283
|
+
letterSpacing: string;
|
|
284
|
+
};
|
|
285
|
+
error: {
|
|
286
|
+
fontFamily: string;
|
|
287
|
+
fontStyle: string;
|
|
288
|
+
fontWeight: number;
|
|
289
|
+
fontSize: string;
|
|
290
|
+
lineHeight: string;
|
|
291
|
+
color: string;
|
|
292
|
+
textDecoration: string;
|
|
293
|
+
letterSpacing: string;
|
|
294
|
+
};
|
|
295
|
+
errorSmall: {
|
|
296
|
+
fontFamily: string;
|
|
297
|
+
fontStyle: string;
|
|
298
|
+
fontWeight: number;
|
|
299
|
+
fontSize: string;
|
|
300
|
+
lineHeight: string;
|
|
301
|
+
color: string;
|
|
302
|
+
textDecoration: string;
|
|
303
|
+
letterSpacing: string;
|
|
304
|
+
};
|
|
305
|
+
successSmall: {
|
|
306
|
+
fontFamily: string;
|
|
307
|
+
fontStyle: string;
|
|
308
|
+
fontWeight: number;
|
|
309
|
+
fontSize: string;
|
|
310
|
+
lineHeight: string;
|
|
311
|
+
color: string;
|
|
312
|
+
textDecoration: string;
|
|
313
|
+
letterSpacing: string;
|
|
314
|
+
};
|
|
315
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@veeqo/ui",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "New optimised component library for Veeqo.",
|
|
5
|
+
"author": "Robert Wealthall",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "lib/index.js",
|
|
9
|
+
"module": "lib/index.esm.js",
|
|
10
|
+
"types": "lib/index.d.ts",
|
|
11
|
+
"directories": {
|
|
12
|
+
"lib": "lib"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
16
|
+
"storybook": "storybook dev -p 6006",
|
|
17
|
+
"build-storybook": "storybook build",
|
|
18
|
+
"build": "rollup -c",
|
|
19
|
+
"release": "release-it && npm publish"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@rollup/plugin-node-resolve": "^15.2.1",
|
|
23
|
+
"@rollup/plugin-terser": "^0.4.3",
|
|
24
|
+
"@rollup/plugin-typescript": "^11.1.3",
|
|
25
|
+
"@storybook/addon-essentials": "^7.4.1",
|
|
26
|
+
"@storybook/addon-interactions": "^7.4.1",
|
|
27
|
+
"@storybook/addon-links": "^7.4.1",
|
|
28
|
+
"@storybook/addon-onboarding": "^1.0.8",
|
|
29
|
+
"@storybook/blocks": "^7.4.1",
|
|
30
|
+
"@storybook/react": "^7.4.1",
|
|
31
|
+
"@storybook/react-vite": "^7.4.1",
|
|
32
|
+
"@storybook/testing-library": "^0.2.0",
|
|
33
|
+
"@types/react": "^18.2.21",
|
|
34
|
+
"framer-motion": "^10.16.4",
|
|
35
|
+
"prettier": "^3.0.3",
|
|
36
|
+
"react": "^18.2.0",
|
|
37
|
+
"react-dom": "^18.2.0",
|
|
38
|
+
"release-it": "^16.1.5",
|
|
39
|
+
"rollup": "^3.29.2",
|
|
40
|
+
"rollup-plugin-dts": "^6.0.2",
|
|
41
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
42
|
+
"storybook": "^7.4.1",
|
|
43
|
+
"styled-components": "^6.0.8",
|
|
44
|
+
"typescript": "^5.2.2"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"framer-motion": "^10.16.4",
|
|
48
|
+
"react": "^18.2.0",
|
|
49
|
+
"react-dom": "^18.2.0",
|
|
50
|
+
"styled-components": "^6.0.8"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import typescriptEngine from 'typescript';
|
|
2
|
+
import dts from 'rollup-plugin-dts';
|
|
3
|
+
import terser from '@rollup/plugin-terser';
|
|
4
|
+
import peerDepsExternal from 'rollup-plugin-peer-deps-external';
|
|
5
|
+
import resolve from '@rollup/plugin-node-resolve';
|
|
6
|
+
import typescript from '@rollup/plugin-typescript';
|
|
7
|
+
|
|
8
|
+
import packageJson from './package.json' assert { type: 'json' };
|
|
9
|
+
|
|
10
|
+
export default [
|
|
11
|
+
{
|
|
12
|
+
input: 'src/index.ts',
|
|
13
|
+
output: [
|
|
14
|
+
{
|
|
15
|
+
file: packageJson.main,
|
|
16
|
+
format: 'cjs',
|
|
17
|
+
sourcemap: true,
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
file: packageJson.module,
|
|
21
|
+
format: 'esm',
|
|
22
|
+
sourcemap: true,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
plugins: [
|
|
26
|
+
peerDepsExternal(), // Don't include peer dependencies, should be given by client.
|
|
27
|
+
resolve(), // Resolve paths
|
|
28
|
+
typescript({
|
|
29
|
+
tsconfig: './tsconfig.json',
|
|
30
|
+
typescript: typescriptEngine,
|
|
31
|
+
sourceMap: true,
|
|
32
|
+
exclude: [
|
|
33
|
+
'**/__snapshots__/*',
|
|
34
|
+
'**/__tests__',
|
|
35
|
+
'**/*.test.ts+(|x)',
|
|
36
|
+
'**/*.story.ts+(|x)',
|
|
37
|
+
'**/*.stories.ts+(|x)',
|
|
38
|
+
'**/*.mdx',
|
|
39
|
+
],
|
|
40
|
+
}),
|
|
41
|
+
terser(),
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
input: 'lib/index.d.ts',
|
|
46
|
+
output: [{ file: 'lib/index.d.ts', format: 'esm' }],
|
|
47
|
+
plugins: [dts()],
|
|
48
|
+
},
|
|
49
|
+
];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Meta, Primary, Controls, Story } from '@storybook/blocks';
|
|
2
|
+
import * as LoaderStories from './Loader.stories';
|
|
3
|
+
|
|
4
|
+
<Meta of={LoaderStories} />
|
|
5
|
+
|
|
6
|
+
# Loader
|
|
7
|
+
|
|
8
|
+
The loader component should be used to indicate to a user that something is loading, such as a page or a button.
|
|
9
|
+
|
|
10
|
+
<Primary />
|
|
11
|
+
|
|
12
|
+
## Props
|
|
13
|
+
|
|
14
|
+
Type will default to TailSpin.
|
|
15
|
+
|
|
16
|
+
<Controls />
|
|
17
|
+
|
|
18
|
+
## Stories
|
|
19
|
+
|
|
20
|
+
Grid, TailSpin and ThreeDots loading states.
|
|
21
|
+
|
|
22
|
+
<div style={{ display: 'flex', gap: '20px' }}>
|
|
23
|
+
<Story of={LoaderStories.Primary} />
|
|
24
|
+
<Story of={LoaderStories.TailSpin} />
|
|
25
|
+
<Story of={LoaderStories.ThreeDots} />
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface GridProps {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const Grid = ({ width, height, className, color, label }: GridProps) => (
|
|
12
|
+
<svg
|
|
13
|
+
width={width}
|
|
14
|
+
height={height}
|
|
15
|
+
className={className}
|
|
16
|
+
viewBox="0 0 105 105"
|
|
17
|
+
fill={color}
|
|
18
|
+
aria-label={label}
|
|
19
|
+
>
|
|
20
|
+
<circle cx="12.5" cy="12.5" r="12.5">
|
|
21
|
+
<animate
|
|
22
|
+
attributeName="fill-opacity"
|
|
23
|
+
begin="0s"
|
|
24
|
+
dur="1s"
|
|
25
|
+
values="1;.2;1"
|
|
26
|
+
calcMode="linear"
|
|
27
|
+
repeatCount="indefinite"
|
|
28
|
+
/>
|
|
29
|
+
</circle>
|
|
30
|
+
<circle cx="12.5" cy="52.5" r="12.5">
|
|
31
|
+
<animate
|
|
32
|
+
attributeName="fill-opacity"
|
|
33
|
+
begin="100ms"
|
|
34
|
+
dur="1s"
|
|
35
|
+
values="1;.2;1"
|
|
36
|
+
calcMode="linear"
|
|
37
|
+
repeatCount="indefinite"
|
|
38
|
+
/>
|
|
39
|
+
</circle>
|
|
40
|
+
<circle cx="52.5" cy="12.5" r="12.5">
|
|
41
|
+
<animate
|
|
42
|
+
attributeName="fill-opacity"
|
|
43
|
+
begin="300ms"
|
|
44
|
+
dur="1s"
|
|
45
|
+
values="1;.2;1"
|
|
46
|
+
calcMode="linear"
|
|
47
|
+
repeatCount="indefinite"
|
|
48
|
+
/>
|
|
49
|
+
</circle>
|
|
50
|
+
<circle cx="52.5" cy="52.5" r="12.5">
|
|
51
|
+
<animate
|
|
52
|
+
attributeName="fill-opacity"
|
|
53
|
+
begin="600ms"
|
|
54
|
+
dur="1s"
|
|
55
|
+
values="1;.2;1"
|
|
56
|
+
calcMode="linear"
|
|
57
|
+
repeatCount="indefinite"
|
|
58
|
+
/>
|
|
59
|
+
</circle>
|
|
60
|
+
<circle cx="92.5" cy="12.5" r="12.5">
|
|
61
|
+
<animate
|
|
62
|
+
attributeName="fill-opacity"
|
|
63
|
+
begin="800ms"
|
|
64
|
+
dur="1s"
|
|
65
|
+
values="1;.2;1"
|
|
66
|
+
calcMode="linear"
|
|
67
|
+
repeatCount="indefinite"
|
|
68
|
+
/>
|
|
69
|
+
</circle>
|
|
70
|
+
<circle cx="92.5" cy="52.5" r="12.5">
|
|
71
|
+
<animate
|
|
72
|
+
attributeName="fill-opacity"
|
|
73
|
+
begin="400ms"
|
|
74
|
+
dur="1s"
|
|
75
|
+
values="1;.2;1"
|
|
76
|
+
calcMode="linear"
|
|
77
|
+
repeatCount="indefinite"
|
|
78
|
+
/>
|
|
79
|
+
</circle>
|
|
80
|
+
<circle cx="12.5" cy="92.5" r="12.5">
|
|
81
|
+
<animate
|
|
82
|
+
attributeName="fill-opacity"
|
|
83
|
+
begin="700ms"
|
|
84
|
+
dur="1s"
|
|
85
|
+
values="1;.2;1"
|
|
86
|
+
calcMode="linear"
|
|
87
|
+
repeatCount="indefinite"
|
|
88
|
+
/>
|
|
89
|
+
</circle>
|
|
90
|
+
<circle cx="52.5" cy="92.5" r="12.5">
|
|
91
|
+
<animate
|
|
92
|
+
attributeName="fill-opacity"
|
|
93
|
+
begin="500ms"
|
|
94
|
+
dur="1s"
|
|
95
|
+
values="1;.2;1"
|
|
96
|
+
calcMode="linear"
|
|
97
|
+
repeatCount="indefinite"
|
|
98
|
+
/>
|
|
99
|
+
</circle>
|
|
100
|
+
<circle cx="92.5" cy="92.5" r="12.5">
|
|
101
|
+
<animate
|
|
102
|
+
attributeName="fill-opacity"
|
|
103
|
+
begin="200ms"
|
|
104
|
+
dur="1s"
|
|
105
|
+
values="1;.2;1"
|
|
106
|
+
calcMode="linear"
|
|
107
|
+
repeatCount="indefinite"
|
|
108
|
+
/>
|
|
109
|
+
</circle>
|
|
110
|
+
</svg>
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
export default Grid;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Loader } from './Loader';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/Common/Loader',
|
|
6
|
+
component: Loader,
|
|
7
|
+
} satisfies Meta<typeof Loader>;
|
|
8
|
+
|
|
9
|
+
export default meta;
|
|
10
|
+
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
|
|
13
|
+
export const Primary: Story = {
|
|
14
|
+
argTypes: {
|
|
15
|
+
type: {
|
|
16
|
+
options: ['Grid', 'TailSpin', 'ThreeDots'],
|
|
17
|
+
control: {
|
|
18
|
+
type: 'select',
|
|
19
|
+
},
|
|
20
|
+
defaultValue: 'Grid',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
args: {
|
|
24
|
+
type: 'Grid',
|
|
25
|
+
height: 32,
|
|
26
|
+
width: 32,
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const TailSpin: Story = {
|
|
31
|
+
argTypes: {
|
|
32
|
+
type: {
|
|
33
|
+
options: ['Grid', 'TailSpin', 'ThreeDots'],
|
|
34
|
+
control: {
|
|
35
|
+
type: 'select',
|
|
36
|
+
},
|
|
37
|
+
defaultValue: 'TailSpin',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
args: {
|
|
41
|
+
type: 'TailSpin',
|
|
42
|
+
height: 32,
|
|
43
|
+
width: 32,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const ThreeDots: Story = {
|
|
48
|
+
argTypes: {
|
|
49
|
+
type: {
|
|
50
|
+
options: ['Grid', 'TailSpin', 'ThreeDots'],
|
|
51
|
+
control: {
|
|
52
|
+
type: 'select',
|
|
53
|
+
},
|
|
54
|
+
defaultValue: 'ThreeDots',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
args: {
|
|
58
|
+
type: 'ThreeDots',
|
|
59
|
+
height: 32,
|
|
60
|
+
width: 32,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import TailSpin from './TailSpin';
|
|
4
|
+
import Grid from './Grid';
|
|
5
|
+
import ThreeDots from './ThreeDots';
|
|
6
|
+
|
|
7
|
+
import { LoaderProps } from './loaderTypes';
|
|
8
|
+
|
|
9
|
+
export const Loader = ({
|
|
10
|
+
className,
|
|
11
|
+
height = 24,
|
|
12
|
+
width = 24,
|
|
13
|
+
color = '#588CB0',
|
|
14
|
+
type = 'TailSpin',
|
|
15
|
+
}: LoaderProps) => {
|
|
16
|
+
switch (type) {
|
|
17
|
+
case 'Grid': {
|
|
18
|
+
return <Grid className={className} height={height} width={width} color={color} />;
|
|
19
|
+
}
|
|
20
|
+
case 'ThreeDots': {
|
|
21
|
+
return <ThreeDots className={className} height={height} width={width} color={color} />;
|
|
22
|
+
}
|
|
23
|
+
default:
|
|
24
|
+
case 'TailSpin': {
|
|
25
|
+
return <TailSpin className={className} height={height} width={width} color={color} />;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
export interface TailSpinProps {
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const TailSpin = ({ width, height, className, color, label }: TailSpinProps) => (
|
|
12
|
+
<svg
|
|
13
|
+
width={width}
|
|
14
|
+
height={height}
|
|
15
|
+
className={className}
|
|
16
|
+
viewBox="0 0 38 38"
|
|
17
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
18
|
+
aria-label={label}
|
|
19
|
+
>
|
|
20
|
+
<defs>
|
|
21
|
+
<linearGradient x1="8.042%" y1="0%" x2="65.682%" y2="23.865%" id="a">
|
|
22
|
+
<stop stopColor={color} stopOpacity="0" offset="0%" />
|
|
23
|
+
<stop stopColor={color} stopOpacity=".631" offset="63.146%" />
|
|
24
|
+
<stop stopColor={color} offset="100%" />
|
|
25
|
+
</linearGradient>
|
|
26
|
+
</defs>
|
|
27
|
+
<g fill="none" fillRule="evenodd">
|
|
28
|
+
<g transform="translate(1 1)">
|
|
29
|
+
<path d="M36 18c0-9.94-8.06-18-18-18" id="Oval-2" stroke={color} strokeWidth="2">
|
|
30
|
+
<animateTransform
|
|
31
|
+
attributeName="transform"
|
|
32
|
+
type="rotate"
|
|
33
|
+
from="0 18 18"
|
|
34
|
+
to="360 18 18"
|
|
35
|
+
dur="0.9s"
|
|
36
|
+
repeatCount="indefinite"
|
|
37
|
+
/>
|
|
38
|
+
</path>
|
|
39
|
+
<circle fill="#fff" cx="36" cy="18" r="1">
|
|
40
|
+
<animateTransform
|
|
41
|
+
attributeName="transform"
|
|
42
|
+
type="rotate"
|
|
43
|
+
from="0 18 18"
|
|
44
|
+
to="360 18 18"
|
|
45
|
+
dur="0.9s"
|
|
46
|
+
repeatCount="indefinite"
|
|
47
|
+
/>
|
|
48
|
+
</circle>
|
|
49
|
+
</g>
|
|
50
|
+
</g>
|
|
51
|
+
</svg>
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
export default TailSpin;
|