@pingux/astro 1.2.0-alpha.9 → 1.3.1
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 +81 -0
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.js +35 -22
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.stories.js +148 -169
- package/lib/cjs/components/AccordionGridGroup/AccordionGridGroup.test.js +25 -30
- package/lib/cjs/components/AccordionGridItem/AccordionGridItem.js +29 -14
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemBody.js +8 -5
- package/lib/cjs/components/AccordionGridItem/AccordionGridItemHeader.js +20 -17
- package/lib/cjs/components/AccordionGroup/AccordionGroup.js +2 -1
- package/lib/cjs/components/AccordionGroup/AccordionGroup.test.js +20 -1
- package/lib/cjs/components/ArrayField/ArrayField.js +213 -0
- package/lib/cjs/components/ArrayField/ArrayField.stories.js +223 -0
- package/lib/cjs/components/ArrayField/ArrayField.test.js +208 -0
- package/lib/cjs/components/ArrayField/ArrayFieldDeleteButton.js +61 -0
- package/lib/cjs/components/ArrayField/index.js +27 -0
- package/lib/cjs/components/Breadcrumbs/Breadcrumbs.stories.js +3 -3
- package/lib/cjs/components/Button/Button.js +14 -2
- package/lib/cjs/components/Button/Button.stories.js +33 -33
- package/lib/cjs/components/CheckboxField/CheckboxField.js +4 -1
- package/lib/cjs/components/CodeView/CodeView.js +3 -3
- package/lib/cjs/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +5 -3
- package/lib/cjs/components/Input/Input.js +3 -11
- package/lib/cjs/components/Input/Input.test.js +14 -2
- package/lib/cjs/components/Link/Link.js +2 -1
- package/lib/cjs/components/ListView/ListView.js +9 -13
- package/lib/cjs/components/ListView/ListView.stories.js +3 -0
- package/lib/cjs/components/ListViewItem/ListViewItem.js +15 -3
- package/lib/cjs/components/Loader/Loader.stories.js +3 -3
- package/lib/cjs/components/Modal/Modal.js +3 -0
- package/lib/cjs/components/Modal/Modal.stories.js +12 -67
- package/lib/cjs/components/MultivaluesField/MultivaluesField.js +10 -2
- package/lib/cjs/components/NavBar/NavBar.js +30 -4
- package/lib/cjs/components/NavBar/NavBar.stories.js +70 -463
- package/lib/cjs/components/NavBar/NavBar.test.js +51 -1
- package/lib/cjs/components/NavBarSection/NavBarItem.js +137 -0
- package/lib/cjs/components/NavBarSection/NavBarItemButton.js +96 -0
- package/lib/cjs/components/NavBarSection/NavBarItemHeader.js +1 -1
- package/lib/cjs/components/NavBarSection/NavBarItemLink.js +98 -0
- package/lib/cjs/components/NavBarSection/NavBarSection.js +10 -8
- package/lib/cjs/components/NavBarSection/index.js +28 -1
- package/lib/cjs/components/NumberField/NumberField.js +30 -10
- package/lib/cjs/components/NumberField/NumberField.test.js +7 -0
- package/lib/cjs/components/PageHeader/PageHeader.js +3 -0
- package/lib/cjs/components/PageHeader/PageHeader.stories.js +6 -1
- package/lib/cjs/components/RadioGroupField/RadioGroupField.js +9 -5
- package/lib/cjs/components/RockerButton/RockerButton.js +14 -22
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.js +5 -9
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.stories.js +4 -22
- package/lib/cjs/components/RockerButtonGroup/RockerButtonGroup.test.js +5 -14
- package/lib/cjs/components/SearchField/SearchField.stories.js +1 -15
- package/lib/cjs/components/SelectField/SelectField.stories.js +3 -55
- package/lib/cjs/components/SelectFieldBase/SelectFieldBase.js +8 -1
- package/lib/cjs/components/Tabs/Tabs.stories.js +1 -15
- package/lib/cjs/components/TextAreaField/TextAreaField.js +54 -9
- package/lib/cjs/components/TextAreaField/TextAreaField.stories.js +31 -52
- package/lib/cjs/components/TextAreaField/TextAreaField.test.js +12 -0
- package/lib/cjs/context/AccordionGridContext/index.js +20 -0
- package/lib/cjs/context/NavBarContext/index.js +20 -0
- package/lib/cjs/hooks/index.js +9 -0
- package/lib/cjs/hooks/useAriaLabelWarning/useAriaLabelWarning.js +2 -1
- package/lib/cjs/hooks/useField/useField.js +7 -2
- package/lib/cjs/{components/AccordionGridGroup/AccordionGridContext.js → hooks/useNavBarPress/index.js} +7 -6
- package/lib/cjs/hooks/useNavBarPress/useNavBarPress.js +38 -0
- package/lib/cjs/hooks/useNavBarPress/useNavBarPress.test.js +42 -0
- package/lib/cjs/hooks/useRockerButton/useRockerButton.js +4 -6
- package/lib/cjs/index.js +80 -58
- package/lib/cjs/recipes/ConditionalFilter.stories.js +7 -3
- package/lib/cjs/recipes/RadioButtonsWithLinks.stories.js +1 -1
- package/lib/cjs/styles/forms/checkbox.js +0 -1
- package/lib/cjs/styles/forms/input.js +1 -1
- package/lib/cjs/styles/forms/label.js +3 -0
- package/lib/cjs/styles/forms/radio.js +1 -1
- package/lib/cjs/styles/forms/switch.js +3 -1
- package/lib/cjs/styles/variants/accordion.js +39 -7
- package/lib/cjs/styles/variants/boxes.js +14 -25
- package/lib/cjs/styles/variants/buttons.js +27 -1
- package/lib/cjs/styles/variants/codeView.js +91 -0
- package/lib/cjs/styles/variants/navBar.js +68 -0
- package/lib/cjs/styles/variants/separator.js +2 -1
- package/lib/cjs/styles/variants/text.js +3 -1
- package/lib/cjs/styles/variants/variants.js +3 -0
- package/lib/components/AccordionGridGroup/AccordionGridGroup.js +35 -22
- package/lib/components/AccordionGridGroup/AccordionGridGroup.stories.js +143 -166
- package/lib/components/AccordionGridGroup/AccordionGridGroup.test.js +24 -25
- package/lib/components/AccordionGridItem/AccordionGridItem.js +29 -15
- package/lib/components/AccordionGridItem/AccordionGridItemBody.js +8 -6
- package/lib/components/AccordionGridItem/AccordionGridItemHeader.js +22 -18
- package/lib/components/AccordionGroup/AccordionGroup.js +2 -1
- package/lib/components/AccordionGroup/AccordionGroup.test.js +16 -2
- package/lib/components/ArrayField/ArrayField.js +179 -0
- package/lib/components/ArrayField/ArrayField.stories.js +196 -0
- package/lib/components/ArrayField/ArrayField.test.js +185 -0
- package/lib/components/ArrayField/ArrayFieldDeleteButton.js +43 -0
- package/lib/components/ArrayField/index.js +2 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.stories.js +3 -3
- package/lib/components/Button/Button.js +15 -3
- package/lib/components/Button/Button.stories.js +17 -15
- package/lib/components/CheckboxField/CheckboxField.js +4 -1
- package/lib/components/CodeView/CodeView.js +2 -2
- package/lib/components/EnvironmentBreadcrumb/EnvironmentBreadcrumb.js +5 -3
- package/lib/components/Input/Input.js +2 -10
- package/lib/components/Input/Input.test.js +11 -2
- package/lib/components/Link/Link.js +2 -1
- package/lib/components/ListView/ListView.js +9 -12
- package/lib/components/ListView/ListView.stories.js +3 -0
- package/lib/components/ListViewItem/ListViewItem.js +14 -3
- package/lib/components/Loader/Loader.stories.js +1 -1
- package/lib/components/Modal/Modal.js +4 -1
- package/lib/components/Modal/Modal.stories.js +11 -60
- package/lib/components/MultivaluesField/MultivaluesField.js +9 -2
- package/lib/components/NavBar/NavBar.js +25 -4
- package/lib/components/NavBar/NavBar.stories.js +71 -462
- package/lib/components/NavBar/NavBar.test.js +39 -2
- package/lib/components/NavBarSection/NavBarItem.js +111 -0
- package/lib/components/NavBarSection/NavBarItemButton.js +69 -0
- package/lib/components/NavBarSection/NavBarItemHeader.js +1 -1
- package/lib/components/NavBarSection/NavBarItemLink.js +71 -0
- package/lib/components/NavBarSection/NavBarSection.js +9 -8
- package/lib/components/NavBarSection/index.js +4 -1
- package/lib/components/NumberField/NumberField.js +32 -12
- package/lib/components/NumberField/NumberField.test.js +5 -0
- package/lib/components/PageHeader/PageHeader.js +2 -0
- package/lib/components/PageHeader/PageHeader.stories.js +5 -1
- package/lib/components/RadioGroupField/RadioGroupField.js +9 -5
- package/lib/components/RockerButton/RockerButton.js +14 -21
- package/lib/components/RockerButtonGroup/RockerButtonGroup.js +5 -9
- package/lib/components/RockerButtonGroup/RockerButtonGroup.stories.js +2 -17
- package/lib/components/RockerButtonGroup/RockerButtonGroup.test.js +5 -11
- package/lib/components/SearchField/SearchField.stories.js +0 -11
- package/lib/components/SelectField/SelectField.stories.js +2 -50
- package/lib/components/SelectFieldBase/SelectFieldBase.js +8 -1
- package/lib/components/Tabs/Tabs.stories.js +0 -11
- package/lib/components/TextAreaField/TextAreaField.js +54 -10
- package/lib/components/TextAreaField/TextAreaField.stories.js +26 -42
- package/lib/components/TextAreaField/TextAreaField.test.js +13 -0
- package/lib/context/AccordionGridContext/index.js +5 -0
- package/lib/context/NavBarContext/index.js +5 -0
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/useAriaLabelWarning/useAriaLabelWarning.js +2 -1
- package/lib/hooks/useField/useField.js +7 -2
- package/lib/hooks/useNavBarPress/index.js +1 -0
- package/lib/hooks/useNavBarPress/useNavBarPress.js +27 -0
- package/lib/hooks/useNavBarPress/useNavBarPress.test.js +36 -0
- package/lib/hooks/useRockerButton/useRockerButton.js +4 -6
- package/lib/index.js +2 -0
- package/lib/recipes/ConditionalFilter.stories.js +7 -3
- package/lib/recipes/RadioButtonsWithLinks.stories.js +1 -1
- package/lib/styles/forms/checkbox.js +0 -1
- package/lib/styles/forms/input.js +1 -1
- package/lib/styles/forms/label.js +3 -0
- package/lib/styles/forms/radio.js +1 -1
- package/lib/styles/forms/switch.js +3 -1
- package/lib/styles/variants/accordion.js +26 -5
- package/lib/styles/variants/boxes.js +14 -25
- package/lib/styles/variants/buttons.js +27 -1
- package/lib/styles/variants/codeView.js +91 -0
- package/lib/styles/variants/navBar.js +46 -0
- package/lib/styles/variants/separator.js +2 -1
- package/lib/styles/variants/text.js +3 -1
- package/lib/styles/variants/variants.js +2 -0
- package/package.json +4 -2
- package/lib/cjs/layouts/ListLayout.stories.js +0 -895
- package/lib/cjs/layouts/SchemaFormLayout.stories.js +0 -139
- package/lib/cjs/recipes/ArrayField.stories.js +0 -169
- package/lib/components/AccordionGridGroup/AccordionGridContext.js +0 -2
- package/lib/layouts/ListLayout.stories.js +0 -866
- package/lib/layouts/SchemaFormLayout.stories.js +0 -107
- package/lib/recipes/ArrayField.stories.js +0 -134
@@ -1,4 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
+
import userEvent from '@testing-library/user-event';
|
2
3
|
import GlobeIcon from 'mdi-react/GlobeIcon';
|
3
4
|
import ViewDashboard from 'mdi-react/ViewDashboardIcon';
|
4
5
|
import AccountMultiple from 'mdi-react/AccountMultipleIcon';
|
@@ -10,13 +11,22 @@ import Verify from 'mdi-react/VerifiedIcon';
|
|
10
11
|
import NavBar from './NavBar';
|
11
12
|
import axeTest from '../../utils/testUtils/testAxe';
|
12
13
|
import { render, screen } from '../../utils/testUtils/testWrapper';
|
13
|
-
import { Box, NavBarSection } from '../../index';
|
14
|
+
import { Box, NavBarSection, NavBarItem, NavBarItemButton, NavBarItemLink } from '../../index';
|
14
15
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
15
16
|
var data = [{
|
16
17
|
icon: GlobeIcon,
|
17
18
|
key: 'Overview',
|
18
19
|
heading: 'Overview',
|
19
|
-
children: [
|
20
|
+
children: [___EmotionJSX(NavBarItemButton, {
|
21
|
+
key: "Credentials Button Users",
|
22
|
+
id: "Credentials Button Users",
|
23
|
+
"data-testid": "navItemButton"
|
24
|
+
}, "Users"), ___EmotionJSX(NavBarItemLink, {
|
25
|
+
key: "Experiences Link Roles",
|
26
|
+
id: "Experiences Link Roles",
|
27
|
+
href: "https://pingidentity.com/",
|
28
|
+
"data-testid": "navItemLink"
|
29
|
+
}, "Roles")]
|
20
30
|
}, {
|
21
31
|
icon: ViewDashboard,
|
22
32
|
key: 'Dashboard',
|
@@ -71,6 +81,12 @@ var getComponent = function getComponent() {
|
|
71
81
|
}), ___EmotionJSX(NavBarSection, {
|
72
82
|
items: secondData,
|
73
83
|
title: "test_title"
|
84
|
+
}), ___EmotionJSX(NavBarItem, {
|
85
|
+
id: "Overview",
|
86
|
+
key: "Overview",
|
87
|
+
text: "Overview",
|
88
|
+
icon: ViewDashboard,
|
89
|
+
"data-testid": "navItem"
|
74
90
|
}))));
|
75
91
|
};
|
76
92
|
|
@@ -89,4 +105,25 @@ test('should render title for itemBodies that have subTitles', function () {
|
|
89
105
|
getComponent();
|
90
106
|
var subTitle = screen.getByText('PingOne Services');
|
91
107
|
expect(subTitle).toBeInTheDocument();
|
108
|
+
});
|
109
|
+
test('should select NavIemLink', function () {
|
110
|
+
getComponent();
|
111
|
+
var link = screen.getByTestId('navItemLink');
|
112
|
+
expect(link).toBeInTheDocument();
|
113
|
+
userEvent.click(link);
|
114
|
+
expect(link).toHaveClass('is-selected');
|
115
|
+
});
|
116
|
+
test('should select NavIem', function () {
|
117
|
+
getComponent();
|
118
|
+
var item = screen.getByTestId('navItem');
|
119
|
+
expect(item).toBeInTheDocument();
|
120
|
+
userEvent.click(item);
|
121
|
+
expect(item).toHaveClass('is-selected');
|
122
|
+
});
|
123
|
+
test('should select NavIemButton', function () {
|
124
|
+
getComponent();
|
125
|
+
var button = screen.getByTestId('navItemButton');
|
126
|
+
expect(button).toBeInTheDocument();
|
127
|
+
userEvent.click(button);
|
128
|
+
expect(button).toHaveClass('is-selected');
|
92
129
|
});
|
@@ -0,0 +1,111 @@
|
|
1
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
2
|
+
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
3
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
4
|
+
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
5
|
+
import React, { useRef, forwardRef, useImperativeHandle } from 'react';
|
6
|
+
import PropTypes from 'prop-types';
|
7
|
+
import { useHover, usePress } from '@react-aria/interactions';
|
8
|
+
import { mergeProps } from '@react-aria/utils';
|
9
|
+
import { useFocusRing } from '@react-aria/focus';
|
10
|
+
import { Box, Icon, Text } from '../../index';
|
11
|
+
import { useStatusClasses, useNavBarPress } from '../../hooks';
|
12
|
+
import { useNavBarContext } from '../../context/NavBarContext';
|
13
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
14
|
+
var NavBarItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
15
|
+
var _context, _context2;
|
16
|
+
|
17
|
+
var icon = props.icon,
|
18
|
+
text = props.text,
|
19
|
+
className = props.className,
|
20
|
+
key = props.id,
|
21
|
+
onPressCallback = props.onPress,
|
22
|
+
others = _objectWithoutProperties(props, ["icon", "text", "className", "id", "onPress"]);
|
23
|
+
|
24
|
+
var navItemRef = useRef();
|
25
|
+
/* istanbul ignore next */
|
26
|
+
|
27
|
+
useImperativeHandle(ref, function () {
|
28
|
+
return navItemRef.current;
|
29
|
+
});
|
30
|
+
|
31
|
+
var _useHover = useHover({}),
|
32
|
+
hoverProps = _useHover.hoverProps,
|
33
|
+
isHovered = _useHover.isHovered;
|
34
|
+
|
35
|
+
var _useFocusRing = useFocusRing({
|
36
|
+
within: true
|
37
|
+
}),
|
38
|
+
focusWithinProps = _useFocusRing.focusProps;
|
39
|
+
|
40
|
+
var _useFocusRing2 = useFocusRing(),
|
41
|
+
focusProps = _useFocusRing2.focusProps,
|
42
|
+
isFocusVisible = _useFocusRing2.isFocusVisible;
|
43
|
+
|
44
|
+
var state = useNavBarContext();
|
45
|
+
|
46
|
+
var isSelected = _includesInstanceProperty(_context = state.selectedKeys).call(_context, key);
|
47
|
+
|
48
|
+
var _useNavBarPress = useNavBarPress({
|
49
|
+
key: key,
|
50
|
+
onPressCallback: onPressCallback
|
51
|
+
}, state),
|
52
|
+
onNavPress = _useNavBarPress.onNavPress;
|
53
|
+
|
54
|
+
var _usePress = usePress({
|
55
|
+
ref: navItemRef,
|
56
|
+
onPress: onNavPress
|
57
|
+
}),
|
58
|
+
pressProps = _usePress.pressProps,
|
59
|
+
isPressed = _usePress.isPressed;
|
60
|
+
|
61
|
+
var mergedProps = mergeProps.apply(void 0, _concatInstanceProperty(_context2 = [pressProps, hoverProps, focusWithinProps, focusProps]).call(_context2, others));
|
62
|
+
|
63
|
+
var _useStatusClasses = useStatusClasses(className, {
|
64
|
+
isPressed: isPressed,
|
65
|
+
isHovered: isHovered,
|
66
|
+
isSelected: isSelected,
|
67
|
+
isFocused: isFocusVisible
|
68
|
+
}),
|
69
|
+
classNames = _useStatusClasses.classNames;
|
70
|
+
|
71
|
+
return ___EmotionJSX(Box, _extends({
|
72
|
+
id: key,
|
73
|
+
variant: "accordion.accordionGridNavItem",
|
74
|
+
isRow: true,
|
75
|
+
className: classNames,
|
76
|
+
ref: navItemRef
|
77
|
+
}, mergedProps, {
|
78
|
+
sx: {
|
79
|
+
maxHeight: '30px'
|
80
|
+
}
|
81
|
+
}), ___EmotionJSX(Box, {
|
82
|
+
isRow: true,
|
83
|
+
sx: {
|
84
|
+
alignItems: 'center'
|
85
|
+
}
|
86
|
+
}, icon && ___EmotionJSX(Icon, {
|
87
|
+
icon: icon,
|
88
|
+
size: 20,
|
89
|
+
sx: {
|
90
|
+
mr: '10px',
|
91
|
+
color: 'white',
|
92
|
+
fill: 'white'
|
93
|
+
}
|
94
|
+
}), ___EmotionJSX(Text, {
|
95
|
+
variant: "navBarHeaderText"
|
96
|
+
}, text)));
|
97
|
+
});
|
98
|
+
NavBarItem.propTypes = {
|
99
|
+
/** Handler that is called when the press is released over the target. */
|
100
|
+
onPress: PropTypes.func,
|
101
|
+
|
102
|
+
/** The icon to render in between each node. */
|
103
|
+
icon: PropTypes.elementType,
|
104
|
+
|
105
|
+
/** The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). */
|
106
|
+
id: PropTypes.string,
|
107
|
+
|
108
|
+
/** Text that will render within the component */
|
109
|
+
text: PropTypes.string
|
110
|
+
};
|
111
|
+
export default NavBarItem;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
2
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
3
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
4
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
5
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
6
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
7
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
8
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
9
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
12
|
+
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
13
|
+
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
15
|
+
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty(_context2 = ownKeys(Object(source), true)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context3; _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
17
|
+
|
18
|
+
import React from 'react';
|
19
|
+
import PropTypes from 'prop-types';
|
20
|
+
import { useNavBarContext } from '../../context/NavBarContext';
|
21
|
+
import { useStatusClasses, useNavBarPress } from '../../hooks';
|
22
|
+
import { Button } from '../../index';
|
23
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
24
|
+
|
25
|
+
var NavBarItemButton = function NavBarItemButton(props) {
|
26
|
+
var _context;
|
27
|
+
|
28
|
+
var className = props.className,
|
29
|
+
key = props.id,
|
30
|
+
onPressCallback = props.onPress,
|
31
|
+
sx = props.sx,
|
32
|
+
others = _objectWithoutProperties(props, ["className", "id", "onPress", "sx"]);
|
33
|
+
|
34
|
+
var state = useNavBarContext();
|
35
|
+
|
36
|
+
var isSelected = _includesInstanceProperty(_context = state.selectedKeys).call(_context, key);
|
37
|
+
|
38
|
+
var _useNavBarPress = useNavBarPress({
|
39
|
+
key: key,
|
40
|
+
onPressCallback: onPressCallback
|
41
|
+
}, state),
|
42
|
+
onNavPress = _useNavBarPress.onNavPress;
|
43
|
+
|
44
|
+
var _useStatusClasses = useStatusClasses(className, {
|
45
|
+
isSelected: isSelected
|
46
|
+
}),
|
47
|
+
classNames = _useStatusClasses.classNames;
|
48
|
+
|
49
|
+
return ___EmotionJSX(Button, _extends({
|
50
|
+
id: key,
|
51
|
+
variant: "navItemButton",
|
52
|
+
onPress: onNavPress,
|
53
|
+
className: classNames
|
54
|
+
}, others, {
|
55
|
+
sx: _objectSpread({
|
56
|
+
paddingLeft: '45px',
|
57
|
+
paddingRight: '45px'
|
58
|
+
}, sx)
|
59
|
+
}));
|
60
|
+
};
|
61
|
+
|
62
|
+
NavBarItemButton.propTypes = {
|
63
|
+
/** Handler that is called when the press is released over the target. */
|
64
|
+
onPress: PropTypes.func,
|
65
|
+
|
66
|
+
/** The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). */
|
67
|
+
id: PropTypes.string.isRequired
|
68
|
+
};
|
69
|
+
export default NavBarItemButton;
|
@@ -7,7 +7,7 @@ var NavBarItemHeader = function NavBarItemHeader(props) {
|
|
7
7
|
var item = props.item;
|
8
8
|
var icon = item.icon;
|
9
9
|
return ___EmotionJSX(Box, {
|
10
|
-
variant: "
|
10
|
+
variant: "navBar.itemHeaderContainer",
|
11
11
|
isRow: true
|
12
12
|
}, icon && ___EmotionJSX(Icon, {
|
13
13
|
icon: icon,
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object/define-property";
|
2
|
+
import _Object$defineProperties from "@babel/runtime-corejs3/core-js-stable/object/define-properties";
|
3
|
+
import _Object$getOwnPropertyDescriptors from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors";
|
4
|
+
import _forEachInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/for-each";
|
5
|
+
import _Object$getOwnPropertyDescriptor from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor";
|
6
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
7
|
+
import _Object$getOwnPropertySymbols from "@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols";
|
8
|
+
import _Object$keys from "@babel/runtime-corejs3/core-js-stable/object/keys";
|
9
|
+
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
10
|
+
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
11
|
+
import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/includes";
|
12
|
+
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
13
|
+
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); if (enumerableOnly) symbols = _filterInstanceProperty(symbols).call(symbols, function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
15
|
+
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context2; _forEachInstanceProperty(_context2 = ownKeys(Object(source), true)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context3; _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
17
|
+
|
18
|
+
import React from 'react';
|
19
|
+
import PropTypes from 'prop-types';
|
20
|
+
import { Link } from '../../index';
|
21
|
+
import { useNavBarContext } from '../../context/NavBarContext';
|
22
|
+
import { useStatusClasses, useNavBarPress } from '../../hooks';
|
23
|
+
import { jsx as ___EmotionJSX } from "@emotion/react";
|
24
|
+
|
25
|
+
var NavBarItemLink = function NavBarItemLink(props) {
|
26
|
+
var _context;
|
27
|
+
|
28
|
+
var className = props.className,
|
29
|
+
key = props.id,
|
30
|
+
onPressCallback = props.onPress,
|
31
|
+
others = _objectWithoutProperties(props, ["className", "id", "onPress"]);
|
32
|
+
|
33
|
+
var state = useNavBarContext();
|
34
|
+
|
35
|
+
var isSelected = _includesInstanceProperty(_context = state.selectedKeys).call(_context, key);
|
36
|
+
|
37
|
+
var _useNavBarPress = useNavBarPress({
|
38
|
+
key: key,
|
39
|
+
onPressCallback: onPressCallback
|
40
|
+
}, state),
|
41
|
+
onNavPress = _useNavBarPress.onNavPress;
|
42
|
+
|
43
|
+
var _useStatusClasses = useStatusClasses(className, {
|
44
|
+
isSelected: isSelected
|
45
|
+
}),
|
46
|
+
classNames = _useStatusClasses.classNames;
|
47
|
+
|
48
|
+
return ___EmotionJSX(Link, _extends({
|
49
|
+
id: key,
|
50
|
+
variant: "buttons.navItemButton",
|
51
|
+
className: classNames,
|
52
|
+
onPress: onNavPress
|
53
|
+
}, others, {
|
54
|
+
sx: _objectSpread({
|
55
|
+
paddingLeft: '45px',
|
56
|
+
paddingRight: '45px'
|
57
|
+
}, props.sx)
|
58
|
+
}));
|
59
|
+
};
|
60
|
+
|
61
|
+
NavBarItemLink.propTypes = {
|
62
|
+
/** Specifies the location of the URL */
|
63
|
+
href: PropTypes.string,
|
64
|
+
|
65
|
+
/** Handler that is called when the press is released over the target. */
|
66
|
+
onPress: PropTypes.func,
|
67
|
+
|
68
|
+
/** The element's unique identifier. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id). */
|
69
|
+
id: PropTypes.string.isRequired
|
70
|
+
};
|
71
|
+
export default NavBarItemLink;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
1
2
|
import React from 'react';
|
2
3
|
import PropTypes from 'prop-types';
|
3
4
|
import { Separator, AccordionGridGroup, Text, Item, Box } from '../../index';
|
@@ -16,19 +17,19 @@ var NavBarSection = function NavBarSection(props) {
|
|
16
17
|
title = props.title,
|
17
18
|
items = props.items;
|
18
19
|
return ___EmotionJSX(React.Fragment, null, title && ___EmotionJSX(Text, {
|
19
|
-
variant: "text.navBarSubtitle"
|
20
|
-
sx: {
|
21
|
-
mt: '25px',
|
22
|
-
mb: '15px',
|
23
|
-
ml: '15px'
|
24
|
-
}
|
20
|
+
variant: "text.navBarSubtitle"
|
25
21
|
}, title), ___EmotionJSX(AccordionGridGroup, {
|
26
|
-
items: items
|
22
|
+
items: _filterInstanceProperty(items).call(items, function (i) {
|
23
|
+
return i.children;
|
24
|
+
})
|
27
25
|
}, function (item) {
|
28
26
|
return ___EmotionJSX(Item, {
|
29
27
|
headerProps: {
|
30
28
|
variant: 'accordion.accordionGridHeaderNav'
|
31
29
|
},
|
30
|
+
bodyProps: {
|
31
|
+
variant: 'navBar.sectionBody'
|
32
|
+
},
|
32
33
|
textValue: item
|
33
34
|
}, ___EmotionJSX(NavBarItemHeader, {
|
34
35
|
item: item
|
@@ -39,7 +40,7 @@ var NavBarSection = function NavBarSection(props) {
|
|
39
40
|
sx: {
|
40
41
|
pl: '15px',
|
41
42
|
pr: '15px',
|
42
|
-
|
43
|
+
my: '10px'
|
43
44
|
}
|
44
45
|
}, ___EmotionJSX(Separator, {
|
45
46
|
variant: "separator.navBarSeparator"
|
@@ -1 +1,4 @@
|
|
1
|
-
export { default } from './NavBarSection';
|
1
|
+
export { default } from './NavBarSection';
|
2
|
+
export { default as NavBarItemButton } from './NavBarItemButton';
|
3
|
+
export { default as NavBarItemLink } from './NavBarItemLink';
|
4
|
+
export { default as NavBarItem } from './NavBarItem';
|
@@ -14,10 +14,10 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
|
|
14
14
|
|
15
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context; _forEachInstanceProperty(_context = ownKeys(Object(source), true)).call(_context, function (key) { _defineProperty(target, key, source[key]); }); } else if (_Object$getOwnPropertyDescriptors) { _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)); } else { var _context2; _forEachInstanceProperty(_context2 = ownKeys(Object(source))).call(_context2, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
16
16
|
|
17
|
-
import React, { forwardRef, useImperativeHandle } from 'react';
|
17
|
+
import React, { forwardRef, useCallback, useImperativeHandle, useMemo } from 'react';
|
18
18
|
import PropTypes from 'prop-types';
|
19
|
-
import
|
20
|
-
import
|
19
|
+
import MenuUp from 'mdi-react/MenuUpIcon';
|
20
|
+
import MenuDown from 'mdi-react/MenuDownIcon';
|
21
21
|
import { useNumberField } from '@react-aria/numberfield';
|
22
22
|
import { useNumberFieldState } from '@react-stately/numberfield';
|
23
23
|
import { useLocale } from '@react-aria/i18n';
|
@@ -73,18 +73,38 @@ var NumberField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
73
73
|
variant: "numberField.arrows"
|
74
74
|
}, ___EmotionJSX(IconButton, _extends({}, incrementButtonProps, {
|
75
75
|
ref: decRef,
|
76
|
-
tabIndex: "-1"
|
76
|
+
tabIndex: "-1",
|
77
|
+
p: 0
|
77
78
|
}), ___EmotionJSX(Icon, {
|
78
|
-
icon:
|
79
|
-
size:
|
79
|
+
icon: MenuUp,
|
80
|
+
size: 18
|
80
81
|
})), ___EmotionJSX(IconButton, _extends({}, decrementButtonProps, {
|
81
82
|
ref: incrRef,
|
82
|
-
tabIndex: "-1"
|
83
|
+
tabIndex: "-1",
|
84
|
+
p: 0
|
83
85
|
}), ___EmotionJSX(Icon, {
|
84
|
-
icon:
|
85
|
-
size:
|
86
|
-
})));
|
87
|
-
|
86
|
+
icon: MenuDown,
|
87
|
+
size: 18
|
88
|
+
}))); // this needed to remove console warning in React 16
|
89
|
+
// I believe once we update to 17 - we can remove this
|
90
|
+
|
91
|
+
|
92
|
+
var onInputFocus = useCallback(function (e) {
|
93
|
+
e.persist();
|
94
|
+
fieldControlProps.onFocus(e);
|
95
|
+
inputProps.onFocus(e);
|
96
|
+
}, [fieldControlProps, inputProps]);
|
97
|
+
var onInputBlur = useCallback(function (e) {
|
98
|
+
e.persist();
|
99
|
+
fieldControlProps.onBlur(e);
|
100
|
+
inputProps.onBlur(e);
|
101
|
+
}, [fieldControlProps, inputProps]);
|
102
|
+
var updatedFieldControlProps = useMemo(function () {
|
103
|
+
return _objectSpread(_objectSpread({}, fieldControlProps), {}, {
|
104
|
+
onFocus: onInputFocus,
|
105
|
+
onBlur: onInputBlur
|
106
|
+
});
|
107
|
+
}, [fieldControlProps, onInputBlur, onInputFocus]);
|
88
108
|
return ___EmotionJSX(Box, fieldContainerProps, ___EmotionJSX(Label, mergeProps(fieldLabelProps, labelProps)), ___EmotionJSX(Box, _extends({
|
89
109
|
variant: "numberField.noDefaultArrows"
|
90
110
|
}, groupProps), ___EmotionJSX(Box, {
|
@@ -95,7 +115,7 @@ var NumberField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
95
115
|
ref: inputRef // we don't want to merge this props, we want to
|
96
116
|
// overwrite them like defaultValue, value, ect.
|
97
117
|
|
98
|
-
},
|
118
|
+
}, updatedFieldControlProps, omit(inputProps, ['name', 'onFocus', 'onBlur']))), ControlArrows), helperText && ___EmotionJSX(FieldHelperText, {
|
99
119
|
status: status
|
100
120
|
}, helperText)));
|
101
121
|
});
|
@@ -135,4 +135,9 @@ test('number field input receiving name attribute', function () {
|
|
135
135
|
name: testName
|
136
136
|
});
|
137
137
|
expect(screen.getByLabelText(testLabel)).toHaveAttribute('name', testName);
|
138
|
+
});
|
139
|
+
test('number field can be focused', function () {
|
140
|
+
getComponent();
|
141
|
+
userEvent.tab();
|
142
|
+
expect(screen.getByLabelText(testLabel)).toHaveClass('is-focused');
|
138
143
|
});
|
@@ -4,12 +4,14 @@ import React, { forwardRef } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
5
5
|
import Text from '../Text/Text';
|
6
6
|
import Box from '../Box/Box';
|
7
|
+
import { useDeprecationWarning } from '../../hooks';
|
7
8
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
8
9
|
var PageHeader = /*#__PURE__*/forwardRef(function (props, ref) {
|
9
10
|
var title = props.title,
|
10
11
|
children = props.children,
|
11
12
|
others = _objectWithoutProperties(props, ["title", "children"]);
|
12
13
|
|
14
|
+
useDeprecationWarning('The Page Header component will be deprecated in Astro-UI 2.0.0.');
|
13
15
|
return ___EmotionJSX(Box, _extends({
|
14
16
|
isRow: true,
|
15
17
|
justifyContent: "space-between",
|
@@ -2,10 +2,14 @@ import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
|
2
2
|
import React from 'react';
|
3
3
|
import PageHeader from '../PageHeader/PageHeader';
|
4
4
|
import Button from '../Button/Button';
|
5
|
+
import withDeprecationWarning from '../../utils/devUtils/decorators/withDeprecationWarning';
|
5
6
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
6
7
|
export default {
|
7
|
-
title: 'PageHeader',
|
8
|
+
title: 'Deprecated/PageHeader',
|
8
9
|
component: PageHeader,
|
10
|
+
decorators: [function (Story, context) {
|
11
|
+
return withDeprecationWarning(Story, context, 'The `PageHeader` component will be deprecated in Astro-UI 2.0.0.');
|
12
|
+
}],
|
9
13
|
argTypes: {
|
10
14
|
title: {
|
11
15
|
control: {
|
@@ -63,17 +63,21 @@ var RadioGroupField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
63
63
|
}, radioGroupProps), ___EmotionJSX(Label, _extends({
|
64
64
|
isDisabled: isDisabled,
|
65
65
|
hintText: hintText,
|
66
|
-
isRequired: isRequired
|
67
|
-
|
68
|
-
|
69
|
-
}, helperText), ___EmotionJSX(Box, {
|
66
|
+
isRequired: isRequired,
|
67
|
+
variant: "forms.label.radioGroup"
|
68
|
+
}, labelProps), label), ___EmotionJSX(Box, {
|
70
69
|
variant: "forms.radioGroupWrapper",
|
71
70
|
isRow: orientation === ORIENTATION.HORIZONTAL
|
72
71
|
}, ___EmotionJSX(RadioContext.Provider, {
|
73
72
|
value: _objectSpread({
|
74
73
|
isDisabled: isDisabled
|
75
74
|
}, state)
|
76
|
-
}, children))
|
75
|
+
}, children)), helperText && ___EmotionJSX(FieldHelperText, {
|
76
|
+
status: status,
|
77
|
+
sx: {
|
78
|
+
pt: 'xs'
|
79
|
+
}
|
80
|
+
}, helperText));
|
77
81
|
});
|
78
82
|
RadioGroupField.propTypes = {
|
79
83
|
/** The name of the RadioGroupField, used when submitting an HTML form. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name_and_radio_buttons). */
|
@@ -17,26 +17,18 @@ import React, { forwardRef, useContext, useImperativeHandle, useRef } from 'reac
|
|
17
17
|
import PropTypes from 'prop-types';
|
18
18
|
import { Item } from '@react-stately/collections';
|
19
19
|
import { useFocusRing } from '@react-aria/focus';
|
20
|
-
import { mergeProps } from '@react-aria/utils';
|
21
20
|
import { useRockerButton, useStatusClasses, usePropWarning } from '../../hooks';
|
22
|
-
import
|
21
|
+
import { Box } from '../../index';
|
23
22
|
import { RockerContext } from '../RockerButtonGroup';
|
24
23
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
25
24
|
export var CollectionRockerButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
26
25
|
var className = props.className,
|
27
|
-
item = props.item
|
28
|
-
buttonGroupDisabled = props.isDisabled;
|
29
|
-
var defaultSelectedStyles = {
|
30
|
-
bg: 'active'
|
31
|
-
};
|
26
|
+
item = props.item;
|
32
27
|
var key = item.key,
|
33
28
|
rendered = item.rendered,
|
34
29
|
itemProps = item.props;
|
35
|
-
var _itemProps$selectedSt = itemProps.selectedStyles,
|
36
|
-
selectedStyles = _itemProps$selectedSt === void 0 ? defaultSelectedStyles : _itemProps$selectedSt,
|
37
|
-
rockerButtonDisabled = itemProps.isDisabled;
|
38
|
-
var isDisabled = buttonGroupDisabled || rockerButtonDisabled;
|
39
30
|
var state = useContext(RockerContext);
|
31
|
+
var isDisabled = state.disabledKeys.has(key);
|
40
32
|
|
41
33
|
var _useFocusRing = useFocusRing(),
|
42
34
|
isFocusVisible = _useFocusRing.isFocusVisible,
|
@@ -46,7 +38,8 @@ export var CollectionRockerButton = /*#__PURE__*/forwardRef(function (props, ref
|
|
46
38
|
|
47
39
|
var _useStatusClasses = useStatusClasses(className, {
|
48
40
|
isFocused: isFocusVisible,
|
49
|
-
isSelected: isSelected
|
41
|
+
isSelected: isSelected,
|
42
|
+
isDisabled: isDisabled
|
50
43
|
}),
|
51
44
|
classNames = _useStatusClasses.classNames;
|
52
45
|
|
@@ -60,25 +53,25 @@ export var CollectionRockerButton = /*#__PURE__*/forwardRef(function (props, ref
|
|
60
53
|
|
61
54
|
var _useRockerButton = useRockerButton({
|
62
55
|
item: item,
|
63
|
-
isDisabled: isDisabled
|
56
|
+
isDisabled: isDisabled,
|
57
|
+
isSelected: isSelected
|
64
58
|
}, state, rockerButtonRef),
|
65
59
|
rockerButtonProps = _useRockerButton.rockerButtonProps;
|
66
60
|
|
67
|
-
return ___EmotionJSX(
|
61
|
+
return ___EmotionJSX(Box, _extends({
|
62
|
+
as: "button",
|
68
63
|
className: classNames,
|
69
|
-
variant: "rocker"
|
70
|
-
},
|
71
|
-
ref: rockerButtonRef
|
64
|
+
variant: "buttons.rocker"
|
65
|
+
}, rockerButtonProps, {
|
66
|
+
ref: rockerButtonRef
|
67
|
+
}, focusProps, itemProps, {
|
72
68
|
sx: {
|
73
|
-
'&.is-selected': _objectSpread({}, selectedStyles)
|
69
|
+
'&.is-selected': _objectSpread({}, itemProps.selectedStyles)
|
74
70
|
}
|
75
71
|
}), rendered);
|
76
72
|
});
|
77
73
|
CollectionRockerButton.displayName = 'CollectionRockerButton';
|
78
74
|
CollectionRockerButton.propTypes = {
|
79
|
-
/** Whether the button is disabled. */
|
80
|
-
isDisabled: PropTypes.bool,
|
81
|
-
|
82
75
|
/** Allows custom styles to be passed to button. */
|
83
76
|
selectedStyles: PropTypes.shape({}),
|
84
77
|
// adding to surface in props table
|
@@ -34,10 +34,10 @@ var RockerButtonGroup = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
34
34
|
var _context;
|
35
35
|
|
36
36
|
var children = props.children,
|
37
|
-
isDisabled = props.isDisabled,
|
38
37
|
onSelectionChange = props.onSelectionChange,
|
39
38
|
tabListProps = props.tabListProps,
|
40
|
-
|
39
|
+
disabledKeys = props.disabledKeys,
|
40
|
+
others = _objectWithoutProperties(props, ["children", "onSelectionChange", "tabListProps", "disabledKeys"]);
|
41
41
|
|
42
42
|
var buttonGroupRef = useRef();
|
43
43
|
usePropWarning(props, 'disabled', 'isDisabled');
|
@@ -67,8 +67,7 @@ var RockerButtonGroup = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
67
67
|
}), _mapInstanceProperty(_context = _Array$from(state.collection)).call(_context, function (item) {
|
68
68
|
return ___EmotionJSX(CollectionRockerButton, {
|
69
69
|
key: item.key,
|
70
|
-
item: item
|
71
|
-
isDisabled: isDisabled
|
70
|
+
item: item
|
72
71
|
});
|
73
72
|
}))));
|
74
73
|
});
|
@@ -79,14 +78,11 @@ RockerButtonGroup.propTypes = {
|
|
79
78
|
/** The button key that is currently selected. (controlled) */
|
80
79
|
selectedKey: PropTypes.string,
|
81
80
|
|
82
|
-
/**
|
83
|
-
|
81
|
+
/** Which keys should be disabled. */
|
82
|
+
disabledKeys: PropTypes.arrayOf(PropTypes.string),
|
84
83
|
|
85
84
|
/** Handler that is called when the selected button has changed. */
|
86
85
|
onSelectionChange: PropTypes.func
|
87
86
|
};
|
88
|
-
RockerButtonGroup.defaultProps = {
|
89
|
-
isDisabled: false
|
90
|
-
};
|
91
87
|
RockerButtonGroup.displayName = 'RockerButtonGroup';
|
92
88
|
export default RockerButtonGroup;
|
@@ -96,23 +96,8 @@ export var withCustomSelectedColors = function withCustomSelectedColors() {
|
|
96
96
|
};
|
97
97
|
export var DisabledSingleButton = function DisabledSingleButton() {
|
98
98
|
return ___EmotionJSX(RockerButtonGroup, {
|
99
|
-
defaultSelectedKey: "or"
|
100
|
-
|
101
|
-
name: "and",
|
102
|
-
key: "and",
|
103
|
-
isDisabled: true
|
104
|
-
}, "And"), ___EmotionJSX(RockerButton, {
|
105
|
-
name: "or",
|
106
|
-
key: "or"
|
107
|
-
}, "Or"), ___EmotionJSX(RockerButton, {
|
108
|
-
name: "maybe",
|
109
|
-
key: "maybe"
|
110
|
-
}, "Maybe"));
|
111
|
-
};
|
112
|
-
export var DisabledRockerButtonGroup = function DisabledRockerButtonGroup() {
|
113
|
-
return ___EmotionJSX(RockerButtonGroup, {
|
114
|
-
isDisabled: true,
|
115
|
-
defaultSelectedKey: "and"
|
99
|
+
defaultSelectedKey: "or",
|
100
|
+
disabledKeys: ['and']
|
116
101
|
}, ___EmotionJSX(RockerButton, {
|
117
102
|
name: "and",
|
118
103
|
key: "and"
|