@pingux/astro 2.143.0-alpha.2 → 2.144.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/AIComponents/Response/ResponseMarkdown/MarkdownContainer.js +2 -2
- package/lib/cjs/components/Checkbox/CheckboxBase.js +3 -1
- package/lib/cjs/components/ComboBox/ComboBoxInput.js +2 -2
- package/lib/cjs/components/DataTable/DataTable.js +4 -4
- package/lib/cjs/components/DataTable/DataTable.stories.js +3 -3
- package/lib/cjs/components/GridList/GridList.stories.d.ts +4 -4
- package/lib/cjs/components/GridList/gridListAttributes.d.ts +4 -4
- package/lib/cjs/components/GridList/gridListAttributes.js +4 -4
- package/lib/cjs/components/IconButtonToggle/IconButtonToggle.js +1 -1
- package/lib/cjs/components/Image/Image.js +5 -5
- package/lib/cjs/components/ListBox/ListBox.js +3 -3
- package/lib/cjs/components/ListBox/Option.js +9 -9
- package/lib/cjs/components/MenuItem/MenuItem.js +4 -4
- package/lib/cjs/components/MultivaluesField/CondensedMultivaluesField.js +2 -2
- package/lib/cjs/components/MultivaluesField/DefaultMultivaluesField.js +2 -2
- package/lib/cjs/components/NavBarSection/NavBarItemHeader.js +5 -5
- package/lib/cjs/components/NavSideBar/NavSideBarSectionHeader.js +5 -5
- package/lib/cjs/components/PopoverMenu/PopoverMenu.js +1 -1
- package/lib/cjs/components/ProgressBar/ProgressBar.js +3 -3
- package/lib/cjs/components/ProgressBar/ProgressBar.stories.js +1 -1
- package/lib/cjs/components/ProgressBar/ProgressBar.test.js +2 -2
- package/lib/cjs/components/RadioField/RadioField.js +3 -3
- package/lib/cjs/components/RockerButton/RockerButton.js +2 -2
- package/lib/cjs/components/SearchField/SearchAutoComplete.js +1 -1
- package/lib/cjs/components/SelectField/SelectField.stories.js +6 -6
- package/lib/cjs/components/Tab/Tab.js +2 -2
- package/lib/cjs/context/MenuContext/index.d.ts +1 -1
- package/lib/cjs/hooks/useComponentToggle/useComponentToggle.d.ts +1 -1
- package/lib/cjs/hooks/useComponentToggle/useComponentToggle.js +6 -6
- package/lib/cjs/hooks/useComponentToggle/useComponentToggle.test.js +6 -6
- package/lib/cjs/hooks/useField/useField.d.ts +2 -2
- package/lib/cjs/hooks/useGridList/useGridList.js +9 -9
- package/lib/cjs/hooks/useInputLoader/useInputLoader.d.ts +2 -2
- package/lib/cjs/hooks/useInputLoader/useInputLoader.js +8 -8
- package/lib/cjs/hooks/useModalState/useModalState.js +2 -2
- package/lib/cjs/hooks/useOverlayPanelState/useOverlayPanelState.js +2 -2
- package/lib/cjs/hooks/useSelectField/useSelectField.js +4 -4
- package/lib/cjs/hooks/useSliderField/useSliderField.d.ts +1 -1
- package/lib/cjs/hooks/useSliderField/useSliderField.js +3 -3
- package/lib/cjs/types/dataTable.d.ts +1 -1
- package/lib/cjs/types/gridList.d.ts +4 -4
- package/lib/cjs/types/listBox.d.ts +2 -2
- package/lib/cjs/types/popoverMenu.d.ts +1 -1
- package/lib/cjs/types/progressBar.d.ts +1 -1
- package/lib/cjs/types/sliderField.d.ts +1 -1
- package/lib/cjs/types/timefield.d.ts +1 -1
- package/lib/cjs/utils/designUtils/figmaLinks.d.ts +1 -1
- package/lib/cjs/utils/designUtils/figmaLinks.js +1 -1
- package/lib/components/AIComponents/Response/ResponseMarkdown/MarkdownContainer.js +2 -2
- package/lib/components/Checkbox/CheckboxBase.js +3 -1
- package/lib/components/ComboBox/ComboBoxInput.js +2 -2
- package/lib/components/DataTable/DataTable.js +4 -4
- package/lib/components/DataTable/DataTable.stories.js +3 -3
- package/lib/components/GridList/gridListAttributes.js +4 -4
- package/lib/components/IconButtonToggle/IconButtonToggle.js +1 -1
- package/lib/components/Image/Image.js +5 -5
- package/lib/components/ListBox/ListBox.js +3 -3
- package/lib/components/ListBox/Option.js +9 -9
- package/lib/components/MenuItem/MenuItem.js +4 -4
- package/lib/components/MultivaluesField/CondensedMultivaluesField.js +2 -2
- package/lib/components/MultivaluesField/DefaultMultivaluesField.js +2 -2
- package/lib/components/NavBarSection/NavBarItemHeader.js +5 -5
- package/lib/components/NavSideBar/NavSideBarSectionHeader.js +5 -5
- package/lib/components/PopoverMenu/PopoverMenu.js +1 -1
- package/lib/components/ProgressBar/ProgressBar.js +3 -3
- package/lib/components/ProgressBar/ProgressBar.stories.js +1 -1
- package/lib/components/ProgressBar/ProgressBar.test.js +2 -2
- package/lib/components/RadioField/RadioField.js +3 -3
- package/lib/components/RockerButton/RockerButton.js +2 -2
- package/lib/components/SearchField/SearchAutoComplete.js +1 -1
- package/lib/components/SelectField/SelectField.stories.js +6 -6
- package/lib/components/Tab/Tab.js +2 -2
- package/lib/hooks/useComponentToggle/useComponentToggle.js +6 -6
- package/lib/hooks/useComponentToggle/useComponentToggle.test.js +6 -6
- package/lib/hooks/useGridList/useGridList.js +9 -9
- package/lib/hooks/useInputLoader/useInputLoader.js +8 -8
- package/lib/hooks/useModalState/useModalState.js +2 -2
- package/lib/hooks/useOverlayPanelState/useOverlayPanelState.js +2 -2
- package/lib/hooks/useSelectField/useSelectField.js +4 -4
- package/lib/hooks/useSliderField/useSliderField.js +3 -3
- package/lib/utils/designUtils/figmaLinks.js +1 -1
- package/package.json +1 -1
@@ -8,7 +8,7 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
8
8
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
9
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
10
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
11
|
-
var _excluded = ["defaultSelectedKeys", "disabledKeys", "hasAutoFocus", "hasFocusWrap", "hasNoEmptySelection", "hasVirtualFocus", "id", "isCondensed", "isLoading", "isFocusedOnHover", "isSelectedOnPressUp", "isVirtualized", "items", "keyboardDelegate", "label", "loadingState", "onLoadMore", "onLoadPrev", "onScroll", "onSelectionChange", "renderEmptyState", "selectedKeys", "selectionMode", "state", "aria-label", "aria-labelledby", "aria-describedby", "aria-details", "
|
11
|
+
var _excluded = ["defaultSelectedKeys", "disabledKeys", "hasAutoFocus", "hasFocusWrap", "hasNoEmptySelection", "hasVirtualFocus", "id", "isCondensed", "isLoading", "isFocusedOnHover", "isSelectedOnPressUp", "isVirtualized", "items", "keyboardDelegate", "label", "loadingState", "onLoadMore", "onLoadPrev", "onScroll", "onSelectionChange", "renderEmptyState", "selectedKeys", "selectionMode", "state", "aria-label", "aria-labelledby", "aria-describedby", "aria-details", "shouldShowSelectedOption"];
|
12
12
|
import _findInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/find";
|
13
13
|
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
|
14
14
|
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; }
|
@@ -82,7 +82,7 @@ var ListBox = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
82
82
|
ariaLabelledby = props['aria-labelledby'],
|
83
83
|
ariaDescribedby = props['aria-describedby'],
|
84
84
|
ariaDetails = props['aria-details'],
|
85
|
-
|
85
|
+
shouldShowSelectedOption = props.shouldShowSelectedOption,
|
86
86
|
others = _objectWithoutProperties(props, _excluded);
|
87
87
|
|
88
88
|
// Object matching React Aria API with all options
|
@@ -184,7 +184,7 @@ var ListBox = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
184
184
|
item: item,
|
185
185
|
hasVirtualFocus: hasVirtualFocus,
|
186
186
|
isCondensed: isCondensed,
|
187
|
-
|
187
|
+
shouldShowSelectedOption: shouldShowSelectedOption
|
188
188
|
});
|
189
189
|
}
|
190
190
|
if (type === collectionTypes.LOADER) {
|
@@ -9,7 +9,7 @@ import _Object$defineProperty from "@babel/runtime-corejs3/core-js-stable/object
|
|
9
9
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
10
10
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
11
11
|
import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
|
12
|
-
var _excluded = ["item", "hasVirtualFocus", "isCondensed", "
|
12
|
+
var _excluded = ["item", "hasVirtualFocus", "isCondensed", "shouldShowSelectedOption"],
|
13
13
|
_excluded2 = ["onPressStart", "onPressUp"];
|
14
14
|
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; }
|
15
15
|
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; }
|
@@ -56,7 +56,7 @@ var Option = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
56
56
|
var item = props.item,
|
57
57
|
hasVirtualFocus = props.hasVirtualFocus,
|
58
58
|
isCondensed = props.isCondensed,
|
59
|
-
|
59
|
+
shouldShowSelectedOption = props.shouldShowSelectedOption,
|
60
60
|
others = _objectWithoutProperties(props, _excluded);
|
61
61
|
var key = item.key,
|
62
62
|
itemProps = item.props,
|
@@ -84,9 +84,9 @@ var Option = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
84
84
|
isFocused = _useOption.isFocused,
|
85
85
|
isFocusVisible = _useOption.isFocusVisible,
|
86
86
|
isPressed = _useOption.isPressed;
|
87
|
-
var
|
87
|
+
var hasFocus = isFocused || (state === null || state === void 0 || (_state$selectionManag = state.selectionManager) === null || _state$selectionManag === void 0 ? void 0 : _state$selectionManag.focusedKey) === item.key;
|
88
88
|
var setFocusOnHover = function setFocusOnHover() {
|
89
|
-
if (!
|
89
|
+
if (!hasFocus && !isCondensed) {
|
90
90
|
state.selectionManager.setFocusedKey(item.key);
|
91
91
|
}
|
92
92
|
};
|
@@ -94,8 +94,8 @@ var Option = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
94
94
|
isOnyx = _useGetTheme.themeState.isOnyx;
|
95
95
|
var _useStatusClasses = useStatusClasses(null, {
|
96
96
|
isDisabled: isDisabled || isSeparator,
|
97
|
-
isFocused:
|
98
|
-
isSelected:
|
97
|
+
isFocused: hasFocus,
|
98
|
+
isSelected: shouldShowSelectedOption ? isSelected : false,
|
99
99
|
isCondensed: isCondensed,
|
100
100
|
isFocusVisible: isFocusVisible,
|
101
101
|
isPressed: isPressed
|
@@ -132,12 +132,12 @@ var Option = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
132
132
|
mr: "xs",
|
133
133
|
className: classNames,
|
134
134
|
variant: "listBox.checkboxIcon"
|
135
|
-
}) : isSelected && !isOnyx &&
|
135
|
+
}) : isSelected && !isOnyx && shouldShowSelectedOption && ___EmotionJSX(Icon, {
|
136
136
|
icon: CircleSmallIcon,
|
137
137
|
title: {
|
138
138
|
name: 'Circle Small Icon'
|
139
139
|
}
|
140
|
-
}), rendered, isSelected && isOnyx &&
|
140
|
+
}), rendered, isSelected && isOnyx && shouldShowSelectedOption && ___EmotionJSX(Icon, {
|
141
141
|
icon: CheckIcon,
|
142
142
|
title: {
|
143
143
|
name: 'Check Icon'
|
@@ -146,6 +146,6 @@ var Option = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
146
146
|
}));
|
147
147
|
});
|
148
148
|
Option.defaultProps = {
|
149
|
-
|
149
|
+
shouldShowSelectedOption: true
|
150
150
|
};
|
151
151
|
export default Option;
|
@@ -17,14 +17,14 @@ import Box from '../Box';
|
|
17
17
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
18
18
|
var MenuItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
19
19
|
var item = props.item,
|
20
|
-
|
20
|
+
isPropDisabled = props.isDisabled,
|
21
21
|
isFocusVisible = props.isFocusVisible,
|
22
22
|
isNotFocusedOnHover = props.isNotFocusedOnHover,
|
23
23
|
className = props.className,
|
24
24
|
state = props.state;
|
25
25
|
var _useMenuContext = useMenuContext(),
|
26
26
|
onClose = _useMenuContext.onClose,
|
27
|
-
|
27
|
+
shouldCloseOnSelect = _useMenuContext.shouldCloseOnSelect;
|
28
28
|
var _ref = item,
|
29
29
|
key = _ref.key,
|
30
30
|
rendered = _ref.rendered,
|
@@ -33,7 +33,7 @@ var MenuItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
33
33
|
propIsPressed = itemProps.isPressed,
|
34
34
|
dataId = itemProps['data-id'],
|
35
35
|
others = _objectWithoutProperties(itemProps, _excluded);
|
36
|
-
var isDisabled =
|
36
|
+
var isDisabled = isPropDisabled || state.disabledKeys.has(key);
|
37
37
|
var isSelected = state.selectionManager.isSelected(key);
|
38
38
|
usePropWarning(props, 'disabled', 'isDisabled');
|
39
39
|
var menuItemRef = useLocalOrForwardRef(ref);
|
@@ -43,7 +43,7 @@ var MenuItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
43
43
|
isDisabled: isDisabled,
|
44
44
|
isSelected: isSelected,
|
45
45
|
onClose: onClose,
|
46
|
-
closeOnSelect:
|
46
|
+
closeOnSelect: shouldCloseOnSelect
|
47
47
|
}, state, menuItemRef),
|
48
48
|
menuItemProps = _useMenuItem.menuItemProps;
|
49
49
|
var _useState = useState(false),
|
@@ -110,7 +110,7 @@ var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
110
110
|
loadingState: loadingState,
|
111
111
|
inputValue: filterString
|
112
112
|
}),
|
113
|
-
|
113
|
+
isLoading = _useInputLoader.isLoading;
|
114
114
|
useEffect(function () {
|
115
115
|
setInitialItems(_Array$from(items));
|
116
116
|
}, []);
|
@@ -379,7 +379,7 @@ var CondensedMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
379
379
|
variant: "forms.comboBox.inputInContainerSlot"
|
380
380
|
},
|
381
381
|
// Render loader after delay if filtering or loading
|
382
|
-
|
382
|
+
isLoading && (isOpen || loadingState === loadingStates.LOADING) && ___EmotionJSX(Loader, {
|
383
383
|
variant: "loader.withinInput"
|
384
384
|
}), ___EmotionJSX(Box, {
|
385
385
|
as: "button",
|
@@ -147,7 +147,7 @@ var DefaultMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
147
147
|
loadingState: loadingState,
|
148
148
|
inputValue: filterString
|
149
149
|
}),
|
150
|
-
|
150
|
+
isLoading = _useInputLoader.isLoading;
|
151
151
|
var closeBadgeRefs = useRef([]);
|
152
152
|
var inputWrapperRef = useRef();
|
153
153
|
var inputRef = useRef();
|
@@ -506,7 +506,7 @@ var DefaultMultivaluesField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
506
506
|
variant: "forms.comboBox.inputInContainerSlot"
|
507
507
|
},
|
508
508
|
// Render loader after delay if filtering or loading
|
509
|
-
|
509
|
+
isLoading && loadingState === loadingStates.LOADING && ___EmotionJSX(Loader, {
|
510
510
|
variant: "loader.withinInput"
|
511
511
|
}));
|
512
512
|
return ___EmotionJSX(MultivaluesContext.Provider, {
|
@@ -38,22 +38,22 @@ var NavBarSectionItemHeader = function NavBarSectionItemHeader(_ref2) {
|
|
38
38
|
var array = (item === null || item === void 0 ? void 0 : item.children) && _mapInstanceProperty(_context = item.children).call(_context, function (i) {
|
39
39
|
return i.key;
|
40
40
|
});
|
41
|
-
var
|
41
|
+
var isChildSelected = array && _includesInstanceProperty(array).call(array, navBarState.selectedKey);
|
42
42
|
useEffect(function () {
|
43
|
-
if (
|
43
|
+
if (isChildSelected && isExpanded === false) {
|
44
44
|
var _context2;
|
45
45
|
setExpandedKeys(_concatInstanceProperty(_context2 = []).call(_context2, expandedKeys, [key]));
|
46
46
|
}
|
47
47
|
}, [selectedKey]);
|
48
48
|
var _useStatusClasses = useStatusClasses(className, {
|
49
|
-
isSelected:
|
49
|
+
isSelected: isChildSelected && !isExpanded
|
50
50
|
}),
|
51
51
|
classNames = _useStatusClasses.classNames;
|
52
52
|
var getIconColor = function getIconColor() {
|
53
53
|
if (navStyles.navBarItemHeader === 'navBar.popUpItemHeaderContainer') {
|
54
|
-
return
|
54
|
+
return isChildSelected && !isExpanded ? 'white' : 'text.primary';
|
55
55
|
}
|
56
|
-
return
|
56
|
+
return isChildSelected && !isExpanded ? 'white' : 'neutral.95';
|
57
57
|
};
|
58
58
|
return ___EmotionJSX(Box, {
|
59
59
|
variant: navStyles.navBarItemHeader,
|
@@ -30,23 +30,23 @@ var NavSideBarSectionHeader = function NavSideBarSectionHeader(props) {
|
|
30
30
|
navStyles = navBarState.navStyles,
|
31
31
|
selectedKey = navBarState.selectedKey;
|
32
32
|
var isExpanded = _includesInstanceProperty(expandedKeys).call(expandedKeys, id);
|
33
|
-
var
|
33
|
+
var isChildSelected = _Array$isArray(items) && _includesInstanceProperty(_context = _mapInstanceProperty(items).call(items, function (i) {
|
34
34
|
return i.key;
|
35
35
|
})).call(_context, selectedKey);
|
36
36
|
useEffect(function () {
|
37
|
-
if (
|
37
|
+
if (isChildSelected && isExpanded === false) {
|
38
38
|
var _context2;
|
39
39
|
setExpandedKeys(_concatInstanceProperty(_context2 = []).call(_context2, expandedKeys, [id]));
|
40
40
|
}
|
41
41
|
}, []);
|
42
42
|
var _useStatusClasses = useStatusClasses(className, {
|
43
|
-
isSelected:
|
43
|
+
isSelected: isChildSelected && !isExpanded
|
44
44
|
}),
|
45
45
|
classNames = _useStatusClasses.classNames;
|
46
|
-
var variant =
|
46
|
+
var variant = isChildSelected && !isExpanded ? navStyles.navBarItemIcon : navStyles.navBarItemIconSelected;
|
47
47
|
var handleButtonPress = function handleButtonPress() {
|
48
48
|
onExpandedChange(!isExpanded);
|
49
|
-
if (
|
49
|
+
if (isChildSelected && isExpanded === false) {
|
50
50
|
var _context3;
|
51
51
|
setExpandedKeys(_concatInstanceProperty(_context3 = []).call(_context3, expandedKeys, [id]));
|
52
52
|
}
|
@@ -66,7 +66,7 @@ var PopoverMenu = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
66
66
|
ref: menuRef,
|
67
67
|
onClose: state.close,
|
68
68
|
// Our API preference is for default false so we invert this since it should be default true
|
69
|
-
|
69
|
+
shouldCloseOnSelect: !isNotClosedOnSelect,
|
70
70
|
autoFocus: state.focusStrategy || true
|
71
71
|
});
|
72
72
|
var contents = ___EmotionJSX(FocusScope, {
|
@@ -19,8 +19,8 @@ export var calculateBarWidth = function calculateBarWidth(value, minValue, maxVa
|
|
19
19
|
var ProgressBar = /*#__PURE__*/forwardRef(function (props, ref) {
|
20
20
|
var _props$label = props.label,
|
21
21
|
label = _props$label === void 0 ? '' : _props$label,
|
22
|
-
_props$
|
23
|
-
|
22
|
+
_props$shouldShowValu = props.shouldShowValueLabel,
|
23
|
+
shouldShowValueLabel = _props$shouldShowValu === void 0 ? true : _props$shouldShowValu,
|
24
24
|
value = props.value,
|
25
25
|
_props$minValue = props.minValue,
|
26
26
|
minValue = _props$minValue === void 0 ? 0 : _props$minValue,
|
@@ -44,7 +44,7 @@ var ProgressBar = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
44
44
|
}, label && ___EmotionJSX(Text, _extends({
|
45
45
|
fontSize: "xs",
|
46
46
|
fontWeight: "3"
|
47
|
-
}, labelProps), label),
|
47
|
+
}, labelProps), label), shouldShowValueLabel && ___EmotionJSX(Text, {
|
48
48
|
fontSize: "xs",
|
49
49
|
fontWeight: "3"
|
50
50
|
}, progressBarProps['aria-valuetext'])), ___EmotionJSX(Box, {
|
@@ -57,10 +57,10 @@ test('renders value as custom valueLabel instead of percentage', function () {
|
|
57
57
|
expect(value).not.toBeInTheDocument();
|
58
58
|
expect(valueLabel).toBeInTheDocument();
|
59
59
|
});
|
60
|
-
test('does not render value when
|
60
|
+
test('does not render value when shouldShowValueLabel is false', function () {
|
61
61
|
getComponent({
|
62
62
|
value: 25,
|
63
|
-
|
63
|
+
shouldShowValueLabel: false
|
64
64
|
});
|
65
65
|
var valueLabel = screen.queryByText('25%');
|
66
66
|
expect(valueLabel).not.toBeInTheDocument();
|
@@ -33,14 +33,14 @@ var RadioField = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
33
33
|
controlProps = props.controlProps,
|
34
34
|
hasAutoFocus = props.hasAutoFocus,
|
35
35
|
helperText = props.helperText,
|
36
|
-
|
36
|
+
isRadioDisabled = props.isDisabled,
|
37
37
|
label = props.label,
|
38
38
|
status = props.status;
|
39
39
|
usePropWarning(props, 'disabled', 'isDisabled');
|
40
40
|
var radioFieldRef = useLocalOrForwardRef(ref);
|
41
41
|
var state = useContext(RadioContext);
|
42
|
-
var
|
43
|
-
var isDisabled =
|
42
|
+
var isGroupDisabled = state.isDisabled;
|
43
|
+
var isDisabled = isRadioDisabled || isGroupDisabled;
|
44
44
|
var _useRadio = useRadio(_objectSpread(_objectSpread({
|
45
45
|
children: label,
|
46
46
|
autoFocus: hasAutoFocus
|
@@ -44,12 +44,12 @@ export var RockerButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
44
44
|
}), state, rockerButtonRef),
|
45
45
|
rockerButtonProps = _useToggleButtonGroup.buttonProps,
|
46
46
|
isSelected = _useToggleButtonGroup.isSelected,
|
47
|
-
|
47
|
+
isRaDisabled = _useToggleButtonGroup.isDisabled,
|
48
48
|
isPressed = _useToggleButtonGroup.isPressed;
|
49
49
|
var _useStatusClasses = useStatusClasses(className, {
|
50
50
|
isHovered: isHovered,
|
51
51
|
isPressed: isPressed,
|
52
|
-
isDisabled:
|
52
|
+
isDisabled: isRaDisabled,
|
53
53
|
isSelected: isSelected
|
54
54
|
}),
|
55
55
|
classNames = _useStatusClasses.classNames;
|
@@ -151,6 +151,6 @@ export var SearchAutoComplete = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
151
151
|
state: comboBoxState,
|
152
152
|
isFocusedOnHover: shouldFocusOnHover,
|
153
153
|
isSelectedOnPressUp: shouldSelectOnPressUp,
|
154
|
-
|
154
|
+
shouldShowSelectedOption: false
|
155
155
|
}, otherListBoxProps)))));
|
156
156
|
});
|
@@ -393,8 +393,8 @@ export var AsyncLoading = function AsyncLoading() {
|
|
393
393
|
setDataSize = _useState10[1];
|
394
394
|
var _useState11 = useState(true),
|
395
395
|
_useState12 = _slicedToArray(_useState11, 2),
|
396
|
-
|
397
|
-
|
396
|
+
isLoading = _useState12[0],
|
397
|
+
setIsLoading = _useState12[1];
|
398
398
|
var fetchData = useCallback( /*#__PURE__*/function () {
|
399
399
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(currentLimit) {
|
400
400
|
var response, json;
|
@@ -414,14 +414,14 @@ export var AsyncLoading = function AsyncLoading() {
|
|
414
414
|
setData(json.body._embedded.users || []);
|
415
415
|
setDataSize(json.body.count);
|
416
416
|
}
|
417
|
-
|
417
|
+
setIsLoading(false);
|
418
418
|
_context3.next = 15;
|
419
419
|
break;
|
420
420
|
case 11:
|
421
421
|
_context3.prev = 11;
|
422
422
|
_context3.t0 = _context3["catch"](0);
|
423
423
|
console.error('Fetch error:', _context3.t0);
|
424
|
-
|
424
|
+
setIsLoading(false);
|
425
425
|
case 15:
|
426
426
|
case "end":
|
427
427
|
return _context3.stop();
|
@@ -434,7 +434,7 @@ export var AsyncLoading = function AsyncLoading() {
|
|
434
434
|
}(), []);
|
435
435
|
var handleLoadMore = function handleLoadMore() {
|
436
436
|
if (limit >= dataSize) return;
|
437
|
-
|
437
|
+
setIsLoading(true);
|
438
438
|
setLimit(function (prevLimit) {
|
439
439
|
return prevLimit + LIMIT;
|
440
440
|
});
|
@@ -445,7 +445,7 @@ export var AsyncLoading = function AsyncLoading() {
|
|
445
445
|
return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(SelectField, {
|
446
446
|
label: "Pick a User",
|
447
447
|
items: data,
|
448
|
-
isLoading:
|
448
|
+
isLoading: isLoading,
|
449
449
|
onLoadMore: handleLoadMore
|
450
450
|
}, function (item) {
|
451
451
|
var user = item;
|
@@ -18,7 +18,7 @@ import { jsx as ___EmotionJSX } from "@emotion/react";
|
|
18
18
|
export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
|
19
19
|
var className = props.className,
|
20
20
|
item = props.item,
|
21
|
-
|
21
|
+
isTabsDisabled = props.isDisabled,
|
22
22
|
isRequired = props.isRequired,
|
23
23
|
orientation = props.orientation,
|
24
24
|
mode = props.mode,
|
@@ -27,7 +27,7 @@ export var CollectionTab = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
27
27
|
rendered = item.rendered,
|
28
28
|
itemProps = item.props;
|
29
29
|
var state = useContext(TabsContext);
|
30
|
-
var isDisabled =
|
30
|
+
var isDisabled = isTabsDisabled || (itemProps === null || itemProps === void 0 ? void 0 : itemProps.isDisabled) || state.disabledKeys.has(key);
|
31
31
|
var isSelected = state.selectedKey === key;
|
32
32
|
var _useFocusRing = useFocusRing(),
|
33
33
|
isFocusVisible = _useFocusRing.isFocusVisible,
|
@@ -4,21 +4,21 @@ import { useProgressiveState } from '../index';
|
|
4
4
|
var useComponentToggle = function useComponentToggle(props) {
|
5
5
|
var ComponentToRenderIfTrue = props.ComponentToRenderIfTrue,
|
6
6
|
ComponentToRenderIfFalse = props.ComponentToRenderIfFalse,
|
7
|
-
|
7
|
+
isToggled = props.isToggled,
|
8
8
|
onConditionChange = props.onConditionChange;
|
9
|
-
var _useProgressiveState = useProgressiveState(
|
9
|
+
var _useProgressiveState = useProgressiveState(isToggled, false),
|
10
10
|
_useProgressiveState2 = _slicedToArray(_useProgressiveState, 2),
|
11
|
-
|
11
|
+
isToggledState = _useProgressiveState2[0],
|
12
12
|
setIsToggled = _useProgressiveState2[1];
|
13
|
-
var RenderedComponent =
|
13
|
+
var RenderedComponent = isToggledState ? ComponentToRenderIfTrue : ComponentToRenderIfFalse;
|
14
14
|
var handleConditionChange = function handleConditionChange() {
|
15
|
-
setIsToggled(!
|
15
|
+
setIsToggled(!isToggledState);
|
16
16
|
if (onConditionChange) {
|
17
17
|
var _context;
|
18
18
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
19
19
|
args[_key] = arguments[_key];
|
20
20
|
}
|
21
|
-
onConditionChange.apply(void 0, _concatInstanceProperty(_context = [!
|
21
|
+
onConditionChange.apply(void 0, _concatInstanceProperty(_context = [!isToggledState]).call(_context, args));
|
22
22
|
}
|
23
23
|
};
|
24
24
|
return {
|
@@ -17,9 +17,9 @@ import userEvent from '@testing-library/user-event';
|
|
17
17
|
import useComponentToggle from './useComponentToggle';
|
18
18
|
import { jsx as ___EmotionJSX } from "@emotion/react";
|
19
19
|
var callback = jest.fn();
|
20
|
-
var
|
20
|
+
var isToggled = false;
|
21
21
|
var defaultProps = {
|
22
|
-
|
22
|
+
isToggled: isToggled,
|
23
23
|
onConditionChange: callback,
|
24
24
|
ComponentToRenderIfTrue: ___EmotionJSX("span", null, "true-string"),
|
25
25
|
ComponentToRenderIfFalse: ___EmotionJSX("span", null, "false-string")
|
@@ -27,11 +27,11 @@ var defaultProps = {
|
|
27
27
|
var TestComponent = function TestComponent() {
|
28
28
|
var _useState = useState(false),
|
29
29
|
_useState2 = _slicedToArray(_useState, 2),
|
30
|
-
|
31
|
-
|
30
|
+
isToggledState = _useState2[0],
|
31
|
+
setIsToggledState = _useState2[1];
|
32
32
|
var conditionalRenderProps = {
|
33
|
-
|
34
|
-
onConditionChange:
|
33
|
+
isToggled: isToggledState,
|
34
|
+
onConditionChange: setIsToggledState,
|
35
35
|
ComponentToRenderIfTrue: ___EmotionJSX("span", null, "true-string"),
|
36
36
|
ComponentToRenderIfFalse: ___EmotionJSX("span", null, "false-string"),
|
37
37
|
onConditionChangeProp: callback
|
@@ -15,15 +15,15 @@ import { useListData } from '@react-stately/data';
|
|
15
15
|
import useReorderableCollection from '../useReorderableCollection';
|
16
16
|
var useGridList = function useGridList(props) {
|
17
17
|
var acceptedDragTypes = props.acceptedDragTypes,
|
18
|
-
|
19
|
-
|
18
|
+
shouldAllowDuplicateSelectionEvents = props.shouldAllowDuplicateSelectionEvents,
|
19
|
+
hasAutoFocus = props.hasAutoFocus,
|
20
20
|
children = props.children,
|
21
21
|
collection = props.collection,
|
22
22
|
defaultSelectedKeys = props.defaultSelectedKeys,
|
23
23
|
disabledBehavior = props.disabledBehavior,
|
24
24
|
disabledKeys = props.disabledKeys,
|
25
|
-
|
26
|
-
|
25
|
+
shouldDisallowEmptySelection = props.shouldDisallowEmptySelection,
|
26
|
+
shouldDisallowTypeAhead = props.shouldDisallowTypeAhead,
|
27
27
|
escapeKeyBehavior = props.escapeKeyBehavior,
|
28
28
|
filter = _filterInstanceProperty(props),
|
29
29
|
getDropOperation = props.getDropOperation,
|
@@ -92,13 +92,13 @@ var useGridList = function useGridList(props) {
|
|
92
92
|
initialSelectedKeys: initialSelectedKeys
|
93
93
|
};
|
94
94
|
var listStateOptions = {
|
95
|
-
|
95
|
+
shouldAllowDuplicateSelectionEvents: shouldAllowDuplicateSelectionEvents,
|
96
96
|
children: children,
|
97
97
|
collection: collection,
|
98
98
|
defaultSelectedKeys: defaultSelectedKeys,
|
99
99
|
disabledBehavior: disabledBehavior,
|
100
100
|
disabledKeys: disabledKeys,
|
101
|
-
disallowEmptySelection:
|
101
|
+
disallowEmptySelection: shouldDisallowEmptySelection,
|
102
102
|
filter: filter,
|
103
103
|
onSelectionChange: onSelectionChange,
|
104
104
|
selectedKeys: selectedKeys,
|
@@ -110,12 +110,12 @@ var useGridList = function useGridList(props) {
|
|
110
110
|
items: list.items
|
111
111
|
}));
|
112
112
|
var gridOptions = {
|
113
|
-
autoFocus:
|
113
|
+
autoFocus: hasAutoFocus,
|
114
114
|
defaultSelectedKeys: defaultSelectedKeys,
|
115
115
|
disabledBehavior: disabledBehavior,
|
116
116
|
disabledKeys: disabledKeys,
|
117
|
-
disallowEmptySelection:
|
118
|
-
disallowTypeAhead:
|
117
|
+
disallowEmptySelection: shouldDisallowEmptySelection,
|
118
|
+
disallowTypeAhead: shouldDisallowTypeAhead,
|
119
119
|
escapeKeyBehavior: escapeKeyBehavior,
|
120
120
|
items: list.items,
|
121
121
|
keyboardDelegate: keyboardDelegate,
|
@@ -8,16 +8,16 @@ var useInputLoader = function useInputLoader(_ref) {
|
|
8
8
|
// START - minimum delay time for loading indicator = 500ms
|
9
9
|
var _useState = useState(false),
|
10
10
|
_useState2 = _slicedToArray(_useState, 2),
|
11
|
-
|
12
|
-
|
11
|
+
isLoadingState = _useState2[0],
|
12
|
+
setIsLoading = _useState2[1];
|
13
13
|
var isLoading = loadingState === loadingStates.LOADING || loadingState === loadingStates.FILTERING;
|
14
14
|
var lastInputValue = useRef(inputValue);
|
15
15
|
var timeout = useRef(null);
|
16
16
|
useEffect(function () {
|
17
|
-
if (isLoading && !
|
17
|
+
if (isLoading && !isLoadingState) {
|
18
18
|
if (timeout.current === null) {
|
19
19
|
timeout.current = _setTimeout(function () {
|
20
|
-
|
20
|
+
setIsLoading(true);
|
21
21
|
}, 500);
|
22
22
|
}
|
23
23
|
|
@@ -25,21 +25,21 @@ var useInputLoader = function useInputLoader(_ref) {
|
|
25
25
|
if (inputValue !== lastInputValue.current) {
|
26
26
|
clearTimeout(timeout.current);
|
27
27
|
timeout.current = _setTimeout(function () {
|
28
|
-
|
28
|
+
setIsLoading(true);
|
29
29
|
}, 500);
|
30
30
|
}
|
31
31
|
} else if (!isLoading) {
|
32
32
|
// If loading is no longer happening, clear any timers and hide the loader
|
33
|
-
|
33
|
+
setIsLoading(false);
|
34
34
|
if (timeout.current) {
|
35
35
|
clearTimeout(timeout.current);
|
36
36
|
timeout.current = null;
|
37
37
|
}
|
38
38
|
}
|
39
39
|
lastInputValue.current = inputValue;
|
40
|
-
}, [isLoading,
|
40
|
+
}, [isLoading, isLoadingState, inputValue]);
|
41
41
|
return {
|
42
|
-
|
42
|
+
isLoading: isLoadingState
|
43
43
|
};
|
44
44
|
// END - minimum delay time for loading indicator = 500ms
|
45
45
|
};
|
@@ -22,8 +22,8 @@ var useModalState = function useModalState() {
|
|
22
22
|
isOpen: isOpen,
|
23
23
|
onOpenChange: onOpenChange
|
24
24
|
});
|
25
|
-
var
|
26
|
-
var isTransitioning = useMountTransition(
|
25
|
+
var isModalOpen = state.isOpen;
|
26
|
+
var isTransitioning = useMountTransition(isModalOpen, transitionDuration || 300);
|
27
27
|
var returnState = _objectSpread(_objectSpread({}, state), {}, {
|
28
28
|
isTransitioning: isTransitioning
|
29
29
|
});
|
@@ -23,8 +23,8 @@ var useOverlayPanelState = function useOverlayPanelState() {
|
|
23
23
|
isOpen: isOpen,
|
24
24
|
onOpenChange: onOpenChange
|
25
25
|
});
|
26
|
-
var
|
27
|
-
var isTransitioning = useMountTransition(
|
26
|
+
var isPanelOpen = state.isOpen;
|
27
|
+
var isTransitioning = useMountTransition(isPanelOpen, transitionDuration);
|
28
28
|
var onClose = function onClose(stateProp, triggerRef, onCloseProp) {
|
29
29
|
if (stateProp) {
|
30
30
|
stateProp.close();
|
@@ -31,8 +31,8 @@ var useSelectField = function useSelectField(props, ref) {
|
|
31
31
|
defaultText = props.defaultText,
|
32
32
|
direction = props.direction,
|
33
33
|
disabledKeys = props.disabledKeys,
|
34
|
-
|
35
|
-
|
34
|
+
hasNoEmptySelection = props.hasNoEmptySelection,
|
35
|
+
isDefaultOpen = props.isDefaultOpen,
|
36
36
|
isDisabled = props.isDisabled,
|
37
37
|
isLoading = props.isLoading,
|
38
38
|
isNotFlippable = props.isNotFlippable,
|
@@ -73,9 +73,9 @@ var useSelectField = function useSelectField(props, ref) {
|
|
73
73
|
onLoadMore: onLoadMore,
|
74
74
|
onOpenChange: onOpenChange,
|
75
75
|
onSelectionChange: onSelectionChange,
|
76
|
-
defaultOpen:
|
76
|
+
defaultOpen: isDefaultOpen,
|
77
77
|
// must match React Aria API
|
78
|
-
disallowEmptySelection:
|
78
|
+
disallowEmptySelection: hasNoEmptySelection,
|
79
79
|
// must match React Aria API
|
80
80
|
shouldFlip: shouldFlip
|
81
81
|
}, controlProps), {}, {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
2
2
|
import _objectWithoutProperties from "@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";
|
3
|
-
var _excluded = ["activeTrackProps", "
|
3
|
+
var _excluded = ["activeTrackProps", "hasAutoFocus", "className", "defaultValue", "displayValue", "formatOptions", "helperTextProps", "helpHintProps", "hintText", "isDisabled", "isDisplayValueHidden", "isMultiThumb", "label", "labelProps", "maxValue", "minValue", "name", "onBlur", "onChange", "onChangeEnd", "onFocus", "onFocusChange", "onKeyDown", "onKeyUp", "orientation", "outputProps", "size", "status", "step", "sx", "thumbProps", "trackProps", "trackRef", "value", "wrapperProps"];
|
4
4
|
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; }
|
5
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context2, _context3; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? _forEachInstanceProperty(_context2 = ownKeys(Object(source), !0)).call(_context2, function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : _forEachInstanceProperty(_context3 = ownKeys(Object(source))).call(_context3, function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
6
6
|
import _concatInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/concat";
|
@@ -63,7 +63,7 @@ export var getLengthValuesMultiThumb = function getLengthValuesMultiThumb(minVal
|
|
63
63
|
};
|
64
64
|
var useSliderField = function useSliderField(props) {
|
65
65
|
var activeTrackProps = props.activeTrackProps,
|
66
|
-
|
66
|
+
hasAutoFocus = props.hasAutoFocus,
|
67
67
|
className = props.className,
|
68
68
|
defaultValueProp = props.defaultValue,
|
69
69
|
displayValueProp = props.displayValue,
|
@@ -146,7 +146,7 @@ var useSliderField = function useSliderField(props) {
|
|
146
146
|
}
|
147
147
|
}, [maxValue, state]);
|
148
148
|
var thumbOptions = _objectSpread(_objectSpread({}, thumbProps), {}, {
|
149
|
-
|
149
|
+
hasAutoFocus: hasAutoFocus,
|
150
150
|
isDisabled: isDisabled,
|
151
151
|
name: name,
|
152
152
|
onBlur: onBlur,
|
@@ -48,7 +48,7 @@ export var FIGMA_LINKS = {
|
|
48
48
|
unavailableDates: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-15681&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
49
49
|
minimumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16197&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
50
50
|
maximumDate: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16454&mode=design&t=PX1Q47IuuVvOafDQ-4',
|
51
|
-
|
51
|
+
hasAutofocus: 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=46454-16768&mode=design&t=PX1Q47IuuVvOafDQ-4'
|
52
52
|
},
|
53
53
|
callout: {
|
54
54
|
"default": 'https://www.figma.com/file/bpbEw54gTTcdIiZs4PKK1p/Astro-Specs?type=design&node-id=45647%3A506&mode=dev',
|