@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
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@app-studio/web",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "files": [
7
- "dist",
8
- "src/components"
7
+ "dist"
9
8
  ],
10
9
  "dependencies": {
11
10
  "app-studio": "^0.1.16",
@@ -1,79 +0,0 @@
1
- import React, { CSSProperties } from 'react';
2
- import { Shadow } from 'app-studio';
3
- import { Elevation } from 'src/utils/elevation';
4
-
5
- import { IconPosition, Shape, Size, Variant } from './Button.type';
6
-
7
- /**
8
- * Represents the properties for the Button component.
9
- */
10
- export interface ButtonProps {
11
- /**
12
- * The content to be rendered inside the button.
13
- */
14
- children?: React.ReactNode;
15
- /**
16
- * Sets the background color of the button.
17
- */
18
- colorScheme?: string;
19
- /**
20
- * Specifies the external URL used when the variant is set to "link".
21
- */
22
- externalHref?: string;
23
- /**
24
- * Indicates whether the button is in a loading state.
25
- */
26
- isLoading?: boolean;
27
- /**
28
- * The icon component rendered within the button.
29
- */
30
- icon?: React.ReactNode;
31
- /**
32
- * Specifies the position of the icon within the button.
33
- */
34
- iconPosition?: IconPosition;
35
- /**
36
- * Disables the button if set to true.
37
- */
38
- isDisabled?: boolean;
39
- /**
40
- * Adjusts the width of the button to take available space.
41
- */
42
- isFilled?: boolean;
43
- /**
44
- * Adjusts the width of the button based on content size.
45
- */
46
- isAuto?: boolean;
47
- /**
48
- * Makes the icon container shape rounded if set to true.
49
- */
50
- isIconRounded?: boolean;
51
- /**
52
- * The event handler called when the button is clicked or pressed.
53
- */
54
- onClick?: Function;
55
- /**
56
- * Specifies the size of the button's text and padding.
57
- */
58
- size?: Size;
59
- /**
60
- * Sets a shadow effect applied to the button.
61
- */
62
- shadow?: Shadow | Elevation | CSSProperties;
63
- /**
64
- * Specifies the shape of the button's corners.
65
- */
66
- shape?: Shape;
67
- /**
68
- * Descriptive label for accessibility (ARIA) purposes.
69
- */
70
- ariaLabel?: string;
71
- /**
72
- * Specifies the style variant of the button.
73
- */
74
- variant?: Variant;
75
- /**
76
- * Additional properties for the button component.
77
- */
78
- [x: string]: any;
79
- }
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
-
3
- export const useButtonState = () => {
4
- const [isHovered, setIsHovered] = React.useState(false);
5
-
6
- return { isHovered, setIsHovered };
7
- };
@@ -1,95 +0,0 @@
1
- import { CSSProperties } from 'react';
2
-
3
- import { Shape, Size } from './Button.type';
4
-
5
- export const ButtonSizes: Record<Size, CSSProperties> = {
6
- xs: {
7
- width: 79,
8
- paddingTop: 8,
9
- paddingBottom: 8,
10
- paddingLeft: 12,
11
- paddingRight: 12,
12
- fontWeight: 600,
13
- fontSize: 'xs',
14
- lineHeight: 16,
15
- letterSpacing: 1.25,
16
- },
17
- sm: {
18
- width: 128,
19
- paddingTop: 10,
20
- paddingBottom: 10,
21
- paddingLeft: 16,
22
- paddingRight: 16,
23
- fontWeight: 600,
24
- fontSize: 'sm',
25
- lineHeight: 20,
26
- letterSpacing: 1.25,
27
- },
28
- md: {
29
- width: 144,
30
- paddingTop: 12,
31
- paddingBottom: 12,
32
- paddingLeft: 18,
33
- paddingRight: 18,
34
- fontWeight: 600,
35
- fontSize: 'md',
36
- lineHeight: 24,
37
- letterSpacing: 1.25,
38
- },
39
- lg: {
40
- width: 178,
41
- paddingTop: 14,
42
- paddingBottom: 14,
43
- paddingLeft: 22,
44
- paddingRight: 22,
45
- fontWeight: 600,
46
- fontSize: 'lg',
47
- lineHeight: 24,
48
- letterSpacing: 1.25,
49
- },
50
- xl: {
51
- width: 220,
52
- paddingTop: 16,
53
- paddingBottom: 16,
54
- paddingLeft: 26,
55
- paddingRight: 26,
56
- fontWeight: 600,
57
- fontSize: 'xl',
58
- lineHeight: 24,
59
- letterSpacing: 1.25,
60
- },
61
- };
62
-
63
- export const ButtonShapes: Record<Shape, number | string> = {
64
- sharp: 0,
65
- rounded: 4,
66
- pillShaped: 24,
67
- };
68
-
69
- export const IconSizes: Record<Size, CSSProperties> = {
70
- xs: {
71
- width: 24,
72
- height: 24,
73
- padding: 12,
74
- },
75
- sm: {
76
- width: 24,
77
- height: 24,
78
- padding: 15,
79
- },
80
- md: {
81
- width: 36,
82
- height: 36,
83
- padding: 15,
84
- },
85
- lg: {
86
- width: 36,
87
- height: 36,
88
- padding: 18,
89
- },
90
- xl: {
91
- width: 36,
92
- height: 36,
93
- padding: 24,
94
- },
95
- };
@@ -1,11 +0,0 @@
1
- export type BorderWeights = 'light' | 'normal' | 'bold' | 'extrabold' | 'black';
2
-
3
- export type Shape = 'sharp' | 'rounded' | 'pillShaped';
4
-
5
- export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
-
7
- export type Loaders = 'spinner' | 'points' | 'points-opacity';
8
-
9
- export type IconPosition = 'left' | 'right';
10
-
11
- export type Variant = 'filled' | 'outline' | 'link' | 'ghost';
@@ -1,113 +0,0 @@
1
- import React, { CSSProperties } from 'react';
2
- import { Element } from 'app-studio';
3
- import { Link } from 'src/components';
4
-
5
- import { ButtonProps } from './Button.props';
6
- import { ButtonShapes, ButtonSizes, IconSizes } from './Button.style';
7
- import { Variant } from './Button.type';
8
-
9
- const ButtonView: React.FC<ButtonProps> = ({
10
- icon,
11
- shadow,
12
- children,
13
- ariaLabel,
14
- externalHref,
15
- isAuto = false,
16
- isFilled = false,
17
- isIconRounded = false,
18
- isLoading = false,
19
- isDisabled = false,
20
- size = 'md',
21
- variant = 'filled',
22
- iconPosition = 'left',
23
- colorScheme = 'theme.primary',
24
- shape = 'rounded',
25
- onClick = () => {},
26
- ...props
27
- }) => {
28
- const isActive = !(isDisabled || isLoading);
29
-
30
- const defaultNativeProps = { disabled: !isActive };
31
-
32
- const buttonColor = isActive ? colorScheme : 'theme.disabled';
33
-
34
- const ButtonVariants: Record<Variant, CSSProperties> = {
35
- filled: {
36
- backgroundColor: buttonColor,
37
- color: 'color.white',
38
- },
39
- outline: {
40
- backgroundColor: 'transparent',
41
- borderWidth: 1,
42
- borderStyle: 'solid',
43
- borderColor: colorScheme,
44
- color: buttonColor,
45
- },
46
- link: {
47
- backgroundColor: 'transparent',
48
- border: 'none',
49
- color: buttonColor,
50
- textDecorationLine: 'underline',
51
- },
52
- ghost: {
53
- backgroundColor: 'transparent',
54
- border: 'none',
55
- color: buttonColor,
56
- },
57
- };
58
-
59
- const buttonSizeStyles = ButtonSizes[size];
60
-
61
- const buttonVariant = ButtonVariants[variant];
62
-
63
- const scaleWidth = {
64
- width: isAuto ? 'fit-content' : isFilled ? '100%' : buttonSizeStyles.width,
65
- };
66
-
67
- const changePadding = {
68
- padding: isIconRounded ? IconSizes[size].padding : ButtonSizes[size].padding,
69
- };
70
-
71
- const content = (
72
- <>
73
- {icon && iconPosition === 'left' && !isLoading && icon}
74
- {children}
75
- {icon && iconPosition === 'right' && !isLoading && icon}
76
- </>
77
- );
78
-
79
- return (
80
- <Element
81
- gap={8}
82
- as="button"
83
- role="button"
84
- border="none"
85
- color="color.white"
86
- display="flex"
87
- alignItems="center"
88
- justifyContent="center"
89
- ariaLabel={ariaLabel}
90
- backgroundColor={buttonColor}
91
- borderRadius={ButtonShapes[shape]}
92
- onClick={props.onClick ?? onClick}
93
- cursor={isActive ? 'pointer' : 'default'}
94
- {...defaultNativeProps} // set default native html button properties
95
- {...buttonSizeStyles} // set default width, paddings and fonts
96
- {...buttonVariant} // changes default background color, color and border
97
- {...scaleWidth} //changes the actual fixed width when isAuto or isFilled are true
98
- {...changePadding} // changes the actual padding when variant equals to circled
99
- {...shadow}
100
- {...props}
101
- >
102
- {variant === 'link' && externalHref ? (
103
- <Link href={externalHref} textDecorationColor={colorScheme} colorScheme={colorScheme} isExternal>
104
- {content}
105
- </Link>
106
- ) : (
107
- content
108
- )}
109
- </Element>
110
- );
111
- };
112
-
113
- export default ButtonView;
@@ -1,165 +0,0 @@
1
- ### **Import**
2
-
3
- ```tsx static
4
- import { Button } from 'app-studio';
5
- ```
6
-
7
- ### **Default**
8
-
9
- ```tsx
10
- import { Center } from '../Layout/Center/Center';
11
-
12
- <Center width="100%">
13
- <Button>Push Me</Button>
14
- </Center>;
15
- ```
16
-
17
- ### **Disabled**
18
-
19
- “isDisabled” makes the button unusable and un-clickable with a “disabled” look.
20
-
21
- ```tsx
22
- import { Center } from '../Layout/Center/Center';
23
- <Center width="100%">
24
- <Button isDisabled>Disabled</Button>
25
- </Center>;
26
- ```
27
-
28
- ### **Size**
29
-
30
- “size” alters the padding, text size, and border of the button. This attribute belongs to the "Sizes" type and has a default value of "md".
31
-
32
- ```jsx
33
- import { Vertical } from '../Layout/Vertical/Vertical';
34
-
35
- <Vertical gap={10}>
36
- {['xs', 'sm', 'md', 'lg', 'xl'].map((size, index) => (
37
- <Button key={index} size={size}>
38
- {size}
39
- </Button>
40
- ))}
41
- <Button isAuto>Auto Width</Button>
42
- <Button isFilled>Full Width</Button>
43
- </Vertical>;
44
- ```
45
-
46
- ### **ColorScheme**
47
-
48
- “colorScheme” allows you to modify the background color of the button. It accepts a value from the "ColorThemes" type, with the default color set to "theme.primary".
49
-
50
- ```tsx
51
- import { Horizontal } from '../Layout/Horizontal/Horizontal';
52
-
53
- <Horizontal justify="space-evenly" gap={10}>
54
- {['theme.primary', 'theme.secondary', 'theme.warning', 'theme.success', 'theme.error'].map((color, index) => (
55
- <Button key={index} colorScheme={color} isAuto>
56
- {color}
57
- </Button>
58
- ))}
59
- </Horizontal>;
60
- ```
61
-
62
- ### **Shadow**
63
-
64
- "shadow" attribute applies a shadow effect to the button.
65
-
66
- ```tsx
67
- import { Center } from '../Layout/Center/Center';
68
- <Center width="100%">
69
- <Button shadow={{ boxShadow: 'rgb(249, 115, 22) 0px 4px 14px 0px' }}>Click Me</Button>
70
- </Center>;
71
- ```
72
-
73
- ### **Loading**
74
-
75
- "isLoading" and "loading" attributes display a loading animation, which indicates that an action is in progress.
76
-
77
- ```tsx
78
- import { Loading } from '../Loader/Loader';
79
- import { Text } from '../Text/Text';
80
- import { Center } from '../Layout/Center/Center';
81
-
82
- <Center width="100%">
83
- <Button isLoading>
84
- <Loading loaderColor="white" />
85
- <Text size="sm">Submitting</Text>
86
- </Button>
87
- </Center>;
88
- ```
89
-
90
- ### **Variant**
91
-
92
- "variant" allows for the customization of the button's styles. The attribute belongs to the "Variants" type and has a default variant of "filled".
93
-
94
- ```tsx
95
- import { Horizontal } from '../Layout/Horizontal/Horizontal';
96
-
97
- <Horizontal justify="space-evenly" gap={10}>
98
- {['filled', 'outline', 'link', 'ghost'].map((variant, index) => (
99
- <Button key={index} variant={variant} colorScheme="theme.primary" isAuto>
100
- {variant}
101
- </Button>
102
- ))}
103
- </Horizontal>;
104
- ```
105
-
106
- ### **Shape**
107
-
108
- “shape” property changes the edges of the button. This property belongs to the "Shapes" type and has a default value of "rounded".
109
-
110
- ```tsx
111
- import { Horizontal } from '../Layout/Horizontal/Horizontal';
112
-
113
- <Horizontal justify="space-evenly" wrap="nowrap" gap={10}>
114
- {['sharp', 'rounded', 'pillShaped'].map((border, index) => (
115
- <Button key={index} shape={border} isAuto>
116
- {border}
117
- </Button>
118
- ))}
119
- </Horizontal>;
120
- ```
121
-
122
- ### **Icon**
123
-
124
- “icon” provides the flexibility to incorporate any desired icon within the button.
125
-
126
- ```tsx
127
- import { Center } from '../Layout/Center/Center';
128
- import { DustBinSvg } from '../Svg/DustBin';
129
-
130
- <Center justifyContent="space-evenly">
131
- <Button icon={<BsBucket size={24} />} height={48}>
132
- Delete
133
- </Button>
134
- <Button height={48} icon={<DustBinSvg size={24} />} shape={'pillShaped'} iconPosition="right" colorScheme="theme.secondary">
135
- Delete
136
- </Button>
137
- <Button icon={<DustBinSvg size={24} />} colorScheme="color.black" isIconRounded isAuto />
138
- </Center>;
139
- ```
140
-
141
- ### Types
142
-
143
- #### Sizes
144
-
145
- ```tsx static
146
- type ButtonSizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
147
- ```
148
-
149
- #### Variants
150
-
151
- ```tsx static
152
- type Variants = 'filled' | 'outline' | 'link' | 'ghost';
153
- ```
154
-
155
- #### IconPositions
156
-
157
- ```tsx static
158
- type IconPositions = 'left' | 'right';
159
- ```
160
-
161
- #### Shapes
162
-
163
- ```tsx static
164
- type Shapes = 'sharp' | 'rounded' | 'pillShaped';
165
- ```
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
-
3
- import { ButtonProps } from './Button/Button.props';
4
- import { useButtonState } from './Button/Button.state';
5
- import ButtonView from './Button/Button.view';
6
-
7
- const ButtonComponent: React.FC<ButtonProps> = (props) => {
8
- const { isHovered, setIsHovered } = useButtonState();
9
- const handleHover = () => setIsHovered(!isHovered);
10
-
11
- return (
12
- <ButtonView
13
- onMouseEnter={handleHover}
14
- onMouseLeave={handleHover}
15
- filter={isHovered ? 'brightness(0.85)' : 'brightness(1)'}
16
- {...props}
17
- />
18
- );
19
- };
20
-
21
- /**
22
- * Buttons allow us to trigger an event or an action with a single click.
23
- */
24
- export const Button = ButtonComponent;
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { Button, Horizontal } from 'src/components';
3
-
4
- export const ExternalButton = () => (
5
- <Horizontal gap={10}>
6
- <Button colorScheme="theme.secondary" type="button" autofocus>
7
- Button
8
- </Button>
9
- <Button colorScheme="theme.secondary" type="submit">
10
- Button
11
- </Button>
12
- </Horizontal>
13
- );
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { Button, Horizontal } from 'src/components';
3
-
4
- import { Shape } from '../Button/Button.type';
5
-
6
- export const BorderedButtons = () => (
7
- <Horizontal gap={15}>
8
- {['sharp', 'rounded', 'pillShaped'].map((border, index) => (
9
- <Button key={index} shape={border as Shape} isAuto>
10
- {border}
11
- </Button>
12
- ))}
13
- </Horizontal>
14
- );
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- import { Button, Horizontal } from 'src/components';
3
-
4
- export const ColoredButtons = () => (
5
- <Horizontal gap={10}>
6
- {['theme.primary', 'theme.secondary', 'theme.warning', 'theme.success', 'theme.error'].map((color, index) => (
7
- <Button key={index} colorScheme={color} isAuto>
8
- {color}
9
- </Button>
10
- ))}
11
- </Horizontal>
12
- );
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { Button } from 'src/components';
3
-
4
- export const DefaultButton = () => <Button onClick={() => alert('Hello, World!')}>Default</Button>;
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { Button } from 'src/components';
3
-
4
- export const DisabledButton = () => (
5
- <Button
6
- onClick={() => {
7
- alert('Disabled');
8
- }}
9
- isDisabled
10
- >
11
- Disabled
12
- </Button>
13
- );
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import { Button, Center } from 'src/components';
3
- import { DustBinSvg } from 'src/components/Svg';
4
-
5
- import { Shape } from '../Button/Button.type';
6
-
7
- export const IconButtons = () => (
8
- <Center gap={15}>
9
- <Button icon={<DustBinSvg size={24} />} height={48}>
10
- Delete
11
- </Button>
12
- <Button
13
- height={48}
14
- icon={<DustBinSvg size={24} />}
15
- shape={'pillShaped' as Shape}
16
- iconPosition="right"
17
- colorScheme="theme.secondary"
18
- >
19
- Delete
20
- </Button>
21
- <Button icon={<DustBinSvg size={24} />} colorScheme="theme.primary" isIconRounded isAuto />
22
- </Center>
23
- );
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import { Button, Loading, Vertical } from 'src/components';
3
-
4
- export const LoadingButtons = () => (
5
- <Vertical gap={15}>
6
- <Button isLoading isFilled>
7
- {<Loading />}
8
- </Button>
9
- <Button isLoading isFilled>
10
- <Loading
11
- type="dotted"
12
- styles={{
13
- loader: { color: 'color.white' },
14
- text: {
15
- color: 'color.black',
16
- },
17
- }}
18
- >
19
- Loading
20
- </Loading>
21
- </Button>
22
- <Button isLoading isFilled>
23
- <Loading
24
- type="quarter"
25
- textPosition="right"
26
- styles={{ loader: { color: 'color.black' }, text: { color: 'color.black' } }}
27
- >
28
- Submitting
29
- </Loading>
30
- </Button>
31
- </Vertical>
32
- );
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import { Button } from 'src/components';
3
-
4
- export const ShadowButton = () => (
5
- <Button shadow={{ boxShadow: 'rgb(249, 115, 22) 0px 4px 14px 0px' }}>Click Me</Button>
6
- );
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import { Button, Vertical } from 'src/components';
3
-
4
- import { Size } from '../Button/Button.type';
5
-
6
- export const ButtonSizes = () => (
7
- <Vertical gap={10}>
8
- {['xs', 'sm', 'md', 'lg', 'xl'].map((size, index) => (
9
- <Button key={index} size={size as Size}>
10
- Button
11
- </Button>
12
- ))}
13
- <Button isAuto>Auto Width</Button>
14
- <Button isFilled>Fill Width</Button>
15
- </Vertical>
16
- );
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import { Button, Vertical } from 'src/components';
3
-
4
- import { Variant } from '../Button/Button.type';
5
-
6
- export const VariantButtons = () => (
7
- <Vertical gap={15}>
8
- {['filled', 'outline', 'link', 'ghost'].map((variant, index) => (
9
- <Button
10
- key={index}
11
- externalHref="https://www.npmjs.com/package/app-studio"
12
- variant={variant as Variant}
13
- colorScheme="theme.primary"
14
- isFilled
15
- >
16
- {variant}
17
- </Button>
18
- ))}
19
- </Vertical>
20
- );
@@ -1,9 +0,0 @@
1
- export * from 'src/components/Button/examples/BorderedButtons';
2
- export * from 'src/components/Button/examples/ColoredButtons';
3
- export * from 'src/components/Button/examples/DefaultButton';
4
- export * from 'src/components/Button/examples/DisabledButton';
5
- export * from 'src/components/Button/examples/IconButtons';
6
- export * from 'src/components/Button/examples/LoadingButtons';
7
- export * from 'src/components/Button/examples/ShadowButton';
8
- export * from 'src/components/Button/examples/SizeButtons';
9
- export * from 'src/components/Button/examples/VariantButtons';