@universal-tennis/ui-shared 0.1.70 → 0.1.71

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.
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { useState } from "react";
2
2
  import Box from "@mui/material/Box";
3
3
  import Button from "@mui/material/Button";
4
4
  import { styled } from "@mui/material/styles";
@@ -16,8 +16,9 @@ const GridSections = styled(Box)({
16
16
  alignItems: "center",
17
17
  position: 'relative',
18
18
  });
19
- export default function MobileTableRows({ totalColumns, headerRows, tableRows }) {
20
- const [activeStep, setActiveStep] = React.useState(0);
19
+ export default function MobileTableRows({ totalColumns, headerRows = [], tableRows = [] }) {
20
+ var _a;
21
+ const [activeStep, setActiveStep] = useState(0);
21
22
  const handleNext = () => {
22
23
  setActiveStep((prevActiveStep) => prevActiveStep + 1);
23
24
  };
@@ -31,7 +32,7 @@ export default function MobileTableRows({ totalColumns, headerRows, tableRows })
31
32
  React.createElement(Button, { color: "inherit", disabled: disabledBackButton, onClick: handleBack, sx: { mr: 1, alignSelf: "flex-start" } },
32
33
  React.createElement(LeftChevronIcon, { size: 16, color: disabledBackButton ? "transparent" : "var(--primary)" })),
33
34
  React.createElement(StyledHeader, { xs: totalColumns },
34
- React.createElement(Typography, { category: "secondary", size: "small-medium-cap" }, headerRows[activeStep].name)),
35
+ React.createElement(Typography, { category: "secondary", size: "small-medium-cap" }, (_a = headerRows[activeStep]) === null || _a === void 0 ? void 0 : _a.name)),
35
36
  React.createElement(Button, { onClick: handleNext, disabled: disabledForwardButton },
36
37
  React.createElement(RightChevronIcon, { size: 16, color: disabledForwardButton ? "transparent" : "var(--primary)" }))),
37
38
  React.createElement(Grid, { flexDirection: "column", container: true },
@@ -1 +1 @@
1
- {"version":3,"file":"MobileTableRows.js","sourceRoot":"","sources":["../../../../../src/stories/organisms/Tables/TeamDrawCardTable/MobileTableRows.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,C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,eAAe,EAAC,EAAE,EAAE,CAAC;YAChD,oBAAC,MAAM,IAAC,KAAK,EAAC,SAAS,EAAC,QAAQ,EAAE,kBAAkB,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE;gBAC7G,oBAAC,eAAe,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,GAAI,CACtF;YACT,oBAAC,YAAY,IAAC,EAAE,EAAE,YAAY;gBAC1B,oBAAC,UAAU,IAAC,QAAQ,EAAC,WAAW,EAAC,IAAI,EAAC,kBAAkB,IACnD,UAAU,CAAC,UAAU,CAAC,CAAC,IAAI,CACnB,CACF;YACf,oBAAC,MAAM,IAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,qBAAqB;gBACxD,oBAAC,gBAAgB,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,GAAI,CAC1F,CACN;QACP,oBAAC,IAAI,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS;YAClC,oBAAC,YAAY,IACT,EAAE,EAAE;oBACF,aAAa,EAAE,QAAQ;oBACvB,GAAG,EAAE,MAAM;iBACZ,IAEA,SAAS,CAAC,UAAU,CAAC,CACX,CACZ,CACL,CACT,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"MobileTableRows.js","sourceRoot":"","sources":["../../../../../src/stories/organisms/Tables/TeamDrawCardTable/MobileTableRows.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,GAAG,MAAM,mBAAmB,CAAC;AACpC,OAAO,MAAM,MAAM,sBAAsB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;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UAAU,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE;gBAC7G,oBAAC,eAAe,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,GAAI,CACtF;YACT,oBAAC,YAAY,IAAC,EAAE,EAAE,YAAY;gBAC1B,oBAAC,UAAU,IAAC,QAAQ,EAAC,WAAW,EAAC,IAAI,EAAC,kBAAkB,IACnD,MAAA,UAAU,CAAC,UAAU,CAAC,0CAAE,IAAI,CACpB,CACF;YACf,oBAAC,MAAM,IAAC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,qBAAqB;gBACxD,oBAAC,gBAAgB,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,GAAI,CAC1F,CACN;QACP,oBAAC,IAAI,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS;YAClC,oBAAC,YAAY,IACT,EAAE,EAAE;oBACF,aAAa,EAAE,QAAQ;oBACvB,GAAG,EAAE,MAAM;iBACZ,IAEA,SAAS,CAAC,UAAU,CAAC,CACX,CACZ,CACL,CACT,CAAC;AACJ,CAAC"}
@@ -7,9 +7,9 @@ export type DrawCardTableProps = {
7
7
  isMobile: boolean;
8
8
  };
9
9
  export interface TableRowProps {
10
- headerRows: {
10
+ readonly headerRows: {
11
11
  name: string;
12
12
  }[];
13
- tableRows: ReactNode[][];
14
- totalColumns: number;
13
+ readonly tableRows: ReactNode[][];
14
+ readonly totalColumns: number;
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universal-tennis/ui-shared",
3
- "version": "0.1.70",
3
+ "version": "0.1.71",
4
4
  "main": "dist/items.js",
5
5
  "license": "MIT",
6
6
  "homepage": "https://universaltennis.com",
@@ -25,7 +25,8 @@
25
25
  "publish:npm": "tsc && yarn copy-files",
26
26
  "publish-package": "npm publish --access public",
27
27
  "copy-files": "copyfiles -u 1 src/stories/assets/*.svg src/stories/assets/*.png src/stories/assets/*.gif src/stories/assets/css/*.css dist/",
28
- "eslint": "npx eslint --ext .jsx,.js src --fix"
28
+ "eslint": "npx eslint --ext .jsx,.js src --fix",
29
+ "eslint:ci": "npx eslint --ext .jsx,.js src --format json --output-file reports/eslint-result.json"
29
30
  },
30
31
  "eslintConfig": {
31
32
  "extends": [
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { useState } from "react";
2
2
  import Box from "@mui/material/Box";
3
3
  import Button from "@mui/material/Button";
4
4
  import { styled } from "@mui/material/styles";
@@ -22,9 +22,9 @@ const GridSections = styled(Box)({
22
22
  });
23
23
 
24
24
  export default function MobileTableRows({
25
- totalColumns, headerRows, tableRows
25
+ totalColumns, headerRows = [], tableRows = []
26
26
  }: TableRowProps) {
27
- const [activeStep, setActiveStep] = React.useState(0);
27
+ const [activeStep, setActiveStep] = useState(0);
28
28
 
29
29
  const handleNext = () => {
30
30
  setActiveStep((prevActiveStep) => prevActiveStep + 1);
@@ -45,7 +45,7 @@ export default function MobileTableRows({
45
45
  </Button>
46
46
  <StyledHeader xs={totalColumns}>
47
47
  <Typography category="secondary" size="small-medium-cap">
48
- {headerRows[activeStep].name}
48
+ {headerRows[activeStep]?.name}
49
49
  </Typography>
50
50
  </StyledHeader>
51
51
  <Button onClick={handleNext} disabled={disabledForwardButton}>
@@ -9,9 +9,9 @@ export type DrawCardTableProps = {
9
9
  }
10
10
 
11
11
  export interface TableRowProps {
12
- headerRows: {
12
+ readonly headerRows: {
13
13
  name: string;
14
14
  }[],
15
- tableRows: ReactNode[][];
16
- totalColumns: number;
15
+ readonly tableRows: ReactNode[][];
16
+ readonly totalColumns: number;
17
17
  }