@app-studio/web 0.1.4 → 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 (300) hide show
  1. package/dist/components/Button/examples/index.d.ts +9 -9
  2. package/dist/components/Form/Checkbox/examples/index.d.ts +11 -11
  3. package/dist/components/Form/CountryPicker/examples/index.d.ts +12 -12
  4. package/dist/components/Form/DatePicker/examples/index.d.ts +11 -11
  5. package/dist/components/Form/Password/Password/Password.props.d.ts +1 -1
  6. package/dist/components/Form/TextArea/examples/index.d.ts +15 -15
  7. package/dist/components/Form/TextField/examples/index.d.ts +17 -17
  8. package/dist/components/Layout/Horizontal/examples/index.d.ts +4 -4
  9. package/dist/components/Layout/Input/FieldContainer/FieldContainer/FieldContainer.props.d.ts +1 -1
  10. package/dist/components/Layout/Input/FieldContent/FieldContent/FieldContent.props.d.ts +1 -1
  11. package/dist/components/Layout/Input/FieldLabel/FieldLabel/FieldLabel.props.d.ts +1 -1
  12. package/dist/components/Layout/Input/FieldLayout/FieldLayout/FieldLayout.props.d.ts +1 -1
  13. package/dist/components/Layout/Input/HelperText/HelperText.props.d.ts +1 -1
  14. package/dist/components/Layout/Input/index.d.ts +7 -7
  15. package/dist/components/Loader/examples/index.d.ts +7 -7
  16. package/dist/components/Modal/Examples/index.d.ts +9 -9
  17. package/dist/components/index.d.ts +18 -18
  18. package/package.json +6 -7
  19. package/src/components/Button/Button/Button.props.ts +0 -79
  20. package/src/components/Button/Button/Button.state.ts +0 -7
  21. package/src/components/Button/Button/Button.style.ts +0 -95
  22. package/src/components/Button/Button/Button.type.d.ts +0 -11
  23. package/src/components/Button/Button/Button.view.tsx +0 -113
  24. package/src/components/Button/Button.md +0 -165
  25. package/src/components/Button/Button.tsx +0 -24
  26. package/src/components/Button/examples/AutoFocusButton.tsx +0 -13
  27. package/src/components/Button/examples/BorderedButtons.tsx +0 -14
  28. package/src/components/Button/examples/ColoredButtons.tsx +0 -12
  29. package/src/components/Button/examples/DefaultButton.tsx +0 -4
  30. package/src/components/Button/examples/DisabledButton.tsx +0 -13
  31. package/src/components/Button/examples/IconButtons.tsx +0 -23
  32. package/src/components/Button/examples/LoadingButtons.tsx +0 -32
  33. package/src/components/Button/examples/ShadowButton.tsx +0 -6
  34. package/src/components/Button/examples/SizeButtons.tsx +0 -16
  35. package/src/components/Button/examples/VariantButtons.tsx +0 -20
  36. package/src/components/Button/examples/index.ts +0 -9
  37. package/src/components/Form/Checkbox/Checkbox/Checkbox.props.ts +0 -118
  38. package/src/components/Form/Checkbox/Checkbox/Checkbox.state.ts +0 -15
  39. package/src/components/Form/Checkbox/Checkbox/Checkbox.style.ts +0 -29
  40. package/src/components/Form/Checkbox/Checkbox/Checkbox.type.d.ts +0 -8
  41. package/src/components/Form/Checkbox/Checkbox/Checkbox.view.tsx +0 -98
  42. package/src/components/Form/Checkbox/Checkbox.md +0 -128
  43. package/src/components/Form/Checkbox/Checkbox.tsx +0 -15
  44. package/src/components/Form/Checkbox/examples/ColorScheme.tsx +0 -12
  45. package/src/components/Form/Checkbox/examples/Default.tsx +0 -5
  46. package/src/components/Form/Checkbox/examples/DisabledInput.tsx +0 -5
  47. package/src/components/Form/Checkbox/examples/ErrorCheckbox.tsx +0 -5
  48. package/src/components/Form/Checkbox/examples/FormCheckout.tsx +0 -46
  49. package/src/components/Form/Checkbox/examples/IconCheckbox.tsx +0 -8
  50. package/src/components/Form/Checkbox/examples/IndeterminateCheckbox.tsx +0 -5
  51. package/src/components/Form/Checkbox/examples/ReadOnlyInput.tsx +0 -5
  52. package/src/components/Form/Checkbox/examples/Shadow.tsx +0 -11
  53. package/src/components/Form/Checkbox/examples/SizeInput.tsx +0 -18
  54. package/src/components/Form/Checkbox/examples/StylesInput.tsx +0 -22
  55. package/src/components/Form/Checkbox/examples/index.ts +0 -11
  56. package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.props.ts +0 -187
  57. package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.state.ts +0 -28
  58. package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.style.ts +0 -17
  59. package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.type.d.ts +0 -22
  60. package/src/components/Form/CountryPicker/CountryPicker/CountryPicker.view.tsx +0 -234
  61. package/src/components/Form/CountryPicker/CountryPicker.md +0 -206
  62. package/src/components/Form/CountryPicker/CountryPicker.tsx +0 -16
  63. package/src/components/Form/CountryPicker/countries.json +0 -1453
  64. package/src/components/Form/CountryPicker/examples/Color.tsx +0 -12
  65. package/src/components/Form/CountryPicker/examples/Default.tsx +0 -4
  66. package/src/components/Form/CountryPicker/examples/Disabled.tsx +0 -5
  67. package/src/components/Form/CountryPicker/examples/Error.tsx +0 -4
  68. package/src/components/Form/CountryPicker/examples/Form.tsx +0 -23
  69. package/src/components/Form/CountryPicker/examples/Formik.tsx +0 -39
  70. package/src/components/Form/CountryPicker/examples/HelperText.tsx +0 -5
  71. package/src/components/Form/CountryPicker/examples/ReadOnlyInput.tsx +0 -5
  72. package/src/components/Form/CountryPicker/examples/Shadow.tsx +0 -4
  73. package/src/components/Form/CountryPicker/examples/Shape.tsx +0 -13
  74. package/src/components/Form/CountryPicker/examples/SizeInput.tsx +0 -16
  75. package/src/components/Form/CountryPicker/examples/StylesInput.tsx +0 -17
  76. package/src/components/Form/CountryPicker/examples/Variant.tsx +0 -13
  77. package/src/components/Form/CountryPicker/examples/index.ts +0 -12
  78. package/src/components/Form/CountryPicker/styles.css +0 -7
  79. package/src/components/Form/DatePicker/DatePicker/DatePicker.props.ts +0 -113
  80. package/src/components/Form/DatePicker/DatePicker/DatePicker.state.ts +0 -17
  81. package/src/components/Form/DatePicker/DatePicker/DatePicker.style.ts +0 -17
  82. package/src/components/Form/DatePicker/DatePicker/DatePicker.type.d.ts +0 -15
  83. package/src/components/Form/DatePicker/DatePicker/DatePicker.view.tsx +0 -118
  84. package/src/components/Form/DatePicker/DatePicker.md +0 -115
  85. package/src/components/Form/DatePicker/DatePicker.tsx +0 -15
  86. package/src/components/Form/DatePicker/examples/ColorScheme.tsx +0 -12
  87. package/src/components/Form/DatePicker/examples/Default.tsx +0 -4
  88. package/src/components/Form/DatePicker/examples/DisabledInput.tsx +0 -5
  89. package/src/components/Form/DatePicker/examples/ErrorCheckbox.tsx +0 -4
  90. package/src/components/Form/DatePicker/examples/FormCheckout.tsx +0 -23
  91. package/src/components/Form/DatePicker/examples/Formik.tsx +0 -35
  92. package/src/components/Form/DatePicker/examples/ReadOnlyInput.tsx +0 -5
  93. package/src/components/Form/DatePicker/examples/Shadow.tsx +0 -10
  94. package/src/components/Form/DatePicker/examples/SizeInput.tsx +0 -16
  95. package/src/components/Form/DatePicker/examples/StylesInput.tsx +0 -14
  96. package/src/components/Form/DatePicker/examples/helperTextDatePicker.tsx +0 -6
  97. package/src/components/Form/DatePicker/examples/index.ts +0 -11
  98. package/src/components/Form/Label/Label/Label.props.ts +0 -36
  99. package/src/components/Form/Label/Label/Label.style.ts +0 -34
  100. package/src/components/Form/Label/Label/Label.type.ts +0 -14
  101. package/src/components/Form/Label/Label/Label.view.tsx +0 -35
  102. package/src/components/Form/Label/Label.tsx +0 -8
  103. package/src/components/Form/Password/Password/Password.props.ts +0 -36
  104. package/src/components/Form/Password/Password/Password.state.ts +0 -6
  105. package/src/components/Form/Password/Password/Password.type.d.ts +0 -14
  106. package/src/components/Form/Password/Password/Password.view.tsx +0 -32
  107. package/src/components/Form/Password/Password.md +0 -108
  108. package/src/components/Form/Password/Password.tsx +0 -15
  109. package/src/components/Form/Password/example/Default.tsx +0 -9
  110. package/src/components/Form/Password/example/DisabledInput.tsx +0 -17
  111. package/src/components/Form/Password/example/ErrorInput.tsx +0 -66
  112. package/src/components/Form/Password/example/FormikErrorInput.tsx +0 -67
  113. package/src/components/Form/Password/example/FormikHelperText.tsx +0 -65
  114. package/src/components/Form/Password/example/HelperText.tsx +0 -65
  115. package/src/components/Form/Select/Select/Select.props.ts +0 -262
  116. package/src/components/Form/Select/Select/Select.state.ts +0 -19
  117. package/src/components/Form/Select/Select/Select.style.ts +0 -19
  118. package/src/components/Form/Select/Select/Select.type.d.ts +0 -15
  119. package/src/components/Form/Select/Select/Select.view.tsx +0 -337
  120. package/src/components/Form/Select/Select.md +0 -165
  121. package/src/components/Form/Select/Select.tsx +0 -16
  122. package/src/components/Form/Select/examples/Color.tsx +0 -12
  123. package/src/components/Form/Select/examples/Default.tsx +0 -4
  124. package/src/components/Form/Select/examples/Disabled.tsx +0 -5
  125. package/src/components/Form/Select/examples/Error.tsx +0 -4
  126. package/src/components/Form/Select/examples/Form.tsx +0 -23
  127. package/src/components/Form/Select/examples/Formik.tsx +0 -41
  128. package/src/components/Form/Select/examples/HelperText.tsx +0 -7
  129. package/src/components/Form/Select/examples/Multiple.tsx +0 -6
  130. package/src/components/Form/Select/examples/ReadOnlyInput.tsx +0 -5
  131. package/src/components/Form/Select/examples/Shadow.tsx +0 -11
  132. package/src/components/Form/Select/examples/SizeInput.tsx +0 -16
  133. package/src/components/Form/Select/examples/StylesInput.tsx +0 -15
  134. package/src/components/Form/Switch/Switch/Switch.props.ts +0 -91
  135. package/src/components/Form/Switch/Switch/Switch.state.ts +0 -11
  136. package/src/components/Form/Switch/Switch/Switch.style.ts +0 -72
  137. package/src/components/Form/Switch/Switch/Switch.type.d.ts +0 -6
  138. package/src/components/Form/Switch/Switch/Switch.view.tsx +0 -78
  139. package/src/components/Form/Switch/Switch.md +0 -148
  140. package/src/components/Form/Switch/Switch.tsx +0 -12
  141. package/src/components/Form/Switch/examples/ChildSwitch.tsx +0 -20
  142. package/src/components/Form/Switch/examples/ColorScheme.tsx +0 -5
  143. package/src/components/Form/Switch/examples/Default.tsx +0 -4
  144. package/src/components/Form/Switch/examples/DisabledInput.tsx +0 -7
  145. package/src/components/Form/Switch/examples/FormSwitch.tsx +0 -22
  146. package/src/components/Form/Switch/examples/Formik.tsx +0 -30
  147. package/src/components/Form/Switch/examples/ReadOnlyInput.tsx +0 -7
  148. package/src/components/Form/Switch/examples/Shadow.tsx +0 -11
  149. package/src/components/Form/Switch/examples/SizeInput.tsx +0 -21
  150. package/src/components/Form/Switch/examples/StylesInput.tsx +0 -32
  151. package/src/components/Form/TextArea/TextArea/TextArea.props.ts +0 -154
  152. package/src/components/Form/TextArea/TextArea/TextArea.state.ts +0 -21
  153. package/src/components/Form/TextArea/TextArea/TextArea.type.ts +0 -15
  154. package/src/components/Form/TextArea/TextArea/TextArea.view.tsx +0 -143
  155. package/src/components/Form/TextArea/TextArea.md +0 -169
  156. package/src/components/Form/TextArea/TextArea.tsx +0 -15
  157. package/src/components/Form/TextArea/examples/ColorScheme.tsx +0 -13
  158. package/src/components/Form/TextArea/examples/Default.tsx +0 -5
  159. package/src/components/Form/TextArea/examples/DisabledInput.tsx +0 -7
  160. package/src/components/Form/TextArea/examples/ErrorInput.tsx +0 -50
  161. package/src/components/Form/TextArea/examples/FormikErrorInput.tsx +0 -52
  162. package/src/components/Form/TextArea/examples/FormikHelperText.tsx +0 -51
  163. package/src/components/Form/TextArea/examples/HelperText.tsx +0 -49
  164. package/src/components/Form/TextArea/examples/LabelInput.tsx +0 -23
  165. package/src/components/Form/TextArea/examples/MaxRowCol.tsx +0 -7
  166. package/src/components/Form/TextArea/examples/Placeholder.tsx +0 -23
  167. package/src/components/Form/TextArea/examples/ReadOnlyInput.tsx +0 -7
  168. package/src/components/Form/TextArea/examples/ShadowArea.tsx +0 -28
  169. package/src/components/Form/TextArea/examples/ShapeInput.tsx +0 -15
  170. package/src/components/Form/TextArea/examples/SizeInput.tsx +0 -16
  171. package/src/components/Form/TextArea/examples/StylesInput.tsx +0 -32
  172. package/src/components/Form/TextArea/examples/VariantsInputs.tsx +0 -15
  173. package/src/components/Form/TextArea/examples/index.ts +0 -15
  174. package/src/components/Form/TextArea/styles.css +0 -7
  175. package/src/components/Form/TextField/TextField/TextField.props.ts +0 -134
  176. package/src/components/Form/TextField/TextField/TextField.state.ts +0 -21
  177. package/src/components/Form/TextField/TextField/TextField.type.d.ts +0 -15
  178. package/src/components/Form/TextField/TextField/TextField.view.tsx +0 -170
  179. package/src/components/Form/TextField/TextField.md +0 -193
  180. package/src/components/Form/TextField/TextField.tsx +0 -14
  181. package/src/components/Form/TextField/examples/ClearInput.tsx +0 -13
  182. package/src/components/Form/TextField/examples/ColorScheme.tsx +0 -13
  183. package/src/components/Form/TextField/examples/Default.tsx +0 -23
  184. package/src/components/Form/TextField/examples/DisabledInput.tsx +0 -7
  185. package/src/components/Form/TextField/examples/ErrorInput.tsx +0 -74
  186. package/src/components/Form/TextField/examples/FormikErrorInput.tsx +0 -76
  187. package/src/components/Form/TextField/examples/FormikHelperText.tsx +0 -62
  188. package/src/components/Form/TextField/examples/HelperText.tsx +0 -60
  189. package/src/components/Form/TextField/examples/LabelInput.tsx +0 -23
  190. package/src/components/Form/TextField/examples/LeftChild.tsx +0 -8
  191. package/src/components/Form/TextField/examples/Placeholder.tsx +0 -23
  192. package/src/components/Form/TextField/examples/ReadOnlyInput.tsx +0 -7
  193. package/src/components/Form/TextField/examples/RightChild.tsx +0 -8
  194. package/src/components/Form/TextField/examples/ShapeInput.tsx +0 -15
  195. package/src/components/Form/TextField/examples/SizeInput.tsx +0 -16
  196. package/src/components/Form/TextField/examples/StylesInput.tsx +0 -33
  197. package/src/components/Form/TextField/examples/VariantsInputs.tsx +0 -15
  198. package/src/components/Form/TextField/examples/index.ts +0 -17
  199. package/src/components/Form/TextField/styles.css +0 -7
  200. package/src/components/Layout/Center/Center/Center.props.ts +0 -18
  201. package/src/components/Layout/Center/Center/Center.view.tsx +0 -12
  202. package/src/components/Layout/Center/Center.md +0 -17
  203. package/src/components/Layout/Center/Center.tsx +0 -11
  204. package/src/components/Layout/Horizontal/Horizontal/Horizontal.props.ts +0 -26
  205. package/src/components/Layout/Horizontal/Horizontal/Horizontal.view.tsx +0 -24
  206. package/src/components/Layout/Horizontal/Horizontal.md +0 -107
  207. package/src/components/Layout/Horizontal/Horizontal.tsx +0 -11
  208. package/src/components/Layout/Horizontal/examples/Default.tsx +0 -11
  209. package/src/components/Layout/Horizontal/examples/Justify.tsx +0 -25
  210. package/src/components/Layout/Horizontal/examples/Reversed.tsx +0 -11
  211. package/src/components/Layout/Horizontal/examples/Wrap.tsx +0 -29
  212. package/src/components/Layout/Horizontal/examples/index.ts +0 -4
  213. package/src/components/Layout/Input/FieldContainer/FieldContainer/FieldContainer.props.ts +0 -25
  214. package/src/components/Layout/Input/FieldContainer/FieldContainer.tsx +0 -17
  215. package/src/components/Layout/Input/FieldContent/FieldContent/FieldContent.props.ts +0 -75
  216. package/src/components/Layout/Input/FieldContent/FieldContent.tsx +0 -55
  217. package/src/components/Layout/Input/FieldIcons/FieldIcons/FieldIcons.props.ts +0 -12
  218. package/src/components/Layout/Input/FieldIcons/FieldIcons.tsx +0 -19
  219. package/src/components/Layout/Input/FieldLabel/FieldLabel/FieldLabel.props.ts +0 -31
  220. package/src/components/Layout/Input/FieldLabel/FieldLabel.tsx +0 -30
  221. package/src/components/Layout/Input/FieldLayout/FieldLayout/FieldLayout.props.ts +0 -29
  222. package/src/components/Layout/Input/FieldLayout/FieldLayout.tsx +0 -33
  223. package/src/components/Layout/Input/FieldWrapper/FieldWrapper.props.ts +0 -12
  224. package/src/components/Layout/Input/FieldWrapper/FieldWrapper.tsx +0 -11
  225. package/src/components/Layout/Input/HelperText/HelperText.props.ts +0 -21
  226. package/src/components/Layout/Input/HelperText/HelperText.tsx +0 -22
  227. package/src/components/Layout/Input/index.ts +0 -7
  228. package/src/components/Layout/Vertical/Vertical/Vertical.props.ts +0 -26
  229. package/src/components/Layout/Vertical/Vertical/Vertical.type.ts +0 -3
  230. package/src/components/Layout/Vertical/Vertical/Vertical.view.tsx +0 -23
  231. package/src/components/Layout/Vertical/Vertical.md +0 -120
  232. package/src/components/Layout/Vertical/Vertical.tsx +0 -12
  233. package/src/components/Layout/Vertical/examples/Default.tsx +0 -11
  234. package/src/components/Layout/Vertical/examples/Justify.tsx +0 -26
  235. package/src/components/Layout/Vertical/examples/Reversed.tsx +0 -11
  236. package/src/components/Layout/Vertical/examples/Wrap.tsx +0 -30
  237. package/src/components/Layout/Vertical/examples/index.tsx +0 -5
  238. package/src/components/Layout/View/View.tsx +0 -2
  239. package/src/components/Layout/configs/Input.style.ts +0 -45
  240. package/src/components/Layout/configs/Input.type.ts +0 -18
  241. package/src/components/Link/Link/Link.props.ts +0 -50
  242. package/src/components/Link/Link/Link.state.ts +0 -6
  243. package/src/components/Link/Link/Link.style.ts +0 -14
  244. package/src/components/Link/Link/Link.type.d.ts +0 -8
  245. package/src/components/Link/Link/Link.view.tsx +0 -44
  246. package/src/components/Link/Link.md +0 -61
  247. package/src/components/Link/Link.tsx +0 -15
  248. package/src/components/Link/examples/Default.tsx +0 -5
  249. package/src/components/Link/examples/IsExternal.tsx +0 -10
  250. package/src/components/Link/examples/Underline.tsx +0 -23
  251. package/src/components/Loader/Loader/Loader.props.ts +0 -105
  252. package/src/components/Loader/Loader/Loader.style.ts +0 -25
  253. package/src/components/Loader/Loader/Loader.type.d.ts +0 -4
  254. package/src/components/Loader/Loader/Loader.view.tsx +0 -138
  255. package/src/components/Loader/Loader.md +0 -111
  256. package/src/components/Loader/Loader.tsx +0 -11
  257. package/src/components/Loader/examples/ColorLoader.tsx +0 -13
  258. package/src/components/Loader/examples/DefaultLoader.tsx +0 -4
  259. package/src/components/Loader/examples/PositionLoader.tsx +0 -19
  260. package/src/components/Loader/examples/SizeLoader.tsx +0 -12
  261. package/src/components/Loader/examples/SpeedLoader.tsx +0 -12
  262. package/src/components/Loader/examples/TextLoader.tsx +0 -8
  263. package/src/components/Loader/examples/VariantLoader.tsx +0 -12
  264. package/src/components/Loader/examples/index.ts +0 -7
  265. package/src/components/Modal/Examples/BlurModal.tsx +0 -38
  266. package/src/components/Modal/Examples/CloseButtonModal.tsx +0 -44
  267. package/src/components/Modal/Examples/DefaultModal.tsx +0 -38
  268. package/src/components/Modal/Examples/FullScreenModal.tsx +0 -28
  269. package/src/components/Modal/Examples/ModalPosition.tsx +0 -61
  270. package/src/components/Modal/Examples/PreventCloseModal.tsx +0 -27
  271. package/src/components/Modal/Examples/ScrollModal.tsx +0 -41
  272. package/src/components/Modal/Examples/ShadowModal.tsx +0 -29
  273. package/src/components/Modal/Examples/VariantModal.tsx +0 -48
  274. package/src/components/Modal/Examples/index.ts +0 -9
  275. package/src/components/Modal/Modal/Modal.props.ts +0 -202
  276. package/src/components/Modal/Modal/Modal.style.ts +0 -23
  277. package/src/components/Modal/Modal/Modal.type.d.ts +0 -7
  278. package/src/components/Modal/Modal/Modal.view.tsx +0 -169
  279. package/src/components/Modal/Modal.md +0 -509
  280. package/src/components/Modal/Modal.tsx +0 -18
  281. package/src/components/Svg/ArrowDown.tsx +0 -32
  282. package/src/components/Svg/ArrowUp.tsx +0 -32
  283. package/src/components/Svg/Check.tsx +0 -28
  284. package/src/components/Svg/Close.tsx +0 -31
  285. package/src/components/Svg/CloseEye.tsx +0 -26
  286. package/src/components/Svg/DustBin.tsx +0 -29
  287. package/src/components/Svg/Edit.tsx +0 -34
  288. package/src/components/Svg/ExternalLink.tsx +0 -31
  289. package/src/components/Svg/Indeterminate.tsx +0 -21
  290. package/src/components/Svg/OpenEye.tsx +0 -26
  291. package/src/components/Svg/Profile.tsx +0 -40
  292. package/src/components/Svg/RightArrow.tsx +0 -44
  293. package/src/components/Svg/index.tsx +0 -12
  294. package/src/components/Text/Text/Text.props.ts +0 -84
  295. package/src/components/Text/Text/Text.style.ts +0 -34
  296. package/src/components/Text/Text/Text.type.d.ts +0 -14
  297. package/src/components/Text/Text/Text.view.tsx +0 -96
  298. package/src/components/Text/Text.md +0 -163
  299. package/src/components/Text/Text.tsx +0 -13
  300. package/src/components/index.tsx +0 -18
