react-miui 0.1.0 → 0.4.1

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 (312) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/assets/back.svg +1 -0
  3. package/assets/forward.svg +1 -0
  4. package/assets/sources/back.fla +0 -0
  5. package/dist/components/form/Toggle.d.ts +8 -0
  6. package/dist/components/form/Toggle.d.ts.map +1 -0
  7. package/dist/{demo/components/form/Checkbox.js → components/form/Toggle.js} +17 -8
  8. package/dist/components/form/Toggle.js.map +1 -0
  9. package/dist/components/form/Toggle.module.scss +46 -0
  10. package/dist/components/icons/Back.d.ts +7 -0
  11. package/dist/components/icons/Back.d.ts.map +1 -0
  12. package/dist/components/icons/Back.js +13 -0
  13. package/dist/components/icons/Back.js.map +1 -0
  14. package/dist/components/icons/Forward.d.ts +7 -0
  15. package/dist/components/icons/Forward.d.ts.map +1 -0
  16. package/dist/components/icons/Forward.js +13 -0
  17. package/dist/components/icons/Forward.js.map +1 -0
  18. package/dist/components/icons/Icon.d.ts +4 -1
  19. package/dist/components/icons/Icon.d.ts.map +1 -1
  20. package/dist/components/icons/Icon.js +7 -3
  21. package/dist/components/icons/Icon.js.map +1 -1
  22. package/dist/components/layout/header/Header.d.ts +3 -0
  23. package/dist/components/layout/header/Header.d.ts.map +1 -1
  24. package/dist/components/layout/header/Header.js +13 -2
  25. package/dist/components/layout/header/Header.js.map +1 -1
  26. package/dist/components/layout/header/Header.module.scss +47 -3
  27. package/dist/components/layout/header/HeaderIconAction.d.ts +17 -0
  28. package/dist/components/layout/header/HeaderIconAction.d.ts.map +1 -0
  29. package/dist/components/layout/header/HeaderIconAction.js +40 -0
  30. package/dist/components/layout/header/HeaderIconAction.js.map +1 -0
  31. package/dist/components/layout/header/HeaderIconAction.module.scss +22 -0
  32. package/dist/components/layout/list/Header.d.ts +4 -0
  33. package/dist/components/layout/list/Header.d.ts.map +1 -0
  34. package/dist/components/layout/list/Header.js +16 -0
  35. package/dist/components/layout/list/Header.js.map +1 -0
  36. package/dist/components/layout/list/Header.module.scss +8 -0
  37. package/dist/components/layout/list/Item.d.ts +8 -1
  38. package/dist/components/layout/list/Item.d.ts.map +1 -1
  39. package/dist/components/layout/list/Item.js +21 -5
  40. package/dist/components/layout/list/Item.js.map +1 -1
  41. package/dist/components/layout/list/Item.module.scss +10 -2
  42. package/dist/components/layout/list/Label.d.ts +8 -0
  43. package/dist/components/layout/list/Label.d.ts.map +1 -0
  44. package/dist/components/layout/list/Label.js +16 -0
  45. package/dist/components/layout/list/Label.js.map +1 -0
  46. package/dist/components/layout/list/Label.module.scss +9 -0
  47. package/dist/components/layout/list/List.d.ts +5 -1
  48. package/dist/components/layout/list/List.d.ts.map +1 -1
  49. package/dist/components/layout/list/List.js +2 -0
  50. package/dist/components/layout/list/List.js.map +1 -1
  51. package/dist/components/layout/list/Value.d.ts +4 -0
  52. package/dist/components/layout/list/Value.d.ts.map +1 -0
  53. package/dist/components/layout/list/Value.js +13 -0
  54. package/dist/components/layout/list/Value.js.map +1 -0
  55. package/dist/components/layout/list/Value.module.scss +7 -0
  56. package/dist/components/ui/action/EqualActions.d.ts +4 -1
  57. package/dist/components/ui/action/EqualActions.d.ts.map +1 -1
  58. package/dist/components/ui/action/EqualActions.js +3 -2
  59. package/dist/components/ui/action/EqualActions.js.map +1 -1
  60. package/dist/global.scss +18 -2
  61. package/dist/index.d.ts +4 -0
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +4 -0
  64. package/dist/index.js.map +1 -1
  65. package/dist/types.d.ts +1 -1
  66. package/dist/types.d.ts.map +1 -1
  67. package/docs/assets/js/search.js +1 -1
  68. package/docs/assets/js/search.json +1 -1
  69. package/docs/enums/ICON.html +44 -4
  70. package/docs/index.html +22 -4
  71. package/docs/modules/Item.html +155 -0
  72. package/docs/modules/List.html +144 -0
  73. package/docs/modules/StickyHeader.html +10 -4
  74. package/docs/modules.html +78 -14
  75. package/docs/pages/Tutorials/Test.html +9 -3
  76. package/esm/components/form/Toggle.d.ts +8 -0
  77. package/esm/components/form/Toggle.d.ts.map +1 -0
  78. package/esm/components/form/Toggle.js +15 -0
  79. package/esm/components/form/Toggle.js.map +1 -0
  80. package/esm/components/form/Toggle.module.scss +46 -0
  81. package/esm/components/icons/Back.d.ts +7 -0
  82. package/esm/components/icons/Back.d.ts.map +1 -0
  83. package/esm/components/icons/Back.js +7 -0
  84. package/esm/components/icons/Back.js.map +1 -0
  85. package/esm/components/icons/Forward.d.ts +7 -0
  86. package/esm/components/icons/Forward.d.ts.map +1 -0
  87. package/esm/components/icons/Forward.js +7 -0
  88. package/esm/components/icons/Forward.js.map +1 -0
  89. package/esm/components/icons/Icon.d.ts +4 -1
  90. package/esm/components/icons/Icon.d.ts.map +1 -1
  91. package/esm/components/icons/Icon.js +7 -3
  92. package/esm/components/icons/Icon.js.map +1 -1
  93. package/esm/components/layout/header/Header.d.ts +3 -0
  94. package/esm/components/layout/header/Header.d.ts.map +1 -1
  95. package/esm/components/layout/header/Header.js +13 -2
  96. package/esm/components/layout/header/Header.js.map +1 -1
  97. package/esm/components/layout/header/Header.module.scss +47 -3
  98. package/esm/components/layout/header/HeaderIconAction.d.ts +17 -0
  99. package/esm/components/layout/header/HeaderIconAction.d.ts.map +1 -0
  100. package/esm/components/layout/header/HeaderIconAction.js +23 -0
  101. package/esm/components/layout/header/HeaderIconAction.js.map +1 -0
  102. package/esm/components/layout/header/HeaderIconAction.module.scss +22 -0
  103. package/esm/components/layout/list/Header.d.ts +4 -0
  104. package/esm/components/layout/list/Header.d.ts.map +1 -0
  105. package/esm/components/layout/list/Header.js +10 -0
  106. package/esm/components/layout/list/Header.js.map +1 -0
  107. package/esm/components/layout/list/Header.module.scss +8 -0
  108. package/esm/components/layout/list/Item.d.ts +8 -1
  109. package/esm/components/layout/list/Item.d.ts.map +1 -1
  110. package/esm/components/layout/list/Item.js +21 -5
  111. package/esm/components/layout/list/Item.js.map +1 -1
  112. package/esm/components/layout/list/Item.module.scss +10 -2
  113. package/esm/components/layout/list/Label.d.ts +8 -0
  114. package/esm/components/layout/list/Label.d.ts.map +1 -0
  115. package/esm/components/layout/list/Label.js +10 -0
  116. package/esm/components/layout/list/Label.js.map +1 -0
  117. package/esm/components/layout/list/Label.module.scss +9 -0
  118. package/esm/components/layout/list/List.d.ts +5 -1
  119. package/esm/components/layout/list/List.d.ts.map +1 -1
  120. package/esm/components/layout/list/List.js +2 -0
  121. package/esm/components/layout/list/List.js.map +1 -1
  122. package/esm/components/layout/list/Value.d.ts +4 -0
  123. package/esm/components/layout/list/Value.d.ts.map +1 -0
  124. package/esm/components/layout/list/Value.js +7 -0
  125. package/esm/components/layout/list/Value.js.map +1 -0
  126. package/esm/components/layout/list/Value.module.scss +7 -0
  127. package/esm/components/ui/action/EqualActions.d.ts +4 -1
  128. package/esm/components/ui/action/EqualActions.d.ts.map +1 -1
  129. package/esm/components/ui/action/EqualActions.js +3 -2
  130. package/esm/components/ui/action/EqualActions.js.map +1 -1
  131. package/esm/global.scss +18 -2
  132. package/esm/index.d.ts +4 -0
  133. package/esm/index.d.ts.map +1 -1
  134. package/esm/index.js +4 -0
  135. package/esm/index.js.map +1 -1
  136. package/esm/types.d.ts +1 -1
  137. package/esm/types.d.ts.map +1 -1
  138. package/package.json +1 -1
  139. package/src/components/form/Toggle.module.scss +46 -0
  140. package/src/components/form/Toggle.tsx +33 -0
  141. package/src/components/icons/Back.tsx +21 -0
  142. package/src/components/icons/Forward.tsx +21 -0
  143. package/src/components/icons/Icon.tsx +10 -5
  144. package/src/components/layout/header/Header.module.scss +47 -3
  145. package/src/components/layout/header/Header.tsx +25 -3
  146. package/src/components/layout/header/HeaderIconAction.module.scss +22 -0
  147. package/src/components/layout/header/HeaderIconAction.tsx +49 -0
  148. package/src/components/layout/list/Header.module.scss +8 -0
  149. package/src/components/layout/list/Header.tsx +16 -0
  150. package/src/components/layout/list/Item.module.scss +10 -2
  151. package/src/components/layout/list/Item.tsx +33 -6
  152. package/src/components/layout/list/Label.module.scss +9 -0
  153. package/src/components/layout/list/Label.tsx +21 -0
  154. package/src/components/layout/list/List.tsx +8 -1
  155. package/src/components/layout/list/Value.module.scss +7 -0
  156. package/src/components/layout/list/Value.tsx +11 -0
  157. package/src/components/ui/action/EqualActions.tsx +8 -3
  158. package/src/demo/Menu.module.scss +2 -0
  159. package/src/demo/components/form/Toggle.tsx +49 -0
  160. package/src/demo/components/layout/header/Header.tsx +104 -2
  161. package/src/demo/components/layout/list/Header.tsx +24 -0
  162. package/src/demo/components/layout/list/ItemRatio.tsx +21 -0
  163. package/src/demo/components/layout/list/Label.tsx +31 -0
  164. package/src/demo/components/layout/list/List.Item.module.scss +4 -0
  165. package/src/demo/components/layout/list/Value.module.scss +4 -0
  166. package/src/demo/components/layout/list/Value.tsx +26 -0
  167. package/src/demo/components/ui/action/Action.tsx +4 -4
  168. package/src/demo/components/ui/icons/Icons.tsx +7 -10
  169. package/src/demo/componentsMap.ts +75 -23
  170. package/src/global.scss +18 -2
  171. package/src/index.ts +4 -0
  172. package/src/pages/react-miui.tsx +12 -0
  173. package/src/types.ts +1 -1
  174. package/dist/demo/Demo.d.ts +0 -4
  175. package/dist/demo/Demo.d.ts.map +0 -1
  176. package/dist/demo/Demo.js +0 -18
  177. package/dist/demo/Demo.js.map +0 -1
  178. package/dist/demo/Demo.module.scss +0 -4
  179. package/dist/demo/Main.d.ts +0 -4
  180. package/dist/demo/Main.d.ts.map +0 -1
  181. package/dist/demo/Main.js +0 -83
  182. package/dist/demo/Main.js.map +0 -1
  183. package/dist/demo/Main.module.scss +0 -30
  184. package/dist/demo/Menu.d.ts +0 -9
  185. package/dist/demo/Menu.d.ts.map +0 -1
  186. package/dist/demo/Menu.js +0 -31
  187. package/dist/demo/Menu.js.map +0 -1
  188. package/dist/demo/Menu.module.scss +0 -39
  189. package/dist/demo/components/form/Checkbox.d.ts +0 -4
  190. package/dist/demo/components/form/Checkbox.d.ts.map +0 -1
  191. package/dist/demo/components/form/Checkbox.js.map +0 -1
  192. package/dist/demo/components/layout/header/Header.d.ts +0 -4
  193. package/dist/demo/components/layout/header/Header.d.ts.map +0 -1
  194. package/dist/demo/components/layout/header/Header.js +0 -16
  195. package/dist/demo/components/layout/header/Header.js.map +0 -1
  196. package/dist/demo/components/layout/header/StickyHeader.d.ts +0 -9
  197. package/dist/demo/components/layout/header/StickyHeader.d.ts.map +0 -1
  198. package/dist/demo/components/layout/header/StickyHeader.js +0 -73
  199. package/dist/demo/components/layout/header/StickyHeader.js.map +0 -1
  200. package/dist/demo/components/layout/list/List.Item.d.ts +0 -4
  201. package/dist/demo/components/layout/list/List.Item.d.ts.map +0 -1
  202. package/dist/demo/components/layout/list/List.Item.js +0 -42
  203. package/dist/demo/components/layout/list/List.Item.js.map +0 -1
  204. package/dist/demo/components/layout/list/List.Item.module.scss +0 -3
  205. package/dist/demo/components/ui/action/Action.d.ts +0 -8
  206. package/dist/demo/components/ui/action/Action.d.ts.map +0 -1
  207. package/dist/demo/components/ui/action/Action.js +0 -83
  208. package/dist/demo/components/ui/action/Action.js.map +0 -1
  209. package/dist/demo/components/ui/action/ActionDemo.module.scss +0 -3
  210. package/dist/demo/components/ui/button/ButtonDemo.d.ts +0 -4
  211. package/dist/demo/components/ui/button/ButtonDemo.d.ts.map +0 -1
  212. package/dist/demo/components/ui/button/ButtonDemo.js +0 -20
  213. package/dist/demo/components/ui/button/ButtonDemo.js.map +0 -1
  214. package/dist/demo/components/ui/directionPad/Pad.d.ts +0 -4
  215. package/dist/demo/components/ui/directionPad/Pad.d.ts.map +0 -1
  216. package/dist/demo/components/ui/directionPad/Pad.js +0 -49
  217. package/dist/demo/components/ui/directionPad/Pad.js.map +0 -1
  218. package/dist/demo/components/ui/icons/Icons.d.ts +0 -4
  219. package/dist/demo/components/ui/icons/Icons.d.ts.map +0 -1
  220. package/dist/demo/components/ui/icons/Icons.js +0 -20
  221. package/dist/demo/components/ui/icons/Icons.js.map +0 -1
  222. package/dist/demo/componentsMap.d.ts +0 -13
  223. package/dist/demo/componentsMap.d.ts.map +0 -1
  224. package/dist/demo/componentsMap.js +0 -87
  225. package/dist/demo/componentsMap.js.map +0 -1
  226. package/dist/demo/utils/makeVariants.d.ts +0 -3
  227. package/dist/demo/utils/makeVariants.d.ts.map +0 -1
  228. package/dist/demo/utils/makeVariants.js +0 -14
  229. package/dist/demo/utils/makeVariants.js.map +0 -1
  230. package/dist/demo/utils/safeUseHash.d.ts +0 -3
  231. package/dist/demo/utils/safeUseHash.d.ts.map +0 -1
  232. package/dist/demo/utils/safeUseHash.js +0 -13
  233. package/dist/demo/utils/safeUseHash.js.map +0 -1
  234. package/dist/demo-global.scss +0 -9
  235. package/dist/pages/_app.d.ts +0 -7
  236. package/dist/pages/_app.d.ts.map +0 -1
  237. package/dist/pages/_app.js +0 -15
  238. package/dist/pages/_app.js.map +0 -1
  239. package/dist/pages/index.d.ts +0 -4
  240. package/dist/pages/index.d.ts.map +0 -1
  241. package/dist/pages/index.js +0 -10
  242. package/dist/pages/index.js.map +0 -1
  243. package/esm/demo/Demo.d.ts +0 -4
  244. package/esm/demo/Demo.d.ts.map +0 -1
  245. package/esm/demo/Demo.js +0 -12
  246. package/esm/demo/Demo.js.map +0 -1
  247. package/esm/demo/Demo.module.scss +0 -4
  248. package/esm/demo/Main.d.ts +0 -4
  249. package/esm/demo/Main.d.ts.map +0 -1
  250. package/esm/demo/Main.js +0 -58
  251. package/esm/demo/Main.js.map +0 -1
  252. package/esm/demo/Main.module.scss +0 -30
  253. package/esm/demo/Menu.d.ts +0 -9
  254. package/esm/demo/Menu.d.ts.map +0 -1
  255. package/esm/demo/Menu.js +0 -25
  256. package/esm/demo/Menu.js.map +0 -1
  257. package/esm/demo/Menu.module.scss +0 -39
  258. package/esm/demo/components/form/Checkbox.d.ts +0 -4
  259. package/esm/demo/components/form/Checkbox.d.ts.map +0 -1
  260. package/esm/demo/components/form/Checkbox.js +0 -9
  261. package/esm/demo/components/form/Checkbox.js.map +0 -1
  262. package/esm/demo/components/layout/header/Header.d.ts +0 -4
  263. package/esm/demo/components/layout/header/Header.d.ts.map +0 -1
  264. package/esm/demo/components/layout/header/Header.js +0 -10
  265. package/esm/demo/components/layout/header/Header.js.map +0 -1
  266. package/esm/demo/components/layout/header/StickyHeader.d.ts +0 -9
  267. package/esm/demo/components/layout/header/StickyHeader.d.ts.map +0 -1
  268. package/esm/demo/components/layout/header/StickyHeader.js +0 -62
  269. package/esm/demo/components/layout/header/StickyHeader.js.map +0 -1
  270. package/esm/demo/components/layout/list/List.Item.d.ts +0 -4
  271. package/esm/demo/components/layout/list/List.Item.d.ts.map +0 -1
  272. package/esm/demo/components/layout/list/List.Item.js +0 -17
  273. package/esm/demo/components/layout/list/List.Item.js.map +0 -1
  274. package/esm/demo/components/layout/list/List.Item.module.scss +0 -3
  275. package/esm/demo/components/ui/action/Action.d.ts +0 -8
  276. package/esm/demo/components/ui/action/Action.d.ts.map +0 -1
  277. package/esm/demo/components/ui/action/Action.js +0 -73
  278. package/esm/demo/components/ui/action/Action.js.map +0 -1
  279. package/esm/demo/components/ui/action/ActionDemo.module.scss +0 -3
  280. package/esm/demo/components/ui/button/ButtonDemo.d.ts +0 -4
  281. package/esm/demo/components/ui/button/ButtonDemo.d.ts.map +0 -1
  282. package/esm/demo/components/ui/button/ButtonDemo.js +0 -14
  283. package/esm/demo/components/ui/button/ButtonDemo.js.map +0 -1
  284. package/esm/demo/components/ui/directionPad/Pad.d.ts +0 -4
  285. package/esm/demo/components/ui/directionPad/Pad.d.ts.map +0 -1
  286. package/esm/demo/components/ui/directionPad/Pad.js +0 -27
  287. package/esm/demo/components/ui/directionPad/Pad.js.map +0 -1
  288. package/esm/demo/components/ui/icons/Icons.d.ts +0 -4
  289. package/esm/demo/components/ui/icons/Icons.d.ts.map +0 -1
  290. package/esm/demo/components/ui/icons/Icons.js +0 -14
  291. package/esm/demo/components/ui/icons/Icons.js.map +0 -1
  292. package/esm/demo/componentsMap.d.ts +0 -13
  293. package/esm/demo/componentsMap.d.ts.map +0 -1
  294. package/esm/demo/componentsMap.js +0 -84
  295. package/esm/demo/componentsMap.js.map +0 -1
  296. package/esm/demo/utils/makeVariants.d.ts +0 -3
  297. package/esm/demo/utils/makeVariants.d.ts.map +0 -1
  298. package/esm/demo/utils/makeVariants.js +0 -11
  299. package/esm/demo/utils/makeVariants.js.map +0 -1
  300. package/esm/demo/utils/safeUseHash.d.ts +0 -3
  301. package/esm/demo/utils/safeUseHash.d.ts.map +0 -1
  302. package/esm/demo/utils/safeUseHash.js +0 -10
  303. package/esm/demo/utils/safeUseHash.js.map +0 -1
  304. package/esm/demo-global.scss +0 -9
  305. package/esm/pages/_app.d.ts +0 -7
  306. package/esm/pages/_app.d.ts.map +0 -1
  307. package/esm/pages/_app.js +0 -10
  308. package/esm/pages/_app.js.map +0 -1
  309. package/esm/pages/index.d.ts +0 -4
  310. package/esm/pages/index.d.ts.map +0 -1
  311. package/esm/pages/index.js +0 -5
  312. package/esm/pages/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"EqualActions.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/action/EqualActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAiBzB,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"EqualActions.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/action/EqualActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,KAAK;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAiBjC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,16 +1,17 @@
