enwawa-ui 1.0.7

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 (115) hide show
  1. package/.babelrc.json +16 -0
  2. package/.eslintrc.cjs +37 -0
  3. package/.husky/pre-commit +6 -0
  4. package/.prettierignore +6 -0
  5. package/.prettierrc +4 -0
  6. package/.storybook/main.ts +21 -0
  7. package/.storybook/preview.tsx +57 -0
  8. package/.vscode/settings.json +14 -0
  9. package/CHANGELOG.md +118 -0
  10. package/auto.config.ts +34 -0
  11. package/constants.ts +1 -0
  12. package/createIndexes.js +34 -0
  13. package/index.ts +5 -0
  14. package/package.json +94 -0
  15. package/placeholder.ts +1 -0
  16. package/readme.md +1 -0
  17. package/rollup.config.mjs +48 -0
  18. package/stories/Introduction.mdx +221 -0
  19. package/stories/assets/backgrounds/bg-1.png +0 -0
  20. package/stories/assets/carousel/login/1st.png +0 -0
  21. package/stories/assets/icons/code-brackets.svg +1 -0
  22. package/stories/assets/icons/colors.svg +1 -0
  23. package/stories/assets/icons/comments.svg +1 -0
  24. package/stories/assets/icons/direction.svg +1 -0
  25. package/stories/assets/icons/flow.svg +1 -0
  26. package/stories/assets/icons/plugin.svg +1 -0
  27. package/stories/assets/icons/repo.svg +1 -0
  28. package/stories/assets/icons/stackalt.svg +1 -0
  29. package/stories/assets/icons/wawa-isotype.svg +4 -0
  30. package/stories/assets/icons/wawa-logo.svg +6 -0
  31. package/stories/atoms/AtAvatar/AtAvatar.stories.tsx +61 -0
  32. package/stories/atoms/AtAvatar/index.tsx +46 -0
  33. package/stories/atoms/AtButton/AtButton.stories.ts +88 -0
  34. package/stories/atoms/AtButton/index.tsx +69 -0
  35. package/stories/atoms/AtButton/styles.ts +13 -0
  36. package/stories/atoms/AtCheckBox/AtCheckBox.stories.tsx +30 -0
  37. package/stories/atoms/AtCheckBox/index.tsx +38 -0
  38. package/stories/atoms/AtDatePicker/AtDatePicker.stories.tsx +45 -0
  39. package/stories/atoms/AtDatePicker/index.tsx +93 -0
  40. package/stories/atoms/AtDivider/AtDivider.stories.tsx +57 -0
  41. package/stories/atoms/AtDivider/index.tsx +44 -0
  42. package/stories/atoms/AtImage/AtImage.stories.tsx +66 -0
  43. package/stories/atoms/AtImage/index.tsx +41 -0
  44. package/stories/atoms/AtLogo/AtLogo.stories.ts +47 -0
  45. package/stories/atoms/AtLogo/index.tsx +22 -0
  46. package/stories/atoms/AtLogo/styles.ts +26 -0
  47. package/stories/atoms/AtNumberInput/AtNumberInput.stories.ts +40 -0
  48. package/stories/atoms/AtNumberInput/index.tsx +138 -0
  49. package/stories/atoms/AtNumberInput/styles.tsx +7 -0
  50. package/stories/atoms/AtPasswordInput/AtPasswordInput.stories.ts +24 -0
  51. package/stories/atoms/AtPasswordInput/index.tsx +11 -0
  52. package/stories/atoms/AtRadio/AtRadio.stories.tsx +36 -0
  53. package/stories/atoms/AtRadio/index.tsx +44 -0
  54. package/stories/atoms/AtSelect/AtSelect.stories.tsx +132 -0
  55. package/stories/atoms/AtSelect/index.tsx +229 -0
  56. package/stories/atoms/AtSelect/styles.tsx +8 -0
  57. package/stories/atoms/AtText/AtText.stories.ts +104 -0
  58. package/stories/atoms/AtText/index.tsx +65 -0
  59. package/stories/atoms/AtTextInput/AtTextInput.stories.ts +40 -0
  60. package/stories/atoms/AtTextInput/index.tsx +85 -0
  61. package/stories/atoms/AtTitle/AtTitle.stories.ts +103 -0
  62. package/stories/atoms/AtTitle/index.tsx +77 -0
  63. package/stories/atoms/AtTitle/styles.ts +7 -0
  64. package/stories/atoms/index.ts +14 -0
  65. package/stories/molecules/MlBreadCrumb/MlBreadCrumb.stories.tsx +123 -0
  66. package/stories/molecules/MlBreadCrumb/index.tsx +29 -0
  67. package/stories/molecules/MlCard/MlCard.stories.tsx +55 -0
  68. package/stories/molecules/MlCard/index.tsx +100 -0
  69. package/stories/molecules/MlCard/styles.tsx +22 -0
  70. package/stories/molecules/MlCarousel/MlCarousel.stories.tsx +98 -0
  71. package/stories/molecules/MlCarousel/index.tsx +67 -0
  72. package/stories/molecules/MlDropdown/MlDropdown.stories.tsx +121 -0
  73. package/stories/molecules/MlDropdown/index.tsx +97 -0
  74. package/stories/molecules/MlFormItem/MlFormItem.stories.tsx +33 -0
  75. package/stories/molecules/MlFormItem/index.tsx +100 -0
  76. package/stories/molecules/MlRadioGroup/MlRadioGroup.stories.ts +40 -0
  77. package/stories/molecules/MlRadioGroup/index.tsx +60 -0
  78. package/stories/molecules/index.ts +6 -0
  79. package/stories/organisms/OrAlert/OrAlert.stories.tsx +136 -0
  80. package/stories/organisms/OrAlert/index.tsx +64 -0
  81. package/stories/organisms/OrCol/OrCol.stories.tsx +33 -0
  82. package/stories/organisms/OrCol/index.tsx +108 -0
  83. package/stories/organisms/OrCol/styles.ts +86 -0
  84. package/stories/organisms/OrContent/index.tsx +6 -0
  85. package/stories/organisms/OrCountryCard/OrCountryCard.stories.ts +19 -0
  86. package/stories/organisms/OrCountryCard/index.tsx +55 -0
  87. package/stories/organisms/OrFlagGrid/OrFlagGrid.stories.ts +41 -0
  88. package/stories/organisms/OrFlagGrid/index.tsx +54 -0
  89. package/stories/organisms/OrFrom/index.tsx +10 -0
  90. package/stories/organisms/OrHeader/index.tsx +6 -0
  91. package/stories/organisms/OrLayout/index.tsx +6 -0
  92. package/stories/organisms/OrLoginLayout/OrLoginLayout.stories.tsx +34 -0
  93. package/stories/organisms/OrLoginLayout/index.tsx +63 -0
  94. package/stories/organisms/OrLoginLayout/styles.tsx +16 -0
  95. package/stories/organisms/OrRow/OrRow.stories.tsx +48 -0
  96. package/stories/organisms/OrRow/index.tsx +71 -0
  97. package/stories/organisms/OrRow/styles.ts +24 -0
  98. package/stories/organisms/OrSider/index.tsx +6 -0
  99. package/stories/organisms/OrSimpleBanner/OrSimpleBanner.stories.ts +18 -0
  100. package/stories/organisms/OrSimpleBanner/index.tsx +26 -0
  101. package/stories/organisms/OrSimpleBanner/styles.ts +12 -0
  102. package/stories/organisms/OrSpace/OrSpace.stories.tsx +169 -0
  103. package/stories/organisms/OrSpace/index.tsx +43 -0
  104. package/stories/organisms/OrSpaceCompact/OrSpaceCompact.stories.tsx +94 -0
  105. package/stories/organisms/OrSpaceCompact/index.tsx +35 -0
  106. package/stories/organisms/index.ts +14 -0
  107. package/stories/templates/TmLoginCountry/TmLoginCountry.stories.ts +44 -0
  108. package/stories/templates/TmLoginCountry/index.tsx +64 -0
  109. package/stories/templates/TmLoginCountry/styles.tsx +14 -0
  110. package/stories/templates/TmLoginPhone/TmLoginPhone.stories.tsx +49 -0
  111. package/stories/templates/TmLoginPhone/index.tsx +191 -0
  112. package/stories/templates/TmLoginPhone/styles.tsx +31 -0
  113. package/stories/templates/index.ts +2 -0
  114. package/theme.tsx +56 -0
  115. package/tsconfig.json +38 -0
