@campxdev/react-blueprint 0.1.12 → 0.1.14

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 (51) hide show
  1. package/.storybook/main.ts +4 -3
  2. package/.storybook/preview.tsx +30 -13
  3. package/package.json +6 -3
  4. package/src/components/DataDisplay/DataTable/DataTable.stories.tsx +63 -0
  5. package/src/components/DataDisplay/DataTable/DataTable.tsx +27 -0
  6. package/src/components/DataDisplay/DataTable/TablePagination.tsx +22 -0
  7. package/src/components/DataDisplay/styles.tsx +5 -0
  8. package/src/components/Input/Button/Button.stories.tsx +5 -0
  9. package/src/components/Input/Button/Button.tsx +8 -1
  10. package/src/components/Input/Button/ButtonLoader.css +24 -0
  11. package/src/components/Input/SingleSelect/SingleSelect.tsx +8 -0
  12. package/src/components/Input/components/FetchingOptionsLoader.tsx +10 -0
  13. package/src/components/Layout/LayoutWrapper/LayoutWrapper.stories.tsx +48 -5
  14. package/src/components/Layout/LayoutWrapper/LayoutWrapper.tsx +41 -22
  15. package/src/components/Layout/SideNavigation/SideNavigation.tsx +5 -4
  16. package/src/components/Layout/SideNavigation/styles/styles.tsx +3 -0
  17. package/src/components/Layout/Spinner/Spinner.css +32 -0
  18. package/src/components/Layout/Spinner/Spinner.stories.tsx +20 -0
  19. package/src/components/Layout/Spinner/Spinner.tsx +5 -0
  20. package/.env +0 -1
  21. package/src/components/Layout/ComponentBackground/ComponentBackground.tsx +0 -83
  22. package/src/components/Layout/ComponentBackground/DefaultBackground.tsx +0 -12
  23. package/src/components/Layout/ComponentBackground/PaperBackground.tsx +0 -12
  24. package/src/components/Layout/SideNavigation/SideNavigation.stories.tsx +0 -30
  25. package/src/components/Typography/Typography.stories.tsx +0 -95
  26. package/src/stories/Button.stories.ts +0 -52
  27. package/src/stories/Button.tsx +0 -48
  28. package/src/stories/Configure.mdx +0 -364
  29. package/src/stories/Header.stories.ts +0 -33
  30. package/src/stories/Header.tsx +0 -56
  31. package/src/stories/Page.stories.ts +0 -32
  32. package/src/stories/Page.tsx +0 -73
  33. package/src/stories/assets/accessibility.png +0 -0
  34. package/src/stories/assets/accessibility.svg +0 -5
  35. package/src/stories/assets/addon-library.png +0 -0
  36. package/src/stories/assets/assets.png +0 -0
  37. package/src/stories/assets/avif-test-image.avif +0 -0
  38. package/src/stories/assets/context.png +0 -0
  39. package/src/stories/assets/discord.svg +0 -15
  40. package/src/stories/assets/docs.png +0 -0
  41. package/src/stories/assets/figma-plugin.png +0 -0
  42. package/src/stories/assets/github.svg +0 -3
  43. package/src/stories/assets/share.png +0 -0
  44. package/src/stories/assets/styling.png +0 -0
  45. package/src/stories/assets/testing.png +0 -0
  46. package/src/stories/assets/theming.png +0 -0
  47. package/src/stories/assets/tutorials.svg +0 -12
  48. package/src/stories/assets/youtube.svg +0 -4
  49. package/src/stories/button.css +0 -30
  50. package/src/stories/header.css +0 -32
  51. package/src/stories/page.css +0 -69
@@ -10,7 +10,8 @@ const config: StorybookConfig = {
10
10
  "@storybook/addon-essentials",
11
11
  "@chromatic-com/storybook",
12
12
  "@storybook/addon-interactions",
13
- "@storybook/addon-mdx-gfm"
13
+ "@storybook/addon-mdx-gfm",
14
+ "storybook-dark-mode",
14
15
  ],
15
16
 
16
17
  framework: {
@@ -23,7 +24,7 @@ const config: StorybookConfig = {
23
24
  staticDirs: ["../public"],
24
25
 
25
26
  typescript: {
26
- reactDocgen: "react-docgen-typescript"
27
- }
27
+ reactDocgen: "react-docgen-typescript",
28
+ },
28
29
  };