1
1
  import React from "react";
2
2
  import { Action } from "./Action";
3
3
  import styles from "./EqualActions.module.scss";
4
+ import classnames from "classnames";
4
5
  const EqualActions = (props) => {
5
6
  React.Children.forEach(props.children, (child) => {
6
7
  if (!child || typeof child !== "object" || !("type" in child) || child.type !== Action) {
7
- throw new TypeError("Every child of Actions must be an Action component");
8
+ throw new TypeError("Every child of EqualActions must be an Action component");
8
9
  }
9
10
  });
10
11
  const style = {
11
12
  "--actions-count": React.Children.count(props.children),
12
13
  };
13
- return (React.createElement("div", { className: styles.actions, style: style }, props.children));
14
+ return (React.createElement("div", { className: classnames(styles.actions, props.className), style: style }, props.children));
14
15
  };
15
16
  export { EqualActions };
16
17
  //# sourceMappingURL=EqualActions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EqualActions.js","sourceRoot":"","sources":["../../../../src/components/ui/action/EqualActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAEhD,MAAM,YAAY,GAAa,CAAC,KAAK,EAAE,EAAE;IACrC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;QAC7C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE;YACpF,MAAM,IAAI,SAAS,CAAC,oDAAoD,CAAC,CAAC;SAC7E;IACL,CAAC,CAAC,CAAC;IAGH,MAAM,KAAK,GAAG;QACV,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;KACnC,CAAC;IAEzB,OAAO,CACH,6BAAK,SAAS,EAAE,MAAM,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,IACvC,KAAK,CAAC,QAAQ,CACb,CACT,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"EqualActions.js","sourceRoot":"","sources":["../../../../src/components/ui/action/EqualActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,MAAM,MAAM,4BAA4B,CAAC;AAChD,OAAO,UAAU,MAAM,YAAY,CAAC;AAMpC,MAAM,YAAY,GAAoB,CAAC,KAAK,EAAE,EAAE;IAC5C,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;QAC7C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM,EAAE;YACpF,MAAM,IAAI,SAAS,CAAC,yDAAyD,CAAC,CAAC;SAClF;IACL,CAAC,CAAC,CAAC;IAGH,MAAM,KAAK,GAAG;QACV,iBAAiB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;KACnC,CAAC;IAEzB,OAAO,CACH,6BAAK,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,IACpE,KAAK,CAAC,QAAQ,CACb,CACT,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
