diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index bd20dc1799..0000000000
--- a/.babelrc
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "presets": [
- "es2015",
- "react"
- ]
-}
diff --git a/.babelrc.js b/.babelrc.js
new file mode 100644
index 0000000000..e7a3c19095
--- /dev/null
+++ b/.babelrc.js
@@ -0,0 +1,48 @@
+'use strict';
+
+const target = process.env.BABEL_TARGET;
+const output = process.env.BABEL_OUTPUT;
+const env = process.env.NODE_ENV;
+const modules = output == null ? false : output;
+
+const targets = env === 'test' ? { node: 'current' } : undefined;
+
+const options = {
+ comments: false,
+ minified: true,
+ assumptions: {
+ ignoreToPrimitiveHint: true,
+ iterableIsArray: true,
+ mutableTemplateObject: true,
+ noNewArrows: true,
+ objectRestNoSymbols: true,
+ setComputedProperties: true,
+ setSpreadProperties: true,
+ },
+ presets: [
+ [
+ '@babel/env',
+ {
+ bugfixes: true,
+ loose: true,
+ modules,
+ targets,
+ corejs: '3',
+ useBuiltIns: 'entry',
+ },
+ ],
+ ['@babel/react', { useBuiltIns: true }],
+ ],
+ plugins: [],
+};
+
+if (target === 'examples') {
+ options.plugins.push([
+ 'transform-react-remove-prop-types',
+ { removeImport: true },
+ ]);
+} else if (env !== 'test') {
+ options.plugins.push(['transform-react-remove-prop-types', { mode: 'wrap' }]);
+}
+
+module.exports = options;
diff --git a/.browserslistrc b/.browserslistrc
new file mode 100644
index 0000000000..55ae8fde69
--- /dev/null
+++ b/.browserslistrc
@@ -0,0 +1,6 @@
+> 0.3%
+last 2 versions
+Firefox ESR
+not dead
+not Android <5
+maintained node versions
\ No newline at end of file
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index 75fa6231bb..0000000000
--- a/.eslintignore
+++ /dev/null
@@ -1 +0,0 @@
-/webpack.*
diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index ea2fb30012..0000000000
--- a/.eslintrc
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "extends": "airbnb",
- "env": {
- "browser": true,
- "node": true
- },
- "rules": {
- "react/prefer-es6-class": 0,
- "react/prefer-stateless-function": 0
- }
-}
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 0000000000..e090ba84f8
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1 @@
+github: [danez]
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000000..4b3711fcd1
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,97 @@
+name: CI
+
+on:
+ push:
+ branches:
+ - main
+ - renovate/**
+ pull_request:
+
+permissions: {}
+
+jobs:
+ tests:
+ name: Unit tests
+ runs-on: ubuntu-latest
+ if: "!startsWith(github.head_ref, 'renovate/')"
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ cache: 'pnpm'
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Unit tests
+ run: pnpm test --coverage
+
+ - name: Upload coverage
+ uses: coverallsapp/github-action@v2
+
+ lint:
+ name: Lint
+ runs-on: ubuntu-latest
+ if: "!startsWith(github.head_ref, 'renovate/')"
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ cache: 'pnpm'
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Lint
+ run: pnpm lint
+
+ release:
+ needs: [tests, lint]
+ if: github.ref == 'refs/heads/main'
+ name: Release
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write # to be able to publish a GitHub release
+ issues: write # to be able to comment on released issues
+ pull-requests: write # to be able to comment on released pull requests
+ id-token: write # to enable use of OIDC for npm provenance
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ cache: 'pnpm'
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Release
+ run: pnpm dlx semantic-release --branches main
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
new file mode 100644
index 0000000000..83a726e4ce
--- /dev/null
+++ b/.github/workflows/codeql-analysis.yml
@@ -0,0 +1,68 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+ push:
+ branches:
+ - main
+ - renovate/**
+ pull_request:
+ schedule:
+ - cron: '33 1 * * 0'
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+ if: "!startsWith(github.head_ref, 'renovate/')"
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ 'javascript' ]
+ # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
+ # Learn more:
+ # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ # Initializes the CodeQL tools for scanning.
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@v3
+ with:
+ languages: ${{ matrix.language }}
+ # If you wish to specify custom queries, you can do so here or in a config file.
+ # By default, queries listed here will override any specified in a config file.
+ # Prefix the list here with "+" to use these queries and those in the config file.
+ # queries: ./path/to/local/query, your-org/your-repo/queries@main
+
+ # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
+ # If this step fails, then you should remove it and run the build manually (see below)
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@v3
+
+ # âšī¸ Command-line programs to run using the OS shell.
+ # đ https://git.io/JvXDl
+
+ # âī¸ If the Autobuild fails above, remove it and uncomment the following three lines
+ # and modify them (or add more) to build your code if your project
+ # uses a compiled language
+
+ #- run: |
+ # make bootstrap
+ # make release
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@v3
diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml
new file mode 100644
index 0000000000..28cc5d68c0
--- /dev/null
+++ b/.github/workflows/lock.yml
@@ -0,0 +1,22 @@
+name: 'Lock Threads'
+
+on:
+ schedule:
+ - cron: '36 5 * * 2'
+ workflow_dispatch:
+
+permissions:
+ issues: write
+ pull-requests: write
+ discussions: write
+
+concurrency:
+ group: lock
+
+jobs:
+ action:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: dessant/lock-threads@v5
+ with:
+ log-output: true
diff --git a/.github/workflows/ossar-analysis.yml b/.github/workflows/ossar-analysis.yml
new file mode 100644
index 0000000000..e4a718be99
--- /dev/null
+++ b/.github/workflows/ossar-analysis.yml
@@ -0,0 +1,53 @@
+# This workflow integrates a collection of open source static analysis tools
+# with GitHub code scanning. For documentation, or to provide feedback, visit
+# https://github.com/github/ossar-action
+name: OSSAR
+
+on:
+ push:
+ branches:
+ - main
+ - renovate/**
+ pull_request:
+
+jobs:
+ OSSAR-Scan:
+ # OSSAR runs on windows-latest.
+ # ubuntu-latest and macos-latest support coming soon
+ runs-on: windows-latest
+ if: "!startsWith(github.head_ref, 'renovate/')"
+
+ steps:
+ # Checkout your code repository to scan
+ - name: Checkout repository
+ uses: actions/checkout@v4
+ with:
+ # We must fetch at least the immediate parents so that if this is
+ # a pull request then we can checkout the head.
+ fetch-depth: 2
+
+ # If this run was triggered by a pull request event, then checkout
+ # the head of the pull request instead of the merge commit.
+ - run: git checkout HEAD^2
+ if: ${{ github.event_name == 'pull_request' }}
+
+ # Ensure a compatible version of dotnet is installed.
+ # The [Microsoft Security Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201.
+ # A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action.
+ # GitHub hosted runners already have a compatible version of dotnet installed and this step may be skipped.
+ # For self-hosted runners, ensure dotnet version 3.1.201 or later is installed by including this action:
+ # - name: Install .NET
+ # uses: actions/setup-dotnet@v1
+ # with:
+ # dotnet-version: '3.1.x'
+
+ # Run open source static analysis tools
+ - name: Run OSSAR
+ uses: github/ossar-action@v1
+ id: ossar
+
+ # Upload results to the Security tab
+ - name: Upload OSSAR results
+ uses: github/codeql-action/upload-sarif@v3
+ with:
+ sarif_file: ${{ steps.ossar.outputs.sarifFile }}
diff --git a/.github/workflows/pkg-size-report.yml b/.github/workflows/pkg-size-report.yml
new file mode 100644
index 0000000000..e209961f33
--- /dev/null
+++ b/.github/workflows/pkg-size-report.yml
@@ -0,0 +1,37 @@
+name: Package size report
+
+on:
+ pull_request:
+ branches: [main, next]
+
+permissions:
+ pull-requests: write
+
+jobs:
+ pkg-size-report:
+ name: Package size report
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ cache: 'pnpm'
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Package size report
+ uses: pkg-size/action@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ hide-files: '*.{js,css}.map'
+ display-size: uncompressed, gzip
diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml
new file mode 100644
index 0000000000..d62419f979
--- /dev/null
+++ b/.github/workflows/website.yml
@@ -0,0 +1,66 @@
+name: Website
+
+on:
+ push:
+ branches:
+ - main
+ - renovate/**
+ pull_request:
+
+permissions: {}
+
+jobs:
+ website:
+ name: Test
+ if: "github.ref != 'refs/heads/main' && !startsWith(github.head_ref, 'renovate/')"
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ cache: 'pnpm'
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Build website
+ run: pnpm run --sequential '/website:.*/'
+
+ deploy:
+ name: Deploy
+ if: github.ref == 'refs/heads/main'
+ runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 'lts/*'
+ cache: 'pnpm'
+
+ - name: Install dependencies
+ run: pnpm install --frozen-lockfile
+
+ - name: Build
+ run: pnpm run --sequential '/website:.*/'
+
+ - name: Deploy
+ uses: JamesIves/github-pages-deploy-action@v4
+ with:
+ branch: gh-pages
+ folder: examples/dist
diff --git a/.gitignore b/.gitignore
index b3827e69a0..ae3adbfdc5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
-.idea
-*.iml
build/
+coverage/
+examples/dist/
node_modules/
npm-debug.log
lib/
+esm/
diff --git a/.gitpod.yml b/.gitpod.yml
new file mode 100644
index 0000000000..c9fa969d57
--- /dev/null
+++ b/.gitpod.yml
@@ -0,0 +1,8 @@
+
+tasks:
+ - init: pnpm install && pnpm run build
+
+vscode:
+ extensions:
+ - esbenp.prettier-vscode
+ - dbaeumer.vscode-eslint
diff --git a/.prettierrc b/.prettierrc
new file mode 100644
index 0000000000..b418c8e60a
--- /dev/null
+++ b/.prettierrc
@@ -0,0 +1,11 @@
+{
+ "arrowParens": "always",
+ "bracketSpacing": true,
+ "bracketSameLine": false,
+ "printWidth": 80,
+ "semi": true,
+ "singleQuote": true,
+ "tabWidth": 2,
+ "trailingComma": "all",
+ "useTabs": false
+ }
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index f36c70fe36..0000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-sudo: false
-language: node_js
-node_js:
- - "4"
- - "5"
- - stable
-script:
- - npm run lint
- - npm test
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000000..6917d94dd8
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,14 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Attach to Process",
+ "type": "node",
+ "request": "attach",
+ "port": 9229
+ }
+ ]
+}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index 2d3cb5fa4c..0000000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,80 +0,0 @@
-v0.5.4 - Fri, 10 Jun 2016 08:48:45 GMT
---------------------------------------
-
-- [5101f96](../../commit/5101f96) [fixed] Update to support react 15 #94
-
-
-v0.5.3 - Mon, 01 Feb 2016 16:09:12 GMT
---------------------------------------
-
-- [baaa587](../../commit/baaa587) [fixed] use correct spelling of aria-labelledby #67
-
-
-v0.5.2 - Fri, 29 Jan 2016 19:45:48 GMT
---------------------------------------
-
-- [c432a08](../../commit/c432a08) [fixed] Server Side Rendering won't work with default styles #45
-
-
-v0.5.1 - Thu, 22 Oct 2015 22:38:49 GMT
---------------------------------------
-
-- [53c7ccb](../../commit/53c7ccb) [fixed] Removing ReactDOM from bundle
-
-
-v0.5.0 - Thu, 22 Oct 2015 05:36:48 GMT
---------------------------------------
-
-- [e05a9ec](../../commit/e05a9ec) [fixed] Issue when conditionally rendering Tab/TabPanel closes #37
-
-
-v0.4.1 - Wed, 09 Sep 2015 19:18:50 GMT
---------------------------------------
-
--
-
-
-v0.4.0 - Tue, 18 Aug 2015 22:53:59 GMT
---------------------------------------
-
--
-
-
-v0.3.0 - Tue, 11 Aug 2015 00:42:23 GMT
---------------------------------------
-
-- [0eb43e5](../../commit/0eb43e5) [added] Support for disabling tabs
-
-
-v0.2.1 - Fri, 26 Jun 2015 19:35:50 GMT
---------------------------------------
-
-- [5132966](../../commit/5132966) [added] Bower support closes #22
-- [3f43e89](../../commit/3f43e89) [fixed] Issue with React being included twice closes #23
-
-
-# Changelog
-
-### 0.1.0 (Jul 18, 2014)
-
-- Initial release
-
-### 0.1.1 (Jul 19, 2014)
-
-- Fixing warning: Invalid access to component property
-- Fixing style weirdness in Firefox
-
-### 0.1.2 (Jul 23, 2014)
-
-- Making Tab and TabPanel to be stateless
-- Throwing Error when Tab count and TabPanel count aren't equal
-
-### 0.2.0 (Jun 07, 2015)
-
-- Allowing children of Tab to select Tab ([#9](https://github.com/rackt/react-tabs/pull/9))
-- Only render the selected TabPanel
-- Upgrading to React 0.13
-- Removing JSX
-- Fixing issue with focus management ([#7](https://github.com/rackt/react-tabs/pull/7))
-- Fixing issue caused by no children being provided ([#6](https://github.com/rackt/react-tabs/issues/6))
-- Fixing issue that made dynamic Tabs difficult
diff --git a/LICENSE b/LICENSE
index aa0e0036f1..50769ac6b9 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2015 by Matt Zabriskie
+Copyright (c) Matt Zabriskie and Daniel Tschinder
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 1a9eb1a353..4f9a3b53ec 100644
--- a/README.md
+++ b/README.md
@@ -1,106 +1,372 @@
-# react-tabs [](https://travis-ci.org/reactjs/react-tabs)
+# react-tabs [](https://www.npmjs.com/package/react-tabs) [](https://coveralls.io/github/reactjs/react-tabs?branch=main)
-React tabs component
+An accessible and easy tab component for ReactJS.
+
+https://reactcommunity.org/react-tabs/
+
+> Version 5 or newer of `react-tabs` needs react version 18 or newer
+>
+> Version 4 of `react-tabs` needs react version 16.8 or newer
+
+
react-tabs was tested on real mobile devices and browsers with
+
+
+
## Installing
```bash
-$ npm install react-tabs
+yarn add react-tabs
```
-## Demo
+or
-https://reactcommunity.org/react-tabs/example/
+```bash
+npm install --save react-tabs
+```
-## Example
+## Basic Example
```js
-var React = require('react');
-var ReactDOM = require('react-dom');
-var ReactTabs = require('react-tabs');
-var Tab = ReactTabs.Tab;
-var Tabs = ReactTabs.Tabs;
-var TabList = ReactTabs.TabList;
-var TabPanel = ReactTabs.TabPanel;
-
-var App = React.createClass({
- handleSelect: function (index, last) {
- console.log('Selected tab: ' + index + ', Last tab: ' + last);
- },
-
- render: function () {
- return (
- {/*
- is a composite component and acts as the main container.
-
- `onSelect` is called whenever a tab is selected. The handler for
- this function will be passed the current index as well as the last index.
-
- `selectedIndex` is the tab to select when first rendered. By default
- the first (index 0) tab will be selected.
-
- `forceRenderTabPanel` By default this react-tabs will only render the selected
- tab's contents. Setting `forceRenderTabPanel` to `true` allows you to override the
- default behavior, which may be useful in some circumstances (such as animating between tabs).
-
- */}
-
-
-
- {/*
- is a composit component and is the container for the s.
- */}
-
-
-
- {/*
- is the actual tab component that users will interact with.
-
- Selecting a tab can be done by either clicking with the mouse,
- or by using the keyboard tab to give focus then navigating with
- the arrow keys (right/down to select tab to the right of selected,
- left/up to select tab to the left of selected).
-
- The content of the (this.props.children) will be shown as the label.
- */}
-
- Foo
- Bar
- Baz
-
-
- {/*
- is the content for the tab.
-
- There should be an equal number of and components.
- and components are tied together by the order in
- which they appear. The first (index 0) will be associated with
- the of the same index. Running this example when
- `selectedIndex` is 0 the tab with the label "Foo" will be selected
- and the content shown will be "Hello from Foo".
-
- As with the content of will be shown as the content.
- */}
-
-
-
+
+
+);
+```
+
+## API
+
+## Components
+
+react-tabs consists of 4 components which all need to be used together.
+
+### <Tabs />
+
+If you specify additional props on the `` component they will be forwarded to the rendered `
`.
+
+#### className: `string | Array | { [string]: boolean }`
+
+> default: `"react-tabs"`
+
+Provide a custom class name for the outer `` of the tabs.
+
+> You can also supply an array of class names or an object where the class names are the key and the value is a boolean indicating if the name should be added. See the docs of [classnames](https://github.com/JedWatson/classnames#usage) on how to supply different class names.
+
+#### defaultFocus: `boolean`
+
+> default: `false`
+
+If set to `true` the tabs will be focused on initial render. This allows immediate use of keyboard keys to switch tabs after the first render.
+
+#### defaultIndex: `number`
+
+> default: `0`
+
+This allows changing the tab that should be open on initial render. This is a zero-based index, so first tab is `0`, second tab is `1`, ...
+
+> This can only be used in uncontrolled mode when react-tabs handles the current selected tab internally and for this reason cannot be used together with `selectedIndex`. See [here](#controlled-vs-uncontrolled-mode) for more info on modes.
+
+#### direction: `string`
+
+> default: `"ltr"`
+
+Provide the direction of the component, can be either rtl or ltr.
+
+#### disabledTabClassName: `string`
+
+> default: `"react-tabs__tab--disabled"`
+
+Provide a custom class name for disabled tabs.
+
+> This option can also be set directly at the `` component.
+
+#### disableUpDownKeys: `bool`
+
+> default: `false`
+
+Disable up & down arrow keys to change tabs.
+
+#### domRef: `(node: ?HTMLElement) => void`
+
+> default: `null`
+
+Register a callback that will receive the underlying DOM node for every mount. It will also receive null on unmount.
+
+#### environment: `Window`
+
+If you're rendering `react-tabs` within a different `window` context than the default one; for example, an iframe.
+
+#### focusTabOnClick: `boolean`
+
+> default: `true`
+
+By default the tab that is clicked will also be focused in the DOM. If set to `false` the tab will not be focused anymore.
+
+> Be aware that keyboard navigation will not work after click if set to false. Though one can still focus the tabs by pressing `tab` and then keyboard navigation will work.
+
+#### forceRenderTabPanel: `boolean`
+
+> default: `false`
+
+By default only the current active tab will be rendered to DOM. If set to `true` all tabs will be rendered to the DOM always.
+
+> This can also be enabled for each individual `` component with its prop `forceRender`.
+
+#### onSelect: `(index: number, lastIndex: number, event: Event) => ?boolean`
+
+> default: `undefined`
+
+This event handler is called every time a tab is about to change. It will be called with the `index` that it will be changed to, the `lastIndex` which was selected before and the underlying `event` which is usually either a `keydown` or `click` event. When `index` and `lastIndex` are equal it means the user clicked on the currently active tab.
+
+The callback can optionally return `false` to cancel the change to the new tab.
+
+> Returning `false` when the change to the new tab should be canceled is also important in controlled mode, as react-tabs still internally handles the focus of the tabs.
+
+> In controlled mode the `onSelect` handler is a required prop.
+
+#### selectedIndex: `number`
+
+> default: `null`
+
+Set the currently selected tab. This is a zero-based index, so first tab is `0`, second tab is `1`, ...
+
+This enables controlled mode, which also requires `onSelect` to be set. See [here](#controlled-vs-uncontrolled-mode) for more info on modes.
+
+#### selectedTabClassName: `string`
+
+> default: `"react-tabs__tab--selected"`
+
+Provide a custom class name for the active tab.
+
+> This option can also be set directly at the `` component.
+
+#### selectedTabPanelClassName: `string`
+
+> default: `"react-tabs__tab-panel--selected"`
+
+Provide a custom class name for the active tab panel.
+
+> This option can also be set directly at the `` component.
+
+### <TabList />
+
+If you specify additional props on the `` component they will be forwarded to the rendered `
`.
+
+#### className: `string | Array | { [string]: boolean }`
+
+> default: `"react-tabs__tab-list"`
+
+Provide a custom class name for the `
`.
+
+> You can also supply an array of class names or an object where the class names are the key and the value is a boolean indicating if the name should be added. See the docs of [classnames](https://github.com/JedWatson/classnames#usage) on how to supply different class names.
+
+### <Tab />
+
+If you specify additional props on the `` component they will be forwarded to the rendered ``.
+
+#### className: `string | Array | { [string]: boolean }`
+
+> default: `"react-tabs__tab"`
+
+Provide a custom class name for the ``.
+
+> You can also supply an array of class names or an object where the class names are the key and the value is a boolean indicating if the name should be added. See the docs of [classnames](https://github.com/JedWatson/classnames#usage) on how to supply different class names.
+
+#### disabled: `boolean`
+
+> default: `false`
+
+Disable this tab which will make it not do anything when clicked. Also a disabled class name will be added (see `disabledClassName`)
+
+#### disabledClassName: `string`
+
+> default: `"react-tabs__tab--disabled"`
+
+Provide a custom class name for disabled tabs.
+
+> This option can also be set for all `` components with the prop `disabledTabClassName` on ``.
+
+#### selectedClassName: `string`
+
+> default: `"react-tabs__tab--selected"`
+
+Provide a custom class name for the active tab.
+
+> This option can also be set for all `` components with the prop `selectedTabClassName` on ``.
+
+#### tabIndex: `string`
+
+> default: if selected `"0"` otherwise `null`
+
+Overrides the tabIndex to enabled tabbing between tabs.
+
+### <TabPanel />
+
+If you specify additional props on the `` component they will be forwarded to the rendered ``.
+
+#### className: `string | Array | { [string]: boolean }`
+
+> default: `"react-tabs__tab-panel"`
+
+Provide a custom class name for the `` containing the tab content.
+
+> You can also supply an array of class names or an object where the class names are the key and the value is a boolean indicating if the name should be added. See the docs of [classnames](https://github.com/JedWatson/classnames#usage) on how to supply different class names.
+
+#### forceRender: `boolean`
+
+> default: `false`
+
+By default the tab content will only be rendered when the tab is active. If set to `true` the tab will also be rendered if inactive.
+
+> This can also be enabled for all `` components with the prop `forceRenderTabPanel` on ``.
+
+#### selectedClassName: `string`
+
+> default: `"react-tabs__tab-panel--selected"`
+
+Provide a custom class name for the active tab panel.
+
+> This option can also be set for all `` components with the prop `selectedTabPanelClassName` on ``.
+
+## Controlled vs Uncontrolled mode
+
+React tabs has two different modes it can operate in, which change the way how much you need to take care about the state yourself.
+
+### Uncontrolled mode
+
+This is the default mode of react-tabs and makes the react-tabs components handle its state internally. You can change the starting tab with `defaultIndex` and you can listen for changes with `onSelect`.
+
+In this mode you cannot force a tab change during runtime.
+
+```js
+ console.log(index)}>
+
+ Title 1
+ Title 2
+
+
+
+
+```
+
+### Controlled mode
+
+This mode has to be enabled by supplying `selectedIndex` to the `` component.
+
+In this mode react-tabs does not handle any tab selection state internally and leaves all the state management up to the outer application.
+
+This mode also enforces you to set a handler for `onSelect`. `defaultIndex` does not have any effect and will therefore throw an error.
+
+```js
+const App = () => {
+ const [tabIndex, setTabIndex] = useState(0);
+
+ return (
+ setTabIndex(index)}>
+
+ Title 1
+ Title 2
+
+
+
+
+ );
+};
+```
+
+## Styling
+
+react-tabs does not include any style loading by default. Default stylesheets are provided and can be included in your application if desired.
+
+### Webpack
+
+When using webpack and an appropriate loader (`css-loader`, `sass-loader`, `less-loader` or `style-loader`) you can simply import the default stylesheet.
+
+```js
+import 'react-tabs/style/react-tabs.css';
+// or
+import 'react-tabs/style/react-tabs.scss';
+// or
+import 'react-tabs/style/react-tabs.less';
+```
+
+### SASS
+
+When using SASS you can easily import the default styles
+
+```scss
+@import 'http://github.com/path/to/node_modules/react-tabs/style/react-tabs.scss';
+```
+
+### LESS
+
+When using LESS you can easily import the default styles
+
+```scss
+@import 'http://github.com/path/to/node_modules/react-tabs/style/react-tabs.less';
+```
+
+### Custom Style
+
+You can also always just simply copy the default style to your own css/scss/less and modify it to your own needs. The changelog will always tell you when classes change and we also consider changes that break the styling as semver major.
+
+### Custom Components
+
+#### Set `tabsRole`
+
+In case you want to create your own component wrapping the ones that the library provides, you have to set its `tabsRole`. This value is used inside react-tabs to check the role of a component inside ``.
+
+Possible values for tabsRole are:
+
+- Tab
+- TabPanel
+- TabList
+- Tabs
+
+#### Pass through properties
+
+Note: Because of how react-tabs works internally (it uses cloning to opaquely control various parts of the tab state), you need to pass any incoming props to the component you're wrapping. The easiest way to do this is to use the rest and spread operators, e.g. see `{...otherProps}` below.
+
+```tsx
+import { Tabs, TabList, Tab, TabPanel } from 'react-tabs';
+import type { ReactTabsFunctionComponent, TabProps } from 'react-tabs';
+
+// All custom elements should pass through other props
+const CustomTab: ReactTabsFunctionComponent = ({
+ children,
+ ...otherProps
+}) => (
+
+
{children}
+
+);
+
+CustomTab.tabsRole = 'Tab'; // Required field to use your custom Tab
+const App = () => (
+
+
+ Custom Tab 1
+ Custom Tab 2
+
+ Panel 1
+ Panel 2
+
+);
```
## License
diff --git a/bower.json b/bower.json
deleted file mode 100644
index 745b94c51c..0000000000
--- a/bower.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- "name": "react-tabs",
- "version": "0.5.3",
- "homepage": "https://github.com/rackt/react-tabs",
- "authors": [
- "Matt Zabriskie"
- ],
- "description": "React tabs component",
- "main": "./dist/react-tabs.js",
- "keywords": [
- "react",
- "tabs"
- ],
- "license": "MIT",
- "ignore": [
- "**/.*",
- "build",
- "examples",
- "lib",
- "src",
- "node_modules",
- "specs",
- "package.json",
- "webpack.*"
- ]
-}
diff --git a/codecov.yml b/codecov.yml
new file mode 100644
index 0000000000..3e31ee1814
--- /dev/null
+++ b/codecov.yml
@@ -0,0 +1,4 @@
+coverage:
+ parsers:
+ javascript:
+ enable_partials: yes
diff --git a/dist/react-tabs.js b/dist/react-tabs.js
deleted file mode 100644
index ae97cb8041..0000000000
--- a/dist/react-tabs.js
+++ /dev/null
@@ -1,980 +0,0 @@
-(function webpackUniversalModuleDefinition(root, factory) {
- if(typeof exports === 'object' && typeof module === 'object')
- module.exports = factory(require("React"), require("ReactDOM"));
- else if(typeof define === 'function' && define.amd)
- define(["React", "ReactDOM"], factory);
- else if(typeof exports === 'object')
- exports["ReactTabs"] = factory(require("React"), require("ReactDOM"));
- else
- root["ReactTabs"] = factory(root["React"], root["ReactDOM"]);
-})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) {
-return /******/ (function(modules) { // webpackBootstrap
-/******/ // The module cache
-/******/ var installedModules = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/
-/******/ // Check if module is in cache
-/******/ if(installedModules[moduleId])
-/******/ return installedModules[moduleId].exports;
-/******/
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = installedModules[moduleId] = {
-/******/ exports: {},
-/******/ id: moduleId,
-/******/ loaded: false
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ // Flag the module as loaded
-/******/ module.loaded = true;
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = modules;
-/******/
-/******/ // expose the module cache
-/******/ __webpack_require__.c = installedModules;
-/******/
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "";
-/******/
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(0);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.TabPanel = exports.Tab = exports.TabList = exports.Tabs = undefined;
-
- var _Tabs = __webpack_require__(1);
-
- var _Tabs2 = _interopRequireDefault(_Tabs);
-
- var _TabList = __webpack_require__(9);
-
- var _TabList2 = _interopRequireDefault(_TabList);
-
- var _Tab = __webpack_require__(8);
-
- var _Tab2 = _interopRequireDefault(_Tab);
-
- var _TabPanel = __webpack_require__(11);
-
- var _TabPanel2 = _interopRequireDefault(_TabPanel);
-
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
-
- exports.Tabs =
-
- // For bc we also export a default object, remove in 1.0
- _Tabs2.default;
- exports.TabList = _TabList2.default;
- exports.Tab = _Tab2.default;
- exports.TabPanel = _TabPanel2.default;
- exports.default = {
- Tabs: _Tabs2.default,
- TabList: _TabList2.default,
- Tab: _Tab2.default,
- TabPanel: _TabPanel2.default
- };
-
-/***/ },
-/* 1 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }return target;
- };
-
- var _react = __webpack_require__(2);
-
- var _react2 = _interopRequireDefault(_react);
-
- var _reactDom = __webpack_require__(3);
-
- var _classnames = __webpack_require__(4);
-
- var _classnames2 = _interopRequireDefault(_classnames);
-
- var _jsStylesheet = __webpack_require__(5);
-
- var _jsStylesheet2 = _interopRequireDefault(_jsStylesheet);
-
- var _uuid = __webpack_require__(6);
-
- var _uuid2 = _interopRequireDefault(_uuid);
-
- var _childrenPropType = __webpack_require__(7);
-
- var _childrenPropType2 = _interopRequireDefault(_childrenPropType);
-
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
-
- function _objectWithoutProperties(obj, keys) {
- var target = {};for (var i in obj) {
- if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i];
- }return target;
- }
-
- // Determine if a node from event.target is a Tab element
- function isTabNode(node) {
- return node.nodeName === 'LI' && node.getAttribute('role') === 'tab';
- }
-
- // Determine if a tab node is disabled
- function isTabDisabled(node) {
- return node.getAttribute('aria-disabled') === 'true';
- }
-
- var useDefaultStyles = true;
-
- module.exports = _react2.default.createClass({
- displayName: 'Tabs',
-
- propTypes: {
- className: _react.PropTypes.string,
- selectedIndex: _react.PropTypes.number,
- onSelect: _react.PropTypes.func,
- focus: _react.PropTypes.bool,
- children: _childrenPropType2.default,
- forceRenderTabPanel: _react.PropTypes.bool
- },
-
- childContextTypes: {
- forceRenderTabPanel: _react.PropTypes.bool
- },
-
- statics: {
- setUseDefaultStyles: function setUseDefaultStyles(use) {
- useDefaultStyles = use;
- }
- },
-
- getDefaultProps: function getDefaultProps() {
- return {
- selectedIndex: -1,
- focus: false,
- forceRenderTabPanel: false
- };
- },
- getInitialState: function getInitialState() {
- return this.copyPropsToState(this.props);
- },
- getChildContext: function getChildContext() {
- return {
- forceRenderTabPanel: this.props.forceRenderTabPanel
- };
- },
- componentDidMount: function componentDidMount() {
- if (useDefaultStyles) {
- (0, _jsStylesheet2.default)(__webpack_require__(10)); // eslint-disable-line global-require
- }
- },
- componentWillReceiveProps: function componentWillReceiveProps(newProps) {
- this.setState(this.copyPropsToState(newProps));
- },
- setSelected: function setSelected(index, focus) {
- // Don't do anything if nothing has changed
- if (index === this.state.selectedIndex) return;
- // Check index boundary
- if (index < 0 || index >= this.getTabsCount()) return;
-
- // Keep reference to last index for event handler
- var last = this.state.selectedIndex;
-
- // Update selected index
- this.setState({ selectedIndex: index, focus: focus === true });
-
- // Call change event handler
- if (typeof this.props.onSelect === 'function') {
- this.props.onSelect(index, last);
- }
- },
- getNextTab: function getNextTab(index) {
- var count = this.getTabsCount();
-
- // Look for non-disabled tab from index to the last tab on the right
- for (var i = index + 1; i < count; i++) {
- var tab = this.getTab(i);
- if (!isTabDisabled((0, _reactDom.findDOMNode)(tab))) {
- return i;
- }
- }
-
- // If no tab found, continue searching from first on left to index
- for (var _i = 0; _i < index; _i++) {
- var _tab = this.getTab(_i);
- if (!isTabDisabled((0, _reactDom.findDOMNode)(_tab))) {
- return _i;
- }
- }
-
- // No tabs are disabled, return index
- return index;
- },
- getPrevTab: function getPrevTab(index) {
- var i = index;
-
- // Look for non-disabled tab from index to first tab on the left
- while (i--) {
- var tab = this.getTab(i);
- if (!isTabDisabled((0, _reactDom.findDOMNode)(tab))) {
- return i;
- }
- }
-
- // If no tab found, continue searching from last tab on right to index
- i = this.getTabsCount();
- while (i-- > index) {
- var _tab2 = this.getTab(i);
- if (!isTabDisabled((0, _reactDom.findDOMNode)(_tab2))) {
- return i;
- }
- }
-
- // No tabs are disabled, return index
- return index;
- },
- getTabsCount: function getTabsCount() {
- return this.props.children && this.props.children[0] ? _react2.default.Children.count(this.props.children[0].props.children) : 0;
- },
- getPanelsCount: function getPanelsCount() {
- return _react2.default.Children.count(this.props.children.slice(1));
- },
- getTabList: function getTabList() {
- return this.refs.tablist;
- },
- getTab: function getTab(index) {
- return this.refs['tabs-' + index];
- },
- getPanel: function getPanel(index) {
- return this.refs['panels-' + index];
- },
- getChildren: function getChildren() {
- var index = 0;
- var count = 0;
- var children = this.props.children;
- var state = this.state;
- var tabIds = this.tabIds = this.tabIds || [];
- var panelIds = this.panelIds = this.panelIds || [];
- var diff = this.tabIds.length - this.getTabsCount();
-
- // Add ids if new tabs have been added
- // Don't bother removing ids, just keep them in case they are added again
- // This is more efficient, and keeps the uuid counter under control
- while (diff++ < 0) {
- tabIds.push((0, _uuid2.default)());
- panelIds.push((0, _uuid2.default)());
- }
-
- // Map children to dynamically setup refs
- return _react2.default.Children.map(children, function (child) {
- // null happens when conditionally rendering TabPanel/Tab
- // see https://github.com/rackt/react-tabs/issues/37
- if (child === null) {
- return null;
- }
-
- var result = null;
-
- // Clone TabList and Tab components to have refs
- if (count++ === 0) {
- // TODO try setting the uuid in the "constructor" for `Tab`/`TabPanel`
- result = (0, _react.cloneElement)(child, {
- ref: 'tablist',
- children: _react2.default.Children.map(child.props.children, function (tab) {
- // null happens when conditionally rendering TabPanel/Tab
- // see https://github.com/rackt/react-tabs/issues/37
- if (tab === null) {
- return null;
- }
-
- var ref = 'tabs-' + index;
- var id = tabIds[index];
- var panelId = panelIds[index];
- var selected = state.selectedIndex === index;
- var focus = selected && state.focus;
-
- index++;
-
- return (0, _react.cloneElement)(tab, {
- ref: ref,
- id: id,
- panelId: panelId,
- selected: selected,
- focus: focus
- });
- })
- });
-
- // Reset index for panels
- index = 0;
- }
- // Clone TabPanel components to have refs
- else {
- var ref = 'panels-' + index;
- var id = panelIds[index];
- var tabId = tabIds[index];
- var selected = state.selectedIndex === index;
-
- index++;
-
- result = (0, _react.cloneElement)(child, {
- ref: ref,
- id: id,
- tabId: tabId,
- selected: selected
- });
- }
-
- return result;
- });
- },
- handleKeyDown: function handleKeyDown(e) {
- if (this.isTabFromContainer(e.target)) {
- var index = this.state.selectedIndex;
- var preventDefault = false;
-
- // Select next tab to the left
- if (e.keyCode === 37 || e.keyCode === 38) {
- index = this.getPrevTab(index);
- preventDefault = true;
- }
- // Select next tab to the right
- /* eslint brace-style:0 */
- else if (e.keyCode === 39 || e.keyCode === 40) {
- index = this.getNextTab(index);
- preventDefault = true;
- }
-
- // This prevents scrollbars from moving around
- if (preventDefault) {
- e.preventDefault();
- }
-
- this.setSelected(index, true);
- }
- },
- handleClick: function handleClick(e) {
- var node = e.target;
- do {
- // eslint-disable-line no-cond-assign
- if (this.isTabFromContainer(node)) {
- if (isTabDisabled(node)) {
- return;
- }
-
- var index = [].slice.call(node.parentNode.children).indexOf(node);
- this.setSelected(index);
- return;
- }
- } while ((node = node.parentNode) !== null);
- },
-
- // This is an anti-pattern, so sue me
- copyPropsToState: function copyPropsToState(props) {
- var selectedIndex = props.selectedIndex;
-
- // If no selectedIndex prop was supplied, then try
- // preserving the existing selectedIndex from state.
- // If the state has not selectedIndex, default
- // to the first tab in the TabList.
- //
- // TODO: Need automation testing around this
- // Manual testing can be done using examples/focus
- // See 'should preserve selectedIndex when typing' in specs/Tabs.spec.js
- if (selectedIndex === -1) {
- if (this.state && this.state.selectedIndex) {
- selectedIndex = this.state.selectedIndex;
- } else {
- selectedIndex = 0;
- }
- }
-
- return {
- selectedIndex: selectedIndex,
- focus: props.focus
- };
- },
-
- /**
- * Determine if a node from event.target is a Tab element for the current Tabs container.
- * If the clicked element is not a Tab, it returns false.
- * If it finds another Tabs container between the Tab and `this`, it returns false.
- */
- isTabFromContainer: function isTabFromContainer(node) {
- // return immediately if the clicked element is not a Tab.
- if (!isTabNode(node)) {
- return false;
- }
-
- // Check if the first occurrence of a Tabs container is `this` one.
- var nodeAncestor = node.parentElement;
- var tabsNode = (0, _reactDom.findDOMNode)(this);
- do {
- if (nodeAncestor === tabsNode) return true;else if (nodeAncestor.getAttribute('data-tabs')) break;
-
- nodeAncestor = nodeAncestor.parentElement;
- } while (nodeAncestor);
-
- return false;
- },
- render: function render() {
- var _this = this;
-
- // This fixes an issue with focus management.
- //
- // Ultimately, when focus is true, and an input has focus,
- // and any change on that input causes a state change/re-render,
- // focus gets sent back to the active tab, and input loses focus.
- //
- // Since the focus state only needs to be remembered
- // for the current render, we can reset it once the
- // render has happened.
- //
- // Don't use setState, because we don't want to re-render.
- //
- // See https://github.com/rackt/react-tabs/pull/7
- if (this.state.focus) {
- setTimeout(function () {
- _this.state.focus = false;
- }, 0);
- }
-
- var _props = this.props;
- var className = _props.className;
-
- var attributes = _objectWithoutProperties(_props, ['className']);
-
- // Delete all known props, so they don't get added to DOM
-
- delete attributes.selectedIndex;
- delete attributes.onSelect;
- delete attributes.focus;
- delete attributes.children;
- delete attributes.forceRenderTabPanel;
- delete attributes.onClick;
- delete attributes.onKeyDown;
-
- return _react2.default.createElement('div', _extends({}, attributes, {
- className: (0, _classnames2.default)('ReactTabs', 'react-tabs', className),
- onClick: this.handleClick,
- onKeyDown: this.handleKeyDown,
- 'data-tabs': true
- }), this.getChildren());
- }
- });
-
-/***/ },
-/* 2 */
-/***/ function(module, exports) {
-
- module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
-
-/***/ },
-/* 3 */
-/***/ function(module, exports) {
-
- module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
-
-/***/ },
-/* 4 */
-/***/ function(module, exports, __webpack_require__) {
-
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
- Copyright (c) 2016 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
- */
- /* global define */
-
- (function () {
- 'use strict';
-
- var hasOwn = {}.hasOwnProperty;
-
- function classNames () {
- var classes = [];
-
- for (var i = 0; i < arguments.length; i++) {
- var arg = arguments[i];
- if (!arg) continue;
-
- var argType = typeof arg;
-
- if (argType === 'string' || argType === 'number') {
- classes.push(arg);
- } else if (Array.isArray(arg)) {
- classes.push(classNames.apply(null, arg));
- } else if (argType === 'object') {
- for (var key in arg) {
- if (hasOwn.call(arg, key) && arg[key]) {
- classes.push(key);
- }
- }
- }
- }
-
- return classes.join(' ');
- }
-
- if (typeof module !== 'undefined' && module.exports) {
- module.exports = classNames;
- } else if (true) {
- // register as 'classnames', consistent with npm package name
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
- return classNames;
- }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
- } else {
- window.classNames = classNames;
- }
- }());
-
-
-/***/ },
-/* 5 */
-/***/ function(module, exports, __webpack_require__) {
-
- !(function() {
- function jss(blocks) {
- var css = [];
- for (var block in blocks)
- css.push(createStyleBlock(block, blocks[block]));
- injectCSS(css);
- }
-
- function createStyleBlock(selector, rules) {
- return selector + ' {\n' + parseRules(rules) + '\n}';
- }
-
- function parseRules(rules) {
- var css = [];
- for (var rule in rules)
- css.push(' '+rule+': '+rules[rule]+';');
- return css.join('\n');
- }
-
- function injectCSS(css) {
- var style = document.getElementById('jss-styles');
- if (!style) {
- style = document.createElement('style');
- style.setAttribute('id', 'jss-styles');
- var head = document.getElementsByTagName('head')[0];
- head.insertBefore(style, head.firstChild);
- }
- var node = document.createTextNode(css.join('\n\n'));
- style.appendChild(node);
- }
-
- if (true)
- module.exports = jss;
- else
- window.jss = jss;
-
- })();
-
-
-
-/***/ },
-/* 6 */
-/***/ function(module, exports) {
-
- "use strict";
-
- // Get a universally unique identifier
-
- var count = 0;
- module.exports = function uuid() {
- return "react-tabs-" + count++;
- };
-
-/***/ },
-/* 7 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _react = __webpack_require__(2);
-
- var _react2 = _interopRequireDefault(_react);
-
- var _Tab = __webpack_require__(8);
-
- var _Tab2 = _interopRequireDefault(_Tab);
-
- var _TabList = __webpack_require__(9);
-
- var _TabList2 = _interopRequireDefault(_TabList);
-
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
-
- module.exports = function childrenPropTypes(props, propName) {
- var error = void 0;
- var tabsCount = 0;
- var panelsCount = 0;
- var children = props[propName];
-
- _react2.default.Children.forEach(children, function (child) {
- // null happens when conditionally rendering TabPanel/Tab
- // see https://github.com/rackt/react-tabs/issues/37
- if (child === null) {
- return;
- }
-
- if (child.type === _TabList2.default) {
- _react2.default.Children.forEach(child.props.children, function (c) {
- // null happens when conditionally rendering TabPanel/Tab
- // see https://github.com/rackt/react-tabs/issues/37
- if (c === null) {
- return;
- }
-
- if (c.type === _Tab2.default) {
- tabsCount++;
- } else {
- error = new Error('Expected \'Tab\' but found \'' + (c.type.displayName || c.type) + '\'');
- }
- });
- } else if (child.type.displayName === 'TabPanel') {
- panelsCount++;
- } else {
- error = new Error('Expected \'TabList\' or \'TabPanel\' but found \'' + (child.type.displayName || child.type) + '\'');
- }
- });
-
- if (tabsCount !== panelsCount) {
- error = new Error("There should be an equal number of 'Tabs' and 'TabPanels'." + ('Received ' + tabsCount + ' \'Tabs\' and ' + panelsCount + ' \'TabPanels\'.'));
- }
-
- return error;
- };
-
-/***/ },
-/* 8 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }return target;
- };
-
- var _react = __webpack_require__(2);
-
- var _react2 = _interopRequireDefault(_react);
-
- var _reactDom = __webpack_require__(3);
-
- var _classnames = __webpack_require__(4);
-
- var _classnames2 = _interopRequireDefault(_classnames);
-
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
-
- function _objectWithoutProperties(obj, keys) {
- var target = {};for (var i in obj) {
- if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i];
- }return target;
- }
-
- function syncNodeAttributes(node, props) {
- if (props.selected) {
- node.setAttribute('tabindex', '0');
- node.setAttribute('selected', 'selected');
- if (props.focus) {
- node.focus();
- }
- } else {
- node.removeAttribute('tabindex');
- node.removeAttribute('selected');
- }
- }
-
- module.exports = _react2.default.createClass({
- displayName: 'Tab',
-
- propTypes: {
- className: _react.PropTypes.string,
- id: _react.PropTypes.string,
- selected: _react.PropTypes.bool,
- disabled: _react.PropTypes.bool,
- panelId: _react.PropTypes.string,
- children: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object, _react.PropTypes.string])
- },
-
- getDefaultProps: function getDefaultProps() {
- return {
- focus: false,
- selected: false,
- id: null,
- panelId: null
- };
- },
- componentDidMount: function componentDidMount() {
- syncNodeAttributes((0, _reactDom.findDOMNode)(this), this.props);
- },
- componentDidUpdate: function componentDidUpdate() {
- syncNodeAttributes((0, _reactDom.findDOMNode)(this), this.props);
- },
- render: function render() {
- var _props = this.props;
- var selected = _props.selected;
- var disabled = _props.disabled;
- var panelId = _props.panelId;
- var className = _props.className;
- var children = _props.children;
- var id = _props.id;
-
- var attributes = _objectWithoutProperties(_props, ['selected', 'disabled', 'panelId', 'className', 'children', 'id']);
-
- return _react2.default.createElement('li', _extends({}, attributes, {
- className: (0, _classnames2.default)('ReactTabs__Tab', className, {
- 'ReactTabs__Tab--selected': selected,
- 'ReactTabs__Tab--disabled': disabled
- }),
- role: 'tab',
- id: id,
- 'aria-selected': selected ? 'true' : 'false',
- 'aria-expanded': selected ? 'true' : 'false',
- 'aria-disabled': disabled ? 'true' : 'false',
- 'aria-controls': panelId
- }), children);
- }
- });
-
-/***/ },
-/* 9 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }return target;
- };
-
- var _react = __webpack_require__(2);
-
- var _react2 = _interopRequireDefault(_react);
-
- var _classnames = __webpack_require__(4);
-
- var _classnames2 = _interopRequireDefault(_classnames);
-
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
-
- function _objectWithoutProperties(obj, keys) {
- var target = {};for (var i in obj) {
- if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i];
- }return target;
- }
-
- module.exports = _react2.default.createClass({
- displayName: 'TabList',
-
- propTypes: {
- className: _react.PropTypes.string,
- children: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.array])
- },
-
- render: function render() {
- var _props = this.props;
- var className = _props.className;
- var children = _props.children;
-
- var attributes = _objectWithoutProperties(_props, ['className', 'children']);
-
- return _react2.default.createElement('ul', _extends({}, attributes, {
- className: (0, _classnames2.default)('ReactTabs__TabList', className),
- role: 'tablist'
- }), children);
- }
- });
-
-/***/ },
-/* 10 */
-/***/ function(module, exports) {
-
- 'use strict';
-
- module.exports = {
- '.react-tabs [role=tablist]': {
- 'border-bottom': '1px solid #aaa',
- margin: '0 0 10px',
- padding: '0'
- },
-
- '.react-tabs [role=tab]': {
- display: 'inline-block',
- border: '1px solid transparent',
- 'border-bottom': 'none',
- bottom: '-1px',
- position: 'relative',
- 'list-style': 'none',
- padding: '6px 12px',
- cursor: 'pointer'
- },
-
- '.react-tabs [role=tab][aria-selected=true]': {
- background: '#fff',
- 'border-color': '#aaa',
- color: 'black',
- 'border-radius': '5px 5px 0 0',
- '-moz-border-radius': '5px 5px 0 0',
- '-webkit-border-radius': '5px 5px 0 0'
- },
-
- '.react-tabs [role=tab][aria-disabled=true]': {
- color: 'GrayText',
- cursor: 'default'
- },
-
- '.react-tabs [role=tab]:focus': {
- 'box-shadow': '0 0 5px hsl(208, 99%, 50%)',
- 'border-color': 'hsl(208, 99%, 50%)',
- outline: 'none'
- },
-
- '.react-tabs [role=tab]:focus:after': {
- content: '""',
- position: 'absolute',
- height: '5px',
- left: '-4px',
- right: '-4px',
- bottom: '-5px',
- background: '#fff'
- }
- };
-
-/***/ },
-/* 11 */
-/***/ function(module, exports, __webpack_require__) {
-
- 'use strict';
-
- var _extends = Object.assign || function (target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = arguments[i];for (var key in source) {
- if (Object.prototype.hasOwnProperty.call(source, key)) {
- target[key] = source[key];
- }
- }
- }return target;
- };
-
- var _react = __webpack_require__(2);
-
- var _react2 = _interopRequireDefault(_react);
-
- var _classnames = __webpack_require__(4);
-
- var _classnames2 = _interopRequireDefault(_classnames);
-
- function _interopRequireDefault(obj) {
- return obj && obj.__esModule ? obj : { default: obj };
- }
-
- function _objectWithoutProperties(obj, keys) {
- var target = {};for (var i in obj) {
- if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i];
- }return target;
- }
-
- module.exports = _react2.default.createClass({
- displayName: 'TabPanel',
-
- propTypes: {
- className: _react.PropTypes.string,
- selected: _react.PropTypes.bool,
- id: _react.PropTypes.string,
- tabId: _react.PropTypes.string,
- children: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object, _react.PropTypes.string])
- },
-
- contextTypes: {
- forceRenderTabPanel: _react.PropTypes.bool
- },
-
- getDefaultProps: function getDefaultProps() {
- return {
- selected: false,
- id: null,
- tabId: null
- };
- },
- render: function render() {
- var _props = this.props;
- var className = _props.className;
- var children = _props.children;
- var selected = _props.selected;
- var id = _props.id;
- var tabId = _props.tabId;
-
- var attributes = _objectWithoutProperties(_props, ['className', 'children', 'selected', 'id', 'tabId']);
-
- // Merge style
-
- var style = _extends({}, attributes.style, { display: selected ? null : 'none' });
- delete attributes.style;
-
- return _react2.default.createElement('div', _extends({}, attributes, {
- className: (0, _classnames2.default)('ReactTabs__TabPanel', className, {
- 'ReactTabs__TabPanel--selected': selected
- }),
- role: 'tabpanel',
- id: id,
- 'aria-labelledby': tabId,
- style: style
- }), this.context.forceRenderTabPanel || selected ? children : null);
- }
- });
-
-/***/ }
-/******/ ])
-});
-;
-//# sourceMappingURL=react-tabs.js.map
\ No newline at end of file
diff --git a/dist/react-tabs.js.map b/dist/react-tabs.js.map
deleted file mode 100644
index 44e227663a..0000000000
--- a/dist/react-tabs.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap 7b362e42f859525ab4b5","webpack:///./lib/main.js","webpack:///./lib/components/Tabs.js","webpack:///external \"React\"","webpack:///external \"ReactDOM\"","webpack:///./~/classnames/index.js","webpack:///./~/js-stylesheet/jss.js","webpack:///./lib/helpers/uuid.js","webpack:///./lib/helpers/childrenPropType.js","webpack:///./lib/components/Tab.js","webpack:///./lib/components/TabList.js","webpack:///./lib/helpers/styles.js","webpack:///./lib/components/TabPanel.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACtCA;;AAEA,QAAO,cAAP,CAAsB,OAAtB,EAA+B,YAA/B,EAA6C;AAC3C,UAAO;AADoC,EAA7C;AAGA,SAAQ,QAAR,GAAmB,QAAQ,GAAR,GAAc,QAAQ,OAAR,GAAkB,QAAQ,IAAR,GAAe,SAAlE;;AAEA,KAAI,QAAQ,oBAAQ,CAAR,CAAZ;;AAEA,KAAI,SAAS,uBAAuB,KAAvB,CAAb;;AAEA,KAAI,WAAW,oBAAQ,CAAR,CAAf;;AAEA,KAAI,YAAY,uBAAuB,QAAvB,CAAhB;;AAEA,KAAI,OAAO,oBAAQ,CAAR,CAAX;;AAEA,KAAI,QAAQ,uBAAuB,IAAvB,CAAZ;;AAEA,KAAI,YAAY,oBAAQ,EAAR,CAAhB;;AAEA,KAAI,aAAa,uBAAuB,SAAvB,CAAjB;;AAEA,UAAS,sBAAT,CAAgC,GAAhC,EAAqC;AAAE,UAAO,OAAO,IAAI,UAAX,GAAwB,GAAxB,GAA8B,EAAE,SAAS,GAAX,EAArC;AAAwD;;AAE/F,SAAQ,IAAR;;;AAGA,QAAO,OAHP;AAIA,SAAQ,OAAR,GAAkB,UAAU,OAA5B;AACA,SAAQ,GAAR,GAAc,MAAM,OAApB;AACA,SAAQ,QAAR,GAAmB,WAAW,OAA9B;AACA,SAAQ,OAAR,GAAkB;AAChB,SAAM,OAAO,OADG;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kBAAW,CAAC,GAAG,aAAa,OAAjB,EAA0B,qBAA1B,EAAiD,SAAjD,EAA4D;AACrE,0CAAiC;AADoC,QAA5D,CADY;AAIvB,aAAM,UAJiB;AAKvB,WAAI,EALmB;AAMvB,0BAAmB,KANI;AAOvB,cAAO;AAPgB,MAAzB,CAFK,EAWL,KAAK,OAAL,CAAa,mBAAb,IAAoC,QAApC,GAA+C,QAA/C,GAA0D,IAXrD,CAAP;AAaD;AAnD0C,EAA5B,CAAjB,C","file":"/Users/danieltschinder/Documents/Github/react-tabs/dist/react-tabs.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"React\"), require(\"ReactDOM\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"React\", \"ReactDOM\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactTabs\"] = factory(require(\"React\"), require(\"ReactDOM\"));\n\telse\n\t\troot[\"ReactTabs\"] = factory(root[\"React\"], root[\"ReactDOM\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__) {\nreturn \n\n\n/** WEBPACK FOOTER **\n ** webpack/universalModuleDefinition\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap 7b362e42f859525ab4b5\n **/","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.TabPanel = exports.Tab = exports.TabList = exports.Tabs = undefined;\n\nvar _Tabs = require('./components/Tabs');\n\nvar _Tabs2 = _interopRequireDefault(_Tabs);\n\nvar _TabList = require('./components/TabList');\n\nvar _TabList2 = _interopRequireDefault(_TabList);\n\nvar _Tab = require('./components/Tab');\n\nvar _Tab2 = _interopRequireDefault(_Tab);\n\nvar _TabPanel = require('./components/TabPanel');\n\nvar _TabPanel2 = _interopRequireDefault(_TabPanel);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.Tabs =\n\n// For bc we also export a default object, remove in 1.0\n_Tabs2.default;\nexports.TabList = _TabList2.default;\nexports.Tab = _Tab2.default;\nexports.TabPanel = _TabPanel2.default;\nexports.default = {\n Tabs: _Tabs2.default,\n TabList: _TabList2.default,\n Tab: _Tab2.default,\n TabPanel: _TabPanel2.default\n};\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require('react-dom');\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _jsStylesheet = require('js-stylesheet');\n\nvar _jsStylesheet2 = _interopRequireDefault(_jsStylesheet);\n\nvar _uuid = require('../helpers/uuid');\n\nvar _uuid2 = _interopRequireDefault(_uuid);\n\nvar _childrenPropType = require('../helpers/childrenPropType');\n\nvar _childrenPropType2 = _interopRequireDefault(_childrenPropType);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\n// Determine if a node from event.target is a Tab element\nfunction isTabNode(node) {\n return node.nodeName === 'LI' && node.getAttribute('role') === 'tab';\n}\n\n// Determine if a tab node is disabled\nfunction isTabDisabled(node) {\n return node.getAttribute('aria-disabled') === 'true';\n}\n\nvar useDefaultStyles = true;\n\nmodule.exports = _react2.default.createClass({\n displayName: 'Tabs',\n\n propTypes: {\n className: _react.PropTypes.string,\n selectedIndex: _react.PropTypes.number,\n onSelect: _react.PropTypes.func,\n focus: _react.PropTypes.bool,\n children: _childrenPropType2.default,\n forceRenderTabPanel: _react.PropTypes.bool\n },\n\n childContextTypes: {\n forceRenderTabPanel: _react.PropTypes.bool\n },\n\n statics: {\n setUseDefaultStyles: function setUseDefaultStyles(use) {\n useDefaultStyles = use;\n }\n },\n\n getDefaultProps: function getDefaultProps() {\n return {\n selectedIndex: -1,\n focus: false,\n forceRenderTabPanel: false\n };\n },\n getInitialState: function getInitialState() {\n return this.copyPropsToState(this.props);\n },\n getChildContext: function getChildContext() {\n return {\n forceRenderTabPanel: this.props.forceRenderTabPanel\n };\n },\n componentDidMount: function componentDidMount() {\n if (useDefaultStyles) {\n (0, _jsStylesheet2.default)(require('../helpers/styles.js')); // eslint-disable-line global-require\n }\n },\n componentWillReceiveProps: function componentWillReceiveProps(newProps) {\n this.setState(this.copyPropsToState(newProps));\n },\n setSelected: function setSelected(index, focus) {\n // Don't do anything if nothing has changed\n if (index === this.state.selectedIndex) return;\n // Check index boundary\n if (index < 0 || index >= this.getTabsCount()) return;\n\n // Keep reference to last index for event handler\n var last = this.state.selectedIndex;\n\n // Update selected index\n this.setState({ selectedIndex: index, focus: focus === true });\n\n // Call change event handler\n if (typeof this.props.onSelect === 'function') {\n this.props.onSelect(index, last);\n }\n },\n getNextTab: function getNextTab(index) {\n var count = this.getTabsCount();\n\n // Look for non-disabled tab from index to the last tab on the right\n for (var i = index + 1; i < count; i++) {\n var tab = this.getTab(i);\n if (!isTabDisabled((0, _reactDom.findDOMNode)(tab))) {\n return i;\n }\n }\n\n // If no tab found, continue searching from first on left to index\n for (var _i = 0; _i < index; _i++) {\n var _tab = this.getTab(_i);\n if (!isTabDisabled((0, _reactDom.findDOMNode)(_tab))) {\n return _i;\n }\n }\n\n // No tabs are disabled, return index\n return index;\n },\n getPrevTab: function getPrevTab(index) {\n var i = index;\n\n // Look for non-disabled tab from index to first tab on the left\n while (i--) {\n var tab = this.getTab(i);\n if (!isTabDisabled((0, _reactDom.findDOMNode)(tab))) {\n return i;\n }\n }\n\n // If no tab found, continue searching from last tab on right to index\n i = this.getTabsCount();\n while (i-- > index) {\n var _tab2 = this.getTab(i);\n if (!isTabDisabled((0, _reactDom.findDOMNode)(_tab2))) {\n return i;\n }\n }\n\n // No tabs are disabled, return index\n return index;\n },\n getTabsCount: function getTabsCount() {\n return this.props.children && this.props.children[0] ? _react2.default.Children.count(this.props.children[0].props.children) : 0;\n },\n getPanelsCount: function getPanelsCount() {\n return _react2.default.Children.count(this.props.children.slice(1));\n },\n getTabList: function getTabList() {\n return this.refs.tablist;\n },\n getTab: function getTab(index) {\n return this.refs['tabs-' + index];\n },\n getPanel: function getPanel(index) {\n return this.refs['panels-' + index];\n },\n getChildren: function getChildren() {\n var index = 0;\n var count = 0;\n var children = this.props.children;\n var state = this.state;\n var tabIds = this.tabIds = this.tabIds || [];\n var panelIds = this.panelIds = this.panelIds || [];\n var diff = this.tabIds.length - this.getTabsCount();\n\n // Add ids if new tabs have been added\n // Don't bother removing ids, just keep them in case they are added again\n // This is more efficient, and keeps the uuid counter under control\n while (diff++ < 0) {\n tabIds.push((0, _uuid2.default)());\n panelIds.push((0, _uuid2.default)());\n }\n\n // Map children to dynamically setup refs\n return _react2.default.Children.map(children, function (child) {\n // null happens when conditionally rendering TabPanel/Tab\n // see https://github.com/rackt/react-tabs/issues/37\n if (child === null) {\n return null;\n }\n\n var result = null;\n\n // Clone TabList and Tab components to have refs\n if (count++ === 0) {\n // TODO try setting the uuid in the \"constructor\" for `Tab`/`TabPanel`\n result = (0, _react.cloneElement)(child, {\n ref: 'tablist',\n children: _react2.default.Children.map(child.props.children, function (tab) {\n // null happens when conditionally rendering TabPanel/Tab\n // see https://github.com/rackt/react-tabs/issues/37\n if (tab === null) {\n return null;\n }\n\n var ref = 'tabs-' + index;\n var id = tabIds[index];\n var panelId = panelIds[index];\n var selected = state.selectedIndex === index;\n var focus = selected && state.focus;\n\n index++;\n\n return (0, _react.cloneElement)(tab, {\n ref: ref,\n id: id,\n panelId: panelId,\n selected: selected,\n focus: focus\n });\n })\n });\n\n // Reset index for panels\n index = 0;\n }\n // Clone TabPanel components to have refs\n else {\n var ref = 'panels-' + index;\n var id = panelIds[index];\n var tabId = tabIds[index];\n var selected = state.selectedIndex === index;\n\n index++;\n\n result = (0, _react.cloneElement)(child, {\n ref: ref,\n id: id,\n tabId: tabId,\n selected: selected\n });\n }\n\n return result;\n });\n },\n handleKeyDown: function handleKeyDown(e) {\n if (this.isTabFromContainer(e.target)) {\n var index = this.state.selectedIndex;\n var preventDefault = false;\n\n // Select next tab to the left\n if (e.keyCode === 37 || e.keyCode === 38) {\n index = this.getPrevTab(index);\n preventDefault = true;\n }\n // Select next tab to the right\n /* eslint brace-style:0 */\n else if (e.keyCode === 39 || e.keyCode === 40) {\n index = this.getNextTab(index);\n preventDefault = true;\n }\n\n // This prevents scrollbars from moving around\n if (preventDefault) {\n e.preventDefault();\n }\n\n this.setSelected(index, true);\n }\n },\n handleClick: function handleClick(e) {\n var node = e.target;\n do {\n // eslint-disable-line no-cond-assign\n if (this.isTabFromContainer(node)) {\n if (isTabDisabled(node)) {\n return;\n }\n\n var index = [].slice.call(node.parentNode.children).indexOf(node);\n this.setSelected(index);\n return;\n }\n } while ((node = node.parentNode) !== null);\n },\n\n\n // This is an anti-pattern, so sue me\n copyPropsToState: function copyPropsToState(props) {\n var selectedIndex = props.selectedIndex;\n\n // If no selectedIndex prop was supplied, then try\n // preserving the existing selectedIndex from state.\n // If the state has not selectedIndex, default\n // to the first tab in the TabList.\n //\n // TODO: Need automation testing around this\n // Manual testing can be done using examples/focus\n // See 'should preserve selectedIndex when typing' in specs/Tabs.spec.js\n if (selectedIndex === -1) {\n if (this.state && this.state.selectedIndex) {\n selectedIndex = this.state.selectedIndex;\n } else {\n selectedIndex = 0;\n }\n }\n\n return {\n selectedIndex: selectedIndex,\n focus: props.focus\n };\n },\n\n\n /**\n * Determine if a node from event.target is a Tab element for the current Tabs container.\n * If the clicked element is not a Tab, it returns false.\n * If it finds another Tabs container between the Tab and `this`, it returns false.\n */\n isTabFromContainer: function isTabFromContainer(node) {\n // return immediately if the clicked element is not a Tab.\n if (!isTabNode(node)) {\n return false;\n }\n\n // Check if the first occurrence of a Tabs container is `this` one.\n var nodeAncestor = node.parentElement;\n var tabsNode = (0, _reactDom.findDOMNode)(this);\n do {\n if (nodeAncestor === tabsNode) return true;else if (nodeAncestor.getAttribute('data-tabs')) break;\n\n nodeAncestor = nodeAncestor.parentElement;\n } while (nodeAncestor);\n\n return false;\n },\n render: function render() {\n var _this = this;\n\n // This fixes an issue with focus management.\n //\n // Ultimately, when focus is true, and an input has focus,\n // and any change on that input causes a state change/re-render,\n // focus gets sent back to the active tab, and input loses focus.\n //\n // Since the focus state only needs to be remembered\n // for the current render, we can reset it once the\n // render has happened.\n //\n // Don't use setState, because we don't want to re-render.\n //\n // See https://github.com/rackt/react-tabs/pull/7\n if (this.state.focus) {\n setTimeout(function () {\n _this.state.focus = false;\n }, 0);\n }\n\n var _props = this.props;\n var className = _props.className;\n\n var attributes = _objectWithoutProperties(_props, ['className']);\n\n // Delete all known props, so they don't get added to DOM\n\n\n delete attributes.selectedIndex;\n delete attributes.onSelect;\n delete attributes.focus;\n delete attributes.children;\n delete attributes.forceRenderTabPanel;\n delete attributes.onClick;\n delete attributes.onKeyDown;\n\n return _react2.default.createElement(\n 'div',\n _extends({}, attributes, {\n className: (0, _classnames2.default)('ReactTabs', 'react-tabs', className),\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'data-tabs': true\n }),\n this.getChildren()\n );\n }\n});\n\n\n/** WEBPACK FOOTER **\n ** ./lib/components/Tabs.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"React\"\n ** module id = 2\n ** module chunks = 0\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"ReactDOM\"\n ** module id = 3\n ** module chunks = 0\n **/","/*!\n Copyright (c) 2016 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tclasses.push(classNames.apply(null, arg));\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/classnames/index.js\n ** module id = 4\n ** module chunks = 0\n **/","!(function() {\n function jss(blocks) {\n var css = [];\n for (var block in blocks)\n css.push(createStyleBlock(block, blocks[block]));\n injectCSS(css);\n }\n\n function createStyleBlock(selector, rules) {\n return selector + ' {\\n' + parseRules(rules) + '\\n}';\n }\n\n function parseRules(rules) {\n var css = [];\n for (var rule in rules)\n css.push(' '+rule+': '+rules[rule]+';');\n return css.join('\\n');\n }\n\n function injectCSS(css) {\n var style = document.getElementById('jss-styles');\n if (!style) {\n style = document.createElement('style');\n style.setAttribute('id', 'jss-styles');\n var head = document.getElementsByTagName('head')[0];\n head.insertBefore(style, head.firstChild);\n }\n var node = document.createTextNode(css.join('\\n\\n'));\n style.appendChild(node);\n }\n\n if (typeof exports === 'object')\n module.exports = jss;\n else\n window.jss = jss;\n\n})();\n\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/js-stylesheet/jss.js\n ** module id = 5\n ** module chunks = 0\n **/","\"use strict\";\n\n// Get a universally unique identifier\nvar count = 0;\nmodule.exports = function uuid() {\n return \"react-tabs-\" + count++;\n};\n\n\n/** WEBPACK FOOTER **\n ** ./lib/helpers/uuid.js\n **/","'use strict';\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _Tab = require('../components/Tab');\n\nvar _Tab2 = _interopRequireDefault(_Tab);\n\nvar _TabList = require('../components/TabList');\n\nvar _TabList2 = _interopRequireDefault(_TabList);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nmodule.exports = function childrenPropTypes(props, propName) {\n var error = void 0;\n var tabsCount = 0;\n var panelsCount = 0;\n var children = props[propName];\n\n _react2.default.Children.forEach(children, function (child) {\n // null happens when conditionally rendering TabPanel/Tab\n // see https://github.com/rackt/react-tabs/issues/37\n if (child === null) {\n return;\n }\n\n if (child.type === _TabList2.default) {\n _react2.default.Children.forEach(child.props.children, function (c) {\n // null happens when conditionally rendering TabPanel/Tab\n // see https://github.com/rackt/react-tabs/issues/37\n if (c === null) {\n return;\n }\n\n if (c.type === _Tab2.default) {\n tabsCount++;\n } else {\n error = new Error('Expected \\'Tab\\' but found \\'' + (c.type.displayName || c.type) + '\\'');\n }\n });\n } else if (child.type.displayName === 'TabPanel') {\n panelsCount++;\n } else {\n error = new Error('Expected \\'TabList\\' or \\'TabPanel\\' but found \\'' + (child.type.displayName || child.type) + '\\'');\n }\n });\n\n if (tabsCount !== panelsCount) {\n error = new Error(\"There should be an equal number of 'Tabs' and 'TabPanels'.\" + ('Received ' + tabsCount + ' \\'Tabs\\' and ' + panelsCount + ' \\'TabPanels\\'.'));\n }\n\n return error;\n};\n\n\n/** WEBPACK FOOTER **\n ** ./lib/helpers/childrenPropType.js\n **/","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require('react-dom');\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction syncNodeAttributes(node, props) {\n if (props.selected) {\n node.setAttribute('tabindex', '0');\n node.setAttribute('selected', 'selected');\n if (props.focus) {\n node.focus();\n }\n } else {\n node.removeAttribute('tabindex');\n node.removeAttribute('selected');\n }\n}\n\nmodule.exports = _react2.default.createClass({\n displayName: 'Tab',\n\n propTypes: {\n className: _react.PropTypes.string,\n id: _react.PropTypes.string,\n selected: _react.PropTypes.bool,\n disabled: _react.PropTypes.bool,\n panelId: _react.PropTypes.string,\n children: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object, _react.PropTypes.string])\n },\n\n getDefaultProps: function getDefaultProps() {\n return {\n focus: false,\n selected: false,\n id: null,\n panelId: null\n };\n },\n componentDidMount: function componentDidMount() {\n syncNodeAttributes((0, _reactDom.findDOMNode)(this), this.props);\n },\n componentDidUpdate: function componentDidUpdate() {\n syncNodeAttributes((0, _reactDom.findDOMNode)(this), this.props);\n },\n render: function render() {\n var _props = this.props;\n var selected = _props.selected;\n var disabled = _props.disabled;\n var panelId = _props.panelId;\n var className = _props.className;\n var children = _props.children;\n var id = _props.id;\n\n var attributes = _objectWithoutProperties(_props, ['selected', 'disabled', 'panelId', 'className', 'children', 'id']);\n\n return _react2.default.createElement(\n 'li',\n _extends({}, attributes, {\n className: (0, _classnames2.default)('ReactTabs__Tab', className, {\n 'ReactTabs__Tab--selected': selected,\n 'ReactTabs__Tab--disabled': disabled\n }),\n role: 'tab',\n id: id,\n 'aria-selected': selected ? 'true' : 'false',\n 'aria-expanded': selected ? 'true' : 'false',\n 'aria-disabled': disabled ? 'true' : 'false',\n 'aria-controls': panelId\n }),\n children\n );\n }\n});\n\n\n/** WEBPACK FOOTER **\n ** ./lib/components/Tab.js\n **/","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nmodule.exports = _react2.default.createClass({\n displayName: 'TabList',\n\n propTypes: {\n className: _react.PropTypes.string,\n children: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.array])\n },\n\n render: function render() {\n var _props = this.props;\n var className = _props.className;\n var children = _props.children;\n\n var attributes = _objectWithoutProperties(_props, ['className', 'children']);\n\n return _react2.default.createElement(\n 'ul',\n _extends({}, attributes, {\n className: (0, _classnames2.default)('ReactTabs__TabList', className),\n role: 'tablist'\n }),\n children\n );\n }\n});\n\n\n/** WEBPACK FOOTER **\n ** ./lib/components/TabList.js\n **/","'use strict';\n\nmodule.exports = {\n '.react-tabs [role=tablist]': {\n 'border-bottom': '1px solid #aaa',\n margin: '0 0 10px',\n padding: '0'\n },\n\n '.react-tabs [role=tab]': {\n display: 'inline-block',\n border: '1px solid transparent',\n 'border-bottom': 'none',\n bottom: '-1px',\n position: 'relative',\n 'list-style': 'none',\n padding: '6px 12px',\n cursor: 'pointer'\n },\n\n '.react-tabs [role=tab][aria-selected=true]': {\n background: '#fff',\n 'border-color': '#aaa',\n color: 'black',\n 'border-radius': '5px 5px 0 0',\n '-moz-border-radius': '5px 5px 0 0',\n '-webkit-border-radius': '5px 5px 0 0'\n },\n\n '.react-tabs [role=tab][aria-disabled=true]': {\n color: 'GrayText',\n cursor: 'default'\n },\n\n '.react-tabs [role=tab]:focus': {\n 'box-shadow': '0 0 5px hsl(208, 99%, 50%)',\n 'border-color': 'hsl(208, 99%, 50%)',\n outline: 'none'\n },\n\n '.react-tabs [role=tab]:focus:after': {\n content: '\"\"',\n position: 'absolute',\n height: '5px',\n left: '-4px',\n right: '-4px',\n bottom: '-5px',\n background: '#fff'\n }\n};\n\n\n/** WEBPACK FOOTER **\n ** ./lib/helpers/styles.js\n **/","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nmodule.exports = _react2.default.createClass({\n displayName: 'TabPanel',\n\n propTypes: {\n className: _react.PropTypes.string,\n selected: _react.PropTypes.bool,\n id: _react.PropTypes.string,\n tabId: _react.PropTypes.string,\n children: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object, _react.PropTypes.string])\n },\n\n contextTypes: {\n forceRenderTabPanel: _react.PropTypes.bool\n },\n\n getDefaultProps: function getDefaultProps() {\n return {\n selected: false,\n id: null,\n tabId: null\n };\n },\n render: function render() {\n var _props = this.props;\n var className = _props.className;\n var children = _props.children;\n var selected = _props.selected;\n var id = _props.id;\n var tabId = _props.tabId;\n\n var attributes = _objectWithoutProperties(_props, ['className', 'children', 'selected', 'id', 'tabId']);\n\n // Merge style\n\n\n var style = _extends({}, attributes.style, { display: selected ? null : 'none' });\n delete attributes.style;\n\n return _react2.default.createElement(\n 'div',\n _extends({}, attributes, {\n className: (0, _classnames2.default)('ReactTabs__TabPanel', className, {\n 'ReactTabs__TabPanel--selected': selected\n }),\n role: 'tabpanel',\n id: id,\n 'aria-labelledby': tabId,\n style: style\n }),\n this.context.forceRenderTabPanel || selected ? children : null\n );\n }\n});\n\n\n/** WEBPACK FOOTER **\n ** ./lib/components/TabPanel.js\n **/"],"sourceRoot":""}
\ No newline at end of file
diff --git a/dist/react-tabs.min.js b/dist/react-tabs.min.js
deleted file mode 100644
index 401242b4d2..0000000000
--- a/dist/react-tabs.min.js
+++ /dev/null
@@ -1,7 +0,0 @@
-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React"),require("ReactDOM")):"function"==typeof define&&define.amd?define(["React","ReactDOM"],t):"object"==typeof exports?exports.ReactTabs=t(require("React"),require("ReactDOM")):e.ReactTabs=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.TabPanel=t.Tab=t.TabList=t.Tabs=void 0;var a=r(1),s=n(a),o=r(9),i=n(o),l=r(8),d=n(l),c=r(11),u=n(c);t.Tabs=s["default"],t.TabList=i["default"],t.Tab=d["default"],t.TabPanel=u["default"],t["default"]={Tabs:s["default"],TabList:i["default"],Tab:d["default"],TabPanel:u["default"]}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function s(e){return"LI"===e.nodeName&&"tab"===e.getAttribute("role")}function o(e){return"true"===e.getAttribute("aria-disabled")}var i=Object.assign||function(e){for(var t=1;te||e>=this.getTabsCount())){var r=this.state.selectedIndex;this.setState({selectedIndex:e,focus:t===!0}),"function"==typeof this.props.onSelect&&this.props.onSelect(e,r)}},getNextTab:function(e){for(var t=this.getTabsCount(),r=e+1;t>r;r++){var n=this.getTab(r);if(!o((0,c.findDOMNode)(n)))return r}for(var a=0;e>a;a++){var s=this.getTab(a);if(!o((0,c.findDOMNode)(s)))return a}return e},getPrevTab:function(e){for(var t=e;t--;){var r=this.getTab(t);if(!o((0,c.findDOMNode)(r)))return t}for(t=this.getTabsCount();t-- >e;){var n=this.getTab(t);if(!o((0,c.findDOMNode)(n)))return t}return e},getTabsCount:function(){return this.props.children&&this.props.children[0]?d["default"].Children.count(this.props.children[0].props.children):0},getPanelsCount:function(){return d["default"].Children.count(this.props.children.slice(1))},getTabList:function(){return this.refs.tablist},getTab:function(e){return this.refs["tabs-"+e]},getPanel:function(e){return this.refs["panels-"+e]},getChildren:function(){for(var e=0,t=0,r=this.props.children,n=this.state,a=this.tabIds=this.tabIds||[],s=this.panelIds=this.panelIds||[],o=this.tabIds.length-this.getTabsCount();o++<0;)a.push((0,T["default"])()),s.push((0,T["default"])());return d["default"].Children.map(r,function(r){if(null===r)return null;var o=null;if(0===t++)o=(0,l.cloneElement)(r,{ref:"tablist",children:d["default"].Children.map(r.props.children,function(t){if(null===t)return null;var r="tabs-"+e,o=a[e],i=s[e],d=n.selectedIndex===e,c=d&&n.focus;return e++,(0,l.cloneElement)(t,{ref:r,id:o,panelId:i,selected:d,focus:c})})}),e=0;else{var i="panels-"+e,c=s[e],u=a[e],p=n.selectedIndex===e;e++,o=(0,l.cloneElement)(r,{ref:i,id:c,tabId:u,selected:p})}return o})},handleKeyDown:function(e){if(this.isTabFromContainer(e.target)){var t=this.state.selectedIndex,r=!1;37===e.keyCode||38===e.keyCode?(t=this.getPrevTab(t),r=!0):39!==e.keyCode&&40!==e.keyCode||(t=this.getNextTab(t),r=!0),r&&e.preventDefault(),this.setSelected(t,!0)}},handleClick:function(e){var t=e.target;do if(this.isTabFromContainer(t)){if(o(t))return;var r=[].slice.call(t.parentNode.children).indexOf(t);return void this.setSelected(r)}while(null!==(t=t.parentNode))},copyPropsToState:function(e){var t=e.selectedIndex;return-1===t&&(t=this.state&&this.state.selectedIndex?this.state.selectedIndex:0),{selectedIndex:t,focus:e.focus}},isTabFromContainer:function(e){if(!s(e))return!1;var t=e.parentElement,r=(0,c.findDOMNode)(this);do{if(t===r)return!0;if(t.getAttribute("data-tabs"))break;t=t.parentElement}while(t);return!1},render:function(){var e=this;this.state.focus&&setTimeout(function(){e.state.focus=!1},0);var t=this.props,r=t.className,n=a(t,["className"]);return delete n.selectedIndex,delete n.onSelect,delete n.focus,delete n.children,delete n.forceRenderTabPanel,delete n.onClick,delete n.onKeyDown,d["default"].createElement("div",i({},n,{className:(0,p["default"])("ReactTabs","react-tabs",r),onClick:this.handleClick,onKeyDown:this.handleKeyDown,"data-tabs":!0}),this.getChildren())}})},function(t,r){t.exports=e},function(e,r){e.exports=t},function(e,t,r){var n,a;/*!
- Copyright (c) 2016 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
- */
-!function(){"use strict";function r(){for(var e=[],t=0;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function s(e,t){t.selected?(e.setAttribute("tabindex","0"),e.setAttribute("selected","selected"),t.focus&&e.focus()):(e.removeAttribute("tabindex"),e.removeAttribute("selected"))}var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var s=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var s=Object.assign||function(e){for(var t=1;t= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i];\n\t }return target;\n\t}\n\t\n\t// Determine if a node from event.target is a Tab element\n\tfunction isTabNode(node) {\n\t return node.nodeName === 'LI' && node.getAttribute('role') === 'tab';\n\t}\n\t\n\t// Determine if a tab node is disabled\n\tfunction isTabDisabled(node) {\n\t return node.getAttribute('aria-disabled') === 'true';\n\t}\n\t\n\tvar useDefaultStyles = true;\n\t\n\tmodule.exports = _react2.default.createClass({\n\t displayName: 'Tabs',\n\t\n\t propTypes: {\n\t className: _react.PropTypes.string,\n\t selectedIndex: _react.PropTypes.number,\n\t onSelect: _react.PropTypes.func,\n\t focus: _react.PropTypes.bool,\n\t children: _childrenPropType2.default,\n\t forceRenderTabPanel: _react.PropTypes.bool\n\t },\n\t\n\t childContextTypes: {\n\t forceRenderTabPanel: _react.PropTypes.bool\n\t },\n\t\n\t statics: {\n\t setUseDefaultStyles: function setUseDefaultStyles(use) {\n\t useDefaultStyles = use;\n\t }\n\t },\n\t\n\t getDefaultProps: function getDefaultProps() {\n\t return {\n\t selectedIndex: -1,\n\t focus: false,\n\t forceRenderTabPanel: false\n\t };\n\t },\n\t getInitialState: function getInitialState() {\n\t return this.copyPropsToState(this.props);\n\t },\n\t getChildContext: function getChildContext() {\n\t return {\n\t forceRenderTabPanel: this.props.forceRenderTabPanel\n\t };\n\t },\n\t componentDidMount: function componentDidMount() {\n\t if (useDefaultStyles) {\n\t (0, _jsStylesheet2.default)(__webpack_require__(10)); // eslint-disable-line global-require\n\t }\n\t },\n\t componentWillReceiveProps: function componentWillReceiveProps(newProps) {\n\t this.setState(this.copyPropsToState(newProps));\n\t },\n\t setSelected: function setSelected(index, focus) {\n\t // Don't do anything if nothing has changed\n\t if (index === this.state.selectedIndex) return;\n\t // Check index boundary\n\t if (index < 0 || index >= this.getTabsCount()) return;\n\t\n\t // Keep reference to last index for event handler\n\t var last = this.state.selectedIndex;\n\t\n\t // Update selected index\n\t this.setState({ selectedIndex: index, focus: focus === true });\n\t\n\t // Call change event handler\n\t if (typeof this.props.onSelect === 'function') {\n\t this.props.onSelect(index, last);\n\t }\n\t },\n\t getNextTab: function getNextTab(index) {\n\t var count = this.getTabsCount();\n\t\n\t // Look for non-disabled tab from index to the last tab on the right\n\t for (var i = index + 1; i < count; i++) {\n\t var tab = this.getTab(i);\n\t if (!isTabDisabled((0, _reactDom.findDOMNode)(tab))) {\n\t return i;\n\t }\n\t }\n\t\n\t // If no tab found, continue searching from first on left to index\n\t for (var _i = 0; _i < index; _i++) {\n\t var _tab = this.getTab(_i);\n\t if (!isTabDisabled((0, _reactDom.findDOMNode)(_tab))) {\n\t return _i;\n\t }\n\t }\n\t\n\t // No tabs are disabled, return index\n\t return index;\n\t },\n\t getPrevTab: function getPrevTab(index) {\n\t var i = index;\n\t\n\t // Look for non-disabled tab from index to first tab on the left\n\t while (i--) {\n\t var tab = this.getTab(i);\n\t if (!isTabDisabled((0, _reactDom.findDOMNode)(tab))) {\n\t return i;\n\t }\n\t }\n\t\n\t // If no tab found, continue searching from last tab on right to index\n\t i = this.getTabsCount();\n\t while (i-- > index) {\n\t var _tab2 = this.getTab(i);\n\t if (!isTabDisabled((0, _reactDom.findDOMNode)(_tab2))) {\n\t return i;\n\t }\n\t }\n\t\n\t // No tabs are disabled, return index\n\t return index;\n\t },\n\t getTabsCount: function getTabsCount() {\n\t return this.props.children && this.props.children[0] ? _react2.default.Children.count(this.props.children[0].props.children) : 0;\n\t },\n\t getPanelsCount: function getPanelsCount() {\n\t return _react2.default.Children.count(this.props.children.slice(1));\n\t },\n\t getTabList: function getTabList() {\n\t return this.refs.tablist;\n\t },\n\t getTab: function getTab(index) {\n\t return this.refs['tabs-' + index];\n\t },\n\t getPanel: function getPanel(index) {\n\t return this.refs['panels-' + index];\n\t },\n\t getChildren: function getChildren() {\n\t var index = 0;\n\t var count = 0;\n\t var children = this.props.children;\n\t var state = this.state;\n\t var tabIds = this.tabIds = this.tabIds || [];\n\t var panelIds = this.panelIds = this.panelIds || [];\n\t var diff = this.tabIds.length - this.getTabsCount();\n\t\n\t // Add ids if new tabs have been added\n\t // Don't bother removing ids, just keep them in case they are added again\n\t // This is more efficient, and keeps the uuid counter under control\n\t while (diff++ < 0) {\n\t tabIds.push((0, _uuid2.default)());\n\t panelIds.push((0, _uuid2.default)());\n\t }\n\t\n\t // Map children to dynamically setup refs\n\t return _react2.default.Children.map(children, function (child) {\n\t // null happens when conditionally rendering TabPanel/Tab\n\t // see https://github.com/rackt/react-tabs/issues/37\n\t if (child === null) {\n\t return null;\n\t }\n\t\n\t var result = null;\n\t\n\t // Clone TabList and Tab components to have refs\n\t if (count++ === 0) {\n\t // TODO try setting the uuid in the \"constructor\" for `Tab`/`TabPanel`\n\t result = (0, _react.cloneElement)(child, {\n\t ref: 'tablist',\n\t children: _react2.default.Children.map(child.props.children, function (tab) {\n\t // null happens when conditionally rendering TabPanel/Tab\n\t // see https://github.com/rackt/react-tabs/issues/37\n\t if (tab === null) {\n\t return null;\n\t }\n\t\n\t var ref = 'tabs-' + index;\n\t var id = tabIds[index];\n\t var panelId = panelIds[index];\n\t var selected = state.selectedIndex === index;\n\t var focus = selected && state.focus;\n\t\n\t index++;\n\t\n\t return (0, _react.cloneElement)(tab, {\n\t ref: ref,\n\t id: id,\n\t panelId: panelId,\n\t selected: selected,\n\t focus: focus\n\t });\n\t })\n\t });\n\t\n\t // Reset index for panels\n\t index = 0;\n\t }\n\t // Clone TabPanel components to have refs\n\t else {\n\t var ref = 'panels-' + index;\n\t var id = panelIds[index];\n\t var tabId = tabIds[index];\n\t var selected = state.selectedIndex === index;\n\t\n\t index++;\n\t\n\t result = (0, _react.cloneElement)(child, {\n\t ref: ref,\n\t id: id,\n\t tabId: tabId,\n\t selected: selected\n\t });\n\t }\n\t\n\t return result;\n\t });\n\t },\n\t handleKeyDown: function handleKeyDown(e) {\n\t if (this.isTabFromContainer(e.target)) {\n\t var index = this.state.selectedIndex;\n\t var preventDefault = false;\n\t\n\t // Select next tab to the left\n\t if (e.keyCode === 37 || e.keyCode === 38) {\n\t index = this.getPrevTab(index);\n\t preventDefault = true;\n\t }\n\t // Select next tab to the right\n\t /* eslint brace-style:0 */\n\t else if (e.keyCode === 39 || e.keyCode === 40) {\n\t index = this.getNextTab(index);\n\t preventDefault = true;\n\t }\n\t\n\t // This prevents scrollbars from moving around\n\t if (preventDefault) {\n\t e.preventDefault();\n\t }\n\t\n\t this.setSelected(index, true);\n\t }\n\t },\n\t handleClick: function handleClick(e) {\n\t var node = e.target;\n\t do {\n\t // eslint-disable-line no-cond-assign\n\t if (this.isTabFromContainer(node)) {\n\t if (isTabDisabled(node)) {\n\t return;\n\t }\n\t\n\t var index = [].slice.call(node.parentNode.children).indexOf(node);\n\t this.setSelected(index);\n\t return;\n\t }\n\t } while ((node = node.parentNode) !== null);\n\t },\n\t\n\t // This is an anti-pattern, so sue me\n\t copyPropsToState: function copyPropsToState(props) {\n\t var selectedIndex = props.selectedIndex;\n\t\n\t // If no selectedIndex prop was supplied, then try\n\t // preserving the existing selectedIndex from state.\n\t // If the state has not selectedIndex, default\n\t // to the first tab in the TabList.\n\t //\n\t // TODO: Need automation testing around this\n\t // Manual testing can be done using examples/focus\n\t // See 'should preserve selectedIndex when typing' in specs/Tabs.spec.js\n\t if (selectedIndex === -1) {\n\t if (this.state && this.state.selectedIndex) {\n\t selectedIndex = this.state.selectedIndex;\n\t } else {\n\t selectedIndex = 0;\n\t }\n\t }\n\t\n\t return {\n\t selectedIndex: selectedIndex,\n\t focus: props.focus\n\t };\n\t },\n\t\n\t /**\n\t * Determine if a node from event.target is a Tab element for the current Tabs container.\n\t * If the clicked element is not a Tab, it returns false.\n\t * If it finds another Tabs container between the Tab and `this`, it returns false.\n\t */\n\t isTabFromContainer: function isTabFromContainer(node) {\n\t // return immediately if the clicked element is not a Tab.\n\t if (!isTabNode(node)) {\n\t return false;\n\t }\n\t\n\t // Check if the first occurrence of a Tabs container is `this` one.\n\t var nodeAncestor = node.parentElement;\n\t var tabsNode = (0, _reactDom.findDOMNode)(this);\n\t do {\n\t if (nodeAncestor === tabsNode) return true;else if (nodeAncestor.getAttribute('data-tabs')) break;\n\t\n\t nodeAncestor = nodeAncestor.parentElement;\n\t } while (nodeAncestor);\n\t\n\t return false;\n\t },\n\t render: function render() {\n\t var _this = this;\n\t\n\t // This fixes an issue with focus management.\n\t //\n\t // Ultimately, when focus is true, and an input has focus,\n\t // and any change on that input causes a state change/re-render,\n\t // focus gets sent back to the active tab, and input loses focus.\n\t //\n\t // Since the focus state only needs to be remembered\n\t // for the current render, we can reset it once the\n\t // render has happened.\n\t //\n\t // Don't use setState, because we don't want to re-render.\n\t //\n\t // See https://github.com/rackt/react-tabs/pull/7\n\t if (this.state.focus) {\n\t setTimeout(function () {\n\t _this.state.focus = false;\n\t }, 0);\n\t }\n\t\n\t var _props = this.props;\n\t var className = _props.className;\n\t\n\t var attributes = _objectWithoutProperties(_props, ['className']);\n\t\n\t // Delete all known props, so they don't get added to DOM\n\t\n\t delete attributes.selectedIndex;\n\t delete attributes.onSelect;\n\t delete attributes.focus;\n\t delete attributes.children;\n\t delete attributes.forceRenderTabPanel;\n\t delete attributes.onClick;\n\t delete attributes.onKeyDown;\n\t\n\t return _react2.default.createElement('div', _extends({}, attributes, {\n\t className: (0, _classnames2.default)('ReactTabs', 'react-tabs', className),\n\t onClick: this.handleClick,\n\t onKeyDown: this.handleKeyDown,\n\t 'data-tabs': true\n\t }), this.getChildren());\n\t }\n\t});\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ },\n/* 3 */\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ },\n/* 4 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n\t Copyright (c) 2016 Jed Watson.\n\t Licensed under the MIT License (MIT), see\n\t http://jedwatson.github.io/classnames\n\t*/\n\t/* global define */\n\t\n\t(function () {\n\t\t'use strict';\n\t\n\t\tvar hasOwn = {}.hasOwnProperty;\n\t\n\t\tfunction classNames () {\n\t\t\tvar classes = [];\n\t\n\t\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\t\tvar arg = arguments[i];\n\t\t\t\tif (!arg) continue;\n\t\n\t\t\t\tvar argType = typeof arg;\n\t\n\t\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\t\tclasses.push(arg);\n\t\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\t\tclasses.push(classNames.apply(null, arg));\n\t\t\t\t} else if (argType === 'object') {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\treturn classes.join(' ');\n\t\t}\n\t\n\t\tif (typeof module !== 'undefined' && module.exports) {\n\t\t\tmodule.exports = classNames;\n\t\t} else if (true) {\n\t\t\t// register as 'classnames', consistent with npm package name\n\t\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t\t\t\treturn classNames;\n\t\t\t}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t} else {\n\t\t\twindow.classNames = classNames;\n\t\t}\n\t}());\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t!(function() {\n\t function jss(blocks) {\n\t var css = [];\n\t for (var block in blocks)\n\t css.push(createStyleBlock(block, blocks[block]));\n\t injectCSS(css);\n\t }\n\t\n\t function createStyleBlock(selector, rules) {\n\t return selector + ' {\\n' + parseRules(rules) + '\\n}';\n\t }\n\t\n\t function parseRules(rules) {\n\t var css = [];\n\t for (var rule in rules)\n\t css.push(' '+rule+': '+rules[rule]+';');\n\t return css.join('\\n');\n\t }\n\t\n\t function injectCSS(css) {\n\t var style = document.getElementById('jss-styles');\n\t if (!style) {\n\t style = document.createElement('style');\n\t style.setAttribute('id', 'jss-styles');\n\t var head = document.getElementsByTagName('head')[0];\n\t head.insertBefore(style, head.firstChild);\n\t }\n\t var node = document.createTextNode(css.join('\\n\\n'));\n\t style.appendChild(node);\n\t }\n\t\n\t if (true)\n\t module.exports = jss;\n\t else\n\t window.jss = jss;\n\t\n\t})();\n\t\n\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\t// Get a universally unique identifier\n\t\n\tvar count = 0;\n\tmodule.exports = function uuid() {\n\t return \"react-tabs-\" + count++;\n\t};\n\n/***/ },\n/* 7 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _Tab = __webpack_require__(8);\n\t\n\tvar _Tab2 = _interopRequireDefault(_Tab);\n\t\n\tvar _TabList = __webpack_require__(9);\n\t\n\tvar _TabList2 = _interopRequireDefault(_TabList);\n\t\n\tfunction _interopRequireDefault(obj) {\n\t return obj && obj.__esModule ? obj : { default: obj };\n\t}\n\t\n\tmodule.exports = function childrenPropTypes(props, propName) {\n\t var error = void 0;\n\t var tabsCount = 0;\n\t var panelsCount = 0;\n\t var children = props[propName];\n\t\n\t _react2.default.Children.forEach(children, function (child) {\n\t // null happens when conditionally rendering TabPanel/Tab\n\t // see https://github.com/rackt/react-tabs/issues/37\n\t if (child === null) {\n\t return;\n\t }\n\t\n\t if (child.type === _TabList2.default) {\n\t _react2.default.Children.forEach(child.props.children, function (c) {\n\t // null happens when conditionally rendering TabPanel/Tab\n\t // see https://github.com/rackt/react-tabs/issues/37\n\t if (c === null) {\n\t return;\n\t }\n\t\n\t if (c.type === _Tab2.default) {\n\t tabsCount++;\n\t } else {\n\t error = new Error('Expected \\'Tab\\' but found \\'' + (c.type.displayName || c.type) + '\\'');\n\t }\n\t });\n\t } else if (child.type.displayName === 'TabPanel') {\n\t panelsCount++;\n\t } else {\n\t error = new Error('Expected \\'TabList\\' or \\'TabPanel\\' but found \\'' + (child.type.displayName || child.type) + '\\'');\n\t }\n\t });\n\t\n\t if (tabsCount !== panelsCount) {\n\t error = new Error(\"There should be an equal number of 'Tabs' and 'TabPanels'.\" + ('Received ' + tabsCount + ' \\'Tabs\\' and ' + panelsCount + ' \\'TabPanels\\'.'));\n\t }\n\t\n\t return error;\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _extends = Object.assign || function (target) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t var source = arguments[i];for (var key in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, key)) {\n\t target[key] = source[key];\n\t }\n\t }\n\t }return target;\n\t};\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactDom = __webpack_require__(3);\n\t\n\tvar _classnames = __webpack_require__(4);\n\t\n\tvar _classnames2 = _interopRequireDefault(_classnames);\n\t\n\tfunction _interopRequireDefault(obj) {\n\t return obj && obj.__esModule ? obj : { default: obj };\n\t}\n\t\n\tfunction _objectWithoutProperties(obj, keys) {\n\t var target = {};for (var i in obj) {\n\t if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i];\n\t }return target;\n\t}\n\t\n\tfunction syncNodeAttributes(node, props) {\n\t if (props.selected) {\n\t node.setAttribute('tabindex', '0');\n\t node.setAttribute('selected', 'selected');\n\t if (props.focus) {\n\t node.focus();\n\t }\n\t } else {\n\t node.removeAttribute('tabindex');\n\t node.removeAttribute('selected');\n\t }\n\t}\n\t\n\tmodule.exports = _react2.default.createClass({\n\t displayName: 'Tab',\n\t\n\t propTypes: {\n\t className: _react.PropTypes.string,\n\t id: _react.PropTypes.string,\n\t selected: _react.PropTypes.bool,\n\t disabled: _react.PropTypes.bool,\n\t panelId: _react.PropTypes.string,\n\t children: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object, _react.PropTypes.string])\n\t },\n\t\n\t getDefaultProps: function getDefaultProps() {\n\t return {\n\t focus: false,\n\t selected: false,\n\t id: null,\n\t panelId: null\n\t };\n\t },\n\t componentDidMount: function componentDidMount() {\n\t syncNodeAttributes((0, _reactDom.findDOMNode)(this), this.props);\n\t },\n\t componentDidUpdate: function componentDidUpdate() {\n\t syncNodeAttributes((0, _reactDom.findDOMNode)(this), this.props);\n\t },\n\t render: function render() {\n\t var _props = this.props;\n\t var selected = _props.selected;\n\t var disabled = _props.disabled;\n\t var panelId = _props.panelId;\n\t var className = _props.className;\n\t var children = _props.children;\n\t var id = _props.id;\n\t\n\t var attributes = _objectWithoutProperties(_props, ['selected', 'disabled', 'panelId', 'className', 'children', 'id']);\n\t\n\t return _react2.default.createElement('li', _extends({}, attributes, {\n\t className: (0, _classnames2.default)('ReactTabs__Tab', className, {\n\t 'ReactTabs__Tab--selected': selected,\n\t 'ReactTabs__Tab--disabled': disabled\n\t }),\n\t role: 'tab',\n\t id: id,\n\t 'aria-selected': selected ? 'true' : 'false',\n\t 'aria-expanded': selected ? 'true' : 'false',\n\t 'aria-disabled': disabled ? 'true' : 'false',\n\t 'aria-controls': panelId\n\t }), children);\n\t }\n\t});\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _extends = Object.assign || function (target) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t var source = arguments[i];for (var key in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, key)) {\n\t target[key] = source[key];\n\t }\n\t }\n\t }return target;\n\t};\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _classnames = __webpack_require__(4);\n\t\n\tvar _classnames2 = _interopRequireDefault(_classnames);\n\t\n\tfunction _interopRequireDefault(obj) {\n\t return obj && obj.__esModule ? obj : { default: obj };\n\t}\n\t\n\tfunction _objectWithoutProperties(obj, keys) {\n\t var target = {};for (var i in obj) {\n\t if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i];\n\t }return target;\n\t}\n\t\n\tmodule.exports = _react2.default.createClass({\n\t displayName: 'TabList',\n\t\n\t propTypes: {\n\t className: _react.PropTypes.string,\n\t children: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.array])\n\t },\n\t\n\t render: function render() {\n\t var _props = this.props;\n\t var className = _props.className;\n\t var children = _props.children;\n\t\n\t var attributes = _objectWithoutProperties(_props, ['className', 'children']);\n\t\n\t return _react2.default.createElement('ul', _extends({}, attributes, {\n\t className: (0, _classnames2.default)('ReactTabs__TabList', className),\n\t role: 'tablist'\n\t }), children);\n\t }\n\t});\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = {\n\t '.react-tabs [role=tablist]': {\n\t 'border-bottom': '1px solid #aaa',\n\t margin: '0 0 10px',\n\t padding: '0'\n\t },\n\t\n\t '.react-tabs [role=tab]': {\n\t display: 'inline-block',\n\t border: '1px solid transparent',\n\t 'border-bottom': 'none',\n\t bottom: '-1px',\n\t position: 'relative',\n\t 'list-style': 'none',\n\t padding: '6px 12px',\n\t cursor: 'pointer'\n\t },\n\t\n\t '.react-tabs [role=tab][aria-selected=true]': {\n\t background: '#fff',\n\t 'border-color': '#aaa',\n\t color: 'black',\n\t 'border-radius': '5px 5px 0 0',\n\t '-moz-border-radius': '5px 5px 0 0',\n\t '-webkit-border-radius': '5px 5px 0 0'\n\t },\n\t\n\t '.react-tabs [role=tab][aria-disabled=true]': {\n\t color: 'GrayText',\n\t cursor: 'default'\n\t },\n\t\n\t '.react-tabs [role=tab]:focus': {\n\t 'box-shadow': '0 0 5px hsl(208, 99%, 50%)',\n\t 'border-color': 'hsl(208, 99%, 50%)',\n\t outline: 'none'\n\t },\n\t\n\t '.react-tabs [role=tab]:focus:after': {\n\t content: '\"\"',\n\t position: 'absolute',\n\t height: '5px',\n\t left: '-4px',\n\t right: '-4px',\n\t bottom: '-5px',\n\t background: '#fff'\n\t }\n\t};\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _extends = Object.assign || function (target) {\n\t for (var i = 1; i < arguments.length; i++) {\n\t var source = arguments[i];for (var key in source) {\n\t if (Object.prototype.hasOwnProperty.call(source, key)) {\n\t target[key] = source[key];\n\t }\n\t }\n\t }return target;\n\t};\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _classnames = __webpack_require__(4);\n\t\n\tvar _classnames2 = _interopRequireDefault(_classnames);\n\t\n\tfunction _interopRequireDefault(obj) {\n\t return obj && obj.__esModule ? obj : { default: obj };\n\t}\n\t\n\tfunction _objectWithoutProperties(obj, keys) {\n\t var target = {};for (var i in obj) {\n\t if (keys.indexOf(i) >= 0) continue;if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;target[i] = obj[i];\n\t }return target;\n\t}\n\t\n\tmodule.exports = _react2.default.createClass({\n\t displayName: 'TabPanel',\n\t\n\t propTypes: {\n\t className: _react.PropTypes.string,\n\t selected: _react.PropTypes.bool,\n\t id: _react.PropTypes.string,\n\t tabId: _react.PropTypes.string,\n\t children: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object, _react.PropTypes.string])\n\t },\n\t\n\t contextTypes: {\n\t forceRenderTabPanel: _react.PropTypes.bool\n\t },\n\t\n\t getDefaultProps: function getDefaultProps() {\n\t return {\n\t selected: false,\n\t id: null,\n\t tabId: null\n\t };\n\t },\n\t render: function render() {\n\t var _props = this.props;\n\t var className = _props.className;\n\t var children = _props.children;\n\t var selected = _props.selected;\n\t var id = _props.id;\n\t var tabId = _props.tabId;\n\t\n\t var attributes = _objectWithoutProperties(_props, ['className', 'children', 'selected', 'id', 'tabId']);\n\t\n\t // Merge style\n\t\n\t var style = _extends({}, attributes.style, { display: selected ? null : 'none' });\n\t delete attributes.style;\n\t\n\t return _react2.default.createElement('div', _extends({}, attributes, {\n\t className: (0, _classnames2.default)('ReactTabs__TabPanel', className, {\n\t 'ReactTabs__TabPanel--selected': selected\n\t }),\n\t role: 'tabpanel',\n\t id: id,\n\t 'aria-labelledby': tabId,\n\t style: style\n\t }), this.context.forceRenderTabPanel || selected ? children : null);\n\t }\n\t});\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** ./dist/react-tabs.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap db99d680d818c095ec9b\n **/","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.TabPanel = exports.Tab = exports.TabList = exports.Tabs = undefined;\n\nvar _Tabs = require('./components/Tabs');\n\nvar _Tabs2 = _interopRequireDefault(_Tabs);\n\nvar _TabList = require('./components/TabList');\n\nvar _TabList2 = _interopRequireDefault(_TabList);\n\nvar _Tab = require('./components/Tab');\n\nvar _Tab2 = _interopRequireDefault(_Tab);\n\nvar _TabPanel = require('./components/TabPanel');\n\nvar _TabPanel2 = _interopRequireDefault(_TabPanel);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.Tabs =\n\n// For bc we also export a default object, remove in 1.0\n_Tabs2.default;\nexports.TabList = _TabList2.default;\nexports.Tab = _Tab2.default;\nexports.TabPanel = _TabPanel2.default;\nexports.default = {\n Tabs: _Tabs2.default,\n TabList: _TabList2.default,\n Tab: _Tab2.default,\n TabPanel: _TabPanel2.default\n};\n\n\n/** WEBPACK FOOTER **\n ** ./lib/main.js\n **/","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require('react-dom');\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nvar _jsStylesheet = require('js-stylesheet');\n\nvar _jsStylesheet2 = _interopRequireDefault(_jsStylesheet);\n\nvar _uuid = require('../helpers/uuid');\n\nvar _uuid2 = _interopRequireDefault(_uuid);\n\nvar _childrenPropType = require('../helpers/childrenPropType');\n\nvar _childrenPropType2 = _interopRequireDefault(_childrenPropType);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\n// Determine if a node from event.target is a Tab element\nfunction isTabNode(node) {\n return node.nodeName === 'LI' && node.getAttribute('role') === 'tab';\n}\n\n// Determine if a tab node is disabled\nfunction isTabDisabled(node) {\n return node.getAttribute('aria-disabled') === 'true';\n}\n\nvar useDefaultStyles = true;\n\nmodule.exports = _react2.default.createClass({\n displayName: 'Tabs',\n\n propTypes: {\n className: _react.PropTypes.string,\n selectedIndex: _react.PropTypes.number,\n onSelect: _react.PropTypes.func,\n focus: _react.PropTypes.bool,\n children: _childrenPropType2.default,\n forceRenderTabPanel: _react.PropTypes.bool\n },\n\n childContextTypes: {\n forceRenderTabPanel: _react.PropTypes.bool\n },\n\n statics: {\n setUseDefaultStyles: function setUseDefaultStyles(use) {\n useDefaultStyles = use;\n }\n },\n\n getDefaultProps: function getDefaultProps() {\n return {\n selectedIndex: -1,\n focus: false,\n forceRenderTabPanel: false\n };\n },\n getInitialState: function getInitialState() {\n return this.copyPropsToState(this.props);\n },\n getChildContext: function getChildContext() {\n return {\n forceRenderTabPanel: this.props.forceRenderTabPanel\n };\n },\n componentDidMount: function componentDidMount() {\n if (useDefaultStyles) {\n (0, _jsStylesheet2.default)(require('../helpers/styles.js')); // eslint-disable-line global-require\n }\n },\n componentWillReceiveProps: function componentWillReceiveProps(newProps) {\n this.setState(this.copyPropsToState(newProps));\n },\n setSelected: function setSelected(index, focus) {\n // Don't do anything if nothing has changed\n if (index === this.state.selectedIndex) return;\n // Check index boundary\n if (index < 0 || index >= this.getTabsCount()) return;\n\n // Keep reference to last index for event handler\n var last = this.state.selectedIndex;\n\n // Update selected index\n this.setState({ selectedIndex: index, focus: focus === true });\n\n // Call change event handler\n if (typeof this.props.onSelect === 'function') {\n this.props.onSelect(index, last);\n }\n },\n getNextTab: function getNextTab(index) {\n var count = this.getTabsCount();\n\n // Look for non-disabled tab from index to the last tab on the right\n for (var i = index + 1; i < count; i++) {\n var tab = this.getTab(i);\n if (!isTabDisabled((0, _reactDom.findDOMNode)(tab))) {\n return i;\n }\n }\n\n // If no tab found, continue searching from first on left to index\n for (var _i = 0; _i < index; _i++) {\n var _tab = this.getTab(_i);\n if (!isTabDisabled((0, _reactDom.findDOMNode)(_tab))) {\n return _i;\n }\n }\n\n // No tabs are disabled, return index\n return index;\n },\n getPrevTab: function getPrevTab(index) {\n var i = index;\n\n // Look for non-disabled tab from index to first tab on the left\n while (i--) {\n var tab = this.getTab(i);\n if (!isTabDisabled((0, _reactDom.findDOMNode)(tab))) {\n return i;\n }\n }\n\n // If no tab found, continue searching from last tab on right to index\n i = this.getTabsCount();\n while (i-- > index) {\n var _tab2 = this.getTab(i);\n if (!isTabDisabled((0, _reactDom.findDOMNode)(_tab2))) {\n return i;\n }\n }\n\n // No tabs are disabled, return index\n return index;\n },\n getTabsCount: function getTabsCount() {\n return this.props.children && this.props.children[0] ? _react2.default.Children.count(this.props.children[0].props.children) : 0;\n },\n getPanelsCount: function getPanelsCount() {\n return _react2.default.Children.count(this.props.children.slice(1));\n },\n getTabList: function getTabList() {\n return this.refs.tablist;\n },\n getTab: function getTab(index) {\n return this.refs['tabs-' + index];\n },\n getPanel: function getPanel(index) {\n return this.refs['panels-' + index];\n },\n getChildren: function getChildren() {\n var index = 0;\n var count = 0;\n var children = this.props.children;\n var state = this.state;\n var tabIds = this.tabIds = this.tabIds || [];\n var panelIds = this.panelIds = this.panelIds || [];\n var diff = this.tabIds.length - this.getTabsCount();\n\n // Add ids if new tabs have been added\n // Don't bother removing ids, just keep them in case they are added again\n // This is more efficient, and keeps the uuid counter under control\n while (diff++ < 0) {\n tabIds.push((0, _uuid2.default)());\n panelIds.push((0, _uuid2.default)());\n }\n\n // Map children to dynamically setup refs\n return _react2.default.Children.map(children, function (child) {\n // null happens when conditionally rendering TabPanel/Tab\n // see https://github.com/rackt/react-tabs/issues/37\n if (child === null) {\n return null;\n }\n\n var result = null;\n\n // Clone TabList and Tab components to have refs\n if (count++ === 0) {\n // TODO try setting the uuid in the \"constructor\" for `Tab`/`TabPanel`\n result = (0, _react.cloneElement)(child, {\n ref: 'tablist',\n children: _react2.default.Children.map(child.props.children, function (tab) {\n // null happens when conditionally rendering TabPanel/Tab\n // see https://github.com/rackt/react-tabs/issues/37\n if (tab === null) {\n return null;\n }\n\n var ref = 'tabs-' + index;\n var id = tabIds[index];\n var panelId = panelIds[index];\n var selected = state.selectedIndex === index;\n var focus = selected && state.focus;\n\n index++;\n\n return (0, _react.cloneElement)(tab, {\n ref: ref,\n id: id,\n panelId: panelId,\n selected: selected,\n focus: focus\n });\n })\n });\n\n // Reset index for panels\n index = 0;\n }\n // Clone TabPanel components to have refs\n else {\n var ref = 'panels-' + index;\n var id = panelIds[index];\n var tabId = tabIds[index];\n var selected = state.selectedIndex === index;\n\n index++;\n\n result = (0, _react.cloneElement)(child, {\n ref: ref,\n id: id,\n tabId: tabId,\n selected: selected\n });\n }\n\n return result;\n });\n },\n handleKeyDown: function handleKeyDown(e) {\n if (this.isTabFromContainer(e.target)) {\n var index = this.state.selectedIndex;\n var preventDefault = false;\n\n // Select next tab to the left\n if (e.keyCode === 37 || e.keyCode === 38) {\n index = this.getPrevTab(index);\n preventDefault = true;\n }\n // Select next tab to the right\n /* eslint brace-style:0 */\n else if (e.keyCode === 39 || e.keyCode === 40) {\n index = this.getNextTab(index);\n preventDefault = true;\n }\n\n // This prevents scrollbars from moving around\n if (preventDefault) {\n e.preventDefault();\n }\n\n this.setSelected(index, true);\n }\n },\n handleClick: function handleClick(e) {\n var node = e.target;\n do {\n // eslint-disable-line no-cond-assign\n if (this.isTabFromContainer(node)) {\n if (isTabDisabled(node)) {\n return;\n }\n\n var index = [].slice.call(node.parentNode.children).indexOf(node);\n this.setSelected(index);\n return;\n }\n } while ((node = node.parentNode) !== null);\n },\n\n\n // This is an anti-pattern, so sue me\n copyPropsToState: function copyPropsToState(props) {\n var selectedIndex = props.selectedIndex;\n\n // If no selectedIndex prop was supplied, then try\n // preserving the existing selectedIndex from state.\n // If the state has not selectedIndex, default\n // to the first tab in the TabList.\n //\n // TODO: Need automation testing around this\n // Manual testing can be done using examples/focus\n // See 'should preserve selectedIndex when typing' in specs/Tabs.spec.js\n if (selectedIndex === -1) {\n if (this.state && this.state.selectedIndex) {\n selectedIndex = this.state.selectedIndex;\n } else {\n selectedIndex = 0;\n }\n }\n\n return {\n selectedIndex: selectedIndex,\n focus: props.focus\n };\n },\n\n\n /**\n * Determine if a node from event.target is a Tab element for the current Tabs container.\n * If the clicked element is not a Tab, it returns false.\n * If it finds another Tabs container between the Tab and `this`, it returns false.\n */\n isTabFromContainer: function isTabFromContainer(node) {\n // return immediately if the clicked element is not a Tab.\n if (!isTabNode(node)) {\n return false;\n }\n\n // Check if the first occurrence of a Tabs container is `this` one.\n var nodeAncestor = node.parentElement;\n var tabsNode = (0, _reactDom.findDOMNode)(this);\n do {\n if (nodeAncestor === tabsNode) return true;else if (nodeAncestor.getAttribute('data-tabs')) break;\n\n nodeAncestor = nodeAncestor.parentElement;\n } while (nodeAncestor);\n\n return false;\n },\n render: function render() {\n var _this = this;\n\n // This fixes an issue with focus management.\n //\n // Ultimately, when focus is true, and an input has focus,\n // and any change on that input causes a state change/re-render,\n // focus gets sent back to the active tab, and input loses focus.\n //\n // Since the focus state only needs to be remembered\n // for the current render, we can reset it once the\n // render has happened.\n //\n // Don't use setState, because we don't want to re-render.\n //\n // See https://github.com/rackt/react-tabs/pull/7\n if (this.state.focus) {\n setTimeout(function () {\n _this.state.focus = false;\n }, 0);\n }\n\n var _props = this.props;\n var className = _props.className;\n\n var attributes = _objectWithoutProperties(_props, ['className']);\n\n // Delete all known props, so they don't get added to DOM\n\n\n delete attributes.selectedIndex;\n delete attributes.onSelect;\n delete attributes.focus;\n delete attributes.children;\n delete attributes.forceRenderTabPanel;\n delete attributes.onClick;\n delete attributes.onKeyDown;\n\n return _react2.default.createElement(\n 'div',\n _extends({}, attributes, {\n className: (0, _classnames2.default)('ReactTabs', 'react-tabs', className),\n onClick: this.handleClick,\n onKeyDown: this.handleKeyDown,\n 'data-tabs': true\n }),\n this.getChildren()\n );\n }\n});\n\n\n/** WEBPACK FOOTER **\n ** ./lib/components/Tabs.js\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"React\"\n ** module id = 2\n ** module chunks = 0\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"ReactDOM\"\n ** module id = 3\n ** module chunks = 0\n **/","/*!\n Copyright (c) 2016 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tclasses.push(classNames.apply(null, arg));\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tfor (var key in arg) {\n\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/classnames/index.js\n ** module id = 4\n ** module chunks = 0\n **/","!(function() {\n function jss(blocks) {\n var css = [];\n for (var block in blocks)\n css.push(createStyleBlock(block, blocks[block]));\n injectCSS(css);\n }\n\n function createStyleBlock(selector, rules) {\n return selector + ' {\\n' + parseRules(rules) + '\\n}';\n }\n\n function parseRules(rules) {\n var css = [];\n for (var rule in rules)\n css.push(' '+rule+': '+rules[rule]+';');\n return css.join('\\n');\n }\n\n function injectCSS(css) {\n var style = document.getElementById('jss-styles');\n if (!style) {\n style = document.createElement('style');\n style.setAttribute('id', 'jss-styles');\n var head = document.getElementsByTagName('head')[0];\n head.insertBefore(style, head.firstChild);\n }\n var node = document.createTextNode(css.join('\\n\\n'));\n style.appendChild(node);\n }\n\n if (typeof exports === 'object')\n module.exports = jss;\n else\n window.jss = jss;\n\n})();\n\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/js-stylesheet/jss.js\n ** module id = 5\n ** module chunks = 0\n **/","\"use strict\";\n\n// Get a universally unique identifier\nvar count = 0;\nmodule.exports = function uuid() {\n return \"react-tabs-\" + count++;\n};\n\n\n/** WEBPACK FOOTER **\n ** ./lib/helpers/uuid.js\n **/","'use strict';\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _Tab = require('../components/Tab');\n\nvar _Tab2 = _interopRequireDefault(_Tab);\n\nvar _TabList = require('../components/TabList');\n\nvar _TabList2 = _interopRequireDefault(_TabList);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nmodule.exports = function childrenPropTypes(props, propName) {\n var error = void 0;\n var tabsCount = 0;\n var panelsCount = 0;\n var children = props[propName];\n\n _react2.default.Children.forEach(children, function (child) {\n // null happens when conditionally rendering TabPanel/Tab\n // see https://github.com/rackt/react-tabs/issues/37\n if (child === null) {\n return;\n }\n\n if (child.type === _TabList2.default) {\n _react2.default.Children.forEach(child.props.children, function (c) {\n // null happens when conditionally rendering TabPanel/Tab\n // see https://github.com/rackt/react-tabs/issues/37\n if (c === null) {\n return;\n }\n\n if (c.type === _Tab2.default) {\n tabsCount++;\n } else {\n error = new Error('Expected \\'Tab\\' but found \\'' + (c.type.displayName || c.type) + '\\'');\n }\n });\n } else if (child.type.displayName === 'TabPanel') {\n panelsCount++;\n } else {\n error = new Error('Expected \\'TabList\\' or \\'TabPanel\\' but found \\'' + (child.type.displayName || child.type) + '\\'');\n }\n });\n\n if (tabsCount !== panelsCount) {\n error = new Error(\"There should be an equal number of 'Tabs' and 'TabPanels'.\" + ('Received ' + tabsCount + ' \\'Tabs\\' and ' + panelsCount + ' \\'TabPanels\\'.'));\n }\n\n return error;\n};\n\n\n/** WEBPACK FOOTER **\n ** ./lib/helpers/childrenPropType.js\n **/","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _reactDom = require('react-dom');\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nfunction syncNodeAttributes(node, props) {\n if (props.selected) {\n node.setAttribute('tabindex', '0');\n node.setAttribute('selected', 'selected');\n if (props.focus) {\n node.focus();\n }\n } else {\n node.removeAttribute('tabindex');\n node.removeAttribute('selected');\n }\n}\n\nmodule.exports = _react2.default.createClass({\n displayName: 'Tab',\n\n propTypes: {\n className: _react.PropTypes.string,\n id: _react.PropTypes.string,\n selected: _react.PropTypes.bool,\n disabled: _react.PropTypes.bool,\n panelId: _react.PropTypes.string,\n children: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object, _react.PropTypes.string])\n },\n\n getDefaultProps: function getDefaultProps() {\n return {\n focus: false,\n selected: false,\n id: null,\n panelId: null\n };\n },\n componentDidMount: function componentDidMount() {\n syncNodeAttributes((0, _reactDom.findDOMNode)(this), this.props);\n },\n componentDidUpdate: function componentDidUpdate() {\n syncNodeAttributes((0, _reactDom.findDOMNode)(this), this.props);\n },\n render: function render() {\n var _props = this.props;\n var selected = _props.selected;\n var disabled = _props.disabled;\n var panelId = _props.panelId;\n var className = _props.className;\n var children = _props.children;\n var id = _props.id;\n\n var attributes = _objectWithoutProperties(_props, ['selected', 'disabled', 'panelId', 'className', 'children', 'id']);\n\n return _react2.default.createElement(\n 'li',\n _extends({}, attributes, {\n className: (0, _classnames2.default)('ReactTabs__Tab', className, {\n 'ReactTabs__Tab--selected': selected,\n 'ReactTabs__Tab--disabled': disabled\n }),\n role: 'tab',\n id: id,\n 'aria-selected': selected ? 'true' : 'false',\n 'aria-expanded': selected ? 'true' : 'false',\n 'aria-disabled': disabled ? 'true' : 'false',\n 'aria-controls': panelId\n }),\n children\n );\n }\n});\n\n\n/** WEBPACK FOOTER **\n ** ./lib/components/Tab.js\n **/","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nmodule.exports = _react2.default.createClass({\n displayName: 'TabList',\n\n propTypes: {\n className: _react.PropTypes.string,\n children: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.array])\n },\n\n render: function render() {\n var _props = this.props;\n var className = _props.className;\n var children = _props.children;\n\n var attributes = _objectWithoutProperties(_props, ['className', 'children']);\n\n return _react2.default.createElement(\n 'ul',\n _extends({}, attributes, {\n className: (0, _classnames2.default)('ReactTabs__TabList', className),\n role: 'tablist'\n }),\n children\n );\n }\n});\n\n\n/** WEBPACK FOOTER **\n ** ./lib/components/TabList.js\n **/","'use strict';\n\nmodule.exports = {\n '.react-tabs [role=tablist]': {\n 'border-bottom': '1px solid #aaa',\n margin: '0 0 10px',\n padding: '0'\n },\n\n '.react-tabs [role=tab]': {\n display: 'inline-block',\n border: '1px solid transparent',\n 'border-bottom': 'none',\n bottom: '-1px',\n position: 'relative',\n 'list-style': 'none',\n padding: '6px 12px',\n cursor: 'pointer'\n },\n\n '.react-tabs [role=tab][aria-selected=true]': {\n background: '#fff',\n 'border-color': '#aaa',\n color: 'black',\n 'border-radius': '5px 5px 0 0',\n '-moz-border-radius': '5px 5px 0 0',\n '-webkit-border-radius': '5px 5px 0 0'\n },\n\n '.react-tabs [role=tab][aria-disabled=true]': {\n color: 'GrayText',\n cursor: 'default'\n },\n\n '.react-tabs [role=tab]:focus': {\n 'box-shadow': '0 0 5px hsl(208, 99%, 50%)',\n 'border-color': 'hsl(208, 99%, 50%)',\n outline: 'none'\n },\n\n '.react-tabs [role=tab]:focus:after': {\n content: '\"\"',\n position: 'absolute',\n height: '5px',\n left: '-4px',\n right: '-4px',\n bottom: '-5px',\n background: '#fff'\n }\n};\n\n\n/** WEBPACK FOOTER **\n ** ./lib/helpers/styles.js\n **/","'use strict';\n\nvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _classnames = require('classnames');\n\nvar _classnames2 = _interopRequireDefault(_classnames);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\nmodule.exports = _react2.default.createClass({\n displayName: 'TabPanel',\n\n propTypes: {\n className: _react.PropTypes.string,\n selected: _react.PropTypes.bool,\n id: _react.PropTypes.string,\n tabId: _react.PropTypes.string,\n children: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object, _react.PropTypes.string])\n },\n\n contextTypes: {\n forceRenderTabPanel: _react.PropTypes.bool\n },\n\n getDefaultProps: function getDefaultProps() {\n return {\n selected: false,\n id: null,\n tabId: null\n };\n },\n render: function render() {\n var _props = this.props;\n var className = _props.className;\n var children = _props.children;\n var selected = _props.selected;\n var id = _props.id;\n var tabId = _props.tabId;\n\n var attributes = _objectWithoutProperties(_props, ['className', 'children', 'selected', 'id', 'tabId']);\n\n // Merge style\n\n\n var style = _extends({}, attributes.style, { display: selected ? null : 'none' });\n delete attributes.style;\n\n return _react2.default.createElement(\n 'div',\n _extends({}, attributes, {\n className: (0, _classnames2.default)('ReactTabs__TabPanel', className, {\n 'ReactTabs__TabPanel--selected': selected\n }),\n role: 'tabpanel',\n id: id,\n 'aria-labelledby': tabId,\n style: style\n }),\n this.context.forceRenderTabPanel || selected ? children : null\n );\n }\n});\n\n\n/** WEBPACK FOOTER **\n ** ./lib/components/TabPanel.js\n **/"],"sourceRoot":""}
\ No newline at end of file
diff --git a/eslint.config.mjs b/eslint.config.mjs
new file mode 100644
index 0000000000..f3bcaa0797
--- /dev/null
+++ b/eslint.config.mjs
@@ -0,0 +1,66 @@
+import babelParser from '@babel/eslint-parser';
+import js from '@eslint/js';
+import reactPlugin from 'eslint-plugin-react';
+import importPlugin from 'eslint-plugin-import';
+import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
+import prettierRecommended from 'eslint-plugin-prettier/recommended';
+
+export default [
+ js.configs.recommended,
+ reactPlugin.configs.flat.recommended,
+ importPlugin.flatConfigs.recommended,
+ importPlugin.flatConfigs.react,
+ jsxA11yPlugin.flatConfigs.recommended,
+ prettierRecommended,
+ {
+ ignores: ['webpack.*', '**/lib', '**/dist', '**/esm'],
+ },
+ {
+ languageOptions: {
+ parser: babelParser,
+
+ parserOptions: {
+ requireConfigFile: false,
+ },
+ },
+
+ settings: {
+ react: {
+ version: 'detect',
+ },
+ 'import/resolver': {
+ node: {
+ extensions: ['.js', '.jsx'],
+ },
+ },
+ },
+
+ rules: {
+ 'jsx-a11y/no-static-element-interactions': 'off',
+
+ 'import/no-extraneous-dependencies': [
+ 'error',
+ {
+ devDependencies: [
+ '**/__tests__/**/*',
+ 'examples/src/**/*.js',
+ 'rollup.config.js',
+ 'webpack.config.js',
+ ],
+
+ optionalDependencies: false,
+ },
+ ],
+
+ 'no-unused-vars': [
+ 'error',
+ {
+ ignoreRestSiblings: true,
+ },
+ ],
+
+ 'no-console': 'error',
+ 'react/prop-types': 'off',
+ },
+ },
+];
diff --git a/examples/basic/app.js b/examples/basic/app.js
deleted file mode 100644
index fe51d3e8da..0000000000
--- a/examples/basic/app.js
+++ /dev/null
@@ -1,89 +0,0 @@
-import React from 'react';
-import ReactDOM from 'react-dom';
-import { Tab, Tabs, TabList, TabPanel } from '../../src/main';
-
-const App = React.createClass({
- render() {
- return (
-
-
Hint:
-
-
use keyboard tab to focus tabs
-
use arrow keys to navigate focused tabs
-
-
-
-
- React
- Ember
- Angular
-
-
-
-
Just The UI
-
Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try it out on a small feature in an existing project.
-
-
Virtual DOM
-
React uses a virtual DOM diff implementation for ultra-high performance. It can also render on the server using Node.js â no heavy browser DOM required.
-
-
Data Flow
-
React implements one-way reactive data flow which reduces boilerplate and is easier to reason about than traditional data binding.
Write dramatically less code with Ember's Handlebars integrated templates that update automatically when the underlying data changes.
-
-
Architecture
-
Don't waste time making trivial choices. Ember.js incorporates common idioms so you can focus on what makes your app special, not reinventing the wheel.
-
-
Productivity
-
Ember.js is built for productivity. Designed with developer ergonomics in mind, its friendly APIs help you get your job doneâfast.
HTML is great for declaring static documents, but it falters when we try to use it for declaring dynamic views in web-applications. AngularJS lets you extend HTML vocabulary for your application. The resulting environment is extraordinarily expressive, readable, and quick to develop.
-
-
Alternatives
-
Other frameworks deal with HTMLâs shortcomings by either abstracting away HTML, CSS, and/or JavaScript or by providing an imperative way for manipulating the DOM. Neither of these address the root problem that HTML was not designed for dynamic views.
-
-
Extensibility
-
AngularJS is a toolset for building the framework most suited to your application development. It is fully extensible and works well with other libraries. Every feature can be modified or replaced to suit your unique development workflow and feature needs. Read on to find out how.
Mario (Japanese: ããĒãĒ Hepburn: Mario?) is a fictional character in the Mario video game franchise by Nintendo, created by Japanese video game designer Shigeru Miyamoto. Serving as Nintendo's mascot and the eponymous protagonist of the series, he has a younger brother Luigi. Mario has appeared in over 200 video games since his creation. Depicted as a short, pudgy, Italian plumber who resides in the Mushroom Kingdom, he repeatedly rescues Princess Peach from the Koopa villain Bowser and stops his numerous plans to destroy him and take over the kingdom.
Luigi (Japanese: ãĢã¤ãŧ㸠Hepburn: RuÄĢji?) is a fictional character featured in video games and related media released by Nintendo. Created by prominent game designer Shigeru Miyamoto, Luigi is portrayed as the slightly younger but taller fraternal twin brother of Nintendo's mascot Mario, and appears in many games throughout the Mario franchise, frequently as a sidekick to his brother.
Princess Peach (Japanese: ããŧãå§Ģ Hepburn: PÄĢchi-hime?) is a character in Nintendo's Mario franchise. Originally created by Shigeru Miyamoto, Peach is the princess of the fictional Mushroom Kingdom, which is constantly under attack by Bowser. She often plays the damsel in distress role within the series and is the lead female.[1] She is often portrayed as Mario's love interest and has appeared in nearly all the Mario games to date with the notable exception of Super Princess Peach, where she is the main playable character.
-
-
-
Yoshi (ã¨ããˇãŧ YosshÄĢ?) /ËjoĘĘi/ or /ËjÉĘi/, once romanized as Yossy, is a fictional anthropomorphic dinosaur (referred to as a dragon at times) who appears in video games published by Nintendo. He debuted in Super Mario World (1990) on the Super Nintendo Entertainment System as Mario and Luigi's sidekick (a role he has often reprised), and he later established his own series with several platform and puzzle games, including Super Mario World 2: Yoshi's Island. He has also appeared in many of the spin-off Mario games including the Mario Party, the Mario Kart, and the Super Smash Bros. series, as well as in other various Mario sports titles. Yoshi also appears in New Super Mario Bros. Wii (2009) as the characters' companion and steed, similar to his original debut role in Super Mario World. Yoshi belongs to the species of the same name which comes in various colors, with green being the most common.
+ );
+ }
+}
+
+ExampleItem.propTypes = {
+ label: T.string.isRequired,
+ hint: T.string.isRequired,
+ code: T.string.isRequired,
+};
diff --git a/examples/src/components/examples/Avengers.js b/examples/src/components/examples/Avengers.js
new file mode 100644
index 0000000000..ccb53aa3e3
--- /dev/null
+++ b/examples/src/components/examples/Avengers.js
@@ -0,0 +1,113 @@
+import React from 'react';
+import ExampleItem from '../ExampleItem';
+import antMan from '../../images/ant_man.png';
+import blackWidow from '../../images/black_widow.png';
+import captain from '../../images/captain_america.png';
+import fury from '../../images/fury.png';
+import hawkeye from '../../images/hawkeye.png';
+import ironman from '../../images/ironman.png';
+import loki from '../../images/loki.png';
+import thor from '../../images/thor.png';
+import warMachine from '../../images/war_machine.png';
+
+const code = `class Component extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.characters = [
+ { name: "Ant-Man", img: "${antMan}", color: "IndianRed", text: "white", desc: "\\"I do some dumb things, and the people I love the most...they pay the price.\\"" },
+ { name: "Black Widow", img: "${blackWidow}", color: "SlateGrey", text: "white", desc: "\\"After everything that happened with S.H.I.E.L.D., during my little hiatus, I went back to Russia and tried to find my parents. Two little graves linked by a chain fence. I pulled some weeds and left some flowers. We have what we have when we have it.\\"" },
+ { name: "Captain America", img: "${captain}", color: "RoyalBlue", text: "white", desc: "\\"I'm not looking for forgiveness. And I'm way past asking for permission. Earth just lost their best defender. So we're here to fight. If you wanna stay in our way... we'll fight you, too.\\"" },
+ { name: "Director Fury", img: "${fury}", color: "Sienna", text: "white", desc: "\\"Back in the day, I had eyes everywhere, ears everywhere else. Here we all are, back on earth, with nothing but our wit, and our will to save the world. So stand. Outwit the platinum bastard.\\"" },
+ { name: "Hawkeye", img: "${hawkeye}", color: "MediumOrchid", text: "white", desc: "\\"Just can't seem to miss.\\"" },
+ { name: "Iron Man", img: "${ironman}", color: "LightCoral", text: "black", desc: "\\"My armor was never a distraction or a hobby. It was a cocoon. And now I'm a changed man. You can take away my house, all my tricks and toys. But one thing you can't take away... I am Iron Man.\\"" },
+ { name: "Loki", img: "${loki}", color: "LightGreen", text: "black", desc: "\\"I, Loki, Prince of Asgard, Odinson, the rightful King of Jotunheim, God of Mischief, do hereby pledge to you, my undying fidelity.\\"" },
+ { name: "Thor", img: "${thor}", color: "SkyBlue", text: "black", desc: "\\"You know Iâm 1500 years old. Iâve killed twice as many enemies as that. And every one of them would have rather killed me than not succeeded. Iâm only alive because fate wants me alive. Thanos is just the latest of a long line of bastards, and heâll be the latest to feel my vengeance. Fate wills it so.\\"" },
+ { name: "War Machine", img: "${warMachine}", color: "LightGrey", text: "black", desc: "\\"138 combat missions. That's how many I've flown, Tony. Every one of them could've been my last, but I flew 'em. Because the fight needed to be fought.\\"" }
+ ];
+
+ this.state = {
+ "Ant-Man": true,
+ "Black Widow": true,
+ "Captain America": true,
+ "Director Fury": false,
+ Loki: false,
+ Hawkeye: true,
+ "Iron Man": true,
+ Thor: true,
+ "War Machine": true,
+ selectedIndex: 0
+ };
+
+ this.handleCheckClicked = this.handleCheckClicked.bind(this);
+ }
+
+ handleCheckClicked(e) {
+ const state = {
+ [e.target.name]: e.target.checked
+ };
+ if (this.characters.findIndex(({name}) => name === e.target.name) <= this.state.selectedIndex) {
+ state.selectedIndex = this.state.selectedIndex + (e.target.checked ? 1 : -1);
+ }
+ this.setState(state);
+ }
+
+ render() {
+ const links = [];
+ const tabs = [];
+ const tabPanels = [];
+
+ this.characters.forEach(({ name, img, color: backgroundColor, text: color, desc }) => {
+ links.push(
+
+ );
+
+ if (!this.state[name]) return;
+
+ tabs.push(
+
+
+
+ );
+
+ tabPanels.push(
+
+ {desc}
+
+ );
+ });
+
+ return (
+
+ );
+ }
+}
+
+render(Component);
+`;
+
+const hint =
+ 'This example lets you disable or enable certain Tabs dynamically.';
+
+export default () => (
+
+);
diff --git a/examples/src/components/examples/MattGroening.js b/examples/src/components/examples/MattGroening.js
new file mode 100644
index 0000000000..696b4a0bb3
--- /dev/null
+++ b/examples/src/components/examples/MattGroening.js
@@ -0,0 +1,83 @@
+import React from 'react';
+import ExampleItem from '../ExampleItem';
+
+const code = `const Component = (
+
+
+ The Simpsons
+ Futurama
+
+
+
+
+ Homer Simpson
+ Marge Simpson
+ Bart Simpson
+ Lisa Simpson
+ Maggie Simpson
+
+
+
Husband of Marge; father of Bart, Lisa, and Maggie.
+
+
+
+
Wife of Homer; mother of Bart, Lisa, and Maggie.
+
+
+
+
Oldest child and only son of Homer and Marge; brother of Lisa and Maggie.
+
+
+
+
Middle child and eldest daughter of Homer and Marge; sister of Bart and Maggie.
+
+
+
+
Youngest child and daughter of Homer and Marge; sister of Bart and Lisa.
+
+
+
+
+
+
+
+ Philip J. Fry
+ Turanga Leela
+ Bender Bending Rodriguez
+ Amy Wong
+ Professor Hubert J. Farnsworth
+ Doctor John Zoidberg
+
+
+
Protagonist, from the 20th Century. Delivery boy. Many times great-uncle to Professor Hubert Farnsworth. Suitor of Leela.
+
+
+
+
Mutant cyclops. Captain of the Planet Express Ship. Love interest of Fry.
+
+
+
+
A kleptomaniacal, lazy, cigar-smoking, heavy-drinking robot who is Fry's best friend. Built in Tijuana, Mexico, he is the Planet Express Ship's cook.
+
+
+
+
Chinese-Martian intern at Planet Express. Fonfon Ru of Kif Kroker.
+
+
+
Many times great-nephew of Fry. CEO and owner of Planet Express delivery company. Tenured professor of Mars University.
+
+
+
+
Alien from Decapod 10. Planet Express' staff doctor and steward. Has a medical degree and Ph.D in art history.
+
+
+
+
+
+);
+
+render(Component);`;
+
+const hint = 'Tabs can also be nested within each other and will continue to work individually.';
+
+export default () => ;
diff --git a/examples/src/components/examples/RightToLeft.js b/examples/src/components/examples/RightToLeft.js
new file mode 100644
index 0000000000..bc57372702
--- /dev/null
+++ b/examples/src/components/examples/RightToLeft.js
@@ -0,0 +1,77 @@
+import React from 'react';
+import ExampleItem from '../ExampleItem';
+
+const code = `const Component = (
+
+);
+
+render(Component);`;
+
+const hint =
+ 'This is an example of a right to left option. Just pass the `direction` prop to the element';
+
+export default () => (
+
+);
diff --git a/examples/src/components/examples/SuperMario.js b/examples/src/components/examples/SuperMario.js
new file mode 100644
index 0000000000..e52226a8cd
--- /dev/null
+++ b/examples/src/components/examples/SuperMario.js
@@ -0,0 +1,107 @@
+import React from 'react';
+import ExampleItem from '../ExampleItem';
+
+const code = `const Component = (
+
+
+ Mario
+ Luigi
+ Peach
+ Yoshi
+ Toad
+
+
+
+
+ Mario (Japanese: ããĒãĒ Hepburn: Mario, [ma.ɞʲi.o]) (English:
+ /ËmÉËrioĘ/; Italian: [ËmaËrjo]) is a fictional character in the Mario video
+ game franchise, owned by Nintendo and created by Japanese video game designer
+ Shigeru Miyamoto. Serving as the company's mascot and the eponymous protagonist
+ of the series, Mario has appeared in over 200 video games since his creation.
+ Depicted as a short, pudgy, Italian plumber who resides in the Mushroom
+ Kingdom, his adventures generally center upon rescuing Princess Peach from the
+ Koopa villain Bowser. His younger brother and sidekick is Luigi.
+
+ Luigi (Japanese: ãĢã¤ãŧ㸠Hepburn: RuÄĢji, [ɞɯ.iË.dĘiĖĨ]) (English: /luËiËdĘi/;
+ Italian: [luËiËdĘi]) is a fictional character featured in video games and related media
+ released by Nintendo. Created by prominent game designer Shigeru Miyamoto, Luigi is portrayed
+ as the slightly younger but taller fraternal twin brother of Nintendo's mascot Mario, and
+ appears in many games throughout the Mario franchise, often as a sidekick to his brother.
+
+ Princess Peach (Japanese: ããŧãå§Ģ Hepburn: PÄĢchi-hime, [piË.tÉiĖĨ çiĖĨ.me])
+ is a character in Nintendo's Mario franchise. Originally created by Shigeru Miyamoto,
+ Peach is the princess of the fictional Mushroom Kingdom, which is constantly under
+ attack by Bowser. She often plays the damsel in distress role within the series and
+ is the lead female. She is often portrayed as Mario's love interest and has appeared
+ in Super Princess Peach, where she is the main playable character.
+
+ Yoshi (ã¨ããˇãŧ YosshÄĢ, [joÉ.ÉiË]) (English: /ËjoĘĘi/ or /ËjÉĘi/), once
+ romanized as Yossy, is a fictional anthropomorphic dinosaur who appears in
+ video games published by Nintendo. Yoshi debuted in Super Mario World (1990) on the
+ Super Nintendo Entertainment System as Mario and Luigi's sidekick. Yoshi later starred
+ in platform and puzzle games, including Super Mario World 2: Yoshi's Island, Yoshi's Story
+ and Yoshi's Woolly World. Yoshi also appears in many of the Mario spin-off games, including
+ Mario Party and Mario Kart, various Mario sports games, and Nintendo's crossover fighting
+ game series Super Smash Bros. Yoshi belongs to the species of the same name, which is
+ characterized by their variety of colors.
+
+ Toad (Japanese: ããããĒ Hepburn: Kinopio) is a fictional character who primarily
+ appears in Nintendo's Mario franchise. Created by Japanese video game designer Shigeru Miyamoto,
+ he is portrayed as a citizen of the Mushroom Kingdom and is one of Princess Peach's most loyal
+ attendants; constantly working on her behalf. He is usually seen as a non-player character (NPC)
+ who provides assistance to Mario and his friends in most games, but there are times when Toad(s)
+ takes center stage and appears as a protagonist, as seen in Super Mario Bros. 2, Wario's Woods,
+ Super Mario 3D World, and Captain Toad: Treasure Tracker.
+
+`;
+
+exports[` > should accept className 1`] = `
+
+`;
+
+exports[` > should allow to be wrapped in higher-order-component 1`] = `
+
+`;
+
+exports[` > should have sane defaults 1`] = `
+
+`;
+
+exports[` > should not allow overriding all default properties 1`] = `
+
+`;
+
+exports[` > should pass through custom properties 1`] = `
+
+`;
+
+exports[` > should support being disabled 1`] = `
+
+`;
+
+exports[` > should support being disabled with custom class name 1`] = `
+
+`;
+
+exports[` > should support being selected 1`] = `
+
+ Hello
+
+`;
+
+exports[` > should support being selected with custom class 1`] = `
+
+`;
diff --git a/src/components/__tests__/__snapshots__/TabList-test.jsx.snap b/src/components/__tests__/__snapshots__/TabList-test.jsx.snap
new file mode 100644
index 0000000000..c39e9c2525
--- /dev/null
+++ b/src/components/__tests__/__snapshots__/TabList-test.jsx.snap
@@ -0,0 +1,230 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[` > should accept className 1`] = `
+
+`;
+
+exports[` > should allow for higher order components 1`] = `
+
+
+
+ Foo
+
+
+ Bar
+
+
+
+ Foo
+
+
+
+`;
+
+exports[` > should display the custom classnames for selected and disabled tab 1`] = `
+
+
+
+ Foo
+
+
+ Bar
+
+
+
+ Foo
+
+
+
+`;
+
+exports[` > should display the custom classnames for selected and disabled tab specified on tabs 1`] = `
+
+
+
+ Foo
+
+
+ Bar
+
+
+
+ Foo
+
+
+
+`;
+
+exports[` > should have sane defaults 1`] = `
+
+`;
+
+exports[` > should not allow overriding all default properties 1`] = `
+
+`;
+
+exports[` > should pass through custom properties 1`] = `
+
+`;
+
+exports[` > should retain the default classnames for active and disabled tab 1`] = `
+
+
+
+ Foo
+
+
+ Bar
+
+
+
+ Foo
+
+
+
+`;
diff --git a/src/components/__tests__/__snapshots__/TabPanel-test.jsx.snap b/src/components/__tests__/__snapshots__/TabPanel-test.jsx.snap
new file mode 100644
index 0000000000..3f28f5ba10
--- /dev/null
+++ b/src/components/__tests__/__snapshots__/TabPanel-test.jsx.snap
@@ -0,0 +1,91 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[` > should accept className 1`] = `
+
+`;
+
+exports[` > should allow for higher-order components 1`] = `
+
+`;
+
+exports[` > should have sane defaults 1`] = `
+
+`;
+
+exports[` > should not allow overriding all default properties 1`] = `
+
+`;
+
+exports[` > should pass through custom properties 1`] = `
+
+`;
+
+exports[` > should render when forced 1`] = `
+
+ Hola
+
+`;
+
+exports[` > should render when selected 1`] = `
+
+ Hola
+
+`;
+
+exports[` > should support being selected 1`] = `
+
+ Hola
+
+`;
+
+exports[` > should support being selected with custom class name 1`] = `
+
+ Hola
+
+`;
diff --git a/src/components/__tests__/__snapshots__/Tabs-test.jsx.snap b/src/components/__tests__/__snapshots__/Tabs-test.jsx.snap
new file mode 100644
index 0000000000..25f05c1ccc
--- /dev/null
+++ b/src/components/__tests__/__snapshots__/Tabs-test.jsx.snap
@@ -0,0 +1,804 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[` > performance > should render all tabs if forceRenderTabPanel is true 1`] = `
+
+`;
+
+exports[` > should allow for higher order components 1`] = `
+
+
+
+ Foo
+
+
+ Bar
+
+
+
+ Foo
+
+
+
+`;
+
+exports[` > should allow string children 1`] = `
+
+ Foo
+
+ Foo
+
+ Foo
+
+ Foo
+
+ Bar
+
+ Foo
+
+
+ Bar
+
+
+ Foo
+
+`;
+
+exports[` > should not add known props to dom 1`] = `
+
+`;
+
+exports[` > should pass through custom properties 1`] = `
+
+`;
+
+exports[` > validation > should allow other DOM nodes 1`] = `
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+`;
+
+exports[` > validation > should allow random order for elements 1`] = `
+
+
+ Hello Foo
+
+
+
+ Foo
+
+
+ Bar
+
+
+
+ Hello Bar
+
+
+`;
+
+exports[` > validation > should be okay with rendering just TabList 1`] = `
+
+
+
+`;
+
+exports[` > validation > should be okay with rendering without any children 1`] = `
+
+`;
+
+exports[` > validation > should gracefully render null 1`] = `
+
+
+
+ Tab A
+
+
+
+ Content A
+
+
+`;
+
+exports[` > validation > should not throw a warning when wrong element is found 1`] = `
+