29
30
  export default config;
@@ -1,17 +1,12 @@
1
1
  import { CssBaseline } from "@mui/material";
2
2
  import type { Preview } from "@storybook/react";
3
3
  import React from "react";
4
+ import { MuiThemeProvider } from "../src/themes/MuiThemeProvider";
5
+ import { useDarkMode } from "storybook-dark-mode";
6
+ import { darkTheme } from "../src/themes/darkTheme";
7
+ import { lightTheme } from "../src/themes/lightTheme";
8
+ import { DarkColorTokens, LightColorTokens } from "../src/themes/colorTokens";
4
9
  import { BrowserRouter } from "react-router-dom";
5
- import { ComponentBackground } from "../src/components/Layout/ComponentBackground/ComponentBackground";
6
-
7
- const withThemeProvider = (Story) => (
8
- <ComponentBackground>
9
- <BrowserRouter>
10
- <Story />
11
- </BrowserRouter>
12
- <CssBaseline />
13
- </ComponentBackground>
14
- );
15
10
 
16
11
  const preview: Preview = {
17
12
  parameters: {
@@ -21,10 +16,32 @@ const preview: Preview = {
21
16
  date: /Date$/i,
22
17
  },
23
18
  },
19
+ backgrounds: {
20
+ default: "light", // name of the default background to use
21
+ values: [
22
+ { name: "light", value: LightColorTokens.background.default },
23
+ { name: "light paper", value: LightColorTokens.background.paper },
24
+ { name: "dark", value: DarkColorTokens.background.default },
25
+ { name: "dark paper", value: DarkColorTokens.background.paper },
26
+ ],
27
+ },
24
28
  },
25
-
26
- decorators: [withThemeProvider],
27
- tags: ["autodocs"]
29
+ decorators: [
30
+ (Story) => {
31
+ const isDarkMode = useDarkMode();
32
+ console.log(isDarkMode);
33
+ const theme = isDarkMode ? darkTheme : lightTheme;
34
+ return (
35
+ <BrowserRouter>
36
+ <MuiThemeProvider theme={theme}>
37
+ <CssBaseline />
38
+ <Story />
39
+ </MuiThemeProvider>
40
+ </BrowserRouter>
41
+ );
42
+ },
43
+ ],
44
+ tags: ["autodocs"],
28
45
  };
29
46
 
30
47
  export default preview;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/react-blueprint",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "main": "./export.ts",
5
5
  "private": false,
6
6
  "dependencies": {
@@ -8,12 +8,13 @@
8
8
  "@emotion/styled": "^11.11.5",
9
9
  "@mui/icons-material": "^5.14.11",
10
10
  "@mui/material": "^5.14.11",
11
+ "@mui/x-data-grid": "^7.5.1",
12
+ "@storybook/addon-backgrounds": "^8.1.4",
11
13
  "@testing-library/jest-dom": "^5.14.1",
12
14
  "@testing-library/react": "^13.0.0",
13
15
  "@testing-library/user-event": "^13.2.1",
14
16
  "@types/jest": "^27.0.1",
15
17
  "@types/node": "^16.7.13",
16
- "react-error-boundary": "^3.1.4",
17
18
  "@types/react": "^18.0.0",
18
19
  "@types/react-dom": "^18.0.0",
19
20
  "axios": "^1.7.2",
@@ -21,8 +22,10 @@
21
22
  "pullstate": "^1.24.0",
22
23
  "react": "^18.3.1",
23
24
  "react-dom": "^18.3.1",
25
+ "react-error-boundary": "^3.1.4",
24
26
  "react-router-dom": "^6.4.2",
25
27
  "react-scripts": "5.0.1",
28
+ "storybook-dark-mode": "^4.0.1",
26
29
  "typescript": "^5.3.3",
27
30
  "web-vitals": "^2.1.0"
28
31
  },
@@ -55,7 +58,6 @@
55
58
  },