package/esm/global.scss CHANGED
@@ -10,6 +10,9 @@
10
10
  --active-bg: #d3d3d3;
11
11
  --inactive-bg: #d3d3d3; // used
12
12
 
13
+ --toggle-handle-bg: #e0e0e0;
14
+ --toggle-handle-border: #cdcdcd;
15
+
13
16
  --icon: #636363;
14
17
  --border: #d5d5d5;
15
18
  --button-border: #bababa;
@@ -17,13 +20,16 @@
17
20
  --header-border: #c8c8c9;
18
21
  --header-bg: #efeff0;
19
22
  --header-text: #484848;
23
+ --text: #323232;
24
+ --sub: #959595;
20
25
 
21
26
  --toolbar-border: #ababab;
22
- --toolbarf-bg: #f8f8f8;
27
+ --toolbar-bg: #f8f8f8;
23
28
 
24
29
  // Shades: https://maketintsandshades.com/#038bf4,ff7200,7357e8,3ec234,3ec234,ff388f,ea2700
25
30
  --blue1: #038bf4;
26
31
  --orange1: #ff7200;
32
+ --orange1-darker: #cc5b00;
27
33
  --purple1: #7357e8;
28
34
  --green1: #3ec234;
29
35
  --green1-darker: #38af2f;
@@ -31,12 +37,22 @@
31
37
  --red1: #ea2700;
