@meduza/ui-kit-2 0.1.2 → 0.1.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.
Files changed (58) hide show
  1. package/README.md +5 -0
  2. package/dist/Button/Button.types.d.ts +2 -2
  3. package/dist/CardTitle/CardTitle.types.d.ts +5 -3
  4. package/dist/DocumentItemsCount/DocumentItemsCount.types.d.ts +3 -3
  5. package/dist/Image/Image.types.d.ts +5 -5
  6. package/dist/ImportantLead/ImportantLead.types.d.ts +1 -1
  7. package/dist/ListBlock/ListBlock.types.d.ts +1 -1
  8. package/dist/Meta/Meta.types.d.ts +3 -3
  9. package/dist/MetaItem/MetaItem.types.d.ts +1 -1
  10. package/dist/RawHtmlBlock/RawHtmlBlock.types.d.ts +10 -4
  11. package/dist/RenderBlocks/RenderBlocks.types.d.ts +7 -1
  12. package/dist/ToolbarButton/ToolbarButton.types.d.ts +1 -1
  13. package/dist/ui-kit-2.cjs.development.js +8 -8
  14. package/dist/ui-kit-2.cjs.development.js.map +1 -1
  15. package/dist/ui-kit-2.cjs.production.min.js +1 -1
  16. package/dist/ui-kit-2.cjs.production.min.js.map +1 -1
  17. package/dist/ui-kit-2.esm.js +8 -8
  18. package/dist/ui-kit-2.esm.js.map +1 -1
  19. package/dist/ui-kit.css +786 -685
  20. package/package.json +1 -1
  21. package/src/Button/Button.types.ts +3 -1
  22. package/src/CardTitle/CardTitle.types.ts +5 -3
  23. package/src/CardTitle/index.tsx +3 -1
  24. package/src/Cover/Cover.module.css +107 -1
  25. package/src/Cover/Cover.stories.module.css +2 -0
  26. package/src/Cover/Cover.stories.tsx +3 -1
  27. package/src/Cover/index.tsx +3 -3
  28. package/src/Cover/mock.json +68 -0
  29. package/src/DocumentItemsCount/DocumentItemsCount.stories.module.css +2 -0
  30. package/src/DocumentItemsCount/DocumentItemsCount.stories.tsx +6 -1
  31. package/src/DocumentItemsCount/DocumentItemsCount.types.ts +3 -3
  32. package/src/GroupedBlock/GroupedBlock.stories.tsx +3 -1
  33. package/src/GroupedBlock/mock.json +110 -0
  34. package/src/HalfBlock/HalfBlock.stories.module.css +2 -1
  35. package/src/HalfBlock/HalfBlock.stories.tsx +3 -1
  36. package/src/HalfBlock/mock.json +81 -0
  37. package/src/Image/Image.types.ts +5 -5
  38. package/src/ImportantLead/ImportantLead.stories.tsx +3 -1
  39. package/src/ImportantLead/ImportantLead.types.ts +1 -1
  40. package/src/ImportantLead/mock.json +47 -0
  41. package/src/ListBlock/ListBlock.stories.module.css +4 -0
  42. package/src/ListBlock/ListBlock.stories.tsx +5 -1
  43. package/src/ListBlock/ListBlock.types.ts +2 -2
  44. package/src/ListBlock/mock.json +24 -0
  45. package/src/Meta/Meta.types.ts +3 -3
  46. package/src/MetaItem/MetaItem.types.ts +1 -1
  47. package/src/RawHtmlBlock/RawHtmlBlock.types.ts +12 -4
  48. package/src/RelatedBlock/RelatedBlock.stories.tsx +3 -1
  49. package/src/RelatedBlock/RelatedBlock.types.ts +1 -1
  50. package/src/RelatedBlock/mock.json +21 -0
  51. package/src/RenderBlocks/RenderBlocks.types.ts +8 -1
  52. package/src/RichTitle/RichTitle.stories.tsx +3 -1
  53. package/src/RichTitle/mock.json +7 -0
  54. package/src/SimpleBlock/SimpleBlock.stories.tsx +9 -1
  55. package/src/SimpleBlock/mock.json +68 -0
  56. package/src/SimpleTitle/SimpleTitle.stories.tsx +3 -1
  57. package/src/SimpleTitle/mock.json +7 -0
  58. package/src/ToolbarButton/ToolbarButton.types.ts +1 -1
package/README.md CHANGED
@@ -9,3 +9,8 @@
9
9
 
