@xyo-network/react-table 7.0.0 → 7.0.1

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.
@@ -2,5 +2,5 @@ import type { TableCellProps } from '@mui/material';
2
2
  export interface TableCellExProps extends TableCellProps {
3
3
  noBgColor?: boolean;
4
4
  }
5
- export declare const TableCellEx: import("@emotion/styled").StyledComponent<TableCellProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & TableCellExProps, {}, {}>;
5
+ export declare const TableCellEx: import("@emotion/styled").StyledComponent<TableCellProps & import(".store/@mui-system-virtual-08e51c7e26/package").MUIStyledCommonProps<import("@mui/material").Theme> & TableCellExProps, {}, {}>;
6
6
  //# sourceMappingURL=TableCellEx.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableCellEx.d.ts","sourceRoot":"","sources":["../../../../src/components/TableEx/TableCellEx.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGnD,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,WAAW,kKAEvB,CAAA"}
1
+ {"version":3,"file":"TableCellEx.d.ts","sourceRoot":"","sources":["../../../../src/components/TableEx/TableCellEx.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGnD,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,WAAW,oMAEvB,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import type { Meta } from '@storybook/react-vite';
2
2
  import { TableEx } from './TableEx.tsx';
3
3
  declare const StorybookEntry: Meta<typeof TableEx>;
4
- declare const Default: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./TableEx.tsx").TableExProps>;
5
- declare const WithRef: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./TableEx.tsx").TableExProps>;
6
- declare const WithScrollable: import("storybook/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./TableEx.tsx").TableExProps>;
4
+ declare const Default: import(".store/storybook-virtual-997ab3c959/package/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./TableEx.tsx").TableExProps>;
5
+ declare const WithRef: import(".store/storybook-virtual-997ab3c959/package/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./TableEx.tsx").TableExProps>;
6
+ declare const WithScrollable: import(".store/storybook-virtual-997ab3c959/package/internal/csf").AnnotatedStoryFn<import("@storybook/react-vite").ReactRenderer, import("./TableEx.tsx").TableExProps>;
7
7
  export { Default, WithRef, WithScrollable, };
8
8
  export default StorybookEntry;
9
9
  //# sourceMappingURL=TableEx.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableEx.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/TableEx/TableEx.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACC,IAAI,EAChB,MAAM,uBAAuB,CAAA;AAK9B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAYvC,QAAA,MAAM,cAAc,EAKf,IAAI,CAAC,OAAO,OAAO,CAAC,CAAA;AAmDzB,QAAA,MAAM,OAAO,wIAAoB,CAAA;AAGjC,QAAA,MAAM,OAAO,wIAAoB,CAAA;AAGjC,QAAA,MAAM,cAAc,wIAAoB,CAAA;AAIxC,OAAO,EACL,OAAO,EAAE,OAAO,EAAE,cAAc,GACjC,CAAA;AAED,eAAe,cAAc,CAAA"}
1
+ {"version":3,"file":"TableEx.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/TableEx/TableEx.stories.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACC,IAAI,EAChB,MAAM,uBAAuB,CAAA;AAK9B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAYvC,QAAA,MAAM,cAAc,EAKf,IAAI,CAAC,OAAO,OAAO,CAAC,CAAA;AAmDzB,QAAA,MAAM,OAAO,0KAAoB,CAAA;AAGjC,QAAA,MAAM,OAAO,0KAAoB,CAAA;AAGjC,QAAA,MAAM,cAAc,0KAAoB,CAAA;AAIxC,OAAO,EACL,OAAO,EAAE,OAAO,EAAE,cAAc,GACjC,CAAA;AAED,eAAe,cAAc,CAAA"}
@@ -1,39 +1,32 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/components/TableEx/TableCellEx.tsx
5
2
  import { styled, TableCell } from "@mui/material";
6
- var TableCellEx = styled(TableCell, {
7
- name: "TableCellNoBgColor",
8
- shouldForwardProp: /* @__PURE__ */ __name((prop) => prop !== "noBgColor", "shouldForwardProp")
9
- })(({ noBgColor = true }) => ({
10
- ...noBgColor && {
11
- backgroundColor: "transparent"
12
- }
13
- }));
3
+ var TableCellEx = styled(TableCell, { name: "TableCellNoBgColor", shouldForwardProp: (prop) => prop !== "noBgColor" })(
4
+ ({ noBgColor = true }) => ({ ...noBgColor && { backgroundColor: "transparent" } })
5
+ );
14
6
 
15
7
  // src/components/TableEx/TableEx.tsx
16
8
  import { Table } from "@mui/material";
17
- import React from "react";
18
- var TableExInner = /* @__PURE__ */ __name(({ children, ...props }) => {
19
- return /* @__PURE__ */ React.createElement(Table, props, children);
20
- }, "TableExInner");
9
+ import { jsx } from "react/jsx-runtime";
10
+ var TableExInner = ({ children, ...props }) => {
11
+ return /* @__PURE__ */ jsx(Table, { ...props, children });
12
+ };
21
13
  TableExInner.displayName = "TableExInner";
22
- var TableExWithRef = /* @__PURE__ */ __name(({ variant, children, ...props }) => {
23
- return /* @__PURE__ */ React.createElement(TableExInner, {
24
- stickyHeader: variant === "scrollable",
25
- ...props
26
- }, children);
27
- }, "TableExWithRef");
14
+ var TableExWithRef = ({
15
+ variant,
16
+ children,
17
+ ...props
18
+ }) => {
19
+ return /* @__PURE__ */ jsx(TableExInner, { stickyHeader: variant === "scrollable", ...props, children });
20
+ };
28
21
  TableExWithRef.displayName = "TableEx";
29
22
  var TableEx = TableExWithRef;
30
23
 
31
24
  // src/components/TableEx/TableFooterEx.tsx
32
25
  import { styled as styled2, TableFooter } from "@mui/material";
33
- import React2 from "react";
26
+ import { jsx as jsx2 } from "react/jsx-runtime";
34
27
  var TableFooterExRoot = styled2(TableFooter, {
35
28
  name: "TableFooterEx",
36
- shouldForwardProp: /* @__PURE__ */ __name((propName) => propName !== "scrollable", "shouldForwardProp"),
29
+ shouldForwardProp: (propName) => propName !== "scrollable",
37
30
  slot: "Root"
38
31
  })(({ variant, theme }) => ({
39
32
  backgroundColor: theme.vars.palette.background.default,
@@ -44,7 +37,7 @@ var TableFooterExRoot = styled2(TableFooter, {
44
37
  position: "sticky"
45
38
  }
46
39
  }));
47
- var TableFooterEx = /* @__PURE__ */ __name(({ children, ...props }) => /* @__PURE__ */ React2.createElement(TableFooterExRoot, props, children), "TableFooterEx");
40
+ var TableFooterEx = ({ children, ...props }) => /* @__PURE__ */ jsx2(TableFooterExRoot, { ...props, children });
48
41
 
49
42
  // src/context/TableHeight/Context.ts
50
43
  import { createContextEx } from "@xylabs/react-shared";
@@ -52,24 +45,22 @@ var TableHeightContext = createContextEx();
52
45
 
53
46
  // src/context/TableHeight/Provider.tsx
54
47
  import { useResetState } from "@xylabs/react-hooks";
55
- import React3, { useMemo, useState } from "react";
56
- var TableHeightProvider = /* @__PURE__ */ __name(({ children, additionalRows = 0, defaultVisibleRows, heightFormat = "px" }) => {
48
+ import { useMemo, useState } from "react";
49
+ import { jsx as jsx3 } from "react/jsx-runtime";
50
+ var TableHeightProvider = ({
51
+ children,
52
+ additionalRows = 0,
53
+ defaultVisibleRows,
54
+ heightFormat = "px"
55
+ }) => {
57
56
  const [visibleRows, setVisibleRows] = useResetState(defaultVisibleRows);
58
57
  const [rowHeight, setRowHeight] = useState();
59
58
  const height = useMemo(() => {
60
59
  if (rowHeight !== void 0 && visibleRows !== void 0) {
61
60
  return rowHeight * (visibleRows + additionalRows);
62
61
  }
63
- }, [
64
- defaultVisibleRows,
65
- rowHeight,
66
- visibleRows,
67
- additionalRows
68
- ]);
69
- const formattedHeight = useMemo(() => height === void 0 ? void 0 : `${height}${heightFormat}`, [
70
- height,
71
- heightFormat
72
- ]);
62
+ }, [defaultVisibleRows, rowHeight, visibleRows, additionalRows]);
63
+ const formattedHeight = useMemo(() => height === void 0 ? void 0 : `${height}${heightFormat}`, [height, heightFormat]);
73
64
  const value = useMemo(() => ({
74
65
  height: formattedHeight,
75
66
  provided: true,
@@ -77,21 +68,13 @@ var TableHeightProvider = /* @__PURE__ */ __name(({ children, additionalRows = 0
77
68
  setRowHeight,
78
69
  setVisibleRows,
79
70
  visibleRows
80
- }), [
81
- formattedHeight,
82
- rowHeight,
83
- setRowHeight,
84
- setVisibleRows,
85
- visibleRows
86
- ]);
87
- return /* @__PURE__ */ React3.createElement(TableHeightContext, {
88
- value
89
- }, children);
90
- }, "TableHeightProvider");
71
+ }), [formattedHeight, rowHeight, setRowHeight, setVisibleRows, visibleRows]);
72
+ return /* @__PURE__ */ jsx3(TableHeightContext, { value, children });
73
+ };
91
74
 
92
75
  // src/context/TableHeight/use.ts
93
76
  import { useContextEx } from "@xylabs/react-shared";
94
- var useTableHeight = /* @__PURE__ */ __name((required = false) => useContextEx(TableHeightContext, "TableHeight", required), "useTableHeight");
77
+ var useTableHeight = (required = false) => useContextEx(TableHeightContext, "TableHeight", required);
95
78
  export {
96
79
  TableCellEx,
97
80
  TableEx,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/TableEx/TableCellEx.tsx","../../src/components/TableEx/TableEx.tsx","../../src/components/TableEx/TableFooterEx.tsx","../../src/context/TableHeight/Context.ts","../../src/context/TableHeight/Provider.tsx","../../src/context/TableHeight/use.ts"],"sourcesContent":["import type { TableCellProps } from '@mui/material'\nimport { styled, TableCell } from '@mui/material'\n\nexport interface TableCellExProps extends TableCellProps {\n noBgColor?: boolean\n}\n\nexport const TableCellEx = styled(TableCell, { name: 'TableCellNoBgColor', shouldForwardProp: prop => prop !== 'noBgColor' })<TableCellExProps>(\n ({ noBgColor = true }) => ({ ...(noBgColor && { backgroundColor: 'transparent' }) }),\n)\n","import type { TableProps } from '@mui/material'\nimport { Table } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport type { TableExVariants } from './types/index.ts'\n\nexport interface TableExProps extends PropsWithChildren, TableProps {\n variant?: TableExVariants\n}\n\nconst TableExInner: React.FC<TableExProps> = ({ children, ...props }) => {\n return (\n <Table {...props}>\n {children}\n </Table>\n )\n}\n\nTableExInner.displayName = 'TableExInner'\n\nexport const TableExWithRef: React.FC<TableExProps> = ({\n variant, children, ...props\n}) => {\n return (\n <TableExInner stickyHeader={variant === 'scrollable'} {...props}>\n {children}\n </TableExInner>\n )\n}\n\nTableExWithRef.displayName = 'TableEx'\n\nexport const TableEx = TableExWithRef\n","import type { TableFooterProps } from '@mui/material'\nimport { styled, TableFooter } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport type { TableExVariants } from './types/index.ts'\n\nconst TableFooterExRoot = styled(TableFooter, {\n name: 'TableFooterEx',\n shouldForwardProp: propName => propName !== 'scrollable',\n slot: 'Root',\n})<TableFooterExProps>(({ variant, theme }) => ({\n backgroundColor: theme.vars.palette.background.default,\n bottom: 'unset',\n position: 'relative',\n ...(variant === 'scrollable' && {\n bottom: 0,\n position: 'sticky',\n }),\n}))\n\nexport interface TableFooterExProps extends PropsWithChildren, TableFooterProps {\n variant?: TableExVariants\n}\n\nexport const TableFooterEx: React.FC<TableFooterExProps> = ({ children, ...props }) => <TableFooterExRoot {...props}>{children}</TableFooterExRoot>\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { TableHeightState } from './State.ts'\n\nexport const TableHeightContext = createContextEx<TableHeightState>()\n","import { useResetState } from '@xylabs/react-hooks'\nimport type { ContextExProviderProps } from '@xylabs/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo, useState } from 'react'\n\nimport { TableHeightContext } from './Context.ts'\nimport type { TableHeightState } from './State.ts'\n\nexport interface TableHeightProviderProps extends ContextExProviderProps, PropsWithChildren {\n /** @field Account for optional header and footer rows */\n additionalRows?: number\n defaultVisibleRows?: number\n heightFormat?: string\n}\n\nexport const TableHeightProvider: React.FC<TableHeightProviderProps> = ({\n children,\n additionalRows = 0,\n defaultVisibleRows,\n heightFormat = 'px',\n}) => {\n const [visibleRows, setVisibleRows] = useResetState(defaultVisibleRows)\n const [rowHeight, setRowHeight] = useState<number | undefined>()\n\n const height = useMemo(() => {\n if (rowHeight !== undefined && visibleRows !== undefined) {\n return rowHeight * (visibleRows + additionalRows)\n }\n }, [defaultVisibleRows, rowHeight, visibleRows, additionalRows])\n\n const formattedHeight = useMemo(() => (height === undefined ? undefined : `${height}${heightFormat}`), [height, heightFormat])\n\n const value: TableHeightState = useMemo(() => ({\n height: formattedHeight, provided: true, rowHeight, setRowHeight, setVisibleRows, visibleRows,\n }), [formattedHeight, rowHeight, setRowHeight, setVisibleRows, visibleRows])\n\n return (\n <TableHeightContext value={value}>\n {children}\n </TableHeightContext>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { TableHeightContext } from './Context.ts'\n\nexport const useTableHeight = (required = false) => useContextEx(TableHeightContext, 'TableHeight', required)\n"],"mappings":";;;;AACA,SAASA,QAAQC,iBAAiB;AAM3B,IAAMC,cAAcC,OAAOC,WAAW;EAAEC,MAAM;EAAsBC,mBAAmBC,wBAAAA,SAAQA,SAAS,aAAjBA;AAA6B,CAAA,EACzH,CAAC,EAAEC,YAAY,KAAI,OAAQ;EAAE,GAAIA,aAAa;IAAEC,iBAAiB;EAAc;AAAG,EAAA;;;ACPpF,SAASC,aAAa;AAEtB,OAAOC,WAAW;AAQlB,IAAMC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;EACF,GAAG;IAACC;IAAoBK;IAAWH;IAAaH;GAAe;AAE/D,QAAMY,kBAAkBF,QAAQ,MAAOD,WAAWE,SAAYA,SAAY,GAAGF,MAAAA,GAASP,YAAAA,IAAiB;IAACO;IAAQP;GAAa;AAE7H,QAAMW,QAA0BH,QAAQ,OAAO;IAC7CD,QAAQG;IAAiBE,UAAU;IAAMR;IAAWC;IAAcH;IAAgBD;EACpF,IAAI;IAACS;IAAiBN;IAAWC;IAAcH;IAAgBD;GAAY;AAE3E,SACE,gBAAAY,OAAA,cAACC,oBAAAA;IAAmBH;KACjBd,QAAAA;AAGP,GA1BuE;;;ACfvE,SAASkB,oBAAoB;AAItB,IAAMC,iBAAiB,wBAACC,WAAW,UAAUC,aAAaC,oBAAoB,eAAeF,QAAAA,GAAtE;","names":["styled","TableCell","TableCellEx","styled","TableCell","name","shouldForwardProp","prop","noBgColor","backgroundColor","Table","React","TableExInner","children","props","Table","displayName","TableExWithRef","variant","stickyHeader","TableEx","styled","TableFooter","React","TableFooterExRoot","styled","TableFooter","name","shouldForwardProp","propName","slot","variant","theme","backgroundColor","vars","palette","background","default","bottom","position","TableFooterEx","children","props","React","createContextEx","TableHeightContext","useResetState","React","useMemo","useState","TableHeightProvider","children","additionalRows","defaultVisibleRows","heightFormat","visibleRows","setVisibleRows","useResetState","rowHeight","setRowHeight","useState","height","useMemo","undefined","formattedHeight","value","provided","React","TableHeightContext","useContextEx","useTableHeight","required","useContextEx","TableHeightContext"]}
1
+ {"version":3,"sources":["../../src/components/TableEx/TableCellEx.tsx","../../src/components/TableEx/TableEx.tsx","../../src/components/TableEx/TableFooterEx.tsx","../../src/context/TableHeight/Context.ts","../../src/context/TableHeight/Provider.tsx","../../src/context/TableHeight/use.ts"],"sourcesContent":["import type { TableCellProps } from '@mui/material'\nimport { styled, TableCell } from '@mui/material'\n\nexport interface TableCellExProps extends TableCellProps {\n noBgColor?: boolean\n}\n\nexport const TableCellEx = styled(TableCell, { name: 'TableCellNoBgColor', shouldForwardProp: prop => prop !== 'noBgColor' })<TableCellExProps>(\n ({ noBgColor = true }) => ({ ...(noBgColor && { backgroundColor: 'transparent' }) }),\n)\n","import type { TableProps } from '@mui/material'\nimport { Table } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport type { TableExVariants } from './types/index.ts'\n\nexport interface TableExProps extends PropsWithChildren, TableProps {\n variant?: TableExVariants\n}\n\nconst TableExInner: React.FC<TableExProps> = ({ children, ...props }) => {\n return (\n <Table {...props}>\n {children}\n </Table>\n )\n}\n\nTableExInner.displayName = 'TableExInner'\n\nexport const TableExWithRef: React.FC<TableExProps> = ({\n variant, children, ...props\n}) => {\n return (\n <TableExInner stickyHeader={variant === 'scrollable'} {...props}>\n {children}\n </TableExInner>\n )\n}\n\nTableExWithRef.displayName = 'TableEx'\n\nexport const TableEx = TableExWithRef\n","import type { TableFooterProps } from '@mui/material'\nimport { styled, TableFooter } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport type { TableExVariants } from './types/index.ts'\n\nconst TableFooterExRoot = styled(TableFooter, {\n name: 'TableFooterEx',\n shouldForwardProp: propName => propName !== 'scrollable',\n slot: 'Root',\n})<TableFooterExProps>(({ variant, theme }) => ({\n backgroundColor: theme.vars.palette.background.default,\n bottom: 'unset',\n position: 'relative',\n ...(variant === 'scrollable' && {\n bottom: 0,\n position: 'sticky',\n }),\n}))\n\nexport interface TableFooterExProps extends PropsWithChildren, TableFooterProps {\n variant?: TableExVariants\n}\n\nexport const TableFooterEx: React.FC<TableFooterExProps> = ({ children, ...props }) => <TableFooterExRoot {...props}>{children}</TableFooterExRoot>\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { TableHeightState } from './State.ts'\n\nexport const TableHeightContext = createContextEx<TableHeightState>()\n","import { useResetState } from '@xylabs/react-hooks'\nimport type { ContextExProviderProps } from '@xylabs/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo, useState } from 'react'\n\nimport { TableHeightContext } from './Context.ts'\nimport type { TableHeightState } from './State.ts'\n\nexport interface TableHeightProviderProps extends ContextExProviderProps, PropsWithChildren {\n /** @field Account for optional header and footer rows */\n additionalRows?: number\n defaultVisibleRows?: number\n heightFormat?: string\n}\n\nexport const TableHeightProvider: React.FC<TableHeightProviderProps> = ({\n children,\n additionalRows = 0,\n defaultVisibleRows,\n heightFormat = 'px',\n}) => {\n const [visibleRows, setVisibleRows] = useResetState(defaultVisibleRows)\n const [rowHeight, setRowHeight] = useState<number | undefined>()\n\n const height = useMemo(() => {\n if (rowHeight !== undefined && visibleRows !== undefined) {\n return rowHeight * (visibleRows + additionalRows)\n }\n }, [defaultVisibleRows, rowHeight, visibleRows, additionalRows])\n\n const formattedHeight = useMemo(() => (height === undefined ? undefined : `${height}${heightFormat}`), [height, heightFormat])\n\n const value: TableHeightState = useMemo(() => ({\n height: formattedHeight, provided: true, rowHeight, setRowHeight, setVisibleRows, visibleRows,\n }), [formattedHeight, rowHeight, setRowHeight, setVisibleRows, visibleRows])\n\n return (\n <TableHeightContext value={value}>\n {children}\n </TableHeightContext>\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { TableHeightContext } from './Context.ts'\n\nexport const useTableHeight = (required = false) => useContextEx(TableHeightContext, 'TableHeight', required)\n"],"mappings":";AACA,SAAS,QAAQ,iBAAiB;AAM3B,IAAM,cAAc,OAAO,WAAW,EAAE,MAAM,sBAAsB,mBAAmB,UAAQ,SAAS,YAAY,CAAC;AAAA,EAC1H,CAAC,EAAE,YAAY,KAAK,OAAO,EAAE,GAAI,aAAa,EAAE,iBAAiB,cAAc,EAAG;AACpF;;;ACRA,SAAS,aAAa;AAYlB;AAFJ,IAAM,eAAuC,CAAC,EAAE,UAAU,GAAG,MAAM,MAAM;AACvE,SACE,oBAAC,SAAO,GAAG,OACR,UACH;AAEJ;AAEA,aAAa,cAAc;AAEpB,IAAM,iBAAyC,CAAC;AAAA,EACrD;AAAA,EAAS;AAAA,EAAU,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AQ,OAAO;AAAA,IAC7C,QAAQ;AAAA,IAAiB,UAAU;AAAA,IAAM;AAAA,IAAW;AAAA,IAAc;AAAA,IAAgB;AAAA,EACpF,IAAI,CAAC,iBAAiB,WAAW,cAAc,gBAAgB,WAAW,CAAC;AAE3E,SACE,gBAAAA,KAAC,sBAAmB,OACjB,UACH;AAEJ;;;ACzCA,SAAS,oBAAoB;AAItB,IAAM,iBAAiB,CAAC,WAAW,UAAU,aAAa,oBAAoB,eAAe,QAAQ;","names":["styled","jsx","jsx"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-table",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -43,29 +43,32 @@
43
43
  "src"
44
44
  ],
45
45
  "dependencies": {
46
- "@xylabs/react-hooks": "^7.0.0",
47
- "@xylabs/react-shared": "^7.0.0"
46
+ "@xylabs/react-hooks": "~7.0.1",
47
+ "@xylabs/react-shared": "~7.0.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@mui/icons-material": "^7.2.0",
51
- "@mui/material": "^7.2.0",
52
- "@storybook/react-vite": "^9.0.18",
53
- "@types/react": "^19.1.9",
54
- "@xylabs/ts-scripts-yarn3": "^7.0.2",
55
- "@xylabs/tsconfig-react": "^7.0.2",
56
- "@xyo-network/react-storybook": "^7.0.0",
57
- "react": "^19.1.1",
58
- "react-dom": "^19.1.1",
59
- "react-router-dom": "^7.7.1",
60
- "storybook": "^9.0.18",
61
- "typescript": "^5.8.3"
50
+ "@mui/icons-material": "~7.3.1",
51
+ "@mui/material": "~7.3.1",
52
+ "@storybook/react-vite": "~9.1.2",
53
+ "@types/react": "~19.1.10",
54
+ "@xylabs/ts-scripts-yarn3": "~7.1.1",
55
+ "@xylabs/tsconfig": "~7.1.1",
56
+ "@xylabs/tsconfig-dom": "~7.1.1",
57
+ "@xylabs/tsconfig-react": "~7.1.1",
58
+ "@xyo-network/react-storybook": "^7.0.1",
59
+ "react": "~19.1.1",
60
+ "react-dom": "~19.1.1",
61
+ "react-router-dom": "~7.8.0",
62
+ "storybook": "~9.1.2",
63
+ "typescript": "~5.9.2",
64
+ "vite": "~7.1.2"
62
65
  },
63
66
  "peerDependencies": {
64
67
  "@mui/icons-material": ">=6 <8",
65
68
  "@mui/material": ">=6 <8",
66
- "react": "^19",
67
- "react-dom": "^19",
68
- "react-router-dom": "^7"
69
+ "react": "~19",
70
+ "react-dom": "~19",
71
+ "react-router-dom": "~7"
69
72
  },
70
73
  "publishConfig": {
71
74
  "access": "public"