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.
- package/CHANGELOG.md +9 -0
- package/assets/sources/battery.fla +0 -0
- package/assets/sources/search.fla +0 -0
- package/dist/components/form/Input.d.ts +9 -0
- package/dist/components/form/Input.d.ts.map +1 -0
- package/dist/components/form/Input.js +62 -0
- package/dist/components/form/Input.js.map +1 -0
- package/dist/components/form/Input.module.scss +39 -0
- package/dist/components/form/Label.d.ts +8 -0
- package/dist/components/form/Label.d.ts.map +1 -0
- package/dist/components/form/Label.js +22 -0
- package/dist/components/form/Label.js.map +1 -0
- package/dist/components/form/Label.module.scss +15 -0
- package/dist/components/form/Toggle.d.ts +1 -1
- package/dist/components/form/Toggle.d.ts.map +1 -1
- package/dist/components/form/Toggle.js.map +1 -1
- package/dist/components/icons/Back.d.ts +1 -1
- package/dist/components/icons/Back.d.ts.map +1 -1
- package/dist/components/icons/Back.js.map +1 -1
- package/dist/components/icons/Battery.d.ts +7 -0
- package/dist/components/icons/Battery.d.ts.map +1 -0
- package/dist/components/icons/Battery.js +14 -0
- package/dist/components/icons/Battery.js.map +1 -0
- package/dist/components/icons/Forward.d.ts +1 -1
- package/dist/components/icons/Forward.d.ts.map +1 -1
- package/dist/components/icons/Forward.js.map +1 -1
- package/dist/components/icons/Icon.d.ts +3 -1
- package/dist/components/icons/Icon.d.ts.map +1 -1
- package/dist/components/icons/Icon.js +6 -0
- package/dist/components/icons/Icon.js.map +1 -1
- package/dist/components/icons/Search.d.ts +7 -0
- package/dist/components/icons/Search.d.ts.map +1 -0
- package/dist/components/icons/Search.js +13 -0
- package/dist/components/icons/Search.js.map +1 -0
- package/dist/components/layout/header/HeaderIconAction.d.ts +1 -1
- package/dist/components/layout/header/HeaderIconAction.d.ts.map +1 -1
- package/dist/components/layout/header/HeaderIconAction.js.map +1 -1
- package/dist/components/layout/section/SearchContainer.d.ts +4 -0
- package/dist/components/layout/section/SearchContainer.d.ts.map +1 -0
- package/dist/components/layout/section/SearchContainer.js +13 -0
- package/dist/components/layout/section/SearchContainer.js.map +1 -0
- package/dist/components/layout/section/SearchContainer.module.scss +3 -0
- package/dist/components/layout/section/Section.module.scss +7 -0
- package/dist/components/ui/action/Action.d.ts +1 -1
- package/dist/components/ui/action/Action.d.ts.map +1 -1
- package/dist/components/ui/action/Action.js.map +1 -1
- package/dist/global.scss +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/docs/assets/js/search.js +1 -1
- package/docs/assets/js/search.json +1 -1
- package/docs/enums/ICON.html +43 -6
- package/docs/index.html +13 -4
- package/docs/modules/Item.html +3 -3
- package/docs/modules/List.html +3 -3
- package/docs/modules/Section.html +3 -3
- package/docs/modules/StickyHeader.html +4 -4
- package/docs/modules.html +63 -21
- package/docs/pages/Tutorials/Test.html +3 -3
- package/esm/components/form/Input.d.ts +9 -0
- package/esm/components/form/Input.d.ts.map +1 -0
- package/esm/components/form/Input.js +25 -0
- package/esm/components/form/Input.js.map +1 -0
- package/esm/components/form/Input.module.scss +39 -0
- package/esm/components/form/Label.d.ts +8 -0
- package/esm/components/form/Label.d.ts.map +1 -0
- package/esm/components/form/Label.js +16 -0
- package/esm/components/form/Label.js.map +1 -0
- package/esm/components/form/Label.module.scss +15 -0
- package/esm/components/form/Toggle.d.ts +1 -1
- package/esm/components/form/Toggle.d.ts.map +1 -1
- package/esm/components/form/Toggle.js.map +1 -1
- package/esm/components/icons/Back.d.ts +1 -1
- package/esm/components/icons/Back.d.ts.map +1 -1
- package/esm/components/icons/Back.js.map +1 -1
- package/esm/components/icons/Battery.d.ts +7 -0
- package/esm/components/icons/Battery.d.ts.map +1 -0
- package/esm/components/icons/Battery.js +8 -0
- package/esm/components/icons/Battery.js.map +1 -0
- package/esm/components/icons/Forward.d.ts +1 -1
- package/esm/components/icons/Forward.d.ts.map +1 -1
- package/esm/components/icons/Forward.js.map +1 -1
- package/esm/components/icons/Icon.d.ts +3 -1
- package/esm/components/icons/Icon.d.ts.map +1 -1
- package/esm/components/icons/Icon.js +6 -0
- package/esm/components/icons/Icon.js.map +1 -1
- package/esm/components/icons/Search.d.ts +7 -0
- package/esm/components/icons/Search.d.ts.map +1 -0
- package/esm/components/icons/Search.js +7 -0
- package/esm/components/icons/Search.js.map +1 -0
- package/esm/components/layout/header/HeaderIconAction.d.ts +1 -1
- package/esm/components/layout/header/HeaderIconAction.d.ts.map +1 -1
- package/esm/components/layout/header/HeaderIconAction.js.map +1 -1
- package/esm/components/layout/section/SearchContainer.d.ts +4 -0
- package/esm/components/layout/section/SearchContainer.d.ts.map +1 -0
- package/esm/components/layout/section/SearchContainer.js +7 -0
- package/esm/components/layout/section/SearchContainer.js.map +1 -0
- package/esm/components/layout/section/SearchContainer.module.scss +3 -0
- package/esm/components/layout/section/Section.module.scss +7 -0
- package/esm/components/ui/action/Action.d.ts +1 -1
- package/esm/components/ui/action/Action.d.ts.map +1 -1
- package/esm/components/ui/action/Action.js.map +1 -1
- package/esm/global.scss +1 -0
- package/esm/index.d.ts +3 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +3 -0
- package/esm/index.js.map +1 -1
- package/esm/types.d.ts +1 -1
- package/esm/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/form/Input.module.scss +39 -0
- package/src/components/form/Input.tsx +48 -0
- package/src/components/form/Label.module.scss +15 -0
- package/src/components/form/Label.tsx +29 -0
- package/src/components/form/Toggle.tsx +1 -1
- package/src/components/icons/Back.tsx +1 -1
- package/src/components/icons/Battery.tsx +34 -0
- package/src/components/icons/Forward.tsx +1 -1
- package/src/components/icons/Icon.tsx +6 -0
- package/src/components/icons/Search.tsx +29 -0
- package/src/components/layout/header/HeaderIconAction.tsx +1 -1
- package/src/components/layout/section/SearchContainer.module.scss +3 -0
- package/src/components/layout/section/SearchContainer.tsx +11 -0
- package/src/components/layout/section/Section.module.scss +7 -0
- package/src/components/ui/action/Action.tsx +1 -1
- package/src/demo/components/form/Form.tsx +31 -0
- package/src/demo/components/form/Input.tsx +13 -0
- package/src/demo/components/form/Label.tsx +14 -0
- package/src/demo/components/form/Search.tsx +36 -0
- package/src/demo/components/form/Toggle.tsx +1 -1
- package/src/demo/componentsMap.ts +33 -11
- package/src/global.scss +1 -0
- package/src/index.ts +3 -0
- 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"}
|
|
@@ -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,
|
|
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,
|
|
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,GAAoB,CAAC,KAAK,EAAE,EAAE;IACtC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAE5D,IAAI,QAAQ,GAAc,IAAI,CAAC;IAC/B,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC1B,QAAQ,GAAG,oBAAC,IAAI,IAAC,IAAI,EAAE,IAAY,GAAI,CAAC;KAC3C;IAED,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,6BAAK,SAAS,EAAE,MAAM,CAAC,KAAK,IAAG,KAAK,CAAO,CAAC,CAAC,CAAC,IAAI,CAAC;IAE7E,MAAM,OAAO,GAAG,CACZ;QACI,6BAAK,SAAS,EAAE,MAAM,CAAC,MAAM,IAAG,QAAQ,CAAO;QAC9C,SAAS,CACX,CACN,CAAC;IAEF,IAAI,EAAE,EAAE;QACJ,IAAI,CAAC,IAAI,EAAE;YACP,MAAM,IAAI,SAAS,CAAC,0CAA0C,CAAC,CAAC;SACnE;QAED,OAAO,oBAAC,IAAI,IAAC,IAAI,EAAE,EAAE,KAAM,SAAS;YAAE,2BAAG,SAAS,EAAE,MAAM,CAAC,CAAC,IAAG,OAAO,CAAK,CAAO,CAAC;KACtF;IAED,IAAI,IAAI,EAAE;QACN,OAAO,2BAAG,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,KAAM,SAAS,IAAG,OAAO,CAAK,CAAC;KAC3E;IAED,OAAO,CACH,gCAAQ,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,IACnD,OAAO,CACH,CACZ,CAAC;AACN,CAAC,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/esm/global.scss
CHANGED
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";
|
package/esm/index.d.ts.map
CHANGED
|
@@ -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
package/esm/types.d.ts.map
CHANGED
|
@@ -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,
|
|
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
|
@@ -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 };
|
|
@@ -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,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.
|
|
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;
|
|
@@ -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.
|
|
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 };
|
|
@@ -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
|
-
|
|
46
|
-
name: "
|
|
47
|
-
Component:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
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";
|