@meduza/ui-kit-2 0.2.21 → 0.2.23

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.
@@ -1,5 +1,5 @@
1
1
  export declare type SvgSymbolStyleContexts = 'isInFeature' | 'isInCard' | 'isInTopicBlockItem' | 'isInPageStatic' | 'isInMaterialMeta' | 'isInToolbar' | 'isInEpisodeBlock' | 'isInAudioPlayer' | 'isInAudioPanel' | 'isInPlaylist' | 'PodcastMaterial' | 'isInHeader' | 'isInProfile' | 'isInBookmark';
2
- export declare type Icons = 'meduzaLogo' | 'meduzaSymbol' | 'menu' | 'fb' | 'tw' | 'vk' | 'ok' | 'tg' | 'chat' | 'backward' | 'forward' | 'download' | 'play' | 'pause' | 'speedHalf' | 'speedOne' | 'speedOneHalf' | 'speedTwo' | 'podcastBookmark' | 'reaction' | 'cross' | 'link' | 'search' | 'card' | 'podcast' | 'arrow' | 'brent' | 'user' | 'bookmark' | 'receipt' | 'read' | 'listened';
2
+ export declare type Icons = 'meduzaLogo' | 'meduzaSymbol' | 'menu' | 'fb' | 'tw' | 'vk' | 'ok' | 'tg' | 'chat' | 'backward' | 'forward' | 'download' | 'play' | 'pause' | 'shareBookmark' | 'speedHalf' | 'speedOne' | 'speedOneHalf' | 'speedTwo' | 'podcastBookmark' | 'reaction' | 'cross' | 'link' | 'search' | 'card' | 'podcast' | 'arrow' | 'brent' | 'user' | 'bookmark' | 'receipt' | 'read' | 'listened';
3
3
  export declare type Sizes = 'small' | 'normal' | 'medium' | 'large' | 'unset';
