@megafon/ui-shared 3.0.0-beta.9 → 3.1.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 (95) hide show
  1. package/CHANGELOG.md +48 -67
  2. package/README.md +2 -2
  3. package/dist/es/components/AccordionBox/AccordionBox.d.ts +5 -0
  4. package/dist/es/components/AccordionBox/AccordionBox.js +6 -1
  5. package/dist/es/components/BenefitsIcons/BenefitsIcons.js +1 -1
  6. package/dist/es/components/Breadcrumbs/Breadcrumbs.css +2 -2
  7. package/dist/es/components/Breadcrumbs/Breadcrumbs.d.ts +7 -2
  8. package/dist/es/components/Breadcrumbs/Breadcrumbs.js +48 -18
  9. package/dist/es/components/ButtonBanner/ButtonBanner.d.ts +1 -0
  10. package/dist/es/components/ButtonBanner/ButtonBanner.js +5 -1
  11. package/dist/es/components/ButtonLinkBox/ButtonLinkBox.d.ts +2 -0
  12. package/dist/es/components/ButtonLinkBox/ButtonLinkBox.js +9 -1
  13. package/dist/es/components/Card/Card.d.ts +4 -2
  14. package/dist/es/components/Card/Card.js +16 -6
  15. package/dist/es/components/Container/Container.css +163 -0
  16. package/dist/es/components/DownloadLinks/DownloadLink.css +1 -1
  17. package/dist/es/components/DownloadLinks/DownloadLink.d.ts +5 -0
  18. package/dist/es/components/DownloadLinks/DownloadLink.js +14 -6
  19. package/dist/es/components/Instructions/Instructions.d.ts +7 -0
  20. package/dist/es/components/Instructions/Instructions.js +55 -45
  21. package/dist/es/components/PageTitle/PageTitle.d.ts +6 -0
  22. package/dist/es/components/PageTitle/PageTitle.js +15 -4
  23. package/dist/es/components/Partners/Partners.d.ts +5 -4
  24. package/dist/es/components/Partners/Partners.js +15 -7
  25. package/dist/es/components/Property/Property.d.ts +3 -2
  26. package/dist/es/components/Property/Property.js +9 -3
  27. package/dist/es/components/Property/PropertyDescription.js +11 -5
  28. package/dist/es/components/Property/types.d.ts +3 -0
  29. package/dist/es/components/StoreBanner/StoreBanner.css +21 -22
  30. package/dist/es/components/StoreBanner/StoreBanner.d.ts +4 -0
  31. package/dist/es/components/StoreBanner/StoreBanner.js +19 -4
  32. package/dist/es/components/StoreBanner/doc/img/qr-code.png +0 -0
  33. package/dist/es/components/StoreButton/StoreButton.d.ts +1 -1
  34. package/dist/es/components/StoreButton/StoreButton.js +26 -7
  35. package/dist/es/components/Table/Table.css +1 -1
  36. package/dist/es/components/TextBox/TextBox.css +9 -0
  37. package/dist/es/components/TextWithIcon/TextWithIcon.css +15 -0
  38. package/dist/es/components/TextWithIcon/TextWithIcon.d.ts +19 -0
  39. package/dist/es/components/TextWithIcon/TextWithIcon.js +40 -0
  40. package/dist/es/components/TextWithIcon/TextWithIconItem.css +49 -0
  41. package/dist/es/components/TextWithIcon/TextWithIconItem.d.ts +18 -0
  42. package/dist/es/components/TextWithIcon/TextWithIconItem.js +35 -0
  43. package/dist/es/components/VideoBanner/VideoBanner.d.ts +7 -2
  44. package/dist/es/components/VideoBanner/VideoBanner.js +21 -5
  45. package/dist/es/components/VideoBlock/VideoBlock.d.ts +4 -3
  46. package/dist/es/components/VideoBlock/VideoBlock.js +12 -6
  47. package/dist/es/index.d.ts +2 -0
  48. package/dist/es/index.js +2 -0
  49. package/dist/lib/components/AccordionBox/AccordionBox.d.ts +5 -0
  50. package/dist/lib/components/AccordionBox/AccordionBox.js +6 -1
  51. package/dist/lib/components/BenefitsIcons/BenefitsIcons.js +1 -1
  52. package/dist/lib/components/Breadcrumbs/Breadcrumbs.css +2 -2
  53. package/dist/lib/components/Breadcrumbs/Breadcrumbs.d.ts +7 -2
  54. package/dist/lib/components/Breadcrumbs/Breadcrumbs.js +49 -17
  55. package/dist/lib/components/ButtonBanner/ButtonBanner.d.ts +1 -0
  56. package/dist/lib/components/ButtonBanner/ButtonBanner.js +5 -1
  57. package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.d.ts +2 -0
  58. package/dist/lib/components/ButtonLinkBox/ButtonLinkBox.js +9 -1
  59. package/dist/lib/components/Card/Card.d.ts +4 -2
  60. package/dist/lib/components/Card/Card.js +16 -6
  61. package/dist/lib/components/Container/Container.css +163 -0
  62. package/dist/lib/components/DownloadLinks/DownloadLink.css +1 -1
  63. package/dist/lib/components/DownloadLinks/DownloadLink.d.ts +5 -0
  64. package/dist/lib/components/DownloadLinks/DownloadLink.js +13 -5
  65. package/dist/lib/components/Instructions/Instructions.d.ts +7 -0
  66. package/dist/lib/components/Instructions/Instructions.js +55 -44
  67. package/dist/lib/components/PageTitle/PageTitle.d.ts +6 -0
  68. package/dist/lib/components/PageTitle/PageTitle.js +17 -5
  69. package/dist/lib/components/Partners/Partners.d.ts +5 -4
  70. package/dist/lib/components/Partners/Partners.js +15 -7
  71. package/dist/lib/components/Property/Property.d.ts +3 -2
  72. package/dist/lib/components/Property/Property.js +9 -3
  73. package/dist/lib/components/Property/PropertyDescription.js +11 -4
  74. package/dist/lib/components/Property/types.d.ts +3 -0
  75. package/dist/lib/components/StoreBanner/StoreBanner.css +21 -22
  76. package/dist/lib/components/StoreBanner/StoreBanner.d.ts +4 -0
  77. package/dist/lib/components/StoreBanner/StoreBanner.js +19 -4
  78. package/dist/lib/components/StoreBanner/doc/img/qr-code.png +0 -0
  79. package/dist/lib/components/StoreButton/StoreButton.d.ts +1 -1
  80. package/dist/lib/components/StoreButton/StoreButton.js +30 -9
  81. package/dist/lib/components/Table/Table.css +1 -1
  82. package/dist/lib/components/TextBox/TextBox.css +9 -0
  83. package/dist/lib/components/TextWithIcon/TextWithIcon.css +15 -0
  84. package/dist/lib/components/TextWithIcon/TextWithIcon.d.ts +19 -0
  85. package/dist/lib/components/TextWithIcon/TextWithIcon.js +60 -0
  86. package/dist/lib/components/TextWithIcon/TextWithIconItem.css +49 -0
  87. package/dist/lib/components/TextWithIcon/TextWithIconItem.d.ts +18 -0
  88. package/dist/lib/components/TextWithIcon/TextWithIconItem.js +54 -0
  89. package/dist/lib/components/VideoBanner/VideoBanner.d.ts +7 -2
  90. package/dist/lib/components/VideoBanner/VideoBanner.js +21 -5
  91. package/dist/lib/components/VideoBlock/VideoBlock.d.ts +4 -3
  92. package/dist/lib/components/VideoBlock/VideoBlock.js +12 -6
  93. package/dist/lib/index.d.ts +2 -0
  94. package/dist/lib/index.js +16 -0
  95. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -3,136 +3,117 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- # [3.0.0-beta.9](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.0-beta.8...@megafon/ui-shared@3.0.0-beta.9) (2022-02-08)