10
10
  `yarn generate` - генератор компонентов. Вводим название компонента, получаем все файлы и импорты
11
11
 
12
+ ## Использование
13
+
14
+ Необходимо глобально импортировать в проект файл ui-kit.css (туда собираются все модули)
15
+ Любые компоненты просто импортятся из кита
16
+
@@ -1,4 +1,4 @@
1
- /// <reference types="react" />
1
+ import React from 'react';
2
2
  export declare type ButtonThemes = 'sand' | 'gold' | 'light' | 'gray' | 'ghost' | 'dark' | 'black' | 'red';
3
3
  export declare type ButtonStates = 'isLoading' | 'isDefault';
4
4
  export declare type ButtonSizes = 'auto' | 'default';
@@ -10,5 +10,5 @@ export interface ButtonProps {
10
10
  styleContext?: ButtonStyleContexts;
11
11
  disabled?: boolean;
12
12
  onClick?: () => void;
13
- children: JSX.Element[] | JSX.Element;
13
+ children: React.ReactNode | JSX.Element[] | JSX.Element;
14
14
  }
@@ -1,8 +1,10 @@
1
1
  export interface CardTitleProps {
2
2
  block: {
3
- index: number;
4
- text: string;
5
- only_on?: string;
3
+ data: {
4
+ index: number;
5
+ text: string;
6
+ only_on?: string;
7
+ };
6
8
  };
7
9
  styleContext?: string;
8
10
  }
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  export interface DocumentItemsCountProps {
3
- type: string;
4
- lang?: string;
3
+ type: 'podcast' | 'card';
4
+ lang?: 'ru' | 'en';
5
5
  items: number;
6
- children: JSX.Element[] | JSX.Element;
6
+ children?: JSX.Element[] | JSX.Element;
7
7
  }
