diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 42b2d9b3c5..04181d6541 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -9,4 +9,4 @@ # Resources # - [CODEOWNERS] https://help.github.com/articles/about-codeowners -* @okta/design-system @ganeshsomasundaram-okta @KevinGhadyani-Okta @odyssey-okta +* @okta/design-system @ganeshsomasundaram-okta @KevinGhadyani-Okta @odyssey-okta @kamronbatmanghelich-okta \ No newline at end of file diff --git a/.gitignore b/.gitignore index bf25ec00fa..52eb23d4d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ .DS_Store -dist +dist/ +dist-composite/ node_modules/ npm-debug.log package-lock.json -storybook-static +storybook-static/ yarn-error.log **/coverage .pnp.* diff --git a/.prettierignore b/.prettierignore index 6625fd8d96..8488355786 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,11 +1,18 @@ .DS_Store -dist +dist/ +dist-composite/ node_modules/ npm-debug.log package-lock.json -storybook-static +storybook-static/ yarn-error.log **/coverage .pnp.* .yarn/* -.git/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions +packages/odyssey-react/src/components/PasswordInput/PasswordInput.tsx +packages/odyssey-react/src/components/SearchInput/SearchInput.tsx \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b63920d6e..70ea2ef607 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,21 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +### Features + +- **odyssey-icons:** add eye and eye off icons ([d44a241](https://github.com/okta/odyssey/commit/d44a241537fa84fcf7679b7e96e52655d83d846f)) +- **odyssey-react-mui:** add Infobox theme for Alert ([d92c896](https://github.com/okta/odyssey/commit/d92c89623451fb947cb0786367aeec9c02966cbc)) +- **odyssey-react-mui:** add theme for Checkbox, Radio, Labels, Hints ([a7ed02a](https://github.com/okta/odyssey/commit/a7ed02a79340c32920da92da4947a068ac44c2fd)) +- **odyssey-react-mui:** utilize color tokens for Palette, add lighter ([639549c](https://github.com/okta/odyssey/commit/639549c92f0b2644d347004f4ec801684cba13bf)) + +### Bug Fixes + +- **odyssey-react-mui:** button danger disabled style ([dd2d344](https://github.com/okta/odyssey/commit/dd2d344e724d79fbc9e915390c7406cafee7279a)) +- **odyssey-react-mui:** button prop serialization ([8092a2c](https://github.com/okta/odyssey/commit/8092a2c5c044b98613555805dd9e89581f7174bd)) +- **odyssey-storybook:** fix font-family display in MUI components ([91a80c1](https://github.com/okta/odyssey/commit/91a80c1fbc1c94875bf83fde33296f22a81dedf1)) + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) ### Features diff --git a/README.md b/README.md index 1adac3f12c..c6e7c2593a 100644 --- a/README.md +++ b/README.md @@ -4,19 +4,19 @@ Build and design consistent, efficient, and accessible UIs for all Okta users. ## Packages -| Package/README | Description | -| ------------------------------------------------------------------------------------------------------------------------------- | -------------------- | -| [@okta/odyssey-design-tokens](https://github.com/okta/odyssey/blob/master/packages/odyssey-design-tokens/README.md) | Design tokens | -| [@okta/browserslist-config-odyssey](https://github.com/okta/odyssey/blob/master/packages/browserslist-config-odyssey/README.md) | Browserslist config | -| [@okta/odyssey-postcss-scss](https://github.com/okta/odyssey/blob/master/packages/odyssey-postcss-scss/README.md) | Postcss scss plugin | -| [@okta/odyssey-postcss-theme](https://github.com/okta/odyssey/blob/master/packages/odyssey-postcss-theme/README.md) | Postcss theme plugin | -| [@okta/odyssey-postcss-preset](https://github.com/okta/odyssey/blob/master/packages/odyssey-postcss-preset/README.md) | Postcss preset | -| [@okta/odyssey-babel-plugin](https://github.com/okta/odyssey/blob/master/packages/odyssey-babel-plugin/README.md) | Babel plugin | -| [@okta/odyssey-babel-preset](https://github.com/okta/odyssey/blob/master/packages/odyssey-babel-preset/README.md) | Babel preset | -| [@okta/odyssey-babel-loader](https://github.com/okta/odyssey/blob/master/packages/odyssey-babel-loader/README.md) | Babel webpack loader | -| [@okta/odyssey-react-theme](https://github.com/okta/odyssey/blob/master/packages/odyssey-react-theme/README.md) | React theme logic | -| [@okta/odyssey-react](https://github.com/okta/odyssey/blob/master/packages/odyssey-react/README.md) | React components | -| [@okta/odyssey-react-mui](https://github.com/okta/odyssey/blob/master/packages/odyssey-react-mui/README.md) | React MUI components | +| Package/README | Description | +| ------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | +| [@okta/odyssey-design-tokens](https://github.com/okta/odyssey/blob/master/packages/odyssey-design-tokens/README.md) | Design tokens | +| [@okta/browserslist-config-odyssey](https://github.com/okta/odyssey/blob/master/packages/browserslist-config-odyssey/README.md) | Browserslist config | +| [@okta/odyssey-postcss-scss](https://github.com/okta/odyssey/blob/master/packages/odyssey-postcss-scss/README.md) | Postcss scss plugin | +| [@okta/odyssey-postcss-theme](https://github.com/okta/odyssey/blob/master/packages/odyssey-postcss-theme/README.md) | Postcss theme plugin | +| [@okta/odyssey-postcss-preset](https://github.com/okta/odyssey/blob/master/packages/odyssey-postcss-preset/README.md) | Postcss preset | +| [@okta/odyssey-babel-plugin](https://github.com/okta/odyssey/blob/master/packages/odyssey-babel-plugin/README.md) | Babel plugin | +| [@okta/odyssey-babel-preset](https://github.com/okta/odyssey/blob/master/packages/odyssey-babel-preset/README.md) | Babel preset | +| [@okta/odyssey-babel-loader](https://github.com/okta/odyssey/blob/master/packages/odyssey-babel-loader/README.md) | Babel webpack loader | +| [@okta/odyssey-react-theme](https://github.com/okta/odyssey/blob/master/packages/odyssey-react-theme/README.md) | React theme logic | +| [@okta/odyssey-react](https://github.com/okta/odyssey/blob/master/packages/odyssey-react/README.md) | React components (Deprecated) | +| [@okta/odyssey-react-mui](https://github.com/okta/odyssey/blob/master/packages/odyssey-react-mui/README.md) | React MUI components | ## Browser Support diff --git a/lerna.json b/lerna.json index 6b7ea7ced9..c5966cce38 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.14.1", + "version": "0.14.2", "npmClient": "yarn", "changelogPreset": "@okta/conventional-changelog-odyssey", "useWorkspaces": true, diff --git a/package.json b/package.json index 196f1ab12d..eba03d76d1 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,8 @@ "lerna-version": "lerna version --no-git-tag-version --include-merged-tags --conventional-commits --no-push --force-publish", "lerna-publish": "lerna publish from-package --no-push --force-publish --no-verify-access --no-verify-registry", "lint": "yarn eslint && yarn stylelint && yarn prettier-check", - "prettier-check": "prettier --no-config --ignore-unknown --loglevel warn --check .", - "prettier-write": "prettier --no-config --ignore-unknown --loglevel warn --write .", + "prettier-check": "prettier --ignore-unknown --loglevel warn --check .", + "prettier-write": "prettier --ignore-unknown --loglevel warn --write .", "eslint": "eslint . --ext .js,.jsx,.ts,.tsx", "stylelint": "stylelint **/*.scss", "test": "lerna run test", @@ -30,10 +30,10 @@ }, "devDependencies": { "@commitlint/cli": "^14.0.0", - "@okta/odyssey-commitlint": "^0.14.1", - "@okta/odyssey-eslint-config": "^0.14.1", - "@okta/odyssey-lint-staged": "^0.14.1", - "@okta/odyssey-stylelint": "^0.14.1", + "@okta/odyssey-commitlint": "^0.14.2", + "@okta/odyssey-eslint-config": "^0.14.2", + "@okta/odyssey-lint-staged": "^0.14.2", + "@okta/odyssey-stylelint": "^0.14.2", "eslint": "^7.27.0", "husky": "^7.0.2", "lerna": "4.0.0", diff --git a/packages/babel-plugin-fully-specified/CHANGELOG.md b/packages/babel-plugin-fully-specified/CHANGELOG.md index f977b1d80f..0f5807fbd4 100644 --- a/packages/babel-plugin-fully-specified/CHANGELOG.md +++ b/packages/babel-plugin-fully-specified/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/babel-plugin-fully-specified + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/babel-plugin-fully-specified diff --git a/packages/babel-plugin-fully-specified/package.json b/packages/babel-plugin-fully-specified/package.json index e8a29a6297..6fbbc81d62 100644 --- a/packages/babel-plugin-fully-specified/package.json +++ b/packages/babel-plugin-fully-specified/package.json @@ -1,6 +1,6 @@ { "name": "@okta/babel-plugin-fully-specified", - "version": "0.14.1", + "version": "0.14.2", "private": true, "description": "Babel plugin to generate fully specified ESM module syntax", "author": "Okta, Inc.", @@ -22,8 +22,8 @@ }, "devDependencies": { "@babel/core": "^7.15.0", - "@okta/odyssey-lifecycle": "^0.14.1", - "@okta/odyssey-typescript": "^0.14.1", + "@okta/odyssey-lifecycle": "^0.14.2", + "@okta/odyssey-typescript": "^0.14.2", "babel-jest": "^26.6.3", "jest": "^26.6.3", "typescript": "^4.4.4" diff --git a/packages/browserslist-config-odyssey/CHANGELOG.md b/packages/browserslist-config-odyssey/CHANGELOG.md index c18d360c59..53c88a28ef 100644 --- a/packages/browserslist-config-odyssey/CHANGELOG.md +++ b/packages/browserslist-config-odyssey/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/browserslist-config-odyssey + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/browserslist-config-odyssey diff --git a/packages/browserslist-config-odyssey/package.json b/packages/browserslist-config-odyssey/package.json index c6b705140c..26c9341df9 100644 --- a/packages/browserslist-config-odyssey/package.json +++ b/packages/browserslist-config-odyssey/package.json @@ -1,6 +1,6 @@ { "name": "@okta/browserslist-config-odyssey", - "version": "0.14.1", + "version": "0.14.2", "description": "Browserslist config for Odyssey, Okta's design system", "author": "Okta, Inc.", "license": "Apache-2.0", @@ -16,8 +16,8 @@ "prepack": "yarn exec prepack" }, "devDependencies": { - "@okta/odyssey-lifecycle": "^0.14.1", - "@okta/odyssey-typescript": "^0.14.1", + "@okta/odyssey-lifecycle": "^0.14.2", + "@okta/odyssey-typescript": "^0.14.2", "typescript": "^4.4.4" } } diff --git a/packages/conventional-changelog-odyssey/CHANGELOG.md b/packages/conventional-changelog-odyssey/CHANGELOG.md index f0a60c7e7c..4ce224c351 100644 --- a/packages/conventional-changelog-odyssey/CHANGELOG.md +++ b/packages/conventional-changelog-odyssey/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/conventional-changelog-odyssey + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/conventional-changelog-odyssey diff --git a/packages/conventional-changelog-odyssey/package.json b/packages/conventional-changelog-odyssey/package.json index fa8e047cfb..1f766500bb 100644 --- a/packages/conventional-changelog-odyssey/package.json +++ b/packages/conventional-changelog-odyssey/package.json @@ -1,6 +1,6 @@ { "name": "@okta/conventional-changelog-odyssey", - "version": "0.14.1", + "version": "0.14.2", "main": "index.js", "author": "Okta, Inc.", "license": "Apache-2.0", diff --git a/packages/eslint-plugin-odyssey/CHANGELOG.md b/packages/eslint-plugin-odyssey/CHANGELOG.md index a13ff373cf..235f2c8aac 100644 --- a/packages/eslint-plugin-odyssey/CHANGELOG.md +++ b/packages/eslint-plugin-odyssey/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/eslint-plugin-odyssey + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/eslint-plugin-odyssey diff --git a/packages/eslint-plugin-odyssey/package.json b/packages/eslint-plugin-odyssey/package.json index aa7ea5d735..6e16ccf3a5 100644 --- a/packages/eslint-plugin-odyssey/package.json +++ b/packages/eslint-plugin-odyssey/package.json @@ -1,6 +1,6 @@ { "name": "@okta/eslint-plugin-odyssey", - "version": "0.14.1", + "version": "0.14.2", "main": "src/index.js", "author": "Okta, Inc.", "license": "Apache-2.0", diff --git a/packages/odyssey-babel-loader/CHANGELOG.md b/packages/odyssey-babel-loader/CHANGELOG.md index ab0a604f81..df5af6a478 100644 --- a/packages/odyssey-babel-loader/CHANGELOG.md +++ b/packages/odyssey-babel-loader/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/odyssey-babel-loader + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-babel-loader diff --git a/packages/odyssey-babel-loader/package.json b/packages/odyssey-babel-loader/package.json index a08cd0ba53..c33b8e0149 100644 --- a/packages/odyssey-babel-loader/package.json +++ b/packages/odyssey-babel-loader/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-babel-loader", - "version": "0.14.1", + "version": "0.14.2", "description": "Babel webpack loader for Odyssey, Okta's design system", "author": "Okta, Inc.", "license": "Apache-2.0", @@ -19,7 +19,7 @@ }, "devDependencies": { "@babel/core": "^7.15.0", - "@okta/odyssey-lifecycle": "^0.14.1", + "@okta/odyssey-lifecycle": "^0.14.2", "webpack": "4.46.0" } } diff --git a/packages/odyssey-babel-plugin/CHANGELOG.md b/packages/odyssey-babel-plugin/CHANGELOG.md index 8722f7d336..163357fbbc 100644 --- a/packages/odyssey-babel-plugin/CHANGELOG.md +++ b/packages/odyssey-babel-plugin/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/odyssey-babel-plugin + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-babel-plugin diff --git a/packages/odyssey-babel-plugin/package.json b/packages/odyssey-babel-plugin/package.json index 1b029373eb..fb8ea0d892 100644 --- a/packages/odyssey-babel-plugin/package.json +++ b/packages/odyssey-babel-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-babel-plugin", - "version": "0.14.1", + "version": "0.14.2", "description": "Babel plugin for Odyssey, Okta's design system", "author": "Okta, Inc.", "license": "Apache-2.0", @@ -23,9 +23,9 @@ }, "devDependencies": { "@babel/core": "^7.15.0", - "@okta/odyssey-lifecycle": "^0.14.1", - "@okta/odyssey-postcss-preset": "^0.14.1", - "@okta/odyssey-typescript": "^0.14.1", + "@okta/odyssey-lifecycle": "^0.14.2", + "@okta/odyssey-postcss-preset": "^0.14.2", + "@okta/odyssey-typescript": "^0.14.2", "babel-jest": "^26.6.3", "jest": "^26.6.3", "postcss": "^8.3.6", diff --git a/packages/odyssey-babel-preset/CHANGELOG.md b/packages/odyssey-babel-preset/CHANGELOG.md index df2865b301..2a19e87d6b 100644 --- a/packages/odyssey-babel-preset/CHANGELOG.md +++ b/packages/odyssey-babel-preset/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/odyssey-babel-preset + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-babel-preset diff --git a/packages/odyssey-babel-preset/package.json b/packages/odyssey-babel-preset/package.json index 0f7c98f015..eea7b49237 100644 --- a/packages/odyssey-babel-preset/package.json +++ b/packages/odyssey-babel-preset/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-babel-preset", - "version": "0.14.1", + "version": "0.14.2", "description": "Babel preset for Odyssey, Okta's design system", "author": "Okta, Inc.", "license": "Apache-2.0", @@ -20,11 +20,11 @@ "@babel/preset-env": "^7.15.0", "@babel/preset-react": "^7.14.5", "@babel/preset-typescript": "^7.15.0", - "@okta/odyssey-babel-plugin": "^0.14.1" + "@okta/odyssey-babel-plugin": "^0.14.2" }, "devDependencies": { - "@okta/odyssey-lifecycle": "^0.14.1", - "@okta/odyssey-typescript": "^0.14.1", + "@okta/odyssey-lifecycle": "^0.14.2", + "@okta/odyssey-typescript": "^0.14.2", "@types/babel__core": "^7.1.15", "typescript": "^4.4.4" } diff --git a/packages/odyssey-commitlint/CHANGELOG.md b/packages/odyssey-commitlint/CHANGELOG.md index b05d67aa0b..48c2bdfa29 100644 --- a/packages/odyssey-commitlint/CHANGELOG.md +++ b/packages/odyssey-commitlint/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/odyssey-commitlint + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-commitlint diff --git a/packages/odyssey-commitlint/package.json b/packages/odyssey-commitlint/package.json index b3ccf5f127..c5901d24b7 100644 --- a/packages/odyssey-commitlint/package.json +++ b/packages/odyssey-commitlint/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-commitlint", - "version": "0.14.1", + "version": "0.14.2", "main": "src/index.js", "author": "Okta, Inc.", "license": "Apache-2.0", diff --git a/packages/odyssey-design-tokens/CHANGELOG.md b/packages/odyssey-design-tokens/CHANGELOG.md index dcaf445520..97fc5d4f99 100644 --- a/packages/odyssey-design-tokens/CHANGELOG.md +++ b/packages/odyssey-design-tokens/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/odyssey-design-tokens + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-design-tokens diff --git a/packages/odyssey-design-tokens/package.json b/packages/odyssey-design-tokens/package.json index 72807ac9bd..92142ee6a6 100644 --- a/packages/odyssey-design-tokens/package.json +++ b/packages/odyssey-design-tokens/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-design-tokens", - "version": "0.14.1", + "version": "0.14.2", "description": "Design tokens for Odyssey, Okta's design system", "author": "Okta, Inc.", "license": "Apache-2.0", @@ -20,7 +20,7 @@ "directory": "packages/odyssey-design-tokens" }, "devDependencies": { - "@okta/odyssey-lifecycle": "^0.14.1", + "@okta/odyssey-lifecycle": "^0.14.2", "style-dictionary": "^3.0.1" }, "scripts": { diff --git a/packages/odyssey-eslint-config/CHANGELOG.md b/packages/odyssey-eslint-config/CHANGELOG.md index 8680da70fc..76840d8132 100644 --- a/packages/odyssey-eslint-config/CHANGELOG.md +++ b/packages/odyssey-eslint-config/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/odyssey-eslint-config + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-eslint-config diff --git a/packages/odyssey-eslint-config/package.json b/packages/odyssey-eslint-config/package.json index 5dbf4d3515..fbae9c19bb 100644 --- a/packages/odyssey-eslint-config/package.json +++ b/packages/odyssey-eslint-config/package.json @@ -1,12 +1,12 @@ { "name": "@okta/odyssey-eslint-config", - "version": "0.14.1", + "version": "0.14.2", "main": "src/index.js", "author": "Okta, Inc.", "license": "Apache-2.0", "private": true, "dependencies": { - "@okta/eslint-plugin-odyssey": "^0.14.1", + "@okta/eslint-plugin-odyssey": "^0.14.2", "@typescript-eslint/eslint-plugin": "^4.31.1", "@typescript-eslint/parser": "^4.31.1", "eslint-config-prettier": "^8.3.0", diff --git a/packages/odyssey-eslint-config/src/index.js b/packages/odyssey-eslint-config/src/index.js index aaf47696e3..8e1c0d54eb 100644 --- a/packages/odyssey-eslint-config/src/index.js +++ b/packages/odyssey-eslint-config/src/index.js @@ -23,7 +23,7 @@ module.exports = { ecmaVersion: 2018, sourceType: "module", }, - ignorePatterns: ["node_modules", "dist"], + ignorePatterns: ["node_modules", "dist", "dist-composite"], plugins: ["header", "import", "@okta/odyssey"], rules: { "header/header": [ diff --git a/packages/odyssey-icons/CHANGELOG.md b/packages/odyssey-icons/CHANGELOG.md index d837171a74..63186a34b4 100644 --- a/packages/odyssey-icons/CHANGELOG.md +++ b/packages/odyssey-icons/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +### Features + +- **odyssey-icons:** add eye and eye off icons ([d44a241](https://github.com/okta/odyssey/commit/d44a241537fa84fcf7679b7e96e52655d83d846f)) + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-icons diff --git a/packages/odyssey-icons/figma/eye-off.svg b/packages/odyssey-icons/figma/eye-off.svg new file mode 100644 index 0000000000..25bb430fd2 --- /dev/null +++ b/packages/odyssey-icons/figma/eye-off.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/odyssey-icons/figma/eye.svg b/packages/odyssey-icons/figma/eye.svg new file mode 100644 index 0000000000..941a63f537 --- /dev/null +++ b/packages/odyssey-icons/figma/eye.svg @@ -0,0 +1,3 @@ + + + diff --git a/packages/odyssey-icons/package.json b/packages/odyssey-icons/package.json index 0fe4c4dd3b..9dec95bcbf 100644 --- a/packages/odyssey-icons/package.json +++ b/packages/odyssey-icons/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-icons", - "version": "0.14.1", + "version": "0.14.2", "private": true, "description": "The home for Odyssey's supported icons.", "homepage": "https://github.com/okta/odyssey", diff --git a/packages/odyssey-icons/src/eye-off.svg b/packages/odyssey-icons/src/eye-off.svg new file mode 100644 index 0000000000..48b3c4e79c --- /dev/null +++ b/packages/odyssey-icons/src/eye-off.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/odyssey-icons/src/eye.svg b/packages/odyssey-icons/src/eye.svg new file mode 100644 index 0000000000..eb807bb54b --- /dev/null +++ b/packages/odyssey-icons/src/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/odyssey-ie-11-sandbox/CHANGELOG.md b/packages/odyssey-ie-11-sandbox/CHANGELOG.md index a1066f5150..892858b9db 100644 --- a/packages/odyssey-ie-11-sandbox/CHANGELOG.md +++ b/packages/odyssey-ie-11-sandbox/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/odyssey-ie-11-sandbox + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-ie-11-sandbox diff --git a/packages/odyssey-ie-11-sandbox/package.json b/packages/odyssey-ie-11-sandbox/package.json index 52cf816d2c..6a6ece7691 100644 --- a/packages/odyssey-ie-11-sandbox/package.json +++ b/packages/odyssey-ie-11-sandbox/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-ie-11-sandbox", - "version": "0.14.1", + "version": "0.14.2", "private": true, "description": "Testing for IE11", "author": "Okta, Inc.", @@ -17,7 +17,7 @@ "build": "webpack --mode production" }, "dependencies": { - "@okta/odyssey-react": "^0.14.1", + "@okta/odyssey-react": "^0.14.2", "core-js": "^3.21.0", "proxy-polyfill": "^0.3.2", "react": "^17.0.2", @@ -28,8 +28,8 @@ "@babel/preset-env": "7.15.0", "@babel/preset-react": "7.14.5", "@babel/preset-typescript": "7.15.0", - "@okta/browserslist-config-odyssey": "^0.14.1", - "@okta/odyssey-babel-preset": "^0.14.1", + "@okta/browserslist-config-odyssey": "^0.14.2", + "@okta/odyssey-babel-preset": "^0.14.2", "babel-loader": "8.2.2", "css-loader": "3.6.0", "html-webpack-plugin": "4.5.2", diff --git a/packages/odyssey-lifecycle/CHANGELOG.md b/packages/odyssey-lifecycle/CHANGELOG.md index 2cc68fbb19..e18cffe6c8 100644 --- a/packages/odyssey-lifecycle/CHANGELOG.md +++ b/packages/odyssey-lifecycle/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/odyssey-lifecycle + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-lifecycle diff --git a/packages/odyssey-lifecycle/package.json b/packages/odyssey-lifecycle/package.json index 9c66a64242..92dd0f4bca 100644 --- a/packages/odyssey-lifecycle/package.json +++ b/packages/odyssey-lifecycle/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-lifecycle", - "version": "0.14.1", + "version": "0.14.2", "description": "Lifecycle scripts for lerna and npm", "author": "Okta, Inc.", "license": "Apache-2.0", diff --git a/packages/odyssey-lint-staged/CHANGELOG.md b/packages/odyssey-lint-staged/CHANGELOG.md index 642c928042..f1d1f93cf3 100644 --- a/packages/odyssey-lint-staged/CHANGELOG.md +++ b/packages/odyssey-lint-staged/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +### Features + +- **odyssey-icons:** add eye and eye off icons ([d44a241](https://github.com/okta/odyssey/commit/d44a241537fa84fcf7679b7e96e52655d83d846f)) + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-lint-staged diff --git a/packages/odyssey-lint-staged/package.json b/packages/odyssey-lint-staged/package.json index 2fac6cca89..ded446933d 100644 --- a/packages/odyssey-lint-staged/package.json +++ b/packages/odyssey-lint-staged/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-lint-staged", - "version": "0.14.1", + "version": "0.14.2", "main": "src/index.js", "author": "Okta, Inc.", "license": "Apache-2.0", diff --git a/packages/odyssey-lint-staged/src/index.js b/packages/odyssey-lint-staged/src/index.js index a496a2590d..488a3bae69 100644 --- a/packages/odyssey-lint-staged/src/index.js +++ b/packages/odyssey-lint-staged/src/index.js @@ -11,7 +11,7 @@ */ module.exports = { - "*": "prettier --no-config --ignore-unknown --loglevel warn --write", + "*": "prettier --ignore-unknown --loglevel warn --write", "*.scss": "stylelint", "*.{js,jsx,ts,tsx}": "eslint", }; diff --git a/packages/odyssey-postcss-preset/CHANGELOG.md b/packages/odyssey-postcss-preset/CHANGELOG.md index 6a187b8889..b0b6980fdb 100644 --- a/packages/odyssey-postcss-preset/CHANGELOG.md +++ b/packages/odyssey-postcss-preset/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/odyssey-postcss-preset + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-postcss-preset diff --git a/packages/odyssey-postcss-preset/package.json b/packages/odyssey-postcss-preset/package.json index 95e9a3d1e6..ca10f82fea 100644 --- a/packages/odyssey-postcss-preset/package.json +++ b/packages/odyssey-postcss-preset/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-postcss-preset", - "version": "0.14.1", + "version": "0.14.2", "description": "Postcss preset for Odyssey, Okta's design system", "author": "Okta, Inc.", "license": "Apache-2.0", @@ -17,7 +17,7 @@ "prepack": "yarn exec prepack" }, "dependencies": { - "@okta/odyssey-postcss-theme": "^0.14.1", + "@okta/odyssey-postcss-theme": "^0.14.2", "autoprefixer": "^10.3.4", "cssnano": "^5.0.8", "loader-utils": "^1.4.0", @@ -25,8 +25,8 @@ "postcss-modules": "^4.2.2" }, "devDependencies": { - "@okta/odyssey-lifecycle": "^0.14.1", - "@okta/odyssey-typescript": "^0.14.1", + "@okta/odyssey-lifecycle": "^0.14.2", + "@okta/odyssey-typescript": "^0.14.2", "@types/cssnano": "^4.0.1", "jest": "^26.6.3", "typescript": "^4.4.4" diff --git a/packages/odyssey-postcss-scss/CHANGELOG.md b/packages/odyssey-postcss-scss/CHANGELOG.md index a9a92fda90..e2af6a43dc 100644 --- a/packages/odyssey-postcss-scss/CHANGELOG.md +++ b/packages/odyssey-postcss-scss/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/odyssey-postcss-scss + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-postcss-scss diff --git a/packages/odyssey-postcss-scss/package.json b/packages/odyssey-postcss-scss/package.json index d828d934f7..fd9d9a7bf4 100644 --- a/packages/odyssey-postcss-scss/package.json +++ b/packages/odyssey-postcss-scss/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-postcss-scss", - "version": "0.14.1", + "version": "0.14.2", "description": "Postcss scss plugin for Odyssey, Okta's design system", "author": "Okta, Inc.", "license": "Apache-2.0", @@ -20,8 +20,8 @@ "sass": "^1.42.1" }, "devDependencies": { - "@okta/odyssey-lifecycle": "^0.14.1", - "@okta/odyssey-typescript": "^0.14.1", + "@okta/odyssey-lifecycle": "^0.14.2", + "@okta/odyssey-typescript": "^0.14.2", "@types/sass": "^1.16.1", "jest": "^26.6.3", "postcss": "^8.3.6", diff --git a/packages/odyssey-postcss-theme/CHANGELOG.md b/packages/odyssey-postcss-theme/CHANGELOG.md index a927517e10..6d61ac319f 100644 --- a/packages/odyssey-postcss-theme/CHANGELOG.md +++ b/packages/odyssey-postcss-theme/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/odyssey-postcss-theme + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-postcss-theme diff --git a/packages/odyssey-postcss-theme/package.json b/packages/odyssey-postcss-theme/package.json index e4b497e049..0d7ddad7c2 100644 --- a/packages/odyssey-postcss-theme/package.json +++ b/packages/odyssey-postcss-theme/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-postcss-theme", - "version": "0.14.1", + "version": "0.14.2", "description": "Postcss theme plugin for Odyssey, Okta's design system", "author": "Okta, Inc.", "license": "Apache-2.0", @@ -17,8 +17,8 @@ "prepack": "yarn exec prepack" }, "devDependencies": { - "@okta/odyssey-lifecycle": "^0.14.1", - "@okta/odyssey-typescript": "^0.14.1", + "@okta/odyssey-lifecycle": "^0.14.2", + "@okta/odyssey-typescript": "^0.14.2", "jest": "^26.6.3", "typescript": "^4.4.4" }, diff --git a/packages/odyssey-react-mui/CHANGELOG.md b/packages/odyssey-react-mui/CHANGELOG.md index b5a0cd504a..fbce08251a 100644 --- a/packages/odyssey-react-mui/CHANGELOG.md +++ b/packages/odyssey-react-mui/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +### Features + +- **odyssey-react-mui:** add Infobox theme for Alert ([d92c896](https://github.com/okta/odyssey/commit/d92c89623451fb947cb0786367aeec9c02966cbc)) +- **odyssey-react-mui:** add theme for Checkbox, Radio, Labels, Hints ([a7ed02a](https://github.com/okta/odyssey/commit/a7ed02a79340c32920da92da4947a068ac44c2fd)) +- **odyssey-react-mui:** utilize color tokens for Palette, add lighter ([639549c](https://github.com/okta/odyssey/commit/639549c92f0b2644d347004f4ec801684cba13bf)) + +### Bug Fixes + +- **odyssey-react-mui:** button danger disabled style ([dd2d344](https://github.com/okta/odyssey/commit/dd2d344e724d79fbc9e915390c7406cafee7279a)) +- **odyssey-react-mui:** button prop serialization ([8092a2c](https://github.com/okta/odyssey/commit/8092a2c5c044b98613555805dd9e89581f7174bd)) + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) ### Features diff --git a/packages/odyssey-react-mui/babel.config.cjs b/packages/odyssey-react-mui/babel.config.cjs index e5c6ecc63b..bb99b3f068 100644 --- a/packages/odyssey-react-mui/babel.config.cjs +++ b/packages/odyssey-react-mui/babel.config.cjs @@ -17,7 +17,7 @@ module.exports = { { odyssey: false, react: { - runtime: "classic", + runtime: "automatic", }, }, ], @@ -76,7 +76,7 @@ module.exports = { modules: false, }, react: { - runtime: "classic", + runtime: "automatic", }, }, ], diff --git a/packages/odyssey-react-mui/package.json b/packages/odyssey-react-mui/package.json index 701064bfe9..5e0c524207 100644 --- a/packages/odyssey-react-mui/package.json +++ b/packages/odyssey-react-mui/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-react-mui", - "version": "0.14.1", + "version": "0.14.2", "description": "React MUI components for Odyssey, Okta's design system", "author": "Okta, Inc.", "license": "Apache-2.0", @@ -19,7 +19,7 @@ "directory": "packages/odyssey-react-mui" }, "dependencies": { - "@okta/odyssey-design-tokens": "^0.14.1" + "@okta/odyssey-design-tokens": "^0.14.2" }, "devDependencies": { "@babel/cli": "^7.14.8", @@ -27,11 +27,11 @@ "@emotion/react": "^11.9.0", "@mui/icons-material": "^5.8.2", "@mui/material": "^5.8.2", - "@okta/browserslist-config-odyssey": "^0.14.1", - "@okta/odyssey-babel-preset": "^0.14.1", - "@okta/odyssey-icons": "^0.14.1", - "@okta/odyssey-lifecycle": "^0.14.1", - "@okta/odyssey-typescript": "^0.14.1", + "@okta/browserslist-config-odyssey": "^0.14.2", + "@okta/odyssey-babel-preset": "^0.14.2", + "@okta/odyssey-icons": "^0.14.2", + "@okta/odyssey-lifecycle": "^0.14.2", + "@okta/odyssey-typescript": "^0.14.2", "@testing-library/dom": "^7.28.1", "@testing-library/jest-dom": "^5.12.0", "@testing-library/react": "^11.2.7", @@ -55,8 +55,8 @@ "@emotion/react": "^11", "@mui/icons-material": "^5", "@mui/material": "^5", - "react": "^17", - "react-dom": "^17" + "react": ">=17 <19", + "react-dom": ">=17 <19" }, "scripts": { "lint": "eslint .", diff --git a/packages/odyssey-react-mui/src/components/Link/Link.tsx b/packages/odyssey-react-mui/src/components/Link/Link.tsx index 29ac1d6bd5..82c3e2b6cb 100644 --- a/packages/odyssey-react-mui/src/components/Link/Link.tsx +++ b/packages/odyssey-react-mui/src/components/Link/Link.tsx @@ -10,7 +10,7 @@ * See the License for the specific language governing permissions and limitations under the License. */ -import React, { forwardRef, ReactElement } from "react"; +import { forwardRef, ReactElement } from "react"; import { Link as MuiLink, SvgIcon } from "@mui/material"; import type { LinkProps as MuiLinkProps } from "@mui/material"; diff --git a/packages/odyssey-react-mui/src/components/PasswordInput/PasswordInput.test.tsx b/packages/odyssey-react-mui/src/components/PasswordInput/PasswordInput.test.tsx index 334707f59c..a9a1e6c35f 100644 --- a/packages/odyssey-react-mui/src/components/PasswordInput/PasswordInput.test.tsx +++ b/packages/odyssey-react-mui/src/components/PasswordInput/PasswordInput.test.tsx @@ -10,7 +10,6 @@ * See the License for the specific language governing permissions and limitations under the License. */ -import React from "react"; import { render, screen } from "@testing-library/react"; import { a11yCheck } from "../../../test"; import { PasswordInput } from "."; diff --git a/packages/odyssey-react-mui/src/components/PasswordInput/PasswordInput.tsx b/packages/odyssey-react-mui/src/components/PasswordInput/PasswordInput.tsx index 07a01c54e2..a873bffff5 100644 --- a/packages/odyssey-react-mui/src/components/PasswordInput/PasswordInput.tsx +++ b/packages/odyssey-react-mui/src/components/PasswordInput/PasswordInput.tsx @@ -10,7 +10,7 @@ * See the License for the specific language governing permissions and limitations under the License. */ -import React, { forwardRef, useState, useMemo } from "react"; +import { forwardRef, useState, useMemo } from "react"; import type { Ref, ChangeEvent, MouseEvent } from "react"; import type { OutlinedInputProps, TooltipProps } from "@mui/material"; import { diff --git a/packages/odyssey-react-mui/src/themes/odyssey/components.ts b/packages/odyssey-react-mui/src/themes/odyssey/components.ts index 1051cb8b2b..41304f4d46 100644 --- a/packages/odyssey-react-mui/src/themes/odyssey/components.ts +++ b/packages/odyssey-react-mui/src/themes/odyssey/components.ts @@ -11,139 +11,56 @@ */ import type { ThemeOptions } from "@mui/material"; +//import radioClasses from "@mui/material"; export const components: ThemeOptions["components"] = { - MuiCssBaseline: { + MuiAlert: { styleOverrides: { - boxSizing: "border-box", - }, - }, - MuiCircularProgress: { - defaultProps: { - size: "1.14285714rem", - thickness: 8, - color: "primary", - disableShrink: false, - variant: "indeterminate", - }, - styleOverrides: { - root: ({ ownerState }) => ({ - ...(ownerState.color !== "inherit" && { - color: "#00297a", + root: ({ ownerState, theme }) => ({ + padding: theme.spacing(4), + color: theme.palette.text.primary, + ...(ownerState.severity && { + backgroundColor: theme.palette[ownerState.severity].lighter, + borderColor: theme.palette[ownerState.severity].light, + }), + ...(ownerState.variant === "infobox" && { + borderStyle: "solid", + borderWidth: 1, + "&:not(:last-child)": { + marginBottom: theme.spacing(4), + }, + }), + ...(ownerState.variant === "banner" && { + borderWidth: 0, }), }), - circle: ({ ownerState }) => ({ - ...(ownerState.variant === "indeterminate" && { - strokeDasharray: "160%, 360%", + icon: ({ ownerState, theme }) => ({ + marginRight: theme.spacing(4), + padding: 0, + fontSize: "1.429rem", + opacity: 1, + ...(ownerState.severity && { + color: theme.palette[ownerState.severity].main, + }), + ...(ownerState.severity === "warning" && { + color: theme.palette[ownerState.severity].dark, }), }), + message: ({ theme }) => ({ + padding: 0, + lineHeight: theme.typography.body.lineHeight, + }), }, }, - MuiFormLabel: { - styleOverrides: { - root: { - color: "#1d1d21", - lineHeight: "1.42857143", - fontSize: "1rem", - fontWeight: 600, - }, - }, - }, - MuiInputBase: { - styleOverrides: { - root: { - lineHeight: "1.14285714", - }, - input: { - boxSizing: "border-box", - height: "auto", - }, - }, - }, - MuiTypography: { - defaultProps: { - fontFamily: - "'Public Sans', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', 'Noto Sans Arabic', sans-serif", - }, - styleOverrides: { - paragraph: { - marginBottom: "1.14285714rem", - }, - }, - }, - MuiLink: { + MuiAlertTitle: { styleOverrides: { - root: { - color: "#1662dd", - textDecoration: "none", - - "&:hover": { - color: "#1662dd", - textDecoration: "underline", - }, - - "&:focus-visible": { - outlineColor: "#1662dd", - outlineOffset: "2px", - outlineStyle: "solid", - outlineWidth: "1px", - }, - - "&:visited": { - color: "#1662dd", - }, - - ".Link-indicator, .Link-icon": { - display: "inline-block", - height: "1em", - lineHeight: 1, - }, - - ".Link-indicator": { - marginInlineStart: "0.57142857rem", - }, - - ".Link-icon": { - marginInlineEnd: "0.57142857rem", - }, - svg: { - fontSize: "1rem", - height: "1em", - position: "relative", - top: "-0.0625em", - verticalAlign: "middle", - width: "1em", - }, - }, - }, - variants: [ - { - props: { variant: "monochrome" }, - style: { - color: "#1d1d21", - textDecoration: "underline", - - "&:hover": { - color: "#6e6e78", - }, - - "&:focus-visible": { - outlineColor: "#1662dd", - outlineOffset: "2px", - outlineStyle: "solid", - outlineWidth: "1px", - }, - - "&:visited": { - color: "#1d1d21", - }, - }, - }, - ], - }, - MuiButtonBase: { - defaultProps: { - disableRipple: true, + root: ({ theme }) => ({ + marginTop: 0, + marginBottom: theme.spacing(1), + lineHeight: theme.typography.h6.lineHeight, + fontSize: theme.typography.h6.fontSize, + fontWeight: theme.typography.fontWeightBold, + }), }, }, MuiButton: { @@ -206,8 +123,9 @@ export const components: ThemeOptions["components"] = { style: { backgroundColor: "#da372c", color: "#ffffff", + borderColor: "transparent", + "&:hover": { - borderColor: "transparent", backgroundColor: "#640019", }, @@ -217,13 +135,11 @@ export const components: ThemeOptions["components"] = { }, "&:active": { - borderColor: "transparent", backgroundColor: "#da372c", }, "&:disabled": { color: "#ffffff", - borderColor: "#f88c90", backgroundColor: "#f88c90", }, }, @@ -278,10 +194,20 @@ export const components: ThemeOptions["components"] = { }, }, }, + { + // icon only + props: { children: "" }, + style: { + minWidth: "auto", + + ".MuiButton-startIcon": { + margin: "0", + }, + }, + }, ], styleOverrides: { - root: ({ ownerState }) => ({ - ...ownerState, + root: () => ({ fontWeight: 600, paddingBlock: "0.85714286rem", paddingInline: "0.85714286rem", @@ -315,7 +241,268 @@ export const components: ThemeOptions["components"] = { cursor: "not-allowed", pointerEvents: "inherit", // in order to have cursor: not-allowed, must change pointer-events from 'none' }, + + ".MuiButton-startIcon > *:nth-of-type(1)": { + fontSize: "inherit", + }, + }), + }, + }, + MuiButtonBase: { + defaultProps: { + disableRipple: true, + }, + }, + MuiCssBaseline: { + styleOverrides: { + boxSizing: "border-box", + fontFeatureSettings: "'lnum','pnum'", + fontVariant: "normal", + }, + }, + MuiCheckbox: { + defaultProps: { + size: "small", + }, + styleOverrides: { + root: { + borderRadius: "4px", + "&:hover": { + backgroundColor: "transparent", + }, + padding: 0, + ".Mui-error > &": { + color: "#da372c", + "&:hover": { + color: "#640019", + }, + }, + ".Mui-error > &.Mui-checked": { + "&:hover": { + color: "#640019", + }, + }, + "&.Mui-focusVisible": { + outlineColor: "#1662dd", + outlineOffset: 0, + outlineStyle: "solid", + outlineWidth: "2px", + }, + }, + }, + }, + MuiCircularProgress: { + defaultProps: { + size: "1.14285714rem", + thickness: 8, + color: "primary", + disableShrink: false, + variant: "indeterminate", + }, + styleOverrides: { + root: ({ ownerState }) => ({ + ...(ownerState.color !== "inherit" && { + color: "#00297a", + }), + }), + circle: ({ ownerState }) => ({ + ...(ownerState.variant === "indeterminate" && { + strokeDasharray: "160%, 360%", + }), + }), + }, + }, + MuiFormControlLabel: { + styleOverrides: { + root: ({ ownerState }) => ({ + gap: "0.57142857rem", + marginLeft: 0, + marginRight: 0, // used for row presentation of radio/checkbox + ...(ownerState.labelPlacement === "start" && { + marginLeft: 0, // used for row presentation of radio/checkbox + marginRight: 0, + }), + ...(ownerState.labelPlacement === "top" && { + marginLeft: 0, + }), + ...(ownerState.labelPlacement === "bottom" && { + marginLeft: 0, + }), + "&:not(:last-child)": { + marginBottom: "0.57142857rem", + }, + "&.Mui-disabled": { + pointerEvents: "none", + }, + //[`&:hover ${radioClasses.root}:not(${radioClasses.checked})`]: { + //color: "#1d1d21", + //}, + "&:hover .MuiRadio-root, &:hover .MuiCheckbox-root": { + color: "#1d1d21", + }, + "&:hover .MuiRadio-root.Mui-checked, &:hover .MuiCheckbox-root.Mui-checked": + { + color: "#00297a", + }, + "&.Mui-error:hover .MuiRadio-root, &.Mui-error:hover .MuiCheckbox-root": + { + color: "#640019", + }, + "&.Mui-error:hover .MuiRadio-root.Mui-checked, &.Mui-error:hover .MuiCheckbox-root.Mui-checked": + { + color: "#640019", + }, }), }, }, + MuiFormHelperText: { + defaultProps: { + variant: "standard", + }, + styleOverrides: { + root: { + lineHeight: "1.33333333", + marginTop: "0.57142857rem", + ".MuiFormLabel-root + &": { + marginTop: "-0.28571429rem", + color: "#6e6e78", + }, + marginBottom: "0.57142857rem", + "&:last-child": { + marginBottom: 0, + }, + }, + }, + }, + MuiFormLabel: { + styleOverrides: { + root: { + color: "#1d1d21", + lineHeight: "1.14285714", + fontSize: "1rem", + fontWeight: 600, + marginBottom: "0.57142857rem", + "&.Mui-focused, &.Mui-error, &.Mui-disabled": { + color: "#1d1d21", + }, + }, + }, + }, + MuiInputBase: { + styleOverrides: { + root: { + lineHeight: "1.14285714", + }, + input: { + boxSizing: "border-box", + height: "auto", + }, + }, + }, + MuiLink: { + styleOverrides: { + root: { + color: "#1662dd", + textDecoration: "none", + + "&:hover": { + color: "#1662dd", + textDecoration: "underline", + }, + + "&:focus-visible": { + outlineColor: "#1662dd", + outlineOffset: "2px", + outlineStyle: "solid", + outlineWidth: "1px", + }, + + "&:visited": { + color: "#1662dd", + }, + + ".Link-indicator, .Link-icon": { + display: "inline-block", + height: "1em", + lineHeight: 1, + }, + + ".Link-indicator": { + marginInlineStart: "0.57142857rem", + }, + + ".Link-icon": { + marginInlineEnd: "0.57142857rem", + }, + svg: { + fontSize: "1rem", + height: "1em", + position: "relative", + top: "-0.0625em", + verticalAlign: "middle", + width: "1em", + }, + }, + }, + variants: [ + { + props: { variant: "monochrome" }, + style: { + color: "#1d1d21", + textDecoration: "underline", + + "&:hover": { + color: "#6e6e78", + }, + + "&:focus-visible": { + outlineColor: "#1662dd", + outlineOffset: "2px", + outlineStyle: "solid", + outlineWidth: "1px", + }, + + "&:visited": { + color: "#1d1d21", + }, + }, + }, + ], + }, + MuiRadio: { + defaultProps: { + size: "small", + }, + styleOverrides: { + root: { + "&:hover": { + backgroundColor: "transparent", + }, + padding: 0, + ".Mui-error > &": { + color: "#da372c", + "&:hover": { + color: "#640019", + }, + }, + "&.Mui-focusVisible": { + outlineColor: "#1662dd", + outlineOffset: 0, + outlineStyle: "solid", + outlineWidth: "2px", + }, + }, + }, + }, + MuiTypography: { + defaultProps: { + fontFamily: + "'Public Sans', '-apple-system', 'BlinkMacSystemFont', 'Segoe UI', 'Roboto', 'Oxygen-Sans', 'Ubuntu', 'Cantarell', 'Helvetica Neue', 'Noto Sans Arabic', sans-serif", + }, + styleOverrides: { + paragraph: { + marginBottom: "1.14285714rem", + }, + }, + }, }; diff --git a/packages/odyssey-react-mui/src/themes/odyssey/components.types.ts b/packages/odyssey-react-mui/src/themes/odyssey/components.types.ts index 91d76ce48a..99f81a58cc 100644 --- a/packages/odyssey-react-mui/src/themes/odyssey/components.types.ts +++ b/packages/odyssey-react-mui/src/themes/odyssey/components.types.ts @@ -10,6 +10,47 @@ * See the License for the specific language governing permissions and limitations under the License. */ +declare module "@mui/material/Alert" { + interface AlertPropsVariantOverrides { + // Disable Mui defaults + filled: false; + outlined: false; + standard: false; + // Enable Odyssey variants + banner: true; + infobox: true; + } +} + +declare module "@mui/material/Button" { + interface ButtonPropsVariantOverrides { + floating: true; + primary: true; + secondary: true; + danger: true; + text: false; + contained: false; + outlined: false; + } + interface ButtonPropsSizeOverrides { + s: true; + m: true; + l: true; + small: false; + medium: false; + large: false; + } + interface ButtonPropsColorOverrides { + inherit: false; + primary: false; + secondary: false; + error: false; + info: false; + warning: false; + success: false; + } +} + declare module "@mui/material/Link" { interface LinkPropsVariantOverrides { default: true; @@ -46,33 +87,5 @@ declare module "@mui/material/Link" { success: false; } } -declare module "@mui/material/Button" { - interface ButtonPropsVariantOverrides { - floating: true; - primary: true; - secondary: true; - danger: true; - text: false; - contained: false; - outlined: false; - } - interface ButtonPropsSizeOverrides { - s: true; - m: true; - l: true; - small: false; - medium: false; - large: false; - } - interface ButtonPropsColorOverrides { - inherit: false; - primary: false; - secondary: false; - error: false; - info: false; - warning: false; - success: false; - } -} export {}; diff --git a/packages/odyssey-react-mui/src/themes/odyssey/palette.ts b/packages/odyssey-react-mui/src/themes/odyssey/palette.ts index adfcfb78c0..84ed59f133 100644 --- a/packages/odyssey-react-mui/src/themes/odyssey/palette.ts +++ b/packages/odyssey-react-mui/src/themes/odyssey/palette.ts @@ -11,48 +11,54 @@ */ import type { ThemeOptions } from "@mui/material"; +import * as Tokens from "@okta/odyssey-design-tokens"; export const palette: ThemeOptions["palette"] = { mode: "light", common: { - black: "#1d1d21", - white: "#ffffff", + black: Tokens.ColorNeutralDark, + white: Tokens.ColorPaletteNeutralWhite, }, primary: { - light: "#a7b5ec", - main: "#1662dd", - dark: "#00297a", - contrastText: "#ffffff", + lighter: Tokens.ColorPaletteBlue000, + light: Tokens.ColorPaletteBlue300, + main: Tokens.ColorPaletteBlue500, + dark: Tokens.ColorPaletteBlue900, + contrastText: Tokens.ColorTextBodyInverse, }, secondary: { light: "#80C7CA", - main: "#2D8C9E", + main: Tokens.ColorPaletteTurquoise500, dark: "#004650", - contrastText: "#ffffff", + contrastText: Tokens.ColorTextBodyInverse, }, error: { - light: "#f88c90", - main: "#da372c", - dark: "#640019", - contrastText: "#ffffff", + lighter: Tokens.ColorPaletteRed000, + light: Tokens.ColorPaletteRed300, + main: Tokens.ColorPaletteRed500, + dark: Tokens.ColorPaletteRed900, + contrastText: Tokens.ColorTextBodyInverse, }, warning: { - light: "#f9dc77", - main: "#ffc61c", - dark: "#663800", - contrastText: "#1d1d21", + lighter: Tokens.ColorPaletteYellow000, + light: Tokens.ColorPaletteYellow300, + main: Tokens.ColorPaletteYellow500, + dark: Tokens.ColorPaletteYellow900, + contrastText: Tokens.ColorTextBody, }, info: { - light: "#a7b5ec", - main: "#1662dd", - dark: "#00297a", - contrastText: "#ffffff", + lighter: Tokens.ColorPaletteBlue000, + light: Tokens.ColorPaletteBlue300, + main: Tokens.ColorPaletteBlue500, + dark: Tokens.ColorPaletteBlue900, + contrastText: Tokens.ColorTextBodyInverse, }, success: { - light: "#84d2b1", - main: "#00b478", - dark: "#00503c", - contrastText: "#ffffff", + lighter: Tokens.ColorPaletteGreen000, + light: Tokens.ColorPaletteGreen300, + main: Tokens.ColorPaletteGreen500, + dark: Tokens.ColorPaletteGreen900, + contrastText: Tokens.ColorTextBodyInverse, }, grey: { 50: "#f5f5f6", @@ -72,16 +78,14 @@ export const palette: ThemeOptions["palette"] = { A700: "#585862", }, text: { - primary: "#1d1d21", - secondary: "#6e6e78", - // We do not currently have a unique disabled color. - disabled: "#6e6e78", + primary: Tokens.ColorNeutralDark, + secondary: Tokens.ColorNeutralBase, + disabled: Tokens.ColorNeutralBase, // We do not currently have a unique disabled color. }, - // Currently mapping this to ColorBorderDisplay. - divider: "#d7d7dc", + divider: Tokens.ColorBorderDisplay, background: { - paper: "#ffffff", - default: "#ffffff", + paper: Tokens.ColorBackgroundBase, + default: Tokens.ColorBackgroundBase, }, action: { // We have no equivalents here. It's likely we will update these as their uses are discovered. diff --git a/packages/odyssey-react-mui/src/themes/odyssey/palette.types.ts b/packages/odyssey-react-mui/src/themes/odyssey/palette.types.ts new file mode 100644 index 0000000000..2cfb2b39fa --- /dev/null +++ b/packages/odyssey-react-mui/src/themes/odyssey/palette.types.ts @@ -0,0 +1,22 @@ +/*! + * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved. + * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") + * + * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and limitations under the License. + */ + +declare module "@mui/material/styles" { + interface PaletteColor { + lighter?: string; + } + interface SimplePaletteColorOptions { + lighter?: string; + } +} + +export {}; diff --git a/packages/odyssey-react-mui/src/themes/odyssey/theme.ts b/packages/odyssey-react-mui/src/themes/odyssey/theme.ts index 96d12901a3..500cdfcef4 100644 --- a/packages/odyssey-react-mui/src/themes/odyssey/theme.ts +++ b/packages/odyssey-react-mui/src/themes/odyssey/theme.ts @@ -13,6 +13,7 @@ import { createTheme } from "@mui/material/styles"; import { palette } from "./palette"; +import "./palette.types"; import { shape } from "./shape"; import { spacing } from "./spacing"; import { typography } from "./typography"; diff --git a/packages/odyssey-react-mui/src/themes/odyssey/typography.ts b/packages/odyssey-react-mui/src/themes/odyssey/typography.ts index 624748b0d9..95ee127710 100644 --- a/packages/odyssey-react-mui/src/themes/odyssey/typography.ts +++ b/packages/odyssey-react-mui/src/themes/odyssey/typography.ts @@ -21,52 +21,46 @@ export const typography: ThemeOptions["typography"] = { fontWeightRegular: Number(Tokens.FontWeightNormal), fontWeightMedium: 500, fontWeightBold: Number(Tokens.FontWeightBold), - h1: { + allVariants: { fontFamily: Tokens.FontFamilyBase, + fontFeatureSettings: "'lnum', 'pnum'", + fontVariant: "normal", + letterSpacing: 0, + }, + h1: { fontWeight: Tokens.FontWeightBold, fontSize: Tokens.FontSizeHeading1, lineHeight: Tokens.FontLineHeightHeading1, - letterSpacing: "initial", marginBottom: Tokens.SpaceScale1, }, h2: { - fontFamily: Tokens.FontFamilyBase, fontWeight: Tokens.FontWeightBold, fontSize: Tokens.FontSizeHeading2, lineHeight: Tokens.FontLineHeightHeading2, - letterSpacing: "initial", marginBottom: Tokens.SpaceScale1, }, h3: { - fontFamily: Tokens.FontFamilyBase, fontWeight: Tokens.FontWeightBold, fontSize: Tokens.FontSizeHeading3, lineHeight: Tokens.FontLineHeightHeading3, - letterSpacing: "initial", marginBottom: Tokens.SpaceScale1, }, h4: { - fontFamily: Tokens.FontFamilyBase, fontWeight: Tokens.FontWeightBold, fontSize: Tokens.FontSizeHeading4, lineHeight: Tokens.FontLineHeightHeading4, - letterSpacing: "initial", marginBottom: Tokens.SpaceScale1, }, h5: { - fontFamily: Tokens.FontFamilyBase, fontWeight: Tokens.FontWeightBold, fontSize: Tokens.FontSizeHeading5, lineHeight: Tokens.FontLineHeightHeading5, - letterSpacing: "initial", marginBottom: Tokens.SpaceScale1, }, h6: { - fontFamily: Tokens.FontFamilyBase, fontWeight: Tokens.FontWeightBold, fontSize: Tokens.FontScale2, lineHeight: Tokens.FontLineHeightHeading6, - letterSpacing: "initial", marginBottom: Tokens.SpaceScale1, }, subtitle1: undefined, @@ -75,6 +69,8 @@ export const typography: ThemeOptions["typography"] = { fontFamily: Tokens.FontFamilyBase, fontWeight: Number(Tokens.FontWeightNormal), fontSize: Tokens.FontScale1, + fontFeatureSettings: "'lnum', 'pnum'", + fontVariant: "normal", lineHeight: Tokens.FontLineHeightBody, letterSpacing: "initial", }, @@ -82,11 +78,9 @@ export const typography: ThemeOptions["typography"] = { body2: undefined, button: undefined, caption: { - fontFamily: Tokens.FontFamilyBase, fontWeight: Tokens.FontWeightNormal, fontSize: Tokens.FontScale0, lineHeight: Tokens.FontLineHeightBody, - letterSpacing: "initial", }, overline: undefined, }; diff --git a/packages/odyssey-react-mui/tsconfig.json b/packages/odyssey-react-mui/tsconfig.json index b03efe2688..4b8b858e23 100644 --- a/packages/odyssey-react-mui/tsconfig.json +++ b/packages/odyssey-react-mui/tsconfig.json @@ -1,3 +1,6 @@ { - "extends": "@okta/odyssey-typescript/tsconfig.react.json" + "extends": "@okta/odyssey-typescript/tsconfig.react.json", + "compilerOptions": { + "jsx": "react-jsx" + } } diff --git a/packages/odyssey-react-mui/tsconfig.production.json b/packages/odyssey-react-mui/tsconfig.production.json index b8e153ab91..c04175b842 100644 --- a/packages/odyssey-react-mui/tsconfig.production.json +++ b/packages/odyssey-react-mui/tsconfig.production.json @@ -1,7 +1,8 @@ { "extends": "@okta/odyssey-typescript/tsconfig.react.types.json", "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "jsx": "react-jsx" }, "exclude": ["./test", "**/*.test.**", "**/dist/**/*"] } diff --git a/packages/odyssey-react-theme/CHANGELOG.md b/packages/odyssey-react-theme/CHANGELOG.md index a53fedd4d4..c16ace9ee4 100644 --- a/packages/odyssey-react-theme/CHANGELOG.md +++ b/packages/odyssey-react-theme/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +**Note:** Version bump only for package @okta/odyssey-react-theme + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-react-theme diff --git a/packages/odyssey-react-theme/package.json b/packages/odyssey-react-theme/package.json index 8ce7df4e69..8fe8ef8173 100644 --- a/packages/odyssey-react-theme/package.json +++ b/packages/odyssey-react-theme/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-react-theme", - "version": "0.14.1", + "version": "0.14.2", "description": "React theme logic for Odyssey, Okta's design system", "author": "Okta, Inc.", "license": "Apache-2.0", @@ -20,16 +20,16 @@ "directory": "packages/odyssey-react-theme" }, "dependencies": { - "@okta/odyssey-design-tokens": "^0.14.1", + "@okta/odyssey-design-tokens": "^0.14.2", "hoist-non-react-statics": "^3.3.2" }, "devDependencies": { "@babel/cli": "^7.14.8", "@babel/core": "^7.15.0", - "@okta/browserslist-config-odyssey": "^0.14.1", - "@okta/odyssey-babel-preset": "^0.14.1", - "@okta/odyssey-lifecycle": "^0.14.1", - "@okta/odyssey-typescript": "^0.14.1", + "@okta/browserslist-config-odyssey": "^0.14.2", + "@okta/odyssey-babel-preset": "^0.14.2", + "@okta/odyssey-lifecycle": "^0.14.2", + "@okta/odyssey-typescript": "^0.14.2", "@testing-library/jest-dom": "^5.12.0", "@testing-library/react": "^11.2.7", "@types/hoist-non-react-statics": "^3.3.1", diff --git a/packages/odyssey-react/CHANGELOG.md b/packages/odyssey-react/CHANGELOG.md index d6f175989b..f2c4f3a064 100644 --- a/packages/odyssey-react/CHANGELOG.md +++ b/packages/odyssey-react/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +### [0.14.2](https://github.com/okta/odyssey/compare/v0.14.1...v0.14.2) (2022-06-30) + +### Features + +- **odyssey-icons:** add eye and eye off icons ([d44a241](https://github.com/okta/odyssey/commit/d44a241537fa84fcf7679b7e96e52655d83d846f)) + ### [0.14.1](https://github.com/okta/odyssey/compare/v0.14.0...v0.14.1) (2022-06-21) **Note:** Version bump only for package @okta/odyssey-react diff --git a/packages/odyssey-react/package.json b/packages/odyssey-react/package.json index 00e63fdb19..5b1242bbcb 100644 --- a/packages/odyssey-react/package.json +++ b/packages/odyssey-react/package.json @@ -1,6 +1,6 @@ { "name": "@okta/odyssey-react", - "version": "0.14.1", + "version": "0.14.2", "description": "React components for Odyssey, Okta's design system", "author": "Okta, Inc.", "license": "Apache-2.0", @@ -20,22 +20,22 @@ "directory": "packages/odyssey-react" }, "dependencies": { - "@okta/odyssey-react-theme": "^0.14.1", + "@okta/odyssey-react-theme": "^0.14.2", "@react-aria/focus": "3.5.0", "choices.js": "^9.0.1" }, "devDependencies": { "@babel/cli": "^7.14.8", "@babel/core": "^7.15.0", - "@okta/browserslist-config-odyssey": "^0.14.1", - "@okta/odyssey-babel-preset": "^0.14.1", - "@okta/odyssey-icons": "^0.14.1", - "@okta/odyssey-lifecycle": "^0.14.1", - "@okta/odyssey-postcss-preset": "^0.14.1", - "@okta/odyssey-postcss-scss": "^0.14.1", - "@okta/odyssey-stylelint": "^0.14.1", - "@okta/odyssey-svgr": "^0.14.1", - "@okta/odyssey-typescript": "^0.14.1", + "@okta/browserslist-config-odyssey": "^0.14.2", + "@okta/odyssey-babel-preset": "^0.14.2", + "@okta/odyssey-icons": "^0.14.2", + "@okta/odyssey-lifecycle": "^0.14.2", + "@okta/odyssey-postcss-preset": "^0.14.2", + "@okta/odyssey-postcss-scss": "^0.14.2", + "@okta/odyssey-stylelint": "^0.14.2", + "@okta/odyssey-svgr": "^0.14.2", + "@okta/odyssey-typescript": "^0.14.2", "@svgr/cli": "^5.5.0", "@testing-library/dom": "^7.28.1", "@testing-library/jest-dom": "^5.12.0", @@ -67,7 +67,7 @@ "typecheck": "tsc", "build": "yarn build:clean && yarn build:types && yarn build:source", "build:clean": "rm -rf dist", - "build:types": "tsc --project tsconfig.production.json", + "build:types": "tsc --project tsconfig.composite.json && tsc --project tsconfig.production.json", "build:source": "./scripts/buildSource", "build-icons": "svgr $(node ./scripts/resolveIconSrcPath.cjs) --out-dir ./src/components/Icon/", "prepack": "yarn exec prepack" diff --git a/packages/odyssey-react/src/components/Button/Button.module.scss b/packages/odyssey-react/src/components/Button/Button.module.scss index 6dc49dfe7a..5764190c45 100644 --- a/packages/odyssey-react/src/components/Button/Button.module.scss +++ b/packages/odyssey-react/src/components/Button/Button.module.scss @@ -150,6 +150,31 @@ } } +.affixVariant { + border: 0; + background-color: var(--AffixBackgroundColor); + color: var(--AffixTextColor); + line-height: 1; + padding-block: var(--AffixPadding); + padding-inline: var(--AffixPadding); + + &:hover { + border-color: var(--AffixHoverBorderColor); + background-color: var(--AffixHoverBackgroundColor); + color: var(--AffixHoverTextColor); + } + + &:focus { + background-color: var(--AffixFocusBackgroundColor); + color: var(--AffixFocusTextColor); + } + + &:disabled { + background-color: var(--AffixDisabledBackgroundColor); + color: var(--AffixDisabledTextColor); + } +} + /* Layouts */ .wideLayout { diff --git a/packages/odyssey-react/src/components/Button/Button.theme.ts b/packages/odyssey-react/src/components/Button/Button.theme.ts index a6bc42dd36..4a24d1f8e8 100644 --- a/packages/odyssey-react/src/components/Button/Button.theme.ts +++ b/packages/odyssey-react/src/components/Button/Button.theme.ts @@ -83,6 +83,18 @@ export const theme: ThemeReducer = (theme) => ({ FloatingHoverBackgroundColor: "rgba(29, 29, 33, 0.1)", FloatingDisabledBackgroundColor: "rgba(235, 235, 237, 0.6)", + // Affix Variant + AffixBackgroundColor: "transparent", + AffixDisabledBackgroundColor: "transparent", + AffixDisabledTextColor: theme.ColorPaletteNeutral500, + AffixFocusBackgroundColor: theme.ColorPaletteNeutral200, + AffixFocusTextColor: theme.ColorTextBody, + AffixHoverBackgroundColor: theme.ColorPaletteNeutral200, + AffixHoverBorderColor: "transparent", + AffixHoverTextColor: theme.ColorTextBody, + AffixPadding: theme.SpaceScale0, + AffixTextColor: theme.ColorTextBody, + // Wide Layout WideLayoutMarginBlock: 0, WideLayoutMarginBlockEnd: theme.SpaceScale3, diff --git a/packages/odyssey-react/src/components/Button/Button.tsx b/packages/odyssey-react/src/components/Button/Button.tsx index 407c706c36..7a0903cf30 100644 --- a/packages/odyssey-react/src/components/Button/Button.tsx +++ b/packages/odyssey-react/src/components/Button/Button.tsx @@ -43,7 +43,7 @@ interface CommonProps * The visual variant to be displayed to the user. * @default primary */ - variant?: "primary" | "secondary" | "danger" | "floating"; + variant?: "primary" | "secondary" | "danger" | "floating" | "affix"; /** * Extends the width of the button to that of its' parent. @@ -59,7 +59,15 @@ interface IconProps extends CommonProps { icon: ReactElement; } -export type ButtonProps = IconProps | ChildrenProps; +interface AffixProps + extends Omit { + variant: "affix"; + children: never; + icon: ReactElement; + size: "s"; +} + +export type ButtonProps = IconProps | ChildrenProps | AffixProps; /** * A clickable button used for form submissions and most in-page interactions. diff --git a/packages/odyssey-react/src/components/Icon/Eye.tsx b/packages/odyssey-react/src/components/Icon/Eye.tsx new file mode 100644 index 0000000000..e548f5ee11 --- /dev/null +++ b/packages/odyssey-react/src/components/Icon/Eye.tsx @@ -0,0 +1,38 @@ +/*! + * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved. + * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") + * + * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and limitations under the License. + */ + +// Code automatically generated by svgr; DO NOT EDIT. + +import React, { forwardRef } from "react"; +import { useOmit } from "../../utils"; +import { SvgIcon } from "./SvgIcon"; +import type { SvgIconNoChildrenProps } from "./types"; + +export type EyeIconProps = SvgIconNoChildrenProps; + +export const EyeIcon = forwardRef((props, ref) => { + const omitProps = useOmit(props); + return ( + + + + + + ); +}); + +EyeIcon.displayName = "EyeIcon"; diff --git a/packages/odyssey-react/src/components/Icon/EyeOff.tsx b/packages/odyssey-react/src/components/Icon/EyeOff.tsx new file mode 100644 index 0000000000..acc2a824fb --- /dev/null +++ b/packages/odyssey-react/src/components/Icon/EyeOff.tsx @@ -0,0 +1,40 @@ +/*! + * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved. + * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") + * + * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and limitations under the License. + */ + +// Code automatically generated by svgr; DO NOT EDIT. + +import React, { forwardRef } from "react"; +import { useOmit } from "../../utils"; +import { SvgIcon } from "./SvgIcon"; +import type { SvgIconNoChildrenProps } from "./types"; + +export type EyeOffIconProps = SvgIconNoChildrenProps; + +export const EyeOffIcon = forwardRef( + (props, ref) => { + const omitProps = useOmit(props); + return ( + + + + + + ); + } +); + +EyeOffIcon.displayName = "EyeOffIcon"; diff --git a/packages/odyssey-react/src/components/Icon/index.tsx b/packages/odyssey-react/src/components/Icon/index.tsx index 21dc0032ee..17d8581e8c 100644 --- a/packages/odyssey-react/src/components/Icon/index.tsx +++ b/packages/odyssey-react/src/components/Icon/index.tsx @@ -83,6 +83,12 @@ export * from "./Edit"; import { ExternalLinkIcon } from "./ExternalLink"; export * from "./ExternalLink"; +import { EyeOffIcon } from "./EyeOff"; +export * from "./EyeOff"; + +import { EyeIcon } from "./Eye"; +export * from "./Eye"; + import { FilterIcon } from "./Filter"; export * from "./Filter"; @@ -146,6 +152,8 @@ export const iconDictionary = { "drag-handle": DragHandleIcon, edit: EditIcon, "external-link": ExternalLinkIcon, + "eye-off": EyeOffIcon, + eye: EyeIcon, filter: FilterIcon, globe: GlobeIcon, home: HomeIcon, diff --git a/packages/odyssey-react/src/components/PasswordInput/PasswordInput.test.tsx b/packages/odyssey-react/src/components/PasswordInput/PasswordInput.test.tsx new file mode 100644 index 0000000000..f98f55670d --- /dev/null +++ b/packages/odyssey-react/src/components/PasswordInput/PasswordInput.test.tsx @@ -0,0 +1,50 @@ +/*! + * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved. + * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") + * + * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and limitations under the License. + */ + +import React from "react"; +import { render, screen } from "@testing-library/react"; +import { PasswordInput } from "."; + +const label = "Password"; +const tooltipOnLabel = "Show password"; +const tooltipOffLabel = "Hide password"; + +describe("PasswordInput", () => { + it("renders into the document", () => { + render(); + expect(screen.getByLabelText(label)).toBeVisible(); + }); + + it("has a button that changes the type when clicked", () => { + const tooltipLabel = (isHidden: boolean) => { + return isHidden ? tooltipOnLabel : tooltipOffLabel; + }; + render( + + ); + const inputElement = screen.getByLabelText(label); + expect(inputElement).toHaveValue("Imma password"); + expect(inputElement).toHaveAttribute("type", "password"); + const eyeButton = screen.getByRole("button"); + expect(eyeButton).toBeInTheDocument(); + eyeButton.click(); + expect(inputElement).toHaveAttribute("type", "text"); + }); + + a11yCheck(() => + render() + ); +}); diff --git a/packages/odyssey-react/src/components/PasswordInput/PasswordInput.tsx b/packages/odyssey-react/src/components/PasswordInput/PasswordInput.tsx new file mode 100644 index 0000000000..58e98c2f88 --- /dev/null +++ b/packages/odyssey-react/src/components/PasswordInput/PasswordInput.tsx @@ -0,0 +1,98 @@ +/*! + * Copyright (c) 2022-present, Okta, Inc. and/or its affiliates. All rights reserved. + * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.") + * + * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * + * See the License for the specific language governing permissions and limitations under the License. + */ + +import React, { forwardRef, useMemo, useState } from "react"; +import { useOmit } from "../../utils"; +import { TextInput, TextInputProps } from "../TextInput"; +import { EyeIcon, EyeOffIcon } from "../Icon"; +import { Button } from "../Button"; +import { Tooltip } from "../Tooltip"; +import type { TooltipProps } from "../Tooltip"; + +export interface PasswordInputProps + extends Omit< + TextInputProps, + | "type" + | "PrefixButton" + | "PrefixIcon" + | "PrefixText" + | "SuffixButton" + | "SuffixIcon" + | "SuffixText" + > { + type?: never; + tooltipLabel: + | TooltipProps["label"] + | ((isHidden: boolean) => TooltipProps["label"]); + tooltipPosition?: TooltipProps["position"]; + PrefixButton?: never; + PrefixIcon?: never; + PrefixText?: never; + SuffixButton?: never; + SuffixIcon?: never; + SuffixText?: never; +} + +/** + * Password inputs exposes hide/show capability + */ +export const PasswordInput = forwardRef( + (props, ref) => { + const { name, label, tooltipLabel, tooltipPosition, ...rest } = props; + + const omitProps = useOmit(rest); + const [internalType, setInternalType] = useState<"password" | "text">( + "password" + ); + + const onHideShowPasswordClick = () => { + setInternalType(internalType === "password" ? "text" : "password"); + }; + + const _tooltipLabel = useMemo(() => { + if (typeof tooltipLabel === "function") { + return tooltipLabel(internalType === "password"); + } + return tooltipLabel; + }, [internalType, tooltipLabel]); + + return ( + <> + {/* + @ts-expect-error using a type="password" intentionally here */} + +