From 3e62507b481862f1a126d46af75f44554d0b73e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Wlekli=C5=84ski?= <114148518+mwleklinskiVL@users.noreply.github.com> Date: Fri, 3 Nov 2023 13:39:03 +0100 Subject: [PATCH] Chore/review components (#93) * chore: NO-JIRA fix correct type when importing package * chore: TET-400 fix SocialIcons size * chore: TET-396 RadioButton corrections * chore: TET-383 fix Avatar correction * chore: TET-405 change StatusDot stroked to hasStroke * fix: TET-405 StatusDot Test fix * fix: TET-385 fix Button * fix: TET-398 clear button in TextInput * fix: TET-403 change helperText beforeIcon to hasBeforeIcon * fix: TET-382 change AlerBanner Positive to Success intent * fix: TET-384 add wrapper for vertical divider * fix: TET-402 fix height of the toast * fix: TET-402 change location of typo in config Toast * fix: TET-395 change size of a ring to smaller (from 2px to 1px) * fix: TET-384 grid presentation and emphasis order * fix: TET-384 change color of border Badge * fix: TET-390 fix presentation of an IconButton, fix BareButton * fix: TET-386 adjust Checkbox component * feat: TET-399 extract useTextInput hook and use it to create Select component * chore: NO-JIRA add bg to text Input * fix: NO-JIRA fix export file * chore: NO-JIRA: change React.FC to FC * chore: NO-JIRA update readme --- README.md | 35 +++++++ package.json | 2 +- .../AlertBanner/AlertBanner.stories.tsx | 9 +- .../AlertBanner/AlertBanner.styles.ts | 10 +- .../AlertBanner/AlertBanner.test.tsx | 4 +- .../types/AlertBannerIntent.type.ts | 2 +- src/components/Avatar/Avatar.stories.tsx | 5 +- src/components/Avatar/Avatar.styles.ts | 2 +- src/components/Avatar/Avatar.tsx | 2 +- .../Avatar/types/AvatarAppearance.type.ts | 35 +++---- src/components/Badge/Badge.stories.tsx | 9 ++ src/components/Badge/Badge.styles.ts | 2 +- src/components/Badge/Badge.tsx | 6 +- src/components/Button/Button.stories.tsx | 10 ++ src/components/Button/Button.styles.ts | 4 +- src/components/Button/Button.tsx | 6 +- .../stylesBuilder/stylesBuilder.test.ts | 2 +- src/components/Checkbox/Checkbox.props.ts | 9 +- src/components/Checkbox/Checkbox.stories.tsx | 13 ++- src/components/Checkbox/Checkbox.test.tsx | 23 +++-- src/components/Checkbox/Checkbox.tsx | 16 +++- .../CheckboxGroup/CheckboxGroup.tsx | 14 ++- src/components/Counter/Counter.tsx | 2 +- src/components/Divider/Divider.stories.tsx | 5 + src/components/Divider/Divider.tsx | 2 +- src/components/HelperText/HelperText.props.ts | 2 +- .../HelperText/HelperText.stories.tsx | 2 +- src/components/HelperText/HelperText.test.tsx | 10 +- src/components/HelperText/HelperText.tsx | 4 +- .../IconButton/IconButton.styles.ts | 6 +- src/components/IconButton/IconButton.tsx | 6 +- .../InlineBanner/InlineBanner.styles.ts | 1 + src/components/InlineBanner/InlineBanner.tsx | 9 +- .../InlineMessage/InlineMessage.tsx | 6 +- .../InlineSearchInput/InlineSearchInput.tsx | 6 +- src/components/Label/Label.tsx | 4 +- src/components/Loader/Loader.tsx | 10 +- src/components/Popover/Popover.styles.ts | 2 +- src/components/Popover/Popover.tsx | 2 +- .../RadioButton/RadioButton.stories.tsx | 1 + src/components/RadioButton/RadioButton.tsx | 22 ++++- .../RadioButtonGroup/RadioButtonGroup.tsx | 8 +- src/components/SearchInput/SearchInput.tsx | 8 +- src/components/Select/Select.test.tsx | 6 +- src/components/Select/Select.tsx | 92 +++++++++++++++++-- src/components/SocialButton/SocialButton.tsx | 2 +- src/components/SocialButton/socials/Apple.tsx | 4 +- .../SocialButton/socials/Facebook.tsx | 14 +-- src/components/SocialButton/socials/Figma.tsx | 22 ++--- .../SocialButton/socials/Github.tsx | 4 +- .../SocialButton/socials/Google.tsx | 20 ++-- .../SocialButton/socials/Twitter.tsx | 4 +- .../SocialButton/socials/WithLoader.tsx | 2 +- .../SocialButton/socials/socials.ts | 6 +- src/components/StatusDot/StatusDot.props.ts | 3 +- .../StatusDot/StatusDot.stories.tsx | 4 +- src/components/StatusDot/StatusDot.styles.ts | 4 +- src/components/StatusDot/StatusDot.test.tsx | 4 +- src/components/StatusDot/StatusDot.tsx | 8 +- .../StatusDot/stylesBuilder/stylesBuilder.ts | 8 +- src/components/Tag/Tag.tsx | 10 +- src/components/TextInput/TextInput.styles.ts | 1 + src/components/TextInput/TextInput.tsx | 64 ++++--------- src/components/TextInput/useTextInput.ts | 67 ++++++++++++++ src/components/Toast/Toast.styles.ts | 4 +- src/components/Toast/Toast.tsx | 2 +- .../Toast/stylesBuilder/stylesBuilder.ts | 8 +- src/docs-components/AlertBannerDocs.tsx | 8 +- src/docs-components/AvatarDocs.tsx | 4 +- src/docs-components/BadgeDocs.tsx | 60 +++++++----- src/docs-components/ButtonDocs/ButtonDocs.tsx | 4 +- src/docs-components/ButtonDocs/ButtonRow.tsx | 2 +- src/docs-components/CheckboxDocs.tsx | 58 +++++++----- src/docs-components/HelperTextDocs.tsx | 2 +- src/docs-components/IconButtonDocs.tsx | 1 + src/docs-components/RadioButtonDocs.tsx | 35 ++++--- src/docs-components/StatusDotDocs.tsx | 2 +- src/docs-components/TagDocs.tsx | 4 +- src/docs-components/TetDocs.tsx | 2 +- src/docs-components/common/Cols.tsx | 8 +- src/docs-components/common/Hero.tsx | 2 +- src/docs-components/common/SectionHeader.tsx | 8 +- src/docs-components/common/States.tsx | 52 +++++++---- src/index.ts | 1 + 84 files changed, 626 insertions(+), 328 deletions(-) create mode 100644 src/components/TextInput/useTextInput.ts diff --git a/README.md b/README.md index cd335c65..15780f65 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,41 @@ If you want to dive deeper into the components Tetrisly offers, check out our of You can also check out our Storybook, which is our Documentation for React components (now in progress): [Tetrisly Storybook](https://virtuslab.github.io/tetrisly-react/?path=/docs/alertbanner--docs) +## Customization + +All Tetrisly components have a `custom` prop. It makes it possible to customize the component without the need to create a new one. Below you can see an example of Button customization + +### Button + +If you want to change any of button styles, you can make it by passing custom props with object based on +specific component config. + +For instance, to change background-color of appereance="primary" intent="secondary" variant to pink, just pass +refferenced object structure: + +```jsx +