@alfalab/core-components-navigation-bar-private 0.6.2 → 0.8.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 (52) hide show
  1. package/Component.js +5 -5
  2. package/components/back-arrow-addon/Component.js +1 -1
  3. package/components/back-arrow-addon/index.css +12 -12
  4. package/components/closer/Component.d.ts +5 -0
  5. package/components/closer/Component.js +15 -3
  6. package/components/closer/default.css +50 -0
  7. package/components/closer/index.css +6 -21
  8. package/components/closer/inverted.css +51 -0
  9. package/cssm/Component.js +4 -4
  10. package/cssm/components/closer/Component.d.ts +5 -0
  11. package/cssm/components/closer/Component.js +12 -2
  12. package/cssm/components/closer/default.module.css +49 -0
  13. package/cssm/components/closer/index.module.css +3 -18
  14. package/cssm/components/closer/inverted.module.css +50 -0
  15. package/cssm/types.d.ts +4 -0
  16. package/esm/Component.js +5 -5
  17. package/esm/components/back-arrow-addon/Component.js +1 -1
  18. package/esm/components/back-arrow-addon/index.css +12 -12
  19. package/esm/components/closer/Component.d.ts +5 -0
  20. package/esm/components/closer/Component.js +15 -3
  21. package/esm/components/closer/default.css +50 -0
  22. package/esm/components/closer/index.css +6 -21
  23. package/esm/components/closer/inverted.css +51 -0
  24. package/esm/index.css +27 -27
  25. package/esm/types.d.ts +4 -0
  26. package/index.css +27 -27
  27. package/modern/Component.js +3 -3
  28. package/modern/components/back-arrow-addon/Component.js +1 -1
  29. package/modern/components/back-arrow-addon/index.css +12 -12
  30. package/modern/components/closer/Component.d.ts +5 -0
  31. package/modern/components/closer/Component.js +15 -3
  32. package/modern/components/closer/default.css +50 -0
  33. package/modern/components/closer/index.css +6 -21
  34. package/modern/components/closer/inverted.css +51 -0
  35. package/modern/index.css +27 -27
  36. package/modern/types.d.ts +4 -0
  37. package/moderncssm/Component.js +2 -2
  38. package/moderncssm/components/closer/Component.d.ts +5 -0
  39. package/moderncssm/components/closer/Component.js +10 -2
  40. package/moderncssm/components/closer/default.module.css +18 -0
  41. package/moderncssm/components/closer/index.module.css +3 -14
  42. package/moderncssm/components/closer/inverted.module.css +20 -0
  43. package/moderncssm/types.d.ts +4 -0
  44. package/package.json +2 -2
  45. package/src/Component.tsx +2 -0
  46. package/src/components/closer/Component.tsx +18 -2
  47. package/src/components/closer/default.module.css +12 -0
  48. package/src/components/closer/index.module.css +0 -9
  49. package/src/components/closer/inverted.module.css +12 -0
  50. package/src/types.ts +5 -0
  51. package/src/vars.css +3 -0
  52. package/types.d.ts +4 -0
