@megafon/ui-core 3.0.0-beta.6 → 3.0.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.
- package/CHANGELOG.md +51 -67
- package/dist/es/colors/Colors.d.ts +2 -2
- package/dist/es/components/Accordion/Accordion.css +1 -15
- package/dist/es/components/Accordion/Accordion.d.ts +11 -5
- package/dist/es/components/Accordion/Accordion.js +16 -14
- package/dist/es/components/Banner/Banner.css +28 -0
- package/dist/es/components/Banner/Banner.d.ts +12 -0
- package/dist/es/components/Banner/Banner.js +40 -21
- package/dist/es/components/Banner/BannerDot.d.ts +3 -0
- package/dist/es/components/Banner/BannerDot.js +8 -3
- package/dist/es/components/Button/Button.d.ts +8 -2
- package/dist/es/components/Button/Button.js +17 -9
- package/dist/es/components/Calendar/Calendar.js +3 -2
- package/dist/es/components/Calendar/components/Day/Day.js +1 -1
- package/dist/es/components/Carousel/Carousel.d.ts +9 -2
- package/dist/es/components/Carousel/Carousel.js +31 -22
- package/dist/es/components/Checkbox/Checkbox.d.ts +8 -2
- package/dist/es/components/Checkbox/Checkbox.js +13 -8
- package/dist/es/components/Collapse/Collapse.d.ts +15 -3
- package/dist/es/components/Collapse/Collapse.js +11 -4
- package/dist/es/components/Counter/Counter.js +3 -3
- package/dist/es/components/Header/Header.d.ts +5 -2
- package/dist/es/components/Header/Header.js +4 -2
- package/dist/es/components/InputLabel/InputLabel.d.ts +3 -0
- package/dist/es/components/InputLabel/InputLabel.js +9 -4
- package/dist/es/components/Link/Link.d.ts +7 -3
- package/dist/es/components/Link/Link.js +26 -10
- package/dist/es/components/Notification/Notification.d.ts +8 -0
- package/dist/es/components/Notification/Notification.js +21 -4
- package/dist/es/components/Pagination/Pagination.d.ts +9 -2
- package/dist/es/components/Pagination/Pagination.js +20 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +12 -7
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +10 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
- package/dist/es/components/Pagination/helpers.d.ts +1 -1
- package/dist/es/components/Paragraph/Paragraph.css +0 -9
- package/dist/es/components/Paragraph/Paragraph.d.ts +4 -3
- package/dist/es/components/Paragraph/Paragraph.js +9 -7
- package/dist/es/components/Preloader/Preloader.d.ts +4 -0
- package/dist/es/components/Preloader/Preloader.js +10 -5
- package/dist/es/components/RadioButton/RadioButton.d.ts +7 -2
- package/dist/es/components/RadioButton/RadioButton.js +11 -7
- package/dist/es/components/Search/Search.js +4 -3
- package/dist/es/components/Select/Select.css +5 -2
- package/dist/es/components/Select/Select.d.ts +43 -50
- package/dist/es/components/Select/Select.js +374 -461
- package/dist/es/components/Select/reducer/selectReducer.d.ts +34 -0
- package/dist/es/components/Select/reducer/selectReducer.js +123 -0
- package/dist/es/components/Switcher/Switcher.css +19 -15
- package/dist/es/components/Switcher/Switcher.js +1 -1
- package/dist/es/components/Tabs/Tab.d.ts +5 -2
- package/dist/es/components/Tabs/Tab.js +4 -2
- package/dist/es/components/Tabs/Tabs.d.ts +10 -0
- package/dist/es/components/Tabs/Tabs.js +123 -70
- package/dist/es/components/TextField/TextField.d.ts +11 -1
- package/dist/es/components/TextField/TextField.js +36 -20
- package/dist/es/components/TextLink/TextLink.js +6 -1
- package/dist/es/components/Tile/Tile.d.ts +5 -2
- package/dist/es/components/Tile/Tile.js +2 -2
- package/dist/es/components/Tooltip/Tooltip.d.ts +5 -0
- package/dist/es/components/Tooltip/Tooltip.js +27 -19
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +1 -0
- package/dist/lib/colors/Colors.d.ts +2 -2
- package/dist/lib/components/Accordion/Accordion.css +1 -15
- package/dist/lib/components/Accordion/Accordion.d.ts +11 -5
- package/dist/lib/components/Accordion/Accordion.js +16 -14
- package/dist/lib/components/Banner/Banner.css +28 -0
- package/dist/lib/components/Banner/Banner.d.ts +12 -0
- package/dist/lib/components/Banner/Banner.js +40 -20
- package/dist/lib/components/Banner/BannerDot.d.ts +3 -0
- package/dist/lib/components/Banner/BannerDot.js +10 -2
- package/dist/lib/components/Button/Button.d.ts +8 -2
- package/dist/lib/components/Button/Button.js +17 -9
- package/dist/lib/components/Calendar/Calendar.js +3 -3
- package/dist/lib/components/Calendar/components/Day/Day.js +1 -1
- package/dist/lib/components/Carousel/Carousel.d.ts +9 -2
- package/dist/lib/components/Carousel/Carousel.js +29 -20
- package/dist/lib/components/Checkbox/Checkbox.d.ts +8 -2
- package/dist/lib/components/Checkbox/Checkbox.js +13 -8
- package/dist/lib/components/Collapse/Collapse.d.ts +15 -3
- package/dist/lib/components/Collapse/Collapse.js +13 -4
- package/dist/lib/components/Counter/Counter.js +3 -3
- package/dist/lib/components/Header/Header.d.ts +5 -2
- package/dist/lib/components/Header/Header.js +4 -2
- package/dist/lib/components/InputLabel/InputLabel.d.ts +3 -0
- package/dist/lib/components/InputLabel/InputLabel.js +11 -3
- package/dist/lib/components/Link/Link.d.ts +7 -3
- package/dist/lib/components/Link/Link.js +37 -23
- package/dist/lib/components/Notification/Notification.d.ts +8 -0
- package/dist/lib/components/Notification/Notification.js +20 -3
- package/dist/lib/components/Pagination/Pagination.d.ts +9 -2
- package/dist/lib/components/Pagination/Pagination.js +20 -2
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +12 -6
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +9 -1
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
- package/dist/lib/components/Pagination/helpers.d.ts +1 -1
- package/dist/lib/components/Paragraph/Paragraph.css +0 -9
- package/dist/lib/components/Paragraph/Paragraph.d.ts +4 -3
- package/dist/lib/components/Paragraph/Paragraph.js +11 -6
- package/dist/lib/components/Preloader/Preloader.d.ts +4 -0
- package/dist/lib/components/Preloader/Preloader.js +10 -4
- package/dist/lib/components/RadioButton/RadioButton.d.ts +7 -2
- package/dist/lib/components/RadioButton/RadioButton.js +11 -7
- package/dist/lib/components/Search/Search.js +4 -3
- package/dist/lib/components/Select/Select.css +5 -2
- package/dist/lib/components/Select/Select.d.ts +43 -50
- package/dist/lib/components/Select/Select.js +368 -484
- package/dist/lib/components/Select/reducer/selectReducer.d.ts +34 -0
- package/dist/lib/components/Select/reducer/selectReducer.js +136 -0
- package/dist/lib/components/Switcher/Switcher.css +19 -15
- package/dist/lib/components/Switcher/Switcher.js +1 -1
- package/dist/lib/components/Tabs/Tab.d.ts +5 -2
- package/dist/lib/components/Tabs/Tab.js +4 -2
- package/dist/lib/components/Tabs/Tabs.d.ts +10 -0
- package/dist/lib/components/Tabs/Tabs.js +123 -70
- package/dist/lib/components/TextField/TextField.d.ts +11 -1
- package/dist/lib/components/TextField/TextField.js +34 -19
- package/dist/lib/components/TextLink/TextLink.js +6 -1
- package/dist/lib/components/Tile/Tile.d.ts +5 -2
- package/dist/lib/components/Tile/Tile.js +2 -2
- package/dist/lib/components/Tooltip/Tooltip.d.ts +5 -0
- package/dist/lib/components/Tooltip/Tooltip.js +26 -18
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +8 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,21 +3,49 @@
|
|
|
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
|
|
6
|
+
# [3.0.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.5.0...@megafon/ui-core@3.0.0) (2022-02-09)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
10
10
|
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* **
|
|
14
|
-
* **
|
|
15
|
-
* **
|
|
16
|
-
* **
|
|
11
|
+
* **accordion:** add focus on arrow after tab press, add open/close accordion after enter press ([5c49447](https://github.com/MegafonWebLab/megafon-ui/commit/5c494474dc319593283b339c63936fd2b862a33f))
|
|
12
|
+
* **accordion:** change type of onClickAccordion prop ([b74e196](https://github.com/MegafonWebLab/megafon-ui/commit/b74e1963587a140bb25b8e50e64490a1337dda78))
|
|
13
|
+
* **calendar/month:** add focus on month arrows, add enter press handlers ([caad017](https://github.com/MegafonWebLab/megafon-ui/commit/caad0176a9d272b19da11ddfac1830d863d090ae))
|
|
14
|
+
* **checkbox:** add focus on custom checkbox, add enter press handler ([136872c](https://github.com/MegafonWebLab/megafon-ui/commit/136872c84c058502a46d5b6db5088bebd71ebdb8))
|
|
15
|
+
* **checkbox:** add isChecked state, change type of onChange prop ([be62e30](https://github.com/MegafonWebLab/megafon-ui/commit/be62e30f43dcee4c43cab5425c4ddc0c6954f3f7))
|
|
16
|
+
* **colors:** fix colors component ([a45d223](https://github.com/MegafonWebLab/megafon-ui/commit/a45d223e8af199df87c7b0a1fb8278093ecd54b9))
|
|
17
|
+
* **colors:** remove unused classname modifiers ([2536f98](https://github.com/MegafonWebLab/megafon-ui/commit/2536f9878456979e1ea56615ca99eaa19b6ab7a3))
|
|
18
|
+
* **colors:** remove unused method ([50ee358](https://github.com/MegafonWebLab/megafon-ui/commit/50ee358233787dd3f855abea071ea11aa9df9785))
|
|
19
|
+
* **colors:** renabe green and purple to brandGreen and brandPurple to avoid postcss-colormin bug ([089dd42](https://github.com/MegafonWebLab/megafon-ui/commit/089dd42cd18db7fc83e690da45d09b88c636a6f7))
|
|
20
|
+
* **colors:** rename green and purple to brandGreen and brandPurple ([e8ec148](https://github.com/MegafonWebLab/megafon-ui/commit/e8ec1488a249748ca6468bfa53eed56e9fcbb5e4))
|
|
21
|
+
* **colors:** update color values on colors page when user switches theme ([8eb66de](https://github.com/MegafonWebLab/megafon-ui/commit/8eb66dec2ef9de5615ad8c921c422b6a9f00893a))
|
|
22
|
+
* **components:** change tests for dataAttrs prop ([eae8ecb](https://github.com/MegafonWebLab/megafon-ui/commit/eae8ecb5104c050ec0e67357ed5edecdfb042838))
|
|
23
|
+
* **core:** fix build ui-core ([fa9522a](https://github.com/MegafonWebLab/megafon-ui/commit/fa9522ac0931edb7ec772ad040557997db080687))
|
|
24
|
+
* **core:** separated colors.css file ([3a0af6b](https://github.com/MegafonWebLab/megafon-ui/commit/3a0af6b31d711016faa92bc7402ce02c6d8710ae))
|
|
25
|
+
* **less:** import base.less file through reference ([20bd43d](https://github.com/MegafonWebLab/megafon-ui/commit/20bd43d60f9cfac102c55ccdf183578702d2eb96))
|
|
26
|
+
* **paragraph:** remove spbSky... values from color prop ([3a74e2b](https://github.com/MegafonWebLab/megafon-ui/commit/3a74e2ba23b41a1982f72cb1a869e0253c903180))
|
|
27
|
+
* **switcher:** fix switcher design ([642d679](https://github.com/MegafonWebLab/megafon-ui/commit/642d679d6c48c4a96093220415a68c9444d8cb53))
|
|
28
|
+
* color props values changes ([9e3dd31](https://github.com/MegafonWebLab/megafon-ui/commit/9e3dd31a8fd57012482c68c1173aae74028aa3a9))
|
|
29
|
+
* remove deprecated props values ([d09c460](https://github.com/MegafonWebLab/megafon-ui/commit/d09c4606ce6e41f7144e18c2216d039d859288e2))
|
|
30
|
+
* **textlink:** fix color prop type ([4e93cce](https://github.com/MegafonWebLab/megafon-ui/commit/4e93ccef6bcbb1a5e670089dfafe308c23fcbe1e))
|
|
31
|
+
* **tooltip:** add check event function from ui-helpers ([18ef333](https://github.com/MegafonWebLab/megafon-ui/commit/18ef333ba78f7804731da2116b124cdc44a8dfcb))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* **accordion:** remove prop hasVerticalPaddings ([c1f0139](https://github.com/MegafonWebLab/megafon-ui/commit/c1f01398154497ed69fb2bb725077e3cc3b5c47e))
|
|
37
|
+
* **colors:** css custom properties and color themes support ([16df5b7](https://github.com/MegafonWebLab/megafon-ui/commit/16df5b7b2644e15bb6c6e49e7347c0f8e4839e58))
|
|
38
|
+
* **components:** add dataAttrs props in new format ([e9cf812](https://github.com/MegafonWebLab/megafon-ui/commit/e9cf8122ac47f83a8e744e0695351d60aa711dbd))
|
|
39
|
+
* **header:** made header as a functional component ([b983934](https://github.com/MegafonWebLab/megafon-ui/commit/b983934ced137ede35f64ce2dfe0c953c1690db0))
|
|
40
|
+
* **radiobutton:** made radiobutton as a functional component ([b225e1d](https://github.com/MegafonWebLab/megafon-ui/commit/b225e1d5e1964fd1e7010a9051586fb627cc90c3))
|
|
41
|
+
* **select:** made select as a functional component ([fc9cfc2](https://github.com/MegafonWebLab/megafon-ui/commit/fc9cfc25505952080bf90095ab183367915d27e6))
|
|
42
|
+
* **styles:** export css version for base.less ([acdea73](https://github.com/MegafonWebLab/megafon-ui/commit/acdea73462713156dee077fde4c223879e356b4d))
|
|
17
43
|
|
|
18
44
|
|
|
19
45
|
### BREAKING CHANGES
|
|
20
46
|
|
|
47
|
+
* **paragraph:** remove from color prop values: spbSky0, spbSky1, spbSky2
|
|
48
|
+
* **accordion:** remove prop hasVerticalPaddings
|
|
21
49
|
* ContentArea: prop color change values from 'base' to 'white' and from 'content' to 'default';
|
|
22
50
|
remove depreacted value 'freshAsphalt'
|
|
23
51
|
Paragraph: prop color change values from 'base' to 'white' and from 'contend' to 'default';
|
|
@@ -25,100 +53,56 @@ remove deprecared values 'freshAsphalt' and 'clearWhite'
|
|
|
25
53
|
StoreBanner: prop theme change value from 'black' to 'default'; remove deprecated value 'clearWhite'
|
|
26
54
|
* ContentArea, Paragraph, StoreBanner and Breadcrumbs components from no don't have
|
|
27
55
|
freshAsphalt and clearWhite as values for colorize props
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
# [3.0.0-beta.5](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.4...@megafon/ui-core@3.0.0-beta.5) (2022-01-28)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
### Features
|
|
37
|
-
|
|
38
|
-
* **header:** made header as a functional component ([81701ad](https://github.com/MegafonWebLab/megafon-ui/commit/81701ad87b6e9df2fe630bf4e183383264c0bb01))
|
|
39
|
-
* **radiobutton:** made radiobutton as a functional component ([65406af](https://github.com/MegafonWebLab/megafon-ui/commit/65406afc90fd82f7eb0fdcbbe78569fc98164e78))
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
# [3.0.0-beta.4](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.3...@megafon/ui-core@3.0.0-beta.4) (2022-01-27)
|
|
46
|
-
|
|
47
|
-
**Note:** Version bump only for package @megafon/ui-core
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
# [3.0.0-beta.3](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@3.0.0-beta.2...@megafon/ui-core@3.0.0-beta.3) (2022-01-24)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
### Bug Fixes
|
|
57
|
-
|
|
58
|
-
* **accordion:** add focus on arrow after tab press, add open/close accordion after enter press ([9bfa0ac](https://github.com/MegafonWebLab/megafon-ui/commit/9bfa0ac5348ac25c0e37a4df51e26e2dabde02ba))
|
|
59
|
-
* **accordion:** change type of onClickAccordion prop ([9a150c5](https://github.com/MegafonWebLab/megafon-ui/commit/9a150c5de309547763a714b0eb630dfb386a8107))
|
|
60
|
-
* **calendar/month:** add focus on month arrows, add enter press handlers ([63f1e47](https://github.com/MegafonWebLab/megafon-ui/commit/63f1e4761e57ed6d56464b632dce9fd5e77655e1))
|
|
61
|
-
* **checkbox:** add focus on custom checkbox, add enter press handler ([83d111d](https://github.com/MegafonWebLab/megafon-ui/commit/83d111d0e4b41d3915bdd079bed4a7f9715ce7a5))
|
|
62
|
-
* **checkbox:** add isChecked state, change type of onChange prop ([f535caf](https://github.com/MegafonWebLab/megafon-ui/commit/f535caf39a02ab6793d3c63b654a1f1f3e9b2b93))
|
|
63
|
-
* **tooltip:** add check event function from ui-helpers ([a784ab4](https://github.com/MegafonWebLab/megafon-ui/commit/a784ab4f288124eb941fe8f52e46b2efc9aa2f82))
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
### BREAKING CHANGES
|
|
67
|
-
|
|
68
56
|
* **checkbox:** change type of onChange prop on (checked: boolean) => void
|
|
69
57
|
* **accordion:** remove parameter 'title' in onClickAccordion prop
|
|
70
58
|
* **tooltip:** change onOpen, onClose types; AccessibilityEventTypeNative from @megafon/ui-helpers
|
|
59
|
+
* **colors:** green, green20, green80, purple, purple20 and purple80 colors now have 'brand'
|
|
60
|
+
prefix (e.g. brandGreen)
|
|
61
|
+
* **colors:** read commit description
|
|
71
62
|
|
|
72
63
|
|
|
73
64
|
|
|
74
65
|
|
|
75
66
|
|
|
76
|
-
# [
|
|
67
|
+
# [2.5.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.4.0...@megafon/ui-core@2.5.0) (2022-02-07)
|
|
77
68
|
|
|
78
|
-
|
|
69
|
+
|
|
70
|
+
### Features
|
|
71
|
+
|
|
72
|
+
* **tabs:** add prop outerObserveContainer for observing sticky mode from outside ([bc20c76](https://github.com/MegafonWebLab/megafon-ui/commit/bc20c76f497d88da19ea03cfc66a0c38a7559698))
|
|
79
73
|
|
|
80
74
|
|
|
81
75
|
|
|
82
76
|
|
|
83
77
|
|
|
84
|
-
# [
|
|
78
|
+
# [2.4.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.3.0...@megafon/ui-core@2.4.0) (2022-01-31)
|
|
85
79
|
|
|
86
80
|
|
|
87
81
|
### Bug Fixes
|
|
88
82
|
|
|
89
|
-
* **
|
|
90
|
-
* **colors:** remove unused classname modifiers ([d919cdc](https://github.com/MegafonWebLab/megafon-ui/commit/d919cdcf1fa79d60230fc85811518ded1c0537ad))
|
|
91
|
-
* **colors:** remove unused method ([2970295](https://github.com/MegafonWebLab/megafon-ui/commit/2970295df9053a4f54ed19d3d46deb07994844e0))
|
|
92
|
-
* **colors:** renabe green and purple to brandGreen and brandPurple to avoid postcss-colormin bug ([563d97c](https://github.com/MegafonWebLab/megafon-ui/commit/563d97c42900099415a6872f57b500b87aeed647))
|
|
93
|
-
* **colors:** update color values on colors page when user switches theme ([8552ff6](https://github.com/MegafonWebLab/megafon-ui/commit/8552ff69a66153ef890437ffc4dd2e50c31d6f2e))
|
|
94
|
-
* **less:** import base.less file through reference ([5a13aae](https://github.com/MegafonWebLab/megafon-ui/commit/5a13aaedec3a7fd09f77dcddfe437fda604f60a5))
|
|
83
|
+
* **link:** new prop dataAttrs ([bde2253](https://github.com/MegafonWebLab/megafon-ui/commit/bde22539ff0db11777be9193adceb6de0f984234))
|
|
95
84
|
|
|
96
85
|
|
|
97
86
|
### Features
|
|
98
87
|
|
|
99
|
-
* **
|
|
88
|
+
* **banner:** add props withPaginationBottomOffset ([c1485a0](https://github.com/MegafonWebLab/megafon-ui/commit/c1485a083d63b886419109b03bb31230c5fed890))
|
|
100
89
|
|
|
101
90
|
|
|
102
|
-
### BREAKING CHANGES
|
|
103
91
|
|
|
104
|
-
* **colors:** green, green20, green80, purple, purple20 and purple80 colors now have 'brand'
|
|
105
|
-
prefix (e.g. brandGreen)
|
|
106
92
|
|
|
107
93
|
|
|
94
|
+
# [2.3.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@2.2.0...@megafon/ui-core@2.3.0) (2022-01-24)
|
|
108
95
|
|
|
109
96
|
|
|
97
|
+
### Bug Fixes
|
|
110
98
|
|
|
111
|
-
|
|
99
|
+
* **search:** prevents default action when a menu item is selected and the enter button is pressed ([054cbcf](https://github.com/MegafonWebLab/megafon-ui/commit/054cbcf3457ff779443a82b5ae6383fda57f9cc7))
|
|
112
100
|
|
|
113
101
|
|
|
114
102
|
### Features
|
|
115
103
|
|
|
116
|
-
* **
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
### BREAKING CHANGES
|
|
120
|
-
|
|
121
|
-
* **colors:** read commit description
|
|
104
|
+
* **accordion:** props hasVerticalPaddings marked as deprecated ([4d6d4cc](https://github.com/MegafonWebLab/megafon-ui/commit/4d6d4cca2cf45a86441827f0bef625a88a2c44f8))
|
|
105
|
+
* **textfield:** add autocomplete prop ([f2cff94](https://github.com/MegafonWebLab/megafon-ui/commit/f2cff9403503de174b785ea02365ce470811369e))
|
|
122
106
|
|
|
123
107
|
|
|
124
108
|
|
|
@@ -40,25 +40,11 @@
|
|
|
40
40
|
.mfui-accordion__content-inner {
|
|
41
41
|
padding: 24px 16px;
|
|
42
42
|
}
|
|
43
|
-
@media screen and (min-width: 768px)
|
|
43
|
+
@media screen and (min-width: 768px) {
|
|
44
44
|
.mfui-accordion__content-inner {
|
|
45
45
|
padding: 24px;
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
|
49
|
-
.mfui-accordion__content-inner {
|
|
50
|
-
padding: 24px 48px;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
@media screen and (min-width: 1280px) {
|
|
54
|
-
.mfui-accordion__content-inner {
|
|
55
|
-
padding: 24px 40px;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
.mfui-accordion__content-inner_v-padding {
|
|
59
|
-
padding-top: 24px;
|
|
60
|
-
padding-bottom: 24px;
|
|
61
|
-
}
|
|
62
48
|
.mfui-accordion__icon {
|
|
63
49
|
fill: var(--content);
|
|
64
50
|
}
|
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { IFilterDataAttrs } from '@megafon/ui-helpers';
|
|
3
2
|
import './Accordion.less';
|
|
4
|
-
export interface IAccordionProps
|
|
3
|
+
export interface IAccordionProps {
|
|
5
4
|
/** Ссылка на корневой элемент */
|
|
6
5
|
rootRef?: React.Ref<HTMLDivElement>;
|
|
7
6
|
/** Заголовок */
|
|
8
7
|
title: string | React.ReactNode | React.ReactNode[];
|
|
9
8
|
/** Состояние открытости */
|
|
10
9
|
isOpened?: boolean;
|
|
11
|
-
/** Вертикальные отступы */
|
|
12
|
-
hasVerticalPaddings?: boolean;
|
|
13
10
|
/** Дополнительный класс для корневого элемента */
|
|
14
11
|
className?: string;
|
|
15
12
|
/** Дополнительные классы для корневого и внутренних элементов */
|
|
16
13
|
classes?: {
|
|
17
|
-
openedClass?: string;
|
|
18
14
|
root?: string;
|
|
15
|
+
openedClass?: string;
|
|
19
16
|
collapse?: string;
|
|
20
17
|
titleWrap?: string;
|
|
21
18
|
};
|
|
19
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
20
|
+
dataAttrs?: {
|
|
21
|
+
root?: Record<string, string>;
|
|
22
|
+
header?: Record<string, string>;
|
|
23
|
+
collapse?: Record<string, string>;
|
|
24
|
+
titleWrap?: Record<string, string>;
|
|
25
|
+
arrowUp?: Record<string, string>;
|
|
26
|
+
arrowDown?: Record<string, string>;
|
|
27
|
+
};
|
|
22
28
|
/** Обработчик клика */
|
|
23
29
|
onClickAccordion?: (isOpened: boolean) => void;
|
|
24
30
|
}
|
|
@@ -30,8 +30,6 @@ var Accordion = function Accordion(_ref) {
|
|
|
30
30
|
title = _ref.title,
|
|
31
31
|
_ref$isOpened = _ref.isOpened,
|
|
32
32
|
isOpened = _ref$isOpened === void 0 ? false : _ref$isOpened,
|
|
33
|
-
_ref$hasVerticalPaddi = _ref.hasVerticalPaddings,
|
|
34
|
-
hasVerticalPaddings = _ref$hasVerticalPaddi === void 0 ? false : _ref$hasVerticalPaddi,
|
|
35
33
|
className = _ref.className,
|
|
36
34
|
_ref$classes = _ref.classes;
|
|
37
35
|
_ref$classes = _ref$classes === void 0 ? {} : _ref$classes;
|
|
@@ -54,36 +52,34 @@ var Accordion = function Accordion(_ref) {
|
|
|
54
52
|
|
|
55
53
|
var handleClickTitle = function handleClickTitle(e) {
|
|
56
54
|
if (checkEventIsClickOrEnterPress(e)) {
|
|
57
|
-
onClickAccordion
|
|
55
|
+
onClickAccordion === null || onClickAccordion === void 0 ? void 0 : onClickAccordion(!isOpenedState);
|
|
58
56
|
setIsOpenedState(!isOpenedState);
|
|
59
57
|
}
|
|
60
58
|
};
|
|
61
59
|
|
|
62
60
|
var openedClassName = isOpenedState ? openedClass : undefined;
|
|
63
|
-
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs), {
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
64
62
|
ref: rootRef,
|
|
65
63
|
className: cn({
|
|
66
64
|
open: isOpenedState
|
|
67
65
|
}, [className, rootPropsClasses, openedClassName])
|
|
68
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
66
|
+
}), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.titleWrap), {
|
|
69
67
|
className: cn('title-wrap', [titleWrapPropsClasses]),
|
|
70
68
|
onClick: handleClickTitle,
|
|
71
69
|
onKeyDown: handleClickTitle
|
|
72
|
-
}, /*#__PURE__*/React.createElement(Header, {
|
|
70
|
+
}), /*#__PURE__*/React.createElement(Header, _extends({
|
|
73
71
|
as: "h5"
|
|
74
|
-
}, title), /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.header)), title), /*#__PURE__*/React.createElement("div", {
|
|
75
73
|
tabIndex: 0,
|
|
76
74
|
role: "button",
|
|
77
75
|
className: cn('icon-box', {
|
|
78
76
|
open: isOpenedState
|
|
79
77
|
})
|
|
80
|
-
}, isOpenedState ? /*#__PURE__*/React.createElement(ArrowUp, null) : /*#__PURE__*/React.createElement(ArrowDown, null))), /*#__PURE__*/React.createElement(Collapse, {
|
|
78
|
+
}, isOpenedState ? /*#__PURE__*/React.createElement(ArrowUp, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowUp)) : /*#__PURE__*/React.createElement(ArrowDown, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowDown)))), /*#__PURE__*/React.createElement(Collapse, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.collapse), {
|
|
81
79
|
className: cn('content', collapsePropsClasses),
|
|
82
|
-
classNameContainer: cn('content-inner',
|
|
83
|
-
'v-padding': hasVerticalPaddings
|
|
84
|
-
}),
|
|
80
|
+
classNameContainer: cn('content-inner'),
|
|
85
81
|
isOpened: isOpenedState
|
|
86
|
-
}, children));
|
|
82
|
+
}), children));
|
|
87
83
|
};
|
|
88
84
|
|
|
89
85
|
Accordion.propTypes = {
|
|
@@ -92,7 +88,6 @@ Accordion.propTypes = {
|
|
|
92
88
|
}), PropTypes.any])]),
|
|
93
89
|
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.arrayOf(PropTypes.node)]).isRequired,
|
|
94
90
|
isOpened: PropTypes.bool,
|
|
95
|
-
hasVerticalPaddings: PropTypes.bool,
|
|
96
91
|
className: PropTypes.string,
|
|
97
92
|
classes: PropTypes.shape({
|
|
98
93
|
openedClass: PropTypes.string,
|
|
@@ -100,7 +95,14 @@ Accordion.propTypes = {
|
|
|
100
95
|
collapse: PropTypes.string,
|
|
101
96
|
titleWrap: PropTypes.string
|
|
102
97
|
}),
|
|
103
|
-
dataAttrs: PropTypes.
|
|
98
|
+
dataAttrs: PropTypes.shape({
|
|
99
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
100
|
+
header: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
101
|
+
collapse: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
102
|
+
titleWrap: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
103
|
+
arrowUp: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
104
|
+
arrowDown: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
105
|
+
}),
|
|
104
106
|
onClickAccordion: PropTypes.func
|
|
105
107
|
};
|
|
106
108
|
export default Accordion;
|
|
@@ -34,6 +34,11 @@
|
|
|
34
34
|
-webkit-transform: translateY(-50%);
|
|
35
35
|
transform: translateY(-50%);
|
|
36
36
|
}
|
|
37
|
+
@media screen and (max-width: 767px) {
|
|
38
|
+
.mfui-banner__arrow {
|
|
39
|
+
display: none;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
37
42
|
.mfui-banner__arrow_prev {
|
|
38
43
|
left: 12px;
|
|
39
44
|
}
|
|
@@ -98,6 +103,29 @@
|
|
|
98
103
|
.mfui-banner__pagination_theme_dark {
|
|
99
104
|
background-color: var(--stcBlack20);
|
|
100
105
|
}
|
|
106
|
+
.mfui-banner__pagination_bottom-offset {
|
|
107
|
+
bottom: 60px;
|
|
108
|
+
}
|
|
109
|
+
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
|
110
|
+
.mfui-banner__pagination_bottom-offset {
|
|
111
|
+
bottom: 89px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
@media screen and (min-width: 1024px) and (max-width: 1279px) {
|
|
115
|
+
.mfui-banner__pagination_bottom-offset {
|
|
116
|
+
bottom: 90px;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
@media screen and (min-width: 1280px) and (max-width: 1439px) {
|
|
120
|
+
.mfui-banner__pagination_bottom-offset {
|
|
121
|
+
bottom: 65px;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
@media screen and (min-width: 1440px) {
|
|
125
|
+
.mfui-banner__pagination_bottom-offset {
|
|
126
|
+
bottom: 72px;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
101
129
|
.mfui-banner__dot {
|
|
102
130
|
width: 12px;
|
|
103
131
|
height: 12px;
|
|
@@ -16,6 +16,18 @@ export interface IBannerProps {
|
|
|
16
16
|
slide?: string;
|
|
17
17
|
arrow?: string;
|
|
18
18
|
};
|
|
19
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
20
|
+
dataAttrs?: {
|
|
21
|
+
root?: Record<string, string>;
|
|
22
|
+
swiper?: Record<string, string>;
|
|
23
|
+
slide?: Record<string, string>;
|
|
24
|
+
arrowPrev?: Record<string, string>;
|
|
25
|
+
arrowNext?: Record<string, string>;
|
|
26
|
+
pagination?: Record<string, string>;
|
|
27
|
+
dot?: Record<string, string>;
|
|
28
|
+
};
|
|
29
|
+
/** Предполагается использование с наезжанием на баннер следующего за баннером элемента */
|
|
30
|
+
withPaginationBottomOffset?: boolean;
|
|
19
31
|
/** Автоматическая прокрутка */
|
|
20
32
|
autoPlay?: boolean;
|
|
21
33
|
/** Задержка автоматической прокрутки */
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "core-js/modules/es.array.map";
|
|
2
2
|
import "core-js/modules/es.object.values";
|
|
3
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
4
|
import _typeof from "@babel/runtime/helpers/typeof";
|
|
4
5
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
5
6
|
import * as React from 'react';
|
|
6
|
-
import { cnCreate } from '@megafon/ui-helpers';
|
|
7
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
7
8
|
import * as PropTypes from 'prop-types';
|
|
8
9
|
import SwiperCore, { Autoplay } from 'swiper';
|
|
9
10
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
@@ -32,6 +33,8 @@ var Banner = function Banner(_ref) {
|
|
|
32
33
|
var className = _ref.className,
|
|
33
34
|
_ref$classes = _ref.classes,
|
|
34
35
|
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
36
|
+
_ref$withPaginationBo = _ref.withPaginationBottomOffset,
|
|
37
|
+
withPaginationBottomOffset = _ref$withPaginationBo === void 0 ? false : _ref$withPaginationBo,
|
|
35
38
|
_ref$autoPlay = _ref.autoPlay,
|
|
36
39
|
autoPlay = _ref$autoPlay === void 0 ? false : _ref$autoPlay,
|
|
37
40
|
_ref$autoPlayDelay = _ref.autoPlayDelay,
|
|
@@ -45,7 +48,8 @@ var Banner = function Banner(_ref) {
|
|
|
45
48
|
onNextClick = _ref.onNextClick,
|
|
46
49
|
onPrevClick = _ref.onPrevClick,
|
|
47
50
|
onDotClick = _ref.onDotClick,
|
|
48
|
-
onChange = _ref.onChange
|
|
51
|
+
onChange = _ref.onChange,
|
|
52
|
+
dataAttrs = _ref.dataAttrs;
|
|
49
53
|
|
|
50
54
|
var _React$useState = React.useState(),
|
|
51
55
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -83,7 +87,8 @@ var Banner = function Banner(_ref) {
|
|
|
83
87
|
return;
|
|
84
88
|
}
|
|
85
89
|
|
|
86
|
-
autoplay.stop();
|
|
90
|
+
autoplay.stop(); // eslint-disable-next-line no-param-reassign
|
|
91
|
+
|
|
87
92
|
params.autoplay.delay = autoPlayDelay * 3;
|
|
88
93
|
autoplay.start();
|
|
89
94
|
}, [autoPlayDelay]);
|
|
@@ -93,18 +98,18 @@ var Banner = function Banner(_ref) {
|
|
|
93
98
|
}
|
|
94
99
|
|
|
95
100
|
swiperInstance.slidePrev();
|
|
96
|
-
onPrevClick
|
|
101
|
+
onPrevClick === null || onPrevClick === void 0 ? void 0 : onPrevClick(swiperInstance.realIndex);
|
|
97
102
|
increaseAutoplayDelay(swiperInstance);
|
|
98
|
-
}, [swiperInstance, onPrevClick]);
|
|
103
|
+
}, [swiperInstance, onPrevClick, increaseAutoplayDelay]);
|
|
99
104
|
var handleNextClick = React.useCallback(function () {
|
|
100
105
|
if (!swiperInstance) {
|
|
101
106
|
return;
|
|
102
107
|
}
|
|
103
108
|
|
|
104
109
|
swiperInstance.slideNext();
|
|
105
|
-
onNextClick
|
|
110
|
+
onNextClick === null || onNextClick === void 0 ? void 0 : onNextClick(swiperInstance.realIndex);
|
|
106
111
|
increaseAutoplayDelay(swiperInstance);
|
|
107
|
-
}, [swiperInstance, onNextClick]);
|
|
112
|
+
}, [swiperInstance, onNextClick, increaseAutoplayDelay]);
|
|
108
113
|
var handleDotClick = React.useCallback(function (index) {
|
|
109
114
|
if (!swiperInstance) {
|
|
110
115
|
return;
|
|
@@ -116,9 +121,9 @@ var Banner = function Banner(_ref) {
|
|
|
116
121
|
swiperInstance.slideTo(index);
|
|
117
122
|
}
|
|
118
123
|
|
|
119
|
-
onDotClick
|
|
124
|
+
onDotClick === null || onDotClick === void 0 ? void 0 : onDotClick(swiperInstance.realIndex);
|
|
120
125
|
increaseAutoplayDelay(swiperInstance);
|
|
121
|
-
}, [swiperInstance, loop, onDotClick]);
|
|
126
|
+
}, [swiperInstance, loop, onDotClick, increaseAutoplayDelay]);
|
|
122
127
|
var handleSwiper = React.useCallback(function (swiper) {
|
|
123
128
|
setSwiperInstance(swiper);
|
|
124
129
|
}, []);
|
|
@@ -141,16 +146,16 @@ var Banner = function Banner(_ref) {
|
|
|
141
146
|
var handleSlideChange = React.useCallback(function (_ref4) {
|
|
142
147
|
var realIndex = _ref4.realIndex;
|
|
143
148
|
setActiveIndex(realIndex);
|
|
144
|
-
onChange
|
|
145
|
-
}, []);
|
|
149
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(realIndex);
|
|
150
|
+
}, [onChange]);
|
|
146
151
|
var handleAutoplayStop = React.useCallback(function () {
|
|
147
152
|
setAutoPlayning(false);
|
|
148
153
|
}, []);
|
|
149
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
154
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
150
155
|
className: cn({
|
|
151
156
|
'nav-theme': navTheme
|
|
152
157
|
}, className)
|
|
153
|
-
}, /*#__PURE__*/React.createElement(Swiper, {
|
|
158
|
+
}), /*#__PURE__*/React.createElement(Swiper, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.swiper), {
|
|
154
159
|
className: cn('swiper'),
|
|
155
160
|
loop: loop,
|
|
156
161
|
autoplay: autoPlay ? getAutoPlayConfig(autoPlayDelay) : false,
|
|
@@ -161,19 +166,19 @@ var Banner = function Banner(_ref) {
|
|
|
161
166
|
onSlideChange: handleSlideChange,
|
|
162
167
|
onAutoplayStop: handleAutoplayStop,
|
|
163
168
|
onTouchEnd: increaseAutoplayDelay
|
|
164
|
-
}, React.Children.map(children, function (child, i) {
|
|
165
|
-
return /*#__PURE__*/React.createElement(SwiperSlide, {
|
|
169
|
+
}), React.Children.map(children, function (child, i) {
|
|
170
|
+
return /*#__PURE__*/React.createElement(SwiperSlide, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.slide, i + 1), {
|
|
166
171
|
key: i,
|
|
167
172
|
className: cn('slide', classes === null || classes === void 0 ? void 0 : classes.slide)
|
|
168
|
-
}, child);
|
|
169
|
-
})), /*#__PURE__*/React.createElement(NavArrow, {
|
|
173
|
+
}), child);
|
|
174
|
+
})), /*#__PURE__*/React.createElement(NavArrow, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowPrev), {
|
|
170
175
|
className: cn('arrow', {
|
|
171
176
|
prev: true
|
|
172
177
|
}, [classes.arrow]),
|
|
173
178
|
onClick: handlePrevClick,
|
|
174
179
|
disabled: !loop && isBeginning,
|
|
175
180
|
theme: navArrowTheme
|
|
176
|
-
}), /*#__PURE__*/React.createElement(NavArrow, {
|
|
181
|
+
})), /*#__PURE__*/React.createElement(NavArrow, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrowNext), {
|
|
177
182
|
className: cn('arrow', {
|
|
178
183
|
next: true
|
|
179
184
|
}, [classes.arrow]),
|
|
@@ -181,12 +186,16 @@ var Banner = function Banner(_ref) {
|
|
|
181
186
|
onClick: handleNextClick,
|
|
182
187
|
disabled: !loop && isEnd,
|
|
183
188
|
theme: navArrowTheme
|
|
184
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
189
|
+
})), /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.pagination), {
|
|
185
190
|
className: cn('pagination', {
|
|
186
|
-
theme: navTheme
|
|
191
|
+
theme: navTheme,
|
|
192
|
+
'bottom-offset': withPaginationBottomOffset
|
|
187
193
|
})
|
|
188
|
-
}, React.Children.map(children, function (_, i) {
|
|
194
|
+
}), React.Children.map(children, function (_, i) {
|
|
189
195
|
return /*#__PURE__*/React.createElement(BannerDot, {
|
|
196
|
+
dataAttrs: {
|
|
197
|
+
root: _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.dot, i + 1))
|
|
198
|
+
},
|
|
190
199
|
key: i,
|
|
191
200
|
className: cn('dot'),
|
|
192
201
|
index: i,
|
|
@@ -204,6 +213,16 @@ Banner.propTypes = {
|
|
|
204
213
|
classes: PropTypes.shape({
|
|
205
214
|
slide: PropTypes.string
|
|
206
215
|
}),
|
|
216
|
+
withPaginationBottomOffset: PropTypes.bool,
|
|
217
|
+
dataAttrs: PropTypes.shape({
|
|
218
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
219
|
+
swiper: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
220
|
+
slide: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
221
|
+
arrowPrev: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
222
|
+
arrowNext: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
223
|
+
pagination: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
224
|
+
dot: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
225
|
+
}),
|
|
207
226
|
autoPlay: PropTypes.bool,
|
|
208
227
|
autoPlayDelay: PropTypes.number,
|
|
209
228
|
navTheme: PropTypes.oneOf(Object.values(NavTheme)),
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import * as React from 'react';
|
|
2
|
-
import { cnCreate } from '@megafon/ui-helpers';
|
|
3
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
3
4
|
import * as PropTypes from 'prop-types';
|
|
4
5
|
import "./BannerDot.css";
|
|
5
6
|
var cn = cnCreate('mfui-banner-dot');
|
|
6
7
|
|
|
7
8
|
var BannerDot = function BannerDot(_ref) {
|
|
8
9
|
var className = _ref.className,
|
|
10
|
+
dataAttrs = _ref.dataAttrs,
|
|
9
11
|
index = _ref.index,
|
|
10
12
|
isActive = _ref.isActive,
|
|
11
13
|
showTimer = _ref.showTimer,
|
|
@@ -14,13 +16,13 @@ var BannerDot = function BannerDot(_ref) {
|
|
|
14
16
|
var handleDotClick = React.useCallback(function () {
|
|
15
17
|
onClick(index);
|
|
16
18
|
}, [onClick, index]);
|
|
17
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
18
20
|
className: cn({
|
|
19
21
|
active: isActive,
|
|
20
22
|
timer: showTimer
|
|
21
23
|
}, className),
|
|
22
24
|
onClick: handleDotClick
|
|
23
|
-
}, showTimer && isActive && /*#__PURE__*/React.createElement("svg", {
|
|
25
|
+
}), showTimer && isActive && /*#__PURE__*/React.createElement("svg", {
|
|
24
26
|
className: cn('timer'),
|
|
25
27
|
viewBox: "0 0 100 100"
|
|
26
28
|
}, /*#__PURE__*/React.createElement("circle", {
|
|
@@ -36,6 +38,9 @@ var BannerDot = function BannerDot(_ref) {
|
|
|
36
38
|
|
|
37
39
|
BannerDot.propTypes = {
|
|
38
40
|
className: PropTypes.string,
|
|
41
|
+
dataAttrs: PropTypes.shape({
|
|
42
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
43
|
+
}),
|
|
39
44
|
index: PropTypes.number.isRequired,
|
|
40
45
|
isActive: PropTypes.bool.isRequired,
|
|
41
46
|
showTimer: PropTypes.bool.isRequired,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { Ref } from 'react';
|
|
2
|
-
import { IFilterDataAttrs } from '@megafon/ui-helpers';
|
|
3
2
|
import './Button.less';
|
|
4
3
|
export declare const ButtonTypes: {
|
|
5
4
|
readonly PRIMARY: "primary";
|
|
@@ -19,7 +18,7 @@ export declare const ButtonSizes: {
|
|
|
19
18
|
readonly LARGE: "large";
|
|
20
19
|
};
|
|
21
20
|
declare type ButtonSizesType = typeof ButtonSizes[keyof typeof ButtonSizes];
|
|
22
|
-
export interface IButtonProps
|
|
21
|
+
export interface IButtonProps {
|
|
23
22
|
/** Дополнительный класс корневого элемента */
|
|
24
23
|
className?: string | string[];
|
|
25
24
|
/** Дополнительные классы для внутренних элементов */
|
|
@@ -31,6 +30,13 @@ export interface IButtonProps extends IFilterDataAttrs {
|
|
|
31
30
|
/** Inner container class */
|
|
32
31
|
inner?: string;
|
|
33
32
|
};
|
|
33
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
34
|
+
dataAttrs?: {
|
|
35
|
+
root?: Record<string, string>;
|
|
36
|
+
content?: Record<string, string>;
|
|
37
|
+
inner?: Record<string, string>;
|
|
38
|
+
loader?: Record<string, string>;
|
|
39
|
+
};
|
|
34
40
|
/** Тема компонента */
|
|
35
41
|
theme?: ButtonThemesType;
|
|
36
42
|
/** Тип компонента */
|