@broxus/react-uikit 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Article/context.js +1 -0
- package/dist/cjs/components/Card/Card.js +4 -4
- package/dist/cjs/components/Card/context.js +1 -0
- package/dist/cjs/components/ConfigProvider/index.js +1 -0
- package/dist/cjs/components/Control/Checkbox/CheckboxGroupContext.js +1 -0
- package/dist/cjs/components/Control/Radio/RadioGroupContext.js +1 -0
- package/dist/cjs/components/Flex/Flex.d.ts +2 -2
- package/dist/cjs/components/Flex/Flex.js +2 -2
- package/dist/cjs/components/Flex/context.js +1 -0
- package/dist/cjs/components/Form/context.js +1 -0
- package/dist/cjs/components/Nav/context/IdContext.js +1 -0
- package/dist/cjs/components/Nav/context/NavContext.js +1 -0
- package/dist/cjs/components/Nav/context/PathContext.js +1 -0
- package/dist/cjs/components/Nav/context/PrivateContext.js +1 -0
- package/dist/cjs/components/Section/index.js +3 -3
- package/dist/cjs/components/Text/index.js +7 -7
- package/dist/cjs/components/Tile/index.js +3 -3
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/esm/components/Article/context.js +1 -0
- package/dist/esm/components/Card/Card.js +4 -4
- package/dist/esm/components/Card/context.js +1 -0
- package/dist/esm/components/ConfigProvider/index.js +1 -0
- package/dist/esm/components/Control/Checkbox/CheckboxGroupContext.js +1 -0
- package/dist/esm/components/Control/Radio/RadioGroupContext.js +1 -0
- package/dist/esm/components/Flex/Flex.d.ts +2 -2
- package/dist/esm/components/Flex/Flex.js +2 -2
- package/dist/esm/components/Flex/context.js +1 -0
- package/dist/esm/components/Form/context.js +1 -0
- package/dist/esm/components/Nav/context/IdContext.js +1 -0
- package/dist/esm/components/Nav/context/NavContext.js +1 -0
- package/dist/esm/components/Nav/context/PathContext.js +1 -0
- package/dist/esm/components/Nav/context/PrivateContext.js +1 -0
- package/dist/esm/components/Section/index.js +3 -3
- package/dist/esm/components/Text/index.js +7 -7
- package/dist/esm/components/Tile/index.js +3 -3
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +8 -8
|
@@ -36,7 +36,7 @@ const ConfigProvider_1 = require("../../components/ConfigProvider");
|
|
|
36
36
|
const defaultElement = 'div';
|
|
37
37
|
function Card(props) {
|
|
38
38
|
const config = (0, ConfigProvider_1.useConfig)();
|
|
39
|
-
const { asBody, className, kind, colorMode = kind
|
|
39
|
+
const { asBody, className, kind, colorMode = kind && kind !== 'default'
|
|
40
40
|
// @ts-ignore
|
|
41
41
|
? config[`card${(0, js_utils_1.capitalizeFirstLetter)(kind)}ColorMode`]
|
|
42
42
|
: undefined, hoverable, prefixCls = config.prefixCls, size, ...restProps } = props;
|
|
@@ -48,11 +48,11 @@ function Card(props) {
|
|
|
48
48
|
}), [rootCls]);
|
|
49
49
|
return (React.createElement(context_1.CardContext.Provider, { value: context },
|
|
50
50
|
React.createElement(Component_1.Component, { className: (0, classnames_1.default)(rootCls, {
|
|
51
|
-
[`${rootCls}-${kind}`]: kind
|
|
52
|
-
[`${rootCls}-${size}`]: size
|
|
51
|
+
[`${rootCls}-${kind}`]: kind && ['default', 'primary', 'secondary', 'tertiary'].includes(kind),
|
|
52
|
+
[`${rootCls}-${size}`]: size && ['small', 'large'].includes(size),
|
|
53
53
|
[`${rootCls}-body`]: asBody,
|
|
54
54
|
[`${rootCls}-hover`]: hoverable,
|
|
55
|
-
[`${config.prefixCls}-${colorMode}`]: colorMode
|
|
55
|
+
[`${config.prefixCls}-${colorMode}`]: colorMode && ['dark', 'light'].includes(colorMode),
|
|
56
56
|
}, className), component: defaultElement, ...restProps })));
|
|
57
57
|
}
|
|
58
58
|
exports.Card = Card;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type PolymorphicProps } from '../../components/Component';
|
|
3
3
|
import { type BreakpointsConfig } from '../../types';
|
|
4
|
-
export type FlexAlignContent = 'stretch' | 'between' | 'around' | 'start' | '
|
|
5
|
-
export type FlexAlignItems = 'stretch' | 'start' | '
|
|
4
|
+
export type FlexAlignContent = 'stretch' | 'between' | 'around' | 'start' | 'center' | 'end';
|
|
5
|
+
export type FlexAlignItems = 'stretch' | 'start' | 'center' | 'end';
|
|
6
6
|
export type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
7
7
|
export type FlexWrap = 'wrap' | 'nowrap' | 'wrap-reverse';
|
|
8
8
|
export type FlexJustifyContent = 'start' | 'center' | 'end' | 'between' | 'around';
|
|
@@ -38,13 +38,13 @@ const alignContentMap = new Map([
|
|
|
38
38
|
['around', 'around'],
|
|
39
39
|
['between', 'between'],
|
|
40
40
|
['end', 'right'],
|
|
41
|
-
['
|
|
41
|
+
['center', 'middle'],
|
|
42
42
|
['start', 'left'],
|
|
43
43
|
['stretch', 'stretch'],
|
|
44
44
|
]);
|
|
45
45
|
const alignItemsMap = new Map([
|
|
46
46
|
['end', 'bottom'],
|
|
47
|
-
['
|
|
47
|
+
['center', 'middle'],
|
|
48
48
|
['start', 'top'],
|
|
49
49
|
['stretch', 'stretch'],
|
|
50
50
|
]);
|
|
@@ -35,11 +35,11 @@ require("./index.scss");
|
|
|
35
35
|
const defaultElement = 'section';
|
|
36
36
|
function Section(props) {
|
|
37
37
|
const config = (0, ConfigProvider_1.useConfig)();
|
|
38
|
-
const { className, prefixCls = config.prefixCls, preserveColor, size,
|
|
38
|
+
const { className, kind, prefixCls = config.prefixCls, preserveColor, size, ...restProps } = props;
|
|
39
39
|
const rootCls = React.useMemo(() => config.getRootPrefixCls(prefixCls || config.prefixCls, 'section'), [config, prefixCls]);
|
|
40
40
|
return (React.createElement(Component_1.Component, { className: (0, classnames_1.default)(rootCls, {
|
|
41
|
-
[`${rootCls}-${size}`]: size
|
|
42
|
-
[`${rootCls}-${kind}`]: kind
|
|
41
|
+
[`${rootCls}-${size}`]: size && ['xsmall', 'small', 'large', 'xlarge'].includes(size),
|
|
42
|
+
[`${rootCls}-${kind}`]: kind && ['default', 'muted', 'primary', 'secondary', 'tertiary'].includes(kind),
|
|
43
43
|
[`${prefixCls || config.prefixCls}-preserve-color`]: preserveColor,
|
|
44
44
|
}, className), component: defaultElement, ...restProps }));
|
|
45
45
|
}
|
|
@@ -45,13 +45,13 @@ function Text(props) {
|
|
|
45
45
|
: (0, utils_1.getBreakpointsConfigClasses)(prefixCls || config.prefixCls, 'column-1', column)), [column, config.prefixCls, prefixCls]);
|
|
46
46
|
return (React.createElement(Component_1.Component, { className: (0, classnames_1.default)(columnClassName, alignClassName, {
|
|
47
47
|
[`${prefixCls || config.prefixCls}-dropcap`]: dropcap,
|
|
48
|
-
[`${rootCls}-${color}`]: color
|
|
49
|
-
[`${rootCls}-${kind}`]: kind
|
|
50
|
-
[`${rootCls}-${size}`]: size
|
|
51
|
-
[`${rootCls}-${transform}`]: transform
|
|
52
|
-
[`${rootCls}-${verticalAlign}`]: verticalAlign
|
|
53
|
-
[`${rootCls}-${weight}`]: weight
|
|
54
|
-
[`${rootCls}-${wrap}`]: wrap
|
|
48
|
+
[`${rootCls}-${color}`]: color && ['muted', 'emphasis', 'primary', 'secondary', 'tertiary', 'success', 'warning', 'danger'].includes(color),
|
|
49
|
+
[`${rootCls}-${kind}`]: kind && ['meta', 'lead', 'base'].includes(kind),
|
|
50
|
+
[`${rootCls}-${size}`]: size && ['xsmall', 'small', 'large'].includes(size),
|
|
51
|
+
[`${rootCls}-${transform}`]: transform && ['capitalize', 'uppercase', 'lowercase'].includes(transform),
|
|
52
|
+
[`${rootCls}-${verticalAlign}`]: verticalAlign && ['top', 'middle', 'bottom', 'baseline'].includes(verticalAlign),
|
|
53
|
+
[`${rootCls}-${weight}`]: weight && ['thin', 'light', 'normal', 'medium', 'semibold', 'bold', 'lighter', 'bolder'].includes(weight),
|
|
54
|
+
[`${rootCls}-${wrap}`]: wrap && ['truncate', 'break', 'nowrap'].includes(wrap),
|
|
55
55
|
[`${rootCls}-decoration-none`]: decoration === 'none',
|
|
56
56
|
[`${rootCls}-italic`]: italic,
|
|
57
57
|
}, className), component: defaultElement, ...restProps }));
|
|
@@ -35,11 +35,11 @@ require("./index.scss");
|
|
|
35
35
|
const defaultElement = 'div';
|
|
36
36
|
function Tile(props) {
|
|
37
37
|
const config = (0, ConfigProvider_1.useConfig)();
|
|
38
|
-
const { className, prefixCls = config.prefixCls, preserveColor, size,
|
|
38
|
+
const { className, kind, prefixCls = config.prefixCls, preserveColor, size, ...restProps } = props;
|
|
39
39
|
const rootCls = React.useMemo(() => config.getRootPrefixCls(prefixCls || config.prefixCls, 'tile'), [config, prefixCls]);
|
|
40
40
|
return (React.createElement(Component_1.Component, { className: (0, classnames_1.default)(rootCls, {
|
|
41
|
-
[`${rootCls}-${size}`]: size
|
|
42
|
-
[`${rootCls}-${kind}`]: kind
|
|
41
|
+
[`${rootCls}-${size}`]: size && ['xsmall', 'small', 'large', 'xlarge'].includes(size),
|
|
42
|
+
[`${rootCls}-${kind}`]: kind && ['default', 'muted', 'primary', 'secondary', 'tertiary'].includes(kind),
|
|
43
43
|
[`${prefixCls || config.prefixCls}-preserve-color`]: preserveColor,
|
|
44
44
|
}, className), component: defaultElement, ...restProps }));
|
|
45
45
|
}
|