@broxus/react-uikit 0.8.1 → 0.9.1
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/Meta.d.ts +1 -1
- package/dist/cjs/components/Article/Title.d.ts +1 -1
- package/dist/cjs/components/Badge/index.d.ts +1 -1
- package/dist/cjs/components/Button/Button.d.ts +4 -4
- package/dist/cjs/components/Button/Button.js +1 -1
- package/dist/cjs/components/Button/index.scss +13 -12
- package/dist/cjs/components/Card/Badge.d.ts +1 -1
- package/dist/cjs/components/Card/Body.d.ts +1 -1
- package/dist/cjs/components/Card/Footer.d.ts +1 -1
- package/dist/cjs/components/Card/Header.d.ts +1 -1
- package/dist/cjs/components/Card/Media.d.ts +1 -1
- package/dist/cjs/components/Card/Title.d.ts +1 -1
- package/dist/cjs/components/Component/index.d.ts +1 -1
- package/dist/cjs/components/Container/index.d.ts +1 -1
- package/dist/cjs/components/Control/Select/index.scss +1 -1
- package/dist/cjs/components/Drawer/index.js +2 -6
- package/dist/cjs/components/Flex/Flex.d.ts +3 -3
- package/dist/cjs/components/Flex/Flex.js +39 -5
- package/dist/cjs/components/Heading/index.d.ts +1 -1
- package/dist/cjs/components/Link/index.d.ts +1 -1
- package/dist/cjs/components/Tabs/index.scss +2 -2
- package/dist/cjs/components/Text/index.d.ts +3 -2
- package/dist/cjs/components/Text/index.js +2 -1
- package/dist/cjs/components/Text/index.scss +315 -0
- package/dist/cjs/styles/mixins.scss +39 -5
- package/dist/cjs/styles/text.scss +1 -303
- package/dist/cjs/styles/variables.scss +4 -6
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/utils/get-breakpoints-config-classes.js +1 -1
- package/dist/esm/components/Article/Meta.d.ts +1 -1
- package/dist/esm/components/Article/Title.d.ts +1 -1
- package/dist/esm/components/Badge/index.d.ts +1 -1
- package/dist/esm/components/Button/Button.d.ts +4 -4
- package/dist/esm/components/Button/Button.js +1 -1
- package/dist/esm/components/Button/index.scss +13 -12
- package/dist/esm/components/Card/Badge.d.ts +1 -1
- package/dist/esm/components/Card/Body.d.ts +1 -1
- package/dist/esm/components/Card/Footer.d.ts +1 -1
- package/dist/esm/components/Card/Header.d.ts +1 -1
- package/dist/esm/components/Card/Media.d.ts +1 -1
- package/dist/esm/components/Card/Title.d.ts +1 -1
- package/dist/esm/components/Component/index.d.ts +1 -1
- package/dist/esm/components/Container/index.d.ts +1 -1
- package/dist/esm/components/Control/Select/index.scss +1 -1
- package/dist/esm/components/Drawer/index.js +2 -6
- package/dist/esm/components/Flex/Flex.d.ts +3 -3
- package/dist/esm/components/Flex/Flex.js +39 -5
- package/dist/esm/components/Heading/index.d.ts +1 -1
- package/dist/esm/components/Link/index.d.ts +1 -1
- package/dist/esm/components/Tabs/index.scss +2 -2
- package/dist/esm/components/Text/index.d.ts +3 -2
- package/dist/esm/components/Text/index.js +2 -1
- package/dist/esm/components/Text/index.scss +315 -0
- package/dist/esm/styles/mixins.scss +39 -5
- package/dist/esm/styles/text.scss +1 -303
- package/dist/esm/styles/variables.scss +4 -6
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/utils/get-breakpoints-config-classes.js +1 -1
- package/package.json +10 -10
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getBreakpointsConfigClasses = void 0;
|
|
4
4
|
function getBreakpointsConfigClasses(prefixCls, componentCls, config = {}) {
|
|
5
|
-
return Object.entries(config).map(([key, value]) => (value ? `${prefixCls}-${componentCls}-${value}${key !== 'default' ? `@${key}` : ''}` : '')).join(' ');
|
|
5
|
+
return Object.entries(config).map(([key, value]) => (value ? `${prefixCls}-${componentCls}-${value}${key !== 'default' ? `@${key}` : ''}` : '')).join(' ').trim();
|
|
6
6
|
}
|
|
7
7
|
exports.getBreakpointsConfigClasses = getBreakpointsConfigClasses;
|
|
@@ -3,7 +3,7 @@ import { type PolymorphicProps } from '../../components/Component';
|
|
|
3
3
|
export type ArticleMetaOwnProps = {
|
|
4
4
|
prefixCls?: string;
|
|
5
5
|
};
|
|
6
|
-
export type ArticleMetaProps<E extends React.ElementType> = React.PropsWithChildren<ArticleMetaOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, ArticleMetaOwnProps>;
|
|
6
|
+
export type ArticleMetaProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<ArticleMetaOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, ArticleMetaOwnProps>;
|
|
7
7
|
declare const defaultElement = "p";
|
|
8
8
|
export declare function Meta<E extends React.ElementType = typeof defaultElement>(props: ArticleMetaProps<E>): React.JSX.Element;
|
|
9
9
|
export declare namespace Meta {
|
|
@@ -3,7 +3,7 @@ import { type PolymorphicProps } from '../../components/Component';
|
|
|
3
3
|
export type ArticleTitleOwnProps = {
|
|
4
4
|
prefixCls?: string;
|
|
5
5
|
};
|
|
6
|
-
export type ArticleTitleProps<E extends React.ElementType> = React.PropsWithChildren<ArticleTitleOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, ArticleTitleOwnProps>;
|
|
6
|
+
export type ArticleTitleProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<ArticleTitleOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, ArticleTitleOwnProps>;
|
|
7
7
|
declare const defaultElement = "h1";
|
|
8
8
|
export declare function Title<E extends React.ElementType = typeof defaultElement>(props: ArticleTitleProps<E>): React.JSX.Element;
|
|
9
9
|
export declare namespace Title {
|
|
@@ -4,7 +4,7 @@ import './index.scss';
|
|
|
4
4
|
export type BadgeOwnProps = {
|
|
5
5
|
prefixCls?: string;
|
|
6
6
|
};
|
|
7
|
-
export type BadgeProps<E extends React.ElementType> = React.PropsWithChildren<BadgeOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, BadgeOwnProps>;
|
|
7
|
+
export type BadgeProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<BadgeOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, BadgeOwnProps>;
|
|
8
8
|
declare const defaultElement = "span";
|
|
9
9
|
export declare function Badge<E extends React.ElementType = typeof defaultElement>(props: BadgeProps<E>): React.JSX.Element;
|
|
10
10
|
export declare namespace Badge {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type PolymorphicProps } from '../../components/Component';
|
|
3
|
-
export interface AnchorButtonProps extends Omit<React.AnchorHTMLAttributes<
|
|
3
|
+
export interface AnchorButtonProps extends Omit<React.AnchorHTMLAttributes<React.ElementType>, 'onClick'> {
|
|
4
4
|
href: string;
|
|
5
5
|
target?: string;
|
|
6
6
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
7
7
|
}
|
|
8
|
-
export interface NativeButtonProps extends Omit<React.ButtonHTMLAttributes<
|
|
8
|
+
export interface NativeButtonProps extends Omit<React.ButtonHTMLAttributes<React.ElementType>, 'type' | 'onClick'> {
|
|
9
9
|
htmlType?: 'button' | 'reset' | 'submit';
|
|
10
10
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
11
11
|
}
|
|
@@ -16,5 +16,5 @@ export interface ButtonOwnProps extends Partial<AnchorButtonProps>, Partial<Nati
|
|
|
16
16
|
size?: 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge';
|
|
17
17
|
type?: 'default' | 'primary' | 'secondary' | 'tertiary' | 'danger' | 'link' | 'text';
|
|
18
18
|
}
|
|
19
|
-
export type ButtonProps<E extends React.ElementType =
|
|
20
|
-
export declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps<any
|
|
19
|
+
export type ButtonProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<ButtonOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, ButtonOwnProps>;
|
|
20
|
+
export declare const Button: React.ForwardRefExoticComponent<Omit<ButtonProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<any>>;
|
|
@@ -18,7 +18,7 @@ export const Button = React.forwardRef((props, ref) => {
|
|
|
18
18
|
const rootCls = React.useMemo(() => config.getRootPrefixCls(prefixCls || config.prefixCls, 'button'), [config, prefixCls]);
|
|
19
19
|
const className = React.useMemo(() => classNames(rootCls, {
|
|
20
20
|
[`${rootCls}-${type}`]: type !== undefined,
|
|
21
|
-
[`${rootCls}-ghost`]: ghost
|
|
21
|
+
[`${rootCls}-ghost`]: ghost === true,
|
|
22
22
|
[`${rootCls}-${size}`]: size !== undefined,
|
|
23
23
|
[`${rootCls}-${shape}`]: shape !== undefined && ['circle', 'round'].includes(shape),
|
|
24
24
|
}, restProps.className), [rootCls, type, ghost, size, shape, restProps.className]);
|
|
@@ -279,21 +279,22 @@
|
|
|
279
279
|
* The same for all style modifiers
|
|
280
280
|
*/
|
|
281
281
|
|
|
282
|
-
|
|
283
|
-
.uk-button-
|
|
284
|
-
.uk-button-
|
|
285
|
-
.uk-button-
|
|
286
|
-
.uk-button-
|
|
287
|
-
.uk-button-
|
|
288
|
-
.uk-button-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
@
|
|
282
|
+
@if $button-disabled-mode == same {
|
|
283
|
+
.uk-button-default:disabled,
|
|
284
|
+
.uk-button-primary:disabled,
|
|
285
|
+
.uk-button-secondary:disabled,
|
|
286
|
+
.uk-button-tertiary:disabled,
|
|
287
|
+
.uk-button-success:disabled,
|
|
288
|
+
.uk-button-warning:disabled,
|
|
289
|
+
.uk-button-danger:disabled {
|
|
290
|
+
background-color: var(--button-disabled-background);
|
|
291
|
+
color: var(--button-disabled-color);
|
|
292
|
+
@if mixin-exists(hook-button-disabled) {
|
|
293
|
+
@include hook-button-disabled;
|
|
294
|
+
}
|
|
293
295
|
}
|
|
294
296
|
}
|
|
295
297
|
|
|
296
|
-
|
|
297
298
|
/* Size modifiers
|
|
298
299
|
========================================================================== */
|
|
299
300
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type BadgeProps } from '../../components/Badge';
|
|
3
|
-
export type CardBadgeProps<E extends React.ElementType> = BadgeProps<E>;
|
|
3
|
+
export type CardBadgeProps<E extends React.ElementType = React.ElementType> = BadgeProps<E>;
|
|
4
4
|
declare const defaultElement = "span";
|
|
5
5
|
export declare function Badge<E extends React.ElementType = typeof defaultElement>(props: CardBadgeProps<E>): React.JSX.Element;
|
|
6
6
|
export declare namespace Badge {
|
|
@@ -3,7 +3,7 @@ import { type PolymorphicProps } from '../../components/Component';
|
|
|
3
3
|
export type CardBodyOwnProps = {
|
|
4
4
|
prefixCls?: string;
|
|
5
5
|
};
|
|
6
|
-
export type CardBodyProps<E extends React.ElementType> = React.PropsWithChildren<CardBodyOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, CardBodyOwnProps>;
|
|
6
|
+
export type CardBodyProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<CardBodyOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, CardBodyOwnProps>;
|
|
7
7
|
declare const defaultElement = "div";
|
|
8
8
|
export declare function Body<E extends React.ElementType = typeof defaultElement>(props: CardBodyProps<E>): React.JSX.Element;
|
|
9
9
|
export declare namespace Body {
|
|
@@ -3,7 +3,7 @@ import { type PolymorphicProps } from '../../components/Component';
|
|
|
3
3
|
export type CardFooterOwnProps = {
|
|
4
4
|
prefixCls?: string;
|
|
5
5
|
};
|
|
6
|
-
export type CardFooterProps<E extends React.ElementType> = React.PropsWithChildren<CardFooterOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, CardFooterOwnProps>;
|
|
6
|
+
export type CardFooterProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<CardFooterOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, CardFooterOwnProps>;
|
|
7
7
|
declare const defaultElement = "footer";
|
|
8
8
|
export declare function Footer<E extends React.ElementType = typeof defaultElement>(props: CardFooterProps<E>): React.JSX.Element;
|
|
9
9
|
export declare namespace Footer {
|
|
@@ -3,7 +3,7 @@ import { type PolymorphicProps } from '../../components/Component';
|
|
|
3
3
|
export type CardHeaderOwnProps = {
|
|
4
4
|
prefixCls?: string;
|
|
5
5
|
};
|
|
6
|
-
export type CardHeaderProps<E extends React.ElementType> = React.PropsWithChildren<CardHeaderOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, CardHeaderOwnProps>;
|
|
6
|
+
export type CardHeaderProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<CardHeaderOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, CardHeaderOwnProps>;
|
|
7
7
|
declare const defaultElement = "header";
|
|
8
8
|
export declare function Header<E extends React.ElementType = typeof defaultElement>(props: CardHeaderProps<E>): React.JSX.Element;
|
|
9
9
|
export declare namespace Header {
|
|
@@ -4,7 +4,7 @@ export type CardMediaOwnProps = {
|
|
|
4
4
|
position: 'left' | 'top' | 'right' | 'bottom';
|
|
5
5
|
prefixCls?: string;
|
|
6
6
|
};
|
|
7
|
-
export type CardMediaProps<E extends React.ElementType> = React.PropsWithChildren<CardMediaOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, CardMediaOwnProps>;
|
|
7
|
+
export type CardMediaProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<CardMediaOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, CardMediaOwnProps>;
|
|
8
8
|
declare const defaultElement = "div";
|
|
9
9
|
export declare function Media<E extends React.ElementType = typeof defaultElement>(props: CardMediaProps<E>): React.JSX.Element;
|
|
10
10
|
export declare namespace Media {
|
|
@@ -3,7 +3,7 @@ import { type PolymorphicProps } from '../../components/Component';
|
|
|
3
3
|
export type CardTitleOwnProps = {
|
|
4
4
|
prefixCls?: string;
|
|
5
5
|
};
|
|
6
|
-
export type CardTitleProps<E extends React.ElementType> = React.PropsWithChildren<CardTitleOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, CardTitleOwnProps>;
|
|
6
|
+
export type CardTitleProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<CardTitleOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, CardTitleOwnProps>;
|
|
7
7
|
declare const defaultElement = "h3";
|
|
8
8
|
export declare function Title<E extends React.ElementType = typeof defaultElement>(props: CardTitleProps<E>): React.JSX.Element;
|
|
9
9
|
export declare namespace Title {
|
|
@@ -12,5 +12,5 @@ export interface PolymorphicComponent<Component extends React.ElementType = Reac
|
|
|
12
12
|
defaultProps?: Partial<any>;
|
|
13
13
|
id?: string;
|
|
14
14
|
}
|
|
15
|
-
export declare const Component: React.ForwardRefExoticComponent<Omit<ComponentOwnProp<React.ElementType<any>>, "ref"> & React.RefAttributes<unknown>>;
|
|
15
|
+
export declare const Component: React.ForwardRefExoticComponent<Omit<ComponentOwnProp<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
|
|
16
16
|
export {};
|
|
@@ -9,4 +9,4 @@ export interface ContainerOwnProps {
|
|
|
9
9
|
size?: 'xsmall' | 'small' | 'large' | 'xlarge' | 'expand';
|
|
10
10
|
}
|
|
11
11
|
export type ContainerProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<ContainerOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, ContainerOwnProps>;
|
|
12
|
-
export declare const Container: React.MemoExoticComponent<(<E extends React.ElementType<any> = "div">(props: ContainerProps<E>) => React.JSX.Element)>;
|
|
12
|
+
export declare const Container: React.MemoExoticComponent<(<E extends React.ElementType<any, keyof React.JSX.IntrinsicElements> = "div">(props: ContainerProps<E>) => React.JSX.Element)>;
|
|
@@ -8,7 +8,7 @@ import './index.scss';
|
|
|
8
8
|
const defaultPushState = { distance: 180 };
|
|
9
9
|
export const Drawer = React.forwardRef((props, ref) => {
|
|
10
10
|
const config = useConfig();
|
|
11
|
-
const { animation = 'slide', children, className,
|
|
11
|
+
const { animation = 'slide', children, className, defaultOpen, destroyOnClose, direction, getContainer = config.getPopupContainer, keyboard = true, mask = true, maskClosable = true, motion, open, placement = 'right', prefixCls = config.prefixCls, push = defaultPushState, size, rootClassName, rootStyle, trigger, onClose: onCloseCallback, ...restProps } = props;
|
|
12
12
|
const [isShown, setShown] = React.useState(defaultOpen);
|
|
13
13
|
const [internalOpen, setOpen] = React.useState(defaultOpen);
|
|
14
14
|
const mergedOpen = open === undefined ? internalOpen : open;
|
|
@@ -101,11 +101,7 @@ export const Drawer = React.forwardRef((props, ref) => {
|
|
|
101
101
|
React.useEffect(() => cleanup, [cleanup]);
|
|
102
102
|
return (React.createElement(React.Fragment, null,
|
|
103
103
|
trigger?.({ collapse, expand, isOpen: !!mergedOpen }),
|
|
104
|
-
React.createElement(RcDrawer, { className: className,
|
|
105
|
-
height: undefined,
|
|
106
|
-
width: undefined,
|
|
107
|
-
...contentWrapperStyle,
|
|
108
|
-
}, destroyOnClose: destroyOnClose, keyboard: keyboard, getContainer: getContainer, mask: mask, maskClosable: maskClosable, maskMotion: {
|
|
104
|
+
React.createElement(RcDrawer, { className: className, destroyOnClose: destroyOnClose, keyboard: keyboard, getContainer: getContainer, mask: mask, maskClosable: maskClosable, maskMotion: {
|
|
109
105
|
motionName: getMotionName(prefixCls || config.prefixCls, 'drawer-fade'),
|
|
110
106
|
}, motion: mergedMotion, open: mergedOpen, placement: placement, prefixCls: rootCls, push: push, rootClassName: drawerRootClassName, rootStyle: { ...rootStyle, display: (mergedOpen || isShown) ? 'block' : '' }, onClose: onClose, ...restProps }, children)));
|
|
111
107
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
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' | '
|
|
5
|
-
export type FlexAlignItems = 'stretch' | '
|
|
4
|
+
export type FlexAlignContent = 'stretch' | 'between' | 'around' | 'start' | 'middle' | 'end';
|
|
5
|
+
export type FlexAlignItems = 'stretch' | 'start' | 'middle' | 'end';
|
|
6
6
|
export type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
|
|
7
7
|
export type FlexWrap = 'wrap' | 'nowrap' | 'wrap-reverse';
|
|
8
|
-
export type FlexJustifyContent = '
|
|
8
|
+
export type FlexJustifyContent = 'start' | 'center' | 'end' | 'between' | 'around';
|
|
9
9
|
export type FlexBreakpoint = {
|
|
10
10
|
alignContent?: FlexAlignContent;
|
|
11
11
|
alignItems?: FlexAlignItems;
|
|
@@ -5,13 +5,47 @@ import { useConfig } from '../../components/ConfigProvider';
|
|
|
5
5
|
import { FlexContext } from '../../components/Flex/context';
|
|
6
6
|
import { getBreakpointsConfigClasses } from '../../utils';
|
|
7
7
|
const defaultElement = 'div';
|
|
8
|
+
const alignContentMap = new Map([
|
|
9
|
+
['around', 'around'],
|
|
10
|
+
['between', 'between'],
|
|
11
|
+
['end', 'right'],
|
|
12
|
+
['middle', 'middle'],
|
|
13
|
+
['start', 'left'],
|
|
14
|
+
['stretch', 'stretch'],
|
|
15
|
+
]);
|
|
16
|
+
const alignItemsMap = new Map([
|
|
17
|
+
['end', 'bottom'],
|
|
18
|
+
['middle', 'middle'],
|
|
19
|
+
['start', 'top'],
|
|
20
|
+
['stretch', 'stretch'],
|
|
21
|
+
]);
|
|
22
|
+
const justifyContentMap = new Map([
|
|
23
|
+
['around', 'around'],
|
|
24
|
+
['between', 'between'],
|
|
25
|
+
['end', 'right'],
|
|
26
|
+
['center', 'center'],
|
|
27
|
+
['start', 'left'],
|
|
28
|
+
]);
|
|
29
|
+
function mapJustifyContentBreakpoints(value) {
|
|
30
|
+
const config = {};
|
|
31
|
+
for (const key in value) {
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
if (justifyContentMap.has(value[key])) {
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
config[key] = justifyContentMap.get(value[key]);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return config;
|
|
39
|
+
}
|
|
8
40
|
export function Flex(props) {
|
|
9
41
|
const config = useConfig();
|
|
10
42
|
const { alignContent, alignItems, className, flexDirection, flexWrap, inline, justifyContent, prefixCls = config.prefixCls, ...restProps } = props;
|
|
11
43
|
const rootCls = React.useMemo(() => config.getRootPrefixCls(prefixCls || config.prefixCls, 'flex'), [config, prefixCls]);
|
|
12
|
-
const justifyContentCls = React.useMemo(
|
|
13
|
-
|
|
14
|
-
|
|
44
|
+
const justifyContentCls = React.useMemo(
|
|
45
|
+
// eslint-disable-next-line no-nested-ternary
|
|
46
|
+
() => (typeof justifyContent === 'string'
|
|
47
|
+
? (justifyContentMap.has(justifyContent) ? `${rootCls}-${justifyContentMap.get(justifyContent)}` : '')
|
|
48
|
+
: getBreakpointsConfigClasses(prefixCls || config.prefixCls, 'flex', mapJustifyContentBreakpoints(justifyContent || {}))), [config.prefixCls, justifyContent, prefixCls, rootCls]);
|
|
15
49
|
const context = React.useMemo(() => ({
|
|
16
50
|
getRootCls() {
|
|
17
51
|
return rootCls;
|
|
@@ -21,9 +55,9 @@ export function Flex(props) {
|
|
|
21
55
|
React.createElement(Component, { className: classNames({
|
|
22
56
|
[rootCls]: !inline,
|
|
23
57
|
[`${rootCls}-inline`]: inline,
|
|
24
|
-
[`${rootCls}-${alignItems}`]: alignItems
|
|
58
|
+
[`${rootCls}-${alignItemsMap.get(alignItems)}`]: alignItems && alignItemsMap.has(alignItems),
|
|
25
59
|
[`${rootCls}-${flexDirection}`]: flexDirection !== undefined,
|
|
26
60
|
[`${rootCls}-${flexWrap}`]: flexWrap !== undefined,
|
|
27
|
-
[`${rootCls}-wrap-${alignContent}`]: alignContent
|
|
61
|
+
[`${rootCls}-wrap-${alignContentMap.get(alignContent)}`]: alignContent && alignContentMap.has(alignContent),
|
|
28
62
|
}, justifyContentCls, className), component: defaultElement, ...restProps })));
|
|
29
63
|
}
|
|
@@ -6,7 +6,7 @@ export type HeadingOwnProps = {
|
|
|
6
6
|
prefixCls?: string;
|
|
7
7
|
size?: 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge';
|
|
8
8
|
};
|
|
9
|
-
export type HeadingProps<E extends React.ElementType> = React.PropsWithChildren<HeadingOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, HeadingOwnProps>;
|
|
9
|
+
export type HeadingProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<HeadingOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, HeadingOwnProps>;
|
|
10
10
|
declare const defaultElement = "div";
|
|
11
11
|
export declare function Heading<E extends React.ElementType = typeof defaultElement>(props: HeadingProps<E>): React.JSX.Element;
|
|
12
12
|
export declare namespace Heading {
|
|
@@ -6,4 +6,4 @@ export interface LinkOwnProps extends React.AnchorHTMLAttributes<HTMLAnchorEleme
|
|
|
6
6
|
type?: 'heading' | 'muted' | 'reset' | 'text' | 'toggle';
|
|
7
7
|
}
|
|
8
8
|
export type LinkProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<LinkOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, LinkOwnProps>;
|
|
9
|
-
export declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps<React.ElementType<any>>, "ref"> & React.RefAttributes<unknown>>;
|
|
9
|
+
export declare const Link: React.ForwardRefExoticComponent<Omit<LinkProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
|
|
@@ -610,8 +610,7 @@
|
|
|
610
610
|
margin: 0;
|
|
611
611
|
max-height: 200px;
|
|
612
612
|
outline: none;
|
|
613
|
-
overflow
|
|
614
|
-
overflow-y: auto;
|
|
613
|
+
overflow: hidden auto;
|
|
615
614
|
padding: 0;
|
|
616
615
|
text-align: left;
|
|
617
616
|
@if mixin-exists(hook-tabs-dropdown-menu) {
|
|
@@ -769,4 +768,5 @@
|
|
|
769
768
|
--inverse-tabs-tab-hover-color: var(--inverse-global-color);
|
|
770
769
|
--inverse-tabs-tab-active-color: var(--inverse-global-emphasis-color);
|
|
771
770
|
--inverse-tabs-tab-disabled-color: var(--inverse-global-muted-color);
|
|
771
|
+
--inverse-tabs-ink-bar-color: var(--inverse-global-primary-background);
|
|
772
772
|
}
|
|
@@ -5,13 +5,14 @@ export type TextAlign = 'left' | 'right' | 'center' | 'justify';
|
|
|
5
5
|
export type TextOwnProps = {
|
|
6
6
|
align?: TextAlign | BreakpointsConfig<TextAlign>;
|
|
7
7
|
className?: string;
|
|
8
|
-
color?: '
|
|
8
|
+
color?: 'muted' | 'emphasis' | 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'danger';
|
|
9
9
|
column?: number | BreakpointsConfig<number>;
|
|
10
10
|
decoration?: 'none';
|
|
11
11
|
dropcap?: boolean;
|
|
12
12
|
italic?: boolean;
|
|
13
|
+
kind?: 'meta' | 'lead' | 'base';
|
|
13
14
|
prefixCls?: string;
|
|
14
|
-
size?: '
|
|
15
|
+
size?: 'xsmall' | 'small' | 'large';
|
|
15
16
|
transform?: 'capitalize' | 'uppercase' | 'lowercase';
|
|
16
17
|
verticalAlign?: 'top' | 'middle' | 'bottom' | 'baseline';
|
|
17
18
|
weight?: 'thin' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'lighter' | 'bolder';
|
|
@@ -6,7 +6,7 @@ import { getBreakpointsConfigClasses } from '../../utils';
|
|
|
6
6
|
const defaultElement = 'span';
|
|
7
7
|
export function Text(props) {
|
|
8
8
|
const config = useConfig();
|
|
9
|
-
const { align, className, color, column, decoration, dropcap, italic, prefixCls = config.prefixCls, size, transform, verticalAlign, weight, wrap, ...restProps } = props;
|
|
9
|
+
const { align, className, color, column, decoration, dropcap, italic, kind, prefixCls = config.prefixCls, size, transform, verticalAlign, weight, wrap, ...restProps } = props;
|
|
10
10
|
const rootCls = React.useMemo(() => config.getRootPrefixCls(prefixCls || config.prefixCls, 'text'), [config, prefixCls]);
|
|
11
11
|
const alignClassName = React.useMemo(() => (typeof align === 'string'
|
|
12
12
|
? `${rootCls}-${align}`
|
|
@@ -17,6 +17,7 @@ export function Text(props) {
|
|
|
17
17
|
return (React.createElement(Component, { className: classNames(columnClassName, alignClassName, {
|
|
18
18
|
[`${prefixCls || config.prefixCls}-dropcap`]: dropcap,
|
|
19
19
|
[`${rootCls}-${color}`]: color !== undefined,
|
|
20
|
+
[`${rootCls}-${kind}`]: kind !== undefined,
|
|
20
21
|
[`${rootCls}-${size}`]: size !== undefined,
|
|
21
22
|
[`${rootCls}-${transform}`]: transform !== undefined,
|
|
22
23
|
[`${rootCls}-${verticalAlign}`]: verticalAlign !== undefined,
|