diff --git a/packages/carbon-react/__tests__/index-test.js b/packages/carbon-react/__tests__/index-test.js
index 5e708602c1f4..1553aeab0296 100644
--- a/packages/carbon-react/__tests__/index-test.js
+++ b/packages/carbon-react/__tests__/index-test.js
@@ -57,6 +57,7 @@ describe('Carbon Components React', () => {
"FileUploaderItem",
"FileUploaderSkeleton",
"Filename",
+ "FlexGrid",
"FluidForm",
"Form",
"FormGroup",
diff --git a/packages/carbon-react/src/components/Grid/index.js b/packages/carbon-react/src/components/Grid/index.js
deleted file mode 100644
index 5c444c336fab..000000000000
--- a/packages/carbon-react/src/components/Grid/index.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-export { Grid, Column } from 'carbon-components-react';
diff --git a/packages/carbon-react/src/index.js b/packages/carbon-react/src/index.js
index 8d360a39cdf9..6c5361b8a77b 100644
--- a/packages/carbon-react/src/index.js
+++ b/packages/carbon-react/src/index.js
@@ -184,6 +184,9 @@ export {
SideNavMenu,
SideNavMenuItem,
SideNavSwitcher,
+ Grid,
+ Column,
+ unstable_FlexGrid as FlexGrid,
// Experimental
unstable_useContextMenu,
unstable_FeatureFlags as FeatureFlags,
@@ -219,8 +222,3 @@ export {
unstable_useTheme as useTheme,
unstable_VStack as VStack,
} from 'carbon-components-react';
-export {
- // Grid
- Grid,
- Column,
-} from './components/Grid';
diff --git a/packages/components/src/components/data-table/_data-table-action.scss b/packages/components/src/components/data-table/_data-table-action.scss
index f21caf570b2a..57aa666fbc8d 100644
--- a/packages/components/src/components/data-table/_data-table-action.scss
+++ b/packages/components/src/components/data-table/_data-table-action.scss
@@ -74,11 +74,15 @@
.#{$prefix}--toolbar-search-container-expandable .#{$prefix}--search-input {
height: 100%;
- padding: 0;
cursor: pointer;
opacity: 0;
}
+ .#{$prefix}--toolbar-search-container-expandable:not(.#{$prefix}--toolbar-search-container-active)
+ .#{$prefix}--search-input {
+ padding: 0;
+ }
+
.#{$prefix}--toolbar-search-container-expandable
.#{$prefix}--search-magnifier-icon {
left: 0;
diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
index c6ffd16a8873..cef53693d108 100644
--- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
+++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
@@ -7889,6 +7889,38 @@ Map {
},
},
},
+ "unstable_FlexGrid" => Object {
+ "propTypes": Object {
+ "as": Object {
+ "args": Array [
+ Array [
+ Object {
+ "type": "string",
+ },
+ Object {
+ "type": "elementType",
+ },
+ ],
+ ],
+ "type": "oneOfType",
+ },
+ "children": Object {
+ "type": "node",
+ },
+ "className": Object {
+ "type": "string",
+ },
+ "condensed": Object {
+ "type": "bool",
+ },
+ "fullWidth": Object {
+ "type": "bool",
+ },
+ "narrow": Object {
+ "type": "bool",
+ },
+ },
+ },
"unstable_HStack" => Object {
"$$typeof": Symbol(react.forward_ref),
"render": [Function],
diff --git a/packages/react/src/__tests__/index-test.js b/packages/react/src/__tests__/index-test.js
index c09fae710b74..84a964d0bcb1 100644
--- a/packages/react/src/__tests__/index-test.js
+++ b/packages/react/src/__tests__/index-test.js
@@ -14,225 +14,226 @@ describe('Carbon Components React', () => {
it('should export components', () => {
expect(Object.keys(Carbon).sort()).toMatchInlineSnapshot(`
-Array [
- "Accordion",
- "AccordionItem",
- "AccordionSkeleton",
- "ActionableNotification",
- "AspectRatio",
- "Breadcrumb",
- "BreadcrumbItem",
- "BreadcrumbSkeleton",
- "Button",
- "ButtonSet",
- "ButtonSkeleton",
- "Checkbox",
- "CheckboxSkeleton",
- "ClickableTile",
- "CodeSnippet",
- "CodeSnippetSkeleton",
- "Column",
- "ComboBox",
- "ComposedModal",
- "Content",
- "ContentSwitcher",
- "ControlledPasswordInput",
- "Copy",
- "CopyButton",
- "DangerButton",
- "DataTable",
- "DataTableSkeleton",
- "DatePicker",
- "DatePickerInput",
- "DatePickerSkeleton",
- "Dropdown",
- "DropdownSkeleton",
- "ErrorBoundary",
- "ErrorBoundaryContext",
- "ExpandableSearch",
- "ExpandableTile",
- "FileUploader",
- "FileUploaderButton",
- "FileUploaderDropContainer",
- "FileUploaderItem",
- "FileUploaderSkeleton",
- "Filename",
- "FilterableMultiSelect",
- "FluidForm",
- "Form",
- "FormGroup",
- "FormItem",
- "FormLabel",
- "Grid",
- "Header",
- "HeaderContainer",
- "HeaderGlobalAction",
- "HeaderGlobalBar",
- "HeaderMenu",
- "HeaderMenuButton",
- "HeaderMenuItem",
- "HeaderName",
- "HeaderNavigation",
- "HeaderPanel",
- "HeaderSideNavItems",
- "Icon",
- "IconSkeleton",
- "InlineLoading",
- "InlineNotification",
- "Link",
- "ListItem",
- "Loading",
- "Modal",
- "ModalBody",
- "ModalFooter",
- "ModalHeader",
- "ModalWrapper",
- "MultiSelect",
- "NotificationActionButton",
- "NotificationButton",
- "NotificationTextDetails",
- "NumberInput",
- "NumberInputSkeleton",
- "OrderedList",
- "OverflowMenu",
- "OverflowMenuItem",
- "Pagination",
- "PaginationNav",
- "PaginationSkeleton",
- "PasswordInput",
- "PrimaryButton",
- "ProgressIndicator",
- "ProgressIndicatorSkeleton",
- "ProgressStep",
- "RadioButton",
- "RadioButtonGroup",
- "RadioButtonSkeleton",
- "RadioTile",
- "Row",
- "Search",
- "SearchFilterButton",
- "SearchLayoutButton",
- "SearchSkeleton",
- "SecondaryButton",
- "Select",
- "SelectItem",
- "SelectItemGroup",
- "SelectSkeleton",
- "SelectableTile",
- "SideNav",
- "SideNavDetails",
- "SideNavDivider",
- "SideNavFooter",
- "SideNavHeader",
- "SideNavIcon",
- "SideNavItem",
- "SideNavItems",
- "SideNavLink",
- "SideNavLinkText",
- "SideNavMenu",
- "SideNavMenuItem",
- "SideNavSwitcher",
- "SkeletonPlaceholder",
- "SkeletonText",
- "SkipToContent",
- "Slider",
- "SliderSkeleton",
- "StructuredListBody",
- "StructuredListCell",
- "StructuredListHead",
- "StructuredListInput",
- "StructuredListRow",
- "StructuredListSkeleton",
- "StructuredListWrapper",
- "Switch",
- "Switcher",
- "SwitcherDivider",
- "SwitcherItem",
- "Tab",
- "TabContent",
- "Table",
- "TableActionList",
- "TableBatchAction",
- "TableBatchActions",
- "TableBody",
- "TableCell",
- "TableContainer",
- "TableExpandHeader",
- "TableExpandRow",
- "TableExpandedRow",
- "TableHead",
- "TableHeader",
- "TableRow",
- "TableSelectAll",
- "TableSelectRow",
- "TableToolbar",
- "TableToolbarAction",
- "TableToolbarContent",
- "TableToolbarMenu",
- "TableToolbarSearch",
- "Tabs",
- "TabsSkeleton",
- "Tag",
- "TagSkeleton",
- "TextArea",
- "TextAreaSkeleton",
- "TextInput",
- "TextInputSkeleton",
- "Tile",
- "TileAboveTheFoldContent",
- "TileBelowTheFoldContent",
- "TileGroup",
- "TimePicker",
- "TimePickerSelect",
- "ToastNotification",
- "Toggle",
- "ToggleSkeleton",
- "ToggleSmall",
- "ToggleSmallSkeleton",
- "Toolbar",
- "ToolbarDivider",
- "ToolbarItem",
- "ToolbarOption",
- "ToolbarSearch",
- "ToolbarTitle",
- "Tooltip",
- "TooltipDefinition",
- "TooltipIcon",
- "UnorderedList",
- "unstable_FeatureFlags",
- "unstable_HStack",
- "unstable_Heading",
- "unstable_IconButton",
- "unstable_IconTab",
- "unstable_Layer",
- "unstable_Menu",
- "unstable_MenuDivider",
- "unstable_MenuGroup",
- "unstable_MenuItem",
- "unstable_MenuRadioGroup",
- "unstable_MenuSelectableItem",
- "unstable_PageSelector",
- "unstable_Pagination",
- "unstable_Popover",
- "unstable_PopoverContent",
- "unstable_ProgressBar",
- "unstable_Section",
- "unstable_Stack",
- "unstable_TabList",
- "unstable_TabPanel",
- "unstable_TabPanels",
- "unstable_Theme",
- "unstable_ThemeContext",
- "unstable_Tooltip",
- "unstable_TreeNode",
- "unstable_TreeView",
- "unstable_VStack",
- "unstable_useContextMenu",
- "unstable_useFeatureFlag",
- "unstable_useFeatureFlags",
- "unstable_usePrefix",
- "unstable_useTheme",
-]
-`);
+ Array [
+ "Accordion",
+ "AccordionItem",
+ "AccordionSkeleton",
+ "ActionableNotification",
+ "AspectRatio",
+ "Breadcrumb",
+ "BreadcrumbItem",
+ "BreadcrumbSkeleton",
+ "Button",
+ "ButtonSet",
+ "ButtonSkeleton",
+ "Checkbox",
+ "CheckboxSkeleton",
+ "ClickableTile",
+ "CodeSnippet",
+ "CodeSnippetSkeleton",
+ "Column",
+ "ComboBox",
+ "ComposedModal",
+ "Content",
+ "ContentSwitcher",
+ "ControlledPasswordInput",
+ "Copy",
+ "CopyButton",
+ "DangerButton",
+ "DataTable",
+ "DataTableSkeleton",
+ "DatePicker",
+ "DatePickerInput",
+ "DatePickerSkeleton",
+ "Dropdown",
+ "DropdownSkeleton",
+ "ErrorBoundary",
+ "ErrorBoundaryContext",
+ "ExpandableSearch",
+ "ExpandableTile",
+ "FileUploader",
+ "FileUploaderButton",
+ "FileUploaderDropContainer",
+ "FileUploaderItem",
+ "FileUploaderSkeleton",
+ "Filename",
+ "FilterableMultiSelect",
+ "FluidForm",
+ "Form",
+ "FormGroup",
+ "FormItem",
+ "FormLabel",
+ "Grid",
+ "Header",
+ "HeaderContainer",
+ "HeaderGlobalAction",
+ "HeaderGlobalBar",
+ "HeaderMenu",
+ "HeaderMenuButton",
+ "HeaderMenuItem",
+ "HeaderName",
+ "HeaderNavigation",
+ "HeaderPanel",
+ "HeaderSideNavItems",
+ "Icon",
+ "IconSkeleton",
+ "InlineLoading",
+ "InlineNotification",
+ "Link",
+ "ListItem",
+ "Loading",
+ "Modal",
+ "ModalBody",
+ "ModalFooter",
+ "ModalHeader",
+ "ModalWrapper",
+ "MultiSelect",
+ "NotificationActionButton",
+ "NotificationButton",
+ "NotificationTextDetails",
+ "NumberInput",
+ "NumberInputSkeleton",
+ "OrderedList",
+ "OverflowMenu",
+ "OverflowMenuItem",
+ "Pagination",
+ "PaginationNav",
+ "PaginationSkeleton",
+ "PasswordInput",
+ "PrimaryButton",
+ "ProgressIndicator",
+ "ProgressIndicatorSkeleton",
+ "ProgressStep",
+ "RadioButton",
+ "RadioButtonGroup",
+ "RadioButtonSkeleton",
+ "RadioTile",
+ "Row",
+ "Search",
+ "SearchFilterButton",
+ "SearchLayoutButton",
+ "SearchSkeleton",
+ "SecondaryButton",
+ "Select",
+ "SelectItem",
+ "SelectItemGroup",
+ "SelectSkeleton",
+ "SelectableTile",
+ "SideNav",
+ "SideNavDetails",
+ "SideNavDivider",
+ "SideNavFooter",
+ "SideNavHeader",
+ "SideNavIcon",
+ "SideNavItem",
+ "SideNavItems",
+ "SideNavLink",
+ "SideNavLinkText",
+ "SideNavMenu",
+ "SideNavMenuItem",
+ "SideNavSwitcher",
+ "SkeletonPlaceholder",
+ "SkeletonText",
+ "SkipToContent",
+ "Slider",
+ "SliderSkeleton",
+ "StructuredListBody",
+ "StructuredListCell",
+ "StructuredListHead",
+ "StructuredListInput",
+ "StructuredListRow",
+ "StructuredListSkeleton",
+ "StructuredListWrapper",
+ "Switch",
+ "Switcher",
+ "SwitcherDivider",
+ "SwitcherItem",
+ "Tab",
+ "TabContent",
+ "Table",
+ "TableActionList",
+ "TableBatchAction",
+ "TableBatchActions",
+ "TableBody",
+ "TableCell",
+ "TableContainer",
+ "TableExpandHeader",
+ "TableExpandRow",
+ "TableExpandedRow",
+ "TableHead",
+ "TableHeader",
+ "TableRow",
+ "TableSelectAll",
+ "TableSelectRow",
+ "TableToolbar",
+ "TableToolbarAction",
+ "TableToolbarContent",
+ "TableToolbarMenu",
+ "TableToolbarSearch",
+ "Tabs",
+ "TabsSkeleton",
+ "Tag",
+ "TagSkeleton",
+ "TextArea",
+ "TextAreaSkeleton",
+ "TextInput",
+ "TextInputSkeleton",
+ "Tile",
+ "TileAboveTheFoldContent",
+ "TileBelowTheFoldContent",
+ "TileGroup",
+ "TimePicker",
+ "TimePickerSelect",
+ "ToastNotification",
+ "Toggle",
+ "ToggleSkeleton",
+ "ToggleSmall",
+ "ToggleSmallSkeleton",
+ "Toolbar",
+ "ToolbarDivider",
+ "ToolbarItem",
+ "ToolbarOption",
+ "ToolbarSearch",
+ "ToolbarTitle",
+ "Tooltip",
+ "TooltipDefinition",
+ "TooltipIcon",
+ "UnorderedList",
+ "unstable_FeatureFlags",
+ "unstable_FlexGrid",
+ "unstable_HStack",
+ "unstable_Heading",
+ "unstable_IconButton",
+ "unstable_IconTab",
+ "unstable_Layer",
+ "unstable_Menu",
+ "unstable_MenuDivider",
+ "unstable_MenuGroup",
+ "unstable_MenuItem",
+ "unstable_MenuRadioGroup",
+ "unstable_MenuSelectableItem",
+ "unstable_PageSelector",
+ "unstable_Pagination",
+ "unstable_Popover",
+ "unstable_PopoverContent",
+ "unstable_ProgressBar",
+ "unstable_Section",
+ "unstable_Stack",
+ "unstable_TabList",
+ "unstable_TabPanel",
+ "unstable_TabPanels",
+ "unstable_Theme",
+ "unstable_ThemeContext",
+ "unstable_Tooltip",
+ "unstable_TreeNode",
+ "unstable_TreeView",
+ "unstable_VStack",
+ "unstable_useContextMenu",
+ "unstable_useFeatureFlag",
+ "unstable_useFeatureFlags",
+ "unstable_usePrefix",
+ "unstable_useTheme",
+ ]
+ `);
});
});
diff --git a/packages/react/src/components/Button/Button.js b/packages/react/src/components/Button/Button.js
index 7df8969c77d4..368a182bf6d4 100644
--- a/packages/react/src/components/Button/Button.js
+++ b/packages/react/src/components/Button/Button.js
@@ -141,17 +141,16 @@ const Button = React.forwardRef(function Button(
[`${prefix}--btn--${kind}`]: kind,
[`${prefix}--btn--disabled`]: disabled,
[`${prefix}--btn--expressive`]: isExpressive,
- [`${prefix}--tooltip--visible`]: !enabled && isHovered,
- [`${prefix}--tooltip--hidden`]:
- !enabled && hasIconOnly && !allowTooltipVisibility,
+ [`${prefix}--tooltip--visible`]: isHovered,
+ [`${prefix}--tooltip--hidden`]: hasIconOnly && !allowTooltipVisibility,
[`${prefix}--btn--icon-only`]: hasIconOnly,
[`${prefix}--btn--selected`]: hasIconOnly && isSelected && kind === 'ghost',
- [`${prefix}--tooltip__trigger`]: !enabled && hasIconOnly,
- [`${prefix}--tooltip--a11y`]: !enabled && hasIconOnly,
+ [`${prefix}--tooltip__trigger`]: hasIconOnly,
+ [`${prefix}--tooltip--a11y`]: hasIconOnly,
[`${prefix}--btn--icon-only--${tooltipPosition}`]:
- !enabled && hasIconOnly && tooltipPosition,
+ hasIconOnly && tooltipPosition,
[`${prefix}--tooltip--align-${tooltipAlignment}`]:
- !enabled && hasIconOnly && tooltipAlignment,
+ hasIconOnly && tooltipAlignment,
});
const commonProps = {
@@ -215,26 +214,6 @@ const Button = React.forwardRef(function Button(
otherProps = anchorProps;
}
- if (enabled) {
- delete otherProps['aria-describedby'];
-
- return React.createElement(
- component,
- {
- onMouseEnter,
- onMouseLeave,
- onFocus,
- onBlur,
- onClick,
- type,
- ...other,
- ...commonProps,
- ...otherProps,
- },
- children
- );
- }
-
return React.createElement(
component,
{
diff --git a/packages/react/src/components/Grid/CSSGrid.js b/packages/react/src/components/Grid/CSSGrid.js
new file mode 100644
index 000000000000..918e107811ba
--- /dev/null
+++ b/packages/react/src/components/Grid/CSSGrid.js
@@ -0,0 +1,85 @@
+/**
+ * Copyright IBM Corp. 2016, 2018
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+import cx from 'classnames';
+import PropTypes from 'prop-types';
+import React from 'react';
+import { usePrefix } from '../../internal/usePrefix';
+import { GridSettings, useGridSettings } from './GridContext';
+
+function CSSGrid({
+ as: BaseComponent = 'div',
+ condensed = false,
+ narrow = false,
+ fullWidth = false,
+ columns = 16,
+ className: containerClassName,
+ children,
+ ...rest
+}) {
+ const prefix = usePrefix();
+ const { subgrid } = useGridSettings();
+ const className = cx(containerClassName, {
+ [`${prefix}--css-grid`]: !subgrid,
+ [`${prefix}--css-grid--${columns}`]: !subgrid && columns !== 16,
+ [`${prefix}--css-grid--condensed`]: condensed,
+ [`${prefix}--css-grid--narrow`]: narrow,
+ [`${prefix}--css-grid--full-width`]: fullWidth,
+ [`${prefix}--subgrid`]: subgrid,
+ [`${prefix}--col-span-${columns}`]:
+ (subgrid && columns !== 16) || columns !== 16,
+ });
+
+ return (
+