diff --git a/.yarn/cache/@rollup-plugin-replace-npm-4.0.0-4c483d297f-b61701e612.zip b/.yarn/cache/@rollup-plugin-replace-npm-4.0.0-4c483d297f-b61701e612.zip
deleted file mode 100644
index d99a173485bf..000000000000
Binary files a/.yarn/cache/@rollup-plugin-replace-npm-4.0.0-4c483d297f-b61701e612.zip and /dev/null differ
diff --git a/.yarn/cache/@rollup-plugin-replace-npm-5.0.1-681fe3a569-d5f98a93dd.zip b/.yarn/cache/@rollup-plugin-replace-npm-5.0.1-681fe3a569-d5f98a93dd.zip
new file mode 100644
index 000000000000..964effd4678e
Binary files /dev/null and b/.yarn/cache/@rollup-plugin-replace-npm-5.0.1-681fe3a569-d5f98a93dd.zip differ
diff --git a/.yarn/cache/@rollup-pluginutils-npm-5.0.2-6aa9d0ddd4-edea15e543.zip b/.yarn/cache/@rollup-pluginutils-npm-5.0.2-6aa9d0ddd4-edea15e543.zip
new file mode 100644
index 000000000000..d898c5035c87
Binary files /dev/null and b/.yarn/cache/@rollup-pluginutils-npm-5.0.2-6aa9d0ddd4-edea15e543.zip differ
diff --git a/.yarn/cache/@types-estree-npm-1.0.0-eddde5b631-910d97fb70.zip b/.yarn/cache/@types-estree-npm-1.0.0-eddde5b631-910d97fb70.zip
new file mode 100644
index 000000000000..8b03b040a651
Binary files /dev/null and b/.yarn/cache/@types-estree-npm-1.0.0-eddde5b631-910d97fb70.zip differ
diff --git a/.yarn/cache/@types-prop-types-npm-15.7.4-592896a9fe-ef6e1899e5.zip b/.yarn/cache/@types-prop-types-npm-15.7.4-592896a9fe-ef6e1899e5.zip
deleted file mode 100644
index 482f0927eec8..000000000000
Binary files a/.yarn/cache/@types-prop-types-npm-15.7.4-592896a9fe-ef6e1899e5.zip and /dev/null differ
diff --git a/.yarn/cache/@types-prop-types-npm-15.7.5-2aa48aa177-5b43b8b154.zip b/.yarn/cache/@types-prop-types-npm-15.7.5-2aa48aa177-5b43b8b154.zip
new file mode 100644
index 000000000000..38bb2b470787
Binary files /dev/null and b/.yarn/cache/@types-prop-types-npm-15.7.5-2aa48aa177-5b43b8b154.zip differ
diff --git a/.yarn/cache/magic-string-npm-0.26.7-07281acc06-89b0d60cbb.zip b/.yarn/cache/magic-string-npm-0.26.7-07281acc06-89b0d60cbb.zip
new file mode 100644
index 000000000000..483252326cb9
Binary files /dev/null and b/.yarn/cache/magic-string-npm-0.26.7-07281acc06-89b0d60cbb.zip differ
diff --git a/config/eslint-config-carbon/package.json b/config/eslint-config-carbon/package.json
index 0d25d634b0d8..825b24c8cebf 100644
--- a/config/eslint-config-carbon/package.json
+++ b/config/eslint-config-carbon/package.json
@@ -1,7 +1,7 @@
{
"name": "eslint-config-carbon",
"description": "ESLint configuration for Carbon",
- "version": "2.18.0-rc.0",
+ "version": "2.18.0",
"license": "Apache-2.0",
"main": "index.js",
"repository": {
diff --git a/config/jest-config-carbon/package.json b/config/jest-config-carbon/package.json
index c64b20d37c35..8340250729c1 100644
--- a/config/jest-config-carbon/package.json
+++ b/config/jest-config-carbon/package.json
@@ -2,7 +2,7 @@
"name": "jest-config-carbon",
"private": true,
"description": "Jest configuration and preset for Carbon",
- "version": "1.5.0-rc.0",
+ "version": "1.5.0",
"license": "Apache-2.0",
"main": "index.js",
"repository": {
diff --git a/docs/guides/adding-component-types.md b/docs/guides/adding-component-types.md
new file mode 100644
index 000000000000..1d8e679628de
--- /dev/null
+++ b/docs/guides/adding-component-types.md
@@ -0,0 +1,150 @@
+# Adding component types
+
+This document lays out the goal, strategy, and guidelines for adding
+[TypeScript](https://www.TypeScriptlang.org/) types for components within
+`@carbon/react`.
+
+
+
+
+## Table of Contents
+
+- [Goal](#goal)
+ - [Purpose](#purpose)
+- [Strategy](#strategy)
+ - [Steps to provide baseline type definitions for components](#steps-to-provide-baseline-type-definitions-for-components)
+- [FAQ](#faq)
+ - [How do I know what's part of the public api?](#how-do-i-know-whats-part-of-the-public-api)
+ - [Should components have both prototypes and ts interface?](#should-components-have-both-prototypes-and-ts-interface)
+ - [Should comment docs be duplicated into the ts interface?](#should-comment-docs-be-duplicated-into-the-ts-interface)
+ - [Where should I put the ts interface in the file?](#where-should-i-put-the-ts-interface-in-the-file)
+
+
+
+
+## Goal
+
+The goal of this workstream is to provide as much downstream value to consumers
+who are using TypeScript, as quickly as possible, while writing the least amount
+of TypeScript.
+
+The goal is _not_ to convert the entire codebase to TypeScript right now.
+
+### Purpose
+
+By adding TypeScript types to components we anticipate a number of benefits:
+
+- Developer productivity will increase due to Component API's being
+ self-documenting and providing tight integration with code editor
+ intellisense.
+- The qualtiy of products developed will increase due to more stable, correct,
+ and thorough component API typings provided first-party through
+ `@carbon/react` itself.
+- Maintenance of the types themselves will be simplified by not having to go
+ through the DefinitelyTyped contribution process/system.
+
+Despite these benefits, adding TypeScript to the codebase is still a large shift
+for the developer community surrounding the Carbon Design System. Most projects
+are not using TypeScript, and contributors are more likely to not have in-depth
+knowledge of TypeScript.
+
+The bar to contribute to Carbon should be as low as possible to facilitate
+experimentation, innovation, and progress within the system. Adding TypeScript
+raises this bar of contribution adding additional friction to even the smallest
+of pull requests.
+
+We believe the majority of the benefits of TypeScript can be provided to
+consumers without needing to convert the entire codebase to use TypeScript.
+Overall, this effort will be focused on limiting the amount of TypeScript within
+the repository for now.
+
+## Strategy
+
+TypeScript will be incrementally adopted, focusing first on adding types to
+components prop APIs that are included as part of the public API of
+`@carbon/react`.
+
+Internal components, helpers, function, etc. will not initially be typed. These
+internal files/components not included in the public API should be left as
+`.js`, given a
+[jsdoc type annotation](https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#providing-type-hints-in-js-via-jsdoc)
+of `/** @type any */`, and
+[errors should be enabled](https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#ts-check)
+by adding `// @ts-check` to the first line in the file.
+
+Other packages, such as `@carbon/icons-react`, `@carbon/elements`, etc will not
+initially be typed.
+
+Within this incremental adoption strategy, **for now types will not be bound to
+semver**.
+
+This means that types are provided on an as-is basis. Ideally types will be
+stable and not ship breaking changes, but the reality is typings may at times be
+incorrect, outdated, or missing. Full details available within our
+[versioning documentation](https://github.com/carbon-design-system/carbon/blob/main/docs/guides/versioning.md#a-change-is-made-to-component-typingsdefinitions).
+
+### Steps to provide baseline type definitions for components
+
+Below is a general outline of what needs to be done for each component within
+the repository. There is an issue tracking curring status of this effort,
+[#12513](https://github.com/carbon-design-system/carbon/issues/12513)
+
+- Change extension to `.tsx`
+- Copying the proptypes def to above the component definition
+- Retool the proptypes to be a ts interface
+- Fix errors as they appear
+- Do not add types to internal components or functions that are not exported as
+ part of the Public API.
+
+ - Leave internals as `.js`
+ - Add a
+ [jsdoc type annotation](https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#providing-type-hints-in-js-via-jsdoc)
+ of `/** @type any */`
+ - [Enable errors](https://www.typescriptlang.org/docs/handbook/intro-to-js-ts.html#ts-check)
+ by adding `// @ts-check` to the first line in the file.
+
+- Test your changes - there are a few options here:
+ - At the bottom of a file, write a dummy component that uses the component
+ that you’re converting to ensure that you can still pass all appropriate
+ props that you need to.
+ - Take a storybook example for a component, copy and paste it into the bottom
+ of the .tsx file and validate whether or not it accepts the props as you’ve
+ defined them
+- Submit a pull request for the changes
+ - Please keep pull requests as small as possible
+ - Avoid adding additional components to a single PR unless necessary
+ - [Link to close the related issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword#linking-a-pull-request-to-an-issue-using-a-keyword),
+ e.g. `Closes #12513`
+- Ask questions if you get stuck!
+ - The team is available on slack
+ [`#carbon-wg-typescript`](https://ibm-studios.slack.com/archives/C03C8VASVED),
+ [discord](https://discord.gg/J7JEUEkTRX), or on
+ [the issue itself](https://github.com/carbon-design-system/carbon/issues/12513).
+
+## FAQ
+
+### How do I know what's part of the public api?
+
+- If it's not on [the storybook](https://react.carbondesignsystem.com), it's
+ probably not public.
+- The entire Public API is snapshotted, you can
+ [search the snapshot here](https://github.com/carbon-design-system/carbon/blob/main/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap).
+ If it's not included there, it's not part of the public API.
+
+### Should components have both prototypes and ts interface?
+
+- Yes
+
+### Should comment docs be duplicated into the ts interface?
+
+- Yes
+ - Duplicate comments between the proptypes definition and ts interface
+ - Storybook prefers react-docgen for now
+ - Once we have ts interfaces for everything we can switch out the storybook
+ config to favor TypeScript docs
+
+### Where should I put the ts interface in the file?
+
+- Above the component definition (likely the top of the file)
+ - The component implementation should be sandwiched inbetween the ts interface
+ and the proptypes definition
diff --git a/docs/guides/versioning.md b/docs/guides/versioning.md
index 4f8721b4fd36..71f238180065 100644
--- a/docs/guides/versioning.md
+++ b/docs/guides/versioning.md
@@ -6,9 +6,10 @@
## Table of Contents
- [Overview](#overview)
-- [`carbon-components-react`](#carbon-components-react)
+- [`carbon-components-react`, `@carbon/react`](#carbon-components-react-carbonreact)
- [Changes](#changes)
- [Examples](#examples)
+ - [A change is made to component typings/definitions](#a-change-is-made-to-component-typingsdefinitions)
- [A new prop is added to a component](#a-new-prop-is-added-to-a-component)
- [An existing prop is deprecated](#an-existing-prop-is-deprecated)
- [An existing prop is removed](#an-existing-prop-is-removed)
@@ -17,6 +18,8 @@
- [A `PropTypes.func` prop type is changed to have different arguments](#a-proptypesfunc-prop-type-is-changed-to-have-different-arguments)
- [A `PropTypes.func` prop type is changed to have additional arguments](#a-proptypesfunc-prop-type-is-changed-to-have-additional-arguments)
- [A `PropTypes.func` prop type is changed to have fewer arguments](#a-proptypesfunc-prop-type-is-changed-to-have-fewer-arguments)
+ - [The DOM node that an `id` corresponds to is changed](#the-dom-node-that-an-id-corresponds-to-is-changed)
+ - [The DOM node that an `aria-label` corresponds to is changed](#the-dom-node-that-an-aria-label-corresponds-to-is-changed)
diff --git a/e2e/components/FluidDatePicker/FluidDatePicker-test.e2e.js b/e2e/components/FluidDatePicker/FluidDatePicker-test.e2e.js
new file mode 100644
index 000000000000..558358d080c1
--- /dev/null
+++ b/e2e/components/FluidDatePicker/FluidDatePicker-test.e2e.js
@@ -0,0 +1,67 @@
+/**
+ * Copyright IBM Corp. 2022
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+'use strict';
+
+const { expect, test } = require('@playwright/test');
+const { themes } = require('../../test-utils/env');
+const { snapshotStory, visitStory } = require('../../test-utils/storybook');
+
+test.describe('FluidDatePicker', () => {
+ themes.forEach((theme) => {
+ test.describe(theme, () => {
+ test('fluid date picker (range) @vrt', async ({ page }) => {
+ await snapshotStory(page, {
+ component: 'FluidDatePicker',
+ id: 'experimental-unstable-fluiddatepicker--range-with-calendar',
+ theme,
+ });
+ });
+
+ test('fluid date picker (single) @vrt', async ({ page }) => {
+ await snapshotStory(page, {
+ component: 'FluidDatePicker',
+ id: 'experimental-unstable-fluiddatepicker--single',
+ theme,
+ });
+ });
+
+ test('fluid date picker (simple) @vrt', async ({ page }) => {
+ await snapshotStory(page, {
+ component: 'FluidDatePicker',
+ id: 'experimental-unstable-fluiddatepicker--simple',
+ theme,
+ });
+ });
+ });
+ });
+
+ test('accessibility-checker @avt', async ({ page }) => {
+ await visitStory(page, {
+ component: 'FluidDatePicker',
+ id: 'experimental-unstable-fluiddatepicker--range-with-calendar',
+ globals: {
+ theme: 'white',
+ },
+ });
+ await visitStory(page, {
+ component: 'FluidDatePicker',
+ id: 'experimental-unstable-fluiddatepicker--single',
+ globals: {
+ theme: 'white',
+ },
+ });
+ await visitStory(page, {
+ component: 'FluidDatePicker',
+ id: 'experimental-unstable-fluiddatepicker--simple',
+ globals: {
+ theme: 'white',
+ },
+ });
+ await expect(page).toHaveNoACViolations('FluidDatePicker');
+ });
+});
diff --git a/examples/codesandbox-styles/package.json b/examples/codesandbox-styles/package.json
index 5874dd497917..f44e54b7fda9 100644
--- a/examples/codesandbox-styles/package.json
+++ b/examples/codesandbox-styles/package.json
@@ -1,7 +1,7 @@
{
"name": "codesandbox-styles",
"private": true,
- "version": "0.20.0-rc.1",
+ "version": "0.20.0",
"scripts": {
"develop": "vite"
},
@@ -9,7 +9,7 @@
"vite": "^2.8.0"
},
"dependencies": {
- "@carbon/styles": "^1.17.0-rc.1",
+ "@carbon/styles": "^1.17.0",
"sass": "^1.51.0"
}
}
diff --git a/examples/codesandbox-with-sass-compilation/package.json b/examples/codesandbox-with-sass-compilation/package.json
index b3ad27d6bfa7..5a17cf6731f8 100644
--- a/examples/codesandbox-with-sass-compilation/package.json
+++ b/examples/codesandbox-with-sass-compilation/package.json
@@ -1,9 +1,9 @@
{
"name": "codesandbox-with-sass-compilation",
- "version": "0.18.0-rc.1",
+ "version": "0.18.0",
"private": true,
"dependencies": {
- "@carbon/react": "^1.17.0-rc.1",
+ "@carbon/react": "^1.17.0",
"react": "^17.0.0",
"react-dom": "^17.0.0"
},
diff --git a/examples/codesandbox/package.json b/examples/codesandbox/package.json
index 507f322f9d44..1594979554b4 100644
--- a/examples/codesandbox/package.json
+++ b/examples/codesandbox/package.json
@@ -1,9 +1,9 @@
{
"name": "codesandbox",
- "version": "0.18.0-rc.1",
+ "version": "0.18.0",
"private": true,
"dependencies": {
- "@carbon/react": "^1.17.0-rc.1",
+ "@carbon/react": "^1.17.0",
"react": "^17.0.0",
"react-dom": "^17.0.0"
},
diff --git a/examples/custom-theme/package.json b/examples/custom-theme/package.json
index a61a1db719a8..24cbc1900c39 100644
--- a/examples/custom-theme/package.json
+++ b/examples/custom-theme/package.json
@@ -1,14 +1,14 @@
{
"name": "custom-theme",
"private": true,
- "version": "0.15.0-rc.1",
+ "version": "0.15.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
- "@carbon/react": "^1.17.0-rc.1",
+ "@carbon/react": "^1.17.0",
"react": "^17.0.0",
"react-dom": "^17.0.0"
},
diff --git a/examples/incremental-migration/package.json b/examples/incremental-migration/package.json
index ed67f67e2a59..71ab729c0287 100644
--- a/examples/incremental-migration/package.json
+++ b/examples/incremental-migration/package.json
@@ -1,7 +1,7 @@
{
"name": "incremental-migration",
"private": true,
- "version": "0.17.0-rc.1",
+ "version": "0.17.0",
"scripts": {
"build": "next build",
"dev": "next dev",
@@ -13,7 +13,7 @@
},
"dependencies": {
"@carbon/icons-react": "^10.49.0",
- "@carbon/react": "^1.17.0-rc.1",
+ "@carbon/react": "^1.17.0",
"carbon-components": "^10.57.0",
"carbon-components-react": "^7.57.0",
"carbon-icons": "^7.0.7",
diff --git a/examples/light-dark-mode/package.json b/examples/light-dark-mode/package.json
index 00efffa95cc4..c2baaa5a8169 100644
--- a/examples/light-dark-mode/package.json
+++ b/examples/light-dark-mode/package.json
@@ -1,7 +1,7 @@
{
"name": "examples-light-dark",
"private": true,
- "version": "0.15.0-rc.1",
+ "version": "0.15.0",
"scripts": {
"build": "next build",
"dev": "next dev",
@@ -9,7 +9,7 @@
"start": "next start"
},
"dependencies": {
- "@carbon/react": "^1.17.0-rc.1",
+ "@carbon/react": "^1.17.0",
"next": "12.1.4",
"react": "18.0.0",
"react-dom": "18.0.0"
diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json
index 53f3f0739a20..ecc6c43af342 100644
--- a/examples/nextjs/package.json
+++ b/examples/nextjs/package.json
@@ -1,7 +1,7 @@
{
"name": "examples-nextjs",
"private": true,
- "version": "0.17.0-rc.1",
+ "version": "0.17.0",
"scripts": {
"build": "next build",
"dev": "next dev",
@@ -9,7 +9,7 @@
"start": "next start"
},
"dependencies": {
- "@carbon/react": "^1.17.0-rc.1",
+ "@carbon/react": "^1.17.0",
"next": "12.1.4",
"react": "18.0.0",
"react-dom": "18.0.0"
diff --git a/examples/vite/package.json b/examples/vite/package.json
index 55fd1ef5ef5f..7033bc8ee78f 100644
--- a/examples/vite/package.json
+++ b/examples/vite/package.json
@@ -1,14 +1,14 @@
{
"name": "vite",
"private": true,
- "version": "0.15.0-rc.1",
+ "version": "0.15.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
- "@carbon/react": "^1.17.0-rc.1",
+ "@carbon/react": "^1.17.0",
"react": "^17.0.0",
"react-dom": "^17.0.0"
},
diff --git a/package.json b/package.json
index 0a13e7bf479b..b0f5098e62a0 100644
--- a/package.json
+++ b/package.json
@@ -30,7 +30,7 @@
},
"resolutions": {
"@types/react": "~17.0.2",
- "@types/prop-types": "15.7.4",
+ "@types/prop-types": "15.7.5",
"ast-types": "^0.14.0",
"node-sass": "^6.0.0",
"react": "~17.0.2",
diff --git a/packages/carbon-components-react/package.json b/packages/carbon-components-react/package.json
index d00113a6dcd6..d1f47094ccf4 100644
--- a/packages/carbon-components-react/package.json
+++ b/packages/carbon-components-react/package.json
@@ -1,7 +1,7 @@
{
"name": "carbon-components-react",
"description": "The Carbon Design System is IBM’s open-source design system for products and experiences.",
- "version": "8.17.0-rc.1",
+ "version": "8.17.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
@@ -39,8 +39,8 @@
"sass": "^1.33.0"
},
"dependencies": {
- "@carbon/react": "^1.17.0-rc.1",
- "@carbon/styles": "^1.17.0-rc.1",
+ "@carbon/react": "^1.17.0",
+ "@carbon/styles": "^1.17.0",
"@carbon/telemetry": "0.1.0"
},
"devDependencies": {
diff --git a/packages/carbon-components-react/scss/components/fluid-date-picker/_fluid-date-picker.scss b/packages/carbon-components-react/scss/components/fluid-date-picker/_fluid-date-picker.scss
new file mode 100644
index 000000000000..48feea2e339c
--- /dev/null
+++ b/packages/carbon-components-react/scss/components/fluid-date-picker/_fluid-date-picker.scss
@@ -0,0 +1,9 @@
+// Code generated by carbon-components-react. DO NOT EDIT.
+//
+// Copyright IBM Corp. 2018, 2018
+//
+// This source code is licensed under the Apache-2.0 license found in the
+// LICENSE file in the root directory of this source tree.
+//
+
+@forward '@carbon/styles/scss/components/fluid-date-picker/fluid-date-picker';
diff --git a/packages/carbon-components-react/scss/components/fluid-date-picker/_index.scss b/packages/carbon-components-react/scss/components/fluid-date-picker/_index.scss
new file mode 100644
index 000000000000..3f06534772d3
--- /dev/null
+++ b/packages/carbon-components-react/scss/components/fluid-date-picker/_index.scss
@@ -0,0 +1,9 @@
+// Code generated by carbon-components-react. DO NOT EDIT.
+//
+// Copyright IBM Corp. 2018, 2018
+//
+// This source code is licensed under the Apache-2.0 license found in the
+// LICENSE file in the root directory of this source tree.
+//
+
+@forward '@carbon/styles/scss/components/fluid-date-picker';
diff --git a/packages/carbon-components/package.json b/packages/carbon-components/package.json
index 72ff93c7330f..09b8098a39fd 100644
--- a/packages/carbon-components/package.json
+++ b/packages/carbon-components/package.json
@@ -1,7 +1,7 @@
{
"name": "carbon-components",
"description": "The Carbon Design System is IBM’s open-source design system for products and experiences.",
- "version": "11.17.0-rc.1",
+ "version": "11.17.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
@@ -40,7 +40,7 @@
"sass": "^1.33.0"
},
"dependencies": {
- "@carbon/styles": "^1.17.0-rc.1",
+ "@carbon/styles": "^1.17.0",
"@carbon/telemetry": "0.1.0"
},
"devDependencies": {
diff --git a/packages/carbon-components/scss/components/fluid-date-picker/_fluid-date-picker.scss b/packages/carbon-components/scss/components/fluid-date-picker/_fluid-date-picker.scss
new file mode 100644
index 000000000000..64deceede606
--- /dev/null
+++ b/packages/carbon-components/scss/components/fluid-date-picker/_fluid-date-picker.scss
@@ -0,0 +1,9 @@
+// Code generated by carbon-components. DO NOT EDIT.
+//
+// Copyright IBM Corp. 2018, 2018
+//
+// This source code is licensed under the Apache-2.0 license found in the
+// LICENSE file in the root directory of this source tree.
+//
+
+@forward '@carbon/styles/scss/components/fluid-date-picker/fluid-date-picker';
diff --git a/packages/carbon-components/scss/components/fluid-date-picker/_index.scss b/packages/carbon-components/scss/components/fluid-date-picker/_index.scss
new file mode 100644
index 000000000000..489faea12362
--- /dev/null
+++ b/packages/carbon-components/scss/components/fluid-date-picker/_index.scss
@@ -0,0 +1,9 @@
+// Code generated by carbon-components. DO NOT EDIT.
+//
+// Copyright IBM Corp. 2018, 2018
+//
+// This source code is licensed under the Apache-2.0 license found in the
+// LICENSE file in the root directory of this source tree.
+//
+
+@forward '@carbon/styles/scss/components/fluid-date-picker';
diff --git a/packages/colors/package.json b/packages/colors/package.json
index 6d3c0ede9f24..fc133d1209ec 100644
--- a/packages/colors/package.json
+++ b/packages/colors/package.json
@@ -1,7 +1,7 @@
{
"name": "@carbon/colors",
"description": "Colors for digital and software products using the Carbon Design System",
- "version": "11.7.1-rc.0",
+ "version": "11.8.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
diff --git a/packages/elements/package.json b/packages/elements/package.json
index 0e72cb9e766f..0081444157de 100644
--- a/packages/elements/package.json
+++ b/packages/elements/package.json
@@ -1,7 +1,7 @@
{
"name": "@carbon/elements",
"description": "A collection of design elements in code for the IBM Design Language",
- "version": "11.13.1-rc.0",
+ "version": "11.14.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
@@ -35,12 +35,12 @@
"clean": "rimraf es lib umd"
},
"dependencies": {
- "@carbon/colors": "^11.7.1-rc.0",
+ "@carbon/colors": "^11.8.0",
"@carbon/grid": "^11.7.0",
- "@carbon/icons": "^11.10.0",
+ "@carbon/icons": "^11.11.0",
"@carbon/layout": "^11.7.0",
"@carbon/motion": "^11.5.0",
- "@carbon/themes": "^11.11.1-rc.0",
+ "@carbon/themes": "^11.12.0",
"@carbon/type": "^11.11.0"
},
"devDependencies": {
diff --git a/packages/icon-build-helpers/package.json b/packages/icon-build-helpers/package.json
index 9af27fa42a29..696f7b539f1b 100644
--- a/packages/icon-build-helpers/package.json
+++ b/packages/icon-build-helpers/package.json
@@ -2,7 +2,7 @@
"name": "@carbon/icon-build-helpers",
"private": true,
"description": "Build helpers for the Carbon Design System icon library",
- "version": "1.5.0",
+ "version": "1.6.0",
"license": "Apache-2.0",
"main": "src/index.js",
"repository": {
@@ -31,7 +31,7 @@
"@carbon/cli-reporter": "^10.5.0",
"@carbon/icon-helpers": "^10.34.0",
"@rollup/plugin-babel": "^5.3.0",
- "@rollup/plugin-replace": "^4.0.0",
+ "@rollup/plugin-replace": "^5.0.0",
"browserslist-config-carbon": "^11.0.0",
"change-case": "^4.1.1",
"core-js": "^3.16.0",
diff --git a/packages/icons-react/package.json b/packages/icons-react/package.json
index 590300755b1b..f8a90fbfe47e 100644
--- a/packages/icons-react/package.json
+++ b/packages/icons-react/package.json
@@ -1,7 +1,7 @@
{
"name": "@carbon/icons-react",
"description": "React components for icons in digital and software products using the Carbon Design System",
- "version": "11.10.0",
+ "version": "11.11.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
@@ -41,8 +41,8 @@
"prop-types": "^15.7.2"
},
"devDependencies": {
- "@carbon/icon-build-helpers": "^1.5.0",
- "@carbon/icons": "^11.10.0",
+ "@carbon/icon-build-helpers": "^1.6.0",
+ "@carbon/icons": "^11.11.0",
"rimraf": "^3.0.2"
},
"sideEffects": false
diff --git a/packages/icons-vue/package.json b/packages/icons-vue/package.json
index 0046ca76b5cc..f79848e14f7f 100644
--- a/packages/icons-vue/package.json
+++ b/packages/icons-vue/package.json
@@ -1,7 +1,7 @@
{
"name": "@carbon/icons-vue",
"description": "Vue components for icons in digital and software products using the Carbon Design System",
- "version": "10.59.0",
+ "version": "10.60.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
@@ -32,7 +32,7 @@
},
"devDependencies": {
"@carbon/cli-reporter": "^10.5.0",
- "@carbon/icons": "^11.10.0",
+ "@carbon/icons": "^11.11.0",
"fs-extra": "^10.0.0",
"prettier": "^2.7.1",
"rimraf": "^3.0.0",
diff --git a/packages/icons/examples/preview/.yarn/install-state.gz b/packages/icons/examples/preview/.yarn/install-state.gz
new file mode 100644
index 000000000000..0679070d1784
Binary files /dev/null and b/packages/icons/examples/preview/.yarn/install-state.gz differ
diff --git a/packages/icons/examples/preview/yarn.lock b/packages/icons/examples/preview/yarn.lock
index 59891eeb9fd8..72c4fc4a1cb6 100644
--- a/packages/icons/examples/preview/yarn.lock
+++ b/packages/icons/examples/preview/yarn.lock
@@ -4271,13 +4271,13 @@ fsevents@~2.3.2:
linkType: hard
"loader-utils@npm:^1.1.0":
- version: 1.4.0
- resolution: "loader-utils@npm:1.4.0"
+ version: 1.4.1
+ resolution: "loader-utils@npm:1.4.1"
dependencies:
big.js: ^5.2.2
emojis-list: ^3.0.0
json5: ^1.0.1
- checksum: d150b15e7a42ac47d935c8b484b79e44ff6ab4c75df7cc4cb9093350cf014ec0b17bdb60c5d6f91a37b8b218bd63b973e263c65944f58ca2573e402b9a27e717
+ checksum: ea0b648cba0194e04a90aab6270619f0e35be009e33a443d9e642e93056cd49e6ca4c9678bd1c777a2392551bc5f4d0f24a87f5040608da1274aa84c6eebb502
languageName: node
linkType: hard
diff --git a/packages/icons/package.json b/packages/icons/package.json
index 13285f169fce..8dd265ef3fca 100644
--- a/packages/icons/package.json
+++ b/packages/icons/package.json
@@ -1,7 +1,7 @@
{
"name": "@carbon/icons",
"description": "Icons for digital and software products using the Carbon Design System",
- "version": "11.10.0",
+ "version": "11.11.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
@@ -39,7 +39,7 @@
},
"devDependencies": {
"@carbon/cli": "^11.5.0",
- "@carbon/icon-build-helpers": "^1.5.0",
+ "@carbon/icon-build-helpers": "^1.6.0",
"rimraf": "^3.0.2"
}
}
diff --git a/packages/layout/examples/preview/.yarn/install-state.gz b/packages/layout/examples/preview/.yarn/install-state.gz
new file mode 100644
index 000000000000..0db8c37d13db
Binary files /dev/null and b/packages/layout/examples/preview/.yarn/install-state.gz differ
diff --git a/packages/layout/examples/preview/yarn.lock b/packages/layout/examples/preview/yarn.lock
index a818eb6d05a6..0b397109e59c 100644
--- a/packages/layout/examples/preview/yarn.lock
+++ b/packages/layout/examples/preview/yarn.lock
@@ -4137,13 +4137,13 @@ fsevents@~2.3.2:
linkType: hard
"loader-utils@npm:^1.1.0":
- version: 1.4.0
- resolution: "loader-utils@npm:1.4.0"
+ version: 1.4.1
+ resolution: "loader-utils@npm:1.4.1"
dependencies:
big.js: ^5.2.2
emojis-list: ^3.0.0
json5: ^1.0.1
- checksum: d150b15e7a42ac47d935c8b484b79e44ff6ab4c75df7cc4cb9093350cf014ec0b17bdb60c5d6f91a37b8b218bd63b973e263c65944f58ca2573e402b9a27e717
+ checksum: ea0b648cba0194e04a90aab6270619f0e35be009e33a443d9e642e93056cd49e6ca4c9678bd1c777a2392551bc5f4d0f24a87f5040608da1274aa84c6eebb502
languageName: node
linkType: hard
diff --git a/packages/pictograms-react/package.json b/packages/pictograms-react/package.json
index 2ecda21e5a23..6654253acd4d 100644
--- a/packages/pictograms-react/package.json
+++ b/packages/pictograms-react/package.json
@@ -1,7 +1,7 @@
{
"name": "@carbon/pictograms-react",
"description": "React components for pictograms in digital and software products using the Carbon Design System",
- "version": "11.33.0",
+ "version": "11.34.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
@@ -42,8 +42,8 @@
"prop-types": "^15.7.2"
},
"devDependencies": {
- "@carbon/icon-build-helpers": "^1.5.0",
- "@carbon/pictograms": "^12.7.0"
+ "@carbon/icon-build-helpers": "^1.6.0",
+ "@carbon/pictograms": "^12.8.0"
},
"sideEffects": false
}
diff --git a/packages/pictograms/examples/preview/.yarn/install-state.gz b/packages/pictograms/examples/preview/.yarn/install-state.gz
new file mode 100644
index 000000000000..0679070d1784
Binary files /dev/null and b/packages/pictograms/examples/preview/.yarn/install-state.gz differ
diff --git a/packages/pictograms/examples/preview/yarn.lock b/packages/pictograms/examples/preview/yarn.lock
index 59891eeb9fd8..72c4fc4a1cb6 100644
--- a/packages/pictograms/examples/preview/yarn.lock
+++ b/packages/pictograms/examples/preview/yarn.lock
@@ -4271,13 +4271,13 @@ fsevents@~2.3.2:
linkType: hard
"loader-utils@npm:^1.1.0":
- version: 1.4.0
- resolution: "loader-utils@npm:1.4.0"
+ version: 1.4.1
+ resolution: "loader-utils@npm:1.4.1"
dependencies:
big.js: ^5.2.2
emojis-list: ^3.0.0
json5: ^1.0.1
- checksum: d150b15e7a42ac47d935c8b484b79e44ff6ab4c75df7cc4cb9093350cf014ec0b17bdb60c5d6f91a37b8b218bd63b973e263c65944f58ca2573e402b9a27e717
+ checksum: ea0b648cba0194e04a90aab6270619f0e35be009e33a443d9e642e93056cd49e6ca4c9678bd1c777a2392551bc5f4d0f24a87f5040608da1274aa84c6eebb502
languageName: node
linkType: hard
diff --git a/packages/pictograms/package.json b/packages/pictograms/package.json
index 324d4fc7ea26..79b959320d79 100644
--- a/packages/pictograms/package.json
+++ b/packages/pictograms/package.json
@@ -1,7 +1,7 @@
{
"name": "@carbon/pictograms",
"description": "Pictograms for digital and software products using the Carbon Design System",
- "version": "12.7.0",
+ "version": "12.8.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
@@ -31,7 +31,7 @@
"prepublishOnly": "yarn build"
},
"devDependencies": {
- "@carbon/icon-build-helpers": "^1.5.0",
+ "@carbon/icon-build-helpers": "^1.6.0",
"rimraf": "^3.0.0"
}
}
diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
index ed941f208d35..95e718146d54 100644
--- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
+++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
@@ -2367,6 +2367,12 @@ Map {
"inline": Object {
"type": "bool",
},
+ "invalid": Object {
+ "type": "bool",
+ },
+ "invalidText": Object {
+ "type": "node",
+ },
"light": [Function],
"locale": Object {
"args": Array [
@@ -2501,6 +2507,12 @@ Map {
],
"type": "oneOfType",
},
+ "warn": Object {
+ "type": "bool",
+ },
+ "warnText": Object {
+ "type": "node",
+ },
},
"render": [Function],
},
@@ -4917,6 +4929,9 @@ Map {
"open": Object {
"type": "bool",
},
+ "readOnly": Object {
+ "type": "bool",
+ },
"selectedItems": Object {
"type": "array",
},
@@ -6693,24 +6708,96 @@ Map {
"render": [Function],
},
"StructuredListBody" => Object {
- "$$typeof": Symbol(react.forward_ref),
- "render": [Function],
+ "defaultProps": Object {
+ "onKeyDown": [Function],
+ },
+ "propTypes": Object {
+ "children": Object {
+ "type": "node",
+ },
+ "className": Object {
+ "type": "string",
+ },
+ "head": Object {
+ "type": "bool",
+ },
+ "onKeyDown": Object {
+ "type": "func",
+ },
+ },
},
"StructuredListCell" => Object {
- "$$typeof": Symbol(react.forward_ref),
- "render": [Function],
+ "defaultProps": Object {
+ "head": false,
+ "noWrap": false,
+ },
+ "propTypes": Object {
+ "children": Object {
+ "type": "node",
+ },
+ "className": Object {
+ "type": "string",
+ },
+ "head": Object {
+ "type": "bool",
+ },
+ "noWrap": Object {
+ "type": "bool",
+ },
+ },
},
"StructuredListHead" => Object {
- "$$typeof": Symbol(react.forward_ref),
- "render": [Function],
+ "propTypes": Object {
+ "children": Object {
+ "type": "node",
+ },
+ "className": Object {
+ "type": "string",
+ },
+ },
},
"StructuredListInput" => Object {
- "$$typeof": Symbol(react.forward_ref),
- "render": [Function],
+ "defaultProps": Object {
+ "title": "title",
+ },
+ "propTypes": Object {
+ "className": Object {
+ "type": "string",
+ },
+ "defaultChecked": [Function],
+ "id": Object {
+ "type": "string",
+ },
+ "name": Object {
+ "type": "string",
+ },
+ "onChange": [Function],
+ "title": Object {
+ "type": "string",
+ },
+ "value": [Function],
+ },
},
"StructuredListRow" => Object {
- "$$typeof": Symbol(react.forward_ref),
- "render": [Function],
+ "defaultProps": Object {
+ "head": false,
+ "onKeyDown": [Function],
+ },
+ "propTypes": Object {
+ "children": Object {
+ "type": "node",
+ },
+ "className": Object {
+ "type": "string",
+ },
+ "head": Object {
+ "type": "bool",
+ },
+ "label": [Function],
+ "onKeyDown": Object {
+ "type": "func",
+ },
+ },
},
"StructuredListSkeleton" => Object {
"defaultProps": Object {
@@ -6730,8 +6817,32 @@ Map {
},
},
"StructuredListWrapper" => Object {
- "$$typeof": Symbol(react.forward_ref),
- "render": [Function],
+ "defaultProps": Object {
+ "ariaLabel": "Structured list section",
+ "isCondensed": false,
+ "isFlush": false,
+ "selection": false,
+ },
+ "propTypes": Object {
+ "ariaLabel": Object {
+ "type": "string",
+ },
+ "children": Object {
+ "type": "node",
+ },
+ "className": Object {
+ "type": "string",
+ },
+ "isCondensed": Object {
+ "type": "bool",
+ },
+ "isFlush": Object {
+ "type": "bool",
+ },
+ "selection": Object {
+ "type": "bool",
+ },
+ },
},
"Switch" => Object {
"$$typeof": Symbol(react.forward_ref),
@@ -7636,7 +7747,6 @@ Map {
"TextArea" => Object {
"$$typeof": Symbol(react.forward_ref),
"defaultProps": Object {
- "cols": 50,
"disabled": false,
"enableCounter": false,
"helperText": "",
@@ -9403,6 +9513,51 @@ Map {
},
},
},
+ "unstable__FluidDatePicker" => Object {
+ "$$typeof": Symbol(react.forward_ref),
+ "propTypes": Object {
+ "children": Object {
+ "type": "node",
+ },
+ "className": Object {
+ "type": "string",
+ },
+ "invalid": Object {
+ "type": "bool",
+ },
+ "invalidText": Object {
+ "type": "node",
+ },
+ "warn": Object {
+ "type": "bool",
+ },
+ "warnText": Object {
+ "type": "node",
+ },
+ },
+ "render": [Function],
+ },
+ "unstable__FluidDatePickerInput" => Object {
+ "$$typeof": Symbol(react.forward_ref),
+ "render": [Function],
+ },
+ "unstable__FluidDatePickerSkeleton" => Object {
+ "propTypes": Object {
+ "className": Object {
+ "type": "string",
+ },
+ "datePickerType": Object {
+ "args": Array [
+ Array [
+ "simple",
+ "single",
+ "range",
+ ],
+ ],
+ "type": "oneOf",
+ },
+ },
+ },
"unstable__FluidDropdown" => Object {
"$$typeof": Symbol(react.forward_ref),
"propTypes": Object {
diff --git a/packages/react/package.json b/packages/react/package.json
index 977629c998c4..ff840cb209d2 100644
--- a/packages/react/package.json
+++ b/packages/react/package.json
@@ -1,7 +1,7 @@
{
"name": "@carbon/react",
"description": "React components for the Carbon Design System",
- "version": "1.17.0-rc.1",
+ "version": "1.17.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
@@ -44,9 +44,9 @@
"dependencies": {
"@babel/runtime": "^7.18.3",
"@carbon/feature-flags": "^0.9.0",
- "@carbon/icons-react": "^11.10.0",
+ "@carbon/icons-react": "^11.11.0",
"@carbon/layout": "^11.7.0",
- "@carbon/styles": "^1.17.0-rc.1",
+ "@carbon/styles": "^1.17.0",
"@carbon/telemetry": "0.1.0",
"classnames": "2.3.2",
"copy-to-clipboard": "^3.3.1",
@@ -73,7 +73,7 @@
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"@carbon/test-utils": "^10.26.0",
- "@carbon/themes": "^11.11.1-rc.0",
+ "@carbon/themes": "^11.12.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^21.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
diff --git a/packages/react/scss/components/fluid-date-picker/_fluid-date-picker.scss b/packages/react/scss/components/fluid-date-picker/_fluid-date-picker.scss
new file mode 100644
index 000000000000..a4a1b765aa35
--- /dev/null
+++ b/packages/react/scss/components/fluid-date-picker/_fluid-date-picker.scss
@@ -0,0 +1,9 @@
+// Code generated by @carbon/react. DO NOT EDIT.
+//
+// Copyright IBM Corp. 2018, 2018
+//
+// This source code is licensed under the Apache-2.0 license found in the
+// LICENSE file in the root directory of this source tree.
+//
+
+@forward '@carbon/styles/scss/components/fluid-date-picker/fluid-date-picker';
diff --git a/packages/react/scss/components/fluid-date-picker/_index.scss b/packages/react/scss/components/fluid-date-picker/_index.scss
new file mode 100644
index 000000000000..0659b6549a33
--- /dev/null
+++ b/packages/react/scss/components/fluid-date-picker/_index.scss
@@ -0,0 +1,9 @@
+// Code generated by @carbon/react. DO NOT EDIT.
+//
+// Copyright IBM Corp. 2018, 2018
+//
+// This source code is licensed under the Apache-2.0 license found in the
+// LICENSE file in the root directory of this source tree.
+//
+
+@forward '@carbon/styles/scss/components/fluid-date-picker';
diff --git a/packages/react/src/__tests__/index-test.js b/packages/react/src/__tests__/index-test.js
index 10ef4678fb5f..b9c972bbd041 100644
--- a/packages/react/src/__tests__/index-test.js
+++ b/packages/react/src/__tests__/index-test.js
@@ -231,6 +231,9 @@ describe('Carbon Components React', () => {
"unstable_TextDirection",
"unstable__FluidComboBox",
"unstable__FluidComboBoxSkeleton",
+ "unstable__FluidDatePicker",
+ "unstable__FluidDatePickerInput",
+ "unstable__FluidDatePickerSkeleton",
"unstable__FluidDropdown",
"unstable__FluidDropdownSkeleton",
"unstable__FluidMultiSelect",
diff --git a/packages/react/src/components/ContentSwitcher/next/ContentSwitcher-story.js b/packages/react/src/components/ContentSwitcher/next/ContentSwitcher-story.js
deleted file mode 100644
index c0cf8ff5ea84..000000000000
--- a/packages/react/src/components/ContentSwitcher/next/ContentSwitcher-story.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-/* eslint-disable storybook/story-exports */
-
-import React from 'react';
-import {
- ContentSwitcher,
- ContentTabs,
- ContentTab,
- ContentPanels,
- ContentPanel,
-} from './';
-
-export default {
- title: 'Experimental/unstable_ContentSwitcher',
- component: ContentSwitcher,
- subcomponents: {
- ContentTabs,
- ContentTab,
- ContentPanels,
- ContentPanel,
- },
- includeStories: [],
-};
-
-export const Default = () => {
- return (
-
-
- Tab 1
- Tab 2
- Tab 3
-
-
- Panel 1
- Panel 2
- Panel 3
-
-
- );
-};
diff --git a/packages/react/src/components/ContentSwitcher/next/index.js b/packages/react/src/components/ContentSwitcher/next/index.js
deleted file mode 100644
index 4df9fe28484b..000000000000
--- a/packages/react/src/components/ContentSwitcher/next/index.js
+++ /dev/null
@@ -1,313 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import PropTypes from 'prop-types';
-import React from 'react';
-import cx from 'classnames';
-import { match, matches, keys } from '../../../internal/keyboard';
-import { useId } from '../../../internal/useId';
-import { useControllableState } from '../../../internal/useControllableState';
-import { usePrefix } from '../../../internal/usePrefix';
-
-// Used to manage the overall state of the ContentSwitcher
-const ContentSwitcherContext = React.createContext();
-
-// Used to keep track of position in a tablist
-const ContentTabContext = React.createContext();
-
-// Used to keep track of position in a list of tab panels
-const ContentPanelContext = React.createContext();
-
-function ContentSwitcher({
- children,
- defaultSelectedIndex = 0,
- onChange,
- selectedIndex: controlledSelectedIndex,
-}) {
- const baseId = useId('ccs');
- // The active index is used to track the element which has focus in our tablist
- const [activeIndex, setActiveIndex] = React.useState(defaultSelectedIndex);
- // The selected index is used for the tab/panel pairing which is "visible"
- const [selectedIndex, setSelectedIndex] = useControllableState({
- value: controlledSelectedIndex,
- defaultValue: defaultSelectedIndex,
- onChange: (value) => {
- if (onChange) {
- onChange({ selectedIndex: value });
- }
- },
- });
- const value = {
- baseId,
- activeIndex,
- setActiveIndex,
- selectedIndex,
- setSelectedIndex,
- };
-
- return (
-
- {children}
-
- );
-}
-
-ContentSwitcher.propTypes = {
- /**
- * Provide child elements to be rendered inside of the `ContentSwitcher`.
- * These elements should render either `ContentTabs` or `ContentPanels`
- */
- children: PropTypes.node,
-
- /**
- * Specify which content tab should be initially selected when the component
- * is first rendered
- */
- defaultSelectedIndex: PropTypes.number,
-
- /**
- * Provide an optional function which is called whenever the state of the
- * `ContentSwitcher` changes
- */
- onChange: PropTypes.func,
-
- /**
- * Control which content panel is currently selected. This puts the component
- * in a controlled mode and should be used along with `onChange`
- */
- selectedIndex: PropTypes.number,
-};
-
-/**
- * A `ContentPanel` corresponds to a tablist in the Tabs pattern as written in
- * WAI-ARIA Authoring Practices.
- *
- * @see https://w3c.github.io/aria-practices/#tabpanel
- */
-function ContentTabs({
- activation = 'automatic',
- 'aria-label': label,
- children,
- className: customClassName,
- size = 'md',
- ...rest
-}) {
- const { activeIndex, selectedIndex, setSelectedIndex, setActiveIndex } =
- React.useContext(ContentSwitcherContext);
- const ref = React.useRef(null);
- const prefix = usePrefix();
- const className = cx(customClassName, `${prefix}--content-switcher`, {
- [`${prefix}--content-switcher--${size}`]: size,
- });
- const count = React.Children.count(children);
- const tabs = [];
-
- function onKeyDown(event) {
- if (
- matches(event, [keys.ArrowRight, keys.ArrowLeft, keys.Home, keys.End])
- ) {
- const nextIndex = getNextIndex(
- event,
- count,
- activation === 'automatic' ? selectedIndex : activeIndex
- );
-
- if (activation === 'automatic') {
- setSelectedIndex(nextIndex);
- } else if (activation === 'manual') {
- setActiveIndex(nextIndex);
- }
-
- tabs[nextIndex].current.focus();
- }
- }
-
- return (
- // eslint-disable-next-line jsx-a11y/interactive-supports-focus
-
- {React.Children.map(children, (child, index) => {
- const ref = React.createRef();
- tabs.push(ref);
- return (
-
- {React.cloneElement(child, {
- ref,
- })}
-
- );
- })}
-
- );
-}
-
-ContentTabs.propTypes = {
- /**
- * Specify whether the content tab should be activated automatically or
- * manually
- */
- activation: PropTypes.oneOf(['automatic', 'manual']),
-
- /**
- * Provide an accessible label to be read when a user interacts with this
- * component
- */
- 'aria-label': PropTypes.string.isRequired,
-
- /**
- * Provide child elements to be rendered inside of `ContentTabs`.
- * These elements should render a `ContentTab`
- */
- children: PropTypes.node,
-
- /**
- * Specify an optional className to be added to the container node
- */
- className: PropTypes.string,
-
- /**
- * Specify the size of the Content Switcher. Currently supports either `sm`, 'md' (default) or 'lg` as an option.
- */
- size: PropTypes.oneOf(['sm', 'md', 'lg']),
-};
-
-/**
- * Get the next index for a givne keyboard event given a count of the total
- * items and the current index
- * @param {Event} event
- * @param {number} total
- * @param {number} index
- * @returns {number}
- */
-function getNextIndex(event, total, index) {
- if (match(event, keys.ArrowRight)) {
- return (index + 1) % total;
- } else if (match(event, keys.ArrowLeft)) {
- return (total + index - 1) % total;
- } else if (match(event, keys.Home)) {
- return 0;
- } else if (match(event, keys.End)) {
- return total - 1;
- }
-}
-
-const ContentTab = React.forwardRef(function ContentTab(
- { children, ...rest },
- ref
-) {
- const { selectedIndex, setSelectedIndex, baseId } = React.useContext(
- ContentSwitcherContext
- );
- const index = React.useContext(ContentTabContext);
- const id = `${baseId}-tab-${index}`;
- const panelId = `${baseId}-tabpanel-${index}`;
- const prefix = usePrefix();
- const className = cx(`${prefix}--content-switcher-btn`, {
- [`${prefix}--content-switcher--selected`]: selectedIndex === index,
- });
-
- return (
- {
- setSelectedIndex(index);
- }}
- tabIndex={selectedIndex === index ? '0' : '-1'}
- type="button">
- {children}
-
- );
-});
-
-ContentTab.propTypes = {
- /**
- * Provide child elements to be rendered inside of `ContentTab`.
- * These elements must be noninteractive
- */
- children: PropTypes.node,
-};
-
-/**
- * Used to display all of the tab panels inside of a Content Switcher. This
- * components keeps track of position in for each ContentPanel.
- *
- * Note: children should either be a `ContentPanel` or should render a
- * `ContentPanel`. Fragments are not currently supported.
- */
-function ContentPanels({ children }) {
- return React.Children.map(children, (child, index) => {
- return (
-
- {child}
-
- );
- });
-}
-
-ContentPanels.propTypes = {
- /**
- * Provide child elements to be rendered inside of `ContentPanels`.
- * These elements should render a `ContentPanel`
- */
- children: PropTypes.node,
-};
-
-/**
- * A `ContentPanel` corresponds to a tabpanel in the Tabs pattern as written in
- * WAI-ARIA Authoring Practices. This component reads the selected
- * index and base id from context in order to determine the correct `id` and
- * display status of the component.
- *
- * @see https://w3c.github.io/aria-practices/#tabpanel
- */
-const ContentPanel = React.forwardRef(function ContentPanel(props, ref) {
- const { children, ...rest } = props;
- const { selectedIndex, baseId } = React.useContext(ContentSwitcherContext);
- const index = React.useContext(ContentPanelContext);
- const id = `${baseId}-tabpanel-${index}`;
- const tabId = `${baseId}-tab-${index}`;
-
- // TODO: tabindex should only be 0 if no interactive content in children
- return (
-
- {children}
-
- );
-});
-
-ContentPanel.propTypes = {
- /**
- * Provide child elements to be rendered inside of `ContentPanel`.
- */
- children: PropTypes.node,
-};
-
-export {
- ContentSwitcher,
- ContentTabs,
- ContentTab,
- ContentPanels,
- ContentPanel,
-};
diff --git a/packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap b/packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap
index 041dc78208b4..b1c00a31dcf8 100644
--- a/packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap
+++ b/packages/react/src/components/DataTable/__tests__/__snapshots__/DataTable-test.js.snap
@@ -2406,20 +2406,11 @@ exports[`DataTable should render 1`] = `
}
}
>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
`;
diff --git a/packages/react/src/components/DataTable/stories/DataTable-toolbar.stories.js b/packages/react/src/components/DataTable/stories/DataTable-toolbar.stories.js
index fbc007392f6c..fab8e53d3a34 100644
--- a/packages/react/src/components/DataTable/stories/DataTable-toolbar.stories.js
+++ b/packages/react/src/components/DataTable/stories/DataTable-toolbar.stories.js
@@ -271,10 +271,10 @@ export const WithOverflowMenu = () => (
{cell.value}
))}
-
- Action 1
- Action 2
- Action 3
+
+
+
+
@@ -334,9 +334,9 @@ export const Playground = (args) => (
))}
- Action 1
- Action 2
- Action 3
+
+
+
diff --git a/packages/react/src/components/DataTableSkeleton/DataTableSkeleton-story.js b/packages/react/src/components/DataTableSkeleton/DataTableSkeleton-story.js
deleted file mode 100644
index cf18dfe85cb1..000000000000
--- a/packages/react/src/components/DataTableSkeleton/DataTableSkeleton-story.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-/* eslint-disable no-console */
-
-import React from 'react';
-import { withKnobs, boolean } from '@storybook/addon-knobs';
-import DataTableSkeleton from '../DataTableSkeleton';
-import { headers } from '../DataTable/stories/shared';
-
-const props = () => ({
- showHeaders: boolean('Show table headers', true),
- zebra: boolean('Use zebra stripe (zebra)', false),
- compact: boolean('Compact variant (compact)', false),
- showHeader: boolean('Show the Table Header (showHeader)', true),
- showToolbar: boolean('Show the Table Toolbar (showToolbar)', true),
-});
-
-export default {
- title: 'Components/DataTable/Skeleton',
- component: DataTableSkeleton,
- decorators: [withKnobs],
-};
-
-export const Skeleton = () => {
- const { showHeaders, ...rest } = props();
- return (
-
-
-
-
- );
-};
diff --git a/packages/react/src/components/DataTableSkeleton/next/DataTableSkeleton.stories.js b/packages/react/src/components/DataTableSkeleton/DataTableSkeleton.stories.js
similarity index 89%
rename from packages/react/src/components/DataTableSkeleton/next/DataTableSkeleton.stories.js
rename to packages/react/src/components/DataTableSkeleton/DataTableSkeleton.stories.js
index 7af57be95419..de5ad05662a3 100644
--- a/packages/react/src/components/DataTableSkeleton/next/DataTableSkeleton.stories.js
+++ b/packages/react/src/components/DataTableSkeleton/DataTableSkeleton.stories.js
@@ -9,8 +9,8 @@
import React from 'react';
import { withKnobs, boolean } from '@storybook/addon-knobs';
-import DataTableSkeleton from '../DataTableSkeleton';
-import { headers } from '../../DataTable/stories/shared';
+import DataTableSkeleton from './DataTableSkeleton';
+import { headers } from '../DataTable/stories/shared';
const props = () => ({
showHeaders: boolean('Show table headers', true),
diff --git a/packages/react/src/components/DatePicker/DatePicker.js b/packages/react/src/components/DatePicker/DatePicker.js
index 88b03ea95eb9..0e5b758e3d6d 100644
--- a/packages/react/src/components/DatePicker/DatePicker.js
+++ b/packages/react/src/components/DatePicker/DatePicker.js
@@ -6,7 +6,7 @@
*/
import PropTypes from 'prop-types';
-import React, { useEffect, useRef } from 'react';
+import React, { useContext, useEffect, useRef } from 'react';
import cx from 'classnames';
import flatpickr from 'flatpickr';
import l10n from 'flatpickr/dist/l10n/index';
@@ -18,6 +18,8 @@ import deprecate from '../../prop-types/deprecate';
import { match, keys } from '../../internal/keyboard';
import { usePrefix } from '../../internal/usePrefix';
import { useSavedCallback } from '../../internal/useSavedCallback';
+import { FormContext } from '../FluidForm';
+import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
// Weekdays shorthand for english locale
l10n.en.weekdays.shorthand.forEach((_day, index) => {
@@ -187,6 +189,10 @@ const DatePicker = React.forwardRef(function DatePicker(
disable,
enable,
inline,
+ invalid,
+ invalidText,
+ warn,
+ warnText,
light = false,
locale = 'en',
maxDate,
@@ -201,6 +207,7 @@ const DatePicker = React.forwardRef(function DatePicker(
ref
) {
const prefix = usePrefix();
+ const { isFluid } = useContext(FormContext);
const startInputField = useRef(null);
const endInputField = useRef(null);
const calendarRef = useRef(null);
@@ -343,6 +350,10 @@ const DatePicker = React.forwardRef(function DatePicker(
calendarRef.current = calendar;
function handleArrowDown(event) {
+ if (match(event, keys.Escape)) {
+ calendar.calendarContainer.classList.remove('open');
+ }
+
if (match(event, keys.ArrowDown)) {
const {
calendarContainer,
@@ -363,6 +374,10 @@ const DatePicker = React.forwardRef(function DatePicker(
}
function handleOnChange() {
+ if (datePickerType == 'single') {
+ calendar.calendarContainer.classList.remove('open');
+ }
+
if (start.value !== '') {
return;
}
@@ -439,7 +454,7 @@ const DatePicker = React.forwardRef(function DatePicker(
useEffect(() => {
if (calendarRef.current && disable) {
- calendarRef.current.set('disbale', disable);
+ calendarRef.current.set('disable', disable);
}
}, [disable]);
@@ -467,9 +482,37 @@ const DatePicker = React.forwardRef(function DatePicker(
}
}, [value, prefix]);
+ let fluidError;
+ if (isFluid) {
+ if (invalid) {
+ fluidError = (
+ <>
+
+
+ {invalidText}
+ >
+ );
+ }
+
+ if (warn && !invalid) {
+ fluidError = (
+ <>
+
+
+ {warnText}
+ >
+ );
+ }
+ }
+
return (
{childrenWithProps}
+ {fluidError}
);
});
@@ -530,6 +573,16 @@ DatePicker.propTypes = {
*/
inline: PropTypes.bool,
+ /**
+ * Specify whether or not the control is invalid (Fluid only)
+ */
+ invalid: PropTypes.bool,
+
+ /**
+ * Provide the text that is displayed when the control is in error state (Fluid Only)
+ */
+ invalidText: PropTypes.node,
+
/**
* `true` to use the light version.
*/
@@ -654,6 +707,16 @@ DatePicker.propTypes = {
PropTypes.object,
PropTypes.number,
]),
+
+ /**
+ * Specify whether the control is currently in warning state (Fluid only)
+ */
+ warn: PropTypes.bool,
+
+ /**
+ * Provide the text that is displayed when the control is in warning state (Fluid only)
+ */
+ warnText: PropTypes.node,
};
export default DatePicker;
diff --git a/packages/react/src/components/DatePickerInput/DatePickerInput.js b/packages/react/src/components/DatePickerInput/DatePickerInput.js
index dad8c5c2ce2d..5f5aad11972b 100644
--- a/packages/react/src/components/DatePickerInput/DatePickerInput.js
+++ b/packages/react/src/components/DatePickerInput/DatePickerInput.js
@@ -8,8 +8,9 @@
import { Calendar, WarningFilled, WarningAltFilled } from '@carbon/icons-react';
import cx from 'classnames';
import PropTypes from 'prop-types';
-import React from 'react';
+import React, { useContext } from 'react';
import { usePrefix } from '../../internal/usePrefix';
+import { FormContext } from '../FluidForm';
const DatePickerInput = React.forwardRef(function DatePickerInput(props, ref) {
const {
@@ -32,6 +33,7 @@ const DatePickerInput = React.forwardRef(function DatePickerInput(props, ref) {
...rest
} = props;
const prefix = usePrefix();
+ const { isFluid } = useContext(FormContext);
const datePickerInputProps = {
id,
onChange: (event) => {
@@ -62,9 +64,12 @@ const DatePickerInput = React.forwardRef(function DatePickerInput(props, ref) {
const inputClasses = cx(`${prefix}--date-picker__input`, {
[`${prefix}--date-picker__input--${size}`]: size,
[`${prefix}--date-picker__input--invalid`]: invalid,
+ [`${prefix}--date-picker__input--warn`]: warn,
});
const containerClasses = cx(`${prefix}--date-picker-container`, {
[`${prefix}--date-picker--nolabel`]: !labelText,
+ [`${prefix}--date-picker--fluid--invalid`]: isFluid && invalid,
+ [`${prefix}--date-picker--fluid--warn`]: isFluid && warn,
});
const input = invalid ? (
@@ -95,6 +100,7 @@ const DatePickerInput = React.forwardRef(function DatePickerInput(props, ref) {
)}
{input}
+ {isFluid && }
{invalid && (
- {invalidText}
+ <>
+ {isFluid && }
+ {invalidText}
+ >
+ )}
+ {warn && (
+ <>
+ {isFluid && }
+ {warnText}
+ >
)}
- {warn && {warnText}
}
{helperText && {helperText}
}
);
@@ -211,9 +225,12 @@ DatePickerInput.propTypes = {
function DatePickerIcon({ datePickerType, invalid, warn }) {
const prefix = usePrefix();
+ const { isFluid } = useContext(FormContext);
if (datePickerType === 'simple' && !invalid && !warn) {
- return null;
+ if (!isFluid) {
+ return null;
+ }
}
if (invalid) {
diff --git a/packages/react/src/components/FluidDatePicker/FluidDatePicker.Skeleton.js b/packages/react/src/components/FluidDatePicker/FluidDatePicker.Skeleton.js
new file mode 100644
index 000000000000..6b3ace7c6629
--- /dev/null
+++ b/packages/react/src/components/FluidDatePicker/FluidDatePicker.Skeleton.js
@@ -0,0 +1,71 @@
+/**
+ * Copyright IBM Corp. 2016, 2018
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+import PropTypes from 'prop-types';
+import React from 'react';
+import classnames from 'classnames';
+import { usePrefix } from '../../internal/usePrefix';
+import { FormContext } from '../FluidForm/FormContext';
+import { Calendar } from '@carbon/icons-react';
+
+function FluidDatePickerSkeleton({
+ className,
+ datePickerType = 'single',
+ ...other
+}) {
+ const prefix = usePrefix();
+
+ const classNames = classnames(
+ className,
+ `${prefix}--form-item ${prefix}--date-picker--fluid__skeleton`,
+ {
+ [`${prefix}--date-picker--fluid__skeleton--range`]:
+ datePickerType === 'range',
+ }
+ );
+
+ return (
+
+
+
+
+
+ {datePickerType !== 'simple' && (
+
+ )}
+
+ {datePickerType === 'range' && (
+
+ )}
+
+
+ );
+}
+
+FluidDatePickerSkeleton.propTypes = {
+ /**
+ * Specify an optional className to be applied to the outer FluidForm wrapper
+ */
+ className: PropTypes.string,
+
+ /**
+ * Specify which variant of the DatePicker the skeleton should mimic
+ */
+ datePickerType: PropTypes.oneOf(['simple', 'single', 'range']),
+};
+
+export default FluidDatePickerSkeleton;
diff --git a/packages/react/src/components/FluidDatePicker/FluidDatePicker.js b/packages/react/src/components/FluidDatePicker/FluidDatePicker.js
new file mode 100644
index 000000000000..42d5794e3f88
--- /dev/null
+++ b/packages/react/src/components/FluidDatePicker/FluidDatePicker.js
@@ -0,0 +1,74 @@
+/**
+ * Copyright IBM Corp. 2022
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+import PropTypes from 'prop-types';
+import React from 'react';
+import classnames from 'classnames';
+import DatePicker from '../DatePicker';
+import { usePrefix } from '../../internal/usePrefix';
+import { FormContext } from '../FluidForm/FormContext';
+
+const FluidDatePicker = React.forwardRef(function FluidDatePicker(
+ { className, children, invalid, invalidText, warn, warnText, ...other },
+ ref
+) {
+ const prefix = usePrefix();
+ const classNames = classnames(className, {
+ [`${prefix}--date-picker--fluid`]: true,
+ [`${prefix}--date-picker--fluid--invalid`]: invalid,
+ [`${prefix}--date-picker--fluid--warn`]: warn,
+ });
+
+ return (
+
+
+ {children}
+
+
+ );
+});
+
+FluidDatePicker.propTypes = {
+ /**
+ * The child node(s)
+ */
+ children: PropTypes.node,
+
+ /**
+ * Specify an optional className to be applied to the outer FluidForm wrapper
+ */
+ className: PropTypes.string,
+
+ /**
+ * Specify whether or not the control is invalid
+ */
+ invalid: PropTypes.bool,
+
+ /**
+ * Provide the text that is displayed when the control is in error state
+ */
+ invalidText: PropTypes.node,
+
+ /**
+ * Specify whether the control is currently in warning state
+ */
+ warn: PropTypes.bool,
+
+ /**
+ * Provide the text that is displayed when the control is in warning state
+ */
+ warnText: PropTypes.node,
+};
+
+export default FluidDatePicker;
diff --git a/packages/react/src/components/FluidDatePicker/FluidDatePicker.stories.js b/packages/react/src/components/FluidDatePicker/FluidDatePicker.stories.js
new file mode 100644
index 000000000000..0022126ab5d0
--- /dev/null
+++ b/packages/react/src/components/FluidDatePicker/FluidDatePicker.stories.js
@@ -0,0 +1,252 @@
+/**
+ * Copyright IBM Corp. 2022
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+import React from 'react';
+import FluidDatePicker from '../FluidDatePicker';
+import FluidDatePickerInput from '../FluidDatePickerInput';
+import FluidDatePickerSkeleton from './FluidDatePicker.Skeleton';
+import {
+ ToggletipLabel,
+ Toggletip,
+ ToggletipButton,
+ ToggletipContent,
+} from '../Toggletip';
+import { Information } from '@carbon/icons-react';
+
+export default {
+ title: 'Experimental/unstable__FluidDatePicker',
+ component: FluidDatePicker,
+};
+
+const ToggleTip = (
+ <>
+ Label
+
+
+
+
+
+ Additional field information here.
+
+
+ >
+);
+
+export const Simple = () => (
+
+
+
+
+
+);
+
+export const Single = () => (
+
+
+
+
+
+);
+
+export const RangeWithCalendar = () => {
+ return (
+
+
+
+
+
+
+ );
+};
+
+export const Skeleton = () => (
+
+
+
+
+
+
+
+
+
+);
+
+export const Playground = (args) => {
+ const { invalid, invalidText, warn, warnText, disabled } = args;
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+Playground.argTypes = {
+ appendTo: {
+ table: {
+ disable: true,
+ },
+ },
+ children: {
+ table: {
+ disable: true,
+ },
+ },
+ className: {
+ table: {
+ disable: true,
+ },
+ },
+ disable: {
+ table: {
+ disable: true,
+ },
+ },
+ enable: {
+ table: {
+ disable: true,
+ },
+ },
+ inline: {
+ table: {
+ disable: true,
+ },
+ },
+ light: {
+ table: {
+ disable: true,
+ },
+ },
+ locale: {
+ table: {
+ disable: true,
+ },
+ },
+ onChange: {
+ action: 'clicked',
+ table: {
+ disable: true,
+ },
+ },
+ onClose: {
+ action: 'clicked',
+ table: {
+ disable: true,
+ },
+ },
+ onOpen: {
+ action: 'clicked',
+ table: {
+ disable: true,
+ },
+ },
+ disabled: {
+ control: { type: 'boolean' },
+ table: {
+ category: 'DatePickerInput',
+ },
+ },
+ invalid: {
+ control: { type: 'boolean' },
+ table: {
+ category: 'DatePickerInput',
+ },
+ },
+ invalidText: {
+ control: { type: 'text' },
+ table: {
+ category: 'DatePickerInput',
+ },
+ defaultValue:
+ 'Error message that is really long can wrap to more lines but should not be excessively long.',
+ },
+ placeholder: {
+ control: { type: 'text' },
+ table: {
+ category: 'DatePickerInput',
+ },
+ },
+ warn: {
+ control: { type: 'boolean' },
+ table: {
+ category: 'DatePickerInput',
+ },
+ },
+ warnText: {
+ control: { type: 'text' },
+ table: {
+ category: 'DatePickerInput',
+ },
+ defaultValue:
+ 'Warning message that is really long can wrap to more lines but should not be excessively long.',
+ },
+};
diff --git a/packages/react/src/components/FluidDatePicker/__tests__/FluidDatePicker-test.js b/packages/react/src/components/FluidDatePicker/__tests__/FluidDatePicker-test.js
new file mode 100644
index 000000000000..8e3d514b0cff
--- /dev/null
+++ b/packages/react/src/components/FluidDatePicker/__tests__/FluidDatePicker-test.js
@@ -0,0 +1,65 @@
+/**
+ * Copyright IBM Corp. 2022
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+import React from 'react';
+import FluidDatePicker from '../FluidDatePicker';
+import FluidDatePickerInput from '../../FluidDatePickerInput';
+import { render, screen } from '@testing-library/react';
+
+const prefix = 'cds';
+
+describe('FluidDatePicker', () => {
+ describe('renders as expected - Component API', () => {
+ it('should add extra classes that are passed via className', () => {
+ render(
+ {}}
+ className="custom-class"
+ dateFormat="m/d/Y"
+ data-testid="datePicker-1">
+
+
+
+ );
+
+ expect(screen.getByTestId('datePicker-1')).toHaveClass('custom-class');
+ });
+
+ it('should add fluid classes by default', () => {
+ render(
+ {}}
+ className="custom-class"
+ dateFormat="m/d/Y"
+ data-testid="datePicker-1">
+
+
+
+ );
+
+ expect(screen.getByTestId('datePicker-1')).toHaveClass(
+ `${prefix}--date-picker--fluid`
+ );
+ });
+ });
+});
diff --git a/packages/react/src/components/FluidDatePicker/index.js b/packages/react/src/components/FluidDatePicker/index.js
new file mode 100644
index 000000000000..4b3107e9f0d0
--- /dev/null
+++ b/packages/react/src/components/FluidDatePicker/index.js
@@ -0,0 +1,11 @@
+/**
+ * Copyright IBM Corp. 2022
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+export default from './FluidDatePicker';
+export FluidDatePicker from './FluidDatePicker';
+
+export { default as FluidDatePickerSkeleton } from './FluidDatePicker.Skeleton';
diff --git a/packages/react/src/components/FluidDatePickerInput/FluidDatePickerInput.js b/packages/react/src/components/FluidDatePickerInput/FluidDatePickerInput.js
new file mode 100644
index 000000000000..35dabebc1189
--- /dev/null
+++ b/packages/react/src/components/FluidDatePickerInput/FluidDatePickerInput.js
@@ -0,0 +1,23 @@
+/**
+ * Copyright IBM Corp. 2022
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+import React from 'react';
+import DatePickerInput from '../DatePickerInput';
+import { FormContext } from '../FluidForm/FormContext';
+
+const FluidDatePickerInput = React.forwardRef(function FluidDatePickerInput(
+ { ...other },
+ ref
+) {
+ return (
+
+
+
+ );
+});
+
+export default FluidDatePickerInput;
diff --git a/packages/react/src/components/FluidDatePickerInput/index.js b/packages/react/src/components/FluidDatePickerInput/index.js
new file mode 100644
index 000000000000..5384e51e32d0
--- /dev/null
+++ b/packages/react/src/components/FluidDatePickerInput/index.js
@@ -0,0 +1,9 @@
+/**
+ * Copyright IBM Corp. 2022
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+export default from './FluidDatePickerInput';
+export FluidDatePickerInput from './FluidDatePickerInput';
diff --git a/packages/react/src/components/FluidForm/FluidForm.stories.js b/packages/react/src/components/FluidForm/FluidForm.stories.js
index 849632a11420..e882d9f49335 100644
--- a/packages/react/src/components/FluidForm/FluidForm.stories.js
+++ b/packages/react/src/components/FluidForm/FluidForm.stories.js
@@ -8,6 +8,11 @@
import React from 'react';
import FluidForm from '.';
+import FluidDatePicker from '../FluidDatePicker';
+import FluidDatePickerInput from '../FluidDatePickerInput';
+import FluidSelect from '../FluidSelect';
+import SelectItem from '../SelectItem';
+import SelectItemGroup from '../SelectItemGroup';
import FluidTextInput from '../FluidTextInput';
import FluidTextArea from '../FluidTextArea';
import ModalWrapper from '../ModalWrapper';
@@ -45,6 +50,39 @@ export default {
export const Default = () => (
<>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
(
+
+
+
+
+
+);
+
const PlaygroundStory = (props) => {
const { align, defaultOpen, disabled, kind, label, size } = props;
return (
diff --git a/packages/react/src/components/Icons/Icons.stories.js b/packages/react/src/components/Icons/Icons.stories.js
index 4c0b8b8d3b60..ebfb2fb8945b 100644
--- a/packages/react/src/components/Icons/Icons.stories.js
+++ b/packages/react/src/components/Icons/Icons.stories.js
@@ -34,3 +34,15 @@ export const Default = () => {
>
);
};
+
+export const Playground = (args) => {
+ return ;
+};
+
+Playground.argTypes = {
+ size: {
+ options: ['16', '20', '32'],
+ control: { type: 'select' },
+ defaultValue: 16,
+ },
+};
diff --git a/packages/react/src/components/Icons/Icons.stories.scss b/packages/react/src/components/Icons/Icons.stories.scss
index 18617f4cb8b8..482e2644abcc 100644
--- a/packages/react/src/components/Icons/Icons.stories.scss
+++ b/packages/react/src/components/Icons/Icons.stories.scss
@@ -6,7 +6,19 @@
//
.demo-icon-example {
display: flex;
- width: 10rem;
+ width: 15rem;
justify-content: space-between;
margin: 2rem;
}
+
+.demo-icon-example:nth-child(1) svg {
+ min-width: 1rem;
+}
+
+.demo-icon-example:nth-child(2) svg {
+ min-width: 1.25rem;
+}
+
+.demo-icon-example:nth-child(3) svg {
+ min-width: 2rem;
+}
diff --git a/packages/react/src/components/ListBox/ListBoxSelection.js b/packages/react/src/components/ListBox/ListBoxSelection.js
index d05822d80055..da6f19a3e12f 100644
--- a/packages/react/src/components/ListBox/ListBoxSelection.js
+++ b/packages/react/src/components/ListBox/ListBoxSelection.js
@@ -23,6 +23,7 @@ function ListBoxSelection({
translateWithId: t,
disabled,
onClearSelection,
+ readOnly,
}) {
const prefix = usePrefix();
const className = cx(`${prefix}--list-box__selection`, {
@@ -31,7 +32,7 @@ function ListBoxSelection({
});
const handleOnClick = (event) => {
event.stopPropagation();
- if (disabled) {
+ if (disabled || readOnly) {
return;
}
clearSelection(event);
@@ -41,7 +42,7 @@ function ListBoxSelection({
};
const handleOnKeyDown = (event) => {
event.stopPropagation();
- if (disabled) {
+ if (disabled || readOnly) {
return;
}
@@ -75,7 +76,8 @@ function ListBoxSelection({
onKeyDown={handleOnKeyDown}
disabled={disabled}
aria-label={t('clear.all')}
- title={description}>
+ title={description}
+ aria-disabled={readOnly ? true : undefined}>
@@ -134,6 +136,11 @@ ListBoxSelection.propTypes = {
*/
onKeyDown: PropTypes.func,
+ /**
+ * Whether or not the Dropdown is readonly
+ */
+ readOnly: PropTypes.bool,
+
/**
* Specify an optional `selectionCount` value that will be used to determine
* whether the selection should display a badge or a single clear icon.
diff --git a/packages/react/src/components/MultiSelect/MultiSelect.js b/packages/react/src/components/MultiSelect/MultiSelect.js
index ae686e941029..b0d1aa5d2d9e 100644
--- a/packages/react/src/components/MultiSelect/MultiSelect.js
+++ b/packages/react/src/components/MultiSelect/MultiSelect.js
@@ -70,6 +70,7 @@ const MultiSelect = React.forwardRef(function MultiSelect(
onMenuChange,
direction,
selectedItems: selected,
+ readOnly,
},
ref
) {
@@ -169,6 +170,7 @@ const MultiSelect = React.forwardRef(function MultiSelect(
[`${prefix}--multi-select--selected`]:
selectedItems && selectedItems.length > 0,
[`${prefix}--list-box--up`]: direction === 'top',
+ [`${prefix}--multi-select--readonly`]: readOnly,
}
);
@@ -234,6 +236,24 @@ const MultiSelect = React.forwardRef(function MultiSelect(
: setIsFocused(evt.type === 'focus' ? true : false);
};
+ const readOnlyEventHandlers = readOnly
+ ? {
+ onClick: (evt) => {
+ // NOTE: does not prevent click
+ evt.preventDefault();
+ // focus on the element as per readonly input behavior
+ evt.target.focus();
+ },
+ onKeyDown: (evt) => {
+ const selectAccessKeys = ['ArrowDown', 'ArrowUp', ' ', 'Enter'];
+ // This prevents the select from opening for the above keys
+ if (selectAccessKeys.includes(evt.key)) {
+ evt.preventDefault();
+ }
+ },
+ }
+ : {};
+
return (
@@ -252,6 +272,7 @@ const MultiSelect = React.forwardRef(function MultiSelect(
size={size}
className={className}
disabled={disabled}
+ readOnly={readOnly}
light={light}
invalid={invalid}
invalidText={invalidText}
@@ -271,13 +292,15 @@ const MultiSelect = React.forwardRef(function MultiSelect(
type="button"
className={`${prefix}--list-box__field`}
disabled={disabled}
- aria-disabled={disabled}
+ aria-disabled={disabled || readOnly}
{...toggleButtonProps}
ref={mergeRefs(toggleButtonProps.ref, ref)}
- onKeyDown={onKeyDown}>
+ onKeyDown={onKeyDown}
+ {...readOnlyEventHandlers}>
{selectedItems.length > 0 && (
{
diff --git a/packages/react/src/components/MultiSelect/__tests__/MultiSelect-test.js b/packages/react/src/components/MultiSelect/__tests__/MultiSelect-test.js
index 091edd89eb16..a0dfbbaa769b 100644
--- a/packages/react/src/components/MultiSelect/__tests__/MultiSelect-test.js
+++ b/packages/react/src/components/MultiSelect/__tests__/MultiSelect-test.js
@@ -241,6 +241,20 @@ describe('MultiSelect', () => {
).toBeFalsy();
});
+ it('should not be interactive if readonly', () => {
+ const items = generateItems(4, generateGenericItem);
+ const label = 'test-label';
+ const { container } = render(
+
+ );
+ const labelNode = getByText(container, label);
+ Simulate.click(labelNode);
+
+ expect(
+ container.querySelector('[aria-expanded="true"][aria-haspopup="listbox"]')
+ ).toBeFalsy();
+ });
+
describe('Component API', () => {
it('should set the default selected items with the `initialSelectedItems` prop', () => {
const items = generateItems(4, generateGenericItem);
diff --git a/packages/react/src/components/NumberInput/NumberInput.js b/packages/react/src/components/NumberInput/NumberInput.js
index 5c61144dcd91..40fc469c2401 100644
--- a/packages/react/src/components/NumberInput/NumberInput.js
+++ b/packages/react/src/components/NumberInput/NumberInput.js
@@ -107,7 +107,6 @@ const NumberInput = React.forwardRef(function NumberInput(props, forwardRef) {
[`${prefix}--number__invalid`]:
normalizedProps.invalid || normalizedProps.warn,
[`${prefix}--number__invalid--warning`]: normalizedProps.warn,
- [`${prefix}--number__readonly-icon`]: readOnly,
});
if (controlledValue !== prevControlledValue) {
@@ -196,7 +195,7 @@ const NumberInput = React.forwardRef(function NumberInput(props, forwardRef) {
{
const state = {
value: clamp(max, min, parseInt(value) - step),
@@ -221,7 +220,7 @@ const NumberInput = React.forwardRef(function NumberInput(props, forwardRef) {
{
const state = {
value: clamp(max, min, parseInt(value) + step),
diff --git a/packages/react/src/components/NumberInput/__tests__/NumberInput-test.js b/packages/react/src/components/NumberInput/__tests__/NumberInput-test.js
index 32bfe638c9de..4679dcf2c464 100644
--- a/packages/react/src/components/NumberInput/__tests__/NumberInput-test.js
+++ b/packages/react/src/components/NumberInput/__tests__/NumberInput-test.js
@@ -323,4 +323,38 @@ describe('NumberInput', () => {
expect(screen.getByLabelText('test-label')).toHaveValue(0);
});
});
+
+ it('should respect readOnly prop', () => {
+ const onChange = jest.fn();
+ const onClick = jest.fn();
+
+ render(
+
+ );
+
+ const input = screen.getByRole('spinbutton');
+
+ // Click events should fire
+ userEvent.click(input);
+ expect(onClick).toHaveBeenCalledTimes(1);
+
+ // Change events should *not* fire
+ userEvent.type(input, '3');
+ expect(input).not.toHaveValue('3');
+
+ expect(screen.getByLabelText('increment')).toBeDisabled();
+ expect(screen.getByLabelText('decrement')).toBeDisabled();
+
+ userEvent.click(screen.getByLabelText('increment'));
+ userEvent.click(screen.getByLabelText('decrement'));
+
+ expect(onChange).toHaveBeenCalledTimes(0);
+ });
});
diff --git a/packages/react/src/components/OverflowMenu/OverflowMenu-story.js b/packages/react/src/components/OverflowMenu/OverflowMenu-story.js
deleted file mode 100644
index cc551aa1bcf9..000000000000
--- a/packages/react/src/components/OverflowMenu/OverflowMenu-story.js
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import React from 'react';
-import { action } from '@storybook/addon-actions';
-import { withKnobs, boolean, select, text } from '@storybook/addon-knobs';
-import { OverflowMenu } from './OverflowMenu';
-import OverflowMenuItem from '../OverflowMenuItem';
-import mdx from './OverflowMenu.mdx';
-import { Filter } from '@carbon/icons-react';
-
-const directions = {
- 'Bottom of the trigger button (bottom)': 'bottom',
- 'Top of the trigger button (top)': 'top',
-};
-
-const sizes = {
- 'Small (sm)': 'sm',
- 'Medium (md) - default': undefined,
- 'Large (lg)': 'lg',
-};
-
-const props = {
- menu: () => ({
- direction: select('Menu direction (direction)', directions, 'bottom'),
- ariaLabel: text('ARIA label (ariaLabel)', 'Menu'),
- iconDescription: text('Icon description (iconDescription)', ''),
- flipped: boolean('Flipped (flipped)', false),
- light: boolean('Light (light)', false),
- selectorPrimaryFocus: text(
- 'Primary focus element selector (selectorPrimaryFocus)',
- ''
- ),
- size: select('Size (size)', sizes, undefined) || undefined,
- onClick: action('onClick'),
- onFocus: action('onFocus'),
- onKeyDown: action('onKeyDown'),
- onClose: action('onClose'),
- onOpen: action('onOpen'),
- }),
- menuItem: () => ({
- className: 'some-class',
- disabled: boolean('Disabled (disabled)', false),
- requireTitle: boolean(
- 'Use hover over text for menu item (requireTitle)',
- false
- ),
- onClick: action('onClick'),
- hasDivider: boolean('Has divider (hasDivider)', false),
- isDelete: boolean('Is delete (isDelete)', false),
- }),
-};
-
-OverflowMenu.displayName = 'OverflowMenu';
-
-export default {
- title: 'Components/OverflowMenu',
- component: OverflowMenu,
- decorators: [withKnobs],
- subcomponents: {
- OverflowMenuItem,
- },
-
- parameters: {
- docs: {
- page: mdx,
- },
- },
-};
-
-export const Default = () => (
-
-
-
-
-
-
-
-);
-
-export const RenderCustomIcon = () => (
-
-
-
-
-);
-
-export const Playground = () => (
-
-
-
-
-
-
-
-);
diff --git a/packages/react/src/components/OverflowMenu/OverflowMenu.stories.js b/packages/react/src/components/OverflowMenu/OverflowMenu.stories.js
new file mode 100644
index 000000000000..e4451e56d6e9
--- /dev/null
+++ b/packages/react/src/components/OverflowMenu/OverflowMenu.stories.js
@@ -0,0 +1,137 @@
+/**
+ * Copyright IBM Corp. 2016, 2018
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+import React from 'react';
+import { OverflowMenu } from './OverflowMenu';
+import { default as OverflowMenuItem } from '../OverflowMenuItem';
+import { Filter } from '@carbon/icons-react';
+import mdx from './OverflowMenu.mdx';
+
+export default {
+ title: 'Components/OverflowMenu',
+ component: OverflowMenu,
+ subcomponents: {
+ OverflowMenuItem,
+ },
+ parameters: {
+ docs: {
+ page: mdx,
+ },
+ },
+};
+
+export const Default = () => (
+
+
+
+
+
+
+
+
+);
+
+export const RenderCustomIcon = () => (
+
+
+
+
+);
+
+export const Playground = (args) => (
+
+
+
+
+
+
+
+
+);
+
+Playground.argTypes = {
+ ariaLabel: {
+ table: {
+ disable: true,
+ },
+ },
+ children: {
+ table: {
+ disable: true,
+ },
+ },
+ className: {
+ table: {
+ disable: true,
+ },
+ },
+ direction: {
+ table: {
+ disable: true,
+ },
+ },
+ flipped: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: false,
+ },
+ focusTrap: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: false,
+ },
+ iconClass: {
+ table: {
+ disable: true,
+ },
+ },
+ iconDescription: {
+ control: { type: 'text' },
+ },
+ id: {
+ table: {
+ disable: true,
+ },
+ },
+ light: {
+ table: {
+ disable: true,
+ },
+ },
+ menuOffset: {
+ table: {
+ disable: true,
+ },
+ },
+ menuOffsetFlip: {
+ table: {
+ disable: true,
+ },
+ },
+ menuOptionsClass: {
+ table: {
+ disable: true,
+ },
+ },
+ open: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: false,
+ },
+ renderIcon: {
+ table: {
+ disable: true,
+ },
+ },
+ size: {
+ options: ['sm', 'md', 'lg'],
+ control: { type: 'select' },
+ },
+};
diff --git a/packages/react/src/components/OverflowMenu/index.js b/packages/react/src/components/OverflowMenu/index.js
index 7f64d2789748..a3ea0fa7e175 100644
--- a/packages/react/src/components/OverflowMenu/index.js
+++ b/packages/react/src/components/OverflowMenu/index.js
@@ -5,10 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
-import * as FeatureFlags from '@carbon/feature-flags';
import { OverflowMenu } from './OverflowMenu';
import { createClassWrapper } from '../../internal/createClassWrapper';
-export default FeatureFlags.enabled('enable-v11-release')
- ? createClassWrapper(OverflowMenu)
- : OverflowMenu;
+export default createClassWrapper(OverflowMenu);
diff --git a/packages/react/src/components/OverflowMenu/next/OverflowMenu.stories.js b/packages/react/src/components/OverflowMenu/next/OverflowMenu.stories.js
deleted file mode 100644
index d9a27cf98e46..000000000000
--- a/packages/react/src/components/OverflowMenu/next/OverflowMenu.stories.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import React from 'react';
-import { OverflowMenu } from '../OverflowMenu';
-import { default as OverflowMenuItem } from '../../OverflowMenuItem';
-import { Filter } from '@carbon/icons-react';
-import mdx from '../OverflowMenu.mdx';
-
-export default {
- title: 'Components/OverflowMenu',
- component: OverflowMenu,
- argTypes: {
- size: {
- options: ['sm', 'md', 'lg'],
- control: { type: 'select' },
- },
- light: {
- table: {
- disable: true,
- },
- },
- },
- args: {
- size: 'md',
- },
- subcomponents: {
- OverflowMenuItem,
- },
- parameters: {
- docs: {
- page: mdx,
- },
- },
-};
-
-export const Default = (args) => (
-
-
-
-
-
-
-
-
-);
-
-export const RenderCustomIcon = (args) => (
-
-
-
-
-);
diff --git a/packages/react/src/components/Pagination/Pagination.stories.js b/packages/react/src/components/Pagination/Pagination.stories.js
index 3b8c1883a5da..f8d20fe8dac7 100644
--- a/packages/react/src/components/Pagination/Pagination.stories.js
+++ b/packages/react/src/components/Pagination/Pagination.stories.js
@@ -98,3 +98,99 @@ export const PaginationWithCustomPageSizesLabel = (args) => {
PaginationWithCustomPageSizesLabel.storyName =
'Pagination with custom page sizes label';
+
+export const Playground = (args) => ;
+
+Playground.argTypes = {
+ className: {
+ control: false,
+ },
+ id: {
+ control: false,
+ },
+ itemText: {
+ control: false,
+ },
+ backwardText: {
+ control: {
+ type: 'text',
+ },
+ defaultValue: 'Previous page',
+ },
+ forwardText: {
+ control: {
+ type: 'text',
+ },
+ defaultValue: 'Next page',
+ },
+ disabled: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: 'false',
+ },
+ isLastPage: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: 'false',
+ },
+ itemsPerPageText: {
+ control: {
+ type: 'text',
+ },
+ defaultValue: 'Items per page:',
+ },
+ page: {
+ control: {
+ type: 'number',
+ },
+ defaultValue: 1,
+ },
+ pageInputDisabled: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: 'false',
+ },
+ pageSize: {
+ control: {
+ type: 'number',
+ },
+ defaultValue: 10,
+ },
+ pageSizes: {
+ control: {
+ type: 'array',
+ },
+ defaultValue: [10, 20, 30, 40, 50],
+ },
+ pageNumberText: {
+ control: {
+ type: 'text',
+ },
+ defaultValue: 'Page Number',
+ },
+ pagesUnknown: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: 'false',
+ },
+ pageSizeInputDisabled: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: 'false',
+ },
+ size: {
+ options: ['sm', 'md', 'lg'],
+ control: { type: 'select' },
+ },
+ totalItems: {
+ control: {
+ type: 'number',
+ },
+ defaultValue: 103,
+ },
+};
diff --git a/packages/react/src/components/Pagination/experimental/Pagination-story.js b/packages/react/src/components/Pagination/experimental/Pagination-story.js
index cda2d3d73a94..b1564177e42c 100644
--- a/packages/react/src/components/Pagination/experimental/Pagination-story.js
+++ b/packages/react/src/components/Pagination/experimental/Pagination-story.js
@@ -17,7 +17,7 @@ import {
import {
unstable_PageSelector as PageSelector,
unstable_Pagination as Pagination,
-} from '../../../';
+} from '../../..';
const props = () => ({
disabled: boolean('Disable backward/forward buttons (disabled)', false),
@@ -74,3 +74,71 @@ export const WithNoSizerChildInputOrChildSelector = () => (
WithNoSizerChildInputOrChildSelector.storyName =
'with no sizer, child input, or child selector';
+
+export const Playground = (args) => ;
+
+Playground.argTypes = {
+ className: {
+ control: false,
+ },
+ children: {
+ control: false,
+ },
+ id: {
+ control: false,
+ },
+ itemText: {
+ control: false,
+ },
+ forwardText: {
+ control: {
+ type: 'text',
+ },
+ defaultValue: 'Next page',
+ },
+ disabled: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: 'false',
+ },
+ itemRangeText: {
+ control: false,
+ },
+ itemsPerPageText: {
+ control: {
+ type: 'text',
+ },
+ defaultValue: 'Items per page:',
+ },
+ initialPage: {
+ control: {
+ type: 'number',
+ },
+ defaultValue: 1,
+ },
+ pageSize: {
+ control: {
+ type: 'number',
+ },
+ defaultValue: 10,
+ },
+ pageSizes: {
+ control: {
+ type: 'array',
+ },
+ defaultValue: [10, 20, 30, 40, 50],
+ },
+ pagesUnknown: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: 'false',
+ },
+ totalItems: {
+ control: {
+ type: 'number',
+ },
+ defaultValue: 350,
+ },
+};
diff --git a/packages/react/src/components/Popover/next/Popover.mdx b/packages/react/src/components/Popover/Popover.mdx
similarity index 100%
rename from packages/react/src/components/Popover/next/Popover.mdx
rename to packages/react/src/components/Popover/Popover.mdx
diff --git a/packages/react/src/components/Popover/next/Popover.stories.js b/packages/react/src/components/Popover/Popover.stories.js
similarity index 98%
rename from packages/react/src/components/Popover/next/Popover.stories.js
rename to packages/react/src/components/Popover/Popover.stories.js
index 2ffa10985d5f..c34f4eb4fd8e 100644
--- a/packages/react/src/components/Popover/next/Popover.stories.js
+++ b/packages/react/src/components/Popover/Popover.stories.js
@@ -8,7 +8,7 @@
import './story.scss';
import { Checkbox } from '@carbon/icons-react';
import React from 'react';
-import { Popover, PopoverContent } from '../../Popover';
+import { Popover, PopoverContent } from '../Popover';
import mdx from './Popover.mdx';
export default {
diff --git a/packages/react/src/components/Popover/next/story.scss b/packages/react/src/components/Popover/story.scss
similarity index 100%
rename from packages/react/src/components/Popover/next/story.scss
rename to packages/react/src/components/Popover/story.scss
diff --git a/packages/react/src/components/ProgressBar/ProgressBar-story.js b/packages/react/src/components/ProgressBar/ProgressBar-story.js
deleted file mode 100644
index 525e6c2484e0..000000000000
--- a/packages/react/src/components/ProgressBar/ProgressBar-story.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * Copyright IBM Corp. 2021
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import React, { useState, useEffect } from 'react';
-
-import {
- withKnobs,
- text,
- boolean,
- number,
- select,
-} from '@storybook/addon-knobs';
-import ProgressBar from '../ProgressBar';
-
-const sizes = {
- 'Small (small)': 'small',
- 'Big (big) - default': 'big',
-};
-
-const types = {
- 'Default (default)': 'default',
- 'Inline (inline)': 'inline',
- 'indented (indented)': 'indented',
-};
-
-const props = () => ({
- helperText: text('Helper text (helperText)', 'Optional helper text'),
- hideLabel: boolean('Hide the label (hideLabel)', false),
- label: text('Label text (label)', 'Progress bar label'),
- max: number('Maximum value (max)', 100),
- size: select('Size (size)', sizes, 'big'),
- type: select('Type (type)', types, 'default'),
- value: number('Current value (value)', 75),
-});
-
-export default {
- title: 'Experimental/unstable_ProgressBar',
- component: ProgressBar,
- decorators: [withKnobs],
-};
-
-export const Default = () => (
-
-);
-
-export const Indeterminate = () => (
-
-);
-
-export const Example = () => {
- const size = 728;
- const [progress, setProgress] = useState(0);
-
- useEffect(() => {
- setTimeout(() => {
- const interval = setInterval(() => {
- setProgress((currentProgress) => {
- const advancement = Math.random() * 8;
- if (currentProgress + advancement < size) {
- return currentProgress + advancement;
- } else {
- clearInterval(interval);
- return size;
- }
- });
- }, 50);
- }, 3000);
- }, []);
-
- const running = progress > 0;
-
- let helperText = running
- ? `${progress.toFixed(1)}MB of ${size}MB`
- : 'Fetching assets...';
- if (progress >= size) {
- helperText = 'Done';
- }
-
- return (
-
- );
-};
-
-export const Playground = () => ;
diff --git a/packages/react/src/components/ProgressBar/next/ProgressBar.stories.js b/packages/react/src/components/ProgressBar/ProgressBar.stories.js
similarity index 92%
rename from packages/react/src/components/ProgressBar/next/ProgressBar.stories.js
rename to packages/react/src/components/ProgressBar/ProgressBar.stories.js
index a7c48d0c87f7..d0cc7541f3e5 100644
--- a/packages/react/src/components/ProgressBar/next/ProgressBar.stories.js
+++ b/packages/react/src/components/ProgressBar/ProgressBar.stories.js
@@ -7,7 +7,7 @@
import React, { useState, useEffect } from 'react';
-import ProgressBar from '../';
+import ProgressBar from './';
export default {
title: 'Components/ProgressBar',
@@ -33,6 +33,14 @@ const PlaygroundStory = (args) => (
export const Playground = PlaygroundStory.bind({});
Playground.argTypes = {
+ className: {
+ table: {
+ disable: true,
+ },
+ },
+ hideLabel: {
+ control: { type: 'boolean' },
+ },
status: {
options: ['active', 'finished', 'error'],
control: { type: 'select' },
diff --git a/packages/react/src/components/ProgressIndicator/ProgressIndicator.stories.js b/packages/react/src/components/ProgressIndicator/ProgressIndicator.stories.js
index 97b8a2b522a6..21c7e1d7eef1 100644
--- a/packages/react/src/components/ProgressIndicator/ProgressIndicator.stories.js
+++ b/packages/react/src/components/ProgressIndicator/ProgressIndicator.stories.js
@@ -72,3 +72,64 @@ export const Interactive = () => (
);
export const Skeleton = () => ;
+
+export const Playground = (args) => (
+
+
+
+
+
+
+
+);
+
+Playground.argTypes = {
+ children: {
+ table: {
+ disable: true,
+ },
+ },
+ className: {
+ table: {
+ disable: true,
+ },
+ },
+ onChange: {
+ table: {
+ disable: true,
+ },
+ },
+ currentIndex: {
+ control: { type: 'number' },
+ defaultValue: 0,
+ },
+ spaceEqually: {
+ control: { type: 'boolean' },
+ defaultValue: false,
+ },
+ vertical: {
+ control: { type: 'boolean' },
+ defaultValue: false,
+ },
+};
diff --git a/packages/react/src/components/Skeleton/next/Skeleton.stories.js b/packages/react/src/components/Skeleton/next/Skeleton.stories.js
deleted file mode 100644
index fedceb323bf4..000000000000
--- a/packages/react/src/components/Skeleton/next/Skeleton.stories.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import React from 'react';
-import SkeletonText from '../../SkeletonText';
-import SkeletonPlaceholder from '../../SkeletonPlaceholder';
-import { withKnobs, select, boolean, number } from '@storybook/addon-knobs';
-
-const classNames = {
- 'my--skeleton__placeholder--small': 'my--skeleton__placeholder--small',
- 'my--skeleton__placeholder--medium': 'my--skeleton__placeholder--medium',
- 'my--skeleton__placeholder--large': 'my--skeleton__placeholder--large',
-};
-
-const placeholderProps = () => ({
- className: select('Classes with different sizes', classNames),
-});
-
-const widths = {
- '100%': '100%',
- '250px': '250px',
-};
-
-const textProps = () => ({
- heading: boolean('Skeleton text at a larger size (heading)'),
- paragraph: boolean('Use multiple lines of text (paragraph)'),
- lineCount: number('The number of lines in a paragraph (lineCount)', 3),
- width: select(
- 'Width (in px or %) of single line of text or max-width of paragraph lines (width)',
- widths,
- '100%'
- ),
-});
-
-export default {
- title: 'Components/Skeleton',
- component: SkeletonText,
- decorators: [withKnobs],
- subcomponents: {
- SkeletonPlaceholder,
- },
-};
-
-export const _SkeletonPlaceholder = () => {
- return (
-
-
-
-
- );
-};
-
-export const _SkeletonText = () => {
- return (
-
-
-
- );
-};
diff --git a/packages/react/src/components/SkeletonIcon/SkeletonIcon-story.js b/packages/react/src/components/SkeletonIcon/SkeletonIcon.stories.js
similarity index 93%
rename from packages/react/src/components/SkeletonIcon/SkeletonIcon-story.js
rename to packages/react/src/components/SkeletonIcon/SkeletonIcon.stories.js
index 2e0c53df571d..9df544045cc1 100644
--- a/packages/react/src/components/SkeletonIcon/SkeletonIcon-story.js
+++ b/packages/react/src/components/SkeletonIcon/SkeletonIcon.stories.js
@@ -6,7 +6,7 @@
*/
import React from 'react';
-import SkeletonIcon from '../SkeletonIcon';
+import SkeletonIcon from '.';
const propsSkeleton = {
style: {
diff --git a/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder-story.js b/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder-story.js
deleted file mode 100644
index f633c0b07323..000000000000
--- a/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder-story.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-/* eslint-disable no-console */
-
-import React from 'react';
-
-import { withKnobs, select } from '@storybook/addon-knobs';
-import SkeletonPlaceholder from '../SkeletonPlaceholder';
-import mdx from './SkeletonPlaceholder.mdx';
-
-const classNames = {
- 'my--skeleton__placeholder--small': 'my--skeleton__placeholder--small',
- 'my--skeleton__placeholder--medium': 'my--skeleton__placeholder--medium',
- 'my--skeleton__placeholder--large': 'my--skeleton__placeholder--large',
-};
-
-const props = () => ({
- className: select('Classes with different sizes', classNames),
-});
-
-export default {
- title: 'Components/Skeleton/SkeletonPlaceholder',
- component: SkeletonPlaceholder,
- decorators: [withKnobs],
- parameters: {
- docs: {
- page: mdx,
- },
- },
-};
-
-export const Default = () => (
-
-
-
-
-);
diff --git a/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder.js b/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder.js
index f727d76ff63e..25476067ef07 100644
--- a/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder.js
+++ b/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder.js
@@ -22,7 +22,8 @@ const SkeletonPlaceholder = ({ className, ...other }) => {
SkeletonPlaceholder.propTypes = {
/**
- * the class to be applied to the component
+ * Add a custom class to the component
+ * to set the height and width
*/
className: PropTypes.string,
};
diff --git a/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder.mdx b/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder.mdx
index 2339e16f81e1..e471aaa083a6 100644
--- a/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder.mdx
+++ b/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder.mdx
@@ -1,4 +1,4 @@
-import { Props } from '@storybook/addon-docs';
+import { Story, Props, Preview } from '@storybook/addon-docs';
# SkeletonPlaceholder
@@ -10,6 +10,10 @@ import { Props } from '@storybook/addon-docs';
## Overview
+
+
+
+
## Component API
diff --git a/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder.stories.js b/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder.stories.js
new file mode 100644
index 000000000000..ae180b24bdb0
--- /dev/null
+++ b/packages/react/src/components/SkeletonPlaceholder/SkeletonPlaceholder.stories.js
@@ -0,0 +1,25 @@
+/**
+ * Copyright IBM Corp. 2016, 2018
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+/* eslint-disable no-console */
+
+import React from 'react';
+
+import SkeletonPlaceholder from '.';
+import mdx from './SkeletonPlaceholder.mdx';
+
+export default {
+ title: 'Components/Skeleton/SkeletonPlaceholder',
+ component: SkeletonPlaceholder,
+ parameters: {
+ docs: {
+ page: mdx,
+ },
+ },
+};
+
+export const Default = () => ;
diff --git a/packages/react/src/components/SkeletonText/SkeletonText-story.js b/packages/react/src/components/SkeletonText/SkeletonText-story.js
deleted file mode 100644
index 3fb2f800e799..000000000000
--- a/packages/react/src/components/SkeletonText/SkeletonText-story.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-/* eslint-disable no-console */
-
-import React from 'react';
-
-import { withKnobs, boolean, number, select } from '@storybook/addon-knobs';
-import SkeletonText from '../SkeletonText';
-import mdx from './SkeletonText.mdx';
-
-const widths = {
- '100%': '100%',
- '250px': '250px',
-};
-
-const props = () => ({
- heading: boolean('Skeleton text at a larger size (heading)'),
- paragraph: boolean('Use multiple lines of text (paragraph)'),
- lineCount: number('The number of lines in a paragraph (lineCount)', 3),
- width: select(
- 'Width (in px or %) of single line of text or max-width of paragraph lines (width)',
- widths,
- '100%'
- ),
-});
-
-export default {
- title: 'Components/Skeleton/SkeletonText',
- component: SkeletonText,
- decorators: [withKnobs],
- parameters: {
- docs: {
- page: mdx,
- },
- },
-};
-
-export const Default = () => (
-
-
-
-);
diff --git a/packages/react/src/components/SkeletonText/SkeletonText.js b/packages/react/src/components/SkeletonText/SkeletonText.js
index 64b600825a60..236fc26bdfa9 100644
--- a/packages/react/src/components/SkeletonText/SkeletonText.js
+++ b/packages/react/src/components/SkeletonText/SkeletonText.js
@@ -83,7 +83,7 @@ SkeletonText.propTypes = {
*/
heading: PropTypes.bool,
/**
- * the number of lines in a paragraph
+ * the number of lines shown if paragraph is true
*/
lineCount: PropTypes.number,
/**
diff --git a/packages/react/src/components/SkeletonText/SkeletonText.mdx b/packages/react/src/components/SkeletonText/SkeletonText.mdx
index 1998e728e43b..b0ebe6a32e2f 100644
--- a/packages/react/src/components/SkeletonText/SkeletonText.mdx
+++ b/packages/react/src/components/SkeletonText/SkeletonText.mdx
@@ -1,4 +1,4 @@
-import { Props } from '@storybook/addon-docs';
+import { Story, Props, Preview } from '@storybook/addon-docs';
# SkeletonText
@@ -10,6 +10,10 @@ import { Props } from '@storybook/addon-docs';
## Overview
+
+
+
+
## Component API
diff --git a/packages/react/src/components/SkeletonText/SkeletonText.stories.js b/packages/react/src/components/SkeletonText/SkeletonText.stories.js
new file mode 100644
index 000000000000..086d79118ff4
--- /dev/null
+++ b/packages/react/src/components/SkeletonText/SkeletonText.stories.js
@@ -0,0 +1,57 @@
+/**
+ * Copyright IBM Corp. 2016, 2018
+ *
+ * This source code is licensed under the Apache-2.0 license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+/* eslint-disable no-console */
+
+import React from 'react';
+
+import SkeletonText from '.';
+import mdx from './SkeletonText.mdx';
+
+export default {
+ title: 'Components/Skeleton/SkeletonText',
+ component: SkeletonText,
+ parameters: {
+ docs: {
+ page: mdx,
+ },
+ },
+};
+
+export const Default = () => ;
+
+export const Playground = (args) => ;
+
+Playground.argTypes = {
+ className: {
+ control: false,
+ },
+ heading: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: false,
+ },
+ paragraph: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: false,
+ },
+ width: {
+ control: {
+ type: 'text',
+ },
+ defaultValue: '100%',
+ },
+ lineCount: {
+ control: {
+ type: 'number',
+ },
+ defaultValue: 3,
+ },
+};
diff --git a/packages/react/src/components/Slider/Slider-story.js b/packages/react/src/components/Slider/Slider-story.js
deleted file mode 100644
index 8e27a5cf15da..000000000000
--- a/packages/react/src/components/Slider/Slider-story.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import React, { useState } from 'react';
-import { action } from '@storybook/addon-actions';
-
-import { withKnobs, boolean, number, text } from '@storybook/addon-knobs';
-import Slider from '../Slider';
-import SliderSkeleton from '../Slider/Slider.Skeleton';
-import { sliderValuePropSync } from '../../internal/FeatureFlags';
-import mdx from './Slider.mdx';
-
-const props = () => ({
- name: text('Form item name (name)', ''),
- inputType: text('The form element type (inputType)', 'number'),
- ariaLabelInput: text(
- 'The ARIA label for the (ariaLabelInput)',
- 'Label for slider value'
- ),
- disabled: boolean('Disabled (disabled)', false),
- light: boolean('Light variant (light)', false),
- hideTextInput: boolean('Without text input (hideTextInput)', false),
- value: !sliderValuePropSync ? 50 : number('The value (value)', 50),
- min: number('The minimum value (min)', 0),
- max: number('The maximum value (max)', 100),
- step: number('The step (step)', 1),
- stepMultiplier: number(
- 'The step factor for Shift+arrow keys (stepMultiplier)',
- 5
- ),
- labelText: text('Label text (labelText)', 'Slider Label'),
- minLabel: text('Label for minimum value (minLabel)', ''),
- maxLabel: text('Label for maximum value (maxLabel)', ''),
- onChange: action('onChange'),
- onRelease: action('onRelease'),
-});
-
-export default {
- title: 'Components/Slider',
- component: Slider,
- decorators: [withKnobs],
- subcomponents: {
- SliderSkeleton,
- },
- parameters: {
- docs: {
- page: mdx,
- },
- },
-};
-
-export const Default = () => (
-
-);
-
-export const Playground = () => ;
-
-export const ControlledSlider = () => {
- const [val, setVal] = useState(87);
- return (
- <>
- setVal(Math.round(Math.random() * 100))}>
- randomize value
-
- setVal(value)}
- />
- {val}
- >
- );
-};
-
-export const Skeleton = () => ;
diff --git a/packages/react/src/components/Slider/Slider-test.js b/packages/react/src/components/Slider/Slider-test.js
index c874aada82ba..0dd69acf8e60 100644
--- a/packages/react/src/components/Slider/Slider-test.js
+++ b/packages/react/src/components/Slider/Slider-test.js
@@ -6,9 +6,8 @@
*/
import React from 'react';
-import Slider from '../Slider';
-import SliderSkeleton from '../Slider/Slider.Skeleton';
-import { mount, shallow } from 'enzyme';
+import Slider from './Slider';
+import { mount } from 'enzyme';
import 'requestanimationframe';
import throttle from 'lodash.throttle';
@@ -440,15 +439,3 @@ describe('Slider', () => {
});
});
});
-
-describe('SliderSkeleton', () => {
- describe('Renders as expected', () => {
- const wrapper = shallow( );
-
- const slider = wrapper.find(`.${prefix}--slider-container`);
-
- it('Has the expected classes', () => {
- expect(slider.hasClass(`${prefix}--skeleton`)).toEqual(true);
- });
- });
-});
diff --git a/packages/react/src/components/Slider/Slider.mdx b/packages/react/src/components/Slider/Slider.mdx
index 99d671962ce5..fd3da1325c21 100644
--- a/packages/react/src/components/Slider/Slider.mdx
+++ b/packages/react/src/components/Slider/Slider.mdx
@@ -21,11 +21,24 @@ Sliders provide a visual indication of adjustable content, where the user can
increase or decrease the value by moving the handle along a horizontal track.
-
+
## Component API
+###
+
+### `step` Prop
+
+If a `step` value other than `1` is provided, any number entered into the text
+input must adhere to the step value. For example, if the `step` is `5`, with a
+range of values from `0-100`, `40` would be valid, and `42` would be considered
+`invalid`.
+
+
+
+
+
## Feedback
diff --git a/packages/react/src/components/Slider/next/Slider.stories.js b/packages/react/src/components/Slider/Slider.stories.js
similarity index 73%
rename from packages/react/src/components/Slider/next/Slider.stories.js
rename to packages/react/src/components/Slider/Slider.stories.js
index a10dcc24cfae..a7fdb318dd6b 100644
--- a/packages/react/src/components/Slider/next/Slider.stories.js
+++ b/packages/react/src/components/Slider/Slider.stories.js
@@ -6,9 +6,9 @@
*/
import React, { useState } from 'react';
-import { SliderSkeleton } from '../../Slider';
-import Slider from '../Slider';
-import { Layer } from '../../Layer';
+import { SliderSkeleton } from '.';
+import Slider from './Slider';
+import { Layer } from '../Layer';
import mdx from './Slider.mdx';
export default {
@@ -17,48 +17,6 @@ export default {
subcomponents: {
SliderSkeleton,
},
- argTypes: {
- light: {
- table: {
- disable: true,
- },
- },
- children: {
- table: {
- disable: true,
- },
- },
- disabled: {
- control: { type: 'boolean' },
- },
- labelText: {
- control: { type: 'string' },
- defaultValue: 'Slider (must be an increment of 5)',
- },
- min: {
- control: { type: 'number' },
- defaultValue: 0,
- },
- max: {
- control: { type: 'number' },
- defaultValue: 100,
- },
- required: {
- control: { type: 'boolean' },
- },
- step: {
- control: { type: 'number' },
- defaultValue: 5,
- },
- stepMultiplier: {
- control: { type: 'number' },
- defaultValue: 5,
- },
- value: {
- control: { type: 'number' },
- defaultValue: 50,
- },
- },
parameters: {
docs: {
page: mdx,
@@ -66,9 +24,8 @@ export default {
},
};
-export const Default = (args) => (
+export const Default = () => (
(
/>
);
-export const Playground = (args) => (
-
-);
-
export const ControlledSlider = () => {
const [val, setVal] = useState(87);
return (
@@ -193,3 +143,84 @@ export const ControlledSliderWithLayer = () => {
};
export const Skeleton = () => ;
+
+export const Playground = (args) => (
+
+);
+
+Playground.argTypes = {
+ light: {
+ table: {
+ disable: true,
+ },
+ },
+ children: {
+ table: {
+ disable: true,
+ },
+ },
+ className: {
+ table: {
+ disable: true,
+ },
+ },
+ disabled: {
+ control: { type: 'boolean' },
+ },
+ formatLabel: {
+ table: {
+ disable: true,
+ },
+ },
+ labelText: {
+ table: {
+ disable: true,
+ },
+ },
+ min: {
+ control: { type: 'number' },
+ defaultValue: 0,
+ },
+ max: {
+ control: { type: 'number' },
+ defaultValue: 100,
+ },
+ required: {
+ control: { type: 'boolean' },
+ },
+ step: {
+ control: { type: 'number' },
+ defaultValue: 5,
+ },
+ stepMultiplier: {
+ control: { type: 'number' },
+ defaultValue: 5,
+ },
+ value: {
+ control: { type: 'number' },
+ defaultValue: 50,
+ },
+ onBlur: {
+ table: {
+ disable: true,
+ },
+ },
+ onChange: {
+ table: {
+ disable: true,
+ },
+ },
+ onInputKeyUp: {
+ table: {
+ disable: true,
+ },
+ },
+ onRelease: {
+ table: {
+ disable: true,
+ },
+ },
+};
diff --git a/packages/react/src/components/Slider/index.js b/packages/react/src/components/Slider/index.js
index d9158d20caec..cafd4a329234 100644
--- a/packages/react/src/components/Slider/index.js
+++ b/packages/react/src/components/Slider/index.js
@@ -5,12 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
-import * as FeatureFlags from '@carbon/feature-flags';
import Slider from './Slider';
import { createClassWrapper } from '../../internal/createClassWrapper';
export { default as SliderSkeleton } from './Slider.Skeleton';
-
-export default FeatureFlags.enabled('enable-v11-release')
- ? createClassWrapper(Slider)
- : Slider;
+export default createClassWrapper(Slider);
diff --git a/packages/react/src/components/Slider/next/Slider.mdx b/packages/react/src/components/Slider/next/Slider.mdx
deleted file mode 100644
index 91940192b2ac..000000000000
--- a/packages/react/src/components/Slider/next/Slider.mdx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { Props, Story, Preview } from '@storybook/addon-docs';
-
-# Slider
-
-[Source code](https://github.com/carbon-design-system/carbon/tree/main/packages/react/src/components/Slider)
- |
-[Usage guidelines](https://www.carbondesignsystem.com/components/slider/usage)
- |
-[Accessibility](https://www.carbondesignsystem.com/components/slider/accessibility)
-
-## Table of Contents
-
-- [Slider](#slider)
- - [Overview](#overview)
- - [Component API](#component-api)
- - [Feedback](#feedback)
-
-## Overview
-
-Sliders provide a visual indication of adjustable content, where the user can
-increase or decrease the value by moving the handle along a horizontal track.
-
-
-
-
-
-## Component API
-
-###
-
-### `step` Prop
-
-If a `step` value other than `1` is provided, any number entered into the text
-input must adhere to the step value. For example, if the `step` is `5`, with a
-range of values from `0-100`, `40` would be valid, and `42` would be considered
-`invalid`.
-
-
-
-
-
-
-
-## Feedback
-
-Help us improve this component by providing feedback, asking questions on Slack,
-or updating this file on
-[GitHub](https://github.com/carbon-design-system/carbon/edit/main/packages/react/src/components/Slider/Slider.mdx).
diff --git a/packages/react/src/components/StructuredList/StructuredList-test.js b/packages/react/src/components/StructuredList/StructuredList-test.js
index 3afc1cbe4985..510347f55049 100644
--- a/packages/react/src/components/StructuredList/StructuredList-test.js
+++ b/packages/react/src/components/StructuredList/StructuredList-test.js
@@ -25,11 +25,13 @@ describe('StructuredListWrapper', () => {
);
it('should have the expected classes', () => {
- expect(wrapper.hasClass(`${prefix}--structured-list`)).toEqual(true);
+ expect(
+ wrapper.find('div').hasClass(`${prefix}--structured-list`)
+ ).toEqual(true);
});
it('Should add extra classes that are passed via className', () => {
- expect(wrapper.hasClass('extra-class')).toEqual(true);
+ expect(wrapper.find('div').hasClass('extra-class')).toEqual(true);
});
it('By default, selection prop is false', () => {
@@ -40,9 +42,23 @@ describe('StructuredListWrapper', () => {
it('Should add the modifier class for selection when selection prop is true', () => {
wrapper.setProps({ selection: true });
- expect(wrapper.hasClass(`${prefix}--structured-list--selection`)).toEqual(
- true
- );
+ expect(
+ wrapper.find('div').hasClass(`${prefix}--structured-list--selection`)
+ ).toEqual(true);
+ });
+
+ it('Should add the modifier class for condensed when isCondensed prop is true', () => {
+ wrapper.setProps({ isCondensed: true });
+ expect(
+ wrapper.find('div').hasClass(`${prefix}--structured-list--condensed`)
+ ).toEqual(true);
+ });
+
+ it('Should add the modifier class for flush when isFlush prop is true', () => {
+ wrapper.setProps({ isFlush: true });
+ expect(
+ wrapper.find('div').hasClass(`${prefix}--structured-list--flush`)
+ ).toEqual(true);
});
});
});
@@ -119,16 +135,6 @@ describe('StructuredListRow', () => {
).toEqual(true);
});
- it('should use HTML by default (or when label prop is false)', () => {
- const wrapperLabel = shallow(
);
- expect(wrapperLabel.getElement().type).toEqual('div');
- });
-
- it('should use
HTML when label prop is true', () => {
- const wrapperLabel = shallow( );
- expect(wrapperLabel.getElement().type).toEqual('label');
- });
-
it('Should accept other props from ...other', () => {
const wrapperProps = shallow(
hi
diff --git a/packages/react/src/components/StructuredList/StructuredList.js b/packages/react/src/components/StructuredList/StructuredList.js
index 0d779247f53e..e3fc3b829dcf 100644
--- a/packages/react/src/components/StructuredList/StructuredList.js
+++ b/packages/react/src/components/StructuredList/StructuredList.js
@@ -5,14 +5,15 @@
* LICENSE file in the root directory of this source tree.
*/
-import React from 'react';
+import React, { useState } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
-import setupGetInstanceId from '../../tools/setupGetInstanceId';
+import { useId } from '../../internal/useId';
import deprecate from '../../prop-types/deprecate';
import { usePrefix } from '../../internal/usePrefix';
-const getInstanceId = setupGetInstanceId();
+const GridSelectedRowStateContext = React.createContext(null);
+const GridSelectedRowDispatchContext = React.createContext(null);
export function StructuredListWrapper(props) {
const {
@@ -22,7 +23,6 @@ export function StructuredListWrapper(props) {
ariaLabel,
isCondensed,
isFlush,
- border: _border,
...other
} = props;
const prefix = usePrefix();
@@ -31,11 +31,16 @@ export function StructuredListWrapper(props) {
[`${prefix}--structured-list--condensed`]: isCondensed,
[`${prefix}--structured-list--flush`]: isFlush,
});
+ const [selectedRow, setSelectedRow] = React.useState(null);
return (
-
- {children}
-
+
+
+
+ {children}
+
+
+
);
}
@@ -45,14 +50,6 @@ StructuredListWrapper.propTypes = {
*/
ariaLabel: PropTypes.string,
- /**
- * Specify whether a border should be added to your StructuredListWrapper
- */
- border: deprecate(
- PropTypes.bool,
- `\nThe prop \`border\` will be removed in the next major version of Carbon.`
- ),
-
/**
* Provide the contents of your StructuredListWrapper
*/
@@ -81,9 +78,9 @@ StructuredListWrapper.propTypes = {
StructuredListWrapper.defaultProps = {
selection: false,
- ariaLabel: 'Structured list section',
isCondensed: false,
isFlush: false,
+ ariaLabel: 'Structured list section',
};
export function StructuredListHead(props) {
@@ -145,26 +142,41 @@ StructuredListBody.defaultProps = {
onKeyDown: () => {},
};
+const GridRowContext = React.createContext(null);
+
export function StructuredListRow(props) {
- const { onKeyDown, tabIndex, children, className, head, label, ...other } =
- props;
+ const { onKeyDown, children, className, head, ...other } = props;
+ const [hasFocusWithin, setHasFocusWithin] = useState(false);
+ const id = useId('grid-input');
+ const setSelectedRow = React.useContext(GridSelectedRowDispatchContext);
const prefix = usePrefix();
+ const value = { id };
const classes = classNames(`${prefix}--structured-list-row`, className, {
[`${prefix}--structured-list-row--header-row`]: head,
+ [`${prefix}--structured-list-row--focused-within`]: hasFocusWithin,
});
- return label ? (
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions
-
+ {children}
+
+ ) : (
+ // eslint-disable-next-line jsx-a11y/interactive-supports-focus
+ setSelectedRow(id)}
+ onFocus={() => {
+ setHasFocusWithin(true);
+ }}
+ onBlur={() => {
+ setHasFocusWithin(false);
+ }}
onKeyDown={onKeyDown}>
- {children}
-
- ) : (
-
- {children}
+
+ {children}
+
);
}
@@ -188,41 +200,53 @@ StructuredListRow.propTypes = {
/**
* Specify whether a `
` should be used
*/
- label: PropTypes.bool,
+ label: deprecate(
+ PropTypes.bool,
+ `\nThe \`label\` prop is no longer needed and will be removed in the next major version of Carbon.`
+ ),
/**
* Provide a handler that is invoked on the key down event for the control,
- * if `` is in use
*/
onKeyDown: PropTypes.func,
-
- /**
- * Specify the tab index of the container node, if `` is in use
- */
- tabIndex: PropTypes.number,
};
StructuredListRow.defaultProps = {
head: false,
- label: false,
- tabIndex: 0,
onKeyDown: () => {},
};
export function StructuredListInput(props) {
- const { className, value, name, title, id, ...other } = props;
+ const defaultId = useId('structureListInput');
+ const {
+ className,
+ name = `structured-list-input-${defaultId}`,
+ title,
+ id,
+ ...other
+ } = props;
const prefix = usePrefix();
- const classes = classNames(`${prefix}--structured-list-input`, className);
- const instanceId = id || getInstanceId();
+ const classes = classNames(
+ `${prefix}--structured-list-input`,
+ `${prefix}--visually-hidden`,
+ className
+ );
+ const row = React.useContext(GridRowContext);
+ const selectedRow = React.useContext(GridSelectedRowStateContext);
+ const setSelectedRow = React.useContext(GridSelectedRowDispatchContext);
return (
{
+ setSelectedRow(event.target.value);
+ }}
+ id={id ?? defaultId}
className={classes}
- value={value}
name={name}
title={title}
/>
@@ -238,7 +262,10 @@ StructuredListInput.propTypes = {
/**
* Specify whether the underlying input should be checked by default
*/
- defaultChecked: PropTypes.bool,
+ defaultChecked: deprecate(
+ PropTypes.bool,
+ `\nThe prop \`defaultChecked\` is no longer needed and will be removed in the next major version of Carbon.`
+ ),
/**
* Specify a custom `id` for the input
@@ -253,7 +280,10 @@ StructuredListInput.propTypes = {
/**
* Provide an optional hook that is called each time the input is updated
*/
- onChange: PropTypes.func,
+ onChange: deprecate(
+ PropTypes.func,
+ `\nThe prop \`onChange\` will be removed in the next major version of Carbon.`
+ ),
/**
* Provide a `title` for the input
@@ -263,12 +293,13 @@ StructuredListInput.propTypes = {
/**
* Specify the value of the input
*/
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
+ value: deprecate(
+ PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
+ `\nThe prop \`value\` will be removed in the next major version of Carbon.`
+ ),
};
StructuredListInput.defaultProps = {
- onChange: () => {},
- value: 'value',
title: 'title',
};
@@ -281,8 +312,16 @@ export function StructuredListCell(props) {
[`${prefix}--structured-list-content--nowrap`]: noWrap,
});
+ if (head) {
+ return (
+
+ {children}
+
+ );
+ }
+
return (
-
+
{children}
);
@@ -314,3 +353,12 @@ StructuredListCell.defaultProps = {
head: false,
noWrap: false,
};
+
+export default {
+ StructuredListWrapper,
+ StructuredListHead,
+ StructuredListBody,
+ StructuredListRow,
+ StructuredListInput,
+ StructuredListCell,
+};
diff --git a/packages/react/src/components/StructuredList/next/StructuredList.stories.js b/packages/react/src/components/StructuredList/StructuredList.stories.js
similarity index 98%
rename from packages/react/src/components/StructuredList/next/StructuredList.stories.js
rename to packages/react/src/components/StructuredList/StructuredList.stories.js
index ae5f879dee50..2b7d13e3f404 100644
--- a/packages/react/src/components/StructuredList/next/StructuredList.stories.js
+++ b/packages/react/src/components/StructuredList/StructuredList.stories.js
@@ -16,8 +16,8 @@ import {
StructuredListRow,
StructuredListInput,
StructuredListCell,
-} from './StructuredList';
-import StructuredListSkeleton from '../StructuredList.Skeleton';
+} from './';
+import StructuredListSkeleton from './StructuredList.Skeleton';
const prefix = 'cds';
diff --git a/packages/react/src/components/StructuredList/index.js b/packages/react/src/components/StructuredList/index.js
index 5a66977aa16c..9fc3f1a77021 100644
--- a/packages/react/src/components/StructuredList/index.js
+++ b/packages/react/src/components/StructuredList/index.js
@@ -4,58 +4,6 @@
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
-import {
- StructuredListWrapper as StructuredListWrapperNext,
- StructuredListHead as StructuredListHeadNext,
- StructuredListInput as StructuredListInputNext,
- StructuredListBody as StructuredListBodyNext,
- StructuredListRow as StructuredListRowNext,
- StructuredListCell as StructuredListCellNext,
-} from './next/StructuredList';
-import {
- StructuredListWrapper as StructuredListWrapperClassic,
- StructuredListHead as StructuredListHeadClassic,
- StructuredListInput as StructuredListInputClassic,
- StructuredListBody as StructuredListBodyClassic,
- StructuredListRow as StructuredListRowClassic,
- StructuredListCell as StructuredListCellClassic,
-} from './StructuredList';
-import { createComponentToggle } from '../../internal/ComponentToggle';
-
-export const StructuredListWrapper = createComponentToggle({
- name: 'StructuredListWrapper',
- next: StructuredListWrapperNext,
- classic: StructuredListWrapperClassic,
-});
-
-export const StructuredListHead = createComponentToggle({
- name: 'StructuredListHead',
- next: StructuredListHeadNext,
- classic: StructuredListHeadClassic,
-});
-
-export const StructuredListInput = createComponentToggle({
- name: 'StructuredListInput',
- next: StructuredListInputNext,
- classic: StructuredListInputClassic,
-});
-
-export const StructuredListBody = createComponentToggle({
- name: 'StructuredListBody',
- next: StructuredListBodyNext,
- classic: StructuredListBodyClassic,
-});
-
-export const StructuredListRow = createComponentToggle({
- name: 'StructuredListRow',
- next: StructuredListRowNext,
- classic: StructuredListRowClassic,
-});
-
-export const StructuredListCell = createComponentToggle({
- name: 'StructuredListCell',
- next: StructuredListCellNext,
- classic: StructuredListCellClassic,
-});
+export * from './StructuredList';
export { default as StructuredListSkeleton } from './StructuredList.Skeleton';
diff --git a/packages/react/src/components/StructuredList/next/StructuredList-test.js b/packages/react/src/components/StructuredList/next/StructuredList-test.js
deleted file mode 100644
index 47d645b139d1..000000000000
--- a/packages/react/src/components/StructuredList/next/StructuredList-test.js
+++ /dev/null
@@ -1,205 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import React from 'react';
-import {
- StructuredListWrapper,
- StructuredListHead,
- StructuredListInput,
- StructuredListBody,
- StructuredListRow,
- StructuredListCell,
-} from '../StructuredList';
-import { mount, shallow } from 'enzyme';
-
-const prefix = 'cds';
-
-describe('StructuredListWrapper', () => {
- describe('Renders as expected', () => {
- const wrapper = shallow(
-
hi
- );
-
- it('should have the expected classes', () => {
- expect(
- wrapper.find('div').hasClass(`${prefix}--structured-list`)
- ).toEqual(true);
- });
-
- it('Should add extra classes that are passed via className', () => {
- expect(wrapper.find('div').hasClass('extra-class')).toEqual(true);
- });
-
- it('By default, selection prop is false', () => {
- expect(wrapper.hasClass(`${prefix}--structured-list--selection`)).toEqual(
- false
- );
- });
-
- it('Should add the modifier class for selection when selection prop is true', () => {
- wrapper.setProps({ selection: true });
- expect(
- wrapper.find('div').hasClass(`${prefix}--structured-list--selection`)
- ).toEqual(true);
- });
-
- it('Should add the modifier class for condensed when isCondensed prop is true', () => {
- wrapper.setProps({ isCondensed: true });
- expect(
- wrapper.find('div').hasClass(`${prefix}--structured-list--condensed`)
- ).toEqual(true);
- });
-
- it('Should add the modifier class for flush when isFlush prop is true', () => {
- wrapper.setProps({ isFlush: true });
- expect(
- wrapper.find('div').hasClass(`${prefix}--structured-list--flush`)
- ).toEqual(true);
- });
- });
-});
-
-describe('StructuredListHead', () => {
- describe('Renders as expected', () => {
- const wrapper = shallow(
-
hi
- );
-
- it('should have the expected classes', () => {
- expect(wrapper.hasClass(`${prefix}--structured-list-thead`)).toEqual(
- true
- );
- });
-
- it('Should add extra classes that are passed via className', () => {
- expect(wrapper.hasClass('extra-class')).toEqual(true);
- });
-
- it('Should accept other props from ...other', () => {
- const wrapperProps = shallow(
-
hi
- );
- expect(wrapperProps.props().title).toEqual('title');
- });
- });
-});
-
-describe('StructuredListInput', () => {
- describe('Renders as expected', () => {
- const wrapper = shallow(
);
-
- it('should have the expected classes', () => {
- expect(wrapper.hasClass(`${prefix}--structured-list-input`)).toEqual(
- true
- );
- });
-
- it('Should add extra classes that are passed via className', () => {
- expect(wrapper.hasClass('extra-class')).toEqual(true);
- });
-
- it('Should accept other props from ...other', () => {
- const wrapperProps = shallow(
);
- expect(wrapperProps.props().title).toEqual('title');
- });
-
- it('Should render unique id with multiple inputs when no id prop is given', () => {
- const wrapper1 = mount(
);
- const wrapper2 = mount(
);
- expect(wrapper1.find('[id]')).not.toEqual(wrapper2.find('[id]'));
- });
- });
-});
-
-describe('StructuredListRow', () => {
- describe('Renders as expected', () => {
- const wrapper = shallow(
);
-
- it('should have the expected classes', () => {
- expect(wrapper.hasClass(`${prefix}--structured-list-row`)).toEqual(true);
- });
-
- it('Should add extra classes that are passed via className', () => {
- expect(wrapper.hasClass('extra-class')).toEqual(true);
- });
-
- it('should use correct class when head prop is true', () => {
- wrapper.setProps({ head: true });
-
- expect(
- wrapper.hasClass(`${prefix}--structured-list-row--header-row`)
- ).toEqual(true);
- });
-
- it('Should accept other props from ...other', () => {
- const wrapperProps = shallow(
-
hi
- );
- expect(wrapperProps.props().title).toEqual('title');
- });
- });
-});
-
-describe('StructuredListBody', () => {
- describe('Renders as expected', () => {
- const wrapper = shallow(
-
hi
- );
-
- it('should have the expected classes', () => {
- expect(wrapper.hasClass(`${prefix}--structured-list-tbody`)).toEqual(
- true
- );
- });
-
- it('Should add extra classes that are passed via className', () => {
- expect(wrapper.hasClass('extra-class')).toEqual(true);
- });
-
- it('Should accept other props from ...other', () => {
- const wrapperProps = shallow(
-
hi
- );
- expect(wrapperProps.props().title).toEqual('title');
- });
- });
-});
-
-describe('StructuredListCell', () => {
- describe('Renders as expected', () => {
- const wrapper = shallow(
-
hi
- );
-
- it('Should add extra classes that are passed via className', () => {
- expect(wrapper.hasClass('extra-class')).toEqual(true);
- });
-
- it('should have the expected classes', () => {
- expect(wrapper.hasClass(`${prefix}--structured-list-td`)).toEqual(true);
- });
-
- it('should use correct class when head prop is true', () => {
- wrapper.setProps({ head: true });
- expect(wrapper.hasClass(`${prefix}--structured-list-th`)).toEqual(true);
- });
-
- it('should use correct class when noWrap prop is true', () => {
- wrapper.setProps({ noWrap: true });
- expect(
- wrapper.hasClass(`${prefix}--structured-list-content--nowrap`)
- ).toEqual(true);
- });
-
- it('Should accept other props from ...other', () => {
- const wrapperProps = shallow(
-
hi
- );
- expect(wrapperProps.props().title).toEqual('title');
- });
- });
-});
diff --git a/packages/react/src/components/StructuredList/next/StructuredList.js b/packages/react/src/components/StructuredList/next/StructuredList.js
deleted file mode 100644
index d502d57a1d01..000000000000
--- a/packages/react/src/components/StructuredList/next/StructuredList.js
+++ /dev/null
@@ -1,364 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import React, { useState } from 'react';
-import PropTypes from 'prop-types';
-import classNames from 'classnames';
-import { useId } from '../../../internal/useId';
-import deprecate from '../../../prop-types/deprecate';
-import { usePrefix } from '../../../internal/usePrefix';
-
-const GridSelectedRowStateContext = React.createContext(null);
-const GridSelectedRowDispatchContext = React.createContext(null);
-
-export function StructuredListWrapper(props) {
- const {
- children,
- selection,
- className,
- ariaLabel,
- isCondensed,
- isFlush,
- ...other
- } = props;
- const prefix = usePrefix();
- const classes = classNames(`${prefix}--structured-list`, className, {
- [`${prefix}--structured-list--selection`]: selection,
- [`${prefix}--structured-list--condensed`]: isCondensed,
- [`${prefix}--structured-list--flush`]: isFlush,
- });
- const [selectedRow, setSelectedRow] = React.useState(null);
-
- return (
-
-
-
- {children}
-
-
-
- );
-}
-
-StructuredListWrapper.propTypes = {
- /**
- * Specify a label to be read by screen readers on the container node
- */
- ariaLabel: PropTypes.string,
-
- /**
- * Provide the contents of your StructuredListWrapper
- */
- children: PropTypes.node,
-
- /**
- * Specify an optional className to be applied to the container node
- */
- className: PropTypes.string,
-
- /**
- * Specify if structured list is condensed, default is false
- */
- isCondensed: PropTypes.bool,
-
- /**
- * Specify if structured list is flush, default is false
- */
- isFlush: PropTypes.bool,
-
- /**
- * Specify whether your StructuredListWrapper should have selections
- */
- selection: PropTypes.bool,
-};
-
-StructuredListWrapper.defaultProps = {
- selection: false,
- isCondensed: false,
- isFlush: false,
- ariaLabel: 'Structured list section',
-};
-
-export function StructuredListHead(props) {
- const { children, className, ...other } = props;
- const prefix = usePrefix();
- const classes = classNames(`${prefix}--structured-list-thead`, className);
-
- return (
-
- {children}
-
- );
-}
-
-StructuredListHead.propTypes = {
- /**
- * Provide the contents of your StructuredListHead
- */
- children: PropTypes.node,
-
- /**
- * Specify an optional className to be applied to the node
- */
- className: PropTypes.string,
-};
-
-export function StructuredListBody(props) {
- const { children, className, ...other } = props;
- const prefix = usePrefix();
- const classes = classNames(`${prefix}--structured-list-tbody`, className);
-
- return (
-
- {children}
-
- );
-}
-
-StructuredListBody.propTypes = {
- /**
- * Provide the contents of your StructuredListBody
- */
- children: PropTypes.node,
-
- /**
- * Specify an optional className to be applied to the container node
- */
- className: PropTypes.string,
-
- head: PropTypes.bool,
-
- /**
- * Provide a handler that is invoked on the key down event for the control
- */
- onKeyDown: PropTypes.func,
-};
-
-StructuredListBody.defaultProps = {
- onKeyDown: () => {},
-};
-
-const GridRowContext = React.createContext(null);
-
-export function StructuredListRow(props) {
- const { onKeyDown, children, className, head, ...other } = props;
- const [hasFocusWithin, setHasFocusWithin] = useState(false);
- const id = useId('grid-input');
- const setSelectedRow = React.useContext(GridSelectedRowDispatchContext);
- const prefix = usePrefix();
- const value = { id };
- const classes = classNames(`${prefix}--structured-list-row`, className, {
- [`${prefix}--structured-list-row--header-row`]: head,
- [`${prefix}--structured-list-row--focused-within`]: hasFocusWithin,
- });
-
- return head ? (
-
- {children}
-
- ) : (
- // eslint-disable-next-line jsx-a11y/interactive-supports-focus
-
setSelectedRow(id)}
- onFocus={() => {
- setHasFocusWithin(true);
- }}
- onBlur={() => {
- setHasFocusWithin(false);
- }}
- onKeyDown={onKeyDown}>
-
- {children}
-
-
- );
-}
-
-StructuredListRow.propTypes = {
- /**
- * Provide the contents of your StructuredListRow
- */
- children: PropTypes.node,
-
- /**
- * Specify an optional className to be applied to the container node
- */
- className: PropTypes.string,
-
- /**
- * Specify whether your StructuredListRow should be used as a header row
- */
- head: PropTypes.bool,
-
- /**
- * Specify whether a `
` should be used
- */
- label: deprecate(
- PropTypes.bool,
- `\nThe \`label\` prop is no longer needed and will be removed in the next major version of Carbon.`
- ),
-
- /**
- * Provide a handler that is invoked on the key down event for the control,
- */
- onKeyDown: PropTypes.func,
-};
-
-StructuredListRow.defaultProps = {
- head: false,
- onKeyDown: () => {},
-};
-
-export function StructuredListInput(props) {
- const defaultId = useId('structureListInput');
- const {
- className,
- name = `structured-list-input-${defaultId}`,
- title,
- id,
- ...other
- } = props;
- const prefix = usePrefix();
- const classes = classNames(
- `${prefix}--structured-list-input`,
- `${prefix}--visually-hidden`,
- className
- );
- const row = React.useContext(GridRowContext);
- const selectedRow = React.useContext(GridSelectedRowStateContext);
- const setSelectedRow = React.useContext(GridSelectedRowDispatchContext);
-
- return (
- {
- setSelectedRow(event.target.value);
- }}
- id={id ?? defaultId}
- className={classes}
- name={name}
- title={title}
- />
- );
-}
-
-StructuredListInput.propTypes = {
- /**
- * Specify an optional className to be applied to the input
- */
- className: PropTypes.string,
-
- /**
- * Specify whether the underlying input should be checked by default
- */
- defaultChecked: deprecate(
- PropTypes.bool,
- `\nThe prop \`defaultChecked\` is no longer needed and will be removed in the next major version of Carbon.`
- ),
-
- /**
- * Specify a custom `id` for the input
- */
- id: PropTypes.string,
-
- /**
- * Provide a `name` for the input
- */
- name: PropTypes.string,
-
- /**
- * Provide an optional hook that is called each time the input is updated
- */
- onChange: deprecate(
- PropTypes.func,
- `\nThe prop \`onChange\` will be removed in the next major version of Carbon.`
- ),
-
- /**
- * Provide a `title` for the input
- */
- title: PropTypes.string,
-
- /**
- * Specify the value of the input
- */
- value: deprecate(
- PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
- `\nThe prop \`value\` will be removed in the next major version of Carbon.`
- ),
-};
-
-StructuredListInput.defaultProps = {
- title: 'title',
-};
-
-export function StructuredListCell(props) {
- const { children, className, head, noWrap, ...other } = props;
- const prefix = usePrefix();
- const classes = classNames(className, {
- [`${prefix}--structured-list-th`]: head,
- [`${prefix}--structured-list-td`]: !head,
- [`${prefix}--structured-list-content--nowrap`]: noWrap,
- });
-
- if (head) {
- return (
-
- {children}
-
- );
- }
-
- return (
-
- {children}
-
- );
-}
-
-StructuredListCell.propTypes = {
- /**
- * Provide the contents of your StructuredListCell
- */
- children: PropTypes.node,
-
- /**
- * Specify an optional className to be applied to the container node
- */
- className: PropTypes.string,
-
- /**
- * Specify whether your StructuredListCell should be used as a header cell
- */
- head: PropTypes.bool,
-
- /**
- * Specify whether your StructuredListCell should have text wrapping
- */
- noWrap: PropTypes.bool,
-};
-
-StructuredListCell.defaultProps = {
- head: false,
- noWrap: false,
-};
-
-export default {
- StructuredListWrapper,
- StructuredListHead,
- StructuredListBody,
- StructuredListRow,
- StructuredListInput,
- StructuredListCell,
-};
diff --git a/packages/react/src/components/StructuredList/next/StructuredList.mdx b/packages/react/src/components/StructuredList/next/StructuredList.mdx
deleted file mode 100644
index 6632318ffd71..000000000000
--- a/packages/react/src/components/StructuredList/next/StructuredList.mdx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { Props } from '@storybook/addon-docs';
-
-# StructuredList
-
-[Source code](https://github.com/carbon-design-system/carbon/tree/main/packages/react/src/components/StructuredList)
- |
-[Usage guidelines](https://www.carbondesignsystem.com/components/structured-list/usage)
- |
-[Accessibility](https://www.carbondesignsystem.com/components/structured-list/accessibility)
-
-## Table of Contents
-
-## Overview
-
-## Component API
-
-
-
-## Feedback
-
-Help us improve this component by providing feedback, asking questions on Slack,
-or updating this file on
-[GitHub](https://github.com/carbon-design-system/carbon/edit/main/packages/react/src/components/StructuredList/StructuredList.mdx).
diff --git a/packages/react/src/components/Tag/Tag.stories.js b/packages/react/src/components/Tag/Tag.stories.js
index 205b0d21b092..e9df8ac8188c 100644
--- a/packages/react/src/components/Tag/Tag.stories.js
+++ b/packages/react/src/components/Tag/Tag.stories.js
@@ -11,113 +11,122 @@ import { default as Tag } from '../Tag';
export default {
title: 'Components/Tag',
component: Tag,
- argTypes: {
- size: {
- options: ['sm', 'md'],
- control: { type: 'select' },
- },
- },
};
-export const Default = (args) => {
+export const Default = () => {
return (
<>
-
+
{'Tag content'}
-
+
{'Tag content'}
-
+
{'Tag content'}
-
+
{'Tag content'}
-
+
{'Tag content'}
-
+
{'Tag content'}
-
+
{'Tag content'}
-
+
{'Tag content'}
+ title="Clear Filter">
{'Tag content'}
+ title="Clear Filter">
{'Tag content'}
+ title="Clear Filter">
{'Tag content'}
-
+
{'Tag content'}
>
);
};
+
+export const Playground = (args) => {
+ return {'Tag content'} ;
+};
+
+Playground.argTypes = {
+ children: {
+ control: false,
+ },
+ className: {
+ control: false,
+ },
+ disabled: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: false,
+ },
+ filter: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: false,
+ },
+ id: {
+ control: false,
+ },
+ renderIcon: {
+ control: false,
+ },
+ size: {
+ defaultValue: 'md',
+ options: ['sm', 'md'],
+ control: {
+ type: 'select',
+ },
+ },
+ title: {
+ control: {
+ type: 'text',
+ },
+ defaultValue: 'Clear filter',
+ },
+ type: {
+ options: [
+ 'red',
+ 'magenta',
+ 'purple',
+ 'blue',
+ 'cyan',
+ 'teal',
+ 'green',
+ 'gray',
+ 'cool-gray',
+ 'warm-gray',
+ 'high-contrast',
+ 'outline',
+ ],
+ control: {
+ type: 'select',
+ },
+ },
+};
diff --git a/packages/react/src/components/TextArea/TextArea-test.js b/packages/react/src/components/TextArea/TextArea-test.js
index 6d203263a3d7..bee02c651684 100644
--- a/packages/react/src/components/TextArea/TextArea-test.js
+++ b/packages/react/src/components/TextArea/TextArea-test.js
@@ -44,7 +44,7 @@ describe('TextArea', () => {
});
it('should set cols as expected', () => {
- expect(textarea().props().cols).toEqual(50);
+ expect(textarea().props().style).toEqual({ width: '100%' });
wrapper.setProps({ cols: 200 });
expect(textarea().props().cols).toEqual(200);
});
diff --git a/packages/react/src/components/TextArea/TextArea.js b/packages/react/src/components/TextArea/TextArea.js
index 441a4a2a0a79..5fa92e064a7a 100644
--- a/packages/react/src/components/TextArea/TextArea.js
+++ b/packages/react/src/components/TextArea/TextArea.js
@@ -128,6 +128,13 @@ const TextArea = React.forwardRef(function TextArea(
aria-invalid={invalid || null}
aria-describedby={invalid ? errorId : null}
disabled={other.disabled}
+ style={
+ other.cols
+ ? {}
+ : {
+ width: `100%`,
+ }
+ }
/>
);
@@ -268,7 +275,6 @@ TextArea.defaultProps = {
onClick: () => {},
placeholder: '',
rows: 4,
- cols: 50,
invalid: false,
invalidText: '',
helperText: '',
diff --git a/packages/react/src/components/TextArea/TextArea.stories.js b/packages/react/src/components/TextArea/TextArea.stories.js
index 5a89e26b4738..296cf048905a 100644
--- a/packages/react/src/components/TextArea/TextArea.stories.js
+++ b/packages/react/src/components/TextArea/TextArea.stories.js
@@ -15,13 +15,19 @@ export default {
subcomponents: {
TextAreaSkeleton,
},
+ argTypes: {
+ light: {
+ table: {
+ disable: true,
+ },
+ },
+ },
};
export const Default = () => (
@@ -33,7 +39,6 @@ export const WithLayer = () => {
@@ -41,7 +46,6 @@ export const WithLayer = () => {
@@ -49,7 +53,6 @@ export const WithLayer = () => {
@@ -65,26 +68,18 @@ export const Playground = (args) => ;
Playground.argTypes = {
className: {
- control: {
- type: 'text',
- },
+ control: false,
},
cols: {
control: {
type: 'number',
},
- defaultValue: 50,
},
defaultValue: {
control: {
type: 'text',
},
},
- value: {
- control: {
- type: 'text',
- },
- },
disabled: {
control: {
type: 'boolean',
@@ -109,9 +104,7 @@ Playground.argTypes = {
defaultValue: false,
},
id: {
- control: {
- type: 'text',
- },
+ control: false,
},
invalid: {
control: {
@@ -123,22 +116,35 @@ Playground.argTypes = {
control: {
type: 'text',
},
+ defaultValue: '',
},
labelText: {
control: {
type: 'text',
},
},
- light: {
+ maxCount: {
control: {
- type: 'boolean',
+ type: 'number',
},
- defaultValue: false,
},
- maxCount: {
+ placeholder: {
+ control: {
+ type: 'text',
+ },
+ defaultValue: '',
+ },
+ rows: {
control: {
type: 'number',
},
+ defaultValue: 4,
+ },
+ value: {
+ control: {
+ type: 'text',
+ },
+ defaultValue: '',
},
};
diff --git a/packages/react/src/components/TextInput/TextInput.stories.js b/packages/react/src/components/TextInput/TextInput.stories.js
index 139f29969e27..026bc7d86eed 100644
--- a/packages/react/src/components/TextInput/TextInput.stories.js
+++ b/packages/react/src/components/TextInput/TextInput.stories.js
@@ -47,6 +47,7 @@ export const TogglePasswordVisibility = () => {
id="text-input-1"
labelText="Text input label"
helperText="Optional help text"
+ autoComplete="true"
/>
);
};
diff --git a/packages/react/src/components/Theme/next/Theme-story.scss b/packages/react/src/components/Theme/Theme-story.scss
similarity index 100%
rename from packages/react/src/components/Theme/next/Theme-story.scss
rename to packages/react/src/components/Theme/Theme-story.scss
diff --git a/packages/react/src/components/Theme/next/Theme.mdx b/packages/react/src/components/Theme/Theme.mdx
similarity index 100%
rename from packages/react/src/components/Theme/next/Theme.mdx
rename to packages/react/src/components/Theme/Theme.mdx
diff --git a/packages/react/src/components/Theme/next/Theme.stories.js b/packages/react/src/components/Theme/Theme.stories.js
similarity index 96%
rename from packages/react/src/components/Theme/next/Theme.stories.js
rename to packages/react/src/components/Theme/Theme.stories.js
index b7eef1834e23..1d824b131da5 100644
--- a/packages/react/src/components/Theme/next/Theme.stories.js
+++ b/packages/react/src/components/Theme/Theme.stories.js
@@ -7,8 +7,8 @@
import './Theme-story.scss';
import React from 'react';
-import { GlobalTheme, Theme, useTheme } from '../../Theme';
-import { Layer } from '../../Layer';
+import { GlobalTheme, Theme, useTheme } from '../Theme';
+import { Layer } from '../Layer';
import mdx from './Theme.mdx';
export default {
diff --git a/packages/react/src/components/Tile/Tile.stories.js b/packages/react/src/components/Tile/Tile.stories.js
index 128fe92ef6b2..b94e96e42aa0 100644
--- a/packages/react/src/components/Tile/Tile.stories.js
+++ b/packages/react/src/components/Tile/Tile.stories.js
@@ -40,6 +40,13 @@ export default {
page: mdx,
},
},
+ argTypes: {
+ light: {
+ table: {
+ disable: true,
+ },
+ },
+ },
};
export const Default = () => {
diff --git a/packages/react/src/components/TimePicker/TimePicker-story.js b/packages/react/src/components/TimePicker/TimePicker-story.js
deleted file mode 100644
index 11ab1263b9b6..000000000000
--- a/packages/react/src/components/TimePicker/TimePicker-story.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import React from 'react';
-
-import {
- withKnobs,
- boolean,
- number,
- select,
- text,
-} from '@storybook/addon-knobs';
-import TimePicker from '../TimePicker';
-import TimePickerSelect from '../TimePickerSelect';
-import SelectItem from '../SelectItem';
-import mdx from './TimePicker.mdx';
-
-const sizes = {
- 'Small (sm)': 'sm',
- 'Medium (md) - default': undefined,
- 'Large (lg)': 'lg',
-};
-
-const props = {
- timepicker: () => ({
- pattern: text(
- 'Regular expression for the value (pattern in )',
- '(1[012]|[1-9]):[0-5][0-9](\\s)?'
- ),
- placeholder: text(
- 'Placeholder text (placeholder in )',
- 'hh:mm'
- ),
- disabled: boolean('Disabled (disabled in )', false),
- light: boolean('Light variant (light in )', false),
- labelText: text('Label text (labelText in )', 'Select a time'),
- invalid: boolean(
- 'Show form validation UI (invalid in )',
- false
- ),
- invalidText: text(
- 'Form validation UI content (invalidText in )',
- 'A valid value is required'
- ),
- maxLength: number('Maximum length (maxLength in )', 5),
- size: select('Field size (size)', sizes, undefined) || undefined,
- }),
- select: () => ({
- disabled: boolean('Disabled (disabled in )', false),
- labelText: text(
- 'Label text (labelText in )',
- 'Please select'
- ),
- ['aria-label']: text(
- 'ARIA label (aria-label in )',
- 'open list of options'
- ),
- }),
-};
-
-export default {
- title: 'Components/TimePicker',
- component: TimePicker,
- decorators: [withKnobs],
- subcomponents: {
- TimePickerSelect,
- SelectItem,
- },
- parameters: {
- docs: {
- page: mdx,
- },
- },
-};
-
-export const Default = () => {
- const selectProps = props.select();
- return (
-
-
-
-
-
-
-
-
-
-
- );
-};
diff --git a/packages/react/src/components/TimePicker/TimePicker-test.js b/packages/react/src/components/TimePicker/TimePicker-test.js
index 4dd08e725bfd..7aec125bb018 100644
--- a/packages/react/src/components/TimePicker/TimePicker-test.js
+++ b/packages/react/src/components/TimePicker/TimePicker-test.js
@@ -6,177 +6,63 @@
*/
import React from 'react';
-import TimePicker from '../TimePicker';
-import { mount, shallow } from 'enzyme';
+import { default as TimePicker } from './TimePicker';
-const prefix = 'cds';
+import { render, screen, fireEvent } from '@testing-library/react';
+import userEvent from '@testing-library/user-event';
describe('TimePicker', () => {
- describe('renders as expected', () => {
- describe('input', () => {
- let wrapper;
- let timePicker;
- let textInput;
-
- beforeEach(() => {
- wrapper = mount( );
-
- timePicker = () => wrapper.find(`.${prefix}--time-picker`);
- textInput = () => wrapper.find('input');
- });
-
- it('renders as expected', () => {
- expect(textInput().length).toBe(1);
- });
-
- it('should add extra classes that are passed via className', () => {
- expect(timePicker().hasClass('extra-class')).toEqual(true);
- });
-
- it('should set type as expected', () => {
- expect(textInput().props().type).toEqual('text');
- });
-
- it('should set value as expected', () => {
- expect(textInput().props().defaultValue).toEqual(undefined);
- wrapper.setProps({ defaultValue: 'test' });
- expect(textInput().props().defaultValue).toEqual('test');
- });
-
- it('should set disabled as expected', () => {
- expect(textInput().props().disabled).toEqual(false);
- wrapper.setProps({ disabled: true });
- expect(textInput().props().disabled).toEqual(true);
- });
-
- it('should set placeholder as expected', () => {
- wrapper.setProps({ placeholder: 'ss:mm' });
- expect(textInput().props().placeholder).toEqual('ss:mm');
- });
+ describe('input', () => {
+ it('renders as expected', () => {
+ render( );
+ expect(screen.getByRole('textbox')).toBeInTheDocument();
});
- describe('label', () => {
- let wrapper;
- let label;
-
- beforeEach(() => {
- wrapper = mount( );
-
- label = () => wrapper.find('label');
- });
-
- it('does not render a label by default', () => {
- expect(label().length).toBe(0);
- });
-
- it('renders a label', () => {
- wrapper.setProps({ labelText: 'Enter a time' });
- const renderedlabel = wrapper.find('label');
- expect(renderedlabel.length).toBe(1);
- });
+ it('passes classNames as expected', () => {
+ render( );
+ expect(screen.getByRole('textbox')).toHaveClass('🚀');
+ });
- it('has the expected classes', () => {
- wrapper.setProps({ labelText: 'Enter a time' });
- const renderedlabel = wrapper.find('label');
- expect(renderedlabel.hasClass(`${prefix}--label`)).toEqual(true);
- });
+ it('should set type as expected', () => {
+ render( );
+ expect(screen.getByRole('textbox')).toHaveAttribute('type', 'text');
+ });
- it('should set label as expected', () => {
- wrapper.setProps({ labelText: 'Enter a time' });
- const renderedlabel = wrapper.find('label');
- expect(renderedlabel.text()).toEqual('Enter a time');
- });
+ it('should set value as expected', () => {
+ render( );
+ expect(screen.getByRole('textbox')).toHaveAttribute('value', '🐶');
});
- });
- describe('events', () => {
- describe('disabled time picker', () => {
+ it('should set disabled as expected', () => {
const onClick = jest.fn();
- const onChange = jest.fn();
-
- const wrapper = mount(
-
- );
-
- const input = wrapper.find('input');
-
- it('should not invoke onClick', () => {
- input.simulate('click');
- expect(onClick).not.toHaveBeenCalled();
- });
-
- it('should not invoke onChange', () => {
- input.simulate('change');
- expect(onChange).not.toHaveBeenCalled();
- });
+ render( );
+ fireEvent.click(screen.getByRole('textbox'));
+ expect(onClick).not.toHaveBeenCalled();
});
- describe('enabled textinput', () => {
- let onClick;
- let onChange;
- let onBlur;
- let wrapper;
- let input;
- let eventObject;
-
- beforeEach(() => {
- onClick = jest.fn();
- onChange = jest.fn();
- onBlur = jest.fn();
- wrapper = mount(
-
- );
- input = wrapper.find('input');
- eventObject = {
- target: {
- defaultValue: 'test',
- },
- };
- });
-
- it('should invoke onBlur when input is clicked', () => {
- input.simulate('blur', eventObject);
- expect(onBlur).toHaveBeenCalledWith(
- expect.objectContaining(eventObject)
- );
- });
-
- it('should invoke onClick when input is clicked', () => {
- input.simulate('click', eventObject);
- expect(onClick).toHaveBeenCalledWith(
- expect.objectContaining(eventObject)
- );
- });
-
- it('should invoke onChange when input value is changed', () => {
- input.simulate('change', eventObject);
- expect(onChange).toHaveBeenCalledWith(
- expect.objectContaining(eventObject)
- );
- });
+ it('should set placeholder as expected', () => {
+ render( );
+ expect(screen.getByPlaceholderText('🧸')).toBeInTheDocument();
});
});
- describe('Getting derived state from props', () => {
- it('should change the value upon change in props', () => {
- const wrapper = shallow( );
- wrapper.setProps({ value: 'foo' });
- wrapper.setState({ value: 'foo' });
- wrapper.setProps({ value: 'bar' });
- expect(wrapper.state().value).toEqual('bar');
+ describe('label', () => {
+ it('does not render a label by default', () => {
+ render( );
+ expect(screen.queryByLabelText('🐳')).not.toBeInTheDocument();
});
- it('should avoid change the value upon setting props, unless there the value actually changes', () => {
- const wrapper = shallow( );
- wrapper.setProps({ value: 'foo' });
- wrapper.setState({ value: 'bar' });
- wrapper.setProps({ value: 'foo' });
- expect(wrapper.state().value).toEqual('bar');
+ it('renders a label as expected', () => {
+ render( );
+ expect(screen.getByLabelText('🐳')).toBeInTheDocument();
+ });
+ });
+
+ describe('events', () => {
+ it('should write text inside the textbox', () => {
+ render( );
+ userEvent.type(screen.getByRole('textbox'), '🧛');
+ expect(screen.getByRole('textbox')).toHaveValue('🧛');
});
});
});
diff --git a/packages/react/src/components/TimePicker/TimePicker.js b/packages/react/src/components/TimePicker/TimePicker.js
index cd92c6ccb82d..9d71c96ce3cc 100644
--- a/packages/react/src/components/TimePicker/TimePicker.js
+++ b/packages/react/src/components/TimePicker/TimePicker.js
@@ -6,256 +6,224 @@
*/
import PropTypes from 'prop-types';
-import React, { Component } from 'react';
-import classNames from 'classnames';
-import { FeatureFlagContext } from '../FeatureFlags';
-import { PrefixContext } from '../../internal/usePrefix';
-
-export default class TimePicker extends Component {
- state = {};
-
- static propTypes = {
- /**
- * Pass in the children that will be rendered next to the form control
- */
- children: PropTypes.node,
-
- /**
- * Specify an optional className to be applied to the container node
- */
- className: PropTypes.string,
-
- /**
- * Specify whether the ` ` should be disabled
- */
- disabled: PropTypes.bool,
-
- /**
- * Specify whether you want the underlying label to be visually hidden
- */
- hideLabel: PropTypes.bool,
-
- /**
- * Specify a custom `id` for the ` `
- */
- id: PropTypes.string.isRequired,
-
- /**
- * Specify whether the control is currently invalid
- */
- invalid: PropTypes.bool,
-
- /**
- * Provide the text that is displayed when the control is in an invalid state
- */
- invalidText: PropTypes.node,
-
- /**
- * Provide the text that will be read by a screen reader when visiting this
- * control
- */
- labelText: PropTypes.node,
-
- /**
- * `true` to use the light version. For use on $ui-01 backgrounds only.
- * Don't use this to make tile background color same as container background color.
- */
- light: PropTypes.bool,
-
- /**
- * Specify the maximum length of the time string in ` `
- */
- maxLength: PropTypes.number,
-
- /**
- * Optionally provide an `onBlur` handler that is called whenever the
- * ` ` loses focus
- */
- onBlur: PropTypes.func,
-
- /**
- * Optionally provide an `onChange` handler that is called whenever ` `
- * is updated
- */
- onChange: PropTypes.func,
-
- /**
- * Optionally provide an `onClick` handler that is called whenever the
- * ` ` is clicked
- */
- onClick: PropTypes.func,
-
- /**
- * Specify the regular expression working as the pattern of the time string in ` `
- */
- pattern: PropTypes.string,
-
- /**
- * Specify the placeholder attribute for the ` `
- */
- placeholder: PropTypes.string,
-
- /**
- * Specify the size of the Time Picker.
- */
- size: PropTypes.oneOf(['sm', 'md', 'lg', 'xl']),
-
- /**
- * Specify the type of the ` `
- */
- type: PropTypes.string,
-
- /**
- * Specify the value of the ` `
- */
- value: PropTypes.string,
- };
-
- static defaultProps = {
- type: 'text',
- pattern: '(1[012]|[1-9]):[0-5][0-9](\\s)?',
- placeholder: 'hh:mm',
- maxLength: 5,
- invalidText: 'Invalid time format.',
- invalid: false,
- disabled: false,
- onChange: () => {},
- onClick: () => {},
- onBlur: () => {},
- light: false,
- };
-
- static contextType = FeatureFlagContext;
-
- static getDerivedStateFromProps({ value }, state) {
- const { prevValue } = state;
- return prevValue === value
- ? null
- : {
- value,
- prevValue: value,
- };
+import React from 'react';
+import cx from 'classnames';
+import { usePrefix } from '../../internal/usePrefix';
+import deprecate from '../../prop-types/deprecate';
+
+const TimePicker = React.forwardRef(function TimePicker(
+ {
+ children,
+ className,
+ disabled = false,
+ hideLabel,
+ id,
+ invalidText = 'Invalid time format.',
+ invalid = false,
+ labelText,
+ light = false,
+ maxLength = 5,
+ onChange = () => {},
+ onClick = () => {},
+ onBlur = () => {},
+ pattern = '(1[012]|[1-9]):[0-5][0-9](\\s)?',
+ placeholder = 'hh:mm',
+ size = 'md',
+ type = 'text',
+ value,
+ ...rest
+ },
+ ref
+) {
+ const prefix = usePrefix();
+
+ const [isValue, setValue] = React.useState(value);
+ const [prevValue, setPrevValue] = React.useState(value);
+
+ if (value !== prevValue) {
+ setValue(value);
+ setPrevValue(value);
}
- render() {
- const {
- children,
- className,
- id,
- labelText,
- type,
- pattern,
- onChange,
- onClick,
- onBlur,
- placeholder,
- maxLength,
- invalidText,
- invalid,
- hideLabel,
- light,
- size,
- ...other
- } = this.props;
-
- const scope = this.context;
- let enabled;
-
- if (scope.enabled) {
- enabled = scope.enabled('enable-v11-release');
+ function handleOnClick(evt) {
+ if (!disabled) {
+ setValue(isValue);
+ onClick(evt);
}
+ }
- return (
-
- {(prefix) => {
- const timePickerInputProps = {
- className: classNames(
- `${prefix}--time-picker__input-field`,
- `${prefix}--text-input`,
- [enabled ? null : className],
- {
- [`${prefix}--text-input--light`]: light,
- }
- ),
-
- onChange: (evt) => {
- if (!other.disabled) {
- this.setState({
- value: evt.target.value,
- });
- onChange(evt);
- }
- },
- onClick: (evt) => {
- if (!other.disabled) {
- this.setState({
- value: evt.target.value,
- });
- onClick(evt);
- }
- },
- onBlur: (evt) => {
- if (!other.disabled) {
- this.setState({
- value: evt.target.value,
- });
- onBlur(evt);
- }
- },
- pattern,
- placeholder,
- maxLength,
- id,
- type,
- value: this.state.value,
- };
-
- const timePickerClasses = classNames({
- [`${prefix}--time-picker`]: true,
- [`${prefix}--time-picker--light`]: light,
- [`${prefix}--time-picker--invalid`]: invalid,
- [`${prefix}--time-picker--${size}`]: size,
- [className]: className,
- });
-
- const labelClasses = classNames(`${prefix}--label`, {
- [`${prefix}--visually-hidden`]: hideLabel,
- [`${prefix}--label--disabled`]: other.disabled,
- });
-
- const label = labelText ? (
-
- {labelText}
-
- ) : null;
-
- const error = invalid ? (
- {invalidText}
- ) : null;
-
- return (
-
- );
- }}
-
- );
+ function handleOnChange(evt) {
+ if (!disabled) {
+ setValue(isValue);
+ onChange(evt);
+ }
}
-}
+
+ function handleOnBlur(evt) {
+ if (!disabled) {
+ setValue(isValue);
+ onBlur(evt);
+ }
+ }
+
+ const timePickerInputClasses = cx(
+ `${prefix}--time-picker__input-field`,
+ `${prefix}--text-input`,
+ [className],
+ {
+ [`${prefix}--text-input--light`]: light,
+ }
+ );
+
+ const timePickerClasses = cx({
+ [`${prefix}--time-picker`]: true,
+ [`${prefix}--time-picker--light`]: light,
+ [`${prefix}--time-picker--invalid`]: invalid,
+ [`${prefix}--time-picker--${size}`]: size,
+ [className]: className,
+ });
+
+ const labelClasses = cx(`${prefix}--label`, {
+ [`${prefix}--visually-hidden`]: hideLabel,
+ [`${prefix}--label--disabled`]: disabled,
+ });
+
+ const label = labelText ? (
+
+ {labelText}
+
+ ) : null;
+
+ const error = invalid ? (
+ {invalidText}
+ ) : null;
+
+ return (
+
+ );
+});
+
+TimePicker.propTypes = {
+ /**
+ * Pass in the children that will be rendered next to the form control
+ */
+ children: PropTypes.node,
+
+ /**
+ * Specify an optional className to be applied to the container node
+ */
+ className: PropTypes.string,
+
+ /**
+ * Specify whether the ` ` should be disabled
+ */
+ disabled: PropTypes.bool,
+
+ /**
+ * Specify whether you want the underlying label to be visually hidden
+ */
+ hideLabel: PropTypes.bool,
+
+ /**
+ * Specify a custom `id` for the ` `
+ */
+ id: PropTypes.string.isRequired,
+
+ /**
+ * Specify whether the control is currently invalid
+ */
+ invalid: PropTypes.bool,
+
+ /**
+ * Provide the text that is displayed when the control is in an invalid state
+ */
+ invalidText: PropTypes.node,
+
+ /**
+ * Provide the text that will be read by a screen reader when visiting this
+ * control
+ */
+ labelText: PropTypes.node,
+
+ /**
+ * The `light` prop for `TimePicker` has been deprecated. It will be removed in v12. Use the `Layer` component instead.
+ */
+ light: deprecate(
+ PropTypes.bool,
+ 'The `light` prop for `TimePicker` is no longer needed and has been deprecated. It will be removed in the next major release. Use the `Layer` component instead.'
+ ),
+
+ /**
+ * Specify the maximum length of the time string in ` `
+ */
+ maxLength: PropTypes.number,
+
+ /**
+ * Optionally provide an `onBlur` handler that is called whenever the
+ * ` ` loses focus
+ */
+ onBlur: PropTypes.func,
+
+ /**
+ * Optionally provide an `onChange` handler that is called whenever ` `
+ * is updated
+ */
+ onChange: PropTypes.func,
+
+ /**
+ * Optionally provide an `onClick` handler that is called whenever the
+ * ` ` is clicked
+ */
+ onClick: PropTypes.func,
+
+ /**
+ * Specify the regular expression working as the pattern of the time string in ` `
+ */
+ pattern: PropTypes.string,
+
+ /**
+ * Specify the placeholder attribute for the ` `
+ */
+ placeholder: PropTypes.string,
+
+ /**
+ * Specify the size of the Time Picker.
+ */
+ size: PropTypes.oneOf(['sm', 'md', 'lg']),
+
+ /**
+ * Specify the type of the ` `
+ */
+ type: PropTypes.string,
+
+ /**
+ * Specify the value of the ` `
+ */
+ value: PropTypes.string,
+};
+
+export default TimePicker;
diff --git a/packages/react/src/components/TimePicker/next/TimePicker.stories.js b/packages/react/src/components/TimePicker/TimePicker.stories.js
similarity index 54%
rename from packages/react/src/components/TimePicker/next/TimePicker.stories.js
rename to packages/react/src/components/TimePicker/TimePicker.stories.js
index 8d173eefdb3f..4640171aec4b 100644
--- a/packages/react/src/components/TimePicker/next/TimePicker.stories.js
+++ b/packages/react/src/components/TimePicker/TimePicker.stories.js
@@ -6,37 +6,29 @@
*/
import React from 'react';
-import SelectItem from '../../SelectItem';
-import TimePicker from '../';
-import TimePickerSelect from '../../TimePickerSelect';
-import { Layer } from '../../Layer';
+import SelectItem from '../SelectItem';
+import TimePicker from './TimePicker';
+import TimePickerSelect from '../TimePickerSelect';
+import { Layer } from '../Layer';
+import mdx from './TimePicker.mdx';
export default {
title: 'Components/TimePicker',
component: TimePicker,
- argTypes: {
- size: {
- options: ['sm', 'md', 'lg'],
- control: { type: 'select' },
- },
- light: {
- table: {
- disable: true,
- },
- },
- },
- args: {
- size: 'md',
- },
subcomponents: {
TimePickerSelect,
SelectItem,
},
+ parameters: {
+ docs: {
+ page: mdx,
+ },
+ },
};
-export const Default = (args) => {
+export const Default = () => {
return (
-
+
@@ -49,10 +41,10 @@ export const Default = (args) => {
);
};
-export const WithLayer = (args) => {
+export const WithLayer = () => {
return (
<>
-
+
@@ -63,7 +55,7 @@ export const WithLayer = (args) => {
-
+
@@ -74,7 +66,7 @@ export const WithLayer = (args) => {
-
+
@@ -89,3 +81,74 @@ export const WithLayer = (args) => {
>
);
};
+
+export const Playground = (args) => {
+ return (
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+Playground.argTypes = {
+ children: {
+ table: {
+ disable: true,
+ },
+ },
+ className: {
+ table: {
+ disable: true,
+ },
+ },
+ id: {
+ table: {
+ disable: true,
+ },
+ },
+ disabled: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: false,
+ },
+ hideLabel: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: false,
+ },
+ invalid: {
+ control: {
+ type: 'boolean',
+ },
+ defaultValue: false,
+ },
+ invalidText: {
+ control: { type: 'text' },
+ },
+ labelText: {
+ control: { type: 'text' },
+ },
+ size: {
+ options: ['sm', 'md', 'lg'],
+ control: { type: 'select' },
+ },
+ light: {
+ table: {
+ disable: true,
+ },
+ },
+ pattern: {
+ table: {
+ disable: true,
+ },
+ },
+};
diff --git a/packages/react/src/components/TimePicker/index.js b/packages/react/src/components/TimePicker/index.js
index f1fdaeb0e0e5..f41baa0c4a41 100644
--- a/packages/react/src/components/TimePicker/index.js
+++ b/packages/react/src/components/TimePicker/index.js
@@ -5,14 +5,4 @@
* LICENSE file in the root directory of this source tree.
*/
-import * as FeatureFlags from '@carbon/feature-flags';
-
-import { default as TimePickerNext } from './next/TimePicker';
-
-import { default as TimePickerClassic } from './TimePicker';
-
-const TimePicker = FeatureFlags.enabled('enable-v11-release')
- ? TimePickerNext
- : TimePickerClassic;
-
-export default TimePicker;
+export default from './TimePicker';
diff --git a/packages/react/src/components/TimePicker/next/TimePicker-test.js b/packages/react/src/components/TimePicker/next/TimePicker-test.js
deleted file mode 100644
index 7aec125bb018..000000000000
--- a/packages/react/src/components/TimePicker/next/TimePicker-test.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import React from 'react';
-import { default as TimePicker } from './TimePicker';
-
-import { render, screen, fireEvent } from '@testing-library/react';
-import userEvent from '@testing-library/user-event';
-
-describe('TimePicker', () => {
- describe('input', () => {
- it('renders as expected', () => {
- render( );
- expect(screen.getByRole('textbox')).toBeInTheDocument();
- });
-
- it('passes classNames as expected', () => {
- render( );
- expect(screen.getByRole('textbox')).toHaveClass('🚀');
- });
-
- it('should set type as expected', () => {
- render( );
- expect(screen.getByRole('textbox')).toHaveAttribute('type', 'text');
- });
-
- it('should set value as expected', () => {
- render( );
- expect(screen.getByRole('textbox')).toHaveAttribute('value', '🐶');
- });
-
- it('should set disabled as expected', () => {
- const onClick = jest.fn();
- render( );
- fireEvent.click(screen.getByRole('textbox'));
- expect(onClick).not.toHaveBeenCalled();
- });
-
- it('should set placeholder as expected', () => {
- render( );
- expect(screen.getByPlaceholderText('🧸')).toBeInTheDocument();
- });
- });
-
- describe('label', () => {
- it('does not render a label by default', () => {
- render( );
- expect(screen.queryByLabelText('🐳')).not.toBeInTheDocument();
- });
-
- it('renders a label as expected', () => {
- render( );
- expect(screen.getByLabelText('🐳')).toBeInTheDocument();
- });
- });
-
- describe('events', () => {
- it('should write text inside the textbox', () => {
- render( );
- userEvent.type(screen.getByRole('textbox'), '🧛');
- expect(screen.getByRole('textbox')).toHaveValue('🧛');
- });
- });
-});
diff --git a/packages/react/src/components/TimePicker/next/TimePicker.js b/packages/react/src/components/TimePicker/next/TimePicker.js
deleted file mode 100644
index 810b5d2b0a59..000000000000
--- a/packages/react/src/components/TimePicker/next/TimePicker.js
+++ /dev/null
@@ -1,229 +0,0 @@
-/**
- * Copyright IBM Corp. 2016, 2018
- *
- * This source code is licensed under the Apache-2.0 license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-import PropTypes from 'prop-types';
-import React from 'react';
-import cx from 'classnames';
-import { usePrefix } from '../../../internal/usePrefix';
-import deprecate from '../../../prop-types/deprecate';
-
-const TimePicker = React.forwardRef(function TimePicker(
- {
- children,
- className,
- disabled = false,
- hideLabel,
- id,
- invalidText = 'Invalid time format.',
- invalid = false,
- labelText,
- light = false,
- maxLength = 5,
- onChange = () => {},
- onClick = () => {},
- onBlur = () => {},
- pattern = '(1[012]|[1-9]):[0-5][0-9](\\s)?',
- placeholder = 'hh:mm',
- size = 'md',
- type = 'text',
- value,
- ...rest
- },
- ref
-) {
- const prefix = usePrefix();
-
- const [isValue, setValue] = React.useState(value);
- const [prevValue, setPrevValue] = React.useState(value);
-
- if (value !== prevValue) {
- setValue(value);
- setPrevValue(value);
- }
-
- function handleOnClick(evt) {
- if (!disabled) {
- setValue(isValue);
- onClick(evt);
- }
- }
-
- function handleOnChange(evt) {
- if (!disabled) {
- setValue(isValue);
- onChange(evt);
- }
- }
-
- function handleOnBlur(evt) {
- if (!disabled) {
- setValue(isValue);
- onBlur(evt);
- }
- }
-
- const timePickerInputClasses = cx(
- `${prefix}--time-picker__input-field`,
- `${prefix}--text-input`,
- [className],
- {
- [`${prefix}--text-input--light`]: light,
- }
- );
-
- const timePickerClasses = cx({
- [`${prefix}--time-picker`]: true,
- [`${prefix}--time-picker--light`]: light,
- [`${prefix}--time-picker--invalid`]: invalid,
- [`${prefix}--time-picker--${size}`]: size,
- [className]: className,
- });
-
- const labelClasses = cx(`${prefix}--label`, {
- [`${prefix}--visually-hidden`]: hideLabel,
- [`${prefix}--label--disabled`]: disabled,
- });
-
- const label = labelText ? (
-
- {labelText}
-
- ) : null;
-
- const error = invalid ? (
- {invalidText}
- ) : null;
-
- return (
-
- );
-});
-
-TimePicker.propTypes = {
- /**
- * Pass in the children that will be rendered next to the form control
- */
- children: PropTypes.node,
-
- /**
- * Specify an optional className to be applied to the container node
- */
- className: PropTypes.string,
-
- /**
- * Specify whether the ` ` should be disabled
- */
- disabled: PropTypes.bool,
-
- /**
- * Specify whether you want the underlying label to be visually hidden
- */
- hideLabel: PropTypes.bool,
-
- /**
- * Specify a custom `id` for the ` `
- */
- id: PropTypes.string.isRequired,
-
- /**
- * Specify whether the control is currently invalid
- */
- invalid: PropTypes.bool,
-
- /**
- * Provide the text that is displayed when the control is in an invalid state
- */
- invalidText: PropTypes.node,
-
- /**
- * Provide the text that will be read by a screen reader when visiting this
- * control
- */
- labelText: PropTypes.node,
-
- /**
- * The `light` prop for `TimePicker` has been deprecated. It will be removed in v12. Use the `Layer` component instead.
- */
- light: deprecate(
- PropTypes.bool,
- 'The `light` prop for `TimePicker` is no longer needed and has been deprecated. It will be removed in the next major release. Use the `Layer` component instead.'
- ),
-
- /**
- * Specify the maximum length of the time string in ` `
- */
- maxLength: PropTypes.number,
-
- /**
- * Optionally provide an `onBlur` handler that is called whenever the
- * ` ` loses focus
- */
- onBlur: PropTypes.func,
-
- /**
- * Optionally provide an `onChange` handler that is called whenever ` `
- * is updated
- */
- onChange: PropTypes.func,
-
- /**
- * Optionally provide an `onClick` handler that is called whenever the
- * ` ` is clicked
- */
- onClick: PropTypes.func,
-
- /**
- * Specify the regular expression working as the pattern of the time string in ` `
- */
- pattern: PropTypes.string,
-
- /**
- * Specify the placeholder attribute for the ` `
- */
- placeholder: PropTypes.string,
-
- /**
- * Specify the size of the Time Picker.
- */
- size: PropTypes.oneOf(['sm', 'md', 'lg']),
-
- /**
- * Specify the type of the ` `
- */
- type: PropTypes.string,
-
- /**
- * Specify the value of the ` `
- */
- value: PropTypes.string,
-};
-
-export default TimePicker;
diff --git a/packages/react/src/index.js b/packages/react/src/index.js
index de0323da0dfd..af64c6560312 100644
--- a/packages/react/src/index.js
+++ b/packages/react/src/index.js
@@ -216,6 +216,11 @@ export {
FluidComboBox as unstable__FluidComboBox,
FluidComboBoxSkeleton as unstable__FluidComboBoxSkeleton,
} from './components/FluidComboBox';
+export {
+ FluidDatePicker as unstable__FluidDatePicker,
+ FluidDatePickerSkeleton as unstable__FluidDatePickerSkeleton,
+} from './components/FluidDatePicker';
+export { FluidDatePickerInput as unstable__FluidDatePickerInput } from './components/FluidDatePickerInput';
export {
FluidDropdown as unstable__FluidDropdown,
FluidDropdownSkeleton as unstable__FluidDropdownSkeleton,
diff --git a/packages/sketch/package.json b/packages/sketch/package.json
index 8cf0bcc42c20..ca08e61b02fc 100644
--- a/packages/sketch/package.json
+++ b/packages/sketch/package.json
@@ -2,7 +2,7 @@
"name": "@carbon/sketch",
"private": true,
"description": "Tooling for generating a sketch plugin to bring code to design",
- "version": "11.13.1-rc.0",
+ "version": "11.14.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
@@ -28,10 +28,10 @@
"skpm:link": "skpm-link"
},
"dependencies": {
- "@carbon/colors": "^11.7.1-rc.0",
+ "@carbon/colors": "^11.8.0",
"@carbon/icon-helpers": "^10.34.0",
- "@carbon/icons": "^11.10.0",
- "@carbon/themes": "^11.11.1-rc.0",
+ "@carbon/icons": "^11.11.0",
+ "@carbon/themes": "^11.12.0",
"@carbon/type": "^11.11.0",
"@skpm/builder": "^0.8.0",
"color-string": "^1.5.3",
diff --git a/packages/styles/__tests__/__snapshots__/styles-test.js.snap b/packages/styles/__tests__/__snapshots__/styles-test.js.snap
index 24782c450218..ddd45244696c 100644
--- a/packages/styles/__tests__/__snapshots__/styles-test.js.snap
+++ b/packages/styles/__tests__/__snapshots__/styles-test.js.snap
@@ -262,6 +262,16 @@ Array [
"importPath": "@carbon/styles/scss/components/form",
"relativePath": "scss/components/form",
},
+ Object {
+ "filepath": "scss/components/fluid-date-picker/_fluid-date-picker.scss",
+ "importPath": "@carbon/styles/scss/components/fluid-date-picker/fluid-date-picker",
+ "relativePath": "scss/components/fluid-date-picker/fluid-date-picker",
+ },
+ Object {
+ "filepath": "scss/components/fluid-date-picker/_index.scss",
+ "importPath": "@carbon/styles/scss/components/fluid-date-picker",
+ "relativePath": "scss/components/fluid-date-picker",
+ },
Object {
"filepath": "scss/components/fluid-dropdown/_fluid-dropdown.scss",
"importPath": "@carbon/styles/scss/components/fluid-dropdown/fluid-dropdown",
diff --git a/packages/styles/files.js b/packages/styles/files.js
index 0a382187bb5b..d467397eb9c4 100644
--- a/packages/styles/files.js
+++ b/packages/styles/files.js
@@ -71,6 +71,8 @@ const files = [
'scss/components/file-uploader/_index.scss',
'scss/components/form/_form.scss',
'scss/components/form/_index.scss',
+ 'scss/components/fluid-date-picker/_fluid-date-picker.scss',
+ 'scss/components/fluid-date-picker/_index.scss',
'scss/components/fluid-dropdown/_fluid-dropdown.scss',
'scss/components/fluid-dropdown/_index.scss',
'scss/components/fluid-list-box/_fluid-list-box.scss',
diff --git a/packages/styles/package.json b/packages/styles/package.json
index 037d63887dd8..1dfcae8f63f6 100644
--- a/packages/styles/package.json
+++ b/packages/styles/package.json
@@ -1,7 +1,7 @@
{
"name": "@carbon/styles",
"description": "Styles for the Carbon Design System",
- "version": "1.17.0-rc.1",
+ "version": "1.17.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
@@ -32,12 +32,12 @@
"sass": "^1.33.0"
},
"dependencies": {
- "@carbon/colors": "^11.7.1-rc.0",
+ "@carbon/colors": "^11.8.0",
"@carbon/feature-flags": "^0.9.0",
"@carbon/grid": "^11.7.0",
"@carbon/layout": "^11.7.0",
"@carbon/motion": "^11.5.0",
- "@carbon/themes": "^11.11.1-rc.0",
+ "@carbon/themes": "^11.12.0",
"@carbon/type": "^11.11.0",
"@ibm/plex": "6.0.0-next.6"
},
diff --git a/packages/styles/scss/components/_index.scss b/packages/styles/scss/components/_index.scss
index 976429ab9b51..8e02aa8bd8d8 100644
--- a/packages/styles/scss/components/_index.scss
+++ b/packages/styles/scss/components/_index.scss
@@ -24,6 +24,7 @@
@use 'dropdown';
@use 'file-uploader';
@use 'fluid-combo-box';
+@use 'fluid-date-picker';
@use 'fluid-dropdown';
@use 'fluid-list-box';
@use 'fluid-multiselect';
diff --git a/packages/styles/scss/components/data-table/_data-table.scss b/packages/styles/scss/components/data-table/_data-table.scss
index fb95dc30444c..0215b82e3f90 100644
--- a/packages/styles/scss/components/data-table/_data-table.scss
+++ b/packages/styles/scss/components/data-table/_data-table.scss
@@ -329,26 +329,6 @@
transition: background-color $duration-fast-01 motion(entrance, productive);
}
- .#{$prefix}--data-table
- .#{$prefix}--table-column-checkbox
- .#{$prefix}--checkbox:focus
- + .#{$prefix}--checkbox-label::before {
- //make checkbox focus larger to match expansion btn focus
- outline-offset: rem(6px);
- }
-
- .#{$prefix}--data-table--compact
- .#{$prefix}--table-column-checkbox
- .#{$prefix}--checkbox:focus
- + .#{$prefix}--checkbox-label::before,
- .#{$prefix}--data-table--xs
- .#{$prefix}--table-column-checkbox
- .#{$prefix}--checkbox:focus
- + .#{$prefix}--checkbox-label::before {
- //make checkbox match expansion button focus size
- outline-offset: rem(2px);
- }
-
.#{$prefix}--data-table thead th.#{$prefix}--table-column-checkbox,
.#{$prefix}--data-table tbody td.#{$prefix}--table-column-checkbox,
.#{$prefix}--data-table thead th.#{$prefix}--table-expand,
diff --git a/packages/styles/scss/components/date-picker/_date-picker.scss b/packages/styles/scss/components/date-picker/_date-picker.scss
index 6e889bcf5c86..ce416b9a5387 100644
--- a/packages/styles/scss/components/date-picker/_date-picker.scss
+++ b/packages/styles/scss/components/date-picker/_date-picker.scss
@@ -46,6 +46,10 @@
justify-content: space-between;
}
+ .#{$prefix}--date-picker-container .#{$prefix}--label {
+ display: flex;
+ }
+
.#{$prefix}--date-picker-input__wrapper {
position: relative;
display: flex;
diff --git a/packages/styles/scss/components/fluid-date-picker/_fluid-date-picker.scss b/packages/styles/scss/components/fluid-date-picker/_fluid-date-picker.scss
new file mode 100644
index 000000000000..98f375acf922
--- /dev/null
+++ b/packages/styles/scss/components/fluid-date-picker/_fluid-date-picker.scss
@@ -0,0 +1,341 @@
+//
+// Copyright IBM Corp. 2022
+//
+// This source code is licensed under the Apache-2.0 license found in the
+// LICENSE file in the root directory of this source tree.
+//
+
+//-----------------------------
+// Fluid Date Picker
+//-----------------------------
+@use '../../config' as *;
+@use '../../motion' as *;
+@use '../../spacing' as *;
+@use '../../theme' as *;
+@use '../../utilities/convert' as *;
+@use '../../utilities/focus-outline' as *;
+@use '../date-picker';
+
+@mixin fluid-date-picker {
+ .#{$prefix}--date-picker--fluid {
+ display: inline-flex;
+ background: $field;
+ }
+
+ .#{$prefix}--date-picker--fluid .#{$prefix}--date-picker {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ transition: background-color $duration-fast-01 motion(standard, productive),
+ outline $duration-fast-01 motion(standard, productive);
+ }
+
+ .#{$prefix}--date-picker--fluid .#{$prefix}--label {
+ position: absolute;
+ z-index: 1;
+ top: rem(13px);
+ left: $spacing-05;
+ display: flex;
+ height: rem(16px);
+ align-items: center;
+ margin: 0;
+ }
+
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker-input__wrapper
+ .#{$prefix}--date-picker__input {
+ min-width: rem(144px);
+ min-height: rem(64px);
+ padding: rem(32px) $spacing-05 rem(13px);
+ border-bottom: none;
+ background: transparent;
+ }
+
+ // Simple
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--simple
+ .#{$prefix}--date-picker__icon {
+ display: none;
+ }
+
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--simple
+ .#{$prefix}--date-picker__input:not(.#{$prefix}--date-picker__input--invalid):not(.#{$prefix}--date-picker__input--warn),
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--simple
+ .#{$prefix}--date-picker--fluid--warn {
+ border-bottom: 1px solid $border-strong;
+ }
+
+ // Single, Range
+ .#{$prefix}--date-picker--fluid .#{$prefix}--date-picker__icon {
+ top: rem(43px);
+ }
+
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--single
+ .#{$prefix}--date-picker__input {
+ width: 100%;
+ }
+
+ .#{$prefix}--date-picker--fluid .#{$prefix}--date-picker--single {
+ border-bottom: none;
+ }
+
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--single
+ .#{$prefix}--date-picker__input:not(.#{$prefix}--date-picker__input--invalid),
+ .#{$prefix}--date-picker--single .#{$prefix}--date-picker--fluid--warn {
+ border-bottom: 1px solid $border-strong;
+ }
+
+ // Range
+ .#{$prefix}--date-picker--fluid:not(.#{$prefix}--date-picker--fluid--invalid):not(.#{$prefix}--date-picker--fluid--warn)
+ .#{$prefix}--date-picker--range
+ .#{$prefix}--date-picker-container:not(.#{$prefix}--date-picker--fluid--invalid) {
+ border-bottom: 1px solid $border-strong;
+ }
+
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--range
+ .#{$prefix}--date-picker__input,
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--range
+ .#{$prefix}--date-picker-container {
+ width: 100%;
+ min-width: rem(144px);
+ min-height: rem(63px);
+ }
+
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--range
+ > .#{$prefix}--date-picker-container:first-child {
+ margin-right: 0;
+ }
+
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--range
+ > .#{$prefix}--date-picker-container:last-child
+ .#{$prefix}--date-picker__input {
+ border-left: 1px solid $border-strong;
+ }
+
+ // Invalid
+ // Entire input
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--invalid,
+ // Just one input invalid
+ .#{$prefix}--date-picker-container.#{$prefix}--date-picker--fluid--invalid {
+ @include focus-outline('invalid');
+ }
+
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker-container.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker__input--invalid {
+ outline: none;
+ }
+
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker-container:last-child.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker__input--invalid,
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker-container.#{$prefix}--date-picker--fluid--invalid
+ + .#{$prefix}--date-picker-container
+ .#{$prefix}--date-picker__input {
+ border-left: none;
+ }
+
+ .#{$prefix}--date-picker-container.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--form-requirement,
+ .#{$prefix}--date-picker-container.#{$prefix}--date-picker--fluid--warn
+ .#{$prefix}--form-requirement {
+ padding: $spacing-03 rem(40px) $spacing-03 $spacing-05;
+ margin: 0;
+ }
+
+ .#{$prefix}--date-picker-container.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker,
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker,
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--single
+ .#{$prefix}--date-picker--fluid--warn
+ .#{$prefix}--date-picker__input,
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--warn
+ .#{$prefix}--date-picker--range
+ .#{$prefix}--date-picker-container {
+ border-bottom: 1px solid transparent;
+ }
+
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker--range
+ > .#{$prefix}--date-picker-container:last-child
+ .#{$prefix}--date-picker__input,
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--warn
+ .#{$prefix}--date-picker--range
+ > .#{$prefix}--date-picker-container:last-child
+ .#{$prefix}--date-picker__input,
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--fluid--warn
+ + .#{$prefix}--date-picker-container:last-child
+ .#{$prefix}--date-picker__input,
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--fluid--warn.#{$prefix}--date-picker-container:last-child
+ .#{$prefix}--date-picker__input {
+ border-left: 1px solid transparent;
+ }
+
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker--range
+ > .#{$prefix}--date-picker-container:first-child::after,
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--warn
+ .#{$prefix}--date-picker--range
+ > .#{$prefix}--date-picker-container:first-child::after,
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--range
+ .#{$prefix}--date-picker--fluid--warn.#{$prefix}--date-picker-container:first-child::after,
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--range
+ .#{$prefix}--date-picker--fluid--warn.#{$prefix}--date-picker-container:last-child::after {
+ position: absolute;
+ top: rem(8px);
+ right: 0;
+ display: block;
+ width: 1px;
+ height: calc(100% - 1rem);
+ background: $border-strong;
+ content: '';
+ }
+
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--fluid--warn.#{$prefix}--date-picker-container:last-child::after {
+ left: 0;
+ }
+
+ .#{$prefix}--date-picker--fluid .#{$prefix}--date-picker__divider {
+ width: calc(100% - 2rem);
+ border-style: solid;
+ border-color: $border-subtle;
+ border-bottom: none;
+ margin: 0 1rem;
+ }
+
+ .#{$prefix}--date-picker-container.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker__icon--invalid,
+ .#{$prefix}--date-picker-container.#{$prefix}--date-picker--fluid--warn
+ .#{$prefix}--date-picker__icon--warn {
+ top: rem(80px);
+ }
+
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--simple
+ .#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker__icon--invalid,
+ .#{$prefix}--date-picker--fluid
+ .#{$prefix}--date-picker--simple
+ .#{$prefix}--date-picker--fluid--warn
+ .#{$prefix}--date-picker__icon--warn {
+ display: block;
+ }
+
+ // Set focus when single input is invalid
+ .#{$prefix}--date-picker-container.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker__input:focus {
+ @include focus-outline('outline');
+ }
+
+ // Entire Datepicker invalid state
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker--range
+ ~ .#{$prefix}--form-requirement,
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--warn
+ .#{$prefix}--date-picker--range
+ ~ .#{$prefix}--form-requirement {
+ display: block;
+ overflow: visible;
+ max-height: 100%;
+ padding: $spacing-03 rem(40px) $spacing-03 $spacing-05;
+ margin-top: 0;
+ }
+
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker--range
+ ~ .#{$prefix}--form-requirement {
+ color: $text-error;
+ }
+
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--invalid,
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--warn {
+ position: relative;
+ }
+
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--invalid
+ .#{$prefix}--date-picker--range
+ + .#{$prefix}--date-picker__icon,
+ .#{$prefix}--date-picker--fluid.#{$prefix}--date-picker--fluid--warn
+ .#{$prefix}--date-picker--range
+ + .#{$prefix}--date-picker__icon {
+ top: rem(80px);
+ }
+
+ // Skeleton
+ .#{$prefix}--date-picker--fluid__skeleton {
+ height: rem(64px);
+ border-bottom: 1px solid $skeleton-element;
+ background: $skeleton-background;
+ }
+
+ .#{$prefix}--date-picker--fluid__skeleton--container {
+ position: relative;
+ width: 100%;
+ height: rem(64px);
+ padding: rem(13px) rem(40px) rem(13px) $spacing-05;
+ }
+
+ .#{$prefix}--date-picker--fluid__skeleton .#{$prefix}--skeleton {
+ height: 1rem;
+ }
+
+ .#{$prefix}--date-picker--fluid__skeleton .#{$prefix}--label {
+ margin-bottom: rem(4px);
+ }
+
+ .#{$prefix}--date-picker--fluid__skeleton .#{$prefix}--text-input {
+ width: 80%;
+ height: rem(18px);
+ }
+
+ .#{$prefix}--date-picker--fluid__skeleton--container
+ .#{$prefix}--date-picker__icon {
+ top: auto;
+ bottom: rem(2px);
+ }
+
+ // Range skeleton
+ .#{$prefix}--date-picker--fluid__skeleton--range {
+ display: flex;
+ flex-direction: row;
+ }
+
+ .#{$prefix}--date-picker--fluid__skeleton--range
+ .#{$prefix}--date-picker--fluid__skeleton--container {
+ display: flex;
+ width: 50%;
+ flex-direction: column;
+ }
+
+ .#{$prefix}--date-picker--fluid__skeleton--range
+ .#{$prefix}--date-picker--fluid__skeleton--container:first-of-type {
+ border-right: 1px solid $skeleton-element;
+ }
+
+ .#{$prefix}--date-picker--fluid__skeleton--range .#{$prefix}--text-input {
+ width: 100%;
+ }
+
+ .#{$prefix}--date-picker--fluid__skeleton--range
+ .#{$prefix}--date-picker--fluid__skeleton--container
+ .#{$prefix}--date-picker__icon {
+ bottom: rem(5px);
+ }
+}
diff --git a/packages/styles/scss/components/fluid-date-picker/_index.scss b/packages/styles/scss/components/fluid-date-picker/_index.scss
new file mode 100644
index 000000000000..63bd8b94d285
--- /dev/null
+++ b/packages/styles/scss/components/fluid-date-picker/_index.scss
@@ -0,0 +1,11 @@
+//
+// Copyright IBM Corp. 2022
+//
+// This source code is licensed under the Apache-2.0 license found in the
+// LICENSE file in the root directory of this source tree.
+//
+
+@forward 'fluid-date-picker';
+@use 'fluid-date-picker';
+
+@include fluid-date-picker.fluid-date-picker;
diff --git a/packages/styles/scss/components/fluid-text-area/_fluid-text-area.scss b/packages/styles/scss/components/fluid-text-area/_fluid-text-area.scss
index 8f8942c094c6..60c991f425e3 100644
--- a/packages/styles/scss/components/fluid-text-area/_fluid-text-area.scss
+++ b/packages/styles/scss/components/fluid-text-area/_fluid-text-area.scss
@@ -64,7 +64,7 @@
// invalid
.#{$prefix}--text-area--fluid .#{$prefix}--text-area--invalid,
.#{$prefix}--text-area--fluid .#{$prefix}--text-area:focus {
- border-bottom: none;
+ border-bottom: 1px solid transparent;
}
.#{$prefix}--text-area__divider,
diff --git a/packages/styles/scss/components/form/_form.scss b/packages/styles/scss/components/form/_form.scss
index 86ca02a4d8d5..b1725bfc391d 100644
--- a/packages/styles/scss/components/form/_form.scss
+++ b/packages/styles/scss/components/form/_form.scss
@@ -20,6 +20,17 @@
$input-label-weight: 400 !default;
@mixin form {
+ // Override Chrome autocomplete styles
+ input:-webkit-autofill,
+ input:-webkit-autofill:hover,
+ input:-webkit-autofill:focus,
+ textarea:-webkit-autofill,
+ textarea:-webkit-autofill:hover,
+ textarea:-webkit-autofill:focus {
+ box-shadow: 0 0 0 1000px $field inset;
+ -webkit-text-fill-color: $text-primary;
+ }
+
.#{$prefix}--fieldset {
@include reset;
}
diff --git a/packages/styles/scss/components/multiselect/_multiselect.scss b/packages/styles/scss/components/multiselect/_multiselect.scss
index 4fc986bc8508..16a2f8223cec 100644
--- a/packages/styles/scss/components/multiselect/_multiselect.scss
+++ b/packages/styles/scss/components/multiselect/_multiselect.scss
@@ -105,4 +105,42 @@
.#{$prefix}--list-box__menu {
visibility: hidden;
}
+
+ .#{$prefix}--multi-select.#{$prefix}--multi-select--readonly,
+ .#{$prefix}--multi-select.#{$prefix}--multi-select--readonly:hover {
+ background-color: transparent;
+ }
+
+ .#{$prefix}--multi-select.#{$prefix}--multi-select--readonly
+ .#{$prefix}--list-box__menu-icon
+ svg {
+ fill: $icon-disabled;
+ }
+
+ .#{$prefix}--multi-select.#{$prefix}--multi-select--readonly
+ .#{$prefix}--tag--filter,
+ .#{$prefix}--multi-select.#{$prefix}--multi-select--readonly
+ .#{$prefix}--tag__close-icon:hover {
+ background-color: transparent;
+ color: $text-primary;
+ cursor: default;
+ }
+
+ .#{$prefix}--multi-select.#{$prefix}--multi-select--readonly
+ .#{$prefix}--tag--filter {
+ box-shadow: 0 0 0 1px $background-inverse;
+ }
+
+ .#{$prefix}--multi-select.#{$prefix}--multi-select--readonly
+ .#{$prefix}--tag--filter
+ svg {
+ fill: $icon-disabled;
+ }
+
+ .#{$prefix}--multi-select.#{$prefix}--multi-select--readonly
+ .#{$prefix}--list-box__field,
+ .#{$prefix}--multi-select.#{$prefix}--multi-select--readonly
+ .#{$prefix}--list-box__menu-icon {
+ cursor: default;
+ }
}
diff --git a/packages/styles/scss/components/number-input/_number-input.scss b/packages/styles/scss/components/number-input/_number-input.scss
index 8ba75d3628cc..2406eb410198 100644
--- a/packages/styles/scss/components/number-input/_number-input.scss
+++ b/packages/styles/scss/components/number-input/_number-input.scss
@@ -440,13 +440,37 @@
background: transparent;
}
- .#{$prefix}--number--readonly .#{$prefix}--number__controls {
- display: none;
+ .#{$prefix}--number--readonly .#{$prefix}--number__control-btn {
+ color: $icon-disabled;
+ pointer-events: none;
+
+ &:hover {
+ background-color: transparent;
+ cursor: pointer;
+
+ &::before,
+ &::after {
+ background-color: transparent;
+ }
+ }
}
- .#{$prefix}--number__readonly-icon {
- position: absolute;
- right: rem(16px);
+ .#{$prefix}--number--readonly
+ input[type='number']:focus
+ ~ .#{$prefix}--number__controls
+ .#{$prefix}--number__control-btn:hover {
+ outline: none;
+ }
+
+ .#{$prefix}--number--readonly .#{$prefix}--number__control-btn::before,
+ .#{$prefix}--number--readonly .#{$prefix}--number__control-btn::after {
+ background: transparent;
+ }
+
+ .#{$prefix}--number--readonly
+ .#{$prefix}--number__controls:hover
+ .#{$prefix}--number__rule-divider:not(:first-of-type) {
+ background-color: $border-subtle;
}
// Skeleton State
diff --git a/packages/styles/scss/components/text-area/_text-area.scss b/packages/styles/scss/components/text-area/_text-area.scss
index 49bee46aeef8..9f5f845c6c9b 100644
--- a/packages/styles/scss/components/text-area/_text-area.scss
+++ b/packages/styles/scss/components/text-area/_text-area.scss
@@ -25,7 +25,6 @@
@include type-style('body-01');
@include focus-outline('reset');
- width: 100%;
min-width: 10rem;
height: 100%;
min-height: rem(40px);
@@ -108,6 +107,7 @@
.#{$prefix}--text-area.#{$prefix}--skeleton {
@include skeleton;
+ width: 100%;
height: rem(100px);
&::placeholder {
diff --git a/packages/themes/examples/preview/.yarn/install-state.gz b/packages/themes/examples/preview/.yarn/install-state.gz
new file mode 100644
index 000000000000..07ff4aa6fcce
Binary files /dev/null and b/packages/themes/examples/preview/.yarn/install-state.gz differ
diff --git a/packages/themes/examples/preview/yarn.lock b/packages/themes/examples/preview/yarn.lock
index a13906c06ffb..b6ebd1dc5386 100644
--- a/packages/themes/examples/preview/yarn.lock
+++ b/packages/themes/examples/preview/yarn.lock
@@ -4221,13 +4221,13 @@ fsevents@~2.3.2:
linkType: hard
"loader-utils@npm:^1.1.0":
- version: 1.4.0
- resolution: "loader-utils@npm:1.4.0"
+ version: 1.4.1
+ resolution: "loader-utils@npm:1.4.1"
dependencies:
big.js: ^5.2.2
emojis-list: ^3.0.0
json5: ^1.0.1
- checksum: d150b15e7a42ac47d935c8b484b79e44ff6ab4c75df7cc4cb9093350cf014ec0b17bdb60c5d6f91a37b8b218bd63b973e263c65944f58ca2573e402b9a27e717
+ checksum: ea0b648cba0194e04a90aab6270619f0e35be009e33a443d9e642e93056cd49e6ca4c9678bd1c777a2392551bc5f4d0f24a87f5040608da1274aa84c6eebb502
languageName: node
linkType: hard
diff --git a/packages/themes/package.json b/packages/themes/package.json
index 7187a898fad5..2c136844662e 100644
--- a/packages/themes/package.json
+++ b/packages/themes/package.json
@@ -1,7 +1,7 @@
{
"name": "@carbon/themes",
"description": "Themes for applying color in the Carbon Design System",
- "version": "11.11.1-rc.0",
+ "version": "11.12.0",
"license": "Apache-2.0",
"main": "lib/index.js",
"module": "es/index.js",
@@ -29,7 +29,7 @@
"build": "yarn clean && carbon-cli bundle src/index.js --name CarbonThemes && babel-node --presets '@babel/preset-env' tasks/build.js && carbon-cli check \"scss/*.scss\""
},
"dependencies": {
- "@carbon/colors": "^11.7.1-rc.0",
+ "@carbon/colors": "^11.8.0",
"@carbon/layout": "^11.7.0",
"@carbon/type": "^11.11.0",
"color": "^4.0.0"
diff --git a/www/package.json b/www/package.json
index 68cbf02093f9..3e9083be5341 100644
--- a/www/package.json
+++ b/www/package.json
@@ -1,7 +1,7 @@
{
"name": "www",
"private": true,
- "version": "0.26.0-rc.1",
+ "version": "0.26.0",
"license": "Apache-2.0",
"repository": {
"type": "git",
@@ -22,7 +22,7 @@
"start": "next start"
},
"dependencies": {
- "@carbon/react": "^1.17.0-rc.1",
+ "@carbon/react": "^1.17.0",
"@octokit/core": "^4.0.0",
"@octokit/plugin-retry": "^3.0.9",
"@octokit/plugin-throttling": "^4.0.0",
diff --git a/yarn.lock b/yarn.lock
index 3903a98c4c2e..fa8857306368 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1931,7 +1931,7 @@ __metadata:
languageName: unknown
linkType: soft
-"@carbon/colors@^11.7.1-rc.0, @carbon/colors@workspace:packages/colors":
+"@carbon/colors@^11.8.0, @carbon/colors@workspace:packages/colors":
version: 0.0.0-use.local
resolution: "@carbon/colors@workspace:packages/colors"
dependencies:
@@ -1950,12 +1950,12 @@ __metadata:
resolution: "@carbon/elements@workspace:packages/elements"
dependencies:
"@carbon/cli": ^11.5.0
- "@carbon/colors": ^11.7.1-rc.0
+ "@carbon/colors": ^11.8.0
"@carbon/grid": ^11.7.0
- "@carbon/icons": ^11.10.0
+ "@carbon/icons": ^11.11.0
"@carbon/layout": ^11.7.0
"@carbon/motion": ^11.5.0
- "@carbon/themes": ^11.11.1-rc.0
+ "@carbon/themes": ^11.12.0
"@carbon/type": ^11.11.0
fs-extra: ^10.0.0
klaw-sync: ^6.0.0
@@ -2002,7 +2002,7 @@ __metadata:
languageName: unknown
linkType: soft
-"@carbon/icon-build-helpers@^1.5.0, @carbon/icon-build-helpers@workspace:packages/icon-build-helpers":
+"@carbon/icon-build-helpers@^1.6.0, @carbon/icon-build-helpers@workspace:packages/icon-build-helpers":
version: 0.0.0-use.local
resolution: "@carbon/icon-build-helpers@workspace:packages/icon-build-helpers"
dependencies:
@@ -2015,7 +2015,7 @@ __metadata:
"@carbon/cli-reporter": ^10.5.0
"@carbon/icon-helpers": ^10.34.0
"@rollup/plugin-babel": ^5.3.0
- "@rollup/plugin-replace": ^4.0.0
+ "@rollup/plugin-replace": ^5.0.0
browserslist-config-carbon: ^11.0.0
change-case: ^4.1.1
core-js: ^3.16.0
@@ -2046,13 +2046,13 @@ __metadata:
languageName: unknown
linkType: soft
-"@carbon/icons-react@^11.10.0, @carbon/icons-react@workspace:packages/icons-react":
+"@carbon/icons-react@^11.11.0, @carbon/icons-react@workspace:packages/icons-react":
version: 0.0.0-use.local
resolution: "@carbon/icons-react@workspace:packages/icons-react"
dependencies:
- "@carbon/icon-build-helpers": ^1.5.0
+ "@carbon/icon-build-helpers": ^1.6.0
"@carbon/icon-helpers": ^10.34.0
- "@carbon/icons": ^11.10.0
+ "@carbon/icons": ^11.11.0
"@carbon/telemetry": 0.1.0
prop-types: ^15.7.2
rimraf: ^3.0.2
@@ -2080,7 +2080,7 @@ __metadata:
dependencies:
"@carbon/cli-reporter": ^10.5.0
"@carbon/icon-helpers": ^10.34.0
- "@carbon/icons": ^11.10.0
+ "@carbon/icons": ^11.11.0
fs-extra: ^10.0.0
prettier: ^2.7.1
rimraf: ^3.0.0
@@ -2089,12 +2089,12 @@ __metadata:
languageName: unknown
linkType: soft
-"@carbon/icons@^11.10.0, @carbon/icons@workspace:packages/icons":
+"@carbon/icons@^11.11.0, @carbon/icons@workspace:packages/icons":
version: 0.0.0-use.local
resolution: "@carbon/icons@workspace:packages/icons"
dependencies:
"@carbon/cli": ^11.5.0
- "@carbon/icon-build-helpers": ^1.5.0
+ "@carbon/icon-build-helpers": ^1.6.0
rimraf: ^3.0.2
languageName: unknown
linkType: soft
@@ -2132,9 +2132,9 @@ __metadata:
version: 0.0.0-use.local
resolution: "@carbon/pictograms-react@workspace:packages/pictograms-react"
dependencies:
- "@carbon/icon-build-helpers": ^1.5.0
+ "@carbon/icon-build-helpers": ^1.6.0
"@carbon/icon-helpers": ^10.34.0
- "@carbon/pictograms": ^12.7.0
+ "@carbon/pictograms": ^12.8.0
"@carbon/telemetry": 0.1.0
prop-types: ^15.7.2
peerDependencies:
@@ -2142,16 +2142,16 @@ __metadata:
languageName: unknown
linkType: soft
-"@carbon/pictograms@^12.7.0, @carbon/pictograms@workspace:packages/pictograms":
+"@carbon/pictograms@^12.8.0, @carbon/pictograms@workspace:packages/pictograms":
version: 0.0.0-use.local
resolution: "@carbon/pictograms@workspace:packages/pictograms"
dependencies:
- "@carbon/icon-build-helpers": ^1.5.0
+ "@carbon/icon-build-helpers": ^1.6.0
rimraf: ^3.0.0
languageName: unknown
linkType: soft
-"@carbon/react@^1.17.0-rc.1, @carbon/react@workspace:packages/react":
+"@carbon/react@^1.17.0, @carbon/react@workspace:packages/react":
version: 0.0.0-use.local
resolution: "@carbon/react@workspace:packages/react"
dependencies:
@@ -2164,12 +2164,12 @@ __metadata:
"@babel/preset-react": ^7.17.12
"@babel/runtime": ^7.18.3
"@carbon/feature-flags": ^0.9.0
- "@carbon/icons-react": ^11.10.0
+ "@carbon/icons-react": ^11.11.0
"@carbon/layout": ^11.7.0
- "@carbon/styles": ^1.17.0-rc.1
+ "@carbon/styles": ^1.17.0
"@carbon/telemetry": 0.1.0
"@carbon/test-utils": ^10.26.0
- "@carbon/themes": ^11.11.1-rc.0
+ "@carbon/themes": ^11.12.0
"@rollup/plugin-babel": ^5.3.0
"@rollup/plugin-commonjs": ^21.0.0
"@rollup/plugin-node-resolve": ^13.0.0
@@ -2252,10 +2252,10 @@ __metadata:
version: 0.0.0-use.local
resolution: "@carbon/sketch@workspace:packages/sketch"
dependencies:
- "@carbon/colors": ^11.7.1-rc.0
+ "@carbon/colors": ^11.8.0
"@carbon/icon-helpers": ^10.34.0
- "@carbon/icons": ^11.10.0
- "@carbon/themes": ^11.11.1-rc.0
+ "@carbon/icons": ^11.11.0
+ "@carbon/themes": ^11.12.0
"@carbon/type": ^11.11.0
"@skpm/builder": ^0.8.0
color-string: ^1.5.3
@@ -2267,17 +2267,17 @@ __metadata:
languageName: unknown
linkType: soft
-"@carbon/styles@^1.17.0-rc.1, @carbon/styles@workspace:packages/styles":
+"@carbon/styles@^1.17.0, @carbon/styles@workspace:packages/styles":
version: 0.0.0-use.local
resolution: "@carbon/styles@workspace:packages/styles"
dependencies:
- "@carbon/colors": ^11.7.1-rc.0
+ "@carbon/colors": ^11.8.0
"@carbon/feature-flags": ^0.9.0
"@carbon/grid": ^11.7.0
"@carbon/layout": ^11.7.0
"@carbon/motion": ^11.5.0
"@carbon/test-utils": ^10.26.0
- "@carbon/themes": ^11.11.1-rc.0
+ "@carbon/themes": ^11.12.0
"@carbon/type": ^11.11.0
"@ibm/plex": 6.0.0-next.6
autoprefixer: ^10.4.7
@@ -2318,7 +2318,7 @@ __metadata:
languageName: unknown
linkType: soft
-"@carbon/themes@^11.11.1-rc.0, @carbon/themes@workspace:packages/themes":
+"@carbon/themes@^11.12.0, @carbon/themes@workspace:packages/themes":
version: 0.0.0-use.local
resolution: "@carbon/themes@workspace:packages/themes"
dependencies:
@@ -2326,7 +2326,7 @@ __metadata:
"@babel/preset-env": ^7.18.2
"@carbon/cli": ^11.5.0
"@carbon/cli-reporter": ^10.5.0
- "@carbon/colors": ^11.7.1-rc.0
+ "@carbon/colors": ^11.8.0
"@carbon/layout": ^11.7.0
"@carbon/scss-generator": ^10.15.0
"@carbon/test-utils": ^10.26.0
@@ -5255,15 +5255,18 @@ __metadata:
languageName: node
linkType: hard
-"@rollup/plugin-replace@npm:^4.0.0":
- version: 4.0.0
- resolution: "@rollup/plugin-replace@npm:4.0.0"
+"@rollup/plugin-replace@npm:^5.0.0":
+ version: 5.0.1
+ resolution: "@rollup/plugin-replace@npm:5.0.1"
dependencies:
- "@rollup/pluginutils": ^3.1.0
- magic-string: ^0.25.7
+ "@rollup/pluginutils": ^5.0.1
+ magic-string: ^0.26.4
peerDependencies:
- rollup: ^1.20.0 || ^2.0.0
- checksum: b61701e612661a46da06ca88f390c3839b586708abc0329a476411b90aa8ac59fe94437ede4c3fe53fea268b3054ea9d7d4ee851d7bd0cb7a5f06906002067cb
+ rollup: ^1.20.0||^2.0.0||^3.0.0
+ peerDependenciesMeta:
+ rollup:
+ optional: true
+ checksum: d5f98a93dd24086ed1bf70e9299230d1fddae9b132280e2daaca855dba2307eccd5490553e2a03b701b7411593d2921d2d675e5d906b4754c57152f8c50adb07
languageName: node
linkType: hard
@@ -5307,6 +5310,22 @@ __metadata:
languageName: node
linkType: hard
+"@rollup/pluginutils@npm:^5.0.1":
+ version: 5.0.2
+ resolution: "@rollup/pluginutils@npm:5.0.2"
+ dependencies:
+ "@types/estree": ^1.0.0
+ estree-walker: ^2.0.2
+ picomatch: ^2.3.1
+ peerDependencies:
+ rollup: ^1.20.0||^2.0.0||^3.0.0
+ peerDependenciesMeta:
+ rollup:
+ optional: true
+ checksum: edea15e543bebc7dcac3b0ac8bc7b8e8e6dbd46e2864dbe5dd28072de1fbd5b0e10d545a610c0edaa178e8a7ac432e2a2a52e547ece1308471412caba47db8ce
+ languageName: node
+ linkType: hard
+
"@rushstack/eslint-patch@npm:1.0.8":
version: 1.0.8
resolution: "@rushstack/eslint-patch@npm:1.0.8"
@@ -7430,10 +7449,10 @@ __metadata:
languageName: node
linkType: hard
-"@types/estree@npm:*, @types/estree@npm:^0.0.51":
- version: 0.0.51
- resolution: "@types/estree@npm:0.0.51"
- checksum: e56a3bcf759fd9185e992e7fdb3c6a5f81e8ff120e871641607581fb3728d16c811702a7d40fa5f869b7f7b4437ab6a87eb8d98ffafeee51e85bbe955932a189
+"@types/estree@npm:*, @types/estree@npm:^1.0.0":
+ version: 1.0.0
+ resolution: "@types/estree@npm:1.0.0"
+ checksum: 910d97fb7092c6738d30a7430ae4786a38542023c6302b95d46f49420b797f21619cdde11fa92b338366268795884111c2eb10356e4bd2c8ad5b92941e9e6443
languageName: node
linkType: hard
@@ -7444,6 +7463,13 @@ __metadata:
languageName: node
linkType: hard
+"@types/estree@npm:^0.0.51":
+ version: 0.0.51
+ resolution: "@types/estree@npm:0.0.51"
+ checksum: e56a3bcf759fd9185e992e7fdb3c6a5f81e8ff120e871641607581fb3728d16c811702a7d40fa5f869b7f7b4437ab6a87eb8d98ffafeee51e85bbe955932a189
+ languageName: node
+ linkType: hard
+
"@types/express-serve-static-core@npm:*, @types/express-serve-static-core@npm:^4.17.18":
version: 4.17.28
resolution: "@types/express-serve-static-core@npm:4.17.28"
@@ -7718,10 +7744,10 @@ __metadata:
languageName: node
linkType: hard
-"@types/prop-types@npm:15.7.4":
- version: 15.7.4
- resolution: "@types/prop-types@npm:15.7.4"
- checksum: ef6e1899e59b876c273811b1bd845022fc66d5a3d11cb38a25b6c566b30514ae38fe20a40f67622f362a4f4f7f9224e22d8da101cff3d6e97e11d7b4c307cfc1
+"@types/prop-types@npm:15.7.5":
+ version: 15.7.5
+ resolution: "@types/prop-types@npm:15.7.5"
+ checksum: 5b43b8b15415e1f298243165f1d44390403bb2bd42e662bca3b5b5633fdd39c938e91b7fce3a9483699db0f7a715d08cef220c121f723a634972fdf596aec980
languageName: node
linkType: hard
@@ -10872,8 +10898,8 @@ __metadata:
"@babel/plugin-transform-react-constant-elements": ^7.17.12
"@babel/preset-env": ^7.18.2
"@babel/preset-react": ^7.17.12
- "@carbon/react": ^1.17.0-rc.1
- "@carbon/styles": ^1.17.0-rc.1
+ "@carbon/react": ^1.17.0
+ "@carbon/styles": ^1.17.0
"@carbon/telemetry": 0.1.0
"@carbon/test-utils": ^10.26.0
"@rollup/plugin-babel": ^5.3.0
@@ -10911,7 +10937,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "carbon-components@workspace:packages/carbon-components"
dependencies:
- "@carbon/styles": ^1.17.0-rc.1
+ "@carbon/styles": ^1.17.0
"@carbon/telemetry": 0.1.0
"@carbon/test-utils": ^10.26.0
fs-extra: ^10.0.0
@@ -11614,7 +11640,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "codesandbox-styles@workspace:examples/codesandbox-styles"
dependencies:
- "@carbon/styles": ^1.17.0-rc.1
+ "@carbon/styles": ^1.17.0
sass: ^1.51.0
vite: ^2.8.0
languageName: unknown
@@ -11624,7 +11650,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "codesandbox-with-sass-compilation@workspace:examples/codesandbox-with-sass-compilation"
dependencies:
- "@carbon/react": ^1.17.0-rc.1
+ "@carbon/react": ^1.17.0
react: ^17.0.0
react-dom: ^17.0.0
react-scripts: 5.0.0
@@ -11636,7 +11662,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "codesandbox@workspace:examples/codesandbox"
dependencies:
- "@carbon/react": ^1.17.0-rc.1
+ "@carbon/react": ^1.17.0
react: ^17.0.0
react-dom: ^17.0.0
react-scripts: 5.0.0
@@ -12943,7 +12969,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "custom-theme@workspace:examples/custom-theme"
dependencies:
- "@carbon/react": ^1.17.0-rc.1
+ "@carbon/react": ^1.17.0
"@types/react": ^18.0.0
"@types/react-dom": ^18.0.0
"@vitejs/plugin-react": 1.1.3
@@ -15554,7 +15580,7 @@ __metadata:
languageName: node
linkType: hard
-"estree-walker@npm:^2.0.1":
+"estree-walker@npm:^2.0.1, estree-walker@npm:^2.0.2":
version: 2.0.2
resolution: "estree-walker@npm:2.0.2"
checksum: 6151e6f9828abe2259e57f5fd3761335bb0d2ebd76dc1a01048ccee22fabcfef3c0859300f6d83ff0d1927849368775ec5a6d265dde2f6de5a1be1721cd94efc
@@ -15611,7 +15637,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "examples-light-dark@workspace:examples/light-dark-mode"
dependencies:
- "@carbon/react": ^1.17.0-rc.1
+ "@carbon/react": ^1.17.0
eslint: 8.12.0
next: 12.1.4
react: 18.0.0
@@ -15624,7 +15650,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "examples-nextjs@workspace:examples/nextjs"
dependencies:
- "@carbon/react": ^1.17.0-rc.1
+ "@carbon/react": ^1.17.0
eslint: 8.12.0
eslint-config-next: 12.1.4
next: 12.1.4
@@ -18214,7 +18240,7 @@ fsevents@^1.2.7:
resolution: "incremental-migration@workspace:examples/incremental-migration"
dependencies:
"@carbon/icons-react": ^10.49.0
- "@carbon/react": ^1.17.0-rc.1
+ "@carbon/react": ^1.17.0
carbon-components: ^10.57.0
carbon-components-react: ^7.57.0
carbon-icons: ^7.0.7
@@ -21857,6 +21883,15 @@ fsevents@^1.2.7:
languageName: node
linkType: hard
+"magic-string@npm:^0.26.4":
+ version: 0.26.7
+ resolution: "magic-string@npm:0.26.7"
+ dependencies:
+ sourcemap-codec: ^1.4.8
+ checksum: 89b0d60cbb32bbf3d1e23c46ea93db082d18a8230b972027aecb10a40bba51be519ecce0674f995571e3affe917b76b09f59d8dbc9a1b2c9c4102a2b6e8a2b01
+ languageName: node
+ linkType: hard
+
"make-dir@npm:^1.0.0":
version: 1.3.0
resolution: "make-dir@npm:1.3.0"
@@ -32120,7 +32155,7 @@ resolve@^2.0.0-next.3:
version: 0.0.0-use.local
resolution: "vite@workspace:examples/vite"
dependencies:
- "@carbon/react": ^1.17.0-rc.1
+ "@carbon/react": ^1.17.0
"@types/react": ^18.0.0
"@types/react-dom": ^18.0.0
"@vitejs/plugin-react": 1.1.3
@@ -33193,7 +33228,7 @@ resolve@^2.0.0-next.3:
version: 0.0.0-use.local
resolution: "www@workspace:www"
dependencies:
- "@carbon/react": ^1.17.0-rc.1
+ "@carbon/react": ^1.17.0
"@octokit/core": ^4.0.0
"@octokit/plugin-retry": ^3.0.9
"@octokit/plugin-throttling": ^4.0.0