grommet 2.26.0 → 2.27.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/all/stories/AllComponents.js +19 -126
- package/components/Accordion/stories/CustomHeader.js +3 -1
- package/components/Avatar/Avatar.js +22 -9
- package/components/CheckBox/StyledCheckBox.js +9 -5
- package/components/DataChart/Detail.js +3 -1
- package/components/DataTable/index.d.ts +6 -6
- package/components/DateInput/DateInput.js +1 -1
- package/components/Diagram/Diagram.js +2 -1
- package/components/Drop/stories/Inline.js +1 -1
- package/components/Drop/stories/Overflow.js +1 -1
- package/components/Drop/stories/Plain.js +1 -1
- package/components/Drop/stories/Simple.js +1 -1
- package/components/Drop/stories/Styled.js +1 -1
- package/components/List/List.js +16 -13
- package/components/List/stories/Order.js +1 -0
- package/components/List/stories/Pinned.js +1 -0
- package/components/List/stories/Selection.js +1 -0
- package/components/List/stories/onClickItem.js +1 -0
- package/components/Notification/Notification.js +2 -2
- package/components/Notification/index.d.ts +1 -1
- package/components/Notification/propTypes.js +1 -1
- package/components/RadioButton/README.md +1 -279
- package/components/RadioButton/RadioButton.js +1 -0
- package/components/Select/Select.js +8 -4
- package/components/Select/SelectContainer.js +4 -4
- package/components/Select/utils.js +28 -2
- package/components/SelectMultiple/SelectMultiple.js +4 -4
- package/components/SelectMultiple/SelectMultipleContainer.js +10 -8
- package/components/SelectMultiple/SelectMultipleValue.js +18 -21
- package/components/SelectMultiple/SelectionSummary.js +1 -1
- package/components/SelectMultiple/stories/ObjectOptions.js +25 -1
- package/components/Sidebar/stories/Labels.js +4 -1
- package/components/TextArea/stories/NonResizable.js +1 -0
- package/components/TextArea/stories/Simple.js +1 -0
- package/es6/all/stories/AllComponents.js +21 -121
- package/es6/components/Accordion/stories/CustomHeader.js +3 -1
- package/es6/components/Avatar/Avatar.js +21 -9
- package/es6/components/CheckBox/StyledCheckBox.js +9 -5
- package/es6/components/DataChart/Detail.js +3 -1
- package/es6/components/DataTable/index.d.ts +6 -6
- package/es6/components/DateInput/DateInput.js +1 -1
- package/es6/components/Diagram/Diagram.js +2 -1
- package/es6/components/Drop/stories/Inline.js +1 -1
- package/es6/components/Drop/stories/Overflow.js +1 -1
- package/es6/components/Drop/stories/Plain.js +1 -1
- package/es6/components/Drop/stories/Simple.js +1 -1
- package/es6/components/Drop/stories/Styled.js +1 -1
- package/es6/components/List/List.js +16 -13
- package/es6/components/List/stories/Order.js +1 -0
- package/es6/components/List/stories/Pinned.js +1 -0
- package/es6/components/List/stories/Selection.js +1 -0
- package/es6/components/List/stories/onClickItem.js +1 -0
- package/es6/components/Notification/Notification.js +2 -2
- package/es6/components/Notification/index.d.ts +1 -1
- package/es6/components/Notification/propTypes.js +1 -1
- package/es6/components/RadioButton/README.md +1 -279
- package/es6/components/RadioButton/RadioButton.js +1 -0
- package/es6/components/Select/Select.js +8 -4
- package/es6/components/Select/SelectContainer.js +4 -4
- package/es6/components/Select/utils.js +21 -1
- package/es6/components/SelectMultiple/SelectMultiple.js +5 -5
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +11 -9
- package/es6/components/SelectMultiple/SelectMultipleValue.js +19 -22
- package/es6/components/SelectMultiple/SelectionSummary.js +2 -2
- package/es6/components/SelectMultiple/stories/ObjectOptions.js +25 -1
- package/es6/components/Sidebar/stories/Labels.js +4 -1
- package/es6/components/TextArea/stories/NonResizable.js +1 -0
- package/es6/components/TextArea/stories/Simple.js +1 -0
- package/es6/themes/base.d.ts +8 -3
- package/es6/themes/base.js +6 -1
- package/es6/themes/hacktoberfest2022.js +129 -0
- package/es6/themes/index.js +2 -1
- package/es6/utils/background.js +4 -4
- package/es6/utils/styles.js +3 -1
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/package.json +45 -43
- package/themes/base.d.ts +8 -3
- package/themes/base.js +6 -1
- package/themes/hacktoberfest2022.js +137 -0
- package/themes/index.js +6 -2
- package/tools/grommet-babel-preset-es2015.js +1 -12
- package/tools/pack.js +1 -94
- package/tools/release-stable.js +1 -27
- package/utils/background.js +4 -4
- package/utils/styles.js +3 -1
|
@@ -5,16 +5,9 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
5
5
|
|
|
6
6
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
7
|
|
|
8
|
-
import React, {
|
|
9
|
-
import {
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
import { Accordion, AccordionPanel, Anchor, Box, Button, Calendar, Chart, CheckBox, Clock, DataTable, Diagram, Distribution, FormField, Grid, Heading, MaskedInput, Menu, Meter, Paragraph, RadioButtonGroup, RangeInput, RangeSelector, Select, Stack, Tab, Tabs, Text, TextArea, TextInput, Video } from 'grommet';
|
|
10
10
|
import { FormNext } from "grommet-icons/es6/icons/FormNext";
|
|
11
|
-
import { grommet } from 'grommet/themes';
|
|
12
|
-
import { generate } from 'grommet/themes/base';
|
|
13
|
-
import { deepMerge } from 'grommet/utils';
|
|
14
|
-
import { hpe } from 'grommet-theme-hpe';
|
|
15
|
-
import { aruba } from 'grommet-theme-aruba';
|
|
16
|
-
import { hp } from 'grommet-theme-hp';
|
|
17
|
-
import { dxc } from 'grommet-theme-dxc';
|
|
18
11
|
|
|
19
12
|
var Node = function Node(_ref) {
|
|
20
13
|
var id = _ref.id,
|
|
@@ -45,61 +38,31 @@ var connection = function connection(fromTarget, toTarget, _temp) {
|
|
|
45
38
|
}, rest);
|
|
46
39
|
};
|
|
47
40
|
|
|
48
|
-
var themes = {
|
|
49
|
-
grommet: grommet,
|
|
50
|
-
hpe: hpe,
|
|
51
|
-
aruba: aruba,
|
|
52
|
-
hp: hp,
|
|
53
|
-
dxc: dxc
|
|
54
|
-
};
|
|
55
|
-
|
|
56
41
|
var Components = function Components() {
|
|
57
|
-
var _useState = useState(
|
|
58
|
-
|
|
59
|
-
|
|
42
|
+
var _useState = useState(true),
|
|
43
|
+
checkBox = _useState[0],
|
|
44
|
+
setCheckBox = _useState[1];
|
|
60
45
|
|
|
61
|
-
var _useState2 = useState(
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
var _useState2 = useState(''),
|
|
47
|
+
textInput = _useState2[0],
|
|
48
|
+
setTextInput = _useState2[1];
|
|
64
49
|
|
|
65
50
|
var _useState3 = useState(''),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
var _useState4 = useState(''),
|
|
70
|
-
maskedInput = _useState4[0],
|
|
71
|
-
setMaskedInput = _useState4[1];
|
|
72
|
-
|
|
73
|
-
var _useState5 = useState('RadioButton 1'),
|
|
74
|
-
radioButton = _useState5[0],
|
|
75
|
-
setRadioButton = _useState5[1];
|
|
51
|
+
maskedInput = _useState3[0],
|
|
52
|
+
setMaskedInput = _useState3[1];
|
|
76
53
|
|
|
77
|
-
var
|
|
78
|
-
|
|
79
|
-
|
|
54
|
+
var _useState4 = useState('RadioButton 1'),
|
|
55
|
+
radioButton = _useState4[0],
|
|
56
|
+
setRadioButton = _useState4[1];
|
|
80
57
|
|
|
81
|
-
var
|
|
82
|
-
|
|
83
|
-
|
|
58
|
+
var _useState5 = useState([1, 2]),
|
|
59
|
+
rangeSelector = _useState5[0],
|
|
60
|
+
setRangeSelector = _useState5[1];
|
|
84
61
|
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
|
|
62
|
+
var _useState6 = useState(0),
|
|
63
|
+
tabIndex = _useState6[0],
|
|
64
|
+
setTabIndex = _useState6[1];
|
|
88
65
|
|
|
89
|
-
var _useState9 = useState(undefined),
|
|
90
|
-
background = _useState9[0],
|
|
91
|
-
setBackground = _useState9[1];
|
|
92
|
-
|
|
93
|
-
var _useState10 = useState(0),
|
|
94
|
-
tabIndex = _useState10[0],
|
|
95
|
-
setTabIndex = _useState10[1];
|
|
96
|
-
|
|
97
|
-
var theme = useMemo(function () {
|
|
98
|
-
return deepMerge(generate(baseSize), themes[themeName]);
|
|
99
|
-
}, [baseSize, themeName]);
|
|
100
|
-
var themeCanMode = useMemo(function () {
|
|
101
|
-
return theme && theme.global.colors.background && theme.global.colors.background.dark;
|
|
102
|
-
}, [theme]);
|
|
103
66
|
var content = [/*#__PURE__*/React.createElement(Box, {
|
|
104
67
|
key: "type",
|
|
105
68
|
align: "start",
|
|
@@ -358,77 +321,14 @@ var Components = function Components() {
|
|
|
358
321
|
src: "http://techslides.com/demos/sample-videos/small.3gp",
|
|
359
322
|
type: "video/3gp"
|
|
360
323
|
})))];
|
|
361
|
-
return /*#__PURE__*/React.createElement(
|
|
362
|
-
style: {
|
|
363
|
-
height: '100vh',
|
|
364
|
-
display: 'flex',
|
|
365
|
-
flexDirection: 'column'
|
|
366
|
-
}
|
|
367
|
-
}, /*#__PURE__*/React.createElement(Grommet, {
|
|
368
|
-
theme: grommet,
|
|
369
|
-
style: {
|
|
370
|
-
flex: '0 0 auto'
|
|
371
|
-
}
|
|
372
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
373
|
-
direction: "row-responsive",
|
|
374
|
-
gap: "medium",
|
|
375
|
-
justify: "end",
|
|
376
|
-
align: "center",
|
|
377
|
-
margin: "small"
|
|
378
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
379
|
-
basis: "small"
|
|
380
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
381
|
-
plain: true,
|
|
382
|
-
size: "small",
|
|
383
|
-
options: Object.keys(themes),
|
|
384
|
-
value: themeName,
|
|
385
|
-
onChange: function onChange(event) {
|
|
386
|
-
return setThemeName(event.option);
|
|
387
|
-
}
|
|
388
|
-
})), themeCanMode && /*#__PURE__*/React.createElement(CheckBox, {
|
|
389
|
-
label: "dark",
|
|
390
|
-
checked: themeMode === 'dark',
|
|
391
|
-
onChange: function onChange() {
|
|
392
|
-
return setThemeMode(themeMode === 'dark' ? 'light' : 'dark');
|
|
393
|
-
}
|
|
394
|
-
}), !themeCanMode && /*#__PURE__*/React.createElement(Box, {
|
|
395
|
-
basis: "small"
|
|
396
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
397
|
-
plain: true,
|
|
398
|
-
placeholder: "background",
|
|
399
|
-
size: "small",
|
|
400
|
-
options: ['default', 'dark-1', 'light-1'],
|
|
401
|
-
value: background,
|
|
402
|
-
onChange: function onChange(event) {
|
|
403
|
-
return setBackground(event.option);
|
|
404
|
-
}
|
|
405
|
-
})), /*#__PURE__*/React.createElement(Box, {
|
|
406
|
-
basis: "small"
|
|
407
|
-
}, /*#__PURE__*/React.createElement(RangeInput, {
|
|
408
|
-
min: 16,
|
|
409
|
-
max: 36,
|
|
410
|
-
step: 2,
|
|
411
|
-
value: baseSize,
|
|
412
|
-
onChange: function onChange(event) {
|
|
413
|
-
return setBaseSize(parseInt(event.target.value, 10));
|
|
414
|
-
}
|
|
415
|
-
})), /*#__PURE__*/React.createElement(Text, {
|
|
416
|
-
size: "small"
|
|
417
|
-
}, baseSize + "px base spacing"))), /*#__PURE__*/React.createElement(Grommet, {
|
|
418
|
-
theme: theme,
|
|
419
|
-
themeMode: themeMode,
|
|
420
|
-
style: {
|
|
421
|
-
flex: '1 1'
|
|
422
|
-
}
|
|
423
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
324
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
424
325
|
fill: true,
|
|
425
326
|
pad: "medium",
|
|
426
|
-
background: background || theme.global.colors.background,
|
|
427
327
|
overflow: "auto"
|
|
428
328
|
}, /*#__PURE__*/React.createElement(Grid, {
|
|
429
329
|
columns: "small",
|
|
430
330
|
gap: "medium"
|
|
431
|
-
}, content))
|
|
331
|
+
}, content));
|
|
432
332
|
};
|
|
433
333
|
|
|
434
334
|
export var All = function All() {
|
|
@@ -34,7 +34,9 @@ var CustomHeaderAccordion = function CustomHeaderAccordion() {
|
|
|
34
34
|
style: {
|
|
35
35
|
height: '800px'
|
|
36
36
|
}
|
|
37
|
-
}, /*#__PURE__*/React.createElement(Text, null, "Panel 1 contents"), /*#__PURE__*/React.createElement(TextInput,
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Text, null, "Panel 1 contents"), /*#__PURE__*/React.createElement(TextInput, {
|
|
38
|
+
a11yTitle: "panel 1 text box"
|
|
39
|
+
}))), /*#__PURE__*/React.createElement(AccordionPanel, {
|
|
38
40
|
header: renderPanelHeader('Panel 2', activeIndex.includes(1))
|
|
39
41
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
40
42
|
pad: "medium",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["align", "children", "height", "justify", "round", "size", "src", "width"];
|
|
1
|
+
var _excluded = ["a11yTitle", "aria-label", "align", "children", "height", "justify", "round", "size", "src", "width"];
|
|
2
2
|
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
@@ -6,12 +6,15 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
6
6
|
|
|
7
7
|
import React, { useCallback, useContext, useMemo } from 'react';
|
|
8
8
|
import { ThemeContext } from 'styled-components';
|
|
9
|
+
import { Image } from '../Image';
|
|
9
10
|
import { defaultProps } from '../../default-props';
|
|
10
11
|
import { StyledAvatar, StyledAvatarText } from './StyledAvatar';
|
|
11
12
|
import { AvatarPropTypes } from './propTypes';
|
|
12
13
|
|
|
13
14
|
var Avatar = function Avatar(_ref) {
|
|
14
|
-
var
|
|
15
|
+
var a11yTitle = _ref.a11yTitle,
|
|
16
|
+
ariaLabel = _ref['aria-label'],
|
|
17
|
+
_ref$align = _ref.align,
|
|
15
18
|
align = _ref$align === void 0 ? 'center' : _ref$align,
|
|
16
19
|
children = _ref.children,
|
|
17
20
|
height = _ref.height,
|
|
@@ -46,17 +49,26 @@ var Avatar = function Avatar(_ref) {
|
|
|
46
49
|
console.warn('Avatar should use `size` instead of `height` or `width` props');
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
|
|
50
|
-
return /*#__PURE__*/React.createElement(StyledAvatar, _extends({}, avatarProps, rest, {
|
|
51
|
-
background: "url(" + src + ")"
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
52
|
+
var content;
|
|
54
53
|
|
|
55
54
|
if (typeof children === 'string') {
|
|
56
|
-
|
|
55
|
+
content = /*#__PURE__*/React.createElement(StyledAvatarText, {
|
|
57
56
|
alignSelf: "center",
|
|
58
57
|
size: avatarTextSize
|
|
59
|
-
}, children)
|
|
58
|
+
}, children);
|
|
59
|
+
} else if (typeof src === 'string') {
|
|
60
|
+
content = /*#__PURE__*/React.createElement(Image, {
|
|
61
|
+
role: "presentation",
|
|
62
|
+
fit: "contain",
|
|
63
|
+
src: src
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (typeof children === 'string' || typeof src === 'string') {
|
|
68
|
+
return /*#__PURE__*/React.createElement(StyledAvatar, _extends({
|
|
69
|
+
role: typeof src === 'string' ? 'figure' : undefined,
|
|
70
|
+
a11yTitle: a11yTitle || ariaLabel
|
|
71
|
+
}, avatarProps, rest), content);
|
|
60
72
|
}
|
|
61
73
|
|
|
62
74
|
return /*#__PURE__*/React.createElement(AvatarChildren, null);
|
|
@@ -9,14 +9,18 @@ var fillStyle = function fillStyle() {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
var disabledStyle = "\n opacity: 0.5;\n cursor: default;\n";
|
|
12
|
-
var hoverStyle = css([":hover input:not([disabled]) + div,:hover input:not([disabled]) + span{border-color:", ";}:hover{background-color:", ";}"], function (props) {
|
|
12
|
+
var hoverStyle = css([":hover input:not([disabled]) + div,:hover input:not([disabled]) + span{border-color:", ";", "}:hover{background-color:", ";}"], function (props) {
|
|
13
13
|
var _props$theme$checkBox, _props$theme$checkBox2;
|
|
14
14
|
|
|
15
15
|
return normalizeColor((_props$theme$checkBox = props.theme.checkBox.hover) == null ? void 0 : (_props$theme$checkBox2 = _props$theme$checkBox.border) == null ? void 0 : _props$theme$checkBox2.color, props.theme);
|
|
16
16
|
}, function (props) {
|
|
17
|
-
var _props$theme$checkBox3
|
|
17
|
+
var _props$theme$checkBox3;
|
|
18
18
|
|
|
19
|
-
return
|
|
19
|
+
return (_props$theme$checkBox3 = props.theme.checkBox.hover) == null ? void 0 : _props$theme$checkBox3.extend;
|
|
20
|
+
}, function (props) {
|
|
21
|
+
var _props$theme$checkBox4, _props$theme$checkBox5;
|
|
22
|
+
|
|
23
|
+
return normalizeColor(!props.disabled && ((_props$theme$checkBox4 = props.theme.checkBox.hover) == null ? void 0 : (_props$theme$checkBox5 = _props$theme$checkBox4.background) == null ? void 0 : _props$theme$checkBox5.color), props.theme);
|
|
20
24
|
});
|
|
21
25
|
var StyledCheckBoxIcon = styled.svg.withConfig({
|
|
22
26
|
displayName: "StyledCheckBox__StyledCheckBoxIcon",
|
|
@@ -48,9 +52,9 @@ var StyledCheckBoxContainer = styled.label.withConfig({
|
|
|
48
52
|
}, function (props) {
|
|
49
53
|
return !props.disabled && 'cursor: pointer;';
|
|
50
54
|
}, hoverStyle, function (props) {
|
|
51
|
-
var _props$theme$
|
|
55
|
+
var _props$theme$checkBox6, _props$theme$checkBox7, _props$theme$checkBox8, _props$theme$checkBox9;
|
|
52
56
|
|
|
53
|
-
return props.focus && !props.focusIndicator && "\n input:not([disabled]) + div,\n input:not([disabled]) + span {\n border-color: " + normalizeColor((_props$theme$
|
|
57
|
+
return props.focus && !props.focusIndicator && "\n input:not([disabled]) + div,\n input:not([disabled]) + span {\n border-color: " + normalizeColor((_props$theme$checkBox6 = props.theme.checkBox.hover) == null ? void 0 : (_props$theme$checkBox7 = _props$theme$checkBox6.border) == null ? void 0 : _props$theme$checkBox7.color, props.theme) + ";\n }\n \n background-color: " + normalizeColor(!props.disabled && ((_props$theme$checkBox8 = props.theme.checkBox.hover) == null ? void 0 : (_props$theme$checkBox9 = _props$theme$checkBox8.background) == null ? void 0 : _props$theme$checkBox9.color), props.theme) + ";";
|
|
54
58
|
}, function (props) {
|
|
55
59
|
return props.theme.checkBox.extend;
|
|
56
60
|
});
|
|
@@ -116,8 +116,10 @@ var Detail = function Detail(_ref) {
|
|
|
116
116
|
gap: "xsmall",
|
|
117
117
|
align: "center"
|
|
118
118
|
}, series.filter(function (_ref2) {
|
|
119
|
+
var _data$detailIndex;
|
|
120
|
+
|
|
119
121
|
var property = _ref2.property;
|
|
120
|
-
return !activeProperty || activeProperty === property || axis && axis.x && axis.x.property === property;
|
|
122
|
+
return (!activeProperty || activeProperty === property) && (data == null ? void 0 : (_data$detailIndex = data[detailIndex]) == null ? void 0 : _data$detailIndex[property]) !== undefined || axis && axis.x && axis.x.property === property;
|
|
121
123
|
}).map(function (serie) {
|
|
122
124
|
var propertyStyle = seriesStyles[serie.property];
|
|
123
125
|
return /*#__PURE__*/React.createElement(Fragment, {
|
|
@@ -91,12 +91,12 @@ export interface DataTableProps<TRowType = any> {
|
|
|
91
91
|
groupBy?:
|
|
92
92
|
| string
|
|
93
93
|
| {
|
|
94
|
-
property
|
|
95
|
-
expand
|
|
96
|
-
expandable
|
|
97
|
-
select
|
|
98
|
-
onExpand
|
|
99
|
-
onSelect
|
|
94
|
+
property?: string;
|
|
95
|
+
expand?: Array<string>;
|
|
96
|
+
expandable?: Array<string>;
|
|
97
|
+
select?: { [key: string]: 'all' | 'some' | 'none' };
|
|
98
|
+
onExpand?: (expandedKeys: string[]) => void;
|
|
99
|
+
onSelect?: (select: (string | number)[], datum: TRowType) => void;
|
|
100
100
|
};
|
|
101
101
|
primaryKey?: string | boolean;
|
|
102
102
|
select?: (string | number)[];
|
|
@@ -259,7 +259,7 @@ var DateInput = /*#__PURE__*/forwardRef(function (_ref, refArg) {
|
|
|
259
259
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
260
260
|
ref: containerRef,
|
|
261
261
|
border: !plain,
|
|
262
|
-
round:
|
|
262
|
+
round: theme.dateInput.container.round,
|
|
263
263
|
direction: "row",
|
|
264
264
|
fill: true
|
|
265
265
|
}, reverse && calendarButton, /*#__PURE__*/React.createElement(MaskedInput, _extends({
|
|
@@ -209,7 +209,8 @@ var Diagram = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
209
209
|
|
|
210
210
|
path = /*#__PURE__*/React.createElement("path", _extends({
|
|
211
211
|
// eslint-disable-next-line react/no-array-index-key
|
|
212
|
-
key: index
|
|
212
|
+
key: index // eslint-disable-next-line react/no-unknown-property
|
|
213
|
+
,
|
|
213
214
|
animation: animation
|
|
214
215
|
}, cleanedRest, {
|
|
215
216
|
stroke: normalizeColor(colorName, theme),
|
|
@@ -196,18 +196,23 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
196
196
|
|
|
197
197
|
var _useState4 = useState(),
|
|
198
198
|
dragging = _useState4[0],
|
|
199
|
-
setDragging = _useState4[1];
|
|
199
|
+
setDragging = _useState4[1];
|
|
200
|
+
|
|
201
|
+
var _useState5 = useState(),
|
|
202
|
+
orderingData = _useState5[0],
|
|
203
|
+
setOrderingData = _useState5[1]; // store a reference to the pinned and the data that is orderable
|
|
200
204
|
|
|
201
205
|
|
|
202
206
|
var _useMemo = useMemo(function () {
|
|
203
207
|
var orderable = [];
|
|
204
208
|
var pinnedData = [];
|
|
205
209
|
var pinnedIndexes = [];
|
|
206
|
-
|
|
210
|
+
var currentData = orderingData || data;
|
|
211
|
+
if (pinned.length === 0) return [currentData, {
|
|
207
212
|
data: pinnedData,
|
|
208
213
|
indexes: pinnedIndexes
|
|
209
214
|
}];
|
|
210
|
-
|
|
215
|
+
currentData.forEach(function (item, index) {
|
|
211
216
|
var key = typeof item === 'object' ? item[itemKey] : item;
|
|
212
217
|
|
|
213
218
|
if (pinned.includes(key)) {
|
|
@@ -221,7 +226,7 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
221
226
|
data: pinnedData,
|
|
222
227
|
indexes: pinnedIndexes
|
|
223
228
|
}];
|
|
224
|
-
}, [data, itemKey, pinned]),
|
|
229
|
+
}, [data, orderingData, itemKey, pinned]),
|
|
225
230
|
orderableData = _useMemo[0],
|
|
226
231
|
pinnedInfo = _useMemo[1];
|
|
227
232
|
|
|
@@ -235,11 +240,6 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
235
240
|
|
|
236
241
|
var Container = paginate ? StyledContainer : Fragment;
|
|
237
242
|
var containterProps = paginate ? _extends({}, theme.list.container) : undefined;
|
|
238
|
-
|
|
239
|
-
var _useState5 = useState(),
|
|
240
|
-
orderingData = _useState5[0],
|
|
241
|
-
setOrderingData = _useState5[1];
|
|
242
|
-
|
|
243
243
|
var draggingRef = useRef();
|
|
244
244
|
var sendAnalytics = useAnalytics();
|
|
245
245
|
var ariaProps = {
|
|
@@ -589,15 +589,18 @@ var List = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
589
589
|
updateActive(undefined);
|
|
590
590
|
setItemFocus(false);
|
|
591
591
|
}
|
|
592
|
-
}));
|
|
592
|
+
})); // wrap the main content and use
|
|
593
|
+
// the boxProps defined for the content
|
|
594
|
+
|
|
595
|
+
content = /*#__PURE__*/React.createElement(Box, _extends({
|
|
596
|
+
flex: true
|
|
597
|
+
}, boxProps), content); // Adjust the boxProps to account for the order controls
|
|
598
|
+
|
|
593
599
|
boxProps = {
|
|
594
600
|
direction: 'row',
|
|
595
601
|
align: defaultItemProps && defaultItemProps.align || 'center',
|
|
596
602
|
gap: 'medium'
|
|
597
603
|
};
|
|
598
|
-
content = /*#__PURE__*/React.createElement(Box, {
|
|
599
|
-
flex: true
|
|
600
|
-
}, content);
|
|
601
604
|
}
|
|
602
605
|
|
|
603
606
|
var itemAriaProps;
|
|
@@ -20,6 +20,7 @@ export var Selection = function Selection() {
|
|
|
20
20
|
pad: "large",
|
|
21
21
|
gap: "large"
|
|
22
22
|
}, /*#__PURE__*/React.createElement(List, {
|
|
23
|
+
"aria-label": "selection list",
|
|
23
24
|
data: data.slice(0, 10),
|
|
24
25
|
itemProps: selected >= 0 ? (_ref = {}, _ref[selected] = {
|
|
25
26
|
background: 'brand'
|
|
@@ -27,6 +27,7 @@ export var OnClickItemList = function OnClickItemList() {
|
|
|
27
27
|
pad: "large",
|
|
28
28
|
gap: "large"
|
|
29
29
|
}, /*#__PURE__*/React.createElement(List, {
|
|
30
|
+
"aria-label": "onClickItem list",
|
|
30
31
|
data: data.slice(0, 10),
|
|
31
32
|
onClickItem: function onClickItem(event) {
|
|
32
33
|
setShow(true);
|
|
@@ -142,11 +142,11 @@ var Notification = function Notification(_ref) {
|
|
|
142
142
|
}, action, theme.notification.actions)), ' ');
|
|
143
143
|
});
|
|
144
144
|
var Message = direction !== 'row' ? Paragraph : Text;
|
|
145
|
-
if (message || actions) message = /*#__PURE__*/React.createElement(Message, theme.notification.message, /*#__PURE__*/React.createElement(Text, {
|
|
145
|
+
if (message || actions) message = typeof message === 'string' ? /*#__PURE__*/React.createElement(Message, theme.notification.message, /*#__PURE__*/React.createElement(Text, {
|
|
146
146
|
margin: {
|
|
147
147
|
right: 'xsmall'
|
|
148
148
|
}
|
|
149
|
-
}, message), actions);
|
|
149
|
+
}, message), actions) : message;
|
|
150
150
|
var content = /*#__PURE__*/React.createElement(Box, _extends({}, theme.notification.container, global ? _extends({}, theme.notification.global.container) : {}, toast ? _extends({}, theme.notification.toast.container) : {}, {
|
|
151
151
|
background: background // let internal box control pad
|
|
152
152
|
,
|
|
@@ -7,7 +7,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
7
7
|
actions: PropTypes.arrayOf(PropTypes.shape(AnchorPropTypes)),
|
|
8
8
|
global: PropTypes.bool,
|
|
9
9
|
title: PropTypes.string,
|
|
10
|
-
message: PropTypes.string,
|
|
10
|
+
message: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
11
11
|
status: PropTypes.oneOf(['critical', 'warning', 'normal', 'info', 'unknown']),
|
|
12
12
|
toast: PropTypes.oneOfType([PropTypes.bool, PropTypes.shape({
|
|
13
13
|
autoClose: PropTypes.bool,
|