react-miui 0.5.0 → 0.7.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 (158) hide show
  1. package/CHANGELOG.md +21 -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 +48 -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/TextArea.d.ts +7 -0
  15. package/dist/components/form/TextArea.d.ts.map +1 -0
  16. package/dist/components/form/TextArea.js +57 -0
  17. package/dist/components/form/TextArea.js.map +1 -0
  18. package/dist/components/form/Toggle.d.ts +1 -1
  19. package/dist/components/form/Toggle.d.ts.map +1 -1
  20. package/dist/components/form/Toggle.js.map +1 -1
  21. package/dist/components/icons/Back.d.ts +1 -1
  22. package/dist/components/icons/Back.d.ts.map +1 -1
  23. package/dist/components/icons/Back.js.map +1 -1
  24. package/dist/components/icons/Battery.d.ts +7 -0
  25. package/dist/components/icons/Battery.d.ts.map +1 -0
  26. package/dist/components/icons/Battery.js +14 -0
  27. package/dist/components/icons/Battery.js.map +1 -0
  28. package/dist/components/icons/Forward.d.ts +1 -1
  29. package/dist/components/icons/Forward.d.ts.map +1 -1
  30. package/dist/components/icons/Forward.js.map +1 -1
  31. package/dist/components/icons/Icon.d.ts +3 -1
  32. package/dist/components/icons/Icon.d.ts.map +1 -1
  33. package/dist/components/icons/Icon.js +6 -0
  34. package/dist/components/icons/Icon.js.map +1 -1
  35. package/dist/components/icons/Search.d.ts +7 -0
  36. package/dist/components/icons/Search.d.ts.map +1 -0
  37. package/dist/components/icons/Search.js +13 -0
  38. package/dist/components/icons/Search.js.map +1 -0
  39. package/dist/components/layout/header/HeaderIconAction.d.ts +1 -1
  40. package/dist/components/layout/header/HeaderIconAction.d.ts.map +1 -1
  41. package/dist/components/layout/header/HeaderIconAction.js.map +1 -1
  42. package/dist/components/layout/section/SearchContainer.d.ts +4 -0
  43. package/dist/components/layout/section/SearchContainer.d.ts.map +1 -0
  44. package/dist/components/layout/section/SearchContainer.js +13 -0
  45. package/dist/components/layout/section/SearchContainer.js.map +1 -0
  46. package/dist/components/layout/section/SearchContainer.module.scss +3 -0
  47. package/dist/components/layout/section/Section.module.scss +7 -0
  48. package/dist/components/ui/action/Action.d.ts +1 -1
  49. package/dist/components/ui/action/Action.d.ts.map +1 -1
  50. package/dist/components/ui/action/Action.js.map +1 -1
  51. package/dist/components/ui/button/Button.d.ts +1 -2
  52. package/dist/components/ui/button/Button.d.ts.map +1 -1
  53. package/dist/components/ui/button/Button.js +15 -3
  54. package/dist/components/ui/button/Button.js.map +1 -1
  55. package/dist/global.scss +1 -0
  56. package/dist/index.d.ts +6 -0
  57. package/dist/index.d.ts.map +1 -1
  58. package/dist/index.js +6 -0
  59. package/dist/index.js.map +1 -1
  60. package/dist/types.d.ts +1 -1
  61. package/dist/types.d.ts.map +1 -1
  62. package/docs/assets/js/search.js +1 -1
  63. package/docs/assets/js/search.json +1 -1
  64. package/docs/enums/ICON.html +52 -6
  65. package/docs/index.html +25 -4
  66. package/docs/modules/Item.html +6 -3
  67. package/docs/modules/List.html +6 -3
  68. package/docs/modules/Section.html +147 -0
  69. package/docs/modules/StickyHeader.html +7 -4
  70. package/docs/modules.html +108 -20
  71. package/docs/pages/Tutorials/Test.html +6 -3
  72. package/esm/components/form/Input.d.ts +9 -0
  73. package/esm/components/form/Input.d.ts.map +1 -0
  74. package/esm/components/form/Input.js +25 -0
  75. package/esm/components/form/Input.js.map +1 -0
  76. package/esm/components/form/Input.module.scss +48 -0
  77. package/esm/components/form/Label.d.ts +8 -0
  78. package/esm/components/form/Label.d.ts.map +1 -0
  79. package/esm/components/form/Label.js +16 -0
  80. package/esm/components/form/Label.js.map +1 -0
  81. package/esm/components/form/Label.module.scss +15 -0
  82. package/esm/components/form/TextArea.d.ts +7 -0
  83. package/esm/components/form/TextArea.d.ts.map +1 -0
  84. package/esm/components/form/TextArea.js +20 -0
  85. package/esm/components/form/TextArea.js.map +1 -0
  86. package/esm/components/form/Toggle.d.ts +1 -1
  87. package/esm/components/form/Toggle.d.ts.map +1 -1
  88. package/esm/components/form/Toggle.js.map +1 -1
  89. package/esm/components/icons/Back.d.ts +1 -1
  90. package/esm/components/icons/Back.d.ts.map +1 -1
  91. package/esm/components/icons/Back.js.map +1 -1
  92. package/esm/components/icons/Battery.d.ts +7 -0
  93. package/esm/components/icons/Battery.d.ts.map +1 -0
  94. package/esm/components/icons/Battery.js +8 -0
  95. package/esm/components/icons/Battery.js.map +1 -0
  96. package/esm/components/icons/Forward.d.ts +1 -1
  97. package/esm/components/icons/Forward.d.ts.map +1 -1
  98. package/esm/components/icons/Forward.js.map +1 -1
  99. package/esm/components/icons/Icon.d.ts +3 -1
  100. package/esm/components/icons/Icon.d.ts.map +1 -1
  101. package/esm/components/icons/Icon.js +6 -0
  102. package/esm/components/icons/Icon.js.map +1 -1
  103. package/esm/components/icons/Search.d.ts +7 -0
  104. package/esm/components/icons/Search.d.ts.map +1 -0
  105. package/esm/components/icons/Search.js +7 -0
  106. package/esm/components/icons/Search.js.map +1 -0
  107. package/esm/components/layout/header/HeaderIconAction.d.ts +1 -1
  108. package/esm/components/layout/header/HeaderIconAction.d.ts.map +1 -1
  109. package/esm/components/layout/header/HeaderIconAction.js.map +1 -1
  110. package/esm/components/layout/section/SearchContainer.d.ts +4 -0
  111. package/esm/components/layout/section/SearchContainer.d.ts.map +1 -0
  112. package/esm/components/layout/section/SearchContainer.js +7 -0
  113. package/esm/components/layout/section/SearchContainer.js.map +1 -0
  114. package/esm/components/layout/section/SearchContainer.module.scss +3 -0
  115. package/esm/components/layout/section/Section.module.scss +7 -0
  116. package/esm/components/ui/action/Action.d.ts +1 -1
  117. package/esm/components/ui/action/Action.d.ts.map +1 -1
  118. package/esm/components/ui/action/Action.js.map +1 -1
  119. package/esm/components/ui/button/Button.d.ts +1 -2
  120. package/esm/components/ui/button/Button.d.ts.map +1 -1
  121. package/esm/components/ui/button/Button.js +3 -3
  122. package/esm/components/ui/button/Button.js.map +1 -1
  123. package/esm/global.scss +1 -0
  124. package/esm/index.d.ts +6 -0
  125. package/esm/index.d.ts.map +1 -1
  126. package/esm/index.js +6 -0
  127. package/esm/index.js.map +1 -1
  128. package/esm/types.d.ts +1 -1
  129. package/esm/types.d.ts.map +1 -1
  130. package/package.json +1 -1
  131. package/src/components/form/Input.module.scss +48 -0
  132. package/src/components/form/Input.tsx +48 -0
  133. package/src/components/form/Label.module.scss +15 -0
  134. package/src/components/form/Label.tsx +29 -0
  135. package/src/components/form/TextArea.tsx +38 -0
  136. package/src/components/form/Toggle.tsx +1 -1
  137. package/src/components/icons/Back.tsx +1 -1
  138. package/src/components/icons/Battery.tsx +34 -0
  139. package/src/components/icons/Forward.tsx +1 -1
  140. package/src/components/icons/Icon.tsx +6 -0
  141. package/src/components/icons/Search.tsx +29 -0
  142. package/src/components/layout/header/HeaderIconAction.tsx +1 -1
  143. package/src/components/layout/section/SearchContainer.module.scss +3 -0
  144. package/src/components/layout/section/SearchContainer.tsx +11 -0
  145. package/src/components/layout/section/Section.module.scss +7 -0
  146. package/src/components/ui/action/Action.tsx +1 -1
  147. package/src/components/ui/button/Button.tsx +8 -4
  148. package/src/demo/components/form/Form.tsx +35 -0
  149. package/src/demo/components/form/Input.tsx +13 -0
  150. package/src/demo/components/form/Label.tsx +14 -0
  151. package/src/demo/components/form/Search.tsx +36 -0
  152. package/src/demo/components/form/TextArea.tsx +12 -0
  153. package/src/demo/components/form/Toggle.tsx +1 -1
  154. package/src/demo/components/ui/button/ButtonDemo.tsx +9 -5
  155. package/src/demo/componentsMap.ts +33 -11
  156. package/src/global.scss +1 -0
  157. package/src/index.ts +6 -0
  158. package/src/types.ts +1 -1