@@ -0,0 +1,71 @@
1
+ import React from 'react';
2
+ import { Gutter } from 'antd/es/grid/row';
3
+ import { StyledRow } from './styles';
4
+ import { RowProps } from 'antd';
5
+
6
+ export interface OrRowProps {
7
+ /**
8
+ * The ID for input
9
+ */
10
+ id?: string;
11
+
12
+ /**
13
+ * Vertical alignment
14
+ */
15
+ align?: RowProps['align'];
16
+ /**
17
+ * Container background source
18
+ */
19
+ $backgroundSrc?: string;
20
+ /**
21
+ * Spacing between grids, could be a number or a object like { xs: 8, sm: 16, md: 24}. Or you can use array to make horizontal and vertical spacing work at the same time [horizontal, vertical]
22
+ */
23
+ gutter?: Gutter | object | [Gutter, Gutter];
24
+ /**
25
+ * Horizontal arrangement
26
+ */
27
+ justify?: RowProps['justify'];
28
+ /**
29
+ * Auto wrap line
30
+ */
31
+ wrap?: boolean;
32
+ /**
33
+ * Children of OrRow
34
+ */
35
+ children?: React.ReactElement | React.ReactElement[];
36
+ /**
37
+ * Container padding top in px
38
+ */
39
+ $paddingTop?: number;
40
+ /**
41
+ * Container padding Bottom in px
42
+ */
43
+ $paddingBottom?: number;
44
+ /**
45
+ * Container padding Right in px
46
+ */
47
+ $paddingRight?: number;
48
+ /**
49
+ * Container padding Left in px
50
+ */
51
+ $paddingLeft?: number;
52
+ /**
53
+ * Container padding Vertical in px
54
+ */
55
+ $paddingVertical?: number;
56
+ /**
57
+ * Container padding Horizontal in px
58
+ */
59
+ $paddingHorizontal?: number;
60
+ }
61
+
62
+ export const OrRow: React.FC<OrRowProps> = (props) => {
63
+ return <StyledRow {...props}>{props.children}</StyledRow>;
64
+ };
65
+
66
+ OrRow.defaultProps = {
67
+ align: 'top',
68
+ gutter: 0,
69
+ justify: 'start',
70
+ wrap: true,
71
+ };
@@ -0,0 +1,24 @@
1
+ import { styled } from 'styled-components';
2
+ import { OrRowProps } from '.';
3
+ import { Row } from 'antd';
4
+
5
+ export const StyledRow = styled(Row)<OrRowProps>`
6
+ ${({ $backgroundSrc }) =>
7
+ $backgroundSrc ? `background-image: url(${$backgroundSrc})` : ''};
8
+ object-fit: cover;
9
+ ${({ $paddingTop }) => ($paddingTop ? `padding-top: ${$paddingTop}px` : '')};
10
+ ${({ $paddingBottom }) =>
11
+ $paddingBottom ? `padding-bottom: ${$paddingBottom}px` : ''};
12
+ ${({ $paddingRight }) =>
13
+ $paddingRight ? `padding-right: ${$paddingRight}px` : ''};
14
+ ${({ $paddingLeft }) =>
15
+ $paddingLeft ? `padding-left: ${$paddingLeft}px` : ''};
16
+ ${({ $paddingVertical }) =>
17
+ $paddingVertical
18
+ ? `padding-top: ${$paddingVertical}px; padding-bottom: ${$paddingVertical}px`
19
+ : ''};
20
+ ${({ $paddingHorizontal }) =>
21
+ $paddingHorizontal
22
+ ? `padding-left: ${$paddingHorizontal}px; padding-right: ${$paddingHorizontal}px`
23
+ : ''};
24
+ `;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { Layout, LayoutProps } from 'antd';
3
+
4
+ export const OrSider: React.FC<LayoutProps> = (props) => (
5
+ <Layout.Sider {...props}>{props.children}</Layout.Sider>
6
+ );
@@ -0,0 +1,18 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { OrSimpleBanner } from '.';
3
+ import defaultBackground from '../../assets/backgrounds/bg-1.png';
4
+ const meta = {
5
+ title: 'Organisms/OrSimpleBanner',
6
+ component: OrSimpleBanner,
7
+ tags: ['autodocs'],
8
+ } satisfies Meta<typeof OrSimpleBanner>;
9
+
10
+ export default meta;
11
+ type Story = StoryObj<typeof meta>;
12
+
13
+ export const Default: Story = {
14
+ args: {
15
+ id: '1',
16
+ $backgroundSrc: defaultBackground,
17
+ },
18
+ };
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { AtLogo } from '../../atoms';
3
+ import { OrRow } from '../OrRow';
4
+ import { LogoContainer, StyledHeader } from './styles';
5
+ export interface OrSimpleBannerProps {
6
+ /**
7
+ * Id of the OrSimpleBannerProps
8
+ */
9
+ id?: string;
10
+ /**
11
+ * Background image for banner
12
+ */
13
+ $backgroundSrc?: string;
14
+ }
15
+
16
+ export const OrSimpleBanner: React.FC<OrSimpleBannerProps> = (props) => {
17
+ return (
18
+ <StyledHeader>
19
+ <OrRow justify={'center'} {...props}>
20
+ <LogoContainer>
21
+ <AtLogo color={props.$backgroundSrc ? 'white' : 'violet'} />
22
+ </LogoContainer>
23
+ </OrRow>
24
+ </StyledHeader>
25
+ );
26
+ };
@@ -0,0 +1,12 @@
1
+ import { styled } from 'styled-components';
2
+ import { OrHeader } from '../OrHeader';
3
+
4
+ export const LogoContainer = styled.div`
5
+ padding-top: 69px;
6
+ padding-bottom: 69px;
7
+ `;
8
+
9
+ export const StyledHeader = styled(OrHeader)`
10
+ height: auto;
11
+ padding-inline: 0;
12
+ `;
@@ -0,0 +1,169 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { OrSpace } from '.';
3
+ import { AtButton } from '../../atoms/AtButton';
4
+ import React, { CSSProperties } from 'react';
5
+
6
+ const meta = {
7
+ title: 'Organisms/OrSpace',
8
+ component: OrSpace,
9
+ tags: ['autodocs'],
10
+ argTypes: {
11
+ align: { options: ['start', 'end', 'center', 'baseline'] },
12
+ direction: { options: ['vertical', 'horizontal'] },
13
+ size: { options: ['small', 'middle', 'large', 1, 2, 3, 5, 8] },
14
+ },
15
+ } satisfies Meta<typeof OrSpace>;
16
+
17
+ export default meta;
18
+
19
+ type Story = StoryObj<typeof meta>;
20
+
21
+ export const Basic: Story = {
22
+ args: {
23
+ id: '1',
24
+ },
25
+ render: (args) => {
26
+ return (
27
+ <OrSpace {...args}>
28
+ {new Array(5).fill(null).map((_, index) => (
29
+ <AtButton key={index} value={`AtButton-${index}`} />
30
+ ))}
31
+ </OrSpace>
32
+ );
33
+ },
34
+ };
35
+
36
+ const alignStyles: CSSProperties = {
37
+ flex: 'none',
38
+ margin: '8px 4px',
39
+ padding: '4px',
40
+ border: '1px solid #40a9ff',
41
+ };
42
+
43
+ const mockBlock: CSSProperties = {
44
+ display: 'inline-block',
45
+ padding: '32px 8px 16px',
46
+ background: 'rgba(150, 150, 150, 0.2)',
47
+ };
48
+
49
+ export const AlignEnd: Story = {
50
+ args: {
51
+ id: '1',
52
+ align: 'end',
53
+ },
54
+ render: (args) => {
55
+ return (
56
+ <div style={alignStyles}>
57
+ <OrSpace {...args}>
58
+ <>
59
+ {new Array(5).fill(null).map((_, index) => (
60
+ <AtButton key={index} value={`AtButton-${index}`} />
61
+ ))}
62
+ <span style={mockBlock}>Block</span>
63
+ </>
64
+ </OrSpace>
65
+ </div>
66
+ );
67
+ },
68
+ };
69
+
70
+ export const AlignCenter: Story = {
71
+ args: {
72
+ id: '1',
73
+ align: 'center',
74
+ },
75
+ render: (args) => {
76
+ return (
77
+ <div style={alignStyles}>
78
+ <OrSpace {...args}>
79
+ <>
80
+ {new Array(5).fill(null).map((_, index) => (
81
+ <AtButton key={index} value={`AtButton-${index}`} />
82
+ ))}
83
+ <span style={mockBlock}>Block</span>
84
+ </>
85
+ </OrSpace>
86
+ </div>
87
+ );
88
+ },
89
+ };
90
+ export const AlignBaseLine: Story = {
91
+ args: {
92
+ id: '1',
93
+ align: 'baseline',
94
+ },
95
+ render: (args) => {
96
+ return (
97
+ <div style={alignStyles}>
98
+ <OrSpace {...args}>
99
+ <>
100
+ {new Array(5).fill(null).map((_, index) => (
101
+ <AtButton key={index} value={`AtButton-${index}`} />
102
+ ))}
103
+ <span style={mockBlock}>Block</span>
104
+ </>
105
+ </OrSpace>
106
+ </div>
107
+ );
108
+ },
109
+ };
110
+ export const Vertical: Story = {
111
+ args: {
112
+ id: '1',
113
+ direction: 'vertical',
114
+ },
115
+ render: (args) => {
116
+ return (
117
+ <OrSpace {...args}>
118
+ {new Array(5).fill(null).map((_, index) => (
119
+ <AtButton key={index} value={`AtButton-${index}`} />
120
+ ))}
121
+ </OrSpace>
122
+ );
123
+ },
124
+ };
125
+ export const Middle: Story = {
126
+ args: {
127
+ id: '1',
128
+ size: 'middle',
129
+ },
130
+ render: (args) => {
131
+ return (
132
+ <OrSpace {...args}>
133
+ {new Array(5).fill(null).map((_, index) => (
134
+ <AtButton key={index} value={`AtButton-${index}`} />
135
+ ))}
136
+ </OrSpace>
137
+ );
138
+ },
139
+ };
140
+ export const Large: Story = {
141
+ args: {
142
+ id: '1',
143
+ size: 'large',
144
+ },
145
+ render: (args) => {
146
+ return (
147
+ <OrSpace {...args}>
148
+ {new Array(5).fill(null).map((_, index) => (
149
+ <AtButton key={index} value={`AtButton-${index}`} />
150
+ ))}
151
+ </OrSpace>
152
+ );
153
+ },
154
+ };
155
+ export const Wrap: Story = {
156
+ args: {
157
+ id: '1',
158
+ wrap: true,
159
+ },
160
+ render: (args) => {
161
+ return (
162
+ <OrSpace {...args}>
163
+ {new Array(5).fill(null).map((_, index) => (
164
+ <AtButton key={index} value={`AtButton-${index}`} />
165
+ ))}
166
+ </OrSpace>
167
+ );
168
+ },
169
+ };
@@ -0,0 +1,43 @@
1
+ import React, { ReactNode } from 'react';
2
+ import { Space, SpaceProps } from 'antd';
3
+
4
+ export interface AtSpaceProps {
5
+ /**
6
+ * The ID for input
7
+ */
8
+ id?: string;
9
+ /**
10
+ * Align items
11
+ */
12
+ align?: 'start' | 'end' | 'center' | 'baseline';
13
+ /**
14
+ * The space direction
15
+ */
16
+ direction?: 'vertical' | 'horizontal';
17
+ /**
18
+ * The space size
19
+ */
20
+ size?: SpaceProps['size'];
21
+ /**
22
+ * Set split
23
+ */
24
+ split?: ReactNode;
25
+ /**
26
+ * Auto wrap line, when horizontal effective
27
+ */
28
+ wrap?: boolean;
29
+ /**
30
+ * Children of the OrSpace
31
+ */
32
+ children?: React.ReactElement | React.ReactElement[];
33
+ }
34
+
35
+ export const OrSpace: React.FC<AtSpaceProps> = (props) => {
36
+ return <Space {...props}>{props.children}</Space>;
37
+ };
38
+
39
+ OrSpace.defaultProps = {
40
+ direction: 'horizontal',
41
+ size: 'small',
42
+ wrap: false,
43
+ };
@@ -0,0 +1,94 @@
1
+ import React from 'react';
2
+ import { Meta, StoryObj } from '@storybook/react';
3
+ import { OrSpaceCompact } from '.';
4
+ import { AtButton } from '../../atoms/AtButton';
5
+
6
+ const meta = {
7
+ title: 'Organisms/OrSpaceCompact',
8
+ component: OrSpaceCompact,
9
+ tags: ['autodocs'],
10
+ argTypes: {
11
+ direction: { options: ['vertical', 'horizontal'] },
12
+ size: { options: ['small', 'middle', 'large'] },
13
+ },
14
+ } satisfies Meta<typeof OrSpaceCompact>;
15
+
16
+ export default meta;
17
+
18
+ type Story = StoryObj<typeof meta>;
19
+
20
+ export const Basic: Story = {
21
+ render: (args) => {
22
+ return (
23
+ <OrSpaceCompact {...args}>
24
+ {new Array(5).fill(null).map((_, index) => (
25
+ <AtButton key={index} value={`AtButton-${index}`} />
26
+ ))}
27
+ </OrSpaceCompact>
28
+ );
29
+ },
30
+ args: {
31
+ id: '1',
32
+ },
33
+ };
34
+
35
+ export const Block: Story = {
36
+ render: (args) => {
37
+ return (
38
+ <OrSpaceCompact {...args}>
39
+ {new Array(5).fill(null).map((_, index) => (
40
+ <AtButton key={index} value={`AtButton-${index}`} />
41
+ ))}
42
+ </OrSpaceCompact>
43
+ );
44
+ },
45
+ args: {
46
+ id: '1',
47
+ block: true,
48
+ },
49
+ };
50
+ export const Vertical: Story = {
51
+ render: (args) => {
52
+ return (
53
+ <OrSpaceCompact {...args}>
54
+ {new Array(5).fill(null).map((_, index) => (
55
+ <AtButton key={index} value={`AtButton-${index}`} />
56
+ ))}
57
+ </OrSpaceCompact>
58
+ );
59
+ },
60
+ args: {
61
+ id: '1',
62
+ direction: 'vertical',
63
+ },
64
+ };
65
+ export const Large: Story = {
66
+ render: (args) => {
67
+ return (
68
+ <OrSpaceCompact {...args}>
69
+ {new Array(5).fill(null).map((_, index) => (
70
+ <AtButton key={index} value={`AtButton-${index}`} />
71
+ ))}
72
+ </OrSpaceCompact>
73
+ );
74
+ },
75
+ args: {
76
+ id: '1',
77
+ size: 'large',
78
+ },
79
+ };
80
+ export const Small: Story = {
81
+ render: (args) => {
82
+ return (
83
+ <OrSpaceCompact {...args}>
84
+ {new Array(5).fill(null).map((_, index) => (
85
+ <AtButton key={index} value={`AtButton-${index}`} />
86
+ ))}
87
+ </OrSpaceCompact>
88
+ );
89
+ },
90
+ args: {
91
+ id: '1',
92
+ size: 'small',
93
+ },
94
+ };
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import { Space } from 'antd';
3
+
4
+ export interface AtSpaceCompactProps {
5
+ /**
6
+ * The ID for input
7
+ */
8
+ id?: string;
9
+ /**
10
+ * Option to fit width to its parent's width
11
+ */
12
+ block?: boolean;
13
+ /**
14
+ * Set direction of layout
15
+ */
16
+ direction?: 'vertical' | 'horizontal';
17
+ /**
18
+ * Set child component size
19
+ */
20
+ size?: 'large' | 'middle' | 'small';
21
+ /**
22
+ * Children of the OrSpace
23
+ */
24
+ children?: React.ReactElement | React.ReactElement[];
25
+ }
26
+
27
+ export const OrSpaceCompact: React.FC<AtSpaceCompactProps> = (props) => {
28
+ return <Space.Compact {...props}>{props.children}</Space.Compact>;
29
+ };
30
+
31
+ OrSpaceCompact.defaultProps = {
32
+ block: false,
33
+ direction: 'horizontal',
34
+ size: 'middle',
35
+ };
@@ -0,0 +1,14 @@
1
+ export * from './OrAlert';
2
+ export * from './OrCol';
3
+ export * from './OrContent';
4
+ export * from './OrCountryCard';
5
+ export * from './OrFlagGrid';
6
+ export * from './OrFrom';
7
+ export * from './OrHeader';
8
+ export * from './OrLayout';
9
+ export * from './OrLoginLayout';
10
+ export * from './OrRow';
11
+ export * from './OrSider';
12
+ export * from './OrSimpleBanner';
13
+ export * from './OrSpace';
14
+ export * from './OrSpaceCompact';
@@ -0,0 +1,44 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { TmLoginCountry } from '.';
3
+ import defaultBackground from '../../assets/backgrounds/bg-1.png';
4
+
5
+ const meta = {
6
+ title: 'Templates/TmLoginCountry',
7
+ component: TmLoginCountry,
8
+ tags: ['autodocs'],
9
+ } satisfies Meta<typeof TmLoginCountry>;
10
+
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+
14
+ const CountriesExampleData = [
15
+ {
16
+ name: 'Venezuela',
17
+ flagSrc:
18
+ 'https://upload.wikimedia.org/wikipedia/commons/0/06/Flag_of_Venezuela.svg',
19
+ },
20
+ {
21
+ name: 'Colombia',
22
+ flagSrc:
23
+ 'https://upload.wikimedia.org/wikipedia/commons/2/21/Flag_of_Colombia.svg',
24
+ },
25
+ {
26
+ name: 'Mexico',
27
+ flagSrc:
28
+ 'https://upload.wikimedia.org/wikipedia/commons/f/fc/Flag_of_Mexico.svg',
29
+ },
30
+ {
31
+ name: 'Peru',
32
+ flagSrc:
33
+ 'https://upload.wikimedia.org/wikipedia/commons/c/cf/Flag_of_Peru.svg',
34
+ },
35
+ ];
36
+
37
+ export const Basic: Story = {
38
+ args: {
39
+ id: '1',
40
+ data: CountriesExampleData,
41
+ $backgroundSrc: defaultBackground,
42
+ title: 'Selecciona tu país o región',
43
+ },
44
+ };
@@ -0,0 +1,64 @@
1
+ import React from 'react';
2
+
3
+ import { OrFlagGrid } from '../../organisms/OrFlagGrid';
4
+ import { AtTitle } from '../../atoms';
5
+ import { StyledContainer } from './styles';
6
+ import { OrCountryCardProps } from '../../organisms/OrCountryCard';
7
+ import { OrSimpleBanner } from '../../organisms/OrSimpleBanner';
8
+ import { OrRow, OrCol, OrContent } from '../../organisms';
9
+ export interface TmLoginCountryProps {
10
+ /**
11
+ * The ID for cards
12
+ */
13
+ id?: string;
14
+ data?: OrCountryCardProps[];
15
+ title?: string;
16
+ itemsPerRow?: number;
17
+ $backgroundSrc?: string;
18
+ /**
19
+ * Index selected Item
20
+ */
21
+ selectedItem?: number;
22
+ /**
23
+ * Callback when card is clicked
24
+ */
25
+ onSelectCard?: (index: number) => void;
26
+ }
27
+
28
+ export const TmLoginCountry: React.FC<TmLoginCountryProps> = ({
29
+ data,
30
+ $backgroundSrc,
31
+ itemsPerRow,
32
+ id,
33
+ title,
34
+ selectedItem,
35
+ onSelectCard,
36
+ }) => {
37
+ return (
38
+ <StyledContainer id={id}>
39
+ <OrSimpleBanner $backgroundSrc={$backgroundSrc} />
40
+ <OrContent>
41
+ <OrRow justify={'center'} gutter={[0, 16]}>
42
+ <OrCol span={24}>
43
+ <AtTitle level={2}>{title}</AtTitle>
44
+ </OrCol>
45
+ <OrCol span={16}>
46
+ <OrRow justify={'center'}>
47
+ <OrFlagGrid
48
+ data={data}
49
+ itemsPerRow={itemsPerRow}
50
+ selectedItem={selectedItem}
51
+ onSelectCard={onSelectCard}
52
+ />
53
+ </OrRow>
54
+ </OrCol>
55
+ </OrRow>
56
+ </OrContent>
57
+ </StyledContainer>
58
+ );
59
+ };
60
+
61
+ TmLoginCountry.defaultProps = {
62
+ data: [],
63
+ itemsPerRow: 2,
64
+ };
@@ -0,0 +1,14 @@
1
+ import 'react';
2
+ import { styled } from 'styled-components';
3
+ import { gray } from '../../../theme';
4
+ import { OrLayout } from '../../organisms';
5
+
6
+ export const StyledContainer = styled(OrLayout)`
7
+ & {
8
+ background-color: ${gray[1]};
9
+ min-height: 100vh;
10
+ }
11
+ & h2 {
12
+ text-align: center;
13
+ }
14
+ `;
@@ -0,0 +1,49 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { TmLoginPhone } from '.';
3
+ import defaultBackground from '../../assets/backgrounds/bg-1.png';
4
+ import defaultCarouselImage from '../../assets/carousel/login/1st.png';
5
+
6
+ const meta = {
7
+ title: 'Templates/TmLoginPhone',
8
+ component: TmLoginPhone,
9
+ tags: ['autodocs'],
10
+ } satisfies Meta<typeof TmLoginPhone>;
11
+
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+
15
+ export const Basic: Story = {
16
+ args: {
17
+ countrySelectOptions: [
18
+ {
19
+ id: '1',
20
+ region: 've',
21
+ countryName: 'Venezuela',
22
+ city: 'Caracas',
23
+ },
24
+ {
25
+ id: '2',
26
+ region: 'co',
27
+ countryName: 'Colombia',
28
+ city: 'Barranquilla',
29
+ },
30
+ ],
31
+ dialCodes: ['+58', '+57'],
32
+ carouselImages: [
33
+ defaultCarouselImage,
34
+ defaultCarouselImage,
35
+ defaultCarouselImage,
36
+ ],
37
+ carouselBackgroundSrc: defaultBackground,
38
+ title: 'Bienvenido a nuestra',
39
+ highlightedTitle: 'plataforma',
40
+ buttonText: 'Continuar',
41
+ initialValues: {
42
+ phone: {
43
+ dialCode: '+58',
44
+ phone: '',
45
+ },
46
+ region: 've',
47
+ },
48
+ },
49
+ };