react-miui 0.5.2 → 0.6.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 (138) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/assets/sources/battery.fla +0 -0
  3. package/assets/sources/search.fla +0 -0
  4. package/dist/components/form/Input.d.ts +9 -0
  5. package/dist/components/form/Input.d.ts.map +1 -0
  6. package/dist/components/form/Input.js +62 -0
  7. package/dist/components/form/Input.js.map +1 -0
  8. package/dist/components/form/Input.module.scss +39 -0
  9. package/dist/components/form/Label.d.ts +8 -0
  10. package/dist/components/form/Label.d.ts.map +1 -0
  11. package/dist/components/form/Label.js +22 -0
  12. package/dist/components/form/Label.js.map +1 -0
  13. package/dist/components/form/Label.module.scss +15 -0
  14. package/dist/components/form/Toggle.d.ts +1 -1
  15. package/dist/components/form/Toggle.d.ts.map +1 -1
  16. package/dist/components/form/Toggle.js.map +1 -1
  17. package/dist/components/icons/Back.d.ts +1 -1
  18. package/dist/components/icons/Back.d.ts.map +1 -1
  19. package/dist/components/icons/Back.js.map +1 -1
  20. package/dist/components/icons/Battery.d.ts +7 -0
  21. package/dist/components/icons/Battery.d.ts.map +1 -0
  22. package/dist/components/icons/Battery.js +14 -0
  23. package/dist/components/icons/Battery.js.map +1 -0
  24. package/dist/components/icons/Forward.d.ts +1 -1
  25. package/dist/components/icons/Forward.d.ts.map +1 -1
  26. package/dist/components/icons/Forward.js.map +1 -1
  27. package/dist/components/icons/Icon.d.ts +3 -1
  28. package/dist/components/icons/Icon.d.ts.map +1 -1
  29. package/dist/components/icons/Icon.js +6 -0
  30. package/dist/components/icons/Icon.js.map +1 -1
  31. package/dist/components/icons/Search.d.ts +7 -0
  32. package/dist/components/icons/Search.d.ts.map +1 -0
  33. package/dist/components/icons/Search.js +13 -0
  34. package/dist/components/icons/Search.js.map +1 -0
  35. package/dist/components/layout/header/HeaderIconAction.d.ts +1 -1
  36. package/dist/components/layout/header/HeaderIconAction.d.ts.map +1 -1
  37. package/dist/components/layout/header/HeaderIconAction.js.map +1 -1
  38. package/dist/components/layout/section/SearchContainer.d.ts +4 -0
  39. package/dist/components/layout/section/SearchContainer.d.ts.map +1 -0
  40. package/dist/components/layout/section/SearchContainer.js +13 -0
  41. package/dist/components/layout/section/SearchContainer.js.map +1 -0
  42. package/dist/components/layout/section/SearchContainer.module.scss +3 -0
  43. package/dist/components/layout/section/Section.module.scss +7 -0
  44. package/dist/components/ui/action/Action.d.ts +1 -1
  45. package/dist/components/ui/action/Action.d.ts.map +1 -1
  46. package/dist/components/ui/action/Action.js.map +1 -1
  47. package/dist/global.scss +1 -0
  48. package/dist/index.d.ts +3 -0
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +3 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/types.d.ts +1 -1
  53. package/dist/types.d.ts.map +1 -1
  54. package/docs/assets/js/search.js +1 -1
  55. package/docs/assets/js/search.json +1 -1
  56. package/docs/enums/ICON.html +43 -6
  57. package/docs/index.html +13 -4
  58. package/docs/modules/Item.html +3 -3
  59. package/docs/modules/List.html +3 -3
  60. package/docs/modules/Section.html +3 -3
  61. package/docs/modules/StickyHeader.html +4 -4
  62. package/docs/modules.html +63 -21
  63. package/docs/pages/Tutorials/Test.html +3 -3
  64. package/esm/components/form/Input.d.ts +9 -0
  65. package/esm/components/form/Input.d.ts.map +1 -0
  66. package/esm/components/form/Input.js +25 -0
  67. package/esm/components/form/Input.js.map +1 -0
  68. package/esm/components/form/Input.module.scss +39 -0
  69. package/esm/components/form/Label.d.ts +8 -0
  70. package/esm/components/form/Label.d.ts.map +1 -0
  71. package/esm/components/form/Label.js +16 -0
  72. package/esm/components/form/Label.js.map +1 -0
  73. package/esm/components/form/Label.module.scss +15 -0
  74. package/esm/components/form/Toggle.d.ts +1 -1
  75. package/esm/components/form/Toggle.d.ts.map +1 -1
  76. package/esm/components/form/Toggle.js.map +1 -1
  77. package/esm/components/icons/Back.d.ts +1 -1
  78. package/esm/components/icons/Back.d.ts.map +1 -1
  79. package/esm/components/icons/Back.js.map +1 -1
  80. package/esm/components/icons/Battery.d.ts +7 -0
  81. package/esm/components/icons/Battery.d.ts.map +1 -0
  82. package/esm/components/icons/Battery.js +8 -0
  83. package/esm/components/icons/Battery.js.map +1 -0
  84. package/esm/components/icons/Forward.d.ts +1 -1
  85. package/esm/components/icons/Forward.d.ts.map +1 -1
  86. package/esm/components/icons/Forward.js.map +1 -1
  87. package/esm/components/icons/Icon.d.ts +3 -1
  88. package/esm/components/icons/Icon.d.ts.map +1 -1
  89. package/esm/components/icons/Icon.js +6 -0
  90. package/esm/components/icons/Icon.js.map +1 -1
  91. package/esm/components/icons/Search.d.ts +7 -0
  92. package/esm/components/icons/Search.d.ts.map +1 -0
  93. package/esm/components/icons/Search.js +7 -0
  94. package/esm/components/icons/Search.js.map +1 -0
  95. package/esm/components/layout/header/HeaderIconAction.d.ts +1 -1
  96. package/esm/components/layout/header/HeaderIconAction.d.ts.map +1 -1
  97. package/esm/components/layout/header/HeaderIconAction.js.map +1 -1
  98. package/esm/components/layout/section/SearchContainer.d.ts +4 -0
  99. package/esm/components/layout/section/SearchContainer.d.ts.map +1 -0
  100. package/esm/components/layout/section/SearchContainer.js +7 -0
  101. package/esm/components/layout/section/SearchContainer.js.map +1 -0
  102. package/esm/components/layout/section/SearchContainer.module.scss +3 -0
  103. package/esm/components/layout/section/Section.module.scss +7 -0
  104. package/esm/components/ui/action/Action.d.ts +1 -1
  105. package/esm/components/ui/action/Action.d.ts.map +1 -1
  106. package/esm/components/ui/action/Action.js.map +1 -1
  107. package/esm/global.scss +1 -0
  108. package/esm/index.d.ts +3 -0
  109. package/esm/index.d.ts.map +1 -1
  110. package/esm/index.js +3 -0
  111. package/esm/index.js.map +1 -1
  112. package/esm/types.d.ts +1 -1
  113. package/esm/types.d.ts.map +1 -1
  114. package/package.json +1 -1
  115. package/src/components/form/Input.module.scss +39 -0
  116. package/src/components/form/Input.tsx +48 -0
  117. package/src/components/form/Label.module.scss +15 -0
  118. package/src/components/form/Label.tsx +29 -0
  119. package/src/components/form/Toggle.tsx +1 -1
  120. package/src/components/icons/Back.tsx +1 -1
  121. package/src/components/icons/Battery.tsx +34 -0
  122. package/src/components/icons/Forward.tsx +1 -1
  123. package/src/components/icons/Icon.tsx +6 -0
  124. package/src/components/icons/Search.tsx +29 -0
  125. package/src/components/layout/header/HeaderIconAction.tsx +1 -1
  126. package/src/components/layout/section/SearchContainer.module.scss +3 -0
  127. package/src/components/layout/section/SearchContainer.tsx +11 -0
  128. package/src/components/layout/section/Section.module.scss +7 -0
  129. package/src/components/ui/action/Action.tsx +1 -1
  130. package/src/demo/components/form/Form.tsx +31 -0
  131. package/src/demo/components/form/Input.tsx +13 -0
  132. package/src/demo/components/form/Label.tsx +14 -0
  133. package/src/demo/components/form/Search.tsx +36 -0
  134. package/src/demo/components/form/Toggle.tsx +1 -1
  135. package/src/demo/componentsMap.ts +33 -11
  136. package/src/global.scss +1 -0
  137. package/src/index.ts +3 -0
  138. package/src/types.ts +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/section/SearchContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAI5B,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import styles from "./SearchContainer.module.scss";
