diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8cf5bfe364e3..e4efe9794a85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: dedupe: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Use Node.js 20.x uses: actions/setup-node@v3 with: @@ -28,7 +28,7 @@ jobs: format: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Use Node.js 20.x uses: actions/setup-node@v3 with: @@ -41,7 +41,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Use Node.js 20.x uses: actions/setup-node@v3 with: @@ -56,7 +56,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Use Node.js 20.x uses: actions/setup-node@v3 with: @@ -82,7 +82,7 @@ jobs: name: 'test:e2e' runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Use Node.js 20.x uses: actions/setup-node@v3 with: @@ -121,7 +121,7 @@ jobs: shard: [1, 2, 3, 4] runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Use Node.js 20.x uses: actions/setup-node@v3 with: @@ -180,7 +180,7 @@ jobs: avt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Use Node.js 20.x uses: actions/setup-node@v3 with: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 350c315884d8..b4af377d54dc 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/deploy-packages.yml b/.github/workflows/deploy-packages.yml index 75daf0eff828..18e8784a1622 100644 --- a/.github/workflows/deploy-packages.yml +++ b/.github/workflows/deploy-packages.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 with: repository: carbon-design-system/design-language-website ref: master @@ -58,7 +58,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 with: repository: carbon-design-system/gatsby-theme-carbon ref: main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3ff3529b07a4..ef5cdea9b49d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,7 @@ jobs: id-token: write contents: write steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Use Node.js 20.x uses: actions/setup-node@v3 diff --git a/.github/workflows/sync-generated-files.yml b/.github/workflows/sync-generated-files.yml index f6bc81e8c101..88206645bc84 100644 --- a/.github/workflows/sync-generated-files.yml +++ b/.github/workflows/sync-generated-files.yml @@ -7,7 +7,7 @@ jobs: release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Use Node.js 20.x uses: actions/setup-node@v3 with: diff --git a/.github/workflows/v10-ci.yml b/.github/workflows/v10-ci.yml index b78c2b3decdf..8c123b218d5b 100644 --- a/.github/workflows/v10-ci.yml +++ b/.github/workflows/v10-ci.yml @@ -13,7 +13,7 @@ jobs: dedupe: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Use Node.js 20.x uses: actions/setup-node@v3 @@ -25,7 +25,7 @@ jobs: format: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 with: ref: v10 - name: Use Node.js 20.x @@ -40,7 +40,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 with: ref: v10 - name: Use Node.js 20.x @@ -57,7 +57,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 with: ref: v10 - name: Use Node.js 20.x @@ -85,7 +85,7 @@ jobs: name: 'test:e2e' runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 with: ref: v10 - name: Use Node.js 20.x diff --git a/.github/workflows/v10-deploy-react-storybook.yml b/.github/workflows/v10-deploy-react-storybook.yml index 1c052c34e184..0a92eb7116a5 100644 --- a/.github/workflows/v10-deploy-react-storybook.yml +++ b/.github/workflows/v10-deploy-react-storybook.yml @@ -16,7 +16,7 @@ jobs: build-ibmcloud: runs-on: ubuntu-latest steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Use Node.js 20.x uses: actions/setup-node@v3 diff --git a/.github/workflows/v10-release.yml b/.github/workflows/v10-release.yml index 6ba17e113a48..2ddec10b09a4 100644 --- a/.github/workflows/v10-release.yml +++ b/.github/workflows/v10-release.yml @@ -16,7 +16,7 @@ jobs: id-token: write contents: write steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 - name: Use Node.js 20.x uses: actions/setup-node@v3 diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml index f9117951e331..366f1583b827 100644 --- a/.github/workflows/version.yml +++ b/.github/workflows/version.yml @@ -28,7 +28,7 @@ jobs: if: github.repository == 'carbon-design-system/carbon' timeout-minutes: 60 steps: - - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 #v4.1.0 + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1 with: fetch-depth: '0' - name: Use Node.js 20.x diff --git a/.yarn/cache/@actions-github-npm-2.1.1-a23c34cedf-1772df082a.zip b/.yarn/cache/@actions-github-npm-2.1.1-a23c34cedf-1772df082a.zip deleted file mode 100644 index 3b64aba00fa2..000000000000 Binary files a/.yarn/cache/@actions-github-npm-2.1.1-a23c34cedf-1772df082a.zip and /dev/null differ diff --git a/.yarn/cache/@actions-github-npm-5.1.1-61d3d8cdac-2210bd7f8e.zip b/.yarn/cache/@actions-github-npm-5.1.1-61d3d8cdac-2210bd7f8e.zip deleted file mode 100644 index 473190da67d9..000000000000 Binary files a/.yarn/cache/@actions-github-npm-5.1.1-61d3d8cdac-2210bd7f8e.zip and /dev/null differ diff --git a/.yarn/cache/@actions-github-npm-6.0.0-555bf7818c-81831a7837.zip b/.yarn/cache/@actions-github-npm-6.0.0-555bf7818c-81831a7837.zip new file mode 100644 index 000000000000..ea4c426f5c8f Binary files /dev/null and b/.yarn/cache/@actions-github-npm-6.0.0-555bf7818c-81831a7837.zip differ diff --git a/.yarn/cache/@actions-http-client-npm-1.0.6-b624868e85-ee3eafa28b.zip b/.yarn/cache/@actions-http-client-npm-1.0.6-b624868e85-ee3eafa28b.zip deleted file mode 100644 index d16ecdf93332..000000000000 Binary files a/.yarn/cache/@actions-http-client-npm-1.0.6-b624868e85-ee3eafa28b.zip and /dev/null differ diff --git a/.yarn/cache/@actions-http-client-npm-2.0.1-8d69921341-799ec3df91.zip b/.yarn/cache/@actions-http-client-npm-2.0.1-8d69921341-799ec3df91.zip deleted file mode 100644 index 309ff52e9c20..000000000000 Binary files a/.yarn/cache/@actions-http-client-npm-2.0.1-8d69921341-799ec3df91.zip and /dev/null differ diff --git a/.yarn/cache/@actions-http-client-npm-2.2.0-5cded732ee-075fc21e8c.zip b/.yarn/cache/@actions-http-client-npm-2.2.0-5cded732ee-075fc21e8c.zip new file mode 100644 index 000000000000..a3785b739951 Binary files /dev/null and b/.yarn/cache/@actions-http-client-npm-2.2.0-5cded732ee-075fc21e8c.zip differ diff --git a/.yarn/cache/@fastify-busboy-npm-2.0.0-c6baf48382-41879937ce.zip b/.yarn/cache/@fastify-busboy-npm-2.0.0-c6baf48382-41879937ce.zip new file mode 100644 index 000000000000..82636906e679 Binary files /dev/null and b/.yarn/cache/@fastify-busboy-npm-2.0.0-c6baf48382-41879937ce.zip differ diff --git a/.yarn/cache/@octokit-auth-token-npm-2.5.0-a1c6ffb640-45949296c0.zip b/.yarn/cache/@octokit-auth-token-npm-2.5.0-a1c6ffb640-45949296c0.zip deleted file mode 100644 index b737fadf4ddb..000000000000 Binary files a/.yarn/cache/@octokit-auth-token-npm-2.5.0-a1c6ffb640-45949296c0.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-auth-token-npm-4.0.0-9ad78a752f-d78f4dc48b.zip b/.yarn/cache/@octokit-auth-token-npm-4.0.0-9ad78a752f-d78f4dc48b.zip new file mode 100644 index 000000000000..1772a6eb18c7 Binary files /dev/null and b/.yarn/cache/@octokit-auth-token-npm-4.0.0-9ad78a752f-d78f4dc48b.zip differ diff --git a/.yarn/cache/@octokit-core-npm-3.6.0-1273c50268-f811601290.zip b/.yarn/cache/@octokit-core-npm-3.6.0-1273c50268-f811601290.zip deleted file mode 100644 index 899e2b16a2bb..000000000000 Binary files a/.yarn/cache/@octokit-core-npm-3.6.0-1273c50268-f811601290.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-core-npm-5.0.1-58208565b9-257c595407.zip b/.yarn/cache/@octokit-core-npm-5.0.1-58208565b9-257c595407.zip new file mode 100644 index 000000000000..f76e4fcf80d6 Binary files /dev/null and b/.yarn/cache/@octokit-core-npm-5.0.1-58208565b9-257c595407.zip differ diff --git a/.yarn/cache/@octokit-endpoint-npm-6.0.12-d467db27fd-b48b29940a.zip b/.yarn/cache/@octokit-endpoint-npm-6.0.12-d467db27fd-b48b29940a.zip deleted file mode 100644 index b844a8513e49..000000000000 Binary files a/.yarn/cache/@octokit-endpoint-npm-6.0.12-d467db27fd-b48b29940a.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-endpoint-npm-9.0.1-19bac4870b-4f700c6682.zip b/.yarn/cache/@octokit-endpoint-npm-9.0.1-19bac4870b-4f700c6682.zip new file mode 100644 index 000000000000..64b37433dab5 Binary files /dev/null and b/.yarn/cache/@octokit-endpoint-npm-9.0.1-19bac4870b-4f700c6682.zip differ diff --git a/.yarn/cache/@octokit-graphql-npm-4.8.0-83d118b4da-f68afe53f6.zip b/.yarn/cache/@octokit-graphql-npm-4.8.0-83d118b4da-f68afe53f6.zip deleted file mode 100644 index 1b16a6066424..000000000000 Binary files a/.yarn/cache/@octokit-graphql-npm-4.8.0-83d118b4da-f68afe53f6.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-graphql-npm-7.0.2-b5522f5b29-05a752c4c2.zip b/.yarn/cache/@octokit-graphql-npm-7.0.2-b5522f5b29-05a752c4c2.zip new file mode 100644 index 000000000000..6fa87513934c Binary files /dev/null and b/.yarn/cache/@octokit-graphql-npm-7.0.2-b5522f5b29-05a752c4c2.zip differ diff --git a/.yarn/cache/@octokit-openapi-types-npm-19.0.0-064193076f-9a8125ab4e.zip b/.yarn/cache/@octokit-openapi-types-npm-19.0.0-064193076f-9a8125ab4e.zip new file mode 100644 index 000000000000..073fa4cf8382 Binary files /dev/null and b/.yarn/cache/@octokit-openapi-types-npm-19.0.0-064193076f-9a8125ab4e.zip differ diff --git a/.yarn/cache/@octokit-plugin-paginate-rest-npm-1.1.2-b0b3e646dc-f04f5ca282.zip b/.yarn/cache/@octokit-plugin-paginate-rest-npm-1.1.2-b0b3e646dc-f04f5ca282.zip deleted file mode 100644 index 193f9933ebb7..000000000000 Binary files a/.yarn/cache/@octokit-plugin-paginate-rest-npm-1.1.2-b0b3e646dc-f04f5ca282.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-plugin-paginate-rest-npm-2.21.3-82d2ad1bba-acf31de2ba.zip b/.yarn/cache/@octokit-plugin-paginate-rest-npm-2.21.3-82d2ad1bba-acf31de2ba.zip deleted file mode 100644 index f30bb798115c..000000000000 Binary files a/.yarn/cache/@octokit-plugin-paginate-rest-npm-2.21.3-82d2ad1bba-acf31de2ba.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-plugin-paginate-rest-npm-9.0.0-fb07663301-4a8543f3e4.zip b/.yarn/cache/@octokit-plugin-paginate-rest-npm-9.0.0-fb07663301-4a8543f3e4.zip new file mode 100644 index 000000000000..6191045eda35 Binary files /dev/null and b/.yarn/cache/@octokit-plugin-paginate-rest-npm-9.0.0-fb07663301-4a8543f3e4.zip differ diff --git a/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-10.0.1-28cbf3f633-4873a76976.zip b/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-10.0.1-28cbf3f633-4873a76976.zip new file mode 100644 index 000000000000..3c962a90e4ac Binary files /dev/null and b/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-10.0.1-28cbf3f633-4873a76976.zip differ diff --git a/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-2.4.0-c786d75f5b-c7e89b6cdd.zip b/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-2.4.0-c786d75f5b-c7e89b6cdd.zip deleted file mode 100644 index 349f48dba773..000000000000 Binary files a/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-2.4.0-c786d75f5b-c7e89b6cdd.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-5.16.2-f54316c392-30fcc50c33.zip b/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-5.16.2-f54316c392-30fcc50c33.zip deleted file mode 100644 index 1cfa3e631a9d..000000000000 Binary files a/.yarn/cache/@octokit-plugin-rest-endpoint-methods-npm-5.16.2-f54316c392-30fcc50c33.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-request-error-npm-1.2.0-0ef613ae16-4a811114e0.zip b/.yarn/cache/@octokit-request-error-npm-1.2.0-0ef613ae16-4a811114e0.zip deleted file mode 100644 index 5f65c29a978f..000000000000 Binary files a/.yarn/cache/@octokit-request-error-npm-1.2.0-0ef613ae16-4a811114e0.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-request-error-npm-2.1.0-51ac624306-baec2b5700.zip b/.yarn/cache/@octokit-request-error-npm-2.1.0-51ac624306-baec2b5700.zip deleted file mode 100644 index fadd972f220c..000000000000 Binary files a/.yarn/cache/@octokit-request-error-npm-2.1.0-51ac624306-baec2b5700.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-request-error-npm-5.0.1-eda589102d-a681341e43.zip b/.yarn/cache/@octokit-request-error-npm-5.0.1-eda589102d-a681341e43.zip new file mode 100644 index 000000000000..ac2bc4ac4776 Binary files /dev/null and b/.yarn/cache/@octokit-request-error-npm-5.0.1-eda589102d-a681341e43.zip differ diff --git a/.yarn/cache/@octokit-request-npm-5.6.3-25a5f5382d-c0b4542eb4.zip b/.yarn/cache/@octokit-request-npm-5.6.3-25a5f5382d-c0b4542eb4.zip deleted file mode 100644 index 19a09612e9e5..000000000000 Binary files a/.yarn/cache/@octokit-request-npm-5.6.3-25a5f5382d-c0b4542eb4.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-request-npm-8.1.4-e871d5ebf1-6a88389b45.zip b/.yarn/cache/@octokit-request-npm-8.1.4-e871d5ebf1-6a88389b45.zip new file mode 100644 index 000000000000..eac8f8ecc525 Binary files /dev/null and b/.yarn/cache/@octokit-request-npm-8.1.4-e871d5ebf1-6a88389b45.zip differ diff --git a/.yarn/cache/@octokit-rest-npm-16.43.1-3451b48d94-52dba060a3.zip b/.yarn/cache/@octokit-rest-npm-16.43.1-3451b48d94-52dba060a3.zip deleted file mode 100644 index f0f98f511e92..000000000000 Binary files a/.yarn/cache/@octokit-rest-npm-16.43.1-3451b48d94-52dba060a3.zip and /dev/null differ diff --git a/.yarn/cache/@octokit-types-npm-12.0.0-b74b3121ec-ad55e13cbe.zip b/.yarn/cache/@octokit-types-npm-12.0.0-b74b3121ec-ad55e13cbe.zip new file mode 100644 index 000000000000..af3eb7cd27b2 Binary files /dev/null and b/.yarn/cache/@octokit-types-npm-12.0.0-b74b3121ec-ad55e13cbe.zip differ diff --git a/.yarn/cache/@octokit-types-npm-2.5.0-806e427b6c-2581698f3e.zip b/.yarn/cache/@octokit-types-npm-2.5.0-806e427b6c-2581698f3e.zip deleted file mode 100644 index 3651ee9202ea..000000000000 Binary files a/.yarn/cache/@octokit-types-npm-2.5.0-806e427b6c-2581698f3e.zip and /dev/null differ diff --git a/.yarn/cache/atob-lite-npm-2.0.0-62802899eb-336880fdca.zip b/.yarn/cache/atob-lite-npm-2.0.0-62802899eb-336880fdca.zip deleted file mode 100644 index 55d853f61567..000000000000 Binary files a/.yarn/cache/atob-lite-npm-2.0.0-62802899eb-336880fdca.zip and /dev/null differ diff --git a/.yarn/cache/btoa-lite-npm-1.0.0-e85ee9286e-c2d61993b8.zip b/.yarn/cache/btoa-lite-npm-1.0.0-e85ee9286e-c2d61993b8.zip deleted file mode 100644 index 7123f7df3ff6..000000000000 Binary files a/.yarn/cache/btoa-lite-npm-1.0.0-e85ee9286e-c2d61993b8.zip and /dev/null differ diff --git a/.yarn/cache/lodash.get-npm-4.4.2-7bda64ed87-e403047ddb.zip b/.yarn/cache/lodash.get-npm-4.4.2-7bda64ed87-e403047ddb.zip deleted file mode 100644 index 63cd7ccfc2f9..000000000000 Binary files a/.yarn/cache/lodash.get-npm-4.4.2-7bda64ed87-e403047ddb.zip and /dev/null differ diff --git a/.yarn/cache/lodash.set-npm-4.3.2-7586c942c2-a9122f49ee.zip b/.yarn/cache/lodash.set-npm-4.3.2-7586c942c2-a9122f49ee.zip deleted file mode 100644 index 4055fea4f259..000000000000 Binary files a/.yarn/cache/lodash.set-npm-4.3.2-7586c942c2-a9122f49ee.zip and /dev/null differ diff --git a/.yarn/cache/macos-release-npm-2.3.0-68f3012f58-3c3568b437.zip b/.yarn/cache/macos-release-npm-2.3.0-68f3012f58-3c3568b437.zip deleted file mode 100644 index 7dd03cceeaef..000000000000 Binary files a/.yarn/cache/macos-release-npm-2.3.0-68f3012f58-3c3568b437.zip and /dev/null differ diff --git a/.yarn/cache/octokit-pagination-methods-npm-1.1.0-ce2bd023d6-1fb85baa6b.zip b/.yarn/cache/octokit-pagination-methods-npm-1.1.0-ce2bd023d6-1fb85baa6b.zip deleted file mode 100644 index 73a2dd811881..000000000000 Binary files a/.yarn/cache/octokit-pagination-methods-npm-1.1.0-ce2bd023d6-1fb85baa6b.zip and /dev/null differ diff --git a/.yarn/cache/os-name-npm-3.1.0-b5e3fb36cd-91448fcb21.zip b/.yarn/cache/os-name-npm-3.1.0-b5e3fb36cd-91448fcb21.zip deleted file mode 100644 index ec8d1fdeb4d8..000000000000 Binary files a/.yarn/cache/os-name-npm-3.1.0-b5e3fb36cd-91448fcb21.zip and /dev/null differ diff --git a/.yarn/cache/undici-npm-5.26.3-bdeea4fdde-aaa9aadb71.zip b/.yarn/cache/undici-npm-5.26.3-bdeea4fdde-aaa9aadb71.zip new file mode 100644 index 000000000000..b6108c8e11f1 Binary files /dev/null and b/.yarn/cache/undici-npm-5.26.3-bdeea4fdde-aaa9aadb71.zip differ diff --git a/.yarn/cache/universal-user-agent-npm-4.0.0-9b1bcfcf6a-798e452472.zip b/.yarn/cache/universal-user-agent-npm-4.0.0-9b1bcfcf6a-798e452472.zip deleted file mode 100644 index 7f5fe3469484..000000000000 Binary files a/.yarn/cache/universal-user-agent-npm-4.0.0-9b1bcfcf6a-798e452472.zip and /dev/null differ diff --git a/.yarn/cache/windows-release-npm-3.2.0-bb84765c45-316efda17e.zip b/.yarn/cache/windows-release-npm-3.2.0-bb84765c45-316efda17e.zip deleted file mode 100644 index 3ff205bed629..000000000000 Binary files a/.yarn/cache/windows-release-npm-3.2.0-bb84765c45-316efda17e.zip and /dev/null differ diff --git a/actions/add-review-labels/package.json b/actions/add-review-labels/package.json index e1774c4a50a9..bc0dd220c606 100644 --- a/actions/add-review-labels/package.json +++ b/actions/add-review-labels/package.json @@ -19,6 +19,6 @@ ], "dependencies": { "@actions/core": "^1.2.3", - "@actions/github": "^2.1.1" + "@actions/github": "^6.0.0" } } diff --git a/actions/issues/package.json b/actions/issues/package.json index 26761b3f0453..98b79b583565 100644 --- a/actions/issues/package.json +++ b/actions/issues/package.json @@ -18,6 +18,6 @@ ], "dependencies": { "@actions/core": "^1.2.3", - "@actions/github": "^2.1.1" + "@actions/github": "^6.0.0" } } diff --git a/actions/release-notifications/package.json b/actions/release-notifications/package.json index 35792136918f..dbb56404fd8e 100644 --- a/actions/release-notifications/package.json +++ b/actions/release-notifications/package.json @@ -3,7 +3,7 @@ "private": true, "dependencies": { "@actions/core": "^1.10.0", - "@actions/github": "^5.1.1", + "@actions/github": "^6.0.0", "@octokit/auth-action": "^2.0.1", "@octokit/request": "^6.2.1" } diff --git a/e2e/components/CodeSnippet/CodeSnippet-test.avt.e2e.js b/e2e/components/CodeSnippet/CodeSnippet-test.avt.e2e.js index 53f6744607cb..e208e38fbf21 100644 --- a/e2e/components/CodeSnippet/CodeSnippet-test.avt.e2e.js +++ b/e2e/components/CodeSnippet/CodeSnippet-test.avt.e2e.js @@ -54,10 +54,7 @@ test.describe('CodeSnippet @avt', () => { await expect(page).toHaveNoACViolations('CodeSnippet inline focused'); }); - // Skipping due to a11y violation issue #14237 - test.skip('accessibility-checker CodeSnippet multiline @avt', async ({ - page, - }) => { + test('accessibility-checker CodeSnippet multiline @avt', async ({ page }) => { await visitStory(page, { component: 'CodeSnippet', id: 'components-codesnippet--multiline', diff --git a/e2e/components/ComposedModal/ComposedModal-test.avt.e2e.js b/e2e/components/ComposedModal/ComposedModal-test.avt.e2e.js index 9aa66164661a..2e05a9a68c81 100644 --- a/e2e/components/ComposedModal/ComposedModal-test.avt.e2e.js +++ b/e2e/components/ComposedModal/ComposedModal-test.avt.e2e.js @@ -33,6 +33,7 @@ test.describe('ComposedModal @avt', () => { await expect(page).toHaveNoACViolations('ComposedModal-full-width'); }); + // Skipping now due to AVT violation, possible false positive test.skip('@avt-advanced-states ComposedModal Passive Modal', async ({ page, }) => { diff --git a/e2e/components/FormLabel/FormLabel-test.avt.e2e.js b/e2e/components/FormLabel/FormLabel-test.avt.e2e.js new file mode 100644 index 000000000000..f13effecee00 --- /dev/null +++ b/e2e/components/FormLabel/FormLabel-test.avt.e2e.js @@ -0,0 +1,72 @@ +/** + * Copyright IBM Corp. 2016, 2023 + * + * 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 { visitStory } = require('../../test-utils/storybook'); + +test.describe('FormLabel @avt', () => { + test('@avt-default-state FormLabel', async ({ page }) => { + await visitStory(page, { + component: 'FormLabel', + id: 'components-formlabel--default', + globals: { + theme: 'white', + }, + }); + await expect(page).toHaveNoACViolations('FormLabel'); + }); + + test('@avt-advanced-states FormLabel with tooltip', async ({ page }) => { + await visitStory(page, { + component: 'FormLabel', + id: 'components-formlabel--with-tooltip', + globals: { + theme: 'white', + }, + }); + await expect(page).toHaveNoACViolations('FormLabel-with-tooltip'); + }); + + test('@avt-keyboard-nav FormLabel with tooltip', async ({ page }) => { + await visitStory(page, { + component: 'FormLabel', + id: 'components-formlabel--with-tooltip', + globals: { + theme: 'white', + }, + }); + + await expect(page.getByText('Form label with Tooltip')).toBeVisible(); + await page.keyboard.press('Tab'); + await expect( + page + .getByText( + 'This can be used to provide more information about a field.' + ) + .first() + ).toBeVisible(); + await page.keyboard.press('Tab'); + await page.keyboard.press('Enter'); + await expect( + page + .getByText( + 'This can be used to provide more information about a field.' + ) + .last() + ).toBeVisible(); + await page.keyboard.press('Escape'); + await expect( + page + .getByText( + 'This can be used to provide more information about a field.' + ) + .last() + ).not.toBeVisible(); + }); +}); diff --git a/e2e/components/FormLabel/FormLabel-test.e2e.js b/e2e/components/FormLabel/FormLabel-test.e2e.js index 7b53bc349e04..3063608fa485 100644 --- a/e2e/components/FormLabel/FormLabel-test.e2e.js +++ b/e2e/components/FormLabel/FormLabel-test.e2e.js @@ -7,9 +7,9 @@ 'use strict'; -const { expect, test } = require('@playwright/test'); +const { test } = require('@playwright/test'); const { themes } = require('../../test-utils/env'); -const { snapshotStory, visitStory } = require('../../test-utils/storybook'); +const { snapshotStory } = require('../../test-utils/storybook'); test.describe('FormLabel', () => { themes.forEach((theme) => { @@ -31,15 +31,4 @@ test.describe('FormLabel', () => { }); }); }); - - test('accessibility-checker @avt', async ({ page }) => { - await visitStory(page, { - component: 'FormLabel', - id: 'components-formlabel--default', - globals: { - theme: 'white', - }, - }); - await expect(page).toHaveNoACViolations('FormLabel'); - }); }); diff --git a/e2e/components/Tag/Tag-test.avt.e2e.js b/e2e/components/Tag/Tag-test.avt.e2e.js new file mode 100644 index 000000000000..fa340ae1dff3 --- /dev/null +++ b/e2e/components/Tag/Tag-test.avt.e2e.js @@ -0,0 +1,54 @@ +/** + * Copyright IBM Corp. 2016, 2023 + * + * 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'; + +import { expect, test } from '@playwright/test'; +import { visitStory } from '../../test-utils/storybook'; + +test.describe('Tag @avt', () => { + test('@avt-default-state Tag', async ({ page }) => { + await visitStory(page, { + component: 'Tag', + id: 'components-tag--default', + globals: { + theme: 'white', + }, + }); + await expect(page).toHaveNoACViolations('Tag'); + }); + + test('@avt-advanced-states Tag skeleton', async ({ page }) => { + await visitStory(page, { + component: 'Tag', + id: 'components-tag--skeleton', + globals: { + theme: 'white', + }, + }); + await expect(page).toHaveNoACViolations('Tag-skeleton'); + }); + + test('@avt-keyboard-nav Tag', async ({ page }) => { + await visitStory(page, { + component: 'Tag', + id: 'components-tag--playground', + globals: { + theme: 'white', + }, + args: { + filter: true, + }, + }); + + await expect(page.getByText('Tag content')).toBeVisible(); + await page.keyboard.press('Tab'); + await expect( + page.getByRole('button', { name: 'Clear filter' }) + ).toBeFocused(); + }); +}); diff --git a/e2e/components/Tag/Tag-test.e2e.js b/e2e/components/Tag/Tag-test.e2e.js index fe784b99d262..3a1b7861c4ef 100644 --- a/e2e/components/Tag/Tag-test.e2e.js +++ b/e2e/components/Tag/Tag-test.e2e.js @@ -7,9 +7,9 @@ 'use strict'; -const { expect, test } = require('@playwright/test'); -const { themes } = require('../../test-utils/env'); -const { snapshotStory, visitStory } = require('../../test-utils/storybook'); +import { test } from '@playwright/test'; +import { themes } from '../../test-utils/env'; +import { snapshotStory } from '../../test-utils/storybook'; test.describe('Tag', () => { themes.forEach((theme) => { @@ -23,15 +23,4 @@ test.describe('Tag', () => { }); }); }); - - test('accessibility-checker @avt', async ({ page }) => { - await visitStory(page, { - component: 'Tag', - id: 'components-tag--default', - globals: { - theme: 'white', - }, - }); - await expect(page).toHaveNoACViolations('Tag'); - }); }); diff --git a/e2e/components/TreeView/TreeView-test.avt.e2e.js b/e2e/components/TreeView/TreeView-test.avt.e2e.js index bebac61a8ea7..d468c727e059 100644 --- a/e2e/components/TreeView/TreeView-test.avt.e2e.js +++ b/e2e/components/TreeView/TreeView-test.avt.e2e.js @@ -11,7 +11,7 @@ const { expect, test } = require('@playwright/test'); const { visitStory } = require('../../test-utils/storybook'); test.describe('TreeView @avt', () => { - test.skip('accessibility-checker default', async ({ page }) => { + test('accessibility-checker default', async ({ page }) => { await visitStory(page, { component: 'TreeView', id: 'components-treeview--default', @@ -22,7 +22,7 @@ test.describe('TreeView @avt', () => { await expect(page).toHaveNoACViolations('components-treeview--default'); }); - test.skip('accessibility-checker with-icons', async ({ page }) => { + test('accessibility-checker with-icons', async ({ page }) => { await visitStory(page, { component: 'TreeView', id: 'components-treeview--with-icons', diff --git a/packages/icon-build-helpers/src/builders/react/components/Icon.js b/packages/icon-build-helpers/src/builders/react/components/Icon.js index 9f2e6320615c..87c020fe564a 100644 --- a/packages/icon-build-helpers/src/builders/react/components/Icon.js +++ b/packages/icon-build-helpers/src/builders/react/components/Icon.js @@ -9,7 +9,14 @@ import PropTypes from 'prop-types'; import React from 'react'; const Icon = React.forwardRef(function Icon( - { className, children, tabIndex, ...rest }, + { + className, + children, + tabIndex, + xmlns = 'http://www.w3.org/2000/svg', + preserveAspectRatio = 'xMidYMid meet', + ...rest + }, ref ) { const { tabindex, ...props } = getAttributes({ @@ -29,6 +36,14 @@ const Icon = React.forwardRef(function Icon( props.ref = ref; } + if (xmlns) { + props.xmlns = xmlns; + } + + if (preserveAspectRatio) { + props.preserveAspectRatio = preserveAspectRatio; + } + return React.createElement('svg', props, children); }); @@ -46,9 +61,5 @@ Icon.propTypes = { width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), xmlns: PropTypes.string, }; -Icon.defaultProps = { - xmlns: 'http://www.w3.org/2000/svg', - preserveAspectRatio: 'xMidYMid meet', -}; export default Icon; diff --git a/packages/icons-react/examples/storybook/.yarn/install-state.gz b/packages/icons-react/examples/storybook/.yarn/install-state.gz index 8c52687d2446..79659045d233 100644 Binary files a/packages/icons-react/examples/storybook/.yarn/install-state.gz and b/packages/icons-react/examples/storybook/.yarn/install-state.gz differ diff --git a/packages/icons-react/examples/storybook/yarn.lock b/packages/icons-react/examples/storybook/yarn.lock index 23410fd5e61c..620927fa9903 100644 --- a/packages/icons-react/examples/storybook/yarn.lock +++ b/packages/icons-react/examples/storybook/yarn.lock @@ -14,6 +14,16 @@ __metadata: languageName: node linkType: hard +"@babel/code-frame@npm:^7.22.13": + version: 7.22.13 + resolution: "@babel/code-frame@npm:7.22.13" + dependencies: + "@babel/highlight": ^7.22.13 + chalk: ^2.4.2 + checksum: 8/22e342c8077c8b77eeb11f554ecca2ba14153f707b85294fcf6070b6f6150aae88a7b7436dd88d8c9289970585f3fe5b9b941c5aa3aa26a6d5a8ef3f292da058 + languageName: node + linkType: hard + "@babel/core@npm:7.4.3": version: 7.4.3 resolution: "@babel/core@npm:7.4.3" @@ -58,6 +68,18 @@ __metadata: languageName: node linkType: hard +"@babel/generator@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/generator@npm:7.23.0" + dependencies: + "@babel/types": ^7.23.0 + "@jridgewell/gen-mapping": ^0.3.2 + "@jridgewell/trace-mapping": ^0.3.17 + jsesc: ^2.5.1 + checksum: 8/8efe24adad34300f1f8ea2add420b28171a646edc70f2a1b3e1683842f23b8b7ffa7e35ef0119294e1901f45bfea5b3dc70abe1f10a1917ccdfb41bed69be5f1 + languageName: node + linkType: hard + "@babel/generator@npm:^7.4.0, @babel/generator@npm:^7.4.4": version: 7.4.4 resolution: "@babel/generator@npm:7.4.4" @@ -138,6 +160,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-environment-visitor@npm:^7.22.20": + version: 7.22.20 + resolution: "@babel/helper-environment-visitor@npm:7.22.20" + checksum: 8/d80ee98ff66f41e233f36ca1921774c37e88a803b2f7dca3db7c057a5fea0473804db9fb6729e5dbfd07f4bed722d60f7852035c2c739382e84c335661590b69 + languageName: node + linkType: hard + "@babel/helper-explode-assignable-expression@npm:^7.1.0": version: 7.1.0 resolution: "@babel/helper-explode-assignable-expression@npm:7.1.0" @@ -159,6 +188,16 @@ __metadata: languageName: node linkType: hard +"@babel/helper-function-name@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/helper-function-name@npm:7.23.0" + dependencies: + "@babel/template": ^7.22.15 + "@babel/types": ^7.23.0 + checksum: 8/e44542257b2d4634a1f979244eb2a4ad8e6d75eb6761b4cfceb56b562f7db150d134bc538c8e6adca3783e3bc31be949071527aa8e3aab7867d1ad2d84a26e10 + languageName: node + linkType: hard + "@babel/helper-get-function-arity@npm:^7.0.0": version: 7.0.0 resolution: "@babel/helper-get-function-arity@npm:7.0.0" @@ -168,6 +207,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-hoist-variables@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-hoist-variables@npm:7.22.5" + dependencies: + "@babel/types": ^7.22.5 + checksum: 8/394ca191b4ac908a76e7c50ab52102669efe3a1c277033e49467913c7ed6f7c64d7eacbeabf3bed39ea1f41731e22993f763b1edce0f74ff8563fd1f380d92cc + languageName: node + linkType: hard + "@babel/helper-hoist-variables@npm:^7.4.4": version: 7.4.4 resolution: "@babel/helper-hoist-variables@npm:7.4.4" @@ -269,6 +317,15 @@ __metadata: languageName: node linkType: hard +"@babel/helper-split-export-declaration@npm:^7.22.6": + version: 7.22.6 + resolution: "@babel/helper-split-export-declaration@npm:7.22.6" + dependencies: + "@babel/types": ^7.22.5 + checksum: 8/e141cace583b19d9195f9c2b8e17a3ae913b7ee9b8120246d0f9ca349ca6f03cb2c001fd5ec57488c544347c0bb584afec66c936511e447fd20a360e591ac921 + languageName: node + linkType: hard + "@babel/helper-split-export-declaration@npm:^7.4.0, @babel/helper-split-export-declaration@npm:^7.4.4": version: 7.4.4 resolution: "@babel/helper-split-export-declaration@npm:7.4.4" @@ -278,6 +335,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-string-parser@npm:^7.22.5": + version: 7.22.5 + resolution: "@babel/helper-string-parser@npm:7.22.5" + checksum: 8/836851ca5ec813077bbb303acc992d75a360267aa3b5de7134d220411c852a6f17de7c0d0b8c8dcc0f567f67874c00f4528672b2a4f1bc978a3ada64c8c78467 + languageName: node + linkType: hard + "@babel/helper-validator-identifier@npm:^7.12.11": version: 7.12.11 resolution: "@babel/helper-validator-identifier@npm:7.12.11" @@ -285,6 +349,13 @@ __metadata: languageName: node linkType: hard +"@babel/helper-validator-identifier@npm:^7.22.20": + version: 7.22.20 + resolution: "@babel/helper-validator-identifier@npm:7.22.20" + checksum: 8/136412784d9428266bcdd4d91c32bcf9ff0e8d25534a9d94b044f77fe76bc50f941a90319b05aafd1ec04f7d127cd57a179a3716009ff7f3412ef835ada95bdc + languageName: node + linkType: hard + "@babel/helper-wrap-function@npm:^7.1.0": version: 7.2.0 resolution: "@babel/helper-wrap-function@npm:7.2.0" @@ -319,6 +390,26 @@ __metadata: languageName: node linkType: hard +"@babel/highlight@npm:^7.22.13": + version: 7.22.20 + resolution: "@babel/highlight@npm:7.22.20" + dependencies: + "@babel/helper-validator-identifier": ^7.22.20 + chalk: ^2.4.2 + js-tokens: ^4.0.0 + checksum: 8/84bd034dca309a5e680083cd827a766780ca63cef37308404f17653d32366ea76262bd2364b2d38776232f2d01b649f26721417d507e8b4b6da3e4e739f6d134 + languageName: node + linkType: hard + +"@babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/parser@npm:7.23.0" + bin: + parser: ./bin/babel-parser.js + checksum: 8/453fdf8b9e2c2b7d7b02139e0ce003d1af21947bbc03eb350fb248ee335c9b85e4ab41697ddbdd97079698de825a265e45a0846bb2ed47a2c7c1df833f42a354 + languageName: node + linkType: hard + "@babel/parser@npm:^7.4.3, @babel/parser@npm:^7.4.4, @babel/parser@npm:^7.4.5": version: 7.4.5 resolution: "@babel/parser@npm:7.4.5" @@ -1237,20 +1328,32 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.1.0, @babel/traverse@npm:^7.4.3, @babel/traverse@npm:^7.4.4, @babel/traverse@npm:^7.4.5": - version: 7.4.5 - resolution: "@babel/traverse@npm:7.4.5" +"@babel/template@npm:^7.22.15": + version: 7.22.15 + resolution: "@babel/template@npm:7.22.15" dependencies: - "@babel/code-frame": ^7.0.0 - "@babel/generator": ^7.4.4 - "@babel/helper-function-name": ^7.1.0 - "@babel/helper-split-export-declaration": ^7.4.4 - "@babel/parser": ^7.4.5 - "@babel/types": ^7.4.4 + "@babel/code-frame": ^7.22.13 + "@babel/parser": ^7.22.15 + "@babel/types": ^7.22.15 + checksum: 8/1f3e7dcd6c44f5904c184b3f7fe280394b191f2fed819919ffa1e529c259d5b197da8981b6ca491c235aee8dbad4a50b7e31304aa531271cb823a4a24a0dd8fd + languageName: node + linkType: hard + +"@babel/traverse@npm:^7.1.0, @babel/traverse@npm:^7.4.3, @babel/traverse@npm:^7.4.4, @babel/traverse@npm:^7.4.5": + version: 7.23.2 + resolution: "@babel/traverse@npm:7.23.2" + dependencies: + "@babel/code-frame": ^7.22.13 + "@babel/generator": ^7.23.0 + "@babel/helper-environment-visitor": ^7.22.20 + "@babel/helper-function-name": ^7.23.0 + "@babel/helper-hoist-variables": ^7.22.5 + "@babel/helper-split-export-declaration": ^7.22.6 + "@babel/parser": ^7.23.0 + "@babel/types": ^7.23.0 debug: ^4.1.0 globals: ^11.1.0 - lodash: ^4.17.11 - checksum: f059fc1e6602b62156a7e5a7ab6f2478aa9a0bdca75203222c6dfad567bbeafffa95108d9974fe7f0a976f303f3c2c0fc7050c9ca1739ca54a34056f57816600 + checksum: 8/26a1eea0dde41ab99dde8b9773a013a0dc50324e5110a049f5d634e721ff08afffd54940b3974a20308d7952085ac769689369e9127dea655f868c0f6e1ab35d languageName: node linkType: hard @@ -1265,6 +1368,17 @@ __metadata: languageName: node linkType: hard +"@babel/types@npm:^7.22.15, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/types@npm:7.23.0" + dependencies: + "@babel/helper-string-parser": ^7.22.5 + "@babel/helper-validator-identifier": ^7.22.20 + to-fast-properties: ^2.0.0 + checksum: 8/215fe04bd7feef79eeb4d33374b39909ce9cad1611c4135a4f7fdf41fe3280594105af6d7094354751514625ea92d0875aba355f53e86a92600f290e77b0e604 + languageName: node + linkType: hard + "@babel/types@npm:^7.8.3": version: 7.13.14 resolution: "@babel/types@npm:7.13.14" @@ -1413,6 +1527,48 @@ __metadata: languageName: node linkType: hard +"@jridgewell/gen-mapping@npm:^0.3.2": + version: 0.3.3 + resolution: "@jridgewell/gen-mapping@npm:0.3.3" + dependencies: + "@jridgewell/set-array": ^1.0.1 + "@jridgewell/sourcemap-codec": ^1.4.10 + "@jridgewell/trace-mapping": ^0.3.9 + checksum: 8/4a74944bd31f22354fc01c3da32e83c19e519e3bbadafa114f6da4522ea77dd0c2842607e923a591d60a76699d819a2fbb6f3552e277efdb9b58b081390b60ab + languageName: node + linkType: hard + +"@jridgewell/resolve-uri@npm:^3.1.0": + version: 3.1.1 + resolution: "@jridgewell/resolve-uri@npm:3.1.1" + checksum: 8/f5b441fe7900eab4f9155b3b93f9800a916257f4e8563afbcd3b5a5337b55e52bd8ae6735453b1b745457d9f6cdb16d74cd6220bbdd98cf153239e13f6cbb653 + languageName: node + linkType: hard + +"@jridgewell/set-array@npm:^1.0.1": + version: 1.1.2 + resolution: "@jridgewell/set-array@npm:1.1.2" + checksum: 8/69a84d5980385f396ff60a175f7177af0b8da4ddb81824cb7016a9ef914eee9806c72b6b65942003c63f7983d4f39a5c6c27185bbca88eb4690b62075602e28e + languageName: node + linkType: hard + +"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14": + version: 1.4.15 + resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" + checksum: 8/b881c7e503db3fc7f3c1f35a1dd2655a188cc51a3612d76efc8a6eb74728bef5606e6758ee77423e564092b4a518aba569bbb21c9bac5ab7a35b0c6ae7e344c8 + languageName: node + linkType: hard + +"@jridgewell/trace-mapping@npm:^0.3.17, @jridgewell/trace-mapping@npm:^0.3.9": + version: 0.3.20 + resolution: "@jridgewell/trace-mapping@npm:0.3.20" + dependencies: + "@jridgewell/resolve-uri": ^3.1.0 + "@jridgewell/sourcemap-codec": ^1.4.14 + checksum: 8/cd1a7353135f385909468ff0cf20bdd37e59f2ee49a13a966dedf921943e222082c583ade2b579ff6cd0d8faafcb5461f253e1bf2a9f48fec439211fdbe788f5 + languageName: node + linkType: hard + "@mrmlnc/readdir-enhanced@npm:^2.2.1": version: 2.2.1 resolution: "@mrmlnc/readdir-enhanced@npm:2.2.1" diff --git a/packages/icons-vue/examples/vue-cli/yarn.lock b/packages/icons-vue/examples/vue-cli/yarn.lock index 468dabf99a39..51dccc94f0a7 100644 --- a/packages/icons-vue/examples/vue-cli/yarn.lock +++ b/packages/icons-vue/examples/vue-cli/yarn.lock @@ -9,6 +9,14 @@ dependencies: "@babel/highlight" "^7.0.0" +"@babel/code-frame@^7.22.13": + version "7.22.13" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.22.13.tgz#e3c1c099402598483b7a8c46a721d1038803755e" + integrity sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w== + dependencies: + "@babel/highlight" "^7.22.13" + chalk "^2.4.2" + "@babel/core@^7.0.0": version "7.1.6" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.1.6.tgz#3733cbee4317429bc87c62b29cf8587dba7baeb3" @@ -40,6 +48,16 @@ source-map "^0.5.0" trim-right "^1.0.1" +"@babel/generator@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.0.tgz#df5c386e2218be505b34837acbcb874d7a983420" + integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g== + dependencies: + "@babel/types" "^7.23.0" + "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" + jsesc "^2.5.1" + "@babel/helper-annotate-as-pure@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz#323d39dd0b50e10c7c06ca7d7638e6864d8c5c32" @@ -73,6 +91,11 @@ "@babel/types" "^7.0.0" lodash "^4.17.10" +"@babel/helper-environment-visitor@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== + "@babel/helper-explode-assignable-expression@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz#537fa13f6f1674df745b0c00ec8fe4e99681c8f6" @@ -90,6 +113,14 @@ "@babel/template" "^7.1.0" "@babel/types" "^7.0.0" +"@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== + dependencies: + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" + "@babel/helper-get-function-arity@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" @@ -104,6 +135,13 @@ dependencies: "@babel/types" "^7.0.0" +"@babel/helper-hoist-variables@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" + integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== + dependencies: + "@babel/types" "^7.22.5" + "@babel/helper-member-expression-to-functions@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz#8cd14b0a0df7ff00f009e7d7a436945f47c7a16f" @@ -185,6 +223,23 @@ dependencies: "@babel/types" "^7.0.0" +"@babel/helper-split-export-declaration@^7.22.6": + version "7.22.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" + integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== + dependencies: + "@babel/types" "^7.22.5" + +"@babel/helper-string-parser@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz#533f36457a25814cf1df6488523ad547d784a99f" + integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== + +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + "@babel/helper-wrap-function@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.1.0.tgz#8cf54e9190706067f016af8f75cb3df829cc8c66" @@ -213,11 +268,25 @@ esutils "^2.0.2" js-tokens "^4.0.0" +"@babel/highlight@^7.22.13": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.22.20.tgz#4ca92b71d80554b01427815e06f2df965b9c1f54" + integrity sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + "@babel/parser@^7.0.0", "@babel/parser@^7.1.2", "@babel/parser@^7.1.6": version "7.1.6" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.6.tgz#16e97aca1ec1062324a01c5a6a7d0df8dd189854" integrity sha512-dWP6LJm9nKT6ALaa+bnL247GHHMWir3vSlZ2+IHgHgktZQx0L3Uvq2uAWcuzIe+fujRsYWBW2q622C5UvGK9iQ== +"@babel/parser@^7.22.15", "@babel/parser@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.0.tgz#da950e622420bf96ca0d0f2909cdddac3acd8719" + integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== + "@babel/plugin-proposal-async-generator-functions@^7.1.0": version "7.1.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.1.0.tgz#41c1a702e10081456e23a7b74d891922dd1bb6ce" @@ -626,20 +695,30 @@ "@babel/parser" "^7.1.2" "@babel/types" "^7.1.2" -"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.1.5", "@babel/traverse@^7.1.6": - version "7.1.6" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.1.6.tgz#c8db9963ab4ce5b894222435482bd8ea854b7b5c" - integrity sha512-CXedit6GpISz3sC2k2FsGCUpOhUqKdyL0lqNrImQojagnUMXf8hex4AxYFRuMkNGcvJX5QAFGzB5WJQmSv8SiQ== +"@babel/template@^7.22.15": + version "7.22.15" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" + integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== dependencies: - "@babel/code-frame" "^7.0.0" - "@babel/generator" "^7.1.6" - "@babel/helper-function-name" "^7.1.0" - "@babel/helper-split-export-declaration" "^7.0.0" - "@babel/parser" "^7.1.6" - "@babel/types" "^7.1.6" + "@babel/code-frame" "^7.22.13" + "@babel/parser" "^7.22.15" + "@babel/types" "^7.22.15" + +"@babel/traverse@^7.0.0", "@babel/traverse@^7.1.0", "@babel/traverse@^7.1.5", "@babel/traverse@^7.1.6": + version "7.23.2" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.2.tgz#329c7a06735e144a506bdb2cad0268b7f46f4ad8" + integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw== + dependencies: + "@babel/code-frame" "^7.22.13" + "@babel/generator" "^7.23.0" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.23.0" + "@babel/types" "^7.23.0" debug "^4.1.0" globals "^11.1.0" - lodash "^4.17.10" "@babel/types@^7.0.0", "@babel/types@^7.1.2", "@babel/types@^7.1.5", "@babel/types@^7.1.6": version "7.1.6" @@ -650,6 +729,15 @@ lodash "^4.17.10" to-fast-properties "^2.0.0" +"@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0": + version "7.23.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.0.tgz#8c1f020c9df0e737e4e247c0619f58c68458aaeb" + integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== + dependencies: + "@babel/helper-string-parser" "^7.22.5" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + "@intervolga/optimize-cssnano-plugin@^1.0.5": version "1.0.6" resolved "https://registry.yarnpkg.com/@intervolga/optimize-cssnano-plugin/-/optimize-cssnano-plugin-1.0.6.tgz#be7c7846128b88f6a9b1d1261a0ad06eb5c0fdf8" @@ -659,6 +747,38 @@ cssnano-preset-default "^4.0.0" postcss "^7.0.0" +"@jridgewell/gen-mapping@^0.3.2": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" + integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.20" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" + integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@mrmlnc/readdir-enhanced@^2.2.1": version "2.2.1" resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" @@ -1747,6 +1867,15 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.4 escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index b6f8fd33a77b..1b2a21b0d253 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -67,11 +67,6 @@ Map { }, }, "AccordionSkeleton" => Object { - "defaultProps": Object { - "align": "end", - "count": 4, - "open": true, - }, "propTypes": Object { "align": Object { "args": Array [ @@ -97,15 +92,6 @@ Map { }, }, "ActionableNotification" => Object { - "defaultProps": Object { - "closeOnEscape": true, - "hasFocus": true, - "hideCloseButton": false, - "inline": false, - "kind": "error", - "onCloseButtonClick": [Function], - "role": "alertdialog", - }, "propTypes": Object { "actionButtonLabel": Object { "type": "string", @@ -143,7 +129,6 @@ Map { "warning-alt", ], ], - "isRequired": true, "type": "oneOf", }, "lowContrast": Object { @@ -466,10 +451,6 @@ Map { }, "Checkbox" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "indeterminate": false, - "onChange": [Function], - }, "propTypes": Object { "checked": Object { "type": "bool", @@ -622,13 +603,6 @@ Map { "render": [Function], }, "CodeSnippet" => Object { - "defaultProps": Object { - "aria-label": "Copy to clipboard", - "showLessText": "Show less", - "showMoreText": "Show more", - "type": "single", - "wrapText": false, - }, "propTypes": Object { "align": Object { "args": Array [ @@ -1079,15 +1053,6 @@ Map { }, "ComboBox" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "aria-label": "Choose an item", - "direction": "bottom", - "disabled": false, - "itemToElement": null, - "itemToString": [Function], - "shouldFilterItem": [Function], - "type": "default", - }, "propTypes": Object { "aria-label": Object { "type": "string", @@ -1336,15 +1301,6 @@ Map { "translateWithId": Object { "type": "func", }, - "type": Object { - "args": Array [ - Array [ - "default", - "inline", - ], - ], - "type": "oneOf", - }, "warn": Object { "type": "bool", }, @@ -1407,9 +1363,6 @@ Map { }, "ComposedModal" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "selectorPrimaryFocus": "[data-modal-primary-focus]", - }, "propTypes": Object { "aria-label": Object { "type": "string", @@ -1604,9 +1557,6 @@ Map { }, }, "Content" => Object { - "defaultProps": Object { - "tagName": "main", - }, "propTypes": Object { "children": Object { "type": "node", @@ -1624,15 +1574,6 @@ Map { }, "ControlledPasswordInput" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "disabled": false, - "helperText": "", - "invalid": false, - "invalidText": "", - "onChange": [Function], - "onClick": [Function], - "size": undefined, - }, "propTypes": Object { "className": Object { "type": "string", @@ -1737,11 +1678,6 @@ Map { "render": [Function], }, "Copy" => Object { - "defaultProps": Object { - "feedback": "Copied!", - "feedbackTimeout": 2000, - "onClick": [Function], - }, "propTypes": Object { "align": Object { "args": Array [ @@ -1779,12 +1715,6 @@ Map { }, }, "CopyButton" => Object { - "defaultProps": Object { - "feedback": "Copied!", - "feedbackTimeout": 2000, - "iconDescription": "Copy to clipboard", - "onClick": [Function], - }, "propTypes": Object { "align": Object { "args": Array [ @@ -1821,10 +1751,6 @@ Map { "DangerButton" => Object {}, "DataTable" => Object { "Table": Object { - "defaultProps": Object { - "isSortable": false, - "overflowMenuOnHover": true, - }, "propTypes": Object { "children": Object { "type": "node", @@ -1873,28 +1799,6 @@ Map { }, }, "TableBatchAction": Object { - "defaultProps": Object { - "iconDescription": "Add", - "renderIcon": Object { - "$$typeof": Symbol(react.forward_ref), - "propTypes": Object { - "size": Object { - "args": Array [ - Array [ - Object { - "type": "number", - }, - Object { - "type": "string", - }, - ], - ], - "type": "oneOfType", - }, - }, - "render": [Function], - }, - }, "propTypes": Object { "hasIconOnly": Object { "type": "bool", @@ -1916,9 +1820,6 @@ Map { }, }, "TableBatchActions": Object { - "defaultProps": Object { - "translateWithId": [Function], - }, "propTypes": Object { "children": Object { "type": "node", @@ -1955,9 +1856,6 @@ Map { ], }, "TableBody": Object { - "defaultProps": Object { - "aria-live": "polite", - }, "propTypes": Object { "aria-live": Object { "args": Array [ @@ -2106,11 +2004,6 @@ Map { }, "TableHeader": Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "isSortable": false, - "scope": "col", - "translateWithId": [Function], - }, "propTypes": Object { "children": Object { "type": "node", @@ -2134,7 +2027,6 @@ Map { "type": "func", }, "scope": Object { - "isRequired": true, "type": "string", }, "sortDirection": Object { @@ -2167,9 +2059,6 @@ Map { }, }, "TableSelectAll": Object { - "defaultProps": Object { - "ariaLabel": "Select all rows in the table", - }, "propTypes": Object { "ariaLabel": Object { "isRequired": true, @@ -2239,12 +2128,11 @@ Map { }, }, "TableToolbar": Object { - "defaultProps": Object { - "aria-label": "data table toolbar", - }, "propTypes": Object { - "aria-label": [Function], - "aria-labelledby": [Function], + "aria-label": Object { + "type": "string", + }, + "ariaLabel": [Function], "children": Object { "type": "node", }, @@ -2284,28 +2172,6 @@ Map { }, }, "TableToolbarMenu": Object { - "defaultProps": Object { - "iconDescription": "Settings", - "renderIcon": Object { - "$$typeof": Symbol(react.forward_ref), - "propTypes": Object { - "size": Object { - "args": Array [ - Array [ - Object { - "type": "number", - }, - Object { - "type": "string", - }, - ], - ], - "type": "oneOfType", - }, - }, - "render": [Function], - }, - }, "propTypes": Object { "children": Object { "isRequired": true, @@ -2315,7 +2181,6 @@ Map { "type": "string", }, "iconDescription": Object { - "isRequired": true, "type": "string", }, "renderIcon": Object { @@ -2334,12 +2199,6 @@ Map { }, }, "TableToolbarSearch": Object { - "defaultProps": Object { - "onClear": [Function], - "persistent": false, - "tabIndex": "0", - "translateWithId": [Function], - }, "propTypes": Object { "children": Object { "type": "node", @@ -2413,19 +2272,10 @@ Map { "type": "oneOfType", }, "translateWithId": Object { - "isRequired": true, "type": "func", }, }, }, - "defaultProps": Object { - "filterRows": [Function], - "locale": "en", - "overflowMenuOnHover": true, - "size": "lg", - "sortRow": [Function], - "translateWithId": [Function], - }, "propTypes": Object { "experimentalAutoAlign": Object { "type": "bool", @@ -2699,10 +2549,30 @@ Map { "type": "oneOfType", }, "maxDate": Object { - "type": "string", + "args": Array [ + Array [ + Object { + "type": "string", + }, + Object { + "type": "number", + }, + ], + ], + "type": "oneOfType", }, "minDate": Object { - "type": "string", + "args": Array [ + Array [ + Object { + "type": "string", + }, + Object { + "type": "number", + }, + ], + ], + "type": "oneOfType", }, "onChange": Object { "type": "func", @@ -2911,15 +2781,6 @@ Map { }, "Dropdown" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "direction": "bottom", - "disabled": false, - "helperText": "", - "itemToElement": null, - "itemToString": [Function], - "titleText": "", - "type": "default", - }, "propTypes": Object { "aria-label": Object { "type": "string", @@ -3227,15 +3088,6 @@ Map { "contextType": Object { "$$typeof": Symbol(react.context), }, - "defaultProps": Object { - "accept": Array [], - "buttonKind": "primary", - "buttonLabel": "", - "disabled": false, - "filenameStatus": "uploading", - "multiple": false, - "onClick": [Function], - }, "propTypes": Object { "accept": Object { "args": Array [ @@ -3281,7 +3133,6 @@ Map { "type": "oneOf", }, "iconDescription": Object { - "isRequired": true, "type": "string", }, "labelDescription": Object { @@ -3386,13 +3237,6 @@ Map { }, }, "FileUploaderDropContainer" => Object { - "defaultProps": Object { - "accept": Array [], - "labelText": "Add file", - "multiple": false, - "onAddFiles": [Function], - "pattern": ".[0-9a-z]+$", - }, "propTypes": Object { "accept": Object { "args": Array [ @@ -3435,10 +3279,6 @@ Map { }, }, "FileUploaderItem" => Object { - "defaultProps": Object { - "onDelete": [Function], - "status": "uploading", - }, "propTypes": Object { "errorBody": Object { "type": "string", @@ -3491,11 +3331,6 @@ Map { }, }, "Filename" => Object { - "defaultProps": Object { - "iconDescription": "Uploading file", - "status": "uploading", - "tabIndex": "0", - }, "propTypes": Object { "aria-describedby": Object { "type": "string", @@ -3520,36 +3355,12 @@ Map { "type": "oneOf", }, "tabIndex": Object { - "args": Array [ - Array [ - Object { - "type": "number", - }, - Object { - "type": "string", - }, - ], - ], - "type": "oneOfType", + "type": "number", }, }, }, "FilterableMultiSelect" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "clearSelectionDescription": "Total items selected: ", - "clearSelectionText": "To clear selection, press Delete or Backspace,", - "compareItems": [Function], - "direction": "bottom", - "disabled": false, - "filterItems": [Function], - "initialSelectedItems": Array [], - "itemToString": [Function], - "locale": "en", - "open": false, - "selectionFeedback": "top-after-reopen", - "sortItems": [Function], - }, "propTypes": Object { "aria-label": [Function], "ariaLabel": [Function], @@ -3560,7 +3371,6 @@ Map { "type": "string", }, "compareItems": Object { - "isRequired": true, "type": "func", }, "direction": Object { @@ -3778,7 +3588,6 @@ Map { "type": "oneOf", }, "sortItems": Object { - "isRequired": true, "type": "func", }, "translateWithId": Object { @@ -3854,11 +3663,6 @@ Map { "Provider": "React.Provider", }, "FormGroup" => Object { - "defaultProps": Object { - "invalid": false, - "message": false, - "messageText": "", - }, "propTypes": Object { "children": Object { "type": "node", @@ -4399,12 +4203,6 @@ Map { }, }, "InlineNotification" => Object { - "defaultProps": Object { - "hideCloseButton": false, - "kind": "error", - "onCloseButtonClick": [Function], - "role": "status", - }, "propTypes": Object { "aria-label": Object { "type": "string", @@ -4814,18 +4612,6 @@ Map { }, "Modal" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "hasScrollingContent": false, - "modalHeading": "", - "modalLabel": "", - "onKeyDown": [Function], - "onRequestClose": [Function], - "onRequestSubmit": [Function], - "passiveModal": false, - "preventCloseOnClickOutside": false, - "primaryButtonDisabled": false, - "selectorPrimaryFocus": "[data-modal-primary-focus]", - }, "propTypes": Object { "alert": Object { "type": "bool", @@ -4961,11 +4747,6 @@ Map { }, "ModalFooter" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "closeModal": [Function], - "onRequestClose": [Function], - "onRequestSubmit": [Function], - }, "propTypes": Object { "children": Object { "type": "node", @@ -5026,9 +4807,6 @@ Map { }, "ModalHeader" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "iconDescription": "Close", - }, "propTypes": Object { "buttonOnClick": Object { "type": "func", @@ -5067,17 +4845,6 @@ Map { "render": [Function], }, "ModalWrapper" => Object { - "defaultProps": Object { - "disabled": false, - "onKeyDown": [Function], - "preventCloseOnClickOutside": false, - "primaryButtonText": "Save", - "secondaryButtonText": "Cancel", - "selectorPrimaryFocus": "[data-modal-primary-focus]", - "shouldCloseAfterSubmit": true, - "triggerButtonIconDescription": "Provide icon description if icon is used", - "triggerButtonKind": "primary", - }, "propTypes": Object { "buttonTriggerClassName": Object { "type": "string", @@ -5176,20 +4943,6 @@ Map { "$$typeof": Symbol(react.forward_ref), "Filterable": Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "clearSelectionDescription": "Total items selected: ", - "clearSelectionText": "To clear selection, press Delete or Backspace,", - "compareItems": [Function], - "direction": "bottom", - "disabled": false, - "filterItems": [Function], - "initialSelectedItems": Array [], - "itemToString": [Function], - "locale": "en", - "open": false, - "selectionFeedback": "top-after-reopen", - "sortItems": [Function], - }, "propTypes": Object { "aria-label": [Function], "ariaLabel": [Function], @@ -5200,7 +4953,6 @@ Map { "type": "string", }, "compareItems": Object { - "isRequired": true, "type": "func", }, "direction": Object { @@ -5418,7 +5170,6 @@ Map { "type": "oneOf", }, "sortItems": Object { - "isRequired": true, "type": "func", }, "translateWithId": Object { @@ -5436,22 +5187,6 @@ Map { }, "render": [Function], }, - "defaultProps": Object { - "clearSelectionDescription": "Total items selected: ", - "clearSelectionText": "To clear selection, press Delete or Backspace,", - "compareItems": [Function], - "direction": "bottom", - "disabled": false, - "initialSelectedItems": Array [], - "itemToString": [Function], - "locale": "en", - "open": false, - "selectedItems": undefined, - "selectionFeedback": "top-after-reopen", - "sortItems": [Function], - "titleText": false, - "type": "default", - }, "propTypes": Object { "className": Object { "type": "string", @@ -5463,7 +5198,6 @@ Map { "type": "string", }, "compareItems": Object { - "isRequired": true, "type": "func", }, "direction": Object { @@ -5554,7 +5288,6 @@ Map { "type": "oneOf", }, "sortItems": Object { - "isRequired": true, "type": "func", }, "titleText": Object { @@ -5601,30 +5334,6 @@ Map { }, }, "NotificationButton" => Object { - "defaultProps": Object { - "aria-label": "close notification", - "notificationType": "toast", - "renderIcon": Object { - "$$typeof": Symbol(react.forward_ref), - "propTypes": Object { - "size": Object { - "args": Array [ - Array [ - Object { - "type": "number", - }, - Object { - "type": "string", - }, - ], - ], - "type": "oneOfType", - }, - }, - "render": [Function], - }, - "type": "button", - }, "propTypes": Object { "aria-label": Object { "type": "string", @@ -6320,9 +6029,6 @@ Map { }, }, "ProgressStep" => Object { - "defaultProps": Object { - "translateWithId": [Function], - }, "propTypes": Object { "className": Object { "type": "string", @@ -6521,10 +6227,6 @@ Map { }, "RadioTile" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "onChange": [Function], - "tabIndex": 0, - }, "propTypes": Object { "checked": Object { "type": "bool", @@ -6697,9 +6399,6 @@ Map { "render": [Function], }, "SearchSkeleton" => Object { - "defaultProps": Object { - "small": false, - }, "propTypes": Object { "className": Object { "type": "string", @@ -6730,14 +6429,6 @@ Map { }, "Select" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "disabled": false, - "helperText": "", - "inline": false, - "invalid": false, - "invalidText": "", - "labelText": "Select", - }, "propTypes": Object { "children": Object { "type": "node", @@ -6803,12 +6494,6 @@ Map { "render": [Function], }, "SelectItem" => Object { - "defaultProps": Object { - "disabled": false, - "hidden": false, - "text": "", - "value": "", - }, "propTypes": Object { "className": Object { "type": "string", @@ -6830,9 +6515,6 @@ Map { }, }, "SelectItemGroup" => Object { - "defaultProps": Object { - "disabled": false, - }, "propTypes": Object { "children": Object { "type": "node", @@ -6985,13 +6667,9 @@ Map { }, }, "SideNavFooter" => Object { - "defaultProps": Object { - "assistiveText": "Toggle opening or closing the side navigation", - }, "displayName": "SideNavFooter", "propTypes": Object { "assistiveText": Object { - "isRequired": true, "type": "string", }, "className": Object { @@ -7036,9 +6714,6 @@ Map { }, }, "SideNavIcon" => Object { - "defaultProps": Object { - "small": false, - }, "propTypes": Object { "children": Object { "isRequired": true, @@ -7048,7 +6723,6 @@ Map { "type": "string", }, "small": Object { - "isRequired": true, "type": "bool", }, }, @@ -7237,12 +6911,6 @@ Map { }, }, "SkeletonText" => Object { - "defaultProps": Object { - "heading": false, - "lineCount": 3, - "paragraph": false, - "width": "100%", - }, "propTypes": Object { "className": Object { "type": "string", @@ -7464,11 +7132,6 @@ Map { }, "Switch" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "onClick": [Function], - "onKeyDown": [Function], - "selected": false, - }, "propTypes": Object { "children": Object { "type": "node", @@ -7699,10 +7362,6 @@ Map { }, }, "Table" => Object { - "defaultProps": Object { - "isSortable": false, - "overflowMenuOnHover": true, - }, "propTypes": Object { "children": Object { "type": "node", @@ -7751,28 +7410,6 @@ Map { }, }, "TableBatchAction" => Object { - "defaultProps": Object { - "iconDescription": "Add", - "renderIcon": Object { - "$$typeof": Symbol(react.forward_ref), - "propTypes": Object { - "size": Object { - "args": Array [ - Array [ - Object { - "type": "number", - }, - Object { - "type": "string", - }, - ], - ], - "type": "oneOfType", - }, - }, - "render": [Function], - }, - }, "propTypes": Object { "hasIconOnly": Object { "type": "bool", @@ -7794,9 +7431,6 @@ Map { }, }, "TableBatchActions" => Object { - "defaultProps": Object { - "translateWithId": [Function], - }, "propTypes": Object { "children": Object { "type": "node", @@ -7833,9 +7467,6 @@ Map { ], }, "TableBody" => Object { - "defaultProps": Object { - "aria-live": "polite", - }, "propTypes": Object { "aria-live": Object { "args": Array [ @@ -7984,11 +7615,6 @@ Map { }, "TableHeader" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "isSortable": false, - "scope": "col", - "translateWithId": [Function], - }, "propTypes": Object { "children": Object { "type": "node", @@ -8012,7 +7638,6 @@ Map { "type": "func", }, "scope": Object { - "isRequired": true, "type": "string", }, "sortDirection": Object { @@ -8045,9 +7670,6 @@ Map { }, }, "TableSelectAll" => Object { - "defaultProps": Object { - "ariaLabel": "Select all rows in the table", - }, "propTypes": Object { "ariaLabel": Object { "isRequired": true, @@ -8117,12 +7739,11 @@ Map { }, }, "TableToolbar" => Object { - "defaultProps": Object { - "aria-label": "data table toolbar", - }, "propTypes": Object { - "aria-label": [Function], - "aria-labelledby": [Function], + "aria-label": Object { + "type": "string", + }, + "ariaLabel": [Function], "children": Object { "type": "node", }, @@ -8162,28 +7783,6 @@ Map { }, }, "TableToolbarMenu" => Object { - "defaultProps": Object { - "iconDescription": "Settings", - "renderIcon": Object { - "$$typeof": Symbol(react.forward_ref), - "propTypes": Object { - "size": Object { - "args": Array [ - Array [ - Object { - "type": "number", - }, - Object { - "type": "string", - }, - ], - ], - "type": "oneOfType", - }, - }, - "render": [Function], - }, - }, "propTypes": Object { "children": Object { "isRequired": true, @@ -8193,7 +7792,6 @@ Map { "type": "string", }, "iconDescription": Object { - "isRequired": true, "type": "string", }, "renderIcon": Object { @@ -8212,12 +7810,6 @@ Map { }, }, "TableToolbarSearch" => Object { - "defaultProps": Object { - "onClear": [Function], - "persistent": false, - "tabIndex": "0", - "translateWithId": [Function], - }, "propTypes": Object { "children": Object { "type": "node", @@ -8291,7 +7883,6 @@ Map { "type": "oneOfType", }, "translateWithId": Object { - "isRequired": true, "type": "func", }, }, @@ -8412,20 +8003,6 @@ Map { }, "TextArea" => Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "disabled": false, - "enableCounter": false, - "helperText": "", - "invalid": false, - "invalidText": "", - "maxCount": undefined, - "onChange": [Function], - "onClick": [Function], - "placeholder": "", - "rows": 4, - "warn": false, - "warnText": "", - }, "propTypes": Object { "className": Object { "type": "string", @@ -8526,15 +8103,6 @@ Map { "$$typeof": Symbol(react.forward_ref), "ControlledPasswordInput": Object { "$$typeof": Symbol(react.forward_ref), - "defaultProps": Object { - "disabled": false, - "helperText": "", - "invalid": false, - "invalidText": "", - "onChange": [Function], - "onClick": [Function], - "size": undefined, - }, "propTypes": Object { "className": Object { "type": "string", @@ -9045,13 +8613,6 @@ Map { "render": [Function], }, "ToastNotification" => Object { - "defaultProps": Object { - "hideCloseButton": false, - "kind": "error", - "onCloseButtonClick": [Function], - "role": "status", - "timeout": 0, - }, "propTypes": Object { "aria-label": Object { "type": "string", @@ -9682,11 +9243,6 @@ Map { }, "unstable_OverflowMenuV2" => Object {}, "unstable_PageSelector" => Object { - "defaultProps": Object { - "className": null, - "id": 1, - "labelText": "Current page number", - }, "propTypes": Object { "className": Object { "type": "string", @@ -9718,24 +9274,6 @@ Map { }, }, "unstable_Pagination" => Object { - "defaultProps": Object { - "backwardText": "Previous page", - "children": undefined, - "className": null, - "disabled": false, - "forwardText": "Next page", - "id": 1, - "initialPage": 1, - "itemRangeText": [Function], - "itemText": [Function], - "itemsPerPageText": "Items per page:", - "pageRangeText": [Function], - "pageSize": 10, - "pageSizes": undefined, - "pageText": [Function], - "pagesUnknown": false, - "totalItems": undefined, - }, "propTypes": Object { "backwardText": Object { "type": "string", diff --git a/packages/react/examples/custom-data-table-state-manager/src/components/CustomDataTable.js b/packages/react/examples/custom-data-table-state-manager/src/components/CustomDataTable.js index 35fc592d3ed1..ab553a8ae819 100644 --- a/packages/react/examples/custom-data-table-state-manager/src/components/CustomDataTable.js +++ b/packages/react/examples/custom-data-table-state-manager/src/components/CustomDataTable.js @@ -59,14 +59,14 @@ import { */ const CustomDataTable = ({ id, - collator, + collator = new Intl.Collator(), columns, - hasSelection, - pageSize: propPageSize, + hasSelection = false, + pageSize: propPageSize = 5, rows: propRows, - size, + size = TABLE_SIZE.REGULAR, sortInfo: propSortInfo, - start: propStart, + start: propStart = 0, zebra, }) => { const [rows, setRows] = useState(propRows); @@ -341,12 +341,4 @@ CustomDataTable.propTypes = { zebra: PropTypes.bool, }; -CustomDataTable.defaultProps = { - collator: new Intl.Collator(), - hasSelection: false, - pageSize: 5, - size: TABLE_SIZE.REGULAR, - start: 0, -}; - export default CustomDataTable; diff --git a/packages/react/src/components/Accordion/Accordion.Skeleton.tsx b/packages/react/src/components/Accordion/Accordion.Skeleton.tsx index a3f9a2ebc650..6b00e7c926c6 100644 --- a/packages/react/src/components/Accordion/Accordion.Skeleton.tsx +++ b/packages/react/src/components/Accordion/Accordion.Skeleton.tsx @@ -105,12 +105,6 @@ AccordionSkeleton.propTypes = { open: PropTypes.bool, }; -AccordionSkeleton.defaultProps = { - open: true, - count: 4, - align: 'end', -}; - function AccordionSkeletonItem() { const prefix = usePrefix(); return ( diff --git a/packages/react/src/components/Checkbox/Checkbox.tsx b/packages/react/src/components/Checkbox/Checkbox.tsx index 6bc628332899..ed4991df6651 100644 --- a/packages/react/src/components/Checkbox/Checkbox.tsx +++ b/packages/react/src/components/Checkbox/Checkbox.tsx @@ -12,6 +12,7 @@ import { Text } from '../Text'; import { usePrefix } from '../../internal/usePrefix'; import { WarningFilled, WarningAltFilled } from '@carbon/icons-react'; import setupGetInstanceId from '../../tools/setupGetInstanceId'; +import { noopFn } from '../../internal/noopFn'; const getInstanceId = setupGetInstanceId(); @@ -101,9 +102,9 @@ const Checkbox = React.forwardRef( helperText, id, labelText, - onChange, + onChange = noopFn, onClick, - indeterminate, + indeterminate = false, invalid, invalidText, hideLabel, @@ -296,11 +297,6 @@ Checkbox.propTypes = { warnText: PropTypes.node, }; -Checkbox.defaultProps = { - onChange: () => {}, - indeterminate: false, -}; - Checkbox.displayName = 'Checkbox'; export default Checkbox; diff --git a/packages/react/src/components/CodeSnippet/CodeSnippet.js b/packages/react/src/components/CodeSnippet/CodeSnippet.js index 35691be2823c..8d045cfb54bd 100644 --- a/packages/react/src/components/CodeSnippet/CodeSnippet.js +++ b/packages/react/src/components/CodeSnippet/CodeSnippet.js @@ -27,21 +27,21 @@ const defaultMinExpandedNumberOfRows = 16; function CodeSnippet({ align = 'bottom', className, - type, + type = 'single', children, disabled, feedback, feedbackTimeout, onClick, - ['aria-label']: ariaLabel, + ['aria-label']: ariaLabel = 'Copy to clipboard', ariaLabel: deprecatedAriaLabel, copyText, copyButtonDescription, light, - showMoreText, - showLessText, + showMoreText = 'Show more', + showLessText = 'Show less', hideCopyButton, - wrapText, + wrapText = false, maxCollapsedNumberOfRows = defaultMaxCollapsedNumberOfRows, maxExpandedNumberOfRows = defaultMaxExpandedNumberOfRows, minCollapsedNumberOfRows = defaultMinCollapsedNumberOfRows, @@ -419,12 +419,4 @@ CodeSnippet.propTypes = { wrapText: PropTypes.bool, }; -CodeSnippet.defaultProps = { - ['aria-label']: 'Copy to clipboard', - type: 'single', - showMoreText: 'Show more', - showLessText: 'Show less', - wrapText: false, -}; - export default CodeSnippet; diff --git a/packages/react/src/components/ComboBox/ComboBox.tsx b/packages/react/src/components/ComboBox/ComboBox.tsx index 77c8ad691f35..6b1f366921a0 100644 --- a/packages/react/src/components/ComboBox/ComboBox.tsx +++ b/packages/react/src/components/ComboBox/ComboBox.tsx @@ -38,7 +38,6 @@ import { } from '@carbon/icons-react'; import ListBox, { PropTypes as ListBoxPropTypes, - ListBoxType, ListBoxSize, } from '../ListBox'; import { ListBoxTrigger, ListBoxSelection } from '../ListBox/next'; @@ -286,11 +285,6 @@ export interface ComboBoxProps */ translateWithId?: (id: string) => string; - /** - * Currently supports either the default type, or an inline variant - */ - type?: ListBoxType; - /** * Specify whether the control is currently in warning state */ @@ -311,8 +305,8 @@ const ComboBox = forwardRef( ['aria-label']: ariaLabel = 'Choose an item', ariaLabel: deprecatedAriaLabel, className: containerClassName, - direction, - disabled, + direction = 'bottom', + disabled = false, downshiftProps, helperText, id, @@ -320,7 +314,7 @@ const ComboBox = forwardRef( invalid, invalidText, items, - itemToElement, + itemToElement = null, itemToString = defaultItemToString, light, onChange, @@ -333,7 +327,6 @@ const ComboBox = forwardRef( size, titleText, translateWithId, - type: _type, warn, warnText, ...rest @@ -926,11 +919,6 @@ ComboBox.propTypes = { */ translateWithId: PropTypes.func, - /** - * Currently supports either the default type, or an inline variant - */ - type: ListBoxPropTypes.ListBoxType, - /** * Specify whether the control is currently in warning state */ @@ -942,16 +930,6 @@ ComboBox.propTypes = { warnText: PropTypes.node, }; -ComboBox.defaultProps = { - disabled: false, - itemToString: defaultItemToString, - itemToElement: null, - shouldFilterItem: defaultShouldFilterItem, - type: 'default', - ['aria-label']: 'Choose an item', - direction: 'bottom', -}; - type ComboboxComponentProps = PropsWithoutRef< PropsWithChildren> & RefAttributes >; diff --git a/packages/react/src/components/ComposedModal/ComposedModal.tsx b/packages/react/src/components/ComposedModal/ComposedModal.tsx index ef7555510617..4cfce68b7697 100644 --- a/packages/react/src/components/ComposedModal/ComposedModal.tsx +++ b/packages/react/src/components/ComposedModal/ComposedModal.tsx @@ -197,7 +197,7 @@ const ComposedModal = React.forwardRef( onKeyDown, open, preventCloseOnClickOutside, - selectorPrimaryFocus, + selectorPrimaryFocus = '[data-modal-primary-focus]', selectorsFloatingMenus, size, launcherButtonRef, @@ -468,8 +468,5 @@ ComposedModal.propTypes = { */ size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']), }; -ComposedModal.defaultProps = { - selectorPrimaryFocus: '[data-modal-primary-focus]', -}; export default ComposedModal; diff --git a/packages/react/src/components/ComposedModal/ModalFooter.tsx b/packages/react/src/components/ComposedModal/ModalFooter.tsx index 95891af0264d..9ee4f68905cb 100644 --- a/packages/react/src/components/ComposedModal/ModalFooter.tsx +++ b/packages/react/src/components/ComposedModal/ModalFooter.tsx @@ -4,6 +4,7 @@ import Button from '../Button'; import ButtonSet from '../ButtonSet'; import cx from 'classnames'; import { usePrefix } from '../../internal/usePrefix'; +import { noopFn } from '../../internal/noopFn'; interface SecondaryButtonProps { buttonText: ReactNode; @@ -163,11 +164,11 @@ export const ModalFooter = React.forwardRef( { children, className: customClassName, - closeModal, + closeModal = noopFn, danger, inputref, - onRequestClose, - onRequestSubmit, + onRequestClose = noopFn, + onRequestSubmit = noopFn, primaryButtonDisabled, primaryButtonText, primaryClassName, @@ -324,10 +325,3 @@ ModalFooter.propTypes = { */ secondaryClassName: PropTypes.string, }; - -const noop = () => {}; -ModalFooter.defaultProps = { - onRequestClose: noop, - onRequestSubmit: noop, - closeModal: noop, -}; diff --git a/packages/react/src/components/ComposedModal/ModalHeader.tsx b/packages/react/src/components/ComposedModal/ModalHeader.tsx index 43d394c4851b..1ddbc044454f 100644 --- a/packages/react/src/components/ComposedModal/ModalHeader.tsx +++ b/packages/react/src/components/ComposedModal/ModalHeader.tsx @@ -84,7 +84,7 @@ export const ModalHeader = React.forwardRef( closeClassName, closeIconClassName, closeModal, - iconDescription, + iconDescription = 'Close', label, labelClassName, title, @@ -198,7 +198,3 @@ ModalHeader.propTypes = { */ titleClassName: PropTypes.string, }; - -ModalHeader.defaultProps = { - iconDescription: 'Close', -}; diff --git a/packages/react/src/components/ContentSwitcher/ContentSwitcher.stories.js b/packages/react/src/components/ContentSwitcher/ContentSwitcher.stories.js index 0072a0dfca3d..87b331e8bdc5 100644 --- a/packages/react/src/components/ContentSwitcher/ContentSwitcher.stories.js +++ b/packages/react/src/components/ContentSwitcher/ContentSwitcher.stories.js @@ -53,7 +53,7 @@ export const _WithLayer = () => ( ); export const IconOnly = (args) => ( - + {}} {...args}> @@ -68,7 +68,7 @@ export const IconOnly = (args) => ( export const IconOnlyWithLayer = (args) => ( - + {}} {...args}> diff --git a/packages/react/src/components/ContentSwitcher/ContentSwitcher.tsx b/packages/react/src/components/ContentSwitcher/ContentSwitcher.tsx index cb3bfeb6c94d..3f3129543476 100644 --- a/packages/react/src/components/ContentSwitcher/ContentSwitcher.tsx +++ b/packages/react/src/components/ContentSwitcher/ContentSwitcher.tsx @@ -13,6 +13,7 @@ import { LayoutConstraint } from '../Layout'; import { composeEventHandlers } from '../../tools/events'; import { getNextIndex, matches, keys } from '../../internal/keyboard'; import { PrefixContext } from '../../internal/usePrefix'; +import { noopFn } from '../../internal/noopFn'; interface SwitchEventHandlersParams { index?: number; @@ -126,13 +127,7 @@ export default class ContentSwitcher extends React.Component< static contextType = PrefixContext; - static defaultProps = { - selectedIndex: 0, - selectionMode: 'automatic', - onChange: () => {}, - }; - - static getDerivedStateFromProps({ selectedIndex }, state) { + static getDerivedStateFromProps({ selectedIndex = 0 }, state) { const { prevSelectedIndex } = state; return prevSelectedIndex === selectedIndex ? null @@ -147,7 +142,7 @@ export default class ContentSwitcher extends React.Component< }; handleChildChange = (data) => { - const { selectionMode } = this.props; + const { selectionMode = 'automatic' } = this.props; // the currently selected child index const { selectedIndex } = this.state; // the newly selected child index @@ -202,10 +197,12 @@ export default class ContentSwitcher extends React.Component< className, light, // eslint-disable-next-line @typescript-eslint/no-unused-vars - selectedIndex, // eslint-disable-line no-unused-vars + selectedIndex = 0, // eslint-disable-next-line @typescript-eslint/no-unused-vars - selectionMode, // eslint-disable-line no-unused-vars + selectionMode = 'automatic', size, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + onChange = noopFn, ...other } = this.props; diff --git a/packages/react/src/components/Copy/Copy.js b/packages/react/src/components/Copy/Copy.js index 298fd87ee57a..10b4976a79f4 100644 --- a/packages/react/src/components/Copy/Copy.js +++ b/packages/react/src/components/Copy/Copy.js @@ -12,15 +12,16 @@ import classnames from 'classnames'; import { composeEventHandlers } from '../../tools/events'; import { usePrefix } from '../../internal/usePrefix'; import { IconButton } from '../IconButton'; +import { noopFn } from '../../internal/noopFn'; export default function Copy({ align = 'bottom', children, className, - feedback, - feedbackTimeout, + feedback = 'Copied!', + feedbackTimeout = 2000, onAnimationEnd, - onClick, + onClick = noopFn, ...other }) { const [animation, setAnimation] = useState(''); @@ -125,9 +126,3 @@ Copy.propTypes = { */ onClick: PropTypes.func, }; - -Copy.defaultProps = { - feedback: 'Copied!', - feedbackTimeout: 2000, - onClick: () => {}, -}; diff --git a/packages/react/src/components/CopyButton/CopyButton.js b/packages/react/src/components/CopyButton/CopyButton.js index 7f217b920ab7..de6ec53ab95a 100644 --- a/packages/react/src/components/CopyButton/CopyButton.js +++ b/packages/react/src/components/CopyButton/CopyButton.js @@ -12,17 +12,23 @@ import { Copy as CopyIcon } from '@carbon/icons-react'; import Copy from '../Copy'; import { LayoutConstraint } from '../Layout'; import { usePrefix } from '../../internal/usePrefix'; - +import { noopFn } from '../../internal/noopFn'; export default function CopyButton({ align = 'bottom', - iconDescription, + feedback = 'Copied!', + feedbackTimeout = 2000, + iconDescription = 'Copy to clipboard', className, + onClick = noopFn, ...other }) { const prefix = usePrefix(); return ( {}, -}; diff --git a/packages/react/src/components/DataTable/DataTable.tsx b/packages/react/src/components/DataTable/DataTable.tsx index 310d7c93af78..e04c3f23167b 100644 --- a/packages/react/src/components/DataTable/DataTable.tsx +++ b/packages/react/src/components/DataTable/DataTable.tsx @@ -15,7 +15,6 @@ import { getCellId } from './tools/cells'; import denormalize from './tools/denormalize'; import { composeEventHandlers } from '../../tools/events'; import { defaultFilterRows } from './tools/filter'; -import { defaultSortRow } from './tools/sorting'; import setupGetInstanceId from './tools/instanceId'; import Table from './Table'; import TableActionList from './TableActionList'; @@ -64,15 +63,6 @@ const defaultTranslations = { const translateWithId = (id) => defaultTranslations[id]; -const dataTableDefaultProps = { - filterRows: defaultFilterRows, - locale: 'en', - overflowMenuOnHover: true, - size: 'lg', - sortRow: defaultSortRow, - translateWithId, -}; - export type DataTableSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; export interface DataTableCell { @@ -220,7 +210,7 @@ export interface DataTableProps { ) => React.ReactElement; experimentalAutoAlign?: boolean; filterRows?: (filterRowsArgs: { - cellsById: Record>; + cellsById: Record>; getCellId: (rowId: string, header: string) => string; headers: Array; inputValue: string; @@ -274,12 +264,11 @@ interface DataTableState { * consumer. */ class DataTable extends React.Component< - DataTableProps & typeof dataTableDefaultProps, + DataTableProps, DataTableState > { instanceId: number; - static defaultProps = dataTableDefaultProps; static propTypes = { /** * Experimental property. Allows table to align cell contents to the top if there is text wrapping in the content. Might have performance issues, intended for smaller tables @@ -495,7 +484,7 @@ class DataTable extends React.Component< [key: string]: unknown; } ) => { - const { translateWithId: t } = this.props; + const { translateWithId: t = translateWithId } = this.props; const { isExpandedAll, rowIds, rowsById } = this.state; const isExpanded = isExpandedAll || rowIds.every((id) => rowsById[id].isExpanded); @@ -561,7 +550,7 @@ class DataTable extends React.Component< row: DataTableRow; [key: string]: unknown; }) => { - const { translateWithId: t } = this.props; + const { translateWithId: t = translateWithId } = this.props; const translationKey = row.isExpanded ? translationKeys.collapseRow : translationKeys.expandRow; @@ -617,7 +606,7 @@ class DataTable extends React.Component< [key: string]: unknown; } ) => { - const { translateWithId: t } = this.props; + const { translateWithId: t = translateWithId } = this.props; // If we're given a row, return the selection state values for that row if (row) { @@ -694,11 +683,11 @@ class DataTable extends React.Component< getTableProps = () => { const { useZebraStyles, - size, + size = 'lg', isSortable, useStaticWidth, stickyHeader, - overflowMenuOnHover, + overflowMenuOnHover = true, experimentalAutoAlign, } = this.props; return { @@ -739,9 +728,10 @@ class DataTable extends React.Component< * @returns {Array} the array of rowIds that are currently included through the filter * */ getFilteredRowIds = () => { + const { filterRows = defaultFilterRows } = this.props; const filteredRowIds = typeof this.state.filterInputValue === 'string' - ? this.props.filterRows({ + ? filterRows({ rowIds: this.state.rowIds, headers: this.props.headers, cellsById: this.state.cellsById, @@ -941,8 +931,12 @@ class DataTable extends React.Component< }; render() { - // eslint-disable-next-line react/prop-types - const { children, filterRows, headers, render } = this.props; + const { + children, + filterRows = defaultFilterRows, + headers, + render, + } = this.props; const { filterInputValue, rowIds, rowsById, cellsById } = this.state; const filteredRowIds = typeof filterInputValue === 'string' diff --git a/packages/react/src/components/DataTable/Table.tsx b/packages/react/src/components/DataTable/Table.tsx index 821253bdb069..9e82aaf81856 100644 --- a/packages/react/src/components/DataTable/Table.tsx +++ b/packages/react/src/components/DataTable/Table.tsx @@ -289,9 +289,4 @@ Table.propTypes = { useZebraStyles: PropTypes.bool, }; -Table.defaultProps = { - isSortable: false, - overflowMenuOnHover: true, -}; - export default Table; diff --git a/packages/react/src/components/DataTable/TableBatchAction.js b/packages/react/src/components/DataTable/TableBatchAction.js index 1a0db30d441e..fcaa9e052605 100644 --- a/packages/react/src/components/DataTable/TableBatchAction.js +++ b/packages/react/src/components/DataTable/TableBatchAction.js @@ -10,7 +10,17 @@ import React from 'react'; import { AddFilled as iconAddSolid } from '@carbon/icons-react'; import Button from '../Button'; -const TableBatchAction = (props) => @@ -129,13 +126,7 @@ Filename.propTypes = { /** * Provide a custom tabIndex value for the `` */ - tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), -}; - -Filename.defaultProps = { - iconDescription: 'Uploading file', - status: 'uploading', - tabIndex: '0', + tabIndex: PropTypes.number, }; export default Filename; diff --git a/packages/react/src/components/FileUploader/__tests__/FileUploader-test.js b/packages/react/src/components/FileUploader/__tests__/FileUploader-test.js index 7a750b3219fc..72cf8c1ba114 100644 --- a/packages/react/src/components/FileUploader/__tests__/FileUploader-test.js +++ b/packages/react/src/components/FileUploader/__tests__/FileUploader-test.js @@ -14,6 +14,7 @@ import { uploadFiles } from '../test-helpers'; const iconDescription = 'test description'; const requiredProps = { iconDescription, + filenameStatus: 'uploading', labelTitle: 'Upload files', labelDescription: 'Max file size is 500mb. Only .jpg files are supported.', }; diff --git a/packages/react/src/components/FileUploader/__tests__/FileUploaderDropContainer-test.js b/packages/react/src/components/FileUploader/__tests__/FileUploaderDropContainer-test.js index d397a5babd02..9caf4730e7a9 100644 --- a/packages/react/src/components/FileUploader/__tests__/FileUploaderDropContainer-test.js +++ b/packages/react/src/components/FileUploader/__tests__/FileUploaderDropContainer-test.js @@ -12,15 +12,19 @@ import { Simulate } from 'react-dom/test-utils'; import { FileUploaderDropContainer } from '../'; import { uploadFiles } from '../test-helpers'; +const requiredProps = { labelText: 'Add file' }; + describe('FileUploaderDropContainer', () => { it('should not have axe violations', async () => { - const { container } = render(); + const { container } = render( + + ); await expect(container).toHaveNoAxeViolations(); }); it('should support a custom class name on the drop area', () => { const { container } = render( - + ); // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access const dropArea = container.querySelector('button'); @@ -30,8 +34,8 @@ describe('FileUploaderDropContainer', () => { it('should have a unique id each time it is used', () => { const { container } = render( <> - - + + ); // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access @@ -40,14 +44,18 @@ describe('FileUploaderDropContainer', () => { }); it('should render with the default labelText prop', () => { - const { container } = render(); + const { container } = render( + + ); // eslint-disable-next-line testing-library/prefer-screen-queries const label = getByText(container, 'Add file'); expect(label).toBeInstanceOf(HTMLElement); }); it('should render with multiple set to false by default', () => { - const { container } = render(); + const { container } = render( + + ); // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access const input = container.querySelector('input'); expect(input.getAttribute('multiple')).toBeFalsy(); @@ -71,7 +79,7 @@ describe('FileUploaderDropContainer', () => { it('should call `onAddFiles` when a file is selected', () => { const onAddFiles = jest.fn(); const { container } = render( - + ); // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access const input = container.querySelector('input'); @@ -95,7 +103,11 @@ describe('FileUploaderDropContainer', () => { it('should mark invalid files using default pattern', () => { const onAddFiles = jest.fn(); const { container } = render( - + ); // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access const input = container.querySelector('input'); @@ -138,7 +150,11 @@ describe('FileUploaderDropContainer', () => { it('should be case insensitive when marking files invalid', () => { const onAddFiles = jest.fn(); const { container } = render( - + ); // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access const input = container.querySelector('input'); @@ -181,6 +197,7 @@ describe('FileUploaderDropContainer', () => { onAddFiles={onAddFiles} accept={['.txt', '.a_a', '.b-b', '.a-b_c']} pattern=".[0-9a-z-_]+$" + {...requiredProps} /> ); // eslint-disable-next-line testing-library/no-container, testing-library/no-node-access diff --git a/packages/react/src/components/FluidDropdown/__tests__/FluidDropdown-test.js b/packages/react/src/components/FluidDropdown/__tests__/FluidDropdown-test.js index e00cacd50b87..94998f0c8b3d 100644 --- a/packages/react/src/components/FluidDropdown/__tests__/FluidDropdown-test.js +++ b/packages/react/src/components/FluidDropdown/__tests__/FluidDropdown-test.js @@ -29,6 +29,7 @@ describe('FluidDropdown', () => { label: 'input', placeholder: 'Filter...', type: 'default', + titleText: 'Dropdown label', }; }); @@ -104,12 +105,12 @@ describe('FluidDropdown', () => { describe('title', () => { it('renders a title', () => { - render(); + render(); expect(screen.getByText('Email Input')).toBeInTheDocument(); }); it('has the expected classes', () => { - render(); + render(); expect(screen.getByText('Email Input')).toHaveClass(`${prefix}--label`); }); }); diff --git a/packages/react/src/components/FluidSearch/FluidSearch.js b/packages/react/src/components/FluidSearch/FluidSearch.js index 1544d54cbfc5..18c209a5ba8f 100644 --- a/packages/react/src/components/FluidSearch/FluidSearch.js +++ b/packages/react/src/components/FluidSearch/FluidSearch.js @@ -26,13 +26,6 @@ const FluidSearch = React.forwardRef(function FluidSearch( ); }); -FluidSearch.defaultProps = { - autoComplete: 'off', - closeButtonLabelText: 'Clear search input', - role: 'searchbox', - type: 'text', -}; - FluidSearch.propTypes = { /** * Specify an optional value for the `autocomplete` property on the underlying diff --git a/packages/react/src/components/FormGroup/FormGroup.stories.js b/packages/react/src/components/FormGroup/FormGroup.stories.js index fbdda32b29e0..d2e0cfccdbd2 100644 --- a/packages/react/src/components/FormGroup/FormGroup.stories.js +++ b/packages/react/src/components/FormGroup/FormGroup.stories.js @@ -6,7 +6,7 @@ */ import React from 'react'; -import FormGroup from '../FormGroup'; +import { FormGroup } from '../FormGroup'; import TextInput from '../TextInput'; import RadioButtonGroup from '../RadioButtonGroup'; import RadioButton from '../RadioButton'; diff --git a/packages/react/src/components/FormGroup/FormGroup.tsx b/packages/react/src/components/FormGroup/FormGroup.tsx index 7c1b5de322ef..7dd2a8b541bb 100644 --- a/packages/react/src/components/FormGroup/FormGroup.tsx +++ b/packages/react/src/components/FormGroup/FormGroup.tsx @@ -47,11 +47,11 @@ export interface FormGroupProps extends ReactAttr { const FormGroup = ({ legendId, legendText, - invalid, + invalid = false, children, className, - message, - messageText, + message = false, + messageText = '', ...rest }: FormGroupProps) => { const prefix = usePrefix(); @@ -115,10 +115,4 @@ FormGroup.propTypes = { messageText: PropTypes.string, }; -FormGroup.defaultProps = { - invalid: false, - message: false, - messageText: '', -}; - export default FormGroup; diff --git a/packages/react/src/components/FormLabel/FormLabel.stories.js b/packages/react/src/components/FormLabel/FormLabel.stories.js index 9821c431610a..d99839b6418c 100644 --- a/packages/react/src/components/FormLabel/FormLabel.stories.js +++ b/packages/react/src/components/FormLabel/FormLabel.stories.js @@ -53,7 +53,8 @@ export const WithTooltip = (controls) => { inline className="notification" aria-label="Accessibility note on form labels" - actionButtonLabel="Accessibility button note on form labels"> + actionButtonLabel="Accessibility button note on form labels" + title="Accessibility note">

