@atom-learning/components 2.35.0 → 2.36.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 CHANGED
@@ -1,9 +1,12 @@
1
- # [2.35.0](https://github.com/Atom-Learning/components/compare/v2.34.0...v2.35.0) (2023-02-22)
1
+ # [2.36.0](https://github.com/Atom-Learning/components/compare/v2.35.0...v2.36.0) (2023-02-22)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * update theme version to 1.2.0 ([0be9b4c](https://github.com/Atom-Learning/components/commit/0be9b4c993a18a6985aabb522e215695bec3cd37))
6
+ * **data-table:** adding support to sticky column ([bc25366](https://github.com/Atom-Learning/components/commit/bc25366bcd99037b393d1deff25e2faae9c6aace))
7
+ * **data-table:** changing the api for sticky columns ([9d2e5bc](https://github.com/Atom-Learning/components/commit/9d2e5bc50f6f7c19afffc7c65fbf8e38053aa951))
8
+ * **data-table:** fixing shadow added to scroll container ([213465e](https://github.com/Atom-Learning/components/commit/213465e1d6c738dd4dc889e06c6324f1597bd745))
9
+ * **data-table:** moving sticky columns css to the container ([90c0ff2](https://github.com/Atom-Learning/components/commit/90c0ff2f51b63a6774fc8d4ec4b055e4fd7e64cc))
7
10
 
8
11
  # [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
9
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableBody.js","sources":["../../../src/components/data-table/DataTableBody.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Table } from '../table'\nimport { DataTable } from '.'\nimport { useDataTable } from './DataTableContext'\n\ntype DataTableBodyProps = Omit<\n React.ComponentProps<typeof Table.Body>,\n 'children'\n>\n\nexport const DataTableBody: React.FC<DataTableBodyProps> = ({\n striped = false,\n ...props\n}) => {\n const { getRowModel } = useDataTable()\n return (\n <Table.Body {...props} striped={striped}>\n {getRowModel().rows.map((row) => {\n return <DataTable.Row row={row} key={row.id} />\n })}\n </Table.Body>\n )\n}\n"],"names":["DataTableBody","striped","props","getRowModel","useDataTable","React","Table","row","DataTable"],"mappings":"kKAWO,MAAMA,EAA8C,CAAC,CAC1D,QAAAC,EAAU,MACPC,CACL,IAAM,CACJ,KAAM,CAAE,YAAAC,CAAY,EAAIC,IACxB,OACEC,EAAA,cAACC,EAAM,KAAN,CAAY,GAAGJ,EAAO,QAASD,CAC7BE,EAAAA,EAAAA,EAAc,KAAK,IAAKI,GAChBF,EAAA,cAACG,EAAU,IAAV,CAAc,IAAKD,EAAK,IAAKA,EAAI,EAAA,CAAI,CAC9C,CACH,CAEJ"}
1
+ {"version":3,"file":"DataTableBody.js","sources":["../../../src/components/data-table/DataTableBody.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Table } from '../table'\nimport { DataTable } from '.'\nimport { useDataTable } from './DataTableContext'\n\ntype DataTableBodyProps = Omit<\n React.ComponentProps<typeof Table.Body>,\n 'children'\n>\n\nexport const DataTableBody: React.FC<DataTableBodyProps> = ({\n striped = false,\n ...props\n}) => {\n const { getRowModel } = useDataTable()\n\n return (\n <Table.Body {...props} striped={striped}>\n {getRowModel().rows.map((row) => {\n return <DataTable.Row row={row} key={row.id} />\n })}\n </Table.Body>\n )\n}\n"],"names":["DataTableBody","striped","props","getRowModel","useDataTable","React","Table","row","DataTable"],"mappings":"kKAWO,MAAMA,EAA8C,CAAC,CAC1D,QAAAC,EAAU,MACPC,CACL,IAAM,CACJ,KAAM,CAAE,YAAAC,CAAY,EAAIC,IAExB,OACEC,EAAA,cAACC,EAAM,KAAN,CAAY,GAAGJ,EAAO,QAASD,CAC7BE,EAAAA,EAAAA,EAAc,KAAK,IAAKI,GAChBF,EAAA,cAACG,EAAU,IAAV,CAAc,IAAKD,EAAK,IAAKA,EAAI,EAAA,CAAI,CAC9C,CACH,CAEJ"}
@@ -1,2 +1,2 @@
1
- import*as e from"react";import{Table as i}from"../table/Table.js";import{DataTable as t}from"./DataTable.js";import{AsyncDataState as c}from"./DataTable.types.js";import{useDataTable as p}from"./DataTableContext.js";import{DataTableLoading as b}from"./DataTableLoading.js";const D=({sortable:a,striped:r,theme:o,css:m,...n})=>{const{asyncDataState:s}=p(),l=s===c.PENDING;return e.createElement(e.Fragment,null,e.createElement(b,null),e.createElement(i,{...n,css:{...m,...l&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},e.createElement(t.Head,{theme:o,sortable:a}),e.createElement(t.Body,{striped:r})))};export{D as DataTableTable};
1
+ import*as e from"react";import{Table as c}from"../table/Table.js";import{DataTable as t}from"./DataTable.js";import{AsyncDataState as p}from"./DataTable.types.js";import{useDataTable as b}from"./DataTableContext.js";import{DataTableLoading as f}from"./DataTableLoading.js";const u=({sortable:a,striped:r,theme:m,css:o,numberOfStickyColumns:n=0,...s})=>{const{asyncDataState:l}=b(),i=l===p.PENDING;return e.createElement(e.Fragment,null,e.createElement(f,null),e.createElement(c,{...s,numberOfStickyColumns:n,css:{...o,...i&&{opacity:.5,pointerEvents:"none",transition:"opacity 250ms linear 150ms"}}},e.createElement(t.Head,{theme:m,sortable:a}),e.createElement(t.Body,{striped:r})))};export{u as DataTableTable};
2
2
  //# sourceMappingURL=DataTableTable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableTable.js","sources":["../../../src/components/data-table/DataTableTable.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Table } from '../table'\nimport { DataTable } from './DataTable'\nimport { AsyncDataState } from './DataTable.types'\nimport { useDataTable } from './DataTableContext'\nimport { DataTableLoading } from './DataTableLoading'\n\nexport type DataTableTableProps = Omit<\n React.ComponentProps<typeof Table>,\n 'children'\n> &\n Partial<\n Pick<React.ComponentProps<typeof DataTable.Head>, 'theme' | 'sortable'>\n > &\n Partial<Pick<React.ComponentProps<typeof Table.Body>, 'striped'>>\n\nexport const DataTableTable: React.FC<DataTableTableProps> = ({\n sortable,\n striped,\n theme,\n css,\n ...props\n}) => {\n const { asyncDataState } = useDataTable()\n const isPending = asyncDataState === AsyncDataState.PENDING\n\n return (\n <>\n <DataTableLoading />\n <Table\n {...props}\n css={{\n ...css,\n ...(isPending && {\n opacity: 0.5,\n pointerEvents: 'none',\n transition: 'opacity 250ms linear 150ms'\n })\n }}\n >\n <DataTable.Head theme={theme} sortable={sortable} />\n <DataTable.Body striped={striped} />\n </Table>\n </>\n )\n}\n"],"names":["DataTableTable","sortable","striped","theme","css","props","asyncDataState","useDataTable","isPending","AsyncDataState","React","DataTableLoading","Table","DataTable"],"mappings":"iRAiBO,MAAMA,EAAgD,CAAC,CAC5D,SAAAC,EACA,QAAAC,EACA,MAAAC,EACA,IAAAC,KACGC,CACL,IAAM,CACJ,KAAM,CAAE,eAAAC,CAAe,EAAIC,IACrBC,EAAYF,IAAmBG,EAAe,QAEpD,OACEC,EAAA,cAAAA,EAAA,cACEA,EAAA,cAACC,EAAA,IAAiB,EAClBD,EAAA,cAACE,EAAA,CACE,GAAGP,EACJ,IAAK,CACH,GAAGD,EACH,GAAII,GAAa,CACf,QAAS,GACT,cAAe,OACf,WAAY,4BACd,CACF,CAEAE,EAAAA,EAAA,cAACG,EAAU,KAAV,CAAe,MAAOV,EAAO,SAAUF,EAAU,EAClDS,EAAA,cAACG,EAAU,KAAV,CAAe,QAASX,CAAAA,CAAS,CACpC,CACF,CAEJ"}
1
+ {"version":3,"file":"DataTableTable.js","sources":["../../../src/components/data-table/DataTableTable.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Table } from '../table'\nimport { DataTable } from './DataTable'\nimport { AsyncDataState } from './DataTable.types'\nimport { useDataTable } from './DataTableContext'\nimport { DataTableLoading } from './DataTableLoading'\n\nexport type DataTableTableProps = Omit<\n React.ComponentProps<typeof Table>,\n 'children'\n> &\n Partial<\n Pick<React.ComponentProps<typeof DataTable.Head>, 'theme' | 'sortable'>\n > &\n Partial<Pick<React.ComponentProps<typeof Table.Body>, 'striped'>>\n\nexport const DataTableTable: React.FC<DataTableTableProps> = ({\n sortable,\n striped,\n theme,\n css,\n numberOfStickyColumns = 0,\n ...props\n}) => {\n const { asyncDataState } = useDataTable()\n const isPending = asyncDataState === AsyncDataState.PENDING\n\n return (\n <>\n <DataTableLoading />\n <Table\n {...props}\n numberOfStickyColumns={numberOfStickyColumns}\n css={{\n ...css,\n ...(isPending && {\n opacity: 0.5,\n pointerEvents: 'none',\n transition: 'opacity 250ms linear 150ms'\n })\n }}\n >\n <DataTable.Head theme={theme} sortable={sortable} />\n <DataTable.Body striped={striped} />\n </Table>\n </>\n )\n}\n"],"names":["DataTableTable","sortable","striped","theme","css","numberOfStickyColumns","props","asyncDataState","useDataTable","isPending","AsyncDataState","React","DataTableLoading","Table","DataTable"],"mappings":"iRAiBa,MAAAA,EAAgD,CAAC,CAC5D,SAAAC,EACA,QAAAC,EACA,MAAAC,EACA,IAAAC,EACA,sBAAAC,EAAwB,KACrBC,CACL,IAAM,CACJ,KAAM,CAAE,eAAAC,CAAe,EAAIC,EAAa,EAClCC,EAAYF,IAAmBG,EAAe,QAEpD,OACEC,EAAA,cAAAA,EAAA,SACEA,KAAAA,EAAA,cAACC,EAAA,IAAiB,EAClBD,EAAA,cAACE,EAAA,CACE,GAAGP,EACJ,sBAAuBD,EACvB,IAAK,CACH,GAAGD,EACH,GAAIK,GAAa,CACf,QAAS,GACT,cAAe,OACf,WAAY,4BACd,CACF,CAAA,EAEAE,EAAA,cAACG,EAAU,KAAV,CAAe,MAAOX,EAAO,SAAUF,CAAU,CAAA,EAClDU,EAAA,cAACG,EAAU,KAAV,CAAe,QAASZ,CAAAA,CAAS,CACpC,CACF,CAEJ"}
@@ -6,6 +6,7 @@ import { TableFooterCell } from './TableFooterCell';
6
6
  import { TableHeader } from './TableHeader';
7
7
  import { TableHeaderCell } from './TableHeaderCell';
8
8
  import { TableRow } from './TableRow';
9
+ import { TableStickyColumnsContainer } from './TableStickyColumnsContainer';
9
10
  declare type TableSubComponents = {
10
11
  Body: typeof TableBody;
11
12
  Cell: typeof TableCell;
@@ -14,6 +15,7 @@ declare type TableSubComponents = {
14
15
  Header: typeof TableHeader;
15
16
  HeaderCell: typeof TableHeaderCell;
16
17
  Row: typeof TableRow;
18
+ StickyColumnsContainer: typeof TableStickyColumnsContainer;
17
19
  };
18
20
  declare const StyledTable: import("@stitches/react/types/styled-component").StyledComponent<"table", {
19
21
  size?: "md" | "lg" | undefined;
@@ -231,6 +233,8 @@ declare const StyledTable: import("@stitches/react/types/styled-component").Styl
231
233
  marginBottom: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
232
234
  };
233
235
  }>>;
234
- declare type TableProps = React.ComponentProps<typeof StyledTable>;
236
+ declare type TableProps = React.ComponentProps<typeof StyledTable> & {
237
+ numberOfStickyColumns?: number;
238
+ };
235
239
  export declare const Table: React.FC<TableProps> & TableSubComponents;
236
240
  export {};
@@ -1,2 +1,2 @@
1
- import*as d from"react";import{styled as s}from"../../stitches.js";import{TableBody as m}from"./TableBody.js";import{TableCell as o}from"./TableCell.js";import{TableFooter as p}from"./TableFooter.js";import{TableFooterCell as t}from"./TableFooterCell.js";import{TableHeader as $}from"./TableHeader.js";import{TableHeaderCell as r}from"./TableHeaderCell.js";import{StyledRow as f,TableRow as b}from"./TableRow.js";const n=s("table",{borderCollapse:"separate",borderSpacing:0,fontFamily:"$sans",fontSize:"$sm",width:"100%",variants:{size:{md:{[`${o}, ${r}, ${t}`]:{height:"$4"}},lg:{[`${o}, ${r}, ${t}`]:{height:"$5"}}},corners:{round:{[`${r}`]:{"&:first-of-type":{borderTopLeftRadius:"$0"},"&:last-of-type":{borderTopRightRadius:"$0"}},[`${f}:last-child`]:{[`${o}:first-child`]:{borderBottomLeftRadius:"$0"},[`${o}:last-child`]:{borderBottomRightRadius:"$0"}}},square:{}}}}),e=({size:l="md",corners:a="round",...i})=>d.createElement(n,{size:l,corners:a,...i});e.Body=m,e.Cell=o,e.Footer=p,e.FooterCell=t,e.Header=$,e.HeaderCell=r,e.Row=b,e.displayName="Table";export{e as Table};
1
+ import*as i from"react";import{styled as f}from"../../stitches.js";import{TableBody as b}from"./TableBody.js";import{TableCell as o}from"./TableCell.js";import{TableFooter as p}from"./TableFooter.js";import{TableFooterCell as t}from"./TableFooterCell.js";import{TableHeader as $}from"./TableHeader.js";import{TableHeaderCell as r}from"./TableHeaderCell.js";import{StyledRow as c,TableRow as u}from"./TableRow.js";import{TableStickyColumnsContainer as m}from"./TableStickyColumnsContainer.js";const C=f("table",{borderCollapse:"separate",borderSpacing:0,fontFamily:"$sans",fontSize:"$sm",width:"100%",variants:{size:{md:{[`${o}, ${r}, ${t}`]:{height:"$4"}},lg:{[`${o}, ${r}, ${t}`]:{height:"$5"}}},corners:{round:{[`${r}`]:{"&:first-of-type":{borderTopLeftRadius:"$0"},"&:last-of-type":{borderTopRightRadius:"$0"}},[`${c}:last-child`]:{[`${o}:first-child`]:{borderBottomLeftRadius:"$0"},[`${o}:last-child`]:{borderBottomRightRadius:"$0"}}},square:{}}}}),e=({size:s="md",corners:d="round",numberOfStickyColumns:l=0,...n})=>{const a=i.createElement(C,{size:s,corners:d,...n});return l?i.createElement(m,{numberOfStickyColumns:l},a):a};e.Body=b,e.Cell=o,e.Footer=p,e.FooterCell=t,e.Header=$,e.HeaderCell=r,e.Row=u,e.StickyColumnsContainer=m,e.displayName="Table";export{e as Table};
2
2
  //# sourceMappingURL=Table.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sources":["../../../src/components/table/Table.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { TableBody } from './TableBody'\nimport { TableCell } from './TableCell'\nimport { TableFooter } from './TableFooter'\nimport { TableFooterCell } from './TableFooterCell'\nimport { TableHeader } from './TableHeader'\nimport { TableHeaderCell } from './TableHeaderCell'\nimport { StyledRow, TableRow } from './TableRow'\n\ntype TableSubComponents = {\n Body: typeof TableBody\n Cell: typeof TableCell\n Footer: typeof TableFooter\n FooterCell: typeof TableFooterCell\n Header: typeof TableHeader\n HeaderCell: typeof TableHeaderCell\n Row: typeof TableRow\n}\n\nconst StyledTable = styled('table', {\n borderCollapse: 'separate',\n borderSpacing: 0,\n fontFamily: '$sans',\n fontSize: '$sm',\n width: '100%',\n variants: {\n size: {\n md: {\n [`${TableCell}, ${TableHeaderCell}, ${TableFooterCell}`]: {\n height: '$4'\n }\n },\n lg: {\n [`${TableCell}, ${TableHeaderCell}, ${TableFooterCell}`]: {\n height: '$5'\n }\n }\n },\n corners: {\n round: {\n [`${TableHeaderCell}`]: {\n '&:first-of-type': { borderTopLeftRadius: '$0' },\n '&:last-of-type': { borderTopRightRadius: '$0' }\n },\n [`${StyledRow}:last-child`]: {\n [`${TableCell}:first-child`]: { borderBottomLeftRadius: '$0' },\n [`${TableCell}:last-child`]: { borderBottomRightRadius: '$0' }\n }\n },\n square: {}\n }\n }\n})\n\ntype TableProps = React.ComponentProps<typeof StyledTable>\n\nexport const Table: React.FC<TableProps> & TableSubComponents = ({\n size = 'md',\n corners = 'round',\n ...rest\n}: TableProps) => <StyledTable size={size} corners={corners} {...rest} />\n\nTable.Body = TableBody\nTable.Cell = TableCell\nTable.Footer = TableFooter\nTable.FooterCell = TableFooterCell\nTable.Header = TableHeader\nTable.HeaderCell = TableHeaderCell\nTable.Row = TableRow\n\nTable.displayName = 'Table'\n"],"names":["StyledTable","styled","TableCell","TableHeaderCell","TableFooterCell","StyledRow","Table","size","corners","rest","React","TableBody","TableFooter","TableHeader","TableRow"],"mappings":"6ZAsBA,MAAMA,EAAcC,EAAO,QAAS,CAClC,eAAgB,WAChB,cAAe,EACf,WAAY,QACZ,SAAU,MACV,MAAO,OACP,SAAU,CACR,KAAM,CACJ,GAAI,CACF,CAAC,GAAGC,MAAcC,MAAoBC,KAAoB,CACxD,OAAQ,IACV,CACF,EACA,GAAI,CACF,CAAC,GAAGF,MAAcC,MAAoBC,KAAoB,CACxD,OAAQ,IACV,CACF,CACF,EACA,QAAS,CACP,MAAO,CACL,CAAC,GAAGD,KAAoB,CACtB,kBAAmB,CAAE,oBAAqB,IAAK,EAC/C,iBAAkB,CAAE,qBAAsB,IAAK,CACjD,EACA,CAAC,GAAGE,gBAAyB,CAC3B,CAAC,GAAGH,iBAA0B,CAAE,uBAAwB,IAAK,EAC7D,CAAC,GAAGA,gBAAyB,CAAE,wBAAyB,IAAK,CAC/D,CACF,EACA,OAAQ,CAAA,CACV,CACF,CACF,CAAC,EAIYI,EAAmD,CAAC,CAC/D,KAAAC,EAAO,KACP,QAAAC,EAAU,WACPC,CACL,IAAkBC,EAAA,cAACV,EAAA,CAAY,KAAMO,EAAM,QAASC,EAAU,GAAGC,CAAAA,CAAM,EAEvEH,EAAM,KAAOK,EACbL,EAAM,KAAOJ,EACbI,EAAM,OAASM,EACfN,EAAM,WAAaF,EACnBE,EAAM,OAASO,EACfP,EAAM,WAAaH,EACnBG,EAAM,IAAMQ,EAEZR,EAAM,YAAc"}
1
+ {"version":3,"file":"Table.js","sources":["../../../src/components/table/Table.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { TableBody } from './TableBody'\nimport { TableCell } from './TableCell'\nimport { TableFooter } from './TableFooter'\nimport { TableFooterCell } from './TableFooterCell'\nimport { TableHeader } from './TableHeader'\nimport { TableHeaderCell } from './TableHeaderCell'\nimport { StyledRow, TableRow } from './TableRow'\nimport { TableStickyColumnsContainer } from './TableStickyColumnsContainer'\n\ntype TableSubComponents = {\n Body: typeof TableBody\n Cell: typeof TableCell\n Footer: typeof TableFooter\n FooterCell: typeof TableFooterCell\n Header: typeof TableHeader\n HeaderCell: typeof TableHeaderCell\n Row: typeof TableRow\n StickyColumnsContainer: typeof TableStickyColumnsContainer\n}\n\nconst StyledTable = styled('table', {\n borderCollapse: 'separate',\n borderSpacing: 0,\n fontFamily: '$sans',\n fontSize: '$sm',\n width: '100%',\n variants: {\n size: {\n md: {\n [`${TableCell}, ${TableHeaderCell}, ${TableFooterCell}`]: {\n height: '$4'\n }\n },\n lg: {\n [`${TableCell}, ${TableHeaderCell}, ${TableFooterCell}`]: {\n height: '$5'\n }\n }\n },\n corners: {\n round: {\n [`${TableHeaderCell}`]: {\n '&:first-of-type': { borderTopLeftRadius: '$0' },\n '&:last-of-type': { borderTopRightRadius: '$0' }\n },\n [`${StyledRow}:last-child`]: {\n [`${TableCell}:first-child`]: { borderBottomLeftRadius: '$0' },\n [`${TableCell}:last-child`]: { borderBottomRightRadius: '$0' }\n }\n },\n square: {}\n }\n }\n})\n\ntype TableProps = React.ComponentProps<typeof StyledTable> & {\n numberOfStickyColumns?: number\n}\n\nexport const Table: React.FC<TableProps> & TableSubComponents = ({\n size = 'md',\n corners = 'round',\n numberOfStickyColumns = 0,\n ...rest\n}: TableProps) => {\n const tableComponent = <StyledTable size={size} corners={corners} {...rest} />\n\n if (numberOfStickyColumns) {\n return (\n <TableStickyColumnsContainer\n numberOfStickyColumns={numberOfStickyColumns}\n >\n {tableComponent}\n </TableStickyColumnsContainer>\n )\n }\n\n return tableComponent\n}\n\nTable.Body = TableBody\nTable.Cell = TableCell\nTable.Footer = TableFooter\nTable.FooterCell = TableFooterCell\nTable.Header = TableHeader\nTable.HeaderCell = TableHeaderCell\nTable.Row = TableRow\nTable.StickyColumnsContainer = TableStickyColumnsContainer\n\nTable.displayName = 'Table'\n"],"names":["StyledTable","styled","TableCell","TableHeaderCell","TableFooterCell","StyledRow","Table","size","corners","numberOfStickyColumns","rest","tableComponent","React","TableStickyColumnsContainer","TableBody","TableFooter","TableHeader","TableRow"],"mappings":"4eAwBA,MAAMA,EAAcC,EAAO,QAAS,CAClC,eAAgB,WAChB,cAAe,EACf,WAAY,QACZ,SAAU,MACV,MAAO,OACP,SAAU,CACR,KAAM,CACJ,GAAI,CACF,CAAC,GAAGC,MAAcC,MAAoBC,KAAoB,CACxD,OAAQ,IACV,CACF,EACA,GAAI,CACF,CAAC,GAAGF,MAAcC,MAAoBC,KAAoB,CACxD,OAAQ,IACV,CACF,CACF,EACA,QAAS,CACP,MAAO,CACL,CAAC,GAAGD,KAAoB,CACtB,kBAAmB,CAAE,oBAAqB,IAAK,EAC/C,iBAAkB,CAAE,qBAAsB,IAAK,CACjD,EACA,CAAC,GAAGE,gBAAyB,CAC3B,CAAC,GAAGH,iBAA0B,CAAE,uBAAwB,IAAK,EAC7D,CAAC,GAAGA,gBAAyB,CAAE,wBAAyB,IAAK,CAC/D,CACF,EACA,OAAQ,CAAA,CACV,CACF,CACF,CAAC,EAMYI,EAAmD,CAAC,CAC/D,KAAAC,EAAO,KACP,QAAAC,EAAU,QACV,sBAAAC,EAAwB,KACrBC,CACL,IAAkB,CAChB,MAAMC,EAAiBC,EAAA,cAACZ,EAAA,CAAY,KAAMO,EAAM,QAASC,EAAU,GAAGE,EAAM,EAE5E,OAAID,EAEAG,EAAA,cAACC,EAAA,CACC,sBAAuBJ,GAEtBE,CACH,EAIGA,CACT,EAEAL,EAAM,KAAOQ,EACbR,EAAM,KAAOJ,EACbI,EAAM,OAASS,EACfT,EAAM,WAAaF,EACnBE,EAAM,OAASU,EACfV,EAAM,WAAaH,EACnBG,EAAM,IAAMW,EACZX,EAAM,uBAAyBO,EAE/BP,EAAM,YAAc"}
@@ -1,2 +1,2 @@
1
- import*as d from"react";import{styled as r}from"../../stitches.js";import{StyledRow as i}from"./TableRow.js";const l=r("tbody",{variants:{striped:{true:{[`${i}`]:{"&:nth-child(odd)":{bg:"white"},"&:nth-child(even)":{bg:"$tonal50"}}},false:{bg:"white"}}}}),t=({striped:e=!0,...o})=>d.createElement(l,{striped:e,...o});t.displayName="TableBody";export{t as TableBody};
1
+ import*as r from"react";import{styled as i}from"../../stitches.js";import{StyledRow as t}from"./TableRow.js";const l=i("tbody",{variants:{striped:{true:{[`${t}`]:{"&:nth-child(odd)":{bg:"white"},"&:nth-child(even)":{bg:"$tonal50"}}},false:{[`${t}`]:{bg:"white"}}}}}),e=({striped:o=!0,...d})=>r.createElement(l,{striped:o,...d});e.displayName="TableBody";export{e as TableBody};
2
2
  //# sourceMappingURL=TableBody.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableBody.js","sources":["../../../src/components/table/TableBody.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { StyledRow } from './TableRow'\n\nconst StyledTableBody = styled('tbody', {\n variants: {\n striped: {\n true: {\n [`${StyledRow}`]: {\n '&:nth-child(odd)': { bg: 'white' },\n '&:nth-child(even)': { bg: '$tonal50' }\n }\n },\n false: {\n bg: 'white'\n }\n }\n }\n})\n\ntype TableBodyProps = React.ComponentProps<typeof StyledTableBody>\n\nexport const TableBody: React.FC<TableBodyProps> = ({\n striped = true,\n ...rest\n}) => <StyledTableBody striped={striped} {...rest} />\n\nTableBody.displayName = 'TableBody'\n"],"names":["StyledTableBody","styled","StyledRow","TableBody","striped","rest","React"],"mappings":"6GAMA,MAAMA,EAAkBC,EAAO,QAAS,CACtC,SAAU,CACR,QAAS,CACP,KAAM,CACJ,CAAC,GAAGC,KAAc,CAChB,mBAAoB,CAAE,GAAI,OAAQ,EAClC,oBAAqB,CAAE,GAAI,UAAW,CACxC,CACF,EACA,MAAO,CACL,GAAI,OACN,CACF,CACF,CACF,CAAC,EAIYC,EAAsC,CAAC,CAClD,QAAAC,EAAU,MACPC,CACL,IAAMC,EAAA,cAACN,EAAA,CAAgB,QAASI,EAAU,GAAGC,CAAM,CAAA,EAEnDF,EAAU,YAAc"}
1
+ {"version":3,"file":"TableBody.js","sources":["../../../src/components/table/TableBody.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { StyledRow } from './TableRow'\n\nconst StyledTableBody = styled('tbody', {\n variants: {\n striped: {\n true: {\n [`${StyledRow}`]: {\n '&:nth-child(odd)': { bg: 'white' },\n '&:nth-child(even)': { bg: '$tonal50' }\n }\n },\n false: {\n [`${StyledRow}`]: {\n bg: 'white'\n }\n }\n }\n }\n})\n\ntype TableBodyProps = React.ComponentProps<typeof StyledTableBody>\n\nexport const TableBody: React.FC<TableBodyProps> = ({\n striped = true,\n ...rest\n}) => <StyledTableBody striped={striped} {...rest} />\n\nTableBody.displayName = 'TableBody'\n"],"names":["StyledTableBody","styled","StyledRow","TableBody","striped","rest","React"],"mappings":"6GAMA,MAAMA,EAAkBC,EAAO,QAAS,CACtC,SAAU,CACR,QAAS,CACP,KAAM,CACJ,CAAC,GAAGC,KAAc,CAChB,mBAAoB,CAAE,GAAI,OAAQ,EAClC,oBAAqB,CAAE,GAAI,UAAW,CACxC,CACF,EACA,MAAO,CACL,CAAC,GAAGA,KAAc,CAChB,GAAI,OACN,CACF,CACF,CACF,CACF,CAAC,EAIYC,EAAsC,CAAC,CAClD,QAAAC,EAAU,MACPC,CACL,IAAMC,EAAA,cAACN,EAAA,CAAgB,QAASI,EAAU,GAAGC,CAAM,CAAA,EAEnDF,EAAU,YAAc"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { CSS } from '../../stitches';
3
+ interface ITableStickyColumnsContainerProps {
4
+ children: React.ReactNode;
5
+ numberOfStickyColumns?: number;
6
+ css?: CSS;
7
+ }
8
+ export declare const TableStickyColumnsContainer: React.FC<ITableStickyColumnsContainerProps>;
9
+ export {};
@@ -0,0 +1,2 @@
1
+ import n from"react";import{Box as p}from"../box/Box.js";const a=({children:l,numberOfStickyColumns:t=0,css:c,...i})=>{const[o,s]=n.useState(!1);return n.createElement(p,{onScroll:r=>{const e=r.currentTarget.scrollWidth>r.currentTarget.clientWidth;e!==o&&s(e)},role:"scrollbar",css:{overflow:"auto",maxWidth:"100%",[`& td:nth-of-type(${t}), th:nth-of-type(${t})`]:{...o&&{boxShadow:"$colors$alpha200 -2px -3px 9px 1px",clipPath:"inset(0px -10px 0px 0px)"},...t===1&&{position:"sticky",left:"0",zIndex:"2"}},"& td":{bg:"inherit"},...c},...i},l)};export{a as TableStickyColumnsContainer};
2
+ //# sourceMappingURL=TableStickyColumnsContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableStickyColumnsContainer.js","sources":["../../../src/components/table/TableStickyColumnsContainer.tsx"],"sourcesContent":["import React from 'react'\n\nimport { CSS } from '~/stitches'\n\nimport { Box } from '../box'\n\ninterface ITableStickyColumnsContainerProps {\n children: React.ReactNode\n numberOfStickyColumns?: number\n css?: CSS\n}\n\nexport const TableStickyColumnsContainer: React.FC<\n ITableStickyColumnsContainerProps\n> = ({ children, numberOfStickyColumns = 0, css, ...restProps }) => {\n const [hasScroll, setHasScroll] = React.useState<boolean>(false)\n\n const handleScroll = (event: React.UIEvent<HTMLDivElement>) => {\n const newHasScroll =\n event.currentTarget.scrollWidth > event.currentTarget.clientWidth\n if (newHasScroll !== hasScroll) {\n setHasScroll(newHasScroll)\n }\n }\n\n return (\n <Box\n onScroll={handleScroll}\n role=\"scrollbar\"\n css={{\n overflow: 'auto',\n maxWidth: '100%',\n [`& td:nth-of-type(${numberOfStickyColumns}), th:nth-of-type(${numberOfStickyColumns})`]:\n {\n ...(hasScroll && {\n boxShadow: '$colors$alpha200 -2px -3px 9px 1px',\n clipPath: 'inset(0px -10px 0px 0px)'\n }),\n ...(numberOfStickyColumns === 1 && {\n position: 'sticky',\n left: '0',\n zIndex: '2'\n })\n },\n '& td': {\n bg: 'inherit'\n },\n ...css\n }}\n {...restProps}\n >\n {children}\n </Box>\n )\n}\n"],"names":["TableStickyColumnsContainer","children","numberOfStickyColumns","css","restProps","hasScroll","setHasScroll","React","Box","event","newHasScroll"],"mappings":"yDAYO,MAAMA,EAET,CAAC,CAAE,SAAAC,EAAU,sBAAAC,EAAwB,EAAG,IAAAC,KAAQC,CAAU,IAAM,CAClE,KAAM,CAACC,EAAWC,CAAY,EAAIC,EAAM,SAAkB,EAAK,EAU/D,OACEA,EAAA,cAACC,EAAA,CACC,SAVkBC,GAAyC,CAC7D,MAAMC,EACJD,EAAM,cAAc,YAAcA,EAAM,cAAc,YACpDC,IAAiBL,GACnBC,EAAaI,CAAY,CAE7B,EAKI,KAAK,YACL,IAAK,CACH,SAAU,OACV,SAAU,OACV,CAAC,oBAAoBR,sBAA0CA,MAC7D,CACE,GAAIG,GAAa,CACf,UAAW,qCACX,SAAU,0BACZ,EACA,GAAIH,IAA0B,GAAK,CACjC,SAAU,SACV,KAAM,IACN,OAAQ,GACV,CACF,EACF,OAAQ,CACN,GAAI,SACN,EACA,GAAGC,CACL,EACC,GAAGC,CAEHH,EAAAA,CACH,CAEJ"}