@carbon/react 1.44.0 → 1.45.0-rc.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 +805 -805
- package/es/components/Checkbox/Checkbox.d.ts +1 -1
- package/es/components/Checkbox/Checkbox.js +1 -1
- package/es/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/es/components/ComboBox/ComboBox.d.ts +1 -1
- package/es/components/ComboBox/ComboBox.js +1 -1
- package/es/components/ComboButton/index.js +1 -1
- package/es/components/ComposedModal/ModalFooter.d.ts +2 -1
- package/es/components/DataTable/DataTable.d.ts +2 -0
- package/es/components/DataTable/DataTable.js +3 -0
- package/es/components/DataTable/TableExpandRow.js +20 -3
- package/es/components/DataTable/TableHeader.d.ts +5 -0
- package/es/components/DataTable/TableHeader.js +30 -6
- package/es/components/DataTable/TableSlugRow.d.ts +31 -0
- package/es/components/DataTable/TableSlugRow.js +49 -0
- package/es/components/DataTable/index.d.ts +2 -1
- package/es/components/DataTable/index.js +3 -0
- package/es/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/es/components/DatePickerInput/DatePickerInput.js +1 -1
- package/es/components/Dropdown/Dropdown.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.js +1 -1
- package/es/components/InlineLoading/InlineLoading.d.ts +68 -0
- package/es/components/InlineLoading/InlineLoading.js +4 -4
- package/es/components/InlineLoading/index.d.ts +9 -0
- package/es/components/Layer/LayerContext.d.ts +8 -0
- package/es/components/Layer/LayerLevel.d.ts +5 -0
- package/es/components/Layer/LayerLevel.js +12 -0
- package/es/components/Layer/index.d.ts +38 -0
- package/es/components/Layer/index.js +9 -8
- package/es/components/Menu/MenuItem.js +2 -1
- package/es/components/MenuButton/index.js +1 -1
- package/es/components/Modal/Modal.d.ts +3 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +1 -1
- package/es/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/es/components/MultiSelect/MultiSelect.js +1 -1
- package/es/components/Notification/Notification.js +1 -0
- package/es/components/NumberInput/NumberInput.d.ts +1 -1
- package/es/components/NumberInput/NumberInput.js +1 -1
- package/es/components/RadioButton/RadioButton.d.ts +1 -1
- package/es/components/RadioButton/RadioButton.js +1 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/Select/Select.js +1 -1
- package/es/components/Slider/Slider.Skeleton.js +17 -3
- package/es/components/Slider/Slider.js +132 -93
- package/es/components/Slider/SliderHandles.d.ts +4 -0
- package/es/components/Slider/SliderHandles.js +65 -0
- package/es/components/Tabs/Tabs.js +1 -1
- package/es/components/TextArea/TextArea.d.ts +7 -3
- package/es/components/TextArea/TextArea.js +84 -17
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +1 -1
- package/es/components/Tile/Tile.d.ts +8 -8
- package/es/components/Tile/Tile.js +9 -5
- package/es/components/Tooltip/Tooltip.js +48 -2
- package/es/components/UIShell/HeaderPanel.d.ts +36 -0
- package/es/components/UIShell/HeaderPanel.js +6 -6
- package/es/index.js +2 -1
- package/es/internal/useAnnouncer.js +2 -1
- package/es/internal/useNoInteractiveChildren.js +2 -6
- package/lib/components/Checkbox/Checkbox.d.ts +1 -1
- package/lib/components/Checkbox/Checkbox.js +1 -1
- package/lib/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.js +1 -1
- package/lib/components/ComboButton/index.js +1 -1
- package/lib/components/ComposedModal/ModalFooter.d.ts +2 -1
- package/lib/components/DataTable/DataTable.d.ts +2 -0
- package/lib/components/DataTable/DataTable.js +3 -0
- package/lib/components/DataTable/TableExpandRow.js +20 -3
- package/lib/components/DataTable/TableHeader.d.ts +5 -0
- package/lib/components/DataTable/TableHeader.js +29 -5
- package/lib/components/DataTable/TableSlugRow.d.ts +31 -0
- package/lib/components/DataTable/TableSlugRow.js +59 -0
- package/lib/components/DataTable/index.d.ts +2 -1
- package/lib/components/DataTable/index.js +3 -0
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/lib/components/DatePickerInput/DatePickerInput.js +1 -1
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.js +1 -1
- package/lib/components/InlineLoading/InlineLoading.d.ts +68 -0
- package/lib/components/InlineLoading/InlineLoading.js +4 -4
- package/lib/components/InlineLoading/index.d.ts +9 -0
- package/lib/components/Layer/LayerContext.d.ts +8 -0
- package/lib/components/Layer/LayerLevel.d.ts +5 -0
- package/lib/components/Layer/LayerLevel.js +18 -0
- package/lib/components/Layer/index.d.ts +38 -0
- package/lib/components/Layer/index.js +10 -9
- package/lib/components/Menu/MenuItem.js +2 -1
- package/lib/components/MenuButton/index.js +1 -1
- package/lib/components/Modal/Modal.d.ts +3 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +1 -1
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/MultiSelect.js +1 -1
- package/lib/components/Notification/Notification.js +1 -0
- package/lib/components/NumberInput/NumberInput.d.ts +1 -1
- package/lib/components/NumberInput/NumberInput.js +1 -1
- package/lib/components/RadioButton/RadioButton.d.ts +1 -1
- package/lib/components/RadioButton/RadioButton.js +1 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/Select.js +1 -1
- package/lib/components/Slider/Slider.Skeleton.js +17 -3
- package/lib/components/Slider/Slider.js +132 -93
- package/lib/components/Slider/SliderHandles.d.ts +4 -0
- package/lib/components/Slider/SliderHandles.js +76 -0
- package/lib/components/Tabs/Tabs.js +1 -1
- package/lib/components/TextArea/TextArea.d.ts +7 -3
- package/lib/components/TextArea/TextArea.js +83 -16
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +1 -1
- package/lib/components/Tile/Tile.d.ts +8 -8
- package/lib/components/Tile/Tile.js +9 -5
- package/lib/components/Tooltip/Tooltip.js +47 -1
- package/lib/components/UIShell/HeaderPanel.d.ts +36 -0
- package/lib/components/UIShell/HeaderPanel.js +7 -7
- package/lib/index.js +4 -2
- package/lib/internal/useAnnouncer.js +2 -1
- package/lib/internal/useNoInteractiveChildren.js +2 -6
- package/package.json +4 -7
|
@@ -46,7 +46,7 @@ export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputE
|
|
|
46
46
|
*/
|
|
47
47
|
invalidText?: React.ReactNode;
|
|
48
48
|
/**
|
|
49
|
-
* Provide a `Slug` component to be rendered inside the `Checkbox` component
|
|
49
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `Checkbox` component
|
|
50
50
|
*/
|
|
51
51
|
slug?: ReactNodeLike;
|
|
52
52
|
/**
|
|
@@ -185,7 +185,7 @@ Checkbox.propTypes = {
|
|
|
185
185
|
*/
|
|
186
186
|
readOnly: PropTypes__default["default"].bool,
|
|
187
187
|
/**
|
|
188
|
-
* Provide a `Slug` component to be rendered inside the `Checkbox` component
|
|
188
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `Checkbox` component
|
|
189
189
|
*/
|
|
190
190
|
slug: PropTypes__default["default"].node,
|
|
191
191
|
/**
|
|
@@ -119,7 +119,7 @@ CheckboxGroup.propTypes = {
|
|
|
119
119
|
*/
|
|
120
120
|
readOnly: PropTypes__default["default"].bool,
|
|
121
121
|
/**
|
|
122
|
-
* Provide a `Slug` component to be rendered inside the `CheckboxGroup` component
|
|
122
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `CheckboxGroup` component
|
|
123
123
|
*/
|
|
124
124
|
slug: PropTypes__default["default"].node,
|
|
125
125
|
/**
|
|
@@ -137,7 +137,7 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
|
|
|
137
137
|
*/
|
|
138
138
|
size?: ListBoxSize;
|
|
139
139
|
/**
|
|
140
|
-
* Provide a `Slug` component to be rendered inside the `ComboBox` component
|
|
140
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `ComboBox` component
|
|
141
141
|
*/
|
|
142
142
|
slug?: ReactNodeLike;
|
|
143
143
|
/**
|
|
@@ -586,7 +586,7 @@ ComboBox.propTypes = {
|
|
|
586
586
|
*/
|
|
587
587
|
size: ListBoxPropTypes.ListBoxSize,
|
|
588
588
|
/**
|
|
589
|
-
* Provide a `Slug` component to be rendered inside the `ComboBox` component
|
|
589
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `ComboBox` component
|
|
590
590
|
*/
|
|
591
591
|
slug: PropTypes__default["default"].node,
|
|
592
592
|
/**
|
|
@@ -30,7 +30,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
30
30
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
31
31
|
|
|
32
32
|
var _ChevronDown;
|
|
33
|
-
const spacing =
|
|
33
|
+
const spacing = 0; // top and bottom spacing between the button and the menu. in px
|
|
34
34
|
const defaultTranslations = {
|
|
35
35
|
'carbon.combo-button.additional-actions': 'Additional actions'
|
|
36
36
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { type ReactNode, type MouseEvent, type Ref } from 'react';
|
|
2
|
+
import { InlineLoadingStatus } from '../InlineLoading/InlineLoading';
|
|
2
3
|
interface SecondaryButtonProps {
|
|
3
4
|
buttonText: ReactNode;
|
|
4
5
|
onClick(evt: MouseEvent): void;
|
|
@@ -70,7 +71,7 @@ export interface ModalFooterProps {
|
|
|
70
71
|
/**
|
|
71
72
|
* loading status
|
|
72
73
|
*/
|
|
73
|
-
loadingStatus?:
|
|
74
|
+
loadingStatus?: InlineLoadingStatus;
|
|
74
75
|
/**
|
|
75
76
|
* Specify the description for the loading text
|
|
76
77
|
*/
|
|
@@ -22,6 +22,7 @@ import TableHeader from './TableHeader';
|
|
|
22
22
|
import TableRow from './TableRow';
|
|
23
23
|
import TableSelectAll from './TableSelectAll';
|
|
24
24
|
import TableSelectRow from './TableSelectRow';
|
|
25
|
+
import TableSlugRow from './TableSlugRow';
|
|
25
26
|
import TableToolbar from './TableToolbar';
|
|
26
27
|
import TableToolbarAction from './TableToolbarAction';
|
|
27
28
|
import TableToolbarContent from './TableToolbarContent';
|
|
@@ -302,6 +303,7 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
|
|
|
302
303
|
static TableRow: typeof TableRow;
|
|
303
304
|
static TableSelectAll: typeof TableSelectAll;
|
|
304
305
|
static TableSelectRow: typeof TableSelectRow;
|
|
306
|
+
static TableSlugRow: typeof TableSlugRow;
|
|
305
307
|
static TableToolbar: typeof TableToolbar;
|
|
306
308
|
static TableToolbarAction: typeof TableToolbarAction;
|
|
307
309
|
static TableToolbarContent: typeof TableToolbarContent;
|
|
@@ -35,6 +35,7 @@ var TableHeader = require('./TableHeader.js');
|
|
|
35
35
|
var TableRow = require('./TableRow.js');
|
|
36
36
|
var TableSelectAll = require('./TableSelectAll.js');
|
|
37
37
|
var TableSelectRow = require('./TableSelectRow.js');
|
|
38
|
+
var TableSlugRow = require('./TableSlugRow.js');
|
|
38
39
|
var TableToolbar = require('./TableToolbar.js');
|
|
39
40
|
var TableToolbarAction = require('./TableToolbarAction.js');
|
|
40
41
|
var TableToolbarContent = require('./TableToolbarContent.js');
|
|
@@ -733,6 +734,7 @@ _rollupPluginBabelHelpers.defineProperty(DataTable, "TableHeader", void 0);
|
|
|
733
734
|
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableRow", void 0);
|
|
734
735
|
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableSelectAll", void 0);
|
|
735
736
|
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableSelectRow", void 0);
|
|
737
|
+
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableSlugRow", void 0);
|
|
736
738
|
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbar", void 0);
|
|
737
739
|
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbarAction", void 0);
|
|
738
740
|
_rollupPluginBabelHelpers.defineProperty(DataTable, "TableToolbarContent", void 0);
|
|
@@ -753,6 +755,7 @@ DataTable.TableHeader = TableHeader["default"];
|
|
|
753
755
|
DataTable.TableRow = TableRow["default"];
|
|
754
756
|
DataTable.TableSelectAll = TableSelectAll["default"];
|
|
755
757
|
DataTable.TableSelectRow = TableSelectRow["default"];
|
|
758
|
+
DataTable.TableSlugRow = TableSlugRow["default"];
|
|
756
759
|
DataTable.TableToolbar = TableToolbar["default"];
|
|
757
760
|
DataTable.TableToolbarAction = TableToolbarAction["default"];
|
|
758
761
|
DataTable.TableToolbarContent = TableToolbarContent["default"];
|
|
@@ -38,17 +38,34 @@ const TableExpandRow = /*#__PURE__*/React__default["default"].forwardRef((_ref,
|
|
|
38
38
|
...rest
|
|
39
39
|
} = _ref;
|
|
40
40
|
const prefix = usePrefix.usePrefix();
|
|
41
|
+
|
|
42
|
+
// We need to put the slug before the expansion arrow and all other table cells after the arrow.
|
|
43
|
+
let rowHasSlug;
|
|
44
|
+
const slug = React__default["default"].Children.toArray(children).map(child => {
|
|
45
|
+
if (child.type?.displayName === 'TableSlugRow') {
|
|
46
|
+
if (child.props.slug) {
|
|
47
|
+
rowHasSlug = true;
|
|
48
|
+
}
|
|
49
|
+
return child;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const normalizedChildren = React__default["default"].Children.toArray(children).map(child => {
|
|
53
|
+
if (child.type?.displayName !== 'TableSlugRow') {
|
|
54
|
+
return child;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
41
57
|
const className = cx__default["default"]({
|
|
42
58
|
[`${prefix}--parent-row`]: true,
|
|
43
59
|
[`${prefix}--expandable-row`]: isExpanded,
|
|
44
|
-
[`${prefix}--data-table--selected`]: isSelected
|
|
60
|
+
[`${prefix}--data-table--selected`]: isSelected,
|
|
61
|
+
[`${prefix}--parent-row--slug`]: rowHasSlug
|
|
45
62
|
}, rowClassName);
|
|
46
63
|
const previousValue = isExpanded ? 'collapsed' : undefined;
|
|
47
64
|
return /*#__PURE__*/React__default["default"].createElement("tr", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
48
65
|
ref: ref,
|
|
49
66
|
className: className,
|
|
50
67
|
"data-parent-row": true
|
|
51
|
-
}), /*#__PURE__*/React__default["default"].createElement(TableCell["default"], {
|
|
68
|
+
}), slug, /*#__PURE__*/React__default["default"].createElement(TableCell["default"], {
|
|
52
69
|
className: `${prefix}--table-expand`,
|
|
53
70
|
"data-previous-value": previousValue,
|
|
54
71
|
headers: expandHeader
|
|
@@ -63,7 +80,7 @@ const TableExpandRow = /*#__PURE__*/React__default["default"].forwardRef((_ref,
|
|
|
63
80
|
}, /*#__PURE__*/React__default["default"].createElement(iconsReact.ChevronRight, {
|
|
64
81
|
className: `${prefix}--table-expand__svg`,
|
|
65
82
|
"aria-label": expandIconDescription
|
|
66
|
-
}))),
|
|
83
|
+
}))), normalizedChildren);
|
|
67
84
|
});
|
|
68
85
|
TableExpandRow.propTypes = {
|
|
69
86
|
/**
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import { ReactNodeLike } from 'prop-types';
|
|
7
8
|
import React, { MouseEventHandler } from 'react';
|
|
8
9
|
import { ReactAttr } from '../../types/common';
|
|
9
10
|
interface TableHeaderProps extends ReactAttr<HTMLTableCellElement & HTMLButtonElement> {
|
|
@@ -43,6 +44,10 @@ interface TableHeaderProps extends ReactAttr<HTMLTableCellElement & HTMLButtonEl
|
|
|
43
44
|
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope
|
|
44
45
|
*/
|
|
45
46
|
scope?: string;
|
|
47
|
+
/**
|
|
48
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `TableSlugRow` component
|
|
49
|
+
*/
|
|
50
|
+
slug?: ReactNodeLike;
|
|
46
51
|
/**
|
|
47
52
|
* Specify which direction we are currently sorting by, should be one of DESC,
|
|
48
53
|
* NONE, or ASC.
|
|
@@ -62,11 +62,26 @@ const TableHeader = /*#__PURE__*/React__default["default"].forwardRef(function T
|
|
|
62
62
|
scope = defaultScope,
|
|
63
63
|
sortDirection,
|
|
64
64
|
translateWithId: t = translateWithId,
|
|
65
|
+
slug,
|
|
65
66
|
id,
|
|
66
67
|
...rest
|
|
67
68
|
} = _ref;
|
|
68
69
|
const prefix = usePrefix.usePrefix();
|
|
69
70
|
const uniqueId = useId.useId('table-sort');
|
|
71
|
+
|
|
72
|
+
// Slug is always size `mini`
|
|
73
|
+
const slugRef = React.useRef(null);
|
|
74
|
+
let normalizedSlug;
|
|
75
|
+
if (slug) {
|
|
76
|
+
normalizedSlug = /*#__PURE__*/React__default["default"].cloneElement(slug, {
|
|
77
|
+
size: 'mini',
|
|
78
|
+
ref: slugRef
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
const headerLabelClassNames = cx__default["default"]({
|
|
82
|
+
[`${prefix}--table-header-label`]: true,
|
|
83
|
+
[`${prefix}--table-header-label--slug`]: slug
|
|
84
|
+
});
|
|
70
85
|
if (!isSortable) {
|
|
71
86
|
return /*#__PURE__*/React__default["default"].createElement("th", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
72
87
|
id: id,
|
|
@@ -75,8 +90,8 @@ const TableHeader = /*#__PURE__*/React__default["default"].forwardRef(function T
|
|
|
75
90
|
colSpan: colSpan,
|
|
76
91
|
ref: ref
|
|
77
92
|
}), children ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
78
|
-
className:
|
|
79
|
-
}, children) : null);
|
|
93
|
+
className: headerLabelClassNames
|
|
94
|
+
}, children, normalizedSlug) : null);
|
|
80
95
|
}
|
|
81
96
|
const className = cx__default["default"](headerClassName, {
|
|
82
97
|
[`${prefix}--table-sort`]: true,
|
|
@@ -90,7 +105,16 @@ const TableHeader = /*#__PURE__*/React__default["default"].forwardRef(function T
|
|
|
90
105
|
isSortHeader,
|
|
91
106
|
sortStates: sortStates.sortStates
|
|
92
107
|
});
|
|
93
|
-
const headerClasses = cx__default["default"](headerClassName, `${prefix}--table-sort__header
|
|
108
|
+
const headerClasses = cx__default["default"](headerClassName, `${prefix}--table-sort__header`, {
|
|
109
|
+
[`${prefix}--table-sort__header--slug`]: slug
|
|
110
|
+
});
|
|
111
|
+
const handleClick = evt => {
|
|
112
|
+
if (slug && slugRef.current && slugRef.current.contains(evt.target)) {
|
|
113
|
+
return;
|
|
114
|
+
} else if (onClick) {
|
|
115
|
+
return onClick(evt);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
94
118
|
return /*#__PURE__*/React__default["default"].createElement("th", {
|
|
95
119
|
id: id,
|
|
96
120
|
"aria-sort": ariaSort,
|
|
@@ -105,12 +129,12 @@ const TableHeader = /*#__PURE__*/React__default["default"].forwardRef(function T
|
|
|
105
129
|
type: "button",
|
|
106
130
|
"aria-describedby": uniqueId,
|
|
107
131
|
className: className,
|
|
108
|
-
onClick:
|
|
132
|
+
onClick: handleClick
|
|
109
133
|
}, rest), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
110
134
|
className: `${prefix}--table-sort__flex`
|
|
111
135
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
112
136
|
className: `${prefix}--table-header-label`
|
|
113
|
-
}, children), /*#__PURE__*/React__default["default"].createElement(iconsReact.ArrowUp, {
|
|
137
|
+
}, children), normalizedSlug, /*#__PURE__*/React__default["default"].createElement(iconsReact.ArrowUp, {
|
|
114
138
|
size: 20,
|
|
115
139
|
className: `${prefix}--table-sort__icon`
|
|
116
140
|
}), /*#__PURE__*/React__default["default"].createElement(iconsReact.ArrowsVertical, {
|
|
@@ -0,0 +1,31 @@
|
|
|
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 PropTypes, { ReactNodeLike } from 'prop-types';
|
|
8
|
+
export interface TableSlugRowProps {
|
|
9
|
+
/**
|
|
10
|
+
* The CSS class names of the cell that wraps the underlying input control
|
|
11
|
+
*/
|
|
12
|
+
className?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Provide a `Slug` component to be rendered inside the `TableSlugRow` component
|
|
15
|
+
*/
|
|
16
|
+
slug?: ReactNodeLike;
|
|
17
|
+
}
|
|
18
|
+
declare const TableSlugRow: {
|
|
19
|
+
({ className, slug }: TableSlugRowProps): JSX.Element;
|
|
20
|
+
propTypes: {
|
|
21
|
+
/**
|
|
22
|
+
* The CSS class names of the cell that wraps the underlying input control
|
|
23
|
+
*/
|
|
24
|
+
className: PropTypes.Requireable<string>;
|
|
25
|
+
/**
|
|
26
|
+
* Provide a `Slug` component to be rendered inside the `TableSlugRow` component
|
|
27
|
+
*/
|
|
28
|
+
slug: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export default TableSlugRow;
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
var PropTypes = require('prop-types');
|
|
13
|
+
var React = require('react');
|
|
14
|
+
var cx = require('classnames');
|
|
15
|
+
var usePrefix = require('../../internal/usePrefix.js');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
+
|
|
19
|
+
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
20
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
|
+
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
22
|
+
|
|
23
|
+
const TableSlugRow = _ref => {
|
|
24
|
+
let {
|
|
25
|
+
className,
|
|
26
|
+
slug
|
|
27
|
+
} = _ref;
|
|
28
|
+
const prefix = usePrefix.usePrefix();
|
|
29
|
+
const TableSlugRowClasses = cx__default["default"]({
|
|
30
|
+
...(className && {
|
|
31
|
+
[className]: true
|
|
32
|
+
}),
|
|
33
|
+
[`${prefix}--table-column-slug`]: true,
|
|
34
|
+
[`${prefix}--table-column-slug--active`]: slug
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Slug is always size `mini`
|
|
38
|
+
let normalizedSlug;
|
|
39
|
+
if (slug) {
|
|
40
|
+
normalizedSlug = /*#__PURE__*/React__default["default"].cloneElement(slug, {
|
|
41
|
+
size: 'mini'
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return /*#__PURE__*/React__default["default"].createElement("td", {
|
|
45
|
+
className: TableSlugRowClasses
|
|
46
|
+
}, normalizedSlug);
|
|
47
|
+
};
|
|
48
|
+
TableSlugRow.propTypes = {
|
|
49
|
+
/**
|
|
50
|
+
* The CSS class names of the cell that wraps the underlying input control
|
|
51
|
+
*/
|
|
52
|
+
className: PropTypes__default["default"].string,
|
|
53
|
+
/**
|
|
54
|
+
* Provide a `Slug` component to be rendered inside the `TableSlugRow` component
|
|
55
|
+
*/
|
|
56
|
+
slug: PropTypes__default["default"].node
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
exports["default"] = TableSlugRow;
|
|
@@ -20,10 +20,11 @@ import TableHeader from './TableHeader';
|
|
|
20
20
|
import TableRow from './TableRow';
|
|
21
21
|
import TableSelectAll from './TableSelectAll';
|
|
22
22
|
import TableSelectRow from './TableSelectRow';
|
|
23
|
+
import TableSlugRow from './TableSlugRow';
|
|
23
24
|
import TableToolbar from './TableToolbar';
|
|
24
25
|
import TableToolbarAction from './TableToolbarAction';
|
|
25
26
|
import TableToolbarContent from './TableToolbarContent';
|
|
26
27
|
import TableToolbarSearch from './TableToolbarSearch';
|
|
27
28
|
import TableToolbarMenu from './TableToolbarMenu';
|
|
28
|
-
export { DataTable, type DataTableCell, type DataTableHeader, type DataTableProps, type DataTableRenderProps, type DataTableRow, type DataTableSize, Table, TableActionList, TableBatchAction, TableBatchActions, TableBody, TableCell, TableContainer, TableExpandHeader, TableExpandRow, TableExpandedRow, TableHead, TableHeader, TableRow, TableSelectAll, TableSelectRow, TableToolbar, TableToolbarAction, TableToolbarContent, TableToolbarSearch, TableToolbarMenu, };
|
|
29
|
+
export { DataTable, type DataTableCell, type DataTableHeader, type DataTableProps, type DataTableRenderProps, type DataTableRow, type DataTableSize, Table, TableActionList, TableBatchAction, TableBatchActions, TableBody, TableCell, TableContainer, TableExpandHeader, TableExpandRow, TableExpandedRow, TableHead, TableHeader, TableRow, TableSelectAll, TableSelectRow, TableSlugRow, TableToolbar, TableToolbarAction, TableToolbarContent, TableToolbarSearch, TableToolbarMenu, };
|
|
29
30
|
export default DataTable;
|
|
@@ -25,6 +25,7 @@ var TableHeader = require('./TableHeader.js');
|
|
|
25
25
|
var TableRow = require('./TableRow.js');
|
|
26
26
|
var TableSelectAll = require('./TableSelectAll.js');
|
|
27
27
|
var TableSelectRow = require('./TableSelectRow.js');
|
|
28
|
+
var TableSlugRow = require('./TableSlugRow.js');
|
|
28
29
|
var TableToolbar = require('./TableToolbar.js');
|
|
29
30
|
var TableToolbarAction = require('./TableToolbarAction.js');
|
|
30
31
|
var TableToolbarContent = require('./TableToolbarContent.js');
|
|
@@ -46,6 +47,7 @@ DataTable["default"].TableHeader = TableHeader["default"];
|
|
|
46
47
|
DataTable["default"].TableRow = TableRow["default"];
|
|
47
48
|
DataTable["default"].TableSelectAll = TableSelectAll["default"];
|
|
48
49
|
DataTable["default"].TableSelectRow = TableSelectRow["default"];
|
|
50
|
+
DataTable["default"].TableSlugRow = TableSlugRow["default"];
|
|
49
51
|
DataTable["default"].TableToolbar = TableToolbar["default"];
|
|
50
52
|
DataTable["default"].TableToolbarAction = TableToolbarAction["default"];
|
|
51
53
|
DataTable["default"].TableToolbarContent = TableToolbarContent["default"];
|
|
@@ -69,6 +71,7 @@ exports.TableHeader = TableHeader["default"];
|
|
|
69
71
|
exports.TableRow = TableRow["default"];
|
|
70
72
|
exports.TableSelectAll = TableSelectAll["default"];
|
|
71
73
|
exports.TableSelectRow = TableSelectRow["default"];
|
|
74
|
+
exports.TableSlugRow = TableSlugRow["default"];
|
|
72
75
|
exports.TableToolbar = TableToolbar["default"];
|
|
73
76
|
exports.TableToolbarAction = TableToolbarAction["default"];
|
|
74
77
|
exports.TableToolbarContent = TableToolbarContent["default"];
|
|
@@ -77,7 +77,7 @@ interface DatePickerInputProps extends Omit<ReactAttr<HTMLInputElement>, Exclude
|
|
|
77
77
|
*/
|
|
78
78
|
size?: 'sm' | 'md' | 'lg';
|
|
79
79
|
/**
|
|
80
|
-
* Provide a `Slug` component to be rendered inside the `DatePickerInput` component
|
|
80
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `DatePickerInput` component
|
|
81
81
|
*/
|
|
82
82
|
slug?: ReactNodeLike;
|
|
83
83
|
/**
|
|
@@ -216,7 +216,7 @@ DatePickerInput.propTypes = {
|
|
|
216
216
|
*/
|
|
217
217
|
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg']),
|
|
218
218
|
/**
|
|
219
|
-
* Provide a `Slug` component to be rendered inside the `DatePickerInput` component
|
|
219
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `DatePickerInput` component
|
|
220
220
|
*/
|
|
221
221
|
slug: PropTypes__default["default"].node,
|
|
222
222
|
/**
|
|
@@ -112,7 +112,7 @@ export interface DropdownProps<ItemType> extends Omit<ReactAttr<HTMLDivElement>,
|
|
|
112
112
|
*/
|
|
113
113
|
size?: ListBoxSize;
|
|
114
114
|
/**
|
|
115
|
-
* Provide a `Slug` component to be rendered inside the `Dropdown` component
|
|
115
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `Dropdown` component
|
|
116
116
|
*/
|
|
117
117
|
slug?: ReactNodeLike;
|
|
118
118
|
/**
|
|
@@ -406,7 +406,7 @@ Dropdown.propTypes = {
|
|
|
406
406
|
*/
|
|
407
407
|
size: ListBoxPropTypes.ListBoxSize,
|
|
408
408
|
/**
|
|
409
|
-
* Provide a `Slug` component to be rendered inside the `Dropdown` component
|
|
409
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `Dropdown` component
|
|
410
410
|
*/
|
|
411
411
|
slug: PropTypes__default["default"].node,
|
|
412
412
|
/**
|
|
@@ -0,0 +1,68 @@
|
|
|
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 React from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
export declare const InlineLoadingStatuses: readonly ["inactive", "active", "finished", "error"];
|
|
10
|
+
export type InlineLoadingStatus = (typeof InlineLoadingStatuses)[number];
|
|
11
|
+
export interface InlineLoadingProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'children'> {
|
|
12
|
+
/**
|
|
13
|
+
* Specify a custom className to be applied to the container node
|
|
14
|
+
*/
|
|
15
|
+
className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Specify the description for the inline loading text
|
|
18
|
+
*/
|
|
19
|
+
description?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Specify the description for the inline loading text
|
|
22
|
+
*/
|
|
23
|
+
iconDescription?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Provide an optional handler to be invoked when <InlineLoading> is
|
|
26
|
+
* successful
|
|
27
|
+
*/
|
|
28
|
+
onSuccess?: () => void;
|
|
29
|
+
/**
|
|
30
|
+
* Specify the loading status
|
|
31
|
+
*/
|
|
32
|
+
status?: InlineLoadingStatus;
|
|
33
|
+
/**
|
|
34
|
+
* Provide a delay for the `setTimeout` for success
|
|
35
|
+
*/
|
|
36
|
+
successDelay?: number;
|
|
37
|
+
}
|
|
38
|
+
declare const InlineLoading: {
|
|
39
|
+
({ className, status, iconDescription, description, onSuccess, successDelay, ...rest }: InlineLoadingProps): JSX.Element;
|
|
40
|
+
propTypes: {
|
|
41
|
+
/**
|
|
42
|
+
* Specify a custom className to be applied to the container node
|
|
43
|
+
*/
|
|
44
|
+
className: PropTypes.Requireable<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Specify the description for the inline loading text
|
|
47
|
+
*/
|
|
48
|
+
description: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
49
|
+
/**
|
|
50
|
+
* Specify the description for the inline loading text
|
|
51
|
+
*/
|
|
52
|
+
iconDescription: PropTypes.Requireable<string>;
|
|
53
|
+
/**
|
|
54
|
+
* Provide an optional handler to be invoked when <InlineLoading> is
|
|
55
|
+
* successful
|
|
56
|
+
*/
|
|
57
|
+
onSuccess: PropTypes.Requireable<(...args: any[]) => any>;
|
|
58
|
+
/**
|
|
59
|
+
* Specify the loading status
|
|
60
|
+
*/
|
|
61
|
+
status: PropTypes.Requireable<string>;
|
|
62
|
+
/**
|
|
63
|
+
* Provide a delay for the `setTimeout` for success
|
|
64
|
+
*/
|
|
65
|
+
successDelay: PropTypes.Requireable<number>;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
export default InlineLoading;
|
|
@@ -23,7 +23,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
23
23
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
24
24
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
const InlineLoading = _ref => {
|
|
27
27
|
let {
|
|
28
28
|
className,
|
|
29
29
|
status = 'active',
|
|
@@ -31,7 +31,7 @@ function InlineLoading(_ref) {
|
|
|
31
31
|
description,
|
|
32
32
|
onSuccess,
|
|
33
33
|
successDelay = 1500,
|
|
34
|
-
...
|
|
34
|
+
...rest
|
|
35
35
|
} = _ref;
|
|
36
36
|
const prefix = usePrefix.usePrefix();
|
|
37
37
|
const loadingClasses = cx__default["default"](`${prefix}--inline-loading`, className);
|
|
@@ -74,10 +74,10 @@ function InlineLoading(_ref) {
|
|
|
74
74
|
}, loading);
|
|
75
75
|
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
76
76
|
className: loadingClasses
|
|
77
|
-
},
|
|
77
|
+
}, rest, {
|
|
78
78
|
"aria-live": 'assertive'
|
|
79
79
|
}), loadingAnimation, description && loadingText);
|
|
80
|
-
}
|
|
80
|
+
};
|
|
81
81
|
InlineLoading.propTypes = {
|
|
82
82
|
/**
|
|
83
83
|
* Specify a custom className to be applied to the container node
|
|
@@ -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 InlineLoading from './InlineLoading';
|
|
8
|
+
export default InlineLoading;
|
|
9
|
+
export { InlineLoading };
|
|
@@ -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
|
+
import React from 'react';
|
|
8
|
+
export declare const LayerContext: React.Context<0 | 1 | 2>;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
+
|
|
12
|
+
const levels = ['one', 'two', 'three'];
|
|
13
|
+
const MIN_LEVEL = 0;
|
|
14
|
+
const MAX_LEVEL = levels.length - 1;
|
|
15
|
+
|
|
16
|
+
exports.MAX_LEVEL = MAX_LEVEL;
|
|
17
|
+
exports.MIN_LEVEL = MIN_LEVEL;
|
|
18
|
+
exports.levels = levels;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 React from 'react';
|
|
8
|
+
import { LayerLevel } from './LayerLevel';
|
|
9
|
+
import { PolymorphicProps } from '../../types/common';
|
|
10
|
+
/**
|
|
11
|
+
* A custom hook that will return information about the current layer. A common
|
|
12
|
+
* field to pull from this is the `level` for the layer that the component that
|
|
13
|
+
* calls this hook is currently in
|
|
14
|
+
*/
|
|
15
|
+
export declare function useLayer(): {
|
|
16
|
+
level: 0 | 1 | 2;
|
|
17
|
+
};
|
|
18
|
+
interface LayerBaseProps {
|
|
19
|
+
/**
|
|
20
|
+
* Provide child elements to be rendered inside of `Theme`
|
|
21
|
+
*/
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Provide a custom class name to be used on the outermost element rendered by
|
|
25
|
+
* the component
|
|
26
|
+
*/
|
|
27
|
+
className?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Specify the layer level and override any existing levels based on hierarchy
|
|
30
|
+
*/
|
|
31
|
+
level?: LayerLevel;
|
|
32
|
+
}
|
|
33
|
+
export type LayerProps<T extends React.ElementType> = PolymorphicProps<T, LayerBaseProps>;
|
|
34
|
+
export interface LayerComponent {
|
|
35
|
+
<T extends React.ElementType>(props: LayerProps<T>, context?: any): React.ReactElement<any, any> | null;
|
|
36
|
+
}
|
|
37
|
+
export declare const Layer: LayerComponent;
|
|
38
|
+
export {};
|