baseui 0.0.0-next-897fdf3 → 0.0.0-next-ac80337
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/accordion/types.d.ts +2 -2
- package/app-nav-bar/types.d.ts +2 -2
- package/aspect-ratio-box/aspect-ratio-box-body.d.ts +1 -1
- package/aspect-ratio-box/types.d.ts +1 -1
- package/badge/styled-components.js +4 -4
- package/badge/styled-components.js.flow +4 -4
- package/badge/types.d.ts +2 -2
- package/banner/index.d.ts +1 -1
- package/banner/types.d.ts +3 -4
- package/block/types.d.ts +3 -4
- package/button/types.d.ts +4 -5
- package/button-group/types.d.ts +4 -5
- package/checkbox/types.d.ts +36 -37
- package/combobox/types.d.ts +4 -5
- package/data-table/types.d.ts +4 -5
- package/datepicker/types.d.ts +2 -2
- package/divider/types.d.ts +1 -1
- package/dnd-list/types.d.ts +2 -2
- package/drawer/types.d.ts +2 -2
- package/es/badge/styled-components.js +4 -4
- package/es/tabs-motion/styled-components.js +23 -1
- package/es/tabs-motion/tabs.js +29 -5
- package/esm/badge/styled-components.js +4 -4
- package/esm/tabs-motion/styled-components.js +60 -39
- package/esm/tabs-motion/tabs.js +85 -57
- package/flex-grid/types.d.ts +1 -1
- package/form-control/types.d.ts +1 -1
- package/heading/types.d.ts +1 -1
- package/helpers/types.d.ts +1 -1
- package/icon/types.d.ts +1 -1
- package/input/types.d.ts +13 -14
- package/layer/types.d.ts +2 -2
- package/layout-grid/types.d.ts +2 -2
- package/list/types.d.ts +2 -2
- package/locale/en_US.d.ts +1 -1
- package/locale/es_AR.d.ts +1 -1
- package/locale/tr_TR.d.ts +1 -1
- package/map-marker/types.d.ts +2 -2
- package/menu/index.d.ts +1 -2
- package/menu/types.d.ts +12 -13
- package/message-card/types.d.ts +1 -1
- package/modal/types.d.ts +2 -2
- package/package.json +1 -1
- package/pagination/types.d.ts +2 -2
- package/phone-input/types.d.ts +5 -6
- package/pin-code/types.d.ts +2 -2
- package/popover/types.d.ts +2 -2
- package/progress-bar/types.d.ts +2 -2
- package/radio/types.d.ts +19 -20
- package/select/types.d.ts +5 -6
- package/side-navigation/types.d.ts +1 -1
- package/slider/types.d.ts +1 -1
- package/snackbar/types.d.ts +3 -4
- package/spinner/types.d.ts +1 -1
- package/styles/styled.d.ts +1 -1
- package/table/types.d.ts +2 -2
- package/table-semantic/types.d.ts +2 -2
- package/tabs/types.d.ts +2 -2
- package/tabs-motion/styled-components.d.ts +5 -0
- package/tabs-motion/styled-components.js +63 -40
- package/tabs-motion/styled-components.js.flow +21 -0
- package/tabs-motion/tabs.d.ts +1 -1
- package/tabs-motion/tabs.js +85 -56
- package/tabs-motion/tabs.js.flow +69 -38
- package/tabs-motion/types.d.ts +5 -2
- package/tabs-motion/types.js.flow +3 -0
- package/tabs-motion/utils.d.ts +1 -1
- package/tag/types.d.ts +4 -5
- package/textarea/types.d.ts +3 -5
- package/toast/types.d.ts +2 -2
- package/tree-view/types.d.ts +3 -4
- package/utils/focusVisible.d.ts +1 -1
package/accordion/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import type * as React from 'react';
|
|
2
2
|
import type { Override } from '../helpers/overrides';
|
|
3
|
-
import { STATE_CHANGE_TYPE } from './constants';
|
|
3
|
+
import type { STATE_CHANGE_TYPE } from './constants';
|
|
4
4
|
export declare type AccordionState = {
|
|
5
5
|
expanded: Array<React.Key>;
|
|
6
6
|
};
|
package/app-nav-bar/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { POSITION } from './constants';
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { POSITION } from './constants';
|
|
3
3
|
import type { Override } from '../helpers/overrides';
|
|
4
4
|
export declare type AppNavBarOverrides = {
|
|
5
5
|
Root?: Override;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StyledBlockProps, BlockProps } from '../block';
|
|
2
|
+
import type { StyledBlockProps, BlockProps } from '../block';
|
|
3
3
|
interface AspectRatioBoxBodyComponentType<D extends React.ElementType> {
|
|
4
4
|
<C extends React.ElementType = D>(props: BlockProps<C> & Omit<StyledBlockProps & React.ComponentProps<C>, keyof BlockProps>): JSX.Element;
|
|
5
5
|
displayName?: string;
|
|
@@ -24,19 +24,19 @@ function getColorStyles(_ref) {
|
|
|
24
24
|
$hierarchy = _ref.$hierarchy,
|
|
25
25
|
$color = _ref.$color;
|
|
26
26
|
var COLOR_STYLES = (_COLOR_STYLES = {}, _defineProperty(_COLOR_STYLES, _constants.HIERARCHY.primary, (_HIERARCHY$primary = {}, _defineProperty(_HIERARCHY$primary, _constants.COLOR.accent, {
|
|
27
|
-
color: $theme.colors.
|
|
27
|
+
color: $theme.colors.contentOnColor,
|
|
28
28
|
backgroundColor: $theme.colors.backgroundAccent
|
|
29
29
|
}), _defineProperty(_HIERARCHY$primary, _constants.COLOR.primary, {
|
|
30
30
|
color: $theme.colors.contentInversePrimary,
|
|
31
31
|
backgroundColor: $theme.colors.backgroundInversePrimary
|
|
32
32
|
}), _defineProperty(_HIERARCHY$primary, _constants.COLOR.positive, {
|
|
33
|
-
color: $theme.colors.
|
|
33
|
+
color: $theme.colors.contentOnColor,
|
|
34
34
|
backgroundColor: $theme.colors.backgroundPositive
|
|
35
35
|
}), _defineProperty(_HIERARCHY$primary, _constants.COLOR.negative, {
|
|
36
|
-
color: $theme.colors.
|
|
36
|
+
color: $theme.colors.contentOnColor,
|
|
37
37
|
backgroundColor: $theme.colors.backgroundNegative
|
|
38
38
|
}), _defineProperty(_HIERARCHY$primary, _constants.COLOR.warning, {
|
|
39
|
-
color: $theme.colors.
|
|
39
|
+
color: $theme.colors.contentOnColorInverse,
|
|
40
40
|
backgroundColor: $theme.colors.backgroundWarning
|
|
41
41
|
}), _HIERARCHY$primary)), _defineProperty(_COLOR_STYLES, _constants.HIERARCHY.secondary, (_HIERARCHY$secondary = {}, _defineProperty(_HIERARCHY$secondary, _constants.COLOR.accent, {
|
|
42
42
|
color: $theme.colors.contentAccent,
|
|
@@ -16,7 +16,7 @@ function getColorStyles({ $theme, $hierarchy, $color }): {|
|
|
|
16
16
|
const COLOR_STYLES = {
|
|
17
17
|
[HIERARCHY.primary]: {
|
|
18
18
|
[COLOR.accent]: {
|
|
19
|
-
color: $theme.colors.
|
|
19
|
+
color: $theme.colors.contentOnColor,
|
|
20
20
|
backgroundColor: $theme.colors.backgroundAccent,
|
|
21
21
|
},
|
|
22
22
|
[COLOR.primary]: {
|
|
@@ -24,15 +24,15 @@ function getColorStyles({ $theme, $hierarchy, $color }): {|
|
|
|
24
24
|
backgroundColor: $theme.colors.backgroundInversePrimary,
|
|
25
25
|
},
|
|
26
26
|
[COLOR.positive]: {
|
|
27
|
-
color: $theme.colors.
|
|
27
|
+
color: $theme.colors.contentOnColor,
|
|
28
28
|
backgroundColor: $theme.colors.backgroundPositive,
|
|
29
29
|
},
|
|
30
30
|
[COLOR.negative]: {
|
|
31
|
-
color: $theme.colors.
|
|
31
|
+
color: $theme.colors.contentOnColor,
|
|
32
32
|
backgroundColor: $theme.colors.backgroundNegative,
|
|
33
33
|
},
|
|
34
34
|
[COLOR.warning]: {
|
|
35
|
-
color: $theme.colors.
|
|
35
|
+
color: $theme.colors.contentOnColorInverse,
|
|
36
36
|
backgroundColor: $theme.colors.backgroundWarning,
|
|
37
37
|
},
|
|
38
38
|
},
|
package/badge/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { HIERARCHY, SHAPE, COLOR, PLACEMENT, ROLE } from './constants';
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { HIERARCHY, SHAPE, COLOR, PLACEMENT, ROLE } from './constants';
|
|
3
3
|
import type { Override } from '../helpers/overrides';
|
|
4
4
|
export declare type Hierarchy = typeof HIERARCHY[keyof typeof HIERARCHY];
|
|
5
5
|
export declare type Shape = typeof SHAPE[keyof typeof SHAPE];
|
package/banner/index.d.ts
CHANGED
package/banner/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import type * as React from 'react';
|
|
2
2
|
import type { Override } from '../helpers/overrides';
|
|
3
|
-
import { ACTION_POSITION, ARTWORK_TYPE, HIERARCHY, KIND } from './constants';
|
|
4
|
-
import type { SyntheticEvent } from 'react';
|
|
3
|
+
import type { ACTION_POSITION, ARTWORK_TYPE, HIERARCHY, KIND } from './constants';
|
|
5
4
|
export declare type ActionPosition = typeof ACTION_POSITION[keyof typeof ACTION_POSITION];
|
|
6
5
|
export declare type ArtworkType = typeof ARTWORK_TYPE[keyof typeof ARTWORK_TYPE];
|
|
7
6
|
export declare type Hierarchy = typeof HIERARCHY[keyof typeof HIERARCHY];
|
|
@@ -11,7 +10,7 @@ export declare type ActionContent = {
|
|
|
11
10
|
icon?: (a: {
|
|
12
11
|
size: string;
|
|
13
12
|
}) => React.ReactNode;
|
|
14
|
-
onClick: (a: SyntheticEvent<HTMLButtonElement>) => unknown;
|
|
13
|
+
onClick: (a: React.SyntheticEvent<HTMLButtonElement>) => unknown;
|
|
15
14
|
position?: ActionPosition;
|
|
16
15
|
};
|
|
17
16
|
export declare type ArtworkContent = {
|
package/block/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type * as React from 'react';
|
|
2
2
|
import type { StyleObject } from 'styletron-standard';
|
|
3
3
|
import type { Override } from '../helpers/overrides';
|
|
4
|
-
import * as React from 'react';
|
|
5
4
|
export declare type BlockOverrides = {
|
|
6
5
|
Block?: Override;
|
|
7
6
|
};
|
|
@@ -20,8 +19,8 @@ declare type Position = 'static' | 'absolute' | 'relative' | 'fixed' | 'sticky';
|
|
|
20
19
|
declare type Overflow = 'visible' | 'hidden' | 'scroll' | 'scrollX' | 'scrollY' | 'auto' | 'inherit' | 'initial' | 'unset';
|
|
21
20
|
export declare type Scale = 0 | string;
|
|
22
21
|
export declare type WhiteSpace = 'normal' | 'nowrap' | 'pre' | 'pre-wrap' | 'pre-line' | 'break-spaces' | 'inherit' | 'initial' | 'unset';
|
|
23
|
-
export declare type BlockProps<T extends ElementType = ElementType> = {
|
|
24
|
-
children?: ReactNode;
|
|
22
|
+
export declare type BlockProps<T extends React.ElementType = React.ElementType> = {
|
|
23
|
+
children?: React.ReactNode;
|
|
25
24
|
/** Modifies the base element used to render the block. */
|
|
26
25
|
as?: T;
|
|
27
26
|
overrides?: BlockOverrides;
|
package/button/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { KIND, SIZE, SHAPE } from './constants';
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { KIND, SIZE, SHAPE } from './constants';
|
|
3
3
|
import type { Override } from '../helpers/overrides';
|
|
4
|
-
import type { ReactNode, SyntheticEvent } from 'react';
|
|
5
4
|
export declare type ButtonOverrides = {
|
|
6
5
|
Root?: Override;
|
|
7
6
|
BaseButton?: Override;
|
|
@@ -15,7 +14,7 @@ export declare type CustomColors = {
|
|
|
15
14
|
color: string;
|
|
16
15
|
};
|
|
17
16
|
export declare type ButtonProps = {
|
|
18
|
-
children?: ReactNode;
|
|
17
|
+
children?: React.ReactNode;
|
|
19
18
|
colors?: CustomColors;
|
|
20
19
|
disabled?: boolean;
|
|
21
20
|
/** A helper rendered at the end of the button. */
|
|
@@ -26,7 +25,7 @@ export declare type ButtonProps = {
|
|
|
26
25
|
isSelected?: boolean;
|
|
27
26
|
/** Defines the kind (purpose) of a button */
|
|
28
27
|
kind?: keyof typeof KIND;
|
|
29
|
-
onClick?: (a: SyntheticEvent<HTMLButtonElement>) => unknown;
|
|
28
|
+
onClick?: (a: React.SyntheticEvent<HTMLButtonElement>) => unknown;
|
|
30
29
|
overrides?: ButtonOverrides;
|
|
31
30
|
/** Defines the shape of the button */
|
|
32
31
|
shape?: keyof typeof SHAPE;
|
package/button-group/types.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { SIZE, SHAPE, KIND } from '../button';
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { SIZE, SHAPE, KIND } from '../button';
|
|
3
3
|
import type { Override } from '../helpers/overrides';
|
|
4
|
-
import { MODE, STATE_CHANGE_TYPE } from './constants';
|
|
5
|
-
import type { SyntheticEvent } from 'react';
|
|
4
|
+
import type { MODE, STATE_CHANGE_TYPE } from './constants';
|
|
6
5
|
export declare type ButtonGroupProps = {
|
|
7
6
|
/** Accessible label. */
|
|
8
7
|
ariaLabel?: string;
|
|
@@ -55,5 +54,5 @@ export declare type State = {
|
|
|
55
54
|
selected: Array<number>;
|
|
56
55
|
};
|
|
57
56
|
export declare type StateReducer = (stateType: typeof STATE_CHANGE_TYPE[keyof typeof STATE_CHANGE_TYPE], nextState: State, currentState: State) => State;
|
|
58
|
-
declare type ClickHandler = (event: SyntheticEvent<HTMLButtonElement>, index: number) => unknown;
|
|
57
|
+
declare type ClickHandler = (event: React.SyntheticEvent<HTMLButtonElement>, index: number) => unknown;
|
|
59
58
|
export {};
|
package/checkbox/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import type * as React from 'react';
|
|
2
2
|
import type { Override } from '../helpers/overrides';
|
|
3
|
-
import { STYLE_TYPE } from './constants';
|
|
4
|
-
import type { ReactNode, ChangeEvent } from 'react';
|
|
3
|
+
import type { STYLE_TYPE } from './constants';
|
|
5
4
|
export declare type LabelPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
6
5
|
export declare type StyleType = keyof typeof STYLE_TYPE;
|
|
7
6
|
export declare type CheckboxOverrides = {
|
|
@@ -15,7 +14,7 @@ export declare type CheckboxOverrides = {
|
|
|
15
14
|
};
|
|
16
15
|
export declare type DefaultProps = {
|
|
17
16
|
overrides?: any;
|
|
18
|
-
children?: ReactNode;
|
|
17
|
+
children?: React.ReactNode;
|
|
19
18
|
checked: boolean;
|
|
20
19
|
disabled: boolean;
|
|
21
20
|
error: boolean;
|
|
@@ -24,13 +23,13 @@ export declare type DefaultProps = {
|
|
|
24
23
|
isIndeterminate: boolean;
|
|
25
24
|
inputRef: React.RefObject<HTMLInputElement>;
|
|
26
25
|
checkmarkType: StyleType;
|
|
27
|
-
onChange: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
28
|
-
onMouseEnter: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
29
|
-
onMouseLeave: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
30
|
-
onMouseDown: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
31
|
-
onMouseUp: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
32
|
-
onFocus: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
33
|
-
onBlur: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
26
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
27
|
+
onMouseEnter: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
28
|
+
onMouseLeave: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
29
|
+
onMouseDown: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
30
|
+
onMouseUp: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
31
|
+
onFocus: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
32
|
+
onBlur: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
34
33
|
containsInteractiveElement?: boolean;
|
|
35
34
|
};
|
|
36
35
|
export declare type CheckboxProps = {
|
|
@@ -42,7 +41,7 @@ export declare type CheckboxProps = {
|
|
|
42
41
|
ariaLabel?: string;
|
|
43
42
|
'aria-label'?: string;
|
|
44
43
|
/** Component or String value for label of checkbox. */
|
|
45
|
-
children?: ReactNode;
|
|
44
|
+
children?: React.ReactNode;
|
|
46
45
|
/** Indicates if this checkbox children contain an interactive element (prevents the label from moving focus from the child element to the radio button) */
|
|
47
46
|
containsInteractiveElement?: boolean;
|
|
48
47
|
overrides?: CheckboxOverrides;
|
|
@@ -73,19 +72,19 @@ export declare type CheckboxProps = {
|
|
|
73
72
|
/** Text to display in native OS tooltip on long hover. */
|
|
74
73
|
title?: string | null;
|
|
75
74
|
/** Handler for change events on trigger element. */
|
|
76
|
-
onChange?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
75
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
77
76
|
/** Handler for mouseenter events on trigger element. */
|
|
78
|
-
onMouseEnter?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
77
|
+
onMouseEnter?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
79
78
|
/** Handler for mouseleave events on trigger element. */
|
|
80
|
-
onMouseLeave?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
79
|
+
onMouseLeave?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
81
80
|
/** Handler for mousedown events on trigger element. */
|
|
82
|
-
onMouseDown?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
81
|
+
onMouseDown?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
83
82
|
/** Handler for mouseup events on trigger element. */
|
|
84
|
-
onMouseUp?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
83
|
+
onMouseUp?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
85
84
|
/** handler for focus events on trigger element. */
|
|
86
|
-
onFocus?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
85
|
+
onFocus?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
87
86
|
/** handler for blur events on trigger element. */
|
|
88
|
-
onBlur?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
87
|
+
onBlur?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
89
88
|
};
|
|
90
89
|
export declare type CheckboxState = {
|
|
91
90
|
isFocused: boolean;
|
|
@@ -97,50 +96,50 @@ export declare type CheckboxReducerState = {
|
|
|
97
96
|
checked?: boolean;
|
|
98
97
|
isIndeterminate?: boolean;
|
|
99
98
|
};
|
|
100
|
-
export declare type StateReducer = (stateType: string, nextState: CheckboxReducerState, currentState: CheckboxReducerState, event: ChangeEvent<HTMLInputElement>) => CheckboxReducerState;
|
|
99
|
+
export declare type StateReducer = (stateType: string, nextState: CheckboxReducerState, currentState: CheckboxReducerState, event: React.ChangeEvent<HTMLInputElement>) => CheckboxReducerState;
|
|
101
100
|
export declare type StatefulContainerChildProps = {
|
|
102
101
|
overrides?: CheckboxOverrides;
|
|
103
102
|
/** Handler for change events on trigger element. */
|
|
104
|
-
onChange?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
103
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
105
104
|
/** Handler for mouseenter events on trigger element. */
|
|
106
|
-
onMouseEnter?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
105
|
+
onMouseEnter?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
107
106
|
/** Handler for mouseleave events on trigger element. */
|
|
108
|
-
onMouseLeave?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
107
|
+
onMouseLeave?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
109
108
|
/** Handler for focus events on trigger element. */
|
|
110
|
-
onFocus?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
109
|
+
onFocus?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
111
110
|
/** Handler for blur events on trigger element. */
|
|
112
|
-
onBlur?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
111
|
+
onBlur?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
113
112
|
/** Focus the checkbox on initial render. */
|
|
114
113
|
autoFocus?: boolean;
|
|
115
114
|
} & CheckboxReducerState;
|
|
116
115
|
export declare type DefaultStatefulProps = {
|
|
117
116
|
initialState: CheckboxReducerState;
|
|
118
|
-
children?: (a: StatefulContainerChildProps) => ReactNode;
|
|
117
|
+
children?: (a: StatefulContainerChildProps) => React.ReactNode;
|
|
119
118
|
stateReducer: StateReducer;
|
|
120
|
-
onChange: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
121
|
-
onMouseEnter: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
122
|
-
onMouseLeave: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
123
|
-
onFocus: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
124
|
-
onBlur: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
119
|
+
onChange: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
120
|
+
onMouseEnter: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
121
|
+
onMouseLeave: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
122
|
+
onFocus: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
123
|
+
onBlur: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
125
124
|
};
|
|
126
125
|
export declare type StatefulContainerProps = {
|
|
127
126
|
overrides?: CheckboxOverrides;
|
|
128
127
|
/** Component or String value for label of checkbox. */
|
|
129
|
-
children?: (a: StatefulContainerChildProps) => ReactNode;
|
|
128
|
+
children?: (a: StatefulContainerChildProps) => React.ReactNode;
|
|
130
129
|
/** Defines the components initial state value */
|
|
131
130
|
initialState?: CheckboxReducerState;
|
|
132
131
|
/** A state change handler. Used to override default state transitions. */
|
|
133
132
|
stateReducer: StateReducer;
|
|
134
133
|
/** Handler for change events on trigger element. */
|
|
135
|
-
onChange?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
134
|
+
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
136
135
|
/** Handler for mouseenter events on trigger element. */
|
|
137
|
-
onMouseEnter?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
136
|
+
onMouseEnter?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
138
137
|
/** Handler for mouseleave events on trigger element. */
|
|
139
|
-
onMouseLeave?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
138
|
+
onMouseLeave?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
140
139
|
/** Handler for focus events on trigger element. */
|
|
141
|
-
onFocus?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
140
|
+
onFocus?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
142
141
|
/** Handler for blur events on trigger element. */
|
|
143
|
-
onBlur?: (e: ChangeEvent<HTMLInputElement>) => unknown;
|
|
142
|
+
onBlur?: (e: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
144
143
|
/** Focus the checkbox on initial render. */
|
|
145
144
|
autoFocus?: boolean;
|
|
146
145
|
};
|
package/combobox/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import type * as React from 'react';
|
|
2
2
|
import type { Override } from '../helpers/overrides';
|
|
3
|
-
import { SIZE } from '../input';
|
|
4
|
-
import type { ChangeEvent } from 'react';
|
|
3
|
+
import type { SIZE } from '../input';
|
|
5
4
|
export declare type ComboboxOverrides = {
|
|
6
5
|
Root?: Override;
|
|
7
6
|
InputContainer?: Override;
|
|
@@ -23,9 +22,9 @@ export declare type ComboboxProps<Option = unknown> = {
|
|
|
23
22
|
id?: string;
|
|
24
23
|
name?: string;
|
|
25
24
|
inputRef?: React.Ref<HTMLElement>;
|
|
26
|
-
onBlur?: (a: ChangeEvent<HTMLInputElement>) => unknown;
|
|
25
|
+
onBlur?: (a: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
27
26
|
onChange: (b: string, a: Option | null) => unknown;
|
|
28
|
-
onFocus?: (a: ChangeEvent<HTMLInputElement>) => unknown;
|
|
27
|
+
onFocus?: (a: React.ChangeEvent<HTMLInputElement>) => unknown;
|
|
29
28
|
onSubmit?: (a: {
|
|
30
29
|
closeListbox: () => void;
|
|
31
30
|
value: string;
|
package/data-table/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { COLUMNS, SORT_DIRECTIONS } from './constants';
|
|
3
|
-
import type { SyntheticEvent } from 'react';
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
import type { COLUMNS, SORT_DIRECTIONS } from './constants';
|
|
4
3
|
export declare type SortDirections = typeof SORT_DIRECTIONS[keyof typeof SORT_DIRECTIONS];
|
|
5
4
|
export declare type Columns = typeof COLUMNS[keyof typeof COLUMNS];
|
|
6
5
|
export declare type SharedColumnOptions<Value> = {
|
|
@@ -45,7 +44,7 @@ export declare type BatchAction = {
|
|
|
45
44
|
label: string;
|
|
46
45
|
onClick: (a: {
|
|
47
46
|
clearSelection: () => unknown;
|
|
48
|
-
event: SyntheticEvent<HTMLButtonElement>;
|
|
47
|
+
event: React.SyntheticEvent<HTMLButtonElement>;
|
|
49
48
|
selection: Row[];
|
|
50
49
|
}) => unknown;
|
|
51
50
|
renderIcon?: React.ComponentType<{
|
|
@@ -55,7 +54,7 @@ export declare type BatchAction = {
|
|
|
55
54
|
export declare type RowAction = {
|
|
56
55
|
label: string;
|
|
57
56
|
onClick: (a: {
|
|
58
|
-
event: SyntheticEvent<HTMLButtonElement>;
|
|
57
|
+
event: React.SyntheticEvent<HTMLButtonElement>;
|
|
59
58
|
row: Row;
|
|
60
59
|
}) => unknown;
|
|
61
60
|
renderIcon: React.ComponentType<{
|
package/datepicker/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import type * as React from 'react';
|
|
2
2
|
import type { Override } from '../helpers/overrides';
|
|
3
3
|
import type { Size } from '../input';
|
|
4
|
-
import { INPUT_ROLE, ORIENTATION, RANGED_CALENDAR_BEHAVIOR, STATE_CHANGE_TYPE, DENSITY } from './constants';
|
|
4
|
+
import type { INPUT_ROLE, ORIENTATION, RANGED_CALENDAR_BEHAVIOR, STATE_CHANGE_TYPE, DENSITY } from './constants';
|
|
5
5
|
import type { DateIOAdapter } from './utils/types';
|
|
6
6
|
declare type Locale = any;
|
|
7
7
|
export declare type Density = keyof typeof DENSITY;
|
package/divider/types.d.ts
CHANGED
package/dnd-list/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import type * as React from 'react';
|
|
2
2
|
import type { Override } from '../helpers/overrides';
|
|
3
|
-
import { STATE_CHANGE_TYPE } from './constants';
|
|
3
|
+
import type { STATE_CHANGE_TYPE } from './constants';
|
|
4
4
|
export declare type State = {
|
|
5
5
|
items: Array<React.ReactNode>;
|
|
6
6
|
};
|
package/drawer/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import type * as React from 'react';
|
|
2
2
|
import type { Override } from '../helpers/overrides';
|
|
3
|
-
import { SIZE, CLOSE_SOURCE, ANCHOR } from './constants';
|
|
3
|
+
import type { SIZE, CLOSE_SOURCE, ANCHOR } from './constants';
|
|
4
4
|
export declare type Size = keyof typeof SIZE;
|
|
5
5
|
export declare type SizeProp = Size | string;
|
|
6
6
|
export declare type Anchor = keyof typeof ANCHOR;
|
|
@@ -15,7 +15,7 @@ function getColorStyles({
|
|
|
15
15
|
const COLOR_STYLES = {
|
|
16
16
|
[HIERARCHY.primary]: {
|
|
17
17
|
[COLOR.accent]: {
|
|
18
|
-
color: $theme.colors.
|
|
18
|
+
color: $theme.colors.contentOnColor,
|
|
19
19
|
backgroundColor: $theme.colors.backgroundAccent
|
|
20
20
|
},
|
|
21
21
|
[COLOR.primary]: {
|
|
@@ -23,15 +23,15 @@ function getColorStyles({
|
|
|
23
23
|
backgroundColor: $theme.colors.backgroundInversePrimary
|
|
24
24
|
},
|
|
25
25
|
[COLOR.positive]: {
|
|
26
|
-
color: $theme.colors.
|
|
26
|
+
color: $theme.colors.contentOnColor,
|
|
27
27
|
backgroundColor: $theme.colors.backgroundPositive
|
|
28
28
|
},
|
|
29
29
|
[COLOR.negative]: {
|
|
30
|
-
color: $theme.colors.
|
|
30
|
+
color: $theme.colors.contentOnColor,
|
|
31
31
|
backgroundColor: $theme.colors.backgroundNegative
|
|
32
32
|
},
|
|
33
33
|
[COLOR.warning]: {
|
|
34
|
-
color: $theme.colors.
|
|
34
|
+
color: $theme.colors.contentOnColorInverse,
|
|
35
35
|
backgroundColor: $theme.colors.backgroundWarning
|
|
36
36
|
}
|
|
37
37
|
},
|
|
@@ -25,6 +25,14 @@ export const StyledRoot = styled('div', ({
|
|
|
25
25
|
});
|
|
26
26
|
StyledRoot.displayName = "StyledRoot";
|
|
27
27
|
StyledRoot.displayName = 'StyledRoot';
|
|
28
|
+
export const StyledTabBar = styled('div', ({
|
|
29
|
+
$hasEndEnhancer,
|
|
30
|
+
$orientation
|
|
31
|
+
}) => $hasEndEnhancer || !isHorizontal($orientation) ? {
|
|
32
|
+
display: 'flex'
|
|
33
|
+
} : {});
|
|
34
|
+
StyledTabBar.displayName = "StyledTabBar";
|
|
35
|
+
StyledTabBar.displayName = 'StyledTabBar';
|
|
28
36
|
export const StyledTabList = styled('div', ({
|
|
29
37
|
$theme,
|
|
30
38
|
$fill = FILL.intrinsic,
|
|
@@ -33,7 +41,8 @@ export const StyledTabList = styled('div', ({
|
|
|
33
41
|
const style = {
|
|
34
42
|
position: 'relative',
|
|
35
43
|
display: 'flex',
|
|
36
|
-
flexWrap: 'nowrap'
|
|
44
|
+
flexWrap: 'nowrap',
|
|
45
|
+
flexGrow: 1
|
|
37
46
|
};
|
|
38
47
|
|
|
39
48
|
if (isHorizontal($orientation)) {
|
|
@@ -139,6 +148,19 @@ export const StyledTab = styled('button', ({
|
|
|
139
148
|
});
|
|
140
149
|
StyledTab.displayName = "StyledTab";
|
|
141
150
|
StyledTab.displayName = 'StyledTab';
|
|
151
|
+
export const StyledEndEnhancerContainer = styled('div', ({
|
|
152
|
+
$theme
|
|
153
|
+
}) => {
|
|
154
|
+
const marginDirection = $theme.direction === 'rtl' ? 'marginRight' : 'marginLeft';
|
|
155
|
+
return {
|
|
156
|
+
display: 'flex',
|
|
157
|
+
alignItems: 'center',
|
|
158
|
+
justifyContent: 'flex-end',
|
|
159
|
+
[marginDirection]: $theme.sizing.scale600
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
StyledEndEnhancerContainer.displayName = "StyledEndEnhancerContainer";
|
|
163
|
+
StyledEndEnhancerContainer.displayName = 'StyledEndEnhancerContainer';
|
|
142
164
|
export const StyledArtworkContainer = styled('div', ({
|
|
143
165
|
$theme,
|
|
144
166
|
$orientation = ORIENTATION.horizontal
|
package/es/tabs-motion/tabs.js
CHANGED
|
@@ -9,12 +9,13 @@ LICENSE file in the root directory of this source tree.
|
|
|
9
9
|
|
|
10
10
|
/* global window */
|
|
11
11
|
import * as React from 'react';
|
|
12
|
+
import * as ReactIs from 'react-is';
|
|
12
13
|
import { useUID } from 'react-uid';
|
|
13
14
|
import { useStyletron } from '../styles';
|
|
14
15
|
import { getOverrides } from '../helpers/overrides';
|
|
15
16
|
import { isFocusVisible, forkFocus, forkBlur } from '../utils/focusVisible';
|
|
16
17
|
import { ORIENTATION, FILL } from './constants';
|
|
17
|
-
import { StyledRoot, StyledTabList, StyledTab, StyledArtworkContainer, StyledTabHighlight, StyledTabBorder, StyledTabPanel } from './styled-components';
|
|
18
|
+
import { StyledRoot, StyledTabList, StyledTab, StyledArtworkContainer, StyledTabHighlight, StyledTabBorder, StyledTabPanel, StyledEndEnhancerContainer, StyledTabBar } from './styled-components';
|
|
18
19
|
import { getTabId, getTabPanelId, isVertical, isHorizontal, isRTL } from './utils';
|
|
19
20
|
const KEYBOARD_ACTION = {
|
|
20
21
|
next: 'next',
|
|
@@ -78,6 +79,20 @@ const scrollParentToCentreTarget = targetNode => {
|
|
|
78
79
|
targetNode.parentNode.scroll(target.x, target.y);
|
|
79
80
|
};
|
|
80
81
|
|
|
82
|
+
function RenderEnhancer({
|
|
83
|
+
Enhancer
|
|
84
|
+
}) {
|
|
85
|
+
if (typeof Enhancer === 'string') {
|
|
86
|
+
return Enhancer;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (ReactIs.isValidElementType(Enhancer)) {
|
|
90
|
+
return /*#__PURE__*/React.createElement(Enhancer, null);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return Enhancer;
|
|
94
|
+
}
|
|
95
|
+
|
|
81
96
|
export function Tabs({
|
|
82
97
|
activeKey = '0',
|
|
83
98
|
disabled = false,
|
|
@@ -88,7 +103,8 @@ export function Tabs({
|
|
|
88
103
|
orientation = ORIENTATION.horizontal,
|
|
89
104
|
overrides = {},
|
|
90
105
|
renderAll = false,
|
|
91
|
-
uid: customUid = null
|
|
106
|
+
uid: customUid = null,
|
|
107
|
+
endEnhancer
|
|
92
108
|
}) {
|
|
93
109
|
// Create unique id prefix for this tabs component
|
|
94
110
|
const generatedUid = useUID();
|
|
@@ -103,7 +119,8 @@ export function Tabs({
|
|
|
103
119
|
const [Root, RootProps] = getOverrides(RootOverrides, StyledRoot);
|
|
104
120
|
const [TabList, TabListProps] = getOverrides(TabListOverrides, StyledTabList);
|
|
105
121
|
const [TabHighlight, TabHighlightProps] = getOverrides(TabHighlightOverrides, StyledTabHighlight);
|
|
106
|
-
const [TabBorder, TabBorderProps] = getOverrides(TabBorderOverrides, StyledTabBorder);
|
|
122
|
+
const [TabBorder, TabBorderProps] = getOverrides(TabBorderOverrides, StyledTabBorder);
|
|
123
|
+
const [EndEnhancerContainer, endEnhancerContainerProps] = getOverrides(overrides.EndEnhancerContainer, StyledEndEnhancerContainer); // Count key updates
|
|
107
124
|
// We disable a few things until after first mount:
|
|
108
125
|
// - the highlight animation, avoiding an initial slide-in
|
|
109
126
|
// - smooth scrolling active tab into view
|
|
@@ -196,7 +213,10 @@ export function Tabs({
|
|
|
196
213
|
}
|
|
197
214
|
}
|
|
198
215
|
}, [orientation, theme.direction]);
|
|
199
|
-
return /*#__PURE__*/React.createElement(Root, _extends({}, sharedStylingProps, RootProps), /*#__PURE__*/React.createElement(
|
|
216
|
+
return /*#__PURE__*/React.createElement(Root, _extends({}, sharedStylingProps, RootProps), /*#__PURE__*/React.createElement(StyledTabBar, {
|
|
217
|
+
$hasEndEnhancer: Boolean(endEnhancer),
|
|
218
|
+
$orientation: orientation
|
|
219
|
+
}, /*#__PURE__*/React.createElement(TabList, _extends({
|
|
200
220
|
"data-baseweb": "tab-list",
|
|
201
221
|
role: "tablist",
|
|
202
222
|
"aria-orientation": orientation
|
|
@@ -224,7 +244,11 @@ export function Tabs({
|
|
|
224
244
|
$animate: keyUpdated > 1,
|
|
225
245
|
"aria-hidden": "true",
|
|
226
246
|
role: "presentation"
|
|
227
|
-
}, sharedStylingProps, TabHighlightProps))), /*#__PURE__*/React.createElement(
|
|
247
|
+
}, sharedStylingProps, TabHighlightProps))), orientation === ORIENTATION.horizontal && endEnhancer !== null && endEnhancer !== undefined && /*#__PURE__*/React.createElement(EndEnhancerContainer, _extends({}, endEnhancerContainerProps, {
|
|
248
|
+
$orientation: orientation
|
|
249
|
+
}), /*#__PURE__*/React.createElement(RenderEnhancer, {
|
|
250
|
+
Enhancer: endEnhancer
|
|
251
|
+
}))), /*#__PURE__*/React.createElement(TabBorder, _extends({
|
|
228
252
|
"data-baseweb": "tab-border",
|
|
229
253
|
"aria-hidden": "true",
|
|
230
254
|
role: "presentation"
|
|
@@ -22,19 +22,19 @@ function getColorStyles(_ref) {
|
|
|
22
22
|
$hierarchy = _ref.$hierarchy,
|
|
23
23
|
$color = _ref.$color;
|
|
24
24
|
var COLOR_STYLES = (_COLOR_STYLES = {}, _defineProperty(_COLOR_STYLES, HIERARCHY.primary, (_HIERARCHY$primary = {}, _defineProperty(_HIERARCHY$primary, COLOR.accent, {
|
|
25
|
-
color: $theme.colors.
|
|
25
|
+
color: $theme.colors.contentOnColor,
|
|
26
26
|
backgroundColor: $theme.colors.backgroundAccent
|
|
27
27
|
}), _defineProperty(_HIERARCHY$primary, COLOR.primary, {
|
|
28
28
|
color: $theme.colors.contentInversePrimary,
|
|
29
29
|
backgroundColor: $theme.colors.backgroundInversePrimary
|
|
30
30
|
}), _defineProperty(_HIERARCHY$primary, COLOR.positive, {
|
|
31
|
-
color: $theme.colors.
|
|
31
|
+
color: $theme.colors.contentOnColor,
|
|
32
32
|
backgroundColor: $theme.colors.backgroundPositive
|
|
33
33
|
}), _defineProperty(_HIERARCHY$primary, COLOR.negative, {
|
|
34
|
-
color: $theme.colors.
|
|
34
|
+
color: $theme.colors.contentOnColor,
|
|
35
35
|
backgroundColor: $theme.colors.backgroundNegative
|
|
36
36
|
}), _defineProperty(_HIERARCHY$primary, COLOR.warning, {
|
|
37
|
-
color: $theme.colors.
|
|
37
|
+
color: $theme.colors.contentOnColorInverse,
|
|
38
38
|
backgroundColor: $theme.colors.backgroundWarning
|
|
39
39
|
}), _HIERARCHY$primary)), _defineProperty(_COLOR_STYLES, HIERARCHY.secondary, (_HIERARCHY$secondary = {}, _defineProperty(_HIERARCHY$secondary, COLOR.accent, {
|
|
40
40
|
color: $theme.colors.contentAccent,
|