@@ -96,6 +96,10 @@ type NavigationBarPrivateProps = {
96
96
  * Обработчик закрытия
97
97
  */
98
98
  onClose?: CloserProps['onClose'];
99
+ /**
100
+ * Дополнительные пропсы для компонента Closer.
101
+ */
102
+ closerProps?: Omit<CloserProps, 'view' | 'onClose'>;
99
103
  /**
100
104
  * обработчик клика по кнопке "назад"
101
105
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfalab/core-components-navigation-bar-private",
3
- "version": "0.6.2",
3
+ "version": "0.8.0",
4
4
  "description": "Navigation bar private component",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -26,5 +26,5 @@
26
26
  "react": "^16.9.0 || ^17.0.1 || ^18.0.0"
27
27
  },
28
28
  "themesVersion": "13.7.2",
29
- "varsVersion": "9.18.0"
29
+ "varsVersion": "9.19.0"
30
30
  }
package/src/Component.tsx CHANGED
@@ -32,6 +32,7 @@ export const NavigationBarPrivate = forwardRef<HTMLDivElement, NavigationBarPriv
32
32
  titleSize = 'default',
33
33
  subtitle,
34
34
  hasCloser,
35
+ closerProps = {},
35
36
  hasBackButton,
36
37
  backButtonClassName,
37
38
  backButtonProps,
@@ -186,6 +187,7 @@ export const NavigationBarPrivate = forwardRef<HTMLDivElement, NavigationBarPriv
186
187
  icon={closerIcon}
187
188
  dataTestId={getDataTestId(dataTestId, 'closer')}
188
189
  onClose={onClose}
190
+ {...closerProps}
189
191
  />
190
192
  </div>
191
193
  );
@@ -1,11 +1,18 @@
1
1
  import React, { ButtonHTMLAttributes, ElementType, FC } from 'react';
2
2
  import cn from 'classnames';
3
3
 
4
- import { IconButton } from '@alfalab/core-components-icon-button';
4
+ import { IconButton, IconButtonProps } from '@alfalab/core-components-icon-button';
5
5
  import { CrossHeavyMIcon } from '@alfalab/icons-glyph/CrossHeavyMIcon';
6
6
  import { CrossMIcon } from '@alfalab/icons-glyph/CrossMIcon';
7
7
 
8
+ import defaultColors from './default.module.css';
8
9
  import styles from './index.module.css';
10
+ import invertedColors from './inverted.module.css';
11
+
12
+ const colorStyles = {
13
+ default: defaultColors,
14
+ inverted: invertedColors,
15
+ } as const;
9
16
 
10
17
  export interface CloserProps extends ButtonHTMLAttributes<HTMLButtonElement> {
11
18
  /**
@@ -33,6 +40,11 @@ export interface CloserProps extends ButtonHTMLAttributes<HTMLButtonElement> {
33
40
  */
34
41
  icon?: ElementType;
35
42
 
43
+ /**
44
+ * Набор цветов для компонента
45
+ */
46
+ colors?: IconButtonProps['colors'];
47
+
36
48
  /**
37
49
  * Идентификатор для систем автоматизированного тестирования
38
50
  */
@@ -52,6 +64,7 @@ export const Closer: FC<CloserProps> = ({
52
64
  className,
53
65
  sticky,
54
66
  icon = view === 'desktop' ? CrossHeavyMIcon : CrossMIcon,
67
+ colors = 'default',
55
68
  dataTestId,
56
69
  onClose,
57
70
  ...restProps
@@ -68,10 +81,13 @@ export const Closer: FC<CloserProps> = ({
68
81
  >
69
82
  <IconButton
70
83
  size={view === 'desktop' ? 's' : 'xs'}
71
- className={cn(styles.button, { [styles.mobile]: view === 'mobile' })}
84
+ className={cn(styles.button, colorStyles[colors].button, {
85
+ [colorStyles[colors].mobile]: view === 'mobile',
86
+ })}
72
87
  aria-label='закрыть'
73
88
  onClick={handleClick}
74
89
  icon={icon}
90
+ colors={colors}
75
91
  dataTestId={dataTestId}
76
92
  {...restProps}
77
93
  />
@@ -0,0 +1,12 @@
1
+ @import '@alfalab/core-components-vars/src/colors-monochrome.css';
2
+ @import '../../vars.css';
3
+
4
+ .button {
5
+ background: var(--color-light-monochrome-white-4);
6
+ color: var(--color-light-neutral-translucent-1300);
7
+
8
+ &.mobile {
9
+ background: var(--color-light-neutral-translucent-100);
10
+ color: var(--navigation-bar-closer-mobile-color);
11
+ }
12
+ }
@@ -1,6 +1,4 @@
1
1
  @import '@alfalab/core-components-vars/src/index.css';
2
- @import '@alfalab/core-components-vars/src/colors-monochrome.css';
3
- @import '../../vars.css';
4
2
 
5
3
  .closer {
6
4
  flex-shrink: 0;
@@ -13,14 +11,7 @@
13
11
  }
14
12
 
15
13
  .button {
16
- background: var(--color-static-monochrome-white-4);
17
14
  backdrop-filter: blur(10px);
18
- color: var(--color-light-neutral-translucent-1300);
19
-
20
- &.mobile {
21
- background: var(--color-light-neutral-translucent-100);
22
- color: var(--navigation-bar-closer-mobile-color);
23
- }
24
15
  }
25
16
 
26
17
  .button.button {
@@ -0,0 +1,12 @@
1
+ @import '@alfalab/core-components-vars/src/colors-monochrome.css';
2
+ @import '../../vars.css';
3
+
4
+ .button {
5
+ background: var(--color-light-monochrome-white-4-inverted);
6
+ color: var(--color-light-neutral-translucent-1300-inverted);
7
+
8
+ &.mobile {
9
+ background: var(--color-light-neutral-translucent-100-inverted);
10
+ color: var(--navigation-bar-closer-mobile-color-inverted);
11
+ }
12
+ }
package/src/types.ts CHANGED
@@ -119,6 +119,11 @@ export type NavigationBarPrivateProps = {
119
119
  */
120
120
  onClose?: CloserProps['onClose'];
121
121
 
122
+ /**
123
+ * Дополнительные пропсы для компонента Closer.
124
+ */
125
+ closerProps?: Omit<CloserProps, 'view' | 'onClose'>;
126
+
122
127
  /**
123
128
  * обработчик клика по кнопке "назад"
124
129
  */
package/src/vars.css CHANGED
@@ -3,6 +3,9 @@
3
3
  :root {
4
4
  /* closer-mobile */
5
5
  --navigation-bar-closer-mobile-color: var(--color-light-neutral-translucent-700);
6
+ --navigation-bar-closer-mobile-color-inverted: var(
7
+ --color-light-neutral-translucent-700-inverted
8
+ );
6
9
 
7
10
  /* back-arrow */
8
11
  --navigation-bar-back-arrow-mobile-fill: var(--color-light-neutral-translucent-700);
package/types.d.ts CHANGED
@@ -96,6 +96,10 @@ type NavigationBarPrivateProps = {
96
96
  * Обработчик закрытия
97
97
  */
98
98
  onClose?: CloserProps['onClose'];
99
+ /**
100
+ * Дополнительные пропсы для компонента Closer.
101
+ */
102
+ closerProps?: Omit<CloserProps, 'view' | 'onClose'>;
99
103
  /**
100
104
  * обработчик клика по кнопке "назад"
101
105
  */