kelt-ui-kit-react 1.2.0 → 1.2.2
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/README.md +46 -46
- package/dist/App.d.ts +2 -3
- package/dist/App.menu.d.ts +10 -10
- package/dist/App.routes.d.ts +1 -1
- package/dist/_core/hooks/ImageChecker.d.ts +5 -6
- package/dist/_core/hooks/useIsMobile.d.ts +1 -1
- package/dist/action/Action.view.d.ts +1 -1
- package/dist/action/ButtonAction.d.ts +8 -9
- package/dist/badge/Badge.d.ts +8 -9
- package/dist/badge/Badge.view.d.ts +1 -1
- package/dist/button/Button.d.ts +1 -2
- package/dist/button/Button.view.d.ts +1 -1
- package/dist/button/button.interface.d.ts +17 -18
- package/dist/button/buttonActions/ButtonActions.d.ts +10 -11
- package/dist/card/Card.d.ts +12 -13
- package/dist/card/Card.view.d.ts +1 -1
- package/dist/card/card.interface.d.ts +10 -10
- package/dist/card/cardAction/CardAction.d.ts +13 -14
- package/dist/card/cardAction.interface.d.ts +8 -9
- package/dist/card/hook/useCardInteractions.d.ts +8 -8
- package/dist/carousel/Carousel.d.ts +14 -15
- package/dist/carousel/Carousel.view.d.ts +1 -1
- package/dist/damier/Damier.d.ts +9 -10
- package/dist/damier/Damier.view.d.ts +1 -1
- package/dist/damier/damierCell/DamierCell.d.ts +6 -7
- package/dist/damier/damierCell/damierCell.interface.d.ts +6 -6
- package/dist/dataTable/DataTable.d.ts +17 -16
- package/dist/dataTable/DataTable.view.d.ts +1 -1
- package/dist/dataTable/dataTable.interface.d.ts +30 -31
- package/dist/datePicker/DatePicker.d.ts +7 -8
- package/dist/datePicker/DatePicker.view.d.ts +1 -1
- package/dist/expands/Expands.d.ts +9 -10
- package/dist/expands/Expands.view.d.ts +1 -1
- package/dist/expands/expand/expand.d.ts +8 -9
- package/dist/expands/expand/expand.interface.d.ts +9 -9
- package/dist/filAriane/FilAriane.d.ts +8 -9
- package/dist/filAriane/FilAriane.view.d.ts +1 -1
- package/dist/filAriane/filAriane.interface.d.ts +6 -6
- package/dist/form/Form.d.ts +23 -24
- package/dist/form/Form.view.d.ts +1 -1
- package/dist/form/form.enum.d.ts +11 -11
- package/dist/form/form.interface.d.ts +29 -30
- package/dist/form/textArea/TextArea.d.ts +12 -13
- package/dist/form/textArea/TextArea.view.d.ts +1 -1
- package/dist/grid/Grid.d.ts +7 -8
- package/dist/grid/Grid.view.d.ts +1 -1
- package/dist/grid/col/Col.d.ts +10 -10
- package/dist/grid/col/colStyled/ColStyled.d.ts +9 -9
- package/dist/grid/container/Container.d.ts +5 -6
- package/dist/grid/grid.interface.d.ts +8 -8
- package/dist/grid/row/Row.d.ts +7 -8
- package/dist/header/Header.d.ts +1 -2
- package/dist/header/Header.view.d.ts +1 -1
- package/dist/header/header.interface.d.ts +9 -9
- package/dist/home/Home.d.ts +1 -1
- package/dist/icon/Icon.d.ts +1 -2
- package/dist/icon/Icons.view.d.ts +1 -1
- package/dist/icon/icon.interface.d.ts +4 -5
- package/dist/icon/iconSize.enum.d.ts +7 -7
- package/dist/index.d.ts +31 -32
- package/dist/index.html +18 -18
- package/dist/index.js +902 -885
- package/dist/loader/Loader.d.ts +7 -8
- package/dist/loader/Loader.view.d.ts +1 -1
- package/dist/main.d.ts +0 -1
- package/dist/manifest.json +25 -25
- package/dist/menus/Menus.d.ts +5 -6
- package/dist/menus/Menus.view.d.ts +1 -1
- package/dist/menus/menu/Menu.d.ts +6 -7
- package/dist/menus/menu/menu.interface.d.ts +10 -10
- package/dist/modal/Modal.d.ts +12 -13
- package/dist/modal/Modal.view.d.ts +1 -1
- package/dist/notFound/NotFound.d.ts +1 -1
- package/dist/overlayPanel/OverlayPanel.d.ts +18 -19
- package/dist/overlayPanel/OverlayPanel.view.d.ts +1 -1
- package/dist/overlayPanel/overlay.context.d.ts +9 -10
- package/dist/overlayPanel/overlayPanelStyled/OverlayPanelStyled.d.ts +7 -7
- package/dist/quantity/Quantity.d.ts +10 -11
- package/dist/robots.txt +3 -3
- package/dist/search/Search.d.ts +21 -22
- package/dist/search/Search.view.d.ts +1 -1
- package/dist/select/Select.d.ts +13 -14
- package/dist/select/Select.view.d.ts +1 -1
- package/dist/select/selectOption.interface.d.ts +4 -4
- package/dist/sidebar/Sidebar.d.ts +12 -13
- package/dist/sidebar/Sidebar.view.d.ts +1 -1
- package/dist/sidebarData/SidebarData.d.ts +6 -7
- package/dist/sidebarData/SidebarData.view.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/toaster/Toaster.d.ts +1 -2
- package/dist/toaster/Toaster.view.d.ts +1 -1
- package/dist/toaster/store/useToasterStore.d.ts +18 -18
- package/index.html +19 -19
- package/package.json +55 -55
- package/public/index.html +18 -18
- package/public/manifest.json +25 -25
- package/public/robots.txt +3 -3
- package/src/App.css +11 -11
- package/src/App.menu.tsx +209 -209
- package/src/App.routes.tsx +16 -16
- package/src/App.tsx +28 -28
- package/src/_core/hooks/ImageChecker.tsx +26 -26
- package/src/_core/hooks/useIsMobile.ts +18 -18
- package/src/action/Action.view.tsx +21 -21
- package/src/action/ButtonAction.tsx +32 -32
- package/src/action/action.css +20 -20
- package/src/badge/Badge.tsx +34 -34
- package/src/badge/Badge.view.tsx +15 -15
- package/src/badge/badge.css +55 -55
- package/src/button/Button.tsx +44 -44
- package/src/button/Button.view.tsx +61 -61
- package/src/button/button.css +53 -53
- package/src/button/button.interface.tsx +20 -20
- package/src/button/buttonActions/ButtonActions.tsx +101 -101
- package/src/card/Card.tsx +125 -125
- package/src/card/Card.view.tsx +73 -73
- package/src/card/card.css +145 -145
- package/src/card/card.interface.tsx +9 -9
- package/src/card/cardAction/CardAction.tsx +135 -135
- package/src/card/cardAction/cardAction.css +10 -10
- package/src/card/cardAction.interface.tsx +10 -10
- package/src/card/hook/useCardInteractions.tsx +30 -30
- package/src/carousel/Carousel.css +44 -44
- package/src/carousel/Carousel.tsx +115 -115
- package/src/carousel/Carousel.view.tsx +13 -13
- package/src/damier/Damier.tsx +55 -55
- package/src/damier/Damier.view.tsx +31 -31
- package/src/damier/damier.css +44 -44
- package/src/damier/damierCell/DamierCell.tsx +18 -18
- package/src/damier/damierCell/damierCell.interface.tsx +5 -5
- package/src/dataTable/DataTable.tsx +236 -202
- package/src/dataTable/DataTable.view.tsx +59 -59
- package/src/dataTable/dataTable.css +16 -14
- package/src/dataTable/dataTable.interface.ts +29 -29
- package/src/datePicker/DatePicker.tsx +110 -110
- package/src/datePicker/DatePicker.view.tsx +9 -9
- package/src/datePicker/datePicker.css +77 -77
- package/src/expands/Expands.tsx +42 -42
- package/src/expands/Expands.view.tsx +90 -90
- package/src/expands/expand/expand.interface.tsx +8 -8
- package/src/expands/expand/expand.tsx +75 -75
- package/src/expands/expands.css +97 -97
- package/src/filAriane/FilAriane.tsx +57 -57
- package/src/filAriane/FilAriane.view.tsx +28 -28
- package/src/filAriane/filAriane.css +22 -22
- package/src/filAriane/filAriane.interface.tsx +6 -6
- package/src/form/Form.tsx +175 -175
- package/src/form/Form.view.tsx +47 -47
- package/src/form/form.css +37 -37
- package/src/form/form.enum.ts +11 -11
- package/src/form/form.interface.tsx +31 -31
- package/src/form/textArea/TextArea.tsx +53 -53
- package/src/form/textArea/TextArea.view.tsx +34 -34
- package/src/form/textArea/textArea.css +9 -9
- package/src/grid/Grid.tsx +21 -21
- package/src/grid/Grid.view.tsx +24 -24
- package/src/grid/col/Col.tsx +15 -15
- package/src/grid/col/colStyled/ColStyled.tsx +41 -41
- package/src/grid/container/Container.tsx +8 -8
- package/src/grid/container/container.css +5 -5
- package/src/grid/grid.interface.tsx +7 -7
- package/src/grid/row/Row.tsx +12 -12
- package/src/grid/row/row.css +18 -18
- package/src/header/Header.tsx +51 -51
- package/src/header/Header.view.tsx +5 -5
- package/src/header/header.css +26 -26
- package/src/header/header.interface.tsx +8 -8
- package/src/home/Home.tsx +3 -3
- package/src/icon/Icon.tsx +6 -6
- package/src/icon/Icons.view.tsx +29 -29
- package/src/icon/icon.css +20 -20
- package/src/icon/icon.interface.tsx +6 -6
- package/src/icon/iconSize.enum.ts +7 -7
- package/src/index.css +502 -502
- package/src/index.ts +33 -33
- package/src/loader/Loader.tsx +37 -37
- package/src/loader/Loader.view.tsx +20 -20
- package/src/loader/loader.css +30 -30
- package/src/main.tsx +10 -10
- package/src/menus/Menus.tsx +42 -42
- package/src/menus/Menus.view.tsx +39 -39
- package/src/menus/menu/Menu.tsx +17 -17
- package/src/menus/menu/menu.interface.tsx +9 -9
- package/src/menus/menus.css +47 -47
- package/src/modal/Modal.tsx +53 -53
- package/src/modal/Modal.view.tsx +25 -25
- package/src/modal/modal.css +69 -65
- package/src/notFound/NotFound.tsx +3 -3
- package/src/overlayPanel/OverlayPanel.tsx +189 -189
- package/src/overlayPanel/OverlayPanel.view.tsx +25 -25
- package/src/overlayPanel/overlay.context.tsx +28 -28
- package/src/overlayPanel/overlayPanel.css +35 -35
- package/src/overlayPanel/overlayPanelStyled/OverlayPanelStyled.tsx +18 -18
- package/src/quantity/Quantity.tsx +103 -103
- package/src/quantity/quantity.css +26 -26
- package/src/search/Search.tsx +161 -161
- package/src/search/Search.view.tsx +14 -14
- package/src/search/search.css +59 -59
- package/src/select/Select.tsx +53 -53
- package/src/select/Select.view.tsx +71 -71
- package/src/select/select.css +51 -51
- package/src/select/selectOption.interface.ts +4 -4
- package/src/sidebar/Sidebar.tsx +111 -111
- package/src/sidebar/Sidebar.view.tsx +17 -17
- package/src/sidebar/sidebar.css +87 -87
- package/src/sidebarData/SidebarData.tsx +19 -19
- package/src/sidebarData/SidebarData.view.tsx +19 -19
- package/src/sidebarData/sidebarData.css +27 -27
- package/src/toaster/Toaster.tsx +47 -47
- package/src/toaster/Toaster.view.tsx +3 -3
- package/src/toaster/store/useToasterStore.tsx +39 -39
- package/src/toaster/toaster.css +57 -57
- package/tsconfig.json +28 -28
- package/vite.config.ts +20 -20
- package/vite.config.ts.timestamp-1733262892554-a13dfef6e8a29.mjs +24 -24
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from "react";
|
|
2
|
-
import "./textArea.css";
|
|
3
|
-
export type TextAreaProps = {
|
|
4
|
-
name: string;
|
|
5
|
-
value?: string;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
width?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
onChange?: (value: string, name: string) => void;
|
|
10
|
-
placeholder?: string;
|
|
11
|
-
rows?: number;
|
|
12
|
-
cols?: number;
|
|
13
|
-
};
|
|
14
|
-
export const TextArea = ({
|
|
15
|
-
name,
|
|
16
|
-
value,
|
|
17
|
-
disabled,
|
|
18
|
-
width,
|
|
19
|
-
className,
|
|
20
|
-
onChange,
|
|
21
|
-
placeholder,
|
|
22
|
-
cols,
|
|
23
|
-
rows,
|
|
24
|
-
}: TextAreaProps) => {
|
|
25
|
-
const [textAreaValue, setTextAreaValue] = useState(value);
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
setTextAreaValue(value);
|
|
28
|
-
}, [value]);
|
|
29
|
-
|
|
30
|
-
const handleChange = useCallback(
|
|
31
|
-
(e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
32
|
-
const newValue = e.target.value;
|
|
33
|
-
setTextAreaValue(newValue);
|
|
34
|
-
if (onChange) {
|
|
35
|
-
onChange(newValue, name);
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
[onChange, name]
|
|
39
|
-
);
|
|
40
|
-
return (
|
|
41
|
-
<textarea
|
|
42
|
-
style={{ width: width }}
|
|
43
|
-
className={`form-control-textarea ${className ?? ""}`}
|
|
44
|
-
name={name}
|
|
45
|
-
disabled={disabled}
|
|
46
|
-
value={textAreaValue}
|
|
47
|
-
onChange={handleChange}
|
|
48
|
-
placeholder={placeholder}
|
|
49
|
-
cols={cols}
|
|
50
|
-
rows={rows}
|
|
51
|
-
/>
|
|
52
|
-
);
|
|
53
|
-
};
|
|
1
|
+
import { useCallback, useEffect, useState } from "react";
|
|
2
|
+
import "./textArea.css";
|
|
3
|
+
export type TextAreaProps = {
|
|
4
|
+
name: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
width?: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
onChange?: (value: string, name: string) => void;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
rows?: number;
|
|
12
|
+
cols?: number;
|
|
13
|
+
};
|
|
14
|
+
export const TextArea = ({
|
|
15
|
+
name,
|
|
16
|
+
value,
|
|
17
|
+
disabled,
|
|
18
|
+
width,
|
|
19
|
+
className,
|
|
20
|
+
onChange,
|
|
21
|
+
placeholder,
|
|
22
|
+
cols,
|
|
23
|
+
rows,
|
|
24
|
+
}: TextAreaProps) => {
|
|
25
|
+
const [textAreaValue, setTextAreaValue] = useState(value);
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
setTextAreaValue(value);
|
|
28
|
+
}, [value]);
|
|
29
|
+
|
|
30
|
+
const handleChange = useCallback(
|
|
31
|
+
(e: React.ChangeEvent<HTMLTextAreaElement>) => {
|
|
32
|
+
const newValue = e.target.value;
|
|
33
|
+
setTextAreaValue(newValue);
|
|
34
|
+
if (onChange) {
|
|
35
|
+
onChange(newValue, name);
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
[onChange, name]
|
|
39
|
+
);
|
|
40
|
+
return (
|
|
41
|
+
<textarea
|
|
42
|
+
style={{ width: width }}
|
|
43
|
+
className={`form-control-textarea ${className ?? ""}`}
|
|
44
|
+
name={name}
|
|
45
|
+
disabled={disabled}
|
|
46
|
+
value={textAreaValue}
|
|
47
|
+
onChange={handleChange}
|
|
48
|
+
placeholder={placeholder}
|
|
49
|
+
cols={cols}
|
|
50
|
+
rows={rows}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import { TextArea } from "./TextArea";
|
|
3
|
-
|
|
4
|
-
export const TextAreaView = () => {
|
|
5
|
-
const textAreaData = useMemo(
|
|
6
|
-
() => [
|
|
7
|
-
{
|
|
8
|
-
name: "textArea",
|
|
9
|
-
value:
|
|
10
|
-
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
11
|
-
placeholder: "Enter text here...",
|
|
12
|
-
rows: 5,
|
|
13
|
-
cols: 50,
|
|
14
|
-
},
|
|
15
|
-
],
|
|
16
|
-
[]
|
|
17
|
-
);
|
|
18
|
-
return (
|
|
19
|
-
<div>
|
|
20
|
-
<h1>TextArea</h1>
|
|
21
|
-
{textAreaData.map((textArea, index) => (
|
|
22
|
-
<div key={index}>
|
|
23
|
-
<TextArea
|
|
24
|
-
name={textArea.name}
|
|
25
|
-
value={textArea.value}
|
|
26
|
-
placeholder={textArea.placeholder}
|
|
27
|
-
rows={textArea.rows}
|
|
28
|
-
cols={textArea.cols}
|
|
29
|
-
/>
|
|
30
|
-
</div>
|
|
31
|
-
))}
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { TextArea } from "./TextArea";
|
|
3
|
+
|
|
4
|
+
export const TextAreaView = () => {
|
|
5
|
+
const textAreaData = useMemo(
|
|
6
|
+
() => [
|
|
7
|
+
{
|
|
8
|
+
name: "textArea",
|
|
9
|
+
value:
|
|
10
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
11
|
+
placeholder: "Enter text here...",
|
|
12
|
+
rows: 5,
|
|
13
|
+
cols: 50,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
[]
|
|
17
|
+
);
|
|
18
|
+
return (
|
|
19
|
+
<div>
|
|
20
|
+
<h1>TextArea</h1>
|
|
21
|
+
{textAreaData.map((textArea, index) => (
|
|
22
|
+
<div key={index}>
|
|
23
|
+
<TextArea
|
|
24
|
+
name={textArea.name}
|
|
25
|
+
value={textArea.value}
|
|
26
|
+
placeholder={textArea.placeholder}
|
|
27
|
+
rows={textArea.rows}
|
|
28
|
+
cols={textArea.cols}
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
))}
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
.form-control-textarea {
|
|
2
|
-
border: 1px solid #cfbdbd;
|
|
3
|
-
padding: 0.5rem 1rem;
|
|
4
|
-
border-radius: 4px;
|
|
5
|
-
margin: 0.25rem 0;
|
|
6
|
-
min-width: 250px;
|
|
7
|
-
resize: none;
|
|
8
|
-
font-size: 0.9rem;
|
|
9
|
-
}
|
|
1
|
+
.form-control-textarea {
|
|
2
|
+
border: 1px solid #cfbdbd;
|
|
3
|
+
padding: 0.5rem 1rem;
|
|
4
|
+
border-radius: 4px;
|
|
5
|
+
margin: 0.25rem 0;
|
|
6
|
+
min-width: 250px;
|
|
7
|
+
resize: none;
|
|
8
|
+
font-size: 0.9rem;
|
|
9
|
+
}
|
package/src/grid/Grid.tsx
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Col } from "./col/Col";
|
|
2
|
-
import { Container } from "./container/Container";
|
|
3
|
-
import { GridInterface } from "./grid.interface";
|
|
4
|
-
import { Row } from "./row/Row";
|
|
5
|
-
type GridProps = {
|
|
6
|
-
items: GridInterface[];
|
|
7
|
-
className?: string;
|
|
8
|
-
scroll?: boolean;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const Grid = ({ items, className, scroll }: GridProps) => {
|
|
12
|
-
return (
|
|
13
|
-
<Container>
|
|
14
|
-
<Row scroll={scroll} className={className}>
|
|
15
|
-
{items.map((item, id) => (
|
|
16
|
-
<Col key={id} {...item} />
|
|
17
|
-
))}
|
|
18
|
-
</Row>
|
|
19
|
-
</Container>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
1
|
+
import { Col } from "./col/Col";
|
|
2
|
+
import { Container } from "./container/Container";
|
|
3
|
+
import { GridInterface } from "./grid.interface";
|
|
4
|
+
import { Row } from "./row/Row";
|
|
5
|
+
type GridProps = {
|
|
6
|
+
items: GridInterface[];
|
|
7
|
+
className?: string;
|
|
8
|
+
scroll?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const Grid = ({ items, className, scroll }: GridProps) => {
|
|
12
|
+
return (
|
|
13
|
+
<Container>
|
|
14
|
+
<Row scroll={scroll} className={className}>
|
|
15
|
+
{items.map((item, id) => (
|
|
16
|
+
<Col key={id} {...item} />
|
|
17
|
+
))}
|
|
18
|
+
</Row>
|
|
19
|
+
</Container>
|
|
20
|
+
);
|
|
21
|
+
};
|
package/src/grid/Grid.view.tsx
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { Grid } from "./Grid";
|
|
2
|
-
import { GridInterface } from "./grid.interface";
|
|
3
|
-
|
|
4
|
-
export const GridView = (): JSX.Element => {
|
|
5
|
-
const mockItems: GridInterface[] = [
|
|
6
|
-
{
|
|
7
|
-
md: 6,
|
|
8
|
-
lg: 4,
|
|
9
|
-
children: <>test</>,
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
md: 6,
|
|
13
|
-
lg: 4,
|
|
14
|
-
children: <>test 2 </>,
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
md: 6,
|
|
18
|
-
lg: 4,
|
|
19
|
-
children: <>test 3 </>,
|
|
20
|
-
},
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
return <Grid items={mockItems} />;
|
|
24
|
-
};
|
|
1
|
+
import { Grid } from "./Grid";
|
|
2
|
+
import { GridInterface } from "./grid.interface";
|
|
3
|
+
|
|
4
|
+
export const GridView = (): JSX.Element => {
|
|
5
|
+
const mockItems: GridInterface[] = [
|
|
6
|
+
{
|
|
7
|
+
md: 6,
|
|
8
|
+
lg: 4,
|
|
9
|
+
children: <>test</>,
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
md: 6,
|
|
13
|
+
lg: 4,
|
|
14
|
+
children: <>test 2 </>,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
md: 6,
|
|
18
|
+
lg: 4,
|
|
19
|
+
children: <>test 3 </>,
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
return <Grid items={mockItems} />;
|
|
24
|
+
};
|
package/src/grid/col/Col.tsx
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ColStyled } from "./colStyled/ColStyled";
|
|
2
|
-
type ColProps = {
|
|
3
|
-
xs?: number;
|
|
4
|
-
sm?: number;
|
|
5
|
-
md?: number;
|
|
6
|
-
lg?: number;
|
|
7
|
-
children: React.ReactNode;
|
|
8
|
-
};
|
|
9
|
-
export const Col: React.FC<ColProps> = ({ xs, sm, md, lg, children }) => {
|
|
10
|
-
return (
|
|
11
|
-
<ColStyled $xs={xs} $sm={sm} $md={md} $lg={lg}>
|
|
12
|
-
{children}
|
|
13
|
-
</ColStyled>
|
|
14
|
-
);
|
|
15
|
-
};
|
|
1
|
+
import { ColStyled } from "./colStyled/ColStyled";
|
|
2
|
+
type ColProps = {
|
|
3
|
+
xs?: number;
|
|
4
|
+
sm?: number;
|
|
5
|
+
md?: number;
|
|
6
|
+
lg?: number;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export const Col: React.FC<ColProps> = ({ xs, sm, md, lg, children }) => {
|
|
10
|
+
return (
|
|
11
|
+
<ColStyled $xs={xs} $sm={sm} $md={md} $lg={lg}>
|
|
12
|
+
{children}
|
|
13
|
+
</ColStyled>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import styled, { css } from "styled-components";
|
|
2
|
-
const getColWidth = (size = 12) => `${(size / 12) * 100}%`;
|
|
3
|
-
type ColStyledProps = {
|
|
4
|
-
$xs?: number;
|
|
5
|
-
$sm?: number;
|
|
6
|
-
$md?: number;
|
|
7
|
-
$lg?: number;
|
|
8
|
-
};
|
|
9
|
-
export const ColStyled = styled.div<ColStyledProps>`
|
|
10
|
-
padding: 0 15px;
|
|
11
|
-
flex: 0 0 ${({ $xs }) => getColWidth($xs)};
|
|
12
|
-
max-width: ${({ $xs }) => getColWidth($xs)};
|
|
13
|
-
margin-bottom: 0.5rem;
|
|
14
|
-
margin-top: 0.5rem;
|
|
15
|
-
${({ $sm }) =>
|
|
16
|
-
$sm &&
|
|
17
|
-
css`
|
|
18
|
-
@container (min-width: 576px) {
|
|
19
|
-
flex: 0 0 ${getColWidth($sm)};
|
|
20
|
-
max-width: ${getColWidth($sm)};
|
|
21
|
-
}
|
|
22
|
-
`}
|
|
23
|
-
|
|
24
|
-
${({ $md }) =>
|
|
25
|
-
$md &&
|
|
26
|
-
css`
|
|
27
|
-
@container (min-width: 768px) {
|
|
28
|
-
flex: 0 0 ${getColWidth($md)};
|
|
29
|
-
max-width: ${getColWidth($md)};
|
|
30
|
-
}
|
|
31
|
-
`}
|
|
32
|
-
|
|
33
|
-
${({ $lg }) =>
|
|
34
|
-
$lg &&
|
|
35
|
-
css`
|
|
36
|
-
@container (min-width: 992px) {
|
|
37
|
-
flex: 0 0 ${getColWidth($lg)};
|
|
38
|
-
max-width: ${getColWidth($lg)};
|
|
39
|
-
}
|
|
40
|
-
`}
|
|
41
|
-
`;
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
const getColWidth = (size = 12) => `${(size / 12) * 100}%`;
|
|
3
|
+
type ColStyledProps = {
|
|
4
|
+
$xs?: number;
|
|
5
|
+
$sm?: number;
|
|
6
|
+
$md?: number;
|
|
7
|
+
$lg?: number;
|
|
8
|
+
};
|
|
9
|
+
export const ColStyled = styled.div<ColStyledProps>`
|
|
10
|
+
padding: 0 15px;
|
|
11
|
+
flex: 0 0 ${({ $xs }) => getColWidth($xs)};
|
|
12
|
+
max-width: ${({ $xs }) => getColWidth($xs)};
|
|
13
|
+
margin-bottom: 0.5rem;
|
|
14
|
+
margin-top: 0.5rem;
|
|
15
|
+
${({ $sm }) =>
|
|
16
|
+
$sm &&
|
|
17
|
+
css`
|
|
18
|
+
@container (min-width: 576px) {
|
|
19
|
+
flex: 0 0 ${getColWidth($sm)};
|
|
20
|
+
max-width: ${getColWidth($sm)};
|
|
21
|
+
}
|
|
22
|
+
`}
|
|
23
|
+
|
|
24
|
+
${({ $md }) =>
|
|
25
|
+
$md &&
|
|
26
|
+
css`
|
|
27
|
+
@container (min-width: 768px) {
|
|
28
|
+
flex: 0 0 ${getColWidth($md)};
|
|
29
|
+
max-width: ${getColWidth($md)};
|
|
30
|
+
}
|
|
31
|
+
`}
|
|
32
|
+
|
|
33
|
+
${({ $lg }) =>
|
|
34
|
+
$lg &&
|
|
35
|
+
css`
|
|
36
|
+
@container (min-width: 992px) {
|
|
37
|
+
flex: 0 0 ${getColWidth($lg)};
|
|
38
|
+
max-width: ${getColWidth($lg)};
|
|
39
|
+
}
|
|
40
|
+
`}
|
|
41
|
+
`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import "./container.css";
|
|
3
|
-
type ContainerProps = {
|
|
4
|
-
children: React.ReactNode;
|
|
5
|
-
};
|
|
6
|
-
export const Container: React.FC<ContainerProps> = ({ children }) => (
|
|
7
|
-
<div className="container">{children}</div>
|
|
8
|
-
);
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./container.css";
|
|
3
|
+
type ContainerProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export const Container: React.FC<ContainerProps> = ({ children }) => (
|
|
7
|
+
<div className="container">{children}</div>
|
|
8
|
+
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
width: 100%;
|
|
3
|
-
margin: 0 auto;
|
|
4
|
-
padding: 0 15px;
|
|
5
|
-
}
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
margin: 0 auto;
|
|
4
|
+
padding: 0 15px;
|
|
5
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface GridInterface {
|
|
2
|
-
sm?: number;
|
|
3
|
-
xs?: number;
|
|
4
|
-
md?: number;
|
|
5
|
-
lg?: number;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
}
|
|
1
|
+
export interface GridInterface {
|
|
2
|
+
sm?: number;
|
|
3
|
+
xs?: number;
|
|
4
|
+
md?: number;
|
|
5
|
+
lg?: number;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
package/src/grid/row/Row.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./row.css";
|
|
2
|
-
type RowProps = {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
className?: string;
|
|
5
|
-
scroll?: boolean;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const Row: React.FC<RowProps> = ({ children, className, scroll }) => (
|
|
9
|
-
<div className={`grid-row ${className ?? ""} ${scroll ? "scroll" : ""}`}>
|
|
10
|
-
{children}
|
|
11
|
-
</div>
|
|
12
|
-
);
|
|
1
|
+
import "./row.css";
|
|
2
|
+
type RowProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
scroll?: boolean;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const Row: React.FC<RowProps> = ({ children, className, scroll }) => (
|
|
9
|
+
<div className={`grid-row ${className ?? ""} ${scroll ? "scroll" : ""}`}>
|
|
10
|
+
{children}
|
|
11
|
+
</div>
|
|
12
|
+
);
|
package/src/grid/row/row.css
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
.grid-row {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-wrap: wrap;
|
|
4
|
-
margin: 0 -15px;
|
|
5
|
-
&.scroll {
|
|
6
|
-
overflow-x: auto;
|
|
7
|
-
flex-wrap: nowrap;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@container (min-width: 998px) {
|
|
12
|
-
.grid-row {
|
|
13
|
-
&.scroll {
|
|
14
|
-
overflow-x: auto;
|
|
15
|
-
flex-wrap: wrap;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
1
|
+
.grid-row {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
margin: 0 -15px;
|
|
5
|
+
&.scroll {
|
|
6
|
+
overflow-x: auto;
|
|
7
|
+
flex-wrap: nowrap;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@container (min-width: 998px) {
|
|
12
|
+
.grid-row {
|
|
13
|
+
&.scroll {
|
|
14
|
+
overflow-x: auto;
|
|
15
|
+
flex-wrap: wrap;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
package/src/header/Header.tsx
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
import { useCallback, useRef, useState } from "react";
|
|
2
|
-
import { Icon } from "../icon/Icon";
|
|
3
|
-
import { IconSizeEnum } from "../icon/iconSize.enum";
|
|
4
|
-
import { OverlayPanel } from "../overlayPanel/OverlayPanel";
|
|
5
|
-
import "./header.css";
|
|
6
|
-
import { HeaderInterface } from "./header.interface";
|
|
7
|
-
|
|
8
|
-
export const Header = ({
|
|
9
|
-
children,
|
|
10
|
-
logo,
|
|
11
|
-
onClickMenu,
|
|
12
|
-
userChildren,
|
|
13
|
-
positionFixed,
|
|
14
|
-
onClickLogo,
|
|
15
|
-
}: HeaderInterface): JSX.Element => {
|
|
16
|
-
const refButton = useRef<HTMLDivElement>(null);
|
|
17
|
-
const [openOverlay, setOpenOverlay] = useState(false);
|
|
18
|
-
const onClickUser = useCallback(() => {
|
|
19
|
-
setOpenOverlay(!openOverlay);
|
|
20
|
-
}, [openOverlay, setOpenOverlay]);
|
|
21
|
-
return (
|
|
22
|
-
<div className={`header ${positionFixed ? "header--fixed" : ""}`}>
|
|
23
|
-
<div className="flex-1 d-flex align-items-center">
|
|
24
|
-
<span onClick={onClickMenu}>
|
|
25
|
-
<Icon size={IconSizeEnum.MEDIUM} classIcon="bi-list"></Icon>
|
|
26
|
-
</span>
|
|
27
|
-
<span
|
|
28
|
-
className={`header-logo ${onClickLogo && "cursor-pointer"} `}
|
|
29
|
-
onClick={onClickLogo}
|
|
30
|
-
>
|
|
31
|
-
{logo && <img src={logo} alt="logo" />}
|
|
32
|
-
</span>
|
|
33
|
-
</div>
|
|
34
|
-
<div className="d-flex align-items-center">
|
|
35
|
-
{children}
|
|
36
|
-
<div ref={refButton} onClick={onClickUser}>
|
|
37
|
-
<Icon size={IconSizeEnum.MEDIUM} classIcon="bi-person-circle"></Icon>
|
|
38
|
-
</div>
|
|
39
|
-
{openOverlay && refButton.current && (
|
|
40
|
-
<OverlayPanel
|
|
41
|
-
position="bottomRight"
|
|
42
|
-
show={openOverlay}
|
|
43
|
-
closeOverlay={setOpenOverlay}
|
|
44
|
-
referenceElement={refButton.current}
|
|
45
|
-
children={userChildren}
|
|
46
|
-
/>
|
|
47
|
-
)}
|
|
48
|
-
</div>
|
|
49
|
-
</div>
|
|
50
|
-
);
|
|
51
|
-
};
|
|
1
|
+
import { useCallback, useRef, useState } from "react";
|
|
2
|
+
import { Icon } from "../icon/Icon";
|
|
3
|
+
import { IconSizeEnum } from "../icon/iconSize.enum";
|
|
4
|
+
import { OverlayPanel } from "../overlayPanel/OverlayPanel";
|
|
5
|
+
import "./header.css";
|
|
6
|
+
import { HeaderInterface } from "./header.interface";
|
|
7
|
+
|
|
8
|
+
export const Header = ({
|
|
9
|
+
children,
|
|
10
|
+
logo,
|
|
11
|
+
onClickMenu,
|
|
12
|
+
userChildren,
|
|
13
|
+
positionFixed,
|
|
14
|
+
onClickLogo,
|
|
15
|
+
}: HeaderInterface): JSX.Element => {
|
|
16
|
+
const refButton = useRef<HTMLDivElement>(null);
|
|
17
|
+
const [openOverlay, setOpenOverlay] = useState(false);
|
|
18
|
+
const onClickUser = useCallback(() => {
|
|
19
|
+
setOpenOverlay(!openOverlay);
|
|
20
|
+
}, [openOverlay, setOpenOverlay]);
|
|
21
|
+
return (
|
|
22
|
+
<div className={`header ${positionFixed ? "header--fixed" : ""}`}>
|
|
23
|
+
<div className="flex-1 d-flex align-items-center">
|
|
24
|
+
<span onClick={onClickMenu}>
|
|
25
|
+
<Icon size={IconSizeEnum.MEDIUM} classIcon="bi-list"></Icon>
|
|
26
|
+
</span>
|
|
27
|
+
<span
|
|
28
|
+
className={`header-logo ${onClickLogo && "cursor-pointer"} `}
|
|
29
|
+
onClick={onClickLogo}
|
|
30
|
+
>
|
|
31
|
+
{logo && <img src={logo} alt="logo" />}
|
|
32
|
+
</span>
|
|
33
|
+
</div>
|
|
34
|
+
<div className="d-flex align-items-center">
|
|
35
|
+
{children}
|
|
36
|
+
<div ref={refButton} onClick={onClickUser}>
|
|
37
|
+
<Icon size={IconSizeEnum.MEDIUM} classIcon="bi-person-circle"></Icon>
|
|
38
|
+
</div>
|
|
39
|
+
{openOverlay && refButton.current && (
|
|
40
|
+
<OverlayPanel
|
|
41
|
+
position="bottomRight"
|
|
42
|
+
show={openOverlay}
|
|
43
|
+
closeOverlay={setOpenOverlay}
|
|
44
|
+
referenceElement={refButton.current}
|
|
45
|
+
children={userChildren}
|
|
46
|
+
/>
|
|
47
|
+
)}
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Header } from "./Header";
|
|
2
|
-
|
|
3
|
-
export const HeaderView = (): JSX.Element => {
|
|
4
|
-
return <Header />;
|
|
5
|
-
};
|
|
1
|
+
import { Header } from "./Header";
|
|
2
|
+
|
|
3
|
+
export const HeaderView = (): JSX.Element => {
|
|
4
|
+
return <Header />;
|
|
5
|
+
};
|