Skip to content

Commit

Permalink
feat(react): add ContainedTab and ContainedTabs (#9974)
Browse files Browse the repository at this point in the history
* feat(react): add ContainedTab and ContainedTabs

* fix(react): update snapshots

Co-authored-by: Taylor Jones <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 2, 2021
1 parent fe9428a commit 6967b7c
Show file tree
Hide file tree
Showing 10 changed files with 962 additions and 135 deletions.
127 changes: 0 additions & 127 deletions packages/carbon-react/src/components/Tabs/Tabs.stories.js

This file was deleted.

94 changes: 94 additions & 0 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5958,6 +5958,51 @@ Map {
},
},
},
"unstable_ContainedTab" => Object {
"$$typeof": Symbol(react.forward_ref),
"propTypes": Object {
"className": Object {
"type": "string",
},
"disabled": Object {
"type": "bool",
},
"handleTabClick": Object {
"type": "func",
},
"handleTabKeyDown": Object {
"type": "func",
},
"id": Object {
"type": "string",
},
"index": Object {
"type": "number",
},
"label": Object {
"type": "node",
},
"onClick": Object {
"type": "func",
},
"onKeyDown": Object {
"type": "func",
},
"renderButton": Object {
"type": "func",
},
"renderContent": Object {
"type": "func",
},
"selected": Object {
"type": "bool",
},
"tabIndex": Object {
"type": "number",
},
},
"render": [Function],
},
"TabContent" => Object {
"defaultProps": Object {
"selected": false,
Expand Down Expand Up @@ -6056,6 +6101,55 @@ Map {
},
},
},
"unstable_ContainedTabs" => Object {
"$$typeof": Symbol(react.forward_ref),
"propTypes": Object {
"children": Object {
"type": "node",
},
"className": Object {
"type": "string",
},
"hidden": Object {
"type": "bool",
},
"leftOverflowButtonProps": Object {
"type": "object",
},
"light": [Function],
"onClick": Object {
"type": "func",
},
"onKeyDown": Object {
"type": "func",
},
"onSelectionChange": Object {
"type": "func",
},
"rightOverflowButtonProps": Object {
"type": "object",
},
"scrollIntoView": Object {
"type": "bool",
},
"selected": Object {
"type": "number",
},
"selectionMode": Object {
"args": Array [
Array [
"automatic",
"manual",
],
],
"type": "oneOf",
},
"tabContentClassName": Object {
"type": "string",
},
},
"render": [Function],
},
"Tag" => Object {
"propTypes": Object {
"children": Object {
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/__tests__/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ Array [
"TooltipDefinition",
"TooltipIcon",
"UnorderedList",
"unstable_ContainedTab",
"unstable_ContainedTabs",
"unstable_FeatureFlags",
"unstable_HStack",
"unstable_Heading",
Expand Down
3 changes: 3 additions & 0 deletions packages/react/src/components/Tab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
import * as FeatureFlags from '@carbon/feature-flags';
import { default as TabNext } from './next/Tab';
import { default as TabClassic } from './Tab';
import ContainedTab from './next/ContainedTab';

const Tab = FeatureFlags.enabled('enable-v11-release') ? TabNext : TabClassic;

export { ContainedTab };

export default Tab;
Loading

0 comments on commit 6967b7c

Please sign in to comment.