32
38
 
33
39
  --grey1: #737373;
40
+
41
+ --focus-color: #dcaf00;
42
+ }
43
+
44
+ *:focus {
45
+ outline: none!important;
34
46
  }
35
47
 
36
- *:focus { // @TODO take care of focus
48
+ *:focus-visible:focus-visible {
37
49
  outline: none!important;
50
+ border-color: var(--focus-color);
51
+ background-color: var(--focus-bg-set);
38
52
  }
39
53
 
54
+
40
55
  body {
41
56
  font-size: 15px;
57
+ color: var(--text);
42
58
  }
package/esm/index.d.ts CHANGED
@@ -1,9 +1,13 @@
1
1
  export * from "./components/form/Checkbox.js";
2
+ export * from "./components/form/Toggle.js";
2
3
  export * from "./components/icons/Icon.js";
3
4
  export * from "./components/layout/header/Header.js";
5
+ export * from "./components/layout/header/HeaderIconAction.js";
4
6
  export * from "./components/layout/header/StickyHeader.js";
5
7
  export * from "./components/layout/list/List.js";
6
8
  export * from "./components/layout/list/Item.js";
9
+ export * from "./components/ui/action/Action.js";
10
+ export * from "./components/ui/action/EqualActions.js";
7
11
  export * from "./components/ui/button/Button.js";
8
12
  export * from "./components/ui/directionPad/Pad.js";
9
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAE9C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC"}
package/esm/index.js CHANGED
@@ -1,9 +1,13 @@
1
1
  export * from "./components/form/Checkbox.js";
2
+ export * from "./components/form/Toggle.js";
2
3
  export * from "./components/icons/Icon.js";
3
4
  export * from "./components/layout/header/Header.js";
5
+ export * from "./components/layout/header/HeaderIconAction.js";
4
6
  export * from "./components/layout/header/StickyHeader.js";
5
7
  export * from "./components/layout/list/List.js";
6
8
  export * from "./components/layout/list/Item.js";
9
+ export * from "./components/ui/action/Action.js";
10
+ export * from "./components/ui/action/EqualActions.js";
7
11
  export * from "./components/ui/button/Button.js";
8
12
  export * from "./components/ui/directionPad/Pad.js";
9
13
  //# sourceMappingURL=index.js.map
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAE9C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AAEjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC"}
package/esm/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import type React from "react";
2
- declare type AnyComponent = React.ComponentClass | React.FC;
2
+ declare type AnyComponent = React.ComponentClass | React.FC | React.VFC;
3
3
  export type { AnyComponent, };
4
4
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,aAAK,YAAY,GAAG,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,EAAE,CAAC;AAEpD,YAAY,EACR,YAAY,GACf,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,aAAK,YAAY,GAAG,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC;AAEhE,YAAY,EACR,YAAY,GACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-miui",
3
- "version": "0.1.0",
3
+ "version": "0.4.1",
4
4
  "author": "Jacek Nowacki",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -0,0 +1,46 @@
1
+ .container {
2
+ --ratio-dimensions: 2.5;
3
+
4
+ display: inline-flex;
5
+ align-items: center;
6
+ border: 1px solid #ccc;
7
+ border-radius: 100px;
8
+ position: relative;
9
+ line-height: 0;
10
+ width: calc(110px / var(--ratio-dimensions));
11
+ height: calc(62px / var(--ratio-dimensions));
12
+ padding-left: calc(8px / var(--ratio-dimensions));
13
+ box-sizing: border-box;
14
+
15
+ input {
16
+ position: absolute;
17
+ width: 0;
18
+ height: 0;
19
+ overflow: hidden;
20
+ visibility: hidden;
21
+
22
+ &:not(:checked) + .toggle {
23
+ transform: translateX(0);
24
+ background: var(--toggle-handle-bg);
25
+ border-color: var(--toggle-handle-border);
26
+ }
27
+
28
+ &[data-undetermined=true] + .toggle {
29
+ transform: translateX(calc(24px / var(--ratio-dimensions)));
30
+ background: var(--toggle-handle-border);
31
+ border-color: var(--toggle-handle-border);
32
+ }
33
+ }
34
+ }
35
+
36
+ .toggle {
37
+ box-sizing: border-box;
38
+ border-radius: 100px;
39
+ display: inline-block;
40
+ width: calc(44px / var(--ratio-dimensions));
41
+ height: calc(44px / var(--ratio-dimensions));
42
+ border: calc(1px / var(--ratio-border)) solid var(--orange1-darker);
43
+ background: var(--orange1);
44
+ transition: transform 200ms, background-color 200ms, border-color 200ms;
45
+ transform: translateX(calc(48px / var(--ratio-dimensions)));
46
+ }
@@ -0,0 +1,33 @@
1
+ import type { ChangeEvent } from "react";
2
+ import React, { useCallback } from "react";
3
+
4
+ import styles from "./Toggle.module.scss";
5
+
6
+ interface Props {
7
+ onChange: (newState: boolean) => void;
8
+ state: boolean | null;
9
+ }
10
+
11
+ const Toggle: React.VFC<Props> = (props) => {
12
+ const handleChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {
13
+ if (props.state == null) {
14
+ return;
15
+ }
16
+ props.onChange(e.target.checked);
17
+ }, [props.onChange, props.state]);
18
+
19
+ return (
20
+ <label className={styles.container}>
21
+ <input
22
+ type={"checkbox"}
23
+ checked={Boolean(props.state)}
24
+ data-undetermined={props.state == null}
25
+ readOnly={props.state == null}
26
+ onChange={handleChange}
27
+ />
28
+ <div className={styles.toggle} />
29
+ </label>
30
+ );
31
+ };
32
+
33
+ export { Toggle };
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+
3
+ interface Props {
4
+ className?: string;
5
+ }
6
+
7
+ const Back: React.VFC<Props> = (props) => {
8
+ return (
9
+ <svg
10
+ width={"9"}
11
+ height={"16"}
12
+ viewBox={"0 0 9 16"}
13
+ xmlns={"http://www.w3.org/2000/svg"}
14
+ className={props.className}
15
+ >
16
+ <path fill={"currentColor"} d={"M8.05.1L0 7.95l8.05 7.85v.05q.15.15.4.15t.4-.15q.15-.2.15-.4 0-.25-.15-.4V15H8.8L1.65 7.95l7.2-7Q9 .75 9 .55q0-.25-.2-.4Q8.65 0 8.4 0q-.2 0-.35.1"} />
17
+ </svg>
18
+ );
19
+ };
20
+
21
+ export { Back };
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+
3
+ interface Props {
4
+ className?: string;
5
+ }
6
+
7
+ const Forward: React.VFC<Props> = (props) => {
8
+ return (
9
+ <svg
10
+ width={"9"}
11
+ height={"16"}
12
+ viewBox={"0 0 9 16"}
13
+ xmlns={"http://www.w3.org/2000/svg"}
14
+ className={props.className}
15
+ >
16
+ <path fill={"currentColor"} d={"M.95.15Q.8 0 .55 0t-.4.15Q0 .3 0 .55t.15.4L7.35 8l-7.2 7.05Q0 15.2 0 15.4q0 .25.2.4.15.2.4.2.2 0 .35-.15L9 8 1 .2Q1 .15.95.15"} />
17
+ </svg>
18
+ );
19
+ };
20
+
21
+ export { Forward };
@@ -1,20 +1,25 @@
1
- import type { AnyComponent } from "../../types";
2
-
3
1
  import React from "react";
