@carbon/react 1.40.0 → 1.41.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/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1564 -872
- package/es/components/Accordion/Accordion.Skeleton.d.ts +0 -5
- package/es/components/Accordion/Accordion.Skeleton.js +0 -5
- package/es/components/Breadcrumb/BreadcrumbItem.js +3 -1
- package/es/components/Checkbox/Checkbox.js +3 -6
- package/es/components/CodeSnippet/CodeSnippet.js +5 -12
- package/es/components/ComboBox/ComboBox.d.ts +1 -5
- package/es/components/ComboBox/ComboBox.js +6 -20
- package/es/components/ComposedModal/ComposedModal.js +1 -5
- package/es/components/ComposedModal/ModalFooter.js +4 -9
- package/es/components/ComposedModal/ModalHeader.js +1 -4
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +3 -8
- package/es/components/ContentSwitcher/ContentSwitcher.js +7 -11
- package/es/components/Copy/Copy.js +4 -8
- package/es/components/CopyButton/CopyButton.js +8 -7
- package/es/components/DataTable/DataTable.d.ts +3 -39
- package/es/components/DataTable/DataTable.js +10 -18
- package/es/components/DataTable/Table.d.ts +0 -4
- package/es/components/DataTable/Table.js +4 -7
- package/es/components/DataTable/TableBatchAction.js +12 -5
- package/es/components/DataTable/TableBatchActions.js +1 -6
- package/es/components/DataTable/TableBody.d.ts +0 -3
- package/es/components/DataTable/TableBody.js +1 -3
- package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/es/components/DataTable/TableHeader.js +3 -8
- package/es/components/DataTable/TableSelectAll.d.ts +0 -3
- package/es/components/DataTable/TableSelectAll.js +1 -4
- package/es/components/DataTable/TableToolbar.d.ts +10 -0
- package/es/components/DataTable/TableToolbar.js +15 -7
- package/es/components/DataTable/TableToolbarMenu.js +2 -6
- package/es/components/DataTable/TableToolbarSearch.d.ts +2 -8
- package/es/components/DataTable/TableToolbarSearch.js +6 -11
- package/es/components/DataTable/tools/sorting.js +2 -2
- package/es/components/DatePicker/DatePicker.d.ts +4 -4
- package/es/components/DatePicker/DatePicker.js +9 -4
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +6 -0
- package/es/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/es/components/DatePickerInput/DatePickerInput.js +12 -6
- package/es/components/Dropdown/Dropdown.js +6 -15
- package/es/components/FileUploader/FileUploader.d.ts +2 -11
- package/es/components/FileUploader/FileUploader.js +15 -19
- package/es/components/FileUploader/FileUploaderButton.js +2 -2
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +0 -7
- package/es/components/FileUploader/FileUploaderDropContainer.js +2 -8
- package/es/components/FileUploader/FileUploaderItem.d.ts +0 -4
- package/es/components/FileUploader/FileUploaderItem.js +12 -9
- package/es/components/FileUploader/Filename.d.ts +6 -10
- package/es/components/FileUploader/Filename.js +7 -11
- package/es/components/FormGroup/FormGroup.d.ts +0 -5
- package/es/components/FormGroup/FormGroup.js +3 -8
- package/es/components/FormItem/FormItem.d.ts +32 -0
- package/es/components/FormItem/index.d.ts +9 -0
- package/es/components/FormLabel/FormLabel.js +4 -1
- package/es/components/ListBox/ListBox.js +4 -8
- package/es/components/ListBox/ListBoxMenuIcon.js +1 -4
- package/es/components/ListBox/ListBoxMenuItem.js +4 -8
- package/es/components/ListBox/ListBoxSelection.d.ts +5 -5
- package/es/components/ListBox/ListBoxSelection.js +12 -13
- package/es/components/ListBox/next/ListBoxSelection.js +12 -13
- package/es/components/ListBox/next/ListBoxTrigger.js +3 -5
- package/es/components/ListItem/ListItem.d.ts +1 -1
- package/es/components/ListItem/ListItem.js +6 -2
- package/es/components/Menu/MenuItem.js +4 -1
- package/es/components/Modal/Modal.d.ts +137 -0
- package/es/components/Modal/Modal.js +39 -45
- package/es/components/Modal/index.d.ts +9 -0
- package/es/components/ModalWrapper/ModalWrapper.js +13 -19
- package/es/components/MultiSelect/FilterableMultiSelect.js +14 -28
- package/es/components/MultiSelect/MultiSelect.js +17 -33
- package/es/components/MultiSelect/MultiSelectPropTypes.js +2 -2
- package/es/components/MultiSelect/tools/sorting.js +2 -2
- package/es/components/Notification/Notification.d.ts +11 -29
- package/es/components/Notification/Notification.js +38 -57
- package/es/components/NumberInput/NumberInput.js +6 -2
- package/es/components/OverflowMenu/OverflowMenu.js +27 -33
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -1
- package/es/components/Pagination/experimental/PageSelector.js +3 -8
- package/es/components/Pagination/experimental/Pagination.js +16 -34
- package/es/components/ProgressIndicator/ProgressIndicator.js +7 -6
- package/es/components/RadioTile/RadioTile.js +6 -7
- package/es/components/Search/Search.Skeleton.d.ts +0 -3
- package/es/components/Search/Search.Skeleton.js +1 -4
- package/es/components/Select/Select.d.ts +2 -2
- package/es/components/Select/Select.js +13 -16
- package/es/components/SelectItem/SelectItem.d.ts +0 -6
- package/es/components/SelectItem/SelectItem.js +4 -10
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -3
- package/es/components/SelectItemGroup/SelectItemGroup.js +1 -4
- package/es/components/SkeletonIcon/SkeletonIcon.d.ts +13 -0
- package/es/components/SkeletonIcon/SkeletonIcon.js +2 -3
- package/es/components/SkeletonText/SkeletonText.d.ts +0 -6
- package/es/components/SkeletonText/SkeletonText.js +0 -6
- package/es/components/Slider/Slider.Skeleton.d.ts +9 -1
- package/es/components/Slider/Slider.Skeleton.js +20 -4
- package/es/components/Slider/Slider.d.ts +137 -25
- package/es/components/Slider/Slider.js +779 -186
- package/es/components/StructuredList/StructuredList.js +5 -2
- package/es/components/Switch/Switch.js +3 -7
- package/es/components/Tabs/Tabs.js +5 -2
- package/es/components/Tag/Tag.js +4 -2
- package/es/components/Text/Text.js +1 -1
- package/es/components/Text/TextDirection.d.ts +1 -1
- package/es/components/TextArea/TextArea.js +30 -34
- package/es/components/TextInput/ControlledPasswordInput.js +12 -19
- package/es/components/TextInput/TextInput.js +8 -3
- package/es/components/Tile/Tile.js +5 -3
- package/es/components/TileGroup/TileGroup.js +5 -4
- package/es/components/Toggle/Toggle.js +4 -2
- package/es/components/Toggletip/index.d.ts +6 -1
- package/es/components/Toggletip/index.js +7 -1
- package/es/components/UIShell/Content.js +1 -4
- package/es/components/UIShell/SideNav.d.ts +1 -1
- package/es/components/UIShell/SideNavDetails.d.ts +32 -0
- package/es/components/UIShell/SideNavDetails.js +1 -2
- package/es/components/UIShell/SideNavDivider.d.ts +15 -0
- package/es/components/UIShell/SideNavDivider.js +2 -2
- package/es/components/UIShell/SideNavFooter.js +2 -5
- package/es/components/UIShell/SideNavIcon.d.ts +25 -0
- package/es/components/UIShell/SideNavIcon.js +4 -7
- package/es/components/UIShell/SideNavSwitcher.d.ts +31 -0
- package/es/components/UIShell/SideNavSwitcher.js +6 -5
- package/es/index.js +2 -2
- package/es/internal/FloatingMenu.js +2 -7
- package/es/internal/Selection.js +0 -3
- package/es/internal/noopFn.d.ts +7 -0
- package/es/internal/noopFn.js +10 -0
- package/es/internal/useNormalizedInputProps.js +6 -2
- package/es/internal/wrapFocus.js +5 -5
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +2 -2
- package/lib/components/Accordion/Accordion.Skeleton.d.ts +0 -5
- package/lib/components/Accordion/Accordion.Skeleton.js +0 -5
- package/lib/components/Breadcrumb/BreadcrumbItem.js +3 -1
- package/lib/components/Checkbox/Checkbox.js +3 -6
- package/lib/components/CodeSnippet/CodeSnippet.js +5 -12
- package/lib/components/ComboBox/ComboBox.d.ts +1 -5
- package/lib/components/ComboBox/ComboBox.js +5 -19
- package/lib/components/ComposedModal/ComposedModal.js +1 -5
- package/lib/components/ComposedModal/ModalFooter.js +4 -9
- package/lib/components/ComposedModal/ModalHeader.js +1 -4
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +3 -8
- package/lib/components/ContentSwitcher/ContentSwitcher.js +7 -11
- package/lib/components/Copy/Copy.js +4 -8
- package/lib/components/CopyButton/CopyButton.js +8 -7
- package/lib/components/DataTable/DataTable.d.ts +3 -39
- package/lib/components/DataTable/DataTable.js +13 -21
- package/lib/components/DataTable/Table.d.ts +0 -4
- package/lib/components/DataTable/Table.js +3 -6
- package/lib/components/DataTable/TableBatchAction.js +12 -5
- package/lib/components/DataTable/TableBatchActions.js +1 -6
- package/lib/components/DataTable/TableBody.d.ts +0 -3
- package/lib/components/DataTable/TableBody.js +1 -3
- package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.js +3 -8
- package/lib/components/DataTable/TableSelectAll.d.ts +0 -3
- package/lib/components/DataTable/TableSelectAll.js +1 -4
- package/lib/components/DataTable/TableToolbar.d.ts +10 -0
- package/lib/components/DataTable/TableToolbar.js +15 -7
- package/lib/components/DataTable/TableToolbarMenu.js +2 -6
- package/lib/components/DataTable/TableToolbarSearch.d.ts +2 -8
- package/lib/components/DataTable/TableToolbarSearch.js +6 -11
- package/lib/components/DataTable/tools/sorting.js +2 -2
- package/lib/components/DatePicker/DatePicker.d.ts +4 -4
- package/lib/components/DatePicker/DatePicker.js +9 -4
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +6 -0
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/lib/components/DatePickerInput/DatePickerInput.js +12 -6
- package/lib/components/Dropdown/Dropdown.js +6 -15
- package/lib/components/FileUploader/FileUploader.d.ts +2 -11
- package/lib/components/FileUploader/FileUploader.js +15 -19
- package/lib/components/FileUploader/FileUploaderButton.js +2 -2
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +0 -7
- package/lib/components/FileUploader/FileUploaderDropContainer.js +2 -8
- package/lib/components/FileUploader/FileUploaderItem.d.ts +0 -4
- package/lib/components/FileUploader/FileUploaderItem.js +12 -9
- package/lib/components/FileUploader/Filename.d.ts +6 -10
- package/lib/components/FileUploader/Filename.js +7 -11
- package/lib/components/FormGroup/FormGroup.d.ts +0 -5
- package/lib/components/FormGroup/FormGroup.js +3 -8
- package/lib/components/FormItem/FormItem.d.ts +32 -0
- package/lib/components/FormItem/index.d.ts +9 -0
- package/lib/components/FormLabel/FormLabel.js +4 -1
- package/lib/components/ListBox/ListBox.js +4 -8
- package/lib/components/ListBox/ListBoxMenuIcon.js +1 -4
- package/lib/components/ListBox/ListBoxMenuItem.js +4 -8
- package/lib/components/ListBox/ListBoxSelection.d.ts +5 -5
- package/lib/components/ListBox/ListBoxSelection.js +12 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +12 -13
- package/lib/components/ListBox/next/ListBoxTrigger.js +3 -5
- package/lib/components/ListItem/ListItem.d.ts +1 -1
- package/lib/components/ListItem/ListItem.js +6 -2
- package/lib/components/Menu/MenuItem.js +4 -1
- package/lib/components/Modal/Modal.d.ts +137 -0
- package/lib/components/Modal/Modal.js +40 -45
- package/lib/components/Modal/index.d.ts +9 -0
- package/lib/components/ModalWrapper/ModalWrapper.js +13 -19
- package/lib/components/MultiSelect/FilterableMultiSelect.js +18 -32
- package/lib/components/MultiSelect/MultiSelect.js +16 -32
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -2
- package/lib/components/MultiSelect/tools/sorting.js +2 -2
- package/lib/components/Notification/Notification.d.ts +11 -29
- package/lib/components/Notification/Notification.js +38 -57
- package/lib/components/NumberInput/NumberInput.js +6 -2
- package/lib/components/OverflowMenu/OverflowMenu.js +27 -33
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +4 -1
- package/lib/components/Pagination/experimental/PageSelector.js +3 -8
- package/lib/components/Pagination/experimental/Pagination.js +16 -34
- package/lib/components/ProgressIndicator/ProgressIndicator.js +7 -6
- package/lib/components/RadioTile/RadioTile.js +6 -7
- package/lib/components/Search/Search.Skeleton.d.ts +0 -3
- package/lib/components/Search/Search.Skeleton.js +1 -4
- package/lib/components/Select/Select.d.ts +2 -2
- package/lib/components/Select/Select.js +13 -16
- package/lib/components/SelectItem/SelectItem.d.ts +0 -6
- package/lib/components/SelectItem/SelectItem.js +4 -10
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -3
- package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -4
- package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +13 -0
- package/lib/components/SkeletonIcon/SkeletonIcon.js +2 -3
- package/lib/components/SkeletonText/SkeletonText.d.ts +0 -6
- package/lib/components/SkeletonText/SkeletonText.js +0 -6
- package/lib/components/Slider/Slider.Skeleton.d.ts +9 -1
- package/lib/components/Slider/Slider.Skeleton.js +20 -4
- package/lib/components/Slider/Slider.d.ts +137 -25
- package/lib/components/Slider/Slider.js +778 -185
- package/lib/components/StructuredList/StructuredList.js +5 -2
- package/lib/components/Switch/Switch.js +3 -7
- package/lib/components/Tabs/Tabs.js +5 -2
- package/lib/components/Tag/Tag.js +4 -2
- package/lib/components/Text/Text.js +1 -1
- package/lib/components/Text/TextDirection.d.ts +1 -1
- package/lib/components/TextArea/TextArea.js +30 -34
- package/lib/components/TextInput/ControlledPasswordInput.js +12 -19
- package/lib/components/TextInput/TextInput.js +8 -3
- package/lib/components/Tile/Tile.js +5 -3
- package/lib/components/TileGroup/TileGroup.js +5 -4
- package/lib/components/Toggle/Toggle.js +4 -2
- package/lib/components/Toggletip/index.d.ts +6 -1
- package/lib/components/Toggletip/index.js +7 -1
- package/lib/components/UIShell/Content.js +1 -4
- package/lib/components/UIShell/SideNav.d.ts +1 -1
- package/lib/components/UIShell/SideNavDetails.d.ts +32 -0
- package/lib/components/UIShell/SideNavDetails.js +1 -2
- package/lib/components/UIShell/SideNavDivider.d.ts +15 -0
- package/lib/components/UIShell/SideNavDivider.js +2 -2
- package/lib/components/UIShell/SideNavFooter.js +2 -5
- package/lib/components/UIShell/SideNavIcon.d.ts +25 -0
- package/lib/components/UIShell/SideNavIcon.js +4 -7
- package/lib/components/UIShell/SideNavSwitcher.d.ts +31 -0
- package/lib/components/UIShell/SideNavSwitcher.js +5 -4
- package/lib/index.js +4 -4
- package/lib/internal/FloatingMenu.js +2 -7
- package/lib/internal/Selection.js +0 -3
- package/lib/internal/noopFn.d.ts +7 -0
- package/lib/internal/noopFn.js +14 -0
- package/lib/internal/useNormalizedInputProps.js +6 -2
- package/lib/internal/wrapFocus.js +5 -5
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +2 -2
- package/package.json +9 -9
- package/scss/components/slug/_index.scss +9 -0
- package/scss/components/slug/_slug.scss +9 -0
|
@@ -51,6 +51,16 @@ export declare namespace NotificationActionButton {
|
|
|
51
51
|
* ==================
|
|
52
52
|
*/
|
|
53
53
|
export interface NotificationButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
54
|
+
/**
|
|
55
|
+
* Specify a label to be read by screen readers on the container node
|
|
56
|
+
* 'aria-label' of the NotificationButton component.
|
|
57
|
+
*/
|
|
58
|
+
['aria-label']?: string;
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated please use `aria-label` instead.
|
|
61
|
+
* 'aria-label' of the NotificationButton component.
|
|
62
|
+
*/
|
|
63
|
+
ariaLabel?: string;
|
|
54
64
|
/**
|
|
55
65
|
* Specify an optional icon for the Button through a string,
|
|
56
66
|
* if provided. However, regular "close" icon is preferred.
|
|
@@ -107,12 +117,6 @@ export declare namespace NotificationButton {
|
|
|
107
117
|
*/
|
|
108
118
|
type: PropTypes.Requireable<string>;
|
|
109
119
|
};
|
|
110
|
-
var defaultProps: {
|
|
111
|
-
"aria-label": string;
|
|
112
|
-
notificationType: string;
|
|
113
|
-
type: string;
|
|
114
|
-
renderIcon: any;
|
|
115
|
-
};
|
|
116
120
|
}
|
|
117
121
|
export interface NotificationIconProps {
|
|
118
122
|
iconDescription: string;
|
|
@@ -248,13 +252,6 @@ export declare namespace ToastNotification {
|
|
|
248
252
|
*/
|
|
249
253
|
title: PropTypes.Requireable<string>;
|
|
250
254
|
};
|
|
251
|
-
var defaultProps: {
|
|
252
|
-
kind: string;
|
|
253
|
-
role: string;
|
|
254
|
-
onCloseButtonClick: () => void;
|
|
255
|
-
hideCloseButton: boolean;
|
|
256
|
-
timeout: number;
|
|
257
|
-
};
|
|
258
255
|
}
|
|
259
256
|
/**
|
|
260
257
|
* InlineNotification
|
|
@@ -364,12 +361,6 @@ export declare namespace InlineNotification {
|
|
|
364
361
|
*/
|
|
365
362
|
title: PropTypes.Requireable<string>;
|
|
366
363
|
};
|
|
367
|
-
var defaultProps: {
|
|
368
|
-
kind: string;
|
|
369
|
-
role: string;
|
|
370
|
-
onCloseButtonClick: () => void;
|
|
371
|
-
hideCloseButton: boolean;
|
|
372
|
-
};
|
|
373
364
|
}
|
|
374
365
|
/**
|
|
375
366
|
* ActionableNotification
|
|
@@ -484,7 +475,7 @@ export declare namespace ActionableNotification {
|
|
|
484
475
|
/**
|
|
485
476
|
* Specify what state the notification represents
|
|
486
477
|
*/
|
|
487
|
-
kind: PropTypes.
|
|
478
|
+
kind: PropTypes.Requireable<string>;
|
|
488
479
|
/**
|
|
489
480
|
* Specify whether you are using the low contrast variant of the ActionableNotification.
|
|
490
481
|
*/
|
|
@@ -519,13 +510,4 @@ export declare namespace ActionableNotification {
|
|
|
519
510
|
*/
|
|
520
511
|
title: PropTypes.Requireable<string>;
|
|
521
512
|
};
|
|
522
|
-
var defaultProps: {
|
|
523
|
-
kind: string;
|
|
524
|
-
role: string;
|
|
525
|
-
onCloseButtonClick: () => void;
|
|
526
|
-
hideCloseButton: boolean;
|
|
527
|
-
hasFocus: boolean;
|
|
528
|
-
closeOnEscape: boolean;
|
|
529
|
-
inline: boolean;
|
|
530
|
-
};
|
|
531
513
|
}
|
|
@@ -11,12 +11,15 @@ import React__default, { useState, useRef, useEffect } from 'react';
|
|
|
11
11
|
import deprecate from '../../prop-types/deprecate.js';
|
|
12
12
|
import cx from 'classnames';
|
|
13
13
|
import { Close, ErrorFilled, CheckmarkFilled, WarningFilled, WarningAltFilled, InformationFilled, InformationSquareFilled } from '@carbon/icons-react';
|
|
14
|
+
import '../Text/index.js';
|
|
14
15
|
import Button from '../Button/Button.js';
|
|
15
16
|
import '../Button/Button.Skeleton.js';
|
|
16
17
|
import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
|
|
17
18
|
import { useNoInteractiveChildren } from '../../internal/useNoInteractiveChildren.js';
|
|
18
19
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
19
20
|
import { useId } from '../../internal/useId.js';
|
|
21
|
+
import { noopFn } from '../../internal/noopFn.js';
|
|
22
|
+
import { Text } from '../Text/Text.js';
|
|
20
23
|
import { matches } from '../../internal/keyboard/match.js';
|
|
21
24
|
import { Escape } from '../../internal/keyboard/keys.js';
|
|
22
25
|
|
|
@@ -85,14 +88,13 @@ NotificationActionButton.propTypes = {
|
|
|
85
88
|
|
|
86
89
|
function NotificationButton(_ref2) {
|
|
87
90
|
let {
|
|
88
|
-
'aria-label': ariaLabel,
|
|
89
|
-
// @ts-expect-error: deprecated prop
|
|
91
|
+
'aria-label': ariaLabel = 'close notification',
|
|
90
92
|
ariaLabel: deprecatedAriaLabel,
|
|
91
93
|
className,
|
|
92
|
-
type,
|
|
93
|
-
renderIcon: IconTag,
|
|
94
|
+
type = 'button',
|
|
95
|
+
renderIcon: IconTag = Close,
|
|
94
96
|
name,
|
|
95
|
-
notificationType,
|
|
97
|
+
notificationType = 'toast',
|
|
96
98
|
...rest
|
|
97
99
|
} = _ref2;
|
|
98
100
|
const prefix = usePrefix();
|
|
@@ -146,12 +148,6 @@ NotificationButton.propTypes = {
|
|
|
146
148
|
*/
|
|
147
149
|
type: PropTypes.string
|
|
148
150
|
};
|
|
149
|
-
NotificationButton.defaultProps = {
|
|
150
|
-
['aria-label']: 'close notification',
|
|
151
|
-
notificationType: 'toast',
|
|
152
|
-
type: 'button',
|
|
153
|
-
renderIcon: Close
|
|
154
|
-
};
|
|
155
151
|
|
|
156
152
|
/**
|
|
157
153
|
* NotificationIcon
|
|
@@ -198,16 +194,16 @@ function ToastNotification(_ref4) {
|
|
|
198
194
|
['aria-label']: ariaLabel,
|
|
199
195
|
// @ts-expect-error: deprecated prop
|
|
200
196
|
ariaLabel: deprecatedAriaLabel,
|
|
201
|
-
role,
|
|
197
|
+
role = 'status',
|
|
202
198
|
onClose,
|
|
203
|
-
onCloseButtonClick,
|
|
199
|
+
onCloseButtonClick = noopFn,
|
|
204
200
|
statusIconDescription,
|
|
205
201
|
className,
|
|
206
202
|
children,
|
|
207
|
-
kind,
|
|
203
|
+
kind = 'error',
|
|
208
204
|
lowContrast,
|
|
209
|
-
hideCloseButton,
|
|
210
|
-
timeout,
|
|
205
|
+
hideCloseButton = false,
|
|
206
|
+
timeout = 0,
|
|
211
207
|
title,
|
|
212
208
|
caption,
|
|
213
209
|
subtitle,
|
|
@@ -265,11 +261,14 @@ function ToastNotification(_ref4) {
|
|
|
265
261
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
266
262
|
ref: contentRef,
|
|
267
263
|
className: `${prefix}--toast-notification__details`
|
|
268
|
-
}, title && /*#__PURE__*/React__default.createElement(
|
|
264
|
+
}, title && /*#__PURE__*/React__default.createElement(Text, {
|
|
265
|
+
as: "div",
|
|
269
266
|
className: `${prefix}--toast-notification__title`
|
|
270
|
-
}, title), subtitle && /*#__PURE__*/React__default.createElement(
|
|
267
|
+
}, title), subtitle && /*#__PURE__*/React__default.createElement(Text, {
|
|
268
|
+
as: "div",
|
|
271
269
|
className: `${prefix}--toast-notification__subtitle`
|
|
272
|
-
}, subtitle), caption && /*#__PURE__*/React__default.createElement(
|
|
270
|
+
}, subtitle), caption && /*#__PURE__*/React__default.createElement(Text, {
|
|
271
|
+
as: "div",
|
|
273
272
|
className: `${prefix}--toast-notification__caption`
|
|
274
273
|
}, caption), children), !hideCloseButton && /*#__PURE__*/React__default.createElement(NotificationButton, {
|
|
275
274
|
notificationType: "toast",
|
|
@@ -343,13 +342,6 @@ ToastNotification.propTypes = {
|
|
|
343
342
|
*/
|
|
344
343
|
title: PropTypes.string
|
|
345
344
|
};
|
|
346
|
-
ToastNotification.defaultProps = {
|
|
347
|
-
kind: 'error',
|
|
348
|
-
role: 'status',
|
|
349
|
-
onCloseButtonClick: () => {},
|
|
350
|
-
hideCloseButton: false,
|
|
351
|
-
timeout: 0
|
|
352
|
-
};
|
|
353
345
|
|
|
354
346
|
/**
|
|
355
347
|
* InlineNotification
|
|
@@ -362,14 +354,14 @@ function InlineNotification(_ref5) {
|
|
|
362
354
|
children,
|
|
363
355
|
title,
|
|
364
356
|
subtitle,
|
|
365
|
-
role,
|
|
357
|
+
role = 'status',
|
|
366
358
|
onClose,
|
|
367
|
-
onCloseButtonClick,
|
|
359
|
+
onCloseButtonClick = noopFn,
|
|
368
360
|
statusIconDescription,
|
|
369
361
|
className,
|
|
370
|
-
kind,
|
|
362
|
+
kind = 'error',
|
|
371
363
|
lowContrast,
|
|
372
|
-
hideCloseButton,
|
|
364
|
+
hideCloseButton = false,
|
|
373
365
|
...rest
|
|
374
366
|
} = _ref5;
|
|
375
367
|
const [isOpen, setIsOpen] = useState(true);
|
|
@@ -409,9 +401,11 @@ function InlineNotification(_ref5) {
|
|
|
409
401
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
410
402
|
ref: contentRef,
|
|
411
403
|
className: `${prefix}--inline-notification__text-wrapper`
|
|
412
|
-
}, title && /*#__PURE__*/React__default.createElement(
|
|
404
|
+
}, title && /*#__PURE__*/React__default.createElement(Text, {
|
|
405
|
+
as: "div",
|
|
413
406
|
className: `${prefix}--inline-notification__title`
|
|
414
|
-
}, title), subtitle && /*#__PURE__*/React__default.createElement(
|
|
407
|
+
}, title), subtitle && /*#__PURE__*/React__default.createElement(Text, {
|
|
408
|
+
as: "div",
|
|
415
409
|
className: `${prefix}--inline-notification__subtitle`
|
|
416
410
|
}, subtitle), children)), !hideCloseButton && /*#__PURE__*/React__default.createElement(NotificationButton, {
|
|
417
411
|
notificationType: "inline",
|
|
@@ -472,12 +466,6 @@ InlineNotification.propTypes = {
|
|
|
472
466
|
*/
|
|
473
467
|
title: PropTypes.string
|
|
474
468
|
};
|
|
475
|
-
InlineNotification.defaultProps = {
|
|
476
|
-
kind: 'error',
|
|
477
|
-
role: 'status',
|
|
478
|
-
onCloseButtonClick: () => {},
|
|
479
|
-
hideCloseButton: false
|
|
480
|
-
};
|
|
481
469
|
|
|
482
470
|
/**
|
|
483
471
|
* ActionableNotification
|
|
@@ -491,18 +479,18 @@ function ActionableNotification(_ref6) {
|
|
|
491
479
|
// @ts-expect-error: deprecated prop
|
|
492
480
|
ariaLabel: deprecatedAriaLabel,
|
|
493
481
|
children,
|
|
494
|
-
role,
|
|
482
|
+
role = 'alertdialog',
|
|
495
483
|
onActionButtonClick,
|
|
496
484
|
onClose,
|
|
497
|
-
onCloseButtonClick,
|
|
485
|
+
onCloseButtonClick = noopFn,
|
|
498
486
|
statusIconDescription,
|
|
499
487
|
className,
|
|
500
|
-
inline,
|
|
501
|
-
kind,
|
|
488
|
+
inline = false,
|
|
489
|
+
kind = 'error',
|
|
502
490
|
lowContrast,
|
|
503
|
-
hideCloseButton,
|
|
504
|
-
hasFocus,
|
|
505
|
-
closeOnEscape,
|
|
491
|
+
hideCloseButton = false,
|
|
492
|
+
hasFocus = true,
|
|
493
|
+
closeOnEscape = true,
|
|
506
494
|
title,
|
|
507
495
|
subtitle,
|
|
508
496
|
...rest
|
|
@@ -552,10 +540,12 @@ function ActionableNotification(_ref6) {
|
|
|
552
540
|
className: `${prefix}--actionable-notification__text-wrapper`
|
|
553
541
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
554
542
|
className: `${prefix}--actionable-notification__content`
|
|
555
|
-
}, title && /*#__PURE__*/React__default.createElement(
|
|
543
|
+
}, title && /*#__PURE__*/React__default.createElement(Text, {
|
|
544
|
+
as: "div",
|
|
556
545
|
className: `${prefix}--actionable-notification__title`,
|
|
557
546
|
id: id
|
|
558
|
-
}, title), subtitle && /*#__PURE__*/React__default.createElement(
|
|
547
|
+
}, title), subtitle && /*#__PURE__*/React__default.createElement(Text, {
|
|
548
|
+
as: "div",
|
|
559
549
|
className: `${prefix}--actionable-notification__subtitle`,
|
|
560
550
|
id: subtitleId
|
|
561
551
|
}, subtitle), children))), actionButtonLabel && /*#__PURE__*/React__default.createElement(NotificationActionButton, {
|
|
@@ -608,7 +598,7 @@ ActionableNotification.propTypes = {
|
|
|
608
598
|
/**
|
|
609
599
|
* Specify what state the notification represents
|
|
610
600
|
*/
|
|
611
|
-
kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt'])
|
|
601
|
+
kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
|
|
612
602
|
/**
|
|
613
603
|
* Specify whether you are using the low contrast variant of the ActionableNotification.
|
|
614
604
|
*/
|
|
@@ -643,14 +633,5 @@ ActionableNotification.propTypes = {
|
|
|
643
633
|
*/
|
|
644
634
|
title: PropTypes.string
|
|
645
635
|
};
|
|
646
|
-
ActionableNotification.defaultProps = {
|
|
647
|
-
kind: 'error',
|
|
648
|
-
role: 'alertdialog',
|
|
649
|
-
onCloseButtonClick: () => {},
|
|
650
|
-
hideCloseButton: false,
|
|
651
|
-
hasFocus: true,
|
|
652
|
-
closeOnEscape: true,
|
|
653
|
-
inline: false
|
|
654
|
-
};
|
|
655
636
|
|
|
656
637
|
export { ActionableNotification, InlineNotification, NotificationActionButton, NotificationButton, ToastNotification };
|
|
@@ -16,6 +16,8 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
16
16
|
import deprecate from '../../prop-types/deprecate.js';
|
|
17
17
|
import '../FluidForm/FluidForm.js';
|
|
18
18
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
19
|
+
import '../Text/index.js';
|
|
20
|
+
import { Text } from '../Text/Text.js';
|
|
19
21
|
|
|
20
22
|
var _Subtract, _Add;
|
|
21
23
|
const translationIds = {
|
|
@@ -371,7 +373,8 @@ function Label(_ref) {
|
|
|
371
373
|
[`${prefix}--visually-hidden`]: hideLabel
|
|
372
374
|
});
|
|
373
375
|
if (label) {
|
|
374
|
-
return /*#__PURE__*/React__default.createElement(
|
|
376
|
+
return /*#__PURE__*/React__default.createElement(Text, {
|
|
377
|
+
as: "label",
|
|
375
378
|
htmlFor: id,
|
|
376
379
|
className: className
|
|
377
380
|
}, label);
|
|
@@ -395,7 +398,8 @@ function HelperText(_ref2) {
|
|
|
395
398
|
[`${prefix}--form__helper-text--disabled`]: disabled
|
|
396
399
|
});
|
|
397
400
|
if (description) {
|
|
398
|
-
return /*#__PURE__*/React__default.createElement(
|
|
401
|
+
return /*#__PURE__*/React__default.createElement(Text, {
|
|
402
|
+
as: "div",
|
|
399
403
|
id: id,
|
|
400
404
|
className: className
|
|
401
405
|
}, description);
|
|
@@ -18,6 +18,7 @@ import { PrefixContext } from '../../internal/usePrefix.js';
|
|
|
18
18
|
import deprecate from '../../prop-types/deprecate.js';
|
|
19
19
|
import { IconButton } from '../IconButton/index.js';
|
|
20
20
|
import setupGetInstanceId from '../../tools/setupGetInstanceId.js';
|
|
21
|
+
import { noopFn } from '../../internal/noopFn.js';
|
|
21
22
|
import { matches } from '../../internal/keyboard/match.js';
|
|
22
23
|
import { ArrowUp, ArrowRight, ArrowDown, ArrowLeft, Escape } from '../../internal/keyboard/keys.js';
|
|
23
24
|
|
|
@@ -114,12 +115,15 @@ class OverflowMenu extends Component {
|
|
|
114
115
|
*/
|
|
115
116
|
_defineProperty(this, "_triggerRef", /*#__PURE__*/React__default.createRef());
|
|
116
117
|
_defineProperty(this, "handleClick", evt => {
|
|
118
|
+
const {
|
|
119
|
+
onClick = noopFn
|
|
120
|
+
} = this.props;
|
|
117
121
|
evt.stopPropagation();
|
|
118
122
|
if (!this._menuBody || !this._menuBody.contains(evt.target)) {
|
|
119
123
|
this.setState({
|
|
120
124
|
open: !this.state.open
|
|
121
125
|
});
|
|
122
|
-
|
|
126
|
+
onClick(evt);
|
|
123
127
|
}
|
|
124
128
|
});
|
|
125
129
|
_defineProperty(this, "closeMenuAndFocus", () => {
|
|
@@ -149,6 +153,9 @@ class OverflowMenu extends Component {
|
|
|
149
153
|
}
|
|
150
154
|
});
|
|
151
155
|
_defineProperty(this, "closeMenu", onCloseMenu => {
|
|
156
|
+
const {
|
|
157
|
+
onClose = noopFn
|
|
158
|
+
} = this.props;
|
|
152
159
|
this.setState({
|
|
153
160
|
open: false
|
|
154
161
|
}, () => {
|
|
@@ -156,7 +163,7 @@ class OverflowMenu extends Component {
|
|
|
156
163
|
if (onCloseMenu) {
|
|
157
164
|
onCloseMenu();
|
|
158
165
|
}
|
|
159
|
-
|
|
166
|
+
onClose();
|
|
160
167
|
});
|
|
161
168
|
});
|
|
162
169
|
_defineProperty(this, "focusMenuEl", () => {
|
|
@@ -221,6 +228,9 @@ class OverflowMenu extends Component {
|
|
|
221
228
|
* @private
|
|
222
229
|
*/
|
|
223
230
|
_defineProperty(this, "_handlePlace", menuBody => {
|
|
231
|
+
const {
|
|
232
|
+
onOpen = noopFn
|
|
233
|
+
} = this.props;
|
|
224
234
|
if (menuBody) {
|
|
225
235
|
this._menuBody = menuBody;
|
|
226
236
|
const hasFocusin = ('onfocusin' in window);
|
|
@@ -236,7 +246,7 @@ class OverflowMenu extends Component {
|
|
|
236
246
|
}
|
|
237
247
|
}
|
|
238
248
|
}, !hasFocusin);
|
|
239
|
-
|
|
249
|
+
onOpen();
|
|
240
250
|
}
|
|
241
251
|
});
|
|
242
252
|
/**
|
|
@@ -251,7 +261,7 @@ class OverflowMenu extends Component {
|
|
|
251
261
|
}
|
|
252
262
|
componentDidUpdate(_, prevState) {
|
|
253
263
|
const {
|
|
254
|
-
onClose
|
|
264
|
+
onClose = noopFn
|
|
255
265
|
} = this.props;
|
|
256
266
|
if (!this.state.open && prevState.open) {
|
|
257
267
|
onClose();
|
|
@@ -288,23 +298,23 @@ class OverflowMenu extends Component {
|
|
|
288
298
|
const prefix = this.context;
|
|
289
299
|
const {
|
|
290
300
|
id,
|
|
291
|
-
['aria-label']: ariaLabel,
|
|
301
|
+
['aria-label']: ariaLabel = null,
|
|
292
302
|
ariaLabel: deprecatedAriaLabel,
|
|
293
303
|
children,
|
|
294
|
-
iconDescription,
|
|
295
|
-
direction,
|
|
296
|
-
flipped,
|
|
297
|
-
focusTrap,
|
|
298
|
-
menuOffset,
|
|
299
|
-
menuOffsetFlip,
|
|
304
|
+
iconDescription = 'Options',
|
|
305
|
+
direction = DIRECTION_BOTTOM,
|
|
306
|
+
flipped = false,
|
|
307
|
+
focusTrap = true,
|
|
308
|
+
menuOffset = getMenuOffset,
|
|
309
|
+
menuOffsetFlip = getMenuOffset,
|
|
300
310
|
iconClass,
|
|
301
|
-
onClick,
|
|
311
|
+
onClick = noopFn,
|
|
302
312
|
// eslint-disable-line
|
|
303
|
-
onOpen,
|
|
313
|
+
onOpen = noopFn,
|
|
304
314
|
// eslint-disable-line
|
|
305
315
|
selectorPrimaryFocus = '[data-floating-menu-primary-focus]',
|
|
306
316
|
// eslint-disable-line
|
|
307
|
-
renderIcon: IconElement,
|
|
317
|
+
renderIcon: IconElement = OverflowMenuVertical,
|
|
308
318
|
// eslint-disable-next-line react/prop-types
|
|
309
319
|
innerRef: ref,
|
|
310
320
|
menuOptionsClass,
|
|
@@ -313,7 +323,7 @@ class OverflowMenu extends Component {
|
|
|
313
323
|
...other
|
|
314
324
|
} = this.props;
|
|
315
325
|
const {
|
|
316
|
-
open
|
|
326
|
+
open = false
|
|
317
327
|
} = this.state;
|
|
318
328
|
const overflowMenuClasses = cx(this.props.className, `${prefix}--overflow-menu`, {
|
|
319
329
|
[`${prefix}--overflow-menu--open`]: open,
|
|
@@ -369,7 +379,7 @@ class OverflowMenu extends Component {
|
|
|
369
379
|
}, /*#__PURE__*/React__default.createElement(IconButton, _extends({}, other, {
|
|
370
380
|
type: "button",
|
|
371
381
|
"aria-haspopup": true,
|
|
372
|
-
"aria-expanded":
|
|
382
|
+
"aria-expanded": open,
|
|
373
383
|
"aria-controls": open ? menuBodyId : null,
|
|
374
384
|
className: overflowMenuClasses,
|
|
375
385
|
onClick: this.handleClick,
|
|
@@ -417,7 +427,7 @@ _defineProperty(OverflowMenu, "propTypes", {
|
|
|
417
427
|
/**
|
|
418
428
|
* The icon description.
|
|
419
429
|
*/
|
|
420
|
-
iconDescription: PropTypes.string
|
|
430
|
+
iconDescription: PropTypes.string,
|
|
421
431
|
/**
|
|
422
432
|
* The element ID.
|
|
423
433
|
*/
|
|
@@ -484,22 +494,6 @@ _defineProperty(OverflowMenu, "propTypes", {
|
|
|
484
494
|
size: PropTypes.oneOf(['sm', 'md', 'lg'])
|
|
485
495
|
});
|
|
486
496
|
_defineProperty(OverflowMenu, "contextType", PrefixContext);
|
|
487
|
-
_defineProperty(OverflowMenu, "defaultProps", {
|
|
488
|
-
['aria-label']: null,
|
|
489
|
-
iconDescription: 'Options',
|
|
490
|
-
open: false,
|
|
491
|
-
direction: DIRECTION_BOTTOM,
|
|
492
|
-
flipped: false,
|
|
493
|
-
focusTrap: true,
|
|
494
|
-
renderIcon: OverflowMenuVertical,
|
|
495
|
-
onClick: () => {},
|
|
496
|
-
onKeyDown: () => {},
|
|
497
|
-
onClose: () => {},
|
|
498
|
-
onOpen: () => {},
|
|
499
|
-
menuOffset: getMenuOffset,
|
|
500
|
-
menuOffsetFlip: getMenuOffset,
|
|
501
|
-
selectorPrimaryFocus: '[data-overflow-menu-primary-focus]'
|
|
502
|
-
});
|
|
503
497
|
(() => {
|
|
504
498
|
const forwardRef = (props, ref) => /*#__PURE__*/React__default.createElement(OverflowMenu, _extends({}, props, {
|
|
505
499
|
innerRef: ref
|
|
@@ -11,6 +11,8 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import React__default from 'react';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
import { warning } from '../../internal/warning.js';
|
|
14
|
+
import '../Text/index.js';
|
|
15
|
+
import { Text } from '../Text/Text.js';
|
|
14
16
|
import { match } from '../../internal/keyboard/match.js';
|
|
15
17
|
import { ArrowDown, ArrowUp } from '../../internal/keyboard/keys.js';
|
|
16
18
|
|
|
@@ -71,7 +73,8 @@ const OverflowMenuItem = /*#__PURE__*/React__default.forwardRef(function Overflo
|
|
|
71
73
|
className: `${prefix}--overflow-menu-options__option-content`
|
|
72
74
|
}, itemText);
|
|
73
75
|
})();
|
|
74
|
-
return /*#__PURE__*/React__default.createElement(
|
|
76
|
+
return /*#__PURE__*/React__default.createElement(Text, {
|
|
77
|
+
as: "li",
|
|
75
78
|
className: overflowMenuItemClasses,
|
|
76
79
|
role: "none"
|
|
77
80
|
}, /*#__PURE__*/React__default.createElement(TagToUse, _extends({
|
|
@@ -18,10 +18,10 @@ import { usePrefix } from '../../../internal/usePrefix.js';
|
|
|
18
18
|
const getInstanceId = setupGetInstanceId();
|
|
19
19
|
function PageSelector(_ref) {
|
|
20
20
|
let {
|
|
21
|
-
className,
|
|
21
|
+
className = null,
|
|
22
22
|
currentPage,
|
|
23
|
-
id,
|
|
24
|
-
labelText,
|
|
23
|
+
id = 1,
|
|
24
|
+
labelText = 'Current page number',
|
|
25
25
|
totalPages,
|
|
26
26
|
...other
|
|
27
27
|
} = _ref;
|
|
@@ -63,10 +63,5 @@ PageSelector.propTypes = {
|
|
|
63
63
|
*/
|
|
64
64
|
totalPages: PropTypes.number.isRequired
|
|
65
65
|
};
|
|
66
|
-
PageSelector.defaultProps = {
|
|
67
|
-
className: null,
|
|
68
|
-
id: 1,
|
|
69
|
-
labelText: 'Current page number'
|
|
70
|
-
};
|
|
71
66
|
|
|
72
67
|
export { PageSelector as default };
|
|
@@ -19,23 +19,23 @@ import { usePrefix } from '../../../internal/usePrefix.js';
|
|
|
19
19
|
var _CaretLeft, _CaretRight;
|
|
20
20
|
function Pagination(_ref) {
|
|
21
21
|
let {
|
|
22
|
-
backwardText,
|
|
23
|
-
children,
|
|
24
|
-
className,
|
|
25
|
-
disabled,
|
|
26
|
-
forwardText,
|
|
27
|
-
id,
|
|
28
|
-
initialPage,
|
|
29
|
-
itemsPerPageText,
|
|
30
|
-
itemRangeText,
|
|
31
|
-
itemText,
|
|
22
|
+
backwardText = 'Previous page',
|
|
23
|
+
children = undefined,
|
|
24
|
+
className = null,
|
|
25
|
+
disabled = false,
|
|
26
|
+
forwardText = 'Next page',
|
|
27
|
+
id = 1,
|
|
28
|
+
initialPage = 1,
|
|
29
|
+
itemsPerPageText = 'Items per page:',
|
|
30
|
+
itemRangeText = (min, max, total) => `${min}–${max} of ${total} items`,
|
|
31
|
+
itemText = (min, max) => `${min}–${max} items`,
|
|
32
32
|
onChange,
|
|
33
|
-
pageRangeText,
|
|
34
|
-
pageSize,
|
|
35
|
-
pageSizes,
|
|
36
|
-
pageText
|
|
37
|
-
pagesUnknown,
|
|
38
|
-
totalItems,
|
|
33
|
+
pageRangeText = (current, total) => `${current} of ${total} pages`,
|
|
34
|
+
pageSize = 10,
|
|
35
|
+
pageSizes = undefined,
|
|
36
|
+
pageText = page => `page ${page}`,
|
|
37
|
+
pagesUnknown = false,
|
|
38
|
+
totalItems = undefined,
|
|
39
39
|
...other
|
|
40
40
|
} = _ref;
|
|
41
41
|
const [currentPage, setCurrentPage] = useState(initialPage);
|
|
@@ -193,23 +193,5 @@ Pagination.propTypes = {
|
|
|
193
193
|
*/
|
|
194
194
|
totalItems: PropTypes.number
|
|
195
195
|
};
|
|
196
|
-
Pagination.defaultProps = {
|
|
197
|
-
backwardText: 'Previous page',
|
|
198
|
-
className: null,
|
|
199
|
-
children: undefined,
|
|
200
|
-
disabled: false,
|
|
201
|
-
forwardText: 'Next page',
|
|
202
|
-
id: 1,
|
|
203
|
-
itemsPerPageText: 'Items per page:',
|
|
204
|
-
itemRangeText: (min, max, total) => `${min}–${max} of ${total} items`,
|
|
205
|
-
itemText: (min, max) => `${min}–${max} items`,
|
|
206
|
-
initialPage: 1,
|
|
207
|
-
pageRangeText: (current, total) => `${current} of ${total} pages`,
|
|
208
|
-
pageSize: 10,
|
|
209
|
-
pageSizes: undefined,
|
|
210
|
-
pageText: page => `page ${page}`,
|
|
211
|
-
pagesUnknown: false,
|
|
212
|
-
totalItems: undefined
|
|
213
|
-
};
|
|
214
196
|
|
|
215
197
|
export { Pagination as default };
|
|
@@ -11,6 +11,8 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import React__default, { useState } from 'react';
|
|
12
12
|
import { Warning, Incomplete, CheckmarkOutline, CircleDash } from '@carbon/icons-react';
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
|
+
import '../Text/index.js';
|
|
15
|
+
import { Text } from '../Text/Text.js';
|
|
14
16
|
import { matches } from '../../internal/keyboard/match.js';
|
|
15
17
|
import { Enter, Space } from '../../internal/keyboard/keys.js';
|
|
16
18
|
|
|
@@ -114,7 +116,7 @@ function ProgressStep(_ref2) {
|
|
|
114
116
|
secondaryLabel,
|
|
115
117
|
disabled,
|
|
116
118
|
onClick,
|
|
117
|
-
translateWithId: t,
|
|
119
|
+
translateWithId: t = translateWithId,
|
|
118
120
|
...rest
|
|
119
121
|
} = _ref2;
|
|
120
122
|
const prefix = usePrefix();
|
|
@@ -185,9 +187,11 @@ function ProgressStep(_ref2) {
|
|
|
185
187
|
prefix: prefix
|
|
186
188
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
187
189
|
className: `${prefix}--progress-text`
|
|
188
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
190
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
191
|
+
as: "p",
|
|
189
192
|
className: `${prefix}--progress-label`
|
|
190
|
-
}, label), secondaryLabel !== null && secondaryLabel !== undefined ? /*#__PURE__*/React__default.createElement(
|
|
193
|
+
}, label), secondaryLabel !== null && secondaryLabel !== undefined ? /*#__PURE__*/React__default.createElement(Text, {
|
|
194
|
+
as: "p",
|
|
191
195
|
className: `${prefix}--progress-optional`
|
|
192
196
|
}, secondaryLabel) : null), /*#__PURE__*/React__default.createElement("span", {
|
|
193
197
|
className: `${prefix}--assistive-text`
|
|
@@ -250,8 +254,5 @@ ProgressStep.propTypes = {
|
|
|
250
254
|
*/
|
|
251
255
|
translateWithId: PropTypes.func
|
|
252
256
|
};
|
|
253
|
-
ProgressStep.defaultProps = {
|
|
254
|
-
translateWithId
|
|
255
|
-
};
|
|
256
257
|
|
|
257
258
|
export { ProgressIndicator, ProgressStep };
|
|
@@ -13,6 +13,9 @@ import React__default from 'react';
|
|
|
13
13
|
import { useFallbackId } from '../../internal/useId.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
15
|
import deprecate from '../../prop-types/deprecate.js';
|
|
16
|
+
import { noopFn } from '../../internal/noopFn.js';
|
|
17
|
+
import '../Text/index.js';
|
|
18
|
+
import { Text } from '../Text/Text.js';
|
|
16
19
|
import { matches } from '../../internal/keyboard/match.js';
|
|
17
20
|
import { Enter, Space } from '../../internal/keyboard/keys.js';
|
|
18
21
|
|
|
@@ -28,8 +31,8 @@ const RadioTile = /*#__PURE__*/React__default.forwardRef(function RadioTile(_ref
|
|
|
28
31
|
name,
|
|
29
32
|
value,
|
|
30
33
|
id,
|
|
31
|
-
onChange,
|
|
32
|
-
tabIndex,
|
|
34
|
+
onChange = noopFn,
|
|
35
|
+
tabIndex = 0,
|
|
33
36
|
...rest
|
|
34
37
|
} = _ref;
|
|
35
38
|
const prefix = usePrefix();
|
|
@@ -65,7 +68,7 @@ const RadioTile = /*#__PURE__*/React__default.forwardRef(function RadioTile(_ref
|
|
|
65
68
|
className: className
|
|
66
69
|
}), /*#__PURE__*/React__default.createElement("span", {
|
|
67
70
|
className: `${prefix}--tile__checkmark`
|
|
68
|
-
}, _CheckmarkFilled || (_CheckmarkFilled = /*#__PURE__*/React__default.createElement(CheckmarkFilled, null))), /*#__PURE__*/React__default.createElement(
|
|
71
|
+
}, _CheckmarkFilled || (_CheckmarkFilled = /*#__PURE__*/React__default.createElement(CheckmarkFilled, null))), /*#__PURE__*/React__default.createElement(Text, {
|
|
69
72
|
className: `${prefix}--tile-content`
|
|
70
73
|
}, children)));
|
|
71
74
|
});
|
|
@@ -112,10 +115,6 @@ RadioTile.propTypes = {
|
|
|
112
115
|
*/
|
|
113
116
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
|
|
114
117
|
};
|
|
115
|
-
RadioTile.defaultProps = {
|
|
116
|
-
onChange: () => {},
|
|
117
|
-
tabIndex: 0
|
|
118
|
-
};
|
|
119
118
|
var RadioTile$1 = RadioTile;
|
|
120
119
|
|
|
121
120
|
export { RadioTile$1 as default };
|