@broxus/react-uikit 0.9.2 → 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 +6 -6
|
@@ -7,7 +7,7 @@ import { useConfig } from '../../components/ConfigProvider';
|
|
|
7
7
|
const defaultElement = 'div';
|
|
8
8
|
export function Card(props) {
|
|
9
9
|
const config = useConfig();
|
|
10
|
-
const { asBody, className, kind, colorMode = kind
|
|
10
|
+
const { asBody, className, kind, colorMode = kind && kind !== 'default'
|
|
11
11
|
// @ts-ignore
|
|
12
12
|
? config[`card${capitalizeFirstLetter(kind)}ColorMode`]
|
|
13
13
|
: undefined, hoverable, prefixCls = config.prefixCls, size, ...restProps } = props;
|
|
@@ -19,11 +19,11 @@ export function Card(props) {
|
|
|
19
19
|
}), [rootCls]);
|
|
20
20
|
return (React.createElement(CardContext.Provider, { value: context },
|
|
21
21
|
React.createElement(Component, { className: classNames(rootCls, {
|
|
22
|
-
[`${rootCls}-${kind}`]: kind
|
|
23
|
-
[`${rootCls}-${size}`]: size
|
|
22
|
+
[`${rootCls}-${kind}`]: kind && ['default', 'primary', 'secondary', 'tertiary'].includes(kind),
|
|
23
|
+
[`${rootCls}-${size}`]: size && ['small', 'large'].includes(size),
|
|
24
24
|
[`${rootCls}-body`]: asBody,
|
|
25
25
|
[`${rootCls}-hover`]: hoverable,
|
|
26
|
-
[`${config.prefixCls}-${colorMode}`]: colorMode
|
|
26
|
+
[`${config.prefixCls}-${colorMode}`]: colorMode && ['dark', 'light'].includes(colorMode),
|
|
27
27
|
}, className), component: defaultElement, ...restProps })));
|
|
28
28
|
}
|
|
29
29
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -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';
|
|
@@ -9,13 +9,13 @@ const alignContentMap = new Map([
|
|
|
9
9
|
['around', 'around'],
|
|
10
10
|
['between', 'between'],
|
|
11
11
|
['end', 'right'],
|
|
12
|
-
['
|
|
12
|
+
['center', 'middle'],
|
|
13
13
|
['start', 'left'],
|
|
14
14
|
['stretch', 'stretch'],
|
|
15
15
|
]);
|
|
16
16
|
const alignItemsMap = new Map([
|
|
17
17
|
['end', 'bottom'],
|
|
18
|
-
['
|
|
18
|
+
['center', 'middle'],
|
|
19
19
|
['start', 'top'],
|
|
20
20
|
['stretch', 'stretch'],
|
|
21
21
|
]);
|
|
@@ -6,11 +6,11 @@ import './index.scss';
|
|
|
6
6
|
const defaultElement = 'section';
|
|
7
7
|
export function Section(props) {
|
|
8
8
|
const config = useConfig();
|
|
9
|
-
const { className, prefixCls = config.prefixCls, preserveColor, size,
|
|
9
|
+
const { className, kind, prefixCls = config.prefixCls, preserveColor, size, ...restProps } = props;
|
|
10
10
|
const rootCls = React.useMemo(() => config.getRootPrefixCls(prefixCls || config.prefixCls, 'section'), [config, prefixCls]);
|
|
11
11
|
return (React.createElement(Component, { className: classNames(rootCls, {
|
|
12
|
-
[`${rootCls}-${size}`]: size
|
|
13
|
-
[`${rootCls}-${kind}`]: kind
|
|
12
|
+
[`${rootCls}-${size}`]: size && ['xsmall', 'small', 'large', 'xlarge'].includes(size),
|
|
13
|
+
[`${rootCls}-${kind}`]: kind && ['default', 'muted', 'primary', 'secondary', 'tertiary'].includes(kind),
|
|
14
14
|
[`${prefixCls || config.prefixCls}-preserve-color`]: preserveColor,
|
|
15
15
|
}, className), component: defaultElement, ...restProps }));
|
|
16
16
|
}
|
|
@@ -16,13 +16,13 @@ export function Text(props) {
|
|
|
16
16
|
: getBreakpointsConfigClasses(prefixCls || config.prefixCls, 'column-1', column)), [column, config.prefixCls, prefixCls]);
|
|
17
17
|
return (React.createElement(Component, { className: classNames(columnClassName, alignClassName, {
|
|
18
18
|
[`${prefixCls || config.prefixCls}-dropcap`]: dropcap,
|
|
19
|
-
[`${rootCls}-${color}`]: color
|
|
20
|
-
[`${rootCls}-${kind}`]: kind
|
|
21
|
-
[`${rootCls}-${size}`]: size
|
|
22
|
-
[`${rootCls}-${transform}`]: transform
|
|
23
|
-
[`${rootCls}-${verticalAlign}`]: verticalAlign
|
|
24
|
-
[`${rootCls}-${weight}`]: weight
|
|
25
|
-
[`${rootCls}-${wrap}`]: wrap
|
|
19
|
+
[`${rootCls}-${color}`]: color && ['muted', 'emphasis', 'primary', 'secondary', 'tertiary', 'success', 'warning', 'danger'].includes(color),
|
|
20
|
+
[`${rootCls}-${kind}`]: kind && ['meta', 'lead', 'base'].includes(kind),
|
|
21
|
+
[`${rootCls}-${size}`]: size && ['xsmall', 'small', 'large'].includes(size),
|
|
22
|
+
[`${rootCls}-${transform}`]: transform && ['capitalize', 'uppercase', 'lowercase'].includes(transform),
|
|
23
|
+
[`${rootCls}-${verticalAlign}`]: verticalAlign && ['top', 'middle', 'bottom', 'baseline'].includes(verticalAlign),
|
|
24
|
+
[`${rootCls}-${weight}`]: weight && ['thin', 'light', 'normal', 'medium', 'semibold', 'bold', 'lighter', 'bolder'].includes(weight),
|
|
25
|
+
[`${rootCls}-${wrap}`]: wrap && ['truncate', 'break', 'nowrap'].includes(wrap),
|
|
26
26
|
[`${rootCls}-decoration-none`]: decoration === 'none',
|
|
27
27
|
[`${rootCls}-italic`]: italic,
|
|
28
28
|
}, className), component: defaultElement, ...restProps }));
|
|
@@ -6,11 +6,11 @@ import './index.scss';
|
|
|
6
6
|
const defaultElement = 'div';
|
|
7
7
|
export function Tile(props) {
|
|
8
8
|
const config = useConfig();
|
|
9
|
-
const { className, prefixCls = config.prefixCls, preserveColor, size,
|
|
9
|
+
const { className, kind, prefixCls = config.prefixCls, preserveColor, size, ...restProps } = props;
|
|
10
10
|
const rootCls = React.useMemo(() => config.getRootPrefixCls(prefixCls || config.prefixCls, 'tile'), [config, prefixCls]);
|
|
11
11
|
return (React.createElement(Component, { className: classNames(rootCls, {
|
|
12
|
-
[`${rootCls}-${size}`]: size
|
|
13
|
-
[`${rootCls}-${kind}`]: kind
|
|
12
|
+
[`${rootCls}-${size}`]: size && ['xsmall', 'small', 'large', 'xlarge'].includes(size),
|
|
13
|
+
[`${rootCls}-${kind}`]: kind && ['default', 'muted', 'primary', 'secondary', 'tertiary'].includes(kind),
|
|
14
14
|
[`${prefixCls || config.prefixCls}-preserve-color`]: preserveColor,
|
|
15
15
|
}, className), component: defaultElement, ...restProps }));
|
|
16
16
|
}
|