baseui 0.0.0-next-90efe07 → 0.0.0-next-233fd73
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/badge/styled-components.js +4 -4
- package/badge/styled-components.js.flow +4 -4
- package/button/styled-components.js +1 -1
- package/button/styled-components.js.flow +1 -1
- package/checkbox/styled-components.js +1 -1
- package/checkbox/styled-components.js.flow +1 -1
- package/datepicker/index.d.ts +1 -1
- package/datepicker/index.js +7 -0
- package/datepicker/index.js.flow +1 -1
- package/es/badge/styled-components.js +4 -4
- package/es/button/styled-components.js +1 -1
- package/es/checkbox/styled-components.js +1 -1
- package/es/datepicker/index.js +1 -1
- package/es/icon/index.js +1 -1
- package/es/input/styled-components.js +8 -2
- package/es/input/utils.js +2 -0
- package/es/message-card/message-card.js +3 -1
- package/es/select/default-props.js +1 -1
- package/es/select/styled-components.js +17 -5
- package/es/tabs-motion/styled-components.js +23 -1
- package/es/tabs-motion/tabs.js +29 -5
- package/es/textarea/styled-components.js +16 -11
- package/es/textarea/textarea.js +4 -2
- package/es/themes/move-theme/typography.js +36 -0
- package/es/themes/shared/borders.js +8 -3
- package/es/themes/shared/typography.js +10 -10
- package/esm/badge/styled-components.js +4 -4
- package/esm/button/styled-components.js +1 -1
- package/esm/checkbox/styled-components.js +1 -1
- package/esm/datepicker/index.js +1 -1
- package/esm/icon/index.js +1 -1
- package/esm/input/styled-components.js +8 -2
- package/esm/input/utils.js +2 -0
- package/esm/message-card/message-card.js +3 -1
- package/esm/select/default-props.js +1 -1
- package/esm/select/styled-components.js +17 -5
- package/esm/tabs-motion/styled-components.js +60 -39
- package/esm/tabs-motion/tabs.js +85 -57
- package/esm/textarea/styled-components.js +7 -5
- package/esm/textarea/textarea.js +4 -2
- package/esm/themes/move-theme/typography.js +36 -0
- package/esm/themes/shared/borders.js +8 -3
- package/esm/themes/shared/typography.js +10 -10
- package/icon/index.d.ts +1 -1
- package/icon/index.js +8 -1
- package/icon/index.js.flow +1 -1
- package/input/styled-components.js +8 -2
- package/input/styled-components.js.flow +9 -2
- package/input/types.d.ts +3 -0
- package/input/types.js.flow +3 -0
- package/input/utils.js +2 -0
- package/message-card/message-card.js +3 -1
- package/package.json +1 -1
- package/select/default-props.js +1 -1
- package/select/styled-components.js +17 -5
- package/select/styled-components.js.flow +25 -5
- 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 +3 -0
- package/tabs-motion/types.js.flow +3 -0
- package/textarea/styled-components.js +7 -5
- package/textarea/textarea.js +4 -2
- package/textarea/types.d.ts +3 -0
- package/textarea/types.js.flow +3 -1
- package/themes/move-theme/typography.d.ts +36 -0
- package/themes/move-theme/typography.js +36 -0
- package/themes/move-theme/typography.js.flow +12 -0
- package/themes/shared/borders.js +8 -3
- package/themes/shared/borders.js.flow +7 -3
- package/themes/shared/typography.js +10 -10
- package/themes/shared/typography.js.flow +10 -10
- package/themes/types.d.ts +3 -0
- package/themes/types.js.flow +3 -0
- package/card/images.d.ts +0 -2
- package/card/images.js +0 -17
- package/card/images.js.flow +0 -18
- package/es/card/images.js +0 -8
- package/esm/card/images.js +0 -8
|
@@ -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
|
},
|
|
@@ -248,7 +248,7 @@ function getBorderRadiiStyles(_ref9) {
|
|
|
248
248
|
} else if ($shape === _constants.SHAPE.circle || $shape === _constants.SHAPE.round) {
|
|
249
249
|
value = '50%';
|
|
250
250
|
} else if ($size === _constants.SIZE.mini) {
|
|
251
|
-
value = $theme.borders.
|
|
251
|
+
value = $theme.borders.buttonBorderRadiusMini;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
return {
|
|
@@ -199,7 +199,7 @@ function getBorderRadiiStyles({ $theme, $size, $shape }) {
|
|
|
199
199
|
} else if ($shape === SHAPE.circle || $shape === SHAPE.round) {
|
|
200
200
|
value = '50%';
|
|
201
201
|
} else if ($size === SIZE.mini) {
|
|
202
|
-
value = $theme.borders.
|
|
202
|
+
value = $theme.borders.buttonBorderRadiusMini;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
return {
|
|
@@ -155,7 +155,7 @@ var Checkmark = (0, _styles.styled)('span', function (props) {
|
|
|
155
155
|
var tickColor = $disabled ? $theme.colors.tickMarkFillDisabled : $error ? $theme.colors.tickMarkFillError : $theme.colors.tickMarkFill;
|
|
156
156
|
var indeterminate = encodeURIComponent("\n <svg width=\"14\" height=\"4\" viewBox=\"0 0 14 4\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M14 0.5H0V3.5H14V0.5Z\" fill=\"".concat(tickColor, "\"/>\n </svg>\n "));
|
|
157
157
|
var check = encodeURIComponent("\n <svg width=\"17\" height=\"13\" viewBox=\"0 0 17 13\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z\" fill=\"".concat(tickColor, "\"/>\n </svg>\n "));
|
|
158
|
-
var borderRadius = $theme.borders.
|
|
158
|
+
var borderRadius = $theme.borders.checkboxBorderRadius;
|
|
159
159
|
var borderColor = getBorderColor(props);
|
|
160
160
|
return {
|
|
161
161
|
flex: '0 0 auto',
|
|
@@ -142,7 +142,7 @@ export const Checkmark = styled<SharedStylePropsT>('span', (props) => {
|
|
|
142
142
|
</svg>
|
|
143
143
|
`);
|
|
144
144
|
|
|
145
|
-
const borderRadius = $theme.borders.
|
|
145
|
+
const borderRadius = $theme.borders.checkboxBorderRadius;
|
|
146
146
|
const borderColor = getBorderColor(props);
|
|
147
147
|
|
|
148
148
|
return ({
|
package/datepicker/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { default as StatefulCalendar } from './stateful-calendar';
|
|
|
5
5
|
export { default as Datepicker, default as DatePicker } from './datepicker';
|
|
6
6
|
export { default as StatefulDatepicker, default as StatefulDatePicker, } from './stateful-datepicker';
|
|
7
7
|
export { formatDate } from './utils';
|
|
8
|
-
export { ORIENTATION, STATE_CHANGE_TYPE } from './constants';
|
|
8
|
+
export { DENSITY, ORIENTATION, STATE_CHANGE_TYPE } from './constants';
|
|
9
9
|
export * from './styled-components';
|
|
10
10
|
export * from '../timepicker';
|
|
11
11
|
export * from '../timezonepicker';
|
package/datepicker/index.js
CHANGED
|
@@ -12,6 +12,7 @@ var _exportNames = {
|
|
|
12
12
|
StatefulDatepicker: true,
|
|
13
13
|
StatefulDatePicker: true,
|
|
14
14
|
formatDate: true,
|
|
15
|
+
DENSITY: true,
|
|
15
16
|
ORIENTATION: true,
|
|
16
17
|
STATE_CHANGE_TYPE: true
|
|
17
18
|
};
|
|
@@ -21,6 +22,12 @@ Object.defineProperty(exports, "Calendar", {
|
|
|
21
22
|
return _calendar.default;
|
|
22
23
|
}
|
|
23
24
|
});
|
|
25
|
+
Object.defineProperty(exports, "DENSITY", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function get() {
|
|
28
|
+
return _constants.DENSITY;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
24
31
|
Object.defineProperty(exports, "DatePicker", {
|
|
25
32
|
enumerable: true,
|
|
26
33
|
get: function get() {
|
package/datepicker/index.js.flow
CHANGED
|
@@ -18,7 +18,7 @@ export { default as TimezonePicker } from '../timezonepicker/timezone-picker.js'
|
|
|
18
18
|
// Util functions
|
|
19
19
|
export { formatDate } from './utils/index.js';
|
|
20
20
|
// Constants
|
|
21
|
-
export { ORIENTATION, STATE_CHANGE_TYPE } from './constants.js';
|
|
21
|
+
export { DENSITY, ORIENTATION, STATE_CHANGE_TYPE } from './constants.js';
|
|
22
22
|
// Styled elements
|
|
23
23
|
export * from './styled-components.js';
|
|
24
24
|
// Flow
|
|
@@ -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
|
},
|
|
@@ -245,7 +245,7 @@ function getBorderRadiiStyles({
|
|
|
245
245
|
} else if ($shape === SHAPE.circle || $shape === SHAPE.round) {
|
|
246
246
|
value = '50%';
|
|
247
247
|
} else if ($size === SIZE.mini) {
|
|
248
|
-
value = $theme.borders.
|
|
248
|
+
value = $theme.borders.buttonBorderRadiusMini;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
return {
|
|
@@ -180,7 +180,7 @@ export const Checkmark = styled('span', props => {
|
|
|
180
180
|
<path d="M6.50002 12.6L0.400024 6.60002L2.60002 4.40002L6.50002 8.40002L13.9 0.900024L16.1 3.10002L6.50002 12.6Z" fill="${tickColor}"/>
|
|
181
181
|
</svg>
|
|
182
182
|
`);
|
|
183
|
-
const borderRadius = $theme.borders.
|
|
183
|
+
const borderRadius = $theme.borders.checkboxBorderRadius;
|
|
184
184
|
const borderColor = getBorderColor(props);
|
|
185
185
|
return {
|
|
186
186
|
flex: '0 0 auto',
|
package/es/datepicker/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export { default as StatefulDatepicker, default as StatefulDatePicker } from './
|
|
|
12
12
|
|
|
13
13
|
export { formatDate } from './utils'; // Constants
|
|
14
14
|
|
|
15
|
-
export { ORIENTATION, STATE_CHANGE_TYPE } from './constants'; // Styled elements
|
|
15
|
+
export { DENSITY, ORIENTATION, STATE_CHANGE_TYPE } from './constants'; // Styled elements
|
|
16
16
|
|
|
17
17
|
export * from './styled-components'; // Dependency components and their types
|
|
18
18
|
|
package/es/icon/index.js
CHANGED
|
@@ -5,7 +5,7 @@ This source code is licensed under the MIT license found in the
|
|
|
5
5
|
LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
export { default as Icon } from './icon';
|
|
8
|
-
export { Svg as StyledSvg } from './styled-components';
|
|
8
|
+
export { Svg as StyledSvg, getSvgStyles } from './styled-components';
|
|
9
9
|
export * from './icon-exports';
|
|
10
10
|
export * from './types';
|
|
11
11
|
/** @deprecated use StyledComponentArgs instead. To be removed in future versions.*/
|
|
@@ -163,7 +163,13 @@ function getRootColors($disabled, $isFocused, $error, $positive = false, colors)
|
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
function getRootBorderRadius(
|
|
166
|
+
function getRootBorderRadius(size, borders) {
|
|
167
|
+
let radius = borders.inputBorderRadius;
|
|
168
|
+
|
|
169
|
+
if (size === SIZE.mini) {
|
|
170
|
+
radius = borders.inputBorderRadiusMini;
|
|
171
|
+
}
|
|
172
|
+
|
|
167
173
|
return {
|
|
168
174
|
borderTopLeftRadius: radius,
|
|
169
175
|
borderBottomLeftRadius: radius,
|
|
@@ -206,7 +212,7 @@ export const getRootStyles = props => {
|
|
|
206
212
|
transitionProperty: 'border',
|
|
207
213
|
transitionDuration: animation.timing200,
|
|
208
214
|
transitionTimingFunction: animation.easeOutCurve,
|
|
209
|
-
...getRootBorderRadius(borders
|
|
215
|
+
...getRootBorderRadius($size, borders),
|
|
210
216
|
...getFont($size, typography),
|
|
211
217
|
...getRootColors($disabled, $isFocused, $error, $positive, colors),
|
|
212
218
|
...getRootPadding($adjoined, $size, sizing, $theme.direction, $hasIconTrailing)
|
package/es/input/utils.js
CHANGED
|
@@ -12,6 +12,7 @@ export function getSharedProps(props, state) {
|
|
|
12
12
|
adjoined,
|
|
13
13
|
size,
|
|
14
14
|
required,
|
|
15
|
+
resize,
|
|
15
16
|
readOnly
|
|
16
17
|
} = props;
|
|
17
18
|
const {
|
|
@@ -25,6 +26,7 @@ export function getSharedProps(props, state) {
|
|
|
25
26
|
$adjoined: adjoined,
|
|
26
27
|
$size: size,
|
|
27
28
|
$required: required,
|
|
29
|
+
$resize: resize,
|
|
28
30
|
$isReadOnly: readOnly
|
|
29
31
|
};
|
|
30
32
|
}
|
|
@@ -82,11 +82,12 @@ const MessageCard = ({
|
|
|
82
82
|
$imageLayout: layout
|
|
83
83
|
}, RootProps), image && /*#__PURE__*/React.createElement(Image, _extends({
|
|
84
84
|
role: "img",
|
|
85
|
-
|
|
85
|
+
"aria-label": ariaLabel,
|
|
86
86
|
$src: src,
|
|
87
87
|
$imageLayout: layout,
|
|
88
88
|
$backgroundPosition: backgroundPosition
|
|
89
89
|
}, ImageProps)), /*#__PURE__*/React.createElement(ContentContainer, ContentContainerProps, heading && /*#__PURE__*/React.createElement(HeadingContainer, HeadingContainerProps, heading), paragraph && /*#__PURE__*/React.createElement(ParagraphContainer, ParagraphContainerProps, paragraph), buttonLabel && /*#__PURE__*/React.createElement(Button, _extends({
|
|
90
|
+
$as: "div",
|
|
90
91
|
kind: buttonKind,
|
|
91
92
|
shape: SHAPE.pill,
|
|
92
93
|
size: SIZE.compact,
|
|
@@ -96,6 +97,7 @@ const MessageCard = ({
|
|
|
96
97
|
overrides: {
|
|
97
98
|
BaseButton: {
|
|
98
99
|
style: {
|
|
100
|
+
textAlign: 'center',
|
|
99
101
|
pointerEvents: 'none',
|
|
100
102
|
...(buttonKind === BUTTON_KIND.tertiary ? {
|
|
101
103
|
marginTop: theme.sizing.scale100,
|
|
@@ -19,6 +19,21 @@ function getFont(size = SIZE.default, typography) {
|
|
|
19
19
|
}[size];
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
function getBorderRadius(size, borders) {
|
|
23
|
+
let radius = borders.inputBorderRadius;
|
|
24
|
+
|
|
25
|
+
if (size === SIZE.mini) {
|
|
26
|
+
radius = borders.inputBorderRadiusMini;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
borderTopLeftRadius: radius,
|
|
31
|
+
borderBottomLeftRadius: radius,
|
|
32
|
+
borderTopRightRadius: radius,
|
|
33
|
+
borderBottomRightRadius: radius
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
22
37
|
function getControlPadding(props) {
|
|
23
38
|
const {
|
|
24
39
|
$theme,
|
|
@@ -170,17 +185,14 @@ export const StyledControlContainer = styled('div', props => {
|
|
|
170
185
|
$isPseudoFocused,
|
|
171
186
|
$type,
|
|
172
187
|
$searchable,
|
|
188
|
+
$size,
|
|
173
189
|
$theme: {
|
|
174
190
|
borders,
|
|
175
191
|
colors,
|
|
176
192
|
animation
|
|
177
193
|
}
|
|
178
194
|
} = props;
|
|
179
|
-
return {
|
|
180
|
-
borderTopLeftRadius: borders.inputBorderRadius,
|
|
181
|
-
borderTopRightRadius: borders.inputBorderRadius,
|
|
182
|
-
borderBottomRightRadius: borders.inputBorderRadius,
|
|
183
|
-
borderBottomLeftRadius: borders.inputBorderRadius,
|
|
195
|
+
return { ...getBorderRadius($size, borders),
|
|
184
196
|
boxSizing: 'border-box',
|
|
185
197
|
overflow: 'hidden',
|
|
186
198
|
width: '100%',
|
|
@@ -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"
|
|
@@ -7,23 +7,28 @@ LICENSE file in the root directory of this source tree.
|
|
|
7
7
|
import { styled } from '../styles';
|
|
8
8
|
import { getInputStyles, getInputContainerStyles, getRootStyles } from '../input/styled-components';
|
|
9
9
|
export const StyledTextAreaRoot = styled('div', props => {
|
|
10
|
-
return getRootStyles({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
return { ...getRootStyles({
|
|
11
|
+
$positive: false,
|
|
12
|
+
...props,
|
|
13
|
+
$hasIconTrailing: false
|
|
14
|
+
}),
|
|
15
|
+
width: props.$resize ? 'fit-content' : '100%'
|
|
16
|
+
};
|
|
15
17
|
});
|
|
16
18
|
StyledTextAreaRoot.displayName = "StyledTextAreaRoot";
|
|
17
19
|
StyledTextAreaRoot.displayName = 'StyledTextAreaRoot';
|
|
18
|
-
export const StyledTextareaContainer = styled('div', props =>
|
|
20
|
+
export const StyledTextareaContainer = styled('div', props => {
|
|
21
|
+
return getInputContainerStyles({
|
|
19
22
|
$positive: false,
|
|
20
23
|
...props
|
|
21
|
-
})
|
|
22
|
-
})
|
|
24
|
+
});
|
|
25
|
+
});
|
|
23
26
|
StyledTextareaContainer.displayName = "StyledTextareaContainer";
|
|
24
27
|
StyledTextareaContainer.displayName = 'StyledTextareaContainer';
|
|
25
|
-
export const StyledTextarea = styled('textarea', props =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
export const StyledTextarea = styled('textarea', props => {
|
|
29
|
+
return { ...getInputStyles(props),
|
|
30
|
+
resize: props.$resize || 'none'
|
|
31
|
+
};
|
|
32
|
+
});
|
|
28
33
|
StyledTextarea.displayName = "StyledTextarea";
|
|
29
34
|
StyledTextarea.displayName = 'StyledTextarea';
|
package/es/textarea/textarea.js
CHANGED
|
@@ -60,12 +60,14 @@ class Textarea extends React.Component {
|
|
|
60
60
|
$disabled: this.props.disabled,
|
|
61
61
|
$error: this.props.error,
|
|
62
62
|
$positive: this.props.positive,
|
|
63
|
-
$required: this.props.required
|
|
63
|
+
$required: this.props.required,
|
|
64
|
+
$resize: this.props.resize
|
|
64
65
|
}, rootProps), /*#__PURE__*/React.createElement(BaseInput, _extends({}, this.props, {
|
|
65
66
|
type: CUSTOM_INPUT_TYPE.textarea,
|
|
66
67
|
overrides: inputOverrides,
|
|
67
68
|
onFocus: this.onFocus,
|
|
68
|
-
onBlur: this.onBlur
|
|
69
|
+
onBlur: this.onBlur,
|
|
70
|
+
resize: this.props.resize
|
|
69
71
|
})));
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -22,6 +22,24 @@ export const typography = {
|
|
|
22
22
|
font1150: {
|
|
23
23
|
fontFamily: secondaryFontFamily
|
|
24
24
|
},
|
|
25
|
+
font1050: {
|
|
26
|
+
fontFamily: secondaryFontFamily
|
|
27
|
+
},
|
|
28
|
+
font950: {
|
|
29
|
+
fontFamily: secondaryFontFamily
|
|
30
|
+
},
|
|
31
|
+
font850: {
|
|
32
|
+
fontFamily: secondaryFontFamily
|
|
33
|
+
},
|
|
34
|
+
font750: {
|
|
35
|
+
fontFamily: secondaryFontFamily
|
|
36
|
+
},
|
|
37
|
+
font650: {
|
|
38
|
+
fontFamily: secondaryFontFamily
|
|
39
|
+
},
|
|
40
|
+
font550: {
|
|
41
|
+
fontFamily: secondaryFontFamily
|
|
42
|
+
},
|
|
25
43
|
DisplayLarge: {
|
|
26
44
|
fontFamily: secondaryFontFamily
|
|
27
45
|
},
|
|
@@ -34,6 +52,24 @@ export const typography = {
|
|
|
34
52
|
DisplayXSmall: {
|
|
35
53
|
fontFamily: secondaryFontFamily
|
|
36
54
|
},
|
|
55
|
+
HeadingXXLarge: {
|
|
56
|
+
fontFamily: secondaryFontFamily
|
|
57
|
+
},
|
|
58
|
+
HeadingXLarge: {
|
|
59
|
+
fontFamily: secondaryFontFamily
|
|
60
|
+
},
|
|
61
|
+
HeadingLarge: {
|
|
62
|
+
fontFamily: secondaryFontFamily
|
|
63
|
+
},
|
|
64
|
+
HeadingMedium: {
|
|
65
|
+
fontFamily: secondaryFontFamily
|
|
66
|
+
},
|
|
67
|
+
HeadingSmall: {
|
|
68
|
+
fontFamily: secondaryFontFamily
|
|
69
|
+
},
|
|
70
|
+
HeadingXSmall: {
|
|
71
|
+
fontFamily: secondaryFontFamily
|
|
72
|
+
},
|
|
37
73
|
MonoParagraphXSmall: {
|
|
38
74
|
fontFamily: monoFontFamily
|
|
39
75
|
},
|
|
@@ -47,13 +47,18 @@ const borders = {
|
|
|
47
47
|
useRoundedCorners: true,
|
|
48
48
|
|
|
49
49
|
/** Button, ButtonGroup */
|
|
50
|
+
buttonBorderRadiusMini: '4px',
|
|
50
51
|
buttonBorderRadius: '8px',
|
|
51
52
|
|
|
52
|
-
/**
|
|
53
|
-
|
|
53
|
+
/** Checkbox */
|
|
54
|
+
checkboxBorderRadius: '0px',
|
|
55
|
+
|
|
56
|
+
/** Input, Select, Textarea */
|
|
57
|
+
inputBorderRadiusMini: '4px',
|
|
58
|
+
inputBorderRadius: '8px',
|
|
54
59
|
|
|
55
60
|
/** Popover, Menu, Tooltip */
|
|
56
|
-
popoverBorderRadius: '
|
|
61
|
+
popoverBorderRadius: '8px',
|
|
57
62
|
|
|
58
63
|
/** Card, Datepicker, Modal, Toast, Notification */
|
|
59
64
|
surfaceBorderRadius: '0px',
|
|
@@ -60,61 +60,61 @@ export default ((fontTokens = defaultFontTokens) => {
|
|
|
60
60
|
const font550 = {
|
|
61
61
|
fontFamily: fontTokens.primaryFontFamily,
|
|
62
62
|
fontSize: '20px',
|
|
63
|
-
fontWeight:
|
|
63
|
+
fontWeight: 700,
|
|
64
64
|
lineHeight: '28px'
|
|
65
65
|
};
|
|
66
66
|
const font650 = {
|
|
67
67
|
fontFamily: fontTokens.primaryFontFamily,
|
|
68
68
|
fontSize: '24px',
|
|
69
|
-
fontWeight:
|
|
69
|
+
fontWeight: 700,
|
|
70
70
|
lineHeight: '32px'
|
|
71
71
|
};
|
|
72
72
|
const font750 = {
|
|
73
73
|
fontFamily: fontTokens.primaryFontFamily,
|
|
74
74
|
fontSize: '28px',
|
|
75
|
-
fontWeight:
|
|
75
|
+
fontWeight: 700,
|
|
76
76
|
lineHeight: '36px'
|
|
77
77
|
};
|
|
78
78
|
const font850 = {
|
|
79
79
|
fontFamily: fontTokens.primaryFontFamily,
|
|
80
80
|
fontSize: '32px',
|
|
81
|
-
fontWeight:
|
|
81
|
+
fontWeight: 700,
|
|
82
82
|
lineHeight: '40px'
|
|
83
83
|
};
|
|
84
84
|
const font950 = {
|
|
85
85
|
fontFamily: fontTokens.primaryFontFamily,
|
|
86
86
|
fontSize: '36px',
|
|
87
|
-
fontWeight:
|
|
87
|
+
fontWeight: 700,
|
|
88
88
|
lineHeight: '44px'
|
|
89
89
|
};
|
|
90
90
|
const font1050 = {
|
|
91
91
|
fontFamily: fontTokens.primaryFontFamily,
|
|
92
92
|
fontSize: '40px',
|
|
93
|
-
fontWeight:
|
|
93
|
+
fontWeight: 700,
|
|
94
94
|
lineHeight: '52px'
|
|
95
95
|
};
|
|
96
96
|
const font1150 = {
|
|
97
97
|
fontFamily: fontTokens.primaryFontFamily,
|
|
98
98
|
fontSize: '36px',
|
|
99
|
-
fontWeight:
|
|
99
|
+
fontWeight: 700,
|
|
100
100
|
lineHeight: '44px'
|
|
101
101
|
};
|
|
102
102
|
const font1250 = {
|
|
103
103
|
fontFamily: fontTokens.primaryFontFamily,
|
|
104
104
|
fontSize: '44px',
|
|
105
|
-
fontWeight:
|
|
105
|
+
fontWeight: 700,
|
|
106
106
|
lineHeight: '52px'
|
|
107
107
|
};
|
|
108
108
|
const font1350 = {
|
|
109
109
|
fontFamily: fontTokens.primaryFontFamily,
|
|
110
110
|
fontSize: '52px',
|
|
111
|
-
fontWeight:
|
|
111
|
+
fontWeight: 700,
|
|
112
112
|
lineHeight: '64px'
|
|
113
113
|
};
|
|
114
114
|
const font1450 = {
|
|
115
115
|
fontFamily: fontTokens.primaryFontFamily,
|
|
116
116
|
fontSize: '96px',
|
|
117
|
-
fontWeight:
|
|
117
|
+
fontWeight: 700,
|
|
118
118
|
lineHeight: '112px'
|
|
119
119
|
};
|
|
120
120
|
return {
|