Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement Typography component #96

Merged
merged 2 commits into from
May 25, 2024
Merged

Conversation

baonguyenhsts
Copy link
Collaborator

Summary

Create new component: Typography

Check List

  • Your code builds clean without any errors or warnings.
  • Check coding convention.
  • Updated Storybook components and stories to reflect any changes made to the UI.
  • Test covers all edge cases and coverage is greater than or equal to 80%.

Proof of Completeness

Screenshot 2024-04-22 at 12 55 21 AM

Copy link

Test Result

File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 67.79 44.09 50.39 67.93
File % Stmts % Branch % Funcs % Lines Uncovered Line #s
All files 67.79 44.09 50.39 67.93
_assets/images 100 100 100 100
_ check.png 100 100 100 100
_components 100 100 28.57 100
_ index.ts 100 100 28.57 100
_components/Accordion 94.23 76 100 93.47
_ Accordion.tsx 86.95 63.63 100 86.36 119-122
_ AccordionItem.tsx 100 80 100 100 27-30
_ ToggleAnimation.ts 100 100 100 100
_components/Button 76.47 0 0 75.55
_ Button.tsx 69.23 0 0 75 86-87,114
_ ButtonOutline.tsx 71.42 100 0 71.42 7-8
_ ButtonPrimary.tsx 71.42 100 0 71.42 7-8
_ ButtonSecondary.tsx 71.42 100 0 71.42 7-8
_ ButtonTransparent.tsx 71.42 100 0 71.42 7-8
_ index.ts 100 100 0 100
_components/Card 100 100 100 100
_ Card.tsx 100 100 100 100
_components/Checkbox 98.18 97.05 92.85 100
_ Checkbox.tsx 97.72 97.05 92.85 100 154
_ constants.ts 100 100 100 100
_ index.ts 100 100 100 100
_components/CodeInput 86.66 66.66 73.33 86.79
_ CodeInput.tsx 84 66.66 66.66 84.09 91-94,100,107,110,142
_ Cursor.tsx 100 100 100 100
_components/Icon 100 100 100 100
_ Icon.tsx 100 100 100 100
_components/Progress 90.62 71.42 83.33 90.32
_ Progress.tsx 90.62 71.42 83.33 90.32 81,97-98
_components/RadioButton 85.48 83.33 61.53 88.33
_ Bounceable.tsx 84 100 50 84 83-84,88-89
_ RadioButton.tsx 86.48 80 66.66 91.42 153-155
_components/Slider 21.62 0 0 22.92
_ Slider.tsx 24.65 0 0 25.35 164-309
_ SliderFixed.tsx 18.75 0 0 20 50-184
_ SliderFixedRange.tsx 12 0 0 13.04 69-265
_ SliderRange.tsx 11.21 0 0 12 81-325
_ constants.ts 100 100 100 100
_components/Slider/components 69.76 0 0 83.33
_ Thumb.tsx 70.58 0 0 92.3 37
_ Track.tsx 77.77 100 0 87.5 13
_ TrackPoint.tsx 57.14 100 0 66.66 26-41
_ index.ts 100 100 100 100
_components/Text 100 100 100 100
_ Text.tsx 100 100 100 100
_components/TextInput 96.8 78.33 92.98 96.44
_ TextInput.tsx 100 91.66 100 100 156
_ TextInputFlat.tsx 95.65 72.41 91.3 95.16 89-90,94
_ TextInputOutlined.tsx 95.71 78.94 91.3 95.23 93-94,98
_ constants.ts 100 100 100 100
_ index.ts 100 100 100 100
_components/TextInput/components 100 100 100 100
_ CustomIcon.tsx 100 100 100 100
_ ErrorText.tsx 100 100 100 100
_ index.tsx 100 100 100 100
_components/Typography 100 100 100 100
_ Typography.tsx 100 100 100 100
_core 63.63 25 36.36 58.62
_ BaseProvider.tsx 88.88 40 66.66 85.71 24,28
_ extendTheme.tsx 23.07 0 0 23.07 7,14-29
_ index.ts 100 100 100 100
_helpers 96.42 100 80 100
_ index.ts 100 100 100 100
_ metrics.ts 96.29 100 80 100
_hooks 70.58 0 50 66.66
_ index.ts 100 100 100 100
_ useBase.tsx 50 0 0 42.85 5-11
_ useTheme.tsx 85.71 0 100 83.33 7
_theme 100 100 100 100
_ images.ts 100 100 100 100
_ index.ts 100 100 100 100
_ theme.ts 100 100 100 100
_theme/base 100 100 100 100
_ borderWidths.ts 100 100 100 100
_ colors.ts 100 100 100 100
_ index.ts 100 100 100 100
_ opacity.ts 100 100 100 100
_ shadows.ts 100 100 100 100
_ sizes.ts 100 100 100 100
_ spacing.ts 100 100 100 100
_ typography.ts 100 100 100 100
_theme/components 100 100 100 100
_ Checkbox.ts 100 100 100 100
_ Text.ts 100 100 100 100
_ index.ts 100 100 100 100
_theme/components/Button 100 100 100 100
_ Button.ts 100 100 100 100
_ ButtonOutline.ts 100 100 100 100
_ ButtonPrimary.ts 100 100 100 100
_ ButtonSecondary.ts 100 100 100 100
_ ButtonTransparent.ts 100 100 100 100
_ index.ts 100 100 100 100

@ngochuyduong ngochuyduong self-requested a review May 9, 2024 04:00
style,
...rest
}: TypographyProps): JSX.Element => {
const styles = typographyVariantStyles[variant]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the name to const variantStyles = typographyVariantStyles[variant] to distinguish between other styles, Because styles, style, ... is quite similar, so not easy to know which is the variant style, which is the text style at the first look unless we go to the styles definition.

Just a tiny suggestion. it's up to you

@honghoangsts honghoangsts merged commit 99a4904 into develop May 25, 2024
2 checks passed
@honghoangsts honghoangsts deleted the feat/typography branch May 25, 2024 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants