react-miui 0.20.1 → 0.22.0

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 (410) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/components/form/Select.d.ts +1 -5
  3. package/dist/components/form/Select.d.ts.map +1 -1
  4. package/dist/components/form/Select.js +2 -23
  5. package/dist/components/form/Select.js.map +1 -1
  6. package/dist/components/form/Select.stories.d.ts +8 -0
  7. package/dist/components/form/Select.stories.d.ts.map +1 -0
  8. package/dist/components/form/Select.stories.js +26 -0
  9. package/dist/components/form/Select.stories.js.map +1 -0
  10. package/dist/components/{layout/list/Value.styled.d.ts → form/Select.styled.d.ts} +20 -12
  11. package/dist/components/form/Select.styled.d.ts.map +1 -0
  12. package/dist/components/form/Select.styled.js +24 -0
  13. package/dist/components/form/Select.styled.js.map +1 -0
  14. package/dist/components/form/input/Input.css.d.ts +16 -16
  15. package/dist/components/form/input/Input.css.d.ts.map +1 -1
  16. package/dist/components/form/input/Input.css.js.map +1 -1
  17. package/dist/components/form/input/Input.styled.d.ts +68 -36
  18. package/dist/components/form/input/Input.styled.d.ts.map +1 -1
  19. package/dist/components/form/textarea/TextArea.styled.d.ts +17 -9
  20. package/dist/components/form/textarea/TextArea.styled.d.ts.map +1 -1
  21. package/dist/components/icons/Icon.js +1 -2
  22. package/dist/components/icons/Icon.js.map +1 -1
  23. package/dist/components/layout/list/Header.d.ts +174 -7
  24. package/dist/components/layout/list/Header.d.ts.map +1 -1
  25. package/dist/components/layout/list/Header.js +36 -11
  26. package/dist/components/layout/list/Header.js.map +1 -1
  27. package/dist/components/layout/list/Header.stories.d.ts +8 -0
  28. package/dist/components/layout/list/Header.stories.d.ts.map +1 -0
  29. package/dist/components/layout/list/Header.stories.js +33 -0
  30. package/dist/components/layout/list/Header.stories.js.map +1 -0
  31. package/dist/components/layout/list/Item.d.ts +88 -7
  32. package/dist/components/layout/list/Item.d.ts.map +1 -1
  33. package/dist/components/layout/list/Item.js +66 -33
  34. package/dist/components/layout/list/Item.js.map +1 -1
  35. package/dist/components/layout/list/Item.stories.d.ts +10 -0
  36. package/dist/components/layout/list/Item.stories.d.ts.map +1 -0
  37. package/dist/components/layout/list/Item.stories.js +65 -0
  38. package/dist/components/layout/list/Item.stories.js.map +1 -0
  39. package/dist/components/layout/list/Label.d.ts +83 -5
  40. package/dist/components/layout/list/Label.d.ts.map +1 -1
  41. package/dist/components/layout/list/Label.js +24 -6
  42. package/dist/components/layout/list/Label.js.map +1 -1
  43. package/dist/components/layout/list/Label.stories.d.ts +8 -0
  44. package/dist/components/layout/list/Label.stories.d.ts.map +1 -0
  45. package/dist/components/layout/list/Label.stories.js +35 -0
  46. package/dist/components/layout/list/Label.stories.js.map +1 -0
  47. package/dist/components/layout/list/List.d.ts +86 -7
  48. package/dist/components/layout/list/List.d.ts.map +1 -1
  49. package/dist/components/layout/list/List.js +15 -9
  50. package/dist/components/layout/list/List.js.map +1 -1
  51. package/dist/components/layout/list/List.stories.d.ts +9 -0
  52. package/dist/components/layout/list/List.stories.d.ts.map +1 -0
  53. package/dist/components/layout/list/List.stories.js +53 -0
  54. package/dist/components/layout/list/List.stories.js.map +1 -0
  55. package/dist/components/layout/list/Value.d.ts +81 -1
  56. package/dist/components/layout/list/Value.d.ts.map +1 -1
  57. package/dist/components/layout/list/Value.js +9 -2
  58. package/dist/components/layout/list/Value.js.map +1 -1
  59. package/dist/components/layout/list/Value.stories.d.ts +8 -0
  60. package/dist/components/layout/list/Value.stories.d.ts.map +1 -0
  61. package/dist/components/layout/list/Value.stories.js +29 -0
  62. package/dist/components/layout/list/Value.stories.js.map +1 -0
  63. package/dist/components/layout/section/Section.d.ts +83 -8
  64. package/dist/components/layout/section/Section.d.ts.map +1 -1
  65. package/dist/components/layout/section/Section.js +17 -15
  66. package/dist/components/layout/section/Section.js.map +1 -1
  67. package/dist/components/layout/section/Section.stories.d.ts +8 -0
  68. package/dist/components/layout/section/Section.stories.d.ts.map +1 -0
  69. package/dist/components/layout/section/Section.stories.js +37 -0
  70. package/dist/components/layout/section/Section.stories.js.map +1 -0
  71. package/dist/components/layout/section/SectionContainer.d.ts +80 -5
  72. package/dist/components/layout/section/SectionContainer.d.ts.map +1 -1
  73. package/dist/components/layout/section/SectionContainer.js +9 -8
  74. package/dist/components/layout/section/SectionContainer.js.map +1 -1
  75. package/dist/components/ui/button/Button.d.ts +1 -7
  76. package/dist/components/ui/button/Button.d.ts.map +1 -1
  77. package/dist/components/ui/button/Button.js +2 -28
  78. package/dist/components/ui/button/Button.js.map +1 -1
  79. package/dist/components/ui/button/Button.stories.d.ts +9 -0
  80. package/dist/components/ui/button/Button.stories.d.ts.map +1 -0
  81. package/dist/components/ui/button/Button.stories.js +62 -0
  82. package/dist/components/ui/button/Button.stories.js.map +1 -0
  83. package/dist/components/ui/button/Button.styled.d.ts +85 -0
  84. package/dist/components/ui/button/Button.styled.d.ts.map +1 -0
  85. package/dist/components/ui/button/Button.styled.js +38 -0
  86. package/dist/components/ui/button/Button.styled.js.map +1 -0
  87. package/dist/components/ui/message/Message.d.ts +17 -9
  88. package/dist/components/ui/message/Message.d.ts.map +1 -1
  89. package/dist/components/ui/message/Message.styled.d.ts +17 -9
  90. package/dist/components/ui/message/Message.styled.d.ts.map +1 -1
  91. package/dist/components/ui/modal/Modal.d.ts +6 -4
  92. package/dist/components/ui/modal/Modal.d.ts.map +1 -1
  93. package/dist/components/ui/modal/Modal.js +30 -21
  94. package/dist/components/ui/modal/Modal.js.map +1 -1
  95. package/dist/components/ui/modal/Modal.stories.d.ts +10 -0
  96. package/dist/components/ui/modal/Modal.stories.d.ts.map +1 -0
  97. package/dist/components/ui/modal/Modal.stories.js +112 -0
  98. package/dist/components/ui/modal/Modal.stories.js.map +1 -0
  99. package/dist/components/ui/modal/Modal.styled.d.ts +329 -0
  100. package/dist/components/ui/modal/Modal.styled.d.ts.map +1 -0
  101. package/dist/components/ui/modal/Modal.styled.js +90 -0
  102. package/dist/components/ui/modal/Modal.styled.js.map +1 -0
  103. package/dist/components/ui/modal/ModalButtons.d.ts +1 -11
  104. package/dist/components/ui/modal/ModalButtons.d.ts.map +1 -1
  105. package/dist/components/ui/modal/ModalButtons.js +2 -12
  106. package/dist/components/ui/modal/ModalButtons.js.map +1 -1
  107. package/dist/components/ui/modal/ModalButtons.stories.d.ts +8 -0
  108. package/dist/components/ui/modal/ModalButtons.stories.d.ts.map +1 -0
  109. package/dist/components/ui/modal/ModalButtons.stories.js +25 -0
  110. package/dist/components/ui/modal/ModalButtons.stories.js.map +1 -0
  111. package/dist/components/ui/modal/ModalButtons.styled.d.ts +166 -0
  112. package/dist/components/ui/modal/ModalButtons.styled.d.ts.map +1 -0
  113. package/dist/components/ui/modal/ModalButtons.styled.js +42 -0
  114. package/dist/components/ui/modal/ModalButtons.styled.js.map +1 -0
  115. package/dist/components/ui/pop/Pop.module.scss +1 -0
  116. package/dist/index.d.ts +0 -1
  117. package/dist/index.d.ts.map +1 -1
  118. package/dist/index.js +0 -1
  119. package/dist/index.js.map +1 -1
  120. package/dist/theme.d.ts +125 -69
  121. package/dist/theme.d.ts.map +1 -1
  122. package/dist/theme.js +2 -0
  123. package/dist/theme.js.map +1 -1
  124. package/docs/assets/search.js +1 -1
  125. package/docs/classes/Drawer.html +14 -17
  126. package/docs/classes/Pop.html +14 -17
  127. package/docs/classes/ToasterProvider.html +10 -13
  128. package/docs/enums/ICON.html +14 -17
  129. package/docs/functions/Action.html +6 -10
  130. package/docs/functions/Button.html +44 -15
  131. package/docs/functions/Card.html +6 -10
  132. package/docs/functions/Checkbox.html +6 -10
  133. package/docs/functions/Choice.html +7 -11
  134. package/docs/functions/CoveringLoader.html +6 -10
  135. package/docs/functions/DirectionPad.html +6 -10
  136. package/docs/functions/EqualActions.html +6 -10
  137. package/docs/functions/FullLoader.html +6 -10
  138. package/docs/functions/HandleEsc.html +6 -10
  139. package/docs/functions/Header.html +6 -10
  140. package/docs/functions/HeaderIconAction.html +6 -10
  141. package/docs/functions/Icon-1.html +6 -10
  142. package/docs/functions/If.html +6 -10
  143. package/docs/functions/Input.html +7 -11
  144. package/docs/functions/KeyValue.html +6 -10
  145. package/docs/functions/Label.html +6 -10
  146. package/docs/functions/List-1.html +18 -12
  147. package/docs/functions/Loader.html +6 -10
  148. package/docs/functions/Loading.html +6 -10
  149. package/docs/functions/Message.html +6 -10
  150. package/docs/functions/Modal-1.html +6 -10
  151. package/docs/functions/ModalButtons.html +135 -0
  152. package/docs/functions/PopLoader.html +6 -10
  153. package/docs/functions/PopOption.html +6 -10
  154. package/docs/functions/SearchContainer.html +6 -10
  155. package/docs/functions/Section.html +145 -0
  156. package/docs/functions/Select.html +40 -15
  157. package/docs/functions/Selector.html +7 -11
  158. package/docs/functions/Spacer.html +6 -10
  159. package/docs/functions/Stats.html +6 -10
  160. package/docs/functions/StickyHeader-1.html +6 -10
  161. package/docs/functions/StickyHeader.Content.html +5 -8
  162. package/docs/functions/Table.html +6 -10
  163. package/docs/functions/TextArea.html +6 -10
  164. package/docs/functions/Toggle.html +6 -10
  165. package/docs/functions/getCssText.html +6 -10
  166. package/docs/functions/styled.html +6 -10
  167. package/docs/functions/useToaster.html +7 -11
  168. package/docs/index.html +6 -10
  169. package/docs/modules/List.html +10 -10
  170. package/docs/modules/Modal.html +8 -11
  171. package/docs/modules/StickyHeader.html +6 -9
  172. package/docs/modules.html +9 -17
  173. package/docs/pages/tutorials/Test.html +6 -10
  174. package/docs/types/ThemeCSS.html +7 -11
  175. package/docs/variables/List.Header.html +8 -10
  176. package/docs/variables/List.Item.html +53 -0
  177. package/docs/variables/{ModalButtons.Button.html → Modal.RemovePadding.html} +11 -14
  178. package/docs/variables/cssReset.html +7 -11
  179. package/docs/variables/miuiScrollbars.html +7 -11
  180. package/esm/components/form/Select.d.ts +1 -5
  181. package/esm/components/form/Select.d.ts.map +1 -1
  182. package/esm/components/form/Select.js +1 -8
  183. package/esm/components/form/Select.js.map +1 -1
  184. package/esm/components/form/Select.stories.d.ts +8 -0
  185. package/esm/components/form/Select.stories.d.ts.map +1 -0
  186. package/esm/components/form/Select.stories.js +20 -0
  187. package/esm/components/form/Select.stories.js.map +1 -0
  188. package/esm/components/{layout/list/Value.styled.d.ts → form/Select.styled.d.ts} +20 -12
  189. package/esm/components/form/Select.styled.d.ts.map +1 -0
  190. package/esm/components/form/Select.styled.js +21 -0
  191. package/esm/components/form/Select.styled.js.map +1 -0
  192. package/esm/components/form/input/Input.css.d.ts +16 -16
  193. package/esm/components/form/input/Input.css.d.ts.map +1 -1
  194. package/esm/components/form/input/Input.css.js.map +1 -1
  195. package/esm/components/form/input/Input.styled.d.ts +68 -36
  196. package/esm/components/form/input/Input.styled.d.ts.map +1 -1
  197. package/esm/components/form/textarea/TextArea.styled.d.ts +17 -9
  198. package/esm/components/form/textarea/TextArea.styled.d.ts.map +1 -1
  199. package/esm/components/layout/list/Header.d.ts +174 -7
  200. package/esm/components/layout/list/Header.d.ts.map +1 -1
  201. package/esm/components/layout/list/Header.js +24 -11
  202. package/esm/components/layout/list/Header.js.map +1 -1
  203. package/esm/components/layout/list/Header.stories.d.ts +8 -0
  204. package/esm/components/layout/list/Header.stories.d.ts.map +1 -0
  205. package/esm/components/layout/list/Header.stories.js +27 -0
  206. package/esm/components/layout/list/Header.stories.js.map +1 -0
  207. package/esm/components/layout/list/Item.d.ts +88 -7
  208. package/esm/components/layout/list/Item.d.ts.map +1 -1
  209. package/esm/components/layout/list/Item.js +64 -33
  210. package/esm/components/layout/list/Item.js.map +1 -1
  211. package/esm/components/layout/list/Item.stories.d.ts +10 -0
  212. package/esm/components/layout/list/Item.stories.d.ts.map +1 -0
  213. package/esm/components/layout/list/Item.stories.js +57 -0
  214. package/esm/components/layout/list/Item.stories.js.map +1 -0
  215. package/esm/components/layout/list/Label.d.ts +83 -5
  216. package/esm/components/layout/list/Label.d.ts.map +1 -1
  217. package/esm/components/layout/list/Label.js +12 -6
  218. package/esm/components/layout/list/Label.js.map +1 -1
  219. package/esm/components/layout/list/Label.stories.d.ts +8 -0
  220. package/esm/components/layout/list/Label.stories.d.ts.map +1 -0
  221. package/esm/components/layout/list/Label.stories.js +29 -0
  222. package/esm/components/layout/list/Label.stories.js.map +1 -0
  223. package/esm/components/layout/list/List.d.ts +86 -7
  224. package/esm/components/layout/list/List.d.ts.map +1 -1
  225. package/esm/components/layout/list/List.js +15 -9
  226. package/esm/components/layout/list/List.js.map +1 -1
  227. package/esm/components/layout/list/List.stories.d.ts +9 -0
  228. package/esm/components/layout/list/List.stories.d.ts.map +1 -0
  229. package/esm/components/layout/list/List.stories.js +46 -0
  230. package/esm/components/layout/list/List.stories.js.map +1 -0
  231. package/esm/components/layout/list/Value.d.ts +81 -1
  232. package/esm/components/layout/list/Value.d.ts.map +1 -1
  233. package/esm/components/layout/list/Value.js +9 -1
  234. package/esm/components/layout/list/Value.js.map +1 -1
  235. package/esm/components/layout/list/Value.stories.d.ts +8 -0
  236. package/esm/components/layout/list/Value.stories.d.ts.map +1 -0
  237. package/esm/components/layout/list/Value.stories.js +23 -0
  238. package/esm/components/layout/list/Value.stories.js.map +1 -0
  239. package/esm/components/layout/section/Section.d.ts +83 -8
  240. package/esm/components/layout/section/Section.d.ts.map +1 -1
  241. package/esm/components/layout/section/Section.js +17 -12
  242. package/esm/components/layout/section/Section.js.map +1 -1
  243. package/esm/components/layout/section/Section.stories.d.ts +8 -0
  244. package/esm/components/layout/section/Section.stories.d.ts.map +1 -0
  245. package/esm/components/layout/section/Section.stories.js +31 -0
  246. package/esm/components/layout/section/Section.stories.js.map +1 -0
  247. package/esm/components/layout/section/SectionContainer.d.ts +80 -5
  248. package/esm/components/layout/section/SectionContainer.d.ts.map +1 -1
  249. package/esm/components/layout/section/SectionContainer.js +9 -5
  250. package/esm/components/layout/section/SectionContainer.js.map +1 -1
  251. package/esm/components/ui/button/Button.d.ts +1 -7
  252. package/esm/components/ui/button/Button.d.ts.map +1 -1
  253. package/esm/components/ui/button/Button.js +1 -13
  254. package/esm/components/ui/button/Button.js.map +1 -1
  255. package/esm/components/ui/button/Button.stories.d.ts +9 -0
  256. package/esm/components/ui/button/Button.stories.d.ts.map +1 -0
  257. package/esm/components/ui/button/Button.stories.js +35 -0
  258. package/esm/components/ui/button/Button.stories.js.map +1 -0
  259. package/esm/components/ui/button/Button.styled.d.ts +85 -0
  260. package/esm/components/ui/button/Button.styled.d.ts.map +1 -0
  261. package/esm/components/ui/button/Button.styled.js +35 -0
  262. package/esm/components/ui/button/Button.styled.js.map +1 -0
  263. package/esm/components/ui/message/Message.d.ts +17 -9
  264. package/esm/components/ui/message/Message.d.ts.map +1 -1
  265. package/esm/components/ui/message/Message.styled.d.ts +17 -9
  266. package/esm/components/ui/message/Message.styled.d.ts.map +1 -1
  267. package/esm/components/ui/modal/Modal.d.ts +6 -4
  268. package/esm/components/ui/modal/Modal.d.ts.map +1 -1
  269. package/esm/components/ui/modal/Modal.js +30 -18
  270. package/esm/components/ui/modal/Modal.js.map +1 -1
  271. package/esm/components/ui/modal/Modal.stories.d.ts +10 -0
  272. package/esm/components/ui/modal/Modal.stories.d.ts.map +1 -0
  273. package/esm/components/ui/modal/Modal.stories.js +84 -0
  274. package/esm/components/ui/modal/Modal.stories.js.map +1 -0
  275. package/esm/components/ui/modal/Modal.styled.d.ts +329 -0
  276. package/esm/components/ui/modal/Modal.styled.d.ts.map +1 -0
  277. package/esm/components/ui/modal/Modal.styled.js +83 -0
  278. package/esm/components/ui/modal/Modal.styled.js.map +1 -0
  279. package/esm/components/ui/modal/ModalButtons.d.ts +1 -11
  280. package/esm/components/ui/modal/ModalButtons.d.ts.map +1 -1
  281. package/esm/components/ui/modal/ModalButtons.js +1 -9
  282. package/esm/components/ui/modal/ModalButtons.js.map +1 -1
  283. package/esm/components/ui/modal/ModalButtons.stories.d.ts +8 -0
  284. package/esm/components/ui/modal/ModalButtons.stories.d.ts.map +1 -0
  285. package/esm/components/ui/modal/ModalButtons.stories.js +19 -0
  286. package/esm/components/ui/modal/ModalButtons.stories.js.map +1 -0
  287. package/esm/components/ui/modal/ModalButtons.styled.d.ts +166 -0
  288. package/esm/components/ui/modal/ModalButtons.styled.d.ts.map +1 -0
  289. package/esm/components/ui/modal/ModalButtons.styled.js +39 -0
  290. package/esm/components/ui/modal/ModalButtons.styled.js.map +1 -0
  291. package/esm/components/ui/pop/Pop.module.scss +1 -0
  292. package/esm/index.d.ts +0 -1
  293. package/esm/index.d.ts.map +1 -1
  294. package/esm/index.js +0 -1
  295. package/esm/index.js.map +1 -1
  296. package/esm/theme.d.ts +125 -69
  297. package/esm/theme.d.ts.map +1 -1
  298. package/esm/theme.js +2 -0
  299. package/esm/theme.js.map +1 -1
  300. package/package.json +8 -7
  301. package/src/components/form/Select.stories.tsx +30 -0
  302. package/src/components/form/Select.styled.ts +25 -0
  303. package/src/components/form/Select.tsx +1 -22
  304. package/src/components/form/input/Input.css.ts +5 -3
  305. package/src/components/layout/list/Header.stories.tsx +40 -0
  306. package/src/components/layout/list/Header.tsx +43 -26
  307. package/src/components/layout/list/Item.stories.tsx +69 -0
  308. package/src/components/layout/list/Item.tsx +118 -46
  309. package/src/components/layout/list/Label.stories.tsx +45 -0
  310. package/src/components/layout/list/Label.tsx +21 -12
  311. package/src/components/layout/list/List.stories.tsx +84 -0
  312. package/src/components/layout/list/List.tsx +34 -23
  313. package/src/components/layout/list/Value.stories.tsx +37 -0
  314. package/src/components/layout/list/Value.tsx +15 -1
  315. package/src/components/layout/section/Section.stories.tsx +54 -0
  316. package/src/components/layout/section/Section.tsx +27 -27
  317. package/src/components/layout/section/SectionContainer.tsx +10 -13
  318. package/src/components/ui/button/Button.stories.tsx +55 -0
  319. package/src/components/ui/button/Button.styled.ts +43 -0
  320. package/src/components/ui/button/Button.tsx +1 -35
  321. package/src/components/ui/modal/Modal.stories.tsx +143 -0
  322. package/src/components/ui/modal/Modal.styled.ts +100 -0
  323. package/src/components/ui/modal/Modal.tsx +49 -26
  324. package/src/components/ui/modal/ModalButtons.stories.tsx +40 -0
  325. package/src/components/ui/modal/ModalButtons.styled.ts +51 -0
  326. package/src/components/ui/modal/ModalButtons.tsx +1 -22
  327. package/src/components/ui/pop/Pop.module.scss +1 -0
  328. package/src/demo/components/form/Choice.tsx +3 -3
  329. package/src/demo/components/form/Form.tsx +1 -1
  330. package/src/demo/components/form/Search.tsx +3 -1
  331. package/src/demo/components/form/Toggle.tsx +3 -1
  332. package/src/demo/components/layout/card/Card.tsx +3 -3
  333. package/src/demo/components/ui/icons/Icons.tsx +3 -1
  334. package/src/demo/components/ui/keyValue/KeyValue.tsx +1 -1
  335. package/src/demo/components/ui/pop/Pop.tsx +1 -1
  336. package/src/demo/componentsMap.ts +0 -77
  337. package/src/index.ts +0 -1
  338. package/src/pages/_app.tsx +2 -0
  339. package/src/theme.ts +5 -3
  340. package/dist/components/form/Select.module.scss +0 -18
  341. package/dist/components/layout/list/Header.module.scss +0 -8
  342. package/dist/components/layout/list/Item.module.scss +0 -46
  343. package/dist/components/layout/list/Label.module.scss +0 -9
  344. package/dist/components/layout/list/List.module.scss +0 -8
  345. package/dist/components/layout/list/Value.styled.d.ts.map +0 -1
  346. package/dist/components/layout/list/Value.styled.js +0 -13
  347. package/dist/components/layout/list/Value.styled.js.map +0 -1
  348. package/dist/components/layout/section/Section.module.scss +0 -24
  349. package/dist/components/layout/section/SectionContainer.module.scss +0 -4
  350. package/dist/components/ui/button/Button.module.scss +0 -25
  351. package/dist/components/ui/modal/Modal.module.scss +0 -92
  352. package/dist/components/ui/modal/ModalButtons.module.scss +0 -32
  353. package/dist/components/ui/modal/ModalNoMargin.d.ts +0 -7
  354. package/dist/components/ui/modal/ModalNoMargin.d.ts.map +0 -1
  355. package/dist/components/ui/modal/ModalNoMargin.js +0 -22
  356. package/dist/components/ui/modal/ModalNoMargin.js.map +0 -1
  357. package/docs/functions/Item-1.html +0 -110
  358. package/docs/functions/ModalButtons-1.html +0 -110
  359. package/docs/functions/Section-1.html +0 -110
  360. package/docs/modules/Item.html +0 -64
  361. package/docs/modules/ModalButtons.html +0 -61
  362. package/docs/modules/Section.html +0 -61
  363. package/docs/variables/Item.Label.html +0 -56
  364. package/docs/variables/Item.Value.html +0 -56
  365. package/docs/variables/Modal.NegateMargin.html +0 -55
  366. package/docs/variables/Section.Container.html +0 -55
  367. package/esm/components/form/Select.module.scss +0 -18
  368. package/esm/components/layout/list/Header.module.scss +0 -8
  369. package/esm/components/layout/list/Item.module.scss +0 -46
  370. package/esm/components/layout/list/Label.module.scss +0 -9
  371. package/esm/components/layout/list/List.module.scss +0 -8
  372. package/esm/components/layout/list/Value.styled.d.ts.map +0 -1
  373. package/esm/components/layout/list/Value.styled.js +0 -10
  374. package/esm/components/layout/list/Value.styled.js.map +0 -1
  375. package/esm/components/layout/section/Section.module.scss +0 -24
  376. package/esm/components/layout/section/SectionContainer.module.scss +0 -4
  377. package/esm/components/ui/button/Button.module.scss +0 -25
  378. package/esm/components/ui/modal/Modal.module.scss +0 -92
  379. package/esm/components/ui/modal/ModalButtons.module.scss +0 -32
  380. package/esm/components/ui/modal/ModalNoMargin.d.ts +0 -7
  381. package/esm/components/ui/modal/ModalNoMargin.d.ts.map +0 -1
  382. package/esm/components/ui/modal/ModalNoMargin.js +0 -16
  383. package/esm/components/ui/modal/ModalNoMargin.js.map +0 -1
  384. package/src/components/form/Select.module.scss +0 -18
  385. package/src/components/layout/list/Header.module.scss +0 -8
  386. package/src/components/layout/list/Item.module.scss +0 -46
  387. package/src/components/layout/list/Label.module.scss +0 -9
  388. package/src/components/layout/list/List.module.scss +0 -8
  389. package/src/components/layout/list/Value.styled.ts +0 -13
  390. package/src/components/layout/section/Section.module.scss +0 -24
  391. package/src/components/layout/section/SectionContainer.module.scss +0 -4
  392. package/src/components/ui/button/Button.module.scss +0 -25
  393. package/src/components/ui/modal/Modal.module.scss +0 -92
  394. package/src/components/ui/modal/ModalButtons.module.scss +0 -32
  395. package/src/components/ui/modal/ModalNoMargin.tsx +0 -25
  396. package/src/demo/components/form/Input.tsx +0 -28
  397. package/src/demo/components/form/Select.tsx +0 -26
  398. package/src/demo/components/layout/list/Header.tsx +0 -23
  399. package/src/demo/components/layout/list/Inset.tsx +0 -23
  400. package/src/demo/components/layout/list/ItemRatio.tsx +0 -20
  401. package/src/demo/components/layout/list/Label.tsx +0 -31
  402. package/src/demo/components/layout/list/List.Item.module.scss +0 -7
  403. package/src/demo/components/layout/list/List.Item.tsx +0 -24
  404. package/src/demo/components/layout/list/Selection.tsx +0 -16
  405. package/src/demo/components/layout/list/Value.module.scss +0 -4
  406. package/src/demo/components/layout/list/Value.tsx +0 -25
  407. package/src/demo/components/layout/section/Section.tsx +0 -33
  408. package/src/demo/components/ui/button/ButtonDemo.tsx +0 -23
  409. package/src/demo/components/ui/message/Message.tsx +0 -27
  410. package/src/demo/components/ui/modal/Modal.tsx +0 -104
@@ -0,0 +1,84 @@
1
+ import React from "react";
2
+
3
+ import type { StoryObj, Meta } from "@storybook/react";
4
+
5
+ import { Icon, ICON } from "../../icons/Icon.js";
6
+
7
+ import { List } from "./List.js";
8
+
9
+ const meta: Meta = {
10
+ title: "Components/Layout/List/List",
11
+ component: List,
12
+ tags: ["autodocs", "layout"],
13
+ argTypes: {
14
+ inset: {
15
+ type: "boolean",
16
+ },
17
+ },
18
+ };
19
+
20
+ type Story = StoryObj<typeof List>;
21
+
22
+ const Primary: Story = {
23
+ args: {
24
+ inset: false,
25
+ },
26
+ render: (args) => {
27
+ return (
28
+ <List {...args}>
29
+ <List.Item>I am a list item</List.Item>
30
+ <List.Item>I am a list item</List.Item>
31
+ </List>
32
+ );
33
+ },
34
+ };
35
+
36
+ const FullFeaturedExample: Story = {
37
+ render: (args) => {
38
+ return (
39
+ <List>
40
+ <List.Header>GPS settings</List.Header>
41
+ <List.Item>
42
+ <List.Item.Label sub={"Higher precision means higher battery usage"}>
43
+ GPS precision
44
+ </List.Item.Label>
45
+ <List.Item.Value>
46
+ Low
47
+ </List.Item.Value>
48
+ <Icon name={ICON.forward} />
49
+ </List.Item>
50
+ <List.Item>
51
+ <List.Item>
52
+ Something
53
+ </List.Item>
54
+ </List.Item>
55
+ <List.Header>
56
+ Last trips
57
+ </List.Header>
58
+ <List.Item>
59
+ Portugal
60
+ </List.Item>
61
+ <List.Item>
62
+ <List.Item.Label sub={"Visited 2 times in last year"}>
63
+ Poland
64
+ </List.Item.Label>
65
+ </List.Item>
66
+ <List.Item>
67
+ Sweden
68
+ </List.Item>
69
+ <List.Header>
70
+ Choose one option
71
+ </List.Header>
72
+ <List.Item selected={true}>yes</List.Item>
73
+ <List.Item selected={false}>no</List.Item>
74
+ </List>
75
+ );
76
+ },
77
+ };
78
+
79
+ export {
80
+ Primary,
81
+ FullFeaturedExample,
82
+ };
83
+
84
+ export default meta;
@@ -1,47 +1,58 @@
1
1
  import React from "react";
