@broxus/react-uikit 0.10.0 → 0.12.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/Accordion/Item.d.ts +2 -1
- package/dist/cjs/components/Alert/index.d.ts +2 -2
- package/dist/cjs/components/Align/Align.d.ts +2 -2
- package/dist/cjs/components/Card/context.d.ts +2 -2
- package/dist/cjs/components/ConfigProvider/index.js +2 -0
- package/dist/cjs/components/Control/Select/index.d.ts +1 -1
- package/dist/cjs/components/Tabs/hooks/index.d.ts +0 -1
- package/dist/cjs/components/Tabs/hooks/index.js +0 -1
- package/dist/cjs/components/Tabs/hooks/useAnimateConfig.d.ts +1 -1
- package/dist/cjs/components/Tabs/index.d.ts +22 -5
- package/dist/cjs/components/Tabs/index.js +7 -3
- package/dist/cjs/styles/_import.components.scss +1 -1
- package/dist/cjs/styles/_import.scss +1 -1
- package/dist/cjs/styles/variables.scss +4 -0
- package/dist/cjs/styles/vars.scss +8 -4
- package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/cjs/types.d.ts +4 -0
- package/dist/esm/components/Accordion/Item.d.ts +2 -1
- package/dist/esm/components/Alert/index.d.ts +2 -2
- package/dist/esm/components/Align/Align.d.ts +2 -2
- package/dist/esm/components/Card/context.d.ts +2 -2
- package/dist/esm/components/ConfigProvider/index.js +2 -0
- package/dist/esm/components/Control/Select/index.d.ts +1 -1
- package/dist/esm/components/Tabs/hooks/index.d.ts +0 -1
- package/dist/esm/components/Tabs/hooks/index.js +0 -1
- package/dist/esm/components/Tabs/hooks/useAnimateConfig.d.ts +1 -1
- package/dist/esm/components/Tabs/index.d.ts +22 -5
- package/dist/esm/components/Tabs/index.js +8 -4
- package/dist/esm/styles/_import.components.scss +1 -1
- package/dist/esm/styles/_import.scss +1 -1
- package/dist/esm/styles/variables.scss +4 -0
- package/dist/esm/styles/vars.scss +8 -4
- package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/esm/types.d.ts +4 -0
- package/package.json +10 -10
- package/dist/cjs/components/Tabs/hooks/useLegacyItems.d.ts +0 -4
- package/dist/cjs/components/Tabs/hooks/useLegacyItems.js +0 -56
- package/dist/esm/components/Tabs/hooks/useLegacyItems.d.ts +0 -4
- package/dist/esm/components/Tabs/hooks/useLegacyItems.js +0 -26
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type CollapsePanelProps } from 'rc-collapse';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
export
|
|
3
|
+
export interface AccordionItemProps extends React.PropsWithChildren<Omit<CollapsePanelProps, 'prefixCls'>> {
|
|
4
|
+
}
|
|
4
5
|
/**
|
|
5
6
|
* Use Accordion items props instead
|
|
6
7
|
* @deprecated
|
|
@@ -9,7 +9,7 @@ export interface AlertProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
9
9
|
onClose?: VoidFunction;
|
|
10
10
|
onClosed?: MotionEndEventHandler;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export interface AlertRef {
|
|
13
13
|
close: VoidFunction;
|
|
14
|
-
}
|
|
14
|
+
}
|
|
15
15
|
export declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttributes<AlertRef>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type PolymorphicProps } from '../../components/Component';
|
|
3
3
|
import { type Direction } from '../../types';
|
|
4
|
-
export
|
|
4
|
+
export interface AlignOwnProps {
|
|
5
5
|
direction?: Direction;
|
|
6
6
|
prefixCls?: string;
|
|
7
7
|
side?: 'left' | 'right';
|
|
8
|
-
}
|
|
8
|
+
}
|
|
9
9
|
export type AlignProps<E extends React.ElementType = React.ElementType> = React.PropsWithChildren<AlignOwnProps & PolymorphicProps<E>> & PolymorphicProps<E, AlignOwnProps>;
|
|
10
10
|
declare const defaultElement = "div";
|
|
11
11
|
export declare function Align<E extends React.ElementType = typeof defaultElement>(props: AlignProps<E>): React.JSX.Element;
|
|
@@ -15,7 +15,7 @@ export interface SelectProps<ValueType = any, OptionType extends BaseOptionType
|
|
|
15
15
|
showArrow?: boolean;
|
|
16
16
|
}
|
|
17
17
|
export declare const Select: (<ValueType = any, OptionType extends BaseOptionType | DefaultOptionType = DefaultOptionType>(props: SelectProps<ValueType, OptionType> & {
|
|
18
|
-
ref?: React.Ref<BaseSelectRef
|
|
18
|
+
ref?: React.Ref<BaseSelectRef>;
|
|
19
19
|
}) => React.ReactElement) & {
|
|
20
20
|
SECRET_COMBOBOX_MODE_DO_NOT_USE: string;
|
|
21
21
|
Option: typeof Option;
|
|
@@ -15,4 +15,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("../../../components/Tabs/hooks/useAnimateConfig"), exports);
|
|
18
|
-
__exportStar(require("../../../components/Tabs/hooks/useLegacyItems"), exports);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type AnimatedConfig } from 'rc-tabs/
|
|
1
|
+
import { type AnimatedConfig } from 'rc-tabs/es/interface';
|
|
2
2
|
import { type TabsProps } from '../../../components/Tabs';
|
|
3
3
|
export declare function useAnimateConfig(prefixCls: string, animated?: TabsProps['animated']): AnimatedConfig;
|
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
import { type TabsProps as RcTabsProps } from 'rc-tabs';
|
|
2
|
-
import { type Tab, type TabPosition as TabsPosition } from 'rc-tabs/lib/interface';
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import './index.scss';
|
|
5
|
-
export
|
|
4
|
+
export type TabsPosition = 'left' | 'right' | 'top' | 'bottom';
|
|
5
|
+
export interface Tab {
|
|
6
|
+
active?: boolean;
|
|
7
|
+
animated?: boolean;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
closable?: boolean;
|
|
11
|
+
closeIcon?: React.ReactNode;
|
|
12
|
+
destroyInactiveTabPane?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
forceRender?: boolean;
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
id?: string;
|
|
17
|
+
key: string;
|
|
18
|
+
label: React.ReactNode;
|
|
19
|
+
prefixCls?: string;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
tabKey?: string;
|
|
22
|
+
}
|
|
6
23
|
export type TabType = 'line' | 'card' | 'editable-card';
|
|
7
|
-
export
|
|
8
|
-
export interface TabsProps extends Exclude<RcTabsProps, 'editable'> {
|
|
24
|
+
export interface TabsProps extends Exclude<RcTabsProps, 'editable' | 'items' | 'tabPosition'> {
|
|
9
25
|
addIcon?: React.ReactNode;
|
|
10
26
|
centered?: boolean;
|
|
11
|
-
children?: React.ReactNode;
|
|
12
27
|
hideAdd?: boolean;
|
|
28
|
+
items?: Tab[];
|
|
13
29
|
size?: 'medium' | 'large';
|
|
30
|
+
tabPosition?: TabsPosition;
|
|
14
31
|
type?: TabType;
|
|
15
32
|
onEdit?: (event: React.MouseEvent | React.KeyboardEvent | string, action: 'add' | 'remove') => void;
|
|
16
33
|
}
|
|
@@ -37,7 +37,7 @@ const utils_1 = require("../../utils");
|
|
|
37
37
|
require("./index.scss");
|
|
38
38
|
function Tabs(props) {
|
|
39
39
|
const config = (0, ConfigProvider_1.useConfig)();
|
|
40
|
-
const { addIcon, animated, centered,
|
|
40
|
+
const { addIcon, animated, centered, className, direction, hideAdd, items, more, prefixCls = config.prefixCls, size, type, onEdit, ...restProps } = props;
|
|
41
41
|
const rootCls = React.useMemo(() => config.getRootPrefixCls(prefixCls || config.prefixCls, 'tabs'), [config, prefixCls]);
|
|
42
42
|
const editable = React.useMemo(() => (type === 'editable-card'
|
|
43
43
|
? {
|
|
@@ -51,11 +51,15 @@ function Tabs(props) {
|
|
|
51
51
|
},
|
|
52
52
|
}
|
|
53
53
|
: undefined), [addIcon, hideAdd, onEdit, type]);
|
|
54
|
-
return (React.createElement(rc_tabs_1.default, { animated: (0, hooks_1.useAnimateConfig)(rootCls, animated), direction: direction, items:
|
|
54
|
+
return (React.createElement(rc_tabs_1.default, { animated: (0, hooks_1.useAnimateConfig)(rootCls, animated), direction: direction, items: items, ...restProps, className: (0, classnames_1.default)({
|
|
55
55
|
[`${rootCls}-${size}`]: size,
|
|
56
56
|
[`${rootCls}-card`]: ['card', 'editable-card'].includes(type),
|
|
57
57
|
[`${rootCls}-editable-card`]: type === 'editable-card',
|
|
58
58
|
[`${rootCls}-centered`]: centered,
|
|
59
|
-
}, className), editable: editable,
|
|
59
|
+
}, className), editable: editable, more: {
|
|
60
|
+
icon: React.createElement(Icon_1.Icon, { icon: "more_horizontal" }),
|
|
61
|
+
transitionName: (0, utils_1.getMotionName)(prefixCls || config.prefixCls, 'slide-bottom-small'),
|
|
62
|
+
...more,
|
|
63
|
+
}, prefixCls: rootCls }));
|
|
60
64
|
}
|
|
61
65
|
exports.Tabs = Tabs;
|
|
@@ -21,11 +21,15 @@ $breakpoint-small: 640px !default;
|
|
|
21
21
|
$breakpoint-medium: 960px !default; // Tablet Landscape
|
|
22
22
|
$breakpoint-large: 1200px !default; // Desktop
|
|
23
23
|
$breakpoint-xlarge: 1600px !default; // Large Screens
|
|
24
|
+
$breakpoint-2xlarge: 2560px !default; // Wide Screens
|
|
25
|
+
$breakpoint-3xlarge: 3440px !default; // Ultra Wide Screens
|
|
24
26
|
|
|
25
27
|
$breakpoint-xsmall-max: ($breakpoint-small - 1) !default;
|
|
26
28
|
$breakpoint-small-max: ($breakpoint-medium - 1) !default;
|
|
27
29
|
$breakpoint-medium-max: ($breakpoint-large - 1) !default;
|
|
28
30
|
$breakpoint-large-max: ($breakpoint-xlarge - 1) !default;
|
|
31
|
+
$breakpoint-xlarge-max: ($breakpoint-2xlarge - 1) !default;
|
|
32
|
+
$breakpoint-2xlarge-max: ($breakpoint-3xlarge - 1) !default;
|
|
29
33
|
|
|
30
34
|
|
|
31
35
|
// Global variables
|
|
@@ -14,10 +14,14 @@
|
|
|
14
14
|
--breakpoint-medium: #{$breakpoint-medium};
|
|
15
15
|
--breakpoint-large: #{$breakpoint-large};
|
|
16
16
|
--breakpoint-xlarge: #{$breakpoint-xlarge};
|
|
17
|
-
--breakpoint-
|
|
18
|
-
--breakpoint-
|
|
19
|
-
--breakpoint-
|
|
20
|
-
--breakpoint-
|
|
17
|
+
--breakpoint-2xlarge: #{$breakpoint-2xlarge};
|
|
18
|
+
--breakpoint-3xlarge: #{$breakpoint-3xlarge};
|
|
19
|
+
--breakpoint-xsmall-max: #{$breakpoint-xsmall-max};
|
|
20
|
+
--breakpoint-small-max: #{$breakpoint-small-max};
|
|
21
|
+
--breakpoint-medium-max: #{$breakpoint-medium-max};
|
|
22
|
+
--breakpoint-large-max: #{$breakpoint-large-max};
|
|
23
|
+
--breakpoint-xlarge-max: #{$breakpoint-xlarge-max};
|
|
24
|
+
--breakpoint-2xlarge-max: #{$breakpoint-2xlarge-max};
|
|
21
25
|
|
|
22
26
|
|
|
23
27
|
// Global variables
|