@@ -1,337 +0,0 @@
1
- import React, { useCallback } from 'react';
2
- import { Element } from 'app-studio';
3
- import { Typography } from 'app-studio';
4
- import { Horizontal, Text } from 'src/components';
5
- import { FieldContainer } from 'src/components/Layout/Input/FieldContainer/FieldContainer';
6
- import { FieldContent } from 'src/components/Layout/Input/FieldContent/FieldContent';
7
- import { FieldIcons } from 'src/components/Layout/Input/FieldIcons/FieldIcons';
8
- import { FieldLabel } from 'src/components/Layout/Input/FieldLabel/FieldLabel';
9
- import { FieldWrapper } from 'src/components/Layout/Input/FieldWrapper/FieldWrapper';
10
- import { ArrowDownSvg, ArrowUpSvg, CloseSvg } from 'src/components/Svg';
11
-
12
- import {
13
- DropDownProps,
14
- HiddenSelectProps,
15
- ItemProps,
16
- MultiSelectProps,
17
- SelectBoxProps,
18
- SelectViewProps,
19
- } from './Select.props';
20
- import { useItemState } from './Select.state';
21
- import { IconSizes } from './Select.style';
22
-
23
- const Item: React.FC<ItemProps> = ({ isHovered, setIsHovered, option, size = 'md', callback = () => {}, ...props }) => {
24
- const handleOptionClick = (option: string) => callback(option);
25
- const handleHover = () => setIsHovered(!isHovered);
26
-
27
- return (
28
- <Element
29
- as="li"
30
- margin={0}
31
- paddingVertical={8}
32
- paddingHorizontal={12}
33
- listStyleType="none"
34
- onMouseEnter={handleHover}
35
- onMouseLeave={handleHover}
36
- fontSize={Typography.fontSizes[size]}
37
- onClick={() => handleOptionClick(option)}
38
- backgroundColor={isHovered ? 'trueGray.100' : 'transparent'}
39
- {...props}
40
- >
41
- {option}
42
- </Element>
43
- );
44
- };
45
-
46
- const SelectBox: React.FC<SelectBoxProps> = ({
47
- size = 'md',
48
- styles = { field: {}, text: {} },
49
- selected,
50
- isDisabled,
51
- placeholder,
52
- removeOption = () => {},
53
- }) => {
54
- const fieldStyles = {
55
- margin: 0,
56
- width: '95%',
57
- heigth: '100%',
58
- border: 'none',
59
- paddingVertical: 8,
60
- paddingHorizontal: 0,
61
- fontSize: Typography.fontSizes[size],
62
- backgroundColor: 'transparent',
63
- color: isDisabled ? 'trueGray.600' : 'blueGray.700',
64
- cursor: isDisabled ? 'not-allowed' : 'auto',
65
- ...styles['field'],
66
- ...styles['text'],
67
- };
68
-
69
- return (
70
- <Text {...fieldStyles}>
71
- {(selected === '' || (selected && selected.length === 0)) && !!placeholder ? (
72
- placeholder
73
- ) : (
74
- <>
75
- {typeof selected === 'string'
76
- ? selected
77
- : selected &&
78
- selected.length > 0 && (
79
- <Horizontal gap={6}>
80
- {selected.map((option) => (
81
- <MultiSelect key={option} option={option} removeOption={removeOption} />
82
- ))}
83
- </Horizontal>
84
- )}
85
- </>
86
- )}
87
- </Text>
88
- );
89
- };
90
-
91
- const HiddenSelect: React.FC<HiddenSelectProps> = ({
92
- id,
93
- name,
94
- selected,
95
- onChange,
96
- isMulti = false,
97
- isDisabled = false,
98
- isReadOnly = false,
99
- options = [],
100
- ...props
101
- }) => {
102
- const handleChange = (event: any) => {
103
- if (onChange) onChange(event);
104
- };
105
- return (
106
- <Element
107
- id={id}
108
- name={name}
109
- as="select"
110
- opacity={0}
111
- width={0}
112
- height={0}
113
- position="absolute"
114
- value={selected}
115
- disabled={isDisabled}
116
- readOnly={isReadOnly}
117
- onChange={handleChange}
118
- multiple={isMulti}
119
- {...props}
120
- >
121
- {options.map((option) => {
122
- return (
123
- <option key={option} value={option}>
124
- {option}
125
- </option>
126
- );
127
- })}
128
- </Element>
129
- );
130
- };
131
-
132
- const DropDown: React.FC<DropDownProps> = ({ size, styles = { dropDown: {} }, options, callback = () => {} }) => {
133
- const itemStates = useItemState();
134
- const handleCallback = (option: string) => callback(option);
135
- const shadow =
136
- typeof document !== undefined
137
- ? {
138
- boxShadow:
139
- 'rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px',
140
- }
141
- : {
142
- elevation: 2,
143
- shadowColor: 'rgba(0, 0, 0, 0.07)',
144
- shadowOffset: {
145
- width: 0,
146
- height: 1,
147
- },
148
- shadowOpacity: 1,
149
- shadowRadius: 1,
150
- };
151
- return (
152
- <Element
153
- as="ul"
154
- role="dropdown"
155
- top="100%"
156
- width="100%"
157
- display="flex"
158
- zIndex={1000}
159
- overflowY="auto"
160
- marginTop={5}
161
- marginLeft={0}
162
- marginRight={0}
163
- marginBottom={0}
164
- padding={0}
165
- borderRadius={4}
166
- position="absolute"
167
- flexDirection="column"
168
- backgroundColor="white"
169
- justifyContent="space-evenly"
170
- {...shadow}
171
- {...styles['dropDown']}
172
- >
173
- {options.map((option) => (
174
- <Item key={option} size={size} option={option} callback={handleCallback} {...itemStates} {...styles['text']} />
175
- ))}
176
- </Element>
177
- );
178
- };
179
-
180
- export const MultiSelect: React.FC<MultiSelectProps> = ({ option, size = 'md', removeOption = () => {}, ...props }) => {
181
- const handleClick = () => removeOption(option);
182
-
183
- return (
184
- <Horizontal
185
- gap={10}
186
- padding={6}
187
- borderRadius={4}
188
- alignItems="center"
189
- fontSize={Typography.fontSizes[size]}
190
- backgroundColor="trueGray.300"
191
- onClick={(event: any) => event.stopPropagation()}
192
- {...props}
193
- >
194
- <Text size={size}>{option}</Text>
195
- <CloseSvg role="close-button" color="inherit" size={IconSizes[size]} onClick={handleClick} />
196
- </Horizontal>
197
- );
198
- };
199
-
200
- const SelectView: React.FC<SelectViewProps> = ({
201
- id,
202
- name,
203
- label,
204
- selected,
205
- placeholder,
206
- helperText,
207
- hide = false,
208
- error = false,
209
- isMulti = false,
210
- isFocused = false,
211
- isHovered = false,
212
- isDisabled = false,
213
- isReadOnly = false,
214
- options = [],
215
- shadow = {},
216
- size = 'md',
217
- colorScheme = 'theme.primary',
218
- shape = 'default',
219
- variant = 'default',
220
- styles = {
221
- text: {},
222
- icon: {},
223
- dropDown: {},
224
- selectBox: {},
225
- label: {},
226
- helperText: {},
227
- },
228
- onChange = () => {},
229
- setHide = () => {},
230
- setSelected = () => {},
231
- setIsHovered = () => {},
232
- setIsFocused = () => {},
233
- ...props
234
- }) => {
235
- const isWithLabel = !!(isFocused && label);
236
-
237
- const handleHover = () => setIsHovered(!isHovered);
238
- const handleFocus = () => setIsFocused(true);
239
-
240
- const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
241
- event.stopPropagation();
242
- setHide(!hide);
243
- setIsFocused(!isFocused);
244
- };
245
-
246
- const handleCallback = useCallback(
247
- (option: string) => {
248
- setHide(!hide);
249
- if (isMulti && Array.isArray(selected)) {
250
- !selected.includes(option) && setSelected([...selected, option]);
251
- } else {
252
- setSelected(option);
253
- }
254
- },
255
-
256
- [hide, isMulti, selected]
257
- );
258
-
259
- const handleRemoveOption = (selectedOption: string) => {
260
- if (Array.isArray(selected) && selected.includes(selectedOption)) {
261
- const newSelected = selected.filter((option) => option !== selectedOption);
262
- setSelected(newSelected.length === 0 ? [] : newSelected);
263
- }
264
- };
265
-
266
- return (
267
- <FieldContainer
268
- role="SelectBox"
269
- helperText={helperText}
270
- error={error}
271
- styles={styles}
272
- onClick={isDisabled || isReadOnly ? () => {} : handleClick}
273
- >
274
- <FieldContent
275
- label={label}
276
- size={size}
277
- error={error}
278
- shape={shape}
279
- styles={styles}
280
- shadow={shadow}
281
- variant={variant}
282
- value={selected}
283
- color={colorScheme}
284
- isHovered={isHovered}
285
- isDisabled={isDisabled}
286
- isReadOnly={isReadOnly}
287
- isFocused={isFocused}
288
- isWithLabel={isWithLabel}
289
- colorScheme={colorScheme}
290
- onMouseEnter={handleHover}
291
- onMouseLeave={handleHover}
292
- >
293
- <FieldWrapper>
294
- {isWithLabel && (
295
- <FieldLabel htmlFor={id} color={colorScheme} error={error} {...styles}>
296
- {label}
297
- </FieldLabel>
298
- )}
299
- <HiddenSelect
300
- id={id}
301
- name={name}
302
- options={options}
303
- onChange={onChange}
304
- selected={selected}
305
- isDisabled={isDisabled}
306
- isReadOnly={isReadOnly}
307
- isMulti={isMulti}
308
- onFocus={handleFocus}
309
- {...props}
310
- />
311
- <SelectBox
312
- size={size}
313
- styles={styles}
314
- selected={selected}
315
- isDisabled={isDisabled}
316
- placeholder={placeholder}
317
- removeOption={handleRemoveOption}
318
- />
319
- </FieldWrapper>
320
- <FieldIcons>
321
- {!isReadOnly && !isDisabled && (
322
- <>
323
- {hide ? (
324
- <ArrowDownSvg color="inherit" size={IconSizes[size]} style={styles.icon} />
325
- ) : (
326
- <ArrowUpSvg color="inherit" size={IconSizes[size]} style={styles.icon} />
327
- )}
328
- </>
329
- )}
330
- </FieldIcons>
331
- </FieldContent>
332
- {!hide && <DropDown size={size} styles={styles} options={options} callback={handleCallback} />}
333
- </FieldContainer>
334
- );
335
- };
336
-
337
- export default SelectView;
@@ -1,165 +0,0 @@
1
- ### **Import**
2
-
3
- ```tsx static
4
- import { Select } from "app-studio";
5
- ```
6
-
7
- ### **Default**
8
-
9
- ```tsx
10
- <Select label="Select an item" options={["Item1", "Item2", "Item3"]} />
11
- ```
12
-
13
- ### **Disabled**
14
-
15
- “**_isDisabled_**” makes the select field unclickable.
16
-
17
- ```tsx
18
- <Select isDisabled options={["Item1", "Item2", "Item3"]} />
19
- ```
20
-
21
- ### **IsReadOnly**
22
-
23
- “**_isReadOnly_**” makes the field readable but not writable. Can only read the element.
24
-
25
- ```tsx
26
- <Select options={["Item1", "Item2", "Item3"]} isReadOnly />
27
- ```
28
-
29
- ### **Sizes**
30
-
31
- “**_size_**” changes the text and icon size . It has a default value of “md”.
32
-
33
- ```tsx
34
- import { Vertical } from "../../Layout/Vertical/Vertical";
35
-
36
- const options = ["Item1", "Item2", "Item3"];
37
-
38
- <Vertical gap={10}>
39
- <Select name="xs" size="xs" placeholder="xs" options={options} />
40
- <Select name="sm" size="sm" placeholder="sm" options={options} />
41
- <Select name="md" size="md" placeholder="md" options={options} />
42
- <Select name="lg" size="lg" placeholder="lg" options={options} />
43
- <Select name="xl" size="xl" placeholder="xl" options={options} />
44
- </Vertical>;
45
- ```
46
-
47
- ### **ColorScheme**
48
-
49
- “**_colorScheme_**” modifies the border color of the select field.
50
-
51
- ```tsx
52
- import { Vertical } from "../../Layout/Vertical/Vertical";
53
-
54
- <Vertical gap={15}>
55
- {["theme.primary", "theme.secondary", "error", "success", "warning"].map((color) => (
56
- <Select
57
- key={color}
58
- options={["Item1", "Item2", "Item3"]}
59
- colorScheme={color}
60
- />
61
- ))}
62
- </Vertical>;
63
- ```
64
-
65
- ### **Shadow**
66
-
67
- “**_shadow_**” adds a shadow effect to the field.
68
-
69
- ```tsx
70
- <Select
71
- shadow={{
72
- boxShadow:
73
- "rgb(204, 219, 232) 3px 3px 6px 0px inset, rgba(255, 255, 255, 0.5) -3px -3px 6px 1px inset",
74
- }}
75
- options={["Item1", "Item2", "Item3"]}
76
- />
77
- ```
78
-
79
- ### **Multiple**
80
-
81
- “**_isMulti_**” indicates whether the select component allows the selection of multiple options.
82
-
83
- ```tsx
84
- <Select
85
- options={["Item1", "Item2", "Item3"]}
86
- placeholder="Select an item.."
87
- isMulti
88
- />
89
- ```
90
-
91
- ### **Error**
92
-
93
- “**error**” indicates whether the field has an error.
94
-
95
- ```tsx
96
- <Select options={["Item1", "Item2", "Item3"]} error />
97
- ```
98
-
99
- ### **HelperText**
100
-
101
- “**_helperText_**” provides additional information about the field.
102
-
103
- ```tsx
104
- <Select
105
- options={["Item1", "Item2", "Item3"]}
106
- helperText="select one item!"
107
- error
108
- />
109
- ```
110
-
111
- ### **Styles**
112
-
113
- “**_styles_**” changes the style of the select field.
114
-
115
- ```tsx
116
- <Select
117
- colorScheme="theme.primary"
118
- options={["Item1", "Item2", "Item3"]}
119
- styles={{
120
- selectBox: { borderRadius: 10, borderColor: 'theme.primary',
121
- borderStyle: 'solid',
122
- borderWidth: 1, },
123
- text: { color: "theme.primary" },
124
- label: { fontWeight: "bold", color: "theme.primary" },
125
- }}
126
- />
127
- ```
128
-
129
- ### **Default Value**
130
-
131
- ```tsx static
132
- const Sizes: Record<Size, CSSProperties> = {
133
- xs: { height: 6, width: 6 },
134
- sm: { height: 12, width: 12 },
135
- md: { height: 18, width: 18 },
136
- lg: { height: 24, width: 24 },
137
- xl: { height: 30, width: 30 },
138
- };
139
- ```
140
-
141
- ```tsx static
142
- const IconSizes: Record<Size, string> = {
143
- xs: "8px",
144
- sm: "10px",
145
- md: "12px",
146
- lg: "14px",
147
- xl: "16px",
148
- };
149
- ```
150
-
151
- ### Types
152
-
153
- ```tsx static
154
- type Size = "xs" | "sm" | "md" | "lg" | "xl";
155
- ```
156
-
157
- ```tsx static
158
- type SelectStyles = {
159
- box?: CSSProperties;
160
- text?: CSSProperties;
161
- label?: CSSProperties;
162
- helperText?: CSSProperties;
163
- field?: CSSProperties;
164
- };
165
- ```
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
-
3
- import { SelectProps } from './Select/Select.props';
4
- import { useSelectState } from './Select/Select.state';
5
- import SelectView from './Select/Select.view';
6
-
7
- const SelectComponent: React.FC<SelectProps> = (props) => {
8
- const selectStates = useSelectState(props);
9
- return <SelectView {...selectStates} {...props} />;
10
- };
11
-
12
- /**
13
- * Select provides a dropdown list of options for the user to choose from.
14
- */
15
-
16
- export const Select = SelectComponent;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { Vertical } from 'src/components/Layout/Vertical/examples';
3
-
4
- import { Select } from '../Select';
5
-
6
- export const ColorSelect = () => (
7
- <Vertical gap={15}>
8
- {['theme.primary', 'theme.secondary', 'theme.error', 'theme.success', 'theme.warning'].map((color) => (
9
- <Select key={color} options={['Item1', 'Item2', 'Item3']} colorScheme={color} />
10
- ))}
11
- </Vertical>
12
- );
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { Select } from 'src/components';
3
-
4
- export const DefaultSelect = () => <Select options={['Item1', 'Item2', 'Item3']} label="Select an item" />;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
-
3
- import { Select } from '../Select';
4
-
5
- export const DisabledSelect = () => <Select isDisabled options={['Item1', 'Item2', 'Item3']} />;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { Select } from 'src/components';
3
-
4
- export const ErrorSelect = () => <Select id="error" name="error" error options={['Item1', 'Item2', 'Item3']} />;
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import { Button } from 'src/components';
3
- import { Vertical } from 'src/components/Layout/Vertical/examples';
4
-
5
- import { Select } from '../Select';
6
-
7
- export const FormSelect = () => {
8
- const handleSubmit = (event: any) => {
9
- event.preventDefault();
10
- const formData = new FormData(event.target);
11
- alert(`You selected: ${formData.getAll('formItem')}`);
12
- };
13
- return (
14
- <form onSubmit={handleSubmit}>
15
- <Vertical gap={10} width="100%">
16
- <Select id="formItem" name="formItem" options={['Item1', 'Item2', 'Item3']} placeholder="Select an item..." />
17
- <Button type="submit" alignSelf="center">
18
- Submit
19
- </Button>
20
- </Vertical>
21
- </form>
22
- );
23
- };
@@ -1,41 +0,0 @@
1
- import React from 'react';
2
- import { Field, Form, Formik } from 'formik';
3
- import { Button } from 'src/components';
4
- import { Vertical } from 'src/components/Layout/Vertical/examples';
5
-
6
- import { Select } from '../Select';
7
-
8
- export const FormikSelect = () => {
9
- const options = ['Item1', 'Item2', 'Item3'];
10
- const initialValues = {
11
- formik: options[0],
12
- };
13
-
14
- const onSubmit = (values: any) => {
15
- alert(`${values.formik}`);
16
- };
17
-
18
- return (
19
- <Formik initialValues={initialValues} onSubmit={onSubmit}>
20
- {({ values, handleChange }) => (
21
- <Form>
22
- <Vertical gap={10}>
23
- <Field
24
- id="formik"
25
- name="formik"
26
- as={Select}
27
- value={values.formik}
28
- options={options}
29
- onChange={handleChange}
30
- placeholder="Select an item..."
31
- />
32
-
33
- <Button type="submit" alignSelf="center">
34
- Submit
35
- </Button>
36
- </Vertical>
37
- </Form>
38
- )}
39
- </Formik>
40
- );
41
- };
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
-
3
- import { Select } from '../Select';
4
-
5
- export const HelperTextSelect = () => (
6
- <Select options={['Item1', 'Item2', 'Item3']} helperText="select one item!" error />
7
- );
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { Select } from 'src/components';
3
-
4
- export const MultiSelect = () => (
5
- <Select options={['Item1', 'Item2', 'Item3']} placeholder="Select an item.." isMulti />
6
- );
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
-
3
- import { Select } from '../Select';
4
-
5
- export const ReadOnlySelect = () => <Select options={['Item1', 'Item2', 'Item3']} isReadOnly />;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { Select } from 'src/components';
3
-
4
- export const ShadowSelect = () => (
5
- <Select
6
- shadow={{
7
- boxShadow: 'rgb(204, 219, 232) 3px 3px 6px 0px inset, rgba(255, 255, 255, 0.5) -3px -3px 6px 1px inset',
8
- }}
9
- options={['Item1', 'Item2', 'Item3']}
10
- />
11
- );
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import { Vertical } from 'src/components/Layout/Vertical/examples';
3
-
4
- import { Select } from '../Select';
5
-
6
- export const SizeSelect = () => {
7
- const options = ['Item1', 'Item2', 'Item3'];
8
- return (
9
- <Vertical gap={10}>
10
- <Select name="sm" size="sm" placeholder="sm" options={options} />
11
- <Select name="md" size="md" placeholder="md" options={options} />
12
- <Select name="lg" size="lg" placeholder="lg" options={options} />
13
- <Select name="xl" size="xl" placeholder="xl" options={options} />
14
- </Vertical>
15
- );
16
- };
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
-
3
- import { Select } from '../Select';
4
-
5
- export const StyledSelect = () => (
6
- <Select
7
- colorScheme="theme.primary"
8
- options={['Item1', 'Item2', 'Item3']}
9
- styles={{
10
- selectBox: { borderRadius: 10, border: '1px solid purple' },
11
- text: { color: 'theme.primary' },
12
- label: { fontWeight: 'bold', color: 'theme.primary' },
13
- }}
14
- />
15
- );