3
+ const SearchContainer = (props) => {
4
+ return (React.createElement("section", { className: styles.section }, props.children));
5
+ };
6
+ export { SearchContainer };
7
+ //# sourceMappingURL=SearchContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchContainer.js","sourceRoot":"","sources":["../../../../src/components/layout/section/SearchContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,MAAM,MAAM,+BAA+B,CAAC;AAEnD,MAAM,eAAe,GAAa,CAAC,KAAK,EAAE,EAAE;IACxC,OAAO,CACH,iCAAS,SAAS,EAAE,MAAM,CAAC,OAAO,IAAG,KAAK,CAAC,QAAQ,CAAW,CACjE,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ .section {
2
+ margin: 12px;
3
+ }
@@ -15,3 +15,10 @@
15
15
  margin-left: 23px;
16
16
  margin-right: 23px;
17
17
  }
18
+
19
+ .section > .section.vertical {
20
+ padding-top: 23px;
21
+ padding-bottom: 23px;
22
+ margin-top: 0;
23
+ margin-bottom: 0;
24
+ }
@@ -12,6 +12,6 @@ interface Props {
12
12
  Link?: React.ComponentClass<LinkProps> | React.FC<LinkProps>;
13
13
  label?: ReactNode;
14
14
  }
15
- declare const Action: React.VFC<Props>;
15
+ declare const Action: React.FC<Props>;
16
16
  export { Action };
