@app-studio/web 0.1.5 → 0.1.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 (283) hide show
  1. package/package.json +2 -3
  2. package/src/components/Button/Button/Button.props.ts +0 -79
  3. package/src/components/Button/Button/Button.state.ts +0 -7
  4. package/src/components/Button/Button/Button.style.ts +0 -95
  5. package/src/components/Button/Button/Button.type.d.ts +0 -11
  6. package/src/components/Button/Button/Button.view.tsx +0 -113
  7. package/src/components/Button/Button.md +0 -165
  8. package/src/components/Button/Button.tsx +0 -24
  9. package/src/components/Button/examples/AutoFocusButton.tsx +0 -13
  10. package/src/components/Button/examples/BorderedButtons.tsx +0 -14
  11. package/src/components/Button/examples/ColoredButtons.tsx +0 -12
  12. package/src/components/Button/examples/DefaultButton.tsx +0 -4
  13. package/src/components/Button/examples/DisabledButton.tsx +0 -13
  14. package/src/components/Button/examples/IconButtons.tsx +0 -23
  15. package/src/components/Button/examples/LoadingButtons.tsx +0 -32
  16. package/src/components/Button/examples/ShadowButton.tsx +0 -6
  17. package/src/components/Button/examples/SizeButtons.tsx +0 -16
  18. package/src/components/Button/examples/VariantButtons.tsx +0 -20
  19. package/src/components/Button/examples/index.ts +0 -9
  20. package/src/components/Form/Checkbox/Checkbox/Checkbox.props.ts +0 -118
  21. package/src/components/Form/Checkbox/Checkbox/Checkbox.state.ts +0 -15
  22. package/src/components/Form/Checkbox/Checkbox/Checkbox.style.ts +0 -29
  23. package/src/components/Form/Checkbox/Checkbox/Checkbox.type.d.ts +0 -8
  24. package/src/components/Form/Checkbox/Checkbox/Checkbox.view.tsx +0 -98
  25. package/src/components/Form/Checkbox/Checkbox.md +0 -128
  26. package/src/components/Form/Checkbox/Checkbox.tsx +0 -15
  27. package/src/components/Form/Checkbox/examples/ColorScheme.tsx +0 -12
  28. package/src/components/Form/Checkbox/examples/Default.tsx +0 -5
  29. package/src/components/Form/Checkbox/examples/DisabledInput.tsx +0 -5
  30. package/src/components/Form/Checkbox/examples/ErrorCheckbox.tsx +0 -5
  31. package/src/components/Form/Checkbox/examples/FormCheckout.tsx +0 -46
  32. package/src/components/Form/Checkbox/examples/IconCheckbox.tsx +0 -8
  33. package/src/components/Form/Checkbox/examples/IndeterminateCheckbox.tsx +0 -5
  34. package/src/components/Form/Checkbox/examples/ReadOnlyInput.tsx +0 -5
  35. package/src/components/Form/Checkbox/examples/Shadow.tsx +0 -11
  36. package/src/components/Form/Checkbox/examples/SizeInput.tsx +0 -18
  37. package/src/components/Form/Checkbox/examples/StylesInput.tsx +0 -22
  38. package/src/components/Form/Checkbox/examples/index.ts +0 -11
  39. package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.props.ts +0 -187
  40. package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.state.ts +0 -28
  41. package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.style.ts +0 -17
  42. package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.type.d.ts +0 -22
  43. package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.view.tsx +0 -234
  44. package/src/components/Form/CountryPicker/CountryPicker.md +0 -206
  45. package/src/components/Form/CountryPicker/CountryPicker.tsx +0 -16
  46. package/src/components/Form/CountryPicker/countries.json +0 -1453
  47. package/src/components/Form/CountryPicker/examples/Color.tsx +0 -12
  48. package/src/components/Form/CountryPicker/examples/Default.tsx +0 -4
  49. package/src/components/Form/CountryPicker/examples/Disabled.tsx +0 -5
  50. package/src/components/Form/CountryPicker/examples/Error.tsx +0 -4
  51. package/src/components/Form/CountryPicker/examples/Form.tsx +0 -23
  52. package/src/components/Form/CountryPicker/examples/Formik.tsx +0 -39
  53. package/src/components/Form/CountryPicker/examples/HelperText.tsx +0 -5
  54. package/src/components/Form/CountryPicker/examples/ReadOnlyInput.tsx +0 -5
  55. package/src/components/Form/CountryPicker/examples/Shadow.tsx +0 -4
  56. package/src/components/Form/CountryPicker/examples/Shape.tsx +0 -13
  57. package/src/components/Form/CountryPicker/examples/SizeInput.tsx +0 -16
  58. package/src/components/Form/CountryPicker/examples/StylesInput.tsx +0 -17
  59. package/src/components/Form/CountryPicker/examples/Variant.tsx +0 -13
  60. package/src/components/Form/CountryPicker/examples/index.ts +0 -12
  61. package/src/components/Form/CountryPicker/styles.css +0 -7
  62. package/src/components/Form/DatePicker/DatePicker/DatePicker.props.ts +0 -113
  63. package/src/components/Form/DatePicker/DatePicker/DatePicker.state.ts +0 -17
  64. package/src/components/Form/DatePicker/DatePicker/DatePicker.style.ts +0 -17
  65. package/src/components/Form/DatePicker/DatePicker/DatePicker.type.d.ts +0 -15
  66. package/src/components/Form/DatePicker/DatePicker/DatePicker.view.tsx +0 -118
  67. package/src/components/Form/DatePicker/DatePicker.md +0 -115
  68. package/src/components/Form/DatePicker/DatePicker.tsx +0 -15
  69. package/src/components/Form/DatePicker/examples/ColorScheme.tsx +0 -12
  70. package/src/components/Form/DatePicker/examples/Default.tsx +0 -4
  71. package/src/components/Form/DatePicker/examples/DisabledInput.tsx +0 -5
  72. package/src/components/Form/DatePicker/examples/ErrorCheckbox.tsx +0 -4
  73. package/src/components/Form/DatePicker/examples/FormCheckout.tsx +0 -23
  74. package/src/components/Form/DatePicker/examples/Formik.tsx +0 -35
  75. package/src/components/Form/DatePicker/examples/ReadOnlyInput.tsx +0 -5
  76. package/src/components/Form/DatePicker/examples/Shadow.tsx +0 -10
  77. package/src/components/Form/DatePicker/examples/SizeInput.tsx +0 -16
  78. package/src/components/Form/DatePicker/examples/StylesInput.tsx +0 -14
  79. package/src/components/Form/DatePicker/examples/helperTextDatePicker.tsx +0 -6
  80. package/src/components/Form/DatePicker/examples/index.ts +0 -11
  81. package/src/components/Form/Label/Label/Label.props.ts +0 -36
  82. package/src/components/Form/Label/Label/Label.style.ts +0 -34
  83. package/src/components/Form/Label/Label/Label.type.ts +0 -14
  84. package/src/components/Form/Label/Label/Label.view.tsx +0 -35
  85. package/src/components/Form/Label/Label.tsx +0 -8
  86. package/src/components/Form/Password/Password/Password.props.ts +0 -36
  87. package/src/components/Form/Password/Password/Password.state.ts +0 -6
  88. package/src/components/Form/Password/Password/Password.type.d.ts +0 -14
  89. package/src/components/Form/Password/Password/Password.view.tsx +0 -32
  90. package/src/components/Form/Password/Password.md +0 -108
  91. package/src/components/Form/Password/Password.tsx +0 -15
  92. package/src/components/Form/Password/example/Default.tsx +0 -9
  93. package/src/components/Form/Password/example/DisabledInput.tsx +0 -17
  94. package/src/components/Form/Password/example/ErrorInput.tsx +0 -66
  95. package/src/components/Form/Password/example/FormikErrorInput.tsx +0 -67
  96. package/src/components/Form/Password/example/FormikHelperText.tsx +0 -65
  97. package/src/components/Form/Password/example/HelperText.tsx +0 -65
  98. package/src/components/Form/Select/Select/Select.props.ts +0 -262
  99. package/src/components/Form/Select/Select/Select.state.ts +0 -19
  100. package/src/components/Form/Select/Select/Select.style.ts +0 -19
  101. package/src/components/Form/Select/Select/Select.type.d.ts +0 -15
  102. package/src/components/Form/Select/Select/Select.view.tsx +0 -337
  103. package/src/components/Form/Select/Select.md +0 -165
  104. package/src/components/Form/Select/Select.tsx +0 -16
  105. package/src/components/Form/Select/examples/Color.tsx +0 -12
  106. package/src/components/Form/Select/examples/Default.tsx +0 -4
  107. package/src/components/Form/Select/examples/Disabled.tsx +0 -5
  108. package/src/components/Form/Select/examples/Error.tsx +0 -4
  109. package/src/components/Form/Select/examples/Form.tsx +0 -23
  110. package/src/components/Form/Select/examples/Formik.tsx +0 -41
  111. package/src/components/Form/Select/examples/HelperText.tsx +0 -7
  112. package/src/components/Form/Select/examples/Multiple.tsx +0 -6
  113. package/src/components/Form/Select/examples/ReadOnlyInput.tsx +0 -5
  114. package/src/components/Form/Select/examples/Shadow.tsx +0 -11
  115. package/src/components/Form/Select/examples/SizeInput.tsx +0 -16
  116. package/src/components/Form/Select/examples/StylesInput.tsx +0 -15
  117. package/src/components/Form/Switch/Switch/Switch.props.ts +0 -91
  118. package/src/components/Form/Switch/Switch/Switch.state.ts +0 -11
  119. package/src/components/Form/Switch/Switch/Switch.style.ts +0 -72
  120. package/src/components/Form/Switch/Switch/Switch.type.d.ts +0 -6
  121. package/src/components/Form/Switch/Switch/Switch.view.tsx +0 -78
  122. package/src/components/Form/Switch/Switch.md +0 -148
  123. package/src/components/Form/Switch/Switch.tsx +0 -12
  124. package/src/components/Form/Switch/examples/ChildSwitch.tsx +0 -20
  125. package/src/components/Form/Switch/examples/ColorScheme.tsx +0 -5
  126. package/src/components/Form/Switch/examples/Default.tsx +0 -4
  127. package/src/components/Form/Switch/examples/DisabledInput.tsx +0 -7
  128. package/src/components/Form/Switch/examples/FormSwitch.tsx +0 -22
  129. package/src/components/Form/Switch/examples/Formik.tsx +0 -30
  130. package/src/components/Form/Switch/examples/ReadOnlyInput.tsx +0 -7
  131. package/src/components/Form/Switch/examples/Shadow.tsx +0 -11
  132. package/src/components/Form/Switch/examples/SizeInput.tsx +0 -21
  133. package/src/components/Form/Switch/examples/StylesInput.tsx +0 -32
  134. package/src/components/Form/TextArea/TextArea/TextArea.props.ts +0 -154
  135. package/src/components/Form/TextArea/TextArea/TextArea.state.ts +0 -21
  136. package/src/components/Form/TextArea/TextArea/TextArea.type.ts +0 -15
  137. package/src/components/Form/TextArea/TextArea/TextArea.view.tsx +0 -143
  138. package/src/components/Form/TextArea/TextArea.md +0 -169
  139. package/src/components/Form/TextArea/TextArea.tsx +0 -15
  140. package/src/components/Form/TextArea/examples/ColorScheme.tsx +0 -13
  141. package/src/components/Form/TextArea/examples/Default.tsx +0 -5
  142. package/src/components/Form/TextArea/examples/DisabledInput.tsx +0 -7
  143. package/src/components/Form/TextArea/examples/ErrorInput.tsx +0 -50
  144. package/src/components/Form/TextArea/examples/FormikErrorInput.tsx +0 -52
  145. package/src/components/Form/TextArea/examples/FormikHelperText.tsx +0 -51
  146. package/src/components/Form/TextArea/examples/HelperText.tsx +0 -49
  147. package/src/components/Form/TextArea/examples/LabelInput.tsx +0 -23
  148. package/src/components/Form/TextArea/examples/MaxRowCol.tsx +0 -7
  149. package/src/components/Form/TextArea/examples/Placeholder.tsx +0 -23
  150. package/src/components/Form/TextArea/examples/ReadOnlyInput.tsx +0 -7
  151. package/src/components/Form/TextArea/examples/ShadowArea.tsx +0 -28
  152. package/src/components/Form/TextArea/examples/ShapeInput.tsx +0 -15
  153. package/src/components/Form/TextArea/examples/SizeInput.tsx +0 -16
  154. package/src/components/Form/TextArea/examples/StylesInput.tsx +0 -32
  155. package/src/components/Form/TextArea/examples/VariantsInputs.tsx +0 -15
  156. package/src/components/Form/TextArea/examples/index.ts +0 -15
  157. package/src/components/Form/TextArea/styles.css +0 -7
  158. package/src/components/Form/TextField/TextField/TextField.props.ts +0 -134
  159. package/src/components/Form/TextField/TextField/TextField.state.ts +0 -21
  160. package/src/components/Form/TextField/TextField/TextField.type.d.ts +0 -15
  161. package/src/components/Form/TextField/TextField/TextField.view.tsx +0 -170
  162. package/src/components/Form/TextField/TextField.md +0 -193
  163. package/src/components/Form/TextField/TextField.tsx +0 -14
  164. package/src/components/Form/TextField/examples/ClearInput.tsx +0 -13
  165. package/src/components/Form/TextField/examples/ColorScheme.tsx +0 -13
  166. package/src/components/Form/TextField/examples/Default.tsx +0 -23
  167. package/src/components/Form/TextField/examples/DisabledInput.tsx +0 -7
  168. package/src/components/Form/TextField/examples/ErrorInput.tsx +0 -74
  169. package/src/components/Form/TextField/examples/FormikErrorInput.tsx +0 -76
  170. package/src/components/Form/TextField/examples/FormikHelperText.tsx +0 -62
  171. package/src/components/Form/TextField/examples/HelperText.tsx +0 -60
  172. package/src/components/Form/TextField/examples/LabelInput.tsx +0 -23
  173. package/src/components/Form/TextField/examples/LeftChild.tsx +0 -8
  174. package/src/components/Form/TextField/examples/Placeholder.tsx +0 -23
  175. package/src/components/Form/TextField/examples/ReadOnlyInput.tsx +0 -7
  176. package/src/components/Form/TextField/examples/RightChild.tsx +0 -8
  177. package/src/components/Form/TextField/examples/ShapeInput.tsx +0 -15
  178. package/src/components/Form/TextField/examples/SizeInput.tsx +0 -16
  179. package/src/components/Form/TextField/examples/StylesInput.tsx +0 -33
  180. package/src/components/Form/TextField/examples/VariantsInputs.tsx +0 -15
  181. package/src/components/Form/TextField/examples/index.ts +0 -17
  182. package/src/components/Form/TextField/styles.css +0 -7
  183. package/src/components/Layout/Center/Center/Center.props.ts +0 -18
  184. package/src/components/Layout/Center/Center/Center.view.tsx +0 -12
  185. package/src/components/Layout/Center/Center.md +0 -17
  186. package/src/components/Layout/Center/Center.tsx +0 -11
  187. package/src/components/Layout/Horizontal/Horizontal/Horizontal.props.ts +0 -26
  188. package/src/components/Layout/Horizontal/Horizontal/Horizontal.view.tsx +0 -24
  189. package/src/components/Layout/Horizontal/Horizontal.md +0 -107
  190. package/src/components/Layout/Horizontal/Horizontal.tsx +0 -11
  191. package/src/components/Layout/Horizontal/examples/Default.tsx +0 -11
  192. package/src/components/Layout/Horizontal/examples/Justify.tsx +0 -25
  193. package/src/components/Layout/Horizontal/examples/Reversed.tsx +0 -11
  194. package/src/components/Layout/Horizontal/examples/Wrap.tsx +0 -29
  195. package/src/components/Layout/Horizontal/examples/index.ts +0 -4
  196. package/src/components/Layout/Input/FieldContainer/FieldContainer/FieldContainer.props.ts +0 -25
  197. package/src/components/Layout/Input/FieldContainer/FieldContainer.tsx +0 -17
  198. package/src/components/Layout/Input/FieldContent/FieldContent/FieldContent.props.ts +0 -75
  199. package/src/components/Layout/Input/FieldContent/FieldContent.tsx +0 -55
  200. package/src/components/Layout/Input/FieldIcons/FieldIcons/FieldIcons.props.ts +0 -12
  201. package/src/components/Layout/Input/FieldIcons/FieldIcons.tsx +0 -19
  202. package/src/components/Layout/Input/FieldLabel/FieldLabel/FieldLabel.props.ts +0 -31
  203. package/src/components/Layout/Input/FieldLabel/FieldLabel.tsx +0 -30
  204. package/src/components/Layout/Input/FieldLayout/FieldLayout/FieldLayout.props.ts +0 -29
  205. package/src/components/Layout/Input/FieldLayout/FieldLayout.tsx +0 -33
  206. package/src/components/Layout/Input/FieldWrapper/FieldWrapper.props.ts +0 -12
  207. package/src/components/Layout/Input/FieldWrapper/FieldWrapper.tsx +0 -11
  208. package/src/components/Layout/Input/HelperText/HelperText.props.ts +0 -21
  209. package/src/components/Layout/Input/HelperText/HelperText.tsx +0 -22
  210. package/src/components/Layout/Input/index.ts +0 -7
  211. package/src/components/Layout/Vertical/Vertical/Vertical.props.ts +0 -26
  212. package/src/components/Layout/Vertical/Vertical/Vertical.type.ts +0 -3
  213. package/src/components/Layout/Vertical/Vertical/Vertical.view.tsx +0 -23
  214. package/src/components/Layout/Vertical/Vertical.md +0 -120
  215. package/src/components/Layout/Vertical/Vertical.tsx +0 -12
  216. package/src/components/Layout/Vertical/examples/Default.tsx +0 -11
  217. package/src/components/Layout/Vertical/examples/Justify.tsx +0 -26
  218. package/src/components/Layout/Vertical/examples/Reversed.tsx +0 -11
  219. package/src/components/Layout/Vertical/examples/Wrap.tsx +0 -30
  220. package/src/components/Layout/Vertical/examples/index.tsx +0 -5
  221. package/src/components/Layout/View/View.tsx +0 -2
  222. package/src/components/Layout/configs/Input.style.ts +0 -45
  223. package/src/components/Layout/configs/Input.type.ts +0 -18
  224. package/src/components/Link/Link/Link.props.ts +0 -50
  225. package/src/components/Link/Link/Link.state.ts +0 -6
  226. package/src/components/Link/Link/Link.style.ts +0 -14
  227. package/src/components/Link/Link/Link.type.d.ts +0 -8
  228. package/src/components/Link/Link/Link.view.tsx +0 -44
  229. package/src/components/Link/Link.md +0 -61
  230. package/src/components/Link/Link.tsx +0 -15
  231. package/src/components/Link/examples/Default.tsx +0 -5
  232. package/src/components/Link/examples/IsExternal.tsx +0 -10
  233. package/src/components/Link/examples/Underline.tsx +0 -23
  234. package/src/components/Loader/Loader/Loader.props.ts +0 -105
  235. package/src/components/Loader/Loader/Loader.style.ts +0 -25
  236. package/src/components/Loader/Loader/Loader.type.d.ts +0 -4
  237. package/src/components/Loader/Loader/Loader.view.tsx +0 -138
  238. package/src/components/Loader/Loader.md +0 -111
  239. package/src/components/Loader/Loader.tsx +0 -11
  240. package/src/components/Loader/examples/ColorLoader.tsx +0 -13
  241. package/src/components/Loader/examples/DefaultLoader.tsx +0 -4
  242. package/src/components/Loader/examples/PositionLoader.tsx +0 -19
  243. package/src/components/Loader/examples/SizeLoader.tsx +0 -12
  244. package/src/components/Loader/examples/SpeedLoader.tsx +0 -12
  245. package/src/components/Loader/examples/TextLoader.tsx +0 -8
  246. package/src/components/Loader/examples/VariantLoader.tsx +0 -12
  247. package/src/components/Loader/examples/index.ts +0 -7
  248. package/src/components/Modal/Examples/BlurModal.tsx +0 -38
  249. package/src/components/Modal/Examples/CloseButtonModal.tsx +0 -44
  250. package/src/components/Modal/Examples/DefaultModal.tsx +0 -38
  251. package/src/components/Modal/Examples/FullScreenModal.tsx +0 -28
  252. package/src/components/Modal/Examples/ModalPosition.tsx +0 -61
  253. package/src/components/Modal/Examples/PreventCloseModal.tsx +0 -27
  254. package/src/components/Modal/Examples/ScrollModal.tsx +0 -41
  255. package/src/components/Modal/Examples/ShadowModal.tsx +0 -29
  256. package/src/components/Modal/Examples/VariantModal.tsx +0 -48
  257. package/src/components/Modal/Examples/index.ts +0 -9
  258. package/src/components/Modal/Modal/Modal.props.ts +0 -202
  259. package/src/components/Modal/Modal/Modal.style.ts +0 -23
  260. package/src/components/Modal/Modal/Modal.type.d.ts +0 -7
  261. package/src/components/Modal/Modal/Modal.view.tsx +0 -169
  262. package/src/components/Modal/Modal.md +0 -509
  263. package/src/components/Modal/Modal.tsx +0 -18
  264. package/src/components/Svg/ArrowDown.tsx +0 -32
  265. package/src/components/Svg/ArrowUp.tsx +0 -32
  266. package/src/components/Svg/Check.tsx +0 -28
  267. package/src/components/Svg/Close.tsx +0 -31
  268. package/src/components/Svg/CloseEye.tsx +0 -26
  269. package/src/components/Svg/DustBin.tsx +0 -29
  270. package/src/components/Svg/Edit.tsx +0 -34
  271. package/src/components/Svg/ExternalLink.tsx +0 -31
  272. package/src/components/Svg/Indeterminate.tsx +0 -21
  273. package/src/components/Svg/OpenEye.tsx +0 -26
  274. package/src/components/Svg/Profile.tsx +0 -40
  275. package/src/components/Svg/RightArrow.tsx +0 -44
  276. package/src/components/Svg/index.tsx +0 -12
  277. package/src/components/Text/Text/Text.props.ts +0 -84
  278. package/src/components/Text/Text/Text.style.ts +0 -34
  279. package/src/components/Text/Text/Text.type.d.ts +0 -14
  280. package/src/components/Text/Text/Text.view.tsx +0 -96
  281. package/src/components/Text/Text.md +0 -163
  282. package/src/components/Text/Text.tsx +0 -13
  283. package/src/components/index.tsx +0 -18