56
59
  "devDependencies": {
57
60
  "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
58
- "@types/js-cookie": "^3.0.5",
59
61
  "@chromatic-com/storybook": "^1.4.0",
60
62
  "@storybook/addon-essentials": "^8.1.4",
61
63
  "@storybook/addon-interactions": "^8.1.4",
@@ -67,6 +69,7 @@
67
69
  "@storybook/react": "^8.1.4",
68
70
  "@storybook/react-webpack5": "^8.1.4",
69
71
  "@storybook/test": "^8.1.4",
72
+ "@types/js-cookie": "^3.0.5",
70
73
  "eslint-plugin-storybook": "^0.8.0",
71
74
  "prop-types": "^15.8.1",
72
75
  "storybook": "^8.1.4",
@@ -0,0 +1,63 @@
1
+ import { GridColDef } from "@mui/x-data-grid";
2
+ import { Meta, StoryObj } from "@storybook/react";
3
+ import { DataTable } from "./DataTable"; // Make sure the path to your component is correct
4
+
5
+ const columns: GridColDef[] = [
6
+ { field: "id", headerName: "ID", width: 70 },
7
+ { field: "firstName", headerName: "First name", width: 130 },
8
+ { field: "lastName", headerName: "Last name", width: 130 },
9
+ { field: "age", headerName: "Age", type: "number", width: 90 },
10
+ {
11
+ field: "fullName",
12
+ headerName: "Full name",
13
+ description: "This column has a value getter and is not sortable.",
14
+ sortable: false,
15
+ width: 160,
16
+ },
17
+ ];
18
+
19
+ const rows = [
20
+ { id: 1, lastName: "Snow", firstName: "Jon", age: 35 },
21
+ { id: 2, lastName: "Lannister", firstName: "Cersei", age: 42 },
22
+ { id: 3, lastName: "Lannister", firstName: "Jaime", age: 45 },
23
+ { id: 4, lastName: "Stark", firstName: "Arya", age: 16 },
24
+ { id: 5, lastName: "Targaryen", firstName: "Daenerys", age: null },
25
+ { id: 6, lastName: "Melisandre", firstName: null, age: 150 },
26
+ { id: 7, lastName: "Clifford", firstName: "Ferrara", age: 44 },
27
+ { id: 8, lastName: "Frances", firstName: "Rossini", age: 36 },
28
+ { id: 9, lastName: "Roxie", firstName: "Harvey", age: 65 },
29
+ ];
30
+
31
+ // Define the default export with Meta type including the component type
32
+ const meta: Meta<typeof DataTable> = {
33
+ title: "DataDisplay/DataTable",
34
+ component: DataTable,
35
+ argTypes: {
36
+ totalCount: {
37
+ control: "number",
38
+ description: "Total Number of rows",
39
+ },
40
+ limit: {
41
+ control: "number",
42
+ description: "Total Number of rows",
43
+ },
44
+ offset: {
45
+ control: "number",
46
+ description: "Total Number of rows",
47
+ },
48
+ },
49
+ };
50
+
51
+ export default meta;
52
+ const Template: StoryObj<typeof DataTable> = {
53
+ render: (args) => <DataTable {...args} />,
54
+
55
+ args: {
56
+ columns,
57
+ rows,
58
+ },
59
+ };
60
+
61
+ export const Default: StoryObj<typeof DataTable> = {
62
+ ...Template,
63
+ };
@@ -0,0 +1,27 @@
1
+ import { Pagination } from "@mui/material";
2
+ import {
3
+ DataGrid as MuiDataGrid,
4
+ DataGridProps as MuiDataGridProps,
5
+ } from "@mui/x-data-grid";
6
+ import { DataGridContainer } from "../styles";
7
+
8
+ export type DataTableProps = {
9
+ limit: number;
10
+ offset: number;
11
+ totalCount: number;
12
+ } & MuiDataGridProps;
13
+
14
+ export const DataTable = (props: DataTableProps) => {
15
+ const pages = Math.ceil(props.totalCount / props.limit);
16
+ const currentPage = Math.ceil(props.offset / props.limit);
17
+ return (
18
+ <DataGridContainer>
19
+ <MuiDataGrid
20
+ {...props}
21
+ slots={{
22
+ pagination: () => <Pagination count={pages} page={currentPage} />,
23
+ }}
24
+ />
25
+ </DataGridContainer>
26
+ );
27
+ };
@@ -0,0 +1,22 @@
1
+ import {
2
+ Pagination as MuiPagination,
3
+ PaginationProps as MuiPaginationProps,
4
+ Stack,
5
+ } from "@mui/material";
6
+ import { Typography } from "../../Typography/Typography";
7
+
8
+ export type PaginationProps = {
9
+ pageStart: number;
10
+ pageEnd: number;
11
+ totalCount: number;
12
+ } & MuiPaginationProps;
13
+
14
+ export const TablePagination = (props: PaginationProps) => {
15
+ const { pageStart, pageEnd, totalCount } = props;
16
+ return (
17
+ <Stack direction="row">
18
+ <Typography variant="caption">{`${pageStart} - ${pageEnd} of ${totalCount}`}</Typography>
19
+ <MuiPagination {...props} variant="outlined" shape="rounded" />
20
+ </Stack>
21
+ );
22
+ };
@@ -0,0 +1,5 @@
1
+ import { Box, styled } from "@mui/material";
2
+
3
+ export const DataGridContainer = styled(Box)(({ theme }) => ({
4
+ backgroundColor: theme.palette.background.paper,
5
+ }));
@@ -30,6 +30,11 @@ export default {
30
30
  description: "Disabled Button",
31
31
  defaultValue: false,
32
32
  },
33
+ loading: {
34
+ control: "boolean",
35
+ description: "Loading Button",
36
+ defaultValue: false,
37
+ },
33
38
  },
