@omniumretail/component-library 1.2.71 → 1.2.72

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 (191) hide show
  1. package/package.json +12 -3
  2. package/NPMPUBLISH.md +0 -29
  3. package/bitbucket-pipelines.yml +0 -95
  4. package/dist/components/AnalyticsBar/AnalyticsBar.stories.d.ts +0 -5
  5. package/dist/components/BellNotifications/BellNotifications.stories.d.ts +0 -5
  6. package/dist/components/Button/Button.stories.d.ts +0 -6
  7. package/dist/components/Category/Category.stories.d.ts +0 -3
  8. package/dist/components/CategoryReadOnly/CategoryReadOnly.stories.d.ts +0 -3
  9. package/dist/components/CategoryResponse/CategoryResponse.stories.d.ts +0 -3
  10. package/dist/components/DatePicker/DatePicker.stories.d.ts +0 -5
  11. package/dist/components/DatePickerTag/DatePickerTag.stories.d.ts +0 -5
  12. package/dist/components/DropdownButton/DropdownButton.stories.d.ts +0 -5
  13. package/dist/components/ExportTableData/ExportTableData.stories.d.ts +0 -3
  14. package/dist/components/Footer/Footer.stories.d.ts +0 -5
  15. package/dist/components/Footer2/Footer.stories.d.ts +0 -6
  16. package/dist/components/Header/Header.stories.d.ts +0 -5
  17. package/dist/components/Input/Input.stories.d.ts +0 -5
  18. package/dist/components/InputCountryCode/inputCountryCode.stories.d.ts +0 -5
  19. package/dist/components/Label/Label.stories.d.ts +0 -6
  20. package/dist/components/Link/Link.stories.d.ts +0 -7
  21. package/dist/components/Menu/Menu.stories.d.ts +0 -5
  22. package/dist/components/MobileTable/MobileTable.stories.d.ts +0 -5
  23. package/dist/components/ModalConfirmation/ModalConfirmation.stories.d.ts +0 -5
  24. package/dist/components/ModalWithTable/ModalWithTable.stories.d.ts +0 -5
  25. package/dist/components/Navigation/Navigation.stories.d.ts +0 -5
  26. package/dist/components/Notification/Notification.stories.d.ts +0 -5
  27. package/dist/components/Questions/Questions.stories.d.ts +0 -3
  28. package/dist/components/Radio/Radio.stories.d.ts +0 -5
  29. package/dist/components/ResponseType/ResponseType.stories.d.ts +0 -3
  30. package/dist/components/ResponsiveTable/ResponsiveTable.stories.d.ts +0 -9
  31. package/dist/components/Select/Select.stories.d.ts +0 -6
  32. package/dist/components/Separator/Separator.stories.d.ts +0 -6
  33. package/dist/components/Sidebar/Sidebar.stories.d.ts +0 -6
  34. package/dist/components/Switch/Switch.stories.d.ts +0 -5
  35. package/dist/components/Table/Table.stories.d.ts +0 -9
  36. package/dist/components/Tag/Tag.stories.d.ts +0 -5
  37. package/dist/components/Upload/Upload.stories.d.ts +0 -3
  38. package/dist/components/UserInfo/UserInfo.stories.d.ts +0 -3
  39. package/dist/components/WebCam/WebCam.stories.d.ts +0 -3
  40. package/dist/types/index.d.ts +0 -2
  41. package/public/index.ts +0 -0
  42. package/src/assets/code-brackets.svg +0 -1
  43. package/src/assets/colors.svg +0 -1
  44. package/src/assets/comments.svg +0 -1
  45. package/src/assets/direction.svg +0 -1
  46. package/src/assets/flow.svg +0 -1
  47. package/src/assets/fonts/Silka-Bold.woff2 +0 -0
  48. package/src/assets/fonts/Silka-Regular.woff2 +0 -0
  49. package/src/assets/images/A2AI-logo.png +0 -0
  50. package/src/assets/images/omnium-retail-logo-white.png +0 -0
  51. package/src/assets/images/omnium-retail-logo.png +0 -0
  52. package/src/assets/images/omnium-retail_icon.png +0 -0
  53. package/src/assets/plugin.svg +0 -1
  54. package/src/assets/repo.svg +0 -1
  55. package/src/assets/scss/_combinations.scss +0 -0
  56. package/src/assets/scss/_global.scss +0 -89
  57. package/src/assets/scss/index.scss +0 -2
  58. package/src/assets/stackalt.svg +0 -1
  59. package/src/components/AnalyticsBar/AnalyticsBar.stories.tsx +0 -236
  60. package/src/components/AnalyticsBar/helpers/codeMutation.tsx +0 -19
  61. package/src/components/AnalyticsBar/index.tsx +0 -76
  62. package/src/components/AnalyticsBar/interfaces/analyticsBar.tsx +0 -13
  63. package/src/components/AnalyticsBar/styles.module.scss +0 -137
  64. package/src/components/BellNotifications/BellNotifications.stories.tsx +0 -200
  65. package/src/components/BellNotifications/index.tsx +0 -154
  66. package/src/components/BellNotifications/styles.module.scss +0 -239
  67. package/src/components/Button/Button.stories.tsx +0 -26
  68. package/src/components/Button/index.tsx +0 -24
  69. package/src/components/Button/styles.module.scss +0 -70
  70. package/src/components/Category/Category.stories.tsx +0 -371
  71. package/src/components/Category/CategoryContent/index.tsx +0 -255
  72. package/src/components/Category/CategoryContent/styles.module.scss +0 -69
  73. package/src/components/Category/CategorySidebar/index.tsx +0 -344
  74. package/src/components/Category/CategorySidebar/styles.module.scss +0 -28
  75. package/src/components/Category/index.tsx +0 -58
  76. package/src/components/Category/styles.module.scss +0 -13
  77. package/src/components/CategoryReadOnly/CategoryReadOnly.stories.tsx +0 -274
  78. package/src/components/CategoryReadOnly/evaluationOptions.tsx +0 -81
  79. package/src/components/CategoryReadOnly/index.tsx +0 -328
  80. package/src/components/CategoryReadOnly/styles.module.scss +0 -214
  81. package/src/components/CategoryResponse/CategoryResponse.stories.tsx +0 -311
  82. package/src/components/CategoryResponse/evaluationOptions.tsx +0 -81
  83. package/src/components/CategoryResponse/index.tsx +0 -502
  84. package/src/components/CategoryResponse/styles.module.scss +0 -365
  85. package/src/components/DatePicker/DatePicker.stories.tsx +0 -16
  86. package/src/components/DatePicker/index.tsx +0 -38
  87. package/src/components/DatePicker/styles.module.scss +0 -3
  88. package/src/components/DatePickerTag/DatePickerTag.stories.tsx +0 -19
  89. package/src/components/DatePickerTag/index.tsx +0 -91
  90. package/src/components/DatePickerTag/styles.module.scss +0 -32
  91. package/src/components/DropdownButton/DropdownButton.stories.tsx +0 -24
  92. package/src/components/DropdownButton/index.tsx +0 -36
  93. package/src/components/DropdownButton/styles.module.scss +0 -9
  94. package/src/components/ExportTableData/ExportTableData.stories.tsx +0 -43
  95. package/src/components/ExportTableData/index.tsx +0 -37
  96. package/src/components/ExportTableData/styles.module.scss +0 -4
  97. package/src/components/Footer/Footer.stories.tsx +0 -15
  98. package/src/components/Footer/index.tsx +0 -45
  99. package/src/components/Footer/styles.module.scss +0 -38
  100. package/src/components/Footer2/Footer.stories.tsx +0 -184
  101. package/src/components/Footer2/index.tsx +0 -322
  102. package/src/components/Footer2/styles.module.scss +0 -292
  103. package/src/components/Header/Header.data.ts +0 -26
  104. package/src/components/Header/Header.stories.tsx +0 -236
  105. package/src/components/Header/Header.types.ts +0 -32
  106. package/src/components/Header/README.md +0 -38
  107. package/src/components/Header/index.tsx +0 -200
  108. package/src/components/Header/styles.module.scss +0 -216
  109. package/src/components/Input/Input.stories.tsx +0 -13
  110. package/src/components/Input/index.tsx +0 -31
  111. package/src/components/Input/styles.module.scss +0 -8
  112. package/src/components/InputCountryCode/index.tsx +0 -79
  113. package/src/components/InputCountryCode/inputCountryCode.stories.tsx +0 -55
  114. package/src/components/InputCountryCode/styles.module.scss +0 -3
  115. package/src/components/Label/Label.stories.tsx +0 -21
  116. package/src/components/Label/index.tsx +0 -19
  117. package/src/components/Label/styles.module.scss +0 -17
  118. package/src/components/Link/Link.stories.tsx +0 -30
  119. package/src/components/Link/index.tsx +0 -21
  120. package/src/components/Link/styles.module.scss +0 -24
  121. package/src/components/Menu/Menu.stories.tsx +0 -178
  122. package/src/components/Menu/helpers/codeMutation.tsx +0 -19
  123. package/src/components/Menu/index.tsx +0 -24
  124. package/src/components/Menu/styles.module.scss +0 -0
  125. package/src/components/MobileTable/MobileTable.stories.tsx +0 -27
  126. package/src/components/MobileTable/index.tsx +0 -102
  127. package/src/components/MobileTable/styles.module.scss +0 -75
  128. package/src/components/ModalConfirmation/ModalConfirmation.stories.tsx +0 -40
  129. package/src/components/ModalConfirmation/ModalStatusList.tsx +0 -5
  130. package/src/components/ModalConfirmation/index.tsx +0 -71
  131. package/src/components/ModalConfirmation/styles.module.scss +0 -62
  132. package/src/components/ModalWithTable/ModalWithTable.stories.tsx +0 -99
  133. package/src/components/ModalWithTable/index.tsx +0 -238
  134. package/src/components/ModalWithTable/styles.module.scss +0 -77
  135. package/src/components/Navigation/Navigation.stories.tsx +0 -21
  136. package/src/components/Navigation/index.tsx +0 -91
  137. package/src/components/Navigation/styles.module.scss +0 -91
  138. package/src/components/Notification/Notification.stories.tsx +0 -32
  139. package/src/components/Notification/index.tsx +0 -28
  140. package/src/components/Questions/Questions.stories.tsx +0 -37
  141. package/src/components/Questions/SingleQuestion/index.tsx +0 -337
  142. package/src/components/Questions/SingleQuestion/styles.module.scss +0 -142
  143. package/src/components/Questions/index.tsx +0 -124
  144. package/src/components/Questions/styles.modules.scss +0 -0
  145. package/src/components/Radio/Radio.stories.tsx +0 -43
  146. package/src/components/Radio/index.tsx +0 -26
  147. package/src/components/Radio/styles.module.scss +0 -24
  148. package/src/components/ResponseType/ResponseType.stories.tsx +0 -393
  149. package/src/components/ResponseType/index.tsx +0 -100
  150. package/src/components/ResponseType/styles.module.scss +0 -31
  151. package/src/components/ResponsiveTable/ResponsiveTable.stories.tsx +0 -386
  152. package/src/components/ResponsiveTable/index.tsx +0 -389
  153. package/src/components/ResponsiveTable/styles.module.scss +0 -153
  154. package/src/components/Select/Select.stories.tsx +0 -39
  155. package/src/components/Select/index.tsx +0 -27
  156. package/src/components/Select/styles.module.scss +0 -19
  157. package/src/components/Separator/Separator.stories.tsx +0 -22
  158. package/src/components/Separator/index.tsx +0 -27
  159. package/src/components/Separator/styles.module.scss +0 -25
  160. package/src/components/Sidebar/Sidebar.stories.tsx +0 -85
  161. package/src/components/Sidebar/index.tsx +0 -127
  162. package/src/components/Sidebar/styles.module.scss +0 -141
  163. package/src/components/Switch/Switch.stories.tsx +0 -14
  164. package/src/components/Switch/index.tsx +0 -18
  165. package/src/components/Switch/styles.module.scss +0 -7
  166. package/src/components/Table/Table.stories.tsx +0 -337
  167. package/src/components/Table/index.tsx +0 -313
  168. package/src/components/Table/styles.module.scss +0 -97
  169. package/src/components/Tag/Tag.stories.tsx +0 -32
  170. package/src/components/Tag/index.tsx +0 -295
  171. package/src/components/Tag/styles.module.scss +0 -104
  172. package/src/components/Upload/Upload.stories.tsx +0 -45
  173. package/src/components/Upload/index.tsx +0 -112
  174. package/src/components/Upload/styles.module.scss +0 -29
  175. package/src/components/UserInfo/UserInfo.stories.tsx +0 -38
  176. package/src/components/UserInfo/index.tsx +0 -77
  177. package/src/components/UserInfo/styles.module.scss +0 -35
  178. package/src/components/WebCam/WebCam.stories.tsx +0 -24
  179. package/src/components/WebCam/index.tsx +0 -73
  180. package/src/components/WebCam/styles.module.scss +0 -37
  181. package/src/components/index.tsx +0 -34
  182. package/src/constants/i18n.ts +0 -25
  183. package/src/constants/logoCompanyHelper.ts +0 -52
  184. package/src/constants/translationHelper.ts +0 -7
  185. package/src/index.ts +0 -3
  186. package/src/locales/en.json +0 -142
  187. package/src/locales/es.json +0 -142
  188. package/src/locales/pt.json +0 -142
  189. package/src/types/Global.d.ts +0 -4
  190. package/tsconfig.json +0 -24
  191. package/vite.config.js +0 -51
