@pingux/astro 1.25.1-alpha.1 → 1.25.1-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/AccordionGridGroup/AccordionGridGroup.test.js +19 -0
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemBody.js +0 -1
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +28 -6
- package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +46 -2
- package/lib/cjs/components/MultivaluesField/MultivaluesField.test.js +14 -0
- package/lib/cjs/components/PopoverContainer/PopoverContainer.js +1 -1
- package/lib/cjs/recipes/ListAndPanel.stories.js +36 -13
- package/lib/cjs/recipes/OneWayToBidirectionalArrow.stories.js +125 -30
- package/lib/cjs/styles/theme.js +3 -1
- package/lib/cjs/styles/variants/bidirectionalIconButton.js +54 -0
- package/lib/cjs/styles/variants/index.js +10 -0
- package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +11 -0
- package/lib/components/AccordionGridItem/AccordionGridItemBody.js +0 -1
- package/lib/components/MultivaluesField/MultivaluesField.js +26 -7
- package/lib/components/MultivaluesField/MultivaluesField.stories.js +40 -0
- package/lib/components/MultivaluesField/MultivaluesField.test.js +11 -0
- package/lib/components/PopoverContainer/PopoverContainer.js +1 -1
- package/lib/recipes/ListAndPanel.stories.js +36 -14
- package/lib/recipes/OneWayToBidirectionalArrow.stories.js +124 -30
- package/lib/styles/theme.js +4 -2
- package/lib/styles/variants/bidirectionalIconButton.js +34 -0
- package/lib/styles/variants/index.js +1 -0
- package/package.json +1 -1
@@ -17,10 +17,18 @@ _Object$defineProperty(exports, "__esModule", {
|
|
17
17
|
var _exportNames = {
|
18
18
|
variants: true,
|
19
19
|
buttons: true,
|
20
|
+
bidirectionalIconButton: true,
|
20
21
|
images: true,
|
21
22
|
links: true
|
22
23
|
};
|
23
24
|
|
25
|
+
_Object$defineProperty(exports, "bidirectionalIconButton", {
|
26
|
+
enumerable: true,
|
27
|
+
get: function get() {
|
28
|
+
return _bidirectionalIconButton["default"];
|
29
|
+
}
|
30
|
+
});
|
31
|
+
|
24
32
|
_Object$defineProperty(exports, "buttons", {
|
25
33
|
enumerable: true,
|
26
34
|
get: function get() {
|
@@ -53,6 +61,8 @@ var _variants = _interopRequireDefault(require("./variants"));
|
|
53
61
|
|
54
62
|
var _buttons = _interopRequireDefault(require("./buttons"));
|
55
63
|
|
64
|
+
var _bidirectionalIconButton = _interopRequireDefault(require("./bidirectionalIconButton"));
|
65
|
+
|
56
66
|
var _images = _interopRequireDefault(require("./images"));
|
57
67
|
|
58
68
|
var _links = _interopRequireDefault(require("./links"));
|
@@ -212,4 +212,15 @@ test('adds focus to inputs', function () {
|
|
212
212
|
userEvent.click(secondInput);
|
213
213
|
expect(firstInput).not.toHaveFocus();
|
214
214
|
expect(secondInput).toHaveFocus();
|
215
|
+
});
|
216
|
+
test('adds focus to input on a single click after onBlur', function () {
|
217
|
+
getComponentWithTextFields();
|
218
|
+
var firstInput = screen.getAllByRole('gridcell')[0];
|
219
|
+
var secondInput = screen.getAllByRole('gridcell')[1];
|
220
|
+
expect(secondInput).not.toHaveFocus();
|
221
|
+
userEvent.click(firstInput);
|
222
|
+
userEvent.click(secondInput);
|
223
|
+
secondInput.blur();
|
224
|
+
userEvent.click(secondInput);
|
225
|
+
expect(secondInput).toHaveFocus();
|
215
226
|
});
|
@@ -55,7 +55,6 @@ var AccordionGridItemBody = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
55
55
|
var ariaLabel = props['aria-label'];
|
56
56
|
delete mergedProps.onMouseDown;
|
57
57
|
delete mergedProps.onPointerDown;
|
58
|
-
delete mergedProps.onClick;
|
59
58
|
return ___EmotionJSX(Box, _extends({
|
60
59
|
as: "div",
|
61
60
|
variant: "accordion.accordionGridBody",
|
@@ -5,6 +5,7 @@ import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
|
|
5
5
|
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
6
6
|
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
7
7
|
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
8
|
+
import _Object$values from "@babel/runtime-corejs3/core-js-stable/object/values";
|
8
9
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
9
10
|
import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
|
10
11
|
import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/map";
|
@@ -27,10 +28,12 @@ import { FocusScope } from '@react-aria/focus';
|
|
27
28
|
import { useListState } from '@react-stately/list';
|
28
29
|
import { DismissButton, useOverlayPosition } from '@react-aria/overlays';
|
29
30
|
import { useLayoutEffect, useResizeObserver } from '@react-aria/utils';
|
30
|
-
import { Chip, Icon, IconButton, PopoverContainer, ScrollBox, TextField } from '../..';
|
31
|
+
import { Box, Chip, Icon, IconButton, PopoverContainer, ScrollBox, TextField } from '../..';
|
31
32
|
import ListBox from '../ListBox';
|
32
33
|
import { isIterableProp } from '../../utils/devUtils/props/isIterable';
|
33
34
|
import { usePropWarning } from '../../hooks';
|
35
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
36
|
+
import FieldHelperText from '../FieldHelperText';
|
34
37
|
/**
|
35
38
|
* Complex control that lets you choose several tags from the dropdown list.
|
36
39
|
* Or to add your own values in non-restrictive mode.
|
@@ -49,8 +52,10 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
49
52
|
direction = props.direction,
|
50
53
|
_props$disabledKeys = props.disabledKeys,
|
51
54
|
disabledKeys = _props$disabledKeys === void 0 ? [] : _props$disabledKeys,
|
55
|
+
containerProps = props.containerProps,
|
52
56
|
hasAutoFocus = props.hasAutoFocus,
|
53
57
|
hasNoStatusIndicator = props.hasNoStatusIndicator,
|
58
|
+
helperText = props.helperText,
|
54
59
|
customInputProps = props.inputProps,
|
55
60
|
isDisabled = props.isDisabled,
|
56
61
|
isNotFlippable = props.isNotFlippable,
|
@@ -70,7 +75,8 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
70
75
|
_props$readOnlyKeys = props.readOnlyKeys,
|
71
76
|
readOnlyKeys = _props$readOnlyKeys === void 0 ? [] : _props$readOnlyKeys,
|
72
77
|
selectedKeys = props.selectedKeys,
|
73
|
-
scrollBoxProps = props.scrollBoxProps
|
78
|
+
scrollBoxProps = props.scrollBoxProps,
|
79
|
+
status = props.status;
|
74
80
|
var hasCustomValue = mode === 'non-restrictive';
|
75
81
|
usePropWarning(props, 'disabled', 'isDisabled');
|
76
82
|
|
@@ -350,10 +356,11 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
350
356
|
wrapperProps: {
|
351
357
|
ref: inputRef,
|
352
358
|
variant: 'forms.input.multivaluesWrapper'
|
353
|
-
}
|
359
|
+
},
|
360
|
+
status: status
|
354
361
|
});
|
355
362
|
|
356
|
-
return ___EmotionJSX(
|
363
|
+
return ___EmotionJSX(Box, containerProps, ___EmotionJSX(TextField, _extends({
|
357
364
|
onBlur: function onBlur(e) {
|
358
365
|
setIsOpen(false);
|
359
366
|
if (_onBlur) _onBlur(e.nativeEvent);
|
@@ -375,7 +382,9 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
375
382
|
beforeInput: ___EmotionJSX(React.Fragment, null, readOnlyItems, " ", selectedItems)
|
376
383
|
},
|
377
384
|
value: filterString
|
378
|
-
}, inputProps)), ___EmotionJSX(
|
385
|
+
}, inputProps)), helperText && ___EmotionJSX(FieldHelperText, {
|
386
|
+
status: status
|
387
|
+
}, helperText), ___EmotionJSX(PopoverContainer, {
|
379
388
|
ref: popoverRef,
|
380
389
|
hasNoArrow: true,
|
381
390
|
isNonModal: true,
|
@@ -385,6 +394,9 @@ var MultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
385
394
|
}, listbox));
|
386
395
|
});
|
387
396
|
MultivaluesField.propTypes = {
|
397
|
+
/** Props object that is spread directly into the root (top-level) Box component. */
|
398
|
+
containerProps: PropTypes.shape({}),
|
399
|
+
|
388
400
|
/** The initial selected keys in the collection (uncontrolled). */
|
389
401
|
defaultSelectedKeys: isIterableProp,
|
390
402
|
|
@@ -402,6 +414,9 @@ MultivaluesField.propTypes = {
|
|
402
414
|
/** Whether the field has a status indicator. */
|
403
415
|
hasNoStatusIndicator: PropTypes.bool,
|
404
416
|
|
417
|
+
/** Text rendered below the input. */
|
418
|
+
helperText: PropTypes.node,
|
419
|
+
|
405
420
|
/**
|
406
421
|
* Props that get passed as-is to the underlying TextField element
|
407
422
|
*/
|
@@ -500,13 +515,17 @@ MultivaluesField.propTypes = {
|
|
500
515
|
/** @ignore */
|
501
516
|
scrollBoxProps: PropTypes.shape({
|
502
517
|
maxHeight: PropTypes.oneOfType([PropTypes.string, PropTypes.object, PropTypes.number])
|
503
|
-
})
|
518
|
+
}),
|
519
|
+
|
520
|
+
/** Determines the input status indicator and helper text styling. */
|
521
|
+
status: PropTypes.oneOf(_Object$values(statuses))
|
504
522
|
};
|
505
523
|
MultivaluesField.defaultProps = {
|
506
524
|
direction: 'bottom',
|
507
525
|
mode: 'restrictive',
|
508
526
|
scrollBoxProps: {
|
509
527
|
maxHeight: 300
|
510
|
-
}
|
528
|
+
},
|
529
|
+
status: statuses.DEFAULT
|
511
530
|
};
|
512
531
|
export default MultivaluesField;
|
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
3
3
|
import React, { useState } from 'react';
|
4
4
|
import { Box, Item, MultivaluesField, OverlayProvider } from '../..';
|
5
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
5
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
6
7
|
export default {
|
7
8
|
title: 'Form/MultivaluesField',
|
@@ -40,6 +41,18 @@ export default {
|
|
40
41
|
control: {
|
41
42
|
type: 'none'
|
42
43
|
}
|
44
|
+
},
|
45
|
+
status: {
|
46
|
+
control: {
|
47
|
+
type: 'select',
|
48
|
+
options: statuses
|
49
|
+
},
|
50
|
+
defaultValue: statuses.DEFAULT
|
51
|
+
},
|
52
|
+
helperText: {
|
53
|
+
control: {
|
54
|
+
type: 'text'
|
55
|
+
}
|
43
56
|
}
|
44
57
|
},
|
45
58
|
parameters: {
|
@@ -306,4 +319,31 @@ export var WithReadOnlyValues = function WithReadOnlyValues(args) {
|
|
306
319
|
"data-id": item.name
|
307
320
|
}, item.name);
|
308
321
|
}));
|
322
|
+
};
|
323
|
+
export var Error = function Error(args) {
|
324
|
+
var _useState17 = useState(false),
|
325
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
326
|
+
isOpen = _useState18[0],
|
327
|
+
setIsOpen = _useState18[1];
|
328
|
+
|
329
|
+
var direction = args.direction;
|
330
|
+
|
331
|
+
var onOpenChange = function onOpenChange() {
|
332
|
+
setIsOpen(true);
|
333
|
+
};
|
334
|
+
|
335
|
+
return ___EmotionJSX(OverlayProvider // note: spacing for demo purpose only so that the select list renders in the correct place
|
336
|
+
, {
|
337
|
+
style: setOverlayStyle(direction, isOpen, '50%', '50%', '20%')
|
338
|
+
}, ___EmotionJSX(MultivaluesField, _extends({}, args, {
|
339
|
+
items: items,
|
340
|
+
helperText: "Here is some helpful text...",
|
341
|
+
status: "error",
|
342
|
+
onOpenChange: onOpenChange
|
343
|
+
}), function (item) {
|
344
|
+
return ___EmotionJSX(Item, {
|
345
|
+
key: item.key,
|
346
|
+
"data-id": item.name
|
347
|
+
}, item.name);
|
348
|
+
}));
|
309
349
|
};
|
@@ -6,6 +6,7 @@ import userEvent from '@testing-library/user-event';
|
|
6
6
|
import { axe } from 'jest-axe';
|
7
7
|
import { Item, MultivaluesField, OverlayProvider } from '../../index';
|
8
8
|
import { render, screen, within } from '../../utils/testUtils/testWrapper';
|
9
|
+
import statuses from '../../utils/devUtils/constants/statuses';
|
9
10
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
10
11
|
var items = [{
|
11
12
|
id: 1,
|
@@ -357,4 +358,14 @@ test('read only keys', function () {
|
|
357
358
|
expect(secondChip).toBeInTheDocument();
|
358
359
|
var deleteButton2 = firstChip.nextSibling;
|
359
360
|
expect(deleteButton2).toBeNull();
|
361
|
+
});
|
362
|
+
test(' multivalue field with helper text', function () {
|
363
|
+
var helperText = 'helper text';
|
364
|
+
getComponent({
|
365
|
+
helperText: helperText,
|
366
|
+
status: statuses.ERROR
|
367
|
+
});
|
368
|
+
var helper = screen.getByText(helperText);
|
369
|
+
expect(helper).toBeInTheDocument();
|
370
|
+
expect(helper).toHaveClass("is-".concat(statuses.ERROR));
|
360
371
|
});
|
@@ -24,7 +24,7 @@ import { mergeProps } from '@react-aria/utils';
|
|
24
24
|
import { useStatusClasses } from '../../hooks';
|
25
25
|
import Box from '../Box';
|
26
26
|
/**
|
27
|
-
* PopoverContainer component used for popover on SelectField, ComboBox
|
27
|
+
* PopoverContainer component used for popover on SelectField, ComboBox & PopoverMenu.
|
28
28
|
*/
|
29
29
|
|
30
30
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
@@ -3,10 +3,11 @@ import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
3
3
|
import React, { useRef, useState } from 'react';
|
4
4
|
import { FocusScope } from '@react-aria/focus';
|
5
5
|
import { Item } from '@react-stately/collections';
|
6
|
+
import AccountIcon from 'mdi-react/AccountIcon';
|
6
7
|
import CloseIcon from 'mdi-react/CloseIcon';
|
7
8
|
import MoreVertIcon from 'mdi-react/MoreVertIcon';
|
8
9
|
import PencilIcon from 'mdi-react/PencilIcon';
|
9
|
-
import { Avatar, Box, IconButton, ListView, Menu, OverlayPanel, PopoverMenu, SearchField, Separator, SwitchField, Tab, Tabs, Text } from '../index';
|
10
|
+
import { Avatar, Box, Icon, IconButton, ListView, Menu, OverlayPanel, PopoverMenu, SearchField, Separator, SwitchField, Tab, Tabs, Text } from '../index';
|
10
11
|
import { useOverlayPanelState } from '../hooks';
|
11
12
|
import { pingImg } from '../utils/devUtils/constants/images';
|
12
13
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
@@ -17,7 +18,8 @@ var items = [{
|
|
17
18
|
email: 'dburkitt5@columbia.edu',
|
18
19
|
firstName: 'Nicola',
|
19
20
|
lastName: 'Burkitt',
|
20
|
-
|
21
|
+
hasIcon: true,
|
22
|
+
avatar: AccountIcon
|
21
23
|
}, {
|
22
24
|
email: 'idixie2@elegantthemes.com',
|
23
25
|
firstName: 'Cacilia',
|
@@ -32,52 +34,62 @@ var items = [{
|
|
32
34
|
email: 'jgolde8@jimdo.com',
|
33
35
|
firstName: 'Celisse',
|
34
36
|
lastName: 'Golde',
|
35
|
-
|
37
|
+
hasIcon: true,
|
38
|
+
avatar: AccountIcon
|
36
39
|
}, {
|
37
40
|
email: 'shearst9@answers.com',
|
38
41
|
firstName: 'Jeth',
|
39
42
|
lastName: 'Hearst',
|
40
|
-
|
43
|
+
hasIcon: true,
|
44
|
+
avatar: AccountIcon
|
41
45
|
}, {
|
42
46
|
email: 'ajinaa@mapquest.com',
|
43
47
|
firstName: 'Kaycee',
|
44
48
|
lastName: 'Jina',
|
45
|
-
|
49
|
+
hasIcon: true,
|
50
|
+
avatar: AccountIcon
|
46
51
|
}, {
|
47
52
|
email: 'vmalster4@biblegateway.com',
|
48
53
|
firstName: 'Lorry',
|
49
54
|
lastName: 'Malster',
|
50
|
-
|
55
|
+
hasIcon: true,
|
56
|
+
avatar: AccountIcon
|
51
57
|
}, {
|
52
58
|
email: 'yphipp6@yellowpages.com',
|
53
59
|
firstName: 'Stanley',
|
54
60
|
lastName: 'Phipp',
|
55
|
-
|
61
|
+
hasIcon: true,
|
62
|
+
avatar: AccountIcon
|
56
63
|
}, {
|
57
64
|
email: 'mskilbeck3@bbc.co.uk',
|
58
65
|
firstName: 'Gradey',
|
59
66
|
lastName: 'Skilbeck',
|
60
|
-
|
67
|
+
hasIcon: true,
|
68
|
+
avatar: AccountIcon
|
61
69
|
}, {
|
62
70
|
email: 'dstebbing1@msu.edu',
|
63
71
|
firstName: 'Marnia',
|
64
72
|
lastName: 'Stebbing',
|
65
|
-
|
73
|
+
hasIcon: true,
|
74
|
+
avatar: AccountIcon
|
66
75
|
}, {
|
67
76
|
email: 'lsterley7@lulu.com',
|
68
77
|
firstName: 'Joshua',
|
69
78
|
lastName: 'Sterley',
|
70
|
-
|
79
|
+
hasIcon: true,
|
80
|
+
avatar: AccountIcon
|
71
81
|
}, {
|
72
82
|
email: 'luttleyb@hugedomains.com',
|
73
83
|
firstName: 'Jarrod',
|
74
84
|
lastName: 'Uttley',
|
75
|
-
|
85
|
+
hasIcon: true,
|
86
|
+
avatar: AccountIcon
|
76
87
|
}, {
|
77
88
|
email: 'lidelc@yelp.com',
|
78
89
|
firstName: 'Andromache',
|
79
90
|
lastName: 'Idel',
|
80
|
-
|
91
|
+
hasIcon: true,
|
92
|
+
avatar: AccountIcon,
|
81
93
|
hasSeparator: false
|
82
94
|
}];
|
83
95
|
|
@@ -91,7 +103,13 @@ var ListElement = function ListElement(_ref) {
|
|
91
103
|
isRow: true,
|
92
104
|
mr: "auto",
|
93
105
|
alignItems: "center"
|
94
|
-
}, ___EmotionJSX(
|
106
|
+
}, item.hasIcon ? ___EmotionJSX(Icon, {
|
107
|
+
icon: item.avatar,
|
108
|
+
alignSelf: "center",
|
109
|
+
size: 24,
|
110
|
+
mr: "sm",
|
111
|
+
color: "accent.40"
|
112
|
+
}) : ___EmotionJSX(Avatar, {
|
95
113
|
mr: "md",
|
96
114
|
sx: {
|
97
115
|
width: '25px',
|
@@ -170,8 +188,11 @@ export var Default = function Default() {
|
|
170
188
|
return ___EmotionJSX(Box, {
|
171
189
|
px: "lg",
|
172
190
|
py: "lg",
|
173
|
-
bg: "accent.99"
|
191
|
+
bg: "accent.99",
|
192
|
+
height: "900px",
|
193
|
+
overflowY: "scroll"
|
174
194
|
}, ___EmotionJSX(SearchField, {
|
195
|
+
position: "fixed",
|
175
196
|
mb: "sm",
|
176
197
|
width: "400px",
|
177
198
|
placeholder: "Search",
|
@@ -227,6 +248,7 @@ export var Default = function Default() {
|
|
227
248
|
}, ___EmotionJSX(Tab, {
|
228
249
|
title: "Profile"
|
229
250
|
}, selectedItemId >= 0 && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(IconButton, {
|
251
|
+
variant: "inverted",
|
230
252
|
sx: {
|
231
253
|
position: 'absolute',
|
232
254
|
top: 0,
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
1
2
|
import React from 'react';
|
2
3
|
import DragVerticalIcon from 'mdi-react/DragVerticalIcon';
|
3
4
|
import DeleteIcon from 'mdi-react/DeleteIcon';
|
@@ -19,42 +20,52 @@ var items = [{
|
|
19
20
|
id: '3'
|
20
21
|
}];
|
21
22
|
export var Default = function Default() {
|
22
|
-
var CustomOnSvg = function CustomOnSvg() {
|
23
|
-
return ___EmotionJSX("svg", {
|
24
|
-
width: "
|
25
|
-
height: "
|
26
|
-
viewBox: "0 0
|
23
|
+
var CustomOnSvg = function CustomOnSvg(props) {
|
24
|
+
return ___EmotionJSX("svg", _extends({
|
25
|
+
width: "16",
|
26
|
+
height: "16",
|
27
|
+
viewBox: "0 0 16 16",
|
27
28
|
fill: "none",
|
28
29
|
xmlns: "http://www.w3.org/2000/svg"
|
29
|
-
}, ___EmotionJSX("path", {
|
30
|
-
d: "
|
31
|
-
fill: "
|
32
|
-
}), ___EmotionJSX("path", {
|
33
|
-
d: "M9.83325 10.6251V6.37511H15.4999V2.94678L21.0533 8.50011L15.4999 14.0534V10.6251H9.83325Z",
|
34
|
-
fill: "#4462ED"
|
30
|
+
}, props), ___EmotionJSX("path", {
|
31
|
+
d: "M5.33325 6.66666V8.66666H9.33325V12H5.33325V14L1.33325 10.3333L5.33325 6.66666Z",
|
32
|
+
fill: "currentColor"
|
35
33
|
}), ___EmotionJSX("path", {
|
36
|
-
d: "
|
37
|
-
fill: "
|
34
|
+
d: "M14.6666 5.66667L10.6666 2V4H6.66658V7.33333H10.6666V9.33333L14.6666 5.66667Z",
|
35
|
+
fill: "currentColor"
|
38
36
|
}));
|
39
37
|
};
|
40
38
|
|
41
|
-
var CustomOffSvg = function CustomOffSvg() {
|
42
|
-
return ___EmotionJSX("svg", {
|
43
|
-
width: "
|
44
|
-
height: "
|
45
|
-
viewBox: "0 0
|
39
|
+
var CustomOffSvg = function CustomOffSvg(props) {
|
40
|
+
return ___EmotionJSX("svg", _extends({
|
41
|
+
width: "16",
|
42
|
+
height: "16",
|
43
|
+
viewBox: "0 0 16 16",
|
46
44
|
fill: "none",
|
47
45
|
xmlns: "http://www.w3.org/2000/svg"
|
48
|
-
}, ___EmotionJSX("path", {
|
49
|
-
d: "
|
46
|
+
}, props), ___EmotionJSX("path", {
|
47
|
+
d: "M5.33325 6.66667V8.66667H9.33325V12H5.33325V14L1.33325 10.3333L5.33325 6.66667Z",
|
50
48
|
fill: "#CACED3"
|
51
49
|
}), ___EmotionJSX("path", {
|
52
|
-
d: "
|
53
|
-
fill: "
|
50
|
+
d: "M14.6666 5.66667L10.6666 2V4H6.66658V7.33333H10.6666V9.33333L14.6666 5.66667Z",
|
51
|
+
fill: "currentColor"
|
52
|
+
}));
|
53
|
+
};
|
54
|
+
|
55
|
+
var CustomRightSvg = function CustomRightSvg(props) {
|
56
|
+
return ___EmotionJSX("svg", _extends({
|
57
|
+
width: "8",
|
58
|
+
height: "8",
|
59
|
+
viewBox: "0 0 8 8",
|
60
|
+
fill: "none",
|
61
|
+
xmlns: "http://www.w3.org/2000/svg"
|
62
|
+
}, props), ___EmotionJSX("path", {
|
63
|
+
d: "M8 4L4 0V2.18182H0V5.81818H4V8L8 4Z",
|
64
|
+
fill: "currentColor"
|
54
65
|
}));
|
55
66
|
};
|
56
67
|
|
57
|
-
return ___EmotionJSX(Box, {
|
68
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(Box, {
|
58
69
|
sx: {
|
59
70
|
alignItems: 'center'
|
60
71
|
},
|
@@ -83,8 +94,7 @@ export var Default = function Default() {
|
|
83
94
|
}, item.name);
|
84
95
|
}), ___EmotionJSX(Box, {
|
85
96
|
sx: {
|
86
|
-
|
87
|
-
mr: '5px',
|
97
|
+
mx: 'sm',
|
88
98
|
flexShrink: 0
|
89
99
|
}
|
90
100
|
}, ___EmotionJSX(IconButtonToggle, {
|
@@ -92,10 +102,91 @@ export var Default = function Default() {
|
|
92
102
|
defaultIcon: CustomOffSvg,
|
93
103
|
title: "Bidirectional/ Outbound toggle",
|
94
104
|
iconProps: {
|
95
|
-
size:
|
105
|
+
size: 16
|
106
|
+
},
|
107
|
+
buttonProps: {
|
108
|
+
variant: 'bidirectionalIconButton'
|
109
|
+
}
|
110
|
+
})), ___EmotionJSX(ComboBoxField, {
|
111
|
+
items: items,
|
112
|
+
defaultSelectedKey: "First Name",
|
113
|
+
containerProps: {
|
114
|
+
width: '275px'
|
115
|
+
},
|
116
|
+
labelProps: {
|
117
|
+
mb: 0
|
118
|
+
},
|
119
|
+
controlProps: {
|
120
|
+
'aria-label': 'Row one Pingone value'
|
121
|
+
}
|
122
|
+
}, function (item) {
|
123
|
+
return ___EmotionJSX(Item, {
|
124
|
+
key: item.name,
|
125
|
+
"data-id": item.name
|
126
|
+
}, item.name);
|
127
|
+
}), ___EmotionJSX(Box, {
|
128
|
+
isRow: true,
|
129
|
+
alignItems: "center",
|
130
|
+
sx: {
|
131
|
+
marginLeft: '12px',
|
132
|
+
marginRight: '12px'
|
133
|
+
}
|
134
|
+
}, ___EmotionJSX(IconButton, {
|
135
|
+
"aria-label": "Edit"
|
136
|
+
}, ___EmotionJSX(Icon, {
|
137
|
+
icon: CogsIcon,
|
138
|
+
color: "neutral.30",
|
139
|
+
size: 20,
|
140
|
+
title: "edit icon"
|
141
|
+
})), ___EmotionJSX(IconButton, {
|
142
|
+
ml: "5px",
|
143
|
+
"aria-label": "Delete"
|
144
|
+
}, ___EmotionJSX(Icon, {
|
145
|
+
icon: DeleteIcon,
|
146
|
+
color: "neutral.30",
|
147
|
+
size: 20,
|
148
|
+
title: "delete icon"
|
149
|
+
})))), ___EmotionJSX(Box, {
|
150
|
+
sx: {
|
151
|
+
alignItems: 'center'
|
152
|
+
},
|
153
|
+
isRow: true
|
154
|
+
}, ___EmotionJSX(Icon, {
|
155
|
+
icon: DragVerticalIcon,
|
156
|
+
size: 25,
|
157
|
+
color: "neutral.50"
|
158
|
+
}), ___EmotionJSX(ComboBoxField, {
|
159
|
+
items: items,
|
160
|
+
defaultSelectedKey: "Last Name",
|
161
|
+
containerProps: {
|
162
|
+
width: '275px'
|
163
|
+
},
|
164
|
+
labelProps: {
|
165
|
+
mb: 0
|
166
|
+
},
|
167
|
+
"aria-label": "Row one value",
|
168
|
+
controlProps: {
|
169
|
+
'aria-label': 'test'
|
170
|
+
}
|
171
|
+
}, function (item) {
|
172
|
+
return ___EmotionJSX(Item, {
|
173
|
+
key: item.name,
|
174
|
+
"data-id": item.name
|
175
|
+
}, item.name);
|
176
|
+
}), ___EmotionJSX(Box, {
|
177
|
+
sx: {
|
178
|
+
mx: 'sm',
|
179
|
+
flexShrink: 0
|
180
|
+
}
|
181
|
+
}, ___EmotionJSX(IconButtonToggle, {
|
182
|
+
toggledIcon: CustomRightSvg,
|
183
|
+
defaultIcon: CustomRightSvg,
|
184
|
+
title: "This attribute does not support write-back.",
|
185
|
+
iconProps: {
|
186
|
+
size: 8
|
96
187
|
},
|
97
188
|
buttonProps: {
|
98
|
-
variant: '
|
189
|
+
variant: 'bidirectionalIconButton'
|
99
190
|
}
|
100
191
|
})), ___EmotionJSX(ComboBoxField, {
|
101
192
|
items: items,
|
@@ -121,17 +212,20 @@ export var Default = function Default() {
|
|
121
212
|
marginLeft: '12px',
|
122
213
|
marginRight: '12px'
|
123
214
|
}
|
124
|
-
}, ___EmotionJSX(IconButton,
|
215
|
+
}, ___EmotionJSX(IconButton, {
|
216
|
+
"aria-label": "Edit"
|
217
|
+
}, ___EmotionJSX(Icon, {
|
125
218
|
icon: CogsIcon,
|
126
219
|
color: "neutral.30",
|
127
220
|
size: 20,
|
128
221
|
title: "edit icon"
|
129
222
|
})), ___EmotionJSX(IconButton, {
|
130
|
-
ml: "5px"
|
223
|
+
ml: "5px",
|
224
|
+
"aria-label": "Delete"
|
131
225
|
}, ___EmotionJSX(Icon, {
|
132
226
|
icon: DeleteIcon,
|
133
227
|
color: "neutral.30",
|
134
228
|
size: 20,
|
135
229
|
title: "delete icon"
|
136
|
-
}))));
|
230
|
+
})))));
|
137
231
|
};
|
package/lib/styles/theme.js
CHANGED
@@ -17,7 +17,7 @@ import colors, { accent, line, shadow, focus } from './colors';
|
|
17
17
|
import { fontSizes, fontWeights, textColors } from './text';
|
18
18
|
import breakpoints from './breakpoints';
|
19
19
|
import forms from './forms';
|
20
|
-
import { variants, buttons, text, images, links } from './variants';
|
20
|
+
import { variants, buttons, text, images, links, bidirectionalIconButton } from './variants';
|
21
21
|
export default {
|
22
22
|
name: 'Astro',
|
23
23
|
space: spacing,
|
@@ -52,7 +52,9 @@ export default {
|
|
52
52
|
forms: forms,
|
53
53
|
text: text,
|
54
54
|
images: images,
|
55
|
-
buttons: buttons,
|
55
|
+
buttons: _objectSpread(_objectSpread({}, buttons), {}, {
|
56
|
+
bidirectionalIconButton: bidirectionalIconButton
|
57
|
+
}),
|
56
58
|
textColors: textColors,
|
57
59
|
links: links,
|
58
60
|
variants: variants
|
@@ -0,0 +1,34 @@
|
|
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
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
|
+
|
11
|
+
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; }
|
12
|
+
|
13
|
+
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; }
|
14
|
+
|
15
|
+
import { defaultFocus } from './buttons';
|
16
|
+
var bidirectionalIconButton = {
|
17
|
+
border: '1px solid',
|
18
|
+
outline: 'none',
|
19
|
+
height: '24px',
|
20
|
+
width: '24px',
|
21
|
+
color: 'active',
|
22
|
+
borderRadius: '12px',
|
23
|
+
borderColor: 'active',
|
24
|
+
'&.is-hovered': {
|
25
|
+
color: 'accent.40',
|
26
|
+
borderColor: 'accent.40'
|
27
|
+
},
|
28
|
+
'&.is-pressed': {
|
29
|
+
color: 'accent.20',
|
30
|
+
borderColor: 'accent.20'
|
31
|
+
},
|
32
|
+
'&.is-focused': _objectSpread({}, defaultFocus)
|
33
|
+
};
|
34
|
+
export default bidirectionalIconButton;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
export { default as variants } from './variants';
|
2
2
|
export { default as buttons } from './buttons';
|
3
|
+
export { default as bidirectionalIconButton } from './bidirectionalIconButton';
|
3
4
|
export { default as images } from './images';
|
4
5
|
export { default as links } from './links';
|
5
6
|
export * from './text';
|