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.
- package/CHANGELOG.md +21 -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 +48 -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/TextArea.d.ts +7 -0
- package/dist/components/form/TextArea.d.ts.map +1 -0
- package/dist/components/form/TextArea.js +57 -0
- package/dist/components/form/TextArea.js.map +1 -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/components/ui/button/Button.d.ts +1 -2
- package/dist/components/ui/button/Button.d.ts.map +1 -1
- package/dist/components/ui/button/Button.js +15 -3
- package/dist/components/ui/button/Button.js.map +1 -1
- package/dist/global.scss +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -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 +52 -6
- package/docs/index.html +25 -4
- package/docs/modules/Item.html +6 -3
- package/docs/modules/List.html +6 -3
- package/docs/modules/Section.html +147 -0
- package/docs/modules/StickyHeader.html +7 -4
- package/docs/modules.html +108 -20
- package/docs/pages/Tutorials/Test.html +6 -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 +48 -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/TextArea.d.ts +7 -0
- package/esm/components/form/TextArea.d.ts.map +1 -0
- package/esm/components/form/TextArea.js +20 -0
- package/esm/components/form/TextArea.js.map +1 -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/components/ui/button/Button.d.ts +1 -2
- package/esm/components/ui/button/Button.d.ts.map +1 -1
- package/esm/components/ui/button/Button.js +3 -3
- package/esm/components/ui/button/Button.js.map +1 -1
- package/esm/global.scss +1 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +6 -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 +48 -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/TextArea.tsx +38 -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/components/ui/button/Button.tsx +8 -4
- package/src/demo/components/form/Form.tsx +35 -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/TextArea.tsx +12 -0
- package/src/demo/components/form/Toggle.tsx +1 -1
- package/src/demo/components/ui/button/ButtonDemo.tsx +9 -5
- package/src/demo/componentsMap.ts +33 -11
- package/src/global.scss +1 -0
- package/src/index.ts +6 -0
- 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
|
+
};
|
|
@@ -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;
|
|
@@ -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
|
|
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 };
|
|
@@ -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
|
-
|
|
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,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";
|