2
2
 
3
- import classnames from "classnames";
4
-
5
- import { makeVariants } from "../../../utils/index.js";
3
+ import { pxToRem, styled } from "../../../theme.js";
6
4
 
7
5
  import { Header } from "./Header.js";
8
6
  import { Item } from "./Item.js";
9
- import styles from "./List.module.scss";
10
-
11
- type Variant = "inset";
12
-
13
- interface Props {
14
- className?: string;
15
- variant?: Variant | Variant[];
16
- children: React.ReactNode;
17
- }
18
7
 
19
8
  interface SubComponents {
20
9
  Header: typeof Header;
10
+ Item: typeof Item;
21
11
  }
22
12
 
23
- const List: React.FC<Props> & SubComponents = (props) => {
24
- const v = makeVariants(props.variant);
25
-
13
+ const StyledList = styled("ul", {
14
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
15
+ margin: `0 ${pxToRem(23)}`,
16
+ padding: 0,
17
+
18
+ variants: {
19
+ inset: {
20
+ true: {
21
+ margin: 0,
22
+ },
23
+ },
24
+ },
25
+ });
26
+
27
+ type StyledListProps = React.ComponentProps<typeof StyledList>;
28
+
29
+ /**
30
+ * Component for rendering menu lists.
31
+ *
32
+ * It has two subcomponents:
33
+ * - `Item`: for rendering list items
34
+ * - `Header`: for rendering list headers
35
+ *
36
+ * List has one variant: `inset`, which removes the margin from the list. If used it will be automatically applied to
37
+ * all children.
38
+ *
39
+ * See `Item` and `Header` for more information about their usage.
40
+ */
41
+ const List: React.FC<StyledListProps> & SubComponents = (props) => {
26
42
  const chld = React.Children.map(props.children, (child) => {
27
43
  if (child && typeof child === "object" && "type" in child && (child.type === Item || child.type === Header)) {
28
44
  return React.cloneElement(child, {
29
- // @TODO this will override but should merge?
30
- variant: props.variant,
45
+ inset: props.inset,
31
46
  });
32
47
  }
33
48
  return child;
34
49
  });
35
50
 
36
- const cls = classnames(props.className, styles.list, {
37
- [styles.inset]: v.includes("inset"),
38
- });
39
-
40
51
  return (
41
- <ul className={cls}>{chld}</ul>
52
+ <StyledList {...props}>{chld}</StyledList>
42
53
  );
43
54
  };
44
-
45
55
  List.Header = Header;
56
+ List.Item = Item;
46
57
 
47
58
  export { List };
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+
3
+ import type { StoryObj, Meta } from "@storybook/react";
4
+
5
+ import { Value } from "./Value.js";
6
+ import { List } from "./List.js";
7
+ import { Item } from "./Item.js";
8
+
9
+ const meta: Meta = {
10
+ title: "Components/Layout/List/Value",
11
+ component: Value,
12
+ tags: ["autodocs", "layout"],
13
+ };
14
+
15
+ type Story = StoryObj<typeof Value>;
16
+
17
+ const Primary: Story = {
18
+ args: {
19
+ children: "23,4*C",
20
+ },
21
+ render: (args) => {
22
+ return (
23
+ <List>
24
+ <Item>
25
+ <div>Some label</div>
26
+ <Value {...args} />
27
+ </Item>
28
+ </List>
29
+ );
30
+ },
31
+ };
32
+
33
+ export {
34
+ Primary,
35
+ };
36
+
37
+ export default meta;
@@ -1 +1,15 @@
1
- export { StyledValue as Value } from "./Value.styled.js";
1
+ import { fontPxToRem, styled } from "../../../theme.js";
2
+
3
+ /**
4
+ * Use this to render a value within `Item`. It's most useful when used with `Item.Label`.
5
+ */
6
+ const Value = styled("div", {
7
+ color: "$icon",
8
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
9
+ fontSize: fontPxToRem(26),
10
+ display: "flex",
11
+ justifyContent: "flex-end",
12
+ flex: 1,
13
+ });
14
+
15
+ export { Value };
@@ -0,0 +1,54 @@
1
+ import React from "react";
2
+
3
+ import type { StoryObj, Meta } from "@storybook/react";
4
+
5
+ import { List } from "../list/List.js";
6
+ import { Item } from "../list/Item.js";
7
+
8
+ import { Section } from "./Section.js";
9
+
10
+ const meta: Meta = {
11
+ title: "Components/Layout/Section",
12
+ component: Section,
13
+ tags: ["autodocs", "layout"],
14
+ argTypes: {
15
+ vertical: {
16
+ type: "boolean",
17
+ },
18
+ horizontal: {
19
+ type: "boolean",
20
+ },
21
+ },
22
+ };
23
+
24
+ type Story = StoryObj<typeof Section>;
25
+
26
+ const Primary: Story = {
27
+ args: {},
28
+ render: (args) => (
29
+ <div style={{ border: "1px solid #ddd" }}>
30
+ <Section.Container>
31
+ <Section {...args}>
32
+ This is an example section, arguments in the arguments table are applied only to this
33
+ section. By default sections do not have any padding, so you can place elements that should touch
34
+ the edges. Use `vertical` and `horizontal` arguments to add padding.
35
+ </Section>
36
+ <Section vertical={true} horizontal={true}>
37
+ Some section
38
+ </Section>
39
+ <Section>
40
+ <List>
41
+ <Item>Some item</Item>
42
+ <Item>Some item</Item>
43
+ </List>
44
+ </Section>
45
+ </Section.Container>
46
+ </div>
47
+ ),
48
+ };
49
+
50
+ export {
51
+ Primary,
52
+ };
53
+
54
+ export default meta;
@@ -1,37 +1,37 @@
1
- import React from "react";
2
-
3
- import classnames from "classnames";
4
-
5
- import { makeVariants } from "../../../utils/makeVariants.js";
1
+ import { pxToRem, styled } from "../../../theme.js";
6
2
 
7
3
  import { SectionContainer } from "./SectionContainer.js";
8
- import styles from "./Section.module.scss";
9
4
 
10
5
  interface SubComponents {
11
6
  Container: typeof SectionContainer;
12
7
  }
13
8
 
14
- type Variant = "horizontal" | "vertical";
15
-
16
- interface Props {
17
- variant?: Variant | Variant[];
18
- className?: string;
19
- children: React.ReactNode;
20
- }
21
-
22
- const Section: React.FC<Props> & SubComponents = (props) => {
23
- const v = makeVariants(props.variant);
24
-
25
- const cls = classnames(props.className, styles.section, {
26
- [styles.vertical]: v.includes("vertical"),
27
- [styles.horizontal]: v.includes("horizontal"),
28
- });
29
- return (
30
- <section className={cls}>
31
- {props.children}
32
- </section>
33
- );
34
- };
9
+ const SectionCmp = styled("div", {
10
+ background: "$background",
11
+
12
+ variants: {
13
+ vertical: {
14
+ true: {
15
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
16
+ py: pxToRem(23),
17
+ },
18
+ },
19
+ horizontal: {
20
+ true: {
21
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
22
+ px: pxToRem(23),
23
+ },
24
+ },
25
+ },
26
+ });
27
+
28
+ /**
29
+ * A section is a container that can be used to group related content.
30
+ *
31
+ * You should use it along with the `Section.Container` component. Container stretches to fill the available space and
32
+ * has darker background color, sections are lighter and have a gap between them.
33
+ */
34
+ const Section = SectionCmp as typeof SectionCmp & SubComponents;
35
35
 
36
36
  Section.Container = SectionContainer;
37
37
 
@@ -1,15 +1,12 @@
1
- import React from "react";
2
-
3
- import styles from "./SectionContainer.module.scss";
4
-
5
- interface Props {
6
- children: React.ReactNode;
7
- }
8
-
9
- const SectionContainer: React.FC<Props> = (props) => {
10
- return (
11
- <div className={styles.container}>{props.children}</div>
12
- );
13
- };
1
+ import { styled } from "../../../theme.js";
2
+
3
+ const SectionContainer = styled("div", {
4
+ background: "$toolbarBg",
5
+ flex: 1,
6
+ height: "100%",
7
+ display: "flex",
8
+ flexDirection: "column",
9
+ gap: 23,
10
+ });
14
11
 
15
12
  export { SectionContainer };
@@ -0,0 +1,55 @@
1
+ import React, { useCallback } from "react";
2
+
3
+ import type { StoryObj, Meta } from "@storybook/react";
4
+
5
+ import { styled } from "../../../theme.js";
6
+
7
+ import { Button } from "./Button.js";
8
+
9
+ // TODO better docs
10
+
11
+ const meta: Meta = {
12
+ title: "Components/UI/Button",
13
+ component: Button,
14
+ tags: ["autodocs", "ui"],
15
+ };
16
+
17
+ type Story = StoryObj<typeof Button>;
18
+
19
+ const Primary: Story = {
20
+ args: {
21
+ children: "Click me",
22
+ onClick: () => { alert("Clicked"); },
23
+ },
24
+ };
25
+
26
+ const Container = styled("div", {
27
+ display: "flex",
28
+ flexDirection: "column",
29
+ alignItems: "flex-start",
30
+ gap: "1rem",
31
+ });
32
+
33
+ const MultipleAtOnce: Story = {
34
+ render: () => {
35
+ const handleClick = useCallback(() => {
36
+ alert("Clicked");
37
+ }, []);
38
+
39
+ return (
40
+ <Container>
41
+ <Button onClick={handleClick}>Basic button</Button>
42
+ <Button disabled={true} onClick={handleClick}>Disabled button</Button>
43
+ <Button inline={true} onClick={handleClick}>Inline button</Button>
44
+ <Button outline={true} onClick={handleClick}>Outline button</Button>
45
+ </Container>
46
+ );
47
+ },
48
+ };
49
+
50
+ export {
51
+ Primary,
52
+ MultipleAtOnce,
53
+ };
54
+
55
+ export default meta;
@@ -0,0 +1,43 @@
1
+ import { borderPxToRem, dimensionsPxToRem, fontPxToRem, pxToRem, styled } from "../../../theme.js";
2
+
3
+ /**
4
+ * Call-to-action button.
5
+ */
6
+ const Button = styled("button", {
7
+ "height": dimensionsPxToRem(118),
8
+ "background": "$green1",
9
+ "border": `${borderPxToRem(1)} solid $green1Darker`,
10
+ "color": "white",
11
+ "borderRadius": "1000px",
12
+ "display": "flex",
13
+ "alignItems": "center",
14
+ "justifyContent": "center",
15
+ "width": "100%",
16
+ "fontSize": fontPxToRem(26),
17
+ "padding": "0 1em",
18
+ "gap": pxToRem(10),
19
+
20
+ "&:disabled": {
21
+ opacity: 0.5,
22
+ },
23
+
24
+ "variants": {
25
+ inline: {
26
+ true: {
27
+ width: "auto",
28
+ display: "inline-flex",
29
+ },
30
+ },
31
+ outline: {
32
+ true: {
33
+ background: "white",
34
+ borderColor: "$buttonBorder",
35
+ color: "$grey1",
36
+ },
37
+ },
38
+ },
39
+ });
40
+
41
+ export {
42
+ Button,
43
+ };
@@ -1,35 +1 @@
1
- import React from "react";
2
-
3
- import classnames from "classnames";
4
-
5
- import { makeVariants } from "../../../utils/index.js";
6
-
7
- import styles from "./Button.module.scss";
8
-
9
- type Variant = "inline" | "outline";
10
-
11
- interface Props {
12
- variant?: Variant | Variant[];
13
- }
14
-
15
- const Button: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & Props> = ({
16
- className, children, variant, ...props
17
- }) => {
18
- const variants = makeVariants(variant);
19
-
20
- const cls = classnames(styles.btn, {
21
- [styles["btn--inline"]]: variants.includes("inline"),
22
- [styles["btn--outline"]]: variants.includes("outline"),
23
- }, className);
24
-
25
- return (
26
- <button
27
- {...props}
28
- className={cls}
29
- disabled={props.disabled}
30
- >{children}
31
- </button>
32
- );
33
- };
34
-
35
- export { Button };
1
+ export { Button } from "./Button.styled.js";
@@ -0,0 +1,143 @@
1
+ import React, { useCallback, useState } from "react";
2
+
3
+ import type { StoryObj, Meta } from "@storybook/react";
4
+
5
+ import { Button } from "../button/Button.js";
6
+ import { Label } from "../../form/Label.js";
7
+ import { Input } from "../../form/input/Input.js";
8
+ import { Checkbox } from "../../form/Checkbox.js";
9
+ import { List } from "../../layout/list/List.js";
10
+
11
+ import { Modal } from "./Modal.js";
12
+ import { ModalButtons } from "./ModalButtons.js";
13
+ import { RemovePadding } from "./Modal.styled";
14
+
15
+ const meta: Meta = {
16
+ title: "Components/UI/Modal",
17
+ component: Modal,
18
+ tags: ["autodocs", "ui"],
19
+ };
20
+
21
+ type Story = StoryObj<typeof Modal>;
22
+
23
+ const handleNoop = () => undefined;
24
+
25
+ const Primary: Story = {
26
+ args: {},
27
+ render: () => {
28
+ // eslint-disable-next-line @typescript-eslint/no-shadow
29
+ const [open, setIsOpen] = useState(false);
30
+
31
+ const handleClose = useCallback(() => {
32
+ setIsOpen(false);
33
+ }, []);
34
+
35
+ const handleOpen = useCallback(() => {
36
+ setIsOpen(true);
37
+ }, []);
38
+
39
+ return (
40
+ <div>
41
+ <Button onClick={handleOpen}>Open modal</Button>
42
+ <Modal onClose={handleClose} isOpen={open} title={"95.5 MHz"} position={"bottom"} full={true}>
43
+ <Label>
44
+ <Input placeholder={"New station"} />
45
+ </Label>
46
+ <Label>
47
+ <Checkbox name={""} onChange={handleNoop} checked={true}>
48
+ Remember me
49
+ </Checkbox>
50
+ </Label>
51
+ <ModalButtons>
52
+ <ModalButtons.Button onClick={handleClose}>
53
+ Cancel
54
+ </ModalButtons.Button>
55
+ <ModalButtons.Button variant={"main"} onClick={handleClose}>
56
+ Ok
57
+ </ModalButtons.Button>
58
+ </ModalButtons>
59
+ </Modal>
60
+ </div>
61
+ );
62
+ },
63
+ };
64
+
65
+ const WithRemovedPaddingSections: Story = {
66
+ args: {},
67
+ render: () => {
68
+ // eslint-disable-next-line @typescript-eslint/no-shadow
69
+ const [open, setIsOpen] = useState(false);
70
+
71
+ const handleClose = useCallback(() => {
72
+ setIsOpen(false);
73
+ }, []);
74
+
75
+ const handleOpen = useCallback(() => {
76
+ setIsOpen(true);
77
+ }, []);
78
+
79
+ return (
80
+ <div>
81
+ <Button onClick={handleOpen}>Open modal</Button>
82
+ <Modal onClose={handleClose} isOpen={open} position={"bottom"} full={true}>
83
+ <RemovePadding>
84
+ <Label>
85
+ <Input placeholder={"New station"} />
86
+ </Label>
87
+ </RemovePadding>
88
+ <Label>
89
+ <Input placeholder={"New station"} />
90
+ </Label>
91
+ <RemovePadding>
92
+ <Label>
93
+ <Input placeholder={"New station"} />
94
+ </Label>
95
+ </RemovePadding>
96
+ </Modal>
97
+ </div>
98
+ );
99
+ },
100
+ };
101
+
102
+ /**
103
+ * Just a demo how to render a pick-mode list in a modal.
104
+ */
105
+ const WithList: Story = {
106
+ args: {},
107
+ render: () => {
108
+ // eslint-disable-next-line @typescript-eslint/no-shadow
109
+ const [open, setIsOpen] = useState(false);
110
+
111
+ const handleClose = useCallback(() => {
112
+ setIsOpen(false);
113
+ }, []);
114
+
115
+ const handleOpen = useCallback(() => {
116
+ setIsOpen(true);
117
+ }, []);
118
+
119
+ return (
120
+ <div>
121
+ <Button onClick={handleOpen}>Open modal</Button>
122
+ <Modal onClose={handleClose} isOpen={open} position={"bottom"} full={true}>
123
+ <RemovePadding>
124
+ <List inset={true}>
125
+ <List.Item selected={false} onClick={handleClose}>First item</List.Item>
126
+ <List.Item selected={true} onClick={handleClose}>Second item</List.Item>
127
+ <List.Item selected={false} onClick={handleClose}>Third item</List.Item>
128
+ <List.Item selected={false} onClick={handleClose}>Last option</List.Item>
129
+ </List>
130
+ </RemovePadding>
131
+ </Modal>
132
+ </div>
133
+ );
134
+ },
135
+ };
136
+
137
+ export {
138
+ Primary,
139
+ WithRemovedPaddingSections,
140
+ WithList,
141
+ };
142
+
143
+ export default meta;