baseui 14.0.0 → 15.0.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/accordion/accordion.js +4 -4
- package/accordion/panel.d.ts +1 -1
- package/accordion/styled-components.js +1 -1
- package/accordion/types.d.ts +1 -1
- package/app-nav-bar/mobile-menu.js +3 -1
- package/banner/banner.js +3 -1
- package/banner/types.d.ts +2 -1
- package/bottom-navigation/bottom-navigation.js +3 -1
- package/bottom-navigation/selector.js +1 -1
- package/bottom-navigation/styled-components.js +1 -1
- package/button/button.d.ts +1 -3
- package/button/button.js +6 -2
- package/button/styled-components.d.ts +1 -0
- package/button/styled-components.js +61 -4
- package/button/types.d.ts +15 -3
- package/button-timed/button-timed.js +4 -5
- package/button-timed/styled-components.js +5 -3
- package/button-timed/types.d.ts +1 -1
- package/data-table/column-categorical.js +2 -2
- package/data-table/locale.d.ts +2 -0
- package/data-table/locale.js +2 -1
- package/data-table/stateful-container.js +1 -1
- package/data-table/stateful-data-table.js +7 -3
- package/data-table/types.d.ts +2 -0
- package/datepicker/day.js +2 -4
- package/datepicker/utils/date-helpers.d.ts +1 -0
- package/datepicker/utils/date-helpers.js +3 -0
- package/dialog/dialog.d.ts +1 -1
- package/dialog/dialog.js +38 -56
- package/dialog/styled-components.d.ts +2 -2
- package/dialog/styled-components.js +56 -24
- package/dialog/types.d.ts +5 -2
- package/file-uploader/constants.d.ts +16 -0
- package/file-uploader/constants.js +30 -0
- package/file-uploader/file-uploader.d.ts +2 -2
- package/file-uploader/file-uploader.js +387 -117
- package/file-uploader/index.d.ts +1 -1
- package/file-uploader/index.js +67 -18
- package/file-uploader/locale.d.ts +10 -10
- package/file-uploader/locale.js +5 -5
- package/file-uploader/styled-components.d.ts +13 -6
- package/file-uploader/styled-components.js +261 -64
- package/file-uploader/types.d.ts +47 -32
- package/file-uploader/utils.d.ts +5 -0
- package/file-uploader/utils.js +45 -0
- package/file-uploader-basic/file-uploader-basic.d.ts +10 -0
- package/file-uploader-basic/file-uploader-basic.js +175 -0
- package/file-uploader-basic/index.d.ts +4 -0
- package/file-uploader-basic/index.js +71 -0
- package/file-uploader-basic/locale.d.ts +15 -0
- package/file-uploader-basic/locale.js +21 -0
- package/file-uploader-basic/styled-components.d.ts +7 -0
- package/file-uploader-basic/styled-components.js +83 -0
- package/file-uploader-basic/types.d.ts +41 -0
- package/form-control/form-control.js +38 -3
- package/form-control/styled-components.d.ts +2 -0
- package/form-control/styled-components.js +22 -2
- package/form-control/types.d.ts +4 -0
- package/icon/circle-check-filled.d.ts +9 -0
- package/icon/circle-check-filled.js +50 -0
- package/icon/circle-exclamation-point-filled.d.ts +9 -0
- package/icon/circle-exclamation-point-filled.js +50 -0
- package/icon/hide.js +1 -1
- package/icon/icon-exports.d.ts +4 -0
- package/icon/icon-exports.js +28 -0
- package/icon/paperclip-filled.d.ts +9 -0
- package/icon/paperclip-filled.js +50 -0
- package/icon/show.js +1 -1
- package/icon/trash-can-filled.d.ts +9 -0
- package/{button-docked/button-docked.js → icon/trash-can-filled.js} +35 -16
- package/locale/en_US.js +14 -12
- package/locale/es_AR.js +9 -1
- package/locale/index.d.ts +3 -0
- package/locale/index.js +2 -0
- package/locale/tr_TR.js +9 -1
- package/locale/types.d.ts +2 -0
- package/message-card/message-card.js +2 -2
- package/message-card/utils.js +8 -3
- package/modal/modal-button.d.ts +1 -3
- package/package.json +5 -3
- package/payment-card/custom-cards.config.d.ts +1 -11
- package/payment-card/payment-card.js +1 -3
- package/phone-input/base-country-picker.js +2 -2
- package/phone-input/country-picker.js +0 -10
- package/progress-bar/progressbar-rounded.js +1 -1
- package/progress-bar/styled-components.js +8 -6
- package/rating/styled-components.js +3 -2
- package/rating/svg-icons.d.ts +5 -5
- package/rating/svg-icons.js +20 -20
- package/select/multi-value.js +1 -1
- package/snackbar/index.d.ts +1 -0
- package/snackbar/snackbar-context.d.ts +1 -2
- package/snackbar/snackbar-context.js +27 -21
- package/spinner/index.d.ts +4 -2
- package/stepper/stepper.js +28 -27
- package/styles/__mocks__/styled.js +0 -2
- package/styles/as-primary-export-hoc.js +0 -2
- package/styles/styled.js +0 -2
- package/styles/types.d.ts +7 -3
- package/tabs-motion/tabs.js +2 -2
- package/tag/constants.d.ts +5 -4
- package/tag/constants.js +7 -6
- package/tag/index.d.ts +1 -1
- package/tag/index.js +7 -7
- package/tag/styled-components.d.ts +1 -1
- package/tag/styled-components.js +137 -124
- package/tag/tag.js +2 -2
- package/tag/types.d.ts +9 -8
- package/tag/types.js +2 -2
- package/themes/dark-theme/color-component-tokens.d.ts +2 -2
- package/themes/dark-theme/color-component-tokens.js +279 -275
- package/themes/dark-theme/color-foundation-tokens.d.ts +3 -0
- package/themes/dark-theme/{color-tokens.js → color-foundation-tokens.js} +11 -14
- package/themes/dark-theme/color-semantic-tokens.d.ts +2 -2
- package/themes/dark-theme/color-semantic-tokens.js +52 -58
- package/themes/dark-theme/create-dark-theme.d.ts +1 -1
- package/themes/dark-theme/create-dark-theme.js +12 -32
- package/themes/dark-theme/dark-theme.js +4 -4
- package/themes/dark-theme/primitives.js +2 -2
- package/themes/light-theme/color-component-tokens.d.ts +2 -2
- package/themes/light-theme/color-component-tokens.js +287 -282
- package/themes/light-theme/color-foundation-tokens.d.ts +3 -0
- package/themes/light-theme/{color-tokens.js → color-foundation-tokens.js} +10 -13
- package/themes/light-theme/color-semantic-tokens.d.ts +2 -2
- package/themes/light-theme/color-semantic-tokens.js +50 -53
- package/themes/light-theme/create-light-theme.d.ts +1 -1
- package/themes/light-theme/create-light-theme.js +12 -32
- package/themes/light-theme/light-theme.js +4 -4
- package/themes/light-theme/primitives.js +2 -2
- package/themes/types.d.ts +74 -13
- package/themes/utils.d.ts +1 -1
- package/themes/utils.js +4 -4
- package/tile/tile-group.js +2 -2
- package/timezonepicker/update-tzdata.js +0 -1
- package/tokens/color-primitive-tokens.d.ts +5 -0
- package/tokens/color-primitive-tokens.js +301 -0
- package/tokens/index.d.ts +5 -4
- package/tokens/index.js +25 -3
- package/tokens/types.d.ts +170 -1
- package/button-docked/button-docked.d.ts +0 -4
- package/button-docked/index.d.ts +0 -3
- package/button-docked/index.js +0 -40
- package/button-docked/styled-components.d.ts +0 -5
- package/button-docked/styled-components.js +0 -55
- package/button-docked/types.d.ts +0 -14
- package/themes/dark-theme/color-tokens.d.ts +0 -3
- package/themes/light-theme/color-tokens.d.ts +0 -3
- package/tokens/colors.d.ts +0 -3
- package/tokens/colors.js +0 -125
- /package/{button-docked → file-uploader-basic}/types.js +0 -0
package/accordion/accordion.js
CHANGED
|
@@ -84,17 +84,17 @@ class Accordion extends React.Component {
|
|
|
84
84
|
lastItem.current && lastItem.current.focus();
|
|
85
85
|
}
|
|
86
86
|
if (e.keyCode === ARROW_UP) {
|
|
87
|
-
e.preventDefault();
|
|
88
87
|
const activeItemIdx = itemRefs.findIndex(item => item.current === document.activeElement);
|
|
89
|
-
if (activeItemIdx
|
|
88
|
+
if (activeItemIdx >= 0) {
|
|
89
|
+
e.preventDefault();
|
|
90
90
|
const prevItem = itemRefs[activeItemIdx - 1];
|
|
91
91
|
prevItem.current && prevItem.current.focus();
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
if (e.keyCode === ARROW_DOWN) {
|
|
95
|
-
e.preventDefault();
|
|
96
95
|
const activeItemIdx = itemRefs.findIndex(item => item.current === document.activeElement);
|
|
97
|
-
if (activeItemIdx < itemRefs.length - 1) {
|
|
96
|
+
if (activeItemIdx >= 0 && activeItemIdx < itemRefs.length - 1) {
|
|
97
|
+
e.preventDefault();
|
|
98
98
|
const nextItem = itemRefs[activeItemIdx + 1];
|
|
99
99
|
nextItem.current && nextItem.current.focus();
|
|
100
100
|
}
|
package/accordion/panel.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ const ToggleIcon = exports.ToggleIcon = (0, _styles.styled)('svg', props => {
|
|
|
87
87
|
return {
|
|
88
88
|
...(0, _styledComponents.getSvgStyles)(props),
|
|
89
89
|
flexShrink: 0,
|
|
90
|
-
color: $color || $theme.colors.
|
|
90
|
+
color: $color || $theme.colors.contentTierary,
|
|
91
91
|
cursor: $disabled ? 'not-allowed' : 'pointer'
|
|
92
92
|
};
|
|
93
93
|
});
|
package/accordion/types.d.ts
CHANGED
|
@@ -87,7 +87,7 @@ export type StatelessAccordionProps = {
|
|
|
87
87
|
};
|
|
88
88
|
type SharedPanelProps = {
|
|
89
89
|
/** The content visible when Panel is expanded. */
|
|
90
|
-
children
|
|
90
|
+
children?: React.ReactNode;
|
|
91
91
|
/** Defaults to the disabled value provided by the parent Accordion component. */
|
|
92
92
|
disabled?: boolean;
|
|
93
93
|
/** Id for a panel, when provided populates aria-controls
|
|
@@ -48,7 +48,9 @@ const MobileNavMenuItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
48
48
|
// Replace with a user menu item renderer
|
|
49
49
|
return /*#__PURE__*/React.createElement(UserMenuProfileListItem, _extends({}, restProps, userMenuProfileListItemProps, {
|
|
50
50
|
ref: ref
|
|
51
|
-
}), /*#__PURE__*/React.createElement(_userProfileTile.default, item.item
|
|
51
|
+
}), /*#__PURE__*/React.createElement(_userProfileTile.default, _extends({}, item.item, {
|
|
52
|
+
overrides: overrides
|
|
53
|
+
})));
|
|
52
54
|
}
|
|
53
55
|
return (
|
|
54
56
|
/*#__PURE__*/
|
package/banner/banner.js
CHANGED
|
@@ -146,10 +146,12 @@ function Trailing({
|
|
|
146
146
|
}));
|
|
147
147
|
}
|
|
148
148
|
const [TrailingButtonContainer, trailingButtonContainerProps] = (0, _overrides.getOverrides)(overrides.TrailingButtonContainer, _styledComponents.StyledTrailingButtonContainer);
|
|
149
|
+
const trailingButtonOverrides = overrides?.TrailingButton;
|
|
150
|
+
const trailingButtonBackgroundColor = trailingButtonOverrides?.style?.backgroundColor ? trailingButtonOverrides.style.backgroundColor : backgroundColor;
|
|
149
151
|
if (action.label) {
|
|
150
152
|
return /*#__PURE__*/React.createElement(TrailingButtonContainer, trailingButtonContainerProps, /*#__PURE__*/React.createElement(_index.Button, {
|
|
151
153
|
colors: {
|
|
152
|
-
backgroundColor,
|
|
154
|
+
backgroundColor: trailingButtonBackgroundColor,
|
|
153
155
|
color
|
|
154
156
|
},
|
|
155
157
|
onClick: action.onClick,
|
package/banner/types.d.ts
CHANGED
|
@@ -29,12 +29,13 @@ export type BannerOverrides = {
|
|
|
29
29
|
Title?: Override;
|
|
30
30
|
TrailingContent?: Override;
|
|
31
31
|
TrailingButtonContainer?: Override;
|
|
32
|
+
TrailingButton?: Override;
|
|
32
33
|
TrailingIconButton?: Override;
|
|
33
34
|
};
|
|
34
35
|
export type BannerProps = {
|
|
35
36
|
action?: ActionContent;
|
|
36
37
|
artwork?: ArtworkContent;
|
|
37
|
-
children
|
|
38
|
+
children?: React.ReactNode;
|
|
38
39
|
hierarchy?: Hierarchy;
|
|
39
40
|
kind?: Kind;
|
|
40
41
|
overrides?: BannerOverrides;
|
|
@@ -98,7 +98,9 @@ const BottomNavigation = ({
|
|
|
98
98
|
const idx = overflowIdx + MAX_SELECTORS - 1;
|
|
99
99
|
return /*#__PURE__*/React.createElement(_list.ListItem, {
|
|
100
100
|
artwork: props => /*#__PURE__*/React.createElement(Icon, props),
|
|
101
|
-
endEnhancer: () => /*#__PURE__*/React.createElement(_icon.ChevronRight,
|
|
101
|
+
endEnhancer: () => /*#__PURE__*/React.createElement(_icon.ChevronRight, {
|
|
102
|
+
title: ""
|
|
103
|
+
}),
|
|
102
104
|
onClick: () => {
|
|
103
105
|
activeKey === idx && !displayOverflow ? scrollToTop(idx) : handleNavItemChange(idx);
|
|
104
106
|
},
|
|
@@ -33,7 +33,7 @@ const Selector = ({
|
|
|
33
33
|
"aria-selected": isActive
|
|
34
34
|
}, SelectorProps), /*#__PURE__*/React.createElement(Icon, {
|
|
35
35
|
size: 20,
|
|
36
|
-
color: isActive ? theme.colors.
|
|
36
|
+
color: isActive ? theme.colors.bottomNavigationSelectedText : theme.colors.bottomNavigationText
|
|
37
37
|
}), /*#__PURE__*/React.createElement(Title, _extends({
|
|
38
38
|
$isActive: isActive
|
|
39
39
|
}, TitleProps), title));
|
|
@@ -60,7 +60,7 @@ const StyledTitle = exports.StyledTitle = (0, _styles.styled)('div', ({
|
|
|
60
60
|
$isActive
|
|
61
61
|
}) => ({
|
|
62
62
|
...$theme.typography.LabelXSmall,
|
|
63
|
-
color: $isActive ? $theme.colors.
|
|
63
|
+
color: $isActive ? $theme.colors.bottomNavigationSelectedText : $theme.colors.bottomNavigationText
|
|
64
64
|
}));
|
|
65
65
|
StyledTitle.displayName = "StyledTitle";
|
|
66
66
|
StyledTitle.displayName = 'StyledTitle';
|
package/button/button.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { ButtonProps, SharedStyleProps } from './types';
|
|
3
3
|
export interface ButtonComponentType {
|
|
4
|
-
<C extends React.ElementType = 'button'>(props: ButtonProps &
|
|
5
|
-
$as?: C | React.ComponentType<any> | keyof JSX.IntrinsicElements;
|
|
6
|
-
}): JSX.Element;
|
|
4
|
+
<C extends React.ElementType = 'button'>(props: ButtonProps & Omit<React.ComponentProps<C>, keyof ButtonProps | keyof SharedStyleProps> & SharedStyleProps<C | React.ComponentType<any> | keyof JSX.IntrinsicElements>): JSX.Element;
|
|
7
5
|
displayName?: string;
|
|
8
6
|
}
|
|
9
7
|
declare const ForwardedButton: ButtonComponentType;
|
package/button/button.js
CHANGED
|
@@ -83,11 +83,12 @@ class Button extends React.Component {
|
|
|
83
83
|
...restProps
|
|
84
84
|
} = this.props;
|
|
85
85
|
// Get overrides
|
|
86
|
+
const isAnchor = 'href' in restProps && Boolean(restProps?.href);
|
|
86
87
|
const [BaseButton, baseButtonProps] = (0, _overrides.getOverrides)(
|
|
87
88
|
// adding both (1) BaseButton and (2) Root
|
|
88
89
|
// (1) because it's a Button under the hood
|
|
89
90
|
// (2) because we want consistency with the rest of the components
|
|
90
|
-
overrides.BaseButton || overrides.Root, _styledComponents.BaseButton);
|
|
91
|
+
overrides.BaseButton || overrides.Root, isAnchor ? _styledComponents.AnchorBaseButton : _styledComponents.BaseButton);
|
|
91
92
|
const [LoadingSpinner, loadingSpinnerProps] = (0, _overrides.getOverrides)(overrides.LoadingSpinner, _styledComponents.LoadingSpinner);
|
|
92
93
|
const [LoadingSpinnerContainer, loadingSpinnerContainerProps] = (0, _overrides.getOverrides)(overrides.LoadingSpinnerContainer, _styledComponents.LoadingSpinnerContainer);
|
|
93
94
|
const sharedProps = {
|
|
@@ -99,10 +100,13 @@ class Button extends React.Component {
|
|
|
99
100
|
['aria-busy']: 'true',
|
|
100
101
|
['aria-live']: 'polite'
|
|
101
102
|
} : {};
|
|
103
|
+
const ariaDisabledProps = restProps?.disabled && isAnchor ? {
|
|
104
|
+
['aria-disabled']: true
|
|
105
|
+
} : {};
|
|
102
106
|
return /*#__PURE__*/React.createElement(BaseButton, _extends({
|
|
103
107
|
ref: forwardedRef,
|
|
104
108
|
"data-baseweb": "button"
|
|
105
|
-
}, ariaLoadingElements, sharedProps, restProps, baseButtonProps, {
|
|
109
|
+
}, ariaLoadingElements, ariaDisabledProps, sharedProps, restProps, baseButtonProps, {
|
|
106
110
|
// Applies last to override passed in onClick
|
|
107
111
|
onClick: this.internalOnClick,
|
|
108
112
|
onFocus: (0, _focusVisible.forkFocus)({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SharedStyleProps } from './types';
|
|
2
2
|
export declare const BaseButton: import("styletron-react").StyletronComponent<"button", SharedStyleProps>;
|
|
3
|
+
export declare const AnchorBaseButton: import("styletron-react").StyletronComponent<"a", SharedStyleProps>;
|
|
3
4
|
export declare const EndEnhancer: import("styletron-react").StyletronComponent<"div", SharedStyleProps>;
|
|
4
5
|
export declare const StartEnhancer: import("styletron-react").StyletronComponent<"div", SharedStyleProps>;
|
|
5
6
|
export declare const LoadingSpinnerContainer: import("styletron-react").StyletronComponent<"div", SharedStyleProps>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StartEnhancer = exports.LoadingSpinnerContainer = exports.LoadingSpinner = exports.EndEnhancer = exports.BaseButton = void 0;
|
|
6
|
+
exports.StartEnhancer = exports.LoadingSpinnerContainer = exports.LoadingSpinner = exports.EndEnhancer = exports.BaseButton = exports.AnchorBaseButton = void 0;
|
|
7
7
|
var _styles = require("../styles");
|
|
8
8
|
var _constants = require("./constants");
|
|
9
9
|
/*
|
|
@@ -13,7 +13,10 @@ This source code is licensed under the MIT license found in the
|
|
|
13
13
|
LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
// note: Tried doing a standard override of the styled function, but it didn't work
|
|
17
|
+
// it seems like there is some bug when override $as
|
|
18
|
+
|
|
19
|
+
const createStyledBaseButton = (type, styleFn) => (0, _styles.styled)(type, ({
|
|
17
20
|
$theme,
|
|
18
21
|
$size,
|
|
19
22
|
$colors,
|
|
@@ -22,7 +25,8 @@ const BaseButton = exports.BaseButton = (0, _styles.styled)('button', ({
|
|
|
22
25
|
$isLoading,
|
|
23
26
|
$isSelected,
|
|
24
27
|
$disabled,
|
|
25
|
-
$isFocusVisible
|
|
28
|
+
$isFocusVisible,
|
|
29
|
+
$as
|
|
26
30
|
}) => ({
|
|
27
31
|
display: 'inline-flex',
|
|
28
32
|
// need to maintain button width while showing loading spinner
|
|
@@ -80,12 +84,44 @@ const BaseButton = exports.BaseButton = (0, _styles.styled)('button', ({
|
|
|
80
84
|
$isSelected,
|
|
81
85
|
$disabled
|
|
82
86
|
}),
|
|
87
|
+
...getAnchorDisabledStyles({
|
|
88
|
+
$as,
|
|
89
|
+
$theme,
|
|
90
|
+
$kind,
|
|
91
|
+
$isSelected,
|
|
92
|
+
$disabled
|
|
93
|
+
}),
|
|
83
94
|
...getShapeStyles({
|
|
84
95
|
$shape,
|
|
85
96
|
$size
|
|
97
|
+
}),
|
|
98
|
+
...styleFn?.({
|
|
99
|
+
$theme,
|
|
100
|
+
$size,
|
|
101
|
+
$colors,
|
|
102
|
+
$kind,
|
|
103
|
+
$shape,
|
|
104
|
+
$isLoading,
|
|
105
|
+
$isSelected,
|
|
106
|
+
$disabled,
|
|
107
|
+
$isFocusVisible,
|
|
108
|
+
$as
|
|
86
109
|
})
|
|
87
110
|
}));
|
|
88
|
-
BaseButton.
|
|
111
|
+
const BaseButton = exports.BaseButton = createStyledBaseButton('button');
|
|
112
|
+
BaseButton.displayName = 'BaseButton';
|
|
113
|
+
const AnchorBaseButton = exports.AnchorBaseButton = createStyledBaseButton('a', ({
|
|
114
|
+
$theme,
|
|
115
|
+
$kind,
|
|
116
|
+
$isSelected,
|
|
117
|
+
$disabled
|
|
118
|
+
}) => getAnchorDisabledStyles({
|
|
119
|
+
$as: 'a',
|
|
120
|
+
$theme,
|
|
121
|
+
$kind,
|
|
122
|
+
$isSelected,
|
|
123
|
+
$disabled
|
|
124
|
+
}));
|
|
89
125
|
BaseButton.displayName = 'BaseButton';
|
|
90
126
|
const EndEnhancer = exports.EndEnhancer = (0, _styles.styled)('div', ({
|
|
91
127
|
$theme
|
|
@@ -270,6 +306,27 @@ function getFontStyles({
|
|
|
270
306
|
return $theme.typography.font350;
|
|
271
307
|
}
|
|
272
308
|
}
|
|
309
|
+
function getAnchorDisabledStyles({
|
|
310
|
+
$as,
|
|
311
|
+
$theme,
|
|
312
|
+
$kind,
|
|
313
|
+
$isSelected,
|
|
314
|
+
$disabled
|
|
315
|
+
}) {
|
|
316
|
+
if (!($as === 'a' && $disabled)) {
|
|
317
|
+
return {};
|
|
318
|
+
}
|
|
319
|
+
return {
|
|
320
|
+
cursor: 'not-allowed',
|
|
321
|
+
pointerEvents: 'none',
|
|
322
|
+
...getDisabledStyles({
|
|
323
|
+
$theme,
|
|
324
|
+
$kind,
|
|
325
|
+
$isSelected,
|
|
326
|
+
$disabled
|
|
327
|
+
})
|
|
328
|
+
};
|
|
329
|
+
}
|
|
273
330
|
|
|
274
331
|
// @ts-ignore
|
|
275
332
|
function getDisabledStyles({
|
package/button/types.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type CustomColors = {
|
|
|
13
13
|
backgroundColor: string;
|
|
14
14
|
color: string;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
interface BaseButtonProps {
|
|
17
17
|
children?: React.ReactNode;
|
|
18
18
|
colors?: CustomColors;
|
|
19
19
|
disabled?: boolean;
|
|
@@ -34,8 +34,18 @@ export type ButtonProps = {
|
|
|
34
34
|
/** A helper rendered at the start of the button. */
|
|
35
35
|
startEnhancer?: React.ReactNode | React.ComponentType<any>;
|
|
36
36
|
type?: 'submit' | 'reset' | 'button';
|
|
37
|
-
}
|
|
38
|
-
export
|
|
37
|
+
}
|
|
38
|
+
export interface LinkButtonProps {
|
|
39
|
+
/** Convert button to <a> tag allowing for opening links directly.
|
|
40
|
+
*
|
|
41
|
+
* Use this over window.open as it handles accessibility better.
|
|
42
|
+
*/
|
|
43
|
+
href?: string | null;
|
|
44
|
+
target?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ButtonProps extends BaseButtonProps, LinkButtonProps {
|
|
47
|
+
}
|
|
48
|
+
export type SharedStyleProps<AS = React.ComponentType<any> | keyof JSX.IntrinsicElements> = {
|
|
39
49
|
$colors?: CustomColors;
|
|
40
50
|
$kind?: keyof typeof KIND;
|
|
41
51
|
$isSelected?: boolean;
|
|
@@ -44,4 +54,6 @@ export type SharedStyleProps = {
|
|
|
44
54
|
$isLoading?: boolean;
|
|
45
55
|
$disabled?: boolean;
|
|
46
56
|
$isFocusVisible?: boolean;
|
|
57
|
+
$as?: AS;
|
|
47
58
|
};
|
|
59
|
+
export {};
|
|
@@ -24,6 +24,7 @@ const ButtonTimed = props => {
|
|
|
24
24
|
paused = false,
|
|
25
25
|
onClick: onClickProp,
|
|
26
26
|
disabled,
|
|
27
|
+
kind = _button.KIND.primary,
|
|
27
28
|
children,
|
|
28
29
|
overrides = {},
|
|
29
30
|
...restProps
|
|
@@ -60,7 +61,7 @@ const ButtonTimed = props => {
|
|
|
60
61
|
} = overrides;
|
|
61
62
|
const [TimerContainer, timerContainerProps] = (0, _overrides.getOverrides)(TimerContainerOverride, _styledComponents.StyledTimerContainer);
|
|
62
63
|
const buttonMergedOverrides = (0, _overrides.mergeOverrides)({
|
|
63
|
-
|
|
64
|
+
Root: {
|
|
64
65
|
component: _styledComponents.StyledBaseButtonTimed,
|
|
65
66
|
props: {
|
|
66
67
|
$initialTime: initialTime,
|
|
@@ -73,9 +74,7 @@ const ButtonTimed = props => {
|
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
}, {
|
|
76
|
-
Root: buttonOverrides.Root || {},
|
|
77
|
-
// @ts-ignore
|
|
78
|
-
BaseButton: buttonOverrides.BaseButton,
|
|
77
|
+
Root: buttonOverrides.Root || buttonOverrides.BaseButton || {},
|
|
79
78
|
StartEnhancer: buttonOverrides.StartEnhancer || {},
|
|
80
79
|
EndEnhancer: buttonOverrides.EndEnhancer || {},
|
|
81
80
|
LoadingSpinnerContainer: buttonOverrides.LoadingSpinnerContainer || {},
|
|
@@ -85,7 +84,7 @@ const ButtonTimed = props => {
|
|
|
85
84
|
overrides: buttonMergedOverrides,
|
|
86
85
|
onClick: onClick,
|
|
87
86
|
size: _button.SIZE.large,
|
|
88
|
-
kind:
|
|
87
|
+
kind: kind,
|
|
89
88
|
shape: _button.SHAPE.default,
|
|
90
89
|
disabled: disabled || timeRemaining === 0
|
|
91
90
|
}), children, /*#__PURE__*/React.createElement(TimerContainer, timerContainerProps, `(${(0, _utils.formatTime)(timeRemaining)})`));
|
|
@@ -20,6 +20,7 @@ const StyledBaseButtonTimed = exports.StyledBaseButtonTimed = (0, _index.withSty
|
|
|
20
20
|
$timeElapsed
|
|
21
21
|
}) => {
|
|
22
22
|
const completionPercentage = $timeElapsed / $initialTime * 100;
|
|
23
|
+
const restPercentage = 100 - completionPercentage;
|
|
23
24
|
const timeLeft = $initialTime - $timeElapsed;
|
|
24
25
|
return {
|
|
25
26
|
position: 'relative',
|
|
@@ -28,10 +29,10 @@ const StyledBaseButtonTimed = exports.StyledBaseButtonTimed = (0, _index.withSty
|
|
|
28
29
|
animationDuration: `${timeLeft}s`,
|
|
29
30
|
animationName: {
|
|
30
31
|
from: {
|
|
31
|
-
transform: `translateX(${completionPercentage}%)`
|
|
32
|
+
transform: `translateX(${completionPercentage}%) scaleX(${restPercentage}%)`
|
|
32
33
|
},
|
|
33
34
|
to: {
|
|
34
|
-
transform: 'translateX(100%)'
|
|
35
|
+
transform: 'translateX(100%) scaleX(0)'
|
|
35
36
|
}
|
|
36
37
|
},
|
|
37
38
|
animationTimingFunction: 'linear',
|
|
@@ -41,7 +42,8 @@ const StyledBaseButtonTimed = exports.StyledBaseButtonTimed = (0, _index.withSty
|
|
|
41
42
|
height: '100%',
|
|
42
43
|
zIndex: '1',
|
|
43
44
|
position: 'absolute',
|
|
44
|
-
backgroundColor: (0, _util.hexToRgb)($theme.colors.backgroundPrimary, '0.2')
|
|
45
|
+
backgroundColor: (0, _util.hexToRgb)($theme.colors.backgroundPrimary, '0.2'),
|
|
46
|
+
transformOrigin: 'left'
|
|
45
47
|
}
|
|
46
48
|
} : {})
|
|
47
49
|
};
|
package/button-timed/types.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { Override } from '../helpers/overrides';
|
|
|
4
4
|
export type ButtonTimedOverrides = ButtonOverrides & {
|
|
5
5
|
TimerContainer?: Override;
|
|
6
6
|
};
|
|
7
|
-
export type ButtonTimedProps = Omit<ButtonProps, '
|
|
7
|
+
export type ButtonTimedProps = Omit<ButtonProps, 'shape' | 'size' | 'onClick' | 'overrides'> & {
|
|
8
8
|
initialTime: number;
|
|
9
9
|
paused?: boolean;
|
|
10
10
|
onClick: (a?: React.SyntheticEvent<HTMLButtonElement>) => unknown;
|
|
@@ -122,14 +122,14 @@ function CategoricalFilter(props) {
|
|
|
122
122
|
value: query,
|
|
123
123
|
onChange: event => setQuery(event.target.value),
|
|
124
124
|
clearable: true
|
|
125
|
-
}),
|
|
125
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
126
126
|
style: {
|
|
127
127
|
// @ts-ignore
|
|
128
128
|
marginTop: showQuery ? theme.sizing.scale600 : null
|
|
129
129
|
}
|
|
130
130
|
}, /*#__PURE__*/React.createElement(FilterQuickControls, {
|
|
131
131
|
onSelectAll: () => {
|
|
132
|
-
|
|
132
|
+
filteredCategories.forEach(c => selection.add(c));
|
|
133
133
|
setSelection(new Set(selection));
|
|
134
134
|
},
|
|
135
135
|
onClearSelection: () => {
|
package/data-table/locale.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export type DataTableLocale = {
|
|
|
36
36
|
selectRow: string;
|
|
37
37
|
selectAllRows: string;
|
|
38
38
|
sortColumn: string;
|
|
39
|
+
textQueryPlaceholder: string;
|
|
39
40
|
};
|
|
40
41
|
declare const locale: {
|
|
41
42
|
emptyState: string;
|
|
@@ -75,5 +76,6 @@ declare const locale: {
|
|
|
75
76
|
selectRow: string;
|
|
76
77
|
selectAllRows: string;
|
|
77
78
|
sortColumn: string;
|
|
79
|
+
textQueryPlaceholder: string;
|
|
78
80
|
};
|
|
79
81
|
export default locale;
|
package/data-table/locale.js
CHANGED
|
@@ -30,7 +30,7 @@ const StatefulContainer = props => {
|
|
|
30
30
|
const [sortIndex, setSortIndex] = React.useState(typeof props.initialSortIndex === 'number' ? props.initialSortIndex : -1);
|
|
31
31
|
const [sortDirection, setSortDirection] = React.useState(props.initialSortDirection);
|
|
32
32
|
const [filters, setFilters] = React.useState(props.initialFilters || new Map());
|
|
33
|
-
const [textQuery, setTextQuery] = React.useState('');
|
|
33
|
+
const [textQuery, setTextQuery] = React.useState(typeof props.initialTextQuery === 'string' ? props.initialTextQuery : '');
|
|
34
34
|
const [selectedRowIds, setSelectedRowIds] = React.useState(props.initialSelectedRowIds || new Set());
|
|
35
35
|
|
|
36
36
|
// @ts-ignore
|
|
@@ -42,7 +42,7 @@ function useResizeObserver(ref, callback) {
|
|
|
42
42
|
function QueryInput(props) {
|
|
43
43
|
const [css, theme] = (0, _styles.useStyletron)();
|
|
44
44
|
const locale = React.useContext(_locale.LocaleContext);
|
|
45
|
-
const [value, setValue] = React.useState(
|
|
45
|
+
const [value, setValue] = React.useState(props.textQuery);
|
|
46
46
|
React.useEffect(() => {
|
|
47
47
|
const timeout = setTimeout(() => props.onChange(value), 250);
|
|
48
48
|
return () => clearTimeout(timeout);
|
|
@@ -70,7 +70,8 @@ function QueryInput(props) {
|
|
|
70
70
|
size: _input.SIZE.compact,
|
|
71
71
|
onChange: event => setValue(event.target.value),
|
|
72
72
|
value: value,
|
|
73
|
-
clearable: true
|
|
73
|
+
clearable: true,
|
|
74
|
+
placeholder: props.textQueryPlaceholder || locale.datatable.textQueryPlaceholder
|
|
74
75
|
}));
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -149,6 +150,7 @@ function StatefulDataTable(props) {
|
|
|
149
150
|
initialSelectedRowIds: props.initialSelectedRowIds,
|
|
150
151
|
initialSortIndex: props.initialSortIndex,
|
|
151
152
|
initialSortDirection: props.initialSortDirection,
|
|
153
|
+
initialTextQuery: props.initialTextQuery,
|
|
152
154
|
onFilterAdd: props.onFilterAdd,
|
|
153
155
|
onFilterRemove: props.onFilterRemove,
|
|
154
156
|
onIncludedRowsChange: props.onIncludedRowsChange,
|
|
@@ -191,7 +193,9 @@ function StatefulDataTable(props) {
|
|
|
191
193
|
paddingTop: theme.sizing.scale500
|
|
192
194
|
})
|
|
193
195
|
}, searchable && /*#__PURE__*/React.createElement(QueryInput, {
|
|
194
|
-
onChange: onTextQueryChange
|
|
196
|
+
onChange: onTextQueryChange,
|
|
197
|
+
textQuery: textQuery,
|
|
198
|
+
textQueryPlaceholder: props.textQueryPlaceholder
|
|
195
199
|
}), filterable && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_filterMenu.default, {
|
|
196
200
|
columns: props.columns,
|
|
197
201
|
filters: filters,
|
package/data-table/types.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ export type StatefulDataTableProps = {
|
|
|
81
81
|
initialSelectedRowIds?: Set<number | string>;
|
|
82
82
|
initialSortIndex?: number;
|
|
83
83
|
initialSortDirection?: SortDirections;
|
|
84
|
+
initialTextQuery?: string;
|
|
84
85
|
loading?: boolean;
|
|
85
86
|
loadingMessage?: string | React.ComponentType<{}>;
|
|
86
87
|
onFilterAdd?: (b: string, a: {
|
|
@@ -98,6 +99,7 @@ export type StatefulDataTableProps = {
|
|
|
98
99
|
rowHeight?: number;
|
|
99
100
|
rowHighlightIndex?: number;
|
|
100
101
|
searchable?: boolean;
|
|
102
|
+
textQueryPlaceholder?: string;
|
|
101
103
|
controlRef?: ControlRef;
|
|
102
104
|
};
|
|
103
105
|
export type DataTableProps = {
|
package/datepicker/day.js
CHANGED
|
@@ -205,11 +205,9 @@ class Day extends React.Component {
|
|
|
205
205
|
});
|
|
206
206
|
_defineProperty(this, "clampToDayStart", dt => {
|
|
207
207
|
const {
|
|
208
|
-
|
|
209
|
-
setMinutes,
|
|
210
|
-
setHours
|
|
208
|
+
startOfDay
|
|
211
209
|
} = this.dateHelpers;
|
|
212
|
-
return
|
|
210
|
+
return startOfDay(dt);
|
|
213
211
|
});
|
|
214
212
|
this.dateHelpers = new _dateHelpers.default(props.adapter);
|
|
215
213
|
}
|
|
@@ -82,6 +82,7 @@ declare class DateHelpers<T> {
|
|
|
82
82
|
setHours: (b: T, a: number) => T;
|
|
83
83
|
setMonth: (b: T, a: number) => T;
|
|
84
84
|
setYear: (b: T, a: number) => T;
|
|
85
|
+
startOfDay: (a: T) => T;
|
|
85
86
|
getMinutes: (a: T) => number;
|
|
86
87
|
getHours: (a: T) => number;
|
|
87
88
|
getMonth: (a: T) => number;
|
|
@@ -358,6 +358,9 @@ class DateHelpers {
|
|
|
358
358
|
_defineProperty(this, "setHours", (date, hours) => this.adapter.setHours(date, hours));
|
|
359
359
|
_defineProperty(this, "setMonth", (date, monthNumber) => this.adapter.setMonth(date, monthNumber));
|
|
360
360
|
_defineProperty(this, "setYear", (date, yearNumber) => this.adapter.setYear(date, yearNumber));
|
|
361
|
+
_defineProperty(this, "startOfDay", date => {
|
|
362
|
+
return this.adapter.startOfDay(date);
|
|
363
|
+
});
|
|
361
364
|
_defineProperty(this, "getMinutes", date => this.adapter.getMinutes(date));
|
|
362
365
|
_defineProperty(this, "getHours", date => this.adapter.getHours(date));
|
|
363
366
|
_defineProperty(this, "getMonth", date => this.adapter.getMonth(date));
|
package/dialog/dialog.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { DialogProps } from './types';
|
|
3
|
-
declare const Dialog: ({ artwork, buttonDock, children,
|
|
3
|
+
declare const Dialog: ({ artwork, buttonDock, children, onDismiss, showDismissButton, hasOverlay, heading, isOpen, overrides, placement, numHeadingLines, size, autoFocus, }: DialogProps) => React.JSX.Element;
|
|
4
4
|
export default Dialog;
|