@megafon/ui-core 9.0.0-alpha.2 → 9.0.0-alpha.3
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/dist/es/components/Avatar/Avatar.css +1 -1
- package/dist/es/components/Avatar/Avatar.d.ts +1 -1
- package/dist/es/components/Buttons/Button/Button.css +1 -0
- package/dist/{lib/components → es/components/Buttons}/Button/Button.d.ts +1 -0
- package/dist/es/components/{Button → Buttons/Button}/Button.js +3 -2
- package/dist/es/components/Buttons/ButtonClose/ButtonClose.css +1 -0
- package/dist/es/components/Buttons/ButtonClose/ButtonClose.d.ts +34 -0
- package/dist/es/components/Buttons/ButtonClose/ButtonClose.js +70 -0
- package/dist/es/components/Chips/Chips/Chip.css +1 -1
- package/dist/es/components/Chips/Chips/Chip.d.ts +9 -1
- package/dist/es/components/Chips/Chips/Chip.js +8 -1
- package/dist/es/components/Chips/Chips/Chips.d.ts +12 -1
- package/dist/es/components/Chips/Chips/Chips.js +20 -6
- package/dist/es/components/Chips/Chips/components/ChipsDropdown/ChipsDropdown.css +1 -1
- package/dist/es/components/Chips/Chips/components/ChipsDropdown/ChipsDropdown.d.ts +12 -4
- package/dist/es/components/Chips/Chips/components/ChipsDropdown/ChipsDropdown.js +55 -47
- package/dist/es/components/Chips/Chips/components/ChipsScrollPanel/ChipsScrollPanel.d.ts +2 -1
- package/dist/es/components/Chips/Chips/components/ChipsScrollPanel/ChipsScrollPanel.js +2 -0
- package/dist/es/components/ContentView/ContentView.js +1 -1
- package/dist/es/components/Counter/Counter.css +1 -1
- package/dist/es/components/Counter/Counter.d.ts +2 -0
- package/dist/es/components/Counter/Counter.js +4 -1
- package/dist/es/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/es/components/ErrorLoad/ErrorLoad.d.ts +1 -1
- package/dist/es/components/ErrorLoad/ErrorLoad.js +1 -1
- package/dist/es/components/ListData/ListData.css +1 -1
- package/dist/es/components/ListData/ListData.d.ts +9 -1
- package/dist/es/components/ListData/ListData.js +8 -0
- package/dist/es/components/Notification/Notification.js +1 -1
- package/dist/es/components/Snackbar/Snackbar.js +1 -1
- package/dist/es/components/Tooltip/Tooltip.css +1 -1
- package/dist/es/components/Tooltip/Tooltip.js +5 -13
- package/dist/es/components/UploadForm/UploadField/components/_UploadFieldDropArea/UploadFieldDropArea.css +1 -1
- package/dist/es/components/UploadForm/UploadFileItem/UploadFileItem.css +1 -1
- package/dist/es/index.d.ts +2 -1
- package/dist/es/index.js +2 -1
- package/dist/lib/components/Avatar/Avatar.css +1 -1
- package/dist/lib/components/Avatar/Avatar.d.ts +1 -1
- package/dist/lib/components/Buttons/Button/Button.css +1 -0
- package/dist/{es/components → lib/components/Buttons}/Button/Button.d.ts +1 -0
- package/dist/lib/components/{Button → Buttons/Button}/Button.js +3 -2
- package/dist/lib/components/Buttons/ButtonClose/ButtonClose.css +1 -0
- package/dist/lib/components/Buttons/ButtonClose/ButtonClose.d.ts +34 -0
- package/dist/lib/components/Buttons/ButtonClose/ButtonClose.js +79 -0
- package/dist/lib/components/Chips/Chips/Chip.css +1 -1
- package/dist/lib/components/Chips/Chips/Chip.d.ts +9 -1
- package/dist/lib/components/Chips/Chips/Chip.js +9 -2
- package/dist/lib/components/Chips/Chips/Chips.d.ts +12 -1
- package/dist/lib/components/Chips/Chips/Chips.js +20 -6
- package/dist/lib/components/Chips/Chips/components/ChipsDropdown/ChipsDropdown.css +1 -1
- package/dist/lib/components/Chips/Chips/components/ChipsDropdown/ChipsDropdown.d.ts +12 -4
- package/dist/lib/components/Chips/Chips/components/ChipsDropdown/ChipsDropdown.js +55 -47
- package/dist/lib/components/Chips/Chips/components/ChipsScrollPanel/ChipsScrollPanel.d.ts +2 -1
- package/dist/lib/components/Chips/Chips/components/ChipsScrollPanel/ChipsScrollPanel.js +2 -0
- package/dist/lib/components/ContentView/ContentView.js +1 -1
- package/dist/lib/components/Counter/Counter.css +1 -1
- package/dist/lib/components/Counter/Counter.d.ts +2 -0
- package/dist/lib/components/Counter/Counter.js +4 -1
- package/dist/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/dist/lib/components/ErrorLoad/ErrorLoad.d.ts +1 -1
- package/dist/lib/components/ErrorLoad/ErrorLoad.js +1 -1
- package/dist/lib/components/ListData/ListData.css +1 -1
- package/dist/lib/components/ListData/ListData.d.ts +9 -1
- package/dist/lib/components/ListData/ListData.js +8 -0
- package/dist/lib/components/Notification/Notification.js +1 -1
- package/dist/lib/components/Snackbar/Snackbar.js +1 -1
- package/dist/lib/components/Tooltip/Tooltip.css +1 -1
- package/dist/lib/components/Tooltip/Tooltip.js +5 -13
- package/dist/lib/components/UploadForm/UploadField/components/_UploadFieldDropArea/UploadFieldDropArea.css +1 -1
- package/dist/lib/components/UploadForm/UploadFileItem/UploadFileItem.css +1 -1
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.js +8 -1
- package/package.json +2 -2
- package/dist/es/components/Button/Button.css +0 -1
- package/dist/lib/components/Button/Button.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-9-avatar{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;position:relative;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;border-radius:
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-9-avatar{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;position:relative;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;border-radius:12px;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:15px;font-weight:500;height:40px;justify-content:center;overflow:hidden;width:40px}.mfui-9-avatar__text{display:block}.mfui-9-avatar__image{background-color:var(--base);height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.mfui-9-avatar__placeholder{opacity:.3}.mfui-9-avatar_color_green{background-color:var(--brandGreen20);color:var(--brandGreen)}.mfui-9-avatar_color_green .mfui-9-avatar__placeholder{fill:var(--brandGreen)}.mfui-9-avatar_color_gray{background-color:var(--spbSky0);color:var(--spbSky3)}.mfui-9-avatar_color_gray .mfui-9-avatar__placeholder{fill:var(--spbSky3)}.mfui-9-avatar_color_white{background-color:var(--stcWhite);color:var(--spbSky3)}.mfui-9-avatar_color_white .mfui-9-avatar__placeholder{fill:var(--spbSky3)}.mfui-9-avatar_size_auto{font-size:inherit;height:100%;width:100%}.mfui-9-avatar_size_small{font-size:12px;height:32px;width:32px}.mfui-9-avatar_default{display:block}.mfui-9-avatar_default svg{margin:auto}
|
|
@@ -10,7 +10,7 @@ export interface IAvatarProps {
|
|
|
10
10
|
/** Цвет заливки */
|
|
11
11
|
color?: 'green' | 'gray' | 'white';
|
|
12
12
|
/** Размер (по умолчанию 40х40 пикселей). */
|
|
13
|
-
size?: 'default' | 'auto';
|
|
13
|
+
size?: 'default' | 'auto' | 'small';
|
|
14
14
|
/** Дополнительный класс корневого элемента */
|
|
15
15
|
className?: string;
|
|
16
16
|
/** Дополнительные data атрибуты к внутренним элементам */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-9-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:transparent;border:none;border-radius:30px;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--stcWhite);cursor:pointer;display:inline-block;font-family:inherit;font-size:15px;font-weight:500;line-height:24px;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content;outline:none;overflow:hidden;padding:0 32px;text-align:center;text-decoration:none;-webkit-transition:background-color .3s,color .3s;transition:background-color .3s,color .3s;vertical-align:top;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mfui-9-button svg{display:block;-webkit-transition:fill .3s;transition:fill .3s}.mfui-9-button_size-all_extra-small{border-radius:8px;font-size:12px;height:24px;line-height:14px;min-width:24px;padding:0 16px}.mfui-9-button_size-all_extra-small .mfui-9-button__icon,.mfui-9-button_size-all_extra-small .mfui-9-button__icon-arrow,.mfui-9-button_size-all_extra-small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:20px;width:20px}.mfui-9-button_size-all_extra-small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{margin-right:2px}.mfui-9-button_size-all_extra-small .mfui-9-button__icon-arrow{margin-left:0}.mfui-9-button_size-all_small{border-radius:12px;height:40px;min-width:40px;padding:0 24px}.mfui-9-button_size-all_small .mfui-9-button__icon,.mfui-9-button_size-all_small .mfui-9-button__icon-arrow{height:20px;width:20px}.mfui-9-button_size-all_small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-all_medium{border-radius:16px;height:52px;min-width:52px}.mfui-9-button_size-all_medium .mfui-9-button__icon,.mfui-9-button_size-all_medium .mfui-9-button__icon-arrow,.mfui-9-button_size-all_medium.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-all_large{border-radius:16px;height:60px;min-width:60px}.mfui-9-button_size-all_large .mfui-9-button__icon,.mfui-9-button_size-all_large .mfui-9-button__icon-arrow,.mfui-9-button_size-all_large.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-all_extra-small.mfui-9-buttonhas-arrow{padding:0 8px}.mfui-9-button_size-all_extra-small.mfui-9-buttonhas-arrow .mfui-9-button__content{padding-left:12px}.mfui-9-button_size-all_large.mfui-9-buttonhas-arrow,.mfui-9-button_size-all_medium.mfui-9-buttonhas-arrow{padding:0 24px}.mfui-9-button_size-all_large.mfui-9-buttonhas-arrow .mfui-9-button__content,.mfui-9-button_size-all_medium.mfui-9-buttonhas-arrow .mfui-9-button__content,.mfui-9-button_size-all_small.mfui-9-buttonhas-arrow .mfui-9-button__content{padding-left:16px}.mfui-9-button_type_text{padding:0}@media screen and (min-width:1024px){.mfui-9-button_size-desktop_extra-small{border-radius:8px;font-size:12px;height:24px;line-height:14px;min-width:24px;padding:0 16px}.mfui-9-button_size-desktop_extra-small .mfui-9-button__icon,.mfui-9-button_size-desktop_extra-small .mfui-9-button__icon-arrow,.mfui-9-button_size-desktop_extra-small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:20px;width:20px}.mfui-9-button_size-desktop_extra-small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{margin-right:2px}.mfui-9-button_size-desktop_extra-small .mfui-9-button__icon-arrow{margin-left:0}.mfui-9-button_size-desktop_small{border-radius:12px;height:40px;min-width:40px;padding:0 24px}.mfui-9-button_size-desktop_small .mfui-9-button__icon,.mfui-9-button_size-desktop_small .mfui-9-button__icon-arrow{height:20px;width:20px}.mfui-9-button_size-desktop_small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-desktop_medium{border-radius:16px;height:52px;min-width:52px}.mfui-9-button_size-desktop_medium .mfui-9-button__icon,.mfui-9-button_size-desktop_medium .mfui-9-button__icon-arrow,.mfui-9-button_size-desktop_medium.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-desktop_large{border-radius:16px;height:60px;min-width:60px}.mfui-9-button_size-desktop_large .mfui-9-button__icon,.mfui-9-button_size-desktop_large .mfui-9-button__icon-arrow,.mfui-9-button_size-desktop_large.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-desktop_extra-small.mfui-9-buttonhas-arrow{padding:0 8px}.mfui-9-button_size-desktop_extra-small.mfui-9-buttonhas-arrow .mfui-9-button__content{padding-left:12px}.mfui-9-button_size-desktop_large.mfui-9-buttonhas-arrow,.mfui-9-button_size-desktop_medium.mfui-9-buttonhas-arrow{padding:0 24px}.mfui-9-button_size-desktop_large.mfui-9-buttonhas-arrow .mfui-9-button__content,.mfui-9-button_size-desktop_medium.mfui-9-buttonhas-arrow .mfui-9-button__content,.mfui-9-button_size-desktop_small.mfui-9-buttonhas-arrow .mfui-9-button__content{padding-left:16px}.mfui-9-button_type_text{padding:0}}@media screen and (min-width:1280px){.mfui-9-button_size-wide_extra-small{border-radius:8px;font-size:12px;height:24px;line-height:14px;min-width:24px;padding:0 16px}.mfui-9-button_size-wide_extra-small .mfui-9-button__icon,.mfui-9-button_size-wide_extra-small .mfui-9-button__icon-arrow,.mfui-9-button_size-wide_extra-small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:20px;width:20px}.mfui-9-button_size-wide_extra-small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{margin-right:2px}.mfui-9-button_size-wide_extra-small .mfui-9-button__icon-arrow{margin-left:0}.mfui-9-button_size-wide_small{border-radius:12px;height:40px;min-width:40px;padding:0 24px}.mfui-9-button_size-wide_small .mfui-9-button__icon,.mfui-9-button_size-wide_small .mfui-9-button__icon-arrow{height:20px;width:20px}.mfui-9-button_size-wide_small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-wide_medium{border-radius:16px;height:52px;min-width:52px}.mfui-9-button_size-wide_medium .mfui-9-button__icon,.mfui-9-button_size-wide_medium .mfui-9-button__icon-arrow,.mfui-9-button_size-wide_medium.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-wide_large{border-radius:16px;height:60px;min-width:60px}.mfui-9-button_size-wide_large .mfui-9-button__icon,.mfui-9-button_size-wide_large .mfui-9-button__icon-arrow,.mfui-9-button_size-wide_large.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-wide_extra-small.mfui-9-buttonhas-arrow{padding:0 8px}.mfui-9-button_size-wide_extra-small.mfui-9-buttonhas-arrow .mfui-9-button__content{padding-left:12px}.mfui-9-button_size-wide_large.mfui-9-buttonhas-arrow,.mfui-9-button_size-wide_medium.mfui-9-buttonhas-arrow{padding:0 24px}.mfui-9-button_size-wide_large.mfui-9-buttonhas-arrow .mfui-9-button__content,.mfui-9-button_size-wide_medium.mfui-9-buttonhas-arrow .mfui-9-button__content,.mfui-9-button_size-wide_small.mfui-9-buttonhas-arrow .mfui-9-button__content{padding-left:16px}.mfui-9-button_type_text{padding:0}}@media screen and (min-width:768px) and (max-width:1023px){.mfui-9-button_size-tablet_extra-small{border-radius:8px;font-size:12px;height:24px;line-height:14px;min-width:24px;padding:0 16px}.mfui-9-button_size-tablet_extra-small .mfui-9-button__icon,.mfui-9-button_size-tablet_extra-small .mfui-9-button__icon-arrow,.mfui-9-button_size-tablet_extra-small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:20px;width:20px}.mfui-9-button_size-tablet_extra-small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{margin-right:2px}.mfui-9-button_size-tablet_extra-small .mfui-9-button__icon-arrow{margin-left:0}.mfui-9-button_size-tablet_small{border-radius:12px;height:40px;min-width:40px;padding:0 24px}.mfui-9-button_size-tablet_small .mfui-9-button__icon,.mfui-9-button_size-tablet_small .mfui-9-button__icon-arrow{height:20px;width:20px}.mfui-9-button_size-tablet_small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-tablet_medium{border-radius:16px;height:52px;min-width:52px}.mfui-9-button_size-tablet_medium .mfui-9-button__icon,.mfui-9-button_size-tablet_medium .mfui-9-button__icon-arrow,.mfui-9-button_size-tablet_medium.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-tablet_large{border-radius:16px;height:60px;min-width:60px}.mfui-9-button_size-tablet_large .mfui-9-button__icon,.mfui-9-button_size-tablet_large .mfui-9-button__icon-arrow,.mfui-9-button_size-tablet_large.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-tablet_extra-small.mfui-9-buttonhas-arrow{padding:0 8px}.mfui-9-button_size-tablet_extra-small.mfui-9-buttonhas-arrow .mfui-9-button__content{padding-left:12px}.mfui-9-button_size-tablet_large.mfui-9-buttonhas-arrow,.mfui-9-button_size-tablet_medium.mfui-9-buttonhas-arrow{padding:0 24px}.mfui-9-button_size-tablet_large.mfui-9-buttonhas-arrow .mfui-9-button__content,.mfui-9-button_size-tablet_medium.mfui-9-buttonhas-arrow .mfui-9-button__content,.mfui-9-button_size-tablet_small.mfui-9-buttonhas-arrow .mfui-9-button__content{padding-left:16px}.mfui-9-button_type_text{padding:0}}@media screen and (max-width:767px){.mfui-9-button_size-mobile_extra-small{border-radius:8px;font-size:12px;height:24px;line-height:14px;min-width:24px;padding:0 16px}.mfui-9-button_size-mobile_extra-small .mfui-9-button__icon,.mfui-9-button_size-mobile_extra-small .mfui-9-button__icon-arrow,.mfui-9-button_size-mobile_extra-small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:20px;width:20px}.mfui-9-button_size-mobile_extra-small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{margin-right:2px}.mfui-9-button_size-mobile_extra-small .mfui-9-button__icon-arrow{margin-left:0}.mfui-9-button_size-mobile_small{border-radius:12px;height:40px;min-width:40px;padding:0 24px}.mfui-9-button_size-mobile_small .mfui-9-button__icon,.mfui-9-button_size-mobile_small .mfui-9-button__icon-arrow{height:20px;width:20px}.mfui-9-button_size-mobile_small.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-mobile_medium{border-radius:16px;height:52px;min-width:52px}.mfui-9-button_size-mobile_medium .mfui-9-button__icon,.mfui-9-button_size-mobile_medium .mfui-9-button__icon-arrow,.mfui-9-button_size-mobile_medium.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-mobile_large{border-radius:16px;height:60px;min-width:60px}.mfui-9-button_size-mobile_large .mfui-9-button__icon,.mfui-9-button_size-mobile_large .mfui-9-button__icon-arrow,.mfui-9-button_size-mobile_large.mfui-9-button_content-type_icon-text .mfui-9-button__icon{height:32px;width:32px}.mfui-9-button_size-mobile_extra-small.mfui-9-buttonhas-arrow{padding:0 8px}.mfui-9-button_size-mobile_extra-small.mfui-9-buttonhas-arrow .mfui-9-button__content{padding-left:12px}.mfui-9-button_size-mobile_large.mfui-9-buttonhas-arrow,.mfui-9-button_size-mobile_medium.mfui-9-buttonhas-arrow{padding:0 24px}.mfui-9-button_size-mobile_large.mfui-9-buttonhas-arrow .mfui-9-button__content,.mfui-9-button_size-mobile_medium.mfui-9-buttonhas-arrow .mfui-9-button__content,.mfui-9-button_size-mobile_small.mfui-9-buttonhas-arrow .mfui-9-button__content{padding-left:16px}.mfui-9-button_type_text{padding:0}}.mfui-9-button:hover{text-decoration:none;-webkit-transition:background-color .3s,color .3s;transition:background-color .3s,color .3s}.mfui-9-button:hover svg{-webkit-transition:fill .3s;transition:fill .3s}.mfui-9-button_disabled{cursor:default}.mfui-9-button__inner{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-sizing:border-box;box-sizing:border-box;height:inherit;justify-content:center;vertical-align:top;width:100%}.mfui-9-button__text{margin-bottom:2px}.mfui-9-button__text_ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mfui-9-button__content{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.mfui-9-button__content_ellipsis{max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content;width:inherit}.mfui-9-button__content_show-loader{visibility:hidden}.mfui-9-button__preloader{position:absolute}.mfui-9-button__icon-arrow{height:32px;margin-left:4px;width:32px}.mfui-9-button_content-type_icon{padding:0}.mfui-9-button_content-type_icon-text .mfui-9-button__icon,.mfui-9-button_content-type_icon-text:not(.mfui-9-button_type_text) .mfui-9-button__text{margin-right:4px}.mfui-9-button_type_text.mfui-9-button_theme_green{background-color:transparent;color:var(--brandGreen);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.mfui-9-button_type_text.mfui-9-button_theme_green svg{fill:var(--brandGreen)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_green:not(.mfui-9-button_loading):hover{color:var(--buttonHoverGreen)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_green:not(.mfui-9-button_loading):hover svg{fill:var(--buttonHoverGreen)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_green:not(.mfui-9-button_loading):active{color:var(--buttonDown)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_green:not(.mfui-9-button_loading):active svg{fill:var(--buttonDown)}.mfui-9-button_type_text.mfui-9-button_theme_purple{background-color:transparent;color:var(--brandPurple);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.mfui-9-button_type_text.mfui-9-button_theme_purple svg{fill:var(--brandPurple)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_purple:not(.mfui-9-button_loading):hover{color:var(--buttonHoverPurple)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_purple:not(.mfui-9-button_loading):hover svg{fill:var(--buttonHoverPurple)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_purple:not(.mfui-9-button_loading):active{color:var(--buttonDown)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_purple:not(.mfui-9-button_loading):active svg{fill:var(--buttonDown)}.mfui-9-button_type_text.mfui-9-button_theme_white{background-color:transparent;color:var(--stcWhite);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.mfui-9-button_type_text.mfui-9-button_theme_white svg{fill:var(--stcWhite)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_white:not(.mfui-9-button_loading):hover{color:var(--buttonHoverGrey)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_white:not(.mfui-9-button_loading):hover svg{fill:var(--buttonHoverGrey)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_white:not(.mfui-9-button_loading):active{color:var(--buttonDown)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_white:not(.mfui-9-button_loading):active svg{fill:var(--buttonDown)}.mfui-9-button_type_text.mfui-9-button_theme_black{background-color:transparent;color:var(--stcBlack);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.mfui-9-button_type_text.mfui-9-button_theme_black svg{fill:var(--stcBlack)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_black{--stcBlack7:#818181}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_black:not(.mfui-9-button_loading):hover{color:var(--stcBlack7)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_black:not(.mfui-9-button_loading):hover svg{fill:var(--stcBlack7)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_black:not(.mfui-9-button_loading):active{color:var(--buttonDown)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_black:not(.mfui-9-button_loading):active svg{fill:var(--buttonDown)}.mfui-9-button_type_text.mfui-9-button_theme_danger{background-color:transparent;color:var(--fury);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.mfui-9-button_type_text.mfui-9-button_theme_danger svg{fill:var(--fury)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_danger:not(.mfui-9-button_loading):hover{color:var(--fury80)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_danger:not(.mfui-9-button_loading):hover svg{fill:var(--fury80)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_danger:not(.mfui-9-button_loading):active{color:var(--buttonDown)}.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_danger:not(.mfui-9-button_loading):active svg{fill:var(--buttonDown)}.mfui-9-button_type_primary.mfui-9-button_theme_green{background-color:var(--brandGreen);color:var(--stcWhite)}.mfui-9-button_type_primary.mfui-9-button_theme_green svg{fill:var(--stcWhite)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_green:not(.mfui-9-button_loading):hover{background-color:var(--buttonHoverGreen)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_green:not(.mfui-9-button_loading):active{background-color:var(--buttonDown)}.mfui-9-button_type_primary.mfui-9-button_theme_green-soft{background-color:var(--brandGreen20);border:1px solid rgba(0,185,86,.2);color:var(--brandGreen)}.mfui-9-button_type_primary.mfui-9-button_theme_green-soft svg{fill:var(--brandGreen)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_green-soft:not(.mfui-9-button_loading):hover{background-color:var(--buttonHoverGreenSoft)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_green-soft:not(.mfui-9-button_loading):active{background-color:var(--buttonDown);color:var(--stcWhite)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_green-soft:not(.mfui-9-button_loading):active svg{fill:var(--stcWhite)}.mfui-9-button_type_primary.mfui-9-button_theme_purple{background-color:var(--brandPurple);color:var(--stcWhite)}.mfui-9-button_type_primary.mfui-9-button_theme_purple svg{fill:var(--stcWhite)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_purple:not(.mfui-9-button_loading):hover{background-color:var(--buttonHoverPurple)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_purple:not(.mfui-9-button_loading):active{background-color:var(--buttonDown)}.mfui-9-button_type_primary.mfui-9-button_theme_purple-soft{background-color:var(--brandPurple20);border:1px solid rgba(115,25,130,.2);color:var(--brandPurple)}.mfui-9-button_type_primary.mfui-9-button_theme_purple-soft svg{fill:var(--brandPurple)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_purple-soft:not(.mfui-9-button_loading):hover{background-color:var(--buttonHoverPurpleSoft)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_purple-soft:not(.mfui-9-button_loading):active{background-color:var(--buttonDown);color:var(--stcWhite)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_purple-soft:not(.mfui-9-button_loading):active svg{fill:var(--stcWhite)}.mfui-9-button_type_primary.mfui-9-button_theme_white{background-color:var(--stcWhite);color:var(--stcBlack)}.mfui-9-button_type_primary.mfui-9-button_theme_white svg{fill:var(--stcBlack)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_white:not(.mfui-9-button_loading):hover{background-color:var(--buttonHoverGrey);color:var(--stcBlack)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_white:not(.mfui-9-button_loading):hover svg{fill:var(--stcBlack)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_white:not(.mfui-9-button_loading):active{background-color:var(--buttonDown);color:var(--stcWhite)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_white:not(.mfui-9-button_loading):active svg{fill:var(--stcWhite)}.mfui-9-button_type_primary.mfui-9-button_theme_gray{background-color:var(--spbSky0);color:var(--content)}.mfui-9-button_type_primary.mfui-9-button_theme_gray svg{fill:var(--content)}.mfui-9-button_type_primary.mfui-9-button_theme_gray .mfui-9-button__content,.mfui-9-button_type_primary.mfui-9-button_theme_gray svg{opacity:.8}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_gray:not(.mfui-9-button_loading):hover{background-color:var(--spbSky1)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_gray:not(.mfui-9-button_loading):hover svg{opacity:.8;fill:var(--content)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_gray:not(.mfui-9-button_loading):active{background-color:var(--spbSky2)}.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_theme_gray:not(.mfui-9-button_loading):active svg{opacity:.8;fill:var(--content)}.mfui-9-button_type_outline.mfui-9-button_theme_green{background-color:transparent;border:1px solid var(--brandGreen);color:var(--brandGreen)}.mfui-9-button_type_outline.mfui-9-button_theme_green svg{fill:var(--brandGreen)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_green{--brandGreen7:rgba(0,185,86,.07);--brandGreen14:rgba(0,185,86,.14)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_green:not(.mfui-9-button_loading):hover{background-color:var(--brandGreen7)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_green:not(.mfui-9-button_loading):active{background-color:var(--brandGreen14)}.mfui-9-button_type_outline.mfui-9-button_theme_green-soft{background-color:transparent;color:var(--brandGreen)}.mfui-9-button_type_outline.mfui-9-button_theme_green-soft svg{fill:var(--brandGreen)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_green-soft{--brandGreen7:rgba(0,185,86,.07);--brandGreen14:rgba(0,185,86,.14)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_green-soft:not(.mfui-9-button_loading):hover{background-color:var(--brandGreen7)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_green-soft:not(.mfui-9-button_loading):active{background-color:var(--brandGreen14)}.mfui-9-button_type_outline.mfui-9-button_theme_purple{background-color:transparent;border:1px solid var(--brandPurple);color:var(--brandPurple)}.mfui-9-button_type_outline.mfui-9-button_theme_purple svg{fill:var(--brandPurple)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_purple{--brandPurple7:rgba(115,25,130,.07);--brandPurple14:rgba(115,25,130,.14)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_purple:not(.mfui-9-button_loading):hover{background-color:var(--brandPurple7)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_purple:not(.mfui-9-button_loading):active{background-color:var(--brandPurple14)}.mfui-9-button_type_outline.mfui-9-button_theme_white{background-color:transparent;border:1px solid var(--stcWhite);color:var(--stcWhite)}.mfui-9-button_type_outline.mfui-9-button_theme_white svg{fill:var(--stcWhite)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_white{--stcWhite7:hsla(0,0%,100%,.07);--stcWhite14:hsla(0,0%,100%,.14)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_white:not(.mfui-9-button_loading):hover{background-color:var(--stcWhite7)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_white:not(.mfui-9-button_loading):active{background-color:var(--stcWhite14)}.mfui-9-button_type_outline.mfui-9-button_theme_black{background-color:transparent;border:1px solid var(--stcBlack);color:var(--stcBlack)}.mfui-9-button_type_outline.mfui-9-button_theme_black svg{fill:var(--stcBlack)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_black{--stcBlack7:rgba(51,51,51,.07);--stcBlack14:rgba(51,51,51,.14)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_black:not(.mfui-9-button_loading):hover{background-color:var(--stcBlack7)}.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_black:not(.mfui-9-button_loading):active{background-color:var(--stcBlack14)}.mfui-9-button_full-width{display:block;width:100%}@media screen and (max-width:767px){.mfui-9-button_full-width-mobile{display:block;width:100%}}.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_disabled,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_disabled:active,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_disabled:hover,.mfui-9-button.mfui-9-button_type_primary.mfui-9-button_disabled{background-color:var(--spbSky1);border:1px solid var(--spbSky2);color:var(--spbSky3)}.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_disabled svg,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_disabled:active svg,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_primary.mfui-9-button_disabled:hover svg,.mfui-9-button.mfui-9-button_type_primary.mfui-9-button_disabled svg{fill:var(--spbSky3)}.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_white.mfui-9-button_disabled,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_white.mfui-9-button_disabled:active,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_white.mfui-9-button_disabled:hover,.mfui-9-button.mfui-9-button_type_outline.mfui-9-button_theme_white.mfui-9-button_disabled{background-color:transparent;border:1px solid var(--stcWhite);color:var(--stcWhite50)}.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_white.mfui-9-button_disabled svg,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_white.mfui-9-button_disabled:active svg,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_theme_white.mfui-9-button_disabled:hover svg,.mfui-9-button.mfui-9-button_type_outline.mfui-9-button_theme_white.mfui-9-button_disabled svg{fill:var(--stcWhite50)}.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_disabled,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_disabled:active,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_disabled:hover,.mfui-9-button.mfui-9-button_type_outline.mfui-9-button_disabled{background-color:transparent;border:1px solid var(--spbSky2);color:var(--spbSky3)}.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_disabled svg,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_disabled:active svg,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_outline.mfui-9-button_disabled:hover svg,.mfui-9-button.mfui-9-button_type_outline.mfui-9-button_disabled svg{fill:var(--spbSky3)}.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_disabled,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_disabled:active,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_disabled:hover,.mfui-9-button.mfui-9-button_type_text.mfui-9-button_disabled{color:var(--spbSky3)}.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_disabled svg,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_disabled:active svg,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_disabled:hover svg,.mfui-9-button.mfui-9-button_type_text.mfui-9-button_disabled svg{fill:var(--spbSky3)}.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_white.mfui-9-button_disabled,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_white.mfui-9-button_disabled:active,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_white.mfui-9-button_disabled:hover,.mfui-9-button.mfui-9-button_type_text.mfui-9-button_theme_white.mfui-9-button_disabled{background-color:transparent;color:var(--stcWhite)}.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_white.mfui-9-button_disabled svg,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_white.mfui-9-button_disabled:active svg,.mfui-9-button.mfui-9-button_no-touch.mfui-9-button_type_text.mfui-9-button_theme_white.mfui-9-button_disabled:hover svg,.mfui-9-button.mfui-9-button_type_text.mfui-9-button_theme_white.mfui-9-button_disabled svg{fill:var(--stcWhite)}
|
|
@@ -14,6 +14,7 @@ export declare const ButtonThemes: {
|
|
|
14
14
|
readonly WHITE: "white";
|
|
15
15
|
readonly BLACK: "black";
|
|
16
16
|
readonly DANGER: "danger";
|
|
17
|
+
readonly GRAY: "gray";
|
|
17
18
|
};
|
|
18
19
|
type ButtonThemesType = (typeof ButtonThemes)[keyof typeof ButtonThemes];
|
|
19
20
|
export declare const ButtonSizes: {
|
|
@@ -15,7 +15,7 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
15
15
|
};
|
|
16
16
|
import * as React from 'react';
|
|
17
17
|
import { cnCreate, detectTouch, filterDataAttrs } from '@megafon/ui-helpers';
|
|
18
|
-
import Preloader, { PreloaderColors } from "
|
|
18
|
+
import Preloader, { PreloaderColors } from "../../Preloader/Preloader";
|
|
19
19
|
import "./Button.css";
|
|
20
20
|
var Arrow = function Arrow(props) {
|
|
21
21
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
@@ -36,7 +36,8 @@ export var ButtonThemes = {
|
|
|
36
36
|
PURPLE_SOFT: 'purple-soft',
|
|
37
37
|
WHITE: 'white',
|
|
38
38
|
BLACK: 'black',
|
|
39
|
-
DANGER: 'danger'
|
|
39
|
+
DANGER: 'danger',
|
|
40
|
+
GRAY: 'gray'
|
|
40
41
|
};
|
|
41
42
|
export var ButtonSizes = {
|
|
42
43
|
EXTRA_SMALL: 'extra-small',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-9-button-close{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;background-color:transparent;border:none;border-radius:30px;cursor:pointer;height:44px;justify-content:center;outline:none;overflow:hidden;text-decoration:none;width:44px;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.mfui-9-button-close__inner{position:relative;-webkit-transition:background-color .3s,color .3s;transition:background-color .3s,color .3s}.mfui-9-button-close__inner:before{border-radius:inherit;content:"";height:100%;left:0;position:absolute;top:0;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transition-property:background-color,color,opacity;transition-property:background-color,color,opacity;width:100%}.mfui-9-button-close_size_small .mfui-9-button-close__inner{border-radius:8px}.mfui-9-button-close_size_small .mfui-9-button-close__icon{height:24px;min-width:24px}.mfui-9-button-close_size_medium .mfui-9-button-close__inner{border-radius:12px}.mfui-9-button-close_size_medium .mfui-9-button-close__icon{height:32px;min-width:32px}.mfui-9-button-close_theme_white .mfui-9-button-close__inner{background-color:var(--spbSky0)}.mfui-9-button-close_theme_white .mfui-9-button-close__inner svg{fill:var(--spbSky3)}.mfui-9-button-close_theme_white:hover .mfui-9-button-close__inner{background-color:var(--spbSky1)}.mfui-9-button-close_theme_white:active .mfui-9-button-close__inner{background-color:var(--spbSky2)}.mfui-9-button-close_theme_gray .mfui-9-button-close__inner{background-color:var(--base)}.mfui-9-button-close_theme_gray .mfui-9-button-close__inner svg{fill:var(--spbSky3)}.mfui-9-button-close_theme_gray:hover .mfui-9-button-close__inner{background-color:var(--spbSky1)}.mfui-9-button-close_theme_gray:active .mfui-9-button-close__inner{background-color:var(--spbSky2)}.mfui-9-button-close_theme_soft .mfui-9-button-close__inner svg{opacity:.5;fill:var(--content)}.mfui-9-button-close_theme_soft .mfui-9-button-close__inner:before{background-color:var(--content);opacity:.05}.mfui-9-button-close_theme_soft:hover .mfui-9-button-close__inner:before{background-color:var(--content);opacity:.1}.mfui-9-button-close_theme_soft:active .mfui-9-button-close__inner:before{background-color:var(--content);opacity:.2}.mfui-9-button-close_theme_color .mfui-9-button-close__inner{background-color:var(--stcWhite20)}.mfui-9-button-close_theme_color .mfui-9-button-close__inner svg{fill:var(--stcWhite)}.mfui-9-button-close_theme_color:hover .mfui-9-button-close__inner{background-color:var(--stcWhite50)}.mfui-9-button-close_theme_color:active .mfui-9-button-close__inner{background:hsla(0,0%,100%,.8)}.mfui-9-button-close_theme_black .mfui-9-button-close__inner:before{background-color:var(--base);opacity:.1}.mfui-9-button-close_theme_black .mfui-9-button-close__inner svg{fill:var(--spbSky3)}.mfui-9-button-close_theme_black:hover .mfui-9-button-close__inner:before{background-color:var(--base);opacity:.2}.mfui-9-button-close_theme_black:active .mfui-9-button-close__inner:before{background-color:var(--base);opacity:.5}.mfui-9-button-close_theme_black:active .mfui-9-button-close__inner svg{fill:var(--base)}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import './ButtonClose.scss';
|
|
3
|
+
export declare const ButtonCloseThemes: {
|
|
4
|
+
readonly WHITE: "white";
|
|
5
|
+
readonly GRAY: "gray";
|
|
6
|
+
readonly SOFT: "soft";
|
|
7
|
+
readonly COLOR: "color";
|
|
8
|
+
readonly BLACK: "black";
|
|
9
|
+
};
|
|
10
|
+
type ButtonCloseThemesType = (typeof ButtonCloseThemes)[keyof typeof ButtonCloseThemes];
|
|
11
|
+
export declare const ButtonCloseSizes: {
|
|
12
|
+
readonly SMALL: "small";
|
|
13
|
+
readonly MEDIUM: "medium";
|
|
14
|
+
};
|
|
15
|
+
type ButtonCloseSizesType = (typeof ButtonCloseSizes)[keyof typeof ButtonCloseSizes];
|
|
16
|
+
type ButtonCloseAttributes = Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof React.ButtonHTMLAttributes<HTMLButtonElement>>;
|
|
17
|
+
export interface IButtonCloseProps extends Omit<ButtonCloseAttributes, 'className'> {
|
|
18
|
+
/** Дополнительный класс корневого элемента */
|
|
19
|
+
className?: string | string[];
|
|
20
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
21
|
+
dataAttrs?: Record<string, string>;
|
|
22
|
+
/** Тема компонента */
|
|
23
|
+
theme?: ButtonCloseThemesType;
|
|
24
|
+
/** Размер компонента */
|
|
25
|
+
size?: ButtonCloseSizesType;
|
|
26
|
+
/** Отключение кнопки */
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
/** Ссылка на элемент */
|
|
29
|
+
buttonRef?: React.Ref<HTMLButtonElement>;
|
|
30
|
+
/** Обработчик клика по кнопке */
|
|
31
|
+
onClick?: (e: React.SyntheticEvent<EventTarget>) => void;
|
|
32
|
+
}
|
|
33
|
+
declare const ButtonClose: React.FC<IButtonCloseProps>;
|
|
34
|
+
export default ButtonClose;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import "core-js/modules/es.symbol.js";
|
|
3
|
+
import "core-js/modules/es.array.index-of.js";
|
|
4
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
5
|
+
var t = {};
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
7
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
14
|
+
import "./ButtonClose.css";
|
|
15
|
+
var CancelIcon = function CancelIcon(props) {
|
|
16
|
+
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
17
|
+
viewBox: "0 0 32 32"
|
|
18
|
+
}, props), /*#__PURE__*/React.createElement("path", {
|
|
19
|
+
className: "CancelIcon__st0",
|
|
20
|
+
d: "M16 14.5L11.5 10 10 11.5l4.5 4.5-4.5 4.5 1.5 1.5 4.5-4.5 4.5 4.5 1.5-1.5-4.5-4.5 4.5-4.5-1.5-1.5-4.5 4.5z"
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
23
|
+
export var ButtonCloseThemes = {
|
|
24
|
+
WHITE: 'white',
|
|
25
|
+
GRAY: 'gray',
|
|
26
|
+
SOFT: 'soft',
|
|
27
|
+
COLOR: 'color',
|
|
28
|
+
BLACK: 'black'
|
|
29
|
+
};
|
|
30
|
+
export var ButtonCloseSizes = {
|
|
31
|
+
SMALL: 'small',
|
|
32
|
+
MEDIUM: 'medium'
|
|
33
|
+
};
|
|
34
|
+
var cn = cnCreate('mfui-9-button-close');
|
|
35
|
+
var ButtonClose = function ButtonClose(_a) {
|
|
36
|
+
var _a$className = _a.className,
|
|
37
|
+
className = _a$className === void 0 ? '' : _a$className,
|
|
38
|
+
_a$theme = _a.theme,
|
|
39
|
+
theme = _a$theme === void 0 ? 'white' : _a$theme,
|
|
40
|
+
_a$size = _a.size,
|
|
41
|
+
size = _a$size === void 0 ? 'small' : _a$size,
|
|
42
|
+
disabled = _a.disabled,
|
|
43
|
+
onClick = _a.onClick,
|
|
44
|
+
dataAttrs = _a.dataAttrs,
|
|
45
|
+
buttonRef = _a.buttonRef,
|
|
46
|
+
rest = __rest(_a, ["className", "theme", "size", "disabled", "onClick", "dataAttrs", "buttonRef"]);
|
|
47
|
+
var handleClick = React.useCallback(function (e) {
|
|
48
|
+
if (disabled) {
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(e);
|
|
53
|
+
}, [disabled, onClick]);
|
|
54
|
+
return /*#__PURE__*/React.createElement("button", _extends({
|
|
55
|
+
type: "button",
|
|
56
|
+
className: cn({
|
|
57
|
+
size: size,
|
|
58
|
+
theme: theme,
|
|
59
|
+
disabled: disabled
|
|
60
|
+
}, className),
|
|
61
|
+
onClick: handleClick,
|
|
62
|
+
disabled: disabled,
|
|
63
|
+
ref: buttonRef
|
|
64
|
+
}, filterDataAttrs(dataAttrs), rest), /*#__PURE__*/React.createElement("div", {
|
|
65
|
+
className: cn('inner')
|
|
66
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
className: cn('icon')
|
|
68
|
+
}, /*#__PURE__*/React.createElement(CancelIcon, null))));
|
|
69
|
+
};
|
|
70
|
+
export default ButtonClose;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}.mfui-9-chip{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-family:inherit;font-size:15px;font-weight:500;line-height:24px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--spbSky0);border:none;border-radius:20px;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--content);overflow:hidden;padding:8px 20px;text-align:center;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;outline:none;-webkit-transition:background-color .3s,color .3s;transition:background-color .3s,color .3s}.mfui-9-chip svg{-webkit-transition:fill .3s;transition:fill .3s;fill:var(--content)}@media screen and (max-width:767px){.mfui-9-chip{padding:4px 12px}}.mfui-9-chip:hover{background-color:var(--spbSky1)}.mfui-9-chip__inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mfui-9-chip__counter{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--spbSky3);margin-left:6px}@media screen and (max-width:767px){.mfui-9-chip__counter{margin-left:4px}}.mfui-9-chip__icon,.mfui-9-chip__icon-arrow{display:block;max-height:20px;min-width:20px;width:20px}.mfui-9-chip__icon svg,.mfui-9-chip__icon-arrow svg{display:block;height:100%;width:100%}.mfui-9-chip__icon{margin-right:6px}@media screen and (max-width:767px){.mfui-9-chip__icon{margin-right:4px}}.mfui-9-chip_disabled,.mfui-9-chip_disabled:hover{background-color:var(--spbSky0);color:var(--spbSky3);cursor:default;pointer-events:none}.mfui-9-chip_disabled svg,.mfui-9-chip_disabled:hover svg{fill:var(--spbSky3)}.mfui-9-chip_disabled .mfui-9-chip__counter,.mfui-9-chip_disabled:hover .mfui-9-chip__counter{color:var(--spbSky2)}.mfui-9-chip_checked,.mfui-9-chip_checked:hover{background-color:var(--night);color:var(--stcWhite)}.mfui-9-chip_checked svg,.mfui-9-chip_checked:hover svg{fill:var(--stcWhite)}.mfui-9-chip_checked .mfui-9-chip__counter,.mfui-9-chip_checked:hover .mfui-9-chip__counter{color:var(--stcWhite)}.mfui-9-chip_checked.mfui-9-chip_color_black,.mfui-9-chip_checked.mfui-9-chip_color_black:hover{background-color:var(--content);color:var(--base)}.mfui-9-chip_checked.mfui-9-chip_color_black svg,.mfui-9-chip_checked.mfui-9-chip_color_black:hover svg{fill:var(--base)}.mfui-9-chip_checked.mfui-9-chip_color_black .mfui-9-chip__counter,.mfui-9-chip_checked.mfui-9-chip_color_black:hover .mfui-9-chip__counter{color:var(--base)}.mfui-9-chip_with-icon{padding-left:16px}@media screen and (max-width:767px){.mfui-9-chip_with-icon{padding-left:8px}}
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-9-chip{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-family:inherit;font-size:15px;font-weight:500;line-height:24px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--spbSky0);border:none;border-radius:20px;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--content);overflow:hidden;padding:8px 20px;text-align:center;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;outline:none;-webkit-transition:background-color .3s,color .3s;transition:background-color .3s,color .3s}.mfui-9-chip.mfui-9-chip_theme_gray{background-color:var(--spbSky1)}.mfui-9-chip svg{-webkit-transition:fill .3s;transition:fill .3s;fill:var(--content)}@media screen and (max-width:767px){.mfui-9-chip{padding:4px 12px}}.mfui-9-chip:hover{background-color:var(--spbSky1)}.mfui-9-chip.mfui-9-chip_theme_gray:hover{background-color:var(--spbSky2)}.mfui-9-chip__inner{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mfui-9-chip__counter{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--spbSky3);margin-left:6px}@media screen and (max-width:767px){.mfui-9-chip__counter{margin-left:4px}}.mfui-9-chip__icon,.mfui-9-chip__icon-arrow{display:block;max-height:20px;min-width:20px;width:20px}.mfui-9-chip__icon svg,.mfui-9-chip__icon-arrow svg{display:block;height:100%;width:100%}.mfui-9-chip__icon{margin-right:6px}@media screen and (max-width:767px){.mfui-9-chip__icon{margin-right:4px}}.mfui-9-chip_disabled,.mfui-9-chip_disabled:hover{background-color:var(--spbSky0);color:var(--spbSky3);cursor:default;pointer-events:none}.mfui-9-chip_disabled svg,.mfui-9-chip_disabled:hover svg{fill:var(--spbSky3)}.mfui-9-chip_disabled .mfui-9-chip__counter,.mfui-9-chip_disabled:hover .mfui-9-chip__counter{color:var(--spbSky2)}.mfui-9-chip_disabled.mfui-9-chip_theme_gray,.mfui-9-chip_disabled.mfui-9-chip_theme_gray:hover{background-color:var(--spbSky1)}.mfui-9-chip_checked,.mfui-9-chip_checked:hover{background-color:var(--night);color:var(--stcWhite)}.mfui-9-chip_checked svg,.mfui-9-chip_checked:hover svg{fill:var(--stcWhite)}.mfui-9-chip_checked .mfui-9-chip__counter,.mfui-9-chip_checked:hover .mfui-9-chip__counter{color:var(--stcWhite)}.mfui-9-chip_checked.mfui-9-chip_color_black,.mfui-9-chip_checked.mfui-9-chip_color_black:hover{background-color:var(--content);color:var(--base)}.mfui-9-chip_checked.mfui-9-chip_color_black svg,.mfui-9-chip_checked.mfui-9-chip_color_black:hover svg{fill:var(--base)}.mfui-9-chip_checked.mfui-9-chip_color_black .mfui-9-chip__counter,.mfui-9-chip_checked.mfui-9-chip_color_black:hover .mfui-9-chip__counter{color:var(--base)}.mfui-9-chip_with-icon{padding-left:16px}@media screen and (max-width:767px){.mfui-9-chip_with-icon{padding-left:8px}}
|
|
@@ -6,6 +6,11 @@ export declare const ChipColors: {
|
|
|
6
6
|
readonly BLACK: "black";
|
|
7
7
|
};
|
|
8
8
|
export type ChipColorsType = (typeof ChipColors)[keyof typeof ChipColors];
|
|
9
|
+
export declare const ChipThemes: {
|
|
10
|
+
readonly WHITE: "white";
|
|
11
|
+
readonly GRAY: "gray";
|
|
12
|
+
};
|
|
13
|
+
export type ChipsThemeType = (typeof ChipThemes)[keyof typeof ChipThemes];
|
|
9
14
|
export declare const ChipArrow: {
|
|
10
15
|
readonly UP: "up";
|
|
11
16
|
readonly DOWN: "down";
|
|
@@ -16,8 +21,10 @@ export interface IChipProps {
|
|
|
16
21
|
id: ChipIdType;
|
|
17
22
|
/** Заголовок */
|
|
18
23
|
title?: string;
|
|
19
|
-
/**
|
|
24
|
+
/** Цвет активного элемента компонента */
|
|
20
25
|
color?: ChipColorsType;
|
|
26
|
+
/** Цвета неактивных элементов компонента */
|
|
27
|
+
theme?: ChipsThemeType;
|
|
21
28
|
/** Отображение в отмеченном (зажатом) состоянии */
|
|
22
29
|
checked?: boolean;
|
|
23
30
|
/** Отключенное состояние */
|
|
@@ -41,6 +48,7 @@ export interface IChipProps {
|
|
|
41
48
|
inner?: string;
|
|
42
49
|
icon?: string;
|
|
43
50
|
counter?: string;
|
|
51
|
+
arrow?: string;
|
|
44
52
|
};
|
|
45
53
|
/** Дополнительные data атрибуты к внутренним элементам */
|
|
46
54
|
dataAttrs?: {
|
|
@@ -24,6 +24,10 @@ export var ChipColors = {
|
|
|
24
24
|
DEFAULT: 'default',
|
|
25
25
|
BLACK: 'black'
|
|
26
26
|
};
|
|
27
|
+
export var ChipThemes = {
|
|
28
|
+
WHITE: 'white',
|
|
29
|
+
GRAY: 'gray'
|
|
30
|
+
};
|
|
27
31
|
export var ChipArrow = {
|
|
28
32
|
UP: 'up',
|
|
29
33
|
DOWN: 'down'
|
|
@@ -34,6 +38,8 @@ var Chip = function Chip(_ref) {
|
|
|
34
38
|
title = _ref.title,
|
|
35
39
|
_ref$color = _ref.color,
|
|
36
40
|
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
41
|
+
_ref$theme = _ref.theme,
|
|
42
|
+
theme = _ref$theme === void 0 ? 'white' : _ref$theme,
|
|
37
43
|
_ref$checked = _ref.checked,
|
|
38
44
|
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
39
45
|
_ref$disabled = _ref.disabled,
|
|
@@ -56,6 +62,7 @@ var Chip = function Chip(_ref) {
|
|
|
56
62
|
type: "button",
|
|
57
63
|
className: cn({
|
|
58
64
|
color: color,
|
|
65
|
+
theme: theme,
|
|
59
66
|
checked: checked,
|
|
60
67
|
disabled: disabled,
|
|
61
68
|
'with-icon': !!icon
|
|
@@ -71,7 +78,7 @@ var Chip = function Chip(_ref) {
|
|
|
71
78
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.inner)), children || title), !!counterValue && /*#__PURE__*/React.createElement("span", _extends({
|
|
72
79
|
className: cn('counter', [classes.counter])
|
|
73
80
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.counter)), counterValue), !!arrow && /*#__PURE__*/React.createElement("div", _extends({
|
|
74
|
-
className: cn('icon-arrow')
|
|
81
|
+
className: cn('icon-arrow', [classes.arrow])
|
|
75
82
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.arrow)), arrow === 'up' ? /*#__PURE__*/React.createElement(ArrowUp, null) : /*#__PURE__*/React.createElement(ArrowDown, null)));
|
|
76
83
|
};
|
|
77
84
|
export default Chip;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DropdownItemsPaddingType } from '../../Dropdown/Dropdown';
|
|
3
|
+
import { ChipColorsType, ChipIdType, IChipProps, ChipsThemeType } from './Chip';
|
|
3
4
|
import './Chips.scss';
|
|
4
5
|
export interface IChipsProps {
|
|
5
6
|
/** Массив элементов */
|
|
@@ -8,6 +9,8 @@ export interface IChipsProps {
|
|
|
8
9
|
value?: ChipIdType;
|
|
9
10
|
/** Цвет активного элемента */
|
|
10
11
|
color?: ChipColorsType;
|
|
12
|
+
/** Цвет неактивных элементов */
|
|
13
|
+
theme?: ChipsThemeType;
|
|
11
14
|
/** Горизонтальное выравнивание */
|
|
12
15
|
align?: 'left' | 'center';
|
|
13
16
|
/** Переводит компонент в контролируемое состояние */
|
|
@@ -24,6 +27,10 @@ export interface IChipsProps {
|
|
|
24
27
|
visibleItemsCountWide?: number;
|
|
25
28
|
/** Название дополнительной кнопки */
|
|
26
29
|
moreTitle?: string;
|
|
30
|
+
/** Попап выпадающего списка короче в высоту */
|
|
31
|
+
isDropdownShort?: boolean;
|
|
32
|
+
/** Отступы элементов списка выпадающего списка */
|
|
33
|
+
dropdownPaddings?: DropdownItemsPaddingType;
|
|
27
34
|
/** Обработчик изменения значения */
|
|
28
35
|
onChange?: (id: ChipIdType, e?: React.SyntheticEvent<EventTarget>) => void;
|
|
29
36
|
/** Дополнительный класс корневого элемента */
|
|
@@ -32,13 +39,17 @@ export interface IChipsProps {
|
|
|
32
39
|
classes?: {
|
|
33
40
|
root?: string;
|
|
34
41
|
dropdown?: string;
|
|
42
|
+
dropdownPopup?: string;
|
|
35
43
|
dropdownList?: string;
|
|
44
|
+
dropdownItem?: string;
|
|
36
45
|
};
|
|
37
46
|
/** Дополнительные data атрибуты к внутренним элементам */
|
|
38
47
|
dataAttrs?: {
|
|
39
48
|
root?: Record<string, string>;
|
|
40
49
|
dropdown?: Record<string, string>;
|
|
50
|
+
dropdownPopup?: Record<string, string>;
|
|
41
51
|
dropdownList?: Record<string, string>;
|
|
52
|
+
dropdownItem?: Record<string, string>;
|
|
42
53
|
};
|
|
43
54
|
}
|
|
44
55
|
declare const Chips: React.FC<IChipsProps>;
|
|
@@ -29,8 +29,13 @@ var Chips = function Chips(_ref) {
|
|
|
29
29
|
value = _ref.value,
|
|
30
30
|
_ref$color = _ref.color,
|
|
31
31
|
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
32
|
+
_ref$theme = _ref.theme,
|
|
33
|
+
theme = _ref$theme === void 0 ? 'white' : _ref$theme,
|
|
32
34
|
_ref$moreTitle = _ref.moreTitle,
|
|
33
35
|
moreTitle = _ref$moreTitle === void 0 ? 'Еще' : _ref$moreTitle,
|
|
36
|
+
_ref$isDropdownShort = _ref.isDropdownShort,
|
|
37
|
+
isDropdownShort = _ref$isDropdownShort === void 0 ? false : _ref$isDropdownShort,
|
|
38
|
+
dropdownPaddings = _ref.dropdownPaddings,
|
|
34
39
|
visibleItemsCountAll = _ref.visibleItemsCountAll,
|
|
35
40
|
visibleItemsCountTablet = _ref.visibleItemsCountTablet,
|
|
36
41
|
visibleItemsCountDesktop = _ref.visibleItemsCountDesktop,
|
|
@@ -79,6 +84,7 @@ var Chips = function Chips(_ref) {
|
|
|
79
84
|
value: selectedId,
|
|
80
85
|
items: visibleItems,
|
|
81
86
|
color: color,
|
|
87
|
+
theme: theme,
|
|
82
88
|
onClick: handleClick
|
|
83
89
|
});
|
|
84
90
|
}
|
|
@@ -91,6 +97,7 @@ var Chips = function Chips(_ref) {
|
|
|
91
97
|
id: id,
|
|
92
98
|
checked: id === selectedId,
|
|
93
99
|
color: color,
|
|
100
|
+
theme: theme,
|
|
94
101
|
onClick: handleClick
|
|
95
102
|
}, rest), !!children && children);
|
|
96
103
|
});
|
|
@@ -137,19 +144,26 @@ var Chips = function Chips(_ref) {
|
|
|
137
144
|
align: align
|
|
138
145
|
}, [className, classes.root])
|
|
139
146
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), renderItems(), !!hiddenItems && /*#__PURE__*/React.createElement(ChipsDropdown, {
|
|
140
|
-
value: selectedId,
|
|
141
147
|
items: hiddenItems,
|
|
142
|
-
moreTitle: moreTitle,
|
|
143
148
|
color: color,
|
|
144
|
-
|
|
149
|
+
theme: theme,
|
|
150
|
+
moreTitle: moreTitle,
|
|
151
|
+
"short": isDropdownShort,
|
|
152
|
+
value: selectedId,
|
|
153
|
+
paddings: dropdownPaddings,
|
|
145
154
|
classes: {
|
|
146
155
|
root: classes.dropdown,
|
|
147
|
-
|
|
156
|
+
popup: classes.dropdownPopup,
|
|
157
|
+
list: classes.dropdownList,
|
|
158
|
+
item: classes.dropdownItem
|
|
148
159
|
},
|
|
149
160
|
dataAttrs: {
|
|
150
161
|
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.dropdown,
|
|
151
|
-
|
|
152
|
-
|
|
162
|
+
popup: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.dropdownPopup,
|
|
163
|
+
list: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.dropdownList,
|
|
164
|
+
item: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.dropdownItem
|
|
165
|
+
},
|
|
166
|
+
onClick: handleClick
|
|
153
167
|
}));
|
|
154
168
|
};
|
|
155
169
|
export default Chips;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
h1,h2,h3,h4,h5{margin:0}
|
|
1
|
+
h1,h2,h3,h4,h5{margin:0}.mfui-9-chips-dropdown{position:relative}.mfui-9-chips-dropdown__button{width:100%}.mfui-9-chips-dropdown__arrow{-webkit-transition:-webkit-transform .6s;transition:-webkit-transform .6s;transition:transform .6s;transition:transform .6s,-webkit-transform .6s}.mfui-9-chips-dropdown__arrow_open{-webkit-transform:rotate(-180deg);transform:rotate(-180deg)}.mfui-9-chips-dropdown__dropdown{max-width:256px;width:-webkit-max-content;width:-moz-max-content;width:max-content}.mfui-9-chips-dropdown__list-item{display:-webkit-box;display:-ms-flexbox;display:flex}.mfui-9-chips-dropdown__icon{display:block;margin-right:16px;max-height:24px;min-width:24px;width:24px}.mfui-9-chips-dropdown__icon svg{display:block;height:100%;width:100%;fill:var(--content)}
|
|
@@ -1,20 +1,28 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DropdownItemsPaddingType } from '../../../../Dropdown/Dropdown';
|
|
3
|
+
import { ChipColorsType, ChipIdType, ChipsThemeType, IChipProps } from '../../Chip';
|
|
3
4
|
import './ChipsDropdown.scss';
|
|
4
5
|
export interface IChipsDropdownProps {
|
|
5
|
-
moreTitle: string;
|
|
6
|
-
value?: ChipIdType;
|
|
7
6
|
items: IChipProps[];
|
|
8
7
|
color: ChipColorsType;
|
|
9
|
-
|
|
8
|
+
theme: ChipsThemeType;
|
|
9
|
+
moreTitle: string;
|
|
10
|
+
short: boolean;
|
|
11
|
+
value?: ChipIdType;
|
|
12
|
+
paddings?: DropdownItemsPaddingType;
|
|
10
13
|
classes?: {
|
|
11
14
|
root?: string;
|
|
15
|
+
popup?: string;
|
|
12
16
|
list?: string;
|
|
17
|
+
item?: string;
|
|
13
18
|
};
|
|
14
19
|
dataAttrs?: {
|
|
15
20
|
root?: Record<string, string>;
|
|
21
|
+
popup?: Record<string, string>;
|
|
16
22
|
list?: Record<string, string>;
|
|
23
|
+
item?: Record<string, string>;
|
|
17
24
|
};
|
|
25
|
+
onClick: (e: React.SyntheticEvent<EventTarget>, id: ChipIdType) => void;
|
|
18
26
|
}
|
|
19
27
|
declare const ChipsDropdown: React.FC<IChipsDropdownProps>;
|
|
20
28
|
export default ChipsDropdown;
|
|
@@ -5,25 +5,42 @@ import "core-js/modules/es.array.map.js";
|
|
|
5
5
|
import "core-js/modules/es.object.to-string.js";
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
8
|
+
import Dropdown from "../../../../Dropdown/Dropdown";
|
|
8
9
|
import Chip from "../../Chip";
|
|
9
10
|
import "./ChipsDropdown.css";
|
|
10
11
|
var cn = cnCreate('mfui-9-chips-dropdown');
|
|
11
12
|
var ChipsDropdown = function ChipsDropdown(_ref) {
|
|
12
|
-
var
|
|
13
|
-
moreTitle = _ref.moreTitle,
|
|
14
|
-
_ref$items = _ref.items,
|
|
13
|
+
var _ref$items = _ref.items,
|
|
15
14
|
items = _ref$items === void 0 ? [] : _ref$items,
|
|
15
|
+
color = _ref.color,
|
|
16
|
+
theme = _ref.theme,
|
|
17
|
+
moreTitle = _ref.moreTitle,
|
|
18
|
+
_short = _ref["short"],
|
|
16
19
|
value = _ref.value,
|
|
17
|
-
|
|
20
|
+
paddings = _ref.paddings,
|
|
18
21
|
_ref$classes = _ref.classes,
|
|
19
22
|
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
20
|
-
dataAttrs = _ref.dataAttrs
|
|
23
|
+
dataAttrs = _ref.dataAttrs,
|
|
24
|
+
onClick = _ref.onClick;
|
|
25
|
+
var _a;
|
|
21
26
|
var _React$useState = React.useState(false),
|
|
22
27
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
23
28
|
isDropdownOpen = _React$useState2[0],
|
|
24
29
|
setIsDropdownOpen = _React$useState2[1];
|
|
25
30
|
var dropdownRef = React.useRef(null);
|
|
26
|
-
var
|
|
31
|
+
var dropdownItems = items.map(function (item) {
|
|
32
|
+
var _a, _b, _c, _d;
|
|
33
|
+
return {
|
|
34
|
+
title: item.title || '',
|
|
35
|
+
value: item.id,
|
|
36
|
+
view: /*#__PURE__*/React.createElement("div", _extends({
|
|
37
|
+
className: cn('list-item', [item.className, (_a = item.classes) === null || _a === void 0 ? void 0 : _a.root])
|
|
38
|
+
}, filterDataAttrs((_b = item === null || item === void 0 ? void 0 : item.dataAttrs) === null || _b === void 0 ? void 0 : _b.root)), !!item.icon && /*#__PURE__*/React.createElement("span", _extends({
|
|
39
|
+
className: cn('icon', [(_c = item.classes) === null || _c === void 0 ? void 0 : _c.icon])
|
|
40
|
+
}, filterDataAttrs((_d = item === null || item === void 0 ? void 0 : item.dataAttrs) === null || _d === void 0 ? void 0 : _d.icon)), item.icon), item.children || item.title || ''),
|
|
41
|
+
paddings: paddings
|
|
42
|
+
};
|
|
43
|
+
});
|
|
27
44
|
var currentItem = React.useMemo(function () {
|
|
28
45
|
return items.find(function (item) {
|
|
29
46
|
return item.id === value;
|
|
@@ -32,61 +49,52 @@ var ChipsDropdown = function ChipsDropdown(_ref) {
|
|
|
32
49
|
children: moreTitle
|
|
33
50
|
};
|
|
34
51
|
}, [items, value, moreTitle]);
|
|
35
|
-
var handleOutsideClick = React.useCallback(function (event) {
|
|
36
|
-
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
37
|
-
setIsDropdownOpen(false);
|
|
38
|
-
}
|
|
39
|
-
}, []);
|
|
40
52
|
var handleOpenItemList = function handleOpenItemList() {
|
|
41
53
|
setIsDropdownOpen(true);
|
|
42
|
-
document.addEventListener('mousedown', handleOutsideClick);
|
|
43
54
|
};
|
|
44
|
-
var
|
|
55
|
+
var handleDropdownItemClick = React.useCallback(function (index) {
|
|
45
56
|
return function (e) {
|
|
46
57
|
e.persist();
|
|
47
58
|
setIsDropdownOpen(false);
|
|
48
|
-
onClick(e,
|
|
59
|
+
onClick(e, items[index].id);
|
|
49
60
|
};
|
|
50
|
-
}, [onClick]);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
}, [handleOutsideClick, isDropdownOpen]);
|
|
56
|
-
React.useEffect(function () {
|
|
57
|
-
return function () {
|
|
58
|
-
return document.removeEventListener('mousedown', handleOutsideClick);
|
|
59
|
-
};
|
|
60
|
-
}, [handleOutsideClick]);
|
|
61
|
+
}, [items, onClick]);
|
|
62
|
+
var handleDropdownClose = function handleDropdownClose() {
|
|
63
|
+
setIsDropdownOpen(false);
|
|
64
|
+
};
|
|
61
65
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
62
66
|
className: cn([classes.root]),
|
|
63
67
|
ref: dropdownRef
|
|
64
68
|
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement(Chip, _extends({}, currentItem, {
|
|
65
69
|
className: cn('button', [currentItem.className]),
|
|
70
|
+
classes: _extends(_extends({}, currentItem.classes), {
|
|
71
|
+
arrow: cn('arrow', {
|
|
72
|
+
open: isDropdownOpen
|
|
73
|
+
}, [(_a = currentItem.classes) === null || _a === void 0 ? void 0 : _a.arrow])
|
|
74
|
+
}),
|
|
66
75
|
color: color,
|
|
76
|
+
theme: theme,
|
|
67
77
|
checked: !!currentItem.id,
|
|
68
|
-
arrow:
|
|
78
|
+
arrow: "down",
|
|
69
79
|
onClick: handleOpenItemList
|
|
70
|
-
})),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
}, icon), children || title);
|
|
90
|
-
}))));
|
|
80
|
+
})), /*#__PURE__*/React.createElement(Dropdown, {
|
|
81
|
+
items: dropdownItems,
|
|
82
|
+
value: value,
|
|
83
|
+
isOpen: isDropdownOpen,
|
|
84
|
+
targetRef: dropdownRef,
|
|
85
|
+
"short": _short,
|
|
86
|
+
onItemClick: handleDropdownItemClick,
|
|
87
|
+
onClose: handleDropdownClose,
|
|
88
|
+
classes: {
|
|
89
|
+
root: cn('dropdown', [classes.popup]),
|
|
90
|
+
list: classes.list,
|
|
91
|
+
item: classes.item
|
|
92
|
+
},
|
|
93
|
+
dataAttrs: {
|
|
94
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.popup,
|
|
95
|
+
list: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.list,
|
|
96
|
+
item: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.item
|
|
97
|
+
}
|
|
98
|
+
}));
|
|
91
99
|
};
|
|
92
100
|
export default ChipsDropdown;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ChipColorsType, ChipIdType, IChipProps } from '../../Chip';
|
|
2
|
+
import { ChipColorsType, ChipIdType, ChipsThemeType, IChipProps } from '../../Chip';
|
|
3
3
|
import './ChipsScrollPanel.scss';
|
|
4
4
|
export interface IChipsScrollPanelProps {
|
|
5
5
|
value?: ChipIdType;
|
|
6
6
|
items: IChipProps[];
|
|
7
7
|
color: ChipColorsType;
|
|
8
|
+
theme: ChipsThemeType;
|
|
8
9
|
onClick: (e: React.SyntheticEvent<EventTarget>, id?: ChipIdType) => void;
|
|
9
10
|
}
|
|
10
11
|
declare const ChipsScrollPanel: React.FC<IChipsScrollPanelProps>;
|
|
@@ -21,6 +21,7 @@ var ChipsScrollPanel = function ChipsScrollPanel(_ref) {
|
|
|
21
21
|
var value = _ref.value,
|
|
22
22
|
items = _ref.items,
|
|
23
23
|
color = _ref.color,
|
|
24
|
+
theme = _ref.theme,
|
|
24
25
|
onClick = _ref.onClick;
|
|
25
26
|
var _React$useState = React.useState(),
|
|
26
27
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -75,6 +76,7 @@ var ChipsScrollPanel = function ChipsScrollPanel(_ref) {
|
|
|
75
76
|
id: id,
|
|
76
77
|
checked: checked,
|
|
77
78
|
color: color,
|
|
79
|
+
theme: theme,
|
|
78
80
|
onClick: handleClick,
|
|
79
81
|
rootRef: checked ? checkedItemRef : null
|
|
80
82
|
}), children));
|