17
17
  //# sourceMappingURL=Action.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/action/Action.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAI7C,UAAU,SAAS;IACf,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,KAAK;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAC7D,KAAK,CAAC,EAAE,SAAS,CAAC;CAErB;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAkC5B,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/action/Action.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAI7C,UAAU,SAAS;IACf,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,KAAK;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACzC,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAC7D,KAAK,CAAC,EAAE,SAAS,CAAC;CAErB;AAED,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAkC3B,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../../src/components/ui/action/Action.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAgB1C,MAAM,MAAM,GAAqB,CAAC,KAAK,EAAE,EAAE;IACvC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,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-border: 2.666666;
5
+ // font is calculated from top to bottom
5
6
  --ratio-font: 1.666666;
6
7
 
7
8
  --background: white;
package/esm/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export * from "./components/form/Checkbox.js";
2
+ export * from "./components/form/Input.js";
3
+ export * from "./components/form/Label.js";
2
4
  export * from "./components/form/Toggle.js";
3
5
  export * from "./components/icons/Icon.js";
4
6
  export * from "./components/layout/card/Card.js";
@@ -7,6 +9,7 @@ export * from "./components/layout/header/HeaderIconAction.js";
7
9
  export * from "./components/layout/header/StickyHeader.js";
8
10
  export * from "./components/layout/list/List.js";
9
11
  export * from "./components/layout/list/Item.js";
12
+ export * from "./components/layout/section/SearchContainer.js";
10
13
  export * from "./components/layout/section/Section.js";
11
14
  export * from "./components/ui/action/Action.js";
12
15
  export * from "./components/ui/action/EqualActions.js";