34
39
  } as Meta<typeof Button>;
35
40
 
@@ -2,9 +2,16 @@ import {
2
2
  Button as MuiButton,
3
3
  ButtonProps as MuiButtonProps,
4
4
  } from "@mui/material";
5
+ import "./ButtonLoader.css";
5
6
 
6
- export type ButtonProps = {} & MuiButtonProps;
7
+ export type ButtonProps = { loading: boolean } & MuiButtonProps;
7
8
 
8
9
  export const Button = (props: ButtonProps) => {
10
+ if (props.loading)
11
+ return (
12
+ <MuiButton {...props} onClick={() => {}}>
13
+ <div className="buttonLoader"></div>
14
+ </MuiButton>
15
+ );
9
16
  return <MuiButton {...props} />;
10
17
  };
@@ -0,0 +1,24 @@
1
+ /* HTML: <div class="buttonLoader"></div> */
2
+ .buttonLoader {
3
+ max-height: 40px;
4
+ padding: 5px 30px;
5
+ aspect-ratio: 2.5;
6
+ --_g: no-repeat radial-gradient(farthest-side,#000 90%,#0000);
7
+ background: var(--_g), var(--_g), var(--_g), var(--_g);
8
+ background-size: 20% 50%;
9
+ animation: l44 1s infinite linear alternate;
10
+ scale:0.5;
11
+ }
12
+ @keyframes l44 {
13
+ 0%,
14
+ 5% {background-position: calc(0*100%/3) 50% ,calc(1*100%/3) 50% ,calc(2*100%/3) 50% ,calc(3*100%/3) 50% }
15
+ 12.5% {background-position: calc(0*100%/3) 0 ,calc(1*100%/3) 50% ,calc(2*100%/3) 50% ,calc(3*100%/3) 50% }
16
+ 25% {background-position: calc(0*100%/3) 0 ,calc(1*100%/3) 0 ,calc(2*100%/3) 50% ,calc(3*100%/3) 50% }
17
+ 37.5% {background-position: calc(0*100%/3) 100%,calc(1*100%/3) 0 ,calc(2*100%/3) 0 ,calc(3*100%/3) 50% }
18
+ 50% {background-position: calc(0*100%/3) 100%,calc(1*100%/3) 100%,calc(2*100%/3) 0 ,calc(3*100%/3) 0 }
19
+ 62.5% {background-position: calc(0*100%/3) 50% ,calc(1*100%/3) 100%,calc(2*100%/3) 100%,calc(3*100%/3) 0 }
20
+ 75% {background-position: calc(0*100%/3) 50% ,calc(1*100%/3) 50% ,calc(2*100%/3) 100%,calc(3*100%/3) 100%}
21
+ 87.5% {background-position: calc(0*100%/3) 50% ,calc(1*100%/3) 50% ,calc(2*100%/3) 50% ,calc(3*100%/3) 100%}
22
+ 95%,
23
+ 100% {background-position: calc(0*100%/3) 50% ,calc(1*100%/3) 50% ,calc(2*100%/3) 50% ,calc(3*100%/3) 50% }
24
+ }
@@ -2,12 +2,14 @@ import {
2
2
  Box,
3
3
  CircularProgress,
4
4
  Autocomplete as MuiAutocomplete,
5
+ Paper,
5
6
  TextField,
6
7
  } from "@mui/material";
7
8
  import axios from "axios";
8
9
  import { useReducer } from "react";
9
10
  import { campxAxios } from "../../../utils/campxAxios";
10
11
  import { Typography } from "../../Typography/Typography";
12
+ import { FetchingOptionsLoader } from "../components/FetchingOptionsLoader";
11
13
  import { OptionContainer } from "../styles";
12
14
 
13
15
  function sleep(duration: number): Promise<void> {
@@ -182,6 +184,12 @@ export const SingleSelect = ({
182
184
  }}
183
185
  />
184
186
  )}