2
+
3
+ import type { AnyComponent } from "../../types";
4
4
  import { Checkmark } from "./Checkmark";
5
+ import { Back } from "./Back";
6
+ import { Forward } from "./Forward";
5
7
 
6
8
  enum ICON {
7
9
  checkmark = "checkmark",
10
+ back = "back",
11
+ forward = "forward",
8
12
  }
9
13
 
10
14
  interface Props {
11
15
  name: ICON;
16
+ className?: string;
12
17
  }
13
18
 
14
19
  const iconsMap = new Map<ICON, AnyComponent>([
15
- [
16
- ICON.checkmark, Checkmark,
17
- ],
20
+ [ICON.checkmark, Checkmark],
21
+ [ICON.back, Back],
22
+ [ICON.forward, Forward],
18
23
  ]);
19
24
 
20
25
  const Icon: React.FC<Props> = ({ name: iconName, ...props }) => {
@@ -16,13 +16,18 @@
16
16
  }
17
17
 
18
18
  .header--top, .header--bottom {
19
- padding: 13px 16.666px;
19
+ padding: 0 16.666px;
20
20
  min-height: 44px;
21
21
  }
22
22
  .header--left, .header--right {
23
- padding: 16.666px 13px;
23
+ padding: 16.666px 0;
24
24
  min-width: 44px;
25
25
  flex-direction: column;
26
+
27
+ > .contents {
28
+ flex-direction: column;
29
+ align-items: center;
30
+ }
26
31
  }