@@ -1 +1 @@
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,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wCAAwC,CAAC;AAEvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wCAAwC,CAAC;AACvD,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,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wCAAwC,CAAC;AAEvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wCAAwC,CAAC;AACvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC"}
package/esm/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  export * from "./components/form/Checkbox.js";
2
+ export * from "./components/form/Input.js";
3
+ export * from "./components/form/Label.js";
2
4
  export * from "./components/form/Toggle.js";
3
5
  export * from "./components/icons/Icon.js";
4
6
  export * from "./components/layout/card/Card.js";
@@ -7,6 +9,7 @@ export * from "./components/layout/header/HeaderIconAction.js";
7
9
  export * from "./components/layout/header/StickyHeader.js";
8
10
  export * from "./components/layout/list/List.js";
9
11
  export * from "./components/layout/list/Item.js";
12
+ export * from "./components/layout/section/SearchContainer.js";
10
13
  export * from "./components/layout/section/Section.js";
11
14
  export * from "./components/ui/action/Action.js";
12
15
  export * from "./components/ui/action/EqualActions.js";
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;AAC9C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wCAAwC,CAAC;AAEvD,cAAc,kCAAkC,CAAC;AACjD,cAAc,wCAAwC,CAAC;AACvD,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,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,4BAA4B,CAAC;AAE3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,sCAAsC,CAAC;AACrD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wCAAwC,CAAC;AAEvD,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 | React.VFC;
2
+ declare type AnyComponent = React.ComponentClass | React.FC;
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,GAAG,KAAK,CAAC,GAAG,CAAC;AAEhE,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,CAAC;AAEpD,YAAY,EACR,YAAY,GACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-miui",
3
- "version": "0.5.2",
3
+ "version": "0.6.0",
4
4
  "author": "Jacek Nowacki",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -0,0 +1,39 @@
