@protonradio/proton-ui 0.11.28 → 0.11.29

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 (85) hide show
  1. package/dist/components/Table/BaseTable/Collection/CompoundComponents.cjs.js +2 -0
  2. package/dist/components/Table/BaseTable/Collection/CompoundComponents.cjs.js.map +1 -0
  3. package/dist/components/Table/BaseTable/Collection/CompoundComponents.es.js +9 -0
  4. package/dist/components/Table/BaseTable/Collection/CompoundComponents.es.js.map +1 -0
  5. package/dist/components/Table/BaseTable/Collection/collectionParser.cjs.js +2 -0
  6. package/dist/components/Table/BaseTable/Collection/collectionParser.cjs.js.map +1 -0
  7. package/dist/components/Table/BaseTable/Collection/collectionParser.es.js +67 -0
  8. package/dist/components/Table/BaseTable/Collection/collectionParser.es.js.map +1 -0
  9. package/dist/components/Table/BaseTable/Collection/useTableCollection.cjs.js +2 -0
  10. package/dist/components/Table/BaseTable/Collection/useTableCollection.cjs.js.map +1 -0
  11. package/dist/components/Table/BaseTable/Collection/useTableCollection.es.js +27 -0
  12. package/dist/components/Table/BaseTable/Collection/useTableCollection.es.js.map +1 -0
  13. package/dist/components/Table/BaseTable/Table.cjs.js +2 -0
  14. package/dist/components/Table/BaseTable/Table.cjs.js.map +1 -0
  15. package/dist/components/Table/BaseTable/Table.es.js +80 -0
  16. package/dist/components/Table/BaseTable/Table.es.js.map +1 -0
  17. package/dist/components/Table/BaseTable/elements/TableBody.cjs.js +2 -0
  18. package/dist/components/Table/BaseTable/elements/TableBody.cjs.js.map +1 -0
  19. package/dist/components/Table/BaseTable/elements/TableBody.es.js +7 -0
  20. package/dist/components/Table/BaseTable/elements/TableBody.es.js.map +1 -0
  21. package/dist/components/Table/BaseTable/elements/TableCell.cjs.js +2 -0
  22. package/dist/components/Table/BaseTable/elements/TableCell.cjs.js.map +1 -0
  23. package/dist/components/Table/BaseTable/elements/TableCell.es.js +22 -0
  24. package/dist/components/Table/BaseTable/elements/TableCell.es.js.map +1 -0
  25. package/dist/components/Table/BaseTable/elements/TableHeader.cjs.js +2 -0
  26. package/dist/components/Table/BaseTable/elements/TableHeader.cjs.js.map +1 -0
  27. package/dist/components/Table/BaseTable/elements/TableHeader.es.js +15 -0
  28. package/dist/components/Table/BaseTable/elements/TableHeader.es.js.map +1 -0
  29. package/dist/components/Table/BaseTable/elements/TableHeaderCell.cjs.js +2 -0
  30. package/dist/components/Table/BaseTable/elements/TableHeaderCell.cjs.js.map +1 -0
  31. package/dist/components/Table/BaseTable/elements/TableHeaderCell.es.js +23 -0
  32. package/dist/components/Table/BaseTable/elements/TableHeaderCell.es.js.map +1 -0
  33. package/dist/components/Table/BaseTable/elements/TableHeaderRow.cjs.js +2 -0
  34. package/dist/components/Table/BaseTable/elements/TableHeaderRow.cjs.js.map +1 -0
  35. package/dist/components/Table/BaseTable/elements/TableHeaderRow.es.js +18 -0
  36. package/dist/components/Table/BaseTable/elements/TableHeaderRow.es.js.map +1 -0
  37. package/dist/components/Table/BaseTable/elements/TableRoot.cjs.js +2 -0
  38. package/dist/components/Table/BaseTable/elements/TableRoot.cjs.js.map +1 -0
  39. package/dist/components/Table/BaseTable/elements/TableRoot.es.js +27 -0
  40. package/dist/components/Table/BaseTable/elements/TableRoot.es.js.map +1 -0
  41. package/dist/components/Table/BaseTable/elements/TableRow.cjs.js +2 -0
  42. package/dist/components/Table/BaseTable/elements/TableRow.cjs.js.map +1 -0
  43. package/dist/components/Table/BaseTable/elements/TableRow.es.js +26 -0
  44. package/dist/components/Table/BaseTable/elements/TableRow.es.js.map +1 -0
  45. package/dist/components/Table/DataTable/DataTable.cjs.js +2 -0
  46. package/dist/components/Table/DataTable/DataTable.cjs.js.map +1 -0
  47. package/dist/components/Table/DataTable/DataTable.es.js +140 -0
  48. package/dist/components/Table/DataTable/DataTable.es.js.map +1 -0
  49. package/dist/components/Table/DataTable/DataTableRow.cjs.js +2 -0
  50. package/dist/components/Table/DataTable/DataTableRow.cjs.js.map +1 -0
  51. package/dist/components/Table/DataTable/DataTableRow.es.js +32 -0
  52. package/dist/components/Table/DataTable/DataTableRow.es.js.map +1 -0
  53. package/dist/index.cjs.js +1 -1
  54. package/dist/index.d.ts +309 -74
  55. package/dist/index.es.js +74 -55
  56. package/dist/index.es.js.map +1 -1
  57. package/dist/utils/deepEqual.cjs.js +2 -0
  58. package/dist/utils/deepEqual.cjs.js.map +1 -0
  59. package/dist/utils/deepEqual.es.js +31 -0
  60. package/dist/utils/deepEqual.es.js.map +1 -0
  61. package/dist/utils.cjs.js +1 -1
  62. package/dist/utils.d.ts +11 -0
  63. package/dist/utils.es.js +19 -17
  64. package/dist/utils.es.js.map +1 -1
  65. package/package.json +1 -1
  66. package/dist/components/DataTable/DataTable.cjs.js +0 -2
  67. package/dist/components/DataTable/DataTable.cjs.js.map +0 -1
  68. package/dist/components/DataTable/DataTable.es.js +0 -137
  69. package/dist/components/DataTable/DataTable.es.js.map +0 -1
  70. package/dist/components/Table/Collection/CompoundComponents.cjs.js +0 -2
  71. package/dist/components/Table/Collection/CompoundComponents.cjs.js.map +0 -1
  72. package/dist/components/Table/Collection/CompoundComponents.es.js +0 -9
  73. package/dist/components/Table/Collection/CompoundComponents.es.js.map +0 -1
  74. package/dist/components/Table/Collection/collectionParser.cjs.js +0 -2
  75. package/dist/components/Table/Collection/collectionParser.cjs.js.map +0 -1
  76. package/dist/components/Table/Collection/collectionParser.es.js +0 -54
  77. package/dist/components/Table/Collection/collectionParser.es.js.map +0 -1
  78. package/dist/components/Table/Collection/useTableCollection.cjs.js +0 -2
  79. package/dist/components/Table/Collection/useTableCollection.cjs.js.map +0 -1
  80. package/dist/components/Table/Collection/useTableCollection.es.js +0 -59
  81. package/dist/components/Table/Collection/useTableCollection.es.js.map +0 -1
  82. package/dist/components/Table/Table.cjs.js +0 -2
  83. package/dist/components/Table/Table.cjs.js.map +0 -1
  84. package/dist/components/Table/Table.es.js +0 -89
  85. package/dist/components/Table/Table.es.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=o=>null,n=o=>null,e=o=>null,u=o=>null,d=o=>null;exports.TableBodyCompound=e;exports.TableCellCompound=d;exports.TableColumnCompound=n;exports.TableHeaderCompound=l;exports.TableRowCompound=u;
