@pingux/astro 2.150.0 → 2.151.0-alpha.3
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/Avatar/Avatar.js +2 -1
- package/lib/cjs/components/Box/Box.js +5 -3
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.js +4 -2
- package/lib/cjs/components/ListViewItem/ListViewItem.styles.js +1 -11
- package/lib/cjs/components/ListViewItem/controls/ListViewItemEditButton.js +1 -1
- package/lib/cjs/components/ListViewItem/controls/ListViewItemMenu.js +1 -1
- package/lib/cjs/components/MultivaluesField/CondensedMultivaluesField.js +18 -25
- package/lib/cjs/components/PanelHeader/PanelHeader.js +6 -4
- package/lib/cjs/components/PanelHeader/PanelHeader.stories.js +5 -5
- package/lib/cjs/components/PanelHeader/PanelHeader.styles.js +2 -1
- package/lib/cjs/components/PanelHeader/stories/OnyxDarkPanelHeader.chromatic.stories.js +22 -0
- package/lib/cjs/components/PanelHeader/stories/OnyxPanelHeader.chromatic.stories.js +22 -0
- package/lib/cjs/components/PanelHeader/stories/OnyxPanelHeaderComponent.js +89 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +8 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +8 -0
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +1 -1
- package/lib/cjs/styles/themes/next-gen/customProperties/customSizes.js +1 -1
- package/lib/cjs/styles/themes/next-gen/forms.d.ts +1 -1
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +159 -18
- package/lib/cjs/styles/themes/next-gen/next-gen.js +2 -0
- package/lib/cjs/styles/themes/next-gen/stories/OnyxInputPatterns.chromatic.stories.d.ts +11 -0
- package/lib/cjs/styles/themes/next-gen/stories/OnyxInputPatterns.chromatic.stories.js +197 -0
- package/lib/cjs/styles/themes/next-gen/variants/box.d.ts +61 -0
- package/lib/cjs/styles/themes/next-gen/variants/box.js +58 -0
- package/lib/cjs/styles/themes/next-gen/variants/button.d.ts +106 -5
- package/lib/cjs/styles/themes/next-gen/variants/button.js +40 -4
- package/lib/cjs/styles/themes/next-gen/variants/input.js +21 -0
- package/lib/cjs/styles/themes/next-gen/variants/listview.d.ts +0 -8
- package/lib/cjs/styles/themes/next-gen/variants/listview.js +0 -8
- package/lib/cjs/styles/themes/next-gen/variants/panelHeader.d.ts +5 -3
- package/lib/cjs/styles/themes/next-gen/variants/panelHeader.js +5 -3
- package/lib/cjs/styles/themes/next-gen/variants/switch.d.ts +1 -1
- package/lib/cjs/styles/themes/next-gen/variants/switch.js +2 -2
- package/lib/cjs/styles/themes/next-gen/variants/text.d.ts +7 -1
- package/lib/cjs/styles/themes/next-gen/variants/text.js +8 -1
- package/lib/cjs/styles/themes/next-gen/variants/variants.d.ts +43 -11
- package/lib/cjs/styles/themes/next-gen/variants/variants.js +2 -16
- package/lib/cjs/types/iconButtonToggle.d.ts +2 -0
- package/lib/components/Avatar/Avatar.js +2 -1
- package/lib/components/Box/Box.js +5 -3
- package/lib/components/IconButtonToggle/IconButtonToggle.js +4 -2
- package/lib/components/ListViewItem/ListViewItem.styles.js +1 -11
- package/lib/components/ListViewItem/controls/ListViewItemEditButton.js +1 -1
- package/lib/components/ListViewItem/controls/ListViewItemMenu.js +1 -1
- package/lib/components/MultivaluesField/CondensedMultivaluesField.js +18 -25
- package/lib/components/PanelHeader/PanelHeader.js +6 -4
- package/lib/components/PanelHeader/PanelHeader.stories.js +5 -5
- package/lib/components/PanelHeader/PanelHeader.styles.js +2 -1
- package/lib/components/PanelHeader/stories/OnyxDarkPanelHeader.chromatic.stories.js +12 -0
- package/lib/components/PanelHeader/stories/OnyxPanelHeader.chromatic.stories.js +12 -0
- package/lib/components/PanelHeader/stories/OnyxPanelHeaderComponent.js +80 -0
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +8 -0
- package/lib/styles/themes/next-gen/convertedComponentList.js +1 -1
- package/lib/styles/themes/next-gen/customProperties/customSizes.js +1 -1
- package/lib/styles/themes/next-gen/next-gen.js +2 -0
- package/lib/styles/themes/next-gen/stories/OnyxInputPatterns.chromatic.stories.js +178 -0
- package/lib/styles/themes/next-gen/variants/box.js +49 -0
- package/lib/styles/themes/next-gen/variants/button.js +40 -4
- package/lib/styles/themes/next-gen/variants/input.js +21 -0
- package/lib/styles/themes/next-gen/variants/listview.js +0 -8
- package/lib/styles/themes/next-gen/variants/panelHeader.js +5 -3
- package/lib/styles/themes/next-gen/variants/switch.js +2 -2
- package/lib/styles/themes/next-gen/variants/text.js +8 -1
- package/lib/styles/themes/next-gen/variants/variants.js +2 -16
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ import { statusDefaultProp, statusPropTypes } from '../../utils/docUtils/statusP
|
|
|
38
38
|
import ListBox from '../ListBox';
|
|
39
39
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
40
40
|
var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
41
|
-
var _selectionManager$sta, _selectionManager$sta2, _selectionManager$sta3, _listBoxRef$
|
|
41
|
+
var _selectionManager$sta, _selectionManager$sta2, _selectionManager$sta3, _listBoxRef$current;
|
|
42
42
|
var defaultSelectedKeys = props.defaultSelectedKeys,
|
|
43
43
|
direction = props.direction,
|
|
44
44
|
_props$disabledKeys = props.disabledKeys,
|
|
@@ -87,14 +87,10 @@ var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
87
87
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
88
88
|
hasFocusWithin = _useState6[0],
|
|
89
89
|
setFocusWithin = _useState6[1];
|
|
90
|
-
var _useState7 = useState(
|
|
90
|
+
var _useState7 = useState(''),
|
|
91
91
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var _useState9 = useState(''),
|
|
95
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
96
|
-
activeDescendant = _useState10[0],
|
|
97
|
-
setActiveDescendant = _useState10[1];
|
|
92
|
+
activeDescendant = _useState8[0],
|
|
93
|
+
setActiveDescendant = _useState8[1];
|
|
98
94
|
var inputWrapperRef = useRef();
|
|
99
95
|
var inputRef = useRef();
|
|
100
96
|
var buttonRef = useRef();
|
|
@@ -111,9 +107,6 @@ var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
111
107
|
inputValue: filterString
|
|
112
108
|
}),
|
|
113
109
|
isLoading = _useInputLoader.isLoading;
|
|
114
|
-
useEffect(function () {
|
|
115
|
-
setInitialItems(_Array$from(items));
|
|
116
|
-
}, []);
|
|
117
110
|
var toggleItems = function toggleItems(keys) {
|
|
118
111
|
if (onSelectionChange) onSelectionChange(keys);
|
|
119
112
|
};
|
|
@@ -192,10 +185,10 @@ var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
192
185
|
}, [isOpen, selectionManager.selectedKeys, updatePosition]);
|
|
193
186
|
|
|
194
187
|
// Measure the width of the input to inform the width of the menu (below).
|
|
195
|
-
var
|
|
196
|
-
|
|
197
|
-
menuWidth =
|
|
198
|
-
setMenuWidth =
|
|
188
|
+
var _useState9 = useState(null),
|
|
189
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
190
|
+
menuWidth = _useState10[0],
|
|
191
|
+
setMenuWidth = _useState10[1];
|
|
199
192
|
var onResize = useCallback(function () {
|
|
200
193
|
/* istanbul ignore next */
|
|
201
194
|
if (inputWrapperRef.current) {
|
|
@@ -260,20 +253,20 @@ var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
260
253
|
if (onKeyDown) onKeyDown(e.nativeEvent);
|
|
261
254
|
};
|
|
262
255
|
var handleBlur = function handleBlur(e) {
|
|
263
|
-
var _inputWrapperRef$curr,
|
|
256
|
+
var _inputWrapperRef$curr, _popoverRef$current;
|
|
264
257
|
var relatedTarget = e.relatedTarget || document.activeElement;
|
|
265
|
-
if ((_inputWrapperRef$curr = inputWrapperRef.current) !== null && _inputWrapperRef$curr !== void 0 && _inputWrapperRef$curr.contains(relatedTarget) || (
|
|
258
|
+
if ((_inputWrapperRef$curr = inputWrapperRef.current) !== null && _inputWrapperRef$curr !== void 0 && _inputWrapperRef$curr.contains(relatedTarget) || (_popoverRef$current = popoverRef.current) !== null && _popoverRef$current !== void 0 && _popoverRef$current.contains(relatedTarget) || buttonRef.current === relatedTarget) {
|
|
266
259
|
return;
|
|
267
260
|
}
|
|
268
261
|
setFilterString('');
|
|
269
262
|
setIsOpen(false);
|
|
270
263
|
};
|
|
271
|
-
var
|
|
272
|
-
|
|
273
|
-
selectionState =
|
|
274
|
-
setSelectionState =
|
|
264
|
+
var _useState11 = useState('Select All'),
|
|
265
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
266
|
+
selectionState = _useState12[0],
|
|
267
|
+
setSelectionState = _useState12[1];
|
|
275
268
|
var arrayItems = _Array$from(items);
|
|
276
|
-
var itemCount = _reduceInstanceProperty(
|
|
269
|
+
var itemCount = _reduceInstanceProperty(arrayItems).call(arrayItems, function (count, obj) {
|
|
277
270
|
return count + (obj.children ? obj.children.length : 1);
|
|
278
271
|
}, 0);
|
|
279
272
|
var selectedKeysSize = selectionManager.selectedKeys.size;
|
|
@@ -341,7 +334,7 @@ var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
341
334
|
var inputProps = _objectSpread(_objectSpread({}, customInputProps), {}, {
|
|
342
335
|
controlProps: {
|
|
343
336
|
'aria-activedescendant': activeDescendant,
|
|
344
|
-
'aria-controls': (_listBoxRef$
|
|
337
|
+
'aria-controls': (_listBoxRef$current = listBoxRef.current) === null || _listBoxRef$current === void 0 ? void 0 : _listBoxRef$current.id,
|
|
345
338
|
'aria-expanded': isOpen,
|
|
346
339
|
role: 'combobox',
|
|
347
340
|
ref: inputRef,
|
|
@@ -399,8 +392,8 @@ var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
399
392
|
value: setActiveDescendant
|
|
400
393
|
}, ___EmotionJSX(Box, mergeProps(containerProps, focusWithinProps), ___EmotionJSX(TextField, _extends({
|
|
401
394
|
onBlur: function onBlur(e) {
|
|
402
|
-
var _popoverRef$
|
|
403
|
-
var blurIntoPopover = (_popoverRef$
|
|
395
|
+
var _popoverRef$current2;
|
|
396
|
+
var blurIntoPopover = (_popoverRef$current2 = popoverRef.current) === null || _popoverRef$current2 === void 0 ? void 0 : _popoverRef$current2.contains(e.relatedTarget);
|
|
404
397
|
if (blurIntoPopover) {
|
|
405
398
|
return;
|
|
406
399
|
}
|
|
@@ -35,7 +35,7 @@ var PanelHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
35
35
|
image = data.image,
|
|
36
36
|
subtext = data.subtext,
|
|
37
37
|
text = data.text,
|
|
38
|
-
|
|
38
|
+
avatarDefaultText = data.avatarDefaultText;
|
|
39
39
|
var _useGetTheme = useGetTheme(),
|
|
40
40
|
themeState = _useGetTheme.themeState;
|
|
41
41
|
var isOnyx = themeState.isOnyx;
|
|
@@ -51,10 +51,12 @@ var PanelHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
51
51
|
}
|
|
52
52
|
}));
|
|
53
53
|
var renderAvatar = ___EmotionJSX(Avatar, _extends({
|
|
54
|
+
color: "green",
|
|
54
55
|
src: image === null || image === void 0 ? void 0 : image.src,
|
|
56
|
+
isSquare: !!(image !== null && image !== void 0 && image.src),
|
|
55
57
|
size: "avatar.lg",
|
|
56
|
-
defaultText:
|
|
57
|
-
mr: "
|
|
58
|
+
defaultText: avatarDefaultText,
|
|
59
|
+
mr: "lg"
|
|
58
60
|
}, avatarProps));
|
|
59
61
|
var renderImage = !icon && image && ___EmotionJSX(Box, {
|
|
60
62
|
variant: "panelHeader.iconWrapper"
|
|
@@ -88,7 +90,7 @@ var PanelHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
88
90
|
var renderData = ___EmotionJSX(Box, {
|
|
89
91
|
isRow: true,
|
|
90
92
|
variant: text || subtext ? 'panelHeader.data' : 'panelHeader.emptyData'
|
|
91
|
-
}, renderLeftContent(), ___EmotionJSX(Box, headerWrapperPropsSpread, text && ___EmotionJSX(Text, _extends({}, headerPropsSpread, {
|
|
93
|
+
}, renderLeftContent(), (text || subtext) && ___EmotionJSX(Box, headerWrapperPropsSpread, text && ___EmotionJSX(Text, _extends({}, headerPropsSpread, {
|
|
92
94
|
variant: "panelHeaderText"
|
|
93
95
|
}), text), subtext && ___EmotionJSX(Text, {
|
|
94
96
|
variant: "panelHeaderSubtext"
|
|
@@ -28,7 +28,7 @@ export var Default = function Default(_ref) {
|
|
|
28
28
|
data: {
|
|
29
29
|
icon: AccountIcon,
|
|
30
30
|
text: 'Fons Vernall',
|
|
31
|
-
|
|
31
|
+
avatarDefaultText: 'FV'
|
|
32
32
|
}
|
|
33
33
|
}));
|
|
34
34
|
};
|
|
@@ -45,7 +45,7 @@ export var WithSubtext = function WithSubtext(_ref2) {
|
|
|
45
45
|
icon: AccountIcon,
|
|
46
46
|
subtext: 'rad_developer@pingidentity.com',
|
|
47
47
|
text: 'Fons Vernall',
|
|
48
|
-
|
|
48
|
+
avatarDefaultText: 'FV'
|
|
49
49
|
}
|
|
50
50
|
}));
|
|
51
51
|
};
|
|
@@ -62,7 +62,7 @@ export var WithControls = function WithControls(_ref3) {
|
|
|
62
62
|
icon: AccountIcon,
|
|
63
63
|
text: 'Fons Vernall',
|
|
64
64
|
subtext: 'rad_developer@pingidentity.com',
|
|
65
|
-
|
|
65
|
+
avatarDefaultText: 'FV'
|
|
66
66
|
}
|
|
67
67
|
}), ___EmotionJSX(PanelHeaderSwitchField, null), ___EmotionJSX(PanelHeaderMenu, null, ___EmotionJSX(Item, {
|
|
68
68
|
key: "enable"
|
|
@@ -85,7 +85,7 @@ export var WithImage = function WithImage(args) {
|
|
|
85
85
|
src: pingImg,
|
|
86
86
|
alt: 'Ping Identity Logo',
|
|
87
87
|
'aria-label': 'Ping Identity Logo',
|
|
88
|
-
|
|
88
|
+
avatarDefaultText: 'FV'
|
|
89
89
|
},
|
|
90
90
|
text: 'Fons Vernall'
|
|
91
91
|
}
|
|
@@ -143,7 +143,7 @@ export var WithExtraLongText = function WithExtraLongText(_ref4) {
|
|
|
143
143
|
var args = _extends({}, (_objectDestructuringEmpty(_ref4), _ref4));
|
|
144
144
|
return ___EmotionJSX(PanelHeader, _extends({}, args, {
|
|
145
145
|
data: {
|
|
146
|
-
|
|
146
|
+
avatarDefaultText: 'FV',
|
|
147
147
|
icon: AccountIcon,
|
|
148
148
|
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
|
|
149
149
|
subtext: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AstroProvider, OnyxDarkTheme } from '../../..';
|
|
3
|
+
import PanelHeaderComponent from './OnyxPanelHeaderComponent';
|
|
4
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Chromatic Only Onyx Dark Panel Header'
|
|
7
|
+
};
|
|
8
|
+
export var Default = function Default() {
|
|
9
|
+
return ___EmotionJSX(AstroProvider, {
|
|
10
|
+
theme: OnyxDarkTheme
|
|
11
|
+
}, ___EmotionJSX(PanelHeaderComponent, null));
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AstroProvider, OnyxTheme } from '../../..';
|
|
3
|
+
import PanelHeaderComponent from './OnyxPanelHeaderComponent';
|
|
4
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Chromatic Only Onyx Panel Header'
|
|
7
|
+
};
|
|
8
|
+
export var Default = function Default() {
|
|
9
|
+
return ___EmotionJSX(AstroProvider, {
|
|
10
|
+
theme: OnyxTheme
|
|
11
|
+
}, ___EmotionJSX(PanelHeaderComponent, null));
|
|
12
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import AccountIcon from '@pingux/mdi-react/AccountIcon';
|
|
3
|
+
import ChevronRightIcon from '@pingux/mdi-react/ChevronRightIcon';
|
|
4
|
+
import { Box, Breadcrumbs, Item, PanelHeader, PanelHeaderCloseButton, PanelHeaderMenu, PanelHeaderSwitchField } from '../../..';
|
|
5
|
+
import { pingImg } from '../../../utils/devUtils/constants/images';
|
|
6
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
7
|
+
var PanelHeaderComponent = function PanelHeaderComponent() {
|
|
8
|
+
var breadcrumbs = ___EmotionJSX(Box, {
|
|
9
|
+
width: "100%"
|
|
10
|
+
}, ___EmotionJSX(Breadcrumbs, {
|
|
11
|
+
icon: ChevronRightIcon
|
|
12
|
+
}, ___EmotionJSX(Item, {
|
|
13
|
+
"aria-label": "Lorem Text",
|
|
14
|
+
href: "https://www.pingidentity.com",
|
|
15
|
+
key: "Item1Key"
|
|
16
|
+
}, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."), ___EmotionJSX(Item, {
|
|
17
|
+
"aria-label": "Lorem Ut",
|
|
18
|
+
key: "Item2Key"
|
|
19
|
+
}, "Ut enim ad minim veniam, quis nostrud exercitation ullamco, laboris nisi ut aliquip ex ea commodo consequat incididunt et dolore.")));
|
|
20
|
+
return ___EmotionJSX(Box, {
|
|
21
|
+
gap: "md"
|
|
22
|
+
}, ___EmotionJSX(PanelHeader, {
|
|
23
|
+
data: {
|
|
24
|
+
icon: AccountIcon,
|
|
25
|
+
text: 'Fons Vernall',
|
|
26
|
+
avatarDefaultText: 'FV'
|
|
27
|
+
}
|
|
28
|
+
}), ___EmotionJSX(PanelHeader, {
|
|
29
|
+
data: {
|
|
30
|
+
icon: AccountIcon,
|
|
31
|
+
subtext: 'rad_developer@pingidentity.com',
|
|
32
|
+
text: 'Fons Vernall',
|
|
33
|
+
avatarDefaultText: 'FV'
|
|
34
|
+
}
|
|
35
|
+
}), ___EmotionJSX(PanelHeader, {
|
|
36
|
+
data: {
|
|
37
|
+
icon: AccountIcon,
|
|
38
|
+
text: 'Fons Vernall',
|
|
39
|
+
subtext: 'rad_developer@pingidentity.com',
|
|
40
|
+
avatarDefaultText: 'FV'
|
|
41
|
+
}
|
|
42
|
+
}, ___EmotionJSX(PanelHeaderSwitchField, null), ___EmotionJSX(PanelHeaderMenu, null, ___EmotionJSX(Item, {
|
|
43
|
+
key: "enable"
|
|
44
|
+
}, "Enable user"), ___EmotionJSX(Item, {
|
|
45
|
+
key: "disable"
|
|
46
|
+
}, "Disable user"), ___EmotionJSX(Item, {
|
|
47
|
+
key: "delete"
|
|
48
|
+
}, "Delete user")), ___EmotionJSX(PanelHeaderCloseButton, null)), ___EmotionJSX(PanelHeader, {
|
|
49
|
+
data: {
|
|
50
|
+
image: {
|
|
51
|
+
src: pingImg,
|
|
52
|
+
alt: 'Ping Identity Logo',
|
|
53
|
+
'aria-label': 'Ping Identity Logo',
|
|
54
|
+
avatarDefaultText: 'FV'
|
|
55
|
+
},
|
|
56
|
+
text: 'Fons Vernall'
|
|
57
|
+
}
|
|
58
|
+
}), ___EmotionJSX(PanelHeader, {
|
|
59
|
+
data: {
|
|
60
|
+
icon: AccountIcon
|
|
61
|
+
},
|
|
62
|
+
slots: {
|
|
63
|
+
rightOfData: breadcrumbs
|
|
64
|
+
}
|
|
65
|
+
}, ___EmotionJSX(PanelHeaderCloseButton, null)), ___EmotionJSX(PanelHeader, {
|
|
66
|
+
data: {
|
|
67
|
+
avatarDefaultText: 'FV',
|
|
68
|
+
icon: AccountIcon,
|
|
69
|
+
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum',
|
|
70
|
+
subtext: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum'
|
|
71
|
+
}
|
|
72
|
+
}, ___EmotionJSX(PanelHeaderSwitchField, null), ___EmotionJSX(PanelHeaderMenu, null, ___EmotionJSX(Item, {
|
|
73
|
+
key: "enable"
|
|
74
|
+
}, "Enable user"), ___EmotionJSX(Item, {
|
|
75
|
+
key: "disable"
|
|
76
|
+
}, "Disable user"), ___EmotionJSX(Item, {
|
|
77
|
+
key: "delete"
|
|
78
|
+
}, "Delete user")), ___EmotionJSX(PanelHeaderCloseButton, null)));
|
|
79
|
+
};
|
|
80
|
+
export default PanelHeaderComponent;
|
|
@@ -19,5 +19,5 @@ export var astroBlacklistStory = {
|
|
|
19
19
|
Text: ['Onyx'],
|
|
20
20
|
Loader: ['Circular', 'Custom Circular']
|
|
21
21
|
};
|
|
22
|
-
export var nextGenOnlyComponents = ['NavigationHeader', 'Prompt', 'AI Panel', 'Response', 'Suggestions', 'Prompt Input', 'Footer'];
|
|
22
|
+
export var nextGenOnlyComponents = ['NavigationHeader', 'Prompt', 'AI Panel', 'Response', 'Suggestions', 'Prompt Input', 'Footer', 'Onyx Input Patterns'];
|
|
23
23
|
export default nextGenConvertedComponents;
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import EyeOffOutlineIcon from '@pingux/mdi-react/EyeOffOutlineIcon';
|
|
4
|
+
import EyeOutlineIcon from '@pingux/mdi-react/EyeOutlineIcon';
|
|
5
|
+
import { Box, Button, IconButtonToggle, Item, SelectField, Text } from '../../../..';
|
|
6
|
+
import TextField from '../../../../components/TextField';
|
|
7
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Form/Onyx Input Patterns',
|
|
10
|
+
component: TextField
|
|
11
|
+
};
|
|
12
|
+
var items = [{
|
|
13
|
+
name: 'Aardvark',
|
|
14
|
+
id: '1'
|
|
15
|
+
}, {
|
|
16
|
+
name: 'Kangaroo',
|
|
17
|
+
id: '2'
|
|
18
|
+
}, {
|
|
19
|
+
name: 'Snake',
|
|
20
|
+
id: '3'
|
|
21
|
+
}];
|
|
22
|
+
export var Default = function Default() {
|
|
23
|
+
return ___EmotionJSX(TextField, {
|
|
24
|
+
label: "Label",
|
|
25
|
+
helperText: "Help text for this field."
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export var PasswordInput = function PasswordInput() {
|
|
29
|
+
var _useState = useState(false),
|
|
30
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
31
|
+
isVisible = _useState2[0],
|
|
32
|
+
setIsVisible = _useState2[1];
|
|
33
|
+
var handleVisible = function handleVisible() {
|
|
34
|
+
setIsVisible(!isVisible);
|
|
35
|
+
};
|
|
36
|
+
return ___EmotionJSX(TextField, {
|
|
37
|
+
label: "Password",
|
|
38
|
+
type: "password",
|
|
39
|
+
containerProps: {
|
|
40
|
+
sx: {
|
|
41
|
+
'& input': {
|
|
42
|
+
paddingRight: '60px'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
slots: {
|
|
47
|
+
inContainer: ___EmotionJSX(IconButtonToggle, {
|
|
48
|
+
toggledIcon: EyeOutlineIcon,
|
|
49
|
+
defaultIcon: EyeOffOutlineIcon,
|
|
50
|
+
onToggle: handleVisible,
|
|
51
|
+
isToggled: isVisible,
|
|
52
|
+
variant: "passwordVisibilityIcon",
|
|
53
|
+
buttonProps: {
|
|
54
|
+
'aria-label': 'eye icon'
|
|
55
|
+
},
|
|
56
|
+
iconProps: {
|
|
57
|
+
size: 'xs'
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
export var InputGroup = function InputGroup() {
|
|
64
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(TextField, {
|
|
65
|
+
label: "Label",
|
|
66
|
+
helperText: "Help text for this field.",
|
|
67
|
+
containerProps: {
|
|
68
|
+
sx: {
|
|
69
|
+
'& input': {
|
|
70
|
+
paddingLeft: '70px'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
slots: {
|
|
75
|
+
beforeInput: ___EmotionJSX(Box, {
|
|
76
|
+
variant: "box.inputGroupContentLeft",
|
|
77
|
+
p: "12px 20px"
|
|
78
|
+
}, ___EmotionJSX(Text, null, "@"))
|
|
79
|
+
}
|
|
80
|
+
}), ___EmotionJSX(TextField, {
|
|
81
|
+
label: "Label",
|
|
82
|
+
mt: "xl",
|
|
83
|
+
helperText: "Help text for this field.",
|
|
84
|
+
containerProps: {
|
|
85
|
+
sx: {
|
|
86
|
+
'& input': {
|
|
87
|
+
paddingRight: '160px'
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
slots: {
|
|
92
|
+
inContainer: ___EmotionJSX(Box, {
|
|
93
|
+
variant: "box.inputGroupContentRight",
|
|
94
|
+
p: "12px 20px"
|
|
95
|
+
}, ___EmotionJSX(Text, null, "@example.com"))
|
|
96
|
+
}
|
|
97
|
+
}));
|
|
98
|
+
};
|
|
99
|
+
export var ButtonInputGroup = function ButtonInputGroup() {
|
|
100
|
+
return ___EmotionJSX(TextField, {
|
|
101
|
+
label: "Label",
|
|
102
|
+
containerProps: {
|
|
103
|
+
sx: {
|
|
104
|
+
'& input': {
|
|
105
|
+
paddingRight: '100px'
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
slots: {
|
|
110
|
+
inContainer: ___EmotionJSX(Button, {
|
|
111
|
+
variant: "ButtonInputGroupContentRight"
|
|
112
|
+
}, "Button")
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
export var DropdownInputGroup = function DropdownInputGroup() {
|
|
117
|
+
var _useState3 = useState(items[0].name),
|
|
118
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
119
|
+
selectedKey = _useState4[0],
|
|
120
|
+
setSelectedKey = _useState4[1];
|
|
121
|
+
var handleSelectionChange = function handleSelectionChange(key) {
|
|
122
|
+
return setSelectedKey(key);
|
|
123
|
+
};
|
|
124
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(TextField, {
|
|
125
|
+
label: "Label",
|
|
126
|
+
containerProps: {
|
|
127
|
+
sx: {
|
|
128
|
+
'& > .field-control-wrapper > input': {
|
|
129
|
+
paddingRight: '160px'
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
slots: {
|
|
134
|
+
inContainer: ___EmotionJSX(Box, {
|
|
135
|
+
variant: "box.inputDropDownContentRight",
|
|
136
|
+
width: "150px",
|
|
137
|
+
mt: "-2px"
|
|
138
|
+
}, ___EmotionJSX(SelectField, {
|
|
139
|
+
items: items,
|
|
140
|
+
selectedKey: selectedKey,
|
|
141
|
+
onSelectionChange: handleSelectionChange,
|
|
142
|
+
variant: "forms.input.dropDownContentRight"
|
|
143
|
+
}, function (item) {
|
|
144
|
+
return ___EmotionJSX(Item, {
|
|
145
|
+
key: item.name,
|
|
146
|
+
"data-id": item.name
|
|
147
|
+
}, item.name);
|
|
148
|
+
}))
|
|
149
|
+
}
|
|
150
|
+
}), ___EmotionJSX(TextField, {
|
|
151
|
+
label: "Label",
|
|
152
|
+
mt: "xl",
|
|
153
|
+
containerProps: {
|
|
154
|
+
sx: {
|
|
155
|
+
'& > .field-control-wrapper > input': {
|
|
156
|
+
paddingLeft: '160px'
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
slots: {
|
|
161
|
+
beforeInput: ___EmotionJSX(Box, {
|
|
162
|
+
variant: "box.inputDropDownContentLeft",
|
|
163
|
+
width: "150px",
|
|
164
|
+
mt: "-2px"
|
|
165
|
+
}, ___EmotionJSX(SelectField, {
|
|
166
|
+
items: items,
|
|
167
|
+
selectedKey: selectedKey,
|
|
168
|
+
onSelectionChange: handleSelectionChange,
|
|
169
|
+
variant: "forms.input.dropDownContentLeft"
|
|
170
|
+
}, function (item) {
|
|
171
|
+
return ___EmotionJSX(Item, {
|
|
172
|
+
key: item.name,
|
|
173
|
+
"data-id": item.name
|
|
174
|
+
}, item.name);
|
|
175
|
+
}))
|
|
176
|
+
}
|
|
177
|
+
}));
|
|
178
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
|
2
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
|
3
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
4
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
6
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
|
7
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
|
8
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
9
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
import colors from '../colors/colors';
|
|
13
|
+
export var commonContentProps = {
|
|
14
|
+
position: 'absolute',
|
|
15
|
+
top: '50%',
|
|
16
|
+
transform: 'translateY(-50%)',
|
|
17
|
+
height: '100%',
|
|
18
|
+
width: 'max-content',
|
|
19
|
+
justifyContent: 'center'
|
|
20
|
+
};
|
|
21
|
+
export var box = {
|
|
22
|
+
indeterminateCheckboxIcon: {
|
|
23
|
+
height: '19.25px',
|
|
24
|
+
width: '19.25px',
|
|
25
|
+
'&.is-disabled': {
|
|
26
|
+
'& rect[id="indeterminate-checkbox-icon-wrapper"]': {
|
|
27
|
+
fill: 'gray-500',
|
|
28
|
+
stroke: 'gray-500'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
'&.is-focused': {
|
|
32
|
+
boxShadow: "inset 0px 0px 0px 1px ".concat(colors.focus)
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
inputDropDownContentLeft: _objectSpread(_objectSpread({}, commonContentProps), {}, {
|
|
36
|
+
left: 0
|
|
37
|
+
}),
|
|
38
|
+
inputGroupContentLeft: _objectSpread(_objectSpread({}, commonContentProps), {}, {
|
|
39
|
+
left: 0,
|
|
40
|
+
borderRight: "1px solid ".concat(colors['gray-500'])
|
|
41
|
+
}),
|
|
42
|
+
inputDropDownContentRight: _objectSpread(_objectSpread({}, commonContentProps), {}, {
|
|
43
|
+
right: 0
|
|
44
|
+
}),
|
|
45
|
+
inputGroupContentRight: _objectSpread(_objectSpread({}, commonContentProps), {}, {
|
|
46
|
+
right: 0,
|
|
47
|
+
borderLeft: "1px solid ".concat(colors['gray-500'])
|
|
48
|
+
})
|
|
49
|
+
};
|
|
@@ -13,6 +13,7 @@ import chroma from 'chroma-js';
|
|
|
13
13
|
import { copyButton } from '../codeView/codeView';
|
|
14
14
|
import colors from '../colors/colors';
|
|
15
15
|
import tShirtSizes from '../customProperties/tShirtSizes';
|
|
16
|
+
import { commonContentProps } from './box';
|
|
16
17
|
var primaryBlue = colors.primary,
|
|
17
18
|
primaryBlueHover = colors.active_hover,
|
|
18
19
|
primaryBluePress = colors.active_pressed,
|
|
@@ -109,8 +110,19 @@ var secondary = _objectSpread(_objectSpread({}, buttonBase), {}, {
|
|
|
109
110
|
var tertiary = _objectSpread(_objectSpread({}, buttonBase), {}, {
|
|
110
111
|
backgroundColor: 'transparent',
|
|
111
112
|
borderColor: 'border.base',
|
|
112
|
-
color: '
|
|
113
|
-
'&.is-
|
|
113
|
+
color: 'font.base',
|
|
114
|
+
'&.is-focused': _objectSpread(_objectSpread({}, defaultFocus), {}, {
|
|
115
|
+
outlineColor: 'gray-700',
|
|
116
|
+
backgroundColor: 'background.secondary'
|
|
117
|
+
}),
|
|
118
|
+
'&.is-pressed': {
|
|
119
|
+
backgroundColor: 'background.secondary',
|
|
120
|
+
color: 'font.base'
|
|
121
|
+
},
|
|
122
|
+
'&.is-hovered': _objectSpread({
|
|
123
|
+
backgroundColor: 'background.secondary',
|
|
124
|
+
color: 'font.base'
|
|
125
|
+
}, boxShadowNone)
|
|
114
126
|
});
|
|
115
127
|
var outlineCritical = _objectSpread(_objectSpread({}, buttonBase), {}, {
|
|
116
128
|
backgroundColor: 'transparent',
|
|
@@ -500,7 +512,21 @@ var iconButtons = {
|
|
|
500
512
|
}
|
|
501
513
|
}
|
|
502
514
|
}),
|
|
503
|
-
hintButton: _objectSpread({}, hintButton)
|
|
515
|
+
hintButton: _objectSpread({}, hintButton),
|
|
516
|
+
passwordVisibilityIcon: _objectSpread(_objectSpread(_objectSpread({}, baseIconButton), commonContentProps), {}, {
|
|
517
|
+
right: 0,
|
|
518
|
+
padding: '12px 20px',
|
|
519
|
+
border: '0px solid !important',
|
|
520
|
+
'&:hover, &.is-pressed': {
|
|
521
|
+
background: 'transparent',
|
|
522
|
+
boxShadow: 'none'
|
|
523
|
+
},
|
|
524
|
+
'&.is-focused': {
|
|
525
|
+
outline: '2px solid',
|
|
526
|
+
outlineOffset: '2px',
|
|
527
|
+
outlineColor: 'gray-700'
|
|
528
|
+
}
|
|
529
|
+
})
|
|
504
530
|
};
|
|
505
531
|
var listBoxLink = {
|
|
506
532
|
color: 'active',
|
|
@@ -529,6 +555,15 @@ var listBoxLink = {
|
|
|
529
555
|
}
|
|
530
556
|
})
|
|
531
557
|
};
|
|
558
|
+
var ButtonInputGroupContentRight = _objectSpread(_objectSpread(_objectSpread({}, tertiary), commonContentProps), {}, {
|
|
559
|
+
right: 0,
|
|
560
|
+
padding: '12px 20px',
|
|
561
|
+
borderRadius: '0px 4px 4px 0px !important',
|
|
562
|
+
borderWidth: '0px !important',
|
|
563
|
+
borderLeftWidth: '1px !important',
|
|
564
|
+
borderRightWidth: '1px !important',
|
|
565
|
+
borderLeftColor: 'gray-500'
|
|
566
|
+
});
|
|
532
567
|
var buttons = {
|
|
533
568
|
neutral: neutral,
|
|
534
569
|
primary: primary,
|
|
@@ -552,6 +587,7 @@ var buttons = {
|
|
|
552
587
|
iconButtons: iconButtons,
|
|
553
588
|
modalCloseButton: modalCloseButton,
|
|
554
589
|
aiChat: aiChat,
|
|
555
|
-
paginationMenu: paginationMenu
|
|
590
|
+
paginationMenu: paginationMenu,
|
|
591
|
+
ButtonInputGroupContentRight: ButtonInputGroupContentRight
|
|
556
592
|
};
|
|
557
593
|
export default buttons;
|
|
@@ -192,4 +192,25 @@ input.promptInputAttachmentWrapper = {
|
|
|
192
192
|
overflowY: 'hidden',
|
|
193
193
|
whiteSpace: 'nowrap',
|
|
194
194
|
px: '.75rem'
|
|
195
|
+
};
|
|
196
|
+
input.dropDownContentRight = {
|
|
197
|
+
background: 'inherit',
|
|
198
|
+
'& button': {
|
|
199
|
+
borderRadius: '0px 4px 4px 0px !important',
|
|
200
|
+
'&.is-focused': {
|
|
201
|
+
outline: '2px solid',
|
|
202
|
+
outlineOffset: '2px',
|
|
203
|
+
outlineColor: 'gray-700'
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
input.dropDownContentLeft = {
|
|
208
|
+
'& button': {
|
|
209
|
+
borderRadius: '4px 0px 0px 4px !important',
|
|
210
|
+
'&.is-focused': {
|
|
211
|
+
outline: '2px solid',
|
|
212
|
+
outlineOffset: '2px',
|
|
213
|
+
outlineColor: 'gray-700'
|
|
214
|
+
}
|
|
215
|
+
}
|
|
195
216
|
};
|