diff --git a/.eslintignore b/.eslintignore index fb66b3b68..8baed5a66 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,5 +1,6 @@ fixtures/ packages/components/core +ui/theme/src/tokens.ts # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. @@ -47,4 +48,7 @@ core lerna-debug.log -**/*.spec.js \ No newline at end of file +**/*.spec.js + +#temp +ui \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index 8ec9f269d..16c1e775c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -25,6 +25,7 @@ module.exports = { "plugin:testing-library/dom", "plugin:jest-dom/recommended", "plugin:storybook/recommended", + "plugin:react/jsx-runtime", ], overrides: [ { @@ -36,12 +37,16 @@ module.exports = { rules: { "react/prop-types": "off", "@washingtonpost/wpds/theme-colors": "warn", - "no-restricted-syntax": [ - "error", + }, + }, + // warning 'React' is defined but never used @typescript-eslint/no-unused-vars -- allow unused React + { + files: ["**/*.tsx"], + rules: { + "@typescript-eslint/no-unused-vars": [ + "warn", { - selector: - "ImportDeclaration[source.value='react'][specifiers.0.type='ImportDefaultSpecifier']", - message: "Default React import not allowed", + varsIgnorePattern: "React", }, ], }, diff --git a/.github/workflows/interaction-tests.yml b/.github/workflows/interaction-tests.yml deleted file mode 100644 index 7da16ff1c..000000000 --- a/.github/workflows/interaction-tests.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Interaction Tests - -on: deployment_status - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -jobs: - tests: - if: github.event.deployment_status.state == 'success' && contains(github.event.deployment_status.target_url, 'storybook') && !contains(github.event.deployment_status.target_url, 'vitejs') - runs-on: ubuntu-latest - timeout-minutes: 10 - env: - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} - TURBO_TEAM: ${{ secrets.TURBO_TEAM }} - steps: - - uses: actions/checkout@v4.1.1 - with: - fetch-depth: 0 - - - uses: actions/setup-node@v4.0.0 - with: - node-version-file: ".nvmrc" - registry-url: "https://registry.npmjs.org" - always-auth: true - cache: npm - - - name: Cache node_modules - id: cache-node_modules - uses: actions/cache@v3 - with: - path: | - **/node_modules - node_modules - key: node_modules-${{ hashFiles('package-lock.json') }} - restore-keys: node_modules - - - name: Install npm dependencies - if: steps.cache-node_modules.outputs.cache-hit != 'true' - run: npm ci - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} - TURBO_TEAM: ${{ secrets.TURBO_TEAM }} - - - name: Run interaction tests - run: npm run test-storybook - env: - TARGET_URL: "${{ github.event.deployment_status.target_url }}" diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index f4ff5c547..0f1d09ce3 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -9,7 +9,9 @@ jobs: test: if: github.event.deployment_status.state == 'success' && !contains(github.event.deployment_status.target_url, 'storybook') && !contains(github.event.deployment_status.target_url, 'vitejs') runs-on: ubuntu-latest - timeout-minutes: 20 + container: + image: mcr.microsoft.com/playwright:v1.40.1-jammy + timeout-minutes: 25 env: TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} TURBO_TEAM: ${{ secrets.TURBO_TEAM }} @@ -25,6 +27,14 @@ jobs: always-auth: true cache: npm + - name: Cache playwright binaries + uses: actions/cache@v3 + id: playwright-cache + with: + path: | + ~/.cache/ms-playwright + key: cache-playwright-linux-1.40.1 + - name: Cache node_modules id: cache-node_modules uses: actions/cache@v3 @@ -44,18 +54,12 @@ jobs: TURBO_TEAM: ${{ secrets.TURBO_TEAM }} - name: Install Playwright Browsers + if: steps.playwright-cache.outputs.cache-hit != 'true' run: npx playwright install --with-deps - name: Run Playwright tests - run: npx playwright test + run: npm run playwright env: BASEURL: "${{ github.event.deployment_status.target_url }}" TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} - TURBO_TEAM: ${{ secrets.TURBO_TEAM }} - - # - uses: actions/upload-artifact@v3 - # if: always() - # with: - # name: playwright-report - # path: playwright-report/ - # retention-days: 30 + TURBO_TEAM: ${{ secrets.TURBO_TEAM }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index b49d78140..2ecaec749 100644 --- a/.gitignore +++ b/.gitignore @@ -126,7 +126,7 @@ yalc.lock # ignore build site vscode build.washingtonpost.com/.vscode/ -# ignore the storybook build +# ignore the storybook build build.washingtonpost.com/public/storybook/**/* .env @@ -135,3 +135,6 @@ build.washingtonpost.com/public/storybook/**/* /test-results/ /playwright-report/ /playwright/.cache/ +.turbo + +.idea/* diff --git a/.prettierignore b/.prettierignore index 8fd0db576..b240afd2d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -9,3 +9,4 @@ out jest-coverage plop-templates /ui/theme/src/tokens.ts +/packages/kit/src/theme/tokens.ts diff --git a/.storybook/main.js b/.storybook/main.js index 5bc98b830..2c26c2055 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -1,36 +1,49 @@ +import { dirname, join } from "path"; // add process.env require("dotenv").config(); module.exports = { - stories: ["../ui/(**|!(node_modules))/src/*.stories.@(ts|tsx|js|jsx)"], + stories: ["../packages/kit/src/**/*.stories.tsx"], exclude: ["node_modules", "dist"], + addons: [ - "@storybook/addon-essentials", - "@storybook/addon-interactions", - "@storybook/addon-a11y", + getAbsolutePath("@storybook/addon-essentials"), + getAbsolutePath("@storybook/addon-interactions"), + getAbsolutePath("@storybook/addon-a11y"), ], + previewBody: (body) => `${body}`, + features: { storyStoreV7: true, interactionsDebugger: true, }, - framework: "@storybook/react", - core: { - builder: "webpack5", + + framework: { + name: getAbsolutePath("@storybook/nextjs"), + options: {}, }, - typescript: { - check: true, - reactDocgen: "react-docgen-typescript", - reactDocgenTypescriptOptions: { - shouldExtractLiteralValuesFromEnum: true, - propFilter: (prop) => - prop.parent - ? /@radix-ui/.test(prop.parent.fileName) || - !/node_modules/.test(prop.parent.fileName) - : true, - compilerOptions: { - allowSyntheticDefaultImports: false, - }, - }, + + // typescript: { + // reactDocgen: "react-docgen-typescript", + // reactDocgenTypescriptOptions: { + // shouldExtractLiteralValuesFromEnum: true, + // propFilter: (prop) => + // prop.parent + // ? /@radix-ui/.test(prop.parent.fileName) || + // !/node_modules/.test(prop.parent.fileName) + // : true, + // compilerOptions: { + // allowSyntheticDefaultImports: false, + // }, + // }, + // }, + + docs: { + autodocs: true, }, }; + +function getAbsolutePath(value) { + return dirname(require.resolve(join(value, "package.json"))); +} diff --git a/.storybook/preview.js b/.storybook/preview.js index 222041ef9..5f5b55a41 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -56,7 +56,7 @@ const Panel = styled("div", { function GlobalStyles(props) { globalStyles(); - return {props.children}; + return {props.children}; } function DarkPanel(props) { @@ -72,7 +72,11 @@ function DarkPanel(props) { export const decorators = [ (Story, Context) => { if (Context.story.includes("Interactions")) { - return ; + return ( + + + + ); } return ( diff --git a/CHANGELOG.md b/CHANGELOG.md index 03686df5d..282959874 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,276 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.0.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.24.0...v2.0.0) (2024-04-24) + +### Features + +- v2.0.0 ([#542](https://github.com/washingtonpost/wpds-ui-kit/issues/542)) ([d429cfa](https://github.com/washingtonpost/wpds-ui-kit/commit/d429cfabb7489a2548ffad5c3d945145824d4a22)), closes [#544](https://github.com/washingtonpost/wpds-ui-kit/issues/544) [#552](https://github.com/washingtonpost/wpds-ui-kit/issues/552) [#555](https://github.com/washingtonpost/wpds-ui-kit/issues/555) [#560](https://github.com/washingtonpost/wpds-ui-kit/issues/560) [#562](https://github.com/washingtonpost/wpds-ui-kit/issues/562) [#564](https://github.com/washingtonpost/wpds-ui-kit/issues/564) [#565](https://github.com/washingtonpost/wpds-ui-kit/issues/565) [#574](https://github.com/washingtonpost/wpds-ui-kit/issues/574) [#570](https://github.com/washingtonpost/wpds-ui-kit/issues/570) [#579](https://github.com/washingtonpost/wpds-ui-kit/issues/579) [#578](https://github.com/washingtonpost/wpds-ui-kit/issues/578) [#580](https://github.com/washingtonpost/wpds-ui-kit/issues/580) [#579](https://github.com/washingtonpost/wpds-ui-kit/issues/579) + +# [2.0.0-alpha.12](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2024-04-10) + +# [1.24.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.10...v1.24.0) (2024-04-09) + +### Bug Fixes + +- remove global styles from wpds-tokens ([2886b69](https://github.com/washingtonpost/wpds-ui-kit/commit/2886b6921257daa54fca191c1c554f8830bf5bf0)) + +### Features + +- add v2 docs switcher ([#609](https://github.com/washingtonpost/wpds-ui-kit/issues/609)) ([49e35a1](https://github.com/washingtonpost/wpds-ui-kit/commit/49e35a13a67efaa5d64e457ac565f8b6970d0fd4)) + +## [1.23.1](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.23.0...v1.23.1) (2024-03-26) + +### Bug Fixes + +- ensure that dark theme colors get written into the dom ([#605](https://github.com/washingtonpost/wpds-ui-kit/issues/605)) ([9fb968e](https://github.com/washingtonpost/wpds-ui-kit/commit/9fb968e6ea78d2d657ef9f538decc0e2b25dcf35)) + +# [1.23.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.6...v1.23.0) (2024-03-25) + +### Bug Fixes + +- make input helper and error text block level elements for consistent formatting ([2640be2](https://github.com/washingtonpost/wpds-ui-kit/commit/2640be29f24f83199baa3c735bdd47c404dd700b)) +- updated React types package to prevent type errors ([b647c60](https://github.com/washingtonpost/wpds-ui-kit/commit/b647c60662d9f75f8857f8f8205f5d4c04ba0cef)) + +### Features + +- increase the specificity of the wpds-dark selector to ensure it overrides light variables ([fd7748f](https://github.com/washingtonpost/wpds-ui-kit/commit/fd7748fa7386396fa13bb52d8d67a1c513ccc6a9)) + +# [2.0.0-alpha.11](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.10...v2.0.0-alpha.11) (2024-04-09) + +**Note:** Version bump only for package root + +# [2.0.0-alpha.10](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.7...v2.0.0-alpha.10) (2024-04-09) + +### Bug Fixes + +- add tokens specifier to exports ([#616](https://github.com/washingtonpost/wpds-ui-kit/issues/616)) ([261c231](https://github.com/washingtonpost/wpds-ui-kit/commit/261c2317d9f34c20da55afaa8d9012d45677ca52)) +- new colors are not showing up ([#614](https://github.com/washingtonpost/wpds-ui-kit/issues/614)) ([9e9b975](https://github.com/washingtonpost/wpds-ui-kit/commit/9e9b9755f70bcd70ebde30501515f31269efaf7d)) + +# [2.0.0-alpha.9](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.7...v2.0.0-alpha.9) (2024-04-09) + +### Bug Fixes + +- add tokens specifier to exports ([#616](https://github.com/washingtonpost/wpds-ui-kit/issues/616)) ([261c231](https://github.com/washingtonpost/wpds-ui-kit/commit/261c2317d9f34c20da55afaa8d9012d45677ca52)) +- new colors are not showing up ([#614](https://github.com/washingtonpost/wpds-ui-kit/issues/614)) ([9e9b975](https://github.com/washingtonpost/wpds-ui-kit/commit/9e9b9755f70bcd70ebde30501515f31269efaf7d)) + +# [2.0.0-alpha.8](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.7...v2.0.0-alpha.8) (2024-04-04) + +### Bug Fixes + +- new colors are not showing up ([#614](https://github.com/washingtonpost/wpds-ui-kit/issues/614)) ([9e9b975](https://github.com/washingtonpost/wpds-ui-kit/commit/9e9b9755f70bcd70ebde30501515f31269efaf7d)) + +# [2.0.0-alpha.7](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.6...v2.0.0-alpha.7) (2024-04-02) + +### Bug Fixes + +- add nanoid back ([#607](https://github.com/washingtonpost/wpds-ui-kit/issues/607)) ([d862816](https://github.com/washingtonpost/wpds-ui-kit/commit/d862816e85c3f667b1bd5be1f253b7920261f01b)) +- make input helper and error block level elements to preserve formatting ([20a9455](https://github.com/washingtonpost/wpds-ui-kit/commit/20a9455cd8a72f1c9c7521e5ced97f09e8b59604)) +- transform Select arrow on open ([#597](https://github.com/washingtonpost/wpds-ui-kit/issues/597)) ([b0e77be](https://github.com/washingtonpost/wpds-ui-kit/commit/b0e77be13ee0e5989d81c976e2b5eb9f5a41a060)) +- transform select icon on open ([#596](https://github.com/washingtonpost/wpds-ui-kit/issues/596)) ([1f68ace](https://github.com/washingtonpost/wpds-ui-kit/commit/1f68acef8dd386267b9b30c650df6abe11b10954)) + +# [2.0.0-alpha.2](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-03-14) + +# [2.0.0-alpha.1](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.0...v2.0.0-alpha.1) (2024-03-14) + +# [2.0.0-alpha.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.1.0-experimental.0...v2.0.0-alpha.0) (2024-03-14) + +# [2.1.0-experimental.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.0...v2.1.0-experimental.0) (2024-03-13) + +### Bug Fixes + +- i don't know how dialog went mising ([#579](https://github.com/washingtonpost/wpds-ui-kit/issues/579)) ([e783d0a](https://github.com/washingtonpost/wpds-ui-kit/commit/e783d0a9a132e67f9b35e1434998a9b163969e25)) +- merging main and resolving conflicts ([#585](https://github.com/washingtonpost/wpds-ui-kit/issues/585)) ([253effe](https://github.com/washingtonpost/wpds-ui-kit/commit/253effebcc310c6ceee9efbed2e346d7b3132691)) +- Playroom fix ([#583](https://github.com/washingtonpost/wpds-ui-kit/issues/583)) ([6b8c42b](https://github.com/washingtonpost/wpds-ui-kit/commit/6b8c42beb93fb2a0e391df6aad5da78cf40d92e3)) +- remove border for clear button on input search ([#560](https://github.com/washingtonpost/wpds-ui-kit/issues/560)) ([504b82f](https://github.com/washingtonpost/wpds-ui-kit/commit/504b82fa0a61249ccab701316ed04fda3077503c)) +- remove defaultOpen from kitchen sink Tooltip example to prevent client server mismatch ([df842ac](https://github.com/washingtonpost/wpds-ui-kit/commit/df842ac97cbd9f1c6a8a680f4cd9f926f7563fb7)) +- take latest minor of Radix accordion ([84f39d4](https://github.com/washingtonpost/wpds-ui-kit/commit/84f39d417b66125ba0efa54dadb08564b9538762)) + +### Features + +- card ([#564](https://github.com/washingtonpost/wpds-ui-kit/issues/564)) ([ce0b9db](https://github.com/washingtonpost/wpds-ui-kit/commit/ce0b9db6985f44d848b0bf38c259f04107f03344)) +- fresh install with updated node/npm ([#574](https://github.com/washingtonpost/wpds-ui-kit/issues/574)) ([848b697](https://github.com/washingtonpost/wpds-ui-kit/commit/848b697d97c6e98241b118ae24472a2fb7cede5a)) +- move Button, Icon, theme, and VisuallyHidden to v2 package ([#562](https://github.com/washingtonpost/wpds-ui-kit/issues/562)) ([be3524d](https://github.com/washingtonpost/wpds-ui-kit/commit/be3524d388e177023b9c476a68020a478a893f50)) +- remove nanoid dependency ([#555](https://github.com/washingtonpost/wpds-ui-kit/issues/555)) ([20f22d6](https://github.com/washingtonpost/wpds-ui-kit/commit/20f22d6a0869de6edb25312bb93638832320b82f)) +- update Accordion to React 18 ([#565](https://github.com/washingtonpost/wpds-ui-kit/issues/565)) ([672e239](https://github.com/washingtonpost/wpds-ui-kit/commit/672e23918d9989de9d1a8702d3880b3f4f0ac38f)) +- update package-lock ([ed5c500](https://github.com/washingtonpost/wpds-ui-kit/commit/ed5c500bd2e03de9c5a87e26b4edd159374c0273)) +- updated InputLabel with latest Radix label component ([#552](https://github.com/washingtonpost/wpds-ui-kit/issues/552)) ([2ca485f](https://github.com/washingtonpost/wpds-ui-kit/commit/2ca485f6be2da0627fad98f3961ab71afdb84b23)) +- v2 mass components upgrade/migration ([#578](https://github.com/washingtonpost/wpds-ui-kit/issues/578)) ([5e0394b](https://github.com/washingtonpost/wpds-ui-kit/commit/5e0394b4e6747bfd9fee1dc0bcd82d1dcb6cd9b6)), closes [#580](https://github.com/washingtonpost/wpds-ui-kit/issues/580) [#579](https://github.com/washingtonpost/wpds-ui-kit/issues/579) + +# [2.0.0-alpha.6](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2024-03-15) + +**Note:** Version bump only for package root + +# [2.0.0-alpha.5](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2024-03-15) + +**Note:** Version bump only for package root + +# [2.0.0-alpha.4](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2024-03-15) + +**Note:** Version bump only for package root + +# [2.0.0-alpha.3](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.6...v2.0.0-alpha.3) (2024-03-14) + +# [2.0.0-alpha.2](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-03-14) + +# [2.0.0-alpha.1](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.0...v2.0.0-alpha.1) (2024-03-14) + +# [2.0.0-alpha.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.1.0-experimental.1...v2.0.0-alpha.0) (2024-03-14) + +# [2.1.0-experimental.1](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.1.0-experimental.0...v2.1.0-experimental.1) (2024-03-13) + +# [2.1.0-experimental.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.0...v2.1.0-experimental.0) (2024-03-13) + +### Bug Fixes + +- i don't know how dialog went mising ([#579](https://github.com/washingtonpost/wpds-ui-kit/issues/579)) ([e783d0a](https://github.com/washingtonpost/wpds-ui-kit/commit/e783d0a9a132e67f9b35e1434998a9b163969e25)) +- merging main and resolving conflicts ([#585](https://github.com/washingtonpost/wpds-ui-kit/issues/585)) ([253effe](https://github.com/washingtonpost/wpds-ui-kit/commit/253effebcc310c6ceee9efbed2e346d7b3132691)) +- Playroom fix ([#583](https://github.com/washingtonpost/wpds-ui-kit/issues/583)) ([6b8c42b](https://github.com/washingtonpost/wpds-ui-kit/commit/6b8c42beb93fb2a0e391df6aad5da78cf40d92e3)) +- remove border for clear button on input search ([#560](https://github.com/washingtonpost/wpds-ui-kit/issues/560)) ([504b82f](https://github.com/washingtonpost/wpds-ui-kit/commit/504b82fa0a61249ccab701316ed04fda3077503c)) +- remove defaultOpen from kitchen sink Tooltip example to prevent client server mismatch ([df842ac](https://github.com/washingtonpost/wpds-ui-kit/commit/df842ac97cbd9f1c6a8a680f4cd9f926f7563fb7)) +- take latest minor of Radix accordion ([84f39d4](https://github.com/washingtonpost/wpds-ui-kit/commit/84f39d417b66125ba0efa54dadb08564b9538762)) + +### Features + +- card ([#564](https://github.com/washingtonpost/wpds-ui-kit/issues/564)) ([ce0b9db](https://github.com/washingtonpost/wpds-ui-kit/commit/ce0b9db6985f44d848b0bf38c259f04107f03344)) +- fresh install with updated node/npm ([#574](https://github.com/washingtonpost/wpds-ui-kit/issues/574)) ([848b697](https://github.com/washingtonpost/wpds-ui-kit/commit/848b697d97c6e98241b118ae24472a2fb7cede5a)) +- move Button, Icon, theme, and VisuallyHidden to v2 package ([#562](https://github.com/washingtonpost/wpds-ui-kit/issues/562)) ([be3524d](https://github.com/washingtonpost/wpds-ui-kit/commit/be3524d388e177023b9c476a68020a478a893f50)) +- remove nanoid dependency ([#555](https://github.com/washingtonpost/wpds-ui-kit/issues/555)) ([20f22d6](https://github.com/washingtonpost/wpds-ui-kit/commit/20f22d6a0869de6edb25312bb93638832320b82f)) +- update Accordion to React 18 ([#565](https://github.com/washingtonpost/wpds-ui-kit/issues/565)) ([672e239](https://github.com/washingtonpost/wpds-ui-kit/commit/672e23918d9989de9d1a8702d3880b3f4f0ac38f)) +- update package-lock ([ed5c500](https://github.com/washingtonpost/wpds-ui-kit/commit/ed5c500bd2e03de9c5a87e26b4edd159374c0273)) +- updated InputLabel with latest Radix label component ([#552](https://github.com/washingtonpost/wpds-ui-kit/issues/552)) ([2ca485f](https://github.com/washingtonpost/wpds-ui-kit/commit/2ca485f6be2da0627fad98f3961ab71afdb84b23)) +- v2 mass components upgrade/migration ([#578](https://github.com/washingtonpost/wpds-ui-kit/issues/578)) ([5e0394b](https://github.com/washingtonpost/wpds-ui-kit/commit/5e0394b4e6747bfd9fee1dc0bcd82d1dcb6cd9b6)), closes [#580](https://github.com/washingtonpost/wpds-ui-kit/issues/580) [#579](https://github.com/washingtonpost/wpds-ui-kit/issues/579) + +# [2.0.0-alpha.2](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-03-14) + +**Note:** Version bump only for package root + +# [2.0.0-alpha.1](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.0...v2.0.0-alpha.1) (2024-03-14) + +**Note:** Version bump only for package root + +# [2.0.0-alpha.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.1.0-experimental.0...v2.0.0-alpha.0) (2024-03-14) + +**Note:** Version bump only for package root + +# [1.24.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.23.1...v1.24.0) (2024-04-09) + +### Bug Fixes + +- remove global styles from wpds-tokens ([2886b69](https://github.com/washingtonpost/wpds-ui-kit/commit/2886b6921257daa54fca191c1c554f8830bf5bf0)) + +### Features + +- add v2 docs switcher ([#609](https://github.com/washingtonpost/wpds-ui-kit/issues/609)) ([49e35a1](https://github.com/washingtonpost/wpds-ui-kit/commit/49e35a13a67efaa5d64e457ac565f8b6970d0fd4)) + +## [1.23.1](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.23.0...v1.23.1) (2024-03-26) + +### Bug Fixes + +- ensure that dark theme colors get written into the dom ([#605](https://github.com/washingtonpost/wpds-ui-kit/issues/605)) ([9fb968e](https://github.com/washingtonpost/wpds-ui-kit/commit/9fb968e6ea78d2d657ef9f538decc0e2b25dcf35)) + +# [1.23.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.6...v1.23.0) (2024-03-25) + +### Bug Fixes + +- make input helper and error text block level elements for consistent formatting ([2640be2](https://github.com/washingtonpost/wpds-ui-kit/commit/2640be29f24f83199baa3c735bdd47c404dd700b)) +- transform select icon on open ([#596](https://github.com/washingtonpost/wpds-ui-kit/issues/596)) ([1f68ace](https://github.com/washingtonpost/wpds-ui-kit/commit/1f68acef8dd386267b9b30c650df6abe11b10954)) +- updated React types package to prevent type errors ([b647c60](https://github.com/washingtonpost/wpds-ui-kit/commit/b647c60662d9f75f8857f8f8205f5d4c04ba0cef)) + +### Features + +- increase the specificity of the wpds-dark selector to ensure it overrides light variables ([fd7748f](https://github.com/washingtonpost/wpds-ui-kit/commit/fd7748fa7386396fa13bb52d8d67a1c513ccc6a9)) + +## [1.22.6](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.5...v1.22.6) (2024-03-14) + +### Bug Fixes + +- readme changes ([035b5c8](https://github.com/washingtonpost/wpds-ui-kit/commit/035b5c8ce14f1994a0be0966e961e40ead24d339)) + +## [1.22.5](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.4...v1.22.5) (2024-03-14) + +**Note:** Version bump only for package root + +## [1.22.4](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.3...v1.22.4) (2024-03-14) + +### Bug Fixes + +- fixing formatting ([#589](https://github.com/washingtonpost/wpds-ui-kit/issues/589)) ([a717dbc](https://github.com/washingtonpost/wpds-ui-kit/commit/a717dbcd9dbc2c2e8619719692636f2287e556cd)) + +## [1.22.3](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.2...v1.22.3) (2024-03-14) + +### Bug Fixes + +- formatting ([#588](https://github.com/washingtonpost/wpds-ui-kit/issues/588)) ([d1e9ad4](https://github.com/washingtonpost/wpds-ui-kit/commit/d1e9ad4166881dea6a9df1ecd8a9d5f0e598efef)) + +## [1.22.2](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.1...v1.22.2) (2024-03-14) + +**Note:** Version bump only for package root + +## [1.22.1](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.0...v1.22.1) (2024-03-14) + +### Bug Fixes + +- Change forCards modifier to forSurfaces ([#576](https://github.com/washingtonpost/wpds-ui-kit/issues/576)) ([c5e0422](https://github.com/washingtonpost/wpds-ui-kit/commit/c5e04223fb2e7c40506751fda61a0a2844101e01)) +- cleaned up [STRY-70] ([007ae6a](https://github.com/washingtonpost/wpds-ui-kit/commit/007ae6a83ba26c53ce1d03bbf4dc035359563be0)) +- cleaned up again [STRY-70] ([95556bf](https://github.com/washingtonpost/wpds-ui-kit/commit/95556bf5f384d62e0523161a81af2cf62b4506ef)) +- Fixed onSurface to have the correct camel casing ([#571](https://github.com/washingtonpost/wpds-ui-kit/issues/571)) ([9daca60](https://github.com/washingtonpost/wpds-ui-kit/commit/9daca60f9c562aa2d697c8389d44d2ef491f1494)) +- ignoring .idea files [STRY-70] ([c686693](https://github.com/washingtonpost/wpds-ui-kit/commit/c686693d49c51b261bb36f134bdb834478c5be0b)) +- linting [STRY-70] ([63e8949](https://github.com/washingtonpost/wpds-ui-kit/commit/63e894934cda486b1d59477b5d60650d0e861893)) +- only add needed files [STRY-70] ([ca38fb2](https://github.com/washingtonpost/wpds-ui-kit/commit/ca38fb2a8f813a543908e9e96acb39115f419e4c)) +- update readme ([#587](https://github.com/washingtonpost/wpds-ui-kit/issues/587)) ([73b4b9e](https://github.com/washingtonpost/wpds-ui-kit/commit/73b4b9e3ac698cdca779cd0c49c490167e18180f)) + +# [1.22.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.21.0...v1.22.0) (2024-02-15) + +### Bug Fixes + +- reverted subtle and faint tokens ([#566](https://github.com/washingtonpost/wpds-ui-kit/issues/566)) ([b45b54a](https://github.com/washingtonpost/wpds-ui-kit/commit/b45b54ab27c3ea341893c79520fe44f3fd463baf)) + +### Features + +- remove search feature from docs site ([#569](https://github.com/washingtonpost/wpds-ui-kit/issues/569)) ([fa22045](https://github.com/washingtonpost/wpds-ui-kit/commit/fa22045fdb00ba1a823056da0ca24a9d938b3665)) + +# [1.21.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.20.0...v1.21.0) (2024-02-07) + +### Features + +- new dark mode colors and tokens ([#554](https://github.com/washingtonpost/wpds-ui-kit/issues/554)) ([39b0d45](https://github.com/washingtonpost/wpds-ui-kit/commit/39b0d45ebd0269843ff5c657e3ab4865f149bbec)) + +# [1.20.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.19.0...v1.20.0) (2024-01-24) + +### Bug Fixes + +- fixes a scrollbar issue with select and our header component ([#563](https://github.com/washingtonpost/wpds-ui-kit/issues/563)) ([1cfe566](https://github.com/washingtonpost/wpds-ui-kit/commit/1cfe5660e763c76beeedf7b19e2a1846110fce70)) + +### Features + +- add site footer back ([#558](https://github.com/washingtonpost/wpds-ui-kit/issues/558)) ([12cf193](https://github.com/washingtonpost/wpds-ui-kit/commit/12cf1936ac67c2791ff06efe6e45dbefca047909)) + +# [1.19.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.18.0...v1.19.0) (2024-01-10) + +### Bug Fixes + +- remove snow ([cdfae9e](https://github.com/washingtonpost/wpds-ui-kit/commit/cdfae9e75f680ba43edb250f441e40ab1b81e65b)) +- remove snow ([f0f45f7](https://github.com/washingtonpost/wpds-ui-kit/commit/f0f45f7c156df78c5c9dba6718403e926cacacbb)) +- remove tokens stylesheet ([16b4b71](https://github.com/washingtonpost/wpds-ui-kit/commit/16b4b7123db787ec9f9f74f9cfff962882cc7b2d)) + +### Features + +- add snowfall to website for fun ([#550](https://github.com/washingtonpost/wpds-ui-kit/issues/550)) ([3f907e4](https://github.com/washingtonpost/wpds-ui-kit/commit/3f907e42f5334c7e43d2ea415f4099be9d45a2df)) +- responsive screen size hook and css var ([#548](https://github.com/washingtonpost/wpds-ui-kit/issues/548)) ([5768e9c](https://github.com/washingtonpost/wpds-ui-kit/commit/5768e9c6357f1df43b9d92002e36bf2cadd171fa)) +- turn snow on ([5c88780](https://github.com/washingtonpost/wpds-ui-kit/commit/5c88780d5df3258d604c108cf680ce9108fdc452)) + +# [1.18.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.17.0...v1.18.0) (2023-12-13) + +### Bug Fixes + +- our lockfile area for build dot site was borked ([#547](https://github.com/washingtonpost/wpds-ui-kit/issues/547)) ([2a66631](https://github.com/washingtonpost/wpds-ui-kit/commit/2a66631d066b7128c4be209a60af0ad86fc528e9)) + +### Features + +- add Dialog component ([15d6206](https://github.com/washingtonpost/wpds-ui-kit/commit/15d6206d6287bb3eee3c9f0af8ff57a0bf917998)) +- bump wam to 1.24.0 ([#546](https://github.com/washingtonpost/wpds-ui-kit/issues/546)) ([d825acc](https://github.com/washingtonpost/wpds-ui-kit/commit/d825acca32c62e3c7295b7ed44ab641ba720cb7a)) + # [1.17.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.16.2...v1.17.0) (2023-11-30) ### Bug Fixes diff --git a/Makefile b/Makefile index c1bd0793a..3807c59e5 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ experimental-version: - npx lerna version --conventional-commits --conventional-prerelease --preid=experimental --sign-git-tag=experimental --no-changelog --yes --force-publish + npx lerna version prerelease --force-publish --preid=alpha --sign-git-tag=alpha experimental-publish: - npx lerna publish from-package --dist-tag experimental --yes --no-verify-access - + npx lerna publish from-package --dist-tag alpha + main-publish: npx lerna publish from-package --yes --no-git-reset --no-verify-access @@ -16,10 +16,15 @@ experimental-release: npm run turbo:build:force make experimental-publish +# checkout any uncommitted changes +boop-checkout: + git checkout . + # create main release main-release: make main-version npm run turbo:build:ui:force + make boop-checkout make main-publish npm install npm run format @@ -35,3 +40,9 @@ validate: npm run lint:check npm run format:check npm run test + +v2-migrate-component: + node scripts/move-component-to-new-dir.js $(componentName) + npx storybook@latest migrate csf-2-to-3 --glob="./packages/kit/src/$(componentName)/*.stories.tsx" + npx jscodeshift ./packages/kit/src/$(componentName) -t ./scripts/transform-wpds-imports.js --extensions=tsx + npx react-codemod update-react-imports ./packages/kit/src diff --git a/apps/nextjs13-approuter/.gitignore b/apps/nextjs13-approuter/.gitignore new file mode 100644 index 000000000..8f322f0d8 --- /dev/null +++ b/apps/nextjs13-approuter/.gitignore @@ -0,0 +1,35 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/apps/nextjs13-approuter/CHANGELOG.md b/apps/nextjs13-approuter/CHANGELOG.md new file mode 100644 index 000000000..73a2fb014 --- /dev/null +++ b/apps/nextjs13-approuter/CHANGELOG.md @@ -0,0 +1,84 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [2.0.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.24.0...v2.0.0) (2024-04-24) + +### Features + +- v2.0.0 ([#542](https://github.com/washingtonpost/wpds-ui-kit/issues/542)) ([d429cfa](https://github.com/washingtonpost/wpds-ui-kit/commit/d429cfabb7489a2548ffad5c3d945145824d4a22)), closes [#544](https://github.com/washingtonpost/wpds-ui-kit/issues/544) [#552](https://github.com/washingtonpost/wpds-ui-kit/issues/552) [#555](https://github.com/washingtonpost/wpds-ui-kit/issues/555) [#560](https://github.com/washingtonpost/wpds-ui-kit/issues/560) [#562](https://github.com/washingtonpost/wpds-ui-kit/issues/562) [#564](https://github.com/washingtonpost/wpds-ui-kit/issues/564) [#565](https://github.com/washingtonpost/wpds-ui-kit/issues/565) [#574](https://github.com/washingtonpost/wpds-ui-kit/issues/574) [#570](https://github.com/washingtonpost/wpds-ui-kit/issues/570) [#579](https://github.com/washingtonpost/wpds-ui-kit/issues/579) [#578](https://github.com/washingtonpost/wpds-ui-kit/issues/578) [#580](https://github.com/washingtonpost/wpds-ui-kit/issues/580) [#579](https://github.com/washingtonpost/wpds-ui-kit/issues/579) + +# [2.0.0-alpha.12](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.11...v2.0.0-alpha.12) (2024-04-10) + +**Note:** Version bump only for package nextjs13-approuter + +# [2.0.0-alpha.11](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.10...v2.0.0-alpha.11) (2024-04-09) + +**Note:** Version bump only for package nextjs13-approuter + +# [2.0.0-alpha.10](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.7...v2.0.0-alpha.10) (2024-04-09) + +**Note:** Version bump only for package nextjs13-approuter + +# [2.0.0-alpha.9](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.7...v2.0.0-alpha.9) (2024-04-09) + +**Note:** Version bump only for package nextjs13-approuter + +# [2.0.0-alpha.8](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.7...v2.0.0-alpha.8) (2024-04-04) + +**Note:** Version bump only for package nextjs13-approuter + +# [2.0.0-alpha.7](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.6...v2.0.0-alpha.7) (2024-04-02) + +# [2.0.0-alpha.2](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-03-14) + +# [2.0.0-alpha.1](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.0...v2.0.0-alpha.1) (2024-03-14) + +# [2.0.0-alpha.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.1.0-experimental.0...v2.0.0-alpha.0) (2024-03-14) + +# [2.1.0-experimental.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.0...v2.1.0-experimental.0) (2024-03-13) + +### Features + +- v2 mass components upgrade/migration ([#578](https://github.com/washingtonpost/wpds-ui-kit/issues/578)) ([5e0394b](https://github.com/washingtonpost/wpds-ui-kit/commit/5e0394b4e6747bfd9fee1dc0bcd82d1dcb6cd9b6)), closes [#580](https://github.com/washingtonpost/wpds-ui-kit/issues/580) [#579](https://github.com/washingtonpost/wpds-ui-kit/issues/579) + +# [2.0.0-alpha.6](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2024-03-15) + +**Note:** Version bump only for package nextjs13-approuter + +# [2.0.0-alpha.5](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2024-03-15) + +**Note:** Version bump only for package nextjs13-approuter + +# [2.0.0-alpha.4](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2024-03-15) + +**Note:** Version bump only for package nextjs13-approuter + +# [2.0.0-alpha.3](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.6...v2.0.0-alpha.3) (2024-03-14) + +# [2.0.0-alpha.2](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-03-14) + +# [2.0.0-alpha.1](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.0...v2.0.0-alpha.1) (2024-03-14) + +# [2.0.0-alpha.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.1.0-experimental.1...v2.0.0-alpha.0) (2024-03-14) + +# [2.1.0-experimental.1](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.1.0-experimental.0...v2.1.0-experimental.1) (2024-03-13) + +# [2.1.0-experimental.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v1.22.0...v2.1.0-experimental.0) (2024-03-13) + +### Features + +- v2 mass components upgrade/migration ([#578](https://github.com/washingtonpost/wpds-ui-kit/issues/578)) ([5e0394b](https://github.com/washingtonpost/wpds-ui-kit/commit/5e0394b4e6747bfd9fee1dc0bcd82d1dcb6cd9b6)), closes [#580](https://github.com/washingtonpost/wpds-ui-kit/issues/580) [#579](https://github.com/washingtonpost/wpds-ui-kit/issues/579) + +# [2.0.0-alpha.2](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2024-03-14) + +**Note:** Version bump only for package nextjs13-approuter + +# [2.0.0-alpha.1](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.0.0-alpha.0...v2.0.0-alpha.1) (2024-03-14) + +**Note:** Version bump only for package nextjs13-approuter + +# [2.0.0-alpha.0](https://github.com/washingtonpost/wpds-ui-kit/compare/v2.1.0-experimental.0...v2.0.0-alpha.0) (2024-03-14) + +**Note:** Version bump only for package nextjs13-approuter diff --git a/apps/nextjs13-approuter/README.md b/apps/nextjs13-approuter/README.md new file mode 100644 index 000000000..376cab465 --- /dev/null +++ b/apps/nextjs13-approuter/README.md @@ -0,0 +1 @@ +# Next.js 13 App Router Test App diff --git a/apps/nextjs13-approuter/next.config.js b/apps/nextjs13-approuter/next.config.js new file mode 100644 index 000000000..658404ac6 --- /dev/null +++ b/apps/nextjs13-approuter/next.config.js @@ -0,0 +1,4 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = {}; + +module.exports = nextConfig; diff --git a/apps/nextjs13-approuter/package.json b/apps/nextjs13-approuter/package.json new file mode 100644 index 000000000..7f3aa2929 --- /dev/null +++ b/apps/nextjs13-approuter/package.json @@ -0,0 +1,18 @@ +{ + "name": "nextjs13-approuter", + "version": "2.0.0", + "private": true, + "scripts": { + "dev": "next dev", + "build-no": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "@washingtonpost/wpds-kitchen-sink": "2.0.0", + "@washingtonpost/wpds-ui-kit": "2.0.0", + "next": "13.5.6", + "react": "^18.2.0", + "react-dom": "^18.2.0" + } +} diff --git a/apps/nextjs13-approuter/src/app/layout.js b/apps/nextjs13-approuter/src/app/layout.js new file mode 100644 index 000000000..0f72f5a0f --- /dev/null +++ b/apps/nextjs13-approuter/src/app/layout.js @@ -0,0 +1,12 @@ +import React from "react"; +import StitchesRegistry from "./registry"; + +export default function RootLayout({ children }) { + return ( + + + {children} + + + ); +} diff --git a/apps/nextjs13-approuter/src/app/page.js b/apps/nextjs13-approuter/src/app/page.js new file mode 100644 index 000000000..1f2a3943a --- /dev/null +++ b/apps/nextjs13-approuter/src/app/page.js @@ -0,0 +1,8 @@ +"use client"; + +import React from "react"; +import { KitchenSink } from "@washingtonpost/wpds-kitchen-sink"; + +export default function Home() { + return ; +} diff --git a/apps/nextjs13-approuter/src/app/registry.js b/apps/nextjs13-approuter/src/app/registry.js new file mode 100644 index 000000000..7fa90b078 --- /dev/null +++ b/apps/nextjs13-approuter/src/app/registry.js @@ -0,0 +1,16 @@ +"use client"; + +import React from "react"; +import { useServerInsertedHTML } from "next/navigation"; +import { getCssText, globalCss } from "@washingtonpost/wpds-ui-kit"; + +export default function StitchesRegistry({ children }) { + useServerInsertedHTML(() => { + globalCss(); + return ( +