@@ -0,0 +1,38 @@
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
+ }
9
+
10
+ const TextArea: React.FC<React.TextareaHTMLAttributes<HTMLTextAreaElement> & Props> = ({
11
+ className, children,
12
+ onFocus, onBlur,
13
+ ...props
14
+ }) => {
15
+ const [focused, setFocused] = useState(false);
16
+
17
+ const handleFocus = useCallback((e: React.FocusEvent<HTMLTextAreaElement>) => {
18
+ setFocused(true);
19
+ onFocus?.(e);
20
+ }, [onFocus]);
21
+
22
+ const handleBlur = useCallback((e: React.FocusEvent<HTMLTextAreaElement>) => {
23
+ setFocused(false);
24
+ onBlur?.(e);
25
+ }, [onBlur]);
26
+
27
+ const cls = classnames(styles.wrapper, {
28
+ [styles.wrapperFocused]: focused,
29
+ }, styles.input, styles.textarea, className);
30
+
31
+ return (
32
+ <textarea {...props} onFocus={handleFocus} onBlur={handleBlur} className={cls} />
33
+ );
34
+ };
35
+
36
+ export {
37
+ TextArea,
38
+ };
@@ -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;
@@ -5,20 +5,24 @@ import styles from "./Button.module.scss";
5
5
  import { makeVariants } from "../../../utils/makeVariants.js";