27
32
 
28
33
  .header--top {
@@ -40,6 +45,45 @@
40
45
  order: 2;
41
46
  }
42
47
 
43
- .header--center {
48
+ .contents {
49
+ flex: 1;
50
+ display: flex;
51
+ }
52
+
53
+ .header--center > .contents {
44
54
  justify-content: center;
45
55
  }
56
+
57
+ .header--top, .header--bottom {
58
+ .before {
59
+ margin-right: calc(50px / var(--ratio-dimensions));
60
+ }
61
+
62
+ .after {
63
+ margin-left: calc(50px / var(--ratio-dimensions));
64
+ }
65
+
66
+ .actions {
67
+ margin: calc(56px / var(--ratio-dimensions)) 0;
68
+ }
69
+ }
70
+
71
+ .header--left, .header--right {
72
+ .before {
73
+ margin-bottom: calc(50px / var(--ratio-dimensions));
74
+ flex-direction: column;
75
+ }
76
+
77
+ .after {
78
+ margin-top: calc(50px / var(--ratio-dimensions));
79
+ flex-direction: column;
80
+ }
81
+
82
+ .actions {
83
+ margin: 0 calc(56px / var(--ratio-dimensions));
84
+ }
85
+ }
86
+
87
+ .before, .after {
88
+ display: flex;
89
+ }
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import classnames from "classnames";
3
+ import type { ReactNode } from "react";
3
4
 
4
5
  import styles from "./Header.module.scss";
5
6
  import { Action } from "../../ui/action/Action";
@@ -8,10 +9,17 @@ import { EqualActions } from "../../ui/action/EqualActions";
8
9
  interface Props {
9
10
  center?: boolean;
10
11
  variant?: "toolbar";
11
- position?: "top" | "left" | "right" | "bottom";
12
+ /**
13
+ * This indicates just how the borders are drawn and how content is aligned, not the actual position on the screen.
14
+ * To set up position on the screen you need to properly style parent element.
15
+ */
16
+ position?: "top" | "left" | "right" | "bottom"; // @TODO disallow left/right if not inside StickyHeader?
12
17
  className?: string;
18
+ before?: ReactNode;
19
+ after?: ReactNode;
13
20
  }
14
21
 
22
+ // eslint-disable-next-line max-statements
15
23
  const Header: React.FC<Props> = (props) => {
16
24
  const { center, children, variant, position = "top" } = props;
17
25
 
@@ -30,12 +38,26 @@ const Header: React.FC<Props> = (props) => {
30
38
 
31
39
  let contents = children;
32
40
  if (justActions) {
33
- contents = <EqualActions>{contents}</EqualActions>;
41
+ contents = <EqualActions className={styles.actions}>{contents}</EqualActions>;
42
+ }
43
+
44
+ let before: ReactNode;
45
+ if (props.before != null) {
46
+ before = <div className={styles.before}>{props.before}</div>;
47
+ }
48
+
49
+ let after: ReactNode;
50
+ if (props.after != null) {
51
+ after = <div className={styles.after}>{props.after}</div>;
34
52
  }
35
53
 
36
54
  return (
37
55
  <div className={cls}>
38
- {contents}
56
+ {before}
57
+ <div className={styles.contents}>
58
+ {contents}
59
+ </div>
60
+ {after}
39
61
  </div>
40
62
  );
41
63
  };
@@ -0,0 +1,22 @@
1
+ .btn, .a {
2
+ padding: 7px;
3
+ background: none;
4
+ border-radius: 666px;
5
+ display: inline-block;
6
+ border: calc(2px / var(--ratio-border)) solid transparent;
7
+ color: var(--header-text);
8
+
9
+ &:hover {
10
+ background: #00000022;
11
+ }
12
+ &:active {
13
+ background: #00000011;
14
+ color: currentColor;
15
+ }
16
+ }
17
+
18
+ .icon {
19
+ width: 16px;
20
+ height: 16px;
21
+ display: block;
22
+ }
@@ -0,0 +1,49 @@
1
+ import React from "react";
2
+ import type { ReactNode } from "react";
3
+
4
+ import type { ICON } from "../../icons/Icon";
5
+ import { Icon } from "../../icons/Icon";
6
+ import styles from "./HeaderIconAction.module.scss";
7
+
8
+ interface LinkProps { // @TODO extract? - same on list item
9
+ href: string;
10
+ }
11
+
12
+ interface Props {
13
+ icon?: ICON | Exclude<ReactNode, string>;
14
+ onClick?: () => void;
15
+ href?: string;
16
+ to?: string;
17
+ Link?: React.ComponentClass<LinkProps> | React.FC<LinkProps>;
18
+ label?: ReactNode;
19
+ // if className ever goes here make sure that `a` gets classnames merged
20
+ }
21
+
22
+ const HeaderIconAction: React.VFC<Props> = (props) => {
23
+ const { icon, label, href, to, Link, ...restProps } = props;
24
+
25
+ let content: ReactNode = icon;
26
+ if (typeof icon === "string") {
27
+ content = <Icon className={styles.icon} name={icon as ICON} />;
28
+ }
29
+
30
+ if (to) {
31
+ if (!Link) {
32
+ throw new TypeError("`to` prop given without `Link` component");
33
+ }
34
+
35
+ return <Link href={to} {...restProps}><a className={styles.a}>{content}</a></Link>;
36
+ }
37
+
38
+ if (href) {
39
+ return <a href={href} className={styles.a} {...restProps}>{content}</a>;
40
+ }
41
+
42
+ return (
43
+ <button className={styles.btn} onClick={props.onClick}>
44
+ {content}
45
+ </button>
46
+ );
47
+ };
48
+
49
+ export { HeaderIconAction };
@@ -0,0 +1,8 @@
1
+ .header > * {
2
+ padding-top: calc(80px / var(--ratio-dimensions));
3
+ padding-bottom: calc(40px / var(--ratio-dimensions));
4
+
5
+ font-size: calc(26px / var(--ratio-font));
6
+ color: var(--sub);
7
+ text-transform: uppercase;
8
+ }
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import classnames from "classnames";
3
+
4
+ import styles from "./Item.module.scss";
5
+ import headerStyles from "./Header.module.scss";
6
+
7
+ const Header: React.FC = (props) => {
8
+ // @TODO way to use h1, h2, h3 instead of div
9
+ return (
10
+ <li className={classnames(styles.item, headerStyles.header)}>
11
+ <div>{props.children}</div>
12
+ </li>
13
+ );
14
+ };
15
+
16
+ export { Header };
@@ -2,7 +2,7 @@
2
2
  list-style-type: none;
3
3
  margin: 0;
4
4
  padding: 0;
5
- font-size: 15px;
5
+ font-size: calc(34px / var(--ratio-font));
6
6
 
7
7
  &:not(:first-child) > * {
8
8
  border-top: 0.37px solid var(--header-border);
@@ -10,7 +10,7 @@
10
10
 
11
11
  > * {
12
12
  display: block;
13
- padding: 20px 0;
13
+ padding: 0;
14
14
  text-decoration: none;
15
15
  }
16
16
  }
@@ -20,4 +20,12 @@
20
20
  background: none;
21
21
  width: 100%;
22
22
  text-align: left;
23
+ font-family: inherit;
24
+ font-size: inherit;
25
+ }
26
+
27
+ .content {
28
+ display: flex;
29
+ min-height: calc(174px / var(--ratio-dimensions));
30
+ align-items: center;
23
31
  }
@@ -2,6 +2,8 @@ import React from "react";
2
2
  import classnames from "classnames";
3
3
 
4
4
  import styles from "./Item.module.scss";
5
+ import { Value } from "./Value";
6
+ import { Label } from "./Label";
5
7
 
6
8
  interface LinkProps {
7
9
  href: string;
@@ -13,38 +15,63 @@ interface Props {
13
15
  onClick?: () => void;
14
16
  className?: string;
15
17
  Link?: React.ComponentClass<LinkProps> | React.FC<LinkProps>;
18
+ ratio?: string; // @TODO number/number/number/.. type?
16
19
  }
17
20
 
18
- const Item: React.FC<Props> = (props) => {
19
- const { className, children, href, to, onClick, Link, ...restProps } = props;
21
+ interface SubComponents {
22
+ Label: typeof Label;
23
+ Value: typeof Value;
24
+ }
25
+
26
+ // eslint-disable-next-line max-statements
27
+ const Item: React.FC<Props> & SubComponents = (props) => {
28
+ const { className, children, href, to, onClick, Link, ratio, ...restProps } = props;
20
29
  const cls = classnames(styles.item, className);
21
30
 
22
31
  const liProps = {
23
32
  className: cls,
24
33
  };
25
34
 
35
+ const r = ratio ? ratio.split("/") : [];
36
+
37
+ const ren = React.Children.map(props.children, (child, index) => {
38
+ let flex = undefined;
39
+ if (!r.length && child && typeof child === "object" && "type" in child && child.type === Value) {
40
+ return child;
41
+ }
42
+ if (index in r) {
43
+ flex = r[index];
44
+ }
45
+ return <div style={{ flex }}>{child}</div>;
46
+ });
47
+
26
48
  if (to) {
27
49
  if (!Link) {
28
50
  throw new TypeError("`to` prop given without `Link` component");
29
51
  }
30
52
 
31
- return <li {...liProps}><Link href={to} {...restProps}>{children}</Link></li>;
53
+ return <li {...liProps}><Link href={to} {...restProps}><a className={styles.content}>{ren}</a></Link></li>;
32
54
  }
33
55
  if (href) {
34
56
  const aProps: typeof restProps & { onClick?: Props["onClick"]} = { ...restProps };
35
57
  if (onClick) {
36
58
  aProps.onClick = onClick;
37
59
  }
38
- return <li {...liProps}><a href={href} {...aProps}>{children}</a></li>;
60
+ return <li {...liProps}><a href={href} {...aProps} className={styles.content}>{ren}</a></li>;
39
61
  }
40
62
  if (onClick) {
41
63
  return (
42
64
  <li {...liProps}>
43
- <button className={styles.button} onClick={props.onClick} {...restProps}>{children}</button>
65
+ <button className={classnames(styles.button, styles.content)} onClick={props.onClick}{...restProps}>
66
+ {ren}
67
+ </button>
44
68
  </li>
45
69
  );
46
70
  }
47
- return <li {...liProps}><div {...restProps}>{children}</div></li>;
71
+ return <li {...liProps}><div {...restProps} className={styles.content}>{ren}</div></li>;
48
72
  };
49
73
 
74
+ Item.Label = Label;
75
+ Item.Value = Value;
76
+
50
77
  export { Item };
@@ -0,0 +1,9 @@
1
+ .sub {
2
+ font-size: calc(27px / var(--ratio-font));
3
+ color: var(--sub);
4
+ margin-top: calc(27px / var(--ratio-font) / 3);
5
+ }
6
+
7
+ .root {
8
+ padding: calc(54px / var(--ratio-dimensions)) 0;
9
+ }
@@ -0,0 +1,21 @@
1
+ import React from "react";
2
+ import type { ReactNode } from "react";
3
+
4
+ import styles from "./Label.module.scss";
5
+
6
+ interface Props {
7
+ sub?: ReactNode;
8
+ }
9
+
10
+ const Label: React.FC<Props> = (props) => {
11
+ const sub = props.sub ? <div className={styles.sub}>{props.sub}</div> : null;
12
+
13
+ return (
14
+ <div className={styles.root}>
15
+ <div>{props.children}</div>
16
+ {sub}
17
+ </div>
18
+ );
19
+ };
20
+
21
+ export { Label };