2
+ //# sourceMappingURL=CompoundComponents.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompoundComponents.cjs.js","sources":["../../../../../src/components/Table/BaseTable/Collection/CompoundComponents.tsx"],"sourcesContent":["import { AriaAttributes, ReactElement, ReactNode } from \"react\";\n\n/*\n Compound reference components used to build the table collection.\n They are not rendered, but used to parse the table structure.\n*/\n\ntype TableColumnElement = ReactElement<\n TableColumnProps,\n typeof TableColumnCompound\n>;\ntype TableRowElement = ReactElement<TableRowProps, typeof TableRowCompound>;\ntype TableCellElement = ReactElement<TableCellProps, typeof TableCellCompound>;\n\nexport interface TableHeaderProps {\n children: TableColumnElement | TableColumnElement[];\n isHidden?: boolean;\n \"data-testid\"?: string;\n}\n\nexport interface TableColumnProps {\n id: string;\n children: ReactNode;\n \"aria-sort\"?: AriaAttributes[\"aria-sort\"];\n}\n\nexport interface TableBodyProps {\n children: TableRowElement | TableRowElement[] | ReactElement | ReactElement[];\n}\n\nexport interface TableRowProps {\n key?: string | number;\n children: TableCellElement | TableCellElement[];\n onClick?: () => void;\n \"data-testid\"?: string;\n}\n\nexport interface TableCellProps {\n columnKey?: string;\n children?: ReactNode;\n colSpan?: number;\n \"data-testid\"?: string;\n}\n\n// Type-safe component definitions that enforce proper children\nexport const TableHeaderCompound = (_: TableHeaderProps) => {\n return null; // This is just a marker component for parsing\n};\n\nexport const TableColumnCompound = (_: TableColumnProps) => {\n return null; // This is just a marker component for parsing\n};\n\nexport const TableBodyCompound = (_: TableBodyProps) => {\n return null; // This is just a marker component for parsing\n};\n\nexport const TableRowCompound = (_: TableRowProps) => {\n return null; // This is just a marker component for parsing\n};\n\nexport const TableCellCompound = (_: TableCellProps) => {\n return null; // This is just a marker component for parsing\n};\n"],"names":["TableHeaderCompound","_","TableColumnCompound","TableBodyCompound","TableRowCompound","TableCellCompound"],"mappings":"gFA6Ca,MAAAA,EAAuBC,GAC3B,KAGIC,EAAuBD,GAC3B,KAGIE,EAAqBF,GACzB,KAGIG,EAAoBH,GACxB,KAGII,EAAqBJ,GACzB"}
@@ -0,0 +1,9 @@
1
+ const o = (n) => null, l = (n) => null, u = (n) => null, e = (n) => null, r = (n) => null;
2
+ export {
3
+ u as TableBodyCompound,
4
+ r as TableCellCompound,
5
+ l as TableColumnCompound,
6
+ o as TableHeaderCompound,
7
+ e as TableRowCompound
8
+ };
9
+ //# sourceMappingURL=CompoundComponents.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompoundComponents.es.js","sources":["../../../../../src/components/Table/BaseTable/Collection/CompoundComponents.tsx"],"sourcesContent":["import { AriaAttributes, ReactElement, ReactNode } from \"react\";\n\n/*\n Compound reference components used to build the table collection.\n They are not rendered, but used to parse the table structure.\n*/\n\ntype TableColumnElement = ReactElement<\n TableColumnProps,\n typeof TableColumnCompound\n>;\ntype TableRowElement = ReactElement<TableRowProps, typeof TableRowCompound>;\ntype TableCellElement = ReactElement<TableCellProps, typeof TableCellCompound>;\n\nexport interface TableHeaderProps {\n children: TableColumnElement | TableColumnElement[];\n isHidden?: boolean;\n \"data-testid\"?: string;\n}\n\nexport interface TableColumnProps {\n id: string;\n children: ReactNode;\n \"aria-sort\"?: AriaAttributes[\"aria-sort\"];\n}\n\nexport interface TableBodyProps {\n children: TableRowElement | TableRowElement[] | ReactElement | ReactElement[];\n}\n\nexport interface TableRowProps {\n key?: string | number;\n children: TableCellElement | TableCellElement[];\n onClick?: () => void;\n \"data-testid\"?: string;\n}\n\nexport interface TableCellProps {\n columnKey?: string;\n children?: ReactNode;\n colSpan?: number;\n \"data-testid\"?: string;\n}\n\n// Type-safe component definitions that enforce proper children\nexport const TableHeaderCompound = (_: TableHeaderProps) => {\n return null; // This is just a marker component for parsing\n};\n\nexport const TableColumnCompound = (_: TableColumnProps) => {\n return null; // This is just a marker component for parsing\n};\n\nexport const TableBodyCompound = (_: TableBodyProps) => {\n return null; // This is just a marker component for parsing\n};\n\nexport const TableRowCompound = (_: TableRowProps) => {\n return null; // This is just a marker component for parsing\n};\n\nexport const TableCellCompound = (_: TableCellProps) => {\n return null; // This is just a marker component for parsing\n};\n"],"names":["TableHeaderCompound","_","TableColumnCompound","TableBodyCompound","TableRowCompound","TableCellCompound"],"mappings":"AA6Ca,MAAAA,IAAsB,CAACC,MAC3B,MAGIC,IAAsB,CAACD,MAC3B,MAGIE,IAAoB,CAACF,MACzB,MAGIG,IAAmB,CAACH,MACxB,MAGII,IAAoB,CAACJ,MACzB;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),a=require("./CompoundComponents.cjs.js"),p=(t,s)=>t.type===s,h=(t,s)=>{const n=[],d=l.Children.toArray(t);for(const o of d)if(l.isValidElement(o)&&p(o,a.TableColumnCompound)){const e=o.props;n.push({key:e.id,header:e.children,isHidden:s,ariaSort:e["aria-sort"]})}return n},C=(t,s)=>{var e;const n=[],d=l.Children.toArray(t);let o=0;for(const c of d)if(l.isValidElement(c)&&p(c,a.TableCellCompound)){const r=c.props,i=r.columnKey??((e=s[o])==null?void 0:e.key);i&&n.push({columnKey:i,value:r.children,colSpan:r.colSpan,dataTestId:r["data-testid"]}),o++}return n},m=t=>{const s=[],n=[],d=l.Children.toArray(t);for(const o of d)if(l.isValidElement(o)){if(p(o,a.TableHeaderCompound)){const e=o.props,c=h(e.children,e.isHidden||!1);s.push(...c);continue}if(p(o,a.TableBodyCompound)){const e=o.props,c=l.Children.toArray(e.children);for(const r of c)if(l.isValidElement(r))if(p(r,a.TableRowCompound)){const i=r.props,u=C(i.children,s);n.push({key:r.key??i.key??String(n.length),cells:u,onClick:i.onClick,dataTestId:i["data-testid"]})}else n.push(r)}}return{columns:s,rows:n}};exports.parseTableChildren=m;
2
+ //# sourceMappingURL=collectionParser.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectionParser.cjs.js","sources":["../../../../../src/components/Table/BaseTable/Collection/collectionParser.ts"],"sourcesContent":["import {\n Children,\n isValidElement,\n ReactElement,\n ReactNode,\n ComponentType,\n} from \"react\";\n\nimport {\n TableHeaderCompound,\n TableColumnCompound,\n TableBodyCompound,\n TableRowCompound,\n TableCellCompound,\n} from \"./CompoundComponents\";\nimport type {\n TableColumnData,\n TableData,\n TableRowData,\n TableCellData,\n} from \"../types\";\n\nconst isComponentType = (\n element: ReactElement,\n componentType: ComponentType<any>,\n): boolean => element.type === componentType;\n\n/**\n * Parses columns from Table.Header children\n */\nconst parseColumns = (\n headerChildren: ReactNode,\n isHeaderHidden: boolean,\n): TableColumnData[] => {\n const columns: TableColumnData[] = [];\n const childrenArray = Children.toArray(headerChildren);\n\n for (const columnChild of childrenArray) {\n if (\n isValidElement(columnChild) &&\n isComponentType(columnChild, TableColumnCompound)\n ) {\n const columnProps = columnChild.props;\n columns.push({\n key: columnProps.id,\n header: columnProps.children,\n isHidden: isHeaderHidden,\n ariaSort: columnProps[\"aria-sort\"],\n });\n }\n }\n\n return columns;\n};\n\n/**\n * Parses cells from Table.Row children\n */\nconst parseCells = (\n rowChildren: ReactNode,\n columns: TableColumnData[],\n): TableCellData[] => {\n const cells: TableCellData[] = [];\n const childrenArray = Children.toArray(rowChildren);\n let cellIndex = 0;\n\n for (const cellChild of childrenArray) {\n if (\n isValidElement(cellChild) &&\n isComponentType(cellChild, TableCellCompound)\n ) {\n const cellProps = cellChild.props;\n const columnKey = cellProps.columnKey ?? columns[cellIndex]?.key;\n\n if (columnKey) {\n cells.push({\n columnKey,\n value: cellProps.children,\n colSpan: cellProps.colSpan,\n dataTestId: cellProps[\"data-testid\"],\n });\n }\n cellIndex++;\n }\n }\n\n return cells;\n};\n\n/**\n * Parses JSX table structure into collection data format.\n *\n * @returns parsed table data\n * @see {@link TableData} for the parsed table data structure\n */\nexport const parseTableChildren = (children: ReactNode): TableData => {\n const columns: TableColumnData[] = [];\n const rows: (TableRowData | ReactElement)[] = [];\n const childrenArray = Children.toArray(children);\n\n for (const child of childrenArray) {\n if (!isValidElement(child)) continue;\n\n // Parse columns from header\n if (isComponentType(child, TableHeaderCompound)) {\n const headerProps = child.props;\n const parsedColumns = parseColumns(\n headerProps.children,\n headerProps.isHidden || false,\n );\n columns.push(...parsedColumns);\n continue;\n }\n\n // Parse rows from body\n if (isComponentType(child, TableBodyCompound)) {\n const bodyProps = child.props;\n const bodyChildren = Children.toArray(bodyProps.children);\n\n for (const rowChild of bodyChildren) {\n if (!isValidElement(rowChild)) continue;\n\n if (isComponentType(rowChild, TableRowCompound)) {\n const rowProps = rowChild.props;\n const cells = parseCells(rowProps.children, columns);\n\n rows.push({\n key: rowChild.key ?? rowProps.key ?? String(rows.length),\n cells,\n onClick: rowProps.onClick,\n dataTestId: rowProps[\"data-testid\"],\n });\n } else {\n rows.push(rowChild);\n }\n }\n }\n }\n\n return {\n columns,\n rows,\n };\n};\n"],"names":["isComponentType","element","componentType","parseColumns","headerChildren","isHeaderHidden","columns","childrenArray","Children","columnChild","isValidElement","TableColumnCompound","columnProps","parseCells","rowChildren","cells","cellIndex","cellChild","TableCellCompound","cellProps","columnKey","_a","parseTableChildren","children","rows","child","TableHeaderCompound","headerProps","parsedColumns","TableBodyCompound","bodyProps","bodyChildren","rowChild","TableRowCompound","rowProps"],"mappings":"kJAsBMA,EAAkB,CACtBC,EACAC,IACYD,EAAQ,OAASC,EAKzBC,EAAe,CACnBC,EACAC,IACsB,CACtB,MAAMC,EAA6B,CAAA,EAC7BC,EAAgBC,EAAAA,SAAS,QAAQJ,CAAc,EAErD,UAAWK,KAAeF,EACxB,GACEG,EAAAA,eAAeD,CAAW,GAC1BT,EAAgBS,EAAaE,EAAmB,mBAAA,EAChD,CACA,MAAMC,EAAcH,EAAY,MAChCH,EAAQ,KAAK,CACX,IAAKM,EAAY,GACjB,OAAQA,EAAY,SACpB,SAAUP,EACV,SAAUO,EAAY,WAAW,CAAA,CAClC,CACH,CAGK,OAAAN,CACT,EAKMO,EAAa,CACjBC,EACAR,IACoB,OACpB,MAAMS,EAAyB,CAAA,EACzBR,EAAgBC,EAAAA,SAAS,QAAQM,CAAW,EAClD,IAAIE,EAAY,EAEhB,UAAWC,KAAaV,EACtB,GACEG,EAAAA,eAAeO,CAAS,GACxBjB,EAAgBiB,EAAWC,EAAiB,iBAAA,EAC5C,CACA,MAAMC,EAAYF,EAAU,MACtBG,EAAYD,EAAU,aAAaE,EAAAf,EAAQU,CAAS,IAAjB,YAAAK,EAAoB,KAEzDD,GACFL,EAAM,KAAK,CACT,UAAAK,EACA,MAAOD,EAAU,SACjB,QAASA,EAAU,QACnB,WAAYA,EAAU,aAAa,CAAA,CACpC,EAEHH,GACF,CAGK,OAAAD,CACT,EAQaO,EAAsBC,GAAmC,CACpE,MAAMjB,EAA6B,CAAA,EAC7BkB,EAAwC,CAAA,EACxCjB,EAAgBC,EAAAA,SAAS,QAAQe,CAAQ,EAE/C,UAAWE,KAASlB,EACd,GAACG,EAAAA,eAAee,CAAK,EAGrB,IAAAzB,EAAgByB,EAAOC,EAAAA,mBAAmB,EAAG,CAC/C,MAAMC,EAAcF,EAAM,MACpBG,EAAgBzB,EACpBwB,EAAY,SACZA,EAAY,UAAY,EAAA,EAElBrB,EAAA,KAAK,GAAGsB,CAAa,EAC7B,QACF,CAGI,GAAA5B,EAAgByB,EAAOI,EAAAA,iBAAiB,EAAG,CAC7C,MAAMC,EAAYL,EAAM,MAClBM,EAAevB,EAAA,SAAS,QAAQsB,EAAU,QAAQ,EAExD,UAAWE,KAAYD,EACjB,GAACrB,EAAAA,eAAesB,CAAQ,EAExB,GAAAhC,EAAgBgC,EAAUC,EAAAA,gBAAgB,EAAG,CAC/C,MAAMC,EAAWF,EAAS,MACpBjB,EAAQF,EAAWqB,EAAS,SAAU5B,CAAO,EAEnDkB,EAAK,KAAK,CACR,IAAKQ,EAAS,KAAOE,EAAS,KAAO,OAAOV,EAAK,MAAM,EACvD,MAAAT,EACA,QAASmB,EAAS,QAClB,WAAYA,EAAS,aAAa,CAAA,CACnC,CAAA,MAEDV,EAAK,KAAKQ,CAAQ,CAGxB,EAGK,MAAA,CACL,QAAA1B,EACA,KAAAkB,CAAA,CAEJ"}
@@ -0,0 +1,67 @@
1
+ import { Children as a, isValidElement as p } from "react";
2
+ import { TableColumnCompound as h, TableCellCompound as m, TableHeaderCompound as f, TableBodyCompound as y, TableRowCompound as C } from "./CompoundComponents.es.js";
3
+ const d = (l, s) => l.type === s, T = (l, s) => {
4
+ const e = [], i = a.toArray(l);
5
+ for (const o of i)
6
+ if (p(o) && d(o, h)) {
7
+ const n = o.props;
8
+ e.push({
9
+ key: n.id,
10
+ header: n.children,
11
+ isHidden: s,
12
+ ariaSort: n["aria-sort"]
13
+ });
14
+ }
15
+ return e;
16
+ }, b = (l, s) => {
17
+ var n;
18
+ const e = [], i = a.toArray(l);
19
+ let o = 0;
20
+ for (const t of i)
21
+ if (p(t) && d(t, m)) {
22
+ const r = t.props, c = r.columnKey ?? ((n = s[o]) == null ? void 0 : n.key);
23
+ c && e.push({
24
+ columnKey: c,
25
+ value: r.children,
26
+ colSpan: r.colSpan,
27
+ dataTestId: r["data-testid"]
28
+ }), o++;
29
+ }
30
+ return e;
31
+ }, P = (l) => {
32
+ const s = [], e = [], i = a.toArray(l);
33
+ for (const o of i)
34
+ if (p(o)) {
35
+ if (d(o, f)) {
36
+ const n = o.props, t = T(
37
+ n.children,
38
+ n.isHidden || !1
39
+ );
40
+ s.push(...t);
41
+ continue;
42
+ }
43
+ if (d(o, y)) {
44
+ const n = o.props, t = a.toArray(n.children);
45
+ for (const r of t)
46
+ if (p(r))
47
+ if (d(r, C)) {
48
+ const c = r.props, u = b(c.children, s);
49
+ e.push({
50
+ key: r.key ?? c.key ?? String(e.length),
51
+ cells: u,
52
+ onClick: c.onClick,
53
+ dataTestId: c["data-testid"]
54
+ });
55
+ } else
56
+ e.push(r);
57
+ }
58
+ }
59
+ return {
60
+ columns: s,
61
+ rows: e
62
+ };
63
+ };
64
+ export {
65
+ P as parseTableChildren
66
+ };
67
+ //# sourceMappingURL=collectionParser.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collectionParser.es.js","sources":["../../../../../src/components/Table/BaseTable/Collection/collectionParser.ts"],"sourcesContent":["import {\n Children,\n isValidElement,\n ReactElement,\n ReactNode,\n ComponentType,\n} from \"react\";\n\nimport {\n TableHeaderCompound,\n TableColumnCompound,\n TableBodyCompound,\n TableRowCompound,\n TableCellCompound,\n} from \"./CompoundComponents\";\nimport type {\n TableColumnData,\n TableData,\n TableRowData,\n TableCellData,\n} from \"../types\";\n\nconst isComponentType = (\n element: ReactElement,\n componentType: ComponentType<any>,\n): boolean => element.type === componentType;\n\n/**\n * Parses columns from Table.Header children\n */\nconst parseColumns = (\n headerChildren: ReactNode,\n isHeaderHidden: boolean,\n): TableColumnData[] => {\n const columns: TableColumnData[] = [];\n const childrenArray = Children.toArray(headerChildren);\n\n for (const columnChild of childrenArray) {\n if (\n isValidElement(columnChild) &&\n isComponentType(columnChild, TableColumnCompound)\n ) {\n const columnProps = columnChild.props;\n columns.push({\n key: columnProps.id,\n header: columnProps.children,\n isHidden: isHeaderHidden,\n ariaSort: columnProps[\"aria-sort\"],\n });\n }\n }\n\n return columns;\n};\n\n/**\n * Parses cells from Table.Row children\n */\nconst parseCells = (\n rowChildren: ReactNode,\n columns: TableColumnData[],\n): TableCellData[] => {\n const cells: TableCellData[] = [];\n const childrenArray = Children.toArray(rowChildren);\n let cellIndex = 0;\n\n for (const cellChild of childrenArray) {\n if (\n isValidElement(cellChild) &&\n isComponentType(cellChild, TableCellCompound)\n ) {\n const cellProps = cellChild.props;\n const columnKey = cellProps.columnKey ?? columns[cellIndex]?.key;\n\n if (columnKey) {\n cells.push({\n columnKey,\n value: cellProps.children,\n colSpan: cellProps.colSpan,\n dataTestId: cellProps[\"data-testid\"],\n });\n }\n cellIndex++;\n }\n }\n\n return cells;\n};\n\n/**\n * Parses JSX table structure into collection data format.\n *\n * @returns parsed table data\n * @see {@link TableData} for the parsed table data structure\n */\nexport const parseTableChildren = (children: ReactNode): TableData => {\n const columns: TableColumnData[] = [];\n const rows: (TableRowData | ReactElement)[] = [];\n const childrenArray = Children.toArray(children);\n\n for (const child of childrenArray) {\n if (!isValidElement(child)) continue;\n\n // Parse columns from header\n if (isComponentType(child, TableHeaderCompound)) {\n const headerProps = child.props;\n const parsedColumns = parseColumns(\n headerProps.children,\n headerProps.isHidden || false,\n );\n columns.push(...parsedColumns);\n continue;\n }\n\n // Parse rows from body\n if (isComponentType(child, TableBodyCompound)) {\n const bodyProps = child.props;\n const bodyChildren = Children.toArray(bodyProps.children);\n\n for (const rowChild of bodyChildren) {\n if (!isValidElement(rowChild)) continue;\n\n if (isComponentType(rowChild, TableRowCompound)) {\n const rowProps = rowChild.props;\n const cells = parseCells(rowProps.children, columns);\n\n rows.push({\n key: rowChild.key ?? rowProps.key ?? String(rows.length),\n cells,\n onClick: rowProps.onClick,\n dataTestId: rowProps[\"data-testid\"],\n });\n } else {\n rows.push(rowChild);\n }\n }\n }\n }\n\n return {\n columns,\n rows,\n };\n};\n"],"names":["isComponentType","element","componentType","parseColumns","headerChildren","isHeaderHidden","columns","childrenArray","Children","columnChild","isValidElement","TableColumnCompound","columnProps","parseCells","rowChildren","cells","cellIndex","cellChild","TableCellCompound","cellProps","columnKey","_a","parseTableChildren","children","rows","child","TableHeaderCompound","headerProps","parsedColumns","TableBodyCompound","bodyProps","bodyChildren","rowChild","TableRowCompound","rowProps"],"mappings":";;AAsBA,MAAMA,IAAkB,CACtBC,GACAC,MACYD,EAAQ,SAASC,GAKzBC,IAAe,CACnBC,GACAC,MACsB;AACtB,QAAMC,IAA6B,CAAA,GAC7BC,IAAgBC,EAAS,QAAQJ,CAAc;AAErD,aAAWK,KAAeF;AACxB,QACEG,EAAeD,CAAW,KAC1BT,EAAgBS,GAAaE,CAAmB,GAChD;AACA,YAAMC,IAAcH,EAAY;AAChC,MAAAH,EAAQ,KAAK;AAAA,QACX,KAAKM,EAAY;AAAA,QACjB,QAAQA,EAAY;AAAA,QACpB,UAAUP;AAAA,QACV,UAAUO,EAAY,WAAW;AAAA,MAAA,CAClC;AAAA,IACH;AAGK,SAAAN;AACT,GAKMO,IAAa,CACjBC,GACAR,MACoB;;AACpB,QAAMS,IAAyB,CAAA,GACzBR,IAAgBC,EAAS,QAAQM,CAAW;AAClD,MAAIE,IAAY;AAEhB,aAAWC,KAAaV;AACtB,QACEG,EAAeO,CAAS,KACxBjB,EAAgBiB,GAAWC,CAAiB,GAC5C;AACA,YAAMC,IAAYF,EAAU,OACtBG,IAAYD,EAAU,eAAaE,IAAAf,EAAQU,CAAS,MAAjB,gBAAAK,EAAoB;AAE7D,MAAID,KACFL,EAAM,KAAK;AAAA,QACT,WAAAK;AAAA,QACA,OAAOD,EAAU;AAAA,QACjB,SAASA,EAAU;AAAA,QACnB,YAAYA,EAAU,aAAa;AAAA,MAAA,CACpC,GAEHH;AAAA,IACF;AAGK,SAAAD;AACT,GAQaO,IAAqB,CAACC,MAAmC;AACpE,QAAMjB,IAA6B,CAAA,GAC7BkB,IAAwC,CAAA,GACxCjB,IAAgBC,EAAS,QAAQe,CAAQ;AAE/C,aAAWE,KAASlB;AACd,QAACG,EAAee,CAAK,GAGrB;AAAA,UAAAzB,EAAgByB,GAAOC,CAAmB,GAAG;AAC/C,cAAMC,IAAcF,EAAM,OACpBG,IAAgBzB;AAAA,UACpBwB,EAAY;AAAA,UACZA,EAAY,YAAY;AAAA,QAAA;AAElB,QAAArB,EAAA,KAAK,GAAGsB,CAAa;AAC7B;AAAA,MACF;AAGI,UAAA5B,EAAgByB,GAAOI,CAAiB,GAAG;AAC7C,cAAMC,IAAYL,EAAM,OAClBM,IAAevB,EAAS,QAAQsB,EAAU,QAAQ;AAExD,mBAAWE,KAAYD;AACjB,cAACrB,EAAesB,CAAQ;AAExB,gBAAAhC,EAAgBgC,GAAUC,CAAgB,GAAG;AAC/C,oBAAMC,IAAWF,EAAS,OACpBjB,IAAQF,EAAWqB,EAAS,UAAU5B,CAAO;AAEnD,cAAAkB,EAAK,KAAK;AAAA,gBACR,KAAKQ,EAAS,OAAOE,EAAS,OAAO,OAAOV,EAAK,MAAM;AAAA,gBACvD,OAAAT;AAAA,gBACA,SAASmB,EAAS;AAAA,gBAClB,YAAYA,EAAS,aAAa;AAAA,cAAA,CACnC;AAAA,YAAA;AAED,cAAAV,EAAK,KAAKQ,CAAQ;AAAA,MAGxB;AAAA;AAGK,SAAA;AAAA,IACL,SAAA1B;AAAA,IACA,MAAAkB;AAAA,EAAA;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),i=(e,l=!1)=>e+(l?1:2),r=e=>e+1,m=e=>!t.isValidElement(e)&&typeof e=="object"&&"cells"in e,w=e=>{var c;const l=e.rows.filter(m),s=e.rows.filter(t.isValidElement),o=((c=e.columns[0])==null?void 0:c.isHidden)||!1,a=(s.length>0?s.length:l.length)+(o?0:1),u=t.useMemo(()=>n=>i(n,o),[o]),d=t.useMemo(()=>n=>r(n),[]);return{columns:e.columns,rows:e.rows,isHeaderHidden:o,getTotalRowCount:a,getRowAriaIndex:u,getColumnAriaIndex:d}};exports.calculateAriaColumnIndex=r;exports.calculateAriaRowIndex=i;exports.useTableCollection=w;
2
+ //# sourceMappingURL=useTableCollection.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableCollection.cjs.js","sources":["../../../../../src/components/Table/BaseTable/Collection/useTableCollection.tsx"],"sourcesContent":["import { useMemo, isValidElement } from \"react\";\nimport type { TableData, TableRowData } from \"../types\";\nimport type { ReactElement } from \"react\";\n\n/*\n * Calculates aria-rowindex from a 0 based `rowIndex` prop.\n */\nexport const calculateAriaRowIndex = (\n rowIndex: number,\n isHeaderHidden: boolean = false,\n): number => rowIndex + (isHeaderHidden ? 1 : 2);\n\n/*\n * Calculates aria-colindex from a 0 based `columnIndex` prop.\n */\nexport const calculateAriaColumnIndex = (columnIndex: number): number =>\n columnIndex + 1;\n\nconst isTableRowData = (\n row: TableRowData | ReactElement,\n): row is TableRowData => {\n return !isValidElement(row) && typeof row === \"object\" && \"cells\" in row;\n};\n\n/**\n * Hook for managing table data structure and providing navigation methods\n */\nexport const useTableCollection = (data: TableData) => {\n const parsedRows = data.rows.filter(isTableRowData);\n const directRows = data.rows.filter(isValidElement);\n\n const isHeaderHidden = data.columns[0]?.isHidden || false;\n const totalRows =\n directRows.length > 0 ? directRows.length : parsedRows.length;\n const getTotalRowCount = totalRows + (isHeaderHidden ? 0 : 1);\n\n const getRowAriaIndex = useMemo(\n () => (rowIndex: number) => calculateAriaRowIndex(rowIndex, isHeaderHidden),\n [isHeaderHidden],\n );\n\n const getColumnAriaIndex = useMemo(\n () => (columnIndex: number) => calculateAriaColumnIndex(columnIndex),\n [],\n );\n\n return {\n // Data\n columns: data.columns,\n rows: data.rows,\n // ARIA helpers\n isHeaderHidden,\n getTotalRowCount,\n getRowAriaIndex,\n getColumnAriaIndex,\n };\n};\n\nexport type TableCollection = ReturnType<typeof useTableCollection>;\n"],"names":["calculateAriaRowIndex","rowIndex","isHeaderHidden","calculateAriaColumnIndex","columnIndex","isTableRowData","row","isValidElement","useTableCollection","data","parsedRows","directRows","_a","getTotalRowCount","getRowAriaIndex","useMemo","getColumnAriaIndex"],"mappings":"yGAOaA,EAAwB,CACnCC,EACAC,EAA0B,KACfD,GAAYC,EAAiB,EAAI,GAKjCC,EAA4BC,GACvCA,EAAc,EAEVC,EACJC,GAEO,CAACC,EAAe,eAAAD,CAAG,GAAK,OAAOA,GAAQ,UAAY,UAAWA,EAM1DE,EAAsBC,GAAoB,OACrD,MAAMC,EAAaD,EAAK,KAAK,OAAOJ,CAAc,EAC5CM,EAAaF,EAAK,KAAK,OAAOF,EAAc,cAAA,EAE5CL,IAAiBU,EAAAH,EAAK,QAAQ,CAAC,IAAd,YAAAG,EAAiB,WAAY,GAG9CC,GADJF,EAAW,OAAS,EAAIA,EAAW,OAASD,EAAW,SACnBR,EAAiB,EAAI,GAErDY,EAAkBC,EAAA,QACtB,IAAOd,GAAqBD,EAAsBC,EAAUC,CAAc,EAC1E,CAACA,CAAc,CAAA,EAGXc,EAAqBD,EAAA,QACzB,IAAOX,GAAwBD,EAAyBC,CAAW,EACnE,CAAC,CAAA,EAGI,MAAA,CAEL,QAASK,EAAK,QACd,KAAMA,EAAK,KAEX,eAAAP,EACA,iBAAAW,EACA,gBAAAC,EACA,mBAAAE,CAAA,CAEJ"}
@@ -0,0 +1,27 @@
1
+ import { isValidElement as r, useMemo as c } from "react";
2
+ const w = (o, t = !1) => o + (t ? 1 : 2), m = (o) => o + 1, d = (o) => !r(o) && typeof o == "object" && "cells" in o, g = (o) => {
3
+ var l;
4
+ const t = o.rows.filter(d), n = o.rows.filter(r), e = ((l = o.columns[0]) == null ? void 0 : l.isHidden) || !1, i = (n.length > 0 ? n.length : t.length) + (e ? 0 : 1), a = c(
5
+ () => (s) => w(s, e),
6
+ [e]
7
+ ), u = c(
8
+ () => (s) => m(s),
9
+ []
10
+ );
11
+ return {
12
+ // Data
13
+ columns: o.columns,
14
+ rows: o.rows,
15
+ // ARIA helpers
16
+ isHeaderHidden: e,
17
+ getTotalRowCount: i,
18
+ getRowAriaIndex: a,
19
+ getColumnAriaIndex: u
20
+ };
21
+ };
22
+ export {
23
+ m as calculateAriaColumnIndex,
24
+ w as calculateAriaRowIndex,
25
+ g as useTableCollection
26
+ };
27
+ //# sourceMappingURL=useTableCollection.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useTableCollection.es.js","sources":["../../../../../src/components/Table/BaseTable/Collection/useTableCollection.tsx"],"sourcesContent":["import { useMemo, isValidElement } from \"react\";\nimport type { TableData, TableRowData } from \"../types\";\nimport type { ReactElement } from \"react\";\n\n/*\n * Calculates aria-rowindex from a 0 based `rowIndex` prop.\n */\nexport const calculateAriaRowIndex = (\n rowIndex: number,\n isHeaderHidden: boolean = false,\n): number => rowIndex + (isHeaderHidden ? 1 : 2);\n\n/*\n * Calculates aria-colindex from a 0 based `columnIndex` prop.\n */\nexport const calculateAriaColumnIndex = (columnIndex: number): number =>\n columnIndex + 1;\n\nconst isTableRowData = (\n row: TableRowData | ReactElement,\n): row is TableRowData => {\n return !isValidElement(row) && typeof row === \"object\" && \"cells\" in row;\n};\n\n/**\n * Hook for managing table data structure and providing navigation methods\n */\nexport const useTableCollection = (data: TableData) => {\n const parsedRows = data.rows.filter(isTableRowData);\n const directRows = data.rows.filter(isValidElement);\n\n const isHeaderHidden = data.columns[0]?.isHidden || false;\n const totalRows =\n directRows.length > 0 ? directRows.length : parsedRows.length;\n const getTotalRowCount = totalRows + (isHeaderHidden ? 0 : 1);\n\n const getRowAriaIndex = useMemo(\n () => (rowIndex: number) => calculateAriaRowIndex(rowIndex, isHeaderHidden),\n [isHeaderHidden],\n );\n\n const getColumnAriaIndex = useMemo(\n () => (columnIndex: number) => calculateAriaColumnIndex(columnIndex),\n [],\n );\n\n return {\n // Data\n columns: data.columns,\n rows: data.rows,\n // ARIA helpers\n isHeaderHidden,\n getTotalRowCount,\n getRowAriaIndex,\n getColumnAriaIndex,\n };\n};\n\nexport type TableCollection = ReturnType<typeof useTableCollection>;\n"],"names":["calculateAriaRowIndex","rowIndex","isHeaderHidden","calculateAriaColumnIndex","columnIndex","isTableRowData","row","isValidElement","useTableCollection","data","parsedRows","directRows","_a","getTotalRowCount","getRowAriaIndex","useMemo","getColumnAriaIndex"],"mappings":";AAOO,MAAMA,IAAwB,CACnCC,GACAC,IAA0B,OACfD,KAAYC,IAAiB,IAAI,IAKjCC,IAA2B,CAACC,MACvCA,IAAc,GAEVC,IAAiB,CACrBC,MAEO,CAACC,EAAeD,CAAG,KAAK,OAAOA,KAAQ,YAAY,WAAWA,GAM1DE,IAAqB,CAACC,MAAoB;;AACrD,QAAMC,IAAaD,EAAK,KAAK,OAAOJ,CAAc,GAC5CM,IAAaF,EAAK,KAAK,OAAOF,CAAc,GAE5CL,MAAiBU,IAAAH,EAAK,QAAQ,CAAC,MAAd,gBAAAG,EAAiB,aAAY,IAG9CC,KADJF,EAAW,SAAS,IAAIA,EAAW,SAASD,EAAW,WACnBR,IAAiB,IAAI,IAErDY,IAAkBC;AAAA,IACtB,MAAM,CAACd,MAAqBD,EAAsBC,GAAUC,CAAc;AAAA,IAC1E,CAACA,CAAc;AAAA,EAAA,GAGXc,IAAqBD;AAAA,IACzB,MAAM,CAACX,MAAwBD,EAAyBC,CAAW;AAAA,IACnE,CAAC;AAAA,EAAA;AAGI,SAAA;AAAA;AAAA,IAEL,SAASK,EAAK;AAAA,IACd,MAAMA,EAAK;AAAA;AAAA,IAEX,gBAAAP;AAAA,IACA,kBAAAW;AAAA,IACA,iBAAAC;AAAA,IACA,oBAAAE;AAAA,EAAA;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../node_modules/react/jsx-runtime.cjs.js"),m=require("react"),x=require("./Collection/collectionParser.cjs.js"),r=require("./Collection/CompoundComponents.cjs.js"),C=require("./Collection/useTableCollection.cjs.js"),p=require("./elements/TableRoot.cjs.js"),R=require("./elements/TableHeader.cjs.js"),j=require("./elements/TableHeaderRow.cjs.js"),q=require("./elements/TableHeaderCell.cjs.js"),y=require("./elements/TableBody.cjs.js"),H=require("./elements/TableRow.cjs.js"),I=require("./elements/TableCell.cjs.js");;/* empty css */const i=({children:d,name:u})=>{const c=x.parseTableChildren(d),e=C.useTableCollection(c);return t.jsxRuntimeExports.jsxs(p.TableRoot,{name:u,rowCount:e.getTotalRowCount,colCount:e.columns.length,children:[t.jsxRuntimeExports.jsx(R.TableHeader,{isHidden:e.isHeaderHidden,children:t.jsxRuntimeExports.jsx(j.TableHeaderRow,{children:e.columns.map((n,l)=>t.jsxRuntimeExports.jsx(q.TableHeaderCell,{colIndex:e.getColumnAriaIndex(l),ariaSort:n.ariaSort,children:n.header},n.key))})}),t.jsxRuntimeExports.jsx(y.TableBody,{children:e.rows.map((n,l)=>{if(m.isValidElement(n))return n;const a=n;return t.jsxRuntimeExports.jsx(H.TableRow,{ariaRowIndex:e.getRowAriaIndex(l),onClick:a.onClick,dataTestId:a.dataTestId,children:e.columns.map((s,T)=>{const o=a.cells.find(b=>b.columnKey===s.key);return t.jsxRuntimeExports.jsx(I.TableCell,{columnIndex:e.getColumnAriaIndex(T),columnSpan:o==null?void 0:o.colSpan,dataTestId:o==null?void 0:o.dataTestId,children:(o==null?void 0:o.value)??""},s.key)})},a.key)})})]})};i.displayName="ProtonUITable";const h=Object.assign(i,{Header:r.TableHeaderCompound,Column:r.TableColumnCompound,Body:r.TableBodyCompound,Row:r.TableRowCompound,Cell:r.TableCellCompound});exports.Table=h;
2
+ //# sourceMappingURL=Table.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.cjs.js","sources":["../../../../src/components/Table/BaseTable/Table.tsx"],"sourcesContent":["import { ReactElement, isValidElement } from \"react\";\nimport { parseTableChildren } from \"./Collection/collectionParser\";\nimport {\n TableHeaderCompound,\n TableColumnCompound,\n TableBodyCompound,\n TableRowCompound,\n TableCellCompound,\n TableHeaderProps as CompoundHeaderProps,\n TableColumnProps as CompoundColumnProps,\n TableBodyProps as CompoundBodyProps,\n TableRowProps as CompoundRowProps,\n TableCellProps as CompoundCellProps,\n} from \"./Collection/CompoundComponents\";\nimport { useTableCollection } from \"./Collection/useTableCollection\";\nimport type {\n TableData,\n TableColumnData,\n TableRowData,\n TableCellData,\n} from \"./types\";\nimport { TableRoot } from \"./elements/TableRoot\";\nimport { TableHeader } from \"./elements/TableHeader\";\nimport { TableHeaderRow } from \"./elements/TableHeaderRow\";\nimport { TableHeaderCell } from \"./elements/TableHeaderCell\";\nimport { TableBody } from \"./elements/TableBody\";\nimport { TableRow } from \"./elements/TableRow\";\nimport { TableCell } from \"./elements/TableCell\";\nimport \"./Table.css\";\n\nexport type { TableColumnData, TableCellData, TableRowData, TableData };\n\nexport interface TableProps {\n children: [\n ReactElement<CompoundHeaderProps>,\n ReactElement<CompoundBodyProps>,\n ];\n /** Table name/caption for accessibility. Provides essential context for screen readers about table content. */\n name: string;\n}\n\nconst TableComponent = ({ children, name }: TableProps) => {\n const tableData: TableData = parseTableChildren(children);\n const collection = useTableCollection(tableData);\n\n return (\n <TableRoot\n name={name}\n rowCount={collection.getTotalRowCount}\n colCount={collection.columns.length}\n >\n {/* Header */}\n <TableHeader isHidden={collection.isHeaderHidden}>\n <TableHeaderRow>\n {collection.columns.map((column, index) => (\n <TableHeaderCell\n key={column.key}\n colIndex={collection.getColumnAriaIndex(index)}\n ariaSort={column.ariaSort}\n >\n {column.header}\n </TableHeaderCell>\n ))}\n </TableHeaderRow>\n </TableHeader>\n\n {/* Body */}\n <TableBody>\n {collection.rows.map((row, rowIndex) => {\n if (isValidElement(row)) return row;\n\n const tableRow = row as TableRowData;\n\n return (\n <TableRow\n key={tableRow.key}\n ariaRowIndex={collection.getRowAriaIndex(rowIndex)}\n onClick={tableRow.onClick}\n dataTestId={tableRow.dataTestId}\n >\n {collection.columns.map((column, colIndex) => {\n const cell = tableRow.cells.find(\n (c) => c.columnKey === column.key,\n );\n\n return (\n <TableCell\n key={column.key}\n columnIndex={collection.getColumnAriaIndex(colIndex)}\n columnSpan={cell?.colSpan}\n dataTestId={cell?.dataTestId}\n >\n {cell?.value ?? \"\"}\n </TableCell>\n );\n })}\n </TableRow>\n );\n })}\n </TableBody>\n </TableRoot>\n );\n};\n\nTableComponent.displayName = \"ProtonUITable\";\n\n/**\n * Base Table component that renders data in rows and columns using collections.\n *\n * ## Features\n * - Built-in keyboard navigation for interactive rows\n * - Full ARIA table semantics with proper roles, labels, and indices\n * - Support for both declarative and custom row rendering\n *\n * @see {@link TableProps} \n * @see {@link CompoundHeaderProps} \n * @see {@link CompoundColumnProps} \n * @see {@link CompoundBodyProps} \n * @see {@link CompoundRowProps} \n * @see {@link CompoundCellProps} \n * @see {@link parseTableChildren} for parser documentation\n *\n * ## Row APIs\n *\n * ### Declarative (Table.Row)\n * Use `Table.Row` with `Table.Cell` for automatic handling of rendering, accessibility, and keyboard navigation.\n *\n * @example\n * ```tsx\n <Table name=\"Employee Directory\">\n <Table.Header>\n <Table.Column id=\"name\">Name</Table.Column>\n </Table.Header>\n <Table.Body>\n <Table.Row key=\"1\">\n <Table.Cell>Joe</Table.Cell>\n </Table.Row>\n </Table.Body>\n </Table>\n * ```\n *\n * ### Imperative (ReactElement)\n * Pass custom components or `<tr>` elements directly to `Table.Body`. Powers advanced use cases like\n * row-level memoization, virtualization, drag-and-drop, or animations.\n *\n * **Consumer Responsibilities for Custom Rows:**\n * - Must directly render a `<tr>` element with `role=\"row\"`\n * - Set `aria-rowindex` (header is 1, data rows start at 2)\n * - Handle keyboard navigation if the row is interactive\n * - Apply styling as needed: `proton-Table__row`, `proton-Table__cell`, etc.\n *\n * @example custom row implementation\n * ```tsx\n const MemoizedRow = memo(({ data, rowIndex }) => (\n <tr\n className=\"proton-Table__row\"\n role=\"row\"\n aria-rowindex={calculateAriaRowIndex(rowIndex)}\n >\n <td className=\"proton-Table__cell\" role=\"cell\">\n {data.name}\n </td>\n </tr>\n ));\n\n <Table.Body>\n {data.map((item, i) => (\n <MemoizedRow key={item.id} data={item} rowIndex={i} />\n ))}\n </Table.Body>\n * ```\n *\n * @example reusable component implementation\n * ```tsx\n const MemoizedRow = memo(({ data, rowIndex }) => (\n <TableRow ariaRowIndex={calculateAriaRowIndex(rowIndex)}>\n <TableCell columnIndex={1}>\n {data.name}\n </TableCell>\n </TableRow>\n ));\n\n <Table.Body>\n {data.map((item, i) => (\n <MemoizedRow key={item.id} data={item} rowIndex={i} />\n ))}\n </Table.Body>\n * ```\n *\n * @see {@link DataTable} for a higher-level component that uses custom rows internally\n * @see {@link DataTableRow} for an example of a memoized custom row implementation\n */\nconst Table = Object.assign(TableComponent, {\n /** Table header: {@link CompoundHeaderProps} */\n Header: TableHeaderCompound,\n /** Table column: {@link CompoundColumnProps} */\n Column: TableColumnCompound,\n /** Table body: {@link CompoundBodyProps} */\n Body: TableBodyCompound,\n /** Table row: {@link CompoundRowProps} */\n Row: TableRowCompound,\n /** Table cell: {@link CompoundCellProps} */\n Cell: TableCellCompound,\n});\n\nexport { Table };\nexport type {\n CompoundHeaderProps as TableHeaderProps,\n CompoundColumnProps as TableColumnProps,\n CompoundBodyProps as TableBodyProps,\n CompoundRowProps as TableRowProps,\n CompoundCellProps as TableCellProps,\n};\n"],"names":["TableComponent","children","name","tableData","parseTableChildren","collection","useTableCollection","jsxs","TableRoot","jsx","TableHeader","TableHeaderRow","column","index","TableHeaderCell","TableBody","row","rowIndex","isValidElement","tableRow","TableRow","colIndex","cell","c","TableCell","Table","TableHeaderCompound","TableColumnCompound","TableBodyCompound","TableRowCompound","TableCellCompound"],"mappings":"woBAyCA,MAAMA,EAAiB,CAAC,CAAE,SAAAC,EAAU,KAAAC,KAAuB,CACnD,MAAAC,EAAuBC,qBAAmBH,CAAQ,EAClDI,EAAaC,qBAAmBH,CAAS,EAG7C,OAAAI,EAAA,kBAAA,KAACC,EAAA,UAAA,CACC,KAAAN,EACA,SAAUG,EAAW,iBACrB,SAAUA,EAAW,QAAQ,OAG7B,SAAA,CAACI,EAAA,kBAAA,IAAAC,EAAA,YAAA,CAAY,SAAUL,EAAW,eAChC,SAAAI,EAAA,kBAAA,IAACE,EACE,eAAA,CAAA,SAAAN,EAAW,QAAQ,IAAI,CAACO,EAAQC,IAC/BJ,EAAA,kBAAA,IAACK,EAAA,gBAAA,CAEC,SAAUT,EAAW,mBAAmBQ,CAAK,EAC7C,SAAUD,EAAO,SAEhB,SAAOA,EAAA,MAAA,EAJHA,EAAO,GAAA,CAMf,EACH,CACF,CAAA,0BAGCG,EAAAA,UACE,CAAA,SAAAV,EAAW,KAAK,IAAI,CAACW,EAAKC,IAAa,CAClC,GAAAC,iBAAeF,CAAG,EAAU,OAAAA,EAEhC,MAAMG,EAAWH,EAGf,OAAAP,EAAA,kBAAA,IAACW,EAAA,SAAA,CAEC,aAAcf,EAAW,gBAAgBY,CAAQ,EACjD,QAASE,EAAS,QAClB,WAAYA,EAAS,WAEpB,SAAWd,EAAA,QAAQ,IAAI,CAACO,EAAQS,IAAa,CACtC,MAAAC,EAAOH,EAAS,MAAM,KACzBI,GAAMA,EAAE,YAAcX,EAAO,GAAA,EAI9B,OAAAH,EAAA,kBAAA,IAACe,EAAA,UAAA,CAEC,YAAanB,EAAW,mBAAmBgB,CAAQ,EACnD,WAAYC,GAAA,YAAAA,EAAM,QAClB,WAAYA,GAAA,YAAAA,EAAM,WAEjB,2BAAM,QAAS,EAAA,EALXV,EAAO,GAAA,CAMd,CAEH,CAAA,EApBIO,EAAS,GAAA,CAuBnB,CAAA,EACH,CAAA,CAAA,CAAA,CAGN,EAEAnB,EAAe,YAAc,gBAwFvB,MAAAyB,EAAQ,OAAO,OAAOzB,EAAgB,CAE1C,OAAQ0B,EAAA,oBAER,OAAQC,EAAA,oBAER,KAAMC,EAAA,kBAEN,IAAKC,EAAA,iBAEL,KAAMC,EAAA,iBACR,CAAC"}
@@ -0,0 +1,80 @@
1
+ import { j as a } from "../../../node_modules/react/jsx-runtime.es.js";
2
+ import { isValidElement as T } from "react";
3
+ import { parseTableChildren as c } from "./Collection/collectionParser.es.js";
4
+ import { TableHeaderCompound as C, TableColumnCompound as b, TableBodyCompound as x, TableRowCompound as f, TableCellCompound as I } from "./Collection/CompoundComponents.es.js";
5
+ import { useTableCollection as h } from "./Collection/useTableCollection.es.js";
6
+ import { TableRoot as j } from "./elements/TableRoot.es.js";
7
+ import { TableHeader as R } from "./elements/TableHeader.es.js";
8
+ import { TableHeaderRow as y } from "./elements/TableHeaderRow.es.js";
9
+ import { TableHeaderCell as w } from "./elements/TableHeaderCell.es.js";
10
+ import { TableBody as H } from "./elements/TableBody.es.js";
11
+ import { TableRow as g } from "./elements/TableRow.es.js";
12
+ import { TableCell as k } from "./elements/TableCell.es.js";
13
+ /* empty css */
14
+ const d = ({ children: m, name: i }) => {
15
+ const s = c(m), o = h(s);
16
+ return /* @__PURE__ */ a.jsxs(
17
+ j,
18
+ {
19
+ name: i,
20
+ rowCount: o.getTotalRowCount,
21
+ colCount: o.columns.length,
22
+ children: [
23
+ /* @__PURE__ */ a.jsx(R, { isHidden: o.isHeaderHidden, children: /* @__PURE__ */ a.jsx(y, { children: o.columns.map((r, t) => /* @__PURE__ */ a.jsx(
24
+ w,
25
+ {
26
+ colIndex: o.getColumnAriaIndex(t),
27
+ ariaSort: r.ariaSort,
28
+ children: r.header
29
+ },
30
+ r.key
31
+ )) }) }),
32
+ /* @__PURE__ */ a.jsx(H, { children: o.rows.map((r, t) => {
33
+ if (T(r)) return r;
34
+ const n = r;
35
+ return /* @__PURE__ */ a.jsx(
36
+ g,
37
+ {
38
+ ariaRowIndex: o.getRowAriaIndex(t),
39
+ onClick: n.onClick,
40
+ dataTestId: n.dataTestId,
41
+ children: o.columns.map((l, p) => {
42
+ const e = n.cells.find(
43
+ (u) => u.columnKey === l.key
44
+ );
45
+ return /* @__PURE__ */ a.jsx(
46
+ k,
47
+ {
48
+ columnIndex: o.getColumnAriaIndex(p),
49
+ columnSpan: e == null ? void 0 : e.colSpan,
50
+ dataTestId: e == null ? void 0 : e.dataTestId,
51
+ children: (e == null ? void 0 : e.value) ?? ""
52
+ },
53
+ l.key
54
+ );
55
+ })
56
+ },
57
+ n.key
58
+ );
59
+ }) })
60
+ ]
61
+ }
62
+ );
63
+ };
64
+ d.displayName = "ProtonUITable";
65
+ const z = Object.assign(d, {
66
+ /** Table header: {@link CompoundHeaderProps} */
67
+ Header: C,
68
+ /** Table column: {@link CompoundColumnProps} */
69
+ Column: b,
70
+ /** Table body: {@link CompoundBodyProps} */
71
+ Body: x,
72
+ /** Table row: {@link CompoundRowProps} */
73
+ Row: f,
74
+ /** Table cell: {@link CompoundCellProps} */
75
+ Cell: I
76
+ });
77
+ export {
78
+ z as Table
79
+ };
80
+ //# sourceMappingURL=Table.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Table.es.js","sources":["../../../../src/components/Table/BaseTable/Table.tsx"],"sourcesContent":["import { ReactElement, isValidElement } from \"react\";\nimport { parseTableChildren } from \"./Collection/collectionParser\";\nimport {\n TableHeaderCompound,\n TableColumnCompound,\n TableBodyCompound,\n TableRowCompound,\n TableCellCompound,\n TableHeaderProps as CompoundHeaderProps,\n TableColumnProps as CompoundColumnProps,\n TableBodyProps as CompoundBodyProps,\n TableRowProps as CompoundRowProps,\n TableCellProps as CompoundCellProps,\n} from \"./Collection/CompoundComponents\";\nimport { useTableCollection } from \"./Collection/useTableCollection\";\nimport type {\n TableData,\n TableColumnData,\n TableRowData,\n TableCellData,\n} from \"./types\";\nimport { TableRoot } from \"./elements/TableRoot\";\nimport { TableHeader } from \"./elements/TableHeader\";\nimport { TableHeaderRow } from \"./elements/TableHeaderRow\";\nimport { TableHeaderCell } from \"./elements/TableHeaderCell\";\nimport { TableBody } from \"./elements/TableBody\";\nimport { TableRow } from \"./elements/TableRow\";\nimport { TableCell } from \"./elements/TableCell\";\nimport \"./Table.css\";\n\nexport type { TableColumnData, TableCellData, TableRowData, TableData };\n\nexport interface TableProps {\n children: [\n ReactElement<CompoundHeaderProps>,\n ReactElement<CompoundBodyProps>,\n ];\n /** Table name/caption for accessibility. Provides essential context for screen readers about table content. */\n name: string;\n}\n\nconst TableComponent = ({ children, name }: TableProps) => {\n const tableData: TableData = parseTableChildren(children);\n const collection = useTableCollection(tableData);\n\n return (\n <TableRoot\n name={name}\n rowCount={collection.getTotalRowCount}\n colCount={collection.columns.length}\n >\n {/* Header */}\n <TableHeader isHidden={collection.isHeaderHidden}>\n <TableHeaderRow>\n {collection.columns.map((column, index) => (\n <TableHeaderCell\n key={column.key}\n colIndex={collection.getColumnAriaIndex(index)}\n ariaSort={column.ariaSort}\n >\n {column.header}\n </TableHeaderCell>\n ))}\n </TableHeaderRow>\n </TableHeader>\n\n {/* Body */}\n <TableBody>\n {collection.rows.map((row, rowIndex) => {\n if (isValidElement(row)) return row;\n\n const tableRow = row as TableRowData;\n\n return (\n <TableRow\n key={tableRow.key}\n ariaRowIndex={collection.getRowAriaIndex(rowIndex)}\n onClick={tableRow.onClick}\n dataTestId={tableRow.dataTestId}\n >\n {collection.columns.map((column, colIndex) => {\n const cell = tableRow.cells.find(\n (c) => c.columnKey === column.key,\n );\n\n return (\n <TableCell\n key={column.key}\n columnIndex={collection.getColumnAriaIndex(colIndex)}\n columnSpan={cell?.colSpan}\n dataTestId={cell?.dataTestId}\n >\n {cell?.value ?? \"\"}\n </TableCell>\n );\n })}\n </TableRow>\n );\n })}\n </TableBody>\n </TableRoot>\n );\n};\n\nTableComponent.displayName = \"ProtonUITable\";\n\n/**\n * Base Table component that renders data in rows and columns using collections.\n *\n * ## Features\n * - Built-in keyboard navigation for interactive rows\n * - Full ARIA table semantics with proper roles, labels, and indices\n * - Support for both declarative and custom row rendering\n *\n * @see {@link TableProps} \n * @see {@link CompoundHeaderProps} \n * @see {@link CompoundColumnProps} \n * @see {@link CompoundBodyProps} \n * @see {@link CompoundRowProps} \n * @see {@link CompoundCellProps} \n * @see {@link parseTableChildren} for parser documentation\n *\n * ## Row APIs\n *\n * ### Declarative (Table.Row)\n * Use `Table.Row` with `Table.Cell` for automatic handling of rendering, accessibility, and keyboard navigation.\n *\n * @example\n * ```tsx\n <Table name=\"Employee Directory\">\n <Table.Header>\n <Table.Column id=\"name\">Name</Table.Column>\n </Table.Header>\n <Table.Body>\n <Table.Row key=\"1\">\n <Table.Cell>Joe</Table.Cell>\n </Table.Row>\n </Table.Body>\n </Table>\n * ```\n *\n * ### Imperative (ReactElement)\n * Pass custom components or `<tr>` elements directly to `Table.Body`. Powers advanced use cases like\n * row-level memoization, virtualization, drag-and-drop, or animations.\n *\n * **Consumer Responsibilities for Custom Rows:**\n * - Must directly render a `<tr>` element with `role=\"row\"`\n * - Set `aria-rowindex` (header is 1, data rows start at 2)\n * - Handle keyboard navigation if the row is interactive\n * - Apply styling as needed: `proton-Table__row`, `proton-Table__cell`, etc.\n *\n * @example custom row implementation\n * ```tsx\n const MemoizedRow = memo(({ data, rowIndex }) => (\n <tr\n className=\"proton-Table__row\"\n role=\"row\"\n aria-rowindex={calculateAriaRowIndex(rowIndex)}\n >\n <td className=\"proton-Table__cell\" role=\"cell\">\n {data.name}\n </td>\n </tr>\n ));\n\n <Table.Body>\n {data.map((item, i) => (\n <MemoizedRow key={item.id} data={item} rowIndex={i} />\n ))}\n </Table.Body>\n * ```\n *\n * @example reusable component implementation\n * ```tsx\n const MemoizedRow = memo(({ data, rowIndex }) => (\n <TableRow ariaRowIndex={calculateAriaRowIndex(rowIndex)}>\n <TableCell columnIndex={1}>\n {data.name}\n </TableCell>\n </TableRow>\n ));\n\n <Table.Body>\n {data.map((item, i) => (\n <MemoizedRow key={item.id} data={item} rowIndex={i} />\n ))}\n </Table.Body>\n * ```\n *\n * @see {@link DataTable} for a higher-level component that uses custom rows internally\n * @see {@link DataTableRow} for an example of a memoized custom row implementation\n */\nconst Table = Object.assign(TableComponent, {\n /** Table header: {@link CompoundHeaderProps} */\n Header: TableHeaderCompound,\n /** Table column: {@link CompoundColumnProps} */\n Column: TableColumnCompound,\n /** Table body: {@link CompoundBodyProps} */\n Body: TableBodyCompound,\n /** Table row: {@link CompoundRowProps} */\n Row: TableRowCompound,\n /** Table cell: {@link CompoundCellProps} */\n Cell: TableCellCompound,\n});\n\nexport { Table };\nexport type {\n CompoundHeaderProps as TableHeaderProps,\n CompoundColumnProps as TableColumnProps,\n CompoundBodyProps as TableBodyProps,\n CompoundRowProps as TableRowProps,\n CompoundCellProps as TableCellProps,\n};\n"],"names":["TableComponent","children","name","tableData","parseTableChildren","collection","useTableCollection","jsxs","TableRoot","jsx","TableHeader","TableHeaderRow","column","index","TableHeaderCell","TableBody","row","rowIndex","isValidElement","tableRow","TableRow","colIndex","cell","c","TableCell","Table","TableHeaderCompound","TableColumnCompound","TableBodyCompound","TableRowCompound","TableCellCompound"],"mappings":";;;;;;;;;;;;;AAyCA,MAAMA,IAAiB,CAAC,EAAE,UAAAC,GAAU,MAAAC,QAAuB;AACnD,QAAAC,IAAuBC,EAAmBH,CAAQ,GAClDI,IAAaC,EAAmBH,CAAS;AAG7C,SAAAI,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAAN;AAAA,MACA,UAAUG,EAAW;AAAA,MACrB,UAAUA,EAAW,QAAQ;AAAA,MAG7B,UAAA;AAAA,QAACI,gBAAAA,EAAA,IAAAC,GAAA,EAAY,UAAUL,EAAW,gBAChC,UAAAI,gBAAAA,EAAA,IAACE,GACE,EAAA,UAAAN,EAAW,QAAQ,IAAI,CAACO,GAAQC,MAC/BJ,gBAAAA,EAAA;AAAA,UAACK;AAAA,UAAA;AAAA,YAEC,UAAUT,EAAW,mBAAmBQ,CAAK;AAAA,YAC7C,UAAUD,EAAO;AAAA,YAEhB,UAAOA,EAAA;AAAA,UAAA;AAAA,UAJHA,EAAO;AAAA,QAAA,CAMf,GACH,EACF,CAAA;AAAA,8BAGCG,GACE,EAAA,UAAAV,EAAW,KAAK,IAAI,CAACW,GAAKC,MAAa;AAClC,cAAAC,EAAeF,CAAG,EAAU,QAAAA;AAEhC,gBAAMG,IAAWH;AAGf,iBAAAP,gBAAAA,EAAA;AAAA,YAACW;AAAA,YAAA;AAAA,cAEC,cAAcf,EAAW,gBAAgBY,CAAQ;AAAA,cACjD,SAASE,EAAS;AAAA,cAClB,YAAYA,EAAS;AAAA,cAEpB,UAAWd,EAAA,QAAQ,IAAI,CAACO,GAAQS,MAAa;AACtC,sBAAAC,IAAOH,EAAS,MAAM;AAAA,kBAC1B,CAACI,MAAMA,EAAE,cAAcX,EAAO;AAAA,gBAAA;AAI9B,uBAAAH,gBAAAA,EAAA;AAAA,kBAACe;AAAA,kBAAA;AAAA,oBAEC,aAAanB,EAAW,mBAAmBgB,CAAQ;AAAA,oBACnD,YAAYC,KAAA,gBAAAA,EAAM;AAAA,oBAClB,YAAYA,KAAA,gBAAAA,EAAM;AAAA,oBAEjB,kCAAM,UAAS;AAAA,kBAAA;AAAA,kBALXV,EAAO;AAAA,gBAAA;AAAA,cAMd,CAEH;AAAA,YAAA;AAAA,YApBIO,EAAS;AAAA,UAAA;AAAA,QAuBnB,CAAA,GACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;AAEAnB,EAAe,cAAc;AAwFvB,MAAAyB,IAAQ,OAAO,OAAOzB,GAAgB;AAAA;AAAA,EAE1C,QAAQ0B;AAAA;AAAA,EAER,QAAQC;AAAA;AAAA,EAER,MAAMC;AAAA;AAAA,EAEN,KAAKC;AAAA;AAAA,EAEL,MAAMC;AACR,CAAC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../../node_modules/react/jsx-runtime.cjs.js"),e=({children:o})=>t.jsxRuntimeExports.jsx("tbody",{className:"proton-Table__body",role:"rowgroup",children:o});e.displayName="ProtonUITableBody";exports.TableBody=e;
2
+ //# sourceMappingURL=TableBody.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableBody.cjs.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableBody.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nexport interface TableBodyProps {\n /** Table row content */\n children: ReactNode;\n}\n\n/**\n * Table body element (`<tbody>`) with styling and ARIA attributes.\n *\n * @see {@link TableBodyProps}\n */\nexport const TableBody = ({ children }: TableBodyProps) => {\n return (\n <tbody className=\"proton-Table__body\" role=\"rowgroup\">\n {children}\n </tbody>\n );\n};\n\nTableBody.displayName = \"ProtonUITableBody\";\n"],"names":["TableBody","children"],"mappings":"qJAYaA,EAAY,CAAC,CAAE,SAAAC,6BAEvB,QAAM,CAAA,UAAU,qBAAqB,KAAK,WACxC,SAAAA,CACH,CAAA,EAIJD,EAAU,YAAc"}
@@ -0,0 +1,7 @@
1
+ import { j as r } from "../../../../node_modules/react/jsx-runtime.es.js";
2
+ const e = ({ children: o }) => /* @__PURE__ */ r.jsx("tbody", { className: "proton-Table__body", role: "rowgroup", children: o });
3
+ e.displayName = "ProtonUITableBody";
4
+ export {
5
+ e as TableBody
6
+ };
7
+ //# sourceMappingURL=TableBody.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableBody.es.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableBody.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nexport interface TableBodyProps {\n /** Table row content */\n children: ReactNode;\n}\n\n/**\n * Table body element (`<tbody>`) with styling and ARIA attributes.\n *\n * @see {@link TableBodyProps}\n */\nexport const TableBody = ({ children }: TableBodyProps) => {\n return (\n <tbody className=\"proton-Table__body\" role=\"rowgroup\">\n {children}\n </tbody>\n );\n};\n\nTableBody.displayName = \"ProtonUITableBody\";\n"],"names":["TableBody","children"],"mappings":";AAYO,MAAMA,IAAY,CAAC,EAAE,UAAAC,8BAEvB,SAAM,EAAA,WAAU,sBAAqB,MAAK,YACxC,UAAAA,EACH,CAAA;AAIJD,EAAU,cAAc;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../../../node_modules/react/jsx-runtime.cjs.js"),e=({columnIndex:l,children:t,columnSpan:a,dataTestId:o})=>r.jsxRuntimeExports.jsx("td",{className:"proton-Table__cell",role:"cell","aria-colindex":l,colSpan:a,"data-testid":o,children:t});e.displayName="ProtonUITableCell";exports.TableCell=e;
2
+ //# sourceMappingURL=TableCell.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableCell.cjs.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableCell.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nexport interface TableCellProps {\n /** 1-based column index for aria-colindex */\n columnIndex: number;\n /** Cell content */\n children: ReactNode;\n /** Number of columns this cell spans */\n columnSpan?: number;\n /** Test ID for testing purposes */\n dataTestId?: string;\n}\n\n/**\n * Table cell element (`<td>`) with styling and ARIA attributes.\n *\n * @see {@link TableCellProps}\n */\nexport const TableCell = ({\n columnIndex,\n children,\n columnSpan,\n dataTestId,\n}: TableCellProps) => {\n return (\n <td\n className=\"proton-Table__cell\"\n role=\"cell\"\n aria-colindex={columnIndex}\n colSpan={columnSpan}\n data-testid={dataTestId}\n >\n {children}\n </td>\n );\n};\n\nTableCell.displayName = \"ProtonUITableCell\";\n"],"names":["TableCell","columnIndex","children","columnSpan","dataTestId","jsx"],"mappings":"qJAkBaA,EAAY,CAAC,CACxB,YAAAC,EACA,SAAAC,EACA,WAAAC,EACA,WAAAC,CACF,IAEIC,EAAA,kBAAA,IAAC,KAAA,CACC,UAAU,qBACV,KAAK,OACL,gBAAeJ,EACf,QAASE,EACT,cAAaC,EAEZ,SAAAF,CAAA,CAAA,EAKPF,EAAU,YAAc"}
@@ -0,0 +1,22 @@
1
+ import { j as t } from "../../../../node_modules/react/jsx-runtime.es.js";
2
+ const r = ({
3
+ columnIndex: l,
4
+ children: e,
5
+ columnSpan: a,
6
+ dataTestId: o
7
+ }) => /* @__PURE__ */ t.jsx(
8
+ "td",
9
+ {
10
+ className: "proton-Table__cell",
11
+ role: "cell",
12
+ "aria-colindex": l,
13
+ colSpan: a,
14
+ "data-testid": o,
15
+ children: e
16
+ }
17
+ );
18
+ r.displayName = "ProtonUITableCell";
19
+ export {
20
+ r as TableCell
21
+ };
22
+ //# sourceMappingURL=TableCell.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableCell.es.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableCell.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nexport interface TableCellProps {\n /** 1-based column index for aria-colindex */\n columnIndex: number;\n /** Cell content */\n children: ReactNode;\n /** Number of columns this cell spans */\n columnSpan?: number;\n /** Test ID for testing purposes */\n dataTestId?: string;\n}\n\n/**\n * Table cell element (`<td>`) with styling and ARIA attributes.\n *\n * @see {@link TableCellProps}\n */\nexport const TableCell = ({\n columnIndex,\n children,\n columnSpan,\n dataTestId,\n}: TableCellProps) => {\n return (\n <td\n className=\"proton-Table__cell\"\n role=\"cell\"\n aria-colindex={columnIndex}\n colSpan={columnSpan}\n data-testid={dataTestId}\n >\n {children}\n </td>\n );\n};\n\nTableCell.displayName = \"ProtonUITableCell\";\n"],"names":["TableCell","columnIndex","children","columnSpan","dataTestId","jsx"],"mappings":";AAkBO,MAAMA,IAAY,CAAC;AAAA,EACxB,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,YAAAC;AACF,MAEIC,gBAAAA,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,iBAAeJ;AAAA,IACf,SAASE;AAAA,IACT,eAAaC;AAAA,IAEZ,UAAAF;AAAA,EAAA;AAAA;AAKPF,EAAU,cAAc;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../../node_modules/react/jsx-runtime.cjs.js"),e=({children:r,isHidden:o})=>a.jsxRuntimeExports.jsx("thead",{className:"proton-Table__rowGroup--header",role:"rowgroup",style:o?{display:"none"}:void 0,children:r});e.displayName="ProtonUITableHeader";exports.TableHeader=e;
2
+ //# sourceMappingURL=TableHeader.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableHeader.cjs.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableHeader.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nexport interface TableHeaderProps {\n /** Header row content (TableHeaderCell elements) */\n children: ReactNode;\n /** Whether the header should be visually hidden */\n isHidden?: boolean;\n}\n\n/**\n * Table header row group element (`<thead>`) with styling and ARIA attributes.\n *\n * @see {@link TableHeaderProps}\n */\nexport const TableHeader = ({ children, isHidden }: TableHeaderProps) => {\n return (\n <thead\n className=\"proton-Table__rowGroup--header\"\n role=\"rowgroup\"\n style={isHidden ? { display: \"none\" } : undefined}\n >\n {children}\n </thead>\n );\n};\n\nTableHeader.displayName = \"ProtonUITableHeader\";\n"],"names":["TableHeader","children","isHidden","jsx"],"mappings":"qJAcaA,EAAc,CAAC,CAAE,SAAAC,EAAU,SAAAC,KAEpCC,EAAA,kBAAA,IAAC,QAAA,CACC,UAAU,iCACV,KAAK,WACL,MAAOD,EAAW,CAAE,QAAS,QAAW,OAEvC,SAAAD,CAAA,CAAA,EAKPD,EAAY,YAAc"}
@@ -0,0 +1,15 @@
1
+ import { j as r } from "../../../../node_modules/react/jsx-runtime.es.js";
2
+ const a = ({ children: e, isHidden: o }) => /* @__PURE__ */ r.jsx(
3
+ "thead",
4
+ {
5
+ className: "proton-Table__rowGroup--header",
6
+ role: "rowgroup",
7
+ style: o ? { display: "none" } : void 0,
8
+ children: e
9
+ }
10
+ );
11
+ a.displayName = "ProtonUITableHeader";
12
+ export {
13
+ a as TableHeader
14
+ };
15
+ //# sourceMappingURL=TableHeader.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableHeader.es.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableHeader.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nexport interface TableHeaderProps {\n /** Header row content (TableHeaderCell elements) */\n children: ReactNode;\n /** Whether the header should be visually hidden */\n isHidden?: boolean;\n}\n\n/**\n * Table header row group element (`<thead>`) with styling and ARIA attributes.\n *\n * @see {@link TableHeaderProps}\n */\nexport const TableHeader = ({ children, isHidden }: TableHeaderProps) => {\n return (\n <thead\n className=\"proton-Table__rowGroup--header\"\n role=\"rowgroup\"\n style={isHidden ? { display: \"none\" } : undefined}\n >\n {children}\n </thead>\n );\n};\n\nTableHeader.displayName = \"ProtonUITableHeader\";\n"],"names":["TableHeader","children","isHidden","jsx"],"mappings":";AAcO,MAAMA,IAAc,CAAC,EAAE,UAAAC,GAAU,UAAAC,QAEpCC,gBAAAA,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,OAAOD,IAAW,EAAE,SAAS,WAAW;AAAA,IAEvC,UAAAD;AAAA,EAAA;AAAA;AAKPD,EAAY,cAAc;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../../../node_modules/react/jsx-runtime.cjs.js"),e=({children:a,colIndex:t,ariaSort:r,"data-testid":l})=>o.jsxRuntimeExports.jsx("th",{className:"proton-Table__header",role:"columnheader",scope:"col","aria-colindex":t,"aria-sort":r,"data-testid":l,children:a});e.displayName="ProtonUITableHeaderCell";exports.TableHeaderCell=e;
2
+ //# sourceMappingURL=TableHeaderCell.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableHeaderCell.cjs.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableHeaderCell.tsx"],"sourcesContent":["import { AriaAttributes, ReactNode } from \"react\";\n\nexport interface TableHeaderCellProps {\n /** Header cell content */\n children: ReactNode;\n /** 1-based column index for aria-colindex */\n colIndex: number;\n /** Sort state for sortable columns */\n ariaSort?: AriaAttributes[\"aria-sort\"];\n /** Test ID for testing purposes */\n \"data-testid\"?: string;\n}\n\n/**\n * Table header cell element (`<th>`) with styling and ARIA attributes.\n *\n * @see {@link TableHeaderCellProps}\n */\nexport const TableHeaderCell = ({\n children,\n colIndex,\n ariaSort,\n \"data-testid\": testId,\n}: TableHeaderCellProps) => {\n return (\n <th\n className=\"proton-Table__header\"\n role=\"columnheader\"\n scope=\"col\"\n aria-colindex={colIndex}\n aria-sort={ariaSort}\n data-testid={testId}\n >\n {children}\n </th>\n );\n};\n\nTableHeaderCell.displayName = \"ProtonUITableHeaderCell\";\n"],"names":["TableHeaderCell","children","colIndex","ariaSort","testId","jsx"],"mappings":"qJAkBaA,EAAkB,CAAC,CAC9B,SAAAC,EACA,SAAAC,EACA,SAAAC,EACA,cAAeC,CACjB,IAEIC,EAAA,kBAAA,IAAC,KAAA,CACC,UAAU,uBACV,KAAK,eACL,MAAM,MACN,gBAAeH,EACf,YAAWC,EACX,cAAaC,EAEZ,SAAAH,CAAA,CAAA,EAKPD,EAAgB,YAAc"}
@@ -0,0 +1,23 @@
1
+ import { j as o } from "../../../../node_modules/react/jsx-runtime.es.js";
2
+ const l = ({
3
+ children: e,
4
+ colIndex: a,
5
+ ariaSort: r,
6
+ "data-testid": t
7
+ }) => /* @__PURE__ */ o.jsx(
8
+ "th",
9
+ {
10
+ className: "proton-Table__header",
11
+ role: "columnheader",
12
+ scope: "col",
13
+ "aria-colindex": a,
14
+ "aria-sort": r,
15
+ "data-testid": t,
16
+ children: e
17
+ }
18
+ );
19
+ l.displayName = "ProtonUITableHeaderCell";
20
+ export {
21
+ l as TableHeaderCell
22
+ };
23
+ //# sourceMappingURL=TableHeaderCell.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableHeaderCell.es.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableHeaderCell.tsx"],"sourcesContent":["import { AriaAttributes, ReactNode } from \"react\";\n\nexport interface TableHeaderCellProps {\n /** Header cell content */\n children: ReactNode;\n /** 1-based column index for aria-colindex */\n colIndex: number;\n /** Sort state for sortable columns */\n ariaSort?: AriaAttributes[\"aria-sort\"];\n /** Test ID for testing purposes */\n \"data-testid\"?: string;\n}\n\n/**\n * Table header cell element (`<th>`) with styling and ARIA attributes.\n *\n * @see {@link TableHeaderCellProps}\n */\nexport const TableHeaderCell = ({\n children,\n colIndex,\n ariaSort,\n \"data-testid\": testId,\n}: TableHeaderCellProps) => {\n return (\n <th\n className=\"proton-Table__header\"\n role=\"columnheader\"\n scope=\"col\"\n aria-colindex={colIndex}\n aria-sort={ariaSort}\n data-testid={testId}\n >\n {children}\n </th>\n );\n};\n\nTableHeaderCell.displayName = \"ProtonUITableHeaderCell\";\n"],"names":["TableHeaderCell","children","colIndex","ariaSort","testId","jsx"],"mappings":";AAkBO,MAAMA,IAAkB,CAAC;AAAA,EAC9B,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAeC;AACjB,MAEIC,gBAAAA,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,OAAM;AAAA,IACN,iBAAeH;AAAA,IACf,aAAWC;AAAA,IACX,eAAaC;AAAA,IAEZ,UAAAH;AAAA,EAAA;AAAA;AAKPD,EAAgB,cAAc;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../../../../node_modules/react/jsx-runtime.cjs.js"),e=({children:r,ariaRowIndex:o=1})=>a.jsxRuntimeExports.jsx("tr",{className:"proton-Table__header-row",role:"row","aria-rowindex":o,children:r});e.displayName="ProtonUITableHeaderRow";exports.TableHeaderRow=e;
2
+ //# sourceMappingURL=TableHeaderRow.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableHeaderRow.cjs.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableHeaderRow.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nexport interface TableHeaderRowProps {\n /** Header cell content (TableHeaderCell elements) */\n children: ReactNode;\n /** 1-based aria-rowindex (typically 1 for header row) */\n ariaRowIndex?: number;\n}\n\n/**\n * Table header row element (`<tr>` inside `<thead>`) with styling and ARIA attributes.\n *\n * @see {@link TableHeaderRowProps}\n */\nexport const TableHeaderRow = ({\n children,\n ariaRowIndex = 1,\n}: TableHeaderRowProps) => {\n return (\n <tr\n className=\"proton-Table__header-row\"\n role=\"row\"\n aria-rowindex={ariaRowIndex}\n >\n {children}\n </tr>\n );\n};\n\nTableHeaderRow.displayName = \"ProtonUITableHeaderRow\";\n"],"names":["TableHeaderRow","children","ariaRowIndex","jsx"],"mappings":"qJAcaA,EAAiB,CAAC,CAC7B,SAAAC,EACA,aAAAC,EAAe,CACjB,IAEIC,EAAA,kBAAA,IAAC,KAAA,CACC,UAAU,2BACV,KAAK,MACL,gBAAeD,EAEd,SAAAD,CAAA,CAAA,EAKPD,EAAe,YAAc"}
@@ -0,0 +1,18 @@
1
+ import { j as o } from "../../../../node_modules/react/jsx-runtime.es.js";
2
+ const a = ({
3
+ children: r,
4
+ ariaRowIndex: e = 1
5
+ }) => /* @__PURE__ */ o.jsx(
6
+ "tr",
7
+ {
8
+ className: "proton-Table__header-row",
9
+ role: "row",
10
+ "aria-rowindex": e,
11
+ children: r
12
+ }
13
+ );
14
+ a.displayName = "ProtonUITableHeaderRow";
15
+ export {
16
+ a as TableHeaderRow
17
+ };
18
+ //# sourceMappingURL=TableHeaderRow.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableHeaderRow.es.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableHeaderRow.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nexport interface TableHeaderRowProps {\n /** Header cell content (TableHeaderCell elements) */\n children: ReactNode;\n /** 1-based aria-rowindex (typically 1 for header row) */\n ariaRowIndex?: number;\n}\n\n/**\n * Table header row element (`<tr>` inside `<thead>`) with styling and ARIA attributes.\n *\n * @see {@link TableHeaderRowProps}\n */\nexport const TableHeaderRow = ({\n children,\n ariaRowIndex = 1,\n}: TableHeaderRowProps) => {\n return (\n <tr\n className=\"proton-Table__header-row\"\n role=\"row\"\n aria-rowindex={ariaRowIndex}\n >\n {children}\n </tr>\n );\n};\n\nTableHeaderRow.displayName = \"ProtonUITableHeaderRow\";\n"],"names":["TableHeaderRow","children","ariaRowIndex","jsx"],"mappings":";AAcO,MAAMA,IAAiB,CAAC;AAAA,EAC7B,UAAAC;AAAA,EACA,cAAAC,IAAe;AACjB,MAEIC,gBAAAA,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,iBAAeD;AAAA,IAEd,UAAAD;AAAA,EAAA;AAAA;AAKPD,EAAe,cAAc;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../../../node_modules/react/jsx-runtime.cjs.js"),a=({children:o,name:t,rowCount:r,colCount:l,"data-testid":s})=>e.jsxRuntimeExports.jsxs("table",{className:"proton-Table",role:"table","aria-rowcount":r,"aria-colcount":l,"aria-label":t,"data-testid":s,children:[e.jsxRuntimeExports.jsx("caption",{className:"proton-Table__caption",children:t}),o]});a.displayName="ProtonUITableRoot";exports.TableRoot=a;
2
+ //# sourceMappingURL=TableRoot.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableRoot.cjs.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableRoot.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nexport interface TableRootProps {\n /** Table content (thead, tbody) */\n children: ReactNode;\n /** Table name/caption for accessibility */\n name: string;\n /** Total row count for aria-rowcount */\n rowCount: number;\n /** Total column count for aria-colcount */\n colCount: number;\n /** Test ID for testing purposes */\n \"data-testid\"?: string;\n}\n\n/**\n * Root table element with styling and ARIA attributes.\n * Wraps table content with proper accessibility semantics.\n *\n * @see {@link TableRootProps}\n */\nexport const TableRoot = ({\n children,\n name,\n rowCount,\n colCount,\n \"data-testid\": testId,\n}: TableRootProps) => {\n return (\n <table\n className=\"proton-Table\"\n role=\"table\"\n aria-rowcount={rowCount}\n aria-colcount={colCount}\n aria-label={name}\n data-testid={testId}\n >\n <caption className=\"proton-Table__caption\">{name}</caption>\n {children}\n </table>\n );\n};\n\nTableRoot.displayName = \"ProtonUITableRoot\";\n"],"names":["TableRoot","children","name","rowCount","colCount","testId","jsxs","jsx"],"mappings":"qJAqBaA,EAAY,CAAC,CACxB,SAAAC,EACA,KAAAC,EACA,SAAAC,EACA,SAAAC,EACA,cAAeC,CACjB,IAEIC,EAAA,kBAAA,KAAC,QAAA,CACC,UAAU,eACV,KAAK,QACL,gBAAeH,EACf,gBAAeC,EACf,aAAYF,EACZ,cAAaG,EAEb,SAAA,CAACE,EAAA,kBAAA,IAAA,UAAA,CAAQ,UAAU,wBAAyB,SAAKL,EAAA,EAChDD,CAAA,CAAA,CAAA,EAKPD,EAAU,YAAc"}
@@ -0,0 +1,27 @@
1
+ import { j as t } from "../../../../node_modules/react/jsx-runtime.es.js";
2
+ const s = ({
3
+ children: o,
4
+ name: a,
5
+ rowCount: e,
6
+ colCount: r,
7
+ "data-testid": l
8
+ }) => /* @__PURE__ */ t.jsxs(
9
+ "table",
10
+ {
11
+ className: "proton-Table",
12
+ role: "table",
13
+ "aria-rowcount": e,
14
+ "aria-colcount": r,
15
+ "aria-label": a,
16
+ "data-testid": l,
17
+ children: [
18
+ /* @__PURE__ */ t.jsx("caption", { className: "proton-Table__caption", children: a }),
19
+ o
20
+ ]
21
+ }
22
+ );
23
+ s.displayName = "ProtonUITableRoot";
24
+ export {
25
+ s as TableRoot
26
+ };
27
+ //# sourceMappingURL=TableRoot.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableRoot.es.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableRoot.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nexport interface TableRootProps {\n /** Table content (thead, tbody) */\n children: ReactNode;\n /** Table name/caption for accessibility */\n name: string;\n /** Total row count for aria-rowcount */\n rowCount: number;\n /** Total column count for aria-colcount */\n colCount: number;\n /** Test ID for testing purposes */\n \"data-testid\"?: string;\n}\n\n/**\n * Root table element with styling and ARIA attributes.\n * Wraps table content with proper accessibility semantics.\n *\n * @see {@link TableRootProps}\n */\nexport const TableRoot = ({\n children,\n name,\n rowCount,\n colCount,\n \"data-testid\": testId,\n}: TableRootProps) => {\n return (\n <table\n className=\"proton-Table\"\n role=\"table\"\n aria-rowcount={rowCount}\n aria-colcount={colCount}\n aria-label={name}\n data-testid={testId}\n >\n <caption className=\"proton-Table__caption\">{name}</caption>\n {children}\n </table>\n );\n};\n\nTableRoot.displayName = \"ProtonUITableRoot\";\n"],"names":["TableRoot","children","name","rowCount","colCount","testId","jsxs","jsx"],"mappings":";AAqBO,MAAMA,IAAY,CAAC;AAAA,EACxB,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,eAAeC;AACjB,MAEIC,gBAAAA,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,iBAAeH;AAAA,IACf,iBAAeC;AAAA,IACf,cAAYF;AAAA,IACZ,eAAaG;AAAA,IAEb,UAAA;AAAA,MAACE,gBAAAA,EAAA,IAAA,WAAA,EAAQ,WAAU,yBAAyB,UAAKL,GAAA;AAAA,MAChDD;AAAA,IAAA;AAAA,EAAA;AAAA;AAKPD,EAAU,cAAc;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../../../../node_modules/react/jsx-runtime.cjs.js"),o=({ariaRowIndex:r,onClick:e,children:a,dataTestId:n})=>s.jsxRuntimeExports.jsx("tr",{className:"proton-Table__row",role:"row","aria-rowindex":r,onClick:e,tabIndex:e?0:void 0,onKeyDown:e?t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),e())}:void 0,"data-testid":n,children:a});o.displayName="ProtonUITableRow";exports.TableRow=o;
2
+ //# sourceMappingURL=TableRow.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableRow.cjs.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableRow.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nexport interface TableRowProps {\n /** 1-based row index for aria-rowindex */\n ariaRowIndex: number;\n /** Click handler for interactive rows */\n onClick?: () => void;\n /** Row content (TableCell elements) */\n children: ReactNode;\n /** Test ID for testing purposes */\n dataTestId?: string;\n}\n\n/**\n * Table row element (`<tr>`) with styling, ARIA attributes, and keyboard support.\n *\n * @see {@link TableRowProps}\n */\nexport const TableRow = ({\n ariaRowIndex,\n onClick,\n children,\n dataTestId,\n}: TableRowProps) => {\n return (\n <tr\n className=\"proton-Table__row\"\n role=\"row\"\n aria-rowindex={ariaRowIndex}\n onClick={onClick}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n data-testid={dataTestId}\n >\n {children}\n </tr>\n );\n};\n\nTableRow.displayName = \"ProtonUITableRow\";\n"],"names":["TableRow","ariaRowIndex","onClick","children","dataTestId","jsx","e"],"mappings":"qJAkBaA,EAAW,CAAC,CACvB,aAAAC,EACA,QAAAC,EACA,SAAAC,EACA,WAAAC,CACF,IAEIC,EAAA,kBAAA,IAAC,KAAA,CACC,UAAU,oBACV,KAAK,MACL,gBAAeJ,EACf,QAAAC,EACA,SAAUA,EAAU,EAAI,OACxB,UACEA,EACKI,GAAM,EACDA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,OACjCA,EAAE,eAAe,EACTJ,IAGZ,EAAA,OAEN,cAAaE,EAEZ,SAAAD,CAAA,CAAA,EAKPH,EAAS,YAAc"}
@@ -0,0 +1,26 @@
1
+ import { j as s } from "../../../../node_modules/react/jsx-runtime.es.js";
2
+ const n = ({
3
+ ariaRowIndex: r,
4
+ onClick: e,
5
+ children: t,
6
+ dataTestId: a
7
+ }) => /* @__PURE__ */ s.jsx(
8
+ "tr",
9
+ {
10
+ className: "proton-Table__row",
11
+ role: "row",
12
+ "aria-rowindex": r,
13
+ onClick: e,
14
+ tabIndex: e ? 0 : void 0,
15
+ onKeyDown: e ? (o) => {
16
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), e());
17
+ } : void 0,
18
+ "data-testid": a,
19
+ children: t
20
+ }
21
+ );
22
+ n.displayName = "ProtonUITableRow";
23
+ export {
24
+ n as TableRow
25
+ };
26
+ //# sourceMappingURL=TableRow.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableRow.es.js","sources":["../../../../../src/components/Table/BaseTable/elements/TableRow.tsx"],"sourcesContent":["import { ReactNode } from \"react\";\n\nexport interface TableRowProps {\n /** 1-based row index for aria-rowindex */\n ariaRowIndex: number;\n /** Click handler for interactive rows */\n onClick?: () => void;\n /** Row content (TableCell elements) */\n children: ReactNode;\n /** Test ID for testing purposes */\n dataTestId?: string;\n}\n\n/**\n * Table row element (`<tr>`) with styling, ARIA attributes, and keyboard support.\n *\n * @see {@link TableRowProps}\n */\nexport const TableRow = ({\n ariaRowIndex,\n onClick,\n children,\n dataTestId,\n}: TableRowProps) => {\n return (\n <tr\n className=\"proton-Table__row\"\n role=\"row\"\n aria-rowindex={ariaRowIndex}\n onClick={onClick}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n data-testid={dataTestId}\n >\n {children}\n </tr>\n );\n};\n\nTableRow.displayName = \"ProtonUITableRow\";\n"],"names":["TableRow","ariaRowIndex","onClick","children","dataTestId","jsx","e"],"mappings":";AAkBO,MAAMA,IAAW,CAAC;AAAA,EACvB,cAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AACF,MAEIC,gBAAAA,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,iBAAeJ;AAAA,IACf,SAAAC;AAAA,IACA,UAAUA,IAAU,IAAI;AAAA,IACxB,WACEA,IACI,CAACI,MAAM;AACL,OAAIA,EAAE,QAAQ,WAAWA,EAAE,QAAQ,SACjCA,EAAE,eAAe,GACTJ;IAGZ,IAAA;AAAA,IAEN,eAAaE;AAAA,IAEZ,UAAAD;AAAA,EAAA;AAAA;AAKPH,EAAS,cAAc;"}