Note:   It is not recommended to include interactive items, such as diff --git a/packages/react/src/components/ListBox/ListBox.tsx b/packages/react/src/components/ListBox/ListBox.tsx index 80e4a979049f..6e6017bb9ea0 100644 --- a/packages/react/src/components/ListBox/ListBox.tsx +++ b/packages/react/src/components/ListBox/ListBox.tsx @@ -90,8 +90,8 @@ const ListBox: ListBoxComponent = React.forwardRef(function ListBox( { children, className: containerClassName, - disabled, - type, + disabled = false, + type = 'default', size, invalid, invalidText, @@ -156,7 +156,7 @@ ListBox.propTypes = { /** * Specify whether the ListBox is currently disabled */ - disabled: PropTypes.bool.isRequired, + disabled: PropTypes.bool, /** * Specify whether the control is currently invalid @@ -192,7 +192,7 @@ ListBox.propTypes = { * Specify the "type" of the ListBox. Currently supports either `default` or * `inline` as an option. */ - type: ListBoxType.isRequired, + type: ListBoxType, /** * Specify whether the control is currently in warning state @@ -205,9 +205,4 @@ ListBox.propTypes = { warnText: PropTypes.node, }; -ListBox.defaultProps = { - disabled: false, - type: 'default', -}; - export default ListBox; diff --git a/packages/react/src/components/ListBox/ListBoxMenuIcon.tsx b/packages/react/src/components/ListBox/ListBoxMenuIcon.tsx index aa55a958b746..c82921a2137f 100644 --- a/packages/react/src/components/ListBox/ListBoxMenuIcon.tsx +++ b/packages/react/src/components/ListBox/ListBoxMenuIcon.tsx @@ -74,11 +74,7 @@ ListBoxMenuIcon.propTypes = { * icon. This function takes in an id defined in `translationIds` and should * return a string message for that given message id. */ - translateWithId: PropTypes.func.isRequired, -}; - -ListBoxMenuIcon.defaultProps = { - translateWithId: defaultTranslateWithId, + translateWithId: PropTypes.func, }; export default ListBoxMenuIcon; diff --git a/packages/react/src/components/ListBox/ListBoxMenuItem.tsx b/packages/react/src/components/ListBox/ListBoxMenuItem.tsx index 0a0c18d2d72d..b6eb7e41804a 100644 --- a/packages/react/src/components/ListBox/ListBoxMenuItem.tsx +++ b/packages/react/src/components/ListBox/ListBoxMenuItem.tsx @@ -59,7 +59,13 @@ export type ListBoxMenuItemComponent = ForwardRefReturn< */ const ListBoxMenuItem = React.forwardRef( function ListBoxMenuItem( - { children, isActive, isHighlighted, title, ...rest }: ListBoxMenuItemProps, + { + children, + isActive = false, + isHighlighted = false, + title, + ...rest + }: ListBoxMenuItemProps, forwardedRef: ListBoxMenuItemForwardedRef ) { const prefix = usePrefix(); @@ -101,12 +107,12 @@ ListBoxMenuItem.propTypes = { /** * Specify whether the current menu item is "active". */ - isActive: PropTypes.bool.isRequired, + isActive: PropTypes.bool, /** * Specify whether the current menu item is "highlighted". */ - isHighlighted: PropTypes.bool.isRequired, + isHighlighted: PropTypes.bool, /** * Provide an optional tooltip for the ListBoxMenuItem @@ -114,9 +120,4 @@ ListBoxMenuItem.propTypes = { title: PropTypes.string, }; -ListBoxMenuItem.defaultProps = { - isActive: false, - isHighlighted: false, -}; - export default ListBoxMenuItem as ListBoxMenuItemComponent; diff --git a/packages/react/src/components/ListBox/ListBoxSelection.tsx b/packages/react/src/components/ListBox/ListBoxSelection.tsx index e88a88cbdc5a..9ef89b691b45 100644 --- a/packages/react/src/components/ListBox/ListBoxSelection.tsx +++ b/packages/react/src/components/ListBox/ListBoxSelection.tsx @@ -50,11 +50,23 @@ export interface ListBoxSelectionProps { * icon. This function takes in an id defined in `translationIds` and should * return a string message for that given message id. */ - translateWithId(messageId: string, args?: Record): string; + translateWithId?(messageId: string, args?: Record): string; } export type ListBoxSelectionComponent = React.FC; +export const translationIds = { + 'clear.all': 'clear.all', + 'clear.selection': 'clear.selection', +}; + +const defaultTranslations = { + [translationIds['clear.all']]: 'Clear all selected items', + [translationIds['clear.selection']]: 'Clear selected item', +}; + +const defaultTranslateWithId = (id: string) => defaultTranslations[id]; + /** * `ListBoxSelection` is used to provide controls for clearing a selection, in * addition to conditionally rendering a badge if the control has more than one @@ -63,7 +75,7 @@ export type ListBoxSelectionComponent = React.FC; const ListBoxSelection: ListBoxSelectionComponent = ({ clearSelection, selectionCount, - translateWithId: t, + translateWithId: t = defaultTranslateWithId, disabled, onClearSelection, readOnly, @@ -124,16 +136,6 @@ const ListBoxSelection: ListBoxSelectionComponent = ({ ); }; -export const translationIds = { - 'clear.all': 'clear.all', - 'clear.selection': 'clear.selection', -}; - -const defaultTranslations = { - [translationIds['clear.all']]: 'Clear all selected items', - [translationIds['clear.selection']]: 'Clear selected item', -}; - ListBoxSelection.propTypes = { /** * Specify a function to be invoked when a user interacts with the clear @@ -168,11 +170,7 @@ ListBoxSelection.propTypes = { * icon. This function takes in an id defined in `translationIds` and should * return a string message for that given message id. */ - translateWithId: PropTypes.func.isRequired, -}; - -ListBoxSelection.defaultProps = { - translateWithId: (id: string) => defaultTranslations[id], + translateWithId: PropTypes.func, }; export default ListBoxSelection; diff --git a/packages/react/src/components/ListBox/next/ListBoxSelection.js b/packages/react/src/components/ListBox/next/ListBoxSelection.js index d7fbe6c67bd6..1ecc3a5b743b 100644 --- a/packages/react/src/components/ListBox/next/ListBoxSelection.js +++ b/packages/react/src/components/ListBox/next/ListBoxSelection.js @@ -16,10 +16,23 @@ import { usePrefix } from '../../../internal/usePrefix'; * addition to conditionally rendering a badge if the control has more than one * selection. */ + +export const translationIds = { + 'clear.all': 'clear.all', + 'clear.selection': 'clear.selection', +}; + +const defaultTranslations = { + [translationIds['clear.all']]: 'Clear all selected items', + [translationIds['clear.selection']]: 'Clear selected item', +}; + +const defaultTranslateWithId = (id) => defaultTranslations[id]; + function ListBoxSelection({ clearSelection, selectionCount, - translateWithId: t, + translateWithId: t = defaultTranslateWithId, disabled, onClearSelection, ...rest @@ -85,16 +98,6 @@ function ListBoxSelection({ ); } -export const translationIds = { - 'clear.all': 'clear.all', - 'clear.selection': 'clear.selection', -}; - -const defaultTranslations = { - [translationIds['clear.all']]: 'Clear all selected items', - [translationIds['clear.selection']]: 'Clear selected item', -}; - ListBoxSelection.propTypes = { /** * Specify a function to be invoked when a user interacts with the clear @@ -136,11 +139,7 @@ ListBoxSelection.propTypes = { * icon. This function takes in an id defined in `translationIds` and should * return a string message for that given message id. */ - translateWithId: PropTypes.func.isRequired, -}; - -ListBoxSelection.defaultProps = { - translateWithId: (id) => defaultTranslations[id], + translateWithId: PropTypes.func, }; export default ListBoxSelection; diff --git a/packages/react/src/components/ListBox/next/ListBoxTrigger.js b/packages/react/src/components/ListBox/next/ListBoxTrigger.js index fa096abd7e1e..4e5f8e130c6f 100644 --- a/packages/react/src/components/ListBox/next/ListBoxTrigger.js +++ b/packages/react/src/components/ListBox/next/ListBoxTrigger.js @@ -21,11 +21,17 @@ const defaultTranslations = { [translationIds['open.menu']]: 'Open', }; +const defaultTranslateWithId = (id) => defaultTranslations[id]; + /** * `ListBoxTrigger` is used to orient the icon up or down depending on the * state of the menu for a given `ListBox` */ -const ListBoxTrigger = ({ isOpen, translateWithId: t, ...rest }) => { +const ListBoxTrigger = ({ + isOpen, + translateWithId: t = defaultTranslateWithId, + ...rest +}) => { const prefix = usePrefix(); const className = cx({ [`${prefix}--list-box__menu-icon`]: true, @@ -57,11 +63,7 @@ ListBoxTrigger.propTypes = { * icon. This function takes in an id defined in `translationIds` and should * return a string message for that given message id. */ - translateWithId: PropTypes.func.isRequired, -}; - -ListBoxTrigger.defaultProps = { - translateWithId: (id) => defaultTranslations[id], + translateWithId: PropTypes.func, }; export default ListBoxTrigger; diff --git a/packages/react/src/components/Modal/Modal.js b/packages/react/src/components/Modal/Modal.js index 5eca4542e223..8ade026277af 100644 --- a/packages/react/src/components/Modal/Modal.js +++ b/packages/react/src/components/Modal/Modal.js @@ -19,6 +19,7 @@ import wrapFocus, { import setupGetInstanceId from '../../tools/setupGetInstanceId'; import { usePrefix } from '../../internal/usePrefix'; import { keys, match } from '../../internal/keyboard'; +import { noopFn } from '../../internal/noopFn'; import { Text } from '../Text'; const getInstanceId = setupGetInstanceId(); @@ -28,27 +29,27 @@ const Modal = React.forwardRef(function Modal( 'aria-label': ariaLabelProp, children, className, - modalHeading, - modalLabel, + modalHeading = '', + modalLabel = '', modalAriaLabel, - passiveModal, + passiveModal = false, secondaryButtonText, primaryButtonText, open, - onRequestClose, - onRequestSubmit, + onRequestClose = noopFn, + onRequestSubmit = noopFn, onSecondarySubmit, - primaryButtonDisabled, + primaryButtonDisabled = false, danger, alert, secondaryButtons, - selectorPrimaryFocus, // eslint-disable-line - selectorsFloatingMenus, // eslint-disable-line - shouldSubmitOnEnter, // eslint-disable-line + selectorPrimaryFocus = '[data-modal-primary-focus]', + selectorsFloatingMenus, + shouldSubmitOnEnter, size, - hasScrollingContent, + hasScrollingContent = false, closeButtonLabel, - preventCloseOnClickOutside, // eslint-disable-line + preventCloseOnClickOutside = false, isFullWidth, launcherButtonRef, ...rest @@ -515,17 +516,4 @@ Modal.propTypes = { size: PropTypes.oneOf(['xs', 'sm', 'md', 'lg']), }; -Modal.defaultProps = { - onRequestClose: () => {}, - onRequestSubmit: () => {}, - primaryButtonDisabled: false, - onKeyDown: () => {}, - passiveModal: false, - modalHeading: '', - modalLabel: '', - preventCloseOnClickOutside: false, - selectorPrimaryFocus: '[data-modal-primary-focus]', - hasScrollingContent: false, -}; - export default Modal; diff --git a/packages/react/src/components/ModalWrapper/ModalWrapper.js b/packages/react/src/components/ModalWrapper/ModalWrapper.js index f6f23d66c31e..2d144e2b1df9 100644 --- a/packages/react/src/components/ModalWrapper/ModalWrapper.js +++ b/packages/react/src/components/ModalWrapper/ModalWrapper.js @@ -11,6 +11,7 @@ import Modal from '../Modal'; import Button from '../Button'; import { ButtonKinds } from '../../prop-types/types'; import { warning } from '../../internal/warning'; +import { noopFn } from '../../internal/noopFn'; let didWarnAboutDeprecation = false; @@ -52,18 +53,6 @@ export default class ModalWrapper extends React.Component { withHeader: PropTypes.bool, }; - static defaultProps = { - shouldCloseAfterSubmit: true, - primaryButtonText: 'Save', - secondaryButtonText: 'Cancel', - triggerButtonIconDescription: 'Provide icon description if icon is used', - triggerButtonKind: 'primary', - disabled: false, - preventCloseOnClickOutside: false, - selectorPrimaryFocus: '[data-modal-primary-focus]', - onKeyDown: () => {}, - }; - triggerButton = React.createRef(); modal = React.createRef(); @@ -107,17 +96,19 @@ export default class ModalWrapper extends React.Component { render() { const { children, - onKeyDown, + onKeyDown = noopFn, buttonTriggerText, buttonTriggerClassName, renderTriggerButtonIcon, - triggerButtonIconDescription, - triggerButtonKind, - disabled, + primaryButtonText = 'Save', + secondaryButtonText = 'Cancel', + triggerButtonIconDescription = 'Provide icon description if icon is used', + triggerButtonKind = 'primary', + disabled = false, handleSubmit, // eslint-disable-line no-unused-vars - shouldCloseAfterSubmit, // eslint-disable-line no-unused-vars - selectorPrimaryFocus, - preventCloseOnClickOutside, // eslint-disable-line no-unused-vars + shouldCloseAfterSubmit = true, // eslint-disable-line no-unused-vars + selectorPrimaryFocus = '[data-modal-primary-focus]', + preventCloseOnClickOutside = false, // eslint-disable-line no-unused-vars ...other } = this.props; @@ -148,7 +139,11 @@ export default class ModalWrapper extends React.Component { ref={this.triggerButton}> {buttonTriggerText} - + {children} diff --git a/packages/react/src/components/MultiSelect/FilterableMultiSelect.js b/packages/react/src/components/MultiSelect/FilterableMultiSelect.js index bda6384794e6..3e6cbd717a95 100644 --- a/packages/react/src/components/MultiSelect/FilterableMultiSelect.js +++ b/packages/react/src/components/MultiSelect/FilterableMultiSelect.js @@ -28,34 +28,34 @@ import { FormContext } from '../FluidForm'; const FilterableMultiSelect = React.forwardRef(function FilterableMultiSelect( { className: containerClassName, - clearSelectionDescription, - clearSelectionText, - compareItems, - direction, - disabled, + clearSelectionDescription = 'Total items selected: ', + clearSelectionText = 'To clear selection, press Delete or Backspace', + compareItems = defaultCompareItems, + direction = 'bottom', + disabled = false, downshiftProps, - filterItems, + filterItems = defaultFilterItems, helperText, hideLabel, id, - initialSelectedItems, + initialSelectedItems = [], invalid, invalidText, items, itemToElement: ItemToElement, // needs to be capitalized for react to render it correctly - itemToString, + itemToString = defaultItemToString, light, - locale, + locale = 'en', onInputValueChange, - open, + open = false, onChange, onMenuChange, placeholder, titleText, type, - selectionFeedback, + selectionFeedback = 'top-after-reopen', size, - sortItems, + sortItems = defaultSortItems, translateWithId, useTitleInItem, warn, @@ -680,19 +680,4 @@ FilterableMultiSelect.propTypes = { warnText: PropTypes.node, }; -FilterableMultiSelect.defaultProps = { - compareItems: defaultCompareItems, - direction: 'bottom', - disabled: false, - filterItems: defaultFilterItems, - initialSelectedItems: [], - itemToString: defaultItemToString, - locale: 'en', - sortItems: defaultSortItems, - open: false, - selectionFeedback: 'top-after-reopen', - clearSelectionText: 'To clear selection, press Delete or Backspace,', - clearSelectionDescription: 'Total items selected: ', -}; - export default FilterableMultiSelect; diff --git a/packages/react/src/components/MultiSelect/MultiSelect.stories.js b/packages/react/src/components/MultiSelect/MultiSelect.stories.js index 110cd24c44ee..12ab47b32807 100644 --- a/packages/react/src/components/MultiSelect/MultiSelect.stories.js +++ b/packages/react/src/components/MultiSelect/MultiSelect.stories.js @@ -142,7 +142,7 @@ Playground.args = { invalidText: 'whoopsie!', label: 'This is a label', clearSelectionDescription: 'Total items selected: ', - useTitleInItem: 'this is the item title', + useTitleInItem: false, clearSelectionText: 'To clear selection, press Delete or Backspace,', }; diff --git a/packages/react/src/components/MultiSelect/MultiSelect.tsx b/packages/react/src/components/MultiSelect/MultiSelect.tsx index 69b439a64dc3..1dd72c3c72e6 100644 --- a/packages/react/src/components/MultiSelect/MultiSelect.tsx +++ b/packages/react/src/components/MultiSelect/MultiSelect.tsx @@ -33,8 +33,8 @@ import { FormContext } from '../FluidForm'; import { ListBoxProps } from '../ListBox/ListBox'; import { OnChangeData } from '../Dropdown'; import type { InternationalProps } from '../../types/common'; +import { noopFn } from '../../internal/noopFn'; -const noop = () => {}; const getInstanceId = setupGetInstanceId(); const { ItemClick, @@ -98,7 +98,7 @@ interface MultiSelectSortingProps { item1: ItemType, item2: ItemType, options: SharedOptions - ): number; // required but has default value + ): number; /** * Provide a method that sorts all options in the control. Overriding this @@ -123,7 +123,7 @@ interface MultiSelectSortingProps { sortItems?( items: ReadonlyArray, options: SortItemsOptions - ): ItemType[]; // required but has default value + ): ItemType[]; } export interface MultiSelectProps @@ -304,18 +304,18 @@ const MultiSelect = React.forwardRef( items, itemToElement, itemToString = defaultItemToString, - titleText, + titleText = false, hideLabel, helperText, label, - type, + type = 'default', size, - disabled, - initialSelectedItems, - sortItems, - compareItems, - clearSelectionText, - clearSelectionDescription, + disabled = false, + initialSelectedItems = [], + sortItems = defaultSortItems as MultiSelectProps['sortItems'], + compareItems = defaultCompareItems, + clearSelectionText = 'To clear selection, press Delete or Backspace', + clearSelectionDescription = 'Total items selected: ', light, invalid, invalidText, @@ -324,14 +324,14 @@ const MultiSelect = React.forwardRef( useTitleInItem, translateWithId, downshiftProps, - open, - selectionFeedback, + open = false, + selectionFeedback = 'top-after-reopen', onChange, onMenuChange, - direction, + direction = 'bottom', selectedItems: selected, readOnly, - locale, + locale = 'en', }: MultiSelectProps, ref: ForwardedRef ) => { @@ -607,7 +607,9 @@ const MultiSelect = React.forwardRef( {selectedItems.length > 0 && ( Array */ - sortItems: PropTypes.func.isRequired, + sortItems: PropTypes.func, /** * Provide text to be used in a `

- - -
- -
-
- ); -}); - -SideNavSwitcher.displayName = 'SideNavSwitcher'; -SideNavSwitcher.propTypes = { - /** - * Provide an optional class to be applied to the containing node - */ - className: PropTypes.string, - - /** - * Provide the label for the switcher. This will be the first visible option - * when someone views this control - */ - labelText: PropTypes.string.isRequired, - - /** - * Provide a callback function that is called whenever the switcher value is - * updated - */ - onChange: PropTypes.func, - - /** - * Provide an array of options to be rendered in the switcher as an - * `