@@ -8,12 +8,12 @@ export interface ImageProps {
8
8
  alt?: string;
9
9
  display?: string;
10
10
  optimized?: {
11
- original: string;
11
+ original?: string;
12
12
  w325: OptimizedImageItem;
13
- w520: OptimizedImageItem;
14
- w650: OptimizedImageItem;
15
- w980: OptimizedImageItem;
16
- w1335: OptimizedImageItem;
13
+ w520?: OptimizedImageItem;
14
+ w650?: OptimizedImageItem;
15
+ w980?: OptimizedImageItem;
16
+ w1335?: OptimizedImageItem;
17
17
  };
18
18
  width?: number;
19
19
  height?: number;
@@ -1,4 +1,4 @@
1
1
  export interface ImportantLeadProps {
2
2
  block: any;
3
- styleContext: string[] | string;
3
+ styleContext?: string[] | string;
4
4
  }
@@ -1,4 +1,4 @@
1
1
  export interface ListBlockProps {
2
2
  block: any;
3
- styleContext: string[] | string;
3
+ styleContext?: string[] | string;
4
4
  }
@@ -2,9 +2,9 @@ import React from 'react';
2
2
  export interface MetaContainerProps {
3
3
  block: any;
4
4
  styleContext: string[] | string;
5
- isRead: boolean;
6
- isListened: boolean;
7
- isInBookmarks: boolean;
5
+ isRead: boolean | undefined;
6
+ isListened: boolean | undefined;
7
+ isInBookmarks: boolean | undefined;
8
8
  bookmarkAction?: (service: string, place: string) => void;
9
9
  lightBox?: () => void;
10
10
  lang: 'ru' | 'en';
@@ -3,5 +3,5 @@ export interface MetaItemProps {
3
3
  bullets?: boolean;
4
4
  hasSource?: boolean;
5
5
  type?: string;
6
- children: JSX.Element[] | JSX.Element;
6
+ children: React.ReactNode | JSX.Element[] | JSX.Element;
7
7
  }
@@ -1,9 +1,15 @@
1
+ import { ImageProps } from '../Image/Image.types';
2
+ export declare type lightBox = {
3
+ show: (image?: ImageProps['optimized'], alt?: ImageProps['alt']) => void;
4
+ hide: () => void;
5
+ visible: boolean;
6
+ };
1
7
  export interface RawHtmlBlockProps {
2
8
  block: any;
3
9
  styleContext: string[] | string;
4
- isRead: boolean;
5
- isListened: boolean;
6
- isInBookmarks: boolean;
10
+ isRead?: boolean | undefined;
11
+ isListened?: boolean | undefined;
12
+ isInBookmarks?: boolean | undefined;
7
13
  bookmarkAction?: (service: string, place: string) => void;
8
- lightBox?: () => void;
14
+ lightBox?: lightBox | null;
9
15
  }
@@ -1,3 +1,9 @@
1
+ import { ImageProps } from '../Image/Image.types';
2
+ export declare type lightBox = {
3
+ show: (image?: ImageProps['optimized'], alt?: ImageProps['alt']) => void;
4
+ hide: () => void;
5
+ visible: boolean;
6
+ };
1
7
  export interface RenderBlocksProps {
2
8
  block: any;
3
9
  styleContext?: any;
@@ -5,6 +11,6 @@ export interface RenderBlocksProps {
5
11
  isListened?: boolean;
6
12
  isInBookmarks?: boolean;
7
13
  bookmarkAction?: (service: string, place: string) => void;
8
- lightBox?: () => void;
14
+ lightBox?: lightBox | null;
9
15
  lang?: 'ru' | 'en';
10
16
  }
@@ -5,5 +5,5 @@ export interface ToolbarButtonProps {
5
5
  theme?: string;
6
6
  isActive?: boolean;
7
7
  onClick: (type: string) => void;
8
- children: React.ReactNode;
8
+ children?: React.ReactNode | JSX.Element[] | JSX.Element;
9
9
  }
@@ -1273,10 +1273,10 @@ var QuoteBlock = function QuoteBlock(_ref) {
1273
1273
  var styles$j = {"root":"CardTitle-module_root__1uqqF","index":"CardTitle-module_index__4FsTf","title":"CardTitle-module_title__2iTI6","mobile":"CardTitle-module_mobile__1_kij","desktop":"CardTitle-module_desktop__1l3_n"};
1274
1274
 
1275
1275
  var CardTitle = function CardTitle(_ref) {
1276
- var _ref$block = _ref.block,
1277
- onlyOn = _ref$block.only_on,
1278
- index = _ref$block.index,
1279
- text = _ref$block.text,
1276
+ var _ref$block$data = _ref.block.data,
1277
+ onlyOn = _ref$block$data.only_on,
1278
+ index = _ref$block$data.index,
1279
+ text = _ref$block$data.text,
1280
1280
  styleContext = _ref.styleContext;
1281
1281
  return React__default.createElement("div", {
1282
1282
  "data-testid": "card-title",
@@ -1311,7 +1311,7 @@ var generateGradient = function generateGradient(color) {
1311
1311
  return "linear-gradient(-180deg, " + gradient + ")";
1312
1312
  };
1313
1313
 
1314
- var styles$l = {"root":"Cover-module_root__18Z8J"};
1314
+ var styles$l = {"root":"Cover-module_root__18Z8J","body":"Cover-module_body__1xs8e","image":"Cover-module_image__2f3Qc","rich":"Cover-module_rich__1fAGA","dark":"Cover-module_dark__2Ac-w","light":"Cover-module_light__FUp5X","control":"Cover-module_control__VXbhi","isInDynamicBlock":"Cover-module_isInDynamicBlock__3eghb","mobile":"Cover-module_mobile__5DKa1","desktop":"Cover-module_desktop__2mrOc"};
1315
1315
 
1316
1316
  var styles$m = {"root":"SimpleTitle-module_root__2jVQN","mobile":"SimpleTitle-module_mobile__11gBz","desktop":"SimpleTitle-module_desktop__3yXgy"};
1317
1317
 
@@ -1917,15 +1917,15 @@ var Cover = function Cover(_ref) {
1917
1917
  setIsPopoverShown = _useState[1];
1918
1918
 
1919
1919
  var style = {};
1920
- var theme;
1921
- var classNames = [[styles$l.root, true], [styles$l[theme], true], [styles$l[onlyOn], !!onlyOn && !!styles$l[onlyOn]]];
1920
+ var classNames = [[styles$l.root, true], [styles$l[onlyOn], !!onlyOn && !!styles$l[onlyOn]]];
1922
1921
 
1923
1922
  if (styleContext) {
1924
1923
  classNames = makeStyleContext(classNames, styleContext, styles$l);
1925
1924
  }
1926
1925
 
1927
1926
  if (gradients) {
1928
- theme = gradients.text_rgb === '0,0,0' ? 'dark' : 'light';
1927
+ var theme = [gradients.text_rgb === '0,0,0' ? 'dark' : 'light'];
1928
+ classNames = makeStyleContext(classNames, theme, styles$l);
1929
1929
  style.backgroundImage = generateGradient(gradients.bg_rgb);
1930
1930
  }
1931
1931