@pingux/astro 1.17.0-alpha.1 → 1.17.0-alpha.10
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/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/MultivaluesField/MultivaluesField.stories.js +142 -21
- package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +1 -1
- package/lib/cjs/components/RockerButton/RockerButton.js +5 -9
- package/lib/cjs/styles/variants/boxes.js +19 -0
- package/lib/cjs/styles/variants/buttons.js +20 -3
- 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/MultivaluesField/MultivaluesField.stories.js +142 -20
- package/lib/components/OverlayPanel/OverlayPanel.stories.js +1 -1
- package/lib/components/RockerButton/RockerButton.js +6 -10
- package/lib/styles/variants/boxes.js +19 -0
- package/lib/styles/variants/buttons.js +20 -3
- package/lib/styles/variants/collapsiblePanel.js +26 -7
- package/lib/styles/variants/overlayPanel.js +2 -2
- package/package.json +1 -1
@@ -16,10 +16,10 @@ _Object$defineProperty(exports, "__esModule", {
|
|
16
16
|
|
17
17
|
exports["default"] = exports.WithReadOnlyValues = exports.WithDisabledKeys = exports.WithCustomValues = exports.WithCustomSize = exports.Uncontrolled = exports.Default = exports.Controlled = void 0;
|
18
18
|
|
19
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
20
|
-
|
21
19
|
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
22
20
|
|
21
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
22
|
+
|
23
23
|
var _react = _interopRequireWildcard(require("react"));
|
24
24
|
|
25
25
|
var _ = require("../..");
|
@@ -34,7 +34,9 @@ var _default = {
|
|
34
34
|
title: 'Form/MultivaluesField',
|
35
35
|
component: _.MultivaluesField,
|
36
36
|
argTypes: {
|
37
|
-
direction: {
|
37
|
+
direction: {
|
38
|
+
defaultValue: 'bottom'
|
39
|
+
},
|
38
40
|
hasAutoFocus: {},
|
39
41
|
hasNoStatusIndicator: {},
|
40
42
|
isDisabled: {},
|
@@ -118,7 +120,26 @@ var items = [{
|
|
118
120
|
key: 'Shark'
|
119
121
|
}];
|
120
122
|
|
123
|
+
var setOverlayStyle = function setOverlayStyle(direction, isOpen, mr, ml, mt) {
|
124
|
+
return {
|
125
|
+
marginRight: direction === 'right' && isOpen ? mr : 0,
|
126
|
+
marginLeft: direction === 'left' && isOpen ? ml : 0,
|
127
|
+
marginTop: direction === 'top' && isOpen ? mt : 0
|
128
|
+
};
|
129
|
+
};
|
130
|
+
|
121
131
|
var Default = function Default(args) {
|
132
|
+
var _useState = (0, _react.useState)(false),
|
133
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
134
|
+
isOpen = _useState2[0],
|
135
|
+
setIsOpen = _useState2[1];
|
136
|
+
|
137
|
+
var direction = args.direction;
|
138
|
+
|
139
|
+
var onOpenChange = function onOpenChange() {
|
140
|
+
setIsOpen(true);
|
141
|
+
};
|
142
|
+
|
122
143
|
return (// const items = [
|
123
144
|
// { id: 1, name: 'Aardvark', key: 'Aardvark' },
|
124
145
|
// { id: 2, name: 'Kangaroo', key: 'Kangaroo' },
|
@@ -128,9 +149,14 @@ var Default = function Default(args) {
|
|
128
149
|
// { id: 6, name: 'Orangutan', key: 'Orangutan' },
|
129
150
|
// { id: 7, name: 'Shark', key: 'Shark' },
|
130
151
|
// ];
|
131
|
-
(0, _react2.jsx)(_.OverlayProvider
|
152
|
+
(0, _react2.jsx)(_.OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
153
|
+
, {
|
154
|
+
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
155
|
+
}, (0, _react2.jsx)(_.MultivaluesField, (0, _extends2["default"])({
|
132
156
|
items: items
|
133
|
-
}, args
|
157
|
+
}, args, {
|
158
|
+
onOpenChange: onOpenChange
|
159
|
+
}), function (item) {
|
134
160
|
return (0, _react2.jsx)(_.Item, {
|
135
161
|
key: item.key,
|
136
162
|
"data-id": item.name
|
@@ -142,10 +168,26 @@ var Default = function Default(args) {
|
|
142
168
|
exports.Default = Default;
|
143
169
|
|
144
170
|
var WithCustomValues = function WithCustomValues(args) {
|
145
|
-
|
171
|
+
var _useState3 = (0, _react.useState)(false),
|
172
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
173
|
+
isOpen = _useState4[0],
|
174
|
+
setIsOpen = _useState4[1];
|
175
|
+
|
176
|
+
var direction = args.direction;
|
177
|
+
|
178
|
+
var onOpenChange = function onOpenChange() {
|
179
|
+
setIsOpen(true);
|
180
|
+
};
|
181
|
+
|
182
|
+
return (0, _react2.jsx)(_.OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
183
|
+
, {
|
184
|
+
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
185
|
+
}, (0, _react2.jsx)(_.MultivaluesField, (0, _extends2["default"])({
|
146
186
|
items: items,
|
147
187
|
mode: "non-restrictive"
|
148
|
-
}, args
|
188
|
+
}, args, {
|
189
|
+
onOpenChange: onOpenChange
|
190
|
+
}), function (item) {
|
149
191
|
return (0, _react2.jsx)(_.Item, {
|
150
192
|
key: item.key,
|
151
193
|
"data-id": item.name
|
@@ -161,10 +203,26 @@ WithCustomValues.argTypes = {
|
|
161
203
|
};
|
162
204
|
|
163
205
|
var WithDisabledKeys = function WithDisabledKeys(args) {
|
164
|
-
|
206
|
+
var _useState5 = (0, _react.useState)(false),
|
207
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
208
|
+
isOpen = _useState6[0],
|
209
|
+
setIsOpen = _useState6[1];
|
210
|
+
|
211
|
+
var direction = args.direction;
|
212
|
+
|
213
|
+
var onOpenChange = function onOpenChange() {
|
214
|
+
setIsOpen(true);
|
215
|
+
};
|
216
|
+
|
217
|
+
return (0, _react2.jsx)(_.OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
218
|
+
, {
|
219
|
+
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
220
|
+
}, (0, _react2.jsx)(_.MultivaluesField, (0, _extends2["default"])({
|
165
221
|
disabledKeys: ['Aardvark'],
|
166
222
|
items: items
|
167
|
-
}, args
|
223
|
+
}, args, {
|
224
|
+
onOpenChange: onOpenChange
|
225
|
+
}), function (item) {
|
168
226
|
return (0, _react2.jsx)(_.Item, {
|
169
227
|
key: item.key,
|
170
228
|
"data-id": item.name
|
@@ -175,10 +233,26 @@ var WithDisabledKeys = function WithDisabledKeys(args) {
|
|
175
233
|
exports.WithDisabledKeys = WithDisabledKeys;
|
176
234
|
|
177
235
|
var Uncontrolled = function Uncontrolled(args) {
|
178
|
-
|
236
|
+
var _useState7 = (0, _react.useState)(false),
|
237
|
+
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
238
|
+
isOpen = _useState8[0],
|
239
|
+
setIsOpen = _useState8[1];
|
240
|
+
|
241
|
+
var direction = args.direction;
|
242
|
+
|
243
|
+
var onOpenChange = function onOpenChange() {
|
244
|
+
setIsOpen(true);
|
245
|
+
};
|
246
|
+
|
247
|
+
return (0, _react2.jsx)(_.OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
248
|
+
, {
|
249
|
+
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
250
|
+
}, (0, _react2.jsx)(_.MultivaluesField, (0, _extends2["default"])({
|
179
251
|
defaultSelectedKeys: ['Aardvark', 'Snake'],
|
180
252
|
items: items
|
181
|
-
}, args
|
253
|
+
}, args, {
|
254
|
+
onOpenChange: onOpenChange
|
255
|
+
}), function (item) {
|
182
256
|
return (0, _react2.jsx)(_.Item, {
|
183
257
|
key: item.key,
|
184
258
|
"data-id": item.name
|
@@ -189,17 +263,32 @@ var Uncontrolled = function Uncontrolled(args) {
|
|
189
263
|
exports.Uncontrolled = Uncontrolled;
|
190
264
|
|
191
265
|
var Controlled = function Controlled(args) {
|
192
|
-
var
|
193
|
-
|
194
|
-
selectedKeys =
|
195
|
-
setSelectedKeys =
|
266
|
+
var _useState9 = (0, _react.useState)(['Aardvark', 'Snake']),
|
267
|
+
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
268
|
+
selectedKeys = _useState10[0],
|
269
|
+
setSelectedKeys = _useState10[1];
|
270
|
+
|
271
|
+
var _useState11 = (0, _react.useState)(false),
|
272
|
+
_useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
|
273
|
+
isOpen = _useState12[0],
|
274
|
+
setIsOpen = _useState12[1];
|
275
|
+
|
276
|
+
var direction = args.direction;
|
277
|
+
|
278
|
+
var onOpenChange = function onOpenChange() {
|
279
|
+
setIsOpen(true);
|
280
|
+
};
|
196
281
|
|
197
|
-
return (0, _react2.jsx)(_.OverlayProvider
|
282
|
+
return (0, _react2.jsx)(_.OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
283
|
+
, {
|
284
|
+
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
285
|
+
}, (0, _react2.jsx)(_.MultivaluesField, (0, _extends2["default"])({
|
198
286
|
label: "Field Label"
|
199
287
|
}, args, {
|
200
288
|
items: items,
|
201
289
|
onSelectionChange: setSelectedKeys,
|
202
|
-
selectedKeys: selectedKeys
|
290
|
+
selectedKeys: selectedKeys,
|
291
|
+
onOpenChange: onOpenChange
|
203
292
|
}), function (item) {
|
204
293
|
return (0, _react2.jsx)(_.Item, {
|
205
294
|
key: item.key,
|
@@ -211,6 +300,17 @@ var Controlled = function Controlled(args) {
|
|
211
300
|
exports.Controlled = Controlled;
|
212
301
|
|
213
302
|
var WithCustomSize = function WithCustomSize(args) {
|
303
|
+
var _useState13 = (0, _react.useState)(false),
|
304
|
+
_useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
|
305
|
+
isOpen = _useState14[0],
|
306
|
+
setIsOpen = _useState14[1];
|
307
|
+
|
308
|
+
var direction = args.direction;
|
309
|
+
|
310
|
+
var onOpenChange = function onOpenChange() {
|
311
|
+
setIsOpen(true);
|
312
|
+
};
|
313
|
+
|
214
314
|
return (0, _react2.jsx)(_.Box, {
|
215
315
|
sx: {
|
216
316
|
width: '100%',
|
@@ -219,9 +319,14 @@ var WithCustomSize = function WithCustomSize(args) {
|
|
219
319
|
}
|
220
320
|
}, (0, _react2.jsx)(_.Box, {
|
221
321
|
width: 300
|
222
|
-
}, (0, _react2.jsx)(_.OverlayProvider
|
322
|
+
}, (0, _react2.jsx)(_.OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
323
|
+
, {
|
324
|
+
style: setOverlayStyle(direction, isOpen, '25%', '25%', '75%')
|
325
|
+
}, (0, _react2.jsx)(_.MultivaluesField, (0, _extends2["default"])({
|
223
326
|
items: items
|
224
|
-
}, args
|
327
|
+
}, args, {
|
328
|
+
onOpenChange: onOpenChange
|
329
|
+
}), function (item) {
|
225
330
|
return (0, _react2.jsx)(_.Item, {
|
226
331
|
key: item.key,
|
227
332
|
"data-id": item.name
|
@@ -232,10 +337,26 @@ var WithCustomSize = function WithCustomSize(args) {
|
|
232
337
|
exports.WithCustomSize = WithCustomSize;
|
233
338
|
|
234
339
|
var WithReadOnlyValues = function WithReadOnlyValues(args) {
|
235
|
-
|
340
|
+
var _useState15 = (0, _react.useState)(false),
|
341
|
+
_useState16 = (0, _slicedToArray2["default"])(_useState15, 2),
|
342
|
+
isOpen = _useState16[0],
|
343
|
+
setIsOpen = _useState16[1];
|
344
|
+
|
345
|
+
var direction = args.direction;
|
346
|
+
|
347
|
+
var onOpenChange = function onOpenChange() {
|
348
|
+
setIsOpen(true);
|
349
|
+
};
|
350
|
+
|
351
|
+
return (0, _react2.jsx)(_.OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
352
|
+
, {
|
353
|
+
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
354
|
+
}, (0, _react2.jsx)(_.MultivaluesField, (0, _extends2["default"])({
|
236
355
|
readOnlyKeys: ['Aardvark', 'Snake'],
|
237
356
|
items: items
|
238
|
-
}, args
|
357
|
+
}, args, {
|
358
|
+
onOpenChange: onOpenChange
|
359
|
+
}), function (item) {
|
239
360
|
return (0, _react2.jsx)(_.Item, {
|
240
361
|
key: item.key,
|
241
362
|
"data-id": item.name
|
@@ -189,7 +189,7 @@ var InnerPanel = function InnerPanel(_ref2) {
|
|
189
189
|
onPress: state.open
|
190
190
|
}, "Open Panel"), outer), messagesOpen && (0, _react2.jsx)(_index.Messages, {
|
191
191
|
sx: {
|
192
|
-
zIndex:
|
192
|
+
zIndex: 11
|
193
193
|
}
|
194
194
|
}, (0, _react2.jsx)(_collections.Item, {
|
195
195
|
key: "message2",
|
@@ -64,15 +64,9 @@ var CollectionRockerButton = /*#__PURE__*/(0, _react.forwardRef)(function (props
|
|
64
64
|
itemProps = item.props;
|
65
65
|
var state = (0, _react.useContext)(_RockerButtonGroup.RockerContext);
|
66
66
|
var isDisabled = state.disabledKeys.has(key);
|
67
|
-
|
68
|
-
var _useFocusRing = (0, _focus.useFocusRing)(),
|
69
|
-
isFocusVisible = _useFocusRing.isFocusVisible,
|
70
|
-
focusProps = _useFocusRing.focusProps;
|
71
|
-
|
72
67
|
var isSelected = state.selectedKey === key;
|
73
68
|
|
74
69
|
var _useStatusClasses = (0, _hooks.useStatusClasses)(className, {
|
75
|
-
isFocused: isFocusVisible,
|
76
70
|
isSelected: isSelected,
|
77
71
|
isDisabled: isDisabled
|
78
72
|
}),
|
@@ -93,17 +87,19 @@ var CollectionRockerButton = /*#__PURE__*/(0, _react.forwardRef)(function (props
|
|
93
87
|
}, state, rockerButtonRef),
|
94
88
|
rockerButtonProps = _useRockerButton.rockerButtonProps;
|
95
89
|
|
96
|
-
return (0, _react2.jsx)(
|
90
|
+
return (0, _react2.jsx)(_focus.FocusRing, {
|
91
|
+
focusRingClass: "is-focused"
|
92
|
+
}, (0, _react2.jsx)(_index.Box, (0, _extends2["default"])({
|
97
93
|
as: "button",
|
98
94
|
className: classNames,
|
99
95
|
variant: "buttons.rocker"
|
100
96
|
}, rockerButtonProps, {
|
101
97
|
ref: rockerButtonRef
|
102
|
-
},
|
98
|
+
}, itemProps, {
|
103
99
|
sx: {
|
104
100
|
'&.is-selected': _objectSpread({}, itemProps.selectedStyles)
|
105
101
|
}
|
106
|
-
}), rendered);
|
102
|
+
}), rendered));
|
107
103
|
});
|
108
104
|
exports.CollectionRockerButton = CollectionRockerButton;
|
109
105
|
CollectionRockerButton.displayName = 'CollectionRockerButton';
|
@@ -134,6 +134,23 @@ var chip = {
|
|
134
134
|
};
|
135
135
|
exports.chip = chip;
|
136
136
|
|
137
|
+
var countDefault = _objectSpread(_objectSpread({}, chip), {}, {
|
138
|
+
width: 'fit-content',
|
139
|
+
minWidth: '17px',
|
140
|
+
height: '17px'
|
141
|
+
});
|
142
|
+
|
143
|
+
var chipCount = _objectSpread(_objectSpread({}, countDefault), {}, {
|
144
|
+
backgroundColor: '#640099 !important'
|
145
|
+
});
|
146
|
+
|
147
|
+
var countNeutral = _objectSpread(_objectSpread({}, chipCount), {}, {
|
148
|
+
backgroundColor: '#E4E6E9 !important',
|
149
|
+
'& span': {
|
150
|
+
color: 'neutral.20'
|
151
|
+
}
|
152
|
+
});
|
153
|
+
|
137
154
|
var multivaluesChip = _objectSpread(_objectSpread({}, chip), {}, {
|
138
155
|
alignSelf: 'center',
|
139
156
|
cursor: 'default',
|
@@ -336,6 +353,8 @@ var _default = {
|
|
336
353
|
base: base,
|
337
354
|
card: card,
|
338
355
|
chip: chip,
|
356
|
+
chipCount: chipCount,
|
357
|
+
countNeutral: countNeutral,
|
339
358
|
selectedItemChip: selectedItemChip,
|
340
359
|
readOnlyChip: readOnlyChip,
|
341
360
|
copy: copy,
|
@@ -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
|
});
|
@@ -713,6 +729,7 @@ var _default = {
|
|
713
729
|
iconButton: iconButton,
|
714
730
|
imageUpload: imageUpload,
|
715
731
|
inline: inline,
|
732
|
+
inlinePrimary: inlinePrimary,
|
716
733
|
inverted: inverted,
|
717
734
|
link: link,
|
718
735
|
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
|
},
|