creactive 0.0.55 → 0.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/build/index.js +1656 -2
  2. package/package.json +6 -4
  3. package/source/components/index.ts +2 -0
  4. package/source/components/text/constants/color.ts +26 -0
  5. package/source/components/text/constants/font.ts +32 -0
  6. package/source/components/text/constants/index.ts +5 -0
  7. package/source/components/text/constants/role.ts +12 -0
  8. package/source/components/text/constants/text.ts +22 -0
  9. package/source/components/text/constants/type.ts +27 -0
  10. package/source/components/text/index.ts +2 -0
  11. package/source/components/text/spec/children.spec.tsx +13 -0
  12. package/source/components/text/spec/color.spec.native.tsx +15 -0
  13. package/source/components/text/spec/color.spec.tsx +159 -0
  14. package/source/components/text/spec/color.spec.web.tsx +15 -0
  15. package/source/components/text/spec/font.spec.tsx +196 -0
  16. package/source/components/text/spec/position.spec.tsx +15 -0
  17. package/source/components/text/spec/text.spec.native.tsx +1043 -0
  18. package/source/components/text/spec/text.spec.tsx +39 -0
  19. package/source/components/text/spec/text.spec.web.tsx +1043 -0
  20. package/source/components/text/spec/type.spec.web.tsx +55 -0
  21. package/source/components/text/text.stories.tsx +46 -0
  22. package/source/components/text/text.tsx +262 -0
  23. package/source/components/text/text.types.ts +67 -0
  24. package/source/constants/index.ts +46 -0
  25. package/source/constants/theme/color.ts +27 -0
  26. package/source/constants/theme/font.ts +48 -0
  27. package/source/constants/theme/index.ts +50 -0
  28. package/source/constants/theme/text.ts +12 -0
  29. package/source/contexts/index.ts +15 -0
  30. package/source/contexts/media/components/index.ts +4 -0
  31. package/source/contexts/media/components/media/index.ts +2 -0
  32. package/source/contexts/media/components/media/media.tsx +37 -0
  33. package/source/contexts/media/components/media/media.types.ts +26 -0
  34. package/source/contexts/media/components/wrapper/index.ts +2 -0
  35. package/source/contexts/media/components/wrapper/wrapper.tsx +73 -0
  36. package/source/contexts/media/components/wrapper/wrapper.types.ts +3 -0
  37. package/source/contexts/media/constants/breakpoint.ts +18 -0
  38. package/source/contexts/media/constants/index.ts +6 -0
  39. package/source/contexts/media/hooks/index.ts +1 -0
  40. package/source/contexts/media/hooks/use-breakpoint.ts +18 -0
  41. package/source/contexts/media/index.ts +7 -0
  42. package/source/contexts/media/media.tsx +36 -0
  43. package/source/contexts/media/media.types.ts +38 -0
  44. package/source/contexts/theme/index.ts +8 -0
  45. package/source/contexts/theme/theme.tsx +280 -0
  46. package/source/contexts/theme/theme.types.ts +284 -0
  47. package/source/helpers/index.ts +3 -0
  48. package/source/helpers/storybook/constants/control.ts +25 -0
  49. package/source/helpers/storybook/constants/index.ts +1 -0
  50. package/source/helpers/storybook/control.spec.ts +140 -0
  51. package/source/helpers/storybook/control.ts +115 -0
  52. package/source/helpers/storybook/index.ts +1 -0
  53. package/source/helpers/style/index.ts +2 -0
  54. package/source/helpers/style/style.spec.web.ts +20 -0
  55. package/source/helpers/style/style.ts +14 -0
  56. package/source/helpers/style/style.types.ts +14 -0
  57. package/source/hooks/index.ts +1 -0
  58. package/source/hooks/use-theme-style-sheet.ts +135 -0
  59. package/source/index.ts +24 -0
  60. package/build/index.js.LICENSE.txt +0 -9
@@ -0,0 +1,39 @@
1
+ import { faker } from '@faker-js/faker'
2
+ import { render, screen } from '@testing-library/react-native'
3
+ import { Text } from '../text'
4
+
5
+ describe('@/components/text', () => {
6
+ describe('text align passing as property', () => {
7
+ it('renders with LEFT text alignment style by default', () => {
8
+ const text = faker.lorem.words(2)
9
+ render(<Text>{text}</Text>)
10
+ expect(screen.getByText(text)).toHaveStyle({
11
+ textAlign: 'left',
12
+ })
13
+ })
14
+
15
+ it('renders with LEFT text alignment style when provided', () => {
16
+ const text = faker.lorem.words(2)
17
+ render(<Text align={Text.Align.LEFT}>{text}</Text>)
18
+ expect(screen.getByText(text)).toHaveStyle({
19
+ textAlign: 'left',
20
+ })
21
+ })
22
+
23
+ it('renders with CENTER text alignment style when provided', () => {
24
+ const text = faker.lorem.words(2)
25
+ render(<Text align={Text.Align.CENTER}>{text}</Text>)
26
+ expect(screen.getByText(text)).toHaveStyle({
27
+ textAlign: 'center',
28
+ })
29
+ })
30
+
31
+ it('renders with RIGHT text alignment style when provided', () => {
32
+ const text = faker.lorem.words(2)
33
+ render(<Text align={Text.Align.RIGHT}>{text}</Text>)
34
+ expect(screen.getByText(text)).toHaveStyle({
35
+ textAlign: 'right',
36
+ })
37
+ })
38
+ })
39
+ })