@shohojdhara/atomix 0.2.9 → 0.3.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.
Files changed (102) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/atomix.css +309 -105
  3. package/dist/atomix.min.css +3 -5
  4. package/dist/index.d.ts +807 -51
  5. package/dist/index.esm.js +16367 -16405
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.js +16277 -16330
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.min.js +1 -1
  10. package/dist/index.min.js.map +1 -1
  11. package/dist/themes/applemix.css +309 -105
  12. package/dist/themes/applemix.min.css +5 -7
  13. package/dist/themes/boomdevs.css +202 -10
  14. package/dist/themes/boomdevs.min.css +3 -5
  15. package/dist/themes/esrar.css +309 -105
  16. package/dist/themes/esrar.min.css +4 -6
  17. package/dist/themes/flashtrade.css +310 -105
  18. package/dist/themes/flashtrade.min.css +5 -7
  19. package/dist/themes/mashroom.css +300 -96
  20. package/dist/themes/mashroom.min.css +4 -6
  21. package/dist/themes/shaj-default.css +300 -96
  22. package/dist/themes/shaj-default.min.css +4 -6
  23. package/package.json +1 -1
  24. package/src/components/AtomixGlass/AtomixGlass.test.tsx +21 -32
  25. package/src/components/AtomixGlass/AtomixGlass.tsx +55 -42
  26. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +205 -57
  27. package/src/components/AtomixGlass/GlassFilter.tsx +22 -8
  28. package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +221 -0
  29. package/src/components/AtomixGlass/atomixGLass.old.tsx +0 -3
  30. package/src/components/AtomixGlass/shader-utils.ts +8 -0
  31. package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +319 -100
  32. package/src/components/AtomixGlass/stories/Examples.stories.tsx +601 -105
  33. package/src/components/AtomixGlass/stories/Modes.stories.tsx +30 -12
  34. package/src/components/AtomixGlass/stories/Playground.stories.tsx +173 -38
  35. package/src/components/AtomixGlass/stories/ShaderVariants.stories.tsx +18 -18
  36. package/src/components/AtomixGlass/stories/shared-components.tsx +27 -5
  37. package/src/components/Breadcrumb/Breadcrumb.tsx +8 -3
  38. package/src/components/Button/Button.tsx +62 -17
  39. package/src/components/Callout/Callout.test.tsx +8 -14
  40. package/src/components/Card/Card.tsx +103 -1
  41. package/src/components/Card/index.ts +3 -2
  42. package/src/components/Footer/Footer.stories.tsx +1 -2
  43. package/src/components/Footer/Footer.tsx +0 -5
  44. package/src/components/Footer/FooterLink.tsx +3 -2
  45. package/src/components/Footer/FooterSection.tsx +0 -7
  46. package/src/components/Icon/index.ts +1 -1
  47. package/src/components/Modal/Modal.stories.tsx +29 -38
  48. package/src/components/Modal/Modal.tsx +4 -4
  49. package/src/components/Navigation/Nav/NavItem.tsx +8 -3
  50. package/src/components/Navigation/SideMenu/SideMenu.tsx +49 -41
  51. package/src/components/Navigation/SideMenu/SideMenuItem.tsx +63 -19
  52. package/src/components/Popover/Popover.tsx +1 -1
  53. package/src/components/VideoPlayer/VideoPlayer.stories.tsx +977 -400
  54. package/src/components/VideoPlayer/VideoPlayer.tsx +1 -6
  55. package/src/lib/composables/shared-mouse-tracker.ts +133 -0
  56. package/src/lib/composables/useAtomixGlass.ts +303 -115
  57. package/src/lib/theme/ThemeManager.integration.test.ts +124 -0
  58. package/src/lib/theme/ThemeManager.stories.tsx +13 -13
  59. package/src/lib/theme/ThemeManager.test.ts +4 -0
  60. package/src/lib/theme/ThemeManager.ts +203 -59
  61. package/src/lib/theme/ThemeProvider.tsx +183 -33
  62. package/src/lib/theme/composeTheme.ts +375 -0
  63. package/src/lib/theme/createTheme.test.ts +475 -0
  64. package/src/lib/theme/createTheme.ts +510 -0
  65. package/src/lib/theme/generateCSSVariables.ts +713 -0
  66. package/src/lib/theme/index.ts +67 -0
  67. package/src/lib/theme/themeUtils.ts +333 -0
  68. package/src/lib/theme/types.ts +337 -8
  69. package/src/lib/theme/useTheme.test.tsx +2 -1
  70. package/src/lib/theme/useTheme.ts +6 -22
  71. package/src/lib/types/components.ts +152 -57
  72. package/src/styles/01-settings/_index.scss +2 -2
  73. package/src/styles/01-settings/_settings.badge.scss +2 -2
  74. package/src/styles/01-settings/_settings.border-radius.scss +1 -1
  75. package/src/styles/01-settings/{_settings.maps.scss → _settings.design-tokens.scss} +163 -49
  76. package/src/styles/01-settings/_settings.modal.scss +1 -1
  77. package/src/styles/01-settings/_settings.spacing.scss +14 -13
  78. package/src/styles/03-generic/_generic.root.scss +131 -50
  79. package/src/styles/05-objects/_objects.block.scss +1 -1
  80. package/src/styles/06-components/_components.atomix-glass.scss +20 -22
  81. package/src/styles/06-components/_components.badge.scss +2 -2
  82. package/src/styles/06-components/_components.button.scss +1 -1
  83. package/src/styles/06-components/_components.callout.scss +1 -1
  84. package/src/styles/06-components/_components.card.scss +74 -2
  85. package/src/styles/06-components/_components.chart.scss +1 -1
  86. package/src/styles/06-components/_components.dropdown.scss +6 -0
  87. package/src/styles/06-components/_components.footer.scss +1 -1
  88. package/src/styles/06-components/_components.list-group.scss +1 -1
  89. package/src/styles/06-components/_components.list.scss +1 -1
  90. package/src/styles/06-components/_components.menu.scss +1 -1
  91. package/src/styles/06-components/_components.messages.scss +1 -1
  92. package/src/styles/06-components/_components.modal.scss +7 -2
  93. package/src/styles/06-components/_components.navbar.scss +1 -1
  94. package/src/styles/06-components/_components.popover.scss +10 -0
  95. package/src/styles/06-components/_components.product-review.scss +1 -1
  96. package/src/styles/06-components/_components.progress.scss +1 -1
  97. package/src/styles/06-components/_components.rating.scss +1 -1
  98. package/src/styles/06-components/_components.spinner.scss +1 -1
  99. package/src/styles/99-utilities/_utilities.background.scss +1 -1
  100. package/src/styles/99-utilities/_utilities.border.scss +1 -1
  101. package/src/styles/99-utilities/_utilities.link.scss +1 -1
  102. package/src/styles/99-utilities/_utilities.text.scss +1 -1