187
+ PaperComponent={(props) => (
188
+ <Paper {...props}>
189
+ {props.children}
190
+ <FetchingOptionsLoader loading={loadingInternalOptions} />
191
+ </Paper>
192
+ )}
185
193
  renderOption={(props, option: any) => {
186
194
  return (
187
195
  <Box component="li" {...props}>
@@ -0,0 +1,10 @@
1
+ import { Box } from "@mui/material";
2
+ import { Spinner } from "../../Layout/Spinner/Spinner";
3
+
4
+ export const FetchingOptionsLoader = ({ loading }: { loading: boolean }) => {
5
+ return (
6
+ <Box>
7
+ <Spinner />
8
+ </Box>
9
+ );
10
+ };
@@ -1,11 +1,21 @@
1
1
  import { Meta, StoryObj } from "@storybook/react";
2
2
  import { DashBoardIcon } from "../../../assets/images/icons";
3
3
  import { LayoutWrapper, LayoutWrapperProps } from "./LayoutWrapper";
4
+ import DialogButton from "../../Modals/DialogButton";
5
+ import { Button } from "@mui/material";
6
+
7
+ const LayoutWrapperStory = (props: LayoutWrapperProps) => {
8
+ return (
9
+ <div style={{ minHeight: "300px" }}>
10
+ <LayoutWrapper {...props} />
11
+ </div>
12
+ );
13
+ };
4
14
 
5
15
  // Define the default export with Meta type including the component type
6
- const meta: Meta<typeof LayoutWrapper> = {
16
+ const meta: Meta<typeof LayoutWrapperStory> = {
7
17
  title: "Layout/LayoutWrapper",
8
- component: LayoutWrapper,
18
+ component: LayoutWrapperStory,
9
19
  tags: ["autodocs"],
10
20
  // argTypes: {
11
21
  // menu: {
@@ -16,16 +26,49 @@ const meta: Meta<typeof LayoutWrapper> = {
16
26
  };
17
27
 
18
28
  export default meta;
19
- type Story = StoryObj<typeof LayoutWrapper>;
29
+ type Story = StoryObj<typeof LayoutWrapperStory>;
20
30
 
21
31
  // Primary story
22
32
  export const Primary: Story = {
23
- render: (args: LayoutWrapperProps) => <LayoutWrapper {...args} />,
33
+ render: (args: LayoutWrapperProps) => <LayoutWrapperStory {...args} />,
34
+ args: {
35
+ menu: [
36
+ { name: "Tickets", path: "/home", icon: DashBoardIcon },
37
+ { name: "Item 2", path: "/item2" },
38
+ ],
39
+ children: <>hi</>,
40
+ actionButtons: [
41
+ <DialogButton
42
+ anchor={({ open }) => (
43
+ <Button variant="contained" onClick={open}>
44
+ Create
45
+ </Button>
46
+ )}
47
+ content={({ close }) => <Button onClick={close}>Click Me</Button>}
48
+ title="Dialog Title"
49
+ />,
50
+ ],
51
+ },
52
+ };
53
+
54
+ export const WithActionButtons: Story = {
55
+ render: (args: LayoutWrapperProps) => <LayoutWrapperStory {...args} />,
24
56
  args: {
25
57
  menu: [
26
- { name: "Tickets", path: "/", icon: DashBoardIcon },
58
+ { name: "Tickets", path: "/home", icon: DashBoardIcon },
27
59
  { name: "Item 2", path: "/item2" },
28
60
  ],
29
61
  children: <>hi</>,
62
+ actionButtons: [
63
+ <DialogButton
64
+ anchor={({ open }) => (
65
+ <Button variant="contained" onClick={open}>
66
+ Click Me
67
+ </Button>
68
+ )}
69
+ content={({ close }) => <Button onClick={close}>Click Me</Button>}
70
+ title="Dialog Title"
71
+ />,
72
+ ],
30
73
  },
31
74
  };
@@ -1,4 +1,4 @@
1
- import { IconButton, Toolbar, Typography } from "@mui/material";
1
+ import { Box, IconButton, Stack, Toolbar, Typography } from "@mui/material";
2
2
 
3
3
  import MenuIcon from "@mui/icons-material/Menu";
4
4
  import { useState } from "react";
@@ -12,6 +12,7 @@ import {
12
12
 
13
13
  export interface LayoutWrapperProps {
14
14
  title?: string;
15
+ actionButtons?: React.ReactNode[];
15
16
  children: React.ReactNode;
16
17
  showIcon?: boolean;
17
18
  menu?: any;
@@ -21,6 +22,7 @@ export const LayoutWrapper = ({
21
22
  title,
22
23
  showIcon = true,
23
24
  menu,
25
+ actionButtons,
24
26
  }: LayoutWrapperProps) => {
25
27
  const [open, setOpen] = useState<boolean>(
26
28
  window.innerWidth > 1024 ? true : false
@@ -36,29 +38,46 @@ export const LayoutWrapper = ({
36
38
  return (
37
39
  <StyledLayoutContainer>
38
40
  <StyledMainContainer>
39
- <Toolbar sx={{ paddingLeft: "0px !important" }}>
41
+ <Toolbar
42
+ sx={{
43
+ padding: "0px !important",
44
+ }}
45
+ >
40
46
  {showIcon && (
41
- <IconButton
42
- color="inherit"
43
- aria-label="open drawer"
44
- onClick={handleDrawer}
45
- edge="start"
46
- sx={{ mr: 0.5, padding: "6px", marginLeft: "0px" }}
47
- onMouseEnter={() => setIsHovered(true)}
48
- onMouseLeave={() => setIsHovered(false)}
49
- >
50
- {open && isHovered ? (
51
- <LeftIcon />
52
- ) : !open && isHovered ? (
53
- <RightIcon />
54
- ) : (
55
- <MenuIcon />
56
- )}
57
- </IconButton>
47
+ <>
48
+ <Stack
49
+ direction={"row"}
50
+ width={"100%"}
51
+ justifyContent={"space-between"}
52
+ >
53
+ <Stack direction={"row"}>
54
+ <IconButton
55
+ color="inherit"
56
+ aria-label="open drawer"
57
+ onClick={handleDrawer}
58
+ edge="start"
59
+ sx={{ mr: 0.5, padding: "6px", marginLeft: "0px" }}
60
+ onMouseEnter={() => setIsHovered(true)}
61
+ onMouseLeave={() => setIsHovered(false)}
62
+ >
63
+ {open && isHovered ? (
64
+ <LeftIcon />
65
+ ) : !open && isHovered ? (
66
+ <RightIcon />
67
+ ) : (
68
+ <MenuIcon />
69
+ )}
70
+ </IconButton>
71
+ <Typography variant="subtitle1" noWrap>
72
+ {title ? title : menu[active].name}
73
+ </Typography>
74
+ </Stack>
75
+ <Stack direction={"row"} alignItems={"flex-end"}>
76
+ {actionButtons?.map((element) => element)}
77
+ </Stack>
78
+ </Stack>
79
+ </>
58
80
  )}
59
- <Typography variant="subtitle1" noWrap>
60
- {title ? title : menu[active].name}
61
- </Typography>
62
81
  </Toolbar>
63
82
 
64
83
  <SideNavigation
@@ -1,4 +1,4 @@
1
- import { Link, ListItemIcon, Stack } from "@mui/material";
1
+ import { ListItemIcon, Stack } from "@mui/material";
2
2
  import { useMatch, useResolvedPath } from "react-router-dom";
3
3
  import { HomeIcon } from "../../../assets/images/icons";
4
4
  import { activeStore } from "../../../store/activeStore";
@@ -6,6 +6,7 @@ import { Typography } from "../../Typography/Typography";
6
6
  import {
7
7
  Main,
8
8
  StyledDrawer,
9
+ StyledLinkButton,
9
10
  StyledList,
10
11
  StyledListItem,
11
12
  StyledListItemButton,
@@ -67,8 +68,8 @@ const MenuItem = ({ menuItem, index }: MenuItemProps) => {
67
68
 
68
69
  return (
69
70
  <StyledListItem key={path} disablePadding match={match}>
70
- <Link
71
- href={path}
71
+ <StyledLinkButton
72
+ to={path}
72
73
  style={{ width: "100%" }}
73
74
  onClick={() =>
74
75
  activeStore.update((s) => {
@@ -87,7 +88,7 @@ const MenuItem = ({ menuItem, index }: MenuItemProps) => {
87
88
  </ListItemIcon>
88
89
  <Typography variant="subtitle3">{name}</Typography>
89
90
  </StyledListItemButton>
90
- </Link>
91
+ </StyledLinkButton>
91
92
  </StyledListItem>
92
93
  );
93
94
  };
@@ -48,6 +48,9 @@ export const StyledListItemButton = styled(ListItemButton)(() => ({
48
48
 
49
49
  export const StyledLinkButton = styled(Link)({
50
50
  textDecoration: "none",
51
+ "&:hover": {
52
+ color: "unset",
53
+ },
51
54
  });
52
55
 
53
56
  export const Main = styled("main", {
@@ -0,0 +1,32 @@
1
+ .spinner {
2
+ width: 40px;
3
+ height: 40px;
4
+ border-radius: 50%;
5
+ position: relative;
6
+ animation: rotate 1s linear infinite;
7
+ scale: 0.5;
8
+ }
9
+ .spinner::before , .spinner::after {
10
+ content: "";
11
+ box-sizing: border-box;
12
+ position: absolute;
13
+ inset: 0px;
14
+ border-radius: 50%;
15
+ border: 5px solid #7D60D9;
16
+ animation: prixClipFix 1.5s linear infinite ;
17
+ }
18
+ .spinner::after{
19
+ transform: rotate3d(90, 90, 0, 180deg );
20
+ border-color: #FF3D00;
21
+ }
22
+
23
+ @keyframes rotate {
24
+ 0% {transform: rotate(0deg)}
25
+ 100% {transform: rotate(360deg)}
26
+ }
27
+
28
+ @keyframes prixClipFix {
29
+ 0% {clip-path:polygon(50% 50%,0 0,0 0,0 0,0 0,0 0)}
30
+ 50% {clip-path:polygon(50% 50%,0 0,100% 0,100% 0,100% 0,100% 0)}
31
+ 75%, 100% {clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)}
32
+ }
@@ -0,0 +1,20 @@
1
+ // Import React and other necessary elements
2
+ import { Meta } from "@storybook/react";
3
+
4
+ // Make sure your TextField import is correct
5
+
6
+ import { Spinner } from "./Spinner";
7
+
8
+ // Define the default export with Meta type including the component type
9
+ export default {
10
+ title: "Layout/Spinner",
11
+ component: Spinner,
12
+ tags: ["autodocs"],
13
+ argTypes: {},
14
+ } as Meta<typeof Spinner>;
15
+
16
+ // Define stories directly as objects with render function
17
+ export const Primary = {
18
+ render: (args: any) => <Spinner {...args} />,
19
+ args: {},
20
+ };
@@ -0,0 +1,5 @@
1
+ import "./Spinner.css";
2
+
3
+ export const Spinner = () => {
4
+ return <div className="spinner" style={{}}></div>;
5
+ };
package/.env DELETED
@@ -1 +0,0 @@
1
- REACT_APP_API_HOST=http://localhost:3000