@carbon/react 1.35.0 → 1.36.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/es/components/Breadcrumb/index.d.ts +11 -0
- package/es/components/BreadcrumbItem/index.d.ts +7 -0
- package/es/components/ComboBox/ComboBox.js +1 -2
- package/es/components/ComboBox/index.d.ts +9 -0
- package/es/components/DataTableSkeleton/DataTableSkeleton.d.ts +4 -0
- package/es/components/DatePicker/DatePicker.Skeleton.d.ts +9 -1
- package/es/components/DatePicker/DatePicker.Skeleton.js +7 -5
- package/es/components/DatePicker/DatePicker.js +1 -0
- package/es/components/DatePickerInput/DatePickerInput.js +1 -2
- package/es/components/DatePickerInput/index.d.ts +9 -0
- package/es/components/ExpandableSearch/index.d.ts +9 -0
- package/es/components/FileUploader/index.d.ts +14 -0
- package/es/components/FormGroup/FormGroup.js +1 -2
- package/es/components/FormGroup/index.d.ts +9 -0
- package/es/components/Loading/index.d.ts +9 -0
- package/es/components/NumberInput/index.d.ts +8 -0
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +1 -2
- package/es/components/OverflowMenuItem/index.d.ts +9 -0
- package/es/components/RadioButton/RadioButton.js +1 -2
- package/es/components/RadioButton/index.d.ts +9 -0
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +1 -2
- package/es/components/RadioButtonGroup/index.d.ts +9 -0
- package/es/components/Search/Search.js +2 -2
- package/es/components/Select/Select.Skeleton.js +1 -2
- package/es/components/Select/Select.js +1 -2
- package/es/components/Select/index.d.ts +10 -0
- package/es/components/SelectItem/SelectItem.js +1 -2
- package/es/components/SelectItem/index.d.ts +9 -0
- package/es/components/SelectItemGroup/SelectItemGroup.js +1 -2
- package/es/components/SelectItemGroup/index.d.ts +9 -0
- package/es/components/StructuredList/StructuredList.js +10 -2
- package/es/components/TimePicker/TimePicker.js +1 -2
- package/es/components/TimePicker/index.d.ts +9 -0
- package/es/components/TimePickerSelect/TimePickerSelect.js +1 -2
- package/es/components/TimePickerSelect/index.d.ts +9 -0
- package/es/components/UIShell/HeaderPanel.js +2 -2
- package/es/components/UIShell/SideNav.js +5 -1
- package/es/index.js +25 -25
- package/es/types/common.d.ts +1 -1
- package/lib/components/Breadcrumb/index.d.ts +11 -0
- package/lib/components/BreadcrumbItem/index.d.ts +7 -0
- package/lib/components/ComboBox/ComboBox.js +1 -2
- package/lib/components/ComboBox/index.d.ts +9 -0
- package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +4 -0
- package/lib/components/DatePicker/DatePicker.Skeleton.d.ts +9 -1
- package/lib/components/DatePicker/DatePicker.Skeleton.js +7 -5
- package/lib/components/DatePicker/DatePicker.js +1 -0
- package/lib/components/DatePickerInput/DatePickerInput.js +1 -2
- package/lib/components/DatePickerInput/index.d.ts +9 -0
- package/lib/components/ExpandableSearch/index.d.ts +9 -0
- package/lib/components/FileUploader/index.d.ts +14 -0
- package/lib/components/FormGroup/FormGroup.js +1 -2
- package/lib/components/FormGroup/index.d.ts +9 -0
- package/lib/components/Loading/index.d.ts +9 -0
- package/lib/components/NumberInput/index.d.ts +8 -0
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +1 -2
- package/lib/components/OverflowMenuItem/index.d.ts +9 -0
- package/lib/components/RadioButton/RadioButton.js +1 -2
- package/lib/components/RadioButton/index.d.ts +9 -0
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +1 -2
- package/lib/components/RadioButtonGroup/index.d.ts +9 -0
- package/lib/components/Search/Search.js +2 -2
- package/lib/components/Select/Select.Skeleton.js +1 -2
- package/lib/components/Select/Select.js +1 -2
- package/lib/components/Select/index.d.ts +10 -0
- package/lib/components/SelectItem/SelectItem.js +1 -2
- package/lib/components/SelectItem/index.d.ts +9 -0
- package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -2
- package/lib/components/SelectItemGroup/index.d.ts +9 -0
- package/lib/components/StructuredList/StructuredList.js +10 -2
- package/lib/components/TimePicker/TimePicker.js +1 -2
- package/lib/components/TimePicker/index.d.ts +9 -0
- package/lib/components/TimePickerSelect/TimePickerSelect.js +1 -2
- package/lib/components/TimePickerSelect/index.d.ts +9 -0
- package/lib/components/UIShell/HeaderPanel.js +2 -2
- package/lib/components/UIShell/SideNav.js +5 -1
- package/lib/index.js +50 -50
- package/lib/types/common.d.ts +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import Breadcrumb from './Breadcrumb';
|
|
8
|
+
import BreadcrumbItem from './BreadcrumbItem';
|
|
9
|
+
import BreadcrumbSkeleton from './Breadcrumb.Skeleton';
|
|
10
|
+
export { Breadcrumb, BreadcrumbItem, BreadcrumbSkeleton };
|
|
11
|
+
export default Breadcrumb;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import ComboBox from './ComboBox';
|
|
8
|
+
export default ComboBox;
|
|
9
|
+
export { ComboBox };
|
|
@@ -45,6 +45,10 @@ export interface DataTableSkeletonProps extends TableHTMLAttributes<HTMLTableEle
|
|
|
45
45
|
* Optionally specify whether you want the DataTable to be zebra striped
|
|
46
46
|
*/
|
|
47
47
|
zebra?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Optionally specify whether you want the DataTable to be styled
|
|
50
|
+
*/
|
|
51
|
+
className?: string;
|
|
48
52
|
}
|
|
49
53
|
declare const DataTableSkeleton: FunctionComponent<DataTableSkeletonProps>;
|
|
50
54
|
export default DataTableSkeleton;
|
|
@@ -8,14 +8,22 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { type HTMLAttributes } from 'react';
|
|
9
9
|
export interface DatePickerSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
10
|
range?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Specify whether the label should be hidden, or not
|
|
13
|
+
*/
|
|
14
|
+
hideLabel?: boolean;
|
|
11
15
|
}
|
|
12
16
|
declare const DatePickerSkeleton: {
|
|
13
|
-
({ range, id, className, ...rest }: DatePickerSkeletonProps): JSX.Element;
|
|
17
|
+
({ range, id, hideLabel, className, ...rest }: DatePickerSkeletonProps): JSX.Element;
|
|
14
18
|
propTypes: {
|
|
15
19
|
/**
|
|
16
20
|
* Specify an optional className to add.
|
|
17
21
|
*/
|
|
18
22
|
className: PropTypes.Requireable<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Specify whether the label should be hidden, or not
|
|
25
|
+
*/
|
|
26
|
+
hideLabel: PropTypes.Requireable<boolean>;
|
|
19
27
|
/**
|
|
20
28
|
* Specify the id to add.
|
|
21
29
|
*/
|
|
@@ -15,18 +15,16 @@ const DatePickerSkeleton = _ref => {
|
|
|
15
15
|
let {
|
|
16
16
|
range,
|
|
17
17
|
id,
|
|
18
|
+
hideLabel,
|
|
18
19
|
className,
|
|
19
20
|
...rest
|
|
20
21
|
} = _ref;
|
|
21
22
|
const prefix = usePrefix();
|
|
22
23
|
const dateInput = /*#__PURE__*/React__default.createElement("div", {
|
|
23
24
|
className: `${prefix}--date-picker-container`
|
|
24
|
-
},
|
|
25
|
-
/*#__PURE__*/
|
|
26
|
-
/* eslint-disable jsx-a11y/label-has-for,jsx-a11y/label-has-associated-control */
|
|
27
|
-
React__default.createElement("label", {
|
|
25
|
+
}, !hideLabel && /*#__PURE__*/React__default.createElement("span", {
|
|
28
26
|
className: `${prefix}--label`,
|
|
29
|
-
|
|
27
|
+
id: id
|
|
30
28
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
31
29
|
className: `${prefix}--date-picker__input ${prefix}--skeleton`
|
|
32
30
|
}));
|
|
@@ -48,6 +46,10 @@ DatePickerSkeleton.propTypes = {
|
|
|
48
46
|
* Specify an optional className to add.
|
|
49
47
|
*/
|
|
50
48
|
className: PropTypes.string,
|
|
49
|
+
/**
|
|
50
|
+
* Specify whether the label should be hidden, or not
|
|
51
|
+
*/
|
|
52
|
+
hideLabel: PropTypes.bool,
|
|
51
53
|
/**
|
|
52
54
|
* Specify the id to add.
|
|
53
55
|
*/
|
|
@@ -123,6 +123,7 @@ function updateClassNames(calendar, prefix) {
|
|
|
123
123
|
});
|
|
124
124
|
forEach.call(daysContainer.querySelectorAll('.flatpickr-day'), item => {
|
|
125
125
|
item.classList.add(`${prefix}--date-picker__day`);
|
|
126
|
+
item.setAttribute('role', 'button');
|
|
126
127
|
if (item.classList.contains('today') && calendar.selectedDates.length > 0) {
|
|
127
128
|
item.classList.add('no-border');
|
|
128
129
|
} else if (item.classList.contains('today') && calendar.selectedDates.length === 0) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import DatePickerInput from './DatePickerInput';
|
|
8
|
+
export default DatePickerInput;
|
|
9
|
+
export { DatePickerInput };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2021
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import ExpandableSearch from './ExpandableSearch';
|
|
8
|
+
export default ExpandableSearch;
|
|
9
|
+
export { ExpandableSearch };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import FileUploader from './FileUploader';
|
|
8
|
+
export default FileUploader;
|
|
9
|
+
export { FileUploader };
|
|
10
|
+
export { default as Filename } from './Filename';
|
|
11
|
+
export { default as FileUploaderSkeleton } from './FileUploader.Skeleton';
|
|
12
|
+
export { default as FileUploaderButton } from './FileUploaderButton';
|
|
13
|
+
export { default as FileUploaderDropContainer } from './FileUploaderDropContainer';
|
|
14
|
+
export { default as FileUploaderItem } from './FileUploaderItem';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import FormGroup from './FormGroup';
|
|
8
|
+
export default FormGroup;
|
|
9
|
+
export { FormGroup };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import Loading from './Loading';
|
|
8
|
+
export default Loading;
|
|
9
|
+
export { Loading };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
export { default as NumberInputSkeleton } from './NumberInput.Skeleton';
|
|
8
|
+
export { NumberInput } from './NumberInput';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import OverflowMenuItem from './OverflowMenuItem';
|
|
8
|
+
export default OverflowMenuItem;
|
|
9
|
+
export { OverflowMenuItem };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import RadioButton from './RadioButton';
|
|
8
|
+
export default RadioButton;
|
|
9
|
+
export { RadioButton };
|
|
@@ -190,6 +190,5 @@ RadioButtonGroup.propTypes = {
|
|
|
190
190
|
warnText: PropTypes.node
|
|
191
191
|
};
|
|
192
192
|
RadioButtonGroup.displayName = 'RadioButtonGroup';
|
|
193
|
-
var RadioButtonGroup$1 = RadioButtonGroup;
|
|
194
193
|
|
|
195
|
-
export { RadioButtonGroup
|
|
194
|
+
export { RadioButtonGroup as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import RadioButtonGroup from './RadioButtonGroup';
|
|
8
|
+
export default RadioButtonGroup;
|
|
9
|
+
export { RadioButtonGroup };
|
|
@@ -135,7 +135,7 @@ const Search = /*#__PURE__*/React__default.forwardRef(function Search(_ref, forw
|
|
|
135
135
|
id: searchId,
|
|
136
136
|
htmlFor: uniqueId,
|
|
137
137
|
className: `${prefix}--label`
|
|
138
|
-
}, labelText), /*#__PURE__*/React__default.createElement("input", _extends({
|
|
138
|
+
}, labelText), /*#__PURE__*/React__default.createElement("input", _extends({
|
|
139
139
|
autoComplete: autoComplete,
|
|
140
140
|
className: `${prefix}--search-input`,
|
|
141
141
|
defaultValue: defaultValue,
|
|
@@ -149,7 +149,7 @@ const Search = /*#__PURE__*/React__default.forwardRef(function Search(_ref, forw
|
|
|
149
149
|
type: type,
|
|
150
150
|
value: value,
|
|
151
151
|
tabIndex: onExpand && !isExpanded ? -1 : undefined
|
|
152
|
-
})), /*#__PURE__*/React__default.createElement("button", {
|
|
152
|
+
}, rest)), /*#__PURE__*/React__default.createElement("button", {
|
|
153
153
|
"aria-label": closeButtonLabelText,
|
|
154
154
|
className: clearClasses,
|
|
155
155
|
disabled: disabled,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import Select from './Select';
|
|
8
|
+
export { default as SelectSkeleton } from './Select.Skeleton';
|
|
9
|
+
export default Select;
|
|
10
|
+
export { Select };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import SelectItem from './SelectItem';
|
|
8
|
+
export default SelectItem;
|
|
9
|
+
export { SelectItem };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import SelectItemGroup from './SelectItemGroup';
|
|
8
|
+
export default SelectItemGroup;
|
|
9
|
+
export { SelectItemGroup };
|
|
@@ -142,6 +142,7 @@ function StructuredListRow(props) {
|
|
|
142
142
|
children,
|
|
143
143
|
className,
|
|
144
144
|
head,
|
|
145
|
+
onClick,
|
|
145
146
|
...other
|
|
146
147
|
} = props;
|
|
147
148
|
const [hasFocusWithin, setHasFocusWithin] = useState(false);
|
|
@@ -167,7 +168,10 @@ function StructuredListRow(props) {
|
|
|
167
168
|
React__default.createElement("div", _extends({}, other, {
|
|
168
169
|
role: "row",
|
|
169
170
|
className: classes,
|
|
170
|
-
onClick: () =>
|
|
171
|
+
onClick: () => {
|
|
172
|
+
setSelectedRow(id);
|
|
173
|
+
onClick && onClick();
|
|
174
|
+
},
|
|
171
175
|
onFocus: () => {
|
|
172
176
|
setHasFocusWithin(true);
|
|
173
177
|
},
|
|
@@ -196,6 +200,10 @@ StructuredListRow.propTypes = {
|
|
|
196
200
|
* Specify whether a `<label>` should be used
|
|
197
201
|
*/
|
|
198
202
|
label: deprecate(PropTypes.bool, `\nThe \`label\` prop is no longer needed and will be removed in the next major version of Carbon.`),
|
|
203
|
+
/**
|
|
204
|
+
* Provide a handler that is invoked on the click,
|
|
205
|
+
*/
|
|
206
|
+
onClick: PropTypes.func,
|
|
199
207
|
/**
|
|
200
208
|
* Provide a handler that is invoked on the key down event for the control,
|
|
201
209
|
*/
|
|
@@ -227,7 +235,7 @@ function StructuredListInput(props) {
|
|
|
227
235
|
value: row?.id ?? '',
|
|
228
236
|
onChange: event => {
|
|
229
237
|
setSelectedRow(event.target.value);
|
|
230
|
-
onChange(event);
|
|
238
|
+
onChange && onChange(event);
|
|
231
239
|
},
|
|
232
240
|
id: id ?? defaultId,
|
|
233
241
|
className: classes,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import TimePicker from './TimePicker';
|
|
8
|
+
export default TimePicker;
|
|
9
|
+
export { TimePicker };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import { default as TimePickerSelect } from './TimePickerSelect';
|
|
8
|
+
export default TimePickerSelect;
|
|
9
|
+
export { TimePickerSelect };
|
|
@@ -15,13 +15,14 @@ import { useMergedRefs } from '../../internal/useMergedRefs.js';
|
|
|
15
15
|
import { match } from '../../internal/keyboard/match.js';
|
|
16
16
|
import { Escape } from '../../internal/keyboard/keys.js';
|
|
17
17
|
|
|
18
|
+
const noopFn = () => {};
|
|
18
19
|
const HeaderPanel = /*#__PURE__*/React__default.forwardRef(function HeaderPanel(_ref, ref) {
|
|
19
20
|
let {
|
|
20
21
|
children,
|
|
21
22
|
className: customClassName,
|
|
22
23
|
expanded,
|
|
23
24
|
addFocusListeners = true,
|
|
24
|
-
onHeaderPanelFocus,
|
|
25
|
+
onHeaderPanelFocus = noopFn,
|
|
25
26
|
href,
|
|
26
27
|
...other
|
|
27
28
|
} = _ref;
|
|
@@ -95,7 +96,6 @@ HeaderPanel.propTypes = {
|
|
|
95
96
|
/**
|
|
96
97
|
* An optional listener that is called a callback to collapse the HeaderPanel
|
|
97
98
|
*/
|
|
98
|
-
|
|
99
99
|
onHeaderPanelFocus: PropTypes.func
|
|
100
100
|
};
|
|
101
101
|
HeaderPanel.displayName = 'HeaderPanel';
|
|
@@ -15,6 +15,8 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
15
15
|
import { useMergedRefs } from '../../internal/useMergedRefs.js';
|
|
16
16
|
import { useWindowEvent } from '../../internal/useEvent.js';
|
|
17
17
|
import { useDelayedState } from '../../internal/useDelayedState.js';
|
|
18
|
+
import { breakpoints } from '@carbon/layout';
|
|
19
|
+
import { useMatchMedia } from '../../internal/useMatchMedia.js';
|
|
18
20
|
import { match } from '../../internal/keyboard/match.js';
|
|
19
21
|
import { Tab, Escape } from '../../internal/keyboard/keys.js';
|
|
20
22
|
|
|
@@ -152,6 +154,8 @@ function SideNavRenderFunction(_ref, ref) {
|
|
|
152
154
|
sideNavRef.current.focus();
|
|
153
155
|
}
|
|
154
156
|
});
|
|
157
|
+
const lgMediaQuery = `(min-width: ${breakpoints.lg.width})`;
|
|
158
|
+
const isLg = useMatchMedia(lgMediaQuery);
|
|
155
159
|
return /*#__PURE__*/React__default.createElement(SideNavContext.Provider, {
|
|
156
160
|
value: {
|
|
157
161
|
isRail
|
|
@@ -166,7 +170,7 @@ function SideNavRenderFunction(_ref, ref) {
|
|
|
166
170
|
tabIndex: -1,
|
|
167
171
|
ref: navRef,
|
|
168
172
|
className: `${prefix}--side-nav__navigation ${className}`,
|
|
169
|
-
inert: !isRail && (expanded ? undefined : -1)
|
|
173
|
+
inert: !isRail && (expanded || isLg ? undefined : -1)
|
|
170
174
|
}, accessibilityLabel, eventHandlers, other), childrenToRender));
|
|
171
175
|
}
|
|
172
176
|
const SideNav = /*#__PURE__*/React__default.forwardRef(SideNavRenderFunction);
|