4
4
  export interface SvgSymbolProps {
5
5
  styleContext?: SvgSymbolStyleContexts;
@@ -139,6 +139,11 @@ export declare const icons: {
139
139
  height: number;
140
140
  content: string;
141
141
  };
142
+ shareBookmark: {
143
+ width: number;
144
+ height: number;
145
+ content: string;
146
+ };
142
147
  receipt: {
143
148
  width: number;
144
149
  height: number;
@@ -3,6 +3,8 @@ export declare type ToolbarButtonTypes = 'vk' | 'fb' | 'tw' | 'tg' | 'ok' | 'rea
3
3
  export interface ToolbarButtonProps {
4
4
  type: ToolbarButtonTypes;
5
5
  theme?: string;
6
+ lang: 'ru' | 'en';
7
+ icon?: 'shareBookmark';
6
8
  isActive?: boolean;
7
9
  onClick: (type: string) => void;
8
10
  children?: React.ReactNode | JSX.Element[] | JSX.Element;
@@ -20,3 +20,22 @@ export declare const imageConditionalKeys: {
20
20
  default: number[];
21
21
  narrow: number[];
22
22
  };
23
+ export declare const SocialLabels: {
24
+ ru: {
25
+ tg: string;
26
+ fb: string;
27
+ vk: string;
28
+ ok: string;
29
+ tw: string;
30
+ bookmark: string;
31
+ reaction: string;
32
+ };
33
+ en: {
34
+ tg: string;
35
+ fb: string;
36
+ vk: string;
37
+ ok: string;
38
+ tw: string;
39
+ bookmark: string;
40
+ };
41
+ };
@@ -221,6 +221,11 @@ var icons = {
221
221
  height: 21,
222
222
  content: '<path d="M16 20l-7.5-6.333L1 20V1h15z" stroke="currentColor" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"/>'
223
223
  },
224
+ shareBookmark: {
225
+ width: 8,
226
+ height: 11,
227
+ content: '<path clip-rule="evenodd" d="M7 10 4 7l-3 3V1h6v9Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>'
228
+ },
224
229
  receipt: {
225
230
  width: 10,
226
231
  height: 13,
@@ -238,7 +243,7 @@ var icons = {
238
243
  }
239
244
  };
240
245
 
241
- var styles$1 = {"root":"SvgSymbol-module_root__2CsRW","small":"SvgSymbol-module_small__2g6oR","normal":"SvgSymbol-module_normal__9lFn1","medium":"SvgSymbol-module_medium__2eF5L","large":"SvgSymbol-module_large__2kQrt","adaptive":"SvgSymbol-module_adaptive__3_68T","fb":"SvgSymbol-module_fb__1whmw","vk":"SvgSymbol-module_vk__3VEuu","ok":"SvgSymbol-module_ok__2_1Qb","tw":"SvgSymbol-module_tw__2VRG5","tg":"SvgSymbol-module_tg__2xe2f","reaction":"SvgSymbol-module_reaction__rrJvf","card":"SvgSymbol-module_card__1XAqw","podcast":"SvgSymbol-module_podcast__3oPoo","read":"SvgSymbol-module_read__2V82i","listened":"SvgSymbol-module_listened__1oMFV","menu":"SvgSymbol-module_menu__2iYFt","cross":"SvgSymbol-module_cross__J2lCN","isInFeature":"SvgSymbol-module_isInFeature__cDeTI","isInCard":"SvgSymbol-module_isInCard__pKq4e","isInTopicBlockItem":"SvgSymbol-module_isInTopicBlockItem__3Te91","isInPageStatic":"SvgSymbol-module_isInPageStatic__H31Rd","isInMaterialMeta":"SvgSymbol-module_isInMaterialMeta__2IbAw","isInAudioPlayer":"SvgSymbol-module_isInAudioPlayer__2xlzW","isInEpisodeBlock":"SvgSymbol-module_isInEpisodeBlock__2vY3o","isInButtonPlaybackRate":"SvgSymbol-module_isInButtonPlaybackRate__1L3TW","isInButtonBackward":"SvgSymbol-module_isInButtonBackward__1Grf9","isInButtonForward":"SvgSymbol-module_isInButtonForward__D1AFL","isInToolbar":"SvgSymbol-module_isInToolbar__3SaIh","play":"SvgSymbol-module_play__pM-qY","meduzaLogo":"SvgSymbol-module_meduzaLogo__2Ouzp","arrow":"SvgSymbol-module_arrow__11naX","oil":"SvgSymbol-module_oil__hvHE5","search":"SvgSymbol-module_search__VK6p3","user":"SvgSymbol-module_user__1MGim","bookmark":"SvgSymbol-module_bookmark__2z7tX","receipt":"SvgSymbol-module_receipt__3Eqow","isInHeader":"SvgSymbol-module_isInHeader__1QHjL"};
246
+ var styles$1 = {"root":"SvgSymbol-module_root__2CsRW","small":"SvgSymbol-module_small__2g6oR","normal":"SvgSymbol-module_normal__9lFn1","medium":"SvgSymbol-module_medium__2eF5L","large":"SvgSymbol-module_large__2kQrt","adaptive":"SvgSymbol-module_adaptive__3_68T","fb":"SvgSymbol-module_fb__1whmw","vk":"SvgSymbol-module_vk__3VEuu","ok":"SvgSymbol-module_ok__2_1Qb","tw":"SvgSymbol-module_tw__2VRG5","tg":"SvgSymbol-module_tg__2xe2f","reaction":"SvgSymbol-module_reaction__rrJvf","card":"SvgSymbol-module_card__1XAqw","podcast":"SvgSymbol-module_podcast__3oPoo","read":"SvgSymbol-module_read__2V82i","listened":"SvgSymbol-module_listened__1oMFV","menu":"SvgSymbol-module_menu__2iYFt","cross":"SvgSymbol-module_cross__J2lCN","isInFeature":"SvgSymbol-module_isInFeature__cDeTI","isInCard":"SvgSymbol-module_isInCard__pKq4e","isInTopicBlockItem":"SvgSymbol-module_isInTopicBlockItem__3Te91","isInPageStatic":"SvgSymbol-module_isInPageStatic__H31Rd","isInMaterialMeta":"SvgSymbol-module_isInMaterialMeta__2IbAw","isInAudioPlayer":"SvgSymbol-module_isInAudioPlayer__2xlzW","isInEpisodeBlock":"SvgSymbol-module_isInEpisodeBlock__2vY3o","isInButtonPlaybackRate":"SvgSymbol-module_isInButtonPlaybackRate__1L3TW","isInButtonBackward":"SvgSymbol-module_isInButtonBackward__1Grf9","isInButtonForward":"SvgSymbol-module_isInButtonForward__D1AFL","isInToolbar":"SvgSymbol-module_isInToolbar__3SaIh","play":"SvgSymbol-module_play__pM-qY","meduzaLogo":"SvgSymbol-module_meduzaLogo__2Ouzp","arrow":"SvgSymbol-module_arrow__11naX","oil":"SvgSymbol-module_oil__hvHE5","search":"SvgSymbol-module_search__VK6p3","user":"SvgSymbol-module_user__1MGim","bookmark":"SvgSymbol-module_bookmark__2z7tX","shareBookmark":"SvgSymbol-module_shareBookmark__QEJOS","receipt":"SvgSymbol-module_receipt__3Eqow","isInHeader":"SvgSymbol-module_isInHeader__1QHjL"};
242
247
 
243
248
  var SvgSymbol = function SvgSymbol(_ref) {
244
249
  var icon = _ref.icon,
@@ -374,6 +379,25 @@ var imageConditionalKeys = {
374
379
  "default": [650, 520, 325],
375
380
  narrow: [600, 325]
376
381
  };
382
+ var SocialLabels = {
383
+ ru: {
384
+ tg: 'Telegram',
385
+ fb: 'Фб',
386
+ vk: 'Вк',
387
+ ok: 'Ок',
388
+ tw: 'Твиттер',
389
+ bookmark: 'В закладки',
390
+ reaction: 'Напишите нам'
391
+ },
392
+ en: {
393
+ tg: 'Telegram',
394
+ fb: 'Fb',
395
+ vk: 'Vk',
396
+ ok: 'Ok',
397
+ tw: 'Twitter',
398
+ bookmark: 'Add to bookmarks'
399
+ }
400
+ };
377
401
 
378
402
  var toCamel = function toCamel(s) {
379
403
  return s.replace(/([_][a-z])/gi, function (str) {
@@ -2752,15 +2776,19 @@ var RawHtmlBlock = function RawHtmlBlock(_ref) {
2752
2776
  }
2753
2777
  };
2754
2778
 
2755
- var styles$E = {"root":"ToolbarButton-module_root__xN-fq","isDark":"ToolbarButton-module_isDark__2q5U7","dark":"ToolbarButton-module_dark__GrIOr","bookmark":"ToolbarButton-module_bookmark__3369b","isActive":"ToolbarButton-module_isActive__3NLAE","text":"ToolbarButton-module_text__32m6s"};
2779
+ var styles$E = {"root":"ToolbarButton-module_root__xN-fq","isDark":"ToolbarButton-module_isDark__2q5U7","dark":"ToolbarButton-module_dark__GrIOr","bookmark":"ToolbarButton-module_bookmark__3369b","isActive":"ToolbarButton-module_isActive__3NLAE","icon":"ToolbarButton-module_icon__4wCid","text":"ToolbarButton-module_text__32m6s","counter":"ToolbarButton-module_counter__2NOtu"};
2756
2780
 
2757
2781
  var ToolbarButton = function ToolbarButton(_ref) {
2758
2782
  var children = _ref.children,
2759
2783
  type = _ref.type,
2760
2784
  theme = _ref.theme,
2761
2785
  isActive = _ref.isActive,
2786
+ _ref$lang = _ref.lang,
2787
+ lang = _ref$lang === void 0 ? 'ru' : _ref$lang,
2788
+ icon = _ref.icon,
2762
2789
  _onClick = _ref.onClick;
2763
2790
  var classNames = [[styles$E.root, true], [styles$E[type], !!styles$E[type]], [styles$E[theme], !!styles$E[theme] && !!theme], [styles$E.isActive, !!isActive]];
2791
+ var label = SocialLabels[lang][type];
2764
2792
  return React__default.createElement("li", {
2765
2793
  className: toolbarStyles.item
2766
2794
  }, React__default.createElement("button", {
@@ -2770,13 +2798,17 @@ var ToolbarButton = function ToolbarButton(_ref) {
2770
2798
  onClick: function onClick() {
2771
2799
  return _onClick(type);
2772
2800
  }
2801
+ }, icon && React__default.createElement("div", {
2802
+ className: styles$E.icon
2773
2803
  }, React__default.createElement(SvgSymbol, {
2774
2804
  size: "medium",
2775
- icon: type,
2805
+ icon: icon,
2776
2806
  styleContext: "isInToolbar"
2777
- }), children && React__default.createElement("span", {
2807
+ })), React__default.createElement("span", {
2778
2808
  className: styles$E.text
2779
- }, children)));
2809
+ }, label), children && React__default.createElement("span", {
2810
+ className: styles$E.counter
2811
+ }, " ", children)));
2780
2812
  };
2781
2813
 
2782
2814
  exports.AnnouncementInText = AnnouncementInText;