1
+ .input {
2
+ box-sizing: border-box;
3
+ height: calc(103px / var(--ratio-dimensions));
4
+ font-size: calc(34 / var(--ratio-font));
5
+ color: var(--text);
6
+ border: none;
7
+ display: block;
8
+ width: 100%;
9
+ background: none;
10
+
11
+ &::placeholder {
12
+ color: var(--sub);
13
+ }
14
+ }
15
+
16
+ .wrapper {
17
+ background: white;
18
+ display: inline-flex;
19
+ width: 100%;
20
+ box-sizing: border-box;
21
+ border-radius: 2px;
22
+ padding: 0 calc(36px / var(--ratio-dimensions));
23
+ border: calc(1px / var(--ratio-border)) solid var(--border);
24
+ align-items: center;
25
+ }
26
+
27
+ .prefix {
28
+ margin-right: calc(36px / var(--ratio-dimensions));
29
+ display: flex;
30
+ }
31
+
32
+ .suffix {
33
+ margin-left: calc(36px / var(--ratio-dimensions));
34
+ display: flex;
35
+ }
36
+
37
+ .wrapperFocused {
38
+ border-color: var(--focus-color);
39
+ }
@@ -0,0 +1,48 @@
1
+ import React, { useCallback, useState } from "react";
2
+ import classnames from "classnames";
3
+
4
+ import styles from "./Input.module.scss";
5
+
6
+ interface Props {
7
+ children?: never;
8
+ prefix?: React.ReactNode;
9
+ suffix?: React.ReactNode;
10
+ }
11
+
12
+ const Input: React.FC<Omit<React.InputHTMLAttributes<HTMLInputElement>, "prefix"> & Props> = ({
13
+ className, children,
14
+ prefix, suffix,
15
+ onFocus, onBlur,
16
+ ...props
17
+ }) => {
18
+ const [focused, setFocused] = useState(false);
19
+
20
+ const handleFocus = useCallback((e: React.FocusEvent<HTMLInputElement>) => {
21
+ setFocused(true);
22
+ onFocus?.(e);
23
+ }, [onFocus]);
24
+
25
+ const handleBlur = useCallback((e: React.FocusEvent<HTMLInputElement>) => {
26
+ setFocused(false);
27
+ onBlur?.(e);
28
+ }, [onBlur]);
29
+
30
+ const wrapperCls = classnames(styles.wrapper, {
31
+ [styles.wrapperFocused]: focused,
32
+ }, className);
33
+
34
+ const prefixElem = prefix ? <div className={styles.prefix}>{prefix}</div> : null;
35
+ const suffixElem = suffix ? <div className={styles.suffix}>{suffix}</div> : null;
36
+
37
+ return (
38
+ <div className={wrapperCls}>
39
+ {prefixElem}
40
+ <input {...props} onFocus={handleFocus} onBlur={handleBlur} className={styles.input} />
41
+ {suffixElem}
42
+ </div>
43
+ );
44
+ };
45
+
46
+ export {
47
+ Input,
48
+ };
@@ -0,0 +1,15 @@
1
+ .label + .label {
2
+ margin-top: 23px;
3
+ display: block;
4
+ }
5
+
6
+ .text {
7
+ font-size: calc(28px / var(--ratio-font));
8
+ margin-bottom: calc(24px / var(--ratio-dimensions));
9
+ color: var(--sub);
10
+ }
11
+
12
+ .textBig {
13
+ font-size: calc(34px / var(--ratio-font));
14
+
15
+ }
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+
3
+ import styles from "./Label.module.scss";
4
+ import { makeVariants } from "../../utils/makeVariants";
5
+ import classnames from "classnames";
6
+
7
+ interface Props {
8
+ label?: React.ReactNode;
9
+ variant?: "big";
10
+ }
11
+
12
+ const Label: React.FC<Props> = (props) => {
13
+ const v = makeVariants(props.variant);
14
+
15
+ const labelCls = classnames(styles.text, {
16
+ [styles.textBig]: v.includes("big"),
17
+ });
18
+
19
+ const label = props.label ? <div className={labelCls}>{props.label}</div> : null;
20
+
21
+ return (
22
+ <label className={styles.label}>
23
+ {label}
24
+ {props.children}
25
+ </label>
26
+ );
27
+ };
28
+
29
+ export { Label };
@@ -8,7 +8,7 @@ interface Props {
8
8
  state: boolean | null;
9
9
  }
10
10
 
