baseui 0.0.0-next-7c7b20c → 0.0.0-next-699f2d6
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/a11y/a11y.js.flow +2 -2
- package/accordion/panel.js.flow +1 -1
- package/accordion/stateful-panel-container.js.flow +1 -1
- package/accordion/stateful-panel.js.flow +1 -1
- package/accordion/stateless-accordion.js.flow +1 -1
- package/accordion/styled-components.js.flow +6 -6
- package/accordion/types.js.flow +4 -3
- package/app-nav-bar/app-nav-bar.js.flow +2 -2
- package/app-nav-bar/mobile-menu.js +3 -1
- package/app-nav-bar/mobile-menu.js.flow +3 -1
- package/app-nav-bar/styled-components.js.flow +3 -3
- package/app-nav-bar/types.js.flow +4 -4
- package/app-nav-bar/user-menu.js +4 -1
- package/app-nav-bar/user-menu.js.flow +5 -2
- package/app-nav-bar/user-profile-tile.js.flow +15 -21
- package/app-nav-bar/utils.js.flow +5 -5
- package/avatar/avatar.js.flow +2 -5
- package/avatar/styled-components.js.flow +3 -3
- package/block/styled-components.js.flow +12 -12
- package/breadcrumbs/breadcrumbs.js.flow +2 -2
- package/button/button.js.flow +5 -7
- package/button-group/button-group.js.flow +3 -3
- package/button-group/stateful-container.js.flow +1 -1
- package/card/card.js.flow +1 -1
- package/checkbox/checkbox.js.flow +2 -2
- package/checkbox/stateful-checkbox.js.flow +1 -1
- package/checkbox/styled-components.js.flow +6 -6
- package/combobox/combobox.js.flow +2 -2
- package/combobox/types.js.flow +1 -1
- package/data-table/column-anchor.js.flow +3 -3
- package/data-table/column-boolean.js.flow +8 -8
- package/data-table/column-categorical.js.flow +9 -9
- package/data-table/column-custom.js.flow +1 -1
- package/data-table/column-datetime.js.flow +20 -20
- package/data-table/column-numerical.js.flow +9 -9
- package/data-table/column-string.js.flow +4 -4
- package/data-table/column.js +1 -0
- package/data-table/column.js.flow +1 -0
- package/data-table/data-table.js.flow +34 -32
- package/data-table/filter-menu.js.flow +10 -10
- package/data-table/filter-shell.js.flow +1 -1
- package/data-table/header-cell.js.flow +6 -6
- package/data-table/index.js.flow +2 -6
- package/data-table/measure-column-widths.js.flow +1 -1
- package/data-table/stateful-container.js.flow +5 -6
- package/data-table/stateful-data-table.js.flow +7 -7
- package/data-table/types.js.flow +4 -4
- package/datepicker/calendar-header.js.flow +19 -21
- package/datepicker/calendar.js.flow +15 -15
- package/datepicker/datepicker.js.flow +34 -34
- package/datepicker/day.js.flow +3 -3
- package/datepicker/month.js.flow +1 -1
- package/datepicker/stateful-calendar.js.flow +1 -1
- package/datepicker/stateful-container.js.flow +2 -2
- package/datepicker/stateful-datepicker.js.flow +1 -1
- package/datepicker/styled-components.js.flow +54 -48
- package/datepicker/types.js.flow +3 -3
- package/datepicker/utils/calendar-header-helpers.js.flow +4 -4
- package/datepicker/utils/date-helpers.js.flow +40 -42
- package/datepicker/utils/index.js.flow +1 -1
- package/dnd-list/list.js.flow +1 -1
- package/dnd-list/stateful-list-container.js.flow +1 -1
- package/dnd-list/stateful-list.js.flow +1 -1
- package/drawer/drawer.js.flow +1 -1
- package/drawer/styled-components.js.flow +5 -5
- package/es/app-nav-bar/mobile-menu.js +3 -1
- package/es/app-nav-bar/user-menu.js +4 -1
- package/es/data-table/column.js +1 -0
- package/es/flex-grid/flex-grid.js +1 -0
- package/es/input/masked-input.js +1 -0
- package/es/modal/modal-button.js +1 -0
- package/es/phone-input/base-country-picker.js +1 -0
- package/es/phone-input/country-select-dropdown.js +2 -1
- package/es/snackbar/snackbar-element.js +1 -0
- package/es/styles/__mocks__/styled.js +1 -0
- package/es/styles/styled.js +2 -0
- package/es/utils/deprecated-component.js +1 -1
- package/esm/app-nav-bar/mobile-menu.js +3 -1
- package/esm/app-nav-bar/user-menu.js +4 -1
- package/esm/data-table/column.js +1 -0
- package/esm/flex-grid/flex-grid.js +1 -0
- package/esm/input/masked-input.js +1 -0
- package/esm/modal/modal-button.js +1 -0
- package/esm/phone-input/base-country-picker.js +1 -0
- package/esm/phone-input/country-select-dropdown.js +2 -1
- package/esm/snackbar/snackbar-element.js +1 -0
- package/esm/styles/__mocks__/styled.js +1 -0
- package/esm/styles/styled.js +2 -0
- package/esm/utils/deprecated-component.js +1 -1
- package/file-uploader/file-uploader.js.flow +5 -3
- package/file-uploader/styled-components.js.flow +3 -3
- package/flex-grid/flex-grid-item.js.flow +8 -7
- package/flex-grid/flex-grid.js +1 -0
- package/flex-grid/flex-grid.js.flow +20 -17
- package/form-control/form-control.js.flow +1 -1
- package/form-control/styled-components.js.flow +3 -3
- package/header-navigation/styled-components.js.flow +3 -3
- package/heading/heading-level.js.flow +1 -1
- package/heading/heading.js.flow +1 -1
- package/helper/stateful-helper.js.flow +1 -1
- package/helper/styled-components.js.flow +2 -2
- package/helpers/responsive-helpers.js.flow +1 -1
- package/icon/build-icons.js.flow +6 -12
- package/input/base-input.js.flow +2 -2
- package/input/masked-input.js +1 -0
- package/input/masked-input.js.flow +2 -1
- package/input/styled-components.js.flow +1 -1
- package/layer/layers-manager.js.flow +10 -12
- package/layout-grid/styled-components.js.flow +24 -15
- package/link/index.js.flow +2 -2
- package/list/types.js.flow +2 -2
- package/map-marker/fixed-marker.js.flow +2 -4
- package/map-marker/floating-marker.js.flow +10 -14
- package/map-marker/pin-head.js.flow +1 -1
- package/menu/maybe-child-menu.js.flow +1 -1
- package/menu/menu.js.flow +2 -2
- package/menu/nested-menus.js.flow +8 -9
- package/menu/option-list.js.flow +3 -3
- package/menu/stateful-container.js.flow +3 -5
- package/menu/stateful-menu.js.flow +2 -2
- package/menu/styled-components.js.flow +5 -5
- package/menu/types.js.flow +3 -5
- package/modal/modal-button.js +1 -0
- package/modal/modal-button.js.flow +1 -0
- package/modal/modal.js.flow +1 -1
- package/modal/styled-components.js.flow +9 -19
- package/package.json +12 -12
- package/pagination/pagination.js.flow +2 -2
- package/pagination/stateful-pagination.js.flow +1 -1
- package/payment-card/payment-card.js.flow +3 -3
- package/payment-card/styled-components.js.flow +1 -1
- package/phone-input/base-country-picker.js +2 -0
- package/phone-input/base-country-picker.js.flow +3 -2
- package/phone-input/country-select-dropdown.js +2 -1
- package/phone-input/country-select-dropdown.js.flow +4 -4
- package/phone-input/country-select.js.flow +1 -1
- package/phone-input/index.js.flow +2 -6
- package/phone-input/styled-components.js.flow +3 -3
- package/phone-input/types.js.flow +1 -1
- package/phone-input/utils.js.flow +1 -1
- package/pin-code/index.js.flow +1 -3
- package/pin-code/pin-code.js.flow +2 -2
- package/pin-code/types.js.flow +2 -2
- package/popover/popover.js.flow +1 -1
- package/popover/stateful-container.js.flow +1 -1
- package/popover/stateful-popover.js.flow +1 -1
- package/popover/utils.js.flow +1 -1
- package/progress-bar/styled-components.js.flow +18 -18
- package/radio/radio.js.flow +2 -2
- package/radio/stateful-radiogroup.js.flow +1 -1
- package/radio/styled-components.js.flow +6 -6
- package/rating/emoticon-rating.js.flow +2 -2
- package/rating/star-rating.js.flow +2 -2
- package/select/dropdown.js.flow +6 -14
- package/select/index.js.flow +1 -3
- package/select/select-component.js.flow +13 -13
- package/select/styled-components.js.flow +74 -65
- package/select/types.js.flow +2 -2
- package/select/utils/default-filter-options.js.flow +3 -3
- package/select/utils/index.js.flow +1 -1
- package/side-navigation/nav-item.js.flow +2 -6
- package/side-navigation/nav.js.flow +3 -9
- package/side-navigation/stateful-nav.js.flow +1 -1
- package/side-navigation/styled-components.js.flow +3 -3
- package/side-navigation/types.js.flow +2 -2
- package/skeleton/styled-components.js.flow +2 -2
- package/slider/slider.js.flow +3 -3
- package/slider/stateful-slider.js.flow +1 -1
- package/slider/styled-components.js.flow +8 -8
- package/snackbar/snackbar-context.js.flow +3 -3
- package/snackbar/snackbar-element.js +1 -0
- package/snackbar/snackbar-element.js.flow +6 -7
- package/spinner/styled-components.js.flow +3 -3
- package/styles/__mocks__/styled.js +1 -0
- package/styles/styled.js +2 -0
- package/styles/styled.js.flow +12 -11
- package/styles/theme-provider.js.flow +2 -3
- package/styles/util.js.flow +1 -1
- package/table/styled-components.js.flow +7 -7
- package/table-grid/styled-components.js.flow +3 -3
- package/table-semantic/table-builder.js.flow +3 -8
- package/tabs/styled-components.js.flow +4 -4
- package/tabs-motion/stateful-tabs.js.flow +1 -1
- package/tabs-motion/tabs.js.flow +8 -10
- package/tag/styled-components.js.flow +4 -4
- package/tag/tag.js.flow +4 -4
- package/tag/utils.js.flow +4 -2
- package/textarea/styled-components.js.flow +9 -6
- package/timepicker/timepicker.js.flow +4 -4
- package/timezonepicker/timezone-picker.js.flow +5 -5
- package/timezonepicker/types.js.flow +1 -1
- package/toast/styled-components.js.flow +3 -3
- package/toast/toast.js.flow +3 -3
- package/toast/toaster.js.flow +12 -12
- package/tooltip/stateful-tooltip.js.flow +1 -1
- package/tooltip/styled-components.js.flow +3 -3
- package/tree-view/stateful-container.js.flow +2 -2
- package/tree-view/stateful-tree-view.js.flow +1 -1
- package/tree-view/tree-label-interactable.js.flow +2 -2
- package/tree-view/tree-label.js.flow +1 -1
- package/tree-view/tree-view.js.flow +3 -3
- package/tree-view/utils.js.flow +1 -1
- package/utils/deprecated-component.js +1 -1
- package/utils/deprecated-component.js.flow +2 -2
- package/utils/focusVisible.js.flow +25 -21
package/a11y/a11y.js.flow
CHANGED
|
@@ -28,7 +28,7 @@ function validateNode(node) {
|
|
|
28
28
|
|
|
29
29
|
function segmentViolationsByNode(violations) {
|
|
30
30
|
const nodes = violations.reduce((map, violation) => {
|
|
31
|
-
violation.nodes.forEach(node => {
|
|
31
|
+
violation.nodes.forEach((node) => {
|
|
32
32
|
if (!map[node.target]) {
|
|
33
33
|
map[node.target] = [violation];
|
|
34
34
|
} else {
|
|
@@ -93,7 +93,7 @@ function Violation(props: ViolationPropsT) {
|
|
|
93
93
|
<TetherBehavior
|
|
94
94
|
anchorRef={anchor}
|
|
95
95
|
popperRef={popper}
|
|
96
|
-
onPopperUpdate={update => setOffset(update.popper)}
|
|
96
|
+
onPopperUpdate={(update) => setOffset(update.popper)}
|
|
97
97
|
placement={TETHER_PLACEMENT.bottom}
|
|
98
98
|
>
|
|
99
99
|
<ViolationContainer
|
package/accordion/panel.js.flow
CHANGED
|
@@ -43,7 +43,7 @@ class StatefulPanelContainer extends React.Component<
|
|
|
43
43
|
|
|
44
44
|
internalSetState(type: StateChangeTypeT, changes: PanelStateT) {
|
|
45
45
|
const {stateReducer} = this.props;
|
|
46
|
-
this.setState(prevState =>
|
|
46
|
+
this.setState((prevState) =>
|
|
47
47
|
stateReducer ? stateReducer(type, changes, prevState) : changes,
|
|
48
48
|
);
|
|
49
49
|
}
|
|
@@ -14,7 +14,7 @@ export default function StatefulPanel(props: StatefulPanelPropsT) {
|
|
|
14
14
|
const {children, ...restProps} = props;
|
|
15
15
|
return (
|
|
16
16
|
<StatefulContainer {...restProps}>
|
|
17
|
-
{componentProps => <Panel {...componentProps}>{children}</Panel>}
|
|
17
|
+
{(componentProps) => <Panel {...componentProps}>{children}</Panel>}
|
|
18
18
|
</StatefulContainer>
|
|
19
19
|
);
|
|
20
20
|
}
|
|
@@ -21,7 +21,7 @@ export const Root = styled('ul', {
|
|
|
21
21
|
width: '100%',
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
-
export const PanelContainer = styled<SharedStylePropsArgT>('li', props => {
|
|
24
|
+
export const PanelContainer = styled<SharedStylePropsArgT>('li', (props) => {
|
|
25
25
|
const {
|
|
26
26
|
$expanded,
|
|
27
27
|
$theme: {colors},
|
|
@@ -35,7 +35,7 @@ export const PanelContainer = styled<SharedStylePropsArgT>('li', props => {
|
|
|
35
35
|
};
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
export const Header = styled<SharedStylePropsArgT>('div', props => {
|
|
38
|
+
export const Header = styled<SharedStylePropsArgT>('div', (props) => {
|
|
39
39
|
const {
|
|
40
40
|
$disabled,
|
|
41
41
|
$isFocusVisible,
|
|
@@ -65,7 +65,7 @@ export const Header = styled<SharedStylePropsArgT>('div', props => {
|
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
export const ToggleIcon = styled<SharedStylePropsArgT>('svg', props => {
|
|
68
|
+
export const ToggleIcon = styled<SharedStylePropsArgT>('svg', (props) => {
|
|
69
69
|
const {$theme, $disabled, $color} = props;
|
|
70
70
|
return {
|
|
71
71
|
...getSvgStyles(props),
|
|
@@ -75,7 +75,7 @@ export const ToggleIcon = styled<SharedStylePropsArgT>('svg', props => {
|
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
export const ToggleIconGroup = styled<SharedStylePropsArgT>('g', props => {
|
|
78
|
+
export const ToggleIconGroup = styled<SharedStylePropsArgT>('g', (props) => {
|
|
79
79
|
const {$theme, $expanded} = props;
|
|
80
80
|
return {
|
|
81
81
|
transform: $expanded ? 'rotate(0)' : 'rotate(-90deg)',
|
|
@@ -86,7 +86,7 @@ export const ToggleIconGroup = styled<SharedStylePropsArgT>('g', props => {
|
|
|
86
86
|
};
|
|
87
87
|
});
|
|
88
88
|
|
|
89
|
-
export const Content = styled<SharedStylePropsArgT>('div', props => {
|
|
89
|
+
export const Content = styled<SharedStylePropsArgT>('div', (props) => {
|
|
90
90
|
const {
|
|
91
91
|
$theme: {animation, colors, sizing, typography},
|
|
92
92
|
$expanded,
|
|
@@ -116,7 +116,7 @@ export const Content = styled<SharedStylePropsArgT>('div', props => {
|
|
|
116
116
|
|
|
117
117
|
export const ContentAnimationContainer = styled<
|
|
118
118
|
{$height: string | number} & SharedStylePropsArgT,
|
|
119
|
-
>('div', props => {
|
|
119
|
+
>('div', (props) => {
|
|
120
120
|
const {
|
|
121
121
|
$height,
|
|
122
122
|
$theme: {animation},
|
package/accordion/types.js.flow
CHANGED
|
@@ -166,9 +166,10 @@ type SharedStatefulPanelContainerPropsT = {
|
|
|
166
166
|
onChange?: OnChangeHandlerT,
|
|
167
167
|
stateReducer?: PanelStateReducerT,
|
|
168
168
|
};
|
|
169
|
-
export type StatefulPanelContainerPropsT =
|
|
170
|
-
|
|
171
|
-
}
|
|
169
|
+
export type StatefulPanelContainerPropsT =
|
|
170
|
+
SharedStatefulPanelContainerPropsT & {
|
|
171
|
+
children: (props: $Diff<PanelPropsT, {children: React.Node}>) => React.Node,
|
|
172
|
+
};
|
|
172
173
|
|
|
173
174
|
// Props for stateful panel
|
|
174
175
|
export type StatefulPanelPropsT = SharedStatefulPanelContainerPropsT &
|
|
@@ -129,8 +129,8 @@ export default function AppNavBar(props: AppNavBarPropsT) {
|
|
|
129
129
|
const {
|
|
130
130
|
title,
|
|
131
131
|
mapItemToNode = defaultMapItemToNode,
|
|
132
|
-
onMainItemSelect = item => {},
|
|
133
|
-
onUserItemSelect = item => {},
|
|
132
|
+
onMainItemSelect = (item) => {},
|
|
133
|
+
onUserItemSelect = (item) => {},
|
|
134
134
|
overrides = {},
|
|
135
135
|
userItems = [],
|
|
136
136
|
username,
|
|
@@ -69,7 +69,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
69
69
|
|
|
70
70
|
var USER_TITLE_ITEM = 'USER_TITLE_ITEM';
|
|
71
71
|
var USER_MENU_ITEM = 'USER_MENU_ITEM';
|
|
72
|
-
var PARENT_MENU_ITEM = 'PARENT_MENU_ITEM';
|
|
72
|
+
var PARENT_MENU_ITEM = 'PARENT_MENU_ITEM'; // eslint-disable-next-line react/display-name
|
|
73
|
+
|
|
73
74
|
var MobileNavMenuItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
74
75
|
var item = props.item,
|
|
75
76
|
_props$mapItemToNode = props.mapItemToNode,
|
|
@@ -200,6 +201,7 @@ function MobileMenu(props) {
|
|
|
200
201
|
boxShadow: 'none'
|
|
201
202
|
}
|
|
202
203
|
},
|
|
204
|
+
// eslint-disable-next-line react/display-name
|
|
203
205
|
ListItem: /*#__PURE__*/React.forwardRef(function (listItemProps, ref) {
|
|
204
206
|
return /*#__PURE__*/React.createElement(MobileNavMenuItem, _extends({
|
|
205
207
|
ref: ref
|
|
@@ -28,6 +28,7 @@ const USER_TITLE_ITEM = 'USER_TITLE_ITEM';
|
|
|
28
28
|
const USER_MENU_ITEM = 'USER_MENU_ITEM';
|
|
29
29
|
const PARENT_MENU_ITEM = 'PARENT_MENU_ITEM';
|
|
30
30
|
|
|
31
|
+
// eslint-disable-next-line react/display-name
|
|
31
32
|
const MobileNavMenuItem = React.forwardRef((props, ref) => {
|
|
32
33
|
const {
|
|
33
34
|
item,
|
|
@@ -94,7 +95,7 @@ export default function MobileMenu(props: AppNavBarPropsT) {
|
|
|
94
95
|
item: {...rest},
|
|
95
96
|
label: props.username,
|
|
96
97
|
[USER_TITLE_ITEM]: true,
|
|
97
|
-
children: userItems.map(item => {
|
|
98
|
+
children: userItems.map((item) => {
|
|
98
99
|
return {
|
|
99
100
|
...item,
|
|
100
101
|
[USER_MENU_ITEM]: true,
|
|
@@ -164,6 +165,7 @@ export default function MobileMenu(props: AppNavBarPropsT) {
|
|
|
164
165
|
boxShadow: 'none',
|
|
165
166
|
},
|
|
166
167
|
},
|
|
168
|
+
// eslint-disable-next-line react/display-name
|
|
167
169
|
ListItem: React.forwardRef((listItemProps, ref) => {
|
|
168
170
|
return (
|
|
169
171
|
<MobileNavMenuItem
|
|
@@ -40,7 +40,7 @@ const StyledButton = styled<{$isFocusVisible: boolean}>(
|
|
|
40
40
|
}),
|
|
41
41
|
);
|
|
42
42
|
|
|
43
|
-
export const StyledRoot = styled<{}>('div', props => {
|
|
43
|
+
export const StyledRoot = styled<{}>('div', (props) => {
|
|
44
44
|
const {$theme} = props;
|
|
45
45
|
return {
|
|
46
46
|
...$theme.typography.font300,
|
|
@@ -58,7 +58,7 @@ export const StyledSubnavContainer = styled<{}>('div', ({$theme}) => {
|
|
|
58
58
|
};
|
|
59
59
|
});
|
|
60
60
|
|
|
61
|
-
export const StyledSpacing = styled<{}>('div', props => {
|
|
61
|
+
export const StyledSpacing = styled<{}>('div', (props) => {
|
|
62
62
|
const {$theme} = props;
|
|
63
63
|
return {
|
|
64
64
|
boxSizing: 'border-box',
|
|
@@ -112,7 +112,7 @@ export const StyledMainMenuItem = styled<{
|
|
|
112
112
|
$active?: boolean,
|
|
113
113
|
$isFocusVisible: boolean,
|
|
114
114
|
$kind: $Values<typeof KIND>,
|
|
115
|
-
}>('div', props => {
|
|
115
|
+
}>('div', (props) => {
|
|
116
116
|
const {
|
|
117
117
|
$active,
|
|
118
118
|
$isFocusVisible,
|
|
@@ -54,15 +54,15 @@ export type UserMenuPropsT = {|
|
|
|
54
54
|
username?: string,
|
|
55
55
|
usernameSubtitle?: React.Node,
|
|
56
56
|
userImgUrl?: string,
|
|
57
|
-
onUserItemSelect?: NavItemT => mixed,
|
|
57
|
+
onUserItemSelect?: (NavItemT) => mixed,
|
|
58
58
|
|};
|
|
59
59
|
|
|
60
60
|
export type AppNavBarPropsT = {|
|
|
61
61
|
...UserMenuPropsT,
|
|
62
|
-
isMainItemActive?: NavItemT => boolean,
|
|
62
|
+
isMainItemActive?: (NavItemT) => boolean,
|
|
63
63
|
mainItems?: NavItemT[],
|
|
64
|
-
mapItemToNode?: NavItemT => React.Node,
|
|
65
|
-
onMainItemSelect?: NavItemT => mixed,
|
|
64
|
+
mapItemToNode?: (NavItemT) => React.Node,
|
|
65
|
+
onMainItemSelect?: (NavItemT) => mixed,
|
|
66
66
|
overrides?: OverridesT,
|
|
67
67
|
title?: React.Node,
|
|
68
68
|
|};
|
package/app-nav-bar/user-menu.js
CHANGED
|
@@ -55,7 +55,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
55
55
|
|
|
56
56
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
57
57
|
|
|
58
|
-
var MENU_ITEM_WIDTH = '275px';
|
|
58
|
+
var MENU_ITEM_WIDTH = '275px'; // eslint-disable-next-line react/display-name
|
|
59
|
+
|
|
59
60
|
var UserMenuListItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
60
61
|
var item = props.item,
|
|
61
62
|
_props$mapItemToNode = props.mapItemToNode,
|
|
@@ -115,6 +116,7 @@ function UserMenuComponent(props) {
|
|
|
115
116
|
|
|
116
117
|
userMenuProps.overrides = (0, _overrides.mergeOverrides)({
|
|
117
118
|
List: {
|
|
119
|
+
// eslint-disable-next-line react/display-name
|
|
118
120
|
component: /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
119
121
|
var children = _ref2.children,
|
|
120
122
|
restProps = _objectWithoutProperties(_ref2, ["children"]);
|
|
@@ -132,6 +134,7 @@ function UserMenuComponent(props) {
|
|
|
132
134
|
width: MENU_ITEM_WIDTH
|
|
133
135
|
}
|
|
134
136
|
},
|
|
137
|
+
// eslint-disable-next-line react/display-name
|
|
135
138
|
ListItem: /*#__PURE__*/React.forwardRef(function (listItemProps, ref) {
|
|
136
139
|
return /*#__PURE__*/React.createElement(UserMenuListItem, _extends({
|
|
137
140
|
ref: ref
|
|
@@ -27,6 +27,7 @@ import {defaultMapItemToNode} from './utils.js';
|
|
|
27
27
|
|
|
28
28
|
const MENU_ITEM_WIDTH = '275px';
|
|
29
29
|
|
|
30
|
+
// eslint-disable-next-line react/display-name
|
|
30
31
|
const UserMenuListItem = React.forwardRef((props, ref) => {
|
|
31
32
|
const {item, mapItemToNode = defaultMapItemToNode} = props;
|
|
32
33
|
// Replace with a user menu item renderer
|
|
@@ -46,8 +47,8 @@ const svgStyleOverride = ({$theme}) => ({paddingLeft: $theme.sizing.scale200});
|
|
|
46
47
|
|
|
47
48
|
export default function UserMenuComponent(props: {|
|
|
48
49
|
...UserMenuPropsT,
|
|
49
|
-
mapItemToNode: NavItemT => React.Node,
|
|
50
|
-
onItemSelect: NavItemT => mixed,
|
|
50
|
+
mapItemToNode: (NavItemT) => React.Node,
|
|
51
|
+
onItemSelect: (NavItemT) => mixed,
|
|
51
52
|
overrides: OverridesT,
|
|
52
53
|
|}) {
|
|
53
54
|
// isOpen is used for displaying different arrow icons in open or closed state
|
|
@@ -78,6 +79,7 @@ export default function UserMenuComponent(props: {|
|
|
|
78
79
|
userMenuProps.overrides = mergeOverrides(
|
|
79
80
|
{
|
|
80
81
|
List: {
|
|
82
|
+
// eslint-disable-next-line react/display-name
|
|
81
83
|
component: React.forwardRef(({children, ...restProps}, ref) => (
|
|
82
84
|
<StyledList {...restProps} ref={ref}>
|
|
83
85
|
<UserMenuProfileListItem {...userMenuProfileListItemProps}>
|
|
@@ -94,6 +96,7 @@ export default function UserMenuComponent(props: {|
|
|
|
94
96
|
)),
|
|
95
97
|
style: {width: MENU_ITEM_WIDTH},
|
|
96
98
|
},
|
|
99
|
+
// eslint-disable-next-line react/display-name
|
|
97
100
|
ListItem: React.forwardRef((listItemProps, ref) => {
|
|
98
101
|
return (
|
|
99
102
|
<UserMenuListItem
|
|
@@ -24,29 +24,23 @@ export default function UserProfileTile(props: {|
|
|
|
24
24
|
|}) {
|
|
25
25
|
const {overrides = {}, username, usernameSubtitle, userImgUrl} = props;
|
|
26
26
|
|
|
27
|
-
const [
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
StyledUserProfileTileContainer,
|
|
33
|
-
);
|
|
27
|
+
const [UserProfileTileContainer, userProfileTileContainerProps] =
|
|
28
|
+
getOverrides(
|
|
29
|
+
overrides.UserProfileTileContainer,
|
|
30
|
+
StyledUserProfileTileContainer,
|
|
31
|
+
);
|
|
34
32
|
|
|
35
|
-
const [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
StyledUserProfilePictureContainer,
|
|
41
|
-
);
|
|
33
|
+
const [UserProfilePictureContainer, userProfilePictureContainerProps] =
|
|
34
|
+
getOverrides(
|
|
35
|
+
overrides.UserProfilePictureContainer,
|
|
36
|
+
StyledUserProfilePictureContainer,
|
|
37
|
+
);
|
|
42
38
|
|
|
43
|
-
const [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
StyledUserProfileInfoContainer,
|
|
49
|
-
);
|
|
39
|
+
const [UserProfileInfoContainer, userProfileInfoContainerProps] =
|
|
40
|
+
getOverrides(
|
|
41
|
+
overrides.UserProfileInfoContainer,
|
|
42
|
+
StyledUserProfileInfoContainer,
|
|
43
|
+
);
|
|
50
44
|
|
|
51
45
|
return (
|
|
52
46
|
// Replace with a profile tile renderer: renderUserProfileTile()
|
|
@@ -9,7 +9,7 @@ LICENSE file in the root directory of this source tree.
|
|
|
9
9
|
|
|
10
10
|
import type {NavItemT} from './types.js';
|
|
11
11
|
|
|
12
|
-
type GetUniqueIdentifierT = NavItemT => string | number;
|
|
12
|
+
type GetUniqueIdentifierT = (NavItemT) => string | number;
|
|
13
13
|
|
|
14
14
|
export function defaultMapItemToNode(item: NavItemT) {
|
|
15
15
|
if (__DEV__) {
|
|
@@ -35,9 +35,9 @@ function defaultGetUniqueIdentifier(item: NavItemT) {
|
|
|
35
35
|
|
|
36
36
|
export function mapItemsActive(
|
|
37
37
|
items: NavItemT[],
|
|
38
|
-
predicate: NavItemT => boolean,
|
|
38
|
+
predicate: (NavItemT) => boolean,
|
|
39
39
|
) {
|
|
40
|
-
return items.map<NavItemT>(current => {
|
|
40
|
+
return items.map<NavItemT>((current) => {
|
|
41
41
|
if (predicate(current)) {
|
|
42
42
|
current.active = true;
|
|
43
43
|
} else {
|
|
@@ -46,7 +46,7 @@ export function mapItemsActive(
|
|
|
46
46
|
|
|
47
47
|
if (current.children) {
|
|
48
48
|
current.children = mapItemsActive(current.children, predicate);
|
|
49
|
-
if (current.children.some(child => child.active)) {
|
|
49
|
+
if (current.children.some((child) => child.active)) {
|
|
50
50
|
current.active = true;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -62,7 +62,7 @@ export function setItemActive(
|
|
|
62
62
|
) {
|
|
63
63
|
return mapItemsActive(
|
|
64
64
|
items,
|
|
65
|
-
current => getUniqueIdentifier(current) === getUniqueIdentifier(item),
|
|
65
|
+
(current) => getUniqueIdentifier(current) === getUniqueIdentifier(item),
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
|
package/avatar/avatar.js.flow
CHANGED
|
@@ -19,11 +19,8 @@ import type {PropsT} from './types.js';
|
|
|
19
19
|
|
|
20
20
|
function getInitials(name) {
|
|
21
21
|
const words = name.split(' ');
|
|
22
|
-
const initials = words.map(word => word[0]);
|
|
23
|
-
return initials
|
|
24
|
-
.slice(0, 2)
|
|
25
|
-
.join('')
|
|
26
|
-
.toUpperCase();
|
|
22
|
+
const initials = words.map((word) => word[0]);
|
|
23
|
+
return initials.slice(0, 2).join('').toUpperCase();
|
|
27
24
|
}
|
|
28
25
|
|
|
29
26
|
export default function Avatar({
|
|
@@ -21,7 +21,7 @@ function getSize(props) {
|
|
|
21
21
|
return $theme.sizing[size] || size;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export const Avatar = styled<AvatarStylePropsT>('img', props => {
|
|
24
|
+
export const Avatar = styled<AvatarStylePropsT>('img', (props) => {
|
|
25
25
|
const themedSize = getSize(props);
|
|
26
26
|
|
|
27
27
|
return {
|
|
@@ -37,7 +37,7 @@ export const Avatar = styled<AvatarStylePropsT>('img', props => {
|
|
|
37
37
|
};
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
export const Initials = styled<InitialsStylePropsT>('div', props => ({
|
|
40
|
+
export const Initials = styled<InitialsStylePropsT>('div', (props) => ({
|
|
41
41
|
...props.$theme.typography.font300,
|
|
42
42
|
color: props.$theme.colors.mono100,
|
|
43
43
|
alignItems: 'center',
|
|
@@ -46,7 +46,7 @@ export const Initials = styled<InitialsStylePropsT>('div', props => ({
|
|
|
46
46
|
height: '100%',
|
|
47
47
|
}));
|
|
48
48
|
|
|
49
|
-
export const Root = styled<RootStylePropsT>('div', props => {
|
|
49
|
+
export const Root = styled<RootStylePropsT>('div', (props) => {
|
|
50
50
|
const {$didImageFailToLoad} = props;
|
|
51
51
|
const themedSize = getSize(props);
|
|
52
52
|
|
|
@@ -32,7 +32,7 @@ function build(breakpoints: BreakpointsT) {
|
|
|
32
32
|
const mediaQueries = getMediaQueries(breakpoints);
|
|
33
33
|
|
|
34
34
|
return {
|
|
35
|
-
apply: ({property, transform = x => x, value}: ApplyParams) => {
|
|
35
|
+
apply: ({property, transform = (x) => x, value}: ApplyParams) => {
|
|
36
36
|
if (value === null || value === undefined) {
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
@@ -65,17 +65,17 @@ function getFontValue(obj, key) {
|
|
|
65
65
|
return obj[key];
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
export const StyledBlock = styled<StyledBlockPropsT>('div', props => {
|
|
68
|
+
export const StyledBlock = styled<StyledBlockPropsT>('div', (props) => {
|
|
69
69
|
const {breakpoints, colors, typography, sizing} = props.$theme;
|
|
70
70
|
|
|
71
71
|
const get = (obj, key) => obj[key];
|
|
72
|
-
const getScale = size => sizing[size] || size;
|
|
72
|
+
const getScale = (size) => sizing[size] || size;
|
|
73
73
|
|
|
74
74
|
const styles = build(breakpoints);
|
|
75
75
|
styles.apply({
|
|
76
76
|
property: 'color',
|
|
77
77
|
value: get(props, '$color'),
|
|
78
|
-
transform: color => colors[color] || color,
|
|
78
|
+
transform: (color) => colors[color] || color,
|
|
79
79
|
});
|
|
80
80
|
styles.apply({
|
|
81
81
|
property: 'backgroundAttachment',
|
|
@@ -88,7 +88,7 @@ export const StyledBlock = styled<StyledBlockPropsT>('div', props => {
|
|
|
88
88
|
styles.apply({
|
|
89
89
|
property: 'backgroundColor',
|
|
90
90
|
value: get(props, '$backgroundColor'),
|
|
91
|
-
transform: backgroundColor => colors[backgroundColor] || backgroundColor,
|
|
91
|
+
transform: (backgroundColor) => colors[backgroundColor] || backgroundColor,
|
|
92
92
|
});
|
|
93
93
|
styles.apply({
|
|
94
94
|
property: 'backgroundImage',
|
|
@@ -113,22 +113,22 @@ export const StyledBlock = styled<StyledBlockPropsT>('div', props => {
|
|
|
113
113
|
styles.apply({
|
|
114
114
|
property: 'fontFamily',
|
|
115
115
|
value: get(props, '$font'),
|
|
116
|
-
transform: font => getFontValue(typography[font], 'fontFamily'),
|
|
116
|
+
transform: (font) => getFontValue(typography[font], 'fontFamily'),
|
|
117
117
|
});
|
|
118
118
|
styles.apply({
|
|
119
119
|
property: 'fontWeight',
|
|
120
120
|
value: get(props, '$font'),
|
|
121
|
-
transform: font => getFontValue(typography[font], 'fontWeight'),
|
|
121
|
+
transform: (font) => getFontValue(typography[font], 'fontWeight'),
|
|
122
122
|
});
|
|
123
123
|
styles.apply({
|
|
124
124
|
property: 'fontSize',
|
|
125
125
|
value: get(props, '$font'),
|
|
126
|
-
transform: font => getFontValue(typography[font], 'fontSize'),
|
|
126
|
+
transform: (font) => getFontValue(typography[font], 'fontSize'),
|
|
127
127
|
});
|
|
128
128
|
styles.apply({
|
|
129
129
|
property: 'lineHeight',
|
|
130
130
|
value: get(props, '$font'),
|
|
131
|
-
transform: font => getFontValue(typography[font], 'lineHeight'),
|
|
131
|
+
transform: (font) => getFontValue(typography[font], 'lineHeight'),
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
styles.apply({
|
|
@@ -240,7 +240,7 @@ export const StyledBlock = styled<StyledBlockPropsT>('div', props => {
|
|
|
240
240
|
styles.apply({
|
|
241
241
|
property: 'overflowX',
|
|
242
242
|
value: get(props, '$overflow'),
|
|
243
|
-
transform: overflow => {
|
|
243
|
+
transform: (overflow) => {
|
|
244
244
|
if (overflow === 'scrollX') {
|
|
245
245
|
return 'scroll';
|
|
246
246
|
}
|
|
@@ -250,7 +250,7 @@ export const StyledBlock = styled<StyledBlockPropsT>('div', props => {
|
|
|
250
250
|
styles.apply({
|
|
251
251
|
property: 'overflowY',
|
|
252
252
|
value: get(props, '$overflow'),
|
|
253
|
-
transform: overflow => {
|
|
253
|
+
transform: (overflow) => {
|
|
254
254
|
if (overflow === 'scrollY') {
|
|
255
255
|
return 'scroll';
|
|
256
256
|
}
|
|
@@ -260,7 +260,7 @@ export const StyledBlock = styled<StyledBlockPropsT>('div', props => {
|
|
|
260
260
|
styles.apply({
|
|
261
261
|
property: 'overflow',
|
|
262
262
|
value: get(props, '$overflow'),
|
|
263
|
-
transform: overflow => {
|
|
263
|
+
transform: (overflow) => {
|
|
264
264
|
if (overflow !== 'scrollX' && overflow !== 'scrollY') {
|
|
265
265
|
return overflow;
|
|
266
266
|
}
|
|
@@ -59,7 +59,7 @@ export function Breadcrumbs(props: BreadcrumbsPropsT) {
|
|
|
59
59
|
{(showTrailingSeparator || index !== childrenArray.length - 1) && (
|
|
60
60
|
<Separator {...baseSeparatorProps} key={`separator-${index}`}>
|
|
61
61
|
<ThemeContext.Consumer>
|
|
62
|
-
{theme =>
|
|
62
|
+
{(theme) =>
|
|
63
63
|
theme.direction === 'rtl' ? (
|
|
64
64
|
<Left {...baseIconProps} />
|
|
65
65
|
) : (
|
|
@@ -75,7 +75,7 @@ export function Breadcrumbs(props: BreadcrumbsPropsT) {
|
|
|
75
75
|
|
|
76
76
|
return (
|
|
77
77
|
<LocaleContext.Consumer>
|
|
78
|
-
{locale => (
|
|
78
|
+
{(locale) => (
|
|
79
79
|
<Root
|
|
80
80
|
aria-label={
|
|
81
81
|
props['aria-label'] ||
|
package/button/button.js.flow
CHANGED
|
@@ -75,13 +75,11 @@ class Button extends React.Component<
|
|
|
75
75
|
overrides.LoadingSpinner,
|
|
76
76
|
StyledLoadingSpinner,
|
|
77
77
|
);
|
|
78
|
-
const [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
StyledLoadingSpinnerContainer,
|
|
84
|
-
);
|
|
78
|
+
const [LoadingSpinnerContainer, loadingSpinnerContainerProps] =
|
|
79
|
+
getOverrides(
|
|
80
|
+
overrides.LoadingSpinnerContainer,
|
|
81
|
+
StyledLoadingSpinnerContainer,
|
|
82
|
+
);
|
|
85
83
|
const sharedProps = {
|
|
86
84
|
...getSharedProps(this.props),
|
|
87
85
|
$isFocusVisible: this.state.isFocusVisible,
|
|
@@ -58,7 +58,7 @@ export default class ButtonGroup extends React.Component<PropsT> {
|
|
|
58
58
|
|
|
59
59
|
return (
|
|
60
60
|
<LocaleContext.Consumer>
|
|
61
|
-
{locale => (
|
|
61
|
+
{(locale) => (
|
|
62
62
|
<Root
|
|
63
63
|
aria-label={ariaLabel || locale.buttongroup.ariaLabel}
|
|
64
64
|
data-baseweb="button-group"
|
|
@@ -89,7 +89,7 @@ export default class ButtonGroup extends React.Component<PropsT> {
|
|
|
89
89
|
(isRadio && (!selected || selected === -1) && index === 0)
|
|
90
90
|
? 0
|
|
91
91
|
: -1,
|
|
92
|
-
onKeyDown: e => {
|
|
92
|
+
onKeyDown: (e) => {
|
|
93
93
|
if (!isRadio) return;
|
|
94
94
|
const value = Number(selected) ? Number(selected) : 0;
|
|
95
95
|
if (e.key === 'ArrowUp' || e.key === 'ArrowLeft') {
|
|
@@ -108,7 +108,7 @@ export default class ButtonGroup extends React.Component<PropsT> {
|
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
kind,
|
|
111
|
-
onClick: event => {
|
|
111
|
+
onClick: (event) => {
|
|
112
112
|
if (disabled) {
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
@@ -76,7 +76,7 @@ export default class StatefulContainer extends React.Component<
|
|
|
76
76
|
this.changeState({selected: [...this.state.selected, index]});
|
|
77
77
|
} else {
|
|
78
78
|
this.changeState({
|
|
79
|
-
selected: this.state.selected.filter(value => value !== index),
|
|
79
|
+
selected: this.state.selected.filter((value) => value !== index),
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
82
|
}
|
package/card/card.js.flow
CHANGED
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import {STYLE_TYPE} from './constants.js';
|
|
21
21
|
import {isFocusVisible} from '../utils/focusVisible.js';
|
|
22
22
|
|
|
23
|
-
const stopPropagation = e => e.stopPropagation();
|
|
23
|
+
const stopPropagation = (e) => e.stopPropagation();
|
|
24
24
|
|
|
25
25
|
class StatelessCheckbox extends React.Component<PropsT, StatelessStateT> {
|
|
26
26
|
static defaultProps: DefaultPropsT = {
|
|
@@ -189,7 +189,7 @@ class StatelessCheckbox extends React.Component<PropsT, StatelessStateT> {
|
|
|
189
189
|
{this.props.containsInteractiveElement ? (
|
|
190
190
|
// Prevents the event from bubbling up to the label and moving focus to the radio button
|
|
191
191
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
|
|
192
|
-
<div onClick={e => e.preventDefault()}>{children}</div>
|
|
192
|
+
<div onClick={(e) => e.preventDefault()}>{children}</div>
|
|
193
193
|
) : (
|
|
194
194
|
children
|
|
195
195
|
)}
|
|
@@ -13,7 +13,7 @@ import {default as Checkbox} from './checkbox.js';
|
|
|
13
13
|
import type {PropsT, StatefulCheckboxPropsT} from './types.js';
|
|
14
14
|
// Styled elements
|
|
15
15
|
|
|
16
|
-
const StatefulCheckbox = function(props: StatefulCheckboxPropsT) {
|
|
16
|
+
const StatefulCheckbox = function (props: StatefulCheckboxPropsT) {
|
|
17
17
|
return (
|
|
18
18
|
<StatefulContainer {...props}>
|
|
19
19
|
{(childrenProps: PropsT) => (
|