@@ -1,28 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Button } from 'src/components';
3
-
4
- import Modal from '../Modal';
5
-
6
- export const FullScreenModal = () => {
7
- const [show, setShow] = useState(false);
8
- return (
9
- <>
10
- <Button onClick={() => setShow(true)} isAuto>
11
- Full Screen
12
- </Button>
13
- <Modal.Overlay isOpen={show} onClose={() => setShow(false)}>
14
- <Modal.Container isFullScreen>
15
- <Modal.Header>Title</Modal.Header>
16
- <Modal.Body>
17
- Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget
18
- quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel
19
- scelerisque nisl consectetur et.
20
- </Modal.Body>
21
- <Modal.Footer>
22
- <Button onClick={() => setShow(false)}>Cancel</Button>
23
- </Modal.Footer>
24
- </Modal.Container>
25
- </Modal.Overlay>
26
- </>
27
- );
28
- };
@@ -1,61 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Button, Horizontal, Text } from 'src/components';
3
-
4
- import Modal from '../Modal';
5
-
6
- export const ModalPosition = () => {
7
- const [showTop, setShowTop] = useState(false);
8
- const [showBottom, setShowBottom] = useState(false);
9
- const [showRight, setShowRight] = useState(false);
10
- const [showLeft, setShowLeft] = useState(false);
11
- const [showCenter, setShowCenter] = useState(false);
12
-
13
- const content = (
14
- <Modal.Container width="fit-content">
15
- <Modal.Body>
16
- <Text color="theme.error" weight="bold">
17
- Unknown Error
18
- </Text>
19
- </Modal.Body>
20
- </Modal.Container>
21
- );
22
-
23
- return (
24
- <>
25
- <Horizontal gap={10} wrap="nowrap">
26
- <Button onClick={() => setShowTop(true)}>Top</Button>
27
- <Button onClick={() => setShowBottom(true)}>Bottom</Button>
28
- <Button onClick={() => setShowRight(true)}>Right</Button>
29
- <Button onClick={() => setShowLeft(true)}>Left</Button>
30
- <Button onClick={() => setShowCenter(true)}>Center</Button>
31
- </Horizontal>
32
-
33
- {showTop && (
34
- <Modal.Overlay isOpen={showTop} onClose={() => setShowTop(false)} position="top">
35
- {content}
36
- </Modal.Overlay>
37
- )}
38
- {showBottom && (
39
- <Modal.Overlay isOpen={showBottom} onClose={() => setShowBottom(false)} position="bottom">
40
- {content}
41
- </Modal.Overlay>
42
- )}
43
- {showRight && (
44
- <Modal.Overlay isOpen={showRight} onClose={() => setShowRight(false)} position="right">
45
- {content}
46
- </Modal.Overlay>
47
- )}
48
-
49
- {showLeft && (
50
- <Modal.Overlay isOpen={showLeft} onClose={() => setShowLeft(false)} position="left">
51
- {content}
52
- </Modal.Overlay>
53
- )}
54
- {showCenter && (
55
- <Modal.Overlay isOpen={showCenter} onClose={() => setShowCenter(false)} position="center">
56
- {content}
57
- </Modal.Overlay>
58
- )}
59
- </>
60
- );
61
- };
@@ -1,27 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Button } from 'src/components';
3
-
4
- import Modal from '../Modal';
5
-
6
- export const PreventClose = () => {
7
- const [prevent, setPrevent] = useState(false);
8
- return (
9
- <>
10
- <Button onClick={() => setPrevent(true)} isAuto>
11
- Prevent Close Button on Overlay
12
- </Button>
13
-
14
- {prevent && (
15
- <Modal.Overlay isOpen={prevent} onClose={() => setPrevent(false)} isClosePrevented>
16
- <Modal.Container>
17
- <Modal.Header> Prevent Close Button on Overlay</Modal.Header>
18
- <Modal.Body>Cras mattis consectetur purus sit amet fermentum.</Modal.Body>
19
- <Modal.Footer>
20
- <Button onClick={() => setPrevent(false)}>Cancel</Button>
21
- </Modal.Footer>
22
- </Modal.Container>
23
- </Modal.Overlay>
24
- )}
25
- </>
26
- );
27
- };
@@ -1,41 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Button, Text } from 'src/components';
3
-
4
- import Modal from '../Modal';
5
-
6
- export const ScrollModal = () => {
7
- const [show, setShow] = useState(false);
8
- return (
9
- <>
10
- <Button onClick={() => setShow(true)} isAuto>
11
- Scroll
12
- </Button>
13
- {show && (
14
- <Modal.Overlay isOpen={show} onClose={() => setShow(false)}>
15
- <Modal.Container>
16
- <Modal.Header buttonPosition="none">
17
- <Text size="lg" weight="semiBold">
18
- Title
19
- </Text>
20
- </Modal.Header>
21
- <Modal.Body height="200px">
22
- Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras
23
- mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis
24
- consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis
25
- consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis
26
- consectetur purus sit amet Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus
27
- sit amet fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet
28
- fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet
29
- fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet
30
- fermentum.Cras mattis consectetur purus sit amet fermentum.Cras mattis consectetur purus sit amet
31
- fermentum.
32
- </Modal.Body>
33
- <Modal.Footer>
34
- <Button onClick={() => setShow(false)}>Cancel</Button>
35
- </Modal.Footer>
36
- </Modal.Container>
37
- </Modal.Overlay>
38
- )}
39
- </>
40
- );
41
- };
@@ -1,29 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Button, Text } from 'src/components';
3
-
4
- import Modal from '../Modal';
5
-
6
- export const ShadowModal = () => {
7
- const [show, setShow] = useState(false);
8
- return (
9
- <>
10
- <Button onClick={() => setShow(true)} isAuto>
11
- Shadow
12
- </Button>
13
-
14
- {show && (
15
- <Modal.Overlay isOpen={show} onClose={() => setShow(false)}>
16
- <Modal.Container shadow={{ boxShadow: '0px 7px 8px rgba(0, 0, 0, 0.6)' }}>
17
- <Modal.Body>
18
- <Text isTruncated maxLines={2}>
19
- Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget
20
- quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel
21
- scelerisque nisl consectetur et.
22
- </Text>
23
- </Modal.Body>
24
- </Modal.Container>
25
- </Modal.Overlay>
26
- )}
27
- </>
28
- );
29
- };
@@ -1,48 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { Button, Horizontal, Text } from 'src/components';
3
-
4
- import Modal from '../Modal';
5
-
6
- export const VariantModal = () => {
7
- const [showSharp, setShowSharp] = useState(false);
8
- const [showRounded, setShowRounded] = useState(false);
9
- return (
10
- <>
11
- <Horizontal gap={10}>
12
- <Button onClick={() => setShowSharp(true)} isAuto>
13
- Sharp
14
- </Button>
15
- <Button onClick={() => setShowRounded(true)} isAuto>
16
- Rounded
17
- </Button>
18
- </Horizontal>
19
-
20
- {showSharp && (
21
- <Modal.Overlay isOpen={showSharp} onClose={() => setShowSharp(false)}>
22
- <Modal.Container shape="sharp">
23
- <Modal.Body>
24
- <Text isTruncated maxLines={2}>
25
- Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget
26
- quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel
27
- scelerisque nisl consectetur et.
28
- </Text>
29
- </Modal.Body>
30
- </Modal.Container>
31
- </Modal.Overlay>
32
- )}
33
- {showRounded && (
34
- <Modal.Overlay isOpen={showRounded} onClose={() => setShowRounded(false)}>
35
- <Modal.Container shape="rounded">
36
- <Modal.Body>
37
- <Text isTruncated maxLines={2}>
38
- Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget
39
- quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel
40
- scelerisque nisl consectetur et.
41
- </Text>
42
- </Modal.Body>
43
- </Modal.Container>
44
- </Modal.Overlay>
45
- )}
46
- </>
47
- );
48
- };
@@ -1,9 +0,0 @@
1
- export * from 'src/components/Modal/Examples/BlurModal';
2
- export * from 'src/components/Modal/Examples/CloseButtonModal';
3
- export * from 'src/components/Modal/Examples/DefaultModal';
4
- export * from 'src/components/Modal/Examples/FullScreenModal';
5
- export * from 'src/components/Modal/Examples/ModalPosition';
6
- export * from 'src/components/Modal/Examples/PreventCloseModal';
7
- export * from 'src/components/Modal/Examples/ScrollModal';
8
- export * from 'src/components/Modal/Examples/ShadowModal';
9
- export * from 'src/components/Modal/Examples/VariantModal';
@@ -1,202 +0,0 @@
1
- import React, { CSSProperties } from 'react';
2
- import { Elevation } from 'src/utils/elevation';
3
- import { Shadow } from 'app-studio';
4
-
5
- import { CloseButtonPosition, Position, Shape, Size } from './Modal.type';
6
-
7
- export interface ModalProps {
8
- /**
9
- * The content to be displayed inside the modal.
10
- */
11
- children: React.ReactNode;
12
-
13
- /**
14
- * The color of the close button in the header.
15
- */
16
- buttonColor?: string;
17
-
18
- /**
19
- * The size of the close button in the header.
20
- */
21
- iconSize?: Size;
22
-
23
- /**
24
- * Determines whether the modal should have sharp or rounded edges.
25
- */
26
- shape?: Shape;
27
-
28
- /**
29
- * If set to true, the modal will occupy the full width and height of the screen.
30
- */
31
- isFullScreen?: boolean;
32
-
33
- /**
34
- * Indicates the presence of a close button and its position within the header.
35
- */
36
- buttonPosition?: CloseButtonPosition;
37
-
38
- /**
39
- * The callback function to be executed when the close button is clicked or pressed.
40
- */
41
- onClose?: () => void;
42
-
43
- /**
44
- * The degree of blurriness applied to the overlay.
45
- */
46
- blur?: number;
47
-
48
- /**
49
- * If set to true, the modal will be visible.
50
- */
51
- isOpen?: boolean;
52
-
53
- /**
54
- * If set to true, the modal will remain open when the overlay is clicked.
55
- */
56
- isClosePrevented?: boolean;
57
-
58
- /**
59
- * The positioning of the modal container.
60
- */
61
- position?: Position;
62
-
63
- /**
64
- * Applies a shadow effect to the button.
65
- */
66
- shadow?: Shadow | Elevation | CSSProperties;
67
-
68
- /**
69
- * Additional properties.
70
- */
71
- [x: string]: any;
72
- }
73
-
74
- export interface ModalType extends React.FunctionComponent<ModalProps> {
75
- /**
76
- * The overlay component of the modal.
77
- */
78
- Overlay: React.FC<OverlayProps>;
79
-
80
- /**
81
- * The container component of the modal.
82
- */
83
- Container: React.FC<ContainerProps>;
84
-
85
- /**
86
- * The header component of the modal.
87
- */
88
- Header: React.FC<HeaderProps>;
89
-
90
- /**
91
- * The body component of the modal.
92
- */
93
- Body: React.FC<BodyProps>;
94
-
95
- /**
96
- * The footer component of the modal.
97
- */
98
- Footer: React.FC<FooterProps>;
99
- }
100
-
101
- export interface OverlayProps {
102
- /**
103
- * The content of the Overlay
104
- */
105
- children?: React.ReactNode;
106
- /**
107
- * The value of how much to blur the overlay
108
- */
109
- blur?: number;
110
- /**
111
- * If true, the modal will be visible
112
- */
113
- isOpen: boolean;
114
- /**
115
- * If true, the modal will not closed when the overlay is clicked
116
- */
117
- isClosePrevented?: boolean;
118
- /**
119
- * To position the modal container
120
- */
121
- position?: Position;
122
- /**
123
- * Action to be handled when the button close is clicked or pressed
124
- */
125
- onClose: () => void;
126
- /**
127
- * Other properties
128
- */
129
- [x: string]: any;
130
- }
131
-
132
- export interface HeaderProps {
133
- /**
134
- * The content of the header
135
- */
136
- buttonColor?: string;
137
- /**
138
- * To set the close button size
139
- */
140
- iconSize?: Size;
141
- /**
142
- * The content of the header
143
- */
144
- children?: React.ReactNode;
145
- /**
146
- * Indicates if there is a button and where to position it
147
- */
148
- buttonPosition?: CloseButtonPosition;
149
- /**
150
- * Action to be handled when the button close is clicked or pressed
151
- */
152
- onClose?: () => void;
153
- /**
154
- * Other properties
155
- */
156
- [x: string]: any;
157
- }
158
-
159
- export interface ContainerProps {
160
- /**
161
- * The content of the modal container
162
- */
163
- children: React.ReactNode;
164
- /**
165
- * To give a sharp or rounded edges to the modal
166
- */
167
- shape?: Shape;
168
- /**
169
- * If true, the modal will take the full width and height
170
- */
171
- isFullScreen?: boolean;
172
- /**
173
- * Set a shadow effect on the button.
174
- */
175
- shadow?: Shadow | Elevation | CSSProperties;
176
- /**
177
- * Other properties
178
- */
179
- [x: string]: any;
180
- }
181
-
182
- export interface BodyProps {
183
- /**
184
- * The content of the Body
185
- */
186
- children?: React.ReactNode;
187
- /**
188
- * Other properties
189
- */
190
- [x: string]: any;
191
- }
192
-
193
- export interface FooterProps {
194
- /**
195
- * The content of the Footer
196
- */
197
- children?: React.ReactNode;
198
- /**
199
- * Other properties
200
- */
201
- [x: string]: any;
202
- }
@@ -1,23 +0,0 @@
1
- import { CSSProperties } from 'react';
2
-
3
- import { Position, Shape, Size } from './Modal.type';
4
-
5
- export const ContainerShapes: Record<Shape, CSSProperties> = {
6
- sharp: { borderRadius: 0 },
7
- rounded: { borderRadius: 4 },
8
- };
9
- export const OverlayAlignments: Record<Position, CSSProperties> = {
10
- center: { justifyContent: 'center', alignItems: 'center' },
11
- top: { justifyContent: 'center' },
12
- right: { justifyContent: 'flex-end', alignItems: 'center' },
13
- bottom: { justifyContent: 'center', alignItems: 'flex-end' },
14
- left: { alignItems: 'center' },
15
- };
16
-
17
- export const HeaderIconSizes: Record<Size, number> = {
18
- xs: 12,
19
- sm: 16,
20
- md: 20,
21
- lg: 24,
22
- xl: 28,
23
- };
@@ -1,7 +0,0 @@
1
- export type Position = 'top' | 'left' | 'right' | 'bottom' | 'center';
2
-
3
- export type Shape = 'sharp' | 'rounded';
4
-
5
- export type CloseButtonPosition = 'left' | 'right' | 'none';
6
-
7
- export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
@@ -1,169 +0,0 @@
1
- import React, { useEffect } from 'react';
2
- import { Center, Vertical } from 'src/components';
3
- import { Horizontal } from 'src/components';
4
- import { Button } from 'src/components';
5
- import { View } from 'src/components/Layout/View/View';
6
- import { CloseSvg } from 'src/components/Svg';
7
- import { useModalStore } from 'src/store/useModalStore';
8
-
9
- import { BodyProps, ContainerProps, FooterProps, HeaderProps, OverlayProps } from '../Modal/Modal.props';
10
- import { ContainerShapes, OverlayAlignments } from '../Modal/Modal.style';
11
- import { HeaderIconSizes } from '../Modal/Modal.style';
12
-
13
- export const ModalOverlay: React.FC<OverlayProps> = ({
14
- children,
15
- blur,
16
- isOpen = false,
17
- isClosePrevented = false,
18
- onClose = () => {},
19
- position = 'center',
20
- ...props
21
- }) => {
22
- const setOpen = useModalStore((state: any) => state.setOpen);
23
- const setOnClose = useModalStore((state: any) => state.setOnClose);
24
-
25
- useEffect(() => {
26
- setOnClose(onClose);
27
- if (isOpen) setOpen();
28
- });
29
-
30
- if (!isOpen) return null;
31
-
32
- const handleClick = () => {
33
- if (!isClosePrevented) onClose();
34
- };
35
-
36
- return (
37
- <Center
38
- position="fixed"
39
- top={0}
40
- left={0}
41
- width="100%"
42
- height="100%"
43
- zIndex={1000}
44
- onClick={handleClick}
45
- visibility={isOpen ? 'visible' : 'hidden'}
46
- >
47
- <View
48
- cursor="pointer"
49
- position="absolute"
50
- top={0}
51
- left={0}
52
- zIndex={1000}
53
- width="100vw"
54
- height="100vh"
55
- display="flex"
56
- backgroundColor="blackAlpha.500"
57
- backdropFilter={blur ? `blur(${blur}px)` : undefined}
58
- onClick={handleClick}
59
- {...OverlayAlignments[position]}
60
- {...props}
61
- >
62
- {children}
63
- </View>
64
- </Center>
65
- );
66
- };
67
-
68
- export const ModalContainer: React.FC<ContainerProps> = ({
69
- children,
70
- shadow,
71
- isFullScreen = false,
72
- shape = 'rounded',
73
- ...props
74
- }) => {
75
- const defaultShadow =
76
- typeof document !== undefined
77
- ? {
78
- boxShadow: '0px 2px 8px rgba(0, 0, 0, 0.3)',
79
- }
80
- : {
81
- elevation: 5,
82
- shadowColor: 'rgba(0, 0, 0, 0.3)',
83
- shadowOffset: { width: 0, height: 2 },
84
- shadowOpacity: 1,
85
- shadowRadius: 8,
86
- };
87
-
88
- const handleClick = (event: any) => event.stopPropagation();
89
- return (
90
- <Vertical
91
- cursor="default"
92
- overflow="hidden"
93
- backgroundColor="white"
94
- width={isFullScreen ? '100%' : 600}
95
- height={isFullScreen ? '100%' : 'fit-content'}
96
- onClick={handleClick}
97
- {...(shadow ? shadow : defaultShadow)}
98
- {...ContainerShapes[shape]}
99
- {...props}
100
- >
101
- {children}
102
- </Vertical>
103
- );
104
- };
105
-
106
- export const ModalHeader: React.FC<HeaderProps> = ({
107
- children,
108
- buttonColor = 'theme.primary',
109
- iconSize = 'md',
110
- buttonPosition = 'right',
111
- ...props
112
- }) => {
113
- const onClose = useModalStore((state: any) => state.onClose);
114
-
115
- const buttonIcon = (
116
- <Button
117
- onClick={onClose}
118
- colorScheme="transparent"
119
- icon={<CloseSvg size={HeaderIconSizes[iconSize]} color={buttonColor} />}
120
- padding={0}
121
- margin={0}
122
- filter="none"
123
- isAuto
124
- />
125
- );
126
-
127
- return (
128
- <Horizontal
129
- justifyContent={buttonPosition === 'none' ? 'center' : 'space-between'}
130
- alignItems="center"
131
- paddingVertical={15}
132
- paddingHorizontal={20}
133
- {...props}
134
- >
135
- {buttonPosition === 'left' && buttonIcon}
136
- {children}
137
- {buttonPosition === 'right' && buttonIcon}
138
- </Horizontal>
139
- );
140
- };
141
-
142
- export const ModalBody: React.FC<BodyProps> = ({ children, ...props }) => {
143
- const defaultBorder = {
144
- borderBottomWidth: 2,
145
- borderTopWidth: 2,
146
- borderColor: 'rgba(250, 250, 250, 1)',
147
- borderStyle: 'solid',
148
- };
149
- return (
150
- <View overflowY="auto" paddingVertical={15} paddingHorizontal={20} {...defaultBorder} {...props}>
151
- {children}
152
- </View>
153
- );
154
- };
155
-
156
- export const ModalFooter: React.FC<FooterProps> = ({ children, ...props }) => {
157
- return (
158
- <Horizontal
159
- marginTop="auto"
160
- alignItems="center"
161
- justifyContent="flex-end"
162
- paddingVertical={15}
163
- paddingHorizontal={20}
164
- {...props}
165
- >
166
- {children}
167
- </Horizontal>
168
- );
169
- };