@@ -1,200 +0,0 @@
1
- import { useRef, useState } from 'react';
2
- import { DownOutlined, UpOutlined, BarsOutlined, CloseOutlined } from '@ant-design/icons';
3
- import styles from './styles.module.scss';
4
- import classNames from 'classnames';
5
- import { HeaderProps, MenuItem } from './Header.types';
6
- import { getMenuTopList, getMenuBottomList } from './Header.data';
7
- import { BellNotifications } from '../BellNotifications';
8
- import { getCompanyLogos } from '../../constants/logoCompanyHelper';
9
-
10
- /**
11
- * Header component to display navigation bar with dropdown menus and action button.
12
- * @param {HeaderProps} props - Properties passed to the component.
13
- */
14
- export const Header = ({
15
- menuList,
16
- actionButton,
17
- logout,
18
- homeUrl,
19
- profileUrl,
20
- onLeavingPage,
21
- userName,
22
- pageTitle,
23
- onFilterChange,
24
- notifications,
25
- onNotificationClick,
26
- handleMarkAllAsRead,
27
- shouldConfirmNavigation,
28
- customLogoClass,
29
- companyName = 'omnium',
30
- }: HeaderProps) => {
31
-
32
- const [isMenuOpen, setIsMenuOpen] = useState(false);
33
- const [activeDropdown, setActiveDropdown] = useState<number | null>(null);
34
- const headerRef = useRef<HTMLDivElement>(null);
35
- const overlayRef = useRef<HTMLDivElement>(null);
36
- const companyLogos = getCompanyLogos(companyName);
37
-
38
- /**
39
- * Handle the logout action. If no logout function is provided, redirect to home as discussed in a meet
40
- */
41
- const onLogout = () => {
42
- if (shouldConfirmNavigation) {
43
- onLeavingPage!('/logout');
44
- } else if (logout) {
45
- logout();
46
- } else {
47
- onHome();
48
- }
49
- };
50
-
51
- /**
52
- * Navigate to the profile URL.
53
- */
54
- const onProfile = () => {
55
- if (shouldConfirmNavigation) {
56
- onLeavingPage!('/profile');
57
- } else {
58
- window.location.href = profileUrl;
59
- }
60
- };
61
-
62
- /**
63
- * Navigate to the home URL.
64
- */
65
- const onHome = () => {
66
- if (shouldConfirmNavigation) {
67
- onLeavingPage!('/home');
68
- } else {
69
- window.location.href = homeUrl;
70
- }
71
- };
72
-
73
- const menuTopList = getMenuTopList(
74
- onHome,
75
- );
76
-
77
- const menuBottomList = getMenuBottomList(
78
- onProfile,
79
- onLogout,
80
- userName
81
- );
82
-
83
- const combinedMenuList = [...menuTopList, ...(menuList || []), ...menuBottomList];
84
-
85
- /**
86
- * Toggle the menu open and closed state.
87
- */
88
- const onToggleMenu = () => {
89
- setIsMenuOpen(!isMenuOpen);
90
- };
91
-
92
- /**
93
- * Handle dropdown click to toggle the active dropdown menu.
94
- * @param {any} e - The event object.
95
- * @param {number} index - The index of the dropdown menu.
96
- */
97
- const handleDropdownClick = (e: any, index: number) => {
98
- e.stopPropagation();
99
- setActiveDropdown(activeDropdown === index ? null : index);
100
- };
101
-
102
- /**
103
- * Render the menu items, including dropdown menus.
104
- * @param {MenuItem[]} menuList - The list of menu items to render.
105
- * @returns {JSX.Element[]} The rendered menu items.
106
- */
107
- const renderMenu = (menuList: MenuItem[]) => {
108
- return menuList.map((link, index) => (
109
- <li
110
- key={link.name}
111
- data-index={index}
112
- className={classNames(styles.listItem, {
113
- [styles.hasDropdown]: link.dropdownMenu,
114
- [styles.dropdownActive]: activeDropdown === index
115
- })}
116
- >
117
- <div
118
- className={styles.listName}
119
- onClick={() => {
120
- if (onLeavingPage && link.targetRoute) {
121
- onLeavingPage(link.targetRoute);
122
- } else {
123
- link.action();
124
- }
125
- }}
126
- >
127
- <p
128
- className={styles.name}
129
- dangerouslySetInnerHTML={{ __html: link.name }}></p>
130
-
131
- {
132
- link.dropdownMenu && link.dropdownMenu.length > 0 && <div className={styles.arrow} onClick={(event) => handleDropdownClick(event, index)}>
133
- {
134
- activeDropdown === index ?
135
- <UpOutlined className={styles.arrowIcon} /> :
136
- <DownOutlined className={styles.arrowIcon} />
137
- }
138
- </div>
139
- }
140
- </div>
141
- {link.dropdownMenu && link.dropdownMenu.length > 0 && (
142
- <ul
143
- className={styles.dropdownMenu}
144
- >
145
- {link.dropdownMenu.map((dropdownLink) => (
146
- <li key={dropdownLink.name} onClick={() => {
147
- if (onLeavingPage && dropdownLink.targetRoute) {
148
- onLeavingPage(dropdownLink.targetRoute);
149
- } else {
150
- dropdownLink.action();
151
- }
152
- }} className={styles.listItem}>
153
- <div className={styles.listName}>{dropdownLink.name}</div>
154
- </li>
155
- ))}
156
- </ul>
157
- )}
158
- </li>
159
- ));
160
- };
161
-
162
- return (
163
- <div className={styles.header} ref={headerRef}>
164
- <BarsOutlined onClick={onToggleMenu} className={styles.toggleMenuOpen} />
165
-
166
- <div className={styles.logoContainer}>
167
- {
168
- pageTitle
169
- ? <p className={styles.title}>{pageTitle}</p>
170
- : <img src={companyLogos.normal} alt={companyLogos.alt} />
171
- }
172
- </div>
173
-
174
- {notifications &&
175
- <BellNotifications onFilterChange={onFilterChange!} notifications={notifications} onNotificationClick={onNotificationClick!} handleMarkAllAsRead={handleMarkAllAsRead!} />
176
- }
177
-
178
- <div className={classNames(styles.menu, { [styles.active]: isMenuOpen })}>
179
- <div className={styles.head}>
180
- <p className={styles.logoWrapper}>
181
- <img className={customLogoClass} src={companyLogos.white} alt={companyLogos.alt} />
182
- </p>
183
- <CloseOutlined color={'#FFFFFF'} className={styles.toggleMenuClose} onClick={onToggleMenu} />
184
- </div>
185
- <div className={styles.menuList}>
186
- {renderMenu(combinedMenuList)}
187
- </div>
188
- </div>
189
- <div ref={overlayRef} className={classNames(styles.overlay, { [styles.active]: isMenuOpen })} onClick={onToggleMenu}></div>
190
-
191
- {actionButton && actionButton.visibility && (
192
- <div className={styles.actionButton} onClick={actionButton.action}>
193
- {actionButton.element}
194
- </div>
195
- )}
196
- </div>
197
- );
198
- };
199
-
200
- export default Header;
@@ -1,216 +0,0 @@
1
- :root {
2
- --color-grey: #e4e4e4;
3
- --color-grey-100: #E5E5E5;
4
- }
5
-
6
- .header {
7
- display: flex;
8
- align-items: center;
9
- padding: 13px 20px;
10
- box-sizing: border-box;
11
- height: 72px;
12
-
13
- * {
14
- box-sizing: border-box;
15
- }
16
- }
17
-
18
- .logoContainer {
19
- display: flex;
20
- flex-grow: 1;
21
- align-items: flex-end;
22
- justify-content: center;
23
- max-width: calc(100% - 60px);
24
-
25
- img {
26
- max-width: 196px;
27
- max-height: 50px;
28
- }
29
-
30
- .title {
31
- font-weight: var(--font-weight-semibold);
32
- text-transform: uppercase;
33
- color: var(--color-black);
34
- }
35
- }
36
-
37
- .toggleMenuOpen {
38
- cursor: pointer;
39
- padding: 4px 4px 4px 0;
40
- font-size: 20px;
41
- width: 30px;
42
- display: flex;
43
- align-items: center;
44
- justify-content: center;
45
- }
46
-
47
- .menu {
48
- position: fixed;
49
- top: 0;
50
- left: -100%;
51
- bottom: 0;
52
- width: 100%;
53
- max-width: 430px;
54
- background-color: var(--color-white);
55
- padding-inline: 15px;
56
- z-index: 999;
57
- box-shadow: 0 3px 12px rgba(0, 0, 0, .45);
58
- transition: 0.6s ease-out;
59
-
60
- &.active {
61
- left: 0;
62
- transition: 0.3s ease-in;
63
- }
64
- }
65
-
66
- .overlay {
67
- background-color: rgba(0, 0, 0, .3);
68
- backdrop-filter: blur(1px);
69
- position: absolute;
70
- left: 0;
71
- top: 0;
72
- right: 0;
73
- bottom: 0;
74
- z-index: 998;
75
- pointer-events: none;
76
- opacity: 0;
77
- transition: 0.3s;
78
-
79
- &.active {
80
- opacity: 1;
81
- pointer-events: all;
82
- }
83
- }
84
-
85
- .head {
86
- width: calc(100% + 30px);
87
- margin-left: -15px;
88
- background-color: var(--color-orange);
89
- display: flex;
90
- align-items: center;
91
- justify-content: center;
92
- }
93
-
94
- .logoWrapper {
95
- img {
96
- max-width: 160px;
97
- max-height: 50px;
98
- }
99
- }
100
-
101
- .toggleMenuClose {
102
- position: absolute;
103
- top: 23px;
104
- right: 15px;
105
- font-size: 25px;
106
- cursor: pointer;
107
- color: var(--color-white);
108
- }
109
-
110
- .menuList {
111
- overflow-y: auto;
112
- height: calc(100% - 51px);
113
- margin: 0;
114
- padding: 0;
115
- }
116
-
117
- .listName {
118
- height: 60px;
119
- padding: 10px;
120
- display: flex;
121
- align-items: center;
122
- border-bottom: 1px solid var(--color-black);
123
- cursor: pointer;
124
- transition: 0.3s;
125
- text-transform: uppercase;
126
- width: 100%;
127
-
128
- &:hover {
129
- background-color: var(--color-grey);
130
- color: var(--color-black);
131
- }
132
- }
133
-
134
- .listItem {
135
- list-style: none;
136
-
137
- &.hasDropdown {
138
- height: auto;
139
- display: flex;
140
- flex-direction: column;
141
- align-items: flex-start;
142
- justify-content: flex-start;
143
- padding-bottom: 0;
144
-
145
- >.listName {
146
- position: relative;
147
-
148
- .arrow {
149
- position: absolute;
150
- width: 60px;
151
- height: 100%;
152
- background: var(--color-black);
153
- right: 0;
154
- display: flex;
155
- align-items: center;
156
- justify-content: center;
157
-
158
- &:hover {
159
- background-color: var(--color-orange);
160
- }
161
- }
162
-
163
- .arrowIcon {
164
- color: var(--color-white);
165
- }
166
- }
167
-
168
- &.dropdownActive {
169
- background: var(--color-grey);
170
-
171
- .arrow {
172
- background-color: var(--color-orange);
173
- }
174
-
175
- .dropdownMenu {
176
- height: auto;
177
- /* Arbitrary large value to allow smooth transition */
178
- opacity: 1;
179
- }
180
- }
181
- }
182
- }
183
-
184
- .dropdownMenu {
185
- padding: 0;
186
- width: 100%;
187
- margin: 0;
188
- background-color: var(--color-orange);
189
- color: var(--color-white);
190
- height: 0;
191
- opacity: 0;
192
- overflow: hidden;
193
- transition: height 0.3s ease, opacity 0.3s ease;
194
-
195
- .listName {
196
- min-height: 60px;
197
- height: auto;
198
- padding-inline: 40px;
199
- }
200
- }
201
-
202
- .actionButton {
203
- cursor: pointer;
204
- }
205
-
206
- .listName {
207
- .name {
208
- span {
209
- margin-left: 8px;
210
- transform: translateY(-2px);
211
- display: inline-block;
212
- font-size: var(--font-size-body-3);
213
- text-transform: capitalize;
214
- }
215
- }
216
- }
@@ -1,13 +0,0 @@
1
- import { Meta, StoryFn } from "@storybook/react-vite";
2
- import { FormInputField, FormInputFieldProps } from '.';
3
-
4
- export default {
5
- title: 'FormInputField',
6
- component: FormInputField,
7
- } as Meta;
8
-
9
- const Template: StoryFn<FormInputFieldProps> = (args: any) => <FormInputField {...args}></FormInputField>;
10
-
11
- export const Primary = Template.bind({});
12
- Primary.args = {
13
- };
@@ -1,31 +0,0 @@
1
- import { Form, FormItemProps, Input, InputProps } from 'antd';
2
- import classNames from 'classnames';
3
- import styles from './styles.module.scss';
4
-
5
- export interface FormInputFieldProps extends Omit<FormItemProps, "name"> {
6
- name: string;
7
- inputProps?: InputProps;
8
- }
9
-
10
- export interface inputPropsCustom extends InputProps {
11
- customClass?: string;
12
- }
13
-
14
- export const InputField = ({customClass, ...inputProps}: inputPropsCustom) => {
15
- const inputClasses = {
16
- [styles.input]: true,
17
- [`${customClass}`]: customClass,
18
- }
19
-
20
- return (
21
- <Input className={classNames(inputClasses)} {...inputProps} />
22
- );
23
- }
24
-
25
- export const FormInputField = ({ inputProps, ...itemProps }: FormInputFieldProps) => {
26
- return (
27
- <Form.Item {...itemProps}>
28
- <InputField {...inputProps} />
29
- </Form.Item>
30
- )
31
- };
@@ -1,8 +0,0 @@
1
- .input {
2
- border-color: rgba(var(--color-black-rgb), .5);
3
- height: 50px;
4
- font-size: var(--font-size-body-3);
5
- line-height: 100%;
6
- color: var(--color-black);
7
- border-radius: 5px;
8
- }
@@ -1,79 +0,0 @@
1
- import { useCallback, useState, useEffect } from 'react';
2
- import { Form, FormItemProps, Input, InputProps, SelectProps } from 'antd';
3
- import { InputField } from '../Input';
4
- import { Select } from '../Select';
5
- import styles from './styles.module.scss';
6
-
7
- export interface FormInputCountryCodeProps extends Omit<FormItemProps, "name"> {
8
- name?: string;
9
- selectProps?: SelectProps;
10
- inputProps?: InputProps;
11
- inputWithSelectBoxValue?: string;
12
- value?: string;
13
- onChange?: (value: any) => void;
14
- dialCode?: string;
15
- }
16
-
17
- interface CountryCodeProps {
18
- value?: string | { Number: string; CountryISO2: string };
19
- onChange?: (value: any) => void;
20
- selectProps?: SelectProps;
21
- inputProps?: InputProps;
22
- dialCode?: string;
23
- }
24
-
25
- const CountryCode = ({ value, onChange, selectProps, inputProps, dialCode }: CountryCodeProps) => {
26
- const [inputDefaultValue, setInputDefaultValue] = useState<any>(inputProps?.defaultValue);
27
- const [countryCode, setCountryCode] = useState(selectProps?.defaultValue);
28
-
29
- useEffect(() => {
30
- setInputDefaultValue(inputProps?.defaultValue);
31
- }, []);
32
-
33
- useEffect(() => {
34
- if (value && typeof value === 'object') {
35
- setInputDefaultValue(value.Number);
36
- setCountryCode(value.CountryISO2);
37
- }
38
- }, [value]);
39
-
40
- const changeLocalValue = useCallback(
41
- (value: string | number, element: string) => {
42
- if (element !== 'countryCode') {
43
- setInputDefaultValue(value);
44
- onChange?.({ Number: value, CountryISO2: countryCode }); // Update this line
45
- return;
46
- }
47
-
48
- setCountryCode(value);
49
- onChange?.({ Number: inputDefaultValue, CountryISO2: value }); // Update this line
50
- },
51
- [onChange, countryCode, inputDefaultValue],
52
- );
53
-
54
- const inputValueWithDialCode = dialCode ? `${dialCode} ${inputDefaultValue}` : inputDefaultValue;
55
-
56
- return (
57
- <Input.Group compact className={styles.inputGroup}>
58
- <Select
59
- {...selectProps}
60
- value={countryCode || selectProps?.defaultValue}
61
- onChange={(value) => changeLocalValue(value, 'countryCode')}
62
- ></Select>
63
- <InputField
64
- {...inputProps}
65
- value={inputValueWithDialCode}
66
- onChange={(event) => changeLocalValue(event.target.value, 'phoneNumber')}
67
- />
68
- </Input.Group>
69
- );
70
- };
71
-
72
- export const InputCountryCode = ({ inputProps, selectProps, name, inputWithSelectBoxValue, value, onChange, ...itemProps }: FormInputCountryCodeProps) => {
73
- return (
74
- <Form.Item name={name} {...itemProps}>
75
- <CountryCode inputProps={inputProps} selectProps={selectProps} value={value} onChange={onChange} />
76
- </Form.Item>
77
- )
78
- }
79
-
@@ -1,55 +0,0 @@
1
- import { Form, Button } from 'antd';
2
- import { Meta, StoryFn } from "@storybook/react-vite";
3
- import { InputCountryCode, FormInputCountryCodeProps } from '.';
4
-
5
- export default {
6
- title: 'InputCountryCode',
7
- component: InputCountryCode,
8
- } as Meta;
9
-
10
- const Template: StoryFn<FormInputCountryCodeProps> = (args: any) => {
11
- return (
12
- <Form>
13
- <InputCountryCode {...args}></InputCountryCode>
14
-
15
- <Form.Item name={["testitem"]}>
16
- <InputCountryCode
17
- selectProps={{
18
- options: [
19
- {
20
- label: 'PT',
21
- value: '+351',
22
- },
23
- {
24
- label: 'KZ',
25
- value: '94',
26
- },
27
- ],
28
- defaultValue: 'KZ',
29
- }} inputProps={{ defaultValue: '919767347' }} />
30
- </Form.Item>
31
-
32
- </Form>
33
- )
34
- };
35
-
36
- export const Primary = Template.bind({});
37
- Primary.args = {
38
- name: "test",
39
- inputProps: {
40
- defaultValue: 961303639,
41
- },
42
- selectProps: {
43
- defaultValue: 'PT',
44
- options: [
45
- {
46
- label: 'PT',
47
- value: '+351',
48
- },
49
- {
50
- label: 'KZ',
51
- value: '94',
52
- },
53
- ]
54
- }
55
- };
@@ -1,3 +0,0 @@
1
- .inputGroup {
2
- display: flex !important;
3
- }
@@ -1,21 +0,0 @@
1
- import { Meta, StoryFn } from "@storybook/react-vite";
2
- import { Label, LabelProps } from '.';
3
-
4
- export default {
5
- title: 'Label',
6
- component: Label,
7
- } as Meta;
8
-
9
- const Template: StoryFn<LabelProps> = (args: any) => <Label {...args}></Label>;
10
-
11
- export const Primary = Template.bind({});
12
- Primary.args = {
13
- forAttribute: 'Label',
14
- children: 'Label',
15
- };
16
-
17
- export const Secondary = Template.bind({});
18
- Secondary.args = {
19
- forAttribute: 'someinputname',
20
- children: 'Label',
21
- };
@@ -1,19 +0,0 @@
1
- import classNames from 'classnames';
2
- import styles from './styles.module.scss';
3
- export interface LabelProps {
4
- forAttribute?: string;
5
- children?: any;
6
- customStyle?: string;
7
- isUppercase?: boolean;
8
- }
9
-
10
- export const Label = (props: LabelProps) => {
11
- const { forAttribute, children, customStyle, isUppercase } = props;
12
-
13
- const labelClasses = classNames({
14
- [styles.label]: true,
15
- [styles.uppercase]: isUppercase,
16
- });
17
-
18
- return <label className={ classNames(labelClasses, customStyle) } htmlFor={ forAttribute }>{ children }</label>
19
- };
@@ -1,17 +0,0 @@
1
-
2
- .label {
3
- display: block;
4
- color: var(--color-black);
5
- text-transform: capitalize;
6
- font-size: var(--font-size-body-base);
7
- line-height: 125%;
8
- font-weight: var(--font-weight-semibold);
9
-
10
- &:not(:first-child) {
11
- margin-top: 8px;
12
- }
13
- }
14
-
15
- .uppercase {
16
- text-transform: uppercase;
17
- }
@@ -1,30 +0,0 @@
1
- import { Meta, StoryFn } from "@storybook/react-vite";
2
- import { Link, CustomLinkProps } from '.';
3
- import { SearchOutlined } from '@ant-design/icons';
4
-
5
- export default {
6
- title: 'Link',
7
- component: Link,
8
- } as Meta;
9
-
10
- const Template: StoryFn<CustomLinkProps> = (args: any) => <Link {...args}> this is a link </Link>;
11
-
12
- export const Primary = Template.bind({});
13
- Primary.args = {
14
- href: '#',
15
- };
16
-
17
-
18
- export const Secondary = Template.bind({});
19
- Secondary.args = {
20
- href: '#',
21
- linkSecondary: true
22
- };
23
-
24
- export const iconAlignRight = Template.bind({});
25
- iconAlignRight.args = {
26
- href: '#',
27
- iconAlignRight: true,
28
- linkSecondary: true,
29
- icon: <SearchOutlined />
30
- };