@pingux/astro 2.147.1-alpha.0 → 2.148.0-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/lib/cjs/components/Badge/Badge.styles.d.ts +5 -1
- package/lib/cjs/components/Badge/Badge.styles.js +6 -2
- package/lib/cjs/components/ImageUploadField/ImageUploadField.test.js +3 -1
- package/lib/cjs/components/ListBox/Option.js +7 -3
- package/lib/cjs/components/Modal/Modal.stories.d.ts +1 -0
- package/lib/cjs/components/Modal/Modal.stories.js +27 -1
- package/lib/cjs/components/Modal/tests/Modal.unit.test.js +51 -2
- package/lib/cjs/components/MultivaluesField/DefaultMultivaluesField.js +0 -1
- package/lib/cjs/components/MultivaluesField/MultivaluesField.stories.js +8 -103
- package/lib/cjs/components/Popover/Popover.d.ts +1 -11
- package/lib/cjs/components/Popover/Popover.js +12 -5
- package/lib/cjs/components/PopoverMenu/PopoverMenu.js +12 -27
- package/lib/cjs/hooks/useOverlappingMenuHoverState/useOverlappingMenuHoverState.test.js +15 -5
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.d.ts +9 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +11 -2
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.d.ts +6 -0
- package/lib/cjs/styles/themeOverrides/nextGenDarkMode/variants/variants.js +7 -1
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.d.ts +0 -1
- package/lib/cjs/styles/themes/next-gen/convertedComponentList.js +0 -1
- package/lib/cjs/styles/themes/next-gen/next-gen.d.ts +3 -5
- package/lib/cjs/styles/themes/next-gen/variants/badges.d.ts +3 -5
- package/lib/cjs/styles/themes/next-gen/variants/badges.js +5 -2
- package/lib/cjs/types/popoverContainer.d.ts +18 -0
- package/lib/cjs/utils/testUtils/universalFormSubmitTest.js +3 -0
- package/lib/components/Badge/Badge.styles.js +6 -2
- package/lib/components/ImageUploadField/ImageUploadField.test.js +3 -1
- package/lib/components/ListBox/Option.js +7 -3
- package/lib/components/Modal/Modal.stories.js +26 -1
- package/lib/components/Modal/tests/Modal.unit.test.js +52 -2
- package/lib/components/MultivaluesField/DefaultMultivaluesField.js +0 -1
- package/lib/components/MultivaluesField/MultivaluesField.stories.js +8 -103
- package/lib/components/Popover/Popover.js +12 -5
- package/lib/components/PopoverMenu/PopoverMenu.js +13 -28
- package/lib/hooks/useOverlappingMenuHoverState/useOverlappingMenuHoverState.test.js +15 -5
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/buttons.js +11 -2
- package/lib/styles/themeOverrides/nextGenDarkMode/variants/variants.js +7 -1
- package/lib/styles/themes/next-gen/convertedComponentList.js +0 -1
- package/lib/styles/themes/next-gen/variants/badges.js +5 -2
- package/lib/utils/testUtils/universalFormSubmitTest.js +3 -0
- package/package.json +1 -1
|
@@ -278,11 +278,20 @@ var buttons = {
|
|
|
278
278
|
},
|
|
279
279
|
'&.is-focused': {
|
|
280
280
|
textDecoration: 'underline',
|
|
281
|
-
color: _chromaJs["default"].mix(_colorTokens.nextGenColors['blue-500'], 'white', 0.
|
|
281
|
+
color: _chromaJs["default"].mix(_colorTokens.nextGenColors['blue-500'], 'white', 0.3, 'rgb').hex(),
|
|
282
282
|
outline: 'none'
|
|
283
283
|
}
|
|
284
284
|
},
|
|
285
|
-
iconButtons: iconButtons
|
|
285
|
+
iconButtons: iconButtons,
|
|
286
|
+
listBoxLink: {
|
|
287
|
+
color: 'blue-400',
|
|
288
|
+
'&.is-pressed': {
|
|
289
|
+
color: _chromaJs["default"].mix(_colorTokens.nextGenColors['blue-500'], 'white', 0.45, 'rgb').hex()
|
|
290
|
+
},
|
|
291
|
+
'&.is-focused': {
|
|
292
|
+
color: _chromaJs["default"].mix(_colorTokens.nextGenColors['blue-500'], 'white', 0.3, 'rgb').hex()
|
|
293
|
+
}
|
|
294
|
+
}
|
|
286
295
|
};
|
|
287
296
|
var _default = buttons;
|
|
288
297
|
exports["default"] = _default;
|
|
@@ -20,7 +20,7 @@ var listBox = {
|
|
|
20
20
|
container: {
|
|
21
21
|
backgroundColor: 'background.base',
|
|
22
22
|
border: '1px solid',
|
|
23
|
-
borderColor: '
|
|
23
|
+
borderColor: 'transparent',
|
|
24
24
|
borderRadius: '4px'
|
|
25
25
|
},
|
|
26
26
|
option: {
|
|
@@ -170,6 +170,12 @@ var _default = {
|
|
|
170
170
|
skeleton: _skeleton["default"],
|
|
171
171
|
footer: _footer.footer,
|
|
172
172
|
tooltip: tooltip,
|
|
173
|
+
popoverMenu: {
|
|
174
|
+
container: {
|
|
175
|
+
background: '#23282e',
|
|
176
|
+
border: '1px solid #69788B'
|
|
177
|
+
}
|
|
178
|
+
},
|
|
173
179
|
dataTable: {
|
|
174
180
|
selectableTableRow: {
|
|
175
181
|
'&.is-selected': {
|
|
@@ -14,7 +14,6 @@ var componentSpecificNextGenBlacklist = {
|
|
|
14
14
|
OverlayPanel: ['Expandable'],
|
|
15
15
|
DataTable: ['Default'],
|
|
16
16
|
Text: ['Default'],
|
|
17
|
-
MultivaluesField: ['Icon Slots In Badge'],
|
|
18
17
|
Tabs: ['Vertical Orientation']
|
|
19
18
|
};
|
|
20
19
|
exports.componentSpecificNextGenBlacklist = componentSpecificNextGenBlacklist;
|
|
@@ -2861,6 +2861,9 @@ declare const _default: {
|
|
|
2861
2861
|
fontSize: string;
|
|
2862
2862
|
fontWeight: number;
|
|
2863
2863
|
};
|
|
2864
|
+
'& svg': {
|
|
2865
|
+
fill: string;
|
|
2866
|
+
};
|
|
2864
2867
|
border: string;
|
|
2865
2868
|
'& button': {
|
|
2866
2869
|
alignSelf: string;
|
|
@@ -2875,11 +2878,6 @@ declare const _default: {
|
|
|
2875
2878
|
};
|
|
2876
2879
|
};
|
|
2877
2880
|
};
|
|
2878
|
-
'& svg': {
|
|
2879
|
-
path: {
|
|
2880
|
-
fill: string;
|
|
2881
|
-
};
|
|
2882
|
-
};
|
|
2883
2881
|
alignItems: string;
|
|
2884
2882
|
justifyContent: string;
|
|
2885
2883
|
py: string;
|
|
@@ -787,6 +787,9 @@ export declare const badges: {
|
|
|
787
787
|
fontSize: string;
|
|
788
788
|
fontWeight: number;
|
|
789
789
|
};
|
|
790
|
+
'& svg': {
|
|
791
|
+
fill: string;
|
|
792
|
+
};
|
|
790
793
|
border: string;
|
|
791
794
|
'& button': {
|
|
792
795
|
alignSelf: string;
|
|
@@ -801,11 +804,6 @@ export declare const badges: {
|
|
|
801
804
|
};
|
|
802
805
|
};
|
|
803
806
|
};
|
|
804
|
-
'& svg': {
|
|
805
|
-
path: {
|
|
806
|
-
fill: string;
|
|
807
|
-
};
|
|
808
|
-
};
|
|
809
807
|
alignItems: string;
|
|
810
808
|
justifyContent: string;
|
|
811
809
|
py: string;
|
|
@@ -105,11 +105,14 @@ var readOnlyFieldBadge = _objectSpread(_objectSpread({}, readOnlyBadge), {}, {
|
|
|
105
105
|
})
|
|
106
106
|
});
|
|
107
107
|
var itemBadgeWithSlot = _objectSpread(_objectSpread({}, readOnlyBadge), {}, {
|
|
108
|
-
bg: '#
|
|
108
|
+
bg: '#EAF2FD !important',
|
|
109
109
|
fontWeight: 2,
|
|
110
110
|
'& span': _objectSpread(_objectSpread({}, badgeFont), {}, {
|
|
111
111
|
color: 'text.primary'
|
|
112
|
-
})
|
|
112
|
+
}),
|
|
113
|
+
'& svg': {
|
|
114
|
+
fill: 'gray-900'
|
|
115
|
+
}
|
|
113
116
|
});
|
|
114
117
|
var badgeDeleteButton = _objectSpread(_objectSpread({}, _button["default"].iconButtons.base), {}, {
|
|
115
118
|
borderRadius: '50%',
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { OverlayTriggerState } from 'react-stately';
|
|
3
|
+
import type { AriaPopoverProps } from '@react-aria/overlays';
|
|
1
4
|
import { TestingAttributes } from './shared/test';
|
|
2
5
|
import { DOMAttributes, Modify, StyleProps } from './shared';
|
|
3
6
|
type PopoverPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
@@ -22,4 +25,19 @@ export interface PopoverContainerProps extends StylePropsExtended, DOMAttributes
|
|
|
22
25
|
export interface PopoverWrapperProps extends PopoverContainerProps {
|
|
23
26
|
isOpen?: boolean;
|
|
24
27
|
}
|
|
28
|
+
export interface PopoverProps extends Omit<AriaPopoverProps, 'popoverRef'> {
|
|
29
|
+
children?: React.ReactNode;
|
|
30
|
+
state: OverlayTriggerState;
|
|
31
|
+
direction?: PopoverPlacement;
|
|
32
|
+
className?: string;
|
|
33
|
+
popoverRef?: React.RefObject<HTMLDivElement>;
|
|
34
|
+
style?: React.CSSProperties;
|
|
35
|
+
width?: string | number;
|
|
36
|
+
'data-testid'?: string;
|
|
37
|
+
hasNoArrow?: boolean;
|
|
38
|
+
arrowProps?: PopoverArrowProps;
|
|
39
|
+
arrowCrossOffset?: string;
|
|
40
|
+
isDismissable?: boolean;
|
|
41
|
+
role?: string;
|
|
42
|
+
}
|
|
25
43
|
export {};
|
|
@@ -356,6 +356,7 @@ var universalFieldComponentTests = function universalFieldComponentTests(_ref3)
|
|
|
356
356
|
}
|
|
357
357
|
});
|
|
358
358
|
_react2.fireEvent.submit(_react2.screen.getByRole('form', {
|
|
359
|
+
hidden: true,
|
|
359
360
|
name: /test form 2/i
|
|
360
361
|
}));
|
|
361
362
|
expect(handleFormSubmit).toHaveBeenCalledWith({
|
|
@@ -376,6 +377,7 @@ var universalFieldComponentTests = function universalFieldComponentTests(_ref3)
|
|
|
376
377
|
}
|
|
377
378
|
});
|
|
378
379
|
_react2.fireEvent.submit(_react2.screen.getByRole('form', {
|
|
380
|
+
hidden: true,
|
|
379
381
|
name: /test form 2/i
|
|
380
382
|
}));
|
|
381
383
|
expect(handleFormSubmit).toHaveBeenCalledWith({
|
|
@@ -426,6 +428,7 @@ var universalFieldComponentTests = function universalFieldComponentTests(_ref3)
|
|
|
426
428
|
});
|
|
427
429
|
}
|
|
428
430
|
_react2.fireEvent.submit(_react2.screen.getByRole('form', {
|
|
431
|
+
hidden: true,
|
|
429
432
|
name: /test form 2/i
|
|
430
433
|
}));
|
|
431
434
|
expect(handleFormSubmit).toHaveBeenCalledWith({
|
|
@@ -51,6 +51,7 @@ var multivaluesBadge = _objectSpread(_objectSpread({}, baseBadge), {}, {
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
var selectedItemBadge = _objectSpread(_objectSpread({}, multivaluesBadge), {}, {
|
|
54
|
+
bg: '#4462ED !important',
|
|
54
55
|
py: 3,
|
|
55
56
|
pr: 0,
|
|
56
57
|
my: 3
|
|
@@ -63,12 +64,15 @@ var readOnlyBadge = _objectSpread(_objectSpread({}, multivaluesBadge), {}, {
|
|
|
63
64
|
var itemBadgeWithSlot = _objectSpread(_objectSpread({}, readOnlyBadge), {}, {
|
|
64
65
|
p: 3,
|
|
65
66
|
my: 0,
|
|
66
|
-
|
|
67
|
+
bg: 'white !important',
|
|
67
68
|
'& span': {
|
|
68
69
|
color: 'text.primary',
|
|
69
70
|
mr: '2px',
|
|
70
71
|
lineHeight: '16px'
|
|
71
72
|
},
|
|
73
|
+
'& svg': {
|
|
74
|
+
fill: 'neutral.10'
|
|
75
|
+
},
|
|
72
76
|
maxHeight: '22px'
|
|
73
77
|
});
|
|
74
78
|
var environmentBadge = _objectSpread(_objectSpread({}, baseBadge), {}, {
|
|
@@ -105,7 +109,7 @@ export var badgeDeleteButton = _objectSpread(_objectSpread({}, deleteButton), {}
|
|
|
105
109
|
}
|
|
106
110
|
},
|
|
107
111
|
'&.is-pressed': {
|
|
108
|
-
|
|
112
|
+
path: {
|
|
109
113
|
fill: 'white'
|
|
110
114
|
},
|
|
111
115
|
bg: '#4462ED !important'
|
|
@@ -363,7 +363,9 @@ test('should show the menu if label clicked when preview image exists', /*#__PUR
|
|
|
363
363
|
// Click on the image preview button
|
|
364
364
|
imageUploadLabel = screen.getByText(testLabel);
|
|
365
365
|
fireEvent.click(imageUploadLabel);
|
|
366
|
-
expect(screen.getAllByRole('button'
|
|
366
|
+
expect(screen.getAllByRole('button', {
|
|
367
|
+
hidden: true
|
|
368
|
+
})[0]).toHaveAttribute('aria-expanded', 'true');
|
|
367
369
|
expect(screen.getByRole('menu')).toBeInTheDocument();
|
|
368
370
|
expect(screen.getByText('Upload New Image')).toBeInTheDocument();
|
|
369
371
|
expect(screen.getByText('Remove Image')).toBeInTheDocument();
|
|
@@ -125,19 +125,23 @@ var Option = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
125
125
|
onPointerOver: setFocusOnHover
|
|
126
126
|
}, theseOptionProps, others, {
|
|
127
127
|
"aria-label": ariaLabel
|
|
128
|
-
}), isCondensed ? ___EmotionJSX(
|
|
128
|
+
}), isCondensed ? ___EmotionJSX(Box, {
|
|
129
|
+
isRow: true,
|
|
130
|
+
alignItems: "center",
|
|
131
|
+
flex: "1"
|
|
132
|
+
}, ___EmotionJSX(Icon, {
|
|
129
133
|
icon: isSelected ? CheckedIcon : UncheckedIcon,
|
|
130
134
|
color: "active",
|
|
131
135
|
size: "24px",
|
|
132
136
|
mr: "xs",
|
|
133
137
|
className: classNames,
|
|
134
138
|
variant: "listBox.checkboxIcon"
|
|
135
|
-
}) : isSelected && !isOnyx && shouldShowSelectedOption && ___EmotionJSX(Icon, {
|
|
139
|
+
}), rendered) : ___EmotionJSX(React.Fragment, null, isSelected && !isOnyx && shouldShowSelectedOption && ___EmotionJSX(Icon, {
|
|
136
140
|
icon: CircleSmallIcon,
|
|
137
141
|
title: {
|
|
138
142
|
name: 'Circle Small Icon'
|
|
139
143
|
}
|
|
140
|
-
}), rendered, isSelected && isOnyx && shouldShowSelectedOption && ___EmotionJSX(Icon, {
|
|
144
|
+
}), rendered), isSelected && isOnyx && shouldShowSelectedOption && ___EmotionJSX(Icon, {
|
|
141
145
|
icon: CheckIcon,
|
|
142
146
|
title: {
|
|
143
147
|
name: 'Check Icon'
|
|
@@ -4,7 +4,7 @@ import React, { useState } from 'react';
|
|
|
4
4
|
import { withDesign } from 'storybook-addon-designs';
|
|
5
5
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
6
6
|
import { useModalState } from '../../hooks';
|
|
7
|
-
import { Box, Button, Item, Modal, OverlayProvider, RadioField, RadioGroupField, SearchField, SelectField, Text } from '../../index';
|
|
7
|
+
import { Box, Button, Item, Menu, Modal, OverlayProvider, PopoverMenu, RadioField, RadioGroupField, SearchField, SelectField, Text } from '../../index';
|
|
8
8
|
import { FIGMA_LINKS } from '../../utils/designUtils/figmaLinks';
|
|
9
9
|
import { modalSizes } from '../../utils/devUtils/constants/modalSizes';
|
|
10
10
|
import ModalReadme from './Modal.mdx';
|
|
@@ -231,6 +231,31 @@ export var WithInputField = function WithInputField() {
|
|
|
231
231
|
"aria-label": "Cancel"
|
|
232
232
|
}, "Cancel")))));
|
|
233
233
|
};
|
|
234
|
+
export var WithPopoverMenu = function WithPopoverMenu() {
|
|
235
|
+
var state = useModalState();
|
|
236
|
+
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
|
|
237
|
+
onPress: state.open,
|
|
238
|
+
"aria-label": "Open modal"
|
|
239
|
+
}, "Open Modal"), state.isOpen && ___EmotionJSX(Modal, {
|
|
240
|
+
isOpen: state.isOpen,
|
|
241
|
+
onClose: state.close
|
|
242
|
+
}, ___EmotionJSX(Box, {
|
|
243
|
+
gap: "lg"
|
|
244
|
+
}, ___EmotionJSX(Text, null, "Lorem ipsum dolor sit amet consectetur"), ___EmotionJSX(PopoverMenu, null, ___EmotionJSX(Button, null, "Click me"), ___EmotionJSX(Menu, {
|
|
245
|
+
onAction: function onAction() {
|
|
246
|
+
return console.log('on action');
|
|
247
|
+
}
|
|
248
|
+
}, ___EmotionJSX(Item, {
|
|
249
|
+
key: "edit"
|
|
250
|
+
}, "Edit"), ___EmotionJSX(Item, {
|
|
251
|
+
key: "duplicate"
|
|
252
|
+
}, "Duplicate"), ___EmotionJSX(Item, {
|
|
253
|
+
key: "delete",
|
|
254
|
+
textValue: "delete"
|
|
255
|
+
}, ___EmotionJSX(Text, {
|
|
256
|
+
color: "critical.bright"
|
|
257
|
+
}, "Delete")))))));
|
|
258
|
+
};
|
|
234
259
|
WithInputField.parameters = {
|
|
235
260
|
a11y: {
|
|
236
261
|
config: {
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
|
2
|
+
import _Symbol from "@babel/runtime-corejs3/core-js-stable/symbol";
|
|
3
|
+
import _Object$create from "@babel/runtime-corejs3/core-js-stable/object/create";
|
|
4
|
+
import _Object$getPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/get-prototype-of";
|
|
5
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
|
6
|
+
import _Object$setPrototypeOf from "@babel/runtime-corejs3/core-js-stable/object/set-prototype-of";
|
|
7
|
+
import _Promise from "@babel/runtime-corejs3/core-js-stable/promise";
|
|
8
|
+
import _reverseInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/reverse";
|
|
9
|
+
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
10
|
+
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
|
11
|
+
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
|
12
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = _Object$defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof _Symbol ? _Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return _Object$defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = _Object$create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = _Object$getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(IteratorPrototype); function defineIteratorMethods(prototype) { var _context2; _forEachInstanceProperty(_context2 = ["next", "throw", "return"]).call(_context2, function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], _forEachInstanceProperty(tryLocsList).call(tryLocsList, pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return _Object$setPrototypeOf ? _Object$setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = _Object$create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = _Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return _reverseInstanceProperty(keys).call(keys), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { var _context3; if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, _forEachInstanceProperty(_context3 = this.tryEntries).call(_context3, resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+_sliceInstanceProperty(name).call(name, 1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
1
13
|
import React from 'react';
|
|
2
14
|
import userEvent from '@testing-library/user-event';
|
|
3
|
-
import { Modal, OverlayProvider, RadioField, RadioGroupField } from '../../../index';
|
|
15
|
+
import { Button, Item, Menu, Modal, OverlayProvider, PopoverMenu, RadioField, RadioGroupField, Text } from '../../../index';
|
|
4
16
|
import { render, screen } from '../../../utils/testUtils/testWrapper';
|
|
5
17
|
import { universalComponentTests } from '../../../utils/testUtils/universalComponentTest';
|
|
6
18
|
|
|
@@ -26,6 +38,24 @@ var getModalWithRadioFieldGroup = function getModalWithRadioFieldGroup() {
|
|
|
26
38
|
"data-testid": "option2"
|
|
27
39
|
})))));
|
|
28
40
|
};
|
|
41
|
+
var buttonText = 'Click me';
|
|
42
|
+
var onAction = jest.fn();
|
|
43
|
+
var option1 = 'option1';
|
|
44
|
+
var getModalWithPopoverMenu = function getModalWithPopoverMenu() {
|
|
45
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
46
|
+
return render(___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Modal, props, ___EmotionJSX(PopoverMenu, null, ___EmotionJSX(Button, null, buttonText), ___EmotionJSX(Menu, {
|
|
47
|
+
onAction: onAction
|
|
48
|
+
}, ___EmotionJSX(Item, {
|
|
49
|
+
key: "edit"
|
|
50
|
+
}, option1), ___EmotionJSX(Item, {
|
|
51
|
+
key: "duplicate"
|
|
52
|
+
}, "Duplicate"), ___EmotionJSX(Item, {
|
|
53
|
+
key: "delete",
|
|
54
|
+
textValue: "delete"
|
|
55
|
+
}, ___EmotionJSX(Text, {
|
|
56
|
+
color: "critical.bright"
|
|
57
|
+
}, "Delete")))))));
|
|
58
|
+
};
|
|
29
59
|
|
|
30
60
|
// **********
|
|
31
61
|
// Unit tests
|
|
@@ -250,4 +280,24 @@ test('should not show focus ring (is-focused class) on radio buttons when clicke
|
|
|
250
280
|
expect(radioB).toBeChecked();
|
|
251
281
|
expect(labelA).not.toHaveClass('is-focused');
|
|
252
282
|
expect(labelB).not.toHaveClass('is-focused');
|
|
253
|
-
});
|
|
283
|
+
});
|
|
284
|
+
test('popover menu onAction is called when menu is inside modal', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
285
|
+
var button, option1Text;
|
|
286
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
287
|
+
while (1) switch (_context.prev = _context.next) {
|
|
288
|
+
case 0:
|
|
289
|
+
getModalWithPopoverMenu();
|
|
290
|
+
button = screen.getByText(buttonText);
|
|
291
|
+
userEvent.click(button);
|
|
292
|
+
_context.next = 5;
|
|
293
|
+
return screen.findByText(option1);
|
|
294
|
+
case 5:
|
|
295
|
+
option1Text = _context.sent;
|
|
296
|
+
userEvent.click(option1Text);
|
|
297
|
+
expect(onAction).toHaveBeenCalled();
|
|
298
|
+
case 8:
|
|
299
|
+
case "end":
|
|
300
|
+
return _context.stop();
|
|
301
|
+
}
|
|
302
|
+
}, _callee);
|
|
303
|
+
})));
|
|
@@ -402,7 +402,6 @@ var DefaultMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
402
402
|
}, ___EmotionJSX(Badge, _extends({
|
|
403
403
|
key: item.key,
|
|
404
404
|
role: "presentation",
|
|
405
|
-
bg: "active",
|
|
406
405
|
variant: "selectedItemBadge",
|
|
407
406
|
label: item.name,
|
|
408
407
|
slots: item.slots
|
|
@@ -13,8 +13,8 @@ import _reverseInstanceProperty from "@babel/runtime-corejs3/core-js-stable/inst
|
|
|
13
13
|
import _sliceInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/slice";
|
|
14
14
|
import _typeof from "@babel/runtime-corejs3/helpers/esm/typeof";
|
|
15
15
|
import _asyncToGenerator from "@babel/runtime-corejs3/helpers/esm/asyncToGenerator";
|
|
16
|
-
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
17
16
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
17
|
+
import _slicedToArray from "@babel/runtime-corejs3/helpers/esm/slicedToArray";
|
|
18
18
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
19
19
|
import _Array$from from "@babel/runtime-corejs3/core-js-stable/array/from";
|
|
20
20
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
|
@@ -27,6 +27,7 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
27
27
|
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; }
|
|
28
28
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context14, _context15; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context14 = ownKeys(Object(source), !0)).call(_context14, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context15 = ownKeys(Object(source))).call(_context15, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29
29
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
30
|
+
import PlusCircleMultipleOutlineIcon from '@pingux/mdi-react/PlusCircleMultipleOutlineIcon';
|
|
30
31
|
import { useFilter } from '@react-aria/i18n';
|
|
31
32
|
import DocsLayout from '../../../.storybook/storybookDocsLayout';
|
|
32
33
|
import { getAllUsers } from '../../api/users';
|
|
@@ -107,99 +108,6 @@ export default {
|
|
|
107
108
|
}
|
|
108
109
|
}
|
|
109
110
|
};
|
|
110
|
-
var VariableIcon = function VariableIcon(props) {
|
|
111
|
-
return ___EmotionJSX("svg", _extends({
|
|
112
|
-
width: "16",
|
|
113
|
-
height: "16",
|
|
114
|
-
viewBox: "0 0 16 16",
|
|
115
|
-
fill: "none",
|
|
116
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
117
|
-
"aria-labelledby": "variable-icon-title"
|
|
118
|
-
}, props), ___EmotionJSX("title", {
|
|
119
|
-
id: "variable-icon-title"
|
|
120
|
-
}, "Variable Icon"), ___EmotionJSX("g", {
|
|
121
|
-
clipPath: "url(#clip0_709_18965)"
|
|
122
|
-
}, ___EmotionJSX("circle", {
|
|
123
|
-
cx: "8",
|
|
124
|
-
cy: "8",
|
|
125
|
-
r: "7.5",
|
|
126
|
-
fill: "white",
|
|
127
|
-
stroke: "#7AC7F2"
|
|
128
|
-
}), ___EmotionJSX("path", {
|
|
129
|
-
d: "M11.5042 4.25C12.0833 5.37917 12.3125 6.68333 12.1667 8C12.0833 9.31667 11.625 10.6208 10.8458 11.75L10.2083 11.3333C10.8792 10.3208 11.2708 9.16667 11.3333 8C11.475 6.83333 11.2875 5.67917 10.7917 4.66667L11.5042 4.25ZM5.15416 4.25L5.79166 4.66667C5.12083 5.67917 4.72916 6.83333 4.66666 8C4.525 9.16667 4.71666 10.3208 5.20833 11.3333L4.50416 11.75C3.92083 10.6208 3.6875 9.32083 3.83333 8C3.91666 6.68333 4.375 5.37917 5.15416 4.25ZM8.03333 7.45L9 6.10417H10.0542L8.47916 8.1875L9.39583 10.2375H8.45416L7.87916 8.83333L6.86666 10.2208H5.81666L7.44166 8.0875L6.55416 6.10417H7.5L8.03333 7.45Z",
|
|
130
|
-
fill: "#7AC7F2"
|
|
131
|
-
})), ___EmotionJSX("defs", null, ___EmotionJSX("clipPath", {
|
|
132
|
-
id: "clip0_709_18965"
|
|
133
|
-
}, ___EmotionJSX("rect", {
|
|
134
|
-
width: "16",
|
|
135
|
-
height: "16",
|
|
136
|
-
fill: "white"
|
|
137
|
-
}))));
|
|
138
|
-
};
|
|
139
|
-
var HTMLIcon = function HTMLIcon(props) {
|
|
140
|
-
return ___EmotionJSX("svg", _extends({
|
|
141
|
-
width: "16",
|
|
142
|
-
height: "16",
|
|
143
|
-
viewBox: "0 0 16 16",
|
|
144
|
-
fill: "none",
|
|
145
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
146
|
-
"aria-labelledby": "html-icon-title"
|
|
147
|
-
}, props), ___EmotionJSX("title", {
|
|
148
|
-
id: "html-icon-title"
|
|
149
|
-
}, "HTML Icon"), ___EmotionJSX("g", {
|
|
150
|
-
clipPath: "url(#clip0_709_18936)"
|
|
151
|
-
}, ___EmotionJSX("circle", {
|
|
152
|
-
cx: "8",
|
|
153
|
-
cy: "8",
|
|
154
|
-
r: "7.5",
|
|
155
|
-
fill: "white",
|
|
156
|
-
stroke: "#2E5EA6"
|
|
157
|
-
}), ___EmotionJSX("g", {
|
|
158
|
-
clipPath: "url(#clip1_709_18936)"
|
|
159
|
-
}, ___EmotionJSX("path", {
|
|
160
|
-
d: "M9.81667 8.83325C9.85 8.55825 9.875 8.28325 9.875 7.99992C9.875 7.71659 9.85 7.44159 9.81667 7.16659H11.225C11.2917 7.43325 11.3333 7.71242 11.3333 7.99992C11.3333 8.28742 11.2917 8.56659 11.225 8.83325H9.81667ZM9.07917 11.1499C9.32917 10.6874 9.52084 10.1874 9.65417 9.66659H10.8833C10.4833 10.3541 9.84584 10.8874 9.07917 11.1499ZM8.975 8.83325H7.025C6.98334 8.55825 6.95834 8.28325 6.95834 7.99992C6.95834 7.71659 6.98334 7.43742 7.025 7.16659H8.975C9.0125 7.43742 9.04167 7.71659 9.04167 7.99992C9.04167 8.28325 9.0125 8.55825 8.975 8.83325ZM8 11.3166C7.65417 10.8166 7.375 10.2624 7.20417 9.66659H8.79584C8.625 10.2624 8.34584 10.8166 8 11.3166ZM6.33334 6.33325H5.11667C5.5125 5.64159 6.15417 5.10825 6.91667 4.84992C6.66667 5.31242 6.47917 5.81242 6.33334 6.33325ZM5.11667 9.66659H6.33334C6.47917 10.1874 6.66667 10.6874 6.91667 11.1499C6.15417 10.8874 5.5125 10.3541 5.11667 9.66659ZM4.775 8.83325C4.70834 8.56659 4.66667 8.28742 4.66667 7.99992C4.66667 7.71242 4.70834 7.43325 4.775 7.16659H6.18334C6.15 7.44159 6.125 7.71659 6.125 7.99992C6.125 8.28325 6.15 8.55825 6.18334 8.83325H4.775ZM8 4.67909C8.34584 5.17909 8.625 5.73742 8.79584 6.33325H7.20417C7.375 5.73742 7.65417 5.17909 8 4.67909ZM10.8833 6.33325H9.65417C9.52084 5.81242 9.32917 5.31242 9.07917 4.84992C9.84584 5.11242 10.4833 5.64159 10.8833 6.33325ZM8 3.83325C5.69584 3.83325 3.83334 5.70825 3.83334 7.99992C3.83334 9.10499 4.27232 10.1648 5.05372 10.9462C5.44064 11.3331 5.89996 11.64 6.40549 11.8494C6.91101 12.0588 7.45283 12.1666 8 12.1666C9.10507 12.1666 10.1649 11.7276 10.9463 10.9462C11.7277 10.1648 12.1667 9.10499 12.1667 7.99992C12.1667 7.45274 12.0589 6.91093 11.8495 6.4054C11.6401 5.89988 11.3332 5.44055 10.9463 5.05364C10.5594 4.66673 10.1 4.35982 9.59452 4.15042C9.08899 3.94103 8.54718 3.83325 8 3.83325Z",
|
|
161
|
-
fill: "#4660A2"
|
|
162
|
-
}))), ___EmotionJSX("g", {
|
|
163
|
-
clipPath: "url(#clip2_709_18936)"
|
|
164
|
-
}, ___EmotionJSX("circle", {
|
|
165
|
-
cx: "8",
|
|
166
|
-
cy: "8",
|
|
167
|
-
r: "7.5",
|
|
168
|
-
fill: "white",
|
|
169
|
-
stroke: "#2E5EA6"
|
|
170
|
-
}), ___EmotionJSX("g", {
|
|
171
|
-
clipPath: "url(#clip3_709_18936)"
|
|
172
|
-
}, ___EmotionJSX("path", {
|
|
173
|
-
d: "M9.81667 8.83325C9.85 8.55825 9.875 8.28325 9.875 7.99992C9.875 7.71659 9.85 7.44159 9.81667 7.16659H11.225C11.2917 7.43325 11.3333 7.71242 11.3333 7.99992C11.3333 8.28742 11.2917 8.56659 11.225 8.83325H9.81667ZM9.07917 11.1499C9.32917 10.6874 9.52084 10.1874 9.65417 9.66659H10.8833C10.4833 10.3541 9.84584 10.8874 9.07917 11.1499ZM8.975 8.83325H7.025C6.98334 8.55825 6.95834 8.28325 6.95834 7.99992C6.95834 7.71659 6.98334 7.43742 7.025 7.16659H8.975C9.0125 7.43742 9.04167 7.71659 9.04167 7.99992C9.04167 8.28325 9.0125 8.55825 8.975 8.83325ZM8 11.3166C7.65417 10.8166 7.375 10.2624 7.20417 9.66659H8.79584C8.625 10.2624 8.34584 10.8166 8 11.3166ZM6.33334 6.33325H5.11667C5.5125 5.64159 6.15417 5.10825 6.91667 4.84992C6.66667 5.31242 6.47917 5.81242 6.33334 6.33325ZM5.11667 9.66659H6.33334C6.47917 10.1874 6.66667 10.6874 6.91667 11.1499C6.15417 10.8874 5.5125 10.3541 5.11667 9.66659ZM4.775 8.83325C4.70834 8.56659 4.66667 8.28742 4.66667 7.99992C4.66667 7.71242 4.70834 7.43325 4.775 7.16659H6.18334C6.15 7.44159 6.125 7.71659 6.125 7.99992C6.125 8.28325 6.15 8.55825 6.18334 8.83325H4.775ZM8 4.67909C8.34584 5.17909 8.625 5.73742 8.79584 6.33325H7.20417C7.375 5.73742 7.65417 5.17909 8 4.67909ZM10.8833 6.33325H9.65417C9.52084 5.81242 9.32917 5.31242 9.07917 4.84992C9.84584 5.11242 10.4833 5.64159 10.8833 6.33325ZM8 3.83325C5.69584 3.83325 3.83334 5.70825 3.83334 7.99992C3.83334 9.10499 4.27232 10.1648 5.05372 10.9462C5.44064 11.3331 5.89996 11.64 6.40549 11.8494C6.91101 12.0588 7.45283 12.1666 8 12.1666C9.10507 12.1666 10.1649 11.7276 10.9463 10.9462C11.7277 10.1648 12.1667 9.10499 12.1667 7.99992C12.1667 7.45274 12.0589 6.91093 11.8495 6.4054C11.6401 5.89988 11.3332 5.44055 10.9463 5.05364C10.5594 4.66673 10.1 4.35982 9.59452 4.15042C9.08899 3.94103 8.54718 3.83325 8 3.83325Z",
|
|
174
|
-
fill: "#4660A2"
|
|
175
|
-
}))), ___EmotionJSX("defs", null, ___EmotionJSX("clipPath", {
|
|
176
|
-
className: "clip0_709_18936"
|
|
177
|
-
}, ___EmotionJSX("rect", {
|
|
178
|
-
width: "16",
|
|
179
|
-
height: "16",
|
|
180
|
-
fill: "white"
|
|
181
|
-
})), ___EmotionJSX("clipPath", {
|
|
182
|
-
className: "clip1_709_18936"
|
|
183
|
-
}, ___EmotionJSX("rect", {
|
|
184
|
-
width: "10",
|
|
185
|
-
height: "10",
|
|
186
|
-
fill: "white",
|
|
187
|
-
transform: "translate(3 3)"
|
|
188
|
-
})), ___EmotionJSX("clipPath", {
|
|
189
|
-
className: "clip2_709_18936"
|
|
190
|
-
}, ___EmotionJSX("rect", {
|
|
191
|
-
width: "16",
|
|
192
|
-
height: "16",
|
|
193
|
-
fill: "white"
|
|
194
|
-
})), ___EmotionJSX("clipPath", {
|
|
195
|
-
className: "clip3_709_18936"
|
|
196
|
-
}, ___EmotionJSX("rect", {
|
|
197
|
-
width: "10",
|
|
198
|
-
height: "10",
|
|
199
|
-
fill: "white",
|
|
200
|
-
transform: "translate(3 3)"
|
|
201
|
-
}))));
|
|
202
|
-
};
|
|
203
111
|
var items = [{
|
|
204
112
|
id: 1,
|
|
205
113
|
name: 'Aardvark',
|
|
@@ -296,15 +204,14 @@ var itemsWithSlots = [{
|
|
|
296
204
|
name: 'Aardvark',
|
|
297
205
|
key: 'Aardvark',
|
|
298
206
|
badgeProps: {
|
|
299
|
-
variant: 'itemBadgeWithSlot'
|
|
300
|
-
bg: 'white'
|
|
207
|
+
variant: 'itemBadgeWithSlot'
|
|
301
208
|
},
|
|
302
209
|
buttonProps: {
|
|
303
210
|
variant: 'badgeDeleteButton'
|
|
304
211
|
},
|
|
305
212
|
slots: {
|
|
306
213
|
leftIcon: ___EmotionJSX(Icon, {
|
|
307
|
-
icon:
|
|
214
|
+
icon: PlusCircleMultipleOutlineIcon,
|
|
308
215
|
size: 16
|
|
309
216
|
})
|
|
310
217
|
}
|
|
@@ -313,15 +220,14 @@ var itemsWithSlots = [{
|
|
|
313
220
|
name: 'Kangaroo',
|
|
314
221
|
key: 'Kangaroo',
|
|
315
222
|
badgeProps: {
|
|
316
|
-
variant: 'itemBadgeWithSlot'
|
|
317
|
-
bg: 'white'
|
|
223
|
+
variant: 'itemBadgeWithSlot'
|
|
318
224
|
},
|
|
319
225
|
buttonProps: {
|
|
320
226
|
variant: 'badgeDeleteButton'
|
|
321
227
|
},
|
|
322
228
|
slots: {
|
|
323
229
|
leftIcon: ___EmotionJSX(Icon, {
|
|
324
|
-
icon:
|
|
230
|
+
icon: PlusCircleMultipleOutlineIcon,
|
|
325
231
|
size: 16
|
|
326
232
|
})
|
|
327
233
|
}
|
|
@@ -330,15 +236,14 @@ var itemsWithSlots = [{
|
|
|
330
236
|
name: 'Snake',
|
|
331
237
|
key: 'Snake',
|
|
332
238
|
badgeProps: {
|
|
333
|
-
variant: 'itemBadgeWithSlot'
|
|
334
|
-
bg: 'white'
|
|
239
|
+
variant: 'itemBadgeWithSlot'
|
|
335
240
|
},
|
|
336
241
|
buttonProps: {
|
|
337
242
|
variant: 'badgeDeleteButton'
|
|
338
243
|
},
|
|
339
244
|
slots: {
|
|
340
245
|
leftIcon: ___EmotionJSX(Icon, {
|
|
341
|
-
icon:
|
|
246
|
+
icon: PlusCircleMultipleOutlineIcon,
|
|
342
247
|
size: 16
|
|
343
248
|
})
|
|
344
249
|
}
|
|
@@ -9,25 +9,31 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
|
9
9
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
10
10
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
11
11
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
|
12
|
-
var _excluded = ["popoverRef", "state", "children", "className", "isNonModal", "width"];
|
|
12
|
+
var _excluded = ["arrowProps", "arrowCrossOffset", "direction", "popoverRef", "state", "children", "className", "isNonModal", "hasNoArrow", "width"];
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
15
15
|
import * as React from 'react';
|
|
16
16
|
import { DismissButton, Overlay, usePopover } from '@react-aria/overlays';
|
|
17
17
|
import { useStatusClasses } from '../../hooks';
|
|
18
18
|
import Box from '../Box';
|
|
19
|
+
import { PopoverArrow } from '../PopoverContainer';
|
|
19
20
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
20
21
|
var Popover = function Popover(props) {
|
|
21
22
|
var ref = React.useRef(null);
|
|
22
|
-
var
|
|
23
|
+
var arrowProps = props.arrowProps,
|
|
24
|
+
arrowCrossOffset = props.arrowCrossOffset,
|
|
25
|
+
direction = props.direction,
|
|
26
|
+
_props$popoverRef = props.popoverRef,
|
|
23
27
|
popoverRef = _props$popoverRef === void 0 ? ref : _props$popoverRef,
|
|
24
28
|
state = props.state,
|
|
25
29
|
children = props.children,
|
|
26
30
|
className = props.className,
|
|
27
31
|
isNonModal = props.isNonModal,
|
|
32
|
+
hasNoArrow = props.hasNoArrow,
|
|
28
33
|
width = props.width,
|
|
29
34
|
others = _objectWithoutProperties(props, _excluded);
|
|
30
35
|
var _usePopover = usePopover(_objectSpread(_objectSpread({}, props), {}, {
|
|
36
|
+
offset: 5,
|
|
31
37
|
popoverRef: popoverRef
|
|
32
38
|
}), state),
|
|
33
39
|
popoverProps = _usePopover.popoverProps,
|
|
@@ -46,9 +52,10 @@ var Popover = function Popover(props) {
|
|
|
46
52
|
className: classNames,
|
|
47
53
|
role: "presentation",
|
|
48
54
|
width: width
|
|
49
|
-
}, popoverProps, others),
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
}, popoverProps, others), children, hasNoArrow ? null : ___EmotionJSX(PopoverArrow, _extends({}, arrowProps, {
|
|
56
|
+
arrowCrossOffset: arrowCrossOffset,
|
|
57
|
+
direction: direction
|
|
58
|
+
})), ___EmotionJSX(DismissButton, {
|
|
52
59
|
onDismiss: state.close
|
|
53
60
|
})));
|
|
54
61
|
};
|