grommet 2.33.1 → 2.33.2
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/components/Anchor/Anchor.js +2 -2
- package/components/Anchor/StyledAnchor.js +6 -6
- package/components/Box/Box.js +1 -1
- package/components/Button/Button.js +8 -8
- package/components/Button/StyledButtonKind.js +5 -5
- package/components/Calendar/Calendar.js +3 -3
- package/components/CheckBox/StyledCheckBox.js +8 -8
- package/components/Data/DataForm.js +15 -10
- package/components/Data/stories/Infinite.js +2 -2
- package/components/Data/stories/SpaceX.js +1 -1
- package/components/Data/stories/StarWars.js +1 -1
- package/components/DataChart/DataChart.js +4 -4
- package/components/DataChart/Detail.js +1 -1
- package/components/DataFilter/DataFilter.js +3 -3
- package/components/DataTable/Header.js +1 -1
- package/components/DataTable/buildState.js +8 -8
- package/components/DateInput/DateInput.js +1 -1
- package/components/DateInput/utils.js +2 -2
- package/components/Drop/DropContainer.js +2 -2
- package/components/FileInput/utils/formatBytes.js +2 -2
- package/components/FormField/FormField.js +1 -1
- package/components/Header/Header.js +4 -4
- package/components/Layer/Layer.js +4 -2
- package/components/List/List.js +5 -5
- package/components/MaskedInput/MaskedInput.js +2 -1
- package/components/Menu/Menu.js +7 -3
- package/components/NameValueList/NameValueList.js +2 -2
- package/components/NameValuePair/NameValuePair.js +2 -2
- package/components/Notification/Notification.js +3 -3
- package/components/RangeInput/StyledRangeInput.js +4 -4
- package/components/Select/EmptySearchOption.js +3 -3
- package/components/Select/StyledSelect.js +4 -4
- package/components/SelectMultiple/SelectMultiple.js +4 -4
- package/components/SelectMultiple/SelectMultipleContainer.js +1 -1
- package/components/Skeleton/Skeleton.js +1 -1
- package/components/Skeleton/StyledSkeleton.js +2 -2
- package/components/Tag/Tag.js +5 -5
- package/components/TextArea/StyledTextArea.js +1 -1
- package/components/ThumbsRating/ThumbsRating.js +6 -6
- package/components/Video/Video.js +2 -2
- package/contexts/AnalyticsContext/AnalyticsContext.js +2 -2
- package/es6/components/Anchor/Anchor.js +2 -2
- package/es6/components/Anchor/StyledAnchor.js +6 -6
- package/es6/components/Box/Box.js +1 -1
- package/es6/components/Button/Button.js +8 -8
- package/es6/components/Button/StyledButtonKind.js +5 -5
- package/es6/components/Calendar/Calendar.js +3 -3
- package/es6/components/CheckBox/StyledCheckBox.js +8 -8
- package/es6/components/Data/DataForm.js +15 -10
- package/es6/components/Data/stories/Infinite.js +2 -2
- package/es6/components/Data/stories/SpaceX.js +1 -1
- package/es6/components/Data/stories/StarWars.js +1 -1
- package/es6/components/DataChart/DataChart.js +4 -4
- package/es6/components/DataChart/Detail.js +1 -1
- package/es6/components/DataFilter/DataFilter.js +3 -3
- package/es6/components/DataTable/Header.js +1 -1
- package/es6/components/DataTable/buildState.js +8 -8
- package/es6/components/DateInput/DateInput.js +1 -1
- package/es6/components/DateInput/utils.js +2 -2
- package/es6/components/Drop/DropContainer.js +2 -2
- package/es6/components/FileInput/utils/formatBytes.js +2 -2
- package/es6/components/FormField/FormField.js +1 -1
- package/es6/components/Header/Header.js +4 -4
- package/es6/components/Layer/Layer.js +4 -2
- package/es6/components/List/List.js +5 -5
- package/es6/components/MaskedInput/MaskedInput.js +2 -1
- package/es6/components/Menu/Menu.js +7 -3
- package/es6/components/NameValueList/NameValueList.js +2 -2
- package/es6/components/NameValuePair/NameValuePair.js +2 -2
- package/es6/components/Notification/Notification.js +3 -3
- package/es6/components/RangeInput/StyledRangeInput.js +4 -4
- package/es6/components/Select/EmptySearchOption.js +3 -3
- package/es6/components/Select/StyledSelect.js +4 -4
- package/es6/components/SelectMultiple/SelectMultiple.js +4 -4
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +1 -1
- package/es6/components/Skeleton/Skeleton.js +1 -1
- package/es6/components/Skeleton/StyledSkeleton.js +2 -2
- package/es6/components/Tag/Tag.js +5 -5
- package/es6/components/TextArea/StyledTextArea.js +1 -1
- package/es6/components/ThumbsRating/ThumbsRating.js +6 -6
- package/es6/components/Video/Video.js +2 -2
- package/es6/contexts/AnalyticsContext/AnalyticsContext.js +2 -2
- package/es6/utils/background.js +4 -4
- package/es6/utils/styles.js +2 -2
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/package.json +22 -22
- package/utils/background.js +4 -4
- package/utils/styles.js +2 -2
|
@@ -267,20 +267,20 @@ export var normalizeCellProps = function normalizeCellProps(props, theme) {
|
|
|
267
267
|
pinned: {}
|
|
268
268
|
};
|
|
269
269
|
cellPropertyNames.forEach(function (propName) {
|
|
270
|
-
var _props$propName, _theme$dataTable, _theme$
|
|
271
|
-
var value = (props == null
|
|
270
|
+
var _props$propName, _theme$dataTable, _theme$table, _props$propName3, _props$propName5, _theme$dataTable2;
|
|
271
|
+
var value = (props == null || (_props$propName = props[propName]) == null ? void 0 : _props$propName[context]) ||
|
|
272
272
|
// if the propName is used without context, it applies to all contexts
|
|
273
273
|
tableContextNames.every(function (n) {
|
|
274
274
|
var _props$propName2;
|
|
275
275
|
return !(props != null && (_props$propName2 = props[propName]) != null && _props$propName2[n]);
|
|
276
|
-
}) && (props == null ? void 0 : props[propName]) || (theme == null
|
|
276
|
+
}) && (props == null ? void 0 : props[propName]) || (theme == null || (_theme$dataTable = theme.dataTable) == null || (_theme$dataTable = _theme$dataTable[context]) == null ? void 0 : _theme$dataTable[propName]) || (theme == null || (_theme$table = theme.table) == null || (_theme$table = _theme$table[context]) == null ? void 0 : _theme$table[propName]);
|
|
277
277
|
if (value !== undefined) result[context][propName] = value;
|
|
278
278
|
|
|
279
279
|
// pinned case
|
|
280
|
-
value = (props == null
|
|
281
|
-
var _props$propName4
|
|
282
|
-
return !(props != null && (_props$propName4 = props[propName]) != null && (_props$propName4
|
|
283
|
-
}) && (props == null
|
|
280
|
+
value = (props == null || (_props$propName3 = props[propName]) == null || (_props$propName3 = _props$propName3.pinned) == null ? void 0 : _props$propName3[context]) || context === 'body' && tableContextNames.every(function (n) {
|
|
281
|
+
var _props$propName4;
|
|
282
|
+
return !(props != null && (_props$propName4 = props[propName]) != null && (_props$propName4 = _props$propName4.pinned) != null && _props$propName4[n]);
|
|
283
|
+
}) && (props == null || (_props$propName5 = props[propName]) == null ? void 0 : _props$propName5.pinned) || (theme == null || (_theme$dataTable2 = theme.dataTable) == null || (_theme$dataTable2 = _theme$dataTable2.pinned) == null || (_theme$dataTable2 = _theme$dataTable2[context]) == null ? void 0 : _theme$dataTable2[propName]);
|
|
284
284
|
if (value !== undefined) {
|
|
285
285
|
if (propName === 'background' && theme.background && value.opacity && !value.color)
|
|
286
286
|
// theme context has an active background color but the
|
|
@@ -304,7 +304,7 @@ export var normalizeRowCellProps = function normalizeRowCellProps(rowProps, cell
|
|
|
304
304
|
};
|
|
305
305
|
['background', 'border', 'pad'].forEach(function (propName) {
|
|
306
306
|
var _rowProps$primaryKey;
|
|
307
|
-
var row = primaryKey && rowProps && (rowProps == null
|
|
307
|
+
var row = primaryKey && rowProps && (rowProps == null || (_rowProps$primaryKey = rowProps[primaryKey]) == null ? void 0 : _rowProps$primaryKey[propName]);
|
|
308
308
|
var cell = cellProps[propName];
|
|
309
309
|
var value = row && (Array.isArray(row) ? row[index % row.length] : row) || (Array.isArray(cell) ? cell[index % cell.length] : cell);
|
|
310
310
|
if (value !== undefined) result[propName] = value;
|
|
@@ -141,7 +141,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
141
141
|
// resets the textValue
|
|
142
142
|
useEffect(function () {
|
|
143
143
|
var _ref$current;
|
|
144
|
-
var form = ref == null
|
|
144
|
+
var form = ref == null || (_ref$current = ref.current) == null ? void 0 : _ref$current.form;
|
|
145
145
|
var handleFormReset = function handleFormReset(e) {
|
|
146
146
|
if (schema && ref.current && e.target.contains(ref.current)) {
|
|
147
147
|
setTextValue('');
|
|
@@ -171,14 +171,14 @@ export var textToValue = function textToValue(text, schema, range, reference, ou
|
|
|
171
171
|
parts.m = pullDigits(text, index);
|
|
172
172
|
index += parts.m.length;
|
|
173
173
|
} else if (_char3 === 'd') {
|
|
174
|
-
var _parts
|
|
174
|
+
var _parts;
|
|
175
175
|
parts.d = pullDigits(text, index);
|
|
176
176
|
// when format is something like yyyy/mm/dd,
|
|
177
177
|
// '0' as incomplete day can cause date to be
|
|
178
178
|
// prematurely calculated.
|
|
179
179
|
// ex: 2022/01/0 would reutrn 2021/12/31 in addDate()
|
|
180
180
|
if (parts.d === '0') delete parts.d;
|
|
181
|
-
index += ((_parts = parts) == null
|
|
181
|
+
index += ((_parts = parts) == null || (_parts = _parts.d) == null ? void 0 : _parts.length) || 0;
|
|
182
182
|
} else if (_char3 === 'y') {
|
|
183
183
|
parts.y = pullDigits(text, index);
|
|
184
184
|
index += parts.y.length;
|
|
@@ -82,7 +82,7 @@ var DropContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
82
82
|
useEffect(function () {
|
|
83
83
|
var notifyAlign = function notifyAlign() {
|
|
84
84
|
var _dropRef$current;
|
|
85
|
-
var styleCurrent = dropRef == null
|
|
85
|
+
var styleCurrent = dropRef == null || (_dropRef$current = dropRef.current) == null ? void 0 : _dropRef$current.style;
|
|
86
86
|
var alignControl = (styleCurrent == null ? void 0 : styleCurrent.top) !== '' ? 'top' : 'bottom';
|
|
87
87
|
onAlign(alignControl);
|
|
88
88
|
};
|
|
@@ -193,7 +193,7 @@ var DropContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
193
193
|
};
|
|
194
194
|
var scrollParents;
|
|
195
195
|
var addScrollListeners = function addScrollListeners() {
|
|
196
|
-
scrollParents = findScrollParents(dropTarget);
|
|
196
|
+
scrollParents = findScrollParents((dropTarget == null ? void 0 : dropTarget.current) || dropTarget);
|
|
197
197
|
scrollParents.forEach(function (scrollParent) {
|
|
198
198
|
return scrollParent.addEventListener('scroll', place);
|
|
199
199
|
});
|
|
@@ -2,8 +2,8 @@ var SI_CONVERSION_FACTOR = 1000;
|
|
|
2
2
|
var IEC_CONVERSION_FACTOR = 1024;
|
|
3
3
|
var getCurrentOS = function getCurrentOS() {
|
|
4
4
|
var currentOS = ['Win', 'Linux', 'Mac'].find(function (v) {
|
|
5
|
-
var _window
|
|
6
|
-
if (typeof window !== 'undefined') return ((_window = window) == null
|
|
5
|
+
var _window;
|
|
6
|
+
if (typeof window !== 'undefined') return ((_window = window) == null || (_window = _window.navigator) == null || (_window = _window.userAgent) == null ? void 0 : _window.indexOf(v)) >= 0;
|
|
7
7
|
return undefined;
|
|
8
8
|
});
|
|
9
9
|
return currentOS;
|
|
@@ -194,7 +194,7 @@ var FormField = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
194
194
|
return /*#__PURE__*/cloneElement(child, {
|
|
195
195
|
plain: true,
|
|
196
196
|
focusIndicator: false,
|
|
197
|
-
pad: 'CheckBox'.indexOf(child.type.displayName) !== -1 ? formFieldTheme == null
|
|
197
|
+
pad: 'CheckBox'.indexOf(child.type.displayName) !== -1 ? formFieldTheme == null || (_formFieldTheme$check = formFieldTheme.checkBox) == null ? void 0 : _formFieldTheme$check.pad : undefined
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
return child;
|
|
@@ -6,7 +6,7 @@ import { ThemeContext } from 'styled-components';
|
|
|
6
6
|
import { findScrollParent, useForwardedRef } from '../../utils';
|
|
7
7
|
import { Box } from '../Box';
|
|
8
8
|
var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
9
|
-
var _theme$header2
|
|
9
|
+
var _theme$header2;
|
|
10
10
|
var sticky = _ref.sticky,
|
|
11
11
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
12
12
|
var theme = useContext(ThemeContext);
|
|
@@ -23,11 +23,11 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
23
23
|
header.style.top = "-" + header.getBoundingClientRect().height + "px";
|
|
24
24
|
header.style.zIndex = '';
|
|
25
25
|
} else if (scrollTop - nextScrollTop > 0) {
|
|
26
|
-
var _theme$header
|
|
26
|
+
var _theme$header;
|
|
27
27
|
// ensure that header moves with the target
|
|
28
28
|
header.style.position = 'sticky';
|
|
29
29
|
header.style.top = '0px';
|
|
30
|
-
header.style.zIndex = "" + ((_theme$header = theme.header) == null
|
|
30
|
+
header.style.zIndex = "" + ((_theme$header = theme.header) == null || (_theme$header = _theme$header.sticky) == null ? void 0 : _theme$header.zIndex);
|
|
31
31
|
header.style.transition = 'top 0.6s';
|
|
32
32
|
}
|
|
33
33
|
scrollTop = nextScrollTop;
|
|
@@ -44,7 +44,7 @@ var Header = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
44
44
|
window.removeEventListener('scroll', updateScrollDir, true);
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
}, [headerRef, sticky, (_theme$header2 = theme.header) == null
|
|
47
|
+
}, [headerRef, sticky, (_theme$header2 = theme.header) == null || (_theme$header2 = _theme$header2.sticky) == null ? void 0 : _theme$header2.zIndex]);
|
|
48
48
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
49
49
|
align: "center",
|
|
50
50
|
as: "header",
|
|
@@ -56,11 +56,13 @@ var Layer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
56
56
|
// we add the id and query here so the unit tests work
|
|
57
57
|
var clone = containerTarget.getRootNode().getElementById('layerClone');
|
|
58
58
|
if (clone) {
|
|
59
|
-
containerTarget.
|
|
59
|
+
if (containerTarget.contains(clone)) {
|
|
60
|
+
containerTarget.removeChild(clone);
|
|
61
|
+
}
|
|
60
62
|
layerContainer.remove();
|
|
61
63
|
}
|
|
62
64
|
}, animationDuration);
|
|
63
|
-
} else {
|
|
65
|
+
} else if (containerTarget.contains(layerContainer)) {
|
|
64
66
|
containerTarget.removeChild(layerContainer);
|
|
65
67
|
}
|
|
66
68
|
}
|
|
@@ -43,12 +43,12 @@ var StyledItem = styled(Box).withConfig({
|
|
|
43
43
|
forceOutline: true,
|
|
44
44
|
skipSvgChildren: true
|
|
45
45
|
}), function (props) {
|
|
46
|
-
var _props$theme$list
|
|
46
|
+
var _props$theme$list;
|
|
47
47
|
var disabledStyle;
|
|
48
|
-
if (props.isDisabled && (_props$theme$list = props.theme.list) != null && (_props$theme$list
|
|
49
|
-
var _props$theme$list$
|
|
50
|
-
color = _props$theme$list$
|
|
51
|
-
cursor = _props$theme$list$
|
|
48
|
+
if (props.isDisabled && (_props$theme$list = props.theme.list) != null && (_props$theme$list = _props$theme$list.item) != null && _props$theme$list.disabled) {
|
|
49
|
+
var _props$theme$list$ite = props.theme.list.item.disabled,
|
|
50
|
+
color = _props$theme$list$ite.color,
|
|
51
|
+
cursor = _props$theme$list$ite.cursor;
|
|
52
52
|
disabledStyle = {
|
|
53
53
|
color: normalizeColor(color, props.theme),
|
|
54
54
|
cursor: cursor
|
|
@@ -148,7 +148,8 @@ var MaskedInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
148
148
|
var formContext = useContext(FormContext);
|
|
149
149
|
var _formContext$useFormI = formContext.useFormInput({
|
|
150
150
|
name: name,
|
|
151
|
-
value: valueProp
|
|
151
|
+
value: valueProp,
|
|
152
|
+
initialValue: ''
|
|
152
153
|
}),
|
|
153
154
|
value = _formContext$useFormI[0],
|
|
154
155
|
setValue = _formContext$useFormI[1];
|
|
@@ -322,18 +322,22 @@ var Menu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
322
322
|
if (itemCount && Array.isArray(items[0])) {
|
|
323
323
|
var index = 0;
|
|
324
324
|
menuContent = items.map(function (group, groupIndex) {
|
|
325
|
-
var _theme$menu$group, _theme$menu$
|
|
325
|
+
var _theme$menu$group, _theme$menu$group2, _theme$menu$group3;
|
|
326
326
|
return /*#__PURE__*/React.createElement(Box
|
|
327
327
|
// eslint-disable-next-line react/no-array-index-key
|
|
328
328
|
, {
|
|
329
329
|
key: groupIndex
|
|
330
|
+
// ensure menu groups don't collapse if vertical space on screen
|
|
331
|
+
// causes scrolling within the menu
|
|
332
|
+
,
|
|
333
|
+
flex: false
|
|
330
334
|
}, groupIndex > 0 && /*#__PURE__*/React.createElement(Box, {
|
|
331
335
|
pad: theme.menu.group.separator.pad
|
|
332
336
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
333
337
|
border: {
|
|
334
338
|
side: 'top',
|
|
335
|
-
color: (_theme$menu$group = theme.menu.group) == null
|
|
336
|
-
size: (_theme$menu$group2 = theme.menu.group) == null
|
|
339
|
+
color: (_theme$menu$group = theme.menu.group) == null || (_theme$menu$group = _theme$menu$group.separator) == null ? void 0 : _theme$menu$group.color,
|
|
340
|
+
size: (_theme$menu$group2 = theme.menu.group) == null || (_theme$menu$group2 = _theme$menu$group2.separator) == null ? void 0 : _theme$menu$group2.size
|
|
337
341
|
}
|
|
338
342
|
})), /*#__PURE__*/React.createElement(Box, (_theme$menu$group3 = theme.menu.group) == null ? void 0 : _theme$menu$group3.container, group.map(function (item) {
|
|
339
343
|
// item index needs to be its index in the entire menu as if
|
|
@@ -7,7 +7,7 @@ import { Grid } from '../Grid';
|
|
|
7
7
|
import { ResponsiveContext } from '../../contexts/ResponsiveContext';
|
|
8
8
|
import { NameValueListContext } from './NameValueListContext';
|
|
9
9
|
var NameValueList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
10
|
-
var _theme$nameValueList
|
|
10
|
+
var _theme$nameValueList$;
|
|
11
11
|
var align = _ref.align,
|
|
12
12
|
_ref$layout = _ref.layout,
|
|
13
13
|
layout = _ref$layout === void 0 ? 'column' : _ref$layout,
|
|
@@ -32,7 +32,7 @@ var NameValueList = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
32
32
|
size: !Array.isArray(valueWidth) ? ['auto', valueWidth] : valueWidth
|
|
33
33
|
};else if (layout === 'column' && pairProps.direction === 'row') columns = [nameWidth, !Array.isArray(valueWidth) ? ['auto', valueWidth] : valueWidth];else columns = [valueWidth];
|
|
34
34
|
var gap = theme.nameValueList.gap;
|
|
35
|
-
if ((pairProps.direction === 'column' || size === 'small') && (_theme$nameValueList$ = theme.nameValueList.pair) != null && (_theme$nameValueList$
|
|
35
|
+
if ((pairProps.direction === 'column' || size === 'small') && (_theme$nameValueList$ = theme.nameValueList.pair) != null && (_theme$nameValueList$ = _theme$nameValueList$.column) != null && _theme$nameValueList$.gap) {
|
|
36
36
|
gap = theme.nameValueList.pair.column.gap;
|
|
37
37
|
}
|
|
38
38
|
var listContextValue = useMemo(function () {
|
|
@@ -6,7 +6,7 @@ import { Text } from '../Text';
|
|
|
6
6
|
import { ResponsiveContext } from '../../contexts/ResponsiveContext';
|
|
7
7
|
import { NameValueListContext } from '../NameValueList/NameValueListContext';
|
|
8
8
|
var NameValuePair = function NameValuePair(_ref) {
|
|
9
|
-
var _theme$nameValuePair
|
|
9
|
+
var _theme$nameValuePair;
|
|
10
10
|
var children = _ref.children,
|
|
11
11
|
nameProp = _ref.name;
|
|
12
12
|
var _useContext = useContext(NameValueListContext),
|
|
@@ -24,7 +24,7 @@ var NameValuePair = function NameValuePair(_ref) {
|
|
|
24
24
|
// <dl> elements must only directly contain
|
|
25
25
|
// properly-ordered <dt> and <dd> groups
|
|
26
26
|
var valueGap;
|
|
27
|
-
if (column && (_theme$nameValuePair = theme.nameValuePair) != null && (_theme$nameValuePair
|
|
27
|
+
if (column && (_theme$nameValuePair = theme.nameValuePair) != null && (_theme$nameValuePair = _theme$nameValuePair.column) != null && _theme$nameValuePair.gap) valueGap = {
|
|
28
28
|
bottom: theme.nameValuePair.column.gap
|
|
29
29
|
};
|
|
30
30
|
var name;
|
|
@@ -50,7 +50,7 @@ var NotificationAnchor = styled(Anchor).withConfig({
|
|
|
50
50
|
componentId: "sc-1yq09yz-0"
|
|
51
51
|
})(["white-space:nowrap;"]);
|
|
52
52
|
var Notification = function Notification(_ref) {
|
|
53
|
-
var _theme$notification, _theme$notification2, _theme$
|
|
53
|
+
var _theme$notification, _theme$notification2, _theme$notification3, _theme$notification4, _theme$notification5;
|
|
54
54
|
var actionsProp = _ref.actions,
|
|
55
55
|
messageProp = _ref.message,
|
|
56
56
|
onClose = _ref.onClose,
|
|
@@ -96,7 +96,7 @@ var Notification = function Notification(_ref) {
|
|
|
96
96
|
var direction;
|
|
97
97
|
if (kind && theme.notification[kind].direction) direction = theme.notification[kind].direction;else direction = theme.notification.direction;
|
|
98
98
|
var background;
|
|
99
|
-
if (kind && (_theme$notification2 = theme.notification) != null && (_theme$notification2
|
|
99
|
+
if (kind && (_theme$notification2 = theme.notification) != null && (_theme$notification2 = _theme$notification2[status]) != null && (_theme$notification2 = _theme$notification2[kind]) != null && _theme$notification2.background) background = theme.notification[status][kind].background;else if ((_theme$notification3 = theme.notification) != null && (_theme$notification3 = _theme$notification3[status]) != null && _theme$notification3.background) background = theme.notification[status].background;else background = ((_theme$notification4 = theme.notification) == null || (_theme$notification4 = _theme$notification4[kind]) == null || (_theme$notification4 = _theme$notification4.container) == null ? void 0 : _theme$notification4.background) || theme.notification.container.background;
|
|
100
100
|
var TextWrapper = direction === 'row' ? Text : Fragment;
|
|
101
101
|
|
|
102
102
|
// notification is built with two child boxes that contain:
|
|
@@ -133,7 +133,7 @@ var Notification = function Notification(_ref) {
|
|
|
133
133
|
right: 'xsmall'
|
|
134
134
|
}
|
|
135
135
|
}, message), actions) : message;
|
|
136
|
-
var iconDimension = ((_theme$notification5 = theme.notification) == null
|
|
136
|
+
var iconDimension = ((_theme$notification5 = theme.notification) == null || (_theme$notification5 = _theme$notification5.message) == null ? void 0 : _theme$notification5.size) || 'medium';
|
|
137
137
|
var content = /*#__PURE__*/React.createElement(Box, _extends({}, theme.notification.container, global ? _extends({}, theme.notification.global.container) : {}, toast ? _extends({}, theme.notification.toast.container) : {}, {
|
|
138
138
|
background: background
|
|
139
139
|
// let internal box control pad
|
|
@@ -81,8 +81,8 @@ var rangeTrackStyle = css(["box-sizing:border-box;width:100%;height:", ";", ";",
|
|
|
81
81
|
}, function (props) {
|
|
82
82
|
return props.theme.rangeInput && props.theme.rangeInput.track && props.theme.rangeInput.track.extend;
|
|
83
83
|
}, function (props) {
|
|
84
|
-
var _props$theme
|
|
85
|
-
return props.disabled && ((_props$theme = props.theme) == null
|
|
84
|
+
var _props$theme;
|
|
85
|
+
return props.disabled && ((_props$theme = props.theme) == null || (_props$theme = _props$theme.rangeInput) == null ? void 0 : _props$theme.disabled) && disabledRangeInputStyle(props, 'track');
|
|
86
86
|
});
|
|
87
87
|
var rangeThumbStyle = css(["box-sizing:border-box;position:relative;border-radius:", ";height:", ";width:", ";overflow:visible;background:", ";-webkit-appearance:none;cursor:pointer;", " ", ";"], function (props) {
|
|
88
88
|
return props.theme.global.spacing;
|
|
@@ -95,8 +95,8 @@ var rangeThumbStyle = css(["box-sizing:border-box;position:relative;border-radiu
|
|
|
95
95
|
}, function (props) {
|
|
96
96
|
return props.theme.rangeInput && props.theme.rangeInput.thumb && props.theme.rangeInput.thumb.extend;
|
|
97
97
|
}, function (props) {
|
|
98
|
-
var _props$theme2
|
|
99
|
-
return props.disabled && ((_props$theme2 = props.theme) == null
|
|
98
|
+
var _props$theme2;
|
|
99
|
+
return props.disabled && ((_props$theme2 = props.theme) == null || (_props$theme2 = _props$theme2.rangeInput) == null ? void 0 : _props$theme2.disabled) && disabledRangeInputStyle(props, 'thumb');
|
|
100
100
|
});
|
|
101
101
|
var firefoxMicrosoftThumbStyle = css(["", " margin-top:0px;height:", ";width:", ";", " ", ""], rangeThumbStyle, function (props) {
|
|
102
102
|
return props.theme.global.spacing;
|
|
@@ -3,12 +3,12 @@ import React from 'react';
|
|
|
3
3
|
import { Box } from '../Box';
|
|
4
4
|
import { Text } from '../Text';
|
|
5
5
|
export var EmptySearchOption = function EmptySearchOption(_ref) {
|
|
6
|
-
var _theme$select, _theme$
|
|
6
|
+
var _theme$select, _theme$select2, _theme$select3;
|
|
7
7
|
var emptySearchMessage = _ref.emptySearchMessage,
|
|
8
8
|
selectOptionsStyle = _ref.selectOptionsStyle,
|
|
9
9
|
theme = _ref.theme;
|
|
10
|
-
return /*#__PURE__*/React.createElement(Box, (theme == null
|
|
10
|
+
return /*#__PURE__*/React.createElement(Box, (theme == null || (_theme$select = theme.select) == null || (_theme$select = _theme$select.emptySearchMessage) == null ? void 0 : _theme$select.container) || selectOptionsStyle, /*#__PURE__*/React.createElement(Text, _extends({
|
|
11
11
|
"aria-live": "polite",
|
|
12
12
|
role: "alert"
|
|
13
|
-
}, (theme == null
|
|
13
|
+
}, (theme == null || (_theme$select2 = theme.select) == null || (_theme$select2 = _theme$select2.emptySearchMessage) == null ? void 0 : _theme$select2.text) || ((_theme$select3 = theme.select) == null || (_theme$select3 = _theme$select3.options) == null ? void 0 : _theme$select3.text)), emptySearchMessage));
|
|
14
14
|
};
|
|
@@ -45,9 +45,9 @@ export var StyledSelectDropButton = styled(DropButton).withConfig({
|
|
|
45
45
|
})(["", ";", ";", ";"], function (props) {
|
|
46
46
|
return !props.plainSelect && controlBorderStyle;
|
|
47
47
|
}, function (props) {
|
|
48
|
-
var _props$theme$select
|
|
49
|
-
return (_props$theme$select = props.theme.select) == null
|
|
48
|
+
var _props$theme$select;
|
|
49
|
+
return (_props$theme$select = props.theme.select) == null || (_props$theme$select = _props$theme$select.control) == null ? void 0 : _props$theme$select.extend;
|
|
50
50
|
}, function (props) {
|
|
51
|
-
var _props$theme$select2
|
|
52
|
-
return props.open && ((_props$theme$select2 = props.theme.select) == null
|
|
51
|
+
var _props$theme$select2;
|
|
52
|
+
return props.open && ((_props$theme$select2 = props.theme.select) == null || (_props$theme$select2 = _props$theme$select2.control) == null ? void 0 : _props$theme$select2.open);
|
|
53
53
|
});
|
|
@@ -22,11 +22,11 @@ var StyledSelectBox = styled(Box).withConfig({
|
|
|
22
22
|
})(["", ";", ";", ";"], function (props) {
|
|
23
23
|
return !props.plainSelect && controlBorderStyle;
|
|
24
24
|
}, function (props) {
|
|
25
|
-
var _props$theme$select
|
|
26
|
-
return (_props$theme$select = props.theme.select) == null
|
|
25
|
+
var _props$theme$select;
|
|
26
|
+
return (_props$theme$select = props.theme.select) == null || (_props$theme$select = _props$theme$select.control) == null ? void 0 : _props$theme$select.extend;
|
|
27
27
|
}, function (props) {
|
|
28
|
-
var _props$theme$select$
|
|
29
|
-
return props.open && ((_props$theme$select$
|
|
28
|
+
var _props$theme$select$c;
|
|
29
|
+
return props.open && ((_props$theme$select$c = props.theme.select.control) == null ? void 0 : _props$theme$select$c.open);
|
|
30
30
|
});
|
|
31
31
|
StyledSelectDropButton.defaultProps = {};
|
|
32
32
|
Object.setPrototypeOf(StyledSelectDropButton.defaultProps, defaultProps);
|
|
@@ -320,7 +320,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
320
320
|
onMouseMove: function onMouseMove() {
|
|
321
321
|
return setKeyboardNavigation(false);
|
|
322
322
|
},
|
|
323
|
-
"aria-activedescendant": optionsRef == null
|
|
323
|
+
"aria-activedescendant": optionsRef == null || (_optionsRef$current = optionsRef.current) == null ? void 0 : _optionsRef$current.children[activeIndex]
|
|
324
324
|
}, /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
325
325
|
items: options,
|
|
326
326
|
step: theme.select.step,
|
|
@@ -17,7 +17,7 @@ var Skeleton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
17
17
|
var theme = useContext(ThemeContext) || defaultProps.theme;
|
|
18
18
|
var skeleton = useSkeleton();
|
|
19
19
|
var depth = (skeleton == null ? void 0 : skeleton.depth) || 0;
|
|
20
|
-
var colors = colorsProp || (theme == null
|
|
20
|
+
var colors = colorsProp || (theme == null || (_theme$skeleton = theme.skeleton) == null ? void 0 : _theme$skeleton.colors);
|
|
21
21
|
var themeColors = colors[theme.dark ? 'dark' : 'light'];
|
|
22
22
|
var background = themeColors[(depth + 1) % themeColors.length];
|
|
23
23
|
return /*#__PURE__*/React.createElement(StyledSkeleton, _extends({
|
|
@@ -10,8 +10,8 @@ export var StyledSkeleton = styled.div.withConfig({
|
|
|
10
10
|
})(["display:flex;box-sizing:border-box;", " ", " ", " ", " ", " ", ""], genericStyles, function (props) {
|
|
11
11
|
return props.background && backgroundStyle(props.background, props.theme);
|
|
12
12
|
}, function (props) {
|
|
13
|
-
var _props$theme$text
|
|
14
|
-
return heightStyle(props.heightProp || ((_props$theme$text = props.theme.text) == null
|
|
13
|
+
var _props$theme$text;
|
|
14
|
+
return heightStyle(props.heightProp || ((_props$theme$text = props.theme.text) == null || (_props$theme$text = _props$theme$text.medium) == null ? void 0 : _props$theme$text.height), props.theme);
|
|
15
15
|
}, function (props) {
|
|
16
16
|
return widthStyle(props.widthProp || '100%', props.theme);
|
|
17
17
|
}, function (props) {
|
|
@@ -10,7 +10,7 @@ import { Box } from '../Box';
|
|
|
10
10
|
import { Text } from '../Text';
|
|
11
11
|
import { StyledRemoveButton, StyledTagButton } from './StyledTag';
|
|
12
12
|
var Tag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
13
|
-
var _theme$tag$size, _theme$tag$
|
|
13
|
+
var _theme$tag$size, _theme$tag$size2, _theme$tag$size3, _theme$tag$size4;
|
|
14
14
|
var name = _ref.name,
|
|
15
15
|
value = _ref.value,
|
|
16
16
|
size = _ref.size,
|
|
@@ -23,13 +23,13 @@ var Tag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
23
23
|
align: 'center',
|
|
24
24
|
background: theme.tag.background,
|
|
25
25
|
border: theme.tag.border,
|
|
26
|
-
round: ((_theme$tag$size = theme.tag.size) == null
|
|
26
|
+
round: ((_theme$tag$size = theme.tag.size) == null || (_theme$tag$size = _theme$tag$size[size]) == null ? void 0 : _theme$tag$size.round) || theme.tag.round
|
|
27
27
|
}, rest);
|
|
28
28
|
var contents = /*#__PURE__*/React.createElement(Box, {
|
|
29
29
|
width: {
|
|
30
30
|
min: 'min-content'
|
|
31
31
|
},
|
|
32
|
-
pad: ((_theme$tag$size2 = theme.tag.size) == null
|
|
32
|
+
pad: ((_theme$tag$size2 = theme.tag.size) == null || (_theme$tag$size2 = _theme$tag$size2[size]) == null ? void 0 : _theme$tag$size2.pad) || theme.tag.pad
|
|
33
33
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
34
34
|
size: size
|
|
35
35
|
}, name && /*#__PURE__*/React.createElement(Text, _extends({}, theme.tag.name, {
|
|
@@ -53,8 +53,8 @@ var Tag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
53
53
|
plain: true,
|
|
54
54
|
hoverIndicator: true,
|
|
55
55
|
focusIndicator: true,
|
|
56
|
-
icon: /*#__PURE__*/React.createElement(FormClose, (_theme$tag$size3 = theme.tag.size) == null
|
|
57
|
-
round: ((_theme$tag$size4 = theme.tag.size) == null
|
|
56
|
+
icon: /*#__PURE__*/React.createElement(FormClose, (_theme$tag$size3 = theme.tag.size) == null || (_theme$tag$size3 = _theme$tag$size3[size]) == null ? void 0 : _theme$tag$size3.icon),
|
|
57
|
+
round: ((_theme$tag$size4 = theme.tag.size) == null || (_theme$tag$size4 = _theme$tag$size4[size]) == null ? void 0 : _theme$tag$size4.round) || theme.tag.round
|
|
58
58
|
}, theme.tag.remove))) : /*#__PURE__*/React.createElement(StyledTagButton, _extends({
|
|
59
59
|
flex: false,
|
|
60
60
|
plain: true,
|
|
@@ -17,7 +17,7 @@ var resizeStyle = function resizeStyle(resize) {
|
|
|
17
17
|
var StyledTextArea = styled.textarea.withConfig({
|
|
18
18
|
displayName: "StyledTextArea",
|
|
19
19
|
componentId: "sc-17i3mwp-0"
|
|
20
|
-
})(["", " ", " ", " ", " ", " ", ";"], inputStyle, function (props) {
|
|
20
|
+
})(["", " ", " ", " ", " ", " ", ";max-width:100%;"], inputStyle, function (props) {
|
|
21
21
|
return props.resize !== undefined && resizeStyle(props.resize);
|
|
22
22
|
}, function (props) {
|
|
23
23
|
return props.fillArg && 'height: 100%;';
|
|
@@ -14,20 +14,20 @@ var ThumbsRating = function ThumbsRating(_ref) {
|
|
|
14
14
|
direction: "row",
|
|
15
15
|
options: ['like', 'dislike']
|
|
16
16
|
}, rest), function (option, _ref2) {
|
|
17
|
-
var _theme$thumbsRating3, _theme$
|
|
17
|
+
var _theme$thumbsRating3, _theme$thumbsRating4;
|
|
18
18
|
var checked = _ref2.checked;
|
|
19
19
|
if (option === 'like') {
|
|
20
|
-
var _theme$thumbsRating, _theme$
|
|
20
|
+
var _theme$thumbsRating, _theme$thumbsRating2;
|
|
21
21
|
return checked ? /*#__PURE__*/React.createElement(LikeFill, {
|
|
22
|
-
color: (_theme$thumbsRating = theme.thumbsRating) == null
|
|
22
|
+
color: (_theme$thumbsRating = theme.thumbsRating) == null || (_theme$thumbsRating = _theme$thumbsRating.like) == null ? void 0 : _theme$thumbsRating.color
|
|
23
23
|
}) : /*#__PURE__*/React.createElement(Like, {
|
|
24
|
-
color: (_theme$thumbsRating2 = theme.thumbsRating) == null
|
|
24
|
+
color: (_theme$thumbsRating2 = theme.thumbsRating) == null || (_theme$thumbsRating2 = _theme$thumbsRating2.like) == null ? void 0 : _theme$thumbsRating2.color
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
return checked ? /*#__PURE__*/React.createElement(DislikeFill, {
|
|
28
|
-
color: (_theme$thumbsRating3 = theme.thumbsRating) == null
|
|
28
|
+
color: (_theme$thumbsRating3 = theme.thumbsRating) == null || (_theme$thumbsRating3 = _theme$thumbsRating3.dislike) == null ? void 0 : _theme$thumbsRating3.color
|
|
29
29
|
}) : /*#__PURE__*/React.createElement(Dislike, {
|
|
30
|
-
color: (_theme$thumbsRating4 = theme.thumbsRating) == null
|
|
30
|
+
color: (_theme$thumbsRating4 = theme.thumbsRating) == null || (_theme$thumbsRating4 = _theme$thumbsRating4.dislike) == null ? void 0 : _theme$thumbsRating4.color
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
};
|
|
@@ -180,9 +180,9 @@ var Video = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
180
180
|
var nextActiveTrack;
|
|
181
181
|
for (var j = 0; j < track.cues.length; j += 1) {
|
|
182
182
|
var _track$cues$j, _track$cues$j2;
|
|
183
|
-
if (currentVideoTime > (track == null
|
|
183
|
+
if (currentVideoTime > (track == null || (_track$cues$j = track.cues[j]) == null ? void 0 : _track$cues$j.startTime) && currentVideoTime < (track == null || (_track$cues$j2 = track.cues[j]) == null ? void 0 : _track$cues$j2.endTime)) {
|
|
184
184
|
var _track$cues$j3;
|
|
185
|
-
nextActiveTrack = track == null
|
|
185
|
+
nextActiveTrack = track == null || (_track$cues$j3 = track.cues[j]) == null ? void 0 : _track$cues$j3.text;
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
188
|
return nextActiveTrack;
|
|
@@ -14,8 +14,8 @@ export var AnalyticsProvider = function AnalyticsProvider(_ref) {
|
|
|
14
14
|
var observer;
|
|
15
15
|
if (onAnalytics) {
|
|
16
16
|
observer = new window.MutationObserver(function () {
|
|
17
|
-
var _window
|
|
18
|
-
var url = (_window = window) == null
|
|
17
|
+
var _window;
|
|
18
|
+
var url = (_window = window) == null || (_window = _window.location) == null ? void 0 : _window.href;
|
|
19
19
|
var previousUrl = lastUrlRef.current;
|
|
20
20
|
if (url !== previousUrl) {
|
|
21
21
|
lastUrlRef.current = url;
|
package/es6/utils/background.js
CHANGED
|
@@ -37,11 +37,11 @@ var normalizeBackgroundColor = function normalizeBackgroundColor(backgroundArg,
|
|
|
37
37
|
var normalizeBackgroundImage = function normalizeBackgroundImage(background, theme) {
|
|
38
38
|
var result;
|
|
39
39
|
if (background.image) {
|
|
40
|
-
var _theme$global$backgro3, _theme$global$backgro4
|
|
41
|
-
result = normalizeBackground(background.dark ? (_theme$global$backgro3 = theme.global.backgrounds) == null
|
|
40
|
+
var _theme$global$backgro3, _theme$global$backgro4;
|
|
41
|
+
result = normalizeBackground(background.dark ? (_theme$global$backgro3 = theme.global.backgrounds) == null || (_theme$global$backgro3 = _theme$global$backgro3[background.image]) == null ? void 0 : _theme$global$backgro3.dark : (_theme$global$backgro4 = theme.global.backgrounds) == null ? void 0 : _theme$global$backgro4[background.image], theme) || background.image;
|
|
42
42
|
} else {
|
|
43
|
-
var _theme$global$
|
|
44
|
-
var normalized = normalizeBackground((_theme$global$
|
|
43
|
+
var _theme$global$backgro5;
|
|
44
|
+
var normalized = normalizeBackground((_theme$global$backgro5 = theme.global.backgrounds) == null ? void 0 : _theme$global$backgro5[background], theme);
|
|
45
45
|
result = typeof normalized === 'object' ? normalizeBackgroundImage(normalized, theme) : normalized;
|
|
46
46
|
}
|
|
47
47
|
return result;
|
package/es6/utils/styles.js
CHANGED
|
@@ -251,8 +251,8 @@ export var inputStyle = css(["box-sizing:border-box;", " font-family:inherit;bor
|
|
|
251
251
|
// icon should equal the icon dimension + 12px (edgeSize.medium)
|
|
252
252
|
// to ensure there is reasonable space between the icon and value or placeholder
|
|
253
253
|
export var inputPadForIcon = css(["", ""], function (props) {
|
|
254
|
-
var _props$theme, _props$theme$icon
|
|
255
|
-
var pad = (_props$theme = props.theme) != null && (_props$theme
|
|
254
|
+
var _props$theme, _props$theme$icon;
|
|
255
|
+
var pad = (_props$theme = props.theme) != null && (_props$theme = _props$theme.icon) != null && _props$theme.matchSize ? parseMetricToNum((_props$theme$icon = props.theme.icon) == null || (_props$theme$icon = _props$theme$icon.size) == null ? void 0 : _props$theme$icon[(props == null ? void 0 : props.size) || 'medium']) + parseMetricToNum(props.theme.global.edgeSize.medium) + "px" : props.theme.global.edgeSize.large;
|
|
256
256
|
return props.reverse ? "padding-right: " + pad + ";" : "padding-left: " + pad + ";";
|
|
257
257
|
});
|
|
258
258
|
export var overflowStyle = function overflowStyle(overflowProp) {
|