From d9c77f544c1435c29d037601703c09582af3dfd3 Mon Sep 17 00:00:00 2001 From: Jamie Hoover Date: Mon, 24 Jan 2022 17:14:17 -0800 Subject: [PATCH] feat: password input - PasswordInput component - fix: text input right padding with trailing icon - redesign examples contents - remove sentry from website --- package-lock.json | 227 ------------------ package.json | 2 - src/docs/app.tsx | 71 +----- .../pages/examples/anchor-button/index.tsx | 4 +- src/docs/pages/examples/button-menu/index.tsx | 4 +- src/docs/pages/examples/button-menu/state.tsx | 2 +- src/docs/pages/examples/button/index.tsx | 5 +- src/docs/pages/examples/checkbox/index.tsx | 4 +- src/docs/pages/examples/index.tsx | 30 +-- src/docs/pages/examples/input-menu/index.tsx | 4 +- src/docs/pages/examples/input-menu/state.tsx | 2 +- .../pages/examples/password-input/index.tsx | 34 +++ .../pages/examples/password-input/state.tsx | 78 ++++++ src/docs/pages/examples/radioset/index.tsx | 4 +- src/docs/pages/examples/text-input/index.tsx | 34 +-- src/docs/pages/examples/typography.tsx | 2 +- src/lib/components/button/button.spec.ts | 18 +- src/lib/components/input/index.ts | 12 +- src/lib/components/input/input.module.css | 8 + src/lib/components/input/password.tsx | 27 +++ src/lib/components/input/text.tsx | 12 +- src/lib/index.ts | 2 +- 22 files changed, 234 insertions(+), 352 deletions(-) create mode 100644 src/docs/pages/examples/password-input/index.tsx create mode 100644 src/docs/pages/examples/password-input/state.tsx create mode 100644 src/lib/components/input/password.tsx diff --git a/package-lock.json b/package-lock.json index c0738ba5..384c27e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,8 +17,6 @@ "@commitlint/config-conventional": "16.0.0", "@fontsource/roboto": "4.5.1", "@playwright/test": "1.18.0", - "@sentry/react": "6.16.1", - "@sentry/tracing": "6.16.1", "@types/node": "17.0.10", "@types/react": "17.0.38", "@types/react-dom": "17.0.11", @@ -2789,123 +2787,6 @@ "semantic-release": ">=18.0.0-beta.1" } }, - "node_modules/@sentry/browser": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-6.16.1.tgz", - "integrity": "sha512-F2I5RL7RTLQF9CccMrqt73GRdK3FdqaChED3RulGQX5lH6U3exHGFxwyZxSrY4x6FedfBFYlfXWWCJXpLnFkow==", - "dev": true, - "dependencies": { - "@sentry/core": "6.16.1", - "@sentry/types": "6.16.1", - "@sentry/utils": "6.16.1", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/core": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.16.1.tgz", - "integrity": "sha512-UFI0264CPUc5cR1zJH+S2UPOANpm6dLJOnsvnIGTjsrwzR0h8Hdl6rC2R/GPq+WNbnipo9hkiIwDlqbqvIU5vw==", - "dev": true, - "dependencies": { - "@sentry/hub": "6.16.1", - "@sentry/minimal": "6.16.1", - "@sentry/types": "6.16.1", - "@sentry/utils": "6.16.1", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/hub": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.16.1.tgz", - "integrity": "sha512-4PGtg6AfpqMkreTpL7ymDeQ/U1uXv03bKUuFdtsSTn/FRf9TLS4JB0KuTZCxfp1IRgAA+iFg6B784dDkT8R9eg==", - "dev": true, - "dependencies": { - "@sentry/types": "6.16.1", - "@sentry/utils": "6.16.1", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/minimal": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.16.1.tgz", - "integrity": "sha512-dq+mI1EQIvUM+zJtGCVgH3/B3Sbx4hKlGf2Usovm9KoqWYA+QpfVBholYDe/H2RXgO7LFEefDLvOdHDkqeJoyA==", - "dev": true, - "dependencies": { - "@sentry/hub": "6.16.1", - "@sentry/types": "6.16.1", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/react": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/react/-/react-6.16.1.tgz", - "integrity": "sha512-n8fOEKbym4kBi946q3AWXBNy1UKTmABj/hE2nAJbTWhi5IwdM7WBG6QCT2yq7oTHLuTxQrAwgKQc+A6zFTyVHg==", - "dev": true, - "dependencies": { - "@sentry/browser": "6.16.1", - "@sentry/minimal": "6.16.1", - "@sentry/types": "6.16.1", - "@sentry/utils": "6.16.1", - "hoist-non-react-statics": "^3.3.2", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "react": "15.x || 16.x || 17.x" - } - }, - "node_modules/@sentry/tracing": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-6.16.1.tgz", - "integrity": "sha512-MPSbqXX59P+OEeST+U2V/8Hu/8QjpTUxTNeNyTHWIbbchdcMMjDbXTS3etCgajZR6Ro+DHElOz5cdSxH6IBGlA==", - "dev": true, - "dependencies": { - "@sentry/hub": "6.16.1", - "@sentry/minimal": "6.16.1", - "@sentry/types": "6.16.1", - "@sentry/utils": "6.16.1", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/types": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.16.1.tgz", - "integrity": "sha512-Wh354g30UsJ5kYJbercektGX4ZMc9MHU++1NjeN2bTMnbofEcpUDWIiKeulZEY65IC1iU+1zRQQgtYO+/hgCUQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@sentry/utils": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.16.1.tgz", - "integrity": "sha512-7ngq/i4R8JZitJo9Sl8PDnjSbDehOxgr1vsoMmerIsyRZ651C/8B+jVkMhaAPgSdyJ0AlE3O7DKKTP1FXFw9qw==", - "dev": true, - "dependencies": { - "@sentry/types": "6.16.1", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" - } - }, "node_modules/@surma/rollup-plugin-off-main-thread": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.3.tgz", @@ -6028,15 +5909,6 @@ "@babel/runtime": "^7.7.6" } }, - "node_modules/hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dev": true, - "dependencies": { - "react-is": "^16.7.0" - } - }, "node_modules/hook-std": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-2.0.0.tgz", @@ -15691,96 +15563,6 @@ "read-pkg-up": "^7.0.0" } }, - "@sentry/browser": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-6.16.1.tgz", - "integrity": "sha512-F2I5RL7RTLQF9CccMrqt73GRdK3FdqaChED3RulGQX5lH6U3exHGFxwyZxSrY4x6FedfBFYlfXWWCJXpLnFkow==", - "dev": true, - "requires": { - "@sentry/core": "6.16.1", - "@sentry/types": "6.16.1", - "@sentry/utils": "6.16.1", - "tslib": "^1.9.3" - } - }, - "@sentry/core": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.16.1.tgz", - "integrity": "sha512-UFI0264CPUc5cR1zJH+S2UPOANpm6dLJOnsvnIGTjsrwzR0h8Hdl6rC2R/GPq+WNbnipo9hkiIwDlqbqvIU5vw==", - "dev": true, - "requires": { - "@sentry/hub": "6.16.1", - "@sentry/minimal": "6.16.1", - "@sentry/types": "6.16.1", - "@sentry/utils": "6.16.1", - "tslib": "^1.9.3" - } - }, - "@sentry/hub": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.16.1.tgz", - "integrity": "sha512-4PGtg6AfpqMkreTpL7ymDeQ/U1uXv03bKUuFdtsSTn/FRf9TLS4JB0KuTZCxfp1IRgAA+iFg6B784dDkT8R9eg==", - "dev": true, - "requires": { - "@sentry/types": "6.16.1", - "@sentry/utils": "6.16.1", - "tslib": "^1.9.3" - } - }, - "@sentry/minimal": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.16.1.tgz", - "integrity": "sha512-dq+mI1EQIvUM+zJtGCVgH3/B3Sbx4hKlGf2Usovm9KoqWYA+QpfVBholYDe/H2RXgO7LFEefDLvOdHDkqeJoyA==", - "dev": true, - "requires": { - "@sentry/hub": "6.16.1", - "@sentry/types": "6.16.1", - "tslib": "^1.9.3" - } - }, - "@sentry/react": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/react/-/react-6.16.1.tgz", - "integrity": "sha512-n8fOEKbym4kBi946q3AWXBNy1UKTmABj/hE2nAJbTWhi5IwdM7WBG6QCT2yq7oTHLuTxQrAwgKQc+A6zFTyVHg==", - "dev": true, - "requires": { - "@sentry/browser": "6.16.1", - "@sentry/minimal": "6.16.1", - "@sentry/types": "6.16.1", - "@sentry/utils": "6.16.1", - "hoist-non-react-statics": "^3.3.2", - "tslib": "^1.9.3" - } - }, - "@sentry/tracing": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-6.16.1.tgz", - "integrity": "sha512-MPSbqXX59P+OEeST+U2V/8Hu/8QjpTUxTNeNyTHWIbbchdcMMjDbXTS3etCgajZR6Ro+DHElOz5cdSxH6IBGlA==", - "dev": true, - "requires": { - "@sentry/hub": "6.16.1", - "@sentry/minimal": "6.16.1", - "@sentry/types": "6.16.1", - "@sentry/utils": "6.16.1", - "tslib": "^1.9.3" - } - }, - "@sentry/types": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.16.1.tgz", - "integrity": "sha512-Wh354g30UsJ5kYJbercektGX4ZMc9MHU++1NjeN2bTMnbofEcpUDWIiKeulZEY65IC1iU+1zRQQgtYO+/hgCUQ==", - "dev": true - }, - "@sentry/utils": { - "version": "6.16.1", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.16.1.tgz", - "integrity": "sha512-7ngq/i4R8JZitJo9Sl8PDnjSbDehOxgr1vsoMmerIsyRZ651C/8B+jVkMhaAPgSdyJ0AlE3O7DKKTP1FXFw9qw==", - "dev": true, - "requires": { - "@sentry/types": "6.16.1", - "tslib": "^1.9.3" - } - }, "@surma/rollup-plugin-off-main-thread": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.3.tgz", @@ -18103,15 +17885,6 @@ "@babel/runtime": "^7.7.6" } }, - "hoist-non-react-statics": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", - "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", - "dev": true, - "requires": { - "react-is": "^16.7.0" - } - }, "hook-std": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hook-std/-/hook-std-2.0.0.tgz", diff --git a/package.json b/package.json index 992668ac..cc46a2c4 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,6 @@ "@commitlint/config-conventional": "16.0.0", "@fontsource/roboto": "4.5.1", "@playwright/test": "1.18.0", - "@sentry/react": "6.16.1", - "@sentry/tracing": "6.16.1", "@types/node": "17.0.10", "@types/react": "17.0.38", "@types/react-dom": "17.0.11", diff --git a/src/docs/app.tsx b/src/docs/app.tsx index bb8c8e5b..0d6ce383 100644 --- a/src/docs/app.tsx +++ b/src/docs/app.tsx @@ -1,5 +1,3 @@ -import { init } from "@sentry/react"; -import { BrowserTracing } from "@sentry/tracing"; import { AnchorButton, Article, @@ -15,7 +13,7 @@ import { StrictMode } from "react"; import { render } from "react-dom"; import { FaToriiGate } from "react-icons/fa"; import { GiKatana, GiStarShuriken } from "react-icons/gi"; -import { MdEdit, MdLink } from "react-icons/md"; +import { MdEdit } from "react-icons/md"; import { SiGithub, SiNetlify, SiNpm } from "react-icons/si"; import { BrowserRouter, @@ -95,6 +93,17 @@ function App() { examples && ( ) } @@ -128,54 +137,6 @@ function App() { )} } - header={ - examples && ( - -
- } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> -
-
- ) - } > } path="/" /> @@ -187,14 +148,6 @@ function App() { ); } -if (typeof import.meta.env.SENTRY_DSN === "string") { - init({ - dsn: import.meta.env.SENTRY_DSN, - integrations: [new BrowserTracing()], - tracesSampleRate: 1.0, - }); -} - render( diff --git a/src/docs/pages/examples/anchor-button/index.tsx b/src/docs/pages/examples/anchor-button/index.tsx index f4a86cee..66fe8d15 100644 --- a/src/docs/pages/examples/anchor-button/index.tsx +++ b/src/docs/pages/examples/anchor-button/index.tsx @@ -5,12 +5,12 @@ import { Link } from "react-router-dom"; import styles from "../examples.module.css"; import { ButtonState, useButtonState } from "./state"; -export function AnchorButtonExamples() { +export function AnchorButtonExample() { const state = useButtonState(); const [{ appearance, external, leadingIcon, reactRouterLink }] = state; return ( - +
+
defaultValue="Filled" flex - id="input-menu-appearance" + id="button-menu-appearance" label="Appearance" name="appearance" onChange={(appearance) => diff --git a/src/docs/pages/examples/button/index.tsx b/src/docs/pages/examples/button/index.tsx index 24f0ebf0..4d8e16bb 100644 --- a/src/docs/pages/examples/button/index.tsx +++ b/src/docs/pages/examples/button/index.tsx @@ -4,18 +4,17 @@ import { MdArrowDropDown, MdThumbUp } from "react-icons/md"; import styles from "../examples.module.css"; import { ButtonState, useButtonState } from "./state"; -export function ButtonExamples() { +export function ButtonExample() { const state = useButtonState(); const [{ appearance, disabled, leadingIcon, trailingIcon }] = state; return ( - +