@pingux/astro 1.0.0-alpha.9 → 1.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +257 -0
- package/README.md +5 -0
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.stories.js +4 -11
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +24 -0
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemBody.js +1 -1
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemHeader.js +1 -1
- package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +33 -1
- package/lib/cjs/components/AccordionItem/AccordionItem.js +5 -4
- package/lib/cjs/components/Button/Button.js +6 -26
- package/lib/cjs/components/Button/Button.stories.js +7 -12
- package/lib/cjs/components/Button/Button.test.js +2 -25
- package/lib/cjs/components/Chip/Chip.js +26 -10
- package/lib/cjs/components/Chip/Chip.stories.js +44 -5
- package/lib/cjs/components/Chip/Chip.test.js +9 -0
- package/lib/cjs/components/{DropdownField/index.js → Chip/ChipContext.js} +8 -7
- package/lib/cjs/components/ColorField/ColorField.js +1 -0
- package/lib/cjs/components/ComboBoxField/ComboBoxField.js +7 -0
- package/lib/cjs/components/ComboBoxField/ComboBoxField.stories.js +25 -1
- package/lib/cjs/components/ComboBoxField/ComboBoxField.test.js +44 -0
- package/lib/cjs/components/FileInputField/FileItem.js +2 -1
- package/lib/cjs/components/IconButton/IconButton.js +17 -7
- package/lib/cjs/components/IconButton/IconButton.stories.js +8 -17
- package/lib/cjs/components/IconButton/IconButton.test.js +4 -6
- package/lib/cjs/components/ImageUploadField/ImagePreviewButton.js +2 -1
- package/lib/cjs/components/List/List.js +3 -0
- package/lib/cjs/components/List/List.stories.js +7 -2
- package/lib/cjs/components/ListBox/ListBox.js +3 -6
- package/lib/cjs/components/ListBox/ListBox.test.js +2 -0
- package/lib/cjs/components/ListBox/Option.js +6 -0
- package/lib/cjs/components/ListItem/ListItem.stories.js +0 -2
- package/lib/cjs/components/ListView/ListView.js +4 -3
- package/lib/cjs/components/ListView/ListView.stories.js +580 -39
- package/lib/cjs/components/ListViewItem/ListViewItem.js +3 -6
- package/lib/cjs/components/Messages/Message.js +2 -2
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +3 -2
- package/lib/cjs/components/OverlayPanel/OverlayPanel.stories.js +15 -14
- package/lib/cjs/components/PopoverContainer/PopoverContainer.test.js +15 -0
- package/lib/cjs/components/Stepper/Stepper.js +1 -0
- package/lib/cjs/components/Tab/Tab.js +5 -3
- package/lib/cjs/components/Tabs/Tabs.js +3 -0
- package/lib/cjs/components/Tabs/Tabs.stories.js +3 -4
- package/lib/cjs/components/Tabs/Tabs.test.js +44 -15
- package/lib/cjs/components/TextArea/TextArea.js +5 -1
- package/lib/cjs/components/TextAreaField/TextAreaField.test.js +10 -0
- package/lib/cjs/components/TooltipTrigger/TooltipTrigger.stories.js +45 -2
- package/lib/cjs/index.js +48 -136
- package/lib/cjs/layouts/ListLayout.stories.js +2 -1
- package/lib/cjs/layouts/SchemaFormLayout.stories.js +2 -21
- package/lib/cjs/recipes/ArrayField.stories.js +3 -3
- package/lib/cjs/styles/forms/input.js +4 -0
- package/lib/cjs/styles/theme.js +0 -3
- package/lib/cjs/styles/variants/accordion.js +7 -9
- package/lib/cjs/styles/variants/boxes.js +22 -19
- package/lib/cjs/styles/variants/buttons.js +48 -29
- package/lib/cjs/styles/variants/variants.js +0 -3
- package/lib/components/AccordionGridGroup/AccordionGridGroup.stories.js +4 -11
- package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +23 -1
- package/lib/components/AccordionGridItem/AccordionGridItemBody.js +1 -1
- package/lib/components/AccordionGridItem/AccordionGridItemHeader.js +1 -1
- package/lib/components/AccordionGroup/AccordionGroup.test.js +30 -1
- package/lib/components/AccordionItem/AccordionItem.js +6 -5
- package/lib/components/Button/Button.js +8 -26
- package/lib/components/Button/Button.stories.js +7 -11
- package/lib/components/Button/Button.test.js +2 -21
- package/lib/components/Chip/Chip.js +25 -10
- package/lib/components/Chip/Chip.stories.js +41 -5
- package/lib/components/Chip/Chip.test.js +9 -0
- package/lib/components/Chip/ChipContext.js +3 -0
- package/lib/components/ColorField/ColorField.js +1 -0
- package/lib/components/ComboBoxField/ComboBoxField.js +7 -0
- package/lib/components/ComboBoxField/ComboBoxField.stories.js +21 -0
- package/lib/components/ComboBoxField/ComboBoxField.test.js +35 -0
- package/lib/components/FileInputField/FileItem.js +2 -1
- package/lib/components/IconButton/IconButton.js +17 -9
- package/lib/components/IconButton/IconButton.stories.js +7 -13
- package/lib/components/IconButton/IconButton.test.js +4 -6
- package/lib/components/ImageUploadField/ImagePreviewButton.js +2 -1
- package/lib/components/List/List.js +2 -0
- package/lib/components/List/List.stories.js +6 -2
- package/lib/components/ListBox/ListBox.js +3 -5
- package/lib/components/ListBox/ListBox.test.js +2 -0
- package/lib/components/ListBox/Option.js +6 -0
- package/lib/components/ListItem/ListItem.stories.js +0 -2
- package/lib/components/ListView/ListView.js +4 -3
- package/lib/components/ListView/ListView.stories.js +577 -39
- package/lib/components/ListViewItem/ListViewItem.js +3 -5
- package/lib/components/Messages/Message.js +2 -2
- package/lib/components/MultivaluesField/MultivaluesField.js +3 -2
- package/lib/components/OverlayPanel/OverlayPanel.stories.js +7 -5
- package/lib/components/PopoverContainer/PopoverContainer.test.js +16 -1
- package/lib/components/Stepper/Stepper.js +1 -0
- package/lib/components/Tab/Tab.js +5 -3
- package/lib/components/Tabs/Tabs.js +3 -0
- package/lib/components/Tabs/Tabs.stories.js +3 -4
- package/lib/components/Tabs/Tabs.test.js +40 -15
- package/lib/components/TextArea/TextArea.js +5 -1
- package/lib/components/TextAreaField/TextAreaField.test.js +8 -0
- package/lib/components/TooltipTrigger/TooltipTrigger.stories.js +33 -1
- package/lib/index.js +0 -8
- package/lib/layouts/ListLayout.stories.js +2 -1
- package/lib/layouts/SchemaFormLayout.stories.js +2 -19
- package/lib/recipes/ArrayField.stories.js +3 -3
- package/lib/styles/forms/input.js +4 -0
- package/lib/styles/theme.js +0 -3
- package/lib/styles/variants/accordion.js +7 -9
- package/lib/styles/variants/boxes.js +21 -19
- package/lib/styles/variants/buttons.js +47 -29
- package/lib/styles/variants/variants.js +0 -2
- package/package.json +1 -1
- package/lib/cjs/components/Dropdown/Dropdown.js +0 -112
- package/lib/cjs/components/Dropdown/Dropdown.test.js +0 -80
- package/lib/cjs/components/Dropdown/index.js +0 -18
- package/lib/cjs/components/DropdownField/DropdownField.js +0 -187
- package/lib/cjs/components/DropdownField/DropdownField.stories.js +0 -278
- package/lib/cjs/components/DropdownField/DropdownField.test.js +0 -80
- package/lib/cjs/components/Panel/Panel.js +0 -101
- package/lib/cjs/components/Panel/Panel.stories.js +0 -57
- package/lib/cjs/components/Panel/Panel.test.js +0 -72
- package/lib/cjs/components/Panel/index.js +0 -18
- package/lib/cjs/components/Popover/Popover.js +0 -87
- package/lib/cjs/components/Popover/Popover.stories.js +0 -80
- package/lib/cjs/components/Popover/Popover.test.js +0 -91
- package/lib/cjs/components/Popover/index.js +0 -18
- package/lib/cjs/recipes/InputBoxWithLinkedChip.stories.js +0 -67
- package/lib/cjs/styles/variants/popover.js +0 -86
- package/lib/components/Dropdown/Dropdown.js +0 -90
- package/lib/components/Dropdown/Dropdown.test.js +0 -62
- package/lib/components/Dropdown/index.js +0 -1
- package/lib/components/DropdownField/DropdownField.js +0 -155
- package/lib/components/DropdownField/DropdownField.stories.js +0 -222
- package/lib/components/DropdownField/DropdownField.test.js +0 -60
- package/lib/components/DropdownField/index.js +0 -1
- package/lib/components/Panel/Panel.js +0 -71
- package/lib/components/Panel/Panel.stories.js +0 -35
- package/lib/components/Panel/Panel.test.js +0 -52
- package/lib/components/Panel/index.js +0 -1
- package/lib/components/Popover/Popover.js +0 -65
- package/lib/components/Popover/Popover.stories.js +0 -52
- package/lib/components/Popover/Popover.test.js +0 -75
- package/lib/components/Popover/index.js +0 -2
- package/lib/recipes/InputBoxWithLinkedChip.stories.js +0 -43
- package/lib/styles/variants/popover.js +0 -76
@@ -337,7 +337,7 @@ var MultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
337
337
|
}, (0, _react2.jsx)(_.Icon, {
|
338
338
|
icon: _CloseIcon["default"],
|
339
339
|
color: "white",
|
340
|
-
size:
|
340
|
+
size: 14
|
341
341
|
})));
|
342
342
|
}
|
343
343
|
|
@@ -352,7 +352,8 @@ var MultivaluesField = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref)
|
|
352
352
|
hasAutoFocus: hasAutoFocus,
|
353
353
|
hasVirtualFocus: true,
|
354
354
|
hasNoEmptySelection: true,
|
355
|
-
state: state
|
355
|
+
state: state,
|
356
|
+
"aria-label": "List of options"
|
356
357
|
})), (0, _react2.jsx)(_overlays.DismissButton, {
|
357
358
|
onDismiss: close
|
358
359
|
}));
|
@@ -22,8 +22,6 @@ var _collections = require("@react-stately/collections");
|
|
22
22
|
|
23
23
|
var _hooks = require("../../hooks");
|
24
24
|
|
25
|
-
var _Button = _interopRequireDefault(require("../Button/Button"));
|
26
|
-
|
27
25
|
var _OverlayPanel = _interopRequireDefault(require("./OverlayPanel"));
|
28
26
|
|
29
27
|
var _index = require("../../index");
|
@@ -66,15 +64,18 @@ var Default = function Default(_ref) {
|
|
66
64
|
var state = (0, _hooks.useOverlayPanelState)();
|
67
65
|
return (// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
68
66
|
// readers when an overlay opens.
|
69
|
-
(0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Text, null, "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."), (0, _react2.jsx)("br", null), (0, _react2.jsx)(
|
67
|
+
(0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Text, null, "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."), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_index.Button, {
|
70
68
|
onPress: state.open
|
71
69
|
}, "Open Panel"), (0, _react2.jsx)(_OverlayPanel["default"], (0, _extends2["default"])({
|
72
70
|
isOpen: state.isOpen
|
73
|
-
}, args), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(
|
71
|
+
}, args), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Button, {
|
74
72
|
onPress: state.close
|
75
|
-
}, "Close Panel"), (0, _react2.jsx)(_index.
|
76
|
-
|
77
|
-
|
73
|
+
}, "Close Panel"), (0, _react2.jsx)(_index.AccordionGroup, args, (0, _react2.jsx)(_collections.Item, {
|
74
|
+
key: "accordionKey",
|
75
|
+
textValue: "accordionKey",
|
76
|
+
label: "Accordion Label",
|
77
|
+
"data-id": "accordionItem"
|
78
|
+
}, (0, _react2.jsx)(_index.Text, null, "Render me!"))))))
|
78
79
|
);
|
79
80
|
};
|
80
81
|
|
@@ -106,7 +107,7 @@ var InnerPanel = function InnerPanel(_ref2) {
|
|
106
107
|
variant: "overlayPanel.overlayPanelInner" // applies higher z-index
|
107
108
|
,
|
108
109
|
isOpen: innerState.isOpen
|
109
|
-
}, args), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(
|
110
|
+
}, args), (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Button, {
|
110
111
|
onPress: innerState.close
|
111
112
|
}, "Close Inner Panel"), (0, _react2.jsx)(_index.Text, {
|
112
113
|
pt: "md"
|
@@ -121,7 +122,7 @@ var InnerPanel = function InnerPanel(_ref2) {
|
|
121
122
|
sx: {
|
122
123
|
p: '12px'
|
123
124
|
}
|
124
|
-
}, (0, _react2.jsx)(
|
125
|
+
}, (0, _react2.jsx)(_index.Button, {
|
125
126
|
onPress: closeOuterPanel
|
126
127
|
}, "Close Panel"), (0, _react2.jsx)(_index.Text, {
|
127
128
|
pt: "md",
|
@@ -164,14 +165,14 @@ var InnerPanel = function InnerPanel(_ref2) {
|
|
164
165
|
mr: "auto"
|
165
166
|
}, "Form 5")), (0, _react2.jsx)(_index.Separator, {
|
166
167
|
margin: "0"
|
167
|
-
})), (0, _react2.jsx)("br", null), (0, _react2.jsx)(
|
168
|
+
})), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_index.Button, {
|
168
169
|
onPress: toggleMessagesOpen
|
169
|
-
}, "Toggle Messages"), (0, _react2.jsx)("br", null), (0, _react2.jsx)(
|
170
|
+
}, "Toggle Messages"), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_index.Button, {
|
170
171
|
onPress: innerState.open
|
171
172
|
}, "Open Inner Panel"), inner)));
|
172
173
|
return (// Application must be wrapped in an OverlayProvider so that it can be hidden from screen
|
173
174
|
// readers when an overlay opens.
|
174
|
-
(0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(
|
175
|
+
(0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
|
175
176
|
onPress: state.open
|
176
177
|
}, "Open Panel"), outer), messagesOpen && (0, _react2.jsx)(_index.Messages, {
|
177
178
|
sx: {
|
@@ -192,14 +193,14 @@ var CustomWidth = function CustomWidth() {
|
|
192
193
|
// readers when an overlay opens.
|
193
194
|
//
|
194
195
|
// For a custom width, provide the width via the 'sx' prop
|
195
|
-
(0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Text, null, "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."), (0, _react2.jsx)("br", null), (0, _react2.jsx)(
|
196
|
+
(0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Text, null, "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."), (0, _react2.jsx)("br", null), (0, _react2.jsx)(_index.Button, {
|
196
197
|
onPress: state.open
|
197
198
|
}, "Open Panel"), (0, _react2.jsx)(_OverlayPanel["default"], {
|
198
199
|
isOpen: state.isOpen,
|
199
200
|
sx: {
|
200
201
|
width: '720px'
|
201
202
|
}
|
202
|
-
}, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(
|
203
|
+
}, (0, _react2.jsx)(_index.Box, null, (0, _react2.jsx)(_index.Button, {
|
203
204
|
onPress: state.close
|
204
205
|
}, "Close Panel"), (0, _react2.jsx)(_index.Text, {
|
205
206
|
pt: "md"
|
@@ -17,6 +17,13 @@ var _react2 = require("@emotion/react");
|
|
17
17
|
var getComponent = function getComponent() {
|
18
18
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
19
19
|
return (0, _testWrapper.render)((0, _react2.jsx)(_react["default"].Fragment, null, (0, _react2.jsx)(_PopoverContainer["default"], props, (0, _react2.jsx)(_index.Box, null, "I am in a popover"))));
|
20
|
+
};
|
21
|
+
|
22
|
+
var getComponentInOverlayPanel = function getComponentInOverlayPanel() {
|
23
|
+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
24
|
+
return (0, _testWrapper.render)((0, _react2.jsx)(_index.OverlayPanel, {
|
25
|
+
isOpen: true
|
26
|
+
}, (0, _react2.jsx)(_PopoverContainer["default"], props, (0, _react2.jsx)(_index.Box, null, "I am in a popover"))));
|
20
27
|
}; // Need to be added to each test file to test accessibility using axe.
|
21
28
|
|
22
29
|
|
@@ -39,4 +46,12 @@ test('should render a popover with no arrow', function () {
|
|
39
46
|
var arrow = _testWrapper.screen.queryByTestId('popover-arrow');
|
40
47
|
|
41
48
|
expect(arrow).not.toBeInTheDocument();
|
49
|
+
});
|
50
|
+
test('popover will not open if wrapped in an overlayPanel', function () {
|
51
|
+
getComponentInOverlayPanel({
|
52
|
+
popoverProps: {
|
53
|
+
'data-test-id': 'popover-test'
|
54
|
+
}
|
55
|
+
});
|
56
|
+
expect(_testWrapper.screen.queryByTestId('popover-test')).not.toBeInTheDocument();
|
42
57
|
});
|
@@ -63,9 +63,10 @@ var CollectionTab = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
63
63
|
tabLabelProps = itemProps.tabLabelProps,
|
64
64
|
tabLineProps = itemProps.tabLineProps,
|
65
65
|
content = itemProps.content,
|
66
|
-
|
67
|
-
|
66
|
+
titleAttr = itemProps.titleAttr,
|
67
|
+
otherItemProps = (0, _objectWithoutProperties2["default"])(itemProps, ["icon", "isDisabled", "separator", "tabLabelProps", "tabLineProps", "content", "titleAttr"]);
|
68
68
|
var state = (0, _react.useContext)(_Tabs.TabsContext);
|
69
|
+
var isDisabled = tabsDisabled || tabDisabled || state.disabledKeys.has(key);
|
69
70
|
var isSelected = state.selectedKey === key;
|
70
71
|
|
71
72
|
var _useFocusRing = (0, _focus.useFocusRing)(),
|
@@ -106,7 +107,8 @@ var CollectionTab = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
106
107
|
className: classNames,
|
107
108
|
variant: "tab"
|
108
109
|
}, (0, _utils.mergeProps)(focusProps, hoverProps, tabProps), otherItemProps, {
|
109
|
-
ref: tabRef
|
110
|
+
ref: tabRef,
|
111
|
+
title: titleAttr || undefined
|
110
112
|
}), icon, (0, _react2.jsx)(_Text["default"], (0, _extends2["default"])({
|
111
113
|
variant: "tabLabel"
|
112
114
|
}, tabLabelProps), rendered), isSelected && !isDisabled && (0, _react2.jsx)(TabLine, tabLineProps)), slots === null || slots === void 0 ? void 0 : slots.afterTab);
|
@@ -126,6 +126,9 @@ Tabs.propTypes = {
|
|
126
126
|
/** The default tab key to be selected. (uncontrolled) */
|
127
127
|
defaultSelectedKey: _propTypes["default"].string,
|
128
128
|
|
129
|
+
/** Array of keys to disable within the tab list. */
|
130
|
+
disabledKeys: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
131
|
+
|
129
132
|
/** The tab key that is currently selected. (controlled) */
|
130
133
|
selectedKey: _propTypes["default"].string,
|
131
134
|
|
@@ -170,13 +170,12 @@ exports.Centered = Centered;
|
|
170
170
|
|
171
171
|
var DisabledSingleTab = function DisabledSingleTab() {
|
172
172
|
return (0, _react2.jsx)(_Tabs["default"], {
|
173
|
-
|
174
|
-
|
173
|
+
items: tabs,
|
174
|
+
disabledKeys: ['Tab 2']
|
175
175
|
}, function (item) {
|
176
176
|
return (0, _react2.jsx)(_Tab["default"], {
|
177
177
|
key: item.name,
|
178
|
-
title: item.name
|
179
|
-
isDisabled: item.name === 'Tab 1'
|
178
|
+
title: item.name
|
180
179
|
}, item.children);
|
181
180
|
});
|
182
181
|
};
|
@@ -257,6 +257,35 @@ test('disabled all tabs', function () {
|
|
257
257
|
expect(tab1).not.toContainElement(_testWrapper.screen.queryByRole('presentation'));
|
258
258
|
testTabPanel(0);
|
259
259
|
});
|
260
|
+
test('disabled tab is not accessible on click or focus', function () {
|
261
|
+
getComponent({
|
262
|
+
disabledKeys: [defaultTabs[1].name]
|
263
|
+
});
|
264
|
+
testTabPanel(0);
|
265
|
+
|
266
|
+
var _getTabs5 = getTabs(),
|
267
|
+
tabs = _getTabs5.tabs,
|
268
|
+
tab0 = _getTabs5.tab0,
|
269
|
+
tab1 = _getTabs5.tab1,
|
270
|
+
tab2 = _getTabs5.tab2; // Ensure that clicking a disabled tab does nothing
|
271
|
+
|
272
|
+
|
273
|
+
_userEvent["default"].click(tab1);
|
274
|
+
|
275
|
+
testTabPanel(0); // Ensure that disabled tab is not accessible via focus
|
276
|
+
|
277
|
+
_userEvent["default"].tab();
|
278
|
+
|
279
|
+
testSingleTab(tabs, tab0, 'toHaveFocus');
|
280
|
+
|
281
|
+
_testWrapper.fireEvent.keyDown(tab0, {
|
282
|
+
key: 'ArrowRight',
|
283
|
+
code: 'ArrowRight'
|
284
|
+
});
|
285
|
+
|
286
|
+
testSingleTab(tabs, tab2, 'toHaveFocus');
|
287
|
+
testTabPanel(2);
|
288
|
+
});
|
260
289
|
test('controlled tabs', function () {
|
261
290
|
var selectedKey = defaultTabs[1].name;
|
262
291
|
var onSelectionChange = jest.fn();
|
@@ -267,11 +296,11 @@ test('controlled tabs', function () {
|
|
267
296
|
}),
|
268
297
|
rerender = _getComponent.rerender;
|
269
298
|
|
270
|
-
var
|
271
|
-
tabs =
|
272
|
-
tab0 =
|
273
|
-
tab1 =
|
274
|
-
tab2 =
|
299
|
+
var _getTabs6 = getTabs(),
|
300
|
+
tabs = _getTabs6.tabs,
|
301
|
+
tab0 = _getTabs6.tab0,
|
302
|
+
tab1 = _getTabs6.tab1,
|
303
|
+
tab2 = _getTabs6.tab2; // Expect the second tab to be selected
|
275
304
|
|
276
305
|
|
277
306
|
expect(onSelectionChange).not.toHaveBeenCalled();
|
@@ -309,9 +338,9 @@ test('tab line props', function () {
|
|
309
338
|
}),
|
310
339
|
rerender = _getComponent2.rerender;
|
311
340
|
|
312
|
-
var
|
313
|
-
tabs =
|
314
|
-
tab0 =
|
341
|
+
var _getTabs7 = getTabs(),
|
342
|
+
tabs = _getTabs7.tabs,
|
343
|
+
tab0 = _getTabs7.tab0;
|
315
344
|
|
316
345
|
var tabLine = _testWrapper.screen.getByRole('presentation'); // Expect the tab line to have a red background
|
317
346
|
|
@@ -340,9 +369,9 @@ test('tab with icon', function () {
|
|
340
369
|
tabs: newTabs
|
341
370
|
});
|
342
371
|
|
343
|
-
var
|
344
|
-
tabs =
|
345
|
-
tab0 =
|
372
|
+
var _getTabs8 = getTabs(),
|
373
|
+
tabs = _getTabs8.tabs,
|
374
|
+
tab0 = _getTabs8.tab0;
|
346
375
|
|
347
376
|
var icon = _testWrapper.screen.getByTestId('icon'); // Expect the tab to have the given icon element
|
348
377
|
|
@@ -350,7 +379,7 @@ test('tab with icon', function () {
|
|
350
379
|
testSingleTab(tabs, tab0, 'toContainElement', [icon]);
|
351
380
|
});
|
352
381
|
test('tooltip renders on tab\'s hover in `tooltip` mode', /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
353
|
-
var
|
382
|
+
var _getTabs9, tab0;
|
354
383
|
|
355
384
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
356
385
|
while (1) {
|
@@ -360,7 +389,7 @@ test('tooltip renders on tab\'s hover in `tooltip` mode', /*#__PURE__*/(0, _asyn
|
|
360
389
|
mode: 'tooltip'
|
361
390
|
});
|
362
391
|
expect(_testWrapper.screen.queryByRole('tooltip')).not.toBeInTheDocument();
|
363
|
-
|
392
|
+
_getTabs9 = getTabs(), tab0 = _getTabs9.tab0;
|
364
393
|
|
365
394
|
_testWrapper.fireEvent.mouseMove(tab0);
|
366
395
|
|
@@ -386,8 +415,8 @@ test('tabs without selected keys show null tab panel content', function () {
|
|
386
415
|
test('hover tab style', function () {
|
387
416
|
getComponent();
|
388
417
|
|
389
|
-
var
|
390
|
-
tab0 =
|
418
|
+
var _getTabs10 = getTabs(),
|
419
|
+
tab0 = _getTabs10.tab0;
|
391
420
|
|
392
421
|
expect(tab0).not.toHaveClass('is-hovered');
|
393
422
|
|
@@ -29,7 +29,11 @@ var _react2 = require("@emotion/react");
|
|
29
29
|
*/
|
30
30
|
var TextArea = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
31
31
|
return (0, _react2.jsx)(_themeUi.Textarea, (0, _extends2["default"])({
|
32
|
-
ref: ref
|
32
|
+
ref: ref // this requires to fix safari resizing issue (UIP-4995)
|
33
|
+
,
|
34
|
+
sx: {
|
35
|
+
position: 'relative'
|
36
|
+
}
|
33
37
|
}, props));
|
34
38
|
});
|
35
39
|
TextArea.displayName = 'TextArea';
|
@@ -128,6 +128,16 @@ test('form wrapper will have default max label column width when no custom width
|
|
128
128
|
|
129
129
|
expect(textAreaContainer).toHaveStyle('grid-template-columns: 40% auto');
|
130
130
|
});
|
131
|
+
test('passing read only prop applys the is-read-only class to the textarea', function () {
|
132
|
+
var isReadOnly = true;
|
133
|
+
getComponent({
|
134
|
+
isReadOnly: isReadOnly
|
135
|
+
});
|
136
|
+
|
137
|
+
var textArea = _testWrapper.screen.getByLabelText(defaultProps.label);
|
138
|
+
|
139
|
+
expect(textArea).toHaveClass('is-read-only');
|
140
|
+
});
|
131
141
|
test('form wrapper will have a max label column width when custom width set', function () {
|
132
142
|
var labelMode = 'left';
|
133
143
|
var containerProps = {
|
@@ -8,16 +8,20 @@ _Object$defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
9
9
|
});
|
10
10
|
|
11
|
-
exports.Disabled = exports.isOpen = exports.withDelayProp = exports.withDirectionProp = exports.withAlignProp = exports.Default = exports["default"] = void 0;
|
11
|
+
exports.TextWithTooltip = exports.ChipWithTooltip = exports.IconWithTooltip = exports.Disabled = exports.isOpen = exports.withDelayProp = exports.withDirectionProp = exports.withAlignProp = exports.Default = exports["default"] = void 0;
|
12
12
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
14
14
|
|
15
15
|
var _EarthIcon = _interopRequireDefault(require("mdi-react/EarthIcon"));
|
16
16
|
|
17
|
+
var _PersonIcon = _interopRequireDefault(require("mdi-react/PersonIcon"));
|
18
|
+
|
17
19
|
var _index = require("../../index");
|
18
20
|
|
19
21
|
var _IconButton = _interopRequireDefault(require("../IconButton"));
|
20
22
|
|
23
|
+
var _Text = _interopRequireDefault(require("../Text"));
|
24
|
+
|
21
25
|
var _react2 = require("@emotion/react");
|
22
26
|
|
23
27
|
var _default = {
|
@@ -80,4 +84,43 @@ Disabled.parameters = {
|
|
80
84
|
story: 'The tooltip can be disabled without disabling the button press events.'
|
81
85
|
}
|
82
86
|
}
|
83
|
-
};
|
87
|
+
};
|
88
|
+
|
89
|
+
var IconWithTooltip = function IconWithTooltip() {
|
90
|
+
return (0, _react2.jsx)(_index.Box, {
|
91
|
+
pl: 50
|
92
|
+
}, (0, _react2.jsx)(_index.TooltipTrigger, null, (0, _react2.jsx)(_IconButton["default"], {
|
93
|
+
variant: "tooltipIconButton"
|
94
|
+
}, (0, _react2.jsx)(_index.Icon, {
|
95
|
+
icon: _PersonIcon["default"]
|
96
|
+
})), (0, _react2.jsx)(_index.Tooltip, null, "Useful tooltip")));
|
97
|
+
};
|
98
|
+
|
99
|
+
exports.IconWithTooltip = IconWithTooltip;
|
100
|
+
|
101
|
+
var ChipWithTooltip = function ChipWithTooltip() {
|
102
|
+
return (0, _react2.jsx)(_index.Box, {
|
103
|
+
pl: 50
|
104
|
+
}, (0, _react2.jsx)(_index.TooltipTrigger, null, (0, _react2.jsx)(_index.Button, {
|
105
|
+
variant: "tooltipChip",
|
106
|
+
bg: "neutral.10"
|
107
|
+
}, (0, _react2.jsx)(_Text["default"], {
|
108
|
+
variant: "label",
|
109
|
+
sx: {
|
110
|
+
textTransform: 'uppercase'
|
111
|
+
},
|
112
|
+
color: "white"
|
113
|
+
}, "Some text")), (0, _react2.jsx)(_index.Tooltip, null, "Useful tooltip")));
|
114
|
+
};
|
115
|
+
|
116
|
+
exports.ChipWithTooltip = ChipWithTooltip;
|
117
|
+
|
118
|
+
var TextWithTooltip = function TextWithTooltip() {
|
119
|
+
return (0, _react2.jsx)(_index.Box, {
|
120
|
+
pl: 50
|
121
|
+
}, (0, _react2.jsx)(_index.TooltipTrigger, null, (0, _react2.jsx)(_index.Button, {
|
122
|
+
variant: "tooltipInline"
|
123
|
+
}, "Some text"), (0, _react2.jsx)(_index.Tooltip, null, "Useful tooltip")));
|
124
|
+
};
|
125
|
+
|
126
|
+
exports.TextWithTooltip = TextWithTooltip;
|