@lumx/react 3.13.2 → 3.13.3-alpha.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 (29) hide show
  1. package/index.d.ts +27 -24
  2. package/index.js +62 -44
  3. package/index.js.map +1 -1
  4. package/package.json +3 -3
  5. package/src/components/avatar/Avatar.stories.tsx +1 -1
  6. package/src/components/avatar/Avatar.tsx +1 -1
  7. package/src/components/button/IconButton.tsx +4 -2
  8. package/src/components/date-picker/DatePickerField.stories.tsx +21 -0
  9. package/src/components/expansion-panel/ExpansionPanel.stories.tsx +58 -0
  10. package/src/components/expansion-panel/ExpansionPanel.tsx +7 -3
  11. package/src/components/icon/Icon.tsx +6 -5
  12. package/src/components/image-block/ImageCaption.tsx +3 -2
  13. package/src/components/image-lightbox/ImageLightbox.stories.tsx +2 -6
  14. package/src/components/image-lightbox/ImageLightbox.tsx +14 -12
  15. package/src/components/image-lightbox/internal/ImageSlideshow.tsx +2 -11
  16. package/src/components/index.ts +2 -33
  17. package/src/components/inline-list/InlineList.tsx +4 -5
  18. package/src/components/link/Link.tsx +11 -5
  19. package/src/components/text/Text.tsx +4 -5
  20. package/src/utils/className/fontColorClass.test.ts +15 -0
  21. package/src/utils/className/fontColorClass.ts +12 -0
  22. package/src/utils/className/index.ts +2 -1
  23. package/src/utils/className/resolveColorWithVariants.test.ts +33 -0
  24. package/src/utils/className/resolveColorWithVariants.ts +11 -0
  25. package/src/utils/date/getMonthCalendar.test.ts +2 -2
  26. package/src/utils/date/getMonthCalendar.ts +11 -2
  27. package/src/utils/type/color/index.ts +43 -0
  28. package/src/utils/className/getFontColorClassName.test.ts +0 -11
  29. package/src/utils/className/getFontColorClassName.ts +0 -9
@@ -0,0 +1,43 @@
1
+ import type { ValueOf } from '@lumx/react/utils/type';
2
+
3
+ /**
4
+ * See SCSS variable $lumx-color-palette
5
+ */
6
+ export const ColorPalette = {
7
+ primary: 'primary',
8
+ secondary: 'secondary',
9
+ blue: 'blue',
10
+ dark: 'dark',
11
+ green: 'green',
12
+ yellow: 'yellow',
13
+ red: 'red',
14
+ light: 'light',
15
+ grey: 'grey',
16
+ } as const;
17
+ export type ColorPalette = ValueOf<typeof ColorPalette>;
18
+ export type Color = ColorPalette | string;
19
+
20
+ /**
21
+ * See SCSS variable $lumx-color-variants
22
+ */
23
+ export const ColorVariant = {
24
+ D1: 'D1',
25
+ D2: 'D2',
26
+ L1: 'L1',
27
+ L2: 'L2',
28
+ L3: 'L3',
29
+ L4: 'L4',
30
+ L5: 'L5',
31
+ L6: 'L6',
32
+ N: 'N',
33
+ } as const;
34
+ export type ColorVariant = ValueOf<typeof ColorVariant>;
35
+
36
+ /** ColorPalette with all possible color variant combination */
37
+ export type ColorWithVariants =
38
+ | ColorPalette
39
+ | Exclude<
40
+ `${ColorPalette}-${ColorVariant}`,
41
+ // No dark variant for light and dark
42
+ `light-D${number}` | `dark-D${number}`
43
+ >;
@@ -1,11 +0,0 @@
1
- import { getFontColorClassName } from '@lumx/react/utils/className/getFontColorClassName';
2
-
3
- describe(getFontColorClassName, () => {
4
- it('should get lumx class for font color', () => {
5
- expect(getFontColorClassName('dark')).toBe('lumx-color-font-dark-N');
6
- });
7
-
8
- it('should get lumx class for font color with variant', () => {
9
- expect(getFontColorClassName('red', 'L2')).toBe('lumx-color-font-red-L2');
10
- });
11
- });
@@ -1,9 +0,0 @@
1
- import { ColorPalette, ColorVariant } from '@lumx/react';
2
-
3
- /**
4
- * Returns the classname associated to the given color and variant.
5
- * For example, for 'dark' and 'L2' it returns `lumx-color-font-dark-l2`
6
- */
7
- export const getFontColorClassName = (color: ColorPalette, colorVariant: ColorVariant = ColorVariant.N) => {
8
- return `lumx-color-font-${color}-${colorVariant}`;
9
- };