@@ -0,0 +1,475 @@
1
+ /**
2
+ * createTheme Tests
3
+ *
4
+ * Tests for the createTheme function and related utilities
5
+ */
6
+
7
+ import { describe, it, expect } from 'vitest';
8
+ import { createTheme } from './createTheme';
9
+ import { generateCSSVariables } from './generateCSSVariables';
10
+ import { mergeTheme, extendTheme, createThemeVariants } from './composeTheme';
11
+ import { lighten, darken, alpha, getContrastText } from './themeUtils';
12
+
13
+ describe('createTheme', () => {
14
+ it('should create a theme with default values', () => {
15
+ const theme = createTheme();
16
+
17
+ expect(theme).toBeDefined();
18
+ expect(theme.__isJSTheme).toBe(true);
19
+ expect(theme.palette).toBeDefined();
20
+ expect(theme.typography).toBeDefined();
21
+ expect(theme.spacing).toBeDefined();
22
+ expect(theme.breakpoints).toBeDefined();
23
+ });
24
+
25
+ it('should create a theme with custom palette', () => {
26
+ const theme = createTheme({
27
+ palette: {
28
+ primary: { main: '#FF0000' },
29
+ secondary: { main: '#00FF00' },
30
+ },
31
+ });
32
+
33
+ expect(theme.palette.primary.main).toBe('#FF0000');
34
+ expect(theme.palette.secondary.main).toBe('#00FF00');
35
+ expect(theme.palette.primary.light).toBeDefined();
36
+ expect(theme.palette.primary.dark).toBeDefined();
37
+ expect(theme.palette.primary.contrastText).toBeDefined();
38
+ });
39
+
40
+ it('should create a theme with custom typography', () => {
41
+ const theme = createTheme({
42
+ typography: {
43
+ fontFamily: 'Arial, sans-serif',
44
+ fontSize: 16,
45
+ },
46
+ });
47
+
48
+ expect(theme.typography.fontFamily).toBe('Arial, sans-serif');
49
+ expect(theme.typography.fontSize).toBe(16);
50
+ });
51
+
52
+ it('should create spacing function', () => {
53
+ const theme = createTheme({ spacing: 8 });
54
+
55
+ expect(theme.spacing(1)).toBe('8px');
56
+ expect(theme.spacing(2)).toBe('16px');
57
+ expect(theme.spacing(1, 2)).toBe('8px 16px');
58
+ });
59
+
60
+ it('should create breakpoints with helpers', () => {
61
+ const theme = createTheme();
62
+
63
+ expect(theme.breakpoints.up('sm')).toContain('min-width');
64
+ expect(theme.breakpoints.down('md')).toContain('max-width');
65
+ expect(theme.breakpoints.between('sm', 'lg')).toContain('min-width');
66
+ });
67
+
68
+ it('should merge multiple theme options', () => {
69
+ const theme = createTheme(
70
+ { palette: { primary: { main: '#000' } } },
71
+ { palette: { secondary: { main: '#FFF' } } }
72
+ );
73
+
74
+ expect(theme.palette.primary.main).toBe('#000');
75
+ expect(theme.palette.secondary.main).toBe('#FFF');
76
+ });
77
+ });
78
+
79
+ describe('CSS Variable Generation', () => {
80
+ it('should generate CSS variables from theme', () => {
81
+ const theme = createTheme({
82
+ palette: {
83
+ primary: { main: '#7AFFD7' },
84
+ },
85
+ });
86
+
87
+ const css = generateCSSVariables(theme);
88
+
89
+ expect(css).toContain('--atomix-primary');
90
+ expect(css).toContain('#7AFFD7');
91
+ expect(css).toContain(':root');
92
+ });
93
+
94
+ it('should generate CSS variables with custom selector', () => {
95
+ const theme = createTheme();
96
+ const css = generateCSSVariables(theme, { selector: '.my-theme' });
97
+
98
+ expect(css).toContain('.my-theme');
99
+ });
100
+
101
+ it('should generate CSS variables with custom prefix', () => {
102
+ const theme = createTheme();
103
+ const css = generateCSSVariables(theme, { prefix: 'custom' });
104
+
105
+ expect(css).toContain('--custom-primary');
106
+ });
107
+
108
+ describe('Border Radius Variables', () => {
109
+ it('should generate all border radius variables', () => {
110
+ const theme = createTheme();
111
+ const css = generateCSSVariables(theme);
112
+
113
+ expect(css).toContain('--atomix-border-radius');
114
+ expect(css).toContain('--atomix-border-radius-sm');
115
+ expect(css).toContain('--atomix-border-radius-lg');
116
+ expect(css).toContain('--atomix-border-radius-xl');
117
+ expect(css).toContain('--atomix-border-radius-xxl');
118
+ expect(css).toContain('--atomix-border-radius-2xl');
119
+ expect(css).toContain('--atomix-border-radius-3xl');
120
+ expect(css).toContain('--atomix-border-radius-4xl');
121
+ expect(css).toContain('--atomix-border-radius-pill');
122
+ });
123
+
124
+ it('should use custom border radius values', () => {
125
+ const theme = createTheme({
126
+ borderRadius: {
127
+ base: '1rem',
128
+ sm: '0.5rem',
129
+ lg: '1.5rem',
130
+ },
131
+ });
132
+ const css = generateCSSVariables(theme);
133
+
134
+ expect(css).toContain('--atomix-border-radius: 1rem');
135
+ expect(css).toContain('--atomix-border-radius-sm: 0.5rem');
136
+ expect(css).toContain('--atomix-border-radius-lg: 1.5rem');
137
+ });
138
+
139
+ it('should accept numeric border radius values', () => {
140
+ const theme = createTheme({
141
+ borderRadius: {
142
+ base: 8,
143
+ sm: 4,
144
+ },
145
+ });
146
+ const css = generateCSSVariables(theme);
147
+
148
+ expect(css).toContain('--atomix-border-radius: 8px');
149
+ expect(css).toContain('--atomix-border-radius-sm: 4px');
150
+ });
151
+ });
152
+
153
+ describe('Color Palette Scales', () => {
154
+ it('should generate primary color scale (1-10)', () => {
155
+ const theme = createTheme({
156
+ palette: {
157
+ primary: { main: '#7AFFD7' },
158
+ },
159
+ });
160
+ const css = generateCSSVariables(theme);
161
+
162
+ for (let i = 1; i <= 10; i++) {
163
+ expect(css).toContain(`--atomix-primary-${i}`);
164
+ }
165
+ });
166
+
167
+ it('should generate secondary color scale (1-10)', () => {
168
+ const theme = createTheme({
169
+ palette: {
170
+ secondary: { main: '#FF5733' },
171
+ },
172
+ });
173
+ const css = generateCSSVariables(theme);
174
+
175
+ for (let i = 1; i <= 10; i++) {
176
+ expect(css).toContain(`--atomix-secondary-${i}`);
177
+ }
178
+ });
179
+
180
+ it('should generate gray color scale (1-10)', () => {
181
+ const theme = createTheme({
182
+ palette: {
183
+ text: {
184
+ primary: '#000000',
185
+ secondary: '#666666',
186
+ disabled: '#999999',
187
+ },
188
+ },
189
+ });
190
+ const css = generateCSSVariables(theme);
191
+
192
+ for (let i = 1; i <= 10; i++) {
193
+ expect(css).toContain(`--atomix-gray-${i}`);
194
+ }
195
+ });
196
+
197
+ it('should generate semantic color scales (red, green, blue, yellow)', () => {
198
+ const theme = createTheme({
199
+ palette: {
200
+ error: { main: '#F44336' },
201
+ success: { main: '#4CAF50' },
202
+ info: { main: '#2196F3' },
203
+ warning: { main: '#FF9800' },
204
+ },
205
+ });
206
+ const css = generateCSSVariables(theme);
207
+
208
+ // Red scale from error
209
+ for (let i = 1; i <= 10; i++) {
210
+ expect(css).toContain(`--atomix-red-${i}`);
211
+ }
212
+
213
+ // Green scale from success
214
+ for (let i = 1; i <= 10; i++) {
215
+ expect(css).toContain(`--atomix-green-${i}`);
216
+ }
217
+
218
+ // Blue scale from info
219
+ for (let i = 1; i <= 10; i++) {
220
+ expect(css).toContain(`--atomix-blue-${i}`);
221
+ }
222
+
223
+ // Yellow scale from warning
224
+ for (let i = 1; i <= 10; i++) {
225
+ expect(css).toContain(`--atomix-yellow-${i}`);
226
+ }
227
+ });
228
+
229
+ it('should generate color scale step 6 as the main color', () => {
230
+ const theme = createTheme({
231
+ palette: {
232
+ primary: { main: '#7AFFD7' },
233
+ },
234
+ });
235
+ const css = generateCSSVariables(theme);
236
+
237
+ // Step 6 should be the main color
238
+ expect(css).toMatch(/--atomix-primary-6:\s*#7AFFD7/i);
239
+ });
240
+ });
241
+
242
+ describe('Typography Variables', () => {
243
+ it('should generate root font size variable', () => {
244
+ const theme = createTheme({
245
+ typography: {
246
+ fontSize: 16,
247
+ },
248
+ });
249
+ const css = generateCSSVariables(theme);
250
+
251
+ expect(css).toContain('--atomix-root-font-size');
252
+ expect(css).toContain('16px');
253
+ });
254
+
255
+ it('should generate extended font size scale', () => {
256
+ const theme = createTheme({
257
+ typography: {
258
+ fontSize: 16,
259
+ },
260
+ });
261
+ const css = generateCSSVariables(theme);
262
+
263
+ expect(css).toContain('--atomix-font-size-xs');
264
+ expect(css).toContain('--atomix-font-size-sm');
265
+ expect(css).toContain('--atomix-font-size-md');
266
+ expect(css).toContain('--atomix-font-size-lg');
267
+ expect(css).toContain('--atomix-font-size-xl');
268
+ expect(css).toContain('--atomix-font-size-2xl');
269
+ });
270
+
271
+ it('should calculate font sizes correctly from base', () => {
272
+ const theme = createTheme({
273
+ typography: {
274
+ fontSize: 16,
275
+ },
276
+ });
277
+ const css = generateCSSVariables(theme);
278
+
279
+ // xs = 0.75 * 16 = 12px
280
+ expect(css).toMatch(/--atomix-font-size-xs:\s*12px/);
281
+ // sm = 0.875 * 16 = 14px
282
+ expect(css).toMatch(/--atomix-font-size-sm:\s*14px/);
283
+ // md = 1 * 16 = 16px
284
+ expect(css).toMatch(/--atomix-font-size-md:\s*16px/);
285
+ // lg = 1.125 * 16 = 18px
286
+ expect(css).toMatch(/--atomix-font-size-lg:\s*18px/);
287
+ // xl = 1.5 * 16 = 24px
288
+ expect(css).toMatch(/--atomix-font-size-xl:\s*24px/);
289
+ // 2xl = 2 * 16 = 32px
290
+ expect(css).toMatch(/--atomix-font-size-2xl:\s*32px/);
291
+ });
292
+ });
293
+
294
+ describe('Link Variables', () => {
295
+ it('should generate link decoration variables', () => {
296
+ const theme = createTheme({
297
+ palette: {
298
+ primary: { main: '#7AFFD7' },
299
+ },
300
+ });
301
+ const css = generateCSSVariables(theme);
302
+
303
+ expect(css).toContain('--atomix-link-decoration');
304
+ expect(css).toContain('--atomix-link-hover-decoration');
305
+ });
306
+
307
+ it('should set default link decoration values', () => {
308
+ const theme = createTheme({
309
+ palette: {
310
+ primary: { main: '#7AFFD7' },
311
+ },
312
+ });
313
+ const css = generateCSSVariables(theme);
314
+
315
+ expect(css).toContain('--atomix-link-decoration: underline');
316
+ expect(css).toContain('--atomix-link-hover-decoration: none');
317
+ });
318
+ });
319
+
320
+ describe('Code and Highlight Variables', () => {
321
+ it('should generate highlight background variable', () => {
322
+ const theme = createTheme();
323
+ const css = generateCSSVariables(theme);
324
+
325
+ expect(css).toContain('--atomix-highlight-bg');
326
+ });
327
+
328
+ it('should generate code color variable', () => {
329
+ const theme = createTheme({
330
+ palette: {
331
+ text: {
332
+ primary: '#000000',
333
+ secondary: '#666666',
334
+ disabled: '#999999',
335
+ },
336
+ },
337
+ });
338
+ const css = generateCSSVariables(theme);
339
+
340
+ expect(css).toContain('--atomix-code-color');
341
+ // Should use text secondary color (value may vary based on theme defaults)
342
+ expect(css).toMatch(/--atomix-code-color:\s*[^;]+/);
343
+ });
344
+
345
+ it('should use warning color for highlight background when available', () => {
346
+ const theme = createTheme({
347
+ palette: {
348
+ warning: { main: '#FF9800' },
349
+ },
350
+ });
351
+ const css = generateCSSVariables(theme);
352
+
353
+ expect(css).toContain('--atomix-highlight-bg');
354
+ // Should contain rgba with warning color
355
+ expect(css).toMatch(/--atomix-highlight-bg:\s*rgba\(/);
356
+ });
357
+ });
358
+
359
+ describe('Variable Format and Structure', () => {
360
+ it('should generate valid CSS variable syntax', () => {
361
+ const theme = createTheme();
362
+ const css = generateCSSVariables(theme);
363
+
364
+ // Check for valid CSS variable format: --name: value;
365
+ const variablePattern = /--[\w-]+:\s*[^;]+;/g;
366
+ const matches = css.match(variablePattern);
367
+ expect(matches).toBeTruthy();
368
+ expect(matches!.length).toBeGreaterThan(0);
369
+ });
370
+
371
+ it('should include all variable categories', () => {
372
+ const theme = createTheme({
373
+ palette: {
374
+ primary: { main: '#7AFFD7' },
375
+ secondary: { main: '#FF5733' },
376
+ error: { main: '#F44336' },
377
+ success: { main: '#4CAF50' },
378
+ info: { main: '#2196F3' },
379
+ warning: { main: '#FF9800' },
380
+ },
381
+ typography: {
382
+ fontSize: 16,
383
+ },
384
+ });
385
+ const css = generateCSSVariables(theme);
386
+
387
+ // Check for variables from each category
388
+ expect(css).toContain('--atomix-primary'); // Palette
389
+ expect(css).toContain('--atomix-body-font-family'); // Typography
390
+ expect(css).toContain('--atomix-box-shadow'); // Shadows
391
+ expect(css).toContain('--atomix-transition-duration'); // Transitions
392
+ expect(css).toContain('--atomix-z-modal'); // Z-index
393
+ expect(css).toContain('--atomix-breakpoint-sm'); // Breakpoints
394
+ expect(css).toContain('--atomix-spacing-4'); // Spacing
395
+ expect(css).toContain('--atomix-border-width'); // Borders
396
+ expect(css).toContain('--atomix-border-radius'); // Border radius
397
+ expect(css).toContain('--atomix-focus-ring-width'); // Focus ring
398
+ });
399
+
400
+ it('should not duplicate variables', () => {
401
+ const theme = createTheme();
402
+ const css = generateCSSVariables(theme);
403
+
404
+ // Extract all variable names
405
+ const variableNames = css.match(/--([\w-]+):/g) || [];
406
+ const uniqueNames = new Set(variableNames);
407
+
408
+ // Should have same count (no duplicates)
409
+ expect(variableNames.length).toBe(uniqueNames.size);
410
+ });
411
+ });
412
+ });
413
+
414
+ describe('Theme Composition', () => {
415
+ it('should merge themes', () => {
416
+ const merged = mergeTheme(
417
+ { palette: { primary: { main: '#000' } } },
418
+ { palette: { secondary: { main: '#FFF' } } }
419
+ );
420
+
421
+ const primary = merged.palette?.primary;
422
+ const secondary = merged.palette?.secondary;
423
+
424
+ expect(primary && typeof primary === 'object' ? primary.main : primary).toBe('#000');
425
+ expect(secondary && typeof secondary === 'object' ? secondary.main : secondary).toBe('#FFF');
426
+ });
427
+
428
+ it('should extend theme', () => {
429
+ const base = createTheme({ palette: { primary: { main: '#000' } } });
430
+ const extended = extendTheme(base, {
431
+ palette: { secondary: { main: '#FFF' } },
432
+ });
433
+
434
+ expect(extended.palette.primary.main).toBe('#000');
435
+ expect(extended.palette.secondary.main).toBe('#FFF');
436
+ });
437
+
438
+ it('should create theme variants', () => {
439
+ const { light, dark } = createThemeVariants({
440
+ palette: { primary: { main: '#7AFFD7' } },
441
+ });
442
+
443
+ expect(light).toBeDefined();
444
+ expect(dark).toBeDefined();
445
+ expect(dark.palette.background.default).toBe('#121212');
446
+ });
447
+ });
448
+
449
+ describe('Theme Utilities', () => {
450
+ it('should lighten color', () => {
451
+ const lightened = lighten('#000000', 0.5);
452
+ expect(lightened).not.toBe('#000000');
453
+ expect(lightened).toMatch(/^#[0-9a-f]{6}$/i);
454
+ });
455
+
456
+ it('should darken color', () => {
457
+ const darkened = darken('#FFFFFF', 0.5);
458
+ expect(darkened).not.toBe('#FFFFFF');
459
+ expect(darkened).toMatch(/^#[0-9a-f]{6}$/i);
460
+ });
461
+
462
+ it('should add alpha to color', () => {
463
+ const withAlpha = alpha('#FF0000', 0.5);
464
+ expect(withAlpha).toContain('rgba');
465
+ expect(withAlpha).toContain('0.5');
466
+ });
467
+
468
+ it('should get contrast text', () => {
469
+ const whiteContrast = getContrastText('#000000');
470
+ const blackContrast = getContrastText('#FFFFFF');
471
+
472
+ expect(whiteContrast).toBe('#FFFFFF');
473
+ expect(blackContrast).toBe('#000000');
474
+ });
475
+ });