zebpay-ui 0.0.3 → 0.0.6

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 (246) hide show
  1. package/dist/esm/dist/components/Button/index.d.ts +5 -0
  2. package/dist/esm/dist/components/Button/styles.d.ts +10 -0
  3. package/dist/esm/dist/components/Button/typings.d.ts +11 -0
  4. package/dist/esm/dist/components/Checkbox/index.d.ts +5 -0
  5. package/dist/esm/dist/components/Checkbox/styles.d.ts +8 -0
  6. package/dist/esm/dist/components/Checkbox/typings.d.ts +13 -0
  7. package/dist/esm/dist/components/CircularLoader/index.d.ts +4 -0
  8. package/dist/esm/dist/components/CircularLoader/style.d.ts +2 -0
  9. package/{src/components/CircularLoader/typings.ts → dist/esm/dist/components/CircularLoader/typings.d.ts} +2 -2
  10. package/dist/esm/dist/components/DateRangePicker/index.d.ts +14 -0
  11. package/dist/esm/dist/components/Input/index.d.ts +4 -0
  12. package/dist/esm/dist/components/Input/styles.d.ts +13 -0
  13. package/dist/esm/dist/components/Input/typings.d.ts +23 -0
  14. package/dist/esm/dist/components/Popper/index.d.ts +5 -0
  15. package/dist/esm/dist/components/Popper/styles.d.ts +6 -0
  16. package/dist/esm/dist/components/Popper/typings.d.ts +14 -0
  17. package/dist/esm/dist/components/Radio/index.d.ts +5 -0
  18. package/dist/esm/dist/components/Radio/styles.d.ts +3 -0
  19. package/dist/esm/dist/components/Radio/typings.d.ts +13 -0
  20. package/dist/esm/dist/components/Toast/index.d.ts +6 -0
  21. package/dist/esm/dist/components/Toast/styles.d.ts +12 -0
  22. package/dist/esm/dist/components/Toast/typings.d.ts +6 -0
  23. package/{src/components/index.ts → dist/esm/dist/components/index.d.ts} +1 -12
  24. package/{src/hooks/index.ts → dist/esm/dist/hooks/index.d.ts} +0 -0
  25. package/dist/esm/dist/hooks/useFocus.d.ts +6 -0
  26. package/{src/index.ts → dist/esm/dist/index.d.ts} +0 -0
  27. package/dist/esm/dist/styles/colors.d.ts +34 -0
  28. package/{src/styles/index.ts → dist/esm/dist/styles/index.d.ts} +0 -1
  29. package/dist/esm/dist/styles/mixins.d.ts +19 -0
  30. package/dist/esm/dist/styles/typography.d.ts +6 -0
  31. package/dist/esm/dist/styles/utils.d.ts +10 -0
  32. package/dist/esm/index.js.map +1 -1
  33. package/{icons/out → dist/icons}/icons.css +0 -0
  34. package/{icons/out → dist/icons}/icons.eot +0 -0
  35. package/{icons/out → dist/icons}/icons.html +0 -0
  36. package/dist/icons/icons.json +159 -0
  37. package/{icons/out → dist/icons}/icons.ts +0 -0
  38. package/{icons/out → dist/icons}/icons.woff +0 -0
  39. package/{icons/out → dist/icons}/icons.woff2 +0 -0
  40. package/package.json +5 -4
  41. package/.babelrc +0 -9
  42. package/.eslintignore +0 -3
  43. package/.eslintrc.json +0 -28
  44. package/.github/CODEOWNERS +0 -1
  45. package/.github/workflows/gh-pages.yml +0 -22
  46. package/.husky/pre-commit +0 -4
  47. package/.lintstagedrc.js +0 -11
  48. package/.prettierignore +0 -3
  49. package/.storybook/main.js +0 -12
  50. package/.storybook/preview.js +0 -22
  51. package/icons/index.js +0 -29
  52. package/icons/out/icons.json +0 -159
  53. package/icons/svgs/1-graph.svg +0 -3
  54. package/icons/svgs/4-graph.svg +0 -5
  55. package/icons/svgs/account-no.svg +0 -4
  56. package/icons/svgs/activity.svg +0 -5
  57. package/icons/svgs/add-collateral.svg +0 -3
  58. package/icons/svgs/add.svg +0 -3
  59. package/icons/svgs/address.svg +0 -4
  60. package/icons/svgs/api.svg +0 -6
  61. package/icons/svgs/arrow-down.svg +0 -3
  62. package/icons/svgs/arrow-left.svg +0 -3
  63. package/icons/svgs/arrow-right.svg +0 -3
  64. package/icons/svgs/arrow-up.svg +0 -3
  65. package/icons/svgs/asterik.svg +0 -3
  66. package/icons/svgs/balance-ltv.svg +0 -3
  67. package/icons/svgs/bank.svg +0 -8
  68. package/icons/svgs/blog.svg +0 -8
  69. package/icons/svgs/bonus.svg +0 -3
  70. package/icons/svgs/buy-crypto.svg +0 -3
  71. package/icons/svgs/calendar.svg +0 -3
  72. package/icons/svgs/camera.svg +0 -6
  73. package/icons/svgs/cancelled.svg +0 -3
  74. package/icons/svgs/candle chart.svg +0 -4
  75. package/icons/svgs/cheque.svg +0 -8
  76. package/icons/svgs/circle-cross.svg +0 -4
  77. package/icons/svgs/circulation-supply.svg +0 -3
  78. package/icons/svgs/city.svg +0 -3
  79. package/icons/svgs/coin-stack.svg +0 -5
  80. package/icons/svgs/coins.svg +0 -5
  81. package/icons/svgs/compare.svg +0 -3
  82. package/icons/svgs/completed.svg +0 -4
  83. package/icons/svgs/contract.svg +0 -3
  84. package/icons/svgs/copy.svg +0 -3
  85. package/icons/svgs/coupon.svg +0 -5
  86. package/icons/svgs/cross.svg +0 -3
  87. package/icons/svgs/deactivate.svg +0 -3
  88. package/icons/svgs/deposit.svg +0 -3
  89. package/icons/svgs/depth-chart.svg +0 -4
  90. package/icons/svgs/district.svg +0 -3
  91. package/icons/svgs/dob.svg +0 -3
  92. package/icons/svgs/download.svg +0 -4
  93. package/icons/svgs/downwards.svg +0 -3
  94. package/icons/svgs/driving-licence.svg +0 -3
  95. package/icons/svgs/earned.svg +0 -5
  96. package/icons/svgs/edit.svg +0 -3
  97. package/icons/svgs/email.svg +0 -3
  98. package/icons/svgs/emi-amount.svg +0 -6
  99. package/icons/svgs/emi-duedate.svg +0 -3
  100. package/icons/svgs/error.svg +0 -6
  101. package/icons/svgs/expand.svg +0 -3
  102. package/icons/svgs/external-link.svg +0 -3
  103. package/icons/svgs/facelock.svg +0 -3
  104. package/icons/svgs/fees.svg +0 -3
  105. package/icons/svgs/filter.svg +0 -3
  106. package/icons/svgs/fingerprint.svg +0 -7
  107. package/icons/svgs/form.svg +0 -3
  108. package/icons/svgs/globe.svg +0 -3
  109. package/icons/svgs/hamburger.svg +0 -3
  110. package/icons/svgs/help.svg +0 -5
  111. package/icons/svgs/hide.svg +0 -4
  112. package/icons/svgs/home.svg +0 -4
  113. package/icons/svgs/ifsc.svg +0 -7
  114. package/icons/svgs/income-source.svg +0 -3
  115. package/icons/svgs/indicators.svg +0 -3
  116. package/icons/svgs/info.svg +0 -3
  117. package/icons/svgs/initial-ltv.svg +0 -3
  118. package/icons/svgs/instant-buy-sell.svg +0 -3
  119. package/icons/svgs/interest-amount.svg +0 -3
  120. package/icons/svgs/interest-rate.svg +0 -6
  121. package/icons/svgs/kyc.svg +0 -5
  122. package/icons/svgs/lend.svg +0 -4
  123. package/icons/svgs/link.svg +0 -4
  124. package/icons/svgs/liquidation-cost.svg +0 -3
  125. package/icons/svgs/liquidation-id.svg +0 -3
  126. package/icons/svgs/liquidation-price.svg +0 -3
  127. package/icons/svgs/liquidation.svg +0 -4
  128. package/icons/svgs/list.svg +0 -8
  129. package/icons/svgs/loan-amount.svg +0 -3
  130. package/icons/svgs/loan-details.svg +0 -3
  131. package/icons/svgs/loan-repayment.svg +0 -3
  132. package/icons/svgs/loan-term.svg +0 -3
  133. package/icons/svgs/location.svg +0 -4
  134. package/icons/svgs/lock.svg +0 -3
  135. package/icons/svgs/logout.svg +0 -3
  136. package/icons/svgs/ltv-ratio.svg +0 -5
  137. package/icons/svgs/mail.svg +0 -3
  138. package/icons/svgs/map.svg +0 -4
  139. package/icons/svgs/margin-call.svg +0 -4
  140. package/icons/svgs/max-supply.svg +0 -3
  141. package/icons/svgs/menu.svg +0 -3
  142. package/icons/svgs/more-options.svg +0 -5
  143. package/icons/svgs/negative.svg +0 -3
  144. package/icons/svgs/network.svg +0 -3
  145. package/icons/svgs/next.svg +0 -3
  146. package/icons/svgs/nominee.svg +0 -3
  147. package/icons/svgs/note.svg +0 -3
  148. package/icons/svgs/notification.svg +0 -3
  149. package/icons/svgs/occupation.svg +0 -3
  150. package/icons/svgs/ongoing.svg +0 -4
  151. package/icons/svgs/order.svg +0 -4
  152. package/icons/svgs/orders-complete.svg +0 -6
  153. package/icons/svgs/pair-selector.svg +0 -3
  154. package/icons/svgs/pan.svg +0 -8
  155. package/icons/svgs/passbook.svg +0 -3
  156. package/icons/svgs/passport.svg +0 -4
  157. package/icons/svgs/pay-emi.svg +0 -3
  158. package/icons/svgs/pay-lumpsum.svg +0 -3
  159. package/icons/svgs/pay-off-loan.svg +0 -3
  160. package/icons/svgs/penalty-charges.svg +0 -3
  161. package/icons/svgs/percentage.svg +0 -6
  162. package/icons/svgs/phone.svg +0 -3
  163. package/icons/svgs/positive.svg +0 -3
  164. package/icons/svgs/prepay-principal.svg +0 -3
  165. package/icons/svgs/previous.svg +0 -3
  166. package/icons/svgs/profile.svg +0 -3
  167. package/icons/svgs/quicktrade.svg +0 -5
  168. package/icons/svgs/rank.svg +0 -3
  169. package/icons/svgs/ream.svg +0 -6
  170. package/icons/svgs/recieve.svg +0 -3
  171. package/icons/svgs/repayment-schedule.svg +0 -4
  172. package/icons/svgs/reports.svg +0 -6
  173. package/icons/svgs/reset.svg +0 -4
  174. package/icons/svgs/save.svg +0 -3
  175. package/icons/svgs/scan.svg +0 -3
  176. package/icons/svgs/search.svg +0 -3
  177. package/icons/svgs/security.svg +0 -4
  178. package/icons/svgs/selfie.svg +0 -5
  179. package/icons/svgs/sell-crypto.svg +0 -3
  180. package/icons/svgs/send-email.svg +0 -3
  181. package/icons/svgs/send.svg +0 -3
  182. package/icons/svgs/separator.svg +0 -3
  183. package/icons/svgs/setttings.svg +0 -3
  184. package/icons/svgs/share.svg +0 -3
  185. package/icons/svgs/show.svg +0 -3
  186. package/icons/svgs/side.svg +0 -7
  187. package/icons/svgs/sip.svg +0 -4
  188. package/icons/svgs/sms.svg +0 -6
  189. package/icons/svgs/star-filled.svg +0 -3
  190. package/icons/svgs/star.svg +0 -3
  191. package/icons/svgs/statement.svg +0 -3
  192. package/icons/svgs/stop.svg +0 -3
  193. package/icons/svgs/street-address.svg +0 -3
  194. package/icons/svgs/subtract.svg +0 -3
  195. package/icons/svgs/success.svg +0 -4
  196. package/icons/svgs/support.svg +0 -5
  197. package/icons/svgs/templates.svg +0 -3
  198. package/icons/svgs/term.svg +0 -3
  199. package/icons/svgs/tick.svg +0 -3
  200. package/icons/svgs/total-payable-lumpsum.svg +0 -9
  201. package/icons/svgs/trash.svg +0 -3
  202. package/icons/svgs/unlock.svg +0 -3
  203. package/icons/svgs/upi.svg +0 -3
  204. package/icons/svgs/upload.svg +0 -4
  205. package/icons/svgs/upwards.svg +0 -3
  206. package/icons/svgs/voting-card.svg +0 -5
  207. package/icons/svgs/wallet.svg +0 -3
  208. package/icons/svgs/xpress.svg +0 -6
  209. package/icons/svgs/zip-code.svg +0 -3
  210. package/rollup.config.js +0 -49
  211. package/src/components/Button/index.tsx +0 -55
  212. package/src/components/Button/styles.ts +0 -142
  213. package/src/components/Button/typings.ts +0 -20
  214. package/src/components/Checkbox/index.tsx +0 -44
  215. package/src/components/Checkbox/styles.ts +0 -76
  216. package/src/components/Checkbox/typings.ts +0 -11
  217. package/src/components/CircularLoader/index.tsx +0 -22
  218. package/src/components/CircularLoader/style.ts +0 -18
  219. package/src/components/DateRangePicker/index.tsx +0 -36
  220. package/src/components/DateRangePicker/styles.css +0 -676
  221. package/src/components/Input/index.tsx +0 -95
  222. package/src/components/Input/styles.ts +0 -79
  223. package/src/components/Input/typings.ts +0 -25
  224. package/src/components/Popper/index.tsx +0 -62
  225. package/src/components/Popper/styles.ts +0 -59
  226. package/src/components/Popper/typings.ts +0 -16
  227. package/src/components/Radio/index.tsx +0 -32
  228. package/src/components/Radio/styles.ts +0 -51
  229. package/src/components/Radio/typings.ts +0 -11
  230. package/src/components/Toast/index.tsx +0 -88
  231. package/src/components/Toast/styles.ts +0 -69
  232. package/src/components/Toast/typings.ts +0 -6
  233. package/src/hooks/useFocus.ts +0 -16
  234. package/src/styles/colors.ts +0 -39
  235. package/src/styles/mixins.ts +0 -52
  236. package/src/styles/typography.ts +0 -331
  237. package/src/styles/utils.ts +0 -39
  238. package/stories/Button.stories.tsx +0 -20
  239. package/stories/Checkbox.stories.tsx +0 -18
  240. package/stories/CircularLoader.stories.tsx +0 -15
  241. package/stories/DateRangePicker.stories.tsx +0 -18
  242. package/stories/Input.stories.tsx +0 -18
  243. package/stories/Popper.stories.tsx +0 -23
  244. package/stories/Radio.stories.tsx +0 -18
  245. package/stories/Toast.stories.tsx +0 -17
  246. package/tsconfig.json +0 -24
