@alfalab/core-components-radio-group 4.3.3 → 4.5.0

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 (34) hide show
  1. package/Component.responsive.d.ts +8 -0
  2. package/Component.responsive.js +2 -2
  3. package/components/base-radio-group/Component.js +1 -1
  4. package/components/base-radio-group/index.css +43 -35
  5. package/cssm/Component.responsive.d.ts +8 -0
  6. package/cssm/Component.responsive.js +2 -2
  7. package/cssm/components/base-radio-group/index.module.css +23 -15
  8. package/cssm/desktop/desktop.module.css +6 -2
  9. package/cssm/mobile/mobile.module.css +11 -5
  10. package/cssm/vars.css +6 -2
  11. package/desktop/Component.desktop.js +1 -1
  12. package/desktop/desktop.css +10 -6
  13. package/esm/Component.responsive.d.ts +8 -0
  14. package/esm/Component.responsive.js +2 -2
  15. package/esm/components/base-radio-group/Component.js +1 -1
  16. package/esm/components/base-radio-group/index.css +43 -35
  17. package/esm/desktop/Component.desktop.js +1 -1
  18. package/esm/desktop/desktop.css +10 -6
  19. package/esm/mobile/Component.mobile.js +1 -1
  20. package/esm/mobile/mobile.css +15 -9
  21. package/mobile/Component.mobile.js +1 -1
  22. package/mobile/mobile.css +15 -9
  23. package/modern/Component.responsive.d.ts +8 -0
  24. package/modern/Component.responsive.js +2 -2
  25. package/modern/components/base-radio-group/Component.js +1 -1
  26. package/modern/components/base-radio-group/index.css +43 -35
  27. package/modern/desktop/Component.desktop.js +1 -1
  28. package/modern/desktop/desktop.css +10 -6
  29. package/modern/mobile/Component.mobile.js +1 -1
  30. package/modern/mobile/mobile.css +15 -9
  31. package/package.json +5 -3
  32. package/src/Component.responsive.tsx +7 -2
  33. package/src/components/base-radio-group/index.module.css +9 -9
  34. package/src/vars.css +2 -2
@@ -12,13 +12,18 @@ export type RadioGroupProps = Omit<BaseRadioGroupProps, 'styles'> & {
12
12
  * @default 1024
13
13
  */
14
14
  breakpoint?: number;
15
+
16
+ /**
17
+ * Значение по-умолчанию для хука useMatchMedia
18
+ */
19
+ defaultMatchMediaValue?: boolean | (() => boolean);
15
20
  };
16
21
 
17
22
  export const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(
18
- ({ breakpoint = 1024, ...restProps }, ref) => {
23
+ ({ breakpoint = 1024, defaultMatchMediaValue, ...restProps }, ref) => {
19
24
  const query = `(min-width: ${breakpoint}px)`;
20
25
 
21
- const [isDesktop] = useMatchMedia(query);
26
+ const [isDesktop] = useMatchMedia(query, defaultMatchMediaValue);
22
27
 
23
28
  const Component = isDesktop ? RadioGroupDesktop : RadioGroupMobile;
24
29
 
@@ -6,11 +6,11 @@
6
6
  }
7
7
 
8
8
  .error {
9
- padding-left: var(--gap-s);
9
+ padding-left: var(--gap-12);
10
10
  border-left: 1px solid var(--color-light-status-negative);
11
11
 
12
12
  &.tag {
13
- padding-left: var(--gap-xs);
13
+ padding-left: var(--gap-8);
14
14
  }
15
15
  }
16
16
 
@@ -25,11 +25,11 @@
25
25
 
26
26
  .horizontalRadioList {
27
27
  flex-wrap: wrap;
28
- margin-bottom: var(--gap-xs-neg);
28
+ margin-bottom: var(--gap-8-neg);
29
29
  }
30
30
 
31
31
  .verticalRadio {
32
- margin-bottom: var(--gap-s);
32
+ margin-bottom: var(--gap-12);
33
33
 
34
34
  &:last-child {
35
35
  margin-bottom: 0;
@@ -37,12 +37,12 @@
37
37
  }
38
38
 
39
39
  .horizontalRadio {
40
- margin-right: var(--gap-xl);
41
- margin-bottom: var(--gap-xs);
40
+ margin-right: var(--gap-24);
41
+ margin-bottom: var(--gap-8);
42
42
  }
43
43
 
44
44
  .horizontalTagLabel {
45
- margin-right: var(--gap-xs);
45
+ margin-right: var(--gap-8);
46
46
  }
47
47
 
48
48
  .horizontalRadio:last-child,
@@ -51,12 +51,12 @@
51
51
  }
52
52
 
53
53
  .label {
54
- margin-bottom: var(--gap-s);
54
+ margin-bottom: var(--gap-12);
55
55
  }
56
56
 
57
57
  .sub {
58
58
  @mixin paragraph_component_secondary;
59
- margin-top: var(--gap-s);
59
+ margin-top: var(--gap-12);
60
60
  }
61
61
 
62
62
  .errorMessage {
package/src/vars.css CHANGED
@@ -8,7 +8,7 @@
8
8
  --radio-group-list-padding-left: 0;
9
9
 
10
10
  /* mobile */
11
- --radio-group-mobile-sub-padding-left: var(--gap-2xs);
12
- --radio-group-mobile-list-padding-left: var(--gap-3xs);
11
+ --radio-group-mobile-sub-padding-left: var(--gap-4);
12
+ --radio-group-mobile-list-padding-left: var(--gap-2);
13
13
  --radio-group-mobile-label-color: var(--color-light-text-secondary);
14
14
  }