11
- const Toggle: React.VFC<Props> = (props) => {
11
+ const Toggle: React.FC<Props> = (props) => {
12
12
  const handleChange = useCallback((e: ChangeEvent<HTMLInputElement>) => {
13
13
  if (props.state == null) {
14
14
  return;
@@ -4,7 +4,7 @@ interface Props {
4
4
  className?: string;
5
5
  }
6
6
 
7
- const Back: React.VFC<Props> = (props) => {
7
+ const Back: React.FC<Props> = (props) => {
8
8
  return (
9
9
  <svg
10
10
  width={"9"}
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+
3
+ interface Props {
4
+ className?: string;
5
+ }
6
+
7
+ const Battery: React.FC<Props> = (props) => {
8
+ return (
9
+ <svg
10
+ width={"13"}
11
+ height={"17"}
12
+ xmlns={"http://www.w3.org/2000/svg"}
13
+ className={props.className}
14
+ >
15
+ <path
16
+ fill={"none"}
17
+ stroke={"#000"}
18
+ strokeLinecap={"round"}
19
+ strokeLinejoin={"round"}
20
+ d={"M12.5 2.55q0-.6-.5-.55H9.25q-.65 0-.6-.7v-.2Q8.7.5 8.2.5H4.75q-.4 0-.4.4v.4q.05.75-.75.7H1.1q-.6-.05-.6.55V16q0 .5.6.5h11q.4 0 .4-.45V2.55"}
21
+ />
22
+ <path
23
+ fill={"none"}
24
+ stroke={"#000"}
25
+ strokeLinecap={"round"}
26
+ strokeLinejoin={"round"}
27
+ d={"M8.9 8.6h-2V5.8l-3 4 1.95.05v2.75l3.05-4"}
28
+ />
29
+ </svg>
30
+
31
+ );
32
+ };
33
+
34
+ export { Battery };
@@ -4,7 +4,7 @@ interface Props {
4
4
  className?: string;
5
5
  }
6
6
 
7
- const Forward: React.VFC<Props> = (props) => {
7
+ const Forward: React.FC<Props> = (props) => {
8
8
  return (
9
9
  <svg
10
10
  width={"9"}
@@ -4,11 +4,15 @@ import type { AnyComponent } from "../../types";
4
4
  import { Checkmark } from "./Checkmark.js";
5
5
  import { Back } from "./Back.js";
6
6
  import { Forward } from "./Forward.js";
7
+ import { Search } from "./Search.js";
8
+ import { Battery } from "./Battery.js";
7
9
 
8
10
  enum ICON {
9
11
  checkmark = "checkmark",
10
12
  back = "back",
11
13
  forward = "forward",
14
+ search = "search",
15
+ battery = "battery",
12
16
  }
13
17
 
14
18
  interface Props {
@@ -20,6 +24,8 @@ const iconsMap = new Map<ICON, AnyComponent>([
20
24
  [ICON.checkmark, Checkmark],
21
25
  [ICON.back, Back],
22
26
  [ICON.forward, Forward],
27
+ [ICON.search, Search],
28
+ [ICON.battery, Battery],
23
29
  ]);
24
30
 
25
31
  const Icon: React.FC<Props> = ({ name: iconName, ...props }) => {
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+
3
+ interface Props {
4
+ className?: string;
5
+ }
6
+
7
+ const Search: React.FC<Props> = (props) => {
8
+ return (
9
+ <svg
10
+ baseProfile={"basic"}
11
+ width={"16"}
12
+ height={"16"}
13
+ xmlns={"http://www.w3.org/2000/svg"}
14
+ className={props.className}
15
+ >
16
+ <path
17
+ fill={"none"}
18
+ stroke={"currentColor"}
19
+ strokeWidth={"2"}
20
+ strokeLinecap={"round"}
21
+ strokeLinejoin={"round"}
22
+ d={"M11.95 6.6q0 2.1-1.5 3.6m0-7.2q1.5 1.55 1.5 3.6M6.9 1.5q2.05 0 3.55 1.5m-7.2 0q1.5-1.5 3.65-1.5M1.75 6.6q0-2.05 1.5-3.6m0 7.2q-1.5-1.5-1.5-3.6m5.15 5.1q-2.15 0-3.65-1.5m6.95.2q-1.4 1.3-3.3 1.3m3.3-1.3l4.1 4.1m-3.85-4.3q-.1.1-.25.2"}
23
+ />
24
+ </svg>
25
+
26
+ );
27
+ };
28
+
29
+ export { Search };
@@ -19,7 +19,7 @@ interface Props {
19
19
  // if className ever goes here make sure that `a` gets classnames merged
20
20
  }
21
21
 
22
- const HeaderIconAction: React.VFC<Props> = (props) => {
22
+ const HeaderIconAction: React.FC<Props> = (props) => {
23
23
  const { icon, label, href, to, Link, ...restProps } = props;
24
24
 
25
25
  let content: ReactNode = icon;
@@ -0,0 +1,3 @@
1
+ .section {
2
+ margin: 12px;
3
+ }
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+
3
+ import styles from "./SearchContainer.module.scss";
4
+
5
+ const SearchContainer: React.FC = (props) => {
6
+ return (
7
+ <section className={styles.section}>{props.children}</section>
8
+ );
9
+ };
10
+
11
+ export { SearchContainer };
@@ -15,3 +15,10 @@
15
15
  margin-left: 23px;
16
16
  margin-right: 23px;
17
17
  }
18
+
19
+ .section > .section.vertical {
20
+ padding-top: 23px;
21
+ padding-bottom: 23px;
22
+ margin-top: 0;
23
+ margin-bottom: 0;
24
+ }
@@ -19,7 +19,7 @@ interface Props {
19
19
  // if className ever goes here make sure that `a` gets classnames merged
20
20
  }
21
21
 
22
- const Action: React.VFC<Props> = (props) => {
22
+ const Action: React.FC<Props> = (props) => {
23
23
  const { icon, label, href, to, Link, ...restProps } = props;
24
24
 
25
25
  let iconElem: ReactNode = icon;
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import { Section } from "../../../components/layout/section/Section";
3
+ import { SectionContainer } from "../../../components/layout/section/SectionContainer";
4
+ import { Input } from "../../../components/form/Input";
5
+ import { Label } from "../../../components/form/Label";
6
+ import { Button } from "../../../components/ui/button/Button";
7
+
8
+ // @TODO add checkbox
9
+ // @TODO add toggle
10
+ // @TODO some kind of `form` wrapper which also takes cares of margins?
11
+ const FormDemo = () => {
12
+ return (
13
+ <SectionContainer>
14
+ <Section>
15
+ <Section variant={["vertical", "horizontal"]}>
16
+ <Label label={"First name"}>
17
+ <Input placeholder={""} />
18
+ </Label>
19
+ <Label label={"E-mail"}>
20
+ <Input placeholder={"Don't forget the @"} suffix={".com"} />
21
+ </Label>
22
+ <Label>
23
+ <Button>Submit</Button>
24
+ </Label>
25
+ </Section>
26
+ </Section>
27
+ </SectionContainer>
28
+ );
29
+ };
30
+
31
+ export { FormDemo };
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import { Input } from "../../../components/form/Input";
3
+ import { ICON, Icon } from "../../../components/icons/Icon";
4
+
5
+ const InputDemo: React.FC = () => {
6
+ return (
7
+ <>
8
+ <Input placeholder={"Capacity"} prefix={<Icon name={ICON.battery} />} suffix={"kWh"} />
9
+ </>
10
+ );
11
+ };
12
+
13
+ export { InputDemo };
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { Label } from "../../../components/form/Label";
3
+ import { Input } from "../../../components/form/Input";
4
+ import { ICON, Icon } from "../../../components/icons/Icon";
5
+
6
+ const LabelDemo = () => {
7
+ return (
8
+ <Label label={"Capacity"}>
9
+ <Input placeholder={"ie: 500"} prefix={<Icon name={ICON.battery} />} suffix={"kWh"} />
10
+ </Label>
11
+ );
12
+ };
13
+
14
+ export { LabelDemo };
@@ -0,0 +1,36 @@
1
+ import React from "react";
2
+ import { SearchContainer } from "../../../components/layout/section/SearchContainer";
3
+ import { Input } from "../../../components/form/Input";
4
+ import { ICON, Icon } from "../../../components/icons/Icon";
5
+ import { Section } from "../../../components/layout/section/Section";
6
+ import { SectionContainer } from "../../../components/layout/section/SectionContainer";
7
+ import { List } from "../../../components/layout/list/List";
8
+ import { Item } from "../../../components/layout/list/Item";
9
+
10
+ const SearchDemo = () => {
11
+ return (
12
+ <SectionContainer>
13
+ <SearchContainer>
14
+ <Input placeholder={"Search..."} prefix={<Icon name={ICON.search} />} />
15
+ </SearchContainer>
16
+ <Section>
17
+ <List>
18
+ <List.Header>Messages</List.Header>
19
+ <Item>Lorem</Item>
20
+ <Item>Ipsum</Item>
21
+ <Item>Dolor</Item>
22
+ </List>
23
+ </Section>
24
+ <Section>
25
+ <List>
26
+ <List.Header>Contacts</List.Header>
27
+ <Item>Lorem</Item>
28
+ <Item>Ipsum</Item>
29
+ <Item>Dolor</Item>
30
+ </List>
31
+ </Section>
32
+ </SectionContainer>
33
+ );
34
+ };
35
+
36
+ export { SearchDemo };
@@ -5,7 +5,7 @@ import { Item } from "../../../components/layout/list/Item";
5
5
 
6
6
  const handleNoop = () => undefined;
7
7
 
8
- const ToggleDemo: React.VFC = () => {
8
+ const ToggleDemo: React.FC = () => {
9
9
  const [state, ss] = useState<boolean | null>(null);
10
10
 
11
11
  useEffect(() => {
@@ -29,6 +29,10 @@ import { ListHeaderDemo } from "./components/layout/list/Header";
29
29
  import { ValueDemo } from "./components/layout/list/Value";
30
30
  import { SectionDemo } from "./components/layout/section/Section";
31
31
  import { CardDemo } from "./components/layout/card/Card";
32
+ import { InputDemo } from "./components/form/Input";
33
+ import { FormDemo } from "./components/form/Form";
34
+ import { SearchDemo } from "./components/form/Search";
35
+ import { LabelDemo } from "./components/form/Label";
32
36
 
33
37
  interface TheMap {
34
38
  // eslint-disable-next-line @typescript-eslint/no-use-before-define
@@ -42,17 +46,35 @@ interface TheMapItem {
42
46
  }
43
47
 
44
48
  const componentsMap: TheMap = {
45
- Button: {
46
- name: "Button",
47
- Component: ButtonDemo,
48
- },
49
- Checkbox: {
50
- name: "Checkbox",
51
- Component: CheckboxDemo,
52
- },
53
- Toggle: {
54
- name: "Toggle",
55
- Component: ToggleDemo,
49
+ Form: {
50
+ name: "Form",
51
+ Component: FormDemo,
52
+ children: {
53
+ Input: {
54
+ name: "Input",
55
+ Component: InputDemo,
56
+ },
57
+ Label: {
58
+ name: "Label",
59
+ Component: LabelDemo,
60
+ },
61
+ Search: {
62
+ name: "Search",
63
+ Component: SearchDemo,
64
+ },
65
+ Button: {
66
+ name: "Button",
67
+ Component: ButtonDemo,
68
+ },
69
+ Checkbox: {
70
+ name: "Checkbox",
71
+ Component: CheckboxDemo,
72
+ },
73
+ Toggle: {
74
+ name: "Toggle",
75
+ Component: ToggleDemo,
76
+ },
77
+ },
56
78
  },
57
79
  Header: {
58
80
  name: "Header",
package/src/global.scss CHANGED
@@ -2,6 +2,7 @@
2
2
  :root {
3
3
  --ratio-dimensions: 3;
4
4
  --ratio-border: 2.666666;
5
+ // font is calculated from top to bottom
5
6
  --ratio-font: 1.666666;
6
7
 
7
8
  --background: white;
package/src/index.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export * from "./components/form/Checkbox.js";
2
+ export * from "./components/form/Input.js";
3
+ export * from "./components/form/Label.js";
2
4
  export * from "./components/form/Toggle.js";
3
5
 
4
6
  export * from "./components/icons/Icon.js";
@@ -9,6 +11,7 @@ export * from "./components/layout/header/HeaderIconAction.js";
9
11
  export * from "./components/layout/header/StickyHeader.js";
10
12
  export * from "./components/layout/list/List.js";
11
13
  export * from "./components/layout/list/Item.js";
14
+ export * from "./components/layout/section/SearchContainer.js";
12
15
  export * from "./components/layout/section/Section.js";
13
16
 
14
17
  export * from "./components/ui/action/Action.js";
package/src/types.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type React from "react";
2
2
 
3
- type AnyComponent = React.ComponentClass | React.FC | React.VFC;
3
+ type AnyComponent = React.ComponentClass | React.FC;
4
4
 
5
5
  export type {
6
6
  AnyComponent,