@@ -1,95 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import { css } from "@emotion/react";
3
- import React, { useState } from "react";
4
- import { mixins, typography } from "../../styles";
5
- import Button from "../Button";
6
- import * as styles from "./styles";
7
- import { InputProps } from "./typings";
8
-
9
- const Input: React.FC<InputProps> = ({
10
- value,
11
- label,
12
- placeholder,
13
- name,
14
- appendItem,
15
- prependItem,
16
- infoText,
17
- errorText,
18
- cta,
19
- style,
20
- type = "text",
21
- onChange,
22
- }) => {
23
- const [focused, setFocused] = useState<boolean>(false);
24
- return (
25
- <div css={style}>
26
- <label
27
- css={[
28
- styles.formLabel,
29
- focused ? styles.activeFormLabel : null,
30
- errorText ? mixins.textError : null,
31
- ]}
32
- >
33
- {label}
34
- </label>
35
- <div
36
- css={[
37
- styles.inputGroup,
38
- mixins.flexAlignCenter,
39
- focused ? styles.focusedInputGroup : null,
40
- errorText ? styles.invalidInputGroup : null,
41
- ]}
42
- >
43
- {prependItem && (
44
- <span css={styles.inputGroupPrepend}>{prependItem}</span>
45
- )}
46
- <input
47
- type={type}
48
- name={name}
49
- placeholder={placeholder}
50
- onFocus={() => {
51
- setFocused(true);
52
- }}
53
- onBlur={() => {
54
- setFocused(false);
55
- }}
56
- css={[
57
- styles.formControl,
58
- styles.fieldFullRounded,
59
- prependItem && styles.fieldFirstHalfRounded,
60
- appendItem && styles.fieldSecondHalfRounded,
61
- appendItem && prependItem && styles.fieldNoRounded,
62
- ]}
63
- value={value}
64
- onChange={(e) => {
65
- const { value, name } = e.target;
66
- onChange({ value: value, name: name });
67
- }}
68
- />
69
- {appendItem && <span css={styles.inputGroupText}>{appendItem}</span>}
70
- </div>
71
- <div css={[mixins.flexAlignCenter, mixins.flexJustifiedBetween]}>
72
- {(errorText || infoText) && (
73
- <div
74
- css={[
75
- css({ ...typography.B4_14_regular }),
76
- infoText && mixins.textFaded,
77
- errorText && mixins.textError,
78
- ]}
79
- >
80
- {infoText || errorText}
81
- </div>
82
- )}
83
- {cta && (
84
- <div css={styles.infoCta}>
85
- <Button type="link" size="medium" onClick={cta.onClick}>
86
- {cta.label}
87
- </Button>
88
- </div>
89
- )}
90
- </div>
91
- </div>
92
- );
93
- };
94
-
95
- export default Input;
@@ -1,79 +0,0 @@
1
- import { css } from "@emotion/react";
2
- import { colors, typography, utils } from "../../styles";
3
-
4
- export const invalidInputGroup = css({
5
- borderColor: colors.Zeb_Solid_Red,
6
- });
7
-
8
- export const formLabel = css({
9
- ...typography.B4_14_regular,
10
- color: colors.Zeb_Solid_Light_Blue,
11
- marginBottom: utils.remConverter(4),
12
- });
13
-
14
- export const activeFormLabel = css({
15
- color: `${colors.Zeb_Solid_White}!important`,
16
- });
17
-
18
- export const inputGroup = css({
19
- border: "1px solid transparent",
20
- borderRadius: 8,
21
- flexWrap: "wrap",
22
- alignItems: "stretch",
23
- });
24
-
25
- export const focusedInputGroup = css({
26
- borderColor: colors.Zeb_Solid_Bright_Blue,
27
- boxShadow: colors.Zeb_Effects_Shadow_Hover,
28
- });
29
-
30
- export const formControl = css({
31
- padding: `${utils.remConverter(8)} ${utils.remConverter(12)}`,
32
- background: colors.Zeb_Solid_Dark_Blue,
33
- border: "none",
34
- ...typography.B4_14_semibold,
35
- color: `${colors.Zeb_Solid_White}!important`,
36
- height: utils.remConverter(40),
37
- flex: "1 1 auto",
38
- ":focus": {
39
- boxShadow: "none",
40
- outline: "none",
41
- },
42
- "::placeholder": {
43
- ...typography.B4_14_regular,
44
- color: `${colors.Zeb_Solid_Light_Blue}!important`,
45
- },
46
- });
47
- export const fieldFullRounded = css({
48
- borderRadius: utils.remConverter(8),
49
- });
50
- export const fieldNoRounded = css({
51
- borderRadius: utils.remConverter(0),
52
- });
53
- export const fieldSecondHalfRounded = css({
54
- borderRadius: `${utils.remConverter(8)} 0 0 ${utils.remConverter(8)}`,
55
- });
56
- export const fieldFirstHalfRounded = css({
57
- borderRadius: `0 ${utils.remConverter(8)} ${utils.remConverter(8)} 0`,
58
- });
59
-
60
- export const inputGroupText = css({
61
- padding: `${utils.remConverter(8)} ${utils.remConverter(12)}`,
62
- background: colors.Zeb_Solid_Dark_Blue,
63
- borderRadius: `0 ${utils.remConverter(8)} ${utils.remConverter(8)} 0`,
64
- border: "none",
65
- ...typography.B4_14_semibold,
66
- height: utils.remConverter(40),
67
- });
68
- export const inputGroupPrepend = css({
69
- padding: `${utils.remConverter(8)} ${utils.remConverter(12)}`,
70
- background: colors.Zeb_Solid_Dark_Blue,
71
- borderRadius: `${utils.remConverter(8)} 0 0 ${utils.remConverter(8)}`,
72
- border: "none",
73
- ...typography.B4_14_semibold,
74
- height: utils.remConverter(40),
75
- });
76
-
77
- export const infoCta = css({
78
- marginLeft: "auto",
79
- });
@@ -1,25 +0,0 @@
1
- import { SerializedStyles } from "@emotion/react";
2
- import { ReactText } from "react";
3
-
4
- export interface InputTargetProps {
5
- value: string;
6
- name: string;
7
- }
8
-
9
- export interface InputProps {
10
- label: string;
11
- placeholder: string;
12
- value: ReactText;
13
- onChange: (target: InputTargetProps) => void;
14
- name?: string;
15
- appendItem?: string | JSX.Element;
16
- prependItem?: string | JSX.Element;
17
- infoText?: string;
18
- errorText?: string;
19
- type?: "text" | "number" | "password";
20
- style?: SerializedStyles;
21
- cta?: {
22
- label: string;
23
- onClick: () => void;
24
- };
25
- }
@@ -1,62 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import * as React from "react";
3
- import * as styles from "./styles";
4
- import Button from "../Button";
5
- import { PopperProps } from "./typings";
6
- import { ButtonProps } from "../Button/typings";
7
- import { useFocus } from "../../hooks";
8
-
9
- const Popper: React.FC<PopperProps> = ({
10
- onClose = () => {},
11
- label,
12
- buttonProps = {} as ButtonProps,
13
- renderChildren,
14
- style,
15
- }) => {
16
- const [open, setOpen] = React.useState<boolean>(false);
17
-
18
- const [popperRef, setFocus] = useFocus<HTMLDivElement>();
19
-
20
- const close = React.useCallback(() => {
21
- setOpen(false);
22
- onClose();
23
- }, [onClose]);
24
-
25
- const toggleOpened = React.useCallback(() => {
26
- if (open) {
27
- close();
28
- } else {
29
- setOpen(true);
30
- }
31
- }, [open, close, setOpen]);
32
-
33
- React.useEffect(() => {
34
- setFocus && setFocus();
35
- }, [popperRef.current, setFocus]);
36
-
37
- return (
38
- <div css={[styles.container, style]}>
39
- {open && (
40
- <div css={styles.popup} tabIndex={0} onBlur={close} ref={popperRef}>
41
- <div css={styles.header}>
42
- <span>{label}</span>
43
- <span onClick={close} css={styles.closer}>
44
- X
45
- </span>
46
- </div>
47
- {renderChildren({ close, isOpened: open })}
48
- </div>
49
- )}
50
- <Button
51
- {...buttonProps}
52
- style={[styles.button, buttonProps.style]}
53
- onClick={toggleOpened}
54
- type={buttonProps.type || "secondary"}
55
- >
56
- {label}
57
- </Button>
58
- </div>
59
- );
60
- };
61
-
62
- export default Popper;
@@ -1,59 +0,0 @@
1
- import { css } from "@emotion/react";
2
- import { colors, typography, utils } from "../../styles";
3
-
4
- const BUTTON_HEIGHT = 34;
5
- const BUTTON_WIDTH = 330;
6
-
7
- export const container = css({
8
- height: utils.remConverter(BUTTON_HEIGHT),
9
- width: utils.remConverter(BUTTON_WIDTH),
10
- position: "relative",
11
- });
12
-
13
- export const popup = css({
14
- backgroundColor: colors.Zeb_Solid_BG_Blue,
15
- borderRadius: utils.remConverter(8),
16
- minWidth: utils.remConverter(BUTTON_WIDTH - 2),
17
- display: "flex",
18
- flexDirection: "column",
19
- padding: utils.remConverter(12),
20
- position: "absolute",
21
- justifyContent: "space-between",
22
- borderColor: colors.Zeb_Solid_Bright_Blue,
23
- borderWidth: utils.remConverter(2),
24
- borderStyle: "solid",
25
- boxShadow: "0px 8px 8px -4px #0C0C1D",
26
- bottom: utils.remConverter(BUTTON_HEIGHT + 8),
27
- });
28
-
29
- export const header = css({
30
- ...typography.B4_14_semibold,
31
- display: "flex",
32
- flexDirection: "row",
33
- justifyContent: "space-between",
34
- alignItems: "center",
35
- marginBottom: "1rem",
36
- });
37
-
38
- export const button = css({
39
- ...typography.C4_12,
40
- textAlign: "center",
41
- height: utils.remConverter(BUTTON_HEIGHT),
42
- width: utils.remConverter(BUTTON_WIDTH),
43
- });
44
-
45
- export const closer = css({});
46
-
47
- export const label = (hovered?: boolean) => {
48
- if (hovered) {
49
- return css({
50
- ...typography.B4_14_semibold,
51
- color: colors.Zeb_Solid_White,
52
- });
53
- }
54
-
55
- return css({
56
- ...typography.B4_14_regular,
57
- color: colors.Zeb_Solid_Light_Blue,
58
- });
59
- };
@@ -1,16 +0,0 @@
1
- import { SerializedStyles } from "@emotion/react";
2
- import { ReactElement } from "react";
3
- import { ButtonProps } from "../Button/typings";
4
-
5
- export interface PopperProps {
6
- label: string;
7
- onClose?: () => void;
8
- buttonProps?: ButtonProps;
9
- renderChildren: (props: ChildrenProps) => ReactElement;
10
- style?: SerializedStyles;
11
- }
12
-
13
- export interface ChildrenProps {
14
- close: () => void;
15
- isOpened: boolean;
16
- }
@@ -1,32 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import React from "react";
3
- import * as styles from "./styles";
4
- import { RadioProps } from "./typings";
5
-
6
- const Radio: React.FC<RadioProps> = ({
7
- value,
8
- onChange,
9
- label,
10
- style,
11
- name,
12
- selected,
13
- }) => {
14
- return (
15
- <label css={[styles.container, style]}>
16
- {label}
17
- <input
18
- type="radio"
19
- name={name}
20
- css={styles.input}
21
- value={value}
22
- onChange={(e) =>
23
- onChange({ selected: e.target.checked, value: e.target.value })
24
- }
25
- checked={selected}
26
- />
27
- <span css={styles.checkmark} />
28
- </label>
29
- );
30
- };
31
-
32
- export default Radio;
@@ -1,51 +0,0 @@
1
- import { css } from "@emotion/react";
2
- import { colors, typography, utils } from "../../styles";
3
-
4
- export const container = css({
5
- display: "block",
6
- position: "relative",
7
- paddingLeft: utils.remConverter(20),
8
- cursor: "pointer",
9
- WebkitUserSelect: "none",
10
- MozUserSelect: "none",
11
- msUserSelect: "none",
12
- userSelect: "none",
13
- marginBottom: 0,
14
- ...typography.B4_14_regular,
15
- });
16
-
17
- export const input = css({
18
- position: "absolute",
19
- opacity: 0,
20
- cursor: "pointer",
21
- ":checked": {
22
- "~ span": {
23
- backgroundColor: "transparent",
24
- ":after": {
25
- display: "block",
26
- },
27
- },
28
- },
29
- });
30
-
31
- export const checkmark = css({
32
- position: "absolute",
33
- display: "flex",
34
- alignItems: "center",
35
- justifyContent: "center",
36
- top: "50%",
37
- left: 0,
38
- height: 16,
39
- width: 16,
40
- borderRadius: "50%",
41
- border: `1px solid ${colors.Zeb_Solid_White}`,
42
- transform: "translateY(-50%)",
43
- ":after": {
44
- content: "''",
45
- display: "none",
46
- width: 8,
47
- height: 8,
48
- borderRadius: "50%",
49
- backgroundColor: colors.Zeb_Solid_Bright_Blue,
50
- },
51
- });
@@ -1,11 +0,0 @@
1
- import { SerializedStyles } from "@emotion/react";
2
- import { ReactText } from "react";
3
-
4
- export interface RadioProps {
5
- selected: boolean;
6
- onChange: (args: { selected: boolean; value: ReactText }) => void;
7
- value?: ReactText;
8
- label?: string | JSX.Element;
9
- name: string;
10
- style?: SerializedStyles;
11
- }
@@ -1,88 +0,0 @@
1
- /** @jsxImportSource @emotion/react */
2
- import React from "react";
3
- import toast from "react-hot-toast";
4
- import { colors } from "../../styles";
5
- import * as styles from "./styles";
6
- import { ToastProps } from "./typings";
7
-
8
- const getColor = (type: "info" | "error" | "success") => {
9
- if (type === "info") return colors.Zeb_Solid_Yellow;
10
- if (type === "error") return colors.Zeb_Solid_Red;
11
- if (type === "success") return colors.Zeb_Solid_Green;
12
- };
13
-
14
- export const generateToast = ({
15
- title,
16
- description,
17
- type,
18
- onClose,
19
- }: ToastProps) => {
20
- const closeToast = () => {
21
- if (onClose) {
22
- onClose();
23
- }
24
- toast.remove(toastId);
25
- };
26
-
27
- const toaster: JSX.Element = (
28
- <Toast
29
- title={title}
30
- description={description}
31
- type={type}
32
- onClose={closeToast}
33
- />
34
- );
35
-
36
- const toastId: string = toast.custom(toaster);
37
- };
38
-
39
- const Toast: React.FC<ToastProps> = ({ title, description, type, onClose }) => {
40
- return (
41
- <div css={[styles.toastContainer, styles[type]]}>
42
- <div css={[styles.toastHeading, styles[`${type}ToastHeading`]]}>
43
- <div css={styles.toastDetails}>
44
- {/* TODO use icon */}
45
- <svg
46
- width="16"
47
- height="16"
48
- viewBox="0 0 16 16"
49
- fill="none"
50
- xmlns="http://www.w3.org/2000/svg"
51
- >
52
- <path
53
- fillRule="evenodd"
54
- clipRule="evenodd"
55
- d="M11.9999 13.9866C10.8159 14.7778 9.42383 15.2 7.9998 15.2C6.09024 15.2 4.2589 14.4415 2.90864 13.0912C1.55837 11.741 0.799805 9.90961 0.799805 8.00005C0.799805 6.57602 1.22208 5.18398 2.01322 3.99995C2.80437 2.81591 3.92885 1.89307 5.24448 1.34812C6.56011 0.803169 8.00779 0.660585 9.40445 0.938398C10.8011 1.21621 12.084 1.90194 13.091 2.90888C14.0979 3.91582 14.7836 5.19874 15.0615 6.5954C15.3393 7.99206 15.1967 9.43974 14.6517 10.7554C14.1068 12.071 13.1839 13.1955 11.9999 13.9866ZM11.4656 2.81311C10.4397 2.12763 9.23361 1.76177 7.9998 1.76177C6.34614 1.76449 4.76099 2.4226 3.59167 3.59192C2.42236 4.76124 1.76424 6.34639 1.76152 8.00005C1.76152 9.23386 2.12739 10.44 2.81286 11.4659C3.49833 12.4917 4.47262 13.2913 5.61251 13.7635C6.75241 14.2356 8.00672 14.3592 9.21683 14.1185C10.4269 13.8778 11.5385 13.2836 12.4109 12.4112C13.2834 11.5387 13.8775 10.4272 14.1182 9.21708C14.3589 8.00697 14.2354 6.75266 13.7632 5.61276C13.2911 4.47286 12.4915 3.49858 11.4656 2.81311ZM7.41321 7.59992C7.41321 7.27925 7.67321 7.01325 7.99321 7.01325C8.31987 7.01325 8.57987 7.27925 8.57987 7.59992V10.5466C8.57987 10.8666 8.31987 11.1266 7.99321 11.1266C7.67321 11.1266 7.41321 10.8666 7.41321 10.5466V7.59992ZM7.41987 5.48659C7.41987 5.15992 7.67987 4.89992 8.00654 4.89992C8.32654 4.89992 8.58654 5.15992 8.58654 5.48659C8.58654 5.80592 8.32654 6.06659 7.99321 6.06659C7.67987 6.06659 7.41987 5.80592 7.41987 5.48659Z"
56
- fill={getColor(type)}
57
- />
58
- </svg>
59
- <div css={styles.toastTitle}>{title}</div>
60
- </div>
61
- <div>
62
- {onClose && (
63
- <button css={styles.closeCta} onClick={onClose}>
64
- {/* TODO use iconbutton */}
65
- <svg
66
- width="16"
67
- height="16"
68
- viewBox="0 0 16 16"
69
- fill="none"
70
- xmlns="http://www.w3.org/2000/svg"
71
- >
72
- <path
73
- fillRule="evenodd"
74
- clipRule="evenodd"
75
- d="M7.99996 0.666626C3.94996 0.666626 0.666626 3.94996 0.666626 7.99996C0.666626 12.05 3.94996 15.3333 7.99996 15.3333C12.05 15.3333 15.3333 12.05 15.3333 7.99996C15.3333 3.94996 12.05 0.666626 7.99996 0.666626ZM10.4713 6.47129C10.5927 6.34556 10.6599 6.17716 10.6584 6.00236C10.6569 5.82756 10.5868 5.66035 10.4632 5.53675C10.3396 5.41314 10.1724 5.34303 9.99756 5.34151C9.82276 5.33999 9.65436 5.40719 9.52862 5.52863L7.99996 7.05729L6.47129 5.52863C6.40979 5.46495 6.33623 5.41416 6.25489 5.37922C6.17356 5.34429 6.08608 5.32589 5.99756 5.32513C5.90904 5.32436 5.82125 5.34122 5.73932 5.37474C5.65739 5.40827 5.58296 5.45777 5.52036 5.52036C5.45777 5.58296 5.40827 5.65739 5.37474 5.73932C5.34122 5.82125 5.32436 5.90904 5.32513 5.99756C5.32589 6.08608 5.34428 6.17356 5.37922 6.2549C5.41416 6.33623 5.46495 6.40979 5.52863 6.47129L7.05729 7.99996L5.52863 9.52863C5.46495 9.59012 5.41416 9.66369 5.37922 9.74502C5.34428 9.82636 5.32589 9.91384 5.32513 10.0024C5.32436 10.0909 5.34122 10.1787 5.37474 10.2606C5.40827 10.3425 5.45777 10.417 5.52036 10.4796C5.58296 10.5422 5.65739 10.5917 5.73932 10.6252C5.82125 10.6587 5.90904 10.6756 5.99756 10.6748C6.08608 10.674 6.17356 10.6556 6.25489 10.6207C6.33623 10.5858 6.40979 10.535 6.47129 10.4713L7.99996 8.94263L9.52862 10.4713C9.65436 10.5927 9.82276 10.6599 9.99756 10.6584C10.1724 10.6569 10.3396 10.5868 10.4632 10.4632C10.5868 10.3396 10.6569 10.1724 10.6584 9.99756C10.6599 9.82276 10.5927 9.65436 10.4713 9.52863L8.94262 7.99996L10.4713 6.47129Z"
76
- fill={getColor(type)}
77
- />
78
- </svg>
79
- </button>
80
- )}
81
- </div>
82
- </div>
83
- <div css={styles.toastDescription}>{description}</div>
84
- </div>
85
- );
86
- };
87
-
88
- export default Toast;
@@ -1,69 +0,0 @@
1
- import { css } from "@emotion/react";
2
- import { colors, typography, utils } from "../../styles";
3
-
4
- export const toastContainer = css({
5
- padding: `${utils.remConverter(12)} ${utils.remConverter(
6
- 16
7
- )} ${utils.remConverter(12)} ${utils.remConverter(24)}`,
8
- border: "1px solid transparent",
9
- backdropFilter: "blur(20px)",
10
- borderRadius: "8px",
11
- maxWidth: "484px",
12
- width: "100%",
13
- });
14
-
15
- export const toastHeading = css({
16
- ...typography.B4_14_semibold,
17
- display: "flex",
18
- alignItems: "center",
19
- justifyContent: "space-between",
20
- });
21
-
22
- export const toastDetails = css({
23
- display: "flex",
24
- alignItems: "center",
25
- });
26
-
27
- export const toastTitle = css({
28
- marginLeft: `${utils.remConverter(8)}`,
29
- });
30
-
31
- export const closeCta = css({
32
- padding: 0,
33
- outline: "none",
34
- border: "none",
35
- boxShadow: "none",
36
- backgroundColor: "transparent",
37
- });
38
-
39
- export const toastDescription = css({
40
- ...typography.B5_12_regular,
41
- marginTop: `${utils.remConverter(4)}`,
42
- });
43
-
44
- export const info = css({
45
- background: "rgba(249, 200, 92, 0.08)",
46
- borderColor: colors.Zeb_Solid_Yellow,
47
- });
48
-
49
- export const infoToastHeading = css({
50
- color: colors.Zeb_Solid_Yellow,
51
- });
52
-
53
- export const error = css({
54
- background: "rgba(234, 97, 97, 0.08)",
55
- borderColor: colors.Zeb_Solid_Red,
56
- });
57
-
58
- export const errorToastHeading = css({
59
- color: colors.Zeb_Solid_Red,
60
- });
61
-
62
- export const success = css({
63
- background: "rgba(30, 202, 162, 0.08)",
64
- borderColor: colors.Zeb_Solid_Green,
65
- });
66
-
67
- export const successToastHeading = css({
68
- color: colors.Zeb_Solid_Green,
69
- });
@@ -1,6 +0,0 @@
1
- export interface ToastProps {
2
- title: string;
3
- description: string;
4
- type: "info" | "error" | "success";
5
- onClose?: () => void;
6
- }
@@ -1,16 +0,0 @@
1
- import React, { useRef } from "react";
2
-
3
- function useFocus<T extends HTMLElement>(): [
4
- React.MutableRefObject<T | null>,
5
- () => void
6
- // eslint-disable-next-line indent
7
- ] {
8
- const htmlElRef = useRef<T | null>(null);
9
- const setFocus = () => {
10
- htmlElRef.current && htmlElRef.current.focus();
11
- };
12
-
13
- return [htmlElRef, setFocus];
14
- }
15
-
16
- export default useFocus;
@@ -1,39 +0,0 @@
1
- const colors = {
2
- Zeb_Solid_White: "#FFFFFF",
3
- Zeb_Solid_BG_Blue: "#222245",
4
- Zeb_Solid_Dark_Blue: "#181837",
5
- Zeb_Solid_Bright_Blue: "#338FFF",
6
- Zeb_Solid_Light_Blue: "#C0C0EE",
7
- Zeb_Solid_Green: "#1ECAA2",
8
- Zeb_Solid_Red: "#EA6161",
9
- Zeb_Solid_Yellow: "#F9C35C",
10
- Zeb_Solid_Grey: "#C2C2DD",
11
- Zeb_Solid_Dark_Grey: "#34345A",
12
- Zeb_Solid_Black: "000000",
13
- Zeb_Solid_Light_Blue_01: "#E9EFF6",
14
- Zeb_Solid_Grey_01: "#E1E3E6",
15
- Zeb_Gradient_Blue_01:
16
- "linear-gradient(90.15deg, #5D7BFE 0.73%, #0974FF 101.92%)",
17
- Zeb_Gradient_Blue_02:
18
- "linear-gradient(180deg, #0473FF 0.54%, rgba(4, 115, 255, 0) 100%)",
19
- Zeb_Gradient_Dark_Blue:
20
- "linear-gradient(254.37deg, #4A62CA -43.42%, #1B264B 148.58%)",
21
- Zeb_Transparent_25: "rgba(12, 12, 36, 0.25)",
22
- Zeb_Transparent_Green: "rgba(30, 202, 162, 0.2)",
23
- Zeb_Transparent_Yellow: "rgba(249, 195, 92, 0.2)",
24
- Zeb_Transparent_Red: "rgba(234, 97, 97, 0.2)",
25
- Zeb_BG_Blue: "rgba(51, 143, 255, 0.2)",
26
- Zeb_BG_Light_Blue: "rgba(192, 192, 238, 0.2)",
27
- Zeb_BG_Green: "rgba(30, 202, 162, 0.08)",
28
- Zeb_BG_Red: "rgba(234, 97, 97, 0.08)",
29
- Zeb_BG_Yellow: "rgba(249, 195, 92, 0.08)",
30
- Zeb_Transparent_4: "rgba(51, 143, 255, 0.04)",
31
- Zeb_Effects_Shadow_Hover: "0px 8px 8px -4px #0C0C1D",
32
- Zeb_Effects_Shadow_W_Drawer: "-12px 0px 40px rgba(12, 12, 29, 0.48)",
33
- Zeb_Effects_Shadow_M_Drawer: "0px -12px 40px rgba(12, 12, 29, 0.48)",
34
- Zeb_Effects_Shadow_Hover_Up: "0px -2px 32px 8px rgba(12, 12, 29, 0.4)",
35
- Zeb_Effects_Shimmer:
36
- "linear-gradient(97.38deg, #34345A -40.76%, #19193A 135.88%)",
37
- };
38
-
39
- export default colors;