@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,187 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- import { Elevation } from 'src/utils/elevation';
3
- import { Shadow } from 'app-studio';
4
-
5
- import { Country, CountryPickerStyles, Shape, Size, Variant } from './CountryPicker.type';
6
-
7
- export interface CountryPickerProps {
8
- /**
9
- * The identifier for the CountryPicker component.
10
- */
11
- id?: string;
12
- /**
13
- * Indicates whether the field has an error.
14
- */
15
- error?: boolean;
16
- /**
17
- * The name of the field.
18
- */
19
- name?: string;
20
- /**
21
- * The label text for the field.
22
- */
23
- label?: string;
24
- /**
25
- * The color scheme that changes the border color on hover of the field.
26
- */
27
- colorScheme?: string;
28
- /**
29
- * Additional helper text that provides information about the field.
30
- */
31
- helperText?: string;
32
- /**
33
- * A brief text or hint that appears in the field before the user enters any value.
34
- */
35
- placeholder?: string;
36
- /**
37
- * The shape that changes the outlines of the CountryPicker.
38
- */
39
- shape?: Shape;
40
- /**
41
- * If true, the field will be automatically focused.
42
- */
43
- isAutoFocus?: boolean;
44
- /**
45
- * If true, the CountryPicker cannot be edited.
46
- */
47
- isReadOnly?: boolean;
48
- /**
49
- * If true, the field will be unusable.
50
- */
51
- isDisabled?: boolean;
52
- /**
53
- * Callback function triggered when the CountryPicker loses focus.
54
- */
55
- onBlur?: (value: any) => void;
56
- /**
57
- * Callback function triggered when the field value changes.
58
- */
59
- onChange?: (value: any) => void;
60
- /**
61
- * CSS styles for the CountryPicker component.
62
- */
63
- styles?: CountryPickerStyles;
64
- /**
65
- * The font size of the CountryPicker.
66
- */
67
- size?: Size;
68
- /**
69
- * The default value of the input field.
70
- */
71
- value?: string | number;
72
- /**
73
- * Changes the style of the input field.
74
- */
75
- variant?: Variant;
76
- /**
77
- * Adds a shadow effect to the CountryPicker.
78
- */
79
- shadow?: Shadow | Elevation | CSSProperties;
80
- /**
81
- * Other properties that can be passed to the component.
82
- */
83
- [x: string]: any;
84
- }
85
-
86
- export interface CountryPickerViewProps extends CountryPickerProps {
87
- /**
88
- * Indicates whether the country picker is currently being hovered.
89
- */
90
- isHovered?: boolean;
91
-
92
- /**
93
- * A function to set the hovered state of the country picker.
94
- * @param hovered - The hovered state to set.
95
- */
96
- setIsHovered?: (hovered: boolean) => void;
97
-
98
- /**
99
- * Indicates whether the country picker is focused.
100
- */
101
- isFocused?: boolean;
102
-
103
- /**
104
- * A function to set the focus state of the country picker.
105
- * @param focused - The focus state to set.
106
- */
107
- setIsFocused?: (focused: boolean) => void;
108
-
109
- /**
110
- * Indicates the currently selected country.
111
- */
112
- selected?: string;
113
-
114
- /**
115
- * A function to set the selected country.
116
- * @param selected - The selected country to set.
117
- */
118
- setSelected?: (selected: string) => void;
119
-
120
- /**
121
- * Indicates whether the country picker should be hidden.
122
- */
123
- hide?: boolean;
124
-
125
- /**
126
- * A function to set the hide state of the country picker.
127
- * @param hide - The hide state to set.
128
- */
129
- setHide?: (hide: boolean) => void;
130
-
131
- /**
132
- * Options for the country picker.
133
- */
134
- newOptions?: Array<Country>;
135
-
136
- /**
137
- * A function to set the new options for the country picker.
138
- * @param newOptions - The new options to set.
139
- */
140
- setNewOptions?: (newOptions: Array<Country>) => void;
141
- }
142
-
143
- export interface DropDownProps {
144
- /**
145
- * To set the height and width of the item list.
146
- */
147
- size?: Size;
148
- /**
149
- * Function that will be called when the option is CountryPickered
150
- */
151
- callback?: Function;
152
- /**
153
- * List of options
154
- */
155
- options: Array<Country>;
156
- /**
157
- * Css styles for the CountryPicker container and label
158
- */
159
- styles?: CountryPickerStyles;
160
- /**
161
- * other properties
162
- */
163
- [x: string]: any;
164
- }
165
-
166
- export interface DropDownItemProps {
167
- /**
168
- * Function that will be called when the option is clicked
169
- */
170
- callback?: Function;
171
- /**
172
- * Option to be displayed
173
- */
174
- option: string;
175
- /**
176
- * To set the DropDownItem's fontSize
177
- */
178
- size?: Size;
179
- /**
180
- * Css styles
181
- */
182
- styles?: CountryPickerStyles;
183
- /**
184
- * other properties
185
- */
186
- [x: string]: any;
187
- }
@@ -1,28 +0,0 @@
1
- import React from 'react';
2
-
3
- import countryList from '../countries.json';
4
-
5
- import { CountryPickerProps } from './CountryPicker.props';
6
- import { Country } from './CountryPicker.type';
7
-
8
- export const useCountryPickerState = ({ placeholder }: CountryPickerProps) => {
9
- const [newOptions, setNewOptions] = React.useState<Array<Country>>(countryList);
10
- const [selected, setSelected] = React.useState<string>(placeholder ?? countryList[0].name);
11
-
12
- const [hide, setHide] = React.useState(true);
13
- const [isFocused, setIsFocused] = React.useState(false);
14
- const [isHovered, setIsHovered] = React.useState(false);
15
-
16
- return {
17
- hide,
18
- setHide,
19
- newOptions,
20
- setNewOptions,
21
- isHovered,
22
- setIsHovered,
23
- isFocused,
24
- setIsFocused,
25
- selected,
26
- setSelected,
27
- };
28
- };
@@ -1,17 +0,0 @@
1
- import { Size } from './CountryPicker.type';
2
-
3
- export const IconSizes: Record<Size, number> = {
4
- xs: 8,
5
- sm: 10,
6
- md: 12,
7
- lg: 14,
8
- xl: 16,
9
- };
10
-
11
- export const LabelSizes: Record<Size, number> = {
12
- xs: 8,
13
- sm: 10,
14
- md: 12,
15
- lg: 14,
16
- xl: 16,
17
- };
@@ -1,22 +0,0 @@
1
- export type CountryPickerStyles = {
2
- text?: CSSProperties;
3
- icon?: CSSProperties;
4
- dropDown?: CSSProperties;
5
- box?: CSSProperties;
6
- label?: CSSProperties;
7
- helperText?: CSSProperties;
8
- field?: CSSProperties;
9
- };
10
-
11
- export type Country = {
12
- name: string;
13
- dial_code: string;
14
- emoji: string;
15
- code: string;
16
- };
17
-
18
- export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
19
-
20
- export type Shape = 'default' | 'sharp' | 'rounded' | 'pillShaped';
21
-
22
- export type Variant = 'default' | 'outline' | 'unStyled';
@@ -1,234 +0,0 @@
1
- import React, { useEffect, useState } from 'react';
2
- import { Element, Input, Typography, useTheme } from 'app-studio';
3
- import { FieldContainer, FieldContent, FieldIcons, FieldLabel, FieldWrapper } from 'src/components/Layout/Input';
4
- import { ArrowDownSvg } from 'src/components/Svg/ArrowDown';
5
- import { ArrowUpSvg } from 'src/components/Svg/ArrowUp';
6
-
7
- import countryList from '../countries.json';
8
-
9
- import { CountryPickerViewProps, DropDownItemProps, DropDownProps } from './CountryPicker.props';
10
- import { IconSizes } from './CountryPicker.style';
11
- import { Country } from './CountryPicker.type';
12
-
13
- const CountryList: React.FC<DropDownProps> = (props) => <Element as="ul" {...props} />;
14
-
15
- const CountrySelector: React.FC<any> = (props) => <Input type="country" {...props} />;
16
-
17
- const CountryItem: React.FC<DropDownItemProps> = (props) => <Element as="li" {...props} />;
18
-
19
- export const DropDownItem: React.FC<DropDownItemProps> = ({
20
- option,
21
- size = 'md',
22
- callback = () => {},
23
- styles = { text: {} },
24
- }) => {
25
- const [isHovered, setIsHovered] = useState(false);
26
-
27
- const handleOptionClick = (event: any) => {
28
- event.stopPropagation();
29
- callback(option);
30
- };
31
- const handleHover = () => setIsHovered(!isHovered);
32
- return (
33
- <CountryItem
34
- margin={0}
35
- role="DropDownItem"
36
- listStyleType="none"
37
- paddingVertical={6}
38
- paddingHorizontal={12}
39
- onMouseEnter={handleHover}
40
- onMouseLeave={handleHover}
41
- onClick={handleOptionClick}
42
- fontSize={Typography.fontSizes[size]}
43
- backgroundColor={isHovered ? 'trueGray.100' : 'transparent'}
44
- {...styles['text']}
45
- >
46
- {option}
47
- </CountryItem>
48
- );
49
- };
50
-
51
- export const DropDown: React.FC<DropDownProps> = ({
52
- size,
53
- styles = { dropDown: {} },
54
- options,
55
- callback = () => {},
56
- }) => {
57
- const handleCallback = (option: string) => callback(option);
58
- return (
59
- <CountryList
60
- role="dropDown"
61
- margin={0}
62
- padding={0}
63
- top="100%"
64
- width="100%"
65
- display="flex"
66
- zIndex={1000}
67
- overflow="auto"
68
- maxHeight="300px"
69
- borderRadius={4}
70
- position="absolute"
71
- flexDirection="column"
72
- backgroundColor="white"
73
- boxShadow="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"
74
- {...styles['dropDown']}
75
- >
76
- {options.map((option: Country) => (
77
- <DropDownItem
78
- key={option.code}
79
- size={size}
80
- option={option.name}
81
- callback={handleCallback}
82
- {...styles['text']}
83
- />
84
- ))}
85
- </CountryList>
86
- );
87
- };
88
-
89
- const CountryPickerView: React.FC<CountryPickerViewProps> = ({
90
- id,
91
- name,
92
- label,
93
- selected,
94
- placeholder,
95
- helperText,
96
- hide = false,
97
- error = false,
98
- isHovered = false,
99
- isFocused = false,
100
- isAutoFocus = false,
101
- isDisabled = false,
102
- isReadOnly = false,
103
- shadow = {},
104
- newOptions = [],
105
- size = 'md',
106
- variant = 'default',
107
- shape = 'default',
108
- colorScheme = 'theme.primary',
109
- onChange,
110
- onBlur = () => {},
111
- setHide = () => {},
112
- setNewOptions = () => {},
113
- setIsHovered = () => {},
114
- setIsFocused = () => {},
115
- setSelected = () => {},
116
- styles = {
117
- text: {},
118
- icon: {},
119
- label: {},
120
- dropDown: {},
121
- helperText: {},
122
- box: {},
123
- },
124
- ...props
125
- }) => {
126
- const { getColor } = useTheme();
127
- const IconColor = getColor('color.blueGray.700');
128
-
129
- const handleHover = () => setIsHovered(!isHovered);
130
- const handleFocus = () => setIsFocused(true);
131
-
132
- const handleCallback = (option: string) => {
133
- setHide(!hide);
134
- setSelected(option);
135
- };
136
-
137
- const handleClick = () => {
138
- if (!isDisabled && !isReadOnly) {
139
- setHide(!hide);
140
- }
141
- };
142
- const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
143
- const selectedCountry = event.target.value;
144
- const filteredCountries = countryList.filter((country) =>
145
- country.name.toLowerCase().startsWith(selectedCountry.toLowerCase())
146
- );
147
- if (hide) setHide(false);
148
- setSelected(event.target.value);
149
- setNewOptions(filteredCountries);
150
- if (onChange) onChange(event);
151
- };
152
-
153
- const handleBlur = (event: any) => {
154
- onBlur(event);
155
- setIsFocused(false);
156
- };
157
-
158
- useEffect(() => {
159
- if (onChange) onChange(selected); // Call onChange when selectedCountry changes
160
- }, [onChange, selected]);
161
-
162
- const isWithLabel = !!(isFocused && label);
163
-
164
- const fieldStyles = {
165
- margin: 0,
166
- paddingVerical: 8,
167
- paddingHorizonatl: 0,
168
- width: '100%',
169
- heigth: '100%',
170
- border: 'none',
171
- on: { focus: { outline: 'none' } },
172
- fontSize: Typography.fontSizes[size],
173
- backgroundColor: 'transparent',
174
- color: isDisabled ? 'color.trueGray.600' : 'color.blueGray.700',
175
- cursor: isDisabled ? 'not-allowed' : 'auto',
176
- ...styles['field'],
177
- };
178
-
179
- return (
180
- <FieldContainer helperText={helperText} error={error} styles={styles} onClick={handleClick}>
181
- <FieldContent
182
- label={label}
183
- size={size}
184
- error={error}
185
- shape={shape}
186
- styles={styles}
187
- shadow={shadow}
188
- variant={variant}
189
- value={selected}
190
- color={colorScheme}
191
- isHovered={isHovered}
192
- isDisabled={isDisabled}
193
- isReadOnly={isReadOnly}
194
- isFocused={isFocused}
195
- isWithLabel={isWithLabel}
196
- colorScheme={colorScheme}
197
- onMouseEnter={handleHover}
198
- onMouseLeave={handleHover}
199
- >
200
- <FieldWrapper>
201
- {isWithLabel && (
202
- <FieldLabel htmlFor={id} color={colorScheme} error={error} {...styles}>
203
- {label}
204
- </FieldLabel>
205
- )}
206
- <CountrySelector
207
- id={id}
208
- name={name}
209
- placeholder={placeholder}
210
- readOnly={isReadOnly}
211
- disabled={isDisabled}
212
- autoFocus={isAutoFocus}
213
- onBlur={handleBlur}
214
- onFocus={handleFocus}
215
- {...fieldStyles}
216
- {...props}
217
- value={selected}
218
- onChange={handleChange}
219
- />
220
- </FieldWrapper>
221
- <FieldIcons>
222
- {hide ? (
223
- <ArrowDownSvg size={IconSizes[size]} color={IconColor} style={styles['icon']} />
224
- ) : (
225
- <ArrowUpSvg size={IconSizes[size]} color={IconColor} style={styles['icon']} />
226
- )}
227
- </FieldIcons>
228
- </FieldContent>
229
- {!hide && <DropDown size={size} styles={styles} options={newOptions} callback={handleCallback} />}
230
- </FieldContainer>
231
- );
232
- };
233
-
234
- export default CountryPickerView;
@@ -1,206 +0,0 @@
1
- ### **Import**
2
-
3
- ```jsx static
4
- import { CountryPicker } from "app-studio";
5
- ```
6
-
7
- ### **Default**
8
-
9
- ```jsx
10
- <CountryPicker label="Country" placeholder="Select a country..." />
11
- ```
12
-
13
- ### **Disabled**
14
-
15
- “**_isDisabled_**” makes the field unusable.
16
-
17
- ```tsx
18
- <CountryPicker isDisabled />
19
- ```
20
-
21
- ### **Read Only**
22
-
23
- “**_isReadOnly_**” makes the field readable but not writable. Can only read the element.
24
-
25
- ```tsx
26
- <CountryPicker isReadOnly />
27
- ```
28
-
29
- ### **Size**
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
- <Vertical gap={10}>
37
- <CountryPicker name="xs" size="xs" label="xs" />
38
- <CountryPicker name="sm" size="sm" label="sm" />
39
- <CountryPicker name="md" size="md" label="md" />
40
- <CountryPicker name="lg" size="lg" label="lg" />
41
- <CountryPicker name="xl" size="xl" label="xl" />
42
- </Vertical>;
43
- ```
44
-
45
- ### **Shape**
46
-
47
- “**_shape_**” changes the appearance of the borders.
48
-
49
- ```tsx
50
- import { Vertical } from "../../Layout/Vertical/Vertical";
51
-
52
- <Vertical gap={10}>
53
- {["default", "sharp", "rounded", "pillShaped"].map((shape) => (
54
- <CountryPicker
55
- key={shape}
56
- shape={shape}
57
- placeholder="Select a country..."
58
- />
59
- ))}
60
- </Vertical>;
61
- ```
62
-
63
- ### **Variant**
64
-
65
- “**_variant_**” modifies the layout or design of the component.
66
-
67
- ```tsx
68
- import { Vertical } from "../../Layout/Vertical/Vertical";
69
-
70
- <Vertical gap={10}>
71
- {["outline", "default", "unStyled"].map((variant) => (
72
- <CountryPicker
73
- key={variant}
74
- variant={variant}
75
- label={variant}
76
- placeholder="Select a country..."
77
- />
78
- ))}
79
- </Vertical>;
80
- ```
81
-
82
- ### **ColorScheme**
83
-
84
- “**_colorScheme_**” modifies the label and border color of the field.
85
-
86
- ```jsx
87
- import { Vertical } from "../../Layout/Vertical/Vertical";
88
-
89
- <Vertical gap={15}>
90
- {["theme.primary", "theme.secondary", "theme.error", "theme.success", "theme.warning"].map((color) => (
91
- <CountryPicker key={color} label={color} colorScheme={color} />
92
- ))}
93
- </Vertical>;
94
- ```
95
-
96
- ### **Shadow**
97
-
98
- “**_shadow_**” adds a shadow effect to the field.
99
-
100
- ```tsx
101
- <CountryPicker shadow={{ boxShadow: "rgba(0, 0, 0, 0.20) 0px 3px 8px" }} />
102
- ```
103
-
104
- ### **HelperText**
105
-
106
- “**_helperText_**” provides additional information about the field.
107
-
108
- ```tsx
109
- <CountryPicker helperText="CountryPicker one item!" error />
110
- ```
111
-
112
- ### **Styles**
113
-
114
- “**_styles_**” changes the style of the field.
115
-
116
- ```jsx
117
- <CountryPicker
118
- styles={{
119
- box: {
120
- borderRadius: 10,
121
- borderColor: 'theme.primary',
122
- borderStyle: 'solid',
123
- borderWidth: 1
124
- },
125
- text: { color: "theme.primary" },
126
- label: { fontWeight: "bold", color: "theme.primary" },
127
- dropDown: { color: "theme.primary" },
128
- }}
129
- error
130
- />
131
- ```
132
-
133
- ```jsx static
134
- const Shapes: Record<Shape, number | string> = {
135
- default: "6px 6px 0 0",
136
- sharp: 0,
137
- rounded: 4,
138
- pillShaped: 24,
139
- };
140
- ```
141
-
142
- ## Types
143
-
144
- ```tsx static
145
- type Size = "xs" | "sm" | "md" | "lg" | "xl";
146
- ```
147
-
148
- ```jsx static
149
- type CountryPickerStyles = {
150
- text?: CSSProperties,
151
- icon?: CSSProperties,
152
- dropDown?: CSSProperties,
153
- box?: CSSProperties,
154
- label?: CSSProperties,
155
- helperText?: CSSProperties,
156
- };
157
- ```
158
-
159
- ```jsx static
160
- type Shape = "default" | "sharp" | "rounded" | "pillShaped";
161
- ```
162
-
163
- ```jsx static
164
- type Country = {
165
- name: string,
166
- dial_code: string,
167
- emoji: string,
168
- code: string,
169
- };
170
- ```
171
-
172
- ```js static
173
- type Variant = "default" | "outline" | "unStyled";
174
- ```
175
-
176
- ```jsx static
177
- type Styles = {
178
- box?: CSSProperties,
179
- text?: CSSProperties,
180
- label?: CSSProperties,
181
- helperText?: CSSProperties,
182
- field?: CSSProperties,ssss
183
- };
184
- ```
185
-
186
- ## Default Values
187
-
188
- ```jsx static
189
- const LabelSizes: Record<Size, number> = {
190
- xs: 8,
191
- sm: 10,
192
- md: 12,
193
- lg: 14,
194
- xl: 16,
195
- };
196
- ```
197
-
198
- ```jsx static
199
- const IconSizes: Record<Size, string> = {
200
- xs: "8px",
201
- sm: "10px",
202
- md: "12px",
203
- lg: "14px",
204
- xl: "16px",
205
- };
206
- ```
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
-
3
- import { CountryPickerProps } from './CountryPicker/CountryPicker.props';
4
- import { useCountryPickerState } from './CountryPicker/CountryPicker.state';
5
- import CountryPickerView from './CountryPicker/CountryPicker.view';
6
-
7
- const CountryPickerComponent: React.FC<CountryPickerProps> = (props) => {
8
- const countryPickerStates = useCountryPickerState(props);
9
-
10
- return <CountryPickerView {...countryPickerStates} {...props} />;
11
- };
12
-
13
- /**
14
- * Country picker allows users to select a country from a dropdown list or search field.
15
- */
16
- export const CountryPicker = CountryPickerComponent;