@pingux/astro 1.17.0 → 1.19.1-alpha.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/CHANGELOG.md +29 -0
- package/lib/cjs/components/Button/Button.stories.js +8 -3
- package/lib/cjs/components/Button/Button.test.js +5 -0
- package/lib/cjs/components/Chip/Chip.stories.js +18 -1
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.js +2 -0
- package/lib/cjs/components/CollapsiblePanel/CollapsiblePanel.stories.js +125 -32
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelContainer.js +4 -22
- package/lib/cjs/components/CollapsiblePanelContainer/CollapsiblePanelContainer.test.js +8 -8
- package/lib/cjs/components/CollapsiblePanelItem/CollapsiblePanelItem.js +2 -2
- package/lib/cjs/components/Link/Link.test.js +5 -0
- package/lib/cjs/components/ListView/ListView.js +1 -0
- package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +1 -1
- package/lib/cjs/components/RockerButton/RockerButton.js +5 -9
- package/lib/cjs/styles/themeOverrides/uiLibraryOverride.js +5 -0
- package/lib/cjs/styles/variants/boxes.js +19 -0
- package/lib/cjs/styles/variants/buttons.js +21 -6
- package/lib/cjs/styles/variants/collapsiblePanel.js +26 -7
- package/lib/cjs/styles/variants/overlayPanel.js +2 -2
- package/lib/components/Button/Button.stories.js +8 -3
- package/lib/components/Button/Button.test.js +3 -0
- package/lib/components/Chip/Chip.stories.js +14 -0
- package/lib/components/CollapsiblePanel/CollapsiblePanel.js +2 -0
- package/lib/components/CollapsiblePanel/CollapsiblePanel.stories.js +113 -31
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelContainer.js +1 -15
- package/lib/components/CollapsiblePanelContainer/CollapsiblePanelContainer.test.js +6 -6
- package/lib/components/CollapsiblePanelItem/CollapsiblePanelItem.js +2 -2
- package/lib/components/Link/Link.test.js +3 -0
- package/lib/components/ListView/ListView.js +1 -0
- package/lib/components/OverlayPanel/OverlayPanel.stories.js +1 -1
- package/lib/components/RockerButton/RockerButton.js +6 -10
- package/lib/styles/themeOverrides/uiLibraryOverride.js +5 -0
- package/lib/styles/variants/boxes.js +19 -0
- package/lib/styles/variants/buttons.js +21 -6
- package/lib/styles/variants/collapsiblePanel.js +26 -7
- package/lib/styles/variants/overlayPanel.js +2 -2
- package/package.json +1 -1
- package/NOTICE.html +0 -4292
@@ -156,7 +156,7 @@ var collapsiblePanelToggle = _objectSpread(_objectSpread({}, square), {}, {
|
|
156
156
|
bg: 'accent.99',
|
157
157
|
height: '40px',
|
158
158
|
minWidth: 'max-content',
|
159
|
-
pl: '
|
159
|
+
pl: 'xs',
|
160
160
|
ml: '10px',
|
161
161
|
path: {
|
162
162
|
fill: 'active'
|
@@ -164,7 +164,10 @@ var collapsiblePanelToggle = _objectSpread(_objectSpread({}, square), {}, {
|
|
164
164
|
'&.is-hovered': {
|
165
165
|
backgroundColor: 'accent.99'
|
166
166
|
},
|
167
|
-
'&.is-focused': _objectSpread({}, defaultFocus),
|
167
|
+
'&.is-focused': _objectSpread(_objectSpread({}, defaultFocus), {}, {
|
168
|
+
outlineOffset: '0',
|
169
|
+
zIndex: 1
|
170
|
+
}),
|
168
171
|
'&.is-pressed': {
|
169
172
|
backgroundColor: 'accent.99'
|
170
173
|
}
|
@@ -388,6 +391,18 @@ var inline = _objectSpread(_objectSpread({}, base), {}, {
|
|
388
391
|
'&.is-focused': _objectSpread({}, defaultFocus)
|
389
392
|
});
|
390
393
|
|
394
|
+
var inlinePrimary = _objectSpread(_objectSpread(_objectSpread({}, inline), defaultActive), {}, {
|
395
|
+
'&.is-hovered': _objectSpread(_objectSpread({}, defaultHover), {}, {
|
396
|
+
backgroundColor: 'accent.40',
|
397
|
+
color: 'white'
|
398
|
+
}),
|
399
|
+
'&.is-pressed': _objectSpread(_objectSpread({}, defaultActive), {}, {
|
400
|
+
backgroundColor: 'accent.20',
|
401
|
+
border: '1px solid',
|
402
|
+
borderColor: 'accent.20'
|
403
|
+
})
|
404
|
+
});
|
405
|
+
|
391
406
|
var text = _objectSpread(_objectSpread({}, base), {}, {
|
392
407
|
display: 'inline-flex',
|
393
408
|
bg: 'transparent',
|
@@ -440,7 +455,8 @@ var rocker = _objectSpread(_objectSpread({}, base), {}, {
|
|
440
455
|
bg: 'accent.95',
|
441
456
|
'&.is-selected': {
|
442
457
|
bg: 'active',
|
443
|
-
color: 'white'
|
458
|
+
color: 'white',
|
459
|
+
zIndex: '1'
|
444
460
|
},
|
445
461
|
'&.is-focused': _objectSpread({}, defaultFocus)
|
446
462
|
});
|
@@ -486,9 +502,7 @@ var colorField = {
|
|
486
502
|
'&:focus-visible': {
|
487
503
|
outline: 'none'
|
488
504
|
},
|
489
|
-
'&.is-focused': {
|
490
|
-
borderColor: 'accent.80'
|
491
|
-
}
|
505
|
+
'&.is-focused': _objectSpread({}, defaultFocus)
|
492
506
|
};
|
493
507
|
|
494
508
|
var imageUpload = _objectSpread(_objectSpread({}, base), {}, {
|
@@ -713,6 +727,7 @@ var _default = {
|
|
713
727
|
iconButton: iconButton,
|
714
728
|
imageUpload: imageUpload,
|
715
729
|
inline: inline,
|
730
|
+
inlinePrimary: inlinePrimary,
|
716
731
|
inverted: inverted,
|
717
732
|
link: link,
|
718
733
|
primary: primary,
|
@@ -8,10 +8,17 @@ _Object$defineProperty(exports, "__esModule", {
|
|
8
8
|
|
9
9
|
exports["default"] = void 0;
|
10
10
|
var collapsiblePanelContainer = {
|
11
|
-
overflowX: 'hidden',
|
12
11
|
pr: 'sm',
|
13
|
-
|
14
|
-
|
12
|
+
minHeight: '80vh',
|
13
|
+
'>div': {
|
14
|
+
visibility: 'hidden',
|
15
|
+
width: 0,
|
16
|
+
transition: 'width .3s ease'
|
17
|
+
},
|
18
|
+
'&.is-open>div': {
|
19
|
+
visibility: 'visible',
|
20
|
+
width: '300px'
|
21
|
+
}
|
15
22
|
};
|
16
23
|
var collapsiblePanelContent = {
|
17
24
|
bg: 'accent.99',
|
@@ -34,15 +41,17 @@ var collapsiblePanelContent = {
|
|
34
41
|
};
|
35
42
|
var collapsiblePanelContainerTitle = {
|
36
43
|
alignContent: 'center',
|
37
|
-
bg: 'accent.99',
|
38
|
-
display: 'flex',
|
39
44
|
fontWeight: '500',
|
40
45
|
minHeight: '40px',
|
41
46
|
alignItems: 'center',
|
42
47
|
padding: '0 10px !important',
|
43
48
|
flexWrap: 'wrap',
|
44
49
|
maxWidth: 'max-content !important',
|
45
|
-
margin: '0'
|
50
|
+
margin: '0',
|
51
|
+
width: '0',
|
52
|
+
'.is-open &': {
|
53
|
+
width: '300px'
|
54
|
+
}
|
46
55
|
};
|
47
56
|
var collapsiblePanelBadge = {
|
48
57
|
borderRadius: '5px',
|
@@ -55,7 +64,17 @@ var collapsiblePanelBadge = {
|
|
55
64
|
pr: '3px !important',
|
56
65
|
pl: '3px !important',
|
57
66
|
alignItems: 'center',
|
58
|
-
fontWeight: 500
|
67
|
+
fontWeight: 500,
|
68
|
+
'.is-open &.title-badge': {
|
69
|
+
minWidth: '0',
|
70
|
+
display: 'flex',
|
71
|
+
transition: 'min-width .3s ease',
|
72
|
+
width: 'max-content'
|
73
|
+
},
|
74
|
+
'&.title-badge': {
|
75
|
+
display: 'none',
|
76
|
+
width: '0'
|
77
|
+
}
|
59
78
|
};
|
60
79
|
var collapsiblePanellItem = {
|
61
80
|
minHeight: '45px',
|
@@ -10,7 +10,7 @@ exports["default"] = void 0;
|
|
10
10
|
var overlayPanel = {
|
11
11
|
position: 'fixed',
|
12
12
|
overflowY: 'scroll',
|
13
|
-
zIndex:
|
13
|
+
zIndex: 10,
|
14
14
|
top: 0,
|
15
15
|
bottom: 0,
|
16
16
|
right: '-100%',
|
@@ -42,7 +42,7 @@ var overlayPanel = {
|
|
42
42
|
};
|
43
43
|
var overlayPanelInner = {
|
44
44
|
position: 'absolute',
|
45
|
-
zIndex:
|
45
|
+
zIndex: 9,
|
46
46
|
bottom: 0,
|
47
47
|
right: 0,
|
48
48
|
background: 'white',
|
@@ -14,7 +14,7 @@ delete variants.ICON;
|
|
14
14
|
delete variants.ICON_BUTTON;
|
15
15
|
delete variants.INVERTED; // add designer approved variants for devs to use here
|
16
16
|
|
17
|
-
var variantOptions = ['critical', 'danger', 'default', 'inline', 'link', 'primary', 'success', 'text'];
|
17
|
+
var variantOptions = ['critical', 'danger', 'default', 'inline', 'inlinePrimary', 'link', 'primary', 'success', 'text'];
|
18
18
|
export default {
|
19
19
|
title: 'Button',
|
20
20
|
component: Button,
|
@@ -69,10 +69,15 @@ export var TextIconButton = function TextIconButton() {
|
|
69
69
|
}), "Add a Form"));
|
70
70
|
};
|
71
71
|
export var InlineButton = function InlineButton() {
|
72
|
-
return ___EmotionJSX(Button, {
|
72
|
+
return ___EmotionJSX(Box, null, ___EmotionJSX(Button, {
|
73
73
|
mb: "sm",
|
74
|
+
mr: "auto",
|
74
75
|
variant: "inline"
|
75
|
-
}, "Inline")
|
76
|
+
}, "Inline"), ___EmotionJSX(Button, {
|
77
|
+
mb: "sm",
|
78
|
+
mr: "auto",
|
79
|
+
variant: "inlinePrimary"
|
80
|
+
}, "Inline primary"));
|
76
81
|
};
|
77
82
|
export var ColorBlockButton = function ColorBlockButton(args) {
|
78
83
|
// Change `isConfigured` property in storybook controls
|
@@ -100,6 +100,9 @@ test('color block button renders in default state', function () {
|
|
100
100
|
userEvent.tab();
|
101
101
|
expect(button).toHaveClass('is-focused');
|
102
102
|
expect(button).toHaveFocus();
|
103
|
+
userEvent.tab();
|
104
|
+
expect(button).not.toHaveClass('is-focused');
|
105
|
+
expect(button).not.toHaveFocus();
|
103
106
|
});
|
104
107
|
test('color block button renders in configured state', function () {
|
105
108
|
getComponent({
|
@@ -8,6 +8,7 @@ import Earth from 'mdi-react/EarthIcon';
|
|
8
8
|
import Chip from '../Chip';
|
9
9
|
import Icon from '../Icon';
|
10
10
|
import IconButton from '../IconButton';
|
11
|
+
import Box from '../Box';
|
11
12
|
import { flatColorList } from '../../styles/colors.js';
|
12
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
13
14
|
export default {
|
@@ -60,6 +61,19 @@ export var Default = function Default(_ref5) {
|
|
60
61
|
color: "white"
|
61
62
|
}, args));
|
62
63
|
};
|
64
|
+
export var Count = function Count(_ref6) {
|
65
|
+
var args = _extends({}, _ref6);
|
66
|
+
|
67
|
+
return ___EmotionJSX(Box, null, ___EmotionJSX(Chip, _extends({
|
68
|
+
color: "white"
|
69
|
+
}, args, {
|
70
|
+
label: "1",
|
71
|
+
variant: "boxes.chipCount"
|
72
|
+
})), ___EmotionJSX("br", null), ___EmotionJSX(Chip, _extends({}, args, {
|
73
|
+
label: "1",
|
74
|
+
variant: "boxes.countNeutral"
|
75
|
+
})));
|
76
|
+
};
|
63
77
|
export var ChipWithCustomColors = function ChipWithCustomColors() {
|
64
78
|
return ___EmotionJSX(Chip, {
|
65
79
|
label: "Custom Colors",
|
@@ -65,6 +65,7 @@ var CollapsiblePanel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
65
65
|
variant: "collapsiblePanelTitle"
|
66
66
|
}, listTitle), selectedFilterCount && ___EmotionJSX(CollapsiblePanelBadge, {
|
67
67
|
margin: "0",
|
68
|
+
className: "title-badge",
|
68
69
|
selectedFilterCount: selectedFilterCount
|
69
70
|
})), ___EmotionJSX(Box, {
|
70
71
|
pl: "xs",
|
@@ -73,6 +74,7 @@ var CollapsiblePanel = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
73
74
|
items: items,
|
74
75
|
onSelectionChange: onSelectionChange,
|
75
76
|
selectionMode: "none",
|
77
|
+
selectionStyle: "highlight",
|
76
78
|
style: {
|
77
79
|
width: '100%'
|
78
80
|
},
|
@@ -1,14 +1,32 @@
|
|
1
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
2
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
3
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
4
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
5
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
6
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
7
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
1
8
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
-
import
|
9
|
+
import _someInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/some";
|
10
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
|
+
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
12
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
13
|
+
import _sortInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/sort";
|
14
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
15
|
+
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
17
|
+
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
19
|
+
|
20
|
+
import React, { useRef, useState, useMemo } from 'react';
|
3
21
|
import AccountGroupIcon from 'mdi-react/AccountGroupIcon';
|
4
|
-
import Clear from 'mdi-react/CloseIcon';
|
5
22
|
import ChevronRightIcon from 'mdi-react/ChevronRightIcon';
|
6
|
-
import
|
23
|
+
import CheckIcon from 'mdi-react/CheckIcon';
|
24
|
+
import Clear from 'mdi-react/CloseIcon';
|
7
25
|
import SearchIcon from 'mdi-react/SearchIcon';
|
8
26
|
import AccountIcon from 'mdi-react/AccountIcon';
|
9
27
|
import CollapsiblePanel from './CollapsiblePanel';
|
10
28
|
import { useOverlayPanelState } from '../../hooks';
|
11
|
-
import { Breadcrumbs, Box, Button, Chip, ListView, Item, Icon, IconButton, CollapsiblePanelItem, OverlayPanel, OverlayProvider, SearchField, Text } from '../../index';
|
29
|
+
import { Breadcrumbs, Box, Button, CheckboxField, Chip, ListView, Item, Icon, IconButton, CollapsiblePanelItem, OverlayPanel, OverlayProvider, SearchField, Text } from '../../index';
|
12
30
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
13
31
|
export default {
|
14
32
|
title: 'CollapsiblePanel',
|
@@ -34,13 +52,14 @@ export default {
|
|
34
52
|
}
|
35
53
|
}
|
36
54
|
};
|
37
|
-
var
|
55
|
+
var data = [{
|
38
56
|
id: '1',
|
39
57
|
icon: 'Group',
|
40
58
|
key: 'Avengers',
|
41
59
|
name: 'Avengers',
|
42
60
|
subtitle: 'Default',
|
43
|
-
chipValue: '25'
|
61
|
+
chipValue: '25',
|
62
|
+
isDefaultSelected: true
|
44
63
|
}, {
|
45
64
|
id: '2',
|
46
65
|
icon: 'Group',
|
@@ -61,7 +80,8 @@ var items = [{
|
|
61
80
|
key: 'Digital Investors',
|
62
81
|
name: 'Digital Investors',
|
63
82
|
subtitle: 'N America',
|
64
|
-
chipValue: '12'
|
83
|
+
chipValue: '12',
|
84
|
+
isDefaultSelected: true
|
65
85
|
}, {
|
66
86
|
id: '5',
|
67
87
|
icon: 'Group',
|
@@ -98,33 +118,45 @@ var items = [{
|
|
98
118
|
subtitle: '',
|
99
119
|
chipValue: '29'
|
100
120
|
}];
|
101
|
-
var mockData = [{
|
102
|
-
id: '10',
|
103
|
-
key: 'Avengers',
|
104
|
-
name: 'Avengers'
|
105
|
-
}, {
|
106
|
-
id: '11',
|
107
|
-
key: 'Digital Investors',
|
108
|
-
name: 'Digital Investors'
|
109
|
-
}, {
|
110
|
-
id: '12',
|
111
|
-
key: 'A very long title as well',
|
112
|
-
name: 'A very long title as well'
|
113
|
-
}];
|
114
|
-
|
115
|
-
var changeSelection = function changeSelection(selected) {
|
116
|
-
console.log(selected);
|
117
|
-
};
|
118
|
-
|
119
121
|
export var Default = function Default(args) {
|
120
122
|
return ___EmotionJSX(CollapsiblePanel, args);
|
121
123
|
};
|
122
124
|
export var CollapsiblePanelWithBadge = function CollapsiblePanelWithBadge(args) {
|
125
|
+
var _useState = useState(data),
|
126
|
+
_useState2 = _slicedToArray(_useState, 2),
|
127
|
+
items = _useState2[0],
|
128
|
+
setItems = _useState2[1];
|
129
|
+
|
123
130
|
var _useOverlayPanelState = useOverlayPanelState(),
|
124
131
|
state = _useOverlayPanelState.state,
|
125
132
|
onClose = _useOverlayPanelState.onClose;
|
126
133
|
|
127
134
|
var triggerRef = useRef();
|
135
|
+
var selectedItems = useMemo(function () {
|
136
|
+
var _context;
|
137
|
+
|
138
|
+
return _sortInstanceProperty(_context = _filterInstanceProperty(items).call(items, function (item) {
|
139
|
+
return item.isDefaultSelected || item.isSelected;
|
140
|
+
}) // sort elements to display "default selected" at first place
|
141
|
+
).call(_context, function (a, b) {
|
142
|
+
return Number(!!b.isDefaultSelected) - Number(!!a.isDefaultSelected);
|
143
|
+
});
|
144
|
+
}, [items]);
|
145
|
+
|
146
|
+
var changeSelection = function changeSelection(key) {
|
147
|
+
setItems(function (prevItems) {
|
148
|
+
return _mapInstanceProperty(prevItems).call(prevItems, function (el) {
|
149
|
+
if (el.key === key) {
|
150
|
+
return _objectSpread(_objectSpread({}, el), {}, {
|
151
|
+
isSelected: !el.isSelected
|
152
|
+
});
|
153
|
+
}
|
154
|
+
|
155
|
+
return el;
|
156
|
+
});
|
157
|
+
});
|
158
|
+
};
|
159
|
+
|
128
160
|
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
|
129
161
|
ref: triggerRef,
|
130
162
|
onPress: state.open
|
@@ -181,7 +213,10 @@ export var CollapsiblePanelWithBadge = function CollapsiblePanelWithBadge(args)
|
|
181
213
|
pt: "25px"
|
182
214
|
}, ___EmotionJSX(Box, {
|
183
215
|
isRow: true,
|
184
|
-
justifyContent: "space-between"
|
216
|
+
justifyContent: "space-between",
|
217
|
+
sx: {
|
218
|
+
marginTop: '5px'
|
219
|
+
}
|
185
220
|
}, ___EmotionJSX(Box, {
|
186
221
|
width: "100%"
|
187
222
|
}, ___EmotionJSX(SearchField, {
|
@@ -190,11 +225,13 @@ export var CollapsiblePanelWithBadge = function CollapsiblePanelWithBadge(args)
|
|
190
225
|
placeholder: "Search",
|
191
226
|
width: "100%",
|
192
227
|
mt: "0px",
|
193
|
-
mr: "sm"
|
228
|
+
mr: "sm",
|
229
|
+
mb: "xs"
|
194
230
|
}), ___EmotionJSX(ListView, {
|
195
231
|
items: items,
|
196
232
|
style: {
|
197
|
-
width: '
|
233
|
+
width: '100%',
|
234
|
+
outline: 'none'
|
198
235
|
}
|
199
236
|
}, function (item) {
|
200
237
|
return ___EmotionJSX(Item, {
|
@@ -202,8 +239,12 @@ export var CollapsiblePanelWithBadge = function CollapsiblePanelWithBadge(args)
|
|
202
239
|
textValue: item.name,
|
203
240
|
"data-id": item.key,
|
204
241
|
listItemProps: {
|
242
|
+
isRow: true,
|
205
243
|
sx: {
|
206
244
|
bg: 'white',
|
245
|
+
width: '100%',
|
246
|
+
justifyContent: 'space-between',
|
247
|
+
alignItems: 'center',
|
207
248
|
'&.is-hovered': {
|
208
249
|
bg: 'accent.99'
|
209
250
|
}
|
@@ -233,9 +274,46 @@ export var CollapsiblePanelWithBadge = function CollapsiblePanelWithBadge(args)
|
|
233
274
|
}
|
234
275
|
})), ___EmotionJSX(Text, {
|
235
276
|
variant: "listSubtitle"
|
236
|
-
}, item.subtitle)))
|
277
|
+
}, item.subtitle))), item.isDefaultSelected ? ___EmotionJSX(Box, {
|
278
|
+
isRow: true,
|
279
|
+
sx: {
|
280
|
+
border: '1px solid',
|
281
|
+
borderColor: 'neutral.80',
|
282
|
+
borderRadius: 5,
|
283
|
+
minHeight: 22,
|
284
|
+
justifyContent: 'center',
|
285
|
+
alignItems: 'center',
|
286
|
+
p: 'xs',
|
287
|
+
maxWidth: '50%'
|
288
|
+
}
|
289
|
+
}, ___EmotionJSX(Icon, {
|
290
|
+
icon: CheckIcon,
|
291
|
+
color: "neutral.20",
|
292
|
+
size: 13,
|
293
|
+
sx: {
|
294
|
+
flexShrink: 0
|
295
|
+
}
|
296
|
+
}), ___EmotionJSX(Text, {
|
297
|
+
sx: {
|
298
|
+
fontSize: 'sm',
|
299
|
+
pl: 'xs',
|
300
|
+
maxHeight: 32,
|
301
|
+
overflow: 'hidden'
|
302
|
+
}
|
303
|
+
}, "Added by Filter")) : ___EmotionJSX(CheckboxField, {
|
304
|
+
controlProps: {
|
305
|
+
color: 'neutral.10',
|
306
|
+
'aria-label': 'Select'
|
307
|
+
},
|
308
|
+
onChange: function onChange() {
|
309
|
+
return changeSelection(item.key);
|
310
|
+
},
|
311
|
+
isSelected: _someInstanceProperty(selectedItems).call(selectedItems, function (el) {
|
312
|
+
return el.key === item.key;
|
313
|
+
})
|
314
|
+
}));
|
237
315
|
})), ___EmotionJSX(CollapsiblePanel, _extends({
|
238
|
-
items:
|
316
|
+
items: selectedItems,
|
239
317
|
onSelectionChange: changeSelection,
|
240
318
|
selectedFilterCount: "1000+"
|
241
319
|
}, args), function (item) {
|
@@ -245,7 +323,11 @@ export var CollapsiblePanelWithBadge = function CollapsiblePanelWithBadge(args)
|
|
245
323
|
"data-id": item.key
|
246
324
|
}, ___EmotionJSX(CollapsiblePanelItem, {
|
247
325
|
text: item.name,
|
248
|
-
icon:
|
326
|
+
icon: item.isDefaultSelected ? CheckIcon : Clear,
|
327
|
+
onPress: function onPress() {
|
328
|
+
return changeSelection(item.key);
|
329
|
+
},
|
330
|
+
isDefaultSelected: item.isDefaultSelected
|
249
331
|
}));
|
250
332
|
})))));
|
251
333
|
};
|
@@ -1,20 +1,6 @@
|
|
1
|
-
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
2
|
-
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
3
|
-
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
4
|
-
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
5
|
-
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
6
|
-
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
7
|
-
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
8
|
-
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
9
1
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
|
-
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
12
3
|
var _excluded = ["selectedFilterCount", "className", "children", "closeAriaLabel", "isDefaultOpen", "isOpen", "onOpenChange", "openAriaLabel"];
|
13
|
-
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
15
|
-
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context, _context2; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(source), !0)).call(_context, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
17
|
-
|
18
4
|
import React, { forwardRef } from 'react';
|
19
5
|
import PropTypes from 'prop-types';
|
20
6
|
import ChevronRightIcon from 'mdi-react/ChevronRightIcon';
|
@@ -90,7 +76,7 @@ var CollapsiblePanelContainer = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
90
76
|
"data-testid": "collapsible-panel-badge",
|
91
77
|
margin: "auto",
|
92
78
|
selectedFilterCount: selectedFilterCount
|
93
|
-
})),
|
79
|
+
})), children);
|
94
80
|
});
|
95
81
|
CollapsiblePanelContainer.propTypes = {
|
96
82
|
/** Amount of selected items indicator. */
|
@@ -55,13 +55,13 @@ test('updates aria label when button is clicked', function () {
|
|
55
55
|
state: state
|
56
56
|
});
|
57
57
|
var button = screen.getByTestId(collapsiblePanelButtonId);
|
58
|
+
var container = screen.getByTestId(testId);
|
58
59
|
userEvent.click(button);
|
59
|
-
var collapsiblePanel = screen.queryByTestId(collapsiblePanelId);
|
60
60
|
expect(button).toHaveAttribute('aria-label', 'Close filter menu?');
|
61
|
-
expect(
|
61
|
+
expect(container).toHaveClass('is-open');
|
62
62
|
userEvent.click(button);
|
63
63
|
expect(button).toHaveAttribute('aria-label', 'Open filter menu?');
|
64
|
-
expect(
|
64
|
+
expect(container).not.toHaveClass('is-open');
|
65
65
|
});
|
66
66
|
test('shows children when isOpen is true', function () {
|
67
67
|
getComponent({
|
@@ -73,9 +73,9 @@ test('shows children when isOpen is true', function () {
|
|
73
73
|
test('should hide children when pressing the escape key', function () {
|
74
74
|
getComponent();
|
75
75
|
var button = screen.getByTestId(collapsiblePanelButtonId);
|
76
|
+
var container = screen.getByTestId(testId);
|
76
77
|
userEvent.click(button);
|
77
|
-
|
78
|
-
expect(collapsiblePanel).toBeInTheDocument();
|
78
|
+
expect(container).toHaveClass('is-open');
|
79
79
|
userEvent.type(button, '{esc}');
|
80
|
-
expect(
|
80
|
+
expect(container).not.toHaveClass('is-open');
|
81
81
|
});
|
@@ -23,8 +23,8 @@ var CollapsiblePanelItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
23
23
|
variant: "collapsiblePanellItem"
|
24
24
|
}, text), iconElement && (isDefaultSelected ? iconElement : ___EmotionJSX(IconButton, {
|
25
25
|
sx: {
|
26
|
-
width:
|
27
|
-
height:
|
26
|
+
width: 20,
|
27
|
+
height: 20,
|
28
28
|
alignSelf: 'auto',
|
29
29
|
'& path': {
|
30
30
|
fill: 'inherit'
|
@@ -43,6 +43,9 @@ test('link shows focus status', function () {
|
|
43
43
|
userEvent.tab();
|
44
44
|
expect(link).toHaveFocus();
|
45
45
|
expect(link).toHaveClass('is-focused');
|
46
|
+
userEvent.tab();
|
47
|
+
expect(link).not.toHaveFocus();
|
48
|
+
expect(link).not.toHaveClass('is-focused');
|
46
49
|
});
|
47
50
|
test('link shows disabled status', function () {
|
48
51
|
// Needs href to have a tabindex
|
@@ -149,6 +149,7 @@ var ListView = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
149
149
|
|
150
150
|
layout.isLoading = isLoading;
|
151
151
|
var focusedItem = gridCollection.getFirstKey();
|
152
|
+
delete gridProps.onMouseDown;
|
152
153
|
return ___EmotionJSX(ListViewContext.Provider, {
|
153
154
|
value: {
|
154
155
|
state: state,
|
@@ -16,7 +16,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
16
16
|
import React, { forwardRef, useContext, useImperativeHandle, useRef } from 'react';
|
17
17
|
import PropTypes from 'prop-types';
|
18
18
|
import { Item } from '@react-stately/collections';
|
19
|
-
import {
|
19
|
+
import { FocusRing } from '@react-aria/focus';
|
20
20
|
import { useRockerButton, useStatusClasses, usePropWarning } from '../../hooks';
|
21
21
|
import { Box } from '../../index';
|
22
22
|
import { RockerContext } from '../RockerButtonGroup';
|
@@ -29,15 +29,9 @@ export var CollectionRockerButton = /*#__PURE__*/forwardRef(function (props, ref
|
|
29
29
|
itemProps = item.props;
|
30
30
|
var state = useContext(RockerContext);
|
31
31
|
var isDisabled = state.disabledKeys.has(key);
|
32
|
-
|
33
|
-
var _useFocusRing = useFocusRing(),
|
34
|
-
isFocusVisible = _useFocusRing.isFocusVisible,
|
35
|
-
focusProps = _useFocusRing.focusProps;
|
36
|
-
|
37
32
|
var isSelected = state.selectedKey === key;
|
38
33
|
|
39
34
|
var _useStatusClasses = useStatusClasses(className, {
|
40
|
-
isFocused: isFocusVisible,
|
41
35
|
isSelected: isSelected,
|
42
36
|
isDisabled: isDisabled
|
43
37
|
}),
|
@@ -58,17 +52,19 @@ export var CollectionRockerButton = /*#__PURE__*/forwardRef(function (props, ref
|
|
58
52
|
}, state, rockerButtonRef),
|
59
53
|
rockerButtonProps = _useRockerButton.rockerButtonProps;
|
60
54
|
|
61
|
-
return ___EmotionJSX(
|
55
|
+
return ___EmotionJSX(FocusRing, {
|
56
|
+
focusRingClass: "is-focused"
|
57
|
+
}, ___EmotionJSX(Box, _extends({
|
62
58
|
as: "button",
|
63
59
|
className: classNames,
|
64
60
|
variant: "buttons.rocker"
|
65
61
|
}, rockerButtonProps, {
|
66
62
|
ref: rockerButtonRef
|
67
|
-
},
|
63
|
+
}, itemProps, {
|
68
64
|
sx: {
|
69
65
|
'&.is-selected': _objectSpread({}, itemProps.selectedStyles)
|
70
66
|
}
|
71
|
-
}), rendered);
|
67
|
+
}), rendered));
|
72
68
|
});
|
73
69
|
CollectionRockerButton.displayName = 'CollectionRockerButton';
|
74
70
|
CollectionRockerButton.propTypes = {
|
@@ -41,6 +41,11 @@ var buttons = {
|
|
41
41
|
border: 'none'
|
42
42
|
})
|
43
43
|
},
|
44
|
+
environmentBreadcrumb: {
|
45
|
+
current: {
|
46
|
+
'&:hover:not(.disabled)': _objectSpread({}, theme.buttons.environmentBreadcrumb.current)
|
47
|
+
}
|
48
|
+
},
|
44
49
|
rocker: _objectSpread(_objectSpread({}, theme.buttons.rocker), {}, {
|
45
50
|
':focus': {
|
46
51
|
border: 'none'
|
@@ -114,6 +114,23 @@ export var chip = {
|
|
114
114
|
}
|
115
115
|
};
|
116
116
|
|
117
|
+
var countDefault = _objectSpread(_objectSpread({}, chip), {}, {
|
118
|
+
width: 'fit-content',
|
119
|
+
minWidth: '17px',
|
120
|
+
height: '17px'
|
121
|
+
});
|
122
|
+
|
123
|
+
var chipCount = _objectSpread(_objectSpread({}, countDefault), {}, {
|
124
|
+
backgroundColor: '#640099 !important'
|
125
|
+
});
|
126
|
+
|
127
|
+
var countNeutral = _objectSpread(_objectSpread({}, chipCount), {}, {
|
128
|
+
backgroundColor: '#E4E6E9 !important',
|
129
|
+
'& span': {
|
130
|
+
color: 'neutral.20'
|
131
|
+
}
|
132
|
+
});
|
133
|
+
|
117
134
|
var multivaluesChip = _objectSpread(_objectSpread({}, chip), {}, {
|
118
135
|
alignSelf: 'center',
|
119
136
|
cursor: 'default',
|
@@ -316,6 +333,8 @@ export default {
|
|
316
333
|
base: base,
|
317
334
|
card: card,
|
318
335
|
chip: chip,
|
336
|
+
chipCount: chipCount,
|
337
|
+
countNeutral: countNeutral,
|
319
338
|
selectedItemChip: selectedItemChip,
|
320
339
|
readOnlyChip: readOnlyChip,
|
321
340
|
copy: copy,
|