@meduza/ui-kit-2 0.1.1 → 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.
- package/README.md +5 -0
- package/dist/Button/Button.types.d.ts +2 -2
- package/dist/CardTitle/CardTitle.types.d.ts +5 -3
- package/dist/DocumentItemsCount/DocumentItemsCount.types.d.ts +3 -3
- package/dist/Image/Image.types.d.ts +5 -5
- package/dist/ImportantLead/ImportantLead.types.d.ts +1 -1
- package/dist/ListBlock/ListBlock.types.d.ts +1 -1
- package/dist/Meta/Meta.types.d.ts +3 -3
- package/dist/MetaItem/MetaItem.types.d.ts +1 -1
- package/dist/RawHtmlBlock/RawHtmlBlock.types.d.ts +10 -4
- package/dist/RenderBlocks/RenderBlocks.types.d.ts +7 -1
- package/dist/ToolbarButton/ToolbarButton.types.d.ts +1 -1
- package/dist/ui-kit-2.cjs.development.js +8 -8
- package/dist/ui-kit-2.cjs.development.js.map +1 -1
- package/dist/ui-kit-2.cjs.production.min.js +1 -1
- package/dist/ui-kit-2.cjs.production.min.js.map +1 -1
- package/dist/ui-kit-2.esm.js +8 -8
- package/dist/ui-kit-2.esm.js.map +1 -1
- package/dist/ui-kit.css +4665 -0
- package/package.json +1 -2
- package/src/Button/Button.types.ts +3 -1
- package/src/CardTitle/CardTitle.types.ts +5 -3
- package/src/CardTitle/index.tsx +3 -1
- package/src/Cover/Cover.module.css +107 -1
- package/src/Cover/Cover.stories.module.css +2 -0
- package/src/Cover/Cover.stories.tsx +3 -1
- package/src/Cover/index.tsx +3 -3
- package/src/Cover/mock.json +68 -0
- package/src/DocumentItemsCount/DocumentItemsCount.stories.module.css +2 -0
- package/src/DocumentItemsCount/DocumentItemsCount.stories.tsx +6 -1
- package/src/DocumentItemsCount/DocumentItemsCount.types.ts +3 -3
- package/src/GroupedBlock/GroupedBlock.stories.tsx +3 -1
- package/src/GroupedBlock/mock.json +110 -0
- package/src/HalfBlock/HalfBlock.stories.module.css +2 -1
- package/src/HalfBlock/HalfBlock.stories.tsx +3 -1
- package/src/HalfBlock/mock.json +81 -0
- package/src/Image/Image.types.ts +5 -5
- package/src/ImportantLead/ImportantLead.stories.tsx +3 -1
- package/src/ImportantLead/ImportantLead.types.ts +1 -1
- package/src/ImportantLead/mock.json +47 -0
- package/src/ListBlock/ListBlock.stories.module.css +4 -0
- package/src/ListBlock/ListBlock.stories.tsx +5 -1
- package/src/ListBlock/ListBlock.types.ts +2 -2
- package/src/ListBlock/mock.json +24 -0
- package/src/Meta/Meta.types.ts +3 -3
- package/src/MetaItem/MetaItem.types.ts +1 -1
- package/src/RawHtmlBlock/RawHtmlBlock.types.ts +12 -4
- package/src/RelatedBlock/RelatedBlock.stories.tsx +3 -1
- package/src/RelatedBlock/RelatedBlock.types.ts +1 -1
- package/src/RelatedBlock/mock.json +21 -0
- package/src/RenderBlocks/RenderBlocks.types.ts +8 -1
- package/src/RichTitle/RichTitle.stories.tsx +3 -1
- package/src/RichTitle/mock.json +7 -0
- package/src/SimpleBlock/SimpleBlock.stories.tsx +9 -1
- package/src/SimpleBlock/mock.json +68 -0
- package/src/SimpleTitle/SimpleTitle.stories.tsx +3 -1
- package/src/SimpleTitle/mock.json +7 -0
- package/src/ToolbarButton/ToolbarButton.types.ts +1 -1
- package/dist/ui-kit-2.cjs.development.css +0 -36
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
|
-
|
|
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,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface DocumentItemsCountProps {
|
|
3
|
-
type:
|
|
4
|
-
lang?:
|
|
3
|
+
type: 'podcast' | 'card';
|
|
4
|
+
lang?: 'ru' | 'en';
|
|
5
5
|
items: number;
|
|
6
|
-
children
|
|
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
|
|
11
|
+
original?: string;
|
|
12
12
|
w325: OptimizedImageItem;
|
|
13
|
-
w520
|
|
14
|
-
w650
|
|
15
|
-
w980
|
|
16
|
-
w1335
|
|
13
|
+
w520?: OptimizedImageItem;
|
|
14
|
+
w650?: OptimizedImageItem;
|
|
15
|
+
w980?: OptimizedImageItem;
|
|
16
|
+
w1335?: OptimizedImageItem;
|
|
17
17
|
};
|
|
18
18
|
width?: number;
|
|
19
19
|
height?: number;
|
|
@@ -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';
|
|
@@ -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
|
|
5
|
-
isListened
|
|
6
|
-
isInBookmarks
|
|
10
|
+
isRead?: boolean | undefined;
|
|
11
|
+
isListened?: boolean | undefined;
|
|
12
|
+
isInBookmarks?: boolean | undefined;
|
|
7
13
|
bookmarkAction?: (service: string, place: string) => void;
|
|
8
|
-
lightBox?:
|
|
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?:
|
|
14
|
+
lightBox?: lightBox | null;
|
|
9
15
|
lang?: 'ru' | 'en';
|
|
10
16
|
}
|
|
@@ -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
|
|
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
|
|