7
-
8
- **Note:** Version bump only for package @megafon/ui-shared
9
-
10
-
6
+ # [3.1.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.3...@megafon/ui-shared@3.1.0) (2022-02-22)
11
7
 
12
8
 
9
+ ### Bug Fixes
13
10
 
14
- # [3.0.0-beta.8](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.0-beta.7...@megafon/ui-shared@3.0.0-beta.8) (2022-02-08)
11
+ * **videobanner:** update snapshots ([77de901](https://github.com/MegafonWebLab/megafon-ui/commit/77de901fa76793cf76dc776b3234b2d792befd9a))
12
+ * fix Breadcrumbs, ButtonLinkBox, Card, CardBox, Container, DownloadLink & VideoBanner snapshots ([e149e2d](https://github.com/MegafonWebLab/megafon-ui/commit/e149e2d40ececff0065ec1d800fb807fabfe8640))
13
+ * **breadcrumbs:** allow to pass items as array of JSX elements ([1ca1583](https://github.com/MegafonWebLab/megafon-ui/commit/1ca158390c7c58b5ff117ae8ad16268b043d5ddb))
14
+ * **colors:** fix colors usage ([f2f59a8](https://github.com/MegafonWebLab/megafon-ui/commit/f2f59a81644c157394817af1531dabb1c0b67b19))
15
+ * **components:** better view of default props values ([1817ed5](https://github.com/MegafonWebLab/megafon-ui/commit/1817ed5cd17fd78a0911a89020138f05d7af9833))
15
16
 
16
17
 
17
18
  ### Features
18
19
 
19
- * **accordionbox:** remove prop hasVerticalPaddings ([82218ad](https://github.com/MegafonWebLab/megafon-ui/commit/82218ad0307c3f566cf9f582a824733e3523be3d))
20
+ * **textwithiconitem:** add type string[] for text prop ([0df9680](https://github.com/MegafonWebLab/megafon-ui/commit/0df9680e10058ea24783fbc41cbce17e9b2a5594))
21
+ * **ui-shared:** add dataAttrs prop for interactive elements of components that did not have ([6b2fad8](https://github.com/MegafonWebLab/megafon-ui/commit/6b2fad84e72269d1fac0408e0b7e94202866b4aa))
22
+ * **videobanner:** added new classes for video ([d8b84a0](https://github.com/MegafonWebLab/megafon-ui/commit/d8b84a003103cf5f66102d354d2625e30a2c0d2a))
20
23
 
21
24
 
22
- ### BREAKING CHANGES
23
25
 
24
- * **accordionbox:** remove prop hasVerticalPaddings
25
26
 
26
27
 
28
+ ## [3.0.3](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.2...@megafon/ui-shared@3.0.3) (2022-02-15)
27
29
 
28
-
29
-
30
- # [3.0.0-beta.7](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.0-beta.6...@megafon/ui-shared@3.0.0-beta.7) (2022-02-04)
31
-
32
-
33
- ### Bug Fixes
34
-
35
- * **components:** change tests for dataAttrs prop ([2a8f306](https://github.com/MegafonWebLab/megafon-ui/commit/2a8f3061a4e89f6877894e5947db7bae2827f86a))
30
+ **Note:** Version bump only for package @megafon/ui-shared
36
31
 
37
32
 
38
33
 
39
34
 
40
35
 
41
- # [3.0.0-beta.6](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.0-beta.5...@megafon/ui-shared@3.0.0-beta.6) (2022-02-02)
36
+ ## [3.0.2](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.0...@megafon/ui-shared@3.0.2) (2022-02-11)
42
37
 
43
38
 
44
39
  ### Bug Fixes
45
40
 
46
- * color props values changes ([b279f2b](https://github.com/MegafonWebLab/megafon-ui/commit/b279f2b5af0edae92fe9825bbfa90a207cb8009a))
47
- * remove deprecated props values ([add76f3](https://github.com/MegafonWebLab/megafon-ui/commit/add76f38a9ebad8b5b6504dfe6aae862746f0dfc))
48
- * **core:** fix build ui-core ([458c824](https://github.com/MegafonWebLab/megafon-ui/commit/458c824aab639e4802db261d0416b3cee58ac274))
41
+ * revert mistake version ([cc8668a](https://github.com/MegafonWebLab/megafon-ui/commit/cc8668a9ff2bc5fde6bf93ca806d4406a5944107))
49
42
 
50
43
 
51
- ### BREAKING CHANGES
52
44
 
53
- * ContentArea: prop color change values from 'base' to 'white' and from 'content' to 'default';
54
- remove depreacted value 'freshAsphalt'
55
- Paragraph: prop color change values from 'base' to 'white' and from 'contend' to 'default';
56
- remove deprecared values 'freshAsphalt' and 'clearWhite'
57
- StoreBanner: prop theme change value from 'black' to 'default'; remove deprecated value 'clearWhite'
58
- * ContentArea, Paragraph, StoreBanner and Breadcrumbs components from no don't have
59
- freshAsphalt and clearWhite as values for colorize props
60
45
 
61
46
 
47
+ # [3.0.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@2.3.0...@megafon/ui-shared@3.0.0) (2022-02-09)
62
48
 
63
49
 
50
+ ### Bug Fixes
64
51
 
65
- # [3.0.0-beta.5](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.0-beta.4...@megafon/ui-shared@3.0.0-beta.5) (2022-01-28)
52
+ * **components:** change tests for dataAttrs prop ([eae8ecb](https://github.com/MegafonWebLab/megafon-ui/commit/eae8ecb5104c050ec0e67357ed5edecdfb042838))
53
+ * color props values changes ([9e3dd31](https://github.com/MegafonWebLab/megafon-ui/commit/9e3dd31a8fd57012482c68c1173aae74028aa3a9))
54
+ * remove deprecated props values ([d09c460](https://github.com/MegafonWebLab/megafon-ui/commit/d09c4606ce6e41f7144e18c2216d039d859288e2))
55
+ * **accordion-box:** change type of onClickAccordion prop ([f464221](https://github.com/MegafonWebLab/megafon-ui/commit/f4642216a3869d7f11005f0162f009225f9661c4))
56
+ * **colors:** renabe green and purple to brandGreen and brandPurple to avoid postcss-colormin bug ([089dd42](https://github.com/MegafonWebLab/megafon-ui/commit/089dd42cd18db7fc83e690da45d09b88c636a6f7))
57
+ * **core:** fix build ui-core ([fa9522a](https://github.com/MegafonWebLab/megafon-ui/commit/fa9522ac0931edb7ec772ad040557997db080687))
66
58
 
67
59
 
68
60
  ### Features
69
61
 
70
- * **header:** made header as a functional component ([81701ad](https://github.com/MegafonWebLab/megafon-ui/commit/81701ad87b6e9df2fe630bf4e183383264c0bb01))
71
-
72
-
73
-
74
-
75
-
76
- # [3.0.0-beta.4](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.0-beta.3...@megafon/ui-shared@3.0.0-beta.4) (2022-01-27)
77
-
78
- **Note:** Version bump only for package @megafon/ui-shared
79
-
80
-
81
-
82
-
83
-
84
- # [3.0.0-beta.3](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.0-beta.2...@megafon/ui-shared@3.0.0-beta.3) (2022-01-24)
85
-
86
-
87
- ### Bug Fixes
88
-
89
- * **accordion-box:** change type of onClickAccordion prop ([5d5cef5](https://github.com/MegafonWebLab/megafon-ui/commit/5d5cef5e2dd70efa808a6146e29daf1c882af304))
62
+ * **accordionbox:** remove prop hasVerticalPaddings ([7dfe546](https://github.com/MegafonWebLab/megafon-ui/commit/7dfe546336aa0a94643299309e90fe7e56936e85))
63
+ * **colors:** css custom properties and color themes support ([16df5b7](https://github.com/MegafonWebLab/megafon-ui/commit/16df5b7b2644e15bb6c6e49e7347c0f8e4839e58))
64
+ * **header:** made header as a functional component ([b983934](https://github.com/MegafonWebLab/megafon-ui/commit/b983934ced137ede35f64ce2dfe0c953c1690db0))
65
+ * **textwithicon:** prop items removed, list items are now added by child components ([44ee66c](https://github.com/MegafonWebLab/megafon-ui/commit/44ee66c3964da1111957553c75046407f789e673))
90
66
 
91
67
 
92
68
  ### BREAKING CHANGES
93
69
 
70
+ * **textwithicon:** prop items removed, list items are now added by child components
71
+ * **accordionbox:** remove prop hasVerticalPaddings
94
72
  * **accordion-box:** remove parameter 'title' in onClickAccordion prop
73
+ * **colors:** green, green20, green80, purple, purple20 and purple80 colors now have 'brand'
74
+ prefix (e.g. brandGreen)
75
+ * **contentarea**: prop color change values from 'base' to 'white' and from 'content' to 'default';
76
+ remove depreacted value 'freshAsphalt'
77
+ * **contentarea**, **paragraph**, **storebanner** and **breadcrumbs** components from no don't have
78
+ 'freshAsphalt' and 'clearWhite' as values for colorizing props
79
+ * **storebanner**: prop theme change value from 'black' to 'default'; remove deprecated value 'clearWhite'
80
+ * **components:** for the components to work correctly, now it's needed to import colors.css file
95
81
 
96
82
 
97
83
 
98
84
 
99
-
100
- # [3.0.0-beta.2](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.0-beta.1...@megafon/ui-shared@3.0.0-beta.2) (2022-01-21)
101
-
102
- **Note:** Version bump only for package @megafon/ui-shared
85
+ # [2.3.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@2.2.1...@megafon/ui-shared@2.3.0) (2022-02-07)
103
86
 
104
87
 
88
+ ### Features
105
89
 
90
+ * **container:** fix margin rules for component TextWithIcon ([3c2de9d](https://github.com/MegafonWebLab/megafon-ui/commit/3c2de9db5a01bdd246daee22dd5545e21dce55ba))
91
+ * **textbox:** add styles for use TextWithIcon inside component ([c993657](https://github.com/MegafonWebLab/megafon-ui/commit/c993657a2f143f87607a7d1474d44c4596d73558))
106
92
 
107
93
 
108
- # [3.0.0-beta.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@3.0.0-beta.0...@megafon/ui-shared@3.0.0-beta.1) (2022-01-20)
109
94
 
110
95
 
111
- ### Bug Fixes
112
96
 
113
- * **colors:** renabe green and purple to brandGreen and brandPurple to avoid postcss-colormin bug ([563d97c](https://github.com/MegafonWebLab/megafon-ui/commit/563d97c42900099415a6872f57b500b87aeed647))
97
+ ## [2.2.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@2.2.0...@megafon/ui-shared@2.2.1) (2022-01-31)
114
98
 
115
99
 
116
- ### BREAKING CHANGES
100
+ ### Bug Fixes
117
101
 
118
- * **colors:** green, green20, green80, purple, purple20 and purple80 colors now have 'brand'
119
- prefix (e.g. brandGreen)
102
+ * **storebanner:** update qr code image for storebanner examples and fix qr code container styles ([1845222](https://github.com/MegafonWebLab/megafon-ui/commit/1845222e5211e70a8f5aa36ab4a710ecd46e8a14))
120
103
 
121
104
 
122
105
 
123
106
 
124
107
 
125
- # [3.0.0-beta.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@2.1.5...@megafon/ui-shared@3.0.0-beta.0) (2022-01-19)
108
+ # [2.2.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@2.1.5...@megafon/ui-shared@2.2.0) (2022-01-24)
126
109
 
127
110
 
128
111
  ### Features
129
112
 
130
- * **colors:** css custom properties and color themes support ([b19a9a5](https://github.com/MegafonWebLab/megafon-ui/commit/b19a9a5112ebc7427d60f6514d606dd9d71ca444))
131
-
132
-
133
- ### BREAKING CHANGES
134
-
135
- * **colors:** read commit description
113
+ * **accordionbox:** props hasVerticalPaddings marked as deprecated ([7dbb43b](https://github.com/MegafonWebLab/megafon-ui/commit/7dbb43b1178f4055ecd0f4eed5614024da638091))
114
+ * **container:** add rules for TextWithIcon component ([4c692ab](https://github.com/MegafonWebLab/megafon-ui/commit/4c692ab43db115dc7c5aeba39713d6f2ae2daaff))
115
+ * **textwithicon:** add component TextWithIcon ([b772728](https://github.com/MegafonWebLab/megafon-ui/commit/b772728b8739dbbfa550eef1c8eedb56cda620c9))
116
+ * **videoblock:** made button optional ([eef7c17](https://github.com/MegafonWebLab/megafon-ui/commit/eef7c174415b28fe3512d8c28fcd9bb73774dd2e))
136
117
 
137
118
 
138
119
 
package/README.md CHANGED
@@ -5,10 +5,10 @@ React UI components library.
5
5
  ## Getting started
6
6
 
7
7
  ```bash
8
- $ npm install --save @megafon/ui-shared@beta
8
+ $ npm install --save @megafon/ui-shared
9
9
  ```
10
10
  ```bash
11
- $ yarn add @megafon/ui-shared@beta
11
+ $ yarn add @megafon/ui-shared
12
12
  ```
13
13
 
14
14
  ## Development notes
@@ -4,6 +4,11 @@ export interface IAccordionBox {
4
4
  /** Дополнительные data атрибуты к внутренним элементам */
5
5
  dataAttrs?: {
6
6
  root?: Record<string, string>;
7
+ header?: Record<string, string>;
8
+ collapse?: Record<string, string>;
9
+ titleWrap?: Record<string, string>;
10
+ arrowUp?: Record<string, string>;
11
+ arrowDown?: Record<string, string>;
7
12
  };
8
13
  /** Ссылка на корневой элемент */
9
14
  rootRef?: React.Ref<HTMLDivElement>;
@@ -42,7 +42,12 @@ var AccordionBox = function AccordionBox(_a) {
42
42
 
43
43
  AccordionBox.propTypes = {
44
44
  dataAttrs: PropTypes.shape({
45
- root: PropTypes.objectOf(PropTypes.string.isRequired)
45
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
46
+ header: PropTypes.objectOf(PropTypes.string.isRequired),
47
+ collapse: PropTypes.objectOf(PropTypes.string.isRequired),
48
+ titleWrap: PropTypes.objectOf(PropTypes.string.isRequired),
49
+ arrowUp: PropTypes.objectOf(PropTypes.string.isRequired),
50
+ arrowDown: PropTypes.objectOf(PropTypes.string.isRequired)
46
51
  }),
47
52
  rootRef: PropTypes.oneOfType([PropTypes.func, PropTypes.oneOfType([PropTypes.shape({
48
53
  current: PropTypes.elementType
@@ -128,7 +128,7 @@ var cn = cnCreate('mfui-benefits-icons');
128
128
  var BenefitsIcons = function BenefitsIcons(_ref) {
129
129
  var rootRef = _ref.rootRef,
130
130
  _ref$iconPosition = _ref.iconPosition,
131
- iconPosition = _ref$iconPosition === void 0 ? IconPositionEnum.LEFT_TOP : _ref$iconPosition,
131
+ iconPosition = _ref$iconPosition === void 0 ? 'left-top' : _ref$iconPosition,
132
132
  _ref$inOneColumn = _ref.inOneColumn,
133
133
  inOneColumn = _ref$inOneColumn === void 0 ? false : _ref$inOneColumn,
134
134
  items = _ref.items,
@@ -30,12 +30,12 @@ h5 {
30
30
  .mfui-breadcrumbs__item {
31
31
  position: relative;
32
32
  margin-right: 10px;
33
- padding-left: 22px;
33
+ padding-left: 26px;
34
34
  }
35
35
  .mfui-breadcrumbs__item:before {
36
36
  content: '→';
37
37
  position: absolute;
38
- top: -2px;
38
+ top: -1px;
39
39
  left: 0;
40
40
  }
41
41
  .mfui-breadcrumbs__item:first-child {
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import './Breadcrumbs.less';
3
- declare type ItemType = {
4
- component?: React.ReactElement;
3
+ declare type ItemObjectType = {
5
4
  title?: string;
6
5
  href?: string;
6
+ component?: React.ReactElement;
7
7
  };
8
+ declare type ItemType = JSX.Element | ItemObjectType;
8
9
  export declare const TextColor: {
9
10
  readonly DEFAULT: "default";
10
11
  readonly BLACK: "black";
@@ -12,6 +13,10 @@ export declare const TextColor: {
12
13
  };
13
14
  declare type TextColorType = typeof TextColor[keyof typeof TextColor];
14
15
  export declare type Props = {
16
+ dataAttrs?: {
17
+ root?: Record<string, string>;
18
+ link?: Record<string, string>;
19
+ };
15
20
  className?: string;
16
21
  classes?: {
17
22
  item?: string;
@@ -1,8 +1,10 @@
1
1
  import "core-js/modules/es.array.map";
2
2
  import "core-js/modules/es.object.values";
3
+ import "core-js/modules/es.string.link";
4
+ import _extends from "@babel/runtime/helpers/extends";
3
5
  import React from 'react';
4
6
  import { TextLink } from '@megafon/ui-core';
5
- import { cnCreate } from '@megafon/ui-helpers';
7
+ import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
6
8
  import PropTypes from 'prop-types';
7
9
  import "./Breadcrumbs.css";
8
10
  export var TextColor = {
@@ -10,6 +12,15 @@ export var TextColor = {
10
12
  BLACK: 'black',
11
13
  WHITE: 'white'
12
14
  };
15
+
16
+ function isObjectElement(item) {
17
+ return !React.isValidElement(item);
18
+ }
19
+
20
+ function isJSXElement(item) {
21
+ return React.isValidElement(item);
22
+ }
23
+
13
24
  var cn = cnCreate('mfui-breadcrumbs');
14
25
 
15
26
  var Breadcrumbs = function Breadcrumbs(_ref) {
@@ -18,34 +29,53 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
18
29
  color = _ref$color === void 0 ? 'black' : _ref$color,
19
30
  className = _ref.className,
20
31
  _ref$classes = _ref.classes,
21
- classes = _ref$classes === void 0 ? {} : _ref$classes;
22
- return /*#__PURE__*/React.createElement("div", {
32
+ classes = _ref$classes === void 0 ? {} : _ref$classes,
33
+ dataAttrs = _ref.dataAttrs;
34
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
23
35
  className: cn({
24
36
  color: color
25
37
  }, className)
26
- }, items.map(function (_ref2) {
27
- var component = _ref2.component,
28
- title = _ref2.title,
29
- href = _ref2.href;
30
- return /*#__PURE__*/React.createElement("div", {
31
- className: cn('item', classes.item),
32
- key: title
33
- }, component, !component && /*#__PURE__*/React.createElement(TextLink, {
34
- href: href,
35
- color: color
36
- }, component || title));
38
+ }), items.map(function (item, i) {
39
+ if (isJSXElement(item)) {
40
+ return /*#__PURE__*/React.createElement("div", {
41
+ className: cn('item', classes.item),
42
+ key: i
43
+ }, item);
44
+ }
45
+
46
+ if (isObjectElement(item)) {
47
+ return /*#__PURE__*/React.createElement("div", {
48
+ className: cn('item', classes.item),
49
+ key: item.component ? i : item.title
50
+ }, item.component || /*#__PURE__*/React.createElement(TextLink, {
51
+ href: item.href,
52
+ color: color,
53
+ dataAttrs: {
54
+ root: (dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link) ? _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link, i + 1)) : undefined
55
+ }
56
+ }, item.title));
57
+ }
58
+
59
+ return null;
37
60
  }));
38
61
  };
39
62
 
40
63
  Breadcrumbs.propTypes = {
64
+ dataAttrs: PropTypes.shape({
65
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
66
+ link: PropTypes.objectOf(PropTypes.string.isRequired)
67
+ }),
41
68
  className: PropTypes.string,
42
69
  classes: PropTypes.shape({
43
70
  item: PropTypes.string
44
71
  }),
45
- items: PropTypes.arrayOf(PropTypes.shape({
46
- title: PropTypes.string.isRequired,
47
- href: PropTypes.string
48
- }).isRequired).isRequired,
72
+ items: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element.isRequired), PropTypes.arrayOf(PropTypes.shape({
73
+ title: PropTypes.string,
74
+ href: PropTypes.string,
75
+
76
+ /* @deprecated */
77
+ component: PropTypes.element
78
+ }).isRequired)]).isRequired,
49
79
  color: PropTypes.oneOf(Object.values(TextColor))
50
80
  };
51
81
  export default Breadcrumbs;
@@ -19,6 +19,7 @@ export interface IButtonBannerProps {
19
19
  /** Дополнительные data атрибуты к внутренним элементам */
20
20
  dataAttrs?: {
21
21
  root?: Record<string, string>;
22
+ button?: Record<string, string>;
22
23
  };
23
24
  /** Дополнительный css класс для корневого элемента */
24
25
  className?: string;
@@ -47,6 +47,9 @@ var ButtonBanner = function ButtonBanner(_ref) {
47
47
  imageScaling = _ref$imageScaling === void 0 ? 'cover' : _ref$imageScaling,
48
48
  onButtonClick = _ref.onButtonClick;
49
49
  var buttonElem = /*#__PURE__*/React.createElement(Button, {
50
+ dataAttrs: {
51
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
52
+ },
50
53
  className: cn('button', [classes.button]),
51
54
  href: buttonUrl,
52
55
  target: buttonTarget,
@@ -86,7 +89,8 @@ var ButtonBanner = function ButtonBanner(_ref) {
86
89
 
87
90
  ButtonBanner.propTypes = {
88
91
  dataAttrs: PropTypes.shape({
89
- root: PropTypes.objectOf(PropTypes.string.isRequired)
92
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
93
+ button: PropTypes.objectOf(PropTypes.string.isRequired)
90
94
  }),
91
95
  className: PropTypes.string,
92
96
  classes: PropTypes.shape({
@@ -4,6 +4,8 @@ export interface IButtonLinkBoxProps {
4
4
  /** Дополнительные data атрибуты к внутренним элементам */
5
5
  dataAttrs?: {
6
6
  root?: Record<string, string>;
7
+ link?: Record<string, string>;
8
+ button?: Record<string, string>;
7
9
  };
8
10
  /** Дополнительный класс корневого элемента */
9
11
  className?: string;
@@ -34,6 +34,9 @@ var ButtonLinkBox = function ButtonLinkBox(_ref) {
34
34
  }), buttonTitle && /*#__PURE__*/React.createElement("div", {
35
35
  className: cn('row')
36
36
  }, /*#__PURE__*/React.createElement(Button, {
37
+ dataAttrs: {
38
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
39
+ },
37
40
  className: classes.button,
38
41
  href: buttonUrl,
39
42
  theme: buttonColor,
@@ -43,6 +46,9 @@ var ButtonLinkBox = function ButtonLinkBox(_ref) {
43
46
  }, buttonTitle)), linkTitle && /*#__PURE__*/React.createElement("div", {
44
47
  className: cn('row')
45
48
  }, /*#__PURE__*/React.createElement(TextLink, {
49
+ dataAttrs: {
50
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link
51
+ },
46
52
  className: classes.link,
47
53
  href: linkUrl,
48
54
  download: linkDownload,
@@ -54,7 +60,9 @@ var ButtonLinkBox = function ButtonLinkBox(_ref) {
54
60
 
55
61
  ButtonLinkBox.propTypes = {
56
62
  dataAttrs: PropTypes.shape({
57
- root: PropTypes.objectOf(PropTypes.string.isRequired)
63
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
64
+ link: PropTypes.objectOf(PropTypes.string.isRequired),
65
+ button: PropTypes.objectOf(PropTypes.string.isRequired)
58
66
  }),
59
67
  className: PropTypes.string,
60
68
  classes: PropTypes.shape({
@@ -23,9 +23,11 @@ export declare const ObjectFit: {
23
23
  };
24
24
  declare type ObjectFitType = typeof ObjectFit[keyof typeof ObjectFit];
25
25
  export interface ICard {
26
- /** Дата атрибуты для корневого элемента */
26
+ /** Дополнительные data атрибуты к внутренним элементам */
27
27
  dataAttrs?: {
28
- [key: string]: string;
28
+ root?: Record<string, string>;
29
+ link?: Record<string, string>;
30
+ button?: Record<string, string>;
29
31
  };
30
32
  /** Дополнительный класс корневого элемента */
31
33
  className?: string;
@@ -84,12 +84,15 @@ var Card = function Card(_ref) {
84
84
  }
85
85
 
86
86
  return /*#__PURE__*/React.createElement(TextLink, {
87
- className: cn('link', [classes.link]),
88
87
  href: linkHref,
88
+ download: download,
89
89
  target: linkTarget,
90
- download: download
90
+ dataAttrs: {
91
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link
92
+ },
93
+ className: cn('link', [classes.link])
91
94
  }, linkTitle);
92
- }, [link, isCardLink, classes]);
95
+ }, [link, isCardLink, classes, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.link]);
93
96
  var renderBtn = React.useCallback(function () {
94
97
  if (!button || isCardLink) {
95
98
  return null;
@@ -100,12 +103,15 @@ var Card = function Card(_ref) {
100
103
  btnTarget = button.target,
101
104
  buttonDownload = button.download;
102
105
  return /*#__PURE__*/React.createElement(Button, {
106
+ dataAttrs: {
107
+ root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button
108
+ },
103
109
  className: cn('button', [classes.button]),
104
110
  href: btnHref,
105
111
  target: btnTarget,
106
112
  download: buttonDownload
107
113
  }, btnTitle);
108
- }, [button, isCardLink, classes]);
114
+ }, [button, isCardLink, classes, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.button]);
109
115
  var renderBtnsWrapper = React.useCallback(function () {
110
116
  var btnElem = renderBtn();
111
117
  var linkElem = renderLink();
@@ -120,7 +126,7 @@ var Card = function Card(_ref) {
120
126
  })
121
127
  }, btnElem, linkElem);
122
128
  }, [renderBtn, renderLink, isAlignAvailable, isLeftHAlign]);
123
- return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs), {
129
+ return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
124
130
  className: cn('', {
125
131
  href: !!href,
126
132
  'full-height': isFullHeight,
@@ -140,7 +146,11 @@ var Card = function Card(_ref) {
140
146
  };
141
147
 
142
148
  Card.propTypes = {
143
- dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired),
149
+ dataAttrs: PropTypes.shape({
150
+ root: PropTypes.objectOf(PropTypes.string.isRequired),
151
+ link: PropTypes.objectOf(PropTypes.string.isRequired),
152
+ button: PropTypes.objectOf(PropTypes.string.isRequired)
153
+ }),
144
154
  className: PropTypes.string,
145
155
  classes: PropTypes.shape({
146
156
  root: PropTypes.string,