6
6
 
7
7
  interface Props {
8
- disabled?: boolean;
9
8
  variant?: "inline" | "outline";
10
9
  }
11
10
 
12
- const Button: React.FC<Props> = (props) => {
11
+ const Button: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & Props> = ({ className, children, ...props }) => {
13
12
  const variants = makeVariants(props.variant);
14
13
 
15
14
  const cls = classnames(styles.btn, {
16
15
  [styles["btn--inline"]]: variants.includes("inline"),
17
16
  [styles["btn--outline"]]: variants.includes("outline"),
18
- });
17
+ }, className);
19
18
 
20
19
  return (
21
- <button className={cls} disabled={props.disabled}>{props.children}</button>
20
+ <button
21
+ {...props}
22
+ className={cls}
23
+ disabled={props.disabled}
24
+ >{children}
25
+ </button>
22
26
  );
23
27
  };
24
28
 
@@ -0,0 +1,35 @@
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
+ import { TextArea } from "../../../components/form/TextArea";
8
+
9
+ // @TODO add checkbox
10
+ // @TODO add toggle
11
+ // @TODO some kind of `form` wrapper which also takes cares of margins?
12
+ const FormDemo = () => {
13
+ return (
14
+ <SectionContainer>
15
+ <Section>
16
+ <Section variant={["vertical", "horizontal"]}>
17
+ <Label label={"First name"}>
18
+ <Input placeholder={""} />
19
+ </Label>
20
+ <Label label={"E-mail"}>
21
+ <Input placeholder={"Don't forget the @"} suffix={".com"} />
22
+ </Label>
23
+ <Label label={"Your story"}>
24
+ <TextArea placeholder={"Hello"} />
25
+ </Label>
26
+ <Label>
27
+ <Button>Submit</Button>
28
+ </Label>
29
+ </Section>
30
+ </Section>
31
+ </SectionContainer>
32
+ );
33
+ };
34
+
35
+ 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 };
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { TextArea } from "../../../components/form/TextArea";
3
+
4
+ const TextAreaDemo: React.FC = () => {
5
+ return (
6
+ <>
7
+ <TextArea placeholder={"Capacity"} />
8
+ </>
9
+ );
10
+ };
11
+
12
+ export { TextAreaDemo };
@@ -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(() => {
@@ -1,16 +1,20 @@
1
- import React from "react";
1
+ import React, { useCallback } from "react";
2
2
  import { Button } from "../../../../index.js";
3
3
 
4
4
  const ButtonDemo = () => {
5
+ const handleClick = useCallback(() => {
6
+ alert("Clicked");
7
+ }, []);
8
+
5
9
  return (
6
10
  <div>
7
- <Button>Basic button</Button>
11
+ <Button onClick={handleClick}>Basic button</Button>
8
12
  <br />
9
- <Button disabled={true}>Disabled button</Button>
13
+ <Button disabled={true} onClick={handleClick}>Disabled button</Button>
10
14
  <br />
11
- <Button variant={"inline"}>Inline button</Button>
15
+ <Button variant={"inline"} onClick={handleClick}>Inline button</Button>
12
16
  <br />
13
- <Button variant={"outline"}>Outline button</Button>
17
+ <Button variant={"outline"} onClick={handleClick}>Outline button</Button>
14
18
  </div>
15
19
  );
16
20
  };
@@ -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,13 +1,19 @@
1
1
  export * from "./components/form/Checkbox.js";
2
+ export * from "./components/form/Input.js";
3
+ export * from "./components/form/Label.js";
4
+ export * from "./components/form/TextArea.js";
2
5
  export * from "./components/form/Toggle.js";
3
6
 
4
7
  export * from "./components/icons/Icon.js";
5
8
 
9
+ export * from "./components/layout/card/Card.js";
6
10
  export * from "./components/layout/header/Header.js";
7
11
  export * from "./components/layout/header/HeaderIconAction.js";
8
12
  export * from "./components/layout/header/StickyHeader.js";
9
13
  export * from "./components/layout/list/List.js";
10
14
  export * from "./components/layout/list/Item.js";
15
+ export * from "./components/layout/section/SearchContainer.js";
16
+ export * from "./components/layout/section/Section.js";
11
17
 
12
18
  export * from "./components/ui/action/Action.js";
13
19
  export * from "./components/ui/action/EqualActions.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,